summaryrefslogtreecommitdiffstats
path: root/src/Runtime/ogl-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/Runtime/ogl-runtime')
m---------src/Runtime/ogl-runtime0
-rw-r--r--src/Runtime/ogl-runtime/commoninclude.pri82
-rw-r--r--src/Runtime/ogl-runtime/commonplatform.pri307
-rw-r--r--src/Runtime/ogl-runtime/ogl-runtime.pro6
-rw-r--r--src/Runtime/ogl-runtime/platformres.qrc4
-rw-r--r--src/Runtime/ogl-runtime/res.qrc117
-rw-r--r--src/Runtime/ogl-runtime/res/DataModelMetadata/en-us/MetaData.xml567
-rw-r--r--src/Runtime/ogl-runtime/res/Font/TitilliumWeb-Regular.ttfbin63752 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/Fxaa3_11.glsllib2073
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/Fxaa3_8.glsllib1423
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/SMAA.glsllib1444
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/SSAOCustomMaterial.glsllib91
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/abbeNumberIOR.glsllib36
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/anisotropyConversion.glsllib46
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/average.glsllib35
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/blendColorLayers.glsllib45
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/blur.glsllib295
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/calculateRoughness.glsllib63
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/coordinateSource.glsllib55
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/cube.glsllib50
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/customCurveLayer.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/customMaterial.glsllib47
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBody.glsllib84
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBodyAO.glsllib90
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialBumpNoLod.glsllib52
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileBumpTexture.glsllib40
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib40
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileNormalTexture.glsllib40
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFresnel.glsllib44
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialLighting.glsllib80
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib43
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/depthpass.glsllib80
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/dfTint.glsllib35
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/diffuseReflectionBSDF.glsllib66
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/diffuseTransmissionBSDF.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/directionalFactor.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.frag28
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.vert77
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.frag13
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.vert15
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.frag47
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.vert88
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.frag30
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.vert25
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/effect.glsllib148
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/evalBakedShadowMap.glsllib36
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/evalEnvironmentMap.glsllib55
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/evalLightmaps.glsllib56
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/fileBumpTexture.glsllib119
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/fileDisplacementTexture.glsllib71
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/fileTexture.glsllib48
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/flakeNoiseBumpTexture.glsllib46
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/flakeNoiseTexture.glsllib66
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/fresnelLayer.glsllib109
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcareaLightVars.glsllib32
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funccalculateDiffuseAreaOld.glsllib29
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib4
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funccomputeMicroHit.glsllib50
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionBSDF.glsllib43
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib5
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcgetTransformedUVCoords.glsllib4
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcsampleAreaGlossyDefault.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcsampleLightVars.glsllib29
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/funcspecularBSDF.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/SSAOCustomMaterial.glsllib100
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/defaultMaterialBumpNoLod.glsllib52
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/evalEnvironmentMap.glsllib37
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib29
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/funcsampleLightVars.glsllib27
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/microfacetBSDF.glsllib233
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/monoChannel.glsllib58
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/refraction.glsllib87
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/sampleProbe.glsllib482
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/shadowMapping.glsllib106
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/tangentSpaceNormalTexture.glsllib97
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gradient3Recolor.glsllib73
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gradient3Texture.glsllib36
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gradientGetPosition.glsllib76
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/luminance.glsllib62
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/miNoise.glsllib113
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/microfacetBSDF.glsllib259
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/monoChannel.glsllib58
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/normalizedMix.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/perlinNoise.glsllib234
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/perlinNoiseBumpTexture.glsllib49
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/perlinNoiseTexture.glsllib11
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/physGlossyBSDF.glsllib159
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/random255.glsllib56
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/refraction.glsllib87
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/rotationTranslationScale.glsllib50
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/sampleArea.glsllib180
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/sampleLight.glsllib130
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/sampleProbe.glsllib473
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/screenSpaceAO.glsllib150
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/screenSpaceDO.glsllib158
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/shadowMapping.glsllib106
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/shadowMappingFragment.glsllib10
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/simpleGlossyBSDF.glsllib99
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/specularBSDF.glsllib47
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/spotEdf.glsllib42
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/square.glsllib35
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tangentSpaceNormalTexture.glsllib91
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationLinear.glsllib104
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationLinearCM.glsllib174
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationNPatch.glsllib290
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationNPatchCM.glsllib194
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationPath.glsllib183
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationPhong.glsllib170
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/tessellationPhongCM.glsllib179
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/textureCoordinateInfo.glsllib54
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/transformCoordinate.glsllib43
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/vertexFragmentBase.glsllib61
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/viewProperties.glsllib41
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/weightedLayer.glsllib35
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/wireframeCM.glsllib169
-rw-r--r--src/Runtime/ogl-runtime/res/primitives/Cone.meshbin5352 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/res/primitives/Cube.meshbin1764 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/res/primitives/Cylinder.meshbin15908 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/res/primitives/Rectangle.meshbin900 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/res/primitives/Sphere.meshbin177980 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/3rdparty.pro5
m---------src/Runtime/ogl-runtime/src/3rdparty/EASTL0
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/color/CColor.cpp719
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/color/CColor.h298
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2.h677
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2ext.h2946
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2platform.h30
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3.h1213
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl31.h1528
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl32.h1829
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3ext.h24
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3platform.h30
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/gl.h1543
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glcorearb.h4533
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glew.h16126
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glext.h11163
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glfuncdef.h343
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glu.h607
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glut.h771
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glx.h357
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxew.h1587
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxext.h941
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/nvogldebug.h794
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglew.h1363
-rw-r--r--src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglext.h421
-rw-r--r--src/Runtime/ogl-runtime/src/api/api.pro5
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue.cpp346
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue_p.h172
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.cpp403
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.h94
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput_p.h83
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.cpp225
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.h83
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput_p.h75
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.cpp284
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.h79
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dselement_p.h77
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.cpp152
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.h117
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry_p.h67
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator.cpp56
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator_p.h67
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread.cpp190
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread_p.h90
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.cpp1770
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.h152
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation_p.h119
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.cpp436
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.h83
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement_p.h81
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.cpp688
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.h116
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer_p.h105
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.cpp401
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.h104
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings_p.h88
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/qstudio3dglobal.h49
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/studio3d.pro56
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/studioutils.cpp56
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/studioutils_p.h52
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy.cpp59
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy_p.h57
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.cpp62
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.h60
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem.cpp158
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem_p.h77
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer.cpp458
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer_p.h110
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d.cpp535
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d_p.h137
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/qmldir3
-rw-r--r--src/Runtime/ogl-runtime/src/api/studio3dqml/studio3dqml.pro34
-rw-r--r--src/Runtime/ogl-runtime/src/commoninclude.pri1
-rw-r--r--src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerCustomMaterialParser.h80
-rw-r--r--src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerRenderPluginParser.h80
-rw-r--r--src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerScriptParser.h137
-rw-r--r--src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.cpp998
-rw-r--r--src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.h386
-rw-r--r--src/Runtime/ogl-runtime/src/dm/EASTL_new.cpp40
-rw-r--r--src/Runtime/ogl-runtime/src/dm/Qt3DSDMPrefix.h81
-rw-r--r--src/Runtime/ogl-runtime/src/dm/dm.pro58
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.cpp131
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.h84
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/HandleSystemBase.h169
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/HandleSystemTransactions.h88
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionCore.h99
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionInfo.h96
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionSystem.h68
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMAnimation.h841
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.cpp579
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.h956
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataCore.h320
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataTypes.h891
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMErrors.h308
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.cpp222
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.h102
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMHandles.h459
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.cpp4170
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.h400
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataTypes.h350
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataValue.h251
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMPropertyDefinition.h75
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructImpl.h305
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructs.h89
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.cpp184
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.h52
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignals.h611
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideCore.h239
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideGraphCore.h89
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlides.h202
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.cpp85
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.h71
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTestOps.h61
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTransactions.h244
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.cpp178
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.h341
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOps.h40
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOpsImpl.h761
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWindowsCompatibility.h182
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.cpp1253
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.h506
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.cpp1565
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.h50
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.cpp867
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.h179
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StandardExtensions.h196
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.cpp610
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.h134
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.cpp409
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.h94
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.cpp647
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.h164
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.cpp233
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.h132
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/VectorTransactions.h235
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.cpp289
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.h125
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.cpp488
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.h148
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.cpp457
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.h175
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.cpp240
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.h165
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.cpp618
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.h230
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.cpp574
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.h373
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.cpp420
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.h408
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.cpp169
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.h134
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.cpp562
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.h190
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.cpp245
-rw-r--r--src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.h98
-rw-r--r--src/Runtime/ogl-runtime/src/engine/EnginePrefix.h143
-rw-r--r--src/Runtime/ogl-runtime/src/engine/NVImageScaler.h311
-rw-r--r--src/Runtime/ogl-runtime/src/engine/OpenKodeInclude.h49
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSEGLInfo.h60
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSEGLWindowSystem.h81
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSPluginDLL.h128
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.cpp1919
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.h82
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImpl.h218
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp224
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp1841
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.cpp853
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.h237
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.cpp124
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.h81
-rw-r--r--src/Runtime/ogl-runtime/src/engine/Qt3DSWindowSystem.h57
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventFactory.cpp143
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventFactory.h87
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventPoller.cpp375
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventPoller.h103
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventPollingSystem.h87
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventSystem.h73
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventSystemC.cpp34
-rw-r--r--src/Runtime/ogl-runtime/src/event/EventSystemC.h139
-rw-r--r--src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.cpp259
-rw-r--r--src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.h56
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/AutoDeallocatorAllocator.h99
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/ConvertUTF.cpp661
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/ConvertUTF.h179
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/EASTL_new.cpp75
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/FastAllocator.h115
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/FileTools.cpp545
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/FileTools.h124
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/IOStreams.cpp384
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/IOStreams.h278
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/LICENCE_SOCKET.TXT20
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/LICENSE_CONVERTUTF.TXT19
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/PoolingAllocator.h177
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/PreAllocatedAllocator.h88
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DS.h59
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocator.h195
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocatorCallback.h100
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSAssert.h62
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSAtomic.h63
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSBasicTemplates.h113
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSBounds3.h443
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSBroadcastingAllocator.h113
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSContainers.h129
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSDataRef.h162
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSDiscriminatedUnion.h335
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSFPU.h97
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSFastIPC.h57
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSFlags.h360
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.cpp237
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.h120
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSIPC.h99
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSIndexableLinkedList.h309
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSIntrinsics.h50
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveLinkedList.h361
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveSet.h104
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.cpp44
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.h51
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMat33.h385
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMat44.h497
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMath.h323
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.cpp181
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.h571
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMemoryBuffer.h160
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSMutex.h376
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSNoCopy.h50
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSOption.h104
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.cpp163
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.h107
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSPlane.h134
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSPool.h159
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSPreprocessor.h375
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSQuat.h381
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSRefCounted.h199
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSSemaphore.h67
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSSimpleTypes.h125
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSStringTokenizer.h108
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSSync.h70
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.cpp139
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.h58
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSThread.h205
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSTime.h97
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSTransform.h195
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSUnionCast.h64
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSUtilities.h189
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSVec2.h321
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSVec3.h377
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSVec4.h373
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Qt3DSVersionNumber.h67
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/SerializationTypes.h132
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Socket.cpp472
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Socket.h79
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/StrConvertUTF.h213
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/StringConversion.h226
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/StringConversionImpl.h219
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/StringTable.cpp700
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/StringTable.h307
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/StringTools.h614
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/TaggedPointer.h80
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/ThreadSafeQueue.h111
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.cpp50
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.h252
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/Utils.h382
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/XML.cpp948
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/XML.h680
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/LICENSE.TXT7
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAoS.h157
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAtomic.cpp129
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFPU.cpp52
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFile.h48
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxInlineAoS.h2666
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxIntrinsics.h209
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxMutex.cpp120
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSemaphore.cpp146
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxString.h202
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSync.cpp137
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxThread.cpp384
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTime.cpp111
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTrigConstants.h96
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/SocketImpl.h424
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/linux/qt_attribution.json10
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixAtomic.cpp89
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixFPU.cpp61
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixMutex.cpp120
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSemaphore.cpp146
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSync.cpp137
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixTime.cpp108
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/qt_attribution.json22
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/LICENSE.TXT7
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAoS.h126
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAtomic.cpp93
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFPU.cpp61
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFile.h48
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInclude.h93
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInlineAoS.h2715
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsIntrinsics.h230
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsMutex.cpp149
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSemaphore.cpp72
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsString.h147
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSync.cpp74
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsThread.cpp241
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTime.cpp92
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTrigConstants.h93
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/SocketImpl.h506
-rw-r--r--src/Runtime/ogl-runtime/src/foundation/windows/qt_attribution.json10
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.cpp145
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.h77
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/GLComputeMipMap.h74
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/GLComputeMipmap.cpp394
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/HDR.cpp30
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/HDR.h239
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cpp265
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cu404
-rw-r--r--src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.h104
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportContainers.h88
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportLibPrecompile.h56
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.cpp829
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.h530
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMeshBuilder.cpp598
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.cpp152
-rw-r--r--src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.h87
-rw-r--r--src/Runtime/ogl-runtime/src/ogl-runtime-dylib/ogl-runtime-dylib.pro73
-rw-r--r--src/Runtime/ogl-runtime/src/ogl-runtime-static/ogl-runtime-static.pro656
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/NvVec.h316
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/misc.h130
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.cpp64
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.h45
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.cpp1030
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.h117
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.cpp199
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.h63
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.abcbin2048 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.ddsbin87509 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.abcbin2048 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.ddsbin349653 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.frag39
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.vert49
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_color.h107
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_debug.h86
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_global.h36
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/NvVec.h316
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/misc.h130
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.cpp64
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.h45
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.cpp1030
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.h118
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.cpp203
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.h64
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_types.h81
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.abcbin2048 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.ddsbin87509 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.abcbin2048 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.ddsbin349653 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.frag39
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.vert49
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_color.h107
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_debug.h86
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_global.h36
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/NvVec.h316
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/misc.h130
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.cpp64
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.h45
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.cpp1030
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.h117
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.cpp199
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.h63
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_types.h81
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.abcbin2048 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.ddsbin87509 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.abcbin2048 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.ddsbin349653 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.frag39
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.vert49
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_color.h107
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_config/nv_config.h278
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_debug.h86
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_global.h36
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/NvVec.h316
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/misc.h130
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.cpp64
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.h45
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.cpp1030
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.h117
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.cpp199
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.h63
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_types.h81
-rw-r--r--src/Runtime/ogl-runtime/src/platformspecific/windows/viewer/Resource.h43
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsincubationcontroller.h55
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.cpp106
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.h68
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamer_global.h41
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.cpp67
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.h52
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.cpp53
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.h61
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.cpp253
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.h79
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.cpp483
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.h124
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamservice.h80
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp78
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.h55
-rw-r--r--src/Runtime/ogl-runtime/src/qmlstreamer/qmlstreamer.pro50
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderClearColorExample.cpp63
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.cpp491
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.h123
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.cpp188
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.h89
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderRenderToTextureExample.cpp178
-rw-r--r--src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderSpinningCubeExample.cpp104
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.cpp156
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.h182
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.cpp57
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.h90
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.cpp1049
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.h2103
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.cpp55
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.h89
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.cpp421
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.h248
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.cpp1107
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.h1075
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.cpp158
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.h188
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.cpp91
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.h134
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.cpp104
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.h152
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawable.h54
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.cpp55
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.h89
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.cpp300
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.h277
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.cpp55
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.h89
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.cpp103
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.h143
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.cpp100
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.h138
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.cpp105
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.h157
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.cpp82
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.h120
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.cpp145
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.h165
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.cpp191
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.h139
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.cpp108
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.h114
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.cpp103
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.h141
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.cpp134
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.h138
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.cpp54
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.h127
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.cpp71
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.h94
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.cpp114
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.h158
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.cpp84
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.h124
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderShader.h123
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderConstant.h448
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.cpp1248
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.h540
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.cpp123
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.h158
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.cpp87
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.h132
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.cpp74
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.h132
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.cpp263
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.h165
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.cpp123
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.h106
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.cpp174
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.h177
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.cpp119
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.h106
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.cpp75
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.h129
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.cpp74
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.h124
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.cpp54
-rw-r--r--src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.h89
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/Qt3DSRenderBackend.h2245
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.cpp887
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.h193
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.cpp170
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.h392
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLPrefix.h48
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLTokens.h408
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLUtil.h2201
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.cpp785
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.h171
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.cpp875
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.h205
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.cpp2223
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.h531
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h146
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h173
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h105
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderContextGL.cpp91
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.cpp588
-rw-r--r--src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.h46
-rw-r--r--src/Runtime/ogl-runtime/src/render/glg/Qt3DSGLImplObjects.h83
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.cpp1027
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.h157
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.cpp432
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.h68
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.cpp2150
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.h261
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSApplicationValues.h369
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.cpp296
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.h286
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.txt249
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandEventTypes.h83
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.cpp129
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.h55
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.cpp487
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.h143
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.cpp141
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.h57
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.cpp855
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.h616
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSEvent.h62
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.cpp258
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.h135
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSFrameworkTypes.h52
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSIComponentManager.h147
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSIInputSystem.h62
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSIScene.h165
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSIScriptBridge.h206
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSIStateful.h69
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSIText.h52
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSInputDefs.h413
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.cpp849
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.h125
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEventTypes.h96
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSInputFrame.h118
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSKernelTypes.h225
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.cpp293
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.h60
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.cpp150
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.h123
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.cpp171
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.h66
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSPickFrame.h70
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.cpp841
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.h231
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.cpp105
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.h87
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.cpp323
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.h57
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp2636
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.h226
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSRuntimeFactory.h108
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSSceneManager.h167
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.cpp675
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.h161
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.cpp407
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.h124
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/RuntimePrefix.h104
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.cpp138
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.h49
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.cpp123
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.h83
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.cpp742
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.h109
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig.cpp122
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig_p.h79
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp517
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager.cpp75
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager_p.h75
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h101
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp1060
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.h171
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase.cpp106
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase_p.h82
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderKey.h153
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.cpp498
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.h256
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.cpp118
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.h102
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp421
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSQtTextRenderer.cpp655
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRender.h257
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.cpp85
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.h161
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.cpp858
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.h223
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialRenderContext.h94
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.cpp1265
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.h69
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp2131
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h174
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp1931
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.h123
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.cpp1532
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.h286
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemCommands.h622
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemUtil.h126
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.cpp1872
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.h209
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.cpp383
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.h142
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGpuProfiler.cpp284
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectPickQuery.h124
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.cpp670
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.h69
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectTypes.h166
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.cpp883
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.h121
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageTextureData.h138
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.cpp214
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.h69
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderLightConstantProperties.h198
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialHelpers.h94
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h152
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMesh.h187
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.cpp1964
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.h121
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathMath.h713
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathRenderContext.h94
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.cpp311
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.h54
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.cpp66
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.h103
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.cpp936
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.h148
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginCInterface.h330
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginGraphObject.h60
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginPropertyValue.h182
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderProfiler.h112
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.cpp164
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.h101
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.cpp124
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.h125
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRotationHelper.h193
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.cpp770
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.h160
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.cpp526
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.h175
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.cpp671
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.h140
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderKeys.h802
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.cpp219
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.h183
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubPresentationHelper.h69
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.cpp127
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.h110
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTaggedPointer.h85
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTessModeValues.h74
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.cpp126
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.h63
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.cpp289
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.h74
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTypes.h193
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.cpp364
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.h102
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.cpp277
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.h127
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.cpp2089
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.h133
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.cpp464
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.h485
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.cpp319
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.h181
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderableImage.h77
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderer.h249
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.cpp119
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.h62
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.cpp87
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.h150
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/android/DynamicLibLoader.h30
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.cpp496
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.h177
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCustomMaterial.h147
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.cpp74
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.h148
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.cpp160
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.h113
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.cpp61
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.h86
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderGraphObject.h77
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp151
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.h114
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.cpp105
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.h203
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.cpp55
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.h90
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.cpp41
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.h77
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderMaterialDirty.h61
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.cpp75
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.h76
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.cpp499
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.h307
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.cpp59
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.h156
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPathSubPath.h65
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.cpp43
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.h94
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderReferencedMaterial.h63
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp122
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.h84
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.cpp68
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.h76
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/linux/DynamicLibLoader.h92
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/macos/DynamicLibLoader.h30
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.cpp144
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.h101
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/qnx/DynamicLibLoader.h30
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.cpp543
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.h472
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp2051
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h549
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp2220
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.h182
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.cpp261
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.h115
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp1479
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h367
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp3007
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.h452
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSVertexPipelineImpl.h463
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.cpp326
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.h85
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp1092
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h119
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.cpp541
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.h96
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp715
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.h184
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureBMP.cpp1262
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.cpp695
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.h88
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureFreeImageCompat.h413
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureGIF.cpp851
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureHDR.cpp255
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.cpp277
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.h39
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.cpp599
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.h129
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.cpp101
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.h96
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.cpp436
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.h81
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.cpp174
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.h126
-rw-r--r--src/Runtime/ogl-runtime/src/runtimerender/windows/DynamicLibLoader.h80
-rw-r--r--src/Runtime/ogl-runtime/src/src.pro10
-rw-r--r--src/Runtime/ogl-runtime/src/state/Qt3DSState.h94
-rw-r--r--src/Runtime/ogl-runtime/src/state/Qt3DSStateScriptContext.h123
-rw-r--r--src/Runtime/ogl-runtime/src/state/Qt3DSStateTypes.h97
-rw-r--r--src/Runtime/ogl-runtime/src/state/Qt3DSStateVisualBindingContextCommands.h348
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSArray.h135
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSArray.inl287
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSAssert.cpp93
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSAssert.h78
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSAudioPlayer.h42
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSBasicPluginDLL.h67
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSBezierEval.h182
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.cpp150
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.h85
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.h102
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.inl225
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSColor.cpp95
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSColor.h85
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSConfig.h49
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.cpp38
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.h78
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSCubicRootsImpl.h177
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.cpp220
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.h96
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.cpp151
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.h226
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.hpp96
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerEnums.h117
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerViewer.h71
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSEGLTimer.h70
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSEndian.h38
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.cpp390
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.h141
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFNDTimer.h44
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFile.cpp77
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFile.h94
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.cpp237
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.h93
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.h87
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.inl150
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.cpp65
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.h416
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSHash.h105
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSIFileStream.h56
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSIStream.h162
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSITimer.h61
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMacros.h189
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.cpp897
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.h146
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemory.cpp137
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemory.h183
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.cpp126
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.h69
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.cpp236
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.h133
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.cpp453
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.h133
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.cpp298
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.h104
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.cpp149
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.h144
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemorySettings.h131
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.cpp647
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.h137
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.cpp164
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.h104
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSPlatformSpecific.h207
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSTimer.cpp116
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSTimer.h142
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSTypes.cpp54
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSTypes.h121
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSVector3.cpp466
-rw-r--r--src/Runtime/ogl-runtime/src/system/Qt3DSVector3.h117
-rw-r--r--src/Runtime/ogl-runtime/src/system/SystemPrefix.h92
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSIPresentation.h158
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParser.h154
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.cpp738
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.h172
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.cpp2610
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.h672
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp1005
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.h159
-rw-r--r--src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.cpp60
-rw-r--r--src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.h48
-rw-r--r--src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.cpp993
-rw-r--r--src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.h524
-rw-r--r--src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerTimer.h120
-rw-r--r--src/Runtime/ogl-runtime/src/viewer/qt3dsruntimeglobal.h45
-rw-r--r--src/Runtime/ogl-runtime/testres.qrc14
-rw-r--r--src/Runtime/ogl-runtime/tools/attributehashes/AttributeHashes.cpp344
-rw-r--r--src/Runtime/ogl-runtime/tools/attributehashes/attributehashes.pro16
-rw-r--r--src/Runtime/ogl-runtime/tools/tools.pro10
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/Viewer.qrc14
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/android/AndroidManifest.xml77
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/main.cpp384
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/qml/StyledButton.qml52
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenu.qml95
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuButton.qml71
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuItem.qml159
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuSeparator.qml47
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/qml/main.qml594
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.cpp202
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.h79
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.icobin112324 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.svg38
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow.pngbin523 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow@2x.pngbin600 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/check.pngbin502 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/check@2x.pngbin638 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/resources/images/viewer.icnsbin161003 -> 0 bytes
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/viewer.cpp416
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/viewer.h128
-rw-r--r--src/Runtime/ogl-runtime/tools/viewer/viewer.pro49
-rw-r--r--src/Runtime/ogl-runtime/utils.pri8
984 files changed, 0 insertions, 289374 deletions
diff --git a/src/Runtime/ogl-runtime b/src/Runtime/ogl-runtime
new file mode 160000
+Subproject 427fddb50d43aa21a90fc7356ee3cdd8a908df5
diff --git a/src/Runtime/ogl-runtime/commoninclude.pri b/src/Runtime/ogl-runtime/commoninclude.pri
deleted file mode 100644
index 3940e4d3..00000000
--- a/src/Runtime/ogl-runtime/commoninclude.pri
+++ /dev/null
@@ -1,82 +0,0 @@
-include($$PWD/commonplatform.pri)
-
-contains(TEMPLATE, lib) {
- load(qt_helper_lib)
- # qt_helper_lib assumes non-qt lib, so it clears qt from config - reset that
- CONFIG += qt exceptions
-}
-QT += core gui openglextensions
-
-DEFINES += COMPILED_FROM_DSP \
- QT3DSDM_USE_NVLOG QT3DSDM_META_DATA_NO_SIGNALS \
- QT3DS_AUTOTESTS_ENABLED
-
-INCLUDEPATH += \
- $$PWD/src \
- $$PWD/src/datamodel \
- $$PWD/src/runtime \
- $$PWD/src/system \
- $$PWD/src/engine \
- $$PWD/src/foundation \
- $$PWD/src/render \
- $$PWD/src/render/gl2 \
- $$PWD/src/render/gl3 \
- $$PWD/src/render/glg \
- $$PWD/src/uipparser \
- $$PWD/src/state \
- $$PWD/src/event \
- $$PWD/src/viewer \
- $$PWD/src/viewer/perflog \
- $$PWD/src/importlib \
- $$PWD/src/dm \
- $$PWD/src/dm/systems \
- $$PWD/src/dm/systems/cores \
- $$PWD/src/3rdparty/EASTL/UnknownVersion/include \
- $$PWD/src/3rdparty/platformspecific/$$PlatformSpecificDir/PlatformLibs \
- $$PWD/src/qmlstreamer \
- $$PWD/src/runtimerender \
- $$PWD/src/runtimerender/graphobjects \
- $$PWD/src/runtimerender/resourcemanager \
-
-# TODO: Investigate whether these can be moved to commonplatform
-win32-msvc {
- CONFIG += nostrictstrings
- QMAKE_CXXFLAGS += /EHsc /GA
- QMAKE_CFLAGS += /EHsc /GA
-}
-
-win32 {
-INCLUDEPATH += \
- $$PWD/src/platformspecific/windows/libs \
- $$PWD/src/3rdparty/platformspecific/Windows/Qt3DSLibs
-}
-
-linux|qnx {
-QMAKE_CXXFLAGS += -fpermissive
-QMAKE_CFLAGS += -fpermissive
-INCLUDEPATH += \
- $$PWD/src/foundation/linux \
- $$PWD/src/platformspecific/linux/libs \
- $$PWD/src/3rdparty/platformspecific/Linux/Qt3DSLibs
-}
-
-integrity {
-INCLUDEPATH += \
- $$PWD/src/foundation/linux \
- $$PWD/src/platformspecific/linux/libs \
- $$PWD/src/3rdparty/platformspecific/Linux/Qt3DSLibs
-}
-
-macos {
-INCLUDEPATH += \
- $$PWD/src/3rdparty/platformspecific/Macos/Qt3DSLibs \
- $$PWD/src/platformspecific/macos/libs
-
-}
-
-android {
-INCLUDEPATH += \
- $$PWD/src/platformspecific/android/jni/libs/nv_thread \
- $$PWD/src/3rdparty/platformspecific/Android/jni/Qt3DSLibs \
- $$PWD/src/3rdparty/platformspecific/Android/jni
-}
diff --git a/src/Runtime/ogl-runtime/commonplatform.pri b/src/Runtime/ogl-runtime/commonplatform.pri
deleted file mode 100644
index f5ff9e08..00000000
--- a/src/Runtime/ogl-runtime/commonplatform.pri
+++ /dev/null
@@ -1,307 +0,0 @@
-load(qt_build_config)
-load(qt_build_paths)
-
-# Common defines across platforms that should be checked if/where they are used
-# as we remove dependencies to see where we can reduce
-DEFINES += \
- QT3DS_FOUNDATION_NO_EXPORTS \
- _CRT_SECURE_NO_DEPRECATE \
- _CRT_NONSTDC_NO_DEPRECATE \
- QT3DS_GRAPHICS_API_GL \
- QT3DS_NO_SEARCH_PATH \
- QT3DS_RENDER_ENABLE_LOAD_UIP \
- FONT_NO_RES_DIR \
- _TEGRA_NO_LOG_FILE \
- EA_COMPILER_HAS_INTTYPES \
- EASTL_ALLOCATOR_COPY_ENABLED \
- UNICODE \
- _UNICODE \
- NO_BOOST
-
-win32: PlatformSpecificDir = windows
-macos: PlatformSpecificDir = macos
-linux|integrity|qnx: PlatformSpecificDir = linux
-android: PlatformSpecificDir = android/jni
-
-integrity: {
- DEFINES += _LINUX
- DEFINES += _INTEGRITYPLATFORM
-}
-
-INCLUDEPATH += $$PWD/src/platformspecific/$$PlatformSpecificDir
-
-THIRDPARTY_DIR = $$(QT3DSTUDIO_3RDPARTY_DIR)
-isEmpty(THIRDPARTY_DIR) {
- THIRDPARTY_DIR = $$PWD/3rdparty
-}
-
-contains(QT_ARCH, x86_64) {
- DEFINES += QT3DS_PROCESSOR_X64
-}
-
-CONFIG(debug, debug|release) {
- DEFINES += _DEBUG
-} else {
- DEFINES += NDEBUG
-}
-
-linux|qnx {
- CONFIG += egl
- DEFINES+=_LINUX QT3DS_OS_LINUX _LINUXPLATFORM QT3DS_NO_X11 \
- QT3DS_VIEWER_EXPORTS WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
- QMAKE_CXXFLAGS_WARN_ON = -Wall -Wno-unused-local-typedefs
-}
-
-linux-clang {
- DEFINES += __STRICT_ANSI__
-}
-
-macos {
- DEFINES += _MACOSX _LINUXPLATFORM WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
- INCLUDEPATH += /usr/local/include
-
-# macOS builds treat most warnings as errors to prevent slipping more warnings
-# in to the code
-
-# Suppress large number of warnings from the Qt 3D Studio Code.
-# Suppressions have been reported in JIRA with these bugs:
-# QT3DS-2214 -Wno-unused-local-typedefs
-# QT3DS-2216 -Wno-inconsistent-missing-override
-# QT3DS-2222 -Wno-reorder
-# QT3DS-2223 -Wno-format
-# QT3DS-2224 -Wno-unused-function
-# QT3DS-2227 -Wno-unused-value
-# QT3DS-2229 -Wno-delete-non-virtual-dtor
-# QT3DS-2234 -Wno-unused-variable
-# QT3DS-2235 -Wno-overloaded-virtual
-# QT3DS-2237 -Wno-unused-private-field
-# QT3DS-2238 -Wno-comment
-# QT3DS-2240 -Wno-enum-compare
-# QT3DS-2241 -Wno-int-to-pointer-cast
-# QT3DS-2242 -Wno-int-to-void-pointer-cast
-# QT3DS-2244 -Wno-unused-lambda-capture
-# QT3DS-2246 -Wno-deprecated-declarations
-# QT3DS-2247 -Wno-pointer-bool-conversion
-# QT3DS-2248 -Wno-self-assign
-# QT3DS-2249 -Wno-tautological-compare
-# QT3DS-2251 -Wno-tautological-constant-out-of-range-compare
- QMAKE_CXXFLAGS_WARN_ON = -Wall \
- -Werror \
- -Wno-unknown-pragmas \
- -Wno-unused-local-typedefs \
- -Wno-inconsistent-missing-override \
- -Wno-reorder \
- -Wno-format \
- -Wno-unused-function \
- -Wno-unused-value \
- -Wno-delete-non-virtual-dtor \
- -Wno-unused-variable \
- -Wno-overloaded-virtual \
- -Wno-unused-private-field \
- -Wno-comment \
- -Wno-enum-compare \
- -Wno-int-to-pointer-cast \
- -Wno-int-to-void-pointer-cast \
- -Wno-unused-lambda-capture \
- -Wno-deprecated-declarations \
- -Wno-pointer-bool-conversion \
- -Wno-self-assign \
- -Wno-tautological-compare \
- -Wno-tautological-constant-out-of-range-compare \
- -Wno-mismatched-tags \
- -Wno-pragma-pack \
- -Wno-error=unused-local-typedefs \
- -Wno-error=inconsistent-missing-override \
- -Wno-error=reorder \
- -Wno-error=format \
- -Wno-error=unused-function \
- -Wno-error=unused-value \
- -Wno-error=delete-non-virtual-dtor \
- -Wno-error=unused-variable \
- -Wno-error=overloaded-virtual \
- -Wno-error=unused-private-field \
- -Wno-error=comment \
- -Wno-error=enum-compare \
- -Wno-error=int-to-pointer-cast \
- -Wno-error=int-to-void-pointer-cast \
- -Wno-error=unused-lambda-capture \
- -Wno-error=deprecated-declarations \
- -Wno-error=pointer-bool-conversion \
- -Wno-error=self-assign \
- -Wno-error=tautological-compare \
- -Wno-error=tautological-constant-out-of-range-compare \
- -Wno-error=switch \
- -Wno-error=mismatched-tags \
- -Wno-error=logical-op-parentheses \
- -Wno-error=pragmas \
- -Wno-error=pragma-pack \
- -Wno-error=mismatched-tags
-
- QMAKE_CFLAGS_WARN_ON = -Wall \
- -Werror \
- -Wno-unknown-pragmas \
- -Wno-unused-local-typedefs \
- -Wno-inconsistent-missing-override \
- -Wno-reorder \
- -Wno-format \
- -Wno-unused-function \
- -Wno-unused-value \
- -Wno-delete-non-virtual-dtor \
- -Wno-unused-variable \
- -Wno-overloaded-virtual \
- -Wno-unused-private-field \
- -Wno-comment \
- -Wno-enum-compare \
- -Wno-int-to-pointer-cast \
- -Wno-int-to-void-pointer-cast \
- -Wno-unused-lambda-capture \
- -Wno-deprecated-declarations \
- -Wno-pointer-bool-conversion \
- -Wno-self-assign \
- -Wno-tautological-compare \
- -Wno-tautological-constant-out-of-range-compare \
- -Wno-mismatched-tags \
- -Wno-pragma-pack \
- -Wno-error=unused-local-typedefs \
- -Wno-error=inconsistent-missing-override \
- -Wno-error=reorder \
- -Wno-error=format \
- -Wno-error=unused-function \
- -Wno-error=unused-value \
- -Wno-error=delete-non-virtual-dtor \
- -Wno-error=unused-variable \
- -Wno-error=overloaded-virtual \
- -Wno-error=unused-private-field \
- -Wno-error=comment \
- -Wno-error=enum-compare \
- -Wno-error=int-to-pointer-cast \
- -Wno-error=int-to-void-pointer-cast \
- -Wno-error=unused-lambda-capture \
- -Wno-error=deprecated-declarations \
- -Wno-error=pointer-bool-conversion \
- -Wno-error=self-assign \
- -Wno-error=tautological-compare \
- -Wno-error=tautological-constant-out-of-range-compare \
- -Wno-error=switch \
- -Wno-error=mismatched-tags \
- -Wno-error=logical-op-parentheses \
- -Wno-error=pragmas \
- -Wno-error=pragma-pack \
- -Wno-error=mismatched-tags
-
-# Suppress the huge pile of Qt related warnings on "direct access in function
-# from file to global weak symbol". These arise when not using devbuilds of Qt.
- QMAKE_CXXFLAGS += -fvisibility=hidden
- QMAKE_CFLAGS += -fvisibility=hidden
-}
-
-clang {
-# Suppress large number of warnings from the Qt 3D Studio Code.
-# Suppressions have been reported in JIRA with bugs
- QMAKE_CXXFLAGS_WARN_ON = -Wall \
- -Wno-unknown-pragmas \
- -Wno-unused-local-typedefs \
- -Wno-inconsistent-missing-override \
- -Wno-reorder \
- -Wno-format \
- -Wno-unused-function \
- -Wno-unused-value \
- -Wno-delete-non-virtual-dtor \
- -Wno-unused-variable \
- -Wno-overloaded-virtual \
- -Wno-unused-private-field \
- -Wno-comment \
- -Wno-enum-compare \
- -Wno-int-to-pointer-cast \
- -Wno-int-to-void-pointer-cast \
- -Wno-unused-lambda-capture \
- -Wno-deprecated-declarations \
- -Wno-pointer-bool-conversion \
- -Wno-self-assign \
- -Wno-tautological-compare \
- -Wno-tautological-constant-out-of-range-compare \
- -Wno-mismatched-tags \
- -Wno-pragma-pack
-
- QMAKE_CFLAGS_WARN_ON = -Wall \
- -Wno-unknown-pragmas \
- -Wno-unused-local-typedefs \
- -Wno-inconsistent-missing-override \
- -Wno-reorder \
- -Wno-format \
- -Wno-unused-function \
- -Wno-unused-value \
- -Wno-delete-non-virtual-dtor \
- -Wno-unused-variable \
- -Wno-overloaded-virtual \
- -Wno-unused-private-field \
- -Wno-comment \
- -Wno-enum-compare \
- -Wno-int-to-pointer-cast \
- -Wno-int-to-void-pointer-cast \
- -Wno-unused-lambda-capture \
- -Wno-deprecated-declarations \
- -Wno-pointer-bool-conversion \
- -Wno-self-assign \
- -Wno-tautological-compare \
- -Wno-tautological-constant-out-of-range-compare \
- -Wno-mismatched-tags \
- -Wno-pragma-pack
-
-# Suppress the huge pile of Qt related warnings on "direct access in function
-# from file to global weak symbol". These arise when not using devbuilds of Qt.
- QMAKE_CXXFLAGS += -fvisibility=hidden
- QMAKE_CFLAGS += -fvisibility=hidden
-}
-
-android {
- QMAKE_CXXFLAGS -= -fstack-protector-strong
- QMAKE_CFLAGS -= -fstack-protector-strong
- # TODO: Should be done using this instead of copying the GLES headers, but including this
- # causes lots of conflicting definitions in signal.h for some reason. Feel free to fix it if
- # you know how. After this works, GLES3 and GLES2 folders can be deleted from
- # 3rdparty/RuntimePlatformSpecific/Android/jni
-# INCLUDEPATH += $$(ANDROID_NDK_ROOT)/sysroot/usr/include
-# DEFINES += __BITS_PER_LONG=32
-}
-
-win32 {
- DEFINES += QT3DS_OS_WINDOWS _WIN32 _PCPLATFORM \
- WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T KDWIN NOMINMAX
-
- win32-msvc {
- QMAKE_CXXFLAGS += /MP /d2Zi+
- QMAKE_CFLAGS += /MP /d2Zi+
- # Warning C4251 = needs to have dll-interface to be used by clients of class,
- # it comes from a lot of Qt headers, so disabling it.
- QMAKE_CXXFLAGS_WARN_ON += -wd4251 #needs to have dll-interface to be used by clients
- }
-
- CONFIG(debug, debug|release) {
- win32-msvc {
- QMAKE_CXXFLAGS += /Od
- QMAKE_CFLAGS += /Od
- }
- } else {
- win32-msvc {
- QMAKE_CXXFLAGS += /Ox
- QMAKE_CFLAGS += /Ox
- }
- }
-
- contains(QT_ARCH, x86_64) {
- DEFINES += _WIN64
- }
-}
-
-BINDIR = $$MODULE_BASE_OUTDIR/bin
-LIBDIR = $$MODULE_BASE_OUTDIR/lib
-LIBS += -L"$$LIBDIR"
-!testcase {
- contains(TEMPLATE, app) {
- DESTDIR = $$BINDIR
- } else {
- DESTDIR = $$LIBDIR
- win32: DLLDESTDIR = $$BINDIR
- }
-}
diff --git a/src/Runtime/ogl-runtime/ogl-runtime.pro b/src/Runtime/ogl-runtime/ogl-runtime.pro
deleted file mode 100644
index 6bb3d181..00000000
--- a/src/Runtime/ogl-runtime/ogl-runtime.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS += \
- src \
- tools
diff --git a/src/Runtime/ogl-runtime/platformres.qrc b/src/Runtime/ogl-runtime/platformres.qrc
deleted file mode 100644
index af8a564b..00000000
--- a/src/Runtime/ogl-runtime/platformres.qrc
+++ /dev/null
@@ -1,4 +0,0 @@
-<RCC>
- <qresource prefix="/">
- </qresource>
-</RCC>
diff --git a/src/Runtime/ogl-runtime/res.qrc b/src/Runtime/ogl-runtime/res.qrc
deleted file mode 100644
index c5c59b29..00000000
--- a/src/Runtime/ogl-runtime/res.qrc
+++ /dev/null
@@ -1,117 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>res/DataModelMetadata/en-us/MetaData.xml</file>
- <file>res/effectlib/abbeNumberIOR.glsllib</file>
- <file>res/effectlib/anisotropyConversion.glsllib</file>
- <file>res/effectlib/average.glsllib</file>
- <file>res/effectlib/blendColorLayers.glsllib</file>
- <file>res/effectlib/blur.glsllib</file>
- <file>res/effectlib/calculateRoughness.glsllib</file>
- <file>res/effectlib/coordinateSource.glsllib</file>
- <file>res/effectlib/cube.glsllib</file>
- <file>res/effectlib/customCurveLayer.glsllib</file>
- <file>res/effectlib/customMaterial.glsllib</file>
- <file>res/effectlib/customMaterialFragBody.glsllib</file>
- <file>res/effectlib/customMaterialFragBodyAO.glsllib</file>
- <file>res/effectlib/defaultMaterialFresnel.glsllib</file>
- <file>res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib</file>
- <file>res/effectlib/funcsampleAreaGlossyDefault.glsllib</file>
- <file>res/effectlib/funccomputeMicroHit.glsllib</file>
- <file>res/effectlib/funcgetTransformedUVCoords.glsllib</file>
- <file>res/effectlib/funcareaLightVars.glsllib</file>
- <file>res/effectlib/funcspecularBSDF.glsllib</file>
- <file>res/effectlib/funccalculateDiffuseAreaOld.glsllib</file>
- <file>res/effectlib/funccalculatePointLightAttenuation.glsllib</file>
- <file>res/effectlib/defaultMaterialLighting.glsllib</file>
- <file>res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib</file>
- <file>res/effectlib/depthpass.glsllib</file>
- <file>res/effectlib/dfTint.glsllib</file>
- <file>res/effectlib/funcdiffuseReflectionBSDF.glsllib</file>
- <file>res/effectlib/diffuseReflectionBSDF.glsllib</file>
- <file>res/effectlib/diffuseTransmissionBSDF.glsllib</file>
- <file>res/effectlib/directionalFactor.glsllib</file>
- <file>res/effectlib/effect.glsllib</file>
- <file>res/effectlib/evalBakedShadowMap.glsllib</file>
- <file>res/effectlib/evalEnvironmentMap.glsllib</file>
- <file>res/effectlib/evalLightmaps.glsllib</file>
- <file>res/effectlib/fileBumpTexture.glsllib</file>
- <file>res/effectlib/fileDisplacementTexture.glsllib</file>
- <file>res/effectlib/fileTexture.glsllib</file>
- <file>res/effectlib/flakeNoiseBumpTexture.glsllib</file>
- <file>res/effectlib/flakeNoiseTexture.glsllib</file>
- <file>res/effectlib/fresnelLayer.glsllib</file>
- <file>res/effectlib/Fxaa3_11.glsllib</file>
- <file>res/effectlib/Fxaa3_8.glsllib</file>
- <file>res/effectlib/gradient3Recolor.glsllib</file>
- <file>res/effectlib/gradient3Texture.glsllib</file>
- <file>res/effectlib/gradientGetPosition.glsllib</file>
- <file>res/effectlib/luminance.glsllib</file>
- <file>res/effectlib/microfacetBSDF.glsllib</file>
- <file>res/effectlib/miNoise.glsllib</file>
- <file>res/effectlib/monoChannel.glsllib</file>
- <file>res/effectlib/normalizedMix.glsllib</file>
- <file>res/effectlib/perlinNoise.glsllib</file>
- <file>res/effectlib/perlinNoiseBumpTexture.glsllib</file>
- <file>res/effectlib/perlinNoiseTexture.glsllib</file>
- <file>res/effectlib/physGlossyBSDF.glsllib</file>
- <file>res/effectlib/random255.glsllib</file>
- <file>res/effectlib/refraction.glsllib</file>
- <file>res/effectlib/rotationTranslationScale.glsllib</file>
- <file>res/effectlib/sampleArea.glsllib</file>
- <file>res/effectlib/funcsampleLightVars.glsllib</file>
- <file>res/effectlib/sampleLight.glsllib</file>
- <file>res/effectlib/sampleProbe.glsllib</file>
- <file>res/effectlib/screenSpaceAO.glsllib</file>
- <file>res/effectlib/screenSpaceDO.glsllib</file>
- <file>res/effectlib/shadowMapping.glsllib</file>
- <file>res/effectlib/shadowMappingFragment.glsllib</file>
- <file>res/effectlib/simpleGlossyBSDF.glsllib</file>
- <file>res/effectlib/SMAA.glsllib</file>
- <file>res/effectlib/specularBSDF.glsllib</file>
- <file>res/effectlib/spotEdf.glsllib</file>
- <file>res/effectlib/square.glsllib</file>
- <file>res/effectlib/SSAOCustomMaterial.glsllib</file>
- <file>res/effectlib/tangentSpaceNormalTexture.glsllib</file>
- <file>res/effectlib/tessellationLinear.glsllib</file>
- <file>res/effectlib/tessellationLinearCM.glsllib</file>
- <file>res/effectlib/tessellationNPatch.glsllib</file>
- <file>res/effectlib/tessellationNPatchCM.glsllib</file>
- <file>res/effectlib/tessellationPath.glsllib</file>
- <file>res/effectlib/tessellationPhong.glsllib</file>
- <file>res/effectlib/tessellationPhongCM.glsllib</file>
- <file>res/effectlib/textureCoordinateInfo.glsllib</file>
- <file>res/effectlib/transformCoordinate.glsllib</file>
- <file>res/effectlib/defaultMaterialFileBumpTexture.glsllib</file>
- <file>res/effectlib/defaultMaterialBumpNoLod.glsllib</file>
- <file>res/effectlib/defaultMaterialFileDisplacementTexture.glsllib</file>
- <file>res/effectlib/defaultMaterialFileNormalTexture.glsllib</file>
- <file>res/effectlib/vertexFragmentBase.glsllib</file>
- <file>res/effectlib/viewProperties.glsllib</file>
- <file>res/effectlib/weightedLayer.glsllib</file>
- <file>res/effectlib/wireframeCM.glsllib</file>
- <file>res/effectlib/gles2/funcsampleLightVars.glsllib</file>
- <file>res/effectlib/gles2/sampleProbe.glsllib</file>
- <file>res/effectlib/gles2/SSAOCustomMaterial.glsllib</file>
- <file>res/effectlib/gles2/funcareaLightVars.glsllib</file>
- <file>res/effectlib/gles2/monoChannel.glsllib</file>
- <file>res/effectlib/gles2/shadowMapping.glsllib</file>
- <file>res/effectlib/gles2/tangentSpaceNormalTexture.glsllib</file>
- <file>res/effectlib/gles2/defaultMaterialBumpNoLod.glsllib</file>
- <file>res/effectlib/gles2/evalEnvironmentMap.glsllib</file>
- <file>res/effectlib/gles2/microfacetBSDF.glsllib</file>
- <file>res/primitives/Cone.mesh</file>
- <file>res/primitives/Cube.mesh</file>
- <file>res/primitives/Cylinder.mesh</file>
- <file>res/primitives/Rectangle.mesh</file>
- <file>res/primitives/Sphere.mesh</file>
- <file>res/Font/TitilliumWeb-Regular.ttf</file>
- <file>res/effectlib/distancefieldtext.frag</file>
- <file>res/effectlib/distancefieldtext.vert</file>
- <file>res/effectlib/distancefieldtext_core.frag</file>
- <file>res/effectlib/distancefieldtext_core.vert</file>
- <file>res/effectlib/distancefieldtext_dropshadow.frag</file>
- <file>res/effectlib/distancefieldtext_dropshadow.vert</file>
- <file>res/effectlib/distancefieldtext_dropshadow_core.frag</file>
- <file>res/effectlib/distancefieldtext_dropshadow_core.vert</file>
- </qresource>
-</RCC>
diff --git a/src/Runtime/ogl-runtime/res/DataModelMetadata/en-us/MetaData.xml b/src/Runtime/ogl-runtime/res/DataModelMetadata/en-us/MetaData.xml
deleted file mode 100644
index 951a2fba..00000000
--- a/src/Runtime/ogl-runtime/res/DataModelMetadata/en-us/MetaData.xml
+++ /dev/null
@@ -1,567 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<MetaData>
- <Category name="Custom Events" description="Custom events exposed on the behavior." icon="Objects-Behavior-Normal.png" highlightIcon="Objects-Behavior-Normal.png" />
- <Category name="Default" description="Default events on all objects" icon="Objects-Folder-Normal.png" highlightIcon="Objects-Folder-Normal.png" />
- <Category name="Gesture" description="Input from the touch screen or the mouse" icon="Objects-Folder-Normal.png" highlightIcon="Objects-Folder-Normal.png" />
- <Category name="Slide" description="Events generated when a slide is changing." icon="Objects-Folder-Normal.png" highlightIcon="Objects-Folder-Normal.png" />
- <Category name="Asset" description="Handlers exposed on the asset." icon="Objects-Folder-Normal.png" highlightIcon="Objects-Folder-Normal.png" />
- <Category name="Custom Handlers" description="Custom Handlers exposed on the behavior." icon="Objects-Behavior-Normal.png" highlightIcon="Objects-Behavior-Normal.png" />
- <Category name="Time" description="Handlers exposed on the asset's time." icon="Objects-Folder-Normal.png" highlightIcon="Objects-Folder-Normal.png" />
-
- <Asset>
- <!-- Basic properties -->
- <Property name="name" formalName="Name" type="String" category="Basic Properties" description="Object name" />
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" controllable="True" description="Item visibility" />
-
- <!-- Hidden properties -->
- <Property name="starttime" formalName="Start Time" type="Long" category="Basic Properties" hidden="True" />
- <Property name="endtime" formalName="End Time" type="Long" default="10000" category="Basic Properties" hidden="True" />
- <Property name="shy" formalName="Shy" type="Boolean" category="Basic Properties" hidden="True" />
- <Property name="sourcepath" type="String" category="Basic Properties" hidden="True" />
- <Property name="importfile" type="String" category="Basic Properties" hidden="True" />
-
- <Handler name="Set Property" category="Asset" description="Set a property to a new value.">
- <Argument name="Property Name" formalName="Property" description="Property to change" type="Slide" argumentType="Property" />
- <Argument name="Property Value" formalName="New Value" description="New value for the property" type="None" argumentType="Dependent" />
- </Handler>
- <Handler name="Fire Event" category="Asset" description="Fire an event on the target.">
- <Argument name="Event" description="The event to fire" type="None" argumentType="Event" />
- </Handler>
- <Handler name="Emit Signal" category="Asset" description="Emit a Signal.">
- <Argument name="Signal Name" description="The signal to emit" type="String" argumentType="Signal" />
- </Handler>
- </Asset>
-
- <Node> <!-- Derived from <Asset> -->
- <!-- Basic Properties -->
- <Property name="position" formalName="Position" category="Basic Properties" type="Vector" description="Location in local space" />
- <Property name="rotation" formalName="Rotation" category="Basic Properties" type="Rotation" description="Rotation around local axes" />
- <Property name="scale" formalName="Scale" category="Basic Properties" type="Vector" default="1 1 1" description="Size adjustments along local axes" />
- <Property name="pivot" formalName="Pivot" category="Basic Properties" type="Vector" description="Offset of the contents away from the\nlocal center" />
- <Property name="opacity" formalName="Opacity" category="Basic Properties" min="0" max="100" default="100" description="How much the element (and its children)\nocclude items behind them" />
-
- <!-- Hidden props -->
- <Property name="rotationorder" formalName="Rotation Order" default="YXZ" hidden="True" list="XYZ:YZX:ZXY:XZY:YXZ:ZYX:XYZr:YZXr:ZXYr:XZYr:YXZr:ZYXr" description="Rotation Order" />
- <Property name="boneid" default="-1" type="Long" hidden="True" />
- <Property name="orientation" formalName="Orientation" default="Left Handed" hidden="True" list="Left Handed:Right Handed" description="Orientation" />
- <Property name="ignoresparent" default="False" type="Boolean" hidden="True" />
-
- <Event name="onPressureDown" category="Gesture" />
- <Event name="onPressureUp" category="Gesture" />
- <Event name="onTap" category="Gesture" />
- <!--
- <Event name="onDoubleTap" category="Gesture" />
- <Event name="onSingleTap" category="Gesture" />
- <Event name="onOnePointDragStart" category="Gesture" />
- <Event name="onOnePointDrag" category="Gesture" />
- <Event name="onOnePointDragRelease" category="Gesture" />
- <Event name="onTwoPointDragStart" category="Gesture" />
- <Event name="onTwoPointDrag" category="Gesture" />
- <Event name="onTwoPointDragRelease" category="Gesture" />
- <Event name="onSwipeLeft" category="Gesture" />
- <Event name="onSwipeRight" category="Gesture" />
- <Event name="onSwipeUp" category="Gesture" />
- <Event name="onSwipeDown" category="Gesture" />
- <Event name="onTwoPointSwipeLeft" category="Gesture" />
- <Event name="onTwoPointSwipeRight" category="Gesture" />
- <Event name="onTwoPointSwipeUp" category="Gesture" />
- <Event name="onTwoPointSwipeDown" category="Gesture" />
- -->
- </Node>
-
- <!-- Objects below are derived from <Asset> -->
- <Scene>
- <!-- Background -->
- <Property name="bgcolorenable" formalName="Use Background" category="Background" type="Boolean" default="True" description="Clear the contents to a solid color\nbefore each frame?" />
- <Property name="backgroundcolor" formalName="Background Color" category="Background" type="Color" animatable="False" description="Color to use for the background" />
-
- <Event name="onPressureDown" category="Gesture" />
- <Event name="onPressureUp" category="Gesture" />
- <Event name="onTap" category="Gesture" />
-
- <!-- Hidden and commented out props -->
- <Property name="name" formalName="Name" category="Basic Properties" type="String" default="Scene" hidden="True" />
- <Property name="eyeball" formalName="Visible" category="Basic Properties" type="Boolean" default="True" hidden="True" description="Item visibility" />
- <!--
- <Event name="onDoubleTap" category="Gesture" />
- <Event name="onSingleTap" category="Gesture" />
- <Event name="onOnePointDragStart" category="Gesture" />
- <Event name="onOnePointDrag" category="Gesture" />
- <Event name="onOnePointDragRelease" category="Gesture" />
- <Event name="onTwoPointDragStart" category="Gesture" />
- <Event name="onTwoPointDrag" category="Gesture" />
- <Event name="onTwoPointDragRelease" category="Gesture" />
- <Event name="onSwipeLeft" category="Gesture" />
- <Event name="onSwipeRight" category="Gesture" />
- <Event name="onSwipeUp" category="Gesture" />
- <Event name="onSwipeDown" category="Gesture" />
- <Event name="onTwoPointSwipeLeft" category="Gesture" />
- <Event name="onTwoPointSwipeRight" category="Gesture" />
- <Event name="onTwoPointSwipeUp" category="Gesture" />
- <Event name="onTwoPointSwipeDown" category="Gesture" />
- -->
- </Scene>
-
- <RenderPlugin>
- <Property name="name" formalName="Name" description="Object name" type="String" default="RenderPlugin" hidden="True" />
- </RenderPlugin>
-
- <Behavior>
- <!--<Property name="name" formalName="Name" description="Object name" type="String" default="Behavior" hidden="False" />-->
- </Behavior>
-
- <Effect>
- <Property name="name" formalName="Name" type="String" default="Effect" hidden="False" />
- <Property name="eyeball" formalName="Visible" description="Item visibility" type="Boolean" default="True" hidden="False" controllable="True" />
- </Effect>
-
- <Image>
- <Property name="scaleu" formalName="U Repeat" default="1" description="Number of times the image is tiled on\nthe U direction of the material" />
- <Property name="scalev" formalName="V Repeat" default="1" description="Number of times the image is tiled on\nthe V direction of the material" />
- <Property name="mappingmode" formalName="Texture Mapping" default="UV Mapping" description="How the image is applied to the\nmaterial" list="UV Mapping:Environmental Mapping:Light Probe" />
- <Property name="tilingmodehorz" formalName="U Tiling" default="No Tiling" description="How the image is tiled in the\nU direction" list="Tiled:Mirrored:No Tiling" />
- <Property name="tilingmodevert" formalName="V Tiling" default="No Tiling" description="How the image is tiled in the\nV direction" list="Tiled:Mirrored:No Tiling" />
- <Property name="rotationuv" formalName="UV Rotation" description="Rotate the image's coordinates" />
- <Property name="positionu" formalName="U Position" description="Offset of the image along the U\ndirection of the material" />
- <Property name="positionv" formalName="V Position" description="Offset of the image along the V\ndirection of the material" />
- <Property name="pivotu" formalName="U Pivot" description="Offset the image in the U direction\nwithout affecting rotation center" />
- <Property name="pivotv" formalName="V Pivot" description="Offset the image in the V direction\nwithout affecting rotation center" />
- <!-- Texture subpresentation is not set to controllable as it does not currently work in runtime -->
- <Property name="subpresentation" formalName="Sub-Presentation" description="Presentation or QML stream\nto use instead of the image" type="Renderable" />
-
- <!-- Hidden props -->
- <Property name="name" formalName="Name" category="Basic Properties" type="String" default="Image" hidden="True" />
- <Property name="eyeball" formalName="Visible" category="Basic Properties" type="Boolean" default="True" hidden="True" description="Item visibility" />
- </Image>
-
- <MaterialBase>
- <Property name="name" formalName="Name" type="String" default="Material" category="Basic Properties" description="Material name" />
- <Property name="iblprobe" formalName="IBL Override" type="Image" category="Basic Properties" description="IBL probe to use in place of the\nlayer probe for this material" />
-
- <!-- Hidden properties -->
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" hidden="True" description="Item visibility" />
- </MaterialBase>
-
- <!-- Objects below are derived from <MaterialBase> -->
- <Lightmaps>
- <Property name="lightmapindirect" formalName="Indirect Lightmap" description="Image providing indirect light values\nfor GI" type="Image" category="Lighting" />
- <Property name="lightmapradiosity" formalName="Radiosity Lightmap" description="Image providing directional light values" type="Image" category="Lighting" />
- <Property name="lightmapshadow" formalName="Shadow Lightmap" description="Baked Shadow map" type="Image" category="Lighting" />
- </Lightmaps>
-
- <!-- Objects below are derived from <Lightmaps> -->
- <Material>
- <Property name="shaderlighting" formalName="Lighting" default="Pixel" category="Material" description="Light model" list="Pixel:None" />
- <Property name="blendmode" formalName="Blending Mode" default="Normal" category="Material" description="How this material blends with content\nbehind it. Modes marked with * are\navailable only with HW supporting\nadvanced blending modes." list="Normal:Screen:Multiply:*Overlay:*ColorBurn:*ColorDodge" />
- <Property name="vertexcolors" formalName="Enable Vertex Colors" type="Boolean" default="False" category="Material" description="Use vertex colors from the mesh" animatable="False" />
- <Property name="diffuse" formalName="Diffuse Color" type="Color" default="1 1 1 1" category="Material" description="Color when lit from any direction" />
- <Property name="diffusemap" formalName="Diffuse Map" type="Image" category="Material" description="Image to multiply with diffuse color" />
- <Property name="diffusemap2" formalName="Diffuse Map 2" type="Image" category="Material" description="Image to multiply with diffuse color" />
- <Property name="diffusemap3" formalName="Diffuse Map 3" type="Image" category="Material" description="Image to multiply with diffuse color" />
- <Property name="specularreflection" formalName="Specular Reflection" type="Image" category="Material" description="Image to use as a faked reflection" />
- <Property name="speculartint" formalName="Specular Tint" type="Color" default="1 1 1 1" category="Material" description="Coloration applied to specular reflections" />
- <Property name="specularamount" formalName="Specular Amount" category="Material" description="Amount of shine/gloss" />
- <Property name="specularmap" formalName="Specular Map" type="Image" category="Material" description="Image to vary the specular amount across\nthe material" />
- <Property name="specularmodel" formalName="Specular Model" default="Default" category="Material" description="Equation to use when calculating specular\nhighlights for CG lights" list="Default:KGGX:KWard" />
- <Property name="specularroughness" formalName="Specular Roughness" min='0.001' max='1' category="Material" description="Softening applied to reflections and\nhighlights" />
- <Property name="roughnessmap" formalName="Roughness Map" type="Image" category="Material" description="Image to vary the specular roughness across\nthe material" />
- <Property name="fresnelPower" formalName="Fresnel Power" category="Material" description="Damping of head-on reflections" />
- <Property name="ior" formalName="Index of Refraction" min="1" default="1.5" category="Material" description="Index of refraction of the material" />
- <Property name="bumpmap" formalName="Bump Map" type="Image" category="Material" description="Grayscale image simulating roughness in the\nlighting" />
- <Property name="normalmap" formalName="Normal Map" type="Image" category="Material" description="Special RGB image describing surface\nroughness" />
- <Property name="bumpamount" formalName="Bump Amount" type="float" default=".5" category="Material" description="Strength of bump/normal map effect" />
- <Property name="displacementmap" formalName="Displacement Map" type="Image" category="Material" description="Grayscale image used to offset vertices\nof the geometry" />
- <Property name="displaceamount" formalName="Displacement Amount" type="float" default="20" category="Material" description="Distance to offset vertices" />
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Material" description="Visibility of the geometry for this material." />
- <Property name="opacitymap" formalName="Opacity Map" type="Image" category="Material" description="Image to vary the opacity across the material" />
- <Property name="emissivecolor" formalName="Emissive Color" type="Color" default="1 1 1 1" category="Material" description="Color of self-illumination for this material" />
- <Property name="emissivepower" formalName="Emissive Power" category="Material" description="Amount of self-illumination for this material\n(will not light other objects)" />
- <Property name="emissivemap" formalName="Emissive Map" type="Image" category="Material" description="Image to vary the emissive power across\nthe material" />
- <Property name="emissivemap2" formalName="Emissive Map 2" type="Image" category="Material" description="Second image to modulate the emissive power\nacross the material" />
- <Property name="translucencymap" formalName="Translucency Map" type="Image" category="Material" description="Grayscale image controlling how much light can\npass through the material from behind" />
- <Property name="translucentfalloff" formalName="Translucent Falloff" type="float" default="1" category="Material" description="Translucent Falloff" />
- <Property name="diffuselightwrap" formalName="Diffuse Light Wrap" type="float" min='0.0' max='1.0' category="Material" description="Diffuse Light Wrap" />
- </Material>
-
- <ReferencedMaterial>
- <Property name="referencedmaterial" formalName="Referenced Material" type="ObjectRef" category="Material" description="Material to use all settings from" />
- </ReferencedMaterial>
-
- <!-- Objects below are derived from <Node> -->
- <Alias> <!-- (no longer in use) -->
- <Property name="referencednode" formalName="Reference" description="Original element (e.g. group, component, model)\nto clone" type="ObjectRef" />
- </Alias>
-
- <Camera>
- <!-- Basic Properties -->
- <Property name="name" formalName="Name" type="String" default="Camera" category="Basic Properties" description="Camera name" />
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" controllable="True" />
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" hidden="True" />
- <Property name="position" formalName="Position" type="Vector" default="0 0 -600" category="Basic Properties" description="Location in local space" />
- <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" description="Rotation around local axes" />
- <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" description="Size adjustments along local axes" />
- <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" description="Offset of the contents away from the local center" />
-
- <!-- Camera Propertiess -->
- <Property name="orthographic" formalName="Orthographic" type="Boolean" category="Camera Properties" description="Remove all perspective from the camera?" />
- <Property name="fov" formalName="Field of View" min="1" max="180" default="60" category="Camera Properties" description="Viewing angle of the camera\n(how much it can see)" >
- <ShowIfEqual property="orthographic" value="False" />
- </Property>
- <Property name="fovhorizontal" formalName="FOV Horizontal" type="Boolean" default="False" category="Camera Properties" description="Field of view angle orientation">
- <ShowIfEqual property="orthographic" value="False" />
- </Property>
- <Property name="clipnear" formalName="Clipping Start" default="10" category="Camera Properties" min="1" max="1000" description="Near distance at which objects disappear" />
- <Property name="clipfar" formalName="Clipping End" default="5000" category="Camera Properties" description="Far distance at which objects disappear" />
- <Property name="scalemode" formalName="Scale Mode" default="Fit" category="Camera Properties" list="Same Size:Fit:Fit Horizontal:Fit Vertical" description="Render more content as the layer expands\n(same size) or scale up the content (fit)" />
- <Property name="scaleanchor" formalName="Scale Anchor" default="Center" category="Camera Properties" list="Center:N:NE:E:SE:S:SW:W:NW" description="Corner of the content to pin as the\nlayer size changes" />
-
- <!-- Hidden props -->
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" hidden="True" />
- </Camera>
-
- <Component>
- <!-- Variant Tags -->
- <Property name="variants" type="String" animatable="False" category="Variant Tags" />
- </Component>
-
- <Group>
- <!-- Variant Tags -->
- <Property name="variants" type="String" animatable="False" category="Variant Tags" />
-
- <!-- Import -->
- <Property name="sourcepath" formalName="Import" type="Import" category="Import" description="Path to the source of this group" />
- </Group>
-
- <Layer>
- <!-- Basic Properties -->
- <Property name="name" formalName="Name" type="String" default="Layer" category="Basic Properties" description="Layer name" />
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" controllable="True" />
- <Property name="background" formalName="Layer Background" default="Transparent" category="Basic Properties" description="The color to use for the layer\neach frame" list="Transparent:SolidColor:Unspecified" />
- <Property name="backgroundcolor" formalName="Background Color" type="Color" animatable="False" category="Basic Properties" description="The background color for the layer">
- <ShowIfEqual property="background" value="SolidColor"/>
- </Property>
- <Property name="blendtype" formalName="Blend Mode" default="Normal" category="Basic Properties" description="Mode of blending between this layer\nand layers below. Modes marked with\n* are available only with HW supporting\nadvanced blending modes." list="Normal:Screen:Multiply:Add:Subtract:*Overlay:*ColorBurn:*ColorDodge" />
- <Property name="sourcepath" formalName="Sub-Presentation" type="Renderable" category="Basic Properties" description="Presentation or QML stream to\nrender for this layer" controllable="True" />
-
- <!-- Variant Tags -->
- <Property name="variants" type="String" animatable="False" category="Variant Tags" />
-
- <!-- Antialiasing -->
- <Property name="progressiveaa" formalName="Progressive AA" list="None:2x:4x:8x" default="None" category="Antialiasing" description="Improves the visual quality when no\nitems are moving" />
- <Property name="multisampleaa" formalName="Multisample AA" list="None:2x:4x:SSAA" default="None" category="Antialiasing" description="Improves geometry quality, e.g.\nsilhouettes." />
- <Property name="temporalaa" formalName="Temporal AA" type="Boolean" default="False" category="Antialiasing" description="Improve overall quality using camera\njittering and frame blending?" />
-
- <!-- Size -->
- <Property name="horzfields" formalName="Horizontal Fields" default="Left/Width" category="Size" description="Properties to use to control the\nhorizontal size and placement" list="Left/Width:Left/Right:Width/Right" />
- <Property name="left" formalName="Left" category="Size" description="Distance between presentation and\nlayer left edges">
- <ShowIfEqual property="horzfields" value="Left/Width"/>
- <ShowIfEqual property="horzfields" value="Left/Right"/>
- </Property>
- <Property name="leftunits" formalName="Left Units" description="Left distance is percent of overall\nwidth or absolute pixels" list="percent:pixels" default="percent" category="Size">
- <ShowIfEqual property="horzfields" value="Left/Width"/>
- <ShowIfEqual property="horzfields" value="Left/Right"/>
- </Property>
- <Property name="width" formalName="Width" description="Overall layer width" default="100" category="Size">
- <ShowIfEqual property="horzfields" value="Left/Width"/>
- <ShowIfEqual property="horzfields" value="Width/Right"/>
- </Property>
- <Property name="widthunits" formalName="Width Units" description="Width is percent of overall width\nor absolute pixels" list="percent:pixels" default="percent" category="Size">
- <ShowIfEqual property="horzfields" value="Left/Width"/>
- <ShowIfEqual property="horzfields" value="Width/Right"/>
- </Property>
- <Property name="right" formalName="Right" description="Distance between presentation and layer\nright edges" category="Size">
- <ShowIfEqual property="horzfields" value="Left/Right"/>
- <ShowIfEqual property="horzfields" value="Width/Right"/>
- </Property>
- <Property name="rightunits" formalName="Right Units" description="Right distance is percent of overall\nwidth or absolute pixels" list="percent:pixels" default="percent" category="Size">
- <ShowIfEqual property="horzfields" value="Left/Right"/>
- <ShowIfEqual property="horzfields" value="Width/Right"/>
- </Property>
- <Property name="vertfields" formalName="Vertical Fields" description="Properties to use to control the\nvertical size and placement" list="Top/Height:Top/Bottom:Height/Bottom" default="Top/Height" category="Size" />
- <Property name="top" formalName="Top" description="Distance between presentation and layer\ntop edges." category="Size">
- <ShowIfEqual property="vertfields" value="Top/Height"/>
- <ShowIfEqual property="vertfields" value="Top/Bottom"/>
- </Property>
- <Property name="topunits" formalName="Top Units" description="Top distance is percent of overall\nheight or absolute pixels" list="percent:pixels" default="percent" category="Size">
- <ShowIfEqual property="vertfields" value="Top/Height"/>
- <ShowIfEqual property="vertfields" value="Top/Bottom"/>
- </Property>
- <Property name="height" formalName="Height" description="Overall layer height." default="100" category="Size">
- <ShowIfEqual property="vertfields" value="Top/Height"/>
- <ShowIfEqual property="vertfields" value="Height/Bottom"/>
- </Property>
- <Property name="heightunits" formalName="Height Units" description="Height is percent of overall height\nor absolute pixels" list="percent:pixels" default="percent" category="Size">
- <ShowIfEqual property="vertfields" value="Top/Height"/>
- <ShowIfEqual property="vertfields" value="Height/Bottom"/>
- </Property>
- <Property name="bottom" formalName="Bottom" description="Distance between presentation and layer\nbottom edges" category="Size">
- <ShowIfEqual property="vertfields" value="Top/Bottom"/>
- <ShowIfEqual property="vertfields" value="Height/Bottom"/>
- </Property>
- <Property name="bottomunits" formalName="Bottom Units" description="Bottom distance is percent of overall\nheight or absolute pixels" list="percent:pixels" default="percent" category="Size">
- <ShowIfEqual property="vertfields" value="Top/Bottom"/>
- <ShowIfEqual property="vertfields" value="Height/Bottom"/>
- </Property>
-
- <!-- Ambient Occlusion -->
- <Property name="aostrength" formalName="Ambient Occlusion" description="Amount of ambient occlusion shading\nto apply" min="0" max="100" default="0" category="Ambient Occlusion" >
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="aodistance" formalName="AO Distance" description="Size of the ambient occlusion shading" default="5" category="Ambient Occlusion">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="aosoftness" formalName="AO Softness" description="Magnitude of the blurring used to\nsoften shading" min="0" max="50" default="50" category="Ambient Occlusion">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="aobias" formalName="AO Threshold" description="Remove AO from flat surfaces to\nprevent artifacts" default="0" category="Ambient Occlusion">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="aosamplerate" formalName="AO Sampling Rate" description="Quality of AO sampling" type="Long" default="2" min="2" max="4" category="Ambient Occlusion">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="aodither" formalName="AO Detail" description="Use close-range detail AO" type="Boolean" default="True" category="Ambient Occlusion">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
-
- <!-- Shadow -->
- <Property name="shadowstrength" formalName="Shadow Strength" description="Amount of shadowing to apply" min="0" max="100" default="0" hidden="True" category="Shadow">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="shadowdist" formalName="Shadow Distance" description="Maximum distance to ray march for\nshadows test" default="10" hidden="True" category="Shadow">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="shadowsoftness" formalName="Shadow Softness" description="Amount of softening of the shadow\nedges" min="0" max="100" default="100" hidden="True" category="Shadow">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
- <Property name="shadowbias" formalName="Shadow Threshold" description="Remove self-shadowing from flat\nsurfaces" default="0" hidden="True" category="Shadow">
- <ShowIfEqual property="sourcepath" value=""/>
- </Property>
-
- <!-- Light Probe -->
- <Property name="lightprobe" formalName="Light Probe" type="Image" category="Light Probe" description="Image used for image-based lighting\nand reflections" />
- <Property name="probebright" formalName="IBL Brightness" default="100" category="Light Probe" description="Amount of light emitted by the light\nprobe." />
- <Property name="probehorizon" formalName="IBL Horizon Cutoff" min="-1" max="-0.001" default="-1" category="Light Probe" description="Upper limit for horizon darkening\nof the light probe" />
- <Property name="probefov" formalName="IBL FOV Angle" min="1.0" max="180" default="180" category="Light Probe" description="Image source FOV for the case of using\na camera-source as the IBL probe" />
- <Property name="lightprobe2" formalName="Secondary Light Probe" type="Image" category="Light Probe" description="Image to blend over the primary light\nprobe" />
- <Property name="probe2fade" formalName="Probe Crossfade" min="0.0" max="1.0" default="1.0" category="Light Probe" description="Blend amount between the primary and\nseconary probes" />
-
- <!-- Advanced -->
- <Property name="disabledepthtest" formalName="Disable Depth Test" type="Boolean" animatable="False" category="Advanced" description="Optimize render speed for layers with\nmostly transparent objects?" />
- <Property name="disabledepthprepass" formalName="Disable Depth Prepass" type="Boolean" animatable="False" category="Advanced" description="Optimize render speed for layers\nwith low depth complexity" />
-
- <!-- Hidden props -->
- <Property name="position" formalName="Position" type="Vector" category="Basic Properties" hidden="True" description="Location in local space" />
- <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" hidden="True" description="Rotation around local axes" />
- <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" hidden="True" description="Size adjustments along local axes" />
- <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" hidden="True" description="Offset of the contents away from the local center" />
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" hidden="True" />
- <Property name="fastibl" formalName="Fast IBL" type="Boolean" default="True" category="Light Probe" hidden="True" description="Use a faster approximation to\nimage-based lighting" />
- <Property name="probe2window" formalName="Secondary Probe Window" min="0.01" max="1.0" default="1.0" category="Light Probe" hidden="True" description="Texture-U window size used for the\nmoving window (for scrolling textures)" />
- <Property name="probe2pos" formalName="Secondary Probe Offset" default="0.5" category="Light Probe" hidden="True" description="Texture-U window offset used for the\nmoving window" />
- </Layer>
-
- <Light>
- <!-- Basic Properties -->
- <Property name="name" formalName="Name" type="String" default="Light" category="Basic Properties" description="Light name" />
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" controllable="True" />
- <Property name="position" formalName="Position" type="Vector" category="Basic Properties" description="Location in local space" />
- <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" description="Rotation around local axes" />
- <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" description="Size adjustments along local axes" />
- <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" description="Offset of the contents away from the local center" />
-
- <!-- Light Properties -->
- <Property name='scope' formalName="Scope" description="Portion of the scene graph lit by this\nlight; no value results in entire layer\nbeing affected." type='ObjectRef' category="Light Properties" />
- <Property name="lighttype" formalName="Light Type" description="Type of illumination to use" list="Directional:Point:Area" default="Directional" category="Light Properties" />
- <Property name="lightdiffuse" formalName="Light Color" description="Color of diffuse lighting effect" type="Color" default="1 1 1 1" category="Light Properties" />
- <Property name="lightspecular" formalName="Specular Color" description="Color of specular lighting highlights" type="Color" default="1 1 1 1" category="Light Properties" />
- <Property name="lightambient" formalName="Ambient Color" description="Color of unlit areas (black for none)" type="Color" category="Light Properties" />
- <Property name="brightness" formalName="Brightness" description="Strength of the light" default="100" category="Light Properties" />
- <Property name="linearfade" formalName="Linear Fade" description="Falloff of the point light" min="0" max="1000" category="Light Properties">
- <ShowIfEqual property="lighttype" value="Point"/>
- </Property>
- <Property name="expfade" formalName="Exponential Fade" description="Additional falloff" min="0" max="1000" category="Light Properties">
- <ShowIfEqual property="lighttype" value="Point"/>
- </Property>
- <Property name="areawidth" formalName="Width" description="Width of the surface of the area light" min="0" default="100" hidden="True" category="Light Properties">
- <ShowIfEqual property="lighttype" value="Area"/>
- </Property>
- <Property name="areaheight" formalName="Height" description="Height of the surface of the area light" min="0" default="100" hidden="True" category="Light Properties">
- <ShowIfEqual property="lighttype" value="Area"/>
- </Property>
-
- <!-- Shadow -->
- <Property name="castshadow" formalName="Cast Shadows" description="Enable shadow casting for this light" type="Boolean" default="False" category="Shadow" />
- <Property name="shdwfactor" formalName="Shadow Darkness" description="Factor used to darken shadows" default="10.0" min="1.0" max="100.0" category="Shadow" />
- <Property name="shdwfilter" formalName="Shadow Softness" description="Width of the blur filter on the shadow map" min="1" max="100" default="35" category="Shadow" />
- <Property name="shdwmapres" formalName="Shadow Resolution" description="Resolution of shadow map\n(powers of two)" type="ShadowMapResolution" default="9" animatable="False" category="Shadow" />
- <Property name="shdwbias" formalName="Shadow Depth Bias" description="Slight offset to avoid self-shadowing\nartifacts" default="0" min="-1.0" max="1.0" category="Shadow" />
- <Property name="shdwmapfar" formalName="Shadow Far Clip" description="Affects the maximum distance for the shadow\ndepth map" default="5000" category="Shadow" />
- <Property name="shdwmapfov" formalName="Shadow Field of View" description="Affects the field of view of the shadow\ncamera" default="90" min="1" max="179" hidden="True" category="Shadow" />
-
- <!-- Hidden props -->
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" hidden="True" />
- </Light>
-
- <Model>
- <!-- Basic Properties -->
- <Property name="name" formalName="Name" type="String" default="Model" category="Basic Properties" description="Object name" />
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" />
- <Property name="position" formalName="Position" type="Vector" category="Basic Properties" description="Location in local space" />
- <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" description="Rotation around local axes" />
- <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" description="Size adjustments along local axes" />
- <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" description="Offset of the contents away from the local center" />
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" />
-
- <!-- Variant Tags -->
- <Property name="variants" type="String" animatable="False" category="Variant Tags" />
-
- <!-- Model -->
- <Property name="sourcepath" formalName="Mesh" type="Mesh" category="Model" description="Geometry to use for this model" />
- <Property name="shadowcaster" formalName="Cast Shadows" type="Boolean" default="True" category="Model" description="Whether the model is a shadow caster or not" />
-
- <!-- Hidden and commented out props -->
- <Property name="poseroot" hidden="True" type="Long" default="-1" category="Model" />
- <!--<Property name="tessellation" formalName="Tessellation Mode" description="Type of tessellation to subdivide\nthe geometry" list="None:Linear:Phong:NPatch" default="None" />
- <Property name="edgetess" formalName="Edge Tessellation" description="Max Tessellation amount" min="1" max="64" default="4" />
- <Property name="innertess" formalName="Inner Tessellation" description="Min Tessellation amount" min="1" max="64" default="4" />-->
- </Model>
-
- <Text>
- <!-- Basic Properties -->
- <Property name="name" formalName="Name" type="String" default="Light" category="Basic Properties" description="Object name" />
- <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" controllable="True" />
- <Property name="position" formalName="Position" type="Vector" category="Basic Properties" description="Location in local space" />
- <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" description="Rotation around local axes" />
- <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" description="Size adjustments along local axes" />
- <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" description="Offset of the contents away from the local center" />
-
- <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" hidden="True" category="Basic Properties" />
-
- <!-- Variant Tags -->
- <Property name="variants" type="String" animatable="False" category="Variant Tags" />
-
- <!-- Format -->
- <Property name="textstring" formalName="Text String" type="MultiLineString" default="Text" category="Format" description="Text String" controllable="True" />
- <Property name="textcolor" formalName="Text Color" type="Color" default="1 1 1 1" category="Format" description="Text Color" controllable="True" />
- <Property name="font" formalName="Font" type="Font" default="TitilliumWeb-Regular" category="Format" description="Font" />
- <!-- HW accelerated fonts not supported
- <Property name="enableacceleratedfont" formalName="Hardware accelerated font" description="Enabled hardware acclerated font" type="Boolean" default="false" category="Format" />
- -->
- <Property name="size" formalName="Font Size" description="Font Size" type="FontSize" default="36" animatable="False" category="Format" />
- <Property name="horzalign" formalName="Horizontal Alignment" description="Horizontal Alignment" list="Left:Center:Right" default="Center" category="Format" />
- <Property name="vertalign" formalName="Vertical Alignment" description="Vertical Alignment" list="Top:Middle:Bottom" default="Middle" category="Format" />
- <Property name="leading" formalName="Leading" description="Leading" category="Format" />
- <Property name="tracking" formalName="Tracking" description="Tracking" category="Format" />
- <Property name="boundingbox" formalName="Text Area" description="Fixed size text area. If not set,\ntext area grows with text." type="Float2" default="0 0" category="Format" />
- <Property name="wordwrap" formalName="Word Wrapping" description="Word wrapping. Has effect only if fixed size\ntext area is used.\nClip: Cut text if it does not fit.\nWrapWord: Wrap between words, if possible.\nWrapAnywhere: Wrap even in the middle\nof words." list="Clip:WrapWord:WrapAnywhere" default="WrapWord" category="Format" />
- <Property name="elide" formalName="Eliding" description="Elide text that does not fit the\ntext area. Has effect only if\nfixed text area is defined." list="ElideNone:ElideLeft:ElideMiddle:ElideRight" default="ElideNone" category="Format" />
-
- <!-- Shadow -->
- <Property name="dropshadow" formalName="Drop-Shadow" category="Shadow" type="Boolean" default="False" description="Add a drop-shadow to the text.\nThe shadow is a darker shade of the given color." />
- <Property name="dropshadowstrength" formalName="Shadow Darkness" category="Shadow" type="Float" min="0" max="100" default="80" description="Darkness of the shadow in percents.\n100 is black, 0 is the same color as the text." />
- <Property name="dropshadowoffsetx" formalName="Horizontal Offset" category="Shadow" type="Float" min="-100" max="100" default="0" description="Horizontal offset of the shadow.\nIt is relative to the font size." />
- <Property name="dropshadowoffsety" formalName="Vertical Offset" category="Shadow" type="Float" min="-100" max="100" default="0" description="Vertical offset of the shadow.\nIt is relative to the font size." />
- </Text>
-
- <Path> <!-- (doesn't seem to be in use) -->
- <Property name="name" formalName="Name" description="Object name" type="String" default="Path" hidden="False" />
- <Property name="opacity" formalName="Opacity" description="How much the element (and its children)\nocclude items behind them" min="0" max="100" default="100" />
- <Property name="sourcepath" formalName="Path" description="Path data to use for this path" type="PathBuffer" />
- <Property name='width' formalName="Stroke Width" description="The size of the stroke in local units" default='5'/>
- <Property name='pathtype' formalName='Path Type' description="The type of this path" list='Painted:Geometry' default='Painted' />
- <Property name='linearerror' formalName="CPU Limit" description="Amount of tessellation work done on the\nCPU before GPU tessellation is involved" default='1000'>
- <ShowIfEqual property='pathtype' value='Geometry'/>
- </Property>
- <Property name='edgetessamount' formalName="Edge Detail" description="Amount of GPU tessellation along the\nlength of the path." default='8' min='1' max='64' >
- <ShowIfEqual property='pathtype' value='Geometry'/>
- </Property>
- <Property name='innertessamount' formalName="Width Detail" description="Amount of GPU tessellation across the\nstroke of the path." default='1' min='1' max='64' >
- <ShowIfEqual property='pathtype' value='Geometry'/>
- </Property>
- <Property name='begincap' formalName="Begin Cap Style" description='Set this to &quot;Taper&quot; to finely\ntaper the beginning of your stroke over\na specified distance' list="None:Taper" default="None">
- <ShowIfEqual property='pathtype' value='Geometry'/>
- </Property>
- <Property name='begincapoffset' formalName='Taper Length' description="Control the length of the taper" default='10'>
- <HideIfEqual property='pathtype' value='Painted'/>
- <ShowIfEqual property='begincap' value='Taper'/>
- </Property>
- <Property name='begincapopacity' formalName='Tip Opacity' description="Control the opacity of the taper" min='0' max='1'>
- <HideIfEqual property='pathtype' value='Painted'/>
- <ShowIfEqual property='begincap' value='Taper'/>
- </Property>
- <Property name='begincapwidth' formalName='Tip Width' description="Control the size of the taper" default='0'>
- <HideIfEqual property='pathtype' value='Painted'/>
- <ShowIfEqual property='begincap' value='Taper'/>
- </Property>
- <Property name='endcap' formalName="End Cap Style" description='Set this to &quot;Taper&quot; to finely\ntaper the end of your stroke over a\nspecified distance' list="None:Taper" default="None">
- <ShowIfEqual property='pathtype' value='Geometry'/>
- </Property>
- <Property name='endcapoffset' formalName='Taper Length' description="Control the length of the taper" default='10'>
- <HideIfEqual property='pathtype' value='Painted'/>
- <ShowIfEqual property='endcap' value='Taper'/>
- </Property>
- <Property name='endcapopacity' formalName='Tip Opacity' description="Control the opacity of the taper" min='0' max='1'>
- <HideIfEqual property='pathtype' value='Painted'/>
- <ShowIfEqual property='endcap' value='Taper'/>
- </Property>
- <Property name='endcapwidth' formalName='Tip Width' description="Control the size of the taper" default='0'>
- <HideIfEqual property='pathtype' value='Painted'/>
- <ShowIfEqual property='endcap' value='Taper'/>
- </Property>
- <!--Painted paths have a dropdown called “Paint Style” with values “Filled and Stroked”, “Filled”, “Stroked”. Default is “Filled and Stroked”, but derived on import.-->
- <Property name='paintstyle' formalName='Paint Style' description="The style of this path" list='Filled and Stroked:Filled:Stroked' default='Stroked'>
- <ShowIfEqual property='pathtype' value='Painted'/>
- </Property>
- </Path>
-
- <SubPath> <!-- (doesn't seem to be in use) -->
- <Property name="name" formalName="Name" description="Object name" type="String" default="SubPath" hidden="False" />
- <Property name='closed' formalName='Closed Path?' type='Boolean' default='False'/>
- </SubPath>
-
- <PathAnchorPoint> <!-- (doesn't seem to be in use) -->
- <Property name="name" formalName="Name" description="Object name" type="String" default="Anchor Point" hidden="False" />
- <Property name='position' formalName='Position' type='Float2'/>
- <Property name="incomingangle" formalName='Handle Angle' />
- <Property name="incomingdistance" formalName="Incoming Distance" />
- <Property name="outgoingdistance" formalName="Outgoing Distance" />
- </PathAnchorPoint>
-
- <Particle> <!-- (doesn't seem to be in use) -->
- <Property name="name" formalName="Name" description="Object name" type="String" default="Particle" hidden="False" />
- <Property name="particletype" formalName="Particle Type" description="Type of particle System" list="Simple:Smoke:Cloud:Fluid:User" default="Cloud" />
- <Property name="opacity" formalName="Opacity" description="How much the element (and its children)\nocclude items behind them" min="0" max="100" default="100" />
- <Property name="maxparticles" formalName="MaxParticle" description="Max count of particles" type="Long" min="0" max="1000000" default="100" />
- <Property name="particlesize" formalName="ParticleSize" description="Render size of particle" min="0" default="1" />
- <Property name="lifetime" formalName="Lifetime" description="Particle lifetime before it dies" min="-1" default="5">
- <HideIfEqual property='particletype' value='Cloud'/>
- </Property>
- </Particle>
-
- <Slide>
- <!-- Play Mode -->
- <Property name="playmode" formalName="Play Mode" category="Play Mode" default="Stop at end" animatable="False" list="Stop at end:Looping:PingPong:Ping:Play Through To..." description="Action to take when reaching the end of\nall timebars on this slide" />
- <Property name="playthroughto" formalName="Play Through To" category="Play Mode" default="Next" animatable="False" type="StringListOrInt" list="Next:Previous" description="Slide to go to after this one">
- <ShowIfEqual property="playmode" value="Play Through To..."/>
- </Property>
- <Property name="initialplaystate" formalName="Initial Play State" category="Play Mode" default="Play" animatable="False" list="Play:Pause" description="Do animations start when coming to\nthis slide?" />
- </Slide>
-
- <SlideOwner>
- <Event name="onSlideEnter" category="Slide" description="Fired when the slide is changing" />
- <Event name="onSlideExit" category="Slide" description="Fired when the slide is changing" />
- <Handler name="Go to Time" category="Time" description="Set the current time on the component.">
- <Argument name="Time" description="Time to go do" />
- <Argument name="Pause" description="Pause playback at the new time?" type="Boolean" />
- </Handler>
- <Handler name="Play" category="Time" description="Start the component's time playing." />
- <Handler name="Pause" category="Time" description="Pause the component's time." />
- <Handler name="Go to Slide" category="Slide" description="Go to a specified slide of the component.">
- <Argument name="Slide" description="Target slide to go to" type="Slide" argumentType="Slide" />
- </Handler>
- <Handler name="Next Slide" category="Slide" description="Activate the next slide of the component." />
- <Handler name="Previous Slide" category="Slide" description="Activate the previous slide of the component." />
- <Handler name="Preceding Slide" category="Slide" description="Activate the slide that was previously active." />
- </SlideOwner>
-
-</MetaData>
diff --git a/src/Runtime/ogl-runtime/res/Font/TitilliumWeb-Regular.ttf b/src/Runtime/ogl-runtime/res/Font/TitilliumWeb-Regular.ttf
deleted file mode 100644
index 6da82193..00000000
--- a/src/Runtime/ogl-runtime/res/Font/TitilliumWeb-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/res/effectlib/Fxaa3_11.glsllib b/src/Runtime/ogl-runtime/res/effectlib/Fxaa3_11.glsllib
deleted file mode 100644
index f5de2089..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/Fxaa3_11.glsllib
+++ /dev/null
@@ -1,2073 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*============================================================================
-
-
- NVIDIA FXAA 3.11 by TIMOTHY LOTTES
-
-------------------------------------------------------------------------------
- INTEGRATION CHECKLIST
-------------------------------------------------------------------------------
-(1.)
-In the shader source, setup defines for the desired configuration.
-When providing multiple shaders (for different presets),
-simply setup the defines differently in multiple files.
-Example,
-
- #define FXAA_PC 1
- #define FXAA_HLSL_5 1
- #define FXAA_QUALITY__PRESET 12
-
-Or,
-
- #define FXAA_360 1
-
-Or,
-
- #define FXAA_PS3 1
-
-Etc.
-
-(2.)
-Then include this file,
-
-(3.)
-Then call the FXAA pixel shader from within your desired shader.
-Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
-As for FXAA 3.11 all inputs for all shaders are the same
-to enable easy porting between platforms.
-
- return FxaaPixelShader(...);
-
-(4.)
-Insure pass prior to FXAA outputs RGBL (see next section).
-Or use,
-
- #define FXAA_GREEN_AS_LUMA 1
-
-(5.)
-Setup engine to provide the following constants
-which are used in the FxaaPixelShader() inputs,
-
- FxaaFloat2 fxaaQualityRcpFrame,
- FxaaFloat4 fxaaConsoleRcpFrameOpt,
- FxaaFloat4 fxaaConsoleRcpFrameOpt2,
- FxaaFloat4 fxaaConsole360RcpFrameOpt2,
- FxaaFloat fxaaQualitySubpix,
- FxaaFloat fxaaQualityEdgeThreshold,
- FxaaFloat fxaaQualityEdgeThresholdMin,
- FxaaFloat fxaaConsoleEdgeSharpness,
- FxaaFloat fxaaConsoleEdgeThreshold,
- FxaaFloat fxaaConsoleEdgeThresholdMin,
- FxaaFloat4 fxaaConsole360ConstDir
-
-Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
-
-(6.)
-Have FXAA vertex shader run as a full screen triangle,
-and output "pos" and "fxaaConsolePosPos"
-such that inputs in the pixel shader provide,
-
- // {xy} = center of pixel
- FxaaFloat2 pos,
-
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- FxaaFloat4 fxaaConsolePosPos,
-
-(7.)
-Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
-
-
-------------------------------------------------------------------------------
- INTEGRATION - RGBL AND COLORSPACE
-------------------------------------------------------------------------------
-FXAA3 requires RGBL as input unless the following is set,
-
- #define FXAA_GREEN_AS_LUMA 1
-
-In which case the engine uses green in place of luma,
-and requires RGB input is in a non-linear colorspace.
-
-RGB should be LDR (low dynamic range).
-Specifically do FXAA after tonemapping.
-
-RGB data as returned by a texture fetch can be non-linear,
-or linear when FXAA_GREEN_AS_LUMA is not set.
-Note an "sRGB format" texture counts as linear,
-because the result of a texture fetch is linear data.
-Regular "RGBA8" textures in the sRGB colorspace are non-linear.
-
-If FXAA_GREEN_AS_LUMA is not set,
-luma must be stored in the alpha channel prior to running FXAA.
-This luma should be in a perceptual space (could be gamma 2.0).
-Example pass before FXAA where output is gamma 2.0 encoded,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- color.rgb = sqrt(color.rgb); // gamma 2.0 color output
- return color;
-
-To use FXAA,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- color.rgb = sqrt(color.rgb); // gamma 2.0 color output
- color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
- return color;
-
-Another example where output is linear encoded,
-say for instance writing to an sRGB formated render target,
-where the render target does the conversion back to sRGB after blending,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- return color;
-
-To use FXAA,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
- return color;
-
-Getting luma correct is required for the algorithm to work correctly.
-
-
-------------------------------------------------------------------------------
- BEING LINEARLY CORRECT?
-------------------------------------------------------------------------------
-Applying FXAA to a framebuffer with linear RGB color will look worse.
-This is very counter intuitive, but happends to be true in this case.
-The reason is because dithering artifacts will be more visiable
-in a linear colorspace.
-
-
-------------------------------------------------------------------------------
- COMPLEX INTEGRATION
-------------------------------------------------------------------------------
-Q. What if the engine is blending into RGB before wanting to run FXAA?
-
-A. In the last opaque pass prior to FXAA,
- have the pass write out luma into alpha.
- Then blend into RGB only.
- FXAA should be able to run ok
- assuming the blending pass did not any add aliasing.
- This should be the common case for particles and common blending passes.
-
-A. Or use FXAA_GREEN_AS_LUMA.
-
-============================================================================*/
-
-/*============================================================================
-
- INTEGRATION KNOBS
-
-============================================================================*/
-//
-// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
-// FXAA_360_OPT is a prototype for the new optimized 360 version.
-//
-// 1 = Use API.
-// 0 = Don't use API.
-//
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PS3
- #define FXAA_PS3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360
- #define FXAA_360 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360_OPT
- #define FXAA_360_OPT 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_PC
- //
- // FXAA Quality
- // The high quality PC algorithm.
- //
- #define FXAA_PC 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PC_CONSOLE
- //
- // The console algorithm for PC is included
- // for developers targeting really low spec machines.
- // Likely better to just run FXAA_PC, and use a really low preset.
- //
- #define FXAA_PC_CONSOLE 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_120
- #define FXAA_GLSL_120 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_130
- #define FXAA_GLSL_130 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_3
- #define FXAA_HLSL_3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_4
- #define FXAA_HLSL_4 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_5
- #define FXAA_HLSL_5 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_GREEN_AS_LUMA
- //
- // For those using non-linear color,
- // and either not able to get luma in alpha, or not wanting to,
- // this enables FXAA to run using green as a proxy for luma.
- // So with this enabled, no need to pack luma in alpha.
- //
- // This will turn off AA on anything which lacks some amount of green.
- // Pure red and blue or combination of only R and B, will get no AA.
- //
- // Might want to lower the settings for both,
- // fxaaConsoleEdgeThresholdMin
- // fxaaQualityEdgeThresholdMin
- // In order to insure AA does not get turned off on colors
- // which contain a minor amount of green.
- //
- // 1 = On.
- // 0 = Off.
- //
- #define FXAA_GREEN_AS_LUMA 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_EARLY_EXIT
- //
- // Controls algorithm's early exit path.
- // On PS3 turning this ON adds 2 cycles to the shader.
- // On 360 turning this OFF adds 10ths of a millisecond to the shader.
- // Turning this off on console will result in a more blurry image.
- // So this defaults to on.
- //
- // 1 = On.
- // 0 = Off.
- //
- #define FXAA_EARLY_EXIT 1
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_DISCARD
- //
- // Only valid for PC OpenGL currently.
- // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
- //
- // 1 = Use discard on pixels which don't need AA.
- // For APIs which enable concurrent TEX+ROP from same surface.
- // 0 = Return unchanged color on pixels which don't need AA.
- //
- #define FXAA_DISCARD 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_FAST_PIXEL_OFFSET
- //
- // Used for GLSL 120 only.
- //
- // 1 = GL API supports fast pixel offsets
- // 0 = do not use fast pixel offsets
- //
- #ifdef GL_EXT_gpu_shader4
- #define FXAA_FAST_PIXEL_OFFSET 1
- #endif
- #ifdef GL_NV_gpu_shader5
- #define FXAA_FAST_PIXEL_OFFSET 1
- #endif
- #ifdef GL_ARB_gpu_shader5
- #define FXAA_FAST_PIXEL_OFFSET 1
- #endif
- #ifndef FXAA_FAST_PIXEL_OFFSET
- #define FXAA_FAST_PIXEL_OFFSET 0
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GATHER4_ALPHA
-
- //
- // 1 = API supports gather4 on alpha channel.
- // 0 = API does not support gather4 on alpha channel.
- //
-
-#ifdef GL_ES
- #if __VERSION__ >= 310
- #ifdef GL_EXT_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #endif
- #ifndef FXAA_GATHER4_ALPHA
- #define FXAA_GATHER4_ALPHA 0
- #endif
-#else
- #if (FXAA_HLSL_5 == 1)
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifdef GL_ARB_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifdef GL_NV_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifndef FXAA_GATHER4_ALPHA
- #define FXAA_GATHER4_ALPHA 0
- #endif
- #endif
-#endif
-
-/*============================================================================
- FXAA CONSOLE PS3 - TUNING KNOBS
-============================================================================*/
-#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
- //
- // Consoles the sharpness of edges on PS3 only.
- // Non-PS3 tuning is done with shader input.
- //
- // Due to the PS3 being ALU bound,
- // there are only two safe values here: 4 and 8.
- // These options use the shaders ability to a free *|/ by 2|4|8.
- //
- // 8.0 is sharper
- // 4.0 is softer
- // 2.0 is really soft (good for vector graphics inputs)
- //
- #if 1
- #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
- #endif
- #if 0
- #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
- #endif
- #if 0
- #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
- //
- // Only effects PS3.
- // Non-PS3 tuning is done with shader input.
- //
- // The minimum amount of local contrast required to apply algorithm.
- // The console setting has a different mapping than the quality setting.
- //
- // This only applies when FXAA_EARLY_EXIT is 1.
- //
- // Due to the PS3 being ALU bound,
- // there are only two safe values here: 0.25 and 0.125.
- // These options use the shaders ability to a free *|/ by 2|4|8.
- //
- // 0.125 leaves less aliasing, but is softer
- // 0.25 leaves more aliasing, and is sharper
- //
- #if 1
- #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
- #else
- #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
- #endif
-#endif
-
-/*============================================================================
- FXAA QUALITY - TUNING KNOBS
-------------------------------------------------------------------------------
-NOTE the other tuning knobs are now in the shader function inputs!
-============================================================================*/
-#ifndef FXAA_QUALITY__PRESET
- //
- // Choose the quality preset.
- // This needs to be compiled into the shader as it effects code.
- // Best option to include multiple presets is to
- // in each shader define the preset, then include this file.
- //
- // OPTIONS
- // -----------------------------------------------------------------------
- // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
- // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
- // 39 - no dither, very expensive
- //
- // NOTES
- // -----------------------------------------------------------------------
- // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
- // 13 = about same speed as FXAA 3.9 and better than 12
- // 23 = closest to FXAA 3.9 visually and performance wise
- // _ = the lowest digit is directly related to performance
- // _ = the highest digit is directly related to style
- //
- #define FXAA_QUALITY__PRESET 12
-#endif
-
-
-/*============================================================================
-
- FXAA QUALITY - PRESETS
-
-============================================================================*/
-
-/*============================================================================
- FXAA QUALITY - MEDIUM DITHER PRESETS
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 10)
- #define FXAA_QUALITY__PS 3
- #define FXAA_QUALITY__P0 1.5
- #define FXAA_QUALITY__P1 3.0
- #define FXAA_QUALITY__P2 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 11)
- #define FXAA_QUALITY__PS 4
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 3.0
- #define FXAA_QUALITY__P3 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 12)
- #define FXAA_QUALITY__PS 5
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 4.0
- #define FXAA_QUALITY__P4 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 13)
- #define FXAA_QUALITY__PS 6
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 4.0
- #define FXAA_QUALITY__P5 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 14)
- #define FXAA_QUALITY__PS 7
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 4.0
- #define FXAA_QUALITY__P6 12.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 15)
- #define FXAA_QUALITY__PS 8
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 2.0
- #define FXAA_QUALITY__P6 4.0
- #define FXAA_QUALITY__P7 12.0
-#endif
-
-/*============================================================================
- FXAA QUALITY - LOW DITHER PRESETS
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 20)
- #define FXAA_QUALITY__PS 3
- #define FXAA_QUALITY__P0 1.5
- #define FXAA_QUALITY__P1 2.0
- #define FXAA_QUALITY__P2 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 21)
- #define FXAA_QUALITY__PS 4
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 22)
- #define FXAA_QUALITY__PS 5
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 23)
- #define FXAA_QUALITY__PS 6
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 24)
- #define FXAA_QUALITY__PS 7
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 3.0
- #define FXAA_QUALITY__P6 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 25)
- #define FXAA_QUALITY__PS 8
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 2.0
- #define FXAA_QUALITY__P6 4.0
- #define FXAA_QUALITY__P7 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 26)
- #define FXAA_QUALITY__PS 9
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 2.0
- #define FXAA_QUALITY__P6 2.0
- #define FXAA_QUALITY__P7 4.0
- #define FXAA_QUALITY__P8 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 27)
- #define FXAA_QUALITY__PS 10
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 2.0
- #define FXAA_QUALITY__P6 2.0
- #define FXAA_QUALITY__P7 2.0
- #define FXAA_QUALITY__P8 4.0
- #define FXAA_QUALITY__P9 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 28)
- #define FXAA_QUALITY__PS 11
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 2.0
- #define FXAA_QUALITY__P6 2.0
- #define FXAA_QUALITY__P7 2.0
- #define FXAA_QUALITY__P8 2.0
- #define FXAA_QUALITY__P9 4.0
- #define FXAA_QUALITY__P10 8.0
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_QUALITY__PRESET == 29)
- #define FXAA_QUALITY__PS 12
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.5
- #define FXAA_QUALITY__P2 2.0
- #define FXAA_QUALITY__P3 2.0
- #define FXAA_QUALITY__P4 2.0
- #define FXAA_QUALITY__P5 2.0
- #define FXAA_QUALITY__P6 2.0
- #define FXAA_QUALITY__P7 2.0
- #define FXAA_QUALITY__P8 2.0
- #define FXAA_QUALITY__P9 2.0
- #define FXAA_QUALITY__P10 4.0
- #define FXAA_QUALITY__P11 8.0
-#endif
-
-/*============================================================================
- FXAA QUALITY - EXTREME QUALITY
-============================================================================*/
-#if (FXAA_QUALITY__PRESET == 39)
- #define FXAA_QUALITY__PS 12
- #define FXAA_QUALITY__P0 1.0
- #define FXAA_QUALITY__P1 1.0
- #define FXAA_QUALITY__P2 1.0
- #define FXAA_QUALITY__P3 1.0
- #define FXAA_QUALITY__P4 1.0
- #define FXAA_QUALITY__P5 1.5
- #define FXAA_QUALITY__P6 2.0
- #define FXAA_QUALITY__P7 2.0
- #define FXAA_QUALITY__P8 2.0
- #define FXAA_QUALITY__P9 2.0
- #define FXAA_QUALITY__P10 4.0
- #define FXAA_QUALITY__P11 8.0
-#endif
-
-
-
-/*============================================================================
-
- API PORTING
-
-============================================================================*/
-#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
- #define FxaaBool bool
- #define FxaaDiscard discard
- #define FxaaFloat float
- #define FxaaFloat2 vec2
- #define FxaaFloat3 vec3
- #define FxaaFloat4 vec4
- #define FxaaHalf float
- #define FxaaHalf2 vec2
- #define FxaaHalf3 vec3
- #define FxaaHalf4 vec4
- #define FxaaInt2 ivec2
- #define FxaaSat(x) clamp(x, 0.0, 1.0)
- #define FxaaTex sampler2D
-#else
- #define FxaaBool bool
- #define FxaaDiscard clip(-1)
- #define FxaaFloat float
- #define FxaaFloat2 float2
- #define FxaaFloat3 float3
- #define FxaaFloat4 float4
- #define FxaaHalf half
- #define FxaaHalf2 half2
- #define FxaaHalf3 half3
- #define FxaaHalf4 half4
- #define FxaaSat(x) saturate(x)
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_GLSL_120 == 1)
- // Requires,
- // #version 120
- // And at least,
- // #extension GL_EXT_gpu_shader4 : enable
- // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
- #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
- #if (FXAA_FAST_PIXEL_OFFSET == 1)
- #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
- #else
- #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
- #endif
- #if (FXAA_GATHER4_ALPHA == 1)
- // use #extension GL_ARB_gpu_shader5 : enable
- #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
- #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
- #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
- #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_GLSL_130 == 1)
- // Requires "#version 130" or better
- #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
- #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
- #if (FXAA_GATHER4_ALPHA == 1)
- // use #extension GL_ARB_gpu_shader5 : enable
- #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
- #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
- #define FxaaTexGreen4(t, p) textureGather(t, p, 1)
- #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
- #define FxaaInt2 float2
- #define FxaaTex sampler2D
- #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
- #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_4 == 1)
- #define FxaaInt2 int2
- struct FxaaTex { SamplerState smpl; Texture2D tex; };
- #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
- #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_5 == 1)
- #define FxaaInt2 int2
- struct FxaaTex { SamplerState smpl; Texture2D tex; };
- #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
- #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
- #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
- #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
- #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
- #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
-#endif
-
-
-/*============================================================================
- GREEN AS LUMA OPTION SUPPORT FUNCTION
-============================================================================*/
-#if (FXAA_GREEN_AS_LUMA == 0)
- FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
-#else
- FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
-#endif
-
-
-
-
-/*============================================================================
-
- FXAA3 QUALITY - PC
-
-============================================================================*/
-#if (FXAA_PC == 1)
-/*--------------------------------------------------------------------------*/
-FxaaFloat4 FxaaPixelShader(
- //
- // Use noperspective interpolation here (turn off perspective interpolation).
- // {xy} = center of pixel
- FxaaFloat2 pos,
- //
- // Used only for FXAA Console, and not used on the 360 version.
- // Use noperspective interpolation here (turn off perspective interpolation).
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- FxaaFloat4 fxaaConsolePosPos,
- //
- // Input color texture.
- // {rgb_} = color in linear or perceptual color space
- // if (FXAA_GREEN_AS_LUMA == 0)
- // {___a} = luma in perceptual color space (not linear)
- FxaaTex tex,
- //
- // Only used on the optimized 360 version of FXAA Console.
- // For everything but 360, just use the same input here as for "tex".
- // For 360, same texture, just alias with a 2nd sampler.
- // This sampler needs to have an exponent bias of -1.
- FxaaTex fxaaConsole360TexExpBiasNegOne,
- //
- // Only used on the optimized 360 version of FXAA Console.
- // For everything but 360, just use the same input here as for "tex".
- // For 360, same texture, just alias with a 3nd sampler.
- // This sampler needs to have an exponent bias of -2.
- FxaaTex fxaaConsole360TexExpBiasNegTwo,
- //
- // Only used on FXAA Quality.
- // This must be from a constant/uniform.
- // {x_} = 1.0/screenWidthInPixels
- // {_y} = 1.0/screenHeightInPixels
- FxaaFloat2 fxaaQualityRcpFrame,
- //
- // Only used on FXAA Console.
- // This must be from a constant/uniform.
- // This effects sub-pixel AA quality and inversely sharpness.
- // Where N ranges between,
- // N = 0.50 (default)
- // N = 0.33 (sharper)
- // {x___} = -N/screenWidthInPixels
- // {_y__} = -N/screenHeightInPixels
- // {__z_} = N/screenWidthInPixels
- // {___w} = N/screenHeightInPixels
- FxaaFloat4 fxaaConsoleRcpFrameOpt,
- //
- // Only used on FXAA Console.
- // Not used on 360, but used on PS3 and PC.
- // This must be from a constant/uniform.
- // {x___} = -2.0/screenWidthInPixels
- // {_y__} = -2.0/screenHeightInPixels
- // {__z_} = 2.0/screenWidthInPixels
- // {___w} = 2.0/screenHeightInPixels
- FxaaFloat4 fxaaConsoleRcpFrameOpt2,
- //
- // Only used on FXAA Console.
- // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
- // This must be from a constant/uniform.
- // {x___} = 8.0/screenWidthInPixels
- // {_y__} = 8.0/screenHeightInPixels
- // {__z_} = -4.0/screenWidthInPixels
- // {___w} = -4.0/screenHeightInPixels
- FxaaFloat4 fxaaConsole360RcpFrameOpt2,
- //
- // Only used on FXAA Quality.
- // This used to be the FXAA_QUALITY__SUBPIX define.
- // It is here now to allow easier tuning.
- // Choose the amount of sub-pixel aliasing removal.
- // This can effect sharpness.
- // 1.00 - upper limit (softer)
- // 0.75 - default amount of filtering
- // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
- // 0.25 - almost off
- // 0.00 - completely off
- FxaaFloat fxaaQualitySubpix,
- //
- // Only used on FXAA Quality.
- // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
- // It is here now to allow easier tuning.
- // The minimum amount of local contrast required to apply algorithm.
- // 0.333 - too little (faster)
- // 0.250 - low quality
- // 0.166 - default
- // 0.125 - high quality
- // 0.063 - overkill (slower)
- FxaaFloat fxaaQualityEdgeThreshold,
- //
- // Only used on FXAA Quality.
- // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
- // It is here now to allow easier tuning.
- // Trims the algorithm from processing darks.
- // 0.0833 - upper limit (default, the start of visible unfiltered edges)
- // 0.0625 - high quality (faster)
- // 0.0312 - visible limit (slower)
- // Special notes when using FXAA_GREEN_AS_LUMA,
- // Likely want to set this to zero.
- // As colors that are mostly not-green
- // will appear very dark in the green channel!
- // Tune by looking at mostly non-green content,
- // then start at zero and increase until aliasing is a problem.
- FxaaFloat fxaaQualityEdgeThresholdMin,
- //
- // Only used on FXAA Console.
- // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
- // It is here now to allow easier tuning.
- // This does not effect PS3, as this needs to be compiled in.
- // Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
- // Due to the PS3 being ALU bound,
- // there are only three safe values here: 2 and 4 and 8.
- // These options use the shaders ability to a free *|/ by 2|4|8.
- // For all other platforms can be a non-power of two.
- // 8.0 is sharper (default!!!)
- // 4.0 is softer
- // 2.0 is really soft (good only for vector graphics inputs)
- FxaaFloat fxaaConsoleEdgeSharpness,
- //
- // Only used on FXAA Console.
- // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
- // It is here now to allow easier tuning.
- // This does not effect PS3, as this needs to be compiled in.
- // Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
- // Due to the PS3 being ALU bound,
- // there are only two safe values here: 1/4 and 1/8.
- // These options use the shaders ability to a free *|/ by 2|4|8.
- // The console setting has a different mapping than the quality setting.
- // Other platforms can use other values.
- // 0.125 leaves less aliasing, but is softer (default!!!)
- // 0.25 leaves more aliasing, and is sharper
- FxaaFloat fxaaConsoleEdgeThreshold,
- //
- // Only used on FXAA Console.
- // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
- // It is here now to allow easier tuning.
- // Trims the algorithm from processing darks.
- // The console setting has a different mapping than the quality setting.
- // This only applies when FXAA_EARLY_EXIT is 1.
- // This does not apply to PS3,
- // PS3 was simplified to avoid more shader instructions.
- // 0.06 - faster but more aliasing in darks
- // 0.05 - default
- // 0.04 - slower and less aliasing in darks
- // Special notes when using FXAA_GREEN_AS_LUMA,
- // Likely want to set this to zero.
- // As colors that are mostly not-green
- // will appear very dark in the green channel!
- // Tune by looking at mostly non-green content,
- // then start at zero and increase until aliasing is a problem.
- FxaaFloat fxaaConsoleEdgeThresholdMin,
- //
- // Extra constants for 360 FXAA Console only.
- // Use zeros or anything else for other platforms.
- // These must be in physical constant registers and NOT immedates.
- // Immedates will result in compiler un-optimizing.
- // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
- FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
- FxaaFloat2 posM;
- posM.x = pos.x;
- posM.y = pos.y;
- #if (FXAA_GATHER4_ALPHA == 1)
- #if (FXAA_DISCARD == 0)
- FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
- #if (FXAA_GREEN_AS_LUMA == 0)
- #define lumaM rgbyM.w
- #else
- #define lumaM rgbyM.y
- #endif
- #endif
- #if (FXAA_GREEN_AS_LUMA == 0)
- FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
- FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
- #else
- FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
- FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
- #endif
- #if (FXAA_DISCARD == 1)
- #define lumaM luma4A.w
- #endif
- #define lumaE luma4A.z
- #define lumaS luma4A.x
- #define lumaSE luma4A.y
- #define lumaNW luma4B.w
- #define lumaN luma4B.z
- #define lumaW luma4B.x
- #else
- FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
- #if (FXAA_GREEN_AS_LUMA == 0)
- #define lumaM rgbyM.w
- #else
- #define lumaM rgbyM.y
- #endif
- FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
- #endif
-/*--------------------------------------------------------------------------*/
- FxaaFloat maxSM = max(lumaS, lumaM);
- FxaaFloat minSM = min(lumaS, lumaM);
- FxaaFloat maxESM = max(lumaE, maxSM);
- FxaaFloat minESM = min(lumaE, minSM);
- FxaaFloat maxWN = max(lumaN, lumaW);
- FxaaFloat minWN = min(lumaN, lumaW);
- FxaaFloat rangeMax = max(maxWN, maxESM);
- FxaaFloat rangeMin = min(minWN, minESM);
- FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
- FxaaFloat range = rangeMax - rangeMin;
- FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
- FxaaBool earlyExit = range < rangeMaxClamped;
-/*--------------------------------------------------------------------------*/
- if(earlyExit)
- #if (FXAA_DISCARD == 1)
- FxaaDiscard;
- #else
- return rgbyM;
- #endif
-/*--------------------------------------------------------------------------*/
- #if (FXAA_GATHER4_ALPHA == 0)
- FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
- #else
- FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
- #endif
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaNS = lumaN + lumaS;
- FxaaFloat lumaWE = lumaW + lumaE;
- FxaaFloat subpixRcpRange = 1.0/range;
- FxaaFloat subpixNSWE = lumaNS + lumaWE;
- FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
- FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaNESE = lumaNE + lumaSE;
- FxaaFloat lumaNWNE = lumaNW + lumaNE;
- FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
- FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaNWSW = lumaNW + lumaSW;
- FxaaFloat lumaSWSE = lumaSW + lumaSE;
- FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
- FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
- FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
- FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
- FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
- FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
-/*--------------------------------------------------------------------------*/
- FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
- FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
- FxaaBool horzSpan = edgeHorz >= edgeVert;
- FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
-/*--------------------------------------------------------------------------*/
- if(!horzSpan) lumaN = lumaW;
- if(!horzSpan) lumaS = lumaE;
- if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
- FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
-/*--------------------------------------------------------------------------*/
- FxaaFloat gradientN = lumaN - lumaM;
- FxaaFloat gradientS = lumaS - lumaM;
- FxaaFloat lumaNN = lumaN + lumaM;
- FxaaFloat lumaSS = lumaS + lumaM;
- FxaaBool pairN = abs(gradientN) >= abs(gradientS);
- FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
- if(pairN) lengthSign = -lengthSign;
- FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
-/*--------------------------------------------------------------------------*/
- FxaaFloat2 posB;
- posB.x = posM.x;
- posB.y = posM.y;
- FxaaFloat2 offNP;
- offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
- offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
- if(!horzSpan) posB.x += lengthSign * 0.5;
- if( horzSpan) posB.y += lengthSign * 0.5;
-/*--------------------------------------------------------------------------*/
- FxaaFloat2 posN;
- posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
- posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
- FxaaFloat2 posP;
- posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
- posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
- FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
- FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
- FxaaFloat subpixE = subpixC * subpixC;
- FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
-/*--------------------------------------------------------------------------*/
- if(!pairN) lumaNN = lumaSS;
- FxaaFloat gradientScaled = gradient * 1.0/4.0;
- FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
- FxaaFloat subpixF = subpixD * subpixE;
- FxaaBool lumaMLTZero = lumaMM < 0.0;
-/*--------------------------------------------------------------------------*/
- lumaEndN -= lumaNN * 0.5;
- lumaEndP -= lumaNN * 0.5;
- FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
- FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
- FxaaBool doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
-/*--------------------------------------------------------------------------*/
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 3)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 4)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 5)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 6)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 7)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 8)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 9)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 10)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 11)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_QUALITY__PS > 12)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
- #endif
-/*--------------------------------------------------------------------------*/
- }
-/*--------------------------------------------------------------------------*/
- FxaaFloat dstN = posM.x - posN.x;
- FxaaFloat dstP = posP.x - posM.x;
- if(!horzSpan) dstN = posM.y - posN.y;
- if(!horzSpan) dstP = posP.y - posM.y;
-/*--------------------------------------------------------------------------*/
- FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
- FxaaFloat spanLength = (dstP + dstN);
- FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
- FxaaFloat spanLengthRcp = 1.0/spanLength;
-/*--------------------------------------------------------------------------*/
- FxaaBool directionN = dstN < dstP;
- FxaaFloat dst = min(dstN, dstP);
- FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
- FxaaFloat subpixG = subpixF * subpixF;
- FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
- FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
-/*--------------------------------------------------------------------------*/
- FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
- FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
- if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
- if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
- #if (FXAA_DISCARD == 1)
- return FxaaTexTop(tex, posM);
- #else
- return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
- #endif
-}
-/*==========================================================================*/
-#endif
-
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - PC VERSION
-
-------------------------------------------------------------------------------
-Instead of using this on PC, I'd suggest just using FXAA Quality with
- #define FXAA_QUALITY__PRESET 10
-Or
- #define FXAA_QUALITY__PRESET 20
-Either are higher qualilty and almost as fast as this on modern PC GPUs.
-============================================================================*/
-#if (FXAA_PC_CONSOLE == 1)
-/*--------------------------------------------------------------------------*/
-FxaaFloat4 FxaaPixelShader(
- // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
- FxaaFloat2 pos,
- FxaaFloat4 fxaaConsolePosPos,
- FxaaTex tex,
- FxaaTex fxaaConsole360TexExpBiasNegOne,
- FxaaTex fxaaConsole360TexExpBiasNegTwo,
- FxaaFloat2 fxaaQualityRcpFrame,
- FxaaFloat4 fxaaConsoleRcpFrameOpt,
- FxaaFloat4 fxaaConsoleRcpFrameOpt2,
- FxaaFloat4 fxaaConsole360RcpFrameOpt2,
- FxaaFloat fxaaQualitySubpix,
- FxaaFloat fxaaQualityEdgeThreshold,
- FxaaFloat fxaaQualityEdgeThresholdMin,
- FxaaFloat fxaaConsoleEdgeSharpness,
- FxaaFloat fxaaConsoleEdgeThreshold,
- FxaaFloat fxaaConsoleEdgeThresholdMin,
- FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
- FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
- FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
- FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
-/*--------------------------------------------------------------------------*/
- FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
- #if (FXAA_GREEN_AS_LUMA == 0)
- FxaaFloat lumaM = rgbyM.w;
- #else
- FxaaFloat lumaM = rgbyM.y;
- #endif
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
- lumaNe += 1.0/384.0;
- FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
- FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
- FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
-/*--------------------------------------------------------------------------*/
- FxaaFloat lumaMinM = min(lumaMin, lumaM);
- FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
- FxaaFloat lumaMaxM = max(lumaMax, lumaM);
- FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
- FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
- FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
- if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
-/*--------------------------------------------------------------------------*/
- FxaaFloat2 dir;
- dir.x = dirSwMinusNe + dirSeMinusNw;
- dir.y = dirSwMinusNe - dirSeMinusNw;
-/*--------------------------------------------------------------------------*/
- FxaaFloat2 dir1 = normalize(dir.xy);
- FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
- FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
-/*--------------------------------------------------------------------------*/
- FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
- FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
-/*--------------------------------------------------------------------------*/
- FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
- FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
-/*--------------------------------------------------------------------------*/
- FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
- FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
-/*--------------------------------------------------------------------------*/
- #if (FXAA_GREEN_AS_LUMA == 0)
- FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
- #else
- FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
- #endif
- if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
- return rgbyB; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - 360 PIXEL SHADER
-
-------------------------------------------------------------------------------
-This optimized version thanks to suggestions from Andy Luedke.
-Should be fully tex bound in all cases.
-As of the FXAA 3.11 release, I have still not tested this code,
-however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
-And note this is replacing the old unoptimized version.
-If it does not work, please let me know so I can fix it.
-============================================================================*/
-#if (FXAA_360 == 1)
-/*--------------------------------------------------------------------------*/
-[reduceTempRegUsage(4)]
-float4 FxaaPixelShader(
- // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
- FxaaFloat2 pos,
- FxaaFloat4 fxaaConsolePosPos,
- FxaaTex tex,
- FxaaTex fxaaConsole360TexExpBiasNegOne,
- FxaaTex fxaaConsole360TexExpBiasNegTwo,
- FxaaFloat2 fxaaQualityRcpFrame,
- FxaaFloat4 fxaaConsoleRcpFrameOpt,
- FxaaFloat4 fxaaConsoleRcpFrameOpt2,
- FxaaFloat4 fxaaConsole360RcpFrameOpt2,
- FxaaFloat fxaaQualitySubpix,
- FxaaFloat fxaaQualityEdgeThreshold,
- FxaaFloat fxaaQualityEdgeThresholdMin,
- FxaaFloat fxaaConsoleEdgeSharpness,
- FxaaFloat fxaaConsoleEdgeThreshold,
- FxaaFloat fxaaConsoleEdgeThresholdMin,
- FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
- float4 lumaNwNeSwSe;
- #if (FXAA_GREEN_AS_LUMA == 0)
- asm {
- tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
- tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD=false
- tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD=false
- tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD=false
- };
- #else
- asm {
- tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false
- tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD=false
- tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD=false
- tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD=false
- };
- #endif
-/*--------------------------------------------------------------------------*/
- lumaNwNeSwSe.y += 1.0/384.0;
- float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
- float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
- float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
- float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
-/*--------------------------------------------------------------------------*/
- float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- float lumaMinM = min(lumaMin, rgbyM.w);
- float lumaMaxM = max(lumaMax, rgbyM.w);
- #else
- float lumaMinM = min(lumaMin, rgbyM.y);
- float lumaMaxM = max(lumaMax, rgbyM.y);
- #endif
- if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
-/*--------------------------------------------------------------------------*/
- float2 dir;
- dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
- dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
- dir = normalize(dir);
-/*--------------------------------------------------------------------------*/
- float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
-/*--------------------------------------------------------------------------*/
- float4 dir2;
- float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
- dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
- dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
-/*--------------------------------------------------------------------------*/
- float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
- float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
- float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
- float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
- float4 rgbyA = rgbyN1 + rgbyP1;
- float4 rgbyB = rgbyN2 + rgbyP2 + rgbyA * 0.5;
-/*--------------------------------------------------------------------------*/
- float4 rgbyR = ((FxaaLuma(rgbyB) - lumaMax) > 0.0) ? rgbyA : rgbyB;
- rgbyR = ((FxaaLuma(rgbyB) - lumaMin) > 0.0) ? rgbyR : rgbyA;
- return rgbyR; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
-
-==============================================================================
-The code below does not exactly match the assembly.
-I have a feeling that 12 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
- --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-------------------------------------------------------------------------------
- NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
- 0: texpkb h0.w(TRUE), v5.zyxx, #0
- 2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
- 4: texpkb h0.w(TRUE), v5.xwxx, #0
- 6: addh h0.z(TRUE), -h2, h0.w
- 7: texpkb h1.w(TRUE), v5, #0
- 9: addh h0.x(TRUE), h0.z, -h1.w
- 10: addh h3.w(TRUE), h0.z, h1
- 11: texpkb h2.w(TRUE), v5.zwzz, #0
- 13: addh h0.z(TRUE), h3.w, -h2.w
- 14: addh h0.x(TRUE), h2.w, h0
- 15: nrmh h1.xz(TRUE), h0_n
- 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
- 17: maxh h4.w(TRUE), h0, h1
- 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
- 19: movr r1.zw(TRUE), v4.xxxy
- 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
- 22: minh h5.w(TRUE), h0, h1
- 23: texpkb h0(TRUE), r2.xzxx, #0
- 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
- 27: maxh h4.x(TRUE), h2.z, h2.w
- 28: texpkb h1(TRUE), r0.zwzz, #0
- 30: addh_d2 h1(TRUE), h0, h1
- 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 33: texpkb h0(TRUE), r0, #0
- 35: minh h4.z(TRUE), h2, h2.w
- 36: fenct TRUE
- 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 39: texpkb h2(TRUE), r1, #0
- 41: addh_d2 h0(TRUE), h0, h2
- 42: maxh h2.w(TRUE), h4, h4.x
- 43: minh h2.x(TRUE), h5.w, h4.z
- 44: addh_d2 h0(TRUE), h0, h1
- 45: slth h2.x(TRUE), h0.w, h2
- 46: sgth h2.w(TRUE), h0, h2
- 47: movh h0(TRUE), h0
- 48: addx.c0 rc(TRUE), h2, h2.w
- 49: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass | Unit | uOp | PC: Op
------+--------+------+-------------------------
- 1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | SCB1 | add | 2: ADDh h2.z, h0.--w-, const.--x-;
- | | |
- 2 | SCT0/1 | mov | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | TEX | txl | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | SCB1 | add | 6: ADDh h0.z,-h2, h0.--w-;
- | | |
- 3 | SCT0/1 | mov | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0;
- | TEX | txl | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0;
- | SCB0 | add | 9: ADDh h0.x, h0.z---,-h1.w---;
- | SCB1 | add | 10: ADDh h3.w, h0.---z, h1;
- | | |
- 4 | SCT0/1 | mov | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | TEX | txl | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | SCB0 | add | 14: ADDh h0.x, h2.w---, h0;
- | SCB1 | add | 13: ADDh h0.z, h3.--w-,-h2.--w-;
- | | |
- 5 | SCT1 | mov | 15: NRMh h1.xz, h0;
- | SRB | nrm | 15: NRMh h1.xz, h0;
- | SCB0 | min | 16: MINh*8 h0.x, |h1|, |h1.z---|;
- | SCB1 | max | 17: MAXh h4.w, h0, h1;
- | | |
- 6 | SCT0 | div | 18: DIVx h2.xy, h1.xz--, h0;
- | SCT1 | mov | 19: MOVr r1.zw, g[TEX0].--xy;
- | SCB0 | mad | 20: MADr r2.xz,-h1, const.z-w-, r1.z-w-;
- | SCB1 | min | 22: MINh h5.w, h0, h1;
- | | |
- 7 | SCT0/1 | mov | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0;
- | TEX | txl | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0;
- | SCB0 | max | 27: MAXh h4.x, h2.z---, h2.w---;
- | SCB1 | mad | 25: MADr r0.zw, h1.--xz, const, r1;
- | | |
- 8 | SCT0/1 | mov | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0;
- | TEX | txl | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0;
- | SCB0/1 | add | 30: ADDh/2 h1, h0, h1;
- | | |
- 9 | SCT0 | mad | 31: MADr r0.xy,-h2, const.xy--, r1.zw--;
- | SCT1 | mov | 33: TXLr h0, r0, const.zzzz, TEX0;
- | TEX | txl | 33: TXLr h0, r0, const.zzzz, TEX0;
- | SCB1 | min | 35: MINh h4.z, h2, h2.--w-;
- | | |
- 10 | SCT0 | mad | 37: MADr r1.xy, h2, const.xy--, r1.zw--;
- | SCT1 | mov | 39: TXLr h2, r1, const.zzzz, TEX0;
- | TEX | txl | 39: TXLr h2, r1, const.zzzz, TEX0;
- | SCB0/1 | add | 41: ADDh/2 h0, h0, h2;
- | | |
- 11 | SCT0 | min | 43: MINh h2.x, h5.w---, h4.z---;
- | SCT1 | max | 42: MAXh h2.w, h4, h4.---x;
- | SCB0/1 | add | 44: ADDh/2 h0, h0, h1;
- | | |
- 12 | SCT0 | set | 45: SLTh h2.x, h0.w---, h2;
- | SCT1 | set | 46: SGTh h2.w, h0, h2;
- | SCB0/1 | mul | 47: MOVh h0, h0;
- | | |
- 13 | SCT0 | mad | 48: ADDxc0_s rc, h2, h2.w---;
- | SCB0/1 | mul | 49: MOVh h0(NE0.xxxx), h1;
-
-Pass SCT TEX SCB
- 1: 0% 100% 25%
- 2: 0% 100% 25%
- 3: 0% 100% 50%
- 4: 0% 100% 50%
- 5: 0% 0% 50%
- 6: 100% 0% 75%
- 7: 0% 100% 75%
- 8: 0% 100% 100%
- 9: 0% 100% 25%
- 10: 0% 100% 100%
- 11: 50% 0% 100%
- 12: 50% 0% 100%
- 13: 25% 0% 100%
-
-MEAN: 17% 61% 67%
-
-Pass SCT0 SCT1 TEX SCB0 SCB1
- 1: 0% 0% 100% 0% 100%
- 2: 0% 0% 100% 0% 100%
- 3: 0% 0% 100% 100% 100%
- 4: 0% 0% 100% 100% 100%
- 5: 0% 0% 0% 100% 100%
- 6: 100% 100% 0% 100% 100%
- 7: 0% 0% 100% 100% 100%
- 8: 0% 0% 100% 100% 100%
- 9: 0% 0% 100% 0% 100%
- 10: 0% 0% 100% 100% 100%
- 11: 100% 100% 0% 100% 100%
- 12: 100% 100% 0% 100% 100%
- 13: 100% 0% 0% 100% 100%
-
-MEAN: 30% 23% 61% 76% 100%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 13 cycles, 3 r regs, 923,076,923 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
-/*--------------------------------------------------------------------------*/
-#pragma regcount 7
-#pragma disablepc all
-#pragma option O3
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
- // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
- FxaaFloat2 pos,
- FxaaFloat4 fxaaConsolePosPos,
- FxaaTex tex,
- FxaaTex fxaaConsole360TexExpBiasNegOne,
- FxaaTex fxaaConsole360TexExpBiasNegTwo,
- FxaaFloat2 fxaaQualityRcpFrame,
- FxaaFloat4 fxaaConsoleRcpFrameOpt,
- FxaaFloat4 fxaaConsoleRcpFrameOpt2,
- FxaaFloat4 fxaaConsole360RcpFrameOpt2,
- FxaaFloat fxaaQualitySubpix,
- FxaaFloat fxaaQualityEdgeThreshold,
- FxaaFloat fxaaQualityEdgeThresholdMin,
- FxaaFloat fxaaConsoleEdgeSharpness,
- FxaaFloat fxaaConsoleEdgeThreshold,
- FxaaFloat fxaaConsoleEdgeThresholdMin,
- FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
- half4 dir;
- half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- lumaNe.w += half(1.0/512.0);
- dir.x = -lumaNe.w;
- dir.z = -lumaNe.w;
- #else
- lumaNe.y += half(1.0/512.0);
- dir.x = -lumaNe.y;
- dir.z = -lumaNe.y;
- #endif
-/*--------------------------------------------------------------------------*/
-// (2)
- half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- dir.x += lumaSw.w;
- dir.z += lumaSw.w;
- #else
- dir.x += lumaSw.y;
- dir.z += lumaSw.y;
- #endif
-/*--------------------------------------------------------------------------*/
-// (3)
- half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- dir.x -= lumaNw.w;
- dir.z += lumaNw.w;
- #else
- dir.x -= lumaNw.y;
- dir.z += lumaNw.y;
- #endif
-/*--------------------------------------------------------------------------*/
-// (4)
- half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- dir.x += lumaSe.w;
- dir.z -= lumaSe.w;
- #else
- dir.x += lumaSe.y;
- dir.z -= lumaSe.y;
- #endif
-/*--------------------------------------------------------------------------*/
-// (5)
- half4 dir1_pos;
- dir1_pos.xy = normalize(dir.xyz).xz;
- half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (6)
- half4 dir2_pos;
- dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
- dir1_pos.zw = pos.xy;
- dir2_pos.zw = pos.xy;
- half4 temp1N;
- temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (7)
- temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
- half4 rgby1;
- rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (8)
- rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
- rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (9)
- half4 temp2N;
- temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
- temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
-// (10)
- half4 rgby2;
- rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
- rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
- rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (11)
- // compilier moves these scalar ops up to other cycles
- #if (FXAA_GREEN_AS_LUMA == 0)
- half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
- half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
- #else
- half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
- half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
- #endif
- rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (12)
- #if (FXAA_GREEN_AS_LUMA == 0)
- bool twoTapLt = rgby2.w < lumaMin;
- bool twoTapGt = rgby2.w > lumaMax;
- #else
- bool twoTapLt = rgby2.y < lumaMin;
- bool twoTapGt = rgby2.y > lumaMax;
- #endif
-/*--------------------------------------------------------------------------*/
-// (13)
- if(twoTapLt || twoTapGt) rgby2 = rgby1;
-/*--------------------------------------------------------------------------*/
- return rgby2; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
-
-==============================================================================
-The code mostly matches the assembly.
-I have a feeling that 14 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
- --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
-Will look at fixing this for FXAA 3.12.
-------------------------------------------------------------------------------
- NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
- 0: texpkb h0.w(TRUE), v5.zyxx, #0
- 2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
- 4: texpkb h1.w(TRUE), v5.xwxx, #0
- 6: addh h0.x(TRUE), h1.w, -h2.y
- 7: texpkb h2.w(TRUE), v5.zwzz, #0
- 9: minh h4.w(TRUE), h2.y, h2
- 10: maxh h5.x(TRUE), h2.y, h2.w
- 11: texpkb h0.w(TRUE), v5, #0
- 13: addh h3.w(TRUE), -h0, h0.x
- 14: addh h0.x(TRUE), h0.w, h0
- 15: addh h0.z(TRUE), -h2.w, h0.x
- 16: addh h0.x(TRUE), h2.w, h3.w
- 17: minh h5.y(TRUE), h0.w, h1.w
- 18: nrmh h2.xz(TRUE), h0_n
- 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
- 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
- 21: movr r1.zw(TRUE), v4.xxxy
- 22: maxh h2.w(TRUE), h0, h1
- 23: fenct TRUE
- 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 26: texpkb h0(TRUE), r0, #0
- 28: maxh h5.x(TRUE), h2.w, h5
- 29: minh h5.w(TRUE), h5.y, h4
- 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 32: texpkb h2(TRUE), r1, #0
- 34: addh_d2 h2(TRUE), h0, h2
- 35: texpkb h1(TRUE), v4, #0
- 37: maxh h5.y(TRUE), h5.x, h1.w
- 38: minh h4.w(TRUE), h1, h5
- 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 41: texpkb h0(TRUE), r0, #0
- 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
- 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 46: texpkb h3(TRUE), r2, #0
- 48: addh_d2 h0(TRUE), h0, h3
- 49: addh_d2 h3(TRUE), h0, h2
- 50: movh h0(TRUE), h3
- 51: slth h3.x(TRUE), h3.w, h5.w
- 52: sgth h3.w(TRUE), h3, h5.x
- 53: addx.c0 rc(TRUE), h3.x, h3
- 54: slth.c0 rc(TRUE), h5.z, h5
- 55: movh h0(c0.NE.w), h2
- 56: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass | Unit | uOp | PC: Op
------+--------+------+-------------------------
- 1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | SCB0 | add | 2: ADDh h2.y, h0.-w--, const.-x--;
- | | |
- 2 | SCT0/1 | mov | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | TEX | txl | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | SCB0 | add | 6: ADDh h0.x, h1.w---,-h2.y---;
- | | |
- 3 | SCT0/1 | mov | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | TEX | txl | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | SCB0 | max | 10: MAXh h5.x, h2.y---, h2.w---;
- | SCB1 | min | 9: MINh h4.w, h2.---y, h2;
- | | |
- 4 | SCT0/1 | mov | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0;
- | TEX | txl | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0;
- | SCB0 | add | 14: ADDh h0.x, h0.w---, h0;
- | SCB1 | add | 13: ADDh h3.w,-h0, h0.---x;
- | | |
- 5 | SCT0 | mad | 16: ADDh h0.x, h2.w---, h3.w---;
- | SCT1 | mad | 15: ADDh h0.z,-h2.--w-, h0.--x-;
- | SCB0 | min | 17: MINh h5.y, h0.-w--, h1.-w--;
- | | |
- 6 | SCT1 | mov | 18: NRMh h2.xz, h0;
- | SRB | nrm | 18: NRMh h2.xz, h0;
- | SCB1 | min | 19: MINh*8 h2.w, |h2.---x|, |h2.---z|;
- | | |
- 7 | SCT0 | div | 20: DIVx h4.xy, h2.xz--, h2.ww--;
- | SCT1 | mov | 21: MOVr r1.zw, g[TEX0].--xy;
- | SCB1 | max | 22: MAXh h2.w, h0, h1;
- | | |
- 8 | SCT0 | mad | 24: MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
- | SCT1 | mov | 26: TXLr h0, r0, const.xxxx, TEX0;
- | TEX | txl | 26: TXLr h0, r0, const.xxxx, TEX0;
- | SCB0 | max | 28: MAXh h5.x, h2.w---, h5;
- | SCB1 | min | 29: MINh h5.w, h5.---y, h4;
- | | |
- 9 | SCT0 | mad | 30: MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
- | SCT1 | mov | 32: TXLr h2, r1, const.xxxx, TEX0;
- | TEX | txl | 32: TXLr h2, r1, const.xxxx, TEX0;
- | SCB0/1 | add | 34: ADDh/2 h2, h0, h2;
- | | |
- 10 | SCT0/1 | mov | 35: TXLr h1, g[TEX0], const.xxxx, TEX0;
- | TEX | txl | 35: TXLr h1, g[TEX0], const.xxxx, TEX0;
- | SCB0 | max | 37: MAXh h5.y, h5.-x--, h1.-w--;
- | SCB1 | min | 38: MINh h4.w, h1, h5;
- | | |
- 11 | SCT0 | mad | 39: MADr r0.xy,-h4, const.xy--, r1.zw--;
- | SCT1 | mov | 41: TXLr h0, r0, const.zzzz, TEX0;
- | TEX | txl | 41: TXLr h0, r0, const.zzzz, TEX0;
- | SCB0 | mad | 44: MADr r2.xy, h4, const.xy--, r1.zw--;
- | SCB1 | add | 43: ADDh*8 h5.z, h5.--y-,-h4.--w-;
- | | |
- 12 | SCT0/1 | mov | 46: TXLr h3, r2, const.xxxx, TEX0;
- | TEX | txl | 46: TXLr h3, r2, const.xxxx, TEX0;
- | SCB0/1 | add | 48: ADDh/2 h0, h0, h3;
- | | |
- 13 | SCT0/1 | mad | 49: ADDh/2 h3, h0, h2;
- | SCB0/1 | mul | 50: MOVh h0, h3;
- | | |
- 14 | SCT0 | set | 51: SLTh h3.x, h3.w---, h5.w---;
- | SCT1 | set | 52: SGTh h3.w, h3, h5.---x;
- | SCB0 | set | 54: SLThc0 rc, h5.z---, h5;
- | SCB1 | add | 53: ADDxc0_s rc, h3.---x, h3;
- | | |
- 15 | SCT0/1 | mul | 55: MOVh h0(NE0.wwww), h2;
- | SCB0/1 | mul | 56: MOVh h0(NE0.xxxx), h1;
-
-Pass SCT TEX SCB
- 1: 0% 100% 25%
- 2: 0% 100% 25%
- 3: 0% 100% 50%
- 4: 0% 100% 50%
- 5: 50% 0% 25%
- 6: 0% 0% 25%
- 7: 100% 0% 25%
- 8: 0% 100% 50%
- 9: 0% 100% 100%
- 10: 0% 100% 50%
- 11: 0% 100% 75%
- 12: 0% 100% 100%
- 13: 100% 0% 100%
- 14: 50% 0% 50%
- 15: 100% 0% 100%
-
-MEAN: 26% 60% 56%
-
-Pass SCT0 SCT1 TEX SCB0 SCB1
- 1: 0% 0% 100% 100% 0%
- 2: 0% 0% 100% 100% 0%
- 3: 0% 0% 100% 100% 100%
- 4: 0% 0% 100% 100% 100%
- 5: 100% 100% 0% 100% 0%
- 6: 0% 0% 0% 0% 100%
- 7: 100% 100% 0% 0% 100%
- 8: 0% 0% 100% 100% 100%
- 9: 0% 0% 100% 100% 100%
- 10: 0% 0% 100% 100% 100%
- 11: 0% 0% 100% 100% 100%
- 12: 0% 0% 100% 100% 100%
- 13: 100% 100% 0% 100% 100%
- 14: 100% 100% 0% 100% 100%
- 15: 100% 100% 0% 100% 100%
-
-MEAN: 33% 33% 60% 86% 80%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 15 cycles, 3 r regs, 800,000,000 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
-/*--------------------------------------------------------------------------*/
-#pragma regcount 7
-#pragma disablepc all
-#pragma option O2
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
- // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
- FxaaFloat2 pos,
- FxaaFloat4 fxaaConsolePosPos,
- FxaaTex tex,
- FxaaTex fxaaConsole360TexExpBiasNegOne,
- FxaaTex fxaaConsole360TexExpBiasNegTwo,
- FxaaFloat2 fxaaQualityRcpFrame,
- FxaaFloat4 fxaaConsoleRcpFrameOpt,
- FxaaFloat4 fxaaConsoleRcpFrameOpt2,
- FxaaFloat4 fxaaConsole360RcpFrameOpt2,
- FxaaFloat fxaaQualitySubpix,
- FxaaFloat fxaaQualityEdgeThreshold,
- FxaaFloat fxaaQualityEdgeThresholdMin,
- FxaaFloat fxaaConsoleEdgeSharpness,
- FxaaFloat fxaaConsoleEdgeThreshold,
- FxaaFloat fxaaConsoleEdgeThresholdMin,
- FxaaFloat4 fxaaConsole360ConstDir
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
- half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- half lumaNe = rgbyNe.w + half(1.0/512.0);
- #else
- half lumaNe = rgbyNe.y + half(1.0/512.0);
- #endif
-/*--------------------------------------------------------------------------*/
-// (2)
- half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- half lumaSwNegNe = lumaSw.w - lumaNe;
- #else
- half lumaSwNegNe = lumaSw.y - lumaNe;
- #endif
-/*--------------------------------------------------------------------------*/
-// (3)
- half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
- half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
- #else
- half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
- half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
- #endif
-/*--------------------------------------------------------------------------*/
-// (4)
- half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- half dirZ = lumaNw.w + lumaSwNegNe;
- half dirX = -lumaNw.w + lumaSwNegNe;
- #else
- half dirZ = lumaNw.y + lumaSwNegNe;
- half dirX = -lumaNw.y + lumaSwNegNe;
- #endif
-/*--------------------------------------------------------------------------*/
-// (5)
- half3 dir;
- dir.y = 0.0;
- #if (FXAA_GREEN_AS_LUMA == 0)
- dir.x = lumaSe.w + dirX;
- dir.z = -lumaSe.w + dirZ;
- half lumaMinNeSe = min(lumaNe, lumaSe.w);
- #else
- dir.x = lumaSe.y + dirX;
- dir.z = -lumaSe.y + dirZ;
- half lumaMinNeSe = min(lumaNe, lumaSe.y);
- #endif
-/*--------------------------------------------------------------------------*/
-// (6)
- half4 dir1_pos;
- dir1_pos.xy = normalize(dir).xz;
- half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (7)
- half4 dir2_pos;
- dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
- dir1_pos.zw = pos.xy;
- dir2_pos.zw = pos.xy;
- #if (FXAA_GREEN_AS_LUMA == 0)
- half lumaMaxNeSe = max(lumaNe, lumaSe.w);
- #else
- half lumaMaxNeSe = max(lumaNe, lumaSe.y);
- #endif
-/*--------------------------------------------------------------------------*/
-// (8)
- half4 temp1N;
- temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
- temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
- half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
- half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
-/*--------------------------------------------------------------------------*/
-// (9)
- half4 rgby1;
- rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
- rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
- rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (10)
- half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
- #if (FXAA_GREEN_AS_LUMA == 0)
- half lumaMaxM = max(lumaMax, rgbyM.w);
- half lumaMinM = min(lumaMin, rgbyM.w);
- #else
- half lumaMaxM = max(lumaMax, rgbyM.y);
- half lumaMinM = min(lumaMin, rgbyM.y);
- #endif
-/*--------------------------------------------------------------------------*/
-// (11)
- half4 temp2N;
- temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
- temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
- half4 rgby2;
- rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
- half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
-/*--------------------------------------------------------------------------*/
-// (12)
- rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
- rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (13)
- rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (14)
- #if (FXAA_GREEN_AS_LUMA == 0)
- bool twoTapLt = rgby2.w < lumaMin;
- bool twoTapGt = rgby2.w > lumaMax;
- #else
- bool twoTapLt = rgby2.y < lumaMin;
- bool twoTapGt = rgby2.y > lumaMax;
- #endif
- bool earlyExit = lumaRangeM < lumaMax;
- bool twoTap = twoTapLt || twoTapGt;
-/*--------------------------------------------------------------------------*/
-// (15)
- if(twoTap) rgby2 = rgby1;
- if(earlyExit) rgby2 = rgbyM;
-/*--------------------------------------------------------------------------*/
- return rgby2; }
-/*==========================================================================*/
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/Fxaa3_8.glsllib b/src/Runtime/ogl-runtime/res/effectlib/Fxaa3_8.glsllib
deleted file mode 100644
index 620f5650..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/Fxaa3_8.glsllib
+++ /dev/null
@@ -1,1423 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 - 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-/*============================================================================
-
-
- NVIDIA FXAA III.8 by TIMOTHY LOTTES
-
-
-------------------------------------------------------------------------------
- INTEGRATION CHECKLIST
-------------------------------------------------------------------------------
-(1.)
-In the shader source,
-setup defines for the desired configuration.
-Example,
-
- #define FXAA_PC 1
- #define FXAA_HLSL_3 1
- #define FXAA_LINEAR 1
-
-(2.)
-Then include this file,
-
-
-
-(3.)
-Then call the FXAA pixel shader from within your desired shader,
-
- return FxaaPixelShader(pos, posPos, tex, rcpFrame, rcpFrameOpt);
-
-(4.)
-Insure pass prior to FXAA outputs RGBL.
-See next section.
-
-(5.)
-Setup engine to provide "rcpFrame" and "rcpFrameOpt" constants.
-Not using constants will result in a performance loss.
-
- // {x_} = 1.0/screenWidthInPixels
- // {_y} = 1.0/screenHeightInPixels
- float2 rcpFrame
-
- // This must be from a constant/uniform.
- // {x___} = 2.0/screenWidthInPixels
- // {_y__} = 2.0/screenHeightInPixels
- // {__z_} = 0.5/screenWidthInPixels
- // {___w} = 0.5/screenHeightInPixels
- float4 rcpFrameOpt
-
-(6.)
-Have FXAA vertex shader run as a full screen triangle,
-and output "pos" and "posPos" such that inputs in the pixel shader provide,
-
- // {xy} = center of pixel
- float2 pos,
-
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- float4 posPos,
-
-(7.)
-Insure the texture sampler used by FXAA is set to bilinear filtering.
-
-
-------------------------------------------------------------------------------
- INTEGRATION - RGBL AND COLORSPACE
-------------------------------------------------------------------------------
-FXAA3 requires RGBL as input.
-
-RGB should be LDR (low dynamic range).
-Specifically do FXAA after tonemapping.
-
-RGB data as returned by a texture fetch can be linear or non-linear.
-Note an "sRGB format" texture counts as linear,
-because the result of a texture fetch is linear data.
-Regular "RGBA8" textures in the sRGB colorspace are non-linear.
-If a texture fetch results linear data the following is required,
-
- #define FXAA_LINEAR 1
-
-Otherwise,
-
- #define FXAA_LINEAR 0
-
-Luma must be stored in the alpha channel prior to running FXAA.
-This luma value must be gamma 2.0 encoded if using FXAA_LINEAR 1.
-If using FXAA_LINEAR 0, luma should match the perceptual space used for RGB.
-
-Example pass before FXAA where output is gamma 2.0 encoded,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- color.rgb = sqrt(color.rgb); // gamma 2.0 color output
- return color;
-
-To use FXAA,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- color.rgb = sqrt(color.rgb); // gamma 2.0 color output
- color.a = dot(color.rgb, float3(0.299, 0.587, 0.114)); // compute luma
- return color;
-
-Another example where output is linear encoded,
-say for instance writing to an sRGB formated render target,
-where the render target does the conversion back to sRGB after blending,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- return color;
-
-To use FXAA,
-
- color.rgb = ToneMap(color.rgb); // linear color output
- color.a = sqrt(dot(color.rgb, float3(0.299, 0.587, 0.114))); // compute luma
- return color;
-
-Getting luma correct is required for the algorithm to work correctly.
-
-
-------------------------------------------------------------------------------
- COMPLEX INTEGRATION
-------------------------------------------------------------------------------
-Q. What if the engine is blending into RGB before wanting to run FXAA?
-
-A. In the last opaque pass prior to FXAA,
- have the pass write out luma into alpha.
- Then blend into RGB only.
- FXAA should be able to run ok
- assuming the blending pass did not any add aliasing.
- This should be the common case for particles and common blending passes.
-
-============================================================================*/
-
-/*============================================================================
-
- INTEGRATION KNOBS
-
-============================================================================*/
-//
-// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
-//
-// 1 = Use API.
-// 0 = Don't use API.
-//
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PS3
- #define FXAA_PS3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_360
- #define FXAA_360 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_PC
- //
- // FXAA Quality
- // The high quality PC algorithm.
- //
- #define FXAA_PC 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_PC_CONSOLE
- //
- // The console algorithm for PC is included
- // for developers targeting really low spec machines.
- //
- #define FXAA_PC_CONSOLE 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_120
- #define FXAA_GLSL_120 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GLSL_130
- #define FXAA_GLSL_130 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_3
- #define FXAA_HLSL_3 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_4
- #define FXAA_HLSL_4 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_HLSL_5
- #define FXAA_HLSL_5 0
-#endif
-/*==========================================================================*/
-#ifndef FXAA_EARLY_EXIT
- //
- // Controls algorithm's early exit path.
- // On PS3 turning this on adds 2 cycles to the shader.
- // On 360 turning this off adds 10ths of a millisecond to the shader.
- // Turning this off on console will result in a more blurry image.
- // So this defaults to on.
- //
- // 1 = On.
- // 0 = Off.
- //
- #define FXAA_EARLY_EXIT 1
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_DISCARD
- //
- // Only valid for PC OpenGL currently.
- //
- // 1 = Use discard on pixels which don't need AA.
- // For APIs which enable concurrent TEX+ROP from same surface.
- // 0 = Return unchanged color on pixels which don't need AA.
- //
- #define FXAA_DISCARD 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_LINEAR
- //
- // 0 = Work in non-linear color space.
- // Use this for standard 32-bit RGBA formats.
- //
- // 1 = Work in RGB=linear, A=non-linear luma.
- // Use this for sRGB and FP16 formats.
- // Works with either FXAA_ALGORITHM = 1 or 0.
- //
- #define FXAA_LINEAR 0
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_FAST_PIXEL_OFFSET
- //
- // Used for GLSL 120 only.
- //
- // 1 = GL API supports fast pixel offsets
- // 0 = do not use fast pixel offsets
- //
- #ifdef GL_EXT_gpu_shader4
- #define FXAA_FAST_PIXEL_OFFSET 1
- #endif
- #ifdef GL_NV_gpu_shader5
- #define FXAA_FAST_PIXEL_OFFSET 1
- #endif
- #ifdef GL_ARB_gpu_shader5
- #define FXAA_FAST_PIXEL_OFFSET 1
- #endif
- #ifndef FXAA_FAST_PIXEL_OFFSET
- #define FXAA_FAST_PIXEL_OFFSET 0
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_GATHER4_ALPHA
- //
- // 1 = API supports gather4 on alpha channel.
- // 0 = API does not support gather4 on alpha channel.
- //
-#ifdef GL_ES
- #if __VERSION__ >= 310
- #ifdef GL_EXT_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #endif
- #ifndef FXAA_GATHER4_ALPHA
- #define FXAA_GATHER4_ALPHA 0
- #endif
-#else
- #if (FXAA_HLSL_5 == 1)
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifdef GL_ARB_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifdef GL_NV_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifdef GL_EXT_gpu_shader5
- #define FXAA_GATHER4_ALPHA 1
- #endif
- #ifndef FXAA_GATHER4_ALPHA
- #define FXAA_GATHER4_ALPHA 0
- #endif
-#endif
-#endif
-
-/*============================================================================
- FXAA CONSOLE - TUNING KNOBS
-============================================================================*/
-#ifndef FXAA_CONSOLE__EDGE_SHARPNESS
- //
- // Consoles the sharpness of edges.
- //
- // Due to the PS3 being ALU bound,
- // there are only two safe values here: 4 and 8.
- // These options use the shaders ability to a free *|/ by 4|8.
- //
- // 8.0 is sharper
- // 4.0 is softer
- //
- #if 1
- #define FXAA_CONSOLE__EDGE_SHARPNESS 8.0
- #else
- #define FXAA_CONSOLE__EDGE_SHARPNESS 4.0
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_CONSOLE__EDGE_THRESHOLD
- //
- // The minimum amount of local contrast required to apply algorithm.
- // The console setting has a different mapping than the quality setting.
- //
- // This only applies when FXAA_EARLY_EXIT is 1.
- //
- // Due to the PS3 being ALU bound,
- // there are only two safe values here: 0.25 and 0.125.
- // These options use the shaders ability to a free *|/ by 4|8.
- //
- // 0.125 leaves less aliasing, but is softer
- // 0.25 leaves more aliasing, and is sharper
- //
- #if 1
- #define FXAA_CONSOLE__EDGE_THRESHOLD 0.125
- #else
- #define FXAA_CONSOLE__EDGE_THRESHOLD 0.25
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_CONSOLE__EDGE_THRESHOLD_MIN
- //
- // Trims the algorithm from processing darks.
- // The console setting has a different mapping than the quality setting.
- //
- // This only applies when FXAA_EARLY_EXIT is 1.
- //
- // This does not apply to PS3.
- // PS3 was simplified to avoid more shader instructions.
- //
- #define FXAA_CONSOLE__EDGE_THRESHOLD_MIN 0.05
-#endif
-
-/*============================================================================
- FXAA QUALITY - TUNING KNOBS
-============================================================================*/
-#ifndef FXAA_QUALITY__EDGE_THRESHOLD
- //
- // The minimum amount of local contrast required to apply algorithm.
- //
- // 1/3 - too little
- // 1/4 - low quality
- // 1/6 - default
- // 1/8 - high quality
- // 1/16 - overkill
- //
- #define FXAA_QUALITY__EDGE_THRESHOLD (1.0/6.0)
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_QUALITY__EDGE_THRESHOLD_MIN
- //
- // Trims the algorithm from processing darks.
- //
- // 1/32 - visible limit
- // 1/16 - high quality
- // 1/12 - upper limit (default, the start of visible unfiltered edges)
- //
- #define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/12.0)
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_QUALITY__SUBPIX_CAP
- //
- // Insures fine detail is not completely removed.
- // This partly overrides FXAA_SUBPIX_TRIM.
- //
- // 3/4 - default amount of filtering
- // 7/8 - high amount of filtering
- // 1 - no capping of filtering
- //
- #define FXAA_QUALITY__SUBPIX_CAP (3.0/4.0)
-#endif
-/*--------------------------------------------------------------------------*/
-#ifndef FXAA_QUALITY__SUBPIX_TRIM
- //
- // Controls removal of sub-pixel aliasing,
- //
- // 1/2 - low removal (sharper but more sub-pixel aliasing)
- // 1/3 - medium removal
- // 1/4 - default removal
- // 1/8 - high removal
- // 0 - complete removal (softer but less sub-pixel aliasing)
- //
- #define FXAA_QUALITY__SUBPIX_TRIM (1.0/4.0)
-#endif
-
-
-/*============================================================================
-
- API PORTING
-
-============================================================================*/
-#if FXAA_GLSL_120
- // Requires,
- // #version 120
- // And at least,
- // #extension GL_EXT_gpu_shader4 : enable
- // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
- #define half float
- #define half2 vec2
- #define half3 vec3
- #define half4 vec4
- #define int2 ivec2
- #define float2 vec2
- #define float3 vec3
- #define float4 vec4
- #define FxaaInt2 ivec2
- #define FxaaFloat2 vec2
- #define FxaaFloat3 vec3
- #define FxaaFloat4 vec4
- #define FxaaDiscard discard
- #define FxaaDot3(a, b) dot(a, b)
- #define FxaaSat(x) clamp(x, 0.0, 1.0)
- #define FxaaLerp(x,y,s) mix(x,y,s)
- #define FxaaTex sampler2D
- #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
- #if (FXAA_FAST_PIXEL_OFFSET == 1)
- #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
- #else
- #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
- #endif
- #if (FXAA_GATHER4_ALPHA == 1)
- // use #extension GL_ARB_gpu_shader5 : enable
- #define FxaaTexAlpha4(t, p, r) textureGather(t, p, 3)
- #define FxaaTexOffAlpha4(t, p, o, r) textureGatherOffset(t, p, o, 3)
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if FXAA_GLSL_130
- // Requires "#version 130" or better
- #define half float
- #define half2 vec2
- #define half3 vec3
- #define half4 vec4
- #define int2 ivec2
- #define float2 vec2
- #define float3 vec3
- #define float4 vec4
- #define FxaaInt2 ivec2
- #define FxaaFloat2 vec2
- #define FxaaFloat3 vec3
- #define FxaaFloat4 vec4
- #define FxaaDiscard discard
- #define FxaaDot3(a, b) dot(a, b)
- #define FxaaSat(x) clamp(x, 0.0, 1.0)
- #define FxaaLerp(x,y,s) mix(x,y,s)
- #define FxaaTex sampler2D
- #define FxaaTexTop(t, p) textureLod(t, p, 0.0)
- #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
- #if (FXAA_GATHER4_ALPHA == 1)
- // use #extension GL_ARB_gpu_shader5 : enable
- #define FxaaTexAlpha4(t, p, r) textureGather(t, p, 3)
- #define FxaaTexOffAlpha4(t, p, o, r) textureGatherOffset(t, p, o, 3)
- #endif
-#endif
-/*--------------------------------------------------------------------------*/
-#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1)
- #define int2 float2
- #define FxaaInt2 float2
- #define FxaaFloat2 float2
- #define FxaaFloat3 float3
- #define FxaaFloat4 float4
- #define FxaaDiscard clip(-1)
- #define FxaaDot3(a, b) dot(a, b)
- #define FxaaSat(x) saturate(x)
- #define FxaaLerp(x,y,s) lerp(x,y,s)
- #define FxaaTex sampler2D
- #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
- #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
-#endif
-/*--------------------------------------------------------------------------*/
-#if FXAA_HLSL_4
- #define FxaaInt2 int2
- #define FxaaFloat2 float2
- #define FxaaFloat3 float3
- #define FxaaFloat4 float4
- #define FxaaDiscard clip(-1)
- #define FxaaDot3(a, b) dot(a, b)
- #define FxaaSat(x) saturate(x)
- #define FxaaLerp(x,y,s) lerp(x,y,s)
- struct FxaaTex { SamplerState smpl; Texture2D tex; };
- #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
- #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
-#endif
-/*--------------------------------------------------------------------------*/
-#if FXAA_HLSL_5
- #define FxaaInt2 int2
- #define FxaaFloat2 float2
- #define FxaaFloat3 float3
- #define FxaaFloat4 float4
- #define FxaaDiscard clip(-1)
- #define FxaaDot3(a, b) dot(a, b)
- #define FxaaSat(x) saturate(x)
- #define FxaaLerp(x,y,s) lerp(x,y,s)
- struct FxaaTex { SamplerState smpl; Texture2D tex; };
- #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
- #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
- #define FxaaTexAlpha4(t, p, r) t.tex.GatherAlpha(t.smpl, p)
- #define FxaaTexOffAlpha4(t, p, o, r) t.tex.GatherAlpha(t.smpl, p, o)
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - 360 PIXEL SHADER
-
-------------------------------------------------------------------------------
-Might be some optimizations left here,
-as of this latest change didn't have a PIX dump to verify if TEX bound.
-============================================================================*/
-#if (FXAA_360 == 1)
-/*--------------------------------------------------------------------------*/
-half4 FxaaPixelShader(
- // {xy} = center of pixel
- float2 pos,
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- float4 posPos,
- // {rgb_} = color in linear or perceptual color space
- // {___a} = alpha output is junk value
- FxaaTex tex,
- // This must be from a constant/uniform.
- // {xy} = rcpFrame not used on PC version of FXAA Console
- float2 rcpFrame,
- // This must be from a constant/uniform.
- // {x___} = 2.0/screenWidthInPixels
- // {_y__} = 2.0/screenHeightInPixels
- // {__z_} = 0.5/screenWidthInPixels
- // {___w} = 0.5/screenHeightInPixels
- float4 rcpFrameOpt
-) {
-/*--------------------------------------------------------------------------*/
- half4 lumaNwNeSwSe;
- lumaNwNeSwSe.x = FxaaTexTop(tex, posPos.xy).w;
- lumaNwNeSwSe.y = FxaaTexTop(tex, posPos.zy).w;
- lumaNwNeSwSe.z = FxaaTexTop(tex, posPos.xw).w;
- lumaNwNeSwSe.w = FxaaTexTop(tex, posPos.zw).w;
-/*--------------------------------------------------------------------------*/
- half4 rgbyM = FxaaTexTop(tex, pos.xy);
-/*--------------------------------------------------------------------------*/
- lumaNwNeSwSe.y += 1.0/384.0;
-/*--------------------------------------------------------------------------*/
- half2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
- half2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
-/*--------------------------------------------------------------------------*/
- half lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
- half lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
-/*--------------------------------------------------------------------------*/
- half lumaMinM = min(lumaMin, rgbyM.w);
- half lumaMaxM = max(lumaMax, rgbyM.w);
- if((lumaMaxM - lumaMinM) < max(FXAA_CONSOLE__EDGE_THRESHOLD_MIN, lumaMax * FXAA_CONSOLE__EDGE_THRESHOLD))
- #if (FXAA_DISCARD == 1)
- FxaaDiscard;
- #else
- return rgbyM;
- #endif
-/*--------------------------------------------------------------------------*/
- half2 dir;
- dir.x = dot(lumaNwNeSwSe, float4(-1.0, -1.0, 1.0, 1.0));
- dir.y = dot(lumaNwNeSwSe, float4( 1.0, -1.0, 1.0,-1.0));
-/*--------------------------------------------------------------------------*/
- half2 dir1;
- dir1 = normalize(dir.xy);
-/*--------------------------------------------------------------------------*/
- half dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * FXAA_CONSOLE__EDGE_SHARPNESS;
- half2 dir2;
- dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
-/*--------------------------------------------------------------------------*/
- half4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * rcpFrameOpt.zw);
- half4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * rcpFrameOpt.zw);
- half4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * rcpFrameOpt.xy);
- half4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * rcpFrameOpt.xy);
-/*--------------------------------------------------------------------------*/
- half4 rgbyA = rgbyN1 * 0.5 + rgbyP1 * 0.5;
- half4 rgbyB = rgbyN2 * 0.25 + rgbyP2 * 0.25 + rgbyA * 0.5;
-/*--------------------------------------------------------------------------*/
- bool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
- if(twoTap) rgbyB.xyz = rgbyA.xyz;
- return rgbyB;
-}
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
-
-==============================================================================
-The code below does not exactly match the assembly.
-I have a feeling that 12 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
- --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-------------------------------------------------------------------------------
- NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
- 0: texpkb h0.w(TRUE), v5.zyxx, #0
- 2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
- 4: texpkb h0.w(TRUE), v5.xwxx, #0
- 6: addh h0.z(TRUE), -h2, h0.w
- 7: texpkb h1.w(TRUE), v5, #0
- 9: addh h0.x(TRUE), h0.z, -h1.w
- 10: addh h3.w(TRUE), h0.z, h1
- 11: texpkb h2.w(TRUE), v5.zwzz, #0
- 13: addh h0.z(TRUE), h3.w, -h2.w
- 14: addh h0.x(TRUE), h2.w, h0
- 15: nrmh h1.xz(TRUE), h0_n
- 16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
- 17: maxh h4.w(TRUE), h0, h1
- 18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
- 19: movr r1.zw(TRUE), v4.xxxy
- 20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
- 22: minh h5.w(TRUE), h0, h1
- 23: texpkb h0(TRUE), r2.xzxx, #0
- 25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
- 27: maxh h4.x(TRUE), h2.z, h2.w
- 28: texpkb h1(TRUE), r0.zwzz, #0
- 30: addh_d2 h1(TRUE), h0, h1
- 31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 33: texpkb h0(TRUE), r0, #0
- 35: minh h4.z(TRUE), h2, h2.w
- 36: fenct TRUE
- 37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 39: texpkb h2(TRUE), r1, #0
- 41: addh_d2 h0(TRUE), h0, h2
- 42: maxh h2.w(TRUE), h4, h4.x
- 43: minh h2.x(TRUE), h5.w, h4.z
- 44: addh_d2 h0(TRUE), h0, h1
- 45: slth h2.x(TRUE), h0.w, h2
- 46: sgth h2.w(TRUE), h0, h2
- 47: movh h0(TRUE), h0
- 48: addx.c0 rc(TRUE), h2, h2.w
- 49: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass | Unit | uOp | PC: Op
------+--------+------+-------------------------
- 1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | SCB1 | add | 2: ADDh h2.z, h0.--w-, const.--x-;
- | | |
- 2 | SCT0/1 | mov | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | TEX | txl | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | SCB1 | add | 6: ADDh h0.z,-h2, h0.--w-;
- | | |
- 3 | SCT0/1 | mov | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0;
- | TEX | txl | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0;
- | SCB0 | add | 9: ADDh h0.x, h0.z---,-h1.w---;
- | SCB1 | add | 10: ADDh h3.w, h0.---z, h1;
- | | |
- 4 | SCT0/1 | mov | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | TEX | txl | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | SCB0 | add | 14: ADDh h0.x, h2.w---, h0;
- | SCB1 | add | 13: ADDh h0.z, h3.--w-,-h2.--w-;
- | | |
- 5 | SCT1 | mov | 15: NRMh h1.xz, h0;
- | SRB | nrm | 15: NRMh h1.xz, h0;
- | SCB0 | min | 16: MINh*8 h0.x, |h1|, |h1.z---|;
- | SCB1 | max | 17: MAXh h4.w, h0, h1;
- | | |
- 6 | SCT0 | div | 18: DIVx h2.xy, h1.xz--, h0;
- | SCT1 | mov | 19: MOVr r1.zw, g[TEX0].--xy;
- | SCB0 | mad | 20: MADr r2.xz,-h1, const.z-w-, r1.z-w-;
- | SCB1 | min | 22: MINh h5.w, h0, h1;
- | | |
- 7 | SCT0/1 | mov | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0;
- | TEX | txl | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0;
- | SCB0 | max | 27: MAXh h4.x, h2.z---, h2.w---;
- | SCB1 | mad | 25: MADr r0.zw, h1.--xz, const, r1;
- | | |
- 8 | SCT0/1 | mov | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0;
- | TEX | txl | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0;
- | SCB0/1 | add | 30: ADDh/2 h1, h0, h1;
- | | |
- 9 | SCT0 | mad | 31: MADr r0.xy,-h2, const.xy--, r1.zw--;
- | SCT1 | mov | 33: TXLr h0, r0, const.zzzz, TEX0;
- | TEX | txl | 33: TXLr h0, r0, const.zzzz, TEX0;
- | SCB1 | min | 35: MINh h4.z, h2, h2.--w-;
- | | |
- 10 | SCT0 | mad | 37: MADr r1.xy, h2, const.xy--, r1.zw--;
- | SCT1 | mov | 39: TXLr h2, r1, const.zzzz, TEX0;
- | TEX | txl | 39: TXLr h2, r1, const.zzzz, TEX0;
- | SCB0/1 | add | 41: ADDh/2 h0, h0, h2;
- | | |
- 11 | SCT0 | min | 43: MINh h2.x, h5.w---, h4.z---;
- | SCT1 | max | 42: MAXh h2.w, h4, h4.---x;
- | SCB0/1 | add | 44: ADDh/2 h0, h0, h1;
- | | |
- 12 | SCT0 | set | 45: SLTh h2.x, h0.w---, h2;
- | SCT1 | set | 46: SGTh h2.w, h0, h2;
- | SCB0/1 | mul | 47: MOVh h0, h0;
- | | |
- 13 | SCT0 | mad | 48: ADDxc0_s rc, h2, h2.w---;
- | SCB0/1 | mul | 49: MOVh h0(NE0.xxxx), h1;
-
-Pass SCT TEX SCB
- 1: 0% 100% 25%
- 2: 0% 100% 25%
- 3: 0% 100% 50%
- 4: 0% 100% 50%
- 5: 0% 0% 50%
- 6: 100% 0% 75%
- 7: 0% 100% 75%
- 8: 0% 100% 100%
- 9: 0% 100% 25%
- 10: 0% 100% 100%
- 11: 50% 0% 100%
- 12: 50% 0% 100%
- 13: 25% 0% 100%
-
-MEAN: 17% 61% 67%
-
-Pass SCT0 SCT1 TEX SCB0 SCB1
- 1: 0% 0% 100% 0% 100%
- 2: 0% 0% 100% 0% 100%
- 3: 0% 0% 100% 100% 100%
- 4: 0% 0% 100% 100% 100%
- 5: 0% 0% 0% 100% 100%
- 6: 100% 100% 0% 100% 100%
- 7: 0% 0% 100% 100% 100%
- 8: 0% 0% 100% 100% 100%
- 9: 0% 0% 100% 0% 100%
- 10: 0% 0% 100% 100% 100%
- 11: 100% 100% 0% 100% 100%
- 12: 100% 100% 0% 100% 100%
- 13: 100% 0% 0% 100% 100%
-
-MEAN: 30% 23% 61% 76% 100%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 13 cycles, 3 r regs, 923,076,923 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
-/*--------------------------------------------------------------------------*/
-#pragma disablepc all
-#pragma option O3
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
- // {xy} = center of pixel
- float2 pos,
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- float4 posPos,
- // {rgb_} = color in linear or perceptual color space
- // {___a} = luma in perceptual color space (not linear)
- sampler2D tex,
- // This must be from a constant/uniform.
- // {xy} = rcpFrame not used on PS3
- float2 rcpFrame,
- // This must be from a constant/uniform.
- // {x___} = 2.0/screenWidthInPixels
- // {_y__} = 2.0/screenHeightInPixels
- // {__z_} = 0.5/screenWidthInPixels
- // {___w} = 0.5/screenHeightInPixels
- float4 rcpFrameOpt
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
- half4 dir;
- half4 lumaNe = h4tex2Dlod(tex, half4(posPos.zy, 0, 0));
- lumaNe.w += half(1.0/512.0);
- dir.x = -lumaNe.w;
- dir.z = -lumaNe.w;
-/*--------------------------------------------------------------------------*/
-// (2)
- half4 lumaSw = h4tex2Dlod(tex, half4(posPos.xw, 0, 0));
- dir.x += lumaSw.w;
- dir.z += lumaSw.w;
-/*--------------------------------------------------------------------------*/
-// (3)
- half4 lumaNw = h4tex2Dlod(tex, half4(posPos.xy, 0, 0));
- dir.x -= lumaNw.w;
- dir.z += lumaNw.w;
-/*--------------------------------------------------------------------------*/
-// (4)
- half4 lumaSe = h4tex2Dlod(tex, half4(posPos.zw, 0, 0));
- dir.x += lumaSe.w;
- dir.z -= lumaSe.w;
-/*--------------------------------------------------------------------------*/
-// (5)
- half4 dir1_pos;
- dir1_pos.xy = normalize(dir.xyz).xz;
- half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (6)
- half4 dir2_pos;
- dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
- dir1_pos.zw = pos.xy;
- dir2_pos.zw = pos.xy;
- half4 temp1N;
- temp1N.xy = dir1_pos.zw - dir1_pos.xy * rcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (7)
- temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
- half4 rgby1;
- rgby1.xy = dir1_pos.zw + dir1_pos.xy * rcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
-// (8)
- rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
- rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (9)
- half4 temp2N;
- temp2N.xy = dir2_pos.zw - dir2_pos.xy * rcpFrameOpt.xy;
- temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
-/*--------------------------------------------------------------------------*/
-// (10)
- half4 rgby2;
- rgby2.xy = dir2_pos.zw + dir2_pos.xy * rcpFrameOpt.xy;
- rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
- rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (11)
- // compilier moves these scalar ops up to other cycles
- half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
- half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
- rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (12)
- bool twoTapLt = rgby2.w < lumaMin;
- bool twoTapGt = rgby2.w > lumaMax;
-/*--------------------------------------------------------------------------*/
-// (13)
- if(twoTapLt || twoTapGt) rgby2 = rgby1;
-/*--------------------------------------------------------------------------*/
- return rgby2; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
-
-==============================================================================
-The code mostly matches the assembly.
-I have a feeling that 14 cycles is possible, but was not able to get there.
-Might have to increase register count to get full performance.
-Note this shader does not use perspective interpolation.
-
-Use the following cgc options,
-
- --fenable-bx2 --fastmath --fastprecision --nofloatbindings
-
-------------------------------------------------------------------------------
- NVSHADERPERF OUTPUT
-------------------------------------------------------------------------------
-For reference and to aid in debug, output of NVShaderPerf should match this,
-
-Shader to schedule:
- 0: texpkb h0.w(TRUE), v5.zyxx, #0
- 2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
- 4: texpkb h1.w(TRUE), v5.xwxx, #0
- 6: addh h0.x(TRUE), h1.w, -h2.y
- 7: texpkb h2.w(TRUE), v5.zwzz, #0
- 9: minh h4.w(TRUE), h2.y, h2
- 10: maxh h5.x(TRUE), h2.y, h2.w
- 11: texpkb h0.w(TRUE), v5, #0
- 13: addh h3.w(TRUE), -h0, h0.x
- 14: addh h0.x(TRUE), h0.w, h0
- 15: addh h0.z(TRUE), -h2.w, h0.x
- 16: addh h0.x(TRUE), h2.w, h3.w
- 17: minh h5.y(TRUE), h0.w, h1.w
- 18: nrmh h2.xz(TRUE), h0_n
- 19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
- 20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
- 21: movr r1.zw(TRUE), v4.xxxy
- 22: maxh h2.w(TRUE), h0, h1
- 23: fenct TRUE
- 24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 26: texpkb h0(TRUE), r0, #0
- 28: maxh h5.x(TRUE), h2.w, h5
- 29: minh h5.w(TRUE), h5.y, h4
- 30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
- 32: texpkb h2(TRUE), r1, #0
- 34: addh_d2 h2(TRUE), h0, h2
- 35: texpkb h1(TRUE), v4, #0
- 37: maxh h5.y(TRUE), h5.x, h1.w
- 38: minh h4.w(TRUE), h1, h5
- 39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 41: texpkb h0(TRUE), r0, #0
- 43: addh_m8 h5.z(TRUE), h5.y, -h4.w
- 44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
- 46: texpkb h3(TRUE), r2, #0
- 48: addh_d2 h0(TRUE), h0, h3
- 49: addh_d2 h3(TRUE), h0, h2
- 50: movh h0(TRUE), h3
- 51: slth h3.x(TRUE), h3.w, h5.w
- 52: sgth h3.w(TRUE), h3, h5.x
- 53: addx.c0 rc(TRUE), h3.x, h3
- 54: slth.c0 rc(TRUE), h5.z, h5
- 55: movh h0(c0.NE.w), h2
- 56: movh h0(c0.NE.x), h1
-
-IPU0 ------ Simplified schedule: --------
-Pass | Unit | uOp | PC: Op
------+--------+------+-------------------------
- 1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
- | SCB0 | add | 2: ADDh h2.y, h0.-w--, const.-x--;
- | | |
- 2 | SCT0/1 | mov | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | TEX | txl | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
- | SCB0 | add | 6: ADDh h0.x, h1.w---,-h2.y---;
- | | |
- 3 | SCT0/1 | mov | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | TEX | txl | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
- | SCB0 | max | 10: MAXh h5.x, h2.y---, h2.w---;
- | SCB1 | min | 9: MINh h4.w, h2.---y, h2;
- | | |
- 4 | SCT0/1 | mov | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0;
- | TEX | txl | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0;
- | SCB0 | add | 14: ADDh h0.x, h0.w---, h0;
- | SCB1 | add | 13: ADDh h3.w,-h0, h0.---x;
- | | |
- 5 | SCT0 | mad | 16: ADDh h0.x, h2.w---, h3.w---;
- | SCT1 | mad | 15: ADDh h0.z,-h2.--w-, h0.--x-;
- | SCB0 | min | 17: MINh h5.y, h0.-w--, h1.-w--;
- | | |
- 6 | SCT1 | mov | 18: NRMh h2.xz, h0;
- | SRB | nrm | 18: NRMh h2.xz, h0;
- | SCB1 | min | 19: MINh*8 h2.w, |h2.---x|, |h2.---z|;
- | | |
- 7 | SCT0 | div | 20: DIVx h4.xy, h2.xz--, h2.ww--;
- | SCT1 | mov | 21: MOVr r1.zw, g[TEX0].--xy;
- | SCB1 | max | 22: MAXh h2.w, h0, h1;
- | | |
- 8 | SCT0 | mad | 24: MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
- | SCT1 | mov | 26: TXLr h0, r0, const.xxxx, TEX0;
- | TEX | txl | 26: TXLr h0, r0, const.xxxx, TEX0;
- | SCB0 | max | 28: MAXh h5.x, h2.w---, h5;
- | SCB1 | min | 29: MINh h5.w, h5.---y, h4;
- | | |
- 9 | SCT0 | mad | 30: MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
- | SCT1 | mov | 32: TXLr h2, r1, const.xxxx, TEX0;
- | TEX | txl | 32: TXLr h2, r1, const.xxxx, TEX0;
- | SCB0/1 | add | 34: ADDh/2 h2, h0, h2;
- | | |
- 10 | SCT0/1 | mov | 35: TXLr h1, g[TEX0], const.xxxx, TEX0;
- | TEX | txl | 35: TXLr h1, g[TEX0], const.xxxx, TEX0;
- | SCB0 | max | 37: MAXh h5.y, h5.-x--, h1.-w--;
- | SCB1 | min | 38: MINh h4.w, h1, h5;
- | | |
- 11 | SCT0 | mad | 39: MADr r0.xy,-h4, const.xy--, r1.zw--;
- | SCT1 | mov | 41: TXLr h0, r0, const.zzzz, TEX0;
- | TEX | txl | 41: TXLr h0, r0, const.zzzz, TEX0;
- | SCB0 | mad | 44: MADr r2.xy, h4, const.xy--, r1.zw--;
- | SCB1 | add | 43: ADDh*8 h5.z, h5.--y-,-h4.--w-;
- | | |
- 12 | SCT0/1 | mov | 46: TXLr h3, r2, const.xxxx, TEX0;
- | TEX | txl | 46: TXLr h3, r2, const.xxxx, TEX0;
- | SCB0/1 | add | 48: ADDh/2 h0, h0, h3;
- | | |
- 13 | SCT0/1 | mad | 49: ADDh/2 h3, h0, h2;
- | SCB0/1 | mul | 50: MOVh h0, h3;
- | | |
- 14 | SCT0 | set | 51: SLTh h3.x, h3.w---, h5.w---;
- | SCT1 | set | 52: SGTh h3.w, h3, h5.---x;
- | SCB0 | set | 54: SLThc0 rc, h5.z---, h5;
- | SCB1 | add | 53: ADDxc0_s rc, h3.---x, h3;
- | | |
- 15 | SCT0/1 | mul | 55: MOVh h0(NE0.wwww), h2;
- | SCB0/1 | mul | 56: MOVh h0(NE0.xxxx), h1;
-
-Pass SCT TEX SCB
- 1: 0% 100% 25%
- 2: 0% 100% 25%
- 3: 0% 100% 50%
- 4: 0% 100% 50%
- 5: 50% 0% 25%
- 6: 0% 0% 25%
- 7: 100% 0% 25%
- 8: 0% 100% 50%
- 9: 0% 100% 100%
- 10: 0% 100% 50%
- 11: 0% 100% 75%
- 12: 0% 100% 100%
- 13: 100% 0% 100%
- 14: 50% 0% 50%
- 15: 100% 0% 100%
-
-MEAN: 26% 60% 56%
-
-Pass SCT0 SCT1 TEX SCB0 SCB1
- 1: 0% 0% 100% 100% 0%
- 2: 0% 0% 100% 100% 0%
- 3: 0% 0% 100% 100% 100%
- 4: 0% 0% 100% 100% 100%
- 5: 100% 100% 0% 100% 0%
- 6: 0% 0% 0% 0% 100%
- 7: 100% 100% 0% 0% 100%
- 8: 0% 0% 100% 100% 100%
- 9: 0% 0% 100% 100% 100%
- 10: 0% 0% 100% 100% 100%
- 11: 0% 0% 100% 100% 100%
- 12: 0% 0% 100% 100% 100%
- 13: 100% 100% 0% 100% 100%
- 14: 100% 100% 0% 100% 100%
- 15: 100% 100% 0% 100% 100%
-
-MEAN: 33% 33% 60% 86% 80%
-Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
-Results 15 cycles, 3 r regs, 800,000,000 pixels/s
-============================================================================*/
-#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
-/*--------------------------------------------------------------------------*/
-#pragma disablepc all
-#pragma option O2
-#pragma option OutColorPrec=fp16
-#pragma texformat default RGBA8
-/*==========================================================================*/
-half4 FxaaPixelShader(
- // {xy} = center of pixel
- float2 pos,
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- float4 posPos,
- // {rgb_} = color in linear or perceptual color space
- // {___a} = luma in perceptual color space (not linear)
- sampler2D tex,
- // This must be from a constant/uniform.
- // {xy} = rcpFrame not used on PS3
- float2 rcpFrame,
- // This must be from a constant/uniform.
- // {x___} = 2.0/screenWidthInPixels
- // {_y__} = 2.0/screenHeightInPixels
- // {__z_} = 0.5/screenWidthInPixels
- // {___w} = 0.5/screenHeightInPixels
- float4 rcpFrameOpt
-) {
-/*--------------------------------------------------------------------------*/
-// (1)
- half4 rgbyNe = h4tex2Dlod(tex, half4(posPos.zy, 0, 0));
- half lumaNe = rgbyNe.w + half(1.0/512.0);
-/*--------------------------------------------------------------------------*/
-// (2)
- half4 lumaSw = h4tex2Dlod(tex, half4(posPos.xw, 0, 0));
- half lumaSwNegNe = lumaSw.w - lumaNe;
-/*--------------------------------------------------------------------------*/
-// (3)
- half4 lumaNw = h4tex2Dlod(tex, half4(posPos.xy, 0, 0));
- half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
- half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
-/*--------------------------------------------------------------------------*/
-// (4)
- half4 lumaSe = h4tex2Dlod(tex, half4(posPos.zw, 0, 0));
- half dirZ = lumaNw.w + lumaSwNegNe;
- half dirX = -lumaNw.w + lumaSwNegNe;
-/*--------------------------------------------------------------------------*/
-// (5)
- half3 dir;
- dir.y = 0.0;
- dir.x = lumaSe.w + dirX;
- dir.z = -lumaSe.w + dirZ;
- half lumaMinNeSe = min(lumaNe, lumaSe.w);
-/*--------------------------------------------------------------------------*/
-// (6)
- half4 dir1_pos;
- dir1_pos.xy = normalize(dir).xz;
- half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
-// (7)
- half4 dir2_pos;
- dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
- dir1_pos.zw = pos.xy;
- dir2_pos.zw = pos.xy;
- half lumaMaxNeSe = max(lumaNe, lumaSe.w);
-/*--------------------------------------------------------------------------*/
-// (8)
- half4 temp1N;
- temp1N.xy = dir1_pos.zw - dir1_pos.xy * rcpFrameOpt.zw;
- temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
- half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
- half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
-/*--------------------------------------------------------------------------*/
-// (9)
- half4 rgby1;
- rgby1.xy = dir1_pos.zw + dir1_pos.xy * rcpFrameOpt.zw;
- rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
- rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (10)
- half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
- half lumaMaxM = max(lumaMax, rgbyM.w);
- half lumaMinM = min(lumaMin, rgbyM.w);
-/*--------------------------------------------------------------------------*/
-// (11)
- half4 temp2N;
- temp2N.xy = dir2_pos.zw - dir2_pos.xy * rcpFrameOpt.xy;
- temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
- half4 rgby2;
- rgby2.xy = dir2_pos.zw + dir2_pos.xy * rcpFrameOpt.xy;
- half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__EDGE_THRESHOLD;
-/*--------------------------------------------------------------------------*/
-// (12)
- rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
- rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (13)
- rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
-// (14)
- bool twoTapLt = rgby2.w < lumaMin;
- bool twoTapGt = rgby2.w > lumaMax;
- bool earlyExit = lumaRangeM < lumaMax;
- bool twoTap = twoTapLt || twoTapGt;
-/*--------------------------------------------------------------------------*/
-// (15)
- if(twoTap) rgby2 = rgby1;
- if(earlyExit) rgby2 = rgbyM;
-/*--------------------------------------------------------------------------*/
- return rgby2; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 CONSOLE - PC PIXEL SHADER
-
-------------------------------------------------------------------------------
-Using a modified version of the PS3 version here to best target old hardware.
-============================================================================*/
-#if (FXAA_PC_CONSOLE == 1)
-/*--------------------------------------------------------------------------*/
-half4 FxaaPixelShader(
- // {xy} = center of pixel
- float2 pos,
- // {xy__} = upper left of pixel
- // {__zw} = lower right of pixel
- float4 posPos,
- // {rgb_} = color in linear or perceptual color space
- // {___a} = alpha output is junk value
- FxaaTex tex,
- // This must be from a constant/uniform.
- // {xy} = rcpFrame not used on PC version of FXAA Console
- float2 rcpFrame,
- // This must be from a constant/uniform.
- // {x___} = 2.0/screenWidthInPixels
- // {_y__} = 2.0/screenHeightInPixels
- // {__z_} = 0.5/screenWidthInPixels
- // {___w} = 0.5/screenHeightInPixels
- float4 rcpFrameOpt
-) {
-/*--------------------------------------------------------------------------*/
- half4 dir;
- dir.y = 0.0;
- half4 lumaNe = FxaaTexTop(tex, posPos.zy);
- lumaNe.w += half(1.0/384.0);
- dir.x = -lumaNe.w;
- dir.z = -lumaNe.w;
-/*--------------------------------------------------------------------------*/
- half4 lumaSw = FxaaTexTop(tex, posPos.xw);
- dir.x += lumaSw.w;
- dir.z += lumaSw.w;
-/*--------------------------------------------------------------------------*/
- half4 lumaNw = FxaaTexTop(tex, posPos.xy);
- dir.x -= lumaNw.w;
- dir.z += lumaNw.w;
-/*--------------------------------------------------------------------------*/
- half4 lumaSe = FxaaTexTop(tex, posPos.zw);
- dir.x += lumaSe.w;
- dir.z -= lumaSe.w;
-/*==========================================================================*/
- #if (FXAA_EARLY_EXIT == 1)
- half4 rgbyM = FxaaTexTop(tex, pos.xy);
-/*--------------------------------------------------------------------------*/
- half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
- half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
-/*--------------------------------------------------------------------------*/
- half lumaMinM = min(lumaMin, rgbyM.w);
- half lumaMaxM = max(lumaMax, rgbyM.w);
-/*--------------------------------------------------------------------------*/
- if((lumaMaxM - lumaMinM) < max(FXAA_CONSOLE__EDGE_THRESHOLD_MIN, lumaMax * FXAA_CONSOLE__EDGE_THRESHOLD))
- #if (FXAA_DISCARD == 1)
- FxaaDiscard;
- #else
- return rgbyM;
- #endif
- #endif
-/*==========================================================================*/
- half4 dir1_pos;
- dir1_pos.xy = normalize(dir.xyz).xz;
- half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__EDGE_SHARPNESS);
-/*--------------------------------------------------------------------------*/
- half4 dir2_pos;
- dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
- dir1_pos.zw = pos.xy;
- dir2_pos.zw = pos.xy;
- half4 temp1N;
- temp1N.xy = dir1_pos.zw - dir1_pos.xy * rcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
- temp1N = FxaaTexTop(tex, temp1N.xy);
- half4 rgby1;
- rgby1.xy = dir1_pos.zw + dir1_pos.xy * rcpFrameOpt.zw;
-/*--------------------------------------------------------------------------*/
- rgby1 = FxaaTexTop(tex, rgby1.xy);
- rgby1 = (temp1N + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
- half4 temp2N;
- temp2N.xy = dir2_pos.zw - dir2_pos.xy * rcpFrameOpt.xy;
- temp2N = FxaaTexTop(tex, temp2N.xy);
-/*--------------------------------------------------------------------------*/
- half4 rgby2;
- rgby2.xy = dir2_pos.zw + dir2_pos.xy * rcpFrameOpt.xy;
- rgby2 = FxaaTexTop(tex, rgby2.xy);
- rgby2 = (temp2N + rgby2) * 0.5;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_EARLY_EXIT == 0)
- half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
- half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
- #endif
- rgby2 = (rgby2 + rgby1) * 0.5;
-/*--------------------------------------------------------------------------*/
- bool twoTapLt = rgby2.w < lumaMin;
- bool twoTapGt = rgby2.w > lumaMax;
-/*--------------------------------------------------------------------------*/
- if(twoTapLt || twoTapGt) rgby2 = rgby1;
-/*--------------------------------------------------------------------------*/
- return rgby2; }
-/*==========================================================================*/
-#endif
-
-
-
-/*============================================================================
-
- FXAA3 QUALITY - PC
-
-============================================================================*/
-#if (FXAA_PC == 1)
-/*--------------------------------------------------------------------------*/
-float4 FxaaPixelShader(
- // {xy} = center of pixel
- float2 pos,
- // {xyzw} = not used on FXAA3 Quality
- float4 posPos,
- // {rgb_} = color in linear or perceptual color space
- // {___a} = luma in perceptual color space (not linear)
- FxaaTex tex,
- // This must be from a constant/uniform.
- // {x_} = 1.0/screenWidthInPixels
- // {_y} = 1.0/screenHeightInPixels
- float2 rcpFrame,
- // {xyzw} = not used on FXAA3 Quality
- float4 rcpFrameOpt
-) {
-/*--------------------------------------------------------------------------*/
- #if (FXAA_GATHER4_ALPHA == 1)
- float4 luma4A = FxaaTexOffAlpha4(tex, pos.xy, FxaaInt2(-1, -1), rcpFrame.xy);
- #if (FXAA_DISCARD == 0)
- float4 rgbyM = FxaaTexTop(tex, pos.xy);
- #endif
- float4 luma4B = FxaaTexAlpha4(tex, pos.xy, rcpFrame.xy);
- float lumaNE = FxaaTexOff(tex, pos.xy, FxaaInt2(1, -1), rcpFrame.xy).w;
- float lumaSW = FxaaTexOff(tex, pos.xy, FxaaInt2(-1, 1), rcpFrame.xy).w;
- float lumaNW = luma4A.w;
- float lumaN = luma4A.z;
- float lumaW = luma4A.x;
- float lumaM = luma4A.y;
- float lumaE = luma4B.z;
- float lumaS = luma4B.x;
- float lumaSE = luma4B.y;
- #else
- float lumaN = FxaaTexOff(tex, pos.xy, FxaaInt2(0, -1), rcpFrame.xy).w;
- float lumaW = FxaaTexOff(tex, pos.xy, FxaaInt2(-1, 0), rcpFrame.xy).w;
- float4 rgbyM = FxaaTexTop(tex, pos.xy);
- float lumaE = FxaaTexOff(tex, pos.xy, FxaaInt2( 1, 0), rcpFrame.xy).w;
- float lumaS = FxaaTexOff(tex, pos.xy, FxaaInt2( 0, 1), rcpFrame.xy).w;
- float lumaM = rgbyM.w;
- #endif
-/*--------------------------------------------------------------------------*/
- float rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));
- float rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));
- float range = rangeMax - rangeMin;
-/*--------------------------------------------------------------------------*/
- if(range < max(FXAA_QUALITY__EDGE_THRESHOLD_MIN, rangeMax * FXAA_QUALITY__EDGE_THRESHOLD))
- #if (FXAA_DISCARD == 1)
- FxaaDiscard;
- #else
- return rgbyM;
- #endif
-/*--------------------------------------------------------------------------*/
- #if (FXAA_GATHER4_ALPHA == 0)
- float lumaNW = FxaaTexOff(tex, pos.xy, FxaaInt2(-1,-1), rcpFrame.xy).w;
- float lumaNE = FxaaTexOff(tex, pos.xy, FxaaInt2( 1,-1), rcpFrame.xy).w;
- float lumaSW = FxaaTexOff(tex, pos.xy, FxaaInt2(-1, 1), rcpFrame.xy).w;
- float lumaSE = FxaaTexOff(tex, pos.xy, FxaaInt2( 1, 1), rcpFrame.xy).w;
- #endif
-/*--------------------------------------------------------------------------*/
- #define FXAA_QUALITY__SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_QUALITY__SUBPIX_TRIM))
-/*--------------------------------------------------------------------------*/
- float lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;
- float rangeL = abs(lumaL - lumaM);
- float blendL = FxaaSat((rangeL / range) - FXAA_QUALITY__SUBPIX_TRIM) * FXAA_QUALITY__SUBPIX_TRIM_SCALE;
- blendL = min(FXAA_QUALITY__SUBPIX_CAP, blendL);
-/*--------------------------------------------------------------------------*/
- float edgeVert =
- abs(lumaNW + (-2.0 * lumaN) + lumaNE) +
- 2.0 * abs(lumaW + (-2.0 * lumaM) + lumaE ) +
- abs(lumaSW + (-2.0 * lumaS) + lumaSE);
- float edgeHorz =
- abs(lumaNW + (-2.0 * lumaW) + lumaSW) +
- 2.0 * abs(lumaN + (-2.0 * lumaM) + lumaS ) +
- abs(lumaNE + (-2.0 * lumaE) + lumaSE);
- bool horzSpan = edgeHorz >= edgeVert;
-/*--------------------------------------------------------------------------*/
- float lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;
- if(!horzSpan) lumaN = lumaW;
- if(!horzSpan) lumaS = lumaE;
- float gradientN = abs(lumaN - lumaM);
- float gradientS = abs(lumaS - lumaM);
- lumaN = (lumaN + lumaM) * 0.5;
- lumaS = (lumaS + lumaM) * 0.5;
-/*--------------------------------------------------------------------------*/
- bool pairN = gradientN >= gradientS;
- if(!pairN) lumaN = lumaS;
- if(!pairN) gradientN = gradientS;
- if(!pairN) lengthSign *= -1.0;
- float2 posN;
- posN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);
- posN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);
-/*--------------------------------------------------------------------------*/
- #define FXAA_SEARCH_STEPS 6
- #define FXAA_SEARCH_THRESHOLD (1.0/4.0)
-/*--------------------------------------------------------------------------*/
- gradientN *= FXAA_SEARCH_THRESHOLD;
-/*--------------------------------------------------------------------------*/
- float2 posP = posN;
- float2 offNP = horzSpan ?
- FxaaFloat2(rcpFrame.x, 0.0) :
- FxaaFloat2(0.0, rcpFrame.y);
- float lumaEndN;
- float lumaEndP;
- bool doneN = false;
- bool doneP = false;
- posN += offNP * (-1.5);
- posP += offNP * ( 1.5);
- for(int i = 0; i < FXAA_SEARCH_STEPS; i++) {
- lumaEndN = FxaaTexTop(tex, posN.xy).w;
- lumaEndP = FxaaTexTop(tex, posP.xy).w;
- bool doneN2 = abs(lumaEndN - lumaN) >= gradientN;
- bool doneP2 = abs(lumaEndP - lumaN) >= gradientN;
- if(doneN2 && !doneN) posN += offNP;
- if(doneP2 && !doneP) posP -= offNP;
- if(doneN2 && doneP2) break;
- doneN = doneN2;
- doneP = doneP2;
- if(!doneN) posN -= offNP * 2.0;
- if(!doneP) posP += offNP * 2.0; }
-/*--------------------------------------------------------------------------*/
- float dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;
- float dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;
-/*--------------------------------------------------------------------------*/
- bool directionN = dstN < dstP;
- lumaEndN = directionN ? lumaEndN : lumaEndP;
-/*--------------------------------------------------------------------------*/
- if(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))
- lengthSign = 0.0;
-/*--------------------------------------------------------------------------*/
- float spanLength = (dstP + dstN);
- dstN = directionN ? dstN : dstP;
- float subPixelOffset = 0.5 + (dstN * (-1.0/spanLength));
- subPixelOffset += blendL * (1.0/8.0);
- subPixelOffset *= lengthSign;
- float3 rgbF = FxaaTexTop(tex, FxaaFloat2(
- pos.x + (horzSpan ? 0.0 : subPixelOffset),
- pos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;
-/*--------------------------------------------------------------------------*/
- #if (FXAA_LINEAR == 1)
- lumaL *= lumaL;
- #endif
- float lumaF = dot(rgbF, float3(0.299, 0.587, 0.114)) + (1.0/(65536.0*256.0));
- float lumaB = FxaaLerp(lumaF, lumaL, blendL);
- float scale = min(4.0, lumaB/lumaF);
- rgbF *= scale;
- return float4(rgbF, lumaM); }
-/*==========================================================================*/
-#endif
-
-
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/SMAA.glsllib b/src/Runtime/ogl-runtime/res/effectlib/SMAA.glsllib
deleted file mode 100644
index 97e0153a..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/SMAA.glsllib
+++ /dev/null
@@ -1,1444 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/**
- * Copyright (C) 2011 Jorge Jimenez (jorge@iryoku.com)
- * Copyright (C) 2011 Jose I. Echevarria (joseignacioechevarria@gmail.com)
- * Copyright (C) 2011 Belen Masia (bmasia@unizar.es)
- * Copyright (C) 2011 Fernando Navarro (fernandn@microsoft.com)
- * Copyright (C) 2011 Diego Gutierrez (diegog@unizar.es)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution:
- *
- * "Uses SMAA. Copyright (C) 2011 by Jorge Jimenez, Jose I. Echevarria,
- * Tiago Sousa, Belen Masia, Fernando Navarro and Diego Gutierrez."
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
- * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are
- * those of the authors and should not be interpreted as representing official
- * policies, either expressed or implied, of the copyright holders.
- */
-
-
-/**
- * _______ ___ ___ ___ ___
- * / || \/ | / \ / \
- * | (---- | \ / | / ^ \ / ^ \
- * \ \ | |\/| | / /_\ \ / /_\ \
- * ----) | | | | | / _____ \ / _____ \
- * |_______/ |__| |__| /__/ \__\ /__/ \__\
- *
- * E N H A N C E D
- * S U B P I X E L M O R P H O L O G I C A L A N T I A L I A S I N G
- *
- * http://www.iryoku.com/smaa/
- *
- * Hi, welcome aboard!
- *
- * Here you'll find instructions to get the shader up and running as fast as
- * possible.
- *
- * IMPORTANTE NOTICE: when updating, remember to update both this file and the
- * precomputed textures! They may change from version to version.
- *
- * The shader has three passes, chained together as follows:
- *
- * |input|------------------
- * v |
- * [ SMAA*EdgeDetection ] |
- * v |
- * |edgesTex| |
- * v |
- * [ SMAABlendingWeightCalculation ] |
- * v |
- * |blendTex| |
- * v |
- * [ SMAANeighborhoodBlending ] <------
- * v
- * |output|
- *
- * Note that each [pass] has its own vertex and pixel shader.
- *
- * You've three edge detection methods to choose from: luma, color or depth.
- * They represent different quality/performance and anti-aliasing/sharpness
- * tradeoffs, so our recommendation is for you to choose the one that best
- * suits your particular scenario:
- *
- * - Depth edge detection is usually the fastest but it may miss some edges.
- *
- * - Luma edge detection is usually more expensive than depth edge detection,
- * but catches visible edges that depth edge detection can miss.
- *
- * - Color edge detection is usually the most expensive one but catches
- * chroma-only edges.
- *
- * For quickstarters: just use luma edge detection.
- *
- * The general advice is to not rush the integration process and ensure each
- * step is done correctly (don't try to integrate SMAA T2x with predicated edge
- * detection from the start!). Ok then, let's go!
- *
- * 1. The first step is to create two RGBA temporal framebuffers for holding
- * |edgesTex| and |blendTex|.
- *
- * In DX10, you can use a RG framebuffer for the edges texture, but in our
- * experience it yields worse performance.
- *
- * On the Xbox 360, you can use the same framebuffer for resolving both
- * |edgesTex| and |blendTex|, as they aren't needed simultaneously.
- *
- * 2. Both temporal framebuffers |edgesTex| and |blendTex| must be cleared
- * each frame. Do not forget to clear the alpha channel!
- *
- * 3. The next step is loading the two supporting precalculated textures,
- * 'areaTex' and 'searchTex'. You'll find them in the 'Textures' folder as
- * C++ headers, and also as regular DDS files. They'll be needed for the
- * 'SMAABlendingWeightCalculation' pass.
- *
- * If you use the C++ headers, be sure to load them in the format specified
- * inside of them.
- *
- * 4. In DX9, all samplers must be set to linear filtering and clamp, with the
- * exception of 'searchTex', which must be set to point filtering.
- *
- * 5. All texture reads and buffer writes must be non-sRGB, with the exception
- * of the input read and the output write of input in
- * 'SMAANeighborhoodBlending' (and only in this pass!). If sRGB reads in
- * this last pass are not possible, the technique will work anyway, but
- * will perform antialiasing in gamma space.
- *
- * IMPORTANT: for best results the input read for the color/luma edge
- * detection should *NOT* be sRGB.
- *
- * 6. Before including SMAA.h you'll have to setup the framebuffer pixel size,
- * the target and any optional configuration defines. Optionally you can
- * use a preset.
- *
- * You have three targets available:
- * SMAA_HLSL_3
- * SMAA_HLSL_4
- * SMAA_HLSL_4_1
- * SMAA_GLSL_3 *
- * SMAA_GLSL_4 *
- *
- * * (See SMAA_ONLY_COMPILE_VS below).
- *
- * And four presets:
- * SMAA_PRESET_LOW (%60 of the quality)
- * SMAA_PRESET_MEDIUM (%80 of the quality)
- * SMAA_PRESET_HIGH (%95 of the quality)
- * SMAA_PRESET_ULTRA (%99 of the quality)
- *
- * For example:
- * #define SMAA_PIXEL_SIZE float2(1.0 / 1280.0, 1.0 / 720.0)
- * #define SMAA_HLSL_4 1
- * #define SMAA_PRESET_HIGH 1
- * include "SMAA.h"
- *
- * 7. Then, you'll have to setup the passes as indicated in the scheme above.
- * You can take a look into SMAA.fx, to see how we did it for our demo.
- * Checkout the function wrappers, you may want to copy-paste them!
- *
- * 8. It's recommended to validate the produced |edgesTex| and |blendTex|.
- * It's advised to not continue with the implementation until both buffers
- * are verified to produce identical results to our reference demo.
- *
- * 9. After you get the last pass to work, it's time to optimize. You'll have
- * to initialize a stencil buffer in the first pass (discard is already in
- * the code), then mask execution by using it the second pass. The last
- * pass should be executed in all pixels.
- *
- *
- * After this point you can choose to enable predicated thresholding,
- * temporal supersampling and motion blur integration:
- *
- * a) If you want to use predicated thresholding, take a look into
- * SMAA_PREDICATION; you'll need to pass an extra texture in the edge
- * detection pass.
- *
- * b) If you want to enable temporal supersampling (SMAA T2x):
- *
- * 1. The first step is to render using subpixel jitters. I won't go into
- * detail, but it's as simple as moving each vertex position in the
- * vertex shader, you can check how we do it in our DX10 demo.
- *
- * 2. Then, you must setup the temporal resolve. You may want to take a look
- * into SMAAResolve for resolving 2x modes. After you get it working, you'll
- * probably see ghosting everywhere. But fear not, you can enable the
- * CryENGINE temporal reprojection by setting the SMAA_REPROJECTION macro.
- *
- * 3. The next step is to apply SMAA to each subpixel jittered frame, just as
- * done for 1x.
- *
- * 4. At this point you should already have something usable, but for best
- * results the proper area textures must be set depending on current jitter.
- * For this, the parameter 'subsampleIndices' of
- * 'SMAABlendingWeightCalculationPS' must be set as follows, for our T2x
- * mode:
- *
- * @SUBSAMPLE_INDICES
- *
- * | S# | Camera Jitter | subsampleIndices |
- * +----+------------------+--------------------+
- * | 0 | ( 0.25, -0.25) | int4(1, 1, 1, 0) |
- * | 1 | (-0.25, 0.25) | int4(2, 2, 2, 0) |
- *
- * These jitter positions assume a bottom-to-top y axis. S# stands for the
- * sample number.
- *
- * More information about temporal supersampling here:
- * http://iryoku.com/aacourse/downloads/13-Anti-Aliasing-Methods-in-CryENGINE-3.pdf
- *
- * c) If you want to enable spatial multisampling (SMAA S2x):
- *
- * 1. The scene must be rendered using MSAA 2x. The MSAA 2x buffer must be
- * created with:
- * - DX10: see below (*)
- * - DX10.1: D3D10_STANDARD_MULTISAMPLE_PATTERN or
- * - DX11: D3D11_STANDARD_MULTISAMPLE_PATTERN
- *
- * This allows to ensure that the subsample order matches the table in
- * @SUBSAMPLE_INDICES.
- *
- * (*) In the case of DX10, we refer the reader to:
- * - SMAA::detectMSAAOrder and
- * - SMAA::msaaReorder
- *
- * These functions allow to match the standard multisample patterns by
- * detecting the subsample order for a specific GPU, and reordering
- * them appropriately.
- *
- * 2. A shader must be run to output each subsample into a separate buffer
- * (DX10 is required). You can use SMAASeparate for this purpose, or just do
- * it in an existing pass (for example, in the tone mapping pass).
- *
- * 3. The full SMAA 1x pipeline must be run for each separated buffer, storing
- * the results in the final buffer. The second run should alpha blend with
- * the existing final buffer using a blending factor of 0.5.
- * 'subsampleIndices' must be adjusted as in the SMAA T2x case (see point
- * b).
- *
- * d) If you want to enable temporal supersampling on top of SMAA S2x
- * (which actually is SMAA 4x):
- *
- * 1. SMAA 4x consists on temporally jittering SMAA S2x, so the first step is
- * to calculate SMAA S2x for current frame. In this case, 'subsampleIndices'
- * must be set as follows:
- *
- * | F# | S# | Camera Jitter | Net Jitter | subsampleIndices |
- * +----+----+--------------------+-------------------+--------------------+
- * | 0 | 0 | ( 0.125, 0.125) | ( 0.375, -0.125) | int4(5, 3, 1, 3) |
- * | 0 | 1 | ( 0.125, 0.125) | (-0.125, 0.375) | int4(4, 6, 2, 3) |
- * +----+----+--------------------+-------------------+--------------------+
- * | 1 | 2 | (-0.125, -0.125) | ( 0.125, -0.375) | int4(3, 5, 1, 4) |
- * | 1 | 3 | (-0.125, -0.125) | (-0.375, 0.125) | int4(6, 4, 2, 4) |
- *
- * These jitter positions assume a bottom-to-top y axis. F# stands for the
- * frame number. S# stands for the sample number.
- *
- * 2. After calculating SMAA S2x for current frame (with the new subsample
- * indices), previous frame must be reprojected as in SMAA T2x mode (see
- * point b).
- *
- * e) If motion blur is used, you may want to do the edge detection pass
- * together with motion blur. This has two advantages:
- *
- * 1. Pixels under heavy motion can be omitted from the edge detection process.
- * For these pixels we can just store "no edge", as motion blur will take
- * care of them.
- * 2. The center pixel tap is reused.
- *
- * Note that in this case depth testing should be used instead of stenciling,
- * as we have to write all the pixels in the motion blur pass.
- *
- * That's it!
- */
-
-//-----------------------------------------------------------------------------
-// SMAA Presets
-
-/**
- * Note that if you use one of these presets, the corresponding macros below
- * won't be used.
- */
-
-#if SMAA_PRESET_LOW == 1
-#define SMAA_THRESHOLD 0.15
-#define SMAA_MAX_SEARCH_STEPS 4
-#define SMAA_MAX_SEARCH_STEPS_DIAG 0
-#define SMAA_CORNER_ROUNDING 100
-#elif SMAA_PRESET_MEDIUM == 1
-#define SMAA_THRESHOLD 0.1
-#define SMAA_MAX_SEARCH_STEPS 8
-#define SMAA_MAX_SEARCH_STEPS_DIAG 0
-#define SMAA_CORNER_ROUNDING 100
-#elif SMAA_PRESET_HIGH == 1
-#define SMAA_THRESHOLD 0.1
-#define SMAA_MAX_SEARCH_STEPS 16
-#define SMAA_MAX_SEARCH_STEPS_DIAG 8
-#define SMAA_CORNER_ROUNDING 25
-#elif SMAA_PRESET_ULTRA == 1
-#define SMAA_THRESHOLD 0.05
-#define SMAA_MAX_SEARCH_STEPS 32
-#define SMAA_MAX_SEARCH_STEPS_DIAG 16
-#define SMAA_CORNER_ROUNDING 25
-#endif
-
-//-----------------------------------------------------------------------------
-// Configurable Defines
-
-/**
- * SMAA_THRESHOLD specifies the threshold or sensitivity to edges.
- * Lowering this value you will be able to detect more edges at the expense of
- * performance.
- *
- * Range: [0, 0.5]
- * 0.1 is a reasonable value, and allows to catch most visible edges.
- * 0.05 is a rather overkill value, that allows to catch 'em all.
- *
- * If temporal supersampling is used, 0.2 could be a reasonable value, as low
- * contrast edges are properly filtered by just 2x.
- */
-#ifndef SMAA_THRESHOLD
-#define SMAA_THRESHOLD 0.1
-#endif
-
-/**
- * SMAA_DEPTH_THRESHOLD specifies the threshold for depth edge detection.
- *
- * Range: depends on the depth range of the scene.
- */
-#ifndef SMAA_DEPTH_THRESHOLD
-#define SMAA_DEPTH_THRESHOLD (0.1 * SMAA_THRESHOLD)
-#endif
-
-/**
- * SMAA_MAX_SEARCH_STEPS specifies the maximum steps performed in the
- * horizontal/vertical pattern searches, at each side of the pixel.
- *
- * In number of pixels, it's actually the double. So the maximum line length
- * perfectly handled by, for example 16, is 64 (by perfectly, we meant that
- * longer lines won't look as good, but still antialiased).
- *
- * Range: [0, 98]
- */
-#ifndef SMAA_MAX_SEARCH_STEPS
-#define SMAA_MAX_SEARCH_STEPS 16
-#endif
-
-/**
- * SMAA_MAX_SEARCH_STEPS_DIAG specifies the maximum steps performed in the
- * diagonal pattern searches, at each side of the pixel. In this case we jump
- * one pixel at time, instead of two.
- *
- * Range: [0, 20]; set it to 0 to disable diagonal processing.
- *
- * On high-end machines it is cheap (between a 0.8x and 0.9x slower for 16
- * steps), but it can have a significant impact on older machines.
- */
-#ifndef SMAA_MAX_SEARCH_STEPS_DIAG
-#define SMAA_MAX_SEARCH_STEPS_DIAG 8
-#endif
-
-/**
- * SMAA_CORNER_ROUNDING specifies how much sharp corners will be rounded.
- *
- * Range: [0, 100]; set it to 100 to disable corner detection.
- */
-#ifndef SMAA_CORNER_ROUNDING
-#define SMAA_CORNER_ROUNDING 25
-#endif
-
-/**
- * Predicated thresholding allows to better preserve texture details and to
- * improve performance, by decreasing the number of detected edges using an
- * additional buffer like the light accumulation buffer, object ids or even the
- * depth buffer (the depth buffer usage may be limited to indoor or short range
- * scenes).
- *
- * It locally decreases the luma or color threshold if an edge is found in an
- * additional buffer (so the global threshold can be higher).
- *
- * This method was developed by Playstation EDGE MLAA team, and used in
- * Killzone 3, by using the light accumulation buffer. More information here:
- * http://iryoku.com/aacourse/downloads/06-MLAA-on-PS3.pptx
- */
-#ifndef SMAA_PREDICATION
-#define SMAA_PREDICATION 0
-#endif
-
-/**
- * Threshold to be used in the additional predication buffer.
- *
- * Range: depends on the input, so you'll have to find the magic number that
- * works for you.
- */
-#ifndef SMAA_PREDICATION_THRESHOLD
-#define SMAA_PREDICATION_THRESHOLD 0.01
-#endif
-
-/**
- * How much to scale the global threshold used for luma or color edge
- * detection when using predication.
- *
- * Range: [1, 5]
- */
-#ifndef SMAA_PREDICATION_SCALE
-#define SMAA_PREDICATION_SCALE 2.0
-#endif
-
-/**
- * How much to locally decrease the threshold.
- *
- * Range: [0, 1]
- */
-#ifndef SMAA_PREDICATION_STRENGTH
-#define SMAA_PREDICATION_STRENGTH 0.4
-#endif
-
-/**
- * Temporal reprojection allows to remove ghosting artifacts when using
- * temporal supersampling. We use the CryEngine 3 method which also introduces
- * velocity weighting. This feature is of extreme importance for totally
- * removing ghosting. More information here:
- * http://iryoku.com/aacourse/downloads/13-Anti-Aliasing-Methods-in-CryENGINE-3.pdf
- *
- * Note that you'll need to setup a velocity buffer for enabling reprojection.
- * For static geometry, saving the previous depth buffer is a viable
- * alternative.
- */
-#ifndef SMAA_REPROJECTION
-#define SMAA_REPROJECTION 0
-#endif
-
-/**
- * SMAA_REPROJECTION_WEIGHT_SCALE controls the velocity weighting. It allows to
- * remove ghosting trails behind the moving object, which are not removed by
- * just using reprojection. Using low values will exhibit ghosting, while using
- * high values will disable temporal supersampling under motion.
- *
- * Behind the scenes, velocity weighting removes temporal supersampling when
- * the velocity of the subsamples differs (meaning they are different objects).
- *
- * Range: [0, 80]
- */
-#define SMAA_REPROJECTION_WEIGHT_SCALE 30.0
-
-/**
- * In the last pass we leverage bilinear filtering to avoid some lerps.
- * However, bilinear filtering is done in gamma space in DX9, under DX9
- * hardware (but not in DX9 code running on DX10 hardware), which gives
- * inaccurate results.
- *
- * So, if you are in DX9, under DX9 hardware, and do you want accurate linear
- * blending, you must set this flag to 1.
- *
- * It's ignored when using SMAA_HLSL_4, and of course, only has sense when
- * using sRGB read and writes on the last pass.
- */
-#ifndef SMAA_DIRECTX9_LINEAR_BLEND
-#define SMAA_DIRECTX9_LINEAR_BLEND 0
-#endif
-
-/**
- * On ATI compilers, discard cannot be used in vertex shaders. Thus, they need
- * to be compiled separately. These macros allow to easily accomplish it.
- */
-#ifndef SMAA_ONLY_COMPILE_VS
-#define SMAA_ONLY_COMPILE_VS 0
-#endif
-#ifndef SMAA_ONLY_COMPILE_PS
-#define SMAA_ONLY_COMPILE_PS 0
-#endif
-
-//-----------------------------------------------------------------------------
-// Non-Configurable Defines
-
-#ifndef SMAA_AREATEX_MAX_DISTANCE
-#define SMAA_AREATEX_MAX_DISTANCE 16
-#endif
-#ifndef SMAA_AREATEX_MAX_DISTANCE_DIAG
-#define SMAA_AREATEX_MAX_DISTANCE_DIAG 20
-#endif
-#define SMAA_AREATEX_PIXEL_SIZE (1.0 / float2(160.0, 560.0))
-#define SMAA_AREATEX_SUBTEX_SIZE (1.0 / 7.0)
-
-//-----------------------------------------------------------------------------
-// Porting Functions
-
-#if SMAA_HLSL_3 == 1
-#define SMAATexture2D sampler2D
-#define SMAASampleLevelZero(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0))
-#define SMAASampleLevelZeroPoint(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0))
-#define SMAASample(tex, coord) tex2D(tex, coord)
-#define SMAASamplePoint(tex, coord) tex2D(tex, coord)
-#define SMAASampleLevelZeroOffset(tex, coord, offset) tex2Dlod(tex, float4(coord + offset * SMAA_PIXEL_SIZE, 0.0, 0.0))
-#define SMAASampleOffset(tex, coord, offset) tex2D(tex, coord + offset * SMAA_PIXEL_SIZE)
-#define SMAALerp(a, b, t) lerp(a, b, t)
-#define SMAASaturate(a) saturate(a)
-#define SMAAMad(a, b, c) mad(a, b, c)
-#define SMAA_FLATTEN [flatten]
-#define SMAA_BRANCH [branch]
-#endif
-#if SMAA_HLSL_4 == 1 || SMAA_HLSL_4_1 == 1
-SamplerState LinearSampler { Filter = MIN_MAG_LINEAR_MIP_POINT; AddressU = Clamp; AddressV = Clamp; };
-SamplerState PointSampler { Filter = MIN_MAG_MIP_POINT; AddressU = Clamp; AddressV = Clamp; };
-#define SMAATexture2D Texture2D
-#define SMAASampleLevelZero(tex, coord) tex.SampleLevel(LinearSampler, coord, 0)
-#define SMAASampleLevelZeroPoint(tex, coord) tex.SampleLevel(PointSampler, coord, 0)
-#define SMAASample(tex, coord) SMAASampleLevelZero(tex, coord)
-#define SMAASamplePoint(tex, coord) SMAASampleLevelZeroPoint(tex, coord)
-#define SMAASampleLevelZeroOffset(tex, coord, offset) tex.SampleLevel(LinearSampler, coord, 0, offset)
-#define SMAASampleOffset(tex, coord, offset) SMAASampleLevelZeroOffset(tex, coord, offset)
-#define SMAALerp(a, b, t) lerp(a, b, t)
-#define SMAASaturate(a) saturate(a)
-#define SMAAMad(a, b, c) mad(a, b, c)
-#define SMAA_FLATTEN [flatten]
-#define SMAA_BRANCH [branch]
-#define SMAATexture2DMS2 Texture2DMS<float4, 2>
-#define SMAALoad(tex, pos, sample) tex.Load(pos, sample)
-#endif
-#if SMAA_HLSL_4_1 == 1
-#define SMAAGather(tex, coord) tex.Gather(LinearSampler, coord, 0)
-#endif
-#if SMAA_GLSL_3 == 1 || SMAA_GLSL_4 == 1
-#define SMAATexture2D sampler2D
-#define SMAASampleLevelZero(tex, coord) textureLod(tex, coord, 0.0)
-#define SMAASampleLevelZeroPoint(tex, coord) textureLod(tex, coord, 0.0)
-#define SMAASample(tex, coord) texture(tex, coord)
-#define SMAASamplePoint(tex, coord) texture(tex, coord)
-#define SMAASampleLevelZeroOffset(tex, coord, offset) textureLodOffset(tex, coord, 0.0, offset)
-#define SMAASampleOffset(tex, coord, offset) texture(tex, coord, offset)
-#define SMAALerp(a, b, t) mix(a, b, t)
-#define SMAASaturate(a) clamp(a, 0.0, 1.0)
-#define SMAA_FLATTEN
-#define SMAA_BRANCH
-#define float2 vec2
-#define float3 vec3
-#define float4 vec4
-#define int2 ivec2
-#define int3 ivec3
-#define int4 ivec4
-#endif
-#if SMAA_GLSL_3 == 1
-#define SMAAMad(a, b, c) (a * b + c)
-#endif
-#if SMAA_GLSL_4 == 1
-#define SMAAMad(a, b, c) fma(a, b, c)
-#define SMAAGather(tex, coord) textureGather(tex, coord)
-#endif
-
-//-----------------------------------------------------------------------------
-// Misc functions
-
-/**
- * Gathers current pixel, and the top-left neighbors.
- */
-float3 SMAAGatherNeighbors(float2 texcoord,
- float4 offset[3],
- SMAATexture2D tex) {
- #if SMAA_HLSL_4_1 == 1 || SMAA_GLSL_4 == 1
- return SMAAGather(tex, texcoord + SMAA_PIXEL_SIZE * float2(-0.5, -0.5)).grb;
- #else
- float P = SMAASample(tex, texcoord).r;
- float Pleft = SMAASample(tex, offset[0].xy).r;
- float Ptop = SMAASample(tex, offset[0].zw).r;
- return float3(P, Pleft, Ptop);
- #endif
-}
-
-/**
- * Adjusts the threshold by means of predication.
- */
-float2 SMAACalculatePredicatedThreshold(float2 texcoord,
- float4 offset[3],
- SMAATexture2D colorTex,
- SMAATexture2D predicationTex) {
- float3 neighbors = SMAAGatherNeighbors(texcoord, offset, predicationTex);
- float2 delta = abs(neighbors.xx - neighbors.yz);
- float2 edges = step(SMAA_PREDICATION_THRESHOLD, delta);
- return SMAA_PREDICATION_SCALE * SMAA_THRESHOLD * (1.0 - SMAA_PREDICATION_STRENGTH * edges);
-}
-
-#if SMAA_ONLY_COMPILE_PS == 0
-//-----------------------------------------------------------------------------
-// Vertex Shaders
-
-/**
- * Edge Detection Vertex Shader
- */
-void SMAAEdgeDetectionVS(float4 position,
- out float4 svPosition,
- in float2 texcoord,
- out float4 offset[3]) {
- svPosition = position;
-
- offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-1.0, 0.0, 0.0, -1.0);
- offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4( 1.0, 0.0, 0.0, 1.0);
- offset[2] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-2.0, 0.0, 0.0, -2.0);
-}
-
-/**
- * Blend Weight Calculation Vertex Shader
- */
-void SMAABlendingWeightCalculationVS(float4 position,
- out float4 svPosition,
- inout float2 texcoord,
- out float2 pixcoord,
- out float4 offset[3]) {
- svPosition = position;
-
- pixcoord = texcoord / SMAA_PIXEL_SIZE;
-
- // We will use these offsets for the searches later on (see @PSEUDO_GATHER4):
- offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-0.25, -0.125, 1.25, -0.125);
- offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-0.125, -0.25, -0.125, 1.25);
-
- // And these for the searches, they indicate the ends of the loops:
- offset[2] = float4(offset[0].xz, offset[1].yw) +
- float4(-2.0, 2.0, -2.0, 2.0) *
- SMAA_PIXEL_SIZE.xxyy * float(SMAA_MAX_SEARCH_STEPS);
-}
-
-/**
- * Neighborhood Blending Vertex Shader
- */
-void SMAANeighborhoodBlendingVS(float4 position,
- out float4 svPosition,
- inout float2 texcoord,
- out float4 offset[2]) {
- svPosition = position;
-
- offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-1.0, 0.0, 0.0, -1.0);
- offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4( 1.0, 0.0, 0.0, 1.0);
-}
-
-/**
- * Resolve Vertex Shader
- */
-void SMAAResolveVS(float4 position,
- out float4 svPosition,
- inout float2 texcoord) {
- svPosition = position;
-}
-
-/**
- * Separate Vertex Shader
- */
-void SMAASeparateVS(float4 position,
- out float4 svPosition,
- inout float2 texcoord) {
- svPosition = position;
-}
-#endif // SMAA_ONLY_COMPILE_PS == 0
-
-#if SMAA_ONLY_COMPILE_VS == 0
-//-----------------------------------------------------------------------------
-// Edge Detection Pixel Shaders (First Pass)
-
-/**
- * Luma Edge Detection
- *
- * IMPORTANT NOTICE: luma edge detection requires gamma-corrected colors, and
- * thus 'colorTex' should be a non-sRGB texture.
- */
-float4 SMAALumaEdgeDetectionPS(float2 texcoord,
- float4 offset[3],
- SMAATexture2D colorTex
- #if SMAA_PREDICATION == 1
- , SMAATexture2D predicationTex
- #endif
- ) {
- // Calculate the threshold:
- #if SMAA_PREDICATION == 1
- float2 threshold = SMAACalculatePredicatedThreshold(texcoord, offset, colorTex, predicationTex);
- #else
- float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD);
- #endif
-
- // Calculate lumas:
- float3 weights = float3(0.2126, 0.7152, 0.0722);
- float L = dot(SMAASample(colorTex, texcoord).rgb, weights);
- float Lleft = dot(SMAASample(colorTex, offset[0].xy).rgb, weights);
- float Ltop = dot(SMAASample(colorTex, offset[0].zw).rgb, weights);
-
- // We do the usual threshold:
- float4 delta;
- delta.xy = abs(L - float2(Lleft, Ltop));
- float2 edges = step(threshold, delta.xy);
-
- // Then discard if there is no edge:
- if (dot(edges, float2(1.0, 1.0)) == 0.0)
- discard;
-
- // Calculate right and bottom deltas:
- float Lright = dot(SMAASample(colorTex, offset[1].xy).rgb, weights);
- float Lbottom = dot(SMAASample(colorTex, offset[1].zw).rgb, weights);
- delta.zw = abs(L - float2(Lright, Lbottom));
-
- // Calculate the maximum delta in the direct neighborhood:
- float2 maxDelta = max(delta.xy, delta.zw);
- maxDelta = max(maxDelta.xx, maxDelta.yy);
-
- // Calculate left-left and top-top deltas:
- float Lleftleft = dot(SMAASample(colorTex, offset[2].xy).rgb, weights);
- float Ltoptop = dot(SMAASample(colorTex, offset[2].zw).rgb, weights);
- delta.zw = abs(float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop));
-
- // Calculate the final maximum delta:
- maxDelta = max(maxDelta.xy, delta.zw);
-
- /**
- * Each edge with a delta in luma of less than 50% of the maximum luma
- * surrounding this pixel is discarded. This allows to eliminate spurious
- * crossing edges, and is based on the fact that, if there is too much
- * contrast in a direction, that will hide contrast in the other
- * neighbors.
- * This is done after the discard intentionally as this situation doesn't
- * happen too frequently (but it's important to do as it prevents some
- * edges from going undetected).
- */
- edges.xy *= step(0.5 * maxDelta, delta.xy);
-
- return float4(edges, 0.0, 0.0);
-}
-
-/**
- * Color Edge Detection
- *
- * IMPORTANT NOTICE: color edge detection requires gamma-corrected colors, and
- * thus 'colorTex' should be a non-sRGB texture.
- */
-float4 SMAAColorEdgeDetectionPS(float2 texcoord,
- float4 offset[3],
- SMAATexture2D colorTex
- #if SMAA_PREDICATION == 1
- , SMAATexture2D predicationTex
- #endif
- ) {
- // Calculate the threshold:
- #if SMAA_PREDICATION == 1
- float2 threshold = SMAACalculatePredicatedThreshold(texcoord, offset, colorTex, predicationTex);
- #else
- float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD);
- #endif
-
- // Calculate color deltas:
- float4 delta;
- float3 C = SMAASample(colorTex, texcoord).rgb;
-
- float3 Cleft = SMAASample(colorTex, offset[0].xy).rgb;
- float3 t = abs(C - Cleft);
- delta.x = max(max(t.r, t.g), t.b);
-
- float3 Ctop = SMAASample(colorTex, offset[0].zw).rgb;
- t = abs(C - Ctop);
- delta.y = max(max(t.r, t.g), t.b);
-
- // We do the usual threshold:
- float2 edges = step(threshold, delta.xy);
-
- // Then discard if there is no edge:
- if (dot(edges, float2(1.0, 1.0)) == 0.0)
- discard;
-
- // Calculate right and bottom deltas:
- float3 Cright = SMAASample(colorTex, offset[1].xy).rgb;
- t = abs(C - Cright);
- delta.z = max(max(t.r, t.g), t.b);
-
- float3 Cbottom = SMAASample(colorTex, offset[1].zw).rgb;
- t = abs(C - Cbottom);
- delta.w = max(max(t.r, t.g), t.b);
-
- // Calculate the maximum delta in the direct neighborhood:
- float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w);
-
- // Calculate left-left and top-top deltas:
- float3 Cleftleft = SMAASample(colorTex, offset[2].xy).rgb;
- t = abs(C - Cleftleft);
- delta.z = max(max(t.r, t.g), t.b);
-
- float3 Ctoptop = SMAASample(colorTex, offset[2].zw).rgb;
- t = abs(C - Ctoptop);
- delta.w = max(max(t.r, t.g), t.b);
-
- // Calculate the final maximum delta:
- maxDelta = max(max(maxDelta, delta.z), delta.w);
-
- // Local contrast adaptation in action:
- edges.xy *= step(0.5 * maxDelta, delta.xy);
-
- return float4(edges, 0.0, 0.0);
-}
-
-float4 SMAASingleChannelEdgeDetectionPS(float2 texcoord,
- float4 offset[3],
- SMAATexture2D colorTex
- #if SMAA_PREDICATION == 1
- , SMAATexture2D predicationTex
- #endif
- ) {
- // Calculate the threshold:
- #if SMAA_PREDICATION == 1
- float2 threshold = SMAACalculatePredicatedThreshold(texcoord, offset, colorTex, predicationTex);
- #else
- float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD);
- #endif
-
- // Calculate lumas:
- float L = SMAASample(colorTex, texcoord).r;
- float Lleft = SMAASample(colorTex, offset[0].xy).r;
- float Ltop = SMAASample(colorTex, offset[0].zw).r;
-
- // We do the usual threshold:
- float4 delta;
- delta.xy = abs(L - float2(Lleft, Ltop));
- float2 edges = step(threshold, delta.xy);
-
- // Then discard if there is no edge:
- if (dot(edges, float2(1.0, 1.0)) == 0.0)
- discard;
-
- // Calculate right and bottom deltas:
- float Lright = SMAASample(colorTex, offset[1].xy).r;
- float Lbottom = SMAASample(colorTex, offset[1].zw).r;
- delta.zw = abs(L - float2(Lright, Lbottom));
-
- // Calculate the maximum delta in the direct neighborhood:
- float2 maxDelta = max(delta.xy, delta.zw);
- maxDelta = max(maxDelta.xx, maxDelta.yy);
-
- // Calculate left-left and top-top deltas:
- float Lleftleft = SMAASample(colorTex, offset[2].xy).r;
- float Ltoptop = SMAASample(colorTex, offset[2].zw).r;
- delta.zw = abs(float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop));
-
- // Calculate the final maximum delta:
- maxDelta = max(maxDelta.xy, delta.zw);
-
- /**
- * Each edge with a delta in luma of less than 50% of the maximum luma
- * surrounding this pixel is discarded. This allows to eliminate spurious
- * crossing edges, and is based on the fact that, if there is too much
- * contrast in a direction, that will hide contrast in the other
- * neighbors.
- * This is done after the discard intentionally as this situation doesn't
- * happen too frequently (but it's important to do as it prevents some
- * edges from going undetected).
- */
- edges.xy *= step(0.5 * maxDelta, delta.xy);
-
- return float4(edges, 0.0, 0.0);
-}
-
-/**
- * Depth Edge Detection
- */
-float4 SMAADepthEdgeDetectionPS(float2 texcoord,
- float4 offset[3],
- SMAATexture2D depthTex) {
- float3 neighbors = SMAAGatherNeighbors(texcoord, offset, depthTex);
- float2 delta = abs(neighbors.xx - float2(neighbors.y, neighbors.z));
- float2 edges = step(SMAA_DEPTH_THRESHOLD, delta);
-
- if (dot(edges, float2(1.0, 1.0)) == 0.0)
- discard;
-
- return float4(edges, 0.0, 0.0);
-}
-
-//-----------------------------------------------------------------------------
-// Diagonal Search Functions
-
-#if SMAA_MAX_SEARCH_STEPS_DIAG > 0 || SMAA_FORCE_DIAGONAL_DETECTION == 1
-
-/**
- * These functions allows to perform diagonal pattern searches.
- */
-float SMAASearchDiag1(SMAATexture2D edgesTex, float2 texcoord, float2 dir, float c) {
- texcoord += dir * SMAA_PIXEL_SIZE;
- float2 e = float2(0.0, 0.0);
- float i;
- for (i = 0.0; i < float(SMAA_MAX_SEARCH_STEPS_DIAG); i++) {
- e.rg = SMAASampleLevelZero(edgesTex, texcoord).rg;
- SMAA_FLATTEN if (dot(e, float2(1.0, 1.0)) < 1.9) break;
- texcoord += dir * SMAA_PIXEL_SIZE;
- }
- return i + float(e.g > 0.9) * c;
-}
-
-float SMAASearchDiag2(SMAATexture2D edgesTex, float2 texcoord, float2 dir, float c) {
- texcoord += dir * SMAA_PIXEL_SIZE;
- float2 e = float2(0.0, 0.0);
- float i;
- for (i = 0.0; i < float(SMAA_MAX_SEARCH_STEPS_DIAG); i++) {
- e.g = SMAASampleLevelZero(edgesTex, texcoord).g;
- e.r = SMAASampleLevelZeroOffset(edgesTex, texcoord, int2(1, 0)).r;
- SMAA_FLATTEN if (dot(e, float2(1.0, 1.0)) < 1.9) break;
- texcoord += dir * SMAA_PIXEL_SIZE;
- }
- return i + float(e.g > 0.9) * c;
-}
-
-/**
- * Similar to SMAAArea, this calculates the area corresponding to a certain
- * diagonal distance and crossing edges 'e'.
- */
-float2 SMAAAreaDiag(SMAATexture2D areaTex, float2 dist, float2 e, float offset) {
- float2 texcoord = float(SMAA_AREATEX_MAX_DISTANCE_DIAG) * e + dist;
-
- // We do a scale and bias for mapping to texel space:
- texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + (0.5 * SMAA_AREATEX_PIXEL_SIZE);
-
- // Diagonal areas are on the second half of the texture:
- texcoord.x += 0.5;
-
- // Move to proper place, according to the subpixel offset:
- texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;
-
- // Do it!
- return SMAASampleLevelZero(areaTex, texcoord).ra;
-}
-
-/**
- * This searches for diagonal patterns and returns the corresponding weights.
- */
-float2 SMAACalculateDiagWeights(SMAATexture2D edgesTex, SMAATexture2D areaTex, float2 texcoord, float2 e, int4 subsampleIndices) {
- float2 weights = float2(0.0, 0.0);
-
- float2 d;
- d.x = e.r > 0.0? SMAASearchDiag1(edgesTex, texcoord, float2(-1.0, 1.0), 1.0) : 0.0;
- d.y = SMAASearchDiag1(edgesTex, texcoord, float2(1.0, -1.0), 0.0);
-
- SMAA_BRANCH
- if (d.r + d.g > 2.0) { // d.r + d.g + 1 > 3
- float4 coords = SMAAMad(float4(-d.r, d.r, d.g, -d.g), SMAA_PIXEL_SIZE.xyxy, texcoord.xyxy);
-
- float4 c;
- c.x = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).g;
- c.y = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2( 0, 0)).r;
- c.z = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, 0)).g;
- c.w = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, -1)).r;
- float2 e = 2.0 * c.xz + c.yw;
- float t = float(SMAA_MAX_SEARCH_STEPS_DIAG) - 1.0;
- e *= step(d.rg, float2(t, t));
-
- weights += SMAAAreaDiag(areaTex, d, e, float(subsampleIndices.z));
- }
-
- d.x = SMAASearchDiag2(edgesTex, texcoord, float2(-1.0, -1.0), 0.0);
- float right = SMAASampleLevelZeroOffset(edgesTex, texcoord, int2(1, 0)).r;
- d.y = right > 0.0? SMAASearchDiag2(edgesTex, texcoord, float2(1.0, 1.0), 1.0) : 0.0;
-
- SMAA_BRANCH
- if (d.r + d.g > 2.0) { // d.r + d.g + 1 > 3
- float4 coords = SMAAMad(float4(-d.r, -d.r, d.g, d.g), SMAA_PIXEL_SIZE.xyxy, texcoord.xyxy);
-
- float4 c;
- c.x = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).g;
- c.y = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2( 0, -1)).r;
- c.zw = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, 0)).gr;
- float2 e = 2.0 * c.xz + c.yw;
- float t = float(SMAA_MAX_SEARCH_STEPS_DIAG) - 1.0;
- e *= step(d.rg, float2(t, t));
-
- weights += SMAAAreaDiag(areaTex, d, e, float(subsampleIndices.w)).gr;
- }
-
- return weights;
-}
-#endif
-
-//-----------------------------------------------------------------------------
-// Horizontal/Vertical Search Functions
-
-/**
- * This allows to determine how much length should we add in the last step
- * of the searches. It takes the bilinearly interpolated edge (see
- * @PSEUDO_GATHER4), and adds 0, 1 or 2, depending on which edges and
- * crossing edges are active.
- */
-float SMAASearchLength(SMAATexture2D searchTex, float2 e, float bias, float scale) {
- // Not required if searchTex accesses are set to point:
- // float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
- // e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
- // e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
- e.r = bias + e.r * scale;
- return 255.0 * SMAASampleLevelZeroPoint(searchTex, e).r;
-}
-
-/**
- * Horizontal/vertical search functions for the 2nd pass.
- */
-float SMAASearchXLeft(SMAATexture2D edgesTex, SMAATexture2D searchTex, float2 texcoord, float end) {
- /**
- * @PSEUDO_GATHER4
- * This texcoord has been offset by (-0.25, -0.125) in the vertex shader to
- * sample between edge, thus fetching four edges in a row.
- * Sampling with different offsets in each direction allows to disambiguate
- * which edges are active from the four fetched ones.
- */
- float2 e = float2(0.0, 1.0);
- while (texcoord.x > end &&
- e.g > 0.8281 && // Is there some edge not activated?
- e.r == 0.0) { // Or is there a crossing edge that breaks the line?
- e = SMAASampleLevelZero(edgesTex, texcoord).rg;
- texcoord -= float2(2.0, 0.0) * SMAA_PIXEL_SIZE;
- }
-
- // We correct the previous (-0.25, -0.125) offset we applied:
- texcoord.x += 0.25 * SMAA_PIXEL_SIZE.x;
-
- // The searches are bias by 1, so adjust the coords accordingly:
- texcoord.x += SMAA_PIXEL_SIZE.x;
-
- // Disambiguate the length added by the last step:
- texcoord.x += 2.0 * SMAA_PIXEL_SIZE.x; // Undo last step
- texcoord.x -= SMAA_PIXEL_SIZE.x * SMAASearchLength(searchTex, e, 0.0, 0.5);
-
- return texcoord.x;
-}
-
-float SMAASearchXRight(SMAATexture2D edgesTex, SMAATexture2D searchTex, float2 texcoord, float end) {
- float2 e = float2(0.0, 1.0);
- while (texcoord.x < end &&
- e.g > 0.8281 && // Is there some edge not activated?
- e.r == 0.0) { // Or is there a crossing edge that breaks the line?
- e = SMAASampleLevelZero(edgesTex, texcoord).rg;
- texcoord += float2(2.0, 0.0) * SMAA_PIXEL_SIZE;
- }
-
- texcoord.x -= 0.25 * SMAA_PIXEL_SIZE.x;
- texcoord.x -= SMAA_PIXEL_SIZE.x;
- texcoord.x -= 2.0 * SMAA_PIXEL_SIZE.x;
- texcoord.x += SMAA_PIXEL_SIZE.x * SMAASearchLength(searchTex, e, 0.5, 0.5);
- return texcoord.x;
-}
-
-float SMAASearchYUp(SMAATexture2D edgesTex, SMAATexture2D searchTex, float2 texcoord, float end) {
- float2 e = float2(1.0, 0.0);
- while (texcoord.y > end &&
- e.r > 0.8281 && // Is there some edge not activated?
- e.g == 0.0) { // Or is there a crossing edge that breaks the line?
- e = SMAASampleLevelZero(edgesTex, texcoord).rg;
- texcoord -= float2(0.0, 2.0) * SMAA_PIXEL_SIZE;
- }
-
- texcoord.y += 0.25 * SMAA_PIXEL_SIZE.y;
- texcoord.y += SMAA_PIXEL_SIZE.y;
- texcoord.y += 2.0 * SMAA_PIXEL_SIZE.y;
- texcoord.y -= SMAA_PIXEL_SIZE.y * SMAASearchLength(searchTex, e.gr, 0.0, 0.5);
- return texcoord.y;
-}
-
-float SMAASearchYDown(SMAATexture2D edgesTex, SMAATexture2D searchTex, float2 texcoord, float end) {
- float2 e = float2(1.0, 0.0);
- while (texcoord.y < end &&
- e.r > 0.8281 && // Is there some edge not activated?
- e.g == 0.0) { // Or is there a crossing edge that breaks the line?
- e = SMAASampleLevelZero(edgesTex, texcoord).rg;
- texcoord += float2(0.0, 2.0) * SMAA_PIXEL_SIZE;
- }
-
- texcoord.y -= 0.25 * SMAA_PIXEL_SIZE.y;
- texcoord.y -= SMAA_PIXEL_SIZE.y;
- texcoord.y -= 2.0 * SMAA_PIXEL_SIZE.y;
- texcoord.y += SMAA_PIXEL_SIZE.y * SMAASearchLength(searchTex, e.gr, 0.5, 0.5);
- return texcoord.y;
-}
-
-/**
- * Ok, we have the distance and both crossing edges. So, what are the areas
- * at each side of current edge?
- */
-float2 SMAAArea(SMAATexture2D areaTex, float2 dist, float e1, float e2, float offset) {
- // Rounding prevents precision errors of bilinear filtering:
- float2 texcoord = float(SMAA_AREATEX_MAX_DISTANCE) * round(4.0 * float2(e1, e2)) + dist;
-
- // We do a scale and bias for mapping to texel space:
- texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + (0.5 * SMAA_AREATEX_PIXEL_SIZE);
-
- // Move to proper place, according to the subpixel offset:
- texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;
-
- // Do it!
- return SMAASampleLevelZero(areaTex, texcoord).ra;
-}
-
-//-----------------------------------------------------------------------------
-// Corner Detection Functions
-
-void SMAADetectHorizontalCornerPattern(SMAATexture2D edgesTex, inout float2 weights, float2 texcoord, float2 d) {
- #if SMAA_CORNER_ROUNDING < 100 || SMAA_FORCE_CORNER_DETECTION == 1
- float4 coords = SMAAMad(float4(d.x, 0.0, d.y, 0.0),
- SMAA_PIXEL_SIZE.xyxy, texcoord.xyxy);
- float2 e;
- e.r = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(0.0, 1.0)).r;
- bool left = abs(d.x) < abs(d.y);
- e.g = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(0.0, -2.0)).r;
- if (left) weights *= SMAASaturate(float(SMAA_CORNER_ROUNDING) / 100.0 + 1.0 - e);
-
- e.r = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2(1.0, 1.0)).r;
- e.g = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2(1.0, -2.0)).r;
- if (!left) weights *= SMAASaturate(float(SMAA_CORNER_ROUNDING) / 100.0 + 1.0 - e);
- #endif
-}
-
-void SMAADetectVerticalCornerPattern(SMAATexture2D edgesTex, inout float2 weights, float2 texcoord, float2 d) {
- #if SMAA_CORNER_ROUNDING < 100 || SMAA_FORCE_CORNER_DETECTION == 1
- float4 coords = SMAAMad(float4(0.0, d.x, 0.0, d.y),
- SMAA_PIXEL_SIZE.xyxy, texcoord.xyxy);
- float2 e;
- e.r = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2( 1.0, 0.0)).g;
- bool left = abs(d.x) < abs(d.y);
- e.g = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-2.0, 0.0)).g;
- if (left) weights *= SMAASaturate(float(SMAA_CORNER_ROUNDING) / 100.0 + 1.0 - e);
-
- e.r = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1.0, 1.0)).g;
- e.g = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2(-2.0, 1.0)).g;
- if (!left) weights *= SMAASaturate(float(SMAA_CORNER_ROUNDING) / 100.0 + 1.0 - e);
- #endif
-}
-
-//-----------------------------------------------------------------------------
-// Blending Weight Calculation Pixel Shader (Second Pass)
-
-float4 SMAABlendingWeightCalculationPS(float2 texcoord,
- float2 pixcoord,
- float4 offset[3],
- SMAATexture2D edgesTex,
- SMAATexture2D areaTex,
- SMAATexture2D searchTex,
- int4 subsampleIndices) { // Just pass zero for SMAA 1x, see @SUBSAMPLE_INDICES.
- float4 weights = float4(0.0, 0.0, 0.0, 0.0);
-
- float2 e = SMAASample(edgesTex, texcoord).rg;
-
- SMAA_BRANCH
- if (e.g > 0.0) { // Edge at north
- #if SMAA_MAX_SEARCH_STEPS_DIAG > 0 || SMAA_FORCE_DIAGONAL_DETECTION == 1
- // Diagonals have both north and west edges, so searching for them in
- // one of the boundaries is enough.
- weights.rg = SMAACalculateDiagWeights(edgesTex, areaTex, texcoord, e, subsampleIndices);
-
- // We give priority to diagonals, so if we find a diagonal we skip
- // horizontal/vertical processing.
- SMAA_BRANCH
- if (dot(weights.rg, float2(1.0, 1.0)) == 0.0) {
- #endif
-
- float2 d;
-
- // Find the distance to the left:
- float2 coords;
- coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x);
- coords.y = offset[1].y; // offset[1].y = texcoord.y - 0.25 * SMAA_PIXEL_SIZE.y (@CROSSING_OFFSET)
- d.x = coords.x;
-
- // Now fetch the left crossing edges, two at a time using bilinear
- // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to
- // discern what value each edge has:
- float e1 = SMAASampleLevelZero(edgesTex, coords).r;
-
- // Find the distance to the right:
- coords.x = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y);
- d.y = coords.x;
-
- // We want the distances to be in pixel units (doing this here allow to
- // better interleave arithmetic and memory accesses):
- d = d / SMAA_PIXEL_SIZE.x - pixcoord.x;
-
- // SMAAArea below needs a sqrt, as the areas texture is compressed
- // quadratically:
- float2 sqrt_d = sqrt(abs(d));
-
- // Fetch the right crossing edges:
- float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, int2(1, 0)).r;
-
- // Ok, we know how this pattern looks like, now it is time for getting
- // the actual area:
- weights.rg = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.y));
-
- // Fix corners:
- SMAADetectHorizontalCornerPattern(edgesTex, weights.rg, texcoord, d);
-
- #if SMAA_MAX_SEARCH_STEPS_DIAG > 0 || SMAA_FORCE_DIAGONAL_DETECTION == 1
- } else
- e.r = 0.0; // Skip vertical processing.
- #endif
- }
-
- SMAA_BRANCH
- if (e.r > 0.0) { // Edge at west
- float2 d;
-
- // Find the distance to the top:
- float2 coords;
- coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z);
- coords.x = offset[0].x; // offset[1].x = texcoord.x - 0.25 * SMAA_PIXEL_SIZE.x;
- d.x = coords.y;
-
- // Fetch the top crossing edges:
- float e1 = SMAASampleLevelZero(edgesTex, coords).g;
-
- // Find the distance to the bottom:
- coords.y = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w);
- d.y = coords.y;
-
- // We want the distances to be in pixel units:
- d = d / SMAA_PIXEL_SIZE.y - pixcoord.y;
-
- // SMAAArea below needs a sqrt, as the areas texture is compressed
- // quadratically:
- float2 sqrt_d = sqrt(abs(d));
-
- // Fetch the bottom crossing edges:
- float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, int2(0, 1)).g;
-
- // Get the area for this direction:
- weights.ba = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.x));
-
- // Fix corners:
- SMAADetectVerticalCornerPattern(edgesTex, weights.ba, texcoord, d);
- }
-
- return weights;
-}
-
-//-----------------------------------------------------------------------------
-// Neighborhood Blending Pixel Shader (Third Pass)
-
-float4 SMAANeighborhoodBlendingPS(float2 texcoord,
- float4 offset[2],
- SMAATexture2D colorTex,
- SMAATexture2D blendTex) {
- // Fetch the blending weights for current pixel:
- float4 a;
- a.xz = SMAASample(blendTex, texcoord).xz;
- a.y = SMAASample(blendTex, offset[1].zw).g;
- a.w = SMAASample(blendTex, offset[1].xy).a;
-
- // Is there any blending weight with a value greater than 0.0?
- SMAA_BRANCH
- if (dot(a, float4(1.0, 1.0, 1.0, 1.0)) < 1e-5)
- return SMAASampleLevelZero(colorTex, texcoord);
- else {
- float4 color = float4(0.0, 0.0, 0.0, 0.0);
-
- // Up to 4 lines can be crossing a pixel (one through each edge). We
- // favor blending by choosing the line with the maximum weight for each
- // direction:
- float2 offset;
- offset.x = a.a > a.b? a.a : -a.b; // left vs. right
- offset.y = a.g > a.r? a.g : -a.r; // top vs. bottom
-
- // Then we go in the direction that has the maximum weight:
- if (abs(offset.x) > abs(offset.y)) // horizontal vs. vertical
- offset.y = 0.0;
- else
- offset.x = 0.0;
-
- #if SMAA_REPROJECTION == 1
- // Fetch the opposite color and lerp by hand:
- float4 C = SMAASampleLevelZero(colorTex, texcoord);
- texcoord += sign(offset) * SMAA_PIXEL_SIZE;
- float4 Cop = SMAASampleLevelZero(colorTex, texcoord);
- float s = abs(offset.x) > abs(offset.y)? abs(offset.x) : abs(offset.y);
-
- // Unpack the velocity values:
- C.a *= C.a;
- Cop.a *= Cop.a;
-
- // Lerp the colors:
- float4 Caa = SMAALerp(C, Cop, s);
-
- // Unpack velocity and return the resulting value:
- Caa.a = sqrt(Caa.a);
- return Caa;
- #elif SMAA_HLSL_4 == 1 || SMAA_DIRECTX9_LINEAR_BLEND == 0
- // We exploit bilinear filtering to mix current pixel with the chosen
- // neighbor:
- texcoord += offset * SMAA_PIXEL_SIZE;
- return SMAASampleLevelZero(colorTex, texcoord);
- #else
- // Fetch the opposite color and lerp by hand:
- float4 C = SMAASampleLevelZero(colorTex, texcoord);
- texcoord += sign(offset) * SMAA_PIXEL_SIZE;
- float4 Cop = SMAASampleLevelZero(colorTex, texcoord);
- float s = abs(offset.x) > abs(offset.y)? abs(offset.x) : abs(offset.y);
- return SMAALerp(C, Cop, s);
- #endif
- }
-}
-
-float4 SMAASampleLevelZeroResolve( SMAATexture2D currentTex,
- SMAATexture2D previousTex,
- float2 texcoord )
-{
- return SMAALerp( SMAASampleLevelZero( currentTex, texcoord ), SMAASampleLevelZero( previousTex, texcoord ), .5 );
-}
-
-float4 SMAANeighborhoodBlendingTemporalPS(float2 texcoord,
- float4 offset[2],
- SMAATexture2D colorTex,
- SMAATexture2D previousTex,
- SMAATexture2D blendTex) {
- // Fetch the blending weights for current pixel:
- float4 a;
- a.xz = SMAASample(blendTex, texcoord).xz;
- a.y = SMAASample(blendTex, offset[1].zw).g;
- a.w = SMAASample(blendTex, offset[1].xy).a;
-
- // Is there any blending weight with a value greater than 0.0?
- SMAA_BRANCH
- if (dot(a, float4(1.0, 1.0, 1.0, 1.0)) < 1e-5)
- return SMAASampleLevelZero(colorTex, texcoord);
- else {
- float4 color = float4(0.0, 0.0, 0.0, 0.0);
-
- // Up to 4 lines can be crossing a pixel (one through each edge). We
- // favor blending by choosing the line with the maximum weight for each
- // direction:
- float2 offset;
- offset.x = a.a > a.b? a.a : -a.b; // left vs. right
- offset.y = a.g > a.r? a.g : -a.r; // top vs. bottom
-
- // Then we go in the direction that has the maximum weight:
- if (abs(offset.x) > abs(offset.y)) // horizontal vs. vertical
- offset.y = 0.0;
- else
- offset.x = 0.0;
-
- #if SMAA_REPROJECTION == 1
- // Fetch the opposite color and lerp by hand:
- return SMAASampleLevelZeroResolve(colorTex, previousTex, texcoord);
- texcoord += sign(offset) * SMAA_PIXEL_SIZE;
- return SMAASampleLevelZeroResolve(colorTex, previousTex, texcoord);
- float s = abs(offset.x) > abs(offset.y)? abs(offset.x) : abs(offset.y);
-
- // Unpack the velocity values:
- C.a *= C.a;
- Cop.a *= Cop.a;
-
- // Lerp the colors:
- float4 Caa = SMAALerp(C, Cop, s);
-
- // Unpack velocity and return the resulting value:
- Caa.a = sqrt(Caa.a);
- return Caa;
- #elif SMAA_HLSL_4 == 1 || SMAA_DIRECTX9_LINEAR_BLEND == 0
- // We exploit bilinear filtering to mix current pixel with the chosen
- // neighbor:
- texcoord += offset * SMAA_PIXEL_SIZE;
- return SMAASampleLevelZeroResolve(colorTex, previousTex, texcoord);
- #else
- // Fetch the opposite color and lerp by hand:
- float4 C = SMAASampleLevelZeroResolve(colorTex, previousTex, texcoord);
- texcoord += sign(offset) * SMAA_PIXEL_SIZE;
- float4 Cop = SMAASampleLevelZeroResolve(colorTex, previousTex, texcoord);
- float s = abs(offset.x) > abs(offset.y)? abs(offset.x) : abs(offset.y);
- return SMAALerp(C, Cop, s);
- #endif
- }
-}
-
-//-----------------------------------------------------------------------------
-// Temporal Resolve Pixel Shader (Optional Pass)
-
-float4 SMAAResolvePS(float2 texcoord,
- SMAATexture2D colorTexCurr,
- SMAATexture2D colorTexPrev
- #if SMAA_REPROJECTION == 1
- , SMAATexture2D velocityTex
- #endif
- ) {
- #if SMAA_REPROJECTION == 1
- // Velocity is calculated from previous to current position, so we need to
- // inverse it:
- float2 velocity = -SMAASample(velocityTex, texcoord).rg;
-
- // Fetch current pixel:
- float4 current = SMAASample(colorTexCurr, texcoord);
-
- // Reproject current coordinates and fetch previous pixel:
- float4 previous = SMAASample(colorTexPrev, texcoord + velocity);
-
- // Attenuate the previous pixel if the velocity is different:
- float delta = abs(current.a * current.a - previous.a * previous.a) / 5.0;
- float weight = 0.5 * SMAASaturate(1.0 - (sqrt(delta) * SMAA_REPROJECTION_WEIGHT_SCALE));
-
- // Blend the pixels according to the calculated weight:
- return SMAALerp(current, previous, weight);
- #else
- // Just blend the pixels:
- float4 current = SMAASample(colorTexCurr, texcoord);
- float4 previous = SMAASample(colorTexPrev, texcoord);
- return SMAALerp(current, previous, 0.5);
- #endif
-}
-
-//-----------------------------------------------------------------------------
-// Separate Multisamples Pixel Shader (Optional Pass)
-
-#if SMAA_HLSL_4 == 1 || SMAA_HLSL_4_1 == 1
-void SMAASeparatePS(float4 position : SV_POSITION,
- float2 texcoord : TEXCOORD0,
- out float4 target0,
- out float4 target1,
- uniform SMAATexture2DMS2 colorTexMS) {
- int2 pos = int2(position.xy);
- target0 = SMAALoad(colorTexMS, pos, 0);
- target1 = SMAALoad(colorTexMS, pos, 1);
-}
-#endif
-
-//-----------------------------------------------------------------------------
-#endif // SMAA_ONLY_COMPILE_VS == 0
diff --git a/src/Runtime/ogl-runtime/res/effectlib/SSAOCustomMaterial.glsllib b/src/Runtime/ogl-runtime/res/effectlib/SSAOCustomMaterial.glsllib
deleted file mode 100644
index 1d8a1c39..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/SSAOCustomMaterial.glsllib
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB
-#define SSAO_CUSTOM_MATERIAL_GLSLLIB
-#if QT3DS_ENABLE_SSAO || QT3DS_ENABLE_SSDO
-
-#include "viewProperties.glsllib"
-#if QT3DS_ENABLE_SSDO
-#include "screenSpaceDO.glsllib"
-
-layout (std140) uniform cbAoShadow {
- vec4 ao_properties;
- vec4 ao_properties2;
- vec4 shadow_properties;
- vec4 aoScreenConst;
- vec4 UvToEyeConst;
- };
-
-uniform sampler2D depth_sampler;
-#endif
-uniform sampler2D ao_sampler;
-
-#endif // QT3DS_ENABLE_SSAO || QT3DS_ENABLE_SSDO
-
-#if QT3DS_ENABLE_SSAO
-
-float customMaterialAO()
-{
-#if QT3DS_ENABLE_SSDO
- vec2 smpUV = (gl_FragCoord.xy) * aoScreenConst.zw;
-#else
- ivec2 iSize = textureSize(ao_sampler, 0);
- vec2 smpUV = (gl_FragCoord.xy) / vec2(iSize);
-#endif
- return texture(ao_sampler, smpUV).x;
-}
-
-#else
-
-float customMaterialAO()
-{
- return 1.0;
-}
-
-#endif
-
-#if QT3DS_ENABLE_SSDO
-
-float customMaterialShadow( vec3 lightDir, vec3 varWorldPos )
-{
- return shadowOcclusion( depth_sampler, lightDir, varWorldPos, view_matrix, view_projection_matrix, shadow_properties, camera_properties, aoScreenConst, UvToEyeConst );
-}
-
-#else
-
-float customMaterialShadow( vec3 lightDir, vec3 varWorldPos )
-{
- return 1.0;
-}
-
-#endif
-
-#endif // #ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB
diff --git a/src/Runtime/ogl-runtime/res/effectlib/abbeNumberIOR.glsllib b/src/Runtime/ogl-runtime/res/effectlib/abbeNumberIOR.glsllib
deleted file mode 100644
index 43ed79d8..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/abbeNumberIOR.glsllib
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// TODO: compute spectral ior based on float ior and abbe number
-vec3 abbeNumberIOR( in float ior, in float abbeNumber )
-{
- return( vec3( ior, ior, ior ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/anisotropyConversion.glsllib b/src/Runtime/ogl-runtime/res/effectlib/anisotropyConversion.glsllib
deleted file mode 100644
index b8aae1ed..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/anisotropyConversion.glsllib
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// TODO: real implementation
-anisotropy_return anisotropyConversion( in float roughness, in float anisotropy, in float anisotropyRotation, in vec3 tangentU, bool miaAnisotropySemantic )
-{
- anisotropy_return aniso;
- float angle = 2.0 * PI * anisotropyRotation;
- float cos_angle = cos(angle);
- float sin_angle = sin(angle);
- aniso.tangent_u = normalize( cos_angle * tangentU + sin_angle * binormal );
- // roughness
- float anisoFac = 1.0 - clamp(anisotropy, 0.0, 0.999);
- aniso.roughness_v = clamp( roughness / anisoFac, 0.0001, 1.0);
- aniso.roughness_u = clamp( aniso.roughness_v * anisoFac, 0.0001, 1.0);
- return( aniso );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/average.glsllib b/src/Runtime/ogl-runtime/res/effectlib/average.glsllib
deleted file mode 100644
index 082eec0c..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/average.glsllib
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float average( in vec3 v )
-{
- return( ( v.x + v.y + v.z ) / 3.0 );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/blendColorLayers.glsllib b/src/Runtime/ogl-runtime/res/effectlib/blendColorLayers.glsllib
deleted file mode 100644
index e07fe613..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/blendColorLayers.glsllib
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef BLEND_COLOR_LAYERS_GLSLLIB
-#define BLEND_COLOR_LAYERS_GLSLLIB
-
-float maxValue( in vec3 t )
-{
- return max( max( t.x, t.y ), t.z );
-}
-
-vec3 blendColor( in vec3 t, in vec3 b, in float weight, in int blendMode)
-{
- vec3 blendResult = t;
- switch( blendMode )
- {
- case color_layer_add :
- blendResult += b;
- break;
- case color_layer_multiply :
- blendResult *= b;
- break;
- case color_layer_screen :
- blendResult += t - t * b;
- break;
- case color_layer_overlay:
- blendResult = (maxValue(t) >= 0.5) ? 2.0 * (t+b - t*b - 0.5) : 2.0 * t*b;
- break;
- case color_layer_blend:
- default:
- // nothing to be done
- break;
- }
-
- return mix( b, blendResult, weight );
-}
-
-texture_return blendColorLayers( in color_layer colorLayer[1], in vec3 base, in int monoSource )
-{
- vec3 result = blendColor( colorLayer[0].layer_color, base, colorLayer[0].weight, colorLayer[0].mode );
-
- texture_return tr;
- tr.tint = result;
- tr.mono = monoChannel( vec4( result, 1.0 ), monoSource );
- return( tr );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/blur.glsllib b/src/Runtime/ogl-runtime/res/effectlib/blur.glsllib
deleted file mode 100644
index 1f3abc86..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/blur.glsllib
+++ /dev/null
@@ -1,295 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef BLUR_GLSLLIB
-#define BLUR_GLSLLIB 1
-#include "depthpass.glsllib"
-varying float xIncrement;
-varying float yIncrement;
-varying vec2 TexCoord0;
-varying vec2 TexCoord1;
-varying vec2 TexCoord2;
-varying vec2 TexCoord3;
-varying vec2 TexCoord4;
-varying vec2 TexCoord5;
-varying vec2 TexCoord6;
-varying vec2 TexCoord7;
-
-
-const vec3 poisson0 = vec3( 0.000000, 0.000000, 0.000000 );
-const vec3 poisson1 = vec3( 0.527837, -0.085868, 0.534776 );
-const vec3 poisson2 = vec3( -0.040088, 0.537087, 0.538581 );
-const vec3 poisson3 = vec3( -0.670445, -0.017995, 0.670686 );
-const vec3 poisson4 = vec3( -0.419418, -0.616039, 0.745262 );
-const vec3 poisson5 = vec3( 0.440453, -0.639399, 0.776421 );
-const vec3 poisson6 = vec3( -0.757088, 0.349334, 0.833796 );
-const vec3 poisson7 = vec3( 0.574619, 0.685879, 0.894772 );
-
-//7 textel gaussian
-#define WT7_0 20.0
-#define WT7_1 15.0
-#define WT7_2 6.0
-#define WT7_3 1.0
-#define WT7_NORMALIZE (WT7_0+2.0*(WT7_1+WT7_2+WT7_3))
-
-//3 textel gaussian
-#define WT3_0 1.0
-#define WT3_1 0.6
-#define WT3_NORMALIZE (WT3_0+2.0*(WT3_1))
-
-uniform vec2 CameraClipRange;
-
-float GetDepthMultiplier(vec2 inTexCoord, sampler2D inDepthSampler, float inFocusDistance, float inFocusWidth, float inFocusPenumbra)
-{
- float depthTap = getDepthValue( texture2D(inDepthSampler, inTexCoord), CameraClipRange );
- float linearDepth = depthValueToLinearDistance( depthTap, CameraClipRange );
- float depthDiff = max( 0.0, abs( linearDepth - inFocusDistance ) - (inFocusWidth/2.0) ) / inFocusPenumbra;
- return clamp( depthDiff, 0.0, 1.0 );
-}
-
-float GetTiltShiftMultiplier(vec2 inTexCoord, float inFocusBarHeight, float inFocusWidth )
-{
- //For now, you can't rotate the focus blur but in time you will be able to.
- float texPos = inTexCoord.y;
- float focusDiff = max( 0.0, abs( texPos - inFocusBarHeight ) - (inFocusWidth/2.0) ) / inFocusWidth;
- return clamp( focusDiff, 0.0, 1.0 );
-}
-
-#ifdef VERTEX_SHADER
-
-void SetupBoxBlurCoords(vec2 inTexInfo)
-{
- xIncrement = .5 / inTexInfo.x;
- yIncrement = .5 / inTexInfo.y;
- TexCoord0 = vec2( TexCoord.x + xIncrement, TexCoord.y + yIncrement );
- TexCoord1 = vec2( TexCoord.x - xIncrement, TexCoord.y - yIncrement );
- TexCoord2 = vec2( TexCoord.x - xIncrement, TexCoord.y + yIncrement );
- TexCoord3 = vec2( TexCoord.x + xIncrement, TexCoord.y - yIncrement );
-}
-
-void SetupPoissonBlurCoords(float inBlurAmount, vec2 inTexInfo )
-{
- float incX = inBlurAmount / inTexInfo.x;
- float incY = inBlurAmount / inTexInfo.y;
- TexCoord0 = vec2( TexCoord.x + poisson0.x * incX, TexCoord.y + poisson0.y * incY );
- TexCoord1 = vec2( TexCoord.x + poisson1.x * incX, TexCoord.y + poisson1.y * incY );
- TexCoord2 = vec2( TexCoord.x + poisson2.x * incX, TexCoord.y + poisson2.y * incY );
- TexCoord3 = vec2( TexCoord.x + poisson3.x * incX, TexCoord.y + poisson3.y * incY );
- TexCoord4 = vec2( TexCoord.x + poisson4.x * incX, TexCoord.y + poisson4.y * incY );
- TexCoord5 = vec2( TexCoord.x + poisson5.x * incX, TexCoord.y + poisson5.y * incY );
- TexCoord6 = vec2( TexCoord.x + poisson6.x * incX, TexCoord.y + poisson6.y * incY );
- TexCoord7 = vec2( TexCoord.x + poisson7.x * incX, TexCoord.y + poisson7.y * incY );
-}
-
-void SetupHorizontalGaussianBlur( float inDestWidth, float inBlurAmount, vec2 inTexCoord )
-{
- float increment = inBlurAmount/inDestWidth;
- TexCoord0 = vec2(inTexCoord.x + increment , inTexCoord.y );
- TexCoord1 = vec2(inTexCoord.x + increment * 2.0 , inTexCoord.y);
- TexCoord2 = vec2(inTexCoord.x + increment * 3.0 , inTexCoord.y);
- TexCoord3 = vec2(inTexCoord.x , inTexCoord.y);
- TexCoord4 = vec2(inTexCoord.x - increment , inTexCoord.y);
- TexCoord5 = vec2(inTexCoord.x - increment * 2.0 , inTexCoord.y);
- TexCoord6 = vec2(inTexCoord.x - increment * 3.0 , inTexCoord.y);
-}
-
-void SetupVerticalGaussianBlur( float inDestHeight, float inBlurAmount, vec2 inTexCoord )
-{
- float increment = inBlurAmount/inDestHeight;
- TexCoord0 = vec2(inTexCoord.x, inTexCoord.y + increment );
- TexCoord1 = vec2(inTexCoord.x, inTexCoord.y + increment * 2.0 );
- TexCoord2 = vec2(inTexCoord.x, inTexCoord.y + increment * 3.0);
- TexCoord3 = vec2(inTexCoord.x, inTexCoord.y);
- TexCoord4 = vec2(inTexCoord.x, inTexCoord.y - increment);
- TexCoord5 = vec2(inTexCoord.x, inTexCoord.y - increment * 2.0);
- TexCoord6 = vec2(inTexCoord.x, inTexCoord.y - increment * 3.0);
-}
-
-void SetupHorizontalGaussianBlur3Tap( float inDestWidth, float inBlurAmount, vec2 inTexCoord )
-{
- float increment = inBlurAmount/inDestWidth;
- TexCoord0 = vec2(inTexCoord.x + increment , inTexCoord.y );
- TexCoord1 = vec2(inTexCoord.x , inTexCoord.y);
- TexCoord2 = vec2(inTexCoord.x - increment , inTexCoord.y);
-}
-
-void SetupVerticalGaussianBlur3Tap( float inDestHeight, float inBlurAmount, vec2 inTexCoord )
-{
- float increment = inBlurAmount/inDestHeight;
- TexCoord0 = vec2(inTexCoord.x, inTexCoord.y + increment );
- TexCoord1 = vec2(inTexCoord.x, inTexCoord.y);
- TexCoord2 = vec2(inTexCoord.x, inTexCoord.y - increment);
-}
-
-#endif
-
-#ifdef FRAGMENT_SHADER
-
-vec4 BoxDepthBlur(sampler2D inDepthSampler, sampler2D inBlurSampler, float inBlurSamplerAlphaFlag
- , float inFocusDistance, float inFocusWidth, float inFocusPenumbra )
-{
- float mult0 = .25 * GetDepthMultiplier( TexCoord0, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra );
- float mult1 = .25 * GetDepthMultiplier( TexCoord1, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra );
- float mult2 = .25 * GetDepthMultiplier( TexCoord2, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra );
- float mult3 = .25 * GetDepthMultiplier( TexCoord3, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra );
- float multTotal = mult0 + mult1 + mult2 + mult3;
- float totalDivisor = multTotal != 0.0 ? 1.0 / multTotal : 0.0;
- vec4 OutCol = GetTextureValue(inBlurSampler, TexCoord0, inBlurSamplerAlphaFlag) * mult0;
- OutCol += GetTextureValue(inBlurSampler, TexCoord1, inBlurSamplerAlphaFlag) * mult1;
- OutCol += GetTextureValue(inBlurSampler, TexCoord2, inBlurSamplerAlphaFlag) * mult2;
- OutCol += GetTextureValue(inBlurSampler, TexCoord3, inBlurSamplerAlphaFlag) * mult3;
- return OutCol * totalDivisor;
-}
-
-vec4 BoxTiltShiftBlur( sampler2D inBlurSampler, float inBlurSamplerAlphaFlag
- , float inFocusBarHeight, float inFocusWidth )
-{
- float mult0 = .25 * GetTiltShiftMultiplier( TexCoord0, inFocusBarHeight, inFocusWidth );
- float mult1 = .25 * GetTiltShiftMultiplier( TexCoord1, inFocusBarHeight, inFocusWidth );
- float mult2 = .25 * GetTiltShiftMultiplier( TexCoord2, inFocusBarHeight, inFocusWidth );
- float mult3 = .25 * GetTiltShiftMultiplier( TexCoord3, inFocusBarHeight, inFocusWidth );
- float multTotal = mult0 + mult1 + mult2 + mult3;
- float totalDivisor = multTotal != 0.0 ? 1.0 / multTotal : 0.0;
- vec4 OutCol = GetTextureValuePreMult(inBlurSampler, TexCoord0) * mult0;
- OutCol += GetTextureValuePreMult(inBlurSampler, TexCoord1) * mult1;
- OutCol += GetTextureValuePreMult(inBlurSampler, TexCoord2) * mult2;
- OutCol += GetTextureValuePreMult(inBlurSampler, TexCoord3) * mult3;
- return OutCol * totalDivisor;
-}
-
-vec4 PoissonDepthBlur(sampler2D inSampler, float inAlphaFlag, sampler2D inDepthSampler
- , float inFocusDistance, float inFocusWidth, float inFocusPenumbra )
-{
- float mult0 = (1.0 - poisson0.z) * GetDepthMultiplier(TexCoord0,inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra);
- float mult1 = (1.0 - poisson1.z) * GetDepthMultiplier(TexCoord1,inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra);
- float mult2 = (1.0 - poisson2.z) * GetDepthMultiplier(TexCoord2,inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra);
-
- float multTotal = mult0 + mult1 + mult2;
- float multMultiplier = multTotal > 0.0 ? 1.0 / multTotal : 0.0;
-
- vec4 outColor = GetTextureValue( inSampler, TexCoord0, inAlphaFlag ) * (mult0 * multMultiplier);
- outColor += GetTextureValue( inSampler, TexCoord1, inAlphaFlag ) * (mult1 * multMultiplier);
- outColor += GetTextureValue( inSampler, TexCoord2, inAlphaFlag ) * (mult2 * multMultiplier);
- return outColor;
-}
-
-vec4 PoissonTiltShiftBlur(sampler2D inSampler, float inAlphaFlag, float inBarHeight, float inFocusWidth )
-{
- float mult0 = (1.0 - poisson0.z) * GetTiltShiftMultiplier(TexCoord0, inBarHeight, inFocusWidth );
- float mult1 = (1.0 - poisson1.z) * GetTiltShiftMultiplier(TexCoord1, inBarHeight, inFocusWidth );
- float mult2 = (1.0 - poisson2.z) * GetTiltShiftMultiplier(TexCoord2, inBarHeight, inFocusWidth );
- float mult3 = (1.0 - poisson3.z) * GetTiltShiftMultiplier(TexCoord3, inBarHeight, inFocusWidth );
- float mult4 = (1.0 - poisson4.z) * GetTiltShiftMultiplier(TexCoord4, inBarHeight, inFocusWidth );
-
- float multTotal = mult0 + mult1 + mult2 + mult3 + mult4;
- float multMultiplier = multTotal > 0.0 ? 1.0 / multTotal : 0.0;
-
- vec4 outColor = GetTextureValuePreMult( inSampler, TexCoord0 ) * (mult0 * multMultiplier);
- outColor += GetTextureValuePreMult( inSampler, TexCoord1 ) * (mult1 * multMultiplier);
- outColor += GetTextureValuePreMult( inSampler, TexCoord2 ) * (mult2 * multMultiplier);
- outColor += GetTextureValuePreMult( inSampler, TexCoord3 ) * (mult3 * multMultiplier);
- outColor += GetTextureValuePreMult( inSampler, TexCoord4 ) * (mult4 * multMultiplier);
- return outColor;
-}
-
-float GaussianAlphaBlur( sampler2D inSampler, float inAlphaFlag )
-{
- float OutCol = 0.0;
- OutCol += GetTextureValue(inSampler, TexCoord0, inAlphaFlag).a * ( WT7_1/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord1, inAlphaFlag).a * ( WT7_2/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord2, inAlphaFlag).a * ( WT7_3/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord3, inAlphaFlag).a * ( WT7_0/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord4, inAlphaFlag).a * ( WT7_1/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord5, inAlphaFlag).a * ( WT7_2/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord6, inAlphaFlag).a * ( WT7_3/WT7_NORMALIZE );
- return OutCol;
-}
-
-vec4 GaussianBlur( sampler2D inSampler, float inAlphaFlag )
-{
- vec4 OutCol = vec4(0.0);
- OutCol += GetTextureValue(inSampler, TexCoord0, inAlphaFlag) * ( WT7_1/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord1, inAlphaFlag) * ( WT7_2/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord2, inAlphaFlag) * ( WT7_3/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord3, inAlphaFlag) * ( WT7_0/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord4, inAlphaFlag) * ( WT7_1/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord5, inAlphaFlag) * ( WT7_2/WT7_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord6, inAlphaFlag) * ( WT7_3/WT7_NORMALIZE );
- return OutCol;
-}
-
-vec4 GaussianBlur3Tap( sampler2D inSampler, float inAlphaFlag )
-{
- vec4 OutCol = vec4(0.0);
- OutCol += GetTextureValue(inSampler, TexCoord0, inAlphaFlag) * ( WT3_1/WT3_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord1, inAlphaFlag) * ( WT3_0/WT3_NORMALIZE );
- OutCol += GetTextureValue(inSampler, TexCoord2, inAlphaFlag) * ( WT3_1/WT3_NORMALIZE );
- return OutCol;
-}
-
-//Get texture data for a texture we know is premultiplied.
-vec4 GaussianBlur3TapPremultiplied( sampler2D inSampler )
-{
- vec4 OutCol = vec4(0.0);
- OutCol += texture2D(inSampler, TexCoord0) * ( WT3_1/WT3_NORMALIZE );
- OutCol += texture2D(inSampler, TexCoord1) * ( WT3_0/WT3_NORMALIZE );
- OutCol += texture2D(inSampler, TexCoord2) * ( WT3_1/WT3_NORMALIZE );
- return OutCol;
-}
-
-vec4 GaussianDepthBlur( sampler2D inSampler, float inTextureAlphaInfo, sampler2D inDepthSampler
- , float inFocusDistance, float inFocusWidth, float inFocusPenumbra )
-{
- //We modulate each sample weight by the depth value so that we minimize bleeding of the focused
- //area into the non-focused area.
- float mult0 = GetDepthMultiplier(TexCoord0, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_1;
- float mult1 = GetDepthMultiplier(TexCoord1, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_2;
- float mult2 = GetDepthMultiplier(TexCoord2, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_3;
- float mult3 = GetDepthMultiplier(TexCoord3, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_0;
- float mult4 = GetDepthMultiplier(TexCoord4, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_1;
- float mult5 = GetDepthMultiplier(TexCoord5, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_2;
- float mult6 = GetDepthMultiplier(TexCoord6, inDepthSampler, inFocusDistance, inFocusWidth, inFocusPenumbra) * WT7_3;
- float multTotal = mult0 + mult1 + mult2 + mult3 + mult4 + mult5 + mult6;
- float multMultiplier = multTotal > 0.0 ? 1.0 / multTotal : 0.0;
- vec4 OutCol = vec4(0.0);
- OutCol += GetTextureValue(inSampler, TexCoord0, inTextureAlphaInfo) * (mult0 * multMultiplier);
- OutCol += GetTextureValue(inSampler, TexCoord1, inTextureAlphaInfo) * (mult1 * multMultiplier);
- OutCol += GetTextureValue(inSampler, TexCoord2, inTextureAlphaInfo) * (mult2 * multMultiplier);
- OutCol += GetTextureValue(inSampler, TexCoord3, inTextureAlphaInfo) * (mult3 * multMultiplier);
- OutCol += GetTextureValue(inSampler, TexCoord4, inTextureAlphaInfo) * (mult4 * multMultiplier);
- OutCol += GetTextureValue(inSampler, TexCoord5, inTextureAlphaInfo) * (mult5 * multMultiplier);
- OutCol += GetTextureValue(inSampler, TexCoord6, inTextureAlphaInfo) * (mult6 * multMultiplier);
- return OutCol;
-}
-
-#endif
-
-
-#endif // BLUR_GLSLLIB
diff --git a/src/Runtime/ogl-runtime/res/effectlib/calculateRoughness.glsllib b/src/Runtime/ogl-runtime/res/effectlib/calculateRoughness.glsllib
deleted file mode 100644
index a14083d6..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/calculateRoughness.glsllib
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float calculateRoughness( in vec3 N, in float roughnessU, in float roughnessV, in vec3 tangentU )
-{
- float roughness = roughnessU;
- if ( abs(roughnessU - roughnessV) > 0.00001)
- {
- // determine major and minor radii a and b, and the vector along the major axis
- float a = roughnessU;
- float b = roughnessV;
-
- // we need the angle between the major axis and the projection of viewDir on the tangential plane
- // the major axis is the orthonormalization of tangentU with respect to N
- // the projection of viewDir is the orthonormalization of viewDir with respect to N
- // as both vectors would be calculated by orthonormalize, we can as well leave the second cross
- // product in those calculations away, as they don't change the angular relation.
- vec3 minorAxis = normalize( cross( tangentU, N ) ); // crossing this with N would give the major axis
- // which is equivalent to orthonormalizing tangentU with respect to N
- if ( roughnessU < roughnessV )
- {
- a = roughnessV;
- b = roughnessU;
- minorAxis = cross( N, minorAxis );
- }
-
- vec3 po = normalize( cross( viewDir, N ) );
- float cosPhi = dot( po, minorAxis );
-
- // determine the polar coordinate of viewDir, take that radius as the roughness
- float excentricitySquare = 1.0 - square( b / a );
- roughness = b / sqrt( 1.0 - excentricitySquare * square( cosPhi ) );
- }
- return( roughness );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/coordinateSource.glsllib b/src/Runtime/ogl-runtime/res/effectlib/coordinateSource.glsllib
deleted file mode 100644
index bc435d51..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/coordinateSource.glsllib
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-texture_coordinate_info coordinateSource( in int coordinateSystem, in int textureSpace )
-{
- texture_coordinate_info tci;
- switch( coordinateSystem )
- {
- case texture_coordinate_object :
- tci.position = varObjPos;
- tci.tangent_u = normalize( varObjTangent );
- tci.tangent_v = normalize( varObjBinormal );
- break;
- case texture_coordinate_world :
- tci.position = varWorldPos;
- tci.tangent_u = normalize( varTangent );
- tci.tangent_v = normalize( varBinormal );
- break;
- case texture_coordinate_uvw :
- default :
- tci.position = varTexCoord0;
- tci.tangent_u = normalize( varTangent );
- tci.tangent_v = normalize( varBinormal );
- break;
- }
- return( tci );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/cube.glsllib b/src/Runtime/ogl-runtime/res/effectlib/cube.glsllib
deleted file mode 100644
index 74da8333..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/cube.glsllib
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float cube( in float x )
-{
- return( x * x * x );
-}
-
-vec2 cube( in vec2 x )
-{
- return( x * x * x );
-}
-
-vec3 cube( in vec3 x )
-{
- return( x * x * x );
-}
-
-vec4 cube( in vec4 x )
-{
- return( x * x * x );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/customCurveLayer.glsllib b/src/Runtime/ogl-runtime/res/effectlib/customCurveLayer.glsllib
deleted file mode 100644
index 2bc1780e..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/customCurveLayer.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 customCurveLayer( in vec3 L, in float normal_reflectivity, in float grazing_reflectivity, in float exponent, float weight, in vec3 layercolor, vec4 layer, vec4 base, in float alpha )
-{
- vec3 H = normalize( viewDir + L );
- vec3 refl = reflect( -viewDir, H );
- float reflWt = clamp( dot( surfNormal, refl ) + 1.0, 0.0, 1.0 );
-
- float curveFactor = mix( normal_reflectivity, grazing_reflectivity, pow(1.0 - abs(dot( viewDir, H )), exponent) );
- curveFactor *= weight * reflWt;
-
- return( vec4( mix( base.rgb, layercolor * layer.rgb, curveFactor ), mix(alpha, 1.0, curveFactor) ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/customMaterial.glsllib b/src/Runtime/ogl-runtime/res/effectlib/customMaterial.glsllib
deleted file mode 100644
index 0a4d88b9..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/customMaterial.glsllib
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CUSTOM_MATERIAL_GLSLLIB
-#define CUSTOM_MATERIAL_GLSLLIB 1
-
-#define SNAPPER_SAMPLER2D(samplerName, samplerNiceName, texFilter, texWrap, showUI )\
-uniform sampler2D samplerName;
-
-// some useful defines
-#ifndef PI
-#define PI 3.14159265358979
-#define PI_HALF ( 0.5 * PI )
-#define PI_TWO ( 2.0 * PI )
-#define ONE_OVER_PI ( 1.0 / PI )
-#define TWO_OVER_PI ( 2.0 / PI )
-#define PI_SQUARE ( PI * PI )
-#endif
-
-#endif // CUSTOM_MATERIAL_GLSLLIB
diff --git a/src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBody.glsllib b/src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBody.glsllib
deleted file mode 100644
index fccb8e05..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBody.glsllib
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CUSTOM_MATERIAL_FRAG_BODY_GLSLLIB
-#define CUSTOM_MATERIAL_FRAG_BODY_GLSLLIB
-
- bool twoSided = false;
- vec3 materialEmissive = vec3( 0.0, 0.0, 0.0 );
-
- float materialIOR = computeIOR();
-
- if ( gl_FrontFacing )
- {
- materialEmissive = computeFrontMaterialEmissive() * computeMaterialEmissiveMask();
- }
- else
- {
- materialIOR = 1.0 / materialIOR;
- twoSided = evalTwoSided();
- if ( twoSided )
- {
- normal = -normal;
- materialEmissive = computeBackMaterialEmissive() * computeMaterialEmissiveMask();
- }
- }
-
- vec4 rgba = vec4( materialEmissive, 0.0 );
-
- vec3 lightAmbient, lightDiffuse, lightSpecular, L;
- for ( int i=0 ; i<uNumLights ; i++ )
- {
- sampleLight( lights[i], varWorldPos, L, lightAmbient, lightDiffuse, lightSpecular);
- //evalTemporariesPerLightSource( normal, L, lightDiffuse, lightSpecular, materialIOR );
- if (gl_FrontFacing)
- computeFrontLayerColor( normal, L, viewDir, lightDiffuse, lightSpecular, materialIOR, 1.0 );
- else
- computeBackLayerColor( normal, L, viewDir, lightDiffuse, lightSpecular, materialIOR, 1.0 );
- }
- for ( int i=0 ; i < uNumAreaLights; ++i )
- {
- if (gl_FrontFacing)
- computeFrontAreaColor( i, arealights[i].diffuse, arealights[i].specular );
- else
- computeBackAreaColor( i, arealights[i].diffuse, arealights[i].specular );
- }
-
- if ( 0.0 < alpha )
- {
- if (gl_FrontFacing)
- computeFrontLayerEnvironment( normal, viewDir, 1.0 );
- else
- computeBackLayerEnvironment( normal, viewDir, 1.0 );
- }
-
- rgba += computeLayerWeights( alpha );
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBodyAO.glsllib b/src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBodyAO.glsllib
deleted file mode 100644
index d194569e..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/customMaterialFragBodyAO.glsllib
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CUSTOM_MATERIAL_FRAG_BODY_AO_GLSLLIB
-#define CUSTOM_MATERIAL_FRAG_BODY_AO_GLSLLIB
-
- bool twoSided = false;
- vec3 materialEmissive = vec3( 0.0, 0.0, 0.0 );
-
- float materialIOR = computeIOR();
-
- if ( gl_FrontFacing )
- {
- materialEmissive = computeFrontMaterialEmissive() * computeMaterialEmissiveMask();
- }
- else
- {
- materialIOR = 1.0 / materialIOR;
- twoSided = evalTwoSided();
- if ( twoSided )
- {
- normal = -normal;
- materialEmissive = computeBackMaterialEmissive() * computeMaterialEmissiveMask();
- }
- }
-
- vec4 rgba = vec4( materialEmissive, 0.0 );
-
- // compute ambient occlusion
- float aoFactor = customMaterialAO( );
-
- vec3 lightAmbient, lightDiffuse, lightSpecular, L;
- for ( int i=0 ; i<uNumLights ; i++ )
- {
- sampleLight( lights[i], varWorldPos, L, lightAmbient, lightDiffuse, lightSpecular);
- lightAmbient *= aoFactor;
- lightDiffuse *= aoFactor;
-
- //evalTemporariesPerLightSource( normal, L, lightDiffuse, lightSpecular, materialIOR );
- if (gl_FrontFacing)
- computeFrontLayerColor( normal, L, viewDir, lightDiffuse, lightSpecular, materialIOR, aoFactor );
- else
- computeBackLayerColor( normal, L, viewDir, lightDiffuse, lightSpecular, materialIOR, aoFactor );
- }
- for ( int i=0 ; i < uNumAreaLights; ++i )
- {
- if (gl_FrontFacing)
- computeFrontAreaColor( i, arealights[i].diffuse, arealights[i].specular );
- else
- computeBackAreaColor( i, arealights[i].diffuse, arealights[i].specular );
- }
-
- if ( 0.0 < alpha )
- {
- if (gl_FrontFacing)
- computeFrontLayerEnvironment( normal, viewDir, aoFactor );
- else
- computeBackLayerEnvironment( normal, viewDir, aoFactor );
- }
-
- rgba += computeLayerWeights( alpha );
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialBumpNoLod.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialBumpNoLod.glsllib
deleted file mode 100644
index 4144ae2f..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialBumpNoLod.glsllib
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float calcRGBAvg(in vec4 rgba)
-{
- return (rgba.r + rgba.g + rgba.b) / 3.0;
-}
-
-vec3 defaultMaterialBumpNoLod(in sampler2D sampler, in float factor,
- in vec2 texCoord, in vec3 tangent, in vec3 binormal,
- in vec3 normal, in vec2 bumpSize)
-{
- // invert factor
- float invFactor = -factor;
-
- vec2 unitStep = 1.0 / bumpSize;
-
- float du = calcRGBAvg(texture2D(sampler, vec2(texCoord.x + unitStep.x, texCoord.y)))
- - calcRGBAvg(texture2D(sampler, vec2(texCoord.x, texCoord.y)));
- float dv = calcRGBAvg(texture2D(sampler, vec2(texCoord.x, texCoord.y + unitStep.y)))
- - calcRGBAvg(texture2D(sampler, vec2(texCoord.x, texCoord.y)));
-
- vec3 n = normalize(vec3(invFactor * du, invFactor * dv, 1.0));
- n = n.x * normalize(tangent) + n.y * normalize(binormal) + n.z * normal;
- return normalize(normal + n);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileBumpTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileBumpTexture.glsllib
deleted file mode 100644
index 6901ace0..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileBumpTexture.glsllib
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_DEFAULT_MATERIAL_FILE_BUMP_TEXTURE_GLSLLIB
-#define QT3DS_DEFAULT_MATERIAL_FILE_BUMP_TEXTURE_GLSLLIB
-
-#ifndef QT3DS_DEFINE_API
-#define QT3DS_DEFINE_API
-#endif
-
-#include "fileBumpTexture.glsllib"
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib
deleted file mode 100644
index 4c9af3fc..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_DEFAULT_MATERIAL_FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-#define QT3DS_DEFAULT_MATERIAL_FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-
-#ifndef QT3DS_DEFINE_API
-#define QT3DS_DEFINE_API
-#endif
-
-#include "fileDisplacementTexture.glsllib"
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileNormalTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileNormalTexture.glsllib
deleted file mode 100644
index 70ab52bc..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFileNormalTexture.glsllib
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_DEFAULT_MATERIAL_FILE_NORMAL_TEXTURE_GLSLLIB
-#define QT3DS_DEFAULT_MATERIAL_FILE_NORMAL_TEXTURE_GLSLLIB
-
-#ifndef QT3DS_DEFINE_API
-#define QT3DS_DEFINE_API
-#endif
-
-#include "tangentSpaceNormalTexture.glsllib"
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFresnel.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFresnel.glsllib
deleted file mode 100644
index e0eff4ff..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialFresnel.glsllib
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DEFAULT_MATERIAL_FRESNEL_GLSLLIB
-#define DEFAULT_MATERIAL_FRESNEL_GLSLLIB
-
-float defaultMaterialSimpleFresnel( in vec3 N, in vec3 viewDir, in float ior, float fresnelPower )
-{
- float F = ((1.0-ior) * (1.0-ior)) / ((1.0+ior) * (1.0+ior));
- float VdotN = dot(viewDir, N);
- VdotN = clamp( VdotN, 0.0, 1.0 );
- float ratio = F + (1.0 - F) * pow(1.0 - VdotN, fresnelPower);
-
- return ratio;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialLighting.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialLighting.glsllib
deleted file mode 100644
index e96a4509..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialLighting.glsllib
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * UICViewer lighting equation implementations
- */
-
-#ifndef DEFAULT_MATERIAL_LIGHTING
-#define DEFAULT_MATERIAL_LIGHTING
-
-#include "diffuseReflectionBSDF.glsllib"
-#include "luminance.glsllib"
-#include "specularBSDF.glsllib"
-
-#include "funccalculatePointLightAttenuation.glsllib"
-#include "funcgetTransformedUVCoords.glsllib"
-
-vec2 calculateLightParameters( vec3 lightDir, vec3 normalDir )
-{
- vec2 retval;
- retval.x = max( 0.0, -1.0 * dot( lightDir, normalDir ) ); //diffuseIntensity
- retval.y = clamp( retval.x * 4.0, 0.0, 1.0 ); //selfShadowTerm
- return retval;
-}
-vec2 calculateWrapLightParameters( vec3 lightDir, vec3 normalDir, float wrap )
-{
- vec2 retval;
- retval.x = max( 0.0, -1.0 * ((dot(lightDir, normalDir) + wrap)/ (1.0 + wrap)) ); //diffuseIntensity
- retval.y = clamp( retval.x, 0.0, 1.0 ); //selfShadowTerm
- return retval;
-}
-
-vec3 calculateDirectionalAddition( vec3 lightColor, vec2 lightParameters ) {
- return ( lightColor * lightParameters.x * lightParameters.y );
-}
-
-vec3 calculateSpecularAddition( vec3 lightDir, vec3 normalDir, vec3 viewVec, vec3 lightSpecularColor, float specularAmount
- , float specularRoughness, vec2 lightParameters )
-{
- vec3 reflection = normalize( 2.0 * lightParameters.x * normalDir + lightDir );
- return ( lightParameters.y * specularAmount * lightSpecularColor * pow( clamp( dot( reflection, viewVec ), 0.0, 1.0 ), specularRoughness ) );
-}
-
-float calculateDiffuseAreaFactors( in vec3 lightDir, in vec3 lightPos, in vec4 lightUp, in vec4 lightRt, in vec3 worldPos, out vec3 outDir )
-{
- vec3 v0 = lightPos - (lightRt.xyz * lightRt.w * 0.5) - (lightUp.xyz * lightUp.w * 0.5);
- vec3 v1 = lightPos - (lightRt.xyz * lightRt.w * 0.5) + (lightUp.xyz * lightUp.w * 0.5);
- vec3 v2 = lightPos + (lightRt.xyz * lightRt.w * 0.5) + (lightUp.xyz * lightUp.w * 0.5);
- vec3 v3 = lightPos + (lightRt.xyz * lightRt.w * 0.5) - (lightUp.xyz * lightUp.w * 0.5);
- v0 = normalize( v0 - worldPos ); v1 = normalize( v1 - worldPos );
- v2 = normalize( v2 - worldPos ); v3 = normalize( v3 - worldPos );
- float a01 = acos( clamp( dot(v0, v1), -1.0, 1.0 ) );
- float a12 = acos( clamp( dot(v1, v2), -1.0, 1.0 ) );
- float a23 = acos( clamp( dot(v2, v3), -1.0, 1.0 ) );
- float a30 = acos( clamp( dot(v3, v0), -1.0, 1.0 ) );
- outDir = vec3( 0.0 );
- outDir -= normalize(cross( v0, v1 )) * a01;
- outDir -= normalize(cross( v1, v2 )) * a12;
- outDir -= normalize(cross( v2, v3 )) * a23;
- outDir -= normalize(cross( v3, v0 )) * a30;
- float retVal = length(outDir) * 0.15915494309; // solid angle / 2*pi
- outDir = -normalize(outDir);
- retVal *= clamp( dot( worldPos-lightPos, lightDir), 0.0, 1.0 );
- return retVal;
-}
-
-vec3 calculateSpecDirection( in vec3 lightDir, in vec3 lightPos, in vec4 lightUp, in vec4 lightRt, in vec3 worldPos, in vec3 worldNorm, in vec3 viewDir )
-{
- vec3 reflDir = reflect(viewDir, worldNorm);
- vec3 ldir = normalize( lightPos - worldPos );
- if ( dot( ldir, lightDir ) > 0.0 ) { return vec3(0.0001); }
- float t = (dot(lightDir, worldPos) - dot(lightDir, lightPos)) / dot(lightDir, reflDir);
- if ( t < 0.0 ) { return vec3(0.0001); }
- vec3 xsectPos = worldPos - t * reflDir;
- float tx = dot( xsectPos - lightPos, lightRt.xyz );
- float ty = dot( xsectPos - lightPos, lightUp.xyz );
- tx = clamp(tx, -lightRt.w*0.5, lightRt.w*0.5);
- ty = clamp(ty, -lightUp.w*0.5, lightUp.w*0.5);
- xsectPos = lightPos + lightUp.xyz * ty + lightRt.xyz * tx;
- return normalize( worldPos - xsectPos );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib
deleted file mode 100644
index 1035e436..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DEFAULT_MATERIAL_PHYS_GLOSSY_BSDF_GLSLLIB
-#define DEFAULT_MATERIAL_PHYS_GLOSSY_BSDF_GLSLLIB
-#ifndef QT3DS_DEFINE_API
-#define QT3DS_DEFINE_API
-#endif
-
-#include "luminance.glsllib"
-#define scatter_reflect 0
-#define scatter_transmit 1
-#define scatter_reflect_transmit 2
-#include "physGlossyBSDF.glsllib"
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/depthpass.glsllib b/src/Runtime/ogl-runtime/res/effectlib/depthpass.glsllib
deleted file mode 100644
index cbd45c24..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/depthpass.glsllib
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DEPTHPASS_GLSLIB
-#define DEPTHPASS_GLSLIB 1
-
-float calculateVertexDepth( vec2 camera_properties, vec4 position )
-{
- float camera_range = camera_properties.y - camera_properties.x;
- return 1.0 - ((position.w - camera_properties.x) / (camera_range));
-}
-
-#if __VERSION__ <= 120
-float modf(in float val, out float integer)
-{
- integer = floor(val);
- return val - integer;
-}
-#endif
-
-vec4 outputDepth( float vert_depth )
-{
- float integer_portion = 0.0;
- float fraction = modf((vert_depth * 255.0), integer_portion);
- return vec4( integer_portion / 255.0, fraction, 0, 1.0 );
-}
-
-float getDepthValue( vec4 depth_texture_sample, vec2 camera_properties )
-{
-
-#if __VERSION__ >= 300
- float zNear = camera_properties.x;
- float zFar = camera_properties.y;
- float zRange = zFar - zNear;
- float z_b = depth_texture_sample.x;
- float z_n = 2.0 * z_b - 1.0;
- float z_e = 2.0 * zNear * zFar / (zFar + zNear - z_n * (zRange));
- return 1.0 - ((z_e - camera_properties.x) / (zRange));
-#else
- return depth_texture_sample.x + (depth_texture_sample.y / 255.0);
-#endif
-}
-
-float depthValueToLinearDistance( float depth_value, vec2 camera_properties )
-{
- float FarClipDistance = camera_properties.y;
- float NearClipDistance = camera_properties.x;
- float DepthRange = FarClipDistance - NearClipDistance;
- float linearDepth = NearClipDistance + (DepthRange * (1.0 - depth_value));
- return linearDepth;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/dfTint.glsllib b/src/Runtime/ogl-runtime/res/effectlib/dfTint.glsllib
deleted file mode 100644
index f1f4b7ac..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/dfTint.glsllib
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 dfTint( in vec3 tint, in vec4 base )
-{
- return( vec4( tint * base.rgb, base.a ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/diffuseReflectionBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/diffuseReflectionBSDF.glsllib
deleted file mode 100644
index a98509d9..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/diffuseReflectionBSDF.glsllib
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "funcdiffuseReflectionBSDF.glsllib"
-#include "funcdiffuseReflectionWrapBSDF.glsllib"
-
-vec4 lambertReflectionBSDF( in vec3 N, in vec3 L, in vec3 lightDiffuse )
-{
- // If we're not going to use the roughness on the diffuse, there's no point
- // in wasting the cycles for the branching.
- float cosThetaI = max( 0.0, dot( N, L ) );
- return vec4( cosThetaI * lightDiffuse, 1.0 );
-}
-
-
-vec4 diffuseReflectionBSDFEnvironment( in vec3 N, in float roughness )
-{
- return( vec4( 0.0, 0.0, 0.0, 1.0 ) );
-}
-
-// RNM radiosity normal maps
-vec4 diffuseRNM( in vec3 N, in vec3 rnmX, in vec3 rnmY, in vec3 rnmZ )
-{
- // we use a fixed basis like Half Life
- vec3 B0 = vec3( -0.40825, 0.70711, 0.57735);
- vec3 B1 = vec3( -0.40825, -0.70711, 0.57735);
- vec3 B2 = vec3( 0.8165, 0.0, 0.57735);
-
- vec3 dp;
- dp.x = clamp( dot ( N , B0 ), 0.0, 1.0);
- dp.y = clamp( dot ( N , B1 ), 0.0, 1.0);
- dp.z = clamp( dot ( N , B2 ), 0.0, 1.0);
-
- float sum = 1.0 / dot( dp, vec3(1.0, 1.0, 1.0) );
- vec3 diffuseLight = dp.x * rnmX + dp.y * rnmY + dp.z * rnmZ;
- //vec3 diffuseLight = N.x * rnmX + N.y * rnmY + N.z * rnmZ;
-
- return (vec4(diffuseLight, 1.0) * sum);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/diffuseTransmissionBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/diffuseTransmissionBSDF.glsllib
deleted file mode 100644
index f6e5f52b..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/diffuseTransmissionBSDF.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 diffuseTransmissionBSDF( in vec3 N, in vec3 L, in vec3 viewDir, in vec3 lightDiffuse, in vec4 transmissiveColor, in float translucentFalloff, float lightWrap )
-{
- float cosThetaI = max( 0.0, (dot( N, L ) + lightWrap) / (1.0 + lightWrap) );
- float factor = cosThetaI;
-
- float l = 0.2126 * transmissiveColor.r + 0.7152 * transmissiveColor.g + 0.0722 * transmissiveColor.b;
-
- float translucent_thickness = l * l;
- float translucent_thickness_exp = exp( translucent_thickness * translucentFalloff);
-
- return( translucent_thickness_exp * vec4( factor * lightDiffuse, 1.0 ) );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/directionalFactor.glsllib b/src/Runtime/ogl-runtime/res/effectlib/directionalFactor.glsllib
deleted file mode 100644
index 78af8839..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/directionalFactor.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 directionalFactor( in vec3 normal, in vec3 viewDir, in vec3 normal_col, in vec3 grazing_col, in float exponent, in vec4 base )
-{
- float f;
-
- f = clamp(dot(viewDir, normal),0.0, 1.0 );
- f = 1.0 - pow(f, 1.0/exponent);
- vec3 directionalColor = mix( normal_col, grazing_col, f );
-
- vec4 color = base * vec4(directionalColor, 1.0);
-
- return color;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.frag b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.frag
deleted file mode 100644
index 1d834902..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.frag
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifdef GL_OES_standard_derivatives
-# extension GL_OES_standard_derivatives : enable
-#else
-# define use_fallback
-#endif
-
-varying highp vec2 sampleCoord;
-
-uniform sampler2D _qt_texture;
-uniform highp vec4 color;
-
-#ifdef use_fallback
-varying highp vec2 alphas;
-#endif
-
-void main()
-{
- highp float distance = texture2D(_qt_texture, sampleCoord).a;
-
-#ifdef use_fallback
- highp float alpha = smoothstep(alphas.x, alphas.y, distance);
-#else
- highp float f = fwidth(distance);
- highp float alpha = smoothstep(0.5 - f, 0.5, distance);
-#endif
-
- gl_FragColor = color * alpha;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.vert b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.vert
deleted file mode 100644
index f6b2de41..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext.vert
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifdef GL_OES_standard_derivatives
-# extension GL_OES_standard_derivatives : enable
-#else
-# define use_fallback
-#endif
-
-uniform highp mat4 mvp;
-uniform highp float fontScale;
-uniform int textureWidth;
-uniform int textureHeight;
-
-attribute highp vec3 vCoord;
-attribute highp vec2 tCoord;
-
-varying highp vec2 sampleCoord;
-
-#ifdef use_fallback
-varying highp vec2 alphas;
-
-highp float thresholdFunc(highp float scale)
-{
- highp float base = 0.5;
- highp float baseDev = 0.065;
- highp float devScaleMin = 0.15;
- highp float devScaleMax = 0.3;
- return base - ((clamp(scale, devScaleMin, devScaleMax) - devScaleMin)
- / (devScaleMax - devScaleMin) * -baseDev + baseDev);
-}
-
-highp float spreadFunc(highp float scale)
-{
- return 0.06 / scale;
-}
-
-highp vec2 alphaRange(highp float scale)
-{
- highp float base = thresholdFunc(scale);
- highp float range = spreadFunc(scale);
- highp float alphaMin = max(0.0, base - range);
- highp float alphaMax = min(base + range, 1.0);
- return vec2(alphaMin, alphaMax);
-}
-
-highp float determinantOfSubmatrix(highp mat4 m, int col0, int col1, int row0, int row1)
-{
- return m[col0][row0] * m[col1][row1] - m[col0][row1] * m[col1][row0];
-}
-
-highp float determinantOfSubmatrix(highp mat4 m, int col0, int col1, int col2,
- int row0, int row1, int row2)
-{
- highp float det = m[col0][row0] * determinantOfSubmatrix(m, col1, col2, row1, row2);
- det -= m[col1][row0] * determinantOfSubmatrix(m, col0, col2, row1, row2);
- det += m[col2][row0] * determinantOfSubmatrix(m, col0, col1, row1, row2);
- return det;
-}
-
-highp float determinant(highp mat4 m)
-{
- highp float det = m[0][0] * determinantOfSubmatrix(m, 1, 2, 3, 1, 2, 3);
- det -= m[1][0] * determinantOfSubmatrix(m, 0, 2, 3, 1, 2, 3);
- det += m[2][0] * determinantOfSubmatrix(m, 0, 1, 3, 1, 2, 3);
- det -= m[3][0] * determinantOfSubmatrix(m, 0, 1, 2, 1, 2, 3);
- return det;
-}
-#endif
-
-void main()
-{
-#ifdef use_fallback
- highp float scale = fontScale * pow(abs(determinant(mvp)), 1.0 / 3.0);
- alphas = alphaRange(scale);
-#endif
-
- sampleCoord = tCoord * vec2(1.0 / float(textureWidth), 1.0 / float(textureHeight));
- gl_Position = mvp * vec4(vCoord, 1.0);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.frag b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.frag
deleted file mode 100644
index bf60f874..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.frag
+++ /dev/null
@@ -1,13 +0,0 @@
-in vec2 sampleCoord;
-
-out vec4 fragColor;
-
-uniform sampler2D _qt_texture;
-uniform vec4 color;
-
-void main()
-{
- float distance = texture(_qt_texture, sampleCoord).r;
- float f = fwidth(distance);
- fragColor = color * smoothstep(0.5 - f, 0.5, distance);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.vert b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.vert
deleted file mode 100644
index 2dc198f4..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_core.vert
+++ /dev/null
@@ -1,15 +0,0 @@
-in vec3 vCoord;
-in vec2 tCoord;
-
-out vec2 sampleCoord;
-
-uniform mat4 mvp;
-uniform int textureWidth;
-uniform int textureHeight;
-uniform float fontScale;
-
-void main()
-{
- sampleCoord = tCoord * vec2(1.0 / float(textureWidth), 1.0 / float(textureHeight));
- gl_Position = mvp * vec4(vCoord, 1.0);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.frag b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.frag
deleted file mode 100644
index fdb68bac..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.frag
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifdef GL_OES_standard_derivatives
-# extension GL_OES_standard_derivatives : enable
-#else
-# define use_fallback
-#endif
-
-varying highp vec2 sampleCoord;
-varying highp vec2 shadowSampleCoord;
-varying highp vec4 normalizedTextureBounds;
-
-#ifdef use_fallback
-varying highp vec2 alphas;
-#endif
-
-uniform sampler2D _qt_texture;
-uniform highp vec4 color;
-uniform highp vec4 shadowColor;
-
-void main()
-{
- highp float shadowDistance = texture2D(_qt_texture,
- clamp(shadowSampleCoord,
- normalizedTextureBounds.xy,
- normalizedTextureBounds.zw)).a;
-#ifdef use_fallback
- highp float shadowAlpha = smoothstep(alphas.x, alphas.y, shadowDistance);
-#else
- highp float shadowDistanceD = fwidth(shadowDistance);
- highp float shadowAlpha = smoothstep(0.5 - shadowDistanceD, 0.5, shadowDistance);
-#endif
-
- highp vec4 shadowPixel = color * shadowColor * shadowAlpha;
-
- highp float textDistance = texture2D(_qt_texture,
- clamp(sampleCoord,
- normalizedTextureBounds.xy,
- normalizedTextureBounds.zw)).a;
-#ifdef use_fallback
- highp float textAlpha = smoothstep(alphas.x, alphas.y, textDistance);
-#else
- highp float textDistanceD = fwidth(textDistance);
- highp float textAlpha = smoothstep(0.5 - textDistanceD, 0.5, textDistance);
-#endif
-
- highp vec4 textPixel = color * textAlpha;
- gl_FragColor = mix(shadowPixel, textPixel, textPixel.a);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.vert b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.vert
deleted file mode 100644
index 835d34dd..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow.vert
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifdef GL_OES_standard_derivatives
-# extension GL_OES_standard_derivatives : enable
-#else
-# define use_fallback
-#endif
-
-uniform highp mat4 mvp;
-uniform highp float fontScale;
-uniform int textureWidth;
-uniform int textureHeight;
-uniform highp vec2 shadowOffset;
-
-attribute highp vec3 vCoord;
-attribute highp vec2 tCoord;
-attribute highp vec4 textureBounds;
-
-varying highp vec2 sampleCoord;
-varying highp vec2 shadowSampleCoord;
-varying highp vec4 normalizedTextureBounds;
-
-#ifdef use_fallback
-varying highp vec2 alphas;
-
-highp float thresholdFunc(highp float scale)
-{
- highp float base = 0.5;
- highp float baseDev = 0.065;
- highp float devScaleMin = 0.15;
- highp float devScaleMax = 0.3;
- return base - ((clamp(scale, devScaleMin, devScaleMax) - devScaleMin)
- / (devScaleMax - devScaleMin) * -baseDev + baseDev);
-}
-
-highp float spreadFunc(highp float scale)
-{
- return 0.06 / scale;
-}
-
-highp vec2 alphaRange(highp float scale)
-{
- highp float base = thresholdFunc(scale);
- highp float range = spreadFunc(scale);
- highp float alphaMin = max(0.0, base - range);
- highp float alphaMax = min(base + range, 1.0);
- return vec2(alphaMin, alphaMax);
-}
-
-highp float determinantOfSubmatrix(highp mat4 m, int col0, int col1, int row0, int row1)
-{
- return m[col0][row0] * m[col1][row1] - m[col0][row1] * m[col1][row0];
-}
-
-highp float determinantOfSubmatrix(highp mat4 m, int col0, int col1, int col2,
- int row0, int row1, int row2)
-{
- highp float det = m[col0][row0] * determinantOfSubmatrix(m, col1, col2, row1, row2);
- det -= m[col1][row0] * determinantOfSubmatrix(m, col0, col2, row1, row2);
- det += m[col2][row0] * determinantOfSubmatrix(m, col0, col1, row1, row2);
- return det;
-}
-
-highp float determinant(highp mat4 m)
-{
- highp float det = m[0][0] * determinantOfSubmatrix(m, 1, 2, 3, 1, 2, 3);
- det -= m[1][0] * determinantOfSubmatrix(m, 0, 2, 3, 1, 2, 3);
- det += m[2][0] * determinantOfSubmatrix(m, 0, 1, 3, 1, 2, 3);
- det -= m[3][0] * determinantOfSubmatrix(m, 0, 1, 2, 1, 2, 3);
- return det;
-}
-#endif
-
-void main()
-{
-#ifdef use_fallback
- highp float scale = fontScale * pow(abs(determinant(mvp)), 1.0 / 3.0);
- alphas = alphaRange(scale);
-#endif
-
- highp vec2 textureSizeMultiplier = vec2(1.0 / highp float(textureWidth),
- 1.0 / float(textureHeight));
-
- sampleCoord = tCoord * textureSizeMultiplier;
- shadowSampleCoord = (tCoord - shadowOffset) * textureSizeMultiplier;
- normalizedTextureBounds = highp vec4(textureBounds.xy * textureSizeMultiplier,
- textureBounds.zw * textureSizeMultiplier);
-
- gl_Position = mvp * vec4(vCoord, 1.0);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.frag b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.frag
deleted file mode 100644
index 51aae5a7..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.frag
+++ /dev/null
@@ -1,30 +0,0 @@
-in vec2 sampleCoord;
-in vec2 shadowSampleCoord;
-in vec4 normalizedTextureBounds;
-
-out vec4 fragColor;
-
-uniform sampler2D _qt_texture;
-uniform vec4 color;
-uniform vec4 shadowColor;
-
-void main()
-{
- float shadowDistance = texture(_qt_texture,
- clamp(shadowSampleCoord,
- normalizedTextureBounds.xy,
- normalizedTextureBounds.zw)).r;
- float shadowDistanceD = fwidth(shadowDistance);
- float shadowAlpha = smoothstep(0.5 - shadowDistanceD, 0.5, shadowDistance);
- vec4 shadowPixel = color * shadowColor * shadowAlpha;
-
- float textDistance = texture(_qt_texture,
- clamp(sampleCoord,
- normalizedTextureBounds.xy,
- normalizedTextureBounds.zw)).r;
- float textDistanceD = fwidth(textDistance);
- float textAlpha = smoothstep(0.5 - textDistanceD, 0.5, textDistance);
- vec4 textPixel = color * textAlpha;
-
- fragColor = mix(shadowPixel, textPixel, textPixel.a);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.vert b/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.vert
deleted file mode 100644
index 7d9736e5..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/distancefieldtext_dropshadow_core.vert
+++ /dev/null
@@ -1,25 +0,0 @@
-in vec3 vCoord;
-in vec2 tCoord;
-in vec4 textureBounds;
-
-out vec2 sampleCoord;
-out vec2 shadowSampleCoord;
-
-out vec4 normalizedTextureBounds;
-
-uniform mat4 mvp;
-uniform int textureWidth;
-uniform int textureHeight;
-uniform float fontScale;
-uniform vec2 shadowOffset;
-
-void main()
-{
- vec2 textureSizeMultiplier = vec2(1.0 / float(textureWidth), 1.0 / float(textureHeight));
-
- sampleCoord = tCoord * textureSizeMultiplier;
- shadowSampleCoord = (tCoord - shadowOffset) * textureSizeMultiplier;
- normalizedTextureBounds = vec4(textureBounds.xy * textureSizeMultiplier,
- textureBounds.zw * textureSizeMultiplier);
- gl_Position = mvp * vec4(vCoord, 1.0);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/effect.glsllib b/src/Runtime/ogl-runtime/res/effectlib/effect.glsllib
deleted file mode 100644
index 802a8460..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/effect.glsllib
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef EFFECT_GLSLLIB
-#define EFFECT_GLSLLIB 1
-
-//Defines used in the effect files.
-
-vec4 GetTextureValue( sampler2D sampler, vec2 inUVCoords, float inTextureAlphaInfo )
-{
- vec4 c = texture2D(sampler, inUVCoords);
- c.rgb = mix( c.rgb*c.a, c.rgb, inTextureAlphaInfo );
- return c;
-}
-
-vec4 GetTextureValuePreMult( sampler2D sampler, vec2 inUVCoords )
-{
- return texture2D(sampler, inUVCoords);
-}
-
-#define SNAPPER_TITLE( title )
-
-#define SNAPPER_PARAMETER(propName, datatype, rangeMin, rangeMax, propNiceName, defaultValue) datatype propName
-
-#define SNAPPER_ANGLE( propName, propNiceName, defaultValueAsFloat ) uniform float propName;
-#define SNAPPER_CHECKBOX(propName, propNiceName, defaultValue) uniform float propName;
-
-#define SNAPPER_ENUM_BEGIN(propName, propNiceName, defaultValueAsIndex) uniform int propName;
-#define SNAPPER_ENUM_VALUE(valueNiceName)
-#define SNAPPER_ENUM_END()
-
-#define SNAPPER_POINT2(propName, propNiceName, defaultValue) uniform vec2 propName;
-#define SNAPPER_COLOR(propName, propNiceName, defaultValue) uniform vec3 propName;
-
-
-#define TEXTURE_LOOKUP_FUNC(name) \
-
-
-//texType = one of: ubyte, ushort, float
-//texFormat = one of: rgb, rgba, lum, lum_alpha
-//texFilter = one of: nearest, linear
-//texWrap = one of: repeat, clamp
-#define SNAPPER_EXTERNAL_PARAMETER(propName, datatype, rangeMin, rangeMax, propNiceName, defaultValue)
-#define SNAPPER_EXTERNAL_ANGLE(propName, propNiceName, defaultValueAsFloat)
-
-// Provide the ability to render outside a effect boundary.
-// Total size = The original effect size * Overrendering value
-// Overrendering value needs to be >= 1.0
-#define SNAPPER_OVERRENDERING(value) const float OverrenderingValue = value;
-
-
-
-#ifdef VERTEX_SHADER
-// Attributes and uniforms used throughout the system.
-attribute vec3 attr_pos;
-attribute vec2 attr_uv;
-#endif
-
-uniform mat4 ModelViewProjectionMatrix;
-//x holds the texture width, y holds the texture height
-//z holds 0,1 value if it should be premultiplied
-uniform vec4 Texture0Info;
-uniform vec2 DestSize; //size of the destination in pixels including overrendering if specified.
-uniform sampler2D Texture0;
-varying vec2 TexCoord;
-uniform vec2 FragColorAlphaSettings; //x > 0.0 premultiply result, y is an alpha multiplier (opacity setting)
-
-vec4 Transform( mat4 ModelViewProjectionMatrix, vec2 inDestSize, vec4 inVertex )
-{
- vec4 temp = ModelViewProjectionMatrix * vec4( inDestSize.x * .5 * inVertex.x, inDestSize.y * .5 * inVertex.y, inVertex.z, inVertex.w );
- return temp;
-}
-////////////////////////////////////////////////////////////
-// provide the texture lookup functions for the default
-// texture (Texture0).
-vec4 texture2D_0(vec2 uv)
-{
- return GetTextureValue( Texture0, uv, Texture0Info.z );
-}
-
-#ifdef FRAGMENT_SHADER
-////////////////////////////////////////////////////////////
-// the functions to set the final frag result.
-void colorOutput(vec4 c)
-{
- c *= FragColorAlphaSettings.x;
- gl_FragColor = clamp(c, 0.0, c.a );
-}
-
-#endif
-
-
-
-////////////////////////////////////////////////////////////
-// define the main functions.
-
-#ifdef VERTEX_SHADER
-#ifndef NO_VERT_MAIN
-
-void vert();
-void main()
-{
- gl_Position = Transform( ModelViewProjectionMatrix, DestSize, vec4(attr_pos, 1.0) );
- TexCoord = attr_uv;
- vert();
-}
-
-#endif
-#endif
-
-#ifdef FRAGMENT_SHADER
-#ifndef NO_FRAG_MAIN
-void frag();
-void main()
-{
- frag();
-}
-#endif // NO_FRAG_MAIN
-#endif // FRAGMENT_SHADER
-
-#endif // EFFECT_GLSLLIB
diff --git a/src/Runtime/ogl-runtime/res/effectlib/evalBakedShadowMap.glsllib b/src/Runtime/ogl-runtime/res/effectlib/evalBakedShadowMap.glsllib
deleted file mode 100644
index a283d8a8..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/evalBakedShadowMap.glsllib
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 evalBakedShadowMap( in vec3 inCoords )
-{
- vec4 shadowCol = (uShadowMappingEnabled) ? texture( uBakedShadowTexture, inCoords.xy ) : vec4( 1.0, 1.0, 1.0, 1.0 );
-
- return shadowCol;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/evalEnvironmentMap.glsllib b/src/Runtime/ogl-runtime/res/effectlib/evalEnvironmentMap.glsllib
deleted file mode 100644
index 18431c70..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/evalEnvironmentMap.glsllib
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec3 evalEnvironmentMap( in vec3 R, float roughness )
-{
- // convert R to spherical texture coordinates
- vec2 tc = vec2( ( atan( R.x, -R.z ) + PI ) / ( PI_TWO ), acos( -R.y ) / PI );
-
- vec2 envMapSize = vec2( textureSize( uEnvironmentTexture, 0 ) );
- float envMapLevels = log2( max( envMapSize.x, envMapSize.y ) );
-
- // simulate textureQueryLod
- vec2 dx = dFdx( tc * envMapSize.x );
- vec2 dy = dFdy( tc * envMapSize.y );
-
- float px = dot( dx, dx );
- float py = dot( dy, dy );
-
- float maxlod = 0.5 * log2( max( px, py ) ); // log2(sqrt()) = 0.5*log2()
- float minlod = 0.5 * log2( min( px, py ) );
-
- //float lod = max(0.0, maxlod - min( maxlod - minlod, envMapLevels ));
- float lod = max(0.0, min( minlod, envMapLevels ));
-
- float roughLevel = mix( lod , envMapLevels, roughness );
-
- return( textureLod( uEnvironmentTexture, tc, roughLevel ).rgb );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/evalLightmaps.glsllib b/src/Runtime/ogl-runtime/res/effectlib/evalLightmaps.glsllib
deleted file mode 100644
index 1a9bc997..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/evalLightmaps.glsllib
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 evalLightmap( in sampler2D sampler, in vec3 inCoords, in vec4 rotScale, in vec3 offset )
-{
- vec3 uTransform = vec3(rotScale.x, rotScale.y, offset.x);
- vec3 vTransform = vec3(rotScale.z, rotScale.w, offset.y);
-
- vec2 transfCoord = vec2( dot( uTransform, inCoords ), dot( vTransform, inCoords ) );
-
- vec4 value = texture( sampler, transfCoord.xy);
-
- return value;
-}
-
-vec4 evalIndirectLightmap( in sampler2D sampler, in vec3 inCoords, in vec4 rotScale, in vec3 offset )
-{
- return evalLightmap( sampler, inCoords, rotScale, offset );
-}
-
-vec4 evalRadiosityLightmap( in sampler2D sampler, in vec3 inCoords, in vec4 rotScale, in vec3 offset )
-{
- return evalLightmap( sampler, inCoords, rotScale, offset );
-}
-
-vec4 evalShadowLightmap( in sampler2D sampler, in vec3 inCoords, in vec4 rotScale, in vec3 offset )
-{
- return evalLightmap( sampler, inCoords, rotScale, offset );
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/fileBumpTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/fileBumpTexture.glsllib
deleted file mode 100644
index d0129a81..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/fileBumpTexture.glsllib
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FILE_BUMP_TEXTURE_GLSLLIB
-#define FILE_BUMP_TEXTURE_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-
-#include "luminance.glsllib"
-#include "monoChannel.glsllib"
-#include "textureCoordinateInfo.glsllib"
-#define wrap_clamp 0
-#define wrap_repeat 1
-#define wrap_mirrored_repeat 2
-#include "rotationTranslationScale.glsllib"
-#include "transformCoordinate.glsllib"
-
-#endif
-
-// compute a normal based on a heightfield style bump texture
-// example call:
-// fileBumpTexture(bump_texture, bump_amount, mono_average
-// , transformCoordinate(
-// rotationTranslationScale(
-// vec3( 0.000000, 0.000000, 0.000000 )
-// , vec3( 0.000000, 0.000000, 0.000000 )
-// , vec3( texture_tiling[0], texture_tiling[1], 1.000000 ) )
-// , textureCoordinateInfo( texCoord0, tangent, binormal ) )
-// , vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 )
-// , wrap_repeat, wrap_repeat, normal );
-
-
-
-vec3 fileBumpTexture( in sampler2D sampler, in float factor, in int bumpSource
- , in texture_coordinate_info uvw
- , in vec2 cropU, in vec2 cropV
- , in int wrapU, in int wrapV, in vec3 normal )
-{
- vec2 bumpMapSize = vec2( textureSize( sampler, 0 ) );
- float bumpMapLevels = log2( max( bumpMapSize.x, bumpMapSize.y ) );
- // simulate textureQueryLod
- vec2 dx = dFdx( uvw.position.xy * bumpMapSize.x );
- vec2 dy = dFdy( uvw.position.xy * bumpMapSize.y );
-
- float px = dot( dx, dx );
- float py = dot( dy, dy );
-
- float maxlod = 0.5 * log2( max( px, py ) ); // log2(sqrt()) = 0.5*log2()
- float minlod = 0.5 * log2( min( px, py ) );
-
- float lod = max(0.0, min( maxlod, bumpMapLevels ));
-
- // invert factor
- float invFactor = -factor;
-
- // currently no lod supported we use 3.3 GL
- //float lod = textureQueryLod( sampler, uvw.position.xy ).x;
- vec2 size = mix( vec2( textureSize( sampler, int( floor( lod ) ) ) ), vec2( textureSize( sampler, int( ceil( lod ) ) ) ), fract( lod ) );
- vec2 unitStep = 1.0 / size;
-
- // Add an inveres scale to keep the original gradient values
- // this makes the bumps a lot smoother.
- // Or we could do it like in iRay and sample always at original size.
- // But this makes me feel better.
- vec2 scale = size / bumpMapSize;
-
- float du = monoChannel( textureLod( sampler, vec2( uvw.position.x + unitStep.x, uvw.position.y ), lod ), bumpSource )
- - monoChannel( textureLod( sampler, vec2( uvw.position.x, uvw.position.y ), lod ), bumpSource );
- float dv = monoChannel( textureLod( sampler, vec2( uvw.position.x, uvw.position.y + unitStep.y ), lod ), bumpSource )
- - monoChannel( textureLod( sampler, vec2( uvw.position.x, uvw.position.y ), lod ), bumpSource );
-
-
- vec3 n = normalize(vec3(invFactor * scale.x * du, invFactor * scale.x * dv, 1.0));
- n = n.x*uvw.tangent_u + n.y*uvw.tangent_v + n.z*normal;
- return normalize(normal + n);
-}
-
-#include "textureCoordinateInfo.glsllib"
-
-//Simpler version built to run from UIC image data
-//In our case, we have already generated the texture coordinate x,y position
-//TODO - figure out if we need to manipulate tangent_u, tangent_v.
-vec3 simplerFileBumpTexture( in sampler2D sampler, in float factor, vec2 texCoord, vec3 tangent, vec3 binormal, vec3 normal )
-{
- return fileBumpTexture( sampler, factor, mono_average
- , textureCoordinateInfo( vec3( texCoord.x, texCoord.y, 0.0 ), tangent, binormal )
- , vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 )
- , wrap_repeat, wrap_repeat, normal );
-}
-
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/fileDisplacementTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/fileDisplacementTexture.glsllib
deleted file mode 100644
index a38d701d..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/fileDisplacementTexture.glsllib
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-#define FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-
-#include "luminance.glsllib"
-#include "monoChannel.glsllib"
-#include "textureCoordinateInfo.glsllib"
-#define wrap_clamp 0
-#define wrap_repeat 1
-#define wrap_mirrored_repeat 2
-#define mono_alpha 0
-#define mono_average 1
-#define mono_luminance 2
-#define mono_maximum 3
-#include "rotationTranslationScale.glsllib"
-#include "transformCoordinate.glsllib"
-
-#endif
-
-
-vec3 fileDisplacementTexture( in sampler2D sampler, in float factor, in int displaceSource
- , in texture_coordinate_info uvw, in vec3 normal, in vec3 pos )
-{
- // compute displace factor
- float df = monoChannel( texture( sampler, uvw.position.xy ), displaceSource );
-
- return( normal * df * factor + pos );
-}
-
-
-//default material path version
-vec3 defaultMaterialFileDisplacementTexture( in sampler2D sampler, in float factor, vec2 texCoord, in vec3 normal, vec3 pos )
-{
- return fileDisplacementTexture( sampler, factor, mono_luminance
- , textureCoordinateInfo( vec3( texCoord.x, texCoord.y, 0.0 ), vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0) )
- , normal, pos );
-}
-
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/fileTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/fileTexture.glsllib
deleted file mode 100644
index 6b9f6ab8..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/fileTexture.glsllib
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-texture_return fileTexture( in sampler2D sampler, in vec3 colorOffset, in vec3 colorScale, in int monoSource, in texture_coordinate_info uvw
- , in vec2 cropU, in vec2 cropV, in int wrapU, in int wrapV, in int gammaMode )
-{
- vec4 t4 = texture( sampler, uvw.position.xy );
- vec3 t3 = colorOffset + colorScale * t4.xyz;
-
- // When we want to operate in linear color space uncomment the lines
- if ( gammaMode == gamma_srgb )
- {
- t3 = pow( t3, vec3( 2.2 ) );
- }
-
- texture_return tr;
- tr.tint = t3;
- tr.mono = monoChannel( vec4( t3, t4.w ), monoSource );
- return( tr );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/flakeNoiseBumpTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/flakeNoiseBumpTexture.glsllib
deleted file mode 100644
index e8e427ce..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/flakeNoiseBumpTexture.glsllib
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec3 flakeNoiseBumpTexture( in texture_coordinate_info uvw, in float scale, in float strength, in vec3 normal )
-{
- vec3 tex = uvw.position / scale;
- vec3 grad = miNoise( tex ).xyz;
-
- // displace coordinate according to noise value
- tex += 2.0 * grad;
-
- // then use only integer coordinates, to make flakes transients harder and not wobbly
- grad = miNoise( round( tex ) ).xyz;
-
- vec3 n = normalize(vec3(strength * grad.x, strength * grad.y, 1.0));
- n = n.x*uvw.tangent_u + n.y*uvw.tangent_v + n.z*normal;
- return normalize(normal + n);
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/flakeNoiseTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/flakeNoiseTexture.glsllib
deleted file mode 100644
index 92f15d30..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/flakeNoiseTexture.glsllib
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-texture_return flakeNoiseTexture( in texture_coordinate_info uvw, in float intensity, in float scale, in float density )
-{
- vec3 tex = uvw.position / scale;
- vec3 grad = miNoise( tex ).xyz;
-
- // displace coordinate according to noise value
- tex += 2.0 * grad;
-
- // then use only integer coordinates, to make flakes transients harder and not wobbly
- vec4 noise = miNoise( floor( tex ) );
- float s = pow( noise.w, 1.0 / density ) * intensity;
-
- texture_return tr;
- tr.tint = vec3( noise.x, noise.y, noise.z );
- tr.mono = clamp(s, 0.0, 1.0);
- return( tr );
-}
-
-
-texture_return flakeNoiseAndBumpTexture( in texture_coordinate_info uvw, in float scale, in float intensity, in float density, float strength, in vec3 normal )
-{
- vec3 tex = uvw.position / scale;
- vec3 grad = miNoise( tex ).xyz;
-
- // displace coordinate according to noise value
- tex += 2.0 * grad;
-
- // then use only integer coordinates, to make flakes transients harder and not wobbly
- vec4 noise = miNoise( round( tex ) );
- float s = pow( noise.w, 1.0 / density ) * intensity;
-
- texture_return tr;
- tr.tint = normalize( normal/strength + ( uvw.tangent_u * grad.x + uvw.tangent_v * grad.y + normal * abs( grad.z ) ) );
- tr.mono = s;
- return( tr );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/fresnelLayer.glsllib b/src/Runtime/ogl-runtime/res/effectlib/fresnelLayer.glsllib
deleted file mode 100644
index 60d71764..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/fresnelLayer.glsllib
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-float simpleFresnel( in vec3 N, in float ior, float fresnelPower )
-{
- float F = ((1.0-ior) * (1.0-ior)) / ((1.0+ior) * (1.0+ior));
- float fresnelGlancingAngle = clamp( 1.0 - dot(viewDir, N), 0.0, 1.0 );
- float ratio = F + (1.0 - F) * pow(fresnelGlancingAngle, fresnelPower);
-
- return ratio;
-}
-
-// PKC : A variation on the simple Schlick approach that also handles the characteristic
-// "dip" that metals exhibit. The dip is very mild or virtually nonexisting in dielectrics,
-// but shows up in metals because of their strong incident reflectivity, and also allows for
-// colored metals like gold or copper to show their Fresnel hue shift as well because certain
-// components will have different baseline responses.
-vec3 pseudoFresnel( in vec3 N, in vec3 ior, float fresnelPower )
-{
- vec3 F0 = ((vec3(1.0)-ior) * (vec3(1.0)-ior)) / ((vec3(1.0)+ior) * (vec3(1.0)+ior));
-
- float fresnelGlancingAngle = clamp( 1.0 - dot(viewDir, N), 0.0, 1.0 );
-
- float fresCurve = pow(fresnelGlancingAngle, fresnelPower);
- vec3 dipCurve = F0 * sin( 3.1415926535 * fresCurve ) * 0.31830988618;
-
- vec3 retCol = (vec3(1.0) - F0) * fresCurve;
- retCol += F0 - dipCurve;
- return clamp(retCol, 0.0, 1.0);
-}
-
-// look here: http://en.wikipedia.org/wiki/Fresnel_equations
-float fresnel( in float eta1, in float eta2, in float cosTheta1 )
-{
- float etaInv = eta1 / eta2;
- float cosTheta2 = 1.0 - ( 1.0 - cosTheta1 * cosTheta1 ) * ( etaInv * etaInv );
- if ( 0.0 <= cosTheta2 )
- {
- cosTheta2 = sqrt( cosTheta2 );
- float n1t1 = eta1 * cosTheta1;
- float n1t2 = eta1 * cosTheta2;
- float n2t1 = eta2 * cosTheta1;
- float n2t2 = eta2 * cosTheta2;
- float rs = ( n1t1 - n2t2 ) / ( n1t1 + n2t2 );
- float rp = ( n1t2 - n2t1 ) / ( n1t2 + n2t1 );
- float f = 0.5 * ( rs * rs + rp * rp );
- return( clamp( f, 0.0, 1.0 ) );
- }
- else
- {
- return( 1.0 );
- }
-}
-
-// we assume, light rays run through air with ior == 1.0
-// with eta = eta2 / eta1, we have
-// - when hitting a front face: eta2 == ior, eta1 == 1.0 => eta = ior
-// - when hitting a back face : eta2 == 1.0, eta1 == ior => eta = 1.0 / ior
-vec3 fresnel( in vec3 N, in vec3 ior )
-{
- float cosTheta1 = dot( N, viewDir );
- if ( gl_FrontFacing )
- {
- return( vec3( fresnel( 1.0, ior[0], cosTheta1 ), fresnel( 1.0, ior[1], cosTheta1 ), fresnel( 1.0, ior[2], cosTheta1 ) ) );
- }
- else
- {
- return( vec3( fresnel( ior[0], 1.0, cosTheta1 ), fresnel( ior[1], 1.0, cosTheta1 ), fresnel( ior[2], 1.0, cosTheta1 ) ) );
- }
-}
-
-vec4 fresnelLayer( in vec3 N, in vec3 ior, in float weight, in vec3 layercolor, in vec4 layer, in vec4 base, in float alpha )
-{
- vec3 refl = reflect( -viewDir, N );
- float reflWt = clamp( dot( surfNormal, refl ) + 1.0, 0.0, 1.0 );
-
- vec3 fresColor = reflWt * weight * layercolor * pseudoFresnel( N, ior, 5.0 );
-
- return( vec4( mix( base.rgb, layer.rgb, fresColor ), mix(alpha, 1.0, luminance(fresColor)) ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcareaLightVars.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcareaLightVars.glsllib
deleted file mode 100644
index 7505b348..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcareaLightVars.glsllib
+++ /dev/null
@@ -1,32 +0,0 @@
-#define MAX_AREA_LIGHTS 16
-
-// note this struct must exactly match the memory layout of the
-// struct SLightSourceShader in the source code. If you make changes here you need
-// to adjust the struct SLightSourceShader as well
-struct AreaLight
-{
- vec4 position;
- vec4 direction; // Specifies the light direction in world coordinates.
- vec4 up;
- vec4 right;
- vec4 diffuse;
- vec4 ambient;
- vec4 specular;
- float spotExponent; // Specifies the intensity distribution of the light.
- float spotCutoff; // Specifies the maximum spread angle of the light.
- float constantAttenuation; // Specifies the constant light attenuation factor.
- float linearAttenuation; // Specifies the linear light attenuation factor.
- float quadraticAttenuation; // Specifies the quadratic light attenuation factor.
- float range; // Specifies the maximum distance of the light influence
- float width; // Specifies the width of the area light surface.
- float height; // Specifies the height of the area light surface;
- vec4 shadowControls;
- mat4 shadowView;
- int shadowIdx;
-};
-
-layout (std140) uniform cbBufferAreaLights
-{
- int uNumAreaLights;
- AreaLight arealights[MAX_AREA_LIGHTS];
-};
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funccalculateDiffuseAreaOld.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funccalculateDiffuseAreaOld.glsllib
deleted file mode 100644
index fc37390c..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funccalculateDiffuseAreaOld.glsllib
+++ /dev/null
@@ -1,29 +0,0 @@
-float calculateDiffuseAreaOld(in vec3 lightDir, in vec3 lightPos, in vec4 lightUp,
- in vec4 lightRt, in vec3 worldPos, out vec3 outDir)
-{
- if ( dot( worldPos-lightPos, lightDir) < 0.0 )
- return 0.0;
-
- vec3 v0 = lightPos - (lightRt.xyz * lightRt.w * 0.5) - (lightUp.xyz * lightUp.w * 0.5);
- vec3 v1 = lightPos - (lightRt.xyz * lightRt.w * 0.5) + (lightUp.xyz * lightUp.w * 0.5);
- vec3 v2 = lightPos + (lightRt.xyz * lightRt.w * 0.5) + (lightUp.xyz * lightUp.w * 0.5);
- vec3 v3 = lightPos + (lightRt.xyz * lightRt.w * 0.5) - (lightUp.xyz * lightUp.w * 0.5);
- v0 = normalize( v0 - worldPos ); v1 = normalize( v1 - worldPos );
- v2 = normalize( v2 - worldPos ); v3 = normalize( v3 - worldPos );
-
- float a01 = acos( clamp( dot(v0, v1), -1.0, 1.0 ) );
- float a12 = acos( clamp( dot(v1, v2), -1.0, 1.0 ) );
- float a23 = acos( clamp( dot(v2, v3), -1.0, 1.0 ) );
- float a30 = acos( clamp( dot(v3, v0), -1.0, 1.0 ) );
-
- outDir = vec3( 0.0 );
- outDir -= normalize(cross( v0, v1 )) * a01;
- outDir -= normalize(cross( v1, v2 )) * a12;
- outDir -= normalize(cross( v2, v3 )) * a23;
- outDir -= normalize(cross( v3, v0 )) * a30;
-
- float retVal = length(outDir) * 0.15915494309; // solid angle / 2*pi
- outDir = normalize(outDir);
- retVal *= clamp( dot( worldPos-lightPos, lightDir), 0.0, 1.0 );
- return retVal;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib
deleted file mode 100644
index 5f421622..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib
+++ /dev/null
@@ -1,4 +0,0 @@
-float calculatePointLightAttenuation(vec3 attenuationConstants, float lightDistance ) {
- return 1.0 / (attenuationConstants.x + attenuationConstants.y * lightDistance
- + attenuationConstants.z * lightDistance * lightDistance);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funccomputeMicroHit.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funccomputeMicroHit.glsllib
deleted file mode 100644
index 7c526916..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funccomputeMicroHit.glsllib
+++ /dev/null
@@ -1,50 +0,0 @@
-bool rayToLightUV( in vec3 pos, in mat3 lightFrame, in vec3 lightPos, in float width, in float height, in vec3 rayDir, out vec2 uv )
-{
- float d0 = dot( lightPos, lightFrame[2] );
- float d1 = dot( pos, lightFrame[2] );
- float fac = dot( rayDir, lightFrame[2] );
-
- if ((d0 < d1) || ( fac < 0.001 ))
- {
- uv = vec2(-1.0);
- return false;
- }
-
- float t = (d0 - d1) / fac;
- vec3 hitPos = pos + t * rayDir;
- width *= dot(lightFrame[0], lightFrame[0]);
- height *= dot(lightFrame[1], lightFrame[1]);
-
- hitPos -= lightPos;
- uv.x = ( dot(hitPos, lightFrame[0]) / width ) + 0.5;
- uv.y = ( dot(hitPos, lightFrame[1]) / height ) + 0.5;
- return true;
-}
-
-float computeMicroHit( in vec3 pos, in mat3 tanFrame, in vec3 lightPos, in mat3 lightFrame, in float width, in float height, in vec3 viewDir, out vec2 UV[5] )
-{
- vec3 rayDir = reflect( -viewDir, tanFrame[2] );
- vec2 ctrUV;
- bool isHit = rayToLightUV( pos, lightFrame, lightPos, width, height, rayDir, ctrUV );
- if ((!isHit) || ( dot(rayDir, tanFrame[2]) < 0.001 )) { return 0.0; }
-
- vec3 H0 = 0.99749686716 * tanFrame[2] + 0.005 * tanFrame[0];
- vec3 H1 = 0.99749686716 * tanFrame[2] - 0.005 * tanFrame[0];
- vec3 H2 = 0.99749686716 * tanFrame[2] + 0.005 * tanFrame[1];
- vec3 H3 = 0.99749686716 * tanFrame[2] - 0.005 * tanFrame[1];
-
- vec3 R[4];
- R[0] = reflect( -viewDir, H0 );
- R[1] = reflect( -viewDir, H1 );
- R[2] = reflect( -viewDir, H2 );
- R[3] = reflect( -viewDir, H3 );
-
- rayToLightUV( pos, lightFrame, lightPos, width, height, R[0], UV[0] );
- rayToLightUV( pos, lightFrame, lightPos, width, height, R[1], UV[1] );
- rayToLightUV( pos, lightFrame, lightPos, width, height, R[2], UV[2] );
- rayToLightUV( pos, lightFrame, lightPos, width, height, R[3], UV[3] );
-
- UV[4] = ctrUV;
-
- return clamp( dot(rayDir, tanFrame[2]), 0.0, 1.0 );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionBSDF.glsllib
deleted file mode 100644
index bda0ea60..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionBSDF.glsllib
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef PI
-#define PI 3.14159265358979
-#define PI_SQUARE ( PI * PI )
-#endif
-
-vec4 diffuseReflectionBSDF(in vec3 N, in vec3 L, in vec3 viewDir,
- in vec3 lightDiffuse, in float roughness)
-{
- float cosThetaI = max( 0.0, dot( N, L ) );
- float factor = cosThetaI;
- if ( ( 0.0 < factor ) && ( 0.0 < roughness ) )
- {
- // see http://en.wikipedia.org/wiki/Oren%E2%80%93Nayar_reflectance_model
- float sigmaSquare = 0.25 * PI_SQUARE * roughness * roughness;
- float A = 1.0 - 0.5 * sigmaSquare / ( sigmaSquare + 0.33 );
- float B = 0.45 * sigmaSquare / ( sigmaSquare + 0.09 );
-
- // project L and viewDir on surface to get the azimuthal angle between them
- // as we don't really need the projections, but the angle between them,
- // it's enough to just use the cross instead
- vec3 pl = normalize( cross( L, N ) );
- vec3 pv = normalize( cross( viewDir, N ) );
- float cosPhi = max( 0.0, dot( pl, pv ) );
-
- float sinAlpha, tanBeta;
- float cosThetaO = max( 0.0, dot( N, viewDir ) );
- float sinThetaI = sqrt( max( 0.0, 1.0 - cosThetaI * cosThetaI ) );
- float sinThetaO = sqrt( max( 0.0, 1.0 - cosThetaO * cosThetaO ) );
- if ( cosThetaI < cosThetaO )
- { // -> thetaO < thetaI
- sinAlpha = sinThetaI;
- tanBeta = sinThetaO / cosThetaO;
- }
- else
- {
- sinAlpha = sinThetaO;
- tanBeta = sinThetaI / cosThetaI;
- }
-
- factor *= A + B * cosPhi * sinAlpha * tanBeta;
- }
- return( vec4( factor * lightDiffuse, 1.0 ) );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib
deleted file mode 100644
index 9afc58b4..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib
+++ /dev/null
@@ -1,5 +0,0 @@
-vec4 diffuseReflectionWrapBSDF(vec3 normalDir, in vec3 L, in vec3 lightDiffuse, float wrap)
-{
- float I = max( 0.0, ((dot(L, normalDir) + wrap)/ (1.0 + wrap)) ); //diffuseIntensity
- return vec4( I * lightDiffuse, 1.0 );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcgetTransformedUVCoords.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcgetTransformedUVCoords.glsllib
deleted file mode 100644
index 9b14a284..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcgetTransformedUVCoords.glsllib
+++ /dev/null
@@ -1,4 +0,0 @@
-vec2 getTransformedUVCoords( vec3 inCoords, vec3 inUTransform, vec3 inVTransform )
-{
- return vec2( dot( inUTransform, inCoords ), dot( inVTransform, inCoords ) );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcsampleAreaGlossyDefault.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcsampleAreaGlossyDefault.glsllib
deleted file mode 100644
index cb9cba11..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcsampleAreaGlossyDefault.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "funccomputeMicroHit.glsllib"
-
-vec3 sampleAreaGlossyDefault( in mat3 tanFrame, in vec3 pos, in mat3 lightFrame, in vec3 lightPos, in float width, in float height, in vec3 viewDir, in float roughU, in float roughV )
-{
- float sigmaU = clamp( 0.5 * roughU, 0.005, 0.5 );
- float sigmaV = clamp( 0.5 * roughV, 0.005, 0.5 );
- vec2 UVset[5];
-
- float thetaI = acos( dot(viewDir, lightFrame[2]) );
- vec2 minMaxThetaH = vec2( (thetaI - 1.5707) * 0.5,
- (thetaI + 1.5707) * 0.5 );
- vec4 sinCosThetaH = vec4( abs(sin(minMaxThetaH)), abs(cos(minMaxThetaH)) );
-
- // First thing we do is compute a small-scale version of the ray hit for a very tiny roughness
- // then we scale that up based on the _actual_ roughness.
- float wt = computeMicroHit( pos, tanFrame, lightPos, lightFrame, width, height, viewDir, UVset );
-
- UVset[0] -= UVset[4]; UVset[1] -= UVset[4];
- UVset[2] -= UVset[4]; UVset[3] -= UVset[4];
-
- UVset[0] *= mix(1.0, sinCosThetaH.y / 0.005, sigmaU); UVset[1] *= mix(1.0, sinCosThetaH.x / 0.005, sigmaU);
- UVset[2] *= mix(1.0, sinCosThetaH.y / 0.005, sigmaV); UVset[3] *= mix(1.0, sinCosThetaH.x / 0.005, sigmaV);
-
- UVset[0] += UVset[4]; UVset[1] += UVset[4];
- UVset[2] += UVset[4]; UVset[3] += UVset[4];
-
- vec2 UVmin = UVset[4], UVmax = UVset[4];
- vec2 cminUV, cmaxUV;
- UVmin = min(UVmin, UVset[0]); UVmax = max(UVmax, UVset[0]);
- UVmin = min(UVmin, UVset[1]); UVmax = max(UVmax, UVset[1]);
- UVmin = min(UVmin, UVset[2]); UVmax = max(UVmax, UVset[2]);
- UVmin = min(UVmin, UVset[3]); UVmax = max(UVmax, UVset[3]);
-
- cminUV = clamp( UVmin, vec2(0.0), vec2(1.0) );
- cmaxUV = clamp( UVmax, vec2(0.0), vec2(1.0) );
-
- vec2 hitScale = (cmaxUV - cminUV);
- vec2 fullScale = (UVmax - UVmin);
- float intensity = ( hitScale.x * hitScale.y ) / max( fullScale.x * fullScale.y, 0.0001 );
-
- return vec3( wt * intensity );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcsampleLightVars.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcsampleLightVars.glsllib
deleted file mode 100644
index 85ca1448..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcsampleLightVars.glsllib
+++ /dev/null
@@ -1,29 +0,0 @@
-#define MAX_NUM_LIGHTS 16
-
-struct LightSource
-{
- vec4 position;
- vec4 direction; // Specifies the light direction in world coordinates.
- vec4 up;
- vec4 right;
- vec4 diffuse;
- vec4 ambient;
- vec4 specular;
- float spotExponent; // Specifies the intensity distribution of the light.
- float spotCutoff; // Specifies the maximum spread angle of the light.
- float constantAttenuation; // Specifies the constant light attenuation factor.
- float linearAttenuation; // Specifies the linear light attenuation factor.
- float quadraticAttenuation; // Specifies the quadratic light attenuation factor.
- float range; // Specifies the maximum distance of the light influence
- float width; // Specifies the width of the area light surface.
- float height; // Specifies the height of the area light surface;
- vec4 shadowControls;
- mat4 shadowView;
- int shadowIdx;
-};
-
-layout (std140) uniform cbBufferLights
-{
- int uNumLights;
- LightSource lights[MAX_NUM_LIGHTS];
-};
diff --git a/src/Runtime/ogl-runtime/res/effectlib/funcspecularBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/funcspecularBSDF.glsllib
deleted file mode 100644
index e9450bfe..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/funcspecularBSDF.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "luminance.glsllib"
-
-#ifndef scatter_reflect
-#define scatter_reflect 0
-#define scatter_transmit 1
-#define scatter_reflect_transmit 2
-#endif
-
-vec4 specularBSDF(in vec3 N, in vec3 L, in vec3 viewDir, in vec3 lightSpecular,
- in float ior, in float shininess, in vec3 tint, int mode)
-{
- vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
- float cosTheta = dot( N, L );
- if ( 0.0 < cosTheta )
- {
- if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
- {
- vec3 R = reflect( -L, N );
- float cosAlpha = max( 0.0, dot( R, viewDir ) );
- float shine = pow( cosAlpha, shininess );
- rgba.rgb = shine * lightSpecular;
- }
- }
- if ( ( mode == scatter_transmit ) || ( mode == scatter_reflect_transmit ) )
- {
- // check against total reflection
- vec3 R = refract( -viewDir, N, ior );
- if ( R == vec3( 0.0, 0.0, 0.0 ) )
- {
- rgba.a = 1.0;
- }
- else if ( mode == scatter_transmit )
- {
- rgba.a = 0.0;
- }
- else
- {
- rgba.a = 1.0 - luminance( tint );
- }
- }
- return( rgba );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/SSAOCustomMaterial.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/SSAOCustomMaterial.glsllib
deleted file mode 100644
index ea8d1642..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/SSAOCustomMaterial.glsllib
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB
-#define SSAO_CUSTOM_MATERIAL_GLSLLIB
-
-#ifndef QT3DS_ENABLE_SSAO
-#define QT3DS_ENABLE_SSAO 0
-#endif
-
-#ifndef QT3DS_ENABLE_SSDO
-#define QT3DS_ENABLE_SSDO 0
-#endif
-
-#if QT3DS_ENABLE_SSAO || QT3DS_ENABLE_SSDO
-
-#include "viewProperties.glsllib"
-#if QT3DS_ENABLE_SSDO
-#include "screenSpaceDO.glsllib"
-
-
-uniform vec4 ao_properties;
-uniform vec4 ao_properties2;
-uniform vec4 shadow_properties;
-uniform vec4 aoScreenConst;
-uniform vec4 UvToEyeConst;
-
-
-uniform sampler2D depth_sampler;
-#endif
-uniform sampler2D ao_sampler;
-uniform vec2 ao_sampler_size;
-
-#endif // QT3DS_ENABLE_SSAO || QT3DS_ENABLE_SSDO
-
-#if QT3DS_ENABLE_SSAO
-
-float customMaterialAO()
-{
-#if QT3DS_ENABLE_SSDO
- vec2 smpUV = (gl_FragCoord.xy) * aoScreenConst.zw;
-#else
- vec2 smpUV = gl_FragCoord.xy / ao_sampler_size;
-#endif
- return texture(ao_sampler, smpUV).x;
-}
-
-#else
-
-float customMaterialAO()
-{
- return 1.0;
-}
-
-#endif
-
-#if QT3DS_ENABLE_SSDO
-
-float customMaterialShadow( vec3 lightDir, vec3 varWorldPos )
-{
- return shadowOcclusion( depth_sampler, lightDir, varWorldPos, view_matrix, view_projection_matrix, shadow_properties, camera_properties, aoScreenConst, UvToEyeConst );
-}
-
-#else
-
-float customMaterialShadow( vec3 lightDir, vec3 varWorldPos )
-{
- return 1.0;
-}
-
-#endif
-
-#endif // #ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/defaultMaterialBumpNoLod.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/defaultMaterialBumpNoLod.glsllib
deleted file mode 100644
index 2f3bd150..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/defaultMaterialBumpNoLod.glsllib
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float calcRGBAvg(in vec4 rgba)
-{
- return (rgba.r + rgba.g + rgba.b) / 3.0;
-}
-
-vec3 defaultMaterialBumpNoLod(in sampler2D sampler, in float factor,
- in vec2 texCoord, in vec3 tangent, in vec3 binormal,
- in vec3 normal, in vec2 bumpSize )
-{
- // invert factor
- float invFactor = -factor;
-
- vec2 unitStep = 1.0 / bumpSize;
-
- float du = calcRGBAvg(texture2D( sampler, vec2( texCoord.x + unitStep.x, texCoord.y )))
- - calcRGBAvg(texture2D( sampler, vec2( texCoord.x, texCoord.y )));
- float dv = calcRGBAvg(texture2D( sampler, vec2( texCoord.x, texCoord.y + unitStep.y )))
- - calcRGBAvg(texture2D( sampler, vec2( texCoord.x, texCoord.y )));
-
- vec3 n = normalize(vec3(invFactor * du, invFactor * dv, 1.0));
- n = n.x * normalize(tangent) + n.y * normalize(binormal) + n.z * normal;
- return normalize(normal + n);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/evalEnvironmentMap.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/evalEnvironmentMap.glsllib
deleted file mode 100644
index ac9851e2..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/evalEnvironmentMap.glsllib
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec3 evalEnvironmentMap( in vec3 R, float roughness )
-{
- // convert R to spherical texture coordinates
- vec2 tc = vec2( ( atan( R.x, -R.z ) + PI ) / ( PI_TWO ), acos( -R.y ) / PI );
-
- return( textureLod( uEnvironmentTexture, tc, 0.0 ).rgb );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib
deleted file mode 100644
index cdb8c92a..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib
+++ /dev/null
@@ -1,29 +0,0 @@
-#define MAX_AREA_LIGHTS 16
-
-// note this struct must exactly match the memory layout of the
-// struct SLightSourceShader in the source code. If you make changes here you need
-// to adjust the struct SLightSourceShader as well
-struct AreaLight
-{
- vec4 position;
- vec4 direction; // Specifies the light direction in world coordinates.
- vec4 up;
- vec4 right;
- vec4 diffuse;
- vec4 ambient;
- vec4 specular;
- float spotExponent; // Specifies the intensity distribution of the light.
- float spotCutoff; // Specifies the maximum spread angle of the light.
- float constantAttenuation; // Specifies the constant light attenuation factor.
- float linearAttenuation; // Specifies the linear light attenuation factor.
- float quadraticAttenuation; // Specifies the quadratic light attenuation factor.
- float range; // Specifies the maximum distance of the light influence
- float width; // Specifies the width of the area light surface.
- float height; // Specifies the height of the area light surface;
- vec4 shadowControls;
- mat4 shadowView;
- int shadowIdx;
-};
-
-uniform int uNumAreaLights;
-uniform AreaLight arealights[MAX_AREA_LIGHTS];
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/funcsampleLightVars.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/funcsampleLightVars.glsllib
deleted file mode 100644
index 6cb0d831..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/funcsampleLightVars.glsllib
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#define MAX_NUM_LIGHTS 16
-
-struct LightSource
-{
- vec4 position;
- vec4 direction; // Specifies the light direction in world coordinates.
- vec4 up;
- vec4 right;
- vec4 diffuse;
- vec4 ambient;
- vec4 specular;
- float spotExponent; // Specifies the intensity distribution of the light.
- float spotCutoff; // Specifies the maximum spread angle of the light.
- float constantAttenuation; // Specifies the constant light attenuation factor.
- float linearAttenuation; // Specifies the linear light attenuation factor.
- float quadraticAttenuation; // Specifies the quadratic light attenuation factor.
- float range; // Specifies the maximum distance of the light influence
- float width; // Specifies the width of the area light surface.
- float height; // Specifies the height of the area light surface;
- vec4 shadowControls;
- mat4 shadowView;
- int shadowIdx;
-};
-
-uniform int uNumLights;
-uniform LightSource lights[MAX_NUM_LIGHTS];
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/microfacetBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/microfacetBSDF.glsllib
deleted file mode 100644
index 7173a743..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/microfacetBSDF.glsllib
+++ /dev/null
@@ -1,233 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MICROFACET_BSDF_GLSLLIB
-#define MICROFACET_BSDF_GLSLLIB 1
-
-
-float GtermSchlick( in mat3 tanFrame, in vec3 l, in vec3 v, in float roughness )
-{
- float NdotV = clamp(dot(tanFrame[2], v), 0.0, 1.0);
- float NdotL = clamp(dot(tanFrame[2], l), 0.0, 1.0);
- float k = roughness*roughness*0.79788;
-
- float G_V = NdotV / (NdotV * (1.0 + k) + k);
- float G_L = NdotL / (NdotL * (1.0 + k) + k);
-
- return clamp(( G_V * G_L ), 0.0, 1.0);
-}
-
-float GtermGGX( in mat3 tanFrame, in vec3 l, in vec3 v, in float roughness )
-{
- float NdotV = clamp(dot(tanFrame[2], v), 0.0, 1.0);
- float NdotL = clamp(dot(tanFrame[2], l), 0.0, 1.0);
- float k = clamp(roughness*roughness, 0.00, 1.0);
-
- float G_V = NdotV + sqrt( (NdotV - NdotV * k) * NdotV + k );
- float G_L = NdotL + sqrt( (NdotL - NdotL * k) * NdotL + k );
-
- return clamp( 2.0 / ( G_V * G_L ), 0.0, 1.0);
-}
-
-float DtermGGX( in mat3 tanFrame, in vec3 L, in vec3 V, in float roughness )
-{
- float m = clamp(roughness, 0.04, 1.0);
- float m2 = m*m;
-
- vec3 H = normalize(L + V);
- float NdotH = clamp(dot( tanFrame[2], H ), 0.0001, 1.0);
- float NdotH2 = NdotH * NdotH;
-
- float denom = NdotH2 * (m2 - 1.0) + 1.0;
- float D = m2 / (PI * denom * denom);
-
- return max( 0.0, D);
-}
-
-float DtermGGXAniso( in mat3 tanFrame, in vec3 L, in vec3 V, in float roughnessU, float roughnessV )
-{
- float roughU = clamp(roughnessU, 0.04, 1.0);
- float roughV = clamp(roughnessV, 0.04, 1.0);
- vec3 H = normalize(L + V);
- float NdotH = clamp( dot(tanFrame[2], H), 0.0001, 1.0 );
- float m = PI * roughU * roughV;
- float HdotX = clamp( abs(dot(H, tanFrame[0])), 0.0001, 1.0 );
- float HdotY = clamp( abs(dot(H, tanFrame[1])), 0.0001, 1.0 );
-
- float x2 = roughU*roughU;
- float y2 = roughV*roughV;
-
- float D = (HdotX*HdotX/x2) + (HdotY*HdotY/y2) + (NdotH*NdotH);
- D = 1.0 / ( m * D * D );
-
- return max( 0.0, D);
-}
-
-vec4 microfacetBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, float ior,
- in float roughnessU, in float roughnessV, int mode )
-{
- vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
- vec3 H = normalize(L + V);
- float HdotL = clamp(dot(H, L), 0.0, 1.0);
- float NdotL = dot(tanFrame[2], L);
-
- if ( NdotL > 0.0 )
- {
- if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
- {
- float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
- // G term
- //float G = GtermSchlick( tanFrame, L, V, roughness );
- float G = GtermGGX( tanFrame, L, V, roughness );
-
- //float D = DtermGGX( tanFrame, L, V, roughness );
- float D = DtermGGXAniso( tanFrame, L, V, roughnessU, roughnessV );
- rgba.rgb = G * D * NdotL * lightSpecular;
- }
-
- if ( ( mode == scatter_transmit ) || ( mode == scatter_reflect_transmit ) )
- {
- rgba.a = pow(1.0 - clamp(HdotL, 0.0, 1.0), 5.0);
- }
- }
-
- return rgba;
-}
-
-vec4 microfacetBSDFEnvironment( in mat3 tanFrame, in vec3 viewDir, in float roughnessU,
- in float roughnessV, int mode )
-{
- vec3 rgb = vec3( 0.0, 0.0, 0.0 );
-#if !QT3DS_ENABLE_LIGHT_PROBE
- if ( uEnvironmentMappingEnabled )
- {
- float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
- vec3 R = reflect( -viewDir, tanFrame[2] );
- rgb = 0.01 * evalEnvironmentMap( R, roughness );
- rgb = microfacetBSDF( tanFrame, R, viewDir, rgb, 1.0, roughnessU, roughnessV,
- scatter_reflect ).rgb;
- }
-#endif
- return( vec4( rgb, 1.0 ) );
-}
-
-vec3 ImportanceGGX( in mat3 tanFrame, vec2 Xi, float roughness , vec3 N )
-{
- float a = roughness * roughness;
- float Phi = 2.0 * PI * Xi.y;
- float CosTheta = (1.0 - Xi.x);
- float SinTheta = sqrt( 1.0 - CosTheta * CosTheta );
-
- vec3 H;
- H.x = SinTheta * cos( Phi );
- H.y = SinTheta * sin( Phi );
- H.z = CosTheta;
-
- // Tangent to world space
- return tanFrame[0] * H.x + tanFrame[1] * H.y + tanFrame[2] * H.z;
-}
-
-float DtermGGXAnisoSampled( in mat3 tanFrame, in vec3 H, in float roughnessU, float roughnessV )
-{
-#if (MATERIAL_IS_NON_DIELECTRIC == 1)
- float roughU = clamp(roughnessU*roughnessU, 0.01, 1.0);
- float roughV = clamp(roughnessV*roughnessV, 0.01, 1.0);
-#else
- float roughU = clamp(roughnessU, 0.02, 1.0);
- float roughV = clamp(roughnessV, 0.02, 1.0);
-#endif
-
- float NdotH = clamp( dot(tanFrame[2], H), 0.0001, 1.0 );
- float m = PI * roughU * roughV;
- float HdotX = clamp( abs(dot(H, tanFrame[0])), 0.0001, 1.0 );
- float HdotY = clamp( abs(dot(H, tanFrame[1])), 0.0001, 1.0 );
-
- float x2 = roughU*roughU;
- float y2 = roughV*roughV;
-
- float pdf = (HdotX*HdotX/x2) + (HdotY*HdotY/y2) + (NdotH*NdotH);
- float D = 1.0 / ( m * pdf * pdf );
-
- return max( 0.0, D);
-}
-
-vec3 sampleEnv(in vec3 L, float pdf, int sampleCount, float roughness )
-{
- // convert coord to 2D
- vec2 tc = vec2( ( atan( L.x, -L.z ) + PI ) / ( 2.0 * PI ), acos( -L.y ) / PI );
- return( textureLod( uEnvironmentTexture, tc, 0.0 ).rgb );
-}
-
-vec4 microfacetSampledBSDF( in mat3 tanFrame, in vec3 viewDir, in float roughnessU,
- in float roughnessV, int mode )
-{
- vec2 hammersly[4];
- hammersly[0] = vec2(0.0, 0.0);
- hammersly[1] = vec2(0.25, 0.5);
- hammersly[2] = vec2(0.5, 0.25);
- hammersly[3] = vec2(0.75, 0.75);
-
- vec3 rgb = vec3( 0.0, 0.0, 0.0 );
-
- float roughness = clamp( calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] ),
- 0.0, 1.0 );
-
- vec3 R = reflect( -viewDir, tanFrame[2] );
-
- const int NumSamples = 4;
- for( int i = 0; i < NumSamples; i++ )
- {
- vec2 Xi = hammersly[i]; // pre computed values
- //vec2 Xi = hammersley2d(i, NumSamples);
- vec3 Half = ImportanceGGX( tanFrame, Xi, roughness , tanFrame[2] );
- vec3 H = normalize( Half );
-
- vec3 L = 2.0 * dot( viewDir, Half ) * Half - viewDir;
- float NdotV = clamp( dot( tanFrame[2], viewDir ), 0.0001, 1.0 );
- float NdotR = clamp( dot( tanFrame[2], R ), 0.0, 1.0 );
- float NdotH = clamp( dot( tanFrame[2], H ), 0.0001, 1.0 );
-
- if( NdotV > 0.0001 )
- {
- float G = GtermGGX( tanFrame, L, viewDir, roughness );
- float D = DtermGGXAnisoSampled( tanFrame, H, roughnessU, roughnessV);
-
- vec3 envColor = 0.01 * sampleEnv( L, D, NumSamples, roughness );
-
- rgb += (envColor * G * D * NdotR) / ( 4.0 * NdotV * NdotH);
- }
- }
-
- rgb /= float(NumSamples);
-
- return( vec4( rgb, 1.0 ) );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/monoChannel.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/monoChannel.glsllib
deleted file mode 100644
index ca682d67..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/monoChannel.glsllib
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MONO_CHANNEL_GLSLLIB
-#define MONO_CHANNEL_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-#define mono_alpha 0
-#define mono_average 1
-#define mono_luminance 2
-#define mono_maximum 3
-#endif
-
-float monoChannel( in vec4 t, const in int monoSource )
-{
- if ( monoSource == mono_alpha )
- return( t.w );
-
- if ( monoSource == mono_average )
- return( ( t.x + t.y + t.z ) / 3.0 );
-
- if ( monoSource == mono_luminance )
- return( luminance( t.xyz ) );
-
- if ( monoSource == mono_maximum )
- return( max( t.x, max( t.y, t.z ) ) );
-
- return( 1.0 );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/refraction.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/refraction.glsllib
deleted file mode 100644
index 837d7f50..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/refraction.glsllib
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// this is entirly phiysical incorrect
-// We just use this to fake distortion when we have no environment available
-// The displacement is calculated on ior
-vec3 refraction( in sampler2D sampler, in float materialIOR )
-{
- vec3 displace = fresnel( viewDir, vec3( materialIOR ));
-
- float xdir = abs( viewDir.x );
- float ydir = abs( viewDir.y );
-
- vec2 texSize = vec2( textureSize( sampler, 0 ) );
- vec2 newUV = vec2(gl_FragCoord.xy/texSize);
- if ( xdir > ydir)
- {
- newUV = ( viewDir.x > 0.0) ? newUV + displace.xy : newUV - displace.xy;
- }
- else
- {
- newUV = ( viewDir.y > 0.0) ? newUV - displace.xy : newUV + displace.xy;
- }
-
- vec3 refractColor = texture( sampler, newUV ).rgb;
-
- return refractColor;
-}
-
-// This should really not be used, but it's there for the sake of testing.
-vec3 refractBlur( in sampler2D sampler, in vec3 viewDir, in float materialIOR, in float blurWidth )
-{
- // This is really terrible, but at least is a little better than
- vec3 displace = viewDir * materialIOR;
-
- vec2 texSize = vec2( textureSize( sampler, 0 ) );
- texSize = vec2(1.0) / texSize;
- vec2 newUV = vec2(gl_FragCoord.xy * texSize);
- newUV += displace.xy * 0.005;
-
- //vec3 refractColor = texture( sampler, newUV ).rgb;
- vec3 refractColor = vec3(0);
- int sz = int(ceil(blurWidth));
- float wtsum = 0.0;
-
- for (int y = -sz; y <= sz; ++y)
- {
- for (int x = -sz; x <= sz; ++x)
- {
- float wt = float(x*x + y*y) / (blurWidth * 0.5);
- wt = exp2(-wt);
- //refractColor += wt * textureOffset( sampler, newUV, ivec2(x, y) ).rgb;
- vec2 uvOfs = vec2(x, y) * texSize;
- refractColor += wt * texture( sampler, newUV+uvOfs).rgb;
- wtsum += wt;
- }
- }
-
- return refractColor / wtsum;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/sampleProbe.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/sampleProbe.glsllib
deleted file mode 100644
index f785918c..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/sampleProbe.glsllib
+++ /dev/null
@@ -1,482 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SAMPLE_PROBE_GLSLLIB
-#define SAMPLE_PROBE_GLSLLIB 1
-
-#ifndef QT3DS_ENABLE_LIGHT_PROBE_2
-#define QT3DS_ENABLE_LIGHT_PROBE_2 0
-#endif
-
-#ifndef QT3DS_ENABLE_IBL_FOV
-#define QT3DS_ENABLE_IBL_FOV 0
-#endif
-
-uniform sampler2D light_probe;
-uniform vec4 light_probe_props;
-uniform vec4 light_probe_rotation;
-uniform vec4 light_probe_offset; // light_probe_offset.w = number of mipmaps
-uniform vec2 light_probe_size;
-
-#if QT3DS_ENABLE_LIGHT_PROBE_2
-uniform sampler2D light_probe2;
-uniform vec4 light_probe2_props;
-uniform vec2 light_probe2_size;
-#endif
-
-#if QT3DS_ENABLE_IBL_FOV
-uniform vec4 light_probe_opts;
-#endif
-
-float noise1d(vec2 n)
-{
- return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);
-}
-
-mat3 orthoNormalize( in mat3 tanFrame )
-{
- mat3 outMat;
- outMat[0] = normalize( cross( tanFrame[1], tanFrame[2] ) );
- outMat[1] = normalize( cross( tanFrame[2], outMat[0] ) );
- outMat[2] = tanFrame[2];
-
- return outMat;
-}
-
-mat3 tangentFrame( vec3 N, vec3 p )
-{
- // get edge vectors of the pixel triangle
- vec3 dp1 = dFdx( p );
- vec3 dp2 = dFdy( p );
- // Using dPdu and dPdv would be nicer, but the nature of our materials
- // are not ones with intrinsic UVs, so we can't really go there.
-// vec2 duv1 = dFdx( uv );
-// vec2 duv2 = dFdy( uv );
-
- // solve the linear system
- vec3 dp2perp = cross( dp2, N );
- vec3 dp1perp = cross( N, dp1 );
-// vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
-// vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
-
- vec3 T = normalize(dp1perp);
- vec3 B = normalize(dp2perp);
- return mat3( T , B , N );
-}
-
-vec2 transformSample( vec2 origUV, vec4 probeRot, vec2 probeOfs )
-{
- vec2 retUV;
- retUV.x = dot( vec3(origUV, 1.0), vec3(probeRot.xy, probeOfs.x) );
- retUV.y = dot( vec3(origUV, 1.0), vec3(probeRot.zw, probeOfs.y) );
- return retUV;
-}
-
-// This is broken out into its own routine so that if we get some other
-// format image than a lat-long, then we can account for that by changing
-// the code here alone.
-vec2 getProbeSampleUV( vec3 smpDir, vec4 probeRot, vec2 probeOfs )
-{
- vec2 smpUV;
-
-#if QT3DS_ENABLE_IBL_FOV
- smpUV.x = (2.0 * atan(-smpDir.z, smpDir.x) + 3.14159265358 ) / light_probe_opts.x;
- smpUV.y = (2.0 * atan(-smpDir.z, smpDir.y) + 3.14159265358 ) / light_probe_opts.x;
-#else
- smpUV.x = atan( smpDir.x, -smpDir.z) / 3.14159265359;
- smpUV.y = 1.0 - (acos(smpDir.y) / 1.57079632679);
-#endif
- smpUV = transformSample( smpUV.xy * 0.5, probeRot, probeOfs ) + vec2(0.5, 0.5);
-
- return smpUV;
-}
-
-vec4 getTopLayerSample( vec3 inDir, float lodShift, vec3 lodOffsets )
-{
-#if QT3DS_ENABLE_LIGHT_PROBE_2
- if ( light_probe2_props.w < 0.5 )
- return vec4(0.0, 0.0, 0.0, 0.0);
-
- vec2 smpUV = getProbeSampleUV( inDir, vec4(1.0, 0.0, 0.0, 1.0), light_probe_props.xy );
- smpUV.x -= 0.5;
- smpUV.x *= light_probe2_props.x;
- smpUV.x += light_probe2_props.y;
-
- vec4 retVal = 0.4 * textureLod( light_probe2, smpUV , lodShift );
- retVal += 0.2 * textureLod( light_probe2, smpUV , lodShift+lodOffsets.x );
- retVal += 0.3 * textureLod( light_probe2, smpUV , lodShift+lodOffsets.y );
- retVal += 0.1 * textureLod( light_probe2, smpUV , lodShift+lodOffsets.z );
- return retVal;
-#else
- return vec4(0.0, 0.0, 0.0, 0.0);
-#endif
-}
-
-vec3 getProbeSample( vec3 smpDir, float lodShift, vec3 normal )
-{
- vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
- return textureLod( light_probe, smpUV , lodShift ).xyz;
-}
-
-vec3 getProbeWeightedSample( vec3 smpDir, float lodShift, float roughness, vec3 normal )
-{
- // This gives us a weighted sum that approximates the total filter support
- // of the full-blown convolution.
- vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
- float wt = 1.0;
-
-#if QT3DS_ENABLE_IBL_FOV
- wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.x));
- wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.y));
- wt = min(wt, 1.0 - smoothstep(1.0 - roughness*0.25, 1.0 + roughness*0.25, smpUV.x));
- wt = min(wt, 1.0 - smoothstep(1.0 - roughness*0.25, 1.0 + roughness*0.25, smpUV.y));
-#endif
-
- vec3 lodOffsets;
- lodOffsets.x = mix(-2.0, -0.70710678, roughness);
- lodOffsets.y = min( 2.0 * smoothstep(0.0, 0.1, roughness), 2.0 - 1.29289 * smoothstep(0.1, 1.0, roughness) );
- lodOffsets.z = min( 6.0 * smoothstep(0.0, 0.1, roughness), 6.0 - 4.585786 * smoothstep(0.1, 1.0, roughness) );
-
- ivec2 iSize = ivec2(light_probe_size);
- vec3 ddx = dFdx( smpDir ) * float(iSize.x);
- vec3 ddy = dFdy( smpDir ) * float(iSize.y);
-// vec2 ddxUV = dFdx( smpUV ) * float(iSize.x);
-// vec2 ddyUV = dFdy( smpUV ) * float(iSize.y);
-
- vec2 deriv;
- deriv.x = max( dot(ddx, ddx), dot(ddy, ddy) );
-// deriv.y = max( dot(ddxUV, ddxUV), dot(ddyUV, ddyUV) );
- deriv = clamp( deriv, vec2(1.0), vec2(iSize.x * iSize.y) );
- vec2 lodBound = 0.5 * log2( deriv ) - vec2(1.0);
-
-// float minLod = 0.5 * (lodBound.x + lodBound.y);
- float minLod = lodBound.x;
- float maxLod = log2( max(float(iSize.x), float(iSize.y)) );
- minLod = clamp( minLod / maxLod, 0.0, 1.0 );
- minLod *= minLod * maxLod;
-
- lodShift = max( lodShift, minLod );
-
- vec3 retVal = 0.4 * textureLod( light_probe, smpUV , lodShift ).xyz;
- retVal += 0.2 * textureLod( light_probe, smpUV , max(minLod, lodShift+lodOffsets.x) ).xyz;
- retVal += 0.3 * textureLod( light_probe, smpUV , lodShift+lodOffsets.y ).xyz;
- retVal += 0.1 * textureLod( light_probe, smpUV , lodShift+lodOffsets.z ).xyz;
-
-#if QT3DS_ENABLE_LIGHT_PROBE_2
- vec4 topSmp = getTopLayerSample( smpDir, lodShift, lodOffsets );
- vec3 tempVal = mix( retVal, topSmp.xyz, topSmp.w );
- retVal = mix( retVal, tempVal, light_probe2_props.z );
-#endif
-
- if (light_probe_props.z > -1.0) {
- float ctr = 0.5 + 0.5 * light_probe_props.z;
- float vertWt = smoothstep(ctr-roughness*0.25, ctr+roughness*0.25, smpUV.y);
- float wtScaled = mix(1.0, vertWt, light_probe_props.z + 1.0);
- retVal *= wtScaled;
- }
-
- return retVal * wt;
-}
-
-vec2 textureSizeLod( vec2 size, int level )
-{
- return size / pow(2.0, float(level));
-}
-
-vec3 getProbeAnisoSample( vec3 smpDir, float roughU, float roughV, mat3 tanFrame )
-{
- float minRough = min(roughU, roughV);
- float maxRough = max(roughU, roughV);
-
- float lodMin = log2( (minRough*3.0 + maxRough)*0.25 ) + (light_probe_offset.w - 2.0);
-
- float ratio = clamp( maxRough / minRough, 1.01, 27.0);
- vec2 texSize = textureSizeLod( light_probe_size, int(floor( lodMin )) );
- texSize = mix( texSize, texSize * 0.5, fract(lodMin) );
-
- // Boundary of 1.0..9.0 is just to keep the number of samples to within a
- // reasonable number of samples in the filter. Similarly, with the clamping
- // of the ratio to a max of 27.0 is just to prevent the step size in the filter
- // to be no bigger than 3 texels (beyond which, there are some artifacts at high
- // roughness, aka low texture res).
- float stepFig = clamp(floor( ratio ), 1.0, 9.0);
-
- // numSteps is half the number of samples we need to take, which makes it
- // the number of steps to take on each side.
- int numSteps = int( floor(stepFig * 0.5) );
-
- vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
- vec4 result = vec4(0.0);
-
- vec3 smpDirOfs = (maxRough == roughU) ? 0.01 * tanFrame[0] : 0.01 * tanFrame[1];
- vec2 stepPos = getProbeSampleUV(normalize(smpDir + smpDirOfs), light_probe_rotation, light_probe_offset.xy);
- vec2 stepNeg = getProbeSampleUV(normalize(smpDir - smpDirOfs), light_probe_rotation, light_probe_offset.xy);
- stepPos -= smpUV; stepNeg -= smpUV;
- stepPos *= texSize; stepNeg *= texSize;
-
- // This ensures that we step along a size that makes sense even if one of the two
- // sammpling directions wraps around the edges of the IBL texture.
- smpDirOfs /= min( length(stepPos), length(stepNeg) );
- smpDirOfs *= ratio / stepFig;
-
- float sigma = mix(0.0, 2.0, ratio / 27.0);
- sigma *= sigma;
-
- float wt = (1.0 / (ratio - 1.0)) + 1.0;
- result.xyz += wt * getProbeWeightedSample( smpDir, lodMin, minRough, tanFrame[2] );
- result.w += wt;
- for (int i = 0; i < numSteps; ++i)
- {
- wt = sigma / (sigma + float(i * i));
- vec2 uv0 = getProbeSampleUV(normalize(smpDir + smpDirOfs * float(i)), light_probe_rotation, light_probe_offset.xy);
- vec2 uv1 = getProbeSampleUV(normalize(smpDir - smpDirOfs * float(i)), light_probe_rotation, light_probe_offset.xy);
- result.xyz += wt * textureLod( light_probe, uv0 , lodMin ).xyz;
- result.w += wt;
- result.xyz += wt * textureLod( light_probe, uv1 , lodMin ).xyz;
- result.w += wt;
- }
-
- result /= result.w;
- return result.xyz;
-}
-
-vec4 sampleDiffuse( mat3 tanFrame )
-{
- if ( light_probe_props.w < 0.005 )
- return vec4( 0.0 );
-
-// if ( light_probe_offset.w > 0.5 )
-// {
- // The LOD offset comes from the assumption that a full diffuse convolution
- // has a support of pi/2, which translates into x pixels, and the base 2 log
- // gives us this LOD... Technically, "x" pixels depends on what the original
- // texture resolution was, which is why we use light_probe_offset.w, which holds
- // the number of mip levels the texture has.
-
- return vec4( light_probe_props.w * getProbeWeightedSample( tanFrame[2], light_probe_offset.w - 2.65149613, 1.0, tanFrame[2] ), 1.0 );
-// }
-
- /*
- // PKC -- the code below is for full-blown IBL, which we'll skip for now
-
- // Hand-calculated Hammersley points for t = 2, n = 33
- // I exclude the 0,0 first point, hence why n=33 and not 32
- // Nice thing about 2d Hammersley points is that any subset is
- // also stratified, so even if I have 1000 points and truncate
- // anywhere, I'm fine. Each of these represent the y of an xy
- // while x for the kth point is always (k+1)/n.
- float kernel[32];
- kernel[0] = 0.5; kernel[1] = 0.25;
- kernel[2] = 0.75; kernel[3] = 0.125;
- kernel[4] = 0.625; kernel[5] = 0.375;
- kernel[6] = 0.875; kernel[7] = 0.0625;
- kernel[8] = 0.5625; kernel[9] = 0.3125;
- kernel[10] = 0.8125; kernel[11] = 0.1875;
- kernel[12] = 0.6875; kernel[13] = 0.4375;
- kernel[14] = 0.9375; kernel[15] = 0.03125;
- kernel[16] = 0.53125; kernel[17] = 0.28125;
- kernel[18] = 0.78125; kernel[19] = 0.15625;
- kernel[20] = 0.65625; kernel[21] = 0.40625;
- kernel[22] = 0.90625; kernel[23] = 0.09375;
- kernel[24] = 0.59375; kernel[25] = 0.34375;
- kernel[26] = 0.84375; kernel[27] = 0.28175;
- kernel[28] = 0.71875; kernel[29] = 0.46875;
- kernel[30] = 0.96875; kernel[31] = 0.015625;
-
- float phiShift = noise1d(gl_FragCoord.xy) - 0.5;
-
- vec3 ret = vec3(0, 0, 0);
-
- int ct = 24;
- float step = 25.0;
-
- // Importance sampling a cosine-weighted distribution. Since this
- // matches the BSDF exactly, we are just going to assume that the PDF
- // and the BSDF cancel out in sampling, so we just need to accumulate
- // texture colors. The noise function puts randomized "twist" into
- // the sampled directions.
- for( int i = 0; i < ct; ++i )
- {
- vec3 localDir;
- float phi = 6.28318530718 * (kernel[i] + phiShift);
- float cosTheta = sqrt( float(i+1) / step);
- localDir.z = sqrt(1.0 - cosTheta*cosTheta);
- localDir.x = cos(phi) * cosTheta;
- localDir.y = sin(phi) * cosTheta;
- vec3 smpDir = tanFrame[0]*localDir.x + tanFrame[1]*localDir.y + tanFrame[2]*localDir.z;
-
-
- float lodShift = light_probe_offset.w - 2 + log2( 3.1415926535 / (localDir.z * step) );
- vec3 smpColor = getProbeSample( smpDir, lodShift, tanFrame[2] );
-
- // The assumption here is that the BSDF and the sampling PDF are identical
- // so they cancel out and therefore, we don't need to include it here.
- ret += smpColor;
- }
-
- ret *= aoFactor / 24.0;
- return ret;
- */
-}
-
-vec4 sampleDiffuseCustomMaterial( vec3 normal, vec3 worldPos, float aoFactor )
-{
-
- mat3 tanFrame = tangentFrame( normal, worldPos );
- return sampleDiffuse( tanFrame );
-}
-
-vec4 sampleGlossyAniso( mat3 tanFrame, vec3 viewDir, float roughU, float roughV )
-{
- if ( light_probe_props.w < 0.005 )
- return vec4( 0.0 );
-
- // PKC : If we do the full IBL sampling, it's useful to square the roughnesses because
- // it makes the effect of roughness feel more linear in the low end. This isn't necessary
- // for fast IBL.
-// float sigmaU = clamp(roughU*roughU, 0.0001, 1.0);
-// float sigmaV = clamp(roughV*roughV, 0.0001, 1.0);
- float sigmaU = smoothstep( 0.0, 1.0, clamp(roughU, 0.0001, 1.0) );
- float sigmaV = smoothstep( 0.0, 1.0, clamp(roughV, 0.0001, 1.0) );
- vec3 ret = vec3(0, 0, 0);
-
-// if ( light_probe_offset.w > 0.5 )
-// {
- vec3 smpDir = reflect( -viewDir, tanFrame[2] );
- float sigma = sqrt(sigmaU * sigmaV);
-
- // Compute the Geometric occlusion/self-shadowing term
- float NdotL = clamp( dot( smpDir, tanFrame[2] ), 0.0, 0.999995);
- float k = sigma * 0.31830988618; // roughness / pi
- float Gl = clamp( (NdotL / (NdotL*(1.0-k) + k) + (1.0 - k*k)) * 0.5, 0.0, 1.0 );
-
- vec3 outColor;
-
- outColor = getProbeAnisoSample( smpDir, sigmaU, sigmaV, tanFrame );
-
- return vec4( light_probe_props.w * Gl * outColor, 1.0 );
-// }
-
- // PKC -- the code below is for full-blown IBL, which we'll skip for now
-
-/*
- float step = clamp( ceil(32.0 * sqrt(max(sigmaU, sigmaV))), 4.0, 32.0 );
- int actualCt = int(step);
- float phiShift = noise1d(gl_FragCoord.xy) - 0.5;
-
- // Hand-calculated Hammersley points for t = 2, n = 33
- // I exclude the 0,0 first point, hence why n=33 and not 32
- // Nice thing about 2d Hammersley points is that any subset is
- // also stratified, so even if I have 1000 points and truncate
- // anywhere, I'm fine. Each of these represent the y of an xy
- // while x for the kth point is always (k+1)/n.
- float kernel[32];
- kernel[0] = 0.5; kernel[1] = 0.25;
- kernel[2] = 0.75; kernel[3] = 0.125;
- kernel[4] = 0.625; kernel[5] = 0.375;
- kernel[6] = 0.875; kernel[7] = 0.0625;
- kernel[8] = 0.5625; kernel[9] = 0.3125;
- kernel[10] = 0.8125; kernel[11] = 0.1875;
- kernel[12] = 0.6875; kernel[13] = 0.4375;
- kernel[14] = 0.9375; kernel[15] = 0.03125;
- kernel[16] = 0.53125; kernel[17] = 0.28125;
- kernel[18] = 0.78125; kernel[19] = 0.15625;
- kernel[20] = 0.65625; kernel[21] = 0.40625;
- kernel[22] = 0.90625; kernel[23] = 0.09375;
- kernel[24] = 0.59375; kernel[25] = 0.34375;
- kernel[26] = 0.84375; kernel[27] = 0.28175;
- kernel[28] = 0.71875; kernel[29] = 0.46875;
- kernel[30] = 0.96875; kernel[31] = 0.015625;
-
- float thetaI = acos( dot(viewDir, tanFrame[2]) );
-
- // NOTE : The model I'm using here is actually based on the KGGX model used in
- // physGlossyBSDF. This is my own variation on the original GGX which uses something
- // closer to a pure Cauchy distribution in tangent space, but also supports anisotropy.
- for (int i = 0; i < actualCt; ++i)
- {
- vec3 localDir;
-
- float phi = 6.28318530718 * (kernel[i] + phiShift);
- float u = float(i + 1) / (step + 1.0);
- float rU = cos(phi) * sigmaU;
- float rV = sin(phi) * sigmaV;
- float sigma = sqrt(rU * rU + rV * rV);
-
- float boundA = atan( ((thetaI - 1.57079632679) * 0.5) / sigma );
- float boundB = atan( ((thetaI + 1.57079632679) * 0.5) / sigma );
- float t = (1.0 - u) * boundA + u * boundB;
- float thetaH = tan( t ) * sigma;
-
- float cosThetaH = cos( thetaH );
- float sinThetaH = sin( thetaH );
- localDir.z = cosThetaH;
- localDir.y = sin(phi) * sinThetaH;
- localDir.x = cos(phi) * sinThetaH;
-
- vec3 halfDir = tanFrame[0]*localDir.x + tanFrame[1]*localDir.y + tanFrame[2]*localDir.z;
- halfDir = normalize(halfDir);
- vec3 smpDir = reflect( -viewDir, halfDir );
-
- vec2 scaledXY = localDir.xy / vec2(sigmaU, sigmaV);
- float PDF = (sigmaU*sigmaV) / (sigmaU*sigmaV + dot(scaledXY, scaledXY));
- vec3 Haf = smpDir + viewDir; // We need the unnormalized half vecter as well as the normalized one
- float HdotL = dot(halfDir, smpDir);
- // normalize the PDF to compute the filter support
- // This gives us the ideal miplevel at which to sample the texture map.
- PDF *= dot(Haf, Haf) / (4.0 * dot(Haf, smpDir) * HdotL * sigmaU*sigmaV * (boundB-boundA)*(boundB-boundA));
-
- // Again assuming that the pdf and BSDF are equivalent -- that's not generally valid,
- // but it saves a lot of ALU cycles.
- float lodShift = log2( 512.0 * sigma / PDF );
-
- float k = sigma * 0.31830988618; // roughness / pi
- float Gl = clamp( (HdotL / (HdotL*(1.0-k) + k) + (1.0 - k*k)) * 0.5, 0.0, 1.0 );
-
- vec3 smpColor = Gl * getProbeSample( smpDir, lodShift, tanFrame[2] );
- ret += smpColor;
- }
- ret /= float(actualCt);
- return vec4(ret, 1.0);
-*/
-}
-
-vec4 sampleGlossy( mat3 tanFrame, vec3 viewDir, float roughness )
-{
- return sampleGlossyAniso( tanFrame, viewDir, roughness, roughness );
-}
-
-vec4 sampleGlossyCustomMaterial( vec3 normal, vec3 worldPos, vec3 viewDir, float roughness )
-{
- mat3 tanFrame = tangentFrame( normal, worldPos );
- return sampleGlossy( tanFrame, viewDir, roughness );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/shadowMapping.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/shadowMapping.glsllib
deleted file mode 100644
index 183ef974..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/shadowMapping.glsllib
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SHADOW_MAPPING_GLSLLIB
-#define SHADOW_MAPPING_GLSLLIB
-
-#include "depthpass.glsllib"
-
-float sampleParaboloid( in sampler2D shadowMap, in vec4 shadowControls, in mat4 shadowMatrix, in vec3 worldPos, in vec2 cameraProps, out vec2 smpUV )
-{
- vec4 projCoord = shadowMatrix * vec4( worldPos, 1.0 );
- vec3 smpCoord = projCoord.xyz / projCoord.w;
-
- float ptDepth = depthValueToLinearDistance( 1.0 - smpCoord.z, cameraProps );
- ptDepth = (ptDepth - cameraProps.x) / (cameraProps.y - cameraProps.x);
- smpCoord = normalize( smpCoord.xyz );
- smpCoord.xy /= -( smpCoord.z + 1.0 );
- smpCoord.xy = vec2(1.0) - smpCoord.xy;
- smpCoord.xy *= 0.5;
-
- smpUV = smpCoord.xy; // This is just for debug purposes to ensure what the sampled UV cooord is.
-
- float sampleDepth = texture( shadowMap, smpCoord.xy ).x + shadowControls.x;
- sampleDepth *= sampleDepth;
- ptDepth *= ptDepth;
- float shadowFac = min(1.0, exp(shadowControls.y * sampleDepth * sampleDepth) / exp(shadowControls.y * ptDepth * ptDepth));
-
- smpUV.xy *= shadowFac;
- return shadowFac;
-}
-
-float sampleCubemap( in samplerCube shadowCube, in vec4 shadowControls, in mat4 shadowViewMat, in vec3 lightPos, in vec3 worldPos, in vec2 cameraProps )
-{
- vec3 viewDir = worldPos - vec3(lightPos.x, lightPos.y, lightPos.z);
- float ptDepth = length(viewDir.xyz);
- vec4 viewCoord = shadowViewMat * vec4( viewDir.xyz, 0.0 );
- viewCoord.xyz /= ptDepth;
- ptDepth = clamp((ptDepth - 1.0) / (cameraProps.y - 1.0), 0.0, 1.0);
-
- float smpDepth = textureCube( shadowCube, viewDir.xyz ).x + shadowControls.x;
-
- float shadowFac = min(1.0, exp(shadowControls.y * smpDepth) / exp(shadowControls.y * ptDepth));
- return shadowFac;
-}
-
-float sampleOrthographic( in sampler2D shadowMap, in vec4 shadowControls, in mat4 shadowMatrix, in vec3 worldPos, in vec2 cameraProps )
-{
- vec4 projCoord = shadowMatrix * vec4( worldPos, 1.0 );
- vec3 smpCoord = projCoord.xyz / projCoord.w;
-
- float sampleDepth = texture( shadowMap, smpCoord.xy ).x + shadowControls.x;
-
- return min(1.0, exp(shadowControls.y * sampleDepth) / exp(shadowControls.y * smpCoord.z));
-}
-
-
-struct ParaboloidMapResult
-{
- vec4 m_Position;
- vec4 m_WorldPos;
-};
-
-ParaboloidMapResult VertexParaboloidDepth(vec3 pos, mat4 inMVP)
-{
- vec4 glPos = inMVP * vec4( pos, 1.0 );
- glPos /= glPos.w;
- glPos.xyz = normalize( glPos.xyz );
- vec4 world_pos;
- world_pos.w = glPos.z;
- glPos.xy /= glPos.z + 1.0;
- world_pos.xyz = pos.xyz;
-
- ParaboloidMapResult retval;
- retval.m_Position = glPos;
- retval.m_WorldPos = world_pos;
- return retval;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/tangentSpaceNormalTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/tangentSpaceNormalTexture.glsllib
deleted file mode 100644
index daae4014..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gles2/tangentSpaceNormalTexture.glsllib
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FILE_NORMAL_TEXTURE_GLSLLIB
-#define FILE_NORMAL_TEXTURE_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-
-#include "luminance.glsllib"
-#include "monoChannel.glsllib"
-#include "textureCoordinateInfo.glsllib"
-#define wrap_clamp 0
-#define wrap_repeat 1
-#define wrap_mirrored_repeat 2
-#include "rotationTranslationScale.glsllib"
-#include "transformCoordinate.glsllib"
-
-#endif
-
-int modulo(int a, int b)
-{
- int k = (a / b);
- return a - k*b;
-}
-
-//interpreting the color values of a bitmap as a vector in tangent space
-vec3 tangentSpaceNormalTexture( in sampler2D tex, in float factor, in bool flipTangentU, in bool flipTangentV
- , in texture_coordinate_info uvw, in vec2 cropU, in vec2 cropV, in int wrapU, in int wrapV )
-{
- // if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
- bool flipU = flipTangentU;
- bool flipV = flipTangentV;
- if ( wrapU == wrap_mirrored_repeat )
- {
- if ( ( ( 0.0 < uvw.position.x ) && ( modulo(int( uvw.position.x ), 2) == 1 ) )
- || ( ( uvw.position.x < 0.0 ) && ( modulo(int( uvw.position.x ), 2) == 0 ) ) )
- {
- flipU = !flipU;
- }
- if ( ( ( 0.0 < uvw.position.y ) && ( modulo(int( uvw.position.y ), 2) == 1 ) )
- || ( ( uvw.position.y < 0.0 ) && ( modulo(int( uvw.position.y ), 2) == 0 ) ) )
- {
- flipV = !flipV;
- }
- }
-
- vec3 tangent = 2.0 * texture( tex, uvw.position.xy ).xyz - 1.0;
-
- vec3 tangentU = normalize( flipU ? -uvw.tangent_u : uvw.tangent_u );
- vec3 tangentV = normalize( flipV ? -uvw.tangent_v : uvw.tangent_v );
- vec3 normal = normalize( cross( tangentU, tangentV ) );
-
- return( mix( normal, normalize( tangent.x * tangentU - tangent.y * tangentV + tangent.z * normal ), factor ) );
-}
-
-#include "textureCoordinateInfo.glsllib"
-
-//Simpler version built to run from UIC image data
-//In our case, we have already generated the texture coordinate x,y position
-//TODO - figure out if we need to manipulate tangent_u, tangent_v.
-vec3 defaultMaterialFileNormalTexture( in sampler2D sampler, in float factor, vec2 texCoord, vec3 tangent, vec3 binormal )
-{
- // factor should be in [0,1] range
- return tangentSpaceNormalTexture( sampler, clamp(factor, 0.0, 1.0), false, false
- , textureCoordinateInfo( vec3( texCoord.x, texCoord.y, 0.0 ), tangent, binormal )
- , vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 )
- , wrap_repeat, wrap_repeat);
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gradient3Recolor.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gradient3Recolor.glsllib
deleted file mode 100644
index ba7d5937..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gradient3Recolor.glsllib
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float gradientInterpolate( in int interpolationMode, in float value )
-{
- switch( interpolationMode )
- {
- case gradient_interpolation_linear :
- return( value );
- case gradient_interpolation_off :
- return( 0.0 );
- case gradient_interpolation_ease_in :
- return( 1.0 - pow( 1.0 - value, 2.0/3.0 ) );
- case gradient_interpolation_ease_out :
- return( pow( value, 2.0/3.0 ) );
- case gradient_interpolation_ease_in_out :
- return( ( value <= 0.5 )
- ? 0.5 * pow( 2.0 * value, 2.0/3.0 )
- : 0.5 + 0.5 * ( 1.0 - pow( 2.0 * ( 1.0 - value ), 2.0/3.0 ) ) );
- default:
- return( value ); // default is linear
- }
-}
-
-texture_return gradient3Recolor( in float gradientPositions[3], in vec3 gradientColors[3], in int interpolationModes[3], in int monoSource, in float distortion, in float position )
-{
- texture_return tr;
- float pos = position + distortion;
- if ( pos <= gradientPositions[0] )
- {
- tr.tint = gradientColors[0];
- }
- else if ( pos >= gradientPositions[2] )
- {
- tr.tint = gradientColors[2];
- }
- else
- {
- int index = ( position < gradientPositions[1] ) ? 0 : 1;
- float relPos = gradientInterpolate( interpolationModes[index], ( pos - gradientPositions[index] ) / ( gradientPositions[index+1] - gradientPositions[index] ) );
- tr.tint = mix( gradientColors[index], gradientColors[index+1], relPos );
- }
- tr.mono = 0.0;
- return( tr );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gradient3Texture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gradient3Texture.glsllib
deleted file mode 100644
index 7bd6cec7..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gradient3Texture.glsllib
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-texture_return gradient3Texture( in int gradientMode, in float gradientPositions[3], in vec3 gradientColors[3], in int interpolationModes[3], in texture_coordinate_info uvw, in float distortion )
-{
- float position = gradientGetPosition( gradientMode, uvw.position.xy );
- return( gradient3Recolor( gradientPositions, gradientColors, interpolationModes, 0, distortion, position ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gradientGetPosition.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gradientGetPosition.glsllib
deleted file mode 100644
index 4ceece04..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/gradientGetPosition.glsllib
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// calculate the length of the hypotenuse of a right-angle triangle
-float hypot( in float x, in float y )
-{
- // (sqrt( x * x + y * y )) might over- or underflow
- // see http://en.wikipedia.org/wiki/Hypot for details
- x = abs( x );
- y = abs( y );
- float t = min( x, y );
- x = max( x, y );
- t = t/x;
- return( x * sqrt( 1.0 + ( t * t ) ) );
-}
-
-float gradientGetPosition( in int gradientMode, in vec2 xy )
-{
- // clamp to [0,1]
- vec2 tex = xy - floor( xy );
-
- switch( gradientMode )
- {
- case gradient_linear :
- return( tex.x );
- case gradient_squared :
- return( tex.x * tex.x );
- case gradient_box :
- // gradient is based on the distance from the center
- return( max( abs( tex.x - 0.5 ), abs( tex.y - 0.5 ) ) );
- case gradient_diagonal :
- // gradient is based on the distance from the diagonal
- return( sqrt(2.0) * abs( tex.x - tex.y ) );
- case gradient_90_degree :
- // Need to check
- return( 0.0 );
- case gradient_symmetric_90_degree :
- // Need to check
- return( 0.0 );
- case gradient_radial :
- // Distance from center
- return( 2.0 * hypot( tex.x - 0.5, tex.y - 0.5 ) );
- case gradient_360_degree :
- // fall through need to check
- default :
- return( 0.0 );
- }
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/luminance.glsllib b/src/Runtime/ogl-runtime/res/effectlib/luminance.glsllib
deleted file mode 100644
index 067dc184..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/luminance.glsllib
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LUMINANCE_GLSLLIB
-#define LUMINANCE_GLSLLIB
-
-// Luma coefficients according to ITU-R Recommendation BT.709 (http://en.wikipedia.org/wiki/Rec._709)
-const vec3 yCoeff_709 = vec3( 0.2126, 0.7152, 0.0722 );
-
-float luminance( in vec3 v )
-{
- return dot( v, yCoeff_709 );
-}
-
-vec3 RGBToYPbPr( in vec3 v )
-{
- vec3 ypp;
- ypp.x = luminance( v );
- ypp.y = 0.5 * (v.b - ypp.x) / (1.0 - yCoeff_709.b);
- ypp.z = 0.5 * (v.r - ypp.x) / (1.0 - yCoeff_709.r);
-
- return ypp;
-}
-
-vec3 YPbPrToRGB( in vec3 v )
-{
- vec3 outRGB;
- outRGB.x = dot(vec3(1.0, 0.0, 1.575), v);
- outRGB.y = dot(vec3(1.0, -0.187, -0.468), v);
- outRGB.z = dot(vec3(1.0, 1.856, 0.0), v);
-
- return outRGB;
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/miNoise.glsllib b/src/Runtime/ogl-runtime/res/effectlib/miNoise.glsllib
deleted file mode 100644
index 5fbff37d..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/miNoise.glsllib
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 miNoise( in vec3 xyz )
-{
- const float div = 1.0 / 256.0;
-
- ivec3 itmp = ivec3( xyz );
- ivec3 ixyz[3] = ivec3[]( itmp & 0xFF, itmp+1 & 0xFF, itmp+2 & 0xFF );
- vec3 fxyz = xyz - floor( xyz );
-
- vec3 dux, ux;
- dux.z = fxyz.x * div;
- dux.y = div - 2.0 * dux.z;
- dux.x = dux.z - div;
- ux.z = 0.5 * fxyz.x * dux.z;
- ux.y = dux.z + 0.5 * ( div - fxyz.x * dux.z );
- ux.x = ux.z - dux.z + 0.5 * div;
-
- vec3 duy, uy;
- duy.z = fxyz.y;
- duy.y = 1.0 - 2.0 * duy.z;
- duy.x = duy.z - 1.0;
- uy.z = 0.5 * square( duy.z );
- uy.y = duy.z + 0.5 - square( duy.z );
- uy.x = uy.z - duy.z + 0.5;
-
- float duz[3] = float[]( fxyz.z - 1.0, 1.0 - 2.0 * fxyz.z, fxyz.z );
- float uz[3] = float[]( 0.5 * square( fxyz.z ) - fxyz.z + 0.5, fxyz.z + 0.5 - square( fxyz.z ), 0.5 * square( fxyz.z ) );
-
- int xx = random255X( ixyz[0].x );
- int yx = random255Y( ixyz[0].y );
- int zx = random255Z( ixyz[0].z );
- int xy = random255X( ixyz[1].x );
- int yy = random255Y( ixyz[1].y );
- int zy = random255Z( ixyz[1].z );
-
- int xxxy = xx ^ xy;
- int yxxy = yx ^ xy;
- int zxxy = zx ^ xy;
- int xxyy = xx ^ yy;
- int yxyy = yx ^ yy;
- int zxyy = zx ^ yy;
- int xxzy = xx ^ zy;
- int yxzy = yx ^ zy;
- int zxzy = zx ^ zy;
-
- int ixyzxx = ixyz[0].x ^ ixyz[1].x;
- int ixyzyx = ixyz[0].y ^ ixyz[1].x;
- int ixyzzx = ixyz[0].z ^ ixyz[1].x;
- int ixyzxy = ixyz[0].x ^ ixyz[1].y;
- int ixyzyy = ixyz[0].y ^ ixyz[1].y;
- int ixyzzy = ixyz[0].z ^ ixyz[1].y;
- int ixyzxz = ixyz[0].x ^ ixyz[1].z;
- int ixyzyz = ixyz[0].y ^ ixyz[1].z;
- int ixyzzz = ixyz[0].z ^ ixyz[1].z;
-
-
- vec4 ret = vec4( 0.0, 0.0, 0.0, 0.0 );
-
- for ( int i=0 ; i<3 ; i++ )
- {
- int iz = random255Z( ixyz[2][i] );
-
- mat3x3 nf = mat3x3( vec3( float( random255W( xxxy ^ iz ^ random255W( ixyzxx ^ ixyz[2][i] ) ) )
- , float( random255W( yxxy ^ iz ^ random255W( ixyzyx ^ ixyz[2][i] ) ) )
- , float( random255W( zxxy ^ iz ^ random255W( ixyzzx ^ ixyz[2][i] ) ) ) )
- , vec3( float( random255W( xxyy ^ iz ^ random255W( ixyzxy ^ ixyz[2][i] ) ) )
- , float( random255W( yxyy ^ iz ^ random255W( ixyzyy ^ ixyz[2][i] ) ) )
- , float( random255W( zxyy ^ iz ^ random255W( ixyzzy ^ ixyz[2][i] ) ) ) )
- , vec3( float( random255W( xxzy ^ iz ^ random255W( ixyzxz ^ ixyz[2][i] ) ) )
- , float( random255W( yxzy ^ iz ^ random255W( ixyzyz ^ ixyz[2][i] ) ) )
- , float( random255W( zxzy ^ iz ^ random255W( ixyzzz ^ ixyz[2][i] ) ) ) ) );
-
- float fxdz = dot( uy, dux * nf );
- vec3 dy = ux * nf;
- float dz = dot( uy, dy );
-
- ret.x += uz[i] * fxdz;
- ret.y += uz[i] * dot( duy, dy );
- ret.z += duz[i] * dz;
- ret.w += uz[i] * dz;
- }
- return( ret );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/microfacetBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/microfacetBSDF.glsllib
deleted file mode 100644
index 8e489107..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/microfacetBSDF.glsllib
+++ /dev/null
@@ -1,259 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MICROFACET_BSDF_GLSLLIB
-#define MICROFACET_BSDF_GLSLLIB 1
-
-
-float GtermSchlick( in mat3 tanFrame, in vec3 l, in vec3 v, in float roughness )
-{
- float NdotV = clamp(dot(tanFrame[2], v), 0.0, 1.0);
- float NdotL = clamp(dot(tanFrame[2], l), 0.0, 1.0);
- float k = roughness*roughness*0.79788;
-
- float G_V = NdotV / (NdotV * (1.0 + k) + k);
- float G_L = NdotL / (NdotL * (1.0 + k) + k);
-
- return clamp(( G_V * G_L ), 0.0, 1.0);
-}
-
-float GtermGGX( in mat3 tanFrame, in vec3 l, in vec3 v, in float roughness )
-{
- float NdotV = clamp(dot(tanFrame[2], v), 0.0, 1.0);
- float NdotL = clamp(dot(tanFrame[2], l), 0.0, 1.0);
- float k = clamp(roughness*roughness, 0.00, 1.0);
-
- float G_V = NdotV + sqrt( (NdotV - NdotV * k) * NdotV + k );
- float G_L = NdotL + sqrt( (NdotL - NdotL * k) * NdotL + k );
-
- return clamp( 2.0 / ( G_V * G_L ), 0.0, 1.0);
-}
-
-float DtermGGX( in mat3 tanFrame, in vec3 L, in vec3 V, in float roughness )
-{
- float m = clamp(roughness, 0.04, 1.0);
- float m2 = m*m;
-
- vec3 H = normalize(L + V);
- float NdotH = clamp(dot( tanFrame[2], H ), 0.0001, 1.0);
- float NdotH2 = NdotH * NdotH;
-
- float denom = NdotH2 * (m2 - 1.0) + 1.0;
- float D = m2 / (PI * denom * denom);
-
- return max( 0.0, D);
-}
-
-float DtermGGXAniso( in mat3 tanFrame, in vec3 L, in vec3 V, in float roughnessU, float roughnessV )
-{
- float roughU = clamp(roughnessU, 0.04, 1.0);
- float roughV = clamp(roughnessV, 0.04, 1.0);
- vec3 H = normalize(L + V);
- float NdotH = clamp( dot(tanFrame[2], H), 0.0001, 1.0 );
- float m = PI * roughU * roughV;
- float HdotX = clamp( abs(dot(H, tanFrame[0])), 0.0001, 1.0 );
- float HdotY = clamp( abs(dot(H, tanFrame[1])), 0.0001, 1.0 );
-
- float x2 = roughU*roughU;
- float y2 = roughV*roughV;
-
- float D = (HdotX*HdotX/x2) + (HdotY*HdotY/y2) + (NdotH*NdotH);
- D = 1.0 / ( m * D * D );
-
- return max( 0.0, D);
-}
-
-vec4 microfacetBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, float ior,
- in float roughnessU, in float roughnessV, int mode )
-{
- vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
- vec3 H = normalize(L + V);
- float HdotL = clamp(dot(H, L), 0.0, 1.0);
- float NdotL = dot(tanFrame[2], L);
-
- if ( NdotL > 0.0 )
- {
- if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
- {
- float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
- // G term
- //float G = GtermSchlick( tanFrame, L, V, roughness );
- float G = GtermGGX( tanFrame, L, V, roughness );
-
- //float D = DtermGGX( tanFrame, L, V, roughness );
- float D = DtermGGXAniso( tanFrame, L, V, roughnessU, roughnessV );
- rgba.rgb = G * D * NdotL * lightSpecular;
- }
-
- if ( ( mode == scatter_transmit ) || ( mode == scatter_reflect_transmit ) )
- {
- rgba.a = pow(1.0 - clamp(HdotL, 0.0, 1.0), 5.0);
- }
- }
-
- return rgba;
-}
-
-vec4 microfacetBSDFEnvironment( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
-{
- vec3 rgb = vec3( 0.0, 0.0, 0.0 );
-#if !QT3DS_ENABLE_LIGHT_PROBE
- if ( uEnvironmentMappingEnabled )
- {
- float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
- vec3 R = reflect( -viewDir, tanFrame[2] );
- rgb = 0.01 * evalEnvironmentMap( R, roughness );
- rgb = microfacetBSDF( tanFrame, R, viewDir, rgb, 1.0, roughnessU, roughnessV, scatter_reflect ).rgb;
- }
-#endif
- return( vec4( rgb, 1.0 ) );
-}
-
-
-// see http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
-
-float radicalInverse_VdC( uint bits)
-{
- bits = (bits << 16u) | (bits >> 16u);
- bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
- bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
- bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
- bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
- return float(bits) * 2.3283064365386963e-10; // / 0x100000000
- }
-
-vec2 hammersley2d(uint i, uint N)
-{
- return vec2(float(i)/float(N), radicalInverse_VdC(i));
-}
-
-vec2 hammersly[4] = vec2[4] (
- vec2(0.0, 0.0),
- vec2(0.25, 0.5),
- vec2(0.5, 0.25),
- vec2(0.75, 0.75)
- );
-
-vec3 ImportanceGGX( in mat3 tanFrame, vec2 Xi, float roughness , vec3 N )
-{
- float a = roughness * roughness;
- float Phi = 2.0 * PI * Xi.y;
- float CosTheta = (1.0 - Xi.x);
- float SinTheta = sqrt( 1.0 - CosTheta * CosTheta );
-
- vec3 H;
- H.x = SinTheta * cos( Phi );
- H.y = SinTheta * sin( Phi );
- H.z = CosTheta;
-
- // Tangent to world space
- return tanFrame[0] * H.x + tanFrame[1] * H.y + tanFrame[2] * H.z;
-}
-
-float DtermGGXAnisoSampled( in mat3 tanFrame, in vec3 H, in float roughnessU, float roughnessV )
-{
-#if (MATERIAL_IS_NON_DIELECTRIC == 1)
- float roughU = clamp(roughnessU*roughnessU, 0.01, 1.0);
- float roughV = clamp(roughnessV*roughnessV, 0.01, 1.0);
-#else
- float roughU = clamp(roughnessU, 0.02, 1.0);
- float roughV = clamp(roughnessV, 0.02, 1.0);
-#endif
-
- float NdotH = clamp( dot(tanFrame[2], H), 0.0001, 1.0 );
- float m = PI * roughU * roughV;
- float HdotX = clamp( abs(dot(H, tanFrame[0])), 0.0001, 1.0 );
- float HdotY = clamp( abs(dot(H, tanFrame[1])), 0.0001, 1.0 );
-
- float x2 = roughU*roughU;
- float y2 = roughV*roughV;
-
- float pdf = (HdotX*HdotX/x2) + (HdotY*HdotY/y2) + (NdotH*NdotH);
- float D = 1.0 / ( m * pdf * pdf );
-
- return max( 0.0, D);
-}
-
-vec3 sampleEnv(in vec3 L, float pdf, uint sampleCount, float roughness )
-{
- vec2 envMapSize = vec2( textureSize( uEnvironmentTexture, 0 ) );
- float envMapLevels = log2( max( envMapSize.x, envMapSize.y ) );
-
- float a = 0.5*log2( float(envMapSize.x*envMapSize.y) / float(sampleCount) );
- float d = 4.0 * (abs(L.z) + 1.0) * (abs(L.z) + 1.0);
- float b = 0.5*log2( pdf * d );
-
- // convert coord to 2D
- vec2 tc = vec2( ( atan( L.x, -L.z ) + PI ) / ( 2.0 * PI ), acos( -L.y ) / PI );
- float weight = step( 0.0001, roughness );
-
- float lod = max( 0.0, min( (a - b)*weight, envMapLevels ));
-
- return( textureLod( uEnvironmentTexture, tc, lod ).rgb );
-}
-
-vec4 microfacetSampledBSDF( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
-{
- vec3 rgb = vec3( 0.0, 0.0, 0.0 );
-
- float roughness = clamp( calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] ), 0.0, 1.0 );
-
- vec3 R = reflect( -viewDir, tanFrame[2] );
-
- const uint NumSamples = 4u;
- for( uint i = 0u; i < NumSamples; i++ )
- {
- vec2 Xi = hammersly[i]; // pre computed values
- //vec2 Xi = hammersley2d(i, NumSamples);
- vec3 Half = ImportanceGGX( tanFrame, Xi, roughness , tanFrame[2] );
- vec3 H = normalize( Half );
-
- vec3 L = 2.0 * dot( viewDir, Half ) * Half - viewDir;
- float NdotV = clamp( dot( tanFrame[2], viewDir ), 0.0001, 1.0 );
- float NdotR = clamp( dot( tanFrame[2], R ), 0.0, 1.0 );
- float NdotH = clamp( dot( tanFrame[2], H ), 0.0001, 1.0 );
-
- if( NdotV > 0.0001 )
- {
- float G = GtermGGX( tanFrame, L, viewDir, roughness );
- float D = DtermGGXAnisoSampled( tanFrame, H, roughnessU, roughnessV);
-
- vec3 envColor = 0.01 * sampleEnv( L, D, NumSamples, roughness );
-
- rgb += (envColor * G * D * NdotR) / ( 4.0 * NdotV * NdotH);
- }
- }
-
- rgb /= float(NumSamples);
-
- return( vec4( rgb, 1.0 ) );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/monoChannel.glsllib b/src/Runtime/ogl-runtime/res/effectlib/monoChannel.glsllib
deleted file mode 100644
index 5c03a971..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/monoChannel.glsllib
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MONO_CHANNEL_GLSLLIB
-#define MONO_CHANNEL_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-#define mono_alpha 0
-#define mono_average 1
-#define mono_luminance 2
-#define mono_maximum 3
-#endif
-
-float monoChannel( in vec4 t, in int monoSource )
-{
- switch( monoSource )
- {
- case mono_alpha :
- return( t.w );
- case mono_average :
- return( ( t.x + t.y + t.z ) / 3.0 );
- case mono_luminance :
- return( luminance( t.xyz ) );
- case mono_maximum :
- return( max( t.x, max( t.y, t.z ) ) );
- default :
- return( 1.0 );
- }
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/normalizedMix.glsllib b/src/Runtime/ogl-runtime/res/effectlib/normalizedMix.glsllib
deleted file mode 100644
index fc90b46d..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/normalizedMix.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 normalizedMix( in bsdf_component components[1] )
-{
- return( components[0].component );
-}
-
-vec4 normalizedMix( in bsdf_component components[2] )
-{
- float sum = components[0].weight + components[1].weight;
- float invSum = ( sum <= 1.0 ) ? 1.0 : 1.0 / sum;
- return( invSum * ( components[0].weight * components[0].component + components[1].weight * components[1].component ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/perlinNoise.glsllib b/src/Runtime/ogl-runtime/res/effectlib/perlinNoise.glsllib
deleted file mode 100644
index 347386c4..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/perlinNoise.glsllib
+++ /dev/null
@@ -1,234 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// check out implementation from GPU Gems 1 and 2
-
-float fade( in float x )
-{
- return( x * x * x * ( x * ( x * 6.0 - 15.0 ) + 10.0 ));
- //return( x * x * ( 3.0 - 2.0 * x ) );
-}
-
-vec2 fade( in vec2 x )
-{
- return( x * x * x * ( x * ( x * 6.0 - 15.0 ) + 10.0 ));
- //return( x * x * ( 3.0 - 2.0 * x ) );
-}
-
-vec3 fade( in vec3 x )
-{
- return( x * x * x * ( x * ( x * 6.0 - 15.0 ) + 10.0 ));
- //return( x * x * ( 3.0 - 2.0 * x ) );
-}
-
-vec4 fade( in vec4 x )
-{
- return( x * x * x * ( x * ( x * 6.0 - 15.0 ) + 10.0 ));
- //return( x * x * ( 3.0 - 2.0 * x ) );
-}
-
-float influence( in int hash, in float x )
-{
- return( x * texelFetch( randomGradient1D, ivec2(hash, 0), 0 ).x );
-}
-
-float influence( in int hash, in float x, in float y )
-{
- return( dot( vec2( x, y ), texelFetch( randomGradient2D, ivec2(hash, 0), 0 ).xy ) );
-}
-
-float influence( in int hash, in float x, in float y, in float z )
-{
- return( dot( vec3( x, y, z ), texelFetch( randomGradient3D, ivec2(hash, 0), 0 ).xyz ) );
-}
-
-float influence( in int hash, in float x, in float y, in float z, in float w )
-{
- return( dot( vec4( x, y, z, w ), texelFetch( randomGradient4D, ivec2(hash, 0), 0 ) ) );
-}
-
-float perlinNoise( in float pos )
-{
- float floorPos = floor( pos );
- int intPos = int( floorPos );
- float fracPos = pos - floorPos;
-
- return( mix( influence( random255X( intPos ), fracPos ), influence( random255X( intPos+1 ), fracPos - 1.0 ), fade( fracPos ) ) );
-}
-
-float perlinNoise( in vec2 pos )
-{
- vec2 floorPos = floor( pos );
- vec2 fracPos = pos - floorPos;
- vec2 fadedPos = fade( fracPos );
-
- int ax = random255X( int(floorPos.x) );
- int bx = random255X( int(floorPos.x) + 1 );
- int ay = random255Y( int(floorPos.y) );
- int by = random255Y( int(floorPos.y) + 1 );
-
- return( mix( mix( influence( ax^ay, fracPos.x, fracPos.y )
- , influence( bx^ay, fracPos.x - 1.0, fracPos.y ), fadedPos.x )
- , mix( influence( ax^by, fracPos.x, fracPos.y - 1.0 )
- , influence( bx^by, fracPos.x - 1.0, fracPos.y - 1.0 ), fadedPos.x ), fadedPos.y ) );
-}
-
-float perlinNoise( in vec3 pos )
-{
- vec3 floorPos = floor( pos );
- vec3 fracPos = pos - floorPos;
- vec3 fadedPos = fade( fracPos );
-
- int ax = random255X( int(floorPos.x) );
- int bx = random255X( int(floorPos.x) + 1 );
- int ay = random255Y( int(floorPos.y) );
- int by = random255Y( int(floorPos.y) + 1 );
- int az = random255Z( int(floorPos.z) );
- int bz = random255Z( int(floorPos.z) + 1 );
-
- int axay = ax ^ ay;
- int bxay = bx ^ ay;
- int axby = ax ^ by;
- int bxby = bx ^ by;
-
- return( mix( mix( mix( influence( axay^az, fracPos.x, fracPos.y, fracPos.z )
- , influence( bxay^az, fracPos.x - 1.0, fracPos.y, fracPos.z ), fadedPos.x )
- , mix( influence( axby^az, fracPos.x, fracPos.y - 1.0, fracPos.z )
- , influence( bxby^az, fracPos.x - 1.0, fracPos.y - 1.0, fracPos.z ), fadedPos.x ), fadedPos.y )
- , mix( mix( influence( axay^bz, fracPos.x, fracPos.y , fracPos.z - 1.0 )
- , influence( bxay^bz, fracPos.x - 1.0, fracPos.y , fracPos.z - 1.0 ), fadedPos.x )
- , mix( influence( axby^bz, fracPos.x, fracPos.y - 1.0, fracPos.z - 1.0 )
- , influence( bxby^bz, fracPos.x - 1.0, fracPos.y - 1.0, fracPos.z - 1.0 ), fadedPos.x ), fadedPos.y ), fadedPos.z ) );
-}
-
-float perlinNoise( in vec4 pos )
-{
- vec4 floorPos = floor( pos );
- vec4 fracPos = pos - floorPos;
- vec4 fadedPos = fade( fracPos );
-
- int ax = random255X( int(floorPos.x) );
- int bx = random255X( int(floorPos.x) + 1 );
- int ay = random255Y( int(floorPos.y) );
- int by = random255Y( int(floorPos.y) + 1 );
- int az = random255Z( int(floorPos.z) );
- int bz = random255Z( int(floorPos.z) + 1 );
- int aw = random255W( int(floorPos.w) );
-
- int axay = ax ^ ay;
- int bxay = bx ^ ay;
- int axby = ax ^ by;
- int bxby = bx ^ by;
-
- float result[2];
- for ( int i=0 ; i<2 ; i++ )
- {
- int azaw = az ^ aw;
- int bzaw = bz ^ aw;
-
- result[i] = mix( mix( mix( influence( axay^azaw, fracPos.x, fracPos.y, fracPos.z, fracPos.w )
- , influence( bxay^azaw, fracPos.x - 1.0, fracPos.y, fracPos.z, fracPos.w ), fadedPos.x )
- , mix( influence( axby^azaw, fracPos.x, fracPos.y - 1.0, fracPos.z, fracPos.w )
- , influence( bxby^azaw, fracPos.x - 1.0, fracPos.y - 1.0, fracPos.z, fracPos.w ), fadedPos.x ), fadedPos.y )
- , mix( mix( influence( axay^bzaw, fracPos.x, fracPos.y, fracPos.z - 1.0, fracPos.w )
- , influence( bxay^bzaw, fracPos.x - 1.0, fracPos.y, fracPos.z - 1.0, fracPos.w ), fadedPos.x )
- , mix( influence( axby^bzaw, fracPos.x, fracPos.y - 1.0, fracPos.z - 1.0, fracPos.w )
- , influence( bxby^bzaw, fracPos.x - 1.0, fracPos.y - 1.0, fracPos.z - 1.0, fracPos.w ), fadedPos.x ), fadedPos.y ), fadedPos.z );
- aw = random255W( int(floorPos.w) + 1 );
- fracPos.w -= 1.0;
- }
- return( mix( result[0], result[1], fadedPos.w ) );
-}
-
-float summedPerlinNoise( in vec3 pos, in int terms, in bool absNoise )
-{
- float sum = 0.0;
- float weight = 1.0;
- vec3 p = pos;
- while ( terms-- != 0 )
- {
- float noise = perlinNoise( p );
- sum += weight * ( absNoise ? abs(noise) : noise );
- p += p;
- weight *= 0.5;
- }
- return( sum );
-}
-
-float summedPerlinNoise( in vec4 pos, in int terms, in bool absNoise )
-{
- float sum = 0.0;
- float weight = 1.0;
- vec4 p = pos;
- while ( terms-- != 0 )
- {
- float noise = perlinNoise( p );
- sum += weight * ( absNoise ? abs(noise) : noise );
- p += p;
- weight *= 0.5;
- }
- return( sum );
-}
-
-float perlinNoise( in vec3 pos, in float time, in int terms, in vec3 turbulenceWeight, in bool absoluteNoise, in bool applyMarble
- , in bool applyDent, in float noiseBands, in float noiseThresholdHigh, in float noiseThresholdLow )
-{
- float noise = ( time == 0.0 ) ? summedPerlinNoise( pos, terms, absoluteNoise ) : summedPerlinNoise( vec4( pos, time ), terms, absoluteNoise );
- if ( turbulenceWeight != vec3( 0.0, 0.0, 0.0 ) )
- {
- noise = sin( dot( pos, turbulenceWeight ) + noise );
- }
- if ( ! absoluteNoise )
- {
- noise = 0.5 * noise + 0.5; // scale [-1,1] to [0,1]
- }
- if ( applyMarble )
- {
- noise = cos( pos.x + 5.0 * noise ); // classic Perlin marble function, with magic 5.0
- }
- if ( applyDent )
- {
- noise = cube( noise );
- }
- if ( noiseBands != 1.0 )
- {
- // Create banding/stripes by using the fraction component only
- noise *= noiseBands;
- noise -= floor( noise );
- noise += pow( 1.0 - noise, 20.0 );
- }
- if ( noiseThresholdLow < noiseThresholdHigh )
- {
- // clamp the noise
- noise = clamp( ( noise - noiseThresholdLow ) / ( noiseThresholdHigh - noiseThresholdLow ), 0.0, 1.0 );
- }
- return( noise );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/perlinNoiseBumpTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/perlinNoiseBumpTexture.glsllib
deleted file mode 100644
index 6e0982f3..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/perlinNoiseBumpTexture.glsllib
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec3 perlinNoiseBumpTexture( in texture_coordinate_info uvw, in float factor, in float size, in bool applyMarble
- , in bool applyDent, in float noisePhase, in int noiseLevels, in bool absoluteNoise, in vec3 noiseDistortion
- , in float noiseThresholdHigh, in float noiseThresholdLow, in float noiseBands, in vec3 normal )
-{
- float delta = 0.1 / noiseBands;
- vec3 pos = uvw.position / size;
-
- float r0 = perlinNoise( pos, noisePhase, noiseLevels, noiseDistortion, absoluteNoise
- , applyMarble, applyDent, noiseBands, noiseThresholdLow, noiseThresholdHigh );
- float r1 = perlinNoise( pos + delta * uvw.tangent_u, noisePhase, noiseLevels, noiseDistortion, absoluteNoise
- , applyMarble, applyDent, noiseBands, noiseThresholdLow, noiseThresholdHigh );
- float r2 = perlinNoise( pos + delta * uvw.tangent_v, noisePhase, noiseLevels, noiseDistortion, absoluteNoise
- , applyMarble, applyDent, noiseBands, noiseThresholdLow, noiseThresholdHigh );
- float r3 = perlinNoise( pos + delta * normal, noisePhase, noiseLevels, noiseDistortion, absoluteNoise
- , applyMarble, applyDent, noiseBands, noiseThresholdLow, noiseThresholdHigh );
-
- return( normalize( normal - factor * ( ( r1 - r0 ) * uvw.tangent_u + ( r2 - r0 ) * uvw.tangent_v + ( r3 - r0 ) * normal ) ) );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/perlinNoiseTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/perlinNoiseTexture.glsllib
deleted file mode 100644
index d968403e..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/perlinNoiseTexture.glsllib
+++ /dev/null
@@ -1,11 +0,0 @@
-texture_return perlinNoiseTexture( in texture_coordinate_info uvw, in vec3 color1, in vec3 color2, in float size, in bool applyMarble, in bool applyDent
- , in float noisePhase, in int noiseLevels, in bool absoluteNoise, in vec3 noiseDistortion
- , in float noiseThresholdHigh, in float noiseThresholdLow, in float noiseBands )
-{
- float noise = perlinNoise( uvw.position / size, noisePhase, noiseLevels, noiseDistortion, absoluteNoise
- , applyMarble, applyDent, noiseBands, noiseThresholdLow, noiseThresholdHigh );
- texture_return tr;
- tr.tint = mix( color1, color2, noise );
- tr.mono = average( tr.tint );
- return( tr );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/physGlossyBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/physGlossyBSDF.glsllib
deleted file mode 100644
index ece836b5..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/physGlossyBSDF.glsllib
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PHYS_GLOSSY_BSDF_GLSLLIB
-#define PHYS_GLOSSY_BSDF_GLSLLIB 1
-
-float sqr(float v)
-{
- return v*v;
-}
-
-float Gterm( float cosTheta, float roughness )
-{
- float k = roughness * 0.31830988618; // roughness / pi
- return clamp( ( cosTheta / (cosTheta*(1.0-k) + k) + (1.0 - k*k) ) * 0.5, 0.0, 1.0 );
-}
-
-
-// PKC -- I came up with an anisotropic microfacet BSDF that has some superficial similarity to GGX in
-// its appearance, but is far simpler and more compact in its implementation. It uses a Cauchy-like lobe
-// shape and because it has an analytic solution to its antiderivative, we can compute the integral given
-// the support boundaries. It's also possible to importance sample at perfect efficiency.
-// This is generally a good choice for any material which has a polish coating to it.
-// TODO : The way roughness scales with this BSDF is roughly equivalent to roughness^2 would affect Ward.
-// It's debatable whether we want that to be done as a sqrt here or as square in Ward.
-vec4 kggxGlossyBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, float ior,
- in float roughnessU, in float roughnessV, int mode )
-{
- vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
- vec3 H = normalize(L + V);
-
- // NOTE : This BSDF allows roughness up to 2.0 which allows it
- // to trend partially into Oren-Nayar diffuse territory, but we should
- // assume that anything that falls under "glossy" should still be
- // in the range of 0..1
- float ax = clamp(roughnessU, 0.0001, 2.0);
- float ay = clamp(roughnessV, 0.0001, 2.0);
-
- float NdotL = dot(tanFrame[2], L);
- float HdotL = clamp(dot(H, L), 0.0, 1.0);
-
- // if (0.0 < NdotL)
- // {
- vec3 Haf = L + V;
-
- float HdotN = clamp( dot(H, tanFrame[2]), 0.0001, 1.0 );
- float HdotX = clamp( abs(dot(H, tanFrame[0])), 0.0001, 1.0 );
- float HdotY = clamp( abs(dot(H, tanFrame[1])), 0.0001, 1.0 );
-
- float sigma = sqrt(ax * ay);
- float sigma2 = ax * ay * HdotN;
-
- float thetaI = acos( dot(V, tanFrame[2]) );
- float maxThetaI = (thetaI + 1.57079632679) * 0.5;
- float minThetaI = (thetaI - 1.57079632679) * 0.5;
- float range = atan(maxThetaI / sigma) - atan(minThetaI / sigma);
- range = max( range, ax*ay );
-
- if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
- {
- float PDF = sigma2 / (sigma2 + sqr(HdotX / ax) + sqr(HdotY / ay));
- PDF *= dot(Haf, Haf) / (4.71238898038 * sqr(dot(Haf, L)) * ax*ay * sigma * sqr(range));
-
- rgba.rgb = Gterm(HdotL, sigma) * lightSpecular * PDF * max(NdotL, 0.0);
- }
- if ( ( mode == scatter_transmit ) || ( mode == scatter_reflect_transmit ) )
- {
- rgba.a = pow(1.0 - clamp(HdotL, 0.0, 1.0), 5.0);
- }
-// }
- return rgba;
-}
-
-vec4 kggxGlossyDefaultMtl( in vec3 normal, in vec3 tangent, in vec3 L, in vec3 V, in vec3 lightSpecular,
- in vec3 materialSpecular, in float roughU, in float roughV )
-{
- vec3 bitan = normalize(cross(normal, tangent));
- mat3 tanFrame = mat3( normalize(cross( bitan, normal) ), bitan, normal );
- return vec4(materialSpecular, 1.0) * kggxGlossyBSDF( tanFrame, L, V, lightSpecular, 1.5, roughU, roughV, scatter_reflect );
-}
-
-// To be exact, this is not the Ward lobe as Ward originally described (there are a few flaws in
-// the original paper, which had spawned half a dozen corrective measures as papers of their own).
-// This is a Ward-Duer variant with Geisler-Moroder's modified normalization factor which serves
-// to bound the albedo.
-vec4 wardGlossyBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, in float ior,
- in float roughnessU, in float roughnessV, int mode )
-{
- vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
- vec3 H = normalize(L + V);
-
- // specular
- float ax = clamp(roughnessU, 0.0001, 1.0);
- float ay = clamp(roughnessV, 0.0001, 1.0);
-
- float NdotL = dot(tanFrame[2], L);
- float HdotL = clamp(dot(H, L), 0.0, 1.0);
-
-// if (0.0 < NdotL)
-// {
- vec3 Haf = L + V;
-
- float HdotN = clamp( dot(H, tanFrame[2]), 0.0001, 1.0 );
- float HdotX = clamp( abs(dot(H, tanFrame[0])), 0.0001, 1.0 );
- float HdotY = clamp( abs(dot(H, tanFrame[1])), 0.0001, 1.0 );
-
- if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
- {
- float exponent = -(sqr(HdotX/ax) + sqr(HdotY/ay));
- exponent /= sqr(HdotN);
- float PDF = exp(exponent) / (4.0 * 3.1415926535 * ax * ay);
- PDF *= 4.0 * dot(Haf, Haf) / sqr(sqr(dot(Haf,tanFrame[2])));
-
- rgba.rgb = Gterm(HdotL, sqrt(ax * ay)) * lightSpecular * PDF * max(NdotL, 0.0);
- }
- if ( ( mode == scatter_transmit ) || ( mode == scatter_reflect_transmit ) )
- {
- rgba.a = pow(1.0 - clamp(HdotL, 0.0, 1.0), 5.0);
- }
-// }
- return rgba;
-}
-
-vec4 wardGlossyDefaultMtl( in vec3 normal, in vec3 tangent, in vec3 L, in vec3 V, in vec3 lightSpecular,
- in vec3 materialSpecular, in float roughU, in float roughV )
-{
- vec3 bitan = normalize(cross(normal, tangent));
- mat3 tanFrame = mat3( normalize(cross( bitan, normal) ), bitan, normal );
- return vec4(materialSpecular, 1.0) * wardGlossyBSDF( tanFrame, L, V, lightSpecular, 1.5, roughU, roughV, scatter_reflect );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/random255.glsllib b/src/Runtime/ogl-runtime/res/effectlib/random255.glsllib
deleted file mode 100644
index ef586a78..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/random255.glsllib
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// random [0..255] calculated by some simple Linear Congruential Generator (LCG)
-// Verfied, that each function is just a permutation of {0,...,255}, that is, with 0<=x<=255, each value in [0,255] is returned once
-int random255X( in int x )
-{
- return( ( ( 8365 * ( x & 0xFF ) + 32285 ) >> 0 ) & 0xFF );
-}
-
-int random255Y( in int x )
-{
- return( ( ( 3152 * ( x & 0xFF ) + 11819 ) >> 4 ) & 0xFF );
-}
-
-int random255Z( in int x )
-{
- return( ( ( 119 * ( x & 0xFF ) + 18747 ) >> 0 ) & 0xFF );
-}
-
-int random255W( in int x )
-{
- return( ( ( 26814 * ( x & 0xFF ) + 9642 ) >> 1 ) & 0xFF );
-}
-
-ivec3 random255XYZ( in ivec3 xyz )
-{
- return( ivec3( random255X( xyz.x ), random255Y( xyz.y ), random255Z( xyz.z ) ) );
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/refraction.glsllib b/src/Runtime/ogl-runtime/res/effectlib/refraction.glsllib
deleted file mode 100644
index f961c50e..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/refraction.glsllib
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// this is entirly phiysical incorrect
-// We just use this to fake distortion when we have no environment available
-// The displacement is calculated on ior
-vec3 refraction( in sampler2D sampler, in float materialIOR )
-{
- vec3 displace = fresnel( viewDir, vec3( materialIOR ));
-
- float xdir = abs( viewDir.x );
- float ydir = abs( viewDir.y );
-
- vec2 texSize = vec2( textureSize( sampler, 0 ) );
- vec2 newUV = vec2(gl_FragCoord.xy/texSize);
- if ( xdir > ydir)
- {
- newUV = ( viewDir.x > 0.0) ? newUV + displace.xy : newUV - displace.xy;
- }
- else
- {
- newUV = ( viewDir.y > 0.0) ? newUV - displace.xy : newUV + displace.xy;
- }
-
- vec3 refractColor = texture( sampler, newUV ).rgb;
-
- return refractColor;
-}
-
-// This should really not be used, but it's there for the sake of testing.
-vec3 refractBlur( in sampler2D sampler, in vec3 viewDir, in float materialIOR, in float blurWidth )
-{
- // This is really terrible, but at least is a little better than
- vec3 displace = viewDir * materialIOR;
-
- vec2 texSize = vec2( textureSize( sampler, 0 ) );
- texSize = vec2(1.0) / texSize;
- vec2 newUV = vec2(gl_FragCoord.xy * texSize);
- newUV += displace.xy * 0.005;
-
- //vec3 refractColor = texture( sampler, newUV ).rgb;
- vec3 refractColor = vec3(0);
- int sz = int(ceil(blurWidth));
- float wtsum = 0.0;
-
- for (int y = -sz; y <= sz; ++y)
- {
- for (int x = -sz; x <= sz; ++x)
- {
- float wt = float(x*x + y*y) / (blurWidth * 0.5);
- wt = exp2(-wt);
- //refractColor += wt * textureOffset( sampler, newUV, ivec2(x, y) ).rgb;
- vec2 uvOfs = vec2(x, y) * texSize;
- refractColor += wt * texture( sampler, newUV+uvOfs).rgb;
- wtsum += wt;
- }
- }
-
- return refractColor / wtsum;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/rotationTranslationScale.glsllib b/src/Runtime/ogl-runtime/res/effectlib/rotationTranslationScale.glsllib
deleted file mode 100644
index 78bb8dd1..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/rotationTranslationScale.glsllib
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef ROTATION_TRANSLATION_SCALE_GLSLLIB
-#define ROTATION_TRANSLATION_SCALE_GLSLLIB
-
-mat4 rotationTranslationScale( in vec3 rotation, in vec3 translation, in vec3 scaling )
-{
- mat4 st = mat4( scaling.x, 0.0, 0.0, 0.0
- , 0.0, scaling.y, 0.0, 0.0
- , 0.0, 0.0, scaling.z, 0.0
- , translation.x - 0.5, translation.y - 0.5, translation.z - 0.5, 1.0 );
- vec3 s = sin( rotation );
- vec3 c = cos( rotation );
- mat4 r = mat4( c.y * c.z, -c.x * s.z + s.x * s.y * c.z, s.x * s.z + c.x * s.y * c.z, 0.0
- , c.y * s.z, c.x * c.z + s.x * s.y * s.z, -s.x * c.z + c.x * s.y * s.z, 0.0
- , -s.y , s.x * c.y , c.x * c.y , 0.0
- , 0.5 , 0.5 , 0.5 , 1.0 );
- return( st * r );
-}
-
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/sampleArea.glsllib b/src/Runtime/ogl-runtime/res/effectlib/sampleArea.glsllib
deleted file mode 100644
index 01f3a749..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/sampleArea.glsllib
+++ /dev/null
@@ -1,180 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SAMPLE_AREA_GLSLLIB
-#define SAMPLE_AREA_GLSLLIB 1
-
-#include "funcareaLightVars.glsllib"
-#include "funccalculateDiffuseAreaOld.glsllib"
-#include "funcsampleAreaGlossyDefault.glsllib"
-
-float rand1d(vec2 n)
-{
- return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);
-}
-
-vec3 quatRotate( vec4 q, vec3 v )
-{
- return v + 2.0 * cross( cross( v, q.xyz ) + q.w * v, q.xyz );
-}
-
-vec3 lightUVToRay( in vec3 pos, in vec3 lightPos, in mat3 lightFrame, in float width, in float height, in vec2 uv )
-{
- width *= dot(lightFrame[0], lightFrame[0]);
- height *= dot(lightFrame[1], lightFrame[1]);
-
- vec3 hitPos = lightPos + (uv.x - 0.5) * width * lightFrame[0] + (uv.y - 0.5) * height * lightFrame[1];
- return normalize(hitPos - pos);
-}
-
-// This is usable only for planar rectangular lights. Will need to break this down into different paths for different shapes.
-float getUVHitBounds( in vec3 pos, in mat3 lightFrame, in vec3 lightPos, in float width, in float height, in vec3 V0, in vec3 V1, in vec3 V2, in vec3 V3, out vec2 UVmin, out vec2 UVmax )
-{
- float d0 = dot( lightPos, lightFrame[2] );
- float d1 = dot( pos, lightFrame[2] );
-
- // If the point is behind the light, it can't be illuminated.
- if (d0 < d1)
- {
- UVmin = vec2( -1.0, -1.0 );
- UVmax = vec2( -1.0, -1.0 );
- return 0.0;
- }
-
- // Compute where all the rays of the light beam hit the light plane
- float t[4];
- vec3 v[4];
-
- v[0] = V0; v[1] = V1; v[2] = V2; v[3] = V3;
- t[0] = (d0 - d1) / dot(V0, lightFrame[2]);
- t[1] = (d0 - d1) / dot(V1, lightFrame[2]);
- t[2] = (d0 - d1) / dot(V2, lightFrame[2]);
- t[3] = (d0 - d1) / dot(V3, lightFrame[2]);
-
- UVmin = vec2(1e6, 1e6);
- UVmax = vec2(-1e6, -1e6);
-
- // If any of them are "negative" relative to the ray direction
- // We don't want to consider them.
- bool weight[4];
- float wtsum = 0.0;
- weight[0] = (t[0] > 0.0);
- weight[1] = (t[1] > 0.0);
- weight[2] = (t[2] > 0.0);
- weight[3] = (t[3] > 0.0);
-
- width *= dot(lightFrame[0], lightFrame[0]);
- height *= dot(lightFrame[1], lightFrame[1]);
-
- for (int i = 0; i < 4; ++i)
- {
- vec3 curPos = pos + v[i] * t[i];
- curPos -= lightPos;
- vec2 curUV = vec2( dot(curPos, lightFrame[0]) / width, dot(curPos, lightFrame[1]) / height ) + vec2(0.5);
-
- UVmin = min(UVmin, curUV); UVmax = max(UVmax, curUV);
- wtsum += weight[i] ? 0.25 : 0.0;
- }
-
- return wtsum;
-}
-
-// Shooting a narrow beam, and then scaling up that beam based on the actual roughness
-vec4 sampleAreaGlossy( in mat3 tanFrame, in vec3 pos, in int lightIdx, in vec3 viewDir, in float roughU, in float roughV )
-{
- float sigmaU = clamp( 0.5 * roughU, 0.005, 0.5 );
- float sigmaV = clamp( 0.5 * roughV, 0.005, 0.5 );
- vec2 UVset[5];
-
- mat3 lightFrame = mat3( arealights[lightIdx].right.xyz, arealights[lightIdx].up.xyz, -arealights[lightIdx].direction.xyz );
-
- float thetaI = acos( dot(viewDir, lightFrame[2]) );
- vec2 minMaxThetaH = vec2( (thetaI - 1.5707) * 0.5,
- (thetaI + 1.5707) * 0.5 );
- vec4 sinCosThetaH = vec4( abs(sin(minMaxThetaH)), abs(cos(minMaxThetaH)) );
-
- // First thing we do is compute a small-scale version of the ray hit for a very tiny roughness
- // then we scale that up based on the _actual_ roughness.
- float wt = computeMicroHit( pos, tanFrame, arealights[lightIdx].position.xyz, lightFrame,
- arealights[lightIdx].right.w, arealights[lightIdx].up.w, viewDir, UVset );
- UVset[0] -= UVset[4]; UVset[1] -= UVset[4];
- UVset[2] -= UVset[4]; UVset[3] -= UVset[4];
-
- UVset[0] *= mix(1.0, sinCosThetaH.y / 0.005, sigmaU); UVset[1] *= mix(1.0, sinCosThetaH.x / 0.005, sigmaU);
- UVset[2] *= mix(1.0, sinCosThetaH.y / 0.005, sigmaV); UVset[3] *= mix(1.0, sinCosThetaH.x / 0.005, sigmaV);
-
- UVset[0] += UVset[4]; UVset[1] += UVset[4];
- UVset[2] += UVset[4]; UVset[3] += UVset[4];
-
- vec2 UVmin = UVset[4], UVmax = UVset[4];
- vec2 cminUV, cmaxUV;
- UVmin = min(UVmin, UVset[0]); UVmax = max(UVmax, UVset[0]);
- UVmin = min(UVmin, UVset[1]); UVmax = max(UVmax, UVset[1]);
- UVmin = min(UVmin, UVset[2]); UVmax = max(UVmax, UVset[2]);
- UVmin = min(UVmin, UVset[3]); UVmax = max(UVmax, UVset[3]);
-
- cminUV = clamp( UVmin, vec2(0.0), vec2(1.0) );
- cmaxUV = clamp( UVmax, vec2(0.0), vec2(1.0) );
-
- vec2 hitScale = (cmaxUV - cminUV);
- vec2 fullScale = (UVmax - UVmin);
- float intensity = ( hitScale.x * hitScale.y ) / max( fullScale.x * fullScale.y, 0.0001 );
-
- return vec4( wt * intensity );
-}
-
-vec4 sampleAreaDiffuse( in mat3 tanFrame, in vec3 pos, in int lightIdx )
-{
- float intensity = 0.0;
- vec3 finalDir;
- intensity = calculateDiffuseAreaOld( arealights[lightIdx].direction.xyz, arealights[lightIdx].position.xyz,
- arealights[lightIdx].up, arealights[lightIdx].right, pos, finalDir );
- intensity *= clamp( dot(finalDir, tanFrame[2]), 0.0, 1.0 );
- return vec4( intensity );
-}
-
-vec4 sampleAreaDiffuseTransmissive( in mat3 tanFrame, in vec3 pos, in int lightIdx, in vec4 transmissiveColor, in float translucentFalloff, float lightWrap )
-{
- float intensity = 0.0;
- vec3 finalDir;
- intensity = calculateDiffuseAreaOld( arealights[lightIdx].direction.xyz, arealights[lightIdx].position.xyz,
- arealights[lightIdx].up, arealights[lightIdx].right, pos, finalDir );
- intensity *= clamp( dot(finalDir, -tanFrame[2]), 0.0, 1.0 );
-
- float l = 0.2126 * transmissiveColor.r + 0.7152 * transmissiveColor.g + 0.0722 * transmissiveColor.b;
-
- float I = max( 0.0, ((dot(finalDir, -tanFrame[2]) + lightWrap)/ (1.0 + lightWrap)) );
- float translucent_thickness = l * l;
- float translucent_thickness_exp = exp( translucent_thickness * translucentFalloff) * I;
-
- return vec4( translucent_thickness_exp * intensity );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/sampleLight.glsllib b/src/Runtime/ogl-runtime/res/effectlib/sampleLight.glsllib
deleted file mode 100644
index 05ad5b4b..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/sampleLight.glsllib
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SAMPLE_LIGHT_GLSLLIB
-#define SAMPLE_LIGHT_GLSLLIB
-
-#define MAX_NUM_SHADOWS 8
-
-#ifndef QT3DS_ENABLE_SSM
-#define QT3DS_ENABLE_SSM 0
-#endif
-
-#include "SSAOCustomMaterial.glsllib"
-#if QT3DS_ENABLE_SSM
-#include "shadowMapping.glsllib"
-#endif
-
-#include "funcsampleLightVars.glsllib"
-
-#if QT3DS_ENABLE_SSM
-uniform sampler2D shadowMaps[MAX_NUM_SHADOWS];
-uniform samplerCube shadowCubes[MAX_NUM_SHADOWS];
-uniform int uNumShadowMaps;
-uniform int uNumShadowCubes;
-#endif
-
-void sampleLight(in LightSource light,
- in vec3 pos,
- out vec3 wi,
- out vec3 opAmbient,
- out vec3 opDiffuse,
- out vec3 opSpecular)
-{
- float att = 1.0;
- if (light.position.w == 0.0) // directional light
- {
- wi = normalize(light.position.xyz);
-#if QT3DS_ENABLE_SSM
- if ( light.shadowIdx >= 0 )
- att *= sampleOrthographic( shadowMaps[light.shadowIdx], light.shadowControls, light.shadowView, pos, vec2(1.0, light.shadowControls.z) );
-#endif
- }
- else if (light.width > 0.01 && light.height > 0.01) // area light
- {
- // This approach is based on the 1994 Tech Report by James Arvo --
- // The Irradiance Jacobian for Partially Occluded Polyhedral Sources
- // The nice thing about this approach is that it extends to arbitrary geometry (if we choose to support it),
- // and accounts for distance & geometric attenuation automatically.
- // Downsides -- only really works for diffuse reflection, does not account properly for an area light that
- // intersects its receiver, in which case it illuminates as if the light source is two-sided Lambertian emitter.
- vec3 v0 = light.position.xyz - (light.right.xyz * light.width * 0.5) - (light.up.xyz * light.height * 0.5);
- vec3 v1 = light.position.xyz - (light.right.xyz * light.width * 0.5) + (light.up.xyz * light.height * 0.5);
- vec3 v2 = light.position.xyz + (light.right.xyz * light.width * 0.5) + (light.up.xyz * light.height * 0.5);
- vec3 v3 = light.position.xyz + (light.right.xyz * light.width * 0.5) - (light.up.xyz * light.height * 0.5);
-
- v0 = normalize( v0 - pos ); v1 = normalize( v1 - pos ); v2 = normalize( v2 - pos ); v3 = normalize( v3 - pos );
-
- float a01 = acos( clamp( dot(v0, v1), -1.0, 1.0 ) );
- float a12 = acos( clamp( dot(v1, v2), -1.0, 1.0 ) );
- float a23 = acos( clamp( dot(v2, v3), -1.0, 1.0 ) );
- float a30 = acos( clamp( dot(v3, v0), -1.0, 1.0 ) );
-
- wi = vec3( 0.0 );
- wi -= normalize(cross( v0, v1 )) * a01;
- wi -= normalize(cross( v1, v2 )) * a12;
- wi -= normalize(cross( v2, v3 )) * a23;
- wi -= normalize(cross( v3, v0 )) * a30;
-
- att = length(wi) * 0.15915494309; // solid angle / 2*pi
- wi = normalize(wi);
- att *= clamp( dot( pos - light.position.xyz, light.direction.xyz ), 0.0, 1.0 );
-#if QT3DS_ENABLE_SSM
- if ( light.shadowIdx >= 0 )
- att *= sampleCubemap( shadowCubes[light.shadowIdx], light.shadowControls, light.shadowView, light.position.xyz, pos, vec2(1.0, light.shadowControls.z) );
-#endif
- }
- else // point or spot light
- {
- wi = light.position.xyz - pos;
- float dist = length(wi);
- wi = wi / dist; // == normalize(wi);
- att = 1.0 / (light.constantAttenuation + (light.linearAttenuation + light.quadraticAttenuation * dist) * dist);
- /*
- if (light.spotCutoff < 180.0) // spot light
- {
- float spot = max(0.0, dot(wi, -light.direction.xyz));
- att *= (spot >= cos(light.spotCutoff * PI / 180.0)) ? pow(spot, light.spotExponent) : 0.0;
- }
- */
-#if QT3DS_ENABLE_SSM
- if ( light.shadowIdx >= 0 )
- att *= sampleCubemap( shadowCubes[light.shadowIdx], light.shadowControls, light.shadowView, light.position.xyz, pos, vec2(1.0, light.shadowControls.z) );
-#endif
- }
- float shadow = customMaterialShadow( -light.direction.xyz, pos );
- opAmbient = att * light.ambient.xyz;
- opDiffuse = att * shadow * light.diffuse.xyz;
- opSpecular = att * shadow * light.specular.xyz;
-}
-
-#include "sampleArea.glsllib"
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/sampleProbe.glsllib b/src/Runtime/ogl-runtime/res/effectlib/sampleProbe.glsllib
deleted file mode 100644
index 6556e51c..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/sampleProbe.glsllib
+++ /dev/null
@@ -1,473 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SAMPLE_PROBE_GLSLLIB
-#define SAMPLE_PROBE_GLSLLIB 1
-
-uniform sampler2D light_probe;
-uniform vec4 light_probe_props;
-uniform vec4 light_probe_rotation;
-uniform vec4 light_probe_offset; // light_probe_offset.w = number of mipmaps
-
-#if QT3DS_ENABLE_LIGHT_PROBE_2
-uniform sampler2D light_probe2;
-uniform vec4 light_probe2_props;
-#endif
-
-#if QT3DS_ENABLE_IBL_FOV
-uniform vec4 light_probe_opts;
-#endif
-
-float noise1d(vec2 n)
-{
- return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);
-}
-
-mat3 orthoNormalize( in mat3 tanFrame )
-{
- mat3 outMat;
- outMat[0] = normalize( cross( tanFrame[1], tanFrame[2] ) );
- outMat[1] = normalize( cross( tanFrame[2], outMat[0] ) );
- outMat[2] = tanFrame[2];
-
- return outMat;
-}
-
-mat3 tangentFrame( vec3 N, vec3 p )
-{
- // get edge vectors of the pixel triangle
- vec3 dp1 = dFdx( p );
- vec3 dp2 = dFdy( p );
- // Using dPdu and dPdv would be nicer, but the nature of our materials
- // are not ones with intrinsic UVs, so we can't really go there.
-// vec2 duv1 = dFdx( uv );
-// vec2 duv2 = dFdy( uv );
-
- // solve the linear system
- vec3 dp2perp = cross( dp2, N );
- vec3 dp1perp = cross( N, dp1 );
-// vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
-// vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
-
- vec3 T = normalize(dp1perp);
- vec3 B = normalize(dp2perp);
- return mat3( T , B , N );
-}
-
-vec2 transformSample( vec2 origUV, vec4 probeRot, vec2 probeOfs )
-{
- vec2 retUV;
- retUV.x = dot( vec3(origUV, 1.0), vec3(probeRot.xy, probeOfs.x) );
- retUV.y = dot( vec3(origUV, 1.0), vec3(probeRot.zw, probeOfs.y) );
- return retUV;
-}
-
-// This is broken out into its own routine so that if we get some other
-// format image than a lat-long, then we can account for that by changing
-// the code here alone.
-vec2 getProbeSampleUV( vec3 smpDir, vec4 probeRot, vec2 probeOfs )
-{
- vec2 smpUV;
-
-#if QT3DS_ENABLE_IBL_FOV
- smpUV = vec2(atan(smpDir.x, smpDir.z), asin(smpDir.y));
- // assume equirectangular HDR spherical map (instead of cube map) and warp sample
- // UV coordinates accordingly
- smpUV *= 2.0 * vec2(0.1591596371160, 0.318319274232054);
- // Default FOV is 180 deg = pi rad. Narrow the FOV
- // by scaling texture coordinates by the ratio of
- // incoming FOV to 180 degrees default
- smpUV *= 3.14159265358 / light_probe_opts.x;
-#else
- smpUV.x = atan( smpDir.x, smpDir.z) / 3.14159265359;
- smpUV.y = 1.0 - (acos(smpDir.y) / 1.57079632679);
-#endif
- smpUV = transformSample( smpUV.xy * 0.5, probeRot, probeOfs ) + vec2(0.5, 0.5);
-
- return smpUV;
-}
-
-vec4 getTopLayerSample( vec3 inDir, float lodShift, vec3 lodOffsets )
-{
-#if QT3DS_ENABLE_LIGHT_PROBE_2
- if ( light_probe2_props.w < 0.5 )
- return vec4(0.0, 0.0, 0.0, 0.0);
-
- vec2 smpUV = getProbeSampleUV( inDir, vec4(1.0, 0.0, 0.0, 1.0), light_probe_props.xy );
- smpUV.x -= 0.5;
- smpUV.x *= light_probe2_props.x;
- smpUV.x += light_probe2_props.y;
-
- vec4 retVal = 0.4 * textureLod( light_probe2, smpUV , lodShift );
- retVal += 0.2 * textureLod( light_probe2, smpUV , lodShift+lodOffsets.x );
- retVal += 0.3 * textureLod( light_probe2, smpUV , lodShift+lodOffsets.y );
- retVal += 0.1 * textureLod( light_probe2, smpUV , lodShift+lodOffsets.z );
- return retVal;
-#else
- return vec4(0.0, 0.0, 0.0, 0.0);
-#endif
-}
-
-vec3 getProbeSample( vec3 smpDir, float lodShift, vec3 normal )
-{
- vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
- return textureLod( light_probe, smpUV , lodShift ).xyz;
-}
-
-vec3 getProbeWeightedSample( vec3 smpDir, float lodShift, float roughness, vec3 normal )
-{
- // This gives us a weighted sum that approximates the total filter support
- // of the full-blown convolution.
- vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
- float wt = 1.0;
-
-#if QT3DS_ENABLE_IBL_FOV
- wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.x));
- wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.y));
- wt = min(wt, 1.0 - smoothstep(1.0 - roughness*0.25, 1.0 + roughness*0.25, smpUV.x));
- wt = min(wt, 1.0 - smoothstep(1.0 - roughness*0.25, 1.0 + roughness*0.25, smpUV.y));
-#endif
-
- vec3 lodOffsets;
- lodOffsets.x = mix(-2.0, -0.70710678, roughness);
- lodOffsets.y = min( 2.0 * smoothstep(0.0, 0.1, roughness), 2.0 - 1.29289 * smoothstep(0.1, 1.0, roughness) );
- lodOffsets.z = min( 6.0 * smoothstep(0.0, 0.1, roughness), 6.0 - 4.585786 * smoothstep(0.1, 1.0, roughness) );
-
- ivec2 iSize = textureSize(light_probe, 0);
- vec3 ddx = dFdx( smpDir ) * float(iSize.x);
- vec3 ddy = dFdy( smpDir ) * float(iSize.y);
-// vec2 ddxUV = dFdx( smpUV ) * float(iSize.x);
-// vec2 ddyUV = dFdy( smpUV ) * float(iSize.y);
-
- vec2 deriv;
- deriv.x = max( dot(ddx, ddx), dot(ddy, ddy) );
-// deriv.y = max( dot(ddxUV, ddxUV), dot(ddyUV, ddyUV) );
- deriv = clamp( deriv, vec2(1.0), vec2(iSize.x * iSize.y) );
- vec2 lodBound = 0.5 * log2( deriv ) - vec2(1.0);
-
-// float minLod = 0.5 * (lodBound.x + lodBound.y);
- float minLod = lodBound.x;
- float maxLod = log2( max(float(iSize.x), float(iSize.y)) );
- minLod = clamp( minLod / maxLod, 0.0, 1.0 );
- minLod *= minLod * maxLod;
-
- lodShift = max( lodShift, minLod );
-
- vec3 retVal = 0.4 * textureLod( light_probe, smpUV , lodShift ).xyz;
- retVal += 0.2 * textureLod( light_probe, smpUV , max(minLod, lodShift+lodOffsets.x) ).xyz;
- retVal += 0.3 * textureLod( light_probe, smpUV , lodShift+lodOffsets.y ).xyz;
- retVal += 0.1 * textureLod( light_probe, smpUV , lodShift+lodOffsets.z ).xyz;
-
-#if QT3DS_ENABLE_LIGHT_PROBE_2
- vec4 topSmp = getTopLayerSample( smpDir, lodShift, lodOffsets );
- vec3 tempVal = mix( retVal, topSmp.xyz, topSmp.w );
- retVal = mix( retVal, tempVal, light_probe2_props.z );
-#endif
-
- if (light_probe_props.z > -1.0) {
- float ctr = 0.5 + 0.5 * light_probe_props.z;
- float vertWt = smoothstep(ctr-roughness*0.25, ctr+roughness*0.25, smpUV.y);
- float wtScaled = mix(1.0, vertWt, light_probe_props.z + 1.0);
- retVal *= wtScaled;
- }
-
- return retVal * wt;
-}
-
-vec3 getProbeAnisoSample( vec3 smpDir, float roughU, float roughV, mat3 tanFrame )
-{
- float minRough = min(roughU, roughV);
- float maxRough = max(roughU, roughV);
-
- float lodMin = log2( (minRough*3.0 + maxRough)*0.25 ) + (light_probe_offset.w - 2.0);
-
- float ratio = clamp( maxRough / minRough, 1.01, 27.0);
- vec2 texSize = vec2( textureSize( light_probe, int(floor( lodMin )) ) );
- texSize = mix( texSize, texSize * 0.5, fract(lodMin) );
-
- // Boundary of 1.0..9.0 is just to keep the number of samples to within a
- // reasonable number of samples in the filter. Similarly, with the clamping
- // of the ratio to a max of 27.0 is just to prevent the step size in the filter
- // to be no bigger than 3 texels (beyond which, there are some artifacts at high
- // roughness, aka low texture res).
- float stepFig = clamp(floor( ratio ), 1.0, 9.0);
-
- // numSteps is half the number of samples we need to take, which makes it
- // the number of steps to take on each side.
- int numSteps = int( floor(stepFig * 0.5) );
-
- vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
- vec4 result = vec4(0.0);
-
- vec3 smpDirOfs = (maxRough == roughU) ? 0.01 * tanFrame[0] : 0.01 * tanFrame[1];
- vec2 stepPos = getProbeSampleUV(normalize(smpDir + smpDirOfs), light_probe_rotation, light_probe_offset.xy);
- vec2 stepNeg = getProbeSampleUV(normalize(smpDir - smpDirOfs), light_probe_rotation, light_probe_offset.xy);
- stepPos -= smpUV; stepNeg -= smpUV;
- stepPos *= texSize; stepNeg *= texSize;
-
- // This ensures that we step along a size that makes sense even if one of the two
- // sammpling directions wraps around the edges of the IBL texture.
- smpDirOfs /= min( length(stepPos), length(stepNeg) );
- smpDirOfs *= ratio / stepFig;
-
- float sigma = mix(0.0, 2.0, ratio / 27.0);
- sigma *= sigma;
-
- float wt = (1.0 / (ratio - 1.0)) + 1.0;
- result.xyz += wt * getProbeWeightedSample( smpDir, lodMin, minRough, tanFrame[2] );
- result.w += wt;
- for (int i = 0; i < numSteps; ++i)
- {
- wt = sigma / (sigma + float(i * i));
- vec2 uv0 = getProbeSampleUV(normalize(smpDir + smpDirOfs * float(i)), light_probe_rotation, light_probe_offset.xy);
- vec2 uv1 = getProbeSampleUV(normalize(smpDir - smpDirOfs * float(i)), light_probe_rotation, light_probe_offset.xy);
- result.xyz += wt * textureLod( light_probe, uv0 , lodMin ).xyz;
- result.w += wt;
- result.xyz += wt * textureLod( light_probe, uv1 , lodMin ).xyz;
- result.w += wt;
- }
-
- result /= result.w;
- return result.xyz;
-}
-
-vec4 sampleDiffuse( mat3 tanFrame )
-{
- if ( light_probe_props.w < 0.005 )
- return vec4( 0.0 );
-
-// if ( light_probe_offset.w > 0.5 )
-// {
- // The LOD offset comes from the assumption that a full diffuse convolution
- // has a support of pi/2, which translates into x pixels, and the base 2 log
- // gives us this LOD... Technically, "x" pixels depends on what the original
- // texture resolution was, which is why we use light_probe_offset.w, which holds
- // the number of mip levels the texture has.
-
- return vec4( light_probe_props.w * getProbeWeightedSample( tanFrame[2], light_probe_offset.w - 2.65149613, 1.0, tanFrame[2] ), 1.0 );
-// }
-
- /*
- // PKC -- the code below is for full-blown IBL, which we'll skip for now
-
- // Hand-calculated Hammersley points for t = 2, n = 33
- // I exclude the 0,0 first point, hence why n=33 and not 32
- // Nice thing about 2d Hammersley points is that any subset is
- // also stratified, so even if I have 1000 points and truncate
- // anywhere, I'm fine. Each of these represent the y of an xy
- // while x for the kth point is always (k+1)/n.
- float kernel[32];
- kernel[0] = 0.5; kernel[1] = 0.25;
- kernel[2] = 0.75; kernel[3] = 0.125;
- kernel[4] = 0.625; kernel[5] = 0.375;
- kernel[6] = 0.875; kernel[7] = 0.0625;
- kernel[8] = 0.5625; kernel[9] = 0.3125;
- kernel[10] = 0.8125; kernel[11] = 0.1875;
- kernel[12] = 0.6875; kernel[13] = 0.4375;
- kernel[14] = 0.9375; kernel[15] = 0.03125;
- kernel[16] = 0.53125; kernel[17] = 0.28125;
- kernel[18] = 0.78125; kernel[19] = 0.15625;
- kernel[20] = 0.65625; kernel[21] = 0.40625;
- kernel[22] = 0.90625; kernel[23] = 0.09375;
- kernel[24] = 0.59375; kernel[25] = 0.34375;
- kernel[26] = 0.84375; kernel[27] = 0.28175;
- kernel[28] = 0.71875; kernel[29] = 0.46875;
- kernel[30] = 0.96875; kernel[31] = 0.015625;
-
- float phiShift = noise1d(gl_FragCoord.xy) - 0.5;
-
- vec3 ret = vec3(0, 0, 0);
-
- int ct = 24;
- float step = 25.0;
-
- // Importance sampling a cosine-weighted distribution. Since this
- // matches the BSDF exactly, we are just going to assume that the PDF
- // and the BSDF cancel out in sampling, so we just need to accumulate
- // texture colors. The noise function puts randomized "twist" into
- // the sampled directions.
- for( int i = 0; i < ct; ++i )
- {
- vec3 localDir;
- float phi = 6.28318530718 * (kernel[i] + phiShift);
- float cosTheta = sqrt( float(i+1) / step);
- localDir.z = sqrt(1.0 - cosTheta*cosTheta);
- localDir.x = cos(phi) * cosTheta;
- localDir.y = sin(phi) * cosTheta;
- vec3 smpDir = tanFrame[0]*localDir.x + tanFrame[1]*localDir.y + tanFrame[2]*localDir.z;
-
-
- float lodShift = light_probe_offset.w - 2 + log2( 3.1415926535 / (localDir.z * step) );
- vec3 smpColor = getProbeSample( smpDir, lodShift, tanFrame[2] );
-
- // The assumption here is that the BSDF and the sampling PDF are identical
- // so they cancel out and therefore, we don't need to include it here.
- ret += smpColor;
- }
-
- ret *= aoFactor / 24.0;
- return ret;
- */
-}
-
-vec4 sampleDiffuseCustomMaterial( vec3 normal, vec3 worldPos, float aoFactor )
-{
-
- mat3 tanFrame = tangentFrame( normal, worldPos );
- return sampleDiffuse( tanFrame );
-}
-
-vec4 sampleGlossyAniso( mat3 tanFrame, vec3 viewDir, float roughU, float roughV )
-{
- if ( light_probe_props.w < 0.005 )
- return vec4( 0.0 );
-
- // PKC : If we do the full IBL sampling, it's useful to square the roughnesses because
- // it makes the effect of roughness feel more linear in the low end. This isn't necessary
- // for fast IBL.
-// float sigmaU = clamp(roughU*roughU, 0.0001, 1.0);
-// float sigmaV = clamp(roughV*roughV, 0.0001, 1.0);
- float sigmaU = smoothstep( 0.0, 1.0, clamp(roughU, 0.0001, 1.0) );
- float sigmaV = smoothstep( 0.0, 1.0, clamp(roughV, 0.0001, 1.0) );
- vec3 ret = vec3(0, 0, 0);
-
-// if ( light_probe_offset.w > 0.5 )
-// {
- vec3 smpDir = reflect( -viewDir, tanFrame[2] );
- float sigma = sqrt(sigmaU * sigmaV);
-
- // Compute the Geometric occlusion/self-shadowing term
- float NdotL = clamp( dot( smpDir, tanFrame[2] ), 0.0, 0.999995);
- float k = sigma * 0.31830988618; // roughness / pi
- float Gl = clamp( (NdotL / (NdotL*(1.0-k) + k) + (1.0 - k*k)) * 0.5, 0.0, 1.0 );
-
- vec3 outColor;
-
- outColor = getProbeAnisoSample( smpDir, sigmaU, sigmaV, tanFrame );
-
- return vec4( light_probe_props.w * Gl * outColor, 1.0 );
-// }
-
- // PKC -- the code below is for full-blown IBL, which we'll skip for now
-
-/*
- float step = clamp( ceil(32.0 * sqrt(max(sigmaU, sigmaV))), 4.0, 32.0 );
- int actualCt = int(step);
- float phiShift = noise1d(gl_FragCoord.xy) - 0.5;
-
- // Hand-calculated Hammersley points for t = 2, n = 33
- // I exclude the 0,0 first point, hence why n=33 and not 32
- // Nice thing about 2d Hammersley points is that any subset is
- // also stratified, so even if I have 1000 points and truncate
- // anywhere, I'm fine. Each of these represent the y of an xy
- // while x for the kth point is always (k+1)/n.
- float kernel[32];
- kernel[0] = 0.5; kernel[1] = 0.25;
- kernel[2] = 0.75; kernel[3] = 0.125;
- kernel[4] = 0.625; kernel[5] = 0.375;
- kernel[6] = 0.875; kernel[7] = 0.0625;
- kernel[8] = 0.5625; kernel[9] = 0.3125;
- kernel[10] = 0.8125; kernel[11] = 0.1875;
- kernel[12] = 0.6875; kernel[13] = 0.4375;
- kernel[14] = 0.9375; kernel[15] = 0.03125;
- kernel[16] = 0.53125; kernel[17] = 0.28125;
- kernel[18] = 0.78125; kernel[19] = 0.15625;
- kernel[20] = 0.65625; kernel[21] = 0.40625;
- kernel[22] = 0.90625; kernel[23] = 0.09375;
- kernel[24] = 0.59375; kernel[25] = 0.34375;
- kernel[26] = 0.84375; kernel[27] = 0.28175;
- kernel[28] = 0.71875; kernel[29] = 0.46875;
- kernel[30] = 0.96875; kernel[31] = 0.015625;
-
- float thetaI = acos( dot(viewDir, tanFrame[2]) );
-
- // NOTE : The model I'm using here is actually based on the KGGX model used in
- // physGlossyBSDF. This is my own variation on the original GGX which uses something
- // closer to a pure Cauchy distribution in tangent space, but also supports anisotropy.
- for (int i = 0; i < actualCt; ++i)
- {
- vec3 localDir;
-
- float phi = 6.28318530718 * (kernel[i] + phiShift);
- float u = float(i + 1) / (step + 1.0);
- float rU = cos(phi) * sigmaU;
- float rV = sin(phi) * sigmaV;
- float sigma = sqrt(rU * rU + rV * rV);
-
- float boundA = atan( ((thetaI - 1.57079632679) * 0.5) / sigma );
- float boundB = atan( ((thetaI + 1.57079632679) * 0.5) / sigma );
- float t = (1.0 - u) * boundA + u * boundB;
- float thetaH = tan( t ) * sigma;
-
- float cosThetaH = cos( thetaH );
- float sinThetaH = sin( thetaH );
- localDir.z = cosThetaH;
- localDir.y = sin(phi) * sinThetaH;
- localDir.x = cos(phi) * sinThetaH;
-
- vec3 halfDir = tanFrame[0]*localDir.x + tanFrame[1]*localDir.y + tanFrame[2]*localDir.z;
- halfDir = normalize(halfDir);
- vec3 smpDir = reflect( -viewDir, halfDir );
-
- vec2 scaledXY = localDir.xy / vec2(sigmaU, sigmaV);
- float PDF = (sigmaU*sigmaV) / (sigmaU*sigmaV + dot(scaledXY, scaledXY));
- vec3 Haf = smpDir + viewDir; // We need the unnormalized half vecter as well as the normalized one
- float HdotL = dot(halfDir, smpDir);
- // normalize the PDF to compute the filter support
- // This gives us the ideal miplevel at which to sample the texture map.
- PDF *= dot(Haf, Haf) / (4.0 * dot(Haf, smpDir) * HdotL * sigmaU*sigmaV * (boundB-boundA)*(boundB-boundA));
-
- // Again assuming that the pdf and BSDF are equivalent -- that's not generally valid,
- // but it saves a lot of ALU cycles.
- float lodShift = log2( 512.0 * sigma / PDF );
-
- float k = sigma * 0.31830988618; // roughness / pi
- float Gl = clamp( (HdotL / (HdotL*(1.0-k) + k) + (1.0 - k*k)) * 0.5, 0.0, 1.0 );
-
- vec3 smpColor = Gl * getProbeSample( smpDir, lodShift, tanFrame[2] );
- ret += smpColor;
- }
- ret /= float(actualCt);
- return vec4(ret, 1.0);
-*/
-}
-
-vec4 sampleGlossy( mat3 tanFrame, vec3 viewDir, float roughness )
-{
- return sampleGlossyAniso( tanFrame, viewDir, roughness, roughness );
-}
-
-vec4 sampleGlossyCustomMaterial( vec3 normal, vec3 worldPos, vec3 viewDir, float roughness )
-{
- mat3 tanFrame = tangentFrame( normal, worldPos );
- return sampleGlossy( tanFrame, viewDir, roughness );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/screenSpaceAO.glsllib b/src/Runtime/ogl-runtime/res/effectlib/screenSpaceAO.glsllib
deleted file mode 100644
index 54204a1f..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/screenSpaceAO.glsllib
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SCREEN_SPACE_AO_GLSLLIB
-#define SCREEN_SPACE_AO_GLSLLIB 1
-
-#include "depthpass.glsllib"
-
-
-float hashRot(vec2 pos)
-{
- // Basically an odd-even hash.
- float px = 2.0 * fract(floor(pos.x) * 0.5);
- float py = fract(floor(pos.y) * 0.5);
-
- return px + py;
-}
-
-vec3 quatRotate( vec4 q, vec3 v )
-{
- return v + 2.0 * cross( cross( v, q.xyz ) + q.w * v, q.xyz );
-}
-
-vec3 getViewSpacePos( sampler2D depthSampler, vec2 camProps, vec2 UV, vec4 UvToEye )
-{
- float sampleDepth = getDepthValue( texture(depthSampler, UV), camProps );
- sampleDepth = depthValueToLinearDistance( sampleDepth, camProps );
-
- vec2 scaledUV = (UV * UvToEye.xy) + UvToEye.zw;
- return vec3(scaledUV * sampleDepth, sampleDepth);
-}
-
-vec2 computeDir( vec2 baseDir, int v )
-{
- float ang = 3.1415926535 * hashRot( gl_FragCoord.xy ) + float(v - 1);
- vec2 vX = vec2(cos(ang), sin(ang));
- vec2 vY = vec2(-sin(ang), cos(ang));
-
- return vec2( dot(baseDir, vX), dot(baseDir, vY) );
-}
-
-vec2 offsetDir( vec2 baseDir, int v )
-{
- float ang = float(v - 1);
- vec2 vX = vec2(cos(ang), sin(ang));
- vec2 vY = vec2(-sin(ang), cos(ang));
-
- return vec2( dot(baseDir, vX), dot(baseDir, vY) );
-}
-
-float SSambientOcclusion(sampler2D depthSampler, vec3 viewNorm, vec4 aoParams, vec4 aoParams2, vec2 camProps, vec4 aoScreen, vec4 UvToEye)
-{
- float ret = 0.0;
-
- vec2 centerUV = gl_FragCoord.xy * aoScreen.zw;
- vec3 viewPos = getViewSpacePos( depthSampler, camProps, centerUV, UvToEye );
- viewPos += viewNorm * aoParams.w;
-
- float screenRadius = aoParams.y * aoScreen.y / viewPos.z;
- if (screenRadius < 1.0) { return 1.0; }
-
- vec3 kernel[9];
-
- // The X and Y are the 2d direction, while the Z is the height of the sphere at that point.
- // In essence, it normalizes the 3d vector, but we're really interested in the 2D offset.
- kernel[0] = vec3(-0.1376476, 0.2842022, 0.948832);
- kernel[1] = vec3(-0.626618, 0.4594115, 0.629516);
- kernel[2] = vec3(-0.8903138, -0.05865424, 0.451554);
- kernel[3] = vec3(0.2871419, 0.8511679, 0.439389);
- kernel[4] = vec3(-0.1525251, -0.3870117, 0.909372);
- kernel[5] = vec3(0.6978705, -0.2176773, 0.682344);
- kernel[6] = vec3(0.7343006, 0.3774331, 0.5642);
- kernel[7] = vec3(0.1408805, -0.88915, 0.4353);
- kernel[8] = vec3(-0.6642616, -0.543601, 0.5130);
-
- int radLevels = int(floor(aoParams2.x));
- float radStep = 1.0 / aoParams2.x;
-
- for (int j = 1; j <= radLevels; ++j)
- {
- for (int i = 0; i < 9; ++i)
- {
- float curRange = aoParams.y * radStep * float(j);
- float curRadius = curRange * kernel[i].z;
-
- vec3 smpDir;
- smpDir.xy = computeDir(kernel[i].xy, j) * aoParams2.y + (1.0 - aoParams2.y) * offsetDir(kernel[i].xy, j);
- smpDir.z = kernel[i].z;
- smpDir *= curRange;
-
- vec2 smpUV = centerUV.xy + smpDir.xy * aoScreen.zw;
-
- // First method is based on Horizon-Based AO
- vec3 samplePos = getViewSpacePos( depthSampler, camProps, smpUV, UvToEye );
- vec3 smpVec = samplePos - viewPos;
-
- float lenRad = dot(smpVec, smpVec);
- smpVec = normalize(smpVec);
- float lenDot = dot(smpVec, viewNorm);
-
- lenRad /= aoParams.y*aoParams.y;
- float falloff = smoothstep(8.0, 0.0, (lenRad - 1.0) * 0.125);
- float occl = 1.0 - clamp(lenDot * falloff, 0.0, 1.0);
-
- ret += occl * occl;
- }
- }
-
- ret = (ret) / (9.0 * float(radLevels));
-
- // Blend between soft and hard based on softness param
- // NOTE : the 0.72974 is actually an gamma-inverted 0.5 (assuming gamma 2.2)
- // Would not need this if we linearized color instead.
- float hardCut = (1.0 - aoParams.z) * 0.72974;
- ret = smoothstep(0.0, 1.0, (ret - hardCut) / (1.0 - hardCut));
-
- // Blend between full and no occlusion based on strength param
- ret = aoParams.x * ret + (1.0 - aoParams.x);
-
- return ret;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/screenSpaceDO.glsllib b/src/Runtime/ogl-runtime/res/effectlib/screenSpaceDO.glsllib
deleted file mode 100644
index 2ccc69fc..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/screenSpaceDO.glsllib
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SCREEN_SPACE_DO_GLSLLIB
-#define SCREEN_SPACE_DO_GLSLLIB 1
-
-#include "depthpass.glsllib"
-
-vec3 getViewSpacePos( sampler2D depthSampler, vec2 camProps, vec2 UV, vec4 UvToEye )
-{
- float sampleDepth = getDepthValue( texture(depthSampler, UV), camProps );
- sampleDepth = depthValueToLinearDistance( sampleDepth, camProps );
-
- vec2 scaledUV = (UV * UvToEye.xy) + UvToEye.zw;
- return vec3(scaledUV * sampleDepth, sampleDepth);
-}
-
-float shadowOcclusion(sampler2D depthSampler, vec3 lightDir, vec3 worldPos, mat4 viewMat, mat4 viewProj, vec4 shadowParams, vec2 camProps, vec4 aoScreen, vec4 UvToEye)
-{
- vec3 viewPos = getViewSpacePos( depthSampler, camProps, ( gl_FragCoord.xy * aoScreen.zw ), UvToEye );
- float depth = viewPos.z;
-
- // Get the screen-space UV
- vec2 centerUV = gl_FragCoord.xy * aoScreen.zw;
-
- float screenDist = shadowParams.y * 3.1415926535 * aoScreen.y / viewPos.z;
- if (screenDist < 1.0) { return 1.0; }
-
- vec3 viewL = normalize( (viewMat * vec4(lightDir, 0)).xyz );
-
- float steps = min( screenDist, 20.0 );
- int maxCt = int(steps);
- float step = 3.1415926535 * shadowParams.y / float(maxCt);
- float ret = float(maxCt);
-
- for( int i = 0; i < maxCt; ++i )
- {
- vec3 ray = lightDir * step * float(i);
- vec3 samplePos = worldPos - ray;
-
- vec4 smpUV = viewProj * vec4(samplePos, 1.0);
- smpUV /= smpUV.w;
- smpUV.xy = (smpUV.xy + 1.0) * 0.5;
-
- vec3 testPos = getViewSpacePos( depthSampler, camProps, smpUV.xy, UvToEye );
- testPos.z += shadowParams.w;
- vec3 testVec = normalize(viewPos - testPos);
- testVec -= viewL;
- float isBehind = clamp( testVec.z, 0.0, 1.0 );
- float diff = (testPos.z - depth) / shadowParams.y;
- ret -= isBehind * (1.0 / (1.0 + diff * diff));
- }
-
- ret /= float(maxCt); // divide by number of samples;
- // Blend between soft and hard based on softness param
- // NOTE : the 0.72974 is actually an gamma-inverted 0.5 (assuming gamma 2.2)
- // Would not need this if we linearized color instead.
- float hardCut = (ret <= 0.72974) ? 0.0 : 1.0;
- ret = shadowParams.z * ret + (1.0 - shadowParams.z) * hardCut;
-
- // Blend between full and no occlusion based on strength param
- ret = shadowParams.x * ret + (1.0 - shadowParams.x);
-
- return ret;
-}
-
-// For reference
-/*
-float glossyOcclusionBasis(sampler2D depthSampler, mat3 tanFrame, vec3 worldPos, mat4 viewProj, vec3 viewDir, vec4 shadowParams, vec2 camProps, float roughness)
-{
- float ret = 16.0;
-
- float kernel[16];
- kernel[0] = 0.5; kernel[1] = 0.25;
- kernel[2] = 0.75; kernel[3] = 0.125;
- kernel[4] = 0.625; kernel[5] = 0.375;
- kernel[6] = 0.875; kernel[7] = 0.0625;
- kernel[8] = 0.5625; kernel[9] = 0.3125;
- kernel[10] = 0.8125; kernel[11] = 0.1875;
- kernel[12] = 0.6875; kernel[13] = 0.4375;
- kernel[14] = 0.9375; kernel[15] = 0.03125;
-
- float rough = clamp(roughness, 0.0001, 1.0);
- float normFac = 1.0 / (rough);
-
- float phiShift = hashRot( gl_FragCoord.xy );
- ivec2 iCoords = ivec2( gl_FragCoord.xy );
- float depth = getDepthValue( texelFetch(depthSampler, iCoords, 0) );
- depth = depthValueToLinearDistance( depth, camProps );
-
- for( int i = 0; i < 16; ++i )
- {
- vec3 localDir;
- float phi = 6.28318530718 * (kernel[i] + phiShift);
- float cosTheta = sqrt( float(i+1) / 33.0);
- localDir.z = sqrt(1.0 - cosTheta*cosTheta) * normFac;
- localDir.x = cos(phi) * cosTheta;
- localDir.y = sin(phi) * cosTheta;
-
- localDir = normalize(localDir);
-
- vec3 halfDir = tanFrame[0]*localDir.x + tanFrame[1]*localDir.y + tanFrame[2]*localDir.z;
- vec3 ray = reflect( -viewDir, halfDir ) * shadowParams.x;
-
- vec4 samplePos = vec4( worldPos + ray, 1.0 );
-
- vec4 sampleProj = viewProj * samplePos;
- sampleProj /= sampleProj.w;
- sampleProj.xy = (sampleProj.xy + 1.0) * 0.5;
- float sampleDepth = getDepthValue( texture(depthSampler, sampleProj.xy) );
-
- sampleDepth = depthValueToLinearDistance( sampleDepth, camProps );
-
- // Occlusion is applied based on a Cauchy distribution filter
- // But with a "dead zone" for the very close samples. By subtracting it from 16,
- // which represents no occlusion (16/16 = 1), we let nearby occluders have a
- // lot of effect, but far away occluders do not. Furthermore, the "dead zone"
- // in the filter means that the extremely near (which we assume to be part of the
- // same surface) are also excluded to try and limit self-occlusion.
- float occlDist = 4.0 * max(depth - sampleDepth - shadowParams.y, 0.0) / shadowParams.x;
- float occlFactor = 1.0 / ( 1.0 + occlDist*occlDist*0.04 );
- occlFactor -= 1.0 / ( 1.0 + occlDist*occlDist*4.0 );
- ret -= min(2.0 * occlFactor, 1.0);
- }
-
- ret /= 16.0; // divide by number of samples;
- return ret;
-}
-*/
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/shadowMapping.glsllib b/src/Runtime/ogl-runtime/res/effectlib/shadowMapping.glsllib
deleted file mode 100644
index df351f9a..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/shadowMapping.glsllib
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SHADOW_MAPPING_GLSLLIB
-#define SHADOW_MAPPING_GLSLLIB
-
-#include "depthpass.glsllib"
-
-float sampleParaboloid( in sampler2D shadowMap, in vec4 shadowControls, in mat4 shadowMatrix, in vec3 worldPos, in vec2 cameraProps, out vec2 smpUV )
-{
- vec4 projCoord = shadowMatrix * vec4( worldPos, 1.0 );
- vec3 smpCoord = projCoord.xyz / projCoord.w;
-
- float ptDepth = depthValueToLinearDistance( 1.0 - smpCoord.z, cameraProps );
- ptDepth = (ptDepth - cameraProps.x) / (cameraProps.y - cameraProps.x);
- smpCoord = normalize( smpCoord.xyz );
- smpCoord.xy /= -( smpCoord.z + 1.0 );
- smpCoord.xy = vec2(1.0) - smpCoord.xy;
- smpCoord.xy *= 0.5;
-
- smpUV = smpCoord.xy; // This is just for debug purposes to ensure what the sampled UV cooord is.
-
- float sampleDepth = texture( shadowMap, smpCoord.xy ).x + shadowControls.x;
- sampleDepth *= sampleDepth;
- ptDepth *= ptDepth;
- float shadowFac = min(1.0, exp(shadowControls.y * sampleDepth * sampleDepth) / exp(shadowControls.y * ptDepth * ptDepth));
-
- smpUV.xy *= shadowFac;
- return shadowFac;
-}
-
-float sampleCubemap( in samplerCube shadowCube, in vec4 shadowControls, in mat4 shadowViewMat, in vec3 lightPos, in vec3 worldPos, in vec2 cameraProps )
-{
- vec3 viewDir = worldPos - vec3(lightPos.x, lightPos.y, lightPos.z);
- float ptDepth = length(viewDir.xyz);
- vec4 viewCoord = shadowViewMat * vec4( viewDir.xyz, 0.0 );
- viewCoord.xyz /= ptDepth;
- ptDepth = clamp((ptDepth - 1.0) / (cameraProps.y - 1.0), 0.0, 1.0);
-
- float smpDepth = texture( shadowCube, viewDir.xyz ).x + shadowControls.x;
-
- float shadowFac = min(1.0, exp(shadowControls.y * smpDepth) / exp(shadowControls.y * ptDepth));
- return shadowFac;
-}
-
-float sampleOrthographic( in sampler2D shadowMap, in vec4 shadowControls, in mat4 shadowMatrix, in vec3 worldPos, in vec2 cameraProps )
-{
- vec4 projCoord = shadowMatrix * vec4( worldPos, 1.0 );
- vec3 smpCoord = projCoord.xyz / projCoord.w;
-
- float sampleDepth = texture( shadowMap, smpCoord.xy ).x + shadowControls.x;
-
- return min(1.0, exp(shadowControls.y * sampleDepth) / exp(shadowControls.y * smpCoord.z));
-}
-
-
-struct ParaboloidMapResult
-{
- vec4 m_Position;
- vec4 m_WorldPos;
-};
-
-ParaboloidMapResult VertexParaboloidDepth(vec3 pos, mat4 inMVP)
-{
- vec4 glPos = inMVP * vec4( pos, 1.0 );
- glPos /= glPos.w;
- glPos.xyz = normalize( glPos.xyz );
- vec4 world_pos;
- world_pos.w = glPos.z;
- glPos.xy /= glPos.z + 1.0;
- world_pos.xyz = pos.xyz;
-
- ParaboloidMapResult retval;
- retval.m_Position = glPos;
- retval.m_WorldPos = world_pos;
- return retval;
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/shadowMappingFragment.glsllib b/src/Runtime/ogl-runtime/res/effectlib/shadowMappingFragment.glsllib
deleted file mode 100644
index 660d736a..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/shadowMappingFragment.glsllib
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "depthpass.glsllib"
-float FragmentParaboloidDepth( vec4 inWorldPos, mat4 inMVP, vec2 inCameraProperties )
-{
- if (inWorldPos.w < 0.0)
- discard;
- vec4 projVec = inMVP * vec4( inWorldPos.xyz, 1.0 );
- projVec /= projVec.w;
- projVec.z = depthValueToLinearDistance( 1.0 - projVec.z, inCameraProperties );
- return (projVec.z - inCameraProperties.x) / (inCameraProperties.y - inCameraProperties.x);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/simpleGlossyBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/simpleGlossyBSDF.glsllib
deleted file mode 100644
index be6024cc..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/simpleGlossyBSDF.glsllib
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 simpleGlossyBSDF( in mat3 tanFrame, in vec3 L, vec3 V, in vec3 lightSpecular, in float ior
- , in float roughnessU, in float roughnessV, int mode )
-{
- vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
-
- float cosTheta = dot( tanFrame[2], L );
- if ( 0.0 < cosTheta )
- {
- float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
-
- if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
- {
- vec3 R = reflect( -L, tanFrame[2] );
- float cosine = dot( R, V );
- float shine = ( 0.0 < cosine ) ? ( ( 0.0 < roughness ) ? pow( cosine, 1.0 / roughness ) : ( 0.9999 <= cosine ) ? 1.0 : 0.0 ) : 0.0;
- rgba.rgb = shine * lightSpecular;
- }
- }
- if ( ( mode == scatter_transmit ) || ( mode == scatter_reflect_transmit ) )
- {
- // check against total reflection
- vec3 R = refract( -V, tanFrame[2], ior );
- if ( R == vec3( 0.0, 0.0, 0.0 ) )
- {
- rgba.a = 1.0;
- }
- else
- {
- rgba.a = 0.0;
- }
- }
-
- return( rgba );
-}
-
-vec4 simpleGlossyBSDFEnvironment( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
-{
- vec3 rgb = vec3( 0.0, 0.0, 0.0 );
-#if !QT3DS_ENABLE_LIGHT_PROBE
- if ( uEnvironmentMappingEnabled )
- {
- float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
- vec3 R = reflect( -viewDir, tanFrame[2] );
- rgb = evalEnvironmentMap( R, roughness );
- rgb = simpleGlossyBSDF( tanFrame, R, viewDir, rgb, 1.0, roughnessU, roughnessV, scatter_reflect ).rgb;
- }
-#endif
- return( vec4( rgb, 1.0 ) );
-}
-
-// RNM radiosity normal maps
-vec4 glossyRNM( in vec3 N, in vec3 rnmX, in vec3 rnmY, in vec3 rnmZ )
-{
- // we use a fixed basis like Half Life
- vec3 B0 = vec3( -0.40825, 0.70711, 0.57735);
- vec3 B1 = vec3( -0.40825, -0.70711, 0.57735);
- vec3 B2 = vec3( 0.8165, 0.0, 0.57735);
-
- vec3 dp;
- dp.x = clamp( dot ( N , B0 ), 0.0, 1.0);
- dp.y = clamp( dot ( N , B1 ), 0.0, 1.0);
- dp.z = clamp( dot ( N , B2 ), 0.0, 1.0);
-
- float sum = 1.0 / dot( dp, vec3(1.0, 1.0, 1.0) );
- vec3 diffuseLight = dp.x * rnmX + dp.y * rnmY + dp.z * rnmZ;
- //vec3 diffuseLight = N.x * rnmX + N.y * rnmY + N.z * rnmZ;
-
- return (vec4(diffuseLight, 1.0) * sum);
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/specularBSDF.glsllib b/src/Runtime/ogl-runtime/res/effectlib/specularBSDF.glsllib
deleted file mode 100644
index 78e541a5..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/specularBSDF.glsllib
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "funcspecularBSDF.glsllib"
-
-#ifndef DEFAULT_MATERIAL_LIGHTING
-
-vec4 specularBSDFEnvironment( in vec3 N, in vec3 viewDir, in vec3 tint, int mode )
-{
- vec3 rgb = vec3( 0.0, 0.0, 0.0 );
- if ( uEnvironmentMappingEnabled )
- {
- vec3 R = reflect( -viewDir, N );
- rgb = evalEnvironmentMap( R, 0.0 );
- rgb = specularBSDF( N, R, viewDir, rgb, 1.0, 256.0, tint, scatter_reflect ).rgb;
- }
- return( vec4( rgb, 1.0 ) );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/spotEdf.glsllib b/src/Runtime/ogl-runtime/res/effectlib/spotEdf.glsllib
deleted file mode 100644
index 2abe194e..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/spotEdf.glsllib
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float spotEdf( float exponent )
-{
- float att = 1.0;
-
- float dist = length(viewDir);
- vec3 spotDir = viewDir / dist;
-
- float spot = max(0.0, dot(spotDir, normal));
- att = pow(spot, exponent);
-
- return att;
-}
diff --git a/src/Runtime/ogl-runtime/res/effectlib/square.glsllib b/src/Runtime/ogl-runtime/res/effectlib/square.glsllib
deleted file mode 100644
index 96857224..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/square.glsllib
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-float square( in float x )
-{
- return( x * x );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tangentSpaceNormalTexture.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tangentSpaceNormalTexture.glsllib
deleted file mode 100644
index 1fcc4290..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tangentSpaceNormalTexture.glsllib
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FILE_NORMAL_TEXTURE_GLSLLIB
-#define FILE_NORMAL_TEXTURE_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-
-#include "luminance.glsllib"
-#include "monoChannel.glsllib"
-#include "textureCoordinateInfo.glsllib"
-#define wrap_clamp 0
-#define wrap_repeat 1
-#define wrap_mirrored_repeat 2
-#include "rotationTranslationScale.glsllib"
-#include "transformCoordinate.glsllib"
-
-#endif
-
-//interpreting the color values of a bitmap as a vector in tangent space
-vec3 tangentSpaceNormalTexture( in sampler2D tex, in float factor, in bool flipTangentU, in bool flipTangentV
- , in texture_coordinate_info uvw, in vec2 cropU, in vec2 cropV, in int wrapU, in int wrapV )
-{
- // if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
- bool flipU = flipTangentU;
- bool flipV = flipTangentV;
- if ( wrapU == wrap_mirrored_repeat )
- {
- if ( ( ( 0.0 < uvw.position.x ) && ( int( uvw.position.x ) % 2 == 1 ) )
- || ( ( uvw.position.x < 0.0 ) && ( int( uvw.position.x ) % 2 == 0 ) ) )
- {
- flipU = !flipU;
- }
- if ( ( ( 0.0 < uvw.position.y ) && ( int( uvw.position.y ) % 2 == 1 ) )
- || ( ( uvw.position.y < 0.0 ) && ( int( uvw.position.y ) % 2 == 0 ) ) )
- {
- flipV = !flipV;
- }
- }
-
- vec3 tangent = 2.0 * texture( tex, uvw.position.xy ).xyz - 1.0;
-
- vec3 tangentU = normalize( flipU ? -uvw.tangent_u : uvw.tangent_u );
- vec3 tangentV = normalize( flipV ? -uvw.tangent_v : uvw.tangent_v );
- vec3 normal = normalize( cross( tangentU, tangentV ) );
-
- return( mix( normal, normalize( tangent.x * tangentU - tangent.y * tangentV + tangent.z * normal ), factor ) );
-}
-
-#include "textureCoordinateInfo.glsllib"
-
-//Simpler version built to run from UIC image data
-//In our case, we have already generated the texture coordinate x,y position
-//TODO - figure out if we need to manipulate tangent_u, tangent_v.
-vec3 defaultMaterialFileNormalTexture( in sampler2D sampler, in float factor, vec2 texCoord, vec3 tangent, vec3 binormal )
-{
- // factor should be in [0,1] range
- return tangentSpaceNormalTexture( sampler, clamp(factor, 0.0, 1.0), false, false
- , textureCoordinateInfo( vec3( texCoord.x, texCoord.y, 0.0 ), tangent, binormal )
- , vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 )
- , wrap_repeat, wrap_repeat);
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationLinear.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationLinear.glsllib
deleted file mode 100644
index f854cc15..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationLinear.glsllib
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_LINEAR_GLSLLIB
-#define TESSELLATION_LINEAR_GLSLLIB
-
-
-#if TESSELLATION_CONTROL_SHADER
-layout (vertices = 3) out;
-
-// global setup in main
-vec3 ctWorldPos[3];
-
-uniform vec3 camera_position;
-uniform vec2 distanceRange;
-uniform float disableCulling;
-
-float isBackFace()
-{
- vec3 faceNormal = normalize( cross( ctWorldPos[2] - ctWorldPos[0], ctWorldPos[1] - ctWorldPos[0] ) );
-
- vec3 ncd = normalize( ctWorldPos[0] - camera_position );
-
- return sign( dot(faceNormal, ncd) );
-}
-
-float adaptiveCameraFactor( in float minTess, in float maxTess )
-{
- float distanceValue0 = distance( camera_position, ctWorldPos[0] );
- float distanceValue1 = distance( camera_position, ctWorldPos[1] );
- float distanceValue2 = distance( camera_position, ctWorldPos[2] );
-
- float range = distanceRange[1] - distanceRange[0];
-
- vec3 edgeDistance;
- edgeDistance[0] = ((distanceValue1 + distanceValue2) / 2.0) / range;
- edgeDistance[1] = ((distanceValue2 + distanceValue0) / 2.0) / range;
- edgeDistance[2] = ((distanceValue0 + distanceValue1) / 2.0) / range;
-
- edgeDistance = clamp( edgeDistance, vec3(0.0), vec3(1.0) );
-
- //float af = mix( minTess, maxTess, 1.0 - edgeDistance[gl_InvocationID] );
- float af = 1.0 - edgeDistance[gl_InvocationID];
- af = clamp( af*af*maxTess , minTess, maxTess );
-
- return af;
-}
-
-void tessShader ( in float tessEdge, in float tessInner )
-{
- float bf = isBackFace();
- bf = max(disableCulling, bf);
-
- // adapative tessellation factor
- float af = adaptiveCameraFactor( tessInner, tessEdge );
-
- // Calculate the tessellation levels
- gl_TessLevelInner[0] = af * bf;
- gl_TessLevelOuter[gl_InvocationID] = af * bf;
-}
-#endif
-
-#if TESSELLATION_EVALUATION_SHADER
-layout (triangles, equal_spacing, ccw) in;
-
-vec4 tessShader ( )
-{
- vec4 p0 = gl_TessCoord.x * gl_in[0].gl_Position;
- vec4 p1 = gl_TessCoord.y * gl_in[1].gl_Position;
- vec4 p2 = gl_TessCoord.z * gl_in[2].gl_Position;
- vec4 pos = p0 + p1 + p2;
- return pos;
-}
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationLinearCM.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationLinearCM.glsllib
deleted file mode 100644
index d2bb90af..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationLinearCM.glsllib
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_LINEAR_CM_GLSLLIB
-#define TESSELLATION_LINEAR_CM_ GLSLLIB
-
-#include "tessellationLinear.glsllib"
-
-#if TESSELLATION_CONTROL_SHADER
-
-uniform float tessLevelOuter;
-uniform float tessLevelInner;
-
-attribute vec3 varNormal[];
-attribute vec3 varObjPos[];
-
-varying vec3 varNormalTC[];
-varying vec3 varObjPosTC[];
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 varTexCoord0[];
-varying vec3 varTexCoord0TC[];
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 varTangent[];
-attribute vec3 varObjTangent[];
-varying vec3 varTangentTC[];
-varying vec3 varObjTangentTC[];
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 varBinormal[];
-attribute vec3 varObjBinormal[];
-varying vec3 varBinormalTC[];
-varying vec3 varObjBinormalTC[];
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 varWorldPos[];
-varying vec3 varWorldPosTC[];
-#endif
-
-void main() {
-
-#if QT3DS_ENABLE_WORLD_POSITION
- ctWorldPos[0] = varWorldPos[0];
- ctWorldPos[1] = varWorldPos[1];
- ctWorldPos[2] = varWorldPos[2];
-#endif
-
- gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
- tessShader( tessLevelOuter, tessLevelInner);
-
- varObjPosTC[gl_InvocationID] = varObjPos[gl_InvocationID];
- varNormalTC[gl_InvocationID] = varNormal[gl_InvocationID];
-
-#if QT3DS_ENABLE_UV0
- varTexCoord0TC[gl_InvocationID] = varTexCoord0[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- varTangentTC[gl_InvocationID] = varTangent[gl_InvocationID];
- varObjTangentTC[gl_InvocationID] = varObjTangent[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- varBinormalTC[gl_InvocationID] = varBinormal[gl_InvocationID];
- varObjBinormalTC[gl_InvocationID] = varObjBinormal[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- varWorldPosTC[gl_InvocationID] = varWorldPos[gl_InvocationID];
-#endif
-}
-
-#endif
-
-
-#if TESSELLATION_EVALUATION_SHADER
-
-#if (GEOMETRY_SHADER == 1)
-#define VARYING_NAME(varyingName) varyingName##TE
-#else
-#define VARYING_NAME(varyingName) varyingName
-#endif
-
-uniform mat3 normal_matrix;
-uniform mat4 model_view_projection_matrix;
-
-attribute vec3 varNormalTC[];
-attribute vec3 varObjPosTC[];
-
-varying vec3 VARYING_NAME(varNormal);
-varying vec3 VARYING_NAME(varObjPos);
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 varTexCoord0TC[];
-varying vec3 VARYING_NAME(varTexCoord0);
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 varTangentTC[];
-attribute vec3 varObjTangentTC[];
-varying vec3 VARYING_NAME(varTangent);
-varying vec3 VARYING_NAME(varObjTangent);
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 varBinormalTC[];
-attribute vec3 varObjBinormalTC[];
-varying vec3 VARYING_NAME(varBinormal);
-varying vec3 VARYING_NAME(varObjBinormal);
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 varWorldPosTC[];
-varying vec3 VARYING_NAME(varWorldPos);
-#endif
-
-void main() {
- vec4 pos = tessShader( );
-
- gl_Position = model_view_projection_matrix * pos;
-
- VARYING_NAME(varObjPos) = gl_TessCoord.x * varObjPosTC[0] + gl_TessCoord.y * varObjPosTC[1] + gl_TessCoord.z * varObjPosTC[2];
- VARYING_NAME(varNormal) = gl_TessCoord.x * varNormalTC[0] + gl_TessCoord.y * varNormalTC[1] + gl_TessCoord.z * varNormalTC[2];
-
-#if QT3DS_ENABLE_UV0
- VARYING_NAME(varTexCoord0) = gl_TessCoord.x * varTexCoord0TC[0] + gl_TessCoord.y * varTexCoord0TC[1] + gl_TessCoord.z * varTexCoord0TC[2];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- VARYING_NAME(varTangent) = gl_TessCoord.x * varTangentTC[0] + gl_TessCoord.y * varTangentTC[1] + gl_TessCoord.z * varTangentTC[2];
- VARYING_NAME(varObjTangent) = gl_TessCoord.x * varObjTangentTC[0] + gl_TessCoord.y * varObjTangentTC[1] + gl_TessCoord.z * varObjTangentTC[2];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- VARYING_NAME(varBinormal) = gl_TessCoord.x * varBinormalTC[0] + gl_TessCoord.y * varBinormalTC[1] + gl_TessCoord.z * varBinormalTC[2];
- VARYING_NAME(varObjBinormal) = gl_TessCoord.x * varObjBinormalTC[0] + gl_TessCoord.y * varObjBinormalTC[1] + gl_TessCoord.z * varObjBinormalTC[2];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- VARYING_NAME(varWorldPos) = gl_TessCoord.x * varWorldPosTC[0] + gl_TessCoord.y * varWorldPosTC[1] + gl_TessCoord.z * varWorldPosTC[2];
-#endif
-
- VARYING_NAME(varNormal) = normalize(normal_matrix * VARYING_NAME(varNormal));
-}
-
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationNPatch.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationNPatch.glsllib
deleted file mode 100644
index 62ec2635..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationNPatch.glsllib
+++ /dev/null
@@ -1,290 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_NPATCH_GLSLLIB
-#define TESSELLATION_NPATCH_GLSLLIB
-
-struct NPatchTessPatch
-{
- float b210;
- float b120;
- float b021;
- float b012;
- float b102;
- float b201;
- float b111;
- float n110;
- float n011;
- float n101;
- float t110;
- float t011;
- float t101;
-};
-
-#if TESSELLATION_CONTROL_SHADER
-layout (vertices = 3) out;
-
-layout(location=15) out NPatchTessPatch tcTessPatch[];
-
-// global setup in main
-vec3 ctWorldPos[3];
-vec3 ctNorm[3];
-vec3 ctTangent[3];
-
-uniform vec3 camera_position;
-uniform vec2 distanceRange;
-uniform float disableCulling;
-
-float isBackFace()
-{
- vec3 faceNormal = normalize( cross( ctWorldPos[2] - ctWorldPos[0], ctWorldPos[1] - ctWorldPos[0] ) );
-
- vec3 ncd = normalize( ctWorldPos[0] - camera_position );
-
- return sign( 0.2 + dot(faceNormal, ncd) ); // 0.2 is a conservative offset to account for curved surfaces
-}
-
-float adaptiveCameraFactor( in float minTess, in float maxTess )
-{
- float distanceValue0 = distance( camera_position, ctWorldPos[0] );
- float distanceValue1 = distance( camera_position, ctWorldPos[1] );
- float distanceValue2 = distance( camera_position, ctWorldPos[2] );
-
- float range = distanceRange[1] - distanceRange[0];
-
- vec3 edgeDistance;
- edgeDistance[0] = ((distanceValue1 + distanceValue2) / 2.0) / range;
- edgeDistance[1] = ((distanceValue2 + distanceValue0) / 2.0) / range;
- edgeDistance[2] = ((distanceValue0 + distanceValue1) / 2.0) / range;
-
- edgeDistance = clamp( edgeDistance, vec3(0.0), vec3(1.0) );
-
- //float af = mix( minTess, maxTess, 1.0 - edgeDistance[gl_InvocationID] );
- float af = 1.0 - edgeDistance[gl_InvocationID];
- af = clamp( af*af*maxTess , minTess, maxTess );
-
- return af;
-}
-
-float adaptiveFeatureFactor( in float minTess, in float maxTess )
-{
- vec3 adaptValue;
- adaptValue[0] = clamp( dot(ctNorm[1], ctNorm[2]), -1.0, 1.0 );
- adaptValue[1] = clamp( dot(ctNorm[2], ctNorm[0]), -1.0, 1.0 );
- adaptValue[2] = clamp( dot(ctNorm[0], ctNorm[1]), -1.0, 1.0 );
-
- //float af = min( adaptValue[0], min(adaptValue[1], adaptValue[2]) );
- // map [-1, +1] range to [0, 1] range
- float af = (adaptValue[gl_InvocationID] + 1.0) / 2.0;
-
- af = mix( minTess, maxTess, 1.0 - af );
-
- return af;
-}
-
-float getwij(int i, int j)
-{
- return dot(gl_in[j].gl_Position.xyz - gl_in[i].gl_Position.xyz, ctNorm[i]);
-}
-
-float getvij(int i, int j)
-{
- vec3 pji = gl_in[j].gl_Position.xyz - gl_in[i].gl_Position.xyz;
- vec3 nij = ctNorm[i] + ctNorm[j];
-
- return 2.0*dot(pji, nij)/dot(pji, pji);
-}
-
-void tessShader ( in float tessEdge, in float tessInner )
-{
- // setup control points
- // notations and formulas see http://alex.vlachos.com/graphics/CurvedPNTriangles.pdf
- // note we compute separate x,y,z component for each invocation
- float b300 = gl_in[0].gl_Position[gl_InvocationID];
- float b030 = gl_in[1].gl_Position[gl_InvocationID];
- float b003 = gl_in[2].gl_Position[gl_InvocationID];
- float n200 = ctNorm[0][gl_InvocationID];
- float n020 = ctNorm[1][gl_InvocationID];
- float n002 = ctNorm[2][gl_InvocationID];
- float t200 = ctTangent[0][gl_InvocationID];
- float t020 = ctTangent[1][gl_InvocationID];
- float t002 = ctTangent[2][gl_InvocationID];
-
- // compute tangent control points
- tcTessPatch[gl_InvocationID].b210 = (2.0*b300 + b030 - getwij(0,1)*n200)/3.0;
- tcTessPatch[gl_InvocationID].b120 = (2.0*b030 + b300 - getwij(1,0)*n020)/3.0;
- tcTessPatch[gl_InvocationID].b021 = (2.0*b030 + b003 - getwij(1,2)*n020)/3.0;
- tcTessPatch[gl_InvocationID].b012 = (2.0*b003 + b030 - getwij(2,1)*n002)/3.0;
- tcTessPatch[gl_InvocationID].b102 = (2.0*b003 + b300 - getwij(2,0)*n002)/3.0;
- tcTessPatch[gl_InvocationID].b201 = (2.0*b300 + b003 - getwij(0,2)*n200)/3.0;
- // compute center control point
- float E = ( tcTessPatch[gl_InvocationID].b210
- + tcTessPatch[gl_InvocationID].b120
- + tcTessPatch[gl_InvocationID].b021
- + tcTessPatch[gl_InvocationID].b012
- + tcTessPatch[gl_InvocationID].b102
- + tcTessPatch[gl_InvocationID].b201 ) / 6.0;
-
- float V = ( b300 + b030 + b003 ) / 3.0;
- tcTessPatch[gl_InvocationID].b111 = E + (E-V)*0.5;
-
- // compute normals
- tcTessPatch[gl_InvocationID].n110 = n200 + n020 - getvij(0,1) * (b030 - b300);
- tcTessPatch[gl_InvocationID].n011 = n020 + n002 - getvij(1,2) * (b003 - b030);
- tcTessPatch[gl_InvocationID].n101 = n002 + n200 - getvij(2,0) * (b300 - b003);
- // compute tangents
- tcTessPatch[gl_InvocationID].t110 = t200 + t020 - getvij(0,1) * (b030 - b300);
- tcTessPatch[gl_InvocationID].t011 = t020 + t002 - getvij(1,2) * (b003 - b030);
- tcTessPatch[gl_InvocationID].t101 = t002 + t200 - getvij(2,0) * (b300 - b003);
-
- // compute backface
- float bf = isBackFace();
- bf = max(disableCulling, bf);
-
- // adapative tessellation factor regarding features
- float af = adaptiveFeatureFactor( tessInner, tessEdge );
-
- //float cf = adaptiveCameraFactor( tessInner, tessEdge );
-
- // Calculate the tessellation levels
- gl_TessLevelInner[0] = af * bf;
- gl_TessLevelOuter[gl_InvocationID] = af * bf;
-}
-
-#endif
-
-#if TESSELLATION_EVALUATION_SHADER
-layout (triangles, fractional_odd_spacing, ccw) in;
-
-layout(location=15) in NPatchTessPatch tcTessPatch[];
-
-// global setup in main
-vec3 ctNorm[3];
-vec3 teNorm;
-vec3 ctTangent[3];
-vec3 teTangent;
-vec3 teBinormal;
-
-bool doLinear(int i, int j)
-{
- /*
- vec3 edgeji = gl_in[j].gl_Position.xyz - gl_in[i].gl_Position.xyz;
-
- float di = sign( dot( ctNorm[i], edgeji ) );
- float dj = sign( dot( ctNorm[j], -edgeji ) );
-
- if ( di != dj )
- return false;
- else
- return true;*/
-
- // Always do linear normal interpolation for now
- // Seems to produce always good results unless we would produce
- // a s-shaped triangle.
- return true;
-}
-
-vec4 tessShader ( )
-{
- // pre compute square tesselation coord
- vec3 tessSquared = gl_TessCoord * gl_TessCoord;
- vec3 tessCubed = tessSquared * gl_TessCoord;
-
- // combine control points
- vec3 b210 = vec3(tcTessPatch[0].b210, tcTessPatch[1].b210, tcTessPatch[2].b210);
- vec3 b120 = vec3(tcTessPatch[0].b120, tcTessPatch[1].b120, tcTessPatch[2].b120);
- vec3 b021 = vec3(tcTessPatch[0].b021, tcTessPatch[1].b021, tcTessPatch[2].b021);
- vec3 b012 = vec3(tcTessPatch[0].b012, tcTessPatch[1].b012, tcTessPatch[2].b012);
- vec3 b102 = vec3(tcTessPatch[0].b102, tcTessPatch[1].b102, tcTessPatch[2].b102);
- vec3 b201 = vec3(tcTessPatch[0].b201, tcTessPatch[1].b201, tcTessPatch[2].b201);
- vec3 b111 = vec3(tcTessPatch[0].b111, tcTessPatch[1].b111, tcTessPatch[2].b111);
-
- // combine control normals
- vec3 n110 = vec3(tcTessPatch[0].n110, tcTessPatch[1].n110, tcTessPatch[2].n110);
- vec3 n011 = vec3(tcTessPatch[0].n011, tcTessPatch[1].n011, tcTessPatch[2].n011);
- vec3 n101 = vec3(tcTessPatch[0].n101, tcTessPatch[1].n101, tcTessPatch[2].n101);
-
- // combine control tangents
- vec3 t110 = vec3(tcTessPatch[0].t110, tcTessPatch[1].t110, tcTessPatch[2].t110);
- vec3 t011 = vec3(tcTessPatch[0].t011, tcTessPatch[1].t011, tcTessPatch[2].t011);
- vec3 t101 = vec3(tcTessPatch[0].t101, tcTessPatch[1].t101, tcTessPatch[2].t101);
-
- // NPatch normal
- if ( doLinear( 0, 1 ) == true )
- {
- // linear normal
- teNorm = ctNorm[0] * gl_TessCoord[2]
- + ctNorm[1] * gl_TessCoord[0]
- + ctNorm[2] * gl_TessCoord[1];
- // NPatch tangent
- teTangent = ctTangent[0] * gl_TessCoord[2]
- + ctTangent[1] * gl_TessCoord[0]
- + ctTangent[2] * gl_TessCoord[1];
- }
- else
- {
- // quadratic normal
- teNorm = ctNorm[0] * tessSquared[2]
- + ctNorm[1] * tessSquared[0]
- + ctNorm[2] * tessSquared[1]
- + n110*gl_TessCoord[2] * gl_TessCoord[0]
- + n011*gl_TessCoord[0] * gl_TessCoord[1]
- + n101*gl_TessCoord[2] * gl_TessCoord[1];
-
- // NPatch tangent
- teTangent = ctTangent[0] * tessSquared[2]
- + ctTangent[1] * tessSquared[0]
- + ctTangent[2] * tessSquared[1]
- + t110*gl_TessCoord[2] * gl_TessCoord[0]
- + t011*gl_TessCoord[0] * gl_TessCoord[1]
- + t101*gl_TessCoord[2] * gl_TessCoord[1];
- }
-
- // NPatch binormal
- teBinormal = cross( teNorm, teTangent );
-
- // npatch interpolated position
- vec3 finalPos = gl_in[0].gl_Position.xyz * tessCubed[2]
- + gl_in[1].gl_Position.xyz * tessCubed[0]
- + gl_in[2].gl_Position.xyz * tessCubed[1]
- + b210 * 3.0 * tessSquared[2] * gl_TessCoord[0]
- + b120 * 3.0 * tessSquared[0] * gl_TessCoord[2]
- + b201 * 3.0 * tessSquared[2] * gl_TessCoord[1]
- + b021 * 3.0 * tessSquared[0] * gl_TessCoord[1]
- + b102 * 3.0 * tessSquared[1] * gl_TessCoord[2]
- + b012 * 3.0 * tessSquared[1] * gl_TessCoord[0]
- + b111 * 6.0 * gl_TessCoord[0] * gl_TessCoord[1] * gl_TessCoord[2];
-
- return vec4( finalPos, 1.0 );
-}
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationNPatchCM.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationNPatchCM.glsllib
deleted file mode 100644
index 4616b583..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationNPatchCM.glsllib
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_NPATCH_CM_GLSLLIB
-#define TESSELLATION_NPATCH_CM_GLSLLIB GLSLLIB
-
-
-#include "tessellationNPatch.glsllib"
-
-
-#if TESSELLATION_CONTROL_SHADER
-
-uniform float tessLevelOuter;
-uniform float tessLevelInner;
-
-attribute vec3 varNormal[];
-attribute vec3 varObjPos[];
-
-varying vec3 varNormalTC[];
-varying vec3 varObjPosTC[];
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 varTexCoord0[];
-varying vec3 varTexCoord0TC[];
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 varTangent[];
-attribute vec3 varObjTangent[];
-varying vec3 varTangentTC[];
-varying vec3 varObjTangentTC[];
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 varBinormal[];
-attribute vec3 varObjBinormal[];
-varying vec3 varBinormalTC[];
-varying vec3 varObjBinormalTC[];
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 varWorldPos[];
-varying vec3 varWorldPosTC[];
-#endif
-
-void main() {
-
- ctNorm[0] = varNormal[0];
- ctNorm[1] = varNormal[1];
- ctNorm[2] = varNormal[2];
-#if QT3DS_ENABLE_TEXTAN
- ctTangent[0] = varObjTangent[0];
- ctTangent[1] = varObjTangent[1];
- ctTangent[2] = varObjTangent[2];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- ctWorldPos[0] = varWorldPos[0];
- ctWorldPos[1] = varWorldPos[1];
- ctWorldPos[2] = varWorldPos[2];
-#endif
-
- gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
- tessShader( tessLevelOuter, tessLevelInner);
-
- varObjPosTC[gl_InvocationID] = varObjPos[gl_InvocationID];
- varNormalTC[gl_InvocationID] = varNormal[gl_InvocationID];
-
-#if QT3DS_ENABLE_UV0
- varTexCoord0TC[gl_InvocationID] = varTexCoord0[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- varTangentTC[gl_InvocationID] = varTangent[gl_InvocationID];
- varObjTangentTC[gl_InvocationID] = varObjTangent[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- varBinormalTC[gl_InvocationID] = varBinormal[gl_InvocationID];
- varObjBinormalTC[gl_InvocationID] = varObjBinormal[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- varWorldPosTC[gl_InvocationID] = varWorldPos[gl_InvocationID];
-#endif
-}
-
-#endif
-
-
-#if TESSELLATION_EVALUATION_SHADER
-
-#if (GEOMETRY_SHADER == 1)
-#define VARYING_NAME(varyingName) varyingName##TE
-#else
-#define VARYING_NAME(varyingName) varyingName
-#endif
-
-uniform mat3 normal_matrix;
-uniform mat4 model_view_projection_matrix;
-
-attribute vec3 varNormalTC[];
-attribute vec3 varObjPosTC[];
-
-varying vec3 VARYING_NAME(varNormal);
-varying vec3 VARYING_NAME(varObjPos);
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 varTexCoord0TC[];
-varying vec3 VARYING_NAME(varTexCoord0);
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 varTangentTC[];
-attribute vec3 varObjTangentTC[];
-varying vec3 VARYING_NAME(varTangent);
-varying vec3 VARYING_NAME(varObjTangent);
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 varBinormalTC[];
-attribute vec3 varObjBinormalTC[];
-varying vec3 VARYING_NAME(varBinormal);
-varying vec3 VARYING_NAME(varObjBinormal);
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 varWorldPosTC[];
-varying vec3 VARYING_NAME(varWorldPos);
-#endif
-
-void main() {
-
- ctNorm[0] = varNormalTC[0];
- ctNorm[1] = varNormalTC[1];
- ctNorm[2] = varNormalTC[2];
-#if QT3DS_ENABLE_TEXTAN
- ctTangent[0] = varObjTangentTC[0];
- ctTangent[1] = varObjTangentTC[1];
- ctTangent[2] = varObjTangentTC[2];
-#endif
-
- vec4 pos = tessShader( );
-
- gl_Position = model_view_projection_matrix * pos;
-
- VARYING_NAME(varObjPos) = gl_TessCoord.z * varObjPosTC[0] + gl_TessCoord.x * varObjPosTC[1] + gl_TessCoord.y * varObjPosTC[2];
-
-#if QT3DS_ENABLE_UV0
- VARYING_NAME(varTexCoord0) = gl_TessCoord.z * varTexCoord0TC[0] + gl_TessCoord.x * varTexCoord0TC[1] + gl_TessCoord.y * varTexCoord0TC[2];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- VARYING_NAME(varWorldPos) = gl_TessCoord.z * varWorldPosTC[0] + gl_TessCoord.x * varWorldPosTC[1] + gl_TessCoord.y * varWorldPosTC[2];
-#endif
-
- VARYING_NAME(varNormal) = normalize(normal_matrix * teNorm);
-
-#if QT3DS_ENABLE_TEXTAN
- VARYING_NAME(varTangent) = normalize(normal_matrix * teTangent);
- VARYING_NAME(varObjTangent) = gl_TessCoord.z * varObjTangentTC[0] + gl_TessCoord.x * varObjTangentTC[1] + gl_TessCoord.y * varObjTangentTC[2];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- VARYING_NAME(varBinormal) = normalize(normal_matrix * teBinormal);
- VARYING_NAME(varObjBinormal) = gl_TessCoord.z * varObjBinormalTC[0] + gl_TessCoord.x * varObjBinormalTC[1] + gl_TessCoord.y * varObjBinormalTC[2];
-#endif
-}
-
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationPath.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationPath.glsllib
deleted file mode 100644
index 17b87b08..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationPath.glsllib
+++ /dev/null
@@ -1,183 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_PATH_GLSLLIB
-#define TESSELLATION_PATH_GLSLLIB
-
-
-#if TESSELLATION_CONTROL_SHADER
-layout (vertices = 5) out;
-
-void tessShader ( in float edgeTessAmount, float innerTessAmount )
-{
- gl_TessLevelOuter[0] = innerTessAmount;
- gl_TessLevelOuter[1] = edgeTessAmount;
- gl_TessLevelOuter[2] = innerTessAmount;
- gl_TessLevelOuter[3] = edgeTessAmount;
-
- gl_TessLevelInner[0] = edgeTessAmount / 2.0;
- gl_TessLevelInner[1] = innerTessAmount;
-}
-
-#endif
-
-#if TESSELLATION_EVALUATION_SHADER
-layout (quads, equal_spacing, cw) in;
-
-vec2 getTangent(vec2 p0, vec2 p1, vec2 p2, vec2 p3, float t)
-{
- // derivative
- float dbt0 = -3.0 * (1.0 - t) * (1.0 - t);
- float dbt1 = 3.0 * (1.0 - t) * (1.0 - 3.0 * t);
- float dbt2 = 3.0 * t * (2.0 - 3.0 * t);
- float dbt3 = 3.0 * t * t;
-
- // tangent on curve
- return normalize( dbt0 * p0 + dbt1 * p1 + dbt2 * p2 + dbt3 * p3 );
-}
-//An exact cross product would involve normalizing dx,dy. Since
-//this algorithm needs merely the sign, normalization is not necessary.
-float roughCrossProd( vec2 prev, vec2 point, vec2 next )
-{
- vec2 inDxDy = point - prev;
- vec2 outDxDy = next - point;
- return inDxDy.x * outDxDy.y - inDxDy.y * outDxDy.x;
-}
-
-//The incoming corss product tells us both if we should do a seam merge
-//and if the merge is above or below point in gl_TessCoord.y space; we know the
-//anchor point is at .5 gl_TessCoord.y space.
-vec3 computeAdjoiningFactors( float cross, vec2 adjoining, vec2 point, float tessY )
-{
- vec3 retval = vec3( 0.0, 0.0, 0.0 );
- float multiplier = cross < 0.0 ? 1.0 : -1.0;
- float weight = abs(cross) > 0.001 ? multiplier * ( ( tessY - .5 )/ .5 ) : 0.0;
- retval.z = weight > 0.0 ? 1.0 : 0.0;
- retval.xy = mix( point, adjoining, weight );
- return retval;
-}
-
-#define NO_TAPER 0
-#define BEGIN_TAPER 1
-#define END_TAPER 2
-
-//Tapering is done by interpolating the path width somewhat cleverly.
-float getTaperResult( float inIncomingValue, float inBeginValue, float inEndValue, vec2 taperData, uint inMode )
-{
- float mixInfo = mix( taperData.x, taperData.y, gl_TessCoord.x );
- float theValueMixer = inMode == BEGIN_TAPER ? inBeginValue : inEndValue;
- return mix( theValueMixer, inIncomingValue, mixInfo );
-}
-
-uniform vec2 beginTaperInfo;
-uniform vec2 endTaperInfo;
-
-struct STessShaderResult
-{
- vec3 m_Position;
- vec2 m_TexCoord;
- vec2 m_Tangent;
- vec2 m_Binormal;
- float m_Opacity;
-};
-
-STessShaderResult tessShader ( float inPathWidth )
-{
- vec2 p1 = gl_in[0].gl_Position.xy;
- vec2 c1 = gl_in[0].gl_Position.zw; //c1
- vec2 c2 = gl_in[1].gl_Position.xy; //c2
- vec2 p2 = gl_in[1].gl_Position.zw;
- vec4 taperData = gl_in[3].gl_Position;
- vec2 udata = gl_in[4].gl_Position.xy;
-
- //Adjust width for taper if necessary.
- inPathWidth = taperData.z > 0.0 ? getTaperResult( inPathWidth, beginTaperInfo.x, endTaperInfo.x, taperData.xy, uint(taperData.z) ) : inPathWidth;
-
- float adjoiningWeight = 0.0;
- vec2 adjoining = vec2( 0.0, 0.0 );
- if ( gl_TessCoord.x == floor(gl_TessCoord.x) ) // gl_TessCord.x either 0.0 or 1.0
- {
- vec2 point, cross1, cross2;
- if ( gl_TessCoord.x == 0.0 )
- {
- adjoining = gl_in[2].gl_Position.xy;
- point = p1;
- cross1 = adjoining;
- cross2 = c1;
- }
- else // gl_TessCoord.x == 1.0
- {
- adjoining = gl_in[2].gl_Position.zw;
- point = p2;
- cross1 = c2;
- cross2 = adjoining;
- }
- float cross = roughCrossProd( cross1, point, cross2 );
- vec3 adjoiningFactors = computeAdjoiningFactors( cross, adjoining, point, gl_TessCoord.y );
- adjoining = adjoiningFactors.xy;
- adjoiningWeight = adjoiningFactors.z;
- }
-
- float v = gl_TessCoord.x;
- // cubic basis function calculated from v.
- float bv0 = (1.0 - v) * (1.0 - v) * (1.0 - v);
- float bv1 = 3.0 * v * (1.0 - v) * (1.0 - v);
- float bv2 = 3.0 * v * v * (1.0 - v);
- float bv3 = v * v * v;
-
- //u ranges from 0 - 1. What we want is to
- //have u range from -1,1.
- float u = 2.0 * ( gl_TessCoord.y - .5 );
-
- vec2 tangent = getTangent( p1, c1, c2, p2, v );
- vec2 normal = vec2( tangent.y, -tangent.x );
-
- vec2 offset = normal * inPathWidth * u;
-
- vec2 pointOnPath = bv0*p1 + bv1*c1 + bv2*c2 + bv3*p2;
-
- vec2 finalPosXY = offset + pointOnPath;
-
- STessShaderResult retval;
- retval.m_Position = vec3( mix( finalPosXY, adjoining, adjoiningWeight), 0.0 );
- retval.m_Opacity = taperData.z > 0.0 ? getTaperResult( 1.0, beginTaperInfo.y, endTaperInfo.y, taperData.xy, uint(taperData.z) ) : 1.0;
-
- // cubic interpolation of the texture coords
- retval.m_TexCoord.x = mix( udata.x, udata.y, v );
- retval.m_TexCoord.y = gl_TessCoord.y;
- retval.m_Tangent = tangent;
- retval.m_Binormal = normal;
-
- return retval;
-}
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationPhong.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationPhong.glsllib
deleted file mode 100644
index 98a683dc..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationPhong.glsllib
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_PHONG_GLSLLIB
-#define TESSELLATION_PHONG_GLSLLIB
-
-struct PhongTessPatch
-{
- float projIJ;
- float projJK;
- float projIK;
-};
-
-#if TESSELLATION_CONTROL_SHADER
-layout (vertices = 3) out;
-
-layout(location = 15) out PhongTessPatch tcTessPatch[];
-
-// global setup in main
-vec3 ctWorldPos[3];
-vec3 ctNorm[3];
-
-uniform vec3 camera_position;
-uniform vec2 distanceRange;
-uniform float disableCulling;
-
-float isBackFace()
-{
- vec3 faceNormal = normalize( cross( ctWorldPos[2] - ctWorldPos[0], ctWorldPos[1] - ctWorldPos[0] ) );
-
- vec3 ncd = normalize( ctWorldPos[0] - camera_position );
-
- return sign( 0.2 + dot(faceNormal, ncd) ); // 0.2 is a conservative offset to account for curved surfaces
-}
-
-float adaptiveCameraFactor( in float minTess, in float maxTess )
-{
- float distanceValue0 = distance( camera_position, ctWorldPos[0] );
- float distanceValue1 = distance( camera_position, ctWorldPos[1] );
- float distanceValue2 = distance( camera_position, ctWorldPos[2] );
-
- float range = distanceRange[1] - distanceRange[0];
-
- vec3 edgeDistance;
- edgeDistance[0] = ((distanceValue1 + distanceValue2) / 2.0) / range;
- edgeDistance[1] = ((distanceValue2 + distanceValue0) / 2.0) / range;
- edgeDistance[2] = ((distanceValue0 + distanceValue1) / 2.0) / range;
-
- edgeDistance = clamp( edgeDistance, vec3(0.0), vec3(1.0) );
-
- //float af = mix( minTess, maxTess, 1.0 - edgeDistance[gl_InvocationID] );
- float af = 1.0 - edgeDistance[gl_InvocationID];
- af = clamp( af*af*maxTess , minTess, maxTess );
-
- return af;
-}
-
-float adaptiveFeatureFactor( in float minTess, in float maxTess )
-{
- vec3 adaptValue;
- adaptValue[0] = clamp( dot(ctNorm[1], ctNorm[2]), -1.0, 1.0 );
- adaptValue[1] = clamp( dot(ctNorm[2], ctNorm[0]), -1.0, 1.0 );
- adaptValue[2] = clamp( dot(ctNorm[0], ctNorm[1]), -1.0, 1.0 );
-
- //float af = min( adaptValue[0], min(adaptValue[1], adaptValue[2]) );
- // map [-1, +1] range to [0, 1] range
- float af = (adaptValue[gl_InvocationID] + 1.0) / 2.0;
-
- af = mix( minTess, maxTess, 1.0 - af );
-
- return af;
-}
-
-float mapToTangentPlane(int i, vec3 q)
-{
- vec3 q_minus_p = q - gl_in[i].gl_Position.xyz;
- return q[gl_InvocationID] - dot(q_minus_p, ctNorm[i]) * ctNorm[i][gl_InvocationID];
-}
-
-void tessShader ( in float tessEdge, in float tessInner )
-{
- // compute projections separate for each xyz component
- tcTessPatch[gl_InvocationID].projIJ = mapToTangentPlane(0, gl_in[1].gl_Position.xyz) + mapToTangentPlane(1, gl_in[0].gl_Position.xyz);
- tcTessPatch[gl_InvocationID].projJK = mapToTangentPlane(1, gl_in[2].gl_Position.xyz) + mapToTangentPlane(2, gl_in[1].gl_Position.xyz);
- tcTessPatch[gl_InvocationID].projIK = mapToTangentPlane(2, gl_in[0].gl_Position.xyz) + mapToTangentPlane(0, gl_in[2].gl_Position.xyz);
-
- // compute backface
- float bf = isBackFace();
- bf = max(disableCulling, bf);
- // adapative tessellation factor regarding features
- float af = adaptiveFeatureFactor( tessInner, tessEdge );
- // adapative tessellation factor regarding camera
- //float cf = adaptiveFeatureFactor( tessInner, tessEdge );
-
- // the camera tess factor is the limit
- //af = min(af, cf);
-
- // Calculate the tessellation levels
- gl_TessLevelInner[0] = af * bf;
- gl_TessLevelOuter[gl_InvocationID] = af * bf;
-}
-
-#endif
-
-#if TESSELLATION_EVALUATION_SHADER
-layout (triangles, equal_spacing, ccw) in;
-
-layout(location = 15) in PhongTessPatch tcTessPatch[];
-
-uniform float phongBlend;
-
-vec4 tessShader ( )
-{
- // pre compute square tesselation coord
- vec3 tessSquared = gl_TessCoord * gl_TessCoord;
-
- // barycentric linear position
- vec3 linearPos = gl_TessCoord.x * gl_in[0].gl_Position.xyz
- + gl_TessCoord.y * gl_in[1].gl_Position.xyz
- + gl_TessCoord.z * gl_in[2].gl_Position.xyz;
-
- // projective terms
- vec3 projJI = vec3(tcTessPatch[0].projIJ, tcTessPatch[1].projIJ, tcTessPatch[2].projIJ);
- vec3 projKJ = vec3(tcTessPatch[0].projJK, tcTessPatch[1].projJK, tcTessPatch[2].projJK);
- vec3 projIK = vec3(tcTessPatch[0].projIK, tcTessPatch[1].projIK, tcTessPatch[2].projIK);
-
- // phong interpolated position
- vec3 phongPos = tessSquared.x * gl_in[0].gl_Position.xyz
- + tessSquared.y * gl_in[1].gl_Position.xyz
- + tessSquared.z * gl_in[2].gl_Position.xyz
- + gl_TessCoord.x * gl_TessCoord.y * projJI
- + gl_TessCoord.y * gl_TessCoord.z * projKJ
- + gl_TessCoord.z * gl_TessCoord.x * projIK;
-
- // final blend between linear and phong interpolation
- vec3 finalPos = (1.0-phongBlend)*linearPos + phongBlend*phongPos;
-
- return vec4( finalPos, 1.0 );
-}
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/tessellationPhongCM.glsllib b/src/Runtime/ogl-runtime/res/effectlib/tessellationPhongCM.glsllib
deleted file mode 100644
index 1374a633..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/tessellationPhongCM.glsllib
+++ /dev/null
@@ -1,179 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESSELLATION_PHONG_CM_GLSLLIB
-#define TESSELLATION_PHONG_CM_ GLSLLIB
-
-
-#include "tessellationPhong.glsllib"
-
-
-#if TESSELLATION_CONTROL_SHADER
-
-uniform float tessLevelOuter;
-uniform float tessLevelInner;
-
-attribute vec3 varNormal[];
-attribute vec3 varObjPos[];
-
-varying vec3 varNormalTC[];
-varying vec3 varObjPosTC[];
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 varTexCoord0[];
-varying vec3 varTexCoord0TC[];
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 varTangent[];
-attribute vec3 varObjTangent[];
-varying vec3 varTangentTC[];
-varying vec3 varObjTangentTC[];
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 varBinormal[];
-attribute vec3 varObjBinormal[];
-varying vec3 varBinormalTC[];
-varying vec3 varObjBinormalTC[];
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 varWorldPos[];
-varying vec3 varWorldPosTC[];
-#endif
-
-void main() {
-
-#if QT3DS_ENABLE_WORLD_POSITION
- ctWorldPos[0] = varWorldPos[0];
- ctWorldPos[1] = varWorldPos[1];
- ctWorldPos[2] = varWorldPos[2];
-#endif
- ctNorm[0] = varNormal[0];
- ctNorm[1] = varNormal[1];
- ctNorm[2] = varNormal[2];
-
- gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
- tessShader( tessLevelOuter, tessLevelInner);
-
- varObjPosTC[gl_InvocationID] = varObjPos[gl_InvocationID];
- varNormalTC[gl_InvocationID] = varNormal[gl_InvocationID];
-
-#if QT3DS_ENABLE_UV0
- varTexCoord0TC[gl_InvocationID] = varTexCoord0[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- varTangentTC[gl_InvocationID] = varTangent[gl_InvocationID];
- varObjTangentTC[gl_InvocationID] = varObjTangent[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- varBinormalTC[gl_InvocationID] = varBinormal[gl_InvocationID];
- varObjBinormalTC[gl_InvocationID] = varObjBinormal[gl_InvocationID];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- varWorldPosTC[gl_InvocationID] = varWorldPos[gl_InvocationID];
-#endif
-}
-
-#endif
-
-
-#if TESSELLATION_EVALUATION_SHADER
-
-#if (GEOMETRY_SHADER == 1)
-#define VARYING_NAME(varyingName) varyingName##TE
-#else
-#define VARYING_NAME(varyingName) varyingName
-#endif
-
-uniform mat3 normal_matrix;
-uniform mat4 model_view_projection_matrix;
-
-attribute vec3 varNormalTC[];
-attribute vec3 varObjPosTC[];
-
-varying vec3 VARYING_NAME(varNormal);
-varying vec3 VARYING_NAME(varObjPos);
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 varTexCoord0TC[];
-varying vec3 VARYING_NAME(varTexCoord0);
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 varTangentTC[];
-attribute vec3 varObjTangentTC[];
-varying vec3 VARYING_NAME(varTangent);
-varying vec3 VARYING_NAME(varObjTangent);
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 varBinormalTC[];
-attribute vec3 varObjBinormalTC[];
-varying vec3 VARYING_NAME(varBinormal);
-varying vec3 VARYING_NAME(varObjBinormal);
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 varWorldPosTC[];
-varying vec3 VARYING_NAME(varWorldPos);
-#endif
-
-void main() {
- vec4 pos = tessShader( );
-
- gl_Position = model_view_projection_matrix * pos;
-
- VARYING_NAME(varObjPos) = gl_TessCoord.x * varObjPosTC[0] + gl_TessCoord.y * varObjPosTC[1] + gl_TessCoord.z * varObjPosTC[2];
- VARYING_NAME(varNormal) = gl_TessCoord.x * varNormalTC[0] + gl_TessCoord.y * varNormalTC[1] + gl_TessCoord.z * varNormalTC[2];
-
-#if QT3DS_ENABLE_UV0
- VARYING_NAME(varTexCoord0) = gl_TessCoord.x * varTexCoord0TC[0] + gl_TessCoord.y * varTexCoord0TC[1] + gl_TessCoord.z * varTexCoord0TC[2];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- VARYING_NAME(varTangent) = gl_TessCoord.x * varTangentTC[0] + gl_TessCoord.y * varTangentTC[1] + gl_TessCoord.z * varTangentTC[2];
- VARYING_NAME(varObjTangent) = gl_TessCoord.x * varObjTangentTC[0] + gl_TessCoord.y * varObjTangentTC[1] + gl_TessCoord.z * varObjTangentTC[2];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- VARYING_NAME(varBinormal) = gl_TessCoord.x * varBinormalTC[0] + gl_TessCoord.y * varBinormalTC[1] + gl_TessCoord.z * varBinormalTC[2];
- VARYING_NAME(varObjBinormal) = gl_TessCoord.x * varObjBinormalTC[0] + gl_TessCoord.y * varObjBinormalTC[1] + gl_TessCoord.z * varObjBinormalTC[2];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- VARYING_NAME(varWorldPos) = gl_TessCoord.x * varWorldPosTC[0] + gl_TessCoord.y * varWorldPosTC[1] + gl_TessCoord.z * varWorldPosTC[2];
-#endif
-
- VARYING_NAME(varNormal) = normalize(normal_matrix * VARYING_NAME(varNormal));
-}
-
-#endif
-
-#endif
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/textureCoordinateInfo.glsllib b/src/Runtime/ogl-runtime/res/effectlib/textureCoordinateInfo.glsllib
deleted file mode 100644
index a90ffbe9..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/textureCoordinateInfo.glsllib
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TEXTURE_COORDINATE_INFO_GLSLLIB
-#define TEXTURE_COORDINATE_INFO_GLSLLIB
-
-#ifdef QT3DS_DEFINE_API
-
-struct texture_coordinate_info
-{
- vec3 position;
- vec3 tangent_u;
- vec3 tangent_v;
-};
-
-#endif
-
-texture_coordinate_info textureCoordinateInfo( in vec3 pos, in vec3 tangentU, in vec3 tangentV )
-{
- texture_coordinate_info tci;
- tci.position = pos;
- tci.tangent_u = normalize( tangentU );
- tci.tangent_v = normalize( tangentV );
- return( tci );
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/transformCoordinate.glsllib b/src/Runtime/ogl-runtime/res/effectlib/transformCoordinate.glsllib
deleted file mode 100644
index ccdf7d0a..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/transformCoordinate.glsllib
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TRANSFORM_COORDINATE_GLSLLIB
-#define TRANSFORM_COORDINATE_GLSLLIB
-
-texture_coordinate_info transformCoordinate( in mat4 transform, in texture_coordinate_info coordinate )
-{
- texture_coordinate_info tci;
- tci.position = ( transform * vec4( coordinate.position, 1.0 ) ).xyz;
- tci.tangent_u = ( transform * vec4( coordinate.tangent_u, 0.0 ) ).xyz;
- tci.tangent_v = ( transform * vec4( coordinate.tangent_v, 0.0 ) ).xyz;
- return( tci );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/vertexFragmentBase.glsllib b/src/Runtime/ogl-runtime/res/effectlib/vertexFragmentBase.glsllib
deleted file mode 100644
index add11bbc..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/vertexFragmentBase.glsllib
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef VERTEX_FRAGMENT_BASE_GLSLLIB
-#define VERTEX_FRAGMENT_BASE_GLSLLIB
-
- //FRAGMENT_SHADER
- uniform vec3 camera_position; //position in world space of the camera
-
-// add global variables
-vec3 normal;
-vec3 surfNormal;
-vec3 texCoord0;
-vec3 tangent;
-vec3 binormal;
-vec3 viewDir;
-
-
-// add shader input
-
-void initializeBaseFragmentVariables()
-{
- normal = normalize( varNormal );
- surfNormal = normalize( varNormal );
-
- texCoord0 = vec3( varTexCoord0.xy, 1.0 );
- tangent = normalize( varTangent );
-
- binormal = normalize( varBinormal );
-
- viewDir = normalize( camera_position - varWorldPos );
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/effectlib/viewProperties.glsllib b/src/Runtime/ogl-runtime/res/effectlib/viewProperties.glsllib
deleted file mode 100644
index ef6b01ff..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/viewProperties.glsllib
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef VIEW_PROPERTIES_GLSLLIB
-#define VIEW_PROPERTIES_GLSLLIB
-
-uniform mat4 view_projection_matrix;
-uniform mat4 view_matrix;
-uniform vec2 camera_properties; //near clip x, far clip y
-#ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB
-uniform vec3 camera_position; //position in world space of the camera
-#endif
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/res/effectlib/weightedLayer.glsllib b/src/Runtime/ogl-runtime/res/effectlib/weightedLayer.glsllib
deleted file mode 100644
index 781ffacf..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/weightedLayer.glsllib
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-vec4 weightedLayer( in float weight, in vec3 layercolor, in vec4 layer, in vec4 base, in float alpha )
-{
- return vec4( mix( base.rgb, layer.rgb * layercolor, weight ), alpha );
-}
-
diff --git a/src/Runtime/ogl-runtime/res/effectlib/wireframeCM.glsllib b/src/Runtime/ogl-runtime/res/effectlib/wireframeCM.glsllib
deleted file mode 100644
index fcbf7e9f..00000000
--- a/src/Runtime/ogl-runtime/res/effectlib/wireframeCM.glsllib
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef WIREFRAME_CM_GLSLLIB
-#define WIREFRAME_CM_GLSLLIB
-
-#ifdef GL_ES
-precision highp float;
-precision highp int;
-#endif
-
-#if (TESSELLATION_EVALUATION_SHADER == 1)
-#define VARYING_NAME(varyingName) varyingName##TE
-#else
-#define VARYING_NAME(varyingName) varyingName##VX
-#endif
-
-attribute vec3 VARYING_NAME(varNormal)[];
-attribute vec3 VARYING_NAME(varObjPos)[];
-
-varying vec3 varNormal;
-varying vec3 varObjPos;
-
-#if QT3DS_ENABLE_UV0
-attribute vec3 VARYING_NAME(varTexCoord0)[];
-varying vec3 varTexCoord0;
-#endif
-
-#if QT3DS_ENABLE_TEXTAN
-attribute vec3 VARYING_NAME(varTangent)[];
-attribute vec3 VARYING_NAME(varObjTangent)[];
-varying vec3 varTangent;
-varying vec3 varObjTangent;
-#endif
-
-#if QT3DS_ENABLE_BINORMAL
-attribute vec3 VARYING_NAME(varBinormal)[];
-attribute vec3 VARYING_NAME(varObjBinormal)[];
-varying vec3 varBinormal;
-varying vec3 varObjBinormal;
-#endif
-
-#if QT3DS_ENABLE_WORLD_POSITION
-attribute vec3 VARYING_NAME(varWorldPos)[];
-varying vec3 varWorldPos;
-#endif
-
-varying vec3 varEdgeDistance;
-
-uniform mat4 viewport_matrix;
-
-layout (triangles) in;
-layout (triangle_strip, max_vertices = 3) out;
-
-void main()
-{
- // how this all work see http://developer.download.nvidia.com/SDK/10.5/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf
- // project points to screen space
- vec3 p0 = vec3(viewport_matrix * (gl_in[0].gl_Position / gl_in[0].gl_Position.w));
- vec3 p1 = vec3(viewport_matrix * (gl_in[1].gl_Position / gl_in[1].gl_Position.w));
- vec3 p2 = vec3(viewport_matrix * (gl_in[2].gl_Position / gl_in[2].gl_Position.w));
- // compute triangle heights
- float e1 = length(p1 - p2);
- float e2 = length(p2 - p0);
- float e3 = length(p1 - p0);
- float alpha = acos( (e2*e2 + e3*e3 - e1*e1) / (2.0*e2*e3) );
- float beta = acos( (e1*e1 + e3*e3 - e2*e2) / (2.0*e1*e3) );
- float ha = abs( e3 * sin( beta ) );
- float hb = abs( e3 * sin( alpha ) );
- float hc = abs( e2 * sin( alpha ) );
-
-
- // vertex 0
- varEdgeDistance = vec3(ha*gl_in[0].gl_Position.w, 0.0, 0.0);
- varNormal = VARYING_NAME(varNormal)[0];
- varObjPos = VARYING_NAME(varObjPos)[0];
-#if QT3DS_ENABLE_UV0
- varTexCoord0 = VARYING_NAME(varTexCoord0)[0];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- varTangent = VARYING_NAME(varTangent)[0];
- varObjTangent = VARYING_NAME(varObjTangent)[0];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- varBinormal = VARYING_NAME(varBinormal)[0];
- varObjBinormal = VARYING_NAME(varObjBinormal)[0];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- varWorldPos = VARYING_NAME(varWorldPos)[0];
-#endif
-
- gl_Position = gl_in[0].gl_Position;
- EmitVertex();
-
- // vertex 1
- varEdgeDistance = vec3(0.0, hb*gl_in[1].gl_Position.w, 0.0);
- varNormal = VARYING_NAME(varNormal)[1];
- varObjPos = VARYING_NAME(varObjPos)[1];
-#if QT3DS_ENABLE_UV0
- varTexCoord0 = VARYING_NAME(varTexCoord0)[1];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- varTangent = VARYING_NAME(varTangent)[1];
- varObjTangent = VARYING_NAME(varObjTangent)[1];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- varBinormal = VARYING_NAME(varBinormal)[1];
- varObjBinormal = VARYING_NAME(varObjBinormal)[1];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- varWorldPos = VARYING_NAME(varWorldPos)[1];
-#endif
-
- gl_Position = gl_in[1].gl_Position;
- EmitVertex();
-
- // vertex 2
- varEdgeDistance = vec3(0.0, 0.0, hc*gl_in[2].gl_Position.w);
- varNormal = VARYING_NAME(varNormal)[2];
- varObjPos = VARYING_NAME(varObjPos)[2];
-#if QT3DS_ENABLE_UV0
- varTexCoord0 = VARYING_NAME(varTexCoord0)[2];
-#endif
-#if QT3DS_ENABLE_TEXTAN
- varTangent = VARYING_NAME(varTangent)[2];
- varObjTangent = VARYING_NAME(varObjTangent)[2];
-#endif
-#if QT3DS_ENABLE_BINORMAL
- varBinormal = VARYING_NAME(varBinormal)[2];
- varObjBinormal = VARYING_NAME(varObjBinormal)[2];
-#endif
-#if QT3DS_ENABLE_WORLD_POSITION
- varWorldPos = VARYING_NAME(varWorldPos)[2];
-#endif
-
- gl_Position = gl_in[2].gl_Position;
- EmitVertex();
-
- EndPrimitive();
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/res/primitives/Cone.mesh b/src/Runtime/ogl-runtime/res/primitives/Cone.mesh
deleted file mode 100644
index 7ef00f3b..00000000
--- a/src/Runtime/ogl-runtime/res/primitives/Cone.mesh
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/res/primitives/Cube.mesh b/src/Runtime/ogl-runtime/res/primitives/Cube.mesh
deleted file mode 100644
index af594b2f..00000000
--- a/src/Runtime/ogl-runtime/res/primitives/Cube.mesh
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/res/primitives/Cylinder.mesh b/src/Runtime/ogl-runtime/res/primitives/Cylinder.mesh
deleted file mode 100644
index 0e9fbfcc..00000000
--- a/src/Runtime/ogl-runtime/res/primitives/Cylinder.mesh
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/res/primitives/Rectangle.mesh b/src/Runtime/ogl-runtime/res/primitives/Rectangle.mesh
deleted file mode 100644
index b137cb93..00000000
--- a/src/Runtime/ogl-runtime/res/primitives/Rectangle.mesh
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/res/primitives/Sphere.mesh b/src/Runtime/ogl-runtime/res/primitives/Sphere.mesh
deleted file mode 100644
index 4f61d4c6..00000000
--- a/src/Runtime/ogl-runtime/res/primitives/Sphere.mesh
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/3rdparty.pro b/src/Runtime/ogl-runtime/src/3rdparty/3rdparty.pro
deleted file mode 100644
index deb754e4..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/3rdparty.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS += \
- EASTL
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/EASTL b/src/Runtime/ogl-runtime/src/3rdparty/EASTL
deleted file mode 160000
-Subproject 1f1468dec7c1e9c168d15a35fadc7a084dfcf9e
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/color/CColor.cpp b/src/Runtime/ogl-runtime/src/3rdparty/color/CColor.cpp
deleted file mode 100644
index d21cc945..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/color/CColor.cpp
+++ /dev/null
@@ -1,719 +0,0 @@
-/****************************************************************************\
-Datei : Color.cpp
-Projekt: Farbverwaltung
-Inhalt : CColor Implementierung
-Datum : 10.01.1999
-Autor : Christian Rodemeyer
-Hinweis: (c) 1999 by Christian Rodemeyer
- Info �ber HLS Konvertierungsfunktion
- - Foley and Van Dam: "Fundamentals of Interactive Computer Graphics"
- - MSDN: 'HLS Color Spaces'
- - MSDN: 'Converting Colors Between RGB and HLS'
-\****************************************************************************/
-#include "Qt3DSCommonPrecompile.h"
-#include "CColor.h"
-
-float GetMin( float in1, float in2 );
-float GetMin( float in1, float in2 )
-{
- return ( in1 < in2 ) ? in1 : in2;
-}
-
-float GetMax( float in1, float in2 );
-float GetMax( float in1, float in2 )
-{
- return ( in1 > in2 ) ? in1 : in2;
-}
-
-/****************************************************************************\
- CColor: Implementierung
-\****************************************************************************/
-const CColor::DNamedColor CColor::m_namedColor[CColor::numNamedColors] =
-{
- {aliceblue , "aliceblue"},
- {antiquewhite , "antiquewhite"},
- {aqua , "aqua"},
- {aquamarine , "aquamarine"},
- {azure , "azure"},
- {beige , "beige"},
- {bisque , "bisque"},
- {black , "black"},
- {blanchedalmond , "blanchedalmond"},
- {blue , "blue"},
- {blueviolet , "blueviolet"},
- {brown , "brown"},
- {burlywood , "burlywood"},
- {cadetblue , "cadetblue"},
- {chartreuse , "chartreuse"},
- {chocolate , "chocolate"},
- {coral , "coral"},
- {cornflower , "cornflower"},
- {cornsilk , "cornsilk"},
- {crimson , "crimson"},
- {cyan , "cyan"},
- {darkblue , "darkblue"},
- {darkcyan , "darkcyan"},
- {darkgoldenrod , "darkgoldenrod"},
- {darkgray , "darkgray"},
- {darkgreen , "darkgreen"},
- {darkkhaki , "darkkhaki"},
- {darkmagenta , "darkmagenta"},
- {darkolivegreen , "darkolivegreen"},
- {darkorange , "darkorange"},
- {darkorchid , "darkorchid"},
- {darkred , "darkred"},
- {darksalmon , "darksalmon"},
- {darkseagreen , "darkseagreen"},
- {darkslateblue , "darkslateblue"},
- {darkslategray , "darkslategray"},
- {darkturquoise , "darkturquoise"},
- {darkviolet , "darkviolet"},
- {deeppink , "deeppink"},
- {deepskyblue , "deepskyblue"},
- {dimgray , "dimgray"},
- {dodgerblue , "dodgerblue"},
- {firebrick , "firebrick"},
- {floralwhite , "floralwhite"},
- {forestgreen , "forestgreen"},
- {fuchsia , "fuchsia"},
- {gainsboro , "gainsboro"},
- {ghostwhite , "ghostwhite"},
- {gold , "gold"},
- {goldenrod , "goldenrod"},
- {gray , "gray"},
- {green , "green"},
- {greenyellow , "greenyellow"},
- {honeydew , "honeydew"},
- {hotpink , "hotpink"},
- {indianred , "indianred"},
- {indigo , "indigo"},
- {ivory , "ivory"},
- {khaki , "khaki"},
- {lavender , "lavender"},
- {lavenderblush , "lavenderblush"},
- {lawngreen , "lawngreen"},
- {lemonchiffon , "lemonchiffon"},
- {lightblue , "lightblue"},
- {lightcoral , "lightcoral"},
- {lightcyan , "lightcyan"},
- {lightgoldenrodyellow , "lightgoldenrodyellow"},
- {lightgreen , "lightgreen"},
- {lightgrey , "lightgrey"},
- {lightpink , "lightpink"},
- {lightsalmon , "lightsalmon"},
- {lightseagreen , "lightseagreen"},
- {lightskyblue , "lightskyblue"},
- {lightslategray , "lightslategray"},
- {lightsteelblue , "lightsteelblue"},
- {lightyellow , "lightyellow"},
- {lime , "lime"},
- {limegreen , "limegreen"},
- {linen , "linen"},
- {magenta , "magenta"},
- {maroon , "maroon"},
- {mediumaquamarine , "mediumaquamarine"},
- {mediumblue , "mediumblue"},
- {mediumorchid , "mediumorchid"},
- {mediumpurple , "mediumpurple"},
- {mediumseagreen , "mediumseagreen"},
- {mediumslateblue , "mediumslateblue"},
- {mediumspringgreen , "mediumspringgreen"},
- {mediumturquoise , "mediumturquoise"},
- {mediumvioletred , "mediumvioletred"},
- {midnightblue , "midnightblue"},
- {mintcream , "mintcream"},
- {mistyrose , "mistyrose"},
- {moccasin , "moccasin"},
- {navajowhite , "navajowhite"},
- {navy , "navy"},
- {oldlace , "oldlace"},
- {olive , "olive"},
- {olivedrab , "olivedrab"},
- {orange , "orange"},
- {orangered , "orangered"},
- {orchid , "orchid"},
- {palegoldenrod , "palegoldenrod"},
- {palegreen , "palegreen"},
- {paleturquoise , "paleturquoise"},
- {palevioletred , "palevioletred"},
- {papayawhip , "papayawhip"},
- {peachpuff , "peachpuff"},
- {peru , "peru"},
- {pink , "pink"},
- {plum , "plum"},
- {powderblue , "powderblue"},
- {purple , "purple"},
- {red , "red"},
- {rosybrown , "rosybrown"},
- {royalblue , "royalblue"},
- {saddlebrown , "saddlebrown"},
- {salmon , "salmon"},
- {sandybrown , "sandybrown"},
- {seagreen , "seagreen"},
- {seashell , "seashell"},
- {sienna , "sienna"},
- {silver , "silver"},
- {skyblue , "skyblue"},
- {slateblue , "slateblue"},
- {slategray , "slategray"},
- {snow , "snow"},
- {springgreen , "springgreen"},
- {steelblue , "steelblue"},
- {tan , "tan"},
- {teal , "teal"},
- {thistle , "thistle"},
- {tomato , "tomato"},
- {turquoise , "turquoise"},
- {violet , "violet"},
- {wheat , "wheat"},
- {white , "white"},
- {whitesmoke , "whitesmoke"},
- {yellow , "yellow"},
- {yellowgreen , "yellowgreen"}
-};
-
-const char* CColor::GetNameFromIndex(int i)
-{
- assert(0 <= i && i < numNamedColors);
-
- return m_namedColor[i].name;
-}
-
-CColor CColor::GetColorFromIndex(int i)
-{
- if ( i < 0 ) i = 0;
- else if ( i >= numNamedColors ) i = numNamedColors - 1;
-
- return m_namedColor[i].color;
-}
-
-CColor CColor::FromString(const char* pcColor)
-{
- CColor t( 0, 0, 0) ;
- t.SetString(pcColor);
-
- return t;
-}
-
-CColor::CColor(COLORTYPE cr) :
- m_colorref(cr),
- m_hue( 0.0 ),
- m_saturation( 0.0 ),
- m_luminance( 0.0 ),
- m_bIsRGB(true),
- m_bIsHLS(false)
-{
-}
-
-CColor::CColor(const QColor &c) :
- CColor(c.red(), c.green(), c.blue())
-{
-}
-
-CColor::operator COLORTYPE() const
-{
- return RGB( GetRed( ), GetGreen( ), GetBlue( ) );
-}
-
-CColor::operator QColor() const
-{
- return QColor( GetRed( ), GetGreen( ), GetBlue( ) );
-}
-
-// RGB
-
-void CColor::SetColor(COLORTYPE color)
-{
- this->SetRGB(GetRValue(color), GetGValue(color), GetBValue(color));
-}
-
-CColor::CColor( int red, int green, int blue ):
- m_hue( 0.0 ),
- m_saturation( 0.0 ),
- m_luminance( 0.0 ),
- m_bIsRGB( true ),
- m_bIsHLS( false )
-{
- this->SetRGB( red, green, blue );
-}
-
-void CColor::SetRed(int red)
-{
- red &= 0xFF;
-
- ToRGB();
- m_color[c_red] = static_cast<unsigned char>(red);
- m_bIsHLS = false;
-}
-
-void CColor::SetGreen(int green)
-{
- green &= 0xFF;
-
- ToRGB();
- m_color[c_green] = static_cast<unsigned char>(green);
- m_bIsHLS = false;
-}
-
-void CColor::SetBlue(int blue)
-{
- blue &= 0xFF;
-
- ToRGB();
- m_color[c_blue] = static_cast<unsigned char>(blue);
- m_bIsHLS = false;
-}
-
-void CColor::SetRGB(int red, int green, int blue)
-{
- red &= 0xFF;
- blue &= 0xFF;
- green &= 0xFF;
-
- m_color[c_red] = static_cast<unsigned char>(red);
- m_color[c_green] = static_cast<unsigned char>(green);
- m_color[c_blue] = static_cast<unsigned char>(blue);
- m_bIsHLS = false;
- m_bIsRGB = true;
-}
-
-unsigned int CColor::GetRed() const
-{
- const_cast<CColor*>(this)->ToRGB();
-
- return m_color[c_red];
-}
-
-unsigned int CColor::GetGreen() const
-{
- const_cast<CColor*>(this)->ToRGB();
-
- return m_color[c_green];
-}
-
-unsigned int CColor::GetBlue() const
-{
- const_cast<CColor*>(this)->ToRGB();
-
- return m_color[c_blue];
-}
-
-COLORTYPE CColor::GetRGBColor()
-{
- const_cast<CColor*>(this)->ToRGB();
-
- return (RGB(m_color[c_red], m_color[c_green], m_color[c_blue])) ;
-}
-
-// HSL
-
-void CColor::SetHue(float hue)
-{
- if ( hue < 0 ) hue = 0;
- else if ( hue > 360 ) hue = 360;
-
- ToHLS();
- m_hue = hue;
- m_bIsRGB = false;
-}
-
-void CColor::SetSaturation(float saturation)
-{
- if ( saturation < 0 ) saturation = 0;
- else if ( saturation > 1 ) saturation = 1;
-
- ToHLS();
- m_saturation = saturation;
- m_bIsRGB = false;
-}
-
-void CColor::SetLuminance(float luminance)
-{
- if ( luminance < 0 ) luminance = 0;
- else if ( luminance > 1 ) luminance = 1;
-
- ToHLS();
- m_luminance = luminance;
- m_bIsRGB = false;
-}
-
-void CColor::SetHLS(float hue, float luminance, float saturation)
-{
- if ( hue < 0 ) hue = 0;
- else if ( hue > 360 ) hue = 360;
- if ( saturation < 0 ) saturation = 0;
- else if ( saturation > 1 ) saturation = 1;
- if ( luminance < 0 ) luminance = 0;
- else if ( luminance > 1 ) luminance = 1;
-
- m_hue = hue;
- m_luminance = luminance;
- m_saturation = saturation;
- m_bIsRGB = false;
- m_bIsHLS = true;
-}
-
-float CColor::GetHue() const
-{
- const_cast<CColor*>(this)->ToHLS();
-
- return m_hue;
-}
-
-float CColor::GetSaturation() const
-{
- const_cast<CColor*>(this)->ToHLS();
-
- return m_saturation;
-}
-
-float CColor::GetLuminance() const
-{
- const_cast<CColor*>(this)->ToHLS();
-
- return m_luminance;
-}
-
-// Konvertierung
-
-void CColor::ToHLS()
-{
- if (!m_bIsHLS)
- {
- // Konvertierung
- unsigned char minval = static_cast<unsigned char>( GetMin(m_color[c_red], GetMin(m_color[c_green], m_color[c_blue])) );
- unsigned char maxval = static_cast<unsigned char>( GetMax(m_color[c_red], GetMax(m_color[c_green], m_color[c_blue])) );
- float mdiff = float(maxval) - float(minval);
- float msum = float(maxval) + float(minval);
-
- m_luminance = msum / 510.0f;
-
- if (maxval == minval)
- {
- m_saturation = 0.0f;
- m_hue = 0.0f;
- }
- else
- {
- float rnorm = (maxval - m_color[c_red] ) / mdiff;
- float gnorm = (maxval - m_color[c_green]) / mdiff;
- float bnorm = (maxval - m_color[c_blue] ) / mdiff;
-
- m_saturation = (m_luminance <= 0.5f) ? (mdiff / msum) : (mdiff / (510.0f - msum));
-
- if (m_color[c_red] == maxval)
- m_hue = 60.0f * (6.0f + bnorm - gnorm);
-
- if (m_color[c_green] == maxval)
- m_hue = 60.0f * (2.0f + rnorm - bnorm);
-
- if (m_color[c_blue] == maxval)
- m_hue = 60.0f * (4.0f + gnorm - rnorm);
-
- if (m_hue > 360.0f)
- m_hue = m_hue - 360.0f;
- }
-
- m_bIsHLS = true;
- }
-}
-
-void CColor::ToRGB()
-{
- if (!m_bIsRGB)
- {
- if (m_saturation == 0.0) // Grauton, einfacher Fall
- {
- m_color[c_red] = m_color[c_green] = m_color[c_blue] = (unsigned char)(m_luminance * 255.0);
- }
- else
- {
- float rm1, rm2;
-
- if (m_luminance <= 0.5f)
- rm2 = m_luminance + m_luminance * m_saturation;
- else
- rm2 = m_luminance + m_saturation - m_luminance * m_saturation;
-
- rm1 = 2.0f * m_luminance - rm2;
- m_color[c_red] = ToRGB1(rm1, rm2, m_hue + 120.0f);
- m_color[c_green] = ToRGB1(rm1, rm2, m_hue);
- m_color[c_blue] = ToRGB1(rm1, rm2, m_hue - 120.0f);
- }
-
- m_bIsRGB = true;
- }
-}
-
-unsigned char CColor::ToRGB1(float rm1, float rm2, float rh)
-{
- if (rh > 360.0f)
- rh -= 360.0f;
- else
- if (rh < 0.0f)
- rh += 360.0f;
-
- if (rh < 60.0f)
- rm1 = rm1 + (rm2 - rm1) * rh / 60.0f;
- else
- if (rh < 180.0f)
- rm1 = rm2;
- else
- if (rh < 240.0f)
- rm1 = rm1 + (rm2 - rm1) * (240.0f - rh) / 60.0f;
-
- return static_cast<unsigned char>(rm1 * 255);
-}
-
-// Stringkonvertierung im Format RRGGBB
-
-Q3DStudio::CString CColor::GetString() const
-{
- Q3DStudio::CString color;
- color.Format( _LSTR( "%02X%02X%02X" ), GetRed(), GetGreen(), GetBlue());
-
- return color;
-}
-
-bool CColor::SetString( const char* pcColor)
-{
- int r, g, b;
- bool bRet = false;
-
- if (sscanf(pcColor, "%2x%2x%2x", &r, &g, &b) != 3)
- {
- m_color[c_red] = m_color[c_green] = m_color[c_blue] = 0;
- }
- else
- {
- m_color[c_red] = static_cast<unsigned char>(r);
- m_color[c_green] = static_cast<unsigned char>(g);
- m_color[c_blue] = static_cast<unsigned char>(b);
- m_bIsRGB = true;
- m_bIsHLS = false;
- bRet = true;
- }
-
- return (bRet) ;
-}
-
-Q3DStudio::CString CColor::GetName() const
-{
- Q3DStudio::CString theRetStr;
-
- const_cast<CColor*>(this)->ToRGB();
- int i = numNamedColors;
- while (i-- && m_colorref != m_namedColor[i].color) { }
- if (i < 0)
- {
- theRetStr = L"#" + GetString();
- }
- else
- theRetStr = m_namedColor[i].name;
-
- return (theRetStr);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// global functions
-/////////////////////////////////////////////////////////////////////////////
-
-COLORTYPE GetHueColor(int iHue)
-{
- COLORTYPE theHueColor ;
- unsigned char r, g, b;
-
- HSVToRGB( r, g, b, (float) iHue, 1.0f, 1.0f );
-
- theHueColor = RGB( r, g, b );
-
- return (theHueColor) ;
-}
-
-// r,g,b values are from 0 to 1
-// h = [0,360], s = [0,1], v = [0,1]
-// if s == 0, then h = -1 (undefined)
-
-void RGBtoHSV( float r, float g, float b, float *h, float *s, float *v )
-{
- float min, max, delta;
-
- min = GetMin( GetMin( r, g ), b );
- max = GetMax( GetMax( r, g ), b );
- *v = max; // v
- delta = max - min;
- if ( max != 0 )
- *s = delta / max; // s
- else
- {
- // r = g = b = 0 // s = 0, v is undefined
- *s = 0;
- *h = -1;
- return;
- }
- if ( r == max )
- *h = ( g - b ) / delta; // between yellow & magenta
- else
- if( g == max )
- *h = 2 + ( b - r ) / delta; // between cyan & yellow
- else
- *h = 4 + ( r - g ) / delta; // between magenta & cyan
- *h *= 60; // degrees
- if ( *h < 0 )
- *h += 360;
-}
-
-void RGBToHSV( unsigned char r, unsigned char g, unsigned char b, float* h, float* s, float* v )
-{
- // Convert an RGB to HSV
-
- float fRed, fGreen, fBlue;
-
- // convert 0-255 values to 0-1 range
- fRed = ( ( float ) r ) / 255.0f;
- fGreen = ( ( float ) g ) / 255.0f;
- fBlue = ( ( float ) b ) / 255.0f;
-
- RGBtoHSV( fRed, fGreen, fBlue, h, s, v );
-}
-
-void HSVtoRGB( float *r, float *g, float *b, float h, float s, float v )
-{
- int i;
- float f, p, q, t;
-
- if ( s == 0 )
- {
- // achromatic (grey)
- *r = *g = *b = v;
- return;
- }
-
- h /= 60; // sector 0 to 5
- i = ( int ) floor( h );
- f = h - i; // factorial part of h
- p = v * ( 1 - s );
- q = v * ( 1 - s * f );
- t = v * ( 1 - s * ( 1 - f ) );
-
- switch( i )
- {
- case 0:
- *r = v;
- *g = t;
- *b = p;
- break;
-
- case 1:
- *r = q;
- *g = v;
- *b = p;
- break;
-
- case 2:
- *r = p;
- *g = v;
- *b = t;
- break;
-
- case 3:
- *r = p;
- *g = q;
- *b = v;
- break;
-
- case 4:
- *r = t;
- *g = p;
- *b = v;
- break;
-
- default: // case 5:
- *r = v;
- *g = p;
- *b = q;
- break;
- }
-}
-
-void HSVToRGB( unsigned char& r, unsigned char& g, unsigned char& b, float h, float s, float v )
-{
- // Convert an HSV to RGB
-
- float fRed, fGreen, fBlue;
-
- HSVtoRGB( &fRed, &fGreen, &fBlue, h, s, v );
-
- r = ( unsigned char ) ( fRed * 255.0f );
- g = ( unsigned char ) ( fGreen * 255.0f );
- b = ( unsigned char ) ( fBlue * 255.0f );
-}
-
-short GetHueValue( COLORTYPE inColor )
-{
- float theHue, theSaturation, theBright;
- short theHueValue;
-
- RGBToHSV( GetRValue( inColor ), GetGValue( inColor ), GetBValue( inColor ), &theHue, &theSaturation, &theBright );
-
- theHueValue = ( short ) theHue;
-
- return theHueValue;
-}
-
-short GetSaturationValue( COLORTYPE inColor )
-{
- float theHue, theSaturation, theBright;
- short theSaturationValue;
-
- RGBToHSV( GetRValue( inColor ), GetGValue( inColor ), GetBValue( inColor ), &theHue, &theSaturation, &theBright );
-
- theSaturationValue = ( short ) ( theSaturation * 255.0f );
-
- return theSaturationValue;
-}
-
-short GetBrightnessValue( COLORTYPE inColor )
-{
- float theHue, theSaturation, theBright;
- short theBrightnessValue;
-
- RGBToHSV( GetRValue( inColor ), GetGValue( inColor ), GetBValue( inColor ), &theHue, &theSaturation, &theBright );
-
- theBrightnessValue = ( short ) ( theBright * 255.0f );
-
- return theBrightnessValue;
-}
-
-CColor CColor::GetFractionalColor( long inIndex, long inCount )
-{
- double theE = .2;
- double theRCenter = 1.0 / 6;
- double theGCenter = 3.0 / 6;
- double theBCenter = 5.0 / 6;
- double theRCenter2 = 7.0 / 6;
- double theBCenter2 = -1.0 / 6;
-
- double theInv2eSquare = -1.0 / ( 2 * theE * theE );
- double theMag = 60 / theE;
-
- double thePos = (double)inIndex / inCount;
- double theR = theMag * exp( ( thePos - theRCenter ) * ( thePos - theRCenter ) * theInv2eSquare );
- double theG = theMag * exp( ( thePos - theGCenter ) * ( thePos - theGCenter ) * theInv2eSquare );
- double theB = theMag * exp( ( thePos - theBCenter ) * ( thePos - theBCenter ) * theInv2eSquare );
-
- double theR2 = theMag * exp( ( thePos - theRCenter2 ) * ( thePos - theRCenter2 ) * theInv2eSquare );
- double theB2 = theMag * exp( ( thePos - theBCenter2 ) * ( thePos - theBCenter2 ) * theInv2eSquare );
-
- theR += theR2;
- theB += theB2;
-
- return CColor( (char)( theR + .5 ), (char)( theG + .5 ), (char)( theB + .5 ) );
-}
-
-QColor CColor::getQColor() const
-{
- const_cast<CColor *>(this)->ToRGB();
-
- return QColor(m_color[c_red], m_color[c_green], m_color[c_blue]);
-}
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/color/CColor.h b/src/Runtime/ogl-runtime/src/3rdparty/color/CColor.h
deleted file mode 100644
index e6f487b5..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/color/CColor.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/****************************************************************************\
-Datei : Color.h
-Projekt: Farbverwaltung
-Inhalt : CColor Deklaration
-Datum : 10.01.1999
-Autor : Christian Rodemeyer
-Hinweis: (c) 1999 by Christian Rodemeyer
-\****************************************************************************/
-#pragma once
-
-#ifndef INCLUDED_COLOR_H
-#define INCLUDED_COLOR_H
-
-/****************************************************************************\
- CColor: Repr�sentiert einen Farbwert
-\****************************************************************************/
-
-typedef unsigned long COLORTYPE;
-
-#include "Qt3DSString.h"
-#include <QColor>
-
-class CColor
-{
-public:
-
- // COLORREF Konvertierung
- // ----------------------
- CColor( COLORTYPE cr = 0 );
- CColor( int red, int green, int blue );
- CColor( const QColor& c );
- operator COLORTYPE() const;
-
- operator QColor() const;
-
- // RGB - Routinen
- // --------------
- void SetRed(int red); // 0..255
- void SetGreen(int green); // 0..255
- void SetBlue(int blue); // 0..255
- void SetRGB(int red, int green, int blue);
- void SetColor(COLORTYPE color);
-
- unsigned int GetRed() const; // 0..255
- unsigned int GetGreen() const; // 0..255
- unsigned int GetBlue() const; // 0..255
- COLORTYPE GetRGBColor();
-
- // HLS - Routinen
- // --------------
- void SetHue(float hue); // 0.0 .. 360.0
- void SetLuminance(float luminance); // 0.0 .. 1.0
- void SetSaturation(float saturation); // 0.0 .. 1.0
- void SetHLS(float hue, float luminance, float saturation);
-
- float GetHue() const; // 0.0 .. 360.0
- float GetLuminance() const; // 0.0 .. 1.0
- float GetSaturation() const; // 0.0 .. 1.0
-
- // String Konvertierung
- // ---------------------
- Q3DStudio::CString GetString() const; // Liefert String im Format RRGGBB
- bool SetString( const char* pcColor); // Erwartet String im Format RRGGBB
- QColor getQColor() const;
-
- // Benannte Web Farben
- // -------------------
- Q3DStudio::CString GetName() const; // Liefert String mit benannter Farbe oder #RRGGBB falls kein Name bekannt
-
- static CColor FromString( const char* pcColor);
- static const char* GetNameFromIndex(int i);
- static CColor GetColorFromIndex(int i);
- static int GetNumNames() {return numNamedColors;}
- static CColor GetFractionalColor( long inIndex, long inCount );
-
- enum ENamedColor // Named Colors, could be used as COLORREF
- {
- none = 0x7FFFFFFF, // keine Farbe
- aliceblue = 0x00FFF8F0, // RGB(0xF0, 0xF8, 0xFF)
- antiquewhite = 0x00D7EBFA, // RGB(0xFA, 0xEB, 0xD7)
- aqua = 0x00FFFF00, // RGB(0x00, 0xFF, 0xFF)
- aquamarine = 0x00D4FF7F, // RGB(0x7F, 0xFF, 0xD4)
- azure = 0x00FFFFF0, // RGB(0xF0, 0xFF, 0xFF)
- beige = 0x00DCF5F5, // RGB(0xF5, 0xF5, 0xDC)
- bisque = 0x00C4E4FF, // RGB(0xFF, 0xE4, 0xC4)
- black = 0x00000000, // RGB(0x00, 0x00, 0x00)
- blanchedalmond = 0x00CDEBFF, // RGB(0xFF, 0xEB, 0xCD)
- blue = 0x00FF0000, // RGB(0x00, 0x00, 0xFF)
- blueviolet = 0x00E22B8A, // RGB(0x8A, 0x2B, 0xE2)
- brown = 0x002A2AA5, // RGB(0xA5, 0x2A, 0x2A)
- burlywood = 0x0087B8DE, // RGB(0xDE, 0xB8, 0x87)
- cadetblue = 0x00A09E5F, // RGB(0x5F, 0x9E, 0xA0)
- chartreuse = 0x0000FF7F, // RGB(0x7F, 0xFF, 0x00)
- chocolate = 0x001E69D2, // RGB(0xD2, 0x69, 0x1E)
- coral = 0x00507FFF, // RGB(0xFF, 0x7F, 0x50)
- cornflower = 0x00ED9564, // RGB(0x64, 0x95, 0xED)
- cornsilk = 0x00DCF8FF, // RGB(0xFF, 0xF8, 0xDC)
- crimson = 0x003C14DC, // RGB(0xDC, 0x14, 0x3C)
- cyan = 0x00FFFF00, // RGB(0x00, 0xFF, 0xFF)
- darkblue = 0x008B0000, // RGB(0x00, 0x00, 0x8B)
- darkcyan = 0x008B8B00, // RGB(0x00, 0x8B, 0x8B)
- darkgoldenrod = 0x000B86B8, // RGB(0xB8, 0x86, 0x0B)
- darkgray = 0x00A9A9A9, // RGB(0xA9, 0xA9, 0xA9)
- darkgreen = 0x00006400, // RGB(0x00, 0x64, 0x00)
- darkkhaki = 0x006BB7BD, // RGB(0xBD, 0xB7, 0x6B)
- darkmagenta = 0x008B008B, // RGB(0x8B, 0x00, 0x8B)
- darkolivegreen = 0x002F6B55, // RGB(0x55, 0x6B, 0x2F)
- darkorange = 0x00008CFF, // RGB(0xFF, 0x8C, 0x00)
- darkorchid = 0x00CC3299, // RGB(0x99, 0x32, 0xCC)
- darkred = 0x0000008B, // RGB(0x8B, 0x00, 0x00)
- darksalmon = 0x007A96E9, // RGB(0xE9, 0x96, 0x7A)
- darkseagreen = 0x008BBC8F, // RGB(0x8F, 0xBC, 0x8B)
- darkslateblue = 0x008B3D48, // RGB(0x48, 0x3D, 0x8B)
- darkslategray = 0x004F4F2F, // RGB(0x2F, 0x4F, 0x4F)
- darkturquoise = 0x00D1CE00, // RGB(0x00, 0xCE, 0xD1)
- darkviolet = 0x00D30094, // RGB(0x94, 0x00, 0xD3)
- deeppink = 0x009314FF, // RGB(0xFF, 0x14, 0x93)
- deepskyblue = 0x00FFBF00, // RGB(0x00, 0xBF, 0xFF)
- dimgray = 0x00696969, // RGB(0x69, 0x69, 0x69)
- dodgerblue = 0x00FF901E, // RGB(0x1E, 0x90, 0xFF)
- firebrick = 0x002222B2, // RGB(0xB2, 0x22, 0x22)
- floralwhite = 0x00F0FAFF, // RGB(0xFF, 0xFA, 0xF0)
- forestgreen = 0x00228B22, // RGB(0x22, 0x8B, 0x22)
- fuchsia = 0x00FF00FF, // RGB(0xFF, 0x00, 0xFF)
- gainsboro = 0x00DCDCDC, // RGB(0xDC, 0xDC, 0xDC)
- ghostwhite = 0x00FFF8F8, // RGB(0xF8, 0xF8, 0xFF)
- gold = 0x0000D7FF, // RGB(0xFF, 0xD7, 0x00)
- goldenrod = 0x0020A5DA, // RGB(0xDA, 0xA5, 0x20)
- gray = 0x00808080, // RGB(0x80, 0x80, 0x80)
- green = 0x00008000, // RGB(0x00, 0x80, 0x00)
- greenyellow = 0x002FFFAD, // RGB(0xAD, 0xFF, 0x2F)
- honeydew = 0x00F0FFF0, // RGB(0xF0, 0xFF, 0xF0)
- hotpink = 0x00B469FF, // RGB(0xFF, 0x69, 0xB4)
- indianred = 0x005C5CCD, // RGB(0xCD, 0x5C, 0x5C)
- indigo = 0x0082004B, // RGB(0x4B, 0x00, 0x82)
- ivory = 0x00F0FFFF, // RGB(0xFF, 0xFF, 0xF0)
- khaki = 0x008CE6F0, // RGB(0xF0, 0xE6, 0x8C)
- lavender = 0x00FAE6E6, // RGB(0xE6, 0xE6, 0xFA)
- lavenderblush = 0x00F5F0FF, // RGB(0xFF, 0xF0, 0xF5)
- lawngreen = 0x0000FC7C, // RGB(0x7C, 0xFC, 0x00)
- lemonchiffon = 0x00CDFAFF, // RGB(0xFF, 0xFA, 0xCD)
- lightblue = 0x00E6D8AD, // RGB(0xAD, 0xD8, 0xE6)
- lightcoral = 0x008080F0, // RGB(0xF0, 0x80, 0x80)
- lightcyan = 0x00FFFFE0, // RGB(0xE0, 0xFF, 0xFF)
- lightgoldenrodyellow = 0x00D2FAFA, // RGB(0xFA, 0xFA, 0xD2)
- lightgreen = 0x0090EE90, // RGB(0x90, 0xEE, 0x90)
- lightgrey = 0x00D3D3D3, // RGB(0xD3, 0xD3, 0xD3)
- lightpink = 0x00C1B6FF, // RGB(0xFF, 0xB6, 0xC1)
- lightsalmon = 0x007AA0FF, // RGB(0xFF, 0xA0, 0x7A)
- lightseagreen = 0x00AAB220, // RGB(0x20, 0xB2, 0xAA)
- lightskyblue = 0x00FACE87, // RGB(0x87, 0xCE, 0xFA)
- lightslategray = 0x00998877, // RGB(0x77, 0x88, 0x99)
- lightsteelblue = 0x00DEC4B0, // RGB(0xB0, 0xC4, 0xDE)
- lightyellow = 0x00E0FFFF, // RGB(0xFF, 0xFF, 0xE0)
- lime = 0x0000FF00, // RGB(0x00, 0xFF, 0x00)
- limegreen = 0x0032CD32, // RGB(0x32, 0xCD, 0x32)
- linen = 0x00E6F0FA, // RGB(0xFA, 0xF0, 0xE6)
- magenta = 0x00FF00FF, // RGB(0xFF, 0x00, 0xFF)
- maroon = 0x00000080, // RGB(0x80, 0x00, 0x00)
- mediumaquamarine = 0x00AACD66, // RGB(0x66, 0xCD, 0xAA)
- mediumblue = 0x00CD0000, // RGB(0x00, 0x00, 0xCD)
- mediumorchid = 0x00D355BA, // RGB(0xBA, 0x55, 0xD3)
- mediumpurple = 0x00DB7093, // RGB(0x93, 0x70, 0xDB)
- mediumseagreen = 0x0071B33C, // RGB(0x3C, 0xB3, 0x71)
- mediumslateblue = 0x00EE687B, // RGB(0x7B, 0x68, 0xEE)
- mediumspringgreen = 0x009AFA00, // RGB(0x00, 0xFA, 0x9A)
- mediumturquoise = 0x00CCD148, // RGB(0x48, 0xD1, 0xCC)
- mediumvioletred = 0x008515C7, // RGB(0xC7, 0x15, 0x85)
- midnightblue = 0x00701919, // RGB(0x19, 0x19, 0x70)
- mintcream = 0x00FAFFF5, // RGB(0xF5, 0xFF, 0xFA)
- mistyrose = 0x00E1E4FF, // RGB(0xFF, 0xE4, 0xE1)
- moccasin = 0x00B5E4FF, // RGB(0xFF, 0xE4, 0xB5)
- navajowhite = 0x00ADDEFF, // RGB(0xFF, 0xDE, 0xAD)
- navy = 0x00800000, // RGB(0x00, 0x00, 0x80)
- oldlace = 0x00E6F5FD, // RGB(0xFD, 0xF5, 0xE6)
- olive = 0x00008080, // RGB(0x80, 0x80, 0x00)
- olivedrab = 0x00238E6B, // RGB(0x6B, 0x8E, 0x23)
- orange = 0x0000A5FF, // RGB(0xFF, 0xA5, 0x00)
- orangered = 0x000045FF, // RGB(0xFF, 0x45, 0x00)
- orchid = 0x00D670DA, // RGB(0xDA, 0x70, 0xD6)
- palegoldenrod = 0x00AAE8EE, // RGB(0xEE, 0xE8, 0xAA)
- palegreen = 0x0098FB98, // RGB(0x98, 0xFB, 0x98)
- paleturquoise = 0x00EEEEAF, // RGB(0xAF, 0xEE, 0xEE)
- palevioletred = 0x009370DB, // RGB(0xDB, 0x70, 0x93)
- papayawhip = 0x00D5EFFF, // RGB(0xFF, 0xEF, 0xD5)
- peachpuff = 0x00B9DAFF, // RGB(0xFF, 0xDA, 0xB9)
- peru = 0x003F85CD, // RGB(0xCD, 0x85, 0x3F)
- pink = 0x00CBC0FF, // RGB(0xFF, 0xC0, 0xCB)
- plum = 0x00DDA0DD, // RGB(0xDD, 0xA0, 0xDD)
- powderblue = 0x00E6E0B0, // RGB(0xB0, 0xE0, 0xE6)
- purple = 0x00800080, // RGB(0x80, 0x00, 0x80)
- red = 0x000000FF, // RGB(0xFF, 0x00, 0x00)
- rosybrown = 0x008F8FBC, // RGB(0xBC, 0x8F, 0x8F)
- royalblue = 0x00E16941, // RGB(0x41, 0x69, 0xE1)
- saddlebrown = 0x0013458B, // RGB(0x8B, 0x45, 0x13)
- salmon = 0x007280FA, // RGB(0xFA, 0x80, 0x72)
- sandybrown = 0x0060A4F4, // RGB(0xF4, 0xA4, 0x60)
- seagreen = 0x00578B2E, // RGB(0x2E, 0x8B, 0x57)
- seashell = 0x00EEF5FF, // RGB(0xFF, 0xF5, 0xEE)
- sienna = 0x002D52A0, // RGB(0xA0, 0x52, 0x2D)
- silver = 0x00C0C0C0, // RGB(0xC0, 0xC0, 0xC0)
- skyblue = 0x00EBCE87, // RGB(0x87, 0xCE, 0xEB)
- slateblue = 0x00CD5A6A, // RGB(0x6A, 0x5A, 0xCD)
- slategray = 0x00908070, // RGB(0x70, 0x80, 0x90)
- snow = 0x00FAFAFF, // RGB(0xFF, 0xFA, 0xFA)
- springgreen = 0x007FFF00, // RGB(0x00, 0xFF, 0x7F)
- steelblue = 0x00B48246, // RGB(0x46, 0x82, 0xB4)
- tan = 0x008CB4D2, // RGB(0xD2, 0xB4, 0x8C)
- teal = 0x00808000, // RGB(0x00, 0x80, 0x80)
- thistle = 0x00D8BFD8, // RGB(0xD8, 0xBF, 0xD8)
- tomato = 0x004763FF, // RGB(0xFF, 0x63, 0x47)
- turquoise = 0x00D0E040, // RGB(0x40, 0xE0, 0xD0)
- violet = 0x00EE82EE, // RGB(0xEE, 0x82, 0xEE)
- wheat = 0x00B3DEF5, // RGB(0xF5, 0xDE, 0xB3)
- white = 0x00FFFFFF, // RGB(0xFF, 0xFF, 0xFF)
- whitesmoke = 0x00F5F5F5, // RGB(0xF5, 0xF5, 0xF5)
- yellow = 0x0000FFFF, // RGB(0xFF, 0xFF, 0x00)
- yellowgreen = 0x0032CD9A, // RGB(0x9A, 0xCD, 0x32)
- };
-
- enum ENamedColorIndex
- {
- i_aliceblue, i_antiquewhite, i_aqua, i_aquamarine, i_azure, i_beige, i_bisque, i_black,
- i_blanchedalmond, i_blue, i_blueviolet, i_brown, i_burlywood, i_cadetblue, i_chartreuse,
- i_chocolate, i_coral, i_cornflower, i_cornsilk, i_crimson, i_cyan, i_darkblue, i_darkcyan,
- i_darkgoldenrod, i_darkgray, i_darkgreen, i_darkkhaki, i_darkmagenta, i_darkolivegreen,
- i_darkorange, i_darkorchid, i_darkred, i_darksalmon, i_darkseagreen, i_darkslateblue,
- i_darkslategray, i_darkturquoise, i_darkviolet, i_deeppink, i_deepskyblue, i_dimgray,
- i_dodgerblue, i_firebrick, i_floralwhite, i_forestgreen, i_fuchsia, i_gainsboro,
- i_ghostwhite, i_gold, i_goldenrod, i_gray, i_green, i_greenyellow, i_honeydew, i_hotpink,
- i_indianred, i_indigo, i_ivory, i_khaki, i_lavender, i_lavenderblush, i_lawngreen,
- i_lemonchiffon, i_lightblue, i_lightcoral, i_lightcyan, i_lightgoldenrodyellow,
- i_lightgreen, i_lightgrey, i_lightpink, i_lightsalmon, i_lightseagreen, i_lightskyblue,
- i_lightslategray, i_lightsteelblue, i_lightyellow, i_lime, i_limegreen, i_linen,
- i_magenta, i_maroon, i_mediumaquamarine, i_mediumblue, i_mediumorchid, i_mediumpurple,
- i_mediumseagreen, i_mediumslateblue, i_mediumspringgreen, i_mediumturquoise,
- i_mediumvioletred, i_midnightblue, i_mintcream, i_mistyrose, i_moccasin, i_navajowhite,
- i_navy, i_oldlace, i_olive, i_olivedrab, i_orange, i_orangered, i_orchid, i_palegoldenrod,
- i_palegreen, i_paleturquoise, i_palevioletred, i_papayawhip, i_peachpuff, i_peru, i_pink,
- i_plum, i_powderblue, i_purple, i_red, i_rosybrown, i_royalblue, i_saddlebrown, i_salmon,
- i_sandybrown, i_seagreen, i_seashell, i_sienna, i_silver, i_skyblue, i_slateblue,
- i_slategray, i_snow, i_springgreen, i_steelblue, i_tan, i_teal, i_thistle, i_tomato,
- i_turquoise, i_violet, i_wheat, i_white, i_whitesmoke, i_yellow, i_yellowgreen,
- numNamedColors
- };
-
-private:
-
- // Konvertierung
- // -------------
- void ToRGB(); // logisch konstant, nicht physikalisch
- void ToHLS(); // logisch konstant, nicht physikalisch
- static unsigned char ToRGB1(float rm1, float rm2, float rh);
-
- // Daten
- // -----
- union // Byteweiser Zugriff auf die COLORREF Struktur
- {
- COLORTYPE m_colorref;
- unsigned char m_color[4];
- };
- enum {c_red = 0, c_green = 1, c_blue = 2, c_null = 3}; // enum Hack f�r colorbyte-Index
-
- float m_hue; // 0.0 .. 360.0 // Winkel
- float m_saturation; // 0.0 .. 1.0 // Prozent
- float m_luminance; // 0.0 .. 1.0 // Prozent
-
- // Flag f�r Lazy Evaluation
- bool m_bIsRGB;
- bool m_bIsHLS;
-
- // statische Konstanten f�r benannte Farben
- struct DNamedColor
- {
- COLORTYPE color;
- const char* name;
- };
- static const DNamedColor m_namedColor[numNamedColors];
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// global functions
-/////////////////////////////////////////////////////////////////////////////
-
-COLORTYPE GetHueColor(int iHue) ;
-
-void RGBtoHSV( float r, float g, float b, float *h, float *s, float *v );
-void RGBToHSV( unsigned char r, unsigned char g, unsigned char b, float* h, float *s, float* v );
-
-void HSVtoRGB( float *r, float *g, float *b, float h, float s, float v );
-void HSVToRGB( unsigned char& r, unsigned char& g, unsigned char& b, float h, float s, float v );
-
-short GetHueValue( COLORTYPE inColor );
-short GetSaturationValue( COLORTYPE inColor );
-short GetBrightnessValue( COLORTYPE inColor );
-
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2.h
deleted file mode 100644
index f64ec00b..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2.h
+++ /dev/null
@@ -1,677 +0,0 @@
-#ifndef __gl2_h_
-#define __gl2_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2015 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-**
-** Khronos $Revision: 32120 $ on $Date: 2015-10-15 04:27:13 -0700 (Thu, 15 Oct 2015) $
-*/
-
-#include <GLES2/gl2platform.h>
-
-#ifndef GL_APIENTRYP
-#define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-#if !defined(GL_GLES_PROTOTYPES)
-#define GL_GLES_PROTOTYPES 1
-#endif
-
-/* Generated on date 20151015 */
-
-/* Generated C header for:
- * API: gles2
- * Profile: common
- * Versions considered: 2\.[0-9]
- * Versions emitted: .*
- * Default extensions included: None
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
-
-#ifndef GL_ES_VERSION_2_0
-#define GL_ES_VERSION_2_0 1
-#include <KHR/khrplatform.h>
-typedef khronos_int8_t GLbyte;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-typedef short GLshort;
-typedef unsigned short GLushort;
-typedef void GLvoid;
-typedef struct __GLsync *GLsync;
-typedef khronos_int64_t GLint64;
-typedef khronos_uint64_t GLuint64;
-typedef unsigned int GLenum;
-typedef unsigned int GLuint;
-typedef char GLchar;
-typedef khronos_float_t GLfloat;
-typedef khronos_ssize_t GLsizeiptr;
-typedef khronos_intptr_t GLintptr;
-typedef unsigned int GLbitfield;
-typedef int GLint;
-typedef unsigned char GLboolean;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_FALSE 0
-#define GL_TRUE 1
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_FUNC_ADD 0x8006
-#define GL_BLEND_EQUATION 0x8009
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STATIC_DRAW 0x88E4
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_BLEND 0x0BE2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_LINE_WIDTH 0x0B21
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_DELETE_STATUS 0x8B80
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_INVERT 0x150A
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TEXTURE 0x1702
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGB565 0x8D62
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_NONE 0
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
-typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
-typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
-typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
-typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
-typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
-typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
-typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
-typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
-typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
-typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
-typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
-typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
-GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
-GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
-GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
-GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
-GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
-GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
-GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
-GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glFinish (void);
-GL_APICALL void GL_APIENTRY glFlush (void);
-GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL GLenum GL_APIENTRY glGetError (void);
-GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
-GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
-GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
-GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
-GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
-GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
-GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
-GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
-GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_ES_VERSION_2_0 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2ext.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2ext.h
deleted file mode 100644
index 2d055961..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2ext.h
+++ /dev/null
@@ -1,2946 +0,0 @@
-#ifndef __gl2ext_h_
-#define __gl2ext_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2015 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-**
-** Khronos $Revision: 32120 $ on $Date: 2015-10-15 04:27:13 -0700 (Thu, 15 Oct 2015) $
-*/
-
-#ifndef GL_APIENTRYP
-#define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-/* Generated on date 20151015 */
-
-/* Generated C header for:
- * API: gles2
- * Profile: common
- * Versions considered: 2\.[0-9]
- * Versions emitted: _nomatch_^
- * Default extensions included: gles2
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
-
-#ifndef GL_KHR_blend_equation_advanced
-#define GL_KHR_blend_equation_advanced 1
-#define GL_MULTIPLY_KHR 0x9294
-#define GL_SCREEN_KHR 0x9295
-#define GL_OVERLAY_KHR 0x9296
-#define GL_DARKEN_KHR 0x9297
-#define GL_LIGHTEN_KHR 0x9298
-#define GL_COLORDODGE_KHR 0x9299
-#define GL_COLORBURN_KHR 0x929A
-#define GL_HARDLIGHT_KHR 0x929B
-#define GL_SOFTLIGHT_KHR 0x929C
-#define GL_DIFFERENCE_KHR 0x929E
-#define GL_EXCLUSION_KHR 0x92A0
-#define GL_HSL_HUE_KHR 0x92AD
-#define GL_HSL_SATURATION_KHR 0x92AE
-#define GL_HSL_COLOR_KHR 0x92AF
-#define GL_HSL_LUMINOSITY_KHR 0x92B0
-typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void);
-#endif
-#endif /* GL_KHR_blend_equation_advanced */
-
-#ifndef GL_KHR_blend_equation_advanced_coherent
-#define GL_KHR_blend_equation_advanced_coherent 1
-#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285
-#endif /* GL_KHR_blend_equation_advanced_coherent */
-
-#ifndef GL_KHR_context_flush_control
-#define GL_KHR_context_flush_control 1
-#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB
-#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC
-#endif /* GL_KHR_context_flush_control */
-
-#ifndef GL_KHR_debug
-#define GL_KHR_debug 1
-typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
-#define GL_SAMPLER 0x82E6
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245
-#define GL_DEBUG_SOURCE_API_KHR 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A
-#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B
-#define GL_DEBUG_TYPE_ERROR_KHR 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250
-#define GL_DEBUG_TYPE_OTHER_KHR 0x8251
-#define GL_DEBUG_TYPE_MARKER_KHR 0x8268
-#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269
-#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A
-#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B
-#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C
-#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D
-#define GL_BUFFER_KHR 0x82E0
-#define GL_SHADER_KHR 0x82E1
-#define GL_PROGRAM_KHR 0x82E2
-#define GL_VERTEX_ARRAY_KHR 0x8074
-#define GL_QUERY_KHR 0x82E3
-#define GL_PROGRAM_PIPELINE_KHR 0x82E4
-#define GL_SAMPLER_KHR 0x82E6
-#define GL_MAX_LABEL_LENGTH_KHR 0x82E8
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147
-#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148
-#define GL_DEBUG_OUTPUT_KHR 0x92E0
-#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002
-#define GL_STACK_OVERFLOW_KHR 0x0503
-#define GL_STACK_UNDERFLOW_KHR 0x0504
-typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam);
-typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void);
-typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam);
-GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void);
-GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label);
-GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params);
-#endif
-#endif /* GL_KHR_debug */
-
-#ifndef GL_KHR_no_error
-#define GL_KHR_no_error 1
-#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
-#endif /* GL_KHR_no_error */
-
-#ifndef GL_KHR_robust_buffer_access_behavior
-#define GL_KHR_robust_buffer_access_behavior 1
-#endif /* GL_KHR_robust_buffer_access_behavior */
-
-#ifndef GL_KHR_robustness
-#define GL_KHR_robustness 1
-#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3
-#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252
-#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256
-#define GL_NO_RESET_NOTIFICATION_KHR 0x8261
-#define GL_CONTEXT_LOST_KHR 0x0507
-typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void);
-typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void);
-GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-#endif
-#endif /* GL_KHR_robustness */
-
-#ifndef GL_KHR_texture_compression_astc_hdr
-#define GL_KHR_texture_compression_astc_hdr 1
-#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
-#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
-#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
-#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
-#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
-#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
-#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
-#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
-#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
-#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
-#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
-#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
-#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
-#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
-#endif /* GL_KHR_texture_compression_astc_hdr */
-
-#ifndef GL_KHR_texture_compression_astc_ldr
-#define GL_KHR_texture_compression_astc_ldr 1
-#endif /* GL_KHR_texture_compression_astc_ldr */
-
-#ifndef GL_KHR_texture_compression_astc_sliced_3d
-#define GL_KHR_texture_compression_astc_sliced_3d 1
-#endif /* GL_KHR_texture_compression_astc_sliced_3d */
-
-#ifndef GL_OES_EGL_image
-#define GL_OES_EGL_image 1
-typedef void *GLeglImageOES;
-typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
-typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
-GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
-#endif
-#endif /* GL_OES_EGL_image */
-
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-#define GL_TEXTURE_EXTERNAL_OES 0x8D65
-#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
-#define GL_SAMPLER_EXTERNAL_OES 0x8D66
-#endif /* GL_OES_EGL_image_external */
-
-#ifndef GL_OES_EGL_image_external_essl3
-#define GL_OES_EGL_image_external_essl3 1
-#endif /* GL_OES_EGL_image_external_essl3 */
-
-#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture
-#define GL_OES_compressed_ETC1_RGB8_sub_texture 1
-#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */
-
-#ifndef GL_OES_compressed_ETC1_RGB8_texture
-#define GL_OES_compressed_ETC1_RGB8_texture 1
-#define GL_ETC1_RGB8_OES 0x8D64
-#endif /* GL_OES_compressed_ETC1_RGB8_texture */
-
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-#endif /* GL_OES_compressed_paletted_texture */
-
-#ifndef GL_OES_copy_image
-#define GL_OES_copy_image 1
-typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-#endif
-#endif /* GL_OES_copy_image */
-
-#ifndef GL_OES_depth24
-#define GL_OES_depth24 1
-#define GL_DEPTH_COMPONENT24_OES 0x81A6
-#endif /* GL_OES_depth24 */
-
-#ifndef GL_OES_depth32
-#define GL_OES_depth32 1
-#define GL_DEPTH_COMPONENT32_OES 0x81A7
-#endif /* GL_OES_depth32 */
-
-#ifndef GL_OES_depth_texture
-#define GL_OES_depth_texture 1
-#endif /* GL_OES_depth_texture */
-
-#ifndef GL_OES_draw_buffers_indexed
-#define GL_OES_draw_buffers_indexed 1
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint index);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOES (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunciOES (GLuint buf, GLenum src, GLenum dst);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOES (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GL_APICALL void GL_APIENTRY glColorMaskiOES (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index);
-#endif
-#endif /* GL_OES_draw_buffers_indexed */
-
-#ifndef GL_OES_draw_elements_base_vertex
-#define GL_OES_draw_elements_base_vertex 1
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexOES (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
-#endif
-#endif /* GL_OES_draw_elements_base_vertex */
-
-#ifndef GL_OES_element_index_uint
-#define GL_OES_element_index_uint 1
-#endif /* GL_OES_element_index_uint */
-
-#ifndef GL_OES_fbo_render_mipmap
-#define GL_OES_fbo_render_mipmap 1
-#endif /* GL_OES_fbo_render_mipmap */
-
-#ifndef GL_OES_fragment_precision_high
-#define GL_OES_fragment_precision_high 1
-#endif /* GL_OES_fragment_precision_high */
-
-#ifndef GL_OES_geometry_point_size
-#define GL_OES_geometry_point_size 1
-#endif /* GL_OES_geometry_point_size */
-
-#ifndef GL_OES_geometry_shader
-#define GL_OES_geometry_shader 1
-#define GL_GEOMETRY_SHADER_OES 0x8DD9
-#define GL_GEOMETRY_SHADER_BIT_OES 0x00000004
-#define GL_GEOMETRY_LINKED_VERTICES_OUT_OES 0x8916
-#define GL_GEOMETRY_LINKED_INPUT_TYPE_OES 0x8917
-#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_OES 0x8918
-#define GL_GEOMETRY_SHADER_INVOCATIONS_OES 0x887F
-#define GL_LAYER_PROVOKING_VERTEX_OES 0x825E
-#define GL_LINES_ADJACENCY_OES 0x000A
-#define GL_LINE_STRIP_ADJACENCY_OES 0x000B
-#define GL_TRIANGLES_ADJACENCY_OES 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_OES 0x000D
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8DDF
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_OES 0x8A2C
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8A32
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_OES 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_OES 0x9124
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_OES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES 0x8DE1
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_OES 0x8E5A
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES 0x8C29
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES 0x92CF
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_OES 0x92D5
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_OES 0x90CD
-#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES 0x90D7
-#define GL_FIRST_VERTEX_CONVENTION_OES 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION_OES 0x8E4E
-#define GL_UNDEFINED_VERTEX_OES 0x8260
-#define GL_PRIMITIVES_GENERATED_OES 0x8C87
-#define GL_FRAMEBUFFER_DEFAULT_LAYERS_OES 0x9312
-#define GL_MAX_FRAMEBUFFER_LAYERS_OES 0x9317
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES 0x8DA8
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_OES 0x8DA7
-#define GL_REFERENCED_BY_GEOMETRY_SHADER_OES 0x9309
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREOESPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glFramebufferTextureOES (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif
-#endif /* GL_OES_geometry_shader */
-
-#ifndef GL_OES_get_program_binary
-#define GL_OES_get_program_binary 1
-#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
-#endif
-#endif /* GL_OES_get_program_binary */
-
-#ifndef GL_OES_gpu_shader5
-#define GL_OES_gpu_shader5 1
-#endif /* GL_OES_gpu_shader5 */
-
-#ifndef GL_OES_mapbuffer
-#define GL_OES_mapbuffer 1
-#define GL_WRITE_ONLY_OES 0x88B9
-#define GL_BUFFER_ACCESS_OES 0x88BB
-#define GL_BUFFER_MAPPED_OES 0x88BC
-#define GL_BUFFER_MAP_POINTER_OES 0x88BD
-typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
-typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
-GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
-GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params);
-#endif
-#endif /* GL_OES_mapbuffer */
-
-#ifndef GL_OES_packed_depth_stencil
-#define GL_OES_packed_depth_stencil 1
-#define GL_DEPTH_STENCIL_OES 0x84F9
-#define GL_UNSIGNED_INT_24_8_OES 0x84FA
-#define GL_DEPTH24_STENCIL8_OES 0x88F0
-#endif /* GL_OES_packed_depth_stencil */
-
-#ifndef GL_OES_primitive_bounding_box
-#define GL_OES_primitive_bounding_box 1
-#define GL_PRIMITIVE_BOUNDING_BOX_OES 0x92BE
-typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXOESPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxOES (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-#endif
-#endif /* GL_OES_primitive_bounding_box */
-
-#ifndef GL_OES_required_internalformat
-#define GL_OES_required_internalformat 1
-#define GL_ALPHA8_OES 0x803C
-#define GL_DEPTH_COMPONENT16_OES 0x81A5
-#define GL_LUMINANCE4_ALPHA4_OES 0x8043
-#define GL_LUMINANCE8_ALPHA8_OES 0x8045
-#define GL_LUMINANCE8_OES 0x8040
-#define GL_RGBA4_OES 0x8056
-#define GL_RGB5_A1_OES 0x8057
-#define GL_RGB565_OES 0x8D62
-#define GL_RGB8_OES 0x8051
-#define GL_RGBA8_OES 0x8058
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB10_A2_EXT 0x8059
-#endif /* GL_OES_required_internalformat */
-
-#ifndef GL_OES_rgb8_rgba8
-#define GL_OES_rgb8_rgba8 1
-#endif /* GL_OES_rgb8_rgba8 */
-
-#ifndef GL_OES_sample_shading
-#define GL_OES_sample_shading 1
-#define GL_SAMPLE_SHADING_OES 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_OES 0x8C37
-typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value);
-#endif
-#endif /* GL_OES_sample_shading */
-
-#ifndef GL_OES_sample_variables
-#define GL_OES_sample_variables 1
-#endif /* GL_OES_sample_variables */
-
-#ifndef GL_OES_shader_image_atomic
-#define GL_OES_shader_image_atomic 1
-#endif /* GL_OES_shader_image_atomic */
-
-#ifndef GL_OES_shader_io_blocks
-#define GL_OES_shader_io_blocks 1
-#endif /* GL_OES_shader_io_blocks */
-
-#ifndef GL_OES_shader_multisample_interpolation
-#define GL_OES_shader_multisample_interpolation 1
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D
-#endif /* GL_OES_shader_multisample_interpolation */
-
-#ifndef GL_OES_standard_derivatives
-#define GL_OES_standard_derivatives 1
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
-#endif /* GL_OES_standard_derivatives */
-
-#ifndef GL_OES_stencil1
-#define GL_OES_stencil1 1
-#define GL_STENCIL_INDEX1_OES 0x8D46
-#endif /* GL_OES_stencil1 */
-
-#ifndef GL_OES_stencil4
-#define GL_OES_stencil4 1
-#define GL_STENCIL_INDEX4_OES 0x8D47
-#endif /* GL_OES_stencil4 */
-
-#ifndef GL_OES_surfaceless_context
-#define GL_OES_surfaceless_context 1
-#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219
-#endif /* GL_OES_surfaceless_context */
-
-#ifndef GL_OES_tessellation_point_size
-#define GL_OES_tessellation_point_size 1
-#endif /* GL_OES_tessellation_point_size */
-
-#ifndef GL_OES_tessellation_shader
-#define GL_OES_tessellation_shader 1
-#define GL_PATCHES_OES 0x000E
-#define GL_PATCH_VERTICES_OES 0x8E72
-#define GL_TESS_CONTROL_OUTPUT_VERTICES_OES 0x8E75
-#define GL_TESS_GEN_MODE_OES 0x8E76
-#define GL_TESS_GEN_SPACING_OES 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER_OES 0x8E78
-#define GL_TESS_GEN_POINT_MODE_OES 0x8E79
-#define GL_ISOLINES_OES 0x8E7A
-#define GL_QUADS_OES 0x0007
-#define GL_FRACTIONAL_ODD_OES 0x8E7B
-#define GL_FRACTIONAL_EVEN_OES 0x8E7C
-#define GL_MAX_PATCH_VERTICES_OES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL_OES 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_OES 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_OES 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_OES 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS_OES 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_OES 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_OES 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_OES 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_OES 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_OES 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_OES 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E1F
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_OES 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_OES 0x92CE
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_OES 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_OES 0x92D4
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_OES 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_OES 0x90CC
-#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_OES 0x90D8
-#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_OES 0x90D9
-#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_OES 0x8221
-#define GL_IS_PER_PATCH_OES 0x92E7
-#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_OES 0x9307
-#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_OES 0x9308
-#define GL_TESS_CONTROL_SHADER_OES 0x8E88
-#define GL_TESS_EVALUATION_SHADER_OES 0x8E87
-#define GL_TESS_CONTROL_SHADER_BIT_OES 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT_OES 0x00000010
-typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIOESPROC) (GLenum pname, GLint value);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glPatchParameteriOES (GLenum pname, GLint value);
-#endif
-#endif /* GL_OES_tessellation_shader */
-
-#ifndef GL_OES_texture_3D
-#define GL_OES_texture_3D 1
-#define GL_TEXTURE_WRAP_R_OES 0x8072
-#define GL_TEXTURE_3D_OES 0x806F
-#define GL_TEXTURE_BINDING_3D_OES 0x806A
-#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
-#define GL_SAMPLER_3D_OES 0x8B5F
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-#endif
-#endif /* GL_OES_texture_3D */
-
-#ifndef GL_OES_texture_border_clamp
-#define GL_OES_texture_border_clamp 1
-#define GL_TEXTURE_BORDER_COLOR_OES 0x1004
-#define GL_CLAMP_TO_BORDER_OES 0x812D
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexParameterIivOES (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexParameterIuivOES (GLenum target, GLenum pname, const GLuint *params);
-GL_APICALL void GL_APIENTRY glGetTexParameterIivOES (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetTexParameterIuivOES (GLenum target, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glSamplerParameterIivOES (GLuint sampler, GLenum pname, const GLint *param);
-GL_APICALL void GL_APIENTRY glSamplerParameterIuivOES (GLuint sampler, GLenum pname, const GLuint *param);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOES (GLuint sampler, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOES (GLuint sampler, GLenum pname, GLuint *params);
-#endif
-#endif /* GL_OES_texture_border_clamp */
-
-#ifndef GL_OES_texture_buffer
-#define GL_OES_texture_buffer 1
-#define GL_TEXTURE_BUFFER_OES 0x8C2A
-#define GL_TEXTURE_BUFFER_BINDING_OES 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_OES 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_OES 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_OES 0x8C2D
-#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES 0x919F
-#define GL_SAMPLER_BUFFER_OES 0x8DC2
-#define GL_INT_SAMPLER_BUFFER_OES 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_OES 0x8DD8
-#define GL_IMAGE_BUFFER_OES 0x9051
-#define GL_INT_IMAGE_BUFFER_OES 0x905C
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_OES 0x9067
-#define GL_TEXTURE_BUFFER_OFFSET_OES 0x919D
-#define GL_TEXTURE_BUFFER_SIZE_OES 0x919E
-typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexBufferOES (GLenum target, GLenum internalformat, GLuint buffer);
-GL_APICALL void GL_APIENTRY glTexBufferRangeOES (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-#endif
-#endif /* GL_OES_texture_buffer */
-
-#ifndef GL_OES_texture_compression_astc
-#define GL_OES_texture_compression_astc 1
-#define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0
-#define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1
-#define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2
-#define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3
-#define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4
-#define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5
-#define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6
-#define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7
-#define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8
-#define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9
-#endif /* GL_OES_texture_compression_astc */
-
-#ifndef GL_OES_texture_cube_map_array
-#define GL_OES_texture_cube_map_array 1
-#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_OES 0x900A
-#define GL_SAMPLER_CUBE_MAP_ARRAY_OES 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900F
-#define GL_IMAGE_CUBE_MAP_ARRAY_OES 0x9054
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x905F
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x906A
-#endif /* GL_OES_texture_cube_map_array */
-
-#ifndef GL_OES_texture_float
-#define GL_OES_texture_float 1
-#endif /* GL_OES_texture_float */
-
-#ifndef GL_OES_texture_float_linear
-#define GL_OES_texture_float_linear 1
-#endif /* GL_OES_texture_float_linear */
-
-#ifndef GL_OES_texture_half_float
-#define GL_OES_texture_half_float 1
-#define GL_HALF_FLOAT_OES 0x8D61
-#endif /* GL_OES_texture_half_float */
-
-#ifndef GL_OES_texture_half_float_linear
-#define GL_OES_texture_half_float_linear 1
-#endif /* GL_OES_texture_half_float_linear */
-
-#ifndef GL_OES_texture_npot
-#define GL_OES_texture_npot 1
-#endif /* GL_OES_texture_npot */
-
-#ifndef GL_OES_texture_stencil8
-#define GL_OES_texture_stencil8 1
-#define GL_STENCIL_INDEX_OES 0x1901
-#define GL_STENCIL_INDEX8_OES 0x8D48
-#endif /* GL_OES_texture_stencil8 */
-
-#ifndef GL_OES_texture_storage_multisample_2d_array
-#define GL_OES_texture_storage_multisample_2d_array 1
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-#endif
-#endif /* GL_OES_texture_storage_multisample_2d_array */
-
-#ifndef GL_OES_texture_view
-#define GL_OES_texture_view 1
-#define GL_TEXTURE_VIEW_MIN_LEVEL_OES 0x82DB
-#define GL_TEXTURE_VIEW_NUM_LEVELS_OES 0x82DC
-#define GL_TEXTURE_VIEW_MIN_LAYER_OES 0x82DD
-#define GL_TEXTURE_VIEW_NUM_LAYERS_OES 0x82DE
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWOESPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTextureViewOES (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-#endif
-#endif /* GL_OES_texture_view */
-
-#ifndef GL_OES_vertex_array_object
-#define GL_OES_vertex_array_object 1
-#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
-typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
-GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
-GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
-GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
-#endif
-#endif /* GL_OES_vertex_array_object */
-
-#ifndef GL_OES_vertex_half_float
-#define GL_OES_vertex_half_float 1
-#endif /* GL_OES_vertex_half_float */
-
-#ifndef GL_OES_vertex_type_10_10_10_2
-#define GL_OES_vertex_type_10_10_10_2 1
-#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
-#define GL_INT_10_10_10_2_OES 0x8DF7
-#endif /* GL_OES_vertex_type_10_10_10_2 */
-
-#ifndef GL_AMD_compressed_3DC_texture
-#define GL_AMD_compressed_3DC_texture 1
-#define GL_3DC_X_AMD 0x87F9
-#define GL_3DC_XY_AMD 0x87FA
-#endif /* GL_AMD_compressed_3DC_texture */
-
-#ifndef GL_AMD_compressed_ATC_texture
-#define GL_AMD_compressed_ATC_texture 1
-#define GL_ATC_RGB_AMD 0x8C92
-#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
-#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
-#endif /* GL_AMD_compressed_ATC_texture */
-
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-#define GL_COUNTER_TYPE_AMD 0x8BC0
-#define GL_COUNTER_RANGE_AMD 0x8BC1
-#define GL_UNSIGNED_INT64_AMD 0x8BC2
-#define GL_PERCENTAGE_AMD 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
-#define GL_PERFMON_RESULT_AMD 0x8BC6
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
-typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data);
-GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
-GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
-GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif
-#endif /* GL_AMD_performance_monitor */
-
-#ifndef GL_AMD_program_binary_Z400
-#define GL_AMD_program_binary_Z400 1
-#define GL_Z400_BINARY_AMD 0x8740
-#endif /* GL_AMD_program_binary_Z400 */
-
-#ifndef GL_ANDROID_extension_pack_es31a
-#define GL_ANDROID_extension_pack_es31a 1
-#endif /* GL_ANDROID_extension_pack_es31a */
-
-#ifndef GL_ANGLE_depth_texture
-#define GL_ANGLE_depth_texture 1
-#endif /* GL_ANGLE_depth_texture */
-
-#ifndef GL_ANGLE_framebuffer_blit
-#define GL_ANGLE_framebuffer_blit 1
-#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-#endif /* GL_ANGLE_framebuffer_blit */
-
-#ifndef GL_ANGLE_framebuffer_multisample
-#define GL_ANGLE_framebuffer_multisample 1
-#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
-#define GL_MAX_SAMPLES_ANGLE 0x8D57
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_ANGLE_framebuffer_multisample */
-
-#ifndef GL_ANGLE_instanced_arrays
-#define GL_ANGLE_instanced_arrays 1
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
-#endif
-#endif /* GL_ANGLE_instanced_arrays */
-
-#ifndef GL_ANGLE_pack_reverse_row_order
-#define GL_ANGLE_pack_reverse_row_order 1
-#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
-#endif /* GL_ANGLE_pack_reverse_row_order */
-
-#ifndef GL_ANGLE_program_binary
-#define GL_ANGLE_program_binary 1
-#define GL_PROGRAM_BINARY_ANGLE 0x93A6
-#endif /* GL_ANGLE_program_binary */
-
-#ifndef GL_ANGLE_texture_compression_dxt3
-#define GL_ANGLE_texture_compression_dxt3 1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
-#endif /* GL_ANGLE_texture_compression_dxt3 */
-
-#ifndef GL_ANGLE_texture_compression_dxt5
-#define GL_ANGLE_texture_compression_dxt5 1
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
-#endif /* GL_ANGLE_texture_compression_dxt5 */
-
-#ifndef GL_ANGLE_texture_usage
-#define GL_ANGLE_texture_usage 1
-#define GL_TEXTURE_USAGE_ANGLE 0x93A2
-#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
-#endif /* GL_ANGLE_texture_usage */
-
-#ifndef GL_ANGLE_translated_shader_source
-#define GL_ANGLE_translated_shader_source 1
-#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
-typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
-#endif
-#endif /* GL_ANGLE_translated_shader_source */
-
-#ifndef GL_APPLE_clip_distance
-#define GL_APPLE_clip_distance 1
-#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32
-#define GL_CLIP_DISTANCE0_APPLE 0x3000
-#define GL_CLIP_DISTANCE1_APPLE 0x3001
-#define GL_CLIP_DISTANCE2_APPLE 0x3002
-#define GL_CLIP_DISTANCE3_APPLE 0x3003
-#define GL_CLIP_DISTANCE4_APPLE 0x3004
-#define GL_CLIP_DISTANCE5_APPLE 0x3005
-#define GL_CLIP_DISTANCE6_APPLE 0x3006
-#define GL_CLIP_DISTANCE7_APPLE 0x3007
-#endif /* GL_APPLE_clip_distance */
-
-#ifndef GL_APPLE_color_buffer_packed_float
-#define GL_APPLE_color_buffer_packed_float 1
-#endif /* GL_APPLE_color_buffer_packed_float */
-
-#ifndef GL_APPLE_copy_texture_levels
-#define GL_APPLE_copy_texture_levels 1
-typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
-#endif
-#endif /* GL_APPLE_copy_texture_levels */
-
-#ifndef GL_APPLE_framebuffer_multisample
-#define GL_APPLE_framebuffer_multisample 1
-#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
-#define GL_MAX_SAMPLES_APPLE 0x8D57
-#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
-#endif
-#endif /* GL_APPLE_framebuffer_multisample */
-
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-#define GL_RGB_422_APPLE 0x8A1F
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#define GL_RGB_RAW_422_APPLE 0x8A51
-#endif /* GL_APPLE_rgb_422 */
-
-#ifndef GL_APPLE_sync
-#define GL_APPLE_sync 1
-#define GL_SYNC_OBJECT_APPLE 0x8A53
-#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111
-#define GL_OBJECT_TYPE_APPLE 0x9112
-#define GL_SYNC_CONDITION_APPLE 0x9113
-#define GL_SYNC_STATUS_APPLE 0x9114
-#define GL_SYNC_FLAGS_APPLE 0x9115
-#define GL_SYNC_FENCE_APPLE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
-#define GL_UNSIGNALED_APPLE 0x9118
-#define GL_SIGNALED_APPLE 0x9119
-#define GL_ALREADY_SIGNALED_APPLE 0x911A
-#define GL_TIMEOUT_EXPIRED_APPLE 0x911B
-#define GL_CONDITION_SATISFIED_APPLE 0x911C
-#define GL_WAIT_FAILED_APPLE 0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001
-#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull
-typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
-typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
-typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
-typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
-GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
-GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
-GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
-GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif
-#endif /* GL_APPLE_sync */
-
-#ifndef GL_APPLE_texture_format_BGRA8888
-#define GL_APPLE_texture_format_BGRA8888 1
-#define GL_BGRA_EXT 0x80E1
-#define GL_BGRA8_EXT 0x93A1
-#endif /* GL_APPLE_texture_format_BGRA8888 */
-
-#ifndef GL_APPLE_texture_max_level
-#define GL_APPLE_texture_max_level 1
-#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
-#endif /* GL_APPLE_texture_max_level */
-
-#ifndef GL_APPLE_texture_packed_float
-#define GL_APPLE_texture_packed_float 1
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B
-#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E
-#define GL_R11F_G11F_B10F_APPLE 0x8C3A
-#define GL_RGB9_E5_APPLE 0x8C3D
-#endif /* GL_APPLE_texture_packed_float */
-
-#ifndef GL_ARM_mali_program_binary
-#define GL_ARM_mali_program_binary 1
-#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61
-#endif /* GL_ARM_mali_program_binary */
-
-#ifndef GL_ARM_mali_shader_binary
-#define GL_ARM_mali_shader_binary 1
-#define GL_MALI_SHADER_BINARY_ARM 0x8F60
-#endif /* GL_ARM_mali_shader_binary */
-
-#ifndef GL_ARM_rgba8
-#define GL_ARM_rgba8 1
-#endif /* GL_ARM_rgba8 */
-
-#ifndef GL_ARM_shader_framebuffer_fetch
-#define GL_ARM_shader_framebuffer_fetch 1
-#define GL_FETCH_PER_SAMPLE_ARM 0x8F65
-#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66
-#endif /* GL_ARM_shader_framebuffer_fetch */
-
-#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil
-#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
-#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
-
-#ifndef GL_DMP_program_binary
-#define GL_DMP_program_binary 1
-#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251
-#define GL_SMAPHS_PROGRAM_BINARY_DMP 0x9252
-#define GL_DMP_PROGRAM_BINARY_DMP 0x9253
-#endif /* GL_DMP_program_binary */
-
-#ifndef GL_DMP_shader_binary
-#define GL_DMP_shader_binary 1
-#define GL_SHADER_BINARY_DMP 0x9250
-#endif /* GL_DMP_shader_binary */
-
-#ifndef GL_EXT_YUV_target
-#define GL_EXT_YUV_target 1
-#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7
-#endif /* GL_EXT_YUV_target */
-
-#ifndef GL_EXT_base_instance
-#define GL_EXT_base_instance 1
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
-#endif
-#endif /* GL_EXT_base_instance */
-
-#ifndef GL_EXT_blend_func_extended
-#define GL_EXT_blend_func_extended 1
-#define GL_SRC1_COLOR_EXT 0x88F9
-#define GL_SRC1_ALPHA_EXT 0x8589
-#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB
-#define GL_SRC_ALPHA_SATURATE_EXT 0x0308
-#define GL_LOCATION_INDEX_EXT 0x930F
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC
-typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar *name);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-GL_APICALL void GL_APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
-GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXT (GLuint program, const GLchar *name);
-#endif
-#endif /* GL_EXT_blend_func_extended */
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#endif /* GL_EXT_blend_minmax */
-
-#ifndef GL_EXT_buffer_storage
-#define GL_EXT_buffer_storage 1
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_PERSISTENT_BIT_EXT 0x0040
-#define GL_MAP_COHERENT_BIT_EXT 0x0080
-#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100
-#define GL_CLIENT_STORAGE_BIT_EXT 0x0200
-#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000
-#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F
-#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220
-typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
-#endif
-#endif /* GL_EXT_buffer_storage */
-
-#ifndef GL_EXT_color_buffer_float
-#define GL_EXT_color_buffer_float 1
-#endif /* GL_EXT_color_buffer_float */
-
-#ifndef GL_EXT_color_buffer_half_float
-#define GL_EXT_color_buffer_half_float 1
-#define GL_RGBA16F_EXT 0x881A
-#define GL_RGB16F_EXT 0x881B
-#define GL_RG16F_EXT 0x822F
-#define GL_R16F_EXT 0x822D
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
-#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
-#endif /* GL_EXT_color_buffer_half_float */
-
-#ifndef GL_EXT_copy_image
-#define GL_EXT_copy_image 1
-typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-#endif
-#endif /* GL_EXT_copy_image */
-
-#ifndef GL_EXT_debug_label
-#define GL_EXT_debug_label 1
-#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
-#define GL_PROGRAM_OBJECT_EXT 0x8B40
-#define GL_SHADER_OBJECT_EXT 0x8B48
-#define GL_BUFFER_OBJECT_EXT 0x9151
-#define GL_QUERY_OBJECT_EXT 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif
-#endif /* GL_EXT_debug_label */
-
-#ifndef GL_EXT_debug_marker
-#define GL_EXT_debug_marker 1
-typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
-GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
-GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
-#endif
-#endif /* GL_EXT_debug_marker */
-
-#ifndef GL_EXT_discard_framebuffer
-#define GL_EXT_discard_framebuffer 1
-#define GL_COLOR_EXT 0x1800
-#define GL_DEPTH_EXT 0x1801
-#define GL_STENCIL_EXT 0x1802
-typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-#endif
-#endif /* GL_EXT_discard_framebuffer */
-
-#ifndef GL_EXT_disjoint_timer_query
-#define GL_EXT_disjoint_timer_query 1
-#define GL_QUERY_COUNTER_BITS_EXT 0x8864
-#define GL_CURRENT_QUERY_EXT 0x8865
-#define GL_QUERY_RESULT_EXT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
-#define GL_TIME_ELAPSED_EXT 0x88BF
-#define GL_TIMESTAMP_EXT 0x8E28
-#define GL_GPU_DISJOINT_EXT 0x8FBB
-typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
-GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
-GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
-GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target);
-GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
-#endif
-#endif /* GL_EXT_disjoint_timer_query */
-
-#ifndef GL_EXT_draw_buffers
-#define GL_EXT_draw_buffers 1
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_MAX_DRAW_BUFFERS_EXT 0x8824
-#define GL_DRAW_BUFFER0_EXT 0x8825
-#define GL_DRAW_BUFFER1_EXT 0x8826
-#define GL_DRAW_BUFFER2_EXT 0x8827
-#define GL_DRAW_BUFFER3_EXT 0x8828
-#define GL_DRAW_BUFFER4_EXT 0x8829
-#define GL_DRAW_BUFFER5_EXT 0x882A
-#define GL_DRAW_BUFFER6_EXT 0x882B
-#define GL_DRAW_BUFFER7_EXT 0x882C
-#define GL_DRAW_BUFFER8_EXT 0x882D
-#define GL_DRAW_BUFFER9_EXT 0x882E
-#define GL_DRAW_BUFFER10_EXT 0x882F
-#define GL_DRAW_BUFFER11_EXT 0x8830
-#define GL_DRAW_BUFFER12_EXT 0x8831
-#define GL_DRAW_BUFFER13_EXT 0x8832
-#define GL_DRAW_BUFFER14_EXT 0x8833
-#define GL_DRAW_BUFFER15_EXT 0x8834
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs);
-#endif
-#endif /* GL_EXT_draw_buffers */
-
-#ifndef GL_EXT_draw_buffers_indexed
-#define GL_EXT_draw_buffers_indexed 1
-typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index);
-#endif
-#endif /* GL_EXT_draw_buffers_indexed */
-
-#ifndef GL_EXT_draw_elements_base_vertex
-#define GL_EXT_draw_elements_base_vertex 1
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
-#endif
-#endif /* GL_EXT_draw_elements_base_vertex */
-
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#endif
-#endif /* GL_EXT_draw_instanced */
-
-#ifndef GL_EXT_float_blend
-#define GL_EXT_float_blend 1
-#endif /* GL_EXT_float_blend */
-
-#ifndef GL_EXT_geometry_point_size
-#define GL_EXT_geometry_point_size 1
-#endif /* GL_EXT_geometry_point_size */
-
-#ifndef GL_EXT_geometry_shader
-#define GL_EXT_geometry_shader 1
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004
-#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916
-#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917
-#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918
-#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F
-#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E
-#define GL_LINES_ADJACENCY_EXT 0x000A
-#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
-#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD
-#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7
-#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
-#define GL_UNDEFINED_VERTEX_EXT 0x8260
-#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
-#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312
-#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif
-#endif /* GL_EXT_geometry_shader */
-
-#ifndef GL_EXT_gpu_shader5
-#define GL_EXT_gpu_shader5 1
-#endif /* GL_EXT_gpu_shader5 */
-
-#ifndef GL_EXT_instanced_arrays
-#define GL_EXT_instanced_arrays 1
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor);
-#endif
-#endif /* GL_EXT_instanced_arrays */
-
-#ifndef GL_EXT_map_buffer_range
-#define GL_EXT_map_buffer_range 1
-#define GL_MAP_READ_BIT_EXT 0x0001
-#define GL_MAP_WRITE_BIT_EXT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020
-typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif
-#endif /* GL_EXT_map_buffer_range */
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
-#endif
-#endif /* GL_EXT_multi_draw_arrays */
-
-#ifndef GL_EXT_multi_draw_indirect
-#define GL_EXT_multi_draw_indirect 1
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
-#endif
-#endif /* GL_EXT_multi_draw_indirect */
-
-#ifndef GL_EXT_multisampled_compatibility
-#define GL_EXT_multisampled_compatibility 1
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#endif /* GL_EXT_multisampled_compatibility */
-
-#ifndef GL_EXT_multisampled_render_to_texture
-#define GL_EXT_multisampled_render_to_texture 1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT 0x8D57
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-#endif /* GL_EXT_multisampled_render_to_texture */
-
-#ifndef GL_EXT_multiview_draw_buffers
-#define GL_EXT_multiview_draw_buffers 1
-#define GL_COLOR_ATTACHMENT_EXT 0x90F0
-#define GL_MULTIVIEW_EXT 0x90F1
-#define GL_DRAW_BUFFER_EXT 0x0C01
-#define GL_READ_BUFFER_EXT 0x0C02
-#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2
-typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index);
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index);
-GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices);
-GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data);
-#endif
-#endif /* GL_EXT_multiview_draw_buffers */
-
-#ifndef GL_EXT_occlusion_query_boolean
-#define GL_EXT_occlusion_query_boolean 1
-#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
-#endif /* GL_EXT_occlusion_query_boolean */
-
-#ifndef GL_EXT_post_depth_coverage
-#define GL_EXT_post_depth_coverage 1
-#endif /* GL_EXT_post_depth_coverage */
-
-#ifndef GL_EXT_primitive_bounding_box
-#define GL_EXT_primitive_bounding_box 1
-#define GL_PRIMITIVE_BOUNDING_BOX_EXT 0x92BE
-typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-#endif
-#endif /* GL_EXT_primitive_bounding_box */
-
-#ifndef GL_EXT_pvrtc_sRGB
-#define GL_EXT_pvrtc_sRGB 1
-#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54
-#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55
-#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56
-#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57
-#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0
-#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1
-#endif /* GL_EXT_pvrtc_sRGB */
-
-#ifndef GL_EXT_raster_multisample
-#define GL_EXT_raster_multisample 1
-#define GL_RASTER_MULTISAMPLE_EXT 0x9327
-#define GL_RASTER_SAMPLES_EXT 0x9328
-#define GL_MAX_RASTER_SAMPLES_EXT 0x9329
-#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A
-#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B
-#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C
-typedef void (GL_APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations);
-#endif
-#endif /* GL_EXT_raster_multisample */
-
-#ifndef GL_EXT_read_format_bgra
-#define GL_EXT_read_format_bgra 1
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
-#endif /* GL_EXT_read_format_bgra */
-
-#ifndef GL_EXT_render_snorm
-#define GL_EXT_render_snorm 1
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM_EXT 0x8F98
-#define GL_RG16_SNORM_EXT 0x8F99
-#define GL_RGBA16_SNORM_EXT 0x8F9B
-#endif /* GL_EXT_render_snorm */
-
-#ifndef GL_EXT_robustness
-#define GL_EXT_robustness 1
-#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
-#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
-#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
-#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
-#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
-typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
-typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
-GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-#endif
-#endif /* GL_EXT_robustness */
-
-#ifndef GL_EXT_sRGB
-#define GL_EXT_sRGB 1
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
-#endif /* GL_EXT_sRGB */
-
-#ifndef GL_EXT_sRGB_write_control
-#define GL_EXT_sRGB_write_control 1
-#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
-#endif /* GL_EXT_sRGB_write_control */
-
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
-#define GL_ACTIVE_PROGRAM_EXT 0x8259
-#define GL_VERTEX_SHADER_BIT_EXT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002
-#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE_EXT 0x8258
-#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A
-typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
-typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
-GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
-GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
-GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
-GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-#endif /* GL_EXT_separate_shader_objects */
-
-#ifndef GL_EXT_shader_framebuffer_fetch
-#define GL_EXT_shader_framebuffer_fetch 1
-#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
-#endif /* GL_EXT_shader_framebuffer_fetch */
-
-#ifndef GL_EXT_shader_implicit_conversions
-#define GL_EXT_shader_implicit_conversions 1
-#endif /* GL_EXT_shader_implicit_conversions */
-
-#ifndef GL_EXT_shader_integer_mix
-#define GL_EXT_shader_integer_mix 1
-#endif /* GL_EXT_shader_integer_mix */
-
-#ifndef GL_EXT_shader_io_blocks
-#define GL_EXT_shader_io_blocks 1
-#endif /* GL_EXT_shader_io_blocks */
-
-#ifndef GL_EXT_shader_pixel_local_storage
-#define GL_EXT_shader_pixel_local_storage 1
-#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63
-#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67
-#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64
-#endif /* GL_EXT_shader_pixel_local_storage */
-
-#ifndef GL_EXT_shader_texture_lod
-#define GL_EXT_shader_texture_lod 1
-#endif /* GL_EXT_shader_texture_lod */
-
-#ifndef GL_EXT_shadow_samplers
-#define GL_EXT_shadow_samplers 1
-#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D
-#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E
-#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62
-#endif /* GL_EXT_shadow_samplers */
-
-#ifndef GL_EXT_sparse_texture
-#define GL_EXT_sparse_texture 1
-#define GL_TEXTURE_SPARSE_EXT 0x91A6
-#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7
-#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA
-#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8
-#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195
-#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196
-#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_TEXTURE_3D 0x806F
-#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198
-#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199
-#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A
-#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9
-typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
-#endif
-#endif /* GL_EXT_sparse_texture */
-
-#ifndef GL_EXT_tessellation_point_size
-#define GL_EXT_tessellation_point_size 1
-#endif /* GL_EXT_tessellation_point_size */
-
-#ifndef GL_EXT_tessellation_shader
-#define GL_EXT_tessellation_shader 1
-#define GL_PATCHES_EXT 0x000E
-#define GL_PATCH_VERTICES_EXT 0x8E72
-#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75
-#define GL_TESS_GEN_MODE_EXT 0x8E76
-#define GL_TESS_GEN_SPACING_EXT 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER_EXT 0x8E78
-#define GL_TESS_GEN_POINT_MODE_EXT 0x8E79
-#define GL_ISOLINES_EXT 0x8E7A
-#define GL_QUADS_EXT 0x0007
-#define GL_FRACTIONAL_ODD_EXT 0x8E7B
-#define GL_FRACTIONAL_EVEN_EXT 0x8E7C
-#define GL_MAX_PATCH_VERTICES_EXT 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL_EXT 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC
-#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8
-#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9
-#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
-#define GL_IS_PER_PATCH_EXT 0x92E7
-#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307
-#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308
-#define GL_TESS_CONTROL_SHADER_EXT 0x8E88
-#define GL_TESS_EVALUATION_SHADER_EXT 0x8E87
-#define GL_TESS_CONTROL_SHADER_BIT_EXT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010
-typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value);
-#endif
-#endif /* GL_EXT_tessellation_shader */
-
-#ifndef GL_EXT_texture_border_clamp
-#define GL_EXT_texture_border_clamp 1
-#define GL_TEXTURE_BORDER_COLOR_EXT 0x1004
-#define GL_CLAMP_TO_BORDER_EXT 0x812D
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
-GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param);
-GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params);
-#endif
-#endif /* GL_EXT_texture_border_clamp */
-
-#ifndef GL_EXT_texture_buffer
-#define GL_EXT_texture_buffer 1
-#define GL_TEXTURE_BUFFER_EXT 0x8C2A
-#define GL_TEXTURE_BUFFER_BINDING_EXT 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F
-#define GL_SAMPLER_BUFFER_EXT 0x8DC2
-#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
-#define GL_IMAGE_BUFFER_EXT 0x9051
-#define GL_INT_IMAGE_BUFFER_EXT 0x905C
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
-#define GL_TEXTURE_BUFFER_OFFSET_EXT 0x919D
-#define GL_TEXTURE_BUFFER_SIZE_EXT 0x919E
-typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
-GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-#endif
-#endif /* GL_EXT_texture_buffer */
-
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#endif /* GL_EXT_texture_compression_dxt1 */
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_EXT_texture_compression_s3tc 1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-#endif /* GL_EXT_texture_compression_s3tc */
-
-#ifndef GL_EXT_texture_cube_map_array
-#define GL_EXT_texture_cube_map_array 1
-#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A
-#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F
-#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
-#endif /* GL_EXT_texture_cube_map_array */
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif /* GL_EXT_texture_filter_anisotropic */
-
-#ifndef GL_EXT_texture_filter_minmax
-#define GL_EXT_texture_filter_minmax 1
-#endif /* GL_EXT_texture_filter_minmax */
-
-#ifndef GL_EXT_texture_format_BGRA8888
-#define GL_EXT_texture_format_BGRA8888 1
-#endif /* GL_EXT_texture_format_BGRA8888 */
-
-#ifndef GL_EXT_texture_norm16
-#define GL_EXT_texture_norm16 1
-#define GL_R16_EXT 0x822A
-#define GL_RG16_EXT 0x822C
-#define GL_RGBA16_EXT 0x805B
-#define GL_RGB16_EXT 0x8054
-#define GL_RGB16_SNORM_EXT 0x8F9A
-#endif /* GL_EXT_texture_norm16 */
-
-#ifndef GL_EXT_texture_rg
-#define GL_EXT_texture_rg 1
-#define GL_RED_EXT 0x1903
-#define GL_RG_EXT 0x8227
-#define GL_R8_EXT 0x8229
-#define GL_RG8_EXT 0x822B
-#endif /* GL_EXT_texture_rg */
-
-#ifndef GL_EXT_texture_sRGB_R8
-#define GL_EXT_texture_sRGB_R8 1
-#define GL_SR8_EXT 0x8FBD
-#endif /* GL_EXT_texture_sRGB_R8 */
-
-#ifndef GL_EXT_texture_sRGB_RG8
-#define GL_EXT_texture_sRGB_RG8 1
-#define GL_SRG8_EXT 0x8FBE
-#endif /* GL_EXT_texture_sRGB_RG8 */
-
-#ifndef GL_EXT_texture_sRGB_decode
-#define GL_EXT_texture_sRGB_decode 1
-#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
-#define GL_DECODE_EXT 0x8A49
-#define GL_SKIP_DECODE_EXT 0x8A4A
-#endif /* GL_EXT_texture_sRGB_decode */
-
-#ifndef GL_EXT_texture_storage
-#define GL_EXT_texture_storage 1
-#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
-#define GL_ALPHA8_EXT 0x803C
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_RGBA32F_EXT 0x8814
-#define GL_RGB32F_EXT 0x8815
-#define GL_ALPHA32F_EXT 0x8816
-#define GL_LUMINANCE32F_EXT 0x8818
-#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
-#define GL_ALPHA16F_EXT 0x881C
-#define GL_LUMINANCE16F_EXT 0x881E
-#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
-#define GL_R32F_EXT 0x822E
-#define GL_RG32F_EXT 0x8230
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-#endif /* GL_EXT_texture_storage */
-
-#ifndef GL_EXT_texture_type_2_10_10_10_REV
-#define GL_EXT_texture_type_2_10_10_10_REV 1
-#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
-#endif /* GL_EXT_texture_type_2_10_10_10_REV */
-
-#ifndef GL_EXT_texture_view
-#define GL_EXT_texture_view 1
-#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB
-#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC
-#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD
-#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE
-typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-#endif
-#endif /* GL_EXT_texture_view */
-
-#ifndef GL_EXT_unpack_subimage
-#define GL_EXT_unpack_subimage 1
-#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2
-#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4
-#endif /* GL_EXT_unpack_subimage */
-
-#ifndef GL_FJ_shader_binary_GCCSO
-#define GL_FJ_shader_binary_GCCSO 1
-#define GL_GCCSO_SHADER_BINARY_FJ 0x9260
-#endif /* GL_FJ_shader_binary_GCCSO */
-
-#ifndef GL_IMG_multisampled_render_to_texture
-#define GL_IMG_multisampled_render_to_texture 1
-#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
-#define GL_MAX_SAMPLES_IMG 0x9135
-#define GL_TEXTURE_SAMPLES_IMG 0x9136
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-#endif
-#endif /* GL_IMG_multisampled_render_to_texture */
-
-#ifndef GL_IMG_program_binary
-#define GL_IMG_program_binary 1
-#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
-#endif /* GL_IMG_program_binary */
-
-#ifndef GL_IMG_read_format
-#define GL_IMG_read_format 1
-#define GL_BGRA_IMG 0x80E1
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
-#endif /* GL_IMG_read_format */
-
-#ifndef GL_IMG_shader_binary
-#define GL_IMG_shader_binary 1
-#define GL_SGX_BINARY_IMG 0x8C0A
-#endif /* GL_IMG_shader_binary */
-
-#ifndef GL_IMG_texture_compression_pvrtc
-#define GL_IMG_texture_compression_pvrtc 1
-#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
-#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
-#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
-#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
-#endif /* GL_IMG_texture_compression_pvrtc */
-
-#ifndef GL_IMG_texture_compression_pvrtc2
-#define GL_IMG_texture_compression_pvrtc2 1
-#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137
-#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138
-#endif /* GL_IMG_texture_compression_pvrtc2 */
-
-#ifndef GL_IMG_texture_filter_cubic
-#define GL_IMG_texture_filter_cubic 1
-#define GL_CUBIC_IMG 0x9139
-#define GL_CUBIC_MIPMAP_NEAREST_IMG 0x913A
-#define GL_CUBIC_MIPMAP_LINEAR_IMG 0x913B
-#endif /* GL_IMG_texture_filter_cubic */
-
-#ifndef GL_INTEL_framebuffer_CMAA
-#define GL_INTEL_framebuffer_CMAA 1
-typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void);
-#endif
-#endif /* GL_INTEL_framebuffer_CMAA */
-
-#ifndef GL_INTEL_performance_query
-#define GL_INTEL_performance_query 1
-#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000
-#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001
-#define GL_PERFQUERY_WAIT_INTEL 0x83FB
-#define GL_PERFQUERY_FLUSH_INTEL 0x83FA
-#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9
-#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0
-#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1
-#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2
-#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3
-#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4
-#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5
-#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8
-#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9
-#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA
-#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB
-#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC
-#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD
-#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE
-#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF
-#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
-typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
-typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
-typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
-typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
-typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
-typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
-typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
-typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
-typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
-GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
-GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
-GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
-GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
-GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
-GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
-GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
-GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
-#endif
-#endif /* GL_INTEL_performance_query */
-
-#ifndef GL_NV_bindless_texture
-#define GL_NV_bindless_texture 1
-typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
-typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);
-typedef GLuint64 (GL_APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
-typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);
-typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
-typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef GLboolean (GL_APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV (GLuint texture);
-GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler);
-GL_APICALL void GL_APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle);
-GL_APICALL void GL_APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle);
-GL_APICALL GLuint64 GL_APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-GL_APICALL void GL_APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access);
-GL_APICALL void GL_APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle);
-GL_APICALL void GL_APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value);
-GL_APICALL void GL_APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value);
-GL_APICALL void GL_APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value);
-GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
-GL_APICALL GLboolean GL_APIENTRY glIsTextureHandleResidentNV (GLuint64 handle);
-GL_APICALL GLboolean GL_APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
-#endif
-#endif /* GL_NV_bindless_texture */
-
-#ifndef GL_NV_blend_equation_advanced
-#define GL_NV_blend_equation_advanced 1
-#define GL_BLEND_OVERLAP_NV 0x9281
-#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280
-#define GL_BLUE_NV 0x1905
-#define GL_COLORBURN_NV 0x929A
-#define GL_COLORDODGE_NV 0x9299
-#define GL_CONJOINT_NV 0x9284
-#define GL_CONTRAST_NV 0x92A1
-#define GL_DARKEN_NV 0x9297
-#define GL_DIFFERENCE_NV 0x929E
-#define GL_DISJOINT_NV 0x9283
-#define GL_DST_ATOP_NV 0x928F
-#define GL_DST_IN_NV 0x928B
-#define GL_DST_NV 0x9287
-#define GL_DST_OUT_NV 0x928D
-#define GL_DST_OVER_NV 0x9289
-#define GL_EXCLUSION_NV 0x92A0
-#define GL_GREEN_NV 0x1904
-#define GL_HARDLIGHT_NV 0x929B
-#define GL_HARDMIX_NV 0x92A9
-#define GL_HSL_COLOR_NV 0x92AF
-#define GL_HSL_HUE_NV 0x92AD
-#define GL_HSL_LUMINOSITY_NV 0x92B0
-#define GL_HSL_SATURATION_NV 0x92AE
-#define GL_INVERT_OVG_NV 0x92B4
-#define GL_INVERT_RGB_NV 0x92A3
-#define GL_LIGHTEN_NV 0x9298
-#define GL_LINEARBURN_NV 0x92A5
-#define GL_LINEARDODGE_NV 0x92A4
-#define GL_LINEARLIGHT_NV 0x92A7
-#define GL_MINUS_CLAMPED_NV 0x92B3
-#define GL_MINUS_NV 0x929F
-#define GL_MULTIPLY_NV 0x9294
-#define GL_OVERLAY_NV 0x9296
-#define GL_PINLIGHT_NV 0x92A8
-#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2
-#define GL_PLUS_CLAMPED_NV 0x92B1
-#define GL_PLUS_DARKER_NV 0x9292
-#define GL_PLUS_NV 0x9291
-#define GL_RED_NV 0x1903
-#define GL_SCREEN_NV 0x9295
-#define GL_SOFTLIGHT_NV 0x929C
-#define GL_SRC_ATOP_NV 0x928E
-#define GL_SRC_IN_NV 0x928A
-#define GL_SRC_NV 0x9286
-#define GL_SRC_OUT_NV 0x928C
-#define GL_SRC_OVER_NV 0x9288
-#define GL_UNCORRELATED_NV 0x9282
-#define GL_VIVIDLIGHT_NV 0x92A6
-#define GL_XOR_NV 0x1506
-typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glBlendBarrierNV (void);
-#endif
-#endif /* GL_NV_blend_equation_advanced */
-
-#ifndef GL_NV_blend_equation_advanced_coherent
-#define GL_NV_blend_equation_advanced_coherent 1
-#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
-#endif /* GL_NV_blend_equation_advanced_coherent */
-
-#ifndef GL_NV_conditional_render
-#define GL_NV_conditional_render 1
-#define GL_QUERY_WAIT_NV 0x8E13
-#define GL_QUERY_NO_WAIT_NV 0x8E14
-#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
-typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
-typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
-GL_APICALL void GL_APIENTRY glEndConditionalRenderNV (void);
-#endif
-#endif /* GL_NV_conditional_render */
-
-#ifndef GL_NV_conservative_raster
-#define GL_NV_conservative_raster 1
-#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346
-#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347
-#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348
-#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349
-typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits);
-#endif
-#endif /* GL_NV_conservative_raster */
-
-#ifndef GL_NV_copy_buffer
-#define GL_NV_copy_buffer 1
-#define GL_COPY_READ_BUFFER_NV 0x8F36
-#define GL_COPY_WRITE_BUFFER_NV 0x8F37
-typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif
-#endif /* GL_NV_copy_buffer */
-
-#ifndef GL_NV_coverage_sample
-#define GL_NV_coverage_sample 1
-#define GL_COVERAGE_COMPONENT_NV 0x8ED0
-#define GL_COVERAGE_COMPONENT4_NV 0x8ED1
-#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
-#define GL_COVERAGE_BUFFERS_NV 0x8ED3
-#define GL_COVERAGE_SAMPLES_NV 0x8ED4
-#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
-#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
-#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
-#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
-GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
-#endif
-#endif /* GL_NV_coverage_sample */
-
-#ifndef GL_NV_depth_nonlinear
-#define GL_NV_depth_nonlinear 1
-#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
-#endif /* GL_NV_depth_nonlinear */
-
-#ifndef GL_NV_draw_buffers
-#define GL_NV_draw_buffers 1
-#define GL_MAX_DRAW_BUFFERS_NV 0x8824
-#define GL_DRAW_BUFFER0_NV 0x8825
-#define GL_DRAW_BUFFER1_NV 0x8826
-#define GL_DRAW_BUFFER2_NV 0x8827
-#define GL_DRAW_BUFFER3_NV 0x8828
-#define GL_DRAW_BUFFER4_NV 0x8829
-#define GL_DRAW_BUFFER5_NV 0x882A
-#define GL_DRAW_BUFFER6_NV 0x882B
-#define GL_DRAW_BUFFER7_NV 0x882C
-#define GL_DRAW_BUFFER8_NV 0x882D
-#define GL_DRAW_BUFFER9_NV 0x882E
-#define GL_DRAW_BUFFER10_NV 0x882F
-#define GL_DRAW_BUFFER11_NV 0x8830
-#define GL_DRAW_BUFFER12_NV 0x8831
-#define GL_DRAW_BUFFER13_NV 0x8832
-#define GL_DRAW_BUFFER14_NV 0x8833
-#define GL_DRAW_BUFFER15_NV 0x8834
-#define GL_COLOR_ATTACHMENT0_NV 0x8CE0
-#define GL_COLOR_ATTACHMENT1_NV 0x8CE1
-#define GL_COLOR_ATTACHMENT2_NV 0x8CE2
-#define GL_COLOR_ATTACHMENT3_NV 0x8CE3
-#define GL_COLOR_ATTACHMENT4_NV 0x8CE4
-#define GL_COLOR_ATTACHMENT5_NV 0x8CE5
-#define GL_COLOR_ATTACHMENT6_NV 0x8CE6
-#define GL_COLOR_ATTACHMENT7_NV 0x8CE7
-#define GL_COLOR_ATTACHMENT8_NV 0x8CE8
-#define GL_COLOR_ATTACHMENT9_NV 0x8CE9
-#define GL_COLOR_ATTACHMENT10_NV 0x8CEA
-#define GL_COLOR_ATTACHMENT11_NV 0x8CEB
-#define GL_COLOR_ATTACHMENT12_NV 0x8CEC
-#define GL_COLOR_ATTACHMENT13_NV 0x8CED
-#define GL_COLOR_ATTACHMENT14_NV 0x8CEE
-#define GL_COLOR_ATTACHMENT15_NV 0x8CEF
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
-#endif
-#endif /* GL_NV_draw_buffers */
-
-#ifndef GL_NV_draw_instanced
-#define GL_NV_draw_instanced 1
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#endif
-#endif /* GL_NV_draw_instanced */
-
-#ifndef GL_NV_explicit_attrib_location
-#define GL_NV_explicit_attrib_location 1
-#endif /* GL_NV_explicit_attrib_location */
-
-#ifndef GL_NV_fbo_color_attachments
-#define GL_NV_fbo_color_attachments 1
-#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
-#endif /* GL_NV_fbo_color_attachments */
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
-GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
-GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
-GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
-GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence);
-GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
-#endif
-#endif /* GL_NV_fence */
-
-#ifndef GL_NV_fill_rectangle
-#define GL_NV_fill_rectangle 1
-#define GL_FILL_RECTANGLE_NV 0x933C
-#endif /* GL_NV_fill_rectangle */
-
-#ifndef GL_NV_fragment_coverage_to_color
-#define GL_NV_fragment_coverage_to_color 1
-#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD
-#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE
-typedef void (GL_APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color);
-#endif
-#endif /* GL_NV_fragment_coverage_to_color */
-
-#ifndef GL_NV_fragment_shader_interlock
-#define GL_NV_fragment_shader_interlock 1
-#endif /* GL_NV_fragment_shader_interlock */
-
-#ifndef GL_NV_framebuffer_blit
-#define GL_NV_framebuffer_blit 1
-#define GL_READ_FRAMEBUFFER_NV 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-#endif /* GL_NV_framebuffer_blit */
-
-#ifndef GL_NV_framebuffer_mixed_samples
-#define GL_NV_framebuffer_mixed_samples 1
-#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331
-#define GL_COLOR_SAMPLES_NV 0x8E20
-#define GL_DEPTH_SAMPLES_NV 0x932D
-#define GL_STENCIL_SAMPLES_NV 0x932E
-#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F
-#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330
-#define GL_COVERAGE_MODULATION_NV 0x9332
-#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v);
-GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components);
-#endif
-#endif /* GL_NV_framebuffer_mixed_samples */
-
-#ifndef GL_NV_framebuffer_multisample
-#define GL_NV_framebuffer_multisample 1
-#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56
-#define GL_MAX_SAMPLES_NV 0x8D57
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_NV_framebuffer_multisample */
-
-#ifndef GL_NV_generate_mipmap_sRGB
-#define GL_NV_generate_mipmap_sRGB 1
-#endif /* GL_NV_generate_mipmap_sRGB */
-
-#ifndef GL_NV_geometry_shader_passthrough
-#define GL_NV_geometry_shader_passthrough 1
-#endif /* GL_NV_geometry_shader_passthrough */
-
-#ifndef GL_NV_image_formats
-#define GL_NV_image_formats 1
-#endif /* GL_NV_image_formats */
-
-#ifndef GL_NV_instanced_arrays
-#define GL_NV_instanced_arrays 1
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor);
-#endif
-#endif /* GL_NV_instanced_arrays */
-
-#ifndef GL_NV_internalformat_sample_query
-#define GL_NV_internalformat_sample_query 1
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_MULTISAMPLES_NV 0x9371
-#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372
-#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373
-#define GL_CONFORMANT_NV 0x9374
-typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
-#endif
-#endif /* GL_NV_internalformat_sample_query */
-
-#ifndef GL_NV_non_square_matrices
-#define GL_NV_non_square_matrices 1
-#define GL_FLOAT_MAT2x3_NV 0x8B65
-#define GL_FLOAT_MAT2x4_NV 0x8B66
-#define GL_FLOAT_MAT3x2_NV 0x8B67
-#define GL_FLOAT_MAT3x4_NV 0x8B68
-#define GL_FLOAT_MAT4x2_NV 0x8B69
-#define GL_FLOAT_MAT4x3_NV 0x8B6A
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-#endif /* GL_NV_non_square_matrices */
-
-#ifndef GL_NV_path_rendering
-#define GL_NV_path_rendering 1
-#define GL_PATH_FORMAT_SVG_NV 0x9070
-#define GL_PATH_FORMAT_PS_NV 0x9071
-#define GL_STANDARD_FONT_NAME_NV 0x9072
-#define GL_SYSTEM_FONT_NAME_NV 0x9073
-#define GL_FILE_NAME_NV 0x9074
-#define GL_PATH_STROKE_WIDTH_NV 0x9075
-#define GL_PATH_END_CAPS_NV 0x9076
-#define GL_PATH_INITIAL_END_CAP_NV 0x9077
-#define GL_PATH_TERMINAL_END_CAP_NV 0x9078
-#define GL_PATH_JOIN_STYLE_NV 0x9079
-#define GL_PATH_MITER_LIMIT_NV 0x907A
-#define GL_PATH_DASH_CAPS_NV 0x907B
-#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C
-#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D
-#define GL_PATH_DASH_OFFSET_NV 0x907E
-#define GL_PATH_CLIENT_LENGTH_NV 0x907F
-#define GL_PATH_FILL_MODE_NV 0x9080
-#define GL_PATH_FILL_MASK_NV 0x9081
-#define GL_PATH_FILL_COVER_MODE_NV 0x9082
-#define GL_PATH_STROKE_COVER_MODE_NV 0x9083
-#define GL_PATH_STROKE_MASK_NV 0x9084
-#define GL_COUNT_UP_NV 0x9088
-#define GL_COUNT_DOWN_NV 0x9089
-#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A
-#define GL_CONVEX_HULL_NV 0x908B
-#define GL_BOUNDING_BOX_NV 0x908D
-#define GL_TRANSLATE_X_NV 0x908E
-#define GL_TRANSLATE_Y_NV 0x908F
-#define GL_TRANSLATE_2D_NV 0x9090
-#define GL_TRANSLATE_3D_NV 0x9091
-#define GL_AFFINE_2D_NV 0x9092
-#define GL_AFFINE_3D_NV 0x9094
-#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
-#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
-#define GL_UTF8_NV 0x909A
-#define GL_UTF16_NV 0x909B
-#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
-#define GL_PATH_COMMAND_COUNT_NV 0x909D
-#define GL_PATH_COORD_COUNT_NV 0x909E
-#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F
-#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0
-#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1
-#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2
-#define GL_SQUARE_NV 0x90A3
-#define GL_ROUND_NV 0x90A4
-#define GL_TRIANGULAR_NV 0x90A5
-#define GL_BEVEL_NV 0x90A6
-#define GL_MITER_REVERT_NV 0x90A7
-#define GL_MITER_TRUNCATE_NV 0x90A8
-#define GL_SKIP_MISSING_GLYPH_NV 0x90A9
-#define GL_USE_MISSING_GLYPH_NV 0x90AA
-#define GL_PATH_ERROR_POSITION_NV 0x90AB
-#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD
-#define GL_ADJACENT_PAIRS_NV 0x90AE
-#define GL_FIRST_TO_REST_NV 0x90AF
-#define GL_PATH_GEN_MODE_NV 0x90B0
-#define GL_PATH_GEN_COEFF_NV 0x90B1
-#define GL_PATH_GEN_COMPONENTS_NV 0x90B3
-#define GL_PATH_STENCIL_FUNC_NV 0x90B7
-#define GL_PATH_STENCIL_REF_NV 0x90B8
-#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9
-#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
-#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
-#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF
-#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4
-#define GL_MOVE_TO_RESETS_NV 0x90B5
-#define GL_MOVE_TO_CONTINUES_NV 0x90B6
-#define GL_CLOSE_PATH_NV 0x00
-#define GL_MOVE_TO_NV 0x02
-#define GL_RELATIVE_MOVE_TO_NV 0x03
-#define GL_LINE_TO_NV 0x04
-#define GL_RELATIVE_LINE_TO_NV 0x05
-#define GL_HORIZONTAL_LINE_TO_NV 0x06
-#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
-#define GL_VERTICAL_LINE_TO_NV 0x08
-#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09
-#define GL_QUADRATIC_CURVE_TO_NV 0x0A
-#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
-#define GL_CUBIC_CURVE_TO_NV 0x0C
-#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D
-#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E
-#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
-#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10
-#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
-#define GL_SMALL_CCW_ARC_TO_NV 0x12
-#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13
-#define GL_SMALL_CW_ARC_TO_NV 0x14
-#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15
-#define GL_LARGE_CCW_ARC_TO_NV 0x16
-#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17
-#define GL_LARGE_CW_ARC_TO_NV 0x18
-#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19
-#define GL_RESTART_PATH_NV 0xF0
-#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2
-#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4
-#define GL_RECT_NV 0xF6
-#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8
-#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA
-#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC
-#define GL_ARC_TO_NV 0xFE
-#define GL_RELATIVE_ARC_TO_NV 0xFF
-#define GL_BOLD_BIT_NV 0x01
-#define GL_ITALIC_BIT_NV 0x02
-#define GL_GLYPH_WIDTH_BIT_NV 0x01
-#define GL_GLYPH_HEIGHT_BIT_NV 0x02
-#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
-#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
-#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
-#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
-#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
-#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
-#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100
-#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000
-#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000
-#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000
-#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000
-#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000
-#define GL_FONT_ASCENDER_BIT_NV 0x00200000
-#define GL_FONT_DESCENDER_BIT_NV 0x00400000
-#define GL_FONT_HEIGHT_BIT_NV 0x00800000
-#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000
-#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000
-#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000
-#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000
-#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000
-#define GL_ROUNDED_RECT_NV 0xE8
-#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9
-#define GL_ROUNDED_RECT2_NV 0xEA
-#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB
-#define GL_ROUNDED_RECT4_NV 0xEC
-#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED
-#define GL_ROUNDED_RECT8_NV 0xEE
-#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF
-#define GL_RELATIVE_RECT_NV 0xF7
-#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368
-#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369
-#define GL_FONT_UNAVAILABLE_NV 0x936A
-#define GL_FONT_UNINTELLIGIBLE_NV 0x936B
-#define GL_CONIC_CURVE_TO_NV 0x1A
-#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B
-#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000
-#define GL_STANDARD_FONT_FORMAT_NV 0x936C
-#define GL_PATH_PROJECTION_NV 0x1701
-#define GL_PATH_MODELVIEW_NV 0x1700
-#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3
-#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6
-#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36
-#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3
-#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4
-#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7
-#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38
-#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4
-#define GL_FRAGMENT_INPUT_NV 0x936D
-typedef GLuint (GL_APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);
-typedef void (GL_APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
-typedef GLboolean (GL_APIENTRYP PFNGLISPATHNVPROC) (GLuint path);
-typedef void (GL_APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (GL_APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (GL_APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (GL_APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (GL_APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString);
-typedef void (GL_APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GL_APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GL_APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
-typedef void (GL_APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
-typedef void (GL_APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-typedef void (GL_APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
-typedef void (GL_APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
-typedef void (GL_APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
-typedef void (GL_APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);
-typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (GL_APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func);
-typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
-typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode);
-typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value);
-typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands);
-typedef void (GL_APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords);
-typedef void (GL_APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray);
-typedef void (GL_APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-typedef void (GL_APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
-typedef void (GL_APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
-typedef GLfloat (GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
-typedef GLboolean (GL_APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
-typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
-typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
-typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range);
-GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
-GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path);
-GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString);
-GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
-GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);
-GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);
-GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);
-GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
-GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func);
-GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);
-GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);
-GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);
-GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);
-GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);
-GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
-GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
-GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
-GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
-GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
-GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
-#endif
-#endif /* GL_NV_path_rendering */
-
-#ifndef GL_NV_path_rendering_shared_edge
-#define GL_NV_path_rendering_shared_edge 1
-#define GL_SHARED_EDGE_NV 0xC0
-#endif /* GL_NV_path_rendering_shared_edge */
-
-#ifndef GL_NV_polygon_mode
-#define GL_NV_polygon_mode 1
-#define GL_POLYGON_MODE_NV 0x0B40
-#define GL_POLYGON_OFFSET_POINT_NV 0x2A01
-#define GL_POLYGON_OFFSET_LINE_NV 0x2A02
-#define GL_POINT_NV 0x1B00
-#define GL_LINE_NV 0x1B01
-#define GL_FILL_NV 0x1B02
-typedef void (GL_APIENTRYP PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode);
-#endif
-#endif /* GL_NV_polygon_mode */
-
-#ifndef GL_NV_read_buffer
-#define GL_NV_read_buffer 1
-#define GL_READ_BUFFER_NV 0x0C02
-typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
-#endif
-#endif /* GL_NV_read_buffer */
-
-#ifndef GL_NV_read_buffer_front
-#define GL_NV_read_buffer_front 1
-#endif /* GL_NV_read_buffer_front */
-
-#ifndef GL_NV_read_depth
-#define GL_NV_read_depth 1
-#endif /* GL_NV_read_depth */
-
-#ifndef GL_NV_read_depth_stencil
-#define GL_NV_read_depth_stencil 1
-#endif /* GL_NV_read_depth_stencil */
-
-#ifndef GL_NV_read_stencil
-#define GL_NV_read_stencil 1
-#endif /* GL_NV_read_stencil */
-
-#ifndef GL_NV_sRGB_formats
-#define GL_NV_sRGB_formats 1
-#define GL_SLUMINANCE_NV 0x8C46
-#define GL_SLUMINANCE_ALPHA_NV 0x8C44
-#define GL_SRGB8_NV 0x8C41
-#define GL_SLUMINANCE8_NV 0x8C47
-#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F
-#define GL_ETC1_SRGB8_NV 0x88EE
-#endif /* GL_NV_sRGB_formats */
-
-#ifndef GL_NV_sample_locations
-#define GL_NV_sample_locations 1
-#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D
-#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E
-#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F
-#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340
-#define GL_SAMPLE_LOCATION_NV 0x8E50
-#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341
-#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342
-#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void);
-#endif
-#endif /* GL_NV_sample_locations */
-
-#ifndef GL_NV_sample_mask_override_coverage
-#define GL_NV_sample_mask_override_coverage 1
-#endif /* GL_NV_sample_mask_override_coverage */
-
-#ifndef GL_NV_shader_noperspective_interpolation
-#define GL_NV_shader_noperspective_interpolation 1
-#endif /* GL_NV_shader_noperspective_interpolation */
-
-#ifndef GL_NV_shadow_samplers_array
-#define GL_NV_shadow_samplers_array 1
-#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4
-#endif /* GL_NV_shadow_samplers_array */
-
-#ifndef GL_NV_shadow_samplers_cube
-#define GL_NV_shadow_samplers_cube 1
-#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5
-#endif /* GL_NV_shadow_samplers_cube */
-
-#ifndef GL_NV_texture_border_clamp
-#define GL_NV_texture_border_clamp 1
-#define GL_TEXTURE_BORDER_COLOR_NV 0x1004
-#define GL_CLAMP_TO_BORDER_NV 0x812D
-#endif /* GL_NV_texture_border_clamp */
-
-#ifndef GL_NV_texture_compression_s3tc_update
-#define GL_NV_texture_compression_s3tc_update 1
-#endif /* GL_NV_texture_compression_s3tc_update */
-
-#ifndef GL_NV_texture_npot_2D_mipmap
-#define GL_NV_texture_npot_2D_mipmap 1
-#endif /* GL_NV_texture_npot_2D_mipmap */
-
-#ifndef GL_NV_viewport_array
-#define GL_NV_viewport_array 1
-#define GL_MAX_VIEWPORTS_NV 0x825B
-#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C
-#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D
-#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F
-typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v);
-typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint *v);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f);
-typedef void (GL_APIENTRYP PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (GL_APIENTRYP PFNGLENABLEINVPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLDISABLEINVPROC) (GLenum target, GLuint index);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDINVPROC) (GLenum target, GLuint index);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-GL_APICALL void GL_APIENTRY glViewportIndexedfvNV (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glScissorArrayvNV (GLuint first, GLsizei count, const GLint *v);
-GL_APICALL void GL_APIENTRY glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glScissorIndexedvNV (GLuint index, const GLint *v);
-GL_APICALL void GL_APIENTRY glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f);
-GL_APICALL void GL_APIENTRY glGetFloati_vNV (GLenum target, GLuint index, GLfloat *data);
-GL_APICALL void GL_APIENTRY glEnableiNV (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glDisableiNV (GLenum target, GLuint index);
-GL_APICALL GLboolean GL_APIENTRY glIsEnablediNV (GLenum target, GLuint index);
-#endif
-#endif /* GL_NV_viewport_array */
-
-#ifndef GL_NV_viewport_array2
-#define GL_NV_viewport_array2 1
-#endif /* GL_NV_viewport_array2 */
-
-#ifndef GL_OVR_multiview
-#define GL_OVR_multiview 1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632
-#define GL_MAX_VIEWS_OVR 0x9631
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
-#endif
-#endif /* GL_OVR_multiview */
-
-#ifndef GL_OVR_multiview2
-#define GL_OVR_multiview2 1
-#endif /* GL_OVR_multiview2 */
-
-#ifndef GL_OVR_multiview_multisampled_render_to_texture
-#define GL_OVR_multiview_multisampled_render_to_texture 1
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews);
-#endif
-#endif /* GL_OVR_multiview_multisampled_render_to_texture */
-
-#ifndef GL_QCOM_alpha_test
-#define GL_QCOM_alpha_test 1
-#define GL_ALPHA_TEST_QCOM 0x0BC0
-#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
-#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
-typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
-#endif
-#endif /* GL_QCOM_alpha_test */
-
-#ifndef GL_QCOM_binning_control
-#define GL_QCOM_binning_control 1
-#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0
-#define GL_CPU_OPTIMIZED_QCOM 0x8FB1
-#define GL_GPU_OPTIMIZED_QCOM 0x8FB2
-#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3
-#endif /* GL_QCOM_binning_control */
-
-#ifndef GL_QCOM_driver_control
-#define GL_QCOM_driver_control 1
-typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
-typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
-typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
-GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
-GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
-GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
-#endif
-#endif /* GL_QCOM_driver_control */
-
-#ifndef GL_QCOM_extended_get
-#define GL_QCOM_extended_get 1
-#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
-#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
-#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
-#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
-#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
-#define GL_TEXTURE_TYPE_QCOM 0x8BD7
-#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
-#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
-#define GL_TEXTURE_TARGET_QCOM 0x8BDA
-#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
-#define GL_STATE_RESTORE 0x8BDC
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
-typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
-typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
-GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
-GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
-GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
-GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
-GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params);
-#endif
-#endif /* GL_QCOM_extended_get */
-
-#ifndef GL_QCOM_extended_get2
-#define GL_QCOM_extended_get2 1
-typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
-typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
-GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
-GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
-GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
-#endif
-#endif /* GL_QCOM_extended_get2 */
-
-#ifndef GL_QCOM_perfmon_global_mode
-#define GL_QCOM_perfmon_global_mode 1
-#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
-#endif /* GL_QCOM_perfmon_global_mode */
-
-#ifndef GL_QCOM_tiled_rendering
-#define GL_QCOM_tiled_rendering 1
-#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
-#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
-#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
-#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
-#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
-#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
-#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
-#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
-#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
-#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
-#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
-#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
-#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
-#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
-#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
-#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
-#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
-#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
-#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
-#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
-#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
-#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
-#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
-#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
-#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
-#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
-#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
-#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
-#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
-#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
-#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
-#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
-typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
-#endif
-#endif /* GL_QCOM_tiled_rendering */
-
-#ifndef GL_QCOM_writeonly_rendering
-#define GL_QCOM_writeonly_rendering 1
-#define GL_WRITEONLY_RENDERING_QCOM 0x8823
-#endif /* GL_QCOM_writeonly_rendering */
-
-#ifndef GL_VIV_shader_binary
-#define GL_VIV_shader_binary 1
-#define GL_SHADER_BINARY_VIV 0x8FC4
-#endif /* GL_VIV_shader_binary */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2platform.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2platform.h
deleted file mode 100644
index 89d4d44d..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES2/gl2platform.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __gl2platform_h_
-#define __gl2platform_h_
-
-/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
- *
- * Adopters may modify khrplatform.h and this file to suit their platform.
- * You are encouraged to submit all modifications to the Khronos group so that
- * they can be included in future versions of this file. Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "OpenGL-ES" component "Registry".
- */
-
-#include <KHR/khrplatform.h>
-
-#ifndef GL_APICALL
-#define GL_APICALL KHRONOS_APICALL
-#endif
-
-#ifndef GL_APIENTRY
-#define GL_APIENTRY KHRONOS_APIENTRY
-#endif
-
-#endif /* __gl2platform_h_ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3.h
deleted file mode 100644
index d51d2e65..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3.h
+++ /dev/null
@@ -1,1213 +0,0 @@
-#ifndef __gl3_h_
-#define __gl3_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2015 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-**
-** Khronos $Revision: 32120 $ on $Date: 2015-10-15 04:27:13 -0700 (Thu, 15 Oct 2015) $
-*/
-
-#include <GLES3/gl3platform.h>
-
-#ifndef GL_APIENTRYP
-#define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-#if !defined(GL_GLES_PROTOTYPES)
-#define GL_GLES_PROTOTYPES 1
-#endif
-
-/* Generated on date 20151015 */
-
-/* Generated C header for:
- * API: gles2
- * Profile: common
- * Versions considered: 2\.[0-9]|3\.0
- * Versions emitted: .*
- * Default extensions included: None
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
-
-#ifndef GL_ES_VERSION_2_0
-#define GL_ES_VERSION_2_0 1
-#include <KHR/khrplatform.h>
-typedef khronos_int8_t GLbyte;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-typedef short GLshort;
-typedef unsigned short GLushort;
-typedef void GLvoid;
-typedef struct __GLsync *GLsync;
-typedef khronos_int64_t GLint64;
-typedef khronos_uint64_t GLuint64;
-typedef unsigned int GLenum;
-typedef unsigned int GLuint;
-typedef char GLchar;
-typedef khronos_float_t GLfloat;
-typedef khronos_ssize_t GLsizeiptr;
-typedef khronos_intptr_t GLintptr;
-typedef unsigned int GLbitfield;
-typedef int GLint;
-typedef unsigned char GLboolean;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_FALSE 0
-#define GL_TRUE 1
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_FUNC_ADD 0x8006
-#define GL_BLEND_EQUATION 0x8009
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STATIC_DRAW 0x88E4
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_BLEND 0x0BE2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_LINE_WIDTH 0x0B21
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_DELETE_STATUS 0x8B80
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_INVERT 0x150A
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TEXTURE 0x1702
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGB565 0x8D62
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_NONE 0
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
-typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
-typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
-typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
-typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
-typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
-typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
-typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
-typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
-typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
-typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
-typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
-typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
-GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
-GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
-GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
-GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
-GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
-GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
-GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
-GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glFinish (void);
-GL_APICALL void GL_APIENTRY glFlush (void);
-GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL GLenum GL_APIENTRY glGetError (void);
-GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
-GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
-GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
-GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
-GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
-GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
-GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
-GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
-GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_ES_VERSION_2_0 */
-
-#ifndef GL_ES_VERSION_3_0
-#define GL_ES_VERSION_3_0 1
-typedef unsigned short GLhalf;
-#define GL_READ_BUFFER 0x0C02
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_RED 0x1903
-#define GL_RGB8 0x8051
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_COMPARE_REF_TO_TEXTURE 0x884E
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_MAX_VARYING_COMPONENTS 0x8B4B
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_COLOR_ATTACHMENT16 0x8CF0
-#define GL_COLOR_ATTACHMENT17 0x8CF1
-#define GL_COLOR_ATTACHMENT18 0x8CF2
-#define GL_COLOR_ATTACHMENT19 0x8CF3
-#define GL_COLOR_ATTACHMENT20 0x8CF4
-#define GL_COLOR_ATTACHMENT21 0x8CF5
-#define GL_COLOR_ATTACHMENT22 0x8CF6
-#define GL_COLOR_ATTACHMENT23 0x8CF7
-#define GL_COLOR_ATTACHMENT24 0x8CF8
-#define GL_COLOR_ATTACHMENT25 0x8CF9
-#define GL_COLOR_ATTACHMENT26 0x8CFA
-#define GL_COLOR_ATTACHMENT27 0x8CFB
-#define GL_COLOR_ATTACHMENT28 0x8CFC
-#define GL_COLOR_ATTACHMENT29 0x8CFD
-#define GL_COLOR_ATTACHMENT30 0x8CFE
-#define GL_COLOR_ATTACHMENT31 0x8CFF
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-#define GL_HALF_FLOAT 0x140B
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_RG8 0x822B
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
-#define GL_COPY_READ_BUFFER_BINDING 0x8F36
-#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFFu
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
-#define GL_SAMPLER_BINDING 0x8919
-#define GL_RGB10_A2UI 0x906F
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_INT_2_10_10_10_REV 0x8D9F
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-#define GL_COMPRESSED_R11_EAC 0x9270
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-#define GL_MAX_ELEMENT_INDEX 0x8D6B
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-typedef void (GL_APIENTRYP PFNGLREADBUFFERPROC) (GLenum src);
-typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (GL_APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (GL_APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-typedef void (GL_APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef GLuint (GL_APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (GL_APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (GL_APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
-typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-typedef void (GL_APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src);
-GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
-GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
-GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
-GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
-GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
-GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
-GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
-GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
-GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
-GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
-GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#endif
-#endif /* GL_ES_VERSION_3_0 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl31.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl31.h
deleted file mode 100644
index 9b89a0ac..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl31.h
+++ /dev/null
@@ -1,1528 +0,0 @@
-#ifndef __gl31_h_
-#define __gl31_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2015 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-**
-** Khronos $Revision$ on $Date$
-*/
-
-#include <GLES3/gl3platform.h>
-
-#ifndef GL_APIENTRYP
-#define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-#if !defined(GL_GLES_PROTOTYPES)
-#define GL_GLES_PROTOTYPES 1
-#endif
-
-/* Generated on date 20151015 */
-
-/* Generated C header for:
- * API: gles2
- * Profile: common
- * Versions considered: 2\.[0-9]|3\.[01]
- * Versions emitted: .*
- * Default extensions included: None
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
-
-#ifndef GL_ES_VERSION_2_0
-#define GL_ES_VERSION_2_0 1
-#include <KHR/khrplatform.h>
-typedef khronos_int8_t GLbyte;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-typedef short GLshort;
-typedef unsigned short GLushort;
-typedef void GLvoid;
-typedef struct __GLsync *GLsync;
-typedef khronos_int64_t GLint64;
-typedef khronos_uint64_t GLuint64;
-typedef unsigned int GLenum;
-typedef unsigned int GLuint;
-typedef char GLchar;
-typedef khronos_float_t GLfloat;
-typedef khronos_ssize_t GLsizeiptr;
-typedef khronos_intptr_t GLintptr;
-typedef unsigned int GLbitfield;
-typedef int GLint;
-typedef unsigned char GLboolean;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_FALSE 0
-#define GL_TRUE 1
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_FUNC_ADD 0x8006
-#define GL_BLEND_EQUATION 0x8009
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STATIC_DRAW 0x88E4
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_BLEND 0x0BE2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_LINE_WIDTH 0x0B21
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_DELETE_STATUS 0x8B80
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_INVERT 0x150A
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TEXTURE 0x1702
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGB565 0x8D62
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_NONE 0
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
-typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
-typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
-typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
-typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
-typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
-typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
-typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
-typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
-typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
-typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
-typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
-typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
-GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
-GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
-GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
-GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
-GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
-GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
-GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
-GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glFinish (void);
-GL_APICALL void GL_APIENTRY glFlush (void);
-GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL GLenum GL_APIENTRY glGetError (void);
-GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
-GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
-GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
-GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
-GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
-GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
-GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
-GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
-GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_ES_VERSION_2_0 */
-
-#ifndef GL_ES_VERSION_3_0
-#define GL_ES_VERSION_3_0 1
-typedef unsigned short GLhalf;
-#define GL_READ_BUFFER 0x0C02
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_RED 0x1903
-#define GL_RGB8 0x8051
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_COMPARE_REF_TO_TEXTURE 0x884E
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_MAX_VARYING_COMPONENTS 0x8B4B
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_COLOR_ATTACHMENT16 0x8CF0
-#define GL_COLOR_ATTACHMENT17 0x8CF1
-#define GL_COLOR_ATTACHMENT18 0x8CF2
-#define GL_COLOR_ATTACHMENT19 0x8CF3
-#define GL_COLOR_ATTACHMENT20 0x8CF4
-#define GL_COLOR_ATTACHMENT21 0x8CF5
-#define GL_COLOR_ATTACHMENT22 0x8CF6
-#define GL_COLOR_ATTACHMENT23 0x8CF7
-#define GL_COLOR_ATTACHMENT24 0x8CF8
-#define GL_COLOR_ATTACHMENT25 0x8CF9
-#define GL_COLOR_ATTACHMENT26 0x8CFA
-#define GL_COLOR_ATTACHMENT27 0x8CFB
-#define GL_COLOR_ATTACHMENT28 0x8CFC
-#define GL_COLOR_ATTACHMENT29 0x8CFD
-#define GL_COLOR_ATTACHMENT30 0x8CFE
-#define GL_COLOR_ATTACHMENT31 0x8CFF
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-#define GL_HALF_FLOAT 0x140B
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_RG8 0x822B
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
-#define GL_COPY_READ_BUFFER_BINDING 0x8F36
-#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFFu
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
-#define GL_SAMPLER_BINDING 0x8919
-#define GL_RGB10_A2UI 0x906F
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_INT_2_10_10_10_REV 0x8D9F
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-#define GL_COMPRESSED_R11_EAC 0x9270
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-#define GL_MAX_ELEMENT_INDEX 0x8D6B
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-typedef void (GL_APIENTRYP PFNGLREADBUFFERPROC) (GLenum src);
-typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (GL_APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (GL_APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-typedef void (GL_APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef GLuint (GL_APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (GL_APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (GL_APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
-typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-typedef void (GL_APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src);
-GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
-GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
-GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
-GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
-GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
-GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
-GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
-GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
-GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
-GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
-GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#endif
-#endif /* GL_ES_VERSION_3_0 */
-
-#ifndef GL_ES_VERSION_3_1
-#define GL_ES_VERSION_3_1 1
-#define GL_COMPUTE_SHADER 0x91B9
-#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB
-#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
-#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD
-#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
-#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
-#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
-#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265
-#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
-#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
-#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
-#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
-#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267
-#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
-#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
-#define GL_COMPUTE_SHADER_BIT 0x00000020
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-#define GL_MAX_UNIFORM_LOCATIONS 0x826E
-#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
-#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
-#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
-#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
-#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315
-#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316
-#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
-#define GL_UNIFORM 0x92E1
-#define GL_UNIFORM_BLOCK 0x92E2
-#define GL_PROGRAM_INPUT 0x92E3
-#define GL_PROGRAM_OUTPUT 0x92E4
-#define GL_BUFFER_VARIABLE 0x92E5
-#define GL_SHADER_STORAGE_BLOCK 0x92E6
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
-#define GL_ACTIVE_RESOURCES 0x92F5
-#define GL_MAX_NAME_LENGTH 0x92F6
-#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
-#define GL_NAME_LENGTH 0x92F9
-#define GL_TYPE 0x92FA
-#define GL_ARRAY_SIZE 0x92FB
-#define GL_OFFSET 0x92FC
-#define GL_BLOCK_INDEX 0x92FD
-#define GL_ARRAY_STRIDE 0x92FE
-#define GL_MATRIX_STRIDE 0x92FF
-#define GL_IS_ROW_MAJOR 0x9300
-#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
-#define GL_BUFFER_BINDING 0x9302
-#define GL_BUFFER_DATA_SIZE 0x9303
-#define GL_NUM_ACTIVE_VARIABLES 0x9304
-#define GL_ACTIVE_VARIABLES 0x9305
-#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
-#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
-#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
-#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
-#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
-#define GL_LOCATION 0x930E
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
-#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
-#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
-#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
-#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
-#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
-#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
-#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#define GL_MAX_IMAGE_UNITS 0x8F38
-#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
-#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
-#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
-#define GL_IMAGE_BINDING_NAME 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED 0x8F3C
-#define GL_IMAGE_BINDING_LAYER 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS 0x8F3E
-#define GL_IMAGE_BINDING_FORMAT 0x906E
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-#define GL_IMAGE_2D 0x904D
-#define GL_IMAGE_3D 0x904E
-#define GL_IMAGE_CUBE 0x9050
-#define GL_IMAGE_2D_ARRAY 0x9053
-#define GL_INT_IMAGE_2D 0x9058
-#define GL_INT_IMAGE_3D 0x9059
-#define GL_INT_IMAGE_CUBE 0x905B
-#define GL_INT_IMAGE_2D_ARRAY 0x905E
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
-#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
-#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
-#define GL_SHADER_STORAGE_BUFFER_START 0x90D4
-#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
-#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
-#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
-#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
-#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
-#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
-#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
-#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
-#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
-#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
-#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
-#define GL_STENCIL_INDEX 0x1901
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
-#define GL_MAX_INTEGER_SAMPLES 0x9110
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_VERTEX_ATTRIB_BINDING 0x82D4
-#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
-#define GL_VERTEX_BINDING_DIVISOR 0x82D6
-#define GL_VERTEX_BINDING_OFFSET 0x82D7
-#define GL_VERTEX_BINDING_STRIDE 0x82D8
-#define GL_VERTEX_BINDING_BUFFER 0x8F4F
-#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
-#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
-#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
-typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-typedef GLuint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
-typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-typedef void (GL_APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
-typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (GL_APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
-typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC) (GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
-typedef void (GL_APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-GL_APICALL void GL_APIENTRY glDispatchComputeIndirect (GLintptr indirect);
-GL_APICALL void GL_APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
-GL_APICALL void GL_APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
-GL_APICALL void GL_APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-GL_APICALL GLuint GL_APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL void GL_APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GL_APICALL void GL_APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
-GL_APICALL void GL_APIENTRY glBindProgramPipeline (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GL_APICALL GLboolean GL_APIENTRY glIsProgramPipeline (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glValidateProgramPipeline (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-GL_APICALL void GL_APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
-GL_APICALL void GL_APIENTRY glMemoryBarrier (GLbitfield barriers);
-GL_APICALL void GL_APIENTRY glMemoryBarrierByRegion (GLbitfield barriers);
-GL_APICALL void GL_APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GL_APICALL void GL_APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
-GL_APICALL void GL_APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
-GL_APICALL void GL_APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-GL_APICALL void GL_APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-GL_APICALL void GL_APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GL_APICALL void GL_APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
-GL_APICALL void GL_APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
-#endif
-#endif /* GL_ES_VERSION_3_1 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl32.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl32.h
deleted file mode 100644
index a2c36119..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl32.h
+++ /dev/null
@@ -1,1829 +0,0 @@
-#ifndef __gl32_h_
-#define __gl32_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2015 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-**
-** Khronos $Revision$ on $Date$
-*/
-
-#include <GLES3/gl3platform.h>
-
-#ifndef GL_APIENTRYP
-#define GL_APIENTRYP GL_APIENTRY*
-#endif
-
-#if !defined(GL_GLES_PROTOTYPES)
-#define GL_GLES_PROTOTYPES 1
-#endif
-
-/* Generated on date 20151015 */
-
-/* Generated C header for:
- * API: gles2
- * Profile: common
- * Versions considered: 2\.[0-9]|3\.[012]
- * Versions emitted: .*
- * Default extensions included: None
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
-
-#ifndef GL_ES_VERSION_2_0
-#define GL_ES_VERSION_2_0 1
-#include <KHR/khrplatform.h>
-typedef khronos_int8_t GLbyte;
-typedef khronos_float_t GLclampf;
-typedef khronos_int32_t GLfixed;
-typedef short GLshort;
-typedef unsigned short GLushort;
-typedef void GLvoid;
-typedef struct __GLsync *GLsync;
-typedef khronos_int64_t GLint64;
-typedef khronos_uint64_t GLuint64;
-typedef unsigned int GLenum;
-typedef unsigned int GLuint;
-typedef char GLchar;
-typedef khronos_float_t GLfloat;
-typedef khronos_ssize_t GLsizeiptr;
-typedef khronos_intptr_t GLintptr;
-typedef unsigned int GLbitfield;
-typedef int GLint;
-typedef unsigned char GLboolean;
-typedef int GLsizei;
-typedef khronos_uint8_t GLubyte;
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_FALSE 0
-#define GL_TRUE 1
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_FUNC_ADD 0x8006
-#define GL_BLEND_EQUATION 0x8009
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STATIC_DRAW 0x88E4
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_CULL_FACE 0x0B44
-#define GL_BLEND 0x0BE2
-#define GL_DITHER 0x0BD0
-#define GL_STENCIL_TEST 0x0B90
-#define GL_DEPTH_TEST 0x0B71
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_LINE_WIDTH 0x0B21
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_FIXED 0x140C
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_DELETE_STATUS 0x8B80
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_INVERT 0x150A
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TEXTURE 0x1702
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_REPEAT 0x2901
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGB565 0x8D62
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_NONE 0
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
-typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
-typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
-typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
-typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
-typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
-typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
-typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
-typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
-typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
-typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
-typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
-typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
-typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
-typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
-typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
-typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
-GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
-GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
-GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
-GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
-GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
-GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
-GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
-GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glFinish (void);
-GL_APICALL void GL_APIENTRY glFlush (void);
-GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
-GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL GLenum GL_APIENTRY glGetError (void);
-GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
-GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
-GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
-GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
-GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
-GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
-GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
-GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
-GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
-GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_ES_VERSION_2_0 */
-
-#ifndef GL_ES_VERSION_3_0
-#define GL_ES_VERSION_3_0 1
-typedef unsigned short GLhalf;
-#define GL_READ_BUFFER 0x0C02
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_RED 0x1903
-#define GL_RGB8 0x8051
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_COMPARE_REF_TO_TEXTURE 0x884E
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_MAX_VARYING_COMPONENTS 0x8B4B
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_COLOR_ATTACHMENT16 0x8CF0
-#define GL_COLOR_ATTACHMENT17 0x8CF1
-#define GL_COLOR_ATTACHMENT18 0x8CF2
-#define GL_COLOR_ATTACHMENT19 0x8CF3
-#define GL_COLOR_ATTACHMENT20 0x8CF4
-#define GL_COLOR_ATTACHMENT21 0x8CF5
-#define GL_COLOR_ATTACHMENT22 0x8CF6
-#define GL_COLOR_ATTACHMENT23 0x8CF7
-#define GL_COLOR_ATTACHMENT24 0x8CF8
-#define GL_COLOR_ATTACHMENT25 0x8CF9
-#define GL_COLOR_ATTACHMENT26 0x8CFA
-#define GL_COLOR_ATTACHMENT27 0x8CFB
-#define GL_COLOR_ATTACHMENT28 0x8CFC
-#define GL_COLOR_ATTACHMENT29 0x8CFD
-#define GL_COLOR_ATTACHMENT30 0x8CFE
-#define GL_COLOR_ATTACHMENT31 0x8CFF
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-#define GL_HALF_FLOAT 0x140B
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_RG8 0x822B
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
-#define GL_COPY_READ_BUFFER_BINDING 0x8F36
-#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFFu
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
-#define GL_SAMPLER_BINDING 0x8919
-#define GL_RGB10_A2UI 0x906F
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_INT_2_10_10_10_REV 0x8D9F
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-#define GL_COMPRESSED_R11_EAC 0x9270
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-#define GL_MAX_ELEMENT_INDEX 0x8D6B
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-typedef void (GL_APIENTRYP PFNGLREADBUFFERPROC) (GLenum src);
-typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (GL_APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
-typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (GL_APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (GL_APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-typedef void (GL_APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GL_APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef GLuint (GL_APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (GL_APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (GL_APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
-typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-typedef void (GL_APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (GL_APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (GL_APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (GL_APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (GL_APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src);
-GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
-GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
-GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
-GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
-GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
-GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
-GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
-GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
-GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
-GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
-GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
-GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#endif
-#endif /* GL_ES_VERSION_3_0 */
-
-#ifndef GL_ES_VERSION_3_1
-#define GL_ES_VERSION_3_1 1
-#define GL_COMPUTE_SHADER 0x91B9
-#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB
-#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
-#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD
-#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
-#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
-#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
-#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265
-#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
-#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
-#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
-#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
-#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267
-#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
-#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
-#define GL_COMPUTE_SHADER_BIT 0x00000020
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-#define GL_MAX_UNIFORM_LOCATIONS 0x826E
-#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
-#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
-#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
-#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
-#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315
-#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316
-#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
-#define GL_UNIFORM 0x92E1
-#define GL_UNIFORM_BLOCK 0x92E2
-#define GL_PROGRAM_INPUT 0x92E3
-#define GL_PROGRAM_OUTPUT 0x92E4
-#define GL_BUFFER_VARIABLE 0x92E5
-#define GL_SHADER_STORAGE_BLOCK 0x92E6
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
-#define GL_ACTIVE_RESOURCES 0x92F5
-#define GL_MAX_NAME_LENGTH 0x92F6
-#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
-#define GL_NAME_LENGTH 0x92F9
-#define GL_TYPE 0x92FA
-#define GL_ARRAY_SIZE 0x92FB
-#define GL_OFFSET 0x92FC
-#define GL_BLOCK_INDEX 0x92FD
-#define GL_ARRAY_STRIDE 0x92FE
-#define GL_MATRIX_STRIDE 0x92FF
-#define GL_IS_ROW_MAJOR 0x9300
-#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
-#define GL_BUFFER_BINDING 0x9302
-#define GL_BUFFER_DATA_SIZE 0x9303
-#define GL_NUM_ACTIVE_VARIABLES 0x9304
-#define GL_ACTIVE_VARIABLES 0x9305
-#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
-#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
-#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
-#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
-#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
-#define GL_LOCATION 0x930E
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
-#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
-#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
-#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
-#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
-#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
-#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
-#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#define GL_MAX_IMAGE_UNITS 0x8F38
-#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
-#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
-#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
-#define GL_IMAGE_BINDING_NAME 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED 0x8F3C
-#define GL_IMAGE_BINDING_LAYER 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS 0x8F3E
-#define GL_IMAGE_BINDING_FORMAT 0x906E
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-#define GL_IMAGE_2D 0x904D
-#define GL_IMAGE_3D 0x904E
-#define GL_IMAGE_CUBE 0x9050
-#define GL_IMAGE_2D_ARRAY 0x9053
-#define GL_INT_IMAGE_2D 0x9058
-#define GL_INT_IMAGE_3D 0x9059
-#define GL_INT_IMAGE_CUBE 0x905B
-#define GL_INT_IMAGE_2D_ARRAY 0x905E
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
-#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
-#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
-#define GL_SHADER_STORAGE_BUFFER_START 0x90D4
-#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
-#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
-#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
-#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
-#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
-#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
-#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
-#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
-#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
-#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
-#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
-#define GL_STENCIL_INDEX 0x1901
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
-#define GL_MAX_INTEGER_SAMPLES 0x9110
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_VERTEX_ATTRIB_BINDING 0x82D4
-#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
-#define GL_VERTEX_BINDING_DIVISOR 0x82D6
-#define GL_VERTEX_BINDING_OFFSET 0x82D7
-#define GL_VERTEX_BINDING_STRIDE 0x82D8
-#define GL_VERTEX_BINDING_BUFFER 0x8F4F
-#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
-#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
-#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
-typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
-typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-typedef GLuint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
-typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (GL_APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-typedef void (GL_APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
-typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (GL_APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
-typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC) (GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
-typedef void (GL_APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-GL_APICALL void GL_APIENTRY glDispatchComputeIndirect (GLintptr indirect);
-GL_APICALL void GL_APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
-GL_APICALL void GL_APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
-GL_APICALL void GL_APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void GL_APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-GL_APICALL GLuint GL_APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-GL_APICALL void GL_APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL void GL_APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GL_APICALL void GL_APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
-GL_APICALL void GL_APIENTRY glBindProgramPipeline (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GL_APICALL GLboolean GL_APIENTRY glIsProgramPipeline (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glValidateProgramPipeline (GLuint pipeline);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-GL_APICALL void GL_APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
-GL_APICALL void GL_APIENTRY glMemoryBarrier (GLbitfield barriers);
-GL_APICALL void GL_APIENTRY glMemoryBarrierByRegion (GLbitfield barriers);
-GL_APICALL void GL_APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GL_APICALL void GL_APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
-GL_APICALL void GL_APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
-GL_APICALL void GL_APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
-GL_APICALL void GL_APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-GL_APICALL void GL_APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-GL_APICALL void GL_APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GL_APICALL void GL_APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
-GL_APICALL void GL_APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
-#endif
-#endif /* GL_ES_VERSION_3_1 */
-
-#ifndef GL_ES_VERSION_3_2
-#define GL_ES_VERSION_3_2 1
-typedef void (GL_APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
-#define GL_MULTISAMPLE_LINE_WIDTH_RANGE 0x9381
-#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY 0x9382
-#define GL_MULTIPLY 0x9294
-#define GL_SCREEN 0x9295
-#define GL_OVERLAY 0x9296
-#define GL_DARKEN 0x9297
-#define GL_LIGHTEN 0x9298
-#define GL_COLORDODGE 0x9299
-#define GL_COLORBURN 0x929A
-#define GL_HARDLIGHT 0x929B
-#define GL_SOFTLIGHT 0x929C
-#define GL_DIFFERENCE 0x929E
-#define GL_EXCLUSION 0x92A0
-#define GL_HSL_HUE 0x92AD
-#define GL_HSL_SATURATION 0x92AE
-#define GL_HSL_COLOR 0x92AF
-#define GL_HSL_LUMINOSITY 0x92B0
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
-#define GL_DEBUG_SOURCE_API 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION 0x824A
-#define GL_DEBUG_SOURCE_OTHER 0x824B
-#define GL_DEBUG_TYPE_ERROR 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
-#define GL_DEBUG_TYPE_OTHER 0x8251
-#define GL_DEBUG_TYPE_MARKER 0x8268
-#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
-#define GL_DEBUG_TYPE_POP_GROUP 0x826A
-#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
-#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
-#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
-#define GL_BUFFER 0x82E0
-#define GL_SHADER 0x82E1
-#define GL_PROGRAM 0x82E2
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_QUERY 0x82E3
-#define GL_PROGRAM_PIPELINE 0x82E4
-#define GL_SAMPLER 0x82E6
-#define GL_MAX_LABEL_LENGTH 0x82E8
-#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES 0x9145
-#define GL_DEBUG_SEVERITY_HIGH 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
-#define GL_DEBUG_SEVERITY_LOW 0x9148
-#define GL_DEBUG_OUTPUT 0x92E0
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_GEOMETRY_SHADER 0x8DD9
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#define GL_GEOMETRY_VERTICES_OUT 0x8916
-#define GL_GEOMETRY_INPUT_TYPE 0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
-#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
-#define GL_LAYER_PROVOKING_VERTEX 0x825E
-#define GL_LINES_ADJACENCY 0x000A
-#define GL_LINE_STRIP_ADJACENCY 0x000B
-#define GL_TRIANGLES_ADJACENCY 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
-#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_UNDEFINED_VERTEX 0x8260
-#define GL_PRIMITIVES_GENERATED 0x8C87
-#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312
-#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
-#define GL_PRIMITIVE_BOUNDING_BOX 0x92BE
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
-#define GL_CONTEXT_FLAGS 0x821E
-#define GL_LOSE_CONTEXT_ON_RESET 0x8252
-#define GL_GUILTY_CONTEXT_RESET 0x8253
-#define GL_INNOCENT_CONTEXT_RESET 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY 0x8256
-#define GL_NO_RESET_NOTIFICATION 0x8261
-#define GL_CONTEXT_LOST 0x0507
-#define GL_SAMPLE_SHADING 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-#define GL_PATCHES 0x000E
-#define GL_PATCH_VERTICES 0x8E72
-#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
-#define GL_TESS_GEN_MODE 0x8E76
-#define GL_TESS_GEN_SPACING 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
-#define GL_TESS_GEN_POINT_MODE 0x8E79
-#define GL_ISOLINES 0x8E7A
-#define GL_QUADS 0x0007
-#define GL_FRACTIONAL_ODD 0x8E7B
-#define GL_FRACTIONAL_EVEN 0x8E7C
-#define GL_MAX_PATCH_VERTICES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
-#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
-#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
-#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
-#define GL_IS_PER_PATCH 0x92E7
-#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307
-#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
-#define GL_TESS_CONTROL_SHADER 0x8E88
-#define GL_TESS_EVALUATION_SHADER 0x8E87
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_TEXTURE_BUFFER 0x8C2A
-#define GL_TEXTURE_BUFFER_BINDING 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F
-#define GL_SAMPLER_BUFFER 0x8DC2
-#define GL_INT_SAMPLER_BUFFER 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
-#define GL_IMAGE_BUFFER 0x9051
-#define GL_INT_IMAGE_BUFFER 0x905C
-#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
-#define GL_TEXTURE_BUFFER_OFFSET 0x919D
-#define GL_TEXTURE_BUFFER_SIZE 0x919E
-#define GL_COMPRESSED_RGBA_ASTC_4x4 0x93B0
-#define GL_COMPRESSED_RGBA_ASTC_5x4 0x93B1
-#define GL_COMPRESSED_RGBA_ASTC_5x5 0x93B2
-#define GL_COMPRESSED_RGBA_ASTC_6x5 0x93B3
-#define GL_COMPRESSED_RGBA_ASTC_6x6 0x93B4
-#define GL_COMPRESSED_RGBA_ASTC_8x5 0x93B5
-#define GL_COMPRESSED_RGBA_ASTC_8x6 0x93B6
-#define GL_COMPRESSED_RGBA_ASTC_8x8 0x93B7
-#define GL_COMPRESSED_RGBA_ASTC_10x5 0x93B8
-#define GL_COMPRESSED_RGBA_ASTC_10x6 0x93B9
-#define GL_COMPRESSED_RGBA_ASTC_10x8 0x93BA
-#define GL_COMPRESSED_RGBA_ASTC_10x10 0x93BB
-#define GL_COMPRESSED_RGBA_ASTC_12x10 0x93BC
-#define GL_COMPRESSED_RGBA_ASTC_12x12 0x93BD
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4 0x93D0
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4 0x93D1
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5 0x93D2
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5 0x93D3
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6 0x93D4
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5 0x93D5
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6 0x93D6
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8 0x93D7
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5 0x93D8
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6 0x93D9
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8 0x93DA
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10 0x93DB
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10 0x93DC
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12 0x93DD
-#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-typedef void (GL_APIENTRYP PFNGLBLENDBARRIERPROC) (void);
-typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
-typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
-typedef void (GL_APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (GL_APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, void **params);
-typedef void (GL_APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GL_APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void);
-typedef void (GL_APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);
-typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
-typedef void (GL_APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-#if GL_GLES_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlendBarrier (void);
-GL_APICALL void GL_APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-GL_APICALL void GL_APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GL_APICALL void GL_APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GL_APICALL void GL_APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);
-GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-GL_APICALL void GL_APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-GL_APICALL void GL_APIENTRY glPopDebugGroup (void);
-GL_APICALL void GL_APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-GL_APICALL void GL_APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-GL_APICALL void GL_APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
-GL_APICALL void GL_APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-GL_APICALL void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
-GL_APICALL void GL_APIENTRY glEnablei (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glDisablei (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
-GL_APICALL void GL_APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GL_APICALL void GL_APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GL_APICALL GLboolean GL_APIENTRY glIsEnabledi (GLenum target, GLuint index);
-GL_APICALL void GL_APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glPrimitiveBoundingBox (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatus (void);
-GL_APICALL void GL_APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GL_APICALL void GL_APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GL_APICALL void GL_APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GL_APICALL void GL_APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-GL_APICALL void GL_APIENTRY glMinSampleShading (GLfloat value);
-GL_APICALL void GL_APIENTRY glPatchParameteri (GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
-GL_APICALL void GL_APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
-GL_APICALL void GL_APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
-GL_APICALL void GL_APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
-GL_APICALL void GL_APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GL_APICALL void GL_APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-#endif
-#endif /* GL_ES_VERSION_3_2 */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3ext.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3ext.h
deleted file mode 100644
index 4d4ea96c..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3ext.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __gl3ext_h_
-#define __gl3ext_h_
-
-/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-/* OpenGL ES 3 Extensions
- *
- * After an OES extension's interactions with OpenGl ES 3.0 have been documented,
- * its tokens and function definitions should be added to this file in a manner
- * that does not conflict with gl2ext.h or gl3.h.
- *
- * Tokens and function definitions for extensions that have become standard
- * features in OpenGL ES 3.0 will not be added to this file.
- *
- * Applications using OpenGL-ES-2-only extensions should include gl2ext.h
- */
-
-#endif /* __gl3ext_h_ */
-
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3platform.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3platform.h
deleted file mode 100644
index b1e869dd..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Android/jni/GLES3/gl3platform.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __gl3platform_h_
-#define __gl3platform_h_
-
-/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
-
-/*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
-
-/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
- *
- * Adopters may modify khrplatform.h and this file to suit their platform.
- * You are encouraged to submit all modifications to the Khronos group so that
- * they can be included in future versions of this file. Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "OpenGL-ES" component "Registry".
- */
-
-#include <KHR/khrplatform.h>
-
-#ifndef GL_APICALL
-#define GL_APICALL KHRONOS_APICALL
-#endif
-
-#ifndef GL_APIENTRY
-#define GL_APIENTRY KHRONOS_APIENTRY
-#endif
-
-#endif /* __gl3platform_h_ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/gl.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/gl.h
deleted file mode 100644
index 1d2cd0ad..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/gl.h
+++ /dev/null
@@ -1,1543 +0,0 @@
-/*
-** NOTE: This is a version of gl.h extracted from Visual C++ 7.1 checked in
-** to the source tree so Linux and Windows builds can use the same headers.
-** The only modification to the file is to define "WINGDIAPI" and "APIENTRY"
-** for non-Win32 builds.
-*/
-
-/*++ BUILD Version: 0004 // Increment this if a change has global effects
-
-Copyright (c) 1985-96, Microsoft Corporation
-
-Module Name:
-
- gl.h
-
-Abstract:
-
- Procedure declarations, constant definitions and macros for the OpenGL
- component.
-
---*/
-
-#ifndef __gl_h_
-#ifndef __GL_H__
-
-#define __gl_h_
-#define __GL_H__
-
-#if !defined (_WIN32)
-#define WINGDIAPI
-#define APIENTRY
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright 1996 Silicon Graphics, Inc.
-** All Rights Reserved.
-**
-** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
-** the contents of this file may not be disclosed to third parties, copied or
-** duplicated in any form, in whole or in part, without the prior written
-** permission of Silicon Graphics, Inc.
-**
-** RESTRICTED RIGHTS LEGEND:
-** Use, duplication or disclosure by the Government is subject to restrictions
-** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
-** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
-** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
-** rights reserved under the Copyright Laws of the United States.
-*/
-
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef signed char GLbyte;
-typedef short GLshort;
-typedef int GLint;
-typedef int GLsizei;
-typedef unsigned char GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned int GLuint;
-typedef float GLfloat;
-typedef float GLclampf;
-typedef double GLdouble;
-typedef double GLclampd;
-typedef void GLvoid;
-
-/*************************************************************/
-
-/* Version */
-#define GL_VERSION_1_1 1
-
-/* AccumOp */
-#define GL_ACCUM 0x0100
-#define GL_LOAD 0x0101
-#define GL_RETURN 0x0102
-#define GL_MULT 0x0103
-#define GL_ADD 0x0104
-
-/* AlphaFunction */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-
-/* AttribMask */
-#define GL_CURRENT_BIT 0x00000001
-#define GL_POINT_BIT 0x00000002
-#define GL_LINE_BIT 0x00000004
-#define GL_POLYGON_BIT 0x00000008
-#define GL_POLYGON_STIPPLE_BIT 0x00000010
-#define GL_PIXEL_MODE_BIT 0x00000020
-#define GL_LIGHTING_BIT 0x00000040
-#define GL_FOG_BIT 0x00000080
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_ACCUM_BUFFER_BIT 0x00000200
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_VIEWPORT_BIT 0x00000800
-#define GL_TRANSFORM_BIT 0x00001000
-#define GL_ENABLE_BIT 0x00002000
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_HINT_BIT 0x00008000
-#define GL_EVAL_BIT 0x00010000
-#define GL_LIST_BIT 0x00020000
-#define GL_TEXTURE_BIT 0x00040000
-#define GL_SCISSOR_BIT 0x00080000
-#define GL_ALL_ATTRIB_BITS 0x000fffff
-
-/* BeginMode */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_QUADS 0x0007
-#define GL_QUAD_STRIP 0x0008
-#define GL_POLYGON 0x0009
-
-/* BlendingFactorDest */
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-
-/* BlendingFactorSrc */
-/* GL_ZERO */
-/* GL_ONE */
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-/* GL_SRC_ALPHA */
-/* GL_ONE_MINUS_SRC_ALPHA */
-/* GL_DST_ALPHA */
-/* GL_ONE_MINUS_DST_ALPHA */
-
-/* Boolean */
-#define GL_TRUE 1
-#define GL_FALSE 0
-
-/* ClearBufferMask */
-/* GL_COLOR_BUFFER_BIT */
-/* GL_ACCUM_BUFFER_BIT */
-/* GL_STENCIL_BUFFER_BIT */
-/* GL_DEPTH_BUFFER_BIT */
-
-/* ClientArrayType */
-/* GL_VERTEX_ARRAY */
-/* GL_NORMAL_ARRAY */
-/* GL_COLOR_ARRAY */
-/* GL_INDEX_ARRAY */
-/* GL_TEXTURE_COORD_ARRAY */
-/* GL_EDGE_FLAG_ARRAY */
-
-/* ClipPlaneName */
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-
-/* ColorMaterialFace */
-/* GL_FRONT */
-/* GL_BACK */
-/* GL_FRONT_AND_BACK */
-
-/* ColorMaterialParameter */
-/* GL_AMBIENT */
-/* GL_DIFFUSE */
-/* GL_SPECULAR */
-/* GL_EMISSION */
-/* GL_AMBIENT_AND_DIFFUSE */
-
-/* ColorPointerType */
-/* GL_BYTE */
-/* GL_UNSIGNED_BYTE */
-/* GL_SHORT */
-/* GL_UNSIGNED_SHORT */
-/* GL_INT */
-/* GL_UNSIGNED_INT */
-/* GL_FLOAT */
-/* GL_DOUBLE */
-
-/* CullFaceMode */
-/* GL_FRONT */
-/* GL_BACK */
-/* GL_FRONT_AND_BACK */
-
-/* DataType */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_2_BYTES 0x1407
-#define GL_3_BYTES 0x1408
-#define GL_4_BYTES 0x1409
-#define GL_DOUBLE 0x140A
-
-/* DepthFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* DrawBufferMode */
-#define GL_NONE 0
-#define GL_FRONT_LEFT 0x0400
-#define GL_FRONT_RIGHT 0x0401
-#define GL_BACK_LEFT 0x0402
-#define GL_BACK_RIGHT 0x0403
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_LEFT 0x0406
-#define GL_RIGHT 0x0407
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_AUX0 0x0409
-#define GL_AUX1 0x040A
-#define GL_AUX2 0x040B
-#define GL_AUX3 0x040C
-
-/* Enable */
-/* GL_FOG */
-/* GL_LIGHTING */
-/* GL_TEXTURE_1D */
-/* GL_TEXTURE_2D */
-/* GL_LINE_STIPPLE */
-/* GL_POLYGON_STIPPLE */
-/* GL_CULL_FACE */
-/* GL_ALPHA_TEST */
-/* GL_BLEND */
-/* GL_INDEX_LOGIC_OP */
-/* GL_COLOR_LOGIC_OP */
-/* GL_DITHER */
-/* GL_STENCIL_TEST */
-/* GL_DEPTH_TEST */
-/* GL_CLIP_PLANE0 */
-/* GL_CLIP_PLANE1 */
-/* GL_CLIP_PLANE2 */
-/* GL_CLIP_PLANE3 */
-/* GL_CLIP_PLANE4 */
-/* GL_CLIP_PLANE5 */
-/* GL_LIGHT0 */
-/* GL_LIGHT1 */
-/* GL_LIGHT2 */
-/* GL_LIGHT3 */
-/* GL_LIGHT4 */
-/* GL_LIGHT5 */
-/* GL_LIGHT6 */
-/* GL_LIGHT7 */
-/* GL_TEXTURE_GEN_S */
-/* GL_TEXTURE_GEN_T */
-/* GL_TEXTURE_GEN_R */
-/* GL_TEXTURE_GEN_Q */
-/* GL_MAP1_VERTEX_3 */
-/* GL_MAP1_VERTEX_4 */
-/* GL_MAP1_COLOR_4 */
-/* GL_MAP1_INDEX */
-/* GL_MAP1_NORMAL */
-/* GL_MAP1_TEXTURE_COORD_1 */
-/* GL_MAP1_TEXTURE_COORD_2 */
-/* GL_MAP1_TEXTURE_COORD_3 */
-/* GL_MAP1_TEXTURE_COORD_4 */
-/* GL_MAP2_VERTEX_3 */
-/* GL_MAP2_VERTEX_4 */
-/* GL_MAP2_COLOR_4 */
-/* GL_MAP2_INDEX */
-/* GL_MAP2_NORMAL */
-/* GL_MAP2_TEXTURE_COORD_1 */
-/* GL_MAP2_TEXTURE_COORD_2 */
-/* GL_MAP2_TEXTURE_COORD_3 */
-/* GL_MAP2_TEXTURE_COORD_4 */
-/* GL_POINT_SMOOTH */
-/* GL_LINE_SMOOTH */
-/* GL_POLYGON_SMOOTH */
-/* GL_SCISSOR_TEST */
-/* GL_COLOR_MATERIAL */
-/* GL_NORMALIZE */
-/* GL_AUTO_NORMAL */
-/* GL_VERTEX_ARRAY */
-/* GL_NORMAL_ARRAY */
-/* GL_COLOR_ARRAY */
-/* GL_INDEX_ARRAY */
-/* GL_TEXTURE_COORD_ARRAY */
-/* GL_EDGE_FLAG_ARRAY */
-/* GL_POLYGON_OFFSET_POINT */
-/* GL_POLYGON_OFFSET_LINE */
-/* GL_POLYGON_OFFSET_FILL */
-
-/* ErrorCode */
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-
-/* FeedBackMode */
-#define GL_2D 0x0600
-#define GL_3D 0x0601
-#define GL_3D_COLOR 0x0602
-#define GL_3D_COLOR_TEXTURE 0x0603
-#define GL_4D_COLOR_TEXTURE 0x0604
-
-/* FeedBackToken */
-#define GL_PASS_THROUGH_TOKEN 0x0700
-#define GL_POINT_TOKEN 0x0701
-#define GL_LINE_TOKEN 0x0702
-#define GL_POLYGON_TOKEN 0x0703
-#define GL_BITMAP_TOKEN 0x0704
-#define GL_DRAW_PIXEL_TOKEN 0x0705
-#define GL_COPY_PIXEL_TOKEN 0x0706
-#define GL_LINE_RESET_TOKEN 0x0707
-
-/* FogMode */
-/* GL_LINEAR */
-#define GL_EXP 0x0800
-#define GL_EXP2 0x0801
-
-
-/* FogParameter */
-/* GL_FOG_COLOR */
-/* GL_FOG_DENSITY */
-/* GL_FOG_END */
-/* GL_FOG_INDEX */
-/* GL_FOG_MODE */
-/* GL_FOG_START */
-
-/* FrontFaceDirection */
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-
-/* GetMapTarget */
-#define GL_COEFF 0x0A00
-#define GL_ORDER 0x0A01
-#define GL_DOMAIN 0x0A02
-
-/* GetPixelMap */
-/* GL_PIXEL_MAP_I_TO_I */
-/* GL_PIXEL_MAP_S_TO_S */
-/* GL_PIXEL_MAP_I_TO_R */
-/* GL_PIXEL_MAP_I_TO_G */
-/* GL_PIXEL_MAP_I_TO_B */
-/* GL_PIXEL_MAP_I_TO_A */
-/* GL_PIXEL_MAP_R_TO_R */
-/* GL_PIXEL_MAP_G_TO_G */
-/* GL_PIXEL_MAP_B_TO_B */
-/* GL_PIXEL_MAP_A_TO_A */
-
-/* GetPointerTarget */
-/* GL_VERTEX_ARRAY_POINTER */
-/* GL_NORMAL_ARRAY_POINTER */
-/* GL_COLOR_ARRAY_POINTER */
-/* GL_INDEX_ARRAY_POINTER */
-/* GL_TEXTURE_COORD_ARRAY_POINTER */
-/* GL_EDGE_FLAG_ARRAY_POINTER */
-
-/* GetTarget */
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_INDEX 0x0B01
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_CURRENT_RASTER_COLOR 0x0B04
-#define GL_CURRENT_RASTER_INDEX 0x0B05
-#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
-#define GL_CURRENT_RASTER_POSITION 0x0B07
-#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
-#define GL_CURRENT_RASTER_DISTANCE 0x0B09
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_RANGE 0x0B12
-#define GL_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_LINE_WIDTH 0x0B21
-#define GL_LINE_WIDTH_RANGE 0x0B22
-#define GL_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_LINE_STIPPLE 0x0B24
-#define GL_LINE_STIPPLE_PATTERN 0x0B25
-#define GL_LINE_STIPPLE_REPEAT 0x0B26
-#define GL_LIST_MODE 0x0B30
-#define GL_MAX_LIST_NESTING 0x0B31
-#define GL_LIST_BASE 0x0B32
-#define GL_LIST_INDEX 0x0B33
-#define GL_POLYGON_MODE 0x0B40
-#define GL_POLYGON_SMOOTH 0x0B41
-#define GL_POLYGON_STIPPLE 0x0B42
-#define GL_EDGE_FLAG 0x0B43
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_LIGHTING 0x0B50
-#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_SHADE_MODEL 0x0B54
-#define GL_COLOR_MATERIAL_FACE 0x0B55
-#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_FOG 0x0B60
-#define GL_FOG_INDEX 0x0B61
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_COLOR 0x0B66
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_ACCUM_CLEAR_VALUE 0x0B80
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_NORMALIZE 0x0BA1
-#define GL_VIEWPORT 0x0BA2
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_ATTRIB_STACK_DEPTH 0x0BB0
-#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_ALPHA_TEST_FUNC 0x0BC1
-#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_DITHER 0x0BD0
-#define GL_BLEND_DST 0x0BE0
-#define GL_BLEND_SRC 0x0BE1
-#define GL_BLEND 0x0BE2
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_INDEX_LOGIC_OP 0x0BF1
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_AUX_BUFFERS 0x0C00
-#define GL_DRAW_BUFFER 0x0C01
-#define GL_READ_BUFFER 0x0C02
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_INDEX_CLEAR_VALUE 0x0C20
-#define GL_INDEX_WRITEMASK 0x0C21
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_INDEX_MODE 0x0C30
-#define GL_RGBA_MODE 0x0C31
-#define GL_DOUBLEBUFFER 0x0C32
-#define GL_STEREO 0x0C33
-#define GL_RENDER_MODE 0x0C40
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_FOG_HINT 0x0C54
-#define GL_TEXTURE_GEN_S 0x0C60
-#define GL_TEXTURE_GEN_T 0x0C61
-#define GL_TEXTURE_GEN_R 0x0C62
-#define GL_TEXTURE_GEN_Q 0x0C63
-#define GL_PIXEL_MAP_I_TO_I 0x0C70
-#define GL_PIXEL_MAP_S_TO_S 0x0C71
-#define GL_PIXEL_MAP_I_TO_R 0x0C72
-#define GL_PIXEL_MAP_I_TO_G 0x0C73
-#define GL_PIXEL_MAP_I_TO_B 0x0C74
-#define GL_PIXEL_MAP_I_TO_A 0x0C75
-#define GL_PIXEL_MAP_R_TO_R 0x0C76
-#define GL_PIXEL_MAP_G_TO_G 0x0C77
-#define GL_PIXEL_MAP_B_TO_B 0x0C78
-#define GL_PIXEL_MAP_A_TO_A 0x0C79
-#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
-#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
-#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
-#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
-#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
-#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
-#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
-#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
-#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
-#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
-#define GL_UNPACK_SWAP_BYTES 0x0CF0
-#define GL_UNPACK_LSB_FIRST 0x0CF1
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_SWAP_BYTES 0x0D00
-#define GL_PACK_LSB_FIRST 0x0D01
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAP_COLOR 0x0D10
-#define GL_MAP_STENCIL 0x0D11
-#define GL_INDEX_SHIFT 0x0D12
-#define GL_INDEX_OFFSET 0x0D13
-#define GL_RED_SCALE 0x0D14
-#define GL_RED_BIAS 0x0D15
-#define GL_ZOOM_X 0x0D16
-#define GL_ZOOM_Y 0x0D17
-#define GL_GREEN_SCALE 0x0D18
-#define GL_GREEN_BIAS 0x0D19
-#define GL_BLUE_SCALE 0x0D1A
-#define GL_BLUE_BIAS 0x0D1B
-#define GL_ALPHA_SCALE 0x0D1C
-#define GL_ALPHA_BIAS 0x0D1D
-#define GL_DEPTH_SCALE 0x0D1E
-#define GL_DEPTH_BIAS 0x0D1F
-#define GL_MAX_EVAL_ORDER 0x0D30
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_CLIP_PLANES 0x0D32
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
-#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_NAME_STACK_DEPTH 0x0D37
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_INDEX_BITS 0x0D51
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_ACCUM_RED_BITS 0x0D58
-#define GL_ACCUM_GREEN_BITS 0x0D59
-#define GL_ACCUM_BLUE_BITS 0x0D5A
-#define GL_ACCUM_ALPHA_BITS 0x0D5B
-#define GL_NAME_STACK_DEPTH 0x0D70
-#define GL_AUTO_NORMAL 0x0D80
-#define GL_MAP1_COLOR_4 0x0D90
-#define GL_MAP1_INDEX 0x0D91
-#define GL_MAP1_NORMAL 0x0D92
-#define GL_MAP1_TEXTURE_COORD_1 0x0D93
-#define GL_MAP1_TEXTURE_COORD_2 0x0D94
-#define GL_MAP1_TEXTURE_COORD_3 0x0D95
-#define GL_MAP1_TEXTURE_COORD_4 0x0D96
-#define GL_MAP1_VERTEX_3 0x0D97
-#define GL_MAP1_VERTEX_4 0x0D98
-#define GL_MAP2_COLOR_4 0x0DB0
-#define GL_MAP2_INDEX 0x0DB1
-#define GL_MAP2_NORMAL 0x0DB2
-#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
-#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
-#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
-#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
-#define GL_MAP2_VERTEX_3 0x0DB7
-#define GL_MAP2_VERTEX_4 0x0DB8
-#define GL_MAP1_GRID_DOMAIN 0x0DD0
-#define GL_MAP1_GRID_SEGMENTS 0x0DD1
-#define GL_MAP2_GRID_DOMAIN 0x0DD2
-#define GL_MAP2_GRID_SEGMENTS 0x0DD3
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
-#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
-#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
-#define GL_SELECTION_BUFFER_POINTER 0x0DF3
-#define GL_SELECTION_BUFFER_SIZE 0x0DF4
-/* GL_TEXTURE_BINDING_1D */
-/* GL_TEXTURE_BINDING_2D */
-/* GL_VERTEX_ARRAY */
-/* GL_NORMAL_ARRAY */
-/* GL_COLOR_ARRAY */
-/* GL_INDEX_ARRAY */
-/* GL_TEXTURE_COORD_ARRAY */
-/* GL_EDGE_FLAG_ARRAY */
-/* GL_VERTEX_ARRAY_SIZE */
-/* GL_VERTEX_ARRAY_TYPE */
-/* GL_VERTEX_ARRAY_STRIDE */
-/* GL_NORMAL_ARRAY_TYPE */
-/* GL_NORMAL_ARRAY_STRIDE */
-/* GL_COLOR_ARRAY_SIZE */
-/* GL_COLOR_ARRAY_TYPE */
-/* GL_COLOR_ARRAY_STRIDE */
-/* GL_INDEX_ARRAY_TYPE */
-/* GL_INDEX_ARRAY_STRIDE */
-/* GL_TEXTURE_COORD_ARRAY_SIZE */
-/* GL_TEXTURE_COORD_ARRAY_TYPE */
-/* GL_TEXTURE_COORD_ARRAY_STRIDE */
-/* GL_EDGE_FLAG_ARRAY_STRIDE */
-/* GL_POLYGON_OFFSET_FACTOR */
-/* GL_POLYGON_OFFSET_UNITS */
-
-/* GetTextureParameter */
-/* GL_TEXTURE_MAG_FILTER */
-/* GL_TEXTURE_MIN_FILTER */
-/* GL_TEXTURE_WRAP_S */
-/* GL_TEXTURE_WRAP_T */
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_BORDER 0x1005
-/* GL_TEXTURE_RED_SIZE */
-/* GL_TEXTURE_GREEN_SIZE */
-/* GL_TEXTURE_BLUE_SIZE */
-/* GL_TEXTURE_ALPHA_SIZE */
-/* GL_TEXTURE_LUMINANCE_SIZE */
-/* GL_TEXTURE_INTENSITY_SIZE */
-/* GL_TEXTURE_PRIORITY */
-/* GL_TEXTURE_RESIDENT */
-
-/* HintMode */
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-
-/* HintTarget */
-/* GL_PERSPECTIVE_CORRECTION_HINT */
-/* GL_POINT_SMOOTH_HINT */
-/* GL_LINE_SMOOTH_HINT */
-/* GL_POLYGON_SMOOTH_HINT */
-/* GL_FOG_HINT */
-/* GL_PHONG_HINT */
-
-/* IndexPointerType */
-/* GL_SHORT */
-/* GL_INT */
-/* GL_FLOAT */
-/* GL_DOUBLE */
-
-/* LightModelParameter */
-/* GL_LIGHT_MODEL_AMBIENT */
-/* GL_LIGHT_MODEL_LOCAL_VIEWER */
-/* GL_LIGHT_MODEL_TWO_SIDE */
-
-/* LightName */
-#define GL_LIGHT0 0x4000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-
-/* LightParameter */
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-
-/* InterleavedArrays */
-/* GL_V2F */
-/* GL_V3F */
-/* GL_C4UB_V2F */
-/* GL_C4UB_V3F */
-/* GL_C3F_V3F */
-/* GL_N3F_V3F */
-/* GL_C4F_N3F_V3F */
-/* GL_T2F_V3F */
-/* GL_T4F_V4F */
-/* GL_T2F_C4UB_V3F */
-/* GL_T2F_C3F_V3F */
-/* GL_T2F_N3F_V3F */
-/* GL_T2F_C4F_N3F_V3F */
-/* GL_T4F_C4F_N3F_V4F */
-
-/* ListMode */
-#define GL_COMPILE 0x1300
-#define GL_COMPILE_AND_EXECUTE 0x1301
-
-/* ListNameType */
-/* GL_BYTE */
-/* GL_UNSIGNED_BYTE */
-/* GL_SHORT */
-/* GL_UNSIGNED_SHORT */
-/* GL_INT */
-/* GL_UNSIGNED_INT */
-/* GL_FLOAT */
-/* GL_2_BYTES */
-/* GL_3_BYTES */
-/* GL_4_BYTES */
-
-/* LogicOp */
-#define GL_CLEAR 0x1500
-#define GL_AND 0x1501
-#define GL_AND_REVERSE 0x1502
-#define GL_COPY 0x1503
-#define GL_AND_INVERTED 0x1504
-#define GL_NOOP 0x1505
-#define GL_XOR 0x1506
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_EQUIV 0x1509
-#define GL_INVERT 0x150A
-#define GL_OR_REVERSE 0x150B
-#define GL_COPY_INVERTED 0x150C
-#define GL_OR_INVERTED 0x150D
-#define GL_NAND 0x150E
-#define GL_SET 0x150F
-
-/* MapTarget */
-/* GL_MAP1_COLOR_4 */
-/* GL_MAP1_INDEX */
-/* GL_MAP1_NORMAL */
-/* GL_MAP1_TEXTURE_COORD_1 */
-/* GL_MAP1_TEXTURE_COORD_2 */
-/* GL_MAP1_TEXTURE_COORD_3 */
-/* GL_MAP1_TEXTURE_COORD_4 */
-/* GL_MAP1_VERTEX_3 */
-/* GL_MAP1_VERTEX_4 */
-/* GL_MAP2_COLOR_4 */
-/* GL_MAP2_INDEX */
-/* GL_MAP2_NORMAL */
-/* GL_MAP2_TEXTURE_COORD_1 */
-/* GL_MAP2_TEXTURE_COORD_2 */
-/* GL_MAP2_TEXTURE_COORD_3 */
-/* GL_MAP2_TEXTURE_COORD_4 */
-/* GL_MAP2_VERTEX_3 */
-/* GL_MAP2_VERTEX_4 */
-
-/* MaterialFace */
-/* GL_FRONT */
-/* GL_BACK */
-/* GL_FRONT_AND_BACK */
-
-/* MaterialParameter */
-#define GL_EMISSION 0x1600
-#define GL_SHININESS 0x1601
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-#define GL_COLOR_INDEXES 0x1603
-/* GL_AMBIENT */
-/* GL_DIFFUSE */
-/* GL_SPECULAR */
-
-/* MatrixMode */
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
-
-/* MeshMode1 */
-/* GL_POINT */
-/* GL_LINE */
-
-/* MeshMode2 */
-/* GL_POINT */
-/* GL_LINE */
-/* GL_FILL */
-
-/* NormalPointerType */
-/* GL_BYTE */
-/* GL_SHORT */
-/* GL_INT */
-/* GL_FLOAT */
-/* GL_DOUBLE */
-
-/* PixelCopyType */
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-
-/* PixelFormat */
-#define GL_COLOR_INDEX 0x1900
-#define GL_STENCIL_INDEX 0x1901
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-
-/* PixelMap */
-/* GL_PIXEL_MAP_I_TO_I */
-/* GL_PIXEL_MAP_S_TO_S */
-/* GL_PIXEL_MAP_I_TO_R */
-/* GL_PIXEL_MAP_I_TO_G */
-/* GL_PIXEL_MAP_I_TO_B */
-/* GL_PIXEL_MAP_I_TO_A */
-/* GL_PIXEL_MAP_R_TO_R */
-/* GL_PIXEL_MAP_G_TO_G */
-/* GL_PIXEL_MAP_B_TO_B */
-/* GL_PIXEL_MAP_A_TO_A */
-
-/* PixelStore */
-/* GL_UNPACK_SWAP_BYTES */
-/* GL_UNPACK_LSB_FIRST */
-/* GL_UNPACK_ROW_LENGTH */
-/* GL_UNPACK_SKIP_ROWS */
-/* GL_UNPACK_SKIP_PIXELS */
-/* GL_UNPACK_ALIGNMENT */
-/* GL_PACK_SWAP_BYTES */
-/* GL_PACK_LSB_FIRST */
-/* GL_PACK_ROW_LENGTH */
-/* GL_PACK_SKIP_ROWS */
-/* GL_PACK_SKIP_PIXELS */
-/* GL_PACK_ALIGNMENT */
-
-/* PixelTransfer */
-/* GL_MAP_COLOR */
-/* GL_MAP_STENCIL */
-/* GL_INDEX_SHIFT */
-/* GL_INDEX_OFFSET */
-/* GL_RED_SCALE */
-/* GL_RED_BIAS */
-/* GL_GREEN_SCALE */
-/* GL_GREEN_BIAS */
-/* GL_BLUE_SCALE */
-/* GL_BLUE_BIAS */
-/* GL_ALPHA_SCALE */
-/* GL_ALPHA_BIAS */
-/* GL_DEPTH_SCALE */
-/* GL_DEPTH_BIAS */
-
-/* PixelType */
-#define GL_BITMAP 0x1A00
-/* GL_BYTE */
-/* GL_UNSIGNED_BYTE */
-/* GL_SHORT */
-/* GL_UNSIGNED_SHORT */
-/* GL_INT */
-/* GL_UNSIGNED_INT */
-/* GL_FLOAT */
-
-/* PolygonMode */
-#define GL_POINT 0x1B00
-#define GL_LINE 0x1B01
-#define GL_FILL 0x1B02
-
-/* ReadBufferMode */
-/* GL_FRONT_LEFT */
-/* GL_FRONT_RIGHT */
-/* GL_BACK_LEFT */
-/* GL_BACK_RIGHT */
-/* GL_FRONT */
-/* GL_BACK */
-/* GL_LEFT */
-/* GL_RIGHT */
-/* GL_AUX0 */
-/* GL_AUX1 */
-/* GL_AUX2 */
-/* GL_AUX3 */
-
-/* RenderingMode */
-#define GL_RENDER 0x1C00
-#define GL_FEEDBACK 0x1C01
-#define GL_SELECT 0x1C02
-
-/* ShadingModel */
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-
-
-/* StencilFunction */
-/* GL_NEVER */
-/* GL_LESS */
-/* GL_EQUAL */
-/* GL_LEQUAL */
-/* GL_GREATER */
-/* GL_NOTEQUAL */
-/* GL_GEQUAL */
-/* GL_ALWAYS */
-
-/* StencilOp */
-/* GL_ZERO */
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-/* GL_INVERT */
-
-/* StringName */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-
-/* TextureCoordName */
-#define GL_S 0x2000
-#define GL_T 0x2001
-#define GL_R 0x2002
-#define GL_Q 0x2003
-
-/* TexCoordPointerType */
-/* GL_SHORT */
-/* GL_INT */
-/* GL_FLOAT */
-/* GL_DOUBLE */
-
-/* TextureEnvMode */
-#define GL_MODULATE 0x2100
-#define GL_DECAL 0x2101
-/* GL_BLEND */
-/* GL_REPLACE */
-
-/* TextureEnvParameter */
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_ENV_COLOR 0x2201
-
-/* TextureEnvTarget */
-#define GL_TEXTURE_ENV 0x2300
-
-/* TextureGenMode */
-#define GL_EYE_LINEAR 0x2400
-#define GL_OBJECT_LINEAR 0x2401
-#define GL_SPHERE_MAP 0x2402
-
-/* TextureGenParameter */
-#define GL_TEXTURE_GEN_MODE 0x2500
-#define GL_OBJECT_PLANE 0x2501
-#define GL_EYE_PLANE 0x2502
-
-/* TextureMagFilter */
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-
-/* TextureMinFilter */
-/* GL_NEAREST */
-/* GL_LINEAR */
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-
-/* TextureParameterName */
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-/* GL_TEXTURE_BORDER_COLOR */
-/* GL_TEXTURE_PRIORITY */
-
-/* TextureTarget */
-/* GL_TEXTURE_1D */
-/* GL_TEXTURE_2D */
-/* GL_PROXY_TEXTURE_1D */
-/* GL_PROXY_TEXTURE_2D */
-
-/* TextureWrapMode */
-#define GL_CLAMP 0x2900
-#define GL_REPEAT 0x2901
-
-/* VertexPointerType */
-/* GL_SHORT */
-/* GL_INT */
-/* GL_FLOAT */
-/* GL_DOUBLE */
-
-/* ClientAttribMask */
-#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
-#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff
-
-/* polygon_offset */
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_POLYGON_OFFSET_FILL 0x8037
-
-/* texture */
-#define GL_ALPHA4 0x803B
-#define GL_ALPHA8 0x803C
-#define GL_ALPHA12 0x803D
-#define GL_ALPHA16 0x803E
-#define GL_LUMINANCE4 0x803F
-#define GL_LUMINANCE8 0x8040
-#define GL_LUMINANCE12 0x8041
-#define GL_LUMINANCE16 0x8042
-#define GL_LUMINANCE4_ALPHA4 0x8043
-#define GL_LUMINANCE6_ALPHA2 0x8044
-#define GL_LUMINANCE8_ALPHA8 0x8045
-#define GL_LUMINANCE12_ALPHA4 0x8046
-#define GL_LUMINANCE12_ALPHA12 0x8047
-#define GL_LUMINANCE16_ALPHA16 0x8048
-#define GL_INTENSITY 0x8049
-#define GL_INTENSITY4 0x804A
-#define GL_INTENSITY8 0x804B
-#define GL_INTENSITY12 0x804C
-#define GL_INTENSITY16 0x804D
-#define GL_R3_G3_B2 0x2A10
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE 0x8061
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-
-/* texture_object */
-#define GL_TEXTURE_PRIORITY 0x8066
-#define GL_TEXTURE_RESIDENT 0x8067
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
-
-/* vertex_array */
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_INDEX_ARRAY 0x8077
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_EDGE_FLAG_ARRAY 0x8079
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_INDEX_ARRAY_TYPE 0x8085
-#define GL_INDEX_ARRAY_STRIDE 0x8086
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_INDEX_ARRAY_POINTER 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
-#define GL_V2F 0x2A20
-#define GL_V3F 0x2A21
-#define GL_C4UB_V2F 0x2A22
-#define GL_C4UB_V3F 0x2A23
-#define GL_C3F_V3F 0x2A24
-#define GL_N3F_V3F 0x2A25
-#define GL_C4F_N3F_V3F 0x2A26
-#define GL_T2F_V3F 0x2A27
-#define GL_T4F_V4F 0x2A28
-#define GL_T2F_C4UB_V3F 0x2A29
-#define GL_T2F_C3F_V3F 0x2A2A
-#define GL_T2F_N3F_V3F 0x2A2B
-#define GL_T2F_C4F_N3F_V3F 0x2A2C
-#define GL_T4F_C4F_N3F_V4F 0x2A2D
-
-/* Extensions */
-#define GL_EXT_vertex_array 1
-#define GL_EXT_bgra 1
-#define GL_EXT_paletted_texture 1
-#define GL_WIN_swap_hint 1
-#define GL_WIN_draw_range_elements 1
-// #define GL_WIN_phong_shading 1
-// #define GL_WIN_specular_fog 1
-
-/* EXT_vertex_array */
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-#define GL_DOUBLE_EXT GL_DOUBLE
-
-/* EXT_bgra */
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-
-/* EXT_paletted_texture */
-
-/* These must match the GL_COLOR_TABLE_*_SGI enumerants */
-#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8
-#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
-
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-
-/* WIN_draw_range_elements */
-#define GL_MAX_ELEMENTS_VERTICES_WIN 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_WIN 0x80E9
-
-/* WIN_phong_shading */
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-
-/* WIN_specular_fog */
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-
-/* For compatibility with OpenGL v1.0 */
-#define GL_LOGIC_OP GL_INDEX_LOGIC_OP
-#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT
-
-/*************************************************************/
-
-WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
-WINGDIAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
-WINGDIAPI GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);
-WINGDIAPI void APIENTRY glArrayElement (GLint i);
-WINGDIAPI void APIENTRY glBegin (GLenum mode);
-WINGDIAPI void APIENTRY glBindTexture (GLenum target, GLuint texture);
-WINGDIAPI void APIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-WINGDIAPI void APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-WINGDIAPI void APIENTRY glCallList (GLuint list);
-WINGDIAPI void APIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists);
-WINGDIAPI void APIENTRY glClear (GLbitfield mask);
-WINGDIAPI void APIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-WINGDIAPI void APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-WINGDIAPI void APIENTRY glClearDepth (GLclampd depth);
-WINGDIAPI void APIENTRY glClearIndex (GLfloat c);
-WINGDIAPI void APIENTRY glClearStencil (GLint s);
-WINGDIAPI void APIENTRY glClipPlane (GLenum plane, const GLdouble *equation);
-WINGDIAPI void APIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue);
-WINGDIAPI void APIENTRY glColor3bv (const GLbyte *v);
-WINGDIAPI void APIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue);
-WINGDIAPI void APIENTRY glColor3dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue);
-WINGDIAPI void APIENTRY glColor3fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glColor3i (GLint red, GLint green, GLint blue);
-WINGDIAPI void APIENTRY glColor3iv (const GLint *v);
-WINGDIAPI void APIENTRY glColor3s (GLshort red, GLshort green, GLshort blue);
-WINGDIAPI void APIENTRY glColor3sv (const GLshort *v);
-WINGDIAPI void APIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
-WINGDIAPI void APIENTRY glColor3ubv (const GLubyte *v);
-WINGDIAPI void APIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue);
-WINGDIAPI void APIENTRY glColor3uiv (const GLuint *v);
-WINGDIAPI void APIENTRY glColor3us (GLushort red, GLushort green, GLushort blue);
-WINGDIAPI void APIENTRY glColor3usv (const GLushort *v);
-WINGDIAPI void APIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-WINGDIAPI void APIENTRY glColor4bv (const GLbyte *v);
-WINGDIAPI void APIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-WINGDIAPI void APIENTRY glColor4dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-WINGDIAPI void APIENTRY glColor4fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
-WINGDIAPI void APIENTRY glColor4iv (const GLint *v);
-WINGDIAPI void APIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
-WINGDIAPI void APIENTRY glColor4sv (const GLshort *v);
-WINGDIAPI void APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-WINGDIAPI void APIENTRY glColor4ubv (const GLubyte *v);
-WINGDIAPI void APIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-WINGDIAPI void APIENTRY glColor4uiv (const GLuint *v);
-WINGDIAPI void APIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
-WINGDIAPI void APIENTRY glColor4usv (const GLushort *v);
-WINGDIAPI void APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-WINGDIAPI void APIENTRY glColorMaterial (GLenum face, GLenum mode);
-WINGDIAPI void APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-WINGDIAPI void APIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-WINGDIAPI void APIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-WINGDIAPI void APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-WINGDIAPI void APIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-WINGDIAPI void APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-WINGDIAPI void APIENTRY glCullFace (GLenum mode);
-WINGDIAPI void APIENTRY glDeleteLists (GLuint list, GLsizei range);
-WINGDIAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-WINGDIAPI void APIENTRY glDepthFunc (GLenum func);
-WINGDIAPI void APIENTRY glDepthMask (GLboolean flag);
-WINGDIAPI void APIENTRY glDepthRange (GLclampd zNear, GLclampd zFar);
-WINGDIAPI void APIENTRY glDisable (GLenum cap);
-WINGDIAPI void APIENTRY glDisableClientState (GLenum array);
-WINGDIAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-WINGDIAPI void APIENTRY glDrawBuffer (GLenum mode);
-WINGDIAPI void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-WINGDIAPI void APIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-WINGDIAPI void APIENTRY glEdgeFlag (GLboolean flag);
-WINGDIAPI void APIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer);
-WINGDIAPI void APIENTRY glEdgeFlagv (const GLboolean *flag);
-WINGDIAPI void APIENTRY glEnable (GLenum cap);
-WINGDIAPI void APIENTRY glEnableClientState (GLenum array);
-WINGDIAPI void APIENTRY glEnd (void);
-WINGDIAPI void APIENTRY glEndList (void);
-WINGDIAPI void APIENTRY glEvalCoord1d (GLdouble u);
-WINGDIAPI void APIENTRY glEvalCoord1dv (const GLdouble *u);
-WINGDIAPI void APIENTRY glEvalCoord1f (GLfloat u);
-WINGDIAPI void APIENTRY glEvalCoord1fv (const GLfloat *u);
-WINGDIAPI void APIENTRY glEvalCoord2d (GLdouble u, GLdouble v);
-WINGDIAPI void APIENTRY glEvalCoord2dv (const GLdouble *u);
-WINGDIAPI void APIENTRY glEvalCoord2f (GLfloat u, GLfloat v);
-WINGDIAPI void APIENTRY glEvalCoord2fv (const GLfloat *u);
-WINGDIAPI void APIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
-WINGDIAPI void APIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-WINGDIAPI void APIENTRY glEvalPoint1 (GLint i);
-WINGDIAPI void APIENTRY glEvalPoint2 (GLint i, GLint j);
-WINGDIAPI void APIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
-WINGDIAPI void APIENTRY glFinish (void);
-WINGDIAPI void APIENTRY glFlush (void);
-WINGDIAPI void APIENTRY glFogf (GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glFogfv (GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glFogi (GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glFogiv (GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glFrontFace (GLenum mode);
-WINGDIAPI void APIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-WINGDIAPI GLuint APIENTRY glGenLists (GLsizei range);
-WINGDIAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-WINGDIAPI void APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
-WINGDIAPI void APIENTRY glGetClipPlane (GLenum plane, GLdouble *equation);
-WINGDIAPI void APIENTRY glGetDoublev (GLenum pname, GLdouble *params);
-WINGDIAPI GLenum APIENTRY glGetError (void);
-WINGDIAPI void APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v);
-WINGDIAPI void APIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v);
-WINGDIAPI void APIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v);
-WINGDIAPI void APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glGetPixelMapfv (GLenum map, GLfloat *values);
-WINGDIAPI void APIENTRY glGetPixelMapuiv (GLenum map, GLuint *values);
-WINGDIAPI void APIENTRY glGetPixelMapusv (GLenum map, GLushort *values);
-WINGDIAPI void APIENTRY glGetPointerv (GLenum pname, GLvoid* *params);
-WINGDIAPI void APIENTRY glGetPolygonStipple (GLubyte *mask);
-WINGDIAPI const GLubyte * APIENTRY glGetString (GLenum name);
-WINGDIAPI void APIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
-WINGDIAPI void APIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-WINGDIAPI void APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-WINGDIAPI void APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-WINGDIAPI void APIENTRY glHint (GLenum target, GLenum mode);
-WINGDIAPI void APIENTRY glIndexMask (GLuint mask);
-WINGDIAPI void APIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-WINGDIAPI void APIENTRY glIndexd (GLdouble c);
-WINGDIAPI void APIENTRY glIndexdv (const GLdouble *c);
-WINGDIAPI void APIENTRY glIndexf (GLfloat c);
-WINGDIAPI void APIENTRY glIndexfv (const GLfloat *c);
-WINGDIAPI void APIENTRY glIndexi (GLint c);
-WINGDIAPI void APIENTRY glIndexiv (const GLint *c);
-WINGDIAPI void APIENTRY glIndexs (GLshort c);
-WINGDIAPI void APIENTRY glIndexsv (const GLshort *c);
-WINGDIAPI void APIENTRY glIndexub (GLubyte c);
-WINGDIAPI void APIENTRY glIndexubv (const GLubyte *c);
-WINGDIAPI void APIENTRY glInitNames (void);
-WINGDIAPI void APIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer);
-WINGDIAPI GLboolean APIENTRY glIsEnabled (GLenum cap);
-WINGDIAPI GLboolean APIENTRY glIsList (GLuint list);
-WINGDIAPI GLboolean APIENTRY glIsTexture (GLuint texture);
-WINGDIAPI void APIENTRY glLightModelf (GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glLightModeli (GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glLightModeliv (GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glLighti (GLenum light, GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glLineStipple (GLint factor, GLushort pattern);
-WINGDIAPI void APIENTRY glLineWidth (GLfloat width);
-WINGDIAPI void APIENTRY glListBase (GLuint base);
-WINGDIAPI void APIENTRY glLoadIdentity (void);
-WINGDIAPI void APIENTRY glLoadMatrixd (const GLdouble *m);
-WINGDIAPI void APIENTRY glLoadMatrixf (const GLfloat *m);
-WINGDIAPI void APIENTRY glLoadName (GLuint name);
-WINGDIAPI void APIENTRY glLogicOp (GLenum opcode);
-WINGDIAPI void APIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-WINGDIAPI void APIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-WINGDIAPI void APIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-WINGDIAPI void APIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-WINGDIAPI void APIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
-WINGDIAPI void APIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
-WINGDIAPI void APIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-WINGDIAPI void APIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-WINGDIAPI void APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glMateriali (GLenum face, GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glMatrixMode (GLenum mode);
-WINGDIAPI void APIENTRY glMultMatrixd (const GLdouble *m);
-WINGDIAPI void APIENTRY glMultMatrixf (const GLfloat *m);
-WINGDIAPI void APIENTRY glNewList (GLuint list, GLenum mode);
-WINGDIAPI void APIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
-WINGDIAPI void APIENTRY glNormal3bv (const GLbyte *v);
-WINGDIAPI void APIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
-WINGDIAPI void APIENTRY glNormal3dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
-WINGDIAPI void APIENTRY glNormal3fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glNormal3i (GLint nx, GLint ny, GLint nz);
-WINGDIAPI void APIENTRY glNormal3iv (const GLint *v);
-WINGDIAPI void APIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz);
-WINGDIAPI void APIENTRY glNormal3sv (const GLshort *v);
-WINGDIAPI void APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-WINGDIAPI void APIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-WINGDIAPI void APIENTRY glPassThrough (GLfloat token);
-WINGDIAPI void APIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values);
-WINGDIAPI void APIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values);
-WINGDIAPI void APIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values);
-WINGDIAPI void APIENTRY glPixelStoref (GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glPixelStorei (GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glPixelTransferf (GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glPixelTransferi (GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor);
-WINGDIAPI void APIENTRY glPointSize (GLfloat size);
-WINGDIAPI void APIENTRY glPolygonMode (GLenum face, GLenum mode);
-WINGDIAPI void APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-WINGDIAPI void APIENTRY glPolygonStipple (const GLubyte *mask);
-WINGDIAPI void APIENTRY glPopAttrib (void);
-WINGDIAPI void APIENTRY glPopClientAttrib (void);
-WINGDIAPI void APIENTRY glPopMatrix (void);
-WINGDIAPI void APIENTRY glPopName (void);
-WINGDIAPI void APIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-WINGDIAPI void APIENTRY glPushAttrib (GLbitfield mask);
-WINGDIAPI void APIENTRY glPushClientAttrib (GLbitfield mask);
-WINGDIAPI void APIENTRY glPushMatrix (void);
-WINGDIAPI void APIENTRY glPushName (GLuint name);
-WINGDIAPI void APIENTRY glRasterPos2d (GLdouble x, GLdouble y);
-WINGDIAPI void APIENTRY glRasterPos2dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glRasterPos2f (GLfloat x, GLfloat y);
-WINGDIAPI void APIENTRY glRasterPos2fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glRasterPos2i (GLint x, GLint y);
-WINGDIAPI void APIENTRY glRasterPos2iv (const GLint *v);
-WINGDIAPI void APIENTRY glRasterPos2s (GLshort x, GLshort y);
-WINGDIAPI void APIENTRY glRasterPos2sv (const GLshort *v);
-WINGDIAPI void APIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
-WINGDIAPI void APIENTRY glRasterPos3dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
-WINGDIAPI void APIENTRY glRasterPos3fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glRasterPos3i (GLint x, GLint y, GLint z);
-WINGDIAPI void APIENTRY glRasterPos3iv (const GLint *v);
-WINGDIAPI void APIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z);
-WINGDIAPI void APIENTRY glRasterPos3sv (const GLshort *v);
-WINGDIAPI void APIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-WINGDIAPI void APIENTRY glRasterPos4dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-WINGDIAPI void APIENTRY glRasterPos4fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
-WINGDIAPI void APIENTRY glRasterPos4iv (const GLint *v);
-WINGDIAPI void APIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
-WINGDIAPI void APIENTRY glRasterPos4sv (const GLshort *v);
-WINGDIAPI void APIENTRY glReadBuffer (GLenum mode);
-WINGDIAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-WINGDIAPI void APIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-WINGDIAPI void APIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2);
-WINGDIAPI void APIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-WINGDIAPI void APIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2);
-WINGDIAPI void APIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
-WINGDIAPI void APIENTRY glRectiv (const GLint *v1, const GLint *v2);
-WINGDIAPI void APIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-WINGDIAPI void APIENTRY glRectsv (const GLshort *v1, const GLshort *v2);
-WINGDIAPI GLint APIENTRY glRenderMode (GLenum mode);
-WINGDIAPI void APIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-WINGDIAPI void APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-WINGDIAPI void APIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z);
-WINGDIAPI void APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
-WINGDIAPI void APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-WINGDIAPI void APIENTRY glSelectBuffer (GLsizei size, GLuint *buffer);
-WINGDIAPI void APIENTRY glShadeModel (GLenum mode);
-WINGDIAPI void APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-WINGDIAPI void APIENTRY glStencilMask (GLuint mask);
-WINGDIAPI void APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-WINGDIAPI void APIENTRY glTexCoord1d (GLdouble s);
-WINGDIAPI void APIENTRY glTexCoord1dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glTexCoord1f (GLfloat s);
-WINGDIAPI void APIENTRY glTexCoord1fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glTexCoord1i (GLint s);
-WINGDIAPI void APIENTRY glTexCoord1iv (const GLint *v);
-WINGDIAPI void APIENTRY glTexCoord1s (GLshort s);
-WINGDIAPI void APIENTRY glTexCoord1sv (const GLshort *v);
-WINGDIAPI void APIENTRY glTexCoord2d (GLdouble s, GLdouble t);
-WINGDIAPI void APIENTRY glTexCoord2dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glTexCoord2f (GLfloat s, GLfloat t);
-WINGDIAPI void APIENTRY glTexCoord2fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glTexCoord2i (GLint s, GLint t);
-WINGDIAPI void APIENTRY glTexCoord2iv (const GLint *v);
-WINGDIAPI void APIENTRY glTexCoord2s (GLshort s, GLshort t);
-WINGDIAPI void APIENTRY glTexCoord2sv (const GLshort *v);
-WINGDIAPI void APIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
-WINGDIAPI void APIENTRY glTexCoord3dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
-WINGDIAPI void APIENTRY glTexCoord3fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glTexCoord3i (GLint s, GLint t, GLint r);
-WINGDIAPI void APIENTRY glTexCoord3iv (const GLint *v);
-WINGDIAPI void APIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r);
-WINGDIAPI void APIENTRY glTexCoord3sv (const GLshort *v);
-WINGDIAPI void APIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-WINGDIAPI void APIENTRY glTexCoord4dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-WINGDIAPI void APIENTRY glTexCoord4fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
-WINGDIAPI void APIENTRY glTexCoord4iv (const GLint *v);
-WINGDIAPI void APIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
-WINGDIAPI void APIENTRY glTexCoord4sv (const GLshort *v);
-WINGDIAPI void APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-WINGDIAPI void APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param);
-WINGDIAPI void APIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params);
-WINGDIAPI void APIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-WINGDIAPI void APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-WINGDIAPI void APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-WINGDIAPI void APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-WINGDIAPI void APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-WINGDIAPI void APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-WINGDIAPI void APIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-WINGDIAPI void APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-WINGDIAPI void APIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z);
-WINGDIAPI void APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
-WINGDIAPI void APIENTRY glVertex2d (GLdouble x, GLdouble y);
-WINGDIAPI void APIENTRY glVertex2dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glVertex2f (GLfloat x, GLfloat y);
-WINGDIAPI void APIENTRY glVertex2fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glVertex2i (GLint x, GLint y);
-WINGDIAPI void APIENTRY glVertex2iv (const GLint *v);
-WINGDIAPI void APIENTRY glVertex2s (GLshort x, GLshort y);
-WINGDIAPI void APIENTRY glVertex2sv (const GLshort *v);
-WINGDIAPI void APIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z);
-WINGDIAPI void APIENTRY glVertex3dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z);
-WINGDIAPI void APIENTRY glVertex3fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glVertex3i (GLint x, GLint y, GLint z);
-WINGDIAPI void APIENTRY glVertex3iv (const GLint *v);
-WINGDIAPI void APIENTRY glVertex3s (GLshort x, GLshort y, GLshort z);
-WINGDIAPI void APIENTRY glVertex3sv (const GLshort *v);
-WINGDIAPI void APIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-WINGDIAPI void APIENTRY glVertex4dv (const GLdouble *v);
-WINGDIAPI void APIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-WINGDIAPI void APIENTRY glVertex4fv (const GLfloat *v);
-WINGDIAPI void APIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w);
-WINGDIAPI void APIENTRY glVertex4iv (const GLint *v);
-WINGDIAPI void APIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
-WINGDIAPI void APIENTRY glVertex4sv (const GLshort *v);
-WINGDIAPI void APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-WINGDIAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-
-/* EXT_vertex_array */
-typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRY * PFNGLARRAYELEMENTARRAYEXTPROC)(GLenum mode, GLsizei count, const GLvoid* pi);
-
-/* WIN_draw_range_elements */
-typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSWINPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-
-/* WIN_swap_hint */
-typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-
-/* EXT_paletted_texture */
-typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC)
- (GLenum target, GLenum internalFormat, GLsizei width, GLenum format,
- GLenum type, const GLvoid *data);
-typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC)
- (GLenum target, GLsizei start, GLsizei count, GLenum format,
- GLenum type, const GLvoid *data);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC)
- (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)
- (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)
- (GLenum target, GLenum pname, GLfloat *params);
-
-#ifdef __cplusplus
-}
-#endif
-
-#if !defined (_WIN32)
-#undef WINGDIAPI
-#undef APIENTRY
-#endif
-
-#endif /* __GL_H__ */
-#endif /* __gl_h_ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glcorearb.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glcorearb.h
deleted file mode 100644
index 07cb03e1..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glcorearb.h
+++ /dev/null
@@ -1,4533 +0,0 @@
-#ifndef __glcorearb_h_
-#define __glcorearb_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2007-2012 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-/* glcorearb.h replaces gl3.h. It is for use with OpenGL core
- * profile implementations.
- *
- * glcorearb.h last updated on $Date: 2012-09-19 19:02:24 -0700 (Wed, 19 Sep 2012) $
- *
- * RELEASE NOTES - 2012/09/19
- *
- * glcorearb.h should be placed in the same directory as gl.h and
- * included as
- * '<GL/glcorearb.h>'.
- *
- * glcorearb.h includes only APIs in the latest OpenGL core profile
- * implementation together with APIs in newer ARB extensions which can be
- * can be supported by the core profile. It does not, and never will
- * include functionality removed from the core profile, such as
- * fixed-function vertex and fragment processing.
- *
- * It is not possible to #include both <GL/glcorearb.h> and either of
- * <GL/gl.h> or <GL/glext.h> in the same source file.
- *
- * Feedback can be given by registering for the Khronos Bugzilla
- * (www.khronos.org/bugzilla) and filing issues there under product
- * "OpenGL", category "Registry".
- */
-
-/* Function declaration macros - to move into glplatform.h */
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/* Base GL types */
-
-typedef unsigned int GLenum;
-typedef unsigned char GLboolean;
-typedef unsigned int GLbitfield;
-typedef signed char GLbyte;
-typedef short GLshort;
-typedef int GLint;
-typedef int GLsizei;
-typedef unsigned char GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned int GLuint;
-typedef unsigned short GLhalf;
-typedef float GLfloat;
-typedef float GLclampf;
-typedef double GLdouble;
-typedef double GLclampd;
-typedef void GLvoid;
-
-/*************************************************************/
-
-#ifndef GL_VERSION_1_1
-/* AttribMask */
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_COLOR_BUFFER_BIT 0x00004000
-/* Boolean */
-#define GL_FALSE 0
-#define GL_TRUE 1
-/* BeginMode */
-#define GL_POINTS 0x0000
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_LINE_STRIP 0x0003
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_QUADS 0x0007
-/* AlphaFunction */
-#define GL_NEVER 0x0200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-/* BlendingFactorDest */
-#define GL_ZERO 0
-#define GL_ONE 1
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-/* BlendingFactorSrc */
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-/* DrawBufferMode */
-#define GL_NONE 0
-#define GL_FRONT_LEFT 0x0400
-#define GL_FRONT_RIGHT 0x0401
-#define GL_BACK_LEFT 0x0402
-#define GL_BACK_RIGHT 0x0403
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_LEFT 0x0406
-#define GL_RIGHT 0x0407
-#define GL_FRONT_AND_BACK 0x0408
-/* ErrorCode */
-#define GL_NO_ERROR 0
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_OUT_OF_MEMORY 0x0505
-/* FrontFaceDirection */
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-/* GetPName */
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_RANGE 0x0B12
-#define GL_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_LINE_WIDTH 0x0B21
-#define GL_LINE_WIDTH_RANGE 0x0B22
-#define GL_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_POLYGON_MODE 0x0B40
-#define GL_POLYGON_SMOOTH 0x0B41
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_VIEWPORT 0x0BA2
-#define GL_DITHER 0x0BD0
-#define GL_BLEND_DST 0x0BE0
-#define GL_BLEND_SRC 0x0BE1
-#define GL_BLEND 0x0BE2
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_DRAW_BUFFER 0x0C01
-#define GL_READ_BUFFER 0x0C02
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_DOUBLEBUFFER 0x0C32
-#define GL_STEREO 0x0C33
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_UNPACK_SWAP_BYTES 0x0CF0
-#define GL_UNPACK_LSB_FIRST 0x0CF1
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_SWAP_BYTES 0x0D00
-#define GL_PACK_LSB_FIRST 0x0D01
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
-/* GetTextureParameter */
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-/* HintMode */
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-/* DataType */
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_DOUBLE 0x140A
-/* ErrorCode */
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-/* LogicOp */
-#define GL_CLEAR 0x1500
-#define GL_AND 0x1501
-#define GL_AND_REVERSE 0x1502
-#define GL_COPY 0x1503
-#define GL_AND_INVERTED 0x1504
-#define GL_NOOP 0x1505
-#define GL_XOR 0x1506
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_EQUIV 0x1509
-#define GL_INVERT 0x150A
-#define GL_OR_REVERSE 0x150B
-#define GL_COPY_INVERTED 0x150C
-#define GL_OR_INVERTED 0x150D
-#define GL_NAND 0x150E
-#define GL_SET 0x150F
-/* MatrixMode (for gl3.h, FBO attachment type) */
-#define GL_TEXTURE 0x1702
-/* PixelCopyType */
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-/* PixelFormat */
-#define GL_STENCIL_INDEX 0x1901
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-/* PolygonMode */
-#define GL_POINT 0x1B00
-#define GL_LINE 0x1B01
-#define GL_FILL 0x1B02
-/* StencilOp */
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-/* StringName */
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-/* TextureMagFilter */
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-/* TextureMinFilter */
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-/* TextureParameterName */
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-/* TextureTarget */
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-/* TextureWrapMode */
-#define GL_REPEAT 0x2901
-/* PixelInternalFormat */
-#define GL_R3_G3_B2 0x2A10
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#endif
-
-#ifndef GL_ARB_imaging
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CLAMP_TO_BORDER 0x812D
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-#define GL_SRC1_ALPHA 0x8589
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB_ALPHA 0x8C42
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_COMPRESSED_SRGB 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#endif
-
-#ifndef GL_VERSION_3_0
-#define GL_COMPARE_REF_TO_TEXTURE 0x884E
-#define GL_CLIP_DISTANCE0 0x3000
-#define GL_CLIP_DISTANCE1 0x3001
-#define GL_CLIP_DISTANCE2 0x3002
-#define GL_CLIP_DISTANCE3 0x3003
-#define GL_CLIP_DISTANCE4 0x3004
-#define GL_CLIP_DISTANCE5 0x3005
-#define GL_CLIP_DISTANCE6 0x3006
-#define GL_CLIP_DISTANCE7 0x3007
-#define GL_MAX_CLIP_DISTANCES 0x0D32
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_CONTEXT_FLAGS 0x821E
-#define GL_COMPRESSED_RED 0x8225
-#define GL_COMPRESSED_RG 0x8226
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_CLAMP_READ_COLOR 0x891C
-#define GL_FIXED_ONLY 0x891D
-#define GL_MAX_VARYING_COMPONENTS 0x8B4B
-#define GL_TEXTURE_1D_ARRAY 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_PRIMITIVES_GENERATED 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_GREEN_INTEGER 0x8D95
-#define GL_BLUE_INTEGER 0x8D96
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_BGR_INTEGER 0x8D9A
-#define GL_BGRA_INTEGER 0x8D9B
-#define GL_SAMPLER_1D_ARRAY 0x8DC0
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_1D 0x8DC9
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_QUERY_WAIT 0x8E13
-#define GL_QUERY_NO_WAIT 0x8E14
-#define GL_QUERY_BY_REGION_WAIT 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-/* Reuse tokens from ARB_depth_buffer_float */
-/* reuse GL_DEPTH_COMPONENT32F */
-/* reuse GL_DEPTH32F_STENCIL8 */
-/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
-/* Reuse tokens from ARB_framebuffer_object */
-/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
-/* reuse GL_FRAMEBUFFER_DEFAULT */
-/* reuse GL_FRAMEBUFFER_UNDEFINED */
-/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
-/* reuse GL_INDEX */
-/* reuse GL_MAX_RENDERBUFFER_SIZE */
-/* reuse GL_DEPTH_STENCIL */
-/* reuse GL_UNSIGNED_INT_24_8 */
-/* reuse GL_DEPTH24_STENCIL8 */
-/* reuse GL_TEXTURE_STENCIL_SIZE */
-/* reuse GL_TEXTURE_RED_TYPE */
-/* reuse GL_TEXTURE_GREEN_TYPE */
-/* reuse GL_TEXTURE_BLUE_TYPE */
-/* reuse GL_TEXTURE_ALPHA_TYPE */
-/* reuse GL_TEXTURE_DEPTH_TYPE */
-/* reuse GL_UNSIGNED_NORMALIZED */
-/* reuse GL_FRAMEBUFFER_BINDING */
-/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
-/* reuse GL_RENDERBUFFER_BINDING */
-/* reuse GL_READ_FRAMEBUFFER */
-/* reuse GL_DRAW_FRAMEBUFFER */
-/* reuse GL_READ_FRAMEBUFFER_BINDING */
-/* reuse GL_RENDERBUFFER_SAMPLES */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-/* reuse GL_FRAMEBUFFER_COMPLETE */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
-/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
-/* reuse GL_MAX_COLOR_ATTACHMENTS */
-/* reuse GL_COLOR_ATTACHMENT0 */
-/* reuse GL_COLOR_ATTACHMENT1 */
-/* reuse GL_COLOR_ATTACHMENT2 */
-/* reuse GL_COLOR_ATTACHMENT3 */
-/* reuse GL_COLOR_ATTACHMENT4 */
-/* reuse GL_COLOR_ATTACHMENT5 */
-/* reuse GL_COLOR_ATTACHMENT6 */
-/* reuse GL_COLOR_ATTACHMENT7 */
-/* reuse GL_COLOR_ATTACHMENT8 */
-/* reuse GL_COLOR_ATTACHMENT9 */
-/* reuse GL_COLOR_ATTACHMENT10 */
-/* reuse GL_COLOR_ATTACHMENT11 */
-/* reuse GL_COLOR_ATTACHMENT12 */
-/* reuse GL_COLOR_ATTACHMENT13 */
-/* reuse GL_COLOR_ATTACHMENT14 */
-/* reuse GL_COLOR_ATTACHMENT15 */
-/* reuse GL_DEPTH_ATTACHMENT */
-/* reuse GL_STENCIL_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER */
-/* reuse GL_RENDERBUFFER */
-/* reuse GL_RENDERBUFFER_WIDTH */
-/* reuse GL_RENDERBUFFER_HEIGHT */
-/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
-/* reuse GL_STENCIL_INDEX1 */
-/* reuse GL_STENCIL_INDEX4 */
-/* reuse GL_STENCIL_INDEX8 */
-/* reuse GL_STENCIL_INDEX16 */
-/* reuse GL_RENDERBUFFER_RED_SIZE */
-/* reuse GL_RENDERBUFFER_GREEN_SIZE */
-/* reuse GL_RENDERBUFFER_BLUE_SIZE */
-/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
-/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
-/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
-/* reuse GL_MAX_SAMPLES */
-/* Reuse tokens from ARB_framebuffer_sRGB */
-/* reuse GL_FRAMEBUFFER_SRGB */
-/* Reuse tokens from ARB_half_float_vertex */
-/* reuse GL_HALF_FLOAT */
-/* Reuse tokens from ARB_map_buffer_range */
-/* reuse GL_MAP_READ_BIT */
-/* reuse GL_MAP_WRITE_BIT */
-/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
-/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
-/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
-/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
-/* Reuse tokens from ARB_texture_compression_rgtc */
-/* reuse GL_COMPRESSED_RED_RGTC1 */
-/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
-/* reuse GL_COMPRESSED_RG_RGTC2 */
-/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
-/* Reuse tokens from ARB_texture_rg */
-/* reuse GL_RG */
-/* reuse GL_RG_INTEGER */
-/* reuse GL_R8 */
-/* reuse GL_R16 */
-/* reuse GL_RG8 */
-/* reuse GL_RG16 */
-/* reuse GL_R16F */
-/* reuse GL_R32F */
-/* reuse GL_RG16F */
-/* reuse GL_RG32F */
-/* reuse GL_R8I */
-/* reuse GL_R8UI */
-/* reuse GL_R16I */
-/* reuse GL_R16UI */
-/* reuse GL_R32I */
-/* reuse GL_R32UI */
-/* reuse GL_RG8I */
-/* reuse GL_RG8UI */
-/* reuse GL_RG16I */
-/* reuse GL_RG16UI */
-/* reuse GL_RG32I */
-/* reuse GL_RG32UI */
-/* Reuse tokens from ARB_vertex_array_object */
-/* reuse GL_VERTEX_ARRAY_BINDING */
-#endif
-
-#ifndef GL_VERSION_3_1
-#define GL_SAMPLER_2D_RECT 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
-#define GL_SAMPLER_BUFFER 0x8DC2
-#define GL_INT_SAMPLER_2D_RECT 0x8DCD
-#define GL_INT_SAMPLER_BUFFER 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
-#define GL_TEXTURE_BUFFER 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_RECTANGLE 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART 0x8F9D
-#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
-/* Reuse tokens from ARB_copy_buffer */
-/* reuse GL_COPY_READ_BUFFER */
-/* reuse GL_COPY_WRITE_BUFFER */
-/* Reuse tokens from ARB_draw_instanced (none) */
-/* Reuse tokens from ARB_uniform_buffer_object */
-/* reuse GL_UNIFORM_BUFFER */
-/* reuse GL_UNIFORM_BUFFER_BINDING */
-/* reuse GL_UNIFORM_BUFFER_START */
-/* reuse GL_UNIFORM_BUFFER_SIZE */
-/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
-/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
-/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
-/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
-/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
-/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
-/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
-/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
-/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
-/* reuse GL_UNIFORM_TYPE */
-/* reuse GL_UNIFORM_SIZE */
-/* reuse GL_UNIFORM_NAME_LENGTH */
-/* reuse GL_UNIFORM_BLOCK_INDEX */
-/* reuse GL_UNIFORM_OFFSET */
-/* reuse GL_UNIFORM_ARRAY_STRIDE */
-/* reuse GL_UNIFORM_MATRIX_STRIDE */
-/* reuse GL_UNIFORM_IS_ROW_MAJOR */
-/* reuse GL_UNIFORM_BLOCK_BINDING */
-/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
-/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
-/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
-/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
-/* reuse GL_INVALID_INDEX */
-#endif
-
-#ifndef GL_VERSION_3_2
-#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define GL_LINES_ADJACENCY 0x000A
-#define GL_LINE_STRIP_ADJACENCY 0x000B
-#define GL_TRIANGLES_ADJACENCY 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
-#define GL_PROGRAM_POINT_SIZE 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_GEOMETRY_SHADER 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT 0x8916
-#define GL_GEOMETRY_INPUT_TYPE 0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_CONTEXT_PROFILE_MASK 0x9126
-/* reuse GL_MAX_VARYING_COMPONENTS */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-/* Reuse tokens from ARB_depth_clamp */
-/* reuse GL_DEPTH_CLAMP */
-/* Reuse tokens from ARB_draw_elements_base_vertex (none) */
-/* Reuse tokens from ARB_fragment_coord_conventions (none) */
-/* Reuse tokens from ARB_provoking_vertex */
-/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
-/* reuse GL_FIRST_VERTEX_CONVENTION */
-/* reuse GL_LAST_VERTEX_CONVENTION */
-/* reuse GL_PROVOKING_VERTEX */
-/* Reuse tokens from ARB_seamless_cube_map */
-/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
-/* Reuse tokens from ARB_sync */
-/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */
-/* reuse GL_OBJECT_TYPE */
-/* reuse GL_SYNC_CONDITION */
-/* reuse GL_SYNC_STATUS */
-/* reuse GL_SYNC_FLAGS */
-/* reuse GL_SYNC_FENCE */
-/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */
-/* reuse GL_UNSIGNALED */
-/* reuse GL_SIGNALED */
-/* reuse GL_ALREADY_SIGNALED */
-/* reuse GL_TIMEOUT_EXPIRED */
-/* reuse GL_CONDITION_SATISFIED */
-/* reuse GL_WAIT_FAILED */
-/* reuse GL_TIMEOUT_IGNORED */
-/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */
-/* reuse GL_TIMEOUT_IGNORED */
-/* Reuse tokens from ARB_texture_multisample */
-/* reuse GL_SAMPLE_POSITION */
-/* reuse GL_SAMPLE_MASK */
-/* reuse GL_SAMPLE_MASK_VALUE */
-/* reuse GL_MAX_SAMPLE_MASK_WORDS */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_SAMPLES */
-/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */
-/* reuse GL_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */
-/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */
-/* reuse GL_MAX_INTEGER_SAMPLES */
-/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */
-#endif
-
-#ifndef GL_VERSION_3_3
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-/* Reuse tokens from ARB_blend_func_extended */
-/* reuse GL_SRC1_COLOR */
-/* reuse GL_ONE_MINUS_SRC1_COLOR */
-/* reuse GL_ONE_MINUS_SRC1_ALPHA */
-/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */
-/* Reuse tokens from ARB_explicit_attrib_location (none) */
-/* Reuse tokens from ARB_occlusion_query2 */
-/* reuse GL_ANY_SAMPLES_PASSED */
-/* Reuse tokens from ARB_sampler_objects */
-/* reuse GL_SAMPLER_BINDING */
-/* Reuse tokens from ARB_shader_bit_encoding (none) */
-/* Reuse tokens from ARB_texture_rgb10_a2ui */
-/* reuse GL_RGB10_A2UI */
-/* Reuse tokens from ARB_texture_swizzle */
-/* reuse GL_TEXTURE_SWIZZLE_R */
-/* reuse GL_TEXTURE_SWIZZLE_G */
-/* reuse GL_TEXTURE_SWIZZLE_B */
-/* reuse GL_TEXTURE_SWIZZLE_A */
-/* reuse GL_TEXTURE_SWIZZLE_RGBA */
-/* Reuse tokens from ARB_timer_query */
-/* reuse GL_TIME_ELAPSED */
-/* reuse GL_TIMESTAMP */
-/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */
-/* reuse GL_INT_2_10_10_10_REV */
-#endif
-
-#ifndef GL_VERSION_4_0
-#define GL_SAMPLE_SHADING 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-/* Reuse tokens from ARB_texture_query_lod (none) */
-/* Reuse tokens from ARB_draw_buffers_blend (none) */
-/* Reuse tokens from ARB_draw_indirect */
-/* reuse GL_DRAW_INDIRECT_BUFFER */
-/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */
-/* Reuse tokens from ARB_gpu_shader5 */
-/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */
-/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */
-/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */
-/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */
-/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */
-/* reuse GL_MAX_VERTEX_STREAMS */
-/* Reuse tokens from ARB_gpu_shader_fp64 */
-/* reuse GL_DOUBLE_VEC2 */
-/* reuse GL_DOUBLE_VEC3 */
-/* reuse GL_DOUBLE_VEC4 */
-/* reuse GL_DOUBLE_MAT2 */
-/* reuse GL_DOUBLE_MAT3 */
-/* reuse GL_DOUBLE_MAT4 */
-/* reuse GL_DOUBLE_MAT2x3 */
-/* reuse GL_DOUBLE_MAT2x4 */
-/* reuse GL_DOUBLE_MAT3x2 */
-/* reuse GL_DOUBLE_MAT3x4 */
-/* reuse GL_DOUBLE_MAT4x2 */
-/* reuse GL_DOUBLE_MAT4x3 */
-/* Reuse tokens from ARB_shader_subroutine */
-/* reuse GL_ACTIVE_SUBROUTINES */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */
-/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */
-/* reuse GL_MAX_SUBROUTINES */
-/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */
-/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
-/* reuse GL_COMPATIBLE_SUBROUTINES */
-/* Reuse tokens from ARB_tessellation_shader */
-/* reuse GL_PATCHES */
-/* reuse GL_PATCH_VERTICES */
-/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */
-/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */
-/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */
-/* reuse GL_TESS_GEN_MODE */
-/* reuse GL_TESS_GEN_SPACING */
-/* reuse GL_TESS_GEN_VERTEX_ORDER */
-/* reuse GL_TESS_GEN_POINT_MODE */
-/* reuse GL_ISOLINES */
-/* reuse GL_FRACTIONAL_ODD */
-/* reuse GL_FRACTIONAL_EVEN */
-/* reuse GL_MAX_PATCH_VERTICES */
-/* reuse GL_MAX_TESS_GEN_LEVEL */
-/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_PATCH_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */
-/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */
-/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */
-/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */
-/* reuse GL_TESS_EVALUATION_SHADER */
-/* reuse GL_TESS_CONTROL_SHADER */
-/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */
-/* Reuse tokens from ARB_transform_feedback2 */
-/* reuse GL_TRANSFORM_FEEDBACK */
-/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
-/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
-/* reuse GL_TRANSFORM_FEEDBACK_BINDING */
-/* Reuse tokens from ARB_transform_feedback3 */
-/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */
-/* reuse GL_MAX_VERTEX_STREAMS */
-#endif
-
-#ifndef GL_VERSION_4_1
-/* Reuse tokens from ARB_ES2_compatibility */
-/* reuse GL_FIXED */
-/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */
-/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */
-/* reuse GL_LOW_FLOAT */
-/* reuse GL_MEDIUM_FLOAT */
-/* reuse GL_HIGH_FLOAT */
-/* reuse GL_LOW_INT */
-/* reuse GL_MEDIUM_INT */
-/* reuse GL_HIGH_INT */
-/* reuse GL_SHADER_COMPILER */
-/* reuse GL_SHADER_BINARY_FORMATS */
-/* reuse GL_NUM_SHADER_BINARY_FORMATS */
-/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */
-/* reuse GL_MAX_VARYING_VECTORS */
-/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */
-/* reuse GL_RGB565 */
-/* Reuse tokens from ARB_get_program_binary */
-/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
-/* reuse GL_PROGRAM_BINARY_LENGTH */
-/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */
-/* reuse GL_PROGRAM_BINARY_FORMATS */
-/* Reuse tokens from ARB_separate_shader_objects */
-/* reuse GL_VERTEX_SHADER_BIT */
-/* reuse GL_FRAGMENT_SHADER_BIT */
-/* reuse GL_GEOMETRY_SHADER_BIT */
-/* reuse GL_TESS_CONTROL_SHADER_BIT */
-/* reuse GL_TESS_EVALUATION_SHADER_BIT */
-/* reuse GL_ALL_SHADER_BITS */
-/* reuse GL_PROGRAM_SEPARABLE */
-/* reuse GL_ACTIVE_PROGRAM */
-/* reuse GL_PROGRAM_PIPELINE_BINDING */
-/* Reuse tokens from ARB_shader_precision (none) */
-/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */
-/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */
-/* reuse GL_MAX_VIEWPORTS */
-/* reuse GL_VIEWPORT_SUBPIXEL_BITS */
-/* reuse GL_VIEWPORT_BOUNDS_RANGE */
-/* reuse GL_LAYER_PROVOKING_VERTEX */
-/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */
-/* reuse GL_UNDEFINED_VERTEX */
-#endif
-
-#ifndef GL_VERSION_4_2
-/* Reuse tokens from ARB_base_instance (none) */
-/* Reuse tokens from ARB_shading_language_420pack (none) */
-/* Reuse tokens from ARB_transform_feedback_instanced (none) */
-/* Reuse tokens from ARB_compressed_texture_pixel_storage */
-/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */
-/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */
-/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */
-/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */
-/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */
-/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */
-/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */
-/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */
-/* Reuse tokens from ARB_conservative_depth (none) */
-/* Reuse tokens from ARB_internalformat_query */
-/* reuse GL_NUM_SAMPLE_COUNTS */
-/* Reuse tokens from ARB_map_buffer_alignment */
-/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */
-/* Reuse tokens from ARB_shader_atomic_counters */
-/* reuse GL_ATOMIC_COUNTER_BUFFER */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_START */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */
-/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */
-/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */
-/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */
-/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */
-/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */
-/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */
-/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */
-/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */
-/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */
-/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */
-/* Reuse tokens from ARB_shader_image_load_store */
-/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */
-/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */
-/* reuse GL_UNIFORM_BARRIER_BIT */
-/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */
-/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */
-/* reuse GL_COMMAND_BARRIER_BIT */
-/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */
-/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */
-/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */
-/* reuse GL_FRAMEBUFFER_BARRIER_BIT */
-/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */
-/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */
-/* reuse GL_ALL_BARRIER_BITS */
-/* reuse GL_MAX_IMAGE_UNITS */
-/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */
-/* reuse GL_IMAGE_BINDING_NAME */
-/* reuse GL_IMAGE_BINDING_LEVEL */
-/* reuse GL_IMAGE_BINDING_LAYERED */
-/* reuse GL_IMAGE_BINDING_LAYER */
-/* reuse GL_IMAGE_BINDING_ACCESS */
-/* reuse GL_IMAGE_1D */
-/* reuse GL_IMAGE_2D */
-/* reuse GL_IMAGE_3D */
-/* reuse GL_IMAGE_2D_RECT */
-/* reuse GL_IMAGE_CUBE */
-/* reuse GL_IMAGE_BUFFER */
-/* reuse GL_IMAGE_1D_ARRAY */
-/* reuse GL_IMAGE_2D_ARRAY */
-/* reuse GL_IMAGE_CUBE_MAP_ARRAY */
-/* reuse GL_IMAGE_2D_MULTISAMPLE */
-/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_INT_IMAGE_1D */
-/* reuse GL_INT_IMAGE_2D */
-/* reuse GL_INT_IMAGE_3D */
-/* reuse GL_INT_IMAGE_2D_RECT */
-/* reuse GL_INT_IMAGE_CUBE */
-/* reuse GL_INT_IMAGE_BUFFER */
-/* reuse GL_INT_IMAGE_1D_ARRAY */
-/* reuse GL_INT_IMAGE_2D_ARRAY */
-/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */
-/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */
-/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_UNSIGNED_INT_IMAGE_1D */
-/* reuse GL_UNSIGNED_INT_IMAGE_2D */
-/* reuse GL_UNSIGNED_INT_IMAGE_3D */
-/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */
-/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */
-/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */
-/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */
-/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */
-/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */
-/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */
-/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_MAX_IMAGE_SAMPLES */
-/* reuse GL_IMAGE_BINDING_FORMAT */
-/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */
-/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */
-/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */
-/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */
-/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */
-/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */
-/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */
-/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */
-/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */
-/* Reuse tokens from ARB_shading_language_packing (none) */
-/* Reuse tokens from ARB_texture_storage */
-/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */
-#endif
-
-#ifndef GL_VERSION_4_3
-#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9
-#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E
-/* Reuse tokens from ARB_arrays_of_arrays (none, GLSL only) */
-/* Reuse tokens from ARB_fragment_layer_viewport (none, GLSL only) */
-/* Reuse tokens from ARB_shader_image_size (none, GLSL only) */
-/* Reuse tokens from ARB_ES3_compatibility */
-/* reuse GL_COMPRESSED_RGB8_ETC2 */
-/* reuse GL_COMPRESSED_SRGB8_ETC2 */
-/* reuse GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */
-/* reuse GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */
-/* reuse GL_COMPRESSED_RGBA8_ETC2_EAC */
-/* reuse GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */
-/* reuse GL_COMPRESSED_R11_EAC */
-/* reuse GL_COMPRESSED_SIGNED_R11_EAC */
-/* reuse GL_COMPRESSED_RG11_EAC */
-/* reuse GL_COMPRESSED_SIGNED_RG11_EAC */
-/* reuse GL_PRIMITIVE_RESTART_FIXED_INDEX */
-/* reuse GL_ANY_SAMPLES_PASSED_CONSERVATIVE */
-/* reuse GL_MAX_ELEMENT_INDEX */
-/* Reuse tokens from ARB_clear_buffer_object (none) */
-/* Reuse tokens from ARB_compute_shader */
-/* reuse GL_COMPUTE_SHADER */
-/* reuse GL_MAX_COMPUTE_UNIFORM_BLOCKS */
-/* reuse GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_COMPUTE_IMAGE_UNIFORMS */
-/* reuse GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */
-/* reuse GL_MAX_COMPUTE_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS */
-/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTERS */
-/* reuse GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMPUTE_LOCAL_INVOCATIONS */
-/* reuse GL_MAX_COMPUTE_WORK_GROUP_COUNT */
-/* reuse GL_MAX_COMPUTE_WORK_GROUP_SIZE */
-/* reuse GL_COMPUTE_LOCAL_WORK_SIZE */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER */
-/* reuse GL_DISPATCH_INDIRECT_BUFFER */
-/* reuse GL_DISPATCH_INDIRECT_BUFFER_BINDING */
-/* Reuse tokens from ARB_copy_image (none) */
-/* Reuse tokens from KHR_debug */
-/* reuse GL_DEBUG_OUTPUT_SYNCHRONOUS */
-/* reuse GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH */
-/* reuse GL_DEBUG_CALLBACK_FUNCTION */
-/* reuse GL_DEBUG_CALLBACK_USER_PARAM */
-/* reuse GL_DEBUG_SOURCE_API */
-/* reuse GL_DEBUG_SOURCE_WINDOW_SYSTEM */
-/* reuse GL_DEBUG_SOURCE_SHADER_COMPILER */
-/* reuse GL_DEBUG_SOURCE_THIRD_PARTY */
-/* reuse GL_DEBUG_SOURCE_APPLICATION */
-/* reuse GL_DEBUG_SOURCE_OTHER */
-/* reuse GL_DEBUG_TYPE_ERROR */
-/* reuse GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR */
-/* reuse GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR */
-/* reuse GL_DEBUG_TYPE_PORTABILITY */
-/* reuse GL_DEBUG_TYPE_PERFORMANCE */
-/* reuse GL_DEBUG_TYPE_OTHER */
-/* reuse GL_MAX_DEBUG_MESSAGE_LENGTH */
-/* reuse GL_MAX_DEBUG_LOGGED_MESSAGES */
-/* reuse GL_DEBUG_LOGGED_MESSAGES */
-/* reuse GL_DEBUG_SEVERITY_HIGH */
-/* reuse GL_DEBUG_SEVERITY_MEDIUM */
-/* reuse GL_DEBUG_SEVERITY_LOW */
-/* reuse GL_DEBUG_TYPE_MARKER */
-/* reuse GL_DEBUG_TYPE_PUSH_GROUP */
-/* reuse GL_DEBUG_TYPE_POP_GROUP */
-/* reuse GL_DEBUG_SEVERITY_NOTIFICATION */
-/* reuse GL_MAX_DEBUG_GROUP_STACK_DEPTH */
-/* reuse GL_DEBUG_GROUP_STACK_DEPTH */
-/* reuse GL_BUFFER */
-/* reuse GL_SHADER */
-/* reuse GL_PROGRAM */
-/* reuse GL_QUERY */
-/* reuse GL_PROGRAM_PIPELINE */
-/* reuse GL_SAMPLER */
-/* reuse GL_DISPLAY_LIST */
-/* reuse GL_MAX_LABEL_LENGTH */
-/* reuse GL_DEBUG_OUTPUT */
-/* reuse GL_CONTEXT_FLAG_DEBUG_BIT */
-/* reuse GL_STACK_UNDERFLOW */
-/* reuse GL_STACK_OVERFLOW */
-/* Reuse tokens from ARB_explicit_uniform_location */
-/* reuse GL_MAX_UNIFORM_LOCATIONS */
-/* Reuse tokens from ARB_framebuffer_no_attachments */
-/* reuse GL_FRAMEBUFFER_DEFAULT_WIDTH */
-/* reuse GL_FRAMEBUFFER_DEFAULT_HEIGHT */
-/* reuse GL_FRAMEBUFFER_DEFAULT_LAYERS */
-/* reuse GL_FRAMEBUFFER_DEFAULT_SAMPLES */
-/* reuse GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS */
-/* reuse GL_MAX_FRAMEBUFFER_WIDTH */
-/* reuse GL_MAX_FRAMEBUFFER_HEIGHT */
-/* reuse GL_MAX_FRAMEBUFFER_LAYERS */
-/* reuse GL_MAX_FRAMEBUFFER_SAMPLES */
-/* Reuse tokens from ARB_internalformat_query2 */
-/* reuse GL_INTERNALFORMAT_SUPPORTED */
-/* reuse GL_INTERNALFORMAT_PREFERRED */
-/* reuse GL_INTERNALFORMAT_RED_SIZE */
-/* reuse GL_INTERNALFORMAT_GREEN_SIZE */
-/* reuse GL_INTERNALFORMAT_BLUE_SIZE */
-/* reuse GL_INTERNALFORMAT_ALPHA_SIZE */
-/* reuse GL_INTERNALFORMAT_DEPTH_SIZE */
-/* reuse GL_INTERNALFORMAT_STENCIL_SIZE */
-/* reuse GL_INTERNALFORMAT_SHARED_SIZE */
-/* reuse GL_INTERNALFORMAT_RED_TYPE */
-/* reuse GL_INTERNALFORMAT_GREEN_TYPE */
-/* reuse GL_INTERNALFORMAT_BLUE_TYPE */
-/* reuse GL_INTERNALFORMAT_ALPHA_TYPE */
-/* reuse GL_INTERNALFORMAT_DEPTH_TYPE */
-/* reuse GL_INTERNALFORMAT_STENCIL_TYPE */
-/* reuse GL_MAX_WIDTH */
-/* reuse GL_MAX_HEIGHT */
-/* reuse GL_MAX_DEPTH */
-/* reuse GL_MAX_LAYERS */
-/* reuse GL_MAX_COMBINED_DIMENSIONS */
-/* reuse GL_COLOR_COMPONENTS */
-/* reuse GL_DEPTH_COMPONENTS */
-/* reuse GL_STENCIL_COMPONENTS */
-/* reuse GL_COLOR_RENDERABLE */
-/* reuse GL_DEPTH_RENDERABLE */
-/* reuse GL_STENCIL_RENDERABLE */
-/* reuse GL_FRAMEBUFFER_RENDERABLE */
-/* reuse GL_FRAMEBUFFER_RENDERABLE_LAYERED */
-/* reuse GL_FRAMEBUFFER_BLEND */
-/* reuse GL_READ_PIXELS */
-/* reuse GL_READ_PIXELS_FORMAT */
-/* reuse GL_READ_PIXELS_TYPE */
-/* reuse GL_TEXTURE_IMAGE_FORMAT */
-/* reuse GL_TEXTURE_IMAGE_TYPE */
-/* reuse GL_GET_TEXTURE_IMAGE_FORMAT */
-/* reuse GL_GET_TEXTURE_IMAGE_TYPE */
-/* reuse GL_MIPMAP */
-/* reuse GL_MANUAL_GENERATE_MIPMAP */
-/* reuse GL_AUTO_GENERATE_MIPMAP */
-/* reuse GL_COLOR_ENCODING */
-/* reuse GL_SRGB_READ */
-/* reuse GL_SRGB_WRITE */
-/* reuse GL_FILTER */
-/* reuse GL_VERTEX_TEXTURE */
-/* reuse GL_TESS_CONTROL_TEXTURE */
-/* reuse GL_TESS_EVALUATION_TEXTURE */
-/* reuse GL_GEOMETRY_TEXTURE */
-/* reuse GL_FRAGMENT_TEXTURE */
-/* reuse GL_COMPUTE_TEXTURE */
-/* reuse GL_TEXTURE_SHADOW */
-/* reuse GL_TEXTURE_GATHER */
-/* reuse GL_TEXTURE_GATHER_SHADOW */
-/* reuse GL_SHADER_IMAGE_LOAD */
-/* reuse GL_SHADER_IMAGE_STORE */
-/* reuse GL_SHADER_IMAGE_ATOMIC */
-/* reuse GL_IMAGE_TEXEL_SIZE */
-/* reuse GL_IMAGE_COMPATIBILITY_CLASS */
-/* reuse GL_IMAGE_PIXEL_FORMAT */
-/* reuse GL_IMAGE_PIXEL_TYPE */
-/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST */
-/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST */
-/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE */
-/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE */
-/* reuse GL_TEXTURE_COMPRESSED_BLOCK_WIDTH */
-/* reuse GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT */
-/* reuse GL_TEXTURE_COMPRESSED_BLOCK_SIZE */
-/* reuse GL_CLEAR_BUFFER */
-/* reuse GL_TEXTURE_VIEW */
-/* reuse GL_VIEW_COMPATIBILITY_CLASS */
-/* reuse GL_FULL_SUPPORT */
-/* reuse GL_CAVEAT_SUPPORT */
-/* reuse GL_IMAGE_CLASS_4_X_32 */
-/* reuse GL_IMAGE_CLASS_2_X_32 */
-/* reuse GL_IMAGE_CLASS_1_X_32 */
-/* reuse GL_IMAGE_CLASS_4_X_16 */
-/* reuse GL_IMAGE_CLASS_2_X_16 */
-/* reuse GL_IMAGE_CLASS_1_X_16 */
-/* reuse GL_IMAGE_CLASS_4_X_8 */
-/* reuse GL_IMAGE_CLASS_2_X_8 */
-/* reuse GL_IMAGE_CLASS_1_X_8 */
-/* reuse GL_IMAGE_CLASS_11_11_10 */
-/* reuse GL_IMAGE_CLASS_10_10_10_2 */
-/* reuse GL_VIEW_CLASS_128_BITS */
-/* reuse GL_VIEW_CLASS_96_BITS */
-/* reuse GL_VIEW_CLASS_64_BITS */
-/* reuse GL_VIEW_CLASS_48_BITS */
-/* reuse GL_VIEW_CLASS_32_BITS */
-/* reuse GL_VIEW_CLASS_24_BITS */
-/* reuse GL_VIEW_CLASS_16_BITS */
-/* reuse GL_VIEW_CLASS_8_BITS */
-/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGB */
-/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGBA */
-/* reuse GL_VIEW_CLASS_S3TC_DXT3_RGBA */
-/* reuse GL_VIEW_CLASS_S3TC_DXT5_RGBA */
-/* reuse GL_VIEW_CLASS_RGTC1_RED */
-/* reuse GL_VIEW_CLASS_RGTC2_RG */
-/* reuse GL_VIEW_CLASS_BPTC_UNORM */
-/* reuse GL_VIEW_CLASS_BPTC_FLOAT */
-/* Reuse tokens from ARB_invalidate_subdata (none) */
-/* Reuse tokens from ARB_multi_draw_indirect (none) */
-/* Reuse tokens from ARB_program_interface_query */
-/* reuse GL_UNIFORM */
-/* reuse GL_UNIFORM_BLOCK */
-/* reuse GL_PROGRAM_INPUT */
-/* reuse GL_PROGRAM_OUTPUT */
-/* reuse GL_BUFFER_VARIABLE */
-/* reuse GL_SHADER_STORAGE_BLOCK */
-/* reuse GL_VERTEX_SUBROUTINE */
-/* reuse GL_TESS_CONTROL_SUBROUTINE */
-/* reuse GL_TESS_EVALUATION_SUBROUTINE */
-/* reuse GL_GEOMETRY_SUBROUTINE */
-/* reuse GL_FRAGMENT_SUBROUTINE */
-/* reuse GL_COMPUTE_SUBROUTINE */
-/* reuse GL_VERTEX_SUBROUTINE_UNIFORM */
-/* reuse GL_TESS_CONTROL_SUBROUTINE_UNIFORM */
-/* reuse GL_TESS_EVALUATION_SUBROUTINE_UNIFORM */
-/* reuse GL_GEOMETRY_SUBROUTINE_UNIFORM */
-/* reuse GL_FRAGMENT_SUBROUTINE_UNIFORM */
-/* reuse GL_COMPUTE_SUBROUTINE_UNIFORM */
-/* reuse GL_TRANSFORM_FEEDBACK_VARYING */
-/* reuse GL_ACTIVE_RESOURCES */
-/* reuse GL_MAX_NAME_LENGTH */
-/* reuse GL_MAX_NUM_ACTIVE_VARIABLES */
-/* reuse GL_MAX_NUM_COMPATIBLE_SUBROUTINES */
-/* reuse GL_NAME_LENGTH */
-/* reuse GL_TYPE */
-/* reuse GL_ARRAY_SIZE */
-/* reuse GL_OFFSET */
-/* reuse GL_BLOCK_INDEX */
-/* reuse GL_ARRAY_STRIDE */
-/* reuse GL_MATRIX_STRIDE */
-/* reuse GL_IS_ROW_MAJOR */
-/* reuse GL_ATOMIC_COUNTER_BUFFER_INDEX */
-/* reuse GL_BUFFER_BINDING */
-/* reuse GL_BUFFER_DATA_SIZE */
-/* reuse GL_NUM_ACTIVE_VARIABLES */
-/* reuse GL_ACTIVE_VARIABLES */
-/* reuse GL_REFERENCED_BY_VERTEX_SHADER */
-/* reuse GL_REFERENCED_BY_TESS_CONTROL_SHADER */
-/* reuse GL_REFERENCED_BY_TESS_EVALUATION_SHADER */
-/* reuse GL_REFERENCED_BY_GEOMETRY_SHADER */
-/* reuse GL_REFERENCED_BY_FRAGMENT_SHADER */
-/* reuse GL_REFERENCED_BY_COMPUTE_SHADER */
-/* reuse GL_TOP_LEVEL_ARRAY_SIZE */
-/* reuse GL_TOP_LEVEL_ARRAY_STRIDE */
-/* reuse GL_LOCATION */
-/* reuse GL_LOCATION_INDEX */
-/* reuse GL_IS_PER_PATCH */
-/* Reuse tokens from ARB_robust_buffer_access_behavior (none) */
-/* Reuse tokens from ARB_shader_storage_buffer_object */
-/* reuse GL_SHADER_STORAGE_BUFFER */
-/* reuse GL_SHADER_STORAGE_BUFFER_BINDING */
-/* reuse GL_SHADER_STORAGE_BUFFER_START */
-/* reuse GL_SHADER_STORAGE_BUFFER_SIZE */
-/* reuse GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS */
-/* reuse GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS */
-/* reuse GL_MAX_SHADER_STORAGE_BLOCK_SIZE */
-/* reuse GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT */
-/* reuse GL_SHADER_STORAGE_BARRIER_BIT */
-/* reuse GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES */
-/* Reuse tokens from ARB_stencil_texturing */
-/* reuse GL_DEPTH_STENCIL_TEXTURE_MODE */
-/* Reuse tokens from ARB_texture_buffer_range */
-/* reuse GL_TEXTURE_BUFFER_OFFSET */
-/* reuse GL_TEXTURE_BUFFER_SIZE */
-/* reuse GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT */
-/* Reuse tokens from ARB_texture_query_levels (none) */
-/* Reuse tokens from ARB_texture_storage_multisample (none) */
-/* Reuse tokens from ARB_texture_view */
-/* reuse GL_TEXTURE_VIEW_MIN_LEVEL */
-/* reuse GL_TEXTURE_VIEW_NUM_LEVELS */
-/* reuse GL_TEXTURE_VIEW_MIN_LAYER */
-/* reuse GL_TEXTURE_VIEW_NUM_LAYERS */
-/* reuse GL_TEXTURE_IMMUTABLE_LEVELS */
-/* Reuse tokens from ARB_vertex_attrib_binding */
-/* reuse GL_VERTEX_ATTRIB_BINDING */
-/* reuse GL_VERTEX_ATTRIB_RELATIVE_OFFSET */
-/* reuse GL_VERTEX_BINDING_DIVISOR */
-/* reuse GL_VERTEX_BINDING_OFFSET */
-/* reuse GL_VERTEX_BINDING_STRIDE */
-/* reuse GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET */
-/* reuse GL_MAX_VERTEX_ATTRIB_BINDINGS */
-#endif
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#endif
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_STENCIL_INDEX1 0x8D46
-#define GL_STENCIL_INDEX4 0x8D47
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_STENCIL_INDEX16 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-#endif
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-#endif
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_HALF_FLOAT 0x140B
-#endif
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-#endif
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_COMPRESSED_RED_RGTC1 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
-#define GL_COMPRESSED_RG_RGTC2 0x8DBD
-#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
-#endif
-
-#ifndef GL_ARB_texture_rg
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_R16 0x822A
-#define GL_RG8 0x822B
-#define GL_RG16 0x822C
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-#endif
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-#endif
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFFu
-#endif
-
-#ifndef GL_ARB_copy_buffer
-#define GL_COPY_READ_BUFFER_BINDING 0x8F36
-#define GL_COPY_READ_BUFFER GL_COPY_READ_BUFFER_BINDING
-#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
-#define GL_COPY_WRITE_BUFFER GL_COPY_WRITE_BUFFER_BINDING
-#endif
-
-#ifndef GL_ARB_depth_clamp
-#define GL_DEPTH_CLAMP 0x864F
-#endif
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#endif
-
-#ifndef GL_ARB_fragment_coord_conventions
-#endif
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_PROVOKING_VERTEX 0x8E4F
-#endif
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-#endif
-
-#ifndef GL_ARB_sync
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#endif
-
-#ifndef GL_ARB_texture_multisample
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
-#define GL_MAX_INTEGER_SAMPLES 0x9110
-#endif
-
-#ifndef GL_ARB_vertex_array_bgra
-/* reuse GL_BGRA */
-#endif
-
-#ifndef GL_ARB_draw_buffers_blend
-#endif
-
-#ifndef GL_ARB_sample_shading
-#define GL_SAMPLE_SHADING_ARB 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
-#endif
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
-#endif
-
-#ifndef GL_ARB_texture_gather
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
-#endif
-
-#ifndef GL_ARB_texture_query_lod
-#endif
-
-#ifndef GL_ARB_shading_language_include
-#define GL_SHADER_INCLUDE_ARB 0x8DAE
-#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
-#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
-#endif
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-#endif
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_SRC1_COLOR 0x88F9
-/* reuse GL_SRC1_ALPHA */
-#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
-#endif
-
-#ifndef GL_ARB_explicit_attrib_location
-#endif
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#endif
-
-#ifndef GL_ARB_sampler_objects
-#define GL_SAMPLER_BINDING 0x8919
-#endif
-
-#ifndef GL_ARB_shader_bit_encoding
-#endif
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_RGB10_A2UI 0x906F
-#endif
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-#endif
-
-#ifndef GL_ARB_timer_query
-#define GL_TIME_ELAPSED 0x88BF
-#define GL_TIMESTAMP 0x8E28
-#endif
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */
-#define GL_INT_2_10_10_10_REV 0x8D9F
-#endif
-
-#ifndef GL_ARB_draw_indirect
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-#endif
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-/* reuse GL_MAX_VERTEX_STREAMS */
-#endif
-
-#ifndef GL_ARB_gpu_shader_fp64
-/* reuse GL_DOUBLE */
-#define GL_DOUBLE_VEC2 0x8FFC
-#define GL_DOUBLE_VEC3 0x8FFD
-#define GL_DOUBLE_VEC4 0x8FFE
-#define GL_DOUBLE_MAT2 0x8F46
-#define GL_DOUBLE_MAT3 0x8F47
-#define GL_DOUBLE_MAT4 0x8F48
-#define GL_DOUBLE_MAT2x3 0x8F49
-#define GL_DOUBLE_MAT2x4 0x8F4A
-#define GL_DOUBLE_MAT3x2 0x8F4B
-#define GL_DOUBLE_MAT3x4 0x8F4C
-#define GL_DOUBLE_MAT4x2 0x8F4D
-#define GL_DOUBLE_MAT4x3 0x8F4E
-#endif
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ACTIVE_SUBROUTINES 0x8DE5
-#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
-#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
-#define GL_MAX_SUBROUTINES 0x8DE7
-#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
-#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
-#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
-/* reuse GL_UNIFORM_SIZE */
-/* reuse GL_UNIFORM_NAME_LENGTH */
-#endif
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_PATCHES 0x000E
-#define GL_PATCH_VERTICES 0x8E72
-#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
-#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
-#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
-#define GL_TESS_GEN_MODE 0x8E76
-#define GL_TESS_GEN_SPACING 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
-#define GL_TESS_GEN_POINT_MODE 0x8E79
-/* reuse GL_TRIANGLES */
-/* reuse GL_QUADS */
-#define GL_ISOLINES 0x8E7A
-/* reuse GL_EQUAL */
-#define GL_FRACTIONAL_ODD 0x8E7B
-#define GL_FRACTIONAL_EVEN 0x8E7C
-/* reuse GL_CCW */
-/* reuse GL_CW */
-#define GL_MAX_PATCH_VERTICES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
-#define GL_TESS_EVALUATION_SHADER 0x8E87
-#define GL_TESS_CONTROL_SHADER 0x8E88
-#endif
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-/* reuse GL_RGB32F */
-/* reuse GL_RGB32UI */
-/* reuse GL_RGB32I */
-#endif
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_PAUSED
-#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_ACTIVE
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-#endif
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-#endif
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_FIXED 0x140C
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_RGB565 0x8D62
-#endif
-
-#ifndef GL_ARB_get_program_binary
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-#endif
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#endif
-
-#ifndef GL_ARB_shader_precision
-#endif
-
-#ifndef GL_ARB_vertex_attrib_64bit
-/* reuse GL_RGB32I */
-/* reuse GL_DOUBLE_VEC2 */
-/* reuse GL_DOUBLE_VEC3 */
-/* reuse GL_DOUBLE_VEC4 */
-/* reuse GL_DOUBLE_MAT2 */
-/* reuse GL_DOUBLE_MAT3 */
-/* reuse GL_DOUBLE_MAT4 */
-/* reuse GL_DOUBLE_MAT2x3 */
-/* reuse GL_DOUBLE_MAT2x4 */
-/* reuse GL_DOUBLE_MAT3x2 */
-/* reuse GL_DOUBLE_MAT3x4 */
-/* reuse GL_DOUBLE_MAT4x2 */
-/* reuse GL_DOUBLE_MAT4x3 */
-#endif
-
-#ifndef GL_ARB_viewport_array
-/* reuse GL_SCISSOR_BOX */
-/* reuse GL_VIEWPORT */
-/* reuse GL_DEPTH_RANGE */
-/* reuse GL_SCISSOR_TEST */
-#define GL_MAX_VIEWPORTS 0x825B
-#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
-#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
-#define GL_LAYER_PROVOKING_VERTEX 0x825E
-#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
-#define GL_UNDEFINED_VERTEX 0x8260
-/* reuse GL_FIRST_VERTEX_CONVENTION */
-/* reuse GL_LAST_VERTEX_CONVENTION */
-/* reuse GL_PROVOKING_VERTEX */
-#endif
-
-#ifndef GL_ARB_cl_event
-#define GL_SYNC_CL_EVENT_ARB 0x8240
-#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
-#endif
-
-#ifndef GL_ARB_debug_output
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
-#define GL_DEBUG_SOURCE_API_ARB 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
-#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
-#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
-#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
-#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
-#endif
-
-#ifndef GL_ARB_robustness
-/* reuse GL_NO_ERROR */
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
-#endif
-
-#ifndef GL_ARB_shader_stencil_export
-#endif
-
-#ifndef GL_ARB_base_instance
-#endif
-
-#ifndef GL_ARB_shading_language_420pack
-#endif
-
-#ifndef GL_ARB_transform_feedback_instanced
-#endif
-
-#ifndef GL_ARB_compressed_texture_pixel_storage
-#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
-#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
-#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
-#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
-#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
-#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
-#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
-#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
-#endif
-
-#ifndef GL_ARB_conservative_depth
-#endif
-
-#ifndef GL_ARB_internalformat_query
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-#endif
-
-#ifndef GL_ARB_map_buffer_alignment
-#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
-#endif
-
-#ifndef GL_ARB_shader_atomic_counters
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
-#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
-#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
-#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
-#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
-#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
-#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
-#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
-#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
-#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#endif
-
-#ifndef GL_ARB_shader_image_load_store
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-#define GL_MAX_IMAGE_UNITS 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
-#define GL_IMAGE_BINDING_NAME 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED 0x8F3C
-#define GL_IMAGE_BINDING_LAYER 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS 0x8F3E
-#define GL_IMAGE_1D 0x904C
-#define GL_IMAGE_2D 0x904D
-#define GL_IMAGE_3D 0x904E
-#define GL_IMAGE_2D_RECT 0x904F
-#define GL_IMAGE_CUBE 0x9050
-#define GL_IMAGE_BUFFER 0x9051
-#define GL_IMAGE_1D_ARRAY 0x9052
-#define GL_IMAGE_2D_ARRAY 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
-#define GL_INT_IMAGE_1D 0x9057
-#define GL_INT_IMAGE_2D 0x9058
-#define GL_INT_IMAGE_3D 0x9059
-#define GL_INT_IMAGE_2D_RECT 0x905A
-#define GL_INT_IMAGE_CUBE 0x905B
-#define GL_INT_IMAGE_BUFFER 0x905C
-#define GL_INT_IMAGE_1D_ARRAY 0x905D
-#define GL_INT_IMAGE_2D_ARRAY 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
-#define GL_MAX_IMAGE_SAMPLES 0x906D
-#define GL_IMAGE_BINDING_FORMAT 0x906E
-#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
-#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
-#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
-#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
-#endif
-
-#ifndef GL_ARB_shading_language_packing
-#endif
-
-#ifndef GL_ARB_texture_storage
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-#endif
-
-#ifndef GL_KHR_texture_compression_astc_ldr
-#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
-#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
-#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
-#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
-#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
-#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
-#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
-#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
-#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
-#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
-#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
-#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
-#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
-#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
-#endif
-
-#ifndef GL_KHR_debug
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
-#define GL_DEBUG_SOURCE_API 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION 0x824A
-#define GL_DEBUG_SOURCE_OTHER 0x824B
-#define GL_DEBUG_TYPE_ERROR 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
-#define GL_DEBUG_TYPE_OTHER 0x8251
-#define GL_DEBUG_TYPE_MARKER 0x8268
-#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
-#define GL_DEBUG_TYPE_POP_GROUP 0x826A
-#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
-#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
-#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
-#define GL_BUFFER 0x82E0
-#define GL_SHADER 0x82E1
-#define GL_PROGRAM 0x82E2
-#define GL_QUERY 0x82E3
-#define GL_PROGRAM_PIPELINE 0x82E4
-#define GL_SAMPLER 0x82E6
-#define GL_DISPLAY_LIST 0x82E7
-/* DISPLAY_LIST used in compatibility profile only */
-#define GL_MAX_LABEL_LENGTH 0x82E8
-#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES 0x9145
-#define GL_DEBUG_SEVERITY_HIGH 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
-#define GL_DEBUG_SEVERITY_LOW 0x9148
-#define GL_DEBUG_OUTPUT 0x92E0
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-/* reuse GL_STACK_UNDERFLOW */
-/* reuse GL_STACK_OVERFLOW */
-#endif
-
-#ifndef GL_ARB_arrays_of_arrays
-#endif
-
-#ifndef GL_ARB_clear_buffer_object
-#endif
-
-#ifndef GL_ARB_compute_shader
-#define GL_COMPUTE_SHADER 0x91B9
-#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB
-#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
-#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD
-#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
-#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
-#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
-#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265
-#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
-#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS 0x90EB
-#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
-#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
-#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
-#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
-#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
-#define GL_COMPUTE_SHADER_BIT 0x00000020
-#endif
-
-#ifndef GL_ARB_copy_image
-#endif
-
-#ifndef GL_ARB_texture_view
-#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB
-#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC
-#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD
-#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-#endif
-
-#ifndef GL_ARB_vertex_attrib_binding
-#define GL_VERTEX_ATTRIB_BINDING 0x82D4
-#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
-#define GL_VERTEX_BINDING_DIVISOR 0x82D6
-#define GL_VERTEX_BINDING_OFFSET 0x82D7
-#define GL_VERTEX_BINDING_STRIDE 0x82D8
-#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
-#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
-#endif
-
-#ifndef GL_ARB_robustness_isolation
-#endif
-
-#ifndef GL_ARB_ES3_compatibility
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-#define GL_COMPRESSED_R11_EAC 0x9270
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
-#define GL_MAX_ELEMENT_INDEX 0x8D6B
-#endif
-
-#ifndef GL_ARB_explicit_uniform_location
-#define GL_MAX_UNIFORM_LOCATIONS 0x826E
-#endif
-
-#ifndef GL_ARB_fragment_layer_viewport
-#endif
-
-#ifndef GL_ARB_framebuffer_no_attachments
-#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
-#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
-#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312
-#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
-#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
-#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315
-#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316
-#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317
-#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
-#endif
-
-#ifndef GL_ARB_internalformat_query2
-/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */
-/* reuse GL_NUM_SAMPLE_COUNTS */
-/* reuse GL_RENDERBUFFER */
-/* reuse GL_SAMPLES */
-/* reuse GL_TEXTURE_1D */
-/* reuse GL_TEXTURE_1D_ARRAY */
-/* reuse GL_TEXTURE_2D */
-/* reuse GL_TEXTURE_2D_ARRAY */
-/* reuse GL_TEXTURE_3D */
-/* reuse GL_TEXTURE_CUBE_MAP */
-/* reuse GL_TEXTURE_CUBE_MAP_ARRAY */
-/* reuse GL_TEXTURE_RECTANGLE */
-/* reuse GL_TEXTURE_BUFFER */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_COMPRESSED */
-#define GL_INTERNALFORMAT_SUPPORTED 0x826F
-#define GL_INTERNALFORMAT_PREFERRED 0x8270
-#define GL_INTERNALFORMAT_RED_SIZE 0x8271
-#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272
-#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273
-#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274
-#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275
-#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276
-#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277
-#define GL_INTERNALFORMAT_RED_TYPE 0x8278
-#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279
-#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A
-#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B
-#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C
-#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D
-#define GL_MAX_WIDTH 0x827E
-#define GL_MAX_HEIGHT 0x827F
-#define GL_MAX_DEPTH 0x8280
-#define GL_MAX_LAYERS 0x8281
-#define GL_MAX_COMBINED_DIMENSIONS 0x8282
-#define GL_COLOR_COMPONENTS 0x8283
-#define GL_DEPTH_COMPONENTS 0x8284
-#define GL_STENCIL_COMPONENTS 0x8285
-#define GL_COLOR_RENDERABLE 0x8286
-#define GL_DEPTH_RENDERABLE 0x8287
-#define GL_STENCIL_RENDERABLE 0x8288
-#define GL_FRAMEBUFFER_RENDERABLE 0x8289
-#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A
-#define GL_FRAMEBUFFER_BLEND 0x828B
-#define GL_READ_PIXELS 0x828C
-#define GL_READ_PIXELS_FORMAT 0x828D
-#define GL_READ_PIXELS_TYPE 0x828E
-#define GL_TEXTURE_IMAGE_FORMAT 0x828F
-#define GL_TEXTURE_IMAGE_TYPE 0x8290
-#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291
-#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292
-#define GL_MIPMAP 0x8293
-#define GL_MANUAL_GENERATE_MIPMAP 0x8294
-#define GL_AUTO_GENERATE_MIPMAP 0x8295
-#define GL_COLOR_ENCODING 0x8296
-#define GL_SRGB_READ 0x8297
-#define GL_SRGB_WRITE 0x8298
-#define GL_SRGB_DECODE_ARB 0x8299
-#define GL_FILTER 0x829A
-#define GL_VERTEX_TEXTURE 0x829B
-#define GL_TESS_CONTROL_TEXTURE 0x829C
-#define GL_TESS_EVALUATION_TEXTURE 0x829D
-#define GL_GEOMETRY_TEXTURE 0x829E
-#define GL_FRAGMENT_TEXTURE 0x829F
-#define GL_COMPUTE_TEXTURE 0x82A0
-#define GL_TEXTURE_SHADOW 0x82A1
-#define GL_TEXTURE_GATHER 0x82A2
-#define GL_TEXTURE_GATHER_SHADOW 0x82A3
-#define GL_SHADER_IMAGE_LOAD 0x82A4
-#define GL_SHADER_IMAGE_STORE 0x82A5
-#define GL_SHADER_IMAGE_ATOMIC 0x82A6
-#define GL_IMAGE_TEXEL_SIZE 0x82A7
-#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8
-#define GL_IMAGE_PIXEL_FORMAT 0x82A9
-#define GL_IMAGE_PIXEL_TYPE 0x82AA
-#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC
-#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD
-#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE
-#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF
-#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1
-#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2
-#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3
-#define GL_CLEAR_BUFFER 0x82B4
-#define GL_TEXTURE_VIEW 0x82B5
-#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6
-#define GL_FULL_SUPPORT 0x82B7
-#define GL_CAVEAT_SUPPORT 0x82B8
-#define GL_IMAGE_CLASS_4_X_32 0x82B9
-#define GL_IMAGE_CLASS_2_X_32 0x82BA
-#define GL_IMAGE_CLASS_1_X_32 0x82BB
-#define GL_IMAGE_CLASS_4_X_16 0x82BC
-#define GL_IMAGE_CLASS_2_X_16 0x82BD
-#define GL_IMAGE_CLASS_1_X_16 0x82BE
-#define GL_IMAGE_CLASS_4_X_8 0x82BF
-#define GL_IMAGE_CLASS_2_X_8 0x82C0
-#define GL_IMAGE_CLASS_1_X_8 0x82C1
-#define GL_IMAGE_CLASS_11_11_10 0x82C2
-#define GL_IMAGE_CLASS_10_10_10_2 0x82C3
-#define GL_VIEW_CLASS_128_BITS 0x82C4
-#define GL_VIEW_CLASS_96_BITS 0x82C5
-#define GL_VIEW_CLASS_64_BITS 0x82C6
-#define GL_VIEW_CLASS_48_BITS 0x82C7
-#define GL_VIEW_CLASS_32_BITS 0x82C8
-#define GL_VIEW_CLASS_24_BITS 0x82C9
-#define GL_VIEW_CLASS_16_BITS 0x82CA
-#define GL_VIEW_CLASS_8_BITS 0x82CB
-#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC
-#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD
-#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE
-#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF
-#define GL_VIEW_CLASS_RGTC1_RED 0x82D0
-#define GL_VIEW_CLASS_RGTC2_RG 0x82D1
-#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2
-#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3
-#endif
-
-#ifndef GL_ARB_invalidate_subdata
-#endif
-
-#ifndef GL_ARB_multi_draw_indirect
-#endif
-
-#ifndef GL_ARB_program_interface_query
-#define GL_UNIFORM 0x92E1
-#define GL_UNIFORM_BLOCK 0x92E2
-#define GL_PROGRAM_INPUT 0x92E3
-#define GL_PROGRAM_OUTPUT 0x92E4
-#define GL_BUFFER_VARIABLE 0x92E5
-#define GL_SHADER_STORAGE_BLOCK 0x92E6
-/* reuse GL_ATOMIC_COUNTER_BUFFER */
-#define GL_VERTEX_SUBROUTINE 0x92E8
-#define GL_TESS_CONTROL_SUBROUTINE 0x92E9
-#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA
-#define GL_GEOMETRY_SUBROUTINE 0x92EB
-#define GL_FRAGMENT_SUBROUTINE 0x92EC
-#define GL_COMPUTE_SUBROUTINE 0x92ED
-#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE
-#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF
-#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0
-#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1
-#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2
-#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3
-#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
-#define GL_ACTIVE_RESOURCES 0x92F5
-#define GL_MAX_NAME_LENGTH 0x92F6
-#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
-#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8
-#define GL_NAME_LENGTH 0x92F9
-#define GL_TYPE 0x92FA
-#define GL_ARRAY_SIZE 0x92FB
-#define GL_OFFSET 0x92FC
-#define GL_BLOCK_INDEX 0x92FD
-#define GL_ARRAY_STRIDE 0x92FE
-#define GL_MATRIX_STRIDE 0x92FF
-#define GL_IS_ROW_MAJOR 0x9300
-#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
-#define GL_BUFFER_BINDING 0x9302
-#define GL_BUFFER_DATA_SIZE 0x9303
-#define GL_NUM_ACTIVE_VARIABLES 0x9304
-#define GL_ACTIVE_VARIABLES 0x9305
-#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
-#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307
-#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
-#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
-#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
-#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
-#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
-#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
-#define GL_LOCATION 0x930E
-#define GL_LOCATION_INDEX 0x930F
-#define GL_IS_PER_PATCH 0x92E7
-/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
-/* reuse GL_COMPATIBLE_SUBROUTINES */
-#endif
-
-#ifndef GL_ARB_robust_buffer_access_behavior
-#endif
-
-#ifndef GL_ARB_shader_image_size
-#endif
-
-#ifndef GL_ARB_shader_storage_buffer_object
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
-#define GL_SHADER_STORAGE_BUFFER_START 0x90D4
-#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
-#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
-#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
-#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
-#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
-#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
-#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
-#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
-#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
-#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
-#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
-#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000
-#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS
-/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */
-#endif
-
-#ifndef GL_ARB_stencil_texturing
-#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
-#endif
-
-#ifndef GL_ARB_texture_buffer_range
-#define GL_TEXTURE_BUFFER_OFFSET 0x919D
-#define GL_TEXTURE_BUFFER_SIZE 0x919E
-#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F
-#endif
-
-#ifndef GL_ARB_texture_query_levels
-#endif
-
-#ifndef GL_ARB_texture_storage_multisample
-#endif
-
-
-/*************************************************************/
-
-#include <stddef.h>
-#ifndef GL_VERSION_2_0
-/* GL type for program/shader text */
-typedef char GLchar;
-#endif
-
-#ifndef GL_VERSION_1_5
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_ARB_shader_objects
-/* GL types for program/shader text and shader object handles */
-typedef char GLcharARB;
-typedef unsigned int GLhandleARB;
-#endif
-
-/* GL type for "half" precision (s10e5) float data in host memory */
-#ifndef GL_ARB_half_float_pixel
-typedef unsigned short GLhalfARB;
-#endif
-
-#ifndef GL_NV_half_float
-typedef unsigned short GLhalfNV;
-#endif
-
-#ifndef GLEXT_64_TYPES_DEFINED
-/* This code block is duplicated in glxext.h, so must be protected */
-#define GLEXT_64_TYPES_DEFINED
-/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
-/* (as used in the GL_EXT_timer_query extension). */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#include <inttypes.h>
-#elif defined(__sun__) || defined(__digital__)
-#include <inttypes.h>
-#if defined(__STDC__)
-#if defined(__arch64__) || defined(_LP64)
-typedef long int int64_t;
-typedef unsigned long int uint64_t;
-#else
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#endif /* __arch64__ */
-#endif /* __STDC__ */
-#elif defined( __VMS ) || defined(__sgi)
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__)
-#include <stdint.h>
-#elif defined(__UNIXOS2__) || defined(__SOL64__)
-typedef long int int32_t;
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#elif defined(_WIN32) && defined(__GNUC__)
-#include <stdint.h>
-#elif defined(_WIN32)
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#else
-/* Fallback if nothing above works */
-#include <inttypes.h>
-#endif
-#endif
-
-#ifndef GL_EXT_timer_query
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-#endif
-
-#ifndef GL_ARB_sync
-typedef int64_t GLint64;
-typedef uint64_t GLuint64;
-typedef struct __GLsync *GLsync;
-#endif
-
-#ifndef GL_ARB_cl_event
-/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
-struct _cl_context;
-struct _cl_event;
-#endif
-
-#ifndef GL_ARB_debug_output
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_AMD_debug_output
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_KHR_debug
-typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_NV_vdpau_interop
-typedef GLintptr GLvdpauSurfaceNV;
-#endif
-
-#ifndef GL_VERSION_1_0
-#define GL_VERSION_1_0 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glCullFace (GLenum mode);
-GLAPI void APIENTRY glFrontFace (GLenum mode);
-GLAPI void APIENTRY glHint (GLenum target, GLenum mode);
-GLAPI void APIENTRY glLineWidth (GLfloat width);
-GLAPI void APIENTRY glPointSize (GLfloat size);
-GLAPI void APIENTRY glPolygonMode (GLenum face, GLenum mode);
-GLAPI void APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glDrawBuffer (GLenum mode);
-GLAPI void APIENTRY glClear (GLbitfield mask);
-GLAPI void APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void APIENTRY glClearStencil (GLint s);
-GLAPI void APIENTRY glClearDepth (GLdouble depth);
-GLAPI void APIENTRY glStencilMask (GLuint mask);
-GLAPI void APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GLAPI void APIENTRY glDepthMask (GLboolean flag);
-GLAPI void APIENTRY glDisable (GLenum cap);
-GLAPI void APIENTRY glEnable (GLenum cap);
-GLAPI void APIENTRY glFinish (void);
-GLAPI void APIENTRY glFlush (void);
-GLAPI void APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GLAPI void APIENTRY glLogicOp (GLenum opcode);
-GLAPI void APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GLAPI void APIENTRY glDepthFunc (GLenum func);
-GLAPI void APIENTRY glPixelStoref (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelStorei (GLenum pname, GLint param);
-GLAPI void APIENTRY glReadBuffer (GLenum mode);
-GLAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
-GLAPI void APIENTRY glGetDoublev (GLenum pname, GLdouble *params);
-GLAPI GLenum APIENTRY glGetError (void);
-GLAPI void APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *params);
-GLAPI const GLubyte * APIENTRY glGetString (GLenum name);
-GLAPI void APIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsEnabled (GLenum cap);
-GLAPI void APIENTRY glDepthRange (GLdouble near, GLdouble far);
-GLAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
-typedef void (APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
-typedef void (APIENTRYP PFNGLPOINTSIZEPROC) (GLfloat size);
-typedef void (APIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLDRAWBUFFERPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
-typedef void (APIENTRYP PFNGLCLEARDEPTHPROC) (GLdouble depth);
-typedef void (APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
-typedef void (APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-typedef void (APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
-typedef void (APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
-typedef void (APIENTRYP PFNGLENABLEPROC) (GLenum cap);
-typedef void (APIENTRYP PFNGLFINISHPROC) (void);
-typedef void (APIENTRYP PFNGLFLUSHPROC) (void);
-typedef void (APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
-typedef void (APIENTRYP PFNGLLOGICOPPROC) (GLenum opcode);
-typedef void (APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
-typedef void (APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
-typedef void (APIENTRYP PFNGLPIXELSTOREFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLREADBUFFERPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *params);
-typedef void (APIENTRYP PFNGLGETDOUBLEVPROC) (GLenum pname, GLdouble *params);
-typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
-typedef void (APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
-typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
-typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC) (GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
-typedef void (APIENTRYP PFNGLDEPTHRANGEPROC) (GLdouble near, GLdouble far);
-typedef void (APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_1
-#define GL_VERSION_1_1 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY glGetPointerv (GLenum pname, GLvoid* *params);
-GLAPI void APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GLAPI void APIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glBindTexture (GLenum target, GLuint texture);
-GLAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GLAPI GLboolean APIENTRY glIsTexture (GLuint texture);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void APIENTRY glBlendEquation (GLenum mode);
-GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum texture);
-GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
-GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount);
-GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
-GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQuery (GLenum target);
-GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
-GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GLAPI void APIENTRY glCompileShader (GLuint shader);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum type);
-GLAPI void APIENTRY glDeleteProgram (GLuint program);
-GLAPI void APIENTRY glDeleteShader (GLuint shader);
-GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
-GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
-GLAPI void APIENTRY glLinkProgram (GLuint program);
-GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);
-GLAPI void APIENTRY glUseProgram (GLuint program);
-GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glValidateProgram (GLuint program);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-
-#ifndef GL_VERSION_3_0
-#define GL_VERSION_3_0 1
-/* OpenGL 3.0 also reuses entry points from these extensions: */
-/* ARB_framebuffer_object */
-/* ARB_map_buffer_range */
-/* ARB_vertex_array_object */
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
-GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
-GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
-GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedback (void);
-GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
-GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRender (void);
-GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
-GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-#endif
-
-#ifndef GL_VERSION_3_1
-#define GL_VERSION_3_1 1
-/* OpenGL 3.1 also reuses entry points from these extensions: */
-/* ARB_copy_buffer */
-/* ARB_uniform_buffer_object */
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);
-GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);
-typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
-#endif
-
-#ifndef GL_VERSION_3_2
-#define GL_VERSION_3_2 1
-/* OpenGL 3.2 also reuses entry points from these extensions: */
-/* ARB_draw_elements_base_vertex */
-/* ARB_provoking_vertex */
-/* ARB_sync */
-/* ARB_texture_multisample */
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif
-
-#ifndef GL_VERSION_3_3
-#define GL_VERSION_3_3 1
-/* OpenGL 3.3 also reuses entry points from these extensions: */
-/* ARB_blend_func_extended */
-/* ARB_sampler_objects */
-/* ARB_explicit_attrib_location, but it has none */
-/* ARB_occlusion_query2 (no entry points) */
-/* ARB_shader_bit_encoding (no entry points) */
-/* ARB_texture_rgb10_a2ui (no entry points) */
-/* ARB_texture_swizzle (no entry points) */
-/* ARB_timer_query */
-/* ARB_vertex_type_2_10_10_10_rev */
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-#endif
-
-#ifndef GL_VERSION_4_0
-#define GL_VERSION_4_0 1
-/* OpenGL 4.0 also reuses entry points from these extensions: */
-/* ARB_texture_query_lod (no entry points) */
-/* ARB_draw_indirect */
-/* ARB_gpu_shader5 (no entry points) */
-/* ARB_gpu_shader_fp64 */
-/* ARB_shader_subroutine */
-/* ARB_tessellation_shader */
-/* ARB_texture_buffer_object_rgb32 (no entry points) */
-/* ARB_texture_cube_map_array (no entry points) */
-/* ARB_texture_gather (no entry points) */
-/* ARB_transform_feedback2 */
-/* ARB_transform_feedback3 */
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShading (GLfloat value);
-GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-#ifndef GL_VERSION_4_1
-#define GL_VERSION_4_1 1
-/* OpenGL 4.1 reuses entry points from these extensions: */
-/* ARB_ES2_compatibility */
-/* ARB_get_program_binary */
-/* ARB_separate_shader_objects */
-/* ARB_shader_precision (no entry points) */
-/* ARB_vertex_attrib_64bit */
-/* ARB_viewport_array */
-#endif
-
-#ifndef GL_VERSION_4_2
-#define GL_VERSION_4_2 1
-/* OpenGL 4.2 reuses entry points from these extensions: */
-/* ARB_base_instance */
-/* ARB_shading_language_420pack (no entry points) */
-/* ARB_transform_feedback_instanced */
-/* ARB_compressed_texture_pixel_storage (no entry points) */
-/* ARB_conservative_depth (no entry points) */
-/* ARB_internalformat_query */
-/* ARB_map_buffer_alignment (no entry points) */
-/* ARB_shader_atomic_counters */
-/* ARB_shader_image_load_store */
-/* ARB_shading_language_packing (no entry points) */
-/* ARB_texture_storage */
-#endif
-
-#ifndef GL_VERSION_4_3
-#define GL_VERSION_4_3 1
-/* OpenGL 4.3 reuses entry points from these extensions: */
-/* ARB_arrays_of_arrays (no entry points, GLSL only) */
-/* ARB_fragment_layer_viewport (no entry points, GLSL only) */
-/* ARB_shader_image_size (no entry points, GLSL only) */
-/* ARB_ES3_compatibility (no entry points) */
-/* ARB_clear_buffer_object */
-/* ARB_compute_shader */
-/* ARB_copy_image */
-/* KHR_debug (includes ARB_debug_output commands promoted to KHR without suffixes) */
-/* ARB_explicit_uniform_location (no entry points) */
-/* ARB_framebuffer_no_attachments */
-/* ARB_internalformat_query2 */
-/* ARB_invalidate_subdata */
-/* ARB_multi_draw_indirect */
-/* ARB_program_interface_query */
-/* ARB_robust_buffer_access_behavior (no entry points) */
-/* ARB_shader_storage_buffer_object */
-/* ARB_stencil_texturing (no entry points) */
-/* ARB_texture_buffer_range */
-/* ARB_texture_query_levels (no entry points) */
-/* ARB_texture_storage_multisample */
-/* ARB_texture_view */
-/* ARB_vertex_attrib_binding */
-#endif
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-#endif
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmap (GLenum target);
-GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-#endif
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-#endif
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-#endif
-
-#ifndef GL_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-#endif
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArray (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-#endif
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_ARB_uniform_buffer_object 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices);
-GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif
-
-#ifndef GL_ARB_copy_buffer
-#define GL_ARB_copy_buffer 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-#endif
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
-GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
-#endif
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-#endif
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertex (GLenum mode);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-#endif
-
-#ifndef GL_ARB_sync
-#define GL_ARB_sync 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
-GLAPI void APIENTRY glDeleteSync (GLsync sync);
-GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif
-
-#ifndef GL_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
-#endif
-
-#ifndef GL_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-#endif
-
-#ifndef GL_ARB_draw_buffers_blend
-#define GL_ARB_draw_buffers_blend 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-#ifndef GL_ARB_sample_shading
-#define GL_ARB_sample_shading 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value);
-#endif
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_ARB_texture_cube_map_array 1
-#endif
-
-#ifndef GL_ARB_texture_gather
-#define GL_ARB_texture_gather 1
-#endif
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-#endif
-
-#ifndef GL_ARB_shading_language_include
-#define GL_ARB_shading_language_include 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
-GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_ARB_texture_compression_bptc 1
-#endif
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_ARB_blend_func_extended 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
-#endif
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-#endif
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-#endif
-
-#ifndef GL_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
-GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
-GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_shader_bit_encoding
-#define GL_ARB_shader_bit_encoding 1
-#endif
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-#endif
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#endif
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
-GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
-#endif
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-#define GL_ARB_vertex_type_2_10_10_10_rev 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-#endif
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);
-GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
-#endif
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-#endif
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
-GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
-typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
-GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
-GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
-typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-#endif
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
-GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
-#endif
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-#endif
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_ARB_transform_feedback2 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedback (void);
-GLAPI void APIENTRY glResumeTransformFeedback (void);
-GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
-#endif
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
-GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
-GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
-GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
-typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_ARB_ES2_compatibility 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glReleaseShaderCompiler (void);
-GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f);
-GLAPI void APIENTRY glClearDepthf (GLfloat d);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
-typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
-#endif
-
-#ifndef GL_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-#endif
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* const *strings);
-GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
-GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* const *strings);
-typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif
-
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
-GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f);
-GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
-GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
-typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
-#endif
-
-#ifndef GL_ARB_cl_event
-#define GL_ARB_cl_event 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
-#endif
-
-#ifndef GL_ARB_debug_output
-#define GL_ARB_debug_output 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#endif
-
-#ifndef GL_ARB_robustness
-#define GL_ARB_robustness 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
-GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
-typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-#endif
-
-#ifndef GL_ARB_base_instance
-#define GL_ARB_base_instance 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
-GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
-#endif
-
-#ifndef GL_ARB_shading_language_420pack
-#define GL_ARB_shading_language_420pack 1
-#endif
-
-#ifndef GL_ARB_transform_feedback_instanced
-#define GL_ARB_transform_feedback_instanced 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount);
-GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
-#endif
-
-#ifndef GL_ARB_compressed_texture_pixel_storage
-#define GL_ARB_compressed_texture_pixel_storage 1
-#endif
-
-#ifndef GL_ARB_conservative_depth
-#define GL_ARB_conservative_depth 1
-#endif
-
-#ifndef GL_ARB_internalformat_query
-#define GL_ARB_internalformat_query 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-#endif
-
-#ifndef GL_ARB_map_buffer_alignment
-#define GL_ARB_map_buffer_alignment 1
-#endif
-
-#ifndef GL_ARB_shader_atomic_counters
-#define GL_ARB_shader_atomic_counters 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_shader_image_load_store
-#define GL_ARB_shader_image_load_store 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
-#endif
-
-#ifndef GL_ARB_shading_language_packing
-#define GL_ARB_shading_language_packing 1
-#endif
-
-#ifndef GL_ARB_texture_storage
-#define GL_ARB_texture_storage 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-
-#ifndef GL_KHR_texture_compression_astc_ldr
-#define GL_KHR_texture_compression_astc_ldr 1
-#endif
-
-#ifndef GL_KHR_debug
-#define GL_KHR_debug 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-GLAPI void APIENTRY glPopDebugGroup (void);
-GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
-GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
-typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
-typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif
-
-#ifndef GL_ARB_arrays_of_arrays
-#define GL_ARB_arrays_of_arrays 1
-#endif
-
-#ifndef GL_ARB_clear_buffer_object
-#define GL_ARB_clear_buffer_object 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
-#endif
-
-#ifndef GL_ARB_compute_shader
-#define GL_ARB_compute_shader 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
-#endif
-
-#ifndef GL_ARB_copy_image
-#define GL_ARB_copy_image 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-#endif
-
-#ifndef GL_ARB_texture_view
-#define GL_ARB_texture_view 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-#endif
-
-#ifndef GL_ARB_vertex_attrib_binding
-#define GL_ARB_vertex_attrib_binding 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
-GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
-GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
-GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
-typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
-typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);
-#endif
-
-#ifndef GL_ARB_robustness_isolation
-#define GL_ARB_robustness_isolation 1
-#endif
-
-#ifndef GL_ARB_ES3_compatibility
-#define GL_ARB_ES3_compatibility 1
-#endif
-
-#ifndef GL_ARB_explicit_uniform_location
-#define GL_ARB_explicit_uniform_location 1
-#endif
-
-#ifndef GL_ARB_fragment_layer_viewport
-#define GL_ARB_fragment_layer_viewport 1
-#endif
-
-#ifndef GL_ARB_framebuffer_no_attachments
-#define GL_ARB_framebuffer_no_attachments 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param);
-GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_internalformat_query2
-#define GL_ARB_internalformat_query2 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
-#endif
-
-#ifndef GL_ARB_invalidate_subdata
-#define GL_ARB_invalidate_subdata 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
-GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);
-GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);
-GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer);
-GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_ARB_multi_draw_indirect
-#define GL_ARB_multi_draw_indirect 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
-GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
-#endif
-
-#ifndef GL_ARB_program_interface_query
-#define GL_ARB_program_interface_query 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
-GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-#endif
-
-#ifndef GL_ARB_robust_buffer_access_behavior
-#define GL_ARB_robust_buffer_access_behavior 1
-#endif
-
-#ifndef GL_ARB_shader_image_size
-#define GL_ARB_shader_image_size 1
-#endif
-
-#ifndef GL_ARB_shader_storage_buffer_object
-#define GL_ARB_shader_storage_buffer_object 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
-#endif
-
-#ifndef GL_ARB_stencil_texturing
-#define GL_ARB_stencil_texturing 1
-#endif
-
-#ifndef GL_ARB_texture_buffer_range
-#define GL_ARB_texture_buffer_range 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-#endif
-
-#ifndef GL_ARB_texture_query_levels
-#define GL_ARB_texture_query_levels 1
-#endif
-
-#ifndef GL_ARB_texture_storage_multisample
-#define GL_ARB_texture_storage_multisample 1
-#ifdef GLCOREARB_PROTOTYPES
-GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-#endif /* GLCOREARB_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glew.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glew.h
deleted file mode 100644
index 0cd6ae3a..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glew.h
+++ /dev/null
@@ -1,16126 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author may be used to endorse or promote products
-** derived from this software without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-** THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.0
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __glew_h__
-#define __glew_h__
-#define __GLEW_H__
-
-#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)
-#error gl.h included before glew.h
-#endif
-#if defined(__glext_h_) || defined(__GLEXT_H_)
-#error glext.h included before glew.h
-#endif
-#if defined(__gl_ATI_h_)
-#error glATI.h included before glew.h
-#endif
-
-#define __gl_h_
-#define __GL_H__
-#define __X_GL_H
-#define __glext_h_
-#define __GLEXT_H_
-#define __gl_ATI_h_
-
-#if defined(_WIN32)
-
-/*
- * GLEW does not include <windows.h> to avoid name space pollution.
- * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t
- * defined properly.
- */
-/* <windef.h> */
-#ifndef APIENTRY
-#define GLEW_APIENTRY_DEFINED
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define APIENTRY __stdcall
-# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
-# define APIENTRY __stdcall
-# else
-# define APIENTRY
-# endif
-#endif
-#ifndef GLAPI
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define GLAPI extern
-# endif
-#endif
-/* <winnt.h> */
-#ifndef CALLBACK
-#define GLEW_CALLBACK_DEFINED
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define CALLBACK __attribute__ ((__stdcall__))
-# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
-# define CALLBACK __stdcall
-# else
-# define CALLBACK
-# endif
-#endif
-/* <wingdi.h> and <winnt.h> */
-#ifndef WINGDIAPI
-#define GLEW_WINGDIAPI_DEFINED
-#define WINGDIAPI __declspec(dllimport)
-#endif
-/* <ctype.h> */
-#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED)
-typedef unsigned short wchar_t;
-# define _WCHAR_T_DEFINED
-#endif
-/* <stddef.h> */
-#if !defined(_W64)
-# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300
-# define _W64 __w64
-# else
-# define _W64
-# endif
-#endif
-#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__)
-# ifdef _WIN64
-typedef __int64 ptrdiff_t;
-# else
-typedef _W64 int ptrdiff_t;
-# endif
-# define _PTRDIFF_T_DEFINED
-# define _PTRDIFF_T_
-#endif
-
-#ifndef GLAPI
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define GLAPI extern
-# else
-# define GLAPI WINGDIAPI
-# endif
-#endif
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY APIENTRY
-#endif
-
-/*
- * GLEW_STATIC is defined for static library.
- * GLEW_BUILD is defined for building the DLL library.
- */
-
-#ifdef GLEW_STATIC
-# define GLEWAPI extern
-#else
-# ifdef GLEW_BUILD
-# define GLEWAPI extern __declspec(dllexport)
-# else
-# define GLEWAPI extern __declspec(dllimport)
-# endif
-#endif
-
-#else /* _UNIX */
-
-/*
- * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO
- * C. On my system, this amounts to _3 lines_ of included code, all of
- * them pretty much harmless. If you know of a way of detecting 32 vs
- * 64 _targets_ at compile time you are free to replace this with
- * something that's portable. For now, _this_ is the portable solution.
- * (mem, 2004-01-04)
- */
-
-#include <stddef.h>
-
-/* SGI MIPSPro doesn't like stdint.h in C++ mode */
-/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */
-
-#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__)
-#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
-
-#define GLEW_APIENTRY_DEFINED
-#define APIENTRY
-
-/*
- * GLEW_STATIC is defined for static library.
- */
-
-#ifdef GLEW_STATIC
-# define GLEWAPI extern
-#else
-# if defined(__GNUC__) && __GNUC__>=4
-# define GLEWAPI extern __attribute__ ((visibility("default")))
-# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-# define GLEWAPI extern __global
-# else
-# define GLEWAPI extern
-# endif
-#endif
-
-/* <glu.h> */
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#endif /* _WIN32 */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ----------------------------- GL_VERSION_1_1 ---------------------------- */
-
-#ifndef GL_VERSION_1_1
-#define GL_VERSION_1_1 1
-
-typedef unsigned int GLenum;
-typedef unsigned int GLbitfield;
-typedef unsigned int GLuint;
-typedef int GLint;
-typedef int GLsizei;
-typedef unsigned char GLboolean;
-typedef signed char GLbyte;
-typedef short GLshort;
-typedef unsigned char GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned long GLulong;
-typedef float GLfloat;
-typedef float GLclampf;
-typedef double GLdouble;
-typedef double GLclampd;
-typedef void GLvoid;
-#if defined(_MSC_VER) && _MSC_VER < 1400
-typedef __int64 GLint64EXT;
-typedef unsigned __int64 GLuint64EXT;
-#elif defined(_MSC_VER) || defined(__BORLANDC__)
-typedef signed long long GLint64EXT;
-typedef unsigned long long GLuint64EXT;
-#else
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-#include <inttypes.h>
-# endif
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-#endif
-typedef GLint64EXT GLint64;
-typedef GLuint64EXT GLuint64;
-typedef struct __GLsync *GLsync;
-
-typedef char GLchar;
-
-#define GL_ZERO 0
-#define GL_FALSE 0
-#define GL_LOGIC_OP 0x0BF1
-#define GL_NONE 0
-#define GL_TEXTURE_COMPONENTS 0x1003
-#define GL_NO_ERROR 0
-#define GL_POINTS 0x0000
-#define GL_CURRENT_BIT 0x00000001
-#define GL_TRUE 1
-#define GL_ONE 1
-#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_POINT_BIT 0x00000002
-#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
-#define GL_LINE_STRIP 0x0003
-#define GL_LINE_BIT 0x00000004
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_QUADS 0x0007
-#define GL_QUAD_STRIP 0x0008
-#define GL_POLYGON_BIT 0x00000008
-#define GL_POLYGON 0x0009
-#define GL_POLYGON_STIPPLE_BIT 0x00000010
-#define GL_PIXEL_MODE_BIT 0x00000020
-#define GL_LIGHTING_BIT 0x00000040
-#define GL_FOG_BIT 0x00000080
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_ACCUM 0x0100
-#define GL_LOAD 0x0101
-#define GL_RETURN 0x0102
-#define GL_MULT 0x0103
-#define GL_ADD 0x0104
-#define GL_NEVER 0x0200
-#define GL_ACCUM_BUFFER_BIT 0x00000200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_FRONT_LEFT 0x0400
-#define GL_FRONT_RIGHT 0x0401
-#define GL_BACK_LEFT 0x0402
-#define GL_BACK_RIGHT 0x0403
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_LEFT 0x0406
-#define GL_RIGHT 0x0407
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_AUX0 0x0409
-#define GL_AUX1 0x040A
-#define GL_AUX2 0x040B
-#define GL_AUX3 0x040C
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_2D 0x0600
-#define GL_3D 0x0601
-#define GL_3D_COLOR 0x0602
-#define GL_3D_COLOR_TEXTURE 0x0603
-#define GL_4D_COLOR_TEXTURE 0x0604
-#define GL_PASS_THROUGH_TOKEN 0x0700
-#define GL_POINT_TOKEN 0x0701
-#define GL_LINE_TOKEN 0x0702
-#define GL_POLYGON_TOKEN 0x0703
-#define GL_BITMAP_TOKEN 0x0704
-#define GL_DRAW_PIXEL_TOKEN 0x0705
-#define GL_COPY_PIXEL_TOKEN 0x0706
-#define GL_LINE_RESET_TOKEN 0x0707
-#define GL_EXP 0x0800
-#define GL_VIEWPORT_BIT 0x00000800
-#define GL_EXP2 0x0801
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_COEFF 0x0A00
-#define GL_ORDER 0x0A01
-#define GL_DOMAIN 0x0A02
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_INDEX 0x0B01
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_CURRENT_RASTER_COLOR 0x0B04
-#define GL_CURRENT_RASTER_INDEX 0x0B05
-#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
-#define GL_CURRENT_RASTER_POSITION 0x0B07
-#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
-#define GL_CURRENT_RASTER_DISTANCE 0x0B09
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_RANGE 0x0B12
-#define GL_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_LINE_WIDTH 0x0B21
-#define GL_LINE_WIDTH_RANGE 0x0B22
-#define GL_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_LINE_STIPPLE 0x0B24
-#define GL_LINE_STIPPLE_PATTERN 0x0B25
-#define GL_LINE_STIPPLE_REPEAT 0x0B26
-#define GL_LIST_MODE 0x0B30
-#define GL_MAX_LIST_NESTING 0x0B31
-#define GL_LIST_BASE 0x0B32
-#define GL_LIST_INDEX 0x0B33
-#define GL_POLYGON_MODE 0x0B40
-#define GL_POLYGON_SMOOTH 0x0B41
-#define GL_POLYGON_STIPPLE 0x0B42
-#define GL_EDGE_FLAG 0x0B43
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_LIGHTING 0x0B50
-#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_SHADE_MODEL 0x0B54
-#define GL_COLOR_MATERIAL_FACE 0x0B55
-#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_FOG 0x0B60
-#define GL_FOG_INDEX 0x0B61
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_COLOR 0x0B66
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_ACCUM_CLEAR_VALUE 0x0B80
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_NORMALIZE 0x0BA1
-#define GL_VIEWPORT 0x0BA2
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_ATTRIB_STACK_DEPTH 0x0BB0
-#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_ALPHA_TEST_FUNC 0x0BC1
-#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_DITHER 0x0BD0
-#define GL_BLEND_DST 0x0BE0
-#define GL_BLEND_SRC 0x0BE1
-#define GL_BLEND 0x0BE2
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_INDEX_LOGIC_OP 0x0BF1
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_AUX_BUFFERS 0x0C00
-#define GL_DRAW_BUFFER 0x0C01
-#define GL_READ_BUFFER 0x0C02
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_INDEX_CLEAR_VALUE 0x0C20
-#define GL_INDEX_WRITEMASK 0x0C21
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_INDEX_MODE 0x0C30
-#define GL_RGBA_MODE 0x0C31
-#define GL_DOUBLEBUFFER 0x0C32
-#define GL_STEREO 0x0C33
-#define GL_RENDER_MODE 0x0C40
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_FOG_HINT 0x0C54
-#define GL_TEXTURE_GEN_S 0x0C60
-#define GL_TEXTURE_GEN_T 0x0C61
-#define GL_TEXTURE_GEN_R 0x0C62
-#define GL_TEXTURE_GEN_Q 0x0C63
-#define GL_PIXEL_MAP_I_TO_I 0x0C70
-#define GL_PIXEL_MAP_S_TO_S 0x0C71
-#define GL_PIXEL_MAP_I_TO_R 0x0C72
-#define GL_PIXEL_MAP_I_TO_G 0x0C73
-#define GL_PIXEL_MAP_I_TO_B 0x0C74
-#define GL_PIXEL_MAP_I_TO_A 0x0C75
-#define GL_PIXEL_MAP_R_TO_R 0x0C76
-#define GL_PIXEL_MAP_G_TO_G 0x0C77
-#define GL_PIXEL_MAP_B_TO_B 0x0C78
-#define GL_PIXEL_MAP_A_TO_A 0x0C79
-#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
-#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
-#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
-#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
-#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
-#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
-#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
-#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
-#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
-#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
-#define GL_UNPACK_SWAP_BYTES 0x0CF0
-#define GL_UNPACK_LSB_FIRST 0x0CF1
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_SWAP_BYTES 0x0D00
-#define GL_PACK_LSB_FIRST 0x0D01
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAP_COLOR 0x0D10
-#define GL_MAP_STENCIL 0x0D11
-#define GL_INDEX_SHIFT 0x0D12
-#define GL_INDEX_OFFSET 0x0D13
-#define GL_RED_SCALE 0x0D14
-#define GL_RED_BIAS 0x0D15
-#define GL_ZOOM_X 0x0D16
-#define GL_ZOOM_Y 0x0D17
-#define GL_GREEN_SCALE 0x0D18
-#define GL_GREEN_BIAS 0x0D19
-#define GL_BLUE_SCALE 0x0D1A
-#define GL_BLUE_BIAS 0x0D1B
-#define GL_ALPHA_SCALE 0x0D1C
-#define GL_ALPHA_BIAS 0x0D1D
-#define GL_DEPTH_SCALE 0x0D1E
-#define GL_DEPTH_BIAS 0x0D1F
-#define GL_MAX_EVAL_ORDER 0x0D30
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_CLIP_PLANES 0x0D32
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
-#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_NAME_STACK_DEPTH 0x0D37
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_INDEX_BITS 0x0D51
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_ACCUM_RED_BITS 0x0D58
-#define GL_ACCUM_GREEN_BITS 0x0D59
-#define GL_ACCUM_BLUE_BITS 0x0D5A
-#define GL_ACCUM_ALPHA_BITS 0x0D5B
-#define GL_NAME_STACK_DEPTH 0x0D70
-#define GL_AUTO_NORMAL 0x0D80
-#define GL_MAP1_COLOR_4 0x0D90
-#define GL_MAP1_INDEX 0x0D91
-#define GL_MAP1_NORMAL 0x0D92
-#define GL_MAP1_TEXTURE_COORD_1 0x0D93
-#define GL_MAP1_TEXTURE_COORD_2 0x0D94
-#define GL_MAP1_TEXTURE_COORD_3 0x0D95
-#define GL_MAP1_TEXTURE_COORD_4 0x0D96
-#define GL_MAP1_VERTEX_3 0x0D97
-#define GL_MAP1_VERTEX_4 0x0D98
-#define GL_MAP2_COLOR_4 0x0DB0
-#define GL_MAP2_INDEX 0x0DB1
-#define GL_MAP2_NORMAL 0x0DB2
-#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
-#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
-#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
-#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
-#define GL_MAP2_VERTEX_3 0x0DB7
-#define GL_MAP2_VERTEX_4 0x0DB8
-#define GL_MAP1_GRID_DOMAIN 0x0DD0
-#define GL_MAP1_GRID_SEGMENTS 0x0DD1
-#define GL_MAP2_GRID_DOMAIN 0x0DD2
-#define GL_MAP2_GRID_SEGMENTS 0x0DD3
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
-#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
-#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
-#define GL_SELECTION_BUFFER_POINTER 0x0DF3
-#define GL_SELECTION_BUFFER_SIZE 0x0DF4
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TRANSFORM_BIT 0x00001000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_BORDER 0x1005
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-#define GL_COMPILE 0x1300
-#define GL_COMPILE_AND_EXECUTE 0x1301
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_2_BYTES 0x1407
-#define GL_3_BYTES 0x1408
-#define GL_4_BYTES 0x1409
-#define GL_DOUBLE 0x140A
-#define GL_CLEAR 0x1500
-#define GL_AND 0x1501
-#define GL_AND_REVERSE 0x1502
-#define GL_COPY 0x1503
-#define GL_AND_INVERTED 0x1504
-#define GL_NOOP 0x1505
-#define GL_XOR 0x1506
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_EQUIV 0x1509
-#define GL_INVERT 0x150A
-#define GL_OR_REVERSE 0x150B
-#define GL_COPY_INVERTED 0x150C
-#define GL_OR_INVERTED 0x150D
-#define GL_NAND 0x150E
-#define GL_SET 0x150F
-#define GL_EMISSION 0x1600
-#define GL_SHININESS 0x1601
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-#define GL_COLOR_INDEXES 0x1603
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_COLOR_INDEX 0x1900
-#define GL_STENCIL_INDEX 0x1901
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_BITMAP 0x1A00
-#define GL_POINT 0x1B00
-#define GL_LINE 0x1B01
-#define GL_FILL 0x1B02
-#define GL_RENDER 0x1C00
-#define GL_FEEDBACK 0x1C01
-#define GL_SELECT 0x1C02
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-#define GL_S 0x2000
-#define GL_ENABLE_BIT 0x00002000
-#define GL_T 0x2001
-#define GL_R 0x2002
-#define GL_Q 0x2003
-#define GL_MODULATE 0x2100
-#define GL_DECAL 0x2101
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_ENV_COLOR 0x2201
-#define GL_TEXTURE_ENV 0x2300
-#define GL_EYE_LINEAR 0x2400
-#define GL_OBJECT_LINEAR 0x2401
-#define GL_SPHERE_MAP 0x2402
-#define GL_TEXTURE_GEN_MODE 0x2500
-#define GL_OBJECT_PLANE 0x2501
-#define GL_EYE_PLANE 0x2502
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_CLAMP 0x2900
-#define GL_REPEAT 0x2901
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_R3_G3_B2 0x2A10
-#define GL_V2F 0x2A20
-#define GL_V3F 0x2A21
-#define GL_C4UB_V2F 0x2A22
-#define GL_C4UB_V3F 0x2A23
-#define GL_C3F_V3F 0x2A24
-#define GL_N3F_V3F 0x2A25
-#define GL_C4F_N3F_V3F 0x2A26
-#define GL_T2F_V3F 0x2A27
-#define GL_T4F_V4F 0x2A28
-#define GL_T2F_C4UB_V3F 0x2A29
-#define GL_T2F_C3F_V3F 0x2A2A
-#define GL_T2F_N3F_V3F 0x2A2B
-#define GL_T2F_C4F_N3F_V3F 0x2A2C
-#define GL_T4F_C4F_N3F_V4F 0x2A2D
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-#define GL_LIGHT0 0x4000
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-#define GL_HINT_BIT 0x00008000
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_ALPHA4 0x803B
-#define GL_ALPHA8 0x803C
-#define GL_ALPHA12 0x803D
-#define GL_ALPHA16 0x803E
-#define GL_LUMINANCE4 0x803F
-#define GL_LUMINANCE8 0x8040
-#define GL_LUMINANCE12 0x8041
-#define GL_LUMINANCE16 0x8042
-#define GL_LUMINANCE4_ALPHA4 0x8043
-#define GL_LUMINANCE6_ALPHA2 0x8044
-#define GL_LUMINANCE8_ALPHA8 0x8045
-#define GL_LUMINANCE12_ALPHA4 0x8046
-#define GL_LUMINANCE12_ALPHA12 0x8047
-#define GL_LUMINANCE16_ALPHA16 0x8048
-#define GL_INTENSITY 0x8049
-#define GL_INTENSITY4 0x804A
-#define GL_INTENSITY8 0x804B
-#define GL_INTENSITY12 0x804C
-#define GL_INTENSITY16 0x804D
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE 0x8061
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-#define GL_TEXTURE_PRIORITY 0x8066
-#define GL_TEXTURE_RESIDENT 0x8067
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_INDEX_ARRAY 0x8077
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_EDGE_FLAG_ARRAY 0x8079
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_INDEX_ARRAY_TYPE 0x8085
-#define GL_INDEX_ARRAY_STRIDE 0x8086
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_INDEX_ARRAY_POINTER 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_EVAL_BIT 0x00010000
-#define GL_LIST_BIT 0x00020000
-#define GL_TEXTURE_BIT 0x00040000
-#define GL_SCISSOR_BIT 0x00080000
-#define GL_ALL_ATTRIB_BITS 0x000fffff
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff
-
-GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value);
-GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref);
-GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);
-GLAPI void GLAPIENTRY glArrayElement (GLint i);
-GLAPI void GLAPIENTRY glBegin (GLenum mode);
-GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture);
-GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GLAPI void GLAPIENTRY glCallList (GLuint list);
-GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists);
-GLAPI void GLAPIENTRY glClear (GLbitfield mask);
-GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void GLAPIENTRY glClearDepth (GLclampd depth);
-GLAPI void GLAPIENTRY glClearIndex (GLfloat c);
-GLAPI void GLAPIENTRY glClearStencil (GLint s);
-GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation);
-GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v);
-GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue);
-GLAPI void GLAPIENTRY glColor3iv (const GLint *v);
-GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue);
-GLAPI void GLAPIENTRY glColor3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v);
-GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue);
-GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v);
-GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue);
-GLAPI void GLAPIENTRY glColor3usv (const GLushort *v);
-GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v);
-GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
-GLAPI void GLAPIENTRY glColor4iv (const GLint *v);
-GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
-GLAPI void GLAPIENTRY glColor4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v);
-GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v);
-GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
-GLAPI void GLAPIENTRY glColor4usv (const GLushort *v);
-GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode);
-GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void GLAPIENTRY glCullFace (GLenum mode);
-GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range);
-GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GLAPI void GLAPIENTRY glDepthFunc (GLenum func);
-GLAPI void GLAPIENTRY glDepthMask (GLboolean flag);
-GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar);
-GLAPI void GLAPIENTRY glDisable (GLenum cap);
-GLAPI void GLAPIENTRY glDisableClientState (GLenum array);
-GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode);
-GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag);
-GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag);
-GLAPI void GLAPIENTRY glEnable (GLenum cap);
-GLAPI void GLAPIENTRY glEnableClientState (GLenum array);
-GLAPI void GLAPIENTRY glEnd (void);
-GLAPI void GLAPIENTRY glEndList (void);
-GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u);
-GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u);
-GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u);
-GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u);
-GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v);
-GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u);
-GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v);
-GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u);
-GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
-GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-GLAPI void GLAPIENTRY glEvalPoint1 (GLint i);
-GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j);
-GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
-GLAPI void GLAPIENTRY glFinish (void);
-GLAPI void GLAPIENTRY glFlush (void);
-GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glFrontFace (GLenum mode);
-GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range);
-GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
-GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation);
-GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params);
-GLAPI GLenum GLAPIENTRY glGetError (void);
-GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v);
-GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v);
-GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v);
-GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values);
-GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values);
-GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values);
-GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params);
-GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask);
-GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name);
-GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
-GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode);
-GLAPI void GLAPIENTRY glIndexMask (GLuint mask);
-GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glIndexd (GLdouble c);
-GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c);
-GLAPI void GLAPIENTRY glIndexf (GLfloat c);
-GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c);
-GLAPI void GLAPIENTRY glIndexi (GLint c);
-GLAPI void GLAPIENTRY glIndexiv (const GLint *c);
-GLAPI void GLAPIENTRY glIndexs (GLshort c);
-GLAPI void GLAPIENTRY glIndexsv (const GLshort *c);
-GLAPI void GLAPIENTRY glIndexub (GLubyte c);
-GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c);
-GLAPI void GLAPIENTRY glInitNames (void);
-GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer);
-GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap);
-GLAPI GLboolean GLAPIENTRY glIsList (GLuint list);
-GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture);
-GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern);
-GLAPI void GLAPIENTRY glLineWidth (GLfloat width);
-GLAPI void GLAPIENTRY glListBase (GLuint base);
-GLAPI void GLAPIENTRY glLoadIdentity (void);
-GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m);
-GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m);
-GLAPI void GLAPIENTRY glLoadName (GLuint name);
-GLAPI void GLAPIENTRY glLogicOp (GLenum opcode);
-GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
-GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
-GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glMatrixMode (GLenum mode);
-GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m);
-GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m);
-GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode);
-GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
-GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v);
-GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
-GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz);
-GLAPI void GLAPIENTRY glNormal3iv (const GLint *v);
-GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz);
-GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void GLAPIENTRY glPassThrough (GLfloat token);
-GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values);
-GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values);
-GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values);
-GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor);
-GLAPI void GLAPIENTRY glPointSize (GLfloat size);
-GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode);
-GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask);
-GLAPI void GLAPIENTRY glPopAttrib (void);
-GLAPI void GLAPIENTRY glPopClientAttrib (void);
-GLAPI void GLAPIENTRY glPopMatrix (void);
-GLAPI void GLAPIENTRY glPopName (void);
-GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask);
-GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask);
-GLAPI void GLAPIENTRY glPushMatrix (void);
-GLAPI void GLAPIENTRY glPushName (GLuint name);
-GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y);
-GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y);
-GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y);
-GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v);
-GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y);
-GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v);
-GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z);
-GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v);
-GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z);
-GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
-GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v);
-GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glReadBuffer (GLenum mode);
-GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2);
-GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2);
-GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
-GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2);
-GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2);
-GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode);
-GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer);
-GLAPI void GLAPIENTRY glShadeModel (GLenum mode);
-GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GLAPI void GLAPIENTRY glStencilMask (GLuint mask);
-GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s);
-GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s);
-GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord1i (GLint s);
-GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord1s (GLshort s);
-GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t);
-GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t);
-GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t);
-GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t);
-GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
-GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
-GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r);
-GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r);
-GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
-GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param);
-GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params);
-GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y);
-GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y);
-GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y);
-GLAPI void GLAPIENTRY glVertex2iv (const GLint *v);
-GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y);
-GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v);
-GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z);
-GLAPI void GLAPIENTRY glVertex3iv (const GLint *v);
-GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z);
-GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w);
-GLAPI void GLAPIENTRY glVertex4iv (const GLint *v);
-GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1)
-
-#endif /* GL_VERSION_1_1 */
-
-/* ---------------------------------- GLU ---------------------------------- */
-
-#ifndef GLEW_NO_GLU
-/* this is where we can safely include GLU */
-# if defined(__APPLE__) && defined(__MACH__)
-# include <OpenGL/glu.h>
-# else
-# include <GL/glu.h>
-# endif
-#endif
-
-/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-
-#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D)
-#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements)
-#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D)
-#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D)
-
-#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2)
-
-#endif /* GL_VERSION_1_2 */
-
-/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */
-
-#ifndef GL_VERSION_1_2_1
-#define GL_VERSION_1_2_1 1
-
-#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1)
-
-#endif /* GL_VERSION_1_2_1 */
-
-/* ----------------------------- GL_VERSION_1_3 ---------------------------- */
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_SUBTRACT 0x84E7
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-#define GL_MULTISAMPLE_BIT 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img);
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-
-#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture)
-#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture)
-#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D)
-#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D)
-#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D)
-#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D)
-#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D)
-#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D)
-#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage)
-#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd)
-#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf)
-#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd)
-#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf)
-#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d)
-#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv)
-#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f)
-#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv)
-#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i)
-#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv)
-#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s)
-#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv)
-#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d)
-#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv)
-#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f)
-#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv)
-#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i)
-#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv)
-#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s)
-#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv)
-#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d)
-#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv)
-#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f)
-#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv)
-#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i)
-#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv)
-#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s)
-#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv)
-#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d)
-#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv)
-#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f)
-#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv)
-#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i)
-#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv)
-#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s)
-#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv)
-#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage)
-
-#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3)
-
-#endif /* GL_VERSION_1_3 */
-
-/* ----------------------------- GL_VERSION_1_4 ---------------------------- */
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL 0x8500
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_DEPTH_TEXTURE_MODE 0x884B
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_COMPARE_R_TO_TEXTURE 0x884E
-
-typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p);
-
-#define glBlendColor GLEW_GET_FUN(__glewBlendColor)
-#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation)
-#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate)
-#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer)
-#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd)
-#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv)
-#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf)
-#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv)
-#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays)
-#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements)
-#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf)
-#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv)
-#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri)
-#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv)
-#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b)
-#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv)
-#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d)
-#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv)
-#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f)
-#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv)
-#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i)
-#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv)
-#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s)
-#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv)
-#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub)
-#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv)
-#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui)
-#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv)
-#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us)
-#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv)
-#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer)
-#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d)
-#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv)
-#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f)
-#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv)
-#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i)
-#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv)
-#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s)
-#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv)
-#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d)
-#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv)
-#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f)
-#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv)
-#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i)
-#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv)
-#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s)
-#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv)
-
-#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4)
-
-#endif /* GL_VERSION_1_4 */
-
-/* ----------------------------- GL_VERSION_1_5 ---------------------------- */
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-
-#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
-#define GL_FOG_COORD GL_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
-#define GL_SRC0_RGB GL_SOURCE0_RGB
-#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
-#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
-#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
-#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
-#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
-#define GL_SRC1_RGB GL_SOURCE1_RGB
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
-#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
-#define GL_SRC2_RGB GL_SOURCE2_RGB
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer);
-typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id);
-typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target);
-
-#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery)
-#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer)
-#define glBufferData GLEW_GET_FUN(__glewBufferData)
-#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData)
-#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers)
-#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries)
-#define glEndQuery GLEW_GET_FUN(__glewEndQuery)
-#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers)
-#define glGenQueries GLEW_GET_FUN(__glewGenQueries)
-#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv)
-#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv)
-#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData)
-#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv)
-#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv)
-#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv)
-#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer)
-#define glIsQuery GLEW_GET_FUN(__glewIsQuery)
-#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer)
-#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer)
-
-#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5)
-
-#endif /* GL_VERSION_1_5 */
-
-/* ----------------------------- GL_VERSION_2_0 ---------------------------- */
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-
-#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_POINT_SPRITE 0x8861
-#define GL_COORD_REPLACE 0x8862
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_COORDS 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-
-typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum);
-typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders);
-typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
-typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source);
-typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param);
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader);
-typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths);
-typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);
-
-#define glAttachShader GLEW_GET_FUN(__glewAttachShader)
-#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)
-#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate)
-#define glCompileShader GLEW_GET_FUN(__glewCompileShader)
-#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram)
-#define glCreateShader GLEW_GET_FUN(__glewCreateShader)
-#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram)
-#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader)
-#define glDetachShader GLEW_GET_FUN(__glewDetachShader)
-#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray)
-#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers)
-#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray)
-#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib)
-#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform)
-#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders)
-#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation)
-#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog)
-#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv)
-#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog)
-#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource)
-#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv)
-#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation)
-#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv)
-#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv)
-#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv)
-#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv)
-#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv)
-#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv)
-#define glIsProgram GLEW_GET_FUN(__glewIsProgram)
-#define glIsShader GLEW_GET_FUN(__glewIsShader)
-#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram)
-#define glShaderSource GLEW_GET_FUN(__glewShaderSource)
-#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate)
-#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate)
-#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate)
-#define glUniform1f GLEW_GET_FUN(__glewUniform1f)
-#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv)
-#define glUniform1i GLEW_GET_FUN(__glewUniform1i)
-#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv)
-#define glUniform2f GLEW_GET_FUN(__glewUniform2f)
-#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv)
-#define glUniform2i GLEW_GET_FUN(__glewUniform2i)
-#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv)
-#define glUniform3f GLEW_GET_FUN(__glewUniform3f)
-#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv)
-#define glUniform3i GLEW_GET_FUN(__glewUniform3i)
-#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv)
-#define glUniform4f GLEW_GET_FUN(__glewUniform4f)
-#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv)
-#define glUniform4i GLEW_GET_FUN(__glewUniform4i)
-#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv)
-#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv)
-#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv)
-#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv)
-#define glUseProgram GLEW_GET_FUN(__glewUseProgram)
-#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram)
-#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d)
-#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv)
-#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f)
-#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv)
-#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s)
-#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv)
-#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d)
-#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv)
-#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f)
-#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv)
-#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s)
-#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv)
-#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d)
-#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv)
-#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f)
-#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv)
-#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s)
-#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv)
-#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv)
-#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv)
-#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv)
-#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub)
-#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv)
-#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv)
-#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv)
-#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv)
-#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d)
-#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv)
-#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f)
-#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv)
-#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv)
-#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s)
-#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv)
-#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv)
-#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv)
-#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv)
-#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
-
-#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)
-
-#endif /* GL_VERSION_2_0 */
-
-/* ----------------------------- GL_VERSION_2_1 ---------------------------- */
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-
-#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB_ALPHA 0x8C42
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_SLUMINANCE_ALPHA 0x8C44
-#define GL_SLUMINANCE8_ALPHA8 0x8C45
-#define GL_SLUMINANCE 0x8C46
-#define GL_SLUMINANCE8 0x8C47
-#define GL_COMPRESSED_SRGB 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#define GL_COMPRESSED_SLUMINANCE 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
-
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-
-#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv)
-#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv)
-#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv)
-#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv)
-#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv)
-#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv)
-
-#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1)
-
-#endif /* GL_VERSION_2_1 */
-
-/* ----------------------------- GL_VERSION_3_0 ---------------------------- */
-
-#ifndef GL_VERSION_3_0
-#define GL_VERSION_3_0 1
-
-#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
-#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
-#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
-#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
-#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
-#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
-#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
-#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
-#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_CONTEXT_FLAGS 0x821E
-#define GL_DEPTH_BUFFER 0x8223
-#define GL_STENCIL_BUFFER 0x8224
-#define GL_COMPRESSED_RED 0x8225
-#define GL_COMPRESSED_RG 0x8226
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_CLAMP_VERTEX_COLOR 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR 0x891B
-#define GL_CLAMP_READ_COLOR 0x891C
-#define GL_FIXED_ONLY 0x891D
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_TEXTURE_1D_ARRAY 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_PRIMITIVES_GENERATED 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_GREEN_INTEGER 0x8D95
-#define GL_BLUE_INTEGER 0x8D96
-#define GL_ALPHA_INTEGER 0x8D97
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_BGR_INTEGER 0x8D9A
-#define GL_BGRA_INTEGER 0x8D9B
-#define GL_SAMPLER_1D_ARRAY 0x8DC0
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_1D 0x8DC9
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_QUERY_WAIT 0x8E13
-#define GL_QUERY_NO_WAIT 0x8E14
-#define GL_QUERY_BY_REGION_WAIT 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
-
-typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum);
-typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum);
-typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*);
-typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
-typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void);
-typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*);
-typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*);
-typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*);
-typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*);
-typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*);
-
-#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender)
-#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback)
-#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation)
-#define glClampColor GLEW_GET_FUN(__glewClampColor)
-#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi)
-#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv)
-#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv)
-#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv)
-#define glColorMaski GLEW_GET_FUN(__glewColorMaski)
-#define glDisablei GLEW_GET_FUN(__glewDisablei)
-#define glEnablei GLEW_GET_FUN(__glewEnablei)
-#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender)
-#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback)
-#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v)
-#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation)
-#define glGetStringi GLEW_GET_FUN(__glewGetStringi)
-#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv)
-#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv)
-#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying)
-#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv)
-#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv)
-#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv)
-#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi)
-#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv)
-#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv)
-#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings)
-#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui)
-#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv)
-#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui)
-#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv)
-#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui)
-#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv)
-#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui)
-#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv)
-#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i)
-#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv)
-#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui)
-#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv)
-#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i)
-#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv)
-#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui)
-#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv)
-#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i)
-#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv)
-#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui)
-#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv)
-#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv)
-#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i)
-#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv)
-#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv)
-#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv)
-#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui)
-#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv)
-#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv)
-#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer)
-
-#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0)
-
-#endif /* GL_VERSION_3_0 */
-
-/* ----------------------------- GL_VERSION_3_1 ---------------------------- */
-
-#ifndef GL_VERSION_3_1
-#define GL_VERSION_3_1 1
-
-#define GL_TEXTURE_RECTANGLE 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
-#define GL_SAMPLER_2D_RECT 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
-#define GL_TEXTURE_BUFFER 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E
-#define GL_SAMPLER_BUFFER 0x8DC2
-#define GL_INT_SAMPLER_2D_RECT 0x8DCD
-#define GL_INT_SAMPLER_BUFFER 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART 0x8F9D
-#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei);
-typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint);
-typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint);
-
-#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced)
-#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced)
-#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex)
-#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer)
-
-#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1)
-
-#endif /* GL_VERSION_3_1 */
-
-/* ----------------------------- GL_VERSION_3_2 ---------------------------- */
-
-#ifndef GL_VERSION_3_2
-#define GL_VERSION_3_2 1
-
-#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define GL_LINES_ADJACENCY 0x000A
-#define GL_LINE_STRIP_ADJACENCY 0x000B
-#define GL_TRIANGLES_ADJACENCY 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
-#define GL_PROGRAM_POINT_SIZE 0x8642
-#define GL_GEOMETRY_VERTICES_OUT 0x8916
-#define GL_GEOMETRY_INPUT_TYPE 0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_GEOMETRY_SHADER 0x8DD9
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_CONTEXT_PROFILE_MASK 0x9126
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *);
-typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *);
-
-#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture)
-#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v)
-#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v)
-
-#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2)
-
-#endif /* GL_VERSION_3_2 */
-
-/* ----------------------------- GL_VERSION_3_3 ---------------------------- */
-
-#ifndef GL_VERSION_3_3
-#define GL_VERSION_3_3 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-#define GL_RGB10_A2UI 0x906F
-
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-
-#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor)
-
-#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3)
-
-#endif /* GL_VERSION_3_3 */
-
-/* ----------------------------- GL_VERSION_4_0 ---------------------------- */
-
-#ifndef GL_VERSION_4_0
-#define GL_VERSION_4_0 1
-
-#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
-#define GL_SAMPLE_SHADING 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F
-#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
-
-#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei)
-#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi)
-#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei)
-#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci)
-#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading)
-
-#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0)
-
-#endif /* GL_VERSION_4_0 */
-
-/* ----------------------------- GL_VERSION_4_1 ---------------------------- */
-
-#ifndef GL_VERSION_4_1
-#define GL_VERSION_4_1 1
-
-#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1)
-
-#endif /* GL_VERSION_4_1 */
-
-/* ----------------------------- GL_VERSION_4_2 ---------------------------- */
-
-#ifndef GL_VERSION_4_2
-#define GL_VERSION_4_2 1
-
-#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2)
-
-#endif /* GL_VERSION_4_2 */
-
-/* -------------------------- GL_3DFX_multisample -------------------------- */
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-
-#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample)
-
-#endif /* GL_3DFX_multisample */
-
-/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-
-typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-
-#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX)
-
-#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer)
-
-#endif /* GL_3DFX_tbuffer */
-
-/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-
-#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1)
-
-#endif /* GL_3DFX_texture_compression_FXT1 */
-
-/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */
-
-#ifndef GL_AMD_blend_minmax_factor
-#define GL_AMD_blend_minmax_factor 1
-
-#define GL_FACTOR_MIN_AMD 0x901C
-#define GL_FACTOR_MAX_AMD 0x901D
-
-#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor)
-
-#endif /* GL_AMD_blend_minmax_factor */
-
-/* ----------------------- GL_AMD_conservative_depth ----------------------- */
-
-#ifndef GL_AMD_conservative_depth
-#define GL_AMD_conservative_depth 1
-
-#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth)
-
-#endif /* GL_AMD_conservative_depth */
-
-/* -------------------------- GL_AMD_debug_output -------------------------- */
-
-#ifndef GL_AMD_debug_output
-#define GL_AMD_debug_output 1
-
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
-#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
-#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
-#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
-#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
-#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
-#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
-#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
-#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
-#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
-
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
-
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void* userParam);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const char* buf);
-typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, char* message);
-
-#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD)
-#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD)
-#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD)
-#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD)
-
-#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output)
-
-#endif /* GL_AMD_debug_output */
-
-/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */
-
-#ifndef GL_AMD_depth_clamp_separate
-#define GL_AMD_depth_clamp_separate 1
-
-#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
-#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
-
-#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate)
-
-#endif /* GL_AMD_depth_clamp_separate */
-
-/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */
-
-#ifndef GL_AMD_draw_buffers_blend
-#define GL_AMD_draw_buffers_blend 1
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-
-#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD)
-#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD)
-#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD)
-#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD)
-
-#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend)
-
-#endif /* GL_AMD_draw_buffers_blend */
-
-/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */
-
-#ifndef GL_AMD_multi_draw_indirect
-#define GL_AMD_multi_draw_indirect 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride);
-
-#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD)
-#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD)
-
-#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect)
-
-#endif /* GL_AMD_multi_draw_indirect */
-
-/* ------------------------- GL_AMD_name_gen_delete ------------------------ */
-
-#ifndef GL_AMD_name_gen_delete
-#define GL_AMD_name_gen_delete 1
-
-#define GL_DATA_BUFFER_AMD 0x9151
-#define GL_PERFORMANCE_MONITOR_AMD 0x9152
-#define GL_QUERY_OBJECT_AMD 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
-#define GL_SAMPLER_OBJECT_AMD 0x9155
-
-typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names);
-typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names);
-typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
-
-#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD)
-#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD)
-#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD)
-
-#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete)
-
-#endif /* GL_AMD_name_gen_delete */
-
-/* ----------------------- GL_AMD_performance_monitor ---------------------- */
-
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_COUNTER_TYPE_AMD 0x8BC0
-#define GL_COUNTER_RANGE_AMD 0x8BC1
-#define GL_UNSIGNED_INT64_AMD 0x8BC2
-#define GL_PERCENTAGE_AMD 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
-#define GL_PERFMON_RESULT_AMD 0x8BC6
-
-typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors);
-typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void* data);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char *counterString);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, char *groupString);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList);
-
-#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD)
-#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD)
-#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD)
-#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD)
-#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD)
-#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD)
-#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD)
-#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD)
-#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD)
-#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD)
-#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD)
-
-#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor)
-
-#endif /* GL_AMD_performance_monitor */
-
-/* ------------------------ GL_AMD_sample_positions ------------------------ */
-
-#ifndef GL_AMD_sample_positions
-#define GL_AMD_sample_positions 1
-
-#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
-
-typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val);
-
-#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD)
-
-#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions)
-
-#endif /* GL_AMD_sample_positions */
-
-/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */
-
-#ifndef GL_AMD_seamless_cubemap_per_texture
-#define GL_AMD_seamless_cubemap_per_texture 1
-
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F
-
-#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture)
-
-#endif /* GL_AMD_seamless_cubemap_per_texture */
-
-/* ---------------------- GL_AMD_shader_stencil_export --------------------- */
-
-#ifndef GL_AMD_shader_stencil_export
-#define GL_AMD_shader_stencil_export 1
-
-#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export)
-
-#endif /* GL_AMD_shader_stencil_export */
-
-/* ------------------------ GL_AMD_texture_texture4 ------------------------ */
-
-#ifndef GL_AMD_texture_texture4
-#define GL_AMD_texture_texture4 1
-
-#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4)
-
-#endif /* GL_AMD_texture_texture4 */
-
-/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#define GL_AMD_transform_feedback3_lines_triangles 1
-
-#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles)
-
-#endif /* GL_AMD_transform_feedback3_lines_triangles */
-
-/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */
-
-#ifndef GL_AMD_vertex_shader_tessellator
-#define GL_AMD_vertex_shader_tessellator 1
-
-#define GL_SAMPLER_BUFFER_AMD 0x9001
-#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
-#define GL_TESSELLATION_MODE_AMD 0x9004
-#define GL_TESSELLATION_FACTOR_AMD 0x9005
-#define GL_DISCRETE_AMD 0x9006
-#define GL_CONTINUOUS_AMD 0x9007
-
-typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
-typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
-
-#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD)
-#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD)
-
-#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator)
-
-#endif /* GL_AMD_vertex_shader_tessellator */
-
-/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */
-
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_APPLE_aux_depth_stencil 1
-
-#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
-
-#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil)
-
-#endif /* GL_APPLE_aux_depth_stencil */
-
-/* ------------------------ GL_APPLE_client_storage ------------------------ */
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-
-#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage)
-
-#endif /* GL_APPLE_client_storage */
-
-/* ------------------------- GL_APPLE_element_array ------------------------ */
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-
-#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
-
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount);
-
-#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE)
-#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE)
-#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE)
-#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE)
-#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE)
-
-#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array)
-
-#endif /* GL_APPLE_element_array */
-
-/* ----------------------------- GL_APPLE_fence ---------------------------- */
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-
-typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences);
-typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences);
-typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-
-#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE)
-#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE)
-#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE)
-#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE)
-#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE)
-#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE)
-#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE)
-#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE)
-
-#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence)
-
-#endif /* GL_APPLE_fence */
-
-/* ------------------------- GL_APPLE_float_pixels ------------------------- */
-
-#ifndef GL_APPLE_float_pixels
-#define GL_APPLE_float_pixels 1
-
-#define GL_HALF_APPLE 0x140B
-#define GL_RGBA_FLOAT32_APPLE 0x8814
-#define GL_RGB_FLOAT32_APPLE 0x8815
-#define GL_ALPHA_FLOAT32_APPLE 0x8816
-#define GL_INTENSITY_FLOAT32_APPLE 0x8817
-#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
-#define GL_RGBA_FLOAT16_APPLE 0x881A
-#define GL_RGB_FLOAT16_APPLE 0x881B
-#define GL_ALPHA_FLOAT16_APPLE 0x881C
-#define GL_INTENSITY_FLOAT16_APPLE 0x881D
-#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
-#define GL_COLOR_FLOAT_APPLE 0x8A0F
-
-#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels)
-
-#endif /* GL_APPLE_float_pixels */
-
-/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_APPLE_flush_buffer_range 1
-
-#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
-#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
-
-typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
-
-#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE)
-#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE)
-
-#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range)
-
-#endif /* GL_APPLE_flush_buffer_range */
-
-/* ----------------------- GL_APPLE_object_purgeable ----------------------- */
-
-#ifndef GL_APPLE_object_purgeable
-#define GL_APPLE_object_purgeable 1
-
-#define GL_BUFFER_OBJECT_APPLE 0x85B3
-#define GL_RELEASED_APPLE 0x8A19
-#define GL_VOLATILE_APPLE 0x8A1A
-#define GL_RETAINED_APPLE 0x8A1B
-#define GL_UNDEFINED_APPLE 0x8A1C
-#define GL_PURGEABLE_APPLE 0x8A1D
-
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params);
-typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-
-#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE)
-#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE)
-#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE)
-
-#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable)
-
-#endif /* GL_APPLE_object_purgeable */
-
-/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */
-
-#ifndef GL_APPLE_pixel_buffer
-#define GL_APPLE_pixel_buffer 1
-
-#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10
-
-#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer)
-
-#endif /* GL_APPLE_pixel_buffer */
-
-/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */
-
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#define GL_RGB_422_APPLE 0x8A1F
-
-#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422)
-
-#endif /* GL_APPLE_rgb_422 */
-
-/* --------------------------- GL_APPLE_row_bytes -------------------------- */
-
-#ifndef GL_APPLE_row_bytes
-#define GL_APPLE_row_bytes 1
-
-#define GL_PACK_ROW_BYTES_APPLE 0x8A15
-#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
-
-#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes)
-
-#endif /* GL_APPLE_row_bytes */
-
-/* ------------------------ GL_APPLE_specular_vector ----------------------- */
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-
-#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector)
-
-#endif /* GL_APPLE_specular_vector */
-
-/* ------------------------- GL_APPLE_texture_range ------------------------ */
-
-#ifndef GL_APPLE_texture_range
-#define GL_APPLE_texture_range 1
-
-#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
-#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
-#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
-#define GL_STORAGE_PRIVATE_APPLE 0x85BD
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params);
-typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-
-#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE)
-#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE)
-
-#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range)
-
-#endif /* GL_APPLE_texture_range */
-
-/* ------------------------ GL_APPLE_transform_hint ------------------------ */
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-
-#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint)
-
-#endif /* GL_APPLE_transform_hint */
-
-/* ---------------------- GL_APPLE_vertex_array_object --------------------- */
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays);
-typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays);
-typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-
-#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE)
-#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE)
-#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE)
-#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE)
-
-#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object)
-
-#endif /* GL_APPLE_vertex_array_object */
-
-/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CLIENT_APPLE 0x85B4
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-
-typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer);
-
-#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE)
-#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE)
-#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE)
-
-#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range)
-
-#endif /* GL_APPLE_vertex_array_range */
-
-/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */
-
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_APPLE_vertex_program_evaluators 1
-
-#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
-#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
-#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
-#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
-#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
-#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
-#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
-#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
-#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
-#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
-
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points);
-
-#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE)
-#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE)
-#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE)
-#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE)
-#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE)
-#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE)
-#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE)
-
-#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators)
-
-#endif /* GL_APPLE_vertex_program_evaluators */
-
-/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-
-#define GL_YCBCR_422_APPLE 0x85B9
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-
-#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422)
-
-#endif /* GL_APPLE_ycbcr_422 */
-
-/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_ARB_ES2_compatibility 1
-
-#define GL_FIXED 0x140C
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);
-typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision);
-typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length);
-
-#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf)
-#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef)
-#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat)
-#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler)
-#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary)
-
-#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility)
-
-#endif /* GL_ARB_ES2_compatibility */
-
-/* -------------------------- GL_ARB_base_instance ------------------------- */
-
-#ifndef GL_ARB_base_instance
-#define GL_ARB_base_instance 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);
-
-#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance)
-#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance)
-#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance)
-
-#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance)
-
-#endif /* GL_ARB_base_instance */
-
-/* ----------------------- GL_ARB_blend_func_extended ---------------------- */
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_ARB_blend_func_extended 1
-
-#define GL_SRC1_COLOR 0x88F9
-#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const char * name);
-typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const char * name);
-
-#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed)
-#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex)
-
-#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended)
-
-#endif /* GL_ARB_blend_func_extended */
-
-/* ---------------------------- GL_ARB_cl_event ---------------------------- */
-
-#ifndef GL_ARB_cl_event
-#define GL_ARB_cl_event 1
-
-#define GL_SYNC_CL_EVENT_ARB 0x8240
-#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
-
-typedef struct _cl_context *cl_context;
-typedef struct _cl_event *cl_event;
-
-typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags);
-
-#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB)
-
-#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event)
-
-#endif /* GL_ARB_cl_event */
-
-/* ----------------------- GL_ARB_color_buffer_float ----------------------- */
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-
-typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-
-#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB)
-
-#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float)
-
-#endif /* GL_ARB_color_buffer_float */
-
-/* -------------------------- GL_ARB_compatibility ------------------------- */
-
-#ifndef GL_ARB_compatibility
-#define GL_ARB_compatibility 1
-
-#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility)
-
-#endif /* GL_ARB_compatibility */
-
-/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */
-
-#ifndef GL_ARB_compressed_texture_pixel_storage
-#define GL_ARB_compressed_texture_pixel_storage 1
-
-#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
-#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
-#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
-#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
-#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
-#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
-#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
-#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
-
-#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage)
-
-#endif /* GL_ARB_compressed_texture_pixel_storage */
-
-/* ----------------------- GL_ARB_conservative_depth ----------------------- */
-
-#ifndef GL_ARB_conservative_depth
-#define GL_ARB_conservative_depth 1
-
-#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth)
-
-#endif /* GL_ARB_conservative_depth */
-
-/* --------------------------- GL_ARB_copy_buffer -------------------------- */
-
-#ifndef GL_ARB_copy_buffer
-#define GL_ARB_copy_buffer 1
-
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
-
-typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
-
-#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData)
-
-#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer)
-
-#endif /* GL_ARB_copy_buffer */
-
-/* -------------------------- GL_ARB_debug_output -------------------------- */
-
-#ifndef GL_ARB_debug_output
-#define GL_ARB_debug_output 1
-
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
-#define GL_DEBUG_SOURCE_API_ARB 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
-#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
-#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
-#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
-#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
-
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
-
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, void* userParam);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* buf);
-typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, char* messageLog);
-
-#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB)
-#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB)
-#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB)
-#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB)
-
-#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output)
-
-#endif /* GL_ARB_debug_output */
-
-/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-
-#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float)
-
-#endif /* GL_ARB_depth_buffer_float */
-
-/* --------------------------- GL_ARB_depth_clamp -------------------------- */
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-
-#define GL_DEPTH_CLAMP 0x864F
-
-#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp)
-
-#endif /* GL_ARB_depth_clamp */
-
-/* -------------------------- GL_ARB_depth_texture ------------------------- */
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-
-#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture)
-
-#endif /* GL_ARB_depth_texture */
-
-/* -------------------------- GL_ARB_draw_buffers -------------------------- */
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs);
-
-#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB)
-
-#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers)
-
-#endif /* GL_ARB_draw_buffers */
-
-/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */
-
-#ifndef GL_ARB_draw_buffers_blend
-#define GL_ARB_draw_buffers_blend 1
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
-
-#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB)
-#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB)
-#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB)
-#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB)
-
-#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend)
-
-#endif /* GL_ARB_draw_buffers_blend */
-
-/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex);
-
-#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex)
-#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex)
-#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex)
-#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex)
-
-#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex)
-
-#endif /* GL_ARB_draw_elements_base_vertex */
-
-/* -------------------------- GL_ARB_draw_indirect ------------------------- */
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect);
-
-#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect)
-#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect)
-
-#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect)
-
-#endif /* GL_ARB_draw_indirect */
-
-/* ------------------------- GL_ARB_draw_instanced ------------------------- */
-
-#ifndef GL_ARB_draw_instanced
-#define GL_ARB_draw_instanced 1
-
-#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced)
-
-#endif /* GL_ARB_draw_instanced */
-
-/* -------------------- GL_ARB_explicit_attrib_location -------------------- */
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-
-#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location)
-
-#endif /* GL_ARB_explicit_attrib_location */
-
-/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-
-#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions)
-
-#endif /* GL_ARB_fragment_coord_conventions */
-
-/* ------------------------ GL_ARB_fragment_program ------------------------ */
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-
-#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program)
-
-#endif /* GL_ARB_fragment_program */
-
-/* --------------------- GL_ARB_fragment_program_shadow -------------------- */
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-
-#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow)
-
-#endif /* GL_ARB_fragment_program_shadow */
-
-/* ------------------------- GL_ARB_fragment_shader ------------------------ */
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-
-#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader)
-
-#endif /* GL_ARB_fragment_shader */
-
-/* ----------------------- GL_ARB_framebuffer_object ----------------------- */
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_INDEX 0x8222
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_SRGB 0x8C40
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_STENCIL_INDEX1 0x8D46
-#define GL_STENCIL_INDEX4 0x8D47
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_STENCIL_INDEX16 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
-typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer)
-#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer)
-#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer)
-#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus)
-#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)
-#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)
-#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)
-#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)
-#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)
-#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)
-#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer)
-#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers)
-#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers)
-#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap)
-#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv)
-#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv)
-#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer)
-#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer)
-#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage)
-#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample)
-
-#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object)
-
-#endif /* GL_ARB_framebuffer_object */
-
-/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-
-#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB)
-
-#endif /* GL_ARB_framebuffer_sRGB */
-
-/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_ARB_geometry_shader4 1
-
-#define GL_LINES_ADJACENCY_ARB 0xA
-#define GL_LINE_STRIP_ADJACENCY_ARB 0xB
-#define GL_TRIANGLES_ADJACENCY_ARB 0xC
-#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD
-#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
-#define GL_GEOMETRY_SHADER_ARB 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
-
-#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB)
-#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB)
-#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB)
-#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB)
-
-#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4)
-
-#endif /* GL_ARB_geometry_shader4 */
-
-/* ----------------------- GL_ARB_get_program_binary ----------------------- */
-
-#ifndef GL_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary);
-typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-
-#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary)
-#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary)
-#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri)
-
-#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary)
-
-#endif /* GL_ARB_get_program_binary */
-
-/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-
-#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-
-#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5)
-
-#endif /* GL_ARB_gpu_shader5 */
-
-/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-
-#define GL_DOUBLE_MAT2 0x8F46
-#define GL_DOUBLE_MAT3 0x8F47
-#define GL_DOUBLE_MAT4 0x8F48
-#define GL_DOUBLE_MAT2x3 0x8F49
-#define GL_DOUBLE_MAT2x4 0x8F4A
-#define GL_DOUBLE_MAT3x2 0x8F4B
-#define GL_DOUBLE_MAT3x4 0x8F4C
-#define GL_DOUBLE_MAT4x2 0x8F4D
-#define GL_DOUBLE_MAT4x3 0x8F4E
-#define GL_DOUBLE_VEC2 0x8FFC
-#define GL_DOUBLE_VEC3 0x8FFD
-#define GL_DOUBLE_VEC4 0x8FFE
-
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-
-#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv)
-#define glProgramUniform1dEXT GLEW_GET_FUN(__glewProgramUniform1dEXT)
-#define glProgramUniform1dvEXT GLEW_GET_FUN(__glewProgramUniform1dvEXT)
-#define glProgramUniform2dEXT GLEW_GET_FUN(__glewProgramUniform2dEXT)
-#define glProgramUniform2dvEXT GLEW_GET_FUN(__glewProgramUniform2dvEXT)
-#define glProgramUniform3dEXT GLEW_GET_FUN(__glewProgramUniform3dEXT)
-#define glProgramUniform3dvEXT GLEW_GET_FUN(__glewProgramUniform3dvEXT)
-#define glProgramUniform4dEXT GLEW_GET_FUN(__glewProgramUniform4dEXT)
-#define glProgramUniform4dvEXT GLEW_GET_FUN(__glewProgramUniform4dvEXT)
-#define glProgramUniformMatrix2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2dvEXT)
-#define glProgramUniformMatrix2x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3dvEXT)
-#define glProgramUniformMatrix2x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4dvEXT)
-#define glProgramUniformMatrix3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3dvEXT)
-#define glProgramUniformMatrix3x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2dvEXT)
-#define glProgramUniformMatrix3x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4dvEXT)
-#define glProgramUniformMatrix4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4dvEXT)
-#define glProgramUniformMatrix4x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2dvEXT)
-#define glProgramUniformMatrix4x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3dvEXT)
-#define glUniform1d GLEW_GET_FUN(__glewUniform1d)
-#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv)
-#define glUniform2d GLEW_GET_FUN(__glewUniform2d)
-#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv)
-#define glUniform3d GLEW_GET_FUN(__glewUniform3d)
-#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv)
-#define glUniform4d GLEW_GET_FUN(__glewUniform4d)
-#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv)
-#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv)
-#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv)
-#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv)
-#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv)
-#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv)
-#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv)
-#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv)
-#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv)
-#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv)
-
-#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64)
-
-#endif /* GL_ARB_gpu_shader_fp64 */
-
-/* ------------------------ GL_ARB_half_float_pixel ------------------------ */
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-
-#define GL_HALF_FLOAT_ARB 0x140B
-
-#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel)
-
-#endif /* GL_ARB_half_float_pixel */
-
-/* ------------------------ GL_ARB_half_float_vertex ----------------------- */
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-
-#define GL_HALF_FLOAT 0x140B
-
-#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex)
-
-#endif /* GL_ARB_half_float_vertex */
-
-/* ----------------------------- GL_ARB_imaging ---------------------------- */
-
-#ifndef GL_ARB_imaging
-#define GL_ARB_imaging 1
-
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_IGNORE_BORDER 0x8150
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_WRAP_BORDER 0x8152
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-
-typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-
-#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable)
-#define glColorTable GLEW_GET_FUN(__glewColorTable)
-#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv)
-#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv)
-#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D)
-#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D)
-#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf)
-#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv)
-#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri)
-#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv)
-#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable)
-#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable)
-#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D)
-#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D)
-#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable)
-#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv)
-#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv)
-#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter)
-#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv)
-#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv)
-#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram)
-#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv)
-#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv)
-#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax)
-#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv)
-#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv)
-#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter)
-#define glHistogram GLEW_GET_FUN(__glewHistogram)
-#define glMinmax GLEW_GET_FUN(__glewMinmax)
-#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram)
-#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax)
-#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D)
-
-#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging)
-
-#endif /* GL_ARB_imaging */
-
-/* ------------------------ GL_ARB_instanced_arrays ------------------------ */
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_ARB_instanced_arrays 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
-
-#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB)
-#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB)
-#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB)
-
-#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays)
-
-#endif /* GL_ARB_instanced_arrays */
-
-/* ---------------------- GL_ARB_internalformat_query ---------------------- */
-
-#ifndef GL_ARB_internalformat_query
-#define GL_ARB_internalformat_query 1
-
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-
-typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params);
-
-#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ)
-
-#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query)
-
-#endif /* GL_ARB_internalformat_query */
-
-/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */
-
-#ifndef GL_ARB_map_buffer_alignment
-#define GL_ARB_map_buffer_alignment 1
-
-#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
-
-#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment)
-
-#endif /* GL_ARB_map_buffer_alignment */
-
-/* ------------------------ GL_ARB_map_buffer_range ------------------------ */
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-
-typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-
-#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange)
-#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange)
-
-#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range)
-
-#endif /* GL_ARB_map_buffer_range */
-
-/* ------------------------- GL_ARB_matrix_palette ------------------------- */
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-
-typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices);
-
-#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB)
-#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB)
-#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB)
-#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB)
-#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB)
-
-#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette)
-
-#endif /* GL_ARB_matrix_palette */
-
-/* --------------------------- GL_ARB_multisample -------------------------- */
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-
-#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB)
-
-#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample)
-
-#endif /* GL_ARB_multisample */
-
-/* -------------------------- GL_ARB_multitexture -------------------------- */
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-
-typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-
-#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB)
-#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB)
-#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB)
-#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB)
-#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB)
-#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB)
-#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB)
-#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB)
-#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB)
-#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB)
-#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB)
-#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB)
-#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB)
-#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB)
-#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB)
-#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB)
-#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB)
-#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB)
-#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB)
-#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB)
-#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB)
-#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB)
-#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB)
-#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB)
-#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB)
-#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB)
-#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB)
-#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB)
-#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB)
-#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB)
-#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB)
-#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB)
-#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB)
-#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB)
-
-#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture)
-
-#endif /* GL_ARB_multitexture */
-
-/* ------------------------- GL_ARB_occlusion_query ------------------------ */
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id);
-
-#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB)
-#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB)
-#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB)
-#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB)
-#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB)
-#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB)
-#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB)
-#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB)
-
-#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query)
-
-#endif /* GL_ARB_occlusion_query */
-
-/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-
-#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2)
-
-#endif /* GL_ARB_occlusion_query2 */
-
-/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-
-#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object)
-
-#endif /* GL_ARB_pixel_buffer_object */
-
-/* ------------------------ GL_ARB_point_parameters ------------------------ */
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params);
-
-#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB)
-#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB)
-
-#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters)
-
-#endif /* GL_ARB_point_parameters */
-
-/* -------------------------- GL_ARB_point_sprite -------------------------- */
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-
-#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite)
-
-#endif /* GL_ARB_point_sprite */
-
-/* ------------------------ GL_ARB_provoking_vertex ------------------------ */
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_PROVOKING_VERTEX 0x8E4F
-
-typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
-
-#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex)
-
-#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex)
-
-#endif /* GL_ARB_provoking_vertex */
-
-/* --------------------------- GL_ARB_robustness --------------------------- */
-
-#ifndef GL_ARB_robustness
-#define GL_ARB_robustness 1
-
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
-
-typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table);
-typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img);
-typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image);
-typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values);
-typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v);
-typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values);
-typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values);
-typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values);
-typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values);
-typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern);
-typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span);
-typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data);
-
-#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB)
-#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB)
-#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB)
-#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB)
-#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB)
-#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB)
-#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB)
-#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB)
-#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB)
-#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB)
-#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB)
-#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB)
-#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB)
-#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB)
-#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB)
-#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB)
-#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB)
-#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB)
-#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB)
-#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB)
-
-#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness)
-
-#endif /* GL_ARB_robustness */
-
-/* ------------------------- GL_ARB_sample_shading ------------------------- */
-
-#ifndef GL_ARB_sample_shading
-#define GL_ARB_sample_shading 1
-
-#define GL_SAMPLE_SHADING_ARB 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
-
-typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);
-
-#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB)
-
-#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading)
-
-#endif /* GL_ARB_sample_shading */
-
-/* ------------------------- GL_ARB_sampler_objects ------------------------ */
-
-#ifndef GL_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-
-#define GL_SAMPLER_BINDING 0x8919
-
-typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers);
-typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params);
-
-#define glBindSampler GLEW_GET_FUN(__glewBindSampler)
-#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers)
-#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers)
-#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv)
-#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv)
-#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv)
-#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv)
-#define glIsSampler GLEW_GET_FUN(__glewIsSampler)
-#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv)
-#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv)
-#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf)
-#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv)
-#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri)
-#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv)
-
-#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects)
-
-#endif /* GL_ARB_sampler_objects */
-
-/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-
-#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map)
-
-#endif /* GL_ARB_seamless_cube_map */
-
-/* --------------------- GL_ARB_separate_shader_objects -------------------- */
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
-
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const char ** strings);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines);
-typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, char *infoLog);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-
-#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram)
-#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline)
-#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv)
-#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines)
-#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines)
-#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog)
-#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv)
-#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline)
-#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d)
-#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv)
-#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f)
-#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv)
-#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i)
-#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv)
-#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui)
-#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv)
-#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d)
-#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv)
-#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f)
-#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv)
-#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i)
-#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv)
-#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui)
-#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv)
-#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d)
-#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv)
-#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f)
-#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv)
-#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i)
-#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv)
-#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui)
-#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv)
-#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d)
-#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv)
-#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f)
-#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv)
-#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i)
-#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv)
-#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui)
-#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv)
-#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv)
-#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv)
-#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv)
-#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv)
-#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv)
-#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv)
-#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv)
-#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv)
-#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv)
-#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv)
-#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv)
-#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv)
-#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv)
-#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv)
-#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv)
-#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv)
-#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv)
-#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv)
-#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages)
-#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline)
-
-#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects)
-
-#endif /* GL_ARB_separate_shader_objects */
-
-/* --------------------- GL_ARB_shader_atomic_counters --------------------- */
-
-#ifndef GL_ARB_shader_atomic_counters
-#define GL_ARB_shader_atomic_counters 1
-
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
-#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
-#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
-#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
-#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
-#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
-#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
-#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
-#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
-#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
-
-typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params);
-
-#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv)
-
-#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters)
-
-#endif /* GL_ARB_shader_atomic_counters */
-
-/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */
-
-#ifndef GL_ARB_shader_bit_encoding
-#define GL_ARB_shader_bit_encoding 1
-
-#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding)
-
-#endif /* GL_ARB_shader_bit_encoding */
-
-/* --------------------- GL_ARB_shader_image_load_store -------------------- */
-
-#ifndef GL_ARB_shader_image_load_store
-#define GL_ARB_shader_image_load_store 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_MAX_IMAGE_UNITS 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
-#define GL_IMAGE_BINDING_NAME 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED 0x8F3C
-#define GL_IMAGE_BINDING_LAYER 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS 0x8F3E
-#define GL_IMAGE_1D 0x904C
-#define GL_IMAGE_2D 0x904D
-#define GL_IMAGE_3D 0x904E
-#define GL_IMAGE_2D_RECT 0x904F
-#define GL_IMAGE_CUBE 0x9050
-#define GL_IMAGE_BUFFER 0x9051
-#define GL_IMAGE_1D_ARRAY 0x9052
-#define GL_IMAGE_2D_ARRAY 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
-#define GL_INT_IMAGE_1D 0x9057
-#define GL_INT_IMAGE_2D 0x9058
-#define GL_INT_IMAGE_3D 0x9059
-#define GL_INT_IMAGE_2D_RECT 0x905A
-#define GL_INT_IMAGE_CUBE 0x905B
-#define GL_INT_IMAGE_BUFFER 0x905C
-#define GL_INT_IMAGE_1D_ARRAY 0x905D
-#define GL_INT_IMAGE_2D_ARRAY 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
-#define GL_MAX_IMAGE_SAMPLES 0x906D
-#define GL_IMAGE_BINDING_FORMAT 0x906E
-#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
-#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
-#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
-#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
-
-#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture)
-#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier)
-
-#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store)
-
-#endif /* GL_ARB_shader_image_load_store */
-
-/* ------------------------- GL_ARB_shader_objects ------------------------- */
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-
-typedef char GLcharARB;
-typedef unsigned int GLhandleARB;
-
-typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj);
-typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source);
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params);
-typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-
-#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB)
-#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB)
-#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB)
-#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB)
-#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB)
-#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB)
-#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB)
-#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB)
-#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB)
-#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB)
-#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB)
-#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB)
-#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB)
-#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB)
-#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB)
-#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB)
-#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB)
-#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB)
-#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB)
-#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB)
-#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB)
-#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB)
-#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB)
-#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB)
-#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB)
-#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB)
-#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB)
-#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB)
-#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB)
-#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB)
-#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB)
-#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB)
-#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB)
-#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB)
-#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB)
-#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB)
-#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB)
-#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB)
-#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB)
-
-#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects)
-
-#endif /* GL_ARB_shader_objects */
-
-/* ------------------------ GL_ARB_shader_precision ------------------------ */
-
-#ifndef GL_ARB_shader_precision
-#define GL_ARB_shader_precision 1
-
-#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision)
-
-#endif /* GL_ARB_shader_precision */
-
-/* ---------------------- GL_ARB_shader_stencil_export --------------------- */
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-
-#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export)
-
-#endif /* GL_ARB_shader_stencil_export */
-
-/* ------------------------ GL_ARB_shader_subroutine ----------------------- */
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-
-#define GL_ACTIVE_SUBROUTINES 0x8DE5
-#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
-#define GL_MAX_SUBROUTINES 0x8DE7
-#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
-#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
-#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
-#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
-
-typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, char *name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, char *name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values);
-typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const char* name);
-typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const char* name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices);
-
-#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName)
-#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName)
-#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv)
-#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv)
-#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex)
-#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation)
-#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv)
-#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv)
-
-#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine)
-
-#endif /* GL_ARB_shader_subroutine */
-
-/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */
-
-#ifndef GL_ARB_shader_texture_lod
-#define GL_ARB_shader_texture_lod 1
-
-#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod)
-
-#endif /* GL_ARB_shader_texture_lod */
-
-/* ---------------------- GL_ARB_shading_language_100 ---------------------- */
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-
-#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100)
-
-#endif /* GL_ARB_shading_language_100 */
-
-/* -------------------- GL_ARB_shading_language_420pack -------------------- */
-
-#ifndef GL_ARB_shading_language_420pack
-#define GL_ARB_shading_language_420pack 1
-
-#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack)
-
-#endif /* GL_ARB_shading_language_420pack */
-
-/* -------------------- GL_ARB_shading_language_include -------------------- */
-
-#ifndef GL_ARB_shading_language_include
-#define GL_ARB_shading_language_include 1
-
-#define GL_SHADER_INCLUDE_ARB 0x8DAE
-#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
-#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
-
-typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const char ** path, const GLint *length);
-typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const char* name);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const char* name, GLsizei bufSize, GLint *stringlen, char *string);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const char* name, GLenum pname, GLint *params);
-typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const char* name);
-typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const char* name, GLint stringlen, const char *string);
-
-#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB)
-#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB)
-#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB)
-#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB)
-#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB)
-#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB)
-
-#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include)
-
-#endif /* GL_ARB_shading_language_include */
-
-/* -------------------- GL_ARB_shading_language_packing -------------------- */
-
-#ifndef GL_ARB_shading_language_packing
-#define GL_ARB_shading_language_packing 1
-
-#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing)
-
-#endif /* GL_ARB_shading_language_packing */
-
-/* ----------------------------- GL_ARB_shadow ----------------------------- */
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-
-#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow)
-
-#endif /* GL_ARB_shadow */
-
-/* ------------------------- GL_ARB_shadow_ambient ------------------------- */
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-
-#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient)
-
-#endif /* GL_ARB_shadow_ambient */
-
-/* ------------------------------ GL_ARB_sync ------------------------------ */
-
-#ifndef GL_ARB_sync
-#define GL_ARB_sync 1
-
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
-
-typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout);
-typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync);
-typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags);
-typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params);
-typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values);
-typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync);
-typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout);
-
-#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync)
-#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync)
-#define glFenceSync GLEW_GET_FUN(__glewFenceSync)
-#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v)
-#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv)
-#define glIsSync GLEW_GET_FUN(__glewIsSync)
-#define glWaitSync GLEW_GET_FUN(__glewWaitSync)
-
-#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync)
-
-#endif /* GL_ARB_sync */
-
-/* ----------------------- GL_ARB_tessellation_shader ---------------------- */
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-
-#define GL_PATCHES 0xE
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_PATCH_VERTICES 0x8E72
-#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
-#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
-#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
-#define GL_TESS_GEN_MODE 0x8E76
-#define GL_TESS_GEN_SPACING 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
-#define GL_TESS_GEN_POINT_MODE 0x8E79
-#define GL_ISOLINES 0x8E7A
-#define GL_FRACTIONAL_ODD 0x8E7B
-#define GL_FRACTIONAL_EVEN 0x8E7C
-#define GL_MAX_PATCH_VERTICES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_TESS_EVALUATION_SHADER 0x8E87
-#define GL_TESS_CONTROL_SHADER 0x8E88
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-
-typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values);
-typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-
-#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv)
-#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri)
-
-#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader)
-
-#endif /* GL_ARB_tessellation_shader */
-
-/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-
-#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp)
-
-#endif /* GL_ARB_texture_border_clamp */
-
-/* ---------------------- GL_ARB_texture_buffer_object --------------------- */
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_ARB_texture_buffer_object 1
-
-#define GL_TEXTURE_BUFFER_ARB 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
-
-typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-
-#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB)
-
-#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object)
-
-#endif /* GL_ARB_texture_buffer_object */
-
-/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-
-#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32)
-
-#endif /* GL_ARB_texture_buffer_object_rgb32 */
-
-/* ----------------------- GL_ARB_texture_compression ---------------------- */
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img);
-
-#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB)
-#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB)
-#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB)
-#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB)
-#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB)
-#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB)
-#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB)
-
-#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression)
-
-#endif /* GL_ARB_texture_compression */
-
-/* -------------------- GL_ARB_texture_compression_bptc -------------------- */
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_ARB_texture_compression_bptc 1
-
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-
-#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc)
-
-#endif /* GL_ARB_texture_compression_bptc */
-
-/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-
-#define GL_COMPRESSED_RED_RGTC1 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
-#define GL_COMPRESSED_RG_RGTC2 0x8DBD
-#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
-
-#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc)
-
-#endif /* GL_ARB_texture_compression_rgtc */
-
-/* ------------------------ GL_ARB_texture_cube_map ------------------------ */
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-
-#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map)
-
-#endif /* GL_ARB_texture_cube_map */
-
-/* --------------------- GL_ARB_texture_cube_map_array --------------------- */
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_ARB_texture_cube_map_array 1
-
-#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
-
-#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array)
-
-#endif /* GL_ARB_texture_cube_map_array */
-
-/* ------------------------- GL_ARB_texture_env_add ------------------------ */
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-
-#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add)
-
-#endif /* GL_ARB_texture_env_add */
-
-/* ----------------------- GL_ARB_texture_env_combine ---------------------- */
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-
-#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine)
-
-#endif /* GL_ARB_texture_env_combine */
-
-/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-
-#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar)
-
-#endif /* GL_ARB_texture_env_crossbar */
-
-/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-
-#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3)
-
-#endif /* GL_ARB_texture_env_dot3 */
-
-/* -------------------------- GL_ARB_texture_float ------------------------- */
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-
-#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float)
-
-#endif /* GL_ARB_texture_float */
-
-/* ------------------------- GL_ARB_texture_gather ------------------------- */
-
-#ifndef GL_ARB_texture_gather
-#define GL_ARB_texture_gather 1
-
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
-
-#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather)
-
-#endif /* GL_ARB_texture_gather */
-
-/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-
-#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat)
-
-#endif /* GL_ARB_texture_mirrored_repeat */
-
-/* ----------------------- GL_ARB_texture_multisample ---------------------- */
-
-#ifndef GL_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
-#define GL_MAX_INTEGER_SAMPLES 0x9110
-
-typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val);
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-
-#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv)
-#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski)
-#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample)
-#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample)
-
-#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample)
-
-#endif /* GL_ARB_texture_multisample */
-
-/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-
-#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two)
-
-#endif /* GL_ARB_texture_non_power_of_two */
-
-/* ------------------------ GL_ARB_texture_query_lod ----------------------- */
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-
-#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod)
-
-#endif /* GL_ARB_texture_query_lod */
-
-/* ------------------------ GL_ARB_texture_rectangle ----------------------- */
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-
-#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle)
-
-#endif /* GL_ARB_texture_rectangle */
-
-/* --------------------------- GL_ARB_texture_rg --------------------------- */
-
-#ifndef GL_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-
-#define GL_RED 0x1903
-#define GL_COMPRESSED_RED 0x8225
-#define GL_COMPRESSED_RG 0x8226
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_R16 0x822A
-#define GL_RG8 0x822B
-#define GL_RG16 0x822C
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-
-#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg)
-
-#endif /* GL_ARB_texture_rg */
-
-/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-
-#define GL_RGB10_A2UI 0x906F
-
-#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui)
-
-#endif /* GL_ARB_texture_rgb10_a2ui */
-
-/* ------------------------- GL_ARB_texture_storage ------------------------ */
-
-#ifndef GL_ARB_texture_storage
-#define GL_ARB_texture_storage 1
-
-#define GL_ALPHA8_EXT 0x803C
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D)
-#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D)
-#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D)
-#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT)
-#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT)
-#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT)
-
-#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage)
-
-#endif /* GL_ARB_texture_storage */
-
-/* ------------------------- GL_ARB_texture_swizzle ------------------------ */
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-
-#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle)
-
-#endif /* GL_ARB_texture_swizzle */
-
-/* --------------------------- GL_ARB_timer_query -------------------------- */
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-
-#define GL_TIME_ELAPSED 0x88BF
-#define GL_TIMESTAMP 0x8E28
-
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params);
-typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
-
-#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v)
-#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v)
-#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter)
-
-#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query)
-
-#endif /* GL_ARB_timer_query */
-
-/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_ARB_transform_feedback2 1
-
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-
-typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
-typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids);
-typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-
-#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback)
-#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks)
-#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback)
-#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks)
-#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback)
-#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback)
-#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback)
-
-#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2)
-
-#endif /* GL_ARB_transform_feedback2 */
-
-/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-
-#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
-typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
-typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params);
-
-#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed)
-#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream)
-#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed)
-#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv)
-
-#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3)
-
-#endif /* GL_ARB_transform_feedback3 */
-
-/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */
-
-#ifndef GL_ARB_transform_feedback_instanced
-#define GL_ARB_transform_feedback_instanced 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);
-
-#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced)
-#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced)
-
-#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced)
-
-#endif /* GL_ARB_transform_feedback_instanced */
-
-/* ------------------------ GL_ARB_transpose_matrix ------------------------ */
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);
-
-#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB)
-#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB)
-#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB)
-#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB)
-
-#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix)
-
-#endif /* GL_ARB_transpose_matrix */
-
-/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_ARB_uniform_buffer_object 1
-
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, char* uniformBlockName);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, char* uniformName);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data);
-typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const char* uniformBlockName);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const char** uniformNames, GLuint* uniformIndices);
-typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-
-#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase)
-#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange)
-#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName)
-#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv)
-#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName)
-#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv)
-#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v)
-#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex)
-#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices)
-#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding)
-
-#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object)
-
-#endif /* GL_ARB_uniform_buffer_object */
-
-/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */
-
-#ifndef GL_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-
-#define GL_BGRA 0x80E1
-
-#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra)
-
-#endif /* GL_ARB_vertex_array_bgra */
-
-/* ----------------------- GL_ARB_vertex_array_object ---------------------- */
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays);
-typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays);
-typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array);
-
-#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray)
-#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays)
-#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays)
-#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray)
-
-#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object)
-
-#endif /* GL_ARB_vertex_array_object */
-
-/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */
-
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-
-#define GL_DOUBLE_MAT2 0x8F46
-#define GL_DOUBLE_MAT3 0x8F47
-#define GL_DOUBLE_MAT4 0x8F48
-#define GL_DOUBLE_VEC2 0x8FFC
-#define GL_DOUBLE_VEC3 0x8FFD
-#define GL_DOUBLE_VEC4 0x8FFE
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);
-
-#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv)
-#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d)
-#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv)
-#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d)
-#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv)
-#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d)
-#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv)
-#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d)
-#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv)
-#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer)
-
-#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit)
-
-#endif /* GL_ARB_vertex_attrib_64bit */
-
-/* -------------------------- GL_ARB_vertex_blend -------------------------- */
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-
-typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count);
-typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights);
-
-#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB)
-#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB)
-#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB)
-#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB)
-#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB)
-#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB)
-#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB)
-#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB)
-#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB)
-#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB)
-
-#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend)
-
-#endif /* GL_ARB_vertex_blend */
-
-/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data);
-typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-
-#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB)
-#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB)
-#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB)
-#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB)
-#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB)
-#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB)
-#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB)
-#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB)
-#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB)
-#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB)
-#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB)
-
-#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object)
-
-#endif /* GL_ARB_vertex_buffer_object */
-
-/* ------------------------- GL_ARB_vertex_program ------------------------- */
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-
-typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer);
-
-#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB)
-#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB)
-#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB)
-#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB)
-#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB)
-#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB)
-#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB)
-#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB)
-#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB)
-#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB)
-#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB)
-#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB)
-#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB)
-#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB)
-#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB)
-#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB)
-#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB)
-#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB)
-#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB)
-#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB)
-#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB)
-#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB)
-#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB)
-#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB)
-#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB)
-#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB)
-#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB)
-#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB)
-#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB)
-#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB)
-#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB)
-#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB)
-#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB)
-#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB)
-#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB)
-#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB)
-#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB)
-#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB)
-#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB)
-#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB)
-#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB)
-#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB)
-#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB)
-#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB)
-#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB)
-#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB)
-#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB)
-#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB)
-#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB)
-#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB)
-#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB)
-#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB)
-#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB)
-#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB)
-#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB)
-#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB)
-#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB)
-#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB)
-#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB)
-#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB)
-#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB)
-#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB)
-
-#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program)
-
-#endif /* GL_ARB_vertex_program */
-
-/* -------------------------- GL_ARB_vertex_shader ------------------------- */
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-
-typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);
-
-#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB)
-#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB)
-#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB)
-
-#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader)
-
-#endif /* GL_ARB_vertex_shader */
-
-/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-#define GL_ARB_vertex_type_2_10_10_10_rev 1
-
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_INT_2_10_10_10_REV 0x8D9F
-
-typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color);
-typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
-typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value);
-
-#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui)
-#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv)
-#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui)
-#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv)
-#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui)
-#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv)
-#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui)
-#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv)
-#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui)
-#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv)
-#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui)
-#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv)
-#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui)
-#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv)
-#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui)
-#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv)
-#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui)
-#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv)
-#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui)
-#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv)
-#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui)
-#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv)
-#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui)
-#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv)
-#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui)
-#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv)
-#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui)
-#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv)
-#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui)
-#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv)
-#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui)
-#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv)
-#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui)
-#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv)
-#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui)
-#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv)
-#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui)
-#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv)
-
-#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev)
-
-#endif /* GL_ARB_vertex_type_2_10_10_10_rev */
-
-/* ------------------------- GL_ARB_viewport_array ------------------------- */
-
-#ifndef GL_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_MAX_VIEWPORTS 0x825B
-#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
-#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
-#define GL_LAYER_PROVOKING_VERTEX 0x825E
-#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
-#define GL_UNDEFINED_VERTEX 0x8260
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_PROVOKING_VERTEX 0x8E4F
-
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data);
-typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v);
-typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v);
-
-#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv)
-#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed)
-#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v)
-#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v)
-#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv)
-#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed)
-#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv)
-#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv)
-#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf)
-#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv)
-
-#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array)
-
-#endif /* GL_ARB_viewport_array */
-
-/* --------------------------- GL_ARB_window_pos --------------------------- */
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p);
-
-#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB)
-#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB)
-#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB)
-#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB)
-#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB)
-#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB)
-#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB)
-#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB)
-#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB)
-#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB)
-#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB)
-#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB)
-#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB)
-#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB)
-#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB)
-#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB)
-
-#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos)
-
-#endif /* GL_ARB_window_pos */
-
-/* ------------------------- GL_ATIX_point_sprites ------------------------- */
-
-#ifndef GL_ATIX_point_sprites
-#define GL_ATIX_point_sprites 1
-
-#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0
-#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1
-#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2
-#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3
-#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4
-#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5
-
-#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites)
-
-#endif /* GL_ATIX_point_sprites */
-
-/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */
-
-#ifndef GL_ATIX_texture_env_combine3
-#define GL_ATIX_texture_env_combine3 1
-
-#define GL_MODULATE_ADD_ATIX 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745
-#define GL_MODULATE_SUBTRACT_ATIX 0x8746
-
-#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3)
-
-#endif /* GL_ATIX_texture_env_combine3 */
-
-/* ----------------------- GL_ATIX_texture_env_route ----------------------- */
-
-#ifndef GL_ATIX_texture_env_route
-#define GL_ATIX_texture_env_route 1
-
-#define GL_SECONDARY_COLOR_ATIX 0x8747
-#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748
-#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
-
-#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route)
-
-#endif /* GL_ATIX_texture_env_route */
-
-/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */
-
-#ifndef GL_ATIX_vertex_shader_output_point_size
-#define GL_ATIX_vertex_shader_output_point_size 1
-
-#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E
-
-#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size)
-
-#endif /* GL_ATIX_vertex_shader_output_point_size */
-
-/* -------------------------- GL_ATI_draw_buffers -------------------------- */
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
-
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs);
-
-#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI)
-
-#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers)
-
-#endif /* GL_ATI_draw_buffers */
-
-/* -------------------------- GL_ATI_element_array ------------------------- */
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer);
-
-#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI)
-#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI)
-#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI)
-
-#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array)
-
-#endif /* GL_ATI_element_array */
-
-/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-
-#define GL_BUMP_ROT_MATRIX_ATI 0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#define GL_DU8DV8_ATI 0x877A
-#define GL_BUMP_ENVMAP_ATI 0x877B
-#define GL_BUMP_TARGET_ATI 0x877C
-
-typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-
-#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI)
-#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI)
-#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI)
-#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI)
-
-#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap)
-
-#endif /* GL_ATI_envmap_bumpmap */
-
-/* ------------------------- GL_ATI_fragment_shader ------------------------ */
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_COMP_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_NEGATE_BIT_ATI 0x00000004
-#define GL_BIAS_BIT_ATI 0x00000008
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#define GL_FRAGMENT_SHADER_ATI 0x8920
-#define GL_REG_0_ATI 0x8921
-#define GL_REG_1_ATI 0x8922
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-
-typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value);
-
-#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI)
-#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI)
-#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI)
-#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI)
-#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI)
-#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI)
-#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI)
-#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI)
-#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI)
-#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI)
-#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI)
-#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI)
-#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI)
-#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI)
-
-#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader)
-
-#endif /* GL_ATI_fragment_shader */
-
-/* ------------------------ GL_ATI_map_object_buffer ----------------------- */
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-
-typedef void* (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-
-#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI)
-#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI)
-
-#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer)
-
-#endif /* GL_ATI_map_object_buffer */
-
-/* ----------------------------- GL_ATI_meminfo ---------------------------- */
-
-#ifndef GL_ATI_meminfo
-#define GL_ATI_meminfo 1
-
-#define GL_VBO_FREE_MEMORY_ATI 0x87FB
-#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
-#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
-
-#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo)
-
-#endif /* GL_ATI_meminfo */
-
-/* -------------------------- GL_ATI_pn_triangles -------------------------- */
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-
-#define GL_PN_TRIANGLES_ATI 0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-
-typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-
-#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI)
-#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI)
-
-#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles)
-
-#endif /* GL_ATI_pn_triangles */
-
-/* ------------------------ GL_ATI_separate_stencil ------------------------ */
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-
-typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-
-#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI)
-#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI)
-
-#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil)
-
-#endif /* GL_ATI_separate_stencil */
-
-/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */
-
-#ifndef GL_ATI_shader_texture_lod
-#define GL_ATI_shader_texture_lod 1
-
-#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod)
-
-#endif /* GL_ATI_shader_texture_lod */
-
-/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-
-#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader)
-
-#endif /* GL_ATI_text_fragment_shader */
-
-/* --------------------- GL_ATI_texture_compression_3dc -------------------- */
-
-#ifndef GL_ATI_texture_compression_3dc
-#define GL_ATI_texture_compression_3dc 1
-
-#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
-
-#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc)
-
-#endif /* GL_ATI_texture_compression_3dc */
-
-/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-
-#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3)
-
-#endif /* GL_ATI_texture_env_combine3 */
-
-/* -------------------------- GL_ATI_texture_float ------------------------- */
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
-
-#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float)
-
-#endif /* GL_ATI_texture_float */
-
-/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
-
-#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once)
-
-#endif /* GL_ATI_texture_mirror_once */
-
-/* ----------------------- GL_ATI_vertex_array_object ---------------------- */
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-
-#define GL_STATIC_ATI 0x8760
-#define GL_DYNAMIC_ATI 0x8761
-#define GL_PRESERVE_ATI 0x8762
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
-
-typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve);
-typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-
-#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI)
-#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI)
-#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI)
-#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI)
-#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI)
-#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI)
-#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI)
-#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI)
-#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI)
-#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI)
-#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI)
-#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI)
-
-#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object)
-
-#endif /* GL_ATI_vertex_array_object */
-
-/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-
-#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI)
-#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI)
-#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI)
-
-#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object)
-
-#endif /* GL_ATI_vertex_attrib_array_object */
-
-/* ------------------------- GL_ATI_vertex_streams ------------------------- */
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-
-#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
-#define GL_VERTEX_SOURCE_ATI 0x876C
-#define GL_VERTEX_STREAM0_ATI 0x876D
-#define GL_VERTEX_STREAM1_ATI 0x876E
-#define GL_VERTEX_STREAM2_ATI 0x876F
-#define GL_VERTEX_STREAM3_ATI 0x8770
-#define GL_VERTEX_STREAM4_ATI 0x8771
-#define GL_VERTEX_STREAM5_ATI 0x8772
-#define GL_VERTEX_STREAM6_ATI 0x8773
-#define GL_VERTEX_STREAM7_ATI 0x8774
-
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *v);
-
-#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI)
-#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI)
-#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI)
-#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI)
-#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI)
-#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI)
-#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI)
-#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI)
-#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI)
-#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI)
-#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI)
-#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI)
-#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI)
-#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI)
-#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI)
-#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI)
-#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI)
-#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI)
-#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI)
-#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI)
-#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI)
-#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI)
-#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI)
-#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI)
-#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI)
-#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI)
-#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI)
-#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI)
-#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI)
-#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI)
-#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI)
-#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI)
-#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI)
-#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI)
-#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI)
-#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI)
-#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI)
-
-#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams)
-
-#endif /* GL_ATI_vertex_streams */
-
-/* --------------------------- GL_EXT_422_pixels --------------------------- */
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-
-#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels)
-
-#endif /* GL_EXT_422_pixels */
-
-/* ---------------------------- GL_EXT_Cg_shader --------------------------- */
-
-#ifndef GL_EXT_Cg_shader
-#define GL_EXT_Cg_shader 1
-
-#define GL_CG_VERTEX_SHADER_EXT 0x890E
-#define GL_CG_FRAGMENT_SHADER_EXT 0x890F
-
-#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader)
-
-#endif /* GL_EXT_Cg_shader */
-
-/* ------------------------------ GL_EXT_abgr ------------------------------ */
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-
-#define GL_ABGR_EXT 0x8000
-
-#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr)
-
-#endif /* GL_EXT_abgr */
-
-/* ------------------------------ GL_EXT_bgra ------------------------------ */
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-
-#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra)
-
-#endif /* GL_EXT_bgra */
-
-/* ------------------------ GL_EXT_bindable_uniform ------------------------ */
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_EXT_bindable_uniform 1
-
-#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
-#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
-#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
-#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
-#define GL_UNIFORM_BUFFER_EXT 0x8DEE
-#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
-
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
-typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
-typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
-
-#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT)
-#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT)
-#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT)
-
-#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform)
-
-#endif /* GL_EXT_bindable_uniform */
-
-/* --------------------------- GL_EXT_blend_color -------------------------- */
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
-
-typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-
-#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT)
-
-#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color)
-
-#endif /* GL_EXT_blend_color */
-
-/* --------------------- GL_EXT_blend_equation_separate -------------------- */
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-
-#define GL_BLEND_EQUATION_RGB_EXT 0x8009
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-
-#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT)
-
-#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate)
-
-#endif /* GL_EXT_blend_equation_separate */
-
-/* ----------------------- GL_EXT_blend_func_separate ---------------------- */
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-
-#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT)
-
-#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate)
-
-#endif /* GL_EXT_blend_func_separate */
-
-/* ------------------------- GL_EXT_blend_logic_op ------------------------- */
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-
-#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op)
-
-#endif /* GL_EXT_blend_logic_op */
-
-/* -------------------------- GL_EXT_blend_minmax -------------------------- */
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_BLEND_EQUATION_EXT 0x8009
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-
-#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT)
-
-#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax)
-
-#endif /* GL_EXT_blend_minmax */
-
-/* ------------------------- GL_EXT_blend_subtract ------------------------- */
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-
-#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract)
-
-#endif /* GL_EXT_blend_subtract */
-
-/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-
-#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint)
-
-#endif /* GL_EXT_clip_volume_hint */
-
-/* ------------------------------ GL_EXT_cmyka ----------------------------- */
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-
-#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka)
-
-#endif /* GL_EXT_cmyka */
-
-/* ------------------------- GL_EXT_color_subtable ------------------------- */
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-
-typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-
-#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT)
-#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT)
-
-#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable)
-
-#endif /* GL_EXT_color_subtable */
-
-/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-
-typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void);
-
-#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT)
-#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT)
-
-#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array)
-
-#endif /* GL_EXT_compiled_vertex_array */
-
-/* --------------------------- GL_EXT_convolution -------------------------- */
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span);
-typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column);
-
-#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT)
-#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT)
-#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT)
-#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT)
-#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT)
-#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT)
-#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT)
-#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT)
-#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT)
-#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT)
-#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT)
-#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT)
-#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT)
-
-#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution)
-
-#endif /* GL_EXT_convolution */
-
-/* ------------------------ GL_EXT_coordinate_frame ------------------------ */
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-
-typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer);
-typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer);
-
-#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT)
-#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT)
-
-#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame)
-
-#endif /* GL_EXT_coordinate_frame */
-
-/* -------------------------- GL_EXT_copy_texture -------------------------- */
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-
-typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT)
-#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT)
-#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT)
-#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT)
-#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT)
-
-#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture)
-
-#endif /* GL_EXT_copy_texture */
-
-/* --------------------------- GL_EXT_cull_vertex -------------------------- */
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-
-typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params);
-
-#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT)
-#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT)
-
-#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex)
-
-#endif /* GL_EXT_cull_vertex */
-
-/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-
-#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
-#define GL_DEPTH_BOUNDS_EXT 0x8891
-
-typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-
-#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT)
-
-#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test)
-
-#endif /* GL_EXT_depth_bounds_test */
-
-/* ----------------------- GL_EXT_direct_state_access ---------------------- */
-
-#ifndef GL_EXT_direct_state_access
-#define GL_EXT_direct_state_access 1
-
-#define GL_PROGRAM_MATRIX_EXT 0x8E2D
-#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
-#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
-
-typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
-typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
-typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);
-typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);
-typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels);
-typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
-typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode);
-typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode);
-typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data);
-typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string);
-typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param);
-typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
-typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-
-#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT)
-#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT)
-#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT)
-#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT)
-#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT)
-#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT)
-#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT)
-#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT)
-#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT)
-#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT)
-#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT)
-#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT)
-#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT)
-#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT)
-#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT)
-#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT)
-#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT)
-#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT)
-#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT)
-#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT)
-#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT)
-#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT)
-#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT)
-#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT)
-#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT)
-#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT)
-#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT)
-#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT)
-#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT)
-#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT)
-#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT)
-#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT)
-#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT)
-#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT)
-#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT)
-#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT)
-#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT)
-#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT)
-#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT)
-#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT)
-#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT)
-#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT)
-#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT)
-#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT)
-#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT)
-#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT)
-#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT)
-#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT)
-#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT)
-#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT)
-#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT)
-#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT)
-#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT)
-#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT)
-#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT)
-#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT)
-#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT)
-#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT)
-#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT)
-#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT)
-#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT)
-#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT)
-#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT)
-#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT)
-#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT)
-#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT)
-#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT)
-#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT)
-#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT)
-#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT)
-#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT)
-#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT)
-#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT)
-#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT)
-#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT)
-#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT)
-#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT)
-#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT)
-#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT)
-#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT)
-#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT)
-#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT)
-#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT)
-#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT)
-#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT)
-#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT)
-#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT)
-#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT)
-#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT)
-#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT)
-#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT)
-#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT)
-#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT)
-#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT)
-#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT)
-#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT)
-#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT)
-#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT)
-#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT)
-#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT)
-#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT)
-#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT)
-#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT)
-#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT)
-#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT)
-#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT)
-#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT)
-#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT)
-#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT)
-#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT)
-#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT)
-#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT)
-#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT)
-#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT)
-#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT)
-#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT)
-#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT)
-#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT)
-#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT)
-#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT)
-#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT)
-#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT)
-#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT)
-#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT)
-#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT)
-#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT)
-#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT)
-#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT)
-#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT)
-#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT)
-#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT)
-#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT)
-#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT)
-#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT)
-#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT)
-#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT)
-#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT)
-#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT)
-#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT)
-#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT)
-#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT)
-#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT)
-#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT)
-#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT)
-#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT)
-#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT)
-#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT)
-#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT)
-#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT)
-#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT)
-#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT)
-#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT)
-#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT)
-#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT)
-#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT)
-#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT)
-#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT)
-#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT)
-#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT)
-#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT)
-#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT)
-#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT)
-#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT)
-#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT)
-#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT)
-#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT)
-#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT)
-#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT)
-#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT)
-#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT)
-#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT)
-#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT)
-#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT)
-#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT)
-#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT)
-#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT)
-#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT)
-#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT)
-#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT)
-#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT)
-#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT)
-#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT)
-#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT)
-#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT)
-#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT)
-#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT)
-#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT)
-#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT)
-#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT)
-#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT)
-#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT)
-#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT)
-#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT)
-#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT)
-#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT)
-#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT)
-#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT)
-#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT)
-#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT)
-#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT)
-#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT)
-#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT)
-#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT)
-#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT)
-#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT)
-#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT)
-#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT)
-#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT)
-#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT)
-#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT)
-#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT)
-#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT)
-#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT)
-
-#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access)
-
-#endif /* GL_EXT_direct_state_access */
-
-/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */
-
-#ifndef GL_EXT_draw_buffers2
-#define GL_EXT_draw_buffers2 1
-
-typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data);
-typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
-
-#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT)
-#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT)
-#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT)
-#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT)
-#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT)
-#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT)
-
-#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2)
-
-#endif /* GL_EXT_draw_buffers2 */
-
-/* ------------------------- GL_EXT_draw_instanced ------------------------- */
-
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-
-#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT)
-#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT)
-
-#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced)
-
-#endif /* GL_EXT_draw_instanced */
-
-/* ----------------------- GL_EXT_draw_range_elements ---------------------- */
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-
-#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT)
-
-#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements)
-
-#endif /* GL_EXT_draw_range_elements */
-
-/* ---------------------------- GL_EXT_fog_coord --------------------------- */
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-
-typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-
-#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT)
-#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT)
-#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT)
-#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT)
-#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT)
-
-#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord)
-
-#endif /* GL_EXT_fog_coord */
-
-/* ------------------------ GL_EXT_fragment_lighting ----------------------- */
-
-#ifndef GL_EXT_fragment_lighting
-#define GL_EXT_fragment_lighting 1
-
-#define GL_FRAGMENT_LIGHTING_EXT 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405
-#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406
-#define GL_LIGHT_ENV_MODE_EXT 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B
-#define GL_FRAGMENT_LIGHT0_EXT 0x840C
-#define GL_FRAGMENT_LIGHT7_EXT 0x8413
-
-typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param);
-
-#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT)
-#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT)
-#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT)
-#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT)
-#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT)
-#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT)
-#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT)
-#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT)
-#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT)
-#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT)
-#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT)
-#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT)
-#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT)
-#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT)
-#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT)
-#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT)
-#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT)
-#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT)
-
-#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting)
-
-#endif /* GL_EXT_fragment_lighting */
-
-/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
-
-typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-
-#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT)
-
-#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit)
-
-#endif /* GL_EXT_framebuffer_blit */
-
-/* --------------------- GL_EXT_framebuffer_multisample -------------------- */
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_EXT_framebuffer_multisample 1
-
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT 0x8D57
-
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT)
-
-#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample)
-
-#endif /* GL_EXT_framebuffer_multisample */
-
-/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */
-
-#ifndef GL_EXT_framebuffer_multisample_blit_scaled
-#define GL_EXT_framebuffer_multisample_blit_scaled 1
-
-#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
-#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
-
-#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled)
-
-#endif /* GL_EXT_framebuffer_multisample_blit_scaled */
-
-/* ----------------------- GL_EXT_framebuffer_object ----------------------- */
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT)
-#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT)
-#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT)
-#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT)
-#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT)
-#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT)
-#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT)
-#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT)
-#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT)
-#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT)
-#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT)
-#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT)
-#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT)
-#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT)
-#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT)
-#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT)
-#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT)
-
-#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object)
-
-#endif /* GL_EXT_framebuffer_object */
-
-/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_EXT_framebuffer_sRGB 1
-
-#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
-#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
-
-#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB)
-
-#endif /* GL_EXT_framebuffer_sRGB */
-
-/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_EXT_geometry_shader4 1
-
-#define GL_LINES_ADJACENCY_EXT 0xA
-#define GL_LINE_STRIP_ADJACENCY_EXT 0xB
-#define GL_TRIANGLES_ADJACENCY_EXT 0xC
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD
-#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
-#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-
-#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT)
-#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT)
-#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT)
-
-#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4)
-
-#endif /* GL_EXT_geometry_shader4 */
-
-/* --------------------- GL_EXT_gpu_program_parameters --------------------- */
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);
-
-#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT)
-#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT)
-
-#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters)
-
-#endif /* GL_EXT_gpu_program_parameters */
-
-/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_EXT_gpu_shader4 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD
-#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
-#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
-#define GL_SAMPLER_BUFFER_EXT 0x8DC2
-#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
-#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
-#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
-#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
-#define GL_INT_SAMPLER_1D_EXT 0x8DC9
-#define GL_INT_SAMPLER_2D_EXT 0x8DCA
-#define GL_INT_SAMPLER_3D_EXT 0x8DCB
-#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
-#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
-#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
-#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-
-#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT)
-#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT)
-#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT)
-#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT)
-#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT)
-#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT)
-#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT)
-#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT)
-#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT)
-#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT)
-#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT)
-#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT)
-#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT)
-#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT)
-#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT)
-#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT)
-#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT)
-#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT)
-#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT)
-#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT)
-#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT)
-#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT)
-#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT)
-#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT)
-#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT)
-#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT)
-#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT)
-#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT)
-#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT)
-#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT)
-#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT)
-#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT)
-#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT)
-#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT)
-
-#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4)
-
-#endif /* GL_EXT_gpu_shader4 */
-
-/* ---------------------------- GL_EXT_histogram --------------------------- */
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target);
-
-#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT)
-#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT)
-#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT)
-#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT)
-#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT)
-#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT)
-#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT)
-#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT)
-#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT)
-#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT)
-
-#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram)
-
-#endif /* GL_EXT_histogram */
-
-/* ----------------------- GL_EXT_index_array_formats ---------------------- */
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-
-#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats)
-
-#endif /* GL_EXT_index_array_formats */
-
-/* --------------------------- GL_EXT_index_func --------------------------- */
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-
-typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref);
-
-#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT)
-
-#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func)
-
-#endif /* GL_EXT_index_func */
-
-/* ------------------------- GL_EXT_index_material ------------------------- */
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-
-typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-
-#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT)
-
-#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material)
-
-#endif /* GL_EXT_index_material */
-
-/* -------------------------- GL_EXT_index_texture ------------------------- */
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-
-#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture)
-
-#endif /* GL_EXT_index_texture */
-
-/* -------------------------- GL_EXT_light_texture ------------------------- */
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-
-typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-
-#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT)
-#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT)
-#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT)
-
-#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture)
-
-#endif /* GL_EXT_light_texture */
-
-/* ------------------------- GL_EXT_misc_attribute ------------------------- */
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-
-#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute)
-
-#endif /* GL_EXT_misc_attribute */
-
-/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount);
-
-#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT)
-#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT)
-
-#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays)
-
-#endif /* GL_EXT_multi_draw_arrays */
-
-/* --------------------------- GL_EXT_multisample -------------------------- */
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-
-#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT)
-#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT)
-
-#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample)
-
-#endif /* GL_EXT_multisample */
-
-/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_EXT 0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
-#define GL_DEPTH24_STENCIL8_EXT 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
-
-#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil)
-
-#endif /* GL_EXT_packed_depth_stencil */
-
-/* -------------------------- GL_EXT_packed_float -------------------------- */
-
-#ifndef GL_EXT_packed_float
-#define GL_EXT_packed_float 1
-
-#define GL_R11F_G11F_B10F_EXT 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
-#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
-
-#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float)
-
-#endif /* GL_EXT_packed_float */
-
-/* -------------------------- GL_EXT_packed_pixels ------------------------- */
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-
-#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels)
-
-#endif /* GL_EXT_packed_pixels */
-
-/* ------------------------ GL_EXT_paletted_texture ------------------------ */
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8
-#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-
-#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT)
-#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT)
-#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT)
-#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT)
-
-#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture)
-
-#endif /* GL_EXT_paletted_texture */
-
-/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-
-#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object)
-
-#endif /* GL_EXT_pixel_buffer_object */
-
-/* ------------------------- GL_EXT_pixel_transform ------------------------ */
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-
-typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);
-
-#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT)
-#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT)
-#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT)
-#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT)
-#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT)
-#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT)
-
-#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform)
-
-#endif /* GL_EXT_pixel_transform */
-
-/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-
-#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table)
-
-#endif /* GL_EXT_pixel_transform_color_table */
-
-/* ------------------------ GL_EXT_point_parameters ------------------------ */
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
-
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params);
-
-#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT)
-#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT)
-
-#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters)
-
-#endif /* GL_EXT_point_parameters */
-
-/* ------------------------- GL_EXT_polygon_offset ------------------------- */
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
-
-typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-
-#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT)
-
-#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset)
-
-#endif /* GL_EXT_polygon_offset */
-
-/* ------------------------ GL_EXT_provoking_vertex ------------------------ */
-
-#ifndef GL_EXT_provoking_vertex
-#define GL_EXT_provoking_vertex 1
-
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
-#define GL_PROVOKING_VERTEX_EXT 0x8E4F
-
-typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
-
-#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT)
-
-#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex)
-
-#endif /* GL_EXT_provoking_vertex */
-
-/* ------------------------- GL_EXT_rescale_normal ------------------------- */
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-
-#define GL_RESCALE_NORMAL_EXT 0x803A
-
-#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal)
-
-#endif /* GL_EXT_rescale_normal */
-
-/* -------------------------- GL_EXT_scene_marker -------------------------- */
-
-#ifndef GL_EXT_scene_marker
-#define GL_EXT_scene_marker 1
-
-typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void);
-
-#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT)
-#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT)
-
-#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker)
-
-#endif /* GL_EXT_scene_marker */
-
-/* ------------------------- GL_EXT_secondary_color ------------------------ */
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-
-#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT)
-#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT)
-#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT)
-#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT)
-#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT)
-#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT)
-#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT)
-#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT)
-#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT)
-#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT)
-#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT)
-#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT)
-#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT)
-#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT)
-#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT)
-#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT)
-#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT)
-
-#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color)
-
-#endif /* GL_EXT_secondary_color */
-
-/* --------------------- GL_EXT_separate_shader_objects -------------------- */
-
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
-
-#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
-
-typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
-typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const char* string);
-typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
-
-#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT)
-#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT)
-#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT)
-
-#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects)
-
-#endif /* GL_EXT_separate_shader_objects */
-
-/* --------------------- GL_EXT_separate_specular_color -------------------- */
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-
-#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color)
-
-#endif /* GL_EXT_separate_specular_color */
-
-/* --------------------- GL_EXT_shader_image_load_store -------------------- */
-
-#ifndef GL_EXT_shader_image_load_store
-#define GL_EXT_shader_image_load_store 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
-#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
-#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
-#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C
-#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E
-#define GL_IMAGE_1D_EXT 0x904C
-#define GL_IMAGE_2D_EXT 0x904D
-#define GL_IMAGE_3D_EXT 0x904E
-#define GL_IMAGE_2D_RECT_EXT 0x904F
-#define GL_IMAGE_CUBE_EXT 0x9050
-#define GL_IMAGE_BUFFER_EXT 0x9051
-#define GL_IMAGE_1D_ARRAY_EXT 0x9052
-#define GL_IMAGE_2D_ARRAY_EXT 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
-#define GL_INT_IMAGE_1D_EXT 0x9057
-#define GL_INT_IMAGE_2D_EXT 0x9058
-#define GL_INT_IMAGE_3D_EXT 0x9059
-#define GL_INT_IMAGE_2D_RECT_EXT 0x905A
-#define GL_INT_IMAGE_CUBE_EXT 0x905B
-#define GL_INT_IMAGE_BUFFER_EXT 0x905C
-#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D
-#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
-#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D
-#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E
-#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
-
-#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT)
-#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT)
-
-#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store)
-
-#endif /* GL_EXT_shader_image_load_store */
-
-/* -------------------------- GL_EXT_shadow_funcs -------------------------- */
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-
-#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs)
-
-#endif /* GL_EXT_shadow_funcs */
-
-/* --------------------- GL_EXT_shared_texture_palette --------------------- */
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-
-#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette)
-
-#endif /* GL_EXT_shared_texture_palette */
-
-/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_EXT_stencil_clear_tag 1
-
-#define GL_STENCIL_TAG_BITS_EXT 0x88F2
-#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
-
-#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag)
-
-#endif /* GL_EXT_stencil_clear_tag */
-
-/* ------------------------ GL_EXT_stencil_two_side ------------------------ */
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-
-typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-
-#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT)
-
-#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side)
-
-#endif /* GL_EXT_stencil_two_side */
-
-/* -------------------------- GL_EXT_stencil_wrap -------------------------- */
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-
-#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap)
-
-#endif /* GL_EXT_stencil_wrap */
-
-/* --------------------------- GL_EXT_subtexture --------------------------- */
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
-
-#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT)
-#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT)
-#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT)
-
-#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture)
-
-#endif /* GL_EXT_subtexture */
-
-/* ----------------------------- GL_EXT_texture ---------------------------- */
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-
-#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture)
-
-#endif /* GL_EXT_texture */
-
-/* ---------------------------- GL_EXT_texture3D --------------------------- */
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
-
-#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT)
-
-#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D)
-
-#endif /* GL_EXT_texture3D */
-
-/* -------------------------- GL_EXT_texture_array ------------------------- */
-
-#ifndef GL_EXT_texture_array
-#define GL_EXT_texture_array 1
-
-#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
-#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
-#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-
-#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT)
-
-#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array)
-
-#endif /* GL_EXT_texture_array */
-
-/* ---------------------- GL_EXT_texture_buffer_object --------------------- */
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_EXT_texture_buffer_object 1
-
-#define GL_TEXTURE_BUFFER_EXT 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
-
-typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-
-#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT)
-
-#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object)
-
-#endif /* GL_EXT_texture_buffer_object */
-
-/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */
-
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
-
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-
-#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1)
-
-#endif /* GL_EXT_texture_compression_dxt1 */
-
-/* -------------------- GL_EXT_texture_compression_latc -------------------- */
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_EXT_texture_compression_latc 1
-
-#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
-#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
-#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
-#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
-
-#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc)
-
-#endif /* GL_EXT_texture_compression_latc */
-
-/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_EXT_texture_compression_rgtc 1
-
-#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
-#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
-#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
-
-#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc)
-
-#endif /* GL_EXT_texture_compression_rgtc */
-
-/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_EXT_texture_compression_s3tc 1
-
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-
-#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc)
-
-#endif /* GL_EXT_texture_compression_s3tc */
-
-/* ------------------------ GL_EXT_texture_cube_map ------------------------ */
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_EXT_texture_cube_map 1
-
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
-
-#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map)
-
-#endif /* GL_EXT_texture_cube_map */
-
-/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */
-
-#ifndef GL_EXT_texture_edge_clamp
-#define GL_EXT_texture_edge_clamp 1
-
-#define GL_CLAMP_TO_EDGE_EXT 0x812F
-
-#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp)
-
-#endif /* GL_EXT_texture_edge_clamp */
-
-/* --------------------------- GL_EXT_texture_env -------------------------- */
-
-#ifndef GL_EXT_texture_env
-#define GL_EXT_texture_env 1
-
-#define GL_TEXTURE_ENV0_EXT 0
-#define GL_ENV_BLEND_EXT 0
-#define GL_TEXTURE_ENV_SHIFT_EXT 0
-#define GL_ENV_REPLACE_EXT 0
-#define GL_ENV_ADD_EXT 0
-#define GL_ENV_SUBTRACT_EXT 0
-#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0
-#define GL_ENV_REVERSE_SUBTRACT_EXT 0
-#define GL_ENV_REVERSE_BLEND_EXT 0
-#define GL_ENV_COPY_EXT 0
-#define GL_ENV_MODULATE_EXT 0
-
-#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env)
-
-#endif /* GL_EXT_texture_env */
-
-/* ------------------------- GL_EXT_texture_env_add ------------------------ */
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-
-#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add)
-
-#endif /* GL_EXT_texture_env_add */
-
-/* ----------------------- GL_EXT_texture_env_combine ---------------------- */
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-
-#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine)
-
-#endif /* GL_EXT_texture_env_combine */
-
-/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-
-#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3)
-
-#endif /* GL_EXT_texture_env_dot3 */
-
-/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-
-#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic)
-
-#endif /* GL_EXT_texture_filter_anisotropic */
-
-/* ------------------------- GL_EXT_texture_integer ------------------------ */
-
-#ifndef GL_EXT_texture_integer
-#define GL_EXT_texture_integer 1
-
-#define GL_RGBA32UI_EXT 0x8D70
-#define GL_RGB32UI_EXT 0x8D71
-#define GL_ALPHA32UI_EXT 0x8D72
-#define GL_INTENSITY32UI_EXT 0x8D73
-#define GL_LUMINANCE32UI_EXT 0x8D74
-#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
-#define GL_RGBA16UI_EXT 0x8D76
-#define GL_RGB16UI_EXT 0x8D77
-#define GL_ALPHA16UI_EXT 0x8D78
-#define GL_INTENSITY16UI_EXT 0x8D79
-#define GL_LUMINANCE16UI_EXT 0x8D7A
-#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
-#define GL_RGBA8UI_EXT 0x8D7C
-#define GL_RGB8UI_EXT 0x8D7D
-#define GL_ALPHA8UI_EXT 0x8D7E
-#define GL_INTENSITY8UI_EXT 0x8D7F
-#define GL_LUMINANCE8UI_EXT 0x8D80
-#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
-#define GL_RGBA32I_EXT 0x8D82
-#define GL_RGB32I_EXT 0x8D83
-#define GL_ALPHA32I_EXT 0x8D84
-#define GL_INTENSITY32I_EXT 0x8D85
-#define GL_LUMINANCE32I_EXT 0x8D86
-#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
-#define GL_RGBA16I_EXT 0x8D88
-#define GL_RGB16I_EXT 0x8D89
-#define GL_ALPHA16I_EXT 0x8D8A
-#define GL_INTENSITY16I_EXT 0x8D8B
-#define GL_LUMINANCE16I_EXT 0x8D8C
-#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
-#define GL_RGBA8I_EXT 0x8D8E
-#define GL_RGB8I_EXT 0x8D8F
-#define GL_ALPHA8I_EXT 0x8D90
-#define GL_INTENSITY8I_EXT 0x8D91
-#define GL_LUMINANCE8I_EXT 0x8D92
-#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
-#define GL_RED_INTEGER_EXT 0x8D94
-#define GL_GREEN_INTEGER_EXT 0x8D95
-#define GL_BLUE_INTEGER_EXT 0x8D96
-#define GL_ALPHA_INTEGER_EXT 0x8D97
-#define GL_RGB_INTEGER_EXT 0x8D98
-#define GL_RGBA_INTEGER_EXT 0x8D99
-#define GL_BGR_INTEGER_EXT 0x8D9A
-#define GL_BGRA_INTEGER_EXT 0x8D9B
-#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
-#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
-#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
-
-typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-
-#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT)
-#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT)
-#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT)
-#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT)
-#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT)
-#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT)
-
-#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer)
-
-#endif /* GL_EXT_texture_integer */
-
-/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-
-#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias)
-
-#endif /* GL_EXT_texture_lod_bias */
-
-/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-
-#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp)
-
-#endif /* GL_EXT_texture_mirror_clamp */
-
-/* ------------------------- GL_EXT_texture_object ------------------------- */
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
-
-typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences);
-typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures);
-typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures);
-typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities);
-
-#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT)
-#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT)
-#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT)
-#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT)
-#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT)
-#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT)
-
-#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object)
-
-#endif /* GL_EXT_texture_object */
-
-/* --------------------- GL_EXT_texture_perturb_normal --------------------- */
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-
-typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-
-#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT)
-
-#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal)
-
-#endif /* GL_EXT_texture_perturb_normal */
-
-/* ------------------------ GL_EXT_texture_rectangle ----------------------- */
-
-#ifndef GL_EXT_texture_rectangle
-#define GL_EXT_texture_rectangle 1
-
-#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8
-
-#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle)
-
-#endif /* GL_EXT_texture_rectangle */
-
-/* -------------------------- GL_EXT_texture_sRGB -------------------------- */
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB8_EXT 0x8C41
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
-#define GL_SLUMINANCE_EXT 0x8C46
-#define GL_SLUMINANCE8_EXT 0x8C47
-#define GL_COMPRESSED_SRGB_EXT 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-
-#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB)
-
-#endif /* GL_EXT_texture_sRGB */
-
-/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */
-
-#ifndef GL_EXT_texture_sRGB_decode
-#define GL_EXT_texture_sRGB_decode 1
-
-#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
-#define GL_DECODE_EXT 0x8A49
-#define GL_SKIP_DECODE_EXT 0x8A4A
-
-#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode)
-
-#endif /* GL_EXT_texture_sRGB_decode */
-
-/* --------------------- GL_EXT_texture_shared_exponent -------------------- */
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_EXT_texture_shared_exponent 1
-
-#define GL_RGB9_E5_EXT 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
-
-#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent)
-
-#endif /* GL_EXT_texture_shared_exponent */
-
-/* -------------------------- GL_EXT_texture_snorm ------------------------- */
-
-#ifndef GL_EXT_texture_snorm
-#define GL_EXT_texture_snorm 1
-
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_ALPHA_SNORM 0x9010
-#define GL_LUMINANCE_SNORM 0x9011
-#define GL_LUMINANCE_ALPHA_SNORM 0x9012
-#define GL_INTENSITY_SNORM 0x9013
-#define GL_ALPHA8_SNORM 0x9014
-#define GL_LUMINANCE8_SNORM 0x9015
-#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
-#define GL_INTENSITY8_SNORM 0x9017
-#define GL_ALPHA16_SNORM 0x9018
-#define GL_LUMINANCE16_SNORM 0x9019
-#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
-#define GL_INTENSITY16_SNORM 0x901B
-
-#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm)
-
-#endif /* GL_EXT_texture_snorm */
-
-/* ------------------------- GL_EXT_texture_swizzle ------------------------ */
-
-#ifndef GL_EXT_texture_swizzle
-#define GL_EXT_texture_swizzle 1
-
-#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
-#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
-#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
-#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
-
-#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle)
-
-#endif /* GL_EXT_texture_swizzle */
-
-/* --------------------------- GL_EXT_timer_query -------------------------- */
-
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
-
-#define GL_TIME_ELAPSED_EXT 0x88BF
-
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
-
-#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT)
-#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT)
-
-#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query)
-
-#endif /* GL_EXT_timer_query */
-
-/* ----------------------- GL_EXT_transform_feedback ----------------------- */
-
-#ifndef GL_EXT_transform_feedback
-#define GL_EXT_transform_feedback 1
-
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
-#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
-#define GL_RASTERIZER_DISCARD_EXT 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
-#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
-
-typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, char *name);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode);
-
-#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT)
-#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT)
-#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT)
-#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT)
-#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT)
-#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT)
-#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT)
-
-#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback)
-
-#endif /* GL_EXT_transform_feedback */
-
-/* -------------------------- GL_EXT_vertex_array -------------------------- */
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-
-#define GL_DOUBLE_EXT 0x140A
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-
-typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer);
-typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer);
-
-#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT)
-#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT)
-#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT)
-#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT)
-#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT)
-#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT)
-#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT)
-#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT)
-
-#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array)
-
-#endif /* GL_EXT_vertex_array */
-
-/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */
-
-#ifndef GL_EXT_vertex_array_bgra
-#define GL_EXT_vertex_array_bgra 1
-
-#define GL_BGRA 0x80E1
-
-#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra)
-
-#endif /* GL_EXT_vertex_array_bgra */
-
-/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */
-
-#ifndef GL_EXT_vertex_attrib_64bit
-#define GL_EXT_vertex_attrib_64bit 1
-
-#define GL_DOUBLE_MAT2_EXT 0x8F46
-#define GL_DOUBLE_MAT3_EXT 0x8F47
-#define GL_DOUBLE_MAT4_EXT 0x8F48
-#define GL_DOUBLE_MAT2x3_EXT 0x8F49
-#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
-#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
-#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
-#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
-#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
-#define GL_DOUBLE_VEC2_EXT 0x8FFC
-#define GL_DOUBLE_VEC3_EXT 0x8FFD
-#define GL_DOUBLE_VEC4_EXT 0x8FFE
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);
-
-#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT)
-#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT)
-#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT)
-#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT)
-#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT)
-#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT)
-#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT)
-#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT)
-#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT)
-#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT)
-#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT)
-
-#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit)
-
-#endif /* GL_EXT_vertex_attrib_64bit */
-
-/* -------------------------- GL_EXT_vertex_shader ------------------------- */
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
-
-typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components);
-typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data);
-typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr);
-typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr);
-typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr);
-typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-
-#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT)
-#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT)
-#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT)
-#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT)
-#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT)
-#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT)
-#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT)
-#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT)
-#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT)
-#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT)
-#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT)
-#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT)
-#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT)
-#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT)
-#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT)
-#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT)
-#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT)
-#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT)
-#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT)
-#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT)
-#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT)
-#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT)
-#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT)
-#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT)
-#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT)
-#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT)
-#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT)
-#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT)
-#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT)
-#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT)
-#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT)
-#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT)
-#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT)
-#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT)
-#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT)
-#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT)
-#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT)
-#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT)
-#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT)
-#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT)
-#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT)
-#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT)
-
-#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader)
-
-#endif /* GL_EXT_vertex_shader */
-
-/* ------------------------ GL_EXT_vertex_weighting ------------------------ */
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-
-#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3
-#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6
-#define GL_MODELVIEW0_EXT 0x1700
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight);
-
-#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT)
-#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT)
-#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT)
-
-#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting)
-
-#endif /* GL_EXT_vertex_weighting */
-
-/* ------------------------- GL_EXT_x11_sync_object ------------------------ */
-
-#ifndef GL_EXT_x11_sync_object
-#define GL_EXT_x11_sync_object 1
-
-#define GL_SYNC_X11_FENCE_EXT 0x90E1
-
-typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
-
-#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT)
-
-#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object)
-
-#endif /* GL_EXT_x11_sync_object */
-
-/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */
-
-#ifndef GL_GREMEDY_frame_terminator
-#define GL_GREMEDY_frame_terminator 1
-
-typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void);
-
-#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY)
-
-#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator)
-
-#endif /* GL_GREMEDY_frame_terminator */
-
-/* ------------------------ GL_GREMEDY_string_marker ----------------------- */
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-
-typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string);
-
-#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY)
-
-#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker)
-
-#endif /* GL_GREMEDY_string_marker */
-
-/* --------------------- GL_HP_convolution_border_modes -------------------- */
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-
-#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes)
-
-#endif /* GL_HP_convolution_border_modes */
-
-/* ------------------------- GL_HP_image_transform ------------------------- */
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-
-typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params);
-
-#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP)
-#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP)
-#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP)
-#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP)
-#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP)
-#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP)
-
-#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform)
-
-#endif /* GL_HP_image_transform */
-
-/* -------------------------- GL_HP_occlusion_test ------------------------- */
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-
-#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test)
-
-#endif /* GL_HP_occlusion_test */
-
-/* ------------------------- GL_HP_texture_lighting ------------------------ */
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-
-#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting)
-
-#endif /* GL_HP_texture_lighting */
-
-/* --------------------------- GL_IBM_cull_vertex -------------------------- */
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-
-#define GL_CULL_VERTEX_IBM 103050
-
-#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex)
-
-#endif /* GL_IBM_cull_vertex */
-
-/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride);
-
-#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM)
-#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM)
-
-#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays)
-
-#endif /* GL_IBM_multimode_draw_arrays */
-
-/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010
-
-#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip)
-
-#endif /* GL_IBM_rasterpos_clip */
-
-/* --------------------------- GL_IBM_static_data -------------------------- */
-
-#ifndef GL_IBM_static_data
-#define GL_IBM_static_data 1
-
-#define GL_ALL_STATIC_DATA_IBM 103060
-#define GL_STATIC_VERTEX_ARRAY_IBM 103061
-
-#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data)
-
-#endif /* GL_IBM_static_data */
-
-/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_IBM_texture_mirrored_repeat 1
-
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-
-#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat)
-
-#endif /* GL_IBM_texture_mirrored_repeat */
-
-/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-
-#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM)
-#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM)
-#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM)
-#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM)
-#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM)
-#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM)
-#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM)
-#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM)
-
-#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists)
-
-#endif /* GL_IBM_vertex_array_lists */
-
-/* -------------------------- GL_INGR_color_clamp -------------------------- */
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-
-#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp)
-
-#endif /* GL_INGR_color_clamp */
-
-/* ------------------------- GL_INGR_interlace_read ------------------------ */
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-
-#define GL_INTERLACE_READ_INGR 0x8568
-
-#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read)
-
-#endif /* GL_INGR_interlace_read */
-
-/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);
-
-#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL)
-#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL)
-#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL)
-#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL)
-
-#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays)
-
-#endif /* GL_INTEL_parallel_arrays */
-
-/* ------------------------ GL_INTEL_texture_scissor ----------------------- */
-
-#ifndef GL_INTEL_texture_scissor
-#define GL_INTEL_texture_scissor 1
-
-typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc);
-typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh);
-
-#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL)
-#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL)
-
-#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor)
-
-#endif /* GL_INTEL_texture_scissor */
-
-/* -------------------------- GL_KTX_buffer_region ------------------------- */
-
-#ifndef GL_KTX_buffer_region
-#define GL_KTX_buffer_region 1
-
-#define GL_KTX_FRONT_REGION 0x0
-#define GL_KTX_BACK_REGION 0x1
-#define GL_KTX_Z_REGION 0x2
-#define GL_KTX_STENCIL_REGION 0x3
-
-typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void);
-typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region);
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest);
-typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region);
-typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled)
-#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion)
-#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion)
-#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion)
-#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion)
-
-#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region)
-
-#endif /* GL_KTX_buffer_region */
-
-/* ------------------------- GL_MESAX_texture_stack ------------------------ */
-
-#ifndef GL_MESAX_texture_stack
-#define GL_MESAX_texture_stack 1
-
-#define GL_TEXTURE_1D_STACK_MESAX 0x8759
-#define GL_TEXTURE_2D_STACK_MESAX 0x875A
-#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
-#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
-#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
-#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
-
-#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack)
-
-#endif /* GL_MESAX_texture_stack */
-
-/* -------------------------- GL_MESA_pack_invert -------------------------- */
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-
-#define GL_PACK_INVERT_MESA 0x8758
-
-#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert)
-
-#endif /* GL_MESA_pack_invert */
-
-/* ------------------------- GL_MESA_resize_buffers ------------------------ */
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-
-typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void);
-
-#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA)
-
-#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers)
-
-#endif /* GL_MESA_resize_buffers */
-
-/* --------------------------- GL_MESA_window_pos -------------------------- */
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p);
-
-#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA)
-#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA)
-#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA)
-#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA)
-#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA)
-#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA)
-#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA)
-#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA)
-#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA)
-#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA)
-#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA)
-#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA)
-#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA)
-#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA)
-#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA)
-#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA)
-#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA)
-#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA)
-#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA)
-#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA)
-#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA)
-#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA)
-#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA)
-#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA)
-
-#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos)
-
-#endif /* GL_MESA_window_pos */
-
-/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
-
-#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture)
-
-#endif /* GL_MESA_ycbcr_texture */
-
-/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */
-
-#ifndef GL_NVX_gpu_memory_info
-#define GL_NVX_gpu_memory_info 1
-
-#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
-#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
-#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
-#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
-#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
-
-#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info)
-
-#endif /* GL_NVX_gpu_memory_info */
-
-/* --------------------------- GL_NV_blend_square -------------------------- */
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-
-#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square)
-
-#endif /* GL_NV_blend_square */
-
-/* ------------------------ GL_NV_conditional_render ----------------------- */
-
-#ifndef GL_NV_conditional_render
-#define GL_NV_conditional_render 1
-
-#define GL_QUERY_WAIT_NV 0x8E13
-#define GL_QUERY_NO_WAIT_NV 0x8E14
-#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
-
-typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void);
-
-#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV)
-#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV)
-
-#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render)
-
-#endif /* GL_NV_conditional_render */
-
-/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
-
-#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color)
-
-#endif /* GL_NV_copy_depth_to_color */
-
-/* ---------------------------- GL_NV_copy_image --------------------------- */
-
-#ifndef GL_NV_copy_image
-#define GL_NV_copy_image 1
-
-typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV)
-
-#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image)
-
-#endif /* GL_NV_copy_image */
-
-/* ------------------------ GL_NV_depth_buffer_float ----------------------- */
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_NV_depth_buffer_float 1
-
-#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
-#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
-#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
-
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
-typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
-
-#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV)
-#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV)
-#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV)
-
-#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float)
-
-#endif /* GL_NV_depth_buffer_float */
-
-/* --------------------------- GL_NV_depth_clamp --------------------------- */
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-
-#define GL_DEPTH_CLAMP_NV 0x864F
-
-#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp)
-
-#endif /* GL_NV_depth_clamp */
-
-/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */
-
-#ifndef GL_NV_depth_range_unclamped
-#define GL_NV_depth_range_unclamped 1
-
-#define GL_SAMPLE_COUNT_BITS_NV 0x8864
-#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865
-#define GL_QUERY_RESULT_NV 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867
-#define GL_SAMPLE_COUNT_NV 0x8914
-
-#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped)
-
-#endif /* GL_NV_depth_range_unclamped */
-
-/* ---------------------------- GL_NV_evaluators --------------------------- */
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-
-typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points);
-typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points);
-typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params);
-
-#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV)
-#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV)
-#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV)
-#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV)
-#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV)
-#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV)
-#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV)
-#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV)
-#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV)
-
-#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators)
-
-#endif /* GL_NV_evaluators */
-
-/* ----------------------- GL_NV_explicit_multisample ---------------------- */
-
-#ifndef GL_NV_explicit_multisample
-#define GL_NV_explicit_multisample 1
-
-#define GL_SAMPLE_POSITION_NV 0x8E50
-#define GL_SAMPLE_MASK_NV 0x8E51
-#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
-#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
-#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
-#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
-#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
-#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
-#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
-#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
-
-typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val);
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
-
-#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV)
-#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV)
-#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV)
-
-#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample)
-
-#endif /* GL_NV_explicit_multisample */
-
-/* ------------------------------ GL_NV_fence ------------------------------ */
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-
-typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences);
-typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences);
-typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence);
-
-#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV)
-#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV)
-#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV)
-#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV)
-#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV)
-#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV)
-#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV)
-
-#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence)
-
-#endif /* GL_NV_fence */
-
-/* --------------------------- GL_NV_float_buffer -------------------------- */
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-
-#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer)
-
-#endif /* GL_NV_float_buffer */
-
-/* --------------------------- GL_NV_fog_distance -------------------------- */
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-
-#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance)
-
-#endif /* GL_NV_fog_distance */
-
-/* ------------------------- GL_NV_fragment_program ------------------------ */
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]);
-
-#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV)
-#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV)
-#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV)
-#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV)
-#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV)
-#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV)
-
-#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program)
-
-#endif /* GL_NV_fragment_program */
-
-/* ------------------------ GL_NV_fragment_program2 ------------------------ */
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
-
-#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2)
-
-#endif /* GL_NV_fragment_program2 */
-
-/* ------------------------ GL_NV_fragment_program4 ------------------------ */
-
-#ifndef GL_NV_fragment_program4
-#define GL_NV_fragment_program4 1
-
-#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4)
-
-#endif /* GL_NV_fragment_program4 */
-
-/* --------------------- GL_NV_fragment_program_option --------------------- */
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-
-#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option)
-
-#endif /* GL_NV_fragment_program_option */
-
-/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_NV_framebuffer_multisample_coverage 1
-
-#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
-#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
-#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
-#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
-
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV)
-
-#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage)
-
-#endif /* GL_NV_framebuffer_multisample_coverage */
-
-/* ------------------------ GL_NV_geometry_program4 ------------------------ */
-
-#ifndef GL_NV_geometry_program4
-#define GL_NV_geometry_program4 1
-
-#define GL_GEOMETRY_PROGRAM_NV 0x8C26
-#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
-#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
-
-#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV)
-
-#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4)
-
-#endif /* GL_NV_geometry_program4 */
-
-/* ------------------------- GL_NV_geometry_shader4 ------------------------ */
-
-#ifndef GL_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-
-#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4)
-
-#endif /* GL_NV_geometry_shader4 */
-
-/* --------------------------- GL_NV_gpu_program4 -------------------------- */
-
-#ifndef GL_NV_gpu_program4
-#define GL_NV_gpu_program4 1
-
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
-#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
-#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
-#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
-#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
-#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
-#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-
-#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV)
-#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV)
-#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV)
-#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV)
-#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV)
-#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV)
-#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV)
-#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV)
-#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV)
-#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV)
-#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV)
-#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV)
-
-#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4)
-
-#endif /* GL_NV_gpu_program4 */
-
-/* --------------------------- GL_NV_gpu_program5 -------------------------- */
-
-#ifndef GL_NV_gpu_program5
-#define GL_NV_gpu_program5 1
-
-#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
-#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
-
-#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5)
-
-#endif /* GL_NV_gpu_program5 */
-
-/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */
-
-#ifndef GL_NV_gpu_program_fp64
-#define GL_NV_gpu_program_fp64 1
-
-#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64)
-
-#endif /* GL_NV_gpu_program_fp64 */
-
-/* --------------------------- GL_NV_gpu_shader5 --------------------------- */
-
-#ifndef GL_NV_gpu_shader5
-#define GL_NV_gpu_shader5 1
-
-#define GL_INT64_NV 0x140E
-#define GL_UNSIGNED_INT64_NV 0x140F
-#define GL_INT8_NV 0x8FE0
-#define GL_INT8_VEC2_NV 0x8FE1
-#define GL_INT8_VEC3_NV 0x8FE2
-#define GL_INT8_VEC4_NV 0x8FE3
-#define GL_INT16_NV 0x8FE4
-#define GL_INT16_VEC2_NV 0x8FE5
-#define GL_INT16_VEC3_NV 0x8FE6
-#define GL_INT16_VEC4_NV 0x8FE7
-#define GL_INT64_VEC2_NV 0x8FE9
-#define GL_INT64_VEC3_NV 0x8FEA
-#define GL_INT64_VEC4_NV 0x8FEB
-#define GL_UNSIGNED_INT8_NV 0x8FEC
-#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
-#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
-#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
-#define GL_UNSIGNED_INT16_NV 0x8FF0
-#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
-#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
-#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
-#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
-#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
-#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
-#define GL_FLOAT16_NV 0x8FF8
-#define GL_FLOAT16_VEC2_NV 0x8FF9
-#define GL_FLOAT16_VEC3_NV 0x8FFA
-#define GL_FLOAT16_VEC4_NV 0x8FFB
-
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-
-#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV)
-#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV)
-#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV)
-#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV)
-#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV)
-#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV)
-#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV)
-#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV)
-#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV)
-#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV)
-#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV)
-#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV)
-#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV)
-#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV)
-#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV)
-#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV)
-#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV)
-#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV)
-#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV)
-#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV)
-#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV)
-#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV)
-#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV)
-#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV)
-#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV)
-#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV)
-#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV)
-#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV)
-#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV)
-#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV)
-#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV)
-#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV)
-#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV)
-#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV)
-
-#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5)
-
-#endif /* GL_NV_gpu_shader5 */
-
-/* ---------------------------- GL_NV_half_float --------------------------- */
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-
-#define GL_HALF_FLOAT_NV 0x140B
-
-typedef unsigned short GLhalf;
-
-typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y);
-typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z);
-typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w);
-typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight);
-
-#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV)
-#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV)
-#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV)
-#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV)
-#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV)
-#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV)
-#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV)
-#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV)
-#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV)
-#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV)
-#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV)
-#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV)
-#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV)
-#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV)
-#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV)
-#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV)
-#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV)
-#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV)
-#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV)
-#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV)
-#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV)
-#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV)
-#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV)
-#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV)
-#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV)
-#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV)
-#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV)
-#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV)
-#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV)
-#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV)
-#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV)
-#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV)
-#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV)
-#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV)
-#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV)
-#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV)
-#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV)
-#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV)
-#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV)
-#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV)
-#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV)
-#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV)
-#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV)
-#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV)
-#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV)
-#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV)
-
-#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float)
-
-#endif /* GL_NV_half_float */
-
-/* ------------------------ GL_NV_light_max_exponent ----------------------- */
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
-
-#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent)
-
-#endif /* GL_NV_light_max_exponent */
-
-/* ----------------------- GL_NV_multisample_coverage ---------------------- */
-
-#ifndef GL_NV_multisample_coverage
-#define GL_NV_multisample_coverage 1
-
-#define GL_COVERAGE_SAMPLES_NV 0x80A9
-#define GL_COLOR_SAMPLES_NV 0x8E20
-
-#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage)
-
-#endif /* GL_NV_multisample_coverage */
-
-/* --------------------- GL_NV_multisample_filter_hint --------------------- */
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-
-#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint)
-
-#endif /* GL_NV_multisample_filter_hint */
-
-/* ------------------------- GL_NV_occlusion_query ------------------------- */
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-
-typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-
-#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV)
-#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV)
-#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV)
-#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV)
-#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV)
-#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV)
-#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV)
-
-#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query)
-
-#endif /* GL_NV_occlusion_query */
-
-/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
-
-#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil)
-
-#endif /* GL_NV_packed_depth_stencil */
-
-/* --------------------- GL_NV_parameter_buffer_object --------------------- */
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_NV_parameter_buffer_object 1
-
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
-#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
-#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
-#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-
-#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV)
-#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV)
-#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV)
-
-#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object)
-
-#endif /* GL_NV_parameter_buffer_object */
-
-/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */
-
-#ifndef GL_NV_parameter_buffer_object2
-#define GL_NV_parameter_buffer_object2 1
-
-#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2)
-
-#endif /* GL_NV_parameter_buffer_object2 */
-
-/* -------------------------- GL_NV_path_rendering ------------------------- */
-
-#ifndef GL_NV_path_rendering
-#define GL_NV_path_rendering 1
-
-#define GL_CLOSE_PATH_NV 0x00
-#define GL_BOLD_BIT_NV 0x01
-#define GL_GLYPH_WIDTH_BIT_NV 0x01
-#define GL_MOVE_TO_NV 0x02
-#define GL_GLYPH_HEIGHT_BIT_NV 0x02
-#define GL_ITALIC_BIT_NV 0x02
-#define GL_RELATIVE_MOVE_TO_NV 0x03
-#define GL_LINE_TO_NV 0x04
-#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
-#define GL_RELATIVE_LINE_TO_NV 0x05
-#define GL_HORIZONTAL_LINE_TO_NV 0x06
-#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
-#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
-#define GL_VERTICAL_LINE_TO_NV 0x08
-#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09
-#define GL_QUADRATIC_CURVE_TO_NV 0x0A
-#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
-#define GL_CUBIC_CURVE_TO_NV 0x0C
-#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D
-#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E
-#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
-#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
-#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10
-#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
-#define GL_SMALL_CCW_ARC_TO_NV 0x12
-#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13
-#define GL_SMALL_CW_ARC_TO_NV 0x14
-#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15
-#define GL_LARGE_CCW_ARC_TO_NV 0x16
-#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17
-#define GL_LARGE_CW_ARC_TO_NV 0x18
-#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19
-#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
-#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
-#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
-#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8
-#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA
-#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC
-#define GL_ARC_TO_NV 0xFE
-#define GL_RELATIVE_ARC_TO_NV 0xFF
-#define GL_GLYPH_HAS_KERNING_NV 0x100
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PATH_FORMAT_SVG_NV 0x9070
-#define GL_PATH_FORMAT_PS_NV 0x9071
-#define GL_STANDARD_FONT_NAME_NV 0x9072
-#define GL_SYSTEM_FONT_NAME_NV 0x9073
-#define GL_FILE_NAME_NV 0x9074
-#define GL_PATH_STROKE_WIDTH_NV 0x9075
-#define GL_PATH_END_CAPS_NV 0x9076
-#define GL_PATH_INITIAL_END_CAP_NV 0x9077
-#define GL_PATH_TERMINAL_END_CAP_NV 0x9078
-#define GL_PATH_JOIN_STYLE_NV 0x9079
-#define GL_PATH_MITER_LIMIT_NV 0x907A
-#define GL_PATH_DASH_CAPS_NV 0x907B
-#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C
-#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D
-#define GL_PATH_DASH_OFFSET_NV 0x907E
-#define GL_PATH_CLIENT_LENGTH_NV 0x907F
-#define GL_PATH_FILL_MODE_NV 0x9080
-#define GL_PATH_FILL_MASK_NV 0x9081
-#define GL_PATH_FILL_COVER_MODE_NV 0x9082
-#define GL_PATH_STROKE_COVER_MODE_NV 0x9083
-#define GL_PATH_STROKE_MASK_NV 0x9084
-#define GL_COUNT_UP_NV 0x9088
-#define GL_COUNT_DOWN_NV 0x9089
-#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A
-#define GL_CONVEX_HULL_NV 0x908B
-#define GL_BOUNDING_BOX_NV 0x908D
-#define GL_TRANSLATE_X_NV 0x908E
-#define GL_TRANSLATE_Y_NV 0x908F
-#define GL_TRANSLATE_2D_NV 0x9090
-#define GL_TRANSLATE_3D_NV 0x9091
-#define GL_AFFINE_2D_NV 0x9092
-#define GL_AFFINE_3D_NV 0x9094
-#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
-#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
-#define GL_UTF8_NV 0x909A
-#define GL_UTF16_NV 0x909B
-#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
-#define GL_PATH_COMMAND_COUNT_NV 0x909D
-#define GL_PATH_COORD_COUNT_NV 0x909E
-#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F
-#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0
-#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1
-#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2
-#define GL_SQUARE_NV 0x90A3
-#define GL_ROUND_NV 0x90A4
-#define GL_TRIANGULAR_NV 0x90A5
-#define GL_BEVEL_NV 0x90A6
-#define GL_MITER_REVERT_NV 0x90A7
-#define GL_MITER_TRUNCATE_NV 0x90A8
-#define GL_SKIP_MISSING_GLYPH_NV 0x90A9
-#define GL_USE_MISSING_GLYPH_NV 0x90AA
-#define GL_PATH_ERROR_POSITION_NV 0x90AB
-#define GL_PATH_FOG_GEN_MODE_NV 0x90AC
-#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD
-#define GL_ADJACENT_PAIRS_NV 0x90AE
-#define GL_FIRST_TO_REST_NV 0x90AF
-#define GL_PATH_GEN_MODE_NV 0x90B0
-#define GL_PATH_GEN_COEFF_NV 0x90B1
-#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2
-#define GL_PATH_GEN_COMPONENTS_NV 0x90B3
-#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4
-#define GL_MOVE_TO_RESETS_NV 0x90B5
-#define GL_MOVE_TO_CONTINUES_NV 0x90B6
-#define GL_PATH_STENCIL_FUNC_NV 0x90B7
-#define GL_PATH_STENCIL_REF_NV 0x90B8
-#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9
-#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
-#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
-#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF
-#define GL_FONT_X_MIN_BOUNDS_NV 0x00010000
-#define GL_FONT_Y_MIN_BOUNDS_NV 0x00020000
-#define GL_FONT_X_MAX_BOUNDS_NV 0x00040000
-#define GL_FONT_Y_MAX_BOUNDS_NV 0x00080000
-#define GL_FONT_UNITS_PER_EM_NV 0x00100000
-#define GL_FONT_ASCENDER_NV 0x00200000
-#define GL_FONT_DESCENDER_NV 0x00400000
-#define GL_FONT_HEIGHT_NV 0x00800000
-#define GL_FONT_MAX_ADVANCE_WIDTH_NV 0x01000000
-#define GL_FONT_MAX_ADVANCE_HEIGHT_NV 0x02000000
-#define GL_FONT_UNDERLINE_POSITION_NV 0x04000000
-#define GL_FONT_UNDERLINE_THICKNESS_NV 0x08000000
-#define GL_FONT_HAS_KERNING_NV 0x10000000
-
-typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
-typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
-typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode);
-typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
-typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords);
-typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray);
-typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
-typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics);
-typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value);
-typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path);
-typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs);
-typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords);
-typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords);
-typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc);
-typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray);
-typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode);
-typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLint units);
-typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString);
-typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords);
-typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords);
-typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs);
-typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues);
-typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]);
-
-#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV)
-#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV)
-#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV)
-#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV)
-#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV)
-#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV)
-#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV)
-#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV)
-#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV)
-#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV)
-#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV)
-#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV)
-#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV)
-#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV)
-#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV)
-#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV)
-#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV)
-#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV)
-#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV)
-#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV)
-#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV)
-#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV)
-#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV)
-#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV)
-#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV)
-#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV)
-#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV)
-#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV)
-#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV)
-#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV)
-#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV)
-#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV)
-#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV)
-#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV)
-#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV)
-#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV)
-#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV)
-#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV)
-#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV)
-#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV)
-#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV)
-#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV)
-#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV)
-#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV)
-#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV)
-#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV)
-#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV)
-#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV)
-#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV)
-
-#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering)
-
-#endif /* GL_NV_path_rendering */
-
-/* ------------------------- GL_NV_pixel_data_range ------------------------ */
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-
-typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer);
-
-#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV)
-#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV)
-
-#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range)
-
-#endif /* GL_NV_pixel_data_range */
-
-/* --------------------------- GL_NV_point_sprite -------------------------- */
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params);
-
-#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV)
-#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV)
-
-#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite)
-
-#endif /* GL_NV_point_sprite */
-
-/* -------------------------- GL_NV_present_video -------------------------- */
-
-#ifndef GL_NV_present_video
-#define GL_NV_present_video 1
-
-#define GL_FRAME_NV 0x8E26
-#define GL_FIELDS_NV 0x8E27
-#define GL_CURRENT_TIME_NV 0x8E28
-#define GL_NUM_FILL_STREAMS_NV 0x8E29
-#define GL_PRESENT_TIME_NV 0x8E2A
-#define GL_PRESENT_DURATION_NV 0x8E2B
-
-typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-
-#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV)
-#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV)
-#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV)
-#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV)
-#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV)
-#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV)
-
-#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video)
-
-#endif /* GL_NV_present_video */
-
-/* ------------------------ GL_NV_primitive_restart ------------------------ */
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
-
-typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void);
-
-#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV)
-#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV)
-
-#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart)
-
-#endif /* GL_NV_primitive_restart */
-
-/* ------------------------ GL_NV_register_combiners ----------------------- */
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-
-typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params);
-
-#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV)
-#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV)
-#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV)
-#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV)
-#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV)
-#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV)
-#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV)
-#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV)
-#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV)
-#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV)
-#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV)
-#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV)
-#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV)
-
-#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners)
-
-#endif /* GL_NV_register_combiners */
-
-/* ----------------------- GL_NV_register_combiners2 ----------------------- */
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
-
-typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params);
-
-#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV)
-#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV)
-
-#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2)
-
-#endif /* GL_NV_register_combiners2 */
-
-/* ------------------------ GL_NV_shader_buffer_load ----------------------- */
-
-#ifndef GL_NV_shader_buffer_load
-#define GL_NV_shader_buffer_load 1
-
-#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
-#define GL_GPU_ADDRESS_NV 0x8F34
-#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
-
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
-typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
-typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-
-#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV)
-#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV)
-#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV)
-#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV)
-#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV)
-#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV)
-#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV)
-#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV)
-#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV)
-#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV)
-#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV)
-#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV)
-#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV)
-
-#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load)
-
-#endif /* GL_NV_shader_buffer_load */
-
-/* ---------------------- GL_NV_tessellation_program5 ---------------------- */
-
-#ifndef GL_NV_tessellation_program5
-#define GL_NV_tessellation_program5 1
-
-#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
-#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
-#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
-#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
-#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
-
-#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5)
-
-#endif /* GL_NV_tessellation_program5 */
-
-/* -------------------------- GL_NV_texgen_emboss -------------------------- */
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-
-#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss)
-
-#endif /* GL_NV_texgen_emboss */
-
-/* ------------------------ GL_NV_texgen_reflection ------------------------ */
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
-
-#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection)
-
-#endif /* GL_NV_texgen_reflection */
-
-/* ------------------------- GL_NV_texture_barrier ------------------------- */
-
-#ifndef GL_NV_texture_barrier
-#define GL_NV_texture_barrier 1
-
-typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void);
-
-#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV)
-
-#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier)
-
-#endif /* GL_NV_texture_barrier */
-
-/* --------------------- GL_NV_texture_compression_vtc --------------------- */
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-
-#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc)
-
-#endif /* GL_NV_texture_compression_vtc */
-
-/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-
-#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4)
-
-#endif /* GL_NV_texture_env_combine4 */
-
-/* ---------------------- GL_NV_texture_expand_normal ---------------------- */
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-
-#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal)
-
-#endif /* GL_NV_texture_expand_normal */
-
-/* ----------------------- GL_NV_texture_multisample ----------------------- */
-
-#ifndef GL_NV_texture_multisample
-#define GL_NV_texture_multisample 1
-
-#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
-#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
-
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-
-#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV)
-#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV)
-#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV)
-#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV)
-#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV)
-#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV)
-
-#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample)
-
-#endif /* GL_NV_texture_multisample */
-
-/* ------------------------ GL_NV_texture_rectangle ------------------------ */
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-
-#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle)
-
-#endif /* GL_NV_texture_rectangle */
-
-/* -------------------------- GL_NV_texture_shader ------------------------- */
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
-
-#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader)
-
-#endif /* GL_NV_texture_shader */
-
-/* ------------------------- GL_NV_texture_shader2 ------------------------- */
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-
-#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2)
-
-#endif /* GL_NV_texture_shader2 */
-
-/* ------------------------- GL_NV_texture_shader3 ------------------------- */
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-
-#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3)
-
-#endif /* GL_NV_texture_shader3 */
-
-/* ------------------------ GL_NV_transform_feedback ----------------------- */
-
-#ifndef GL_NV_transform_feedback
-#define GL_NV_transform_feedback 1
-
-#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
-#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
-#define GL_TEXTURE_COORD_NV 0x8C79
-#define GL_CLIP_DISTANCE_NV 0x8C7A
-#define GL_VERTEX_ID_NV 0x8C7B
-#define GL_PRIMITIVE_ID_NV 0x8C7C
-#define GL_GENERIC_ATTRIB_NV 0x8C7D
-#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
-#define GL_ACTIVE_VARYINGS_NV 0x8C81
-#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
-#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
-#define GL_PRIMITIVES_GENERATED_NV 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
-#define GL_RASTERIZER_DISCARD_NV 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
-#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
-
-typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
-typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
-typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-
-#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV)
-#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV)
-#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV)
-#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV)
-#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV)
-#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV)
-#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV)
-#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV)
-#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV)
-#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV)
-#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV)
-
-#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback)
-
-#endif /* GL_NV_transform_feedback */
-
-/* ----------------------- GL_NV_transform_feedback2 ----------------------- */
-
-#ifndef GL_NV_transform_feedback2
-#define GL_NV_transform_feedback2 1
-
-#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
-
-typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
-typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids);
-typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
-
-#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV)
-#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV)
-#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV)
-#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV)
-#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV)
-#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV)
-#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV)
-
-#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2)
-
-#endif /* GL_NV_transform_feedback2 */
-
-/* -------------------------- GL_NV_vdpau_interop -------------------------- */
-
-#ifndef GL_NV_vdpau_interop
-#define GL_NV_vdpau_interop 1
-
-#define GL_SURFACE_STATE_NV 0x86EB
-#define GL_SURFACE_REGISTERED_NV 0x86FD
-#define GL_SURFACE_MAPPED_NV 0x8700
-#define GL_WRITE_DISCARD_NV 0x88BE
-
-typedef GLintptr GLvdpauSurfaceNV;
-
-typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values);
-typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress);
-typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces);
-typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
-typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces);
-typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
-
-#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV)
-#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV)
-#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV)
-#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV)
-#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV)
-#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV)
-#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV)
-#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV)
-#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV)
-#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV)
-
-#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop)
-
-#endif /* GL_NV_vdpau_interop */
-
-/* ------------------------ GL_NV_vertex_array_range ----------------------- */
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-
-typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer);
-
-#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV)
-#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV)
-
-#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range)
-
-#endif /* GL_NV_vertex_array_range */
-
-/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-
-#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2)
-
-#endif /* GL_NV_vertex_array_range2 */
-
-/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */
-
-#ifndef GL_NV_vertex_attrib_integer_64bit
-#define GL_NV_vertex_attrib_integer_64bit 1
-
-#define GL_INT64_NV 0x140E
-#define GL_UNSIGNED_INT64_NV 0x140F
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-
-#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV)
-#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV)
-#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV)
-#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV)
-#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV)
-#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV)
-#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV)
-#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV)
-#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV)
-#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV)
-#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV)
-#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV)
-#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV)
-#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV)
-#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV)
-#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV)
-#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV)
-#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV)
-#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV)
-
-#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit)
-
-#endif /* GL_NV_vertex_attrib_integer_64bit */
-
-/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */
-
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_NV_vertex_buffer_unified_memory 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
-#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
-#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
-#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
-#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
-#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
-#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
-#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
-#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
-#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
-#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
-#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
-#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
-#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
-#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
-#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
-#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
-#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
-#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
-#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
-#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
-#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
-#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
-#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
-#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
-
-typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]);
-typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-
-#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV)
-#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV)
-#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV)
-#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV)
-#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV)
-#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV)
-#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV)
-#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV)
-#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV)
-#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV)
-#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV)
-#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV)
-
-#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory)
-
-#endif /* GL_NV_vertex_buffer_unified_memory */
-
-/* -------------------------- GL_NV_vertex_program ------------------------- */
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-
-typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences);
-typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v);
-
-#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV)
-#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV)
-#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV)
-#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV)
-#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV)
-#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV)
-#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV)
-#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV)
-#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV)
-#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV)
-#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV)
-#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV)
-#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV)
-#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV)
-#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV)
-#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV)
-#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV)
-#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV)
-#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV)
-#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV)
-#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV)
-#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV)
-#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV)
-#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV)
-#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV)
-#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV)
-#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV)
-#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV)
-#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV)
-#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV)
-#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV)
-#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV)
-#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV)
-#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV)
-#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV)
-#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV)
-#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV)
-#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV)
-#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV)
-#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV)
-#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV)
-#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV)
-#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV)
-#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV)
-#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV)
-#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV)
-#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV)
-#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV)
-#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV)
-#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV)
-#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV)
-#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV)
-#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV)
-#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV)
-#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV)
-#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV)
-#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV)
-#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV)
-#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV)
-#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV)
-#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV)
-#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV)
-#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV)
-#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV)
-
-#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program)
-
-#endif /* GL_NV_vertex_program */
-
-/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-
-#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1)
-
-#endif /* GL_NV_vertex_program1_1 */
-
-/* ------------------------- GL_NV_vertex_program2 ------------------------- */
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-
-#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2)
-
-#endif /* GL_NV_vertex_program2 */
-
-/* ---------------------- GL_NV_vertex_program2_option --------------------- */
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-
-#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option)
-
-#endif /* GL_NV_vertex_program2_option */
-
-/* ------------------------- GL_NV_vertex_program3 ------------------------- */
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-
-#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-
-#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3)
-
-#endif /* GL_NV_vertex_program3 */
-
-/* ------------------------- GL_NV_vertex_program4 ------------------------- */
-
-#ifndef GL_NV_vertex_program4
-#define GL_NV_vertex_program4 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
-
-#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4)
-
-#endif /* GL_NV_vertex_program4 */
-
-/* -------------------------- GL_NV_video_capture -------------------------- */
-
-#ifndef GL_NV_video_capture
-#define GL_NV_video_capture 1
-
-#define GL_VIDEO_BUFFER_NV 0x9020
-#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
-#define GL_FIELD_UPPER_NV 0x9022
-#define GL_FIELD_LOWER_NV 0x9023
-#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
-#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
-#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
-#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
-#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
-#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
-#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
-#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
-#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
-#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
-#define GL_PARTIAL_SUCCESS_NV 0x902E
-#define GL_SUCCESS_NV 0x902F
-#define GL_FAILURE_NV 0x9030
-#define GL_YCBYCR8_422_NV 0x9031
-#define GL_YCBAYCR8A_4224_NV 0x9032
-#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
-#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
-#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
-#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
-#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
-#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
-#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
-#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
-#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
-#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
-
-typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params);
-typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time);
-typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params);
-
-#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV)
-#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV)
-#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV)
-#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV)
-#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV)
-#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV)
-#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV)
-#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV)
-#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV)
-#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV)
-#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV)
-#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV)
-
-#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture)
-
-#endif /* GL_NV_video_capture */
-
-/* ------------------------ GL_OES_byte_coordinates ------------------------ */
-
-#ifndef GL_OES_byte_coordinates
-#define GL_OES_byte_coordinates 1
-
-#define GL_BYTE 0x1400
-
-#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates)
-
-#endif /* GL_OES_byte_coordinates */
-
-/* ------------------- GL_OES_compressed_paletted_texture ------------------ */
-
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-
-#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture)
-
-#endif /* GL_OES_compressed_paletted_texture */
-
-/* --------------------------- GL_OES_read_format -------------------------- */
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-
-#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format)
-
-#endif /* GL_OES_read_format */
-
-/* ------------------------ GL_OES_single_precision ------------------------ */
-
-#ifndef GL_OES_single_precision
-#define GL_OES_single_precision 1
-
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth);
-typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);
-typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation);
-typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-
-#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES)
-#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES)
-#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES)
-#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES)
-#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES)
-#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES)
-
-#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision)
-
-#endif /* GL_OES_single_precision */
-
-/* ---------------------------- GL_OML_interlace --------------------------- */
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-
-#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace)
-
-#endif /* GL_OML_interlace */
-
-/* ---------------------------- GL_OML_resample ---------------------------- */
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
-
-#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample)
-
-#endif /* GL_OML_resample */
-
-/* ---------------------------- GL_OML_subsample --------------------------- */
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
-
-#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample)
-
-#endif /* GL_OML_subsample */
-
-/* --------------------------- GL_PGI_misc_hints --------------------------- */
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000
-#define GL_CONSERVE_MEMORY_HINT_PGI 107005
-#define GL_RECLAIM_MEMORY_HINT_PGI 107006
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012
-#define GL_ALWAYS_FAST_HINT_PGI 107020
-#define GL_ALWAYS_SOFT_HINT_PGI 107021
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030
-#define GL_STRICT_LIGHTING_HINT_PGI 107031
-#define GL_STRICT_SCISSOR_HINT_PGI 107032
-#define GL_FULL_STIPPLE_HINT_PGI 107033
-#define GL_CLIP_NEAR_HINT_PGI 107040
-#define GL_CLIP_FAR_HINT_PGI 107041
-#define GL_WIDE_LINE_HINT_PGI 107042
-#define GL_BACK_NORMALS_HINT_PGI 107043
-
-#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints)
-
-#endif /* GL_PGI_misc_hints */
-
-/* -------------------------- GL_PGI_vertex_hints -------------------------- */
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_VERTEX_DATA_HINT_PGI 107050
-#define GL_VERTEX_CONSISTENT_HINT_PGI 107051
-#define GL_MATERIAL_SIDE_HINT_PGI 107052
-#define GL_MAX_VERTEX_HINT_PGI 107053
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-
-#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints)
-
-#endif /* GL_PGI_vertex_hints */
-
-/* ----------------------- GL_REND_screen_coordinates ---------------------- */
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-
-#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates)
-
-#endif /* GL_REND_screen_coordinates */
-
-/* ------------------------------- GL_S3_s3tc ------------------------------ */
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
-#define GL_RGBA_DXT5_S3TC 0x83A4
-#define GL_RGBA4_DXT5_S3TC 0x83A5
-
-#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc)
-
-#endif /* GL_S3_s3tc */
-
-/* -------------------------- GL_SGIS_color_range -------------------------- */
-
-#ifndef GL_SGIS_color_range
-#define GL_SGIS_color_range 1
-
-#define GL_EXTENDED_RANGE_SGIS 0x85A5
-#define GL_MIN_RED_SGIS 0x85A6
-#define GL_MAX_RED_SGIS 0x85A7
-#define GL_MIN_GREEN_SGIS 0x85A8
-#define GL_MAX_GREEN_SGIS 0x85A9
-#define GL_MIN_BLUE_SGIS 0x85AA
-#define GL_MAX_BLUE_SGIS 0x85AB
-#define GL_MIN_ALPHA_SGIS 0x85AC
-#define GL_MAX_ALPHA_SGIS 0x85AD
-
-#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range)
-
-#endif /* GL_SGIS_color_range */
-
-/* ------------------------- GL_SGIS_detail_texture ------------------------ */
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-
-typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points);
-
-#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS)
-#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS)
-
-#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture)
-
-#endif /* GL_SGIS_detail_texture */
-
-/* -------------------------- GL_SGIS_fog_function ------------------------- */
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-
-typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points);
-
-#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS)
-#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS)
-
-#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function)
-
-#endif /* GL_SGIS_fog_function */
-
-/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-
-#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap)
-
-#endif /* GL_SGIS_generate_mipmap */
-
-/* -------------------------- GL_SGIS_multisample -------------------------- */
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-
-#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS)
-#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS)
-
-#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample)
-
-#endif /* GL_SGIS_multisample */
-
-/* ------------------------- GL_SGIS_pixel_texture ------------------------- */
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-
-#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture)
-
-#endif /* GL_SGIS_pixel_texture */
-
-/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-
-#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen)
-
-#endif /* GL_SGIS_point_line_texgen */
-
-/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-
-typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points);
-
-#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS)
-#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS)
-
-#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture)
-
-#endif /* GL_SGIS_sharpen_texture */
-
-/* --------------------------- GL_SGIS_texture4D --------------------------- */
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels);
-
-#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS)
-#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS)
-
-#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D)
-
-#endif /* GL_SGIS_texture4D */
-
-/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-
-#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp)
-
-#endif /* GL_SGIS_texture_border_clamp */
-
-/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-
-#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp)
-
-#endif /* GL_SGIS_texture_edge_clamp */
-
-/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-
-typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights);
-typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights);
-
-#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS)
-#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS)
-
-#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4)
-
-#endif /* GL_SGIS_texture_filter4 */
-
-/* -------------------------- GL_SGIS_texture_lod -------------------------- */
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-
-#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod)
-
-#endif /* GL_SGIS_texture_lod */
-
-/* ------------------------- GL_SGIS_texture_select ------------------------ */
-
-#ifndef GL_SGIS_texture_select
-#define GL_SGIS_texture_select 1
-
-#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select)
-
-#endif /* GL_SGIS_texture_select */
-
-/* ----------------------------- GL_SGIX_async ----------------------------- */
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-
-#define GL_ASYNC_MARKER_SGIX 0x8329
-
-typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp);
-typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp);
-
-#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX)
-#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX)
-#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX)
-#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX)
-#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX)
-#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX)
-
-#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async)
-
-#endif /* GL_SGIX_async */
-
-/* ------------------------ GL_SGIX_async_histogram ------------------------ */
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-
-#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram)
-
-#endif /* GL_SGIX_async_histogram */
-
-/* -------------------------- GL_SGIX_async_pixel -------------------------- */
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-
-#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel)
-
-#endif /* GL_SGIX_async_pixel */
-
-/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-
-#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax)
-
-#endif /* GL_SGIX_blend_alpha_minmax */
-
-/* ---------------------------- GL_SGIX_clipmap ---------------------------- */
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-
-#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap)
-
-#endif /* GL_SGIX_clipmap */
-
-/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-
-#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy)
-
-#endif /* GL_SGIX_convolution_accuracy */
-
-/* ------------------------- GL_SGIX_depth_texture ------------------------- */
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-
-#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture)
-
-#endif /* GL_SGIX_depth_texture */
-
-/* -------------------------- GL_SGIX_flush_raster ------------------------- */
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-
-typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void);
-
-#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX)
-
-#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster)
-
-#endif /* GL_SGIX_flush_raster */
-
-/* --------------------------- GL_SGIX_fog_offset -------------------------- */
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-
-#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset)
-
-#endif /* GL_SGIX_fog_offset */
-
-/* -------------------------- GL_SGIX_fog_texture -------------------------- */
-
-#ifndef GL_SGIX_fog_texture
-#define GL_SGIX_fog_texture 1
-
-#define GL_TEXTURE_FOG_SGIX 0
-#define GL_FOG_PATCHY_FACTOR_SGIX 0
-#define GL_FRAGMENT_FOG_SGIX 0
-
-typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname);
-
-#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX)
-
-#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture)
-
-#endif /* GL_SGIX_fog_texture */
-
-/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */
-
-#ifndef GL_SGIX_fragment_specular_lighting
-#define GL_SGIX_fragment_specular_lighting 1
-
-typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data);
-
-#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX)
-#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX)
-#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX)
-#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX)
-#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX)
-#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX)
-#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX)
-#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX)
-#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX)
-#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX)
-#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX)
-#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX)
-#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX)
-#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX)
-#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX)
-#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX)
-#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX)
-
-#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting)
-
-#endif /* GL_SGIX_fragment_specular_lighting */
-
-/* --------------------------- GL_SGIX_framezoom --------------------------- */
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-
-typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-
-#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX)
-
-#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom)
-
-#endif /* GL_SGIX_framezoom */
-
-/* --------------------------- GL_SGIX_interlace --------------------------- */
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-
-#define GL_INTERLACE_SGIX 0x8094
-
-#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace)
-
-#endif /* GL_SGIX_interlace */
-
-/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-
-#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1)
-
-#endif /* GL_SGIX_ir_instrument1 */
-
-/* ------------------------- GL_SGIX_list_priority ------------------------- */
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-
-#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority)
-
-#endif /* GL_SGIX_list_priority */
-
-/* ------------------------- GL_SGIX_pixel_texture ------------------------- */
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-
-typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-
-#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX)
-
-#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture)
-
-#endif /* GL_SGIX_pixel_texture */
-
-/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */
-
-#ifndef GL_SGIX_pixel_texture_bits
-#define GL_SGIX_pixel_texture_bits 1
-
-#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits)
-
-#endif /* GL_SGIX_pixel_texture_bits */
-
-/* ------------------------ GL_SGIX_reference_plane ------------------------ */
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-
-typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation);
-
-#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX)
-
-#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane)
-
-#endif /* GL_SGIX_reference_plane */
-
-/* ---------------------------- GL_SGIX_resample --------------------------- */
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-
-#define GL_PACK_RESAMPLE_SGIX 0x842E
-#define GL_UNPACK_RESAMPLE_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#define GL_RESAMPLE_REPLICATE_SGIX 0x8433
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434
-
-#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample)
-
-#endif /* GL_SGIX_resample */
-
-/* ----------------------------- GL_SGIX_shadow ---------------------------- */
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-
-#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow)
-
-#endif /* GL_SGIX_shadow */
-
-/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-
-#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient)
-
-#endif /* GL_SGIX_shadow_ambient */
-
-/* ----------------------------- GL_SGIX_sprite ---------------------------- */
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params);
-
-#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX)
-#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX)
-#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX)
-#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX)
-
-#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite)
-
-#endif /* GL_SGIX_sprite */
-
-/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-
-typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-
-#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX)
-
-#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer)
-
-#endif /* GL_SGIX_tag_sample_buffer */
-
-/* ------------------------ GL_SGIX_texture_add_env ------------------------ */
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-
-#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env)
-
-#endif /* GL_SGIX_texture_add_env */
-
-/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
-
-#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp)
-
-#endif /* GL_SGIX_texture_coordinate_clamp */
-
-/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-
-#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias)
-
-#endif /* GL_SGIX_texture_lod_bias */
-
-/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-
-#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer)
-
-#endif /* GL_SGIX_texture_multi_buffer */
-
-/* ------------------------- GL_SGIX_texture_range ------------------------- */
-
-#ifndef GL_SGIX_texture_range
-#define GL_SGIX_texture_range 1
-
-#define GL_RGB_SIGNED_SGIX 0x85E0
-#define GL_RGBA_SIGNED_SGIX 0x85E1
-#define GL_ALPHA_SIGNED_SGIX 0x85E2
-#define GL_LUMINANCE_SIGNED_SGIX 0x85E3
-#define GL_INTENSITY_SIGNED_SGIX 0x85E4
-#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5
-#define GL_RGB16_SIGNED_SGIX 0x85E6
-#define GL_RGBA16_SIGNED_SGIX 0x85E7
-#define GL_ALPHA16_SIGNED_SGIX 0x85E8
-#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9
-#define GL_INTENSITY16_SIGNED_SGIX 0x85EA
-#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB
-#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC
-#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED
-#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE
-#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF
-#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0
-#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1
-#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2
-#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3
-#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4
-#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5
-#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6
-#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7
-#define GL_MIN_LUMINANCE_SGIS 0x85F8
-#define GL_MAX_LUMINANCE_SGIS 0x85F9
-#define GL_MIN_INTENSITY_SGIS 0x85FA
-#define GL_MAX_INTENSITY_SGIS 0x85FB
-
-#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range)
-
-#endif /* GL_SGIX_texture_range */
-
-/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-
-#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias)
-
-#endif /* GL_SGIX_texture_scale_bias */
-
-/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-
-#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip)
-
-#endif /* GL_SGIX_vertex_preclip */
-
-/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */
-
-#ifndef GL_SGIX_vertex_preclip_hint
-#define GL_SGIX_vertex_preclip_hint 1
-
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-
-#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint)
-
-#endif /* GL_SGIX_vertex_preclip_hint */
-
-/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-
-#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb)
-
-#endif /* GL_SGIX_ycrcb */
-
-/* -------------------------- GL_SGI_color_matrix -------------------------- */
-
-#ifndef GL_SGI_color_matrix
-#define GL_SGI_color_matrix 1
-
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-
-#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix)
-
-#endif /* GL_SGI_color_matrix */
-
-/* --------------------------- GL_SGI_color_table -------------------------- */
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table);
-
-#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI)
-#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI)
-#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI)
-#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI)
-#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI)
-#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI)
-#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI)
-
-#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table)
-
-#endif /* GL_SGI_color_table */
-
-/* ----------------------- GL_SGI_texture_color_table ---------------------- */
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-
-#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table)
-
-#endif /* GL_SGI_texture_color_table */
-
-/* ------------------------- GL_SUNX_constant_data ------------------------- */
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-
-typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void);
-
-#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX)
-
-#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data)
-
-#endif /* GL_SUNX_constant_data */
-
-/* -------------------- GL_SUN_convolution_border_modes -------------------- */
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-
-#define GL_WRAP_BORDER_SUN 0x81D4
-
-#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes)
-
-#endif /* GL_SUN_convolution_border_modes */
-
-/* -------------------------- GL_SUN_global_alpha -------------------------- */
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-
-#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN)
-#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN)
-#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN)
-#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN)
-#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN)
-#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN)
-#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN)
-#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN)
-
-#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha)
-
-#endif /* GL_SUN_global_alpha */
-
-/* --------------------------- GL_SUN_mesh_array --------------------------- */
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-
-#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array)
-
-#endif /* GL_SUN_mesh_array */
-
-/* ------------------------ GL_SUN_read_video_pixels ----------------------- */
-
-#ifndef GL_SUN_read_video_pixels
-#define GL_SUN_read_video_pixels 1
-
-typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
-
-#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN)
-
-#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels)
-
-#endif /* GL_SUN_read_video_pixels */
-
-/* --------------------------- GL_SUN_slice_accum -------------------------- */
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-
-#define GL_SLICE_ACCUM_SUN 0x85CC
-
-#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum)
-
-#endif /* GL_SUN_slice_accum */
-
-/* -------------------------- GL_SUN_triangle_list ------------------------- */
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-
-#define GL_RESTART_SUN 0x01
-#define GL_REPLACE_MIDDLE_SUN 0x02
-#define GL_REPLACE_OLDEST_SUN 0x03
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code);
-
-#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN)
-#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN)
-#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN)
-#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN)
-#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN)
-#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN)
-#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN)
-
-#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list)
-
-#endif /* GL_SUN_triangle_list */
-
-/* ----------------------------- GL_SUN_vertex ----------------------------- */
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-
-typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v);
-
-#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN)
-#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN)
-#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN)
-#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN)
-#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN)
-#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN)
-#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN)
-#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN)
-#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN)
-#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN)
-#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN)
-#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN)
-#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN)
-#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN)
-#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN)
-#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN)
-#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN)
-#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN)
-#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN)
-#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN)
-#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN)
-#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN)
-#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN)
-#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN)
-#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN)
-#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN)
-#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN)
-#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN)
-#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN)
-#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN)
-#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN)
-#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN)
-#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN)
-
-#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex)
-
-#endif /* GL_SUN_vertex */
-
-/* -------------------------- GL_WIN_phong_shading ------------------------- */
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-
-#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading)
-
-#endif /* GL_WIN_phong_shading */
-
-/* -------------------------- GL_WIN_specular_fog -------------------------- */
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-
-#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog)
-
-#endif /* GL_WIN_specular_fog */
-
-/* ---------------------------- GL_WIN_swap_hint --------------------------- */
-
-#ifndef GL_WIN_swap_hint
-#define GL_WIN_swap_hint 1
-
-typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN)
-
-#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint)
-
-#endif /* GL_WIN_swap_hint */
-
-/* ------------------------------------------------------------------------- */
-
-#if defined(GLEW_MX) && defined(_WIN32)
-#define GLEW_FUN_EXPORT
-#else
-#define GLEW_FUN_EXPORT GLEWAPI
-#endif /* GLEW_MX */
-
-#if defined(GLEW_MX)
-#define GLEW_VAR_EXPORT
-#else
-#define GLEW_VAR_EXPORT GLEWAPI
-#endif /* GLEW_MX */
-
-#if defined(GLEW_MX) && defined(_WIN32)
-struct GLEWContextStruct
-{
-#endif /* GLEW_MX */
-
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D;
-
-GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture;
-GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage;
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd;
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv;
-GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage;
-
-GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate;
-GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer;
-GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData;
-GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData;
-GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers;
-GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries;
-GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery;
-GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers;
-GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv;
-GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv;
-GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv;
-GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer;
-GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery;
-GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer;
-GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer;
-
-GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader;
-GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate;
-GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader;
-GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram;
-GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram;
-GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader;
-GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray;
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray;
-GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform;
-GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders;
-GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv;
-GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog;
-GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource;
-GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv;
-GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram;
-GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader;
-GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram;
-GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource;
-GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate;
-GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate;
-GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv;
-GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram;
-GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer;
-
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv;
-
-GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender;
-GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback;
-GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation;
-GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv;
-GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski;
-GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei;
-GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei;
-GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender;
-GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback;
-GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v;
-GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation;
-GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv;
-GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv;
-GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced;
-GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex;
-GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v;
-GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v;
-
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci;
-GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading;
-
-GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX;
-
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD;
-GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD;
-
-GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD;
-GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD;
-GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD;
-
-GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD;
-GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD;
-GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD;
-GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD;
-GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD;
-
-GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD;
-
-GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD;
-GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD;
-
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE;
-
-GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE;
-GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE;
-GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE;
-GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE;
-
-GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE;
-GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE;
-
-GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE;
-GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE;
-GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE;
-
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE;
-GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE;
-
-GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE;
-GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE;
-GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE;
-
-GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE;
-
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE;
-GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE;
-
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef;
-GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat;
-GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler;
-GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed;
-GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex;
-
-GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB;
-
-GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB;
-
-GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData;
-
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB;
-GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer;
-GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer;
-GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer;
-GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
-GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;
-GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer;
-GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers;
-GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers;
-GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv;
-GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv;
-GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer;
-GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer;
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage;
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB;
-
-GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary;
-GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri;
-
-GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d;
-GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d;
-GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d;
-GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d;
-GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv;
-
-GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv;
-GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter;
-GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram;
-GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax;
-GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram;
-GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax;
-GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB;
-
-GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ;
-
-GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange;
-GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange;
-
-GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB;
-
-GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB;
-
-GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB;
-GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB;
-GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB;
-GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB;
-GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB;
-GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB;
-GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB;
-
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB;
-
-GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex;
-
-GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB;
-GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB;
-GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB;
-GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB;
-GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB;
-GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB;
-GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB;
-GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB;
-GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB;
-GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB;
-GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB;
-GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB;
-GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB;
-GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB;
-GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB;
-GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB;
-
-GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB;
-
-GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler;
-GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers;
-GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv;
-GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv;
-
-GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram;
-GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline;
-GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines;
-GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv;
-GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv;
-GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages;
-GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline;
-
-GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv;
-
-GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture;
-GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier;
-
-GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB;
-GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB;
-GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB;
-GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB;
-GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB;
-GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB;
-GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB;
-GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB;
-GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB;
-GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB;
-GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB;
-GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB;
-GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB;
-GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB;
-GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB;
-GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB;
-
-GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName;
-GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName;
-GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv;
-GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex;
-GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv;
-GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv;
-
-GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB;
-GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB;
-GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB;
-GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB;
-GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB;
-GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB;
-
-GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync;
-GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync;
-GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync;
-GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v;
-GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv;
-GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync;
-GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync;
-
-GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv;
-GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri;
-
-GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB;
-
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB;
-
-GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv;
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample;
-
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D;
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D;
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v;
-GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter;
-
-GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback;
-GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback;
-GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks;
-GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback;
-GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback;
-GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream;
-GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed;
-GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv;
-
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced;
-
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB;
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB;
-
-GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv;
-GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices;
-GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding;
-
-GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray;
-GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays;
-GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays;
-GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer;
-
-GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB;
-
-GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB;
-GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB;
-GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB;
-GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB;
-GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB;
-GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB;
-GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB;
-GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB;
-GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB;
-
-GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB;
-GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB;
-GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB;
-
-GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB;
-GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB;
-GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB;
-
-GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui;
-GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv;
-GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui;
-GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv;
-GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui;
-GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui;
-GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui;
-GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui;
-GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv;
-
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v;
-GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v;
-GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv;
-GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed;
-GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv;
-GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv;
-GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf;
-GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv;
-
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI;
-
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI;
-GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI;
-
-GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI;
-GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI;
-GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI;
-GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI;
-
-GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI;
-GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI;
-GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI;
-GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI;
-GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI;
-GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI;
-GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI;
-GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI;
-GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI;
-GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI;
-
-GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI;
-
-GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI;
-GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI;
-
-GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI;
-GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI;
-
-GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI;
-GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI;
-GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI;
-GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI;
-GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI;
-GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI;
-GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI;
-GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI;
-
-GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI;
-GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI;
-
-GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT;
-
-GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT;
-
-GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT;
-GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT;
-
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT;
-GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT;
-
-GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT;
-GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT;
-GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT;
-
-GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT;
-GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT;
-GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT;
-GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT;
-GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT;
-GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT;
-GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT;
-GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT;
-GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT;
-GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT;
-GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT;
-GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT;
-GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT;
-
-GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT;
-GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT;
-GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT;
-
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT;
-
-GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT;
-GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT;
-
-GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT;
-
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT;
-GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT;
-GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT;
-GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT;
-GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT;
-GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT;
-GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT;
-GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT;
-GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT;
-GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT;
-GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT;
-GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT;
-
-GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT;
-
-GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT;
-
-GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT;
-
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT;
-GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT;
-
-GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT;
-
-GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT;
-
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT;
-
-GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT;
-
-GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT;
-
-GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT;
-GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT;
-
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT;
-GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT;
-GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT;
-GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT;
-
-GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT;
-
-GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT;
-GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT;
-
-GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT;
-GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT;
-GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT;
-GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT;
-GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT;
-GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT;
-
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT;
-
-GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT;
-GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT;
-GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT;
-GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT;
-
-GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT;
-GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT;
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT;
-GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT;
-GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT;
-GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT;
-GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT;
-GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT;
-GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT;
-GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT;
-GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT;
-GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT;
-GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT;
-GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT;
-GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT;
-GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT;
-GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT;
-GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT;
-GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT;
-GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT;
-GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT;
-GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT;
-
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT;
-
-GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY;
-
-GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY;
-
-GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP;
-GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP;
-
-GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM;
-GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM;
-
-GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM;
-GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM;
-GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM;
-
-GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL;
-
-GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL;
-GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL;
-
-GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled;
-GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion;
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion;
-GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion;
-GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion;
-
-GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA;
-
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA;
-
-GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV;
-GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV;
-
-GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV;
-
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV;
-GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV;
-
-GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV;
-GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV;
-GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV;
-GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV;
-GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV;
-GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV;
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV;
-GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV;
-
-GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV;
-GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV;
-GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV;
-GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV;
-GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV;
-GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV;
-GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV;
-
-GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV;
-
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV;
-
-GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV;
-
-GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV;
-GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV;
-GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV;
-GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV;
-GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV;
-GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV;
-GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV;
-GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV;
-GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV;
-GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV;
-GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV;
-
-GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV;
-GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV;
-GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV;
-GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV;
-GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV;
-GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV;
-GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV;
-
-GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV;
-GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV;
-GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV;
-GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV;
-GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV;
-GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV;
-GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV;
-GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV;
-GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV;
-GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV;
-GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV;
-GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV;
-GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV;
-GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV;
-GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV;
-GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV;
-GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV;
-GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV;
-GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV;
-GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV;
-GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV;
-GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV;
-GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV;
-GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV;
-GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV;
-GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV;
-GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV;
-GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV;
-GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV;
-GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV;
-GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV;
-GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV;
-GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV;
-GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV;
-GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV;
-GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV;
-GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV;
-
-GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV;
-GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV;
-
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV;
-GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV;
-GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV;
-
-GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV;
-GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV;
-
-GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV;
-GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV;
-GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV;
-
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV;
-GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV;
-GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV;
-
-GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV;
-
-GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV;
-
-GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV;
-GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV;
-GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV;
-GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV;
-GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV;
-GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV;
-
-GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV;
-GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV;
-
-GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV;
-GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV;
-GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV;
-GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV;
-GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV;
-GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV;
-GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV;
-GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV;
-GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV;
-GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV;
-
-GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV;
-
-GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV;
-GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV;
-GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV;
-GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV;
-GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV;
-GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV;
-
-GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV;
-GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV;
-GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV;
-GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV;
-GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV;
-GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV;
-GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV;
-GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV;
-GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV;
-
-GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV;
-GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV;
-GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV;
-GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES;
-GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES;
-GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES;
-GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES;
-GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES;
-
-GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS;
-GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS;
-GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS;
-GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS;
-
-GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS;
-GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS;
-
-GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS;
-GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX;
-GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX;
-GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX;
-GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX;
-GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX;
-GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX;
-
-GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX;
-
-GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX;
-
-GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX;
-
-GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX;
-
-GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX;
-
-GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX;
-
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX;
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX;
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX;
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX;
-
-GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX;
-
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI;
-GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI;
-
-GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX;
-
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN;
-
-GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN;
-
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN;
-
-GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN;
-
-GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN;
-
-#if defined(GLEW_MX) && !defined(_WIN32)
-struct GLEWContextStruct
-{
-#endif /* GLEW_MX */
-
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2;
-GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator;
-GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists;
-GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read;
-GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor;
-GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision;
-GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace;
-GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample;
-GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample;
-GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints;
-GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints;
-GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates;
-GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading;
-GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog;
-GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint;
-
-#ifdef GLEW_MX
-}; /* GLEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------- */
-
-/* error codes */
-#define GLEW_OK 0
-#define GLEW_NO_ERROR 0
-#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */
-#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */
-#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */
-
-/* string codes */
-#define GLEW_VERSION 1
-#define GLEW_VERSION_MAJOR 2
-#define GLEW_VERSION_MINOR 3
-#define GLEW_VERSION_MICRO 4
-
-/* API */
-#ifdef GLEW_MX
-
-typedef struct GLEWContextStruct GLEWContext;
-GLEWAPI GLenum glewContextInit (GLEWContext* ctx);
-GLEWAPI GLboolean glewContextIsSupported (const GLEWContext* ctx, const char* name);
-
-#define glewInit() glewContextInit(glewGetContext())
-#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x)
-#define glewIsExtensionSupported(x) glewIsSupported(x)
-
-#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x))
-#ifdef _WIN32
-# define GLEW_GET_FUN(x) glewGetContext()->x
-#else
-# define GLEW_GET_FUN(x) x
-#endif
-
-#else /* GLEW_MX */
-
-GLEWAPI GLenum glewInit ();
-GLEWAPI GLboolean glewIsSupported (const char* name);
-#define glewIsExtensionSupported(x) glewIsSupported(x)
-
-#define GLEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define GLEW_GET_FUN(x) x
-
-#endif /* GLEW_MX */
-
-GLEWAPI GLboolean glewExperimental;
-GLEWAPI GLboolean glewGetExtension (const char* name);
-GLEWAPI const GLubyte* glewGetErrorString (GLenum error);
-GLEWAPI const GLubyte* glewGetString (GLenum name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef GLEW_APIENTRY_DEFINED
-#undef GLEW_APIENTRY_DEFINED
-#undef APIENTRY
-#undef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#ifdef GLEW_CALLBACK_DEFINED
-#undef GLEW_CALLBACK_DEFINED
-#undef CALLBACK
-#endif
-
-#ifdef GLEW_WINGDIAPI_DEFINED
-#undef GLEW_WINGDIAPI_DEFINED
-#undef WINGDIAPI
-#endif
-
-#undef GLAPI
-/* #undef GLEWAPI */
-
-#endif /* __glew_h__ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glext.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glext.h
deleted file mode 100644
index 5a6dbc4c..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glext.h
+++ /dev/null
@@ -1,11163 +0,0 @@
-#ifndef __glext_h_
-#define __glext_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2014 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-**
-** Khronos $Revision: 28221 $ on $Date: 2014-09-18 20:11:05 -0700 (Thu, 18 Sep 2014) $
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN 1
-#endif
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-#define GL_GLEXT_VERSION 20140918
-
-/* Generated C header for:
- * API: gl
- * Profile: compatibility
- * Versions considered: .*
- * Versions emitted: 1\.[2-9]|[234]\.[0-9]
- * Default extensions included: gl
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_VERSION_1_2 */
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_MULTISAMPLE_BIT 0x20000000
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum texture);
-GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img);
-GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
-GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
-GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
-GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
-GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
-GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
-GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
-#endif
-#endif /* GL_VERSION_1_3 */
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_TEXTURE_FILTER_CONTROL 0x8500
-#define GL_DEPTH_TEXTURE_MODE 0x884B
-#define GL_COMPARE_R_TO_TEXTURE 0x884E
-#define GL_FUNC_ADD 0x8006
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
-GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
-GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFogCoordf (GLfloat coord);
-GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
-GLAPI void APIENTRY glFogCoordd (GLdouble coord);
-GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
-GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
-GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
-GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
-GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
-GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
-GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
-GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
-GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
-GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
-GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
-GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
-GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void APIENTRY glBlendEquation (GLenum mode);
-#endif
-#endif /* GL_VERSION_1_4 */
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#include <stddef.h>
-typedef ptrdiff_t GLsizeiptr;
-typedef ptrdiff_t GLintptr;
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-#define GL_SRC1_ALPHA 0x8589
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_FOG_COORD_SRC 0x8450
-#define GL_FOG_COORD 0x8451
-#define GL_CURRENT_FOG_COORD 0x8453
-#define GL_FOG_COORD_ARRAY_TYPE 0x8454
-#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORD_ARRAY_POINTER 0x8456
-#define GL_FOG_COORD_ARRAY 0x8457
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
-#define GL_SRC0_RGB 0x8580
-#define GL_SRC1_RGB 0x8581
-#define GL_SRC2_RGB 0x8582
-#define GL_SRC0_ALPHA 0x8588
-#define GL_SRC2_ALPHA 0x858A
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data);
-typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
-GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQuery (GLenum target);
-GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
-GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
-GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data);
-GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
-#endif
-#endif /* GL_VERSION_1_5 */
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-typedef char GLchar;
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
-#define GL_POINT_SPRITE 0x8861
-#define GL_COORD_REPLACE 0x8862
-#define GL_MAX_TEXTURE_COORDS 0x8871
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GLAPI void APIENTRY glCompileShader (GLuint shader);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum type);
-GLAPI void APIENTRY glDeleteProgram (GLuint program);
-GLAPI void APIENTRY glDeleteShader (GLuint shader);
-GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
-GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
-GLAPI void APIENTRY glLinkProgram (GLuint program);
-GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-GLAPI void APIENTRY glUseProgram (GLuint program);
-GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glValidateProgram (GLuint program);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-#endif
-#endif /* GL_VERSION_2_0 */
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB_ALPHA 0x8C42
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_COMPRESSED_SRGB 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
-#define GL_SLUMINANCE_ALPHA 0x8C44
-#define GL_SLUMINANCE8_ALPHA8 0x8C45
-#define GL_SLUMINANCE 0x8C46
-#define GL_SLUMINANCE8 0x8C47
-#define GL_COMPRESSED_SLUMINANCE 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-#endif /* GL_VERSION_2_1 */
-
-#ifndef GL_VERSION_3_0
-#define GL_VERSION_3_0 1
-typedef unsigned short GLhalf;
-#define GL_COMPARE_REF_TO_TEXTURE 0x884E
-#define GL_CLIP_DISTANCE0 0x3000
-#define GL_CLIP_DISTANCE1 0x3001
-#define GL_CLIP_DISTANCE2 0x3002
-#define GL_CLIP_DISTANCE3 0x3003
-#define GL_CLIP_DISTANCE4 0x3004
-#define GL_CLIP_DISTANCE5 0x3005
-#define GL_CLIP_DISTANCE6 0x3006
-#define GL_CLIP_DISTANCE7 0x3007
-#define GL_MAX_CLIP_DISTANCES 0x0D32
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_CONTEXT_FLAGS 0x821E
-#define GL_COMPRESSED_RED 0x8225
-#define GL_COMPRESSED_RG 0x8226
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_CLAMP_READ_COLOR 0x891C
-#define GL_FIXED_ONLY 0x891D
-#define GL_MAX_VARYING_COMPONENTS 0x8B4B
-#define GL_TEXTURE_1D_ARRAY 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_PRIMITIVES_GENERATED 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_GREEN_INTEGER 0x8D95
-#define GL_BLUE_INTEGER 0x8D96
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_BGR_INTEGER 0x8D9A
-#define GL_BGRA_INTEGER 0x8D9B
-#define GL_SAMPLER_1D_ARRAY 0x8DC0
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_1D 0x8DC9
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_QUERY_WAIT 0x8E13
-#define GL_QUERY_NO_WAIT 0x8E14
-#define GL_QUERY_BY_REGION_WAIT 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_STENCIL_INDEX1 0x8D46
-#define GL_STENCIL_INDEX4 0x8D47
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_STENCIL_INDEX16 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-#define GL_INDEX 0x8222
-#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-#define GL_HALF_FLOAT 0x140B
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-#define GL_COMPRESSED_RED_RGTC1 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
-#define GL_COMPRESSED_RG_RGTC2 0x8DBD
-#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_R16 0x822A
-#define GL_RG8 0x822B
-#define GL_RG16 0x822C
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-#define GL_CLAMP_VERTEX_COLOR 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR 0x891B
-#define GL_ALPHA_INTEGER 0x8D97
-typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
-GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
-GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
-GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedback (void);
-GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
-GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRender (void);
-GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
-GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index);
-GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmap (GLenum target);
-GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-GLAPI void APIENTRY glBindVertexArray (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
-#endif
-#endif /* GL_VERSION_3_0 */
-
-#ifndef GL_VERSION_3_1
-#define GL_VERSION_3_1 1
-#define GL_SAMPLER_2D_RECT 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
-#define GL_SAMPLER_BUFFER 0x8DC2
-#define GL_INT_SAMPLER_2D_RECT 0x8DCD
-#define GL_INT_SAMPLER_BUFFER 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
-#define GL_TEXTURE_BUFFER 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_RECTANGLE 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART 0x8F9D
-#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFFu
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
-GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
-GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
-GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif
-#endif /* GL_VERSION_3_1 */
-
-#ifndef GL_VERSION_3_2
-#define GL_VERSION_3_2 1
-typedef struct __GLsync *GLsync;
-#ifndef GLEXT_64_TYPES_DEFINED
-/* This code block is duplicated in glxext.h, so must be protected */
-#define GLEXT_64_TYPES_DEFINED
-/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
-/* (as used in the GL_EXT_timer_query extension). */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#include <inttypes.h>
-#elif defined(__sun__) || defined(__digital__)
-#include <inttypes.h>
-#if defined(__STDC__)
-#if defined(__arch64__) || defined(_LP64)
-typedef long int int64_t;
-typedef unsigned long int uint64_t;
-#else
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#endif /* __arch64__ */
-#endif /* __STDC__ */
-#elif defined( __VMS ) || defined(__sgi)
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__)
-#include <stdint.h>
-#elif defined(__UNIXOS2__) || defined(__SOL64__)
-typedef long int int32_t;
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#elif defined(_WIN32) && defined(__GNUC__)
-#include <stdint.h>
-#elif defined(_WIN32)
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#else
-/* Fallback if nothing above works */
-#include <inttypes.h>
-#endif
-#endif
-typedef uint64_t GLuint64;
-typedef int64_t GLint64;
-#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define GL_LINES_ADJACENCY 0x000A
-#define GL_LINE_STRIP_ADJACENCY 0x000B
-#define GL_TRIANGLES_ADJACENCY 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
-#define GL_PROGRAM_POINT_SIZE 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_GEOMETRY_SHADER 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT 0x8916
-#define GL_GEOMETRY_INPUT_TYPE 0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_CONTEXT_PROFILE_MASK 0x9126
-#define GL_DEPTH_CLAMP 0x864F
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_PROVOKING_VERTEX 0x8E4F
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
-#define GL_MAX_INTEGER_SAMPLES 0x9110
-typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
-typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
-typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
-GLAPI void APIENTRY glProvokingVertex (GLenum mode);
-GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
-GLAPI void APIENTRY glDeleteSync (GLsync sync);
-GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
-GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
-#endif
-#endif /* GL_VERSION_3_2 */
-
-#ifndef GL_VERSION_3_3
-#define GL_VERSION_3_3 1
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_SRC1_COLOR 0x88F9
-#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-#define GL_SAMPLER_BINDING 0x8919
-#define GL_RGB10_A2UI 0x906F
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-#define GL_TIME_ELAPSED 0x88BF
-#define GL_TIMESTAMP 0x8E28
-#define GL_INT_2_10_10_10_REV 0x8D9F
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
-GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
-GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
-GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
-GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
-#endif
-#endif /* GL_VERSION_3_3 */
-
-#ifndef GL_VERSION_4_0
-#define GL_VERSION_4_0 1
-#define GL_SAMPLE_SHADING 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-#define GL_DOUBLE_VEC2 0x8FFC
-#define GL_DOUBLE_VEC3 0x8FFD
-#define GL_DOUBLE_VEC4 0x8FFE
-#define GL_DOUBLE_MAT2 0x8F46
-#define GL_DOUBLE_MAT3 0x8F47
-#define GL_DOUBLE_MAT4 0x8F48
-#define GL_DOUBLE_MAT2x3 0x8F49
-#define GL_DOUBLE_MAT2x4 0x8F4A
-#define GL_DOUBLE_MAT3x2 0x8F4B
-#define GL_DOUBLE_MAT3x4 0x8F4C
-#define GL_DOUBLE_MAT4x2 0x8F4D
-#define GL_DOUBLE_MAT4x3 0x8F4E
-#define GL_ACTIVE_SUBROUTINES 0x8DE5
-#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
-#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
-#define GL_MAX_SUBROUTINES 0x8DE7
-#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
-#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
-#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
-#define GL_PATCHES 0x000E
-#define GL_PATCH_VERTICES 0x8E72
-#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
-#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
-#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
-#define GL_TESS_GEN_MODE 0x8E76
-#define GL_TESS_GEN_SPACING 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
-#define GL_TESS_GEN_POINT_MODE 0x8E79
-#define GL_ISOLINES 0x8E7A
-#define GL_FRACTIONAL_ODD 0x8E7B
-#define GL_FRACTIONAL_EVEN 0x8E7C
-#define GL_MAX_PATCH_VERTICES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
-#define GL_TESS_EVALUATION_SHADER 0x8E87
-#define GL_TESS_CONTROL_SHADER 0x8E88
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect);
-typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
-typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
-typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
-typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
-typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShading (GLfloat value);
-GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
-GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
-GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
-GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
-GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
-GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
-GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
-GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
-GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedback (void);
-GLAPI void APIENTRY glResumeTransformFeedback (void);
-GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
-GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
-GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
-GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
-GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif
-#endif /* GL_VERSION_4_0 */
-
-#ifndef GL_VERSION_4_1
-#define GL_VERSION_4_1 1
-#define GL_FIXED 0x140C
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_RGB565 0x8D62
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#define GL_MAX_VIEWPORTS 0x825B
-#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
-#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
-#define GL_LAYER_PROVOKING_VERTEX 0x825E
-#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
-#define GL_UNDEFINED_VERTEX 0x8260
-typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
-typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
-typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
-typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
-typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReleaseShaderCompiler (void);
-GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
-GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f);
-GLAPI void APIENTRY glClearDepthf (GLfloat d);
-GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
-GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
-GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
-GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
-GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
-GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f);
-GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
-GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
-#endif
-#endif /* GL_VERSION_4_1 */
-
-#ifndef GL_VERSION_4_2
-#define GL_VERSION_4_2 1
-#define GL_COPY_READ_BUFFER_BINDING 0x8F36
-#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
-#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
-#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
-#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
-#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
-#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
-#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
-#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
-#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
-#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
-#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
-#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
-#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
-#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
-#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
-#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
-#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
-#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
-#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-#define GL_MAX_IMAGE_UNITS 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
-#define GL_IMAGE_BINDING_NAME 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED 0x8F3C
-#define GL_IMAGE_BINDING_LAYER 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS 0x8F3E
-#define GL_IMAGE_1D 0x904C
-#define GL_IMAGE_2D 0x904D
-#define GL_IMAGE_3D 0x904E
-#define GL_IMAGE_2D_RECT 0x904F
-#define GL_IMAGE_CUBE 0x9050
-#define GL_IMAGE_BUFFER 0x9051
-#define GL_IMAGE_1D_ARRAY 0x9052
-#define GL_IMAGE_2D_ARRAY 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
-#define GL_INT_IMAGE_1D 0x9057
-#define GL_INT_IMAGE_2D 0x9058
-#define GL_INT_IMAGE_3D 0x9059
-#define GL_INT_IMAGE_2D_RECT 0x905A
-#define GL_INT_IMAGE_CUBE 0x905B
-#define GL_INT_IMAGE_BUFFER 0x905C
-#define GL_INT_IMAGE_1D_ARRAY 0x905D
-#define GL_INT_IMAGE_2D_ARRAY 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
-#define GL_MAX_IMAGE_SAMPLES 0x906D
-#define GL_IMAGE_BINDING_FORMAT 0x906E
-#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
-#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
-#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
-#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
-#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
-typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
-typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
-GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
-GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
-GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
-GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount);
-GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
-#endif
-#endif /* GL_VERSION_4_2 */
-
-#ifndef GL_VERSION_4_3
-#define GL_VERSION_4_3 1
-typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
-#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9
-#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-#define GL_COMPRESSED_R11_EAC 0x9270
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
-#define GL_MAX_ELEMENT_INDEX 0x8D6B
-#define GL_COMPUTE_SHADER 0x91B9
-#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB
-#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
-#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD
-#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
-#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
-#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
-#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265
-#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
-#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
-#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
-#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
-#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
-#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
-#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
-#define GL_COMPUTE_SHADER_BIT 0x00000020
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
-#define GL_DEBUG_SOURCE_API 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION 0x824A
-#define GL_DEBUG_SOURCE_OTHER 0x824B
-#define GL_DEBUG_TYPE_ERROR 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
-#define GL_DEBUG_TYPE_OTHER 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES 0x9145
-#define GL_DEBUG_SEVERITY_HIGH 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
-#define GL_DEBUG_SEVERITY_LOW 0x9148
-#define GL_DEBUG_TYPE_MARKER 0x8268
-#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
-#define GL_DEBUG_TYPE_POP_GROUP 0x826A
-#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
-#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
-#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
-#define GL_BUFFER 0x82E0
-#define GL_SHADER 0x82E1
-#define GL_PROGRAM 0x82E2
-#define GL_QUERY 0x82E3
-#define GL_PROGRAM_PIPELINE 0x82E4
-#define GL_SAMPLER 0x82E6
-#define GL_MAX_LABEL_LENGTH 0x82E8
-#define GL_DEBUG_OUTPUT 0x92E0
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-#define GL_MAX_UNIFORM_LOCATIONS 0x826E
-#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
-#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
-#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312
-#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
-#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
-#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315
-#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316
-#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317
-#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
-#define GL_INTERNALFORMAT_SUPPORTED 0x826F
-#define GL_INTERNALFORMAT_PREFERRED 0x8270
-#define GL_INTERNALFORMAT_RED_SIZE 0x8271
-#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272
-#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273
-#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274
-#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275
-#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276
-#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277
-#define GL_INTERNALFORMAT_RED_TYPE 0x8278
-#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279
-#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A
-#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B
-#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C
-#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D
-#define GL_MAX_WIDTH 0x827E
-#define GL_MAX_HEIGHT 0x827F
-#define GL_MAX_DEPTH 0x8280
-#define GL_MAX_LAYERS 0x8281
-#define GL_MAX_COMBINED_DIMENSIONS 0x8282
-#define GL_COLOR_COMPONENTS 0x8283
-#define GL_DEPTH_COMPONENTS 0x8284
-#define GL_STENCIL_COMPONENTS 0x8285
-#define GL_COLOR_RENDERABLE 0x8286
-#define GL_DEPTH_RENDERABLE 0x8287
-#define GL_STENCIL_RENDERABLE 0x8288
-#define GL_FRAMEBUFFER_RENDERABLE 0x8289
-#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A
-#define GL_FRAMEBUFFER_BLEND 0x828B
-#define GL_READ_PIXELS 0x828C
-#define GL_READ_PIXELS_FORMAT 0x828D
-#define GL_READ_PIXELS_TYPE 0x828E
-#define GL_TEXTURE_IMAGE_FORMAT 0x828F
-#define GL_TEXTURE_IMAGE_TYPE 0x8290
-#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291
-#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292
-#define GL_MIPMAP 0x8293
-#define GL_MANUAL_GENERATE_MIPMAP 0x8294
-#define GL_AUTO_GENERATE_MIPMAP 0x8295
-#define GL_COLOR_ENCODING 0x8296
-#define GL_SRGB_READ 0x8297
-#define GL_SRGB_WRITE 0x8298
-#define GL_FILTER 0x829A
-#define GL_VERTEX_TEXTURE 0x829B
-#define GL_TESS_CONTROL_TEXTURE 0x829C
-#define GL_TESS_EVALUATION_TEXTURE 0x829D
-#define GL_GEOMETRY_TEXTURE 0x829E
-#define GL_FRAGMENT_TEXTURE 0x829F
-#define GL_COMPUTE_TEXTURE 0x82A0
-#define GL_TEXTURE_SHADOW 0x82A1
-#define GL_TEXTURE_GATHER 0x82A2
-#define GL_TEXTURE_GATHER_SHADOW 0x82A3
-#define GL_SHADER_IMAGE_LOAD 0x82A4
-#define GL_SHADER_IMAGE_STORE 0x82A5
-#define GL_SHADER_IMAGE_ATOMIC 0x82A6
-#define GL_IMAGE_TEXEL_SIZE 0x82A7
-#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8
-#define GL_IMAGE_PIXEL_FORMAT 0x82A9
-#define GL_IMAGE_PIXEL_TYPE 0x82AA
-#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC
-#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD
-#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE
-#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF
-#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1
-#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2
-#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3
-#define GL_CLEAR_BUFFER 0x82B4
-#define GL_TEXTURE_VIEW 0x82B5
-#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6
-#define GL_FULL_SUPPORT 0x82B7
-#define GL_CAVEAT_SUPPORT 0x82B8
-#define GL_IMAGE_CLASS_4_X_32 0x82B9
-#define GL_IMAGE_CLASS_2_X_32 0x82BA
-#define GL_IMAGE_CLASS_1_X_32 0x82BB
-#define GL_IMAGE_CLASS_4_X_16 0x82BC
-#define GL_IMAGE_CLASS_2_X_16 0x82BD
-#define GL_IMAGE_CLASS_1_X_16 0x82BE
-#define GL_IMAGE_CLASS_4_X_8 0x82BF
-#define GL_IMAGE_CLASS_2_X_8 0x82C0
-#define GL_IMAGE_CLASS_1_X_8 0x82C1
-#define GL_IMAGE_CLASS_11_11_10 0x82C2
-#define GL_IMAGE_CLASS_10_10_10_2 0x82C3
-#define GL_VIEW_CLASS_128_BITS 0x82C4
-#define GL_VIEW_CLASS_96_BITS 0x82C5
-#define GL_VIEW_CLASS_64_BITS 0x82C6
-#define GL_VIEW_CLASS_48_BITS 0x82C7
-#define GL_VIEW_CLASS_32_BITS 0x82C8
-#define GL_VIEW_CLASS_24_BITS 0x82C9
-#define GL_VIEW_CLASS_16_BITS 0x82CA
-#define GL_VIEW_CLASS_8_BITS 0x82CB
-#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC
-#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD
-#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE
-#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF
-#define GL_VIEW_CLASS_RGTC1_RED 0x82D0
-#define GL_VIEW_CLASS_RGTC2_RG 0x82D1
-#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2
-#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3
-#define GL_UNIFORM 0x92E1
-#define GL_UNIFORM_BLOCK 0x92E2
-#define GL_PROGRAM_INPUT 0x92E3
-#define GL_PROGRAM_OUTPUT 0x92E4
-#define GL_BUFFER_VARIABLE 0x92E5
-#define GL_SHADER_STORAGE_BLOCK 0x92E6
-#define GL_VERTEX_SUBROUTINE 0x92E8
-#define GL_TESS_CONTROL_SUBROUTINE 0x92E9
-#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA
-#define GL_GEOMETRY_SUBROUTINE 0x92EB
-#define GL_FRAGMENT_SUBROUTINE 0x92EC
-#define GL_COMPUTE_SUBROUTINE 0x92ED
-#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE
-#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF
-#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0
-#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1
-#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2
-#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3
-#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
-#define GL_ACTIVE_RESOURCES 0x92F5
-#define GL_MAX_NAME_LENGTH 0x92F6
-#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
-#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8
-#define GL_NAME_LENGTH 0x92F9
-#define GL_TYPE 0x92FA
-#define GL_ARRAY_SIZE 0x92FB
-#define GL_OFFSET 0x92FC
-#define GL_BLOCK_INDEX 0x92FD
-#define GL_ARRAY_STRIDE 0x92FE
-#define GL_MATRIX_STRIDE 0x92FF
-#define GL_IS_ROW_MAJOR 0x9300
-#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
-#define GL_BUFFER_BINDING 0x9302
-#define GL_BUFFER_DATA_SIZE 0x9303
-#define GL_NUM_ACTIVE_VARIABLES 0x9304
-#define GL_ACTIVE_VARIABLES 0x9305
-#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
-#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307
-#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
-#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
-#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
-#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
-#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
-#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
-#define GL_LOCATION 0x930E
-#define GL_LOCATION_INDEX 0x930F
-#define GL_IS_PER_PATCH 0x92E7
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
-#define GL_SHADER_STORAGE_BUFFER_START 0x90D4
-#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
-#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
-#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
-#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
-#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
-#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
-#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
-#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
-#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
-#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
-#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
-#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
-#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
-#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
-#define GL_TEXTURE_BUFFER_OFFSET 0x919D
-#define GL_TEXTURE_BUFFER_SIZE 0x919E
-#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F
-#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB
-#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC
-#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD
-#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-#define GL_VERTEX_ATTRIB_BINDING 0x82D4
-#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
-#define GL_VERTEX_BINDING_DIVISOR 0x82D6
-#define GL_VERTEX_BINDING_OFFSET 0x82D7
-#define GL_VERTEX_BINDING_STRIDE 0x82D8
-#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
-#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
-#define GL_VERTEX_BINDING_BUFFER 0x8F4F
-#define GL_DISPLAY_LIST 0x82E7
-typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
-typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
-typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
-typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
-typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
-typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
-typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
-typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
-typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);
-GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
-GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
-GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);
-GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);
-GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer);
-GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
-GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
-GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
-GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
-GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
-GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
-GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
-GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-GLAPI void APIENTRY glPopDebugGroup (void);
-GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
-GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif
-#endif /* GL_VERSION_4_3 */
-
-#ifndef GL_VERSION_4_4
-#define GL_VERSION_4_4 1
-#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
-#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
-#define GL_TEXTURE_BUFFER_BINDING 0x8C2A
-#define GL_MAP_PERSISTENT_BIT 0x0040
-#define GL_MAP_COHERENT_BIT 0x0080
-#define GL_DYNAMIC_STORAGE_BIT 0x0100
-#define GL_CLIENT_STORAGE_BIT 0x0200
-#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000
-#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F
-#define GL_BUFFER_STORAGE_FLAGS 0x8220
-#define GL_CLEAR_TEXTURE 0x9365
-#define GL_LOCATION_COMPONENT 0x934A
-#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B
-#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C
-#define GL_QUERY_BUFFER 0x9192
-#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000
-#define GL_QUERY_BUFFER_BINDING 0x9193
-#define GL_QUERY_RESULT_NO_WAIT 0x9194
-#define GL_MIRROR_CLAMP_TO_EDGE 0x8743
-typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
-typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes);
-typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures);
-typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers);
-typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures);
-typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
-GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers);
-GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes);
-GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures);
-GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers);
-GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures);
-GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
-#endif
-#endif /* GL_VERSION_4_4 */
-
-#ifndef GL_VERSION_4_5
-#define GL_VERSION_4_5 1
-#define GL_CONTEXT_LOST 0x0507
-#define GL_NEGATIVE_ONE_TO_ONE 0x935E
-#define GL_ZERO_TO_ONE 0x935F
-#define GL_CLIP_ORIGIN 0x935C
-#define GL_CLIP_DEPTH_MODE 0x935D
-#define GL_QUERY_WAIT_INVERTED 0x8E17
-#define GL_QUERY_NO_WAIT_INVERTED 0x8E18
-#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19
-#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A
-#define GL_MAX_CULL_DISTANCES 0x82F9
-#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA
-#define GL_TEXTURE_TARGET 0x1006
-#define GL_QUERY_TARGET 0x82EA
-#define GL_TEXTURE_BINDING 0x82EB
-#define GL_GUILTY_CONTEXT_RESET 0x8253
-#define GL_INNOCENT_CONTEXT_RESET 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY 0x8256
-#define GL_LOSE_CONTEXT_ON_RESET 0x8252
-#define GL_NO_RESET_NOTIFICATION 0x8261
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
-#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB
-#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC
-typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
-typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
-typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizei size, const void *data, GLenum usage);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, const void *data);
-typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
-typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
-typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access);
-typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void **params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, void *data);
-typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src);
-typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments);
-typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
-typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target);
-typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures);
-typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture);
-typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels);
-typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index);
-typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
-typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
-typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);
-typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param);
-typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers);
-typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers);
-typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);
-typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void);
-typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels);
-typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
-typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (APIENTRYP PFNGLGETNMAPDVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-typedef void (APIENTRYP PFNGLGETNMAPFVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-typedef void (APIENTRYP PFNGLGETNMAPIVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPFVPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values);
-typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern);
-typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
-typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
-typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
-typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth);
-GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size);
-GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param);
-GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
-GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers);
-GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
-GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizei size, const void *data, GLenum usage);
-GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizei size, const void *data);
-GLAPI void APIENTRY glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
-GLAPI void APIENTRY glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
-GLAPI void *APIENTRY glMapNamedBuffer (GLuint buffer, GLenum access);
-GLAPI void *APIENTRY glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
-GLAPI GLboolean APIENTRY glUnmapNamedBuffer (GLuint buffer);
-GLAPI void APIENTRY glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizei length);
-GLAPI void APIENTRY glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void **params);
-GLAPI void APIENTRY glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizei size, void *data);
-GLAPI void APIENTRY glCreateFramebuffers (GLsizei n, GLuint *framebuffers);
-GLAPI void APIENTRY glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param);
-GLAPI void APIENTRY glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum buf);
-GLAPI void APIENTRY glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum src);
-GLAPI void APIENTRY glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments);
-GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
-GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
-GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
-GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target);
-GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glCreateRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glCreateTextures (GLenum target, GLsizei n, GLuint *textures);
-GLAPI void APIENTRY glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size);
-GLAPI void APIENTRY glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);
-GLAPI void APIENTRY glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-GLAPI void APIENTRY glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glTextureParameterf (GLuint texture, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glTextureParameteri (GLuint texture, GLenum pname, GLint param);
-GLAPI void APIENTRY glTextureParameterIiv (GLuint texture, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glTextureParameteriv (GLuint texture, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glGenerateTextureMipmap (GLuint texture);
-GLAPI void APIENTRY glBindTextureUnit (GLuint unit, GLuint texture);
-GLAPI void APIENTRY glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
-GLAPI void APIENTRY glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels);
-GLAPI void APIENTRY glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glGetTextureParameteriv (GLuint texture, GLenum pname, GLint *params);
-GLAPI void APIENTRY glCreateVertexArrays (GLsizei n, GLuint *arrays);
-GLAPI void APIENTRY glDisableVertexArrayAttrib (GLuint vaobj, GLuint index);
-GLAPI void APIENTRY glEnableVertexArrayAttrib (GLuint vaobj, GLuint index);
-GLAPI void APIENTRY glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer);
-GLAPI void APIENTRY glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-GLAPI void APIENTRY glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
-GLAPI void APIENTRY glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
-GLAPI void APIENTRY glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-GLAPI void APIENTRY glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor);
-GLAPI void APIENTRY glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param);
-GLAPI void APIENTRY glCreateSamplers (GLsizei n, GLuint *samplers);
-GLAPI void APIENTRY glCreateProgramPipelines (GLsizei n, GLuint *pipelines);
-GLAPI void APIENTRY glCreateQueries (GLenum target, GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glMemoryBarrierByRegion (GLbitfield barriers);
-GLAPI void APIENTRY glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
-GLAPI void APIENTRY glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);
-GLAPI GLenum APIENTRY glGetGraphicsResetStatus (void);
-GLAPI void APIENTRY glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, void *pixels);
-GLAPI void APIENTRY glGetnTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
-GLAPI void APIENTRY glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-GLAPI void APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GLAPI void APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GLAPI void APIENTRY glGetnMapdv (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-GLAPI void APIENTRY glGetnMapfv (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-GLAPI void APIENTRY glGetnMapiv (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-GLAPI void APIENTRY glGetnPixelMapfv (GLenum map, GLsizei bufSize, GLfloat *values);
-GLAPI void APIENTRY glGetnPixelMapuiv (GLenum map, GLsizei bufSize, GLuint *values);
-GLAPI void APIENTRY glGetnPixelMapusv (GLenum map, GLsizei bufSize, GLushort *values);
-GLAPI void APIENTRY glGetnPolygonStipple (GLsizei bufSize, GLubyte *pattern);
-GLAPI void APIENTRY glGetnColorTable (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
-GLAPI void APIENTRY glGetnConvolutionFilter (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
-GLAPI void APIENTRY glGetnSeparableFilter (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
-GLAPI void APIENTRY glGetnHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-GLAPI void APIENTRY glGetnMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-GLAPI void APIENTRY glTextureBarrier (void);
-#endif
-#endif /* GL_VERSION_4_5 */
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_ARB_ES2_compatibility 1
-#endif /* GL_ARB_ES2_compatibility */
-
-#ifndef GL_ARB_ES3_1_compatibility
-#define GL_ARB_ES3_1_compatibility 1
-#endif /* GL_ARB_ES3_1_compatibility */
-
-#ifndef GL_ARB_ES3_compatibility
-#define GL_ARB_ES3_compatibility 1
-#endif /* GL_ARB_ES3_compatibility */
-
-#ifndef GL_ARB_arrays_of_arrays
-#define GL_ARB_arrays_of_arrays 1
-#endif /* GL_ARB_arrays_of_arrays */
-
-#ifndef GL_ARB_base_instance
-#define GL_ARB_base_instance 1
-#endif /* GL_ARB_base_instance */
-
-#ifndef GL_ARB_bindless_texture
-#define GL_ARB_bindless_texture 1
-typedef uint64_t GLuint64EXT;
-#define GL_UNSIGNED_INT64_ARB 0x140F
-typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture);
-typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler);
-typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle);
-typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle);
-typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access);
-typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle);
-typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value);
-typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle);
-typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture);
-GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler);
-GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle);
-GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle);
-GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access);
-GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle);
-GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value);
-GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value);
-GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value);
-GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
-GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle);
-GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle);
-GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x);
-GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params);
-#endif
-#endif /* GL_ARB_bindless_texture */
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_ARB_blend_func_extended 1
-#endif /* GL_ARB_blend_func_extended */
-
-#ifndef GL_ARB_buffer_storage
-#define GL_ARB_buffer_storage 1
-#endif /* GL_ARB_buffer_storage */
-
-#ifndef GL_ARB_cl_event
-#define GL_ARB_cl_event 1
-struct _cl_context;
-struct _cl_event;
-#define GL_SYNC_CL_EVENT_ARB 0x8240
-#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
-typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags);
-#endif
-#endif /* GL_ARB_cl_event */
-
-#ifndef GL_ARB_clear_buffer_object
-#define GL_ARB_clear_buffer_object 1
-#endif /* GL_ARB_clear_buffer_object */
-
-#ifndef GL_ARB_clear_texture
-#define GL_ARB_clear_texture 1
-#endif /* GL_ARB_clear_texture */
-
-#ifndef GL_ARB_clip_control
-#define GL_ARB_clip_control 1
-#endif /* GL_ARB_clip_control */
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
-#endif
-#endif /* GL_ARB_color_buffer_float */
-
-#ifndef GL_ARB_compatibility
-#define GL_ARB_compatibility 1
-#endif /* GL_ARB_compatibility */
-
-#ifndef GL_ARB_compressed_texture_pixel_storage
-#define GL_ARB_compressed_texture_pixel_storage 1
-#endif /* GL_ARB_compressed_texture_pixel_storage */
-
-#ifndef GL_ARB_compute_shader
-#define GL_ARB_compute_shader 1
-#endif /* GL_ARB_compute_shader */
-
-#ifndef GL_ARB_compute_variable_group_size
-#define GL_ARB_compute_variable_group_size 1
-#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344
-#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB
-#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345
-#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF
-typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z);
-#endif
-#endif /* GL_ARB_compute_variable_group_size */
-
-#ifndef GL_ARB_conditional_render_inverted
-#define GL_ARB_conditional_render_inverted 1
-#endif /* GL_ARB_conditional_render_inverted */
-
-#ifndef GL_ARB_conservative_depth
-#define GL_ARB_conservative_depth 1
-#endif /* GL_ARB_conservative_depth */
-
-#ifndef GL_ARB_copy_buffer
-#define GL_ARB_copy_buffer 1
-#endif /* GL_ARB_copy_buffer */
-
-#ifndef GL_ARB_copy_image
-#define GL_ARB_copy_image 1
-#endif /* GL_ARB_copy_image */
-
-#ifndef GL_ARB_cull_distance
-#define GL_ARB_cull_distance 1
-#endif /* GL_ARB_cull_distance */
-
-#ifndef GL_ARB_debug_output
-#define GL_ARB_debug_output 1
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
-#define GL_DEBUG_SOURCE_API_ARB 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
-#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
-#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
-#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
-#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#endif
-#endif /* GL_ARB_debug_output */
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-#endif /* GL_ARB_depth_buffer_float */
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-#endif /* GL_ARB_depth_clamp */
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-#endif /* GL_ARB_depth_texture */
-
-#ifndef GL_ARB_derivative_control
-#define GL_ARB_derivative_control 1
-#endif /* GL_ARB_derivative_control */
-
-#ifndef GL_ARB_direct_state_access
-#define GL_ARB_direct_state_access 1
-#endif /* GL_ARB_direct_state_access */
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
-#endif
-#endif /* GL_ARB_draw_buffers */
-
-#ifndef GL_ARB_draw_buffers_blend
-#define GL_ARB_draw_buffers_blend 1
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-#endif /* GL_ARB_draw_buffers_blend */
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-#endif /* GL_ARB_draw_elements_base_vertex */
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-#endif /* GL_ARB_draw_indirect */
-
-#ifndef GL_ARB_draw_instanced
-#define GL_ARB_draw_instanced 1
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#endif
-#endif /* GL_ARB_draw_instanced */
-
-#ifndef GL_ARB_enhanced_layouts
-#define GL_ARB_enhanced_layouts 1
-#endif /* GL_ARB_enhanced_layouts */
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-#endif /* GL_ARB_explicit_attrib_location */
-
-#ifndef GL_ARB_explicit_uniform_location
-#define GL_ARB_explicit_uniform_location 1
-#endif /* GL_ARB_explicit_uniform_location */
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-#endif /* GL_ARB_fragment_coord_conventions */
-
-#ifndef GL_ARB_fragment_layer_viewport
-#define GL_ARB_fragment_layer_viewport 1
-#endif /* GL_ARB_fragment_layer_viewport */
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string);
-typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string);
-GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
-GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
-GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string);
-GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
-#endif
-#endif /* GL_ARB_fragment_program */
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif /* GL_ARB_fragment_program_shadow */
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-#endif /* GL_ARB_fragment_shader */
-
-#ifndef GL_ARB_framebuffer_no_attachments
-#define GL_ARB_framebuffer_no_attachments 1
-#endif /* GL_ARB_framebuffer_no_attachments */
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-#endif /* GL_ARB_framebuffer_object */
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-#endif /* GL_ARB_framebuffer_sRGB */
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_ARB_geometry_shader4 1
-#define GL_LINES_ADJACENCY_ARB 0x000A
-#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
-#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
-#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
-#define GL_GEOMETRY_SHADER_ARB 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
-GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif
-#endif /* GL_ARB_geometry_shader4 */
-
-#ifndef GL_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-#endif /* GL_ARB_get_program_binary */
-
-#ifndef GL_ARB_get_texture_sub_image
-#define GL_ARB_get_texture_sub_image 1
-#endif /* GL_ARB_get_texture_sub_image */
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-#endif /* GL_ARB_gpu_shader5 */
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-#endif /* GL_ARB_gpu_shader_fp64 */
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-typedef unsigned short GLhalfARB;
-#define GL_HALF_FLOAT_ARB 0x140B
-#endif /* GL_ARB_half_float_pixel */
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-#endif /* GL_ARB_half_float_vertex */
-
-#ifndef GL_ARB_imaging
-#define GL_ARB_imaging 1
-#define GL_BLEND_COLOR 0x8005
-#define GL_BLEND_EQUATION 0x8009
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
-GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table);
-GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
-GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
-GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image);
-GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
-GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
-GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glResetHistogram (GLenum target);
-GLAPI void APIENTRY glResetMinmax (GLenum target);
-#endif
-#endif /* GL_ARB_imaging */
-
-#ifndef GL_ARB_indirect_parameters
-#define GL_ARB_indirect_parameters 1
-#define GL_PARAMETER_BUFFER_ARB 0x80EE
-#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-#endif
-#endif /* GL_ARB_indirect_parameters */
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_ARB_instanced_arrays 1
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
-#endif
-#endif /* GL_ARB_instanced_arrays */
-
-#ifndef GL_ARB_internalformat_query
-#define GL_ARB_internalformat_query 1
-#endif /* GL_ARB_internalformat_query */
-
-#ifndef GL_ARB_internalformat_query2
-#define GL_ARB_internalformat_query2 1
-#define GL_SRGB_DECODE_ARB 0x8299
-#endif /* GL_ARB_internalformat_query2 */
-
-#ifndef GL_ARB_invalidate_subdata
-#define GL_ARB_invalidate_subdata 1
-#endif /* GL_ARB_invalidate_subdata */
-
-#ifndef GL_ARB_map_buffer_alignment
-#define GL_ARB_map_buffer_alignment 1
-#endif /* GL_ARB_map_buffer_alignment */
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-#endif /* GL_ARB_map_buffer_range */
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
-GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
-GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
-GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
-GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer);
-#endif
-#endif /* GL_ARB_matrix_palette */
-
-#ifndef GL_ARB_multi_bind
-#define GL_ARB_multi_bind 1
-#endif /* GL_ARB_multi_bind */
-
-#ifndef GL_ARB_multi_draw_indirect
-#define GL_ARB_multi_draw_indirect 1
-#endif /* GL_ARB_multi_draw_indirect */
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert);
-#endif
-#endif /* GL_ARB_multisample */
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
-GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
-GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
-GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
-GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
-GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
-GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
-#endif
-#endif /* GL_ARB_multitexture */
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
-GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQueryARB (GLenum target);
-GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
-#endif
-#endif /* GL_ARB_occlusion_query */
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-#endif /* GL_ARB_occlusion_query2 */
-
-#ifndef GL_ARB_pipeline_statistics_query
-#define GL_ARB_pipeline_statistics_query 1
-#define GL_VERTICES_SUBMITTED_ARB 0x82EE
-#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF
-#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0
-#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1
-#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2
-#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3
-#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4
-#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5
-#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6
-#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7
-#endif /* GL_ARB_pipeline_statistics_query */
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-#endif /* GL_ARB_pixel_buffer_object */
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
-#endif
-#endif /* GL_ARB_point_parameters */
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-#endif /* GL_ARB_point_sprite */
-
-#ifndef GL_ARB_program_interface_query
-#define GL_ARB_program_interface_query 1
-#endif /* GL_ARB_program_interface_query */
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-#endif /* GL_ARB_provoking_vertex */
-
-#ifndef GL_ARB_query_buffer_object
-#define GL_ARB_query_buffer_object 1
-#endif /* GL_ARB_query_buffer_object */
-
-#ifndef GL_ARB_robust_buffer_access_behavior
-#define GL_ARB_robust_buffer_access_behavior 1
-#endif /* GL_ARB_robust_buffer_access_behavior */
-
-#ifndef GL_ARB_robustness
-#define GL_ARB_robustness 1
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
-typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
-typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img);
-typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img);
-typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
-typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
-typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
-typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
-typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
-typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
-GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img);
-GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
-GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img);
-GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
-GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
-GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
-GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
-GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
-GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
-GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
-GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
-#endif
-#endif /* GL_ARB_robustness */
-
-#ifndef GL_ARB_robustness_isolation
-#define GL_ARB_robustness_isolation 1
-#endif /* GL_ARB_robustness_isolation */
-
-#ifndef GL_ARB_sample_shading
-#define GL_ARB_sample_shading 1
-#define GL_SAMPLE_SHADING_ARB 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value);
-#endif
-#endif /* GL_ARB_sample_shading */
-
-#ifndef GL_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-#endif /* GL_ARB_sampler_objects */
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-#endif /* GL_ARB_seamless_cube_map */
-
-#ifndef GL_ARB_seamless_cubemap_per_texture
-#define GL_ARB_seamless_cubemap_per_texture 1
-#endif /* GL_ARB_seamless_cubemap_per_texture */
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
-#endif /* GL_ARB_separate_shader_objects */
-
-#ifndef GL_ARB_shader_atomic_counters
-#define GL_ARB_shader_atomic_counters 1
-#endif /* GL_ARB_shader_atomic_counters */
-
-#ifndef GL_ARB_shader_bit_encoding
-#define GL_ARB_shader_bit_encoding 1
-#endif /* GL_ARB_shader_bit_encoding */
-
-#ifndef GL_ARB_shader_draw_parameters
-#define GL_ARB_shader_draw_parameters 1
-#endif /* GL_ARB_shader_draw_parameters */
-
-#ifndef GL_ARB_shader_group_vote
-#define GL_ARB_shader_group_vote 1
-#endif /* GL_ARB_shader_group_vote */
-
-#ifndef GL_ARB_shader_image_load_store
-#define GL_ARB_shader_image_load_store 1
-#endif /* GL_ARB_shader_image_load_store */
-
-#ifndef GL_ARB_shader_image_size
-#define GL_ARB_shader_image_size 1
-#endif /* GL_ARB_shader_image_size */
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef __APPLE__
-typedef void *GLhandleARB;
-#else
-typedef unsigned int GLhandleARB;
-#endif
-typedef char GLcharARB;
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length);
-typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);
-GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
-GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
-GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
-GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length);
-GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
-GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
-GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
-GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
-GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
-GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
-GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
-GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
-GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif
-#endif /* GL_ARB_shader_objects */
-
-#ifndef GL_ARB_shader_precision
-#define GL_ARB_shader_precision 1
-#endif /* GL_ARB_shader_precision */
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-#endif /* GL_ARB_shader_stencil_export */
-
-#ifndef GL_ARB_shader_storage_buffer_object
-#define GL_ARB_shader_storage_buffer_object 1
-#endif /* GL_ARB_shader_storage_buffer_object */
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-#endif /* GL_ARB_shader_subroutine */
-
-#ifndef GL_ARB_shader_texture_image_samples
-#define GL_ARB_shader_texture_image_samples 1
-#endif /* GL_ARB_shader_texture_image_samples */
-
-#ifndef GL_ARB_shader_texture_lod
-#define GL_ARB_shader_texture_lod 1
-#endif /* GL_ARB_shader_texture_lod */
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-#endif /* GL_ARB_shading_language_100 */
-
-#ifndef GL_ARB_shading_language_420pack
-#define GL_ARB_shading_language_420pack 1
-#endif /* GL_ARB_shading_language_420pack */
-
-#ifndef GL_ARB_shading_language_include
-#define GL_ARB_shading_language_include 1
-#define GL_SHADER_INCLUDE_ARB 0x8DAE
-#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
-#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
-typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length);
-GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif
-#endif /* GL_ARB_shading_language_include */
-
-#ifndef GL_ARB_shading_language_packing
-#define GL_ARB_shading_language_packing 1
-#endif /* GL_ARB_shading_language_packing */
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-#endif /* GL_ARB_shadow */
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-#endif /* GL_ARB_shadow_ambient */
-
-#ifndef GL_ARB_sparse_buffer
-#define GL_ARB_sparse_buffer 1
-#define GL_SPARSE_STORAGE_BIT_ARB 0x0400
-#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8
-typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit);
-GLAPI void APIENTRY glNamedBufferPageCommitmentEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
-GLAPI void APIENTRY glNamedBufferPageCommitmentARB (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
-#endif
-#endif /* GL_ARB_sparse_buffer */
-
-#ifndef GL_ARB_sparse_texture
-#define GL_ARB_sparse_texture 1
-#define GL_TEXTURE_SPARSE_ARB 0x91A6
-#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7
-#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA
-#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8
-#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195
-#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196
-#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197
-#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198
-#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199
-#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A
-#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9
-typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident);
-#endif
-#endif /* GL_ARB_sparse_texture */
-
-#ifndef GL_ARB_stencil_texturing
-#define GL_ARB_stencil_texturing 1
-#endif /* GL_ARB_stencil_texturing */
-
-#ifndef GL_ARB_sync
-#define GL_ARB_sync 1
-#endif /* GL_ARB_sync */
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-#endif /* GL_ARB_tessellation_shader */
-
-#ifndef GL_ARB_texture_barrier
-#define GL_ARB_texture_barrier 1
-#endif /* GL_ARB_texture_barrier */
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-#endif /* GL_ARB_texture_border_clamp */
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_ARB_texture_buffer_object 1
-#define GL_TEXTURE_BUFFER_ARB 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
-typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-#endif /* GL_ARB_texture_buffer_object */
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-#endif /* GL_ARB_texture_buffer_object_rgb32 */
-
-#ifndef GL_ARB_texture_buffer_range
-#define GL_ARB_texture_buffer_range 1
-#endif /* GL_ARB_texture_buffer_range */
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
-GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img);
-#endif
-#endif /* GL_ARB_texture_compression */
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_ARB_texture_compression_bptc 1
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-#endif /* GL_ARB_texture_compression_bptc */
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-#endif /* GL_ARB_texture_compression_rgtc */
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-#endif /* GL_ARB_texture_cube_map */
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_ARB_texture_cube_map_array 1
-#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
-#endif /* GL_ARB_texture_cube_map_array */
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif /* GL_ARB_texture_env_add */
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#endif /* GL_ARB_texture_env_combine */
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif /* GL_ARB_texture_env_crossbar */
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-#endif /* GL_ARB_texture_env_dot3 */
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#endif /* GL_ARB_texture_float */
-
-#ifndef GL_ARB_texture_gather
-#define GL_ARB_texture_gather 1
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
-#endif /* GL_ARB_texture_gather */
-
-#ifndef GL_ARB_texture_mirror_clamp_to_edge
-#define GL_ARB_texture_mirror_clamp_to_edge 1
-#endif /* GL_ARB_texture_mirror_clamp_to_edge */
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-#endif /* GL_ARB_texture_mirrored_repeat */
-
-#ifndef GL_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-#endif /* GL_ARB_texture_multisample */
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-#endif /* GL_ARB_texture_non_power_of_two */
-
-#ifndef GL_ARB_texture_query_levels
-#define GL_ARB_texture_query_levels 1
-#endif /* GL_ARB_texture_query_levels */
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-#endif /* GL_ARB_texture_query_lod */
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#endif /* GL_ARB_texture_rectangle */
-
-#ifndef GL_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-#endif /* GL_ARB_texture_rg */
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-#endif /* GL_ARB_texture_rgb10_a2ui */
-
-#ifndef GL_ARB_texture_stencil8
-#define GL_ARB_texture_stencil8 1
-#endif /* GL_ARB_texture_stencil8 */
-
-#ifndef GL_ARB_texture_storage
-#define GL_ARB_texture_storage 1
-#endif /* GL_ARB_texture_storage */
-
-#ifndef GL_ARB_texture_storage_multisample
-#define GL_ARB_texture_storage_multisample 1
-#endif /* GL_ARB_texture_storage_multisample */
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#endif /* GL_ARB_texture_swizzle */
-
-#ifndef GL_ARB_texture_view
-#define GL_ARB_texture_view 1
-#endif /* GL_ARB_texture_view */
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-#endif /* GL_ARB_timer_query */
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_ARB_transform_feedback2 1
-#endif /* GL_ARB_transform_feedback2 */
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-#endif /* GL_ARB_transform_feedback3 */
-
-#ifndef GL_ARB_transform_feedback_instanced
-#define GL_ARB_transform_feedback_instanced 1
-#endif /* GL_ARB_transform_feedback_instanced */
-
-#ifndef GL_ARB_transform_feedback_overflow_query
-#define GL_ARB_transform_feedback_overflow_query 1
-#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC
-#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED
-#endif /* GL_ARB_transform_feedback_overflow_query */
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
-GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
-GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
-GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
-#endif
-#endif /* GL_ARB_transpose_matrix */
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_ARB_uniform_buffer_object 1
-#endif /* GL_ARB_uniform_buffer_object */
-
-#ifndef GL_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-#endif /* GL_ARB_vertex_array_bgra */
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-#endif /* GL_ARB_vertex_array_object */
-
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-#endif /* GL_ARB_vertex_attrib_64bit */
-
-#ifndef GL_ARB_vertex_attrib_binding
-#define GL_ARB_vertex_attrib_binding 1
-#endif /* GL_ARB_vertex_attrib_binding */
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
-GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
-GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
-GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
-GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
-GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
-GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
-GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
-GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glVertexBlendARB (GLint count);
-#endif
-#endif /* GL_ARB_vertex_blend */
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-typedef ptrdiff_t GLsizeiptrARB;
-typedef ptrdiff_t GLintptrARB;
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data);
-typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
-GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data);
-GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data);
-GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
-GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params);
-#endif
-#endif /* GL_ARB_vertex_buffer_object */
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
-GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
-GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer);
-#endif
-#endif /* GL_ARB_vertex_program */
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
-#endif
-#endif /* GL_ARB_vertex_shader */
-
-#ifndef GL_ARB_vertex_type_10f_11f_11f_rev
-#define GL_ARB_vertex_type_10f_11f_11f_rev 1
-#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-#define GL_ARB_vertex_type_2_10_10_10_rev 1
-#endif /* GL_ARB_vertex_type_2_10_10_10_rev */
-
-#ifndef GL_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-#endif /* GL_ARB_viewport_array */
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
-GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
-GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
-#endif
-#endif /* GL_ARB_window_pos */
-
-#ifndef GL_KHR_blend_equation_advanced
-#define GL_KHR_blend_equation_advanced 1
-#define GL_MULTIPLY_KHR 0x9294
-#define GL_SCREEN_KHR 0x9295
-#define GL_OVERLAY_KHR 0x9296
-#define GL_DARKEN_KHR 0x9297
-#define GL_LIGHTEN_KHR 0x9298
-#define GL_COLORDODGE_KHR 0x9299
-#define GL_COLORBURN_KHR 0x929A
-#define GL_HARDLIGHT_KHR 0x929B
-#define GL_SOFTLIGHT_KHR 0x929C
-#define GL_DIFFERENCE_KHR 0x929E
-#define GL_EXCLUSION_KHR 0x92A0
-#define GL_HSL_HUE_KHR 0x92AD
-#define GL_HSL_SATURATION_KHR 0x92AE
-#define GL_HSL_COLOR_KHR 0x92AF
-#define GL_HSL_LUMINOSITY_KHR 0x92B0
-typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendBarrierKHR (void);
-#endif
-#endif /* GL_KHR_blend_equation_advanced */
-
-#ifndef GL_KHR_blend_equation_advanced_coherent
-#define GL_KHR_blend_equation_advanced_coherent 1
-#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285
-#endif /* GL_KHR_blend_equation_advanced_coherent */
-
-#ifndef GL_KHR_context_flush_control
-#define GL_KHR_context_flush_control 1
-#endif /* GL_KHR_context_flush_control */
-
-#ifndef GL_KHR_debug
-#define GL_KHR_debug 1
-#endif /* GL_KHR_debug */
-
-#ifndef GL_KHR_robust_buffer_access_behavior
-#define GL_KHR_robust_buffer_access_behavior 1
-#endif /* GL_KHR_robust_buffer_access_behavior */
-
-#ifndef GL_KHR_robustness
-#define GL_KHR_robustness 1
-#define GL_CONTEXT_ROBUST_ACCESS 0x90F3
-#endif /* GL_KHR_robustness */
-
-#ifndef GL_KHR_texture_compression_astc_hdr
-#define GL_KHR_texture_compression_astc_hdr 1
-#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
-#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
-#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
-#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
-#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
-#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
-#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
-#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
-#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
-#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
-#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
-#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
-#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
-#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
-#endif /* GL_KHR_texture_compression_astc_hdr */
-
-#ifndef GL_KHR_texture_compression_astc_ldr
-#define GL_KHR_texture_compression_astc_ldr 1
-#endif /* GL_KHR_texture_compression_astc_ldr */
-
-#ifndef GL_OES_byte_coordinates
-#define GL_OES_byte_coordinates 1
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s);
-typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t);
-typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r);
-typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q);
-typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords);
-typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x, GLbyte y);
-typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords);
-typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y, GLbyte z);
-typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords);
-typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z, GLbyte w);
-typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s);
-GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords);
-GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t);
-GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords);
-GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r);
-GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords);
-GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q);
-GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords);
-GLAPI void APIENTRY glTexCoord1bOES (GLbyte s);
-GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords);
-GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t);
-GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords);
-GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r);
-GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords);
-GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q);
-GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords);
-GLAPI void APIENTRY glVertex2bOES (GLbyte x, GLbyte y);
-GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords);
-GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y, GLbyte z);
-GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords);
-GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z, GLbyte w);
-GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords);
-#endif
-#endif /* GL_OES_byte_coordinates */
-
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-#endif /* GL_OES_compressed_paletted_texture */
-
-#ifndef GL_OES_fixed_point
-#define GL_OES_fixed_point 1
-typedef GLint GLfixed;
-#define GL_FIXED_OES 0x140C
-typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref);
-typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth);
-typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
-typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f);
-typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param);
-typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation);
-typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param);
-typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
-typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
-typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
-typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param);
-typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
-typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
-typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
-typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEOESPROC) (GLfixed value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
-typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
-typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
-typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value);
-typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap);
-typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue);
-typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components);
-typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
-typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u);
-typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v);
-typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v);
-typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values);
-typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params);
-typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component);
-typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m);
-typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points);
-typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points);
-typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2);
-typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords);
-typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token);
-typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values);
-typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities);
-typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y);
-typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z);
-typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w);
-typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2);
-typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2);
-typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s);
-typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t);
-typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r);
-typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
-typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
-typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x);
-typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y);
-typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords);
-typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z);
-typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref);
-GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GLAPI void APIENTRY glClearDepthxOES (GLfixed depth);
-GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
-GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f);
-GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param);
-GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param);
-GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation);
-GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
-GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param);
-GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glLineWidthxOES (GLfixed width);
-GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m);
-GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param);
-GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m);
-GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
-GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glPointSizexOES (GLfixed size);
-GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
-GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glSampleCoverageOES (GLfixed value, GLboolean invert);
-GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value);
-GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap);
-GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue);
-GLAPI void APIENTRY glColor3xvOES (const GLfixed *components);
-GLAPI void APIENTRY glColor4xvOES (const GLfixed *components);
-GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u);
-GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v);
-GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer);
-GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v);
-GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values);
-GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params);
-GLAPI void APIENTRY glIndexxOES (GLfixed component);
-GLAPI void APIENTRY glIndexxvOES (const GLfixed *component);
-GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m);
-GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points);
-GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points);
-GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2);
-GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2);
-GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m);
-GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s);
-GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords);
-GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t);
-GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords);
-GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r);
-GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords);
-GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords);
-GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glPassThroughxOES (GLfixed token);
-GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values);
-GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param);
-GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param);
-GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor);
-GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities);
-GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y);
-GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w);
-GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2);
-GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2);
-GLAPI void APIENTRY glTexCoord1xOES (GLfixed s);
-GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t);
-GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r);
-GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
-GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
-GLAPI void APIENTRY glVertex2xOES (GLfixed x);
-GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y);
-GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords);
-GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z);
-GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords);
-#endif
-#endif /* GL_OES_fixed_point */
-
-#ifndef GL_OES_query_matrix
-#define GL_OES_query_matrix 1
-typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent);
-#endif
-#endif /* GL_OES_query_matrix */
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#endif /* GL_OES_read_format */
-
-#ifndef GL_OES_single_precision
-#define GL_OES_single_precision 1
-typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
-typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
-typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);
-typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation);
-typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClearDepthfOES (GLclampf depth);
-GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
-GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f);
-GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation);
-GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-#endif
-#endif /* GL_OES_single_precision */
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-#endif /* GL_3DFX_multisample */
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
-#endif
-#endif /* GL_3DFX_tbuffer */
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-#endif /* GL_3DFX_texture_compression_FXT1 */
-
-#ifndef GL_AMD_blend_minmax_factor
-#define GL_AMD_blend_minmax_factor 1
-#define GL_FACTOR_MIN_AMD 0x901C
-#define GL_FACTOR_MAX_AMD 0x901D
-#endif /* GL_AMD_blend_minmax_factor */
-
-#ifndef GL_AMD_conservative_depth
-#define GL_AMD_conservative_depth 1
-#endif /* GL_AMD_conservative_depth */
-
-#ifndef GL_AMD_debug_output
-#define GL_AMD_debug_output 1
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
-#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
-#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
-#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
-#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
-#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
-#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
-#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
-#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
-#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
-#endif
-#endif /* GL_AMD_debug_output */
-
-#ifndef GL_AMD_depth_clamp_separate
-#define GL_AMD_depth_clamp_separate 1
-#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
-#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
-#endif /* GL_AMD_depth_clamp_separate */
-
-#ifndef GL_AMD_draw_buffers_blend
-#define GL_AMD_draw_buffers_blend 1
-typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-#endif
-#endif /* GL_AMD_draw_buffers_blend */
-
-#ifndef GL_AMD_gcn_shader
-#define GL_AMD_gcn_shader 1
-#endif /* GL_AMD_gcn_shader */
-
-#ifndef GL_AMD_gpu_shader_int64
-#define GL_AMD_gpu_shader_int64 1
-typedef int64_t GLint64EXT;
-#define GL_INT64_NV 0x140E
-#define GL_UNSIGNED_INT64_NV 0x140F
-#define GL_INT8_NV 0x8FE0
-#define GL_INT8_VEC2_NV 0x8FE1
-#define GL_INT8_VEC3_NV 0x8FE2
-#define GL_INT8_VEC4_NV 0x8FE3
-#define GL_INT16_NV 0x8FE4
-#define GL_INT16_VEC2_NV 0x8FE5
-#define GL_INT16_VEC3_NV 0x8FE6
-#define GL_INT16_VEC4_NV 0x8FE7
-#define GL_INT64_VEC2_NV 0x8FE9
-#define GL_INT64_VEC3_NV 0x8FEA
-#define GL_INT64_VEC4_NV 0x8FEB
-#define GL_UNSIGNED_INT8_NV 0x8FEC
-#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
-#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
-#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
-#define GL_UNSIGNED_INT16_NV 0x8FF0
-#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
-#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
-#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
-#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
-#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
-#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
-#define GL_FLOAT16_NV 0x8FF8
-#define GL_FLOAT16_VEC2_NV 0x8FF9
-#define GL_FLOAT16_VEC3_NV 0x8FFA
-#define GL_FLOAT16_VEC4_NV 0x8FFB
-typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
-typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
-GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
-GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
-GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
-GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
-GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
-GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif
-#endif /* GL_AMD_gpu_shader_int64 */
-
-#ifndef GL_AMD_interleaved_elements
-#define GL_AMD_interleaved_elements 1
-#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4
-#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param);
-#endif
-#endif /* GL_AMD_interleaved_elements */
-
-#ifndef GL_AMD_multi_draw_indirect
-#define GL_AMD_multi_draw_indirect 1
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride);
-GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride);
-#endif
-#endif /* GL_AMD_multi_draw_indirect */
-
-#ifndef GL_AMD_name_gen_delete
-#define GL_AMD_name_gen_delete 1
-#define GL_DATA_BUFFER_AMD 0x9151
-#define GL_PERFORMANCE_MONITOR_AMD 0x9152
-#define GL_QUERY_OBJECT_AMD 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
-#define GL_SAMPLER_OBJECT_AMD 0x9155
-typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
-typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
-typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
-GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
-GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
-#endif
-#endif /* GL_AMD_name_gen_delete */
-
-#ifndef GL_AMD_occlusion_query_event
-#define GL_AMD_occlusion_query_event 1
-#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F
-#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001
-#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002
-#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004
-#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008
-#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF
-typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param);
-#endif
-#endif /* GL_AMD_occlusion_query_event */
-
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-#define GL_COUNTER_TYPE_AMD 0x8BC0
-#define GL_COUNTER_RANGE_AMD 0x8BC1
-#define GL_UNSIGNED_INT64_AMD 0x8BC2
-#define GL_PERCENTAGE_AMD 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
-#define GL_PERFMON_RESULT_AMD 0x8BC6
-typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
-typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data);
-GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
-GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
-GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif
-#endif /* GL_AMD_performance_monitor */
-
-#ifndef GL_AMD_pinned_memory
-#define GL_AMD_pinned_memory 1
-#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160
-#endif /* GL_AMD_pinned_memory */
-
-#ifndef GL_AMD_query_buffer_object
-#define GL_AMD_query_buffer_object 1
-#define GL_QUERY_BUFFER_AMD 0x9192
-#define GL_QUERY_BUFFER_BINDING_AMD 0x9193
-#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194
-#endif /* GL_AMD_query_buffer_object */
-
-#ifndef GL_AMD_sample_positions
-#define GL_AMD_sample_positions 1
-#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
-typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
-#endif
-#endif /* GL_AMD_sample_positions */
-
-#ifndef GL_AMD_seamless_cubemap_per_texture
-#define GL_AMD_seamless_cubemap_per_texture 1
-#endif /* GL_AMD_seamless_cubemap_per_texture */
-
-#ifndef GL_AMD_shader_atomic_counter_ops
-#define GL_AMD_shader_atomic_counter_ops 1
-#endif /* GL_AMD_shader_atomic_counter_ops */
-
-#ifndef GL_AMD_shader_stencil_export
-#define GL_AMD_shader_stencil_export 1
-#endif /* GL_AMD_shader_stencil_export */
-
-#ifndef GL_AMD_shader_trinary_minmax
-#define GL_AMD_shader_trinary_minmax 1
-#endif /* GL_AMD_shader_trinary_minmax */
-
-#ifndef GL_AMD_sparse_texture
-#define GL_AMD_sparse_texture 1
-#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195
-#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196
-#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197
-#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198
-#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199
-#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A
-#define GL_MIN_SPARSE_LEVEL_AMD 0x919B
-#define GL_MIN_LOD_WARNING_AMD 0x919C
-#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001
-typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
-typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
-GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
-#endif
-#endif /* GL_AMD_sparse_texture */
-
-#ifndef GL_AMD_stencil_operation_extended
-#define GL_AMD_stencil_operation_extended 1
-#define GL_SET_AMD 0x874A
-#define GL_REPLACE_VALUE_AMD 0x874B
-#define GL_STENCIL_OP_VALUE_AMD 0x874C
-#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D
-typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value);
-#endif
-#endif /* GL_AMD_stencil_operation_extended */
-
-#ifndef GL_AMD_texture_texture4
-#define GL_AMD_texture_texture4 1
-#endif /* GL_AMD_texture_texture4 */
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#define GL_AMD_transform_feedback3_lines_triangles 1
-#endif /* GL_AMD_transform_feedback3_lines_triangles */
-
-#ifndef GL_AMD_transform_feedback4
-#define GL_AMD_transform_feedback4 1
-#define GL_STREAM_RASTERIZATION_AMD 0x91A0
-#endif /* GL_AMD_transform_feedback4 */
-
-#ifndef GL_AMD_vertex_shader_layer
-#define GL_AMD_vertex_shader_layer 1
-#endif /* GL_AMD_vertex_shader_layer */
-
-#ifndef GL_AMD_vertex_shader_tessellator
-#define GL_AMD_vertex_shader_tessellator 1
-#define GL_SAMPLER_BUFFER_AMD 0x9001
-#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
-#define GL_TESSELLATION_MODE_AMD 0x9004
-#define GL_TESSELLATION_FACTOR_AMD 0x9005
-#define GL_DISCRETE_AMD 0x9006
-#define GL_CONTINUOUS_AMD 0x9007
-typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
-GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
-#endif
-#endif /* GL_AMD_vertex_shader_tessellator */
-
-#ifndef GL_AMD_vertex_shader_viewport_index
-#define GL_AMD_vertex_shader_viewport_index 1
-#endif /* GL_AMD_vertex_shader_viewport_index */
-
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_APPLE_aux_depth_stencil 1
-#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
-#endif /* GL_APPLE_aux_depth_stencil */
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-#endif /* GL_APPLE_client_storage */
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
-typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer);
-GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif
-#endif /* GL_APPLE_element_array */
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
-typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
-GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
-GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
-GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
-GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
-#endif
-#endif /* GL_APPLE_fence */
-
-#ifndef GL_APPLE_float_pixels
-#define GL_APPLE_float_pixels 1
-#define GL_HALF_APPLE 0x140B
-#define GL_RGBA_FLOAT32_APPLE 0x8814
-#define GL_RGB_FLOAT32_APPLE 0x8815
-#define GL_ALPHA_FLOAT32_APPLE 0x8816
-#define GL_INTENSITY_FLOAT32_APPLE 0x8817
-#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
-#define GL_RGBA_FLOAT16_APPLE 0x881A
-#define GL_RGB_FLOAT16_APPLE 0x881B
-#define GL_ALPHA_FLOAT16_APPLE 0x881C
-#define GL_INTENSITY_FLOAT16_APPLE 0x881D
-#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
-#define GL_COLOR_FLOAT_APPLE 0x8A0F
-#endif /* GL_APPLE_float_pixels */
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_APPLE_flush_buffer_range 1
-#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
-#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
-typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
-#endif
-#endif /* GL_APPLE_flush_buffer_range */
-
-#ifndef GL_APPLE_object_purgeable
-#define GL_APPLE_object_purgeable 1
-#define GL_BUFFER_OBJECT_APPLE 0x85B3
-#define GL_RELEASED_APPLE 0x8A19
-#define GL_VOLATILE_APPLE 0x8A1A
-#define GL_RETAINED_APPLE 0x8A1B
-#define GL_UNDEFINED_APPLE 0x8A1C
-#define GL_PURGEABLE_APPLE 0x8A1D
-typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
-GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
-GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
-#endif
-#endif /* GL_APPLE_object_purgeable */
-
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-#define GL_RGB_422_APPLE 0x8A1F
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#define GL_RGB_RAW_422_APPLE 0x8A51
-#endif /* GL_APPLE_rgb_422 */
-
-#ifndef GL_APPLE_row_bytes
-#define GL_APPLE_row_bytes 1
-#define GL_PACK_ROW_BYTES_APPLE 0x8A15
-#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
-#endif /* GL_APPLE_row_bytes */
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif /* GL_APPLE_specular_vector */
-
-#ifndef GL_APPLE_texture_range
-#define GL_APPLE_texture_range 1
-#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
-#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
-#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
-#define GL_STORAGE_PRIVATE_APPLE 0x85BD
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer);
-GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params);
-#endif
-#endif /* GL_APPLE_texture_range */
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-#endif /* GL_APPLE_transform_hint */
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
-#endif
-#endif /* GL_APPLE_vertex_array_object */
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CLIENT_APPLE 0x85B4
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer);
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer);
-GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer);
-GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
-#endif
-#endif /* GL_APPLE_vertex_array_range */
-
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_APPLE_vertex_program_evaluators 1
-#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
-#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
-#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
-#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
-#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
-#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
-#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
-#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
-#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
-#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
-GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
-GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
-GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-#endif
-#endif /* GL_APPLE_vertex_program_evaluators */
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-#define GL_YCBCR_422_APPLE 0x85B9
-#endif /* GL_APPLE_ycbcr_422 */
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
-typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
-#endif
-#endif /* GL_ATI_draw_buffers */
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer);
-GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
-GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif
-#endif /* GL_ATI_element_array */
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-#define GL_BUMP_ROT_MATRIX_ATI 0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#define GL_DU8DV8_ATI 0x877A
-#define GL_BUMP_ENVMAP_ATI 0x877B
-#define GL_BUMP_TARGET_ATI 0x877C
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
-GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
-#endif
-#endif /* GL_ATI_envmap_bumpmap */
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-#define GL_FRAGMENT_SHADER_ATI 0x8920
-#define GL_REG_0_ATI 0x8921
-#define GL_REG_1_ATI 0x8922
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_REG_6_ATI 0x8927
-#define GL_REG_7_ATI 0x8928
-#define GL_REG_8_ATI 0x8929
-#define GL_REG_9_ATI 0x892A
-#define GL_REG_10_ATI 0x892B
-#define GL_REG_11_ATI 0x892C
-#define GL_REG_12_ATI 0x892D
-#define GL_REG_13_ATI 0x892E
-#define GL_REG_14_ATI 0x892F
-#define GL_REG_15_ATI 0x8930
-#define GL_REG_16_ATI 0x8931
-#define GL_REG_17_ATI 0x8932
-#define GL_REG_18_ATI 0x8933
-#define GL_REG_19_ATI 0x8934
-#define GL_REG_20_ATI 0x8935
-#define GL_REG_21_ATI 0x8936
-#define GL_REG_22_ATI 0x8937
-#define GL_REG_23_ATI 0x8938
-#define GL_REG_24_ATI 0x8939
-#define GL_REG_25_ATI 0x893A
-#define GL_REG_26_ATI 0x893B
-#define GL_REG_27_ATI 0x893C
-#define GL_REG_28_ATI 0x893D
-#define GL_REG_29_ATI 0x893E
-#define GL_REG_30_ATI 0x893F
-#define GL_REG_31_ATI 0x8940
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_CON_8_ATI 0x8949
-#define GL_CON_9_ATI 0x894A
-#define GL_CON_10_ATI 0x894B
-#define GL_CON_11_ATI 0x894C
-#define GL_CON_12_ATI 0x894D
-#define GL_CON_13_ATI 0x894E
-#define GL_CON_14_ATI 0x894F
-#define GL_CON_15_ATI 0x8950
-#define GL_CON_16_ATI 0x8951
-#define GL_CON_17_ATI 0x8952
-#define GL_CON_18_ATI 0x8953
-#define GL_CON_19_ATI 0x8954
-#define GL_CON_20_ATI 0x8955
-#define GL_CON_21_ATI 0x8956
-#define GL_CON_22_ATI 0x8957
-#define GL_CON_23_ATI 0x8958
-#define GL_CON_24_ATI 0x8959
-#define GL_CON_25_ATI 0x895A
-#define GL_CON_26_ATI 0x895B
-#define GL_CON_27_ATI 0x895C
-#define GL_CON_28_ATI 0x895D
-#define GL_CON_29_ATI 0x895E
-#define GL_CON_30_ATI 0x895F
-#define GL_CON_31_ATI 0x8960
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#define GL_COMP_BIT_ATI 0x00000002
-#define GL_NEGATE_BIT_ATI 0x00000004
-#define GL_BIAS_BIT_ATI 0x00000008
-typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
-GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
-GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
-GLAPI void APIENTRY glBeginFragmentShaderATI (void);
-GLAPI void APIENTRY glEndFragmentShaderATI (void);
-GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
-GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
-GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
-#endif
-#endif /* GL_ATI_fragment_shader */
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
-#endif
-#endif /* GL_ATI_map_object_buffer */
-
-#ifndef GL_ATI_meminfo
-#define GL_ATI_meminfo 1
-#define GL_VBO_FREE_MEMORY_ATI 0x87FB
-#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
-#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
-#endif /* GL_ATI_meminfo */
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_ATI_pixel_format_float 1
-#define GL_RGBA_FLOAT_MODE_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-#endif /* GL_ATI_pixel_format_float */
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-#define GL_PN_TRIANGLES_ATI 0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
-GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
-#endif
-#endif /* GL_ATI_pn_triangles */
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif
-#endif /* GL_ATI_separate_stencil */
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-#endif /* GL_ATI_text_fragment_shader */
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-#endif /* GL_ATI_texture_env_combine3 */
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
-#endif /* GL_ATI_texture_float */
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
-#endif /* GL_ATI_texture_mirror_once */
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-#define GL_STATIC_ATI 0x8760
-#define GL_DYNAMIC_ATI 0x8761
-#define GL_PRESERVE_ATI 0x8762
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
-typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage);
-typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage);
-GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve);
-GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
-GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
-#endif
-#endif /* GL_ATI_vertex_array_object */
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
-#endif
-#endif /* GL_ATI_vertex_attrib_array_object */
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
-#define GL_VERTEX_STREAM0_ATI 0x876C
-#define GL_VERTEX_STREAM1_ATI 0x876D
-#define GL_VERTEX_STREAM2_ATI 0x876E
-#define GL_VERTEX_STREAM3_ATI 0x876F
-#define GL_VERTEX_STREAM4_ATI 0x8770
-#define GL_VERTEX_STREAM5_ATI 0x8771
-#define GL_VERTEX_STREAM6_ATI 0x8772
-#define GL_VERTEX_STREAM7_ATI 0x8773
-#define GL_VERTEX_SOURCE_ATI 0x8774
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
-GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
-GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
-GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
-GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
-GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
-GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
-GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
-GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
-GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
-#endif
-#endif /* GL_ATI_vertex_streams */
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-#endif /* GL_EXT_422_pixels */
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-#define GL_ABGR_EXT 0x8000
-#endif /* GL_EXT_abgr */
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-#endif /* GL_EXT_bgra */
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_EXT_bindable_uniform 1
-#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
-#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
-#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
-#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
-#define GL_UNIFORM_BUFFER_EXT 0x8DEE
-#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
-typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
-typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
-GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
-GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
-#endif
-#endif /* GL_EXT_bindable_uniform */
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
-typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-#endif
-#endif /* GL_EXT_blend_color */
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-#define GL_BLEND_EQUATION_RGB_EXT 0x8009
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
-#endif
-#endif /* GL_EXT_blend_equation_separate */
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-#endif /* GL_EXT_blend_func_separate */
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif /* GL_EXT_blend_logic_op */
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_BLEND_EQUATION_EXT 0x8009
-typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
-#endif
-#endif /* GL_EXT_blend_minmax */
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-#endif /* GL_EXT_blend_subtract */
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-#endif /* GL_EXT_clip_volume_hint */
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-#endif /* GL_EXT_cmyka */
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data);
-GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-#endif /* GL_EXT_color_subtable */
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
-GLAPI void APIENTRY glUnlockArraysEXT (void);
-#endif
-#endif /* GL_EXT_compiled_vertex_array */
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image);
-GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image);
-GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image);
-GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span);
-GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column);
-#endif
-#endif /* GL_EXT_convolution */
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
-GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
-GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
-GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
-GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
-GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
-GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
-GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
-GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
-GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
-GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
-GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
-GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
-GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
-GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer);
-#endif
-#endif /* GL_EXT_coordinate_frame */
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_EXT_copy_texture */
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
-#endif
-#endif /* GL_EXT_cull_vertex */
-
-#ifndef GL_EXT_debug_label
-#define GL_EXT_debug_label 1
-#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
-#define GL_PROGRAM_OBJECT_EXT 0x8B40
-#define GL_SHADER_OBJECT_EXT 0x8B48
-#define GL_BUFFER_OBJECT_EXT 0x9151
-#define GL_QUERY_OBJECT_EXT 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
-typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-#endif
-#endif /* GL_EXT_debug_label */
-
-#ifndef GL_EXT_debug_marker
-#define GL_EXT_debug_marker 1
-typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
-GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
-GLAPI void APIENTRY glPopGroupMarkerEXT (void);
-#endif
-#endif /* GL_EXT_debug_marker */
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
-#define GL_DEPTH_BOUNDS_EXT 0x8891
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
-#endif
-#endif /* GL_EXT_depth_bounds_test */
-
-/* GL_EXT_direct_state_access */
-#ifndef GL_EXT_direct_state_access
-#define GL_EXT_direct_state_access 1
-#define GL_PROGRAM_MATRIX 0x8E2D
-#define GL_TRANSPOSE_PROGRAM_MATRIX 0x8E2E
-#define GL_PROGRAM_MATRIX_STACK_DEPTH 0x8E2F
-typedef void (APIENTRYP PFNGLMATRIXLOADFPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADDPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTFPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXROTATEFPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXROTATEDPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXSCALEFPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXSCALEDPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXFRUSTUMPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLMATRIXORTHOPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLMATRIXPOPPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXPUSHPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDPROC) (GLenum mode, const GLdouble *m);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMatrixLoadf (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoadd (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixMultf (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultd (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixLoadIdentity (GLenum mode);
-GLAPI void APIENTRY glMatrixRotatef (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixRotated (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixScalef (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixScaled (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixTranslatef (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixTranslated (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixFrustum (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glMatrixOrtho (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glMatrixPop (GLenum mode);
-GLAPI void APIENTRY glMatrixPush (GLenum mode);
-GLAPI void APIENTRY glMatrixLoadTransposef (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoadTransposed (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixMultTransposef (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultTransposed (GLenum mode, const GLdouble *m);
-#endif
-#endif /* GL_EXT_direct_state_access */
-
-#ifndef GL_EXT_draw_buffers2
-#define GL_EXT_draw_buffers2 1
-typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-#endif
-#endif /* GL_EXT_draw_buffers2 */
-
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
-#endif
-#endif /* GL_EXT_draw_instanced */
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
-#endif
-#endif /* GL_EXT_draw_range_elements */
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
-GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
-GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
-GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
-GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer);
-#endif
-#endif /* GL_EXT_fog_coord */
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-#endif /* GL_EXT_framebuffer_blit */
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_EXT_framebuffer_multisample 1
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT 0x8D57
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_EXT_framebuffer_multisample */
-
-#ifndef GL_EXT_framebuffer_multisample_blit_scaled
-#define GL_EXT_framebuffer_multisample_blit_scaled 1
-#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
-#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
-#endif /* GL_EXT_framebuffer_multisample_blit_scaled */
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
-#endif
-#endif /* GL_EXT_framebuffer_object */
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_EXT_framebuffer_sRGB 1
-#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
-#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
-#endif /* GL_EXT_framebuffer_sRGB */
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_EXT_geometry_shader4 1
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
-#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-#define GL_LINES_ADJACENCY_EXT 0x000A
-#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
-#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
-#endif
-#endif /* GL_EXT_geometry_shader4 */
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-#endif
-#endif /* GL_EXT_gpu_program_parameters */
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_EXT_gpu_shader4 1
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD
-#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
-#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
-#define GL_SAMPLER_BUFFER_EXT 0x8DC2
-#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
-#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
-#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
-#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
-#define GL_INT_SAMPLER_1D_EXT 0x8DC9
-#define GL_INT_SAMPLER_2D_EXT 0x8DCA
-#define GL_INT_SAMPLER_3D_EXT 0x8DCB
-#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
-#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
-#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
-#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
-#endif
-#endif /* GL_EXT_gpu_shader4 */
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-#define GL_TABLE_TOO_LARGE_EXT 0x8031
-typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values);
-GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
-GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
-#endif
-#endif /* GL_EXT_histogram */
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#define GL_IUI_V2F_EXT 0x81AD
-#define GL_IUI_V3F_EXT 0x81AE
-#define GL_IUI_N3F_V2F_EXT 0x81AF
-#define GL_IUI_N3F_V3F_EXT 0x81B0
-#define GL_T2F_IUI_V2F_EXT 0x81B1
-#define GL_T2F_IUI_V3F_EXT 0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
-#endif /* GL_EXT_index_array_formats */
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#define GL_INDEX_TEST_EXT 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT 0x81B6
-#define GL_INDEX_TEST_REF_EXT 0x81B7
-typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
-#endif
-#endif /* GL_EXT_index_func */
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#define GL_INDEX_MATERIAL_EXT 0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
-typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
-#endif
-#endif /* GL_EXT_index_material */
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif /* GL_EXT_index_texture */
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
-GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
-GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
-#endif
-#endif /* GL_EXT_light_texture */
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif /* GL_EXT_misc_attribute */
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
-#endif
-#endif /* GL_EXT_multi_draw_arrays */
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
-#endif
-#endif /* GL_EXT_multisample */
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-#define GL_DEPTH_STENCIL_EXT 0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
-#define GL_DEPTH24_STENCIL8_EXT 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
-#endif /* GL_EXT_packed_depth_stencil */
-
-#ifndef GL_EXT_packed_float
-#define GL_EXT_packed_float 1
-#define GL_R11F_G11F_B10F_EXT 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
-#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
-#endif /* GL_EXT_packed_float */
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-#endif /* GL_EXT_packed_pixels */
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
-typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table);
-GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data);
-GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-#endif
-#endif /* GL_EXT_paletted_texture */
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-#endif /* GL_EXT_pixel_buffer_object */
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-#endif
-#endif /* GL_EXT_pixel_transform */
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif /* GL_EXT_pixel_transform_color_table */
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
-#endif
-#endif /* GL_EXT_point_parameters */
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
-#endif
-#endif /* GL_EXT_polygon_offset */
-
-#ifndef GL_EXT_polygon_offset_clamp
-#define GL_EXT_polygon_offset_clamp 1
-#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp);
-#endif
-#endif /* GL_EXT_polygon_offset_clamp */
-
-#ifndef GL_EXT_provoking_vertex
-#define GL_EXT_provoking_vertex 1
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
-#define GL_PROVOKING_VERTEX_EXT 0x8E4F
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
-#endif
-#endif /* GL_EXT_provoking_vertex */
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-#define GL_RESCALE_NORMAL_EXT 0x803A
-#endif /* GL_EXT_rescale_normal */
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
-GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
-GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
-GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
-GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
-GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer);
-#endif
-#endif /* GL_EXT_secondary_color */
-
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
-#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
-typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
-GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
-#endif
-#endif /* GL_EXT_separate_shader_objects */
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-#endif /* GL_EXT_separate_specular_color */
-
-#ifndef GL_EXT_shader_image_load_formatted
-#define GL_EXT_shader_image_load_formatted 1
-#endif /* GL_EXT_shader_image_load_formatted */
-
-#ifndef GL_EXT_shader_image_load_store
-#define GL_EXT_shader_image_load_store 1
-#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
-#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C
-#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E
-#define GL_IMAGE_1D_EXT 0x904C
-#define GL_IMAGE_2D_EXT 0x904D
-#define GL_IMAGE_3D_EXT 0x904E
-#define GL_IMAGE_2D_RECT_EXT 0x904F
-#define GL_IMAGE_CUBE_EXT 0x9050
-#define GL_IMAGE_BUFFER_EXT 0x9051
-#define GL_IMAGE_1D_ARRAY_EXT 0x9052
-#define GL_IMAGE_2D_ARRAY_EXT 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
-#define GL_INT_IMAGE_1D_EXT 0x9057
-#define GL_INT_IMAGE_2D_EXT 0x9058
-#define GL_INT_IMAGE_3D_EXT 0x9059
-#define GL_INT_IMAGE_2D_RECT_EXT 0x905A
-#define GL_INT_IMAGE_CUBE_EXT 0x905B
-#define GL_INT_IMAGE_BUFFER_EXT 0x905C
-#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D
-#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
-#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D
-#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
-#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
-#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
-typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
-#endif
-#endif /* GL_EXT_shader_image_load_store */
-
-#ifndef GL_EXT_shader_integer_mix
-#define GL_EXT_shader_integer_mix 1
-#endif /* GL_EXT_shader_integer_mix */
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-#endif /* GL_EXT_shadow_funcs */
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-#endif /* GL_EXT_shared_texture_palette */
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_EXT_stencil_clear_tag 1
-#define GL_STENCIL_TAG_BITS_EXT 0x88F2
-#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
-typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif
-#endif /* GL_EXT_stencil_clear_tag */
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
-#endif
-#endif /* GL_EXT_stencil_two_side */
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-#endif /* GL_EXT_stencil_wrap */
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
-#endif
-#endif /* GL_EXT_subtexture */
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
-#endif /* GL_EXT_texture */
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-#endif
-#endif /* GL_EXT_texture3D */
-
-#ifndef GL_EXT_texture_array
-#define GL_EXT_texture_array 1
-#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
-#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
-#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif
-#endif /* GL_EXT_texture_array */
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_EXT_texture_buffer_object 1
-#define GL_TEXTURE_BUFFER_EXT 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
-typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-#endif /* GL_EXT_texture_buffer_object */
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_EXT_texture_compression_latc 1
-#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
-#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
-#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
-#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
-#endif /* GL_EXT_texture_compression_latc */
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_EXT_texture_compression_rgtc 1
-#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
-#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
-#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
-#endif /* GL_EXT_texture_compression_rgtc */
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_EXT_texture_compression_s3tc 1
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-#endif /* GL_EXT_texture_compression_s3tc */
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_EXT_texture_cube_map 1
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
-#endif /* GL_EXT_texture_cube_map */
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif /* GL_EXT_texture_env_add */
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-#endif /* GL_EXT_texture_env_combine */
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-#endif /* GL_EXT_texture_env_dot3 */
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif /* GL_EXT_texture_filter_anisotropic */
-
-#ifndef GL_EXT_texture_integer
-#define GL_EXT_texture_integer 1
-#define GL_RGBA32UI_EXT 0x8D70
-#define GL_RGB32UI_EXT 0x8D71
-#define GL_ALPHA32UI_EXT 0x8D72
-#define GL_INTENSITY32UI_EXT 0x8D73
-#define GL_LUMINANCE32UI_EXT 0x8D74
-#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
-#define GL_RGBA16UI_EXT 0x8D76
-#define GL_RGB16UI_EXT 0x8D77
-#define GL_ALPHA16UI_EXT 0x8D78
-#define GL_INTENSITY16UI_EXT 0x8D79
-#define GL_LUMINANCE16UI_EXT 0x8D7A
-#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
-#define GL_RGBA8UI_EXT 0x8D7C
-#define GL_RGB8UI_EXT 0x8D7D
-#define GL_ALPHA8UI_EXT 0x8D7E
-#define GL_INTENSITY8UI_EXT 0x8D7F
-#define GL_LUMINANCE8UI_EXT 0x8D80
-#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
-#define GL_RGBA32I_EXT 0x8D82
-#define GL_RGB32I_EXT 0x8D83
-#define GL_ALPHA32I_EXT 0x8D84
-#define GL_INTENSITY32I_EXT 0x8D85
-#define GL_LUMINANCE32I_EXT 0x8D86
-#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
-#define GL_RGBA16I_EXT 0x8D88
-#define GL_RGB16I_EXT 0x8D89
-#define GL_ALPHA16I_EXT 0x8D8A
-#define GL_INTENSITY16I_EXT 0x8D8B
-#define GL_LUMINANCE16I_EXT 0x8D8C
-#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
-#define GL_RGBA8I_EXT 0x8D8E
-#define GL_RGB8I_EXT 0x8D8F
-#define GL_ALPHA8I_EXT 0x8D90
-#define GL_INTENSITY8I_EXT 0x8D91
-#define GL_LUMINANCE8I_EXT 0x8D92
-#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
-#define GL_RED_INTEGER_EXT 0x8D94
-#define GL_GREEN_INTEGER_EXT 0x8D95
-#define GL_BLUE_INTEGER_EXT 0x8D96
-#define GL_ALPHA_INTEGER_EXT 0x8D97
-#define GL_RGB_INTEGER_EXT 0x8D98
-#define GL_RGBA_INTEGER_EXT 0x8D99
-#define GL_BGR_INTEGER_EXT 0x8D9A
-#define GL_BGRA_INTEGER_EXT 0x8D9B
-#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
-#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
-#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
-GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-#endif
-#endif /* GL_EXT_texture_integer */
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-#endif /* GL_EXT_texture_lod_bias */
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-#endif /* GL_EXT_texture_mirror_clamp */
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
-typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);
-GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);
-GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);
-GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);
-GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);
-GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif
-#endif /* GL_EXT_texture_object */
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
-#endif
-#endif /* GL_EXT_texture_perturb_normal */
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB8_EXT 0x8C41
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
-#define GL_SLUMINANCE_EXT 0x8C46
-#define GL_SLUMINANCE8_EXT 0x8C47
-#define GL_COMPRESSED_SRGB_EXT 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-#endif /* GL_EXT_texture_sRGB */
-
-#ifndef GL_EXT_texture_sRGB_decode
-#define GL_EXT_texture_sRGB_decode 1
-#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
-#define GL_DECODE_EXT 0x8A49
-#define GL_SKIP_DECODE_EXT 0x8A4A
-#endif /* GL_EXT_texture_sRGB_decode */
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_EXT_texture_shared_exponent 1
-#define GL_RGB9_E5_EXT 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
-#endif /* GL_EXT_texture_shared_exponent */
-
-#ifndef GL_EXT_texture_snorm
-#define GL_EXT_texture_snorm 1
-#define GL_ALPHA_SNORM 0x9010
-#define GL_LUMINANCE_SNORM 0x9011
-#define GL_LUMINANCE_ALPHA_SNORM 0x9012
-#define GL_INTENSITY_SNORM 0x9013
-#define GL_ALPHA8_SNORM 0x9014
-#define GL_LUMINANCE8_SNORM 0x9015
-#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
-#define GL_INTENSITY8_SNORM 0x9017
-#define GL_ALPHA16_SNORM 0x9018
-#define GL_LUMINANCE16_SNORM 0x9019
-#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
-#define GL_INTENSITY16_SNORM 0x901B
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#endif /* GL_EXT_texture_snorm */
-
-#ifndef GL_EXT_texture_swizzle
-#define GL_EXT_texture_swizzle 1
-#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
-#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
-#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
-#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
-#endif /* GL_EXT_texture_swizzle */
-
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
-#define GL_TIME_ELAPSED_EXT 0x88BF
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
-#endif
-#endif /* GL_EXT_timer_query */
-
-#ifndef GL_EXT_transform_feedback
-#define GL_EXT_transform_feedback 1
-#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
-#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
-#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
-#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
-#define GL_RASTERIZER_DISCARD_EXT 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
-GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-#endif
-#endif /* GL_EXT_transform_feedback */
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params);
-typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glArrayElementEXT (GLint i);
-GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
-GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params);
-GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer);
-#endif
-#endif /* GL_EXT_vertex_array */
-
-#ifndef GL_EXT_vertex_array_bgra
-#define GL_EXT_vertex_array_bgra 1
-#endif /* GL_EXT_vertex_array_bgra */
-
-#ifndef GL_EXT_vertex_attrib_64bit
-#define GL_EXT_vertex_attrib_64bit 1
-#define GL_DOUBLE_VEC2_EXT 0x8FFC
-#define GL_DOUBLE_VEC3_EXT 0x8FFD
-#define GL_DOUBLE_VEC4_EXT 0x8FFE
-#define GL_DOUBLE_MAT2_EXT 0x8F46
-#define GL_DOUBLE_MAT3_EXT 0x8F47
-#define GL_DOUBLE_MAT4_EXT 0x8F48
-#define GL_DOUBLE_MAT2x3_EXT 0x8F49
-#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
-#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
-#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
-#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
-#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
-#endif
-#endif /* GL_EXT_vertex_attrib_64bit */
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
-typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr);
-typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr);
-typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
-typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
-typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
-typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
-typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
-typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
-typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr);
-typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data);
-typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVertexShaderEXT (void);
-GLAPI void APIENTRY glEndVertexShaderEXT (void);
-GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
-GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
-GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
-GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
-GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
-GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
-GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr);
-GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr);
-GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
-GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
-GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
-GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
-GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
-GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
-GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
-GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
-GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr);
-GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
-GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
-GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
-GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
-GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
-GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
-GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
-GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
-GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data);
-GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-#endif
-#endif /* GL_EXT_vertex_shader */
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW0_EXT 0x1700
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
-GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
-GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer);
-#endif
-#endif /* GL_EXT_vertex_weighting */
-
-#ifndef GL_EXT_x11_sync_object
-#define GL_EXT_x11_sync_object 1
-#define GL_SYNC_X11_FENCE_EXT 0x90E1
-typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
-#endif
-#endif /* GL_EXT_x11_sync_object */
-
-#ifndef GL_GREMEDY_frame_terminator
-#define GL_GREMEDY_frame_terminator 1
-typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
-#endif
-#endif /* GL_GREMEDY_frame_terminator */
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string);
-#endif
-#endif /* GL_GREMEDY_string_marker */
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#define GL_IGNORE_BORDER_HP 0x8150
-#define GL_CONSTANT_BORDER_HP 0x8151
-#define GL_REPLICATE_BORDER_HP 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
-#endif /* GL_HP_convolution_border_modes */
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-#define GL_IMAGE_SCALE_X_HP 0x8155
-#define GL_IMAGE_SCALE_Y_HP 0x8156
-#define GL_IMAGE_TRANSLATE_X_HP 0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
-#define GL_IMAGE_MAG_FILTER_HP 0x815C
-#define GL_IMAGE_MIN_FILTER_HP 0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
-#define GL_CUBIC_HP 0x815F
-#define GL_AVERAGE_HP 0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
-#endif
-#endif /* GL_HP_image_transform */
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-#endif /* GL_HP_occlusion_test */
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
-#endif /* GL_HP_texture_lighting */
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#define GL_CULL_VERTEX_IBM 103050
-#endif /* GL_IBM_cull_vertex */
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride);
-#endif
-#endif /* GL_IBM_multimode_draw_arrays */
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
-#endif /* GL_IBM_rasterpos_clip */
-
-#ifndef GL_IBM_static_data
-#define GL_IBM_static_data 1
-#define GL_ALL_STATIC_DATA_IBM 103060
-#define GL_STATIC_VERTEX_ARRAY_IBM 103061
-typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target);
-#endif
-#endif /* GL_IBM_static_data */
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_IBM_texture_mirrored_repeat 1
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-#endif /* GL_IBM_texture_mirrored_repeat */
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride);
-GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride);
-#endif
-#endif /* GL_IBM_vertex_array_lists */
-
-#ifndef GL_INGR_blend_func_separate
-#define GL_INGR_blend_func_separate 1
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-#endif /* GL_INGR_blend_func_separate */
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-#endif /* GL_INGR_color_clamp */
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-#define GL_INTERLACE_READ_INGR 0x8568
-#endif /* GL_INGR_interlace_read */
-
-#ifndef GL_INTEL_fragment_shader_ordering
-#define GL_INTEL_fragment_shader_ordering 1
-#endif /* GL_INTEL_fragment_shader_ordering */
-
-#ifndef GL_INTEL_map_texture
-#define GL_INTEL_map_texture 1
-#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF
-#define GL_LAYOUT_DEFAULT_INTEL 0
-#define GL_LAYOUT_LINEAR_INTEL 1
-#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2
-typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level);
-typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture);
-GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level);
-GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout);
-#endif
-#endif /* GL_INTEL_map_texture */
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer);
-typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer);
-GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer);
-GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer);
-GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer);
-#endif
-#endif /* GL_INTEL_parallel_arrays */
-
-#ifndef GL_INTEL_performance_query
-#define GL_INTEL_performance_query 1
-#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000
-#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001
-#define GL_PERFQUERY_WAIT_INTEL 0x83FB
-#define GL_PERFQUERY_FLUSH_INTEL 0x83FA
-#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9
-#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0
-#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1
-#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2
-#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3
-#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4
-#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5
-#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8
-#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9
-#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA
-#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB
-#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC
-#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD
-#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE
-#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF
-#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
-typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
-typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
-typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
-typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
-typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
-typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
-typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
-typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
-typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
-GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
-GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
-GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
-GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
-GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
-GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
-GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
-GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
-#endif
-#endif /* GL_INTEL_performance_query */
-
-#ifndef GL_MESAX_texture_stack
-#define GL_MESAX_texture_stack 1
-#define GL_TEXTURE_1D_STACK_MESAX 0x8759
-#define GL_TEXTURE_2D_STACK_MESAX 0x875A
-#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
-#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
-#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
-#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
-#endif /* GL_MESAX_texture_stack */
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-#define GL_PACK_INVERT_MESA 0x8758
-#endif /* GL_MESA_pack_invert */
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glResizeBuffersMESA (void);
-#endif
-#endif /* GL_MESA_resize_buffers */
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
-GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
-#endif
-#endif /* GL_MESA_window_pos */
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
-#endif /* GL_MESA_ycbcr_texture */
-
-#ifndef GL_NVX_conditional_render
-#define GL_NVX_conditional_render 1
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id);
-GLAPI void APIENTRY glEndConditionalRenderNVX (void);
-#endif
-#endif /* GL_NVX_conditional_render */
-
-#ifndef GL_NVX_gpu_memory_info
-#define GL_NVX_gpu_memory_info 1
-#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
-#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
-#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
-#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
-#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
-#endif /* GL_NVX_gpu_memory_info */
-
-#ifndef GL_NV_bindless_multi_draw_indirect
-#define GL_NV_bindless_multi_draw_indirect 1
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
-GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
-#endif
-#endif /* GL_NV_bindless_multi_draw_indirect */
-
-#ifndef GL_NV_bindless_multi_draw_indirect_count
-#define GL_NV_bindless_multi_draw_indirect_count 1
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
-GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
-#endif
-#endif /* GL_NV_bindless_multi_draw_indirect_count */
-
-#ifndef GL_NV_bindless_texture
-#define GL_NV_bindless_texture 1
-typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
-typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);
-typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);
-typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
-typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);
-typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);
-typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture);
-GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler);
-GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle);
-GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle);
-GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access);
-GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle);
-GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value);
-GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value);
-GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value);
-GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
-GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle);
-GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
-#endif
-#endif /* GL_NV_bindless_texture */
-
-#ifndef GL_NV_blend_equation_advanced
-#define GL_NV_blend_equation_advanced 1
-#define GL_BLEND_OVERLAP_NV 0x9281
-#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280
-#define GL_BLUE_NV 0x1905
-#define GL_COLORBURN_NV 0x929A
-#define GL_COLORDODGE_NV 0x9299
-#define GL_CONJOINT_NV 0x9284
-#define GL_CONTRAST_NV 0x92A1
-#define GL_DARKEN_NV 0x9297
-#define GL_DIFFERENCE_NV 0x929E
-#define GL_DISJOINT_NV 0x9283
-#define GL_DST_ATOP_NV 0x928F
-#define GL_DST_IN_NV 0x928B
-#define GL_DST_NV 0x9287
-#define GL_DST_OUT_NV 0x928D
-#define GL_DST_OVER_NV 0x9289
-#define GL_EXCLUSION_NV 0x92A0
-#define GL_GREEN_NV 0x1904
-#define GL_HARDLIGHT_NV 0x929B
-#define GL_HARDMIX_NV 0x92A9
-#define GL_HSL_COLOR_NV 0x92AF
-#define GL_HSL_HUE_NV 0x92AD
-#define GL_HSL_LUMINOSITY_NV 0x92B0
-#define GL_HSL_SATURATION_NV 0x92AE
-#define GL_INVERT_OVG_NV 0x92B4
-#define GL_INVERT_RGB_NV 0x92A3
-#define GL_LIGHTEN_NV 0x9298
-#define GL_LINEARBURN_NV 0x92A5
-#define GL_LINEARDODGE_NV 0x92A4
-#define GL_LINEARLIGHT_NV 0x92A7
-#define GL_MINUS_CLAMPED_NV 0x92B3
-#define GL_MINUS_NV 0x929F
-#define GL_MULTIPLY_NV 0x9294
-#define GL_OVERLAY_NV 0x9296
-#define GL_PINLIGHT_NV 0x92A8
-#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2
-#define GL_PLUS_CLAMPED_NV 0x92B1
-#define GL_PLUS_DARKER_NV 0x9292
-#define GL_PLUS_NV 0x9291
-#define GL_RED_NV 0x1903
-#define GL_SCREEN_NV 0x9295
-#define GL_SOFTLIGHT_NV 0x929C
-#define GL_SRC_ATOP_NV 0x928E
-#define GL_SRC_IN_NV 0x928A
-#define GL_SRC_NV 0x9286
-#define GL_SRC_OUT_NV 0x928C
-#define GL_SRC_OVER_NV 0x9288
-#define GL_UNCORRELATED_NV 0x9282
-#define GL_VIVIDLIGHT_NV 0x92A6
-#define GL_XOR_NV 0x1506
-typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value);
-GLAPI void APIENTRY glBlendBarrierNV (void);
-#endif
-#endif /* GL_NV_blend_equation_advanced */
-
-#ifndef GL_NV_blend_equation_advanced_coherent
-#define GL_NV_blend_equation_advanced_coherent 1
-#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
-#endif /* GL_NV_blend_equation_advanced_coherent */
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif /* GL_NV_blend_square */
-
-#ifndef GL_NV_compute_program5
-#define GL_NV_compute_program5 1
-#define GL_COMPUTE_PROGRAM_NV 0x90FB
-#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC
-#endif /* GL_NV_compute_program5 */
-
-#ifndef GL_NV_conditional_render
-#define GL_NV_conditional_render 1
-#define GL_QUERY_WAIT_NV 0x8E13
-#define GL_QUERY_NO_WAIT_NV 0x8E14
-#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRenderNV (void);
-#endif
-#endif /* GL_NV_conditional_render */
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
-#endif /* GL_NV_copy_depth_to_color */
-
-#ifndef GL_NV_copy_image
-#define GL_NV_copy_image 1
-typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-#endif /* GL_NV_copy_image */
-
-#ifndef GL_NV_deep_texture3D
-#define GL_NV_deep_texture3D 1
-#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0
-#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1
-#endif /* GL_NV_deep_texture3D */
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_NV_depth_buffer_float 1
-#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
-#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
-#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
-typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
-GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
-#endif
-#endif /* GL_NV_depth_buffer_float */
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#define GL_DEPTH_CLAMP_NV 0x864F
-#endif /* GL_NV_depth_clamp */
-
-#ifndef GL_NV_draw_texture
-#define GL_NV_draw_texture 1
-typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
-#endif
-#endif /* GL_NV_draw_texture */
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points);
-typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points);
-GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points);
-GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
-#endif
-#endif /* GL_NV_evaluators */
-
-#ifndef GL_NV_explicit_multisample
-#define GL_NV_explicit_multisample 1
-#define GL_SAMPLE_POSITION_NV 0x8E50
-#define GL_SAMPLE_MASK_NV 0x8E51
-#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
-#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
-#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
-#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
-#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
-#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
-#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
-#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
-typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
-GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
-#endif
-#endif /* GL_NV_explicit_multisample */
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
-GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
-GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
-GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
-GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
-GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
-GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
-#endif
-#endif /* GL_NV_fence */
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-#endif /* GL_NV_float_buffer */
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-#endif /* GL_NV_fog_distance */
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif
-#endif /* GL_NV_fragment_program */
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
-#endif /* GL_NV_fragment_program2 */
-
-#ifndef GL_NV_fragment_program4
-#define GL_NV_fragment_program4 1
-#endif /* GL_NV_fragment_program4 */
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif /* GL_NV_fragment_program_option */
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_NV_framebuffer_multisample_coverage 1
-#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
-#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
-#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
-#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-#endif /* GL_NV_framebuffer_multisample_coverage */
-
-#ifndef GL_NV_geometry_program4
-#define GL_NV_geometry_program4 1
-#define GL_GEOMETRY_PROGRAM_NV 0x8C26
-#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
-#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
-typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
-GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif
-#endif /* GL_NV_geometry_program4 */
-
-#ifndef GL_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-#endif /* GL_NV_geometry_shader4 */
-
-#ifndef GL_NV_gpu_program4
-#define GL_NV_gpu_program4 1
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
-#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
-#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
-#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
-#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
-#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
-#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
-GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
-#endif
-#endif /* GL_NV_gpu_program4 */
-
-#ifndef GL_NV_gpu_program5
-#define GL_NV_gpu_program5 1
-#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
-#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
-#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
-#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
-typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
-#endif
-#endif /* GL_NV_gpu_program5 */
-
-#ifndef GL_NV_gpu_program5_mem_extended
-#define GL_NV_gpu_program5_mem_extended 1
-#endif /* GL_NV_gpu_program5_mem_extended */
-
-#ifndef GL_NV_gpu_shader5
-#define GL_NV_gpu_shader5 1
-#endif /* GL_NV_gpu_shader5 */
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-typedef unsigned short GLhalfNV;
-#define GL_HALF_FLOAT_NV 0x140B
-typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
-typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
-typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
-GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);
-GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);
-GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);
-GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);
-GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
-GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
-GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
-GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
-GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
-GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
-GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif
-#endif /* GL_NV_half_float */
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
-#endif /* GL_NV_light_max_exponent */
-
-#ifndef GL_NV_multisample_coverage
-#define GL_NV_multisample_coverage 1
-#define GL_COLOR_SAMPLES_NV 0x8E20
-#endif /* GL_NV_multisample_coverage */
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-#endif /* GL_NV_multisample_filter_hint */
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
-GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
-GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
-#endif
-#endif /* GL_NV_occlusion_query */
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
-#endif /* GL_NV_packed_depth_stencil */
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_NV_parameter_buffer_object 1
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
-#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
-#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
-#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params);
-#endif
-#endif /* GL_NV_parameter_buffer_object */
-
-#ifndef GL_NV_parameter_buffer_object2
-#define GL_NV_parameter_buffer_object2 1
-#endif /* GL_NV_parameter_buffer_object2 */
-
-#ifndef GL_NV_path_rendering
-#define GL_NV_path_rendering 1
-#define GL_PATH_FORMAT_SVG_NV 0x9070
-#define GL_PATH_FORMAT_PS_NV 0x9071
-#define GL_STANDARD_FONT_NAME_NV 0x9072
-#define GL_SYSTEM_FONT_NAME_NV 0x9073
-#define GL_FILE_NAME_NV 0x9074
-#define GL_PATH_STROKE_WIDTH_NV 0x9075
-#define GL_PATH_END_CAPS_NV 0x9076
-#define GL_PATH_INITIAL_END_CAP_NV 0x9077
-#define GL_PATH_TERMINAL_END_CAP_NV 0x9078
-#define GL_PATH_JOIN_STYLE_NV 0x9079
-#define GL_PATH_MITER_LIMIT_NV 0x907A
-#define GL_PATH_DASH_CAPS_NV 0x907B
-#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C
-#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D
-#define GL_PATH_DASH_OFFSET_NV 0x907E
-#define GL_PATH_CLIENT_LENGTH_NV 0x907F
-#define GL_PATH_FILL_MODE_NV 0x9080
-#define GL_PATH_FILL_MASK_NV 0x9081
-#define GL_PATH_FILL_COVER_MODE_NV 0x9082
-#define GL_PATH_STROKE_COVER_MODE_NV 0x9083
-#define GL_PATH_STROKE_MASK_NV 0x9084
-#define GL_COUNT_UP_NV 0x9088
-#define GL_COUNT_DOWN_NV 0x9089
-#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A
-#define GL_CONVEX_HULL_NV 0x908B
-#define GL_BOUNDING_BOX_NV 0x908D
-#define GL_TRANSLATE_X_NV 0x908E
-#define GL_TRANSLATE_Y_NV 0x908F
-#define GL_TRANSLATE_2D_NV 0x9090
-#define GL_TRANSLATE_3D_NV 0x9091
-#define GL_AFFINE_2D_NV 0x9092
-#define GL_AFFINE_3D_NV 0x9094
-#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
-#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
-#define GL_UTF8_NV 0x909A
-#define GL_UTF16_NV 0x909B
-#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
-#define GL_PATH_COMMAND_COUNT_NV 0x909D
-#define GL_PATH_COORD_COUNT_NV 0x909E
-#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F
-#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0
-#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1
-#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2
-#define GL_SQUARE_NV 0x90A3
-#define GL_ROUND_NV 0x90A4
-#define GL_TRIANGULAR_NV 0x90A5
-#define GL_BEVEL_NV 0x90A6
-#define GL_MITER_REVERT_NV 0x90A7
-#define GL_MITER_TRUNCATE_NV 0x90A8
-#define GL_SKIP_MISSING_GLYPH_NV 0x90A9
-#define GL_USE_MISSING_GLYPH_NV 0x90AA
-#define GL_PATH_ERROR_POSITION_NV 0x90AB
-#define GL_PATH_FOG_GEN_MODE_NV 0x90AC
-#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD
-#define GL_ADJACENT_PAIRS_NV 0x90AE
-#define GL_FIRST_TO_REST_NV 0x90AF
-#define GL_PATH_GEN_MODE_NV 0x90B0
-#define GL_PATH_GEN_COEFF_NV 0x90B1
-#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2
-#define GL_PATH_GEN_COMPONENTS_NV 0x90B3
-#define GL_PATH_STENCIL_FUNC_NV 0x90B7
-#define GL_PATH_STENCIL_REF_NV 0x90B8
-#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9
-#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
-#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
-#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF
-#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4
-#define GL_MOVE_TO_RESETS_NV 0x90B5
-#define GL_MOVE_TO_CONTINUES_NV 0x90B6
-#define GL_CLOSE_PATH_NV 0x00
-#define GL_MOVE_TO_NV 0x02
-#define GL_RELATIVE_MOVE_TO_NV 0x03
-#define GL_LINE_TO_NV 0x04
-#define GL_RELATIVE_LINE_TO_NV 0x05
-#define GL_HORIZONTAL_LINE_TO_NV 0x06
-#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
-#define GL_VERTICAL_LINE_TO_NV 0x08
-#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09
-#define GL_QUADRATIC_CURVE_TO_NV 0x0A
-#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
-#define GL_CUBIC_CURVE_TO_NV 0x0C
-#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D
-#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E
-#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
-#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10
-#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
-#define GL_SMALL_CCW_ARC_TO_NV 0x12
-#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13
-#define GL_SMALL_CW_ARC_TO_NV 0x14
-#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15
-#define GL_LARGE_CCW_ARC_TO_NV 0x16
-#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17
-#define GL_LARGE_CW_ARC_TO_NV 0x18
-#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19
-#define GL_RESTART_PATH_NV 0xF0
-#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2
-#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4
-#define GL_RECT_NV 0xF6
-#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8
-#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA
-#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC
-#define GL_ARC_TO_NV 0xFE
-#define GL_RELATIVE_ARC_TO_NV 0xFF
-#define GL_BOLD_BIT_NV 0x01
-#define GL_ITALIC_BIT_NV 0x02
-#define GL_GLYPH_WIDTH_BIT_NV 0x01
-#define GL_GLYPH_HEIGHT_BIT_NV 0x02
-#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
-#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
-#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
-#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
-#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
-#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
-#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100
-#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000
-#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000
-#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000
-#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000
-#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000
-#define GL_FONT_ASCENDER_BIT_NV 0x00200000
-#define GL_FONT_DESCENDER_BIT_NV 0x00400000
-#define GL_FONT_HEIGHT_BIT_NV 0x00800000
-#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000
-#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000
-#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000
-#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000
-#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_ROUNDED_RECT_NV 0xE8
-#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9
-#define GL_ROUNDED_RECT2_NV 0xEA
-#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB
-#define GL_ROUNDED_RECT4_NV 0xEC
-#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED
-#define GL_ROUNDED_RECT8_NV 0xEE
-#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF
-#define GL_RELATIVE_RECT_NV 0xF7
-#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368
-#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369
-#define GL_FONT_UNAVAILABLE_NV 0x936A
-#define GL_FONT_UNINTELLIGIBLE_NV 0x936B
-#define GL_CONIC_CURVE_TO_NV 0x1A
-#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B
-#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000
-#define GL_STANDARD_FONT_FORMAT_NV 0x936C
-#define GL_2_BYTES_NV 0x1407
-#define GL_3_BYTES_NV 0x1408
-#define GL_4_BYTES_NV 0x1409
-#define GL_EYE_LINEAR_NV 0x2400
-#define GL_OBJECT_LINEAR_NV 0x2401
-#define GL_CONSTANT_NV 0x8576
-#define GL_PATH_PROJECTION_NV 0x1701
-#define GL_PATH_MODELVIEW_NV 0x1700
-#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3
-#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6
-#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36
-#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3
-#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4
-#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7
-#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38
-#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4
-#define GL_FRAGMENT_INPUT_NV 0x936D
-typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path);
-typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
-typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString);
-typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
-typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
-typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value);
-typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
-typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
-typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);
-typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func);
-typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
-typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
-typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode);
-typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
-typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode);
-typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value);
-typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value);
-typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands);
-typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords);
-typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray);
-typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
-typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value);
-typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value);
-typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value);
-typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value);
-typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
-typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
-typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
-typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
-typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
-typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
-typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range);
-GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
-GLAPI GLboolean APIENTRY glIsPathNV (GLuint path);
-GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
-GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
-GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString);
-GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
-GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);
-GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
-GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);
-GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);
-GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);
-GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);
-GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
-GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);
-GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);
-GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);
-GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func);
-GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
-GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
-GLAPI void APIENTRY glPathFogGenNV (GLenum genMode);
-GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);
-GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);
-GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);
-GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);
-GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);
-GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);
-GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);
-GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
-GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value);
-GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value);
-GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value);
-GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value);
-GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
-GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
-GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-GLAPI void APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
-GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
-GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
-GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
-GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
-GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
-#endif
-#endif /* GL_NV_path_rendering */
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer);
-typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer);
-GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
-#endif
-#endif /* GL_NV_pixel_data_range */
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
-#endif
-#endif /* GL_NV_point_sprite */
-
-#ifndef GL_NV_present_video
-#define GL_NV_present_video 1
-#define GL_FRAME_NV 0x8E26
-#define GL_FIELDS_NV 0x8E27
-#define GL_CURRENT_TIME_NV 0x8E28
-#define GL_NUM_FILL_STREAMS_NV 0x8E29
-#define GL_PRESENT_TIME_NV 0x8E2A
-#define GL_PRESENT_DURATION_NV 0x8E2B
-typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
-#endif
-#endif /* GL_NV_present_video */
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
-#endif
-#endif /* GL_NV_primitive_restart */
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
-#endif
-#endif /* GL_NV_register_combiners */
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
-typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
-#endif
-#endif /* GL_NV_register_combiners2 */
-
-#ifndef GL_NV_shader_atomic_counters
-#define GL_NV_shader_atomic_counters 1
-#endif /* GL_NV_shader_atomic_counters */
-
-#ifndef GL_NV_shader_atomic_float
-#define GL_NV_shader_atomic_float 1
-#endif /* GL_NV_shader_atomic_float */
-
-#ifndef GL_NV_shader_atomic_int64
-#define GL_NV_shader_atomic_int64 1
-#endif /* GL_NV_shader_atomic_int64 */
-
-#ifndef GL_NV_shader_buffer_load
-#define GL_NV_shader_buffer_load 1
-#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
-#define GL_GPU_ADDRESS_NV 0x8F34
-#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
-typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
-typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
-typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
-typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
-typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
-GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
-GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
-GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
-GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
-GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
-GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
-GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
-GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
-GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif
-#endif /* GL_NV_shader_buffer_load */
-
-#ifndef GL_NV_shader_buffer_store
-#define GL_NV_shader_buffer_store 1
-#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
-#endif /* GL_NV_shader_buffer_store */
-
-#ifndef GL_NV_shader_storage_buffer_object
-#define GL_NV_shader_storage_buffer_object 1
-#endif /* GL_NV_shader_storage_buffer_object */
-
-#ifndef GL_NV_shader_thread_group
-#define GL_NV_shader_thread_group 1
-#define GL_WARP_SIZE_NV 0x9339
-#define GL_WARPS_PER_SM_NV 0x933A
-#define GL_SM_COUNT_NV 0x933B
-#endif /* GL_NV_shader_thread_group */
-
-#ifndef GL_NV_shader_thread_shuffle
-#define GL_NV_shader_thread_shuffle 1
-#endif /* GL_NV_shader_thread_shuffle */
-
-#ifndef GL_NV_tessellation_program5
-#define GL_NV_tessellation_program5 1
-#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
-#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
-#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
-#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
-#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
-#endif /* GL_NV_tessellation_program5 */
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-#endif /* GL_NV_texgen_emboss */
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
-#endif /* GL_NV_texgen_reflection */
-
-#ifndef GL_NV_texture_barrier
-#define GL_NV_texture_barrier 1
-typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureBarrierNV (void);
-#endif
-#endif /* GL_NV_texture_barrier */
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif /* GL_NV_texture_compression_vtc */
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-#endif /* GL_NV_texture_env_combine4 */
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-#endif /* GL_NV_texture_expand_normal */
-
-#ifndef GL_NV_texture_multisample
-#define GL_NV_texture_multisample 1
-#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
-#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
-typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-#endif
-#endif /* GL_NV_texture_multisample */
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-#endif /* GL_NV_texture_rectangle */
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
-#endif /* GL_NV_texture_shader */
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#endif /* GL_NV_texture_shader2 */
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-#endif /* GL_NV_texture_shader3 */
-
-#ifndef GL_NV_transform_feedback
-#define GL_NV_transform_feedback 1
-#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
-#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
-#define GL_TEXTURE_COORD_NV 0x8C79
-#define GL_CLIP_DISTANCE_NV 0x8C7A
-#define GL_VERTEX_ID_NV 0x8C7B
-#define GL_PRIMITIVE_ID_NV 0x8C7C
-#define GL_GENERIC_ATTRIB_NV 0x8C7D
-#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
-#define GL_ACTIVE_VARYINGS_NV 0x8C81
-#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
-#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
-#define GL_PRIMITIVES_GENERATED_NV 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
-#define GL_RASTERIZER_DISCARD_NV 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
-#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
-#define GL_LAYER_NV 0x8DAA
-#define GL_NEXT_BUFFER_NV -2
-#define GL_SKIP_COMPONENTS4_NV -3
-#define GL_SKIP_COMPONENTS3_NV -4
-#define GL_SKIP_COMPONENTS2_NV -5
-#define GL_SKIP_COMPONENTS1_NV -6
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedbackNV (void);
-GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLsizei count, const GLint *attribs, GLenum bufferMode);
-GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
-GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
-GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
-#endif
-#endif /* GL_NV_transform_feedback */
-
-#ifndef GL_NV_transform_feedback2
-#define GL_NV_transform_feedback2 1
-#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
-GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
-GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
-#endif
-#endif /* GL_NV_transform_feedback2 */
-
-#ifndef GL_NV_uniform_buffer_unified_memory
-#define GL_NV_uniform_buffer_unified_memory 1
-#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E
-#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F
-#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370
-#endif /* GL_NV_uniform_buffer_unified_memory */
-
-#ifndef GL_NV_vdpau_interop
-#define GL_NV_vdpau_interop 1
-typedef GLintptr GLvdpauSurfaceNV;
-#define GL_SURFACE_STATE_NV 0x86EB
-#define GL_SURFACE_REGISTERED_NV 0x86FD
-#define GL_SURFACE_MAPPED_NV 0x8700
-#define GL_WRITE_DISCARD_NV 0x88BE
-typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress);
-typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
-typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
-typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
-typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress);
-GLAPI void APIENTRY glVDPAUFiniNV (void);
-GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
-GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
-GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
-GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
-GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
-#endif
-#endif /* GL_NV_vdpau_interop */
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer);
-#endif
-#endif /* GL_NV_vertex_array_range */
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif /* GL_NV_vertex_array_range2 */
-
-#ifndef GL_NV_vertex_attrib_integer_64bit
-#define GL_NV_vertex_attrib_integer_64bit 1
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
-GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
-GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
-#endif
-#endif /* GL_NV_vertex_attrib_integer_64bit */
-
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_NV_vertex_buffer_unified_memory 1
-#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
-#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
-#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
-#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
-#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
-#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
-#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
-#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
-#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
-#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
-#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
-#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
-#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
-#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
-#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
-#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
-#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
-#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
-#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
-#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
-#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
-#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
-#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
-#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
-#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
-typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
-GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
-#endif
-#endif /* GL_NV_vertex_buffer_unified_memory */
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
-GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
-GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
-GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
-GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer);
-GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
-GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
-#endif
-#endif /* GL_NV_vertex_program */
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-#endif /* GL_NV_vertex_program1_1 */
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-#endif /* GL_NV_vertex_program2 */
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-#endif /* GL_NV_vertex_program2_option */
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-#endif /* GL_NV_vertex_program3 */
-
-#ifndef GL_NV_vertex_program4
-#define GL_NV_vertex_program4 1
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
-GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
-GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
-#endif
-#endif /* GL_NV_vertex_program4 */
-
-#ifndef GL_NV_video_capture
-#define GL_NV_video_capture 1
-#define GL_VIDEO_BUFFER_NV 0x9020
-#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
-#define GL_FIELD_UPPER_NV 0x9022
-#define GL_FIELD_LOWER_NV 0x9023
-#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
-#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
-#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
-#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
-#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
-#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
-#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
-#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
-#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
-#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
-#define GL_PARTIAL_SUCCESS_NV 0x902E
-#define GL_SUCCESS_NV 0x902F
-#define GL_FAILURE_NV 0x9030
-#define GL_YCBYCR8_422_NV 0x9031
-#define GL_YCBAYCR8A_4224_NV 0x9032
-#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
-#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
-#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
-#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
-#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
-#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
-#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
-#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
-#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
-#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
-typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
-typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
-GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
-GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
-GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
-GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
-#endif
-#endif /* GL_NV_video_capture */
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-#endif /* GL_OML_interlace */
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
-#endif /* GL_OML_resample */
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
-#endif /* GL_OML_subsample */
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
-#define GL_CLIP_NEAR_HINT_PGI 0x1A220
-#define GL_CLIP_FAR_HINT_PGI 0x1A221
-#define GL_WIDE_LINE_HINT_PGI 0x1A222
-#define GL_BACK_NORMALS_HINT_PGI 0x1A223
-typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
-#endif
-#endif /* GL_PGI_misc_hints */
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#endif /* GL_PGI_vertex_hints */
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-#endif /* GL_REND_screen_coordinates */
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
-#define GL_RGBA_DXT5_S3TC 0x83A4
-#define GL_RGBA4_DXT5_S3TC 0x83A5
-#endif /* GL_S3_s3tc */
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS 0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
-#endif
-#endif /* GL_SGIS_detail_texture */
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-#define GL_FOG_FUNC_SGIS 0x812A
-#define GL_FOG_FUNC_POINTS_SGIS 0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
-typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
-#endif
-#endif /* GL_SGIS_fog_function */
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif /* GL_SGIS_generate_mipmap */
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
-#endif
-#endif /* GL_SGIS_multisample */
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#define GL_PIXEL_TEXTURE_SGIS 0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
-GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
-#endif
-#endif /* GL_SGIS_pixel_texture */
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-#endif /* GL_SGIS_point_line_texgen */
-
-#ifndef GL_SGIS_point_parameters
-#define GL_SGIS_point_parameters 1
-#define GL_POINT_SIZE_MIN_SGIS 0x8126
-#define GL_POINT_SIZE_MAX_SGIS 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
-#endif
-#endif /* GL_SGIS_point_parameters */
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#define GL_LINEAR_SHARPEN_SGIS 0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
-#endif
-#endif /* GL_SGIS_sharpen_texture */
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
-#define GL_TEXTURE_4D_SGIS 0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
-#define GL_TEXTURE_4DSIZE_SGIS 0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
-typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels);
-GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels);
-#endif
-#endif /* GL_SGIS_texture4D */
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-#endif /* GL_SGIS_texture_border_clamp */
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
-typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-#endif /* GL_SGIS_texture_color_mask */
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-#endif /* GL_SGIS_texture_edge_clamp */
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#define GL_FILTER4_SGIS 0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
-typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
-GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
-#endif /* GL_SGIS_texture_filter4 */
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-#endif /* GL_SGIS_texture_lod */
-
-#ifndef GL_SGIS_texture_select
-#define GL_SGIS_texture_select 1
-#define GL_DUAL_ALPHA4_SGIS 0x8110
-#define GL_DUAL_ALPHA8_SGIS 0x8111
-#define GL_DUAL_ALPHA12_SGIS 0x8112
-#define GL_DUAL_ALPHA16_SGIS 0x8113
-#define GL_DUAL_LUMINANCE4_SGIS 0x8114
-#define GL_DUAL_LUMINANCE8_SGIS 0x8115
-#define GL_DUAL_LUMINANCE12_SGIS 0x8116
-#define GL_DUAL_LUMINANCE16_SGIS 0x8117
-#define GL_DUAL_INTENSITY4_SGIS 0x8118
-#define GL_DUAL_INTENSITY8_SGIS 0x8119
-#define GL_DUAL_INTENSITY12_SGIS 0x811A
-#define GL_DUAL_INTENSITY16_SGIS 0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
-#define GL_QUAD_ALPHA4_SGIS 0x811E
-#define GL_QUAD_ALPHA8_SGIS 0x811F
-#define GL_QUAD_LUMINANCE4_SGIS 0x8120
-#define GL_QUAD_LUMINANCE8_SGIS 0x8121
-#define GL_QUAD_INTENSITY4_SGIS 0x8122
-#define GL_QUAD_INTENSITY8_SGIS 0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
-#endif /* GL_SGIS_texture_select */
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-#define GL_ASYNC_MARKER_SGIX 0x8329
-typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
-typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
-typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
-GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
-GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
-GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
-GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
-GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
-#endif
-#endif /* GL_SGIX_async */
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-#endif /* GL_SGIX_async_histogram */
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-#endif /* GL_SGIX_async_pixel */
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-#endif /* GL_SGIX_blend_alpha_minmax */
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
-#endif /* GL_SGIX_calligraphic_fragment */
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
-#endif /* GL_SGIX_clipmap */
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-#endif /* GL_SGIX_convolution_accuracy */
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif /* GL_SGIX_depth_pass_instrument */
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-#endif /* GL_SGIX_depth_texture */
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif
-#endif /* GL_SGIX_flush_raster */
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-#endif /* GL_SGIX_fog_offset */
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
-#define GL_LIGHT_ENV_MODE_SGIX 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
-typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
-GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
-GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
-#endif
-#endif /* GL_SGIX_fragment_lighting */
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-#define GL_FRAMEZOOM_SGIX 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
-typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
-#endif
-#endif /* GL_SGIX_framezoom */
-
-#ifndef GL_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params);
-#endif
-#endif /* GL_SGIX_igloo_interface */
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
-typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
-GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
-GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
-GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
-GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
-#endif
-#endif /* GL_SGIX_instruments */
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#define GL_INTERLACE_SGIX 0x8094
-#endif /* GL_SGIX_interlace */
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#define GL_IR_INSTRUMENT1_SGIX 0x817F
-#endif /* GL_SGIX_ir_instrument1 */
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#define GL_LIST_PRIORITY_SGIX 0x8182
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
-GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
-GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
-#endif
-#endif /* GL_SGIX_list_priority */
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#define GL_PIXEL_TEX_GEN_SGIX 0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
-typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
-#endif
-#endif /* GL_SGIX_pixel_texture */
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
-#endif /* GL_SGIX_pixel_tiles */
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_SGIX_polynomial_ffd 1
-#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
-#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
-#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
-#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
-#define GL_DEFORMATIONS_MASK_SGIX 0x8196
-#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
-GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
-#endif
-#endif /* GL_SGIX_polynomial_ffd */
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-#define GL_REFERENCE_PLANE_SGIX 0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
-typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
-#endif
-#endif /* GL_SGIX_reference_plane */
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-#define GL_PACK_RESAMPLE_SGIX 0x842C
-#define GL_UNPACK_RESAMPLE_SGIX 0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#endif /* GL_SGIX_resample */
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#define GL_SCALEBIAS_HINT_SGIX 0x8322
-#endif /* GL_SGIX_scalebias_hint */
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-#endif /* GL_SGIX_shadow */
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-#endif /* GL_SGIX_shadow_ambient */
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#define GL_SPRITE_SGIX 0x8148
-#define GL_SPRITE_MODE_SGIX 0x8149
-#define GL_SPRITE_AXIS_SGIX 0x814A
-#define GL_SPRITE_TRANSLATION_SGIX 0x814B
-#define GL_SPRITE_AXIAL_SGIX 0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
-GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
-#endif
-#endif /* GL_SGIX_sprite */
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
-#endif /* GL_SGIX_subsample */
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif
-#endif /* GL_SGIX_tag_sample_buffer */
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
-#endif /* GL_SGIX_texture_add_env */
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
-#endif /* GL_SGIX_texture_coordinate_clamp */
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
-#endif /* GL_SGIX_texture_lod_bias */
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif /* GL_SGIX_texture_multi_buffer */
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif /* GL_SGIX_texture_scale_bias */
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-#endif /* GL_SGIX_vertex_preclip */
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#define GL_YCRCB_422_SGIX 0x81BB
-#define GL_YCRCB_444_SGIX 0x81BC
-#endif /* GL_SGIX_ycrcb */
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif /* GL_SGIX_ycrcb_subsample */
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#define GL_YCRCB_SGIX 0x8318
-#define GL_YCRCBA_SGIX 0x8319
-#endif /* GL_SGIX_ycrcba */
-
-#ifndef GL_SGI_color_matrix
-#define GL_SGI_color_matrix 1
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif /* GL_SGI_color_matrix */
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table);
-GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table);
-GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
-#endif
-#endif /* GL_SGI_color_table */
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-#endif /* GL_SGI_texture_color_table */
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFinishTextureSUNX (void);
-#endif
-#endif /* GL_SUNX_constant_data */
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#define GL_WRAP_BORDER_SUN 0x81D4
-#endif /* GL_SUN_convolution_border_modes */
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
-GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
-GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
-GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
-GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
-GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
-GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
-GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
-#endif
-#endif /* GL_SUN_global_alpha */
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-#endif /* GL_SUN_mesh_array */
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-#define GL_SLICE_ACCUM_SUN 0x85CC
-#endif /* GL_SUN_slice_accum */
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-#define GL_RESTART_SUN 0x0001
-#define GL_REPLACE_MIDDLE_SUN 0x0002
-#define GL_REPLACE_OLDEST_SUN 0x0003
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
-GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
-GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
-GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
-GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
-GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
-GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer);
-#endif
-#endif /* GL_SUN_triangle_list */
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
-#endif /* GL_SUN_vertex */
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-#endif /* GL_WIN_phong_shading */
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-#endif /* GL_WIN_specular_fog */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glfuncdef.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glfuncdef.h
deleted file mode 100644
index cd50a3a3..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glfuncdef.h
+++ /dev/null
@@ -1,343 +0,0 @@
-// Notice
-// NVIDIA Corporation and its licensors retain all intellectual property and
-// proprietary rights in and to this software and related documentation and
-// any modifications thereto. Any use, reproduction, disclosure, or
-// distribution of this software and related documentation without an express
-// license agreement from NVIDIA Corporation is strictly prohibited.
-//
-// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
-// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
-// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
-// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// Information and code furnished is believed to be accurate and reliable.
-// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
-// information or for any infringement of patents or other rights of third parties that may
-// result from its use. No license is granted by implication or otherwise Under any patent
-// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
-// This code supersedes and replaces all information previously supplied.
-// NVIDIA Corporation products are not authorized for use as critical
-// components in life support devices or systems without express written approval of
-// NVIDIA Corporation.
-//
-// Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved.
-
-/*
-** Copyright (c) 2013-2016 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-*/
-
-
-/// @file glfuncdef.h
-/// this is our internal OpenGL function header define
-
-#ifndef __gl_func_def_h_
-#define __gl_func_def_h_
-
-#include <GLES2/gl2platform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*-------------------------------------------------------------------------
- * GL2 core functions.
- *-----------------------------------------------------------------------*/
-
-GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name);
-GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
-GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
-GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
-GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
-GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
-GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
-GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
-GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
-GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
-GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
-GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glDrawBuffers( GLsizei n, const GLenum *bufs);
-GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
-GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
-GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
-GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
-GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
-GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const char* name);
-GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
-GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
-GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
-GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
-GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
-GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const char* name);
-GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer);
-GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length);
-GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
-GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
-GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
-GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
-GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
-GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
-GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
-GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
-
-/*-------------------------------------------------------------------------
- * GL3 core functions.
- *-----------------------------------------------------------------------*/
-
-GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
-GL_APICALL void GL_APIENTRY glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
-GL_APICALL void GL_APIENTRY glBindFragDataLocation (GLuint program, GLuint colorNumber, const GLchar * name);
-GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
-GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
-GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
-GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GL_APICALL void GL_APIENTRY glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GL_APICALL void GL_APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
-GL_APICALL const GLubyte* GL_APIENTRY glGetStringi (GLenum name, GLuint index);
-GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex( GLuint program, const GLchar *uniformBlockName);
-GL_APICALL GLvoid* GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GL_APICALL void GL_APIENTRY glQueryCounter (GLuint id, GLenum target);
-GL_APICALL void GL_APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
-GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
-GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-
-/*-------------------------------------------------------------------------
- * GL4 core functions.
- *-----------------------------------------------------------------------*/
-
-GL_APICALL void GL_APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GL_APICALL void GL_APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-GL_APICALL void GL_APIENTRY glBindProgramPipeline (GLuint pipeline);
-GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
-GL_APICALL void GL_APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-GL_APICALL void GL_APIENTRY glDispatchComputeIndirect (GLintptr indirect);
-GL_APICALL void GL_APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
-GL_APICALL void GL_APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
-GL_APICALL void GL_APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GL_APICALL void GL_APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val );
-GL_APICALL void GL_APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
-GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GL_APICALL void GL_APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GL_APICALL GLuint GL_APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
-GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
-GL_APICALL void GL_APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
-GL_APICALL void GL_APIENTRY glMemoryBarrier (GLbitfield barriers);
-GL_APICALL void GL_APIENTRY glMinSampleShading (GLfloat value );
-GL_APICALL void GL_APIENTRY glPatchParameteri (GLenum pname, GLint value );
-GL_APICALL void GL_APIENTRY glPatchParameterfv (GLenum pname, GLint value );
-GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void GL_APIENTRY glTexStorage2DMultisample (GLint target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-GL_APICALL void GL_APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GL_APICALL void GL_APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GL_APICALL void GL_APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GL_APICALL void GL_APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GL_APICALL void GL_APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GL_APICALL void GL_APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GL_APICALL void GL_APIENTRY glValidateProgramPipeline (GLuint pipeline);
-
-
-/*-------------------------------------------------------------------------
- * GL4 NV extensions
- *-----------------------------------------------------------------------*/
-
-GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range);
-GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
-GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path);
-GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
-GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString);
-GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
-GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);
-GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);
-GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);
-GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);
-GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);
-GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
-GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);
-GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);
-GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func);
-GL_APICALL void GL_APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
-GL_APICALL void GL_APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
-GL_APICALL void GL_APIENTRY glPathFogGenNV (GLenum genMode);
-GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);
-GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);
-GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);
-GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);
-GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);
-GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
-GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-GL_APICALL void GL_APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value);
-GL_APICALL void GL_APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value);
-GL_APICALL void GL_APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value);
-GL_APICALL void GL_APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value);
-GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
-GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
-GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
-GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
-GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
-GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
-GL_APICALL void GL_APIENTRY glMatrixLoadf (GLenum mode, const GLfloat *m);
-GL_APICALL void GL_APIENTRY glBlendBarrierNV( void );
-GL_APICALL void GL_APIENTRY glBlendParameteriNV( GLenum pname, GLint value );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gl_func_def_h_ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glu.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glu.h
deleted file mode 100644
index 54bc52bc..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glu.h
+++ /dev/null
@@ -1,607 +0,0 @@
-/*++ BUILD Version: 0004 // Increment this if a change has global effects
-
-Copyright (c) 1985-95, Microsoft Corporation
-
-Module Name:
-
- glu.h
-
-Abstract:
-
- Procedure declarations, constant definitions and macros for the OpenGL
- Utility Library.
-
---*/
-
-#ifndef __glu_h__
-#ifndef __GLU_H__
-
-#define __glu_h__
-#define __GLU_H__
-
-#include <GL/gl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright 1991-1993, Silicon Graphics, Inc.
-** All Rights Reserved.
-**
-** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
-** the contents of this file may not be disclosed to third parties, copied or
-** duplicated in any form, in whole or in part, without the prior written
-** permission of Silicon Graphics, Inc.
-**
-** RESTRICTED RIGHTS LEGEND:
-** Use, duplication or disclosure by the Government is subject to restrictions
-** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
-** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
-** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
-** rights reserved under the Copyright Laws of the United States.
-*/
-
-/*
-** Return the error string associated with a particular error code.
-** This will return 0 for an invalid error code.
-**
-** The generic function prototype that can be compiled for ANSI or Unicode
-** is defined as follows:
-**
-** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
-*/
-#ifdef UNICODE
-#define gluErrorStringWIN(errCode) ((LPCSTR) gluErrorUnicodeStringEXT(errCode))
-#else
-#define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
-#endif
-
-/* XXX APIENTRY and CALLBACK defined added by aritger */
-#ifndef APIENTRY
-# define APIENTRY
-#endif
-
-#ifndef CALLBACK
-# define CALLBACK
-#endif
-
-const GLubyte* APIENTRY gluErrorString (
- GLenum errCode);
-
-/* XXX aritger: gluErrorUnicodeStringEXT() appears to be a MicroSoft addition */
-#if defined(_WIN32)
-const wchar_t* APIENTRY gluErrorUnicodeStringEXT (
- GLenum errCode);
-#endif
-
-const GLubyte* APIENTRY gluGetString (
- GLenum name);
-
-void APIENTRY gluOrtho2D (
- GLdouble left,
- GLdouble right,
- GLdouble bottom,
- GLdouble top);
-
-void APIENTRY gluPerspective (
- GLdouble fovy,
- GLdouble aspect,
- GLdouble zNear,
- GLdouble zFar);
-
-void APIENTRY gluPickMatrix (
- GLdouble x,
- GLdouble y,
- GLdouble width,
- GLdouble height,
- GLint viewport[4]);
-
-void APIENTRY gluLookAt (
- GLdouble eyex,
- GLdouble eyey,
- GLdouble eyez,
- GLdouble centerx,
- GLdouble centery,
- GLdouble centerz,
- GLdouble upx,
- GLdouble upy,
- GLdouble upz);
-
-int APIENTRY gluProject (
- GLdouble objx,
- GLdouble objy,
- GLdouble objz,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLdouble *winx,
- GLdouble *winy,
- GLdouble *winz);
-
-int APIENTRY gluUnProject (
- GLdouble winx,
- GLdouble winy,
- GLdouble winz,
- const GLdouble modelMatrix[16],
- const GLdouble projMatrix[16],
- const GLint viewport[4],
- GLdouble *objx,
- GLdouble *objy,
- GLdouble *objz);
-
-
-int APIENTRY gluScaleImage (
- GLenum format,
- GLint widthin,
- GLint heightin,
- GLenum typein,
- const void *datain,
- GLint widthout,
- GLint heightout,
- GLenum typeout,
- void *dataout);
-
-
-int APIENTRY gluBuild1DMipmaps (
- GLenum target,
- GLint components,
- GLint width,
- GLenum format,
- GLenum type,
- const void *data);
-
-int APIENTRY gluBuild2DMipmaps (
- GLenum target,
- GLint components,
- GLint width,
- GLint height,
- GLenum format,
- GLenum type,
- const void *data);
-
-#ifdef __cplusplus
-
-class GLUnurbs;
-class GLUquadric;
-class GLUtesselator;
-
-/* backwards compatibility: */
-typedef class GLUnurbs GLUnurbsObj;
-typedef class GLUquadric GLUquadricObj;
-typedef class GLUtesselator GLUtesselatorObj;
-typedef class GLUtesselator GLUtriangulatorObj;
-
-#else
-
-typedef struct GLUnurbs GLUnurbs;
-typedef struct GLUquadric GLUquadric;
-typedef struct GLUtesselator GLUtesselator;
-
-/* backwards compatibility: */
-typedef struct GLUnurbs GLUnurbsObj;
-typedef struct GLUquadric GLUquadricObj;
-typedef struct GLUtesselator GLUtesselatorObj;
-typedef struct GLUtesselator GLUtriangulatorObj;
-
-#endif
-
-// (NVIDIA change: pbrown) GLUcallbackFuncPtr is a general-purpose function
-// pointer type for GLU callbacks. We declare a "void" argument list in the
-// prototype as a least-common-denominator to avoid "function declaration
-// isn't a prototype" warnings from GCC (which until late 2010 didn't have a
-// good way to temporarily change warning state via #pragma). Most, but not
-// all, GLU callbacks do take one or more arguments, so will likely need
-// manual casts. The fundamental problem is that the actual argument list is
-// typically a function of the <which> argument in the
-// glu{Tess,Nurbs}Callback, so there is no good way to check for correctness
-// at compile time.
-typedef void (CALLBACK* GLUcallbackFuncPtr)(void);
-
-GLUquadric* APIENTRY gluNewQuadric (void);
-void APIENTRY gluDeleteQuadric (
- GLUquadric *state);
-
-void APIENTRY gluQuadricNormals (
- GLUquadric *quadObject,
- GLenum normals);
-
-void APIENTRY gluQuadricTexture (
- GLUquadric *quadObject,
- GLboolean textureCoords);
-
-void APIENTRY gluQuadricOrientation (
- GLUquadric *quadObject,
- GLenum orientation);
-
-void APIENTRY gluQuadricDrawStyle (
- GLUquadric *quadObject,
- GLenum drawStyle);
-
-void APIENTRY gluCylinder (
- GLUquadric *qobj,
- GLdouble baseRadius,
- GLdouble topRadius,
- GLdouble height,
- GLint slices,
- GLint stacks);
-
-void APIENTRY gluDisk (
- GLUquadric *qobj,
- GLdouble innerRadius,
- GLdouble outerRadius,
- GLint slices,
- GLint loops);
-
-void APIENTRY gluPartialDisk (
- GLUquadric *qobj,
- GLdouble innerRadius,
- GLdouble outerRadius,
- GLint slices,
- GLint loops,
- GLdouble startAngle,
- GLdouble sweepAngle);
-
-void APIENTRY gluSphere (
- GLUquadric *qobj,
- GLdouble radius,
- GLint slices,
- GLint stacks);
-
-void APIENTRY gluQuadricCallback (
- GLUquadric *qobj,
- GLenum which,
- GLUcallbackFuncPtr fn );
-
-GLUtesselator* APIENTRY gluNewTess(
- void );
-
-void APIENTRY gluDeleteTess(
- GLUtesselator *tess );
-
-void APIENTRY gluTessBeginPolygon(
- GLUtesselator *tess,
- void *polygon_data );
-
-void APIENTRY gluTessBeginContour(
- GLUtesselator *tess );
-
-void APIENTRY gluTessVertex(
- GLUtesselator *tess,
- GLdouble coords[3],
- void *data );
-
-void APIENTRY gluTessEndContour(
- GLUtesselator *tess );
-
-void APIENTRY gluTessEndPolygon(
- GLUtesselator *tess );
-
-void APIENTRY gluTessProperty(
- GLUtesselator *tess,
- GLenum which,
- GLdouble value );
-
-void APIENTRY gluTessNormal(
- GLUtesselator *tess,
- GLdouble x,
- GLdouble y,
- GLdouble z );
-
-void APIENTRY gluTessCallback(
- GLUtesselator *tess,
- GLenum which,
- GLUcallbackFuncPtr fn );
-
-void APIENTRY gluGetTessProperty(
- GLUtesselator *tess,
- GLenum which,
- GLdouble *value );
-
-GLUnurbs* APIENTRY gluNewNurbsRenderer (void);
-
-void APIENTRY gluDeleteNurbsRenderer (
- GLUnurbs *nobj);
-
-void APIENTRY gluBeginSurface (
- GLUnurbs *nobj);
-
-void APIENTRY gluBeginCurve (
- GLUnurbs *nobj);
-
-void APIENTRY gluEndCurve (
- GLUnurbs *nobj);
-
-void APIENTRY gluEndSurface (
- GLUnurbs *nobj);
-
-void APIENTRY gluBeginTrim (
- GLUnurbs *nobj);
-
-void APIENTRY gluEndTrim (
- GLUnurbs *nobj);
-
-void APIENTRY gluPwlCurve (
- GLUnurbs *nobj,
- GLint count,
- GLfloat *array,
- GLint stride,
- GLenum type);
-
-void APIENTRY gluNurbsCurve (
- GLUnurbs *nobj,
- GLint nknots,
- GLfloat *knot,
- GLint stride,
- GLfloat *ctlarray,
- GLint order,
- GLenum type);
-
-void APIENTRY
-gluNurbsSurface(
- GLUnurbs *nobj,
- GLint sknot_count,
- float *sknot,
- GLint tknot_count,
- GLfloat *tknot,
- GLint s_stride,
- GLint t_stride,
- GLfloat *ctlarray,
- GLint sorder,
- GLint torder,
- GLenum type);
-
-void APIENTRY
-gluLoadSamplingMatrices (
- GLUnurbs *nobj,
- const GLfloat modelMatrix[16],
- const GLfloat projMatrix[16],
- const GLint viewport[4] );
-
-void APIENTRY
-gluNurbsProperty (
- GLUnurbs *nobj,
- GLenum property,
- GLfloat value );
-
-void APIENTRY
-gluGetNurbsProperty (
- GLUnurbs *nobj,
- GLenum property,
- GLfloat *value );
-
-void APIENTRY
-gluNurbsCallback (
- GLUnurbs *nobj,
- GLenum which,
- GLUcallbackFuncPtr fn );
-
-
-/**** Callback function prototypes ****/
-
-/* gluQuadricCallback */
-typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
-
-/* gluTessCallback */
-typedef void (CALLBACK* GLUtessBeginProc) (GLenum);
-typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
-typedef void (CALLBACK* GLUtessVertexProc) (void *);
-typedef void (CALLBACK* GLUtessEndProc) (void);
-typedef void (CALLBACK* GLUtessErrorProc) (GLenum);
-typedef void (CALLBACK* GLUtessCombineProc) (GLdouble[3],
- void*[4],
- GLfloat[4],
- void** );
-typedef void (CALLBACK* GLUtessBeginDataProc) (GLenum, void *);
-typedef void (CALLBACK* GLUtessEdgeFlagDataProc) (GLboolean, void *);
-typedef void (CALLBACK* GLUtessVertexDataProc) (void *, void *);
-typedef void (CALLBACK* GLUtessEndDataProc) (void *);
-typedef void (CALLBACK* GLUtessErrorDataProc) (GLenum, void *);
-typedef void (CALLBACK* GLUtessCombineDataProc) (GLdouble[3],
- void*[4],
- GLfloat[4],
- void**,
- void* );
-
-/* gluNurbsCallback */
-typedef void (CALLBACK* GLUnurbsErrorProc) (GLenum);
-
-
-/**** Generic constants ****/
-
-/* Version */
-#define GLU_VERSION_1_1 1
-#define GLU_VERSION_1_2 1
-
-/* Errors: (return value 0 = no error) */
-#define GLU_INVALID_ENUM 100900
-#define GLU_INVALID_VALUE 100901
-#define GLU_OUT_OF_MEMORY 100902
-#define GLU_INCOMPATIBLE_GL_VERSION 100903
-
-/* StringName */
-#define GLU_VERSION 100800
-#define GLU_EXTENSIONS 100801
-
-/* Boolean */
-#define GLU_TRUE GL_TRUE
-#define GLU_FALSE GL_FALSE
-
-
-/**** Quadric constants ****/
-
-/* QuadricNormal */
-#define GLU_SMOOTH 100000
-#define GLU_FLAT 100001
-#define GLU_NONE 100002
-
-/* QuadricDrawStyle */
-#define GLU_POINT 100010
-#define GLU_LINE 100011
-#define GLU_FILL 100012
-#define GLU_SILHOUETTE 100013
-
-/* QuadricOrientation */
-#define GLU_OUTSIDE 100020
-#define GLU_INSIDE 100021
-
-/* Callback types: */
-/* GLU_ERROR 100103 */
-
-
-/**** Tesselation constants ****/
-
-#define GLU_TESS_MAX_COORD 1.0e150
-
-/* TessProperty */
-#define GLU_TESS_WINDING_RULE 100140
-#define GLU_TESS_BOUNDARY_ONLY 100141
-#define GLU_TESS_TOLERANCE 100142
-
-/* TessWinding */
-#define GLU_TESS_WINDING_ODD 100130
-#define GLU_TESS_WINDING_NONZERO 100131
-#define GLU_TESS_WINDING_POSITIVE 100132
-#define GLU_TESS_WINDING_NEGATIVE 100133
-#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
-
-/* TessCallback */
-#define GLU_TESS_BEGIN 100100 /* void (CALLBACK*)(GLenum type) */
-#define GLU_TESS_VERTEX 100101 /* void (CALLBACK*)(void *data) */
-#define GLU_TESS_END 100102 /* void (CALLBACK*)(void) */
-#define GLU_TESS_ERROR 100103 /* void (CALLBACK*)(GLenum errno) */
-#define GLU_TESS_EDGE_FLAG 100104 /* void (CALLBACK*)(GLboolean boundaryEdge) */
-#define GLU_TESS_COMBINE 100105 /* void (CALLBACK*)(GLdouble coords[3],
- void *data[4],
- GLfloat weight[4],
- void **dataOut) */
-#define GLU_TESS_BEGIN_DATA 100106 /* void (CALLBACK*)(GLenum type,
- void *polygon_data) */
-#define GLU_TESS_VERTEX_DATA 100107 /* void (CALLBACK*)(void *data,
- void *polygon_data) */
-#define GLU_TESS_END_DATA 100108 /* void (CALLBACK*)(void *polygon_data) */
-#define GLU_TESS_ERROR_DATA 100109 /* void (CALLBACK*)(GLenum errno,
- void *polygon_data) */
-#define GLU_TESS_EDGE_FLAG_DATA 100110 /* void (CALLBACK*)(GLboolean boundaryEdge,
- void *polygon_data) */
-#define GLU_TESS_COMBINE_DATA 100111 /* void (CALLBACK*)(GLdouble coords[3],
- void *data[4],
- GLfloat weight[4],
- void **dataOut,
- void *polygon_data) */
-
-/* TessError */
-#define GLU_TESS_ERROR1 100151
-#define GLU_TESS_ERROR2 100152
-#define GLU_TESS_ERROR3 100153
-#define GLU_TESS_ERROR4 100154
-#define GLU_TESS_ERROR5 100155
-#define GLU_TESS_ERROR6 100156
-#define GLU_TESS_ERROR7 100157
-#define GLU_TESS_ERROR8 100158
-
-#define GLU_TESS_MISSING_BEGIN_POLYGON GLU_TESS_ERROR1
-#define GLU_TESS_MISSING_BEGIN_CONTOUR GLU_TESS_ERROR2
-#define GLU_TESS_MISSING_END_POLYGON GLU_TESS_ERROR3
-#define GLU_TESS_MISSING_END_CONTOUR GLU_TESS_ERROR4
-#define GLU_TESS_COORD_TOO_LARGE GLU_TESS_ERROR5
-#define GLU_TESS_NEED_COMBINE_CALLBACK GLU_TESS_ERROR6
-
-/**** NURBS constants ****/
-
-/* NurbsProperty */
-#define GLU_AUTO_LOAD_MATRIX 100200
-#define GLU_CULLING 100201
-#define GLU_SAMPLING_TOLERANCE 100203
-#define GLU_DISPLAY_MODE 100204
-#define GLU_PARAMETRIC_TOLERANCE 100202
-#define GLU_SAMPLING_METHOD 100205
-#define GLU_U_STEP 100206
-#define GLU_V_STEP 100207
-
-/* NurbsSampling */
-#define GLU_PATH_LENGTH 100215
-#define GLU_PARAMETRIC_ERROR 100216
-#define GLU_DOMAIN_DISTANCE 100217
-
-
-/* NurbsTrim */
-#define GLU_MAP1_TRIM_2 100210
-#define GLU_MAP1_TRIM_3 100211
-
-/* NurbsDisplay */
-/* GLU_FILL 100012 */
-#define GLU_OUTLINE_POLYGON 100240
-#define GLU_OUTLINE_PATCH 100241
-
-/* NurbsCallback */
-/* GLU_ERROR 100103 */
-
-/* NurbsErrors */
-#define GLU_NURBS_ERROR1 100251
-#define GLU_NURBS_ERROR2 100252
-#define GLU_NURBS_ERROR3 100253
-#define GLU_NURBS_ERROR4 100254
-#define GLU_NURBS_ERROR5 100255
-#define GLU_NURBS_ERROR6 100256
-#define GLU_NURBS_ERROR7 100257
-#define GLU_NURBS_ERROR8 100258
-#define GLU_NURBS_ERROR9 100259
-#define GLU_NURBS_ERROR10 100260
-#define GLU_NURBS_ERROR11 100261
-#define GLU_NURBS_ERROR12 100262
-#define GLU_NURBS_ERROR13 100263
-#define GLU_NURBS_ERROR14 100264
-#define GLU_NURBS_ERROR15 100265
-#define GLU_NURBS_ERROR16 100266
-#define GLU_NURBS_ERROR17 100267
-#define GLU_NURBS_ERROR18 100268
-#define GLU_NURBS_ERROR19 100269
-#define GLU_NURBS_ERROR20 100270
-#define GLU_NURBS_ERROR21 100271
-#define GLU_NURBS_ERROR22 100272
-#define GLU_NURBS_ERROR23 100273
-#define GLU_NURBS_ERROR24 100274
-#define GLU_NURBS_ERROR25 100275
-#define GLU_NURBS_ERROR26 100276
-#define GLU_NURBS_ERROR27 100277
-#define GLU_NURBS_ERROR28 100278
-#define GLU_NURBS_ERROR29 100279
-#define GLU_NURBS_ERROR30 100280
-#define GLU_NURBS_ERROR31 100281
-#define GLU_NURBS_ERROR32 100282
-#define GLU_NURBS_ERROR33 100283
-#define GLU_NURBS_ERROR34 100284
-#define GLU_NURBS_ERROR35 100285
-#define GLU_NURBS_ERROR36 100286
-#define GLU_NURBS_ERROR37 100287
-
-/**** Backwards compatibility for old tesselator ****/
-
-void APIENTRY gluBeginPolygon( GLUtesselator *tess );
-
-void APIENTRY gluNextContour( GLUtesselator *tess,
- GLenum type );
-
-void APIENTRY gluEndPolygon( GLUtesselator *tess );
-
-/* Contours types -- obsolete! */
-#define GLU_CW 100120
-#define GLU_CCW 100121
-#define GLU_INTERIOR 100122
-#define GLU_EXTERIOR 100123
-#define GLU_UNKNOWN 100124
-
-/* Names without "TESS_" prefix */
-#define GLU_BEGIN GLU_TESS_BEGIN
-#define GLU_VERTEX GLU_TESS_VERTEX
-#define GLU_END GLU_TESS_END
-#define GLU_ERROR GLU_TESS_ERROR
-#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __GLU_H__ */
-#endif /* __glu_h__ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glut.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glut.h
deleted file mode 100644
index 65fd748d..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glut.h
+++ /dev/null
@@ -1,771 +0,0 @@
-#ifndef __glut_h__
-#define __glut_h__
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998, 2000. */
-
-/* This program is freely distributable without licensing fees and is
- provided without guarantee or warrantee expressed or implied. This
- program is -not- in the public domain. */
-
-#ifdef _WIN32
-
-/* GLUT 3.7 now tries to avoid including <windows.h>
- to avoid name space pollution, but Win32's <GL/gl.h>
- needs APIENTRY and WINGDIAPI defined properly. */
-# if 0
- /* This would put tons of macros and crap in our clean name space. */
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# else
- /* XXX This is from Win32's <windef.h> */
-# ifndef APIENTRY
-# define GLUT_APIENTRY_DEFINED
- /* Cygwin and MingW32 are two free GNU-based Open Source compilation
- environments for Win32. Note that __CYGWIN32__ is deprecated
- in favor of simply __CYGWIN__. */
-# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
-# ifdef i386
-# define APIENTRY __attribute__ ((stdcall))
-# else
-# define APIENTRY
-# endif
-# else
-# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
-# define APIENTRY __stdcall
-# else
-# define APIENTRY
-# endif
-# endif
-# endif
- /* XXX This is from Win32's <winnt.h> */
-# ifndef CALLBACK
-# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
-# define CALLBACK __attribute__ ((stdcall))
-# else
-# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64)) && !defined(MIDL_PASS)
-# define CALLBACK __stdcall
-# else
-# define CALLBACK
-# endif
-# endif
-# endif
- /* XXX This is from Win32's <wingdi.h> and <winnt.h> */
-# ifndef WINGDIAPI
-# define GLUT_WINGDIAPI_DEFINED
-# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
-# define WINGDIAPI
-# else
-# define WINGDIAPI __declspec(dllimport)
-# endif
-# endif
-# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
- /* Rely on Cygwin32/MingW32 <stddef.h> to set wchar_t. */
- /* XXX Warning. The Cygwin32/MingW32 definition for wchar_t
- is an "int" instead of the "short" used by Windows. */
-# include <stddef.h>
-# else
- /* XXX This is from Win32's <ctype.h> */
-# ifndef _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-# define _WCHAR_T_DEFINED
-# endif
-# endif
-# endif
-
-/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
- in your compile preprocessor options. */
-# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
-# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
-# pragma comment (lib, "user32.lib") /* link with Windows User lib */
-# pragma comment (lib, "gdi32.lib") /* link with Windows GDI lib */
-/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
- define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
-# ifdef GLUT_USE_SGI_OPENGL
-# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
-# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
-# if defined(GLUT_STATIC_LIB)
-# pragma comment (lib, "glutstatic.lib") /* link with static Win32 GLUT lib */
-# else
-# pragma comment (lib, "glut.lib") /* link with Win32 GLUT lib */
-# endif
-# else
-# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
-# pragma comment (lib, "glustatic.lib") /* link with Microsoft OpenGL Utility lib */
-# if defined(GLUT_STATIC_LIB)
-# pragma comment (lib, "glutstatic.lib") /* link with static Win32 GLUT lib */
-# else
-# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
-# endif
-# endif
-# endif
-
-/* To disable supression of annoying warnings about floats being promoted
- to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
- options. */
-# if defined(_MSC_VER) && !defined(GLUT_NO_WARNING_DISABLE)
-# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
-# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
-# endif
-
-/* Win32 has an annoying issue where there are multiple C run-time
- libraries (CRTs). If the executable is linked with a different CRT
- from the GLUT DLL, the GLUT DLL will not share the same CRT static
- data seen by the executable. In particular, atexit callbacks registered
- in the executable will not be called if GLUT calls its (different)
- exit routine). GLUT is typically built with the
- "/MD" option (the CRT with multithreading DLL support), but the Visual
- C++ linker default is "/ML" (the single threaded CRT).
-
- One workaround to this issue is requiring users to always link with
- the same CRT as GLUT is compiled with. That requires users supply a
- non-standard option. GLUT 3.7 has its own built-in workaround where
- the executable's "exit" function pointer is covertly passed to GLUT.
- GLUT then calls the executable's exit function pointer to ensure that
- any "atexit" calls registered by the application are called if GLUT
- needs to exit.
-
- Note that the __glut*WithExit routines should NEVER be called directly.
- To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
-
-/* XXX This is from Win32's <process.h> */
-# if !defined(_MSC_VER) && !defined(__cdecl)
- /* Define __cdecl for non-Microsoft compilers. */
-# define __cdecl
-# define GLUT_DEFINED___CDECL
-# endif
-# ifndef _CRTIMP
-# ifdef _NTSDK
- /* Definition compatible with NT SDK */
-# define _CRTIMP
-# else
- /* Current definition */
-# ifdef _DLL
-# define _CRTIMP __declspec(dllimport)
-# else
-# define _CRTIMP
-# endif
-# endif
-# define GLUT_DEFINED__CRTIMP
-# endif
-
-/* GLUT API entry point declarations for Win32. */
-# ifdef GLUT_BUILDING_LIB
-# define GLUTAPI __declspec(dllexport)
-# else
-# ifdef _DLL
-# define GLUTAPI __declspec(dllimport)
-# else
-# define GLUTAPI extern
-# endif
-# endif
-
-/* GLUT callback calling convention for Win32. */
-# define GLUTCALLBACK __cdecl
-
-#endif /* _WIN32 */
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _WIN32
-# ifndef GLUT_BUILDING_LIB
-# if __BORLANDC__
-# if defined(_BUILDRTLDLL)
-void __cdecl __export exit(int __status);
-# else
-void __cdecl exit(int __status);
-# endif
-# else
-# if _MSC_VER >= 1200
- extern _CRTIMP __declspec(noreturn) void __cdecl exit(int);
-# else
- extern _CRTIMP void __cdecl exit(int);
-# endif
-# endif
-# endif
-#else
-/* non-Win32 case. */
-/* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */
-# define APIENTRY
-# define GLUT_APIENTRY_DEFINED
-# define CALLBACK
-/* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */
-# define GLUTAPI extern
-# define GLUTCALLBACK
-/* Prototype exit for the non-Win32 case (see above). */
-# ifdef __GNUC__
-extern void exit(int __status) __attribute__((__noreturn__));
-# else
-extern void exit(int);
-# endif
-#endif
-
-/**
- GLUT API revision history:
-
- GLUT_API_VERSION is updated to reflect incompatible GLUT
- API changes (interface changes, semantic changes, deletions,
- or additions).
-
- GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
-
- GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
- extension. Supports new input devices like tablet, dial and button
- box, and Spaceball. Easy to query OpenGL extensions.
-
- GLUT_API_VERSION=3 glutMenuStatus added.
-
- GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
- glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
- video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
- glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
- glutJoystickFunc, glutForceJoystickFunc, glutStrokeWidthf,
- glutStrokeLengthf (NOT FINALIZED!).
-**/
-#ifndef GLUT_API_VERSION /* allow this to be overriden */
-#define GLUT_API_VERSION 3
-#endif
-
-/**
- GLUT implementation revision history:
-
- GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
- API revisions and implementation revisions (ie, bug fixes).
-
- GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
- GLUT Xlib-based implementation. 11/29/94
-
- GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
- GLUT Xlib-based implementation providing GLUT version 2
- interfaces.
-
- GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
-
- GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
-
- GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
-
- GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
-
- GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
- and video resize. 1/3/97
-
- GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
-
- GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
-
- GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
-
- GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
-
- GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
-
- GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
-
- GLUT_XLIB_IMPLEMENTATION=16 mjk's early GLUT 3.8
-
- GLUT_XLIB_IMPLEMENTATION=17 mjk's GLUT 3.8 with glutStrokeWidthf and glutStrokeLengthf
-**/
-#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
-#define GLUT_XLIB_IMPLEMENTATION 17
-#endif
-
-/* Display mode bit masks. */
-#define GLUT_RGB 0
-#define GLUT_RGBA GLUT_RGB
-#define GLUT_INDEX 1
-#define GLUT_SINGLE 0
-#define GLUT_DOUBLE 2
-#define GLUT_ACCUM 4
-#define GLUT_ALPHA 8
-#define GLUT_DEPTH 16
-#define GLUT_STENCIL 32
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_MULTISAMPLE 128
-#define GLUT_STEREO 256
-#endif
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_LUMINANCE 512
-#endif
-
-/* Mouse buttons. */
-#define GLUT_LEFT_BUTTON 0
-#define GLUT_MIDDLE_BUTTON 1
-#define GLUT_RIGHT_BUTTON 2
-
-/* Mouse button state. */
-#define GLUT_DOWN 0
-#define GLUT_UP 1
-
-#if (GLUT_API_VERSION >= 2)
-/* function keys */
-#define GLUT_KEY_F1 1
-#define GLUT_KEY_F2 2
-#define GLUT_KEY_F3 3
-#define GLUT_KEY_F4 4
-#define GLUT_KEY_F5 5
-#define GLUT_KEY_F6 6
-#define GLUT_KEY_F7 7
-#define GLUT_KEY_F8 8
-#define GLUT_KEY_F9 9
-#define GLUT_KEY_F10 10
-#define GLUT_KEY_F11 11
-#define GLUT_KEY_F12 12
-/* directional keys */
-#define GLUT_KEY_LEFT 100
-#define GLUT_KEY_UP 101
-#define GLUT_KEY_RIGHT 102
-#define GLUT_KEY_DOWN 103
-#define GLUT_KEY_PAGE_UP 104
-#define GLUT_KEY_PAGE_DOWN 105
-#define GLUT_KEY_HOME 106
-#define GLUT_KEY_END 107
-#define GLUT_KEY_INSERT 108
-#endif
-
-/* Entry/exit state. */
-#define GLUT_LEFT 0
-#define GLUT_ENTERED 1
-
-/* Menu usage state. */
-#define GLUT_MENU_NOT_IN_USE 0
-#define GLUT_MENU_IN_USE 1
-
-/* Visibility state. */
-#define GLUT_NOT_VISIBLE 0
-#define GLUT_VISIBLE 1
-
-/* Window status state. */
-#define GLUT_HIDDEN 0
-#define GLUT_FULLY_RETAINED 1
-#define GLUT_PARTIALLY_RETAINED 2
-#define GLUT_FULLY_COVERED 3
-
-/* Color index component selection values. */
-#define GLUT_RED 0
-#define GLUT_GREEN 1
-#define GLUT_BLUE 2
-
-#ifdef _WIN32
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN ((void*)0)
-#define GLUT_STROKE_MONO_ROMAN ((void*)1)
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 ((void*)2)
-#define GLUT_BITMAP_8_BY_13 ((void*)3)
-#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
-#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
-#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
-#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
-#endif
-#else
-/* Stroke font opaque addresses (use constants instead in source code). */
-GLUTAPI void *glutStrokeRoman;
-GLUTAPI void *glutStrokeMonoRoman;
-
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
-#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
-
-/* Bitmap font opaque addresses (use constants instead in source code). */
-GLUTAPI void *glutBitmap9By15;
-GLUTAPI void *glutBitmap8By13;
-GLUTAPI void *glutBitmapTimesRoman10;
-GLUTAPI void *glutBitmapTimesRoman24;
-GLUTAPI void *glutBitmapHelvetica10;
-GLUTAPI void *glutBitmapHelvetica12;
-GLUTAPI void *glutBitmapHelvetica18;
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
-#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
-#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
-#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
-#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
-#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
-#endif
-#endif
-
-/* glutGet parameters. */
-#define GLUT_WINDOW_X ((GLenum) 100)
-#define GLUT_WINDOW_Y ((GLenum) 101)
-#define GLUT_WINDOW_WIDTH ((GLenum) 102)
-#define GLUT_WINDOW_HEIGHT ((GLenum) 103)
-#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104)
-#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105)
-#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106)
-#define GLUT_WINDOW_RED_SIZE ((GLenum) 107)
-#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108)
-#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109)
-#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110)
-#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111)
-#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112)
-#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113)
-#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114)
-#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115)
-#define GLUT_WINDOW_RGBA ((GLenum) 116)
-#define GLUT_WINDOW_PARENT ((GLenum) 117)
-#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118)
-#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119)
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120)
-#define GLUT_WINDOW_STEREO ((GLenum) 121)
-#endif
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_WINDOW_CURSOR ((GLenum) 122)
-#endif
-#define GLUT_SCREEN_WIDTH ((GLenum) 200)
-#define GLUT_SCREEN_HEIGHT ((GLenum) 201)
-#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202)
-#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203)
-#define GLUT_MENU_NUM_ITEMS ((GLenum) 300)
-#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400)
-#define GLUT_INIT_WINDOW_X ((GLenum) 500)
-#define GLUT_INIT_WINDOW_Y ((GLenum) 501)
-#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502)
-#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503)
-#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504)
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_ELAPSED_TIME ((GLenum) 700)
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123)
-#endif
-
-#if (GLUT_API_VERSION >= 2)
-/* glutDeviceGet parameters. */
-#define GLUT_HAS_KEYBOARD ((GLenum) 600)
-#define GLUT_HAS_MOUSE ((GLenum) 601)
-#define GLUT_HAS_SPACEBALL ((GLenum) 602)
-#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603)
-#define GLUT_HAS_TABLET ((GLenum) 604)
-#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605)
-#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606)
-#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607)
-#define GLUT_NUM_DIALS ((GLenum) 608)
-#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609)
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610)
-#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611)
-#define GLUT_HAS_JOYSTICK ((GLenum) 612)
-#define GLUT_OWNS_JOYSTICK ((GLenum) 613)
-#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614)
-#define GLUT_JOYSTICK_AXES ((GLenum) 615)
-#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616)
-#endif
-
-#if (GLUT_API_VERSION >= 3)
-/* glutLayerGet parameters. */
-#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800)
-#define GLUT_LAYER_IN_USE ((GLenum) 801)
-#define GLUT_HAS_OVERLAY ((GLenum) 802)
-#define GLUT_TRANSPARENT_INDEX ((GLenum) 803)
-#define GLUT_NORMAL_DAMAGED ((GLenum) 804)
-#define GLUT_OVERLAY_DAMAGED ((GLenum) 805)
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-/* glutVideoResizeGet parameters. */
-#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900)
-#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901)
-#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902)
-#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903)
-#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904)
-#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905)
-#define GLUT_VIDEO_RESIZE_X ((GLenum) 906)
-#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907)
-#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908)
-#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909)
-#endif
-
-/* glutUseLayer parameters. */
-#define GLUT_NORMAL ((GLenum) 0)
-#define GLUT_OVERLAY ((GLenum) 1)
-
-/* glutGetModifiers return mask. */
-#define GLUT_ACTIVE_SHIFT 1
-#define GLUT_ACTIVE_CTRL 2
-#define GLUT_ACTIVE_ALT 4
-
-/* glutSetCursor parameters. */
-/* Basic arrows. */
-#define GLUT_CURSOR_RIGHT_ARROW 0
-#define GLUT_CURSOR_LEFT_ARROW 1
-/* Symbolic cursor shapes. */
-#define GLUT_CURSOR_INFO 2
-#define GLUT_CURSOR_DESTROY 3
-#define GLUT_CURSOR_HELP 4
-#define GLUT_CURSOR_CYCLE 5
-#define GLUT_CURSOR_SPRAY 6
-#define GLUT_CURSOR_WAIT 7
-#define GLUT_CURSOR_TEXT 8
-#define GLUT_CURSOR_CROSSHAIR 9
-/* Directional cursors. */
-#define GLUT_CURSOR_UP_DOWN 10
-#define GLUT_CURSOR_LEFT_RIGHT 11
-/* Sizing cursors. */
-#define GLUT_CURSOR_TOP_SIDE 12
-#define GLUT_CURSOR_BOTTOM_SIDE 13
-#define GLUT_CURSOR_LEFT_SIDE 14
-#define GLUT_CURSOR_RIGHT_SIDE 15
-#define GLUT_CURSOR_TOP_LEFT_CORNER 16
-#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
-#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
-#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
-/* Inherit from parent window. */
-#define GLUT_CURSOR_INHERIT 100
-/* Blank cursor. */
-#define GLUT_CURSOR_NONE 101
-/* Fullscreen crosshair (if available). */
-#define GLUT_CURSOR_FULL_CROSSHAIR 102
-#endif
-
-/* GLUT initialization sub-API. */
-GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI void APIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static void APIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
-#define glutInit glutInit_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void APIENTRY glutInitDisplayString(const char *string);
-#endif
-GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
-GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
-GLUTAPI void APIENTRY glutMainLoop(void);
-
-/* GLUT window sub-API. */
-GLUTAPI int APIENTRY glutCreateWindow(const char *title);
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static int APIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
-#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
-GLUTAPI void APIENTRY glutDestroyWindow(int win);
-GLUTAPI void APIENTRY glutPostRedisplay(void);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
-GLUTAPI void APIENTRY glutPostWindowRedisplay(int win);
-#endif
-GLUTAPI void APIENTRY glutSwapBuffers(void);
-GLUTAPI int APIENTRY glutGetWindow(void);
-GLUTAPI void APIENTRY glutSetWindow(int win);
-GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
-GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
-GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
-GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
-GLUTAPI void APIENTRY glutPopWindow(void);
-GLUTAPI void APIENTRY glutPushWindow(void);
-GLUTAPI void APIENTRY glutIconifyWindow(void);
-GLUTAPI void APIENTRY glutShowWindow(void);
-GLUTAPI void APIENTRY glutHideWindow(void);
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI void APIENTRY glutFullScreen(void);
-GLUTAPI void APIENTRY glutSetCursor(int cursor);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void APIENTRY glutWarpPointer(int x, int y);
-#endif
-
-/* GLUT overlay sub-API. */
-GLUTAPI void APIENTRY glutEstablishOverlay(void);
-GLUTAPI void APIENTRY glutRemoveOverlay(void);
-GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
-GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
-GLUTAPI void APIENTRY glutPostWindowOverlayRedisplay(int win);
-#endif
-GLUTAPI void APIENTRY glutShowOverlay(void);
-GLUTAPI void APIENTRY glutHideOverlay(void);
-#endif
-
-/* GLUT menu sub-API. */
-GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI int APIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static int APIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
-#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI void APIENTRY glutDestroyMenu(int menu);
-GLUTAPI int APIENTRY glutGetMenu(void);
-GLUTAPI void APIENTRY glutSetMenu(int menu);
-GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
-GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
-GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
-GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
-GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
-GLUTAPI void APIENTRY glutAttachMenu(int button);
-GLUTAPI void APIENTRY glutDetachMenu(int button);
-
-/* GLUT window callback sub-API. */
-GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
-GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
-GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
-GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
-GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
-GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
-GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
-GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
-GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
-#if (GLUT_API_VERSION >= 2)
-GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
-GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
-GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
-GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
-GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
-GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
-GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
-GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
-#endif
-#endif
-#endif
-
-/* GLUT color index sub-API. */
-GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
-GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
-GLUTAPI void APIENTRY glutCopyColormap(int win);
-
-/* GLUT state retrieval sub-API. */
-GLUTAPI int APIENTRY glutGet(GLenum type);
-GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
-#if (GLUT_API_VERSION >= 2)
-/* GLUT extension support sub-API */
-GLUTAPI int APIENTRY glutExtensionSupported(const char *name);
-#endif
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI int APIENTRY glutGetModifiers(void);
-GLUTAPI int APIENTRY glutLayerGet(GLenum type);
-#endif
-
-/* GLUT font sub-API */
-GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
-GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI int APIENTRY glutBitmapLength(void *font, const unsigned char *string);
-GLUTAPI int APIENTRY glutStrokeLength(void *font, const unsigned char *string);
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 17)
-GLUTAPI float APIENTRY glutStrokeWidthf(void *font, int character);
-GLUTAPI float APIENTRY glutStrokeLengthf(void *font, const unsigned char *string);
-#endif
-
-/* GLUT pre-built models sub-API */
-GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCube(GLdouble size);
-GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
-GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutWireDodecahedron(void);
-GLUTAPI void APIENTRY glutSolidDodecahedron(void);
-GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutWireOctahedron(void);
-GLUTAPI void APIENTRY glutSolidOctahedron(void);
-GLUTAPI void APIENTRY glutWireTetrahedron(void);
-GLUTAPI void APIENTRY glutSolidTetrahedron(void);
-GLUTAPI void APIENTRY glutWireIcosahedron(void);
-GLUTAPI void APIENTRY glutSolidIcosahedron(void);
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-/* GLUT video resize sub-API. */
-GLUTAPI int APIENTRY glutVideoResizeGet(GLenum param);
-GLUTAPI void APIENTRY glutSetupVideoResizing(void);
-GLUTAPI void APIENTRY glutStopVideoResizing(void);
-GLUTAPI void APIENTRY glutVideoResize(int x, int y, int width, int height);
-GLUTAPI void APIENTRY glutVideoPan(int x, int y, int width, int height);
-
-/* GLUT debugging sub-API. */
-GLUTAPI void APIENTRY glutReportErrors(void);
-#endif
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-/* GLUT device control sub-API. */
-/* glutSetKeyRepeat modes. */
-#define GLUT_KEY_REPEAT_OFF 0
-#define GLUT_KEY_REPEAT_ON 1
-#define GLUT_KEY_REPEAT_DEFAULT 2
-
-/* Joystick button masks. */
-#define GLUT_JOYSTICK_BUTTON_A 1
-#define GLUT_JOYSTICK_BUTTON_B 2
-#define GLUT_JOYSTICK_BUTTON_C 4
-#define GLUT_JOYSTICK_BUTTON_D 8
-
-GLUTAPI void APIENTRY glutIgnoreKeyRepeat(int ignore);
-GLUTAPI void APIENTRY glutSetKeyRepeat(int repeatMode);
-GLUTAPI void APIENTRY glutForceJoystickFunc(void);
-
-/* GLUT game mode sub-API. */
-/* glutGameModeGet. */
-#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0)
-#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1)
-#define GLUT_GAME_MODE_WIDTH ((GLenum) 2)
-#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3)
-#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4)
-#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5)
-#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6)
-
-GLUTAPI void APIENTRY glutGameModeString(const char *string);
-GLUTAPI int APIENTRY glutEnterGameMode(void);
-GLUTAPI void APIENTRY glutLeaveGameMode(void);
-GLUTAPI int APIENTRY glutGameModeGet(GLenum mode);
-#endif
-
-#ifdef __cplusplus
-}
-
-#endif
-
-#ifdef GLUT_APIENTRY_DEFINED
-# undef GLUT_APIENTRY_DEFINED
-# undef APIENTRY
-#endif
-
-#ifdef GLUT_WINGDIAPI_DEFINED
-# undef GLUT_WINGDIAPI_DEFINED
-# undef WINGDIAPI
-#endif
-
-#ifdef GLUT_DEFINED___CDECL
-# undef GLUT_DEFINED___CDECL
-# undef __cdecl
-#endif
-
-#ifdef GLUT_DEFINED__CRTIMP
-# undef GLUT_DEFINED__CRTIMP
-# undef _CRTIMP
-#endif
-
-#endif /* __glut_h__ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glx.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glx.h
deleted file mode 100644
index 66ad53c6..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glx.h
+++ /dev/null
@@ -1,357 +0,0 @@
-#ifndef __glx_h__
-#define __glx_h__
-
-/*
-** The contents of this file are subject to the GLX Public License Version 1.0
-** (the "License"). You may not use this file except in compliance with the
-** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
-** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
-** or at http://www.sgi.com/software/opensource/glx/license.html.
-**
-** Software distributed under the License is distributed on an "AS IS"
-** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
-** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
-** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
-** language governing rights and limitations under the License.
-**
-** The Original Software is GLX version 1.2 source code, released February,
-** 1999. The developer of the Original Software is Silicon Graphics, Inc.
-** Those portions of the Subject Software created by Silicon Graphics, Inc.
-** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
-**
-** $Header: //sw/main/drivers/OpenGL/win/glx/include/glx.h#21 $
-*/
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <GL/gl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Names for attributes to glXGetConfig.
- */
-#define GLX_USE_GL 1 /* support GLX rendering */
-#define GLX_BUFFER_SIZE 2 /* depth of the color buffer */
-#define GLX_LEVEL 3 /* level in plane stacking */
-#define GLX_RGBA 4 /* true if RGBA mode */
-#define GLX_DOUBLEBUFFER 5 /* double buffering supported */
-#define GLX_STEREO 6 /* stereo buffering supported */
-#define GLX_AUX_BUFFERS 7 /* number of aux buffers */
-#define GLX_RED_SIZE 8 /* number of red component bits */
-#define GLX_GREEN_SIZE 9 /* number of green component bits */
-#define GLX_BLUE_SIZE 10 /* number of blue component bits */
-#define GLX_ALPHA_SIZE 11 /* number of alpha component bits */
-#define GLX_DEPTH_SIZE 12 /* number of depth bits */
-#define GLX_STENCIL_SIZE 13 /* number of stencil bits */
-#define GLX_ACCUM_RED_SIZE 14 /* number of red accum bits */
-#define GLX_ACCUM_GREEN_SIZE 15 /* number of green accum bits */
-#define GLX_ACCUM_BLUE_SIZE 16 /* number of blue accum bits */
-#define GLX_ACCUM_ALPHA_SIZE 17 /* number of alpha accum bits */
-
-/*
- * Error return values from glXGetConfig. Success is indicated by
- * a value of 0.
- */
-#define GLX_BAD_SCREEN 1 /* screen # is bad */
-#define GLX_BAD_ATTRIBUTE 2 /* attribute to get is bad */
-#define GLX_NO_EXTENSION 3 /* no glx extension on server */
-#define GLX_BAD_VISUAL 4 /* visual # not known by GLX */
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-/*
- * Names for attributes to glXGetClientString.
- */
-#define GLX_VENDOR 0x1
-#define GLX_VERSION 0x2
-#define GLX_EXTENSIONS 0x3
-
-#ifndef GLX_VERSION_1_3
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
-#define GLX_AUX_BUFFERS_BIT 0x00000010
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_DONT_CARE 0xFFFFFFFF
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_VISUAL_ID 0x800B
-#define GLX_SCREEN 0x800C
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_PBUFFER_HEIGHT 0x8040
-#define GLX_PBUFFER_WIDTH 0x8041
-#endif
-
-#ifndef GLX_VERSION_1_4
-#define GLX_SAMPLE_BUFFERS 0x186a0
-#define GLX_SAMPLES 0x186a1
-#endif
-
-#ifndef GLX_ARB_get_proc_address
-typedef void (*__GLXextFuncPtr)(void);
-#endif
-
-/*
- * GLX resources.
- */
-typedef XID GLXContextID;
-typedef XID GLXPixmap;
-typedef XID GLXDrawable;
-typedef XID GLXPbuffer;
-typedef XID GLXWindow;
-typedef XID GLXFBConfigID;
-
-/*
- * GLXContext is a pointer to opaque data.
- */
-typedef struct __GLXcontextRec *GLXContext;
-
-/*
- * GLXFBConfig is a pointer to opaque data.
- */
-typedef struct __GLXFBConfigRec *GLXFBConfig;
-
-
-/**********************************************************************/
-
-/*
- * GLX 1.0 functions.
- */
-extern XVisualInfo* glXChooseVisual(Display *dpy, int screen,
- int *attrib_list);
-
-extern void glXCopyContext(Display *dpy, GLXContext src,
- GLXContext dst, unsigned long mask);
-
-extern GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
- GLXContext share_list, Bool direct);
-
-extern GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
- Pixmap pixmap);
-
-extern void glXDestroyContext(Display *dpy, GLXContext ctx);
-
-extern void glXDestroyGLXPixmap(Display *dpy, GLXPixmap pix);
-
-extern int glXGetConfig(Display *dpy, XVisualInfo *vis,
- int attrib, int *value);
-
-extern GLXContext glXGetCurrentContext(void);
-
-extern GLXDrawable glXGetCurrentDrawable(void);
-
-extern Bool glXIsDirect(Display *dpy, GLXContext ctx);
-
-extern Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable,
- GLXContext ctx);
-
-extern Bool glXQueryExtension(Display *dpy, int *error_base, int *event_base);
-
-extern Bool glXQueryVersion(Display *dpy, int *major, int *minor);
-
-extern void glXSwapBuffers(Display *dpy, GLXDrawable drawable);
-
-extern void glXUseXFont(Font font, int first, int count, int list_base);
-
-extern void glXWaitGL(void);
-
-extern void glXWaitX(void);
-
-
-#ifndef GLX_VERSION_1_1
-#define GLX_VERSION_1_1 1
-/*
- * GLX 1.1 functions.
- */
-extern const char *glXGetClientString(Display *dpy, int name);
-
-extern const char *glXQueryServerString(Display *dpy, int screen, int name);
-
-extern const char *glXQueryExtensionsString(Display *dpy, int screen);
-#endif
-
-
-#ifndef GLX_VERSION_1_2
-#define GLX_VERSION_1_2 1
-/*
- * GLX 1.2 functions.
- */
-extern Display *glXGetCurrentDisplay(void);
-#endif
-
-#ifndef GLX_VERSION_1_3
-#define GLX_VERSION_1_3 1
-/*
- * GLX 1.3 functions.
- */
-extern GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
- const int *attrib_list, int *nelements);
-
-extern GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
- int render_type, GLXContext share_list,
- Bool direct);
-
-extern GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config,
- const int *attrib_list);
-
-extern GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config,
- Pixmap pixmap, const int *attrib_list);
-
-extern GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config,
- Window win, const int *attrib_list);
-
-extern void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
-
-extern void glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
-
-extern void glXDestroyWindow(Display *dpy, GLXWindow win);
-
-extern GLXDrawable glXGetCurrentReadDrawable(void);
-
-extern int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
- int attribute, int *value);
-
-extern GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements);
-
-extern void glXGetSelectedEvent(Display *dpy, GLXDrawable draw,
- unsigned long *event_mask);
-
-extern XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
-
-extern Bool glXMakeContextCurrent(Display *display, GLXDrawable draw,
- GLXDrawable read, GLXContext ctx);
-
-extern int glXQueryContext(Display *dpy, GLXContext ctx,
- int attribute, int *value);
-
-extern void glXQueryDrawable(Display *dpy, GLXDrawable draw,
- int attribute, unsigned int *value);
-
-extern void glXSelectEvent(Display *dpy, GLXDrawable draw,
- unsigned long event_mask);
-
-typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
-typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
-typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
-typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
-typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
-typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
-typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
-typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
-typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
-typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
-typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
-typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
-typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
-typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
-#endif
-
-
-#ifndef GLX_VERSION_1_4
-#define GLX_VERSION_1_4 1
-/*
- * GLX 1.4 functions and typedefs.
- */
-extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
-typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
-#endif
-
-
-
-/**********************************************************************/
-
-/*
- * ARB_get_proc_address
- */
-#ifndef GLX_ARB_get_proc_address
-#define GLX_ARB_get_proc_address 1
-/* Don't wrap this in GLX_GLXEXT_PROTOTYPES! */
-extern void (*glXGetProcAddressARB(const GLubyte *procName))(void);
-typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
-#endif
-
-/**********************************************************************/
-
-/*** Should these go here, or in another header? */
-/*
- * GLX Events
- */
-typedef struct {
- int event_type; /* GLX_DAMAGED or GLX_SAVED */
- int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came for SendEvent request */
- Display *display; /* display the event was read from */
- GLXDrawable drawable; /* XID of Drawable */
- unsigned int buffer_mask; /* mask indicating which buffers are affected */
- unsigned int aux_buffer; /* which aux buffer was affected */
- int x, y;
- int width, height;
- int count; /* if nonzero, at least this many more */
-} GLXPbufferClobberEvent;
-
-typedef union __GLXEvent {
- GLXPbufferClobberEvent glxpbufferclobber;
- long pad[24];
-} GLXEvent;
-
-#ifndef GLX_GLXEXT_LEGACY
-#include <GL/glxext.h>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__glx_h__ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxew.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxew.h
deleted file mode 100644
index 6d249f73..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxew.h
+++ /dev/null
@@ -1,1587 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author may be used to endorse or promote products
-** derived from this software without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-** THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.0
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __glxew_h__
-#define __glxew_h__
-#define __GLXEW_H__
-
-#ifdef __glxext_h_
-#error glxext.h included before glxew.h
-#endif
-
-#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__)
-#error glx.h included before glxew.h
-#endif
-
-#define __glxext_h_
-
-#define GLX_H
-#define __GLX_glx_h__
-#define __glx_h__
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xmd.h>
-#include <GL/glew.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ---------------------------- GLX_VERSION_1_0 --------------------------- */
-
-#ifndef GLX_VERSION_1_0
-#define GLX_VERSION_1_0 1
-
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-#define GLX_BAD_SCREEN 1
-#define GLX_BAD_ATTRIBUTE 2
-#define GLX_NO_EXTENSION 3
-#define GLX_BAD_VISUAL 4
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-typedef XID GLXDrawable;
-typedef XID GLXPixmap;
-#ifdef __sun
-typedef struct __glXContextRec *GLXContext;
-#else
-typedef struct __GLXcontextRec *GLXContext;
-#endif
-
-typedef unsigned int GLXVideoDeviceNV;
-
-extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase);
-extern Bool glXQueryVersion (Display *dpy, int *major, int *minor);
-extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value);
-extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList);
-extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
-extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);
-extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
-extern void glXDestroyContext (Display *dpy, GLXContext ctx);
-extern Bool glXIsDirect (Display *dpy, GLXContext ctx);
-extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);
-extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx);
-extern GLXContext glXGetCurrentContext (void);
-extern GLXDrawable glXGetCurrentDrawable (void);
-extern void glXWaitGL (void);
-extern void glXWaitX (void);
-extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable);
-extern void glXUseXFont (Font font, int first, int count, int listBase);
-
-#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0)
-
-#endif /* GLX_VERSION_1_0 */
-
-/* ---------------------------- GLX_VERSION_1_1 --------------------------- */
-
-#ifndef GLX_VERSION_1_1
-#define GLX_VERSION_1_1
-
-#define GLX_VENDOR 0x1
-#define GLX_VERSION 0x2
-#define GLX_EXTENSIONS 0x3
-
-extern const char* glXQueryExtensionsString (Display *dpy, int screen);
-extern const char* glXGetClientString (Display *dpy, int name);
-extern const char* glXQueryServerString (Display *dpy, int screen, int name);
-
-#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1)
-
-#endif /* GLX_VERSION_1_1 */
-
-/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */
-
-#ifndef GLX_VERSION_1_2
-#define GLX_VERSION_1_2 1
-
-typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
-
-#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay)
-
-#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2)
-
-#endif /* GLX_VERSION_1_2 */
-
-/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */
-
-#ifndef GLX_VERSION_1_3
-#define GLX_VERSION_1_3 1
-
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
-#define GLX_AUX_BUFFERS_BIT 0x00000010
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_VISUAL_ID 0x800B
-#define GLX_SCREEN 0x800C
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_PBUFFER_HEIGHT 0x8040
-#define GLX_PBUFFER_WIDTH 0x8041
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-#define GLX_DONT_CARE 0xFFFFFFFF
-
-typedef XID GLXFBConfigID;
-typedef XID GLXPbuffer;
-typedef XID GLXWindow;
-typedef struct __GLXFBConfigRec *GLXFBConfig;
-
-typedef struct {
- int event_type;
- int draw_type;
- unsigned long serial;
- Bool send_event;
- Display *display;
- GLXDrawable drawable;
- unsigned int buffer_mask;
- unsigned int aux_buffer;
- int x, y;
- int width, height;
- int count;
-} GLXPbufferClobberEvent;
-typedef union __GLXEvent {
- GLXPbufferClobberEvent glxpbufferclobber;
- long pad[24];
-} GLXEvent;
-
-typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
-typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
-typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
-typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
-typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
-typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
-typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
-typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
-typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
-typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
-
-#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig)
-#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext)
-#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer)
-#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap)
-#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow)
-#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer)
-#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap)
-#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow)
-#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable)
-#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib)
-#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs)
-#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent)
-#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig)
-#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent)
-#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext)
-#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable)
-#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent)
-
-#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3)
-
-#endif /* GLX_VERSION_1_3 */
-
-/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */
-
-#ifndef GLX_VERSION_1_4
-#define GLX_VERSION_1_4 1
-
-#define GLX_SAMPLE_BUFFERS 100000
-#define GLX_SAMPLES 100001
-
-extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);
-
-#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4)
-
-#endif /* GLX_VERSION_1_4 */
-
-/* -------------------------- GLX_3DFX_multisample ------------------------- */
-
-#ifndef GLX_3DFX_multisample
-#define GLX_3DFX_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
-#define GLX_SAMPLES_3DFX 0x8051
-
-#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample)
-
-#endif /* GLX_3DFX_multisample */
-
-/* ------------------------ GLX_AMD_gpu_association ------------------------ */
-
-#ifndef GLX_AMD_gpu_association
-#define GLX_AMD_gpu_association 1
-
-#define GLX_GPU_VENDOR_AMD 0x1F00
-#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
-#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define GLX_GPU_RAM_AMD 0x21A3
-#define GLX_GPU_CLOCK_AMD 0x21A4
-#define GLX_GPU_NUM_PIPES_AMD 0x21A5
-#define GLX_GPU_NUM_SIMD_AMD 0x21A6
-#define GLX_GPU_NUM_RB_AMD 0x21A7
-#define GLX_GPU_NUM_SPI_AMD 0x21A8
-
-#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association)
-
-#endif /* GLX_AMD_gpu_association */
-
-/* ------------------------- GLX_ARB_create_context ------------------------ */
-
-#ifndef GLX_ARB_create_context
-#define GLX_ARB_create_context 1
-
-#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define GLX_CONTEXT_FLAGS_ARB 0x2094
-
-typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
-
-#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB)
-
-#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context)
-
-#endif /* GLX_ARB_create_context */
-
-/* --------------------- GLX_ARB_create_context_profile -------------------- */
-
-#ifndef GLX_ARB_create_context_profile
-#define GLX_ARB_create_context_profile 1
-
-#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
-
-#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile)
-
-#endif /* GLX_ARB_create_context_profile */
-
-/* ------------------- GLX_ARB_create_context_robustness ------------------- */
-
-#ifndef GLX_ARB_create_context_robustness
-#define GLX_ARB_create_context_robustness 1
-
-#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
-
-#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness)
-
-#endif /* GLX_ARB_create_context_robustness */
-
-/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */
-
-#ifndef GLX_ARB_fbconfig_float
-#define GLX_ARB_fbconfig_float 1
-
-#define GLX_RGBA_FLOAT_BIT 0x00000004
-#define GLX_RGBA_FLOAT_TYPE 0x20B9
-
-#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float)
-
-#endif /* GLX_ARB_fbconfig_float */
-
-/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */
-
-#ifndef GLX_ARB_framebuffer_sRGB
-#define GLX_ARB_framebuffer_sRGB 1
-
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
-
-#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB)
-
-#endif /* GLX_ARB_framebuffer_sRGB */
-
-/* ------------------------ GLX_ARB_get_proc_address ----------------------- */
-
-#ifndef GLX_ARB_get_proc_address
-#define GLX_ARB_get_proc_address 1
-
-extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);
-
-#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address)
-
-#endif /* GLX_ARB_get_proc_address */
-
-/* -------------------------- GLX_ARB_multisample -------------------------- */
-
-#ifndef GLX_ARB_multisample
-#define GLX_ARB_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_ARB 100000
-#define GLX_SAMPLES_ARB 100001
-
-#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample)
-
-#endif /* GLX_ARB_multisample */
-
-/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */
-
-#ifndef GLX_ARB_vertex_buffer_object
-#define GLX_ARB_vertex_buffer_object 1
-
-#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
-
-#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object)
-
-#endif /* GLX_ARB_vertex_buffer_object */
-
-/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */
-
-#ifndef GLX_ATI_pixel_format_float
-#define GLX_ATI_pixel_format_float 1
-
-#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100
-
-#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float)
-
-#endif /* GLX_ATI_pixel_format_float */
-
-/* ------------------------- GLX_ATI_render_texture ------------------------ */
-
-#ifndef GLX_ATI_render_texture
-#define GLX_ATI_render_texture 1
-
-#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800
-#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801
-#define GLX_TEXTURE_FORMAT_ATI 0x9802
-#define GLX_TEXTURE_TARGET_ATI 0x9803
-#define GLX_MIPMAP_TEXTURE_ATI 0x9804
-#define GLX_TEXTURE_RGB_ATI 0x9805
-#define GLX_TEXTURE_RGBA_ATI 0x9806
-#define GLX_NO_TEXTURE_ATI 0x9807
-#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808
-#define GLX_TEXTURE_1D_ATI 0x9809
-#define GLX_TEXTURE_2D_ATI 0x980A
-#define GLX_MIPMAP_LEVEL_ATI 0x980B
-#define GLX_CUBE_MAP_FACE_ATI 0x980C
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812
-#define GLX_FRONT_LEFT_ATI 0x9813
-#define GLX_FRONT_RIGHT_ATI 0x9814
-#define GLX_BACK_LEFT_ATI 0x9815
-#define GLX_BACK_RIGHT_ATI 0x9816
-#define GLX_AUX0_ATI 0x9817
-#define GLX_AUX1_ATI 0x9818
-#define GLX_AUX2_ATI 0x9819
-#define GLX_AUX3_ATI 0x981A
-#define GLX_AUX4_ATI 0x981B
-#define GLX_AUX5_ATI 0x981C
-#define GLX_AUX6_ATI 0x981D
-#define GLX_AUX7_ATI 0x981E
-#define GLX_AUX8_ATI 0x981F
-#define GLX_AUX9_ATI 0x9820
-#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821
-#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822
-
-typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);
-typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);
-
-#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI)
-#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI)
-#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI)
-
-#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture)
-
-#endif /* GLX_ATI_render_texture */
-
-/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */
-
-#ifndef GLX_EXT_create_context_es2_profile
-#define GLX_EXT_create_context_es2_profile 1
-
-#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-
-#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile)
-
-#endif /* GLX_EXT_create_context_es2_profile */
-
-/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */
-
-#ifndef GLX_EXT_fbconfig_packed_float
-#define GLX_EXT_fbconfig_packed_float 1
-
-#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
-#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
-
-#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float)
-
-#endif /* GLX_EXT_fbconfig_packed_float */
-
-/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */
-
-#ifndef GLX_EXT_framebuffer_sRGB
-#define GLX_EXT_framebuffer_sRGB 1
-
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
-
-#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB)
-
-#endif /* GLX_EXT_framebuffer_sRGB */
-
-/* ------------------------- GLX_EXT_import_context ------------------------ */
-
-#ifndef GLX_EXT_import_context
-#define GLX_EXT_import_context 1
-
-#define GLX_SHARE_CONTEXT_EXT 0x800A
-#define GLX_VISUAL_ID_EXT 0x800B
-#define GLX_SCREEN_EXT 0x800C
-
-typedef XID GLXContextID;
-
-typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context);
-typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
-typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID);
-typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value);
-
-#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT)
-#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT)
-#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT)
-#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT)
-
-#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context)
-
-#endif /* GLX_EXT_import_context */
-
-/* -------------------------- GLX_EXT_scene_marker ------------------------- */
-
-#ifndef GLX_EXT_scene_marker
-#define GLX_EXT_scene_marker 1
-
-#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker)
-
-#endif /* GLX_EXT_scene_marker */
-
-/* -------------------------- GLX_EXT_swap_control ------------------------- */
-
-#ifndef GLX_EXT_swap_control
-#define GLX_EXT_swap_control 1
-
-#define GLX_SWAP_INTERVAL_EXT 0x20F1
-#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
-
-typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval);
-
-#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT)
-
-#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control)
-
-#endif /* GLX_EXT_swap_control */
-
-/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */
-
-#ifndef GLX_EXT_texture_from_pixmap
-#define GLX_EXT_texture_from_pixmap 1
-
-#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
-#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
-#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
-#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
-#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
-#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
-#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
-#define GLX_Y_INVERTED_EXT 0x20D4
-#define GLX_TEXTURE_FORMAT_EXT 0x20D5
-#define GLX_TEXTURE_TARGET_EXT 0x20D6
-#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
-#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
-#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
-#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
-#define GLX_TEXTURE_1D_EXT 0x20DB
-#define GLX_TEXTURE_2D_EXT 0x20DC
-#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
-#define GLX_FRONT_LEFT_EXT 0x20DE
-#define GLX_FRONT_RIGHT_EXT 0x20DF
-#define GLX_BACK_LEFT_EXT 0x20E0
-#define GLX_BACK_RIGHT_EXT 0x20E1
-#define GLX_AUX0_EXT 0x20E2
-#define GLX_AUX1_EXT 0x20E3
-#define GLX_AUX2_EXT 0x20E4
-#define GLX_AUX3_EXT 0x20E5
-#define GLX_AUX4_EXT 0x20E6
-#define GLX_AUX5_EXT 0x20E7
-#define GLX_AUX6_EXT 0x20E8
-#define GLX_AUX7_EXT 0x20E9
-#define GLX_AUX8_EXT 0x20EA
-#define GLX_AUX9_EXT 0x20EB
-
-typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer);
-
-#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT)
-#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT)
-
-#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap)
-
-#endif /* GLX_EXT_texture_from_pixmap */
-
-/* -------------------------- GLX_EXT_visual_info -------------------------- */
-
-#ifndef GLX_EXT_visual_info
-#define GLX_EXT_visual_info 1
-
-#define GLX_X_VISUAL_TYPE_EXT 0x22
-#define GLX_TRANSPARENT_TYPE_EXT 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
-#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
-#define GLX_NONE_EXT 0x8000
-#define GLX_TRUE_COLOR_EXT 0x8002
-#define GLX_DIRECT_COLOR_EXT 0x8003
-#define GLX_PSEUDO_COLOR_EXT 0x8004
-#define GLX_STATIC_COLOR_EXT 0x8005
-#define GLX_GRAY_SCALE_EXT 0x8006
-#define GLX_STATIC_GRAY_EXT 0x8007
-#define GLX_TRANSPARENT_RGB_EXT 0x8008
-#define GLX_TRANSPARENT_INDEX_EXT 0x8009
-
-#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info)
-
-#endif /* GLX_EXT_visual_info */
-
-/* ------------------------- GLX_EXT_visual_rating ------------------------- */
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating 1
-
-#define GLX_VISUAL_CAVEAT_EXT 0x20
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-
-#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating)
-
-#endif /* GLX_EXT_visual_rating */
-
-/* -------------------------- GLX_INTEL_swap_event ------------------------- */
-
-#ifndef GLX_INTEL_swap_event
-#define GLX_INTEL_swap_event 1
-
-#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
-#define GLX_COPY_COMPLETE_INTEL 0x8181
-#define GLX_FLIP_COMPLETE_INTEL 0x8182
-#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
-
-#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event)
-
-#endif /* GLX_INTEL_swap_event */
-
-/* -------------------------- GLX_MESA_agp_offset -------------------------- */
-
-#ifndef GLX_MESA_agp_offset
-#define GLX_MESA_agp_offset 1
-
-typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer);
-
-#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA)
-
-#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset)
-
-#endif /* GLX_MESA_agp_offset */
-
-/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */
-
-#ifndef GLX_MESA_copy_sub_buffer
-#define GLX_MESA_copy_sub_buffer 1
-
-typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height);
-
-#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA)
-
-#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer)
-
-#endif /* GLX_MESA_copy_sub_buffer */
-
-/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */
-
-#ifndef GLX_MESA_pixmap_colormap
-#define GLX_MESA_pixmap_colormap 1
-
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
-
-#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA)
-
-#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap)
-
-#endif /* GLX_MESA_pixmap_colormap */
-
-/* ------------------------ GLX_MESA_release_buffers ----------------------- */
-
-#ifndef GLX_MESA_release_buffers
-#define GLX_MESA_release_buffers 1
-
-typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d);
-
-#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA)
-
-#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers)
-
-#endif /* GLX_MESA_release_buffers */
-
-/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */
-
-#ifndef GLX_MESA_set_3dfx_mode
-#define GLX_MESA_set_3dfx_mode 1
-
-#define GLX_3DFX_WINDOW_MODE_MESA 0x1
-#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
-
-typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
-
-#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA)
-
-#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode)
-
-#endif /* GLX_MESA_set_3dfx_mode */
-
-/* ------------------------- GLX_MESA_swap_control ------------------------- */
-
-#ifndef GLX_MESA_swap_control
-#define GLX_MESA_swap_control 1
-
-typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void);
-typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
-
-#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA)
-#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA)
-
-#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control)
-
-#endif /* GLX_MESA_swap_control */
-
-/* --------------------------- GLX_NV_copy_image --------------------------- */
-
-#ifndef GLX_NV_copy_image
-#define GLX_NV_copy_image 1
-
-typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV)
-
-#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image)
-
-#endif /* GLX_NV_copy_image */
-
-/* -------------------------- GLX_NV_float_buffer -------------------------- */
-
-#ifndef GLX_NV_float_buffer
-#define GLX_NV_float_buffer 1
-
-#define GLX_FLOAT_COMPONENTS_NV 0x20B0
-
-#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer)
-
-#endif /* GLX_NV_float_buffer */
-
-/* ---------------------- GLX_NV_multisample_coverage ---------------------- */
-
-#ifndef GLX_NV_multisample_coverage
-#define GLX_NV_multisample_coverage 1
-
-#define GLX_COLOR_SAMPLES_NV 0x20B3
-#define GLX_COVERAGE_SAMPLES_NV 100001
-
-#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage)
-
-#endif /* GLX_NV_multisample_coverage */
-
-/* -------------------------- GLX_NV_present_video ------------------------- */
-
-#ifndef GLX_NV_present_video
-#define GLX_NV_present_video 1
-
-#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
-
-typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
-typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
-
-#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV)
-#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV)
-
-#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video)
-
-#endif /* GLX_NV_present_video */
-
-/* --------------------------- GLX_NV_swap_group --------------------------- */
-
-#ifndef GLX_NV_swap_group
-#define GLX_NV_swap_group 1
-
-typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier);
-typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group);
-typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count);
-typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
-typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
-typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen);
-
-#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV)
-#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV)
-#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV)
-#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV)
-#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV)
-#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV)
-
-#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group)
-
-#endif /* GLX_NV_swap_group */
-
-/* ----------------------- GLX_NV_vertex_array_range ----------------------- */
-
-#ifndef GLX_NV_vertex_array_range
-#define GLX_NV_vertex_array_range 1
-
-typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
-typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
-
-#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV)
-#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV)
-
-#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range)
-
-#endif /* GLX_NV_vertex_array_range */
-
-/* -------------------------- GLX_NV_video_capture ------------------------- */
-
-#ifndef GLX_NV_video_capture
-#define GLX_NV_video_capture 1
-
-#define GLX_DEVICE_ID_NV 0x20CD
-#define GLX_UNIQUE_ID_NV 0x20CE
-#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-
-typedef XID GLXVideoCaptureDeviceNV;
-
-typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
-typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);
-typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
-typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
-typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
-
-#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)
-#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)
-#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)
-#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)
-#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)
-
-#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)
-
-#endif /* GLX_NV_video_capture */
-
-/* -------------------------- GLX_NV_video_output -------------------------- */
-
-#ifndef GLX_NV_video_output
-#define GLX_NV_video_output 1
-
-#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
-#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
-#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
-#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
-#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
-#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
-#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
-#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
-
-typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
-typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
-typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);
-typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf);
-typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
-
-#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV)
-#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV)
-#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV)
-#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV)
-#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
-#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
-
-#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
-
-#endif /* GLX_NV_video_output */
-
-/* -------------------------- GLX_OML_swap_method -------------------------- */
-
-#ifndef GLX_OML_swap_method
-#define GLX_OML_swap_method 1
-
-#define GLX_SWAP_METHOD_OML 0x8060
-#define GLX_SWAP_EXCHANGE_OML 0x8061
-#define GLX_SWAP_COPY_OML 0x8062
-#define GLX_SWAP_UNDEFINED_OML 0x8063
-
-#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method)
-
-#endif /* GLX_OML_swap_method */
-
-/* -------------------------- GLX_OML_sync_control ------------------------- */
-
-#ifndef GLX_OML_sync_control
-#define GLX_OML_sync_control 1
-
-typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
-typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
-typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc);
-
-#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML)
-#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML)
-#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML)
-#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML)
-#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML)
-
-#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control)
-
-#endif /* GLX_OML_sync_control */
-
-/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */
-
-#ifndef GLX_SGIS_blended_overlay
-#define GLX_SGIS_blended_overlay 1
-
-#define GLX_BLENDED_RGBA_SGIS 0x8025
-
-#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay)
-
-#endif /* GLX_SGIS_blended_overlay */
-
-/* -------------------------- GLX_SGIS_color_range ------------------------- */
-
-#ifndef GLX_SGIS_color_range
-#define GLX_SGIS_color_range 1
-
-#define GLX_MIN_RED_SGIS 0
-#define GLX_MAX_GREEN_SGIS 0
-#define GLX_MIN_BLUE_SGIS 0
-#define GLX_MAX_ALPHA_SGIS 0
-#define GLX_MIN_GREEN_SGIS 0
-#define GLX_MIN_ALPHA_SGIS 0
-#define GLX_MAX_RED_SGIS 0
-#define GLX_EXTENDED_RANGE_SGIS 0
-#define GLX_MAX_BLUE_SGIS 0
-
-#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range)
-
-#endif /* GLX_SGIS_color_range */
-
-/* -------------------------- GLX_SGIS_multisample ------------------------- */
-
-#ifndef GLX_SGIS_multisample
-#define GLX_SGIS_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_SGIS 100000
-#define GLX_SAMPLES_SGIS 100001
-
-#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample)
-
-#endif /* GLX_SGIS_multisample */
-
-/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */
-
-#ifndef GLX_SGIS_shared_multisample
-#define GLX_SGIS_shared_multisample 1
-
-#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
-#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
-
-#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample)
-
-#endif /* GLX_SGIS_shared_multisample */
-
-/* --------------------------- GLX_SGIX_fbconfig --------------------------- */
-
-#ifndef GLX_SGIX_fbconfig
-#define GLX_SGIX_fbconfig 1
-
-#define GLX_WINDOW_BIT_SGIX 0x00000001
-#define GLX_RGBA_BIT_SGIX 0x00000001
-#define GLX_PIXMAP_BIT_SGIX 0x00000002
-#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
-#define GLX_SCREEN_EXT 0x800C
-#define GLX_DRAWABLE_TYPE_SGIX 0x8010
-#define GLX_RENDER_TYPE_SGIX 0x8011
-#define GLX_X_RENDERABLE_SGIX 0x8012
-#define GLX_FBCONFIG_ID_SGIX 0x8013
-#define GLX_RGBA_TYPE_SGIX 0x8014
-#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
-
-typedef XID GLXFBConfigIDSGIX;
-typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
-
-typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value);
-typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis);
-typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config);
-
-#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX)
-#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX)
-#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX)
-#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX)
-#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX)
-#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX)
-
-#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig)
-
-#endif /* GLX_SGIX_fbconfig */
-
-/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */
-
-#ifndef GLX_SGIX_hyperpipe
-#define GLX_SGIX_hyperpipe 1
-
-#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
-#define GLX_PIPE_RECT_SGIX 0x00000001
-#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
-#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
-#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
-#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
-#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
-#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
-#define GLX_BAD_HYPERPIPE_SGIX 92
-#define GLX_HYPERPIPE_ID_SGIX 0x8030
-
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int networkId;
-} GLXHyperpipeNetworkSGIX;
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int XOrigin;
- int YOrigin;
- int maxHeight;
- int maxWidth;
-} GLXPipeRectLimits;
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int channel;
- unsigned int participationType;
- int timeSlice;
-} GLXHyperpipeConfigSGIX;
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int srcXOrigin;
- int srcYOrigin;
- int srcWidth;
- int srcHeight;
- int destXOrigin;
- int destYOrigin;
- int destWidth;
- int destHeight;
-} GLXPipeRect;
-
-typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
-typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
-typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
-typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
-typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
-typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
-
-#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX)
-#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX)
-#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX)
-#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX)
-#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX)
-#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX)
-#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX)
-#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX)
-
-#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe)
-
-#endif /* GLX_SGIX_hyperpipe */
-
-/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */
-
-#ifndef GLX_SGIX_pbuffer
-#define GLX_SGIX_pbuffer 1
-
-#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
-#define GLX_PBUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
-#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
-#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
-#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
-#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
-#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
-#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
-#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
-#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
-#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
-#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
-#define GLX_LARGEST_PBUFFER_SGIX 0x801C
-#define GLX_WIDTH_SGIX 0x801D
-#define GLX_HEIGHT_SGIX 0x801E
-#define GLX_EVENT_MASK_SGIX 0x801F
-#define GLX_DAMAGED_SGIX 0x8020
-#define GLX_SAVED_SGIX 0x8021
-#define GLX_WINDOW_SGIX 0x8022
-#define GLX_PBUFFER_SGIX 0x8023
-#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
-
-typedef XID GLXPbufferSGIX;
-typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX;
-
-typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list);
-typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask);
-typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask);
-
-#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX)
-#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX)
-#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX)
-#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX)
-#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX)
-
-#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer)
-
-#endif /* GLX_SGIX_pbuffer */
-
-/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */
-
-#ifndef GLX_SGIX_swap_barrier
-#define GLX_SGIX_swap_barrier 1
-
-typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
-typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
-
-#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX)
-#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX)
-
-#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier)
-
-#endif /* GLX_SGIX_swap_barrier */
-
-/* -------------------------- GLX_SGIX_swap_group -------------------------- */
-
-#ifndef GLX_SGIX_swap_group
-#define GLX_SGIX_swap_group 1
-
-typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
-
-#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX)
-
-#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group)
-
-#endif /* GLX_SGIX_swap_group */
-
-/* ------------------------- GLX_SGIX_video_resize ------------------------- */
-
-#ifndef GLX_SGIX_video_resize
-#define GLX_SGIX_video_resize 1
-
-#define GLX_SYNC_FRAME_SGIX 0x00000000
-#define GLX_SYNC_SWAP_SGIX 0x00000001
-
-typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window);
-typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h);
-typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype);
-typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h);
-typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
-
-#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX)
-#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX)
-#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX)
-#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX)
-#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX)
-
-#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize)
-
-#endif /* GLX_SGIX_video_resize */
-
-/* ---------------------- GLX_SGIX_visual_select_group --------------------- */
-
-#ifndef GLX_SGIX_visual_select_group
-#define GLX_SGIX_visual_select_group 1
-
-#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
-
-#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group)
-
-#endif /* GLX_SGIX_visual_select_group */
-
-/* ---------------------------- GLX_SGI_cushion ---------------------------- */
-
-#ifndef GLX_SGI_cushion
-#define GLX_SGI_cushion 1
-
-typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion);
-
-#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI)
-
-#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion)
-
-#endif /* GLX_SGI_cushion */
-
-/* ----------------------- GLX_SGI_make_current_read ----------------------- */
-
-#ifndef GLX_SGI_make_current_read
-#define GLX_SGI_make_current_read 1
-
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
-typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-
-#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI)
-#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI)
-
-#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read)
-
-#endif /* GLX_SGI_make_current_read */
-
-/* -------------------------- GLX_SGI_swap_control ------------------------- */
-
-#ifndef GLX_SGI_swap_control
-#define GLX_SGI_swap_control 1
-
-typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
-
-#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI)
-
-#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control)
-
-#endif /* GLX_SGI_swap_control */
-
-/* --------------------------- GLX_SGI_video_sync -------------------------- */
-
-#ifndef GLX_SGI_video_sync
-#define GLX_SGI_video_sync 1
-
-typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count);
-typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count);
-
-#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI)
-#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI)
-
-#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync)
-
-#endif /* GLX_SGI_video_sync */
-
-/* --------------------- GLX_SUN_get_transparent_index --------------------- */
-
-#ifndef GLX_SUN_get_transparent_index
-#define GLX_SUN_get_transparent_index 1
-
-typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex);
-
-#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN)
-
-#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index)
-
-#endif /* GLX_SUN_get_transparent_index */
-
-/* -------------------------- GLX_SUN_video_resize ------------------------- */
-
-#ifndef GLX_SUN_video_resize
-#define GLX_SUN_video_resize 1
-
-#define GLX_VIDEO_RESIZE_SUN 0x8171
-#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD
-
-typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor);
-typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor);
-
-#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN)
-#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN)
-
-#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize)
-
-#endif /* GLX_SUN_video_resize */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-#define GLXEW_EXPORT
-#else
-#define GLXEW_EXPORT extern
-#endif /* GLEW_MX */
-
-extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
-
-extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
-extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
-extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
-extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
-extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
-extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
-extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
-extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
-extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
-extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
-extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
-extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
-extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
-extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
-extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
-extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
-extern PFNGLXSELECTEVENTPROC __glewXSelectEvent;
-
-extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
-
-extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
-extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
-extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
-
-extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
-extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
-extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
-extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
-
-extern PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
-
-extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
-extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
-
-extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
-
-extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
-
-extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
-
-extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
-
-extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
-
-extern PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;
-extern PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;
-
-extern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
-
-extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
-extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
-
-extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
-extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
-extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
-extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
-extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
-extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
-
-extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
-extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
-
-extern PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;
-extern PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;
-extern PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;
-extern PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;
-extern PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;
-
-extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
-extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
-extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
-extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
-extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
-extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
-
-extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
-extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
-extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
-extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
-extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
-
-extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
-extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
-extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
-extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
-extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
-extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
-
-extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
-extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
-extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
-extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
-extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
-extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
-extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
-extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
-
-extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
-extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
-extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
-extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
-extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
-
-extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
-extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
-
-extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
-
-extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
-extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
-extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
-extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
-extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
-
-extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
-
-extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
-extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
-
-extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
-
-extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
-extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
-
-extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
-
-extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
-extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
-
-#if defined(GLEW_MX)
-struct GLXEWContextStruct
-{
-#endif /* GLEW_MX */
-
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4;
-GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_AMD_gpu_association;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
-GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
-GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_swap_control;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating;
-GLXEW_EXPORT GLboolean __GLXEW_INTEL_swap_event;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_swap_control;
-GLXEW_EXPORT GLboolean __GLXEW_NV_copy_image;
-GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer;
-GLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
-GLXEW_EXPORT GLboolean __GLXEW_NV_present_video;
-GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;
-GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
-GLXEW_EXPORT GLboolean __GLXEW_NV_video_capture;
-GLXEW_EXPORT GLboolean __GLXEW_NV_video_output;
-GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;
-GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync;
-GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
-GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
-
-#ifdef GLEW_MX
-}; /* GLXEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------ */
-
-#ifdef GLEW_MX
-
-typedef struct GLXEWContextStruct GLXEWContext;
-extern GLenum glxewContextInit (GLXEWContext* ctx);
-extern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name);
-
-#define glxewInit() glxewContextInit(glxewGetContext())
-#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
-
-#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x))
-#define GLXEW_GET_FUN(x) x
-
-#else /* GLEW_MX */
-
-#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define GLXEW_GET_FUN(x) x
-
-extern GLboolean glxewIsSupported (const char* name);
-
-#endif /* GLEW_MX */
-
-extern GLboolean glxewGetExtension (const char* name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glxew_h__ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxext.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxext.h
deleted file mode 100644
index cccee18d..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/glxext.h
+++ /dev/null
@@ -1,941 +0,0 @@
-#ifndef __glxext_h_
-#define __glxext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/*************************************************************/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-/* glxext.h last updated 2009/01/08 */
-/* Current version at http://www.opengl.org/registry/ */
-#define GLX_GLXEXT_VERSION 21
-
-#ifndef GLX_ARB_get_proc_address
-#endif
-
-#ifndef GLX_ARB_multisample
-#define GLX_SAMPLE_BUFFERS_ARB 100000
-#define GLX_SAMPLES_ARB 100001
-#endif
-
-#ifndef GLX_ARB_fbconfig_float
-#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
-#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
-#endif
-
-#ifndef GLX_ARB_create_context
-#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
-#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define GLX_CONTEXT_FLAGS_ARB 0x2094
-#endif
-
-#ifndef GLX_SGIS_multisample
-#define GLX_SAMPLE_BUFFERS_SGIS 100000
-#define GLX_SAMPLES_SGIS 100001
-#endif
-
-#ifndef GLX_EXT_visual_info
-#define GLX_X_VISUAL_TYPE_EXT 0x22
-#define GLX_TRANSPARENT_TYPE_EXT 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
-#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
-#define GLX_NONE_EXT 0x8000
-#define GLX_TRUE_COLOR_EXT 0x8002
-#define GLX_DIRECT_COLOR_EXT 0x8003
-#define GLX_PSEUDO_COLOR_EXT 0x8004
-#define GLX_STATIC_COLOR_EXT 0x8005
-#define GLX_GRAY_SCALE_EXT 0x8006
-#define GLX_STATIC_GRAY_EXT 0x8007
-#define GLX_TRANSPARENT_RGB_EXT 0x8008
-#define GLX_TRANSPARENT_INDEX_EXT 0x8009
-#endif
-
-#ifndef GLX_SGI_swap_control
-#endif
-
-#ifndef GLX_SGI_video_sync
-#endif
-
-#ifndef GLX_SGI_make_current_read
-#endif
-
-#ifndef GLX_SGIX_video_source
-#endif
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_VISUAL_CAVEAT_EXT 0x20
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-/* reuse GLX_NONE_EXT */
-#endif
-
-#ifndef GLX_EXT_import_context
-#define GLX_SHARE_CONTEXT_EXT 0x800A
-#define GLX_VISUAL_ID_EXT 0x800B
-#define GLX_SCREEN_EXT 0x800C
-#endif
-
-#ifndef GLX_SGIX_fbconfig
-#define GLX_WINDOW_BIT_SGIX 0x00000001
-#define GLX_PIXMAP_BIT_SGIX 0x00000002
-#define GLX_RGBA_BIT_SGIX 0x00000001
-#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
-#define GLX_DRAWABLE_TYPE_SGIX 0x8010
-#define GLX_RENDER_TYPE_SGIX 0x8011
-#define GLX_X_RENDERABLE_SGIX 0x8012
-#define GLX_FBCONFIG_ID_SGIX 0x8013
-#define GLX_RGBA_TYPE_SGIX 0x8014
-#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
-/* reuse GLX_SCREEN_EXT */
-#endif
-
-#ifndef GLX_SGIX_pbuffer
-#define GLX_PBUFFER_BIT_SGIX 0x00000004
-#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
-#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
-#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
-#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
-#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
-#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
-#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
-#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
-#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
-#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
-#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
-#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
-#define GLX_LARGEST_PBUFFER_SGIX 0x801C
-#define GLX_WIDTH_SGIX 0x801D
-#define GLX_HEIGHT_SGIX 0x801E
-#define GLX_EVENT_MASK_SGIX 0x801F
-#define GLX_DAMAGED_SGIX 0x8020
-#define GLX_SAVED_SGIX 0x8021
-#define GLX_WINDOW_SGIX 0x8022
-#define GLX_PBUFFER_SGIX 0x8023
-#endif
-
-#ifndef GLX_SGI_cushion
-#endif
-
-#ifndef GLX_SGIX_video_resize
-#define GLX_SYNC_FRAME_SGIX 0x00000000
-#define GLX_SYNC_SWAP_SGIX 0x00000001
-#endif
-
-#ifndef GLX_SGIX_dmbuffer
-#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
-#endif
-
-#ifndef GLX_SGIX_swap_group
-#endif
-
-#ifndef GLX_SGIX_swap_barrier
-#endif
-
-#ifndef GLX_SGIS_blended_overlay
-#define GLX_BLENDED_RGBA_SGIS 0x8025
-#endif
-
-#ifndef GLX_SGIS_shared_multisample
-#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
-#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
-#endif
-
-#ifndef GLX_SUN_get_transparent_index
-#endif
-
-#ifndef GLX_3DFX_multisample
-#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
-#define GLX_SAMPLES_3DFX 0x8051
-#endif
-
-#ifndef GLX_MESA_copy_sub_buffer
-#endif
-
-#ifndef GLX_MESA_pixmap_colormap
-#endif
-
-#ifndef GLX_MESA_release_buffers
-#endif
-
-#ifndef GLX_MESA_set_3dfx_mode
-#define GLX_3DFX_WINDOW_MODE_MESA 0x1
-#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
-#endif
-
-#ifndef GLX_SGIX_visual_select_group
-#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
-#endif
-
-#ifndef GLX_OML_swap_method
-#define GLX_SWAP_METHOD_OML 0x8060
-#define GLX_SWAP_EXCHANGE_OML 0x8061
-#define GLX_SWAP_COPY_OML 0x8062
-#define GLX_SWAP_UNDEFINED_OML 0x8063
-#endif
-
-#ifndef GLX_OML_sync_control
-#endif
-
-#ifndef GLX_NV_float_buffer
-#define GLX_FLOAT_COMPONENTS_NV 0x20B0
-#endif
-
-#ifndef GLX_SGIX_hyperpipe
-#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
-#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
-#define GLX_BAD_HYPERPIPE_SGIX 92
-#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
-#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
-#define GLX_PIPE_RECT_SGIX 0x00000001
-#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
-#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
-#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
-#define GLX_HYPERPIPE_ID_SGIX 0x8030
-#endif
-
-#ifndef GLX_MESA_agp_offset
-#endif
-
-
-/*************************************************************/
-
-#ifndef GLX_ARB_get_proc_address
-/*
- * Linux OpenGL ABI specifies glXGetProcAddressARB should be
- * in glx.h moving related defines there as well.
- */
-#endif
-
-#ifndef GLX_SGIX_video_source
-typedef XID GLXVideoSourceSGIX;
-#endif
-
-#ifndef GLX_SGIX_fbconfig
-typedef XID GLXFBConfigIDSGIX;
-typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
-#endif
-
-#ifndef GLX_SGIX_pbuffer
-typedef XID GLXPbufferSGIX;
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came for SendEvent request */
- Display *display; /* display the event was read from */
- GLXDrawable drawable; /* i.d. of Drawable */
- int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
- int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
- unsigned int mask; /* mask indicating which buffers are affected*/
- int x, y;
- int width, height;
- int count; /* if nonzero, at least this many more */
-} GLXBufferClobberEventSGIX;
-#endif
-
-#ifndef GLX_NV_swap_group
-#endif
-
-#ifndef GLX_NV_video_out
-/*
- * GLXVideoDeviceNV is an opaque handle to a video device (part of the
- * GLX_NV_video_out extension).
- */
-typedef unsigned int GLXVideoDeviceNV;
-
-/* glXBindVideoImageNV iVideoBuffer values (NV_video_out) */
-#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
-#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
-#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
-#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-
-/* glXSendPbufferToVideoNV iBufferType values (NV_video_out) */
-#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
-#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
-#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
-#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
-#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
-#endif
-
-#ifndef GLX_EXT_fbconfig_packed_float
-#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
-#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
-#endif
-
-#ifndef GLX_EXT_framebuffer_sRGB
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
-#endif
-
-#ifndef GLX_EXT_texture_from_pixmap
-/* New glXGetFBConfigAttrib <attrib_list> tokens */
-#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
-#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
-#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
-#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
-#define GLX_Y_INVERTED_EXT 0x20D4
-
-/* New glXCreatePixmap attributes and glXQueryDrawable attributes */
-#define GLX_TEXTURE_FORMAT_EXT 0x20D5
-#define GLX_TEXTURE_TARGET_EXT 0x20D6
-#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
-
-/* Values for GLX_TEXTURE_FORMAT_EXT */
-#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
-#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
-#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
-
-/* Bits for GLX_BIND_TO_TEXTURE_TARGETS_EXT mask */
-#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
-#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
-#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
-
-/* Values for GLX_TEXTURE_TARGET_EXT */
-#define GLX_TEXTURE_1D_EXT 0x20DB
-#define GLX_TEXTURE_2D_EXT 0x20DC
-#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
-
-/*
- * Values for the buffer parameter of glXBindTexImageEXT and
- * glXReleaseTexImageEXT
- */
-#define GLX_FRONT_LEFT_EXT 0x20DE
-#define GLX_FRONT_RIGHT_EXT 0x20DF
-#define GLX_BACK_LEFT_EXT 0x20E0
-#define GLX_BACK_RIGHT_EXT 0x20E1
-#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
-#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
-#define GLX_AUX0_EXT 0x20E2
-#define GLX_AUX1_EXT 0x20E3
-#define GLX_AUX2_EXT 0x20E4
-#define GLX_AUX3_EXT 0x20E5
-#define GLX_AUX4_EXT 0x20E6
-#define GLX_AUX5_EXT 0x20E7
-#define GLX_AUX6_EXT 0x20E8
-#define GLX_AUX7_EXT 0x20E9
-#define GLX_AUX8_EXT 0x20EA
-#define GLX_AUX9_EXT 0x20EB
-
-#endif
-
-#ifndef GLX_NV_multisample_coverage
-#define GLX_COVERAGE_SAMPLES_NV GLX_SAMPLES_ARB
-#define GLX_COLOR_SAMPLES_NV 0x20B3
-#endif
-
-#ifndef GLX_NV_video_capture
-typedef struct GLXVideoCaptureDeviceNVRec *GLXVideoCaptureDeviceNV;
-
-#define GLX_DEVICE_ID_NV 0x20CD
-#define GLX_UNIQUE_ID_NV 0x20CE
-#endif
-
-#ifndef GLX_EXT_swap_control
-#define GLX_SWAP_INTERVAL_EXT 0x20F1
-#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
-#endif
-
-#ifndef GLX_EXT_swap_control_tear
-#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
-#endif
-
-/* Define int32_t and int64_t types for UST/MSC */
-/* (as used in the GLX_OML_sync_control extension). */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#include <inttypes.h>
-#elif defined( __VMS ) || defined(__FreeBSD__)
-#include <inttypes.h>
-#elif (defined(__sun__) && defined(__svr4__)) || (defined(__sun) && defined(__SVR4))
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__) || defined(__linux__)
-#include <stdint.h>
-#elif defined(__UNIXOS2__) || defined(__SOL64__)
-typedef long int int32_t;
-typedef long long int int64_t;
-#else
-#error "int32_t and int64_t are undefined!"
-#endif
-
-#ifndef GLX_ARB_get_proc_address
-/* Moved to glx.h */
-#endif
-
-#ifndef GLX_ARB_multisample
-#define GLX_ARB_multisample 1
-#endif
-
-#ifndef GLX_ARB_fbconfig_float
-#define GLX_ARB_fbconfig_float 1
-#endif
-
-#ifndef GLX_ARB_create_context
-#define GLX_ARB_create_context 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
-#endif
-
-#ifndef GLX_SGIS_multisample
-#define GLX_SGIS_multisample 1
-#endif
-
-#ifndef GLX_EXT_visual_info
-#define GLX_EXT_visual_info 1
-#endif
-
-#ifndef GLX_SGI_swap_control
-#define GLX_SGI_swap_control 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern int glXSwapIntervalSGI (int);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
-#endif
-
-#ifndef GLX_EXT_swap_control
-#define GLX_EXT_swap_control 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
-#endif
-
-#ifndef GLX_EXT_swap_control_tear
-#define GLX_EXT_swap_control_tear 1
-#endif
-
-#ifndef GLX_SGI_video_sync
-#define GLX_SGI_video_sync 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern int glXGetVideoSyncSGI (unsigned int *);
-extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
-extern int glXGetRefreshRateSGI(unsigned int *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
-typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
-typedef int ( * PFNGLXGETREFRESHRATESGIPROC) (unsigned int *);
-#endif
-
-#ifndef GLX_SGI_make_current_read
-#define GLX_SGI_make_current_read 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
-extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
-#endif
-
-#ifndef GLX_SGIX_video_source
-#define GLX_SGIX_video_source 1
-#ifdef _VL_H
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
-extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
-typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
-#endif /* _VL_H */
-#endif
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating 1
-#endif
-
-#ifndef GLX_EXT_import_context
-#define GLX_EXT_import_context 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Display * glXGetCurrentDisplayEXT (void);
-extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
-extern GLXContextID glXGetContextIDEXT (const GLXContext);
-extern GLXContext glXImportContextEXT (Display *, GLXContextID);
-extern void glXFreeContextEXT (Display *, GLXContext);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
-typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
-typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
-typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
-typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
-#endif
-
-#ifndef GLX_SGIX_fbconfig
-#define GLX_SGIX_fbconfig 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
-extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
-extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
-extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
-extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
-extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
-typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
-typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
-typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
-typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
-#endif
-
-#ifndef GLX_SGIX_pbuffer
-#define GLX_SGIX_pbuffer 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
-extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
-extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
-extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
-extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
-typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
-typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
-typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
-#endif
-
-#ifndef GLX_SGI_cushion
-#define GLX_SGI_cushion 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void glXCushionSGI (Display *, Window, float);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
-#endif
-
-#ifndef GLX_SGIX_video_resize
-#define GLX_SGIX_video_resize 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
-extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
-extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
-extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
-extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
-typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
-typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
-typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
-typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
-#endif
-
-#ifndef GLX_SGIX_dmbuffer
-#define GLX_SGIX_dmbuffer 1
-#ifdef _DM_BUFFER_H_
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
-#endif /* _DM_BUFFER_H_ */
-#endif
-
-#ifndef GLX_SGIX_swap_group
-#define GLX_SGIX_swap_group 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
-#endif
-
-#ifndef GLX_SGIX_swap_barrier
-#define GLX_SGIX_swap_barrier 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
-extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
-typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
-#endif
-
-#ifndef GLX_SUN_get_transparent_index
-#define GLX_SUN_get_transparent_index 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
-#endif
-
-#ifndef GLX_MESA_copy_sub_buffer
-#define GLX_MESA_copy_sub_buffer 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
-#endif
-
-#ifndef GLX_MESA_pixmap_colormap
-#define GLX_MESA_pixmap_colormap 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
-#endif
-
-#ifndef GLX_MESA_release_buffers
-#define GLX_MESA_release_buffers 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
-#endif
-
-#ifndef GLX_MESA_set_3dfx_mode
-#define GLX_MESA_set_3dfx_mode 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Bool glXSet3DfxModeMESA (int);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
-#endif
-
-#ifndef GLX_SGIX_visual_select_group
-#define GLX_SGIX_visual_select_group 1
-#endif
-
-#ifndef GLX_OML_swap_method
-#define GLX_OML_swap_method 1
-#endif
-
-#ifndef GLX_OML_sync_control
-#define GLX_OML_sync_control 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
-extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
-extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
-extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
-extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
-typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
-typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
-typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
-typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
-#endif
-
-#ifndef GLX_NV_float_buffer
-#define GLX_NV_float_buffer 1
-#endif
-
-#ifndef GLX_SGIX_hyperpipe
-#define GLX_SGIX_hyperpipe 1
-
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int networkId;
-} GLXHyperpipeNetworkSGIX;
-
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int channel;
- unsigned int
- participationType;
- int timeSlice;
-} GLXHyperpipeConfigSGIX;
-
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
- int destXOrigin, destYOrigin, destWidth, destHeight;
-} GLXPipeRect;
-
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int XOrigin, YOrigin, maxHeight, maxWidth;
-} GLXPipeRectLimits;
-
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
-extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
-extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
-extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
-extern int glXBindHyperpipeSGIX (Display *, int);
-extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
-extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
-extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
-typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
-typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
-typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
-typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
-typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
-#endif
-
-#ifndef GLX_MESA_agp_offset
-#define GLX_MESA_agp_offset 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern unsigned int glXGetAGPOffsetMESA (const void *);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
-#endif
-
-/*
- * GLX_NV_vertex_array_range is not a real extension name...
- */
-#ifndef GLX_NV_vertex_array_range
-#define GLX_NV_vertex_array_range 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq,
- GLfloat writefreq, GLfloat priority);
-
-extern void glXFreeMemoryNV(GLvoid *pointer);
-#endif
-typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size,
- GLfloat readfreq,
- GLfloat writefreq,
- GLfloat priority);
-
-typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
-#endif
-
-#ifndef GLX_NV_swap_group
-#define GLX_NV_swap_group 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern Bool glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable,
- GLuint group);
-
-extern Bool glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier);
-
-extern Bool glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable,
- GLuint *group, GLuint *barrier);
-
-extern Bool glXQueryMaxSwapGroupsNV(Display *dpy, int screen,
- GLuint *maxGroups, GLuint *maxBarriers);
-
-extern Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count);
-
-extern Bool glXResetFrameCountNV(Display *dpy, int screen);
-#endif
-typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy,
- GLXDrawable drawable,
- GLuint group);
-
-typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy,
- GLuint group,
- GLuint barrier);
-
-typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy,
- GLXDrawable drawable,
- GLuint *group,
- GLuint *barrier);
-
-typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy,
- int screen,
- GLuint *maxGroups,
- GLuint *maxBarriers);
-
-typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy,
- int screen,
- GLuint *count);
-
-typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
-#endif
-
-#ifndef GLX_NV_video_out
-#define GLX_NV_video_out 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern int glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices,
- GLXVideoDeviceNV *pVideoDevice);
-
-extern int glXReleaseVideoDeviceNV(Display *dpy, int screen,
- GLXVideoDeviceNV VideoDevice);
-
-extern int glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice,
- GLXPbuffer pbuf, int iVideoBuffer);
-
-extern int glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf);
-
-extern int glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf,
- int iBufferType,
- unsigned long *pulCounterPbuffer,
- GLboolean bBlock);
-
-extern int glXGetVideoInfoNV(Display *dpy, int screen,
- GLXVideoDeviceNV VideoDevice,
- unsigned long *pulCounterOutputPbuffer,
- unsigned long *pulCounterOutputVideo);
-#endif
-typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy,
- int screen,
- int numVideoDevices,
- GLXVideoDeviceNV *pVideoDevice);
-
-typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy,
- int screen,
- GLXVideoDeviceNV VideoDevice);
-
-typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy,
- GLXVideoDeviceNV VideoDevice,
- GLXPbuffer pbuf,
- int iVideoBuffer);
-
-typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy,
- GLXPbuffer pbuf);
-
-typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy,
- GLXPbuffer pbuf,
- int iBufferType,
- unsigned long *pulCounterPbuffer,
- GLboolean bBlock);
-
-typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen,
- GLXVideoDeviceNV VideoDevice,
- unsigned long *pulCounterOutputPbuffer,
- unsigned long *pulCounterOutputVideo);
-#endif
-
-#ifndef GLX_EXT_fbconfig_packed_float
-#define GLX_EXT_fbconfig_packed_float 1
-#endif
-
-#ifndef GLX_EXT_framebuffer_sRGB
-#define GLX_EXT_framebuffer_sRGB 1
-#endif
-
-#ifndef GLX_EXT_texture_from_pixmap
-#define GLX_EXT_texture_from_pixmap
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable,
- int buffer, const int *attrib_list);
-extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable,
- int buffer);
-#endif
-typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy,
- GLXDrawable drawable,
- int buffer,
- const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy,
- GLXDrawable drawable,
- int buffer);
-#endif
-
-#ifndef GLX_NV_present_video
-#define GLX_NV_present_video
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern unsigned int *glXEnumerateVideoDevicesNV(Display *dpy,
- int screen,
- int *nelements);
-extern int glXBindVideoDeviceNV(Display *dpy,
- unsigned int video_slot,
- unsigned int video_device,
- const int *attrib_list);
-#endif
-typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy,
- int screen,
- int *nelements);
-typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy,
- unsigned int video_slot,
- unsigned int video_device,
- const int *attrib_list);
-#endif
-
-#ifndef GLX_NV_multisample_coverage
-#define GLX_NV_multisample_coverage 1
-#endif
-
-#ifndef GLX_NV_video_capture
-#define GLX_NV_video_capture
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern GLXVideoCaptureDeviceNV*
- glXEnumerateVideoCaptureDevicesNV(Display *dpy,
- int screen,
- int *nelements);
-extern void glXLockVideoCaptureDeviceNV(Display *dpy,
- GLXVideoCaptureDeviceNV device);
-extern void glXReleaseVideoCaptureDeviceNV(Display *dpy,
- GLXVideoCaptureDeviceNV device);
-extern int glXBindVideoCaptureDeviceNV(Display *dpy,
- unsigned int video_capture_slot,
- GLXVideoCaptureDeviceNV device);
-extern int glXQueryVideoCaptureDeviceNV(Display *dpy,
- GLXVideoCaptureDeviceNV device,
- int attribute,
- int *value);
-#endif
-typedef GLXVideoCaptureDeviceNV* ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)
- (Display *dpy,
- int screen,
- int *nelements);
-typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)
- (Display *dpy,
- GLXVideoCaptureDeviceNV device);
-
-typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)
- (Display *dpy,
- GLXVideoCaptureDeviceNV device);
-typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)
- (Display *dpy,
- unsigned int video_capture_slot,
- GLXVideoCaptureDeviceNV device);
-typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)
- (Display *dpy,
- GLXVideoCaptureDeviceNV device,
- int attribute,
- int *value);
-#endif
-
-#ifndef GLX_NV_copy_image
-#define GLX_NV_copy_image 1
-#ifdef GLX_GLXEXT_PROTOTYPES
-extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif /* GLX_GLXEXT_PROTOTYPES */
-typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/nvogldebug.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/nvogldebug.h
deleted file mode 100644
index 10e43b4b..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/nvogldebug.h
+++ /dev/null
@@ -1,794 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2005 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
-* This file defines the "__NvOglDebugConfig" and NVX_debug_control interfaces.
-* Its purpose is to aid debugging and development by providing a simple way for
-* applications to control global "debug variables" in the driver.
-*/
-
-#ifndef __nvogldebug_h_
-#define __nvogldebug_h_
-
-// An OpenGL implementation can have combinations of internal driver
-// and hardware state that are difficult to achieve by clever use of
-// the extended OpenGL API alone. This extension provides for
-// arbitrary modifications to driver state and behavior at runtime.
-// The exact driver behaviors that can be modified are not specified
-// here, but may be specified by layered extensions.
-
-typedef enum __GLdebugControlFunctionEnum {
- GL_DEBUG_CONTROL_FUNCTION_IS_SUPPORTED_NVX = 10,
- GL_DEBUG_CONTROL_FUNCTION_EVICT_OBJECT_NVX = 11,
- GL_DEBUG_CONTROL_FUNCTION_GET_BUGFIX_PRESENT = 12,
- GL_DEBUG_CONTROL_FUNCTION_ENABLES = 13,
- GL_DEBUG_CONTROL_FUNCTION_DETECT_FALLBACK = 14,
- GL_DEBUG_CONTROL_FUNCTION_CLAW = 15,
- GL_DEBUG_CONTROL_FUNCTION_GET_STATISTIC = 16,
- GL_DEBUG_CONTROL_FUNCTION_DO_QUADRO_SLOWDOWN = 17,
- GL_DEBUG_CONTROL_FUNCTION_BUFFER_OBJECT = 18,
- GL_DEBUG_CONTROL_FUNCTION_GET_CAPS = 19,
- GL_DEBUG_CONTROL_FUNCTION_DO_QUADRO_SLOWDOWN_US = 20,
- GL_DEBUG_CONTROL_FUNCTION_GET_GENERIC_STATISTIC = 21,
- GL_DEBUG_CONTROL_FUNCTION_INJECT_RC_ERROR = 22,
- GL_DEBUG_CONTROL_FUNCTION_FORCE_MEMSTRATEGY = 23,
- GL_DEBUG_CONTROL_FUNCTION_QUERY_APPDB = 24,
- GL_DEBUG_CONTROL_FUNCTION_SEND_3D_METHOD = 25,
- GL_DEBUG_CONTROL_FUNCTION_GL_VERSION_3_2 = 26,
- GL_DEBUG_CONTROL_FUNCTION_SET_CYCLESTATS_STATE = 27,
- GL_DEBUG_CONTROL_FUNCTION_WWMP = 28,
- GL_DEBUG_CONTROL_FUNCTION_SET_STATE_OBJECT_GPU = 29,
- GL_DEBUG_CONTROL_FUNCTION_NVOGTEST_TEST_START = 30,
- GL_DEBUG_CONTROL_FUNCTION_DUAL_CORE = 31,
- GL_DEBUG_CONTROL_FUNCTION_THREADING_OPTIMIZATIONS = 32,
- GL_DEBUG_CONTROL_FUNCTION_NX6PLUSMODE_FORCE_SYNC = 33,
- GL_DEBUG_CONTROL_FUNCTION_LOOP_ENHANCE = 34,
- GL_DEBUG_CONTROL_FUNCTION_APICOGL = 35,
- GL_DEBUG_CONTROL_FUNCTION_GET_GPU_ADDRESS = 36,
- GL_DEBUG_CONTROL_FUNCTION_EXTRA_CGC_OPTIONS = 37,
- GL_DEBUG_CONTROL_FUNCTION_ES2_READ_BUFFER_AUTO_STEREO = 38,
- GL_DEBUG_CONTROL_FUNCTION_ES2_SET_STEREO_PARAMS = 39,
- GL_DEBUG_CONTROL_FUNCTION_ES2_DISK_CACHE_ENABLE = 40,
- GL_DEBUG_CONTROL_FUNCTION_INDEX_REORDERING_CONFIG = 41,
- GL_DEBUG_CONTROL_FUNCTION_INDEX_REORDERING_STATS = 42,
-} __GLdebugControlFunction;
-
-typedef struct __GLdebugControlIsSupportedRec {
- __GLdebugControlFunction function; // [IN]
- GLboolean isSupported; // [OUT]
-} __GLdebugControlIsSupported;
-
-typedef struct __GLdebugControlEvictObjectRec {
- GLuint objType; // [IN]
- GLuint id; // [IN]
-} __GLdebugControlEvictObject;
-
-typedef enum {
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_393272 = 1, // memhdrs not locked properly on download/eviction
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_LAYERED_CLEAR_PUSHBUFFER_OVERFLOW = 2,
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_395052 = 3, // xfb falls back when raster disabled
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_399272 = 4, // geometry program output size hardware bug
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_391451 = 5, // xfb can't capture layer
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_389986 = 6, // invalid shader uniform array element being updated
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_393139 = 7, // General Vista fixes, especially multi-threading related
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_412399 = 8, // ZCull GL_NEVER bug.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_369989 = 9, // update internal bindings in PopClientAttribs()
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_424295 = 10, // CopyTexImage path crashed when reading from a source with S8D24 internal buffer but no stencil image bound
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_429286 = 11, // __glGenerateMipmaps copies texture level specification correctly
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_426399 = 12, // ActiveTexture produces GL_INVALID_ENUM, not GL_INVALID_OPERATION for invalid textures
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_431407 = 13, // CopyTexSubImage crashed when the texture was not initialized
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_438799 = 14, // NP2 texture base_level bugs.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_440068 = 15, // AA pbuffers incorrectly swapped
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_441074 = 16, // GetRenderbufferParameteriv returns 0 for STENCIL_SIZE
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_416094 = 17, // corruption in primitive restart
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_462805 = 18, // wrong memspace for PBO texsubimage
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_468172 = 19, // DSA uniform calls crash with invalid program ID
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_469086 = 20, // VBO pulling of an edge flag array crashes
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_MAP_BUFFER_RANGE = 21, // Assorted MBR bugs from first implementation
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_466357 = 22, // UINT variable modifier is supported
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_455345 = 23, // Texture API target mismatch bug (tested by tex_match nvogtest)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_306875 = 24, // Erroneous in-band updates to constant buffers (PaBO)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_480517 = 25, // glMatrixMode returns GL_INVALID_OPERATION when active texture is out of range
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_482923 = 26, // Bufferobject counter normalization bug
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_445457 = 27, // Texture array mipmap generation bug
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_489472 = 28, // Shared VBO data store changes not handled
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_458167 = 29, // Dangling gc->buffers.fbo.zeroObject->dp pointer
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_SHADEBLO_GLSL = 30, // ShadeBLo GLSL support, developed after the extension string was added
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_491100 = 31, // Failing to download missing mip levels when BASE_LEVEL is changed
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_VBUM_CLIENTATTRIB = 32, // Interaction between VBUM and ClientAttribDefault
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_505040 = 33, // Interop counters cleanup
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_502904 = 34, // EXT_texture_swizzle interaction with sRGB
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_502904_VTG = 35, // Vertex/Tess/Geometry program EXT_texture_swizzle interaction with sRGB
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_TEX_MAXSIZE_BDR = 36, // cubemap and array textures don't handle border properly
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_489261 = 37, // Unbind a VBO from a VAO
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_430878 = 38, // Fall out of SFR for a 3D blit
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_MODS_CLIPID_TEST = 39, // driver has a MODS hack to force the use of clip IDs for basic functional testing (GL_DEBUG_CONTROL_ENABLE_MODS_CLIPID_TEST)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_505040_2 = 40, // changes for state machine of VBO memory allocation strategy (state_init)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_505040_3 = 41, // changes for state machine of VBO memory allocation strategy (state_vid)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_LOD_FP_ONLY = 42, // Only allow the LOD instruction in fragment programs
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_522575 = 43, // Keep track of lockedCount in the mutex table for GL_DEBUG_CONTROL_GET_GENERIC_STATISTIC_MUTEX_WORD
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_515687 = 44, // ARB_texture_rg: GL_RED should be legal GL_DEPTH_TEXTURE_MODE
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_EXPMS_VCAA = 45, // VCAA depth surface can now be fetch by explicit_multisample
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_VBUM_MBR = 46, // MapBufferRange orphan+discard doesn't work with vbum/shadeblo
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_MAPPED_BUFFER_CRASH = 47, // Deleting a context while a buffer is mapped will crash
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_MAPPED_BUFFER_CRASH_NV4X = 48, // Deleting a context while a buffer is mapped will crash (on NV4X)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_NULL_COMPRESSED_TEXIMG = 49, // Allow NULL for glCompressedTexImage*D
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_SHADER_SUBROUTINE_CHANGE = 50, // Change to NV_shader_subroutine API
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_DSA_TOKENHELPER_BUG_560077 = 51,
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_571236 = 52, // Interactions of dualcore, client-state, and deprecation
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_578086 = 53, // Fixes for max attrib fragment programs
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_SEAMLESS_CUBEMAP = 54, // seamless cubemap enum changed
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_GL32_MAX_COMPONENTS_QUERIES = 55, // driver implements new GL3.2 MAX_*_COMPONENTS queries
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_GL32_GETBUFFERPARAMETERI64V = 56, // driver implements missing 64b buffer parameter query
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_576302 = 57,
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_LOADIM_MULTISAMPLE_TEX = 58, // image_load_store converted to use GL3.2 multisample texture syntax
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_VOTE_IMPLEMENTED = 59, // does NV_gpu_program5 code include support for TGALL/TGANY/TGEQ?
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_424330 = 60,
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_ALPHA_CB_FIX = 61, // Set alpha circular buffer size for gf10y
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_GETINTEGER64I_V = 62, // glGetInteger64i_v is present.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_2DMSARRAY_RENAMED = 63, // Assembly token 2DMSARRAY has been renamed to ARRAY2DMS
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_607673 = 64, // Assembler properly rejects POPA with a CC mask
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_599222 = 65, // Disabled vbo slots are still remembered across context switches.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_TEXBO_GETTEXLEVELPARAM = 66, // Support gettexlevelparameter on buffer textures
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_618201 = 67, // Subsequent VBO ArrayElement calls with different enables cause crash
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_INT64_DIV_MOD = 68, // Supports 64 bit integer DIV and MOD instructions
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_635764 = 69, // Draw without attrib 0 enabled
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_PIXELPATH_PACKED_PIXELS = 71, // support for packed pixel types in the pixel path, part of ARB_texture_rgb10_a2ui
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BEGINQUERYINDEXED = 72, // XFB3 change from using separate query targets to using indexed query targets
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_INDEXED_TXWAR = 73, // Support texture format WAR on indexed texture
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_SHADER_SUBROUTINE_CHANGE2 = 74,// Further shader subroutine changes
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_FRAGMENT_SMID = 75, // Supports the "fragment.smid" binding for MODS (bug 663067).
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BIND_SAMPLER_UINT = 76, // ARB_sampler_objects' BindSampler implementation accepts a uint (bug 668718).
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_MISC_GL33_GL40_FIXES = 77, // Contains fixes for miscellaneous OpenGL 3.3/4.0 impl. bugs
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_663779 = 78, // Support IPA instruction on FPOS attribute
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_368610 = 79, // Sharing FBOs between display connections and closing owning connection
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_674780 = 80, // Driver does not crash when given negative values for sampler texture indices
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_681447 = 81, // glGetIntegerv() support for GL_COPY_READ_BUFFER and GL_COPY_WRITE_BUFFER
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_SUBROUTINE_QUERY_CRASH = 82, // querying information about compatible subroutines from an unbound program crashes
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_IPA_FOGCOORD = 83, // Support IPA instruction on fogcoord
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_710489 = 84, // DSA + VAO fixes, mostly for glGetVertexArrayIntegeri_vEXT
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_PPO_FIXES = 85, // Deleting a bound user pipeline updates properly and bindprogrampipeline updates active programs
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_676759 = 86, // Linker fixes for uniform arrays with 64-bit components.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_741073 = 87, // Linker handles Cg bug in handling matrix uniform arrays where only the last element is used.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_664244 = 88, // Problems with arrays of GLSL subroutine uniforms, crashes on R256 x64
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_744350 = 89, // Problems with FL-predicated subroutine calls
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_751609 = 90, // Crash can occur when doing too many CE operations back-to-back.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_728033 = 91, // New format support for cuda interop has been added to R270 and above.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_762723 = 92, // UBO only allows 12 bindings
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_763409 = 93, // Supports DX11 - OGL interop, R270 and above.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_747891 = 94, // Errors during GLX context creation can cause a hang without this fix.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_758921 = 95, // ClientAttribDefault resets the primitive restart state.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_762974 = 96, // Bad interaction of UBO and EXT_bindable_uniform in the same program.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_779707 = 97, // BPTC textures don't require CompressedSubImage3D on 4 block boundaries
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_746642 = 98, // Addresses returned by VBUM are made virtual to allow modeswitching with XP
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_790472 = 99, // Querying GLSL uniform array names returns "foo[0]" and UBO uniforms return locations of -1
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_792522 = 100, // Fix issue with aa downsample of fbo with mixed dimensions attachments
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_796862 = 101, // Context creation of version 1.0 should result in latest OpenGL version
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_625498 = 102, // Fix dual-core issue with glCallLists (see dlist_hell nvogtest)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_809142 = 103, // Incorrect restore of the program binary refcount causes memory leak
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_800902 = 104, // X crashes when making current to GLX window whose X window is gone
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_362397 = 105, // DivByZero expection when a Buffer attached to a texbo is resized to less than 1px.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_826092 = 106, // GL_ARB_pixel_buffer_object: check if GL errors are correctly set
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_822935 = 107, // LoopEnhance nvogtest support
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_857702 = 108, // driver good enough to handle glsl_ils_fmt* tests
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_845118 = 109, // Need to look at read drawable during read fbo validation
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_856656 = 110, // no known compiler exceptions on glsl_ils_misc* (can run test)
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_852161 = 111, // glMaterial doesn't update GLSL material built-in inside dlist
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_860989 = 112, // program tracking bits not updated by glPopAttrib
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_870498 = 113, // If drawbuffer settings do not match FBO attachment causes a crash
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_876641 = 114, // crash binding the same FBO to two threads simultaneously
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_879671 = 115, // drawElementsInstanced might crash if we copy not enabled vertex data
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_906242 = 116, // glFramebufferTexture and friends are not setting a GL error when the <texture> argument is zero
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_909200 = 117, // assembly CBUFFER and BUFFER4 arrays are sized with correct units
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_918415 = 118, // glMakeBufferNonResidentNV doesn't ensure the buffer is resident before doing its business
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_874617 = 119, // Fix for use-after-delete using FBO
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_920825 = 120, // Fix crash on calling glReadPixels with invalid parameters
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_930245 = 121, // Fix crash on calling glGetBufferPointervOES if buffer object name 0 is bound to target
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_930248 = 122, // Fix crash on glCopyTexSubImage3DOES when x or y is negative value
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_930253 = 123, // Fix crash on glDrawBuffersNV when <bufs> is NULL
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_930290 = 124, // call to glEGLImageTargetTexture2DOES when texture target is 0 excutes without error
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_934987 = 125, // Properly round non-antialiased line widths
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_874933 = 126, // LDDM non-CUDA-interop buffers allocated within CUDA reserved address range
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_936396 = 127, // Linux: Damage events are not generated on parents of GL drawables when GL drawable is created after the Damage object
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_882002 = 128, // Fix mip-mapped compressed NPOT texture's edges
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_937411 = 129, // Fix issues with drawElementeInstanced path and usage of vertex attrib divisor
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_940255 = 130, // Fix crash on querying EGL_STEREO_LAYOUT_NVX surface attribute value using eglQuerySurface
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_945327 = 131, // Fixed MT event and thread handle leaks
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_IS_OBJECT = 132, // The IsObject routines behave correct in that they return FALSE until first bind
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_953084 = 133, // Fix texture completeness check for EGLImage creation
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_960878 = 134, // NV_path_rendering is broken when programmable shaders are in use
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_874652 = 135, // [Cg/AR20] Illegit shader compiles without error: Illegit unreferenced function does not fail to compile
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_952196 = 136, // [Cg/AR20] Assert in vertex shader compilation when same attribute is assigned to multiple varyings
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_968228 = 137, // Default state for UNIFORM_BUFFER_{START,SIZE} is fixed to 0, instead of original -1.
- GL_DEBUG_CONTROL_GET_BUGFIX_PRESENT_BUG_968768 = 138, // Early Z logic is broken for stencil func GL_NEVER
-} __GLdebugControlGetBugfixPresentEnum;
-
-typedef struct __GLdebugControlGetBugfixPresentRec {
- __GLdebugControlGetBugfixPresentEnum bugfix; // [IN]
- GLboolean isSupported; // [OUT]
-} __GLdebugControlGetBugfixPresent;
-
-typedef enum {
- GL_DEBUG_CONTROL_ENABLE_AGGRESSIVE_EVICTION = 1,
- GL_DEBUG_CONTROL_ENABLE_MODS_CLIPID_TEST = 2,
- GL_DEBUG_CONTROL_ENABLE_WSPERF_PUSH = 3,
- GL_DEBUG_CONTROL_ENABLE_WSPERF_POP = 4,
- GL_DEBUG_CONTROL_ENABLE_WSPERF_REINIT_GC = 5, // Required before changes take affect
- GL_DEBUG_CONTROL_ENABLE_WS_VARRAY = 6,
- GL_DEBUG_CONTROL_ENABLE_SDDR = 7,
- GL_DEBUG_CONTROL_ENABLE_SDSR = 8,
- GL_DEBUG_CONTROL_ENABLE_LAZY_VBUM = 9,
- GL_DEBUG_CONTROL_ENABLE_LOOP_ENHANCE = 10,
- GL_DEBUG_CONTROL_ENABLE_VAB_IMMEDIATE_MODE = 11,
- GL_DEBUG_CONTROL_ENABLE_VAB_VERTEXARRAY = 12,
- GL_DEBUG_CONTROL_ENABLE_CLAW = 13,
-} __GLdebugControlEnableEnum;
-
-// may return an error if the enable isn't supported
-typedef struct __GLdebugControlEnablesRec {
- __GLdebugControlEnableEnum cap; // [IN]
- GLboolean enable; // [IN]
- GLboolean success; // [OUT]
-} __GLdebugControlEnables;
-
-typedef enum {
- GL_DEBUG_CONTROL_DETECT_FALLBACK_SOFTWARE_VALIDATE = 1,
-} __GLdebugControlDetectFallbackType;
-
-typedef struct __GLdebugControlDetectFallbackRec {
- // If a fallback of the specified type has occurred since the last reset,
- // this operation returns GL_TRUE in <result>. If <reset> is GL_TRUE, the
- // fallback flag will be reset.
- __GLdebugControlDetectFallbackType type; // [IN]
- GLboolean reset; // [IN]
- GLboolean result; // [OUT]
-} __GLdebugControlDetectFallback;
-
-typedef enum {
- GL_DEBUG_CONTROL_DUAL_CORE_CMD_CHECK_POSSIBLE = 1,
- GL_DEBUG_CONTROL_DUAL_CORE_CMD_CURRENT_MODE,
- GL_DEBUG_CONTROL_DUAL_CORE_CMD_ENTER,
- GL_DEBUG_CONTROL_DUAL_CORE_CMD_LEAVE
-} __GLdebugControlDualCoreCmd;
-
-typedef struct __GLdebugControlDualCoreRec {
- int size; // [IN] size of this struct; the cmd is ignored if there is a size mismatch
- __GLdebugControlDualCoreCmd cmd; // [IN]
- GLint arg1; // [IN]
- GLint result; // [OUT]
- GLint success; // [OUT]
-} __GLdebugControlDualCore;
-
-
-typedef enum {
- GL_DEBUG_CONTROL_LE_INIT,
- GL_DEBUG_CONTROL_LE_GET_LOOP,
- GL_DEBUG_CONTROL_LE_CHECK_LOOP,
- GL_DEBUG_CONTROL_LE_RESET_LOOP,
- GL_DEBUG_CONTROL_LE_DESTROY
-} __GLdebugControlLEcmd;
-
-typedef enum {
- GL_DEBUG_CONTROL_LE_SUCCESS,
- GL_DEBUG_CONTROL_LE_LOOP_REPLACED,
- GL_DEBUG_CONTROL_LE_NO_MORE_AVAILABLE, // indicates no more loops or applicatiosns available
- GL_DEBUG_CONTROL_LE_FAIL,
- GL_DEBUG_CONTROL_LE_FAIL_DUE_TO_OGL32,
- GL_DEBUG_CONTROL_LE_FAIL_STRUCT_MISMATCH,
-} __GLdebugControlLEreturnCodes;
-
-
-typedef struct __GLdebugControlLERec {
- __GLdebugControlLEcmd cmd; // [IN]
- int structSize; // [IN]
- __GLdebugControlLEreturnCodes result; // [OUT]
- union {
- struct {
- int appNumber; // [IN]
- } init;
- struct {
- int loopNumber; // [IN]
- void *pFunction; // [OUT]
- GLboolean color; // [OUT]
- GLboolean texture; // [OUT]
- GLboolean index; // [OUT]
- } getLoop;
- } u;
-} __GLdebugControlLE;
-
-
-typedef struct __GLdebugControlApicOglRec {
- void (*callbackProcDrawArrays)(void* basePtr, const GLint *first, const GLsizei *count, GLsizei primcount); // [IN]
-} __GLdebugControlApicOgl;
-
-typedef enum {
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_DISABLE_ALL = 1,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_GET_GLSL_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_SET_GLSL_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_GET_VIEWPORT_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_SET_VIEWPORT_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_GET_MATRIX_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_SET_MATRIX_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_GET_GLSTATE_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_SET_GLSTATE_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_GET_FB_STATUS_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_SET_FB_STATUS_CACHE,
- GL_DEBUG_CONTROL_THREADING_OPT_CMD_ENABLE_ALL = 0x0000FFFF,
-} __GLdebugControlThreadingOptimizationsCmd;
-
-typedef struct __GLdebugControlThreadingOptimizationsRec {
- int size; // [IN] size of this struct; the cmd is ignored if there is a size mismatch
- __GLdebugControlThreadingOptimizationsCmd cmd; // [IN]
- GLint arg1; // [IN]
- GLint result; // [OUT]
- GLint success; // [OUT]
-} __GLdebugControlThreadingOptimizations;
-
-typedef enum {
- GL_DEBUG_CONTROL_CLAW_CMD_RESET = 1,
- GL_DEBUG_CONTROL_CLAW_CMD_GET_ENABLES,
- GL_DEBUG_CONTROL_CLAW_CMD_SET_ENABLES_AND_RESET,
- GL_DEBUG_CONTROL_CLAW_CMD_DISALLOW,
- GL_DEBUG_CONTROL_CLAW_CMD_SET_OVERRIDE_ENABLES_AND_RESET,
-} __GLdebugControlClawCmd;
-
-typedef struct __GLdebugControlClawRec {
- int size; // [IN] size of this struct; the cmd is ignored if there is a size mismatch
- __GLdebugControlClawCmd cmd; // [IN]
- GLint arg1; // [IN]
- GLint result; // [OUT]
- GLint error; // [OUT]
-} __GLdebugControlClaw;
-
-typedef enum {
- // nvogtest test tagging
- GL_DEBUG_CONTROL_GET_GENERIC_STATISTIC_TAG_TEST = 0,
- GL_DEBUG_CONTROL_GET_GENERIC_STATISTIC_MUTEX_WORD = 1,
-} __GLdebugControlGetGenericStatisticType;
-
-typedef struct __GLdebugControlGetGenericStatisticRec {
- // If a fallback of the specified type has occurred since the last reset,
- // this operation returns GL_TRUE in <result>. If <reset> is GL_TRUE, the
- // fallback flag will be reset. If the driver understands the type, <success>
- // will be set to GL_TRUE, GL_FALSE otherwise.
- __GLdebugControlGetGenericStatisticType type; // [IN]
- GLboolean reset; // [IN]
- GLboolean success; // [OUT]
- unsigned int result; // [OUT]
-} __GLdebugControlGetGenericStatistic;
-
-typedef enum {
- // for blits (copypixels, drawpixels, readpixels, pbo teximage, copyteximage),
- // report which path performed the blit. Also count number of shaders
- // replaced, and fragment shaders that use constant color rendering.
- GL_DEBUG_CONTROL_GET_STATISTIC_BLIT_2D = 1,
- GL_DEBUG_CONTROL_GET_STATISTIC_BLIT_3D = 2,
- GL_DEBUG_CONTROL_GET_STATISTIC_BLIT_CE = 3,
- GL_DEBUG_CONTROL_GET_STATISTIC_BLIT_M2M = 4,
- GL_DEBUG_CONTROL_GET_STATISTIC_SHADER_REPLACEMENT = 5,
- GL_DEBUG_CONTROL_GET_STATISTIC_CONSTANT_COLOR_RENDERING = 6,
- GL_DEBUG_CONTROL_GET_STATISTIC_BLIT_3D_PFM = 7, // PixelsFromMemory in 3D class (GK20A+)
-} __GLdebugControlGetStatisticType;
-
-typedef struct __GLdebugControlGetStatisticRec {
- // If a fallback of the specified type has occurred since the last reset,
- // this operation returns GL_TRUE in <result>. If <reset> is GL_TRUE, the
- // fallback flag will be reset.
- __GLdebugControlGetStatisticType type; // [IN]
- GLboolean reset; // [IN]
- unsigned int result; // [OUT]
-} __GLdebugControlGetStatistic;
-
-typedef struct __GLdebugControlDoQuadroSlowdownRec {
- // Activates a test which will hang if the card is a GeForce.
- // when used with GL_DEBUG_CONTROL_FUNCTION_DO_QUADRO_SLOWDOWN_US, value used as microseconds
- // when used with GL_DEBUG_CONTROL_FUNCTION_DO_QUADRO_SLOWDOWN, value used as clock ticks
- unsigned int value; // [IN]
-} __GLdebugControlDoQuadroSlowdown;
-
-typedef enum {
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_INIT,
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_STREAM_VID,
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_STREAM_SYSHEAP,
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_MAP_FOR_READ,
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_FALLBACK,
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_MIGHT_STALL,
- __GL_DEBUG_CONTROL_BUFFER_OBJECT_STATE_INTEROP
-} __GLdebugControlBufferObjectState;
-
-typedef enum {
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_GPU_READ_VTX = 0,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_GPU_READ_INDEX,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_GPU_READ_BLIT,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_CPU_READ,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_CPU_WRITE,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_GPU_WRITE_BLIT,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_USER_MAP_AS_UPDATE,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_USER_MAP_AS_READ,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_SYNC_UPDATE_STALL,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_GPU_WRITE_BLIT_NONCOHERENT,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_GPU_HIGH_PRIORITY,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_INTEROP_VIDMEM,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_INTEROP_SYSMEM,
- __GL_DEBUG_CONTROL_BUFFER_COUNTER_COUNT
-} __GLdebugControlBufferCounter;
-
-typedef enum {
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_INVALID = 0,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_MALLOC,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_SYSHEAP,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_DMA_CACHED,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_DMA_CACHED_NONCOHERENT,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_VID_ONLY,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_VID_PLUS_MALLOC,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_VID_PLUS_SYSHEAP,
-
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_ANY_GPU_PREFER_SYSHEAP,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_ANY_GPU_PREFER_VID,
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_ANY_GPU_PREFER_CACHED,
-
- __GL_DEBUG_CONTROL_BUFFER_ALLOC_STRATEGY_COUNT,
-} __GLdebugControlBufferAllocStrategy;
-
-typedef enum {
- GL_DEBUG_CONTROL_BUFFER_OBJECT_SET_STALLING = 1,
- GL_DEBUG_CONTROL_BUFFER_OBJECT_GET_STATE = 2,
- GL_DEBUG_CONTROL_BUFFER_OBJECT_HIDE_STALLING = 3,
- GL_DEBUG_CONTROL_BUFFER_OBJECT_TAP_COUNTER = 4,
- GL_DEBUG_CONTROL_BUFFER_OBJECT_SET_COUNTER = 5,
-} __GLdebugControlBufferObjectCmd;
-
-typedef struct __GLdebugControlBufferObjectRec {
- __GLdebugControlBufferObjectCmd cmd; // [IN]
- unsigned int bit; // [IN]
- unsigned int inc; // [IN]
- GLenum target; // [IN]
- GLboolean hideStalling; // [IN]
- unsigned int state; // [OUT]
-} __GLdebugControlBufferObject;
-
-typedef enum {
- GL_DEBUG_CONTROL_INDEX_REORDERING_CONFIG_READ,
- GL_DEBUG_CONTROL_INDEX_REORDERING_CONFIG_WRITE,
-} __GLdebugControlIndexReorderingConfigCmd;
-
-typedef struct __GLdebugControlIndexReorderingConfigRec {
- __GLdebugControlIndexReorderingConfigCmd cmd; // [IN]
- unsigned int enabled;
- unsigned int minHitCnt;
- unsigned int minIndCnt;
- unsigned int synchronous;
- unsigned int subranges;
- float margin;
- float thresholdACMR;
- unsigned int ignoreThreshold; //Mostly for testing
- unsigned int forceReorder; //Mostly for testing
- unsigned int postTransformCacheSize;
- unsigned int cacheModel;
-} __GLdebugControlIndexReorderingConfig;
-
-typedef struct __GLdebugControlIndexReorderingStatsRec {
- unsigned int count;
-} __GLdebugControlIndexReorderingStats;
-
-typedef enum {
- // Capability types to be returned by GL_DEBUG_CONTROL_FUNCTION_GET_CAPS.
- // The type of <result> depends on the requested capability. The comment
- // after the type specifies the return type.
- GL_DEBUG_CONTROL_GET_CAPS_IS_QUADRO = 1, // Out Type: GLboolean
- GL_DEBUG_CONTROL_GET_CAPS_IS_FORCED_SYSMEM = 2, // Out Type: GLboolean
- GL_DEBUG_CONTROL_GET_CAPS_HAS_SHADOW_MAPPING_BUG_280195 = 3, // Out Type: GLboolean
-
- GL_DEBUG_CONTROL_GET_CAPS_HAS_INDEX_LIMIT = 4, // Out Type: GLboolean
-} __GLdebugControlGetCapsType;
-
-typedef struct __GLdebugControlGetCapsRec {
- // Returns internal data directly from the driver. <success> is set to
- // GL_TRUE if the operation was successful.
- // The type of <result> depends upon the capability that is requested.
- __GLdebugControlGetCapsType type; // [IN]
- GLboolean success; // [OUT]
- void* result; // [OUT]
-} __GLdebugControlGetCaps;
-
-typedef enum {
- GL_DEBUG_CONTROL_INJECT_RC_ERROR_PARSE_ERROR,
- GL_DEBUG_CONTROL_INJECT_RC_ERROR_DATA_ERROR,
-} __GLdebugControlInjectRcErrorType;
-
-typedef struct __GLdebugControlInjectRcErrorRec {
- __GLdebugControlInjectRcErrorType type; // [IN]
- GLboolean success; // [OUT]
-} __GLdebugControlInjectRcError;
-
-typedef struct __GLdebugControlQueryAppdbRec {
- GLuint *size; // [IN / OUT]
- GLchar *data; // [OUT, optional]
-} __GLdebugControlQueryAppdb;
-
-// Sends a 3D subchannel method
-// **DO NOT CALL IN CHECKED IN TESTS**
-typedef struct __GLdebugControlSend3DMethod {
- GLuint method; // [IN]
- GLuint data; // [IN]
-} __GLdebugControlSend3DMethod;
-
-typedef struct __GLdebugControlSetCycleStatsState {
- GLuint stateIndex; // [IN]
- GLuint stateValue; // [IN]
-} __GLdebugControlSetCycleStatsState;
-
-typedef enum {
- GL_DEBUG_CONTROL_WWMP_INSTALL_SIGNAL_HANDLER,
- GL_DEBUG_CONTROL_WWMP_ADD_WRITE_WATCH,
- GL_DEBUG_CONTROL_WWMP_DISABLE,
- GL_DEBUG_CONTROL_WWMP_GET_STATE,
-} __GLdebugControlWWMPCmd;
-
-typedef struct __GLdebugControlWWMPRec {
- __GLdebugControlWWMPCmd cmd; // [IN]
- union {
- struct {
- GLboolean result; // [OUT]
- void* trackAdr; // [IN]
- volatile GLintptr **watchAdr; // [OUT]
- volatile GLintptr *watchValue; // [OUT]
- void** trackDat; // [OUT]
- GLboolean *isTracked; // [OUT]
- } addWriteWatch;
- struct {
- GLboolean enabled; // [OUT]
- int sigactionPending; // [OUT]
- int sigactionInitialized; // [OUT]
- }getState;
- } u;
-} __GLdebugControlWWMP;
-
-typedef struct __GLdebugControlSetStateObjectGPURec {
- GLuint64EXT handle; // [IN]
- GLint dynamiccount; // [IN]
- const GLvoid *dynamicprops; // [IN]
-} __GLdebugControlSetStateObjectGPU;
-
-typedef enum {
- GL_DEBUG_CONTROL_GET_GPU_ADDRESS_BUFFER_OBJECT = 0,
-} __GLdebugControlGetGPUAddressObjectType;
-
-typedef struct __GLdebugControlGetGPUAddressRec {
- __GLdebugControlGetGPUAddressObjectType objectType; // [IN]
- GLenum target; // [IN]
- GLboolean success; // [OUT]
- GLuint64EXT address; // [OUT]
- GLuint64EXT size; // [OUT]
-} __GLdebugControlGetGPUAddress;
-
-typedef struct __GLdebugControlExtraCgcOptionsRec {
- GLuint argc; // [IN]
- GLchar **argv; // [IN]
- GLboolean success; // [OUT]
-} __GLdebugControlExtraCgcOptions;
-
-typedef struct __GLdebugControlNvogtestTestStartRec {
- GLboolean dcWasRestored; // [OUT]
-} __GLdebugControlNvogtestTestStart;
-
-typedef enum {
- GL_DEBUG_CONTROL_ES2_LEFT_EYE,
- GL_DEBUG_CONTROL_ES2_RIGHT_EYE,
-} __GLdebugControlES2StereoEye;
-
-typedef struct __GLdebugControlES2ReadBufferAutoStereoRec {
- GLuint eye; // [IN]
- GLenum mode; // [IN]
-} __GLdebugControlES2ReadBufferAutoStereo;
-
-typedef struct __GLdebugControlES2SetStereoParamsRec {
- GLuint control; // 0 => Stereo Disabled, else Enabled
- GLuint method; // NvGlStereoMethod
- GLuint changeSep;
- float separation;
- float convergence;
- float cutoff;
- float cutoffDir;
- GLuint screenWidth;
-} __GLdebugControlES2SetStereoParams;
-
-typedef struct __GLdebugControlES2DiskCacheCtrl {
- GLboolean enable;
- GLuint numEntries;
- GLuint numHits;
- GLboolean deleteCachedFiles;
- GLboolean blobEnable;
- GLuint numBlobEntries;
- GLuint numBlobHits;
-} __GLdebugControlES2DiskCacheCtrl;
-
-struct __GLdebugControlParametersRec
-{
- __GLdebugControlFunction function;
-
- // Note: This union is only aligned to 4B. Adding a member with a uint64 in it
- // will cause it to be aligned to 8B and break compatibility.
- union
- {
- __GLdebugControlIsSupported isSupported;
- __GLdebugControlEvictObject evictObject;
- __GLdebugControlGetBugfixPresent getBugfixPresent;
- __GLdebugControlEnables enables;
- __GLdebugControlDetectFallback detectFallback;
- __GLdebugControlClaw claw;
- __GLdebugControlGetGenericStatistic getGenericStatistic;
- __GLdebugControlGetStatistic getStatistic;
- __GLdebugControlDoQuadroSlowdown slowdown;
- __GLdebugControlBufferObject bufObject;
- __GLdebugControlGetCaps getCaps;
- __GLdebugControlInjectRcError injectRcError;
- __GLdebugControlQueryAppdb queryAppdb;
- __GLdebugControlSend3DMethod send3DMethod;
- __GLdebugControlSetCycleStatsState setCycleStatsState;
- __GLdebugControlWWMP wwmp;
- // Add new entries to u2 instead of u.
- } u;
-
- // This union is 8B-aligned.
- union
- {
- GLuint64EXT x; // force 8B alignment.
- __GLdebugControlSetStateObjectGPU setStateObjectGPU;
- __GLdebugControlThreadingOptimizations threadOptimizations;
- __GLdebugControlDualCore dualCore;
- __GLdebugControlLE loopEnhance;
- __GLdebugControlApicOgl apicOgl;
- __GLdebugControlGetGPUAddress getGPUAddress;
- __GLdebugControlExtraCgcOptions extraCgcOptions;
- __GLdebugControlNvogtestTestStart nvogtestTestStart;
- __GLdebugControlES2ReadBufferAutoStereo readBufferAutoStereo;
- __GLdebugControlES2SetStereoParams setStereoParams;
- __GLdebugControlES2DiskCacheCtrl diskCacheCtrl;
- __GLdebugControlIndexReorderingConfig ibrCfg;
- __GLdebugControlIndexReorderingStats ibrStats;
- } u2;
-};
-
-
-// All implementations that export this entrypoint support the function
-// IS_SUPPORTED. Whether or not other functions are supported is
-// implementation defined.
-//
-// The correct usage is as follows. Let's say you want to use the function
-// EVICT_OBJECT:
-//
-// 1) glDebugControlNVX( {IS_SUPPORTED, EVICT_OBJECT, &result} );
-// 2) stop if result is FALSE
-// 3) glDebugControlNVX( {EVICT_OBJECT, objType, id} );
-//
-#define PROC_DebugControlNVX gl6813513874685413
-
-
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//
-// The remainder of this file is the legacy interface. It is still used by
-// nvogtest and nvapi. Eventually uses of the old interface will be ported to
-// the new interface, at which time the old interface will be removed.
-//
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-// bump this every time you change the list of recognized <pname> values.
-#define __NVOGLDEBUG_ENUM_VERSION 3
-
-// The following values may be passed as <pname> to
-// __NvOglDebugSeti and __NvOglDebugGeti.
-//
-// __NVOGLDEBUG_USER_1 and __NVOGLDEBUG_USER_2 should never be used in
-// checked-in code. Their purpose is for quick hacks while debugging or
-// developing new code. By including them here a priori, an engineer can
-// quickly use them without modifying a key .h file that causes recompilation
-// of the world.
-//
-// __NVOGLDEBUG_NVTRACE_LEVEL refers to the nvTraceLevel.
-//
-#define __NVOGLDEBUG_USER_1 0x8C50
-#define __NVOGLDEBUG_USER_2 0x8C51
-#define __NVOGLDEBUG_NVTRACE_LEVEL 0x8C52
-#define __NVOGLDEBUG_NVTRACE_OPTIONS 0x8C53
-#define __NVOGLDEBUG_VERSION 0x8C54
-#define __NVOGLDEBUG_TAG_TEST 0x8C55
-
-#define __NVOGLDEBUG_NVEXPERT_LEVEL 0x8C56
-#define __NVOGLDEBUG_NVEXPERT_CALLBACK 0x8C57
-#define __NVOGLDEBUG_NVEXPERT_MASK0 0x8C58
-
-#define __NVOGLDEBUG_TEMP0 0x8C59
-#define __NVOGLDEBUG_TEMP1 0x8C5A
-#define __NVOGLDEBUG_TEMP2 0x8C5B
-#define __NVOGLDEBUG_TEMP3 0x8C5C
-#define __NVOGLDEBUG_TEMP4 0x8C5D
-#define __NVOGLDEBUG_INSTRUMENTATION_ENABLED 0x8C5E
-#define __NVOGLDEBUG_OPTIONS 0x8C5F
-
-#define __NVOGLDEBUG_NVTRACE_MASK0 0x8C60
-#define __NVOGLDEBUG_NVTRACE_MASK1 0x8C61
-#define __NVOGLDEBUG_NVTRACE_MASK2 0x8C62
-#define __NVOGLDEBUG_NVTRACE_MASK3 0x8C63
-#define __NVOGLDEBUG_NVTRACE_MASK4 0x8C64
-#define __NVOGLDEBUG_NVTRACE_MASK5 0x8C65
-#define __NVOGLDEBUG_NVTRACE_MASK6 0x8C66
-#define __NVOGLDEBUG_NVTRACE_MASK7 0x8C67
-#define __NVOGLDEBUG_NVTRACE_MASK8 0x8C68
-#define __NVOGLDEBUG_NVTRACE_MASK9 0x8C69
-#define __NVOGLDEBUG_NVTRACE_MASK10 0x8C6A
-#define __NVOGLDEBUG_NVTRACE_MASK11 0x8C6B
-#define __NVOGLDEBUG_NVTRACE_MASK12 0x8C6C
-#define __NVOGLDEBUG_NVTRACE_MASK13 0x8C6D
-#define __NVOGLDEBUG_NVTRACE_MASK14 0x8C6E
-#define __NVOGLDEBUG_NVTRACE_MASK15 0x8C6F
-
-
-// Used to set the value of a debug variable. Returns the old value.
-// XXX deprecated, do not use
-int GLAPIENTRY __NvOglDebugSeti (unsigned int pname, int param);
-typedef int (GLAPIENTRY * PFN__NVOGLDEBUGSETIPROC) (unsigned int pname, int param);
-
-// Used to get the value of a debug variable.
-// XXX deprecated, do not use
-int GLAPIENTRY __NvOglDebugGeti (unsigned int pname);
-typedef int (GLAPIENTRY * PFN__NVOGLDEBUGGETIPROC) (unsigned int pname);
-
-// Used to set the value of a debug variable. Returns the old value.
-// XXX deprecated, do not use
-void* GLAPIENTRY __NvOglDebugSetv (unsigned int pname, void* param);
-typedef void* (GLAPIENTRY * PFN__NVOGLDEBUGSETVPROC) (unsigned int pname, void* param);
-
-// Used to get the value of a debug variable.
-// XXX deprecated, do not use
-void* GLAPIENTRY __NvOglDebugGetv (unsigned int pname);
-typedef void* (GLAPIENTRY * PFN__NVOGLDEBUGGETVPROC) (unsigned int pname);
-
-// keep this in sync with the ogl driver!!!
-#define OGL_PERF_STRAT_CLAW_ENABLED 0x00000001
-#define OGL_PERF_STRAT_CLAW_IGNORE_TRASH 0x00000040
-#define OGL_PERF_STRAT_CLAW_FORCE_EXECUTE_BLOCK 0x00000200
-#define OGL_PERF_STRAT_CLAW_FORCE_EXECUTE_PIKACHOU 0x00000400
-#define OGL_PERF_STRAT_CLAW_PIXEL_ACCURATE 0x00008000
-
-#if defined(QT3DS_MACINTOSH_OSX)
-
-// Used to emulate the debug control API via gldSetInteger. Values of 5000 or greater
-// are reserved for internal driver use.
-enum GLDVendorIntegerParameter
-{
- GLD_NVIDIA_DEBUG_CONTROL = 5000,
-};
-
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglew.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglew.h
deleted file mode 100644
index 05f054fc..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglew.h
+++ /dev/null
@@ -1,1363 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author may be used to endorse or promote products
-** derived from this software without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-** THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __wglew_h__
-#define __wglew_h__
-#define __WGLEW_H__
-
-#ifdef __wglext_h_
-#error wglext.h included before wglew.h
-#endif
-
-#define __wglext_h_
-
-#if !defined(WINAPI)
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN 1
-# endif
-#include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-#endif
-
-/*
- * GLEW_STATIC needs to be set when using the static version.
- * GLEW_BUILD is set when building the DLL version.
- */
-#ifdef GLEW_STATIC
-# define GLEWAPI extern
-#else
-# ifdef GLEW_BUILD
-# define GLEWAPI extern __declspec(dllexport)
-# else
-# define GLEWAPI extern __declspec(dllimport)
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* -------------------------- WGL_3DFX_multisample ------------------------- */
-
-#ifndef WGL_3DFX_multisample
-#define WGL_3DFX_multisample 1
-
-#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
-#define WGL_SAMPLES_3DFX 0x2061
-
-#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample)
-
-#endif /* WGL_3DFX_multisample */
-
-/* ------------------------- WGL_3DL_stereo_control ------------------------ */
-
-#ifndef WGL_3DL_stereo_control
-#define WGL_3DL_stereo_control 1
-
-#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
-#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
-#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
-#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
-
-typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
-
-#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL)
-
-#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control)
-
-#endif /* WGL_3DL_stereo_control */
-
-/* ------------------------ WGL_AMD_gpu_association ------------------------ */
-
-#ifndef WGL_AMD_gpu_association
-#define WGL_AMD_gpu_association 1
-
-#define WGL_GPU_VENDOR_AMD 0x1F00
-#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
-#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define WGL_GPU_RAM_AMD 0x21A3
-#define WGL_GPU_CLOCK_AMD 0x21A4
-#define WGL_GPU_NUM_PIPES_AMD 0x21A5
-#define WGL_GPU_NUM_SIMD_AMD 0x21A6
-#define WGL_GPU_NUM_RB_AMD 0x21A7
-#define WGL_GPU_NUM_SPI_AMD 0x21A8
-
-typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList);
-typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
-typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
-typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
-typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids);
-typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data);
-typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
-
-#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD)
-#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD)
-#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD)
-#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD)
-#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD)
-#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD)
-#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD)
-#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD)
-#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD)
-
-#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association)
-
-#endif /* WGL_AMD_gpu_association */
-
-/* ------------------------- WGL_ARB_buffer_region ------------------------- */
-
-#ifndef WGL_ARB_buffer_region
-#define WGL_ARB_buffer_region 1
-
-#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
-#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
-#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
-#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
-
-typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
-typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
-typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
-
-#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB)
-#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB)
-#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB)
-#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB)
-
-#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region)
-
-#endif /* WGL_ARB_buffer_region */
-
-/* ------------------------- WGL_ARB_create_context ------------------------ */
-
-#ifndef WGL_ARB_create_context
-#define WGL_ARB_create_context 1
-
-#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
-#define WGL_CONTEXT_FLAGS_ARB 0x2094
-#define ERROR_INVALID_VERSION_ARB 0x2095
-#define ERROR_INVALID_PROFILE_ARB 0x2096
-
-typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
-
-#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB)
-
-#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context)
-
-#endif /* WGL_ARB_create_context */
-
-/* --------------------- WGL_ARB_create_context_profile -------------------- */
-
-#ifndef WGL_ARB_create_context_profile
-#define WGL_ARB_create_context_profile 1
-
-#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
-
-#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile)
-
-#endif /* WGL_ARB_create_context_profile */
-
-/* ------------------- WGL_ARB_create_context_robustness ------------------- */
-
-#ifndef WGL_ARB_create_context_robustness
-#define WGL_ARB_create_context_robustness 1
-
-#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
-
-#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness)
-
-#endif /* WGL_ARB_create_context_robustness */
-
-/* ----------------------- WGL_ARB_extensions_string ----------------------- */
-
-#ifndef WGL_ARB_extensions_string
-#define WGL_ARB_extensions_string 1
-
-typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
-
-#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB)
-
-#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string)
-
-#endif /* WGL_ARB_extensions_string */
-
-/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */
-
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_ARB_framebuffer_sRGB 1
-
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
-
-#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB)
-
-#endif /* WGL_ARB_framebuffer_sRGB */
-
-/* ----------------------- WGL_ARB_make_current_read ----------------------- */
-
-#ifndef WGL_ARB_make_current_read
-#define WGL_ARB_make_current_read 1
-
-#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
-#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
-
-typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-
-#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB)
-#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB)
-
-#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read)
-
-#endif /* WGL_ARB_make_current_read */
-
-/* -------------------------- WGL_ARB_multisample -------------------------- */
-
-#ifndef WGL_ARB_multisample
-#define WGL_ARB_multisample 1
-
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-
-#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample)
-
-#endif /* WGL_ARB_multisample */
-
-/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */
-
-#ifndef WGL_ARB_pbuffer
-#define WGL_ARB_pbuffer 1
-
-#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
-#define WGL_PBUFFER_LARGEST_ARB 0x2033
-#define WGL_PBUFFER_WIDTH_ARB 0x2034
-#define WGL_PBUFFER_HEIGHT_ARB 0x2035
-#define WGL_PBUFFER_LOST_ARB 0x2036
-
-DECLARE_HANDLE(HPBUFFERARB);
-
-typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
-typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
-typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
-typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue);
-typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
-
-#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB)
-#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB)
-#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB)
-#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB)
-#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB)
-
-#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer)
-
-#endif /* WGL_ARB_pbuffer */
-
-/* -------------------------- WGL_ARB_pixel_format ------------------------- */
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_ARB_pixel_format 1
-
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues);
-
-#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB)
-#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB)
-#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB)
-
-#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format)
-
-#endif /* WGL_ARB_pixel_format */
-
-/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */
-
-#ifndef WGL_ARB_pixel_format_float
-#define WGL_ARB_pixel_format_float 1
-
-#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
-
-#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float)
-
-#endif /* WGL_ARB_pixel_format_float */
-
-/* ------------------------- WGL_ARB_render_texture ------------------------ */
-
-#ifndef WGL_ARB_render_texture
-#define WGL_ARB_render_texture 1
-
-#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
-#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
-#define WGL_TEXTURE_FORMAT_ARB 0x2072
-#define WGL_TEXTURE_TARGET_ARB 0x2073
-#define WGL_MIPMAP_TEXTURE_ARB 0x2074
-#define WGL_TEXTURE_RGB_ARB 0x2075
-#define WGL_TEXTURE_RGBA_ARB 0x2076
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
-#define WGL_TEXTURE_1D_ARB 0x2079
-#define WGL_TEXTURE_2D_ARB 0x207A
-#define WGL_MIPMAP_LEVEL_ARB 0x207B
-#define WGL_CUBE_MAP_FACE_ARB 0x207C
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
-#define WGL_FRONT_LEFT_ARB 0x2083
-#define WGL_FRONT_RIGHT_ARB 0x2084
-#define WGL_BACK_LEFT_ARB 0x2085
-#define WGL_BACK_RIGHT_ARB 0x2086
-#define WGL_AUX0_ARB 0x2087
-#define WGL_AUX1_ARB 0x2088
-#define WGL_AUX2_ARB 0x2089
-#define WGL_AUX3_ARB 0x208A
-#define WGL_AUX4_ARB 0x208B
-#define WGL_AUX5_ARB 0x208C
-#define WGL_AUX6_ARB 0x208D
-#define WGL_AUX7_ARB 0x208E
-#define WGL_AUX8_ARB 0x208F
-#define WGL_AUX9_ARB 0x2090
-
-typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList);
-
-#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB)
-#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB)
-#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB)
-
-#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture)
-
-#endif /* WGL_ARB_render_texture */
-
-/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */
-
-#ifndef WGL_ATI_pixel_format_float
-#define WGL_ATI_pixel_format_float 1
-
-#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
-#define GL_RGBA_FLOAT_MODE_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-
-#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float)
-
-#endif /* WGL_ATI_pixel_format_float */
-
-/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */
-
-#ifndef WGL_ATI_render_texture_rectangle
-#define WGL_ATI_render_texture_rectangle 1
-
-#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
-
-#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle)
-
-#endif /* WGL_ATI_render_texture_rectangle */
-
-/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */
-
-#ifndef WGL_EXT_create_context_es2_profile
-#define WGL_EXT_create_context_es2_profile 1
-
-#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-
-#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile)
-
-#endif /* WGL_EXT_create_context_es2_profile */
-
-/* -------------------------- WGL_EXT_depth_float -------------------------- */
-
-#ifndef WGL_EXT_depth_float
-#define WGL_EXT_depth_float 1
-
-#define WGL_DEPTH_FLOAT_EXT 0x2040
-
-#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float)
-
-#endif /* WGL_EXT_depth_float */
-
-/* ---------------------- WGL_EXT_display_color_table ---------------------- */
-
-#ifndef WGL_EXT_display_color_table
-#define WGL_EXT_display_color_table 1
-
-typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length);
-
-#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT)
-#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT)
-#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT)
-#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT)
-
-#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table)
-
-#endif /* WGL_EXT_display_color_table */
-
-/* ----------------------- WGL_EXT_extensions_string ----------------------- */
-
-#ifndef WGL_EXT_extensions_string
-#define WGL_EXT_extensions_string 1
-
-typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
-
-#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT)
-
-#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string)
-
-#endif /* WGL_EXT_extensions_string */
-
-/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */
-
-#ifndef WGL_EXT_framebuffer_sRGB
-#define WGL_EXT_framebuffer_sRGB 1
-
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
-
-#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB)
-
-#endif /* WGL_EXT_framebuffer_sRGB */
-
-/* ----------------------- WGL_EXT_make_current_read ----------------------- */
-
-#ifndef WGL_EXT_make_current_read
-#define WGL_EXT_make_current_read 1
-
-#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
-
-typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-
-#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT)
-#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT)
-
-#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read)
-
-#endif /* WGL_EXT_make_current_read */
-
-/* -------------------------- WGL_EXT_multisample -------------------------- */
-
-#ifndef WGL_EXT_multisample
-#define WGL_EXT_multisample 1
-
-#define WGL_SAMPLE_BUFFERS_EXT 0x2041
-#define WGL_SAMPLES_EXT 0x2042
-
-#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample)
-
-#endif /* WGL_EXT_multisample */
-
-/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */
-
-#ifndef WGL_EXT_pbuffer
-#define WGL_EXT_pbuffer 1
-
-#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
-#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
-#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
-#define WGL_PBUFFER_LARGEST_EXT 0x2033
-#define WGL_PBUFFER_WIDTH_EXT 0x2034
-#define WGL_PBUFFER_HEIGHT_EXT 0x2035
-
-DECLARE_HANDLE(HPBUFFEREXT);
-
-typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
-typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
-typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
-typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);
-typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
-
-#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT)
-#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT)
-#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT)
-#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT)
-#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT)
-
-#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer)
-
-#endif /* WGL_EXT_pbuffer */
-
-/* -------------------------- WGL_EXT_pixel_format ------------------------- */
-
-#ifndef WGL_EXT_pixel_format
-#define WGL_EXT_pixel_format 1
-
-#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
-#define WGL_DRAW_TO_WINDOW_EXT 0x2001
-#define WGL_DRAW_TO_BITMAP_EXT 0x2002
-#define WGL_ACCELERATION_EXT 0x2003
-#define WGL_NEED_PALETTE_EXT 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
-#define WGL_SWAP_METHOD_EXT 0x2007
-#define WGL_NUMBER_OVERLAYS_EXT 0x2008
-#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
-#define WGL_TRANSPARENT_EXT 0x200A
-#define WGL_TRANSPARENT_VALUE_EXT 0x200B
-#define WGL_SHARE_DEPTH_EXT 0x200C
-#define WGL_SHARE_STENCIL_EXT 0x200D
-#define WGL_SHARE_ACCUM_EXT 0x200E
-#define WGL_SUPPORT_GDI_EXT 0x200F
-#define WGL_SUPPORT_OPENGL_EXT 0x2010
-#define WGL_DOUBLE_BUFFER_EXT 0x2011
-#define WGL_STEREO_EXT 0x2012
-#define WGL_PIXEL_TYPE_EXT 0x2013
-#define WGL_COLOR_BITS_EXT 0x2014
-#define WGL_RED_BITS_EXT 0x2015
-#define WGL_RED_SHIFT_EXT 0x2016
-#define WGL_GREEN_BITS_EXT 0x2017
-#define WGL_GREEN_SHIFT_EXT 0x2018
-#define WGL_BLUE_BITS_EXT 0x2019
-#define WGL_BLUE_SHIFT_EXT 0x201A
-#define WGL_ALPHA_BITS_EXT 0x201B
-#define WGL_ALPHA_SHIFT_EXT 0x201C
-#define WGL_ACCUM_BITS_EXT 0x201D
-#define WGL_ACCUM_RED_BITS_EXT 0x201E
-#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
-#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
-#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
-#define WGL_DEPTH_BITS_EXT 0x2022
-#define WGL_STENCIL_BITS_EXT 0x2023
-#define WGL_AUX_BUFFERS_EXT 0x2024
-#define WGL_NO_ACCELERATION_EXT 0x2025
-#define WGL_GENERIC_ACCELERATION_EXT 0x2026
-#define WGL_FULL_ACCELERATION_EXT 0x2027
-#define WGL_SWAP_EXCHANGE_EXT 0x2028
-#define WGL_SWAP_COPY_EXT 0x2029
-#define WGL_SWAP_UNDEFINED_EXT 0x202A
-#define WGL_TYPE_RGBA_EXT 0x202B
-#define WGL_TYPE_COLORINDEX_EXT 0x202C
-
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues);
-
-#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT)
-#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT)
-#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT)
-
-#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format)
-
-#endif /* WGL_EXT_pixel_format */
-
-/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */
-
-#ifndef WGL_EXT_pixel_format_packed_float
-#define WGL_EXT_pixel_format_packed_float 1
-
-#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
-
-#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float)
-
-#endif /* WGL_EXT_pixel_format_packed_float */
-
-/* -------------------------- WGL_EXT_swap_control ------------------------- */
-
-#ifndef WGL_EXT_swap_control
-#define WGL_EXT_swap_control 1
-
-typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-
-#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT)
-#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT)
-
-#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control)
-
-#endif /* WGL_EXT_swap_control */
-
-/* --------------------- WGL_I3D_digital_video_control --------------------- */
-
-#ifndef WGL_I3D_digital_video_control
-#define WGL_I3D_digital_video_control 1
-
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
-#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
-#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
-
-typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
-typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
-
-#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D)
-#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D)
-
-#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control)
-
-#endif /* WGL_I3D_digital_video_control */
-
-/* ----------------------------- WGL_I3D_gamma ----------------------------- */
-
-#ifndef WGL_I3D_gamma
-#define WGL_I3D_gamma 1
-
-#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
-#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
-
-typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue);
-typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
-typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue);
-typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
-
-#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D)
-#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D)
-#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D)
-#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D)
-
-#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma)
-
-#endif /* WGL_I3D_gamma */
-
-/* ---------------------------- WGL_I3D_genlock ---------------------------- */
-
-#ifndef WGL_I3D_genlock
-#define WGL_I3D_genlock 1
-
-#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
-#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
-#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
-#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
-#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
-#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
-#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
-#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
-#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
-
-typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
-typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource);
-typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag);
-typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay);
-
-#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D)
-#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D)
-#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D)
-#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D)
-#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D)
-#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D)
-#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D)
-#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D)
-#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D)
-#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D)
-#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D)
-#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D)
-
-#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock)
-
-#endif /* WGL_I3D_genlock */
-
-/* -------------------------- WGL_I3D_image_buffer ------------------------- */
-
-#ifndef WGL_I3D_image_buffer
-#define WGL_I3D_image_buffer 1
-
-#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
-#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
-
-typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count);
-typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
-typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
-typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count);
-
-#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D)
-#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D)
-#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D)
-#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D)
-
-#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer)
-
-#endif /* WGL_I3D_image_buffer */
-
-/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */
-
-#ifndef WGL_I3D_swap_frame_lock
-#define WGL_I3D_swap_frame_lock 1
-
-typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag);
-
-#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D)
-#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D)
-#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D)
-#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D)
-
-#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock)
-
-#endif /* WGL_I3D_swap_frame_lock */
-
-/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */
-
-#ifndef WGL_I3D_swap_frame_usage
-#define WGL_I3D_swap_frame_usage 1
-
-typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
-
-#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D)
-#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D)
-#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D)
-#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D)
-
-#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage)
-
-#endif /* WGL_I3D_swap_frame_usage */
-
-/* --------------------------- WGL_NV_DX_interop --------------------------- */
-
-#ifndef WGL_NV_DX_interop
-#define WGL_NV_DX_interop 1
-
-#define WGL_ACCESS_READ_ONLY_NV 0x0000
-#define WGL_ACCESS_READ_WRITE_NV 0x0001
-#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002
-
-typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
-typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
-typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
-typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice);
-typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
-typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle);
-typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
-typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
-
-#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV)
-#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV)
-#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV)
-#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV)
-#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV)
-#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV)
-#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV)
-#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV)
-
-#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop)
-
-#endif /* WGL_NV_DX_interop */
-
-/* --------------------------- WGL_NV_copy_image --------------------------- */
-
-#ifndef WGL_NV_copy_image
-#define WGL_NV_copy_image 1
-
-typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV)
-
-#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image)
-
-#endif /* WGL_NV_copy_image */
-
-/* -------------------------- WGL_NV_float_buffer -------------------------- */
-
-#ifndef WGL_NV_float_buffer
-#define WGL_NV_float_buffer 1
-
-#define WGL_FLOAT_COMPONENTS_NV 0x20B0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
-#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
-#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
-#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
-#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
-
-#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer)
-
-#endif /* WGL_NV_float_buffer */
-
-/* -------------------------- WGL_NV_gpu_affinity -------------------------- */
-
-#ifndef WGL_NV_gpu_affinity
-#define WGL_NV_gpu_affinity 1
-
-#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
-#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
-
-DECLARE_HANDLE(HGPUNV);
-typedef struct _GPU_DEVICE {
- DWORD cb;
- CHAR DeviceName[32];
- CHAR DeviceString[128];
- DWORD Flags;
- RECT rcVirtualScreen;
-} GPU_DEVICE, *PGPU_DEVICE;
-
-typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
-typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
-typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
-typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
-typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
-
-#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV)
-#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV)
-#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV)
-#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV)
-#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV)
-
-#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity)
-
-#endif /* WGL_NV_gpu_affinity */
-
-/* ---------------------- WGL_NV_multisample_coverage ---------------------- */
-
-#ifndef WGL_NV_multisample_coverage
-#define WGL_NV_multisample_coverage 1
-
-#define WGL_COVERAGE_SAMPLES_NV 0x2042
-#define WGL_COLOR_SAMPLES_NV 0x20B9
-
-#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage)
-
-#endif /* WGL_NV_multisample_coverage */
-
-/* -------------------------- WGL_NV_present_video ------------------------- */
-
-#ifndef WGL_NV_present_video
-#define WGL_NV_present_video 1
-
-#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
-
-DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
-
-typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList);
-typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList);
-typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue);
-
-#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV)
-#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV)
-#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV)
-
-#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video)
-
-#endif /* WGL_NV_present_video */
-
-/* ---------------------- WGL_NV_render_depth_texture ---------------------- */
-
-#ifndef WGL_NV_render_depth_texture
-#define WGL_NV_render_depth_texture 1
-
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
-#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
-#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
-#define WGL_DEPTH_COMPONENT_NV 0x20A7
-
-#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture)
-
-#endif /* WGL_NV_render_depth_texture */
-
-/* -------------------- WGL_NV_render_texture_rectangle -------------------- */
-
-#ifndef WGL_NV_render_texture_rectangle
-#define WGL_NV_render_texture_rectangle 1
-
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
-#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
-
-#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle)
-
-#endif /* WGL_NV_render_texture_rectangle */
-
-/* --------------------------- WGL_NV_swap_group --------------------------- */
-
-#ifndef WGL_NV_swap_group
-#define WGL_NV_swap_group 1
-
-typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
-typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count);
-typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers);
-typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier);
-typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
-
-#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV)
-#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV)
-#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV)
-#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV)
-#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV)
-#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV)
-
-#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group)
-
-#endif /* WGL_NV_swap_group */
-
-/* ----------------------- WGL_NV_vertex_array_range ----------------------- */
-
-#ifndef WGL_NV_vertex_array_range
-#define WGL_NV_vertex_array_range 1
-
-typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
-typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
-
-#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV)
-#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV)
-
-#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range)
-
-#endif /* WGL_NV_vertex_array_range */
-
-/* -------------------------- WGL_NV_video_capture ------------------------- */
-
-#ifndef WGL_NV_video_capture
-#define WGL_NV_video_capture 1
-
-#define WGL_UNIQUE_ID_NV 0x20CE
-#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-
-DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
-
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
-typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);
-typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-
-#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV)
-#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV)
-#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV)
-#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV)
-#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV)
-
-#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture)
-
-#endif /* WGL_NV_video_capture */
-
-/* -------------------------- WGL_NV_video_output -------------------------- */
-
-#ifndef WGL_NV_video_output
-#define WGL_NV_video_output 1
-
-#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
-#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
-#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
-#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
-#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
-#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
-#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define WGL_VIDEO_OUT_FRAME 0x20C8
-#define WGL_VIDEO_OUT_FIELD_1 0x20C9
-#define WGL_VIDEO_OUT_FIELD_2 0x20CA
-#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
-#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
-
-DECLARE_HANDLE(HPVIDEODEV);
-
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock);
-
-#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV)
-#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV)
-#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV)
-#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV)
-#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV)
-#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV)
-
-#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output)
-
-#endif /* WGL_NV_video_output */
-
-/* -------------------------- WGL_OML_sync_control ------------------------- */
-
-#ifndef WGL_OML_sync_control
-#define WGL_OML_sync_control 1
-
-typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator);
-typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc);
-typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc);
-typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc);
-
-#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML)
-#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML)
-#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML)
-#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML)
-#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML)
-#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML)
-
-#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control)
-
-#endif /* WGL_OML_sync_control */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-#define WGLEW_EXPORT
-#else
-#define WGLEW_EXPORT GLEWAPI
-#endif /* GLEW_MX */
-
-#ifdef GLEW_MX
-struct WGLEWContextStruct
-{
-#endif /* GLEW_MX */
-
-WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;
-
-WGLEW_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD;
-WGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD;
-WGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD;
-WGLEW_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD;
-WGLEW_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;
-WGLEW_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;
-WGLEW_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;
-WGLEW_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
-WGLEW_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;
-
-WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
-WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
-WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
-WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
-
-WGLEW_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;
-
-WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
-
-WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
-WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
-
-WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
-WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
-WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
-WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
-WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
-
-WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
-WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
-WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
-
-WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
-WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
-WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
-
-WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
-WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
-WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
-WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
-
-WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
-
-WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
-WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
-
-WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
-WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
-WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
-WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
-WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
-
-WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
-WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
-WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
-
-WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
-WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
-
-WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
-WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
-
-WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
-WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
-WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
-WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
-
-WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
-WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
-WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
-WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
-WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
-WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
-WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
-WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
-WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
-WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
-WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
-WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
-
-WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
-WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
-WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
-WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
-
-WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
-WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
-WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
-WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
-
-WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
-WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
-WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
-WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
-
-WGLEW_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV;
-WGLEW_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV;
-WGLEW_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV;
-WGLEW_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV;
-WGLEW_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV;
-WGLEW_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV;
-WGLEW_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV;
-WGLEW_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;
-
-WGLEW_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
-
-WGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
-WGLEW_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
-WGLEW_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
-WGLEW_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;
-WGLEW_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;
-
-WGLEW_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;
-WGLEW_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;
-WGLEW_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;
-
-WGLEW_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;
-WGLEW_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;
-WGLEW_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;
-WGLEW_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;
-WGLEW_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;
-WGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
-
-WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
-WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
-
-WGLEW_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV;
-WGLEW_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV;
-WGLEW_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV;
-WGLEW_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV;
-WGLEW_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV;
-
-WGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
-WGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
-WGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
-WGLEW_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;
-WGLEW_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;
-WGLEW_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;
-
-WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
-WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
-WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
-WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
-WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
-WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
-WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample;
-WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control;
-WGLEW_EXPORT GLboolean __WGLEW_AMD_gpu_association;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_profile;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
-WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture;
-WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
-WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;
-WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control;
-WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
-WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma;
-WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock;
-WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;
-WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
-WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
-WGLEW_EXPORT GLboolean __WGLEW_NV_DX_interop;
-WGLEW_EXPORT GLboolean __WGLEW_NV_copy_image;
-WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;
-WGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
-WGLEW_EXPORT GLboolean __WGLEW_NV_multisample_coverage;
-WGLEW_EXPORT GLboolean __WGLEW_NV_present_video;
-WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
-WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
-WGLEW_EXPORT GLboolean __WGLEW_NV_swap_group;
-WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
-WGLEW_EXPORT GLboolean __WGLEW_NV_video_capture;
-WGLEW_EXPORT GLboolean __WGLEW_NV_video_output;
-WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
-
-#ifdef GLEW_MX
-}; /* WGLEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-
-typedef struct WGLEWContextStruct WGLEWContext;
-GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx);
-GLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name);
-
-#define wglewInit() wglewContextInit(wglewGetContext())
-#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
-
-#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x))
-#define WGLEW_GET_FUN(x) wglewGetContext()->x
-
-#else /* GLEW_MX */
-
-#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define WGLEW_GET_FUN(x) x
-
-GLEWAPI GLboolean wglewIsSupported (const char* name);
-
-#endif /* GLEW_MX */
-
-GLEWAPI GLboolean wglewGetExtension (const char* name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#undef GLEWAPI
-
-#endif /* __wglew_h__ */
diff --git a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglext.h b/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglext.h
deleted file mode 100644
index ac632cce..00000000
--- a/src/Runtime/ogl-runtime/src/3rdparty/platformspecific/Windows/PlatformLibs/GL/wglext.h
+++ /dev/null
@@ -1,421 +0,0 @@
-#ifndef __wglext_h_
-#define __wglext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2013-2016 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-** http://www.opengl.org/registry/
-*/
-
-#ifndef GLAPI
-# define GLAPI __stdcall
-# define __DEFINED_GLAPI
-#endif
-
-DECLARE_HANDLE(HPBUFFERARB);
-DECLARE_HANDLE(HPVIDEODEVICE);
-DECLARE_HANDLE(HGPUNV);
-DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
-DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
-
- /* WGL_NV_gpu_affinity */
-typedef struct _GPU_DEVICE {
- DWORD cb;
- CHAR DeviceName[32];
- CHAR DeviceString[128];
- DWORD Flags;
- RECT rcVirtualScreen;
-} GPU_DEVICE, *PGPU_DEVICE;
-
-/*************************************************************/
-
-/* Extensions */
-#define WGL_ARB_buffer_region 1
-#define WGL_ARB_create_context_robustness 1
-#define WGL_ARB_extensions_string 1
-#define WGL_ARB_make_current_read 1
-#define WGL_ARB_multisample 1
-#define WGL_ARB_pbuffer 1
-#define WGL_ARB_pixel_format 1
-#define WGL_ARB_pixel_format_float 1
-#define WGL_ARB_render_texture 1
-#define WGL_ATI_pixel_format_float 1
-#define WGL_EXT_create_context_es2_profile 1
-#define WGL_EXT_extensions_string 1
-#define WGL_EXT_framebuffer_sRGB 1
-#define WGL_EXT_pixel_format_packed_float 1
-#define WGL_EXT_swap_control 1
-#define WGL_NV_allocate_memory 1
-#define WGL_NV_copy_image 1
-#define WGL_NV_float_buffer 1
-#define WGL_NV_multisample_coverage 1
-#define WGL_NV_render_depth_texture 1
-#define WGL_NV_render_texture_rectangle 1
-#define WGL_NV_video_output 1
-#define WGL_KTX_buffer_region 1
-#define WGL_I3D_genlock 1
-#define WGL_NV_swap_group 1
-#define WGL_NV_gpu_affinity 1
-#define WGL_NV_present_video 1
-#define WGL_ARB_create_context 1
-#define WGL_NV_video_capture 1
-
-/* ARB_buffer_region */
-#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
-#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
-#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
-#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
-
-/* ARB_pixel_format */
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-
-/* ARB_pbuffer */
-#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
-#define WGL_PBUFFER_LARGEST_ARB 0x2033
-#define WGL_PBUFFER_WIDTH_ARB 0x2034
-#define WGL_PBUFFER_HEIGHT_ARB 0x2035
-#define WGL_PBUFFER_LOST_ARB 0x2036
-
-/* ARB_multisample */
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-
-/* I3D_genlock */
-#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
-#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
-#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
-#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
-#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
-#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
-#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
-#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
-#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
-
-/* ARB_render_texture */
-#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
-#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
-#define WGL_TEXTURE_FORMAT_ARB 0x2072
-#define WGL_TEXTURE_TARGET_ARB 0x2073
-#define WGL_MIPMAP_TEXTURE_ARB 0x2074
-#define WGL_TEXTURE_RGB_ARB 0x2075
-#define WGL_TEXTURE_RGBA_ARB 0x2076
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
-#define WGL_TEXTURE_1D_ARB 0x2079
-#define WGL_TEXTURE_2D_ARB 0x207A
-#define WGL_MIPMAP_LEVEL_ARB 0x207B
-#define WGL_CUBE_MAP_FACE_ARB 0x207C
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
-#define WGL_FRONT_LEFT_ARB 0x2083
-#define WGL_FRONT_RIGHT_ARB 0x2084
-#define WGL_BACK_LEFT_ARB 0x2085
-#define WGL_BACK_RIGHT_ARB 0x2086
-#define WGL_AUX0_ARB 0x2087
-#define WGL_AUX1_ARB 0x2088
-#define WGL_AUX2_ARB 0x2089
-#define WGL_AUX3_ARB 0x208A
-#define WGL_AUX4_ARB 0x208B
-#define WGL_AUX5_ARB 0x208C
-#define WGL_AUX6_ARB 0x208D
-#define WGL_AUX7_ARB 0x208E
-#define WGL_AUX8_ARB 0x208F
-#define WGL_AUX9_ARB 0x2090
-
-/* NV_render_depth_texture */
-#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
-#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
-#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
-#define WGL_DEPTH_COMPONENT_NV 0x20A7
-
-/* NV_float_buffer */
-#define WGL_FLOAT_COMPONENTS_NV 0x20B0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
-#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
-#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
-#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
-#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
-
-/* NV_render_texture_rectangle */
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
-#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
-
-/* ARB_make_current_read */
-#define WGL_ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
-#define WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
-
-/* ATI_pixel_format_float */
-#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
-
-/* WGL_NV_video_output */
-#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
-#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
-#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
-#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
-#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
-#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
-#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define WGL_VIDEO_OUT_FRAME_NV 0x20C8
-#define WGL_VIDEO_OUT_FIELD_1_NV 0x20C9
-#define WGL_VIDEO_OUT_FIELD_2_NV 0x20CA
-#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
-#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
-
-/* ARB_pixel_format_float */
-#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
-
-/* EXT_pixel_format_packed_float */
-#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
-
-/* NV_gpu_affinity */
-#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
-#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
-
-/* EXT_framebuffer_sRGB */
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
-
-/* NV_multisample_coverage */
-#define WGL_COVERAGE_SAMPLES_NV 0x2042
-#define WGL_COLOR_SAMPLES_NV 0x20B9
-
-/* NV_present_video */
-#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
-
-/* ARB_create_context */
-#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
-#define WGL_CONTEXT_FLAGS_ARB 0x2094
-#define WGL_ERROR_INVALID_VERSION_ARB 0x2095
-
-/* NV_video_capture */
-#define WGL_UNIQUE_ID_NV 0x20CE
-
-/* EXT_create_context_es2_profile */
-#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x0004
-
-/* ARB_create_context_robustness */
-#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x0004
-#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
-#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-
-
-/*************************************************************/
-
-
-/* WGL_ARB_buffer_region */
-typedef HANDLE (GLAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hdc, int iLayerPlane, UINT uType);
-typedef void (GLAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
-typedef BOOL (GLAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
-typedef BOOL (GLAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-
-/* WGL_ARB_create_context */
-typedef HGLRC (APIENTRY * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC, HGLRC, const int *);
-
-/* WGL_ARB_extensions_string */
-typedef const char * (GLAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
-
-/* WGL_ARB_pbuffer */
-typedef HPBUFFERARB (GLAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hdc, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
-typedef HDC (GLAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
-typedef int (GLAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hdc);
-typedef BOOL (GLAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
-typedef BOOL (GLAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
-
-/* WGL_ARB_render_texture */
-typedef BOOL (GLAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (GLAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (GLAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int * piAttribList);
-
-/* WGL_NV_video_output */
-typedef BOOL (GLAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, INT iVideoStreams, HPVIDEODEVICE* phpVideoDevice);
-typedef BOOL (GLAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEVICE hpVideoDevice);
-typedef BOOL (GLAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEVICE hpVideoDevice, HPBUFFERARB hPbuffer, INT iVideoBuffer);
-typedef BOOL (GLAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, INT iVideoBuffer);
-typedef BOOL (GLAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, INT iBufferType, unsigned long * pulCounterPbuffer, BOOL bBlock);
-typedef BOOL (GLAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEVICE hpVideoDevice, unsigned long * pulCounterOutputVideo, unsigned long * pulCounterOutputPbuffer);
-
-/* WGL_ARB_pixel_format */
-typedef BOOL (GLAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
-typedef BOOL (GLAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
-typedef BOOL (GLAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-
-/* WGL_EXT_extensions_string */
-typedef const char * (GLAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
-
-/* WGL_EXT_swap_control */
-typedef int (GLAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-typedef int (GLAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-
-/* WGL_NV_allocate_memory */
-typedef void * (GLAPI * PFNWGLALLOCATEMEMORYNVPROC) (int size, float readfreq, float writefreq, float priority);
-typedef void (GLAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
-
-/* WGL_KTX_buffer_region */
-typedef UINT (GLAPI * PFNWGLNEWBUFFERREGIONPROC) (UINT type);
-typedef void (GLAPI * PFNWGLDELETEBUFFERREGIONPROC) (UINT region);
-typedef void (GLAPI * PFNWGLREADBUFFERREGIONPROC) (UINT region, int x, int y, GLint width, GLint height);
-typedef void (GLAPI * PFNWGLDRAWBUFFERREGIONPROC) (UINT region, int x, int y, GLint width, GLint height, int xDest, int yDest);
-typedef UINT (GLAPI * PFNWGLBUFFERREGIONENABLEDPROC) (void);
-
-/* WGL_I3D_genlock */
-typedef BOOL (GLAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hdc);
-typedef BOOL (GLAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hdc);
-typedef BOOL (GLAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hdc, BOOL * pFlag);
-typedef BOOL (GLAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hdc, UINT uSource);
-typedef BOOL (GLAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hdc, UINT * uSource);
-typedef BOOL (GLAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hdc, UINT uEdge);
-typedef BOOL (GLAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hdc, UINT * uEdge);
-typedef BOOL (GLAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hdc, UINT uRate);
-typedef BOOL (GLAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hdc, UINT * uRate);
-typedef BOOL (GLAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hdc, UINT uDelay);
-typedef BOOL (GLAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hdc, UINT * uDelay);
-typedef BOOL (GLAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hdc, UINT * uMaxLineDelay, UINT * uMaxPixelDelay);
-
-/* WGL_NV_swap_group */
-typedef BOOL (GLAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
-typedef BOOL (GLAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
-typedef BOOL (GLAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint * group, GLuint * barrier);
-typedef BOOL (GLAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint * maxGroups, GLuint * maxBarriers);
-typedef BOOL (GLAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint * count);
-typedef BOOL (GLAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
-
-/* WGL_ARB_make_current_read */
-typedef BOOL (GLAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-typedef HDC (GLAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
-
-/* WGL_NV_copy_image */
-typedef BOOL (GLAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-/* WGL_NV_gpu_affinity */
-typedef BOOL (GLAPI * PFNWGLENUMGPUSNVPROC) (UINT iIndex, HGPUNV *hGpu);
-typedef BOOL (GLAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iIndex, PGPU_DEVICE pGpuDevice);
-typedef HDC (GLAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *pGpuList);
-typedef BOOL (GLAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iIndex, HGPUNV *hGpu);
-typedef BOOL (GLAPI * PFNWGLDELETEDCNVPROC) (HDC hAffinityDC);
-
-/* WGL_NV_present_video */
-typedef INT (GLAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
-typedef BOOL (GLAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, UINT uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int * piAttribList);
-typedef BOOL (GLAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (INT iAttribute, INT *piValue);
-
-/* WGL_NV_video_capture */
-typedef BOOL (GLAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hVideoDevice);
-typedef UINT (GLAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDC, HVIDEOINPUTDEVICENV *phDeviceList);
-typedef BOOL (GLAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDC, HVIDEOINPUTDEVICENV hDevice);
-typedef BOOL (GLAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDC, HVIDEOINPUTDEVICENV hDevice, INT iAttribute, INT *piValue);
-typedef BOOL (GLAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDC, HVIDEOINPUTDEVICENV hDevice);
-
-/* WGL_NVX_DX_interop */
-#define WGL_ACCESS_READ_ONLY_NVX 0x0000
-#define WGL_ACCESS_READ_WRITE_NVX 0x0001
-#define WGL_ACCESS_WRITE_DISCARD_NVX 0x0002
-typedef HANDLE (GLAPI * PFNWGLDXOPENDEVICENVXPROC) (void *dxDevice);
-typedef BOOL (GLAPI * PFNWGLDXCLOSEDEVICENVXPROC) (HANDLE hDevice);
-typedef HANDLE (GLAPI * PFNWGLDXREGISTEROBJECTNVXPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
-typedef BOOL (GLAPI * PFNWGLDXUNREGISTEROBJECTNVXPROC) (HANDLE hDevice, HANDLE hObject);
-typedef BOOL (GLAPI * PFNWGLDXOBJECTACCESSNVXPROC) (HANDLE hObject, GLenum access);
-typedef BOOL (GLAPI * PFNWGLDXLOCKOBJECTSNVXPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
-typedef BOOL (GLAPI * PFNWGLDXUNLOCKOBJECTSNVXPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
-
-#ifdef __DEFINED_GLAPI
-# undef GLAPI
-# undef __DEFINED_GLAPI
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __wglext_h_ */
diff --git a/src/Runtime/ogl-runtime/src/api/api.pro b/src/Runtime/ogl-runtime/src/api/api.pro
deleted file mode 100644
index 7d5b27d0..00000000
--- a/src/Runtime/ogl-runtime/src/api/api.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS += \
- studio3d \
- studio3dqml
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue.cpp
deleted file mode 100644
index 550dc24f..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dscommandqueue_p.h"
-#include "q3dspresentation.h"
-#include "Qt3DSViewerApp.h"
-
-#include <QtCore/qstringlist.h>
-
-ElementCommand::ElementCommand()
- : m_commandType(CommandType_Invalid)
-{
-}
-
-QString ElementCommand::toString() const
-{
- QString ret = QStringLiteral("ElementCommand - Type: %1 Path: '%2' StrVal: '%3' VarVal: '%4'");
- return ret.arg(m_commandType).arg(m_elementPath)
- .arg(m_stringValue).arg(m_variantValue.toString());
-}
-
-CommandQueue::CommandQueue()
- : m_visibleChanged(false)
- , m_scaleModeChanged(false)
- , m_shadeModeChanged(false)
- , m_showRenderStatsChanged(false)
- , m_matteColorChanged(false)
- , m_sourceChanged(false)
- , m_variantListChanged(false)
- , m_globalAnimationTimeChanged(false)
- , m_delayedLoadingChanged(false)
- , m_visible(false)
- , m_scaleMode(Q3DSViewerSettings::ScaleModeCenter)
- , m_shadeMode(Q3DSViewerSettings::ShadeModeShaded)
- , m_showRenderStats(false)
- , m_matteColor(Qt::black)
- , m_delayedLoading(false)
- , m_size(0)
-{
- qRegisterMetaType<CommandType>();
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath,
- CommandType commandType,
- const QString &attributeName,
- const QVariant &value)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_stringValue = attributeName;
- cmd.m_variantValue = value;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath,
- CommandType commandType,
- const QString &attributeName,
- const QVariant &value,
- int intValue)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_stringValue = attributeName;
- cmd.m_variantValue = value;
- cmd.m_intValues[0] = intValue;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath, CommandType commandType,
- const QString &value)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_stringValue = value;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath,
- CommandType commandType, bool value)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_boolValue = value;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath,
- CommandType commandType, float value)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_floatValue = value;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath,
- CommandType commandType, int value0, int value1,
- int value2, int value3)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_intValues[0] = value0;
- cmd.m_intValues[1] = value1;
- cmd.m_intValues[2] = value2;
- cmd.m_intValues[3] = value3;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath, CommandType commandType,
- const QString &stringValue, void *commandData)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_stringValue = stringValue;
- cmd.m_data = commandData;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(CommandType commandType, void *commandData)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_data = commandData;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath, CommandType commandType)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
-
- return cmd;
-}
-
-ElementCommand &CommandQueue::queueCommand(const QString &elementPath, CommandType commandType,
- void *commandData)
-{
- ElementCommand &cmd = nextFreeCommand();
-
- cmd.m_commandType = commandType;
- cmd.m_elementPath = elementPath;
- cmd.m_data = commandData;
-
- return cmd;
-}
-
-void CommandQueue::copyCommands(CommandQueue &fromQueue)
-{
- m_visibleChanged = m_visibleChanged || fromQueue.m_visibleChanged;
- m_scaleModeChanged = m_scaleModeChanged || fromQueue.m_scaleModeChanged;
- m_shadeModeChanged = m_shadeModeChanged || fromQueue.m_shadeModeChanged;
- m_showRenderStatsChanged = m_showRenderStatsChanged || fromQueue.m_showRenderStatsChanged;
- m_matteColorChanged = m_matteColorChanged || fromQueue.m_matteColorChanged;
- m_sourceChanged = m_sourceChanged || fromQueue.m_sourceChanged;
- m_variantListChanged = m_variantListChanged || fromQueue.m_variantListChanged;
- m_globalAnimationTimeChanged
- = m_globalAnimationTimeChanged || fromQueue.m_globalAnimationTimeChanged;
- m_delayedLoadingChanged = m_delayedLoadingChanged || fromQueue.m_delayedLoadingChanged;
-
- if (fromQueue.m_visibleChanged)
- m_visible = fromQueue.m_visible;
- if (fromQueue.m_scaleModeChanged)
- m_scaleMode = fromQueue.m_scaleMode;
- if (fromQueue.m_shadeModeChanged)
- m_shadeMode = fromQueue.m_shadeMode;
- if (fromQueue.m_showRenderStatsChanged)
- m_showRenderStats = fromQueue.m_showRenderStats;
- if (fromQueue.m_matteColorChanged)
- m_matteColor = fromQueue.m_matteColor;
- if (fromQueue.m_sourceChanged)
- m_source = fromQueue.m_source;
- if (fromQueue.m_variantListChanged)
- m_variantList = fromQueue.m_variantList;
- if (fromQueue.m_globalAnimationTimeChanged)
- m_globalAnimationTime = fromQueue.m_globalAnimationTime;
- if (fromQueue.m_delayedLoadingChanged)
- m_delayedLoading = fromQueue.m_delayedLoading;
-
- // Pending queue may be synchronized multiple times between queue processing, so let's append
- // to the existing queue rather than clearing it.
- for (int i = 0; i < fromQueue.m_size; i++) {
- const ElementCommand &source = fromQueue.constCommandAt(i);
- switch (source.m_commandType) {
- case CommandType_SetDataInputValue:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_stringValue,
- source.m_variantValue, source.m_intValues[0]);
- break;
- case CommandType_SetAttribute:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_stringValue,
- source.m_variantValue);
- break;
- case CommandType_GoToSlideByName:
- case CommandType_FireEvent:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_stringValue);
- break;
- case CommandType_SetPresentationActive:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_boolValue);
- break;
- case CommandType_GoToTime:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_floatValue);
- break;
- case CommandType_GoToSlide:
- case CommandType_GoToSlideRelative:
- case CommandType_MousePress:
- case CommandType_MouseRelease:
- case CommandType_MouseMove:
- case CommandType_MouseWheel:
- case CommandType_KeyPress:
- case CommandType_KeyRelease:
- queueCommand(source.m_elementPath, source.m_commandType,
- source.m_intValues[0], source.m_intValues[1],
- source.m_intValues[2], source.m_intValues[3]);
- break;
- case CommandType_CreateElements:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_stringValue,
- source.m_data);
- fromQueue.commandAt(i).m_data = nullptr; // This queue takes ownership of data
- break;
- case CommandType_DeleteElements:
- case CommandType_DeleteMeshes:
- case CommandType_CreateMeshes:
- queueCommand(source.m_commandType, source.m_data);
- fromQueue.commandAt(i).m_data = nullptr; // This queue takes ownership of data
- break;
- case CommandType_CreateMaterials:
- case CommandType_DeleteMaterials:
- queueCommand(source.m_elementPath, source.m_commandType, source.m_data);
- fromQueue.commandAt(i).m_data = nullptr; // This queue takes ownership of data
- break;
- case CommandType_RequestSlideInfo:
- case CommandType_UnloadSlide:
- case CommandType_PreloadSlide:
- case CommandType_RequestDataInputs:
- case CommandType_RequestDataOutputs:
- queueCommand(source.m_elementPath, source.m_commandType);
- break;
- default:
- queueCommand(QString(), CommandType_Invalid, false);
- break;
- }
- }
-}
-
-// Clears changed states and empties the queue
-void CommandQueue::clear(bool deleteCommandData)
-{
- m_visibleChanged = false;
- m_scaleModeChanged = false;
- m_shadeModeChanged = false;
- m_showRenderStatsChanged = false;
- m_matteColorChanged = false;
- m_sourceChanged = false;
- m_variantListChanged = false;
- m_globalAnimationTimeChanged = false;
- m_delayedLoadingChanged = false;
-
- if (deleteCommandData) {
- for (int i = 0; i < m_size; ++i) {
- ElementCommand &cmd = m_elementCommands[i];
- if (cmd.m_data) {
- switch (cmd.m_commandType) {
- case CommandType_CreateElements:
- delete static_cast<QVector<QHash<QString, QVariant>> *>(cmd.m_data);
- break;
- case CommandType_DeleteElements:
- case CommandType_CreateMaterials:
- case CommandType_DeleteMaterials:
- case CommandType_DeleteMeshes:
- delete static_cast<QStringList *>(cmd.m_data);
- break;
- case CommandType_CreateMeshes: {
- delete static_cast<QHash<QString, Q3DSViewer::MeshData> *>(cmd.m_data);
- break;
- }
- default:
- Q_ASSERT(false); // Should never come here
- break;
- }
- cmd.m_data = nullptr;
- }
- }
- }
-
- // We do not clear the actual queued commands, those will be reused the next frame
- // To avoid a lot of unnecessary reallocations.
- m_size = 0;
-}
-
-ElementCommand &CommandQueue::nextFreeCommand()
-{
- m_size++;
- if (m_size > m_elementCommands.size())
- m_elementCommands.append(ElementCommand());
- return m_elementCommands[m_size - 1];
-}
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue_p.h
deleted file mode 100644
index 12d1b7e3..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dscommandqueue_p.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_COMMAND_QUEUE_H
-#define Q3DS_COMMAND_QUEUE_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dsviewersettings.h"
-
-#include <QtGui/qcolor.h>
-#include <QtCore/qsize.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_NAMESPACE
-
-enum CommandType {
- CommandType_Invalid = 0,
- CommandType_SetAttribute,
- CommandType_SetPresentationActive,
- CommandType_GoToSlideByName,
- CommandType_GoToSlide,
- CommandType_GoToSlideRelative,
- CommandType_GoToTime,
- CommandType_FireEvent,
- CommandType_MousePress,
- CommandType_MouseRelease,
- CommandType_MouseMove,
- CommandType_MouseWheel,
- CommandType_KeyPress,
- CommandType_KeyRelease,
- CommandType_SetGlobalAnimationTime,
- CommandType_SetDataInputValue,
- CommandType_CreateElements,
- CommandType_DeleteElements,
- CommandType_CreateMaterials,
- CommandType_DeleteMaterials,
- CommandType_CreateMeshes,
- CommandType_DeleteMeshes,
-
- // Requests
- CommandType_RequestSlideInfo,
- CommandType_RequestDataInputs,
- CommandType_PreloadSlide,
- CommandType_UnloadSlide,
- CommandType_RequestDataOutputs
-};
-
-class Q_STUDIO3D_EXPORT ElementCommand
-{
-public:
- ElementCommand();
-
- CommandType m_commandType;
- QString m_elementPath;
- QString m_stringValue;
- QVariant m_variantValue;
- void *m_data = nullptr; // Data is owned by the queue and is deleted once command is handled
- union {
- bool m_boolValue;
- float m_floatValue;
- int m_intValues[4];
- qint64 m_int64Value;
- };
-
- QString toString() const;
-};
-
-typedef QVector<ElementCommand> CommandList;
-
-class Q_STUDIO3D_EXPORT CommandQueue
-{
-public:
- CommandQueue();
-
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- const QString &attributeName, const QVariant &value);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- const QString &attributeName, const QVariant &value,
- int intValue);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- const QString &value);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- bool value);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- float value);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- int value0, int value1 = 0,
- int value2 = 0, int value3 = 0);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- const QString &stringValue, void *commandData);
- ElementCommand &queueCommand(CommandType commandType, void *commandData);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType);
- ElementCommand &queueCommand(const QString &elementPath, CommandType commandType,
- void *commandData);
-
- void copyCommands(CommandQueue &fromQueue);
-
- bool m_visibleChanged;
- bool m_scaleModeChanged;
- bool m_shadeModeChanged;
- bool m_showRenderStatsChanged;
- bool m_matteColorChanged;
- bool m_sourceChanged;
- bool m_variantListChanged;
- bool m_globalAnimationTimeChanged;
- bool m_delayedLoadingChanged;
-
- bool m_visible;
- Q3DSViewerSettings::ScaleMode m_scaleMode;
- Q3DSViewerSettings::ShadeMode m_shadeMode;
- bool m_showRenderStats;
- QColor m_matteColor;
- QUrl m_source;
- QStringList m_variantList;
- qint64 m_globalAnimationTime;
- bool m_delayedLoading;
-
- void clear(bool deleteCommandData);
- int size() const { return m_size; }
- const ElementCommand &constCommandAt(int index) const { return m_elementCommands.at(index); }
- ElementCommand &commandAt(int index) { return m_elementCommands[index]; }
-
-private:
- ElementCommand &nextFreeCommand();
-
- CommandList m_elementCommands;
- int m_size;
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(CommandType)
-
-#endif // Q3DS_COMMAND_QUEUE_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.cpp
deleted file mode 100644
index 2e6281e6..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.cpp
+++ /dev/null
@@ -1,403 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsdatainput_p.h"
-#include "q3dspresentation_p.h"
-#include "q3dscommandqueue_p.h"
-
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype DataInput
- \instantiates Q3DSDataInput
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief Controls a data input entry in a Qt 3D Studio presentation.
- This class is a convenience class for controlling a data input in a presentation.
- DataInput provides a clean contract between the presentation design and the code.
- It hides the presentation details from the code while providing a contractual access
- point to code for controlling aspects of the presentation (e.g. timeline of a
- subpresentation). It also allows the design to use a single DataInput to drive
- multiple aspects of the design (e.g. DataInput for speed can change the color of
- the speedometer, angle of the needle).
-
- \note There is a performance cost for each registered DataInput, so try to avoid
- creating unnecessary DataInputs.
-
- \sa Presentation, DataOutput, Presentation::slideExited, Presentation::slideEntered
- \sa Presentation::customSignalEmitted
-*/
-
-/*!
- \class Q3DSDataInput
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
- \brief Controls a data input entry in a Qt 3D Studio presentation.
- This class is a convenience class for controlling a data input in a presentation.
- DataInput provides a clean contract between the presentation design and the code.
- It hides the presentation details from the code while providing a contractual access
- point to code for controlling aspects of the presentation (e.g. timeline of a
- subpresentation). It also allows the design to use a single DataInput to drive
- multiple aspects of the design (e.g. DataInput for speed can change the color of
- the speedometer, angle of the needle).
-
- \note There is a performance cost for each registered DataInput, so try to avoid
- creating unnecessary DataInputs.
-
- For other integration points between code and presentation see:
- \sa Q3DSPresentation::customSignalEmitted
- \sa Q3DSPresentation::slideEntered
- \sa Q3DSPresentation::slideExited
- \sa Q3DSDataOutput
-
- \sa Q3DSPresentation
-*/
-
-/*!
- \internal
- */
-Q3DSDataInput::Q3DSDataInput(QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSDataInputPrivate(this))
-{
-}
-
-/*!
- \internal
- */
-Q3DSDataInput::Q3DSDataInput(const QString &name, QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSDataInputPrivate(this))
-{
- d_ptr->m_name = name;
-}
-
-/*!
- Constructs a Q3DSDataInput instance and initializes the \a name. The
- constructed instance is automatically associated with the specified \a
- presentation. An optional \a parent object can be specified.
- */
-Q3DSDataInput::Q3DSDataInput(Q3DSPresentation *presentation, const QString &name, QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSDataInputPrivate(this))
-{
- d_ptr->m_name = name;
- d_ptr->m_presentation = presentation;
- if (presentation)
- presentation->registerDataInput(this);
-}
-
-/*!
- \internal
- */
-Q3DSDataInput::Q3DSDataInput(Q3DSDataInputPrivate *d, Q3DSPresentation *presentation,
- const QString &name, QObject *parent)
- : QObject(parent)
- , d_ptr(d)
-{
- d_ptr->m_name = name;
- d_ptr->m_presentation = presentation;
- if (presentation)
- presentation->registerDataInput(this);
-}
-
-/*!
- Destructor.
- */
-Q3DSDataInput::~Q3DSDataInput()
-{
- delete d_ptr;
-}
-
-/*!
- \qmlproperty string DataInput::name
-
- Specifies the name of the controlled data input element in the
- presentation. The name must match a name of a data input defined
- in the presentation. This property must be set before setting the
- value property.
- */
-
-/*!
- \property Q3DSDataInput::name
-
- Specifies the name of the controlled data input element in the
- presentation. The name must match a name of a data input defined
- in the presentation.
-
- This property must be set before setting the value property.
- The initial value is provided via the constructor, but the name
- can also be changed later on.
- */
-QString Q3DSDataInput::name() const
-{
- return d_ptr->m_name;
-}
-
-void Q3DSDataInput::setName(const QString &name)
-{
- if (d_ptr->m_name != name) {
- d_ptr->m_name = name;
- if (d_ptr->m_presentation)
- d_ptr->m_presentation->registerDataInput(this);
- Q_EMIT nameChanged();
- }
-}
-
-/*!
- \qmlproperty variant DataInput::value
-
- Specifies the value of the controlled data input element in the
- presentation.
-
- The value of this property only accounts for changes done via the same
- Q3DSDataInput instance. If the value of the same data input in the
- presentation is changed elsewhere, for example via animations or
- Q3DSPresentation::setAttribute(), those changes are not reflected in the
- value of this property. Due to this uncertainty, this property treats all
- value sets as changes even if the newly set value is the same value as the
- previous value.
-
- To get actual values from the presentation, use DataOutput.
- \sa DataOutput
-*/
-/*!
- \property Q3DSDataInput::value
-
- Specifies the value of the controlled data input element in the
- presentation.
-
- The value of this property only accounts for changes done via the same
- Q3DSDataInput instance. If the value of the same data input in the
- presentation is changed elsewhere, for example via animations or
- Q3DSPresentation::setAttribute(), those changes are not reflected in the
- value of this property. Due to this uncertainty, this property treats all
- value sets as changes even if the newly set value is the same value as the
- previous value.
-
- To get actual values from the presentation, use DataOutput.
- \sa DataOutput
-*/
-QVariant Q3DSDataInput::value() const
-{
- return d_ptr->m_value;
-}
-
-/*!
- \property Q3DSDataInput::min
-
- Contains the minimum range value for datainput. Returned value is zero
- for datainput types other than \e {Ranged Number}.
-
- \note This value is read-only.
- */
-float Q3DSDataInput::min() const
-{
- if (!d_ptr->m_presentation)
- return 0.0f;
-
- return d_ptr->m_presentation->d_ptr->dataInputMin(d_ptr->m_name);
-}
-
-/*!
- \property Q3DSDataInput::max
-
- Contains the maximum range value for datainput. Returned value is zero
- for datainput types other than \e {Ranged Number}.
-
- \note This value is read-only.
- */
-float Q3DSDataInput::max() const
-{
- if (!d_ptr->m_presentation)
- return 0.0f;
-
- return d_ptr->m_presentation->d_ptr->dataInputMax(d_ptr->m_name);
-}
-
-/*!
- Returns true if presentation (or its subpresentation) associated with
- this datainput has a datainput definition with a matching name. Returns
- false if the datainput has no associated presentation, or if a match is not found.
- */
-bool Q3DSDataInput::isValid() const
-{
- if (d_ptr->m_presentation)
- return d_ptr->m_presentation->d_ptr->isValidDataInput(this);
- else
- return false;
-}
-
-/*!
- \brief Q3DSDataInput::setValue Set value of the data input.
- \param value New value to be set.
- \note For performance reasons do not call setValue unnecessarily.
- */
-void Q3DSDataInput::setValue(const QVariant &value)
-{
- // Since properties controlled by data inputs can change without the current value being
- // reflected on the value of the DataInput element, we allow setting the value to the
- // same one it was previously and still consider it a change.
- // For example, when controlling timeline, the value set to DataInput will only be
- // the current value for one frame if presentation has a running animation.
- // In order to track an element property, see DataOutput API.
- d_ptr->setValue(value, ValueRole::Value);
- Q_EMIT valueChanged();
-}
-
-void Q3DSDataInputPrivate::setPresentation(Q3DSPresentation *presentation)
-{
- m_presentation = presentation;
-}
-
-Q3DSDataInputPrivate::Q3DSDataInputPrivate(Q3DSDataInput *parent)
- : q_ptr(parent)
-{
-}
-
-Q3DSDataInputPrivate::~Q3DSDataInputPrivate()
-{
- if (m_presentation)
- m_presentation->unregisterDataInput(q_ptr);
-}
-
-void Q3DSDataInputPrivate::setValue(const QVariant &value, Q3DSDataInput::ValueRole valueRole)
-{
- m_value = value;
- if (m_presentation)
- m_presentation->setDataInputValue(m_name, m_value, valueRole);
-}
-
-void Q3DSDataInputPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app)
-{
- m_viewerApp = app;
-
- if (m_viewerApp && m_value.isValid())
- setValue(m_value);
-}
-
-void Q3DSDataInputPrivate::setCommandQueue(CommandQueue *queue)
-{
- m_commandQueue = queue;
-
- if (m_commandQueue && m_value.isValid())
- setValue(m_value);
-}
-
-
-/*!
- \qmltype DataInput
- \instantiates Q3DSDataInput
- \inqmlmodule QtStudio3D
- \ingroup OpenGLRuntime
-
- \brief Controls a data input entry in a Qt 3D Studio presentation.
-
- This type is a convenience for controlling a data in a presentation. Its functionality is
- equivalent to \c{Presentation::setDataInputValue()}, however it has a big advantage
- of being able to use QML property bindings, thus avoiding the need to having to resort
- to a JavaScript function call for every value change.
-
- As an example:
-
- \qml
- Studio3D {
- ...
- Presentation {
- id: presentation
- ...
- property string text: ""
- DataInput {
- name: "inputForSomeTextNode"
- value: presentation.text
- }
- }
- }
-
- Button {
- onClicked: presentation.text = "Hello World"
- }
- \endqml
-
- The example assumes that a data input connection was made in Qt 3D Studio
- presentation using Qt 3D Studio editor between the \c textstring property of
- target property and a data input name \c inputForSomeTextNode. As the value
- is now set via a property, the full set of QML property bindings techniques
- are available.
-
- \sa Studio3D, Presentation
-*/
-
-/*!
- \qmlproperty string DataInput::name
-
- Specifies the name of the controlled data input element in the
- presentation. This property must be set as part of DataInput declaration,
- although it is changeable afterwards, if desired.
-*/
-
-/*!
- \qmlproperty variant DataInput::value
-
- Specifies the value of the controlled data input element in the presentation.
-
- The value of this property only accounts for changes done via the same
- DataInput instance. If the value of the underlying attribute in the
- presentation is changed elsewhere, for example via animations or
- Presentation::setAttribute(), those changes are not reflected in the value
- of this property. Due to this uncertainty, this property treats all value
- sets as changes even if the newly set value is the same value as the
- previous value.
-*/
-
-/*!
- \qmlproperty real DataInput::min
-
- Contains the minimum value of the controlled data input element range.
-
- This property is applicable only to data input type \e {Ranged Number}. For other
- types, value returned is zero.
-
- \note This value is read-only.
-*/
-
-/*!
- \qmlproperty real DataInput::max
-
- Contains the maximum value of the controlled data input element range.
-
- This property is applicable only to data input type \e {Ranged Number}. For other
- types, value returned is zero.
-
- \note This value is read-only.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.h
deleted file mode 100644
index 4504e5d2..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSDATAINPUT_H
-#define Q3DSDATAINPUT_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSDataInputPrivate;
-class Q3DSPresentation;
-
-class Q_STUDIO3D_EXPORT Q3DSDataInput : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSDataInput)
-
- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
- Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
- Q_PROPERTY(float max READ max CONSTANT)
- Q_PROPERTY(float min READ min CONSTANT)
-public:
- explicit Q3DSDataInput(QObject *parent = nullptr);
- explicit Q3DSDataInput(const QString &name, QObject *parent = nullptr);
- explicit Q3DSDataInput(Q3DSPresentation *presentation, const QString &name,
- QObject *parent = nullptr);
-
- virtual ~Q3DSDataInput();
-
- enum class ValueRole {
- Value = 0,
- Min = 1,
- Max = 2
- };
-
- QString name() const;
- QVariant value() const;
- float min() const;
- float max() const;
- bool isValid() const;
-
-public Q_SLOTS:
- void setName(const QString &name);
- void setValue(const QVariant &value);
-
-Q_SIGNALS:
- void nameChanged();
- void valueChanged();
-
-protected:
- explicit Q3DSDataInput(Q3DSDataInputPrivate *d, Q3DSPresentation *presentation,
- const QString &name, QObject *parent = nullptr);
- Q3DSDataInputPrivate *d_ptr;
-
-private:
- Q_DISABLE_COPY(Q3DSDataInput)
- friend class Q3DSPresentationPrivate;
- friend class Q3DSRenderer;
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(Q3DSDataInput*)
-
-#endif // Q3DSDATAINPUT_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput_p.h
deleted file mode 100644
index 6107add9..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdatainput_p.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSDATAINPUT_P_P_H
-#define Q3DSDATAINPUT_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dsdatainput.h"
-#include "q3dscommandqueue_p.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPresentationPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSDataInputPrivate
-{
- Q_DECLARE_PUBLIC(Q3DSDataInput)
-public:
- explicit Q3DSDataInputPrivate(Q3DSDataInput *parent);
- virtual ~Q3DSDataInputPrivate();
-
- void setValue(const QVariant &value,
- Q3DSDataInput::ValueRole valueRole = Q3DSDataInput::ValueRole::Value);
- void setViewerApp(Q3DSViewer::Q3DSViewerApp *app);
- void setCommandQueue(CommandQueue *queue);
- void setPresentation(Q3DSPresentation *presentation);
-
-protected:
- Q3DSDataInput *q_ptr;
- Q3DSViewer::Q3DSViewerApp *m_viewerApp = nullptr; // Not owned
- CommandQueue *m_commandQueue = nullptr; // Not owned
- Q3DSPresentation *m_presentation = nullptr; // Not owned
- QString m_name;
- // Local cached values, used only when synchronous getter from runtime engine
- // is not available (for QML -side that is behind command queue).
- QVariant m_value;
- float m_max = 0;
- float m_min = 0;
-
- friend class Q3DSPresentationPrivate;
- friend class Q3DSRenderer;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSDATAINPUT_P_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.cpp
deleted file mode 100644
index 3cb13a0e..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsdataoutput_p.h"
-#include "q3dspresentation_p.h"
-#include "q3dscommandqueue_p.h"
-
-/*!
- \qmltype DataOutput
- \instantiates Q3DSDataOutput
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief Provides notifications from data output entries in Qt 3D Studio presentation.
- This class is a convenience class for listening for changes in the Qt 3D Studio
- presentation attributes. DataOutput provides a clean contract between the presentation
- design and the code. It hides the presentation details from the code while providing a
- contractual access point to code to be notified when aspects of the presentation change
- (e.g. movement of an element in the presentation due to timeline animation).
-
- DataOutput can be attached to same attributes in the design as DataInput is, including
- presentation timeline. Only exception is slide changes. Slide changes are already notified
- through \c{Presentation::slideEntered} and \c{Presentation::slideExited} signals.
-
- \note There is a performance cost for each registered DataOutput, so try to avoid
- creating unnecessary DataOutputs.
-
- \sa Presentation, DataInput, Presentation::slideExited, Presentation::slideEntered
- \sa Presentation::customSignalEmitted
-*/
-
-/*!
- \class Q3DSDataOutput
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.4
- \brief Provides notifications from data output entries in Qt 3D Studio presentation.
- This class is a convenience class for listening for changes in the Qt 3D Studio
- presentation attributes. DataOutput provides a clean contract between the presentation
- design and the code. It hides the presentation details from the code while providing a
- contractual access point to code to be notified when aspects of the presentation change
- (e.g. movement of an element in the presentation due to timeline animation).
-
- DataOutput can be attached to same attributes in the design as DataInput is, including
- presentation timeline. Only excaption is slide changes Slide changes are already notified
- through \c{Q3DSPresentation::slideEntered} and \c{Q3DSPresentation::slideExited} signals.
-
- \note There is a performance cost for each registered DataOutput, so try to avoid
- creating unnecessary DataOutputs.
-
- For other integration points between code and presentation see:
- \sa Q3DSPresentation::customSignalEmitted
- \sa Q3DSPresentation::slideEntered
- \sa Q3DSPresentation::slideExited
- \sa Q3DSDataInput
-
- \sa Q3DSPresentation
-*/
-Q3DSDataOutput::Q3DSDataOutput(QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSDataOutputPrivate(this))
-{
-
-}
-
-Q3DSDataOutput::Q3DSDataOutput(const QString &name, QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSDataOutputPrivate(this))
-{
- d_ptr->m_name = name;
-}
-
-Q3DSDataOutput::~Q3DSDataOutput()
-{
- delete d_ptr;
-}
-
-/*!
- \qmlproperty string DataOutput::name
-
- Specifies the name of the observed data output element in the
- presentation. The name must match a name of a data output defined
- in the presentation. This property must be set before setting the value
- property.
- */
-
-/*!
- \property Q3DSDataOutput::name
-
- Specifies the name of the observed data output element in the
- presentation. The name must match a name of a data output defined
- in the presentation.
-
- This property must be set before setting the value property.
- The initial value is provided via the constructor, but the name
- can also be changed later on.
- */
-QString Q3DSDataOutput::name() const
-{
- return d_ptr->m_name;
-}
-
-void Q3DSDataOutput::setName(const QString &name)
-{
- if (d_ptr->m_name != name) {
- d_ptr->m_name = name;
- if (d_ptr->m_presentation)
- d_ptr->m_presentation->registerDataOutput(this);
- Q_EMIT nameChanged(name);
- }
-}
-
-/*!
- \qmlproperty DataOutput::value
-
- Contains the read-only value of the controlled data output element in the
- presentation.
-
- The value of this property accounts for actual value in the last processed
- frame of the presentation. This includes animation timeline driven changes,
- changes done via DataInput and changes done via Behavior scripts.
-*/
-
-/*!
- \property Q3DSDataOutput::value
-
- Contains the read-only value of the controlled data output element in the
- presentation.
-
- The value of this property accounts for actual value in the last processed
- frame of the presentation. This includes animation timeline driven changes,
- changes done via DataInput and changes done via Behavior scripts.
-*/
-QVariant Q3DSDataOutput::value() const
-{
- return d_ptr->m_value;
-}
-
-/*!
- * \qmlsignal DataOutput::valueChanged
- Emitted when the value of the observed DataOutput has changed in the
- presentation.
- \param newValue The new value of the observed DataOutput.
- */
-
-/*!
- \fn Q3DSDataOutput::valueChanged
- Emitted when the value of the observed DataOutput has changed in the
- presentation.
- \param newValue The new value of the observed DataOutput.
- */
-
-/*!
- * \internal
- */
-void Q3DSDataOutput::setValue(const QVariant &value)
-{
- if (d_ptr->m_value == value)
- return;
-
- d_ptr->m_value = value;
- Q_EMIT valueChanged(value);
-}
-
-void Q3DSDataOutputPrivate::setPresentation(Q3DSPresentation *presentation)
-{
- m_presentation = presentation;
-}
-
-Q3DSDataOutputPrivate::Q3DSDataOutputPrivate(Q3DSDataOutput *parent)
- : q_ptr(parent)
-{
-}
-
-Q3DSDataOutputPrivate::~Q3DSDataOutputPrivate()
-{
- if (m_presentation)
- m_presentation->unregisterDataOutput(q_ptr);
-}
-
-void Q3DSDataOutputPrivate::setValue(const QVariant &value)
-{
- m_value = value;
- Q_EMIT q_ptr->valueChanged(value);
-}
-
-void Q3DSDataOutputPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app)
-{
- m_viewerApp = app;
-
- if (m_viewerApp && m_value.isValid())
- setValue(m_value);
-}
-
-void Q3DSDataOutputPrivate::setCommandQueue(CommandQueue *queue)
-{
- m_commandQueue = queue;
-
- if (m_commandQueue && m_value.isValid())
- setValue(m_value);
-}
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.h
deleted file mode 100644
index 93f74267..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSDATAOUTPUT_H
-#define Q3DSDATAOUTPUT_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSDataOutputPrivate;
-class Q3DSPresentation;
-
-class Q_STUDIO3D_EXPORT Q3DSDataOutput : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSDataOutput)
-
- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
- Q_PROPERTY(QVariant value READ value NOTIFY valueChanged)
-
-public:
-
- explicit Q3DSDataOutput(QObject *parent = nullptr);
- explicit Q3DSDataOutput(const QString &name, QObject *parent = nullptr);
- explicit Q3DSDataOutput(Q3DSPresentation *presentation, const QString &name,
- QObject *parent = nullptr);
- virtual ~Q3DSDataOutput();
-
- QString name() const;
- QVariant value() const;
-
-public Q_SLOTS:
- void setName(const QString &name);
-
-Q_SIGNALS:
- void nameChanged(const QString &newName);
- void valueChanged(const QVariant &newValue);
-
-protected:
- explicit Q3DSDataOutput(Q3DSDataOutputPrivate *d, Q3DSPresentation *presentation,
- const QString &name, QObject *parent = nullptr);
- Q3DSDataOutputPrivate *d_ptr;
-
-private:
- Q_DISABLE_COPY(Q3DSDataOutput)
- void setValue(const QVariant &newValue);
- friend class Q3DSPresentationPrivate;
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(Q3DSDataOutput*)
-
-#endif // Q3DSDATAOUTPUT_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput_p.h
deleted file mode 100644
index c4745bfb..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsdataoutput_p.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSDATAOUTPUT_P_H
-#define Q3DSDATAOUTPUT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dsdataoutput.h"
-#include "q3dscommandqueue_p.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPresentationPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSDataOutputPrivate
-{
- Q_DECLARE_PUBLIC(Q3DSDataOutput)
-public:
- explicit Q3DSDataOutputPrivate(Q3DSDataOutput *parent);
- virtual ~Q3DSDataOutputPrivate();
-
- void setValue(const QVariant &value);
- void setViewerApp(Q3DSViewer::Q3DSViewerApp *app);
- void setCommandQueue(CommandQueue *queue);
- void setPresentation(Q3DSPresentation *presentation);
-
-protected:
- Q3DSDataOutput *q_ptr;
- Q3DSViewer::Q3DSViewerApp *m_viewerApp = nullptr; // Not owned
- CommandQueue *m_commandQueue = nullptr; // Not owned
- Q3DSPresentation *m_presentation = nullptr; // Not owned
- QString m_name;
- QVariant m_value;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSDATAOUTPUT_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.cpp
deleted file mode 100644
index 16ae1102..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dselement_p.h"
-#include "q3dspresentation_p.h"
-#include "q3dscommandqueue_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qsettings.h>
-#include <QtCore/qcoreapplication.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype Element
- \instantiates Q3DSElement
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief Control type for elements in a Qt 3D Studio presentation.
-
- This class is provided for backwards compatibility. We recommend using
- DataInput and DataOutput APIs for contractual and clean API between
- the design and the code.
-
- \sa DataInput, DataOutput
-
- This type is a convenience for controlling the properties of a scene object
- (such as, model, material, camera, layer) in a Qt 3D Studio presentation.
-
- \note The functionality of Element is equivalent to
- Presentation::setAttribute() and Presentation::fireEvent().
-
- \sa Studio3D, SceneElement, Presentation, DataInput, DataOutput
-*/
-
-/*!
- \class Q3DSElement
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
-
- \brief Controls a scene object (node) in a Qt 3D Studio presentation.
-
- This class is provided for backwards compatibility. We recommend using
- DataInput and DataOutput APIs for contractual and clean API between
- the design and the code.
-
- This class is a convenience class for controlling the properties of a scene
- object (such as, model, material, camera, layer) in a Qt 3D Studio
- presentation.
-
- \sa Q3DSWidget, Q3DSSurfaceViewer, Q3DSSceneElement
- */
-
-/*!
- \internal
- */
-Q3DSElement::Q3DSElement(QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSElementPrivate(this))
-{
-}
-
-/*!
- \internal
- */
-Q3DSElement::Q3DSElement(const QString &elementPath, QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSElementPrivate(this))
-{
- d_ptr->m_elementPath = elementPath;
-}
-
-/*!
- Constructs a Q3DSElement instance controlling the scene object specified by
- \a elementPath. An optional \a parent object can be specified. The
- constructed instance is automatically associated with the specified \a
- presentation. An optional \a parent object can be specified.
- */
-Q3DSElement::Q3DSElement(Q3DSPresentation *presentation, const QString &elementPath,
- QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSElementPrivate(this))
-{
- d_ptr->m_elementPath = elementPath;
- if (presentation)
- presentation->registerElement(this);
-}
-
-/*!
- \internal
- */
-Q3DSElement::Q3DSElement(Q3DSElementPrivate *d, Q3DSPresentation *presentation,
- const QString &elementPath, QObject *parent)
- : QObject(parent)
- , d_ptr(d)
-{
- d_ptr->m_elementPath = elementPath;
- if (presentation)
- presentation->registerElement(this);
-}
-
-/*!
- Destructor.
- */
-Q3DSElement::~Q3DSElement()
-{
- // Private class isn't QObject, so we need to delete it explicitly
- delete d_ptr;
-}
-
-/*!
- \qmlproperty string Element::elementPath
-
- Holds the element path of the presentation element.
-
- An element path refers to an object in the scene by name, for example,
- \c{Scene.Layer.Camera}. Here the right camera object gets chosen even if
- the scene contains other layers with the default camera names (for instance
- \c{Scene.Layer2.Camera}).
-
- To reference an object stored in a property of another object, the dot
- syntax can be used. The most typical example of this is changing the source
- of a texture map by changing the \c sourcepath property on the object
- selected by \c{SomeMaterial.diffusemap}.
-
- To access an object in a sub-presentation, prepend the name of the
- sub-presentation followed by a colon, for example,
- \c{SubPresentationOne:Scene.Layer.Camera}.
- */
-
-/*!
- \property Q3DSElement::elementPath
-
- Holds the element path of the presentation element.
-
- An element path refers to an object in the scene by name, for example,
- \c{Scene.Layer.Camera}. Here the right camera object gets chosen even if
- the scene contains other layers with the default camera names (for instance
- \c{Scene.Layer2.Camera}).
-
- To reference an object stored in a property of another object, the dot
- syntax can be used. The most typical example of this is changing the source
- of a texture map by changing the \c sourcepath property on the object
- selected by \c{SomeMaterial.diffusemap}.
-
- To access an object in a sub-presentation, prepend the name of the
- sub-presentation followed by a colon, for example,
- \c{SubPresentationOne:Scene.Layer.Camera}.
- */
-QString Q3DSElement::elementPath() const
-{
- return d_ptr->m_elementPath;
-}
-
-void Q3DSElement::setElementPath(const QString &elementPath)
-{
- if (d_ptr->m_elementPath != elementPath) {
- d_ptr->setElementPath(elementPath);
- Q_EMIT elementPathChanged(d_ptr->m_elementPath);
- }
-}
-
-/*!
- \qmlmethod void Element::setAttribute(string attributeName, variant value)
-
- Sets the \a value of an attribute (property) of the scene object specified
- by this Element instance. The \a attributeName is the \l{Attribute
- Names}{scripting name} of the attribute.
-*/
-
-/*!
- Sets the \a value of an attribute (property) of the scene object
- specified by elementPath.
-
- The \a attributeName is the \l{Attribute Names}{scripting name} of the attribute.
- */
-void Q3DSElement::setAttribute(const QString &attributeName, const QVariant &value)
-{
- if (d_ptr->m_presentation)
- d_ptr->m_presentation->q_ptr->setAttribute(d_ptr->m_elementPath, attributeName, value);
- else
- qWarning() << __FUNCTION__ << "Element is not registered to any presentation!";
-}
-
-/*!
- \qmlmethod void Element::fireEvent(string eventName)
-
- Dispatches an event with \a eventName on the scene object
- specified by elementPath.
-
- Appropriate actions created in Qt 3D Studio or callbacks registered using
- the registerForEvent() method in attached \c{behavior scripts} will be
- executed in response to the event.
-*/
-
-/*!
- Dispatches an event with \a eventName on the scene object
- specified by elementPath.
-
- Appropriate actions created in Qt 3D Studio or callbacks registered using
- the registerForEvent() method in attached (behavior) scripts will be
- executed in response to the event.
- */
-void Q3DSElement::fireEvent(const QString &eventName)
-{
- if (d_ptr->m_presentation)
- d_ptr->m_presentation->q_ptr->fireEvent(d_ptr->m_elementPath, eventName);
- else
- qWarning() << __FUNCTION__ << "Element is not registered to any presentation!";
-}
-
-Q3DSElementPrivate::Q3DSElementPrivate(Q3DSElement *parent)
- : q_ptr(parent)
- , m_viewerApp(nullptr)
- , m_commandQueue(nullptr)
- , m_presentation(nullptr)
-{
-}
-
-Q3DSElementPrivate::~Q3DSElementPrivate()
-{
- if (m_presentation)
- m_presentation->unregisterElement(q_ptr);
-}
-
-void Q3DSElementPrivate::setElementPath(const QString &elementPath)
-{
- m_elementPath = elementPath;
-
- if (m_presentation)
- m_presentation->registerElement(q_ptr);
-}
-
-void Q3DSElementPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app)
-{
- m_viewerApp = app;
-}
-
-void Q3DSElementPrivate::setCommandQueue(CommandQueue *queue)
-{
- m_commandQueue = queue;
-}
-
-void Q3DSElementPrivate::setPresentation(Q3DSPresentationPrivate *presentation)
-{
- m_presentation = presentation;
-}
-
-void Q3DSElementPrivate::requestResponseHandler(CommandType commandType, void *requestData)
-{
- Q_UNUSED(commandType)
- Q_UNUSED(requestData)
-
- // Base element doesn't handle any request command types yet
- qWarning() << __FUNCTION__ << "Unknown command type.";
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.h
deleted file mode 100644
index 04c43f52..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSELEMENT_H
-#define Q3DSELEMENT_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSElementPrivate;
-class Q3DSPresentation;
-
-class Q_STUDIO3D_EXPORT Q3DSElement : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSElement)
-
- Q_PROPERTY(QString elementPath READ elementPath WRITE setElementPath NOTIFY elementPathChanged)
-
-public:
- explicit Q3DSElement(QObject *parent = nullptr);
- explicit Q3DSElement(const QString &elementPath, QObject *parent = nullptr);
- explicit Q3DSElement(Q3DSPresentation *presentation, const QString &elementPath,
- QObject *parent = nullptr);
- virtual ~Q3DSElement();
-
- QString elementPath() const;
-
-public Q_SLOTS:
- void setElementPath(const QString &elementPath);
- void setAttribute(const QString &attributeName, const QVariant &value);
- void fireEvent(const QString &eventName);
-
-Q_SIGNALS:
- void elementPathChanged(const QString &elementPath);
-
-protected:
- explicit Q3DSElement(Q3DSElementPrivate *d, Q3DSPresentation *presentation,
- const QString &elementPath, QObject *parent = nullptr);
- Q3DSElementPrivate *d_ptr;
-
-private:
- Q_DISABLE_COPY(Q3DSElement)
-
- friend class Q3DSPresentationPrivate;
- friend class Q3DSStudio3D;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSELEMENT_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement_p.h
deleted file mode 100644
index d4e77b1c..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dselement_p.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSSCENE_P_H
-#define Q3DSSCENE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dselement.h"
-#include "q3dscommandqueue_p.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPresentationPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSElementPrivate
-{
- Q_DECLARE_PUBLIC(Q3DSElement)
-public:
- explicit Q3DSElementPrivate(Q3DSElement *parent);
- virtual ~Q3DSElementPrivate();
-
- void setElementPath(const QString &elementPath);
-
- virtual void setViewerApp(Q3DSViewer::Q3DSViewerApp *app);
- virtual void setCommandQueue(CommandQueue *queue);
- virtual void setPresentation(Q3DSPresentationPrivate *presentation);
-
- virtual void requestResponseHandler(CommandType commandType, void *requestData);
-
-protected:
- Q3DSElement *q_ptr;
- Q3DSViewer::Q3DSViewerApp *m_viewerApp; // Not owned
- CommandQueue *m_commandQueue; // Not owned
- Q3DSPresentationPrivate *m_presentation; // Not owned
- QString m_elementPath;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSSCENE_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.cpp
deleted file mode 100644
index bfc66a96..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsgeometry_p.h"
-
-QT_BEGIN_NAMESPACE
-
-Q3DSGeometry::Q3DSGeometry()
- : d_ptr(new Q3DSGeometryPrivate(this))
-{
-}
-
-Q3DSGeometry::~Q3DSGeometry()
-{
- delete d_ptr;
-}
-
-void Q3DSGeometry::setVertexData(const QByteArray &data)
-{
- d_ptr->m_meshData.m_vertexBuffer = data;
-}
-
-void Q3DSGeometry::setIndexData(const QByteArray &data)
-{
- d_ptr->m_meshData.m_indexBuffer = data;
-}
-
-const QByteArray &Q3DSGeometry::vertexBuffer() const
-{
- return d_ptr->m_meshData.m_vertexBuffer;
-}
-
-QByteArray &Q3DSGeometry::vertexBuffer()
-{
- return d_ptr->m_meshData.m_vertexBuffer;
-}
-
-const QByteArray &Q3DSGeometry::indexBuffer() const
-{
- return d_ptr->m_meshData.m_indexBuffer;
-}
-
-QByteArray &Q3DSGeometry::indexBuffer()
-{
- return d_ptr->m_meshData.m_indexBuffer;
-}
-
-int Q3DSGeometry::attributeCount() const
-{
- return d_ptr->m_meshData.m_attributeCount;
-}
-
-void Q3DSGeometry::addAttribute(Q3DSGeometry::Attribute::Semantic semantic,
- Q3DSGeometry::Attribute::ComponentType componentType)
-{
- Q_ASSERT(d_ptr->m_meshData.m_attributeCount < Q3DSViewer::MeshData::MAX_ATTRIBUTES);
-
- Q3DSViewer::MeshData::Attribute &att
- = d_ptr->m_meshData.m_attributes[d_ptr->m_meshData.m_attributeCount];
-
- Q3DSGeometry::Attribute::ComponentType theCompType = componentType;
- if (theCompType == Attribute::DefaultType) {
- theCompType = semantic == Attribute::IndexSemantic ? Attribute::U32Type
- : Attribute::F32Type;
- }
- att.semantic = static_cast<Q3DSViewer::MeshData::Attribute::Semantic>(semantic);
- att.componentType = static_cast<Q3DSViewer::MeshData::Attribute::ComponentType>(theCompType);
- if (semantic != Q3DSGeometry::Attribute::IndexSemantic)
- att.offset = d_ptr->getNextAttributeOffset();
-
- d_ptr->m_meshData.m_attributeCount++;
- d_ptr->m_meshData.m_stride = d_ptr->getNextAttributeOffset();
-}
-
-void Q3DSGeometry::addAttribute(const Q3DSGeometry::Attribute &att)
-{
- addAttribute(att.semantic, att.componentType);
-}
-
-Q3DSGeometry::Attribute Q3DSGeometry::attribute(int idx) const
-{
- Attribute att;
- att.semantic = static_cast<Q3DSGeometry::Attribute::Semantic>(
- d_ptr->m_meshData.m_attributes[idx].semantic);
- att.componentType = static_cast<Q3DSGeometry::Attribute::ComponentType>(
- d_ptr->m_meshData.m_attributes[idx].componentType);
- return att;
-}
-
-Q3DSGeometry::PrimitiveType Q3DSGeometry::primitiveType() const
-{
- return static_cast<Q3DSGeometry::PrimitiveType>(d_ptr->m_meshData.m_primitiveType);
-}
-
-void Q3DSGeometry::setPrimitiveType(Q3DSGeometry::PrimitiveType type)
-{
- d_ptr->m_meshData.m_primitiveType = static_cast<Q3DSViewer::MeshData::PrimitiveType>(type);
-}
-
-void Q3DSGeometry::clear()
-{
- d_ptr->m_meshData.clear();
-}
-
-Q3DSGeometryPrivate::Q3DSGeometryPrivate(Q3DSGeometry *parent)
- : q_ptr(parent)
-{
-}
-
-Q3DSGeometryPrivate::~Q3DSGeometryPrivate()
-{
-}
-
-int Q3DSGeometryPrivate::getNextAttributeOffset() const
-{
- int retval = 0;
- for (int i = 0; i < m_meshData.m_attributeCount; ++i) {
- if (m_meshData.m_attributes[i].semantic != Q3DSViewer::MeshData::Attribute::IndexSemantic) {
- retval += m_meshData.m_attributes[i].typeSize()
- * m_meshData.m_attributes[i].componentCount();
- }
- }
- return retval;
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.h
deleted file mode 100644
index b9b66e98..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSGEOMETRY_H
-#define Q3DSGEOMETRY_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qbytearray.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSGeometryPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSGeometry
-{
-public:
- Q_DECLARE_PRIVATE(Q3DSGeometry)
-
- // All enums must match the ones defined by MeshData::Attribute struct in Qt3DSViewerApp.h
- enum PrimitiveType {
- UnknownType = 0,
- Points,
- LineStrip,
- LineLoop,
- Lines,
- TriangleStrip,
- TriangleFan,
- Triangles, // Default primitive type
- Patches
- };
-
- struct Attribute {
- enum Semantic {
- UnknownSemantic = 0,
- IndexSemantic,
- PositionSemantic, // attr_pos
- NormalSemantic, // attr_norm
- TexCoordSemantic, // attr_uv0
- TangentSemantic, // attr_textan
- BinormalSemantic // attr_binormal
- };
- enum ComponentType {
- DefaultType = 0,
- U8Type,
- I8Type,
- U16Type,
- I16Type,
- U32Type, // Default for IndexSemantic
- I32Type,
- U64Type,
- I64Type,
- F16Type,
- F32Type, // Default for other semantics
- F64Type
- };
- Semantic semantic = PositionSemantic;
- ComponentType componentType = DefaultType;
- };
-
- explicit Q3DSGeometry();
- virtual ~Q3DSGeometry();
-
- void setVertexData(const QByteArray &data);
- void setIndexData(const QByteArray &data);
-
- const QByteArray &vertexBuffer() const;
- QByteArray &vertexBuffer();
- const QByteArray &indexBuffer() const;
- QByteArray &indexBuffer();
-
- int attributeCount() const;
- void addAttribute(Attribute::Semantic semantic,
- Attribute::ComponentType componentType = Attribute::DefaultType);
- void addAttribute(const Attribute &att);
- Attribute attribute(int idx) const;
-
- PrimitiveType primitiveType() const;
- void setPrimitiveType(PrimitiveType type);
-
- void clear();
-
-protected:
- Q_DISABLE_COPY(Q3DSGeometry)
- Q3DSGeometryPrivate *d_ptr;
-
- friend class Q3DSPresentation;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSGEOMETRY_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry_p.h
deleted file mode 100644
index 586b0d7b..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsgeometry_p.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSGEOMETRY_P_H
-#define Q3DSGEOMETRY_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dsgeometry.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q_STUDIO3D_EXPORT Q3DSGeometryPrivate
-{
- Q_DECLARE_PUBLIC(Q3DSGeometry)
-public:
- explicit Q3DSGeometryPrivate(Q3DSGeometry *parent);
- virtual ~Q3DSGeometryPrivate();
-
- Q3DSViewer::MeshData &meshData() { return m_meshData; }
-
-private:
- int getNextAttributeOffset() const;
-
- Q3DSGeometry *q_ptr;
- Q3DSViewer::MeshData m_meshData;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSGEOMETRY_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator.cpp
deleted file mode 100644
index d0b8251b..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsimagesequencegenerator_p.h"
-#include "q3dsimagesequencegeneratorthread_p.h"
-
-#ifndef Q_OS_ANDROID
-bool Q3DSImageSequenceGenerator::generateImageSequence(
- const QString &presentation, qreal start, qreal end, qreal fps, qreal frameInterval,
- int width, int height, const QString &outPath, const QString &outFile)
-{
- Q3DSImageSequenceGeneratorThread *thread = new Q3DSImageSequenceGeneratorThread;
-
- connect(thread, &Q3DSImageSequenceGeneratorThread::generationFinished,
- this, &Q3DSImageSequenceGenerator::finished);
-
- bool success = thread->initialize(presentation, start, end, fps, frameInterval, width, height,
- outPath, outFile);
-
- if (success) {
- connect(thread, &Q3DSImageSequenceGeneratorThread::progress,
- this, &Q3DSImageSequenceGenerator::progress);
- thread->start();
- } else {
- delete thread;
- }
-
- return success;
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator_p.h
deleted file mode 100644
index bc56fb1e..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegenerator_p.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSIMAGE_SEQUENCE_GENERATOR_H
-#define Q3DSIMAGE_SEQUENCE_GENERATOR_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qobject.h>
-#ifndef Q_OS_ANDROID
-QT_BEGIN_NAMESPACE
-
-class Q_STUDIO3D_EXPORT Q3DSImageSequenceGenerator : public QObject
-{
- Q_OBJECT
-public:
- Q3DSImageSequenceGenerator() {}
- virtual ~Q3DSImageSequenceGenerator() {}
-
- bool generateImageSequence(const QString &presentation, qreal start, qreal end,
- qreal fps, qreal frameInterval, int width, int height,
- const QString &outPath, const QString &outFile);
-Q_SIGNALS:
- void progress(int totalFrames, int frameNumber);
- void finished(bool success, const QString &details);
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSIMAGE_SEQUENCE_GENERATOR_H
-#endif
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread.cpp
deleted file mode 100644
index 0968e3f1..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsimagesequencegeneratorthread_p.h"
-#include "q3dssurfaceviewer.h"
-#include "q3dspresentation.h"
-#include "q3dsviewersettings.h"
-
-#include <QtGui/qopenglcontext.h>
-#include <QtGui/qopenglfunctions.h>
-#include <QtGui/qoffscreensurface.h>
-#include <QtGui/qopenglframebufferobject.h>
-#include <QtCore/qfileinfo.h>
-#include <QtCore/qdir.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qmath.h>
-
-bool Q3DSImageSequenceGeneratorThread::initialize(
- const QString &presentation, qreal start, qreal end, qreal fps, qreal frameInterval,
- int width, int height, const QString &outPath, const QString &outFile)
-{
- QFileInfo fileInfo(presentation);
- if (!fileInfo.exists()) {
- QString error = QObject::tr("File not found: '%1'").arg(presentation);
- qWarning() << "Generating image sequence failed -" << error;
- Q_EMIT generationFinished(false, error);
- return false;
- }
-
- m_outputFileName = QStringLiteral("%2/%1_%3.png");
- if (outFile.isEmpty()) {
- m_outputFileName = m_outputFileName.arg(fileInfo.baseName())
- .arg(outPath).arg(QStringLiteral("%1"));
- } else {
- m_outputFileName = m_outputFileName.arg(outFile).arg(outPath).arg(QStringLiteral("%1"));
- }
-
- m_sourceUrl = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
-
- QSurfaceFormat format;
- format.setDepthBufferSize(24);
- format.setStencilBufferSize(8);
-
- m_context = new QOpenGLContext;
- m_context->setFormat(format);
- if (!m_context->create()) {
- QString error = QObject::tr("Failed to create context");
- qWarning() << "Generating image sequence failed -" << error;
- Q_EMIT generationFinished(false, error);
- return false;
- }
-
- m_surface = new QOffscreenSurface;
- m_surface->setFormat(m_context->format());
- m_surface->create();
-
- m_mainThread = QThread::currentThread();
- m_surface->moveToThread(this);
- m_context->moveToThread(this);
-
- m_start = start;
- m_end = end;
- m_fps = fps;
- m_frameInterval = frameInterval;
- m_width = width;
- m_height = height;
-
- return true;
-}
-
-Q3DSImageSequenceGeneratorThread::Q3DSImageSequenceGeneratorThread()
- : m_start(0)
- , m_end(10000)
- , m_fps(60)
- , m_frameInterval(16.666667)
- , m_width(1920)
- , m_height(1080)
- , m_surface(nullptr)
- , m_context(nullptr)
-{
-}
-
-Q3DSImageSequenceGeneratorThread::~Q3DSImageSequenceGeneratorThread() {
- delete m_context;
- delete m_surface;
-}
-
-void Q3DSImageSequenceGeneratorThread::run() {
- if (!m_context->makeCurrent(m_surface)) {
- QString error = QObject::tr("Couldn't make context current.");
- qWarning() << "Generating image sequence failed -" << error;
- Q_EMIT generationFinished(false, error);
- cleanup();
- return;
- }
-
- const QSize size(m_width, m_height);
- QOpenGLFramebufferObject fbo(size, QOpenGLFramebufferObject::CombinedDepthStencil);
-
- Q3DSSurfaceViewer viewer;
- viewer.presentation()->setSource(m_sourceUrl);
- viewer.settings()->setScaleMode(Q3DSViewerSettings::ScaleModeFill);
-
- viewer.setUpdateInterval(-1);
- viewer.setAutoSize(false);
- viewer.setSize(size);
-
- if (!viewer.create(m_surface, m_context, fbo.handle())) {
- QString error = QObject::tr("Viewer initialization failed.");
- qWarning() << "Generating image sequence failed -" << error;
- Q_EMIT generationFinished(false, error);
- cleanup();
- return;
- }
-
- if (m_frameInterval <= 0)
- m_frameInterval = 1000.0 / m_fps;
-
- // Presentations always assume you want to start animating at time zero and set a local
- // offset to global time when they render the first frame. This means we need to always
- // render a frame at global time zero first.
- if (qRound(m_start) != 0) {
- viewer.presentation()->setGlobalAnimationTime(0);
- viewer.update();
- }
-
- // Add a bit of time to the end time to ensure we don't lose the last frame to rounding errors
- m_end += m_frameInterval / 10000.0;
-
- // Ensure directory exists
- QFileInfo fi(m_outputFileName);
- QDir dir = fi.absoluteDir();
- dir.mkpath(".");
-
- int frameCount = 0;
- int totalFrames = qCeil((m_end - m_start) / m_frameInterval);
- for (qreal t = m_start; t <= m_end; t += m_frameInterval) {
- ++frameCount;
- viewer.presentation()->setGlobalAnimationTime(qRound64(t));
- viewer.update();
- if (!fbo.toImage().save(m_outputFileName.arg(frameCount))) {
- QString error = QObject::tr("Failed to write output file: '%1'")
- .arg(m_outputFileName.arg(frameCount));
- qWarning() << "Generating image sequence failed -" << error;
- Q_EMIT generationFinished(false, error);
- cleanup();
- return;
- }
- Q_EMIT progress(totalFrames, frameCount);
- }
-
- Q_EMIT generationFinished(true, m_outputFileName.arg("*"));
- cleanup();
-}
-
-void Q3DSImageSequenceGeneratorThread::cleanup()
-{
- m_context->doneCurrent();
- delete m_context;
- m_context = nullptr;
- // Surface needs to be deleted in the thread it was created in
- m_surface->moveToThread(m_mainThread);
- deleteLater();
-}
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread_p.h
deleted file mode 100644
index 45869a69..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsimagesequencegeneratorthread_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSIMAGE_SEQUENCE_GENERATOR_THREAD_H
-#define Q3DSIMAGE_SEQUENCE_GENERATOR_THREAD_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qthread.h>
-#include <QtCore/qurl.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOffscreenSurface;
-class QOpenGLContext;
-
-class Q3DSImageSequenceGeneratorThread : public QThread
-{
- Q_OBJECT
-public:
- Q3DSImageSequenceGeneratorThread();
- virtual ~Q3DSImageSequenceGeneratorThread();
-
- bool initialize(const QString &presentation, qreal start, qreal end,
- qreal fps, qreal frameInterval, int width, int height,
- const QString &outPath, const QString &outFile);
-
-Q_SIGNALS:
- void progress(int totalFrames, int frameNumber);
- void generationFinished(bool success, const QString &details);
-
-protected:
- void run() override;
-
-private:
- void cleanup();
-
- QUrl m_sourceUrl;
- qreal m_start;
- qreal m_end;
- qreal m_fps;
- qreal m_frameInterval;
- int m_width;
- int m_height;
- QString m_outputFileName;
-
- QOffscreenSurface *m_surface;
- QOpenGLContext *m_context;
- QThread *m_mainThread;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSIMAGE_SEQUENCE_GENERATOR_THREAD_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.cpp
deleted file mode 100644
index 204b2035..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.cpp
+++ /dev/null
@@ -1,1770 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dspresentation_p.h"
-#include "q3dssceneelement_p.h"
-#include "q3dscommandqueue_p.h"
-#include "viewerqmlstreamproxy_p.h"
-#include "q3dsdatainput_p.h"
-#include "q3dsdataoutput_p.h"
-#include "q3dsgeometry_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qsettings.h>
-#include <QtCore/qcoreapplication.h>
-#include <QtGui/qevent.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class Q3DSPresentation
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
-
- \brief Represents a Qt 3D Studio presentation.
-
- This class provides properties and methods for controlling a
- presentation.
-
- Qt 3D Studio supports multiple presentations in one project. There
- is always a main presentation and zero or more
- subpresentations. The subpresentations are composed into the
- main presentations either as contents of Qt 3D Studio layers or as
- texture maps.
-
- In the filesystem each presentation corresponds to one \c{.uip}
- presentation file. When present, the \c{.uia} project file ties
- these together by specifying a name for each of the
- (sub-)presentations and specifies which one is the main one.
-
- The \c{.uia} project also defines \l{DataInput}s and
- \l{DataOutput}s that are exported by the presentations.
- \l{DataInput}s provide a way to provide input to the presentation
- to e.g. control a timeline of a subpresentation from code.
- \c{DataOutput}s provide a way to get notified when an attribute
- is changed in the presentation by animation timeline,
- by behavior scripts or by a \l{DataInput}.
-
- From the API point of view Q3DSPresentation corresponds to the
- main presentation. The source property can refer either to a
- \c{.uia} or \c{.uip} file. When specifying a file with \c{.uip}
- extension and a \c{.uia} is present with the same name, the
- \c{.uia} is loaded automatically and thus sub-presentation
- information is available regardless.
-
- \note This class should not be instantiated directly when working with the
- C++ APIs. Q3DSSurfaceViewer and Q3DSWidget create a Q3DSPresentation
- instance implicitly. This can be queried via
- Q3DSSurfaceViewer::presentation() or Q3DSWidget::presentation().
- */
-
-/*!
- Constructs a new Q3DSPresentation with the given \a parent.
- */
-Q3DSPresentation::Q3DSPresentation(QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSPresentationPrivate(this))
-{
-}
-
-/*!
- Destructor.
- */
-Q3DSPresentation::~Q3DSPresentation()
-{
-}
-
-/*!
- \qmlproperty string Presentation::source
-
- Holds the name of the main presentation file (\c{*.uia} or
- \c{*.uip}). This may be either a local file or qrc URL.
-
- The names of all further assets (image files for texture maps, qml
- behavior scripts, mesh files) will be resolved relative to the
- location of the presentation, unless they use absolute paths. This
- allows bundling all assets next to the presentation in the Qt
- resource system.
-
- Currently set \c{variantList} property will modify which variant groups
- and tags are loaded from the presentations. See
- Q3DSPresentation::variantList property.
-*/
-
-/*!
- \property Q3DSPresentation::source
-
- Holds the name of the main presentation file (\c{*.uia} or
- \c{*.uip}). This may be either a local file or qrc URL.
-
- The names of all further assets (image files for texture maps, qml
- behavior scripts, mesh files) will be resolved relative to the
- location of the presentation, unless they use absolute paths. This
- allows bundling all assets next to the presentation in the Qt
- resource system.
-
- Currently set variantList will modify which variant groups
- and tags are loaded from the presentations. See
- Q3DSPresentation::variantList property.
-*/
-QUrl Q3DSPresentation::source() const
-{
- return d_ptr->m_source;
-}
-
-void Q3DSPresentation::setSource(const QUrl &source)
-{
- if (d_ptr->m_source != source) {
- d_ptr->setSource(source);
- Q_EMIT sourceChanged(source);
- }
-}
-
-/*!
- \qmlproperty variant Presentation::variantList
-
- Holds a list of (variant group):(variant) tags that are loaded when the
- \c{source} property is set. If this list is left empty (default), no variant
- filtering is applied and all items are loaded regardless of variant tags in
- the presentation. Variant mechanism allows one presentation project to
- contain multiple variants of the presentation and the decision which variant
- set is loaded is determined during runtime based on the \c{variantList}.
-
- Variants are divided to variant groups, e.g. one variant group could be
- \c{region} and the variants within that group could be e.g. \c{US, EU, CH}.
- Another variant group could be e.g. \c{power} and variants within that could
- be e.g. \c{gas, electric, diesel}. To filter in this example an electric
- variant for the EU region, the variantList needs to contain two strings
- "region:EU" and "power:electric". Also of course the presentation project
- needs to contain these variant groups and tags applied appropriately to the
- presentation content.
-
- When variant filters are used, the decision what gets loaded and what is not
- loaded is based on checking every item in the presentation:
- \list
- \li If the item has no variant tags, it will be loaded.
- \li If the item has no tags defined for the checked variant group(s),
- it will be loaded.
- \li If the item has tag(s) for the variant group, any of those tags must
- match any of the variants defined in the filter for that group.
- \endlist
-
- If the item doesn't fulfill the above rules it will not be loaded.
-*/
-
-/*!
- \property Q3DSPresentation::variantList
-
- Holds a list of (variant group):(variant) tags that are loaded when the
- \c{source} property is set. If this list is left empty (default), no variant
- filtering is applied and all items are loaded regardless of variant tags in
- the presentation. Variant mechanism allows one presentation project to
- contain multiple variants of the presentation and the decision which variant
- set is loaded is determined during runtime based on the \c{variantList}.
-
- Variants are divided to variant groups, e.g. one variant group could be
- \c{region} and the variants within that group could be e.g. \c{US, EU, CH}.
- Another variant group could be e.g. \c{power} and variants within that could
- be e.g. \c{gas, electric, diesel}. To filter in this example an electric
- variant for the EU region, the variantList needs to contain two strings
- "region:EU" and "power:electric". Also of course the presentation project
- needs to contain these variant groups and tags applied appropriately to the
- presentation content.
-
- When variant filters are used, the decision what gets loaded and what is not
- loaded is based on checking every item in the presentation:
- \list
- \li If the item has no variant tags, it will be loaded.
- \li If the item has no tags defined for the checked variant group(s),
- it will be loaded.
- \li If the item has tag(s) for the variant group, any of those tags must
- match any of the variants defined in the filter for that group.
- \endlist
-
- If the item doesn't fulfill the above rules it will not be loaded.
-*/
-QStringList Q3DSPresentation::variantList() const
-{
- return d_ptr->m_variantList;
-}
-
-void Q3DSPresentation::setVariantList(const QStringList &variantList)
-{
- if (d_ptr->m_variantList != variantList) {
- d_ptr->setVariantList(variantList);
- Q_EMIT variantListChanged(variantList);
- }
-}
-
-/*!
- \internal
- */
-void Q3DSPresentation::registerElement(Q3DSElement *element)
-{
- d_ptr->registerElement(element);
-}
-
-/*!
- \internal
- */
-void Q3DSPresentation::unregisterElement(Q3DSElement *element)
-{
- d_ptr->unregisterElement(element);
-}
-
-/*!
- \internal
- */
-Q3DSElement *Q3DSPresentation::registeredElement(const QString &elementPath) const
-{
- return d_ptr->m_elements.value(elementPath, nullptr);
-}
-
-/*!
- \internal
- */
-void Q3DSPresentation::registerDataInput(Q3DSDataInput *dataInput)
-{
- d_ptr->registerDataInput(dataInput);
-}
-
-/*!
- \internal
- */
-void Q3DSPresentation::unregisterDataInput(Q3DSDataInput *dataInput)
-{
- d_ptr->unregisterDataInput(dataInput);
-}
-
-/*!
- \internal
- */
-Q3DSDataInput *Q3DSPresentation::registeredDataInput(const QString &name) const
-{
- return d_ptr->m_dataInputs.value(name, nullptr);
-}
-
-/*!
- \internal
- */
-void Q3DSPresentation::registerDataOutput(Q3DSDataOutput *dataOutput)
-{
- d_ptr->registerDataOutput(dataOutput);
-}
-
-/*!
- \internal
- */
-void Q3DSPresentation::unregisterDataOutput(Q3DSDataOutput *dataOutput)
-{
- d_ptr->unregisterDataOutput(dataOutput);
-}
-
-/*!
- \internal
- */
-Q3DSDataOutput *Q3DSPresentation::registeredDataOutput(const QString &name) const
-{
- return d_ptr->m_dataOutputs.value(name, nullptr);
-}
-
-/*!
- Returns a list of datainputs defined for this presentation. Use setDataInputValue()
- interface to set a datainput value using datainput name, or call Q3DSDataInput::setValue
- directly for a specific datainput.
-
- \sa setDataInputValue
- \sa Q3DSDataInput
- */
-QVector<Q3DSDataInput *> Q3DSPresentation::dataInputs() const
-{
- QVector<Q3DSDataInput *> ret;
- const auto datainputs = d_ptr->m_dataInputs;
- for (const auto &it : datainputs)
- ret.append(it);
-
- return ret;
-}
-
-/*!
- \qmlmethod variant Presentation::getDataInputs
- Returns a list of datainputs defined for this presentation. Use setDataInputValue()
- interface to set a datainput value using datainput name, or call Q3DSDataInput::setValue
- directly for a specific datainput.
-
- \sa DataInput
- */
-
-/*!
- Returns a list of datainputs defined for this presentation. Use setDataInputValue()
- interface to set a datainput value using datainput name, or call Q3DSDataInput::setValue
- directly for a specific datainput.
-
- \sa setDataInputValue
- \sa Q3DSDataInput
- */
-QVariantList Q3DSPresentation::getDataInputs() const
-{
- QVariantList ret;
- const auto datainputs = dataInputs();
-
- for (const auto &it : datainputs)
- ret.append(QVariant::fromValue(it));
-
- return ret;
-}
-
-/*!
- Returns a list of dataoutputs defined for this presentation. Use Qt's connect() method
- to connect slots to the valueChanged() signal in the required \l{DataOutput}s to get notified
- when the value tracked by the DataOutput is changed.
-
- \sa Q3DSDataOutput
- */
-QVector<Q3DSDataOutput *> Q3DSPresentation::dataOutputs() const
-{
- QVector<Q3DSDataOutput *> ret;
- const auto datainputs = d_ptr->m_dataOutputs;
- for (const auto &it : datainputs)
- ret.append(it);
-
- return ret;
-}
-
-/*!
- \qmlmethod variant Presentation::getDataOutputs
-
- Returns a list of dataoutputs defined for this presentation. Connect slots to the
- \c{valueChanged()} signal in the required \l{DataOutput}s to get notified
- when the value tracked by the DataOutput is changed.
-
- \sa SDataOutput
- */
-/*!
- * \brief Q3DSPresentation::getDataOutputs Returns \l{DataOutput}s.
- Returns a list of dataoutputs defined for this presentation. Use Qt's connect() method
- to connect slots to the valueChanged() signal in the required \l{DataOutput}s to get notified
- when the value tracked by the DataOutput is changed.
-
- \sa Q3DSDataOutput
- */
-QVariantList Q3DSPresentation::getDataOutputs() const
-{
- QVariantList ret;
- const auto dataoutputs = dataOutputs();
-
- for (const auto &it : dataoutputs)
- ret.append(QVariant::fromValue(it));
-
- return ret;
-}
-
-/*!
- \qmlproperty bool Presentation::delayedLoading
-
- This property controls whether the presentation resources are loaded while loading
- the presentation(false) or afterwards when they are actually used in the presentation(true).
- The resources are loaded per slide basis so that all resources required by a slide will be
- loaded at once.
-
- The resources can be images, subpresentations, materials, effects and meshes.
-
- Default is \c{false}.
- */
-
-/*!
- \property Q3DSPresentation::delayedLoading
-
- This property controls whether the presentation resources are loaded while loading
- the presentation(false) or afterwards when they are actually used in the presentation(true).
- The resources are loaded per slide basis so that all resources required by a slide will be
- loaded at once.
-
- The resources can be images, subpresentations, materials, effects and meshes.
-
- Default is \c{false}.
- */
-bool Q3DSPresentation::delayedLoading() const
-{
- return d_ptr->m_delayedLoading;
-}
-
-void Q3DSPresentation::setDelayedLoading(bool enable)
-{
- if (d_ptr->m_delayedLoading != enable) {
- d_ptr->setDelayedLoading(enable);
- Q_EMIT delayedLoadingChanged(enable);
- }
-}
-
-/*!
- \qmlmethod Presentation::preloadSlide
- Preloads slide resources to memory. All resources required by the given slide will be
- loaded in the background. This function has effect only when delayed loading is enabled.
- \param elementPath
- */
-/*!
- \brief Q3DSPresentation::preloadSlide
- Preloads slide resources to memory. All resources required by the given slide will be
- loaded in the background. This function has effect only when delayed loading is enabled.
- \param elementPath
- */
-void Q3DSPresentation::preloadSlide(const QString &elementPath)
-{
- if (d_ptr->m_viewerApp)
- d_ptr->m_viewerApp->preloadSlide(elementPath);
- else if (d_ptr->m_commandQueue)
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_PreloadSlide);
-}
-
-/*!
- \qmlmethod Presentation::unloadSlide
- Unloads slide resources from memory. If the slide is current, then the resources are unloaded
- when the slide is changed. This function has effect only when delayed loading is enabled.
- \param elementPath
- */
-
-/*!
- \brief Q3DSPresentation::unloadSlide
- Unloads slide resources from memory. If the slide is current, then the resources are unloaded
- when the slide is changed. This function has effect only when delayed loading is enabled.
- \param elementPath
- */
-void Q3DSPresentation::unloadSlide(const QString &elementPath)
-{
- if (d_ptr->m_viewerApp)
- d_ptr->m_viewerApp->unloadSlide(elementPath);
- else if (d_ptr->m_commandQueue)
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_UnloadSlide);
-}
-
-/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
- slide changes. \l{DataInput} provides stronger contract between the design and
- code as it avoids use of elementPath (a reference to design's internal structure).
-
- Requests a time context (a Scene or a Component object) to change
- to a specific slide by \a index. If the context is already on that
- slide, playback will start over.
-
- If \a elementPath points to a time context, that element is
- controlled. For all other element types the time context owning
- that element is controlled instead. You can target the command to
- a specific sub-presentation by adding "SubPresentationId:" in
- front of the element path, for example \c{"SubPresentationOne:Scene"}.
- */
-void Q3DSPresentation::goToSlide(const QString &elementPath, unsigned int index)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray path(elementPath.toUtf8());
- d_ptr->m_viewerApp->GoToSlideByIndex(path, index);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_GoToSlide, int(index));
- }
-}
-
-/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
- slide changes. \l{DataInput} provides stronger contract between the design and
- code as it avoids use of elementPath (a reference to design's internal structure).
-
- Requests a time context (a Scene or a Component object) to change
- to a specific slide by \a name. If the context is already on that
- slide, playback will start over.
-
- If \a elementPath points to a time context, that element is
- controlled. For all other element types the time context owning
- that element is controlled instead. You can target the command to
- a specific sub-presentation by adding "SubPresentationId:" in
- front of the element path, for example \c{"SubPresentationOne:Scene"}.
- */
-void Q3DSPresentation::goToSlide(const QString &elementPath, const QString &name)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray path(elementPath.toUtf8());
- const QByteArray byteName(name.toUtf8());
- d_ptr->m_viewerApp->GoToSlideByName(path, byteName);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_GoToSlideByName, name);
- }
-}
-
-/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
- slide changes. \l{DataInput} provides stronger contract between the design and
- code as it avoids use of elementPath (a reference to design's internal structure).
-
- Requests a time context (a Scene or a Component object) to change to the
- next or previous slide, depending on the value of \a next. If the context
- is already at the last or first slide, \a wrap defines if wrapping over to
- the first or last slide, respectively, occurs.
-
- If \a elementPath points to a time context, that element is controlled. For
- all other element types the time context owning that element is controlled
- instead. You can target the command to a specific sub-presentation by
- adding "SubPresentationId:" in front of the element path, for example
- \c{"SubPresentationOne:Scene"}.
- */
-void Q3DSPresentation::goToSlide(const QString &elementPath, bool next, bool wrap)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray path(elementPath.toUtf8());
- d_ptr->m_viewerApp->GoToSlideRelative(path, next, wrap);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_GoToSlideRelative,
- int(next), int(wrap));
- }
-}
-
-/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
- slide changes. \l{DataInput} provides stronger contract between the design and
- code as it avoids use of elementPath (a reference to design's internal structure).
-
- Moves the timeline for a time context (a Scene or a Component element) to a
- specific position. The position is given in seconds in \a timeSeconds.
-
- If \a elementPath points to a time context, that element is
- controlled. For all other element types the time context owning
- that element is controlled instead. You can target the command to
- a specific sub-presentation by adding "SubPresentationId:" in
- front of the element path, for example
- \c{"SubPresentationOne:Scene"}.
-
- The behavior when specifying a time before 0 or after the end time
- for the current slide depends on the play mode of the slide:
-
- \list
- \li \c{Stop at End} - values outside the valid time range instead clamp to the boundaries.
- For example, going to time -5 is the same as going to time 0.
- \li \c{Looping} - values outside the valid time range mod into the valid range. For example,
- going to time -4 on a 10 second slide is the same as going to time 6.
- \li \c{Ping Pong} - values outside the valid time range bounce off the ends. For example,
- going to time -4 is the same as going to time 4 (assuming the time context is at least 4 seconds
- long), while going to time 12 on a 10 second slide is the same as going to time 8.
- \li \c{Ping} - values less than 0 are treated as time 0, while values greater than the endtime
- bounce off the end (eventually hitting 0.)
- \endlist
- */
-void Q3DSPresentation::goToTime(const QString &elementPath, float time)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray path(elementPath.toUtf8());
- d_ptr->m_viewerApp->GoToTime(path, time);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_GoToTime, time);
- }
-}
-
-/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
- attributes in the presentation. \l{DataInput} provides stronger contract between the
- design and code as it avoids use of elementPath (a reference to design's
- internal structure).
-
- Sets the \a value of an attribute (property) on the object specified by
- \a elementPath. The \a attributeName is the \l{Attribute Names}{scripting
- name} of the attribute.
-
- An element path refers to an object in the scene by name, for example,
- \c{Scene.Layer.Camera}. Here the right camera object gets chosen even if
- the scene contains other layers with the default camera names (for instance
- \c{Scene.Layer2.Camera}).
-
- To reference an object stored in a property of another object, the dot
- syntax can be used. The most typical example of this is changing the source
- of a texture map by changing the \c sourcepath property on the object
- selected by \c{SomeMaterial.diffusemap}.
-
- To access an object in a sub-presentation, prepend the name of the
- sub-presentation followed by a colon, for example,
- \c{SubPresentationOne:Scene.Layer.Camera}.
- */
-void Q3DSPresentation::setAttribute(const QString &elementPath, const QString &attributeName,
- const QVariant &value)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray path(elementPath.toUtf8());
- const QByteArray name(attributeName.toUtf8());
-
- QByteArray valueStr;
- float valueFloat;
-
- const void *theValue = nullptr;
- switch (static_cast<QMetaType::Type>(value.type())) {
- case QMetaType::Bool:
- case QMetaType::Int:
- case QMetaType::Double:
- case QMetaType::Float:
- valueFloat = value.toFloat();
- theValue = &valueFloat;
- break;
- case QMetaType::QString:
- default: // Try string for other types
- valueStr = value.toString().toUtf8();
- theValue = valueStr.constData();
- break;
- }
- d_ptr->m_viewerApp->SetAttribute(path, name, (char *)theValue);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_SetAttribute,
- attributeName, value);
- }
-}
-
-// #TODO: QT3DS-3558
-/*!
- \brief Q3DSPresentation::setPresentationActive
- \param id
- \param active
- */
-void Q3DSPresentation::setPresentationActive(const QString &id, bool active)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray presId(id.toUtf8());
- d_ptr->m_viewerApp->SetPresentationActive(presId, active);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(id, CommandType_SetPresentationActive, active);
- }
-}
-
-/*!
- Dispatches a Qt 3D Studio presentation event with \a eventName on
- scene object specified by \a elementPath. These events provide a
- way to communicate with the \c .qml based \c{behavior scripts}
- attached to scene objects since they can register to be notified
- via Behavior::registerForEvent().
-
- See setAttribute() for a description of \a elementPath.
- */
-void Q3DSPresentation::fireEvent(const QString &elementPath, const QString &eventName)
-{
- if (d_ptr->m_viewerApp) {
- const QByteArray path(elementPath.toUtf8());
- const QByteArray name(eventName.toUtf8());
- d_ptr->m_viewerApp->FireEvent(path, name);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_FireEvent, eventName);
- }
-}
-
-// #TODO: QT3DS-3559
-/*!
- \brief Q3DSPresentation::setGlobalAnimationTime
- \param milliseconds
- */
-void Q3DSPresentation::setGlobalAnimationTime(qint64 milliseconds)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->SetGlobalAnimationTime(milliseconds);
- } else {
- d_ptr->m_commandQueue->m_globalAnimationTimeChanged = true;
- d_ptr->m_commandQueue->m_globalAnimationTime = milliseconds;
- }
-}
-
-/*!
- Sets the \a value of a data input element \a name in the presentation.
-
- Data input provides a higher level, designer-driven alternative to
- Q3DSElement and setAttribute(). Instead of exposing a large set of
- properties with their internal engine names, data input allows designers to
- decide which properties should be writable by the application, and can
- assign custom names to these data input entries, thus forming a
- well-defined contract between the designer and the developer.
-
- In addition, data input also allows controlling the time line and the
- current slide for time context objects (Scene or Component). Therefore it
- is also an alternative to the goToSlide() and goToTime() family of APIs and
- to Q3DSSceneElement.
-
- \sa DataInput
- */
-void Q3DSPresentation::setDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->SetDataInputValue(name, value,
- (qt3ds::runtime::DataInputValueRole)valueRole);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_SetDataInputValue,
- name, value, static_cast<int>(valueRole));
- }
-}
-
-/*!
- * \brief Q3DSPresentation::createElement Adds a new child element for the specified element.
- Adds a new child element for the element specified by parentElementPath to the slide
- specified with slideName. Only model element creation is currently supported.
- A referenced material element is also created for the new model element. The source material
- name can be specified with custom "material" property in the properties hash.
- The source material must exist in the material container of the presentation.
- */
-void Q3DSPresentation::createElement(const QString &parentElementPath, const QString &slideName,
- const QHash<QString, QVariant> &properties)
-{
- QVector<QHash<QString, QVariant>> theProperties;
- theProperties << properties;
- createElements(parentElementPath, slideName, theProperties);
-}
-
-// #TODO: QT3DS-3560
-/*!
- \brief Q3DSPresentation::createElements
- \param parentElementPath
- \param slideName
- \param properties
- */
-void Q3DSPresentation::createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->createElements(parentElementPath, slideName, properties);
- } else if (d_ptr->m_commandQueue) {
- // We need to copy the properties map as queue takes ownership of it
- QVector<QHash<QString, QVariant>> *theProperties
- = new QVector<QHash<QString, QVariant>>(properties);
- d_ptr->m_commandQueue->queueCommand(parentElementPath, CommandType_CreateElements,
- slideName, theProperties);
- }
-}
-
-/*!
- \brief Q3DSPresentation::deleteElement
- Removes an element added by createElement and all its child elements.
- \param elementPath
- */
-void Q3DSPresentation::deleteElement(const QString &elementPath)
-{
- QStringList elementPaths;
- elementPaths << elementPath;
- deleteElements(elementPaths);
-}
-
-/*!
- \brief Q3DSPresentation::deleteElements
- Removes the given list of elements added by createElement and all their child elements.
- \param elementPaths QStringList containing the elementPaths of dynamically created objects.
- */
-void Q3DSPresentation::deleteElements(const QStringList &elementPaths)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->deleteElements(elementPaths);
- } else if (d_ptr->m_commandQueue) {
- // We need to copy the list as queue takes ownership of it
- QStringList *theElementPaths = new QStringList(elementPaths);
- d_ptr->m_commandQueue->queueCommand(CommandType_DeleteElements, theElementPaths);
- }
-}
-
-/*!
- \brief Q3DSPresentation::createMaterial
- Creates a material specified by the materialDefinition parameter into the material
- container of the presentation that owns the element specified by the elementPath parameter.
- After creation, the material can be used for new elements created via createElement.
- The materialDefinition parameter can contain either the file path to a material definition
- file or a material definition in the Qt 3D Studion material data format.
- \param elementPath
- \param materialDefinition
- */
-void Q3DSPresentation::createMaterial(const QString &elementPath,
- const QString &materialDefinition)
-{
- QStringList materialDefinitions;
- materialDefinitions << materialDefinition;
- createMaterials(elementPath, materialDefinitions);
-}
-
-/*!
- \brief Q3DSPresentation::createMaterials
- Same as createMaterial, but creates multiple materials.
- \param elementPath
- \param materialDefinitions
- */
-void Q3DSPresentation::createMaterials(const QString &elementPath,
- const QStringList &materialDefinitions)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->createMaterials(elementPath, materialDefinitions);
- } else if (d_ptr->m_commandQueue) {
- // We need to copy the list as queue takes ownership of it
- QStringList *theMaterialDefinitions = new QStringList(materialDefinitions);
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_CreateMaterials,
- theMaterialDefinitions);
- }
-}
-
-void Q3DSPresentation::deleteMaterial(const QString &elementPath, const QString &materialName)
-{
- QStringList materialNames;
- materialNames << materialName;
- deleteMaterials(elementPath, materialNames);
-}
-
-void Q3DSPresentation::deleteMaterials(const QString &elementPath, const QStringList &materialNames)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->deleteMaterials(elementPath, materialNames);
- } else if (d_ptr->m_commandQueue) {
- // We need to copy the list as queue takes ownership of it
- QStringList *theMaterialNames = new QStringList(materialNames);
- d_ptr->m_commandQueue->queueCommand(elementPath, CommandType_DeleteMaterials,
- theMaterialNames);
- }
-}
-
-/**
- Creates a mesh specified by given geometry. The given meshName can be used as sourcepath
- property value for model elements created with future createElement calls.
-*/
-void Q3DSPresentation::createMesh(const QString &meshName, const Q3DSGeometry &geometry)
-{
- QHash<QString, const Q3DSGeometry *> meshData;
- meshData.insert(meshName, &geometry);
- createMeshes(meshData);
-}
-
-// The ownership of supplied geometries stays with the caller
-void Q3DSPresentation::createMeshes(const QHash<QString, const Q3DSGeometry *> &meshData)
-{
- // We can't refer to API class Q3DSGeometry on the runtime side, so let's grab the meshdata
- // from Q3DSGeometryPrivate that is in runtime approved format and pass that on instead
- auto theMeshData = new QHash<QString, Q3DSViewer::MeshData>;
- QHashIterator<QString, const Q3DSGeometry *> it(meshData);
- while (it.hasNext()) {
- it.next();
- theMeshData->insert(it.key(), it.value()->d_ptr->meshData());
- }
-
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->createMeshes(*theMeshData);
- delete theMeshData;
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(CommandType_CreateMeshes, theMeshData);
- }
-}
-
-void Q3DSPresentation::deleteMesh(const QString &meshName)
-{
- QStringList meshNames;
- meshNames << meshName;
- deleteMeshes(meshNames);
-}
-
-void Q3DSPresentation::deleteMeshes(const QStringList &meshNames)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->deleteMeshes(meshNames);
- } else if (d_ptr->m_commandQueue) {
- // We need to copy the list as queue takes ownership of it
- QStringList *theMeshNames = new QStringList(meshNames);
- d_ptr->m_commandQueue->queueCommand(CommandType_DeleteMeshes, theMeshNames);
- }
-}
-
-void Q3DSPresentation::mousePressEvent(QMouseEvent *e)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->HandleMousePress(e->x(), e->y(), e->button(), true);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_MousePress,
- e->x(), e->y(), int(e->button()));
- }
-}
-
-/*!
- * \internal
- */
-void Q3DSPresentation::mouseReleaseEvent(QMouseEvent *e)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->HandleMousePress(e->x(), e->y(), e->button(), false);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_MouseRelease,
- e->x(), e->y(), int(e->button()));
- }
-}
-
-/*!
- * \internal
- */
-void Q3DSPresentation::mouseMoveEvent(QMouseEvent *e)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->HandleMouseMove(e->x(), e->y(), true);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_MouseMove,
- e->x(), e->y());
- }
-}
-
-/*!
- * \internal
- */
-void Q3DSPresentation::wheelEvent(QWheelEvent *e)
-{
- QPoint pixelData = e->pixelDelta();
- int numSteps = 0;
- if (pixelData.isNull()) {
- if (e->orientation() == Qt::Vertical)
- numSteps = e->angleDelta().y() / 8;
- else
- numSteps = e->angleDelta().x() / 8;
- } else {
- // trackpad, pixel = one step in scroll wheel.
- if (e->orientation() == Qt::Vertical)
- numSteps = pixelData.y();
- else
- numSteps = pixelData.x();
- }
- if (numSteps != 0) {
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->HandleMouseWheel(e->x(), e->y(),
- e->orientation() == Qt::Vertical ? 0 : 1,
- numSteps);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_MouseWheel,
- e->x(), e->y(),
- int(e->orientation() == Qt::Vertical), numSteps);
- }
- }
-}
-
-/*!
- * \internal
- */
-void Q3DSPresentation::keyPressEvent(QKeyEvent *e)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->HandleKeyInput(d_ptr->getScanCode(e), true);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_KeyPress,
- d_ptr->getScanCode(e));
- }
-}
-
-/*!
- * \internal
- */
-void Q3DSPresentation::keyReleaseEvent(QKeyEvent *e)
-{
- if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->HandleKeyInput(d_ptr->getScanCode(e), false);
- } else if (d_ptr->m_commandQueue) {
- d_ptr->m_commandQueue->queueCommand(QString(), CommandType_KeyRelease,
- d_ptr->getScanCode(e));
- }
-}
-
-// #TODO: QT3DS-3562 Most Presentation signals missing documentation
-/*!
- * \qmlsignal Presentation::slideEntered
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
- */
-
-/*!
- * \fn Q3DSPresentation::slideEntered
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
- */
-
-/*!
- * \qmlsignal Presentation::slideExited
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
- */
-
-/*!
- * \fn Q3DSPresentation::slideExited
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
- */
-
-/*!
- * \fn Q3DSPresentation::dataInputsReady
- * Emitted when \l{DataInput}s in the Studio project have been parsed and data inputs are available
- * through dataInputs() and getDataInputs() methods.
- */
-
-/*!
- * \fn Q3DSPresentation::dataOutputsReady
- * Emitted when \l{DataOutput}s in the Studio project have been parsed and data outputs are available
- * through dataOutputs() and getDataOutputs() methods.
- */
-
-/*!
- * \qmlsignal Presentation::customSignalEmitted
- * Emitted when
- * \param elementPath
- * \param name
- */
-
-/*!
- * \fn Q3DSPresentation::customSignalEmitted
- * Emitted when
- * \param elementPath
- * \param name
- */
-
-/*!
- * \qmlsignal Presentation::elementsCreated
- * Emitted when
- * \param elementPaths
- * \param error
- */
-
-/*!
- * \fn Q3DSPresentation::elementsCreated
- * Emitted when
- * \param elementPaths
- * \param error
- */
-
-/*!
- * \qmlsignal Presentation::materialsCreated
- * Emitted when
- * \param materialNames
- * \param error
- */
-
-/*!
- * \fn Q3DSPresentation::materialsCreated
- * Emitted when
- * \param materialNames
- * \param error
- */
-
-
-/*!
- * \internal
- */
-Q3DSPresentationPrivate::Q3DSPresentationPrivate(Q3DSPresentation *q)
- : QObject(q)
- , q_ptr(q)
- , m_viewerApp(nullptr)
- , m_commandQueue(nullptr)
- , m_streamProxy(nullptr)
- , m_delayedLoading(false)
-{
-}
-
-Q3DSPresentationPrivate::~Q3DSPresentationPrivate()
-{
- unregisterAllElements();
- unregisterAllDataInputs();
- unregisterAllDataOutputs();
- delete m_streamProxy;
-}
-
-void Q3DSPresentationPrivate::setSource(const QUrl &source)
-{
- m_source = source;
- if (m_commandQueue) {
- m_commandQueue->m_sourceChanged = true;
- m_commandQueue->m_source = source;
- }
-}
-
-void Q3DSPresentationPrivate::setVariantList(const QStringList &variantList)
-{
- m_variantList = variantList;
- if (m_commandQueue) {
- m_commandQueue->m_variantListChanged = true;
- m_commandQueue->m_variantList = variantList;
- }
-}
-
-void Q3DSPresentationPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app, bool connectApp)
-{
- Q3DSViewer::Q3DSViewerApp *oldApp = m_viewerApp;
- m_viewerApp = app;
-
- const auto elements = m_elements.values();
- for (Q3DSElement *element : elements)
- element->d_ptr->setViewerApp(app);
-
- if (m_viewerApp) {
- const auto dataInputs = m_viewerApp->dataInputs();
- for (const auto &name : dataInputs) {
- if (!m_dataInputs.contains(name)) {
- // Name is sufficient for C++ side APIs, as other parameters
- // (max/min) are queried synchronously.
- auto *di = new Q3DSDataInput(name, nullptr);
- registerDataInput(di);
- }
- }
- Q_EMIT q_ptr->dataInputsReady();
- }
-
- if (connectApp) {
- if (app) {
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigSlideEntered,
- this, &Q3DSPresentationPrivate::handleSlideEntered);
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigSlideExited,
- q_ptr, &Q3DSPresentation::slideExited);
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigCustomSignal,
- q_ptr, &Q3DSPresentation::customSignalEmitted);
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigDataOutputValueUpdated,
- this, &Q3DSPresentationPrivate::handleDataOutputValueUpdate);
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigElementsCreated,
- q_ptr, &Q3DSPresentation::elementsCreated);
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigMaterialsCreated,
- q_ptr, &Q3DSPresentation::materialsCreated);
- connect(app, &Q3DSViewer::Q3DSViewerApp::SigMeshesCreated,
- q_ptr, &Q3DSPresentation::meshesCreated);
- }
- if (oldApp) {
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigSlideEntered,
- this, &Q3DSPresentationPrivate::handleSlideEntered);
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigSlideExited,
- q_ptr, &Q3DSPresentation::slideExited);
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigCustomSignal,
- q_ptr, &Q3DSPresentation::customSignalEmitted);
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigDataOutputValueUpdated,
- this, &Q3DSPresentationPrivate::handleDataOutputValueUpdate);
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigElementsCreated,
- q_ptr, &Q3DSPresentation::elementsCreated);
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigMaterialsCreated,
- q_ptr, &Q3DSPresentation::materialsCreated);
- disconnect(oldApp, &Q3DSViewer::Q3DSViewerApp::SigMeshesCreated,
- q_ptr, &Q3DSPresentation::meshesCreated);
- }
- }
-}
-
-void Q3DSPresentationPrivate::setCommandQueue(CommandQueue *queue)
-{
- m_commandQueue = queue;
-
- const auto elements = m_elements.values();
- const auto dataInputs = m_dataInputs.values();
- for (Q3DSElement *element : elements)
- element->d_ptr->setCommandQueue(queue);
- for (Q3DSDataInput *di : dataInputs)
- di->d_ptr->setCommandQueue(queue);
-
- if (m_commandQueue) {
- setDelayedLoading(m_delayedLoading);
- setVariantList(m_variantList);
- // Queue a request ASAP for datainputs and outputs defined in UIA file so that
- // getDataInputs has up-to-date info at the earliest and that data outputs
- // connect from source to destination
- m_commandQueue->queueCommand({}, CommandType_RequestDataInputs);
- m_commandQueue->queueCommand({}, CommandType_RequestDataOutputs);
- setSource(m_source);
- }
-}
-
-void Q3DSPresentationPrivate::setDelayedLoading(bool enable)
-{
- m_delayedLoading = enable;
- if (m_commandQueue) {
- m_commandQueue->m_delayedLoading = enable;
- m_commandQueue->m_delayedLoadingChanged = true;
- }
-}
-
-void Q3DSPresentationPrivate::requestResponseHandler(CommandType commandType, void *requestData)
-{
- switch (commandType) {
- case CommandType_RequestDataInputs: {
- QVariantList *response = reinterpret_cast<QVariantList *>(requestData);
-
- for (int i = 0; i < response->size(); ++i) {
- // Check and append to QML-side list if the (UIA) presentation has additional datainputs
- // that are not explicitly defined in QML code.
- auto receivedDI = response->at(i).value<Q3DSDataInput *>();
- // For QML behind async command queue, we cache min/max values in addition
- // to name, in order to be able to return values initially set in UIA file (in QML
- // getters).
- if (!m_dataInputs.contains(receivedDI->name())) {
- auto newDI = new Q3DSDataInput(receivedDI->name(), nullptr);
- newDI->d_ptr->m_min = receivedDI->d_ptr->m_min;
- newDI->d_ptr->m_max = receivedDI->d_ptr->m_max;
- registerDataInput(newDI);
- } else {
- m_dataInputs[receivedDI->name()]->d_ptr->m_min = receivedDI->d_ptr->m_min;
- m_dataInputs[receivedDI->name()]->d_ptr->m_max = receivedDI->d_ptr->m_max;
- }
- }
- delete response;
- Q_EMIT q_ptr->dataInputsReady();
- break;
- }
- case CommandType_RequestDataOutputs: {
- QVariantList *response = reinterpret_cast<QVariantList *>(requestData);
-
- for (int i = 0; i < response->size(); ++i) {
- // Check and append to QML-side list if the (UIA) presentation has additional
- // dataoutputs that are not explicitly defined in QML code.
- if (!m_dataOutputs.contains(response->at(i).value<QString>()))
- registerDataOutput(new Q3DSDataOutput(response->at(i).value<QString>(), nullptr));
- }
- delete response;
- Q_EMIT q_ptr->dataOutputsReady();
- break;
- }
- default:
- Q_ASSERT(false);
- break;
- }
-}
-
-// Doc note: The ownership of the registered scenes remains with the caller, who needs to
-// ensure that registered scenes are alive as long as the presentation is alive.
-void Q3DSPresentationPrivate::registerElement(Q3DSElement *element)
-{
- Q_ASSERT(!element->elementPath().isEmpty());
-
- // Allow only single registration for each element path and scene object
- QMutableHashIterator<QString, Q3DSElement *> i(m_elements);
- while (i.hasNext()) {
- i.next();
- if (i.value() == element) {
- // If the same scene object is already registered with different path,
- // remove it from the map to avoid duplication.
- if (i.key() != element->elementPath())
- i.remove();
- } else if (i.key() == element->elementPath()) {
- // If the same element path is registered by another scene object, the old
- // scene object is unregistered.
- i.value()->d_ptr->setViewerApp(nullptr);
- i.value()->d_ptr->setPresentation(nullptr);
- i.remove();
- }
- }
-
- element->d_ptr->setViewerApp(m_viewerApp);
- element->d_ptr->setCommandQueue(m_commandQueue);
- element->d_ptr->setPresentation(this);
-
- m_elements.insert(element->elementPath(), element);
-}
-
-void Q3DSPresentationPrivate::unregisterElement(Q3DSElement *element)
-{
- Q3DSElement *oldScene = m_elements.value(element->elementPath());
- if (oldScene == element) {
- element->d_ptr->setViewerApp(nullptr);
- element->d_ptr->setCommandQueue(nullptr);
- element->d_ptr->setPresentation(nullptr);
- m_elements.remove(element->elementPath());
- }
-}
-
-void Q3DSPresentationPrivate::unregisterAllElements()
-{
- for (Q3DSElement *element : m_elements.values()) {
- element->d_ptr->setViewerApp(nullptr);
- element->d_ptr->setCommandQueue(nullptr);
- element->d_ptr->setPresentation(nullptr);
- }
- m_elements.clear();
-}
-
-void Q3DSPresentationPrivate::registerDataInput(Q3DSDataInput *dataInput)
-{
- Q_ASSERT(!dataInput->name().isEmpty());
-
- // Allow only single registration for each DataInput
- QMutableHashIterator<QString, Q3DSDataInput *> i(m_dataInputs);
- while (i.hasNext()) {
- i.next();
- if (i.value() == dataInput) {
- // If the same DataInput object is already registered with different name,
- // remove it from the map to avoid duplication.
- if (i.key() != dataInput->name())
- i.remove();
- } else if (i.key() == dataInput->name()) {
- // If the same name is registered by another DataInput object, the old
- // DataInput object is unregistered.
- i.value()->d_ptr->setViewerApp(nullptr);
- i.value()->d_ptr->setPresentation(nullptr);
- i.remove();
- }
- }
-
- dataInput->d_ptr->setPresentation(q_ptr);
- dataInput->d_ptr->setViewerApp(m_viewerApp);
- dataInput->d_ptr->setCommandQueue(m_commandQueue);
-
- m_dataInputs.insert(dataInput->name(), dataInput);
-}
-
-void Q3DSPresentationPrivate::unregisterDataInput(Q3DSDataInput *dataInput)
-{
- Q3DSDataInput *oldDi = m_dataInputs.value(dataInput->name());
- if (oldDi == dataInput) {
- dataInput->d_ptr->setCommandQueue(nullptr);
- dataInput->d_ptr->setViewerApp(nullptr);
- dataInput->d_ptr->setPresentation(nullptr);
- m_dataInputs.remove(dataInput->name());
- }
-}
-
-void Q3DSPresentationPrivate::unregisterAllDataInputs()
-{
- for (Q3DSDataInput *di : m_dataInputs.values()) {
- di->d_ptr->setViewerApp(nullptr);
- di->d_ptr->setCommandQueue(nullptr);
- di->d_ptr->setPresentation(nullptr);
- }
- m_dataInputs.clear();
-}
-bool Q3DSPresentationPrivate::isValidDataInput(const Q3DSDataInput *dataInput) const
-{
- // For QML instance separated from runtime engine by command queue,
- // check locally cached list for this datainput (initialised at presentation load).
- if (!m_viewerApp) {
- if (m_dataInputs.contains(dataInput->name()))
- return true;
- else
- return false;
- }
-
- return m_viewerApp->dataInputs().contains(dataInput->name());
-}
-
-float Q3DSPresentationPrivate::dataInputMin(const QString &name) const
-{
- // For QML instance separated from runtime engine by command queue,
- // return locally cached value (initialised at presentation load).
- if (!m_viewerApp) {
- if (m_dataInputs.contains(name))
- return m_dataInputs[name]->d_ptr->m_min;
- else
- return 0.0f;
- }
- return m_viewerApp->dataInputMin(name);
-}
-
-float Q3DSPresentationPrivate::dataInputMax(const QString &name) const
-{
- // For QML instance separated from runtime engine by command queue,
- // return locally cached value (initialised at presentation load).
- if (!m_viewerApp) {
- if (m_dataInputs.contains(name))
- return m_dataInputs[name]->d_ptr->m_max;
- else
- return 0.0f;
- }
- return m_viewerApp->dataInputMax(name);
-}
-
-void Q3DSPresentationPrivate::registerDataOutput(Q3DSDataOutput *dataOutput)
-{
- Q_ASSERT(!dataOutput->name().isEmpty());
-
- // Allow only single registration for each DataOutput
- QMutableHashIterator<QString, Q3DSDataOutput *> i(m_dataOutputs);
- while (i.hasNext()) {
- i.next();
- if (i.value() == dataOutput) {
- // If the same DataOutput object is already registered with different name,
- // remove it from the map to avoid duplication.
- if (i.key() != dataOutput->name())
- i.remove();
- } else if (i.key() == dataOutput->name()) {
- // If the same name is registered by another DataOutput object, the old
- // DataOutput object is unregistered.
- i.value()->d_ptr->setViewerApp(nullptr);
- i.value()->d_ptr->setPresentation(nullptr);
- i.value()->d_ptr->setCommandQueue(nullptr);
- i.remove();
- }
- }
-
- dataOutput->d_ptr->setPresentation(q_ptr);
- dataOutput->d_ptr->setViewerApp(m_viewerApp);
- dataOutput->d_ptr->setCommandQueue(m_commandQueue);
-
- m_dataOutputs.insert(dataOutput->name(), dataOutput);
-}
-
-void Q3DSPresentationPrivate::unregisterDataOutput(Q3DSDataOutput *dataOutput)
-{
- Q3DSDataOutput *oldDout = m_dataOutputs.value(dataOutput->name());
- if (oldDout == dataOutput) {
- dataOutput->d_ptr->setCommandQueue(nullptr);
- dataOutput->d_ptr->setViewerApp(nullptr);
- dataOutput->d_ptr->setPresentation(nullptr);
- m_dataOutputs.remove(dataOutput->name());
- }
-}
-
-void Q3DSPresentationPrivate::unregisterAllDataOutputs()
-{
- const auto values = m_dataOutputs.values();
- for (Q3DSDataOutput *dout : values) {
- dout->d_ptr->setViewerApp(nullptr);
- dout->d_ptr->setCommandQueue(nullptr);
- dout->d_ptr->setPresentation(nullptr);
- }
- m_dataOutputs.clear();
-}
-
-bool Q3DSPresentationPrivate::isValidDataOutput(const Q3DSDataOutput *dataOutput) const
-{
- if (!m_viewerApp)
- return false;
-
- return m_viewerApp->dataOutputs().contains(dataOutput->name());
-}
-
-Q3DStudio::EKeyCode Q3DSPresentationPrivate::getScanCode(QKeyEvent *e)
-{
- enum {
- RIGHT_SHIFT = 0x036,
- RIGHT_CTRL = 0x11d,
- RIGHT_ALT = 0x138,
- };
-
- Qt::Key keyScanCode = static_cast<Qt::Key>(e->key());
-
- Q3DStudio::EKeyCode newScanCode = Q3DStudio::KEY_NOKEY;
- switch (keyScanCode) {
- case Qt::Key_Down:
- newScanCode = Q3DStudio::KEY_DOWN;
- break;
- case Qt::Key_Up:
- newScanCode = Q3DStudio::KEY_UP;
- break;
- case Qt::Key_Left:
- newScanCode = Q3DStudio::KEY_LEFT;
- break;
- case Qt::Key_Right:
- newScanCode = Q3DStudio::KEY_RIGHT;
- break;
- case Qt::Key_Return:
- case Qt::Key_Enter:
- newScanCode = e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPADENTER
- : Q3DStudio::KEY_RETURN;
- break;
- case Qt::Key_Backspace:
- newScanCode = Q3DStudio::KEY_BACK;
- break;
- case Qt::Key_Tab:
- newScanCode = Q3DStudio::KEY_TAB;
- break;
- case Qt::Key_Escape:
- newScanCode = Q3DStudio::KEY_ESCAPE;
- break;
- case Qt::Key_A:
- newScanCode = Q3DStudio::KEY_A;
- break;
- case Qt::Key_B:
- newScanCode = Q3DStudio::KEY_B;
- break;
- case Qt::Key_C:
- newScanCode = Q3DStudio::KEY_C;
- break;
- case Qt::Key_D:
- newScanCode = Q3DStudio::KEY_D;
- break;
- case Qt::Key_E:
- newScanCode = Q3DStudio::KEY_E;
- break;
- case Qt::Key_F:
- newScanCode = Q3DStudio::KEY_F;
- break;
- case Qt::Key_G:
- newScanCode = Q3DStudio::KEY_G;
- break;
- case Qt::Key_H:
- newScanCode = Q3DStudio::KEY_H;
- break;
- case Qt::Key_I:
- newScanCode = Q3DStudio::KEY_I;
- break;
- case Qt::Key_J:
- newScanCode = Q3DStudio::KEY_J;
- break;
- case Qt::Key_K:
- newScanCode = Q3DStudio::KEY_K;
- break;
- case Qt::Key_L:
- newScanCode = Q3DStudio::KEY_L;
- break;
- case Qt::Key_M:
- newScanCode = Q3DStudio::KEY_M;
- break;
- case Qt::Key_N:
- newScanCode = Q3DStudio::KEY_N;
- break;
- case Qt::Key_O:
- newScanCode = Q3DStudio::KEY_O;
- break;
- case Qt::Key_P:
- newScanCode = Q3DStudio::KEY_P;
- break;
- case Qt::Key_Q:
- newScanCode = Q3DStudio::KEY_Q;
- break;
- case Qt::Key_R:
- newScanCode = Q3DStudio::KEY_R;
- break;
- case Qt::Key_S:
- newScanCode = Q3DStudio::KEY_S;
- break;
- case Qt::Key_T:
- newScanCode = Q3DStudio::KEY_T;
- break;
- case Qt::Key_U:
- newScanCode = Q3DStudio::KEY_U;
- break;
- case Qt::Key_V:
- newScanCode = Q3DStudio::KEY_V;
- break;
- case Qt::Key_W:
- newScanCode = Q3DStudio::KEY_W;
- break;
- case Qt::Key_X:
- newScanCode = Q3DStudio::KEY_X;
- break;
- case Qt::Key_Y:
- newScanCode = Q3DStudio::KEY_Y;
- break;
- case Qt::Key_Z:
- newScanCode = Q3DStudio::KEY_Z;
- break;
- case Qt::Key_0:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD0 : Q3DStudio::KEY_0;
- break;
- case Qt::Key_1:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD1 : Q3DStudio::KEY_1;
- break;
- case Qt::Key_2:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD2 : Q3DStudio::KEY_2;
- break;
- case Qt::Key_3:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD3 : Q3DStudio::KEY_3;
- break;
- case Qt::Key_4:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD4 : Q3DStudio::KEY_4;
- break;
- case Qt::Key_5:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD5 : Q3DStudio::KEY_5;
- break;
- case Qt::Key_6:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD6 : Q3DStudio::KEY_6;
- break;
- case Qt::Key_7:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD7 : Q3DStudio::KEY_7;
- break;
- case Qt::Key_8:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD8 : Q3DStudio::KEY_8;
- break;
- case Qt::Key_9:
- newScanCode =
- e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPAD9 : Q3DStudio::KEY_9;
- break;
- case Qt::Key_Minus:
- newScanCode = e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPADSUBTRACT
- : Q3DStudio::KEY_SUBTRACT;
- break;
- case Qt::Key_Plus:
- newScanCode = e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPADADD
- : Q3DStudio::KEY_EQUALS;
- break;
- case Qt::Key_NumLock:
- newScanCode = Q3DStudio::KEY_NUMLOCK;
- break;
- case Qt::Key_ScrollLock:
- newScanCode = Q3DStudio::KEY_SCROLL;
- break;
- case Qt::Key_CapsLock:
- newScanCode = Q3DStudio::KEY_CAPITAL;
- break;
- case Qt::Key_Pause:
- newScanCode = Q3DStudio::KEY_PAUSE;
- break;
- case Qt::Key_Print:
- newScanCode = Q3DStudio::KEY_PRINTSCREEN;
- break;
- case Qt::Key_Insert:
- newScanCode = Q3DStudio::KEY_INSERT;
- break;
- case Qt::Key_Delete:
- newScanCode = Q3DStudio::KEY_DELETE;
- break;
- case Qt::Key_Home:
- newScanCode = Q3DStudio::KEY_HOME;
- break;
- case Qt::Key_End:
- newScanCode = Q3DStudio::KEY_END;
- break;
- case Qt::Key_PageUp:
- newScanCode = Q3DStudio::KEY_PGUP;
- break;
- case Qt::Key_PageDown:
- newScanCode = Q3DStudio::KEY_PGDN;
- break;
- case Qt::Key_F1:
- newScanCode = Q3DStudio::KEY_F1;
- break;
- case Qt::Key_F2:
- newScanCode = Q3DStudio::KEY_F2;
- break;
- case Qt::Key_F3:
- newScanCode = Q3DStudio::KEY_F3;
- break;
- case Qt::Key_F4:
- newScanCode = Q3DStudio::KEY_F4;
- break;
- case Qt::Key_F5:
- newScanCode = Q3DStudio::KEY_F5;
- break;
- case Qt::Key_F6:
- newScanCode = Q3DStudio::KEY_F6;
- break;
- case Qt::Key_F7:
- newScanCode = Q3DStudio::KEY_F7;
- break;
- case Qt::Key_F8:
- newScanCode = Q3DStudio::KEY_F8;
- break;
- case Qt::Key_F9:
- newScanCode = Q3DStudio::KEY_F9;
- break;
- case Qt::Key_F10:
- newScanCode = Q3DStudio::KEY_F10;
- break;
- case Qt::Key_F11:
- newScanCode = Q3DStudio::KEY_F11;
- break;
- case Qt::Key_F12:
- newScanCode = Q3DStudio::KEY_F12;
- break;
- case Qt::Key_F13:
- newScanCode = Q3DStudio::KEY_F13;
- break;
- case Qt::Key_F14:
- newScanCode = Q3DStudio::KEY_F14;
- break;
- case Qt::Key_QuoteLeft:
- newScanCode = Q3DStudio::KEY_GRAVE;
- break;
- case Qt::Key_Asterisk:
- newScanCode = Q3DStudio::KEY_MULTIPLY;
- break;
- case Qt::Key_BracketRight:
- newScanCode = Q3DStudio::KEY_RBRACKET;
- break;
- case Qt::Key_BracketLeft:
- newScanCode = Q3DStudio::KEY_LBRACKET;
- break;
- case Qt::Key_Semicolon:
- newScanCode = Q3DStudio::KEY_SEMICOLON;
- break;
- case Qt::Key_Comma:
- newScanCode = Q3DStudio::KEY_COMMA;
- break;
- case Qt::Key_Period:
- newScanCode = e->modifiers() == Qt::KeypadModifier ? Q3DStudio::KEY_NUMPADDECIMAL
- : Q3DStudio::KEY_PERIOD;
- break;
- case Qt::Key_Apostrophe:
- newScanCode = Q3DStudio::KEY_APOSTROPHE;
- break;
- case Qt::Key_Slash:
- newScanCode = Q3DStudio::KEY_SLASH;
- break;
- case Qt::Key_Backslash:
- newScanCode = Q3DStudio::KEY_BACKSLASH;
- break;
- case Qt::Key_Equal:
- newScanCode = Q3DStudio::KEY_EQUALS;
- break;
- case Qt::Key_Space:
- newScanCode = Q3DStudio::KEY_SPACE;
- break;
- case Qt::Key_Shift:
- newScanCode =
- e->nativeScanCode() == RIGHT_SHIFT ? Q3DStudio::KEY_RSHIFT : Q3DStudio::KEY_LSHIFT;
- break;
- case Qt::Key_Control:
- newScanCode = e->nativeScanCode() == RIGHT_CTRL ? Q3DStudio::KEY_RCONTROL
- : Q3DStudio::KEY_LCONTROL;
- break;
- case Qt::Key_Alt:
- newScanCode =
- e->nativeScanCode() == RIGHT_ALT ? Q3DStudio::KEY_RALT : Q3DStudio::KEY_LALT;
- break;
- default:
- break;
- }
-
- return newScanCode;
-}
-
-ViewerQmlStreamProxy *Q3DSPresentationPrivate::streamProxy()
-{
- if (!m_streamProxy)
- m_streamProxy = new ViewerQmlStreamProxy();
- return m_streamProxy;
-}
-
-void Q3DSPresentationPrivate::handleSlideEntered(const QString &elementPath, unsigned int index,
- const QString &name)
-{
- Q3DSSceneElement *scene = qobject_cast<Q3DSSceneElement *>(m_elements.value(elementPath));
- if (scene)
- scene->d_func()->handleSlideEntered(index, name);
- Q_EMIT q_ptr->slideEntered(elementPath, index, name);
-}
-
-void Q3DSPresentationPrivate::handleDataOutputValueUpdate(const QString &name,
- const QVariant &newValue)
-{
- if (!m_dataOutputs.contains(name))
- return;
-
- Q3DSDataOutput *node = m_dataOutputs[name];
- node->setValue(newValue);
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.h
deleted file mode 100644
index 436e6844..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSPRESENTATION_H
-#define Q3DSPRESENTATION_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtStudio3D/q3dsdatainput.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qstringlist.h>
-#include <QtStudio3D/q3dsdatainput.h>
-#include <QtStudio3D/q3dsdataoutput.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPresentationPrivate;
-class Q3DSElement;
-class Q3DSGeometry;
-class QMouseEvent;
-class QWheelEvent;
-class QKeyEvent;
-
-class Q_STUDIO3D_EXPORT Q3DSPresentation : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSPresentation)
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(QStringList variantList READ variantList WRITE setVariantList NOTIFY variantListChanged)
- Q_PROPERTY(bool delayedLoading READ delayedLoading WRITE setDelayedLoading NOTIFY delayedLoadingChanged)
-
-public:
- explicit Q3DSPresentation(QObject *parent = nullptr);
- ~Q3DSPresentation();
-
- QUrl source() const;
- QStringList variantList() const;
-
- void registerElement(Q3DSElement *scene);
- void unregisterElement(Q3DSElement *scene);
- Q3DSElement *registeredElement(const QString &elementPath) const;
-
- void registerDataInput(Q3DSDataInput *dataInput);
- void unregisterDataInput(Q3DSDataInput *dataInput);
- Q3DSDataInput *registeredDataInput(const QString &name) const;
- void registerDataOutput(Q3DSDataOutput *dataOutput);
- void unregisterDataOutput(Q3DSDataOutput *dataOutput);
- Q3DSDataOutput *registeredDataOutput(const QString &name) const;
-
- Q_INVOKABLE QVariantList getDataInputs() const;
- QVector<Q3DSDataInput *> dataInputs() const;
- Q_INVOKABLE QVariantList getDataOutputs() const;
- QVector<Q3DSDataOutput *> dataOutputs() const;
-
- bool delayedLoading() const;
- void setDelayedLoading(bool enable);
-
- Q_INVOKABLE void preloadSlide(const QString &elementPath);
- Q_INVOKABLE void unloadSlide(const QString &elementPath);
-
- // Input event handlers
- void mousePressEvent(QMouseEvent *e);
- void mouseReleaseEvent(QMouseEvent *e);
- void mouseMoveEvent(QMouseEvent *e);
- void wheelEvent(QWheelEvent *e);
- void keyPressEvent(QKeyEvent *e);
- void keyReleaseEvent(QKeyEvent *e);
-
- void createElement(const QString &parentElementPath, const QString &slideName,
- const QHash<QString, QVariant> &properties);
- void createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties);
- void deleteElement(const QString &elementPath);
- void deleteElements(const QStringList &elementPaths);
- void createMaterial(const QString &elementPath, const QString &materialDefinition);
- void createMaterials(const QString &elementPath, const QStringList &materialDefinitions);
- void deleteMaterial(const QString &elementPath, const QString &materialName);
- void deleteMaterials(const QString &elementPath, const QStringList &materialNames);
- void createMesh(const QString &meshName, const Q3DSGeometry &geometry);
- void createMeshes(const QHash<QString, const Q3DSGeometry *> &meshData);
- void deleteMesh(const QString &meshName);
- void deleteMeshes(const QStringList &meshNames);
-
-public Q_SLOTS:
- void setSource(const QUrl &source);
- void setVariantList(const QStringList &variantList);
- void goToSlide(const QString &elementPath, unsigned int index);
- void goToSlide(const QString &elementPath, const QString &name);
- void goToSlide(const QString &elementPath, bool next, bool wrap);
- void goToTime(const QString &elementPath, float time);
- void setAttribute(const QString &elementPath, const QString &attributeName,
- const QVariant &value);
- void setPresentationActive(const QString &id, bool active);
- void fireEvent(const QString &elementPath, const QString &eventName);
- void setGlobalAnimationTime(qint64 milliseconds);
- void setDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole = Q3DSDataInput::ValueRole::Value);
-
-Q_SIGNALS:
- void variantListChanged(const QStringList &variantList);
- void sourceChanged(const QUrl &source);
- void slideEntered(const QString &elementPath, unsigned int index, const QString &name);
- void slideExited(const QString &elementPath, unsigned int index, const QString &name);
- void dataInputsReady();
- void dataOutputsReady();
- void customSignalEmitted(const QString &elementPath, const QString &name);
- void delayedLoadingChanged(bool enable);
- void elementsCreated(const QStringList &elementPaths, const QString &error);
- void materialsCreated(const QStringList &materialNames, const QString &error);
- void meshesCreated(const QStringList &meshNames, const QString &error);
-
-private:
- Q_DISABLE_COPY(Q3DSPresentation)
- Q3DSPresentationPrivate *d_ptr;
-
- friend class Q3DSPresentationItem;
- friend class Q3DSSurfaceViewerPrivate;
- friend class Q3DSRenderer;
- friend class Q3DSStudio3D;
- friend class Q3DSDataInput;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSPRESENTATION_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation_p.h
deleted file mode 100644
index 7b4877d9..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dspresentation_p.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSPRESENTATION_P_H
-#define Q3DSPRESENTATION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dspresentation.h"
-#include "q3dscommandqueue_p.h"
-#include "Qt3DSViewerApp.h"
-#include <QtCore/QHash>
-#include <QtCore/QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class CommandQueue;
-class ViewerQmlStreamProxy;
-class QKeyEvent;
-
-class Q_STUDIO3D_EXPORT Q3DSPresentationPrivate : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PUBLIC(Q3DSPresentation)
-
-public:
- typedef QHash<QString, Q3DSElement *> ElementMap;
- typedef QHash<QString, Q3DSDataInput *> DataInputMap;
- typedef QHash<QString, Q3DSDataOutput *> DataOutputMap;
-
- explicit Q3DSPresentationPrivate(Q3DSPresentation *parent);
- ~Q3DSPresentationPrivate();
-
- void setSource(const QUrl &source);
- void setVariantList(const QStringList &variantList);
- void setViewerApp(Q3DSViewer::Q3DSViewerApp *app, bool connectApp = true);
- void setCommandQueue(CommandQueue *queue);
- void setDelayedLoading(bool enable);
-
- void registerElement(Q3DSElement *element);
- void unregisterElement(Q3DSElement *element);
- void unregisterAllElements();
-
- void registerDataInput(Q3DSDataInput *dataInput);
- void unregisterDataInput(Q3DSDataInput *dataInput);
- void unregisterAllDataInputs();
- void registerDataOutput(Q3DSDataOutput *dataOutput);
- void unregisterDataOutput(Q3DSDataOutput *dataOutput);
- void unregisterAllDataOutputs();
-
- bool isValidDataInput(const Q3DSDataInput *dataInput) const;
- float dataInputMin(const QString &name) const;
- float dataInputMax(const QString &name) const;
- bool isValidDataOutput(const Q3DSDataOutput *dataOutput) const;
-
- ViewerQmlStreamProxy *streamProxy();
- Q3DStudio::EKeyCode getScanCode(QKeyEvent *e);
-
- void requestResponseHandler(CommandType commandType, void *requestData);
-
-public Q_SLOTS:
- void handleSlideEntered(const QString &elementPath, unsigned int index, const QString &name);
- void handleDataOutputValueUpdate(const QString &name, const QVariant &newValue);
-
-public:
- Q3DSPresentation *q_ptr;
-
-private:
- Q3DSViewer::Q3DSViewerApp *m_viewerApp; // Not owned
- CommandQueue *m_commandQueue; // Not owned
- ElementMap m_elements;
- DataInputMap m_dataInputs;
- DataOutputMap m_dataOutputs;
- QUrl m_source;
- QStringList m_variantList;
- ViewerQmlStreamProxy *m_streamProxy;
- bool m_delayedLoading;
-
- friend class Q3DSStudio3D;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSPRESENTATION_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.cpp
deleted file mode 100644
index 3f860d65..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dssceneelement_p.h"
-#include "q3dspresentation_p.h"
-#include "q3dscommandqueue_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qsettings.h>
-#include <QtCore/qcoreapplication.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype SceneElement
- \instantiates Q3DSSceneElement
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief Controls the special Scene or Component scene objects in a Qt 3D
- Studio presentation.
-
- This class is a convenience class for controlling the properties of Scene
- and Component objects in the scene. These are special since they have a
- time context, meaning they control a timeline and a set of associated
- slides.
-
- \sa Studio3D, Element, Presentation
-*/
-
-/*!
- \class Q3DSSceneElement
- \inherits Q3DSElement
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
-
- \brief Controls the special Scene or Component scene objects in a Qt 3D
- Studio presentation.
-
- This class is a convenience class for controlling the properties of Scene
- and Component objects in the scene. These are special since they have a
- time context, meaning they control a timline and a set of associated
- slides.
-
- \note The functionality of Q3DSSceneElement is equivalent to
- Q3DSPresentation::goToTime() and Q3DSPresentation::goToSlide().
-
- \sa Q3DSPresentation, Q3DSWidget, Q3DSSurfaceViewer, Q3DSElement
- */
-
-/*!
- \internal
- */
-Q3DSSceneElement::Q3DSSceneElement(QObject *parent)
- : Q3DSElement(new Q3DSSceneElementPrivate(this), nullptr, QString(), parent)
-{
-}
-
-/*!
- \internal
- */
-Q3DSSceneElement::Q3DSSceneElement(const QString &elementPath, QObject *parent)
- : Q3DSElement(new Q3DSSceneElementPrivate(this), nullptr, elementPath, parent)
-{
-}
-
-/*!
- Constructs a Q3DSSceneElement instance and associated it with the object
- specified by \a elementPath and the given \a presentation. An optional \a
- parent object can be specified.
- */
-Q3DSSceneElement::Q3DSSceneElement(Q3DSPresentation *presentation, const QString &elementPath,
- QObject *parent)
- : Q3DSElement(new Q3DSSceneElementPrivate(this), presentation, elementPath, parent)
-{
-
-}
-
-/*!
- Destructor.
- */
-Q3DSSceneElement::~Q3DSSceneElement()
-{
-}
-
-/*!
- \qmlproperty int SceneElement::currentSlideIndex
-
- Holds the index of the currently active slide of the tracked time context.
-
- \note If this property is set to something else than the default slide for
- the scene at the initial declaration of SceneElement, a changed signal for
- the default slide may still be emitted before the slide changes to the
- desired one. This happens in order to ensure we end up with the index of
- the slide that is actually shown even if the slide specified in the initial
- declaration is invalid.
-*/
-
-/*!
- \property Q3DSSceneElement::currentSlideIndex
-
- Holds the index of the currently active slide of the tracked time context.
-
- \note If this property is set to something else than the default slide for
- the scene at the initial declaration of SceneElement, a changed signal for
- the default slide may still be emitted before the slide changes to the
- desired one. This happens in order to ensure we end up with the index of
- the slide that is actually shown even if the slide specified in the initial
- declaration is invalid.
-*/
-int Q3DSSceneElement::currentSlideIndex() const
-{
- Q_D(const Q3DSSceneElement);
- return d->m_currentSlideIndex;
-}
-
-void Q3DSSceneElement::setCurrentSlideIndex(int currentSlideIndex)
-{
- Q_D(Q3DSSceneElement);
- if (d->m_viewerApp) {
- const QByteArray path(d->m_elementPath.toUtf8());
- d->m_viewerApp->GoToSlideByIndex(path, currentSlideIndex + 1);
- } else if (d->m_commandQueue) {
- d->m_commandQueue->queueCommand(d->m_elementPath, CommandType_GoToSlide,
- int(currentSlideIndex + 1));
- } else {
- // Store desired slide until we have either app or queue. Only name or index can be set.
- d->m_initialSlideIndex = currentSlideIndex + 1;
- d->m_initialSlideName.clear();
- }
-}
-
-/*!
- \property int SceneElement::previousSlideIndex
-
- Holds the index of the previously active slide of the tracked time context.
-
- Note: This property is read-only.
-*/
-/*!
- \property Q3DSSceneElement::previousSlideIndex
-
- Holds the index of the previously active slide of the tracked time context.
-
- This property is read-only.
-*/
-int Q3DSSceneElement::previousSlideIndex() const
-{
- Q_D(const Q3DSSceneElement);
- return d->m_previousSlideIndex;
-}
-
-/*!
- \qmlproperty string SceneElement::currentSlideName
-
- Holds the name of the currently active slide of the tracked time context.
-
- \note If this property is set to something else than the default slide for
- the scene at the initial declaration of SceneElement, a changed signal for
- the default slide may still be emitted before the slide changes to the
- desired one. This happens in order to ensure we end up with the index of
- the slide that is actually shown even if the slide specified in the initial
- declaration is invalid.
-*/
-
-/*!
- \property Q3DSSceneElement::currentSlideName
-
- Holds the name of the currently active slide of the tracked time context.
-
- \note If this property is set to something else than the default slide for
- the scene at the initial declaration of SceneElement, a changed signal for
- the default slide may still be emitted before the slide changes to the
- desired one. This happens in order to ensure we end up with the index of
- the slide that is actually shown even if the slide specified in the initial
- declaration is invalid.
-*/
-QString Q3DSSceneElement::currentSlideName() const
-{
- Q_D(const Q3DSSceneElement);
- return d->m_currentSlideName;
-}
-
-void Q3DSSceneElement::setCurrentSlideName(const QString &currentSlideName)
-{
- Q_D(Q3DSSceneElement);
- if (d->m_viewerApp) {
- const QByteArray path(d->m_elementPath.toUtf8());
- const QByteArray name(currentSlideName.toUtf8());
- d->m_viewerApp->GoToSlideByName(path, name);
- } else if (d->m_commandQueue) {
- d->m_commandQueue->queueCommand(d->m_elementPath, CommandType_GoToSlideByName,
- currentSlideName);
- } else {
- // Store desired slide until we have either app or queue. Only name or index can be set.
- d->m_initialSlideName = currentSlideName;
- d->m_initialSlideIndex = 0;
- }
-}
-
-/*!
- \qmlmproperty string SceneElement::previousSlideName
-
- Holds the name of the previously active slide of the tracked time context.
-
- Note: This property is read-only.
-*/
-/*!
- \property Q3DSSceneElement::previousSlideName
-
- Holds the name of the previously active slide of the tracked time context.
-
- This property is read-only.
-*/
-QString Q3DSSceneElement::previousSlideName() const
-{
- Q_D(const Q3DSSceneElement);
- return d->m_previousSlideName;
-}
-
-/*!
- Requests a time context (a Scene or a Component object) to change to the
- next or previous slide, depending on the value of \a next. If the context
- is already at the last or first slide, \a wrap defines if wrapping over to
- the first or last slide, respectively, occurs.
- */
-void Q3DSSceneElement::goToSlide(bool next, bool wrap)
-{
- Q_D(Q3DSSceneElement);
- d->goToSlide(next, wrap);
-}
-
-/*!
- Moves the timeline for a time context (a Scene or a Component element) to a
- specific position. The position is given in seconds in \a timeSeconds.
- */
-void Q3DSSceneElement::goToTime(float time)
-{
- Q_D(Q3DSSceneElement);
- d->goToTime(time);
-}
-
-
-/*!
- \internal
- */
-Q3DSSceneElementPrivate::Q3DSSceneElementPrivate(Q3DSSceneElement *parent)
- : Q3DSElementPrivate(parent)
- , m_currentSlideIndex(0)
- , m_previousSlideIndex(0)
- , m_initialSlideIndex(0)
- , m_slideInfoRequestPending(false)
-{
-}
-
-/*!
- \internal
- */
-Q3DSSceneElementPrivate::~Q3DSSceneElementPrivate()
-{
-}
-
-/*!
- \internal
- */
-void Q3DSSceneElementPrivate::handleSlideEntered(int index, const QString &name)
-{
- Q_Q(Q3DSSceneElement);
-
- // Initializing presentation will report slide entered for the scenes on the default slide
- // of the presentation even if user has specified different initial slides.
- // Since we don't have robust error reporting mechanism from the viewerapp,
- // we cannot simply ignore these initial enters, as there is no guarantee the slide
- // user wants even exists.
-
- // We ignore the slide exited signals and rely on stored previous slide data
- // to avoid excessive signaling on slide changes.
- bool notifyCurrent = m_currentSlideIndex != index;
- bool notifyPrevious = m_previousSlideIndex != m_currentSlideIndex;
-
- // Since child (i.e. component) slides always get enter event when parent slide is entered,
- // it is possible that current and previous slides are the same. This feels bit odd, but is
- // technically correct, as the last time we got enter, the same slide was made current.
- // It also matches the internal m_viewerApp logic for previous slides.
- m_previousSlideIndex = m_currentSlideIndex;
- m_previousSlideName = m_currentSlideName;
- m_currentSlideIndex = index;
- m_currentSlideName = name;
-
- if (notifyPrevious) {
- Q_EMIT q->previousSlideIndexChanged(m_previousSlideIndex);
- Q_EMIT q->previousSlideNameChanged(m_previousSlideName);
- }
-
- if (notifyCurrent) {
- Q_EMIT q->currentSlideIndexChanged(m_currentSlideIndex);
- Q_EMIT q->currentSlideNameChanged(m_currentSlideName);
- }
-}
-
-/*!
- \internal
- */
-void Q3DSSceneElementPrivate::goToSlide(bool next, bool wrap)
-{
- if (m_presentation)
- m_presentation->q_ptr->goToSlide(m_elementPath, next, wrap);
- else
- qWarning() << __FUNCTION__ << "Element is not registered to any presentation!";
-}
-
-/*!
- \internal
- */
-void Q3DSSceneElementPrivate::goToTime(float time)
-{
- if (m_presentation)
- m_presentation->q_ptr->goToTime(m_elementPath, time);
- else
- qWarning() << __FUNCTION__ << "Element is not registered to any presentation!";
-}
-
-/*!
- \internal
- */
-void Q3DSSceneElementPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app)
-{
- Q_Q(Q3DSSceneElement);
-
- if (app || m_viewerApp) {
- m_currentSlideIndex = 0;
- m_currentSlideName.clear();
- m_previousSlideIndex = 0;
- m_previousSlideName.clear();
- }
-
- Q3DSElementPrivate::setViewerApp(app);
-
- if (m_viewerApp) {
- const QByteArray path(m_elementPath.toUtf8());
- m_viewerApp->GetSlideInfo(path, m_currentSlideIndex, m_previousSlideIndex,
- m_currentSlideName, m_previousSlideName);
-
- // If user has set current slide before viewer app has been set for the first time,
- // we will switch to the desired slide after we initialize.
- if (m_initialSlideIndex != 0)
- q->setCurrentSlideIndex(m_initialSlideIndex - 1);
- else if (!m_initialSlideName.isEmpty())
- q->setCurrentSlideName(m_initialSlideName);
-
- m_initialSlideIndex = 0;
- m_initialSlideName.clear();
- }
-}
-
-/*!
- \internal
- */
-void Q3DSSceneElementPrivate::setCommandQueue(CommandQueue *queue)
-{
- Q_Q(Q3DSSceneElement);
-
- if (queue || m_commandQueue) {
- m_currentSlideIndex = 0;
- m_currentSlideName.clear();
- m_previousSlideIndex = 0;
- m_previousSlideName.clear();
- }
- Q3DSElementPrivate::setCommandQueue(queue);
-
- if (m_commandQueue) {
- m_commandQueue->queueCommand(m_elementPath, CommandType_RequestSlideInfo);
- m_slideInfoRequestPending = true;
- // If user has set current slide before the queue has been set for the first time,
- // we will switch to the desired slide after we initialize.
- if (m_initialSlideIndex != 0)
- q->setCurrentSlideIndex(m_initialSlideIndex - 1);
- else if (!m_initialSlideName.isEmpty())
- q->setCurrentSlideName(m_initialSlideName);
-
- m_initialSlideIndex = 0;
- m_initialSlideName.clear();
- }
-}
-
-/*!
- \internal
- */
-void Q3DSSceneElementPrivate::requestResponseHandler(CommandType commandType, void *requestData)
-{
- switch (commandType) {
- case CommandType_RequestSlideInfo: {
- QVariantList *response = reinterpret_cast<QVariantList *>(requestData);
- if (m_slideInfoRequestPending) {
- m_slideInfoRequestPending = false;
-
- m_previousSlideIndex = response->at(1).toInt();
- m_previousSlideName = response->at(3).toString();
-
- handleSlideEntered(response->at(0).toInt(), response->at(2).toString());
- }
- delete response;
- break;
- }
- default:
- Q3DSElementPrivate::requestResponseHandler(commandType, requestData);
- break;
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.h
deleted file mode 100644
index 2d96255c..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSSCENEELEMENT_H
-#define Q3DSSCENEELEMENT_H
-
-#include <QtStudio3D/q3dselement.h>
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSSceneElementPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSSceneElement : public Q3DSElement
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSSceneElement)
-
- Q_PROPERTY(int currentSlideIndex READ currentSlideIndex WRITE setCurrentSlideIndex NOTIFY currentSlideIndexChanged)
- Q_PROPERTY(int previousSlideIndex READ previousSlideIndex NOTIFY previousSlideIndexChanged)
- Q_PROPERTY(QString currentSlideName READ currentSlideName WRITE setCurrentSlideName NOTIFY currentSlideNameChanged)
- Q_PROPERTY(QString previousSlideName READ previousSlideName NOTIFY previousSlideNameChanged)
-
-public:
- explicit Q3DSSceneElement(QObject *parent = nullptr);
- explicit Q3DSSceneElement(const QString &elementPath, QObject *parent = nullptr);
- explicit Q3DSSceneElement(Q3DSPresentation *presentation, const QString &elementPath,
- QObject *parent = nullptr);
- ~Q3DSSceneElement();
-
- int currentSlideIndex() const;
- int previousSlideIndex() const;
- QString currentSlideName() const;
- QString previousSlideName() const;
-
-public Q_SLOTS:
- void setCurrentSlideIndex(int currentSlideIndex);
- void setCurrentSlideName(const QString &currentSlideName);
- void goToSlide(bool next, bool wrap);
- void goToTime(float time);
-
-Q_SIGNALS:
- void currentSlideIndexChanged(int currentSlideIndex);
- void previousSlideIndexChanged(int previousSlideIndex);
- void currentSlideNameChanged(const QString &currentSlideName);
- void previousSlideNameChanged(const QString &previousSlideName);
-
-private:
- Q_DISABLE_COPY(Q3DSSceneElement)
-
- friend class Q3DSPresentationPrivate;
- friend class Q3DSStudio3D;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSSCENEELEMENT_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement_p.h
deleted file mode 100644
index 02d2bdff..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssceneelement_p.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSSCENEELEMENT_P_H
-#define Q3DSSCENEELEMENT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dssceneelement.h"
-#include "q3dselement_p.h"
-#include "q3dscommandqueue_p.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPresentationPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSSceneElementPrivate : public Q3DSElementPrivate
-{
- Q_DECLARE_PUBLIC(Q3DSSceneElement)
-public:
- explicit Q3DSSceneElementPrivate(Q3DSSceneElement *parent);
- ~Q3DSSceneElementPrivate();
-
- void handleSlideEntered(int index, const QString &name);
- void goToSlide(bool next, bool wrap);
- void goToTime(float time);
-
- void setViewerApp(Q3DSViewer::Q3DSViewerApp *app) override;
- void setCommandQueue(CommandQueue *queue) override;
-
- void requestResponseHandler(CommandType commandType, void *requestData) override;
-
-private:
- int m_currentSlideIndex;
- int m_previousSlideIndex;
- int m_initialSlideIndex;
- QString m_currentSlideName;
- QString m_previousSlideName;
- QString m_initialSlideName;
- bool m_slideInfoRequestPending;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSSCENEELEMENT_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.cpp
deleted file mode 100644
index 23782f2f..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.cpp
+++ /dev/null
@@ -1,688 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dssurfaceviewer_p.h"
-#include "Qt3DSAudioPlayerImpl.h"
-#include "viewerqmlstreamproxy_p.h"
-#include "q3dsviewersettings_p.h"
-#include "q3dspresentation_p.h"
-#include "studioutils_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtGui/qopenglcontext.h>
-#include <QtGui/qopenglfunctions.h>
-#include <QtGui/qoffscreensurface.h>
-#include <QtGui/qwindow.h>
-#include <QtGui/QPlatformSurfaceEvent>
-
-#include <QtCore/QFileInfo>
-
-using namespace Q3DSViewer;
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class Q3DSSurfaceViewer
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
-
- \brief Renders a Qt 3D Studio presentation on a QWindow or an offscreen
- render target using OpenGL.
-
- Q3DSSurfaceViewer is used to render Qt 3D Studio presentations onto a
- QSurface. In practice this means two types of uses: rendering to an
- on-screen QWindow, or rendering to an offscreen render target (typically an
- OpenGL texture via a framebuffer object and a QOffscreenSurface).
-
- \section2 Example Usage
-
- \code
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
-
- QOpenGLContext context;
- context.create();
-
- QWindow window;
- window.setSurfaceType(QSurface::OpenGLSurface);
- window.setFormat(context.format());
- window.create();
-
- Q3DSSurfaceViewer viewer;
- viewer.presentation()->setSource(QUrl(QStringLiteral("qrc:/my_presentation.uip")));
- viewer.setUpdateInterval(0); // enable automatic updates
-
- // Register a scene object for slide management (optional)
- Q3DSSceneElement scene(viewer.presentation(), QStringLiteral("Scene"));
-
- // Register an element object for attribute setting (optional)
- Q3DSElement element(viewer.presentation(), QStringLiteral("Scene.Layer.myCarModel"));
-
- viewer.create(&window, &context);
-
- w.resize(1024, 768);
- w.show();
-
- return app.exec();
- }
- \endcode
-
- \sa Q3DSWidget
- */
-
-/*!
- * \brief Q3DSSurfaceViewer::Q3DSSurfaceViewer Constructor.
- * \param parent Optional parent of the object.
- */
-Q3DSSurfaceViewer::Q3DSSurfaceViewer(QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSSurfaceViewerPrivate(this))
-{
-}
-
-/*!
- * \brief Q3DSSurfaceViewer::~Q3DSSurfaceViewer Destructor
- */
-Q3DSSurfaceViewer::~Q3DSSurfaceViewer()
-{
- delete d_ptr;
-}
-
-/*!
- Initializes Q3DSSurfaceViewer to render the presentation to the given
- \a surface using the \a context.
-
- The source property of the attached presentation must be set before the
- viewer can be initialized.
-
- Returns whether the initialization succeeded.
-
- \sa running, Q3DSPresentation::source, presentation()
-*/
-bool Q3DSSurfaceViewer::create(QSurface *surface, QOpenGLContext *context)
-{
- // #TODO: QT3DS-3531 Fix this to behave as in RT2
- return create(surface, context, 0);
-}
-
-
-/*!
- Initializes Q3DSSurfaceViewer to render the presentation to the given
- \a surface using the \a context and optional framebuffer id (\a fboId). If
- \a fboId is omitted, it defaults to zero.
-
- The source property of the attached presentation must be set before the
- viewer can be initialized.
-
- Returns whether the initialization succeeded.
-
- \sa running, Q3DSPresentation::source, presentation()
-*/
-bool Q3DSSurfaceViewer::create(QSurface *surface, QOpenGLContext *context, GLuint fboId)
-{
- return d_ptr->initialize(surface, context, fboId);
-}
-
-/*!
- Releases the presentation and all related resources.
- The Q3DSSurfaceViewer instance can be reused by calling create() again.
- */
-void Q3DSSurfaceViewer::destroy()
-{
- d_ptr->destroy();
-}
-
-/*!
- Updates the surface viewer with a new frame.
-*/
-void Q3DSSurfaceViewer::update()
-{
- d_ptr->update();
-}
-
-/*!
- Grabs the data rendered to the framebuffer into an image using the given \a
- rect. The \a rect parameter is optional. If it is omitted, the whole
- framebuffer is captured.
-
- \note This is a potentially expensive operation.
-*/
-QImage Q3DSSurfaceViewer::grab(const QRect &rect)
-{
- return d_ptr->grab(rect);
-}
-
-/*!
- \property Q3DSSurfaceViewer::size
-
- Holds the desired size of the presentation. Relevant only when
- autoSize is set to \c false.
-
- \sa autoSize
-*/
-QSize Q3DSSurfaceViewer::size() const
-{
- return d_ptr->m_size;
-}
-
-void Q3DSSurfaceViewer::setSize(const QSize &size)
-{
- d_ptr->setSize(size);
-}
-
-/*!
- \property Q3DSSurfaceViewer::autoSize
-
- Specifies whether the viewer should change the size of the presentation
- automatically to match the surface size when surface size changes. The
- \l{Q3DSSurfaceViewer::size}{size} property is updated automatically
- whenever the viewer is \l{Q3DSSurfaceViewer::update()}{updated} if this
- property value is \c{true}.
-
- When rendering offscreen, via a QOffscreenSurface, this property must be
- set to \c{false} by the application since it is then up to the application
- to provide a QOpenGLFramebufferObject with the desired size. The size of
- the Q3DSSurfaceViewer must be set to the same value.
-
- The default value is \c{true}.
-*/
-bool Q3DSSurfaceViewer::autoSize() const
-{
- return d_ptr->m_autoSize;
-}
-
-void Q3DSSurfaceViewer::setAutoSize(bool autoSize)
-{
- if (d_ptr->m_autoSize != autoSize) {
- d_ptr->m_autoSize = autoSize;
- Q_EMIT autoSizeChanged(autoSize);
- }
-}
-
-/*!
- \property Q3DSSurfaceViewer::updateInterval
-
- Holds the viewer update interval in milliseconds. If the value is negative,
- the viewer doesn't update the presentation automatically.
-
- The default value is -1, meaning there are no automatic updates and
- update() must be called manually.
-
- \sa update()
-*/
-int Q3DSSurfaceViewer::updateInterval() const
-{
- return d_ptr->m_updateInterval;
-}
-
-void Q3DSSurfaceViewer::setUpdateInterval(int interval)
-{
- d_ptr->setUpdateInterval(interval);
-}
-
-/*!
- \property Q3DSSurfaceViewer::running
-
- The value of this property is \c true when the presentation has been loaded
- and is ready to be shown.
-
- This property is read-only.
-*/
-bool Q3DSSurfaceViewer::isRunning() const
-{
- return d_ptr->m_viewerApp != nullptr;
-}
-
-// #TODO QT3DS-3534
-
-/*!
- \property Q3DSSurfaceViewer::presentationId
- */
-QString Q3DSSurfaceViewer::presentationId() const
-{
- return d_ptr->m_id;
-}
-
-/*!
- Returns the framebuffer id given in initialization.
-
- \sa create()
-*/
-int Q3DSSurfaceViewer::fboId() const
-{
- return d_ptr->m_fboId;
-}
-
-/*!
- Returns the surface given in initialization.
-
- \sa create()
-*/
-QSurface *Q3DSSurfaceViewer::surface() const
-{
- return d_ptr->m_surface;
-}
-
-/*!
- Returns the context given in initialization.
-
- \sa create()
-*/
-QOpenGLContext *Q3DSSurfaceViewer::context() const
-{
- return d_ptr->m_context;
-}
-
-/*!
- Returns the settings object used by the Q3DSSurfaceViewer.
-*/
-Q3DSViewerSettings *Q3DSSurfaceViewer::settings() const
-{
- return d_ptr->m_settings;
-}
-
-/*!
- Returns the presentation object used by the Q3DSSurfaceViewer.
-*/
-Q3DSPresentation *Q3DSSurfaceViewer::presentation() const
-{
- return d_ptr->m_presentation;
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewer::setPresentationId(const QString &id)
-{
- if (d_ptr->m_id != id) {
- d_ptr->m_id = id;
- Q_EMIT presentationIdChanged(id);
- if (d_ptr->m_viewerApp)
- d_ptr->m_viewerApp->setPresentationId(id);
- }
-}
-
-// TODO: QT3DS-3563
-
-/*!
- * \brief Q3DSSurfaceViewer::qmlEngine
- * \return
- */
-QQmlEngine *Q3DSSurfaceViewer::qmlEngine() const
-{
- Q_D(const Q3DSSurfaceViewer);
- return d->qmlEngine;
-}
-
-/*!
- * \brief Q3DSSurfaceViewer::setQmlEngine
- * \param qmlEngine
- */
-void Q3DSSurfaceViewer::setQmlEngine(QQmlEngine *qmlEngine)
-{
- Q_D(Q3DSSurfaceViewer);
- d->qmlEngine = qmlEngine;
-}
-
-
-/*!
- \fn Q3DSSurfaceViewer::frameUpdate()
-
- Emitted each time a frame has been rendered.
-*/
-
-/*!
- \fn Q3DSSurfaceViewer::presentationLoaded()
-
- Emitted when the presentation has been loaded and is ready
- to be shown.
-*/
-
-/*!
- \fn Q3DSSurfaceViewer::presentationReady()
- Emitted when first frame is about to be shown. DataInputs and setAttribute
- are ready to be used after this signal.
- */
-
-/*!
- * \internal
- */
-Q3DSSurfaceViewerPrivate::Q3DSSurfaceViewerPrivate(Q3DSSurfaceViewer *q)
- : QObject(q)
- , q_ptr(q)
- , m_viewerApp(nullptr)
- , m_timer(nullptr)
- , m_updateInterval(-1)
- , m_pixelRatio(1.0)
- , m_fboId(0)
- , m_surface(nullptr)
- , m_context(nullptr)
- , m_autoSize(true)
- , m_settings(new Q3DSViewerSettings(this))
- , m_presentation(new Q3DSPresentation(this))
-{
- m_startupTimer.start();
- connect(m_presentation, &Q3DSPresentation::sourceChanged,
- this, &Q3DSSurfaceViewerPrivate::reset);
-}
-
-/*!
- * \internal
- */
-Q3DSSurfaceViewerPrivate::~Q3DSSurfaceViewerPrivate()
-{
- releaseRuntime();
-
- delete m_timer;
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::setSize(const QSize &size)
-{
- if (m_size != size) {
- m_size = size;
-
- if (m_viewerApp) {
- m_context->makeCurrent(m_surface);
- m_viewerApp->Resize(int(m_size.width() * m_pixelRatio),
- int(m_size.height() * m_pixelRatio));
- }
-
- Q_EMIT q_ptr->sizeChanged(m_size);
- }
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::setUpdateInterval(int interval)
-{
- if (m_updateInterval != interval) {
- m_updateInterval = interval;
- resetUpdateTimer();
- Q_EMIT q_ptr->updateIntervalChanged(m_updateInterval);
- }
-}
-
-/*!
- * \internal
- */
-bool Q3DSSurfaceViewerPrivate::initialize(QSurface *surface, QOpenGLContext *context, GLuint fboId)
-{
- Q_ASSERT(context);
- Q_ASSERT(surface);
-
- if (m_presentation->source().isEmpty()) {
- qWarning("Failed to initialize Q3DSSurfaceViewer,"
- " presentation source must be set before calling initialize()");
- return false;
- }
-
- QFileInfo info(Q3DSUtils::urlToLocalFileOrQrc(m_presentation->source()));
- if (!info.exists()) {
- qWarning() << "Failed to initialize Q3DSSurfaceViewer, the presentation doesn't exist:"
- << m_presentation->source().toString();
- return false;
- }
-
- destroy();
-
- m_surface = surface;
- m_context = context;
- m_fboId = fboId;
- if (m_surface->surfaceClass() == QSurface::Window && fboId == 0)
- m_pixelRatio = static_cast<QWindow *>(m_surface)->devicePixelRatio();
-
- surfaceObject()->installEventFilter(this);
-
- connect(context, &QOpenGLContext::aboutToBeDestroyed, this, &Q3DSSurfaceViewerPrivate::destroy);
-
- bool success = initializeRuntime();
-
- if (success)
- Q_EMIT q_ptr->runningChanged(true);
-
- return success;
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::destroy()
-{
- bool oldInitialized = (m_viewerApp != nullptr);
-
- if (m_context) {
- disconnect(m_context, &QOpenGLContext::aboutToBeDestroyed,
- this, &Q3DSSurfaceViewerPrivate::destroy);
- }
-
- if (m_surface)
- surfaceObject()->removeEventFilter(this);
-
- releaseRuntime();
-
- m_surface = nullptr;
- m_context = nullptr;
- m_fboId = 0;
-
- if (oldInitialized)
- Q_EMIT q_ptr->runningChanged(false);
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::update()
-{
- if (m_viewerApp && m_viewerApp->IsInitialised()) {
- if (m_surface->surfaceClass() != QSurface::Window
- || static_cast<QWindow *>(m_surface)->isExposed()) {
- m_context->makeCurrent(m_surface);
- if (m_autoSize)
- setSize(m_surface->size());
- m_viewerApp->Render();
-
- if (m_fboId == 0)
- m_context->swapBuffers(m_surface);
-
- Q_EMIT q_ptr->frameUpdate();
- }
- }
-}
-
-extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format,
- bool include_alpha);
-
-/*!
- * \internal
- */
-QImage Q3DSSurfaceViewerPrivate::grab(const QRect &rect)
-{
- QRect captureRect;
- QSize fullSize = m_size * m_pixelRatio;
- if (rect.isValid()) {
- captureRect = QRect(rect.x() * m_pixelRatio, rect.y() * m_pixelRatio,
- rect.width() * m_pixelRatio, rect.height() * m_pixelRatio);
- } else {
- captureRect = QRect(0, 0, fullSize.width(), fullSize.height());
- }
- QImage image(captureRect.size(), QImage::Format_ARGB32);
-
- if (m_surface && m_context && m_viewerApp && m_viewerApp->IsInitialised()
- && (m_surface->surfaceClass() != QSurface::Window
- || static_cast<QWindow *>(m_surface)->isExposed())) {
- m_context->makeCurrent(m_surface);
-
- // Render now to ensure the image is up to date and will actually exist in case
- // the surface has a non-preserved swap buffer
- if (m_autoSize)
- setSize(m_surface->size());
- m_viewerApp->Render();
-
- m_context->functions()->glBindFramebuffer(GL_FRAMEBUFFER, m_fboId);
- QImage fullGrab = qt_gl_read_framebuffer(fullSize, false, false);
-
- // Also update the screen to match the grab, since we just rendered
- if (m_fboId == 0)
- m_context->swapBuffers(m_surface);
-
- if (captureRect.size() == fullSize)
- image = fullGrab;
- else
- image = fullGrab.copy(captureRect);
- }
-
- return image;
-}
-
-/*!
- * \internal
- */
-bool Q3DSSurfaceViewerPrivate::eventFilter(QObject *obj, QEvent *e)
-{
- if (m_surface && e->type() == QEvent::PlatformSurface) {
- if (surfaceObject() == obj) {
- QPlatformSurfaceEvent *ev = static_cast<QPlatformSurfaceEvent *>(e);
- if (ev->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
- destroy();
- }
- }
- return QObject::eventFilter(obj, e);
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::reset()
-{
- if (m_viewerApp) {
- releaseRuntime();
- initializeRuntime();
- }
-}
-
-/*!
- * \internal
- */
-bool Q3DSSurfaceViewerPrivate::initializeRuntime()
-{
- Q_ASSERT(!m_viewerApp);
-
- m_context->makeCurrent(m_surface);
-
- m_viewerApp = &Q3DSViewerApp::Create(m_context, new Qt3DSAudioPlayerImpl(), &m_startupTimer);
- connect(m_viewerApp, &Q3DSViewerApp::SigPresentationReady,
- this->q_ptr, &Q3DSSurfaceViewer::presentationReady);
- connect(m_viewerApp, &Q3DSViewerApp::SigPresentationLoaded,
- this->q_ptr, &Q3DSSurfaceViewer::presentationLoaded);
- Q_ASSERT(m_viewerApp);
-
- const QString localSource = Q3DSUtils::urlToLocalFileOrQrc(m_presentation->source());
-
- if (m_autoSize)
- m_size = m_surface->size();
-
- if (nullptr != qmlEngine)
- m_presentation->d_ptr->streamProxy()->setEngine(qmlEngine);
-
- if (!m_viewerApp->InitializeApp(int(m_size.width() * m_pixelRatio),
- int(m_size.height() * m_pixelRatio),
- m_context->format(), m_fboId, localSource,
- m_presentation->variantList(),
- m_presentation->delayedLoading(),
- m_presentation->d_ptr->streamProxy())) {
- releaseRuntime();
- qWarning("Failed to initialize runtime");
- return false;
- }
-
- if (!m_id.isEmpty())
- m_viewerApp->setPresentationId(m_id);
- m_settings->d_ptr->setViewerApp(m_viewerApp);
- m_presentation->d_ptr->setViewerApp(m_viewerApp);
-
- resetUpdateTimer();
-
- return true;
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::releaseRuntime()
-{
- m_settings->d_ptr->setViewerApp(nullptr);
- m_presentation->d_ptr->setViewerApp(nullptr);
-
- if (m_context && m_surface)
- m_context->makeCurrent(m_surface);
-
- if (m_viewerApp) {
- m_viewerApp->Release();
- m_viewerApp = nullptr;
- }
-
- resetUpdateTimer();
-}
-
-/*!
- * \internal
- */
-void Q3DSSurfaceViewerPrivate::resetUpdateTimer()
-{
- if (m_viewerApp && m_updateInterval >= 0) {
- if (!m_timer) {
- m_timer = new QTimer();
- connect(m_timer, &QTimer::timeout, this, &Q3DSSurfaceViewerPrivate::update);
- }
- m_timer->start(m_updateInterval);
- } else if (m_timer) {
- m_timer->stop();
- }
-}
-
-/*!
- * \internal
- */
-QObject *Q3DSSurfaceViewerPrivate::surfaceObject()
-{
- if (m_surface) {
- if (m_surface->surfaceClass() == QSurface::Window)
- return static_cast<QWindow *>(m_surface);
- else
- return static_cast<QOffscreenSurface *>(m_surface);
- }
- return nullptr;
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.h
deleted file mode 100644
index 5c166af9..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSSURFACEVIEWER_H
-#define Q3DSSURFACEVIEWER_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qsize.h>
-#include <QtCore/qurl.h>
-#include <QtGui/qimage.h>
-#include <QtGui/qopengl.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSSurfaceViewerPrivate;
-class QSurface;
-class QOpenGLContext;
-class Q3DSViewerSettings;
-class Q3DSPresentation;
-class QQmlEngine;
-
-class Q_STUDIO3D_EXPORT Q3DSSurfaceViewer : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSSurfaceViewer)
-
- // #TODO: QT3DS-3532 SurfaceViewer API missing error string
- //Q_PROPERTY(QString error READ error NOTIFY errorChanged)
- Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
- Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged)
- Q_PROPERTY(bool autoSize READ autoSize WRITE setAutoSize NOTIFY autoSizeChanged)
- Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval NOTIFY updateIntervalChanged)
- Q_PROPERTY(QString presentationId READ presentationId WRITE setPresentationId NOTIFY presentationIdChanged)
-
-public:
- explicit Q3DSSurfaceViewer(QObject *parent = nullptr);
- ~Q3DSSurfaceViewer();
-
- bool create(QSurface *surface, QOpenGLContext *context);
- bool create(QSurface *surface, QOpenGLContext *context, GLuint fboId);
- void destroy();
-
- Q3DSPresentation *presentation() const;
- Q3DSViewerSettings *settings() const;
-
- bool isRunning() const;
-
- QSize size() const;
- void setSize(const QSize &size);
-
- bool autoSize() const;
- void setAutoSize(bool autoSize);
-
- int updateInterval() const;
- void setUpdateInterval(int interval);
-
- int fboId() const;
- QSurface *surface() const;
- QOpenGLContext *context() const;
-
- QImage grab(const QRect &rect = QRect());
-
- QQmlEngine *qmlEngine() const;
- void setQmlEngine(QQmlEngine *qmlEngine);
- QString presentationId() const;
-
-public Q_SLOTS:
- void update();
- void setPresentationId(const QString &id);
-
-Q_SIGNALS:
- void presentationLoaded();
- void presentationReady();
- void frameUpdate();
-
- void presentationIdChanged(const QString &id);
- void sizeChanged(const QSize &size);
- void autoSizeChanged(bool autoSize);
- void updateIntervalChanged(bool autoUpdate);
- void runningChanged(bool initialized);
-
-private:
- Q_DISABLE_COPY(Q3DSSurfaceViewer)
- Q3DSSurfaceViewerPrivate *d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSSURFACEVIEWER_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer_p.h
deleted file mode 100644
index fc6b4cc8..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dssurfaceviewer_p.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSSURFACEVIEWER_P_H
-#define Q3DSSURFACEVIEWER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dssurfaceviewer.h"
-#include "Qt3DSViewerApp.h"
-
-#include <QtCore/qtimer.h>
-
-QT_BEGIN_NAMESPACE
-
-class QSurface;
-class QOpenGLContext;
-class Q3DSViewerSettings;
-class Q3DSPresentation;
-class QQmlEngine;
-
-class Q_STUDIO3D_EXPORT Q3DSSurfaceViewerPrivate : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PUBLIC(Q3DSSurfaceViewer)
-public:
- explicit Q3DSSurfaceViewerPrivate(Q3DSSurfaceViewer *parent = nullptr);
- ~Q3DSSurfaceViewerPrivate();
-
- void setSize(const QSize &size);
- void setUpdateInterval(int interval);
- bool initialize(QSurface *surface, QOpenGLContext *context, GLuint fboId);
- void update();
-
- QImage grab(const QRect &rect);
-
-private Q_SLOTS:
- void destroy();
-
-protected:
- bool eventFilter(QObject *obj, QEvent *e) override;
-
-private:
- void reset();
- bool initializeRuntime();
- void releaseRuntime();
- void resetUpdateTimer();
- QObject *surfaceObject();
-
- Q3DSSurfaceViewer *q_ptr;
-
- Q3DSViewer::Q3DSViewerApp *m_viewerApp;
- QSize m_size;
- QTimer *m_timer;
- int m_updateInterval;
- qreal m_pixelRatio;
- GLuint m_fboId;
- QSurface *m_surface; // Not owned
- QOpenGLContext *m_context; // Not owned
- bool m_autoSize;
- Q3DSViewerSettings *m_settings;
- Q3DSPresentation *m_presentation;
- QString m_id;
- QElapsedTimer m_startupTimer;
- QQmlEngine *qmlEngine = nullptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSSURFACEVIEWER_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.cpp
deleted file mode 100644
index 187729a0..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.cpp
+++ /dev/null
@@ -1,401 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsviewersettings_p.h"
-#include "Qt3DSViewerApp.h"
-#include "q3dscommandqueue_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qsettings.h>
-#include <QtCore/qcoreapplication.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype ViewerSettings
- \instantiates Q3DSViewerSettings
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief Qt 3D Studio presentation viewer settings.
-
- This type provides properties to define presentation independent viewer settings.
-
- \note ViewerSettings are only applicable when \l Studio3D is used in the
- default mode, showing the final, composed image from the Qt 3D Studio
- renderer.
-
- \sa Studio3D
-*/
-
-/*!
- \class Q3DSViewerSettings
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
-
- \brief Qt 3D Studio presentation viewer settings.
-
- Q3DSViewerSettings provides properties to define presentation independent
- viewer settings.
-
- \note This class should not be instantiated directly when working with the
- C++ APIs. Q3DSSurfaceViewer and Q3DSWidget create a Q3DSViewerSettings
- instance implicitly. This can be queried via Q3DSSurfaceViewer::settings()
- or Q3DSWidget::settings().
- */
-
-/*!
- * \internal
- */
-Q3DSViewerSettings::Q3DSViewerSettings(QObject *parent)
- : QObject(parent)
- , d_ptr(new Q3DSViewerSettingsPrivate(this))
-{
-}
-
-/*!
- * \internal
- */
-Q3DSViewerSettings::~Q3DSViewerSettings()
-{
-}
-
-/*!
- \enum Q3DSViewerSettings::ScaleMode
-
- This enumeration specifies the possible scaling modes.
-
- \value ScaleModeFit Scales the presentation to fit the output area.
- \value ScaleModeFill Scales the presentation to completely fill the output area.
- This is the default.
- \value ScaleModeCenter Centers the presentation in the output area without scaling it.
-*/
-
-/*!
- \qmlproperty QColor ViewerSettings::matteColor
-
- Specifies the matte color.
- */
-
-/*!
- \property Q3DSViewerSettings::matteColor
-
- Specifies the matte color.
- */
-QColor Q3DSViewerSettings::matteColor() const
-{
- return d_ptr->m_matteColor;
-}
-
-void Q3DSViewerSettings::setMatteColor(const QColor &color)
-{
- if (d_ptr->m_matteColor != color) {
- d_ptr->setMatteColor(color);
- Q_EMIT matteColorChanged(color);
- }
-}
-
-/*!
- \qmlproperty bool ViewerSettings::showRenderStats
-
- If this property is set to \c true, the simple profile
- view is displayed in-scene, on top of the 3D content.
-
- \note this feature can be disabled at build time, in which case this
- property has no effect.
-
- The default value is \c{false}.
-*/
-
-/*!
- \property Q3DSViewerSettings::showRenderStats
-
- When this property is \c{true}, the simple profile
- view is displayed in-scene, on top of the 3D content.
-
- \note This feature can be disabled at build time, in which case this
- property has no effect.
-
- Default value is \c{false}.
-*/
-bool Q3DSViewerSettings::isShowRenderStats() const
-{
- return d_ptr->m_showRenderStats;
-}
-
-void Q3DSViewerSettings::setShowRenderStats(bool show)
-{
- if (d_ptr->m_showRenderStats != show) {
- d_ptr->setShowRenderStats(show);
- Q_EMIT showRenderStatsChanged(show);
- }
-}
-
-/*!
- \qmlproperty ViewerSettings::shadeMode
- */
-
-/*!
- \property Q3DSViewerSettings::shadeMode
- */
-Q3DSViewerSettings::ShadeMode Q3DSViewerSettings::shadeMode() const
-{
- return d_ptr->m_shadeMode;
-}
-
-void Q3DSViewerSettings::setShadeMode(Q3DSViewerSettings::ShadeMode mode)
-{
- if (d_ptr->m_shadeMode != mode) {
- d_ptr->setShadeMode(mode);
- Q_EMIT shadeModeChanged(mode);
- }
-}
-
-/*!
- \qmlproperty enumeration ViewerSettings::scaleMode
-
- Specifies the scaling mode. The default value \c is ScaleModeFill where the
- size of the presentation on-screen follows and fills the size of the output
- area (the window, the screen, or the area occupied by the Studio3D
- element).
-
- During the design phase it can be valuable to see the presentation with
- some other scaling approach. For example, the Qt 3D Studio Viewer
- application uses ScaleModeCenter by default.
-
- \value ScaleModeFit Scales the presentation to fit the output area.
- \value ScaleModeFill Scales the presentation to completely fill the output area.
- \value ScaleModeCenter Centers the presentation in the output area without scaling it.
-
- The default value is \c{ScaleModeFill}.
-*/
-/*!
- \property Q3DSViewerSettings::scaleMode
-
- Specifies the scaling mode. The default value \c is ScaleModeFill where the
- size of the presentation on-screen follows and fills the size of the output
- area (the window, the screen, or the area occupied by the \l Studio3D
- element).
-
- During the design phase it can be valuable to see the presentation with
- some other scaling approach. For example, the Qt 3D Studio Viewer
- application uses ScaleModeCenter by default.
-
- \value ScaleModeFit Scales the presentation to fit the output area.
- \value ScaleModeFill Scales the presentation to completely fill the output area.
- \value ScaleModeCenter Centers the presentation in the output area without scaling it.
-
- The default value is \c{ScaleModeFill}.
- */
-Q3DSViewerSettings::ScaleMode Q3DSViewerSettings::scaleMode() const
-{
- return d_ptr->m_scaleMode;
-}
-
-void Q3DSViewerSettings::setScaleMode(Q3DSViewerSettings::ScaleMode mode)
-{
- if (d_ptr->m_scaleMode != mode) {
- d_ptr->setScaleMode(mode);
- Q_EMIT scaleModeChanged(mode);
- }
-}
-
-/*!
- \qmmlmethod ViewerSettings::save
- Persistently saves the viewer \l{QSettings}{settings} using \a group, \a organization and
- \a application.
- \param group
- \param organization
- \param application
- */
-/*!
- * \brief Q3DSViewerSettings::save Persistently saves the viewer \l{QSettings}{settings}
- Persistently saves the viewer \l{QSettings}{settings} using \a group, \a organization and
- \a application.
- \param group
- \param organization
- \param application
- */
-void Q3DSViewerSettings::save(const QString &group, const QString &organization,
- const QString &application)
-{
- d_ptr->save(group, organization, application);
-}
-
-/*!
- \qmlmethod ViewerSettings::load
- Loads previously saved viewer \l{QSettings}{settings} using \a group, \a organization and
- \a application.
- \param group
- \param organization
- \param application
- */
-/*!
- * \brief Q3DSViewerSettings::load Loads previously saved viewer \l{QSettings}{settings}
- Loads previously saved viewer \l{QSettings}{settings} using \a group, \a organization and
- \a application.
- \param group
- \param organization
- \param application
- */
-void Q3DSViewerSettings::load(const QString &group, const QString &organization,
- const QString &application)
-{
- d_ptr->load(group, organization, application);
-}
-
-Q3DSViewerSettingsPrivate::Q3DSViewerSettingsPrivate(Q3DSViewerSettings *q)
- : QObject(q)
- , q_ptr(q)
- , m_viewerApp(nullptr)
- , m_commandQueue(nullptr)
- , m_matteColor(Qt::black)
- , m_showRenderStats(false)
- , m_shadeMode(Q3DSViewerSettings::ShadeModeShaded)
- , m_scaleMode(Q3DSViewerSettings::ScaleModeCenter)
- , m_savedSettings(nullptr)
-{
-}
-
-Q3DSViewerSettingsPrivate::~Q3DSViewerSettingsPrivate()
-{
-}
-
-void Q3DSViewerSettingsPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app)
-{
- m_viewerApp = app;
- if (m_viewerApp) {
- setMatteColor(m_matteColor);
- setShowRenderStats(m_showRenderStats);
- setShadeMode(m_shadeMode);
- setScaleMode(m_scaleMode);
- }
-}
-
-void Q3DSViewerSettingsPrivate::setCommandQueue(CommandQueue *queue)
-{
- m_commandQueue = queue;
- if (m_commandQueue) {
- setMatteColor(m_matteColor);
- setShowRenderStats(m_showRenderStats);
- setShadeMode(m_shadeMode);
- setScaleMode(m_scaleMode);
- }
-}
-
-void Q3DSViewerSettingsPrivate::save(const QString &group, const QString &organization,
- const QString &application)
-{
- initSettingsStore(group, organization, application);
-
- m_savedSettings->setValue(QStringLiteral("matteColor"), m_matteColor);
- m_savedSettings->setValue(QStringLiteral("showRenderStats"), m_showRenderStats);
- m_savedSettings->setValue(QStringLiteral("shadeMode"), m_shadeMode);
- m_savedSettings->setValue(QStringLiteral("scaleMode"), m_scaleMode);
-}
-
-void Q3DSViewerSettingsPrivate::load(const QString &group, const QString &organization,
- const QString &application)
-{
- initSettingsStore(group, organization, application);
-
- q_ptr->setMatteColor(m_savedSettings->value(QStringLiteral("matteColor")).value<QColor>());
- q_ptr->setShowRenderStats(m_savedSettings->value(QStringLiteral("showRenderStats")).toBool());
- q_ptr->setShadeMode(Q3DSViewerSettings::ShadeMode(
- m_savedSettings->value(QStringLiteral("shadeMode")).toInt()));
- q_ptr->setScaleMode(Q3DSViewerSettings::ScaleMode(
- m_savedSettings->value(QStringLiteral("scaleMode")).toInt()));
-}
-
-void Q3DSViewerSettingsPrivate::setMatteColor(const QColor &color)
-{
- m_matteColor = color;
- if (m_viewerApp) {
- m_viewerApp->setMatteColor(color);
- } else if (m_commandQueue) {
- m_commandQueue->m_matteColor = color;
- m_commandQueue->m_matteColorChanged = true;
- }
-}
-
-void Q3DSViewerSettingsPrivate::setShowRenderStats(bool show)
-{
- m_showRenderStats = show;
- if (m_viewerApp) {
- m_viewerApp->setShowOnScreenStats(show);
- } else if (m_commandQueue) {
- m_commandQueue->m_showRenderStats = show;
- m_commandQueue->m_showRenderStatsChanged = true;
- }
-}
-
-void Q3DSViewerSettingsPrivate::setShadeMode(Q3DSViewerSettings::ShadeMode mode)
-{
- m_shadeMode = mode;
- if (m_viewerApp) {
- if (mode == Q3DSViewerSettings::ShadeModeShaded)
- m_viewerApp->SetShadeMode(Q3DSViewer::ViewerShadeModes::Shaded);
- else
- m_viewerApp->SetShadeMode(Q3DSViewer::ViewerShadeModes::ShadedWireframe);
- } else if (m_commandQueue) {
- m_commandQueue->m_shadeMode = mode;
- m_commandQueue->m_shadeModeChanged = true;
- }
-}
-
-void Q3DSViewerSettingsPrivate::setScaleMode(Q3DSViewerSettings::ScaleMode mode)
-{
- m_scaleMode = mode;
- if (m_viewerApp) {
- if (mode == Q3DSViewerSettings::ScaleModeFit)
- m_viewerApp->SetScaleMode(Q3DSViewer::ViewerScaleModes::ScaleToFit);
- else if (mode == Q3DSViewerSettings::ScaleModeFill)
- m_viewerApp->SetScaleMode(Q3DSViewer::ViewerScaleModes::ScaleToFill);
- else
- m_viewerApp->SetScaleMode(Q3DSViewer::ViewerScaleModes::ExactSize);
- } else if (m_commandQueue) {
- m_commandQueue->m_scaleMode = mode;
- m_commandQueue->m_scaleModeChanged = true;
- }
-}
-
-void Q3DSViewerSettingsPrivate::initSettingsStore(const QString &group, const QString &organization,
- const QString &application)
-{
- if (!m_savedSettings) {
- QString org = organization.isEmpty() ? QCoreApplication::instance()->organizationName()
- : organization;
- QString app = application.isEmpty() ? QCoreApplication::instance()->applicationName()
- : application;
-
- m_savedSettings = new QSettings(org, app, this);
- m_savedSettings->beginGroup(group);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.h
deleted file mode 100644
index 5d7abf68..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSVIEWERSETTINGS_H
-#define Q3DSVIEWERSETTINGS_H
-
-#include <QtStudio3D/qstudio3dglobal.h>
-#include <QtCore/qobject.h>
-#include <QtGui/qcolor.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSViewerSettingsPrivate;
-
-class Q_STUDIO3D_EXPORT Q3DSViewerSettings : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(Q3DSViewerSettings)
- Q_ENUMS(ShadeMode)
- Q_ENUMS(ScaleMode)
-
-// #TODO: QT3DS-3542 Q3DSViewerSettings API is missing property matteEnabled compared to 2.3
-// Q_PROPERTY(bool matteEnabled READ matteEnabled WRITE setMatteEnabled NOTIFY matteEnabledChanged)
-
- Q_PROPERTY(QColor matteColor READ matteColor WRITE setMatteColor NOTIFY matteColorChanged)
- Q_PROPERTY(bool showRenderStats READ isShowRenderStats WRITE setShowRenderStats NOTIFY showRenderStatsChanged)
- Q_PROPERTY(ScaleMode scaleMode READ scaleMode WRITE setScaleMode NOTIFY scaleModeChanged)
-
-public:
- enum ShadeMode {
- ShadeModeShaded,
- ShadeModeShadedWireframe
- };
-
- enum ScaleMode {
- ScaleModeFit,
- ScaleModeFill,
- ScaleModeCenter
- };
-
- explicit Q3DSViewerSettings(QObject *parent = nullptr);
- ~Q3DSViewerSettings();
-
- QColor matteColor() const;
- bool isShowRenderStats() const;
- ScaleMode scaleMode() const;
-
- Q_INVOKABLE void save(const QString &group, const QString &organization = QString(),
- const QString &application = QString());
- Q_INVOKABLE void load(const QString &group, const QString &organization = QString(),
- const QString &application = QString());
-
-public Q_SLOTS:
- void setMatteColor(const QColor &color);
- void setShowRenderStats(bool show);
- void setScaleMode(ScaleMode mode);
-
-Q_SIGNALS:
- void matteColorChanged(const QColor &color);
- void showRenderStatsChanged(bool show);
- void shadeModeChanged(ShadeMode mode);
- void scaleModeChanged(ScaleMode mode);
-
-private:
- Q_DISABLE_COPY(Q3DSViewerSettings)
- Q3DSViewerSettingsPrivate *d_ptr;
-
- ShadeMode shadeMode() const;
- void setShadeMode(ShadeMode mode);
-
- friend class Q3DSSurfaceViewerPrivate;
- friend class Q3DSRenderer;
- friend class Q3DSStudio3D;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSVIEWERSETTINGS_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings_p.h
deleted file mode 100644
index 48fbae3a..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/q3dsviewersettings_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSVIEWERSETTINGS_P_H
-#define Q3DSVIEWERSETTINGS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dsviewersettings.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class QSettings;
-class CommandQueue;
-
-class Q_STUDIO3D_EXPORT Q3DSViewerSettingsPrivate : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PUBLIC(Q3DSViewerSettings)
-public:
- explicit Q3DSViewerSettingsPrivate(Q3DSViewerSettings *parent);
- ~Q3DSViewerSettingsPrivate();
-
- void setViewerApp(Q3DSViewer::Q3DSViewerApp *app);
- void setCommandQueue(CommandQueue *queue);
- void save(const QString &group, const QString &organization, const QString &application);
- void load(const QString &group, const QString &organization, const QString &application);
-
- void setMatteColor(const QColor &color);
- void setShowRenderStats(bool show);
- void setShadeMode(Q3DSViewerSettings::ShadeMode mode);
- void setScaleMode(Q3DSViewerSettings::ScaleMode mode);
-
-public:
- Q3DSViewerSettings *q_ptr;
-
-private:
- void initSettingsStore(const QString &group, const QString &organization,
- const QString &application);
-
- Q3DSViewer::Q3DSViewerApp *m_viewerApp; // Not owned
- CommandQueue *m_commandQueue; // Not owned
- QColor m_matteColor;
- bool m_showRenderStats;
- Q3DSViewerSettings::ShadeMode m_shadeMode;
- Q3DSViewerSettings::ScaleMode m_scaleMode;
- QSettings *m_savedSettings;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSVIEWERSETTINGS_P_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/qstudio3dglobal.h b/src/Runtime/ogl-runtime/src/api/studio3d/qstudio3dglobal.h
deleted file mode 100644
index d1960634..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/qstudio3dglobal.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSTUDIO3D_GLOBAL_H
-#define QSTUDIO3D_GLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_STATIC
-# if defined(QT_BUILD_STUDIO3D_LIB)
-# define Q_STUDIO3D_EXPORT Q_DECL_EXPORT
-# else
-# define Q_STUDIO3D_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_STUDIO3D_EXPORT
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QSTUDIO3D_GLOBAL_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/studio3d.pro b/src/Runtime/ogl-runtime/src/api/studio3d/studio3d.pro
deleted file mode 100644
index 62d0613f..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/studio3d.pro
+++ /dev/null
@@ -1,56 +0,0 @@
-TARGET = QtStudio3D
-
-include($$PWD/../../commoninclude.pri)
-QT += opengl widgets qml
-
-qtHaveModule(multimedia) {
-DEFINES += PLATFORM_HAS_QT_MULTIMEDIA_LIB
-QT += multimedia
-}
-CONFIG += console
-
-LIBS += \
- -lqt3dsopengl$$qtPlatformTargetSuffix() \
- -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
-
-HEADERS += \
- q3dsdataoutput.h \
- q3dsdataoutput_p.h \
- q3dssurfaceviewer.h \
- q3dssurfaceviewer_p.h \
- qstudio3dglobal.h \
- viewerqmlstreamproxy_p.h \
- q3dsviewersettings.h \
- q3dsviewersettings_p.h \
- q3dspresentation.h \
- q3dspresentation_p.h \
- q3dssceneelement.h \
- q3dssceneelement_p.h \
- q3dselement.h \
- q3dselement_p.h \
- studioutils_p.h \
- q3dscommandqueue_p.h \
- q3dsimagesequencegenerator_p.h \
- q3dsimagesequencegeneratorthread_p.h \
- q3dsdatainput.h \
- q3dsdatainput_p.h \
- q3dsgeometry.h \
- q3dsgeometry_p.h
-
-SOURCES += q3dsdataoutput.cpp \
- q3dssurfaceviewer.cpp \
- viewerqmlstreamproxy.cpp \
- q3dsviewersettings.cpp \
- q3dspresentation.cpp \
- q3dssceneelement.cpp \
- q3dselement.cpp \
- studioutils.cpp \
- q3dscommandqueue.cpp \
- q3dsimagesequencegenerator.cpp \
- q3dsimagesequencegeneratorthread.cpp \
- q3dsdatainput.cpp \
- q3dsgeometry.cpp
-
-load(qt_module)
-
-OTHER_FILES += $$PWD/../../../doc/src/12-cpp-reference/*
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/studioutils.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/studioutils.cpp
deleted file mode 100644
index 9156be7f..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/studioutils.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "studioutils_p.h"
-
-#include <QtCore/QString>
-
-QT_BEGIN_NAMESPACE
-
-QString Q3DSUtils::urlToLocalFileOrQrc(const QUrl &url)
-{
- const QString scheme(url.scheme().toLower());
- if (scheme == QLatin1String("qrc")) {
- if (url.authority().isEmpty())
- return QLatin1Char(':') + url.path();
- return QString();
- }
-
-#if defined(Q_OS_ANDROID)
- if (scheme == QLatin1String("assets")) {
- if (url.authority().isEmpty())
- return url.toString();
- return QString();
- }
-#endif
-
- return url.toLocalFile();
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/studioutils_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/studioutils_p.h
deleted file mode 100644
index afec688c..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/studioutils_p.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#include "qstudio3dglobal.h"
-
-#include <QtCore/QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class Q_STUDIO3D_EXPORT Q3DSUtils
-{
-public:
- static QString urlToLocalFileOrQrc(const QUrl &url);
-};
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy.cpp b/src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy.cpp
deleted file mode 100644
index 520dc8c6..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "viewerqmlstreamproxy_p.h"
-
-QT_BEGIN_NAMESPACE
-
-ViewerQmlStreamProxy::ViewerQmlStreamProxy(QObject *parent)
- : Q3DSQmlStreamProxy(parent)
-{
-}
-
-ViewerQmlStreamProxy::~ViewerQmlStreamProxy()
-{
-}
-
-void ViewerQmlStreamProxy::visit(const char *path)
-{
- setPath(QLatin1String(path));
-}
-
-void ViewerQmlStreamProxy::visit(const char *type, const char *id, const char *src,
- const char *args)
-{
- Q_UNUSED(src);
- QString assetType = QLatin1String(type);
- QString presentationId = QLatin1String(id);
- QString presentationArgs = QLatin1String(args);
- if (assetType == QLatin1String("presentation-qml"))
- registerPresentation(presentationId, presentationArgs);
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy_p.h b/src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy_p.h
deleted file mode 100644
index 16569c1c..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3d/viewerqmlstreamproxy_p.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#include "qstudio3dglobal.h"
-#include "q3dsqmlstreamproxy.h"
-#include "Qt3DSViewerApp.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q_STUDIO3D_EXPORT ViewerQmlStreamProxy : public Q3DSQmlStreamProxy,
- public qt3ds::Qt3DSAssetVisitor
-{
-public:
- ViewerQmlStreamProxy(QObject *parent = nullptr);
- ~ViewerQmlStreamProxy();
-
- void visit(const char *path) override;
- void visit(const char *type, const char *id, const char *src, const char *args) override;
-};
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.cpp b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.cpp
deleted file mode 100644
index 640018f4..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (c) 2016 NVIDIA CORPORATION.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsplugin.h"
-
-#include <QtQml/qqml.h>
-
-#include <QtStudio3D/private/q3dsviewersettings_p.h>
-
-#include "q3dsstudio3d_p.h"
-#include "q3dspresentationitem_p.h"
-#include "q3dsqmlstream.h"
-#include "q3dsqmlsubpresentationsettings.h"
-#include "q3dssceneelement.h"
-#include "q3dsdatainput.h"
-
-QT_BEGIN_NAMESPACE
-
-void Q3DSPlugin::registerTypes(const char *uri)
-{
- Q_ASSERT(uri == QLatin1String("QtStudio3D.OpenGL"));
-
- // @uri QtStudio3D.OpenGL
- qmlRegisterType<Q3DSStudio3D>(uri, 2, 4, "Studio3D");
- qmlRegisterType<Q3DSViewerSettings>(uri, 2, 4, "ViewerSettings");
- qmlRegisterType<Q3DSPresentationItem>(uri, 2, 4, "Presentation");
- qmlRegisterType<Q3DSSceneElement>(uri, 2, 4, "SceneElement");
- qmlRegisterType<Q3DSElement>(uri, 2, 4, "Element");
- qmlRegisterType<Q3DSQmlStream>(uri, 2, 4, "QmlStream");
- qmlRegisterType<Q3DSSubPresentationSettings>(uri, 2, 4, "SubPresentationSettings");
- qmlRegisterType<Q3DSDataInput>(uri, 2, 4, "DataInput");
- qmlRegisterType<Q3DSDataOutput>(uri, 2, 4, "DataOutput");
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.h b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.h
deleted file mode 100644
index 04f69429..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsplugin.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (c) 2016 NVIDIA CORPORATION.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_PLUGIN_H
-#define Q3DS_PLUGIN_H
-
-#include <QtQml/qqmlextensionplugin.h>
-
-static void initResources()
-{
-#ifdef QT_STATIC
- Q_INIT_RESOURCE(qmake_QtStudio3D_OpenGL);
-#endif
-}
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-
-public:
- Q3DSPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent)
- {
- initResources();
- }
- void registerTypes(const char *uri) override;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DS_PLUGIN_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem.cpp b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem.cpp
deleted file mode 100644
index 407739e5..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dspresentationitem_p.h"
-
-#include <QtStudio3D/q3dssceneelement.h>
-#include <QtStudio3D/q3dsdatainput.h>
-#include <QtStudio3D/private/q3dspresentation_p.h>
-#include <QtStudio3D/private/viewerqmlstreamproxy_p.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype Presentation
- \instantiates Q3DSPresentationItem
- \inqmlmodule QtStudio3D
- \ingroup OpenGLRuntime
- \inherits Q3DSPresentation
- \keyword Studio3D
-
- \brief Represents a Qt 3D Studio presentation.
-
- This item provides properties and methods for controlling a
- presentation.
-
- Qt 3D Studio supports multiple presentations in one project. There
- is always a main presentation and zero or more
- sub-presentations. The sub-presentations are composed into the
- main presentations either as contents of Qt 3D Studio layers or as
- texture maps.
-
- In the filesystem each presentation corresponds to one \c{.uip}
- presentation file. When present, the \c{.uia} project file ties
- these together by specifying a name for each of the
- (sub-)presentations and specifies which one is the main one.
-
- The \c{.uia} project also defines \l{DataInput}s and
- \l{DataOutput}s that are exported by the presentations.
- \l{DataInput}s provide a way to provide input to the presentation
- to e.g. control a timeline of a subpresentation from code.
- \l{DataOutput}s provide a way to get notified when an attribute
- is changed in the presentation by animation timeline,
- by behavior scripts or by a \l{DataInput}.
-
- From the API point of view Presentation corresponds to the
- main presentation. The source property can refer either to a
- \c{.uia} or \c{.uip} file. When specifying a file with \c{.uip}
- extension and a \c{.uia} is present with the same name, the
- \c{.uia} is loaded automatically and thus sub-presentation
- information is available regardless.
- */
-Q3DSPresentationItem::Q3DSPresentationItem(QObject *parent)
- : Q3DSPresentation(parent)
- , m_subPresentationSettings(nullptr)
-{
-}
-
-Q3DSPresentationItem::~Q3DSPresentationItem()
-{
-}
-
-// #TODO: QT3DS-3565 subPresentationSettings is missing documentation
-/*!
- \qmlproperty SubPresentationSettings Presentation::subPresentationSettings
-
- Note: This property is read-only.
- */
-Q3DSSubPresentationSettings *Q3DSPresentationItem::subPresentationSettings() const
-{
- return m_subPresentationSettings;
-}
-
-QQmlListProperty<QObject> Q3DSPresentationItem::qmlChildren()
-{
- return QQmlListProperty<QObject>(this, nullptr, &appendQmlChildren, nullptr, nullptr, nullptr);
-}
-
-void Q3DSPresentationItem::appendQmlChildren(QQmlListProperty<QObject> *list, QObject *obj)
-{
- auto item = qobject_cast<Q3DSPresentationItem *>(list->object);
- if (item) {
- auto scene = qobject_cast<Q3DSSceneElement *>(obj);
- if (scene) {
- if (item->registeredElement(scene->elementPath()))
- qWarning() << __FUNCTION__ << "A duplicate SceneElement defined for Presentation.";
- else
- item->registerElement(scene);
- } else {
- auto studioElement = qobject_cast<Q3DSElement *>(obj);
- if (studioElement) {
- if (item->registeredElement(studioElement->elementPath()))
- qWarning() << __FUNCTION__ << "A duplicate Element defined for Presentation.";
- else
- item->registerElement(studioElement);
- } else {
- auto subPresSettings = qobject_cast<Q3DSSubPresentationSettings *>(obj);
- if (subPresSettings) {
- if (item->m_subPresentationSettings) {
- qWarning() << __FUNCTION__
- << "Duplicate SubPresentationSettings defined for Presentation.";
- } else {
- item->m_subPresentationSettings = subPresSettings;
- item->d_ptr->streamProxy()->setSettings(subPresSettings);
- }
- } else {
- auto dataInput = qobject_cast<Q3DSDataInput *>(obj);
- if (dataInput) {
- if (item->registeredDataInput(dataInput->name())) {
- qWarning() << __FUNCTION__
- << "Duplicate DataInput defined for Presentation.";
- } else {
- item->registerDataInput(dataInput);
- }
- } else {
- auto dataOutput = qobject_cast<Q3DSDataOutput *>(obj);
- if (dataOutput) {
- if (item->registeredDataOutput(dataOutput->name())) {
- qWarning() << __FUNCTION__
- << "Duplicate DataOutput defined for Presentation.";
- } else {
- item->registerDataOutput(dataOutput);
- }
- }
- }
- }
- }
- }
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem_p.h b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem_p.h
deleted file mode 100644
index 757f34fa..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dspresentationitem_p.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSPRESENTATIONITEM_H
-#define Q3DSPRESENTATIONITEM_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "q3dsqmlsubpresentationsettings.h"
-
-#include <QtStudio3D/q3dspresentation.h>
-#include <QtQml/qqmllist.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSPresentationItem : public Q3DSPresentation
-{
- Q_OBJECT
- Q_PROPERTY(QQmlListProperty<QObject> qmlChildren READ qmlChildren DESIGNABLE false)
- Q_PROPERTY(Q3DSSubPresentationSettings *subPresentationSettings READ subPresentationSettings CONSTANT)
- Q_CLASSINFO("DefaultProperty", "qmlChildren")
-
-public:
- explicit Q3DSPresentationItem(QObject *parent = nullptr);
- ~Q3DSPresentationItem();
-
- Q3DSSubPresentationSettings *subPresentationSettings() const;
-
- QQmlListProperty<QObject> qmlChildren();
-
-public Q_SLOTS:
- static void appendQmlChildren(QQmlListProperty<QObject> *list, QObject *obj);
-
-private:
- Q3DSSubPresentationSettings *m_subPresentationSettings;
-
- friend class Q3DSStudio3D;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSPRESENTATIONITEM_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer.cpp b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer.cpp
deleted file mode 100644
index bbfee502..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer.cpp
+++ /dev/null
@@ -1,458 +0,0 @@
-/****************************************************************************
-**
-** Copyright (c) 2016 NVIDIA CORPORATION.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsrenderer_p.h"
-#include "Qt3DSViewerApp.h"
-#include "Qt3DSAudioPlayerImpl.h"
-#include "q3dspresentationitem_p.h"
-
-#include <QtStudio3D/private/q3dscommandqueue_p.h>
-#include <QtStudio3D/private/q3dsviewersettings_p.h>
-#include <QtStudio3D/private/q3dspresentation_p.h>
-#include <QtStudio3D/private/studioutils_p.h>
-#include <QtStudio3D/private/q3dsdatainput_p.h>
-
-#include <QtCore/qdebug.h>
-#include <QtGui/qwindow.h>
-#include <QtGui/qopenglcontext.h>
-#include <QtQuick/qquickwindow.h>
-
-using namespace Q3DSViewer;
-
-QT_BEGIN_NAMESPACE
-
-Q3DSRenderer::Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisitor)
- : m_visibleFlag(visibleFlag)
- , m_initElements(false)
- , m_runtime(0)
- , m_window(nullptr)
- , m_initialized(false)
- , m_initializationFailure(false)
- , m_visitor(assetVisitor)
- , m_settings(new Q3DSViewerSettings(this))
- , m_presentation(new Q3DSPresentation(this))
-{
- m_startupTimer.start();
-}
-
-Q3DSRenderer::~Q3DSRenderer()
-{
- releaseRuntime();
-}
-
-QOpenGLFramebufferObject *Q3DSRenderer::createFramebufferObject(const QSize &size)
-{
- QOpenGLFramebufferObjectFormat theFormat;
- theFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
- QOpenGLFramebufferObject *frameBuffer =
- new QOpenGLFramebufferObject(size, theFormat);
- if (m_runtime && m_runtime->IsInitialised())
- m_runtime->setOffscreenId(frameBuffer->handle());
- return frameBuffer;
-}
-
-/** Pull pending commands from the plugin.
- * Invoked automatically by the QML scene graph.
- *
- * This is the only place where it is valid for the Q3DSStudio3D plugin and render to communicate.
- */
-void Q3DSRenderer::synchronize(QQuickFramebufferObject *inView)
-{
- // Passing m_InitElements here is a bit of a hack to easily set the flag on the plugin.
- static_cast<Q3DSStudio3D *>(inView)->getCommands(m_initElements, m_commands);
-
- if (m_initializationFailure)
- static_cast<Q3DSStudio3D *>(inView)->setError(m_error);
-
- if (m_commands.m_sourceChanged || m_commands.m_variantListChanged) {
- releaseRuntime();
- // Need to update source and variant list here rather than
- // processCommands, as both are needed for init
- m_presentation->setVariantList(m_commands.m_variantList);
- m_presentation->setSource(m_commands.m_source);
- m_presentation->setDelayedLoading(m_commands.m_delayedLoading);
- m_initialized = false;
- m_initializationFailure = false;
- m_error.clear();
- static_cast<Q3DSStudio3D *>(inView)->setError(QString());
- }
-
- m_initElements = false;
-
- // We need a handle to the window to be able to reset the GL state inside of Draw().
- // See https://bugreports.qt.io/browse/QTBUG-47213
- if (!m_window)
- m_window = inView->window();
-}
-
-void Q3DSRenderer::releaseRuntime()
-{
- m_settings->d_ptr->setViewerApp(nullptr);
- m_presentation->d_ptr->setViewerApp(nullptr);
-
- if (m_runtime) {
- m_runtime->Release();
- m_runtime = nullptr;
- }
-}
-
-/** Invoked by the QML scene graph indicating that it's time to render.
- * Calls `draw()` if the plugin is visible, or `processCommands()` otherwise.
- *
- * Note that this will still render if the plugin is opacity:0. To avoid this,
- * add a line to your QML to hide the object when opacity is zero, like:
- *
- * visible: opacity != 0
- */
-void Q3DSRenderer::render()
-{
- // We may start in a non visible state but we still need
- // to init the runtime otherwise the commands are never processed
- if (!m_initialized && !m_initializationFailure) {
- m_initialized = initializeRuntime(this->framebufferObject());
- m_initializationFailure = !m_initialized;
- if (m_initializationFailure)
- m_commands.clear(true);
- }
-
- // Don't render if the plugin is hidden; however, if hidden, but sure
- // to process pending commands so we can be shown again.
- if (m_initialized) {
- if (m_visibleFlag)
- draw();
- else
- processCommands();
- update(); // mark as dirty to ensure update again
- }
-}
-
-/** Cause Qt3DS runtime to render content.
- * Initializes GL and the runtime when called the first time.
- */
-void Q3DSRenderer::draw()
-{
- if (m_runtime && m_runtime->IsInitialised() && m_window) {
- if (m_initialized)
- m_runtime->RestoreState();
- m_runtime->Render();
- m_runtime->SaveState();
-
- m_window->resetOpenGLState();
- }
-}
-
-bool Q3DSRenderer::initializeRuntime(QOpenGLFramebufferObject *inFbo)
-{
- m_runtime = &Q3DSViewerApp::Create(nullptr, new Qt3DSAudioPlayerImpl(), &m_startupTimer);
- Q_ASSERT(m_runtime);
-
- // Connect presentation ready signal before initializing the app
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigPresentationReady,
- this, &Q3DSRenderer::presentationReady);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigPresentationLoaded,
- this, &Q3DSRenderer::presentationLoaded);
-
- int theWidth = inFbo->width();
- int theHeight = inFbo->height();
-
- const QString localSource = Q3DSUtils::urlToLocalFileOrQrc(m_presentation->source());
-
- if (!m_runtime->InitializeApp(theWidth, theHeight,
- QOpenGLContext::currentContext()->format(),
- inFbo->handle(), localSource,
- m_presentation->variantList(),
- m_presentation->delayedLoading(),
- m_visitor)) {
- m_error = m_runtime->error();
- releaseRuntime();
- return false;
- }
-
- m_runtime->RegisterScriptCallback(Q3DSViewer::ViewerCallbackType::Enum::CALLBACK_ON_INIT,
- reinterpret_cast<qml_Function>(Q3DSRenderer::onInitHandler),
- this);
- m_runtime->RegisterScriptCallback(Q3DSViewer::ViewerCallbackType::Enum::CALLBACK_ON_UPDATE,
- reinterpret_cast<qml_Function>(Q3DSRenderer::onUpdateHandler),
- this);
-
- m_settings->d_ptr->setViewerApp(m_runtime);
- m_presentation->d_ptr->setViewerApp(m_runtime, false);
-
- // Connect signals
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigSlideEntered,
- this, &Q3DSRenderer::enterSlide);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigSlideExited,
- this, &Q3DSRenderer::exitSlide);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigCustomSignal,
- this, &Q3DSRenderer::customSignalEmitted);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigElementsCreated,
- this, &Q3DSRenderer::elementsCreated);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigMaterialsCreated,
- this, &Q3DSRenderer::materialsCreated);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigMeshesCreated,
- this, &Q3DSRenderer::meshesCreated);
- connect(m_runtime, &Q3DSViewer::Q3DSViewerApp::SigDataOutputValueUpdated,
- this, &Q3DSRenderer::dataOutputValueUpdated);
-
- return true;
-}
-
-/** Accept user commands (e.g. setAttribute) needed to initialize the code.
- *
- * If we attempt to run Qt3DS methods like setAttribute() before the runtime
- * has been initialized, they will be lost. This method is the correct place
- * to accept user commands.
- *
- * Currently this method just sets a flag needed to pass a flag to the
- * plugin next time syncronize() is called, which eventually gets the plugin
- * to emit an `runningChanged` signal the next time `tick()` is called.
- * As a result, code specified in an `onRunningChanged` handler may be run
- * after one or more frames have already rendered.
- */
-void Q3DSRenderer::onInitHandler(void *userData)
-{
- Q3DSRenderer *theRenderer = static_cast<Q3DSRenderer *>(userData);
- theRenderer->setInitElements(true);
-}
-
-/** Accept the latest pending user commands (e.g. setAttribute).
- *
- * This method just calls `ProcessCommands` to avoid unnecessary
- * pointer dereferencing and accessor methods (or public member variables).
- */
-void Q3DSRenderer::onUpdateHandler(void *userData)
-{
- Q3DSRenderer *theRenderer = static_cast<Q3DSRenderer *>(userData);
- theRenderer->processCommands();
-}
-
-/** Apply commands queued up by the user (e.g. setAttribute).
- *
- * Note that these commands are executed even if the plugin is not visible,
- * in part to allow changes to the visible flag to be noticed, but also
- * to allow specialty code to continue to be queued up even when not rendering.
- */
-void Q3DSRenderer::processCommands()
-{
- if (!m_runtime) {
- m_commands.clear(true);
- return;
- }
-
- if (m_commands.m_visibleChanged)
- m_visibleFlag = m_commands.m_visible;
-
- if (QOpenGLFramebufferObject *inFbo = this->framebufferObject()) {
- if (inFbo->isValid() && (inFbo->width() != m_runtime->GetWindowWidth()
- || inFbo->height() != m_runtime->GetWindowHeight())) {
- m_runtime->Resize(inFbo->width(), inFbo->height());
- }
- }
-
- if (m_commands.m_scaleModeChanged)
- m_settings->setScaleMode(m_commands.m_scaleMode);
- if (m_commands.m_shadeModeChanged)
- m_settings->setShadeMode(m_commands.m_shadeMode);
- if (m_commands.m_matteColorChanged)
- m_settings->setMatteColor(m_commands.m_matteColor);
- if (m_commands.m_showRenderStatsChanged)
- m_settings->setShowRenderStats(m_commands.m_showRenderStats);
- if (m_commands.m_delayedLoadingChanged)
- this->m_runtime->setDelayedLoading(m_commands.m_delayedLoading);
-
- if (m_commands.m_globalAnimationTimeChanged)
- m_presentation->setGlobalAnimationTime(m_commands.m_globalAnimationTime);
-
- // Send scene graph changes over to Q3DS
- for (int i = 0; i < m_commands.size(); i++) {
- const ElementCommand &cmd = m_commands.constCommandAt(i);
- switch (cmd.m_commandType) {
- case CommandType_SetAttribute:
- m_presentation->setAttribute(cmd.m_elementPath, cmd.m_stringValue, cmd.m_variantValue);
- break;
- case CommandType_SetPresentationActive:
- m_presentation->setPresentationActive(cmd.m_elementPath, cmd.m_boolValue);
- break;
- case CommandType_GoToTime:
- m_presentation->goToTime(cmd.m_elementPath, cmd.m_floatValue);
- break;
- case CommandType_GoToSlide:
- m_presentation->goToSlide(cmd.m_elementPath, cmd.m_intValues[0]);
- break;
- case CommandType_GoToSlideByName:
- m_presentation->goToSlide(cmd.m_elementPath, cmd.m_stringValue);
- break;
- case CommandType_GoToSlideRelative:
- m_presentation->goToSlide(cmd.m_elementPath, bool(cmd.m_intValues[0]),
- bool(cmd.m_intValues[1]));
- break;
- case CommandType_FireEvent:
- m_presentation->fireEvent(cmd.m_elementPath, cmd.m_stringValue);
- break;
- case CommandType_MousePress:
- m_runtime->HandleMousePress(cmd.m_intValues[0],
- cmd.m_intValues[1], cmd.m_intValues[2], true);
- break;
- case CommandType_MouseRelease:
- m_runtime->HandleMousePress(cmd.m_intValues[0],
- cmd.m_intValues[1], cmd.m_intValues[2], false);
- break;
- case CommandType_MouseMove:
- m_runtime->HandleMouseMove(cmd.m_intValues[0], cmd.m_intValues[1], true);
- break;
- case CommandType_MouseWheel:
- m_runtime->HandleMouseWheel(cmd.m_intValues[0], cmd.m_intValues[1],
- bool(cmd.m_intValues[2]), cmd.m_intValues[3]);
- break;
- case CommandType_KeyPress:
- m_runtime->HandleKeyInput(Q3DStudio::EKeyCode(cmd.m_intValues[0]), true);
- break;
- case CommandType_KeyRelease:
- m_runtime->HandleKeyInput(Q3DStudio::EKeyCode(cmd.m_intValues[0]), false);
- break;
- case CommandType_SetDataInputValue:
- m_runtime->SetDataInputValue(
- cmd.m_stringValue, cmd.m_variantValue,
- static_cast<qt3ds::runtime::DataInputValueRole>(cmd.m_intValues[0]));
- break;
- case CommandType_CreateElements: {
- m_runtime->createElements(
- cmd.m_elementPath, cmd.m_stringValue,
- *static_cast<QVector<QHash<QString, QVariant>> *>(cmd.m_data));
- // Runtime makes copy of the data in its own format, so we can delete it now
- auto &command = m_commands.commandAt(i);
- delete reinterpret_cast<QVector<QHash<QString, QVariant>> *>(command.m_data);
- command.m_data = nullptr;
- break;
- }
- case CommandType_DeleteElements: {
- m_runtime->deleteElements(*static_cast<QStringList *>(cmd.m_data));
- // Runtime makes copy of the data in its own format, so we can delete it now
- auto &command = m_commands.commandAt(i);
- delete reinterpret_cast<QStringList *>(command.m_data);
- command.m_data = nullptr;
- break;
- }
- case CommandType_CreateMaterials: {
- m_runtime->createMaterials(cmd.m_elementPath, *static_cast<QStringList *>(cmd.m_data));
- // Runtime makes copy of the data in its own format, so we can delete it now
- auto &command = m_commands.commandAt(i);
- delete reinterpret_cast<QStringList *>(command.m_data);
- command.m_data = nullptr;
- break;
- }
- case CommandType_DeleteMaterials: {
- m_runtime->deleteMaterials(cmd.m_elementPath, *static_cast<QStringList *>(cmd.m_data));
- // Runtime makes copy of the data in its own format, so we can delete it now
- auto &command = m_commands.commandAt(i);
- delete reinterpret_cast<QStringList *>(command.m_data);
- command.m_data = nullptr;
- break;
- }
- case CommandType_CreateMeshes: {
- m_runtime->createMeshes(*static_cast<QHash<QString, Q3DSViewer::MeshData> *>(
- cmd.m_data));
- // Runtime makes copy of the data, so we can delete it now
- auto &command = m_commands.commandAt(i);
- auto meshData = reinterpret_cast<QHash<QString, Q3DSViewer::MeshData> *>(
- command.m_data);
- delete meshData;
- command.m_data = nullptr;
- break;
- }
- case CommandType_DeleteMeshes: {
- m_runtime->deleteMeshes(*static_cast<QStringList *>(cmd.m_data));
- // Runtime makes copy of the data in its own format, so we can delete it now
- auto &command = m_commands.commandAt(i);
- delete reinterpret_cast<QStringList *>(command.m_data);
- command.m_data = nullptr;
- break;
- }
- case CommandType_RequestSlideInfo: {
- int current = 0;
- int previous = 0;
- QString currentName;
- QString previousName;
- const QByteArray path(cmd.m_elementPath.toUtf8());
- m_runtime->GetSlideInfo(path, current, previous, currentName, previousName);
- QVariantList *requestData = new QVariantList();
- requestData->append(QVariant(current));
- requestData->append(QVariant(previous));
- requestData->append(QVariant(currentName));
- requestData->append(QVariant(previousName));
-
- Q_EMIT requestResponse(cmd.m_elementPath, cmd.m_commandType, requestData);
-
- break;
- }
- case CommandType_RequestDataInputs: {
- QVariantList *requestData = new QVariantList();
- if (m_runtime) {
- const auto diList = m_runtime->dataInputs();
-
- for (const auto &it : diList) {
- Q3DSDataInput *newIt = new Q3DSDataInput(it, nullptr);
- newIt->d_ptr->m_max = m_runtime->dataInputMax(it);
- newIt->d_ptr->m_min = m_runtime->dataInputMin(it);
-
- requestData->append(QVariant::fromValue(newIt));
- }
- }
-
- Q_EMIT requestResponse(cmd.m_elementPath, cmd.m_commandType, requestData);
- break;
- }
- case CommandType_RequestDataOutputs: {
- QVariantList *requestData = new QVariantList();
- if (m_presentation) {
- const auto diList = m_presentation->dataOutputs();
-
- for (const auto &it : diList)
- requestData->append(QVariant::fromValue(it->name()));
- }
-
- Q_EMIT requestResponse(cmd.m_elementPath, cmd.m_commandType, requestData);
- break;
- }
- case CommandType_PreloadSlide:
- m_runtime->preloadSlide(cmd.m_elementPath);
- break;
- case CommandType_UnloadSlide:
- m_runtime->unloadSlide(cmd.m_elementPath);
- break;
- default:
- qWarning() << __FUNCTION__ << "Unrecognized CommandType in command list!";
- }
- }
-
- m_commands.clear(false);
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer_p.h b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer_p.h
deleted file mode 100644
index 6d044ff7..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsrenderer_p.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (c) 2016 NVIDIA CORPORATION.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_RENDERER_H
-#define Q3DS_RENDERER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtGui/qopenglframebufferobject.h>
-#include <QtQuick/qquickframebufferobject.h>
-
-#include "Qt3DSViewerApp.h"
-#include "q3dsstudio3d_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSViewerSettings;
-class Q3DSPresentation;
-
-class Q3DSRenderer : public QObject,
- public QQuickFramebufferObject::Renderer
-{
- Q_OBJECT
-
-public:
- Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisitor);
- ~Q3DSRenderer();
-
- QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override;
-
- void setInitElements(bool inFlag) { m_initElements = inFlag; }
- void processCommands();
-
-Q_SIGNALS:
- void enterSlide(const QString &elementPath, unsigned int slide, const QString &slideName);
- void exitSlide(const QString &elementPath, unsigned int slide, const QString &slideName);
- void requestResponse(const QString &elementPath, CommandType commandType, void *requestData);
- void presentationReady();
- void presentationLoaded();
- void customSignalEmitted(const QString &elNmentPath, const QString &name);
- void elementsCreated(const QStringList &elementPaths, const QString &error);
- void materialsCreated(const QStringList &materialNames, const QString &error);
- void meshesCreated(const QStringList &meshNames, const QString &error);
- void dataOutputValueUpdated(const QString &name, const QVariant &newValue);
-
-protected:
- static void onInitHandler(void *userData);
- static void onUpdateHandler(void *userData);
- bool initializeRuntime(QOpenGLFramebufferObject *inFbo);
- void draw();
- void render() override;
- void synchronize(QQuickFramebufferObject *inView) override;
- void releaseRuntime();
-
-protected:
- bool m_visibleFlag; // Is the plugin visible? Prevents rendering hidden content.
- CommandQueue m_commands; // A list of commands retrieved by the plugin to be applied.
- bool m_initElements; // Flag set when the runtime is first ready to render.
- Q3DSViewer::Q3DSViewerApp *m_runtime; // The Qt3DS viewer that renders all content.
- QQuickWindow *m_window; // Window associated with the plugin; needed to reset OpenGL state.
-
- bool m_initialized; // Has the runtime and OpenGL state been initialized?
- bool m_initializationFailure; // Initialization failed, no point in trying to init again
- qt3ds::Qt3DSAssetVisitor *m_visitor;
-
- Q3DSViewerSettings *m_settings;
- Q3DSPresentation *m_presentation;
- QString m_error;
- QElapsedTimer m_startupTimer;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DS_RENDERER_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d.cpp b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d.cpp
deleted file mode 100644
index 3d48babc..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-/****************************************************************************
-**
-** Copyright (c) 2016 NVIDIA CORPORATION.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsstudio3d_p.h"
-#include "q3dsrenderer_p.h"
-#include "q3dspresentationitem_p.h"
-
-#include <QtStudio3D/private/q3dsviewersettings_p.h>
-#include <QtStudio3D/private/q3dspresentation_p.h>
-#include <QtStudio3D/private/q3dssceneelement_p.h>
-#include <QtStudio3D/private/viewerqmlstreamproxy_p.h>
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qfileinfo.h>
-#include <QtQuick/qquickwindow.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype Studio3D
- \instantiates Q3DSStudio3D
- \inqmlmodule QtStudio3D
- \ingroup OpenGLRuntime
- \inherits Item
- \keyword Studio3D
-
- \brief Qt 3D Studio presentation viewer.
-
- This type enables developers to embed Qt 3D Studio presentations in Qt
- Quick.
-
- \section2 Example Usage
-
- \qml
- Studio3D {
- id: studio3D
- anchors.fill: parent
-
- Presentation {
- source: "qrc:///presentation.uia"
- SceneElement {
- id: scene
- elementPath: "Scene"
- currentSlideIndex: 2
- }
- Element {
- id: textLabel
- elementPath: "Scene.Layer.myLabel"
- }
- }
- ViewerSettings {
- showRenderStats: true
- }
- onRunningChanged: {
- console.log("Presentation ready!");
- }
- }
- \endqml
-
- \section2 Controlling the presentation
-
- Like the example above suggests, Studio3D and the other types under the
- QtStudio3D import offer more than simply rendering the animated Qt 3D
- Studio presentation. They also offer scene manipulation, including
-
- \list
-
- \li querying and changing scene object properties (for example, the
- transform of a model, colors and other settings of a material, etc.) via
- Presentation::getAttribute(), Presentation::setAttribute(), \l Element, and
- \l DataInput,
-
- \li changing slides (and thus starting the relevant animations and applying
- the scene object property changes associated with the new slide) via
- Presentation::goToSlide(), \l SceneElement, and \l DataInput,
-
- \li and controlling the timeline (the current playback position for the
- key-frame based animations) both on the main scene and on individual
- Component nodes via Presentation::goToTime(), \l SceneElement, and \l DataInput.
-
- \endlist
-
- \sa Presentation
-*/
-
-/*!
- \qmlsignal Studio3D::frameUpdate()
-
- This signal is emitted each time a frame has been rendered.
-*/
-
-/*!
- \qmlsignal Studio3D::presentationLoaded()
-
- This signal is emitted when the presentation has been loaded and is ready
- to be shown.
-*/
-
-/*!
- \qmlsignal Studio3D::presentationReady()
-
- This signal is emitted when the presentation has fully initialized its 3D
- scene for the first frame.
-
- The difference to presentationLoaded() is that this signal is emitted only
- when the asynchronous operations needed to build to 3D scene and the first
- frame have completed.
-
- When implementing splash screens via Loader items and the Item::visible
- property, this is the signal that should be used to trigger hiding the
- splash screen.
-*/
-
-Q3DSStudio3D::Q3DSStudio3D()
- : m_viewerSettings(nullptr)
- , m_presentation(nullptr)
- , m_emitRunningChange(false)
- , m_isRunning(false)
- , m_eventIgnoreFlags(EnableAllEvents)
- , m_pixelRatio(1.0)
-{
- setMirrorVertically(true);
- connect(this, &Q3DSStudio3D::windowChanged, this, &Q3DSStudio3D::handleWindowChanged);
- connect(this, &Q3DSStudio3D::visibleChanged, this, &Q3DSStudio3D::handleVisibleChanged);
-
- updateEventMasks();
-}
-
-Q3DSStudio3D::~Q3DSStudio3D()
-{
-}
-
-/*!
- \qmlproperty Presentation Studio3D::presentation
-
- Accessor for the presentation. Applications are expected to create a single
- Presentation child object for Studio3D. If this is omitted, a presentation
- is created automatically.
-
- This property is read-only.
-*/
-Q3DSPresentationItem *Q3DSStudio3D::presentation() const
-{
- return m_presentation;
-}
-
-// #TODO: QT3DS-3566 viewerSettings is missing documentation
-/*!
- \qmlproperty ViewerSettings Studio3D::viewerSettings
-
- This property is read-only.
-*/
-Q3DSViewerSettings *Q3DSStudio3D::viewerSettings() const
-{
- return m_viewerSettings;
-}
-
-/*!
- \qmlproperty string Studio3D::error
-
- Contains the text for the error message that was generated during the
- loading of the presentation. When no error occurred or there is no
- presentation loaded, the value is an empty string.
-
- This property is read-only.
-*/
-QString Q3DSStudio3D::error() const
-{
- return m_error;
-}
-
-void Q3DSStudio3D::setError(const QString &error)
-{
- if (error != m_error) {
- m_error = error;
- Q_EMIT errorChanged(m_error);
- }
-}
-
-/*!
- \qmlproperty EventIgnoreFlags Studio3D::ignoredEvents
-
- This property can be used to ignore mouse/wheel/keyboard events.
- By default all events are enabled.
-*/
-
-Q3DSStudio3D::EventIgnoreFlags Q3DSStudio3D::ignoredEvents() const
-{
- return m_eventIgnoreFlags;
-}
-
-void Q3DSStudio3D::setIgnoredEvents(EventIgnoreFlags flags)
-{
- if (m_eventIgnoreFlags == flags)
- return;
-
- m_eventIgnoreFlags = flags;
- updateEventMasks();
- Q_EMIT ignoredEventsChanged();
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::updateEventMasks()
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreMouseEvents)) {
- setAcceptedMouseButtons(Qt::NoButton);
- setAcceptHoverEvents(false);
- } else {
- setAcceptedMouseButtons(Qt::MouseButtonMask);
- setAcceptHoverEvents(true);
- }
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::componentComplete()
-{
- const auto childObjs = children();
- for (QObject *child : childObjs) {
- auto settings = qobject_cast<Q3DSViewerSettings *>(child);
- if (settings) {
- if (m_viewerSettings)
- qWarning("Duplicate ViewerSettings defined for Studio3D.");
- else
- m_viewerSettings = settings;
- }
- auto presentation = qobject_cast<Q3DSPresentationItem *>(child);
- if (presentation) {
- if (m_presentation)
- qWarning("Duplicate Presentation defined for Studio3D.");
- else
- m_presentation = presentation;
- }
- }
- if (!m_viewerSettings)
- m_viewerSettings = new Q3DSViewerSettings(this);
- if (!m_presentation)
- m_presentation = new Q3DSPresentationItem(this);
-
- m_viewerSettings->d_ptr->setCommandQueue(&m_pendingCommands);
- m_presentation->d_ptr->setCommandQueue(&m_pendingCommands);
-
- // Ensure qml stream proxy gets created on main thread
- m_presentation->d_ptr->streamProxy();
-
- QQuickFramebufferObject::componentComplete();
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::handleWindowChanged(QQuickWindow *window)
-{
- if (!window)
- return;
-
- window->setClearBeforeRendering(false);
- m_pixelRatio = window->devicePixelRatio();
-
- // Call tick every frame of the GUI thread to notify QML about new frame via frameUpdate signal
- connect(window, &QQuickWindow::afterAnimating, this, &Q3DSStudio3D::tick);
- // Call update after the frame is handled to queue another frame
- connect(window, &QQuickWindow::afterSynchronizing, this, &Q3DSStudio3D::update);
-}
-
-/*!
- \internal
- Queue up a command to inform the renderer of a newly-changed visible/hidden status.
- */
-void Q3DSStudio3D::handleVisibleChanged()
-{
- m_pendingCommands.m_visibleChanged = true;
- m_pendingCommands.m_visible = isVisible();
-}
-
-/*!
- \brief internal
- */
-void Q3DSStudio3D::reset()
-{
- // Fake a source change to trigger a reloading of the presentation
- m_pendingCommands.m_sourceChanged = true;
- m_pendingCommands.m_source = m_presentation->source();
- m_pendingCommands.m_variantListChanged = true;
- m_pendingCommands.m_variantList = m_presentation->variantList();
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::requestResponseHandler(const QString &elementPath, CommandType commandType,
- void *requestData)
-{
- switch (commandType) {
- case CommandType_RequestSlideInfo: {
- Q3DSSceneElement *handler = qobject_cast<Q3DSSceneElement *>(
- m_presentation->registeredElement(elementPath));
- if (handler)
- handler->d_ptr->requestResponseHandler(commandType, requestData);
- else
- qWarning() << __FUNCTION__ << "RequestSlideInfo response got for unregistered scene.";
- break;
- }
- case CommandType_RequestDataInputs: {
- Q3DSPresentation *handler = qobject_cast<Q3DSPresentation *>(m_presentation);
- if (handler) {
- handler->d_ptr->requestResponseHandler(commandType, requestData);
- } else {
- qWarning() << __FUNCTION__
- << "RequestDataInputs response got for invalid presentation.";
- }
- break;
- }
- case CommandType_RequestDataOutputs: {
- Q3DSPresentation *handler = qobject_cast<Q3DSPresentation *>(m_presentation);
- if (handler) {
- handler->d_ptr->requestResponseHandler(commandType, requestData);
- } else {
- qWarning() << __FUNCTION__
- << "RequestDataOutputs response got for invalid presentation.";
- }
- break;
- }
- default:
- qWarning() << __FUNCTION__ << "Unknown command type.";
- break;
- }
-}
-
-/*!
- \internal
- Create the Q3DSRenderer. Invoked automatically by the QML scene graph.
- */
-QQuickFramebufferObject::Renderer *Q3DSStudio3D::createRenderer() const
-{
- // It is "illegal" to create a connection between the renderer
- // and the plugin, and vice-versa. The only valid time the two
- // may communicate is during Q3DSRenderer::synchronize().
- Q3DSRenderer *renderer = new Q3DSRenderer(isVisible(), m_presentation->d_ptr->streamProxy());
-
- connect(renderer, &Q3DSRenderer::enterSlide,
- m_presentation->d_ptr, &Q3DSPresentationPrivate::handleSlideEntered);
- connect(renderer, &Q3DSRenderer::dataOutputValueUpdated,
- m_presentation->d_ptr, &Q3DSPresentationPrivate::handleDataOutputValueUpdate);
- connect(renderer, &Q3DSRenderer::exitSlide,
- m_presentation, &Q3DSPresentation::slideExited);
- connect(renderer, &Q3DSRenderer::customSignalEmitted,
- m_presentation, &Q3DSPresentation::customSignalEmitted);
- connect(renderer, &Q3DSRenderer::elementsCreated,
- m_presentation, &Q3DSPresentation::elementsCreated);
- connect(renderer, &Q3DSRenderer::materialsCreated,
- m_presentation, &Q3DSPresentation::materialsCreated);
- connect(renderer, &Q3DSRenderer::meshesCreated,
- m_presentation, &Q3DSPresentation::meshesCreated);
- connect(renderer, &Q3DSRenderer::requestResponse,
- this, &Q3DSStudio3D::requestResponseHandler);
- connect(renderer, &Q3DSRenderer::presentationLoaded,
- this, &Q3DSStudio3D::presentationLoaded);
- connect(renderer, &Q3DSRenderer::presentationReady,
- this, &Q3DSStudio3D::presentationReady);
- return renderer;
-}
-
-/*!
- \qmlproperty bool Studio3D::running
-
- The value of this property is \c true when the presentation has been loaded
- and is ready to be shown.
-
- This property is read-only.
-*/
-bool Q3DSStudio3D::isRunning() const
-{
- return m_isRunning;
-}
-
-/*!
- \internal
- Emit QML `runningChanged` and `frameUpdate` and signals.
- This method is called every frame, and emits the `frameUpdate` signal every frame,
- regardless of plugin visibility. This allows a hidden Qt3DSView to still process
- information every frame, even though the Renderer is not rendering.
-
- To prevent expensive onFrameUpdate handlers from being processed when hidden,
- add an early return to the top like:
-
- onFrameUpdate: {
- if (!visible) return;
- ...
- }
- */
-void Q3DSStudio3D::tick()
-{
- if (m_emitRunningChange) {
- m_isRunning = true;
- Q_EMIT runningChanged(true);
- m_emitRunningChange = false;
- }
-
- // Don't call onFrameUpdate until after onInitialize has been called
- if (m_isRunning) {
- // Give QML an opportunity to change Qt3DS values every frame
- Q_EMIT frameUpdate();
- }
-}
-
-/*!
- \internal
- Copies the list of commands previously queued up. Called by Q3DSRenderer::synchronize().
- */
-void Q3DSStudio3D::getCommands(bool emitInitialize, CommandQueue &renderQueue)
-{
- if (emitInitialize)
- m_emitRunningChange = true;
-
- renderQueue.copyCommands(m_pendingCommands);
- m_pendingCommands.clear(false);
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::mousePressEvent(QMouseEvent *event)
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreMouseEvents))
- return;
-
- if (m_pixelRatio != 1.0) {
- QMouseEvent scaledEvent(event->type(), event->pos() * m_pixelRatio,
- event->button(), event->buttons(), event->modifiers());
- m_presentation->mousePressEvent(&scaledEvent);
- } else {
- m_presentation->mousePressEvent(event);
- }
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::mouseReleaseEvent(QMouseEvent *event)
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreMouseEvents))
- return;
-
- if (m_pixelRatio != 1.0) {
- QMouseEvent scaledEvent(event->type(), event->pos() * m_pixelRatio,
- event->button(), event->buttons(), event->modifiers());
- m_presentation->mouseReleaseEvent(&scaledEvent);
- } else {
- m_presentation->mouseReleaseEvent(event);
- }
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::mouseMoveEvent(QMouseEvent *event)
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreMouseEvents))
- return;
-
- if (m_pixelRatio != 1.0) {
- QMouseEvent scaledEvent(event->type(), event->pos() * m_pixelRatio,
- event->button(), event->buttons(), event->modifiers());
- m_presentation->mouseMoveEvent(&scaledEvent);
- } else {
- m_presentation->mouseMoveEvent(event);
- }
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::wheelEvent(QWheelEvent *event)
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreWheelEvents))
- return;
-
- m_presentation->wheelEvent(event);
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::keyPressEvent(QKeyEvent *event)
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreKeyboardEvents))
- return;
-
- m_presentation->keyPressEvent(event);
-}
-
-/*!
- \internal
- */
-void Q3DSStudio3D::keyReleaseEvent(QKeyEvent *event)
-{
- if (m_eventIgnoreFlags.testFlag(IgnoreKeyboardEvents))
- return;
-
- if (!event->isAutoRepeat())
- m_presentation->keyReleaseEvent(event);
-}
-
-QT_END_NAMESPACE
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d_p.h b/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d_p.h
deleted file mode 100644
index eed8459a..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/q3dsstudio3d_p.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (c) 2016 NVIDIA CORPORATION.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_STUDIO3D_H
-#define Q3DS_STUDIO3D_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the QtStudio3D API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtStudio3D/private/q3dscommandqueue_p.h>
-#include <QtGui/qopenglframebufferobject.h>
-#include <QtQuick/qquickframebufferobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSRenderer;
-class Q3DSViewerSettings;
-class Q3DSPresentationItem;
-
-class Q3DSStudio3D : public QQuickFramebufferObject
-{
- Q_OBJECT
- Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
- Q_PROPERTY(Q3DSPresentationItem *presentation READ presentation CONSTANT)
- Q_PROPERTY(Q3DSViewerSettings *viewerSettings READ viewerSettings CONSTANT)
- Q_PROPERTY(QString error READ error NOTIFY errorChanged)
- Q_PROPERTY(EventIgnoreFlags ignoredEvents READ ignoredEvents WRITE setIgnoredEvents NOTIFY ignoredEventsChanged)
-
-public:
- enum EventIgnoreFlag {
- EnableAllEvents = 0,
- IgnoreMouseEvents = 0x01,
- IgnoreWheelEvents = 0x02,
- IgnoreKeyboardEvents = 0x04,
- IgnoreAllInputEvents = IgnoreMouseEvents | IgnoreWheelEvents | IgnoreKeyboardEvents
- };
- Q_DECLARE_FLAGS(EventIgnoreFlags, EventIgnoreFlag)
- Q_FLAG(EventIgnoreFlags)
-
- Q3DSStudio3D();
- ~Q3DSStudio3D() override;
-
- QQuickFramebufferObject::Renderer *createRenderer() const override;
-
- bool isRunning() const;
- Q3DSPresentationItem *presentation() const;
- Q3DSViewerSettings *viewerSettings() const;
- QString error() const;
- void setError(const QString &error);
-
- void getCommands(bool emitInitialize, CommandQueue &renderQueue);
-
- void mousePressEvent(QMouseEvent *event) override;
- void mouseReleaseEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) override;
- void wheelEvent(QWheelEvent *event) override;
- void keyPressEvent(QKeyEvent *event) override;
- void keyReleaseEvent(QKeyEvent *event) override;
-
- EventIgnoreFlags ignoredEvents() const;
- void setIgnoredEvents(EventIgnoreFlags flags);
-
- void componentComplete() override;
-
-Q_SIGNALS:
- void frameUpdate();
- void runningChanged(bool initialized);
- void errorChanged(const QString &error);
- void ignoredEventsChanged();
- void presentationReady();
- void presentationLoaded();
-
-public Q_SLOTS:
- void reset();
-
-protected Q_SLOTS:
- void handleWindowChanged(QQuickWindow *window);
- void handleVisibleChanged();
- void tick();
- void requestResponseHandler(const QString &elementPath, CommandType commandType,
- void *requestData);
-private:
- void updateEventMasks();
-
-protected:
- Q3DSViewerSettings *m_viewerSettings;
- Q3DSPresentationItem *m_presentation;
-
- bool m_emitRunningChange;
- bool m_isRunning;
- EventIgnoreFlags m_eventIgnoreFlags;
-
- CommandQueue m_pendingCommands;
- qreal m_pixelRatio;
- QString m_error;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(Q3DSStudio3D::EventIgnoreFlags)
-
-QT_END_NAMESPACE
-
-#endif // Q3DS_STUDIO3D_H
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/qmldir b/src/Runtime/ogl-runtime/src/api/studio3dqml/qmldir
deleted file mode 100644
index 1eaa8f2b..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module QtStudio3D.OpenGL
-plugin declarative_qtstudio3dopengl
-classname Q3DSPlugin
diff --git a/src/Runtime/ogl-runtime/src/api/studio3dqml/studio3dqml.pro b/src/Runtime/ogl-runtime/src/api/studio3dqml/studio3dqml.pro
deleted file mode 100644
index b62a3424..00000000
--- a/src/Runtime/ogl-runtime/src/api/studio3dqml/studio3dqml.pro
+++ /dev/null
@@ -1,34 +0,0 @@
-include($$PWD/../../commoninclude.pri)
-
-QT += qml quick opengl studio3d-private
-CONFIG += plugin
-
-qtHaveModule(multimedia) {
-DEFINES += PLATFORM_HAS_QT_MULTIMEDIA_LIB
-QT += multimedia
-}
-
-TARGET = qtstudio3dopengl
-TARGETPATH = QtStudio3D/OpenGL
-IMPORT_VERSION = 2.4
-
-SOURCES += \
- q3dsplugin.cpp \
- q3dsstudio3d.cpp \
- q3dsrenderer.cpp \
- q3dspresentationitem.cpp
-
-HEADERS += \
- q3dsplugin.h \
- q3dsrenderer_p.h \
- q3dsstudio3d_p.h \
- q3dspresentationitem_p.h
-
-LIBS += \
- -lqt3dsopengl$$qtPlatformTargetSuffix() \
- -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
-
-OTHER_FILES += \
- qmldir
-
-load(qml_plugin)
diff --git a/src/Runtime/ogl-runtime/src/commoninclude.pri b/src/Runtime/ogl-runtime/src/commoninclude.pri
deleted file mode 100644
index 13925a3b..00000000
--- a/src/Runtime/ogl-runtime/src/commoninclude.pri
+++ /dev/null
@@ -1 +0,0 @@
-include($$PWD/../commoninclude.pri)
diff --git a/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerCustomMaterialParser.h b/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerCustomMaterialParser.h
deleted file mode 100644
index 47a8092d..00000000
--- a/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerCustomMaterialParser.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2002 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef DOCUMENTRESOURCEMANAGERCUSTOMMATERIALPARSERH
-#define DOCUMENTRESOURCEMANAGERCUSTOMMATERIALPARSERH
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-#include "Qt3DSDMXML.h"
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSDMWStrOpsImpl.h"
-#include "foundation/StrConvertUTF.h"
-#include <EASTL/string.h>
-#include "Qt3DSRenderInputStreamFactory.h"
-
-namespace Q3DStudio {
-struct CCustomMaterialParser
-{
-
- static bool NavigateToMetadata(std::shared_ptr<qt3dsdm::IDOMReader> inReader)
- {
- return inReader->MoveToFirstChild("MetaData");
- }
-
- static std::shared_ptr<qt3dsdm::IDOMReader>
- ParseFile(std::shared_ptr<qt3dsdm::IDOMFactory> inFactory,
- std::shared_ptr<qt3dsdm::IStringTable> inStringTable, const char8_t *inFileData,
- qt3dsdm::CXmlErrorHandler &inErrorHandler,
- qt3ds::render::IInputStreamFactory &inStreamFactory)
- {
- using namespace qt3ds;
- using namespace qt3ds::foundation;
-
- NVScopedRefCounted<qt3ds::render::IRefCountedInputStream> theStream(
- inStreamFactory.GetStreamForFile(inFileData));
- if (!theStream) {
- QT3DS_ASSERT(0);
- return std::shared_ptr<qt3dsdm::IDOMReader>();
- }
-
- qt3dsdm::SDOMElement *theElem(
- qt3dsdm::CDOMSerializer::Read(*inFactory, *theStream, &inErrorHandler));
-
- if (theElem == NULL) {
- return std::shared_ptr<qt3dsdm::IDOMReader>();
- } else
- return qt3dsdm::IDOMReader::CreateDOMReader(*theElem, inStringTable, inFactory);
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerRenderPluginParser.h b/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerRenderPluginParser.h
deleted file mode 100644
index e3eee1cf..00000000
--- a/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerRenderPluginParser.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2002 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef DOCUMENTRESOURCEMANAGERRENDERPLUGINPARSERH
-#define DOCUMENTRESOURCEMANAGERRENDERPLUGINPARSERH
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-#include "Qt3DSDMXML.h"
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSDMWStrOpsImpl.h"
-#include "foundation/StrConvertUTF.h"
-#include <EASTL/string.h>
-#include "Qt3DSRenderInputStreamFactory.h"
-
-namespace Q3DStudio {
-struct CRenderPluginParser
-{
-
- static bool NavigateToMetadata(std::shared_ptr<qt3dsdm::IDOMReader> inReader)
- {
- return inReader->MoveToFirstChild("metadata");
- }
-
- static std::shared_ptr<qt3dsdm::IDOMReader>
- ParseFile(std::shared_ptr<qt3dsdm::IDOMFactory> inFactory,
- std::shared_ptr<qt3dsdm::IStringTable> inStringTable, const char8_t *inFileData,
- qt3dsdm::CXmlErrorHandler &inErrorHandler,
- qt3ds::render::IInputStreamFactory &inStreamFactory)
- {
- using namespace qt3ds;
- using namespace qt3ds::foundation;
-
- NVScopedRefCounted<qt3ds::render::IRefCountedInputStream> theStream(
- inStreamFactory.GetStreamForFile(inFileData));
- if (!theStream) {
- QT3DS_ASSERT(0);
- return std::shared_ptr<qt3dsdm::IDOMReader>();
- }
-
- qt3dsdm::SDOMElement *theElem(
- qt3dsdm::CDOMSerializer::Read(*inFactory, *theStream, &inErrorHandler));
-
- if (theElem == NULL) {
- return std::shared_ptr<qt3dsdm::IDOMReader>();
- } else
- return qt3dsdm::IDOMReader::CreateDOMReader(*theElem, inStringTable, inFactory);
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerScriptParser.h b/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerScriptParser.h
deleted file mode 100644
index 4c2ce437..00000000
--- a/src/Runtime/ogl-runtime/src/datamodel/DocumentResourceManagerScriptParser.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DOCUMENTRESOURCEMANAGERSCRIPTPARSER_H
-#define DOCUMENTRESOURCEMANAGERSCRIPTPARSER_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-#include "Qt3DSDMXML.h"
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-
-namespace Q3DStudio {
-namespace ScriptParser {
-
- using namespace qt3dsdm;
- using namespace Q3DStudio;
-
- struct StringInStream : qt3ds::foundation::IInStream
- {
- const QString &m_String;
- QT3DSU32 m_Offset;
-
- StringInStream(const QString &str)
- : m_String(str)
- , m_Offset(0)
- {
- }
-
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- std::string str = m_String.toUtf8().constData();
- const char *theStart((const char *)str.c_str());
- const char *theEnd(theStart + str.size());
-
- QT3DSU32 amountLeft = QT3DSU32(theEnd - theStart) - m_Offset;
- QT3DSU32 amountToRead = qt3ds::NVMin(data.size(), amountLeft);
- qt3ds::intrinsics::memCopy(data.begin(), theStart + m_Offset, amountToRead);
- m_Offset += amountToRead;
- return amountToRead;
- }
- };
-
- struct SScriptParser
- {
- static std::shared_ptr<IDOMReader>
- ParseScriptFile(std::shared_ptr<IDOMFactory> factory,
- std::shared_ptr<qt3dsdm::IStringTable> stringTable,
- const QString &fullPath, CXmlErrorHandler &errorHandler,
- qt3ds::render::IInputStreamFactory &streamFactory)
- {
- QVector<QT3DSU8> readBuf;
- {
- using namespace qt3ds;
- using namespace qt3ds::foundation;
- eastl::string strConvert;
- NVScopedRefCounted<qt3ds::render::IRefCountedInputStream> stream(
- streamFactory.GetStreamForFile(fullPath));
- if (!stream) {
- QT3DS_ASSERT(0);
- return std::shared_ptr<IDOMReader>();
- }
-
- QT3DSU32 readLen = 0;
- do {
- uint32_t offset = readBuf.size();
- readBuf.resize(offset + 4096);
- readLen = stream->Read(NVDataRef<QT3DSU8>(&readBuf[0] + offset, 4096));
- readBuf.resize(offset + readLen);
- } while (readLen == 4096);
- }
-
- QByteArray byteArray;
- for (auto &&c : qAsConst(readBuf))
- byteArray.append(c);
-
- QString code = QString::fromUtf8(byteArray);
-
- bool skipXml = false;
- auto start = code.indexOf("/*[[");
- if (start == -1)
- skipXml = true;
-
- QString tagged("<Behavior>\n");
- if (!skipXml) {
- start += 4;
- auto end = code.indexOf("]]*/", start);
- if (end == -1)
- return std::shared_ptr<IDOMReader>();
-
- QString xml = code.mid(start, end - start).trimmed();
-
- tagged.append(xml);
- }
- tagged.append("</Behavior>\n");
- tagged.replace("\r\n", "\n");
-
- StringInStream xmlStream(tagged);
-
- SDOMElement *element(CDOMSerializer::Read(*factory, xmlStream, &errorHandler));
- if (element == NULL)
- return std::shared_ptr<IDOMReader>();
-
- return IDOMReader::CreateDOMReader(*element, stringTable, factory);
- }
- };
-}
-}
-
-#endif // DOCUMENTRESOURCEMANAGERSCRIPTPARSER_H
diff --git a/src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.cpp b/src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.cpp
deleted file mode 100644
index 89bb4de7..00000000
--- a/src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.cpp
+++ /dev/null
@@ -1,998 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSMetadata.h"
-#include "SimpleDataCore.h"
-#include "Qt3DSDMXML.h"
-#include "foundation/IOStreams.h"
-#include "Qt3DSEulerAngles.h"
-#include "Qt3DSDMWindowsCompatibility.h"
-#include "Qt3DSDMComposerTypeDefinitions.h"
-#include "DocumentResourceManagerScriptParser.h"
-#include "foundation/StrConvertUTF.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "foundation/FileTools.h"
-#include "foundation/TrackingAllocator.h"
-#include "EASTL/hash_map.h"
-#include "DocumentResourceManagerRenderPluginParser.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/StringTable.h"
-
-using qt3ds::render::IInputStreamFactory;
-using qt3ds::render::IRefCountedInputStream;
-
-using namespace qt3dsdm;
-using namespace Q3DStudio;
-
-namespace {
-
-
-struct SImportXmlErrorHandler : public CXmlErrorHandler
-{
- void OnXmlError(const QString &errorName, int line, int) override
- {
- qCCritical(INTERNAL_ERROR) << "XML error:"
- << errorName << "on line" << line;
- }
-};
-
-struct SRuntimeMetaDataPropertyInfo
-{
- ERuntimeDataModelDataType m_DataType;
- ERuntimeAdditionalMetaDataType m_AdditionalType;
- Option<SValue> m_Value;
- bool m_Exist;
- SRuntimeMetaDataPropertyInfo(ERuntimeDataModelDataType inDataType,
- ERuntimeAdditionalMetaDataType inAdditionalType,
- const Option<SValue> &inValue, bool inExist)
- : m_DataType(inDataType)
- , m_AdditionalType(inAdditionalType)
- , m_Value(inValue)
- , m_Exist(inExist)
- {
- }
- SRuntimeMetaDataPropertyInfo()
- : m_DataType(ERuntimeDataModelDataTypeNone)
- , m_AdditionalType(ERuntimeAdditionalMetaDataTypeNone)
- , m_Exist(false)
- {
- }
-};
-
-struct SPropertyKey
-{
- const char8_t *m_TypeOrId;
- const char8_t *m_PropertyName;
-
- // The character pointers are expected to have come from the string table
- // thus we can safely use their exact pointer addresses for the hash code.
- SPropertyKey(const char8_t *typeOrId, const char8_t *inPname)
- : m_TypeOrId(typeOrId)
- , m_PropertyName(inPname)
- {
- }
- bool operator==(const SPropertyKey &inOther) const
- {
- // equality comparison safe since strings are assumed to come from string table.
- return m_TypeOrId == inOther.m_TypeOrId && m_PropertyName == inOther.m_PropertyName;
- }
-};
-}
-
-namespace eastl {
-template <>
-struct hash<SPropertyKey>
-{
- size_t operator()(const SPropertyKey &inKey) const
- {
- return reinterpret_cast<size_t>(inKey.m_TypeOrId)
- ^ reinterpret_cast<size_t>(inKey.m_PropertyName);
- }
-};
-}
-
-namespace {
-
-//===========================================================================
-/**
- * @class SRuntimeMetaDataImpl
- * @brief implements the IRumtimeMetaData interface class
- */
-struct SRuntimeMetaDataImpl : public IRuntimeMetaData
-{
-
-private:
- typedef std::map<TCharStr, int> TIdToHandleMap;
- typedef eastl::hash_map<SPropertyKey, SRuntimeMetaDataPropertyInfo> TPropertyLookupHash;
-
- //==============================================================================
- // Fields
- //==============================================================================
- std::shared_ptr<qt3dsdm::IStringTable> m_StrTable;
- std::shared_ptr<IDataCore> m_DataCore;
- std::shared_ptr<IMetaData> m_NewMetaData;
- std::shared_ptr<SComposerObjectDefinitions> m_Objects;
- std::vector<TCharStr> m_TempReferences;
-
- TIdToHandleMap m_IdToHandleMap;
- // We cache properties by id or by instance so that the same query for the same value
- // will return an answer instantly instead of calling GetAggregateInstancePropertyByName which
- // is really
- // expensive.
- TPropertyLookupHash m_PropertyLookupHash;
- IInputStreamFactory &m_InputStreamFactory;
-
- // Helper to convert char to wchar_t
- eastl::basic_string<qt3ds::foundation::TWCharEASTLConverter::TCharType> m_Buf[4];
-
-public:
- static void SimpleDataModelLogger(const char *inMessage)
- {
- qCInfo(TRACE_INFO) << SRuntimeMetaDataImpl::SimpleDataModelLogger
- << inMessage;
- }
- //==============================================================================
- /**
- * Constructor
- */
- SRuntimeMetaDataImpl(IInputStreamFactory &inFactory)
- : m_InputStreamFactory(inFactory)
- {
- // Use this to enable some simple uicdm debug logging. Beware of a *lot* of log output.
- // g_DataModelDebugLogger = SimpleDataModelLogger;
- try {
- // need to pause here to hook up the debugger
- m_StrTable = qt3dsdm::IStringTable::CreateStringTable();
- m_DataCore = std::make_shared<CSimpleDataCore>(m_StrTable);
- m_NewMetaData = IMetaData::CreateNewMetaData(m_DataCore);
-
- m_Objects = std::make_shared<SComposerObjectDefinitions>(std::ref(*m_DataCore),
- std::ref(*m_NewMetaData));
- } catch (qt3dsdm::Qt3DSDMError &error) {
- qCCritical(INTERNAL_ERROR) << "SRuntimeMetaDataImpl Qt3DSDMError: "
- << m_StrTable->GetNarrowStr(error.m_Message);
- } catch (std::runtime_error &exc) {
- if (exc.what()) {
- qCCritical(INTERNAL_ERROR) << "SRuntimeMetaDataImpl std::runtime_error: "
- << exc.what();
- } else {
- qCCritical(INTERNAL_ERROR) << "SRuntimeMetaDataImpl std::runtime_error";
- }
- } catch (std::exception &exc) {
- if (exc.what()) {
- qCCritical(INTERNAL_ERROR) << "SRuntimeMetaDataImpl std::exception: "
- << exc.what();
- } else {
- qCCritical(INTERNAL_ERROR) << "SRuntimeMetaDataImpl std::exception";
- }
- }
- }
-
- void Load()
- {
- // Create the base types.
- std::shared_ptr<IDOMFactory> theFactory(IDOMFactory::CreateDOMFactory(m_StrTable));
- const char8_t *theMetaDataPath = GetMetaDataDirectory();
- NVScopedRefCounted<IRefCountedInputStream> theInStream(
- m_InputStreamFactory.GetStreamForFile(theMetaDataPath));
- SDOMElement *topElement = NULL;
- if (theInStream)
- topElement = CDOMSerializer::Read(*theFactory, *theInStream);
- if (topElement) {
- shared_ptr<IDOMReader> theReader =
- IDOMReader::CreateDOMReader(*topElement, m_StrTable, theFactory);
- m_NewMetaData->Load(*theReader);
-
- } else {
- qCCritical(INVALID_OPERATION) << "Metadata loading failed", "Failed to find meta data file";
- // Q3DStudio_ASSERT requires static linkage to UICSystem, which is only used
- // by UICEngine and UICRuntime
- // QT3DS_ASSERT requires the qt3ds foundation libraries which are used by all products.
- QT3DS_ASSERT(false);
- return;
- }
- }
-
- // Helper to convert wchar_t to eastl::string
- static inline void ConvertWide(const wchar_t *inType, eastl::string &outStr)
- {
- if (inType && *inType)
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const qt3ds::foundation::TWCharEASTLConverter::TCharType *>(inType),
- 0, outStr);
- else
- outStr.clear();
- }
-
- // Helper to convert char to wchar_t
- const wchar_t *ConvertChar(const char *inName, int inBufferIndex)
- {
- if (inName && *inName) {
- qt3ds::foundation::ConvertUTF(inName, 0, m_Buf[inBufferIndex]);
- return reinterpret_cast<const wchar_t *>(m_Buf[inBufferIndex].c_str());
- }
- return NULL;
- }
- inline const wchar_t *Convert0(const char *inName) { return ConvertChar(inName, 0); }
- inline const wchar_t *Convert1(const char *inName) { return ConvertChar(inName, 1); }
- inline const wchar_t *Convert2(const char *inName) { return ConvertChar(inName, 2); }
- inline const wchar_t *Convert3(const char *inName) { return ConvertChar(inName, 3); }
-
- inline Qt3DSDMInstanceHandle GetInstanceForType(const wchar_t *inType)
- {
- return m_Objects->GetInstanceForType(ComposerObjectTypes::Convert(inType));
- }
-
- Qt3DSDMInstanceHandle GetInstanceById(const wchar_t *inId)
- {
- if (IsTrivial(inId))
- return 0;
- if (inId[0] == '#')
- ++inId;
-
- TIdToHandleMap::iterator find = m_IdToHandleMap.find(inId);
- if (find != m_IdToHandleMap.end())
- return find->second;
- return 0;
- }
-
- virtual bool IsPropertyExist(const wchar_t *inType, const wchar_t *inProperty,
- const wchar_t *inId)
- {
- Qt3DSDMInstanceHandle theInstance =
- IsTrivial(inId) ? GetInstanceForType(inType) : GetInstanceById(inId);
- if (theInstance.Valid()) {
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theInstance, inProperty);
-
- return theProperty.Valid();
- }
- return false;
- }
-
- ERuntimeDataModelDataType Convert(DataModelDataType::Value inType)
- {
- switch (inType) {
- case DataModelDataType::None:
- return ERuntimeDataModelDataTypeNone;
- case DataModelDataType::Float:
- return ERuntimeDataModelDataTypeFloat;
- case DataModelDataType::Float2:
- return ERuntimeDataModelDataTypeFloat2;
- case DataModelDataType::Float3:
- return ERuntimeDataModelDataTypeFloat3;
- case DataModelDataType::Float4:
- return ERuntimeDataModelDataTypeFloat4;
- case DataModelDataType::Long:
- return ERuntimeDataModelDataTypeLong;
- case DataModelDataType::String:
- return ERuntimeDataModelDataTypeString;
- case DataModelDataType::Bool:
- return ERuntimeDataModelDataTypeBool;
- case DataModelDataType::Long4:
- return ERuntimeDataModelDataTypeLong4;
- case DataModelDataType::StringRef:
- return ERuntimeDataModelDataTypeStringRef;
- case DataModelDataType::ObjectRef:
- return ERuntimeDataModelDataTypeObjectRef;
- case DataModelDataType::StringOrInt:
- return ERuntimeDataModelDataTypeStringOrInt;
- default:
- QT3DS_ASSERT(false);
- return ERuntimeDataModelDataTypeNone;
- }
- }
-
- virtual ERuntimeDataModelDataType
- GetPropertyType(const wchar_t *inType, const wchar_t *inProperty, const wchar_t *inId)
- {
- Qt3DSDMInstanceHandle theInstance =
- IsTrivial(inId) ? GetInstanceForType(inType) : GetInstanceById(inId);
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theInstance, inProperty);
- return Convert(m_DataCore->GetProperty(theProperty).m_Type);
- }
-
- ERuntimeAdditionalMetaDataType Convert(AdditionalMetaDataType::Value inType)
- {
- switch (inType) {
- case AdditionalMetaDataType::None:
- return ERuntimeAdditionalMetaDataTypeNone;
- case AdditionalMetaDataType::StringList:
- return ERuntimeAdditionalMetaDataTypeStringList;
- case AdditionalMetaDataType::Range:
- return ERuntimeAdditionalMetaDataTypeRange;
- case AdditionalMetaDataType::Image:
- return ERuntimeAdditionalMetaDataTypeImage;
- case AdditionalMetaDataType::Color:
- return ERuntimeAdditionalMetaDataTypeColor;
- case AdditionalMetaDataType::Rotation:
- return ERuntimeAdditionalMetaDataTypeRotation;
- case AdditionalMetaDataType::Font:
- return ERuntimeAdditionalMetaDataTypeFont;
- case AdditionalMetaDataType::FontSize:
- return ERuntimeAdditionalMetaDataTypeFontSize;
- case AdditionalMetaDataType::MultiLine:
- return ERuntimeAdditionalMetaDataTypeMultiLine;
- case AdditionalMetaDataType::ObjectRef:
- return ERuntimeAdditionalMetaDataTypeObjectRef;
- case AdditionalMetaDataType::Mesh:
- return ERuntimeAdditionalMetaDataTypeMesh;
- case AdditionalMetaDataType::Import:
- return ERuntimeAdditionalMetaDataTypeImport;
- case AdditionalMetaDataType::Texture:
- return ERuntimeAdditionalMetaDataTypeTexture;
- case AdditionalMetaDataType::Renderable:
- return ERuntimeAdditionalMetaDataTypeRenderable;
- case AdditionalMetaDataType::PathBuffer:
- return ERuntimeAdditionalMetaDataTypePathBuffer;
- case AdditionalMetaDataType::ShadowMapResolution:
- return ERuntimeAdditionalMetaDataTypeShadowMapResolution;
- case AdditionalMetaDataType::String:
- return ERuntimeAdditionalMetaDataTypeString;
- default:
- QT3DS_ASSERT(false);
- return ERuntimeAdditionalMetaDataTypeNone;
- }
- }
-
- virtual ERuntimeAdditionalMetaDataType
- GetAdditionalType(const wchar_t *inType, const wchar_t *inProperty, const wchar_t *inId)
- {
- Qt3DSDMInstanceHandle theInstance =
- IsTrivial(inId) ? GetInstanceForType(inType) : GetInstanceById(inId);
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theInstance, inProperty);
- return Convert(m_NewMetaData->GetAdditionalMetaDataType(theInstance, theProperty));
- }
-
- bool GetPropertyValue(const wchar_t *inType, const wchar_t *inProperty, const wchar_t *inId,
- SValue &outValue)
- {
- Qt3DSDMInstanceHandle theInstance =
- IsTrivial(inId) ? GetInstanceForType(inType) : GetInstanceById(inId);
- if (theInstance.Valid()) {
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theInstance, inProperty);
- return m_DataCore->GetInstancePropertyValue(theInstance, theProperty, outValue);
- } else {
- eastl::string typeStr;
- eastl::string propertyStr;
- eastl::string idStr;
- ConvertWide(inType, typeStr);
- ConvertWide(inProperty, propertyStr);
- ConvertWide(inId, idStr);
- qCCritical(INVALID_OPERATION) << "GetPropertyValueString: "
- << typeStr.c_str() << " "
- << propertyStr.c_str() << " "
- << idStr.c_str();
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
- SRuntimeMetaDataPropertyInfo &FindProperty(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId)
- {
- TStrTableStr theTypeOrId = inId.IsValid() ? inId : inType;
- SPropertyKey theKey(theTypeOrId, inProperty);
- eastl::pair<TPropertyLookupHash::iterator, bool> theLookup =
- m_PropertyLookupHash.insert(eastl::make_pair(theKey, SRuntimeMetaDataPropertyInfo()));
- if (theLookup.second) {
- const wchar_t *theType(Convert0(inType));
- const wchar_t *theProperty(Convert1(inProperty));
- const wchar_t *theId(Convert2(inId));
- if (IsPropertyExist(theType, theProperty, theId)) {
- ERuntimeDataModelDataType theDataType(GetPropertyType(theType, theProperty, theId));
- ERuntimeAdditionalMetaDataType theAdditionalType(
- GetAdditionalType(theType, theProperty, theId));
- Option<SValue> theValue;
- SValue theValueData;
- if (GetPropertyValue(theType, theProperty, theId, theValueData))
- theValue = theValueData.toOldSkool();
- theLookup.first->second =
- SRuntimeMetaDataPropertyInfo(theDataType, theAdditionalType, theValue, true);
- }
- }
- return theLookup.first->second;
- }
-
- bool IsPropertyExist(TStrTableStr inType, TStrTableStr inProperty, TStrTableStr inId) override
- {
- return FindProperty(inType, inProperty, inId).m_Exist;
- }
-
- ERuntimeDataModelDataType GetPropertyType(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- return FindProperty(inType, inProperty, inId).m_DataType;
- }
-
- virtual ERuntimeAdditionalMetaDataType
- GetAdditionalType(TStrTableStr inType, TStrTableStr inProperty, TStrTableStr inId) override
- {
- return FindProperty(inType, inProperty, inId).m_AdditionalType;
- }
-
- Option<float> GetPropertyValueFloat(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue())
- return qt3dsdm::get<float>(*theInfo.m_Value);
- return Empty();
- }
-
- Option<qt3ds::QT3DSVec2> GetPropertyValueVector2(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue()) {
- SFloat2 theFloat2 = qt3dsdm::get<SFloat2>(*theInfo.m_Value);
- return qt3ds::QT3DSVec2(theFloat2[0], theFloat2[1]);
- }
- return Empty();
- }
-
- Option<qt3ds::QT3DSVec3> GetPropertyValueVector3(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue()) {
- SFloat3 theFloat3 = qt3dsdm::get<SFloat3>(*theInfo.m_Value);
- return qt3ds::QT3DSVec3(theFloat3[0], theFloat3[1], theFloat3[2]);
- }
- return Empty();
- }
-
- Option<qt3ds::QT3DSVec4> GetPropertyValueVector4(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue()) {
- SFloat4 theFloat4 = qt3dsdm::get<SFloat4>(*theInfo.m_Value);
- return qt3ds::QT3DSVec4(theFloat4[0], theFloat4[1], theFloat4[2], theFloat4[3]);
- }
- return Empty();
- }
-
- virtual Option<qt3ds::QT3DSI32> GetPropertyValueLong(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue())
- return qt3dsdm::get<qt3ds::QT3DSI32>(*theInfo.m_Value);
- return Empty();
- }
-
- virtual Option<TRuntimeMetaDataStrType>
- GetPropertyValueString(TStrTableStr inType, TStrTableStr inProperty, TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue()) {
- TDataStrPtr theStr = qt3dsdm::get<TDataStrPtr>(*theInfo.m_Value);
- TRuntimeMetaDataStrType retval;
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const qt3ds::foundation::TWCharEASTLConverter::TCharType *>(
- theStr->GetData()),
- 0, retval);
- return retval;
- }
- return Empty();
- }
-
- virtual Option<TRuntimeMetaDataStrType>
- GetPropertyValueObjectRef(TStrTableStr inType, TStrTableStr inProperty, TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue()) {
- SObjectRefType theObjectRef = ConvertToObjectRef(*theInfo.m_Value);
- if (theObjectRef.GetReferenceType() == ObjectReferenceType::Relative) {
- TDataStrPtr theStr = qt3dsdm::get<TDataStrPtr>(theObjectRef.m_Value);
- TRuntimeMetaDataStrType retval;
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const qt3ds::foundation::TWCharEASTLConverter::TCharType *>(
- theStr->GetData()),
- 0, retval);
- return retval;
- } else // we don't know how to solve absolute reference type
- {
- // QT3DS_ASSERT( false );
- return TRuntimeMetaDataStrType("");
- }
- }
- return Empty();
- }
-
- Option<bool> GetPropertyValueBool(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId) override
- {
- SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId));
- if (theInfo.m_Value.hasValue())
- return qt3dsdm::get<bool>(*theInfo.m_Value);
- return Empty();
- }
-
- virtual void GetReferences(const wchar_t *inType,
- eastl::vector<TRuntimeMetaDataStrType> &outReferences,
- const wchar_t *inId)
- {
- Qt3DSDMInstanceHandle theInstance =
- IsTrivial(inId) ? GetInstanceForType(inType) : GetInstanceById(inId);
-
- if (theInstance.Valid()) {
- m_TempReferences.clear();
- m_NewMetaData->GetReferences(theInstance, m_TempReferences);
- outReferences.resize((uint32_t)m_TempReferences.size());
- for (uint32_t idx = 0, end = (uint32_t)m_TempReferences.size(); idx < end; ++idx) {
- qt3ds::foundation::ConvertUTF(m_TempReferences[idx].c_str(),
- m_TempReferences[idx].size(), outReferences[idx]);
- }
- }
- }
-
- void GetReferences(const char *inType,
- eastl::vector<TRuntimeMetaDataStrType> &outReferences,
- const char *inId) override
- {
- GetReferences(Convert0(inType), outReferences, Convert2(inId));
- }
-
- virtual bool IsCustomProperty(const wchar_t *inId, const wchar_t *inProperty)
- {
- Qt3DSDMInstanceHandle theInstance = GetInstanceById(inId);
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theInstance, inProperty);
- return m_NewMetaData->IsCustomProperty(theInstance, theProperty);
- }
-
- bool IsCustomProperty(const char *inId, const char *inProperty) override
- {
- return IsCustomProperty(Convert2(inId), Convert1(inProperty));
- }
-
- virtual bool IsCustomHandler(const wchar_t *inId, const wchar_t *inHandlerName)
- {
- Qt3DSDMInstanceHandle theInstance = GetInstanceById(inId);
- Qt3DSDMHandlerHandle theHandle =
- m_NewMetaData->FindHandlerByName(theInstance, inHandlerName);
- return m_NewMetaData->IsCustomHandler(theHandle);
- }
-
- inline void SetDataType(SAttOrArg &arg, const SMetaPropertyBase &argInfo)
- {
- arg.m_DataType = Convert(argInfo.GetDataType());
- arg.m_MetaType = Convert(argInfo.GetAdditionalType());
- qt3ds::foundation::ConvertUTF(argInfo.m_Name.c_str(), argInfo.m_Name.size(), arg.m_Name);
- qt3ds::foundation::ConvertUTF(argInfo.m_FormalName.c_str(), argInfo.m_FormalName.size(),
- arg.m_FormalName);
- switch (argInfo.GetAdditionalType()) {
- case qt3dsdm::AdditionalMetaDataType::StringList: {
- const eastl::vector<TCharStr> &theData =
- argInfo.m_MetaDataData.getData<eastl::vector<TCharStr>>();
- arg.m_MetaDataList.resize(theData.size());
- for (uint32_t metaIdx = 0, metaEnd = theData.size(); metaIdx < metaEnd; ++metaIdx)
- qt3ds::foundation::ConvertUTF(theData[metaIdx].c_str(), theData[metaIdx].size(),
- arg.m_MetaDataList[metaIdx]);
- } break;
- case qt3dsdm::AdditionalMetaDataType::Range: {
- const SMetaDataRange &range = argInfo.m_MetaDataData.getData<SMetaDataRange>();
- arg.m_MetaDataRange = eastl::make_pair(range.m_min, range.m_max);
- } break;
- default:
- break;
- }
- }
-
- THandlerList GetCustomHandlers(const char *inId) override
- {
- THandlerList retval;
- Qt3DSDMInstanceHandle theInstance = GetInstanceById(Convert0(inId));
- THandlerHandleList handlerList;
- m_NewMetaData->GetHandlers(theInstance, handlerList);
- retval.reserve((uint32_t)handlerList.size());
- for (size_t idx = 0, end = handlerList.size(); idx < end; ++idx) {
- if (m_NewMetaData->IsCustomHandler(handlerList[idx])) {
- SHandlerInfo theInfo(m_NewMetaData->GetHandlerInfo(handlerList[idx]));
- retval.push_back(SHandler());
- SHandler &handler(retval.back());
- qt3ds::foundation::ConvertUTF(theInfo.m_Name.c_str(), theInfo.m_Name.size(),
- handler.m_Name);
- qt3ds::foundation::ConvertUTF(theInfo.m_FormalName.c_str(),
- theInfo.m_FormalName.size(), handler.m_FormalName);
- vector<SMetaDataHandlerArgumentInfo> theArgInfo;
- m_NewMetaData->GetHandlerArguments(handlerList[idx], theArgInfo);
- handler.m_Arguments.resize((uint32_t)theArgInfo.size());
- for (uint32_t argIdx = 0, argEnd = (uint32_t)theArgInfo.size(); argIdx < argEnd;
- ++argIdx) {
- const SMetaDataHandlerArgumentInfo &argInfo(theArgInfo[argIdx]);
- SAttOrArg &arg = handler.m_Arguments[argIdx];
- SetDataType(arg, argInfo);
- }
- }
- }
- return retval;
- }
-
- TVisualEventList GetVisualEvents(const char *inId) override
- {
- TVisualEventList theRetval;
- Qt3DSDMInstanceHandle theInstance = GetInstanceById(Convert0(inId));
- TEventHandleList theEventList;
- m_NewMetaData->GetEvents(theInstance, theEventList);
- theRetval.reserve((uint32_t)theEventList.size());
- for (uint32_t idx = 0, end = (uint32_t)theEventList.size(); idx < end; ++idx) {
- SEventInfo theInfo(m_NewMetaData->GetEventInfo(theEventList[idx]));
- theRetval.push_back(SVisualEvent());
- SVisualEvent &theEvent(theRetval.back());
- qt3ds::foundation::ConvertUTF(theInfo.m_Name.c_str(), theInfo.m_Name.size(),
- theEvent.m_Name);
- qt3ds::foundation::ConvertUTF(theInfo.m_FormalName.c_str(), theInfo.m_FormalName.size(),
- theEvent.m_FormalName);
- }
- return theRetval;
- }
-
- void MetaPropertiesToAttList(vector<Qt3DSDMMetaDataPropertyHandle> &theProperties,
- TAttOrArgList &outAtts)
- {
- outAtts.reserve((uint32_t)theProperties.size());
- for (uint32_t idx = 0, end = (uint32_t)theProperties.size(); idx < end; ++idx) {
- SMetaDataPropertyInfo thePropInfo =
- m_NewMetaData->GetMetaDataPropertyInfo(theProperties[idx]);
- outAtts.push_back(SAttOrArg());
- SAttOrArg &arg(outAtts.back());
- arg.m_DataType = Convert(thePropInfo.GetDataType());
- arg.m_MetaType = Convert(thePropInfo.GetAdditionalType());
- qt3ds::foundation::ConvertUTF(thePropInfo.m_Name.c_str(), thePropInfo.m_Name.size(),
- arg.m_Name);
- qt3ds::foundation::ConvertUTF(thePropInfo.m_FormalName.c_str(),
- thePropInfo.m_FormalName.size(), arg.m_FormalName);
- SetDataType(arg, thePropInfo);
- }
- }
-
- SElementInfo LoadElement(const char *clsName, const char *clsRef, const char *inId) override
- {
- SElementInfo retval;
- Qt3DSDMInstanceHandle theInstance;
- Qt3DSDMInstanceHandle parentInstance;
- if (!qt3ds::foundation::isTrivial(clsRef)) {
- if (clsRef[0] == '#')
- ++clsRef;
- parentInstance = GetInstanceById(Convert0(clsRef));
- } else {
- parentInstance = m_NewMetaData->GetCanonicalInstanceForType(Convert0(clsName));
- }
- if (parentInstance.Valid() == false) {
- QT3DS_ASSERT(false);
- return retval;
- }
- theInstance = m_DataCore->CreateInstance();
- m_DataCore->DeriveInstance(theInstance, parentInstance);
- m_IdToHandleMap.insert(std::make_pair(TCharStr(Convert0(inId)), theInstance));
- // setup isComponent
- Qt3DSDMInstanceHandle slideOwner = m_NewMetaData->GetCanonicalInstanceForType(L"SlideOwner");
- retval.m_IsComponent = m_DataCore->IsInstanceOrDerivedFrom(theInstance, slideOwner);
- TCharStr type = m_NewMetaData->GetTypeForInstance(theInstance);
- qt3ds::foundation::ConvertUTF(type.c_str(), type.size(), retval.m_ClassName);
- vector<Qt3DSDMMetaDataPropertyHandle> theProperties;
- m_NewMetaData->GetMetaDataProperties(theInstance, theProperties);
- MetaPropertiesToAttList(theProperties, retval.m_Attributes);
- return retval;
- }
-
- TAttOrArgList GetSlideAttributes() override
- {
- TAttOrArgList retval;
- Qt3DSDMInstanceHandle slideOwner = m_NewMetaData->GetCanonicalInstanceForType(L"Slide");
- vector<Qt3DSDMMetaDataPropertyHandle> theProperties;
- m_NewMetaData->GetSpecificMetaDataProperties(slideOwner, theProperties);
- MetaPropertiesToAttList(theProperties, retval);
- return retval;
- }
-
- bool IsCustomHandler(const char *inId, const char *inHandlerName) override
- {
- return IsCustomHandler(Convert0(inId), Convert1(inHandlerName));
- }
-
- virtual void GetHandlerArgumentType(const wchar_t *inId, const wchar_t *inHandlerName,
- const wchar_t *inArgumentName,
- ERuntimeDataModelDataType &outType,
- ERuntimeAdditionalMetaDataType &outAdditionalType)
- {
- outType = ERuntimeDataModelDataTypeNone;
- outAdditionalType = ERuntimeAdditionalMetaDataTypeNone;
-
- Qt3DSDMInstanceHandle theInstance = GetInstanceById(inId);
- Qt3DSDMHandlerHandle theHandle =
- m_NewMetaData->FindHandlerByName(theInstance, inHandlerName);
- Option<SMetaDataHandlerArgumentInfo> theArgMetaData(
- m_NewMetaData->FindHandlerArgumentByName(theHandle, inArgumentName));
- if (theArgMetaData.hasValue()) {
- outType = Convert(theArgMetaData->GetDataType());
- outAdditionalType = Convert(theArgMetaData->GetAdditionalType());
- }
-
- // Check if the type is something that we support
- QT3DS_ASSERT(outType != ERuntimeDataModelDataTypeNone);
- }
-
- void GetHandlerArgumentType(const char *inId, const char *inHandlerName,
- const char *inArgumentName,
- ERuntimeDataModelDataType &outType,
- ERuntimeAdditionalMetaDataType &outAdditionalType) override
- {
- GetHandlerArgumentType(Convert0(inId), Convert1(inHandlerName), Convert2(inArgumentName),
- outType, outAdditionalType);
- }
-
- std::shared_ptr<IDOMReader> ParseScriptFile(const wchar_t *inFullPathToDocument,
- std::shared_ptr<qt3dsdm::IStringTable> inStringTable)
- {
- using namespace ScriptParser;
- std::shared_ptr<qt3dsdm::IStringTable> theStringTable(inStringTable);
- std::shared_ptr<IDOMFactory> theFactory(IDOMFactory::CreateDOMFactory(theStringTable));
- SImportXmlErrorHandler theXmlErrorHandler;
- const QString path = QString::fromWCharArray(inFullPathToDocument);
- std::shared_ptr<IDOMReader> theReaderPtr(
- SScriptParser::ParseScriptFile(theFactory, inStringTable,
- path,
- theXmlErrorHandler, m_InputStreamFactory));
- if (!theReaderPtr)
- qCCritical(INVALID_OPERATION) << "Failed to open script file: " << path;
- return theReaderPtr;
- }
-
- Qt3DSDMInstanceHandle CreateAndDeriveInstance(const wchar_t *inType, const wchar_t *inId)
- {
- // Make sure that the same id has not been created before
- TCharStr theId(inId);
- QT3DS_ASSERT(m_IdToHandleMap.find(theId) == m_IdToHandleMap.end());
-
- Qt3DSDMInstanceHandle theCanonicalType(m_NewMetaData->GetCanonicalInstanceForType(inType));
- if (theCanonicalType.Valid() == false) {
- QT3DS_ASSERT(false);
- return 0;
- }
-
- Qt3DSDMInstanceHandle theMaster = m_DataCore->CreateInstance();
- m_DataCore->DeriveInstance(theMaster, theCanonicalType);
- m_IdToHandleMap.insert(std::make_pair(theId, theMaster));
- return theMaster;
- }
-
- virtual bool LoadScriptFile(const wchar_t *inType, const wchar_t *inId, const wchar_t *inName,
- const wchar_t *inSourcePath)
- {
- TCharStr theId(inId);
- if (m_IdToHandleMap.find(theId) != m_IdToHandleMap.end())
- return true;
-
- Qt3DSDMInstanceHandle theMaster = CreateAndDeriveInstance(inType, inId);
- if (!theMaster.Valid())
- return false;
-
- std::shared_ptr<IDOMReader> theScriptPtr =
- ParseScriptFile(inSourcePath, m_DataCore->GetStringTablePtr());
- if (theScriptPtr) {
- std::vector<SMetaDataLoadWarning> warnings;
- // Now the magic section
- m_NewMetaData->LoadInstance(*theScriptPtr, theMaster, inName, warnings);
-
- // Set the name
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theMaster, L"name");
- m_DataCore->SetInstancePropertyValue(theMaster, theProperty,
- std::make_shared<CDataStr>(inName));
- return true;
- }
-
- return false;
- }
-
- bool LoadScriptFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) override
- {
- return LoadScriptFile(Convert0(inType), Convert1(inId), Convert2(inName),
- Convert3(inSourcePath));
- }
-
- bool LoadEffectXMLFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) override
- {
- const wchar_t *theType(Convert0(inType));
- const wchar_t *theId(Convert1(inId));
- const wchar_t *theName(Convert2(inName));
- if (m_IdToHandleMap.find(theId) != m_IdToHandleMap.end())
- return true;
-
- Qt3DSDMInstanceHandle theMaster = CreateAndDeriveInstance(theType, theId);
- if (!theMaster.Valid())
- return false;
- NVScopedRefCounted<IRefCountedInputStream> theStream(
- m_InputStreamFactory.GetStreamForFile(inSourcePath));
- if (theStream) {
- std::vector<SMetaDataLoadWarning> warnings;
- bool success = m_NewMetaData->LoadEffectXMLFromSourcePath(
- inSourcePath, theMaster, theName, warnings, *theStream);
- (void)success;
- QT3DS_ASSERT(success);
- return success;
- }
- return false;
- }
-
- bool LoadMaterialXMLFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) override
- {
- const wchar_t *theType(Convert0(inType));
- const wchar_t *theId(Convert1(inId));
- const wchar_t *theName(Convert2(inName));
- (void)theName;
- if (m_IdToHandleMap.find(theId) != m_IdToHandleMap.end())
- return true;
-
- Qt3DSDMInstanceHandle theMaster = CreateAndDeriveInstance(theType, theId);
- if (!theMaster.Valid())
- return false;
-
- NVScopedRefCounted<IRefCountedInputStream> theStream(
- m_InputStreamFactory.GetStreamForFile(inSourcePath));
- if (theStream) {
- std::vector<SMetaDataLoadWarning> warnings;
- bool success = m_NewMetaData->LoadMaterialClassFromSourcePath(
- inSourcePath, theMaster, theId, warnings, *theStream);
- (void)success;
- QT3DS_ASSERT(success);
- return success;
- }
- return false;
- }
-
- struct PluginErrorHandler : public qt3dsdm::CXmlErrorHandler
- {
- void OnXmlError(const QString &, int, int) override {}
- };
-
- bool LoadPluginXMLFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) override
- {
- const wchar_t *theType(Convert0(inType));
- const wchar_t *theId(Convert1(inId));
- const wchar_t *theName(Convert2(inName));
- if (m_IdToHandleMap.find(theId) != m_IdToHandleMap.end())
- return true;
-
- Qt3DSDMInstanceHandle theMaster = CreateAndDeriveInstance(theType, theId);
- if (!theMaster.Valid())
- return false;
-
- std::shared_ptr<qt3dsdm::IDOMFactory> theFactory =
- qt3dsdm::IDOMFactory::CreateDOMFactory(m_StrTable);
-
- PluginErrorHandler dummyHandler;
- std::shared_ptr<qt3dsdm::IDOMReader> theReader = Q3DStudio::CRenderPluginParser::ParseFile(
- theFactory, m_StrTable, inSourcePath, dummyHandler, m_InputStreamFactory);
- if (theReader) {
- Q3DStudio::CRenderPluginParser::NavigateToMetadata(theReader);
- std::vector<SMetaDataLoadWarning> theWarnings;
- m_NewMetaData->LoadInstance(*theReader, theMaster, theName, theWarnings);
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(theMaster, L"name");
- m_DataCore->SetInstancePropertyValue(theMaster, theProperty,
- std::make_shared<CDataStr>(theName));
- return true;
- }
- return false;
- }
-
- Option<qt3dsdm::SMetaDataEffect> GetEffectMetaDataBySourcePath(const char *inName) override
- {
- return m_NewMetaData->GetEffectBySourcePath(inName);
- }
-
- virtual Option<qt3dsdm::SMetaDataCustomMaterial>
- GetMaterialMetaDataBySourcePath(const char *inName) override
- {
- return m_NewMetaData->GetMaterialBySourcePath(inName);
- }
-
- virtual void GetInstanceProperties(const wchar_t *inType, const wchar_t *inId,
- eastl::vector<TRuntimeMetaDataStrType> &outProperties,
- bool inSearchParent)
- {
- // Get the instance handle given the type or id
- Qt3DSDMInstanceHandle theInstance =
- IsTrivial(inId) ? GetInstanceForType(inType) : GetInstanceById(inId);
- if (!theInstance.Valid()) {
- QT3DS_ASSERT(false);
- return;
- }
-
- vector<Qt3DSDMMetaDataPropertyHandle> theProperties;
- if (inSearchParent)
- // Get the meta data properties defined on this object or its derivation parents
- m_NewMetaData->GetMetaDataProperties(theInstance, theProperties);
- else
- // Get the meta data properties defined on *only* this object, don't search parents
- m_NewMetaData->GetSpecificMetaDataProperties(theInstance, theProperties);
-
- outProperties.clear();
- // Iterate each property and fill outProperties
- for (size_t propIdx = 0, propEnd = theProperties.size(); propIdx < propEnd; ++propIdx) {
- SMetaDataPropertyInfo theInfo(
- m_NewMetaData->GetMetaDataPropertyInfo(theProperties[propIdx]));
- outProperties.push_back(TRuntimeMetaDataStrType());
- qt3ds::foundation::ConvertUTF(theInfo.m_Name.c_str(), 0, outProperties.back());
- }
- }
-
- void GetInstanceProperties(const char *inType, const char *inId,
- eastl::vector<TRuntimeMetaDataStrType> &outProperties,
- bool inSearchParent) override
- {
- GetInstanceProperties(Convert0(inType), Convert2(inId), outProperties, inSearchParent);
- }
-
- std::shared_ptr<qt3dsdm::IStringTable> GetStringTable() override { return m_StrTable; }
-
- TStrTableStr Register(const char *inStr) override
- {
- return m_StrTable->GetRenderStringTable().RegisterStr(inStr);
- }
-
- //==============================================================================
- /**
- * @Self release
- */
- void release() override { delete this; }
-
- void ClearPerProjectData() override
- {
-
- m_IdToHandleMap.clear();
- m_PropertyLookupHash.clear();
- }
-
-}; // end of struct SRuntimeMetaDataImpl
-}
-
-IRuntimeMetaData &IRuntimeMetaData::Create(IInputStreamFactory &inInputStreamFactory)
-{
- SRuntimeMetaDataImpl &retval = *new SRuntimeMetaDataImpl(inInputStreamFactory);
- retval.Load();
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.h b/src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.h
deleted file mode 100644
index 1efe748c..00000000
--- a/src/Runtime/ogl-runtime/src/datamodel/Qt3DSMetadata.h
+++ /dev/null
@@ -1,386 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSVec4.h"
-#include <EASTL/string.h>
-#include <EASTL/vector.h>
-#include "foundation/StringTable.h"
-#include <memory>
-
-namespace qt3ds {
-namespace foundation {
-}
-}
-
-namespace qt3dsdm {
-class IStringTable;
-struct SMetaDataEffect;
-struct SMetaDataCustomMaterial;
-}
-
-namespace qt3ds {
-namespace render {
- class IInputStreamFactory;
-}
-}
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-using namespace qt3ds::foundation;
-
-//==============================================================================
-// Redifinition of qt3dsdm::DataModelDataType::Value
-//==============================================================================
-enum ERuntimeDataModelDataType {
- ERuntimeDataModelDataTypeNone,
- ERuntimeDataModelDataTypeFloat,
- ERuntimeDataModelDataTypeFloat2,
- ERuntimeDataModelDataTypeFloat3,
- ERuntimeDataModelDataTypeFloat4,
- ERuntimeDataModelDataTypeLong,
- ERuntimeDataModelDataTypeString,
- ERuntimeDataModelDataTypeBool,
- ERuntimeDataModelDataTypeLong4,
- ERuntimeDataModelDataTypeStringRef,
- ERuntimeDataModelDataTypeObjectRef,
- ERuntimeDataModelDataTypeStringOrInt,
-};
-
-//==============================================================================
-// Redifinition of qt3dsdm::AdditionalMetaDataType
-//==============================================================================
-enum ERuntimeAdditionalMetaDataType {
- ERuntimeAdditionalMetaDataTypeNone,
- ERuntimeAdditionalMetaDataTypeStringList,
- ERuntimeAdditionalMetaDataTypeRange,
- ERuntimeAdditionalMetaDataTypeImage,
- ERuntimeAdditionalMetaDataTypeColor,
- ERuntimeAdditionalMetaDataTypeRotation,
- ERuntimeAdditionalMetaDataTypeFont,
- ERuntimeAdditionalMetaDataTypeFontSize,
- ERuntimeAdditionalMetaDataTypeMultiLine,
- ERuntimeAdditionalMetaDataTypeObjectRef,
- ERuntimeAdditionalMetaDataTypeMesh,
- ERuntimeAdditionalMetaDataTypeImport,
- ERuntimeAdditionalMetaDataTypeTexture,
- ERuntimeAdditionalMetaDataTypeRenderable,
- ERuntimeAdditionalMetaDataTypePathBuffer,
- ERuntimeAdditionalMetaDataTypeShadowMapResolution,
- ERuntimeAdditionalMetaDataTypeString,
-};
-
-typedef eastl::basic_string<char8_t> TRuntimeMetaDataStrType;
-typedef qt3ds::foundation::CRegisteredString TStrTableStr;
-
-struct SAttOrArg
-{
- TRuntimeMetaDataStrType m_Name;
- TRuntimeMetaDataStrType m_FormalName;
- ERuntimeDataModelDataType m_DataType;
- ERuntimeAdditionalMetaDataType m_MetaType;
- eastl::vector<TRuntimeMetaDataStrType> m_MetaDataList;
- eastl::pair<float, float> m_MetaDataRange;
-};
-
-typedef eastl::vector<SAttOrArg> TAttOrArgList;
-struct SHandler
-{
- TRuntimeMetaDataStrType m_Name;
- TRuntimeMetaDataStrType m_FormalName;
- TAttOrArgList m_Arguments;
-};
-
-typedef eastl::vector<SHandler> THandlerList;
-
-struct SVisualEvent
-{
- TRuntimeMetaDataStrType m_Name;
- TRuntimeMetaDataStrType m_FormalName;
-};
-
-typedef eastl::vector<SVisualEvent> TVisualEventList;
-
-struct SElementInfo
-{
- TRuntimeMetaDataStrType m_ClassName;
- bool m_IsComponent;
- TAttOrArgList m_Attributes;
-};
-
-//==============================================================================
-/**
- * @class IRuntimeMetaData
- * @brief Declare interfaces for querying meta data values
- */
-class QT3DS_AUTOTEST_EXPORT IRuntimeMetaData : public NVReleasable
-{
-
-public:
- static const char *GetMetaDataDirectory()
- {
- return ":/res/DataModelMetadata/en-us/MetaData.xml";
- }
- //==============================================================================
- /**
- * Check if a property for the specified type or id exists
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value type
- */
- virtual bool IsPropertyExist(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value type
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value type
- */
- virtual ERuntimeDataModelDataType GetPropertyType(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get additional metadata type
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property meta data type
- */
- virtual ERuntimeAdditionalMetaDataType
- GetAdditionalType(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value as float
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<float> GetPropertyValueFloat(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value as QT3DSVec2
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<qt3ds::QT3DSVec2> GetPropertyValueVector2(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value as QT3DSVec3
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<qt3ds::QT3DSVec3> GetPropertyValueVector3(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- virtual Option<qt3ds::QT3DSVec4> GetPropertyValueVector4(TStrTableStr inType,
- TStrTableStr inProperty, TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value as long
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<qt3ds::QT3DSI32> GetPropertyValueLong(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value as string
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<TRuntimeMetaDataStrType>
- GetPropertyValueString(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get object ref property value as string
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<TRuntimeMetaDataStrType>
- GetPropertyValueObjectRef(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get property value as bool
- * @param inType default object type
- * @param inProperty the property to query
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param return property value
- */
- virtual Option<bool> GetPropertyValueBool(TStrTableStr inType, TStrTableStr inProperty,
- TStrTableStr inId = TStrTableStr()) = 0;
-
- //==============================================================================
- /**
- * Get references
- * @param inType default object type
- * @param outReferences References of the object
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- */
- virtual void GetReferences(const char *inType,
- eastl::vector<TRuntimeMetaDataStrType> &outReferences,
- const char *inId = NULL) = 0;
-
- //==============================================================================
- /**
- * Check if the property is custom or built in (canonical)
- * @param inId object id
- * @param inProperty the property to query
- */
- virtual bool IsCustomProperty(const char *inId, const char *inProperty) = 0;
-
- //==============================================================================
- /**
- * Check if the handle is custom or built in (canonical)
- * @param inId object id
- * @param inHandlerName the handler name
- */
- virtual bool IsCustomHandler(const char *inId, const char *inHandlerName) = 0;
-
- virtual THandlerList GetCustomHandlers(const char *inId) = 0;
-
- virtual TVisualEventList GetVisualEvents(const char *inId) = 0;
-
- virtual SElementInfo LoadElement(const char *clsName, const char *clsRef, const char *inId) = 0;
-
- virtual TAttOrArgList GetSlideAttributes() = 0;
-
- //==============================================================================
- /**
- * Get the data type and additional type of the custom handler
- * @param inId object id
- * @param inHandlerName the handler name
- * @param inArgumentName the handler argument name
- * @param outType the type
- * @param outAdditionalType the additional type
- */
- virtual void GetHandlerArgumentType(const char *inId, const char *inHandlerName,
- const char *inArgumentName,
- ERuntimeDataModelDataType &outType,
- ERuntimeAdditionalMetaDataType &outAdditionalType) = 0;
-
- //==============================================================================
- /**
- * Get properties of the object with the given id, with the option of searching the parent or
- *only specific to this object.
- * @param inType default object type
- * @param inId object id. if this value is not trivial, the query is based on inId
- *instead of inType
- * @param outProperties the list of property names
- * @param inSearchParent if true, get the properties defined on the object or its derivation
- *parents
- * else, get only the properties defined on the object, not properties
- *derived from the parent.
- */
- virtual void GetInstanceProperties(const char *inType, const char *inId,
- eastl::vector<TRuntimeMetaDataStrType> &outProperties,
- bool inSearchParent) = 0;
-
- virtual bool LoadScriptFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) = 0;
-
- virtual bool LoadEffectXMLFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) = 0;
-
- virtual bool LoadMaterialXMLFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) = 0;
-
- virtual bool LoadPluginXMLFile(const char *inType, const char *inId, const char *inName,
- const char *inSourcePath) = 0;
-
- virtual Option<qt3dsdm::SMetaDataEffect> GetEffectMetaDataBySourcePath(const char *inName) = 0;
-
- virtual Option<qt3dsdm::SMetaDataCustomMaterial>
- GetMaterialMetaDataBySourcePath(const char *inSourcePath) = 0;
-
- virtual std::shared_ptr<qt3dsdm::IStringTable> GetStringTable() = 0;
-
- virtual TStrTableStr Register(const char *inStr) = 0;
-
- // Clear data that affects project loading (mainly id->instance map)
- virtual void ClearPerProjectData() = 0;
-
-public:
- //==============================================================================
- /**
- * Creation function creates an object implements the IRuntimeMetaData interface
- * This takes an input stream factory because on android the metadata is installed
- * in the APK file, so we don't have exact access to it on the filesystem.
- */
- static IRuntimeMetaData &Create(qt3ds::render::IInputStreamFactory &inInputStreamFactory);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/dm/EASTL_new.cpp b/src/Runtime/ogl-runtime/src/dm/EASTL_new.cpp
deleted file mode 100644
index 1ca308e7..00000000
--- a/src/Runtime/ogl-runtime/src/dm/EASTL_new.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "EASTL/allocator.h"
-
-void *operator new[](size_t size, const char *, int, unsigned, const char *, int)
-{
- return malloc(size);
-}
-
-void *operator new[](size_t size, size_t, size_t, const char *, int, unsigned, const char *, int)
-{
- return malloc(size);
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/Qt3DSDMPrefix.h b/src/Runtime/ogl-runtime/src/dm/Qt3DSDMPrefix.h
deleted file mode 100644
index 4164d646..00000000
--- a/src/Runtime/ogl-runtime/src/dm/Qt3DSDMPrefix.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifdef __cplusplus
-#pragma once
-
-#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
-#define _WIN32_WINNT \
- 0x0501 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
-// TODO: reference additional headers your program requires here
-#if defined(WIN32) && defined(MSVC)
-#pragma warning(push)
-#pragma warning(disable : 4100)
-#pragma warning(disable : 4512)
-#pragma warning(disable : 4702)
-#pragma warning(disable : 4996)
-#endif
-
-// std includes
-#include <map>
-#include <vector>
-#include <string>
-#include <exception>
-#include <set>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <memory>
-#include <functional>
-
-// Project includes
-#include "StandardExtensions.h"
-
-namespace qt3dsdm {
-using std::ref;
-using std::get;
-using std::bind;
-using std::tuple;
-using std::static_pointer_cast;
-using std::make_pair;
-using std::equal_to;
-using std::vector;
-using std::make_tuple;
-using std::function;
-using std::shared_ptr;
-using std::make_shared;
-}
-#if defined(WIN32) && defined(MSVC)
-#pragma warning(pop)
-#endif
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/dm.pro b/src/Runtime/ogl-runtime/src/dm/dm.pro
deleted file mode 100644
index 2e57f308..00000000
--- a/src/Runtime/ogl-runtime/src/dm/dm.pro
+++ /dev/null
@@ -1,58 +0,0 @@
-TEMPLATE = lib
-TARGET = QT3DSDM
-CONFIG += staticlib
-include(../commoninclude.pri)
-
-DEFINES += QT3DS_AUTHORING _AFXDLL PCRE_STATIC _UNICODE
-
-linux {
- DEFINES += QT3DSDM_META_DATA_NO_SIGNALS
-}
-
-INCLUDEPATH += \
- \
- systems \
- systems/cores \
- ../system \
- ../foundation \
- ../runtimerender \
- ../datamodel \
- ../render \
- ../3rdparty/EASTL/UnknownVersion/include \
- ../3rdparty/color \
-
-PRECOMPILED_HEADER = Qt3DSDMPrefix.h
-
-SOURCES += \
- EASTL_new.cpp \
- systems/ActionSystem.cpp \
- systems/SignalsImpl.cpp \
- systems/SlideSystem.cpp \
- systems/StudioAnimationSystem.cpp \
- systems/StudioCoreSystem.cpp \
- systems/StudioFullSystem.cpp \
- systems/StudioPropertySystem.cpp \
- systems/Qt3DSDMComposerTypeDefinitions.cpp \
- systems/Qt3DSDMGuides.cpp \
- systems/Qt3DSDMMetaData.cpp \
- systems/Qt3DSDMSignalSystem.cpp \
- systems/Qt3DSDMStringTable.cpp \
- systems/Qt3DSDMValue.cpp \
- systems/Qt3DSDMXML.cpp \
- systems/cores/ActionCoreProducer.cpp \
- systems/cores/AnimationCoreProducer.cpp \
- systems/cores/DataCoreProducer.cpp \
- systems/cores/SimpleActionCore.cpp \
- systems/cores/SimpleAnimationCore.cpp \
- systems/cores/SimpleDataCore.cpp \
- systems/cores/SimpleSlideCore.cpp \
- systems/cores/SimpleSlideGraphCore.cpp \
- systems/cores/SlideCoreProducer.cpp \
- systems/cores/SlideGraphCoreProducer.cpp \
-
-HEADERS += \
- systems/Qt3DSDMDataTypes.h \
- systems/Qt3DSDMMetaDataTypes.h \
- systems/Qt3DSDMMetaDataValue.h \
- systems/Qt3DSDMMetaData.h \
- systems/Qt3DSDMWStrOpsImpl.h
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.cpp
deleted file mode 100644
index fbd25938..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "ActionSystem.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-CActionSystem::CActionSystem(TDataCorePtr inDataCore, TSlideCorePtr inSlideCore,
- TSlideGraphCorePtr inSlideGraphCore, TActionCorePtr inActionCore,
- TSlideSystemPtr inSlideSystem, Qt3DSDMInstanceHandle inActionInstance,
- Qt3DSDMPropertyHandle inActionEyeball)
- : m_DataCore(inDataCore)
- , m_SlideCore(inSlideCore)
- , m_SlideGraphCore(inSlideGraphCore)
- , m_ActionCore(inActionCore)
- , m_SlideSystem(inSlideSystem)
- , m_ActionInstance(inActionInstance)
- , m_ActionEyeball(inActionEyeball)
-{
- m_Signaller = CreateActionSystemSignaller();
-}
-
-Qt3DSDMActionHandle CActionSystem::CreateAction(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner,
- SLong4 inTriggerTargetObjects)
-{
- Q_ASSERT(inSlide.Valid() && inOwner.Valid());
-
- // Create Action instance handle that derives from Action instance
- Qt3DSDMInstanceHandle theActionInstance = m_DataCore->CreateInstance();
- m_DataCore->DeriveInstance(theActionInstance, m_ActionInstance);
-
- // Associate Action instance handle with Slide
- m_SlideSystem->AssociateInstanceWithSlide(inSlide, theActionInstance);
-
- // Unlink the eyeball property because Action can be eyeballed-on/off per-slide
- m_SlideSystem->UnlinkProperty(theActionInstance, m_ActionEyeball);
-
- // Create the Action handle
- Qt3DSDMActionHandle retval =
- m_ActionCore->CreateAction(theActionInstance, inSlide, inOwner, inTriggerTargetObjects);
-
- GetSignalSender()->SendActionCreated(retval, inSlide, inOwner);
- return retval;
-}
-
-void CActionSystem::DeleteAction(Qt3DSDMActionHandle inAction)
-{
- Qt3DSDMInstanceHandle theActionInstance;
- SActionInfo theActionInfo = m_ActionCore->GetActionInfo(inAction);
- m_ActionCore->DeleteAction(inAction, theActionInstance);
- m_DataCore->DeleteInstance(theActionInstance);
- GetSignalSender()->SendActionDeleted(inAction, theActionInfo.m_Slide, theActionInfo.m_Owner);
-}
-
-void CActionSystem::GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const
-{
- // Get all actions that exist in inSlide
- m_ActionCore->GetActions(inSlide, inOwner, outActions);
-
- // if inSlide is not master, get all actions that exist in master slide
- Qt3DSDMSlideHandle theMaster = m_SlideSystem->GetMasterSlide(inSlide);
- if (theMaster != inSlide) {
- TActionHandleList theMasterActions;
- m_ActionCore->GetActions(theMaster, inOwner, theMasterActions);
- outActions.insert(outActions.end(), theMasterActions.begin(), theMasterActions.end());
- sort(outActions.begin(), outActions.end());
- }
-}
-
-bool CActionSystem::GetActionEyeballValue(Qt3DSDMSlideHandle inActiveSlide,
- Qt3DSDMActionHandle inAction) const
-{
- SValue theValue;
- Qt3DSDMInstanceHandle theInstance = m_ActionCore->GetActionInstance(inAction);
- // Get the eyeball property value from SlideCore. There is no animation on eyeball so we can
- // query SlideCore directly.
- m_SlideCore->GetInstancePropertyValue(inActiveSlide, theInstance, m_ActionEyeball, theValue);
- if (m_SlideCore->IsSlide(inActiveSlide))
- return qt3dsdm::get<bool>(theValue);
- return false;
-}
-
-void CActionSystem::SetActionEyeballValue(Qt3DSDMSlideHandle inActiveSlide,
- Qt3DSDMActionHandle inAction, bool inValue)
-{
- Qt3DSDMInstanceHandle theInstance = m_ActionCore->GetActionInstance(inAction);
- // Set the eyeball property value to SlideCore.
- m_SlideCore->ForceSetInstancePropertyValue(inActiveSlide, theInstance, m_ActionEyeball,
- inValue);
-}
-
-IActionSystemSignalProvider *CActionSystem::GetSignalProvider()
-{
- return dynamic_cast<IActionSystemSignalProvider *>(m_Signaller.get());
-}
-
-IActionSystemSignalSender *CActionSystem::GetSignalSender()
-{
- return dynamic_cast<IActionSystemSignalSender *>(m_Signaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.h
deleted file mode 100644
index fea9894a..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/ActionSystem.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef ACTIONSYSTEMH
-#define ACTIONSYSTEMH
-#include "Qt3DSDMActionSystem.h"
-#include "Qt3DSDMActionCore.h"
-#include "Qt3DSDMDataCore.h"
-#include "Qt3DSDMSlideCore.h"
-#include "Qt3DSDMSlideGraphCore.h"
-#include "Qt3DSDMSlides.h"
-#include "Qt3DSDMTransactions.h"
-#include "SignalsImpl.h"
-
-namespace qt3dsdm {
-
-class CActionSystem : public IActionSystem
-{
- TDataCorePtr m_DataCore;
- TSlideCorePtr m_SlideCore;
- TSlideGraphCorePtr m_SlideGraphCore;
- TActionCorePtr m_ActionCore;
-
- TSlideSystemPtr m_SlideSystem;
-
- Qt3DSDMInstanceHandle m_ActionInstance;
- Qt3DSDMPropertyHandle m_ActionEyeball;
-
- std::shared_ptr<ISignalItem> m_Signaller;
-
-public:
- CActionSystem(TDataCorePtr inDataCore, TSlideCorePtr inSlideCore,
- TSlideGraphCorePtr inSlideGraphCore, TActionCorePtr inActionCore,
- TSlideSystemPtr inSlideSystem, Qt3DSDMInstanceHandle inActionInstance,
- Qt3DSDMPropertyHandle inActionEyeball);
-
- Qt3DSDMActionHandle CreateAction(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- SLong4 inTriggerTargetObjects) override;
- void DeleteAction(Qt3DSDMActionHandle inAction) override;
- void GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const override;
-
- bool GetActionEyeballValue(Qt3DSDMSlideHandle inActiveSlide,
- Qt3DSDMActionHandle inAction) const override;
- void SetActionEyeballValue(Qt3DSDMSlideHandle inActiveSlide, Qt3DSDMActionHandle inAction,
- bool inValue) override;
-
- virtual IActionSystemSignalProvider *GetSignalProvider();
-
-private:
- virtual IActionSystemSignalSender *GetSignalSender();
-
- CActionSystem(const CActionSystem&) = delete;
- CActionSystem& operator=(const CActionSystem&) = delete;
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/HandleSystemBase.h b/src/Runtime/ogl-runtime/src/dm/systems/HandleSystemBase.h
deleted file mode 100644
index cb8e0f6c..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/HandleSystemBase.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef HANDLESYSTEMIMPLH
-#define HANDLESYSTEMIMPLH
-
-#include <unordered_map>
-
-namespace qt3dsdm {
-
-class CHandleObject
-{
-public:
- // Type of CHandleObject
- // Each subclass needs to specify what type it is
- // This is used to avoid dynamic_cast (RTTI) which is expensive
- enum EHandleObjectType {
- EHandleObjectTypeUnknown = 0,
- EHandleObjectTypeCDataModelInstance,
- EHandleObjectTypeCDataModelPropertyDefinitionObject,
- EHandleObjectTypeSAnimationTrack,
- EHandleObjectTypeSKeyframe,
- EHandleObjectTypeSSlide,
- EHandleObjectTypeSSlideGraph,
- EHandleObjectTypeAction,
- EHandleObjectTypeActionHandlerArgument,
- EHandleObjectTypeCustomProperty,
- EHandleObjectTypeEvent,
- EHandleObjectTypeCustomHandler,
- EHandleObjectTypeHandlerParam,
- EHandleObjectTypeEnd,
- };
-
- CHandleObject(int inHandle = 0)
- : m_Handle(inHandle)
- {
- }
- virtual ~CHandleObject() {}
-
- virtual EHandleObjectType GetType() = 0;
-
- int m_Handle;
-
-private: //noncopyable
- CHandleObject(const CHandleObject&) = delete;
- CHandleObject& operator=(const CHandleObject&) = delete;
-
-};
-
-typedef std::shared_ptr<CHandleObject> THandleObjectPtr;
-
-// Note that maps don't need to copy their objects.
-typedef std::unordered_map<int, THandleObjectPtr> THandleObjectMap;
-typedef std::pair<int, THandleObjectPtr> THandleObjectPair;
-
-class IHandleBase
-{
-public:
- /**
- * Check whether a given handle exists
- */
- virtual bool HandleValid(int inHandle) const = 0;
-};
-
-struct CHandleBase : public IHandleBase
-{
- THandleObjectMap m_Objects;
- int m_NextId;
-
- CHandleBase()
- : m_NextId(1)
- {
- }
- CHandleBase(const CHandleBase &inOther)
- : m_Objects(inOther.m_Objects)
- , m_NextId(inOther.m_NextId)
- {
- }
-
- CHandleBase &operator=(const CHandleBase &inOther)
- {
- m_Objects = inOther.m_Objects;
- m_NextId = inOther.m_NextId;
- return *this;
- }
-
- // IHandleBase
- bool HandleValid(int inHandle) const override
- {
- return m_Objects.find(inHandle) != m_Objects.end();
- }
-
- template <typename T>
- static inline bool HandleObjectValid(int inHandle, const THandleObjectMap &inMap)
- {
- THandleObjectMap::const_iterator theIter = inMap.find(inHandle);
- if (theIter != inMap.end()) {
- if (theIter->second->GetType() == T::s_Type)
- return true;
- }
- return false;
- }
-
- template <typename T>
- static inline const T *GetHandleObject(int inHandle, const THandleObjectMap &inMap)
- {
- THandleObjectMap::const_iterator theIter = inMap.find(inHandle);
- if (theIter != inMap.end()) {
- if (theIter->second->GetType() == T::s_Type)
- return static_cast<const T *>(theIter->second.get());
- }
- return NULL;
- }
-
- template <typename ObjectType, typename HandleType>
- static inline void MaybeAddObject(const std::pair<int, THandleObjectPtr> &inItem,
- std::vector<HandleType> &outHandles)
- {
- if (inItem.second->GetType() == ObjectType::s_Type)
- outHandles.push_back(HandleType(inItem.first));
- }
-
- static void EraseHandle(int inHandle, THandleObjectMap &inObjects)
- {
- THandleObjectMap::iterator theFind = inObjects.find(inHandle);
- if (theFind != inObjects.end())
- inObjects.erase(theFind);
- }
-
- // Return the next unused id. There are no guarantees whether positive or negative; what this
- // will
- // guarantee is that it isn't currently used in the object map and it is non-zero.
- int GetNextId()
- {
- do {
- ++m_NextId;
- } while (m_Objects.find(m_NextId) != m_Objects.end());
- return m_NextId;
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/HandleSystemTransactions.h b/src/Runtime/ogl-runtime/src/dm/systems/HandleSystemTransactions.h
deleted file mode 100644
index 9d77884e..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/HandleSystemTransactions.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef HANDLESYSTEMTRANSACTIONSH
-#define HANDLESYSTEMTRANSACTIONSH
-#include "HandleSystemBase.h"
-#include "Qt3DSDMTransactions.h"
-
-namespace qt3dsdm {
-inline void InsertItemInMap(THandleObjectMap &inObjects,
- const std::pair<int, THandleObjectPtr> &inItem)
-{
- inObjects.insert(inItem);
-}
-inline void HandleCreateTransaction(const char *inFile, int inLine, int inHandle,
- THandleObjectMap &inObjects,
- TTransactionConsumerPtr &inConsumer)
-{
- std::pair<int, THandleObjectPtr> theEntry = *inObjects.find(inHandle);
- std::function<void()> doOp(std::bind(InsertItemInMap, std::ref(inObjects), theEntry));
- std::function<void()> undoOp(
- std::bind(CHandleBase::EraseHandle, inHandle, std::ref(inObjects)));
- TTransactionPtr theTransaction(DoCreateGenericTransaction(inFile, inLine, doOp, undoOp));
- inConsumer->OnTransaction(theTransaction);
-}
-
-inline void HandleDeleteTransaction(const char *inFile, int inLine, int inHandle,
- THandleObjectMap &inObjects,
- TTransactionConsumerPtr &inConsumer)
-{
- using namespace std;
- pair<int, THandleObjectPtr> theEntry = *inObjects.find(inHandle);
- TTransactionPtr theTransaction(DoCreateGenericTransaction(
- inFile, inLine, std::bind(CHandleBase::EraseHandle, inHandle, std::ref(inObjects)),
- std::bind(InsertItemInMap, std::ref(inObjects), theEntry)));
- inConsumer->OnTransaction(theTransaction);
-}
-
-inline void DoCreateHandleCreateTransaction(const char *inFile, int inLine,
- TTransactionConsumerPtr inConsumer, int inHandle,
- THandleObjectMap &inObjects)
-{
- RunWithConsumer(inConsumer, std::bind(HandleCreateTransaction, inFile, inLine, inHandle,
- std::ref(inObjects), std::placeholders::_1));
-}
-
-#define CREATE_HANDLE_CREATE_TRANSACTION(inConsumer, inHandle, inObjects) \
- DoCreateHandleCreateTransaction(__FILE__, __LINE__, inConsumer, inHandle, inObjects);
-
-inline void DoCreateHandleDeleteTransaction(const char *inFile, int inLine,
- TTransactionConsumerPtr inConsumer, int inHandle,
- THandleObjectMap &inObjects)
-{
- RunWithConsumer(inConsumer, std::bind(HandleDeleteTransaction, inFile, inLine, inHandle,
- std::ref(inObjects), std::placeholders::_1));
-}
-
-#define CREATE_HANDLE_DELETE_TRANSACTION(inConsumer, inHandle, inObjects) \
- DoCreateHandleDeleteTransaction(__FILE__, __LINE__, inConsumer, inHandle, inObjects);
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionCore.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionCore.h
deleted file mode 100644
index a9201462..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionCore.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_ACTION_CORE_H
-#define QT3DSDM_ACTION_CORE_H
-
-#include "Qt3DSDMHandles.h"
-#include "HandleSystemBase.h"
-#include "Qt3DSDMActionInfo.h"
-
-namespace qt3dsdm {
-const long REFERENCED_AS_OWNER = 0x01;
-const long REFERENCED_AS_TRIGGER = 0x02;
-const long REFERENCED_AS_TARGET = 0x04;
-class IStringTable;
-
-/**
- * ActionCore
- */
-class IActionCore : public IHandleBase
-{
-public:
- virtual ~IActionCore() {}
-
- virtual TStringTablePtr GetStringTablePtr() const = 0;
- virtual IStringTable &GetStringTable() const = 0;
- // Action
- virtual Qt3DSDMActionHandle CreateAction(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- SLong4 inTriggerTargetObjects) = 0;
- virtual void DeleteAction(Qt3DSDMActionHandle inAction, Qt3DSDMInstanceHandle &outInstance) = 0;
- virtual const SActionInfo &GetActionInfo(Qt3DSDMActionHandle inAction) const = 0;
- virtual void GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const = 0;
- virtual void GetActions(Qt3DSDMSlideHandle inSlide, TActionHandleList &outActions) const = 0;
- virtual void GetActions(Qt3DSDMInstanceHandle inOwner, TActionHandleList &outActions) const = 0;
- virtual void GetActions(TActionHandleList &outActions) const = 0;
-
- // Return the instance that was allocated for this action.
- virtual Qt3DSDMInstanceHandle GetActionInstance(Qt3DSDMActionHandle inAction) const = 0;
- // Reverse lookup into the action system so you can match actions to instances.
- virtual Qt3DSDMActionHandle GetActionByInstance(Qt3DSDMInstanceHandle inActionInstance) const = 0;
-
- // Action Properties
- virtual void SetTriggerObject(Qt3DSDMActionHandle inAction,
- const SObjectRefType &inTriggerObject) = 0;
- virtual void SetTargetObject(Qt3DSDMActionHandle inAction,
- const SObjectRefType &inTargetObject) = 0;
- virtual void SetEvent(Qt3DSDMActionHandle inAction, const wstring &inEventName) = 0;
- virtual void SetHandler(Qt3DSDMActionHandle inAction, const wstring &inHandlerName) = 0;
-
- // Handler Argument
- virtual Qt3DSDMHandlerArgHandle AddHandlerArgument(Qt3DSDMActionHandle inAction,
- const TCharStr &inName,
- HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) = 0;
- virtual void RemoveHandlerArgument(Qt3DSDMHandlerArgHandle inHandlerArgument) = 0;
- virtual const SHandlerArgumentInfo &
- GetHandlerArgumentInfo(Qt3DSDMHandlerArgHandle inHandlerArgument) const = 0;
- virtual void GetHandlerArguments(Qt3DSDMActionHandle inAction,
- THandlerArgHandleList &outHandlerArguments) const = 0;
-
- // Handler Argument Properties
- virtual void GetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument,
- SValue &outValue) const = 0;
- virtual void SetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument,
- const SValue &inValue) = 0;
-};
-
-typedef std::shared_ptr<IActionCore> TActionCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionInfo.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionInfo.h
deleted file mode 100644
index 40fd9645..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionInfo.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_ACTION_INFO_H
-#define QT3DSDM_ACTION_INFO_H
-
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMMetaDataTypes.h"
-
-namespace qt3dsdm {
-using std::wstring;
-struct SActionInfo
-{
- // InstanceHandle corresponding to this action (to store other properties not listed here)
- Qt3DSDMInstanceHandle m_Instance;
-
- // Where the action is added to
- Qt3DSDMSlideHandle m_Slide; // the slide that the action is added to
- Qt3DSDMInstanceHandle
- m_Owner; // the object that the action is added to (the owner of the action)
-
- // Trigger object
- SObjectRefType m_TriggerObject; // trigger object
- wstring m_Event; // the list of applicable events is based on object type and stored, by type,
- // in metadata
-
- // Target object
- SObjectRefType m_TargetObject; // target object
- wstring m_Handler; // the list of applicable action handlers is loaded from metadata xml file
- // and based on object type
- THandlerArgHandleList m_HandlerArgs; // the list of applicable action arguments is dependent on
- // the handler and loaded from the metadata xml file.
-
- SActionInfo() {}
-
- SActionInfo(Qt3DSDMInstanceHandle inInstance, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner)
- : m_Instance(inInstance)
- , m_Slide(inSlide)
- , m_Owner(inOwner)
- {
- }
-};
-
-struct SHandlerArgumentInfo
-{
- Qt3DSDMActionHandle m_Action; // Action that owns this Action Argument
- TCharStr m_Name; // Name of the Action Argument
- HandlerArgumentType::Value m_ArgType; // m_ArgType will override m_ValueType
- DataModelDataType::Value m_ValueType; // m_ValueType is ignored if ArgType is specified
- SValue m_Value; // Value of the Action Argument
-
- SHandlerArgumentInfo()
- : m_ArgType(HandlerArgumentType::None)
- , m_ValueType(DataModelDataType::None)
- {
- }
-
- SHandlerArgumentInfo(Qt3DSDMActionHandle inAction, const TCharStr &inName,
- HandlerArgumentType::Value inArgType, DataModelDataType::Value inValueType)
- : m_Action(inAction)
- , m_Name(inName)
- , m_ArgType(inArgType)
- , m_ValueType(inValueType)
- {
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionSystem.h
deleted file mode 100644
index 8713729a..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMActionSystem.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_ACTION_SYSTEM_H
-#define QT3DSDM_ACTION_SYSTEM_H
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMActionCore.h"
-
-namespace qt3dsdm {
-/**
- * ActionSystem acts as a wrapper or helper around ActionCore. ActionSystem will call
- * ActionCore and perform other necessary setups. It also has the knowledge of other
- * system or core so there are some synchronization being done here.
- *
- * When in doubts which one to use (ActionSystem or ActionCore), always use ActionSystem
- */
-class IActionSystem
-{
-public:
- virtual ~IActionSystem() {}
-
- // CreateAction will create Action's InstanceHandle and Action's ActionHandle and do some
- // necessary setup
- virtual Qt3DSDMActionHandle CreateAction(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- SLong4 inTriggerTargetObjects) = 0;
- // DeleteAction will delete both Action's ActionHandle and Action's InstanceHandle
- virtual void DeleteAction(Qt3DSDMActionHandle inAction) = 0;
- // Return all actions that belong to a certain instance in a certain slide + the master slide
- virtual void GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const = 0;
-
- // Get/set action eyeball property value
- virtual bool GetActionEyeballValue(Qt3DSDMSlideHandle inActiveSlide,
- Qt3DSDMActionHandle inAction) const = 0;
- virtual void SetActionEyeballValue(Qt3DSDMSlideHandle inActiveSlide, Qt3DSDMActionHandle inAction,
- bool inValue) = 0;
-};
-
-typedef std::shared_ptr<IActionSystem> TActionSystemPtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMAnimation.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMAnimation.h
deleted file mode 100644
index 457b042f..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMAnimation.h
+++ /dev/null
@@ -1,841 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DSDM_ANIMATION_H
-#define QT3DSDM_ANIMATION_H
-
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMValue.h"
-
-namespace qt3dsdm {
-
-struct SLinearKeyframe
-{
- float m_KeyframeSeconds;
- float m_KeyframeValue;
-};
-
-struct SBezierKeyframe : public SLinearKeyframe
-{
- float m_InTangentTime; // time
- float m_InTangentValue; // value offset
- float m_OutTangentTime; // time offset in seconds
- float m_OutTangentValue; // value offset
-};
-
-typedef std::vector<SBezierKeyframe> TBezierKeyframeList;
-
-/**
- * Ease in/out are parameters that affect the bezier evaluation.
- * Ease in/out at 100 means that the control values are at the end points thus creating
- * a gradual deceleration. Ease in/out at 0 means that interpolation is linear, the
- * control points are at 1/3 and 2/3's the distance to the next value.
- * Ease in/out go from 0.f to 100.0f
- */
-struct SEaseInEaseOutKeyframe : public SLinearKeyframe
-{
- float m_EaseIn;
- float m_EaseOut;
-};
-
-} // namespace qt3dsdm
-
-namespace qt3ds {
-namespace foundation {
- // Disable calling destructor of these pod types
- template <>
- struct DestructTraits<qt3dsdm::SEaseInEaseOutKeyframe>
- {
- void destruct(qt3dsdm::SEaseInEaseOutKeyframe &) {}
- };
- template <>
- struct DestructTraits<qt3dsdm::SBezierKeyframe>
- {
- void destruct(qt3dsdm::SBezierKeyframe &) {}
- };
- template <>
- struct DestructTraits<qt3dsdm::SLinearKeyframe>
- {
- void destruct(qt3dsdm::SLinearKeyframe &) {}
- };
-}
-}
-
-namespace qt3dsdm {
-
-enum EAnimationType {
- EAnimationTypeNone = 0,
- EAnimationTypeLinear,
- EAnimationTypeBezier,
- EAnimationTypeEaseInOut,
-};
-
-template <typename TDataType>
-struct SAnimationTypeTraits
-{
-};
-
-template <>
-struct SAnimationTypeTraits<SBezierKeyframe>
-{
- EAnimationType getType() { return EAnimationTypeBezier; }
-};
-template <>
-struct SAnimationTypeTraits<SLinearKeyframe>
-{
- EAnimationType getType() { return EAnimationTypeLinear; }
-};
-template <>
-struct SAnimationTypeTraits<SEaseInEaseOutKeyframe>
-{
- EAnimationType getType() { return EAnimationTypeEaseInOut; }
-};
-
-struct SKeyframeUnionTraits
-{
- typedef EAnimationType TIdType;
- enum {
- TBufferSize = sizeof(SBezierKeyframe),
- };
- static TIdType getNoDataId() { return EAnimationTypeNone; }
- template <typename TDataType>
- static TIdType getType()
- {
- return SAnimationTypeTraits<TDataType>().getType();
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case EAnimationTypeBezier:
- return inVisitor(*reinterpret_cast<SBezierKeyframe *>(inData));
- case EAnimationTypeLinear:
- return inVisitor(*reinterpret_cast<SLinearKeyframe *>(inData));
- case EAnimationTypeEaseInOut:
- return inVisitor(*reinterpret_cast<SEaseInEaseOutKeyframe *>(inData));
- default:
- QT3DS_ASSERT(false);
- case EAnimationTypeNone:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case EAnimationTypeBezier:
- return inVisitor(*reinterpret_cast<const SBezierKeyframe *>(inData));
- case EAnimationTypeLinear:
- return inVisitor(*reinterpret_cast<const SLinearKeyframe *>(inData));
- case EAnimationTypeEaseInOut:
- return inVisitor(*reinterpret_cast<const SEaseInEaseOutKeyframe *>(inData));
- default:
- QT3DS_ASSERT(false);
- case EAnimationTypeNone:
- return inVisitor();
- }
- }
-};
-
-typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SKeyframeUnionTraits,
- SKeyframeUnionTraits::TBufferSize>,
- SKeyframeUnionTraits::TBufferSize>
- TKeyframe;
-
-template <>
-struct Qt3DSDMGetter<TKeyframe>
-{
- template <typename TRetType>
- TRetType doGet(const TKeyframe &inValue)
- {
- return inValue.getData<TRetType>();
- }
-};
-
-typedef std::vector<TKeyframe> TKeyframeList;
-
-struct SAnimationInfo
-{
- Qt3DSDMSlideHandle m_Slide;
- Qt3DSDMInstanceHandle m_Instance;
- Qt3DSDMPropertyHandle m_Property;
- size_t m_Index;
- EAnimationType m_AnimationType;
- // Use the existing value for the value of the first keyframe.
- // Not reflected in studio at this time, purely a runtime problem.
- // Defaults to false
- bool m_DynamicFirstKeyframe;
- bool m_ArtistEdited;
- SAnimationInfo()
- : m_Index(0)
- , m_AnimationType(EAnimationTypeLinear)
- , m_DynamicFirstKeyframe(false)
- // Animations are assumed to be artist edited.
- // And any change will force this flag to true.
- , m_ArtistEdited(true)
-
- {
- }
- SAnimationInfo(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex, EAnimationType inAnimationType,
- bool inDynamicFirstKeyframe, bool inArtistEdited)
- : m_Slide(inSlide)
- , m_Instance(inInstance)
- , m_Property(inProperty)
- , m_Index(inIndex)
- , m_AnimationType(inAnimationType)
- , m_DynamicFirstKeyframe(inDynamicFirstKeyframe)
- , m_ArtistEdited(inArtistEdited)
- {
- }
-};
-
-typedef std::pair<SAnimationInfo, TKeyframeList> TAnimationKeyframesPair;
-typedef std::vector<TAnimationKeyframesPair> TAnimationKeyframesPairList;
-typedef std::vector<SAnimationInfo> TAnimationInfoList;
-
-/**
- * Pure animation core. Not wrapped in any niceties.
- */
-class IAnimationCore
-{
-public:
- virtual ~IAnimationCore() {}
- virtual Qt3DSDMAnimationHandle CreateAnimation(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic) = 0;
- virtual void DeleteAnimation(Qt3DSDMAnimationHandle inAnimation) = 0;
- virtual Qt3DSDMAnimationHandle GetAnimation(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- size_t inIndex) const = 0;
- virtual SAnimationInfo GetAnimationInfo(Qt3DSDMAnimationHandle inAnimation) const = 0;
- virtual void GetAnimations(TAnimationHandleList &outAnimations) const = 0;
- virtual void GetAnimations(TAnimationInfoList &outAnimations,
- Qt3DSDMSlideHandle inMaster = Qt3DSDMSlideHandle(),
- Qt3DSDMSlideHandle inSlide = Qt3DSDMSlideHandle()) const = 0;
-
- virtual void GetSpecificInstanceAnimations(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TAnimationHandleList &outAnimations) = 0;
-
- virtual void SetFirstKeyframeDynamic(Qt3DSDMAnimationHandle inAnimation, bool inValue) = 0;
-
- // keyframe manipulation
- virtual Qt3DSDMKeyframeHandle InsertKeyframe(Qt3DSDMAnimationHandle inAnimation,
- const TKeyframe &inKeyframe) = 0;
- virtual void EraseKeyframe(Qt3DSDMKeyframeHandle inKeyframe) = 0;
- virtual void DeleteAllKeyframes(Qt3DSDMAnimationHandle inAnimation) = 0;
-
- // All of these mutators will force the artist edited property
- // of the animation to true.
- virtual Qt3DSDMAnimationHandle
- GetAnimationForKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const = 0;
- virtual TKeyframe GetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe) const = 0;
- virtual void SetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) = 0;
- virtual void GetKeyframes(Qt3DSDMAnimationHandle inAnimation,
- TKeyframeHandleList &outKeyframes) const = 0;
- virtual size_t GetKeyframeCount(Qt3DSDMAnimationHandle inAnimation) const = 0;
- virtual bool IsFirstKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const = 0;
-
- virtual void OffsetAnimations(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- long inOffset) = 0;
-
- // Direct mutators of the artist edited feature of animations
- virtual void SetIsArtistEdited(Qt3DSDMAnimationHandle inAnimation, bool inEdited = true) = 0;
- virtual bool IsArtistEdited(Qt3DSDMAnimationHandle inAnimation) const = 0;
-
- // Animation Evaluation.
- virtual float EvaluateAnimation(Qt3DSDMAnimationHandle inAnimation, float inSeconds) const = 0;
-
- virtual bool KeyframeValid(Qt3DSDMKeyframeHandle inKeyframe) const = 0;
- virtual bool AnimationValid(Qt3DSDMAnimationHandle inAnimation) const = 0;
-
- virtual void CopyAnimations(Qt3DSDMSlideHandle inSourceSlide,
- Qt3DSDMInstanceHandle inSourceInstance,
- Qt3DSDMSlideHandle inDestSlide,
- Qt3DSDMInstanceHandle inDestInstance) = 0;
-};
-
-typedef std::shared_ptr<IAnimationCore> TAnimationCorePtr;
-
-struct SGetOrSetKeyframeInfo
-{
- float m_Value = 0.0;
- float m_EaseIn = -1.f;
- float m_EaseOut = -1.f;
- bool m_AnimationTrackIsDynamic = false;
-
- SGetOrSetKeyframeInfo(float inValue, float inEaseIn = -1.f, float inEaseOut = -1.f,
- bool inDynamic = false)
- : m_Value(inValue)
- , m_EaseIn(inEaseIn)
- , m_EaseOut(inEaseOut)
- , m_AnimationTrackIsDynamic(inDynamic)
- {
- }
- SGetOrSetKeyframeInfo() = default;
-
-};
-/**
- * Interface from studio into the animation system that speaks
- * a language near to that of studio. Public interface.
- */
-class IStudioAnimationSystem
-{
-public:
- virtual ~IStudioAnimationSystem() {}
-
- /**
- * When auto-keyframing is on, all calls to setinstancepropertyvalue will
- * case a keyframe to be set if the instance is a member of a slide graph.
- */
- virtual void SetAutoKeyframe(bool inAutoKeyframe) = 0;
- /**
- * Returns true when auto keyframing is set.
- */
- virtual bool GetAutoKeyframe() const = 0;
- /**
- * Create animation on the property on this instance. If the property was animated and had
- *keyframes previously,
- * this function will also set the keyframes accordingly.
- */
- virtual void Animate(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) = 0;
- /**
- * Delete animation on the property on this instance
- */
- virtual void Deanimate(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) = 0;
- /**
- * Set a keyframe on this property. Uses the current time of the slide graph.
- * If the keyframe is within a given time distance of another, this function will simply change
- * the keyframed value of the other property to match the current value of this property.
- */
- virtual void KeyframeProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- bool inDoDiffValue) = 0;
- /**
- * Set the value of a existing a keyframe or create a new one, on this property, at the given
- *time.
- * If ease in or ease out are unset then the keyframe gets the default ease in or out.
- */
- virtual void SetOrCreateKeyframe(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, float inTimeInSeconds,
- SGetOrSetKeyframeInfo *inKeyframeInfo, size_t inNumInfos) = 0;
- /**
- * Return the animation that is currently controlling this property. This function will return
- * an invalid handle value if there is currently no animation controlling this property.
- */
- virtual Qt3DSDMAnimationHandle GetControllingAnimation(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- size_t inIndex) const = 0;
-
- /**
- * Return true if the given property is animatable. You can begin animation by calling
- *KeyframeProperty *or*
- * by setting auto keyframe to on and setting a property value through the
- *IInstancePropertyCore system.
- */
- virtual bool IsPropertyAnimatable(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
-
- /**
- * Return true if the given property is animated. Currently, either 0 or ALL channels are
- *animated. Hence, checking for index = 0 suffices.
- * And if that changes, this function can be updated accordingly.
- */
- virtual bool IsPropertyAnimated(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
-
- /**
- * Specify if new keyframes should be created with smooth ( ie Ease In/Out values = 100 ) or
- *linear ( Ease In/Out values = 0 )
- */
- virtual void SetInterpolation(bool inSmooth) = 0;
-
- /**
- * Get an instance property value. Will override outValue only if the slide, instance,
- *property is animated.
- */
- virtual bool GetAnimatedInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
- /**
- * Set an instance property value. Will return true in the cases where
- * the property is actually animated. May only set local values, or may auto set a keyframed
- *value.
- */
- virtual bool SetAnimatedInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- typedef std::function<void(Qt3DSDMInstanceHandle instance)> TRefreshCallbackFunc;
- virtual void setRefreshCallback(TRefreshCallbackFunc func) = 0;
-};
-
-typedef std::shared_ptr<IStudioAnimationSystem> TStudioAnimationSystemPtr;
-
-inline SLinearKeyframe CreateLinearKeyframe(float inSeconds, float inValue)
-{
- SLinearKeyframe retval = { inSeconds, inValue };
- return retval;
-}
-
-inline SBezierKeyframe CreateBezierKeyframe(float inSeconds, float inValue, float inInTangentTime,
- float inInTangentValue, float inOutTangentTime,
- float inOutTangentValue)
-{
- SBezierKeyframe theBezierKeyframe;
- theBezierKeyframe.m_KeyframeSeconds = inSeconds;
- theBezierKeyframe.m_KeyframeValue = inValue;
- theBezierKeyframe.m_InTangentTime = inInTangentTime;
- theBezierKeyframe.m_InTangentValue = inInTangentValue;
- theBezierKeyframe.m_OutTangentTime = inOutTangentTime;
- theBezierKeyframe.m_OutTangentValue = inOutTangentValue;
- return theBezierKeyframe;
-}
-
-inline SEaseInEaseOutKeyframe CreateEaseInEaseOutKeyframe(float inSeconds, float inValue,
- float inEaseIn, float inEaseOut)
-{
- SEaseInEaseOutKeyframe retval;
- retval.m_KeyframeSeconds = inSeconds;
- retval.m_KeyframeValue = inValue;
- retval.m_EaseIn = inEaseIn;
- retval.m_EaseOut = inEaseOut;
- return retval;
-}
-
-inline SAnimationInfo CreateAnimationInfo(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic, bool inArtistEdited)
-{
- SAnimationInfo retval(inSlide, inInstance, inProperty, inIndex, inAnimationType,
- inFirstKeyframeDynamic, inArtistEdited);
- return retval;
-}
-
-struct SKeyframeValueVisitor
-{
- float operator()(const SLinearKeyframe &inKeyframe) const { return inKeyframe.m_KeyframeValue; }
- float operator()(const SBezierKeyframe &inKeyframe) const { return inKeyframe.m_KeyframeValue; }
- float operator()(const SEaseInEaseOutKeyframe &inKeyframe) const
- {
- return inKeyframe.m_KeyframeValue;
- }
- float operator()()
- {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-};
-
-inline float KeyframeValueValue(const TKeyframe &inKeyframe)
-{
- return inKeyframe.visit<float>(SKeyframeValueVisitor());
-}
-
-struct SKeyframeTimeAnalyzer
-{
- float operator()(const SLinearKeyframe &inValue) const { return inValue.m_KeyframeSeconds; }
- float operator()(const SBezierKeyframe &inValue) const { return inValue.m_KeyframeSeconds; }
- float operator()(const SEaseInEaseOutKeyframe &inValue) const
- {
- return inValue.m_KeyframeSeconds;
- }
- float operator()()
- {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-};
-
-inline float KeyframeTime(const TKeyframe &inValue)
-{
- return inValue.visit<float>(SKeyframeTimeAnalyzer());
-}
-
-inline EAnimationType GetKeyframeType(const TKeyframe &inKeyframe)
-{
- return inKeyframe.getType();
-}
-
-struct SAnimatableArityVisitor
-{
- std::tuple<bool, size_t> operator()(bool) const
- {
- return std::tuple<bool, size_t>(true, 1);
- }
- std::tuple<bool, size_t> operator()(long) const
- {
- return std::tuple<bool, size_t>(true, 1);
- }
- std::tuple<bool, size_t> operator()(float) const
- {
- return std::tuple<bool, size_t>(true, 1);
- }
- std::tuple<bool, size_t> operator()(const SFloat2 &) const
- {
- return std::tuple<bool, size_t>(true, 2);
- }
- std::tuple<bool, size_t> operator()(const SFloat3 &) const
- {
- return std::tuple<bool, size_t>(true, 3);
- }
- std::tuple<bool, size_t> operator()(const SFloat4 &) const
- {
- return std::tuple<bool, size_t>(true, 4);
- }
- template <typename TDataType>
- std::tuple<bool, size_t> operator()(const TDataType &) const
- {
- return std::tuple<bool, size_t>(false, 0);
- }
- std::tuple<bool, size_t> operator()()
- {
- QT3DS_ASSERT(false);
- return std::tuple<bool, size_t>(false, 0);
- }
-};
-
-inline std::tuple<bool, size_t> GetVariantAnimatableAndArity(const SValue &inValue)
-{
- return inValue.visit<std::tuple<bool, size_t>>(SAnimatableArityVisitor());
-}
-
-inline std::tuple<bool, size_t> GetDatatypeAnimatableAndArity(DataModelDataType::Value inDataType)
-{
- switch (inDataType) {
- case DataModelDataType::Long:
- case DataModelDataType::Float:
- return std::make_tuple(true, 1);
-
- case DataModelDataType::Float2:
- return std::make_tuple(true, 2);
-
- case DataModelDataType::Float3:
- return std::make_tuple(true, 3);
-
- case DataModelDataType::Float4:
- return std::make_tuple(true, 4);
-
- default:
- return std::make_tuple(false, 0);
- }
-}
-
-template <typename TDataType>
-inline TDataType SetFloatValue(float inValue, size_t inIndex, const TDataType &inDataType)
-{
- TDataType retval(inDataType);
- retval[inIndex] = inValue;
- return retval;
-}
-
-struct SAnimationApplier
-{
- float m_Value;
- size_t m_Index;
- SValue operator()(const bool &) { return m_Value > 0.5f; }
- SValue operator()(const qt3ds::QT3DSI32 &) { return static_cast<qt3ds::QT3DSI32>(m_Value + .5f); }
- SValue operator()(const float &) { return m_Value; }
- SValue operator()(const SFloat2 &inValue) { return SetFloatValue(m_Value, m_Index, inValue); }
- SValue operator()(const SFloat3 &inValue) { return SetFloatValue(m_Value, m_Index, inValue); }
- SValue operator()(const SFloat4 &inValue) { return SetFloatValue(m_Value, m_Index, inValue); }
- template <typename TDataType>
- SValue operator()(const TDataType &inValue)
- {
- return inValue;
- }
- SValue operator()()
- {
- QT3DS_ASSERT(false);
- return SValue();
- }
-};
-
-inline void SetAnimationValue(float inValue, size_t inIndex, SValue &ioValue)
-{
- using namespace std;
- SAnimationApplier theApplier;
- theApplier.m_Value = inValue;
- theApplier.m_Index = inIndex;
- ioValue = ioValue.visit<SValue>(theApplier);
-}
-
-template <typename TDataType>
-inline float GetFloatValue(const TDataType &inValue, size_t inIndex)
-{
- return inValue[inIndex];
-}
-
-struct SAnimationGetter
-{
- size_t m_Index;
- float operator()(const bool &inValue) const { return inValue ? 1.f : 0.f; }
- float operator()(const long &inValue) const { return static_cast<float>(inValue); }
- float operator()(const float &inValue) const { return inValue; }
- float operator()(const SFloat2 &inValue) const { return GetFloatValue(inValue, m_Index); }
- float operator()(const SFloat3 &inValue) const { return GetFloatValue(inValue, m_Index); }
- float operator()(const SFloat4 &inValue) const { return GetFloatValue(inValue, m_Index); }
- template <typename TDataType>
- float operator()(const TDataType & /*inValue*/) const
- {
- return 0.f;
- }
- float operator()()
- {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-};
-
-inline float GetAnimationValue(size_t inIndex, const SValue &ioValue)
-{
- SAnimationGetter theGetter;
- theGetter.m_Index = inIndex;
- return ioValue.visit<float>(theGetter);
-}
-
-struct SKeyframeTimeSetter
-{
- float m_Seconds;
- TKeyframe operator()(const SLinearKeyframe &inValue) const
- {
- return CreateLinearKeyframe(m_Seconds, inValue.m_KeyframeValue);
- }
- TKeyframe operator()(const SBezierKeyframe &inValue) const
- {
- return CreateBezierKeyframe(m_Seconds, inValue.m_KeyframeValue, inValue.m_InTangentTime,
- inValue.m_InTangentValue, inValue.m_OutTangentTime,
- inValue.m_OutTangentValue);
- }
- TKeyframe operator()(const SEaseInEaseOutKeyframe &inValue) const
- {
- return CreateEaseInEaseOutKeyframe(m_Seconds, inValue.m_KeyframeValue, inValue.m_EaseIn,
- inValue.m_EaseOut);
- }
- TKeyframe operator()()
- {
- QT3DS_ASSERT(false);
- return TKeyframe();
- }
-};
-
-inline TKeyframe SetKeyframeSeconds(const TKeyframe &inKeyframe, float inSeconds)
-{
- SKeyframeTimeSetter theSetter;
- theSetter.m_Seconds = inSeconds;
- return inKeyframe.visit<TKeyframe>(theSetter);
-}
-
-struct SKeyframeTimeGetter
-{
- template <typename TKeyframeType>
- float operator()(const TKeyframeType &inValue) const
- {
- return inValue.m_KeyframeSeconds;
- }
- float operator()()
- {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-};
-
-inline float GetKeyframeSeconds(const TKeyframe &inKeyframe)
-{
- SKeyframeTimeGetter theGetter;
- return inKeyframe.visit<float>(theGetter);
-}
-
-struct SKeyframeValueSetter
-{
- float m_Value;
- TKeyframe operator()(const SLinearKeyframe &inValue) const
- {
- return CreateLinearKeyframe(inValue.m_KeyframeSeconds, m_Value);
- }
- TKeyframe operator()(const SBezierKeyframe &inValue) const
- {
- return CreateBezierKeyframe(inValue.m_KeyframeSeconds, m_Value, inValue.m_InTangentTime,
- inValue.m_InTangentValue, inValue.m_OutTangentTime,
- inValue.m_OutTangentValue);
- }
- TKeyframe operator()(const SEaseInEaseOutKeyframe &inValue) const
- {
- return CreateEaseInEaseOutKeyframe(inValue.m_KeyframeSeconds, m_Value, inValue.m_EaseIn,
- inValue.m_EaseOut);
- }
- TKeyframe operator()()
- {
- QT3DS_ASSERT(false);
- return TKeyframe();
- }
-};
-
-inline TKeyframe SetKeyframeValue(const TKeyframe &inKeyframe, float inValue)
-{
- SKeyframeValueSetter theSetter;
- theSetter.m_Value = inValue;
- return inKeyframe.visit<TKeyframe>(theSetter);
-}
-
-inline float AnimationClamp(float inLowerBound, float inUpperBound, float inValue)
-{
- if (inValue < inLowerBound)
- return inLowerBound;
- if (inValue > inUpperBound)
- return inUpperBound;
- return inValue;
-}
-
-inline SBezierKeyframe
-CreateBezierKeyframeFromEaseInEaseOutKeyframe(float *inPreviousValue,
- SEaseInEaseOutKeyframe inCurrent, float *inNextValue)
-{
- float theValue = inCurrent.m_KeyframeValue;
- float theSeconds = inCurrent.m_KeyframeSeconds;
- float inSeconds = 0.f;
- float inValue = 0.f;
- float outSeconds = 0.f;
- float outValue = 0.f;
- if (inPreviousValue) {
- float thePercent = 1.0f - AnimationClamp(0.0f, 1.0f, inCurrent.m_EaseIn / 100.f);
- double theAmount = 1.0f - thePercent * .333333333334;
- inValue = (float)(*inPreviousValue
- + ((inCurrent.m_KeyframeValue - *inPreviousValue) * theAmount));
- }
- if (inNextValue) {
- float thePercent = 1.0f - AnimationClamp(0.0f, 1.0f, inCurrent.m_EaseOut / 100.f);
- double theAmount = thePercent * .3333333333334;
- outValue = (float)(inCurrent.m_KeyframeValue
- + ((*inNextValue - inCurrent.m_KeyframeValue) * theAmount));
- }
- return CreateBezierKeyframe(theSeconds, theValue, inSeconds, inValue, outSeconds, outValue);
-}
-
-void CopyKeyframes(const IAnimationCore &inSourceAnimationCore, IAnimationCore &inDestAnimationCore,
- Qt3DSDMAnimationHandle inDestAnimation, const TKeyframeHandleList &inKeyframes);
-
-Qt3DSDMAnimationHandle CopyAnimation(TAnimationCorePtr inSourceAnimationCore,
- Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMSlideHandle inNewSlide,
- Qt3DSDMInstanceHandle inNewInstance,
- Qt3DSDMPropertyHandle inNewProperty, size_t inNewIndex);
-
-struct SEaseInGetter
-{
- float operator()(const SLinearKeyframe &) const { return 0.f; }
- float operator()(const SBezierKeyframe &) const { return 0.f; }
- float operator()(const SEaseInEaseOutKeyframe &inValue) const { return inValue.m_EaseIn; }
- float operator()()
- {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-};
-struct SEaseOutGetter
-{
- float operator()(const SLinearKeyframe &) const { return 0.f; }
- float operator()(const SBezierKeyframe &) const { return 0.f; }
- float operator()(const SEaseInEaseOutKeyframe &inValue) const { return inValue.m_EaseOut; }
- float operator()()
- {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-};
-inline void GetEaseInOutValues(const TKeyframe &inValue, float &outEaseIn, float &outEaseOut)
-{
- SEaseInGetter theGetter;
- outEaseIn = inValue.visit<float>(theGetter);
-
- SEaseOutGetter theEaseOutGetter;
- outEaseOut = inValue.visit<float>(theEaseOutGetter);
-}
-
-struct SEaseInSetter
-{
- float m_Value;
- TKeyframe operator()(SLinearKeyframe &inValue) const { return inValue; }
- TKeyframe operator()(SBezierKeyframe &inValue) const { return inValue; }
- TKeyframe operator()(SEaseInEaseOutKeyframe &inKeyframe) const
- {
- inKeyframe.m_EaseIn = m_Value;
- return inKeyframe;
- }
- TKeyframe operator()()
- {
- QT3DS_ASSERT(false);
- return TKeyframe();
- }
-};
-struct SEaseOutSetter
-{
- float m_Value;
- TKeyframe operator()(SLinearKeyframe &inValue) const { return inValue; }
- TKeyframe operator()(SBezierKeyframe &inValue) const { return inValue; }
- TKeyframe operator()(SEaseInEaseOutKeyframe &inKeyframe) const
- {
- inKeyframe.m_EaseOut = m_Value;
- return inKeyframe;
- }
- TKeyframe operator()()
- {
- QT3DS_ASSERT(false);
- return TKeyframe();
- }
-};
-inline TKeyframe SetEaseInOutValues(TKeyframe &inKeyframe, float inEaseIn, float inEaseOut)
-{
- SEaseInSetter theSetter;
- theSetter.m_Value = inEaseIn;
- inKeyframe.visit<TKeyframe>(theSetter);
-
- SEaseOutSetter theEaseOutSetter;
- theEaseOutSetter.m_Value = inEaseOut;
- inKeyframe.visit<TKeyframe>(theEaseOutSetter);
-
- return inKeyframe;
-}
-
-void GetKeyframesAsBezier(Qt3DSDMAnimationHandle inAnimation, const IAnimationCore &inAnimationCore,
- TBezierKeyframeList &outKeyframes);
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.cpp
deleted file mode 100644
index 2bd89418..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.cpp
+++ /dev/null
@@ -1,579 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMComposerTypeDefinitions.h"
-#include <memory>
-#include "Qt3DSDMDataCore.h"
-#include "SimpleDataCore.h"
-#include "DataCoreProducer.h"
-#include "Qt3DSDMSlideCore.h"
-
-#include <QtGlobal>
-
-using namespace qt3dsdm;
-using std::make_shared;
-using std::shared_ptr;
-
-#ifdef _WIN32
-#pragma warning(disable : 4100)
-#endif
-
-// SComposerTypePropertyDefinition constructors
-
-namespace {
-
-template <typename TDataType>
-struct DataConstructor
-{
- template <typename TInputType>
- TDataType Construct(const TInputType &inInput)
- {
- return TDataType(inInput);
- }
-};
-
-template <>
-struct DataConstructor<SLong4>
-{
- SLong4 Construct(int inValue)
- {
- unsigned long theValue((unsigned long)inValue);
- return SLong4(theValue, theValue, theValue, theValue);
- }
-};
-
-template <>
-struct DataConstructor<TDataStrPtr>
-{
- TDataStrPtr Construct(const wchar_t *inData)
- {
- if (IsTrivial(inData))
- return make_shared<CDataStr>();
- return make_shared<CDataStr>(inData);
- }
-};
-template <>
-struct DataConstructor<SStringOrInt>
-{
- SStringOrInt Construct(const wchar_t *inData)
- {
- if (IsTrivial(inData))
- return make_shared<CDataStr>();
- return make_shared<CDataStr>(inData);
- }
-};
-template <>
-struct DataConstructor<SObjectRefType>
-{
- SObjectRefType Construct(const wchar_t *) { return SObjectRefType(); }
-};
-}
-
-#define QT3DS_WCHAR_T_Typed L"Typed"
-#define QT3DS_WCHAR_T_Guided L"Guided"
-#define QT3DS_WCHAR_T_Named L"Named"
-#define QT3DS_WCHAR_T_SlideOwner L"SlideOwner"
-#define QT3DS_WCHAR_T_Slide L"Slide"
-#define QT3DS_WCHAR_T_Action L"Action"
-#define QT3DS_WCHAR_T_Asset L"Asset"
-#define QT3DS_WCHAR_T_Scene L"Scene"
-#define QT3DS_WCHAR_T_Image L"Image"
-#define QT3DS_WCHAR_T_Material L"Material"
-#define QT3DS_WCHAR_T_Behavior L"Behavior"
-#define QT3DS_WCHAR_T_Node L"Node"
-#define QT3DS_WCHAR_T_Layer L"Layer"
-#define QT3DS_WCHAR_T_Group L"Group"
-#define QT3DS_WCHAR_T_Model L"Model"
-#define QT3DS_WCHAR_T_Light L"Light"
-#define QT3DS_WCHAR_T_Camera L"Camera"
-#define QT3DS_WCHAR_T_Component L"Component"
-#define QT3DS_WCHAR_T_Text L"Text"
-#define QT3DS_WCHAR_T_Effect L"Effect"
-#define QT3DS_WCHAR_T_RenderPlugin L"RenderPlugin"
-#define QT3DS_WCHAR_T_MaterialBase L"MaterialBase"
-#define QT3DS_WCHAR_T_CustomMaterial L"CustomMaterial"
-#define QT3DS_WCHAR_T_ReferencedMaterial L"ReferencedMaterial"
-#define QT3DS_WCHAR_T_Alias L"Alias"
-#define QT3DS_WCHAR_T_Lightmaps L"Lightmaps"
-
-#define QT3DS_WCHAR_T_type L"type"
-#define QT3DS_WCHAR_T_id L"id"
-#define QT3DS_WCHAR_T_name L"name"
-#define QT3DS_WCHAR_T_componentid L"componentid"
-#define QT3DS_WCHAR_T_playmode L"playmode"
-#define QT3DS_WCHAR_T_playthroughto L"playthroughto"
-#define QT3DS_WCHAR_T_initialplaystate L"initialplaystate"
-#define QT3DS_WCHAR_T_actioneyeball L"actioneyeball"
-#define QT3DS_WCHAR_T_sourcepath L"sourcepath"
-#define QT3DS_WCHAR_T_importid L"importid"
-#define QT3DS_WCHAR_T_starttime L"starttime"
-#define QT3DS_WCHAR_T_endtime L"endtime"
-#define QT3DS_WCHAR_T_eyeball L"eyeball"
-#define QT3DS_WCHAR_T_shy L"shy"
-#define QT3DS_WCHAR_T_locked L"locked"
-#define QT3DS_WCHAR_T_timebarcolor L"timebarcolor"
-#define QT3DS_WCHAR_T_timebartext L"timebartext"
-#define QT3DS_WCHAR_T_bgcolorenable L"bgcolorenable"
-#define QT3DS_WCHAR_T_background L"background"
-#define QT3DS_WCHAR_T_backgroundcolor L"backgroundcolor"
-#define QT3DS_WCHAR_T_blendtype L"blendtype"
-#define QT3DS_WCHAR_T_scaleu L"scaleu"
-#define QT3DS_WCHAR_T_scalev L"scalev"
-#define QT3DS_WCHAR_T_mappingmode L"mappingmode"
-#define QT3DS_WCHAR_T_tilingmodehorz L"tilingmodehorz"
-#define QT3DS_WCHAR_T_tilingmodevert L"tilingmodevert"
-#define QT3DS_WCHAR_T_rotationuv L"rotationuv"
-#define QT3DS_WCHAR_T_positionu L"positionu"
-#define QT3DS_WCHAR_T_positionv L"positionv"
-#define QT3DS_WCHAR_T_pivotu L"pivotu"
-#define QT3DS_WCHAR_T_pivotv L"pivotv"
-#define QT3DS_WCHAR_T_subpresentation L"subpresentation"
-#define QT3DS_WCHAR_T_iblprobe L"iblprobe"
-#define QT3DS_WCHAR_T_shaderlighting L"shaderlighting"
-#define QT3DS_WCHAR_T_blendmode L"blendmode"
-#define QT3DS_WCHAR_T_vertexcolors L"vertexcolors"
-#define QT3DS_WCHAR_T_diffuse L"diffuse"
-#define QT3DS_WCHAR_T_diffusemap L"diffusemap"
-#define QT3DS_WCHAR_T_diffusemap2 L"diffusemap2"
-#define QT3DS_WCHAR_T_diffusemap3 L"diffusemap3"
-#define QT3DS_WCHAR_T_specularreflection L"specularreflection"
-#define QT3DS_WCHAR_T_specularmap L"specularmap"
-#define QT3DS_WCHAR_T_specularmodel L"specularmodel"
-#define QT3DS_WCHAR_T_speculartint L"speculartint"
-#define QT3DS_WCHAR_T_ior L"ior"
-#define QT3DS_WCHAR_T_specularamount L"specularamount"
-#define QT3DS_WCHAR_T_specularroughness L"specularroughness"
-#define QT3DS_WCHAR_T_roughnessmap L"roughnessmap"
-#define QT3DS_WCHAR_T_opacitymap L"opacitymap"
-#define QT3DS_WCHAR_T_emissivepower L"emissivepower"
-#define QT3DS_WCHAR_T_emissivecolor L"emissivecolor"
-#define QT3DS_WCHAR_T_emissivemap L"emissivemap"
-#define QT3DS_WCHAR_T_emissivemap2 L"emissivemap2"
-#define QT3DS_WCHAR_T_normalmap L"normalmap"
-#define QT3DS_WCHAR_T_normalstrength L"normalstrength"
-#define QT3DS_WCHAR_T_position L"position"
-#define QT3DS_WCHAR_T_rotation L"rotation"
-#define QT3DS_WCHAR_T_scale L"scale"
-#define QT3DS_WCHAR_T_pivot L"pivot"
-#define QT3DS_WCHAR_T_opacity L"opacity"
-#define QT3DS_WCHAR_T_rotationorder L"rotationorder"
-#define QT3DS_WCHAR_T_orientation L"orientation"
-#define QT3DS_WCHAR_T_progressiveaa L"progressiveaa"
-#define QT3DS_WCHAR_T_multisampleaa L"multisampleaa"
-#define QT3DS_WCHAR_T_disabledepthtest L"disabledepthtest"
-#define QT3DS_WCHAR_T_disabledepthprepass L"disabledepthprepass"
-#define QT3DS_WCHAR_T_layerwidth L"layerwidth"
-#define QT3DS_WCHAR_T_layerheight L"layerheight"
-#define QT3DS_WCHAR_T_lighttype L"lighttype"
-#define QT3DS_WCHAR_T_lightdiffuse L"lightdiffuse"
-#define QT3DS_WCHAR_T_lightspecular L"lightspecular"
-#define QT3DS_WCHAR_T_lightambient L"lightambient"
-#define QT3DS_WCHAR_T_brightness L"brightness"
-#define QT3DS_WCHAR_T_linearfade L"linearfade"
-#define QT3DS_WCHAR_T_expfade L"expfade"
-#define QT3DS_WCHAR_T_areawidth L"areawidth"
-#define QT3DS_WCHAR_T_areaheight L"areaheight"
-#define QT3DS_WCHAR_T_castshadow L"castshadow"
-#define QT3DS_WCHAR_T_shdwbias L"shdwbias"
-#define QT3DS_WCHAR_T_shdwfactor L"shdwfactor"
-#define QT3DS_WCHAR_T_shdwmapres L"shdwmapres"
-#define QT3DS_WCHAR_T_shdwmapfar L"shdwmapfar"
-#define QT3DS_WCHAR_T_shdwmapfov L"shdwmapfov"
-#define QT3DS_WCHAR_T_shdwfilter L"shdwfilter"
-#define QT3DS_WCHAR_T_orthographic L"orthographic"
-#define QT3DS_WCHAR_T_fov L"fov"
-#define QT3DS_WCHAR_T_fovhorizontal L"fovhorizontal"
-#define QT3DS_WCHAR_T_clipnear L"clipnear"
-#define QT3DS_WCHAR_T_clipfar L"clipfar"
-#define QT3DS_WCHAR_T_lookatlock L"lookatlock"
-#define QT3DS_WCHAR_T_lookatpoint L"lookatpoint"
-#define QT3DS_WCHAR_T_textstring L"textstring"
-#define QT3DS_WCHAR_T_textcolor L"textcolor"
-#define QT3DS_WCHAR_T_font L"font"
-#define QT3DS_WCHAR_T_size L"size"
-#define QT3DS_WCHAR_T_horzalign L"horzalign"
-#define QT3DS_WCHAR_T_vertalign L"vertalign"
-#define QT3DS_WCHAR_T_leading L"leading"
-#define QT3DS_WCHAR_T_tracking L"tracking"
-#define QT3DS_WCHAR_T_dropshadow L"dropshadow"
-#define QT3DS_WCHAR_T_dropshadowstrength L"dropshadowstrength"
-#define QT3DS_WCHAR_T_dropshadowoffsetx L"dropshadowoffsetx"
-#define QT3DS_WCHAR_T_dropshadowoffsety L"dropshadowoffsety"
-#define QT3DS_WCHAR_T_wordwrap L"wordwrap"
-#define QT3DS_WCHAR_T_boundingbox L"boundingbox"
-#define QT3DS_WCHAR_T_elide L"elide"
-#define QT3DS_WCHAR_T_enableacceleratedfont L"enableacceleratedfont"
-#define QT3DS_WCHAR_T_importfile L"importfile"
-#define QT3DS_WCHAR_T_fileid L"fileid"
-#define QT3DS_WCHAR_T_size L"size"
-#define QT3DS_WCHAR_T_location L"location"
-#define QT3DS_WCHAR_T_boneid L"boneid"
-#define QT3DS_WCHAR_T_poseroot L"poseroot"
-#define QT3DS_WCHAR_T_ignoresparent L"ignoresparent"
-#define QT3DS_WCHAR_T_shadowcaster L"shadowcaster"
-#define QT3DS_WCHAR_T_tessellation L"tessellation"
-#define QT3DS_WCHAR_T_edgetess L"edgetess"
-#define QT3DS_WCHAR_T_innertess L"innertess"
-#define QT3DS_WCHAR_T_scalemode L"scalemode"
-#define QT3DS_WCHAR_T_scaleanchor L"scaleanchor"
-#define QT3DS_WCHAR_T_horzfields L"horzfields"
-#define QT3DS_WCHAR_T_left L"left"
-#define QT3DS_WCHAR_T_leftunits L"leftunits"
-#define QT3DS_WCHAR_T_width L"width"
-#define QT3DS_WCHAR_T_widthunits L"widthunits"
-#define QT3DS_WCHAR_T_right L"right"
-#define QT3DS_WCHAR_T_rightunits L"rightunits"
-#define QT3DS_WCHAR_T_vertfields L"vertfields"
-#define QT3DS_WCHAR_T_top L"top"
-#define QT3DS_WCHAR_T_topunits L"topunits"
-#define QT3DS_WCHAR_T_height L"height"
-#define QT3DS_WCHAR_T_heightunits L"heightunits"
-#define QT3DS_WCHAR_T_bottom L"bottom"
-#define QT3DS_WCHAR_T_bottomunits L"bottomunits"
-#define QT3DS_WCHAR_T_aostrength L"aostrength"
-#define QT3DS_WCHAR_T_aodistance L"aodistance"
-#define QT3DS_WCHAR_T_aosoftness L"aosoftness"
-#define QT3DS_WCHAR_T_aobias L"aobias"
-#define QT3DS_WCHAR_T_aosamplerate L"aosamplerate"
-#define QT3DS_WCHAR_T_aodither L"aodither"
-#define QT3DS_WCHAR_T_shadowstrength L"shadowstrength"
-#define QT3DS_WCHAR_T_shadowdist L"shadowdist"
-#define QT3DS_WCHAR_T_shadowsoftness L"shadowsoftness"
-#define QT3DS_WCHAR_T_shadowbias L"shadowbias"
-#define QT3DS_WCHAR_T_source L"source"
-#define QT3DS_WCHAR_T_referencedmaterial L"referencedmaterial"
-#define QT3DS_WCHAR_T_lightprobe L"lightprobe"
-#define QT3DS_WCHAR_T_probebright L"probebright"
-#define QT3DS_WCHAR_T_fastibl L"fastibl"
-#define QT3DS_WCHAR_T_probehorizon L"probehorizon"
-#define QT3DS_WCHAR_T_probefov L"probefov"
-#define QT3DS_WCHAR_T_lightprobe2 L"lightprobe2"
-#define QT3DS_WCHAR_T_probe2fade L"probe2fade"
-#define QT3DS_WCHAR_T_probe2window L"probe2window"
-#define QT3DS_WCHAR_T_probe2pos L"probe2pos"
-#define QT3DS_WCHAR_T_bumpmap L"bumpmap"
-#define QT3DS_WCHAR_T_bumpamount L"bumpamount"
-#define QT3DS_WCHAR_T_normalmap L"normalmap"
-#define QT3DS_WCHAR_T_displacementmap L"displacementmap"
-#define QT3DS_WCHAR_T_displaceamount L"displaceamount"
-#define QT3DS_WCHAR_T_translucencymap L"translucencymap"
-#define QT3DS_WCHAR_T_translucentfalloff L"translucentfalloff"
-#define QT3DS_WCHAR_T_diffuselightwrap L"diffuselightwrap"
-#define QT3DS_WCHAR_T_fresnelPower L"fresnelPower"
-#define QT3DS_WCHAR_T_referencednode L"referencednode"
-#define QT3DS_WCHAR_T_temporalaa L"temporalaa"
-#define QT3DS_WCHAR_T_scope L"scope"
-#define QT3DS_WCHAR_T_Path L"Path"
-#define QT3DS_WCHAR_T_pathdata L"pathdata"
-#define QT3DS_WCHAR_T_PathAnchorPoint L"PathAnchorPoint"
-#define QT3DS_WCHAR_T_incomingangle L"incomingangle"
-#define QT3DS_WCHAR_T_incomingdistance L"incomingdistance"
-#define QT3DS_WCHAR_T_outgoingdistance L"outgoingdistance"
-#define QT3DS_WCHAR_T_linearerror L"linearerror"
-#define QT3DS_WCHAR_T_edgetessamount L"edgetessamount"
-#define QT3DS_WCHAR_T_innertessamount L"innertessamount"
-#define QT3DS_WCHAR_T_begincap L"begincap"
-#define QT3DS_WCHAR_T_begincapoffset L"begincapoffset"
-#define QT3DS_WCHAR_T_begincapopacity L"begincapopacity"
-#define QT3DS_WCHAR_T_begincapwidth L"begincapwidth"
-#define QT3DS_WCHAR_T_endcap L"endcap"
-#define QT3DS_WCHAR_T_endcapoffset L"endcapoffset"
-#define QT3DS_WCHAR_T_endcapopacity L"endcapopacity"
-#define QT3DS_WCHAR_T_endcapwidth L"endcapwidth"
-#define QT3DS_WCHAR_T_pathtype L"pathtype"
-#define QT3DS_WCHAR_T_closed L"closed"
-#define QT3DS_WCHAR_T_paintstyle L"paintstyle"
-#define QT3DS_WCHAR_T_SubPath L"SubPath"
-#define QT3DS_WCHAR_T_lightmapindirect L"lightmapindirect"
-#define QT3DS_WCHAR_T_lightmapradiosity L"lightmapradiosity"
-#define QT3DS_WCHAR_T_lightmapshadow L"lightmapshadow"
-#define QT3DS_WCHAR_T_controlledproperty L"controlledproperty"
-#define QT3DS_WCHAR_T_variants L"variants"
-
-const wchar_t *ComposerObjectTypes::Convert(ComposerObjectTypes::Enum inType)
-{
- switch (inType) {
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- case name: \
- return QT3DS_WCHAR_T_##name;
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return L"Unknown";
-}
-
-ComposerObjectTypes::Enum ComposerObjectTypes::Convert(const wchar_t *inType)
-{
-
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- if (AreEqual(QT3DS_WCHAR_T_##name, inType)) \
- return ComposerObjectTypes::name;
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-
- QT3DS_ASSERT(false);
- return ComposerObjectTypes::Unknown;
-}
-
-ComposerObjectTypes::Enum ComposerObjectTypes::Convert(const char8_t *inType)
-{
-
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- if (AreEqual(#name, inType)) \
- return ComposerObjectTypes::name;
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-
- QT3DS_ASSERT(false);
- return ComposerObjectTypes::Unknown;
-}
-
-const wchar_t *ComposerPropertyNames::Convert(ComposerPropertyNames::Enum inType)
-{
- switch (inType) {
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, type, defaultValue)
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type) \
- case name: \
- return QT3DS_WCHAR_T_##name;
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, type, defaultValue) \
- HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type)
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) propmacro
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return L"Unknown";
-}
-
-ComposerPropertyNames::Enum ComposerPropertyNames::Convert(const wchar_t *inType)
-{
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, type, defaultValue)
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type) \
- if (AreEqual(inType, QT3DS_WCHAR_T_##name)) \
- return name;
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, type, defaultValue) \
- HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type)
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) propmacro
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
- QT3DS_ASSERT(false);
- return ComposerPropertyNames::Unknown;
-}
-
-const char8_t *ComposerPropertyNames::ConvertNarrow(ComposerPropertyNames::Enum inType)
-{
- switch (inType) {
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, type, defaultValue)
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type) \
- case name: \
- return #name;
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, type, defaultValue) \
- HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type)
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) propmacro
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return "Unknown";
-}
-
-ComposerPropertyNames::Enum ComposerPropertyNames::Convert(const char8_t *inType)
-{
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, type, defaultValue)
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type) \
- if (AreEqual(inType, #name)) \
- return name;
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, type, defaultValue) \
- HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type)
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) propmacro
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
- QT3DS_ASSERT(false);
- return ComposerPropertyNames::Unknown;
-}
-
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, dtype, defaultValue) \
- , memberName(inCore, inInstance, DataConstructor<dtype>().Construct(defaultValue))
-
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, dtype) \
- , memberName(inCore, inInstance)
-
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, dtype, defaultValue) \
- HANDLE_COMPOSER_PROPERTY(name, memberName, dtype, defaultValue)
-
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- SComposerTypePropertyDefinition<ComposerObjectTypes::name>::SComposerTypePropertyDefinition( \
- IDataCore &inCore, Qt3DSDMInstanceHandle inInstance) \
- : reserved(false) propmacro \
- { \
- Q_UNUSED(inCore); \
- Q_UNUSED(inInstance); \
- }
-ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
-
-void ComposerTypeDefinitionsHelper::SetInstanceAsCanonical(IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- ComposerObjectTypes::Enum inObjectType)
-{
- inMetaData.SetInstanceAsCanonical(inInstance, ComposerObjectTypes::Convert(inObjectType));
-}
-
-void ComposerTypeDefinitionsHelper::SetInstancePropertyValue(IDataCore &inDataCore,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const wchar_t *inPropValue)
-{
- inDataCore.SetInstancePropertyValue(inInstance, inProperty, make_shared<CDataStr>(inPropValue));
-}
-
-void ComposerTypeDefinitionsHelper::DeriveInstance(IDataCore &inDataCore,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent)
-{
- inDataCore.DeriveInstance(inInstance, inParent);
-}
-
-// Container object for all of the object definitions
-SComposerObjectDefinitions::SComposerObjectDefinitions(IDataCore &inCore, IMetaData &inMetaData)
- : m_Typed(inCore, inMetaData, inCore.CreateInstance())
- , m_Guided(inCore, inMetaData, inCore.CreateInstance())
- , m_Named(inCore, inMetaData, inCore.CreateInstance())
- , m_SlideOwner(inCore, inMetaData, inCore.CreateInstance())
- , m_Slide(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Named)
- , m_Action(inCore, inMetaData, inCore.CreateInstance(), m_Typed)
- , m_Asset(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Guided, m_Named)
- , m_Scene(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset, m_SlideOwner)
- , m_Image(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_MaterialBase(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_Lightmaps(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_MaterialBase)
- , m_Material(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Lightmaps)
- , m_CustomMaterial(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Lightmaps)
- , m_ReferencedMaterial(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Lightmaps)
- , m_Behavior(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_Effect(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_Node(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_Layer(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_Group(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_Model(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_Light(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_Camera(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_Component(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node, m_SlideOwner)
- , m_Text(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_RenderPlugin(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_Alias(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_Path(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node)
- , m_PathAnchorPoint(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_SubPath(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset)
- , m_DataCore(inCore)
-{
-}
-
-bool SComposerObjectDefinitions::IsA(Qt3DSDMInstanceHandle inInstance,
- ComposerObjectTypes::Enum inType)
-{
- if (m_DataCore.IsInstance(inInstance) == false)
- return false;
-
- switch (inType) {
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- case ComposerObjectTypes::name: \
- return m_DataCore.IsInstanceOrDerivedFrom(inInstance, m_##name.m_Instance);
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return false;
-}
-
-// Could easily return None, meaning we can't identify the object type.
-// Checks the type of the first derivation parent, so this won't ever return
-// SlideOwner, for instance.
-ComposerObjectTypes::Enum SComposerObjectDefinitions::GetType(Qt3DSDMInstanceHandle inInstance)
-{
- if (m_DataCore.IsInstance(inInstance) == false)
- return ComposerObjectTypes::Unknown;
-
- Qt3DSDMInstanceHandle theTargetInstance = inInstance;
- TInstanceHandleList theHandleList;
- m_DataCore.GetInstanceParents(inInstance, theHandleList);
- if (theHandleList.empty() == false)
- theTargetInstance = theHandleList[0];
-
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- if (m_##name.m_Instance == theTargetInstance) \
- return ComposerObjectTypes::name;
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-
- return ComposerObjectTypes::Unknown;
-}
-
-Qt3DSDMInstanceHandle
-SComposerObjectDefinitions::GetInstanceForType(ComposerObjectTypes::Enum inType)
-{
- switch (inType) {
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- case ComposerObjectTypes::name: \
- return m_##name.m_Instance;
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return 0;
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.h
deleted file mode 100644
index 1a079402..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMComposerTypeDefinitions.h
+++ /dev/null
@@ -1,956 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMDataTypes.h"
-#include "foundation/Qt3DSOption.h"
-#include "Qt3DSDMDataCore.h"
-#include <utility>
-
-// Defines the minimal property model that UIComposer needs to
-// run off of.
-namespace qt3dsdm {
-class IDataCore;
-class IMetaData;
-class ISlideCore;
-class IPropertySystem;
-
-// Extensible macro definitions
-// Enumerations *have* to be in derivation order
-// else initialization of the SComposerObjectDefinitions class
-// will fail catastrophically
-// Specific type documentation is below
-#define ITERATE_COMPOSER_OBJECT_TYPES \
- HANDLE_COMPOSER_OBJECT_TYPE(Typed, ITERATE_COMPOSER_TYPED_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Guided, ITERATE_COMPOSER_GUIDED_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Named, ITERATE_COMPOSER_NAMED_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(SlideOwner, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Slide, ITERATE_COMPOSER_SLIDE_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Action, ITERATE_COMPOSER_ACTION_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Asset, ITERATE_COMPOSER_ASSET_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Scene, ITERATE_COMPOSER_SCENE_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Image, ITERATE_COMPOSER_IMAGE_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(MaterialBase, ITERATE_COMPOSER_MATERIAL_BASE_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Lightmaps, ITERATE_COMPOSER_LIGHTMAP_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Material, ITERATE_COMPOSER_MATERIAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(CustomMaterial, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(ReferencedMaterial, \
- ITERATE_COMPOSER_REFERENCED_MATERIAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Behavior, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Effect, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Node, ITERATE_COMPOSER_NODE_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Layer, ITERATE_COMPOSER_LAYER_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Group, ITERATE_COMPOSER_GROUP_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Model, ITERATE_COMPOSER_MODEL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Light, ITERATE_COMPOSER_LIGHT_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Camera, ITERATE_COMPOSER_CAMERA_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Component, ITERATE_COMPOSER_COMPONENT_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Text, ITERATE_COMPOSER_TEXT_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(RenderPlugin, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Alias, ITERATE_COMPOSER_ALIAS_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(Path, ITERATE_COMPOSER_PATH_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(PathAnchorPoint, ITERATE_COMPOSER_PATH_ANCHOR_POINT_PROPERTIES) \
- HANDLE_COMPOSER_OBJECT_TYPE(SubPath, ITERATE_COMPOSER_PATH_SUBPATH_PROPERTIES)
-
-#define ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES
-
-#define ITERATE_COMPOSER_TYPED_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(type, m_TypeProp, TDataStrPtr, L"Typed")
-
-#define ITERATE_COMPOSER_GUIDED_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(id, m_GuidProp, SLong4, 0)
-
-#define ITERATE_COMPOSER_NAMED_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(name, m_NameProp, TDataStrPtr, L"Unnamed")
-
-#define ITERATE_COMPOSER_ASSET_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(sourcepath, m_SourcePath, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY(importid, m_ImportId, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY(importfile, m_ImportFile, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY(fileid, m_FileId, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY(starttime, m_StartTime, qt3ds::QT3DSI32, 0) \
- HANDLE_COMPOSER_PROPERTY(endtime, m_EndTime, qt3ds::QT3DSI32, 10000) \
- HANDLE_COMPOSER_PROPERTY(eyeball, m_Eyeball, bool, true) \
- HANDLE_COMPOSER_PROPERTY(shy, m_Shy, bool, false) \
- HANDLE_COMPOSER_PROPERTY(locked, m_Locked, bool, false) \
- HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(timebarcolor, m_TimebarColor, SFloat4) \
- HANDLE_COMPOSER_PROPERTY(timebartext, m_TimebarText, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_SCENE_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(bgcolorenable, m_BgColorEnable, bool, true) \
- HANDLE_COMPOSER_PROPERTY(backgroundcolor, m_BackgroundColor, SFloat4, SFloat4(0, 0, 0, 1)) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_COMPONENT_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(variants, m_variants, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_NODE_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(position, m_Position, SFloat3, SFloat3(0, 0, 0)) \
- HANDLE_COMPOSER_PROPERTY(rotation, m_Rotation, SFloat3, SFloat3(0, 0, 0)) \
- HANDLE_COMPOSER_PROPERTY(scale, m_Scale, SFloat3, SFloat3(1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(pivot, m_Pivot, SFloat3, SFloat3(0, 0, 0)) \
- HANDLE_COMPOSER_PROPERTY(opacity, m_Opacity, float, 100.f) \
- HANDLE_COMPOSER_PROPERTY(rotationorder, m_RotationOrder, TDataStrPtr, L"YXZ") \
- HANDLE_COMPOSER_PROPERTY(orientation, m_Orientation, TDataStrPtr, L"Left Handed") \
- HANDLE_COMPOSER_PROPERTY(boneid, m_BoneId, qt3ds::QT3DSI32, 0) \
- HANDLE_COMPOSER_PROPERTY(ignoresparent, m_IgnoresParent, bool, false) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_MODEL_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(shadowcaster, m_ShadowCaster, bool, true) \
- HANDLE_COMPOSER_PROPERTY(poseroot, m_PoseRoot, qt3ds::QT3DSI32, -1) \
- HANDLE_COMPOSER_PROPERTY(tessellation, m_Tessellation, TDataStrPtr, L"None") \
- HANDLE_COMPOSER_PROPERTY(edgetess, m_EdgeTess, float, 1.0) \
- HANDLE_COMPOSER_PROPERTY(innertess, m_InnerTess, float, 1.0) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(variants, m_variants, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_IMAGE_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(scaleu, m_RepeatU, float, 1.0f) \
- HANDLE_COMPOSER_PROPERTY(scalev, m_RepeatV, float, 1.0f) \
- HANDLE_COMPOSER_PROPERTY(mappingmode, m_TextureMapping, TDataStrPtr, L"UV Mapping") \
- HANDLE_COMPOSER_PROPERTY(tilingmodehorz, m_TilingU, TDataStrPtr, L"No Tiling") \
- HANDLE_COMPOSER_PROPERTY(tilingmodevert, m_TilingV, TDataStrPtr, L"No Tiling") \
- HANDLE_COMPOSER_PROPERTY(rotationuv, m_RotationUV, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(positionu, m_PositionU, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(positionv, m_PositionV, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(pivotu, m_PivotU, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(pivotv, m_PivotV, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(subpresentation, m_SubPresentation, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_LIGHTMAP_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(lightmapindirect, m_LightmapIndirect, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(lightmapradiosity, m_LightmapRadiosity, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(lightmapshadow, m_LightmapShadow, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_CUSTOM_MATERIAL_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(iblprobe, m_IblProbe, SLong4, 0)
-
-#define ITERATE_COMPOSER_MATERIAL_BASE_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(iblprobe, m_IblProbe, SLong4, 0)
-
-#define ITERATE_COMPOSER_MATERIAL_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(shaderlighting, m_ShaderLighting, TDataStrPtr, L"Vertex") \
- HANDLE_COMPOSER_PROPERTY(blendmode, m_BlendMode, TDataStrPtr, L"Normal") \
- HANDLE_COMPOSER_PROPERTY(diffuse, m_DiffuseColor, SFloat4, SFloat4(1, 1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(diffusemap, m_DiffuseMap1, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(diffusemap2, m_DiffuseMap2, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(diffusemap3, m_DiffuseMap3, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(specularreflection, m_SpecularReflection, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(specularamount, m_SpecularAmount, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(specularroughness, m_SpecularRoughness, float, 50.f) \
- HANDLE_COMPOSER_PROPERTY(roughnessmap, m_RoughnessMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(opacity, m_Opacity, float, 100.f) \
- HANDLE_COMPOSER_PROPERTY(opacitymap, m_OpacityMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(emissivecolor, m_EmissiveColor, SFloat4, SFloat4(1, 1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(emissivepower, m_EmissivePower, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(emissivemap, m_EmissiveMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(emissivemap2, m_EmissiveMap2, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(bumpmap, m_BumpMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(bumpamount, m_BumpAmount, float, 9.0f) \
- HANDLE_COMPOSER_PROPERTY(normalmap, m_NormalMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(displacementmap, m_DisplacementMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(displaceamount, m_DisplaceAmount, float, 0.5f) \
- HANDLE_COMPOSER_PROPERTY(translucencymap, m_TranslucencyMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(translucentfalloff, m_TranslucentFalloff, float, 1.f) \
- HANDLE_COMPOSER_PROPERTY(diffuselightwrap, m_DiffuseLightWrap, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(specularmap, m_SpecularMap, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(specularmodel, m_SpecularModel, TDataStrPtr, L"Default") \
- HANDLE_COMPOSER_PROPERTY(speculartint, m_SpecularTint, SFloat4, SFloat4(1, 1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(ior, m_IOR, float, 0) \
- HANDLE_COMPOSER_PROPERTY(fresnelPower, m_FresnelPower, float, 0) \
- HANDLE_COMPOSER_PROPERTY(vertexcolors, m_VertexColors, bool, false) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_REFERENCED_MATERIAL_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(referencedmaterial, m_ReferencedMaterial, SObjectRefType, L"")
-
-#define ITERATE_COMPOSER_LAYER_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(progressiveaa, m_ProgressiveAA, TDataStrPtr, L"None") \
- HANDLE_COMPOSER_PROPERTY(multisampleaa, m_MultisampleAA, TDataStrPtr, L"None") \
- HANDLE_COMPOSER_PROPERTY(temporalaa, m_TemporalAA, bool, false) \
- HANDLE_COMPOSER_PROPERTY(disabledepthtest, m_DisableDepthTest, bool, false) \
- HANDLE_COMPOSER_PROPERTY(disabledepthprepass, m_DisableDepthPrepass, bool, false) \
- HANDLE_COMPOSER_PROPERTY(background, m_Background, TDataStrPtr, L"Transparent") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(backgroundcolor, m_BackgroundColor, SFloat4, \
- SFloat4(0, 0, 0, 1)) \
- HANDLE_COMPOSER_PROPERTY(blendtype, m_BlendType, TDataStrPtr, L"Normal") \
- HANDLE_COMPOSER_PROPERTY(horzfields, m_HorizontalFieldValues, TDataStrPtr, L"Left/Width") \
- HANDLE_COMPOSER_PROPERTY(left, m_Left, float, 0) \
- HANDLE_COMPOSER_PROPERTY(leftunits, m_LeftUnits, TDataStrPtr, L"percent") \
- HANDLE_COMPOSER_PROPERTY(width, m_Width, float, 100.0f) \
- HANDLE_COMPOSER_PROPERTY(widthunits, m_WidthUnits, TDataStrPtr, L"percent") \
- HANDLE_COMPOSER_PROPERTY(right, m_Right, float, 0) \
- HANDLE_COMPOSER_PROPERTY(rightunits, m_RightUnits, TDataStrPtr, L"percent") \
- HANDLE_COMPOSER_PROPERTY(vertfields, m_VerticalFieldValues, TDataStrPtr, L"Top/Height") \
- HANDLE_COMPOSER_PROPERTY(top, m_Top, float, 0) \
- HANDLE_COMPOSER_PROPERTY(topunits, m_TopUnits, TDataStrPtr, L"percent") \
- HANDLE_COMPOSER_PROPERTY(height, m_Height, float, 100.0f) \
- HANDLE_COMPOSER_PROPERTY(heightunits, m_HeightUnits, TDataStrPtr, L"percent") \
- HANDLE_COMPOSER_PROPERTY(bottom, m_Bottom, float, 0) \
- HANDLE_COMPOSER_PROPERTY(bottomunits, m_BottomUnits, TDataStrPtr, L"percent") \
- HANDLE_COMPOSER_PROPERTY(aostrength, m_AoStrength, float, 0) \
- HANDLE_COMPOSER_PROPERTY(aodistance, m_AoDistance, float, 0) \
- HANDLE_COMPOSER_PROPERTY(aosoftness, m_AoSoftness, float, 0) \
- HANDLE_COMPOSER_PROPERTY(aobias, m_AoBias, float, 0) \
- HANDLE_COMPOSER_PROPERTY(aosamplerate, m_AoSamplerate, qt3ds::QT3DSI32, 1) \
- HANDLE_COMPOSER_PROPERTY(aodither, m_AoDither, bool, false) \
- HANDLE_COMPOSER_PROPERTY(shadowstrength, m_ShadowStrength, float, 0) \
- HANDLE_COMPOSER_PROPERTY(shadowdist, m_ShadowDist, float, 0) \
- HANDLE_COMPOSER_PROPERTY(shadowsoftness, m_ShadowSoftness, float, 0) \
- HANDLE_COMPOSER_PROPERTY(shadowbias, m_ShadowBias, float, 0) \
- HANDLE_COMPOSER_PROPERTY(lightprobe, m_LightProbe, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(probebright, m_ProbeBright, float, 100.0f) \
- HANDLE_COMPOSER_PROPERTY(fastibl, m_FastIbl, bool, true) \
- HANDLE_COMPOSER_PROPERTY(probehorizon, m_ProbeHorizon, float, -1) \
- HANDLE_COMPOSER_PROPERTY(probefov, m_ProbeFov, float, 180.0f) \
- HANDLE_COMPOSER_PROPERTY(lightprobe2, m_LightProbe2, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(probe2fade, m_Probe2Fade, float, 1) \
- HANDLE_COMPOSER_PROPERTY(probe2window, m_Probe2Window, float, 1) \
- HANDLE_COMPOSER_PROPERTY(probe2pos, m_Probe2Pos, float, 0.5f) \
- HANDLE_COMPOSER_PROPERTY(variants, m_variants, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_GROUP_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(variants, m_variants, TDataStrPtr, L"") \
-
-#define ITERATE_COMPOSER_LIGHT_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(lighttype, m_LightType, TDataStrPtr, L"Directional") \
- HANDLE_COMPOSER_PROPERTY(scope, m_Scope, SObjectRefType, L"") \
- HANDLE_COMPOSER_PROPERTY(lightdiffuse, m_LightColor, SFloat4, SFloat4(1, 1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(lightspecular, m_SpecularColor, SFloat4, SFloat4(1, 1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(lightambient, m_AmbientColor, SFloat4, SFloat4(0, 0, 0, 1)) \
- HANDLE_COMPOSER_PROPERTY(brightness, m_Brightness, float, 100.0f) \
- HANDLE_COMPOSER_PROPERTY(linearfade, m_LinearFade, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(expfade, m_ExpFade, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(areawidth, m_AreaWidth, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(areaheight, m_AreaHeight, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(castshadow, m_CastShadow, bool, false) \
- HANDLE_COMPOSER_PROPERTY(shdwbias, m_ShadowBias, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(shdwfactor, m_ShadowFactor, float, 5.0f) \
- HANDLE_COMPOSER_PROPERTY(shdwmapres, m_ShadowMapRes, qt3ds::QT3DSI32, 9) \
- HANDLE_COMPOSER_PROPERTY(shdwmapfar, m_ShadowMapFar, float, 5000.0f) \
- HANDLE_COMPOSER_PROPERTY(shdwmapfov, m_ShadowMapFov, float, 90.0f) \
- HANDLE_COMPOSER_PROPERTY(shdwfilter, m_ShadowFilter, float, 35.0f) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_CAMERA_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(orthographic, m_Orthographic, bool, false) \
- HANDLE_COMPOSER_PROPERTY(fov, m_Fov, float, 60.f) \
- HANDLE_COMPOSER_PROPERTY(fovhorizontal, m_FovHorizontal, bool, false) \
- HANDLE_COMPOSER_PROPERTY(clipnear, m_ClipNear, float, 10.f) \
- HANDLE_COMPOSER_PROPERTY(clipfar, m_ClipFar, float, 100000.f) \
- HANDLE_COMPOSER_PROPERTY(scalemode, m_ScaleMode, TDataStrPtr, L"Fit") \
- HANDLE_COMPOSER_PROPERTY(scaleanchor, m_ScaleAnchor, TDataStrPtr, L"Center") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_EDIT_CAMERA_PROPERTIES HANDLE_COMPOSER_PROPERTY(is3d, m_Is3d, bool, false)
-
-#define ITERATE_COMPOSER_TEXT_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(textstring, m_TextString, TDataStrPtr, L"Text") \
- HANDLE_COMPOSER_PROPERTY(textcolor, m_TextColor, SFloat4, SFloat4(1, 1, 1, 1)) \
- HANDLE_COMPOSER_PROPERTY(font, m_Font, TDataStrPtr, L"arial") \
- HANDLE_COMPOSER_PROPERTY(size, m_Size, float, 24.f) \
- HANDLE_COMPOSER_PROPERTY(horzalign, m_HorzAlign, TDataStrPtr, L"Center") \
- HANDLE_COMPOSER_PROPERTY(vertalign, m_VertAlign, TDataStrPtr, L"Middle") \
- HANDLE_COMPOSER_PROPERTY(leading, m_Leading, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(tracking, m_Tracking, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(dropshadow, m_DropShadow, bool, false) \
- HANDLE_COMPOSER_PROPERTY(dropshadowstrength, m_DropShadowStrength, float, 80.f) \
- HANDLE_COMPOSER_PROPERTY(dropshadowoffsetx, m_DropShadowOffsetX, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(dropshadowoffsety, m_DropShadowOffsetY, float, 0.f) \
- HANDLE_COMPOSER_PROPERTY(wordwrap, m_WordWrap, TDataStrPtr, L"WrapWord") \
- HANDLE_COMPOSER_PROPERTY(boundingbox, m_BoundingBox, SFloat2, SFloat2(0, 0)) \
- HANDLE_COMPOSER_PROPERTY(elide, m_Elide, TDataStrPtr, L"ElideNone") \
- HANDLE_COMPOSER_PROPERTY(enableacceleratedfont, m_EnableAcceleratedFont, bool, false) \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(variants, m_variants, TDataStrPtr, L"") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_SLIDE_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(componentid, m_ComponentId, SLong4, 0) \
- HANDLE_COMPOSER_PROPERTY(playmode, m_PlayMode, TDataStrPtr, L"Looping") \
- HANDLE_COMPOSER_PROPERTY(playthroughto, m_PlaythroughTo, SStringOrInt, L"Next") \
- HANDLE_COMPOSER_PROPERTY(initialplaystate, m_InitialPlayState, TDataStrPtr, L"Play") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_ACTION_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(actioneyeball, m_ActionEyeball, bool, true)
-
-#define ITERATE_COMPOSER_ALIAS_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(referencednode, m_ReferencedNode, SObjectRefType, L"") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_PATH_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(pathtype, m_PathType, TDataStrPtr, L"Geometry") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(width, m_Width, float, 5.0f) \
- HANDLE_COMPOSER_PROPERTY(linearerror, m_LinearError, float, 10) \
- HANDLE_COMPOSER_PROPERTY(edgetessamount, m_EdgeTessAmount, float, 8) \
- HANDLE_COMPOSER_PROPERTY(innertessamount, m_InnerTessAmount, float, 8) \
- HANDLE_COMPOSER_PROPERTY(begincap, m_BeginCap, TDataStrPtr, L"None") \
- HANDLE_COMPOSER_PROPERTY(begincapoffset, m_BeginCapOffset, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(begincapopacity, m_BeginCapOpacity, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(begincapwidth, m_BeginCapWidth, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(endcap, m_EndCap, TDataStrPtr, L"None") \
- HANDLE_COMPOSER_PROPERTY(endcapoffset, m_EndCapOffset, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(endcapopacity, m_EndCapOpacity, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(endcapwidth, m_EndCapWidth, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(paintstyle, m_PaintStyle, TDataStrPtr, L"Stroked") \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"")
-
-#define ITERATE_COMPOSER_PATH_ANCHOR_POINT_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY_DUPLICATE(position, m_Position, SFloat2, SFloat2(0.0f, 0.0f)) \
- HANDLE_COMPOSER_PROPERTY(incomingangle, m_IncomingAngle, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(incomingdistance, m_IncomingDistance, float, 0.0f) \
- HANDLE_COMPOSER_PROPERTY(outgoingdistance, m_OutgoingDistance, float, 0.0f)
-
-#define ITERATE_COMPOSER_PATH_SUBPATH_PROPERTIES \
- HANDLE_COMPOSER_PROPERTY(closed, m_Closed, bool, true)
-
-struct ComposerObjectTypes
-{
- enum Enum {
- Unknown = 0,
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) name,
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
- ControllableObject
- };
- static const wchar_t *Convert(ComposerObjectTypes::Enum inType);
- static ComposerObjectTypes::Enum Convert(const wchar_t *inType);
- static ComposerObjectTypes::Enum Convert(const char8_t *inType);
-};
-
-struct ComposerPropertyNames
-{
- enum Enum {
- Unknown = 0,
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, type) name,
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, type, defaultValue)
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, type, defaultValue) name,
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) propmacro
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
- };
-
- static const wchar_t *Convert(ComposerPropertyNames::Enum inType);
- static ComposerPropertyNames::Enum Convert(const wchar_t *inType);
- static const char8_t *ConvertNarrow(ComposerPropertyNames::Enum inType);
- static ComposerPropertyNames::Enum Convert(const char8_t *inType);
-};
-
-template <typename TDataType>
-struct TypeToDataTypeMap
-{
- bool force_compile_error;
-};
-template <DataModelDataType::Value TEnum>
-struct DataTypeToTypeMap
-{
- bool force_compile_error;
-};
-
-#define QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(enumName, type) \
- template <> \
- struct TypeToDataTypeMap<type> \
- { \
- static DataModelDataType::Value GetDataType() { return enumName; } \
- }; \
- template <> \
- struct DataTypeToTypeMap<enumName> \
- { \
- typedef type TDataType; \
- };
-
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Float, float)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Float2, SFloat2)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Float3, SFloat3)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Float4, SFloat4)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Long, qt3ds::QT3DSI32)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::String, TDataStrPtr)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Bool, bool)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::Long4, SLong4)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::StringRef, SStringRef)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::StringOrInt, SStringOrInt)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::ObjectRef, SObjectRefType)
-QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE(DataModelDataType::FloatList, TFloatList)
-
-#undef QT3DSDM_DEFINE_TYPE_TO_DATA_TYPE
-
-template <typename TDataType>
-inline DataModelDataType::Value TypeToDataType()
-{
- return TypeToDataTypeMap<TDataType>::GetDataType();
-}
-
-template <ComposerPropertyNames::Enum TPropName, typename TDataType>
-struct SComposerPropertyDefinition
-{
- qt3ds::foundation::Option<TDataType> m_DefaultValue;
- Qt3DSDMPropertyHandle m_Property;
- SComposerPropertyDefinition(IDataCore &inDataCore, Qt3DSDMInstanceHandle inInstance,
- const TDataType &inDefault)
- : m_DefaultValue(inDefault)
- {
- QT3DSDM_LOG_FUNCTION("SComposerPropertyDefinition-1");
- m_Property = inDataCore.AddProperty(inInstance, ComposerPropertyNames::Convert(TPropName),
- TypeToDataType<TDataType>());
- if (m_DefaultValue.hasValue())
- inDataCore.SetInstancePropertyValue(inInstance, m_Property, m_DefaultValue.getValue());
- }
- SComposerPropertyDefinition(IDataCore &inDataCore, Qt3DSDMInstanceHandle inInstance)
- {
- QT3DSDM_LOG_FUNCTION("SComposerPropertyDefinition-2");
- m_Property = inDataCore.AddProperty(inInstance, ComposerPropertyNames::Convert(TPropName),
- TypeToDataType<TDataType>());
- }
- operator Qt3DSDMPropertyHandle() const { return m_Property; }
-};
-
-// Define all the objects with their properties
-
-template <ComposerObjectTypes::Enum>
-struct SComposerTypePropertyDefinition
-{
- bool force_compile_error;
-};
-
-#define HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, dtype) \
- SComposerPropertyDefinition<ComposerPropertyNames::name, dtype> memberName;
-
-#define HANDLE_COMPOSER_PROPERTY(name, memberName, dtype, defaultValue) \
- HANDLE_COMPOSER_PROPERTY_NO_DEFAULT(name, memberName, dtype)
-#define HANDLE_COMPOSER_PROPERTY_DUPLICATE(name, memberName, dtype, defaultValue) \
- HANDLE_COMPOSER_PROPERTY(name, memberName, dtype, defaultValue)
-
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- template <> \
- struct SComposerTypePropertyDefinition<ComposerObjectTypes::name> \
- { \
- bool reserved; \
- propmacro SComposerTypePropertyDefinition(IDataCore &inCore, \
- Qt3DSDMInstanceHandle inInstance); \
- };
-
-ITERATE_COMPOSER_OBJECT_TYPES
-
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-#undef HANDLE_COMPOSER_PROPERTY
-#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
-#undef HANDLE_COMPOSER_PROPERTY_DUPLICATE
-
-struct ComposerTypeDefinitionsHelper
-{
- // Functions here so we don't have to include UICDMDataCore.h or UICDMMetaData.h
- static void SetInstanceAsCanonical(IMetaData &inMetaData, Qt3DSDMInstanceHandle inInstance,
- ComposerObjectTypes::Enum inObjectType);
- static void SetInstancePropertyValue(IDataCore &inDataCore, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const wchar_t *inPropValue);
- static void DeriveInstance(IDataCore &inDataCore, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent);
-};
-
-template <ComposerObjectTypes::Enum TEnumType>
-struct SComposerBaseObjectDefinition : public SComposerTypePropertyDefinition<TEnumType>
-{
- Qt3DSDMInstanceHandle m_Instance;
- SComposerBaseObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance)
- : SComposerTypePropertyDefinition<TEnumType>(inCore, inInstance)
- , m_Instance(inInstance)
- {
- QT3DSDM_LOG_FUNCTION("SComposerBaseObjectDefinition");
- ComposerTypeDefinitionsHelper::SetInstanceAsCanonical(inMetaData, inInstance, TEnumType);
- }
-
- template <ComposerObjectTypes::Enum TBaseType>
- void Derive(IDataCore &inCore, const SComposerBaseObjectDefinition<TBaseType> &inParent)
- {
- QT3DSDM_LOG_FUNCTION("SComposerBaseObjectDefinition::Derive");
- ComposerTypeDefinitionsHelper::DeriveInstance(inCore, m_Instance, inParent.m_Instance);
- }
- void SetType(IDataCore &inCore,
- const SComposerBaseObjectDefinition<ComposerObjectTypes::Typed> &inParent)
- {
- QT3DSDM_LOG_FUNCTION("SComposerBaseObjectDefinition::SetInstancePropertyValue");
- ComposerTypeDefinitionsHelper::SetInstancePropertyValue(
- inCore, m_Instance, inParent.m_TypeProp, ComposerObjectTypes::Convert(TEnumType));
- }
- void TypedDerive(IDataCore &inCore,
- const SComposerBaseObjectDefinition<ComposerObjectTypes::Typed> &inParent)
- {
- QT3DSDM_LOG_FUNCTION("SComposerBaseObjectDefinition::TypedDerive");
- Derive(inCore, inParent);
- SetType(inCore, inParent);
- }
-};
-
-template <ComposerObjectTypes::Enum TEnumType>
-struct SComposerObjectDefinition : public SComposerBaseObjectDefinition<TEnumType>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance)
- : SComposerBaseObjectDefinition<TEnumType>(inCore, inMetaData, inInstance)
- {
- }
-};
-
-// Base class of slides
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Slide>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Slide>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Named> &inNamed)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Slide>(inCore, inMetaData, inInstance)
- {
- TypedDerive(inCore, inTyped);
- Derive(inCore, inNamed);
- }
-};
-
-// Base class of actions
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Action>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Action>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Action>(inCore, inMetaData, inInstance)
- {
- TypedDerive(inCore, inTyped);
- }
-};
-
-// Base class of assets
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Asset>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Asset>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Guided> &inGuided,
- SComposerObjectDefinition<ComposerObjectTypes::Named> &inNamed)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Asset>(inCore, inMetaData, inInstance)
- {
- TypedDerive(inCore, inTyped);
- Derive(inCore, inGuided);
- Derive(inCore, inNamed);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Scene>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Scene>
-{
- SComposerObjectDefinition(
- IDataCore &inCore, IMetaData &inMetaData, Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset,
- SComposerObjectDefinition<ComposerObjectTypes::SlideOwner> &inSlideOwner)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Scene>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inAsset);
- Derive(inCore, inSlideOwner);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Image>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Image>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Image>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::MaterialBase>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::MaterialBase>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::MaterialBase>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Lightmaps>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Lightmaps>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::MaterialBase> &inBase)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Lightmaps>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inBase);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Material>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Material>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Lightmaps> &inBase)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Material>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inBase);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::CustomMaterial>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::CustomMaterial>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Lightmaps> &inBase)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::CustomMaterial>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inBase);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::ReferencedMaterial>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::ReferencedMaterial>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Lightmaps> &inBase)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::ReferencedMaterial>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inBase);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Behavior>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Behavior>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Behavior>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Effect>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Effect>
-
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Effect>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Node>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Node>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Node>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Layer>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Layer>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Layer>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Model>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Model>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Model>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Group>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Group>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Group>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Light>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Light>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Light>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Camera>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Camera>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Camera>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Text>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Text>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Text>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Component>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Component>
-{
- SComposerObjectDefinition(
- IDataCore &inCore, IMetaData &inMetaData, Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode,
- SComposerObjectDefinition<ComposerObjectTypes::SlideOwner> &inSlideOwner)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Component>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inNode);
- Derive(inCore, inSlideOwner);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::RenderPlugin>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::RenderPlugin>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::RenderPlugin>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Alias>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Alias>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Alias>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::Path>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::Path>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Node> &inNode)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::Path>(inCore, inMetaData, inInstance)
- {
- Derive(inCore, inNode);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::PathAnchorPoint>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::PathAnchorPoint>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::PathAnchorPoint>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-template <>
-struct SComposerObjectDefinition<ComposerObjectTypes::SubPath>
- : public SComposerBaseObjectDefinition<ComposerObjectTypes::SubPath>
-{
- SComposerObjectDefinition(IDataCore &inCore, IMetaData &inMetaData,
- Qt3DSDMInstanceHandle inInstance,
- SComposerObjectDefinition<ComposerObjectTypes::Typed> &inTyped,
- SComposerObjectDefinition<ComposerObjectTypes::Asset> &inAsset)
- : SComposerBaseObjectDefinition<ComposerObjectTypes::SubPath>(inCore, inMetaData,
- inInstance)
- {
- Derive(inCore, inAsset);
- SetType(inCore, inTyped);
- }
-};
-
-// Container object for all of the object definitions
-class SComposerObjectDefinitions
-{
-public:
-#define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \
- SComposerObjectDefinition<ComposerObjectTypes::name> m_##name;
- ITERATE_COMPOSER_OBJECT_TYPES
-#undef HANDLE_COMPOSER_OBJECT_TYPE
-
- SComposerObjectDefinitions(IDataCore &inDataCore, IMetaData &inMetaData);
- SComposerObjectDefinitions() = default;
- ~SComposerObjectDefinitions() = default;
-
- // RTTI API
- bool IsA(Qt3DSDMInstanceHandle inInstance, ComposerObjectTypes::Enum inType);
- // Could easily return None, meaning we can't identify the object type.
- // Checks the type of the first derivation parent, so this won't ever return
- // SlideOwner, for instance.
- ComposerObjectTypes::Enum GetType(Qt3DSDMInstanceHandle inInstance);
-
- Qt3DSDMInstanceHandle GetInstanceForType(ComposerObjectTypes::Enum inType);
-private:
- IDataCore &m_DataCore;
- SComposerObjectDefinitions(const SComposerObjectDefinitions&) = delete;
- SComposerObjectDefinitions& operator=(const SComposerObjectDefinitions&) = delete;
-};
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataCore.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataCore.h
deleted file mode 100644
index 793cddb4..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataCore.h
+++ /dev/null
@@ -1,320 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_DATACORE_H
-#define QT3DSDM_DATACORE_H
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMPropertyDefinition.h"
-#include "HandleSystemBase.h"
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSDMValue.h"
-
-namespace qt3dsdm {
-
-typedef std::pair<Qt3DSDMPropertyHandle, SValue> TPropertyHandleValuePair;
-typedef std::vector<TPropertyHandleValuePair> TPropertyHandleValuePairList;
-
-class IInstancePropertyCore
-{
-public:
- virtual ~IInstancePropertyCore() {}
-
- /**
- * Find a given instance property by name. May return an invalid handle.
- */
- virtual Qt3DSDMPropertyHandle
- GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const = 0;
- /**
- * Get the entire list of instance properties;
- */
- virtual void GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const = 0;
- // Get the properties that are stored only on this instance, not on any parents.
- virtual void GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inHandle,
- TPropertyHandleValuePairList &outValues) = 0;
- /**
- * Return true if this property is on this instance or one of its parents.
- */
- virtual bool HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
-
- /**
- * Does this value match the approperty property type.
- * error - PropertyNotFound
- * error - ValueTypeError
- */
- virtual void CheckValue(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) const = 0;
- /**
- * Get this property from this instance. This includes looking up the default value. If the
- *instance doesn't have the property
- * and it has no default the return value is false.
- * error - InstanceNotFound
- * error - PropertyNotFound if this property doesn't exist on this instance or doesn't exist.
- */
- virtual bool GetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
- /**
- * Set this property on this instance.
- * error - InstanceNotFound
- * error - PropertyNotFound if this property doesn't exist on this instance or doesn't exist.
- * error - ValueTypeError if this value is of the wrong type
- */
- virtual void SetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-};
-
-typedef std::shared_ptr<IInstancePropertyCore> TInstancePropertyCorePtr;
-
-class IStringTable;
-
-/**
- * Primary interface to data model system. This allows you to define 'classes', which are
- *really just
- * collections of properties, and instances of those classes. A zero handle value is regarded
- *as empty.
- */
-class IDataCore : public IHandleBase, public IInstancePropertyCore
-{
-public:
- virtual ~IDataCore() {}
-
- // Bookkeeping
- virtual IStringTable &GetStringTable() const = 0;
- virtual std::shared_ptr<IStringTable> GetStringTablePtr() const = 0;
-
- //===============================================================
- // Instances
- //===============================================================
- /**
- * Create a new instance of a class. Instances can be named, in which case
- * they are sometimes treated differently when serialized. If the name is null
- * or has no length then it is ignored. If the name is non-null, then a check is
- * run as named instances must have unique names. When a named instance is a parent
- * of another instance, only its name is serialized out; not its handle thus you can safely
- * use names as inter-application instance handles.
- * May use a target id to specify what the ideal id is; id must not exist.
- * - error DuplicateInstanceName
- */
- virtual Qt3DSDMInstanceHandle
- CreateInstance(Qt3DSDMInstanceHandle inTargetId = Qt3DSDMInstanceHandle()) = 0;
- /**
- * Delete an instance.
- * error - InstanceNotFound
- */
- virtual void DeleteInstance(Qt3DSDMInstanceHandle inHandle) = 0;
- /**
- * Return all the instances in the system.
- */
- virtual void GetInstances(TInstanceHandleList &outInstances) const = 0;
- /**
- * Return all the instances in the system that is derived from parent.
- */
- virtual void GetInstancesDerivedFrom(TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParentHandle) const = 0;
-
- //===============================================================
- // Instance Derivation
- //===============================================================
- /**
- * Derive an instance from another instance. This implies a rebuild of
- * the aggregate properties of a given instance.
- * error - InstanceNotFound if either instance or parent aren't found
- */
- virtual void DeriveInstance(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent) = 0;
- /**
- * Return a count of the parent's of a given instance.
- * error - InstanceNotFound
- */
- virtual void GetInstanceParents(Qt3DSDMInstanceHandle inHandle,
- TInstanceHandleList &outParents) const = 0;
-
- /**
- * Returns true if the instance is derived from the parent somehow.
- */
- virtual bool IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const = 0;
- //===============================================================
-
- //===============================================================
- // Class Properties
- //===============================================================
- /**
- * Add a new property to a given instances. You can use this to overshadow properties
- * on base instances but you can't add two properties of the same name to a given
- * instance.
- * error - InstanceNotFound
- * error - PropertyExists if the property already exists on this class
- * error - ValueTypeError if the default value exists and is if a different type than
- *inPropType
- */
- virtual Qt3DSDMPropertyHandle AddProperty(Qt3DSDMInstanceHandle inInstance, TCharPtr inName,
- DataModelDataType::Value inPropType) = 0;
- /**
- * Return the property definition that corresponds to a given property value.
- */
- virtual const Qt3DSDMPropertyDefinition &GetProperty(Qt3DSDMPropertyHandle inProperty) const = 0;
- /**
- * Return the properties specific to this instance, not including properties
- * gained by derivation
- */
- virtual void GetInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const = 0;
- /**
- * Remove a property from an instance. Instances will no long have this property accessible
- *nor will
- * child instances.
- */
- virtual void RemoveProperty(Qt3DSDMPropertyHandle inProperty) = 0;
- /**
- * Copy properties (definitions & values) specific to one instance, not including properties
- * gained by derivation, to another instance.
- */
- virtual void CopyInstanceProperties(Qt3DSDMInstanceHandle inSrcInstance,
- Qt3DSDMInstanceHandle inDestInstance) = 0;
- /**
- * Removed cached intermediate values from the instance. DataModel pull properties from the
- *inheritance hierarchy chain
- * up to the current instance when someone requests a property in order to make the next
- *request quicker. This breaks
- * some forms of updating where a parent's default value gets changed and the instance won't
- *reflect it (until you
- * save/load the file).
- */
- //===============================================================
- virtual void RemoveCachedValues(Qt3DSDMInstanceHandle inInstance) = 0;
-
- //===============================================================
- // Handle validation
- //===============================================================
- /**
- * Is valid and is instances
- */
- virtual bool IsInstance(int inHandle) const = 0;
- /**
- * is valid and is property
- */
- virtual bool IsProperty(int inHandle) const = 0;
-};
-
-typedef std::shared_ptr<IDataCore> TDataCorePtr;
-
-class IPropertySystem : public IHandleBase
-{
-public:
- virtual ~IPropertySystem() {}
-
- virtual Qt3DSDMInstanceHandle CreateInstance() = 0;
- virtual void DeleteInstance(Qt3DSDMInstanceHandle inHandle) = 0;
- virtual void DeriveInstance(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent) = 0;
-
- virtual void GetInstances(TInstanceHandleList &outInstances) const = 0;
-
- virtual Qt3DSDMPropertyHandle AddProperty(Qt3DSDMInstanceHandle inInstance, TCharPtr inName,
- DataModelDataType::Value inPropType) = 0;
-
- virtual Qt3DSDMPropertyHandle
- GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const = 0;
- virtual void GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const = 0;
- virtual bool HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
-
- virtual bool GetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
- virtual void SetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- virtual bool IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const = 0;
-
- virtual DataModelDataType::Value GetDataType(Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual TCharStr GetName(Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual TCharStr GetFormalName(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual AdditionalMetaDataType::Value
- GetAdditionalMetaDataType(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual TMetaDataData GetAdditionalMetaDataData(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual Qt3DSDMInstanceHandle GetPropertyOwner(Qt3DSDMPropertyHandle inProperty) const = 0;
-
- virtual QVector<Qt3DSDMPropertyHandle> GetControllableProperties(
- Qt3DSDMInstanceHandle inInst) const = 0;
-
-};
-typedef std::shared_ptr<IPropertySystem> TPropertySystemPtr;
-
-template <typename TCoreType>
-inline SValue GetInstancePropertyValue(TCoreType inCore, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- SValue retval;
- if (!inCore->GetInstancePropertyValue(inInstance, inProperty, retval))
- throw PropertyNotFound(L"");
- return retval;
-}
-
-template <typename TDataType, typename TCoreType>
-inline TDataType GetSpecificInstancePropertyValue(TCoreType inDataCore,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- return qt3dsdm::get<TDataType>(GetInstancePropertyValue(inDataCore, inInstance, inProperty));
-}
-
-template <typename TDataType, typename TCoreType>
-inline TDataType GetNamedInstancePropertyValue(TCoreType inDataCore,
- Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inName)
-{
- Qt3DSDMPropertyHandle theProperty =
- inDataCore->GetAggregateInstancePropertyByName(inInstance, inName);
- return GetSpecificInstancePropertyValue<TDataType, TCoreType>(inDataCore, inInstance,
- theProperty);
-}
-
-inline Qt3DSDMPropertyHandle AddPropertyWithValue(IPropertySystem &inPropertySystem,
- Qt3DSDMInstanceHandle inInstance, TCharPtr inName,
- DataModelDataType::Value inDataType,
- const SValue &inValue)
-{
- Qt3DSDMPropertyHandle theProperty(inPropertySystem.AddProperty(inInstance, inName, inDataType));
- inPropertySystem.SetInstancePropertyValue(inInstance, theProperty, inValue);
- return theProperty;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataTypes.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataTypes.h
deleted file mode 100644
index 7a7157f6..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMDataTypes.h
+++ /dev/null
@@ -1,891 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_DATA_H
-#define QT3DSDM_DATA_H
-
-#include <memory>
-#include <functional>
-
-#include "Qt3DSDMErrors.h"
-#include "Qt3DSDMStringTable.h"
-#include "Qt3DSDMWindowsCompatibility.h"
-#include <stdexcept>
-#include <vector>
-#include <map>
-#include <set>
-#include <EABase/eabase.h> //char8_t, etc.
-#include <EASTL/string.h>
-#include <EASTL/vector.h>
-#include "foundation/StrConvertUTF.h"
-#include "foundation/Qt3DSDiscriminatedUnion.h"
-
-#include <QObject>
-
-namespace qt3dsdm {
-
-typedef const wchar_t *TCharPtr;
-struct Qt3DSDMStr : public eastl::basic_string<qt3ds::foundation::TWCharEASTLConverter::TCharType>
-{
- typedef qt3ds::foundation::TWCharEASTLConverter::TCharType TCharType;
- typedef eastl::basic_string<qt3ds::foundation::TWCharEASTLConverter::TCharType> TStrType;
- Qt3DSDMStr() {}
- Qt3DSDMStr(const wchar_t *inStr)
- : TStrType(qt3ds::NVUnionCast<const TCharType *>(inStr))
- {
- }
- Qt3DSDMStr(const TStrType &inOther)
- : TStrType(inOther)
- {
- }
-
- const wchar_t *wide_str() const { return reinterpret_cast<const wchar_t *>(c_str()); }
- bool operator==(const Qt3DSDMStr &inOther) const { return TStrType::compare(inOther) == 0; }
- bool operator!=(const Qt3DSDMStr &inOther) const { return TStrType::compare(inOther) != 0; }
- bool operator==(const wchar_t *inOther) const
- {
- return TStrType::compare(reinterpret_cast<const TCharType *>(inOther)) == 0;
- }
- bool operator!=(const wchar_t *inOther) const
- {
- return TStrType::compare(reinterpret_cast<const TCharType *>(inOther)) != 0;
- }
-
- TStrType::size_type find_first_of(const wchar_t *p, size_type position = 0) const
- {
- return TStrType::find_first_of(reinterpret_cast<const TCharType *>(p), position);
- }
- TStrType::size_type find_first_not_of(const wchar_t *p, size_type position = 0) const
- {
- return TStrType::find_first_not_of(reinterpret_cast<const TCharType *>(p), position);
- }
- TStrType::size_type find_last_not_of(const wchar_t *p,
- size_type position = TStrType::npos) const
- {
- return TStrType::find_last_not_of(reinterpret_cast<const TCharType *>(p), position);
- }
- TStrType::size_type find(const wchar_t *p, size_type position = 0) const
- {
- return TStrType::find(reinterpret_cast<const TCharType *>(p), position);
- }
- TStrType::size_type find(wchar_t p, size_type position = 0) const
- {
- return TStrType::find(static_cast<TCharType>(p), position);
- }
- TStrType::size_type rfind(const wchar_t *p, size_type position = TStrType::npos) const
- {
- return TStrType::rfind(reinterpret_cast<const TCharType *>(p), position);
- }
- TStrType::size_type rfind(wchar_t p, size_type position = TStrType::npos) const
- {
- return TStrType::rfind(p, position);
- }
- Qt3DSDMStr replace(size_type position, size_type length, const wchar_t *inNewStr)
- {
- return TStrType::replace(position, length, reinterpret_cast<const TCharType *>(inNewStr));
- }
-
- void append(const wchar_t *p) { TStrType::append(reinterpret_cast<const TCharType *>(p)); }
- void append(const wchar_t *p, size_type position, size_type n)
- {
- TStrType::append(reinterpret_cast<const TCharType *>(p), position, n);
- }
- void append(const Qt3DSDMStr &p) { TStrType::append(p); }
- void assign(const wchar_t *p) { TStrType::assign(reinterpret_cast<const TCharType *>(p)); }
- void assign(const Qt3DSDMStr &p) { TStrType::assign(p); }
-};
-typedef Qt3DSDMStr TCharStr;
-typedef std::vector<wchar_t> TCharList;
-typedef eastl::vector<TCharStr> TCharStrList;
-typedef std::map<TCharStr, int> TCharStrIntMap;
-typedef std::map<int, TCharStr> TIntTCharStrMap;
-typedef std::vector<int> TIntList;
-typedef std::set<int> TIntSet;
-typedef eastl::vector<float> TFloatList;
-
-template <typename TDataType>
-class CImmutableVector : private std::vector<TDataType>
-{
-public:
- typedef std::vector<TDataType> base;
-
- CImmutableVector(const std::vector<TDataType> &inSrc)
- : base(inSrc)
- {
- }
- CImmutableVector(const CImmutableVector &inSrc)
- : base(inSrc)
- {
- }
-
- CImmutableVector &operator=(const CImmutableVector &inSrc)
- {
- base::operator=(inSrc);
- return *this;
- }
-
- typename std::vector<TDataType>::const_iterator begin() const { return base::begin(); }
- typename std::vector<TDataType>::const_iterator end() const { return base::end(); }
-
- size_t size() const { return base::size(); }
-
- const TDataType &at(int inIndex) const { return base::at(inIndex); }
- const TDataType &operator[](int inIndex) const { return base::at(inIndex); }
-};
-
-typedef CImmutableVector<TCharStr> TImmutableCharStrList;
-typedef std::shared_ptr<TImmutableCharStrList> TImmutableCharStrListPtr;
-
-class CDataStr
-{
- TCharList m_Data;
-
-public:
- CDataStr() {}
- CDataStr(TCharList &inData) { m_Data.swap(inData); }
- CDataStr(const wchar_t *inData)
- {
- if (inData && *inData)
- m_Data.insert(m_Data.begin(), inData, inData + wcslen(inData));
- m_Data.push_back(0);
- }
- CDataStr(const wchar_t *inData, size_t inLen)
- {
- if (inData && *inData)
- m_Data.insert(m_Data.begin(), inData, inData + inLen);
- if (m_Data.size() > 0 && m_Data.back() != 0)
- m_Data.push_back(0);
- }
- CDataStr(const CDataStr &inOther)
- : m_Data(inOther.m_Data)
- {
- }
- virtual ~CDataStr() {}
-
- CDataStr &operator=(const CDataStr &inOther)
- {
- m_Data = inOther.m_Data;
- return *this;
- }
- const wchar_t *GetData() const { return m_Data.size() <= 1 ? L"" : &(*m_Data.begin()); }
- size_t GetLength() const { return m_Data.size() > 1 ? m_Data.size() - 1 : 0; }
- bool operator==(const CDataStr &inOther) const { return m_Data == inOther.m_Data; }
- QString toQString() const { return QString::fromWCharArray(GetData()); }
-};
-
-typedef std::shared_ptr<CDataStr> TDataStrPtr;
-
-struct SFloat2
-{
- float m_Floats[2];
- SFloat2(float f1 = 0, float f2 = 0)
- {
- m_Floats[0] = f1;
- m_Floats[1] = f2;
- }
- SFloat2(const SFloat2 &inOther) { operator=(inOther); }
- SFloat2 &operator=(const SFloat2 &inOther)
- {
- m_Floats[0] = inOther.m_Floats[0];
- m_Floats[1] = inOther.m_Floats[1];
- return *this;
- }
- bool operator==(const SFloat2 &other) const
- {
- return m_Floats[0] == other.m_Floats[0] && m_Floats[1] == other.m_Floats[1];
- }
- float &operator[](size_t inIndex)
- {
- switch (inIndex) {
- default:
- throw std::out_of_range("");
- case 0:
- case 1:
- return m_Floats[inIndex];
- }
- }
- const float &operator[](size_t inIndex) const
- {
- switch (inIndex) {
- default:
- throw std::out_of_range("");
- case 0:
- case 1:
- return m_Floats[inIndex];
- }
- }
-};
-
-struct SFloat3
-{
- float m_Floats[3];
-
- SFloat3(float f1 = 0, float f2 = 0, float f3 = 0)
- {
- m_Floats[0] = f1;
- m_Floats[1] = f2;
- m_Floats[2] = f3;
- }
- SFloat3(const SFloat3 &inOther) { operator=(inOther); }
- SFloat3 &operator=(const SFloat3 &inOther)
- {
- m_Floats[0] = inOther.m_Floats[0];
- m_Floats[1] = inOther.m_Floats[1];
- m_Floats[2] = inOther.m_Floats[2];
- return *this;
- }
-
- bool operator==(const SFloat3 &other) const
- {
- return m_Floats[0] == other.m_Floats[0] && m_Floats[1] == other.m_Floats[1]
- && m_Floats[2] == other.m_Floats[2];
- }
-
- float &operator[](size_t inIndex)
- {
- switch (inIndex) {
- default:
- throw std::out_of_range("");
- case 0:
- case 1:
- case 2:
- return m_Floats[inIndex];
- }
- }
- const float &operator[](size_t inIndex) const
- {
- switch (inIndex) {
- default:
- throw std::out_of_range("");
- case 0:
- case 1:
- case 2:
- return m_Floats[inIndex];
- }
- }
-};
-
-struct SFloat4
-{
- float m_Floats[4];
-
- SFloat4(float f1 = 0, float f2 = 0, float f3 = 0, float f4 = 1)
- {
- m_Floats[0] = f1;
- m_Floats[1] = f2;
- m_Floats[2] = f3;
- m_Floats[3] = f4;
- }
- SFloat4(const SFloat4 &inOther) { operator=(inOther); }
- SFloat4 &operator=(const SFloat4 &inOther)
- {
- m_Floats[0] = inOther.m_Floats[0];
- m_Floats[1] = inOther.m_Floats[1];
- m_Floats[2] = inOther.m_Floats[2];
- m_Floats[3] = inOther.m_Floats[3];
- return *this;
- }
-
- bool operator==(const SFloat4 &other) const
- {
- return m_Floats[0] == other.m_Floats[0] && m_Floats[1] == other.m_Floats[1]
- && m_Floats[2] == other.m_Floats[2] && m_Floats[3] == other.m_Floats[3];
- }
-
- float &operator[](size_t inIndex)
- {
- if (inIndex < 4)
- return m_Floats[inIndex];
-
- throw std::out_of_range("");
- }
- const float &operator[](size_t inIndex) const
- {
- if (inIndex < 4)
- return m_Floats[inIndex];
-
- throw std::out_of_range("");
- }
-};
-
-struct SLong4
-{
- qt3ds::QT3DSU32 m_Longs[4];
-
- SLong4(qt3ds::QT3DSU32 l1 = 0,
- qt3ds::QT3DSU32 l2 = 0,
- qt3ds::QT3DSU32 l3 = 0,
- qt3ds::QT3DSU32 l4 = 0)
- {
- m_Longs[0] = l1;
- m_Longs[1] = l2;
- m_Longs[2] = l3;
- m_Longs[3] = l4;
- }
- SLong4(const SLong4 &inOther) { operator=(inOther); }
- SLong4 &operator=(const SLong4 &inOther)
- {
- m_Longs[0] = inOther.m_Longs[0];
- m_Longs[1] = inOther.m_Longs[1];
- m_Longs[2] = inOther.m_Longs[2];
- m_Longs[3] = inOther.m_Longs[3];
- return *this;
- }
-
- bool operator==(const SLong4 &other) const
- {
- return m_Longs[0] == other.m_Longs[0] && m_Longs[1] == other.m_Longs[1]
- && m_Longs[2] == other.m_Longs[2] && m_Longs[3] == other.m_Longs[3];
- }
-
- bool operator<(const SLong4 &other) const
- {
- if (m_Longs[0] < other.m_Longs[0])
- return true;
- else if (m_Longs[0] == other.m_Longs[0]) {
- if (m_Longs[1] < other.m_Longs[1])
- return true;
- else if (m_Longs[1] == other.m_Longs[1]) {
- if (m_Longs[2] < other.m_Longs[2])
- return true;
- else if (m_Longs[3] < other.m_Longs[3])
- return true;
- }
- }
- return false;
- }
-
- bool Valid() const
- {
- bool retval = false;
- for (int idx = 0; idx < 4; ++idx)
- retval = retval || m_Longs[0] > 0;
- return retval;
- }
-};
-
-typedef std::vector<SLong4> TLong4Vec;
-
-struct SSizet4
-{
- size_t m_Longs[4];
-
- SSizet4(size_t l1 = 0, size_t l2 = 0, size_t l3 = 0, size_t l4 = 0)
- {
- m_Longs[0] = l1;
- m_Longs[1] = l2;
- m_Longs[2] = l3;
- m_Longs[3] = l4;
- }
- SSizet4(const SSizet4 &inOther) { operator=(inOther); }
- SSizet4 &operator=(const SSizet4 &inOther)
- {
- m_Longs[0] = inOther.m_Longs[0];
- m_Longs[1] = inOther.m_Longs[1];
- m_Longs[2] = inOther.m_Longs[2];
- m_Longs[3] = inOther.m_Longs[3];
- return *this;
- }
-
- bool operator==(const SSizet4 &other) const
- {
- return m_Longs[0] == other.m_Longs[0] && m_Longs[1] == other.m_Longs[1]
- && m_Longs[2] == other.m_Longs[2] && m_Longs[3] == other.m_Longs[3];
- }
-
- bool operator<(const SSizet4 &other) const
- {
- if (m_Longs[0] < other.m_Longs[0])
- return true;
- else if (m_Longs[0] == other.m_Longs[0]) {
- if (m_Longs[1] < other.m_Longs[1])
- return true;
- else if (m_Longs[1] == other.m_Longs[1]) {
- if (m_Longs[2] < other.m_Longs[2])
- return true;
- else if (m_Longs[3] < other.m_Longs[3])
- return true;
- }
- }
- return false;
- }
-
- bool Valid() const
- {
- bool retval = false;
- for (int idx = 0; idx < 4; ++idx)
- retval = retval || m_Longs[0] > 0;
- return retval;
- }
-};
-
-inline bool IsTrivial(const wchar_t *inStr)
-{
- return inStr == NULL || *inStr == 0;
-}
-inline const wchar_t *NonNull(const wchar_t *inStr)
-{
- return inStr ? inStr : L"";
-}
-inline bool AreEqual(const wchar_t *lhs, const wchar_t *rhs)
-{
- return wcscmp(NonNull(lhs), NonNull(rhs)) == 0;
-}
-
-inline bool IsTrivial(const char8_t *inStr)
-{
- return inStr == NULL || *inStr == 0;
-}
-inline const char8_t *NonNull(const char8_t *inStr)
-{
- return inStr ? inStr : "";
-}
-inline bool AreEqual(const char8_t *lhs, const char8_t *rhs)
-{
- return strcmp(NonNull(lhs), NonNull(rhs)) == 0;
-}
-
-inline bool AreEqualCaseless(const char8_t *lhs, const char8_t *rhs)
-{
- if (IsTrivial(lhs) && IsTrivial(rhs))
- return true;
- if (IsTrivial(lhs) || IsTrivial(rhs))
- return false;
- for (; *lhs && *rhs; ++lhs, ++rhs)
- if (tolower(*lhs) != tolower(*rhs))
- return false;
- if (*lhs || *rhs)
- return false;
- return true;
-}
-
-struct SStringRef
-{
- const wchar_t *m_Id;
-
- SStringRef(const wchar_t *id = L"")
- : m_Id(NonNull(id))
- {
- }
-
- operator const wchar_t *() const { return m_Id; }
- bool operator==(const SStringRef &inOther) const { return AreEqual(m_Id, inOther.m_Id); }
-};
-}
-
-// Traits specializations have to be in the same namespace as they were first declared.
-namespace qt3ds {
-namespace foundation {
-
- template <>
- struct DestructTraits<qt3dsdm::SFloat2>
- {
- void destruct(qt3dsdm::SFloat2 &) {}
- };
- template <>
- struct DestructTraits<qt3dsdm::SFloat3>
- {
- void destruct(qt3dsdm::SFloat3 &) {}
- };
- template <>
- struct DestructTraits<qt3dsdm::SFloat4>
- {
- void destruct(qt3dsdm::SFloat4 &) {}
- };
- template <>
- struct DestructTraits<qt3dsdm::SLong4>
- {
- void destruct(qt3dsdm::SLong4 &) {}
- };
- template <>
- struct DestructTraits<qt3dsdm::SStringRef>
- {
- void destruct(qt3dsdm::SStringRef &) {}
- };
-
- template <>
- struct EqualVisitorTraits<qt3dsdm::TDataStrPtr>
- {
- bool operator()(const qt3dsdm::TDataStrPtr &lhs, const qt3dsdm::TDataStrPtr &rhs)
- {
- if (lhs && rhs)
- return *lhs == *rhs;
- if (lhs || rhs)
- return false;
- return true;
- }
- };
-}
-}
-
-namespace qt3dsdm {
-
-using qt3ds::NVUnionCast;
-
-struct ObjectReferenceType
-{
- enum Enum {
- Unknown = 0,
- Absolute = 1,
- Relative = 2,
- };
-};
-
-template <typename TDataType>
-struct SObjectRefTypeTraits
-{
-};
-
-template <>
-struct SObjectRefTypeTraits<SLong4>
-{
- ObjectReferenceType::Enum getType() { return ObjectReferenceType::Absolute; }
-};
-template <>
-struct SObjectRefTypeTraits<TDataStrPtr>
-{
- ObjectReferenceType::Enum getType() { return ObjectReferenceType::Relative; }
-};
-
-struct SObjectRefUnionTraits
-{
- typedef ObjectReferenceType::Enum TIdType;
- enum {
- TBufferSize = sizeof(SSizet4),
- };
-
- static ObjectReferenceType::Enum getNoDataId() { return ObjectReferenceType::Unknown; }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return SObjectRefTypeTraits<TDataType>().getType();
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case ObjectReferenceType::Absolute:
- return inVisitor(*NVUnionCast<SLong4 *>(inData));
- case ObjectReferenceType::Relative:
- return inVisitor(*NVUnionCast<TDataStrPtr *>(inData));
- default:
- QT3DS_ASSERT(false);
- case ObjectReferenceType::Unknown:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case ObjectReferenceType::Absolute:
- return inVisitor(*NVUnionCast<const SLong4 *>(inData));
- case ObjectReferenceType::Relative:
- return inVisitor(*NVUnionCast<const TDataStrPtr *>(inData));
- default:
- QT3DS_ASSERT(false);
- case ObjectReferenceType::Unknown:
- return inVisitor();
- }
- }
-};
-
-typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SObjectRefUnionTraits,
- SObjectRefUnionTraits::TBufferSize>,
- SObjectRefUnionTraits::TBufferSize>
- TObjRefUnionType;
-
-template <typename TDataType>
-struct Qt3DSDMGetter
-{
-};
-
-template <typename TRetType, typename TDataType>
-TRetType get(const TDataType &inType)
-{
- return Qt3DSDMGetter<TDataType>().template doGet<TRetType>(inType);
-}
-
-template <>
-struct Qt3DSDMGetter<TObjRefUnionType>
-{
- template <typename TRetType>
- TRetType doGet(const TObjRefUnionType &inValue)
- {
- return inValue.getData<TRetType>();
- }
-};
-
-// Either an absolute reference (SLong4) or a relative reference (string)
-struct SObjectRefType
-{
- TObjRefUnionType m_Value;
-
- SObjectRefType(const TDataStrPtr &inValue)
- : m_Value(inValue)
- {
- }
- SObjectRefType(const SLong4 &inValue)
- : m_Value(inValue)
- {
- }
- SObjectRefType(const SObjectRefType &inOther)
- : m_Value(inOther.m_Value)
- {
- }
- SObjectRefType() {}
- SObjectRefType &operator=(const SObjectRefType &inOther)
- {
- m_Value = inOther.m_Value;
- return *this;
- }
- ObjectReferenceType::Enum GetReferenceType() const { return m_Value.getType(); }
- bool operator==(const SObjectRefType &inOther) const { return m_Value == inOther.m_Value; }
-};
-
-inline bool Equals(const SObjectRefType &lhs, const SObjectRefType &rhs)
-{
- return lhs == rhs;
-}
-
-struct SStringOrIntTypes
-{
- enum Enum {
- Unknown = 0,
- Int,
- String,
- };
-};
-
-template <typename TDataType>
-struct SStringOrIntTypeTraits
-{
-};
-
-template <>
-struct SStringOrIntTypeTraits<long>
-{
- SStringOrIntTypes::Enum getType() { return SStringOrIntTypes::Int; }
-};
-template <>
-struct SStringOrIntTypeTraits<int>
-{
- SStringOrIntTypes::Enum getType() { return SStringOrIntTypes::Int; }
-};
-template <>
-struct SStringOrIntTypeTraits<TDataStrPtr>
-{
- SStringOrIntTypes::Enum getType() { return SStringOrIntTypes::String; }
-};
-
-struct SStringOrIntUnionTraits
-{
- typedef SStringOrIntTypes::Enum TIdType;
- enum {
- TBufferSize = sizeof(TDataStrPtr),
- };
-
- static SStringOrIntTypes::Enum getNoDataId() { return SStringOrIntTypes::Unknown; }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return SStringOrIntTypeTraits<TDataType>().getType();
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case SStringOrIntTypes::Int:
- return inVisitor(*NVUnionCast<long *>(inData));
- case SStringOrIntTypes::String:
- return inVisitor(*NVUnionCast<TDataStrPtr *>(inData));
- default:
- QT3DS_ASSERT(false);
- case SStringOrIntTypes::Unknown:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case SStringOrIntTypes::Int:
- return inVisitor(*NVUnionCast<const qt3ds::QT3DSI32 *>(inData));
- case SStringOrIntTypes::String:
- return inVisitor(*NVUnionCast<const TDataStrPtr *>(inData));
- default:
- QT3DS_ASSERT(false);
- case SStringOrIntTypes::Unknown:
- return inVisitor();
- }
- }
-};
-
-typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SStringOrIntUnionTraits,
- SStringOrIntUnionTraits::TBufferSize>,
- SStringOrIntUnionTraits::TBufferSize>
- TStringOrIntUnionType;
-
-template <>
-struct Qt3DSDMGetter<TStringOrIntUnionType>
-{
- template <typename TRetType>
- TRetType doGet(const TStringOrIntUnionType &inValue)
- {
- return inValue.getData<TRetType>();
- }
-};
-
-struct SStringOrInt
-{
- TStringOrIntUnionType m_Value;
-
- SStringOrInt() {}
- SStringOrInt(int inValue)
- : m_Value(inValue)
- {
- }
- SStringOrInt(TDataStrPtr inValue)
- : m_Value(inValue)
- {
- }
- SStringOrInt(const SStringOrInt &inOther)
- : m_Value(inOther.m_Value)
- {
- }
-
- SStringOrInt &operator=(const SStringOrInt &inOther)
- {
- m_Value = inOther.m_Value;
- return *this;
- }
-
- SStringOrIntTypes::Enum GetType() const { return m_Value.getType(); }
-
- bool operator==(const SStringOrInt &inOther) const { return m_Value == inOther.m_Value; }
-};
-
-inline bool Equals(const SStringOrInt &lhs, const SStringOrInt &rhs)
-{
- return lhs == rhs;
-}
-
-//comes from broken X.h
-#ifdef None
-#undef None
-#endif
-
-#ifdef Bool
-#undef Bool
-#endif
-
-struct DataModelDataType {
-
- enum Value {
- None,
- Float,
- Float2,
- Float3,
- Float4,
- Long,
- String,
- Bool,
- Long4,
- StringRef,
- ObjectRef,
- StringOrInt,
- FloatList,
- RangedNumber // datainput-specific type for editor only
- };
-
-
- Q_ENUM(Value)
- Q_GADGET
-};
-
-
-class IStringTable;
-
-template <typename TDataType>
-struct Qt3DSDMValueTyper
-{
-};
-
-template <typename TDataType>
-inline DataModelDataType::Value GetValueType(const TDataType &inValue)
-{
- return Qt3DSDMValueTyper<TDataType>().Get(inValue);
-}
-
-template <typename TDataType>
-struct SDefaulter
-{
-};
-
-template <typename TDataType>
-inline bool SetDefault(DataModelDataType::Value inDataType, TDataType &outValue)
-{
- return SDefaulter<TDataType>().SetDefault(inDataType, outValue);
-}
-
-typedef void (*Qt3DSDMDebugLogFunction)(const char *message);
-// UICDMSimpleDataCore.cpp
-extern Qt3DSDMDebugLogFunction g_DataModelDebugLogger;
-
-#define QT3DSDM_DEBUG_LOG(msg) \
- { \
- if (g_DataModelDebugLogger) { \
- g_DataModelDebugLogger(msg); \
- } \
- }
-struct Qt3DSDMLogScope
-{
- const char *m_EndMessage;
- Qt3DSDMLogScope(const char *inStartMessage, const char *inEndMessage)
- : m_EndMessage(inEndMessage)
- {
- QT3DSDM_DEBUG_LOG(inStartMessage);
- }
- ~Qt3DSDMLogScope() { QT3DSDM_DEBUG_LOG(m_EndMessage); }
-};
-
-#define QT3DSDM_LOG_FUNCTION(fnname) Qt3DSDMLogScope __fn_scope(fnname " Enter", fnname " Leave");
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMErrors.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMErrors.h
deleted file mode 100644
index 77ea7bf7..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMErrors.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_ERRORS_H
-#define QT3DSDM_ERRORS_H
-#include "Qt3DSDMWindowsCompatibility.h"
-
-namespace qt3dsdm {
-class Qt3DSDMError : public std::exception
-{
-public:
- Qt3DSDMError(const wchar_t *inMessage)
- : std::exception()
- {
- wcscpy_s(m_Message, inMessage);
- }
- wchar_t m_Message[1024];
-};
-
-class HandleExists : public Qt3DSDMError
-{
-public:
- HandleExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class PropertyNotFound : public Qt3DSDMError
-{
-public:
- PropertyNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class PropertyExists : public Qt3DSDMError
-{
-public:
- PropertyExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class DuplicateInstanceName : public Qt3DSDMError
-{
-public:
- DuplicateInstanceName(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class InstanceNotFound : public Qt3DSDMError
-{
-public:
- InstanceNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class ValueTypeError : public Qt3DSDMError
-{
-public:
- ValueTypeError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SerializationError : public Qt3DSDMError
-{
-public:
- SerializationError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SlideNotFound : public Qt3DSDMError
-{
-public:
- SlideNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SlideExists : public Qt3DSDMError
-{
-public:
- SlideExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SlideDerivationError : public Qt3DSDMError
-{
-public:
- SlideDerivationError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SlideChildNotFoundError : public Qt3DSDMError
-{
-public:
- SlideChildNotFoundError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SlideGraphNotFound : public Qt3DSDMError
-{
-public:
- SlideGraphNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class SlideGraphExists : public Qt3DSDMError
-{
-public:
- SlideGraphExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class PropertyLinkError : public Qt3DSDMError
-{
-public:
- PropertyLinkError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class RearrangeSlideArgumentsMustNotBeZero : public Qt3DSDMError
-{
-public:
- RearrangeSlideArgumentsMustNotBeZero(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class AnimationNotFound : public Qt3DSDMError
-{
-public:
- AnimationNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class AnimationExists : public Qt3DSDMError
-{
-public:
- AnimationExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class AnimationKeyframeTypeError : public Qt3DSDMError
-{
-public:
- AnimationKeyframeTypeError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class AnimationKeyframeNotFound : public Qt3DSDMError
-{
-public:
- AnimationKeyframeNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class AnimationEvaluationError : public Qt3DSDMError
-{
-public:
- AnimationEvaluationError(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class ActionNotFound : public Qt3DSDMError
-{
-public:
- ActionNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class ActionExists : public Qt3DSDMError
-{
-public:
- ActionExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class HandlerArgumentNotFound : public Qt3DSDMError
-{
-public:
- HandlerArgumentNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class HandlerArgumentExists : public Qt3DSDMError
-{
-public:
- HandlerArgumentExists(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class CustomPropertyNotFound : public Qt3DSDMError
-{
-public:
- CustomPropertyNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class CustomEventNotFound : public Qt3DSDMError
-{
-public:
- CustomEventNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class CustomHandlerNotFound : public Qt3DSDMError
-{
-public:
- CustomHandlerNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class CustomHandlerParamNotFound : public Qt3DSDMError
-{
-public:
- CustomHandlerParamNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-
-class AttributeTypeNotFound : public Qt3DSDMError
-{
-public:
- AttributeTypeNotFound(const wchar_t *inMessage)
- : Qt3DSDMError(inMessage)
- {
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.cpp
deleted file mode 100644
index e8ea421f..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMGuides.h"
-#include <unordered_map>
-#include "VectorTransactions.h"
-
-using namespace qt3dsdm;
-
-namespace {
-
-#define CONNECT(x) std::make_shared<qt3dsdm::QtSignalConnection>(QObject::connect(this, x, inCallback))
-
-class SGuideSystem : public QObject, public IGuideSystem
-{
- Q_OBJECT
-public:
- typedef std::unordered_map<long, SGuideInfo> TGuideMap;
- typedef std::shared_ptr<IMergeableTransaction<SGuideInfo>> TMergeableTransaction;
- typedef std::unordered_map<long, TMergeableTransaction> TGuideInfoMergeMap;
-
- long m_NextHandleValue;
- TGuideMap m_Guides;
- bool m_GuidesEditable;
-
- std::shared_ptr<ITransactionConsumer> m_CurrentTransaction;
- TGuideInfoMergeMap m_GuideMergeMap;
-Q_SIGNALS:
- void guideCreated(Qt3DSDMGuideHandle, SGuideInfo);
- void guideDestroyed(Qt3DSDMGuideHandle, SGuideInfo);
- void guideModified(Qt3DSDMGuideHandle, SGuideInfo);
- void guideModifiedImmediate(Qt3DSDMGuideHandle, SGuideInfo);
-public:
- SGuideSystem()
- : m_NextHandleValue(0)
- , m_GuidesEditable(true)
- {
- }
-
- void SignalGuideCreated(long hdl, const SGuideInfo &inInfo) { Q_EMIT guideCreated(hdl, inInfo); }
-
- void SignalGuideDestroyed(long hdl, const SGuideInfo &inInfo) { Q_EMIT guideDestroyed(hdl, inInfo); }
-
- void SignalGuideModified(long hdl, const SGuideInfo &inInfo) { Q_EMIT guideModified(hdl, inInfo); }
-
- Qt3DSDMGuideHandle CreateGuide() override
- {
- ++m_NextHandleValue;
- std::pair<long, SGuideInfo> entry(std::make_pair(m_NextHandleValue, SGuideInfo()));
- m_Guides.insert(entry);
- if (m_CurrentTransaction) {
- CreateHashMapInsertTransaction(__FILE__, __LINE__, m_CurrentTransaction, entry,
- m_Guides);
- m_CurrentTransaction->OnDoNotification(std::bind(
- &SGuideSystem::SignalGuideCreated, this, m_NextHandleValue, SGuideInfo()));
- m_CurrentTransaction->OnUndoNotification(std::bind(
- &SGuideSystem::SignalGuideDestroyed, this, m_NextHandleValue, SGuideInfo()));
- }
-
- return m_NextHandleValue;
- }
-
- SGuideInfo *InternalGetGuideInfo(Qt3DSDMGuideHandle inGuideHandle)
- {
- TGuideMap::iterator theFind = m_Guides.find((long)inGuideHandle.GetHandleValue());
- if (theFind != m_Guides.end())
- return &theFind->second;
- return NULL;
- }
-
- const SGuideInfo *InternalGetGuideInfo(Qt3DSDMGuideHandle inGuideHandle) const
- {
- return const_cast<SGuideSystem &>(*this).InternalGetGuideInfo(inGuideHandle);
- }
-
- void SetGuideInfo(Qt3DSDMGuideHandle inGuideHandle, const SGuideInfo &info) override
- {
- SGuideInfo *existing = InternalGetGuideInfo(inGuideHandle);
- long theHdlValue = (long)inGuideHandle.GetHandleValue();
- TGuideInfoMergeMap::iterator iter = m_GuideMergeMap.find(theHdlValue);
- if (iter != m_GuideMergeMap.end()) {
- iter->second->Update(info);
- *existing = info;
- } else {
- if (!existing) {
- QT3DS_ASSERT(false);
- return;
- }
- SGuideInfo oldValue(*existing);
- *existing = info;
- if (m_CurrentTransaction) {
- TMergeableTransaction newTransaction =
- CreateHashMapSwapTransaction(__FILE__, __LINE__, m_CurrentTransaction,
- theHdlValue, oldValue, info, m_Guides);
- m_GuideMergeMap.insert(std::make_pair(theHdlValue, newTransaction));
- m_CurrentTransaction->OnDoNotification(
- std::bind(&SGuideSystem::SignalGuideModified, this, theHdlValue, info));
- m_CurrentTransaction->OnUndoNotification(
- std::bind(&SGuideSystem::SignalGuideModified, this, theHdlValue, oldValue));
- }
- }
- if (AreDataModelSignalsEnabled())
- Q_EMIT guideModifiedImmediate(theHdlValue, info);
- }
-
- SGuideInfo GetGuideInfo(Qt3DSDMGuideHandle inGuideHandle) const override
- {
- const SGuideInfo *existing = InternalGetGuideInfo(inGuideHandle);
- if (existing)
- return *existing;
- QT3DS_ASSERT(false);
- return SGuideInfo();
- }
-
- void DeleteGuide(Qt3DSDMGuideHandle inGuideHandle) override
- {
-
- SGuideInfo *existing = InternalGetGuideInfo(inGuideHandle);
- if (!existing) {
- QT3DS_ASSERT(false);
- return;
- }
- long theHdlValue = (long)inGuideHandle.GetHandleValue();
- SGuideInfo oldValue = *existing;
- m_Guides.erase(theHdlValue);
-
- if (m_CurrentTransaction) {
- std::pair<long, SGuideInfo> entry(std::make_pair(theHdlValue, oldValue));
- CreateHashMapEraseTransaction(__FILE__, __LINE__, m_CurrentTransaction, entry,
- m_Guides);
- m_CurrentTransaction->OnDoNotification(
- std::bind(&SGuideSystem::SignalGuideDestroyed, this, theHdlValue, oldValue));
- m_CurrentTransaction->OnUndoNotification(
- std::bind(&SGuideSystem::SignalGuideCreated, this, theHdlValue, oldValue));
- }
- }
-
- TGuideHandleList GetAllGuides() const override
- {
- TGuideHandleList retval;
- for (TGuideMap::const_iterator iter = m_Guides.begin(), end = m_Guides.end(); iter != end;
- ++iter)
- retval.push_back(iter->first);
- return retval;
- }
-
- bool IsGuideValid(Qt3DSDMGuideHandle inGuideHandle) const override
- {
- return InternalGetGuideInfo(inGuideHandle) != NULL;
- }
- bool AreGuidesEditable() const override { return m_GuidesEditable; }
- void SetGuidesEditable(bool val) override { m_GuidesEditable = val; }
-
- // Undo/Redo
- void SetConsumer(std::shared_ptr<ITransactionConsumer> inConsumer) override
- {
- m_CurrentTransaction = inConsumer;
- m_GuideMergeMap.clear();
- }
-
- // These are events coming from undo/redo operations, not events coming directly from the
- // modification of the guides
- virtual TSignalConnectionPtr
- ConnectGuideCreated(const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) override
- {
- return CONNECT(&SGuideSystem::guideCreated);
- }
-
- virtual TSignalConnectionPtr
- ConnectGuideDestroyed(const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) override
- {
- return CONNECT(&SGuideSystem::guideDestroyed);
- }
-
- virtual TSignalConnectionPtr
- ConnectGuideModified(const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) override
- {
- return CONNECT(&SGuideSystem::guideModified);
- }
-
- // Signal happens immediately instead of on undo/redo, used for live-update of the inspector
- // palette
- TSignalConnectionPtr ConnectGuideModifiedImmediate(
- const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) override
- {
- return CONNECT(&SGuideSystem::guideModifiedImmediate);
- }
-};
-}
-
-shared_ptr<IGuideSystem> IGuideSystem::CreateGuideSystem()
-{
- return std::make_shared<SGuideSystem>();
-}
-
-#include "Qt3DSDMGuides.moc"
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.h
deleted file mode 100644
index 0362abff..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMGuides.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_GUIDES_H
-#define QT3DSDM_GUIDES_H
-#include "Qt3DSDMDataTypes.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "Qt3DSDMSignals.h"
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMTransactions.h"
-#include <functional>
-
-namespace qt3dsdm {
-struct GuideDirections
-{
- enum Enum {
- UnknownDirection = 0,
- Vertical,
- Horizontal,
- };
-};
-
-struct SGuideInfo
-{
- qt3ds::QT3DSF32 m_Position;
- GuideDirections::Enum m_Direction;
- qt3ds::QT3DSI32 m_Width;
- SGuideInfo(qt3ds::QT3DSF32 pos = 0.0f, GuideDirections::Enum dir = GuideDirections::UnknownDirection,
- qt3ds::QT3DSI32 width = 1)
- : m_Position(pos)
- , m_Direction(dir)
- , m_Width(width)
- {
- }
-};
-
-class IGuideSystem : public ITransactionProducer
-{
-protected:
- virtual ~IGuideSystem() {}
-public:
- friend class std::shared_ptr<IGuideSystem>;
-
- virtual Qt3DSDMGuideHandle CreateGuide() = 0;
- virtual void SetGuideInfo(Qt3DSDMGuideHandle inGuideHandle, const SGuideInfo &info) = 0;
- virtual SGuideInfo GetGuideInfo(Qt3DSDMGuideHandle inGuideHandle) const = 0;
- virtual void DeleteGuide(Qt3DSDMGuideHandle inGuideHandle) = 0;
- virtual TGuideHandleList GetAllGuides() const = 0;
- virtual bool IsGuideValid(Qt3DSDMGuideHandle inGuideHandle) const = 0;
- // No real effect on datamodel because you can still create guides when they are locked.
- // Just used in the UI.
- virtual bool AreGuidesEditable() const = 0;
- virtual void SetGuidesEditable(bool val) = 0;
-
- // Undo/Redo
- void SetConsumer(std::shared_ptr<ITransactionConsumer> inConsumer) override = 0;
-
- // These are events coming from undo/redo operations, not events coming directly from the
- // modification of the guides
- virtual TSignalConnectionPtr
- ConnectGuideCreated(const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectGuideDestroyed(
- const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectGuideModified(
- const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) = 0;
-
- // Signal happens immediately instead of on undo/redo, used for live-update of the inspector
- // palette
- virtual TSignalConnectionPtr ConnectGuideModifiedImmediate(
- const std::function<void(Qt3DSDMGuideHandle, SGuideInfo)> &inCallback) = 0;
-
- static std::shared_ptr<IGuideSystem> CreateGuideSystem();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMHandles.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMHandles.h
deleted file mode 100644
index 05867a14..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMHandles.h
+++ /dev/null
@@ -1,459 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_HANDLES_H
-#define QT3DSDM_HANDLES_H
-
-#include <QMetaType>
-
-namespace qt3dsdm {
-
-class IDataCore;
-
-class CDataModelHandle
-{
- int m_Handle;
-
-public:
- inline CDataModelHandle(int inHandle = 0);
- inline CDataModelHandle(const CDataModelHandle &other);
- virtual ~CDataModelHandle();
-
- // Operators
- inline CDataModelHandle &operator=(const CDataModelHandle &other);
- inline bool operator==(const CDataModelHandle &other) const;
- inline bool operator<(const CDataModelHandle &other) const;
- inline operator int() const { return GetHandleValue(); }
-
- // Use
- inline bool Valid() const { return m_Handle != 0; }
- int GetHandleValue() const { return m_Handle; }
-};
-
-inline CDataModelHandle::CDataModelHandle(int inHandle)
- : m_Handle(inHandle)
-{
-}
-inline CDataModelHandle::CDataModelHandle(const CDataModelHandle &other)
- : m_Handle(other.m_Handle)
-{
-}
-inline CDataModelHandle::~CDataModelHandle()
-{
-}
-
-inline CDataModelHandle &CDataModelHandle::operator=(const CDataModelHandle &other)
-{
- if (this != &other) {
- m_Handle = other.m_Handle;
- }
- return *this;
-}
-
-inline bool CDataModelHandle::operator==(const CDataModelHandle &other) const
-{
- return m_Handle == other.m_Handle;
-}
-
-inline bool CDataModelHandle::operator<(const CDataModelHandle &other) const
-{
- return m_Handle < other.m_Handle;
-}
-
-class Qt3DSDMInstanceHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMInstanceHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMInstanceHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMInstanceHandle(const Qt3DSDMInstanceHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMInstanceHandle &operator=(const Qt3DSDMInstanceHandle &inOther)
- {
- return static_cast<Qt3DSDMInstanceHandle &>(CDataModelHandle::operator=(inOther));
- }
-
- inline bool operator==(const Qt3DSDMInstanceHandle &other) const
- {
- return CDataModelHandle::operator==(other);
- }
-};
-
-typedef std::vector<Qt3DSDMInstanceHandle> TInstanceHandleList;
-
-class Qt3DSDMPropertyHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMPropertyHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMPropertyHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMPropertyHandle(const Qt3DSDMInstanceHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMPropertyHandle &operator=(const Qt3DSDMPropertyHandle &inOther)
- {
- return static_cast<Qt3DSDMPropertyHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMPropertyHandle> TPropertyHandleList;
-
-class Qt3DSDMSlideHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMSlideHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMSlideHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMSlideHandle(const Qt3DSDMSlideHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMSlideHandle &operator=(const Qt3DSDMSlideHandle &inOther)
- {
- return static_cast<Qt3DSDMSlideHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMSlideHandle> TSlideHandleList;
-
-class Qt3DSDMSlideGraphHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMSlideGraphHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMSlideGraphHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMSlideGraphHandle(const Qt3DSDMSlideGraphHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMSlideGraphHandle &operator=(const Qt3DSDMSlideGraphHandle &inOther)
- {
- return static_cast<Qt3DSDMSlideGraphHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMSlideGraphHandle> TSlideGraphHandleList;
-
-class Qt3DSDMAnimationHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMAnimationHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMAnimationHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMAnimationHandle(const Qt3DSDMAnimationHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMAnimationHandle &operator=(const Qt3DSDMAnimationHandle &inOther)
- {
- return static_cast<Qt3DSDMAnimationHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMAnimationHandle> TAnimationHandleList;
-
-class Qt3DSDMKeyframeHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMKeyframeHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMKeyframeHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMKeyframeHandle(const Qt3DSDMKeyframeHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMKeyframeHandle &operator=(const Qt3DSDMKeyframeHandle &inOther)
- {
- return static_cast<Qt3DSDMKeyframeHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMKeyframeHandle> TKeyframeHandleList;
-
-class Qt3DSDMActionHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMActionHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMActionHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMActionHandle(const Qt3DSDMActionHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMActionHandle &operator=(const Qt3DSDMActionHandle &inOther)
- {
- return static_cast<Qt3DSDMActionHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMActionHandle> TActionHandleList;
-
-class Qt3DSDMHandlerArgHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMHandlerArgHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMHandlerArgHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMHandlerArgHandle(const Qt3DSDMHandlerArgHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
- Qt3DSDMHandlerArgHandle &operator=(const Qt3DSDMHandlerArgHandle &inOther)
- {
- return static_cast<Qt3DSDMHandlerArgHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMHandlerArgHandle> THandlerArgHandleList;
-
-class Qt3DSDMEventHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMEventHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMEventHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMEventHandle(const Qt3DSDMEventHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMEventHandle &operator=(const Qt3DSDMEventHandle &inOther)
- {
- return static_cast<Qt3DSDMEventHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMEventHandle> TEventHandleList;
-
-class Qt3DSDMHandlerHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMHandlerHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMHandlerHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMHandlerHandle(const Qt3DSDMHandlerHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMHandlerHandle &operator=(const Qt3DSDMHandlerHandle &inOther)
- {
- return static_cast<Qt3DSDMHandlerHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMHandlerHandle> THandlerHandleList;
-
-class Qt3DSDMHandlerParamHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMHandlerParamHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMHandlerParamHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMHandlerParamHandle(const Qt3DSDMHandlerParamHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMHandlerParamHandle &operator=(const Qt3DSDMHandlerParamHandle &inOther)
- {
- return static_cast<Qt3DSDMHandlerParamHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMHandlerParamHandle> THandlerParamHandleList;
-
-class Qt3DSDMMetaDataPropertyHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMMetaDataPropertyHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMMetaDataPropertyHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMMetaDataPropertyHandle(const Qt3DSDMMetaDataPropertyHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMMetaDataPropertyHandle &operator=(const Qt3DSDMMetaDataPropertyHandle &inOther)
- {
- return static_cast<Qt3DSDMMetaDataPropertyHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMMetaDataPropertyHandle> TMetaDataPropertyHandleList;
-
-class Qt3DSDMCategoryHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMCategoryHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMCategoryHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMCategoryHandle(const Qt3DSDMCategoryHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
- Qt3DSDMCategoryHandle &operator=(const Qt3DSDMCategoryHandle &inOther)
- {
- return static_cast<Qt3DSDMCategoryHandle &>(CDataModelHandle::operator=(inOther));
- }
-};
-
-typedef std::vector<Qt3DSDMCategoryHandle> TCategoryHandleList;
-
-class Qt3DSDMGuideHandle : public CDataModelHandle
-{
-public:
- Qt3DSDMGuideHandle(int inHandle = 0)
- : CDataModelHandle(inHandle)
- {
- }
-
- Qt3DSDMGuideHandle(const CDataModelHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
-
- Qt3DSDMGuideHandle(const Qt3DSDMCategoryHandle &inOther)
- : CDataModelHandle(inOther)
- {
- }
- Qt3DSDMGuideHandle &operator=(const Qt3DSDMGuideHandle &inOther)
- {
- CDataModelHandle::operator=(inOther);
- return *this;
- }
-};
-
-typedef std::vector<Qt3DSDMGuideHandle> TGuideHandleList;
-}
-
-Q_DECLARE_METATYPE(qt3dsdm::Qt3DSDMSlideHandle);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.cpp
deleted file mode 100644
index 66f56ce8..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.cpp
+++ /dev/null
@@ -1,4170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#ifdef _WIN32
-#pragma warning(disable : 4103)
-#endif
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSDMXML.h"
-#include "foundation/Qt3DSAssert.h"
-#include "StandardExtensions.h"
-#include <unordered_map>
-#include <memory>
-#include <unordered_set>
-#include "Qt3DSDMTransactions.h"
-#include "VectorTransactions.h"
-#include "Qt3DSDMSignals.h"
-// Pull in the fancy str-type implementations
-#include "Qt3DSDMWStrOpsImpl.h"
-#include "Qt3DSDMDataCore.h"
-#include "DataCoreProducer.h"
-#include "Qt3DSDMWindowsCompatibility.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "Qt3DSRenderDynamicObjectSystemCommands.h"
-#include "foundation/StringConversionImpl.h"
-
-#include <QtCore/qdir.h>
-
-using namespace qt3dsdm;
-using std::shared_ptr;
-using std::make_shared;
-using std::static_pointer_cast;
-using std::unordered_map;
-using std::unordered_set;
-using std::function;
-using std::bind;
-using std::ref;
-using std::get;
-using qt3ds::foundation::Empty;
-
-typedef Qt3DSDMInstanceHandle TInstanceHandle;
-typedef Qt3DSDMPropertyHandle TPropertyHandle;
-typedef Qt3DSDMEventHandle TEventHandle;
-typedef Qt3DSDMHandlerHandle THandlerHandle;
-typedef Qt3DSDMHandlerArgHandle THandlerArgHandle;
-typedef Qt3DSDMMetaDataPropertyHandle TMetaDataPropertyHandle;
-typedef Qt3DSDMCategoryHandle TCategoryHandle;
-
-namespace qt3dsdm {
-#define QT3DS_WCHAR_T_None L"None"
-#define QT3DS_WCHAR_T_StringList L"StringList"
-#define QT3DS_WCHAR_T_Range L"Range"
-#define QT3DS_WCHAR_T_Image L"Image"
-#define QT3DS_WCHAR_T_Color L"Color"
-#define QT3DS_WCHAR_T_Rotation L"Rotation"
-#define QT3DS_WCHAR_T_Font L"Font"
-#define QT3DS_WCHAR_T_FontSize L"FontSize"
-#define QT3DS_WCHAR_T_MultiLine L"MultiLine"
-#define QT3DS_WCHAR_T_ObjectRef L"ObjectRef"
-#define QT3DS_WCHAR_T_Mesh L"Mesh"
-#define QT3DS_WCHAR_T_Import L"Import"
-#define QT3DS_WCHAR_T_Texture L"Texture"
-#define QT3DS_WCHAR_T_Image2D L"Image2D"
-#define QT3DS_WCHAR_T_Buffer L"Buffer"
-#define QT3DS_WCHAR_T_Property L"Property"
-#define QT3DS_WCHAR_T_Dependent L"Dependent"
-#define QT3DS_WCHAR_T_Slide L"Slide"
-#define QT3DS_WCHAR_T_Event L"Event"
-#define QT3DS_WCHAR_T_Object L"Object"
-#define QT3DS_WCHAR_T_Signal L"Signal"
-#define QT3DS_WCHAR_T_Renderable L"Renderable"
-#define QT3DS_WCHAR_T_PathBuffer L"PathBuffer"
-#define QT3DS_WCHAR_T_ShadowMapResolution L"ShadowMapResolution"
-#define QT3DS_WCHAR_T_String L"String"
-
-#define ITERATE_ADDITIONAL_META_DATA_TYPES \
- HANDLE_ADDITIONAL_META_DATA_TYPE(None) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(StringList) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Range) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Image) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Color) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Rotation) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Font) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(FontSize) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(MultiLine) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(ObjectRef) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Mesh) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Import) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Texture) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(Renderable) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(PathBuffer) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(ShadowMapResolution) \
- HANDLE_ADDITIONAL_META_DATA_TYPE(String)
-template <>
-struct WStrOps<AdditionalMetaDataType::Value>
-{
- QT3DSU32 ToStr(AdditionalMetaDataType::Value item, NVDataRef<wchar_t> buffer)
- {
- switch (item) {
-#define HANDLE_ADDITIONAL_META_DATA_TYPE(name) \
- case AdditionalMetaDataType::name: \
- wcscpy_s(buffer.begin(), buffer.size(), QT3DS_WCHAR_T_##name); \
- return 1;
- ITERATE_ADDITIONAL_META_DATA_TYPES
- #undef HANDLE_ADDITIONAL_META_DATA_TYPE
- }
- return 0;
- }
- bool StrTo(const wchar_t *buffer, AdditionalMetaDataType::Value &item)
- {
-#define HANDLE_ADDITIONAL_META_DATA_TYPE(name) \
- if (AreEqual(buffer, QT3DS_WCHAR_T_##name)) { \
- item = AdditionalMetaDataType::name; \
- return true; \
- }
- ITERATE_ADDITIONAL_META_DATA_TYPES
- #undef HANDLE_ADDITIONAL_META_DATA_TYPE
- return false;
- }
-};
-
-#undef ITERATE_ADDITIONAL_META_DATA_TYPES
-
-#define ITERATE_HANDLER_ARG_TYPES \
- HANDLE_HANDLER_ARG_TYPE(None) \
- HANDLE_HANDLER_ARG_TYPE(Property) \
- HANDLE_HANDLER_ARG_TYPE(Dependent) \
- HANDLE_HANDLER_ARG_TYPE(Slide) \
- HANDLE_HANDLER_ARG_TYPE(Event) \
- HANDLE_HANDLER_ARG_TYPE(Object) \
- HANDLE_HANDLER_ARG_TYPE(Signal)
-
-QT3DSU32 WStrOps<HandlerArgumentType::Value>::ToStr(HandlerArgumentType::Value item, NVDataRef<wchar_t> buffer)
-{
- switch (item) {
-#define HANDLE_HANDLER_ARG_TYPE(name) \
- case HandlerArgumentType::name: \
- wcscpy_s(buffer.begin(), buffer.size(), QT3DS_WCHAR_T_##name); \
- return 1;
- ITERATE_HANDLER_ARG_TYPES
- #undef HANDLE_HANDLER_ARG_TYPE
- }
- return 0;
-}
-
-bool WStrOps<HandlerArgumentType::Value>::StrTo(const wchar_t *buffer, HandlerArgumentType::Value &item)
-{
-#define HANDLE_HANDLER_ARG_TYPE(name) \
- if (AreEqual(buffer, QT3DS_WCHAR_T_##name)) { \
- item = HandlerArgumentType::name; \
- return true; \
-}
- ITERATE_HANDLER_ARG_TYPES
- #undef HANDLE_HANDLER_ARG_TYPE
- return false;
-}
-
-#define QT3DS_WCHAR_T_FloatRange L"FloatRange"
-#define QT3DS_WCHAR_T_LongRange L"LongRange"
-#define QT3DS_WCHAR_T_Vector L"Vector"
-#define QT3DS_WCHAR_T_MultiLineString L"MultiLineString"
-#define QT3DS_WCHAR_T_Boolean L"Boolean"
-#define QT3DS_WCHAR_T_Guid L"Guid"
-#define QT3DS_WCHAR_T_StringListOrInt L"StringListOrInt"
-#define QT3DS_WCHAR_T_Scale L"Scale"
-
-#define ITERATE_QT3DSDM_COMPLETE_TYPES \
- HANDLE_QT3DSDM_COMPLETE_NONE_TYPE \
- HANDLE_QT3DSDM_COMPLETE_TYPE(StringList, StringList, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(FloatRange, Range, DataModelDataType::Float) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(LongRange, Range, DataModelDataType::Long) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Float, None, DataModelDataType::Float) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Long, None, DataModelDataType::Long) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Float2, None, DataModelDataType::Float2) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Vector, None, DataModelDataType::Float3) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Scale, None, DataModelDataType::Float3) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Rotation, Rotation, DataModelDataType::Float3) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Color, Color, DataModelDataType::Float4) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Boolean, None, DataModelDataType::Bool) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Slide, None, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Font, Font, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(FontSize, FontSize, DataModelDataType::Float) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(String, String, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(MultiLineString, MultiLine, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(ObjectRef, ObjectRef, DataModelDataType::ObjectRef) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Image, Image, DataModelDataType::Long4) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Mesh, Mesh, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Import, Import, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Texture, Texture, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Image2D, Texture, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Buffer, Texture, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Guid, None, DataModelDataType::Long4) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(StringListOrInt, StringList, DataModelDataType::StringOrInt) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(Renderable, Renderable, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(PathBuffer, PathBuffer, DataModelDataType::String) \
- HANDLE_QT3DSDM_COMPLETE_TYPE(ShadowMapResolution, ShadowMapResolution, DataModelDataType::Long)
-
-DataModelDataType::Value CompleteMetaDataType::ToDataType(CompleteMetaDataType::Enum inCompleteType)
-{
- switch (inCompleteType) {
-#define HANDLE_QT3DSDM_COMPLETE_NONE_TYPE \
- case Unknown: \
- return DataModelDataType::None;
-#define HANDLE_QT3DSDM_COMPLETE_TYPE(name, addtype, dtype) \
- case name: \
- return dtype;
- ITERATE_QT3DSDM_COMPLETE_TYPES
- #undef HANDLE_QT3DSDM_COMPLETE_NONE_TYPE
- #undef HANDLE_QT3DSDM_COMPLETE_TYPE
- }
- QT3DS_ASSERT(false);
- return DataModelDataType::None;
-}
-
-AdditionalMetaDataType::Value
-CompleteMetaDataType::ToAdditionalType(CompleteMetaDataType::Enum inCompleteType)
-{
- switch (inCompleteType) {
-#define HANDLE_QT3DSDM_COMPLETE_NONE_TYPE \
- case Unknown: \
- return AdditionalMetaDataType::None;
-#define HANDLE_QT3DSDM_COMPLETE_TYPE(name, addtype, dtype) \
- case name: \
- return AdditionalMetaDataType::addtype;
- ITERATE_QT3DSDM_COMPLETE_TYPES
- #undef HANDLE_QT3DSDM_COMPLETE_NONE_TYPE
- #undef HANDLE_QT3DSDM_COMPLETE_TYPE
- }
- QT3DS_ASSERT(false);
- return AdditionalMetaDataType::None;
-}
-
-CompleteMetaDataType::Enum
-CompleteMetaDataType::ToCompleteType(DataModelDataType::Value inDataType,
- AdditionalMetaDataType::Value inAdditionalType)
-{
-#define HANDLE_QT3DSDM_COMPLETE_NONE_TYPE \
- if (inDataType == DataModelDataType::None) \
- return CompleteMetaDataType::Unknown;
-#define HANDLE_QT3DSDM_COMPLETE_TYPE(name, addtype, dtype) \
- if (inDataType == dtype \
- && inAdditionalType == AdditionalMetaDataType::addtype) \
- return CompleteMetaDataType::name;
-
- ITERATE_QT3DSDM_COMPLETE_TYPES
- #undef HANDLE_QT3DSDM_COMPLETE_NONE_TYPE
- #undef HANDLE_QT3DSDM_COMPLETE_TYPE
- QT3DS_ASSERT(false);
- return CompleteMetaDataType::Unknown;
-}
-
-QT3DSU32 WStrOps<CompleteMetaDataType::Enum>::ToStr(CompleteMetaDataType::Enum item,
- NVDataRef<wchar_t> buffer)
-{
- switch (item) {
-#define HANDLE_QT3DSDM_COMPLETE_NONE_TYPE \
- case CompleteMetaDataType::Unknown: \
- wcscpy_s(buffer.begin(), buffer.size(), L"None"); \
- return 1;
-#define HANDLE_QT3DSDM_COMPLETE_TYPE(name, addtype, dtype) \
- case CompleteMetaDataType::name: \
- wcscpy_s(buffer.begin(), buffer.size(), QT3DS_WCHAR_T_##name); \
- return 1;
-
- ITERATE_QT3DSDM_COMPLETE_TYPES
- #undef HANDLE_QT3DSDM_COMPLETE_NONE_TYPE
- #undef HANDLE_QT3DSDM_COMPLETE_TYPE
- }
- QT3DS_ASSERT(false);
- return 0;
-}
-bool WStrOps<CompleteMetaDataType::Enum>::StrTo(const wchar_t *buffer,
- CompleteMetaDataType::Enum &item)
-{
-
-#define HANDLE_QT3DSDM_COMPLETE_NONE_TYPE \
- if (AreEqual(buffer, L"None")) { \
- item = CompleteMetaDataType::Unknown; \
- return true; \
-}
-#define HANDLE_QT3DSDM_COMPLETE_TYPE(name, addtype, dtype) \
- if (AreEqual(buffer, QT3DS_WCHAR_T_##name)) { \
- item = CompleteMetaDataType::name; \
- return true; \
-}
-
- ITERATE_QT3DSDM_COMPLETE_TYPES
- #undef HANDLE_QT3DSDM_COMPLETE_NONE_TYPE
- #undef HANDLE_QT3DSDM_COMPLETE_TYPE
- return false;
-}
-}
-
-namespace {
-
-#ifndef QT3DSDM_META_DATA_NO_SIGNALS
-#define CONNECT(x) std::make_shared<qt3dsdm::QtSignalConnection>(QObject::connect(this, x, inCallback))
-#else
-#define CONNECT(x) std::shared_ptr<qt3dsdm::ISignalConnection>()
-
-struct SNullFunc
-{
- template <typename TArgType>
- void operator()(TArgType)
- {
- }
- template <typename TA1, typename TA2>
- void operator()(TA1, TA2)
- {
- }
-};
-
-#endif
-
-typedef TCharStr TStrType;
-using std::hash;
-
-struct InstanceHandleVecHash
-{
- size_t operator()(const vector<TInstanceHandle> &inInstances) const
- {
- size_t retval = 0;
- for (size_t idx = 0, end = inInstances.size(); idx < end; ++idx)
- retval = retval ^ hash<int>()(inInstances[idx]);
- return retval;
- }
-};
-
-struct SEventAndHandlerBase
-{
- Qt3DSDMInstanceHandle m_Instance;
- TStrType m_Name;
- TStrType m_FormalName;
- TStrType m_Category;
- TStrType m_Description;
- SEventAndHandlerBase() {}
- SEventAndHandlerBase(Qt3DSDMInstanceHandle hdl)
- : m_Instance(hdl)
- {
- }
-};
-
-struct SEvent : public SEventAndHandlerBase
-{
- SEvent() {}
- SEvent(Qt3DSDMInstanceHandle hdl)
- : SEventAndHandlerBase(hdl)
- {
- }
-};
-
-struct SHandler : public SEventAndHandlerBase
-{
- SHandler() {}
- SHandler(Qt3DSDMInstanceHandle hdl)
- : SEventAndHandlerBase(hdl)
- {
- }
- vector<SMetaDataHandlerArgumentInfo> m_Arguments;
-};
-
-// Note that this hash item only works for strings that are in the string table.
-// These have the property that pointer comparison also indicates string equality.
-struct SInstanceStrHash
-{
- size_t operator()(const pair<TInstanceHandle, TCharPtr> &inPair) const
- {
- return hash<int>()(inPair.first) ^ hash<const void *>()(inPair.second);
- }
-};
-
-template <typename TDataType>
-NVConstDataRef<TDataType> VecToCRef(const eastl::vector<TDataType> &inType)
-{
- return NVConstDataRef<TDataType>(inType.data(), (QT3DSU32)inType.size());
-}
-
-struct SMetaDataDynamicObjectImpl
-{
-private:
- SMetaDataDynamicObjectImpl &operator=(const SMetaDataDynamicObjectImpl &inOther);
-
-public:
- TCharStr m_Name;
- TCharStr m_SourcePath;
- eastl::vector<SMetaDataShader> m_Shaders;
- eastl::vector<qt3ds::render::dynamic::SPropertyDefinition> m_Properties;
- eastl::vector<eastl::vector<qt3ds::foundation::CRegisteredString> *> m_EnumValueNames;
- ~SMetaDataDynamicObjectImpl() { ClearEnumValueNames(); }
-
- void ClearEnumValueNames()
- {
- for (QT3DSU32 idx = 0, end = m_EnumValueNames.size(); idx < end; ++idx)
- delete (m_EnumValueNames[idx]);
- m_EnumValueNames.clear();
- }
-};
-
-struct SMetaDataEffectImpl : public SMetaDataDynamicObjectImpl
-{
-private:
- SMetaDataEffectImpl &operator=(const SMetaDataEffectImpl &inOther);
-
-public:
- eastl::vector<qt3ds::render::dynamic::SCommand *> m_EffectCommands;
-
- void ClearEffectCommands()
- {
- for (QT3DSU32 idx = 0, end = m_EnumValueNames.size(); idx < end; ++idx)
- free(m_EffectCommands[idx]);
- m_EffectCommands.clear();
- }
- SMetaDataEffect ToEffect() const
- {
- return SMetaDataEffect(m_Name, VecToCRef(m_Shaders), VecToCRef(m_Properties),
- VecToCRef(m_EffectCommands));
- }
-};
-
-struct SMetaDataCustomMaterialImpl : public SMetaDataDynamicObjectImpl
-{
-private:
- SMetaDataCustomMaterialImpl &operator=(const SMetaDataCustomMaterialImpl &);
-
-public:
- eastl::vector<qt3ds::render::dynamic::SCommand *>
- m_CustomerMaterialCommands; ///< our command stream used for rendering
- bool m_HasTransparency; ///< this material is transparent
- bool m_HasRefraction; ///< this material is refractive (e.g glass)
- bool m_AlwaysDirty;
- QT3DSU32 m_ShaderKey; ///< What does this shader contain ( e.g. specular, diffuse, ...)
- QT3DSU32 m_LayerCount; ///< How much layers does this material have
-
- void ClearEffectCommands()
- {
- for (QT3DSU32 idx = 0, end = m_EnumValueNames.size(); idx < end; ++idx) {
- free(m_CustomerMaterialCommands[idx]);
- }
-
- m_CustomerMaterialCommands.clear();
- }
-
- SMetaDataCustomMaterial ToMaterial() const
- {
- return SMetaDataCustomMaterial(m_Name, VecToCRef(m_Shaders), VecToCRef(m_Properties),
- VecToCRef(m_CustomerMaterialCommands), m_HasTransparency,
- m_HasRefraction, m_AlwaysDirty, m_ShaderKey, m_LayerCount);
- }
-};
-
-#ifndef QT3DSDM_META_DATA_NO_SIGNALS
-class SNewMetaDataImpl : public QObject, public IMetaData
-{
- Q_OBJECT
-#else
-class SNewMetaDataImpl : public IMetaData
-{
-#endif
-public:
- typedef unordered_map<TCharPtr, TInstanceHandle> TStrInstanceMap;
- typedef unordered_map<TInstanceHandle, TCharPtr, hash<int>> TInstanceStrMap;
- // Caching the derivation chain lookup so we can quickly lookup the entire list of
- // derived instances (and have it ordered, somewhat).
- typedef unordered_map<vector<TInstanceHandle>, vector<TInstanceHandle>, InstanceHandleVecHash>
- TDerivationMap;
-
- typedef unordered_map<TCategoryHandle, SCategoryInfo, hash<int>> TCategoryMap;
- typedef unordered_map<TCharPtr, TCategoryHandle> TNameCategoryMap;
-
- typedef unordered_map<TMetaDataPropertyHandle, SMetaDataPropertyInfo, hash<int>>
- TMetaDataPropertyMap;
- typedef unordered_map<TInstanceHandle, vector<TMetaDataPropertyHandle>, hash<int>>
- TInstancePropertyMap;
- typedef unordered_map<pair<TInstanceHandle, TCharPtr>, TMetaDataPropertyHandle,
- SInstanceStrHash>
- TInstancePropertyNamePropertyMap;
- typedef unordered_map<TMetaDataPropertyHandle, eastl::vector<SPropertyFilterInfo>, hash<int>>
- TMetaDataPropertyFilterMap;
- typedef unordered_map<TInstanceHandle, vector<TCharPtr>, hash<int>> TInstanceGroupMap;
-
- typedef unordered_map<TEventHandle, SEvent, hash<int>> TEventMap;
- typedef unordered_map<TInstanceHandle, vector<TEventHandle>, hash<int>> TInstanceEventMap;
- typedef unordered_map<pair<TInstanceHandle, TCharPtr>, TEventHandle, SInstanceStrHash>
- TInstanceEventNameEventMap;
-
- typedef unordered_map<THandlerHandle, SHandler, hash<int>> THandlerMap;
- typedef unordered_map<TInstanceHandle, vector<THandlerHandle>, hash<int>> TInstanceHandlerMap;
- typedef unordered_map<pair<TInstanceHandle, TCharPtr>, THandlerHandle, SInstanceStrHash>
- TInstanceHandlerNameHandlerMap;
-
- typedef unordered_map<TInstanceHandle, vector<TCharPtr>, hash<int>> TInstanceStringListMap;
- typedef unordered_map<TCharPtr, SMetaDataEffectImpl> TEffectMap;
- typedef unordered_map<TCharPtr, SMetaDataCustomMaterialImpl> TCustomMaterialMap;
-
- std::shared_ptr<IDataCore> m_DataCore;
- IStringTable &m_StringTable;
- TTransactionConsumerPtr m_Consumer;
-
- int m_NextId;
-
- // Helper objects to speed up queries
- TStrInstanceMap m_CanonicalTypeToInstances;
- TInstanceStrMap m_InstancesToCanonicalType;
- TDerivationMap m_DerivationMap;
-
- TCategoryMap m_Categories;
- TNameCategoryMap m_NameToCategories;
-
- TMetaDataPropertyMap m_Properties;
- TInstancePropertyMap m_InstanceToProperties;
- TInstancePropertyNamePropertyMap m_InstanceNameToProperties;
- TMetaDataPropertyFilterMap m_PropertyFilters;
- TInstanceGroupMap m_InstanceGroupMap;
-
- TEventMap m_Events;
- TInstanceEventMap m_InstanceToEvents;
- TInstanceEventNameEventMap m_InstanceNameToEvents;
-
- THandlerMap m_Handlers;
- TInstanceHandlerMap m_InstanceToHandlers;
- TInstanceHandlerNameHandlerMap m_InstanceNameToHandlers;
-
- TInstanceStringListMap m_InstanceToReferences;
-
- vector<TInstanceHandle> m_Parents;
- vector<TInstanceHandle> m_NextParents;
- vector<TInstanceHandle> m_DerivationChain;
- unordered_set<int> m_UniqueSet;
- unordered_set<size_t> m_SizeTSet;
-
- MemoryBuffer<RawAllocator> m_TempBuffer;
- MemoryBuffer<RawAllocator> m_ReadBuffer;
-
- eastl::string m_ConvertStr;
-
- TCharStr m_ObjectName;
-
- TEffectMap m_EffectMap;
- TCustomMaterialMap m_CustomMaterials;
-
-#ifndef QT3DSDM_META_DATA_NO_SIGNALS
-Q_SIGNALS:
- void internalCategoryDestroyed(Qt3DSDMCategoryHandle);
- void internalMetaDataPropertyDestroyed(Qt3DSDMMetaDataPropertyHandle);
- void internalEventDestroyed(Qt3DSDMEventHandle);
- void internalHandlerDestroyed(Qt3DSDMHandlerHandle);
- void internalHandlerArgDestroyed(Qt3DSDMHandlerHandle, QT3DSU32);
-#else
- SNullFunc internalCategoryDestroyed;
- SNullFunc internalMetaDataPropertyDestroyed;
- SNullFunc internalEventDestroyed;
- SNullFunc internalHandlerDestroyed;
- SNullFunc internalHandlerArgDestroyed;
-#endif
-public:
- TSignalConnectionPtr m_PropertyDeletedConnection;
- bool m_IgnorePropertyDeleted;
- TSignalConnectionPtr m_InstanceDeletedConnection;
-
- SNewMetaDataImpl(std::shared_ptr<IDataCore> inDataCore)
- : m_DataCore(inDataCore)
- , m_StringTable(inDataCore->GetStringTable())
- , m_NextId(1)
- , m_IgnorePropertyDeleted(false)
- {
-#ifndef QT3DSDM_META_DATA_NO_SIGNALS
- CDataCoreProducer *producer = dynamic_cast<CDataCoreProducer *>(inDataCore.get());
- if (producer) {
- m_PropertyDeletedConnection = producer->ConnectPropertyRemoved(
- bind(&SNewMetaDataImpl::OnPropertyRemoved, this,
- std::placeholders::_1, std::placeholders::_2));
- m_InstanceDeletedConnection = producer->ConnectBeforeInstanceDeleted(
- bind(&SNewMetaDataImpl::OnInstanceRemoved, this,
- std::placeholders::_1));
- }
-#endif
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Helper Functions
-
- const wchar_t *Intern(TStrType inData) { return m_StringTable.RegisterStr(inData.wide_str()); }
- const wchar_t *Intern(const char *inData) { return m_StringTable.GetWideStr(inData); }
-
- inline int GetNextId()
- {
- int retval = m_NextId;
- ++m_NextId;
- return retval;
- }
-
- template <typename TMapType, typename THandleType>
- static void AddItemToInstanceList(TInstanceHandle inInstance, THandleType inHandle, QT3DSU32 inIdx,
- TMapType &ioMap)
- {
- pair<typename TMapType::iterator, bool> inserter =
- ioMap.insert(make_pair(inInstance, vector<THandleType>()));
- inserter.first->second.insert(inserter.first->second.begin() + inIdx, inHandle);
- }
-
- template <typename TMapType, typename THandleType>
- static QT3DSU32 AddItemToInstanceList(TInstanceHandle inInstance, THandleType inHandle,
- TMapType &ioMap)
- {
- pair<typename TMapType::iterator, bool> inserter =
- ioMap.insert(make_pair(inInstance, vector<THandleType>()));
- QT3DSU32 offset = (QT3DSU32)inserter.first->second.size();
- inserter.first->second.push_back(inHandle);
- return offset;
- }
-
- template <typename TItemType>
- struct VectorEqualPred
- {
- TItemType m_Item;
- VectorEqualPred(const TItemType &inItem)
- : m_Item(inItem)
- {
- }
-
- bool operator()(const TItemType &inOther) const { return m_Item == inOther; }
- };
-
- template <typename THandleType, typename TMapType>
- static QT3DSU32 DoRemoveItemFromInstanceList(TInstanceHandle inInstance, THandleType inHandle,
- TMapType &ioMap)
- {
- typename TMapType::iterator find = ioMap.find(inInstance);
- if (find != ioMap.end()) {
- typename vector<THandleType>::iterator theVecFind =
- std::find(find->second.begin(), find->second.end(), inHandle);
- if (theVecFind != find->second.end()) {
- QT3DSU32 retval = (QT3DSU32)(theVecFind - find->second.begin());
- find->second.erase(theVecFind);
- if (find->second.empty())
- ioMap.erase(find);
- return retval;
- }
- }
- QT3DS_ASSERT(false);
- return QT3DS_MAX_U32;
- }
-
- template <typename TMapType, typename THandleType>
- struct InstanceListTransaction : ITransaction
- {
- TInstanceHandle m_Instance;
- THandleType m_Handle;
- TMapType &m_Map;
- QT3DSU32 m_Idx;
- bool m_InsertOnDo;
-
- InstanceListTransaction(const char *inFile, int inLine, TInstanceHandle inst,
- THandleType handle, TMapType &map, QT3DSU32 inIdx, bool inInsertOnDo)
- : ITransaction(inFile, inLine)
- , m_Instance(inst)
- , m_Handle(handle)
- , m_Map(map)
- , m_Idx(inIdx)
- , m_InsertOnDo(inInsertOnDo)
- {
- }
-
- void insert()
- {
- SNewMetaDataImpl::AddItemToInstanceList(m_Instance, m_Handle, m_Idx, m_Map);
- }
- void remove()
- {
- SNewMetaDataImpl::DoRemoveItemFromInstanceList(m_Instance, m_Handle, m_Map);
- }
-
- void Do() override
- {
- if (m_InsertOnDo)
- insert();
- else
- remove();
- }
- void Undo() override
- {
- if (m_InsertOnDo)
- remove();
- else
- insert();
- }
- };
-
- template <typename THandleType, typename TMapType>
- void RemoveItemFromInstanceList(const char *inFile, int inLine, TInstanceHandle inInstance,
- THandleType inHandle, TMapType &ioMap)
- {
- typename TMapType::iterator find = ioMap.find(inInstance);
- if (find != ioMap.end()) {
- QT3DSU32 idx = DoRemoveItemFromInstanceList(inInstance, inHandle, ioMap);
- if (m_Consumer != NULL) {
- m_Consumer->OnTransaction(
- std::make_shared<InstanceListTransaction<TMapType, THandleType>>(
- inFile, inLine, inInstance, inHandle, std::ref(ioMap), idx, false));
- }
- }
- }
-
- template <typename THandleType, typename TValueType, typename TMapType,
- typename TInstanceListMapType>
- THandleType CreateItem(const char *inFile, int inLine, Qt3DSDMInstanceHandle inInstance,
- TMapType &inMap, TInstanceListMapType &inInstanceListMap)
- {
- int retval = GetNextId();
- pair<THandleType, TValueType> thePair(make_pair(retval, TValueType(inInstance)));
- inMap.insert(thePair);
- QT3DSU32 idx = AddItemToInstanceList(inInstance, THandleType(retval), inInstanceListMap);
- if (m_Consumer) {
- CreateHashMapInsertTransaction(inFile, inLine, m_Consumer, thePair, inMap);
- m_Consumer->OnTransaction(
- std::make_shared<InstanceListTransaction<TInstanceListMapType, THandleType>>(
- inFile, inLine, inInstance, retval, std::ref(inInstanceListMap), idx, true));
- }
- return retval;
- }
-
- template <typename TKeyType, typename TValueType, typename THashType>
- TValueType *FindHashItem(TKeyType inHandle,
- unordered_map<TKeyType, TValueType, THashType> &ioHash)
- {
- typename unordered_map<TKeyType, TValueType, THashType>::iterator find =
- ioHash.find(inHandle);
- if (find != ioHash.end())
- return &find->second;
- return NULL;
- }
-
- template <typename THandleType, typename TMapType>
- static void DoReplaceNamedItem(TInstanceHandle inInst, TCharPtr inOldName, TCharPtr inNewName,
- THandleType inNewHandle, TMapType &ioMap)
- {
- ioMap.erase(make_pair(inInst, inOldName));
- bool success = ioMap.insert(make_pair(make_pair(inInst, inNewName), inNewHandle)).second;
- (void)success;
- QT3DS_ASSERT(success);
- }
-
- template <typename TMapType, typename THandleType>
- struct ReplaceNamedItemTransaction : ITransaction
- {
- TInstanceHandle m_Instance;
- TCharPtr m_OldName;
- TCharPtr m_NewName;
- THandleType m_OldHandle;
- THandleType m_NewHandle;
- TMapType &m_Map;
- ReplaceNamedItemTransaction(const char *inFile, int inLine, TInstanceHandle inst,
- TCharPtr oldNm, TCharPtr newNm, THandleType oldHdl,
- THandleType newHdl, TMapType &map)
- : ITransaction(inFile, inLine)
- , m_Instance(inst)
- , m_OldName(oldNm)
- , m_NewName(newNm)
- , m_OldHandle(oldHdl)
- , m_NewHandle(newHdl)
- , m_Map(map)
- {
- }
- void Do() override
- {
- SNewMetaDataImpl::DoReplaceNamedItem(m_Instance, m_OldName, m_NewName, m_NewHandle,
- m_Map);
- }
- void Undo() override
- {
- SNewMetaDataImpl::DoReplaceNamedItem(m_Instance, m_NewName, m_OldName, m_OldHandle,
- m_Map);
- }
- };
-
- template <typename THandleType, typename TMapType>
- void ReplaceNamedItem(const char *inFile, int inLine, TInstanceHandle inInst,
- TCharPtr inOldName, TCharPtr inNewName, THandleType inNewHandle,
- TMapType &ioMap)
- {
- typename TMapType::iterator find = ioMap.find(std::make_pair(inInst, inOldName));
- THandleType oldHandle;
- if (find != ioMap.end())
- oldHandle = find->second;
- DoReplaceNamedItem(inInst, inOldName, inNewName, inNewHandle, ioMap);
- if (m_Consumer) {
- if (oldHandle.Valid()) {
- m_Consumer->OnTransaction(
- std::make_shared<ReplaceNamedItemTransaction<TMapType, THandleType>>(
- inFile, inLine, inInst, inOldName, inNewName, oldHandle, inNewHandle,
- std::ref(ioMap)));
- } else
- CreateHashMapInsertTransaction(__FILE__, __LINE__, m_Consumer,
- make_pair(make_pair(inInst, inNewName), inNewHandle),
- ioMap);
- }
- }
-
- template <typename THandleType, typename TMapType>
- void DestroyNamedItem(const char *inFile, int inLine, TInstanceHandle inInst, TCharPtr inName,
- TMapType &ioMap)
- {
- typename TMapType::iterator iter = ioMap.find(make_pair(inInst, inName));
- if (iter != ioMap.end()) {
- pair<pair<TInstanceHandle, TCharPtr>, THandleType> existing(*iter);
- ioMap.erase(iter);
- CreateHashMapEraseTransaction(inFile, inLine, m_Consumer, existing, ioMap);
- }
- }
-
- template <typename THandleType, typename TInfoType, typename TMapType, typename TNamedMapType>
- void SetItemInfo(const char *inFile, int inLine, THandleType inItem, const TInfoType &oldInfo,
- const TInfoType &newInfo, TMapType &inMap, TNamedMapType &inNamedMap)
- {
- TCharPtr newName = Intern(newInfo.m_Name.wide_str());
- TCharPtr oldName = Intern(oldInfo.m_Name.wide_str());
- ReplaceNamedItem(inFile, inLine, newInfo.m_Instance, oldName, newName, inItem, inNamedMap);
- CreateHashMapSwapTransaction(inFile, inLine, m_Consumer, inItem, oldInfo, newInfo, inMap);
- }
-
- bool AddDerivationChainItem(TInstanceHandle inInst)
- {
- if (m_UniqueSet.find(inInst) == m_UniqueSet.end()) {
- m_DerivationChain.push_back(inInst);
- m_UniqueSet.insert(inInst);
- return true;
- }
- return false;
- }
-
- void GetDerivationChain(TInstanceHandle inInst)
- {
- m_Parents.clear();
- m_DerivationChain.clear();
- m_UniqueSet.clear();
- m_NextParents.clear();
- m_DataCore->GetInstanceParents(inInst, m_Parents);
-
- TDerivationMap::iterator mapIter = m_DerivationMap.find(m_Parents);
- if (mapIter != m_DerivationMap.end())
- m_DerivationChain = mapIter->second;
- else {
- while (m_Parents.empty() == false) {
- for (size_t idx = 0, end = m_Parents.size(); idx < end; ++idx) {
- if (AddDerivationChainItem(m_Parents[idx]))
- m_DataCore->GetInstanceParents(m_Parents[idx], m_NextParents);
- }
- m_Parents = m_NextParents;
- m_NextParents.clear();
- }
- m_NextParents.clear();
-
- m_DataCore->GetInstanceParents(inInst, m_NextParents);
- m_DerivationMap.insert(make_pair(m_NextParents, m_DerivationChain));
- }
- }
-
- template <typename THandleType, typename TMapType>
- THandleType FindItemByName(TInstanceHandle inInst, TCharPtr inName, TMapType &ioMap)
- {
- typename TMapType::iterator find(ioMap.find(make_pair(inInst, inName)));
- if (find != ioMap.end())
- return find->second;
-
- GetDerivationChain(inInst);
- for (size_t idx = 0, end = m_DerivationChain.size(); idx < end; ++idx) {
- find = ioMap.find(make_pair(m_DerivationChain[idx], inName));
- if (find != ioMap.end())
- return find->second;
- }
- return 0;
- }
-
- template <typename TItemType, typename TVectorType>
- void AddListMapItems(const std::vector<TItemType> &inMapEntry, TVectorType &outVector)
- {
- typedef typename std::vector<TItemType>::const_iterator TIterType;
- for (TIterType theIter = inMapEntry.begin(), theEnd = inMapEntry.end(); theIter != theEnd;
- ++theIter)
- outVector.push_back(*theIter);
- }
-
- template <typename TListMapType, typename TSizeTOpType, typename TVectorType>
- void DoGetHandleList(Qt3DSDMInstanceHandle inInstance, TListMapType &inMap,
- TVectorType &outHandles, TSizeTOpType inOperator)
- {
- typename TListMapType::iterator find;
- GetDerivationChain(inInstance);
- for (size_t idx = 0, end = m_DerivationChain.size(); idx < end; ++idx) {
- // Add base classes to the list first
- find = inMap.find(m_DerivationChain[end - idx - 1]);
- if (find != inMap.end())
- AddListMapItems(find->second, outHandles);
- }
- find = inMap.find(inInstance);
- if (find != inMap.end())
- AddListMapItems(find->second, outHandles);
- m_SizeTSet.clear();
- for (size_t ridx = 0; ridx < outHandles.size(); ++ridx) {
- size_t idx = outHandles.size() - ridx - 1;
- // Run through the list backwards, making sure that items further in the list
- // completely overshadow items earlier in the list.
-
- // Create unique key from the item that we can check against
- size_t item = inOperator(outHandles[idx]);
- if (m_SizeTSet.insert(item).second == false) {
- outHandles.erase(outHandles.begin() + idx);
- --ridx;
- }
- }
- }
-
- template <typename THandleType, typename TMapType>
- struct NameSizeTOpType
- {
- SNewMetaDataImpl &m_Impl;
- TMapType &m_Map;
- NameSizeTOpType(SNewMetaDataImpl &inImpl, TMapType &inMap)
- : m_Impl(inImpl)
- , m_Map(inMap)
- {
- }
-
- size_t operator()(THandleType inHandle)
- {
- return reinterpret_cast<size_t>(m_Impl.Intern(m_Map[inHandle].m_Name));
- }
- };
-
- // Ensure we don't return two items of the same name.
- template <typename THandleType, typename TListMapType, typename TMapType>
- void GetHandleList(Qt3DSDMInstanceHandle inInstance, TListMapType &inMap, TMapType &inTypeName,
- vector<THandleType> &outHandles)
- {
- DoGetHandleList(inInstance, inMap, outHandles,
- NameSizeTOpType<THandleType, TMapType>(*this, inTypeName));
- }
-
- template <typename THandleType, typename TMapType, typename TNameMapType,
- typename TListMapType>
- bool DestroyItem(const char *inFile, int inLine, THandleType inItem,
- TMapType &inMap, TNameMapType &inNameMap, TListMapType &inListMap)
- {
- typename TMapType::iterator find(inMap.find(inItem));
- if (find == inMap.end())
- return false;
- DestroyNamedItem<THandleType>(inFile, inLine, find->second.m_Instance,
- Intern(find->second.m_Name.wide_str()), inNameMap);
- RemoveItemFromInstanceList(inFile, inLine, find->second.m_Instance, inItem, inListMap);
- CreateHashMapEraseTransaction(inFile, inLine, m_Consumer,
- make_pair(find->first, find->second), inMap);
- inMap.erase(find);
- return true;
- }
-
- template <typename THandleType, typename TListMapType>
- void ForEachItem(Qt3DSDMInstanceHandle inInstance, TListMapType &ioMap,
- function<void(THandleType)> inOperation)
- {
- typename TListMapType::iterator find = ioMap.find(inInstance);
- if (find != ioMap.end()) {
- vector<THandleType> itemData(find->second);
- for (size_t idx = 0, end = itemData.size(); idx < end; ++idx)
- inOperation(itemData[idx]);
- }
- }
-
- SCategoryInfo *FindCategory(Qt3DSDMCategoryHandle inCategory)
- {
- return FindHashItem(inCategory, m_Categories);
- }
-
- SMetaDataPropertyInfo *FindProperty(Qt3DSDMMetaDataPropertyHandle inPropertyHandle)
- {
- return FindHashItem(inPropertyHandle, m_Properties);
- }
-
- SEvent *FindEvent(Qt3DSDMEventHandle inEventHandle)
- {
- return FindHashItem(inEventHandle, m_Events);
- }
-
- SHandler *FindHandler(Qt3DSDMHandlerHandle inHandle)
- {
- return FindHashItem(inHandle, m_Handlers);
- }
-
- SMetaDataHandlerArgumentInfo *FindHandlerArg(Qt3DSDMHandlerHandle inHandler, QT3DSU32 inIdx)
- {
- SHandler *theHandler(FindHandler(inHandler));
- if (theHandler && theHandler->m_Arguments.size() > inIdx)
- return &theHandler->m_Arguments[inIdx];
- return NULL;
- }
-
- void OnPropertyRemoved(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty)
- {
- if (m_IgnorePropertyDeleted)
- return;
-
- vector<Qt3DSDMMetaDataPropertyHandle> propertiesToDestroy;
- for (TMetaDataPropertyMap::iterator iter = m_Properties.begin(), end = m_Properties.end();
- iter != end; ++iter) {
- if (iter->second.m_Property == inProperty)
- propertiesToDestroy.push_back(iter->first);
- }
-
- for (size_t idx = 0, end = propertiesToDestroy.size(); idx < end; ++idx)
- DestroyMetaDataProperty(propertiesToDestroy[idx]);
- }
-
- void OnInstanceRemoved(Qt3DSDMInstanceHandle inInstance) { DestroyMetaData(inInstance); }
- template <typename TEntryType, typename TMapType>
- void InsertWithTransaction(const char *inFile, int inLine, const TEntryType &inEntry,
- TMapType &inMap)
- {
- inMap.insert(inEntry);
- CreateHashMapInsertTransaction(inFile, inLine, m_Consumer, inEntry, inMap);
- }
-
- template <typename TKeyType, typename TMapType>
- void EraseWithTransaction(const char *inFile, int inLine, TKeyType inKey, TMapType &inMap)
- {
- typename TMapType::iterator find(inMap.find(inKey));
- if (find != inMap.end()) {
- CreateHashMapEraseTransaction(inFile, inLine, m_Consumer,
- std::make_pair(find->first, find->second), inMap);
- inMap.erase(find);
- }
- }
-
- template <typename TEntryType, typename TMapType>
- void InsertOrUpdateWithTransaction(const TEntryType &inEntry, TMapType &inMap)
- {
- pair<typename TMapType::iterator, bool> inserter = inMap.insert(inEntry);
- if (inserter.second)
- CreateHashMapInsertTransaction(__FILE__, __LINE__, m_Consumer, inEntry, inMap);
- else {
- typename TMapType::iterator theIter(inserter.first);
- CreateHashMapSwapTransaction(__FILE__, __LINE__, m_Consumer, theIter->first,
- theIter->second, inEntry.second, inMap);
- theIter->second = inEntry.second;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // API Implementation
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Sharing some utility objects
- IStringTable &GetStringTable() override { return m_DataCore->GetStringTable(); }
- TStringTablePtr GetStringTablePtr() override { return m_DataCore->GetStringTablePtr(); }
- TDataCorePtr GetDataCore() override { return m_DataCore; }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Canonical Instances
- void SetInstanceAsCanonical(Qt3DSDMInstanceHandle inInstance, TStrType inTypename) override
- {
- const wchar_t *theTypename(Intern(inTypename));
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger("IMetaData::SetInstanceAsCanonical Enter");
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger(GetStringTable().GetNarrowStr(inTypename.wide_str()));
- m_CanonicalTypeToInstances.insert(make_pair(theTypename, inInstance));
- m_InstancesToCanonicalType.insert(make_pair(inInstance, theTypename));
- CreateHashMapInsertTransaction(__FILE__, __LINE__, m_Consumer,
- make_pair(theTypename, inInstance),
- m_CanonicalTypeToInstances);
- CreateHashMapInsertTransaction(__FILE__, __LINE__, m_Consumer,
- make_pair(inInstance, theTypename),
- m_InstancesToCanonicalType);
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger("IMetaData::SetInstanceAsCanonical Leave");
- }
-
- Qt3DSDMInstanceHandle GetCanonicalInstanceForType(TStrType inTypename) override
- {
- TStrInstanceMap::iterator find = m_CanonicalTypeToInstances.find(Intern(inTypename));
- if (find != m_CanonicalTypeToInstances.end())
- return find->second;
- return 0;
- }
-
- Option<TCharStr> GetTypeForCanonicalInstance(Qt3DSDMInstanceHandle inInstance) override
- {
- TInstanceStrMap::iterator find = m_InstancesToCanonicalType.find(inInstance);
- if (find != m_InstancesToCanonicalType.end())
- return TCharStr(find->second);
- return Empty();
- }
-
- Option<TCharStr> GetTypeForInstance(Qt3DSDMInstanceHandle inInstance) override
- {
- Option<TCharStr> theType = GetTypeForCanonicalInstance(inInstance);
- if (theType.hasValue())
- return theType;
- GetDerivationChain(inInstance);
- for (size_t idx = 0, end = m_DerivationChain.size(); idx < end; ++idx) {
- theType = GetTypeForCanonicalInstance(m_DerivationChain[idx]);
- if (theType.hasValue())
- return theType;
- }
- return Empty();
- }
-
- QT3DSU32 GetGroupCountForInstance(Qt3DSDMInstanceHandle inInstance) override
- {
- std::vector<TCharStr> outNames;
- QT3DSU32 count = GetGroupNamesForInstance(inInstance, outNames);
- return (count == 0) ? 1 : count;
- }
-
- QT3DSU32 GetGroupNamesForInstance(Qt3DSDMInstanceHandle inInstance,
- std::vector<TCharStr> &outNames) override
- {
- TInstanceStrMap::iterator canonicalFind = m_InstancesToCanonicalType.find(inInstance);
- if (canonicalFind != m_InstancesToCanonicalType.end()) {
- TInstanceGroupMap::iterator find = m_InstanceGroupMap.find(inInstance);
- if (find != m_InstanceGroupMap.end()) {
- pair<typename TInstanceGroupMap::iterator, bool> inserter =
- m_InstanceGroupMap.insert(make_pair(inInstance, vector<TCharPtr>()));
- vector<TCharPtr> &itemList = inserter.first->second;
- for (size_t i = 0, j = itemList.size(); i < j; ++i) {
- bool alreadyInList = false;
- // discard duplicates
- for (size_t k = 0, l = outNames.size(); k < l; ++k) {
- TCharStr curListName = itemList[i];
- if (curListName == outNames[k].wide_str()) {
- alreadyInList = true;
- break;
- }
- }
- if (!alreadyInList)
- outNames.push_back(itemList[i]);
- }
- }
- return (QT3DSU32)outNames.size();
- }
-
- GetDerivationChain(inInstance);
-
- for (int idx = (int)m_DerivationChain.size() - 1, end = 0; idx >= end; --idx) {
- TInstanceGroupMap::iterator find = m_InstanceGroupMap.find(m_DerivationChain[idx]);
- if (find != m_InstanceGroupMap.end()) {
- pair<typename TInstanceGroupMap::iterator, bool> inserter =
- m_InstanceGroupMap.insert(
- make_pair(m_DerivationChain[idx], vector<TCharPtr>()));
- vector<TCharPtr> &itemList = inserter.first->second;
- for (size_t i = 0, j = itemList.size(); i < j; ++i) {
- bool alreadyInList = false;
- // discard duplicates
- for (size_t k = 0, l = outNames.size(); k < l; ++k) {
- TCharStr curListName = itemList[i];
- if (curListName == outNames[k].wide_str()) {
- alreadyInList = true;
- break;
- }
- }
- if (!alreadyInList)
- outNames.push_back(itemList[i]);
- }
- }
- }
-
- return (QT3DSU32)outNames.size();
- }
-
- Option<TCharStr> GetGroupFilterNameForInstance(Qt3DSDMInstanceHandle inInstance,
- long inIndex) override
- {
- std::vector<TCharStr> outNames;
- QT3DSU32 count = GetGroupNamesForInstance(inInstance, outNames);
- if (count > (QT3DSU32)inIndex)
- return outNames[inIndex];
-
- return Empty();
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Categories
-
- std::pair<Qt3DSDMCategoryHandle, bool> GetOrCreateCategory(TStrType inName) override
- {
- TCharPtr theName(Intern(inName));
- TNameCategoryMap::iterator find = m_NameToCategories.find(theName);
- if (find != m_NameToCategories.end())
- return make_pair(find->second, false);
-
- TCategoryHandle retval(GetNextId());
- InsertWithTransaction(__FILE__, __LINE__, make_pair(retval, SCategoryInfo(inName)),
- m_Categories);
- InsertWithTransaction(__FILE__, __LINE__, make_pair(theName, retval), m_NameToCategories);
- return make_pair(retval, true);
- }
-
- void SetCategoryInfo(Qt3DSDMCategoryHandle inCategory, TStrType inIcon,
- TStrType inHighlight, TStrType inDescription) override
- {
- SCategoryInfo *infoPtr(FindCategory(inCategory));
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SCategoryInfo &newInfo(*infoPtr);
- SCategoryInfo oldInfo(newInfo);
-
- newInfo.m_Icon = inIcon;
- newInfo.m_HighlightIcon = inHighlight;
- newInfo.m_Description = inDescription;
- CreateHashMapSwapTransaction(__FILE__, __LINE__, m_Consumer, inCategory, oldInfo, newInfo,
- m_Categories);
- }
-
- void DestroyCategory(Qt3DSDMCategoryHandle inCategory) override
- {
- SCategoryInfo *infoPtr(FindCategory(inCategory));
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- EraseWithTransaction(__FILE__, __LINE__, Intern(infoPtr->m_Name), m_NameToCategories);
- EraseWithTransaction(__FILE__, __LINE__, inCategory, m_Categories);
- }
- Option<SCategoryInfo> GetCategoryInfo(Qt3DSDMCategoryHandle inCategory) override
- {
- SCategoryInfo *infoPtr(FindCategory(inCategory));
- if (infoPtr)
- return *infoPtr;
- return Empty();
- }
- Qt3DSDMCategoryHandle FindCategoryByName(TStrType inName) override
- {
- TCharPtr theName(Intern(inName));
- TNameCategoryMap::iterator find = m_NameToCategories.find(theName);
- if (find != m_NameToCategories.end())
- return find->second;
- return 0;
- }
-
- void GetCategories(vector<Qt3DSDMCategoryHandle> &outCategories) override
- {
- for (TCategoryMap::iterator iter = m_Categories.begin(), end = m_Categories.end();
- iter != end; ++iter)
- outCategories.push_back(iter->first);
- }
-
- Option<SCategoryInfo> GetEventCategory(TStrType inName) override
- {
- return GetCategoryInfo(FindCategoryByName(inName));
- }
-
- Option<SCategoryInfo> GetHandlerCategory(TStrType inName) override
- {
- return GetCategoryInfo(FindCategoryByName(inName));
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Properties
-
- Qt3DSDMMetaDataPropertyHandle CreateMetaDataProperty(Qt3DSDMInstanceHandle inInstance) override
- {
- return CreateItem<Qt3DSDMMetaDataPropertyHandle, SMetaDataPropertyInfo>(
- __FILE__, __LINE__, inInstance, m_Properties, m_InstanceToProperties);
- }
-
- void EnsureDataCoreProperty(SMetaDataPropertyInfo &newInfo)
- {
- m_IgnorePropertyDeleted = true;
- // If the existing property under the new name doesn't match
- // the new info, then we also have to delete the property
- Qt3DSDMPropertyHandle theExistingProperty =
- m_DataCore->GetAggregateInstancePropertyByName(newInfo.m_Instance, newInfo.m_Name);
- // Ensure the types match.
- if (theExistingProperty.Valid()) {
- Qt3DSDMPropertyDefinition theDefinition(m_DataCore->GetProperty(theExistingProperty));
- if (theDefinition.m_Name != newInfo.m_Name
- || theDefinition.m_Type != newInfo.GetDataType()) {
- m_DataCore->RemoveProperty(theExistingProperty);
- theExistingProperty = 0;
- }
- }
-
- // Finally, if we don't have a property at this point, create a new property
- if (theExistingProperty.Valid() == false)
- theExistingProperty = m_DataCore->AddProperty(
- newInfo.m_Instance, newInfo.m_Name.wide_str(), newInfo.GetDataType());
- newInfo.m_Property = theExistingProperty;
- m_IgnorePropertyDeleted = false;
- }
-
- // If the type doesn't match the default, then it has no default.
- SValue VerifyDefaultPropertyType(DataModelDataType::Value inDataType, const SValue &inValue)
- {
- if (inValue.empty() == false) {
- DataModelDataType::Value theType = GetValueType(inValue);
- if (theType != inDataType) {
- return SValue(0.0f);
- }
- }
- return inValue;
- }
- // If the datatype doesn't match the value, force the value to match the type.
- // some types *have* to have values.
- TMetaDataData VerifyMetaDataDataType(AdditionalMetaDataType::Value inDataType,
- const TMetaDataData &inValue)
- {
- if (inDataType == AdditionalMetaDataType::StringList
- || inDataType == AdditionalMetaDataType::Range) {
- if (inValue.empty() == true || inDataType != GetMetaDataValueType(inValue)) {
- QT3DS_ASSERT(false);
- if (inDataType == AdditionalMetaDataType::StringList)
- return TMetaDataStringList();
- if (inDataType == AdditionalMetaDataType::Range)
- return SMetaDataRange(0, 1);
- }
- }
- return inValue;
- }
-
- void SetPropertyBaseInfo(SMetaPropertyBase &newInfo, TStrType inName, TStrType inFormalName,
- TStrType inDescription, TStrType inUsage,
- CompleteMetaDataType::Enum inDataType, const SValue &inDefaultValue,
- const TMetaDataData &inMetaData)
- {
- newInfo.m_Name = inName;
- newInfo.m_FormalName = inFormalName;
- newInfo.m_Description = inDescription;
- newInfo.m_Usage = inUsage;
- newInfo.m_CompleteType = inDataType;
- newInfo.m_DefaultValue =
- VerifyDefaultPropertyType(CompleteMetaDataType::ToDataType(inDataType),
- inDefaultValue);
- newInfo.m_MetaDataData =
- VerifyMetaDataDataType(CompleteMetaDataType::ToAdditionalType(inDataType),
- inMetaData);
- }
-
- // For properties, you set the default values separately
- // This may delete the underlying data model property rebuild it.
- void SetMetaDataPropertyInfo(Qt3DSDMMetaDataPropertyHandle inPropertyHandle,
- TStrType inName, TStrType inFormalName,
- TStrType inDescription, TStrType inUsage,
- CompleteMetaDataType::Enum inDataType,
- const SValue &inDefaultValue,
- const TMetaDataData &inMetaData, TStrType inGroupName,
- bool inIsHidden, bool inIsAnimatable,
- bool inIsControllable) override
- {
- SMetaDataPropertyInfo *infoPtr = FindProperty(inPropertyHandle);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SMetaDataPropertyInfo &newInfo(*infoPtr);
- SMetaDataPropertyInfo oldInfo(newInfo);
-
- SetPropertyBaseInfo(newInfo, inName, inFormalName, inDescription, inUsage, inDataType,
- inDefaultValue, inMetaData);
- newInfo.m_IsHidden = inIsHidden;
- newInfo.m_Animatable = inIsAnimatable;
- newInfo.m_Controllable = inIsControllable;
- newInfo.m_GroupName = inGroupName;
- EnsureDataCoreProperty(newInfo);
-
- SetItemInfo(__FILE__, __LINE__, inPropertyHandle, oldInfo, newInfo, m_Properties,
- m_InstanceNameToProperties);
-
- SetPropertyDefault(newInfo, CompleteMetaDataType::ToDataType(inDataType));
- }
-
- void SetPropertyDefault(SMetaDataPropertyInfo &newInfo, DataModelDataType::Value inDataType)
- {
- if (newInfo.m_DefaultValue.empty() == false
- && GetValueType(newInfo.m_DefaultValue) == inDataType) {
- m_DataCore->SetInstancePropertyValue(newInfo.m_Instance, newInfo.m_Property,
- newInfo.m_DefaultValue);
- }
- }
-
- // Destroy just this meta data property
- void DestroyMetaDataProperty(Qt3DSDMMetaDataPropertyHandle inProperty) override
- {
- SMetaDataPropertyInfo *infoPtr = FindProperty(inProperty);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- if (DestroyItem(__FILE__, __LINE__, inProperty,
- m_Properties, m_InstanceNameToProperties, m_InstanceToProperties)) {
- Q_EMIT internalMetaDataPropertyDestroyed(inProperty);
- }
-
- RemoveMetaDataPropertyFilters(inProperty);
- }
-
- Qt3DSDMMetaDataPropertyHandle GetMetaDataProperty(Qt3DSDMInstanceHandle inInstance,
- TStrType inPropertyName) override
- {
- return FindItemByName<Qt3DSDMMetaDataPropertyHandle>(inInstance, Intern(inPropertyName),
- m_InstanceNameToProperties);
- }
- Qt3DSDMMetaDataPropertyHandle GetMetaDataProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- Qt3DSDMPropertyDefinition propDef(m_DataCore->GetProperty(inProperty));
- return GetMetaDataProperty(inInstance, propDef.m_Name);
- }
- // Sets the value in the data core
- virtual Option<SMetaDataPropertyInfo>
- GetMetaDataPropertyInfo(Qt3DSDMMetaDataPropertyHandle inProperty) override
- {
- SMetaDataPropertyInfo *infoPtr = FindProperty(inProperty);
- if (infoPtr == NULL) {
- return Empty();
- }
- return *infoPtr;
- }
-
- void GetMetaDataProperties(Qt3DSDMInstanceHandle inInstance,
- vector<Qt3DSDMMetaDataPropertyHandle> &outProperties) override
- {
- return GetHandleList<Qt3DSDMMetaDataPropertyHandle>(inInstance, m_InstanceToProperties,
- m_Properties, outProperties);
- }
- virtual Qt3DSDMMetaDataPropertyHandle
- GetSpecificMetaDataProperty(Qt3DSDMInstanceHandle inInstance, TStrType inPropertyName)
- {
- TInstancePropertyNamePropertyMap::iterator theFind = m_InstanceNameToProperties.find(
- make_pair(inInstance, m_StringTable.RegisterStr(inPropertyName.wide_str())));
- if (theFind != m_InstanceNameToProperties.end())
- return theFind->second;
- return 0;
- }
- virtual Qt3DSDMMetaDataPropertyHandle
- GetOrCreateSpecificMetaDataProperty(Qt3DSDMInstanceHandle inInstance,
- TStrType inPropertyName) override
- {
- Qt3DSDMMetaDataPropertyHandle theProp(
- GetSpecificMetaDataProperty(inInstance, inPropertyName));
- if (theProp.Valid())
- return theProp;
- return CreateMetaDataProperty(inInstance);
- }
-
- void GetSpecificMetaDataProperties(Qt3DSDMInstanceHandle inInstance,
- vector<Qt3DSDMMetaDataPropertyHandle> &outProperties) override
- {
- TInstancePropertyMap::iterator find = m_InstanceToProperties.find(inInstance);
- if (find != m_InstanceToProperties.end())
- outProperties.insert(outProperties.end(), find->second.begin(), find->second.end());
- }
-
- TCharStr GetFormalName(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- Qt3DSDMMetaDataPropertyHandle propHandle(GetMetaDataProperty(inInstance, inProperty));
- SMetaDataPropertyInfo *infoPtr = FindProperty(propHandle);
- if (infoPtr)
- return infoPtr->m_FormalName;
- return TCharStr();
- }
- AdditionalMetaDataType::Value GetAdditionalMetaDataType(
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) override
- {
- Qt3DSDMMetaDataPropertyHandle propHandle(GetMetaDataProperty(inInstance, inProperty));
- SMetaDataPropertyInfo *infoPtr = FindProperty(propHandle);
- if (infoPtr)
- return infoPtr->GetAdditionalType();
- return AdditionalMetaDataType::None;
- }
- TMetaDataData GetAdditionalMetaDataData(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- Qt3DSDMMetaDataPropertyHandle propHandle(GetMetaDataProperty(inInstance, inProperty));
- SMetaDataPropertyInfo *infoPtr = FindProperty(propHandle);
- if (propHandle.Valid())
- return infoPtr->m_MetaDataData;
- return TMetaDataData();
- }
-
- bool IsCustomInstance(Qt3DSDMInstanceHandle inInstance)
- {
- return m_InstancesToCanonicalType.find(inInstance) == m_InstancesToCanonicalType.end();
- }
-
- SValue GetDefaultValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- Qt3DSDMMetaDataPropertyHandle theProperty(GetMetaDataProperty(inInstance, inProperty));
- if (theProperty.Valid() == false) {
- QT3DS_ASSERT(false);
- return SValue();
- }
- return FindProperty(theProperty)->m_DefaultValue;
- }
-
- bool IsCustomProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- Qt3DSDMMetaDataPropertyHandle propHandle(GetMetaDataProperty(inInstance, inProperty));
- SMetaDataPropertyInfo *infoPtr = FindProperty(propHandle);
- if (infoPtr)
- return IsCustomInstance(infoPtr->m_Instance);
-
- return false;
- }
-
- bool IsFilterValid(Qt3DSDMMetaDataPropertyHandle inProperty,
- const SPropertyFilterInfo &inFilter)
- {
- SMetaDataPropertyInfo *infoPtr = FindProperty(inProperty);
- if (m_DataCore->IsProperty(inFilter.m_FilterProperty) == false) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- Qt3DSDMPropertyDefinition theProp(m_DataCore->GetProperty(inFilter.m_FilterProperty));
- Qt3DSDMPropertyHandle propCheck =
- m_DataCore->GetAggregateInstancePropertyByName(infoPtr->m_Instance, theProp.m_Name);
- if (propCheck != inFilter.m_FilterProperty) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- DataModelDataType::Value theType = GetValueType(inFilter.m_Value);
- if (theType != theProp.m_Type) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- return true;
- }
-
- void SetMetaDataPropertyFilters(Qt3DSDMMetaDataPropertyHandle inProperty,
- NVConstDataRef<SPropertyFilterInfo> inFilters) override
- {
- SMetaDataPropertyInfo *infoPtr = FindProperty(inProperty);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- eastl::vector<SPropertyFilterInfo> newFilters;
- for (QT3DSU32 idx = 0, end = inFilters.size(); idx < end; ++idx) {
- const SPropertyFilterInfo &theFilter(inFilters[idx]);
- if (IsFilterValid(inProperty, theFilter))
- newFilters.push_back(theFilter);
- }
-
- InsertOrUpdateWithTransaction(std::make_pair(inProperty, newFilters), m_PropertyFilters);
- }
-
- virtual NVConstDataRef<SPropertyFilterInfo>
- GetMetaDataPropertyFilters(Qt3DSDMMetaDataPropertyHandle inProperty) override
- {
- TMetaDataPropertyFilterMap::iterator theIter(m_PropertyFilters.find(inProperty));
- if (theIter != m_PropertyFilters.end())
- return qt3ds::foundation::toDataRef(theIter->second.data(), theIter->second.size());
- return NVConstDataRef<SPropertyFilterInfo>();
- }
-
- void RemoveMetaDataPropertyFilters(Qt3DSDMMetaDataPropertyHandle inProperty) override
- {
- TMetaDataPropertyFilterMap::iterator theIter(m_PropertyFilters.find(inProperty));
- if (theIter != m_PropertyFilters.end())
- EraseWithTransaction(__FILE__, __LINE__, inProperty, m_PropertyFilters);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Properties
- Qt3DSDMEventHandle CreateMetaDataEvent(TInstanceHandle inInstance) override
- {
- return CreateItem<Qt3DSDMEventHandle, SEvent>(__FILE__, __LINE__, inInstance, m_Events,
- m_InstanceToEvents);
- }
-
- void SetEventInfo(Qt3DSDMEventHandle inEventHandle, TStrType inName,
- TStrType inFormalName, TStrType inCategory, TStrType inDescription) override
- {
- SEvent *infoPtr = FindEvent(inEventHandle);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SEvent &newInfo(*infoPtr);
- SEvent oldInfo(newInfo);
- newInfo.m_Name = inName;
- newInfo.m_FormalName = inFormalName;
- newInfo.m_Category = inCategory;
- newInfo.m_Description = inDescription;
- SetItemInfo(__FILE__, __LINE__, inEventHandle, oldInfo, newInfo, m_Events,
- m_InstanceNameToEvents);
- }
-
- void DestroyEvent(Qt3DSDMEventHandle inEventHandle) override
- {
- if (DestroyItem(__FILE__, __LINE__, inEventHandle, m_Events,
- m_InstanceNameToEvents, m_InstanceToEvents)) {
- Q_EMIT internalEventDestroyed(inEventHandle);
- }
- }
-
- void GetEvents(Qt3DSDMInstanceHandle inInstance, TEventHandleList &outEvents) override
- {
- return GetHandleList<Qt3DSDMEventHandle>(inInstance, m_InstanceToEvents, m_Events,
- outEvents);
- }
-
- Qt3DSDMEventHandle FindEvent(Qt3DSDMInstanceHandle inInstance, TStrType inName) override
- {
- return FindItemByName<Qt3DSDMEventHandle>(inInstance, Intern(inName),
- m_InstanceNameToEvents);
- }
-
- Option<SEventInfo> GetEventInfo(Qt3DSDMEventHandle inEventHandle) override
- {
- SEvent *infoPtr = FindEvent(inEventHandle);
- if (infoPtr == NULL) {
- return Empty();
- }
- SEventInfo retval;
- retval.m_Name = infoPtr->m_Name;
- retval.m_FormalName = infoPtr->m_FormalName;
- retval.m_Description = infoPtr->m_Description;
- retval.m_Category = infoPtr->m_Category;
- return retval;
- }
-
- bool IsCustomEvent(Qt3DSDMEventHandle inEventHandle) override
- {
- SEvent *infoPtr = FindEvent(inEventHandle);
- if (infoPtr != NULL)
- return IsCustomInstance(infoPtr->m_Instance);
- return false;
- }
-
- void GetSpecificEvents(Qt3DSDMInstanceHandle inInstance, TEventHandleList &outEvents) override
- {
- TInstanceEventMap::iterator theFind(m_InstanceToEvents.find(inInstance));
- if (theFind != m_InstanceToEvents.end())
- outEvents.insert(outEvents.end(), theFind->second.begin(), theFind->second.end());
- }
-
- Qt3DSDMEventHandle GetOrCreateSpecificEvent(Qt3DSDMInstanceHandle inInstance,
- TStrType inName) override
- {
- TInstanceEventNameEventMap::iterator theFind(
- m_InstanceNameToEvents.find(make_pair(inInstance, Intern(inName))));
- if (theFind != m_InstanceNameToEvents.end())
- return theFind->second;
- return CreateMetaDataEvent(inInstance);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Handlers
-
- Qt3DSDMHandlerHandle CreateHandler(Qt3DSDMInstanceHandle inInstance) override
- {
- return CreateItem<Qt3DSDMHandlerHandle, SHandler>(__FILE__, __LINE__, inInstance,
- m_Handlers, m_InstanceToHandlers);
- }
-
- void SetHandlerInfo(Qt3DSDMHandlerHandle inHandle, TStrType inName,
- TStrType inFormalName, TStrType inCategoryName,
- TStrType inDescription) override
- {
- SHandler *infoPtr = FindHandler(inHandle);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SHandler &newInfo(*infoPtr);
- SHandler oldInfo(newInfo);
- newInfo.m_Name = inName;
- newInfo.m_FormalName = inFormalName;
- newInfo.m_Description = inDescription;
- newInfo.m_Category = inCategoryName;
- SetItemInfo(__FILE__, __LINE__, inHandle, oldInfo, newInfo, m_Handlers,
- m_InstanceNameToHandlers);
- }
-
- void DestroyHandler(Qt3DSDMHandlerHandle inHandlerHandle) override
- {
- SHandler *infoPtr(FindHandler(inHandlerHandle));
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- while (infoPtr->m_Arguments.empty() == false)
- DestroyHandlerArgument(inHandlerHandle, (QT3DSU32)infoPtr->m_Arguments.size() - 1);
- if (DestroyItem(__FILE__, __LINE__, inHandlerHandle, m_Handlers,
- m_InstanceNameToHandlers, m_InstanceToHandlers)) {
- Q_EMIT internalHandlerDestroyed(inHandlerHandle);
- }
- }
-
- Qt3DSDMHandlerHandle FindHandlerByName(Qt3DSDMInstanceHandle inInstance,
- TStrType inName) override
- {
- return FindItemByName<Qt3DSDMHandlerHandle>(inInstance, Intern(inName),
- m_InstanceNameToHandlers);
- }
-
- Option<SHandlerInfo> GetHandlerInfo(Qt3DSDMHandlerHandle inHandlerHandle) override
- {
- SHandler *infoPtr = FindHandler(inHandlerHandle);
- if (infoPtr == NULL)
- return Empty();
-
- SHandlerInfo retval;
- retval.m_Name = infoPtr->m_Name;
- retval.m_FormalName = infoPtr->m_FormalName;
- retval.m_Category = infoPtr->m_Category;
- retval.m_Description = infoPtr->m_Description;
-
- return retval;
- }
-
- void GetHandlers(Qt3DSDMInstanceHandle inInstance, THandlerHandleList &outHandlers) override
- {
- return GetHandleList<Qt3DSDMHandlerHandle>(inInstance, m_InstanceToHandlers, m_Handlers,
- outHandlers);
- }
-
- bool IsCustomHandler(Qt3DSDMHandlerHandle inHandle) override
- {
- SHandler *infoPtr = FindHandler(inHandle);
- if (infoPtr != NULL)
- return IsCustomInstance(infoPtr->m_Instance);
- return false;
- }
-
- void GetSpecificHandlers(Qt3DSDMInstanceHandle inInstance,
- THandlerHandleList &outHandlers) override
- {
- TInstanceHandlerMap::iterator theFind = m_InstanceToHandlers.find(inInstance);
- if (theFind != m_InstanceToHandlers.end())
- outHandlers.insert(outHandlers.end(), theFind->second.begin(), theFind->second.end());
- }
-
- Qt3DSDMHandlerHandle GetOrCreateSpecificHandler(Qt3DSDMInstanceHandle inInstance,
- TStrType inName) override
- {
- TInstanceHandlerNameHandlerMap::iterator theFind =
- m_InstanceNameToHandlers.find(make_pair(inInstance, Intern(inName)));
- if (theFind != m_InstanceNameToHandlers.end())
- return theFind->second;
- return CreateHandler(inInstance);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Handler Arguments
-
- void DoAddHandlerArgument(Qt3DSDMHandlerHandle inHandler,
- const SMetaDataHandlerArgumentInfo &inArgHandle, QT3DSU32 inIdx)
- {
- SHandler *infoPtr = FindHandler(inHandler);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- infoPtr->m_Arguments.insert(infoPtr->m_Arguments.begin() + inIdx, inArgHandle);
- }
-
- struct ArgNameEqual
- {
- const TCharStr &m_Name;
- ArgNameEqual(const TCharStr &nm)
- : m_Name(nm)
- {
- }
- bool operator()(const SMetaDataHandlerArgumentInfo &info) const
- {
- return m_Name == info.m_Name;
- }
- };
-
- void DoRemoveHandlerArgument(Qt3DSDMHandlerHandle inHandler,
- const SMetaDataHandlerArgumentInfo &inArgHandle)
- {
- SHandler *infoPtr = FindHandler(inHandler);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- erase_if(infoPtr->m_Arguments, ArgNameEqual(inArgHandle.m_Name));
- }
-
- struct HandlerArgumentAddRemoveTransaction : public ITransaction
- {
- SNewMetaDataImpl &m_Impl;
- Qt3DSDMHandlerHandle m_Handler;
- SMetaDataHandlerArgumentInfo m_Arg;
- QT3DSU32 m_Idx;
- bool m_AddOnDo;
-
- HandlerArgumentAddRemoveTransaction(const char *inFile, int inLine, SNewMetaDataImpl &impl,
- Qt3DSDMHandlerHandle hdl,
- const SMetaDataHandlerArgumentInfo &arg, QT3DSU32 inIdx,
- bool inAddOnDo)
- : ITransaction(inFile, inLine)
- , m_Impl(impl)
- , m_Handler(hdl)
- , m_Arg(arg)
- , m_Idx(inIdx)
- , m_AddOnDo(inAddOnDo)
- {
- }
- void insert() { m_Impl.DoAddHandlerArgument(m_Handler, m_Arg, m_Idx); }
- void remove() { m_Impl.DoRemoveHandlerArgument(m_Handler, m_Arg); }
- void Do() override
- {
- if (m_AddOnDo)
- insert();
- else
- remove();
- }
- void Undo() override
- {
- if (m_AddOnDo)
- remove();
- else
- insert();
- }
- };
-
- QT3DSU32 AddHandlerArgument(Qt3DSDMHandlerHandle inHandler) override
- {
- SHandler *infoPtr = FindHandler(inHandler);
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return 0;
- }
-
- SMetaDataHandlerArgumentInfo theInfo(inHandler);
- QT3DSU32 idx = (QT3DSU32)infoPtr->m_Arguments.size();
- DoAddHandlerArgument(inHandler, theInfo, idx);
- if (m_Consumer)
- m_Consumer->OnTransaction(make_shared<HandlerArgumentAddRemoveTransaction>(
- __FILE__, __LINE__, ref(*this), inHandler, theInfo,
- idx, true));
-
- return idx;
- }
-
- void DoSetHandlerArgument(THandlerHandle inHandler, QT3DSU32 inIdx,
- const SMetaDataHandlerArgumentInfo &inInfo)
- {
- SMetaDataHandlerArgumentInfo *infoPtr(FindHandlerArg(inHandler, inIdx));
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- *infoPtr = inInfo;
- }
-
- struct SetHandlerArgumentInfoTrans : public ITransaction
- {
- SNewMetaDataImpl &m_Impl;
- THandlerHandle m_Handler;
- QT3DSU32 m_Idx;
- SMetaDataHandlerArgumentInfo m_NewValue;
- SMetaDataHandlerArgumentInfo m_OldValue;
- SetHandlerArgumentInfoTrans(const char *inFile, int inLine, SNewMetaDataImpl &impl,
- THandlerHandle handler, QT3DSU32 inIdx,
- const SMetaDataHandlerArgumentInfo &inNewVal,
- const SMetaDataHandlerArgumentInfo &inOldVal)
- : ITransaction(inFile, inLine)
- , m_Impl(impl)
- , m_Handler(handler)
- , m_Idx(inIdx)
- , m_NewValue(inNewVal)
- , m_OldValue(inOldVal)
- {
- }
- void Do() override { m_Impl.DoSetHandlerArgument(m_Handler, m_Idx, m_NewValue); }
- void Undo() override { m_Impl.DoSetHandlerArgument(m_Handler, m_Idx, m_OldValue); }
- };
-
- void SetHandlerArgumentInfo(THandlerHandle inHandler, QT3DSU32 inIdx, TStrType inName,
- TStrType inFormalName, TStrType inDescription,
- CompleteMetaDataType::Enum inDataType,
- const SValue &inDefaultValue,
- const TMetaDataData &inMetaData,
- HandlerArgumentType::Value inArgType) override
- {
- SMetaDataHandlerArgumentInfo *infoPtr(FindHandlerArg(inHandler, inIdx));
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SMetaDataHandlerArgumentInfo &newInfo(*infoPtr);
- SMetaDataHandlerArgumentInfo oldInfo(newInfo);
- SetPropertyBaseInfo(newInfo, inName, inFormalName, inDescription, L"", inDataType,
- inDefaultValue, inMetaData);
- newInfo.m_ArgType = inArgType;
- if (m_Consumer != NULL)
- m_Consumer->OnTransaction(make_shared<SetHandlerArgumentInfoTrans>(
- __FILE__, __LINE__, ref(*this), inHandler, inIdx,
- newInfo, oldInfo));
- }
-
- void DestroyHandlerArgument(THandlerHandle inHandler, QT3DSU32 inIdx) override
- {
- SHandler *ownerPtr = FindHandler(inHandler);
- SMetaDataHandlerArgumentInfo *infoPtr(FindHandlerArg(inHandler, inIdx));
- if (infoPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- if (ownerPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- Q_EMIT internalHandlerArgDestroyed(inHandler, inIdx);
-
- if (m_Consumer)
- m_Consumer->OnTransaction(make_shared<HandlerArgumentAddRemoveTransaction>(
- __FILE__, __LINE__, ref(*this), infoPtr->m_Handler,
- *infoPtr, inIdx, false));
-
- DoRemoveHandlerArgument(infoPtr->m_Handler, *infoPtr);
- }
-
- Option<SMetaDataHandlerArgumentInfo> FindHandlerArgumentByName(THandlerHandle inHandler,
- TStrType inName) override
- {
- SHandler *ownerPtr = FindHandler(inHandler);
- if (ownerPtr == NULL) {
- return Empty();
- }
- for (size_t idx = 0, end = ownerPtr->m_Arguments.size(); idx < end; ++idx) {
- if (ownerPtr->m_Arguments[idx].m_Name == inName)
- return ownerPtr->m_Arguments[idx];
- }
- return Empty();
- }
-
- void GetHandlerArguments(THandlerHandle inHandler,
- vector<SMetaDataHandlerArgumentInfo> &outArguments) override
- {
- SHandler *ownerPtr = FindHandler(inHandler);
- if (ownerPtr == NULL) {
- return;
- }
- outArguments.insert(outArguments.end(), ownerPtr->m_Arguments.begin(),
- ownerPtr->m_Arguments.end());
- }
-
- virtual Option<SMetaDataHandlerArgumentInfo>
- GetHandlerArgumentInfo(Qt3DSDMHandlerHandle inHandle, QT3DSU32 inIdx) override
- {
- SMetaDataHandlerArgumentInfo *infoPtr(FindHandlerArg(inHandle, inIdx));
- if (infoPtr == NULL) {
- return Empty();
- }
- return *infoPtr;
- }
-
- QT3DSU32 GetNumHandlerArguments(Qt3DSDMHandlerHandle inHandler) override
- {
- SHandler *ownerPtr = FindHandler(inHandler);
- if (ownerPtr == NULL) {
- return 0;
- }
- return (QT3DSU32)ownerPtr->m_Arguments.size();
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // References
- void AddReference(Qt3DSDMInstanceHandle inInstance, TStrType inRefString) override
- {
- // trim whitespace from the beginning and the end of the string
- TCharStr::size_type startPos = inRefString.find_first_not_of(L"\n\r\t ");
- TCharStr::size_type endPos = inRefString.find_last_not_of(L"\n\r\t ");
- const wchar_t *theStr = NULL;
- if (startPos != TCharStr::npos) {
- TStrType temp = inRefString.substr(startPos, endPos - startPos + 1);
- theStr = Intern(temp);
- } else
- theStr = Intern(inRefString);
-
- QT3DSU32 idx = AddItemToInstanceList(inInstance, theStr, m_InstanceToReferences);
- if (m_Consumer) {
- m_Consumer->OnTransaction(
- std::make_shared<InstanceListTransaction<TInstanceStringListMap,
- const wchar_t *>>(
- __FILE__, __LINE__, inInstance, theStr,
- std::ref(m_InstanceToReferences), idx,
- true));
- }
- }
-
- void DestroyReferences(Qt3DSDMInstanceHandle inInstance) override
- {
- TInstanceStringListMap::iterator find = m_InstanceToReferences.find(inInstance);
-
- if (find == m_InstanceToReferences.end())
- return;
-
- CreateHashMapEraseTransaction(__FILE__, __LINE__, m_Consumer,
- make_pair(find->first, find->second), m_InstanceToReferences);
- m_InstanceToReferences.erase(find);
- }
-
- struct InternSizeTOpType
- {
- SNewMetaDataImpl &m_Impl;
- InternSizeTOpType(SNewMetaDataImpl &inImpl)
- : m_Impl(inImpl)
- {
- }
-
- size_t operator()(const TCharStr &inHandle)
- {
- return reinterpret_cast<size_t>(m_Impl.Intern(inHandle));
- }
- };
-
- void GetReferences(Qt3DSDMInstanceHandle inInstance, vector<TCharStr> &outReferences) override
- {
- DoGetHandleList(inInstance, m_InstanceToReferences, outReferences,
- InternSizeTOpType(*this));
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Instance-global functions
- // Destroy all meta data that relates to this instance.
- // Calling this on a derived instance does nothing, this only works if this specific
- // instance was mapped to a type.
- // This function must be completely undoable.
- void DestroyMetaData(Qt3DSDMInstanceHandle inInstance) override
- {
- ForEachItem<TMetaDataPropertyHandle>(
- inInstance, m_InstanceToProperties,
- bind(&SNewMetaDataImpl::DestroyMetaDataProperty, this,
- std::placeholders::_1));
- ForEachItem<TEventHandle>(inInstance, m_InstanceToEvents,
- bind(&SNewMetaDataImpl::DestroyEvent, this,
- std::placeholders::_1));
- ForEachItem<THandlerHandle>(inInstance, m_InstanceToHandlers,
- bind(&SNewMetaDataImpl::DestroyHandler, this,
- std::placeholders::_1));
- DestroyReferences(inInstance);
-
- TInstanceStrMap::iterator find = m_InstancesToCanonicalType.find(inInstance);
- if (find != m_InstancesToCanonicalType.end()) {
- TCharPtr theName(find->second);
- m_CanonicalTypeToInstances.erase(theName);
- m_InstancesToCanonicalType.erase(inInstance);
- CreateHashMapEraseTransaction(__FILE__, __LINE__, m_Consumer,
- make_pair(theName, inInstance),
- m_CanonicalTypeToInstances);
- CreateHashMapEraseTransaction(__FILE__, __LINE__, m_Consumer,
- make_pair(inInstance, theName),
- m_InstancesToCanonicalType);
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Serialization
- // You can either save out in canonical format (and it will only save canonical-instance-related
- // information *or* you can save out in normal format where we link directly to instance handle
- // instead of to typename
- template <typename THashType>
- void AddInstancesFromHash(THashType &inHash,
- unordered_set<TInstanceHandle, hash<int>> &outInstances)
- {
- for (typename THashType::const_iterator iter = inHash.begin(), end = inHash.end();
- iter != end; ++iter)
- outInstances.insert(iter->first);
- }
-
- void SerializeMetaDataData(IDOMWriter &inWriter, TMetaDataData &inItem,
- AdditionalMetaDataType::Value inType)
- {
- if (!inItem.empty()) {
- if (inType == AdditionalMetaDataType::Range) {
- SMetaDataRange theRange(get<SMetaDataRange>(inItem));
- inWriter.Att(L"min", theRange.m_min);
- inWriter.Att(L"max", theRange.m_max);
- inWriter.Att(L"decimals", theRange.m_decimals);
- } else if (inType == AdditionalMetaDataType::StringList) {
- const TMetaDataStringList &theList(get<TMetaDataStringList>(inItem));
- TCharStr theBuffer;
- for (uint32_t idx = 0, end = theList.size(); idx < end; ++idx) {
- if (idx)
- theBuffer.append(L":");
- theBuffer.append(theList[idx]);
- }
- inWriter.Att(L"list", theBuffer.wide_str());
- }
- }
- }
-
- void SerializeDataModelValue(IDOMWriter &inWriter, const SValue &inValue,
- DataModelDataType::Value /*inType*/,
- const wchar_t *inName = L"default")
- {
- if (inValue.empty())
- return;
-
- m_TempBuffer.clear();
- WCharTWriter writer(m_TempBuffer);
- WStrOps<SValue>().ToBuf(inValue, writer);
-
- if (m_TempBuffer.size()) {
- m_TempBuffer.write((QT3DSU16)0);
- inWriter.Att(inName, (const wchar_t *)m_TempBuffer.begin());
- }
- }
-
- void SerializeDataModelValue(IDOMReader &inReader, SValue &outValue,
- DataModelDataType::Value inType,
- const wchar_t *inName = L"default")
- {
- const char8_t *theDefaultValue;
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const qt3ds::foundation::TWCharEASTLConverter::TCharType *>(
- inName), 0,
- m_ConvertStr);
- if (inReader.UnregisteredAtt(m_ConvertStr.c_str(), theDefaultValue)) {
- m_TempBuffer.clear();
- // We have to write a temporary value because the parsing of floats,
- // in order to be efficient, is destructive.
- if (theDefaultValue && *theDefaultValue)
- m_TempBuffer.write(theDefaultValue, (QT3DSU32)strlen(theDefaultValue) + 1);
-
- if (m_TempBuffer.size() == 0) {
- SetDefault(inType, outValue);
- return;
- }
- m_ReadBuffer.clear();
-
- char8_t *trashPtr = (char8_t *)m_TempBuffer.begin();
- WCharTReader theReader(trashPtr, m_ReadBuffer, m_StringTable);
- outValue = WStrOps<SValue>().BufTo(inType, theReader);
- } else
- SetDefault(inType, outValue);
- }
-
- void SerializeMetaDataData(IDOMReader &inReader, TMetaDataData &ioItem,
- CompleteMetaDataType::Enum &ioType)
- {
- // Use the meta data extra information to force the type
- // to something that works correctly.
- SMetaDataRange theRange;
- if (inReader.Att("min", theRange.m_min) && inReader.Att("max", theRange.m_max)) {
- inReader.Att("decimals", theRange.m_decimals);
- ioItem = theRange;
- if (ioType == CompleteMetaDataType::Long)
- ioType = CompleteMetaDataType::LongRange;
- else
- ioType = CompleteMetaDataType::FloatRange;
- } else {
- TMetaDataStringList theList;
- TCharStr theItems;
- if (inReader.Att(L"list", theItems)) {
- for (TCharStr::size_type theIter = theItems.find_first_of(L":,");
- theIter != theItems.npos; theIter = theItems.find_first_of(L":,")) {
- theList.push_back(theItems.substr(0, theIter));
- theItems = theItems.substr(theIter + 1);
- }
- theList.push_back(theItems);
- ioItem = theList;
- if (ioType != CompleteMetaDataType::StringListOrInt)
- ioType = CompleteMetaDataType::StringList;
- }
- }
- }
- void EnsureCategory(IDOMWriter &, const TCharStr &, const TCharStr &) {}
- void EnsureCategory(IDOMReader &, TCharStr &inCategory, const TCharStr &inObjectName)
- {
- Qt3DSDMCategoryHandle theCategory = FindCategoryByName(inCategory);
- if (theCategory.Valid() == false) {
- if (inObjectName.empty()) {
- QT3DS_ASSERT(false);
- } else {
- if (inCategory.empty())
- inCategory = inObjectName;
-
- pair<Qt3DSDMCategoryHandle, bool> theGetOrCreateResult(
- GetOrCreateCategory(inCategory));
-
- if (theGetOrCreateResult.second == true) {
- SetCategoryInfo(theGetOrCreateResult.first, L"Objects-Behavior-Normal.png",
- L"Objects-Behavior-Normal.png", inCategory);
- }
- }
- }
- }
-
- void SerializePropertyBase(IDOMWriter &inArchive, SMetaPropertyBase &inItem)
- {
- inArchive.Att(L"name", inItem.m_Name);
- if (inItem.m_FormalName != inItem.m_Name)
- inArchive.Att(L"formalName", inItem.m_FormalName);
- if (inItem.m_Description != inItem.m_Name)
- inArchive.Att(L"description", inItem.m_Description);
- if (inItem.m_CompleteType != CompleteMetaDataType::Float
- && inItem.m_CompleteType != CompleteMetaDataType::FloatRange
- && inItem.m_CompleteType != CompleteMetaDataType::LongRange
- && inItem.m_CompleteType != CompleteMetaDataType::StringList) {
- inArchive.Att(L"type", inItem.m_CompleteType);
- }
-
- // Ensure that all types work
- if (inItem.GetAdditionalType() != AdditionalMetaDataType::None)
- SerializeMetaDataData(inArchive, inItem.m_MetaDataData, inItem.GetAdditionalType());
-
- if (inItem.GetDataType() != DataModelDataType::None) {
- SValue theGlobalDefault;
- SetDefault(inItem.GetDataType(), theGlobalDefault);
- if (!Equals(theGlobalDefault.toOldSkool(), inItem.m_DefaultValue.toOldSkool()))
- SerializeDataModelValue(inArchive, inItem.m_DefaultValue, inItem.GetDataType());
- }
- }
-
- void SerializePropertyBase(IDOMReader &inArchive, SMetaPropertyBase &inItem)
- {
- inArchive.Att(L"name", inItem.m_Name);
- inArchive.Att(L"formalName", inItem.m_FormalName);
- inArchive.Att(L"usage", inItem.m_Usage);
- inArchive.Att(L"description", inItem.m_Description);
- inArchive.Att(L"type", inItem.m_CompleteType);
- // Setup reasonable defaults in the case where the users are specifying little information
- // in the file format
- if (inItem.m_FormalName.empty())
- inItem.m_FormalName = inItem.m_Name;
- if (inItem.m_Description.empty())
- inItem.m_Description = inItem.m_FormalName;
-
- // Ensure that users can use a float type and make minimal decisions
- SerializeMetaDataData(inArchive, inItem.m_MetaDataData, inItem.m_CompleteType);
-
- if (inItem.GetDataType() != DataModelDataType::None)
- SerializeDataModelValue(inArchive, inItem.m_DefaultValue, inItem.GetDataType());
- }
-
- void FinalizeCategory(IDOMWriter &, SCategoryInfo &) {}
-
- void FinalizeCategory(IDOMReader &, SCategoryInfo &inCategory)
- {
- if (inCategory.m_Description.empty())
- inCategory.m_Description = inCategory.m_Name;
- }
-
- template <typename TArchiveType>
- void SerializeItem(TArchiveType &inArchive, SCategoryInfo &inItem)
- {
- inArchive.Att(L"name", inItem.m_Name);
- inArchive.Att(L"description", inItem.m_Description);
- inArchive.Att(L"icon", inItem.m_Icon);
- inArchive.Att(L"highlightIcon", inItem.m_HighlightIcon);
-
- FinalizeCategory(inArchive, inItem);
- }
-
- void SerializeItem(IDOMWriter &inArchive, SMetaDataPropertyInfo &inItem,
- Qt3DSDMMetaDataPropertyHandle inHandle)
- {
- SerializePropertyBase(inArchive, inItem);
- if (inItem.m_IsHidden == true)
- inArchive.Att("hidden", inItem.m_IsHidden);
- if (inItem.m_Animatable == false)
- inArchive.Att("animatable", inItem.m_Animatable);
- if (inItem.m_Controllable == true)
- inArchive.Att("controllable", inItem.m_Controllable);
- NVConstDataRef<SPropertyFilterInfo> theInfos = GetMetaDataPropertyFilters(inHandle);
- for (QT3DSU32 idx = 0, end = theInfos.size(); idx < end; ++idx) {
- const SPropertyFilterInfo &theInfo(theInfos[idx]);
- Qt3DSDMPropertyDefinition thePropertyInfo(
- m_DataCore->GetProperty(theInfo.m_FilterProperty));
-
- const wchar_t *theFilterName;
- if (theInfo.m_FilterType == PropertyFilterTypes::HideIfEqual)
- theFilterName = L"HideIfEqual";
- else
- theFilterName = L"ShowIfEqual";
-
- IDOMWriter::Scope filterScope(inArchive, theFilterName);
- inArchive.Att(L"property", thePropertyInfo.m_Name);
- SerializeDataModelValue(inArchive, theInfo.m_Value, thePropertyInfo.m_Type, L"value");
- }
- }
-
- void SerializeItem(IDOMReader &inArchive, SMetaDataPropertyInfo &inItem,
- Qt3DSDMMetaDataPropertyHandle inHandle)
- {
- QT3DS_ASSERT(inHandle.Valid());
-
- SerializePropertyBase(inArchive, inItem);
- inArchive.Att("hidden", inItem.m_IsHidden);
- inArchive.Att("animatable", inItem.m_Animatable);
- inArchive.Att("controllable", inItem.m_Controllable);
- inArchive.Att(L"category", inItem.m_GroupName);
- }
-
- void ReadChildren(IDOMReader &inArchive, SMetaDataPropertyInfo &inItem,
- Qt3DSDMMetaDataPropertyHandle inHandle)
- {
- IDOMReader::Scope __readerScope(inArchive);
- eastl::vector<SPropertyFilterInfo> theFilters;
- for (bool success = inArchive.MoveToFirstChild(); success;
- success = inArchive.MoveToNextSibling()) {
-
- if (AreEqual(inArchive.GetElementName(), L"ShowIfEqual")) {
- TCharStr theName;
- inArchive.Att(L"property", theName);
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(inItem.m_Instance, theName);
- if (theProperty.Valid() == false) {
- QT3DS_ASSERT(false);
- return;
- }
- Qt3DSDMPropertyDefinition thePropDef(m_DataCore->GetProperty(theProperty));
-
- SPropertyFilterInfo theInfo;
- theInfo.m_FilterType = PropertyFilterTypes::ShowIfEqual;
- theInfo.m_FilterProperty = theProperty;
- SerializeDataModelValue(inArchive, theInfo.m_Value, thePropDef.m_Type, L"value");
- theFilters.push_back(theInfo);
- } else if (AreEqual(inArchive.GetElementName(), L"HideIfEqual")) {
- TCharStr theName;
- inArchive.Att(L"property", theName);
- Qt3DSDMPropertyHandle theProperty =
- m_DataCore->GetAggregateInstancePropertyByName(inItem.m_Instance, theName);
- if (theProperty.Valid() == false) {
- QT3DS_ASSERT(false);
- return;
- }
- Qt3DSDMPropertyDefinition thePropDef(m_DataCore->GetProperty(theProperty));
-
- SPropertyFilterInfo theInfo;
- theInfo.m_FilterType = PropertyFilterTypes::HideIfEqual;
- theInfo.m_FilterProperty = theProperty;
- SerializeDataModelValue(inArchive, theInfo.m_Value, thePropDef.m_Type, L"value");
- theFilters.push_back(theInfo);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- if (theFilters.size())
- SetMetaDataPropertyFilters(
- inHandle, qt3ds::foundation::toDataRef(theFilters.data(),
- theFilters.size()));
- }
-
- void EnsureEventHandlerBase(IDOMWriter &, SEventAndHandlerBase &) {}
-
- void EnsureEventHandlerBase(IDOMReader &, SEventAndHandlerBase &inItem)
- {
- if (inItem.m_FormalName.empty())
- inItem.m_FormalName = inItem.m_Name;
- if (inItem.m_Description.empty())
- inItem.m_Description = inItem.m_Name;
- }
-
- void SerializeItem(IDOMWriter &inArchive, SEvent &inItem, Qt3DSDMEventHandle &)
- {
- inArchive.Att(L"name", inItem.m_Name);
- if (inItem.m_Name != inItem.m_FormalName)
- inArchive.Att(L"formalName", inItem.m_FormalName);
- if (inItem.m_Category != L"Default")
- inArchive.Att(L"category", inItem.m_Category);
- if (inItem.m_Description != inItem.m_Name)
- inArchive.Att(L"description", inItem.m_Description);
-
- EnsureCategory(inArchive, inItem.m_Category, m_ObjectName);
- EnsureEventHandlerBase(inArchive, inItem);
- }
-
- void SerializeItem(IDOMReader &inArchive, SEvent &inItem, Qt3DSDMEventHandle &)
- {
- inArchive.Att(L"name", inItem.m_Name);
- inArchive.Att(L"formalName", inItem.m_FormalName);
- inArchive.Att(L"category", inItem.m_Category);
- EnsureCategory(inArchive, inItem.m_Category, m_ObjectName);
- inArchive.Att(L"description", inItem.m_Description);
- EnsureEventHandlerBase(inArchive, inItem);
- }
-
- void SerializeHandlerArgument(IDOMWriter &inArchive, SMetaDataHandlerArgumentInfo &inArgument)
- {
- SerializePropertyBase(inArchive, inArgument);
- if (inArgument.m_ArgType != HandlerArgumentType::None)
- inArchive.Att(L"argumentType", inArgument.m_ArgType);
- }
-
- void SerializeHandlerArgument(IDOMReader &inArchive, SMetaDataHandlerArgumentInfo &inArgument)
- {
- SerializePropertyBase(inArchive, inArgument);
- inArchive.Att(L"argumentType", inArgument.m_ArgType);
- }
-
- void SerializeHandlerArguments(IDOMWriter &inWriter, SHandler &inItem, Qt3DSDMHandlerHandle &)
- {
- for (size_t idx = 0, end = inItem.m_Arguments.size(); idx < end; ++idx) {
- SMetaDataHandlerArgumentInfo &theArg(inItem.m_Arguments[idx]);
- IDOMWriter::Scope __argScope(inWriter, L"Argument");
- SerializeHandlerArgument(inWriter, theArg);
- }
- }
-
- void SerializeHandlerArguments(IDOMReader &inReader, SHandler &inItem, THandlerHandle &inHandle)
- {
- if (inHandle.GetHandleValue() == 0)
- inHandle = THandlerHandle(GetNextId());
-
- IDOMReader::Scope __handlerScope(inReader);
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- SMetaDataHandlerArgumentInfo theArg(inHandle);
- SerializeHandlerArgument(inReader, theArg);
- inItem.m_Arguments.push_back(theArg);
- }
- }
-
- void SerializeHandlerItem(IDOMWriter &inArchive, SHandler &inItem)
- {
- inArchive.Att(L"name", inItem.m_Name);
- if (inItem.m_FormalName != inItem.m_Name)
- inArchive.Att(L"formalName", inItem.m_FormalName);
- if (inItem.m_Category != L"Default")
- inArchive.Att(L"category", inItem.m_Category);
- if (inItem.m_Description != inItem.m_Name)
- inArchive.Att(L"description", inItem.m_Description);
- EnsureEventHandlerBase(inArchive, inItem);
- }
-
- void SerializeHandlerItem(IDOMReader &inArchive, SHandler &inItem)
- {
- inArchive.Att(L"name", inItem.m_Name);
- inArchive.Att(L"formalName", inItem.m_FormalName);
- inArchive.Att(L"category", inItem.m_Category);
- EnsureCategory(inArchive, inItem.m_Category, m_ObjectName);
- inArchive.Att(L"description", inItem.m_Description);
- EnsureEventHandlerBase(inArchive, inItem);
- }
-
- template <typename TArchiveType>
- void SerializeItem(TArchiveType &inArchive, SHandler &inItem, Qt3DSDMHandlerHandle &inHandle)
- {
- SerializeHandlerItem(inArchive, inItem);
- SerializeHandlerArguments(inArchive, inItem, inHandle);
- }
-
- template <typename TInfoType, typename THandleType, typename TListMapType, typename THashType,
- typename TNameMapType>
- void SerializeInstanceData(IDOMWriter &inArchive, TInstanceHandle inInstanceHandle,
- TCharPtr inElementName,
- unordered_map<THandleType, TInfoType, THashType> &inMap,
- TListMapType &inListMap, TNameMapType & /*inNameMap*/)
- {
- typedef unordered_map<THandleType, TInfoType, THashType> TMapType;
- typename TListMapType::iterator find = inListMap.find(inInstanceHandle);
- if (find == inListMap.end())
- return;
-
- vector<THandleType> &itemList = find->second;
- for (size_t idx = 0, end = itemList.size(); idx < end; ++idx) {
- typename TMapType::iterator iter = inMap.find(itemList[idx]);
- if (iter == inMap.end()) {
- QT3DS_ASSERT(false);
- continue;
- }
- TInfoType &theType = iter->second;
- IDOMWriter::Scope __elemScope(inArchive, inElementName);
- SerializeItem(inArchive, theType, itemList[idx]);
- }
- }
-
- void CreateInstanceGroupInfo(SMetaDataPropertyInfo &inProperty)
- {
- if (!inProperty.m_GroupName.empty()) {
- const wchar_t *theGroupName = Intern(inProperty.m_GroupName);
- bool found = false;
- pair<typename TInstanceGroupMap::iterator, bool> inserter =
- m_InstanceGroupMap.insert(make_pair(inProperty.m_Instance, vector<TCharPtr>()));
- vector<TCharPtr> &itemList = inserter.first->second;
- for (size_t idx = 0, end = itemList.size(); idx < end; ++idx) {
- TCharStr curListName = itemList[idx];
- if (curListName == theGroupName) {
- found = true;
- break;
- }
- }
- if (!found && !inProperty.m_IsHidden)
- inserter.first->second.push_back(theGroupName);
- }
- }
- void CreateInstanceGroupInfo(SEvent &) {}
- void CreateInstanceGroupInfo(SHandler &) {}
-
- // Make sure the data core
- void PostLoad(SMetaDataPropertyInfo &inProperty)
- {
- EnsureDataCoreProperty(inProperty);
- SetPropertyDefault(inProperty, inProperty.GetDataType());
- }
-
- void ReadChildren(IDOMReader &, SEvent &, Qt3DSDMEventHandle) {}
- void ReadChildren(IDOMReader &, SHandler &, Qt3DSDMHandlerHandle) {}
-
- void PostLoad(SEvent &) {}
- void PostLoad(SHandler &) {}
- template <typename TInfoType, typename THandleType, typename TListMapType, typename THashType,
- typename TNameMapType>
- void SerializeInstanceData(IDOMReader &inArchive, TInstanceHandle inInstanceHandle,
- TCharPtr inElementName,
- unordered_map<THandleType, TInfoType, THashType> &inMap,
- TListMapType &inListMap, TNameMapType &inNameMap)
- {
- // Ensure we pop out to where we were.
- IDOMReader::Scope __readerScope(inArchive);
- for (bool success = inArchive.MoveToFirstChild(inElementName); success;
- success = inArchive.MoveToNextSibling(inElementName)) {
- TInfoType theInfo(inInstanceHandle);
- THandleType theHandle(GetNextId());
- SerializeItem(inArchive, theInfo, theHandle);
- PostLoad(theInfo);
- CreateInstanceGroupInfo(theInfo);
- inMap.insert(make_pair(theHandle, theInfo));
- this->AddItemToInstanceList(inInstanceHandle, theHandle, inListMap);
- inNameMap.insert(
- make_pair(make_pair(inInstanceHandle, Intern(theInfo.m_Name)), theHandle));
- ReadChildren(inArchive, theInfo, theHandle);
- }
- }
-
- void SerializeInstanceData(IDOMWriter &inArchive, TInstanceHandle inInstance,
- TCharPtr inElementName, TInstanceStringListMap &inMap)
- {
- TInstanceStringListMap::iterator iter = inMap.find(inInstance);
- if (iter == inMap.end())
- return;
- const vector<TCharPtr> &theValueList(iter->second);
- for (size_t idx = 0, end = theValueList.size(); idx < end; ++idx) {
- IDOMWriter::Scope __elemScope(inArchive, inElementName);
- inArchive.Value(theValueList[idx]);
- }
- }
-
- void SerializeInstanceData(IDOMReader &inArchive, TInstanceHandle inInstance,
- TCharPtr inElementName, TInstanceStringListMap &inMap)
- {
- IDOMReader::Scope __readerScope(inArchive);
- for (bool success = inArchive.MoveToFirstChild(inElementName); success;
- success = inArchive.MoveToNextSibling(inElementName)) {
- const wchar_t *theValue;
- if (inArchive.RegisteredValue(theValue))
- AddItemToInstanceList(inInstance, theValue, inMap);
- }
- }
-
- template <typename TArchiveType>
- void SerializeInstance(TArchiveType &inArchive, TInstanceHandle inInstance)
- {
- SerializeInstanceData(inArchive, inInstance, L"Property", m_Properties,
- m_InstanceToProperties, m_InstanceNameToProperties);
- SerializeInstanceData(inArchive, inInstance, L"Event", m_Events, m_InstanceToEvents,
- m_InstanceNameToEvents);
- SerializeInstanceData(inArchive, inInstance, L"Handler", m_Handlers, m_InstanceToHandlers,
- m_InstanceNameToHandlers);
- SerializeInstanceData(inArchive, inInstance, L"Reference", m_InstanceToReferences);
- }
- void SerializeCategories(IDOMWriter &inWriter)
- {
- for (TCategoryMap::iterator iter = m_Categories.begin(), end = m_Categories.end();
- iter != end; ++iter) {
- IDOMWriter::Scope __writerScope(inWriter, L"Category");
- SerializeItem(inWriter, iter->second);
- }
- }
- void SerializeCategories(IDOMReader &inReader)
- {
- IDOMReader::Scope __readerScope(inReader);
- for (bool success = inReader.MoveToFirstChild(L"Category"); success;
- success = inReader.MoveToNextSibling(L"Category")) {
- SCategoryInfo theInfo;
- SerializeItem(inReader, theInfo);
- TCategoryHandle newHandle(GetNextId());
- theInfo.m_Canonical = true;
- m_Categories.insert(make_pair(newHandle, theInfo));
- m_NameToCategories.insert(make_pair(Intern(theInfo.m_Name), newHandle));
- }
- }
-
- struct SInstanceSorter
- {
- const TInstanceStrMap &m_Map;
- SInstanceSorter(const TInstanceStrMap &inMap)
- : m_Map(inMap)
- {
- }
- bool operator()(TInstanceHandle lhs, TInstanceHandle rhs)
- {
- TInstanceStrMap::const_iterator lhsIter(m_Map.find(lhs));
- TInstanceStrMap::const_iterator rhsIter(m_Map.find(rhs));
- if (lhsIter == rhsIter)
- return false;
- if (lhsIter == m_Map.end())
- return false;
- if (rhsIter == m_Map.end())
- return true;
- return wcscmp(lhsIter->second, rhsIter->second) < 0;
- }
- };
-
- void Save(IDOMWriter &inWriter) override
- {
- SerializeCategories(inWriter);
- typedef unordered_set<TInstanceHandle, hash<int>> TInstanceListType;
- TInstanceListType theInstanceList;
- // Get the list of instances to serialize.
-
- AddInstancesFromHash(m_InstanceToProperties, theInstanceList);
- AddInstancesFromHash(m_InstanceToEvents, theInstanceList);
- AddInstancesFromHash(m_InstanceToHandlers, theInstanceList);
- AddInstancesFromHash(m_InstanceToReferences, theInstanceList);
-
- vector<TInstanceHandle> theInstances;
- theInstances.reserve(theInstanceList.size());
- theInstances.insert(theInstances.begin(), theInstanceList.begin(), theInstanceList.end());
- sort(theInstances.begin(), theInstances.end(), SInstanceSorter(m_InstancesToCanonicalType));
-
- for (vector<TInstanceHandle>::iterator iter = theInstances.begin(),
- end = theInstances.end();
- iter != end; ++iter) {
- TInstanceHandle instHandle = *iter;
- Option<TCharStr> theType(GetTypeForCanonicalInstance(*iter));
- if (theType.hasValue()) {
- IDOMWriter::Scope __instanceElem(inWriter, theType->wide_str());
- SerializeInstance(inWriter, *iter);
- }
- }
- }
-
- // Loading expects the canonical instances to be setup already which means that
- // it will perform lookups based on
- void Load(IDOMReader &inReader) override
- {
- if (!inReader.Att("NextId", m_NextId))
- m_NextId = 1;
- m_ObjectName = L"";
- SerializeCategories(inReader);
- IDOMReader::Scope __instanceGatherScope(inReader);
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- const wchar_t *elemName = inReader.GetElementName();
- TStrInstanceMap::iterator find = m_CanonicalTypeToInstances.find(elemName);
- if (find == m_CanonicalTypeToInstances.end()) {
- continue;
- }
-
- SerializeInstance(inReader, find->second);
- }
- }
-
- template <typename THandleType, typename TMapType>
- void RemoveOldItemsAndSetOrder(
- Qt3DSDMInstanceHandle inInstance, vector<THandleType> &inNewHandles,
- void (SNewMetaDataImpl::*inGetSpecificFun)(Qt3DSDMInstanceHandle, vector<THandleType> &),
- void (SNewMetaDataImpl::*inDestroyFun)(THandleType), TMapType &inListMap)
- {
- vector<THandleType> theHandles;
- (this->*inGetSpecificFun)(inInstance, theHandles);
- for (size_t idx = 0, end = theHandles.size(); idx < end; ++idx)
- if (find(inNewHandles.begin(), inNewHandles.end(), theHandles[idx])
- == inNewHandles.end())
- (this->*inDestroyFun)(theHandles[idx]);
-
- InsertOrUpdateWithTransaction(make_pair(inInstance, inNewHandles), inListMap);
- }
-
- // Load meta data and apply it to just this instance
- // This needs to be undoable so we have to do this through a slightly different
- // system than we did before.
- void LoadInstance(IDOMReader &inReader, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings) override
- {
- const wchar_t *theAtt;
- vector<Qt3DSDMMetaDataPropertyHandle> theProperties;
- vector<Qt3DSDMEventHandle> theEvents;
- vector<Qt3DSDMHandlerHandle> theHandlers;
- DestroyReferences(inInstance);
- m_ObjectName = inObjectName;
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetElementName(), L"Category")) {
- SCategoryInfo theInfo;
- SerializeItem(inReader, theInfo);
- Qt3DSDMCategoryHandle theCategoryInfo(GetOrCreateCategory(theInfo.m_Name).first);
- SetCategoryInfo(theCategoryInfo, theInfo.m_Icon, theInfo.m_HighlightIcon,
- theInfo.m_Description);
- } else if (AreEqual(inReader.GetElementName(), L"Property")) {
- SMetaDataPropertyInfo theInfo(inInstance);
- if (inReader.Att(L"name", theAtt)) {
- Qt3DSDMMetaDataPropertyHandle theProperty(
- GetOrCreateSpecificMetaDataProperty(inInstance, theAtt));
- SerializeItem(inReader, theInfo, theProperty);
- SetMetaDataPropertyInfo(theProperty, theInfo.m_Name, theInfo.m_FormalName,
- theInfo.m_Description, theInfo.m_Usage,
- theInfo.m_CompleteType, theInfo.m_DefaultValue,
- theInfo.m_MetaDataData, theInfo.m_GroupName,
- theInfo.m_IsHidden, theInfo.m_Animatable,
- theInfo.m_Controllable);
- CreateInstanceGroupInfo(theInfo);
- theProperties.push_back(theProperty);
- ReadChildren(inReader, theInfo, theProperty);
- } else
- outWarnings.push_back(
- SMetaDataLoadWarning(MetaDataLoadWarningType::InvalidProperty,
- MetaDataLoadWarningMessage::MissingName));
- } else if (AreEqual(inReader.GetElementName(), L"Event")) {
- SEvent theInfo(inInstance);
- if (inReader.Att(L"name", theAtt)) {
- Qt3DSDMEventHandle theEvent(GetOrCreateSpecificEvent(inInstance, theAtt));
- SerializeItem(inReader, theInfo, theEvent);
- SetEventInfo(theEvent, theInfo.m_Name, theInfo.m_FormalName, theInfo.m_Category,
- theInfo.m_Description);
- theEvents.push_back(theEvent);
- } else
- outWarnings.push_back(
- SMetaDataLoadWarning(MetaDataLoadWarningType::InvalidEvent,
- MetaDataLoadWarningMessage::MissingName));
- } else if (AreEqual(inReader.GetElementName(), L"Handler")) {
- if (inReader.Att(L"name", theAtt)) {
- Qt3DSDMHandlerHandle theHandler(GetOrCreateSpecificHandler(inInstance, theAtt));
- SHandler theInfo(inInstance);
- SerializeHandlerItem(inReader, theInfo);
- SetHandlerInfo(theHandler, theInfo.m_Name, theInfo.m_FormalName,
- theInfo.m_Category, theInfo.m_Description);
- IDOMReader::Scope __argScope(inReader);
- QT3DSU32 argIdx = 0;
- for (bool argSuccess = inReader.MoveToFirstChild(); argSuccess;
- argSuccess = inReader.MoveToNextSibling(), ++argIdx) {
- SMetaDataHandlerArgumentInfo theArg(theHandler);
- SerializeHandlerArgument(inReader, theArg);
- while (argIdx >= GetNumHandlerArguments(theHandler))
- AddHandlerArgument(theHandler);
-
- if (argIdx < GetNumHandlerArguments(theHandler)) {
- SetHandlerArgumentInfo(theHandler, argIdx, theArg.m_Name,
- theArg.m_FormalName, theArg.m_Description,
- theArg.m_CompleteType, theArg.m_DefaultValue,
- theArg.m_MetaDataData, theArg.m_ArgType);
- }
- }
- while (GetNumHandlerArguments(theHandler) > argIdx)
- DestroyHandlerArgument(theHandler, GetNumHandlerArguments(theHandler) - 1);
- theHandlers.push_back(theHandler);
- } else
- outWarnings.push_back(
- SMetaDataLoadWarning(MetaDataLoadWarningType::InvalidHandler,
- MetaDataLoadWarningMessage::MissingName));
- } else if (AreEqual(inReader.GetElementName(), L"Reference")) {
- const wchar_t *theValue;
- if (inReader.Value(theValue))
- AddReference(inInstance, theValue);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- RemoveOldItemsAndSetOrder(
- inInstance, theProperties, &SNewMetaDataImpl::GetSpecificMetaDataProperties,
- &SNewMetaDataImpl::DestroyMetaDataProperty, m_InstanceToProperties);
- RemoveOldItemsAndSetOrder(inInstance, theEvents, &SNewMetaDataImpl::GetSpecificEvents,
- &SNewMetaDataImpl::DestroyEvent, m_InstanceToEvents);
- RemoveOldItemsAndSetOrder(inInstance, theHandlers, &SNewMetaDataImpl::GetSpecificHandlers,
- &SNewMetaDataImpl::DestroyHandler, m_InstanceToHandlers);
- }
-
- // Save just this instances meta data out to the writer
- void SaveInstance(IDOMWriter &inWriter, Qt3DSDMInstanceHandle inInstance) override
- {
- SerializeInstance(inWriter, inInstance);
- }
-
- // Helper to convert char to wchar_t
- eastl::basic_string<qt3ds::foundation::TWCharEASTLConverter::TCharType> m_Buf;
- const wchar_t *ConvertChar(const char *inName)
- {
- if (inName && *inName) {
- qt3ds::foundation::ConvertUTF(inName, 0, m_Buf);
- return reinterpret_cast<const wchar_t *>(m_Buf.c_str());
- }
- return NULL;
- }
-
- void LoadEffectInstance(const char *inShaderFile, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) override
- {
- QString shaderFile(inShaderFile);
- if (shaderFile.endsWith(".effect")) {
- LoadEffectXMLFromSourcePath(inShaderFile, inInstance, inObjectName, outWarnings,
- inStream);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- bool IsEffectInstanceRegistered(const char *inName) override
- {
- return m_EffectMap.find(Intern(inName)) != m_EffectMap.end();
- }
-
- inline qt3ds::render::NVRenderTextureFormats::Enum
- ConvertTypeAndFormatToTextureFormat(const char8_t *inType, const char8_t *inFormat)
- {
- qt3ds::render::NVRenderTextureFormats::Enum retval
- = qt3ds::render::NVRenderTextureFormats::RGBA8;
- if (AreEqual(inFormat, "source"))
- retval = qt3ds::render::NVRenderTextureFormats::Unknown;
- else if (AreEqual(inFormat, "depth24stencil8"))
- retval = qt3ds::render::NVRenderTextureFormats::Depth24Stencil8;
- else {
- if (AreEqual(inType, "ubyte")) {
- if (AreEqual(inFormat, "rgb"))
- retval = qt3ds::render::NVRenderTextureFormats::RGB8;
- else if (AreEqual(inFormat, "rgba"))
- retval = qt3ds::render::NVRenderTextureFormats::RGBA8;
- else if (AreEqual(inFormat, "alpha"))
- retval = qt3ds::render::NVRenderTextureFormats::Alpha8;
- else if (AreEqual(inFormat, "lum"))
- retval = qt3ds::render::NVRenderTextureFormats::Luminance8;
- else if (AreEqual(inFormat, "lum_alpha"))
- retval = qt3ds::render::NVRenderTextureFormats::LuminanceAlpha8;
- else if (AreEqual(inFormat, "rg"))
- retval = qt3ds::render::NVRenderTextureFormats::RG8;
- } else if (AreEqual(inType, "ushort")) {
- if (AreEqual(inFormat, "rgb"))
- retval = qt3ds::render::NVRenderTextureFormats::RGB565;
- else if (AreEqual(inFormat, "rgba"))
- retval = qt3ds::render::NVRenderTextureFormats::RGBA5551;
- } else if (AreEqual(inType, "fp16")) {
- if (AreEqual(inFormat, "rgba"))
- retval = qt3ds::render::NVRenderTextureFormats::RGBA16F;
- else if (AreEqual(inFormat, "rg"))
- retval = qt3ds::render::NVRenderTextureFormats::RG16F;
- } else if (AreEqual(inType, "fp32")) {
- if (AreEqual(inFormat, "rgba"))
- retval = qt3ds::render::NVRenderTextureFormats::RGBA32F;
- else if (AreEqual(inFormat, "rg"))
- retval = qt3ds::render::NVRenderTextureFormats::RG32F;
- } else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported texture type %s,
- // defaulting to RGBA8", inType );
- }
- }
- return retval;
- }
-
- static inline qt3ds::render::NVRenderTextureMagnifyingOp::Enum
- ConvertFilterToMagOp(const char8_t *inFilter)
- {
- if (AreEqual(inFilter, "linear"))
- return qt3ds::render::NVRenderTextureMagnifyingOp::Linear;
- if (IsTrivial(inFilter) || AreEqual(inFilter, "nearest"))
- return qt3ds::render::NVRenderTextureMagnifyingOp::Nearest;
- else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported filter type %s, defaulting to
- // linear", inFilter );
- return qt3ds::render::NVRenderTextureMagnifyingOp::Linear;
- }
- }
-
- static inline qt3ds::render::NVRenderTextureMinifyingOp::Enum
- ConvertFilterToMinOp(const char8_t *inFilter)
- {
- // we make the decision based on the texture usage
- if (AreEqual(inFilter, "linear"))
- return qt3ds::render::NVRenderTextureMinifyingOp::Linear;
- if (AreEqual(inFilter, "nearest"))
- return qt3ds::render::NVRenderTextureMinifyingOp::Nearest;
- if (AreEqual(inFilter, "linearMipmapLinear"))
- return qt3ds::render::NVRenderTextureMinifyingOp::LinearMipmapLinear;
- if (AreEqual(inFilter, "nearestMipmapNearest"))
- return qt3ds::render::NVRenderTextureMinifyingOp::NearestMipmapNearest;
- if (AreEqual(inFilter, "nearestMipmapLinear"))
- return qt3ds::render::NVRenderTextureMinifyingOp::NearestMipmapLinear;
- if (AreEqual(inFilter, "linearMipmapNearest"))
- return qt3ds::render::NVRenderTextureMinifyingOp::LinearMipmapNearest;
- else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported filter type %s, defaulting
- // to linear", inFilter );
- return qt3ds::render::NVRenderTextureMinifyingOp::Linear;
- }
- }
-
- static inline qt3ds::render::NVRenderTextureCoordOp::Enum
- ConvertTextureCoordOp(const char8_t *inWrap)
- {
- if (IsTrivial(inWrap) || AreEqual(inWrap, "clamp"))
- return qt3ds::render::NVRenderTextureCoordOp::ClampToEdge;
- if (AreEqual(inWrap, "repeat"))
- return qt3ds::render::NVRenderTextureCoordOp::Repeat;
- else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported wrap type %s, defaulting to
- // clamp", inWrap );
- return qt3ds::render::NVRenderTextureCoordOp::ClampToEdge;
- }
- }
-
- static inline qt3ds::render::NVRenderTextureTypeValue::Enum
- ConvertTextureType(const char8_t *inTexType)
- {
- // this usually comes from a MDL description file
- if (IsTrivial(inTexType))
- return qt3ds::render::NVRenderTextureTypeValue::Unknown;
- if (AreEqual(inTexType, "environment"))
- return qt3ds::render::NVRenderTextureTypeValue::Environment;
- if (AreEqual(inTexType, "diffuse"))
- return qt3ds::render::NVRenderTextureTypeValue::Diffuse;
- if (AreEqual(inTexType, "specular"))
- return qt3ds::render::NVRenderTextureTypeValue::Specular;
- if (AreEqual(inTexType, "bump"))
- return qt3ds::render::NVRenderTextureTypeValue::Bump;
- if (AreEqual(inTexType, "displacement"))
- return qt3ds::render::NVRenderTextureTypeValue::Displace;
- if (AreEqual(inTexType, "shadow"))
- return qt3ds::render::NVRenderTextureTypeValue::LightmapShadow;
- if (AreEqual(inTexType, "emissive"))
- return qt3ds::render::NVRenderTextureTypeValue::Emissive;
- if (AreEqual(inTexType, "emissive_mask"))
- return qt3ds::render::NVRenderTextureTypeValue::Emissive2;
- else {
- return qt3ds::render::NVRenderTextureTypeValue::Unknown;
- }
- }
-
- static inline qt3ds::render::NVRenderSrcBlendFunc::Enum
- ConvertToSrcBlendFunc(const char8_t *inFilter)
- {
- if (AreEqual(inFilter, "SrcAlpha"))
- return qt3ds::render::NVRenderSrcBlendFunc::SrcAlpha;
- if (AreEqual(inFilter, "OneMinusSrcAlpha"))
- return qt3ds::render::NVRenderSrcBlendFunc::OneMinusSrcAlpha;
- if (AreEqual(inFilter, "One"))
- return qt3ds::render::NVRenderSrcBlendFunc::One;
- else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported filter type %s, defaulting
- // to linear", inFilter );
- return qt3ds::render::NVRenderSrcBlendFunc::One;
- }
- }
-
- static inline qt3ds::render::NVRenderDstBlendFunc::Enum
- ConvertToDstBlendFunc(const char8_t *inFilter)
- {
- if (AreEqual(inFilter, "SrcAlpha"))
- return qt3ds::render::NVRenderDstBlendFunc::SrcAlpha;
- if (AreEqual(inFilter, "OneMinusSrcAlpha"))
- return qt3ds::render::NVRenderDstBlendFunc::OneMinusSrcAlpha;
- if (AreEqual(inFilter, "One"))
- return qt3ds::render::NVRenderDstBlendFunc::One;
- else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported filter type %s, defaulting
- // to linear", inFilter );
- return qt3ds::render::NVRenderDstBlendFunc::One;
- }
- }
-
- static inline qt3ds::render::NVRenderState::Enum ConvertRenderState(const char8_t *inState)
- {
- if (AreEqual(inState, "Stencil"))
- return qt3ds::render::NVRenderState::StencilTest;
- else {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Unsupported filter type %s, defaulting
- // to linear", inFilter );
- return qt3ds::render::NVRenderState::StencilTest;
- }
- }
-
- static inline qt3ds::render::NVRenderImageAccessType::Enum
- ConvertToImageAccessType(const char8_t *inAccess)
- {
- if (AreEqual(inAccess, "read"))
- return qt3ds::render::NVRenderImageAccessType::Read;
- if (AreEqual(inAccess, "write"))
- return qt3ds::render::NVRenderImageAccessType::Write;
- if (AreEqual(inAccess, "readwrite"))
- return qt3ds::render::NVRenderImageAccessType::ReadWrite;
- else
- QT3DS_ASSERT(false);
-
- return qt3ds::render::NVRenderImageAccessType::ReadWrite;
- }
-
- static inline size_t GetTypeSize(const char8_t *inType)
- {
- if (AreEqual(inType, "uint"))
- return sizeof(QT3DSU32);
- else if (AreEqual(inType, "int"))
- return sizeof(QT3DSI32);
- else if (AreEqual(inType, "uvec4"))
- return sizeof(QT3DSU32) * 4;
- else
- QT3DS_ASSERT(false);
-
- return 1;
- }
-
- inline qt3ds::render::NVRenderBufferBindValues::Enum
- ConvertFormatToBufferBindFlags(const char8_t *inFormat)
- {
- if (AreEqual(inFormat, "storage"))
- return qt3ds::render::NVRenderBufferBindValues::Storage;
- else if (AreEqual(inFormat, "indirect"))
- return qt3ds::render::NVRenderBufferBindValues::Draw_Indirect;
- else
- QT3DS_ASSERT(false);
-
- return qt3ds::render::NVRenderBufferBindValues::Unknown;
- }
-
- static inline void AppendShaderUniform(const char8_t *type, const char8_t *name,
- eastl::string &shaderPrefix)
- {
- shaderPrefix.append("uniform ");
- shaderPrefix.append(type);
- shaderPrefix.append(" ");
- shaderPrefix.append(name);
- shaderPrefix.append(";\n");
- }
- static inline void AppendShaderCode(
- const char8_t *inCode, Qt3DSDMStr &ioStr,
- eastl::basic_string<qt3ds::foundation::TWCharEASTLConverter::TCharType>
- &inConvertBuffer)
- {
- qt3ds::foundation::ConvertUTF(inCode, 0, inConvertBuffer);
- ioStr.append(inConvertBuffer);
- }
- void HideEffectProperty(Qt3DSDMInstanceHandle inInstance, const char8_t *inParamName)
- {
- Qt3DSDMMetaDataPropertyHandle theProp =
- GetSpecificMetaDataProperty(inInstance, Intern(inParamName));
- if (theProp.Valid()) {
- SMetaDataPropertyInfo theInfo = GetMetaDataPropertyInfo(theProp);
- SetMetaDataPropertyInfo(theProp, theInfo.m_Name, theInfo.m_FormalName,
- theInfo.m_Description, theInfo.m_Usage, theInfo.m_CompleteType,
- theInfo.m_DefaultValue, theInfo.m_MetaDataData,
- theInfo.m_GroupName, true, theInfo.m_Animatable,
- theInfo.m_Controllable);
- }
- }
-
- static inline void GetShaderName(const TCharStr &inObjectName,
- const char8_t *inShaderSpecificName,
- eastl::string &outShaderName)
- {
- outShaderName.clear();
- qt3ds::foundation::ConvertUTF(inObjectName.c_str(), 0, outShaderName);
- outShaderName.append(" - ");
- outShaderName.append(inShaderSpecificName);
- }
-
- void LoadDynamicObjectProperties(IDOMReader &inStream, SMetaDataDynamicObjectImpl &ioObject,
- Qt3DSDMInstanceHandle inInstance, const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- eastl::string &shaderPrefix)
- {
- eastl::string vertexUniforms;
- eastl::string fragmentUniforms;
- vertexUniforms += "#ifdef VERTEX_SHADER\n";
- fragmentUniforms += "#ifdef FRAGMENT_SHADER\n";
- using namespace qt3ds::render::dynamic;
- ioObject.m_Properties.clear();
- ioObject.ClearEnumValueNames();
- IDOMReader::Scope __readerScope(inStream);
- if (inStream.MoveToFirstChild("MetaData")) {
- {
- IDOMReader::Scope __readerScope(inStream);
- LoadInstance(inStream, inInstance, inObjectName, outWarnings);
- }
-
- vector<Qt3DSDMMetaDataPropertyHandle> theProperties;
- GetSpecificMetaDataProperties(inInstance, theProperties);
- size_t propIdx = 0, propEnd = theProperties.size();
- for (bool success = inStream.MoveToFirstChild("Property"); success && propIdx < propEnd;
- success = inStream.MoveToNextSibling("Property"), ++propIdx) {
- ioObject.m_Properties.push_back();
- SPropertyDefinition &theNewDefinition = ioObject.m_Properties.back();
- SMetaDataPropertyInfo theInfo(GetMetaDataPropertyInfo(theProperties[propIdx]));
- theNewDefinition.m_Name =
- m_StringTable.GetRenderStringTable().RegisterStr(theInfo.m_Name.c_str());
- const char8_t *xmlName;
- inStream.Att("name", xmlName);
- const char8_t *stage;
- inStream.Att("stage", stage);
- eastl::string uniforms;
- if (AreEqual(xmlName, theNewDefinition.m_Name.c_str())) {
- switch (theInfo.GetDataType()) {
- case DataModelDataType::Bool:
- theNewDefinition.m_DataType =
- qt3ds::render::NVRenderShaderDataTypes::QT3DSRenderBool;
- AppendShaderUniform("bool", theNewDefinition.m_Name.c_str(), uniforms);
- break;
- case DataModelDataType::Long:
- theNewDefinition.m_DataType
- = qt3ds::render::NVRenderShaderDataTypes::QT3DSI32;
- AppendShaderUniform("int", theNewDefinition.m_Name.c_str(), uniforms);
- break;
- case DataModelDataType::Float2:
- theNewDefinition.m_DataType
- = qt3ds::render::NVRenderShaderDataTypes::QT3DSVec2;
- AppendShaderUniform("vec2", theNewDefinition.m_Name.c_str(), uniforms);
- break;
- case DataModelDataType::Float3:
- theNewDefinition.m_DataType
- = qt3ds::render::NVRenderShaderDataTypes::QT3DSVec3;
- AppendShaderUniform("vec3", theNewDefinition.m_Name.c_str(), uniforms);
- break;
- case DataModelDataType::Float4:
- theNewDefinition.m_DataType
- = qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4;
- AppendShaderUniform("vec4", theNewDefinition.m_Name.c_str(), uniforms);
- break;
- case DataModelDataType::String:
- if (theInfo.m_CompleteType == CompleteMetaDataType::Texture) {
- theNewDefinition.m_DataType =
- qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr;
- const char8_t *filter = "linear", *minFilter = "linear",
- *clamp = "clamp", *usage = "", *path = "";
- if (inStream.Att("filter", filter))
- theNewDefinition.m_MagFilterOp = ConvertFilterToMagOp(filter);
- if (inStream.Att("minfilter", minFilter))
- theNewDefinition.m_MinFilterOp = ConvertFilterToMinOp(minFilter);
- if (inStream.Att("clamp", clamp))
- theNewDefinition.m_CoordOp = ConvertTextureCoordOp(clamp);
- if (inStream.Att("usage", usage))
- theNewDefinition.m_TexUsageType = ConvertTextureType(usage);
- if (inStream.Att("default", path)) {
- TDataStrPtr theDataStr(
- theInfo.m_DefaultValue.getData<TDataStrPtr>());
- theNewDefinition.m_ImagePath =
- m_StringTable.GetRenderStringTable().RegisterStr(
- theDataStr->GetData());
- }
-
- // Output macro so we can change the set of variables used for this
- // independent of the
- // meta data system.
- uniforms.append("SNAPPER_SAMPLER2D(");
- uniforms.append(theNewDefinition.m_Name.c_str());
- uniforms.append(", ");
- uniforms.append(theNewDefinition.m_Name.c_str());
- uniforms.append(", ");
- uniforms.append(filter);
- uniforms.append(", ");
- uniforms.append(clamp);
- uniforms.append(", ");
- uniforms.append("false )\n");
- } else if (theInfo.m_CompleteType == CompleteMetaDataType::StringList) {
- theNewDefinition.m_DataType =
- qt3ds::render::NVRenderShaderDataTypes::QT3DSI32;
- const TMetaDataStringList &theList =
- qt3dsdm::get<TMetaDataStringList>(theInfo.m_MetaDataData);
- ioObject.m_EnumValueNames.push_back(
- new eastl::vector<qt3ds::foundation::CRegisteredString>());
- eastl::vector<qt3ds::foundation::CRegisteredString> &theBack =
- *ioObject.m_EnumValueNames.back();
- for (QT3DSU32 idx = 0, end = (QT3DSU32)theList.size(); idx < end; ++idx)
- theBack.push_back(m_StringTable.GetRenderStringTable().RegisterStr(
- theList[idx].c_str()));
- theNewDefinition.m_EnumValueNames = VecToCRef(theBack);
- theNewDefinition.m_IsEnumProperty = true;
- AppendShaderUniform("int", theNewDefinition.m_Name.c_str(),
- uniforms);
- } else if (theInfo.m_CompleteType == CompleteMetaDataType::Image2D) {
- theNewDefinition.m_DataType =
- qt3ds::render::NVRenderShaderDataTypes::NVRenderImage2DPtr;
- const char8_t *format = "", *binding = "", *access = "readonly";
- uniforms.append("layout(");
- inStream.Att("format", format);
- uniforms.append(format);
- if (inStream.Att("binding", binding)) {
- uniforms.append(", binding = ");
- uniforms.append(binding);
- }
- uniforms.append(") ");
-
- // if we have format layout we cannot set an additional access qualifier
- if (inStream.Att("access", access) && !AreEqual(format, ""))
- uniforms.append(access);
-
- uniforms.append(" uniform image2D ");
- uniforms.append(theNewDefinition.m_Name.c_str());
- uniforms.append(";\n");
- } else if (theInfo.m_CompleteType == CompleteMetaDataType::Buffer) {
- theNewDefinition.m_DataType =
- qt3ds::render::NVRenderShaderDataTypes::NVRenderDataBufferPtr;
- const char8_t *align = "std140", *usage = "storage", *binding = "",
- *format = "float";
- uniforms.append("layout(");
-
- inStream.Att("format", format);
- inStream.Att("usage", usage);
- if (AreEqual(usage, "storage")) {
- inStream.Att("align", align);
- uniforms.append(align);
-
- if (inStream.Att("binding", binding)) {
- uniforms.append(", binding = ");
- uniforms.append(binding);
- }
-
- uniforms.append(") ");
-
- uniforms.append("buffer ");
- uniforms.append(theNewDefinition.m_Name.c_str());
- uniforms.append("\n{ \n");
- uniforms.append(format);
- uniforms.append(" ");
- uniforms.append(theNewDefinition.m_Name.c_str());
- uniforms.append("_data[]; \n};\n");
- } else {
- // currently we only handle storage counters
- QT3DS_ASSERT(false);
- }
- }
- break;
- default:
- QT3DS_ASSERT(false);
- // Fallthrough intentional
- case DataModelDataType::Float:
- theNewDefinition.m_DataType = qt3ds::render::NVRenderShaderDataTypes::QT3DSF32;
- AppendShaderUniform("float", theNewDefinition.m_Name.c_str(), uniforms);
- break;
- }
- } else {
- // It is conceivable that we not every property tag gets parsed into a property.
- QT3DS_ASSERT(false);
- // So we will bump to the next item and try again.
- --propIdx;
- }
-
- if (AreEqual(stage, "vertex")) {
- vertexUniforms += uniforms;
- } else if (AreEqual(stage, "fragment")) {
- fragmentUniforms += uniforms;
- } else {
- vertexUniforms += uniforms;
- fragmentUniforms += uniforms;
- }
- }
- }
- vertexUniforms += "#endif\n";
- fragmentUniforms += "#endif\n";
- shaderPrefix.append(vertexUniforms);
- shaderPrefix.append(fragmentUniforms);
- }
-
- void LoadDynamicObjectShaders(IDOMReader &inStream, SMetaDataDynamicObjectImpl &ioObject,
- eastl::string &shaderPrefix, const TCharStr &inObjectName)
- {
- eastl::string theShaderNameStr;
- eastl::string theShaderTypeStr;
- eastl::string theShaderVersionStr;
- {
- IDOMReader::Scope __readerScope(inStream);
- eastl::basic_string<qt3ds::foundation::TWCharEASTLConverter::TCharType> theConvertBuffer;
- if (inStream.MoveToFirstChild("Shaders")) {
- const char8_t *globalShared = "";
- const char8_t *globalVertexShared = "";
- const char8_t *globalFragmentShared = "";
- inStream.ChildValue("Shared", globalShared);
- inStream.ChildValue("VertexShaderShared", globalVertexShared);
- inStream.ChildValue("FragmentShaderShared", globalFragmentShared);
-
- inStream.Att("type", theShaderTypeStr); // can be empty
- inStream.Att("version", theShaderVersionStr); // can be empty
-
- for (bool success = inStream.MoveToFirstChild(); success;
- success = inStream.MoveToNextSibling()) {
- IDOMReader::Scope __shaderScope(inStream);
- const char8_t *elemName = inStream.GetNarrowElementName();
- // If this is neither a compute shader nor a normal shader, go on and ignore
- // element.
- if (!(AreEqual(elemName, "Shader") || AreEqual(elemName, "ComputeShader")))
- continue;
-
- ioObject.m_Shaders.push_back();
- SMetaDataShader &theShader = ioObject.m_Shaders.back();
-
- qt3ds::foundation::ConvertUTF(theShaderTypeStr.c_str(), theShaderTypeStr.size(),
- theShader.m_Type);
- qt3ds::foundation::ConvertUTF(theShaderVersionStr.c_str(),
- theShaderVersionStr.size(), theShader.m_Version);
- const char8_t *theName = "";
- char8_t theITOABuffer[64] = { 0 };
- if (!inStream.Att("name", theName)) {
- sprintf(theITOABuffer, "%d", (int)ioObject.m_Shaders.size() - 1);
- theName = theITOABuffer;
- }
- GetShaderName(inObjectName, theName, theShaderNameStr);
- qt3ds::foundation::ConvertUTF(theShaderNameStr.c_str(), theShaderNameStr.size(),
- theShader.m_Name);
-
- if (AreEqual(elemName, "Shader")) {
- const char8_t *shaderShared = "";
- inStream.ChildValue("Shared", shaderShared);
- const char8_t *vertexCode = "";
- inStream.ChildValue("VertexShader", vertexCode);
- if (IsTrivial(vertexCode))
- vertexCode = "void vert(){}";
- const char8_t *fragmentCode = "void frag(){}";
- inStream.ChildValue("FragmentShader", fragmentCode);
- if (IsTrivial(fragmentCode))
- fragmentCode = "void frag(){}";
- const char8_t *geomCode = "";
- inStream.ChildValue("GeometryShader", geomCode);
-
- AppendShaderCode(shaderPrefix.c_str(), theShader.m_Code, theConvertBuffer);
- AppendShaderCode(globalShared, theShader.m_Code, theConvertBuffer);
- AppendShaderCode(shaderShared, theShader.m_Code, theConvertBuffer);
- AppendShaderCode("\n#ifdef VERTEX_SHADER\n", theShader.m_Code,
- theConvertBuffer);
- AppendShaderCode(globalVertexShared, theShader.m_Code, theConvertBuffer);
- AppendShaderCode(vertexCode, theShader.m_Code, theConvertBuffer);
- AppendShaderCode("\n#endif\n", theShader.m_Code, theConvertBuffer);
- if (!IsTrivial(geomCode)) {
- AppendShaderCode("\n#ifdef USER_GEOMETRY_SHADER\n", theShader.m_Code,
- theConvertBuffer);
- AppendShaderCode(geomCode, theShader.m_Code, theConvertBuffer);
- AppendShaderCode("\n#endif\n", theShader.m_Code, theConvertBuffer);
- theShader.m_HasGeomShader = true;
- }
- AppendShaderCode("\n#ifdef FRAGMENT_SHADER\n", theShader.m_Code,
- theConvertBuffer);
- AppendShaderCode(globalFragmentShared, theShader.m_Code, theConvertBuffer);
- AppendShaderCode(fragmentCode, theShader.m_Code, theConvertBuffer);
- AppendShaderCode("\n#endif\n", theShader.m_Code, theConvertBuffer);
- } else if (AreEqual(elemName, "ComputeShader")) {
- const char8_t *shaderCode = "";
- inStream.Value(shaderCode);
- theShader.m_IsComputeShader = true;
- AppendShaderCode(shaderCode, theShader.m_Code, theConvertBuffer);
- }
- }
- }
- }
- }
-
- static size_t Align(size_t inValue)
- {
- if (inValue % 4)
- return inValue + (4 - (inValue % 4));
- return inValue;
- }
-
- static qt3ds::render::dynamic::SDepthStencilFlags ParseDepthStencilFlags(const char8_t *inFlags)
- {
- eastl::string parseStr(inFlags);
- eastl::string tokenStr;
- qt3ds::render::dynamic::SDepthStencilFlags retval;
- for (uint32_t pos = parseStr.find('|'); parseStr.empty() == false;
- pos = parseStr.find('|')) {
- if (pos != eastl::string::npos) {
- tokenStr = parseStr.substr(pos);
- parseStr.erase(parseStr.begin(), parseStr.begin() + pos + 1);
- } else {
- tokenStr = parseStr;
- parseStr.clear();
- }
- if (AreEqual(tokenStr.c_str(), "clear-stencil"))
- retval |= qt3ds::render::dynamic::DepthStencilFlagValues::ClearStencil;
- if (AreEqual(tokenStr.c_str(), "clear-depth"))
- retval |= qt3ds::render::dynamic::DepthStencilFlagValues::ClearDepth;
- }
- return retval;
- }
-
- static qt3ds::render::NVRenderBoolOp::Enum ParseBoolOp(const char8_t *inOp)
- {
- if (AreEqual(inOp, "never"))
- return qt3ds::render::NVRenderBoolOp::Never;
- if (AreEqual(inOp, "less"))
- return qt3ds::render::NVRenderBoolOp::Less;
- if (AreEqual(inOp, "less-than-or-equal"))
- return qt3ds::render::NVRenderBoolOp::LessThanOrEqual;
- if (AreEqual(inOp, "equal"))
- return qt3ds::render::NVRenderBoolOp::Equal;
- if (AreEqual(inOp, "not-equal"))
- return qt3ds::render::NVRenderBoolOp::NotEqual;
- if (AreEqual(inOp, "greater"))
- return qt3ds::render::NVRenderBoolOp::Greater;
- if (AreEqual(inOp, "greater-than-or-equal"))
- return qt3ds::render::NVRenderBoolOp::GreaterThanOrEqual;
- if (AreEqual(inOp, "always"))
- return qt3ds::render::NVRenderBoolOp::AlwaysTrue;
-
- QT3DS_ASSERT(false);
- return qt3ds::render::NVRenderBoolOp::Unknown;
- }
-
- static qt3ds::render::NVRenderStencilOp::Enum ParseStencilOp(const char8_t *inOp)
- {
-
- if (AreEqual(inOp, "keep"))
- return qt3ds::render::NVRenderStencilOp::Keep;
- if (AreEqual(inOp, "zero"))
- return qt3ds::render::NVRenderStencilOp::Zero;
- if (AreEqual(inOp, "replace"))
- return qt3ds::render::NVRenderStencilOp::Replace;
- if (AreEqual(inOp, "increment"))
- return qt3ds::render::NVRenderStencilOp::Increment;
- if (AreEqual(inOp, "increment-wrap"))
- return qt3ds::render::NVRenderStencilOp::IncrementWrap;
- if (AreEqual(inOp, "decrement"))
- return qt3ds::render::NVRenderStencilOp::Decrement;
- if (AreEqual(inOp, "decrement-wrap"))
- return qt3ds::render::NVRenderStencilOp::DecrementWrap;
- if (AreEqual(inOp, "invert"))
- return qt3ds::render::NVRenderStencilOp::Invert;
-
- QT3DS_ASSERT(false);
- return qt3ds::render::NVRenderStencilOp::Unknown;
- }
-
- // Reloads an effect if one is already loaded so we can replace the existing effect definition
- void LoadEffectXML(IDOMReader &inStream, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- const TCharStr &inSourcePath) override
- {
- using namespace qt3ds::render::dynamic;
- std::pair<TEffectMap::iterator, bool> theInserter =
- m_EffectMap.insert(std::make_pair(Intern(inObjectName), SMetaDataEffectImpl()));
- /*if ( inStream.MoveToFirstChild( "Effect" ) == false )
- {
- outWarnings.push_back( SMetaDataLoadWarning( MetaDataLoadWarningType::Unknown,
- MetaDataLoadWarningMessage::GeneralError, L"File doesn't appear to be an effect xml file,
- missing top level Effect tag" ) );
- return;
- }*/
- eastl::string shaderPrefix = "#include \"effect.glsllib\"\n";
-
- SMetaDataEffectImpl &theEffect = theInserter.first->second;
- m_ObjectName = inObjectName;
- theEffect.m_Name = inObjectName;
- theEffect.m_SourcePath = inSourcePath;
- theEffect.ClearEffectCommands();
- LoadDynamicObjectProperties(inStream, theEffect, inInstance, inObjectName, outWarnings,
- shaderPrefix);
- theEffect.m_Shaders.clear();
- LoadDynamicObjectShaders(inStream, theEffect, shaderPrefix, inObjectName);
- eastl::string theShaderNameStr;
- {
- IDOMReader::Scope __readerScope(inStream);
- if (inStream.MoveToFirstChild("Passes")) {
- for (bool success = inStream.MoveToFirstChild(); success;
- success = inStream.MoveToNextSibling()) {
- IDOMReader::Scope __passScope(inStream);
- if (AreEqual("Pass", inStream.GetNarrowElementName())) {
- bool drawIndirect = false;
- const char8_t *shader = "", *input = "[source]", *output = "[dest]",
- *outputFormat = "rgba";
- inStream.Att("shader", shader);
- inStream.Att("input", input);
- inStream.Att("output", output);
- // this is only for the final output of the effect
- inStream.Att("format", outputFormat);
- qt3ds::render::NVRenderTextureFormats::Enum theOutputFormat =
- ConvertTypeAndFormatToTextureFormat("ubyte", outputFormat);
- if (AreEqual(output, "[dest]") || IsTrivial(output))
- theEffect.m_EffectCommands.push_back(new SBindTarget(theOutputFormat));
- else
- theEffect.m_EffectCommands.push_back(
- new SBindBuffer(
- m_StringTable.GetRenderStringTable().RegisterStr(output),
- false));
- GetShaderName(inObjectName, shader, theShaderNameStr);
- theEffect.m_EffectCommands.push_back(
- new SBindShader(m_StringTable.GetRenderStringTable().RegisterStr(
- theShaderNameStr.c_str())));
- theEffect.m_EffectCommands.push_back(new SApplyInstanceValue());
- if (AreEqual(input, "[source]") || IsTrivial(input))
- theEffect.m_EffectCommands.push_back(
- new SApplyBufferValue(
- m_StringTable.GetRenderStringTable().RegisterStr(""),
- m_StringTable.GetRenderStringTable().RegisterStr("")));
- else
- theEffect.m_EffectCommands.push_back(
- new SApplyBufferValue(
- m_StringTable.GetRenderStringTable().RegisterStr(input),
- m_StringTable.GetRenderStringTable().RegisterStr("")));
- for (bool bufParam = inStream.MoveToFirstChild(); bufParam;
- bufParam = inStream.MoveToNextSibling()) {
- if (AreEqual("BufferInput", inStream.GetNarrowElementName())) {
- const char8_t *param = "";
- const char8_t *value = "";
- inStream.Att("param", param);
- inStream.Att("value", value);
- if (AreEqual("[source]", value))
- value = "";
- theEffect.m_EffectCommands.push_back(
- new SApplyBufferValue(
- m_StringTable.GetRenderStringTable().RegisterStr(
- value),
- m_StringTable.GetRenderStringTable().RegisterStr(
- param)));
- HideEffectProperty(inInstance, param);
- } else if (AreEqual("DepthInput", inStream.GetNarrowElementName())) {
- const char8_t *param = "";
- inStream.Att("param", param);
- theEffect.m_EffectCommands.push_back(
- new SApplyDepthValue(
- m_StringTable.GetRenderStringTable().RegisterStr(
- param)));
- HideEffectProperty(inInstance, param);
- } else if (AreEqual("ImageInput", inStream.GetNarrowElementName())) {
- bool useAsTexture = false;
- bool needSync = false;
- const char8_t *param = "";
- const char8_t *value = "";
- const char8_t *usage = "";
- const char8_t *sync = "";
- inStream.Att("param", param);
- inStream.Att("value", value);
- if (AreEqual("[source]", value))
- value = "";
- inStream.Att("usage", usage);
- if (AreEqual("texture", usage))
- useAsTexture = true;
- inStream.Att("sync", sync);
- if (AreEqual("true", sync))
- needSync = true;
-
- theEffect.m_EffectCommands.push_back(
- new SApplyImageValue(
- m_StringTable.GetRenderStringTable().RegisterStr(
- value),
- m_StringTable.GetRenderStringTable().RegisterStr(
- param), useAsTexture, needSync));
- HideEffectProperty(inInstance, param);
- } else if (AreEqual("DataBufferInput",
- inStream.GetNarrowElementName())) {
- const char8_t *param = "";
- const char8_t *usage = "";
- inStream.Att("param", param);
- inStream.Att("usage", usage);
- qt3ds::render::NVRenderBufferBindValues::Enum bufType =
- ConvertFormatToBufferBindFlags(usage);
-
- // check if we using an indirect buffer for drawing
- if (bufType == qt3ds::render::NVRenderBufferBindValues::Draw_Indirect)
- drawIndirect = true;
-
- theEffect.m_EffectCommands.push_back(
- new SApplyDataBufferValue(
- m_StringTable.GetRenderStringTable().RegisterStr(
- param), bufType));
- HideEffectProperty(inInstance, param);
- } else if (AreEqual("SetParam", inStream.GetNarrowElementName())) {
- const char8_t *name = "";
- inStream.Att("name", name);
- const char8_t *value = "";
- inStream.Att("value", value);
- // find the param and the type.
- qt3ds::foundation::CRegisteredString propName =
- m_StringTable.GetRenderStringTable().RegisterStr(name);
- qt3ds::render::dynamic::SPropertyDefinition *theDefinition = NULL;
- for (uint32_t propIdx = 0, propEnd = theEffect.m_Properties.size();
- propIdx < propEnd && theDefinition == NULL; ++propIdx) {
- if (theEffect.m_Properties[propIdx].m_Name == propName)
- theDefinition = &theEffect.m_Properties[propIdx];
- }
- if (theDefinition != NULL) {
- // Hack it for now because the shader datatypes don't have a
- // built in sizeof operator.
- QT3DSU32 valueSize = 4;
- qt3ds::render::NVRenderShaderDataTypes::Enum theDataType =
- theDefinition->m_DataType;
- size_t allocSize = sizeof(SApplyValue) + valueSize;
- QT3DSU8 *theCommandData = (QT3DSU8 *)malloc(allocSize);
- QT3DSU8 *theValueData = theCommandData + sizeof(SApplyValue);
- new (theCommandData) SApplyValue(propName, theDataType);
- SApplyValue *theCommand =
- reinterpret_cast<SApplyValue *>(theCommandData);
- switch (theDataType) {
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSRenderBool: {
- bool &target = *reinterpret_cast<bool *>(theValueData);
- qt3ds::foundation::StringConversion<bool>().StrTo(value,
- target);
- } break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSI32: {
- QT3DSI32 &target = *reinterpret_cast<QT3DSI32 *>(
- theValueData);
- qt3ds::foundation::StringConversion<QT3DSI32>().StrTo(
- value, target);
- } break;
- default:
- QT3DS_ASSERT(false);
- // Fallthrough intentional
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSF32: {
- QT3DSF32 &target = *reinterpret_cast<QT3DSF32 *>(
- theValueData);
- qt3ds::foundation::StringConversion<QT3DSF32>().StrTo(
- value, target);
- } break;
- }
- theCommand->m_Value = NVDataRef<QT3DSU8>(theValueData,
- valueSize);
- theEffect.m_EffectCommands.push_back(theCommand);
- }
- } else if (AreEqual("Blending", inStream.GetNarrowElementName())) {
- const char8_t *theSrcBlendFuncStr = "", *theDestBlendFuncStr = "";
- inStream.Att("source", theSrcBlendFuncStr);
- inStream.Att("dest", theDestBlendFuncStr);
-
- qt3ds::render::NVRenderSrcBlendFunc::Enum theSrcBlendFunc =
- ConvertToSrcBlendFunc(theSrcBlendFuncStr);
- qt3ds::render::NVRenderDstBlendFunc::Enum theDstBlendFuc =
- ConvertToDstBlendFunc(theDestBlendFuncStr);
-
- // this will setup blending
- theEffect.m_EffectCommands.push_back(
- new SApplyBlending(theSrcBlendFunc, theDstBlendFuc));
- } else if (AreEqual("RenderState", inStream.GetNarrowElementName())) {
- const char8_t *name = "";
- inStream.Att("name", name);
- const char8_t *value = "";
- inStream.Att("value", value);
- // find the param and the type.
- bool theStateEnable = false;
- qt3ds::render::NVRenderState::Enum theState
- = ConvertRenderState(name);
- if (AreEqual("true", value))
- theStateEnable = true;
-
- // this will setup blending
- theEffect.m_EffectCommands.push_back(
- new SApplyRenderState(theState, theStateEnable));
- } else if (AreEqual("DepthStencil", inStream.GetNarrowElementName())) {
- const char8_t *bufferName = "";
- inStream.Att("buffer", bufferName);
- QT3DSU32 stencilvalue = 0;
- inStream.Att("reference", stencilvalue);
- const char8_t *flags = "";
- inStream.Att("flags", flags);
- QT3DSU32 mask = QT3DS_MAX_U32;
- inStream.Att("mask", mask);
- qt3ds::render::NVRenderBoolOp::Enum stencilFunction =
- qt3ds::render::NVRenderBoolOp::Equal;
- qt3ds::render::NVRenderStencilOp::Enum stencilFailOperation =
- qt3ds::render::NVRenderStencilOp::Keep;
- qt3ds::render::NVRenderStencilOp::Enum depthPass =
- qt3ds::render::NVRenderStencilOp::Keep;
- qt3ds::render::NVRenderStencilOp::Enum depthFail =
- qt3ds::render::NVRenderStencilOp::Keep;
- const char8_t *temp;
- if (inStream.Att("stencil-fail", temp))
- stencilFailOperation = ParseStencilOp(temp);
- if (inStream.Att("depth-pass", temp))
- depthPass = ParseStencilOp(temp);
- if (inStream.Att("depth-fail", temp))
- depthFail = ParseStencilOp(temp);
- if (inStream.Att("stencil-function", temp))
- stencilFunction = ParseBoolOp(temp);
-
- qt3ds::render::dynamic::SDepthStencilFlags flagValues =
- ParseDepthStencilFlags(flags);
- theEffect.m_EffectCommands.push_back(
- new SDepthStencil(
- m_StringTable.GetRenderStringTable().RegisterStr(
- bufferName), flagValues, stencilFailOperation,
- depthPass, depthFail, stencilFunction, stencilvalue,
- mask));
- } else {
- QT3DS_ASSERT(false);
- }
- }
- theEffect.m_EffectCommands.push_back(new SRender(drawIndirect));
- } else if (AreEqual("Buffer", inStream.GetNarrowElementName())
- || AreEqual("Image", inStream.GetNarrowElementName())) {
- SAllocateBufferFlags theFlags;
- const char8_t *theLifetimeStr = "", *theType = "", *theFormat = "",
- *theFilter = "", *theWrap = "", *theName = "";
- QT3DSF32 theSize = 1.0f;
- bool isImage = AreEqual("Image", inStream.GetNarrowElementName());
- inStream.Att("name", theName);
- inStream.Att("lifetime", theLifetimeStr);
- inStream.Att("type", theType);
- inStream.Att("format", theFormat);
- inStream.Att("filter", theFilter);
- inStream.Att("wrap", theWrap);
- inStream.Att("size", theSize);
- // Clamp the size to valid amounts
- if (theSize <= 0)
- theSize = 1.0f;
- if (theSize > 1.0f)
- theSize = 1.0f;
- if (AreEqual(theLifetimeStr, "scene"))
- theFlags.SetSceneLifetime(true);
- qt3ds::render::NVRenderTextureFormats::Enum theTexFormat =
- ConvertTypeAndFormatToTextureFormat(theType, theFormat);
- qt3ds::render::NVRenderTextureMagnifyingOp::Enum theMagOp =
- ConvertFilterToMagOp(theFilter);
- qt3ds::render::NVRenderTextureCoordOp::Enum theCoordOp =
- ConvertTextureCoordOp(theWrap);
- if (*theName == 0) {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Buffer is missing its
- // name" );
- } else if (isImage) {
- const char8_t *temp;
- qt3ds::render::NVRenderImageAccessType::Enum theAccess =
- qt3ds::render::NVRenderImageAccessType::ReadWrite;
- if (inStream.Att("access", temp))
- theAccess = ConvertToImageAccessType(temp);
-
- theEffect.m_EffectCommands.push_back(
- new SAllocateImage(
- m_StringTable.GetRenderStringTable().RegisterStr(
- theName), theTexFormat, theMagOp, theCoordOp,
- theSize, theFlags, theAccess));
- } else {
- theEffect.m_EffectCommands.push_back(
- new SAllocateBuffer(
- m_StringTable.GetRenderStringTable().RegisterStr(
- theName), theTexFormat, theMagOp, theCoordOp,
- theSize, theFlags));
- }
- } else if (AreEqual("DataBuffer", inStream.GetNarrowElementName())) {
- SAllocateBufferFlags theFlags;
- const char8_t *theLifetimeStr = "", *theType = "", *theWrapName = "",
- *theWrapType = "", *theFormat = "", *theName = "";
- QT3DSF32 theSize = 1.0f;
- qt3ds::render::NVRenderBufferBindValues::Enum bufType,
- wrapBufType = qt3ds::render::NVRenderBufferBindValues::Unknown;
-
- inStream.Att("name", theName);
- inStream.Att("lifetime", theLifetimeStr);
- inStream.Att("type", theType);
- inStream.Att("format", theFormat);
- inStream.Att("size", theSize);
- if (AreEqual(theLifetimeStr, "scene"))
- theFlags.SetSceneLifetime(true);
- bufType = ConvertFormatToBufferBindFlags(theType);
-
- if (inStream.Att("wrapType", theWrapType)) {
- wrapBufType = ConvertFormatToBufferBindFlags(theWrapType);
- inStream.Att("wrapName", theWrapName);
- if (*theWrapName == 0)
- QT3DS_ASSERT(false);
- }
-
- theSize *= GetTypeSize(theFormat);
-
- if (theSize <= 0)
- theSize = 1.0f;
-
- if (*theName == 0) {
- QT3DS_ASSERT(false);
- } else {
- theEffect.m_EffectCommands.push_back(
- new SAllocateDataBuffer(
- m_StringTable.GetRenderStringTable().RegisterStr(
- theName), bufType,
- m_StringTable.GetRenderStringTable().RegisterStr(
- theWrapName), wrapBufType, theSize, theFlags));
- }
- } else {
- QT3DS_ASSERT(false); // Unrecognized effect passes member.
- }
- }
-
- } else {
- if (theEffect.m_Shaders.size()) {
- // Create the minimal set of commands that we could run the first shader with.
- theEffect.m_EffectCommands.push_back(new SBindTarget());
- theEffect.m_EffectCommands.push_back(
- new SBindShader(m_StringTable.GetRenderStringTable().RegisterStr(
- theEffect.m_Shaders[0].m_Name.c_str())));
- theEffect.m_EffectCommands.push_back(new SApplyInstanceValue());
- theEffect.m_EffectCommands.push_back(new SRender(false));
- }
- }
- }
- }
-
- bool LoadEffectXMLFromSourcePath(const char *inSourcePath,
- Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) override
- {
- std::shared_ptr<IDOMFactory> theFactory(
- IDOMFactory::CreateDOMFactory(m_DataCore->GetStringTablePtr()));
- qt3dsdm::SDOMElement *theElem = CDOMSerializer::Read(*theFactory, inStream, NULL);
- if (theElem != NULL) {
- std::shared_ptr<IDOMReader> theReader(
- IDOMReader::CreateDOMReader(*theElem, m_DataCore->GetStringTablePtr(),
- theFactory));
- LoadEffectXML(*theReader, inInstance, inObjectName, outWarnings,
- TCharStr(Intern(inSourcePath)));
- return true;
- }
- return false;
- }
-
- Option<SMetaDataEffect> GetEffectBySourcePath(const char *inSourcePath) override
- {
- QDir sourcePath = QDir::cleanPath(QString(inSourcePath));
- for (TEffectMap::iterator iter = m_EffectMap.begin(), end = m_EffectMap.end(); iter != end;
- ++iter) {
- QDir effectPath = QDir::cleanPath(QString::fromWCharArray(
- iter->second.m_SourcePath.wide_str()));
- if (effectPath == sourcePath)
- return iter->second.ToEffect();
- }
- return Empty();
- }
-
- void LoadMaterialInstance(const char *inShaderFile, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) override
- {
- QString shaderFile(inShaderFile);
- if (shaderFile.endsWith(".material") || shaderFile.endsWith(".shader")) {
- LoadMaterialClassFromSourcePath(inShaderFile, inInstance, inName, outWarnings,
- inStream);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- bool IsMaterialClassRegistered(const char *inName) override
- {
- return m_CustomMaterials.find(Intern(inName)) != m_CustomMaterials.end();
- }
-
- void LoadMaterialClassXML(IDOMReader &inStream, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- const TCharStr &inSourcePath) override
- {
- using namespace qt3ds::render::dynamic;
-
- std::pair<TCustomMaterialMap::iterator, bool> theInserter = m_CustomMaterials.insert(
- std::make_pair(Intern(inObjectName), SMetaDataCustomMaterialImpl()));
- /*if ( inStream.MoveToFirstChild( "Effect" ) == false )
- {
- outWarnings.push_back( SMetaDataLoadWarning( MetaDataLoadWarningType::Unknown,
- MetaDataLoadWarningMessage::GeneralError, L"File doesn't appear to be an effect xml file,
- missing top level Effect tag" ) );
- return;
- }*/
- eastl::string shaderPrefix = "#include \"customMaterial.glsllib\"\n";
-
- SMetaDataCustomMaterialImpl &theMaterial = theInserter.first->second;
- m_ObjectName = inObjectName;
- theMaterial.m_Name = inObjectName;
- theMaterial.m_SourcePath = inSourcePath;
- theMaterial.m_HasTransparency = false;
- theMaterial.m_HasRefraction = false;
- theMaterial.m_AlwaysDirty = false;
- theMaterial.m_ShaderKey = 0;
- theMaterial.m_LayerCount = 0;
- inStream.Att("always-dirty", theMaterial.m_AlwaysDirty);
- LoadDynamicObjectProperties(inStream, theMaterial, inInstance, inObjectName, outWarnings,
- shaderPrefix);
- LoadDynamicObjectShaders(inStream, theMaterial, shaderPrefix, inObjectName);
-
- // currently single pass shader only
- if (theMaterial.m_Shaders.size()) {
- eastl::string theShaderNameStr;
-
- // in Passes we store additional render commands
- IDOMReader::Scope __readerScope(inStream);
- if (inStream.MoveToFirstChild("Passes")) {
- for (bool success = inStream.MoveToFirstChild(); success;
- success = inStream.MoveToNextSibling()) {
- IDOMReader::Scope __passScope(inStream);
- if (AreEqual("Pass", inStream.GetNarrowElementName())) {
- const char8_t *typeStr;
- if (!inStream.UnregisteredAtt("type", typeStr))
- typeStr = "render";
- if (AreEqual(typeStr, "render")) {
- const char8_t *shader = "", *input = "[source]", *output = "[dest]",
- *outputFormat = "rgba", *clear = "";
- bool needsClear = false;
- inStream.Att("shader", shader);
- inStream.Att("input", input);
- inStream.Att("output", output);
- // for multi pass materials
- inStream.Att("clear", clear);
- if (AreEqual("true", clear))
- needsClear = true;
-
- GetShaderName(inObjectName, shader, theShaderNameStr);
- // this is only for the final output of the effect
- inStream.Att("format", outputFormat);
- qt3ds::render::NVRenderTextureFormats::Enum theOutputFormat =
- ConvertTypeAndFormatToTextureFormat("ubyte", outputFormat);
-
- if (AreEqual(output, "[dest]") || IsTrivial(output)) {
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SBindTarget(theOutputFormat));
- } else {
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SBindBuffer(
- m_StringTable.GetRenderStringTable().RegisterStr(
- output), needsClear));
- }
-
- // add shader to command stream
- qt3ds::render::CRegisteredString theShaderName;
- if (!IsTrivial(shader)) {
- for (QT3DSU32 idx = 0, end = theMaterial.m_Shaders.size();
- idx < end && theShaderName.IsValid() == false; ++idx) {
- qt3ds::render::CRegisteredString thePossibleNameStr =
- m_StringTable.GetRenderStringTable().RegisterStr(
- theMaterial.m_Shaders[idx].m_Name.c_str());
- if (AreEqual(thePossibleNameStr.c_str(),
- theShaderNameStr.c_str()))
- theShaderName = thePossibleNameStr;
- }
- }
- if (theShaderName.IsValid() == false
- && theMaterial.m_Shaders.empty() == false)
- theShaderName = m_StringTable.GetRenderStringTable().RegisterStr(
- theMaterial.m_Shaders[0].m_Name.c_str());
- if (theShaderName.IsValid()) {
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SBindShader(theShaderName));
- // this is a place holder for our input values to the shader
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SApplyInstanceValue());
-
- for (bool bufParam = inStream.MoveToFirstChild(); bufParam;
- bufParam = inStream.MoveToNextSibling()) {
- if (AreEqual("BufferBlit", inStream.GetNarrowElementName())) {
- const char8_t *value = "";
- const char8_t *dest = "";
- const char8_t *source = "";
- inStream.Att("dest", dest);
- if (AreEqual("[dest]", dest))
- value = "";
- inStream.Att("source", source);
- if (AreEqual("[source]", source))
- value = "";
-
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SApplyBlitFramebuffer(
- m_StringTable.GetRenderStringTable().RegisterStr(
- source),
- m_StringTable.GetRenderStringTable().RegisterStr(
- dest)));
-
- // note need a better way to pass information from MDL to
- // our input
- // We use buffer blits to simulate glass refraction
- theMaterial.m_HasRefraction = true;
- } else if (AreEqual("BufferInput",
- inStream.GetNarrowElementName())) {
- const char8_t *param = "";
- const char8_t *value = "";
- inStream.Att("param", param);
- inStream.Att("value", value);
- if (AreEqual("[source]", value))
- value = "";
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SApplyBufferValue(
- m_StringTable.GetRenderStringTable().RegisterStr(
- value),
- m_StringTable.GetRenderStringTable().RegisterStr(
- param)));
- HideEffectProperty(inInstance, param);
- } else if (AreEqual("Blending",
- inStream.GetNarrowElementName())) {
- const char8_t *theSrcBlendFuncStr = "",
- *theDestBlendFuncStr = "";
- inStream.Att("source", theSrcBlendFuncStr);
- inStream.Att("dest", theDestBlendFuncStr);
-
- qt3ds::render::NVRenderSrcBlendFunc::Enum theSrcBlendFunc =
- ConvertToSrcBlendFunc(theSrcBlendFuncStr);
- qt3ds::render::NVRenderDstBlendFunc::Enum theDstBlendFuc =
- ConvertToDstBlendFunc(theDestBlendFuncStr);
-
- // this will setup blending
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SApplyBlending(theSrcBlendFunc,
- theDstBlendFuc));
- // if we have blending we have transparency
- theMaterial.m_HasTransparency = true;
- } else if (AreEqual("RenderState",
- inStream.GetNarrowElementName())) {
- // UdoL Todo: add this one
- }
- }
- }
- // add the render command as last thing in the pass, it is a render
- // pass.
- theMaterial.m_CustomerMaterialCommands.push_back(new SRender(false));
- }
- } else if (AreEqual("ShaderKey", inStream.GetNarrowElementName())) {
- QT3DSU32 theValue = 0;
- inStream.Att("value", theValue);
- theMaterial.m_ShaderKey = theValue;
- } else if (AreEqual("LayerKey", inStream.GetNarrowElementName())) {
- QT3DSU32 theValue = 0;
- inStream.Att("count", theValue);
- theMaterial.m_LayerCount = theValue;
- } else if (AreEqual("Buffer", inStream.GetNarrowElementName())) {
- SAllocateBufferFlags theFlags;
- const char8_t *theLifetimeStr = "", *theType = "", *theFormat = "",
- *theFilter = "", *theWrap = "", *theName = "";
- QT3DSF32 theSize = 1.0f;
- inStream.Att("name", theName);
- inStream.Att("lifetime", theLifetimeStr);
- inStream.Att("type", theType);
- inStream.Att("format", theFormat);
- inStream.Att("filter", theFilter);
- inStream.Att("wrap", theWrap);
- inStream.Att("size", theSize);
- // Clamp the size to valid amounts
- if (theSize <= 0)
- theSize = 1.0f;
- if (theSize > 1.0f)
- theSize = 1.0f;
- if (AreEqual(theLifetimeStr, "scene"))
- theFlags.SetSceneLifetime(true);
- qt3ds::render::NVRenderTextureFormats::Enum theTexFormat =
- ConvertTypeAndFormatToTextureFormat(theType, theFormat);
- qt3ds::render::NVRenderTextureMagnifyingOp::Enum theMagOp =
- ConvertFilterToMagOp(theFilter);
- qt3ds::render::NVRenderTextureCoordOp::Enum theCoordOp =
- ConvertTextureCoordOp(theWrap);
- if (*theName == 0) {
- QT3DS_ASSERT(false);
- // inFoundation.error( QT3DS_INVALID_PARAMETER, "Buffer is missing its
- // name" );
- } else {
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SAllocateBuffer(
- m_StringTable.GetRenderStringTable().RegisterStr(
- theName), theTexFormat, theMagOp, theCoordOp,
- theSize, theFlags));
- }
- }
- }
- }
-
- if (theMaterial.m_CustomerMaterialCommands.size() == 0) {
- // add minimal set
- // add shader to command stream
- theMaterial.m_CustomerMaterialCommands.push_back(
- new SBindShader(m_StringTable.GetRenderStringTable().RegisterStr(
- theMaterial.m_Shaders[0].m_Name.c_str())));
- // this is a place holder for our input values to the shader
- theMaterial.m_CustomerMaterialCommands.push_back(new SApplyInstanceValue());
- // add the render command as last thing
- theMaterial.m_CustomerMaterialCommands.push_back(new SRender(false));
- }
- }
- }
-
- bool LoadMaterialClassFromSourcePath(const char *inSourcePath,
- Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) override
- {
- std::shared_ptr<IDOMFactory> theFactory(
- IDOMFactory::CreateDOMFactory(m_DataCore->GetStringTablePtr()));
- qt3dsdm::SDOMElement *theElem = CDOMSerializer::Read(*theFactory, inStream, NULL);
- if (theElem != NULL) {
- std::shared_ptr<IDOMReader> theReader(
- IDOMReader::CreateDOMReader(*theElem, m_DataCore->GetStringTablePtr(),
- theFactory));
- LoadMaterialClassXML(*theReader, inInstance, inObjectName, outWarnings,
- TCharStr(Intern(inSourcePath)));
- return true;
- }
- return false;
- }
-
- Option<SMetaDataCustomMaterial> GetMaterialBySourcePath(const char *inSourcePath) override
- {
- TCharStr theSourcePath(Intern(inSourcePath));
- for (TCustomMaterialMap::iterator iter = m_CustomMaterials.begin(),
- end = m_CustomMaterials.end();
- iter != end; ++iter) {
- if (iter->second.m_SourcePath == theSourcePath)
- return iter->second.ToMaterial();
- }
- return Empty();
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Undo/Redo
- void SetConsumer(TTransactionConsumerPtr inConsumer) override { m_Consumer = inConsumer; }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Signals
- virtual TSignalConnectionPtr
- ConnectInternalCategoryDestroyed(function<void(Qt3DSDMCategoryHandle)> inCallback)
- {
- return CONNECT(&SNewMetaDataImpl::internalCategoryDestroyed);
- }
- virtual TSignalConnectionPtr
- ConnectInternalPropertyDestroyed(function<void(Qt3DSDMMetaDataPropertyHandle)> inCallback)
- {
- return CONNECT(&SNewMetaDataImpl::internalMetaDataPropertyDestroyed);
- }
- virtual TSignalConnectionPtr
- ConnectInternalEventDestroyed(function<void(Qt3DSDMEventHandle)> inCallback)
- {
- return CONNECT(&SNewMetaDataImpl::internalEventDestroyed);
- }
- virtual TSignalConnectionPtr
- ConnectInternalHandlerDestroyed(function<void(Qt3DSDMHandlerHandle)> inCallback)
- {
- return CONNECT(&SNewMetaDataImpl::internalHandlerDestroyed);
- }
- virtual TSignalConnectionPtr
- ConnectInternalHandlerArgDestroyed(function<void(Qt3DSDMHandlerHandle, QT3DSU32)> inCallback)
- {
- return CONNECT(&SNewMetaDataImpl::internalHandlerArgDestroyed);
- }
-};
-}
-
-std::shared_ptr<IMetaData> IMetaData::CreateNewMetaData(std::shared_ptr<IDataCore> inDataCore)
-{
- return std::make_shared<SNewMetaDataImpl>(inDataCore);
-}
-#ifndef QT3DSDM_META_DATA_NO_SIGNALS
-#include "Qt3DSDMMetaData.moc"
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.h
deleted file mode 100644
index 67a7fb18..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaData.h
+++ /dev/null
@@ -1,400 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-
-#include "Qt3DSDMMetaDataTypes.h"
-#include "foundation/Qt3DSOption.h"
-#include <functional>
-#include <memory>
-#include "Qt3DSDMActionInfo.h"
-#include "Qt3DSDMStringTable.h"
-#include "Qt3DSDMValue.h"
-
-struct SShaderParameters;
-namespace qt3ds {
-namespace foundation {
- class IInStream;
-}
-}
-
-namespace qt3dsdm {
-
-using qt3ds::foundation::Option;
-using qt3ds::QT3DSU32;
-using std::pair;
-using std::vector;
-
-class ISignalConnection;
-class ITransactionConsumer;
-class IDOMWriter;
-class IDOMReader;
-class IDataCore;
-class CDataCoreProducer;
-
-struct MetaDataLoadWarningType
-{
- enum Enum {
- Unknown = 0,
- InvalidProperty,
- InvalidEvent,
- InvalidHandler,
- };
-};
-
-struct MetaDataLoadWarningMessage
-{
- enum Enum {
- Unknown = 0,
- GeneralError,
- MissingName,
- InvalidDefault,
- };
-};
-
-struct SMetaDataLoadWarning
-{
- MetaDataLoadWarningType::Enum m_Type;
- MetaDataLoadWarningMessage::Enum m_Message;
- TCharStr m_ExtraInfo;
-
- SMetaDataLoadWarning(MetaDataLoadWarningType::Enum inType,
- MetaDataLoadWarningMessage::Enum inMessage, TCharStr inInfo = TCharStr())
- : m_Type(inType)
- , m_Message(inMessage)
- , m_ExtraInfo(inInfo)
- {
- }
- SMetaDataLoadWarning()
- : m_Type(MetaDataLoadWarningType::Unknown)
- , m_Message(MetaDataLoadWarningMessage::Unknown)
- {
- }
-};
-
-/**
- * Meta data class to hold meta data descriptions of the objects used in DataModel.
- * A user-visible type in DataModel (things in the timeline) has a specific set of metadata,
- * the type can have properties, events, handlers, and references.
- *
- * Properties are exactly what they sound like. Events are messages the object can send,
- * and handlers are functions that are exported from the object.
- *
- * Events are hooked up to handlers using an ActionCore which takes tuples
- * of instance, event, handler and slide and maintains a specific instance of an action.
- *
- * References allow us to track which properties are being accessed. Properties are stripped
- * from the engine portion of the runtime (although they still appear in the scenegraph)
- * if they aren't animated nor set in a given slide.
- */
-class IMetaData
-{
-protected:
- virtual ~IMetaData() {}
-public:
- typedef const TCharStr &TStrType;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Sharing some utility objects
- virtual IStringTable &GetStringTable() = 0;
- virtual TStringTablePtr GetStringTablePtr() = 0;
- virtual std::shared_ptr<IDataCore> GetDataCore() = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Canonical Instances
- // Map an instance to a given type name. The type name is stored, along with the instance
- // handle in the file if this object is *not* canonical.
- // If this object is canonical, then we expect this mapping setup before loading the
- // canonical data, and we will use a type lookup instead of a direct handle lookup
- // when loading canonical information.
- virtual void SetInstanceAsCanonical(Qt3DSDMInstanceHandle inInstance, TStrType inTypename) = 0;
-
- virtual Qt3DSDMInstanceHandle GetCanonicalInstanceForType(TStrType inTypename) = 0;
- // If this instance wasn't registered as canonical, then we return empty.
- virtual Option<TCharStr> GetTypeForCanonicalInstance(Qt3DSDMInstanceHandle inInstance) = 0;
- // Gets the type for this instance via derivation
- virtual Option<TCharStr> GetTypeForInstance(Qt3DSDMInstanceHandle inInstance) = 0;
- // Get group count for instance
- virtual QT3DSU32 GetGroupCountForInstance(Qt3DSDMInstanceHandle inInstance) = 0;
- // Get all group names
- virtual QT3DSU32 GetGroupNamesForInstance(Qt3DSDMInstanceHandle inInstance,
- std::vector<TCharStr> &outNames) = 0;
- // Get group count for instance
- virtual Option<TCharStr> GetGroupFilterNameForInstance(Qt3DSDMInstanceHandle inInstance,
- long inIndex) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Categories
- // Categories appear in the UI to divide up large lists of events, actions, and properties.
- // Returns <handle,true> if a category was created
- // else returns <handle,false>
- virtual pair<Qt3DSDMCategoryHandle, bool> GetOrCreateCategory(TStrType inName) = 0;
-
- virtual void SetCategoryInfo(Qt3DSDMCategoryHandle inCategory, TStrType inIcon,
- TStrType inHighlight, TStrType inDescription) = 0;
- virtual void DestroyCategory(Qt3DSDMCategoryHandle inCategory) = 0;
-
- virtual Option<SCategoryInfo> GetCategoryInfo(Qt3DSDMCategoryHandle inCategory) = 0;
- virtual Qt3DSDMCategoryHandle FindCategoryByName(TStrType inName) = 0;
- virtual void GetCategories(vector<Qt3DSDMCategoryHandle> &outCategories) = 0;
- virtual Option<SCategoryInfo> GetEventCategory(TStrType inName) = 0;
- virtual Option<SCategoryInfo> GetHandlerCategory(TStrType inName) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Properties
- // Will create the property on the instance associated with this type name if it doesn't exist.
- // Metadata properties can be redifined for child instances and this re-definition will override
- // the parent definition. We currently use this to give different formal names and description
- // to the sourcepath property (for models it is mesh, for materials it is image).
- virtual Qt3DSDMMetaDataPropertyHandle
- CreateMetaDataProperty(Qt3DSDMInstanceHandle inInstance) = 0;
-
- // For properties, you set the default values separately
- // This may delete the underlying data model property rebuild it.
- virtual void SetMetaDataPropertyInfo(Qt3DSDMMetaDataPropertyHandle inPropertyHandle,
- TStrType inName, TStrType inFormalName,
- TStrType inDescription, TStrType inUsage,
- CompleteMetaDataType::Enum inDataType,
- const SValue &inDefaultValue,
- const TMetaDataData &inMetaData, TStrType inGroupName,
- bool inIsHidden = false, bool inIsAnimatable = false,
- bool inIsControllable = false) = 0;
-
- // Destroy just this meta data property
- // Does not destroy the underlying data core property, so this function isn't a perfect
- // reverse of the above system. This *just* destroyed the meta data pointed to by
- // this property.
- virtual void DestroyMetaDataProperty(Qt3DSDMMetaDataPropertyHandle inProperty) = 0;
-
- virtual Qt3DSDMMetaDataPropertyHandle GetMetaDataProperty(Qt3DSDMInstanceHandle inInstance,
- TStrType inPropertyName) = 0;
- virtual Qt3DSDMMetaDataPropertyHandle GetMetaDataProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual Option<SMetaDataPropertyInfo>
- GetMetaDataPropertyInfo(Qt3DSDMMetaDataPropertyHandle inProperty) = 0;
- // Get all of the meta data properties defined on this object or its derivation parents
- virtual void GetMetaDataProperties(Qt3DSDMInstanceHandle inInstance,
- vector<Qt3DSDMMetaDataPropertyHandle> &outProperties) = 0;
-
- // Get the meta data properties defined on *only* this object, don't search parents
- virtual Qt3DSDMMetaDataPropertyHandle
- GetOrCreateSpecificMetaDataProperty(Qt3DSDMInstanceHandle inInstance,
- TStrType inPropertyName) = 0;
- virtual void
- GetSpecificMetaDataProperties(Qt3DSDMInstanceHandle inInstance,
- vector<Qt3DSDMMetaDataPropertyHandle> &outProperties) = 0;
-
- virtual TCharStr GetFormalName(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual AdditionalMetaDataType::Value GetAdditionalMetaDataType(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual TMetaDataData GetAdditionalMetaDataData(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual bool IsCustomProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual SValue GetDefaultValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
-
- virtual void
- SetMetaDataPropertyFilters(Qt3DSDMMetaDataPropertyHandle inProperty,
- qt3ds::foundation::NVConstDataRef<SPropertyFilterInfo> inFilters) = 0;
- virtual qt3ds::foundation::NVConstDataRef<SPropertyFilterInfo>
- GetMetaDataPropertyFilters(Qt3DSDMMetaDataPropertyHandle inProperty) = 0;
- virtual void RemoveMetaDataPropertyFilters(Qt3DSDMMetaDataPropertyHandle inProperty) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Events
- // CreateMetaDataEvent was original named CreateEvent but this collides with
- // the microsoft macro CreateEvent which expands to CreateEventA or CreateEventW
- virtual Qt3DSDMEventHandle CreateMetaDataEvent(Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SetEventInfo(Qt3DSDMEventHandle inEventHandle, TStrType inName,
- TStrType inFormalName, TStrType inCategory,
- TStrType inDescription) = 0;
-
- virtual void DestroyEvent(Qt3DSDMEventHandle inEventHandle) = 0;
-
- virtual void GetEvents(Qt3DSDMInstanceHandle inInstance, TEventHandleList &outEvents) = 0;
- virtual Qt3DSDMEventHandle FindEvent(Qt3DSDMInstanceHandle inInstance, TStrType inName) = 0;
- virtual Option<SEventInfo> GetEventInfo(Qt3DSDMEventHandle inEventHandle) = 0;
- virtual bool IsCustomEvent(Qt3DSDMEventHandle inEventHandle) = 0;
-
- // Get/Find an event that occurs on just this instance, don't search parent instances
- virtual void GetSpecificEvents(Qt3DSDMInstanceHandle inInstance,
- TEventHandleList &outEvents) = 0;
- virtual Qt3DSDMEventHandle GetOrCreateSpecificEvent(Qt3DSDMInstanceHandle inInstance,
- TStrType inName) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Handlers
- virtual Qt3DSDMHandlerHandle CreateHandler(Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SetHandlerInfo(Qt3DSDMHandlerHandle inHandle, TStrType inName,
- TStrType inFormalName, TStrType inCategory,
- TStrType inDescription) = 0;
- virtual void DestroyHandler(Qt3DSDMHandlerHandle inHandlerHandle) = 0;
-
- virtual Qt3DSDMHandlerHandle FindHandlerByName(Qt3DSDMInstanceHandle inInstance,
- TStrType inName) = 0;
- virtual Option<SHandlerInfo> GetHandlerInfo(Qt3DSDMHandlerHandle inHandlerHandle) = 0;
- virtual void GetHandlers(Qt3DSDMInstanceHandle inInstance, THandlerHandleList &outHandlers) = 0;
- virtual bool IsCustomHandler(Qt3DSDMHandlerHandle inEventHandle) = 0;
-
- virtual void GetSpecificHandlers(Qt3DSDMInstanceHandle inInstance,
- THandlerHandleList &outHandlers) = 0;
- virtual Qt3DSDMHandlerHandle GetOrCreateSpecificHandler(Qt3DSDMInstanceHandle inInstance,
- TStrType inName) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Handler Arguments
- virtual QT3DSU32 AddHandlerArgument(Qt3DSDMHandlerHandle inHandler) = 0;
- virtual void
- SetHandlerArgumentInfo(Qt3DSDMHandlerHandle inHandler, QT3DSU32 inArgIndex, TStrType inName,
- TStrType inFormalName, TStrType inDescription,
- CompleteMetaDataType::Enum inDataType, const SValue &inDefaultValue,
- const TMetaDataData &inMetaData, HandlerArgumentType::Value inArgType) = 0;
-
- virtual void DestroyHandlerArgument(Qt3DSDMHandlerHandle inHandler, QT3DSU32 inArgIndex) = 0;
-
- virtual Option<SMetaDataHandlerArgumentInfo>
- FindHandlerArgumentByName(Qt3DSDMHandlerHandle inHandler, TStrType inName) = 0;
- virtual void GetHandlerArguments(Qt3DSDMHandlerHandle inHandler,
- vector<SMetaDataHandlerArgumentInfo> &outArguments) = 0;
- virtual Option<SMetaDataHandlerArgumentInfo>
- GetHandlerArgumentInfo(Qt3DSDMHandlerHandle inHandle, QT3DSU32 inIndex) = 0;
- virtual QT3DSU32 GetNumHandlerArguments(Qt3DSDMHandlerHandle inHandler) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // References
- // Duplicate references are removed from this instance
- virtual void AddReference(Qt3DSDMInstanceHandle inInstance, TStrType inRefString) = 0;
- virtual void DestroyReferences(Qt3DSDMInstanceHandle inInstance) = 0;
-
- // Does the recursive gather from all the parents. Duplicate references are removed from the
- // final list.
- virtual void GetReferences(Qt3DSDMInstanceHandle inInstance,
- std::vector<TCharStr> &outReferences) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Instance-global functions
- // Destroy all meta data that relates to this instance.
- // Calling this on a derived instance does nothing, this only works if this specific
- // instance was mapped directly to meta data.
- virtual void DestroyMetaData(Qt3DSDMInstanceHandle inInstance) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Serialization
- // You can either save out in canonical format (and it will only save canonical-instance-related
- // information *or* you can save out in normal format where we link directly to instance handle
- // instead of to typename
- virtual void Save(IDOMWriter &inWriter) = 0;
- // Loading expects the canonical instances to be setup already which means that
- // it will perform lookups based on
- // One huge assumption is that the reader is using the same string table
- // that this object was built with
- // InIsCanonical tells us whether to mark loaded categories as canonical
- // or not.
- virtual void Load(IDOMReader &ioStream) = 0;
-
- // Load meta data and apply it to just this instance
- virtual void LoadInstance(IDOMReader &inReader, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inName,
- std::vector<SMetaDataLoadWarning> &outWarnings) = 0;
-
- // Save just this instances meta data out to the writer
- virtual void SaveInstance(IDOMWriter &inWriter, Qt3DSDMInstanceHandle inInstance) = 0;
-
- // Load effect meta data from file and apply it to just this instance
- virtual void LoadEffectInstance(const char *inShaderFile, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) = 0;
-
- virtual bool IsEffectInstanceRegistered(const char *inName) = 0;
- virtual void LoadEffectXML(IDOMReader &inStream, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- const TCharStr &inSourcePath) = 0;
- virtual bool LoadEffectXMLFromSourcePath(const char *inSourcePath,
- Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) = 0;
- virtual Option<SMetaDataEffect> GetEffectBySourcePath(const char *inName) = 0;
-
- virtual void LoadMaterialInstance(const char *inShaderFile,
- Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) = 0;
- virtual bool IsMaterialClassRegistered(const char *inName) = 0;
- virtual void LoadMaterialClassXML(IDOMReader &inStream, Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- const TCharStr &inSourcePath) = 0;
- virtual bool LoadMaterialClassFromSourcePath(const char *inSourcePath,
- Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inObjectName,
- std::vector<SMetaDataLoadWarning> &outWarnings,
- qt3ds::foundation::IInStream &inStream) = 0;
- virtual Option<SMetaDataCustomMaterial> GetMaterialBySourcePath(const char *inSourcePath) = 0;
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Undo/Redo
- virtual void SetConsumer(std::shared_ptr<ITransactionConsumer> inConsumer) = 0;
-
-#ifndef QT3DSDM_META_DATA_NO_SIGNALS
- ////////////////////////////////////////////////////////////////////////////////////
- // Signals
- // These events are sent out only once, they aren't set into the transaction consumer
- // to be sent out upon undo and redo. These events are meant for chaining together side effects
- // so other systems don't have references to invalid handler arguments and handles.
- // Also, the objects in these messages are still valid so you can query information about them
- // at this time. They will be destroyed subsequent to the event.
- virtual std::shared_ptr<ISignalConnection>
- ConnectInternalCategoryDestroyed(std::function<void(Qt3DSDMCategoryHandle)> inCallback) = 0;
- virtual std::shared_ptr<ISignalConnection> ConnectInternalPropertyDestroyed(
- std::function<void(Qt3DSDMMetaDataPropertyHandle)> inCallback) = 0;
- virtual std::shared_ptr<ISignalConnection>
- ConnectInternalEventDestroyed(std::function<void(Qt3DSDMEventHandle)> inCallback) = 0;
- virtual std::shared_ptr<ISignalConnection>
- ConnectInternalHandlerDestroyed(std::function<void(Qt3DSDMHandlerHandle)> inCallback) = 0;
- virtual std::shared_ptr<ISignalConnection> ConnectInternalHandlerArgDestroyed(
- std::function<void(Qt3DSDMHandlerHandle, QT3DSU32)> inCallback) = 0;
-#endif
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Creation/Lifetime Management
- friend class std::shared_ptr<IMetaData>;
- // The data core is used to create the properties if they don't exist or
- // query their underlying type if they do exist. We also subscribe to
- // the datacore's beforeInstanceDelete function in order to ensure
- // that we delete our existing meta data for instances that are being deleted.
- static std::shared_ptr<IMetaData> CreateNewMetaData(std::shared_ptr<IDataCore> inDataCore);
-};
-
-typedef std::shared_ptr<IMetaData> TNewMetaDataPtr;
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataTypes.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataTypes.h
deleted file mode 100644
index 5532e0a5..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataTypes.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#include "Qt3DSDMMetaDataValue.h"
-
-namespace qt3ds {
-namespace render {
- namespace dynamic {
- struct SCommand;
- struct SPropertyDeclaration;
- struct SPropertyDefinition;
- }
-}
-}
-
-namespace qt3dsdm {
-
-struct HandlerArgumentType {
-
- enum Value {
- None,
- Property, // Property reference. Load the Properties of the Target Object.
- Dependent, // Property type depends on another property.
- Slide, // Slide reference. Load the list of slides of the Target Object if
- // applicable.
- Event, // Event reference. Load the applicable Events of the Target Object.
- Object, // Object reference. Used for dynamic actions with object referenced
- // property.
- Signal, // Signal reference. Used for emiting signals fired from the trigger
- // object.
- };
-
- Q_ENUM(Value)
- Q_GADGET
-};
-
-struct CompleteMetaDataType
-{
- enum Enum {
- Unknown = 0,
- StringList,
- FloatRange,
- LongRange,
- Float,
- Long,
- Float2,
- Vector,
- Scale,
- Rotation,
- Color,
- Boolean,
- Slide,
- Font,
- FontSize,
- String,
- MultiLineString,
- ObjectRef,
- Image,
- Mesh,
- Import,
- Texture,
- Guid,
- StringListOrInt,
- Renderable,
- Image2D,
- Buffer,
- PathBuffer,
- ShadowMapResolution,
- };
-
- // Functions defined in UICDMMetaData.cpp
- static DataModelDataType::Value ToDataType(Enum inCompleteType);
- static AdditionalMetaDataType::Value ToAdditionalType(Enum inCompleteType);
- static CompleteMetaDataType::Enum ToCompleteType(DataModelDataType::Value inDataType,
- AdditionalMetaDataType::Value inAdditionalType);
- Q_ENUM(Enum)
- Q_GADGET
-};
-
-typedef std::pair<DataModelDataType::Value, AdditionalMetaDataType::Value> TDataTypePair;
-
-inline bool Equals(const TMetaDataData &lhs, const TMetaDataData &rhs)
-{
- return rhs == lhs;
-}
-
-inline AdditionalMetaDataType::Value GetMetaDataValueType(const TMetaDataData &inValue)
-{
- return inValue.getType();
-}
-
-// Base class shared between property info
-// and handler arguments.
-struct SMetaPropertyBase
-{
- TCharStr m_Name;
- TCharStr m_FormalName;
- TCharStr m_Usage;
- TCharStr m_Description;
- CompleteMetaDataType::Enum m_CompleteType;
- TMetaDataData m_MetaDataData;
- SValue m_DefaultValue;
-
- SMetaPropertyBase()
- : m_CompleteType(CompleteMetaDataType::Float)
- {
- }
- bool operator==(const SMetaPropertyBase &inOther) const
- {
- return m_Name == inOther.m_Name && m_FormalName == inOther.m_FormalName
- && m_Usage == inOther.m_Usage && m_Description == inOther.m_Description
- && m_CompleteType == inOther.m_CompleteType
- && Equals(m_DefaultValue.toOldSkool(), inOther.m_DefaultValue.toOldSkool())
- && Equals(m_MetaDataData, inOther.m_MetaDataData);
- }
- DataModelDataType::Value GetDataType() const
- {
- return CompleteMetaDataType::ToDataType(m_CompleteType);
- }
- AdditionalMetaDataType::Value GetAdditionalType() const
- {
- return CompleteMetaDataType::ToAdditionalType(m_CompleteType);
- }
-};
-
-struct SMetaDataPropertyInfo : SMetaPropertyBase
-{
- Qt3DSDMInstanceHandle m_Instance;
- Qt3DSDMPropertyHandle m_Property;
- bool m_Controllable = false; // Can this property be controlled via data input (default no)
- bool m_IsHidden = false; // Is this property hidden in the inspector (default no)
- bool m_Animatable = true; // Is this property animatable (default yes)
- // Note: all animatables are controllable
-
- TCharStr m_GroupName; // Name of the group this property belongs to or "default"
-
- SMetaDataPropertyInfo(Qt3DSDMInstanceHandle inInstance)
- : m_Instance(inInstance)
- {
- }
- SMetaDataPropertyInfo() {}
-
- bool operator==(const SMetaDataPropertyInfo &inOther) const
- {
- return m_Instance == inOther.m_Instance && m_Property == inOther.m_Property
- && m_IsHidden == inOther.m_IsHidden && m_Animatable == inOther.m_Animatable
- && m_GroupName == inOther.m_GroupName
- && m_Controllable == inOther.m_Controllable
- && SMetaPropertyBase::operator==(inOther);
- }
-
- bool operator!=(const SMetaDataPropertyInfo &inOther) const { return !(*this == inOther); }
-};
-
-struct SMetaDataHandlerArgumentInfo : SMetaPropertyBase
-{
- Qt3DSDMHandlerHandle m_Handler;
- HandlerArgumentType::Value m_ArgType;
- SMetaDataHandlerArgumentInfo(Qt3DSDMHandlerHandle inHandler = Qt3DSDMHandlerHandle())
- : m_Handler(inHandler)
- , m_ArgType(HandlerArgumentType::None)
- {
- }
-};
-
-struct SCategoryInfo
-{
- TCharStr m_Name;
- TCharStr m_Description;
- TCharStr m_Icon;
- TCharStr m_HighlightIcon;
- bool m_Canonical;
-
- SCategoryInfo()
- : m_Canonical(false)
- {
- }
- SCategoryInfo(TCharStr inName)
- : m_Name(inName)
- , m_Canonical(false)
- {
- }
-};
-
-struct SEventInfo
-{
- bool operator!=(const SEventInfo &inEvent) const
- {
- return (m_Name != inEvent.m_Name || m_FormalName != inEvent.m_FormalName
- || m_Category != inEvent.m_Category || m_Description != inEvent.m_Description);
- }
-
- TCharStr m_Name;
- TCharStr m_FormalName;
- TCharStr m_Category;
- TCharStr m_Description;
-};
-
-struct SHandlerInfo
-{
- TCharStr m_Name;
- TCharStr m_FormalName;
- TCharStr m_Category;
- TCharStr m_Description;
-
- bool operator!=(const SHandlerInfo &inHandler) const
- {
- return (m_Name != inHandler.m_Name || m_FormalName != inHandler.m_FormalName
- || m_Category != inHandler.m_Category || m_Description != inHandler.m_Description);
- }
-};
-
-struct PropertyFilterTypes
-{
- enum Enum {
- Unknown,
- ShowIfEqual,
- HideIfEqual,
- };
-};
-
-struct SPropertyFilterInfo
-{
- PropertyFilterTypes::Enum m_FilterType;
- Qt3DSDMPropertyHandle m_FilterProperty;
- SValue m_Value;
- SPropertyFilterInfo()
- : m_FilterType(PropertyFilterTypes::Unknown)
- {
- }
- SPropertyFilterInfo(PropertyFilterTypes::Enum inFilterType, Qt3DSDMPropertyHandle inProp,
- const SValue &inValue)
- : m_FilterType(inFilterType)
- , m_FilterProperty(inProp)
- , m_Value(inValue)
- {
- }
-};
-struct SMetaDataShader
-{
- TCharStr m_Name;
- TCharStr m_Type; ///< shader type (GLSL or HLSL)
- TCharStr m_Version; ///< shader version (e.g. 330 vor GLSL)
- // Code contains both the vertex and fragment portions separated by #define's.
- //#define VERTEX_SHADER, #define FRAGMENT_SHADER
- TCharStr m_Code;
- bool m_HasGeomShader;
- bool m_IsComputeShader;
- SMetaDataShader()
- : m_HasGeomShader(false)
- , m_IsComputeShader(false)
- {
- }
- SMetaDataShader(const TCharStr &inName, const TCharStr &inType, const TCharStr &inVersion,
- const TCharStr &inCode, bool hasGeom, bool isCompute)
- : m_Name(inName)
- , m_Type(inType)
- , m_Version(inVersion)
- , m_Code(inCode)
- , m_HasGeomShader(hasGeom)
- , m_IsComputeShader(isCompute)
- {
- }
-};
-
-struct SMetaDataDynamicObject
-{
- TCharStr m_Name;
- qt3ds::foundation::NVConstDataRef<SMetaDataShader> m_Shaders;
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> m_Properties;
- SMetaDataDynamicObject() {}
- SMetaDataDynamicObject(
- const TCharStr &inName, qt3ds::foundation::NVConstDataRef<SMetaDataShader> inShaders,
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> inProperties)
- : m_Name(inName)
- , m_Shaders(inShaders)
- , m_Properties(inProperties)
- {
- }
-};
-
-struct SMetaDataEffect : public SMetaDataDynamicObject
-{
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SCommand *> m_EffectCommands;
- SMetaDataEffect() {}
- SMetaDataEffect(
- const TCharStr &inName, qt3ds::foundation::NVConstDataRef<SMetaDataShader> inShaders,
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> inProperties,
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SCommand *> inEffectCommands)
- : SMetaDataDynamicObject(inName, inShaders, inProperties)
- , m_EffectCommands(inEffectCommands)
- {
- }
-};
-
-struct SMetaDataCustomMaterial : public SMetaDataDynamicObject
-{
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SCommand *> m_CustomMaterialCommands;
- bool m_HasTransparency;
- bool m_HasRefraction;
- bool m_AlwaysDirty;
- unsigned int m_ShaderKey;
- unsigned int m_LayerCount;
- SMetaDataCustomMaterial() {}
- SMetaDataCustomMaterial(
- const TCharStr &inName, qt3ds::foundation::NVConstDataRef<SMetaDataShader> inShaders,
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> inProperties,
- qt3ds::foundation::NVConstDataRef<qt3ds::render::dynamic::SCommand *> inCustomMaterialCommands,
- bool inHasTransparency, bool inHasRefraction, bool inIsAlwaysDirty,
- unsigned int inShaderKey, unsigned int inLayerCount)
- : SMetaDataDynamicObject(inName, inShaders, inProperties)
- , m_CustomMaterialCommands(inCustomMaterialCommands)
- , m_HasTransparency(inHasTransparency)
- , m_HasRefraction(inHasRefraction)
- , m_AlwaysDirty(inIsAlwaysDirty)
- , m_ShaderKey(inShaderKey)
- , m_LayerCount(inLayerCount)
- {
- }
-};
-}
-
-Q_DECLARE_METATYPE(qt3dsdm::HandlerArgumentType::Value)
-
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataValue.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataValue.h
deleted file mode 100644
index b981b956..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMMetaDataValue.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#include <EASTL/string.h>
-#include <EASTL/vector.h>
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMDataTypes.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "Qt3DSDMValue.h"
-
-#include <QStringList>
-
-namespace qt3dsdm {
-
-struct AdditionalMetaDataType {
-
- enum Value {
- None,
- StringList,
- Range,
- Image,
- Color,
- Rotation,
- Font,
- FontSize,
- MultiLine,
- ObjectRef,
- Mesh,
- Import,
- Texture,
- Renderable,
- PathBuffer,
- ShadowMapResolution,
- String,
- };
-
-
- Q_ENUM(Value)
- Q_GADGET
-};
-
-// List type metadata
-typedef eastl::vector<TCharStr> TMetaDataStringList;
-
-// Float type metadata
-struct SMetaDataRange
-{
- SMetaDataRange() {}
-
- SMetaDataRange(float min, float max, int decimals = -1)
- : m_min(min)
- , m_max(max)
- , m_decimals(decimals)
- {
- }
-
- bool operator==(const SMetaDataRange &other) const
- {
- // no need to check m_decimals for quality as it is not significant to the range value
- return m_min == other.m_min && m_max == other.m_max;
- }
-
- float m_min = 0.0f;
- float m_max = 0.0f;
- int m_decimals = -1; // num decimals to show, -1: dynamically calculated
-};
-}
-
-namespace qt3ds {
-namespace foundation {
-
- template <>
- struct DestructTraits<qt3dsdm::SMetaDataRange>
- {
- void destruct(qt3dsdm::SMetaDataRange &) {}
- };
-}
-}
-
-namespace qt3dsdm {
-
-template <typename TDataType>
-struct SMetaDataTypeToEnumMap
-{
-};
-template <>
-struct SMetaDataTypeToEnumMap<eastl::vector<TCharStr>>
-{
- static AdditionalMetaDataType::Value getType() { return AdditionalMetaDataType::StringList; }
-};
-template <>
-struct SMetaDataTypeToEnumMap<SMetaDataRange>
-{
- static AdditionalMetaDataType::Value getType() { return AdditionalMetaDataType::Range; }
-};
-
-struct SMetaDataValueTraits
-{
- typedef AdditionalMetaDataType::Value TIdType;
-
- enum {
- TBufferSize = sizeof(TMetaDataStringList),
- };
-
- static TIdType getNoDataId() { return AdditionalMetaDataType::None; }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return SMetaDataTypeToEnumMap<TDataType>::getType();
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, AdditionalMetaDataType::Value inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case AdditionalMetaDataType::StringList:
- return inVisitor(*reinterpret_cast<TMetaDataStringList *>(inData));
- case AdditionalMetaDataType::Range:
- return inVisitor(*reinterpret_cast<SMetaDataRange *>(inData));
- default:
- QT3DS_ASSERT(false);
- case AdditionalMetaDataType::None:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, AdditionalMetaDataType::Value inType,
- TVisitorType inVisitor)
- {
- switch (inType) {
- case AdditionalMetaDataType::StringList:
- return inVisitor(*reinterpret_cast<const TMetaDataStringList *>(inData));
- case AdditionalMetaDataType::Range:
- return inVisitor(*reinterpret_cast<const SMetaDataRange *>(inData));
- default:
- QT3DS_ASSERT(false);
- case AdditionalMetaDataType::None:
- return inVisitor();
- }
- }
-};
-
-struct SMetaDataData
- : public qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SMetaDataValueTraits,
- Qt3DSDMDataTypeUnionTraits::
- TBufferSize>,
- SMetaDataValueTraits::TBufferSize>
-{
- typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::DiscriminatedUnionGenericBase<SMetaDataValueTraits,
- Qt3DSDMDataTypeUnionTraits::
- TBufferSize>,
- SMetaDataValueTraits::TBufferSize>
- TBase;
- SMetaDataData() {}
- SMetaDataData(const SMetaDataData &inOther)
- : TBase(static_cast<const TBase &>(inOther))
- {
- }
- SMetaDataData &operator=(const SMetaDataData &inOther)
- {
- TBase::operator=(static_cast<const TBase &>(inOther));
- return *this;
- }
- SMetaDataData(const TMetaDataStringList &inData)
- : TBase(inData)
- {
- }
- SMetaDataData(const SMetaDataRange &inData)
- : TBase(inData)
- {
- }
- SMetaDataData &operator=(const TMetaDataStringList &inData)
- {
- TBase::operator=(inData);
- return *this;
- }
- SMetaDataData &operator=(const SMetaDataRange &inData)
- {
- TBase::operator=(inData);
- return *this;
- }
- bool empty() const { return getType() == AdditionalMetaDataType::None; }
-};
-
-template <>
-struct Qt3DSDMGetter<SMetaDataData>
-{
- template <typename TRetType>
- TRetType doGet(const SMetaDataData &inValue)
- {
- return inValue.getData<TRetType>();
- }
-};
-
-template <>
-struct Qt3DSDMValueTyper<SMetaDataData>
-{
- AdditionalMetaDataType::Value Get(const SMetaDataData &inValue) { return inValue.getType(); }
-};
-
-typedef SMetaDataData TMetaDataData;
-
-
-template <>
-inline QStringList get<QStringList>(const qt3dsdm::SMetaDataData &inType)
-{
- QStringList result;
- if (inType.getType() == qt3dsdm::AdditionalMetaDataType::None)
- return result;
-
- auto list = qt3dsdm::get<qt3dsdm::TMetaDataStringList>(inType);
- std::transform(list.begin(), list.end(), std::back_inserter(result), [](const Qt3DSDMStr &s) {
- return QString::fromWCharArray(s.wide_str());
- });
- return result;
-}
-}
-
-Q_DECLARE_METATYPE(qt3dsdm::AdditionalMetaDataType)
-
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMPropertyDefinition.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMPropertyDefinition.h
deleted file mode 100644
index d324b539..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMPropertyDefinition.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_PROPERTY_DEFINITION_H
-#define QT3DSDM_PROPERTY_DEFINITION_H
-
-#include "Qt3DSDMDataTypes.h"
-
-namespace qt3dsdm {
-
-struct Qt3DSDMPropertyDefinition
-{
- TCharStr m_Name;
- Qt3DSDMInstanceHandle m_Instance;
- DataModelDataType::Value m_Type;
-
- Qt3DSDMPropertyDefinition()
- : m_Type(DataModelDataType::None)
- {
- }
- Qt3DSDMPropertyDefinition(Qt3DSDMInstanceHandle inInstanceHandle, TCharPtr inName,
- DataModelDataType::Value inType)
- : m_Name(inName)
- , m_Instance(inInstanceHandle)
- , m_Type(inType)
- {
- }
- Qt3DSDMPropertyDefinition(const Qt3DSDMPropertyDefinition &inOther)
- : m_Name(inOther.m_Name)
- , m_Instance(inOther.m_Instance)
- , m_Type(inOther.m_Type)
- {
- }
-
- Qt3DSDMPropertyDefinition &operator=(const Qt3DSDMPropertyDefinition &inOther)
- {
- if (this != &inOther) {
- m_Name = inOther.m_Name;
- m_Instance = inOther.m_Instance;
- m_Type = inOther.m_Type;
- }
- return *this;
- }
-};
-
-typedef std::vector<Qt3DSDMPropertyDefinition> TPropertyDefinitionList;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructImpl.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructImpl.h
deleted file mode 100644
index 9664566f..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructImpl.h
+++ /dev/null
@@ -1,305 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SIGNAL_STRUCT_IMPL_H
-#define QT3DSDM_SIGNAL_STRUCT_IMPL_H
-#include "Qt3DSDMSignalStructs.h"
-
-namespace qt3dsdm {
-
-struct SSignalDataStruct0
-{
- typedef SSignalDataStruct0 TThisType;
- typedef std::function<void()> TFunType;
- static void Send(ISignalSystem &system, void *sender, const char *sigName)
- {
- system.Signal(sender, sigName, NULL, 0);
- }
-
- static void Unpack(void *inSender, const char *inName, const char *inData, size_t inDataSize,
- TFunType inHandler)
- {
- if (inDataSize == 0)
- inHandler();
- else {
- QT3DS_ASSERT(false);
- }
- }
-
- static TGenericSignalHandlerFunc CreateHandler(std::function<void()> inHandler)
- {
- return std::bind(&TThisType::Unpack, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, inHandler);
- }
-
- static std::shared_ptr<ISignalConnection> AddListener(ISignalSystem &inSystem, void *inSender,
- const char *inName, TFunType inHandler)
- {
- return inSystem.AddListener(inSender, inName, CreateHandler(inHandler));
- }
-};
-
-#define QT3DSDM_SIGNALS_DEFINE_SPECIFIC_SIGNAL_STRUCT0(name) \
- std::shared_ptr<ISignalConnection> Sig##name::AddListener( \
- ISignalSystem &inSystem, void *inSender, std::function<void()> inHandler) \
- { \
- typedef SSignalDataStruct0 TBase; \
- return TBase::AddListener(inSystem, inSender, #name, inHandler); \
- } \
- void Sig##name::Send(ISignalSystem &system, void *sender) \
- { \
- typedef SSignalDataStruct0 TBase; \
- TBase::Send(system, sender, #name); \
- }
-
-template <typename TData1>
-struct SSignalDataStruct1
-{
- typedef SSignalDataStruct1<TData1> TThisType;
- TData1 m_Data1;
- typedef std::function<void(TData1)> TFunType;
- SSignalDataStruct1(TData1 d1)
- : m_Data1(d1)
- {
- }
- static void Send(ISignalSystem &system, void *sender, const char *sigName, const TData1 &d1)
- {
- TThisType theData(d1);
- system.Signal(sender, sigName, reinterpret_cast<const char *>(&theData), sizeof(TThisType));
- }
-
- static void Unpack(void *inSender, const char *inName, const char *inData, size_t inDataSize,
- TFunType inHandler)
- {
- if (inDataSize == sizeof(TThisType)) {
- const TThisType *theData = reinterpret_cast<const TThisType *>(inData);
- inHandler(theData->m_Data1);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- static TGenericSignalHandlerFunc CreateHandler(TFunType inHandler)
- {
- return std::bind(&TThisType::Unpack, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, inHandler);
- }
-
- static std::shared_ptr<ISignalConnection> AddListener(ISignalSystem &inSystem, void *inSender,
- const char *inName, TFunType inHandler)
- {
- return inSystem.AddListener(inSender, inName, CreateHandler(inHandler));
- }
-};
-
-#define QT3DSDM_SIGNALS_DEFINE_SPECIFIC_SIGNAL_STRUCT1(name, d1) \
- std::shared_ptr<ISignalConnection> Sig##name::AddListener( \
- ISignalSystem &inSystem, void *inSender, std::function<void(d1)> inHandler) \
- { \
- typedef SSignalDataStruct1<d1> TBase; \
- return TBase::AddListener(inSystem, inSender, #name, inHandler); \
- } \
- void Sig##name::Send(ISignalSystem &system, void *sender, const d1 &arg) \
- { \
- typedef SSignalDataStruct1<d1> TBase; \
- TBase::Send(system, sender, #name, arg); \
- }
-
-template <typename TData1, typename TData2>
-struct SSignalDataStruct2
-{
- typedef SSignalDataStruct2<TData1, TData2> TThisType;
- typedef std::function<void(TData1, TData2)> TFunType;
- TData1 m_Data1;
- TData2 m_Data2;
- SSignalDataStruct2(TData1 d1, TData2 d2)
- : m_Data1(d1)
- , m_Data2(d2)
- {
- }
- static void Send(ISignalSystem &system, void *sender, const char *sigName, const TData1 &d1,
- const TData2 &d2)
- {
- TThisType theData(d1, d2);
- system.Signal(sender, sigName, reinterpret_cast<const char *>(&theData), sizeof(TThisType));
- }
-
- static void Unpack(void *inSender, const char *inName, const char *inData, size_t inDataSize,
- TFunType inHandler)
- {
- if (inDataSize == sizeof(TThisType)) {
- const TThisType *theData = reinterpret_cast<const TThisType *>(inData);
- inHandler(theData->m_Data1, theData->m_Data2);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- static TGenericSignalHandlerFunc CreateHandler(TFunType inHandler)
- {
- return std::bind(&TThisType::Unpack, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, inHandler);
- }
-
- static std::shared_ptr<ISignalConnection> AddListener(ISignalSystem &inSystem, void *inSender,
- const char *inName, TFunType inHandler)
- {
- return inSystem.AddListener(inSender, inName, CreateHandler(inHandler));
- }
-};
-
-#define QT3DSDM_SIGNALS_DEFINE_SPECIFIC_SIGNAL_STRUCT2(name, d1, d2) \
- std::shared_ptr<ISignalConnection> Sig##name::AddListener( \
- ISignalSystem &inSystem, void *inSender, std::function<void(d1, d2)> inHandler) \
- { \
- return SSignalDataStruct2<d1, d2>::AddListener(inSystem, inSender, #name, inHandler); \
- } \
- void Sig##name::Send(ISignalSystem &system, void *sender, const d1 &arg1, const d2 &arg2) \
- { \
- SSignalDataStruct2<d1, d2>::Send(system, sender, #name, arg1, arg2); \
- }
-
-template <typename TData1, typename TData2, typename TData3>
-struct SSignalDataStruct3
-{
- typedef SSignalDataStruct3<TData1, TData2, TData3> TThisType;
- typedef std::function<void(TData1, TData2, TData3)> TFunType;
- TData1 m_Data1;
- TData2 m_Data2;
- TData3 m_Data3;
- SSignalDataStruct3(const TData1 &d1, const TData2 &d2, const TData3 &d3)
- : m_Data1(d1)
- , m_Data2(d2)
- , m_Data3(d3)
- {
- }
- static void Send(ISignalSystem &system, void *sender, const char *sigName, const TData1 &d1,
- const TData2 &d2, const TData3 &d3)
- {
- TThisType theData(d1, d2, d3);
- system.Signal(sender, sigName, reinterpret_cast<const char *>(&theData), sizeof(TThisType));
- }
-
- static void Unpack(void *inSender, const char *inName, const char *inData, size_t inDataSize,
- TFunType inHandler)
- {
- if (inDataSize == sizeof(TThisType)) {
- const TThisType *theData = reinterpret_cast<const TThisType *>(inData);
- inHandler(theData->m_Data1, theData->m_Data2, theData->m_Data2);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- static TGenericSignalHandlerFunc CreateHandler(TFunType inHandler)
- {
- return std::bind(&TThisType::Unpack, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, inHandler);
- }
-
- static std::shared_ptr<ISignalConnection> AddListener(ISignalSystem &inSystem, void *inSender,
- const char *inName, TFunType inHandler)
- {
- return inSystem.AddListener(inSender, inName, CreateHandler(inHandler));
- }
-};
-
-#define QT3DSDM_SIGNALS_DEFINE_SPECIFIC_SIGNAL_STRUCT3(name, d1, d2, d3) \
- std::shared_ptr<ISignalConnection> Sig##name::AddListener( \
- ISignalSystem &inSystem, void *inSender, std::function<void(d1, d2, d3)> inHandler) \
- { \
- return SSignalDataStruct3<d1, d2, d3>::AddListener(inSystem, inSender, #name, inHandler); \
- } \
- void Sig##name::Send(ISignalSystem &system, void *sender, const d1 &arg1, const d2 &arg2, \
- const d3 &arg3) \
- { \
- SSignalDataStruct3<d1, d2, d3>::Send(system, sender, #name, arg1, arg2, arg3); \
- }
-
-template <typename TData1, typename TData2, typename TData3, typename TData4>
-struct SSignalDataStruct4
-{
- typedef SSignalDataStruct4<TData1, TData2, TData3, TData4> TThisType;
- typedef std::function<void(TData1, TData2, TData3, TData4)> TFunType;
- TData1 m_Data1;
- TData2 m_Data2;
- TData3 m_Data3;
- TData4 m_Data4;
- SSignalDataStruct4(const TData1 &d1, const TData2 &d2, const TData3 &d3, const TData4 &d4)
- : m_Data1(d1)
- , m_Data2(d2)
- , m_Data3(d3)
- , m_Data4(d4)
- {
- }
- static void Send(ISignalSystem &system, void *sender, const char *sigName, const TData1 &d1,
- const TData2 &d2, const TData3 &d3, const TData4 &d4)
- {
- TThisType theData(d1, d2, d3, d4);
- system.Signal(sender, sigName, reinterpret_cast<const char *>(&theData), sizeof(TThisType));
- }
-
- static void Unpack(void *inSender, const char *inName, const char *inData, size_t inDataSize,
- TFunType inHandler)
- {
- if (inDataSize == sizeof(TThisType)) {
- const TThisType *theData = reinterpret_cast<const TThisType *>(inData);
- inHandler(theData->m_Data1, theData->m_Data2, theData->m_Data2, theData->m_Data4);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- static TGenericSignalHandlerFunc CreateHandler(TFunType inHandler)
- {
- return std::bind(&TThisType::Unpack, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, inHandler);
- }
-
- static std::shared_ptr<ISignalConnection> AddListener(ISignalSystem &inSystem, void *inSender,
- const char *inName, TFunType inHandler)
- {
- return inSystem.AddListener(inSender, inName, CreateHandler(inHandler));
- }
-};
-
-#define QT3DSDM_SIGNALS_DEFINE_SPECIFIC_SIGNAL_STRUCT4(name, d1, d2, d3, d4) \
- std::shared_ptr<ISignalConnection> Sig##name::AddListener( \
- ISignalSystem &inSystem, void *inSender, std::function<void(d1, d2, d3, d4)> inHandler) \
- { \
- return SSignalDataStruct4<d1, d2, d3, d4>::AddListener(inSystem, inSender, #name, \
- inHandler); \
- } \
- void Sig##name::Send(ISignalSystem &system, void *sender, const d1 &arg1, const d2 &arg2, \
- const d3 &arg3, const d4 &arg4) \
- { \
- SSignalDataStruct4<d1, d2, d3, d4>::Send(system, sender, #name, arg1, arg2, arg3, arg4); \
- }
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructs.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructs.h
deleted file mode 100644
index 86c09fd4..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalStructs.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SIGNAL_STRUCTS_H
-#define QT3DSDM_SIGNAL_STRUCTS_H
-#include "Qt3DSDMSignalSystem.h"
-// Helper structs for signals of different arity.
-namespace qt3dsdm {
-// Helper defines to create static tables of signals
-// Macros with the same number of args but with 'declare' replaced by 'define
-// are available in UICDMSignalStructImpl.h. You will need to place these somewhere but
-// they rely on std::bind so I don't place them here.
-#define QT3DSDM_SIGNALS_DECLARE_SPECIFIC_SIGNAL_STRUCT0(name) \
- struct Sig##name \
- { \
- static std::shared_ptr<ISignalConnection> \
- AddListener(ISignalSystem &inSystem, void *inSender, std::function<void()> inHandler); \
- static void Send(ISignalSystem &system, void *sender); \
- };
-
-// Helper defines to create static tables of signals
-#define QT3DSDM_SIGNALS_DECLARE_SPECIFIC_SIGNAL_STRUCT1(name, d1) \
- struct Sig##name \
- { \
- static std::shared_ptr<ISignalConnection> \
- AddListener(ISignalSystem &inSystem, void *inSender, std::function<void(d1)> inHandler); \
- static void Send(ISignalSystem &system, void *sender, const d1 &arg); \
- };
-
-// Helper defines to create static tables of signals
-#define QT3DSDM_SIGNALS_DECLARE_SPECIFIC_SIGNAL_STRUCT2(name, d1, d2) \
- struct Sig##name \
- { \
- static std::shared_ptr<ISignalConnection> \
- AddListener(ISignalSystem &inSystem, void *inSender, \
- std::function<void(d1, d2)> inHandler); \
- static void Send(ISignalSystem &system, void *sender, const d1 &arg1, const d2 &arg2); \
- };
-
-// Helper defines to create static tables of signals
-#define QT3DSDM_SIGNALS_DECLARE_SPECIFIC_SIGNAL_STRUCT3(name, d1, d2, d3) \
- struct Sig##name \
- { \
- static std::shared_ptr<ISignalConnection> \
- AddListener(ISignalSystem &inSystem, void *inSender, \
- std::function<void(d1, d2, d3)> inHandler); \
- static void Send(ISignalSystem &system, void *sender, const d1 &arg1, const d2 &arg2, \
- const d3 &arg3); \
- };
-
-// Helper defines to create static tables of signals
-#define QT3DSDM_SIGNALS_DECLARE_SPECIFIC_SIGNAL_STRUCT4(name, d1, d2, d3, d4) \
- struct Sig##name \
- { \
- static std::shared_ptr<ISignalConnection> \
- AddListener(ISignalSystem &inSystem, void *inSender, \
- std::function<void(d1, d2, d3, d4)> inHandler); \
- static void Send(ISignalSystem &system, void *sender, const d1 &arg1, const d2 &arg2, \
- const d3 &arg3, const d4 &arg4); \
- };
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.cpp
deleted file mode 100644
index 37d02003..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMSignalSystem.h"
-#include "EASTL/hash_map.h"
-
-using namespace qt3dsdm;
-
-namespace {
-
-struct SSignalListener;
-class ISignalSystemImpl
-{
-public:
- virtual ~ISignalSystemImpl() {}
- virtual void RemoveListener(SSignalListener &inListener) = 0;
-};
-
-struct SSignalSystemKey
-{
- void *m_Sender;
- const char *m_SignalName;
- SSignalSystemKey(void *inSender, const char *inSigName, IStringTable &inStrTable)
- : m_Sender(inSender)
- , m_SignalName(inStrTable.GetNarrowStr(inSigName))
- {
- }
- SSignalSystemKey(const SSignalSystemKey &inOther)
- : m_Sender(inOther.m_Sender)
- , m_SignalName(inOther.m_SignalName)
- {
- }
-
- SSignalSystemKey &operator=(const SSignalSystemKey &inOther)
- {
- if (this != &inOther) {
- m_Sender = inOther.m_Sender;
- m_SignalName = inOther.m_SignalName;
- }
- return *this;
- }
-
- bool operator==(const SSignalSystemKey &inOther) const
- {
- return m_Sender == inOther.m_Sender && m_SignalName == inOther.m_SignalName;
- }
-};
-
-struct SSignalListener : ISignalConnection
-{
- shared_ptr<ISignalSystemImpl> m_SignalSystem;
- TGenericSignalHandlerFunc m_Handler;
- SSignalSystemKey m_Key;
- SSignalListener(shared_ptr<ISignalSystemImpl> inSystem, TGenericSignalHandlerFunc inHandler,
- SSignalSystemKey inKey)
- : m_SignalSystem(inSystem)
- , m_Handler(inHandler)
- , m_Key(inKey)
- {
- }
- ~SSignalListener() { m_SignalSystem->RemoveListener(*this); }
- void Signal(void *inSender, const char *inName, const char *inData, size_t inDataSize)
- {
- m_Handler(inSender, inName, inData, inDataSize);
- }
-};
-
-typedef eastl::vector<SSignalListener *> TSignalListenerPtrList;
-}
-
-namespace eastl {
-template <>
-struct hash<SSignalSystemKey>
-{
- size_t operator()(const SSignalSystemKey &inKey) const
- {
- return hash<void *>()(inKey.m_Sender) ^ hash<const char *>()(inKey.m_SignalName);
- }
-};
-}
-
-namespace {
-typedef eastl::hash_map<SSignalSystemKey, TSignalListenerPtrList> TSignalHandlerMap;
-
-struct SSignalSystemImpl : public ISignalSystemImpl
-{
- TSignalHandlerMap m_SignalHandlers;
- shared_ptr<IStringTable> m_StringTable;
- SSignalSystemImpl(shared_ptr<IStringTable> inStrTable)
- : m_StringTable(inStrTable)
- {
- }
-
- TSignalListenerPtrList *FindListenerList(const SSignalSystemKey &inKey)
- {
- TSignalHandlerMap::iterator theIter = m_SignalHandlers.find(inKey);
- if (theIter != m_SignalHandlers.end())
- return &theIter->second;
- return NULL;
- }
-
- void Signal(void *inSender, const char *inName, const char *inData, size_t inDataSize)
- {
- TSignalListenerPtrList *theSignals =
- FindListenerList(SSignalSystemKey(inSender, inName, *m_StringTable));
- if (theSignals) {
- for (eastl_size_t idx = 0, end = theSignals->size(); idx < end; ++idx) {
- (*theSignals)[idx]->Signal(inSender, inName, inData, inDataSize);
- }
- }
- }
-
- void RemoveListener(SSignalListener &inListener) override
- {
- TSignalListenerPtrList *theSignals = FindListenerList(inListener.m_Key);
- if (theSignals) {
- // If we could allow unordered access then this could potentially be a lot faster.
- TSignalListenerPtrList::iterator theFind =
- eastl::find(theSignals->begin(), theSignals->end(), &inListener);
- if (theFind != theSignals->end())
- theSignals->erase(theFind);
- }
- }
-};
-
-struct SSignalSystem : public ISignalSystem
-{
- shared_ptr<SSignalSystemImpl> m_System;
- SSignalSystem(shared_ptr<IStringTable> inStrTable)
- {
- m_System = std::make_shared<SSignalSystemImpl>(inStrTable);
- }
-
- shared_ptr<ISignalConnection> AddListener(void *inSender, const char *inName,
- TGenericSignalHandlerFunc inFunc) override
- {
- SSignalSystemKey theKey(inSender, inName, *m_System->m_StringTable);
- TSignalHandlerMap::iterator theIter =
- m_System->m_SignalHandlers.insert(eastl::make_pair(theKey, TSignalListenerPtrList()))
- .first;
- TSignalListenerPtrList &theList(theIter->second);
- shared_ptr<SSignalListener> theSender =
- std::make_shared<SSignalListener>(m_System, inFunc, theKey);
- theList.push_back(theSender.get());
- return theSender;
- }
-
- void Signal(void *inSender, const char *inName, const char *inData, size_t inDataSize) override
- {
- m_System->Signal(inSender, inName, inData, inDataSize);
- }
-};
-}
-
-shared_ptr<ISignalSystem> ISignalSystem::CreateSignalSystem(shared_ptr<IStringTable> inStrTable)
-{
- return std::make_shared<SSignalSystem>(inStrTable);
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.h
deleted file mode 100644
index cd80010d..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignalSystem.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SIGNAL_SYSTEM_H
-#define QT3DSDM_SIGNAL_SYSTEM_H
-#include <functional>
-#include "Qt3DSDMSignals.h"
-
-namespace qt3dsdm {
-typedef std::function<void(void *, const char *, const char *, size_t)> TGenericSignalHandlerFunc;
-
-class ISignalSystem
-{
-protected:
- virtual ~ISignalSystem() {}
-public:
- virtual shared_ptr<ISignalConnection> AddListener(void *inSender, const char *inName,
- TGenericSignalHandlerFunc inFunc) = 0;
- virtual void Signal(void *inSender, const char *inName, const char *inData,
- size_t inDataSize) = 0;
-
- static shared_ptr<ISignalSystem> CreateSignalSystem(shared_ptr<IStringTable> inStrTable);
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignals.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignals.h
deleted file mode 100644
index 57b96591..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSignals.h
+++ /dev/null
@@ -1,611 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SIGNALS_H
-#define QT3DSDM_SIGNALS_H
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMAnimation.h"
-#include "Qt3DSDMActionInfo.h"
-#include "Qt3DSDMValue.h"
-#include <functional>
-#include <string>
-
-namespace qt3dsdm {
-
-class ISignalConnection
-{
-public:
- virtual ~ISignalConnection() {}
-};
-
-class ISignalItem
-{
-public:
- virtual ~ISignalItem() {}
-};
-
-typedef std::shared_ptr<ISignalItem> TSignalItemPtr;
-
-typedef std::shared_ptr<ISignalConnection> TSignalConnectionPtr;
-
-class QtSignalConnection : public ISignalConnection
-{
- Q_DISABLE_COPY(QtSignalConnection)
-private:
- QMetaObject::Connection m_connection;
-public:
- QtSignalConnection(const QMetaObject::Connection &inConnection)
- : m_connection(inConnection)
- {
- }
- ~QtSignalConnection() override
- {
- QObject::disconnect(m_connection);
- }
-};
-
-
-class IInstancePropertyCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr ConnectInstancePropertyValue(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, const SValue &)>
- &inCallback) = 0;
-};
-
-class IInstancePropertyCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SignalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-};
-
-class IDataCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr
- ConnectInstanceCreated(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectBeforeInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstanceDerived(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstanceParentRemoved(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectPropertyAdded(const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- TCharPtr, DataModelDataType::Value)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectPropertyRemoved(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, TCharPtr,
- DataModelDataType::Value)> &inCallback) = 0;
-};
-
-class IDataCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SignalInstanceCreated(Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SignalBeforeInstanceDeleted(Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SignalInstanceDeleted(Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SignalInstanceDerived(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) = 0;
- virtual void SignalInstanceParentRemoved(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) = 0;
- virtual void SignalPropertyAdded(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, TCharPtr inName,
- DataModelDataType::Value inDataType) = 0;
- virtual void SignalPropertyRemoved(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, TCharPtr inName,
- DataModelDataType::Value inDataType) = 0;
-};
-
-class ISlideCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr
- ConnectSlideCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectBeforeSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectSlideDerived(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle, int)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstancePropertyValueSet(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstancePropertyValueRemoved(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectSlideTimeChanged(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
-};
-
-class ISlideCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SendSlideCreated(Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendBeforeSlideDeleted(Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendSlideDeleted(Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendSlideDerived(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent,
- int inIndex) = 0;
- virtual void SendPropertyValueSet(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inParent, const SValue &inValue) = 0;
- // This gives clients a chance to override a property value the first time it is set on a slide
- virtual void SendPropertyValueRemoved(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inParent, const SValue &inValue) = 0;
- virtual void SendSlideTimeChanged(Qt3DSDMSlideHandle inSlide) = 0;
-};
-
-class ISlideGraphCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr ConnectGraphCreated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectGraphDeleted(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstanceAssociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstanceDissociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectGraphActiveSlide(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) = 0;
-};
-
-class ISlideGraphCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SendGraphCreated(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendGraphDeleted(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendInstanceAssociated(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SendInstanceDissociated(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SendGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph,
- Qt3DSDMSlideHandle inSlide) = 0;
-};
-
-class IAnimationCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr ConnectAnimationCreated(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectBeforeAnimationDeleted(
- const std::function<void(Qt3DSDMAnimationHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectAnimationDeleted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectKeyframeInserted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectBeforeKeyframeErased(const std::function<void(Qt3DSDMKeyframeHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectKeyframeErased(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectBeforeAllKeyframesErased(
- const std::function<void(Qt3DSDMAnimationHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectKeyframeUpdated(
- const std::function<void(Qt3DSDMKeyframeHandle, const TKeyframe &)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectFirstKeyframeDynamicSet(
- const std::function<void(Qt3DSDMAnimationHandle, bool)> &inCallback) = 0;
-};
-
-class IAnimationCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SendAnimationCreated(Qt3DSDMAnimationHandle inAnimation, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType) = 0;
- virtual void SendBeforeAnimationDeleted(Qt3DSDMAnimationHandle inAnimation) = 0;
- virtual void SendAnimationDeleted(Qt3DSDMAnimationHandle inAnimation, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType) = 0;
- virtual void SendKeyframeInserted(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) = 0;
- virtual void SendBeforeKeyframeErased(Qt3DSDMKeyframeHandle inAnimation) = 0;
- virtual void SendKeyframeErased(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) = 0;
- virtual void SendBeforeAllKeyframesErased(Qt3DSDMAnimationHandle inAnimation) = 0;
- virtual void SendKeyframeUpdated(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) = 0;
- virtual void SendFirstKeyframeDynamicSet(Qt3DSDMAnimationHandle inAnimation,
- bool inKeyframeDynamic) = 0;
-};
-
-class IActionCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr ConnectTriggerObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectTargetObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectEventSet(
- const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectHandlerSet(
- const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectHandlerArgumentAdded(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectHandlerArgumentRemoved(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectHandlerArgumentValueSet(
- const std::function<void(Qt3DSDMHandlerArgHandle, const SValue &)> &inCallback) = 0;
-};
-
-class IActionCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SendTriggerObjectSet(Qt3DSDMActionHandle inAction,
- SObjectRefType &inTriggerObject) = 0;
- virtual void SendTargetObjectSet(Qt3DSDMActionHandle inAction,
- SObjectRefType &inTargetObject) = 0;
- virtual void SendEventSet(Qt3DSDMActionHandle inAction, const wstring &inEventHandle) = 0;
- virtual void SendHandlerSet(Qt3DSDMActionHandle inAction, const wstring &inActionName) = 0;
-
- virtual void SendHandlerArgumentAdded(Qt3DSDMActionHandle inAction,
- Qt3DSDMHandlerArgHandle inHandlerArgument,
- const TCharStr &inName, HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) = 0;
- virtual void SendHandlerArgumentRemoved(Qt3DSDMActionHandle inAction,
- Qt3DSDMHandlerArgHandle inHandlerArgument,
- const TCharStr &inName, HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) = 0;
- virtual void SendHandlerArgumentValueSet(Qt3DSDMHandlerArgHandle inHandlerArgument,
- const SValue &inValue) = 0;
-};
-
-class IActionSystemSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr ConnectActionCreated(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectActionDeleted(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) = 0;
-};
-
-class IActionSystemSignalSender : public ISignalItem
-{
-public:
- virtual void SendActionCreated(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendActionDeleted(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) = 0;
-};
-
-class ICustomPropCoreSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr ConnectCustomPropertyCreated(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomPropertyDeleted(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomPropertyModified(
- const std::function<void(Qt3DSDMPropertyHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectCustomEventCreated(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomEventDeleted(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectCustomEventModified(const std::function<void(Qt3DSDMEventHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectCustomHandlerCreated(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerDeleted(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectCustomHandlerModified(const std::function<void(Qt3DSDMHandlerHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectCustomHandlerParamCreated(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerParamDeleted(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerParamModified(
- const std::function<void(Qt3DSDMHandlerParamHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectCustomReferencesModified(
- const std::function<void(Qt3DSDMInstanceHandle, const TCharStr &)> &inCallback) = 0;
-};
-
-class ICustomPropCoreSignalSender : public ISignalItem
-{
-public:
- virtual void SendCustomPropertyCreated(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomPropertyDeleted(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomPropertyModified(Qt3DSDMPropertyHandle inProp) = 0;
-
- virtual void SendCustomEventCreated(Qt3DSDMEventHandle inEvent,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomEventDeleted(Qt3DSDMEventHandle inEvent,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomEventModified(Qt3DSDMEventHandle inEvent) = 0;
-
- virtual void SendCustomHandlerCreated(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomHandlerDeleted(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomHandlerModified(Qt3DSDMHandlerHandle inHandler) = 0;
-
- virtual void SendCustomHandlerParamCreated(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) = 0;
- virtual void SendCustomHandlerParamDeleted(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) = 0;
- virtual void SendCustomHandlerParamModified(Qt3DSDMHandlerParamHandle inParameter) = 0;
-
- virtual void SendCustomReferencesModified(Qt3DSDMInstanceHandle inOwner,
- const TCharStr &inString) = 0;
-};
-
-class ISlideSystemSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr
- ConnectMasterCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectMasterDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectSlideCreated(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectSlideDeleted(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectSlideRearranged(
- const std::function<void(Qt3DSDMSlideHandle, int, int)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstanceAssociated(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectInstanceDissociated(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectPropertyLinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectPropertyUnlinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectActiveSlide(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle, Qt3DSDMSlideHandle)>
- &inCallback) = 0;
-};
-
-class ISlideSystemSignalSender : public ISignalItem
-{
-public:
- virtual void SendMasterCreated(Qt3DSDMSlideHandle inMaster) = 0;
- virtual void SendMasterDeleted(Qt3DSDMSlideHandle inMaster) = 0;
- virtual void SendSlideCreated(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendSlideDeleted(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendSlideRearranged(Qt3DSDMSlideHandle inMaster, int inOldIndex,
- int inNewIndex) = 0;
- virtual void SendInstanceAssociated(Qt3DSDMSlideHandle inMaster,
- Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SendInstanceDissociated(Qt3DSDMSlideHandle inMaster,
- Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SendPropertyLinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void SendPropertyUnlinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void SendActiveSlide(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inOldSlide, Qt3DSDMSlideHandle inNewSlide) = 0;
-};
-
-class IStudioFullSystemSignalProvider : public ISignalItem
-{
-public:
- virtual TSignalConnectionPtr
- ConnectSlideCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectSlideRearranged(
- const std::function<void(Qt3DSDMSlideHandle, int, int)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectBeginComponentSeconds(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectComponentSeconds(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectPropertyLinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectPropertyUnlinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectActiveSlide(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr
- ConnectInstanceCreated(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr
- ConnectAnimationCreated(const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectAnimationDeleted(const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectKeyframeInserted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectKeyframeErased(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectKeyframeUpdated(const std::function<void(Qt3DSDMKeyframeHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectFirstKeyframeDynamicSet(
- const std::function<void(Qt3DSDMAnimationHandle, bool)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectInstancePropertyValue(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectActionCreated(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectActionDeleted(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectTriggerObjectSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectTargetObjectSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectEventSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectHandlerSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectHandlerArgumentValueSet(
- const std::function<void(Qt3DSDMHandlerArgHandle)> &inCallback) = 0;
-
- virtual TSignalConnectionPtr ConnectCustomPropertyCreated(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomPropertyDeleted(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomPropertyModified(
- const std::function<void(Qt3DSDMPropertyHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomEventCreated(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomEventDeleted(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectCustomEventModified(const std::function<void(Qt3DSDMEventHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerCreated(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerDeleted(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr
- ConnectCustomHandlerModified(const std::function<void(Qt3DSDMHandlerHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerParamCreated(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerParamDeleted(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomHandlerParamModified(
- const std::function<void(Qt3DSDMHandlerParamHandle)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectCustomReferencesModified(
- const std::function<void(Qt3DSDMInstanceHandle, const TCharStr &)> &inCallback) = 0;
- virtual TSignalConnectionPtr ConnectControlledToggled(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> &inCallback) = 0;
-};
-
-class IStudioFullSystemSignalSender : public ISignalItem
-{
-public:
- virtual void SendSlideCreated(Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendSlideDeleted(Qt3DSDMSlideHandle inSlide) = 0;
- virtual void SendSlideRearranged(Qt3DSDMSlideHandle inMaster, int inOldIndex,
- int inNewIndex) = 0;
- virtual void SendComponentSeconds(Qt3DSDMSlideHandle inMaster) = 0;
- virtual void SendBeginComponentSeconds(Qt3DSDMSlideHandle inMaster) = 0;
- virtual void SendPropertyLinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void SendPropertyUnlinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void SendActiveSlide(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inSlide) = 0;
-
- virtual void SendInstanceCreated(Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void SendInstanceDeleted(Qt3DSDMInstanceHandle inInstance) = 0;
-
- virtual void SendAnimationCreated(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void SendAnimationDeleted(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void SendKeyframeInserted(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe) = 0;
- virtual void SendKeyframeErased(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe) = 0;
- virtual void SendKeyframeUpdated(Qt3DSDMKeyframeHandle inKeyframe) = 0;
- virtual void SendConnectFirstKeyframeDynamicSet(Qt3DSDMAnimationHandle inAnimation,
- bool inDynamic) = 0;
-
- virtual void SendInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
-
- virtual void SendActionCreated(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendActionDeleted(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendTriggerObjectSet(Qt3DSDMActionHandle inAction) = 0;
- virtual void SendTargetObjectSet(Qt3DSDMActionHandle inAction) = 0;
- virtual void SendEventSet(Qt3DSDMActionHandle inAction) = 0;
- virtual void SendHandlerSet(Qt3DSDMActionHandle inAction) = 0;
- virtual void SendHandlerArgumentValueSet(Qt3DSDMHandlerArgHandle inHandlerArgument) = 0;
-
- virtual void SendCustomPropertyCreated(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomPropertyDeleted(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomPropertyModified(Qt3DSDMPropertyHandle inProp) = 0;
- virtual void SendCustomEventCreated(Qt3DSDMEventHandle inEvent,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomEventDeleted(Qt3DSDMEventHandle inEvent,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomEventModified(Qt3DSDMEventHandle inEvent) = 0;
- virtual void SendCustomHandlerCreated(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomHandlerDeleted(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) = 0;
- virtual void SendCustomHandlerModified(Qt3DSDMHandlerHandle inHandler) = 0;
- virtual void SendCustomHandlerParamCreated(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) = 0;
- virtual void SendCustomHandlerParamDeleted(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) = 0;
- virtual void SendCustomHandlerParamModified(Qt3DSDMHandlerParamHandle inParameter) = 0;
- virtual void SendCustomReferencesModified(Qt3DSDMInstanceHandle inOwner,
- const TCharStr &inString) = 0;
- virtual void SendControlledToggled(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
-};
-
-// Use this if you want to register for only a specific instance or specific property
-template <typename TTransaction>
-inline void MaybackCallbackInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- Qt3DSDMInstanceHandle inDesiredInstance,
- Qt3DSDMPropertyHandle inDesiredProperty,
- TTransaction inCallback)
-{
- if ((!inDesiredInstance.Valid() || (inDesiredInstance == inInstance))
- && (!inDesiredProperty.Valid() || (inDesiredProperty == inProperty)))
- inCallback(inInstance, inProperty);
-}
-
-void SetDataModelSignalsEnabled(bool inEnabled);
-// Defaults to true
-bool AreDataModelSignalsEnabled();
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideCore.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideCore.h
deleted file mode 100644
index 8216b01d..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideCore.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SLIDE_CORE_H
-#define QT3DSDM_SLIDE_CORE_H
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMDataTypes.h"
-#include "HandleSystemBase.h"
-#include "Qt3DSDMStringTable.h"
-#include "Qt3DSDMDataCore.h"
-
-namespace qt3dsdm {
-typedef std::pair<Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle> TInstancePropertyPair;
-typedef std::vector<TInstancePropertyPair> TInstancePropertyPairList;
-
-// instance,property,value
-typedef std::tuple<Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, SValue> TSlideEntry;
-typedef std::vector<TSlideEntry> TSlideEntryList;
-
-class ISlideCore : public IHandleBase
-{
-public:
- virtual ~ISlideCore() {}
- virtual TStringTablePtr GetStringTablePtr() const = 0;
- virtual IStringTable &GetStringTable() const = 0;
- //===============================================================
- // Slide lifetime management
- //===============================================================
- /**
- * Create a new slide. Slides must have an instance allocated for them.
- */
- virtual Qt3DSDMSlideHandle CreateSlide(Qt3DSDMInstanceHandle inInstance) = 0;
- /**
- * Return the instance that was allocated for this slide.
- */
- virtual Qt3DSDMInstanceHandle GetSlideInstance(Qt3DSDMSlideHandle inSlide) const = 0;
- /**
- * Reverse lookup into the slide system so you can match slides to instances.
- */
- virtual Qt3DSDMSlideHandle GetSlideByInstance(Qt3DSDMInstanceHandle inSlide) const = 0;
- /**
- * Delete a given slide. This recursively deletes all children. All associated instances
- * are returned in the outInstances list so the caller can further delete them.
- * The deleted object is removed from the parent's list of children. Child objects are
- * also deleted.
- */
- virtual void DeleteSlide(Qt3DSDMSlideHandle inSlide, TInstanceHandleList &outInstances) = 0;
- /**
- * Return all of the slides in the core.
- */
- virtual void GetSlides(TSlideHandleList &outSlides) const = 0;
-
- virtual float GetSlideTime(Qt3DSDMSlideHandle inSlide) const = 0;
-
- virtual void SetSlideTime(Qt3DSDMSlideHandle inSlide, float inNewTime) = 0;
-
- //===============================================================
- // Slide derivation
- //===============================================================
- /**
- * Derive a slide from another slide. This simply provides an alternate path for property
- *lookup
- * if it isn't found on this slide. OK for parent to be an invalid handle. It is also fine
- * for the slide to have a valid parent; all involved parties are notified and updated.
- */
- virtual void DeriveSlide(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent,
- int inIndex = -1) = 0;
- /**
- * Return the parent slide for this slide. Invalid handle if no parent.
- */
- virtual Qt3DSDMSlideHandle GetParentSlide(Qt3DSDMSlideHandle inSlide) const = 0;
- /**
- * Return a list of derived slides for this slide.
- */
- virtual void GetChildSlides(Qt3DSDMSlideHandle inSlide, TSlideHandleList &outChildren) const = 0;
-
- /**
- * Return the index of this child. Exception if child isn't found
- */
- virtual int GetChildIndex(Qt3DSDMSlideHandle inParent, Qt3DSDMSlideHandle inChild) const = 0;
- //===============================================================
-
- //===============================================================
- // Instance Property Access
- //===============================================================
- /**
- * Get this property from this instance in this slide. Includes lookup into any parent slides.
- */
- virtual bool GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
-
- /**
- * Set this property. If this slide doesn't already contain an entry
- *(PushPropertyValueToChildren)
- * then this will attempt to set it on the parent slide. If it does not have a parent slide or
- *if
- * it already has a property entry then it sets the value locally.
- */
- virtual void SetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- /**
- * Set this property on this slide; do not try to set on parent slide under any circumstances.
- *Always adds entry to this slide.
- */
- virtual void ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- /**
- * Set a property value on an instance on all slides.
- */
- virtual void forceSetInstancePropertyValueOnAllSlides(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- /**
- * Return the value for this property if it exists on this slide.
- */
- virtual bool GetSpecificInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
-
- /**
- * Return all of the properties for this instance stored on this slide.
- */
- virtual void GetSpecificInstancePropertyValues(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleValuePairList &outValues) = 0;
-
- /**
- * Get all of the property entries for the slide.
- */
- virtual void GetSlidePropertyEntries(Qt3DSDMSlideHandle inSlide,
- TSlideEntryList &outEntries) const = 0;
-
- /**
- * Set this property value on all my child slides.
- */
- virtual void PushPropertyValueToChildren(Qt3DSDMSlideHandle inParent,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- /**
- * If any property entries in slide1 intersect (have matching instance and property handles)
- *with slide 2,
- * add said property entry from slide1 to outEntries;
- */
- virtual void GetIntersectingProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- TSlideEntryList &outEntries) const = 0;
-
- /**
- * Take the intersection of the properties of slide1 and slide2 and push values from slide1 to
- *destination.
- * Used for new slide operations.
- */
- virtual void PushIntersectingProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- Qt3DSDMSlideHandle inDestination) = 0;
-
- /**
- * Ensure the children of this parent item do not contain entries for a given property.
- */
- virtual void ClearChildrenPropertyValues(Qt3DSDMSlideHandle inParent,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) = 0;
-
- /**
- * Delete all property entries related to this instance.
- */
- virtual void DeleteAllInstanceEntries(Qt3DSDMInstanceHandle inHandle) = 0;
-
- /**
- * Delete all of the property entries related to this property
- */
- virtual void DeleteAllPropertyEntries(Qt3DSDMPropertyHandle inHandle) = 0;
-
- /**
- * Delete all property entries that have an instance in the instances list *and*
- * a property in the properties list.
- */
- virtual void DeleteAllInstancePropertyEntries(const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties) = 0;
-
- /**
- * Does this slide contain this property?
- */
- virtual bool ContainsProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) const = 0;
-
- /**
- * Copy the properties from the source slide and source instance to the destination slide and
- *destination
- * instance.
- */
- virtual void CopyProperties(Qt3DSDMSlideHandle inSourceSlide,
- Qt3DSDMInstanceHandle inSourceInstance,
- Qt3DSDMSlideHandle inDestSlide,
- Qt3DSDMInstanceHandle inDestInstance) = 0;
-
- virtual bool IsSlide(Qt3DSDMSlideHandle inSlide) const = 0;
-};
-
-typedef std::shared_ptr<ISlideCore> TSlideCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideGraphCore.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideGraphCore.h
deleted file mode 100644
index 34c04e11..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlideGraphCore.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SLIDE_GRAPH_CORE_H
-#define QT3DSDM_SLIDE_GRAPH_CORE_H
-
-#include "Qt3DSDMHandles.h"
-#include "HandleSystemBase.h"
-
-namespace qt3dsdm {
-
-typedef std::pair<Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle> TSlideInstancePair;
-typedef std::vector<TSlideInstancePair> TSlideInstancePairList;
-typedef std::pair<Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle> TGraphSlidePair;
-
-/**
- * Binding instances to slide graphs.
- */
-class ISlideGraphCore : public IHandleBase
-{
-public:
- virtual ~ISlideGraphCore() {}
-
- /**
- * A slide graph is used to associate a set of instances to a set of slides.
- * This allows rapid lookup of properties, as an implementation of these.
- * There are a few assumptions here. First is that a given slide can be a member
- * of one and only one graph (i.e. it does not derive from another slide outside of the graph).
- * Second is that an instance is a member of one and only one graph.
- */
- virtual Qt3DSDMSlideGraphHandle CreateSlideGraph(Qt3DSDMSlideHandle inRoot) = 0;
- virtual Qt3DSDMSlideHandle GetGraphRoot(Qt3DSDMSlideGraphHandle inGraph) const = 0;
- virtual Qt3DSDMSlideGraphHandle GetSlideGraph(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual void GetSlideGraphs(TSlideGraphHandleList &outGraphs) const = 0;
- virtual void DeleteSlideGraph(Qt3DSDMSlideGraphHandle inHandle) = 0;
-
- /**
- * Associate a given instance handle with a given graph. This will ensure that property
- *lookups
- * will travel through this graph before they hit the main data core. Instances may be
- *associated
- * with a sub-slide of a given graph, not just the root. An instance associated with the root
- *is
- * implicitly associated with any root-derived slides.
- */
- virtual void AssociateInstance(Qt3DSDMSlideGraphHandle inSlideGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) = 0;
- virtual void GetAssociatedInstances(Qt3DSDMSlideGraphHandle inSlideGraph,
- TSlideInstancePairList &outAssociations) const = 0;
- virtual TGraphSlidePair GetAssociatedGraph(Qt3DSDMInstanceHandle inInstance) const = 0;
- virtual void DissociateInstance(Qt3DSDMInstanceHandle inInstance) = 0;
-
- /**
- * All graphs always have an active slide. This is assumed to be the root right off the bat.
- */
- virtual void SetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) = 0;
- virtual Qt3DSDMSlideHandle GetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph) const = 0;
-};
-
-typedef std::shared_ptr<ISlideGraphCore> TSlideGraphCorePtr;
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlides.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlides.h
deleted file mode 100644
index aa7c27ce..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMSlides.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_SLIDES_H
-#define QT3DSDM_SLIDES_H
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMSlideCore.h"
-
-namespace qt3dsdm {
-/**
- * Some properties point to instances which act like extended properties.
- * An example of this would be the images on materials. If a material has an
- * image in one of its slots, that image should be duplicated upon property unlink
- * and deleted upon property link. It (and its animations) should be duplicated upon
- * create slide and deleted upon slide destruction such that the concept that the image
- * is really a property on the material stays sound.
- */
-class IPropertyInstanceInfo
-{
-public:
- virtual ~IPropertyInstanceInfo() {}
-
- /**
- * Return the instance that relates to this property
- */
- virtual Qt3DSDMInstanceHandle GetInstanceForProperty(const SValue &inValue) = 0;
-
- /**
- * Duplicate this instance and whichever properties and animations you desire,
- * returning a new data model value that will be set on the newly created property.
- * Don't forget to associate the instance with a the dest slide. I doubt things
- * will work correctly if you do not.
- */
- virtual SValue CreateInstanceForProperty(Qt3DSDMSlideHandle inSourceSlide,
- Qt3DSDMSlideHandle inDestSlide,
- Qt3DSDMInstanceHandle inInstance) = 0;
-};
-
-typedef std::shared_ptr<IPropertyInstanceInfo> TPropertyInstanceInfoPtr;
-
-struct SInstanceSlideInformation
-{
- // The slide associated with the instance
- Qt3DSDMSlideHandle m_AssociatedSlide;
- // The master slide of the component.
- Qt3DSDMSlideHandle m_MasterSlide;
- // The active slide of the component.
- Qt3DSDMSlideHandle m_ActiveSlide;
- // The current milliseconds of the active slide on the component.
- long m_ComponentMilliseconds;
-
- SInstanceSlideInformation()
- : m_ComponentMilliseconds(0)
- {
- }
- SInstanceSlideInformation(Qt3DSDMSlideHandle inAssoc, Qt3DSDMSlideHandle inMaster,
- Qt3DSDMSlideHandle inActive, long inMilliseconds)
- : m_AssociatedSlide(inAssoc)
- , m_MasterSlide(inMaster)
- , m_ActiveSlide(inActive)
- , m_ComponentMilliseconds(inMilliseconds)
- {
- }
-};
-
-class ISlideSystem
-{
-public:
- virtual ~ISlideSystem() {}
- virtual Qt3DSDMSlideHandle CreateMasterSlide() = 0;
- virtual Qt3DSDMSlideHandle CreateSlide(Qt3DSDMSlideHandle inMaster, int inIndex = -1) = 0;
- // Duplicate this slide and put it into the master's child lists at index.
- virtual Qt3DSDMSlideHandle DuplicateSlide(Qt3DSDMSlideHandle inSourceSlide, int inDestIndex) = 0;
- virtual Qt3DSDMSlideHandle GetMasterSlide(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual bool IsMasterSlide(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual Qt3DSDMSlideHandle GetMasterSlideByComponentGuid(SLong4 inGuid) const = 0;
- // Indexes are 1 based. Index 0 refers to the master slide; you can't delete this.
- virtual void DeleteSlideByIndex(Qt3DSDMSlideHandle inMaster, size_t inIndex) = 0;
- virtual void GetSlideReferencedInstances(Qt3DSDMSlideHandle inMaster, size_t inIndex,
- TInstanceHandleList &outReferencedInstances) = 0;
- virtual Qt3DSDMSlideHandle GetSlideByIndex(Qt3DSDMSlideHandle inMaster, size_t inIndex) const = 0;
- virtual void SetActiveSlide(Qt3DSDMSlideHandle inMaster, size_t inIndex) = 0;
- virtual void RearrangeSlide(Qt3DSDMSlideHandle inMaster, size_t inOldIndex,
- size_t inNewIndex) = 0;
- /**
- * Set the current component time. This object will figure out the component from the slide.
- */
- virtual void SetComponentSeconds(Qt3DSDMSlideHandle inSlide, float inSeconds) = 0;
- /**
- * Return the current time of the component
- */
- virtual float GetComponentSeconds(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual long GetComponentSecondsLong(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual long GetComponentSecondsLong(Qt3DSDMInstanceHandle inInstance) const = 0;
-
- // The fastest way possible, get all of the slide information for this instance.
- virtual SInstanceSlideInformation
- GetInstanceSlideInformation(Qt3DSDMInstanceHandle inInstance) const = 0;
- /**
- * Slide count includes the master slide;
- */
- virtual size_t GetSlideCount(Qt3DSDMSlideHandle inMaster) const = 0;
- /**
- * Use the instance for storing information such as name, or the GUID of the object
- * this slide links to.
- */
- virtual Qt3DSDMInstanceHandle GetSlideInstance(Qt3DSDMSlideHandle inSlide) const = 0;
- /**
- * Reverse lookup into the slide system so you can match slides to instances.
- */
- virtual Qt3DSDMSlideHandle GetSlideByInstance(Qt3DSDMInstanceHandle inInstance) const = 0;
- /**
- * Slide may be either a master slide
- */
- virtual void AssociateInstanceWithSlide(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) = 0;
- virtual Qt3DSDMSlideHandle GetAssociatedSlide(Qt3DSDMInstanceHandle inInstance) const = 0;
- virtual void GetAssociatedInstances(
- Qt3DSDMSlideHandle inMaster,
- std::vector<std::pair<Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle>> &outAssociations) const = 0;
- virtual void GetAssociatedInstances(Qt3DSDMSlideHandle inSlide,
- TInstanceHandleList &outAssociations) const = 0;
- virtual void LinkProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) = 0;
- virtual void UnlinkProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) = 0;
- virtual bool IsPropertyLinked(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual bool CanPropertyBeLinked(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
- virtual void GetUnionOfProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide,
- TInstancePropertyPairList &outProperties) const = 0;
-
- virtual bool GetSlidePropertyValue(size_t inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) = 0;
-
- virtual void SetActiveSlide(Qt3DSDMSlideHandle inSlide) = 0;
- virtual Qt3DSDMSlideHandle GetAssociatedSlide(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const = 0;
-
- virtual bool SlideValid(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual int GetSlideIndex(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual int GetActiveSlideIndex(Qt3DSDMSlideHandle inMaster) const = 0;
- virtual Qt3DSDMSlideHandle GetActiveSlide(Qt3DSDMSlideHandle inMaster) const = 0;
- virtual Qt3DSDMInstanceHandle GetSlideSelectedInstance(Qt3DSDMSlideHandle inSlide) const = 0;
- virtual void SetSlideSelectedInstance(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) = 0;
-
- virtual Qt3DSDMSlideHandle GetApplicableSlide(Qt3DSDMInstanceHandle inHandle) = 0;
- virtual Qt3DSDMSlideHandle GetApplicableSlide(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) = 0;
-
- virtual bool GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
- virtual bool GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const = 0;
- virtual void ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) = 0;
-
- /**
- * Let this object know that this property will sometimes reference another property
- * and give an outside entity the chance to create new objects and properties when
- * the property is unlinked and linked.
- */
- virtual void RegisterPropertyInstance(Qt3DSDMPropertyHandle inPropertyHandle,
- TPropertyInstanceInfoPtr inPropertyInfo) = 0;
-};
-
-typedef std::shared_ptr<ISlideSystem> TSlideSystemPtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.cpp
deleted file mode 100644
index 58db71c7..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMStringTable.h"
-#include "foundation/StringTable.h"
-#include "foundation/TrackingAllocator.h"
-
-using namespace qt3dsdm;
-using namespace eastl;
-using namespace qt3ds;
-
-namespace {
-
-struct StringTableImpl : public IStringTable
-{
- qt3ds::foundation::MallocAllocator m_MallocAllocator;
- qt3ds::foundation::IStringTable &m_StringTable;
- StringTableImpl()
- : m_StringTable(qt3ds::foundation::IStringTable::CreateStringTable(m_MallocAllocator))
- {
- m_StringTable.addRef();
- }
- StringTableImpl(qt3ds::foundation::IStringTable &inStrTable)
- : m_StringTable(inStrTable)
- {
- m_StringTable.addRef();
- }
-
- virtual ~StringTableImpl() { m_StringTable.release(); }
- const wchar_t *RegisterStr(const wchar_t *inStr) override
- {
- return m_StringTable.GetWideStr(inStr);
- }
- const char8_t *RegisterStr(const char8_t *inStr) override
- {
- return m_StringTable.GetNarrowStr(inStr);
- }
- // Get the utf-8 or utf-(sizeof wchar_t) converted strings
- const wchar_t *GetWideStr(const char8_t *inStr) override
- {
- return m_StringTable.GetWideStr(inStr);
- }
- const char8_t *GetNarrowStr(const wchar_t *inStr) override
- {
- return m_StringTable.GetNarrowStr(inStr);
- }
- qt3ds::foundation::IStringTable &GetRenderStringTable() override { return m_StringTable; }
-};
-}
-
-TStringTablePtr IStringTable::CreateStringTable()
-{
- return std::make_shared<StringTableImpl>();
-}
-
-TStringTablePtr IStringTable::CreateStringTable(qt3ds::foundation::IStringTable &inStrTable)
-{
- return std::make_shared<StringTableImpl>(std::ref(inStrTable));
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.h
deleted file mode 100644
index 7f1e9453..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMStringTable.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_IMPORT_STRINGTABLE_H
-#define QT3DS_IMPORT_STRINGTABLE_H
-
-#include <string>
-#include <EABase/eabase.h>
-#include "foundation/Qt3DSPreprocessor.h"
-
-namespace qt3ds {
-namespace foundation {
- class IStringTable;
-}
-}
-
-namespace qt3dsdm {
-
-class QT3DS_AUTOTEST_EXPORT IStringTable
-{
-public:
- virtual ~IStringTable() {}
-
- virtual const wchar_t *RegisterStr(const wchar_t *inStr) = 0;
- virtual const char8_t *RegisterStr(const char8_t *inStr) = 0;
- // Get the utf-8 or utf-(sizeof wchar_t) converted strings
- virtual const wchar_t *GetWideStr(const char8_t *inStr) = 0;
- virtual const char8_t *GetNarrowStr(const wchar_t *inStr) = 0;
-
- const wchar_t *GetWideStr(const wchar_t *inStr) { return RegisterStr(inStr); }
- const char8_t *GetNarrowStr(const char8_t *inStr) { return RegisterStr(inStr); }
-
- const wchar_t *RegisterStr(const std::wstring &inStr) { return RegisterStr(inStr.c_str()); }
- const char8_t *RegisterStr(const std::string &inStr) { return RegisterStr(inStr.c_str()); }
-
- virtual qt3ds::foundation::IStringTable &GetRenderStringTable() = 0;
-
- static std::shared_ptr<IStringTable> CreateStringTable();
- static std::shared_ptr<IStringTable>
- CreateStringTable(qt3ds::foundation::IStringTable &inStrTable);
-};
-typedef std::shared_ptr<IStringTable> TStringTablePtr;
-};
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTestOps.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTestOps.h
deleted file mode 100644
index ac43eaf0..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTestOps.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_OPS_H
-#define QT3DSDM_OPS_H
-
-namespace qt3dsdm {
-inline const TCharStr &GetPropertyName(const IDataCore &inModel, Qt3DSDMPropertyHandle inProperty)
-{
- return inModel.GetProperty(inProperty).m_Name;
-}
-
-inline bool PropertyNameMatches(const IDataCore &inModel, const TCharStr &inName,
- Qt3DSDMPropertyHandle inProperty)
-{
- return inName == GetPropertyName(inModel, inProperty);
-}
-
-inline const Qt3DSDMPropertyHandle
-GetPropertyByName(const IDataCore &inModel, Qt3DSDMInstanceHandle inInstance, const TCharStr &inName)
-{
- using namespace std;
- TPropertyHandleList properties;
- inModel.GetAggregateInstanceProperties(inInstance, properties);
- TPropertyHandleList::iterator theProp =
- std::find_if(properties.begin(), properties.end(),
- std::bind(PropertyNameMatches, std::ref(inModel), inName,
- std::placeholders::_1));
- if (theProp != properties.end())
- return *theProp;
- return 0;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTransactions.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTransactions.h
deleted file mode 100644
index f6ed3da0..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMTransactions.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_TRANSACTIONS_H
-#define QT3DSDM_TRANSACTIONS_H
-#include "Qt3DSDMDataTypes.h"
-#include "StandardExtensions.h"
-#include <functional>
-
-namespace qt3dsdm {
-
-/**
- * Transaction is some small entity that changes data. A transaction consumer is expected to
- *execute
- * a list of these either forward on a "redo" command or backwards on an "undo" command.
- *
- * Transactions merely change data. There are two other lists on consumers for "do"
- *notifications
- * and "undo" notifications. These lists control the events sent out to the UI about what
- *actually
- * changed in the model. Note that undo/do notifications may be more clever than simple
- *send-signal
- * commands in that they may check if an object is alive or not before sending a notification
- *and may
- * decline to send a notification if the target object is not currently alive.
- *
- * Currently the undo/redo system first executes all of the transactions and then sends the
- *appropriate
- * notifications. This means that when the UI receives any notification, the model is in its
- *most-updated
- * state.
- */
-class ITransaction
-{
-public:
- const char *m_File;
- int m_Line;
-
- ITransaction(const char *inFile, int inLine)
- : m_File(inFile)
- , m_Line(inLine)
- {
- }
- virtual ~ITransaction() {}
- virtual void Do() = 0;
- virtual void Undo() = 0;
-};
-
-/**
- * Merging allows us to efficient handle situations where the users are continuously
- * modifying an object (or set of objects). These are referred to as live-update
- * scenarios. Dragging an object in the 3d view or dragging keyframes in the timeline
- * would be an example of live-update scenarios.
- */
-template <typename TValueType>
-class IMergeableTransaction
-{
-public:
- virtual ~IMergeableTransaction() {}
- // Called when a new value has arrived and we would rather update
- // an existing representation rather than create a new one.
- virtual void Update(const TValueType &inValue) = 0;
-};
-
-/**
- * A consumer is an object that records the transaction. This interface keeps the
- * base producer objects from binding to how the transaction or the notifications
- * are stored.
- */
-class ITransactionConsumer
-{
-public:
- virtual ~ITransactionConsumer() {}
- virtual void OnTransaction(std::shared_ptr<ITransaction> inTransaction) = 0;
- // Notifications to be sent for undo/redo These are used to
- // notify clients that something is different.
- virtual void OnDoNotification(std::function<void()> inNotification) = 0;
- virtual void OnUndoNotification(std::function<void()> inNotification) = 0;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Implementation of helper objects and functions.
-///////////////////////////////////////////////////////////////////////////////
-
-typedef std::vector<std::function<void()>> TVoidFunctionList;
-
-typedef std::shared_ptr<ITransactionConsumer> TTransactionConsumerPtr;
-
-class ITransactionProducer
-{
-public:
- virtual ~ITransactionProducer() {}
- virtual void SetConsumer(TTransactionConsumerPtr inConsumer) = 0;
-};
-
-template <typename TDoTransaction, typename TUndoTransaction>
-class CGenericTransaction : public ITransaction
-{
- Q_DISABLE_COPY(CGenericTransaction)
-
- TUndoTransaction m_UndoTransaction;
- TDoTransaction m_DoTransaction;
-
-public:
- CGenericTransaction(const char *inFile, int inLine, TDoTransaction inDo,
- TUndoTransaction inUndo)
- : ITransaction(inFile, inLine)
- , m_UndoTransaction(inUndo)
- , m_DoTransaction(inDo)
- {
- }
- void Do() override { m_DoTransaction(); }
- void Undo() override { m_UndoTransaction(); }
-};
-
-template <typename TDoTransaction, typename TUndoTransaction>
-ITransaction *DoCreateGenericTransaction(const char *inFile, int inLine, TDoTransaction inDo,
- TUndoTransaction inUndo)
-{
- return static_cast<ITransaction *>(
- new CGenericTransaction<TDoTransaction, TUndoTransaction>(inFile, inLine, inDo, inUndo));
-}
-
-#define CREATE_GENERIC_TRANSACTION(inDo, inUndo) \
- DoCreateGenericTransaction(__FILE__, __LINE__, inDo, inUndo)
-
-typedef std::shared_ptr<ITransaction> TTransactionPtr;
-typedef std::vector<TTransactionPtr> TTransactionPtrList;
-
-struct CTransactionConsumer : public ITransactionConsumer
-{
- TTransactionPtrList m_TransactionList;
- TVoidFunctionList m_DoNotifications;
- TVoidFunctionList m_UndoNotifications;
- void OnTransaction(TTransactionPtr inTransaction) override
- {
- m_TransactionList.push_back(inTransaction);
- }
- void OnDoNotification(std::function<void()> inNotification) override
- {
- m_DoNotifications.push_back(inNotification);
- }
- void OnUndoNotification(std::function<void()> inNotification) override
- {
- m_UndoNotifications.push_back(inNotification);
- }
-
- // Merge with another CTransactionConsumer
- virtual void Merge(const ITransactionConsumer *inConsumer)
- {
- const CTransactionConsumer *theConsumer =
- static_cast<const CTransactionConsumer *>(inConsumer);
- m_TransactionList.insert(m_TransactionList.begin(), theConsumer->m_TransactionList.begin(),
- theConsumer->m_TransactionList.end());
- }
- void Reset()
- {
- m_TransactionList.clear();
- m_DoNotifications.clear();
- m_UndoNotifications.clear();
- }
-};
-
-template <typename TTransactionType>
-inline void RunWithConsumer(TTransactionConsumerPtr inConsumer, TTransactionType inTransaction)
-{
- if (inConsumer)
- inTransaction(inConsumer);
-}
-
-template <typename TDoTransaction, typename TUndoTransaction>
-inline void CreateGenericTransactionWithConsumer(const char *inFile, int inLine,
- TTransactionConsumerPtr inConsumer,
- TDoTransaction inDoTransaction,
- TUndoTransaction inUndoTransaction)
-{
- if (inConsumer)
- inConsumer->OnTransaction(TTransactionPtr(
- DoCreateGenericTransaction(inFile, inLine, inDoTransaction, inUndoTransaction)));
-}
-
-template <typename TItemType>
-inline void DoSetConsumer(TTransactionConsumerPtr inConsumer,
- std::shared_ptr<TItemType> inTypePtr)
-{
- ITransactionProducer *theProducer = dynamic_cast<ITransactionProducer *>(inTypePtr.get());
- if (theProducer)
- theProducer->SetConsumer(inConsumer);
-}
-
-template <typename TContainer>
-inline void Undo(TContainer &inTransactions)
-{
- std::for_each(inTransactions.rbegin(), inTransactions.rend(), std::bind(&ITransaction::Undo,
- std::placeholders::_1));
-}
-
-template <typename TContainer>
-inline void Redo(TContainer &inTransactions)
-{
- do_all(inTransactions, std::bind(&ITransaction::Do, std::placeholders::_1));
-}
-
-template <typename TItemType>
-void Notify(std::vector<TItemType> &inNotifications)
-{
- do_all(inNotifications, std::bind(&TItemType::operator(), std::placeholders::_1));
-}
-
-template <typename TItemType>
-void NotifyReverse(std::vector<TItemType> &inNotifications)
-{
- std::for_each(inNotifications.rbegin(), inNotifications.rend(),
- std::bind(&TItemType::operator(), std::placeholders::_1));
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.cpp
deleted file mode 100644
index 94c5a594..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMValue.h"
-
-#include <QColor>
-#include <QDebug>
-#include <QVariant>
-
-using namespace qt3dsdm;
-
-SValue::SValue(const QVariant &inData)
-{
- switch (inData.type()) {
- case QVariant::Bool:
- {
- *this = inData.toBool();
- break;
- }
- case QVariant::Color:
- {
- const QColor c = inData.value<QColor>();
- *this = qt3dsdm::SFloat4(c.redF(), c.greenF(), c.blueF(), c.alphaF());
- break;
- }
- case QVariant::String:
- {
- const QString q = inData.toString();
- const int count = q.size() + 1;
-#ifdef __INTEGRITY
- wchar_t* tempBuf = reinterpret_cast<wchar_t*>(malloc(count * sizeof(wchar_t)));
-#else
- wchar_t* tempBuf = reinterpret_cast<wchar_t*>(alloca(count * sizeof(wchar_t)));
-#endif
- tempBuf[count - 1] = 0;
- q.toWCharArray(tempBuf);
- *this = std::make_shared<qt3dsdm::CDataStr>(tempBuf);
-#ifdef __INTEGRITY
- free(tempBuf);
-#endif
- break;
- }
- case QVariant::Int: {
- *this = inData.toInt();
- break;
- }
- case QVariant::Double: {
- *this = inData.toFloat();
- break;
- }
-
- case QVariant::Vector2D: {
- const auto v = inData.value<QVector2D>();
- *this = qt3dsdm::SFloat2(v.x(), v.y());
- break;
- }
-
- case QVariant::Vector3D: {
- const auto v = inData.value<QVector3D>();
- *this = qt3dsdm::SFloat3(v.x(), v.y(), v.z());
- break;
- }
-
- default:
- qDebug() << "Add a handler for QVariant::type" << inData.type();
- throw std::runtime_error("Cannot transform this QVariant into SValue");
- }
-}
-
-QVariant SValue::toQVariant() const
-{
- switch (getType()) {
- case DataModelDataType::String:
- case DataModelDataType::StringRef:
- {
- return get<QString>(*this);
- }
- case DataModelDataType::Float: {
- return get<float>(*this);
- }
- case DataModelDataType::Float2: {
- return QVariant::fromValue(get<QVector2D>(*this));
- }
- case DataModelDataType::Float3: {
- return QVariant::fromValue(get<QVector3D>(*this));
- }
- case DataModelDataType::Float4: {
- return QVariant::fromValue(get<QVector<float> >(*this));
- }
- case DataModelDataType::Long: {
- return QVariant::fromValue(get<qt3ds::QT3DSI32>(*this));
- }
- case DataModelDataType::Bool: {
- return get<bool>(*this);
- }
- case DataModelDataType::FloatList: {
- //KDAB_TODO
- qDebug() << "Add a handler for type DataModelDataType::FloatList";
- return {};
- }
- case DataModelDataType::Long4: {
- return QVariant::fromValue(get<QVector<qt3ds::QT3DSU32> >(*this));
- }
- case DataModelDataType::ObjectRef: {
- const SObjectRefType &theRef(get<SObjectRefType>(*this));
- switch (theRef.GetReferenceType()) {
- case ObjectReferenceType::Absolute:
- return SValue(get<SLong4>(theRef.m_Value)).toQVariant();
- break;
- case ObjectReferenceType::Relative:
- return SValue(get<TDataStrPtr>(theRef.m_Value)).toQVariant();
- break;
- case ObjectReferenceType::Unknown:
- return QVariant::fromValue(QVector<qt3ds::QT3DSU32>());
- break;
- }
- }
- case DataModelDataType::StringOrInt: {
- const SStringOrInt &theData(get<SStringOrInt>(*this));
- if (theData.GetType() == SStringOrIntTypes::Int) {
- return QVariant::fromValue(get<qt3ds::QT3DSI32>(theData.m_Value));
- } else if (theData.GetType() == SStringOrIntTypes::String) {
- auto wideStr = get<TDataStrPtr>(theData.m_Value)->GetData();
- return QString::fromWCharArray(wideStr);
- } else {
- return {};
- }
-
- }
- case DataModelDataType::None:
- return {};
- default:
- break;
- }
- return {};
-}
-
-SInternValue::SInternValue(const SValue &inValue, IStringTable &inStringTable)
-{
- if (GetValueType(inValue) == DataModelDataType::StringRef) {
- const SStringRef &current = get<SStringRef>(inValue);
- SStringRef newId = inStringTable.RegisterStr(current.m_Id);
- m_Value = SValue(newId);
- } else {
- m_Value = inValue;
- }
-}
-
-SInternValue::SInternValue(const SInternValue &inOther)
- : m_Value(inOther.m_Value)
-{
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.h
deleted file mode 100644
index 9e006320..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMValue.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_VALUE_H
-#define QT3DSDM_VALUE_H
-#include "Qt3DSDMDataTypes.h"
-
-#include <QColor>
-#include <QMetaType>
-#include <QVariant>
-#include <QVector>
-#include <QVector2D>
-#include <QVector3D>
-
-namespace qt3dsdm {
-
-template <typename TDataType>
-struct SDataTypeToEnumMap
-{
-};
-
-template <DataModelDataType::Value TEnumVal>
-struct SEnumToDataTypeMap
-{
-};
-
-#define DEFINE_QT3DSDM_DATA_TYPE_MAP(dtype, enumName) \
- template <> \
- struct SDataTypeToEnumMap<dtype> \
- { \
- static DataModelDataType::Value getType() { return enumName; } \
- }; \
- template <> \
- struct SEnumToDataTypeMap<enumName> \
- { \
- typedef dtype TDataType; \
- };
-
-#define ITERATE_QT3DSDM_DATA_TYPES \
- HANDLE_QT3DSDM_DATA_TYPE(float, DataModelDataType::Float); \
- HANDLE_QT3DSDM_DATA_TYPE(SFloat2, DataModelDataType::Float2); \
- HANDLE_QT3DSDM_DATA_TYPE(SFloat3, DataModelDataType::Float3); \
- HANDLE_QT3DSDM_DATA_TYPE(SFloat4, DataModelDataType::Float4); \
- HANDLE_QT3DSDM_DATA_TYPE(qt3ds::QT3DSI32, DataModelDataType::Long); \
- HANDLE_QT3DSDM_DATA_TYPE(TDataStrPtr, DataModelDataType::String); \
- HANDLE_QT3DSDM_DATA_TYPE(bool, DataModelDataType::Bool); \
- HANDLE_QT3DSDM_DATA_TYPE(SLong4, DataModelDataType::Long4); \
- HANDLE_QT3DSDM_DATA_TYPE(SStringRef, DataModelDataType::StringRef); \
- HANDLE_QT3DSDM_DATA_TYPE(SObjectRefType, DataModelDataType::ObjectRef); \
- HANDLE_QT3DSDM_DATA_TYPE(SStringOrInt, DataModelDataType::StringOrInt); \
- HANDLE_QT3DSDM_DATA_TYPE(TFloatList, DataModelDataType::FloatList);
-
-#define HANDLE_QT3DSDM_DATA_TYPE(a, b) DEFINE_QT3DSDM_DATA_TYPE_MAP(a, b)
-ITERATE_QT3DSDM_DATA_TYPES
-#undef HANDLE_QT3DSDM_DATA_TYPE
-
-struct Qt3DSDMDataTypeUnionTraits
-{
- typedef DataModelDataType::Value TIdType;
-
- enum {
- TBufferSize = sizeof(SObjectRefType),
- };
-
- static TIdType getNoDataId() { return DataModelDataType::None; }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return SDataTypeToEnumMap<TDataType>::getType();
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, DataModelDataType::Value inType, TVisitorType inVisitor)
- {
- switch (inType) {
-#define HANDLE_QT3DSDM_DATA_TYPE(dtype, enumType) \
- case enumType: \
- return inVisitor(*NVUnionCast<dtype *>(inData));
- ITERATE_QT3DSDM_DATA_TYPES
-#undef HANDLE_QT3DSDM_DATA_TYPE
-
- default:
- QT3DS_ASSERT(false);
- case DataModelDataType::None:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, DataModelDataType::Value inType, TVisitorType inVisitor)
- {
- switch (inType) {
-#define HANDLE_QT3DSDM_DATA_TYPE(dtype, enumType) \
- case enumType: \
- return inVisitor(*NVUnionCast<const dtype *>(inData));
- ITERATE_QT3DSDM_DATA_TYPES
-#undef HANDLE_QT3DSDM_DATA_TYPE
-
- default:
- QT3DS_ASSERT(false);
- case DataModelDataType::None:
- return inVisitor();
- }
- }
-};
-
-typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<Qt3DSDMDataTypeUnionTraits,
- Qt3DSDMDataTypeUnionTraits::TBufferSize>,
- Qt3DSDMDataTypeUnionTraits::TBufferSize>
- TValue;
-
-struct SValue : public TValue
-{
- SValue() {}
- SValue(const SValue &inOther)
- : TValue(static_cast<const TValue &>(inOther))
- {
- }
- SValue(const QVariant &inData);
-
- template <typename TDataType>
- SValue(const TDataType &inData)
- : TValue(inData)
- {
- }
- SValue &operator=(const SValue &inOther)
- {
- TValue::operator=(inOther);
- return *this;
- }
- bool operator==(const SValue &inOther) const { return TValue::operator==(inOther); }
- bool operator!=(const SValue &inOther) const { return TValue::operator!=(inOther); }
- bool empty() const { return getType() == DataModelDataType::None; }
-
- // Conversion from this data type into a data model value
- const SValue &toOldSkool() const { return *this; }
-
- QVariant toQVariant() const;
-};
-
-typedef std::shared_ptr<SValue> SValuePtr;
-
-template <>
-struct Qt3DSDMGetter<SValue>
-{
- template <typename TRetType>
- TRetType doGet(const SValue &inValue)
- {
- return inValue.getData<TRetType>();
- }
-};
-
-template <>
-struct Qt3DSDMValueTyper<SValue>
-{
- DataModelDataType::Value Get(const SValue &inValue) { return inValue.getType(); }
-};
-
-inline bool CheckValueType(DataModelDataType::Value inType, const SValue &inValue)
-{
- bool retval = inType == inValue.getType();
- if (!retval)
- throw ValueTypeError(L"");
- return retval;
-}
-
-inline bool Equals(const SValue &lhs, const SValue &rhs)
-{
- return lhs == rhs;
-}
-
-class SInternValue
-{
- SValue m_Value;
-
-public:
- SInternValue(const SValue &inValue, IStringTable &inTable);
- SInternValue() {}
- SInternValue(const SInternValue &inOther);
- SInternValue &operator=(const SInternValue &inOther)
- {
- m_Value = inOther.m_Value;
- return *this;
- }
-
- static SInternValue ISwearThisHasAlreadyBeenInternalized(const SValue &inValue)
- {
- SInternValue retval;
- retval.m_Value = inValue;
- return retval;
- }
-
- const SValue &GetValue() const { return m_Value; }
- operator const SValue &() const { return m_Value; }
-};
-
-template <>
-struct SDefaulter<SValue>
-{
- inline bool SetDefault(DataModelDataType::Value inDataType, SValue &outValue)
- {
- switch (inDataType) {
- case DataModelDataType::Float:
- outValue = SValue(0.f);
- break;
- case DataModelDataType::Float2:
- outValue = SValue(SFloat2());
- break;
- case DataModelDataType::Float3:
- outValue = SValue(SFloat3());
- break;
- case DataModelDataType::Float4:
- outValue = SValue(SFloat4());
- break;
- case DataModelDataType::Long:
- outValue = SValue(0);
- break;
- case DataModelDataType::String:
- outValue = SValue(TDataStrPtr(new CDataStr(L"")));
- break;
- case DataModelDataType::Bool:
- outValue = SValue(false);
- break;
- case DataModelDataType::Long4:
- outValue = SValue(SLong4());
- break;
- case DataModelDataType::StringRef:
- outValue = SValue(SStringRef());
- break;
- case DataModelDataType::ObjectRef:
- outValue = SValue(SObjectRefType());
- break;
- case DataModelDataType::FloatList:
- outValue = SValue(TFloatList());
- break;
- case DataModelDataType::StringOrInt:
- default:
- outValue = SValue(SStringOrInt());
- return false;
- }
- return true;
- }
-};
-
-inline SObjectRefType ConvertToObjectRef(const SValue &inValue)
-{
- using namespace std;
- switch (GetValueType(inValue)) {
- case DataModelDataType::StringRef:
- return SObjectRefType(make_shared<CDataStr>(get<SStringRef>(inValue).m_Id));
- case DataModelDataType::String:
- return SObjectRefType(get<TDataStrPtr>(inValue));
- case DataModelDataType::Long4:
- return SObjectRefType(get<SLong4>(inValue));
- case DataModelDataType::ObjectRef:
- return get<SObjectRefType>(inValue);
- default:
- break;
- }
- return SObjectRefType();
-}
-
-
-template <>
-inline QColor get<QColor>(const SValue &inType)
-{
- auto f = get<qt3dsdm::SFloat4>(inType);
- qreal r = qBound<qreal>(0.0, f.m_Floats[0], 1.0);
- qreal g = qBound<qreal>(0.0, f.m_Floats[1], 1.0);
- qreal b = qBound<qreal>(0.0, f.m_Floats[2], 1.0);
- qreal a = qBound<qreal>(0.0, f.m_Floats[3], 1.0);
- return QColor::fromRgbF(r, g, b, a);
-}
-
-template <>
-inline QString get<QString>(const qt3dsdm::SValue &inType)
-{
- return QString::fromWCharArray(qt3dsdm::get<qt3dsdm::TDataStrPtr>(inType)->GetData());
-}
-
-template <>
-inline QVector2D get<QVector2D>(const qt3dsdm::SValue &inType)
-{
- auto f = get<qt3dsdm::SFloat2>(inType);
- return QVector2D(f.m_Floats[0], f.m_Floats[1]);
-}
-
-template <>
-inline QVector3D get<QVector3D>(const qt3dsdm::SValue &inType)
-{
- auto f = get<qt3dsdm::SFloat3>(inType);
- return QVector3D(f.m_Floats[0], f.m_Floats[1], f.m_Floats[2]);
-}
-
-template <>
-inline QVector<float> get<QVector<float> >(const qt3dsdm::SValue &inType)
-{
- auto f = get<qt3dsdm::SFloat4>(inType);
- return {f.m_Floats[0], f.m_Floats[1], f.m_Floats[2], f.m_Floats[3]};
-}
-
-// KDAB_TODO Shortcut to not define our own 4 member long structure
-template <>
-inline QVector<qt3ds::QT3DSU32> get<QVector<qt3ds::QT3DSU32> >(const qt3dsdm::SValue &inType)
-{
- auto f = get<qt3dsdm::SLong4>(inType);
- return {f.m_Longs[0], f.m_Longs[1], f.m_Longs[2], f.m_Longs[3]};
-}
-
-}
-Q_DECLARE_METATYPE(qt3dsdm::DataModelDataType)
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOps.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOps.h
deleted file mode 100644
index b1e1fb01..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOps.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_WSTR_OPS_H
-#define QT3DSDM_WSTR_OPS_H
-namespace qt3dsdm {
-// Template base class so that we can convert items to and from wide string
-template <typename TDataType>
-struct WStrOps
-{
- bool force_compile_error;
-};
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOpsImpl.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOpsImpl.h
deleted file mode 100644
index d65ac131..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWStrOpsImpl.h
+++ /dev/null
@@ -1,761 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_IMPORT_WSTR_OPS_IMPL_H
-#define QT3DS_IMPORT_WSTR_OPS_IMPL_H
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMWStrOps.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMAnimation.h"
-#include "Qt3DSDMMetaDataTypes.h"
-#include "Qt3DSDMXML.h"
-#include "EABase/eabase.h"
-#include "Qt3DSDMStringTable.h"
-
-namespace qt3dsdm {
-using qt3ds::QT3DSI8;
-using qt3ds::QT3DSU8;
-using qt3ds::QT3DSI16;
-using qt3ds::QT3DSU16;
-using qt3ds::QT3DSU32;
-using qt3ds::QT3DSI32;
-using qt3ds::QT3DSU64;
-using qt3ds::QT3DSI64;
-using qt3ds::QT3DSF32;
-using qt3ds::QT3DSF64;
-template <>
-struct WStrOps<bool>
-{
- QT3DSU32 ToStr(bool item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(
- swprintf(buffer.begin(), buffer.size(), L"%s", item ? L"True" : L"False"));
- }
- bool StrTo(const wchar_t *buffer, bool &item)
- {
- if (AreEqual(buffer, L"True"))
- item = true;
- else
- item = false;
- return true;
- }
- QT3DSU32 ToStr(bool item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(
- _snprintf(buffer.begin(), buffer.size(), "%s", item ? "True" : "False"));
- }
- bool StrTo(const char8_t *buffer, bool &item)
- {
- if (AreEqualCaseless(buffer, "True"))
- item = true;
- else
- item = false;
- return true;
- }
-};
-template <>
-struct WStrOps<QT3DSU8>
-{
- QT3DSU32 ToStr(QT3DSU8 item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(
- swprintf(buffer.begin(), buffer.size(), L"%hu", static_cast<QT3DSU16>(item)));
- }
- bool StrTo(const char8_t *buffer, QT3DSU8 &item)
- {
- item = static_cast<QT3DSU8>(strtoul(buffer, NULL, 10));
- return true;
- }
-};
-template <>
-struct WStrOps<QT3DSI8>
-{
- QT3DSU32 ToStr(QT3DSI8 item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(
- swprintf(buffer.begin(), buffer.size(), L"%hd", static_cast<QT3DSI16>(item)));
- }
- bool StrTo(const char8_t *buffer, QT3DSI8 &item)
- {
- item = static_cast<QT3DSI8>(strtol(buffer, NULL, 10));
- return true;
- }
-};
-template <>
-struct WStrOps<QT3DSU16>
-{
- QT3DSU32 ToStr(QT3DSU16 item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(swprintf(buffer.begin(), buffer.size(), L"%hu", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSU16 &item)
- {
- item = static_cast<QT3DSU16>(strtoul(buffer, NULL, 10));
- return true;
- }
-};
-template <>
-struct WStrOps<QT3DSI16>
-{
- QT3DSU32 ToStr(QT3DSI16 item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(swprintf(buffer.begin(), buffer.size(), L"%hd", item));
- }
- QT3DSU32 ToStr(QT3DSI16 item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(sprintf(buffer.begin(), "%hd", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSI16 &item)
- {
- item = static_cast<QT3DSI16>(strtol(buffer, NULL, 10));
- return true;
- }
-};
-
-template <>
-struct WStrOps<QT3DSU32>
-{
- QT3DSU32 ToStr(QT3DSU32 item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(swprintf(buffer.begin(), buffer.size(), L"%lu", item));
- }
- QT3DSU32 ToStr(QT3DSU32 item, NVDataRef<char8_t> buffer)
- {
- // hope the buffer is big enough...
- return static_cast<QT3DSU32>(sprintf(buffer.begin(), "%u", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSU32 &item)
- {
- item = strtoul(buffer, NULL, 10);
- return true;
- }
-};
-
-template <>
-struct WStrOps<QT3DSI32>
-{
- QT3DSU32 ToStr(QT3DSI32 item, NVDataRef<wchar_t> buffer)
- {
- return static_cast<QT3DSU32>(swprintf(buffer.begin(), buffer.size(), L"%ld", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSI32 &item)
- {
- item = strtol(buffer, NULL, 10);
- return true;
- }
-};
-template <>
-struct WStrOps<QT3DSF32>
-{
- QT3DSU32 ToStr(QT3DSF32 item, NVDataRef<wchar_t> buffer)
- {
- QString s = QLocale::c().toString(item);
- wcsncpy(buffer.begin(), s.toStdWString().c_str(), buffer.size());
- return s.length();
- }
- QT3DSU32 ToStr(QT3DSF32 item, NVDataRef<char8_t> buffer)
- {
- QString s = QLocale::c().toString(item);
- strncpy(buffer.begin(), s.toStdString().c_str(), buffer.size());
- return s.length();
- }
- bool StrTo(const char8_t *buffer, QT3DSF32 &item)
- {
- bool ok;
- item = QLocale::c().toFloat(buffer, &ok);
- return ok;
- }
-};
-
-template <>
-struct WStrOps<QT3DSF64>
-{
- QT3DSU32 ToStr(QT3DSF64 item, NVDataRef<wchar_t> buffer)
- {
- QString s = QLocale::c().toString(item);
- wcsncpy(buffer.begin(), s.toStdWString().c_str(), buffer.size());
- return s.length();
- }
- bool StrTo(const char8_t *buffer, QT3DSF64 &item)
- {
- bool ok;
- item = QLocale::c().toDouble(buffer, &ok);
- return ok;
- }
-};
-#define QT3DS_WCHAR_T_None L"None"
-#define QT3DS_WCHAR_T_Float L"Float"
-#define QT3DS_WCHAR_T_Float2 L"Float2"
-#define QT3DS_WCHAR_T_Float3 L"Float3"
-#define QT3DS_WCHAR_T_Float4 L"Float4"
-#define QT3DS_WCHAR_T_Long L"Long"
-#define QT3DS_WCHAR_T_String L"String"
-#define QT3DS_WCHAR_T_Bool L"Bool"
-#define QT3DS_WCHAR_T_Long4 L"Long4"
-#define QT3DS_WCHAR_T_StringRef L"StringRef"
-#define QT3DS_WCHAR_T_ObjectRef L"ObjectRef"
-#define QT3DS_WCHAR_T_StringOrInt L"StringOrInt"
-#define QT3DS_WCHAR_T_FloatList L"FloatList"
-
-#define QT3DS_IMPORT_ITERATE_DMTYPE \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::None, None, QT3DSF32) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Float, Float, QT3DSF32) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Float2, Float2, SFloat2) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Float3, Float3, SFloat3) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Float4, Float4, SFloat4) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Long, Long, QT3DSI32) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::String, String, TDataStrPtr) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Bool, Bool, bool) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::Long4, Long4, SLong4) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::StringRef, StringRef, SStringRef) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::ObjectRef, ObjectRef, SObjectRefType) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::StringOrInt, StringOrInt, SStringOrInt) \
- QT3DS_IMPORT_HANDLE_DMTYPE(DataModelDataType::FloatList, FloatList, TFloatList)
-
-template <>
-struct WStrOps<DataModelDataType::Value>
-{
- QT3DSU32 ToStr(DataModelDataType::Value item, NVDataRef<wchar_t> buffer)
- {
- const wchar_t *data = NULL;
- switch (item) {
-#define QT3DS_IMPORT_HANDLE_DMTYPE(x, y, z) \
- case x: \
- data = QT3DS_WCHAR_T_##y; \
- break;
- QT3DS_IMPORT_ITERATE_DMTYPE
-#undef QT3DS_IMPORT_HANDLE_DMTYPE
- default:
- break;
- }
- if (data == NULL) {
- QT3DS_ASSERT(false);
- data = L"Unknown";
- }
- return (QT3DSU32)swprintf(buffer.begin(), buffer.size(), L"%ls", data);
- }
- bool StrTo(const wchar_t *buffer, DataModelDataType::Value &item)
- {
-#define QT3DS_IMPORT_HANDLE_DMTYPE(x, y, z) \
- if (AreEqual(buffer, QT3DS_WCHAR_T_##y)) { \
- item = x; \
- return true; \
- }
- QT3DS_IMPORT_ITERATE_DMTYPE
-#undef QT3DS_IMPORT_HANDLE_DMTYPE
- item = DataModelDataType::None;
- return false;
- }
-};
-template <typename TBufferType>
-struct WStrOpsDMWriter
-{
- TBufferType &buf;
- WStrOpsDMWriter(TBufferType &_buf)
- : buf(_buf)
- {
- }
-
- void operator()(float val) { buf.Write(val); }
- void operator()(const SFloat2 &val) { buf.Write(NVConstDataRef<QT3DSF32>(&val[0], 2)); }
- void operator()(const SFloat3 &val) { buf.Write(NVConstDataRef<QT3DSF32>(&val[0], 3)); }
- void operator()(const SFloat4 &val) { buf.Write(NVConstDataRef<QT3DSF32>(&val[0], 4)); }
- void operator()(QT3DSI32 val) { buf.Write(val); }
- void operator()(bool val) { buf.Write(val); }
- void operator()(const TDataStrPtr &val)
- {
- if (val != NULL)
- buf.Write(NVConstDataRef<wchar_t>(val->GetData(), (QT3DSU32)val->GetLength()));
- }
- void operator()(const SLong4 &val)
- {
- buf.Write(NVConstDataRef<QT3DSU32>(&val.m_Longs[0], 4), 4);
- }
- void operator()(const SStringRef &val) { buf.Write(val.m_Id, (QT3DSU32)wcslen(val.m_Id) + 1); }
- void operator()(const SObjectRefType &val) { val.m_Value.visit<void>(*this); }
- void operator()(const SStringOrInt &val) { val.m_Value.visit<void>(*this); }
- void operator()(const TFloatList &val)
- {
- buf.Write(NVConstDataRef<float>(val.data(), (QT3DSU32)val.size()));
- }
- void operator()() { QT3DS_ASSERT(false); }
-};
-
-template <>
-struct WStrOps<SValue>
-{
- template <typename TBufferType>
- void ToBuf(const SValue &item, TBufferType &outBuffer)
- {
- WStrOpsDMWriter<TBufferType> writer(outBuffer);
- item.visit<void>(writer);
- }
- template <typename TBufferType>
- SValue BufTo(DataModelDataType::Value type, TBufferType &inReader)
- {
- switch (type) {
-#define QT3DS_IMPORT_HANDLE_DMTYPE(x, y, z) \
- case x: { \
- z retval; \
- Read(inReader, retval); \
- return retval; \
- }
- QT3DS_IMPORT_ITERATE_DMTYPE
-#undef QT3DS_IMPORT_HANDLE_DMTYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return SValue();
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, float &val)
- {
- reader.Read(val);
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SFloat2 &val)
- {
- reader.ReadRef(NVDataRef<QT3DSF32>(&val[0], 2));
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SFloat3 &val)
- {
- reader.ReadRef(NVDataRef<QT3DSF32>(&val[0], 3));
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SFloat4 &val)
- {
- reader.ReadRef(NVDataRef<QT3DSF32>(&val[0], 4));
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, QT3DSI32 &val)
- {
- reader.Read(val);
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, bool &val)
- {
- reader.Read(val);
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, TDataStrPtr &val)
- {
- NVConstDataRef<wchar_t> buffer;
- reader.ReadBuffer(buffer);
- val = std::make_shared<CDataStr>(buffer.begin(), buffer.size());
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SLong4 &val)
- {
- reader.ReadRef(NVDataRef<QT3DSU32>(&val.m_Longs[0], 4));
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SStringRef &val)
- {
- NVConstDataRef<wchar_t> buffer;
- reader.ReadBuffer(buffer);
- val = SStringRef(buffer.begin());
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, TFloatList &val)
- {
- NVConstDataRef<QT3DSF32> buffer;
- reader.ReadBuffer(buffer);
- val.assign(buffer.begin(), buffer.end());
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SObjectRefType &val)
- {
- // Force the read to be as string; callers can always convert to a different
- // format later if required.
- TDataStrPtr theValue;
- Read(reader, theValue);
- val.m_Value = theValue;
- }
- template <typename TBufferType>
- void Read(TBufferType &reader, SStringOrInt &val)
- {
- NVConstDataRef<char8_t> buffer;
- reader.ReadBuffer(buffer);
- if (buffer.size() == 0)
- return;
-
- if ((buffer[0] >= '0' && buffer[0] <= '9') || buffer[0] == '-') {
- QT3DSI32 theVal;
- WStrOps<QT3DSI32>().StrTo(buffer.begin(), theVal);
- val = SStringOrInt(theVal);
- } else {
- NVConstDataRef<wchar_t> wideBuffer;
- reader.ReadBuffer(wideBuffer);
- val = SStringOrInt(std::make_shared<CDataStr>(wideBuffer.begin()));
- }
- }
-};
-
-// Write the wchar_t but exlude the null terminator
-// Meant to write data model values.
-// Memory buffer contains a non-null-terminated
-// wchar_t string
-struct WCharTWriter
-{
- MemoryBuffer<RawAllocator> &m_Buffer;
- WCharTWriter(MemoryBuffer<RawAllocator> &buf)
- : m_Buffer(buf)
- {
- }
- void Write(const wchar_t *value, QT3DSU32 len = 0)
- {
- if (IsTrivial(value))
- return;
- if (len == 0)
- len = (QT3DSU32)wcslen(value);
- m_Buffer.write(value, len);
- }
- void Write(wchar_t value) { m_Buffer.write(value); }
- void Write(bool value) { Write(value ? L"True" : L"False"); }
-
- // Takes care of long and float
- template <typename TDataType>
- void Write(TDataType value)
- {
- wchar_t buf[256];
- QT3DSU32 numWritten = WStrOps<TDataType>().ToStr(value, NVDataRef<wchar_t>(buf, 256));
- if (numWritten)
- Write((const wchar_t *)buf);
- else {
- QT3DS_ASSERT(false);
- }
- }
- template <typename TDataType>
- void Write(NVConstDataRef<TDataType> values, QT3DSU32 grouping = 6, QT3DSU32 tabCount = 0)
- {
- for (QT3DSU32 idx = 0; idx < values.size(); ++idx) {
- if (idx) {
- if ((idx % grouping) == 0) {
- Write((wchar_t)'\n');
- for (QT3DSU32 tabIdx = 0; tabIdx < tabCount; ++tabIdx)
- Write((wchar_t)'\t');
- } else
- Write((wchar_t)' ');
- }
- Write(values[idx]);
- }
- }
-
- void Write(NVConstDataRef<wchar_t> values, QT3DSU32 ignored = 6)
- {
- (void)ignored;
- if (values.size() && values[0] != 0) {
- QT3DSU32 lastItem = values.size() - 1;
- if (values[lastItem] == 0)
- --lastItem;
- Write(values.begin(), lastItem + 1);
- }
- }
-};
-
-inline bool IsWhite(wchar_t value)
-{
- return value == '\n' || value == '\r' || value == ' ' || value == '\t';
-}
-
-// skip until we find whitespace.
-inline wchar_t *FindNextWhitespace(wchar_t *input)
-{
- if (input == NULL)
- return input;
- wchar_t *marker = input;
- // Empty loop intentional
- for (; *marker && !IsWhite(*marker); ++marker)
- ;
- return marker;
-}
-
-// skip until we find whitespace.
-inline char8_t *FindNextWhitespace(char8_t *input)
-{
- if (input == NULL)
- return input;
- char8_t *marker = input;
- // Empty loop intentional
- for (; *marker && !IsWhite(*marker); ++marker)
- ;
- return marker;
-}
-
-// skip until we find something that isn't whitespace.
-inline wchar_t *FindNextNonWhitespace(wchar_t *input)
-{
- if (input == NULL)
- return input;
- wchar_t *marker = input;
- // Empty loop intentional
- for (; *marker && IsWhite(*marker); ++marker)
- ;
- return marker;
-}
-
-inline char8_t *FindNextNonWhitespace(char8_t *input)
-{
- if (input == NULL)
- return input;
- char8_t *marker = input;
- // Empty loop intentional
- for (; *marker && IsWhite(*marker); ++marker)
- ;
- return marker;
-}
-
-// Reading is destructive in the case of floating point lists, so we may
-// destroy the incoming string.
-// We are assuming the string is null-terminated at end ptr.
-struct WCharTReader
-{
- char8_t *m_StartPtr;
- // Buffer used for temp storage
- MemoryBuffer<RawAllocator> &m_Buffer;
- IStringTable &m_StringTable;
- WCharTReader(char8_t *sp, MemoryBuffer<RawAllocator> &buf, IStringTable &inStringTable)
- : m_StartPtr(sp)
- , m_Buffer(buf)
- , m_StringTable(inStringTable)
- {
- }
- void Read(const char8_t *&outPtr) { outPtr = m_StartPtr; }
- void Read(const wchar_t *&outPtr) { outPtr = m_StringTable.GetWideStr(m_StartPtr); }
- template <typename TDataType>
- void Read(TDataType &data)
- {
- bool success = WStrOps<TDataType>().StrTo(m_StartPtr, data);
- QT3DS_ASSERT(success);
- (void)success;
- }
- // Destructive operation because we can't trust
- // strtod to do the right thing. On windows, for long strings,
- // it calls strlen every operation thus leading to basically N^2
- // behavior
- template <typename TDataType>
- void ReadRef(NVDataRef<TDataType> data)
- {
- QT3DSU32 idx = 0;
- m_StartPtr = FindNextNonWhitespace(m_StartPtr);
- for (; idx < data.size() && m_StartPtr && *m_StartPtr; ++idx) {
- char8_t *nextPtr = FindNextWhitespace(m_StartPtr);
- if (nextPtr && *nextPtr)
- *nextPtr = 0;
- else
- nextPtr = NULL;
- WStrOps<TDataType>().StrTo(m_StartPtr, data[idx]);
- m_StartPtr = nextPtr;
- if (m_StartPtr)
- m_StartPtr = FindNextNonWhitespace(m_StartPtr + 1);
- }
- }
-
- void ReadBuffer(NVConstDataRef<char8_t> &outBuffer)
- {
- if (m_StartPtr && *m_StartPtr) {
- QT3DSU32 len = (QT3DSU32)strlen(m_StartPtr);
- outBuffer = NVConstDataRef<char8_t>(m_StartPtr, len + 1);
- }
- }
- void ReadBuffer(NVConstDataRef<wchar_t> &outBuffer)
- {
- if (m_StartPtr && *m_StartPtr) {
- QT3DSU32 len = (QT3DSU32)strlen(m_StartPtr);
- outBuffer = NVConstDataRef<wchar_t>(m_StringTable.GetWideStr(m_StartPtr), len + 1);
- }
- }
-
- // Destructive operation because we can't trust
- // strtod to do the right thing. On windows, for long strings,
- // it calls strlen every operation thus leading to basically N^2
- // behavior
- template <typename TDataType>
- void ReadBuffer(NVConstDataRef<TDataType> &outBuffer)
- {
- m_Buffer.clear();
- m_StartPtr = FindNextNonWhitespace(m_StartPtr);
- while (m_StartPtr && *m_StartPtr) {
- char8_t *nextPtr = FindNextWhitespace(m_StartPtr);
- if (nextPtr && *nextPtr)
- *nextPtr = 0;
- else
- nextPtr = NULL;
- TDataType temp;
- WStrOps<TDataType>().StrTo(m_StartPtr, temp);
- m_Buffer.write(temp);
- m_StartPtr = nextPtr;
- if (m_StartPtr)
- m_StartPtr = FindNextNonWhitespace(m_StartPtr + 1);
- }
- QT3DSU32 numItems = m_Buffer.size() / sizeof(TDataType);
- if (numItems)
- outBuffer = NVConstDataRef<TDataType>((TDataType *)m_Buffer.begin(), numItems);
- else
- outBuffer = NVConstDataRef<TDataType>();
- }
-};
-
-template <>
-struct WStrOps<CDataModelHandle>
-{
- template <typename THandleType>
- QT3DSU32 ToStr(THandleType item, NVDataRef<wchar_t> buffer)
- {
- int theValue(item);
- return WStrOps<int>().ToStr(theValue, buffer);
- }
- template <typename THandleType>
- bool StrTo(const char8_t *buffer, THandleType &item)
- {
- int theValue;
- bool retval = WStrOps<int>().StrTo(buffer, theValue);
- item = theValue;
- return retval;
- }
-};
-
-#define IMPLEMENT_HANDLE_WSTROPS(HandleType) \
- template <> \
- struct WStrOps<HandleType> : public WStrOps<CDataModelHandle> \
- { \
- };
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMInstanceHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMPropertyHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMSlideHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMSlideGraphHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMAnimationHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMKeyframeHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMActionHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMHandlerArgHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMEventHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMHandlerHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMHandlerParamHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMMetaDataPropertyHandle);
-IMPLEMENT_HANDLE_WSTROPS(Qt3DSDMCategoryHandle);
-#undef IMPLEMENT_HANDLE_WSTROPS
-
-template <>
-struct WStrOps<EAnimationType>
-{
- QT3DSU32 ToStr(EAnimationType value, NVDataRef<wchar_t> buffer)
- {
- const wchar_t *animType = NULL;
- switch (value) {
- case EAnimationTypeLinear:
- animType = L"Linear";
- break;
- case EAnimationTypeBezier:
- animType = L"Bezier";
- break;
- case EAnimationTypeEaseInOut:
- animType = L"EaseInOut";
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- if (animType != NULL)
- return swprintf(buffer.begin(), buffer.size(), L"%ls", animType);
- else {
- QT3DS_ASSERT(false);
- return 0;
- }
- }
- bool StrTo(const wchar_t *buffer, EAnimationType &item)
- {
- if (AreEqual(L"Linear", buffer)) {
- item = EAnimationTypeLinear;
- return true;
- }
- if (AreEqual(L"Bezier", buffer)) {
- item = EAnimationTypeBezier;
- return true;
- }
- if (AreEqual(L"EaseInOut", buffer)) {
- item = EAnimationTypeEaseInOut;
- return true;
- }
- return false;
- }
-};
-
-// Implemented in UICDMMetaData.h
-template <>
-struct WStrOps<CompleteMetaDataType::Enum>
-{
- QT3DSU32 ToStr(CompleteMetaDataType::Enum item, NVDataRef<wchar_t> buffer);
- bool StrTo(const wchar_t *buffer, CompleteMetaDataType::Enum &item);
-};
-
-template <>
-struct WStrOps<HandlerArgumentType::Value>
-{
- QT3DSU32 ToStr(HandlerArgumentType::Value item, NVDataRef<wchar_t> buffer);
- bool StrTo(const wchar_t *buffer, HandlerArgumentType::Value &item);
-};
-
-#ifndef __clang__
-#ifndef __INTEGRITY
-// IDOMReader implementations
-template <typename TDataType>
-bool IDOMReader::ValueList(NVDataRef<TDataType> data)
-{
- const wchar_t *value;
- if (Value(value)) {
- WCharTReader reader(const_cast<wchar_t *>(value), m_TempBuf);
- reader.ReadRef(data);
- }
- return true;
-}
-
-// Destructive operation because we can't trust
-// strtod to do the right thing. On windows, for long strings,
-// it calls strlen every operation thus leading to basically N^2
-// behavior
-template <typename TDataType>
-NVConstDataRef<TDataType> IDOMReader::ChildValueList(TWideXMLCharPtr listName)
-{
- NVConstDataRef<TDataType> retval;
- TWideXMLCharPtr childValue = NULL;
- if (ChildValue(listName, childValue)) {
- WCharTReader reader(const_cast<wchar_t *>(childValue), m_TempBuf);
- reader.ReadBuffer(retval);
- }
- return retval;
-}
-#endif
-#endif
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWindowsCompatibility.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWindowsCompatibility.h
deleted file mode 100644
index 0a53c71c..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMWindowsCompatibility.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DSDM_WINDOWS_COMPATIBILITY_H
-#define QT3DSDM_WINDOWS_COMPATIBILITY_H
-#include "EABase/config/eaplatform.h"
-#include "EABase/eabase.h"
-#include <string>
-#ifndef __INTEGRITY
-#include <memory.h>
-#endif
-#include <string.h>
-#include <stdio.h>
-
-#if defined QT3DS_PLATFORM_NEEDS_WCHAR_T
-
-inline size_t wcslen(const wchar_t *inStr)
-{
- size_t retval = 0;
- while (inStr && *inStr) {
- ++retval;
- ++inStr;
- }
- return retval;
-}
-
-inline int wmemcmp(const wchar_t *lhs, const wchar_t *rhs, size_t count)
-{
- return memcmp(lhs, rhs, count * sizeof(wchar_t));
-}
-
-inline wchar_t *wmemcpy(wchar_t *dest, const wchar_t *src, size_t count)
-{
- memcpy(dest, src, count * sizeof(wchar_t));
- return dest;
-}
-
-inline const wchar_t *wmemchr(const wchar_t *inFirst, size_t count, const wchar_t val)
-{
- size_t idx;
- // empty loop intentional
- for (idx = 0; idx < count && inFirst[idx] != val; ++idx) {
- }
- if (idx < count)
- return inFirst + idx;
- return NULL;
-}
-
-inline wchar_t *wmemmove(wchar_t *dest, const wchar_t *src, size_t count)
-{
- memmove(dest, src, count * sizeof(wchar_t));
- return dest;
-}
-
-inline wchar_t *wmemset(wchar_t *dest, size_t count, wchar_t val)
-{
- for (size_t idx = 0; idx < count; ++idx)
- dest[idx] = val;
- return dest;
-}
-
-#endif
-
-inline size_t WideToNarrow(char *inDest, size_t inDestLen, const wchar_t *inWideStr);
-template <unsigned int N>
-inline size_t WideToNarrow(char (&inDest)[N], const wchar_t *inWideStr);
-
-#if !defined EA_PLATFORM_WINDOWS
-
-inline void wcscpy_s(wchar_t *inDest, size_t destLen, const wchar_t *inMessage)
-{
- if (destLen) {
- size_t idx = 0;
- while (inMessage && *inMessage && idx < destLen) {
- inDest[idx] = *inMessage;
- ++inMessage;
- ++idx;
- }
-
- idx = idx < destLen ? idx : destLen - 1;
- inDest[idx] = 0;
- }
-}
-
-template <unsigned int N>
-inline void wcscpy_s(wchar_t (&inDest)[N], const wchar_t *inMessage)
-{
- wcscpy_s(inDest, N, inMessage);
-}
-
-inline FILE *_wfopen(const wchar_t *inFname, const wchar_t *inFlags)
-{
- char name[1024] = { 0 };
- WideToNarrow(name, inFname);
- char flags[24] = { 0 };
- WideToNarrow(flags, inFlags);
- return fopen(name, flags);
-}
-
-inline int _fseeki64(FILE *inFile, int64_t pos, int seekFlags)
-{
- return fseek(inFile, (int32_t)pos, seekFlags);
-}
-
-inline int64_t _ftelli64(FILE *inFile)
-{
- return ftell(inFile);
-}
-
-#define _snprintf snprintf
-
-#endif
-
-template <typename TLHS, typename TRHS>
-inline size_t ConvertStr(TLHS *inDest, size_t inDestLen, const TRHS *inWideStr)
-{
- if (inDestLen == 0)
- return 0;
-
- size_t nameLen = 0;
-
- // empty loop intentional.
- for (const TRHS *tempPtr = inWideStr; tempPtr && *tempPtr; ++tempPtr, ++nameLen) {
- }
-
- if (nameLen > inDestLen - 1)
- nameLen = inDestLen - 1;
- for (size_t idx = 0; idx < nameLen; ++idx)
- inDest[idx] = (char)inWideStr[idx];
- inDest[nameLen] = 0;
- return nameLen;
-}
-
-inline size_t WideToNarrow(char *inDest, size_t inDestLen, const wchar_t *inWideStr)
-{
- return ConvertStr(inDest, inDestLen, inWideStr);
-}
-
-template <unsigned int N>
-inline size_t WideToNarrow(char (&inDest)[N], const wchar_t *inWideStr)
-{
- return WideToNarrow(inDest, N, inWideStr);
-}
-
-inline size_t WideToNarrow(char *inDest, size_t inDestLen, const char16_t *inWideStr)
-{
- return ConvertStr(inDest, inDestLen, inWideStr);
-}
-
-template <unsigned int N>
-inline size_t WideToNarrow(char (&inDest)[N], const char16_t *inWideStr)
-{
- return WideToNarrow(inDest, N, inWideStr);
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.cpp b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.cpp
deleted file mode 100644
index 2055adf1..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.cpp
+++ /dev/null
@@ -1,1253 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMXML.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSDMStringTable.h"
-#include "Qt3DSDMWStrOpsImpl.h"
-#include <memory>
-#include "foundation/StrConvertUTF.h"
-#include "foundation/StringTable.h"
-#ifdef QT3DS_VC
-#include <winsock2.h>
-#include <windows.h> //output debug string
-#endif
-
-#include <QtCore/qxmlstream.h>
-
-typedef char XML_Char;
-typedef char XML_LChar;
-
-using namespace qt3dsdm;
-using std::shared_ptr;
-using namespace qt3ds::foundation;
-using qt3ds::foundation::Pool;
-
-#define QT3DSXML_FOREACH(idxnm, val) \
- for (QT3DSU32 idxnm = 0, __numItems = (QT3DSU32)val; idxnm < __numItems; ++idxnm)
-
-namespace qt3dsdm {
-
-// All names are string table values so we can do straight
-// pointer comparisons on them, we don't have the compare their
-// values.
-struct SDOMAttribute
-{
- TXMLCharPtr m_Name;
- TXMLCharPtr m_Value;
- SDOMAttribute *m_NextAttribute;
-
- SDOMAttribute(TXMLCharPtr nm, TXMLCharPtr val)
- : m_Name(nm)
- , m_Value(val)
- , m_NextAttribute(NULL)
- {
- }
-};
-
-struct SDOMElement
-{
- TXMLCharPtr m_Name;
- SDOMAttribute *m_FirstAttribute;
- SDOMAttribute *m_LastAttribute;
- SDOMElement *m_Parent;
- SDOMElement *m_FirstChild;
- SDOMElement *m_LastChild;
- SDOMElement *m_NextSibling;
- TXMLCharPtr m_Value;
-
- SDOMElement(TXMLCharPtr nm)
- : m_Name(nm)
- , m_FirstAttribute(NULL)
- , m_LastAttribute(NULL)
- , m_Parent(NULL)
- , m_FirstChild(NULL)
- , m_LastChild(NULL)
- , m_NextSibling(NULL)
- , m_Value("")
- {
- }
-
- void AddAttribute(SDOMAttribute &att)
- {
- if (m_LastAttribute) {
- m_LastAttribute->m_NextAttribute = &att;
- m_LastAttribute = &att;
- } else {
- QT3DS_ASSERT(m_FirstAttribute == NULL);
- m_FirstAttribute = m_LastAttribute = &att;
- }
- }
- // Used to ensure duplicate attributes can't happen
- void SetAttributeValue(TXMLCharPtr inName, TXMLCharPtr inValue, IDOMFactory &inFactory,
- const SDOMFlags &inFlags)
- {
- inName = inFactory.GetStringTable()->RegisterStr(inName);
- SDOMAttribute *att = FindAttribute(inName, inFlags);
- if (att) {
- att->m_Value = inFactory.RegisterValue(inValue);
- } else {
- AddAttribute(*inFactory.NextAttribute(inName, inValue));
- }
- }
- void SetAttributeValue(TWideXMLCharPtr inName, TWideXMLCharPtr inValue, IDOMFactory &inFactory,
- const SDOMFlags &inFlags)
- {
- TXMLCharPtr theName = inFactory.GetStringTable()->GetNarrowStr(inName);
- SDOMAttribute *att = FindAttribute(theName, inFlags);
- if (att) {
- att->m_Value = inFactory.RegisterValue(inValue);
- } else {
- AddAttribute(
- *inFactory.NextAttribute(inFactory.GetStringTable()->GetWideStr(inName), inValue));
- }
- }
- const SDOMAttribute *FindAttribute(TXMLCharPtr nm, const SDOMFlags &inFlags) const
- {
- return const_cast<SDOMElement *>(this)->FindAttribute(nm, inFlags);
- }
- SDOMAttribute *FindAttribute(TXMLCharPtr nm, const SDOMFlags &inFlags)
- {
- for (SDOMAttribute *att = m_FirstAttribute; att != NULL; att = att->m_NextAttribute) {
- if (att->m_Name == nm)
- return att;
- else if (inFlags.CaselessAttributes() && AreEqualCaseless(nm, att->m_Name))
- return att;
- }
- return NULL;
- }
- void RemoveAttribute(TXMLCharPtr nm, const SDOMFlags &inFlags)
- {
- SDOMAttribute *preatt = m_FirstAttribute;
- for (SDOMAttribute *att = m_FirstAttribute; att != NULL;
- preatt = att, att = att->m_NextAttribute) {
- if (att->m_Name == nm
- || (inFlags.CaselessAttributes() && AreEqualCaseless(nm, att->m_Name))) {
- if (att == m_FirstAttribute) {
- m_FirstAttribute = att->m_NextAttribute;
- } else {
- preatt->m_NextAttribute = att->m_NextAttribute;
- if (att == m_LastAttribute)
- m_LastAttribute = preatt;
- }
-
- att->m_NextAttribute = NULL;
- }
- }
- }
- TXMLCharPtr GetAttributeValue(TXMLCharPtr nm, SDOMFlags &inFlags) const
- {
- const SDOMAttribute *att = FindAttribute(nm, inFlags);
- if (att)
- return att->m_Value;
- return NULL;
- }
- void AddChild(SDOMElement &elem)
- {
- elem.m_Parent = this;
- if (m_LastChild) {
- m_LastChild->m_NextSibling = &elem;
- m_LastChild = &elem;
- } else {
- QT3DS_ASSERT(m_FirstChild == NULL);
- m_FirstChild = m_LastChild = &elem;
- }
- }
- SDOMElement *FindPreviousChild(SDOMElement &elem)
- {
- if (&elem == m_FirstChild)
- return NULL;
- // Find the previous sibling.
- SDOMElement *theChild = m_FirstChild;
- // Empty loop intentional
- for (; theChild && theChild->m_NextSibling != &elem; theChild = theChild->m_NextSibling) {
- }
-
- return theChild;
- }
- void RemoveChild(SDOMElement &elem)
- {
- if (elem.m_Parent != this) {
- QT3DS_ASSERT(false);
- return;
- }
- elem.m_Parent = NULL;
- if (&elem == m_FirstChild) {
- m_FirstChild = elem.m_NextSibling;
- } else {
- SDOMElement *theChild(FindPreviousChild(elem));
- QT3DS_ASSERT(theChild);
- if (theChild) {
- theChild->m_NextSibling = elem.m_NextSibling;
- if (&elem == m_LastChild)
- m_LastChild = theChild;
- }
- }
- elem.m_NextSibling = NULL;
- }
-
- void ReplaceChild(SDOMElement &inChild, SDOMElement &inReplacement)
- {
- inChild.m_Parent = NULL;
- if (&inChild == m_FirstChild)
- m_FirstChild = &inReplacement;
- else {
- SDOMElement *theChild(FindPreviousChild(inChild));
- QT3DS_ASSERT(theChild);
- if (theChild) {
- theChild->m_NextSibling = &inReplacement;
- if (&inChild == m_LastChild)
- m_LastChild = &inReplacement;
- }
- }
- inReplacement.m_NextSibling = inChild.m_NextSibling;
- inReplacement.m_Parent = this;
- inChild.m_NextSibling = NULL;
- }
-
- void InsertChildBefore(SDOMElement &elem, SDOMElement &theSibling)
- {
- // Ensure elem isn't in the graph.
- QT3DS_ASSERT(elem.m_Parent == NULL);
- QT3DS_ASSERT(elem.m_NextSibling == NULL);
- elem.m_Parent = this;
- if (&theSibling == m_FirstChild)
- m_FirstChild = &elem;
- else {
- SDOMElement *thePrevious = FindPreviousChild(theSibling);
- QT3DS_ASSERT(thePrevious);
- if (thePrevious)
- thePrevious->m_NextSibling = &elem;
- }
-
- elem.m_NextSibling = &theSibling;
- }
- QT3DSU32 GetNumChildren(TXMLCharPtr inChildName, const SDOMFlags &inFlags) const
- {
- QT3DSU32 idx = 0;
- for (SDOMElement *elem = m_FirstChild; elem != NULL; elem = elem->m_NextSibling) {
- if (elem->m_Name == inChildName)
- ++idx;
- else if (inFlags.CaselessElements() && AreEqualCaseless(inChildName, elem->m_Name))
- ++idx;
- }
- return idx;
- }
- QT3DSU32 GetNumChildren() const
- {
- QT3DSU32 idx = 0;
- for (SDOMElement *elem = m_FirstChild; elem != NULL; elem = elem->m_NextSibling)
- ++idx;
- return idx;
- }
- SDOMElement *FindChildByName(TXMLCharPtr nm, const SDOMFlags &inFlags) const
- {
- for (SDOMElement *elem = m_FirstChild; elem != NULL; elem = elem->m_NextSibling) {
- if (elem->m_Name == nm)
- return elem;
- else if (inFlags.CaselessElements() && AreEqualCaseless(nm, elem->m_Name))
- return elem;
- }
- return NULL;
- }
- SDOMElement *FindNextSiblingByName(TXMLCharPtr nm, const SDOMFlags &inFlags) const
- {
- for (SDOMElement *elem = m_NextSibling; elem != NULL; elem = elem->m_NextSibling) {
- if (elem->m_Name == nm)
- return elem;
- else if (inFlags.CaselessElements() && AreEqualCaseless(nm, elem->m_Name))
- return elem;
- }
- return NULL;
- }
-};
-}
-
-namespace {
-
-const QT3DSU16 g_BOMMarker = (QT3DSU16)0xFEFF;
-
-struct SElemPointer : eastl::pair<SDOMElement *, SDOMAttribute *>
-{
- SElemPointer(SDOMElement *elem = NULL)
- : eastl::pair<SDOMElement *, SDOMAttribute *>(elem, NULL)
- {
- }
- SElemPointer &operator=(SDOMElement *elem)
- {
- first = elem;
- second = NULL;
- return *this;
- }
- SElemPointer &operator=(SDOMAttribute *att)
- {
- second = att;
- return *this;
- }
- SElemPointer &operator=(const eastl::pair<SDOMElement *, SDOMAttribute *> &other)
- {
- eastl::pair<SDOMElement *, SDOMAttribute *>::operator=(other);
- return *this;
- }
- operator SDOMElement *() const { return first; }
- SDOMElement *operator->() const { return first; }
-};
-
-// Some DOM parsing operations are destructive. If you need
-// them to not be destructive, then we need to modify
-// the reader. Specifically parsing lists of floats, due
-// to a bug in strtod, is destructive.
-struct SDOMReader : public IDOMReader
-{
- SElemPointer m_TopElement;
- eastl::vector<eastl::pair<SDOMElement *, SDOMAttribute *>> m_ScopeStack;
- std::shared_ptr<IDOMFactory> m_Factory;
- SDOMFlags m_Flags;
- eastl::basic_string<TWCharEASTLConverter::TCharType> m_TempBuffer;
-
- SDOMReader(SDOMElement &te, std::shared_ptr<qt3dsdm::IStringTable> s,
- std::shared_ptr<IDOMFactory> inFactory = std::shared_ptr<IDOMFactory>())
- : IDOMReader(s)
- , m_TopElement(&te)
- , m_Factory(inFactory)
- {
- }
-
- SDOMElement *Current() const { return m_TopElement.first; }
- void SetDOMFlags(SDOMFlags inFlags) override { m_Flags = inFlags; }
- SDOMFlags GetDOMFlags() const override { return m_Flags; }
-
- void PushScope() override { m_ScopeStack.push_back(m_TopElement); }
- void PopScope() override
- {
- if (m_ScopeStack.size()) {
- m_TopElement = m_ScopeStack.back();
- m_ScopeStack.pop_back();
- } else
- m_TopElement = eastl::pair<SDOMElement *, SDOMAttribute *>(NULL, NULL);
- }
-
- void *GetScope() override { return m_TopElement.first; }
-
- void SetScope(void *inScope) override
- {
- m_TopElement =
- eastl::make_pair(reinterpret_cast<SDOMElement *>(inScope), (SDOMAttribute *)NULL);
- }
-
- TWideXMLCharPtr GetElementName() const override
- {
- return m_StringTable->GetWideStr(GetNarrowElementName());
- }
-
- TXMLCharPtr GetNarrowElementName() const override
- {
- if (!Current()) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- return Current()->m_Name;
- }
-
- bool UnregisteredAtt(TWideXMLCharPtr name, TWideXMLCharPtr &outValue) override
- {
- outValue = L"";
- SDOMElement *current(Current());
- if (current) {
- TXMLCharPtr theValue =
- current->GetAttributeValue(m_StringTable->GetNarrowStr(name), m_Flags);
- if (theValue && *theValue) {
- qt3ds::foundation::ConvertUTF(theValue, 0, m_TempBuffer);
- outValue = reinterpret_cast<const wchar_t *>(m_TempBuffer.c_str());
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
- bool UnregisteredAtt(TXMLCharPtr name, TXMLCharPtr &outValue) override
- {
- outValue = "";
- SDOMElement *current(Current());
- if (current) {
- outValue = current->GetAttributeValue(m_StringTable->GetNarrowStr(name), m_Flags);
- if (outValue)
- return true;
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
- bool Att(TWideXMLCharPtr name, TWideXMLCharPtr &outValue) override
- {
- if (UnregisteredAtt(name, outValue)) {
- outValue = m_StringTable->RegisterStr(outValue);
- return true;
- }
- return false;
- }
- bool Att(TXMLCharPtr name, TXMLCharPtr &outValue) override
- {
- if (UnregisteredAtt(name, outValue)) {
- outValue = m_StringTable->RegisterStr(outValue);
- return true;
- }
- return false;
- }
-
- QT3DSU32 CountChildren() override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return 0;
- }
- return elem->GetNumChildren();
- }
-
- QT3DSU32 CountChildren(TWideXMLCharPtr childName) override
- {
- return CountChildren(m_StringTable->GetNarrowStr(childName));
- }
-
- QT3DSU32 CountChildren(TXMLCharPtr childName) override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return 0;
- }
- return elem->GetNumChildren(m_StringTable->GetNarrowStr(childName), m_Flags);
- }
-
- eastl::pair<TWideXMLCharPtr, TWideXMLCharPtr>
- ToWide(const eastl::pair<TXMLCharPtr, TXMLCharPtr> &att)
- {
- return eastl::make_pair(m_StringTable->GetWideStr(att.first),
- m_StringTable->GetWideStr(att.second));
- }
- eastl::pair<TWideXMLCharPtr, TWideXMLCharPtr> CurrentAtt()
- {
- return ToWide(CurrentAttNarrow());
- }
-
- eastl::pair<TXMLCharPtr, TXMLCharPtr> CurrentAttNarrow()
- {
- if (m_TopElement.second)
- return eastl::make_pair(m_TopElement.second->m_Name, m_TopElement.second->m_Value);
- return eastl::make_pair("", "");
- }
- eastl::pair<TXMLCharPtr, TXMLCharPtr> GetNarrowFirstAttribute() override
- {
- if (m_TopElement.first == NULL) {
- QT3DS_ASSERT(false);
- eastl::make_pair("", "");
- }
- m_TopElement.second = m_TopElement.first->m_FirstAttribute;
- return CurrentAttNarrow();
- }
-
- eastl::pair<TWideXMLCharPtr, TWideXMLCharPtr> GetFirstAttribute() override
- {
- return ToWide(GetNarrowFirstAttribute());
- }
- eastl::pair<TXMLCharPtr, TXMLCharPtr> GetNarrowNextAttribute() override
- {
- if (m_TopElement.second)
- m_TopElement.second = m_TopElement.second->m_NextAttribute;
- return CurrentAttNarrow();
- }
-
- eastl::pair<TWideXMLCharPtr, TWideXMLCharPtr> GetNextAttribute() override
- {
- return ToWide(GetNarrowNextAttribute());
- }
-
- bool MoveToFirstChild() override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- if (elem->m_FirstChild) {
- m_TopElement = elem->m_FirstChild;
- return true;
- }
- return false;
- }
- bool MoveToFirstChild(TXMLCharPtr childName) override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- SDOMElement *child = elem->FindChildByName(m_StringTable->RegisterStr(childName), m_Flags);
- if (child != NULL) {
- m_TopElement = child;
- return true;
- }
- return false;
- }
-
- bool MoveToFirstChild(TWideXMLCharPtr childName) override
- {
- return MoveToFirstChild(m_StringTable->GetNarrowStr(childName));
- }
-
- bool MoveToNextSibling() override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- if (elem->m_NextSibling) {
- m_TopElement = elem->m_NextSibling;
- return true;
- }
- return false;
- }
- bool MoveToNextSibling(TXMLCharPtr childName) override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- SDOMElement *nextSibling =
- elem->FindNextSiblingByName(m_StringTable->RegisterStr(childName), m_Flags);
- if (nextSibling) {
- m_TopElement = nextSibling;
- return true;
- }
- return false;
- }
- bool MoveToNextSibling(TWideXMLCharPtr childName) override
- {
- return MoveToNextSibling(m_StringTable->GetNarrowStr(childName));
- }
- // Leave element means go to its parent.
- void Leave() override
- {
- if (m_TopElement)
- m_TopElement = m_TopElement->m_Parent;
-
- QT3DS_ASSERT(m_TopElement);
- }
- bool Value(TXMLCharPtr &outValue) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return false;
- }
- outValue = current->m_Value;
- return true;
- }
-
- bool Value(TWideXMLCharPtr &outValue) override
- {
- outValue = L"";
- TXMLCharPtr theValue;
- if (Value(theValue)) {
- qt3ds::foundation::ConvertUTF(theValue, 0, m_TempBuffer);
- outValue = reinterpret_cast<const wchar_t *>(m_TempBuffer.c_str());
- return true;
- }
- return false;
- }
-
- SDOMElement *GetTopElement() override
- {
- SDOMElement *current(Current());
- while (current && current->m_Parent)
- current = current->m_Parent;
- return current;
- }
-
- virtual std::shared_ptr<IDOMFactory> GetFactory() { return m_Factory; }
-};
-
-struct SDOMWriter : public IDOMWriter, public SDOMReader
-{
- std::shared_ptr<IDOMFactory> m_FactoryPtr;
- IDOMFactory &m_Factory;
-
- SDOMWriter(std::shared_ptr<IDOMFactory> inDOMFactory,
- std::shared_ptr<qt3dsdm::IStringTable> inStringTable, SDOMElement &inTopElem)
- : m_FactoryPtr(inDOMFactory)
- , m_Factory(*inDOMFactory)
- , SDOMReader(inTopElem, inStringTable)
- {
- }
- void SetDOMFlags(SDOMFlags inFlags) override { m_Flags = inFlags; }
- SDOMFlags GetDOMFlags() const override { return m_Flags; }
-
- void Begin(TXMLCharPtr inElemName) override
- {
- if (!m_TopElement) {
- QT3DS_ASSERT(false);
- return;
- }
- SDOMElement *current(Current());
- SDOMElement *newElement(m_Factory.NextElement(inElemName));
- current->AddChild(*newElement);
- m_TopElement = newElement;
- }
-
- void Begin(TWideXMLCharPtr inElemName) override
- {
- Begin(m_FactoryPtr->GetStringTable()->GetNarrowStr(inElemName));
- }
-
- void Att(TXMLCharPtr name, TXMLCharPtr value) override
- {
- if (!m_TopElement) {
- QT3DS_ASSERT(false);
- return;
- }
- m_TopElement->SetAttributeValue(name, value, m_Factory, m_Flags);
- }
- // Attributes. They may be sorted just before write
- void Att(TWideXMLCharPtr name, TWideXMLCharPtr value) override
- {
- if (!m_TopElement) {
- QT3DS_ASSERT(false);
- return;
- }
- m_TopElement->SetAttributeValue(name, value, m_Factory, m_Flags);
- }
-
- void Value(TWideXMLCharPtr value) override
- {
- if (!m_TopElement) {
- QT3DS_ASSERT(false);
- return;
- }
- if (value == NULL)
- value = L"";
- size_t len = wcslen(value);
- m_Factory.AppendStrBuf(value, (QT3DSU32)len);
- m_TopElement->m_Value = m_Factory.FinalizeStrBuf();
- }
- void Value(TXMLCharPtr value) override
- {
- if (!m_TopElement) {
- QT3DS_ASSERT(false);
- return;
- }
- if (value == NULL)
- value = "";
- size_t len = strlen(value);
- m_Factory.AppendStrBuf(value, (QT3DSU32)len);
- m_TopElement->m_Value = m_Factory.FinalizeStrBuf();
- }
-
- void End() override
- {
- if (!m_TopElement) {
- QT3DS_ASSERT(false);
- return;
- }
- Leave();
- }
- void RemoveCurrent() override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
- if (current->m_Parent) {
- m_TopElement = current->m_Parent;
- m_TopElement->RemoveChild(*current);
- }
- }
- void ReplaceCurrent(SDOMElement &inElement) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
- if (current->m_Parent) {
- current->m_Parent->ReplaceChild(*current, inElement);
- m_TopElement = &inElement;
- } else {
- m_TopElement = &inElement;
- inElement.m_Parent = NULL;
- inElement.m_NextSibling = NULL;
- }
- }
- void AppendChildren(SDOMElement &inElement) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
- SDOMElement *theChild = inElement.m_FirstChild;
- inElement.m_FirstChild = inElement.m_LastChild = NULL;
- while (theChild) {
- SDOMElement *theCurrentChild = theChild;
- theChild = theChild->m_NextSibling;
-
- theCurrentChild->m_Parent = NULL;
- theCurrentChild->m_NextSibling = NULL;
- current->AddChild(*theCurrentChild);
- }
- }
- void RemoveAttribute(TXMLCharPtr inItem) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
- current->RemoveAttribute(m_StringTable->RegisterStr(inItem), m_Flags);
- }
- void RemoveAttribute(TWideXMLCharPtr inItem) override
- {
- RemoveAttribute(m_StringTable->GetNarrowStr(inItem));
- }
-
- void MoveBefore(TXMLCharPtr inItem, TXMLCharPtr inSibling) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
-
- SDOMElement *theItem =
- current->FindChildByName(m_StringTable->RegisterStr(inItem), m_Flags);
- SDOMElement *theSibling =
- current->FindChildByName(m_StringTable->RegisterStr(inSibling), m_Flags);
- QT3DS_ASSERT(theItem && theSibling);
- if (theItem && theSibling) {
- current->RemoveChild(*theItem);
- current->InsertChildBefore(*theItem, *theSibling);
- }
- }
-
- void MoveBefore(TWideXMLCharPtr inItem, TWideXMLCharPtr inSibling) override
- {
- MoveBefore(m_StringTable->GetNarrowStr(inItem), m_StringTable->GetNarrowStr(inSibling));
- }
-
- // If current has no parent, then we are at the top
- // of the tree and we should return 0. Or if there is no
- // current.
- // If there is one parent, we should return 1.
- QT3DSU32 GetTabs() override
- {
- QT3DSU32 retval = 0;
- SDOMElement *current(Current());
- do {
- if (current)
- current = current->m_Parent;
- if (current)
- ++retval;
- } while (current);
- return retval;
- }
-
- SDOMElement *GetTopElement() override { return SDOMReader::GetTopElement(); }
-
- std::shared_ptr<IDOMFactory> GetFactory() override { return m_FactoryPtr; }
-};
-
-struct SimpleXmlWriter
-{
- IOutStream &m_Stream;
- eastl::vector<eastl::pair<TXMLCharPtr, bool>> m_OpenElements;
- bool m_ElementOpen;
- wchar_t m_PrintBuf[256];
- QT3DSU32 m_Tabs;
- eastl::basic_string<char8_t> m_ConvertBuf;
- eastl::basic_string<TWCharEASTLConverter::TCharType> m_WideBuffer;
-
- SimpleXmlWriter(IOutStream &stream, QT3DSU32 inTabs = 0)
- : m_Stream(stream)
- , m_ElementOpen(false)
- , m_Tabs(inTabs)
- {
- }
- void Write(TWideXMLCharPtr data)
- {
- if (!IsTrivial(data)) {
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const TWCharEASTLConverter::TCharType *>(data), 0,
- m_ConvertBuf);
- m_Stream.Write(m_ConvertBuf.begin(), m_ConvertBuf.size());
- }
- }
- void Write(const char8_t *data)
- {
- if (!IsTrivial(data)) {
- m_Stream.Write(data, (QT3DSU32)strlen(data));
- }
- }
- void BeginWideWrite() { m_WideBuffer.clear(); }
- void WriteTemp(wchar_t data) { m_WideBuffer.append(1, data); }
- void WriteTemp(const wchar_t *data)
- {
- m_WideBuffer.append(reinterpret_cast<const TWCharEASTLConverter::TCharType *>(data));
- }
- void EndWideWrite() { Write(reinterpret_cast<const wchar_t *>(m_WideBuffer.c_str())); }
- void Write(char8_t data) { m_Stream.Write(data); }
- void Tabs()
- {
- QT3DSXML_FOREACH(idx, (m_OpenElements.size() + m_Tabs))
- Write('\t');
- }
- void Close(bool newline)
- {
- if (m_ElementOpen) {
- Write(L" >");
- if (newline)
- Write('\n');
- }
- m_ElementOpen = false;
- }
- void Begin(TXMLCharPtr name)
- {
- Close(true);
- Tabs();
- Write('<');
- Write(name);
- m_OpenElements.push_back(eastl::pair<TXMLCharPtr, bool>(name, false));
- m_ElementOpen = true;
- }
- TWideXMLCharPtr ToStr(char8_t val)
- {
- m_PrintBuf[0] = val;
- m_PrintBuf[1] = 0;
- return m_PrintBuf;
- }
- template <typename TDataType>
- TWideXMLCharPtr ToStr(TDataType val)
- {
- WStrOps<TDataType>().ToStr(val, NVDataRef<wchar_t>(m_PrintBuf, 256));
- return m_PrintBuf;
- }
- void Att(TXMLCharPtr name, TXMLCharPtr value)
- {
- QT3DS_ASSERT(m_ElementOpen);
- Write(' ');
- Write(name);
- Write("=\"");
- QString str = QString::fromUtf8(nonNull(value)).toHtmlEscaped();
- Write(str.toUtf8().constData());
- Write("\"");
- }
- template <typename TData>
- void Att(TXMLCharPtr name, TData value)
- {
- Att(name, ToStr(value));
- }
-
- void Value(TXMLCharPtr value)
- {
- if (!IsTrivial(value)) {
- Close(false);
- QString str = QString::fromUtf8(nonNull(value)).toHtmlEscaped();
- Write(str.toUtf8().constData());
- m_OpenElements.back().second = true;
- }
- }
- void ChildValue(TXMLCharPtr name, TXMLCharPtr value)
- {
- Begin(name);
- Value(value);
- End();
- }
- void End(bool newlineAfterClose = true)
- {
- QT3DS_ASSERT(m_OpenElements.size());
- eastl::pair<TXMLCharPtr, bool> topElem = m_OpenElements.back();
- m_OpenElements.pop_back();
- if (m_ElementOpen)
- Write(" />");
- else {
- if (topElem.second == false)
- Tabs();
- Write("</");
- Write(topElem.first);
- Write(">");
- }
- m_ElementOpen = false;
- if (newlineAfterClose == true)
- Write('\n');
- }
-};
-
-struct DOMParser
-{
- typedef eastl::basic_string<TWCharEASTLConverter::TCharType> TStrType;
- IDOMFactory &m_Factory;
- SDOMElement *m_TopElement;
- SDOMElement *m_FirstElement;
-
- DOMParser(IDOMFactory &factory)
- : m_Factory(factory)
- , m_FirstElement(NULL)
- {
- }
-
- template <QT3DSU32 THeaderLen>
- struct SHeaderInStream : public IInStream
- {
- QT3DSU8 m_Header[THeaderLen];
- QT3DSU32 m_BytesRead;
- IInStream &m_InStream;
- SHeaderInStream(IInStream &inStream)
- : m_InStream(inStream)
- , m_BytesRead(0)
- {
- }
- bool readHeader()
- {
- QT3DSU32 amountRead = m_InStream.Read(NVDataRef<QT3DSU8>(m_Header, THeaderLen));
- return amountRead == THeaderLen;
- }
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- if (data.size() == 0)
- return 0;
- QT3DSU8 *writePtr(data.begin());
- QT3DSU32 amountToRead(data.size());
- QT3DSU32 amountRead = 0;
- if (m_BytesRead < THeaderLen) {
- QT3DSU32 headerLeft = qMin(THeaderLen - m_BytesRead, amountToRead);
- memCopy(writePtr, m_Header + m_BytesRead, headerLeft);
- writePtr += headerLeft;
- amountToRead -= headerLeft;
- amountRead += headerLeft;
- }
- if (amountToRead)
- amountRead += m_InStream.Read(NVDataRef<QT3DSU8>(writePtr, amountToRead));
- m_BytesRead += amountRead;
- return amountRead;
- }
- };
-
- static SDOMElement *ParseXMLFile(IDOMFactory &factory, IInStream &inStream,
- CXmlErrorHandler *handler = NULL)
- {
- QXmlStreamReader sreader;
-
- DOMParser domParser(factory);
- QT3DSU8 dataBuf[2048];
- QT3DSU32 amountRead = 0;
- do {
- amountRead = inStream.Read(toDataRef(dataBuf, 2048));
- if (amountRead) {
- QByteArray tmp = QByteArray::fromRawData((char*)dataBuf,amountRead);
- sreader.addData(tmp);
- }
- } while (amountRead > 0);
-
- while (!sreader.atEnd()) {
- QXmlStreamReader::TokenType token = sreader.readNext();
-
- if (token == QXmlStreamReader::StartElement) {
- domParser.m_Factory.IgnoreStrBuf();
- SDOMElement *newElem = domParser.m_Factory.NextElement(
- (TXMLCharPtr)sreader.name().toUtf8().data());
- if (domParser.m_FirstElement == NULL) {
- domParser.m_FirstElement = newElem;
- domParser.m_TopElement = newElem;
- } else {
- domParser.m_TopElement->AddChild(*newElem);
- domParser.m_TopElement = newElem;
- }
- const QXmlStreamAttributes& attributes = sreader.attributes();
- for (auto attrib : attributes) {
- SDOMAttribute *att = domParser.m_Factory.NextAttribute(
- (TXMLCharPtr)attrib.name().toUtf8().data(),
- (TXMLCharPtr)attrib.value().toUtf8().data());
- newElem->AddAttribute(*att);
- }
- } else if (token == QXmlStreamReader::Characters) {
- QByteArray text = sreader.text().toUtf8();
- domParser.m_Factory.AppendStrBuf(text.data(),text.length());
- } else if (token == QXmlStreamReader::EndElement) {
- domParser.m_TopElement->m_Value = domParser.m_Factory.FinalizeStrBuf();
- domParser.m_TopElement = domParser.m_TopElement->m_Parent;
- }
- if (sreader.hasError()) {
- if (handler) {
- handler->OnXmlError(sreader.errorString(), sreader.lineNumber(),
- sreader.columnNumber());
- } else {
- qWarning() << "XML parse error:" << sreader.errorString()
- << "line:" << sreader.lineNumber()
- << "column:" << sreader.columnNumber();
- }
- return nullptr;
- }
- }
- return domParser.m_FirstElement;
- }
-};
-
-class SimpleDomFactory : public IDOMFactory
-{
- typedef eastl::basic_string<char8_t> TNarrowStr;
- Pool<SDOMElement> m_ElementPool;
- Pool<SDOMAttribute> m_AttributePool;
- eastl::vector<char8_t *> m_BigStrings;
- eastl::vector<char8_t> m_StringBuilder;
- TNarrowStr m_ConvertBuffer;
- std::shared_ptr<qt3dsdm::IStringTable> m_StringTable;
-
-public:
- SimpleDomFactory(std::shared_ptr<qt3dsdm::IStringTable> strt)
- : m_StringTable(strt)
- {
- }
- ~SimpleDomFactory()
- {
- QT3DSXML_FOREACH(idx, m_BigStrings.size())
- free(m_BigStrings[idx]);
- }
-
- TWideXMLCharPtr RegisterStr(TWideXMLCharPtr str)
- {
- if (str == NULL || *str == 0)
- return L"";
- return m_StringTable->RegisterStr(str);
- }
-
- TXMLCharPtr RegisterStr(TXMLCharPtr str)
- {
- if (str == NULL || *str == 0)
- return "";
- return m_StringTable->RegisterStr(str);
- }
-
- void Release() override { delete this; }
- void AppendStrBuf(TXMLCharPtr str, QT3DSU32 len) override
- {
- if (len && *str) {
- QT3DSU32 offset = m_StringBuilder.size();
- m_StringBuilder.resize(offset + len);
- memCopy(&m_StringBuilder[0] + offset, str, len * sizeof(char8_t));
- }
- }
- // Str does not need to be null terminated.
- void AppendStrBuf(TWideXMLCharPtr str, QT3DSU32 len) override
- {
- if (len && *str) {
- const TWCharEASTLConverter::TCharType *bufPtr =
- reinterpret_cast<const TWCharEASTLConverter::TCharType *>(str);
- qt3ds::foundation::ConvertUTF(bufPtr, len, m_ConvertBuffer);
- AppendStrBuf(m_ConvertBuffer.data(), m_ConvertBuffer.size());
- }
- }
-
- // Null terminate what is there and return the buffer.
- // This pointer needs to be persistent.
- TXMLCharPtr FinalizeStrBuf() override
- {
- if (m_StringBuilder.size() == 0)
- return "";
- m_StringBuilder.push_back(0);
- QT3DSU32 len = m_StringBuilder.size();
- QT3DSU32 numBytes = len * sizeof(char8_t);
- char8_t *newMem = (char8_t *)malloc(numBytes);
- memCopy(newMem, &m_StringBuilder[0], numBytes);
- m_BigStrings.push_back(newMem);
- m_StringBuilder.clear();
- return newMem;
- }
- void IgnoreStrBuf() override { m_StringBuilder.clear(); }
-
- SDOMAttribute *NextAttribute(TXMLCharPtr name, TXMLCharPtr val) override
- {
- TXMLCharPtr n(m_StringTable->GetNarrowStr(name));
- TXMLCharPtr v(RegisterValue(val));
- return m_AttributePool.construct(n, v, __FILE__, __LINE__);
- }
-
- SDOMAttribute *NextAttribute(TWideXMLCharPtr name, TWideXMLCharPtr val) override
- {
- TXMLCharPtr n(m_StringTable->GetNarrowStr(name));
- TXMLCharPtr v(RegisterValue(val));
- return m_AttributePool.construct(n, v, __FILE__, __LINE__);
- }
-
- SDOMElement *NextElement(TXMLCharPtr name) override
- {
- IgnoreStrBuf();
- TXMLCharPtr n(m_StringTable->GetNarrowStr(name));
- return m_ElementPool.construct(n, __FILE__, __LINE__);
- }
- SDOMElement *NextElement(TWideXMLCharPtr name) override
- {
- IgnoreStrBuf();
- TXMLCharPtr n(m_StringTable->GetNarrowStr(name));
- return m_ElementPool.construct(n, __FILE__, __LINE__);
- }
-
- std::shared_ptr<qt3dsdm::IStringTable> GetStringTable() override { return m_StringTable; }
-};
-}
-
-bool IDOMReader::Value(DataModelDataType::Value type, SValue &outValue)
-{
- TXMLCharPtr value;
- if (Value(value)) {
- WCharTReader reader(const_cast<char8_t *>(value), m_TempBuf, *GetStringTable());
- outValue = WStrOps<SValue>().BufTo(type, reader);
- return true;
- }
- return false;
-}
-
-std::shared_ptr<IDOMReader>
-IDOMReader::CreateDOMReader(SDOMElement &inRootElement,
- std::shared_ptr<qt3dsdm::IStringTable> inStringTable,
- std::shared_ptr<IDOMFactory> inFactory)
-{
- return std::make_shared<SDOMReader>(std::ref(inRootElement), std::ref(inStringTable),
- inFactory);
-}
-
-eastl::pair<std::shared_ptr<IDOMWriter>, std::shared_ptr<IDOMReader>>
-IDOMWriter::CreateDOMWriter(std::shared_ptr<IDOMFactory> inFactory, SDOMElement &inRootElement,
- std::shared_ptr<qt3dsdm::IStringTable> inStringTable)
-{
- std::shared_ptr<SDOMWriter> writer(std::make_shared<SDOMWriter>(
- inFactory, std::ref(inStringTable), std::ref(inRootElement)));
- return eastl::make_pair(writer, writer);
-}
-
-TXMLCharPtr IDOMFactory::RegisterValue(TWideXMLCharPtr inValue)
-{
- if (IsTrivial(inValue))
- return "";
- IgnoreStrBuf();
- AppendStrBuf(inValue, (QT3DSU32)wcslen(inValue));
- return FinalizeStrBuf();
-}
-
-TXMLCharPtr IDOMFactory::RegisterValue(TXMLCharPtr inValue)
-{
- if (IsTrivial(inValue))
- return "";
- IgnoreStrBuf();
- AppendStrBuf(inValue, (QT3DSU32)strlen(inValue));
- return FinalizeStrBuf();
-}
-
-std::shared_ptr<IDOMFactory>
-IDOMFactory::CreateDOMFactory(std::shared_ptr<qt3dsdm::IStringTable> inStrTable)
-{
- return std::make_shared<SimpleDomFactory>(std::ref(inStrTable));
-}
-
-void CDOMSerializer::WriteXMLHeader(IOutStream &inStream)
-{
- SimpleXmlWriter writer(inStream);
- writer.Write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
-}
-
-// Lexigraphically sort the attributes.
-struct SAttributeComparator
-{
- bool operator()(const SDOMAttribute *lhs, const SDOMAttribute *rhs)
- {
- return strcmp(lhs->m_Name, rhs->m_Name) < 0;
- }
-};
-
-// Write an element with attributes sorted by name so a file diff is effective.
-void WriteElement(SDOMElement &inElement, SimpleXmlWriter &inWriter,
- std::vector<SDOMAttribute *> &inAttSorter)
-{
- inAttSorter.clear();
- for (SDOMAttribute *att = inElement.m_FirstAttribute; att; att = att->m_NextAttribute)
- inAttSorter.push_back(att);
- // We decided that we don't want attribute sorting; the code that adds attributes needs
- // to be consistent.
- // std::sort( inAttSorter.begin(), inAttSorter.end(), SAttributeComparator() );
- // This element doesn't add anything to the system in this case.
- if (inElement.m_FirstAttribute == NULL && inElement.m_FirstChild == NULL
- && IsTrivial(inElement.m_Value))
- return;
-
- inWriter.Begin(inElement.m_Name);
-
- const char8_t *theLastAttName = 0;
- for (size_t idx = 0, end = inAttSorter.size(); idx < end; ++idx) {
- SDOMAttribute *theAtt(inAttSorter[idx]);
- if (theAtt->m_Name != theLastAttName)
- inWriter.Att(theAtt->m_Name, theAtt->m_Value);
- else {
- QT3DS_ASSERT(false);
- }
- theLastAttName = theAtt->m_Name;
- }
- // Elements can either have children or values but not both at this point.
- if (inElement.m_FirstChild) {
- for (SDOMElement *theChild = inElement.m_FirstChild; theChild;
- theChild = theChild->m_NextSibling)
- WriteElement(*theChild, inWriter, inAttSorter);
- inWriter.End();
- } else {
- if (!IsTrivial(inElement.m_Value))
- inWriter.Value(inElement.m_Value);
-
- inWriter.End();
- }
-}
-
-void CDOMSerializer::Write(SDOMElement &inElement, IOutStream &inStream, QT3DSU32 inTabs)
-{
- // TODO: QXmlStreamWriter here?
- std::vector<SDOMAttribute *> theAttributes;
- SimpleXmlWriter writer(inStream, inTabs);
- std::vector<SDOMAttribute *> theAttSorter;
- WriteElement(inElement, writer, theAttSorter);
-}
-
-SDOMElement *CDOMSerializer::Read(IDOMFactory &inFactory, IInStream &inStream,
- CXmlErrorHandler *inErrorHandler)
-{
- return DOMParser::ParseXMLFile(inFactory, inStream, inErrorHandler);
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.h b/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.h
deleted file mode 100644
index 5fe722f9..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/Qt3DSDMXML.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_IMPORT_XML_H
-#define QT3DS_IMPORT_XML_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "Qt3DSDMDataTypes.h"
-#include <string>
-#include "Qt3DSDMWStrOps.h" //Conversion between string and various datatypes.
-#include "foundation/Qt3DSFlags.h"
-#include "EASTL/algorithm.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/IOStreams.h"
-#include "Qt3DSDMValue.h"
-#include <memory>
-
-namespace qt3dsdm {
-using qt3ds::foundation::MemoryBuffer;
-using qt3ds::foundation::RawAllocator;
-class IStringTable;
-
-class IDOMFactory;
-struct SDOMAttribute;
-struct SDOMElement;
-
-typedef const char8_t *TXMLCharPtr;
-typedef const wchar_t *TWideXMLCharPtr;
-
-typedef TCharStr TXMLWideStr;
-typedef eastl::basic_string<char8_t> TXMLStr;
-
-using qt3ds::QT3DSU32;
-using qt3ds::NVFlags;
-using qt3ds::foundation::NVDataRef;
-using qt3ds::foundation::NVConstDataRef;
-using qt3ds::foundation::IOutStream;
-
-class IDOMFactory
-{
-protected:
- virtual ~IDOMFactory() {}
-public:
- friend class std::shared_ptr<IDOMFactory>;
-
- virtual void Release() = 0;
- // Str does not need to be null terminated.
- virtual void AppendStrBuf(TXMLCharPtr str, QT3DSU32 len) = 0;
- virtual void AppendStrBuf(TWideXMLCharPtr str, QT3DSU32 len) = 0;
- // Null terminate what is there and return the buffer.
- // This pointer needs to be persistent.
- virtual TXMLCharPtr FinalizeStrBuf() = 0;
- virtual void IgnoreStrBuf() = 0;
-
- virtual std::shared_ptr<IStringTable> GetStringTable() = 0;
-
- virtual SDOMAttribute *NextAttribute(TWideXMLCharPtr name, TWideXMLCharPtr val) = 0;
- virtual SDOMElement *NextElement(TWideXMLCharPtr name) = 0;
-
- virtual SDOMAttribute *NextAttribute(TXMLCharPtr name, TXMLCharPtr val) = 0;
- virtual SDOMElement *NextElement(TXMLCharPtr name) = 0;
-
- TXMLCharPtr RegisterValue(TXMLCharPtr inValue);
- TXMLCharPtr RegisterValue(TWideXMLCharPtr inValue);
-
- static std::shared_ptr<IDOMFactory>
- CreateDOMFactory(std::shared_ptr<IStringTable> inStrTable);
-};
-
-struct DOMFlagValues
-{
- enum Enum {
- CaselessElementNames = 1 << 0,
- CaselessAttributeNames = 1 << 1,
- };
-};
-
-struct SDOMFlags : NVFlags<DOMFlagValues::Enum, int>
-{
- SDOMFlags()
- : NVFlags<DOMFlagValues::Enum, int>(DOMFlagValues::CaselessElementNames
- | DOMFlagValues::CaselessAttributeNames)
- {
- }
- bool CaselessAttributes() const { return *this & DOMFlagValues::CaselessAttributeNames; }
- bool CaselessElements() const { return *this & DOMFlagValues::CaselessElementNames; }
-};
-
-class IDOMReader
-{
-protected:
- virtual ~IDOMReader() {}
-public:
- friend class std::shared_ptr<IDOMReader>;
-
- // Stack object to save the reader's state.
- struct Scope
- {
- IDOMReader &m_Reader;
- Scope(IDOMReader &reader)
- : m_Reader(reader)
- {
- m_Reader.PushScope();
- }
- ~Scope() { m_Reader.PopScope(); }
- };
-
- // Parse buffer
- MemoryBuffer<RawAllocator> m_TempBuf;
- std::shared_ptr<IStringTable> m_StringTable;
-
- IDOMReader(std::shared_ptr<IStringTable> inStringTable)
- : m_StringTable(inStringTable)
- {
- }
-
- std::shared_ptr<IStringTable> GetStringTable() { return m_StringTable; }
-
- // DOM reader flags change the nature of the DOM reader.
- // see DOMFlagValues
- // Defaults to caseless comparisons for attributes and for
- // element names.
- virtual void SetDOMFlags(SDOMFlags inFlags) = 0;
- virtual SDOMFlags GetDOMFlags() const = 0;
-
- // Pushing scope saves your state so no matter where you are when
- // you next pop scope, you come back to the same state.
- virtual void PushScope() = 0;
- virtual void PopScope() = 0;
-
- // Sometimes pushing and popping scope isn't enough and you need
- // somewhat random access to scope.
- // This scope does not remember the current attribute.
- virtual void *GetScope() = 0;
- virtual void SetScope(void *inScope) = 0;
- // Return an attribute whose value is *not* registered with the string table.
- // You can't hold onto this value for any length of time, but when you need to
- // immediately convert to a different value this is the most efficient way.
- virtual bool UnregisteredAtt(TWideXMLCharPtr name, TWideXMLCharPtr &outValue) = 0;
- virtual bool UnregisteredAtt(TXMLCharPtr name, TXMLCharPtr &outValue) = 0;
- // Return an attribute whose value *is* registered with the string table.
- virtual bool Att(TWideXMLCharPtr name, TWideXMLCharPtr &outValue) = 0;
- virtual bool Att(TXMLCharPtr name, TXMLCharPtr &outValue) = 0;
- virtual eastl::pair<TWideXMLCharPtr, TWideXMLCharPtr> GetFirstAttribute() = 0;
- virtual eastl::pair<TWideXMLCharPtr, TWideXMLCharPtr> GetNextAttribute() = 0;
- virtual eastl::pair<TXMLCharPtr, TXMLCharPtr> GetNarrowFirstAttribute() = 0;
- virtual eastl::pair<TXMLCharPtr, TXMLCharPtr> GetNarrowNextAttribute() = 0;
- virtual QT3DSU32 CountChildren() = 0;
- virtual QT3DSU32 CountChildren(TWideXMLCharPtr childName) = 0;
- virtual QT3DSU32 CountChildren(TXMLCharPtr childName) = 0;
- virtual bool MoveToFirstChild(TWideXMLCharPtr childName) = 0;
- virtual bool MoveToFirstChild(TXMLCharPtr childName) = 0;
- virtual bool MoveToFirstChild() = 0;
- virtual bool MoveToNextSibling(TWideXMLCharPtr siblingName) = 0;
- virtual bool MoveToNextSibling(TXMLCharPtr siblingName) = 0;
- virtual bool MoveToNextSibling() = 0;
- // Leave element means go to its parent.
- virtual void Leave() = 0;
- virtual TWideXMLCharPtr GetElementName() const = 0;
- virtual TXMLCharPtr GetNarrowElementName() const = 0;
-
- // Value is the concatentated text node values inside the element
- virtual bool Value(TWideXMLCharPtr &outValue) = 0;
- virtual bool Value(TXMLCharPtr &outValue) = 0;
-
- // Get the element this reader was created with
- virtual SDOMElement *GetTopElement() = 0;
-
- bool Att(TWideXMLCharPtr name, TXMLWideStr &outValue)
- {
- TWideXMLCharPtr temp;
- if (UnregisteredAtt(name, temp)) {
- outValue.assign(temp);
- return true;
- }
- return false;
- }
-
- bool Att(TXMLCharPtr name, TXMLStr &outValue)
- {
- TXMLCharPtr temp;
- if (UnregisteredAtt(name, temp)) {
- outValue.assign(temp);
- return true;
- }
- return false;
- }
-
- // Helpers to help make the parsing a bit easier.
- template <typename TDataType>
- bool Att(TWideXMLCharPtr name, TDataType &outValue)
- {
- TWideXMLCharPtr temp;
- if (UnregisteredAtt(name, temp)) {
- WStrOps<TDataType>().StrTo(temp, outValue);
- return true;
- } else {
- return false;
- }
- }
- template <typename TDataType>
- bool Att(TXMLCharPtr name, TDataType &outValue)
- {
- TXMLCharPtr temp;
- if (UnregisteredAtt(name, temp)) {
- WStrOps<TDataType>().StrTo(temp, outValue);
- return true;
- } else {
- return false;
- }
- }
-
- bool ChildValue(TXMLCharPtr name, TXMLCharPtr &value)
- {
- if (MoveToFirstChild(name)) {
- Value(value);
- Leave();
- return true;
- }
- return false;
- }
-
- bool ChildValue(TWideXMLCharPtr name, TWideXMLCharPtr &value)
- {
- if (MoveToFirstChild(name)) {
- Value(value);
- Leave();
- return true;
- }
- return false;
- }
-
- bool RegisteredChildValue(TWideXMLCharPtr name, TWideXMLCharPtr &value)
- {
- if (MoveToFirstChild(name)) {
- RegisteredValue(value);
- Leave();
- return true;
- }
- return false;
- }
- bool RegisteredChildValue(TXMLCharPtr name, TXMLCharPtr &value)
- {
- if (MoveToFirstChild(name)) {
- RegisteredValue(value);
- Leave();
- return true;
- }
- return false;
- }
- bool RegisteredValue(TWideXMLCharPtr &outValue)
- {
- bool retval = Value(outValue);
- if (retval)
- outValue = m_StringTable->RegisterStr(outValue);
- return retval;
- }
- bool RegisteredValue(TXMLCharPtr &outValue)
- {
- bool retval = Value(outValue);
- if (retval)
- outValue = m_StringTable->RegisterStr(outValue);
- return retval;
- }
- bool Value(DataModelDataType::Value type, SValue &outValue);
-
- template <typename TDataType>
- bool Value(TDataType &outValue)
- {
- TXMLCharPtr value;
- if (Value(value)) {
- WStrOps<TDataType>().StrTo(value, outValue);
- return true;
- }
- return false;
- }
-
- // Functions below implemented in WStrOpsImpl
- // to avoid circular dependencies
- // Returns the number of items read
- // Destructive parsing
- template <typename TDataType>
- bool ValueList(NVDataRef<TDataType> data);
-
- // Destructive operation because we can't trust
- // strtod to do the right thing. On windows, for long strings,
- // it calls strlen every operation thus leading to basically N^2
- // behavior
- template <typename TDataType>
- NVConstDataRef<TDataType> ChildValueList(TWideXMLCharPtr listName);
-
- template <typename TDataType>
- NVConstDataRef<TDataType> ChildValueList(TXMLCharPtr listName);
-
- template <typename TSerializer>
- void Serialize(const wchar_t *elemName, TSerializer &serializer)
- {
- IDOMReader::Scope __theScope(*this);
- if (MoveToFirstChild(elemName)) {
- serializer.Serialize(*this);
- }
- }
- // Optionally hold on to the factory to keep our elements in memory as long as we are.
- static std::shared_ptr<IDOMReader>
- CreateDOMReader(SDOMElement &inRootElement, std::shared_ptr<IStringTable> inStringTable,
- std::shared_ptr<IDOMFactory> inFactory = std::shared_ptr<IDOMFactory>());
-};
-
-// Write out data in an xml-like fasion without specifying exactly
-// where that data is being written.
-class IDOMWriter
-{
-protected:
- virtual ~IDOMWriter() {}
-public:
- friend class std::shared_ptr<IDOMWriter>;
-
- // Control the element scope.
- struct Scope
- {
- IDOMWriter &m_Writer;
- Scope(IDOMWriter &writer, TWideXMLCharPtr inElemName)
- : m_Writer(writer)
- {
- m_Writer.Begin(inElemName);
- }
- Scope(IDOMWriter &writer, TXMLCharPtr inElemName)
- : m_Writer(writer)
- {
- m_Writer.Begin(inElemName);
- }
- ~Scope() { m_Writer.End(); }
- };
-
- wchar_t m_PrintBuf[256];
- char8_t m_NarrowBuf[256];
-
- virtual void SetDOMFlags(SDOMFlags inFlags) = 0;
- virtual SDOMFlags GetDOMFlags() const = 0;
- // There tend to be two types of elements.
- // Containers (<a>\n\t<b/><b/>\n</a>)
- // and Values <b>onetwothree</b>
- virtual void Begin(TWideXMLCharPtr inElemName) = 0;
- virtual void Begin(TXMLCharPtr inElemName) = 0;
- // Attributes. They may be sorted just before write
- virtual void Att(TWideXMLCharPtr name, TWideXMLCharPtr value) = 0;
- virtual void Att(TXMLCharPtr name, TXMLCharPtr value) = 0;
- virtual void Value(TWideXMLCharPtr value) = 0;
- virtual void Value(TXMLCharPtr value) = 0;
- virtual void End() = 0;
- virtual void RemoveCurrent() = 0;
- virtual void ReplaceCurrent(SDOMElement &inElement) = 0;
- // Append all the children of inElement to the child list of the current items.
- virtual void AppendChildren(SDOMElement &inElement) = 0;
- virtual void RemoveAttribute(TWideXMLCharPtr inItem) = 0;
- virtual void RemoveAttribute(TXMLCharPtr inItem) = 0;
- // Get the number of tabs required to line up the next line
- // with the opening of the previous line
- virtual QT3DSU32 GetTabs() = 0;
- virtual SDOMElement *GetTopElement() = 0;
- virtual std::shared_ptr<IDOMFactory> GetFactory() = 0;
- // Move this item before this sibling. Function does not rearrange the
- // tree in any major way and will not work if inItem and inSibling aren't
- // siblings.
- virtual void MoveBefore(TWideXMLCharPtr inItem, TWideXMLCharPtr inSibling) = 0;
- virtual void MoveBefore(TXMLCharPtr inItem, TXMLCharPtr inSibling) = 0;
-
- virtual void ChildValue(TWideXMLCharPtr name, TWideXMLCharPtr value)
- {
- Begin(name);
- Value(value);
- End();
- }
-
- virtual void ChildValue(TXMLCharPtr name, TXMLCharPtr value)
- {
- Begin(name);
- Value(value);
- End();
- }
-
- TWideXMLCharPtr ToStr(wchar_t val)
- {
- m_PrintBuf[0] = val;
- m_PrintBuf[1] = 0;
- return m_PrintBuf;
- }
- TXMLCharPtr ToStr(char8_t val)
- {
- m_NarrowBuf[0] = val;
- m_NarrowBuf[1] = 0;
- return m_NarrowBuf;
- }
- template <typename TDataType>
- TWideXMLCharPtr ToStr(TDataType val)
- {
- WStrOps<TDataType>().ToStr(val, NVDataRef<wchar_t>(m_PrintBuf, 256));
- return m_PrintBuf;
- }
-
- template <typename TDataType>
- TXMLCharPtr ToNarrowStr(TDataType val)
- {
- WStrOps<TDataType>().ToStr(val, NVDataRef<char8_t>(m_NarrowBuf, 256));
- return m_NarrowBuf;
- }
-
- void Att(TWideXMLCharPtr name, const TXMLWideStr &inValue)
- {
- return Att(name, inValue.wide_str());
- }
-
- void Att(TXMLCharPtr name, const TXMLStr &inValue) { return Att(name, inValue.c_str()); }
-
- template <typename TData>
- void Att(TWideXMLCharPtr name, TData value)
- {
- Att(name, ToStr(value));
- }
-
- template <typename TData>
- void Att(TXMLCharPtr name, TData value)
- {
- Att(name, ToNarrowStr(value));
- }
-
- template <typename TSerializer>
- void Serialize(const wchar_t *elemName, TSerializer &serializer)
- {
- IDOMWriter::Scope __theScope(*this, elemName);
- serializer.Serialize(*this);
- }
-
- template <typename TSerializer>
- void Serialize(const char8_t *elemName, TSerializer &serializer)
- {
- IDOMWriter::Scope __theScope(*this, elemName);
- serializer.Serialize(*this);
- }
-
- std::shared_ptr<IDOMReader> CreateDOMReader()
- {
- std::shared_ptr<IDOMFactory> theFactory(GetFactory());
- return IDOMReader::CreateDOMReader(*GetTopElement(), theFactory->GetStringTable(),
- theFactory);
- }
-
- // Note that the default method of creating a writer also creates a reader; they can
- // both manipulation the DOM hierarch.
- static eastl::pair<std::shared_ptr<IDOMWriter>, std::shared_ptr<IDOMReader>>
- CreateDOMWriter(std::shared_ptr<IDOMFactory> inFactory, SDOMElement &inRootElement,
- std::shared_ptr<IStringTable> inStringTable);
-
- static eastl::pair<std::shared_ptr<IDOMWriter>, std::shared_ptr<IDOMReader>>
- CreateDOMWriter(const wchar_t *inTopElemName, std::shared_ptr<IStringTable> inStringTable)
- {
- std::shared_ptr<IDOMFactory> theFactory(IDOMFactory::CreateDOMFactory(inStringTable));
- SDOMElement *theRoot = theFactory->NextElement(inTopElemName);
- return CreateDOMWriter(theFactory, *theRoot, inStringTable);
- }
-};
-
-class CXmlErrorHandler
-{
-protected:
- virtual ~CXmlErrorHandler() {}
-public:
- virtual void OnXmlError(const QString &errorName, int line, int column) = 0;
-};
-
-class CDOMSerializer
-{
-public:
- static void WriteXMLHeader(IOutStream &inStream);
- static void Write(SDOMElement &inElement, IOutStream &inStream, QT3DSU32 inTabs = 0);
- static SDOMElement *Read(IDOMFactory &inFactory, qt3ds::foundation::IInStream &inStream,
- CXmlErrorHandler *inErrorHandler = NULL);
-};
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.cpp b/src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.cpp
deleted file mode 100644
index 6f42516b..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.cpp
+++ /dev/null
@@ -1,1565 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#ifdef WIN32
-#pragma warning(disable : 4103 4512 4503)
-#endif
-#include "SignalsImpl.h"
-
-using namespace std;
-
-namespace {
-bool g_DataModelSignalsEnabled = true;
-
-#define CHECK_SIGNALS_ENABLED() \
- { \
- if (g_DataModelSignalsEnabled == false) \
- return; \
- }
-}
-
-namespace qt3dsdm {
-void SetDataModelSignalsEnabled(bool inEnabled)
-{
- g_DataModelSignalsEnabled = inEnabled;
-}
-// Defaults to true
-bool AreDataModelSignalsEnabled()
-{
- return g_DataModelSignalsEnabled;
-}
-
-#define CONNECT_QT(x) TSignalConnectionPtr(new QtSignalConnection(x))
-#define CONNECT_SIGNAL_QT(x) CONNECT_QT(QObject::connect(this, x, inCallback))
-
-class CPropertyCoreSignaller : public QObject, public IInstancePropertyCoreSignalProvider,
- public IInstancePropertyCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void propertySignal(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, const SValue);
-public:
- TSignalConnectionPtr ConnectInstancePropertyValue(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, const SValue &)>
- &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CPropertyCoreSignaller::propertySignal,
- inCallback));
- }
- void SignalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertySignal(inInstance, inProperty, inValue);
- }
-};
-
-TSignalItemPtr CreatePropertyCoreSignaller()
-{
- return TSignalItemPtr(
- static_cast<IInstancePropertyCoreSignalProvider *>(new CPropertyCoreSignaller()));
-}
-
-class CDataCoreSignaller : public QObject, public IDataCoreSignalProvider,
- public IDataCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void instanceCreated(Qt3DSDMInstanceHandle handle);
- void beforeInstanceDeleted(Qt3DSDMInstanceHandle handle);
- void instanceDeleted(Qt3DSDMInstanceHandle handle);
- void instanceDerived(Qt3DSDMInstanceHandle handle, Qt3DSDMInstanceHandle handle2);
- void instanceParentRemoved(Qt3DSDMInstanceHandle handle, Qt3DSDMInstanceHandle handle2);
- void propertyAdded(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, TCharPtr,
- DataModelDataType::Value);
- void propertyRemoved(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, TCharPtr,
- DataModelDataType::Value);
-
-public:
- virtual TSignalConnectionPtr
- ConnectInstanceCreated(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::instanceCreated,
- inCallback));
- }
- virtual TSignalConnectionPtr
- ConnectBeforeInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::beforeInstanceDeleted,
- inCallback));
- }
- virtual TSignalConnectionPtr
- ConnectInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::instanceDeleted,
- inCallback));
- }
- TSignalConnectionPtr ConnectInstanceDerived(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::instanceDerived,
- inCallback));
- }
- TSignalConnectionPtr ConnectInstanceParentRemoved(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::instanceParentRemoved,
- inCallback));
- }
- virtual TSignalConnectionPtr
- ConnectPropertyAdded(const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- TCharPtr, DataModelDataType::Value)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::propertyAdded, inCallback));
- }
- virtual TSignalConnectionPtr
- ConnectPropertyRemoved(const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- TCharPtr, DataModelDataType::Value)> &inCallback) override
- {
- return CONNECT_QT(QObject::connect(this, &CDataCoreSignaller::propertyRemoved,
- inCallback));
- }
-
- void SignalInstanceCreated(Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceCreated(inInstance);
- }
- void SignalBeforeInstanceDeleted(Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT beforeInstanceDeleted(inInstance);
- }
- void SignalInstanceDeleted(Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceDeleted(inInstance);
- }
- void SignalInstanceDerived(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceDerived(inInstance, inParent);
- }
- void SignalInstanceParentRemoved(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceParentRemoved(inInstance, inParent);
- }
- void SignalPropertyAdded(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, TCharPtr inName,
- DataModelDataType::Value inDataType) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertyAdded(inInstance, inProperty, inName, inDataType);
- }
- void SignalPropertyRemoved(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, TCharPtr inName,
- DataModelDataType::Value inDataType) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertyRemoved(inInstance, inProperty, inName, inDataType);
- }
-};
-
-TSignalItemPtr CreateDataCoreSignaller()
-{
- return TSignalItemPtr(static_cast<IDataCoreSignalProvider *>(new CDataCoreSignaller()));
-}
-
-class CSlideCoreSignaller : public QObject, public ISlideCoreSignalProvider,
- public ISlideCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
-
- void slideCreated(Qt3DSDMSlideHandle);
- void beforeSlideDeleted(Qt3DSDMSlideHandle);
- void slideDeleted(Qt3DSDMSlideHandle);
- void slideDerived(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle, int);
- void instancePropertyValueSet(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &);
- qt3dsdm::SValue instancePropertyValueAdded(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle,
- Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &);
- void instancePropertyValueRemoved(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, const SValue &);
- void slideTimeChanged(Qt3DSDMSlideHandle);
-
-public:
- virtual TSignalConnectionPtr
- ConnectSlideCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::slideCreated);
- }
- virtual TSignalConnectionPtr
- ConnectBeforeSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::beforeSlideDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::slideDeleted);
- }
- TSignalConnectionPtr ConnectSlideDerived(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle, int)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::slideDerived);
- }
- TSignalConnectionPtr ConnectInstancePropertyValueSet(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::instancePropertyValueSet);
- }
- virtual TSignalConnectionPtr ConnectInstancePropertyValueAdded(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, const SValue &)> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::instancePropertyValueAdded);
- }
- TSignalConnectionPtr ConnectInstancePropertyValueRemoved(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::instancePropertyValueRemoved);
- }
- virtual TSignalConnectionPtr
- ConnectSlideTimeChanged(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideCoreSignaller::slideTimeChanged);
- }
-
- void SendSlideCreated(Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideCreated(inSlide);
- }
- void SendBeforeSlideDeleted(Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT beforeSlideDeleted(inSlide);
- }
- void SendSlideDeleted(Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideDeleted(inSlide);
- }
- void SendSlideDerived(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent,
- int inIndex) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideDerived(inSlide, inParent, inIndex);
- }
- void SendPropertyValueSet(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instancePropertyValueSet(inSlide, inInstance, inProperty, inValue);
- }
- virtual SValue SendPropertyValueAdded(Qt3DSDMSlideHandle inSource, Qt3DSDMSlideHandle inDest,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue)
- {
- if (!g_DataModelSignalsEnabled) return SValue();
-
- // check that we have one and only one slot connected to
- // instancePropertyValueAdded signal as it returns a value.
- Q_ASSERT(
- receivers(
- SIGNAL(
- instancePropertyValueAdded(
- Qt3DSDMSlideHandle, Qt3DSDMSlideHandle,
- Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,const SValue &))) == 1);
- // emit instancePropertyValueAdded
- return instancePropertyValueAdded(inSource, inDest, inInstance, inProperty, inValue);
- }
- void SendPropertyValueRemoved(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instancePropertyValueRemoved(inSlide, inInstance, inProperty, inValue);
- }
- void SendSlideTimeChanged(Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideTimeChanged(inSlide);
- }
-};
-
-TSignalItemPtr CreateSlideCoreSignaller()
-{
- return TSignalItemPtr(static_cast<ISlideCoreSignalProvider *>(new CSlideCoreSignaller()));
-}
-
-class CSlideGraphCoreSignaller : public QObject, public ISlideGraphCoreSignalProvider,
- public ISlideGraphCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void graphCreated(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle);
- void graphDeleted(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle);
- void instanceAssociated(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void instanceDissociated(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void graphActiveSlide(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle);
- void graphSeconds(Qt3DSDMSlideGraphHandle, float);
-
-public:
- TSignalConnectionPtr ConnectGraphCreated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideGraphCoreSignaller::graphCreated);
- }
- TSignalConnectionPtr ConnectGraphDeleted(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideGraphCoreSignaller::graphDeleted);
- }
- TSignalConnectionPtr ConnectInstanceAssociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideGraphCoreSignaller::instanceAssociated);
- }
- TSignalConnectionPtr ConnectInstanceDissociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideGraphCoreSignaller::instanceDissociated);
- }
- TSignalConnectionPtr ConnectGraphActiveSlide(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideGraphCoreSignaller::graphActiveSlide);
- }
- virtual TSignalConnectionPtr
- ConnectGraphSeconds(const std::function<void(Qt3DSDMSlideGraphHandle, float)> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CSlideGraphCoreSignaller::graphSeconds);
- }
-
- void SendGraphCreated(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT graphCreated(inGraph, inSlide);
- }
- void SendGraphDeleted(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT graphDeleted(inGraph, inSlide);
- }
- void SendInstanceAssociated(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceAssociated(inGraph, inSlide, inInstance);
- }
- void SendInstanceDissociated(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceDissociated(inGraph, inSlide, inInstance);
- }
- void SendGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT graphActiveSlide(inGraph, inSlide);
- }
- virtual void SendGraphSeconds(Qt3DSDMSlideGraphHandle inGraph, float inSeconds)
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT graphSeconds(inGraph, inSeconds);
- }
-};
-
-TSignalItemPtr CreateSlideGraphCoreSignaller()
-{
- return TSignalItemPtr(
- static_cast<ISlideGraphCoreSignalProvider *>(new CSlideGraphCoreSignaller()));
-}
-
-class CAnimationCoreSignaller : public QObject, public IAnimationCoreSignalProvider,
- public IAnimationCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void animationCreated(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType);
- void beforeAnimationDeleted(Qt3DSDMAnimationHandle);
- void animationDeleted(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType);
- void keyframeInserted(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &);
- void beforeKeyframeErased(Qt3DSDMKeyframeHandle);
- void keyframeErased(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &);
- void beforeAllKeyframesErased(Qt3DSDMAnimationHandle);
- void keyframeUpdated(Qt3DSDMKeyframeHandle, const TKeyframe &);
- void firstKeyframeDynamic(Qt3DSDMAnimationHandle, bool);
-
-public:
- TSignalConnectionPtr ConnectAnimationCreated(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::animationCreated);
- }
- virtual TSignalConnectionPtr
- ConnectBeforeAnimationDeleted(const std::function<void(Qt3DSDMAnimationHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::beforeAnimationDeleted);
- }
- TSignalConnectionPtr ConnectAnimationDeleted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::animationDeleted);
- }
- TSignalConnectionPtr ConnectKeyframeInserted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::keyframeInserted);
- }
- virtual TSignalConnectionPtr
- ConnectBeforeKeyframeErased(const std::function<void(Qt3DSDMKeyframeHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::beforeKeyframeErased);
- }
- TSignalConnectionPtr ConnectKeyframeErased(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::keyframeErased);
- }
- virtual TSignalConnectionPtr
- ConnectBeforeAllKeyframesErased(const std::function<void(Qt3DSDMAnimationHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::beforeAllKeyframesErased);
- }
- TSignalConnectionPtr ConnectKeyframeUpdated(
- const std::function<void(Qt3DSDMKeyframeHandle, const TKeyframe &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::keyframeUpdated);
- }
- TSignalConnectionPtr ConnectFirstKeyframeDynamicSet(
- const std::function<void(Qt3DSDMAnimationHandle, bool)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CAnimationCoreSignaller::firstKeyframeDynamic);
- }
-
- void SendAnimationCreated(Qt3DSDMAnimationHandle inAnimation, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT animationCreated(inAnimation, inSlide, inInstance, inProperty, inIndex,
- inAnimationType);
- }
- void SendBeforeAnimationDeleted(Qt3DSDMAnimationHandle inAnimation) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT beforeAnimationDeleted(inAnimation);
- }
- void SendAnimationDeleted(Qt3DSDMAnimationHandle inAnimation, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT animationDeleted(inAnimation, inSlide, inInstance, inProperty, inIndex,
- inAnimationType);
- }
- void SendKeyframeInserted(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT keyframeInserted(inAnimation, inKeyframe, inData);
- }
- void SendBeforeKeyframeErased(Qt3DSDMKeyframeHandle inKeyframe) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT beforeKeyframeErased(inKeyframe);
- }
- void SendKeyframeErased(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT keyframeErased(inAnimation, inKeyframe, inData);
- }
- void SendBeforeAllKeyframesErased(Qt3DSDMAnimationHandle inAnimation) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT beforeAllKeyframesErased(inAnimation);
- }
- void SendKeyframeUpdated(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT keyframeUpdated(inKeyframe, inData);
- }
- void SendFirstKeyframeDynamicSet(Qt3DSDMAnimationHandle inAnimation,
- bool inKeyframeDynamic) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT firstKeyframeDynamic(inAnimation, inKeyframeDynamic);
- }
-};
-
-TSignalItemPtr CreateAnimationCoreSignaller()
-{
- return TSignalItemPtr(
- static_cast<IAnimationCoreSignalProvider *>(new CAnimationCoreSignaller()));
-}
-
-class CActionCoreSignaller : public QObject, public IActionCoreSignalProvider,
- public IActionCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void triggerObjectSet(Qt3DSDMActionHandle, SObjectRefType &);
- void targetObjectSet(Qt3DSDMActionHandle, SObjectRefType &);
- void eventHandleSet(Qt3DSDMActionHandle, const wstring &);
- void handlerHandleSet(Qt3DSDMActionHandle, const wstring &);
-
- void handlerArgumentAdded(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value);
- void handlerArgumentRemoved(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value);
- void handlerArgumentValueSet(Qt3DSDMHandlerArgHandle, const SValue &);
-
-public:
- TSignalConnectionPtr ConnectTriggerObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::triggerObjectSet);
- }
- TSignalConnectionPtr ConnectTargetObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::targetObjectSet);
- }
- virtual TSignalConnectionPtr
- ConnectEventSet(const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::eventHandleSet);
- }
- virtual TSignalConnectionPtr
- ConnectHandlerSet(const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::handlerHandleSet);
- }
-
- TSignalConnectionPtr ConnectHandlerArgumentAdded(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::handlerArgumentAdded);
- }
- TSignalConnectionPtr ConnectHandlerArgumentRemoved(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::handlerArgumentRemoved);
- }
- TSignalConnectionPtr ConnectHandlerArgumentValueSet(
- const std::function<void(Qt3DSDMHandlerArgHandle, const SValue &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionCoreSignaller::handlerArgumentValueSet);
- }
-
- void SendTriggerObjectSet(Qt3DSDMActionHandle inAction, SObjectRefType &inTriggerObject) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT triggerObjectSet(inAction, inTriggerObject);
- }
- void SendTargetObjectSet(Qt3DSDMActionHandle inAction, SObjectRefType &inTargetObject) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT targetObjectSet(inAction, inTargetObject);
- }
- void SendEventSet(Qt3DSDMActionHandle inAction, const wstring &inEventHandle) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT eventHandleSet(inAction, inEventHandle);
- }
- void SendHandlerSet(Qt3DSDMActionHandle inAction, const wstring &inHandlerHandle) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT handlerHandleSet(inAction, inHandlerHandle);
- }
-
- void SendHandlerArgumentAdded(Qt3DSDMActionHandle inAction,
- Qt3DSDMHandlerArgHandle inHandlerArgument,
- const TCharStr &inName, HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT handlerArgumentAdded(inAction, inHandlerArgument, inName, inArgType, inValueType);
- }
- void SendHandlerArgumentRemoved(Qt3DSDMActionHandle inAction,
- Qt3DSDMHandlerArgHandle inHandlerArgument,
- const TCharStr &inName, HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT handlerArgumentRemoved(inAction, inHandlerArgument, inName, inArgType, inValueType);
- }
- void SendHandlerArgumentValueSet(Qt3DSDMHandlerArgHandle inHandlerArgument,
- const SValue &inValue) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT handlerArgumentValueSet(inHandlerArgument, inValue);
- }
-};
-
-TSignalItemPtr CreateActionCoreSignaller()
-{
- return TSignalItemPtr(static_cast<IActionCoreSignalProvider *>(new CActionCoreSignaller()));
-}
-
-class CActionSystemSignaller : public QObject, public IActionSystemSignalProvider,
- public IActionSystemSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void actionCreated(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void actionDeleted(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
-
-public:
- TSignalConnectionPtr ConnectActionCreated(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionSystemSignaller::actionCreated);
- }
- TSignalConnectionPtr ConnectActionDeleted(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CActionSystemSignaller::actionDeleted);
- }
-
- void SendActionCreated(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT actionCreated(inAction, inSlide, inOwner);
- }
- void SendActionDeleted(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT actionDeleted(inAction, inSlide, inOwner);
- }
-};
-
-TSignalItemPtr CreateActionSystemSignaller()
-{
- return TSignalItemPtr(static_cast<IActionSystemSignalProvider *>(new CActionSystemSignaller()));
-}
-
-class CSlideSystemSignaller : public QObject, public ISlideSystemSignalProvider,
- public ISlideSystemSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void masterCreated(Qt3DSDMSlideHandle);
- void masterDeleted(Qt3DSDMSlideHandle);
- void slideCreated(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle);
- void slideDeleted(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle);
- void slideRearranged(Qt3DSDMSlideHandle, int, int);
- void componentSeconds(Qt3DSDMSlideHandle, float);
- void instanceAssociated(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void instanceDissociated(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void propertyLinked(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void propertyUnlinked(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void activeSlide(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle, Qt3DSDMSlideHandle);
-
- qt3dsdm::SValue valueCreated(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue);
- void valueDestroyed(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue);
-
-public:
- virtual TSignalConnectionPtr
- ConnectMasterCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::masterCreated);
- }
- virtual TSignalConnectionPtr
- ConnectMasterDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::masterDeleted);
- }
- TSignalConnectionPtr ConnectSlideCreated(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::slideCreated);
- }
- TSignalConnectionPtr ConnectSlideDeleted(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::slideDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectSlideRearranged(const std::function<void(Qt3DSDMSlideHandle, int, int)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::slideRearranged);
- }
- virtual TSignalConnectionPtr
- ConnectComponentSeconds(const std::function<void(Qt3DSDMSlideHandle, float)> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::componentSeconds);
- }
- TSignalConnectionPtr ConnectInstanceAssociated(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::instanceAssociated);
- }
- TSignalConnectionPtr ConnectInstanceDissociated(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::instanceDissociated);
- }
- TSignalConnectionPtr ConnectPropertyLinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::propertyLinked);
- }
- TSignalConnectionPtr ConnectPropertyUnlinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::propertyUnlinked);
- }
- TSignalConnectionPtr ConnectActiveSlide(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle, Qt3DSDMSlideHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::activeSlide);
- }
- virtual TSignalConnectionPtr ConnectPropertyValueCreated(
- const std::function<SValue(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::valueCreated);
- }
- virtual TSignalConnectionPtr ConnectPropertyValueDestroyed(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CSlideSystemSignaller::valueDestroyed);
- }
-
- void SendMasterCreated(Qt3DSDMSlideHandle inMaster) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT masterCreated(inMaster);
- }
- void SendMasterDeleted(Qt3DSDMSlideHandle inMaster) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT masterDeleted(inMaster);
- }
- void SendSlideCreated(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideCreated(inMaster, inIndex, inSlide);
- }
- void SendSlideDeleted(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideDeleted(inMaster, inIndex, inSlide);
- }
- void SendSlideRearranged(Qt3DSDMSlideHandle inMaster, int inOldIndex, int inNewIndex) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideRearranged(inMaster, inOldIndex, inNewIndex);
- }
- virtual void SendComponentSeconds(Qt3DSDMSlideHandle inMaster, float inSeconds)
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT componentSeconds(inMaster, inSeconds);
- }
- void SendInstanceAssociated(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceAssociated(inMaster, inInstance);
- }
- void SendInstanceDissociated(Qt3DSDMSlideHandle inMaster,
- Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceDissociated(inMaster, inInstance);
- }
- void SendPropertyLinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertyLinked(inMaster, inInstance, inProperty);
- }
- void SendPropertyUnlinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertyUnlinked(inMaster, inInstance, inProperty);
- }
- void SendActiveSlide(Qt3DSDMSlideHandle inMaster, int inIndex,
- Qt3DSDMSlideHandle inOldSlide, Qt3DSDMSlideHandle inNewSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT activeSlide(inMaster, inIndex, inOldSlide, inNewSlide);
- }
-
- virtual SValue SendPropertyValueCreated(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue)
- {
- if (!g_DataModelSignalsEnabled) return SValue();
-
- // check that we have one and only one slot connected to
- // valueCreated signal as it returns a value.
- Q_ASSERT(
- receivers(
- SIGNAL(
- valueCreated(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, const SValue &))) == 1);
- // emit valueCreated
- return valueCreated(inSlide, inInstance, inProperty, inValue);
- }
- virtual void SendPropertyValueDestroyed(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue)
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT valueDestroyed(inSlide, inInstance, inProperty, inValue);
- }
-};
-
-TSignalItemPtr CreateSlideSystemSignaller()
-{
- return TSignalItemPtr(static_cast<ISlideSystemSignalProvider *>(new CSlideSystemSignaller()));
-}
-
-class CCustomPropCoreSignaller : public QObject, public ICustomPropCoreSignalProvider,
- public ICustomPropCoreSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void customPropertyCreated(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle);
- void customPropertyDeleted(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle);
- void customPropertyModified(Qt3DSDMPropertyHandle);
- void customEventCreated(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle);
- void customEventDeleted(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle);
- void customEventModified(Qt3DSDMEventHandle);
- void customHandlerCreated(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle);
- void customHandlerDeleted(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle);
- void customHandlerModified(Qt3DSDMHandlerHandle);
- void customHandlerParamCreated(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle);
- void customHandlerParamDeleted(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle);
- void customHandlerParamModified(Qt3DSDMHandlerParamHandle);
- void customReferencesModified(Qt3DSDMInstanceHandle, const TCharStr &);
-
-public:
- TSignalConnectionPtr ConnectCustomPropertyCreated(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customPropertyCreated);
- }
- TSignalConnectionPtr ConnectCustomPropertyDeleted(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customPropertyDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectCustomPropertyModified(const std::function<void(Qt3DSDMPropertyHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customPropertyModified);
- }
- TSignalConnectionPtr ConnectCustomEventCreated(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customEventCreated);
- }
- TSignalConnectionPtr ConnectCustomEventDeleted(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customEventDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectCustomEventModified(const std::function<void(Qt3DSDMEventHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customEventModified);
- }
- TSignalConnectionPtr ConnectCustomHandlerCreated(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customHandlerCreated);
- }
- TSignalConnectionPtr ConnectCustomHandlerDeleted(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customHandlerDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectCustomHandlerModified(const std::function<void(Qt3DSDMHandlerHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customHandlerModified);
- }
- TSignalConnectionPtr ConnectCustomHandlerParamCreated(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customHandlerParamCreated);
- }
- TSignalConnectionPtr ConnectCustomHandlerParamDeleted(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customHandlerParamDeleted);
- }
- TSignalConnectionPtr ConnectCustomHandlerParamModified(
- const std::function<void(Qt3DSDMHandlerParamHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customHandlerParamModified);
- }
- TSignalConnectionPtr ConnectCustomReferencesModified(
- const std::function<void(Qt3DSDMInstanceHandle, const TCharStr &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CCustomPropCoreSignaller::customReferencesModified);
- }
-
- void SendCustomPropertyCreated(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customPropertyCreated(inProp, inOwner);
- }
- void SendCustomPropertyDeleted(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customPropertyDeleted(inProp, inOwner);
- }
- void SendCustomPropertyModified(Qt3DSDMPropertyHandle inProp) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customPropertyModified(inProp);
- }
- void SendCustomEventCreated(Qt3DSDMEventHandle inEvent, Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customEventCreated(inEvent, inOwner);
- }
- void SendCustomEventDeleted(Qt3DSDMEventHandle inEvent, Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customEventDeleted(inEvent, inOwner);
- }
- void SendCustomEventModified(Qt3DSDMEventHandle inEvent) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customEventModified(inEvent);
- }
- void SendCustomHandlerCreated(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerCreated(inHandler, inOwner);
- }
- void SendCustomHandlerDeleted(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerDeleted(inHandler, inOwner);
- }
- void SendCustomHandlerModified(Qt3DSDMHandlerHandle inHandler) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerModified(inHandler);
- }
- void SendCustomHandlerParamCreated(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerParamCreated(inParameter, inHandler);
- }
- void SendCustomHandlerParamDeleted(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerParamDeleted(inParameter, inHandler);
- }
- void SendCustomHandlerParamModified(Qt3DSDMHandlerParamHandle inParameter) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerParamModified(inParameter);
- }
- void SendCustomReferencesModified(Qt3DSDMInstanceHandle inOwner,
- const TCharStr &inString) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customReferencesModified(inOwner, inString);
- }
-};
-
-TSignalItemPtr CreateCustomPropCoreSignaller()
-{
- return TSignalItemPtr(
- static_cast<ICustomPropCoreSignalProvider *>(new CCustomPropCoreSignaller()));
-}
-
-class CStudioFullSystemSignaller : public QObject, public IStudioFullSystemSignalProvider,
- public IStudioFullSystemSignalSender
-{
- Q_OBJECT
-Q_SIGNALS:
- void changeSetBegin();
- void changeSetEnd();
- void animationBegin();
- void animationEnd();
- void slideCreated(Qt3DSDMSlideHandle);
- void slideDeleted(Qt3DSDMSlideHandle);
- void slideRearranged(Qt3DSDMSlideHandle, int, int);
- void componentSeconds(Qt3DSDMSlideHandle);
- void beginComponentSeconds(Qt3DSDMSlideHandle);
- void propertyLinked(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void propertyUnlinked(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void activeSlide(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle);
- void instanceCreated(Qt3DSDMInstanceHandle);
- void instanceDeleted(Qt3DSDMInstanceHandle);
- void animationCreated(Qt3DSDMAnimationHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void animationDeleted(Qt3DSDMAnimationHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void controlledToggled(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void keyframeInserted(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle);
- void keyframeErased(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle);
- void keyframeUpdated(Qt3DSDMKeyframeHandle);
- void connectFirstKeyframeDynamicSet(Qt3DSDMAnimationHandle, bool);
- void instancePropertyValue(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle);
- void actionCreated(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void actionDeleted(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle);
- void triggerObjectSet(Qt3DSDMActionHandle);
- void targetObjectSet(Qt3DSDMActionHandle);
- void eventHandleSet(Qt3DSDMActionHandle);
- void handlerHandleSet(Qt3DSDMActionHandle);
- void handlerArgumentValueSet(Qt3DSDMHandlerArgHandle);
- void customPropertyCreated(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle);
- void customPropertyDeleted(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle);
- void customPropertyModified(Qt3DSDMPropertyHandle);
- void customEventCreated(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle);
- void customEventDeleted(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle);
- void customEventModified(Qt3DSDMEventHandle);
- void customHandlerCreated(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle);
- void customHandlerDeleted(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle);
- void customHandlerModified(Qt3DSDMHandlerHandle);
- void customHandlerParamCreated(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle);
- void customHandlerParamDeleted(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle);
- void customHandlerParamModified(Qt3DSDMHandlerParamHandle);
- void customReferencesModified(Qt3DSDMInstanceHandle, const TCharStr &);
-private:
- ISlideSystemSignalProvider *m_SlideSystemSignalProvider;
-
-public:
- CStudioFullSystemSignaller(ISlideSystemSignalProvider *inProvider)
- : m_SlideSystemSignalProvider(inProvider)
- {
- }
-
- virtual TSignalConnectionPtr ConnectChangeSetBegin(const std::function<void()> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::changeSetBegin);
- }
- virtual TSignalConnectionPtr ConnectChangeSetEnd(const std::function<void()> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::changeSetEnd);
- }
-
- // Used when people start to set component times.
- virtual TSignalConnectionPtr ConnectAnimationSetBegin(const std::function<void()> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::animationBegin);
- }
- virtual TSignalConnectionPtr ConnectAnimationSetEnd(const std::function<void()> &inCallback)
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::animationEnd);
- }
-
- virtual TSignalConnectionPtr
- ConnectSlideCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::slideCreated);
- }
- virtual TSignalConnectionPtr
- ConnectSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::slideDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectSlideRearranged(const std::function<void(Qt3DSDMSlideHandle, int, int)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::slideRearranged);
- }
- virtual TSignalConnectionPtr
- ConnectBeginComponentSeconds(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::beginComponentSeconds);
- }
- virtual TSignalConnectionPtr
- ConnectComponentSeconds(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::componentSeconds);
- }
- TSignalConnectionPtr ConnectPropertyLinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::propertyLinked);
- }
- TSignalConnectionPtr ConnectPropertyUnlinked(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::propertyUnlinked);
- }
- TSignalConnectionPtr ConnectActiveSlide(
- const std::function<void(Qt3DSDMSlideHandle, int, Qt3DSDMSlideHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::activeSlide);
- }
-
- virtual TSignalConnectionPtr
- ConnectInstanceCreated(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::instanceCreated);
- }
- virtual TSignalConnectionPtr
- ConnectInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::instanceDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectAnimationCreated(const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::animationCreated);
- }
- virtual TSignalConnectionPtr
- ConnectAnimationDeleted(const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::animationDeleted);
- }
- TSignalConnectionPtr ConnectKeyframeInserted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::keyframeInserted);
- }
- TSignalConnectionPtr ConnectKeyframeErased(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::keyframeErased);
- }
- virtual TSignalConnectionPtr
- ConnectKeyframeUpdated(const std::function<void(Qt3DSDMKeyframeHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::keyframeUpdated);
- }
- TSignalConnectionPtr ConnectInstancePropertyValue(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::instancePropertyValue);
- }
- TSignalConnectionPtr ConnectFirstKeyframeDynamicSet(
- const std::function<void(Qt3DSDMAnimationHandle, bool)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::connectFirstKeyframeDynamicSet);
- }
-
- TSignalConnectionPtr ConnectActionCreated(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::actionCreated);
- }
- TSignalConnectionPtr ConnectActionDeleted(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::actionDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectTriggerObjectSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::triggerObjectSet);
- }
- virtual TSignalConnectionPtr
- ConnectTargetObjectSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::targetObjectSet);
- }
- virtual TSignalConnectionPtr
- ConnectEventSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::eventHandleSet);
- }
- virtual TSignalConnectionPtr
- ConnectHandlerSet(const std::function<void(Qt3DSDMActionHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::handlerHandleSet);
- }
- virtual TSignalConnectionPtr
- ConnectHandlerArgumentValueSet(const std::function<void(Qt3DSDMHandlerArgHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::handlerArgumentValueSet);
- }
-
- TSignalConnectionPtr ConnectCustomPropertyCreated(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customPropertyCreated);
- }
- TSignalConnectionPtr ConnectCustomPropertyDeleted(
- const std::function<void(Qt3DSDMPropertyHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customPropertyDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectCustomPropertyModified(const std::function<void(Qt3DSDMPropertyHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customPropertyModified);
- }
- TSignalConnectionPtr ConnectCustomEventCreated(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customEventCreated);
- }
- TSignalConnectionPtr ConnectCustomEventDeleted(
- const std::function<void(Qt3DSDMEventHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customEventDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectCustomEventModified(const std::function<void(Qt3DSDMEventHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customEventModified);
- }
- TSignalConnectionPtr ConnectCustomHandlerCreated(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customHandlerCreated);
- }
- TSignalConnectionPtr ConnectCustomHandlerDeleted(
- const std::function<void(Qt3DSDMHandlerHandle, Qt3DSDMInstanceHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customHandlerDeleted);
- }
- virtual TSignalConnectionPtr
- ConnectCustomHandlerModified(const std::function<void(Qt3DSDMHandlerHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customHandlerModified);
- }
- TSignalConnectionPtr ConnectCustomHandlerParamCreated(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customHandlerParamCreated);
- }
- TSignalConnectionPtr ConnectCustomHandlerParamDeleted(
- const std::function<void(Qt3DSDMHandlerParamHandle, Qt3DSDMHandlerHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customHandlerParamDeleted);
- }
- TSignalConnectionPtr ConnectCustomHandlerParamModified(
- const std::function<void(Qt3DSDMHandlerParamHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customHandlerParamModified);
- }
- TSignalConnectionPtr ConnectCustomReferencesModified(
- const std::function<void(Qt3DSDMInstanceHandle, const TCharStr &)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::customReferencesModified);
- }
- TSignalConnectionPtr ConnectControlledToggled(
- const std::function<void(
- Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> &inCallback) override
- {
- return CONNECT_SIGNAL_QT(&CStudioFullSystemSignaller::controlledToggled);
- }
-
- virtual void SendChangeSetBegin()
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT changeSetBegin();
- }
- virtual void SendChangeSetEnd()
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT changeSetEnd();
- }
-
- virtual void SendAnimationSetBegin()
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT animationBegin();
- }
- virtual void SendAnimationSetEnd()
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT animationEnd();
- }
-
- void SendSlideCreated(Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideCreated(inSlide);
- }
- void SendSlideDeleted(Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideDeleted(inSlide);
- }
- void SendSlideRearranged(Qt3DSDMSlideHandle inMaster, int inOldIndex, int inNewIndex) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT slideRearranged(inMaster, inOldIndex, inNewIndex);
- }
- void SendBeginComponentSeconds(Qt3DSDMSlideHandle inMaster) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT beginComponentSeconds(inMaster);
- }
- void SendComponentSeconds(Qt3DSDMSlideHandle inMaster) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT componentSeconds(inMaster);
- }
- void SendPropertyLinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertyLinked(inMaster, inInstance, inProperty);
- }
- void SendPropertyUnlinked(Qt3DSDMSlideHandle inMaster, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT propertyUnlinked(inMaster, inInstance, inProperty);
- }
- void SendActiveSlide(Qt3DSDMSlideHandle inMaster, int inIndex, Qt3DSDMSlideHandle inSlide) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT activeSlide(inMaster, inIndex, inSlide);
- }
-
- void SendInstanceCreated(Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceCreated(inInstance);
- }
- void SendInstanceDeleted(Qt3DSDMInstanceHandle inInstance) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instanceDeleted(inInstance);
- }
-
- void SendAnimationCreated(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT animationCreated(inAnimation, inInstance, inProperty);
- }
- void SendAnimationDeleted(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT animationDeleted(inAnimation, inInstance, inProperty);
- }
- void SendKeyframeInserted(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT keyframeInserted(inAnimation, inKeyframe);
- }
- void SendKeyframeErased(Qt3DSDMAnimationHandle inAnimation,
- Qt3DSDMKeyframeHandle inKeyframe) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT keyframeErased(inAnimation, inKeyframe);
- }
- void SendKeyframeUpdated(Qt3DSDMKeyframeHandle inKeyframe) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT keyframeUpdated(inKeyframe);
- }
- void SendConnectFirstKeyframeDynamicSet(Qt3DSDMAnimationHandle inAnimation,
- bool inDynamic) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT connectFirstKeyframeDynamicSet(inAnimation, inDynamic);
- }
-
- void SendInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT instancePropertyValue(inInstance, inProperty);
- }
-
- void SendActionCreated(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT actionCreated(inAction, inSlide, inOwner);
- }
- void SendActionDeleted(Qt3DSDMActionHandle inAction, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT actionDeleted(inAction, inSlide, inOwner);
- }
- void SendTriggerObjectSet(Qt3DSDMActionHandle inAction) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT triggerObjectSet(inAction);
- }
- void SendTargetObjectSet(Qt3DSDMActionHandle inAction) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT targetObjectSet(inAction);
- }
- void SendEventSet(Qt3DSDMActionHandle inAction) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT eventHandleSet(inAction);
- }
- void SendHandlerSet(Qt3DSDMActionHandle inAction) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT handlerHandleSet(inAction);
- }
- void SendHandlerArgumentValueSet(Qt3DSDMHandlerArgHandle inHandlerArgument) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT handlerArgumentValueSet(inHandlerArgument);
- }
-
- void SendCustomPropertyCreated(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customPropertyCreated(inProp, inOwner);
- }
- void SendCustomPropertyDeleted(Qt3DSDMPropertyHandle inProp,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customPropertyDeleted(inProp, inOwner);
- }
- void SendCustomPropertyModified(Qt3DSDMPropertyHandle inProp) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customPropertyModified(inProp);
- }
- void SendCustomEventCreated(Qt3DSDMEventHandle inEvent, Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customEventCreated(inEvent, inOwner);
- }
- void SendCustomEventDeleted(Qt3DSDMEventHandle inEvent, Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customEventDeleted(inEvent, inOwner);
- }
- void SendCustomEventModified(Qt3DSDMEventHandle inEvent) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customEventModified(inEvent);
- }
- void SendCustomHandlerCreated(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerCreated(inHandler, inOwner);
- }
- void SendCustomHandlerDeleted(Qt3DSDMHandlerHandle inHandler,
- Qt3DSDMInstanceHandle inOwner) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerDeleted(inHandler, inOwner);
- }
- void SendCustomHandlerModified(Qt3DSDMHandlerHandle inHandler) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerModified(inHandler);
- }
- void SendCustomHandlerParamCreated(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerParamCreated(inParameter, inHandler);
- }
- void SendCustomHandlerParamDeleted(Qt3DSDMHandlerParamHandle inParameter,
- Qt3DSDMHandlerHandle inHandler) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerParamDeleted(inParameter, inHandler);
- }
- void SendCustomHandlerParamModified(Qt3DSDMHandlerParamHandle inParameter) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customHandlerParamModified(inParameter);
- }
- void SendCustomReferencesModified(Qt3DSDMInstanceHandle inOwner,
- const TCharStr &inString) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT customReferencesModified(inOwner, inString);
- }
-
- void SendControlledToggled(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) override
- {
- CHECK_SIGNALS_ENABLED();
- Q_EMIT controlledToggled(inInstance, inProperty);
- }
-};
-
-TSignalItemPtr
-CreateStudioFullSystemSignaller(ISlideSystemSignalProvider *inSlideSystemSignalProvider)
-{
- return TSignalItemPtr(static_cast<IStudioFullSystemSignalProvider *>(
- new CStudioFullSystemSignaller(inSlideSystemSignalProvider)));
-}
-}
-
-#include "SignalsImpl.moc"
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.h b/src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.h
deleted file mode 100644
index 988270e8..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/SignalsImpl.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef SIGNALSIMPLH
-#define SIGNALSIMPLH
-#include "Qt3DSDMSignals.h"
-
-namespace qt3dsdm {
-class ISlideSystemSignalProvider;
-
-TSignalItemPtr CreatePropertyCoreSignaller();
-TSignalItemPtr CreateDataCoreSignaller();
-TSignalItemPtr CreateSlideCoreSignaller();
-TSignalItemPtr CreateSlideGraphCoreSignaller();
-TSignalItemPtr CreateAnimationCoreSignaller();
-TSignalItemPtr CreateActionCoreSignaller();
-TSignalItemPtr CreateActionSystemSignaller();
-TSignalItemPtr CreateSlideSystemSignaller();
-TSignalItemPtr CreateCustomPropCoreSignaller();
-TSignalItemPtr
-CreateStudioFullSystemSignaller(ISlideSystemSignalProvider *inSlideSystemSignalProvider);
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.cpp
deleted file mode 100644
index d6d88932..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.cpp
+++ /dev/null
@@ -1,867 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#ifdef WIN32
-#pragma warning(disable : 4503)
-#endif
-#include "SlideSystem.h"
-#include "SimpleSlideCore.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-SSlideSystem::SSlideSystem(TDataCorePtr inDataCore, TSlideCorePtr inSlideCore,
- TSlideGraphCorePtr inSlideGraphCore, TAnimationCorePtr inAnimationCore,
- Qt3DSDMInstanceHandle inSlideInstance,
- Qt3DSDMPropertyHandle inComponentGuidProperty)
- : m_DataCore(inDataCore)
- , m_SlideCore(inSlideCore)
- , m_SlideGraphCore(inSlideGraphCore)
- , m_AnimationCore(inAnimationCore)
- , m_SlideInstance(inSlideInstance)
- , m_ComponentGuid(inComponentGuidProperty)
-{
- m_Signaller = CreateSlideSystemSignaller();
-}
-void SSlideSystem::SetPropertySystem(TPropertySystemPtr inPropertySystem)
-{
- m_PropertySystem = inPropertySystem;
-}
-
-Qt3DSDMSlideHandle SSlideSystem::CreateMasterSlide()
-{
- Qt3DSDMInstanceHandle theSlideInstance = m_DataCore->CreateInstance();
- m_DataCore->DeriveInstance(theSlideInstance, m_SlideInstance);
- Qt3DSDMSlideHandle retval = m_SlideCore->CreateSlide(theSlideInstance);
- m_SlideGraphCore->CreateSlideGraph(retval);
- GetSignalSender()->SendMasterCreated(retval);
- return retval;
-}
-
-inline bool PropertyHandlePairEquals(const TPropertyHandlePropertyInfoPair &inPair,
- Qt3DSDMPropertyHandle inProperty)
-{
- return (inProperty == inPair.first);
-}
-
-void AddReferencedInstance(const TSlideEntry &inEntry,
- const TPropertyHandlePropertyInfoPairList &inInfoPairList,
- Qt3DSDMSlideHandle inSourceSlide, Qt3DSDMSlideHandle inDestSlide,
- TInstanceHandleList &outInstances, TSlideEntryList &outReferencedEntries)
-{
- TPropertyHandlePropertyInfoPairList::const_iterator theFind =
- find_if<TPropertyHandlePropertyInfoPairList::const_iterator>(
- inInfoPairList, std::bind(PropertyHandlePairEquals,
- std::placeholders::_1, get<1>(inEntry)));
- if (theFind != inInfoPairList.end()) {
- TPropertyInstanceInfoPtr theInfo(theFind->second);
- Qt3DSDMInstanceHandle theReferenced(theInfo->GetInstanceForProperty(get<2>(inEntry)));
- if (theReferenced.Valid()
- && !exists(outInstances, std::bind(equal_to<int>(), theReferenced,
- std::placeholders::_1))) {
- insert_unique(outInstances, theReferenced);
- SValue theNewValue(
- theInfo->CreateInstanceForProperty(inSourceSlide, inDestSlide, theReferenced));
- outReferencedEntries.push_back(
- make_tuple(get<0>(inEntry), get<1>(inEntry), theNewValue));
- }
- }
-}
-
-void CopySpecificAnimation(Qt3DSDMSlideHandle inMaster, Qt3DSDMSlideHandle inTarget,
- TInstancePropertyPair inPropertyPair, TAnimationCorePtr inAnimationCore,
- size_t inIndex)
-{
- Qt3DSDMAnimationHandle theAnimation = inAnimationCore->GetAnimation(
- inMaster, inPropertyPair.first, inPropertyPair.second, inIndex);
- if (theAnimation.Valid())
- CopyAnimation(inAnimationCore, theAnimation, inTarget, inPropertyPair.first,
- inPropertyPair.second, inIndex);
-}
-
-void CopyAnimationIfExist(Qt3DSDMSlideHandle inMaster, Qt3DSDMSlideHandle inTarget,
- TInstancePropertyPair inPropertyPair, TPropertySystemPtr inPropertySystem,
- TAnimationCorePtr inAnimationCore)
-{
- DataModelDataType::Value thePropertyType = inPropertySystem->GetDataType(inPropertyPair.second);
- std::tuple<bool, size_t> theArity = GetDatatypeAnimatableAndArity(thePropertyType);
- if (std::get<0>(theArity))
- do_times(std::get<1>(theArity), std::bind(CopySpecificAnimation, inMaster, inTarget,
- inPropertyPair, inAnimationCore,
- std::placeholders::_1));
-}
-
-void SetEntryValueIfNotReferenced(const TSlideEntry &inEntry,
- const TInstanceHandleList &inReferencedInstances,
- const TSlideEntryList &inReferencedEntries,
- Qt3DSDMSlideHandle inSource, Qt3DSDMSlideHandle inDestSlide,
- TPropertySystemPtr inPropertySystem, TSlideCorePtr inDestCore,
- TAnimationCorePtr inAnimationCore)
-{
- // Don't copy referenced instance properties.
- if (exists(inReferencedInstances, std::bind(equal_to<int>(), get<0>(inEntry),
- std::placeholders::_1)))
- return;
- TSlideEntryList::const_iterator theFind = find_if<TSlideEntryList::const_iterator>(
- inReferencedEntries,
- std::bind(CSimpleSlideCore::PropertyFound, get<0>(inEntry), get<1>(inEntry),
- std::placeholders::_1));
- if (theFind != inReferencedEntries.end())
- inDestCore->ForceSetInstancePropertyValue(inDestSlide, get<0>(inEntry), get<1>(inEntry),
- get<2>(*theFind));
- else
- inDestCore->ForceSetInstancePropertyValue(inDestSlide, get<0>(inEntry), get<1>(inEntry),
- get<2>(inEntry));
- CopyAnimationIfExist(inSource, inDestSlide, make_pair(get<0>(inEntry), get<1>(inEntry)),
- inPropertySystem, inAnimationCore);
-}
-
-Qt3DSDMSlideHandle SSlideSystem::CreateSlide(Qt3DSDMSlideHandle inMaster, int inIndex)
-{
- return DuplicateSlide(inMaster, inIndex);
-}
-
-Qt3DSDMSlideHandle SSlideSystem::DuplicateSlide(Qt3DSDMSlideHandle inSourceSlide, int inIndex)
-{
- Qt3DSDMSlideHandle theMaster = GetMasterSlide(inSourceSlide);
- Qt3DSDMInstanceHandle theSlideInstance = m_DataCore->CreateInstance();
- m_DataCore->DeriveInstance(theSlideInstance, m_SlideInstance);
- Qt3DSDMSlideHandle retval = m_SlideCore->CreateSlide(theSlideInstance);
-
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(theMaster, theChildren);
- m_SlideCore->DeriveSlide(retval, theMaster, inIndex - 1);
- int finalIndex = m_SlideCore->GetChildIndex(theMaster, retval) + 1;
- if (!theChildren.empty()) {
- // If the master was passed in, we get the intersecting properties
- // of the master and first child.
- // if another slide was passed in, we again do the intersection but we
- // take the values from the source slide instead of the master.
- TSlideEntryList theIntersectingEntries;
- if (inSourceSlide == theMaster)
- m_SlideCore->GetIntersectingProperties(theMaster, theChildren.at(0),
- theIntersectingEntries);
- else
- m_SlideCore->GetIntersectingProperties(inSourceSlide, theMaster,
- theIntersectingEntries);
-
- // duplicates the instance properties, from source slide (could be master (a new slide
- // command) or another other slides (duplicate slide) to the newly created slide
- m_DataCore->CopyInstanceProperties(this->GetSlideInstance(inSourceSlide), theSlideInstance);
-
- TInstanceHandleList theReferencedInstances;
- TSlideEntryList theReferencedEntries;
- do_all(theIntersectingEntries,
- std::bind(AddReferencedInstance, std::placeholders::_1,
- std::cref(m_PropertyInfoPairList),
- inSourceSlide, retval, std::ref(theReferencedInstances),
- std::ref(theReferencedEntries)));
- do_all(theIntersectingEntries,
- std::bind(SetEntryValueIfNotReferenced, std::placeholders::_1,
- std::cref(theReferencedInstances),
- std::cref(theReferencedEntries), inSourceSlide, retval,
- m_PropertySystem, m_SlideCore, m_AnimationCore));
- }
- GetSignalSender()->SendSlideCreated(theMaster, finalIndex, retval);
- return retval;
-}
-
-Qt3DSDMSlideHandle SSlideSystem::GetMasterSlide(Qt3DSDMSlideHandle inSlide) const
-{
- if (inSlide.Valid() && m_SlideCore->IsSlide(inSlide)) {
- Qt3DSDMSlideHandle theParent = m_SlideCore->GetParentSlide(inSlide);
- if (theParent.Valid())
- return theParent;
- return inSlide;
- }
- return 0;
-}
-
-bool SSlideSystem::IsMasterSlide(Qt3DSDMSlideHandle inSlide) const
-{
- Qt3DSDMSlideHandle theParent = m_SlideCore->GetParentSlide(inSlide);
- if (!theParent.Valid())
- return true;
- else
- return false;
-}
-
-inline bool GraphGuidMatches(Qt3DSDMSlideGraphHandle inGraph, TSlideGraphCorePtr inSlideGraph,
- TSlideCorePtr inSlideCore, TDataCorePtr inDataCore,
- Qt3DSDMPropertyHandle inProperty, SValue inValue)
-{
- Qt3DSDMSlideHandle theMaster = inSlideGraph->GetGraphRoot(inGraph);
- Qt3DSDMInstanceHandle theInstance = inSlideCore->GetSlideInstance(theMaster);
- SValue theValue;
- if (inDataCore->GetInstancePropertyValue(theInstance, inProperty, theValue)
- && Equals(inValue, theValue.toOldSkool()))
- return true;
- return false;
-}
-
-Qt3DSDMSlideHandle SSlideSystem::GetMasterSlideByComponentGuid(SLong4 inGuid) const
-{
- TSlideGraphHandleList theGraphs;
- m_SlideGraphCore->GetSlideGraphs(theGraphs);
- TSlideGraphHandleList::iterator theFind = find_if<TSlideGraphHandleList::iterator>(
- theGraphs, std::bind(GraphGuidMatches,
- std::placeholders::_1, m_SlideGraphCore, m_SlideCore, m_DataCore,
- m_ComponentGuid, inGuid));
- if (theFind != theGraphs.end())
- return m_SlideGraphCore->GetGraphRoot(*theFind);
- return 0;
-}
-
-void InsertIfReferencedProperty(const TSlideEntry &inEntry,
- const TPropertyHandlePropertyInfoPairList &inRefProperties,
- TInstanceHandleList &inInstances)
-{
- TPropertyHandlePropertyInfoPairList::const_iterator theFind =
- find_if<TPropertyHandlePropertyInfoPairList::const_iterator>(
- inRefProperties, std::bind(PropertyHandlePairEquals, std::placeholders::_1, get<1>(inEntry)));
- if (theFind != inRefProperties.end()) {
- Qt3DSDMInstanceHandle theInstance(theFind->second->GetInstanceForProperty(get<2>(inEntry)));
- if (theInstance.Valid())
- inInstances.push_back(theInstance);
- }
-}
-
-void SSlideSystem::InsertEntryAndPropertyInstance(const TSlideEntry &inEntry,
- TInstanceHandleList &inInstances,
- Qt3DSDMSlideHandle inSlide)
-{
- Qt3DSDMInstanceHandle theEntryInstance = get<0>(inEntry);
- if (find(inInstances.begin(), inInstances.end(), theEntryInstance) == inInstances.end()) {
- TGraphSlidePair thePair = m_SlideGraphCore->GetAssociatedGraph(theEntryInstance);
- if (thePair.second == inSlide) // if this instance belongs to this slide
- {
- // get all references belong to this instance (ex: image instances that belong to this
- // material instance)
- qt3dsdm::SValue theValue;
- for (TPropertyHandlePropertyInfoPairList::iterator theIter =
- m_PropertyInfoPairList.begin();
- theIter != m_PropertyInfoPairList.end(); ++theIter) {
- if (m_DataCore->HasAggregateInstanceProperty(
- theEntryInstance,
- theIter->first) // check if the property exists before querying the value
- && m_DataCore->GetInstancePropertyValue(
- theEntryInstance, theIter->first,
- theValue)) // this function may throw error if the property doesn't exist
- {
- Qt3DSDMInstanceHandle theInstance(
- theIter->second->GetInstanceForProperty(theValue.toOldSkool()));
- if (theInstance.Valid())
- inInstances.push_back(theInstance);
- }
- }
- // get this instance as well
- inInstances.push_back(theEntryInstance);
- }
- }
-}
-
-// Delete the referenced instances of this slide
-// This function is very similar to GetReferencedInstances
-// You change one function, you need to change the other function
-void SSlideSystem::DeleteReferencedInstances(Qt3DSDMSlideHandle inSlide)
-{
- // Recursively delete the children of this slide
- // Usually the slide has children if it is a Master slide (for example when deleting a
- // Component)
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(inSlide, theChildren);
- do_all(theChildren, std::bind(&SSlideSystem::DeleteReferencedInstances, this,
- std::placeholders::_1));
-
- // Delete the referenced instances from this slide
- TSlideEntryList theEntries;
- m_SlideCore->GetSlidePropertyEntries(inSlide, theEntries);
-
- // Run through all entries, if you find a reference property delete the associated instance.
- // This is for properties that are set on this slide (because you can set property on slide or
- // on instance)
- TInstanceHandleList theReferencedInstances;
- do_all(theEntries,
- std::bind(InsertIfReferencedProperty, std::placeholders::_1,
- std::cref(m_PropertyInfoPairList),
- std::ref(theReferencedInstances)));
- do_all(theReferencedInstances, std::bind(&IDataCore::DeleteInstance, m_DataCore,
- std::placeholders::_1));
-
- // Run through all entries, delete all instances that belong to this slide and its reference
- // property instances
- // This is for properties that are set on instance
- theReferencedInstances.clear();
- do_all(theEntries, std::bind(&SSlideSystem::InsertEntryAndPropertyInstance, this,
- std::placeholders::_1,
- std::ref(theReferencedInstances), inSlide));
- do_all(theReferencedInstances, std::bind(&IDataCore::DeleteInstance, m_DataCore,
- std::placeholders::_1));
-}
-
-// Get the referenced instances of this slide
-// This function is very similar to DeleteReferencedInstances
-// You change one function, you need to change the other function
-void SSlideSystem::GetReferencedInstances(Qt3DSDMSlideHandle inSlide,
- TInstanceHandleList &outReferencedInstances)
-{
- // Recursively get the children of this slide
- // Usually the slide has children if it is a Master slide (for example Component)
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(inSlide, theChildren);
- do_all(theChildren, std::bind(&SSlideSystem::GetReferencedInstances, this,
- std::placeholders::_1,
- std::ref(outReferencedInstances)));
-
- // Get the referenced instances from this slide
- TSlideEntryList theEntries;
- m_SlideCore->GetSlidePropertyEntries(inSlide, theEntries);
-
- // Run through all entries, if you find a reference property get the associated instance.
- // This is for properties that are set on this slide (because you can set property on slide or
- // on instance)
- do_all(theEntries,
- std::bind(InsertIfReferencedProperty, std::placeholders::_1,
- std::cref(m_PropertyInfoPairList),
- std::ref(outReferencedInstances)));
-
- // Run through all entries, get all instances that belong to this slide and its reference
- // property instances
- // This is for properties that are set on instance
- do_all(theEntries, std::bind(&SSlideSystem::InsertEntryAndPropertyInstance, this,
- std::placeholders::_1,
- std::ref(outReferencedInstances), inSlide));
-}
-
-void SSlideSystem::DeleteSlideByIndex(Qt3DSDMSlideHandle inMaster, size_t inIndex)
-{
- Qt3DSDMSlideHandle theChild = GetSlideByIndex(inMaster, inIndex);
- TInstanceHandleList theInstances;
- if (theChild.Valid()) {
- DeleteReferencedInstances(theChild);
- m_SlideCore->DeleteSlide(theChild, theInstances);
- do_all(theInstances, std::bind(&IDataCore::DeleteInstance, m_DataCore,
- std::placeholders::_1));
- }
- if (inIndex == 0)
- GetSignalSender()->SendMasterDeleted(inMaster);
- else
- GetSignalSender()->SendSlideDeleted(inMaster, (int)inIndex, theChild);
-}
-
-void SSlideSystem::GetSlideReferencedInstances(Qt3DSDMSlideHandle inMaster, size_t inIndex,
- TInstanceHandleList &outReferencedInstances)
-{
- outReferencedInstances.clear();
- Qt3DSDMSlideHandle theChild = GetSlideByIndex(inMaster, inIndex);
- if (theChild.Valid()) {
- GetReferencedInstances(theChild, outReferencedInstances);
- }
-}
-
-Qt3DSDMSlideHandle SSlideSystem::GetSlideByIndex(Qt3DSDMSlideHandle inMaster, size_t inIndex) const
-{
- if (inIndex == 0)
- return inMaster;
- --inIndex;
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(inMaster, theChildren);
- if (inIndex < theChildren.size())
- return theChildren[inIndex];
- return Qt3DSDMSlideHandle();
-}
-
-void SSlideSystem::SetActiveSlide(Qt3DSDMSlideHandle inMaster, size_t inIndex)
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetSlideGraph(inMaster);
- Qt3DSDMSlideHandle theActiveSlide = inMaster;
- if (inIndex > 0)
- theActiveSlide = GetSlideByIndex(inMaster, inIndex);
- Qt3DSDMSlideHandle theOldSlide = m_SlideGraphCore->GetGraphActiveSlide(theGraph);
- m_SlideGraphCore->SetGraphActiveSlide(theGraph, theActiveSlide);
- GetSignalSender()->SendActiveSlide(inMaster, (int)inIndex, theOldSlide, theActiveSlide);
-}
-
-size_t SSlideSystem::GetSlideCount(Qt3DSDMSlideHandle inMaster) const
-{
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(inMaster, theChildren);
- return 1 + theChildren.size();
-}
-
-void SSlideSystem::RearrangeSlide(Qt3DSDMSlideHandle inMaster, size_t inOldIndex, size_t inNewIndex)
-{
- if (inOldIndex == 0)
- throw RearrangeSlideArgumentsMustNotBeZero(L"");
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(inMaster, theChildren);
- Qt3DSDMSlideHandle theChild = theChildren.at(inOldIndex - 1);
- m_SlideCore->DeriveSlide(theChild, inMaster, (int)inNewIndex - 1);
- GetSignalSender()->SendSlideRearranged(inMaster, (int)inOldIndex, (int)inNewIndex);
-}
-
-void SSlideSystem::SetComponentSeconds(Qt3DSDMSlideHandle inSlide, float inSeconds)
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetSlideGraph(GetMasterSlide(inSlide));
- m_SlideCore->SetSlideTime(m_SlideGraphCore->GetGraphActiveSlide(theGraph), inSeconds);
-}
-
-float SSlideSystem::GetComponentSeconds(Qt3DSDMSlideHandle inSlide) const
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetSlideGraph(GetMasterSlide(inSlide));
- return m_SlideCore->GetSlideTime(m_SlideGraphCore->GetGraphActiveSlide(theGraph));
-}
-
-long SSlideSystem::GetComponentSecondsLong(Qt3DSDMSlideHandle inSlide) const
-{
- float seconds(GetComponentSeconds(inSlide));
- return static_cast<long>((seconds * 1000) + .5f);
-}
-
-long SSlideSystem::GetComponentSecondsLong(Qt3DSDMInstanceHandle inInstance) const
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetAssociatedGraph(inInstance).first;
- float seconds = m_SlideCore->GetSlideTime(m_SlideGraphCore->GetGraphActiveSlide(theGraph));
- return static_cast<long>((seconds * 1000) + .5f);
-}
-
-SInstanceSlideInformation
-SSlideSystem::GetInstanceSlideInformation(Qt3DSDMInstanceHandle inInstance) const
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- Qt3DSDMSlideHandle theAssociatedSlide(theGraphSlidePair.second);
- if (theAssociatedSlide.Valid() == false)
- return SInstanceSlideInformation();
- Qt3DSDMSlideHandle theMasterSlide(GetMasterSlide(theGraphSlidePair.second));
- Qt3DSDMSlideHandle theActiveSlide(
- m_SlideGraphCore->GetGraphActiveSlide(theGraphSlidePair.first));
- float seconds = m_SlideCore->GetSlideTime(theActiveSlide);
- long theMilliseconds = static_cast<long>((seconds * 1000) + .5f);
- return SInstanceSlideInformation(theAssociatedSlide, theMasterSlide, theActiveSlide,
- theMilliseconds);
-}
-
-/**
- * Use the instance for storing information such as name, or the GUID of the object
- * this slide links to.
- */
-Qt3DSDMInstanceHandle SSlideSystem::GetSlideInstance(Qt3DSDMSlideHandle inSlide) const
-{
- return m_SlideCore->GetSlideInstance(inSlide);
-}
-/**
- * Reverse lookup into the slide system so you can match slides to instances.
- */
-Qt3DSDMSlideHandle SSlideSystem::GetSlideByInstance(Qt3DSDMInstanceHandle inSlide) const
-{
- return m_SlideCore->GetSlideByInstance(inSlide);
-}
-
-/**
- * Slide may be either a master slide
- */
-void SSlideSystem::AssociateInstanceWithSlide(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance)
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetSlideGraph(GetMasterSlide(inSlide));
- m_SlideGraphCore->AssociateInstance(theGraph, inSlide, inInstance);
- GetSignalSender()->SendInstanceAssociated(inSlide, inInstance);
-}
-
-Qt3DSDMSlideHandle SSlideSystem::GetAssociatedSlide(Qt3DSDMInstanceHandle inInstance) const
-{
- return m_SlideGraphCore->GetAssociatedGraph(inInstance).second;
-}
-
-/**
- * This gets the instances that resides int the SlideGraph, i.e. all the instances in all the
- *slides for this component/scene
- * TODO rename this to make it more clear
- */
-void SSlideSystem::GetAssociatedInstances(Qt3DSDMSlideHandle inMaster,
- TSlideInstancePairList &outAssociations) const
-{
- m_SlideGraphCore->GetAssociatedInstances(
- m_SlideGraphCore->GetSlideGraph(GetMasterSlide(inMaster)), outAssociations);
-}
-
-/**
- * Gets all the instances in this slide
- */
-void SSlideSystem::GetAssociatedInstances(Qt3DSDMSlideHandle inSlide,
- TInstanceHandleList &outAssociations) const
-{
- Qt3DSDMSlideHandle theMasterSlide = GetMasterSlide(inSlide);
- TSlideInstancePairList theGraphInstances;
- m_SlideGraphCore->GetAssociatedInstances(m_SlideGraphCore->GetSlideGraph(theMasterSlide),
- theGraphInstances);
- for (TSlideInstancePairList::const_iterator theIter = theGraphInstances.begin();
- theIter != theGraphInstances.end(); ++theIter) {
- if (theIter->first == inSlide || theIter->first == theMasterSlide) {
- // in the current slide or master slide
- outAssociations.push_back(theIter->second);
- }
- }
-}
-
-void DeleteInstanceIfExistsAsProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, TSlideCorePtr inSlideCore,
- TPropertyInstanceInfoPtr inPropertyInfoPtr,
- TDataCorePtr inDataCore)
-{
- SValue theValue;
- if (inSlideCore->GetSpecificInstancePropertyValue(inSlide, inInstance, inProperty, theValue)) {
- Qt3DSDMInstanceHandle theInstance(inPropertyInfoPtr->GetInstanceForProperty(theValue));
- if (theInstance.Valid())
- inDataCore->DeleteInstance(theInstance);
- }
-}
-
-void SSlideSystem::LinkProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty)
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetAssociatedGraph(inInstance).first;
- Qt3DSDMSlideHandle theSlide = m_SlideGraphCore->GetGraphRoot(theGraph);
- TPropertyHandlePropertyInfoPairList::const_iterator theFind =
- find_if<TPropertyHandlePropertyInfoPairList::const_iterator>(
- m_PropertyInfoPairList, std::bind(PropertyHandlePairEquals,
- std::placeholders::_1, inProperty));
- if (theFind != m_PropertyInfoPairList.end()) {
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(theSlide, theChildren);
- do_all(theChildren, std::bind(DeleteInstanceIfExistsAsProperty, std::placeholders::_1, inInstance,
- inProperty, m_SlideCore, theFind->second, m_DataCore));
- }
- m_SlideCore->ClearChildrenPropertyValues(theSlide, inInstance, inProperty);
- GetSignalSender()->SendPropertyLinked(theSlide, inInstance, inProperty);
-}
-
-void ClearPropertyValueIfLinked(Qt3DSDMSlideHandle inMaster, const TSlideHandleList &inChildren,
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- TSlideCorePtr inSlideCore)
-{
- if (inChildren.empty())
- return;
-
- if (inSlideCore->ContainsProperty(inChildren.at(0), inInstance,
- inProperty)) // if property is linked,
- inSlideCore->ClearChildrenPropertyValues(inMaster, inInstance,
- inProperty); // get it off non-master slides
-}
-
-void SetReferencedEntryValue(Qt3DSDMSlideHandle inMaster, Qt3DSDMSlideHandle inDestSlide,
- TPropertyInstanceInfoPtr inInfo, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- Qt3DSDMInstanceHandle inReferencedInstance, TSlideCorePtr inSlideCore)
-{
- SValue theNewValue(
- inInfo->CreateInstanceForProperty(inMaster, inDestSlide, inReferencedInstance));
- inSlideCore->ForceSetInstancePropertyValue(inDestSlide, inInstance, inProperty, theNewValue);
-}
-
-void SSlideSystem::UnlinkProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty)
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetAssociatedGraph(inInstance).first;
- Qt3DSDMSlideHandle theSlide = m_SlideGraphCore->GetGraphRoot(theGraph);
- SValue theValue;
- SValue theTempValue;
- if (!m_SlideCore->GetInstancePropertyValue(theSlide, inInstance, inProperty, theValue)) {
- if (!m_PropertySystem->GetInstancePropertyValue(inInstance, inProperty, theTempValue))
- throw PropertyLinkError(L"");
- theValue = theTempValue.toOldSkool();
- }
-
- m_SlideCore->ForceSetInstancePropertyValue(theSlide, inInstance, inProperty, theValue);
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(theSlide, theChildren);
-
- Qt3DSDMInstanceHandle theReferenced;
- TPropertyHandlePropertyInfoPairList::const_iterator theFind =
- find_if<TPropertyHandlePropertyInfoPairList::const_iterator>(
- m_PropertyInfoPairList, std::bind(PropertyHandlePairEquals,
- std::placeholders::_1, inProperty));
- TPropertyInstanceInfoPtr theInfo;
- if (theFind != m_PropertyInfoPairList.end()) {
- theInfo = theFind->second;
- theReferenced = theInfo->GetInstanceForProperty(theValue);
- }
- if (theReferenced.Valid()) {
- TPropertyHandleList theProperties;
- m_PropertySystem->GetAggregateInstanceProperties(
- theReferenced,
- theProperties); // TODO: We should make the method return the custom properties.
- // Remove the property instance's unlinked properties from non-master slides.
- do_all(theProperties,
- std::bind(ClearPropertyValueIfLinked, theSlide, std::cref(theChildren),
- theReferenced, std::placeholders::_1, m_SlideCore));
- // Remove all property values from the children from that instance.
- do_all(theChildren, std::bind(SetReferencedEntryValue, theSlide,
- std::placeholders::_1, theInfo, inInstance,
- inProperty, theReferenced, m_SlideCore));
- } else {
- do_all(theChildren, std::bind(&ISlideCore::ForceSetInstancePropertyValue, m_SlideCore,
- std::placeholders::_1,
- inInstance, inProperty, theValue));
- do_all(theChildren,
- std::bind(CopyAnimationIfExist, theSlide, std::placeholders::_1, make_pair(inInstance, inProperty),
- m_PropertySystem, m_AnimationCore));
- }
- GetSignalSender()->SendPropertyUnlinked(theSlide, inInstance, inProperty);
-}
-
-bool SSlideSystem::IsPropertyLinked(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- Qt3DSDMSlideGraphHandle theGraph = theGraphSlidePair.first;
- if (!theGraph.Valid())
- return false;
-
- Qt3DSDMSlideHandle theSlide = m_SlideGraphCore->GetGraphRoot(theGraph);
- if (theGraphSlidePair.second != theSlide)
- return false;
-
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(theSlide, theChildren);
- bool containsProperty = false;
- for (TSlideHandleList::iterator theIter = theChildren.begin();
- theIter != theChildren.end() && !containsProperty; ++theIter) {
- containsProperty =
- containsProperty || m_SlideCore->ContainsProperty(*theIter, inInstance, inProperty);
- }
-
- return !containsProperty;
-}
-
-bool SSlideSystem::CanPropertyBeLinked(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- if (theGraphSlidePair.first.Valid()
- && theGraphSlidePair.second == m_SlideGraphCore->GetGraphRoot(theGraphSlidePair.first))
- return true;
- return false;
-}
-
-bool SSlideSystem::GetSlidePropertyValue(size_t inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue)
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- Qt3DSDMSlideGraphHandle theGraph = theGraphSlidePair.first;
- if (!theGraph.Valid())
- return false;
- Qt3DSDMSlideHandle theSlide = GetSlideByIndex(m_SlideGraphCore->GetGraphRoot(theGraph), inSlide);
- if (!theSlide.Valid())
- return false;
- return m_SlideCore->GetSpecificInstancePropertyValue(theSlide, inInstance, inProperty,
- outValue);
-}
-
-void AddEntriesToHash(const TSlideEntryList &theSlideEntries, TSlideEntryHash &theEntryHash,
- TInstancePropertyPairList &outProperties)
-{
- for (size_t idx = 0, end = theSlideEntries.size(); idx < end; ++idx) {
- const TSlideEntry &theEntry(theSlideEntries[idx]);
- pair<TSlideEntryHash::iterator, bool> insertRecord(theEntryHash.insert(
- make_pair(TSlideInstancePropertyPair(get<0>(theEntry), get<1>(theEntry)),
- SInternValue::ISwearThisHasAlreadyBeenInternalized(get<2>(theEntry)))));
- if (insertRecord.second)
- outProperties.push_back(insertRecord.first->first);
- }
-}
-
-void SSlideSystem::GetUnionOfProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- TInstancePropertyPairList &outProperties) const
-{
- TSlideEntryHash theEntryHash;
- TSlideEntryList theSlideEntries;
- if (m_SlideCore->IsSlide(inSlide1)) {
- m_SlideCore->GetSlidePropertyEntries(inSlide1, theSlideEntries);
- AddEntriesToHash(theSlideEntries, theEntryHash, outProperties);
- }
- if (m_SlideCore->IsSlide(inSlide2)) {
- m_SlideCore->GetSlidePropertyEntries(inSlide2, theSlideEntries);
- AddEntriesToHash(theSlideEntries, theEntryHash, outProperties);
- }
-}
-
-void SSlideSystem::SetActiveSlide(Qt3DSDMSlideHandle inSlide)
-{
- Qt3DSDMSlideHandle theMaster = GetMasterSlide(inSlide);
- int theIndex = GetSlideIndex(inSlide);
- SetActiveSlide(theMaster, theIndex);
-}
-
-Qt3DSDMSlideHandle SSlideSystem::GetAssociatedSlide(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- Qt3DSDMSlideGraphHandle theGraph = theGraphSlidePair.first;
- if (!theGraph.Valid())
- return 0;
- Qt3DSDMSlideHandle theSlide = m_SlideGraphCore->GetGraphActiveSlide(theGraph);
- if (theSlide.Valid()) {
- if (m_SlideCore->ContainsProperty(theSlide, inInstance, inProperty))
- return theSlide;
- theSlide = m_SlideCore->GetParentSlide(theSlide);
- if (theSlide.Valid() && m_SlideCore->ContainsProperty(theSlide, inInstance, inProperty))
- return theSlide;
- return theGraphSlidePair.second;
- }
- return 0;
-}
-
-bool SSlideSystem::SlideValid(Qt3DSDMSlideHandle inSlide) const
-{
- return m_SlideCore->HandleValid(inSlide);
-}
-
-int SSlideSystem::GetSlideIndex(Qt3DSDMSlideHandle inSlide) const
-{
- Qt3DSDMSlideHandle theMaster = GetMasterSlide(inSlide);
- if (inSlide.Valid() && inSlide != theMaster)
- return m_SlideCore->GetChildIndex(theMaster, inSlide) + 1;
- return 0;
-}
-
-int SSlideSystem::GetActiveSlideIndex(Qt3DSDMSlideHandle inMaster) const
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetSlideGraph(inMaster);
- Qt3DSDMSlideHandle theActiveSlide = m_SlideGraphCore->GetGraphActiveSlide(theGraph);
- if (theActiveSlide == inMaster)
- return 0;
- return GetSlideIndex(theActiveSlide);
-}
-
-Qt3DSDMSlideHandle SSlideSystem::GetActiveSlide(Qt3DSDMSlideHandle inMaster) const
-{
- Qt3DSDMSlideGraphHandle theGraph = m_SlideGraphCore->GetSlideGraph(inMaster);
- return m_SlideGraphCore->GetGraphActiveSlide(theGraph);
-}
-
-Qt3DSDMInstanceHandle SSlideSystem::GetSlideSelectedInstance(Qt3DSDMSlideHandle inSlide) const
-{
- TIntIntMap::const_iterator theIter = m_SlideSelectedInstances.find(inSlide);
- if (theIter != m_SlideSelectedInstances.end() && m_DataCore->IsInstance(theIter->second))
- return theIter->second;
- return 0;
-}
-
-void SSlideSystem::SetSlideSelectedInstance(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance)
-{
- m_SlideSelectedInstances[inSlide] = inInstance;
-}
-
-void SSlideSystem::RegisterPropertyInstance(Qt3DSDMPropertyHandle inPropertyHandle,
- TPropertyInstanceInfoPtr inPropertyInfo)
-{
- m_PropertyInfoPairList.push_back(make_pair(inPropertyHandle, inPropertyInfo));
-}
-
-ISlideSystemSignalProvider *SSlideSystem::GetSignalProvider()
-{
- return dynamic_cast<ISlideSystemSignalProvider *>(m_Signaller.get());
-}
-
-ISlideSystemSignalSender *SSlideSystem::GetSignalSender()
-{
- return dynamic_cast<ISlideSystemSignalSender *>(m_Signaller.get());
-}
-
-qt3dsdm::Qt3DSDMSlideHandle SSlideSystem::GetApplicableSlide(Qt3DSDMInstanceHandle inHandle)
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inHandle);
- if (!theGraphSlidePair.first.Valid())
- return Qt3DSDMSlideHandle();
-
- Qt3DSDMSlideHandle theMaster = m_SlideGraphCore->GetGraphRoot(theGraphSlidePair.first);
- if (theGraphSlidePair.second != theMaster)
- return theGraphSlidePair.second;
-
- return theMaster;
-}
-
-qt3dsdm::Qt3DSDMSlideHandle SSlideSystem::GetApplicableSlide(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty)
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inHandle);
- if (!theGraphSlidePair.first.Valid())
- return Qt3DSDMSlideHandle();
-
- Qt3DSDMSlideHandle theMaster = m_SlideGraphCore->GetGraphRoot(theGraphSlidePair.first);
- if (theGraphSlidePair.second != theMaster)
- return theGraphSlidePair.second;
-
- Qt3DSDMSlideHandle theActive = m_SlideGraphCore->GetGraphActiveSlide(theGraphSlidePair.first);
- if (m_SlideCore->ContainsProperty(theActive, inHandle, inProperty))
- return theActive;
-
- return theMaster;
-}
-
-bool SSlideSystem::GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const
-{
- return m_SlideCore->GetInstancePropertyValue(inSlide, inInstance, inProperty, outValue);
-}
-
-bool SSlideSystem::GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- if (theGraphSlidePair.first.Valid()) {
- // Check to see if the object is on the master slide;
- if (theGraphSlidePair.second == m_SlideGraphCore->GetGraphRoot(theGraphSlidePair.first)) {
- TSlideHandleList theChildren;
- m_SlideCore->GetChildSlides(theGraphSlidePair.second, theChildren);
- // See if the value exists on slide 1.
- if (!theChildren.empty()
- && m_SlideCore->GetSpecificInstancePropertyValue(theChildren.at(0), inInstance,
- inProperty, outValue))
- return true;
- }
-
- if (m_SlideCore->GetSpecificInstancePropertyValue(theGraphSlidePair.second, inInstance,
- inProperty, outValue))
- return true;
- }
- return false;
-}
-
-void SSlideSystem::ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- m_SlideCore->ForceSetInstancePropertyValue(inSlide, inInstance, inProperty, inValue);
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.h
deleted file mode 100644
index 1ea3f816..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/SlideSystem.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef SLIDESYSTEMH
-#define SLIDESYSTEMH
-#include "Qt3DSDMDataCore.h"
-#include "Qt3DSDMSlideCore.h"
-#include "Qt3DSDMSlideGraphCore.h"
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMSlides.h"
-#include "Qt3DSDMAnimation.h"
-#include "StudioPropertySystem.h"
-#include "SignalsImpl.h"
-
-/**
- * The systems aggregate the various cores and provide further information or
- * integrity checking taking the various cores into account.
- */
-
-namespace qt3dsdm {
-
-typedef std::pair<Qt3DSDMPropertyHandle, TPropertyInstanceInfoPtr> TPropertyHandlePropertyInfoPair;
-typedef std::vector<TPropertyHandlePropertyInfoPair> TPropertyHandlePropertyInfoPairList;
-/**
- * Provides more thorough checking and will return an appropriate
- * slide graph when calling GetSlideGraph
- */
-struct SSlideSystem : public ISlideSystem
-{
- Q_DISABLE_COPY(SSlideSystem)
-
- TDataCorePtr m_DataCore; // TODO: We might want to throw this away and use the PropertySystem,
- // unless we have a clean seperate of IPropertySystem and IDataCore
- TPropertySystemPtr m_PropertySystem;
- TSlideCorePtr m_SlideCore;
- TSlideGraphCorePtr m_SlideGraphCore;
- TAnimationCorePtr m_AnimationCore;
- Qt3DSDMInstanceHandle m_SlideInstance;
- Qt3DSDMPropertyHandle m_ComponentGuid;
- std::shared_ptr<ISignalItem> m_Signaller;
- TPropertyHandlePropertyInfoPairList m_PropertyInfoPairList;
- typedef std::unordered_map<int, int> TIntIntMap;
- TIntIntMap m_SlideSelectedInstances;
-
- SSlideSystem(TDataCorePtr inDataCore, TSlideCorePtr inSlideCore,
- TSlideGraphCorePtr inSlideGraphCore, TAnimationCorePtr inAnimationCore,
- Qt3DSDMInstanceHandle inSlideInstance,
- Qt3DSDMPropertyHandle inComponentGuidProperty);
-
- void SetPropertySystem(TPropertySystemPtr inPropertySystem);
-
- Qt3DSDMSlideHandle CreateMasterSlide() override;
- Qt3DSDMSlideHandle CreateSlide(Qt3DSDMSlideHandle inMaster, int inIndex = -1) override;
- Qt3DSDMSlideHandle DuplicateSlide(Qt3DSDMSlideHandle inSourceSlide, int inDestIndex = -1) override;
- Qt3DSDMSlideHandle GetMasterSlide(Qt3DSDMSlideHandle inSlide) const override;
- bool IsMasterSlide(Qt3DSDMSlideHandle inSlide) const override;
- Qt3DSDMSlideHandle GetMasterSlideByComponentGuid(SLong4 inGuid) const override;
- // Indexes are 1 based. Index 0 refers to the master slide; you can't delete this.
- void DeleteSlideByIndex(Qt3DSDMSlideHandle inMaster, size_t inIndex) override;
- void GetSlideReferencedInstances(Qt3DSDMSlideHandle inMaster, size_t inIndex,
- TInstanceHandleList &outReferencedInstances) override;
- Qt3DSDMSlideHandle GetSlideByIndex(Qt3DSDMSlideHandle inMaster, size_t inIndex) const override;
- void SetActiveSlide(Qt3DSDMSlideHandle inMaster, size_t inIndex) override;
- size_t GetSlideCount(Qt3DSDMSlideHandle inMaster) const override;
- void RearrangeSlide(Qt3DSDMSlideHandle inMaster, size_t inOldIndex, size_t inNewIndex) override;
-
- void SetComponentSeconds(Qt3DSDMSlideHandle inSlide, float inSeconds) override;
- float GetComponentSeconds(Qt3DSDMSlideHandle inSlide) const override;
- long GetComponentSecondsLong(Qt3DSDMSlideHandle inSlide) const override;
- // For any given instance, find the current seconds via backtracking to the graph, finding the
- // active
- // slide, and return.
- long GetComponentSecondsLong(Qt3DSDMInstanceHandle inInstance) const override;
- virtual SInstanceSlideInformation
- GetInstanceSlideInformation(Qt3DSDMInstanceHandle inInstance) const override;
- /**
- * Use the instance for storing information such as name, or the GUID of the object
- * this slide links to.
- */
- Qt3DSDMInstanceHandle GetSlideInstance(Qt3DSDMSlideHandle inInstance) const override;
- /**
- * Reverse lookup into the slide system so you can match slides to instances.
- */
- Qt3DSDMSlideHandle GetSlideByInstance(Qt3DSDMInstanceHandle inInstance) const override;
-
- /**
- * Slide may be either a master slide or a normal slide. This will associate this instance
- * with this set of slides. Property lookups (using the above IInstancePropertyCore interface)
- * will now run through the slide set before hitting the main data core database.
- */
- void AssociateInstanceWithSlide(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) override;
- Qt3DSDMSlideHandle GetAssociatedSlide(Qt3DSDMInstanceHandle inInstance) const override;
- void GetAssociatedInstances(
- Qt3DSDMSlideHandle inMaster,
- std::vector<std::pair<Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle>> &outAssociations) const override;
- void GetAssociatedInstances(Qt3DSDMSlideHandle inSlide,
- TInstanceHandleList &outAssociations) const override;
- void LinkProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) override;
- void UnlinkProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) override;
- bool IsPropertyLinked(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- bool CanPropertyBeLinked(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- bool GetSlidePropertyValue(size_t inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) override;
- void GetUnionOfProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide,
- TInstancePropertyPairList &outProperties) const override;
-
- void SetActiveSlide(Qt3DSDMSlideHandle inSlide) override;
- Qt3DSDMSlideHandle GetAssociatedSlide(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
-
- bool SlideValid(Qt3DSDMSlideHandle inSlide) const override;
- int GetSlideIndex(Qt3DSDMSlideHandle inSlide) const override;
- int GetActiveSlideIndex(Qt3DSDMSlideHandle inMaster) const override;
- Qt3DSDMSlideHandle GetActiveSlide(Qt3DSDMSlideHandle inMaster) const override;
- Qt3DSDMInstanceHandle GetSlideSelectedInstance(Qt3DSDMSlideHandle inSlide) const override;
- void SetSlideSelectedInstance(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance) override;
-
- Qt3DSDMSlideHandle GetApplicableSlide(Qt3DSDMInstanceHandle inHandle) override;
- Qt3DSDMSlideHandle GetApplicableSlide(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) override;
-
- bool GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- bool GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const override;
- void ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) override;
-
- void RegisterPropertyInstance(Qt3DSDMPropertyHandle inPropertyHandle,
- TPropertyInstanceInfoPtr inPropertyInfo) override;
-
- virtual ISlideSystemSignalProvider *GetSignalProvider();
-
-private:
- virtual ISlideSystemSignalSender *GetSignalSender();
- // helper method
- void InsertEntryAndPropertyInstance(const TSlideEntry &inEntry,
- TInstanceHandleList &inInstances,
- Qt3DSDMSlideHandle inSlide);
- void DeleteReferencedInstances(Qt3DSDMSlideHandle inSlide);
- void GetReferencedInstances(Qt3DSDMSlideHandle inSlide,
- TInstanceHandleList &outReferencedInstances);
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StandardExtensions.h b/src/Runtime/ogl-runtime/src/dm/systems/StandardExtensions.h
deleted file mode 100644
index a9946002..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StandardExtensions.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef STANDARDEXTENSIONSH
-#define STANDARDEXTENSIONSH
-#include <algorithm>
-
-namespace qt3dsdm {
-template <typename TContainer, typename TPred>
-inline void erase_if(TContainer &inContainer, TPred inPred)
-{
- inContainer.erase(std::remove_if(inContainer.begin(), inContainer.end(), inPred),
- inContainer.end());
-}
-
-template <typename TRetType, typename TContainerType, typename TPred>
-inline TRetType find_if(TContainerType &inContainer, TPred inPred)
-{
- return std::find_if(inContainer.begin(), inContainer.end(), inPred);
-}
-
-template <typename TContainer, typename TTransaction>
-inline void do_all(TContainer &inContainer, TTransaction inTransaction)
-{
- std::for_each(inContainer.begin(), inContainer.end(), inTransaction);
-}
-
-template <typename TNumType, typename TTransaction>
-inline void do_times(TNumType numberOfTimes, TTransaction inTransaction)
-{
- for (TNumType index = 0; index < numberOfTimes; ++index)
- inTransaction(index);
-}
-
-template <typename TCountFunc, typename TItemByIndexFunc, typename TTransaction>
-inline void for_each_item(TCountFunc inCountFunc, TItemByIndexFunc inItemByIndex,
- TTransaction inTransaction)
-{
- int theEnd = static_cast<int>(inCountFunc());
- for (int index = 0; index < theEnd; ++index)
- inTransaction(inItemByIndex(index));
-}
-
-template <typename TContainerType, typename TItemType>
-inline void insert_unique(TContainerType &inContainer, const TItemType &inItem)
-{
- if (find(inContainer.begin(), inContainer.end(), inItem) == inContainer.end())
- inContainer.insert(inContainer.end(), inItem);
-}
-
-template <typename TContainerType, typename TItemType, typename TPred>
-inline void insert_unique_if(TContainerType &inContainer, const TItemType &inItem, TPred inPred)
-{
- if (find_if(inContainer.begin(), inContainer.end(), inPred) == inContainer.end())
- inContainer.insert(inContainer.end(), inItem);
-}
-
-template <typename TItemType>
-inline TItemType identity(const TItemType &inValue)
-{
- return inValue;
-}
-
-template <typename TItemType, typename TOutContainerType>
-inline void transformv_all(const std::vector<TItemType> &inSource, TOutContainerType &outDest)
-{
- outDest.resize(inSource.size());
- std::transform(inSource.begin(), inSource.end(), outDest.begin(), identity<TItemType>);
-}
-
-template <typename TContainerType, typename Pred>
-inline bool exists(TContainerType &inContainer, Pred inPredicate)
-{
- return std::find_if(inContainer.begin(), inContainer.end(), inPredicate) != inContainer.end();
-}
-
-// Always return a default value (useful for default true for false)
-template <typename TRetType>
-inline TRetType always(TRetType inValue)
-{
- return inValue;
-}
-
-template <typename TRetType, typename TIgnoreType>
-inline TRetType always_ignore(TIgnoreType, TRetType inValue)
-{
- return inValue;
-}
-
-template <typename TArgument, typename TTransaction, typename TPredicate>
-inline void predicate_apply(TArgument inArgument, TTransaction inTransaction,
- TPredicate inPredicate)
-{
- if (inPredicate(inArgument))
- inTransaction(inArgument);
-}
-
-template <typename TItemType>
-inline void assign_to(const TItemType &inSource, TItemType &inDest)
-{
- inDest = inSource;
-}
-
-template <typename TPredType, typename TArgType>
-bool complement(TPredType inPredicate, TArgType inArgument)
-{
- return !(inPredicate(inArgument));
-}
-
-template <typename TItemType, typename TPredicate>
-void insert_or_update(const TItemType &inItem, std::vector<TItemType> &inItems,
- TPredicate inPredicate)
-{
- typename std::vector<TItemType>::iterator theIter =
- find_if<typename std::vector<TItemType>::iterator>(inItems, inPredicate);
- if (theIter == inItems.end())
- inItems.push_back(inItem);
- else
- *theIter = inItem;
-}
-
-template <typename TItemType>
-typename std::vector<TItemType>::iterator binary_sort_find(std::vector<TItemType> &inItems,
- const TItemType &inItem)
-{
- typedef typename std::vector<TItemType>::iterator TIterType;
- TIterType insertPos = std::lower_bound(inItems.begin(), inItems.end(), inItem);
- if (insertPos != inItems.end() && *insertPos == inItem)
- return insertPos;
- return inItems.end();
-}
-
-template <typename TItemType, typename TPredicate>
-std::pair<typename std::vector<TItemType>::iterator, bool>
-binary_sort_insert_unique(std::vector<TItemType> &inItems, const TItemType &inItem,
- TPredicate inPredicate)
-{
- typedef typename std::vector<TItemType>::iterator TIterType;
- TIterType insertPos = std::lower_bound(inItems.begin(), inItems.end(), inItem, inPredicate);
- // OK, insertPos can equal begin, it can equal end, or somewhere in between.
- // If it doesn't equal end, then we may be pointing at the object and we let
- // the caller figure out what to do. Else we insert
- if (insertPos != inItems.end() && *insertPos == inItem)
- return std::make_pair(insertPos, false);
- size_t diff = insertPos - inItems.begin();
- inItems.insert(insertPos, inItem);
- return std::make_pair(inItems.begin() + diff, true);
-}
-
-template <typename TItemType>
-std::pair<typename std::vector<TItemType>::iterator, bool>
-binary_sort_insert_unique(std::vector<TItemType> &inItems, const TItemType &inItem)
-{
- return binary_sort_insert_unique(inItems, inItem, std::less<TItemType>());
-}
-
-template <typename TItemType>
-bool binary_sort_erase(std::vector<TItemType> &inItems, const TItemType &inItem)
-{
- typedef typename std::vector<TItemType>::iterator TIterType;
- TIterType insertPos = binary_sort_find(inItems, inItem);
- if (insertPos != inItems.end()) {
- inItems.erase(insertPos);
- return true;
- }
- return false;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.cpp
deleted file mode 100644
index 2b788880..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.cpp
+++ /dev/null
@@ -1,610 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "StudioAnimationSystem.h"
-#include "StudioPropertySystem.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-bool AnimationFloatPairContainsAnimation(Qt3DSDMAnimationHandle inAnimation,
- const TAnimationFloatPair &inPair)
-{
- return inAnimation == inPair.first;
-}
-
-CStudioAnimationSystem::CStudioAnimationSystem(TPropertySystemPtr inPropertySystem,
- TSlideSystemPtr inSlideSystem,
- TSlideCorePtr inSlideCore,
- TSlideGraphCorePtr inSlideGraphCore,
- TAnimationCorePtr inAnimationCore)
- : m_PropertySystem(inPropertySystem)
- , m_SlideSystem(inSlideSystem)
- , m_SlideCore(inSlideCore)
- , m_SlideGraphCore(inSlideGraphCore)
- , m_AnimationCore(inAnimationCore)
- , m_AutoKeyframe(false)
- , m_SmoothInterpolation(false)
-{
- IAnimationCoreSignalProvider *theAnimationSignals =
- dynamic_cast<IAnimationCoreSignalProvider *>(m_AnimationCore.get());
- m_Connections.push_back(theAnimationSignals->ConnectAnimationDeleted(
- std::bind(&CStudioAnimationSystem::OnAnimationDeleted, this, std::placeholders::_1)));
-}
-
-void CStudioAnimationSystem::OnAnimationDeleted(Qt3DSDMAnimationHandle inAnimation)
-{
- ClearTemporaryAnimationValues(inAnimation);
-}
-
-void CStudioAnimationSystem::ClearTemporaryAnimationValues()
-{
- m_AnimationFloatPairs.clear();
-}
-
-void CStudioAnimationSystem::ClearTemporaryAnimationValues(Qt3DSDMAnimationHandle inAnimation)
-{
- erase_if(m_AnimationFloatPairs,
- std::bind(AnimationFloatPairContainsAnimation, inAnimation, std::placeholders::_1));
-}
-
-inline bool IsAnimationInfoEqual(const SAnimationInfo &inInfo, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty)
-{
- if (inInfo.m_Slide == inSlide && inInfo.m_Instance == inInstance
- && inInfo.m_Property == inProperty)
- return true;
- return false;
-}
-inline bool IsAnimationInfoEqual(const SAnimationInfo &inInfo, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- size_t inIndex)
-{
- if (IsAnimationInfoEqual(inInfo, inSlide, inInstance, inProperty) && inInfo.m_Index == inIndex)
- return true;
- return false;
-}
-
-inline bool ApplyIfAnimationMatches(TAnimationFloatPair inAnimationFloatPair,
- Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- TAnimationCorePtr inAnimationCore, SValue &outValue)
-{
- SAnimationInfo theInfo = inAnimationCore->GetAnimationInfo(inAnimationFloatPair.first);
- if (IsAnimationInfoEqual(theInfo, inSlide, inInstance, inProperty)) {
- SetAnimationValue(inAnimationFloatPair.second, theInfo.m_Index, outValue);
- return true;
- }
- return false;
-}
-
-void CStudioAnimationSystem::OverrideChannelIfAnimated(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- size_t inIndex, float inSeconds,
- bool &ioAnimated, SValue &outValue) const
-{
- Qt3DSDMAnimationHandle theAnimation =
- m_AnimationCore->GetAnimation(inSlide, inInstance, inProperty, inIndex);
- if (theAnimation.Valid() && m_AnimationCore->GetKeyframeCount(theAnimation)) {
- float theValue = m_AnimationCore->EvaluateAnimation(theAnimation, inSeconds);
- SetAnimationValue(theValue, inIndex, outValue);
- ioAnimated |= true;
- }
-}
-
-// Value must be *primed* first.
-bool CStudioAnimationSystem::GetAnimatedInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- bool retval = false;
-
- tuple<bool, size_t> arity = GetVariantAnimatableAndArity(outValue);
- if (get<0>(arity)) {
- for (size_t index = 0; index < m_AnimationFloatPairs.size(); ++index)
- retval |= ApplyIfAnimationMatches(m_AnimationFloatPairs.at(index), inSlide, inInstance,
- inProperty, m_AnimationCore, outValue);
- }
-
- if (!retval) {
- bool animatable;
- size_t numChannels;
- bool animated = false;
-
- std::tie(animatable, numChannels) = GetVariantAnimatableAndArity(outValue);
- if (animatable) {
- TGraphSlidePair theGraphSlidePair = m_SlideGraphCore->GetAssociatedGraph(inInstance);
- float theSeconds = m_SlideCore->GetSlideTime(
- m_SlideGraphCore->GetGraphActiveSlide(theGraphSlidePair.first));
-
- do_times(numChannels, std::bind(&CStudioAnimationSystem::OverrideChannelIfAnimated,
- this, inSlide, inInstance, inProperty,
- std::placeholders::_1, theSeconds,
- std::ref(animated), std::ref(outValue)));
- }
-
- if (animated)
- retval = true;
- }
-
- return retval;
-}
-
-bool KeyframeNear(const TKeyframe &inKeyframe, float inSeconds)
-{
- return fabs(KeyframeTime(inKeyframe) - inSeconds) < .01;
-}
-Qt3DSDMKeyframeHandle CreateKeyframeExplicit(Qt3DSDMAnimationHandle inAnimation, float inValue,
- float inSeconds, TAnimationCorePtr inAnimationCore,
- float inEaseIn, float inEaseOut)
-{
- TKeyframeHandleList theKeyframes;
- float theValue = inValue;
- inAnimationCore->GetKeyframes(inAnimation, theKeyframes);
- function<TKeyframe(Qt3DSDMKeyframeHandle)> theConverter(
- std::bind(&IAnimationCore::GetKeyframeData, inAnimationCore, std::placeholders::_1));
-
- TKeyframeHandleList::iterator theFind =
- std::find_if(theKeyframes.begin(), theKeyframes.end(),
- [theConverter, inSeconds](const Qt3DSDMKeyframeHandle &handle)
- { return KeyframeNear(theConverter(handle), inSeconds); });
-
- float theEaseIn = inEaseIn;
- float theEaseOut = inEaseOut;
- Qt3DSDMKeyframeHandle theKeyframe;
- if (theFind != theKeyframes.end()) {
- theKeyframe = *theFind;
-
- inAnimationCore->SetKeyframeData(
- theKeyframe, CreateEaseInEaseOutKeyframe(inSeconds, theValue, theEaseIn, theEaseOut));
- } else {
- theKeyframe = inAnimationCore->InsertKeyframe(
- inAnimation, CreateEaseInEaseOutKeyframe(inSeconds, theValue, theEaseIn, theEaseOut));
- }
- return theKeyframe;
-}
-
-Qt3DSDMKeyframeHandle CreateKeyframe(Qt3DSDMAnimationHandle inAnimation, const SValue &inValue,
- float inSeconds, TAnimationCorePtr inAnimationCore,
- float inEaseIn, float inEaseOut)
-{
- SAnimationInfo theInfo(inAnimationCore->GetAnimationInfo(inAnimation));
- return CreateKeyframeExplicit(inAnimation, GetAnimationValue(theInfo.m_Index, inValue),
- inSeconds, inAnimationCore, inEaseIn, inEaseOut);
-}
-
-void MaybeAddAnimation(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore, TAnimationHandleList &outAnimations)
-{
- SAnimationInfo theInfo(inAnimationCore->GetAnimationInfo(inAnimation));
- if (IsAnimationInfoEqual(theInfo, inSlide, inInstance, inProperty))
- outAnimations.push_back(inAnimation);
-}
-
-bool SortAnimationHandlesByIndex(Qt3DSDMAnimationHandle lhs, Qt3DSDMAnimationHandle rhs,
- TAnimationCorePtr inCore)
-{
- return inCore->GetAnimationInfo(lhs).m_Index < inCore->GetAnimationInfo(rhs).m_Index;
-}
-
-void GetPresentAnimations(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const TAnimationFloatPairList &inAnimationPairs,
- TAnimationCorePtr inAnimationCore, TAnimationHandleList &outAnimations)
-{
- function<void(Qt3DSDMAnimationHandle)> theOperation(
- std::bind(MaybeAddAnimation, inSlide, inInstance, inProperty,
- std::placeholders::_1, inAnimationCore,
- std::ref(outAnimations)));
-
- for (auto animation : inAnimationPairs) {
- MaybeAddAnimation(inSlide, inInstance, inProperty, animation.first, inAnimationCore,
- std::ref(outAnimations));
- }
-
- if (outAnimations.empty()) {
- TAnimationHandleList theAnimationHandles;
- inAnimationCore->GetAnimations(theAnimationHandles);
- do_all(theAnimationHandles, theOperation);
- }
- std::sort(outAnimations.begin(), outAnimations.end(),
- std::bind(SortAnimationHandlesByIndex,
- std::placeholders::_1, std::placeholders::_2, inAnimationCore));
-}
-
-void CreateAnimationAndAdd(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- TAnimationCorePtr inAnimationCore, TAnimationHandleList &outAnimations)
-{
- outAnimations.push_back(inAnimationCore->CreateAnimation(
- inSlide, inInstance, inProperty, inIndex, EAnimationTypeEaseInOut, false));
-}
-
-bool AnimationValueDiffers(Qt3DSDMAnimationHandle inAnimation, const SValue &inValue,
- float inSeconds, TAnimationCorePtr inAnimationCore)
-{
- SAnimationInfo theInfo(inAnimationCore->GetAnimationInfo(inAnimation));
- if (inAnimationCore->GetKeyframeCount(inAnimation) == 0)
- return true; // currently there is no keyframe, so return true
- float theValue = GetAnimationValue(theInfo.m_Index, inValue);
- float theAnimatedValue = inAnimationCore->EvaluateAnimation(inAnimation, inSeconds);
- return fabs(theValue - theAnimatedValue) > .001;
-}
-
-bool AnimationExistsInPresentAnimations(const TAnimationFloatPair &inAnimation,
- TAnimationHandleList &inPresentAnimations)
-{
- return exists(inPresentAnimations,
- std::bind(equal_to<Qt3DSDMAnimationHandle>(), inAnimation.first,
- std::placeholders::_1));
-}
-
-void DoKeyframeProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue, float inTimeInSecs,
- bool inDoDiffValue, TAnimationCorePtr inAnimationCore,
- TAnimationFloatPairList &inAnimationFloatPairs, float inEaseIn,
- float inEaseOut)
-{
- tuple<bool, size_t> arity = GetVariantAnimatableAndArity(inValue);
- TAnimationHandleList thePresentAnimations;
- GetPresentAnimations(inSlide, inInstance, inProperty, std::cref(inAnimationFloatPairs),
- inAnimationCore, thePresentAnimations);
- if (thePresentAnimations.empty())
- do_times(get<1>(arity), std::bind(CreateAnimationAndAdd, inSlide, inInstance, inProperty,
- std::placeholders::_1,
- inAnimationCore, std::ref(thePresentAnimations)));
- if (!inDoDiffValue
- || find_if(thePresentAnimations.begin(), thePresentAnimations.end(),
- std::bind(AnimationValueDiffers,
- std::placeholders::_1, inValue, inTimeInSecs, inAnimationCore))
- != thePresentAnimations.end()) {
- do_all(thePresentAnimations,
- std::bind(CreateKeyframe, std::placeholders::_1,
- std::cref(inValue), inTimeInSecs, inAnimationCore,
- inEaseIn, inEaseOut));
- erase_if(inAnimationFloatPairs, std::bind(AnimationExistsInPresentAnimations,
- std::placeholders::_1,
- std::ref(thePresentAnimations)));
- }
-}
-
-void DoKeyframeProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue, bool inDoDiffValue,
- TAnimationCorePtr inAnimationCore, TSlideGraphCorePtr inSlideGraphCore,
- TSlideCorePtr inSlideCore, TAnimationFloatPairList &inAnimationFloatPairs,
- float inEaseIn, float inEaseOut)
-{
- TGraphSlidePair theGraphSlidePair = inSlideGraphCore->GetAssociatedGraph(inInstance);
- float theCurrentTime =
- inSlideCore->GetSlideTime(inSlideGraphCore->GetGraphActiveSlide(theGraphSlidePair.first));
- DoKeyframeProperty(inSlide, inInstance, inProperty, inValue, theCurrentTime, inDoDiffValue,
- inAnimationCore, inAnimationFloatPairs, inEaseIn, inEaseOut);
-}
-
-void DoKeyframeProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue, bool inDoDiffValue,
- TAnimationCorePtr inAnimationCore, TSlideGraphCorePtr inSlideGraphCore,
- TSlideCorePtr inSlideCore, TAnimationFloatPairList &inAnimationFloatPairs,
- bool inSmoothInterpolation)
-{
- float theEaseIn = 0.0f, theEaseOut = 0.0f;
- if (inSmoothInterpolation)
- theEaseIn = theEaseOut = 100.f;
- DoKeyframeProperty(inSlide, inInstance, inProperty, inValue, inDoDiffValue, inAnimationCore,
- inSlideGraphCore, inSlideCore, inAnimationFloatPairs, theEaseIn, theEaseOut);
-}
-
-TAnimationFloatPair CreateAnimationFloatPair(Qt3DSDMAnimationHandle inAnimation,
- const SValue &inValue,
- TAnimationCorePtr inAnimationCore)
-{
- SAnimationInfo theInfo(inAnimationCore->GetAnimationInfo(inAnimation));
- float theValue = GetAnimationValue(theInfo.m_Index, inValue);
- return make_pair(inAnimation, theValue);
-}
-
-void InsertUniqueAnimationFloatPair(Qt3DSDMAnimationHandle inAnimation,
- TAnimationFloatPairList &inList, const SValue &inValue,
- TAnimationCorePtr inAnimationCore)
-{
- TAnimationFloatPair thePair = CreateAnimationFloatPair(inAnimation, inValue, inAnimationCore);
- insert_or_update(thePair, inList,
- std::bind(AnimationFloatPairContainsAnimation, inAnimation, std::placeholders::_1));
-}
-
-bool CStudioAnimationSystem::SetAnimatedInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- tuple<bool, size_t> arity = GetVariantAnimatableAndArity(inValue);
- if (get<0>(arity)) {
- if (m_AutoKeyframe && IsPropertyAnimated(inInstance, inProperty)) // prerequisite for
- // autoset-keyframes is
- // that the property is
- // already animated.
- {
- DoKeyframeProperty(inSlide, inInstance, inProperty, inValue, true, m_AnimationCore,
- m_SlideGraphCore, m_SlideCore, m_AnimationFloatPairs,
- m_SmoothInterpolation);
- return true;
- }
-
- TAnimationHandleList thePresentAnimations;
- GetPresentAnimations(inSlide, inInstance, inProperty, std::cref(m_AnimationFloatPairs),
- m_AnimationCore, thePresentAnimations);
- if (!thePresentAnimations.empty()) {
- TAnimationFloatPairList thePreList(m_AnimationFloatPairs);
- do_all(thePresentAnimations, std::bind(InsertUniqueAnimationFloatPair, std::placeholders::_1,
- std::ref(m_AnimationFloatPairs),
- std::cref(inValue), m_AnimationCore));
-
-
- if (m_Consumer && m_refreshCallback) {
- // Only create a single refresh per transaction stack
- if (((CTransactionConsumer *)m_Consumer.get())->m_TransactionList.size() == 0) {
- CreateGenericTransactionWithConsumer(
- __FILE__, __LINE__, m_Consumer,
- std::bind(m_refreshCallback, inInstance),
- std::bind(m_refreshCallback, inInstance));
- }
- }
-
- CreateGenericTransactionWithConsumer(
- __FILE__, __LINE__, m_Consumer,
- std::bind(assign_to<TAnimationFloatPairList>, m_AnimationFloatPairs,
- std::ref(m_AnimationFloatPairs)),
- std::bind(assign_to<TAnimationFloatPairList>, thePreList,
- std::ref(m_AnimationFloatPairs)));
- return true;
- }
- }
- return false;
-}
-
-void CStudioAnimationSystem::SetAutoKeyframe(bool inAutoKeyframe)
-{
- m_AutoKeyframe = inAutoKeyframe;
-}
-bool CStudioAnimationSystem::GetAutoKeyframe() const
-{
- return m_AutoKeyframe;
-}
-
-Qt3DSDMSlideHandle CStudioAnimationSystem::GetApplicableGraphAndSlide(
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty, const SValue &inValue)
-{
- Qt3DSDMSlideHandle theApplicableSlide;
- tuple<bool, size_t> arity = GetVariantAnimatableAndArity(inValue);
- if (get<0>(arity))
- theApplicableSlide = m_SlideSystem->GetApplicableSlide(inInstance, inProperty);
- return theApplicableSlide;
-}
-
-void InsertUniqueAnimationKeyframesPair(TAnimationKeyframesPairList &ioList, SAnimationInfo &inInfo,
- TKeyframeList &inKeyframes)
-{
- bool theFound = false;
- for (TAnimationKeyframesPairList::iterator theAnimationKeyframeIter = ioList.begin();
- theAnimationKeyframeIter < ioList.end(); ++theAnimationKeyframeIter) {
- if (IsAnimationInfoEqual(theAnimationKeyframeIter->first, inInfo.m_Slide, inInfo.m_Instance,
- inInfo.m_Property, inInfo.m_Index)) {
- theFound = true;
- // Overwrite the existing value
- SAnimationInfo &theInfo = theAnimationKeyframeIter->first;
- theInfo.m_AnimationType = inInfo.m_AnimationType;
- theInfo.m_DynamicFirstKeyframe = inInfo.m_DynamicFirstKeyframe;
- theAnimationKeyframeIter->second = inKeyframes;
- break;
- }
- }
- if (!theFound) {
- ioList.push_back(std::make_pair(inInfo, inKeyframes));
- }
-}
-
-void CStudioAnimationSystem::Animate(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- SValue theValue;
- m_PropertySystem->GetInstancePropertyValue(inInstance, inProperty, theValue);
- Qt3DSDMSlideHandle theApplicableSlide =
- GetApplicableGraphAndSlide(inInstance, inProperty, theValue.toOldSkool());
- if (theApplicableSlide.Valid()) {
- // Check if previously we have set animation & keyframes
- DataModelDataType::Value theDataType = m_PropertySystem->GetDataType(inProperty);
- std::tuple<bool, size_t> theArity = GetDatatypeAnimatableAndArity(theDataType);
- bool theFound = false;
- for (size_t i = 0; i < std::get<1>(theArity); ++i) {
- TAnimationKeyframesPairList::iterator theAnimationKeyframeIter =
- m_DeletedAnimationData.begin();
- for (; theAnimationKeyframeIter < m_DeletedAnimationData.end();
- ++theAnimationKeyframeIter) {
- if (IsAnimationInfoEqual(theAnimationKeyframeIter->first, theApplicableSlide,
- inInstance, inProperty, i)) {
- theFound = true;
-
- // We use previously set animation & keyframes to create new animation &
- // keyframe
- SAnimationInfo &theInfo = theAnimationKeyframeIter->first;
- Qt3DSDMAnimationHandle theAnimation = m_AnimationCore->CreateAnimation(
- theInfo.m_Slide, theInfo.m_Instance, theInfo.m_Property, theInfo.m_Index,
- theInfo.m_AnimationType, theInfo.m_DynamicFirstKeyframe);
-
- TKeyframeList theKeyframes = theAnimationKeyframeIter->second;
- for (TKeyframeList::const_iterator theKeyframeIter = theKeyframes.begin();
- theKeyframeIter < theKeyframes.end(); ++theKeyframeIter)
- m_AnimationCore->InsertKeyframe(theAnimation, *theKeyframeIter);
-
- break;
- }
- }
- }
-
- if (!theFound)
- DoKeyframeProperty(theApplicableSlide, inInstance, inProperty, theValue.toOldSkool(),
- true, m_AnimationCore, m_SlideGraphCore, m_SlideCore,
- m_AnimationFloatPairs, m_SmoothInterpolation);
- }
-}
-
-void CStudioAnimationSystem::Deanimate(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- DataModelDataType::Value theDataType = m_PropertySystem->GetDataType(inProperty);
- std::tuple<bool, size_t> theArity = GetDatatypeAnimatableAndArity(theDataType);
- for (size_t i = 0; i < std::get<1>(theArity); ++i) {
- Qt3DSDMAnimationHandle theAnimationHandle =
- GetControllingAnimation(inInstance, inProperty, i);
-
- if (theAnimationHandle.Valid()) {
- // Get animation & keyframe data and save it
- SAnimationInfo theInfo(m_AnimationCore->GetAnimationInfo(theAnimationHandle));
- TKeyframeHandleList theKeyframeHandles;
- m_AnimationCore->GetKeyframes(theAnimationHandle, theKeyframeHandles);
- TKeyframeList theKeyframeList;
- for (TKeyframeHandleList::const_iterator theKeyframeIter = theKeyframeHandles.begin();
- theKeyframeIter < theKeyframeHandles.end(); ++theKeyframeIter)
- theKeyframeList.push_back(m_AnimationCore->GetKeyframeData(*theKeyframeIter));
- InsertUniqueAnimationKeyframesPair(m_DeletedAnimationData, theInfo, theKeyframeList);
-
- // Delete the animation
- m_AnimationCore->DeleteAnimation(theAnimationHandle);
- }
- }
-}
-
-void CStudioAnimationSystem::KeyframeProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, bool inDoDiffValue)
-{
- SValue theValue;
- m_PropertySystem->GetInstancePropertyValue(inInstance, inProperty, theValue);
- Qt3DSDMSlideHandle theApplicableSlide =
- GetApplicableGraphAndSlide(inInstance, inProperty, theValue.toOldSkool());
- if (theApplicableSlide.Valid())
- DoKeyframeProperty(theApplicableSlide, inInstance, inProperty, theValue.toOldSkool(),
- inDoDiffValue, m_AnimationCore, m_SlideGraphCore, m_SlideCore,
- m_AnimationFloatPairs, m_SmoothInterpolation);
-}
-void CStudioAnimationSystem::SetOrCreateKeyframe(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- float inTimeInSeconds,
- SGetOrSetKeyframeInfo *inKeyframeInfo,
- size_t inNumInfos)
-{
- qt3dsdm::DataModelDataType::Value thePropertyType = m_PropertySystem->GetDataType(inProperty);
- Qt3DSDMSlideHandle theApplicableSlide;
- std::tuple<bool, size_t> arity = GetDatatypeAnimatableAndArity(thePropertyType);
- if (std::get<0>(arity)) {
- theApplicableSlide = m_SlideSystem->GetApplicableSlide(inInstance, inProperty);
- if (theApplicableSlide.Valid()) {
-
- TAnimationHandleList thePresentAnimations;
- GetPresentAnimations(theApplicableSlide, inInstance, inProperty,
- std::cref(m_AnimationFloatPairs), m_AnimationCore,
- thePresentAnimations);
- size_t numIterations = std::min(inNumInfos, get<1>(arity));
- if (thePresentAnimations.empty()) {
- for (size_t idx = 0, end = numIterations; idx < end; ++idx) {
- CreateAnimationAndAdd(theApplicableSlide, inInstance, inProperty, idx,
- m_AnimationCore, thePresentAnimations);
- }
- }
- for (size_t idx = 0, end = numIterations; idx < end; ++idx) {
- CreateKeyframeExplicit(thePresentAnimations[idx], inKeyframeInfo[idx].m_Value,
- inTimeInSeconds, m_AnimationCore,
- inKeyframeInfo[idx].m_EaseIn, inKeyframeInfo[idx].m_EaseOut);
- if (inKeyframeInfo[idx].m_AnimationTrackIsDynamic)
- m_AnimationCore->SetFirstKeyframeDynamic(thePresentAnimations[idx], true);
- }
- erase_if(m_AnimationFloatPairs, std::bind(AnimationExistsInPresentAnimations,
- std::placeholders::_1,
- std::ref(thePresentAnimations)));
- }
- }
-}
-
-inline bool FindMatchingAnimation(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore, size_t inIndex)
-{
- return inAnimationCore->GetAnimationInfo(inAnimation).m_Index == inIndex;
-}
-
-Qt3DSDMAnimationHandle CStudioAnimationSystem::GetControllingAnimation(
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty, size_t inIndex) const
-{
- Qt3DSDMSlideHandle theApplicableSlide =
- m_SlideSystem->GetApplicableSlide(inInstance, inProperty);
- // first check our anim float pairs
- for (size_t idx = 0, end = m_AnimationFloatPairs.size(); idx < end; ++idx) {
- const SAnimationInfo &theInfo =
- m_AnimationCore->GetAnimationInfo(m_AnimationFloatPairs[idx].first);
- if (IsAnimationInfoEqual(theInfo, theApplicableSlide, inInstance, inProperty, inIndex))
- return m_AnimationFloatPairs[idx].first;
- }
- // Use the cache lookup instead of linear search algorithm
- return m_AnimationCore->GetAnimation(theApplicableSlide, inInstance, inProperty, inIndex);
-}
-
-bool CStudioAnimationSystem::IsPropertyAnimatable(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- DataModelDataType::Value theDataType = m_PropertySystem->GetDataType(inProperty);
- std::tuple<bool, size_t> theArity = GetDatatypeAnimatableAndArity(theDataType);
- if (std::get<0>(theArity))
- return m_SlideGraphCore->GetAssociatedGraph(inInstance).first.Valid();
- return false;
-}
-
-bool CStudioAnimationSystem::IsPropertyAnimated(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- DataModelDataType::Value theDataType = m_PropertySystem->GetDataType(inProperty);
- std::tuple<bool, size_t> theArity = GetDatatypeAnimatableAndArity(theDataType);
- for (size_t i = 0; i < std::get<1>(theArity); ++i) {
- if (GetControllingAnimation(inInstance, inProperty, i).Valid())
- return true;
- }
- return false;
-}
-
-void CStudioAnimationSystem::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_Consumer = inConsumer;
-}
-
-void CStudioAnimationSystem::setRefreshCallback(TRefreshCallbackFunc func)
-{
- m_refreshCallback = func;
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.h
deleted file mode 100644
index e6fdf755..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioAnimationSystem.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef STUDIOANIMATIONSYSTEMIMPLH
-#define STUDIOANIMATIONSYSTEMIMPLH
-
-#include "Qt3DSDMAnimation.h"
-#include "Qt3DSDMSlides.h"
-#include "Qt3DSDMSlideCore.h"
-#include "Qt3DSDMSlideGraphCore.h"
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMDataCore.h"
-#include "Qt3DSDMSignals.h"
-
-namespace qt3dsdm {
-
-typedef std::pair<Qt3DSDMAnimationHandle, float> TAnimationFloatPair;
-typedef std::vector<TAnimationFloatPair> TAnimationFloatPairList;
-
-class CStudioAnimationSystem : public IStudioAnimationSystem,
- public ITransactionProducer
-{
- Q_DISABLE_COPY(CStudioAnimationSystem)
-
- TPropertySystemPtr m_PropertySystem;
- TSlideSystemPtr m_SlideSystem;
- TSlideCorePtr m_SlideCore;
- TSlideGraphCorePtr m_SlideGraphCore;
- TAnimationCorePtr m_AnimationCore;
- TRefreshCallbackFunc m_refreshCallback = nullptr;
-
- bool m_AutoKeyframe;
- // When a property has an animation associated with it, then writes
- // do not go all the way down to the db. They stay on this object.
- TAnimationFloatPairList m_AnimationFloatPairs;
- bool m_SmoothInterpolation;
-
- TAnimationKeyframesPairList m_DeletedAnimationData; // list to store deanimated animation &
- // keyframe data. This will be use if user
- // wants to animate the same property again
-
- TTransactionConsumerPtr m_Consumer;
-
- std::vector<std::shared_ptr<ISignalConnection>> m_Connections;
-
-public:
- CStudioAnimationSystem(TPropertySystemPtr inPropertySystem, TSlideSystemPtr inSlideSystem,
- TSlideCorePtr inSlideCore, TSlideGraphCorePtr inSlideGraphCore,
- TAnimationCorePtr inAnimationCore);
-
- void ClearTemporaryAnimationValues();
- void ClearTemporaryAnimationValues(Qt3DSDMAnimationHandle inAnimation);
-
- void SetPropertySystem(TPropertySystemPtr inPropertySystem)
- {
- m_PropertySystem = inPropertySystem;
- } // HACK: TODO: We should really consider having all the subsytem know everyone else without
- // passing in so many things in the constructor
-
- //====================================================================
- // IStudioAnimationSystem implementation
- //====================================================================
- void SetAutoKeyframe(bool inAutoKeyframe) override;
- bool GetAutoKeyframe() const override;
- void Animate(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) override;
- void Deanimate(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty) override;
- void KeyframeProperty(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- bool inDoDiffValue) override;
- void SetOrCreateKeyframe(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, float inTimeInSeconds,
- SGetOrSetKeyframeInfo *inKeyframeInfo, size_t inNumInfos) override;
- Qt3DSDMAnimationHandle GetControllingAnimation(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- size_t inIndex) const override;
- bool IsPropertyAnimatable(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- bool IsPropertyAnimated(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- void SetInterpolation(bool inSmooth) override { m_SmoothInterpolation = inSmooth; }
-
- bool GetAnimatedInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const override;
- bool SetAnimatedInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) override;
- //====================================================================
-
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-
- void setRefreshCallback(TRefreshCallbackFunc func) override;
-
-private:
- void OnAnimationDeleted(Qt3DSDMAnimationHandle inAnimation);
-
- Qt3DSDMSlideHandle GetApplicableGraphAndSlide(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue);
-
- void OverrideChannelIfAnimated(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex, float inSeconds,
- bool &ioAnimated, SValue &outValue) const;
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.cpp
deleted file mode 100644
index f9f0e2c8..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.cpp
+++ /dev/null
@@ -1,409 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "StudioCoreSystem.h"
-#include "SlideCoreProducer.h"
-#include "SlideGraphCoreProducer.h"
-#include "DataCoreProducer.h"
-#include "AnimationCoreProducer.h"
-#include "ActionCoreProducer.h"
-#include "Qt3DSDMSignals.h"
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSDMGuides.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-inline bool AnimationInstanceMatches(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore,
- Qt3DSDMInstanceHandle inInstance)
-{
- return inInstance == inAnimationCore->GetAnimationInfo(inAnimation).m_Instance;
-}
-
-inline bool AnimationPropertyMatches(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore,
- Qt3DSDMPropertyHandle inProperty)
-{
- return inProperty == inAnimationCore->GetAnimationInfo(inAnimation).m_Property;
-}
-
-inline bool AnimationSlideMatches(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore, Qt3DSDMSlideHandle inSlide)
-{
- return inSlide == inAnimationCore->GetAnimationInfo(inAnimation).m_Slide;
-}
-
-inline bool AnimationSlideInstancePropertyMatch(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- SAnimationInfo theInfo = inAnimationCore->GetAnimationInfo(inAnimation);
- return theInfo.m_Slide == inSlide && theInfo.m_Instance == inInstance
- && theInfo.m_Property == inProperty;
-}
-
-inline bool AnimationInstancesPropertiesMatch(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore,
- const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties)
-{
- SAnimationInfo theInfo = inAnimationCore->GetAnimationInfo(inAnimation);
- return exists(inInstances, std::bind(equal_to<int>(), theInfo.m_Instance,
- std::placeholders::_1))
- && exists(inProperties, std::bind(equal_to<int>(), theInfo.m_Property,
- std::placeholders::_1));
-}
-
-void EraseAnimationsThatMatch(TAnimationCorePtr inAnimationCore,
- function<bool(Qt3DSDMAnimationHandle)> inPredicate)
-{
- TAnimationHandleList theAnimations;
- inAnimationCore->GetAnimations(theAnimations);
- function<bool(Qt3DSDMAnimationHandle)> theComp(std::bind(
- complement<function<bool(Qt3DSDMAnimationHandle)>, Qt3DSDMAnimationHandle>, inPredicate,
- std::placeholders::_1));
- TAnimationHandleList::iterator theRemovals =
- remove_if(theAnimations.begin(), theAnimations.end(), theComp);
- for_each(theAnimations.begin(), theRemovals,
- std::bind(&IAnimationCore::DeleteAnimation, inAnimationCore, std::placeholders::_1));
-}
-
-void EraseActions(TDataCorePtr inDataCore, TActionCorePtr inActionCore,
- const TActionHandleList &inActions)
-{
- for (TActionHandleList::const_iterator theActionIter = inActions.begin();
- theActionIter != inActions.end(); ++theActionIter) {
- Qt3DSDMInstanceHandle theActionInstance;
- inActionCore->DeleteAction(*theActionIter, theActionInstance);
- inDataCore->DeleteInstance(theActionInstance);
- }
-}
-
-void CascadeInstanceDelete(Qt3DSDMInstanceHandle inInstance, TDataCorePtr inDataCore,
- TSlideCorePtr inSlideCore, TSlideGraphCorePtr inSlideGraphCore,
- TAnimationCorePtr inAnimationCore, TActionCorePtr inActionCore)
-{
- inSlideCore->DeleteAllInstanceEntries(inInstance);
-
- inSlideGraphCore->DissociateInstance(inInstance);
-
- function<bool(Qt3DSDMAnimationHandle)> thePredicate(
- std::bind(AnimationInstanceMatches, std::placeholders::_1, inAnimationCore, inInstance));
- EraseAnimationsThatMatch(inAnimationCore, thePredicate);
-
- TActionHandleList theActions;
- inActionCore->GetActions(inInstance, theActions);
- EraseActions(inDataCore, inActionCore, theActions);
-}
-
-void CascadePropertyRemove(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- TSlideCorePtr inSlideCore, TSlideGraphCorePtr inSlideGraphCore,
- TAnimationCorePtr inAnimationCore)
-{
- inSlideCore->DeleteAllPropertyEntries(inProperty);
- function<bool(Qt3DSDMAnimationHandle)> thePredicate(
- std::bind(AnimationPropertyMatches, std::placeholders::_1, inAnimationCore, inProperty));
- EraseAnimationsThatMatch(inAnimationCore, thePredicate);
-}
-
-void CascadeSlideDelete(Qt3DSDMSlideHandle inSlide, TDataCorePtr inDataCore,
- TSlideCorePtr inSlideCore, TSlideGraphCorePtr inSlideGraphCore,
- TAnimationCorePtr inAnimationCore, TActionCorePtr inActionCore)
-{
- Qt3DSDMSlideGraphHandle theGraph = inSlideGraphCore->GetSlideGraph(inSlide);
- if (theGraph.Valid()) {
- TSlideHandleList theChildren;
- inSlideCore->GetChildSlides(inSlide, theChildren);
- TInstanceHandleList instances;
- for (size_t idx = 0, end = theChildren.size(); idx < end; ++idx) {
- instances.clear();
- inSlideCore->DeleteSlide(theChildren[idx], instances);
- for (size_t instIdx = 0, instEnd = instances.size(); instIdx < instEnd; ++instIdx)
- inDataCore->DeleteInstance(instances[instIdx]);
- }
- inSlideGraphCore->DeleteSlideGraph(theGraph);
- }
-
- else {
- Qt3DSDMSlideHandle theMaster(inSlideCore->GetParentSlide(inSlide));
- if (theMaster.Valid()) {
- Qt3DSDMSlideGraphHandle theGraph = inSlideGraphCore->GetSlideGraph(theMaster);
- if (theGraph.Valid()) {
- /*
- tricky stuff. The slide change was recorded in the transaction system when the
- slide was created. But since there didn't *have* to be a slide change when the
- slide was destroyed there was no slide change recorded at that point.
-
- Then on the first redo, the system quietly switched the active slide to the new
- slide. On the second redo the system crashed due to attempting to access the
- new slide after it had been deleted (as nothing switched the system back to the
- current slide).
-
- So the correct answer is that the cascading system needs to *always* set the
- active slide, even if it seems like it would be, at the moment, unnecessary
- because the slide getting deleted is not currently active. This is the mirror
- of the fact that new slide *always* sets the active slide so it does make
- logical sense.*/
- Qt3DSDMSlideHandle theNewActiveSlide =
- inSlideGraphCore->GetGraphActiveSlide(theGraph);
- if (theNewActiveSlide == inSlide) {
- TSlideHandleList theChildren;
- inSlideCore->GetChildSlides(theMaster, theChildren);
- size_t idx = 0;
- for (size_t end = theChildren.size(); idx < end; ++idx) {
- if (theChildren[idx] != inSlide) {
- theNewActiveSlide = theChildren[idx];
- break;
- }
- }
- if (theNewActiveSlide == inSlide)
- theNewActiveSlide = theMaster;
- }
- inSlideGraphCore->SetGraphActiveSlide(theGraph, theNewActiveSlide);
- }
- }
- }
- EraseAnimationsThatMatch(inAnimationCore,
- std::bind(AnimationSlideMatches,
- std::placeholders::_1, inAnimationCore, inSlide));
-
- TActionHandleList theActions;
- inActionCore->GetActions(inSlide, theActions);
- EraseActions(inDataCore, inActionCore, theActions);
-}
-
-void CascadeSlidePropertyRemove(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, TAnimationCorePtr inAnimationCore)
-{
- EraseAnimationsThatMatch(inAnimationCore,
- std::bind(AnimationSlideInstancePropertyMatch,
- std::placeholders::_1, inAnimationCore,
- inSlide, inInstance, inProperty));
-}
-
-void CascadeInstanceParentRemoved(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent,
- TDataCorePtr inDataCore, TSlideCorePtr inSlideCore,
- TAnimationCorePtr inAnimationCore)
-{
- TPropertyHandleList theProperties;
- inDataCore->GetInstanceProperties(inParent, theProperties);
- TInstanceHandleList allInstances;
- inDataCore->GetInstances(allInstances);
- function<bool(Qt3DSDMInstanceHandle)> InstanceOrDerived(
- std::bind(&IDataCore::IsInstanceOrDerivedFrom, inDataCore,
- std::placeholders::_1, inInstance));
- function<bool(Qt3DSDMInstanceHandle)> DerivedComplement(
- std::bind(complement<function<bool(Qt3DSDMInstanceHandle)>, Qt3DSDMInstanceHandle>,
- InstanceOrDerived, std::placeholders::_1));
- TInstanceHandleList::iterator all_derived =
- remove_if(allInstances.begin(), allInstances.end(), DerivedComplement);
- TInstanceHandleList derivedInstances(allInstances.begin(), all_derived);
- inSlideCore->DeleteAllInstancePropertyEntries(derivedInstances, theProperties);
- EraseAnimationsThatMatch(
- inAnimationCore, std::bind(AnimationInstancesPropertiesMatch,
- std::placeholders::_1, inAnimationCore,
- std::cref(derivedInstances), std::cref(theProperties)));
-}
-
-void CascadeBeforeAnimationDeleted(Qt3DSDMAnimationHandle inAnimation,
- TAnimationCorePtr inAnimationCore, TDataCorePtr inDataCore,
- TSlideCorePtr inSlideCore)
-{
- SAnimationInfo theInfo = inAnimationCore->GetAnimationInfo(inAnimation);
- SValue theSlideValue;
- if (inDataCore->IsInstance(theInfo.m_Instance) && inSlideCore->IsSlide(theInfo.m_Slide)
- && inSlideCore->GetSpecificInstancePropertyValue(theInfo.m_Slide, theInfo.m_Instance,
- theInfo.m_Property, theSlideValue)
- && inAnimationCore->GetKeyframeCount(inAnimation)) {
- float theTime = inSlideCore->GetSlideTime(theInfo.m_Slide);
- float theValue = inAnimationCore->EvaluateAnimation(inAnimation, theTime);
- SetAnimationValue(theValue, theInfo.m_Index, theSlideValue);
- inSlideCore->ForceSetInstancePropertyValue(theInfo.m_Slide, theInfo.m_Instance,
- theInfo.m_Property, theSlideValue);
- }
-}
-
-void CascadeBeforeKeyframeErased(Qt3DSDMKeyframeHandle inKeyframe, TAnimationCorePtr inAnimationCore,
- TDataCorePtr inDataCore, TSlideCorePtr inSlideCore)
-{
- Qt3DSDMAnimationHandle theAnimation = inAnimationCore->GetAnimationForKeyframe(inKeyframe);
- if (inAnimationCore->GetKeyframeCount(theAnimation) == 1)
- CascadeBeforeAnimationDeleted(theAnimation, inAnimationCore, inDataCore, inSlideCore);
-}
-
-CStudioCoreSystem::CStudioCoreSystem(TStringTablePtr strTable)
- : m_StringTable(strTable.get() != NULL ? strTable : IStringTable::CreateStringTable())
- , m_DataCore(new CDataCoreProducer(m_StringTable))
- , m_SlideCore(new CSlideCoreProducer(m_StringTable))
- , m_SlideGraphCore(new CSlideGraphCoreProducer())
- , m_AnimationCore(new CAnimationCoreProducer())
- , m_ActionCore(new CActionCoreProducer(m_StringTable))
- , m_NewMetaData(
- IMetaData::CreateNewMetaData(dynamic_pointer_cast<CDataCoreProducer>(m_DataCore)))
- , m_GuideSystem(IGuideSystem::CreateGuideSystem())
-{
- IDataCoreSignalProvider *theProvider =
- dynamic_cast<IDataCoreSignalProvider *>(m_DataCore.get());
- m_Connections.push_back(theProvider->ConnectInstanceDeleted(
- std::bind(CascadeInstanceDelete, std::placeholders::_1, m_DataCore, m_SlideCore,
- m_SlideGraphCore, m_AnimationCore, m_ActionCore)));
- m_Connections.push_back(theProvider->ConnectPropertyRemoved(std::bind(
- CascadePropertyRemove, std::placeholders::_1,
- std::placeholders::_2, m_SlideCore, m_SlideGraphCore, m_AnimationCore)));
- m_Connections.push_back(theProvider->ConnectInstanceParentRemoved(std::bind(
- CascadeInstanceParentRemoved, std::placeholders::_1,
- std::placeholders::_2, m_DataCore, m_SlideCore, m_AnimationCore)));
- ISlideCoreSignalProvider *theSlideCoreSignalProvider =
- dynamic_cast<ISlideCoreSignalProvider *>(m_SlideCore.get());
- m_Connections.push_back(theSlideCoreSignalProvider->ConnectBeforeSlideDeleted(
- std::bind(CascadeSlideDelete, std::placeholders::_1, m_DataCore, m_SlideCore,
- m_SlideGraphCore, m_AnimationCore, m_ActionCore)));
- m_Connections.push_back(theSlideCoreSignalProvider->ConnectInstancePropertyValueRemoved(
- std::bind(CascadeSlidePropertyRemove, std::placeholders::_1,
- std::placeholders::_2, std::placeholders::_3, m_AnimationCore)));
- IAnimationCoreSignalProvider *theAnimProvider =
- dynamic_cast<IAnimationCoreSignalProvider *>(m_AnimationCore.get());
- m_Connections.push_back(theAnimProvider->ConnectBeforeAnimationDeleted(
- std::bind(CascadeBeforeAnimationDeleted, std::placeholders::_1,
- m_AnimationCore, m_DataCore, m_SlideCore)));
- m_Connections.push_back(theAnimProvider->ConnectBeforeKeyframeErased(
- std::bind(CascadeBeforeKeyframeErased, std::placeholders::_1,
- m_AnimationCore, m_DataCore, m_SlideCore)));
- m_Connections.push_back(theAnimProvider->ConnectBeforeAllKeyframesErased(
- std::bind(CascadeBeforeAnimationDeleted, std::placeholders::_1,
- m_AnimationCore, m_DataCore, m_SlideCore)));
-}
-
-CStudioCoreSystem::~CStudioCoreSystem()
-{
-}
-
-std::shared_ptr<IDataCore> CStudioCoreSystem::GetDataCore()
-{
- return m_DataCore;
-}
-std::shared_ptr<ISlideCore> CStudioCoreSystem::GetSlideCore()
-{
- return m_SlideCore;
-}
-std::shared_ptr<ISlideGraphCore> CStudioCoreSystem::GetSlideGraphCore()
-{
- return m_SlideGraphCore;
-}
-std::shared_ptr<IAnimationCore> CStudioCoreSystem::GetAnimationCore()
-{
- return m_AnimationCore;
-}
-std::shared_ptr<IActionCore> CStudioCoreSystem::GetActionCore()
-{
- return m_ActionCore;
-}
-std::shared_ptr<ICustomPropCore> CStudioCoreSystem::GetCustomPropCore()
-{
- return m_CustomPropCore;
-}
-std::shared_ptr<IMetaData> CStudioCoreSystem::GetNewMetaData()
-{
- return m_NewMetaData;
-}
-std::shared_ptr<IGuideSystem> CStudioCoreSystem::GetGuideSystem()
-{
- return m_GuideSystem;
-}
-
-std::shared_ptr<IDataCore> CStudioCoreSystem::GetTransactionlessDataCore()
-{
- return dynamic_cast<CDataCoreProducer *>(m_DataCore.get())->GetTransactionlessDataCore();
-}
-std::shared_ptr<ISlideCore> CStudioCoreSystem::GetTransactionlessSlideCore()
-{
- return dynamic_cast<CSlideCoreProducer *>(m_SlideCore.get())->GetTransactionlessSlideCore();
-}
-std::shared_ptr<ISlideGraphCore> CStudioCoreSystem::GetTransactionlessSlideGraphCore()
-{
- return dynamic_cast<CSlideGraphCoreProducer *>(m_SlideGraphCore.get())
- ->GetTransactionlessSlideGraphCore();
-}
-std::shared_ptr<IAnimationCore> CStudioCoreSystem::GetTransactionlessAnimationCore()
-{
- return dynamic_cast<CAnimationCoreProducer *>(m_AnimationCore.get())
- ->GetTransactionlessAnimationCore();
-}
-std::shared_ptr<IActionCore> CStudioCoreSystem::GetTransactionlessActionCore()
-{
- return dynamic_cast<CActionCoreProducer *>(m_ActionCore.get())->GetTransactionlessActionCore();
-}
-
-inline bool InstanceSpecificNameMatches(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const TCharStr &inName,
- const CSimpleDataCore &inData)
-{
- TPropertyHandleList theProperties;
- inData.GetAggregateInstanceProperties(inInstance, theProperties);
- SValue theValue;
- if (exists(theProperties, std::bind(equal_to<int>(), inProperty, std::placeholders::_1))
- && inData.GetSpecificInstancePropertyValue(inInstance, inProperty, theValue)) {
- return inName == get<TDataStrPtr>(theValue)->GetData();
- }
- return false;
-}
-
-Qt3DSDMInstanceHandle CStudioCoreSystem::FindInstanceByName(Qt3DSDMPropertyHandle inNameProperty,
- const TCharStr &inName) const
-{
- TInstanceHandleList theInstances;
- m_DataCore->GetInstances(theInstances);
- TInstanceHandleList::iterator theFind = find_if<TInstanceHandleList::iterator>(
- theInstances,
- std::bind(InstanceSpecificNameMatches, std::placeholders::_1, inNameProperty, std::cref(inName),
- std::cref(*dynamic_cast<CDataCoreProducer *>(m_DataCore.get())
- ->GetTransactionlessDataCore())));
- if (theFind != theInstances.end())
- return *theFind;
- return 0;
-}
-
-void CStudioCoreSystem::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- DoSetConsumer(inConsumer, m_DataCore);
- DoSetConsumer(inConsumer, m_SlideCore);
- DoSetConsumer(inConsumer, m_SlideGraphCore);
- DoSetConsumer(inConsumer, m_AnimationCore);
- DoSetConsumer(inConsumer, m_ActionCore);
- DoSetConsumer(inConsumer, m_GuideSystem);
- // In general the meta data doesn't participate in the undo/redo system except
- // in special cases.
- if (!inConsumer)
- DoSetConsumer(inConsumer, m_NewMetaData);
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.h
deleted file mode 100644
index 18f1dad6..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioCoreSystem.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef STUDIOCORESYSTEMH
-#define STUDIOCORESYSTEMH
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMHandles.h"
-
-namespace qt3dsdm {
-class IDataCore;
-class ISlideCore;
-class ISlideGraphCore;
-class IAnimationCore;
-class IActionCore;
-class ICustomPropCore;
-class ISignalConnection;
-class IMetaData;
-class IGuideSystem;
-
-// Manages cascading operations between cores so that the entire group of
-// cores stays up to date.
-class CStudioCoreSystem : public ITransactionProducer
-{
- Q_DISABLE_COPY(CStudioCoreSystem)
-
- TStringTablePtr m_StringTable;
- std::shared_ptr<IDataCore> m_DataCore;
- std::shared_ptr<ISlideCore> m_SlideCore;
- std::shared_ptr<ISlideGraphCore> m_SlideGraphCore;
- std::shared_ptr<IAnimationCore> m_AnimationCore;
- std::shared_ptr<IActionCore> m_ActionCore;
- std::shared_ptr<ICustomPropCore> m_CustomPropCore;
- std::shared_ptr<IMetaData> m_NewMetaData;
- std::shared_ptr<IGuideSystem> m_GuideSystem;
-
- std::vector<std::shared_ptr<ISignalConnection>> m_Connections;
-
-public:
- CStudioCoreSystem(TStringTablePtr strTable = TStringTablePtr());
- virtual ~CStudioCoreSystem();
- TStringTablePtr GetStringTablePtr() const { return m_StringTable; }
-
- std::shared_ptr<IDataCore> GetDataCore();
- std::shared_ptr<ISlideCore> GetSlideCore();
- std::shared_ptr<ISlideGraphCore> GetSlideGraphCore();
- std::shared_ptr<IAnimationCore> GetAnimationCore();
- std::shared_ptr<IActionCore> GetActionCore();
- std::shared_ptr<ICustomPropCore> GetCustomPropCore();
- std::shared_ptr<IMetaData> GetNewMetaData();
- std::shared_ptr<IGuideSystem> GetGuideSystem();
-
- std::shared_ptr<IDataCore> GetTransactionlessDataCore();
- std::shared_ptr<ISlideCore> GetTransactionlessSlideCore();
- std::shared_ptr<ISlideGraphCore> GetTransactionlessSlideGraphCore();
- std::shared_ptr<IAnimationCore> GetTransactionlessAnimationCore();
- std::shared_ptr<IActionCore> GetTransactionlessActionCore();
- std::shared_ptr<ICustomPropCore> GetTransactionlessCustomPropCore();
-
- Qt3DSDMInstanceHandle FindInstanceByName(Qt3DSDMPropertyHandle inNameProperty,
- const TCharStr &inName) const;
-
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-};
-
-typedef std::shared_ptr<CStudioCoreSystem> TStudioCoreSystemPtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.cpp
deleted file mode 100644
index c98f8a81..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.cpp
+++ /dev/null
@@ -1,647 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "StudioFullSystem.h"
-#include "StudioCoreSystem.h"
-#include "StudioPropertySystem.h"
-#include "SlideSystem.h"
-#include "StudioAnimationSystem.h"
-#include "ActionSystem.h"
-#include "SignalsImpl.h"
-#include "SimpleDataCore.h"
-#include "SimpleSlideCore.h"
-#include "SimpleSlideGraphCore.h"
-#include "SimpleAnimationCore.h"
-#include "DataCoreProducer.h"
-#include "SlideCoreProducer.h"
-#include "SlideGraphCoreProducer.h"
-#include "ActionCoreProducer.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-template <typename TDoTransaction, typename TUndoTransaction>
-inline void NotifyConsumer(TTransactionConsumerPtr inConsumer, TDoTransaction inDoNotification,
- TUndoTransaction inUndoNotification)
-{
- if (inConsumer) {
- inConsumer->OnDoNotification(inDoNotification);
- inConsumer->OnUndoNotification(inUndoNotification);
- } else {
- inDoNotification(); // No consumer, send notification right away
- }
-}
-
-void NotifySlideCreated(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inSlide)
-{
- NotifyConsumer(inConsumer,
- bind(&IStudioFullSystemSignalSender::SendSlideCreated, inSender, inSlide),
- bind(&IStudioFullSystemSignalSender::SendSlideDeleted, inSender, inSlide));
-}
-
-void NotifySlideDeleted(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inSlide)
-{
- NotifyConsumer(inConsumer,
- bind(&IStudioFullSystemSignalSender::SendSlideDeleted, inSender, inSlide),
- bind(&IStudioFullSystemSignalSender::SendSlideCreated, inSender, inSlide));
-}
-
-void NotifySlideRearranged(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inSlide,
- int inOldIndex, int inNewIndex)
-{
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendSlideRearranged, inSender,
- inSlide, inOldIndex, inNewIndex),
- bind(&IStudioFullSystemSignalSender::SendSlideRearranged, inSender, inSlide,
- inNewIndex, inOldIndex));
-}
-
-void SendInstancePropertyValueChanged(TDataCorePtr inCore, IStudioFullSystemSignalSender *inSender,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- // Ignore when the instance is not an instance (undoing an add operation may create this, as
- // transactions are run first and notifications second).
- if (inCore->IsInstance(inInstance))
- inSender->SendInstancePropertyValue(inInstance, inProperty);
-}
-
-void NotifyInstancePropertyChanged(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- bool inIsAggregate)
-{
- if (inConsumer) {
- if (inIsAggregate == false) {
- NotifyConsumer(
- inConsumer,
- bind(SendInstancePropertyValueChanged, inCore, inSender, inInstance, inProperty),
- bind(SendInstancePropertyValueChanged, inCore, inSender, inInstance, inProperty));
- }
- } else {
- SendInstancePropertyValueChanged(inCore, inSender, inInstance, inProperty);
- }
-}
-
-void RunAnimations(IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inMaster,
- Qt3DSDMSlideHandle inSlide, TAnimationCorePtr inAnimationCore,
- TDataCorePtr inDataCore, TTransactionConsumerPtr &inConsumer)
-{
- TAnimationInfoList theAnimations;
- inAnimationCore->GetAnimations(theAnimations, inMaster, inSlide);
- size_t theEnd = theAnimations.size();
- for (size_t theIndex = 0; theIndex < theEnd; ++theIndex) {
- SAnimationInfo &theInfo(theAnimations[theIndex]);
- NotifyInstancePropertyChanged(inConsumer, inDataCore, inSender, theInfo.m_Instance,
- theInfo.m_Property, false);
- }
-}
-
-void NotifyComponentSeconds(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inSlide,
- TDataCorePtr inCore, TAnimationCorePtr inAnimationCore,
- TStudioAnimationSystemPtr inAnimationSystem,
- TSlideSystemPtr inSlideSystem)
-{
- Qt3DSDMSlideHandle theMaster = inSlideSystem->GetMasterSlide(inSlide);
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendBeginComponentSeconds,
- inSender, theMaster),
- bind(&IStudioFullSystemSignalSender::SendComponentSeconds, inSender, theMaster));
- RunAnimations(inSender, theMaster, inSlide, inAnimationCore, inCore, inConsumer);
- dynamic_cast<CStudioAnimationSystem *>(inAnimationSystem.get())
- ->ClearTemporaryAnimationValues();
- NotifyConsumer(
- inConsumer, bind(&IStudioFullSystemSignalSender::SendComponentSeconds, inSender, theMaster),
- bind(&IStudioFullSystemSignalSender::SendBeginComponentSeconds, inSender, theMaster));
-}
-
-void NotifyPropertyLinked(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inMaster,
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- bool inAggregate)
-{
- if (inAggregate == false) {
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendPropertyLinked,
- inSender, inMaster, inInstance, inProperty),
- bind(&IStudioFullSystemSignalSender::SendPropertyUnlinked, inSender,
- inMaster, inInstance, inProperty));
- NotifyInstancePropertyChanged(inConsumer, inCore, inSender, inInstance, inProperty,
- inAggregate);
- }
-}
-
-void NotifyPropertyUnlinked(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inMaster,
- Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- bool inAggregate)
-{
- if (inAggregate == false) {
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendPropertyUnlinked,
- inSender, inMaster, inInstance, inProperty),
- bind(&IStudioFullSystemSignalSender::SendPropertyLinked, inSender, inMaster,
- inInstance, inProperty));
- NotifyInstancePropertyChanged(inConsumer, inCore, inSender, inInstance, inProperty,
- inAggregate);
- }
-}
-
-void NotifyActiveSlide(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMSlideHandle inMaster,
- int /*inIndex*/, Qt3DSDMSlideHandle inOldSlide, Qt3DSDMSlideHandle inNewSlide,
- TAnimationCorePtr inAnimationCore, TSlideSystemPtr inSlideSystem)
-{
- TInstancePropertyPairList thePropertyList;
- inSlideSystem->GetUnionOfProperties(inOldSlide, inNewSlide, thePropertyList);
- for (size_t idx = 0, end = thePropertyList.size(); idx < end; ++idx)
- NotifyInstancePropertyChanged(inConsumer, inCore, inSender, thePropertyList[idx].first,
- thePropertyList[idx].second, false);
-
- RunAnimations(inSender, inMaster, inNewSlide, inAnimationCore, inCore, inConsumer);
-}
-
-void NotifyAnimationCreated(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMAnimationHandle inAnimation, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, bool inIsAggregate)
-{
- if (!inIsAggregate) {
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendAnimationCreated,
- inSender, inAnimation, inInstance, inProperty),
- bind(&IStudioFullSystemSignalSender::SendAnimationDeleted, inSender,
- inAnimation, inInstance, inProperty));
- }
-}
-
-void NotifyAnimationDeleted(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMAnimationHandle inAnimation, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendAnimationDeleted, inSender,
- inAnimation, inInstance, inProperty),
- bind(&IStudioFullSystemSignalSender::SendAnimationCreated, inSender, inAnimation,
- inInstance, inProperty));
- NotifyInstancePropertyChanged(inConsumer, inCore, inSender, inInstance, inProperty, false);
-}
-
-void NotifyAnimationChanged(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMAnimationHandle inAnimation, TAnimationCorePtr inAnimationCore,
- bool inIsAggregate)
-{
- if (!inIsAggregate) {
- SAnimationInfo theInfo(inAnimationCore->GetAnimationInfo(inAnimation));
- NotifyInstancePropertyChanged(inConsumer, inCore, inSender, theInfo.m_Instance,
- theInfo.m_Property, inIsAggregate);
- }
-}
-
-void NotifyKeyframeInserted(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMAnimationHandle inAnimation, Qt3DSDMKeyframeHandle inKeyframe,
- TAnimationCorePtr inAnimationCore, bool inIsAggregate)
-{
- if (!inIsAggregate) {
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendKeyframeInserted,
- inSender, inAnimation, inKeyframe),
- bind(&IStudioFullSystemSignalSender::SendKeyframeErased, inSender,
- inAnimation, inKeyframe));
- NotifyAnimationChanged(inConsumer, inCore, inSender, inAnimation, inAnimationCore, false);
- }
-}
-
-void NotifyKeyframeErased(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMAnimationHandle inAnimation, Qt3DSDMKeyframeHandle inKeyframe,
- TAnimationCorePtr inAnimationCore)
-{
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendKeyframeErased, inSender,
- inAnimation, inKeyframe),
- bind(&IStudioFullSystemSignalSender::SendKeyframeInserted, inSender, inAnimation,
- inKeyframe));
- NotifyAnimationChanged(inConsumer, inCore, inSender, inAnimation, inAnimationCore, false);
-}
-
-void NotifyKeyframeUpdated(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMKeyframeHandle inKeyframe,
- TAnimationCorePtr inAnimationCore)
-{
- NotifyConsumer(inConsumer,
- bind(&IStudioFullSystemSignalSender::SendKeyframeUpdated, inSender, inKeyframe),
- bind(&IStudioFullSystemSignalSender::SendKeyframeUpdated, inSender, inKeyframe));
- Qt3DSDMAnimationHandle theAnimation(inAnimationCore->GetAnimationForKeyframe(inKeyframe));
- NotifyAnimationChanged(inConsumer, inCore, inSender, theAnimation, inAnimationCore, false);
-}
-
-void NotifyConnectFirstKeyframeDynamicSet(TTransactionConsumerPtr &inConsumer, TDataCorePtr inCore,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMAnimationHandle inAnimation, bool inDynamic,
- TAnimationCorePtr inAnimationCore)
-{
- NotifyConsumer(inConsumer,
- bind(&IStudioFullSystemSignalSender::SendConnectFirstKeyframeDynamicSet,
- inSender, inAnimation, inDynamic),
- bind(&IStudioFullSystemSignalSender::SendConnectFirstKeyframeDynamicSet,
- inSender, inAnimation, inDynamic));
- NotifyAnimationChanged(inConsumer, inCore, inSender, inAnimation, inAnimationCore, false);
-}
-
-inline ISlideCoreSignalProvider *GetSlideSignaller(TSlideCorePtr inSlideCore)
-{
- return dynamic_cast<CSlideCoreProducer *>(inSlideCore.get());
-}
-
-void NotifyInstanceCreated(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMInstanceHandle instance)
-{
- NotifyConsumer(inConsumer,
- bind(&IStudioFullSystemSignalSender::SendInstanceCreated, inSender, instance),
- bind(&IStudioFullSystemSignalSender::SendInstanceDeleted, inSender, instance));
-}
-
-void NotifyInstanceDeleted(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMInstanceHandle instance)
-{
- NotifyConsumer(inConsumer,
- bind(&IStudioFullSystemSignalSender::SendInstanceDeleted, inSender, instance),
- bind(&IStudioFullSystemSignalSender::SendInstanceCreated, inSender, instance));
-}
-
-void NotifyActionCreated(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMActionHandle inAction,
- Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance)
-{
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendActionCreated, inSender,
- inAction, inSlide, inInstance),
- bind(&IStudioFullSystemSignalSender::SendActionDeleted, inSender, inAction,
- inSlide, inInstance));
-}
-
-void NotifyActionDestroyed(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMActionHandle inAction,
- Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance)
-{
- NotifyConsumer(inConsumer, bind(&IStudioFullSystemSignalSender::SendActionDeleted, inSender,
- inAction, inSlide, inInstance),
- bind(&IStudioFullSystemSignalSender::SendActionCreated, inSender, inAction,
- inSlide, inInstance));
-}
-
-void SendActionEvent(Qt3DSDMActionHandle inAction, TActionCorePtr inCore,
- function<void()> inFunction)
-{
- if (inCore->HandleValid(inAction))
- inFunction();
-}
-
-void NotifyTriggerObjectSet(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMActionHandle inAction,
- TActionCorePtr inCore)
-{
- function<void()> theFunc(
- bind(&IStudioFullSystemSignalSender::SendTriggerObjectSet, inSender, inAction));
- NotifyConsumer(inConsumer, bind(SendActionEvent, inAction, inCore, theFunc),
- bind(SendActionEvent, inAction, inCore, theFunc));
-}
-
-void NotifyTargetObjectSet(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender, Qt3DSDMActionHandle inAction,
- TActionCorePtr inCore)
-{
- function<void()> theFunc(
- bind(&IStudioFullSystemSignalSender::SendTargetObjectSet, inSender, inAction));
- NotifyConsumer(inConsumer, bind(SendActionEvent, inAction, inCore, theFunc),
- bind(SendActionEvent, inAction, inCore, theFunc));
-}
-
-void NotifyEventSet(TTransactionConsumerPtr &inConsumer, IStudioFullSystemSignalSender *inSender,
- Qt3DSDMActionHandle inAction, TActionCorePtr inCore)
-{
- function<void()> theFunc(
- bind(&IStudioFullSystemSignalSender::SendEventSet, inSender, inAction));
- NotifyConsumer(inConsumer, bind(SendActionEvent, inAction, inCore, theFunc),
- bind(SendActionEvent, inAction, inCore, theFunc));
-}
-
-void NotifyHandlerSet(TTransactionConsumerPtr &inConsumer, IStudioFullSystemSignalSender *inSender,
- Qt3DSDMActionHandle inAction, TActionCorePtr inCore)
-{
- function<void()> theFunc(
- bind(&IStudioFullSystemSignalSender::SendHandlerSet, inSender, inAction));
- NotifyConsumer(inConsumer, bind(SendActionEvent, inAction, inCore, theFunc),
- bind(SendActionEvent, inAction, inCore, theFunc));
-}
-
-void NotifyHandlerArgumentValueSet(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender,
- Qt3DSDMHandlerArgHandle inAction, TActionCorePtr inCore)
-{
- function<void()> theFunc(
- bind(&IStudioFullSystemSignalSender::SendHandlerArgumentValueSet, inSender, inAction));
- Qt3DSDMActionHandle theActionHdl(inCore->GetHandlerArgumentInfo(inAction).m_Action);
- NotifyConsumer(inConsumer, bind(SendActionEvent, theActionHdl, inCore, theFunc),
- bind(SendActionEvent, theActionHdl, inCore, theFunc));
-}
-
-void NotifyAllKeyframesErased(TTransactionConsumerPtr &inConsumer,
- IStudioFullSystemSignalSender *inSender,
- TAnimationCorePtr inAnimationCore, Qt3DSDMAnimationHandle inAnimation)
-{
- if (inConsumer) {
- TKeyframeHandleList theKeyframes;
- inAnimationCore->GetKeyframes(inAnimation, theKeyframes);
- for (size_t idx = 0, end = theKeyframes.size(); idx < end; ++idx) {
- inConsumer->OnDoNotification(bind(&IStudioFullSystemSignalSender::SendKeyframeErased,
- inSender, inAnimation, theKeyframes[idx]));
- inConsumer->OnUndoNotification(
- bind(&IStudioFullSystemSignalSender::SendKeyframeInserted, inSender, inAnimation,
- theKeyframes[idx]));
- }
- }
-}
-
-CStudioFullSystem::CStudioFullSystem(std::shared_ptr<CStudioCoreSystem> inCoreSystem,
- Qt3DSDMInstanceHandle inSlideInstance,
- Qt3DSDMPropertyHandle inComponentGuidProperty,
- Qt3DSDMInstanceHandle inActionInstance,
- Qt3DSDMPropertyHandle inActionEyeball)
- : m_CoreSystem(inCoreSystem)
- , m_SlideSystem(new SSlideSystem(m_CoreSystem->GetDataCore(), m_CoreSystem->GetSlideCore(),
- m_CoreSystem->GetSlideGraphCore(),
- m_CoreSystem->GetAnimationCore(), inSlideInstance,
- inComponentGuidProperty))
- , m_ActionSystem(new CActionSystem(m_CoreSystem->GetDataCore(), m_CoreSystem->GetSlideCore(),
- m_CoreSystem->GetSlideGraphCore(),
- m_CoreSystem->GetActionCore(), m_SlideSystem,
- inActionInstance, inActionEyeball))
- , m_AggregateOperation(false)
-{
- // TODO: Too many parameters passed in to the subsystem. Just make them know about FullSystem so
- // they can get whatever they want
- CStudioAnimationSystem *theAnimationSystem = new CStudioAnimationSystem(
- m_PropertySystem, m_SlideSystem, m_CoreSystem->GetSlideCore(),
- m_CoreSystem->GetSlideGraphCore(), m_CoreSystem->GetAnimationCore());
- m_AnimationSystem = std::shared_ptr<qt3dsdm::IStudioAnimationSystem>(theAnimationSystem);
-
- m_PropertySystem = std::shared_ptr<qt3dsdm::IPropertySystem>(
- new CStudioPropertySystem(m_CoreSystem->GetNewMetaData(), m_CoreSystem->GetDataCore(),
- m_SlideSystem, m_AnimationSystem));
- theAnimationSystem->SetPropertySystem(m_PropertySystem);
-
- TDataCorePtr dataCore(m_CoreSystem->GetDataCore());
-
- static_cast<SSlideSystem *>(m_SlideSystem.get())->SetPropertySystem(m_PropertySystem);
-
- ISlideSystemSignalProvider *theSlideSignaller =
- dynamic_cast<SSlideSystem *>(m_SlideSystem.get())->GetSignalProvider();
- m_Signaller = CreateStudioFullSystemSignaller(theSlideSignaller);
- IStudioFullSystemSignalSender *theSystemSender =
- dynamic_cast<IStudioFullSystemSignalSender *>(m_Signaller.get());
- m_Connections.push_back(theSlideSignaller->ConnectSlideRearranged(
- bind(NotifySlideRearranged, ref(m_Consumer), theSystemSender,
- std::placeholders::_1,
- std::placeholders::_2, std::placeholders::_3)));
- m_Connections.push_back(theSlideSignaller->ConnectPropertyLinked(
- bind(NotifyPropertyLinked, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1,
- std::placeholders::_2, std::placeholders::_3,
- std::cref(m_AggregateOperation))));
- m_Connections.push_back(theSlideSignaller->ConnectPropertyUnlinked(
- bind(NotifyPropertyUnlinked, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1,
- std::placeholders::_2, std::placeholders::_3,
- std::cref(m_AggregateOperation))));
-
- m_Connections.push_back(theSlideSignaller->ConnectActiveSlide(
- bind(NotifyActiveSlide, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1,
- std::placeholders::_2, std::placeholders::_3, std::placeholders::_4,
- GetAnimationCore(), GetSlideSystem())));
-
- IDataCoreSignalProvider *theDataSignals =
- dynamic_cast<IDataCoreSignalProvider *>(m_CoreSystem->GetDataCore().get());
- m_Connections.push_back(theDataSignals->ConnectInstanceCreated(
- bind(NotifyInstanceCreated, ref(m_Consumer), theSystemSender, std::placeholders::_1)));
- m_Connections.push_back(theDataSignals->ConnectInstanceDeleted(
- bind(NotifyInstanceDeleted, ref(m_Consumer), theSystemSender, std::placeholders::_1)));
-
- ISlideCoreSignalProvider *theSlideCoreSignaller =
- dynamic_cast<ISlideCoreSignalProvider *>(m_CoreSystem->GetSlideCore().get());
- m_Connections.push_back(theSlideCoreSignaller->ConnectInstancePropertyValueSet(
- bind(NotifyInstancePropertyChanged, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_2, std::placeholders::_3,
- std::cref(m_AggregateOperation))));
- m_Connections.push_back(theSlideCoreSignaller->ConnectSlideTimeChanged(
- bind(NotifyComponentSeconds, ref(m_Consumer), theSystemSender, std::placeholders::_1,
- dataCore, GetAnimationCore(), GetAnimationSystem(), GetSlideSystem())));
- m_Connections.push_back(theSlideCoreSignaller->ConnectSlideCreated(
- bind(NotifySlideCreated, ref(m_Consumer), theSystemSender, std::placeholders::_1)));
- m_Connections.push_back(theSlideCoreSignaller->ConnectSlideDeleted(
- bind(NotifySlideDeleted, ref(m_Consumer), theSystemSender, std::placeholders::_1)));
-
- IAnimationCoreSignalProvider *theAnimationSignals =
- dynamic_cast<IAnimationCoreSignalProvider *>(GetAnimationCore().get());
- m_Connections.push_back(theAnimationSignals->ConnectAnimationCreated(
- bind(NotifyAnimationCreated, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, std::placeholders::_3, std::placeholders::_4,
- std::cref(m_AggregateOperation))));
- m_Connections.push_back(theAnimationSignals->ConnectAnimationDeleted(
- bind(NotifyAnimationDeleted, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1, std::placeholders::_3, std::placeholders::_4)));
- m_Connections.push_back(theAnimationSignals->ConnectKeyframeInserted(
- bind(NotifyKeyframeInserted, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1, std::placeholders::_2,
- GetAnimationCore(), std::cref(m_AggregateOperation))));
- m_Connections.push_back(theAnimationSignals->ConnectKeyframeErased(
- bind(NotifyKeyframeErased, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1, std::placeholders::_2,
- GetAnimationCore())));
- m_Connections.push_back(theAnimationSignals->ConnectKeyframeUpdated(
- bind(NotifyKeyframeUpdated, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1, GetAnimationCore())));
- m_Connections.push_back(theAnimationSignals->ConnectFirstKeyframeDynamicSet(
- bind(NotifyConnectFirstKeyframeDynamicSet, ref(m_Consumer), dataCore,
- theSystemSender, std::placeholders::_1,
- std::placeholders::_2, GetAnimationCore())));
- m_Connections.push_back(theAnimationSignals->ConnectBeforeAllKeyframesErased(
- bind(NotifyAllKeyframesErased, ref(m_Consumer), theSystemSender,
- GetAnimationCore(), std::placeholders::_1)));
-
- IInstancePropertyCoreSignalProvider *thePropertyCoreSignaller =
- dynamic_cast<CStudioPropertySystem *>(m_PropertySystem.get())
- ->GetPropertyCoreSignalProvider();
- m_Connections.push_back(thePropertyCoreSignaller->ConnectInstancePropertyValue(
- bind(NotifyInstancePropertyChanged, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1, std::placeholders::_2, std::cref(m_AggregateOperation))));
-
- thePropertyCoreSignaller = dynamic_cast<CStudioPropertySystem *>(m_PropertySystem.get())
- ->GetImmediatePropertyCoreSignalProvider();
- m_Connections.push_back(thePropertyCoreSignaller->ConnectInstancePropertyValue(
- bind(&IStudioFullSystemSignalSender::SendInstancePropertyValue, theSystemSender,
- std::placeholders::_1, std::placeholders::_2)));
-
- thePropertyCoreSignaller =
- dynamic_cast<IInstancePropertyCoreSignalProvider *>(m_CoreSystem->GetDataCore().get());
- m_Connections.push_back(thePropertyCoreSignaller->ConnectInstancePropertyValue(
- bind(NotifyInstancePropertyChanged, ref(m_Consumer), dataCore, theSystemSender,
- std::placeholders::_1, std::placeholders::_2, std::cref(m_AggregateOperation))));
-
- IActionCoreSignalProvider *theActionSignals =
- dynamic_cast<IActionCoreSignalProvider *>(m_CoreSystem->GetActionCore().get());
- m_Connections.push_back(theActionSignals->ConnectTriggerObjectSet(
- bind(NotifyTriggerObjectSet, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, GetActionCore())));
- m_Connections.push_back(theActionSignals->ConnectTargetObjectSet(
- bind(NotifyTargetObjectSet, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, GetActionCore())));
- m_Connections.push_back(theActionSignals->ConnectEventSet(
- bind(NotifyEventSet, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, GetActionCore())));
- m_Connections.push_back(theActionSignals->ConnectHandlerSet(
- bind(NotifyHandlerSet, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, GetActionCore())));
- m_Connections.push_back(theActionSignals->ConnectHandlerArgumentValueSet(bind(
- NotifyHandlerArgumentValueSet, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, GetActionCore())));
-
- IActionSystemSignalProvider *theActionSystemSignals =
- dynamic_cast<CActionSystem *>(m_ActionSystem.get())->GetSignalProvider();
- m_Connections.push_back(theActionSystemSignals->ConnectActionCreated(
- bind(NotifyActionCreated, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
- m_Connections.push_back(theActionSystemSignals->ConnectActionDeleted(
- bind(NotifyActionDestroyed, ref(m_Consumer), theSystemSender,
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
-}
-
-CStudioFullSystem::~CStudioFullSystem()
-{
-}
-
-std::shared_ptr<IPropertySystem> CStudioFullSystem::GetPropertySystem()
-{
- return m_PropertySystem;
-}
-std::shared_ptr<ISlideSystem> CStudioFullSystem::GetSlideSystem()
-{
- return m_SlideSystem;
-}
-std::shared_ptr<ISlideCore> CStudioFullSystem::GetSlideCore()
-{
- return m_CoreSystem->GetSlideCore();
-}
-std::shared_ptr<IAnimationCore> CStudioFullSystem::GetAnimationCore()
-{
- return m_CoreSystem->GetAnimationCore();
-}
-std::shared_ptr<IStudioAnimationSystem> CStudioFullSystem::GetAnimationSystem()
-{
- return m_AnimationSystem;
-}
-std::shared_ptr<IActionCore> CStudioFullSystem::GetActionCore()
-{
- return m_CoreSystem->GetActionCore();
-}
-std::shared_ptr<IActionSystem> CStudioFullSystem::GetActionSystem()
-{
- return m_ActionSystem;
-}
-
-std::shared_ptr<IPropertySystem> CStudioFullSystem::GetPropertySystem() const
-{
- return m_PropertySystem;
-}
-std::shared_ptr<ISlideSystem> CStudioFullSystem::GetSlideSystem() const
-{
- return m_SlideSystem;
-}
-std::shared_ptr<ISlideCore> CStudioFullSystem::GetSlideCore() const
-{
- return m_CoreSystem->GetSlideCore();
-}
-std::shared_ptr<IAnimationCore> CStudioFullSystem::GetAnimationCore() const
-{
- return m_CoreSystem->GetAnimationCore();
-}
-std::shared_ptr<IStudioAnimationSystem> CStudioFullSystem::GetAnimationSystem() const
-{
- return m_AnimationSystem;
-}
-std::shared_ptr<IActionCore> CStudioFullSystem::GetActionCore() const
-{
- return m_CoreSystem->GetActionCore();
-}
-std::shared_ptr<IActionSystem> CStudioFullSystem::GetActionSystem() const
-{
- return m_ActionSystem;
-}
-
-std::shared_ptr<CStudioCoreSystem> CStudioFullSystem::GetCoreSystem()
-{
- return m_CoreSystem;
-}
-
-bool CStudioFullSystem::GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- SValue theTemp;
- bool retval = dynamic_cast<const CStudioPropertySystem *>(m_PropertySystem.get())
- ->GetCanonicalInstancePropertyValue(inInstance, inProperty, theTemp);
- if (retval)
- outValue = theTemp.toOldSkool();
- return retval;
-}
-
-Qt3DSDMInstanceHandle CStudioFullSystem::FindInstanceByName(Qt3DSDMPropertyHandle inNameProperty,
- const TCharStr &inName) const
-{
- return m_CoreSystem->FindInstanceByName(inNameProperty, inName);
-}
-
-void CStudioFullSystem::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_CoreSystem->SetConsumer(inConsumer);
- DoSetConsumer(inConsumer, m_AnimationSystem);
- m_Consumer = inConsumer;
-}
-
-IStudioFullSystemSignalProvider *CStudioFullSystem::GetSignalProvider()
-{
- return dynamic_cast<IStudioFullSystemSignalProvider *>(m_Signaller.get());
-}
-
-IStudioFullSystemSignalSender *CStudioFullSystem::GetSignalSender()
-{
- return dynamic_cast<IStudioFullSystemSignalSender *>(m_Signaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.h b/src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.h
deleted file mode 100644
index 9411e783..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioFullSystem.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef STUDIOFULLSYSTEMH
-#define STUDIOFULLSYSTEMH
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMHandles.h"
-#include "Qt3DSDMSignals.h"
-#include "Qt3DSDMDataTypes.h"
-
-namespace qt3dsdm {
-class IPropertySystem;
-class ISlideSystem;
-class IStudioAnimationSystem;
-class CStudioCoreSystem;
-class IInstancePropertyCore;
-class INotificationEngine;
-class IAnimationCore;
-class IActionCore;
-class ISlideCore;
-class IActionSystem;
-class ISignalConnection;
-
-class IStudioFullSystemSerializeHelper
-{
-public:
- virtual ~IStudioFullSystemSerializeHelper() {}
- /**
- * Given an instance, set the name if possible. Called for parents of existing instances
- * so we can find instances by name later. There is an implicit assumption for partial
- * serialization that none of the instances that are serialized out are base instances
- * for other serialized instances. There is another implicit assumption that the system
- * can name any instances used a base.
- */
- virtual bool GetInstanceName(Qt3DSDMInstanceHandle inInstance, TCharStr &outName) = 0;
-};
-
-typedef std::shared_ptr<IStudioFullSystemSerializeHelper> TStudioFullSystemSerializeHelperPtr;
-
-// The full studio system needs extra information in the deserialize stage. This information
-// requires knowledge of the larger studio universe in order to work and thus clients need to
-// pass in an interface.
-class IStudioFullSystemDeserializeHelper
-{
-public:
- virtual ~IStudioFullSystemDeserializeHelper() {}
- /**
- * Return an instance by name. Whatever method was used above to name instances
- * should be used to find a given instance by name.
- */
- virtual Qt3DSDMInstanceHandle FindInstanceByName(const TCharStr &inName) = 0;
- /**
- * Translate a given guid. For pass 1, you should only translate ids and just return identity
- * for anything that isn't an id.
- */
- virtual void TranslateGuidPass1(Qt3DSDMPropertyHandle inProperty, SLong4 inValue) = 0;
- /**
- * Now translate guids that are used as data variables. These are links to other objects and
- *the GUID
- * information should come from what was created in pass 1.
- */
- virtual SLong4 TranslateGuidPass2(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SLong4 inValue) = 0;
-};
-
-typedef std::shared_ptr<IStudioFullSystemDeserializeHelper> TStudioFullSystemDeserializeHelperPtr;
-
-class CStudioFullSystem : public ITransactionProducer
-{
- Q_DISABLE_COPY(CStudioFullSystem)
-
- // Base that the other types are built upon
- std::shared_ptr<CStudioCoreSystem> m_CoreSystem;
-
- // The data model exposed to studio
- std::shared_ptr<IPropertySystem> m_PropertySystem;
- std::shared_ptr<ISlideSystem> m_SlideSystem;
- std::shared_ptr<IStudioAnimationSystem> m_AnimationSystem;
- std::shared_ptr<IActionSystem> m_ActionSystem;
-
- std::vector<std::shared_ptr<ISignalConnection>> m_Connections;
-
- TTransactionConsumerPtr m_Consumer;
- TSignalItemPtr m_Signaller;
- bool m_AggregateOperation;
-
-public:
- CStudioFullSystem(std::shared_ptr<CStudioCoreSystem> inCoreSystem,
- Qt3DSDMInstanceHandle inSlideInstance,
- Qt3DSDMPropertyHandle inComponentGuidProperty,
- Qt3DSDMInstanceHandle inActionInstance, Qt3DSDMPropertyHandle inActionEyeball);
- virtual ~CStudioFullSystem();
-
- void BeginAggregateOperation() { m_AggregateOperation = true; }
- void EndAggregateOperation() { m_AggregateOperation = false; }
-
- std::shared_ptr<IPropertySystem> GetPropertySystem();
- std::shared_ptr<ISlideSystem> GetSlideSystem();
- std::shared_ptr<ISlideCore> GetSlideCore();
- std::shared_ptr<IAnimationCore> GetAnimationCore();
- std::shared_ptr<IStudioAnimationSystem> GetAnimationSystem();
- std::shared_ptr<IActionCore> GetActionCore();
- std::shared_ptr<IActionSystem> GetActionSystem();
-
- std::shared_ptr<IPropertySystem> GetPropertySystem() const;
- std::shared_ptr<ISlideSystem> GetSlideSystem() const;
- std::shared_ptr<ISlideCore> GetSlideCore() const;
- std::shared_ptr<IAnimationCore> GetAnimationCore() const;
- std::shared_ptr<IStudioAnimationSystem> GetAnimationSystem() const;
- std::shared_ptr<IActionCore> GetActionCore() const;
- std::shared_ptr<IActionSystem> GetActionSystem() const;
-
- // Don't use this unless you are a test harness or some other more-knowledgeable-than-ordinary
- // entity.
- std::shared_ptr<CStudioCoreSystem> GetCoreSystem();
-
- // Ignoring animation and the currently active slide, get the canonical instance property value
- // for this instance.
- bool GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const;
- Qt3DSDMInstanceHandle FindInstanceByName(Qt3DSDMPropertyHandle inNameProperty,
- const TCharStr &inName) const;
-
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
- TTransactionConsumerPtr GetConsumer() { return m_Consumer; }
-
- // This signal provider sends signals during undo/redo and during
- // animation runs.
- IStudioFullSystemSignalProvider *GetSignalProvider();
-
- // Return the signal sender so that we can activate/deactivate signals
- IStudioFullSystemSignalSender *GetSignalSender();
-};
-
-typedef std::shared_ptr<CStudioFullSystem> TStudioFullSystemPtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.cpp b/src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.cpp
deleted file mode 100644
index 78fabc6b..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSDMPrefix.h"
-#include "StudioPropertySystem.h"
-#include "StudioAnimationSystem.h"
-#include "SignalsImpl.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-CStudioPropertySystem::CStudioPropertySystem(std::shared_ptr<IMetaData> inMetaData,
- TDataCorePtr inDataCore, TSlideSystemPtr inSlideSystem,
- TStudioAnimationSystemPtr inStudioAnimationSystem)
- : m_MetaData(inMetaData)
- , m_DataCore(inDataCore)
- , m_SlideSystem(inSlideSystem)
- , m_StudioAnimationSystem(inStudioAnimationSystem)
-{
- m_PropertyCoreSignaller = CreatePropertyCoreSignaller();
- m_ImmediateModePropertyCoreSignaller = CreatePropertyCoreSignaller();
-}
-
-DataModelDataType::Value CStudioPropertySystem::GetDataType(Qt3DSDMPropertyHandle inProperty) const
-{
- if (m_DataCore->IsProperty(inProperty))
- return m_DataCore->GetProperty(inProperty).m_Type;
- return DataModelDataType::None;
-}
-
-TCharStr CStudioPropertySystem::GetName(Qt3DSDMPropertyHandle inProperty) const
-{
- if (m_DataCore->IsProperty(inProperty))
- return m_DataCore->GetProperty(inProperty).m_Name;
- return TCharStr();
-}
-
-TCharStr CStudioPropertySystem::GetFormalName(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- if (inInstance.Valid() && inProperty.Valid())
- return m_MetaData->GetFormalName(inInstance, inProperty);
- return TCharStr();
-}
-
-AdditionalMetaDataType::Value
-CStudioPropertySystem::GetAdditionalMetaDataType(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- return m_MetaData->GetAdditionalMetaDataType(inInstance, inProperty);
-}
-
-TMetaDataData
-CStudioPropertySystem::GetAdditionalMetaDataData(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- return m_MetaData->GetAdditionalMetaDataData(inInstance, inProperty);
-}
-
-Qt3DSDMInstanceHandle CStudioPropertySystem::GetPropertyOwner(Qt3DSDMPropertyHandle inProperty) const
-{
-
- qt3dsdm::Qt3DSDMPropertyDefinition thePropDef = m_DataCore->GetProperty(inProperty);
- return thePropDef.m_Instance;
-}
-
-Qt3DSDMPropertyHandle
-CStudioPropertySystem::GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const
-{
- return m_DataCore->GetAggregateInstancePropertyByName(inInstance, inStr);
-}
-
-void CStudioPropertySystem::GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const
-{
- m_DataCore->GetAggregateInstanceProperties(inInstance, outProperties);
-}
-
-bool CStudioPropertySystem::HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- return m_DataCore->HasAggregateInstanceProperty(inInstance, inProperty);
-}
-
-bool ApplyValueAndReturnTrue(const SValue &inValue, SValue &outValue)
-{
- outValue = inValue;
- return true;
-}
-
-bool CStudioPropertySystem::GetInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- if (!m_DataCore->IsInstance(inInstance))
- return false;
- if (!m_DataCore->IsProperty(inProperty))
- return false;
-
- Qt3DSDMSlideHandle theAnimationSlide;
- theAnimationSlide = m_SlideSystem->GetApplicableSlide(inInstance, inProperty);
- SValue theTemp;
- bool retval = SetDefault(GetDataType(inProperty), theTemp);
- if (retval && theAnimationSlide.Valid()
- && m_StudioAnimationSystem->GetAnimatedInstancePropertyValue(theAnimationSlide, inInstance,
- inProperty, theTemp))
- return ApplyValueAndReturnTrue(theTemp, outValue);
- if (theAnimationSlide.Valid()
- && m_SlideSystem->GetInstancePropertyValue(theAnimationSlide, inInstance, inProperty,
- theTemp))
- return ApplyValueAndReturnTrue(theTemp, outValue);
- return m_DataCore->GetInstancePropertyValue(inInstance, inProperty, outValue);
-}
-
-void CStudioPropertySystem::SetInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- m_DataCore->CheckValue(inInstance, inProperty, inValue);
-
- Qt3DSDMSlideHandle theApplicableSlide;
- theApplicableSlide = m_SlideSystem->GetApplicableSlide(inInstance, inProperty);
- if (theApplicableSlide.Valid()) {
- if (!m_StudioAnimationSystem->SetAnimatedInstancePropertyValue(
- theApplicableSlide, inInstance, inProperty, inValue.toOldSkool())) {
- // Force set on slide where item exists as it doesn't exist on the root.
- m_SlideSystem->ForceSetInstancePropertyValue(theApplicableSlide, inInstance, inProperty,
- inValue.toOldSkool());
- }
- } else {
- m_DataCore->SetInstancePropertyValue(inInstance, inProperty, inValue);
- }
-}
-
-Qt3DSDMInstanceHandle CStudioPropertySystem::CreateInstance()
-{
- return m_DataCore->CreateInstance();
-}
-
-void CStudioPropertySystem::GetInstances(TInstanceHandleList &outInstances) const
-{
- m_DataCore->GetInstances(outInstances);
-}
-
-void CStudioPropertySystem::DeleteInstance(Qt3DSDMInstanceHandle inHandle)
-{
- m_DataCore->DeleteInstance(inHandle);
-}
-
-void CStudioPropertySystem::DeriveInstance(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent)
-{
- m_DataCore->DeriveInstance(inInstance, inParent);
-}
-
-bool CStudioPropertySystem::IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const
-{
- return m_DataCore->IsInstanceOrDerivedFrom(inInstance, inParent);
-}
-
-QVector<Qt3DSDMPropertyHandle>
-CStudioPropertySystem::GetControllableProperties(Qt3DSDMInstanceHandle inInst) const
-{
- vector<Qt3DSDMMetaDataPropertyHandle> propList;
- QVector<Qt3DSDMPropertyHandle> outList;
- m_MetaData->GetMetaDataProperties(inInst, propList);
-
- for (const auto it : qAsConst(propList)) {
- auto metadata = m_MetaData->GetMetaDataPropertyInfo(it).getValue();
-
- if ((metadata.m_Controllable
- || (metadata.m_Animatable
- && m_StudioAnimationSystem->IsPropertyAnimatable(inInst, metadata.m_Property)))
- && !metadata.m_IsHidden) {
- outList.append(metadata.m_Property);
- }
- }
- return outList;
-}
-
-Qt3DSDMPropertyHandle CStudioPropertySystem::AddProperty(Qt3DSDMInstanceHandle inInstance,
- TCharPtr inName,
- DataModelDataType::Value inPropType)
-{
- return m_DataCore->AddProperty(inInstance, inName, inPropType);
-}
-
-bool CStudioPropertySystem::HandleValid(int inHandle) const
-{
- return m_DataCore->HandleValid(inHandle);
-}
-
-bool CStudioPropertySystem::GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- SValue theTempValue;
- if (m_SlideSystem->GetCanonicalInstancePropertyValue(inInstance, inProperty, theTempValue)) {
- outValue = SValue(theTempValue);
- return true;
- }
- return m_DataCore->GetInstancePropertyValue(inInstance, inProperty, outValue);
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.h b/src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.h
deleted file mode 100644
index 67abcf98..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/StudioPropertySystem.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef INSTANCEPROPERTYCORESYSTEMH
-#define INSTANCEPROPERTYCORESYSTEMH
-
-#include "Qt3DSDMSlides.h"
-#include "Qt3DSDMAnimation.h"
-#include "Qt3DSDMSignals.h"
-#include "Qt3DSDMDataCore.h"
-
-namespace qt3dsdm {
-
-typedef std::tuple<Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, SValue> TTemporaryPropertyValue;
-typedef std::vector<TTemporaryPropertyValue> TTemporaryPropertyValueList;
-
-/**
- * Get/set instance properties taking the slide and slide graph, and animation systems into
- *account.
- * Also takes care of notifying external entities when a property changes.
- */
-class CStudioPropertySystem : public IPropertySystem
-{
- std::shared_ptr<IMetaData> m_MetaData;
- TDataCorePtr m_DataCore;
-
- TSlideSystemPtr m_SlideSystem;
- TStudioAnimationSystemPtr m_StudioAnimationSystem;
-
- TSignalItemPtr m_PropertyCoreSignaller;
- TSignalItemPtr m_ImmediateModePropertyCoreSignaller;
-
-public:
- CStudioPropertySystem(std::shared_ptr<IMetaData> inMetaData, TDataCorePtr inDataCore,
- TSlideSystemPtr inSlideSystem,
- TStudioAnimationSystemPtr inStudioAnimationSystem);
-
- IInstancePropertyCoreSignalProvider *GetPropertyCoreSignalProvider()
- {
- return dynamic_cast<IInstancePropertyCoreSignalProvider *>(m_PropertyCoreSignaller.get());
- }
- // The immediate signaller is used before changes have been committed for very live feedback.
- IInstancePropertyCoreSignalProvider *GetImmediatePropertyCoreSignalProvider()
- {
- return dynamic_cast<IInstancePropertyCoreSignalProvider *>(
- m_ImmediateModePropertyCoreSignaller.get());
- }
-
- IInstancePropertyCoreSignalSender *GetPropertyCoreSignalSender()
- {
- return dynamic_cast<IInstancePropertyCoreSignalSender *>(m_PropertyCoreSignaller.get());
- }
-
- DataModelDataType::Value GetDataType(Qt3DSDMPropertyHandle inProperty) const override;
- TCharStr GetName(Qt3DSDMPropertyHandle inProperty) const override;
- TCharStr GetFormalName(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- virtual AdditionalMetaDataType::Value
- GetAdditionalMetaDataType(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- TMetaDataData GetAdditionalMetaDataData(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- Qt3DSDMInstanceHandle GetPropertyOwner(Qt3DSDMPropertyHandle inProperty) const override;
-
- Qt3DSDMPropertyHandle GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const override;
- void GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const override;
- bool HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
-
- bool GetInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- void SetInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
-
- Qt3DSDMInstanceHandle CreateInstance() override;
- void GetInstances(TInstanceHandleList &outInstances) const override;
- void DeleteInstance(Qt3DSDMInstanceHandle inHandle) override;
-
- void DeriveInstance(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent) override;
- bool IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const override;
-
- Qt3DSDMPropertyHandle AddProperty(Qt3DSDMInstanceHandle inInstance, TCharPtr inName,
- DataModelDataType::Value inPropType) override;
- bool HandleValid(int inHandle) const override;
-
- // Get the instance property value from the slide that owns the instance or the data core if the
- // slide doesn't have the value
- bool GetCanonicalInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const;
-
- QVector<Qt3DSDMPropertyHandle> GetControllableProperties(
- Qt3DSDMInstanceHandle inInst) const override;
-
-private:
- static bool DerivedGuidMatches(qt3dsdm::IDataCore &inDataCore,
- qt3dsdm::Qt3DSDMInstanceHandle inInstance,
- qt3dsdm::Qt3DSDMPropertyHandle inProperty, qt3dsdm::SLong4 inGuid);
- CStudioPropertySystem(const CStudioPropertySystem&) = delete;
- CStudioPropertySystem& operator=(const CStudioPropertySystem&) = delete;
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/VectorTransactions.h b/src/Runtime/ogl-runtime/src/dm/systems/VectorTransactions.h
deleted file mode 100644
index ff1fe2e2..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/VectorTransactions.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef VECTORTRANSACTIONSH
-#define VECTORTRANSACTIONSH
-
-namespace qt3dsdm {
-template <typename TItemType>
-inline void VecInsert(std::vector<TItemType> &inItems, const TItemType &inItem, size_t inIndex)
-{
- inItems.insert(inItems.begin() + inIndex, inItem);
-}
-
-template <typename TItemType>
-inline void VecErase(std::vector<TItemType> &inItems, const TItemType &inItem)
-{
- erase_if(inItems, std::bind(std::equal_to<TItemType>(), inItem, std::placeholders::_1));
-}
-
-template <typename TItemType>
-inline void VecInsertTransaction(const char *inFile, int inLine, std::vector<TItemType> &inItems,
- size_t inIndex, TTransactionConsumerPtr &inConsumer)
-{
- TItemType theItem = inItems.at(inIndex);
- TTransactionPtr theTransaction(DoCreateGenericTransaction(
- inFile, inLine, std::bind(VecInsert<TItemType>, std::ref(inItems), theItem, inIndex),
- std::bind(VecErase<TItemType>, std::ref(inItems), theItem)));
- inConsumer->OnTransaction(theTransaction);
-}
-
-template <typename TItemType>
-inline void VecEraseTransaction(const char *inFile, int inLine, std::vector<TItemType> &inItems,
- size_t inIndex, const TItemType &inItem,
- TTransactionConsumerPtr &inConsumer)
-{
- TTransactionPtr theTransaction(DoCreateGenericTransaction(
- inFile, inLine, std::bind(VecErase<TItemType>, std::ref(inItems), inItem),
- std::bind(VecInsert<TItemType>, std::ref(inItems), inItem, inIndex)));
- inConsumer->OnTransaction(theTransaction);
-}
-
-template <typename TItemType>
-inline void CreateVecInsertTransaction(const char *inFile, int inLine,
- TTransactionConsumerPtr inConsumer, const TItemType &inItem,
- std::vector<TItemType> &inItems)
-{
- using namespace std;
- size_t theDistance = distance(inItems.begin(), find(inItems.begin(), inItems.end(), inItem));
- RunWithConsumer(inConsumer, std::bind(VecInsertTransaction<TItemType>, inFile, inLine,
- std::ref(inItems), theDistance, std::placeholders::_1));
-}
-
-template <typename TItemType>
-inline void CreateVecEraseTransaction(const char *inFile, int inLine,
- TTransactionConsumerPtr inConsumer, const TItemType &inItem,
- std::vector<TItemType> &inItems)
-{
- using namespace std;
- size_t theDistance = distance(inItems.begin(), find(inItems.begin(), inItems.end(), inItem));
- RunWithConsumer(inConsumer,
- std::bind(VecEraseTransaction<TItemType>, inFile, inLine, std::ref(inItems),
- theDistance, std::ref(inItem), std::placeholders::_1));
-}
-
-template <typename TKeyType, typename TValueType, typename THashType>
-struct HashMapAction
-{
- std::unordered_map<TKeyType, TValueType, THashType> &m_HashMap;
- std::pair<TKeyType, TValueType> m_Value;
-
- HashMapAction(std::unordered_map<TKeyType, TValueType, THashType> &map,
- const std::pair<TKeyType, TValueType> &val)
- : m_HashMap(map)
- , m_Value(val)
- {
- }
- bool Exists() { return m_HashMap.find(m_Value.first) != m_HashMap.end(); }
- void Add()
- {
- Q_ASSERT(!Exists());
- m_HashMap.insert(m_Value);
- }
- void Remove()
- {
- Q_ASSERT(Exists());
- m_HashMap.erase(m_HashMap.find(m_Value.first));
- }
-};
-
-template <typename TKeyType, typename TValueType, typename THashType>
-struct HashMapInsertTransaction : public HashMapAction<TKeyType, TValueType, THashType>,
- public ITransaction,
- public IMergeableTransaction<TValueType>
-{
- typedef HashMapAction<TKeyType, TValueType, THashType> base;
- HashMapInsertTransaction(const char *inFile, int inLine,
- std::unordered_map<TKeyType, TValueType, THashType> &map,
- const std::pair<TKeyType, TValueType> &val)
- : HashMapAction<TKeyType, TValueType, THashType>(map, val)
- , ITransaction(inFile, inLine)
- {
- }
- void Do() override { base::Add(); }
- void Undo() override { base::Remove(); }
- void Update(const TValueType &inValue) override { base::m_Value.second = inValue; }
-};
-
-template <typename TKeyType, typename TValueType, typename THashType>
-struct HashMapEraseTransaction : public HashMapAction<TKeyType, TValueType, THashType>,
- public ITransaction
-{
- typedef HashMapAction<TKeyType, TValueType, THashType> base;
- HashMapEraseTransaction(const char *inFile, int inLine,
- std::unordered_map<TKeyType, TValueType, THashType> &map,
- const std::pair<TKeyType, TValueType> &val)
- : HashMapAction<TKeyType, TValueType, THashType>(map, val)
- , ITransaction(inFile, inLine)
- {
- }
- void Do() override { base::Remove(); }
- void Undo() override { base::Add(); }
-};
-
-template <typename TKeyType, typename TValueType, typename THashType>
-inline std::shared_ptr<IMergeableTransaction<TValueType>>
-CreateHashMapInsertTransaction(const char *inFile, int inLine, TTransactionConsumerPtr inConsumer,
- const std::pair<TKeyType, TValueType> &inItem,
- std::unordered_map<TKeyType, TValueType, THashType> &inItems)
-{
- using namespace std;
- std::shared_ptr<IMergeableTransaction<TValueType>> retval;
- if (inConsumer) {
- std::shared_ptr<HashMapInsertTransaction<TKeyType, TValueType, THashType>> transaction(
- std::make_shared<HashMapInsertTransaction<TKeyType, TValueType, THashType>>(
- inFile, inLine, std::ref(inItems), std::cref(inItem)));
- retval = static_pointer_cast<IMergeableTransaction<TValueType>>(transaction);
- inConsumer->OnTransaction(static_pointer_cast<ITransaction>(transaction));
- }
- return retval;
-}
-
-template <typename TKeyType, typename TValueType, typename THashType>
-inline void
-CreateHashMapEraseTransaction(const char *inFile, int inLine, TTransactionConsumerPtr inConsumer,
- const std::pair<TKeyType, TValueType> &inItem,
- std::unordered_map<TKeyType, TValueType, THashType> &inItems)
-{
- using namespace std;
- if (inConsumer)
- inConsumer->OnTransaction(static_pointer_cast<ITransaction>(
- std::make_shared<HashMapEraseTransaction<TKeyType, TValueType, THashType>>(
- inFile, inLine, std::ref(inItems), std::cref(inItem))));
-}
-
-template <typename TKeyType, typename TValueType, typename THashType>
-struct HashMapSwapTransaction : public ITransaction, public IMergeableTransaction<TValueType>
-{
- typedef std::unordered_map<TKeyType, TValueType, THashType> TMapType;
-
- TMapType &m_HashMap;
- TKeyType m_Key;
- TValueType m_OldValue;
- TValueType m_NewValue;
-
- HashMapSwapTransaction(const char *inFile, int inLine, TMapType &inMap, const TKeyType &inKey,
- const TValueType &inOldVal, const TValueType &inNewVal)
- : ITransaction(inFile, inLine)
- , m_HashMap(inMap)
- , m_Key(inKey)
- , m_OldValue(inOldVal)
- , m_NewValue(inNewVal)
- {
- }
-
- bool Exists() { return m_HashMap.find(m_Key) != m_HashMap.end(); }
- void SetValue(const TValueType &inVal)
- {
- typename TMapType::iterator find(m_HashMap.find(m_Key));
- if (find != m_HashMap.end())
- find->second = inVal;
- else
- m_HashMap.insert(std::make_pair(m_Key, inVal));
- }
- void Do() override { SetValue(m_NewValue); }
- void Undo() override { SetValue(m_OldValue); }
- void Update(const TValueType &inValue) override { m_NewValue = inValue; }
-};
-
-template <typename TKeyType, typename TValueType, typename THashType>
-inline std::shared_ptr<IMergeableTransaction<TValueType>>
-CreateHashMapSwapTransaction(const char *inFile, int inLine, TTransactionConsumerPtr inConsumer,
- const TKeyType &inKey, const TValueType &inOldValue,
- const TValueType &inNewValue,
- std::unordered_map<TKeyType, TValueType, THashType> &inItems)
-{
- using namespace std;
- std::shared_ptr<IMergeableTransaction<TValueType>> retval;
- if (inConsumer) {
- std::shared_ptr<HashMapSwapTransaction<TKeyType, TValueType, THashType>> transaction =
- std::make_shared<HashMapSwapTransaction<TKeyType, TValueType, THashType>>(
- inFile, inLine, std::ref(inItems), inKey, inOldValue, inNewValue);
- retval = static_pointer_cast<IMergeableTransaction<TValueType>>(transaction);
- inConsumer->OnTransaction(static_pointer_cast<ITransaction>(transaction));
- }
- return retval;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.cpp
deleted file mode 100644
index c262c239..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "ActionCoreProducer.h"
-#include "HandleSystemTransactions.h"
-#include "VectorTransactions.h"
-#include "SignalsImpl.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-Qt3DSDMActionHandle CActionCoreProducer::CreateAction(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner,
- SLong4 inTriggerTargetObjects)
-{
- Qt3DSDMActionHandle retval =
- m_Data->CreateAction(inInstance, inSlide, inOwner, inTriggerTargetObjects);
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- return retval;
-}
-
-void CActionCoreProducer::DeleteAction(Qt3DSDMActionHandle inAction,
- Qt3DSDMInstanceHandle &outInstance)
-{
- // Ensure action exists
- SAction *theAction = CSimpleActionCore::GetActionNF(inAction, m_Data->m_Objects);
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inAction, m_Data->m_Objects);
- do_all(theAction->m_ActionInfo.m_HandlerArgs,
- std::bind(DoCreateHandleDeleteTransaction, __FILE__, __LINE__, m_Consumer,
- std::placeholders::_1, std::ref(m_Data->m_Objects)));
- m_Data->DeleteAction(inAction, outInstance);
-}
-
-const SActionInfo &CActionCoreProducer::GetActionInfo(Qt3DSDMActionHandle inAction) const
-{
- return m_Data->GetActionInfo(inAction);
-}
-
-void CActionCoreProducer::GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const
-{
- return m_Data->GetActions(inSlide, inOwner, outActions);
-}
-
-void CActionCoreProducer::GetActions(Qt3DSDMSlideHandle inSlide, TActionHandleList &outActions) const
-{
- return m_Data->GetActions(inSlide, outActions);
-}
-
-void CActionCoreProducer::GetActions(Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const
-{
- return m_Data->GetActions(inOwner, outActions);
-}
-
-void CActionCoreProducer::GetActions(TActionHandleList &outActions) const
-{
- return m_Data->GetActions(outActions);
-}
-
-Qt3DSDMInstanceHandle CActionCoreProducer::GetActionInstance(Qt3DSDMActionHandle inAction) const
-{
- return m_Data->GetActionInstance(inAction);
-}
-
-Qt3DSDMActionHandle
-CActionCoreProducer::GetActionByInstance(Qt3DSDMInstanceHandle inActionInstance) const
-{
- return m_Data->GetActionByInstance(inActionInstance);
-}
-
-void CActionCoreProducer::SetTriggerObject(Qt3DSDMActionHandle inAction,
- const SObjectRefType &inTriggerObject)
-{
- SAction *theAction = CSimpleActionCore::GetActionNF(inAction, m_Data->m_Objects);
- if (m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleActionCore::SetTriggerObject, m_Data, inAction, inTriggerObject),
- std::bind(&CSimpleActionCore::SetTriggerObject, m_Data, inAction,
- theAction->m_ActionInfo.m_TriggerObject))));
- }
- m_Data->SetTriggerObject(inAction, inTriggerObject);
- GetSignalSender()->SendTriggerObjectSet(inAction, theAction->m_ActionInfo.m_TriggerObject);
-}
-
-void CActionCoreProducer::SetTargetObject(Qt3DSDMActionHandle inAction,
- const SObjectRefType &inTargetObject)
-{
- SAction *theAction = CSimpleActionCore::GetActionNF(inAction, m_Data->m_Objects);
- if (m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleActionCore::SetTargetObject, m_Data, inAction, inTargetObject),
- std::bind(&CSimpleActionCore::SetTargetObject, m_Data, inAction,
- theAction->m_ActionInfo.m_TargetObject))));
- }
- m_Data->SetTargetObject(inAction, inTargetObject);
- GetSignalSender()->SendTargetObjectSet(inAction, theAction->m_ActionInfo.m_TargetObject);
-}
-
-void CActionCoreProducer::SetEvent(Qt3DSDMActionHandle inAction, const wstring &inEventHandle)
-{
- SAction *theAction = CSimpleActionCore::GetActionNF(inAction, m_Data->m_Objects);
- if (m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleActionCore::SetEvent, m_Data, inAction, inEventHandle),
- std::bind(&CSimpleActionCore::SetEvent, m_Data, inAction,
- theAction->m_ActionInfo.m_Event))));
- }
- m_Data->SetEvent(inAction, inEventHandle);
- GetSignalSender()->SendEventSet(inAction, inEventHandle);
-}
-
-void CActionCoreProducer::SetHandler(Qt3DSDMActionHandle inAction, const wstring &inHandlerHandle)
-{
- SAction *theAction = CSimpleActionCore::GetActionNF(inAction, m_Data->m_Objects);
- if (m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleActionCore::SetHandler, m_Data, inAction, inHandlerHandle),
- std::bind(&CSimpleActionCore::SetHandler, m_Data, inAction,
- theAction->m_ActionInfo.m_Handler))));
- }
- m_Data->SetHandler(inAction, inHandlerHandle);
- GetSignalSender()->SendHandlerSet(inAction, inHandlerHandle);
-}
-
-Qt3DSDMHandlerArgHandle CActionCoreProducer::AddHandlerArgument(Qt3DSDMActionHandle inAction,
- const TCharStr &inName,
- HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType)
-{
- Qt3DSDMHandlerArgHandle retval =
- m_Data->AddHandlerArgument(inAction, inName, inArgType, inValueType);
- SAction *theAction = CSimpleActionCore::GetActionNF(inAction, m_Data->m_Objects);
- CreateVecInsertTransaction<Qt3DSDMHandlerArgHandle>(__FILE__, __LINE__, m_Consumer, retval,
- theAction->m_ActionInfo.m_HandlerArgs);
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- GetSignalSender()->SendHandlerArgumentAdded(inAction, retval, inName, inArgType, inValueType);
- return retval;
-}
-
-void CActionCoreProducer::RemoveHandlerArgument(Qt3DSDMHandlerArgHandle inHandlerArgument)
-{
- SHandlerArgument *theHandlerArgument =
- CSimpleActionCore::GetHandlerArgumentNF(inHandlerArgument, m_Data->m_Objects);
- SAction *theAction = CSimpleActionCore::GetActionNF(
- theHandlerArgument->m_HandlerArgInfo.m_Action, m_Data->m_Objects);
- if (exists(theAction->m_ActionInfo.m_HandlerArgs,
- std::bind(equal_to<Qt3DSDMHandlerArgHandle>(), inHandlerArgument,
- std::placeholders::_1))) {
- CreateVecEraseTransaction<Qt3DSDMHandlerArgHandle>(__FILE__, __LINE__, m_Consumer,
- inHandlerArgument,
- theAction->m_ActionInfo.m_HandlerArgs);
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inHandlerArgument, m_Data->m_Objects);
- }
- m_Data->RemoveHandlerArgument(inHandlerArgument);
- GetSignalSender()->SendHandlerArgumentRemoved(theAction->m_Handle, theHandlerArgument->m_Handle,
- theHandlerArgument->m_HandlerArgInfo.m_Name,
- theHandlerArgument->m_HandlerArgInfo.m_ArgType,
- theHandlerArgument->m_HandlerArgInfo.m_ValueType);
-}
-
-const SHandlerArgumentInfo &
-CActionCoreProducer::GetHandlerArgumentInfo(Qt3DSDMHandlerArgHandle inHandlerArgument) const
-{
- return m_Data->GetHandlerArgumentInfo(inHandlerArgument);
-}
-
-void CActionCoreProducer::GetHandlerArguments(Qt3DSDMActionHandle inAction,
- THandlerArgHandleList &outHandlerArguments) const
-{
- return m_Data->GetHandlerArguments(inAction, outHandlerArguments);
-}
-
-void CActionCoreProducer::GetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument,
- SValue &outValue) const
-{
- return m_Data->GetHandlerArgumentValue(inHandlerArgument, outValue);
-}
-
-void CActionCoreProducer::SetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument,
- const SValue &inValue)
-{
- SHandlerArgument *theHandlerArgument =
- CSimpleActionCore::GetHandlerArgumentNF(inHandlerArgument, m_Data->m_Objects);
- if (m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleActionCore::SetHandlerArgumentValue, m_Data, inHandlerArgument,
- inValue),
- std::bind(&CSimpleActionCore::SetHandlerArgumentValue, m_Data, inHandlerArgument,
- theHandlerArgument->m_HandlerArgInfo.m_Value))));
- }
- m_Data->SetHandlerArgumentValue(inHandlerArgument, inValue);
- GetSignalSender()->SendHandlerArgumentValueSet(inHandlerArgument, inValue);
-}
-
-// CHandleBase
-bool CActionCoreProducer::HandleValid(int inHandle) const
-{
- return m_Data->HandleValid(inHandle);
-}
-
-// ITransactionProducer implementation
-void CActionCoreProducer::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_Consumer = inConsumer;
-}
-
-TSignalConnectionPtr CActionCoreProducer::ConnectTriggerObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback)
-{
- return GetSignalProvider()->ConnectTriggerObjectSet(inCallback);
-}
-TSignalConnectionPtr CActionCoreProducer::ConnectTargetObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback)
-{
- return GetSignalProvider()->ConnectTargetObjectSet(inCallback);
-}
-TSignalConnectionPtr CActionCoreProducer::ConnectEventSet(
- const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback)
-{
- return GetSignalProvider()->ConnectEventSet(inCallback);
-}
-TSignalConnectionPtr CActionCoreProducer::ConnectHandlerSet(
- const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback)
-{
- return GetSignalProvider()->ConnectHandlerSet(inCallback);
-}
-
-TSignalConnectionPtr CActionCoreProducer::ConnectHandlerArgumentAdded(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback)
-{
- return GetSignalProvider()->ConnectHandlerArgumentAdded(inCallback);
-}
-TSignalConnectionPtr CActionCoreProducer::ConnectHandlerArgumentRemoved(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback)
-{
- return GetSignalProvider()->ConnectHandlerArgumentRemoved(inCallback);
-}
-TSignalConnectionPtr CActionCoreProducer::ConnectHandlerArgumentValueSet(
- const std::function<void(Qt3DSDMHandlerArgHandle, const SValue &)> &inCallback)
-{
- return GetSignalProvider()->ConnectHandlerArgumentValueSet(inCallback);
-}
-
-void CActionCoreProducer::InitSignaller()
-{
- m_Signaller = CreateActionCoreSignaller();
-}
-
-IActionCoreSignalProvider *CActionCoreProducer::GetSignalProvider()
-{
- return dynamic_cast<IActionCoreSignalProvider *>(m_Signaller.get());
-}
-
-IActionCoreSignalSender *CActionCoreProducer::GetSignalSender()
-{
- return dynamic_cast<IActionCoreSignalSender *>(m_Signaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.h
deleted file mode 100644
index bf65a387..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/ActionCoreProducer.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef ACTIONCOREPRODUCERH
-#define ACTIONCOREPRODUCERH
-
-#include "SimpleActionCore.h"
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMSignals.h"
-#include "Qt3DSDMStringTable.h"
-
-namespace qt3dsdm {
-class CActionCoreProducer : public IActionCore,
- public ITransactionProducer,
- public IActionCoreSignalProvider
-{
- Q_DISABLE_COPY(CActionCoreProducer)
-
- TSimpleActionCorePtr m_Data;
- TTransactionConsumerPtr m_Consumer;
- TSignalItemPtr m_Signaller;
-
-public:
- CActionCoreProducer(TStringTablePtr inStringTable)
- : m_Data(new CSimpleActionCore(inStringTable))
- {
- InitSignaller();
- }
-
- TSimpleActionCorePtr GetTransactionlessActionCore() const { return m_Data; }
-
- // IActionCore implementation
- IStringTable &GetStringTable() const override { return m_Data->GetStringTable(); }
- TStringTablePtr GetStringTablePtr() const override { return m_Data->GetStringTablePtr(); }
- // Action
- Qt3DSDMActionHandle CreateAction(Qt3DSDMInstanceHandle inInstance, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner, SLong4 inTriggerTargetObjects) override;
- void DeleteAction(Qt3DSDMActionHandle inAction, Qt3DSDMInstanceHandle &outInstance) override;
- const SActionInfo &GetActionInfo(Qt3DSDMActionHandle inAction) const override;
- void GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const override;
- void GetActions(Qt3DSDMSlideHandle inSlide, TActionHandleList &outActions) const override;
- void GetActions(Qt3DSDMInstanceHandle inOwner, TActionHandleList &outActions) const override;
- void GetActions(TActionHandleList &outActions) const override;
- Qt3DSDMInstanceHandle GetActionInstance(Qt3DSDMActionHandle inAction) const override;
- Qt3DSDMActionHandle GetActionByInstance(Qt3DSDMInstanceHandle inActionInstance) const override;
-
- // Action Properties
- void SetTriggerObject(Qt3DSDMActionHandle inAction, const SObjectRefType &inTriggerObject) override;
- void SetTargetObject(Qt3DSDMActionHandle inAction, const SObjectRefType &inTargetObject) override;
- void SetEvent(Qt3DSDMActionHandle inAction, const wstring &inEventHandle) override;
- void SetHandler(Qt3DSDMActionHandle inAction, const wstring &inHandlerHandle) override;
-
- // Action Argument
- Qt3DSDMHandlerArgHandle AddHandlerArgument(Qt3DSDMActionHandle inAction, const TCharStr &inName,
- HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) override;
- void RemoveHandlerArgument(Qt3DSDMHandlerArgHandle inHandlerArgument) override;
- const SHandlerArgumentInfo &
- GetHandlerArgumentInfo(Qt3DSDMHandlerArgHandle inHandlerArgument) const override;
- void GetHandlerArguments(Qt3DSDMActionHandle inAction,
- THandlerArgHandleList &outHandlerArguments) const override;
-
- // Action Argument Properties
- void GetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument, SValue &outValue) const override;
- void SetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument, const SValue &inValue) override;
-
- // CHandleBase
- bool HandleValid(int inHandle) const override;
-
- // ITransactionProducer implementation
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-
- TSignalConnectionPtr ConnectTriggerObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback) override;
- TSignalConnectionPtr ConnectTargetObjectSet(
- const std::function<void(Qt3DSDMActionHandle, SObjectRefType &)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectEventSet(const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectHandlerSet(const std::function<void(Qt3DSDMActionHandle, const wstring &)> &inCallback) override;
-
- TSignalConnectionPtr ConnectHandlerArgumentAdded(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback) override;
- TSignalConnectionPtr ConnectHandlerArgumentRemoved(
- const std::function<void(Qt3DSDMActionHandle, Qt3DSDMHandlerArgHandle, const TCharStr &,
- HandlerArgumentType::Value, DataModelDataType::Value)> &inCallback) override;
- TSignalConnectionPtr ConnectHandlerArgumentValueSet(
- const std::function<void(Qt3DSDMHandlerArgHandle, const SValue &)> &inCallback) override;
-
-private:
- void InitSignaller();
- IActionCoreSignalProvider *GetSignalProvider();
- IActionCoreSignalSender *GetSignalSender();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.cpp
deleted file mode 100644
index 14d18240..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.cpp
+++ /dev/null
@@ -1,488 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "AnimationCoreProducer.h"
-#include "HandleSystemTransactions.h"
-#include "VectorTransactions.h"
-#include "SignalsImpl.h"
-#ifdef _WIN32
-#pragma warning(disable : 4512) // assignment operator not generated
-#endif
-
-using namespace std;
-
-namespace qt3dsdm {
-
-struct SArtistEditedUndoRedoScope
-{
- TSimpleAnimationCorePtr m_AnimationCore;
- Qt3DSDMAnimationHandle m_Animation;
- TTransactionConsumerPtr m_Consumer;
- bool m_ArtistEdited;
- SArtistEditedUndoRedoScope(TSimpleAnimationCorePtr inAnimCore, Qt3DSDMAnimationHandle inAnim,
- TTransactionConsumerPtr inConsumer)
- : m_AnimationCore(inAnimCore)
- , m_Animation(inAnim)
- , m_Consumer(inConsumer)
- , m_ArtistEdited(inAnimCore->IsArtistEdited(inAnim))
- {
- }
- ~SArtistEditedUndoRedoScope()
- {
- bool edited = m_AnimationCore->IsArtistEdited(m_Animation);
- if (m_Consumer && edited != m_ArtistEdited) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleAnimationCore::SetIsArtistEdited, m_AnimationCore, m_Animation,
- edited),
- std::bind(&CSimpleAnimationCore::SetIsArtistEdited, m_AnimationCore, m_Animation,
- m_ArtistEdited))));
- }
- }
-};
-
-struct SLookupCacheDoUndoOp : public ITransaction
-{
- std::shared_ptr<SAnimationTrack> m_Animation;
- TSimpleAnimationCorePtr m_AnimationCore;
- bool m_AddOnDo;
- SLookupCacheDoUndoOp(const char *inFile, int inLine, Qt3DSDMAnimationHandle inAnimHandle,
- TSimpleAnimationCorePtr inCore, bool addOnDo)
- : ITransaction(inFile, inLine)
- , m_AnimationCore(inCore)
- , m_AddOnDo(addOnDo)
- {
- THandleObjectMap::const_iterator theIter(inCore->m_Objects.find(inAnimHandle));
- if (theIter != inCore->m_Objects.end())
- m_Animation = static_pointer_cast<SAnimationTrack>(theIter->second);
- }
- void Remove()
- {
- if (m_Animation)
- m_AnimationCore->RemoveAnimationFromLookupCache(m_Animation);
- }
- void Add()
- {
- if (m_Animation)
- m_AnimationCore->AddAnimationToLookupCache(m_Animation);
- }
- void Do() override
- {
- if (m_AddOnDo)
- Add();
- else
- Remove();
- }
- void Undo() override
- {
- if (m_AddOnDo)
- Remove();
- else
- Add();
- }
-};
-
-Qt3DSDMAnimationHandle
-CAnimationCoreProducer::CreateAnimation(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType, bool inFirstKeyframeDynamic)
-{
- Qt3DSDMAnimationHandle retval = m_Data->CreateAnimation(inSlide, inInstance, inProperty, inIndex,
- inAnimationType, inFirstKeyframeDynamic);
-
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- if (m_Consumer)
- m_Consumer->OnTransaction(
- std::make_shared<SLookupCacheDoUndoOp>(__FILE__, __LINE__, retval, m_Data, true));
- GetSignalSender()->SendAnimationCreated(retval, inSlide, inInstance, inProperty, inIndex,
- inAnimationType);
- return retval;
-}
-
-void CAnimationCoreProducer::DeleteAnimation(Qt3DSDMAnimationHandle inAnimation)
-{
- // Ensure animation exists
- SAnimationTrack *theAnimation =
- CSimpleAnimationCore::GetAnimationNF(inAnimation, m_Data->m_Objects);
- GetSignalSender()->SendBeforeAnimationDeleted(inAnimation);
- if (m_Consumer)
- m_Consumer->OnTransaction(std::make_shared<SLookupCacheDoUndoOp>(
- __FILE__, __LINE__, inAnimation, m_Data, false));
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inAnimation, m_Data->m_Objects);
- do_all(theAnimation->m_Keyframes,
- std::bind(DoCreateHandleDeleteTransaction, __FILE__, __LINE__, m_Consumer,
- std::placeholders::_1, std::ref(m_Data->m_Objects)));
- SAnimationInfo theInfo = m_Data->GetAnimationInfo(inAnimation);
- m_Data->DeleteAnimation(inAnimation);
- GetSignalSender()->SendAnimationDeleted(inAnimation, theInfo.m_Slide, theInfo.m_Instance,
- theInfo.m_Property, theInfo.m_Index,
- theInfo.m_AnimationType);
-}
-
-Qt3DSDMAnimationHandle CAnimationCoreProducer::GetAnimation(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- size_t inIndex) const
-{
- return m_Data->GetAnimation(inSlide, inInstance, inProperty, inIndex);
-}
-
-SAnimationInfo CAnimationCoreProducer::GetAnimationInfo(Qt3DSDMAnimationHandle inAnimation) const
-{
- return m_Data->GetAnimationInfo(inAnimation);
-}
-
-void CAnimationCoreProducer::GetAnimations(TAnimationHandleList &outAnimations) const
-{
- return m_Data->GetAnimations(outAnimations);
-}
-
-void CAnimationCoreProducer::GetAnimations(TAnimationInfoList &outAnimations,
- Qt3DSDMSlideHandle inMaster,
- Qt3DSDMSlideHandle inSlide) const
-{
- return m_Data->GetAnimations(outAnimations, inMaster, inSlide);
-}
-
-void CAnimationCoreProducer::SetFirstKeyframeDynamic(Qt3DSDMAnimationHandle inAnimation,
- bool inValue)
-{
- SAnimationInfo theInfo(m_Data->GetAnimationInfo(inAnimation));
- SArtistEditedUndoRedoScope __editedScope(m_Data, inAnimation, m_Consumer);
- if (m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSimpleAnimationCore::SetFirstKeyframeDynamic, m_Data, inAnimation,
- inValue),
- std::bind(&CSimpleAnimationCore::SetFirstKeyframeDynamic, m_Data, inAnimation,
- theInfo.m_DynamicFirstKeyframe))));
- }
- m_Data->SetFirstKeyframeDynamic(inAnimation, inValue);
- GetSignalSender()->SendFirstKeyframeDynamicSet(inAnimation, inValue);
-}
-
-inline void DirtyKeyframes(Qt3DSDMAnimationHandle inAnimation, THandleObjectMap &inObjects)
-{
- SAnimationTrack *theAnimation = CSimpleAnimationCore::GetAnimationNF(inAnimation, inObjects);
- theAnimation->m_KeyframesDirty = true;
-}
-
-inline void CreateDirtyKeyframesTransaction(TTransactionConsumerPtr inConsumer,
- Qt3DSDMAnimationHandle inAnimation,
- THandleObjectMap &inObjects)
-{
- if (inConsumer) {
- inConsumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(DirtyKeyframes, inAnimation, std::ref(inObjects)),
- std::bind(DirtyKeyframes, inAnimation, std::ref(inObjects)))));
- }
-}
-
-Qt3DSDMKeyframeHandle CAnimationCoreProducer::InsertKeyframe(Qt3DSDMAnimationHandle inAnimation,
- const TKeyframe &inKeyframe)
-{
- SArtistEditedUndoRedoScope __editedScope(m_Data, inAnimation, m_Consumer);
- Qt3DSDMKeyframeHandle retval = m_Data->InsertKeyframe(inAnimation, inKeyframe);
- SAnimationTrack *theAnimation =
- CSimpleAnimationCore::GetAnimationNF(inAnimation, m_Data->m_Objects);
- CreateVecInsertTransaction<Qt3DSDMKeyframeHandle>(__FILE__, __LINE__, m_Consumer, retval,
- theAnimation->m_Keyframes);
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- CreateDirtyKeyframesTransaction(m_Consumer, inAnimation, m_Data->m_Objects);
- GetSignalSender()->SendKeyframeInserted(inAnimation, retval, inKeyframe);
- return retval;
-}
-
-void CAnimationCoreProducer::EraseKeyframe(Qt3DSDMKeyframeHandle inKeyframe)
-{
- SKeyframe *theKeyframe = CSimpleAnimationCore::GetKeyframeNF(inKeyframe, m_Data->m_Objects);
- SArtistEditedUndoRedoScope __editedScope(m_Data, theKeyframe->m_Animation, m_Consumer);
- GetSignalSender()->SendBeforeKeyframeErased(inKeyframe);
- SAnimationTrack *theAnimation =
- CSimpleAnimationCore::GetAnimationNF(theKeyframe->m_Animation, m_Data->m_Objects);
- if (exists(theAnimation->m_Keyframes, std::bind(equal_to<int>(), inKeyframe,
- std::placeholders::_1))) {
- CreateVecEraseTransaction<Qt3DSDMKeyframeHandle>(__FILE__, __LINE__, m_Consumer, inKeyframe,
- theAnimation->m_Keyframes);
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inKeyframe, m_Data->m_Objects);
- CreateDirtyKeyframesTransaction(m_Consumer, theKeyframe->m_Animation, m_Data->m_Objects);
- }
- int theKeyframeHandle = theKeyframe->m_Handle;
- TKeyframe theData = theKeyframe->m_Keyframe;
- m_Data->EraseKeyframe(inKeyframe);
- GetSignalSender()->SendKeyframeErased(theAnimation->m_Handle, theKeyframeHandle, theData);
-}
-
-template <typename TDataType>
-struct VectorSwapTransaction : public ITransaction
-{
- vector<TDataType> m_Data;
- vector<TDataType> &m_Target;
- VectorSwapTransaction(const char *inFile, int inLine, vector<TDataType> &inTarget)
- : ITransaction(inFile, inLine)
- , m_Data(inTarget)
- , m_Target(inTarget)
- {
- }
- void Do() override { std::swap(m_Data, m_Target); }
- void Undo() override { Do(); }
-};
-
-void CAnimationCoreProducer::DeleteAllKeyframes(Qt3DSDMAnimationHandle inAnimation)
-{
- // Ensure animation exists
- SAnimationTrack *theAnimation =
- CSimpleAnimationCore::GetAnimationNF(inAnimation, m_Data->m_Objects);
- SArtistEditedUndoRedoScope __editedScope(m_Data, inAnimation, m_Consumer);
- GetSignalSender()->SendBeforeAllKeyframesErased(inAnimation);
- do_all(theAnimation->m_Keyframes,
- std::bind(DoCreateHandleDeleteTransaction, __FILE__, __LINE__, m_Consumer,
- std::placeholders::_1, std::ref(m_Data->m_Objects)));
- if (m_Consumer)
- m_Consumer->OnTransaction(std::make_shared<VectorSwapTransaction<Qt3DSDMKeyframeHandle>>(
- __FILE__, __LINE__, std::ref(theAnimation->m_Keyframes)));
- theAnimation->m_Keyframes.clear();
-}
-
-Qt3DSDMAnimationHandle
-CAnimationCoreProducer::GetAnimationForKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- return m_Data->GetAnimationForKeyframe(inKeyframe);
-}
-
-struct KeyframeDataTransaction : public ITransaction, public IMergeableTransaction<TKeyframe>
-{
- TSimpleAnimationCorePtr m_AnimationCore;
- Qt3DSDMKeyframeHandle m_Keyframe;
- TKeyframe m_OldData;
- TKeyframe m_NewData;
-
- KeyframeDataTransaction(const char *inFile, int inLine, TSimpleAnimationCorePtr animCore,
- Qt3DSDMKeyframeHandle keyframe, TKeyframe oldData, TKeyframe newData)
- : ITransaction(inFile, inLine)
- , m_AnimationCore(animCore)
- , m_Keyframe(keyframe)
- , m_OldData(oldData)
- , m_NewData(newData)
- {
- }
-
- void Do() override { m_AnimationCore->DoSetKeyframeData(m_Keyframe, m_NewData); }
- void Undo() override { m_AnimationCore->DoSetKeyframeData(m_Keyframe, m_OldData); }
-
- void Update(const TKeyframe &inKeyframe) override { m_NewData = inKeyframe; }
-};
-
-void CAnimationCoreProducer::SetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe,
- const TKeyframe &inData)
-{
- SKeyframe *theKeyframe = CSimpleAnimationCore::GetKeyframeNF(inKeyframe, m_Data->m_Objects);
- SArtistEditedUndoRedoScope __editedScope(m_Data, theKeyframe->m_Animation, m_Consumer);
- TKeyframe theNewData(inData);
- TKeyframe theOldData = theKeyframe->m_Keyframe;
- m_Data->SetKeyframeData(inKeyframe, inData);
- TKeyframeDataMergeMap::iterator iter(m_KeyframeMergeMap.find(inKeyframe));
- if (iter != m_KeyframeMergeMap.end())
- iter->second->Update(theNewData);
- else {
- if (m_Consumer) {
- std::shared_ptr<KeyframeDataTransaction> theKeyframeTransaction(
- std::make_shared<KeyframeDataTransaction>(__FILE__, __LINE__, m_Data, inKeyframe,
- theOldData, theNewData));
- m_Consumer->OnTransaction(static_pointer_cast<ITransaction>(theKeyframeTransaction));
- m_KeyframeMergeMap.insert(make_pair(
- inKeyframe,
- static_pointer_cast<IMergeableTransaction<TKeyframe>>(theKeyframeTransaction)));
- }
- GetSignalSender()->SendKeyframeUpdated(inKeyframe, inData);
- }
-}
-
-TKeyframe CAnimationCoreProducer::GetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- return m_Data->GetKeyframeData(inKeyframe);
-}
-
-void CAnimationCoreProducer::GetKeyframes(Qt3DSDMAnimationHandle inAnimation,
- TKeyframeHandleList &outKeyframes) const
-{
- return m_Data->GetKeyframes(inAnimation, outKeyframes);
-}
-
-size_t CAnimationCoreProducer::GetKeyframeCount(Qt3DSDMAnimationHandle inAnimation) const
-{
- return m_Data->GetKeyframeCount(inAnimation);
-}
-
-void CAnimationCoreProducer::OffsetAnimations(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- long inMillisecondOffset)
-{
- float theOffsetSeconds = static_cast<float>(inMillisecondOffset) / 1000.f;
- for (THandleObjectMap::const_iterator iter = m_Data->m_Objects.begin(),
- end = m_Data->m_Objects.end();
- iter != end; ++iter) {
- SAnimationTrack *theTrack = static_cast<SAnimationTrack *>(iter->second.get());
- if (theTrack->m_Slide == inSlide && theTrack->m_Instance == inInstance) {
- for (size_t keyframeIdx = 0, keyframeEnd = theTrack->m_Keyframes.size();
- keyframeIdx < keyframeEnd; ++keyframeIdx) {
- Qt3DSDMKeyframeHandle theKeyframeHandle(theTrack->m_Keyframes[keyframeIdx]);
- TKeyframe theCurrentKeyframe = m_Data->GetKeyframeData(theKeyframeHandle);
-
- float seconds = qt3dsdm::GetKeyframeSeconds(theCurrentKeyframe);
-
- theCurrentKeyframe =
- qt3dsdm::SetKeyframeSeconds(theCurrentKeyframe, seconds + theOffsetSeconds);
-
- SetKeyframeData(theKeyframeHandle, theCurrentKeyframe);
- }
- }
- }
-}
-
-void CAnimationCoreProducer::SetIsArtistEdited(Qt3DSDMAnimationHandle inAnimation, bool inEdited)
-{
- SArtistEditedUndoRedoScope __editedScope(m_Data, inAnimation, m_Consumer);
- m_Data->SetIsArtistEdited(inAnimation, inEdited);
-}
-
-bool CAnimationCoreProducer::IsArtistEdited(Qt3DSDMAnimationHandle inAnimation) const
-{
- return m_Data->IsArtistEdited(inAnimation);
-}
-// Animation Evaluation.
-float CAnimationCoreProducer::EvaluateAnimation(Qt3DSDMAnimationHandle inAnimation,
- float inSeconds) const
-{
- return m_Data->EvaluateAnimation(inAnimation, inSeconds);
-}
-
-bool CAnimationCoreProducer::KeyframeValid(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- return m_Data->KeyframeValid(inKeyframe);
-}
-
-bool CAnimationCoreProducer::AnimationValid(Qt3DSDMAnimationHandle inAnimation) const
-{
- return m_Data->AnimationValid(inAnimation);
-}
-
-void CAnimationCoreProducer::CopyAnimations(Qt3DSDMSlideHandle inSourceSlide,
- Qt3DSDMInstanceHandle inSourceInstance,
- Qt3DSDMSlideHandle inDestSlide,
- Qt3DSDMInstanceHandle inDestInstance)
-{
- std::vector<SAnimationTrack *> theAnimations;
- for (THandleObjectMap::const_iterator iter = m_Data->m_Objects.begin(),
- end = m_Data->m_Objects.end();
- iter != end; ++iter) {
- SAnimationTrack *theTrack = static_cast<SAnimationTrack *>(iter->second.get());
- if (theTrack->m_Instance == inSourceInstance && theTrack->m_Slide == inSourceSlide)
- theAnimations.push_back(theTrack);
- }
- for (size_t idx = 0, end = theAnimations.size(); idx < end; ++idx) {
- const SAnimationTrack &newTrack(*theAnimations[idx]);
- Qt3DSDMAnimationHandle theNewAnimation(
- CreateAnimation(inDestSlide, inDestInstance, newTrack.m_Property, newTrack.m_Index,
- newTrack.m_AnimationType, newTrack.m_FirstKeyframeDynamic));
- for (size_t keyIdx = 0, keyEnd = newTrack.m_Keyframes.size(); keyIdx < keyEnd; ++keyIdx)
- InsertKeyframe(theNewAnimation, GetKeyframeData(newTrack.m_Keyframes[keyIdx]));
- }
-}
-
-// ITransactionProducer implementation
-void CAnimationCoreProducer::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_Consumer = inConsumer;
- m_KeyframeMergeMap.clear();
-}
-
-TSignalConnectionPtr CAnimationCoreProducer::ConnectAnimationCreated(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback)
-{
- return GetSignalProvider()->ConnectAnimationCreated(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectBeforeAnimationDeleted(
- const std::function<void(Qt3DSDMAnimationHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectBeforeAnimationDeleted(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectAnimationDeleted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback)
-{
- return GetSignalProvider()->ConnectAnimationDeleted(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectKeyframeInserted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback)
-{
- return GetSignalProvider()->ConnectKeyframeInserted(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectBeforeKeyframeErased(
- const std::function<void(Qt3DSDMKeyframeHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectBeforeKeyframeErased(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectKeyframeErased(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback)
-{
- return GetSignalProvider()->ConnectKeyframeErased(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectBeforeAllKeyframesErased(
- const std::function<void(Qt3DSDMAnimationHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectBeforeAllKeyframesErased(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectKeyframeUpdated(
- const std::function<void(Qt3DSDMKeyframeHandle, const TKeyframe &)> &inCallback)
-{
- return GetSignalProvider()->ConnectKeyframeUpdated(inCallback);
-}
-TSignalConnectionPtr CAnimationCoreProducer::ConnectFirstKeyframeDynamicSet(
- const std::function<void(Qt3DSDMAnimationHandle, bool)> &inCallback)
-{
- return GetSignalProvider()->ConnectFirstKeyframeDynamicSet(inCallback);
-}
-
-void CAnimationCoreProducer::InitSignaller()
-{
- m_Signaller = CreateAnimationCoreSignaller();
-}
-
-IAnimationCoreSignalProvider *CAnimationCoreProducer::GetSignalProvider()
-{
- return dynamic_cast<IAnimationCoreSignalProvider *>(m_Signaller.get());
-}
-
-IAnimationCoreSignalSender *CAnimationCoreProducer::GetSignalSender()
-{
- return dynamic_cast<IAnimationCoreSignalSender *>(m_Signaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.h
deleted file mode 100644
index 17603d64..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/AnimationCoreProducer.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef ANIMATIONCOREPRODUCERH
-#define ANIMATIONCOREPRODUCERH
-#include "SimpleAnimationCore.h"
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMSignals.h"
-
-namespace qt3dsdm {
-class CAnimationCoreProducer : public IAnimationCore,
- public ITransactionProducer,
- public IAnimationCoreSignalProvider
-{
- Q_DISABLE_COPY(CAnimationCoreProducer)
-
- typedef std::shared_ptr<IMergeableTransaction<TKeyframe>> TKeyframeDataMergeMapEntry;
- typedef std::unordered_map<int, TKeyframeDataMergeMapEntry> TKeyframeDataMergeMap;
-
- TSimpleAnimationCorePtr m_Data;
- TTransactionConsumerPtr m_Consumer;
- TSignalItemPtr m_Signaller;
- TKeyframeDataMergeMap m_KeyframeMergeMap;
-
-public:
- CAnimationCoreProducer()
- : m_Data(new CSimpleAnimationCore())
- {
- InitSignaller();
- }
- CAnimationCoreProducer(TStringTablePtr strTable)
- : m_Data(new CSimpleAnimationCore(strTable))
- {
- InitSignaller();
- }
-
- TSimpleAnimationCorePtr GetTransactionlessAnimationCore() const { return m_Data; }
-
- // IAnimationManger implementation
-
- Qt3DSDMAnimationHandle CreateAnimation(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic) override;
- void DeleteAnimation(Qt3DSDMAnimationHandle inAnimation) override;
- Qt3DSDMAnimationHandle GetAnimation(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex) const override;
- SAnimationInfo GetAnimationInfo(Qt3DSDMAnimationHandle inAnimation) const override;
- void GetAnimations(TAnimationHandleList &outAnimations) const override;
- void GetAnimations(TAnimationInfoList &outAnimations, Qt3DSDMSlideHandle inMaster,
- Qt3DSDMSlideHandle inSlide) const override;
- void GetSpecificInstanceAnimations(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- TAnimationHandleList &outAnimations) override
- {
- m_Data->GetSpecificInstanceAnimations(inSlide, inInstance, outAnimations);
- }
-
- void SetFirstKeyframeDynamic(Qt3DSDMAnimationHandle inAnimation, bool inValue) override;
-
- Qt3DSDMKeyframeHandle InsertKeyframe(Qt3DSDMAnimationHandle inAnimation,
- const TKeyframe &inKeyframe) override;
- void EraseKeyframe(Qt3DSDMKeyframeHandle) override;
- void DeleteAllKeyframes(Qt3DSDMAnimationHandle inAnimation) override;
- Qt3DSDMAnimationHandle GetAnimationForKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const override;
- TKeyframe GetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe) const override;
- void SetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) override;
- void GetKeyframes(Qt3DSDMAnimationHandle inAnimation, TKeyframeHandleList &outKeyframes) const override;
- size_t GetKeyframeCount(Qt3DSDMAnimationHandle inAnimation) const override;
- bool IsFirstKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const override
- {
- return m_Data->IsFirstKeyframe(inKeyframe);
- }
- void OffsetAnimations(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- long inMillisecondOffset) override;
-
- void SetIsArtistEdited(Qt3DSDMAnimationHandle inAnimation, bool inEdited = true) override;
- bool IsArtistEdited(Qt3DSDMAnimationHandle inAnimation) const override;
-
- // Animation Evaluation.
- float EvaluateAnimation(Qt3DSDMAnimationHandle inAnimation, float inSeconds) const override;
-
- bool KeyframeValid(Qt3DSDMKeyframeHandle inKeyframe) const override;
- bool AnimationValid(Qt3DSDMAnimationHandle inAnimation) const override;
-
- void CopyAnimations(Qt3DSDMSlideHandle inSourceSlide, Qt3DSDMInstanceHandle inSourceInstance,
- Qt3DSDMSlideHandle inDestSlide, Qt3DSDMInstanceHandle inDestInstance) override;
-
- // ITransactionProducer implementation
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-
- TSignalConnectionPtr ConnectAnimationCreated(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectBeforeAnimationDeleted(const std::function<void(Qt3DSDMAnimationHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectAnimationDeleted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle, size_t, EAnimationType)> &inCallback) override;
- TSignalConnectionPtr ConnectKeyframeInserted(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectBeforeKeyframeErased(const std::function<void(Qt3DSDMKeyframeHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectKeyframeErased(
- const std::function<void(Qt3DSDMAnimationHandle, Qt3DSDMKeyframeHandle, const TKeyframe &)>
- &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectBeforeAllKeyframesErased(const std::function<void(Qt3DSDMAnimationHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectKeyframeUpdated(
- const std::function<void(Qt3DSDMKeyframeHandle, const TKeyframe &)> &inCallback) override;
- TSignalConnectionPtr ConnectFirstKeyframeDynamicSet(
- const std::function<void(Qt3DSDMAnimationHandle, bool)> &inCallback) override;
-
-private:
- void InitSignaller();
- IAnimationCoreSignalProvider *GetSignalProvider();
- IAnimationCoreSignalSender *GetSignalSender();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.cpp
deleted file mode 100644
index 5c3cc924..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "DataCoreProducer.h"
-#include "HandleSystemTransactions.h"
-#include "VectorTransactions.h"
-#include "SignalsImpl.h"
-#ifdef _WIN32
-#pragma warning(disable : 4503) // decorated name length exceeded
-#endif
-namespace qt3dsdm {
-
-Qt3DSDMInstanceHandle CDataCoreProducer::CreateInstance(Qt3DSDMInstanceHandle inTargetId)
-{
- Qt3DSDMInstanceHandle retval = m_Data->CreateInstance(inTargetId);
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- GetDataCoreSender()->SignalInstanceCreated(retval);
- return retval;
-}
-
-inline tuple<Qt3DSDMPropertyHandle, Qt3DSDMPropertyDefinition>
-TransformProperty(Qt3DSDMPropertyHandle inProperty, CSimpleDataCore &inData)
-{
- return make_tuple(inProperty, inData.GetProperty(inProperty));
-}
-
-inline void SignalPropertyRemoved(Qt3DSDMInstanceHandle inInstance,
- tuple<Qt3DSDMPropertyHandle, Qt3DSDMPropertyDefinition> inData,
- IDataCoreSignalSender *inSender)
-{
- inSender->SignalPropertyRemoved(inInstance, get<0>(inData), get<1>(inData).m_Name.wide_str(),
- get<1>(inData).m_Type);
-}
-
-void CDataCoreProducer::DeleteInstance(Qt3DSDMInstanceHandle inInstance)
-{
- TIntList theProperties;
- TIntList theInstances;
-
- GetDataCoreSender()->SignalBeforeInstanceDeleted(inInstance);
- // Ensure the instance exists
- m_Data->GetInstanceNF(inInstance, m_Data->m_Objects);
- do_all(m_Data->m_Objects,
- std::bind(CSimpleDataCore::FindRelatedItemsForDelete, inInstance.GetHandleValue(),
- std::ref(theProperties), std::ref(theInstances), std::placeholders::_1));
-
- if (m_Consumer) {
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inInstance, m_Data->m_Objects);
- do_all(theProperties, std::bind(HandleDeleteTransaction, __FILE__, __LINE__,
- std::placeholders::_1,
- std::ref(m_Data->m_Objects), m_Consumer));
- }
-
- vector<tuple<Qt3DSDMPropertyHandle, Qt3DSDMPropertyDefinition>> theDefinitionList;
- theDefinitionList.resize(theProperties.size());
-
- function<tuple<Qt3DSDMPropertyHandle, Qt3DSDMPropertyDefinition>(Qt3DSDMPropertyHandle)>
- thePropertyTransform(bind(TransformProperty, std::placeholders::_1, ref(*m_Data)));
- transform(theProperties.begin(), theProperties.end(), theDefinitionList.begin(),
- thePropertyTransform);
-
- GetDataCoreSender()->SignalInstanceDeleted(inInstance);
-
- m_Data->DeleteInstance(inInstance);
- // Signal that these theProperties are no longer with us.
- do_all(theDefinitionList, bind(SignalPropertyRemoved, inInstance,
- std::placeholders::_1, GetDataCoreSender()));
-}
-
-bool CDataCoreProducer::IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const
-{
- return m_Data->IsInstanceOrDerivedFrom(inInstance, inParent);
-}
-
-void CDataCoreProducer::GetInstances(TInstanceHandleList &outInstances) const
-{
- m_Data->GetInstances(outInstances);
-}
-void CDataCoreProducer::GetInstancesDerivedFrom(TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParentHandle) const
-{
- m_Data->GetInstancesDerivedFrom(outInstances, inParentHandle);
-}
-
-struct ClearInstanceParentCacheTransaction : public ITransaction
-{
- const CDataModelInstance &m_Instance;
- ClearInstanceParentCacheTransaction(const char *inFile, int inLine,
- const CDataModelInstance &inst)
- : ITransaction(inFile, inLine)
- , m_Instance(inst)
- {
- }
- void Do() override { m_Instance.ClearParentCache(); }
- void Undo() override { m_Instance.ClearParentCache(); }
-};
-
-void CDataCoreProducer::DeriveInstance(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent)
-{
- m_Data->DeriveInstance(inInstance, inParent);
- TDataModelInstancePtr theInstance =
- CSimpleDataCore::GetInstanceNF(inInstance, m_Data->m_Objects);
- if (m_Consumer) {
- CreateHashMapInsertTransaction(
- __FILE__, __LINE__, m_Consumer,
- make_pair(inParent.GetHandleValue(),
- CSimpleDataCore::GetInstanceNF(inParent, m_Data->m_Objects)),
- theInstance->m_Parents);
- m_Consumer->OnTransaction(std::static_pointer_cast<ITransaction>(
- std::make_shared<ClearInstanceParentCacheTransaction>(__FILE__, __LINE__,
- *theInstance)));
- }
- GetDataCoreSender()->SignalInstanceDerived(inInstance, inParent);
-}
-
-void CDataCoreProducer::GetInstanceParents(Qt3DSDMInstanceHandle inHandle,
- TInstanceHandleList &outParents) const
-{
- m_Data->GetInstanceParents(inHandle, outParents);
-}
-
-Qt3DSDMPropertyHandle CDataCoreProducer::AddProperty(Qt3DSDMInstanceHandle inInstance,
- TCharPtr inName, DataModelDataType::Value inPropType)
-{
- Qt3DSDMPropertyHandle retval = m_Data->AddProperty(inInstance, inName, inPropType);
- TDataModelInstancePtr theInstance =
- CSimpleDataCore::GetInstanceNF(inInstance, m_Data->m_Objects);
- CreateVecInsertTransaction<int>(__FILE__, __LINE__, m_Consumer, retval,
- theInstance->m_Properties);
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- GetDataCoreSender()->SignalPropertyAdded(inInstance, retval, inName, inPropType);
- return retval;
-}
-
-void CDataCoreProducer::GetInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const
-{
- m_Data->GetInstanceProperties(inInstance, outProperties);
-}
-
-const Qt3DSDMPropertyDefinition &
-CDataCoreProducer::GetProperty(Qt3DSDMPropertyHandle inProperty) const
-{
- return m_Data->GetProperty(inProperty);
-}
-
-void CDataCoreProducer::RemoveProperty(Qt3DSDMPropertyHandle inProperty)
-{
- Qt3DSDMPropertyDefinition theDef = GetProperty(inProperty);
- TDataModelInstancePtr theInstance =
- CSimpleDataCore::GetInstanceNF(theDef.m_Instance, m_Data->m_Objects);
- if (find_if<TIntList::iterator>(theInstance->m_Properties,
- std::bind(equal_to<int>(), inProperty, std::placeholders::_1))
- != theInstance->m_Properties.end()) {
- CreateVecEraseTransaction<int>(__FILE__, __LINE__, m_Consumer, inProperty,
- theInstance->m_Properties);
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inProperty, m_Data->m_Objects);
- GetDataCoreSender()->SignalPropertyRemoved(theDef.m_Instance, inProperty,
- theDef.m_Name.wide_str(), theDef.m_Type);
- m_Data->RemoveProperty(inProperty);
- } else {
- throw PropertyNotFound(L"");
- }
-}
-
-inline void AddCopyInstancePropertyTransaction(int inProperty, const TIntList &inOriginalList,
- CDataModelInstance &inInstance,
- TTransactionConsumerPtr &inConsumer)
-{
- // if this property was never in the original list
- if (find_if<TIntList::const_iterator>(inOriginalList,
- std::bind(equal_to<int>(), inProperty,
- std::placeholders::_1))
- == inOriginalList.end())
- CreateVecInsertTransaction<int>(__FILE__, __LINE__, inConsumer,
- Qt3DSDMPropertyHandle(inProperty), inInstance.m_Properties);
-}
-
-inline void AddCopyInstanceValuePropertyTransaction(const TPropertyPair &inProperty,
- const TPropertyPairHash &inOriginalList,
- CDataModelInstance &inInstance,
- TTransactionConsumerPtr &inConsumer)
-{
- // if this property was never in the original list
- if (inOriginalList.end() == inOriginalList.find(inProperty.first))
- CreateHashMapInsertTransaction(__FILE__, __LINE__, inConsumer, inProperty,
- inInstance.m_PropertyValues);
-}
-
-struct InstancePropertyValuesTransaction : public ITransaction
-{
- CDataModelInstance &m_Instance;
- TIntList m_OldProperties;
- TPropertyPairList m_OldValues;
- TIntList m_NewProperties;
- TPropertyPairList m_NewValues;
-
- InstancePropertyValuesTransaction(const char *inFile, int inLine,
- CDataModelInstance &inInstance)
- : ITransaction(inFile, inLine)
- , m_Instance(inInstance)
- , m_OldProperties(inInstance.m_Properties)
- {
- inInstance.ToPropertyPairList(m_OldValues);
- }
-
- void SetNew()
- {
- m_NewProperties = m_Instance.m_Properties;
- m_Instance.ToPropertyPairList(m_NewValues);
- }
-
- void Do() override
- {
- m_Instance.m_Properties = m_NewProperties;
- m_Instance.FromPropertyPairList(m_NewValues);
- }
-
- void Undo() override
- {
- m_Instance.m_Properties = m_OldProperties;
- m_Instance.FromPropertyPairList(m_OldValues);
- }
-};
-
-void CDataCoreProducer::CopyInstanceProperties(Qt3DSDMInstanceHandle inSrcInstance,
- Qt3DSDMInstanceHandle inDestInstance)
-{
- TDataModelInstancePtr theInstance =
- CSimpleDataCore::GetInstanceNF(inDestInstance, m_Data->m_Objects);
- if (m_Consumer) {
- // Create the transaction object setting its 'old values' property to the current instance
- // property values.
- std::shared_ptr<InstancePropertyValuesTransaction> theTransaction(
- std::make_shared<InstancePropertyValuesTransaction>(__FILE__, __LINE__,
- ref(*theInstance)));
-
- // Change the current instance property values
- m_Data->CopyInstanceProperties(inSrcInstance, inDestInstance);
-
- // Ask the transaction to copy the new values into it's new values datastructure.
- theTransaction->SetNew();
-
- m_Consumer->OnTransaction(std::static_pointer_cast<ITransaction>(theTransaction));
- } else {
- m_Data->CopyInstanceProperties(inSrcInstance, inDestInstance);
- }
-}
-
-Qt3DSDMPropertyHandle
-CDataCoreProducer::GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const
-{
- return m_Data->GetAggregateInstancePropertyByName(inInstance, inStr);
-}
-
-void CDataCoreProducer::GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const
-{
- m_Data->GetAggregateInstanceProperties(inInstance, outProperties);
-}
-
-void CDataCoreProducer::GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inHandle,
- TPropertyHandleValuePairList &outValues)
-{
- m_Data->GetSpecificInstancePropertyValues(inHandle, outValues);
-}
-
-bool CDataCoreProducer::HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- return m_Data->HasAggregateInstanceProperty(inInstance, inProperty);
-}
-
-void CDataCoreProducer::CheckValue(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) const
-{
- return m_Data->CheckValue(inInstance, inProperty, inValue);
-}
-
-bool CDataCoreProducer::GetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- return m_Data->GetInstancePropertyValue(inHandle, inProperty, outValue);
-}
-
-inline void EraseProperty(TPropertyPairHash &inProperties, int inProperty)
-{
- inProperties.erase(
- find_if(inProperties.begin(), inProperties.end(),
- std::bind(CSimpleDataCore::InstancePropertyMatches, inProperty,
- std::placeholders::_1)));
-}
-
-void CDataCoreProducer::SetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- // Two possible courses of actions. The property exists, in which case
- // we need to get its old value.
- // If it doesn't exist, then we need to erase for undo.
- TPropertyValuePair theOldValue(PropertyValueFlags(PropertyValueFlags::SetViaAutoPropagate),
- SInternValue(0.0f, GetStringTable()));
- TDataModelInstancePtr theInstance = CSimpleDataCore::GetInstanceNF(inHandle, m_Data->m_Objects);
- TPropertyPairHash::iterator theItem =
- theInstance->m_PropertyValues.find(inProperty.GetHandleValue());
- bool foundProp = theItem != theInstance->m_PropertyValues.end();
- if (foundProp)
- theOldValue = theItem->second;
- m_Data->SetInstancePropertyValue(inHandle, inProperty, inValue);
- TPropertyValuePair theNewValue =
- theInstance->m_PropertyValues.find(inProperty.GetHandleValue())->second;
- if (m_Consumer) {
- // Check if we already have the entry
- TSlideInstancePropertyPair theKey(inHandle, inProperty);
- TPropertyMergeMap::iterator iter = m_PropertyMergeMap.find(theKey);
- // Then we merge the values in to the original event where they
- // first happened.
- if (iter != m_PropertyMergeMap.end()) {
- iter->second->Update(theNewValue);
- return; // don't send the signal if we just updated value
- } else // Else we add a new merge entry.
- {
- TPropertyMergeMapEntry theEntry;
- if (!foundProp)
- theEntry = CreateHashMapInsertTransaction(
- __FILE__, __LINE__, m_Consumer,
- make_pair(inProperty.GetHandleValue(), theNewValue),
- theInstance->m_PropertyValues);
- else
- theEntry = CreateHashMapSwapTransaction(__FILE__, __LINE__, m_Consumer,
- inProperty.GetHandleValue(), theOldValue,
- theNewValue, theInstance->m_PropertyValues);
- m_PropertyMergeMap.insert(std::make_pair(theKey, theEntry));
- }
- }
- GetPropertyCoreSender()->SignalInstancePropertyValue(inHandle, inProperty, inValue);
-}
-
-bool CDataCoreProducer::HandleValid(int inHandle) const
-{
- return m_Data->HandleValid(inHandle);
-}
-
-void CDataCoreProducer::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_Consumer = inConsumer;
- m_PropertyMergeMap.clear();
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectInstancePropertyValue(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, const SValue &)>
- &inCallback)
-{
- return GetPropertyCoreProvider()->ConnectInstancePropertyValue(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectInstanceCreated(
- const std::function<void(Qt3DSDMInstanceHandle)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectInstanceCreated(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectInstanceDeleted(
- const std::function<void(Qt3DSDMInstanceHandle)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectInstanceDeleted(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectBeforeInstanceDeleted(
- const std::function<void(Qt3DSDMInstanceHandle)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectBeforeInstanceDeleted(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectInstanceDerived(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectInstanceDerived(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectInstanceParentRemoved(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectInstanceParentRemoved(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectPropertyAdded(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, TCharPtr,
- DataModelDataType::Value)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectPropertyAdded(inCallback);
-}
-
-TSignalConnectionPtr CDataCoreProducer::ConnectPropertyRemoved(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, TCharPtr,
- DataModelDataType::Value)> &inCallback)
-{
- return GetDataCoreProvider()->ConnectPropertyRemoved(inCallback);
-}
-
-void CDataCoreProducer::InitSignallers()
-{
- m_InstancePropertyCoreSignaller = CreatePropertyCoreSignaller();
- m_DataCoreSignaller = CreateDataCoreSignaller();
-}
-
-IInstancePropertyCoreSignalProvider *CDataCoreProducer::GetPropertyCoreProvider()
-{
- return dynamic_cast<IInstancePropertyCoreSignalProvider *>(
- m_InstancePropertyCoreSignaller.get());
-}
-
-IInstancePropertyCoreSignalSender *CDataCoreProducer::GetPropertyCoreSender()
-{
- return dynamic_cast<IInstancePropertyCoreSignalSender *>(m_InstancePropertyCoreSignaller.get());
-}
-
-IDataCoreSignalProvider *CDataCoreProducer::GetDataCoreProvider()
-{
- return dynamic_cast<IDataCoreSignalProvider *>(m_DataCoreSignaller.get());
-}
-
-IDataCoreSignalSender *CDataCoreProducer::GetDataCoreSender()
-{
- return dynamic_cast<IDataCoreSignalSender *>(m_DataCoreSignaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.h
deleted file mode 100644
index 8d89bfab..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/DataCoreProducer.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef DATACOREPRODUCERH
-#define DATACOREPRODUCERH
-
-#include "Qt3DSDMTransactions.h"
-#include "SimpleDataCore.h"
-#include "Qt3DSDMSignals.h"
-#include "SimpleSlideCore.h"
-
-namespace qt3dsdm {
-
-class CDataCoreProducer : public IDataCore,
- public ITransactionProducer,
- public IInstancePropertyCoreSignalProvider,
- public IDataCoreSignalProvider
-{
- typedef std::shared_ptr<IMergeableTransaction<TPropertyValuePair>> TPropertyMergeMapEntry;
- typedef std::unordered_map<TSlideInstancePropertyPair, TPropertyMergeMapEntry>
- TPropertyMergeMap;
-
- TTransactionConsumerPtr m_Consumer;
- TSimpleDataCorePtr m_Data;
- TSignalItemPtr m_InstancePropertyCoreSignaller;
- TSignalItemPtr m_DataCoreSignaller;
-
- TPropertyMergeMap m_PropertyMergeMap;
-
-public:
- CDataCoreProducer(TStringTablePtr inStringTable)
- : m_Data(new CSimpleDataCore(inStringTable))
- {
- InitSignallers();
- }
- virtual ~CDataCoreProducer() {}
-
- IStringTable &GetStringTable() const override { return m_Data->GetStringTable(); }
- std::shared_ptr<IStringTable> GetStringTablePtr() const override
- {
- return m_Data->GetStringTablePtr();
- }
-
- // IHandleBase
- bool HandleValid(int inHandle) const override;
-
- // IInstancePropertyCore
- //===============================================================
- Qt3DSDMPropertyHandle GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const override;
- void GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const override;
- void GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inHandle,
- TPropertyHandleValuePairList &outValues) override;
- bool HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
-
- void CheckValue(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) const override;
- bool GetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- void SetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
- //===============================================================
-
- // IDataCore
- //===============================================================
- Qt3DSDMInstanceHandle CreateInstance(Qt3DSDMInstanceHandle hdl = Qt3DSDMInstanceHandle()) override;
- void GetInstances(TInstanceHandleList &outInstances) const override;
- void GetInstancesDerivedFrom(TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParent) const override;
- void DeleteInstance(Qt3DSDMInstanceHandle inHandle) override;
-
- void DeriveInstance(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent) override;
- void GetInstanceParents(Qt3DSDMInstanceHandle inHandle,
- TInstanceHandleList &outParents) const override;
- bool IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const override;
-
- Qt3DSDMPropertyHandle AddProperty(Qt3DSDMInstanceHandle inInstance, TCharPtr inName,
- DataModelDataType::Value inPropType) override;
- void GetInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const override;
- const Qt3DSDMPropertyDefinition &GetProperty(Qt3DSDMPropertyHandle inProperty) const override;
- void RemoveProperty(Qt3DSDMPropertyHandle inProperty) override;
- void CopyInstanceProperties(Qt3DSDMInstanceHandle inSrcInstance,
- Qt3DSDMInstanceHandle inDestInstance) override;
-
- void RemoveCachedValues(Qt3DSDMInstanceHandle inInstance) override
- {
- m_Data->RemoveCachedValues(inInstance);
- }
- bool IsInstance(int inHandle) const override { return m_Data->IsInstance(inHandle); }
- bool IsProperty(int inHandle) const override { return m_Data->IsProperty(inHandle); }
- //===============================================================
-
- //===============================================================
- // Set the current consumer
- //===============================================================
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-
- //===============================================================
- // Return a serializable data model for load/save
- //===============================================================
- virtual TSimpleDataCorePtr GetTransactionlessDataCore() { return m_Data; }
- virtual TSimpleDataCorePtr GetTransactionlessDataCore() const { return m_Data; }
-
- //===============================================================
- // Signal provider implementation
- //===============================================================
- TSignalConnectionPtr ConnectInstancePropertyValue(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, const SValue &)>
- &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectInstanceCreated(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectBeforeInstanceDeleted(const std::function<void(Qt3DSDMInstanceHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectInstanceDerived(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectInstanceParentRemoved(
- const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMInstanceHandle)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectPropertyAdded(const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- TCharPtr, DataModelDataType::Value)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectPropertyRemoved(const std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- TCharPtr, DataModelDataType::Value)> &inCallback) override;
-
-private:
- CDataCoreProducer(const CDataCoreProducer&) = delete;
- CDataCoreProducer& operator=(const CDataCoreProducer&) = delete;
-
- template <typename TTransactionType>
- inline void RunWithConsumer(TTransactionType inTransaction)
- {
- qt3dsdm::RunWithConsumer(m_Consumer, inTransaction);
- }
-
- void InitSignallers();
- IInstancePropertyCoreSignalProvider *GetPropertyCoreProvider();
- IInstancePropertyCoreSignalSender *GetPropertyCoreSender();
- IDataCoreSignalProvider *GetDataCoreProvider();
- IDataCoreSignalSender *GetDataCoreSender();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.cpp
deleted file mode 100644
index b2f35538..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "SimpleActionCore.h"
-
-namespace qt3dsdm {
-
-Qt3DSDMActionHandle CSimpleActionCore::CreateAction(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner,
- SLong4 inTriggerTargetObjects)
-{
- int nextId = GetNextId();
- Qt3DSDMActionHandle retval = CreateActionWithHandle(nextId, inInstance, inSlide, inOwner);
- SetTriggerObject(retval, inTriggerTargetObjects);
- SetTargetObject(retval, inTriggerTargetObjects);
- return retval;
-}
-
-void CSimpleActionCore::DeleteAction(Qt3DSDMActionHandle inAction, Qt3DSDMInstanceHandle &outInstance)
-{
- SAction *theAction = GetActionNF(inAction, m_Objects);
- outInstance = theAction->m_ActionInfo.m_Instance;
- do_all(theAction->m_ActionInfo.m_HandlerArgs,
- std::bind(EraseHandle, std::placeholders::_1, std::ref(m_Objects)));
- EraseHandle(inAction, m_Objects);
-}
-
-const SActionInfo &CSimpleActionCore::GetActionInfo(Qt3DSDMActionHandle inAction) const
-{
- const SAction *theAction = GetActionNF(inAction, m_Objects);
- return theAction->m_ActionInfo;
-}
-
-inline void AddIfActionMatches(const THandleObjectPair &inPair, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner, TActionHandleList &outActions)
-{
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeAction) {
- const SAction *theAction = static_cast<SAction *>(inPair.second.get());
- if ((!inSlide.Valid() || inSlide == theAction->m_ActionInfo.m_Slide)
- && (!inOwner.Valid() || inOwner == theAction->m_ActionInfo.m_Owner))
- outActions.push_back(inPair.first);
- }
-}
-
-// Return all actions that belong to a certain instance in a certain slide
-void CSimpleActionCore::GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const
-{
- outActions.clear();
- do_all(m_Objects,
- std::bind(AddIfActionMatches,
- std::placeholders::_1, inSlide, inOwner, std::ref(outActions)));
-}
-
-// Return all actions that exist in a certain slide
-void CSimpleActionCore::GetActions(Qt3DSDMSlideHandle inSlide, TActionHandleList &outActions) const
-{
- GetActions(inSlide, 0, outActions);
-}
-
-// Return all actions that belong to a certain instance
-void CSimpleActionCore::GetActions(Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const
-{
- GetActions(0, inOwner, outActions);
-}
-
-// Return all actions
-void CSimpleActionCore::GetActions(TActionHandleList &outActions) const
-{
- outActions.clear();
- outActions.reserve(m_Objects.size());
- do_all(m_Objects,
- std::bind(MaybeAddObject<SAction, Qt3DSDMActionHandle>,
- std::placeholders::_1, std::ref(outActions)));
-}
-
-// Return the instance that was allocated for this action.
-Qt3DSDMInstanceHandle CSimpleActionCore::GetActionInstance(Qt3DSDMActionHandle inAction) const
-{
- return GetActionNF(inAction, m_Objects)->m_ActionInfo.m_Instance;
-}
-
-inline bool ActionInstanceMatches(const THandleObjectPair &inPair, Qt3DSDMInstanceHandle inInstance)
-{
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeAction) {
- const SAction *theAction = static_cast<SAction *>(inPair.second.get());
- if (inInstance == theAction->m_ActionInfo.m_Instance)
- return true;
- }
- return false;
-}
-
-// Reverse lookup into the action system so you can match actions to instances.
-Qt3DSDMActionHandle
-CSimpleActionCore::GetActionByInstance(Qt3DSDMInstanceHandle inActionInstance) const
-{
- THandleObjectMap::const_iterator theAction =
- find_if(m_Objects.begin(), m_Objects.end(),
- std::bind(ActionInstanceMatches, std::placeholders::_1, inActionInstance));
- if (theAction != m_Objects.end())
- return theAction->first;
- throw ActionNotFound(L"");
-}
-
-// Action Properties
-void CSimpleActionCore::SetTriggerObject(Qt3DSDMActionHandle inAction,
- const SObjectRefType &inTriggerObject)
-{
- SAction *theAction = GetActionNF(inAction, m_Objects);
- theAction->m_ActionInfo.m_TriggerObject = inTriggerObject;
-}
-
-void CSimpleActionCore::SetTargetObject(Qt3DSDMActionHandle inAction,
- const SObjectRefType &inTargetObject)
-{
- SAction *theAction = GetActionNF(inAction, m_Objects);
- theAction->m_ActionInfo.m_TargetObject = inTargetObject;
-}
-
-void CSimpleActionCore::SetEvent(Qt3DSDMActionHandle inAction, const wstring &inEventHandle)
-{
- SAction *theAction = GetActionNF(inAction, m_Objects);
- theAction->m_ActionInfo.m_Event = inEventHandle;
-}
-
-void CSimpleActionCore::SetHandler(Qt3DSDMActionHandle inAction, const wstring &inHandlerHandle)
-{
- SAction *theAction = GetActionNF(inAction, m_Objects);
- theAction->m_ActionInfo.m_Handler = inHandlerHandle;
-}
-
-// Action Argument
-Qt3DSDMHandlerArgHandle CSimpleActionCore::AddHandlerArgument(Qt3DSDMActionHandle inAction,
- const TCharStr &inName,
- HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType)
-{
- int nextId = GetNextId();
- return AddHandlerArgumentWithHandle(nextId, inAction, inName, inArgType, inValueType);
-}
-
-void CSimpleActionCore::RemoveHandlerArgument(Qt3DSDMHandlerArgHandle inHandlerArgument)
-{
- SHandlerArgument *theHandlerArgument = GetHandlerArgumentNF(inHandlerArgument, m_Objects);
- SAction *theAction = GetActionNF(theHandlerArgument->m_HandlerArgInfo.m_Action, m_Objects);
- EraseHandle(inHandlerArgument, m_Objects);
- erase_if(theAction->m_ActionInfo.m_HandlerArgs,
- std::bind(equal_to<int>(), std::placeholders::_1, inHandlerArgument.GetHandleValue()));
-}
-
-const SHandlerArgumentInfo &
-CSimpleActionCore::GetHandlerArgumentInfo(Qt3DSDMHandlerArgHandle inHandlerArgument) const
-{
- if (HandleValid(inHandlerArgument)) {
- const SHandlerArgument *theHandlerArgument =
- GetHandlerArgumentNF(inHandlerArgument, m_Objects);
- return theHandlerArgument->m_HandlerArgInfo;
- } else {
- static SHandlerArgumentInfo dummy;
- return dummy;
- }
-}
-
-void CSimpleActionCore::GetHandlerArguments(Qt3DSDMActionHandle inAction,
- THandlerArgHandleList &outHandlerArguments) const
-{
- const SAction *theAction = GetActionNF(inAction, m_Objects);
- outHandlerArguments = theAction->m_ActionInfo.m_HandlerArgs;
-}
-
-// Action Argument Properties
-void CSimpleActionCore::GetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument,
- SValue &outValue) const
-{
- const SHandlerArgument *theHandlerArgument = GetHandlerArgumentNF(inHandlerArgument, m_Objects);
- outValue = theHandlerArgument->m_HandlerArgInfo.m_Value;
-}
-
-void CSimpleActionCore::SetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument,
- const SValue &inValue)
-{
- SHandlerArgument *theHandlerArgument = GetHandlerArgumentNF(inHandlerArgument, m_Objects);
- theHandlerArgument->m_HandlerArgInfo.m_Value = inValue;
-}
-
-// Helper functions
-Qt3DSDMActionHandle CSimpleActionCore::CreateActionWithHandle(int inHandle,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner)
-{
- if (HandleValid(inHandle))
- throw HandleExists(L"");
- m_Objects.insert(make_pair(
- inHandle, (THandleObjectPtr) new SAction(inHandle, inInstance, inSlide, inOwner)));
- return inHandle;
-}
-
-Qt3DSDMHandlerArgHandle
-CSimpleActionCore::AddHandlerArgumentWithHandle(int inHandle, Qt3DSDMActionHandle inAction,
- const TCharStr &inName, HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType)
-{
- if (HandleValid(inHandle))
- throw HandleExists(L"");
- m_Objects.insert(make_pair(inHandle, (THandleObjectPtr) new SHandlerArgument(
- inHandle, inAction, inName, inArgType, inValueType)));
- SAction *theAction = GetActionNF(inAction, m_Objects);
- theAction->m_ActionInfo.m_HandlerArgs.push_back(inHandle);
- return inHandle;
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.h
deleted file mode 100644
index 1e229f18..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleActionCore.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef ACTIONCOREH
-#define ACTIONCOREH
-
-#include "Qt3DSDMActionCore.h"
-#include "HandleSystemBase.h"
-#include "Qt3DSDMErrors.h"
-
-namespace qt3dsdm {
-struct SAction : public CHandleObject
-{
- SActionInfo m_ActionInfo;
-
- SAction() {}
-
- SAction(int inHandle, Qt3DSDMInstanceHandle inInstance, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner)
- : CHandleObject(inHandle)
- , m_ActionInfo(inInstance, inSlide, inOwner)
- {
- }
-
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeAction;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-struct SHandlerArgument : public CHandleObject
-{
- SHandlerArgumentInfo m_HandlerArgInfo;
-
- SHandlerArgument() {}
-
- SHandlerArgument(int inHandle, Qt3DSDMActionHandle inAction, const TCharStr &inName,
- HandlerArgumentType::Value inArgType, DataModelDataType::Value inValueType)
- : CHandleObject(inHandle)
- , m_HandlerArgInfo(inAction, inName, inArgType, inValueType)
- {
- }
-
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeActionHandlerArgument;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-class CSimpleActionCore : public CHandleBase, public IActionCore
-{
- mutable TStringTablePtr m_StringTable;
-
-public: // Use
- CSimpleActionCore(TStringTablePtr strTable)
- : m_StringTable(strTable)
- {
- }
-
- IStringTable &GetStringTable() const override { return *m_StringTable.get(); }
- TStringTablePtr GetStringTablePtr() const override { return m_StringTable; }
- // Action
- Qt3DSDMActionHandle CreateAction(Qt3DSDMInstanceHandle inInstance, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner, SLong4 inTriggerTargetObjects) override;
- void DeleteAction(Qt3DSDMActionHandle inAction, Qt3DSDMInstanceHandle &outInstance) override;
- const SActionInfo &GetActionInfo(Qt3DSDMActionHandle inAction) const override;
- void GetActions(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inOwner,
- TActionHandleList &outActions) const override;
- void GetActions(Qt3DSDMSlideHandle inSlide, TActionHandleList &outActions) const override;
- void GetActions(Qt3DSDMInstanceHandle inOwner, TActionHandleList &outActions) const override;
- void GetActions(TActionHandleList &outActions) const override;
-
- // Return the instance that was allocated for this action.
- Qt3DSDMInstanceHandle GetActionInstance(Qt3DSDMActionHandle inAction) const override;
- // Reverse lookup into the action system so you can match actions to instances.
- Qt3DSDMActionHandle GetActionByInstance(Qt3DSDMInstanceHandle inActionInstance) const override;
-
- // Action Properties
- void SetTriggerObject(Qt3DSDMActionHandle inAction, const SObjectRefType &inTriggerObject) override;
- void SetTargetObject(Qt3DSDMActionHandle inAction, const SObjectRefType &inTargetObject) override;
- void SetEvent(Qt3DSDMActionHandle inAction, const wstring &inEvent) override;
- void SetHandler(Qt3DSDMActionHandle inAction, const wstring &inHandler) override;
-
- // Action Argument
- Qt3DSDMHandlerArgHandle AddHandlerArgument(Qt3DSDMActionHandle inAction, const TCharStr &inName,
- HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType) override;
- void RemoveHandlerArgument(Qt3DSDMHandlerArgHandle inHandlerArgument) override;
- const SHandlerArgumentInfo &
- GetHandlerArgumentInfo(Qt3DSDMHandlerArgHandle inHandlerArgument) const override;
- void GetHandlerArguments(Qt3DSDMActionHandle inAction,
- THandlerArgHandleList &outHandlerArguments) const override;
-
- // Action Argument Properties
- void GetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument, SValue &outValue) const override;
- void SetHandlerArgumentValue(Qt3DSDMHandlerArgHandle inHandlerArgument, const SValue &inValue) override;
-
- // CHandleBase
- bool HandleValid(int inHandle) const override { return CHandleBase::HandleValid(inHandle); }
-
- // Helper functions
- Qt3DSDMActionHandle CreateActionWithHandle(int inHandle, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inOwner);
- Qt3DSDMHandlerArgHandle AddHandlerArgumentWithHandle(int inHandle, Qt3DSDMActionHandle inAction,
- const TCharStr &inName,
- HandlerArgumentType::Value inArgType,
- DataModelDataType::Value inValueType);
-
- static SAction *GetActionNF(int inHandle, THandleObjectMap &inObjects)
- {
- return const_cast<SAction *>(
- GetActionNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const SAction *GetActionNF(int inHandle, const THandleObjectMap &inObjects)
- {
- const SAction *theAction = GetHandleObject<SAction>(inHandle, inObjects);
- if (theAction)
- return theAction;
- throw ActionNotFound(L"");
- }
-
- static SHandlerArgument *GetHandlerArgumentNF(int inHandle, THandleObjectMap &inObjects)
- {
- return const_cast<SHandlerArgument *>(
- GetHandlerArgumentNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const SHandlerArgument *GetHandlerArgumentNF(int inHandle,
- const THandleObjectMap &inObjects)
- {
- const SHandlerArgument *theItem = GetHandleObject<SHandlerArgument>(inHandle, inObjects);
- if (theItem)
- return theItem;
- throw HandlerArgumentNotFound(L"");
- }
-};
-
-typedef std::shared_ptr<CSimpleActionCore> TSimpleActionCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.cpp
deleted file mode 100644
index 00d6df4e..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.cpp
+++ /dev/null
@@ -1,618 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "SimpleAnimationCore.h"
-
-#ifdef _WIN32
-#pragma warning(disable : 4503) // decorated name length exceeded
-#endif
-
-typedef long INT32;
-typedef float FLOAT;
-#define DATALOGGER_CUBICROOT 0
-
-struct SPerfLogEvent
-{
- SPerfLogEvent(int) {}
-};
-
-typedef SPerfLogEvent TPerfLogMathEvent1;
-
-#include "Qt3DSCubicRoots.h"
-#include "Qt3DSCubicRootsImpl.h"
-#include "Qt3DSBezierEval.h"
-using namespace std;
-
-namespace qt3dsdm {
-
-Qt3DSDMAnimationHandle
-CSimpleAnimationCore::CreateAnimation(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType, bool inFirstKeyframeDynamic)
-{
- if (GetAnimation(inSlide, inInstance, inProperty, inIndex).Valid())
- throw AnimationExists(L"");
-
- int nextId = GetNextId();
- Qt3DSDMAnimationHandle retval = CreateAnimationWithHandle(
- nextId, inSlide, inInstance, inProperty, inIndex, inAnimationType, inFirstKeyframeDynamic);
- AddAnimationToLookupCache(retval);
- return retval;
-}
-
-void CSimpleAnimationCore::DeleteAnimation(Qt3DSDMAnimationHandle inAnimation)
-{
- RemoveAnimationFromLookupCache(inAnimation);
- SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- do_all(theItem->m_Keyframes, std::bind(EraseHandle,
- std::placeholders::_1, std::ref(m_Objects)));
- EraseHandle(inAnimation, m_Objects);
-}
-
-void CSimpleAnimationCore::EnsureAnimationCache() const
-{
- if (m_AnimationMatchesCache.size() == 0) {
- for (THandleObjectMap::const_iterator theIter = m_Objects.begin(), theEnd = m_Objects.end();
- theIter != theEnd; ++theIter) {
- if (theIter->second->GetType() == CHandleObject::EHandleObjectTypeSAnimationTrack)
- AddAnimationToLookupCache(static_pointer_cast<SAnimationTrack>(theIter->second));
- }
- }
-}
-
-Qt3DSDMAnimationHandle CSimpleAnimationCore::GetAnimation(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- size_t inIndex) const
-{
- EnsureAnimationCache();
-
- pair<TStateInstanceAnimationMap::const_iterator, TStateInstanceAnimationMap::const_iterator>
- theRange(m_AnimationMatchesCache.equal_range(
- make_pair(inSlide.GetHandleValue(), inInstance.GetHandleValue())));
- for (TStateInstanceAnimationMap::const_iterator theIter = theRange.first;
- theIter != theRange.second; ++theIter) {
- std::shared_ptr<SAnimationTrack> theItem = theIter->second;
- if (inSlide.GetHandleValue() == theItem->m_Slide
- && inInstance.GetHandleValue() == theItem->m_Instance
- && inProperty.GetHandleValue() == theItem->m_Property && inIndex == theItem->m_Index)
- return theItem->m_Handle;
- }
- return 0;
-}
-
-SAnimationInfo CSimpleAnimationCore::GetAnimationInfo(Qt3DSDMAnimationHandle inAnimation) const
-{
- if (m_Objects.find(inAnimation) != m_Objects.end()) {
- const SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- return CreateAnimationInfo(theItem->m_Slide, theItem->m_Instance, theItem->m_Property,
- theItem->m_Index, theItem->m_AnimationType,
- theItem->m_FirstKeyframeDynamic, theItem->m_ArtistEdited);
- }
- return SAnimationInfo();
-}
-
-inline void AddIfAnimation(const THandleObjectPair &inPair, TAnimationHandleList &outAnimations)
-{
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeSAnimationTrack)
- outAnimations.push_back(inPair.first);
-}
-
-void CSimpleAnimationCore::GetAnimations(TAnimationHandleList &outAnimations) const
-{
- outAnimations.clear();
- do_all(m_Objects, std::bind(AddIfAnimation, std::placeholders::_1, std::ref(outAnimations)));
-}
-
-void CSimpleAnimationCore::GetAnimations(TAnimationInfoList &outAnimations,
- Qt3DSDMSlideHandle inMaster,
- Qt3DSDMSlideHandle inSlide) const
-{
- outAnimations.clear();
- for (THandleObjectMap::const_iterator iter = m_Objects.begin(), end = m_Objects.end();
- iter != end; ++iter) {
- if (iter->second->GetType() == CHandleObject::EHandleObjectTypeSAnimationTrack) {
- const SAnimationTrack *theItem =
- static_cast<const SAnimationTrack *>(iter->second.get());
- // If either master or slide is valid, then item slide must match.
- // If item slide matches neither, then we ignore unless neither are valid.
- bool keep = (theItem->m_Slide == inMaster || theItem->m_Slide == inSlide)
- || (inMaster.Valid() == false && inSlide.Valid() == false);
- if (keep) {
- outAnimations.push_back(
- CreateAnimationInfo(theItem->m_Slide, theItem->m_Instance, theItem->m_Property,
- theItem->m_Index, theItem->m_AnimationType,
- theItem->m_FirstKeyframeDynamic, theItem->m_ArtistEdited));
- }
- }
- }
-}
-
-inline void AddSpecificAnimationsIf(const THandleObjectPair &inPair, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TAnimationHandleList &outAnimations)
-{
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeSAnimationTrack) {
- const SAnimationTrack *theTrack = static_cast<const SAnimationTrack *>(inPair.second.get());
- if (theTrack->m_Slide == inSlide && theTrack->m_Instance == inInstance)
- outAnimations.push_back(inPair.first);
- }
-}
-
-void CSimpleAnimationCore::GetSpecificInstanceAnimations(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TAnimationHandleList &outAnimations)
-{
- EnsureAnimationCache();
- pair<TStateInstanceAnimationMap::const_iterator, TStateInstanceAnimationMap::const_iterator>
- theRange(m_AnimationMatchesCache.equal_range(
- make_pair(inSlide.GetHandleValue(), inInstance.GetHandleValue())));
- for (TStateInstanceAnimationMap::const_iterator iter = theRange.first; iter != theRange.second;
- ++iter)
- outAnimations.push_back(iter->second->m_Handle);
-}
-
-void CSimpleAnimationCore::SetFirstKeyframeDynamic(Qt3DSDMAnimationHandle inAnimation, bool inValue)
-{
- SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- theItem->m_FirstKeyframeDynamic = inValue;
- SetIsArtistEdited(inAnimation);
-}
-
-inline void CheckKeyframeType(EAnimationType inExpected, const TKeyframe &inKeyframe)
-{
- if (inExpected != GetKeyframeType(inKeyframe))
- throw AnimationKeyframeTypeError(L"");
-}
-
-// keyframe manipulation
-Qt3DSDMKeyframeHandle CSimpleAnimationCore::InsertKeyframe(Qt3DSDMAnimationHandle inAnimation,
- const TKeyframe &inKeyframe)
-{
- SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- CheckKeyframeType(theItem->m_AnimationType, inKeyframe);
- int nextId = GetNextId();
- m_Objects.insert(
- make_pair(nextId, (THandleObjectPtr) new SKeyframe(nextId, inAnimation, inKeyframe)));
- theItem->m_Keyframes.push_back(nextId);
- theItem->m_KeyframesDirty = true;
- SetIsArtistEdited(inAnimation);
- return nextId;
-}
-
-void CSimpleAnimationCore::EraseKeyframe(Qt3DSDMKeyframeHandle inKeyframe)
-{
- SKeyframe *theKeyframe = GetKeyframeNF(inKeyframe, m_Objects);
- int theAnimHandle(theKeyframe->m_Animation);
- SAnimationTrack *theItem = GetAnimationNF(theAnimHandle, m_Objects);
- EraseHandle(inKeyframe, m_Objects);
- erase_if(theItem->m_Keyframes, std::bind(equal_to<int>(),
- std::placeholders::_1, inKeyframe.GetHandleValue()));
- SetIsArtistEdited(theAnimHandle);
-}
-
-void CSimpleAnimationCore::DeleteAllKeyframes(Qt3DSDMAnimationHandle inAnimation)
-{
- SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- do_all(theItem->m_Keyframes, std::bind(EraseHandle,
- std::placeholders::_1, std::ref(m_Objects)));
- theItem->m_Keyframes.clear();
- SetIsArtistEdited(inAnimation);
-}
-
-Qt3DSDMAnimationHandle
-CSimpleAnimationCore::GetAnimationForKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- const SKeyframe *theKeyframe = GetKeyframeNF(inKeyframe, m_Objects);
- return theKeyframe->m_Animation;
-}
-
-TKeyframe CSimpleAnimationCore::GetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- const SKeyframe *theKeyframe = GetKeyframeNF(inKeyframe, m_Objects);
- return theKeyframe->m_Keyframe;
-}
-
-void CSimpleAnimationCore::SetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData)
-{
- DoSetKeyframeData(inKeyframe, inData);
- SKeyframe *theKeyframe = GetKeyframeNF(inKeyframe, m_Objects);
- SetIsArtistEdited(theKeyframe->m_Animation);
-}
-
-void CSimpleAnimationCore::DoSetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe,
- const TKeyframe &inData)
-{
- SKeyframe *theKeyframe = GetKeyframeNF(inKeyframe, m_Objects);
- CheckKeyframeType(GetKeyframeType(theKeyframe->m_Keyframe), inData);
- theKeyframe->m_Keyframe = inData;
- SAnimationTrack *theItem = GetAnimationNF(theKeyframe->m_Animation, m_Objects);
- theItem->m_KeyframesDirty = true;
-}
-
-bool KeyframeLessThan(int inLeftSide, int inRightSide, const THandleObjectMap &inObjects)
-{
- const SKeyframe *theLeft = CSimpleAnimationCore::GetKeyframeNF(inLeftSide, inObjects);
- const SKeyframe *theRight = CSimpleAnimationCore::GetKeyframeNF(inRightSide, inObjects);
- return KeyframeTime(theLeft->m_Keyframe) < KeyframeTime(theRight->m_Keyframe);
-}
-
-void SortKeyframes(TKeyframeHandleList &inKeyframes, const THandleObjectMap &inObjects)
-{
- return stable_sort(inKeyframes.begin(), inKeyframes.end(),
- std::bind(KeyframeLessThan, std::placeholders::_1,
- std::placeholders::_2, std::ref(inObjects)));
-}
-
-void CheckKeyframesSorted(const SAnimationTrack *theItem, const THandleObjectMap &inObjects)
-{
- if (theItem->m_KeyframesDirty) {
- SAnimationTrack *theNonConst = const_cast<SAnimationTrack *>(theItem);
- SortKeyframes(theNonConst->m_Keyframes, inObjects);
- theNonConst->m_KeyframesDirty = false;
- }
-}
-
-void CSimpleAnimationCore::GetKeyframes(Qt3DSDMAnimationHandle inAnimation,
- TKeyframeHandleList &outKeyframes) const
-{
- const SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- CheckKeyframesSorted(theItem, m_Objects);
- outKeyframes = theItem->m_Keyframes;
-}
-
-size_t CSimpleAnimationCore::GetKeyframeCount(Qt3DSDMAnimationHandle inAnimation) const
-{
- const SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- return theItem->m_Keyframes.size();
-}
-
-bool CSimpleAnimationCore::IsFirstKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- Qt3DSDMAnimationHandle theAnimation = GetAnimationForKeyframe(inKeyframe);
- if (theAnimation.Valid()) {
- const SAnimationTrack *theItem = GetAnimationNF(theAnimation, m_Objects);
- return theItem->m_Keyframes.size() && theItem->m_Keyframes[0] == inKeyframe;
- }
- return false;
-}
-
-void CSimpleAnimationCore::OffsetAnimations(Qt3DSDMSlideHandle /*inSlide*/,
- Qt3DSDMInstanceHandle /*inInstance*/, long /*inOffset*/)
-{
- throw std::runtime_error("unimplemented");
-}
-
-void CSimpleAnimationCore::SetIsArtistEdited(Qt3DSDMAnimationHandle inAnimation, bool inEdited)
-{
- if (m_Objects.find(inAnimation) == m_Objects.end()) {
- Q_ASSERT(false);
- return;
- }
- SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- if (theItem->m_ArtistEdited != inEdited)
- theItem->m_ArtistEdited = inEdited;
-}
-
-bool CSimpleAnimationCore::IsArtistEdited(Qt3DSDMAnimationHandle inAnimation) const
-{
- if (m_Objects.find(inAnimation) == m_Objects.end()) {
- return false;
- }
- const SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- return theItem->m_ArtistEdited;
-}
-
-inline bool KeyframeTimeLessThan(int inKeyframe, float inSeconds, const THandleObjectMap &inObjects)
-{
- const SKeyframe *theKeyframe = CSimpleAnimationCore::GetKeyframeNF(inKeyframe, inObjects);
- return KeyframeTime(theKeyframe->m_Keyframe) < inSeconds;
-}
-
-inline bool KeyframeValueTimeLessThan(const TKeyframe &inLeft, const TKeyframe &inRight)
-{
- return KeyframeTime(inLeft) < KeyframeTime(inRight);
-}
-
-TKeyframe IntToKeyframe(int inKeyframe, const THandleObjectMap &inObjects)
-{
- const SKeyframe *theKeyframe = CSimpleAnimationCore::GetKeyframeNF(inKeyframe, inObjects);
- return theKeyframe->m_Keyframe;
-}
-
-inline float KeyframeValue(int inKeyframe, const THandleObjectMap &inObjects)
-{
- const SKeyframe *theKeyframe = CSimpleAnimationCore::GetKeyframeNF(inKeyframe, inObjects);
- return KeyframeValueValue(theKeyframe->m_Keyframe);
-}
-
-inline float EvaluateLinear(float inS1, float inS2, float inV1, float inV2, float inSeconds)
-{
- float amount = (inSeconds - inS1) / (inS2 - inS1);
- return inV1 + amount * (inV2 - inV1);
-}
-
-inline float EvaluateLinearKeyframe(SLinearKeyframe &inK1, SLinearKeyframe &inK2, float inSeconds)
-{
- return EvaluateLinear(inK1.m_KeyframeSeconds, inK2.m_KeyframeSeconds, inK1.m_KeyframeValue,
- inK2.m_KeyframeValue, inSeconds);
-}
-
-inline float DoBezierEvaluation(float inSeconds, const SBezierKeyframe &inK1,
- const SBezierKeyframe &inK2)
-{
- return Q3DStudio::EvaluateBezierKeyframe(
- inSeconds, inK1.m_KeyframeSeconds, inK1.m_KeyframeValue, inK1.m_OutTangentTime,
- inK1.m_OutTangentValue, inK2.m_InTangentTime, inK2.m_InTangentValue, inK2.m_KeyframeSeconds,
- inK2.m_KeyframeValue);
-}
-
-// Animation Evaluation.
-float CSimpleAnimationCore::EvaluateAnimation(Qt3DSDMAnimationHandle inAnimation,
- float inSeconds) const
-{
- const SAnimationTrack *theItem = GetAnimationNF(inAnimation, m_Objects);
- if (theItem->m_Keyframes.empty())
- return 0.0f;
- CheckKeyframesSorted(theItem, m_Objects);
- // Default to linear for now.
- SLinearKeyframe theKeyframe = { 0 };
- theKeyframe.m_KeyframeSeconds = inSeconds;
- TKeyframe theSearchKey(theKeyframe);
- function<TKeyframe(int)> theIntToKeyframe(
- std::bind(IntToKeyframe, std::placeholders::_1, std::ref(m_Objects)));
-
- TKeyframeHandleList::const_iterator theBound =
- lower_bound(theItem->m_Keyframes.begin(), theItem->m_Keyframes.end(), theSearchKey,
- [theIntToKeyframe](const Qt3DSDMKeyframeHandle &inLeft,
- const TKeyframe &inRight)
- {return KeyframeTime(theIntToKeyframe(inLeft)) < KeyframeTime(inRight);});
-
- if (theBound == theItem->m_Keyframes.end())
- return KeyframeValue(theItem->m_Keyframes.back(), m_Objects);
- if (theBound == theItem->m_Keyframes.begin())
- return KeyframeValue(*theItem->m_Keyframes.begin(), m_Objects);
-
- TKeyframeHandleList::const_iterator theStartIter = theBound;
- --theStartIter;
-
- // Both iterators must be valid at this point...
- Qt3DSDMKeyframeHandle theStart = *theStartIter;
- Qt3DSDMKeyframeHandle theFinish = *theBound;
- switch (theItem->m_AnimationType) {
- default:
- throw AnimationEvaluationError(L"");
- case EAnimationTypeLinear: {
- SLinearKeyframe k1 = get<SLinearKeyframe>(theIntToKeyframe(theStart));
- SLinearKeyframe k2 = get<SLinearKeyframe>(theIntToKeyframe(theFinish));
- return EvaluateLinearKeyframe(k1, k2, inSeconds);
- }
- case EAnimationTypeBezier: {
- SBezierKeyframe k1 = get<SBezierKeyframe>(theIntToKeyframe(theStart));
- SBezierKeyframe k2 = get<SBezierKeyframe>(theIntToKeyframe(theFinish));
- return DoBezierEvaluation(inSeconds, k1, k2);
- }
- case EAnimationTypeEaseInOut: {
- SEaseInEaseOutKeyframe k1 = get<SEaseInEaseOutKeyframe>(theIntToKeyframe(theStart));
- SEaseInEaseOutKeyframe k2 = get<SEaseInEaseOutKeyframe>(theIntToKeyframe(theFinish));
- return DoBezierEvaluation(
- inSeconds, CreateBezierKeyframeFromEaseInEaseOutKeyframe(NULL, k1, &k2.m_KeyframeValue),
- CreateBezierKeyframeFromEaseInEaseOutKeyframe(&k1.m_KeyframeValue, k2, NULL));
- }
- }
-}
-
-bool CSimpleAnimationCore::KeyframeValid(Qt3DSDMKeyframeHandle inKeyframe) const
-{
- return HandleObjectValid<SKeyframe>(inKeyframe, m_Objects);
-}
-
-bool CSimpleAnimationCore::AnimationValid(Qt3DSDMAnimationHandle inAnimation) const
-{
- return HandleObjectValid<SAnimationTrack>(inAnimation, m_Objects);
-}
-
-Qt3DSDMAnimationHandle CSimpleAnimationCore::CreateAnimationWithHandle(
- int inHandle, Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex, EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic)
-{
- if (HandleValid(inHandle))
- throw HandleExists(L"");
- m_Objects.insert(make_pair(inHandle, (THandleObjectPtr) new SAnimationTrack(
- inHandle, inSlide, inInstance, inProperty, inIndex,
- inAnimationType, inFirstKeyframeDynamic, true)));
- return inHandle;
-}
-
-void CSimpleAnimationCore::AddAnimationToLookupCache(Qt3DSDMAnimationHandle inAnimation) const
-{
- THandleObjectMap::const_iterator theAnim = m_Objects.find(inAnimation);
- if (theAnim != m_Objects.end())
- AddAnimationToLookupCache(static_pointer_cast<SAnimationTrack>(theAnim->second));
-}
-void CSimpleAnimationCore::RemoveAnimationFromLookupCache(Qt3DSDMAnimationHandle inAnimation) const
-{
- THandleObjectMap::const_iterator theAnim = m_Objects.find(inAnimation);
- if (theAnim != m_Objects.end())
- RemoveAnimationFromLookupCache(static_pointer_cast<SAnimationTrack>(theAnim->second));
-}
-
-// Ensure there is only one of these in the multimap.
-void CSimpleAnimationCore::AddAnimationToLookupCache(
- std::shared_ptr<SAnimationTrack> inAnimation) const
-{
- Qt3DSDMSlideHandle theSlide = inAnimation->m_Slide;
- Qt3DSDMInstanceHandle theInstance = inAnimation->m_Instance;
- pair<TStateInstanceAnimationMap::iterator, TStateInstanceAnimationMap::iterator> theRange =
- m_AnimationMatchesCache.equal_range(
- make_pair(theSlide.GetHandleValue(), theInstance.GetHandleValue()));
- for (TStateInstanceAnimationMap::iterator theIter = theRange.first; theIter != theRange.second;
- ++theIter) {
- if (theIter->second == inAnimation)
- return;
- }
- m_AnimationMatchesCache.insert(
- make_pair(make_pair(theSlide.GetHandleValue(), theInstance.GetHandleValue()), inAnimation));
-}
-
-// Remove this from the multimap
-void CSimpleAnimationCore::RemoveAnimationFromLookupCache(
- std::shared_ptr<SAnimationTrack> inAnimation) const
-{
- TStateInstanceAnimationMap &theMap(m_AnimationMatchesCache);
- Qt3DSDMSlideHandle theSlide = inAnimation->m_Slide;
- Qt3DSDMInstanceHandle theInstance = inAnimation->m_Instance;
- pair<TStateInstanceAnimationMap::iterator, TStateInstanceAnimationMap::iterator> theRange =
- theMap.equal_range(make_pair(theSlide.GetHandleValue(), theInstance.GetHandleValue()));
- for (TStateInstanceAnimationMap::iterator theIter = theRange.first; theIter != theRange.second;
- ++theIter) {
- if (theIter->second == inAnimation) {
- theMap.erase(theIter);
- break;
- }
- }
-}
-
-//================================================================================
-// UICDMAnimation.h function implementations
-//================================================================================
-
-void CopyKeyframe(Qt3DSDMAnimationHandle inAnimation, Qt3DSDMKeyframeHandle inKeyframe,
- const IAnimationCore &inSourceAnimationCore, IAnimationCore &inDestAnimationCore)
-{
- TKeyframe theData = inSourceAnimationCore.GetKeyframeData(inKeyframe);
- inDestAnimationCore.InsertKeyframe(inAnimation, theData);
-}
-
-void CopyKeyframes(const IAnimationCore &inSourceAnimationCore, IAnimationCore &inDestAnimationCore,
- Qt3DSDMAnimationHandle inDestAnimation, const TKeyframeHandleList &inKeyframes)
-{
- do_all(inKeyframes,
- std::bind(CopyKeyframe, inDestAnimation, std::placeholders::_1,
- std::cref(inSourceAnimationCore), std::ref(inDestAnimationCore)));
-}
-
-Qt3DSDMAnimationHandle CopyAnimation(TAnimationCorePtr inAnimationCore,
- Qt3DSDMAnimationHandle inAnimation, Qt3DSDMSlideHandle inNewSlide,
- Qt3DSDMInstanceHandle inNewInstance,
- Qt3DSDMPropertyHandle inNewProperty, size_t inNewIndex)
-{
- TKeyframeHandleList theKeyframes;
- inAnimationCore->GetKeyframes(inAnimation, theKeyframes);
- SAnimationInfo theInfo(inAnimationCore->GetAnimationInfo(inAnimation));
- Qt3DSDMAnimationHandle theAnimation =
- inAnimationCore->CreateAnimation(inNewSlide, inNewInstance, inNewProperty, inNewIndex,
- theInfo.m_AnimationType, theInfo.m_DynamicFirstKeyframe);
- CopyKeyframes(*inAnimationCore, *inAnimationCore, theAnimation, theKeyframes);
- return theAnimation;
-}
-
-SBezierKeyframe GetBezierKeyframeData(Qt3DSDMKeyframeHandle inKeyframe,
- const IAnimationCore &inAnimationCore)
-{
- return get<SBezierKeyframe>(inAnimationCore.GetKeyframeData(inKeyframe));
-}
-
-SEaseInEaseOutKeyframe GetEaseInEaseOutKeyframeData(Qt3DSDMKeyframeHandle inKeyframe,
- const IAnimationCore &inAnimationCore)
-{
- return get<SEaseInEaseOutKeyframe>(inAnimationCore.GetKeyframeData(inKeyframe));
-}
-
-TKeyframeHandleList::iterator SafeIncrementIterator(TKeyframeHandleList::iterator inIter,
- const TKeyframeHandleList::iterator &inEnd)
-{
- return inIter == inEnd ? inEnd : inIter + 1;
-}
-
-void GetKeyframesAsBezier(Qt3DSDMAnimationHandle inAnimation, const IAnimationCore &inAnimationCore,
- TBezierKeyframeList &outKeyframes)
-{
- SAnimationInfo theInfo(inAnimationCore.GetAnimationInfo(inAnimation));
- TKeyframeHandleList theKeyframes;
- inAnimationCore.GetKeyframes(inAnimation, theKeyframes);
- outKeyframes.resize(theKeyframes.size());
- switch (theInfo.m_AnimationType) {
- default:
- throw invalid_argument("AnimationType");
- case EAnimationTypeBezier:
- transform(theKeyframes.begin(), theKeyframes.end(), outKeyframes.begin(),
- std::bind(GetBezierKeyframeData, std::placeholders::_1,
- std::cref(inAnimationCore)));
- break;
- case EAnimationTypeEaseInOut: {
-
- TKeyframeHandleList::iterator theEndKeyframe = theKeyframes.end();
-
- typedef std::function<SEaseInEaseOutKeyframe(Qt3DSDMKeyframeHandle)> TConvertFunc;
- TConvertFunc theDataConverter(
- std::bind(GetEaseInEaseOutKeyframeData, std::placeholders::_1,
- std::cref(inAnimationCore)));
-
- TKeyframeHandleList::iterator thePreviousKeyframe = theKeyframes.begin();
-
- TKeyframeHandleList::iterator theCurrentKeyframe =
- SafeIncrementIterator(thePreviousKeyframe, theEndKeyframe);
-
- TKeyframeHandleList::iterator theNextKeyframe =
- SafeIncrementIterator(theCurrentKeyframe, theEndKeyframe);
-
- TBezierKeyframeList::iterator theResult(outKeyframes.begin());
-
- if (thePreviousKeyframe != theEndKeyframe) {
- float *theNextValuePtr = NULL;
- float theNextValue;
- if (theCurrentKeyframe != theEndKeyframe) {
- theNextValue = theDataConverter(*theCurrentKeyframe).m_KeyframeValue;
- theNextValuePtr = &theNextValue;
- }
- *theResult = CreateBezierKeyframeFromEaseInEaseOutKeyframe(
- NULL, theDataConverter(*thePreviousKeyframe), theNextValuePtr);
- theResult = theResult + 1;
- }
- for (; theCurrentKeyframe != theEndKeyframe;
- ++thePreviousKeyframe,
- theCurrentKeyframe = SafeIncrementIterator(theCurrentKeyframe, theEndKeyframe),
- theNextKeyframe = SafeIncrementIterator(theNextKeyframe, theEndKeyframe),
- ++theResult) {
- float theLastValue(theDataConverter(*thePreviousKeyframe).m_KeyframeValue);
- float *theNextValuePtr = NULL;
- float theNextValue;
- if (theNextKeyframe != theEndKeyframe) {
- theNextValue = theDataConverter(*theNextKeyframe).m_KeyframeValue;
- theNextValuePtr = &theNextValue;
- }
- *theResult = CreateBezierKeyframeFromEaseInEaseOutKeyframe(
- &theLastValue, theDataConverter(*theCurrentKeyframe), theNextValuePtr);
- }
- } break;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.h
deleted file mode 100644
index cb4c4154..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleAnimationCore.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef ANIMATIONCOREH
-#define ANIMATIONCOREH
-#include "Qt3DSDMAnimation.h"
-#include "HandleSystemBase.h"
-#include <unordered_map>
-
-namespace {
-struct pair_hash {
- template <class T1, class T2>
- std::size_t operator () (const std::pair<T1, T2> &p) const {
- auto h1 = std::hash<T1>{}(p.first);
- auto h2 = std::hash<T2>{}(p.second);
-
- return h1 ^ h2;
- }
- };
-}
-
-namespace qt3dsdm {
-struct SAnimationTrack : public CHandleObject
-{
- int m_Slide;
- int m_Instance;
- int m_Property;
- EAnimationType m_AnimationType;
- size_t m_Index;
- TKeyframeHandleList m_Keyframes;
- bool m_KeyframesDirty;
- bool m_FirstKeyframeDynamic;
- bool m_ArtistEdited;
-
- SAnimationTrack()
- : m_Slide(0)
- , m_Instance(0)
- , m_Property(0)
- , m_AnimationType(EAnimationTypeLinear)
- , m_Index(0)
- , m_KeyframesDirty(false)
- , m_FirstKeyframeDynamic(false)
- , m_ArtistEdited(true)
- {
- }
-
- SAnimationTrack(int inHandle, Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex, EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic, bool inArtistEdited)
- : CHandleObject(inHandle)
- , m_Slide(inSlide)
- , m_Instance(inInstance)
- , m_Property(inProperty)
- , m_AnimationType(inAnimationType)
- , m_Index(inIndex)
- , m_KeyframesDirty(false)
- , m_FirstKeyframeDynamic(inFirstKeyframeDynamic)
- , m_ArtistEdited(inArtistEdited)
- {
- }
-
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeSAnimationTrack;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-struct SKeyframe : public CHandleObject
-{
- TKeyframe m_Keyframe;
- int m_Animation;
-
- SKeyframe(int inHandle, int inAnimation, const TKeyframe &inKeyframe)
- : CHandleObject(inHandle)
- , m_Keyframe(inKeyframe)
- , m_Animation(inAnimation)
- {
- }
-
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeSKeyframe;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-class CAnimationCoreProducer;
-
-class CSimpleAnimationCore : public CHandleBase, public IAnimationCore
-{
- TStringTablePtr m_StringTable;
- typedef std::unordered_multimap<std::pair<int, int>,
- std::shared_ptr<SAnimationTrack>, pair_hash> TStateInstanceAnimationMap;
- // state,instance pair map to animation handle to speed up querying if a particular
- // property is animated.
- mutable TStateInstanceAnimationMap m_AnimationMatchesCache;
-
-public: // Use
- friend class CAnimationCoreProducer;
- // We don't use the string table ptr we are constructed with
- // but the testing system needs an unified interface to creating
- // objects
- CSimpleAnimationCore() {}
- CSimpleAnimationCore(TStringTablePtr strTable)
- : m_StringTable(strTable)
- {
- }
- TStringTablePtr GetStringTablePtr() const { return m_StringTable; }
-
- Qt3DSDMAnimationHandle CreateAnimation(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic) override;
- void DeleteAnimation(Qt3DSDMAnimationHandle inAnimation) override;
- Qt3DSDMAnimationHandle GetAnimation(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex) const override;
- SAnimationInfo GetAnimationInfo(Qt3DSDMAnimationHandle inAnimation) const override;
- void GetAnimations(TAnimationHandleList &outAnimations) const override;
- void GetAnimations(TAnimationInfoList &outAnimations, Qt3DSDMSlideHandle inMaster,
- Qt3DSDMSlideHandle inSlide) const override;
- void GetSpecificInstanceAnimations(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- TAnimationHandleList &outAnimations) override;
-
- void SetFirstKeyframeDynamic(Qt3DSDMAnimationHandle inAnimation, bool inValue) override;
-
- // keyframe manipulation
- Qt3DSDMKeyframeHandle InsertKeyframe(Qt3DSDMAnimationHandle inAnimation,
- const TKeyframe &inKeyframe) override;
- void EraseKeyframe(Qt3DSDMKeyframeHandle inKeyframe) override;
- void DeleteAllKeyframes(Qt3DSDMAnimationHandle inAnimation) override;
- Qt3DSDMAnimationHandle GetAnimationForKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const override;
- TKeyframe GetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe) const override;
- void SetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData) override;
- // Set the keyframe data, but don't set the artist edited flag. Used for undo/redo operations
- // where the artist edited flag has handeled by a different transaction
- void DoSetKeyframeData(Qt3DSDMKeyframeHandle inKeyframe, const TKeyframe &inData);
- void GetKeyframes(Qt3DSDMAnimationHandle inAnimation, TKeyframeHandleList &outKeyframes) const override;
- size_t GetKeyframeCount(Qt3DSDMAnimationHandle inAnimation) const override;
- bool IsFirstKeyframe(Qt3DSDMKeyframeHandle inKeyframe) const override;
- // Only implemented in the producer for now.
- void OffsetAnimations(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inInstance,
- long inOffset) override;
-
- void SetIsArtistEdited(Qt3DSDMAnimationHandle inAnimation, bool inEdited = true) override;
- bool IsArtistEdited(Qt3DSDMAnimationHandle inAnimation) const override;
-
- // Animation Evaluation.
- float EvaluateAnimation(Qt3DSDMAnimationHandle inAnimation, float inSeconds) const override;
-
- bool KeyframeValid(Qt3DSDMKeyframeHandle inKeyframe) const override;
- bool AnimationValid(Qt3DSDMAnimationHandle inAnimation) const override;
-
- // Only implemented at the producer level, not at the simple core level.
- void CopyAnimations(Qt3DSDMSlideHandle /*inSourceSlide*/,
- Qt3DSDMInstanceHandle /*inSourceInstance*/,
- Qt3DSDMSlideHandle /*inDestSlide*/, Qt3DSDMInstanceHandle /*inDestInstance*/) override
- {
- throw AnimationNotFound(L"");
- }
-
- // Lookup cache management so we can find particular animations quickly.
- void ClearAnimationMatchesLookupCache() const { m_AnimationMatchesCache.clear(); }
- void AddAnimationToLookupCache(Qt3DSDMAnimationHandle inAnimation) const;
- void RemoveAnimationFromLookupCache(Qt3DSDMAnimationHandle inAnimation) const;
- void AddAnimationToLookupCache(std::shared_ptr<SAnimationTrack> inAnimation) const;
- void RemoveAnimationFromLookupCache(std::shared_ptr<SAnimationTrack> inAnimation) const;
-
- void EnsureAnimationCache() const;
-
- Qt3DSDMAnimationHandle CreateAnimationWithHandle(int inHandle, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, size_t inIndex,
- EAnimationType inAnimationType,
- bool inFirstKeyframeDynamic);
-
- static SAnimationTrack *GetAnimationNF(int inHandle, THandleObjectMap &inObjects)
- {
- return const_cast<SAnimationTrack *>(
- GetAnimationNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const SAnimationTrack *GetAnimationNF(int inHandle, const THandleObjectMap &inObjects)
- {
- const SAnimationTrack *theAnimation = GetHandleObject<SAnimationTrack>(inHandle, inObjects);
- if (theAnimation)
- return theAnimation;
- throw AnimationNotFound(L"");
- }
-
- static SKeyframe *GetKeyframeNF(int inHandle, THandleObjectMap &inObjects)
- {
- return const_cast<SKeyframe *>(
- GetKeyframeNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const SKeyframe *GetKeyframeNF(int inHandle, const THandleObjectMap &inObjects)
- {
- const SKeyframe *theItem = GetHandleObject<SKeyframe>(inHandle, inObjects);
- if (theItem)
- return theItem;
- throw AnimationKeyframeNotFound(L"");
- }
-};
-
-typedef std::shared_ptr<CSimpleAnimationCore> TSimpleAnimationCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.cpp
deleted file mode 100644
index d6a1470b..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.cpp
+++ /dev/null
@@ -1,574 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "SimpleDataCore.h"
-
-namespace qt3dsdm {
-Qt3DSDMDebugLogFunction g_DataModelDebugLogger = NULL;
-// Instances
-Qt3DSDMInstanceHandle CSimpleDataCore::CreateInstance(Qt3DSDMInstanceHandle hdl)
-{
- int nextId = hdl;
- if (hdl.Valid() == false)
- nextId = GetNextId();
-
- return CreateInstanceWithHandle(nextId);
-}
-
-inline void RemoveParentFromClass(int inParent, int inChild, THandleObjectMap &inMap)
-{
- TDataModelInstancePtr theInstance = CSimpleDataCore::GetInstanceNF(inChild, inMap);
- theInstance->m_Parents.erase(theInstance->m_Parents.find(inParent));
- // Cascade the delete operation
-}
-
-void CSimpleDataCore::DeleteInstance(Qt3DSDMInstanceHandle inHandle)
-{
- // Ensure it exists in the first place.
- CSimpleDataCore::GetInstanceNF(inHandle, m_Objects); // Check for instance existance
- CSimpleDataCore::EraseHandle(inHandle, m_Objects);
- TIntList properties;
- TIntList instances;
- do_all(m_Objects, std::bind(FindRelatedItemsForDelete, inHandle.GetHandleValue(),
- std::ref(properties), std::ref(instances), std::placeholders::_1));
- do_all(instances, std::bind(RemoveParentFromClass, inHandle.GetHandleValue(),
- std::placeholders::_1, std::ref(m_Objects)));
- do_all(properties, std::bind(EraseHandle, std::placeholders::_1, std::ref(m_Objects)));
-}
-
-void CSimpleDataCore::GetInstances(TInstanceHandleList &outInstances) const
-{
- // reserve the vector to m_Objects.size() to prevent vector reallocation
- // m_Objects.size() is the upper bound of the no of instances
- // the exact no of instances = m_Objects.size() - the no of properties as added by
- // CClientDataModelBridge::InitializeDataCore (as of now, we have 31 properties)
- outInstances.reserve(m_Objects.size());
- do_all(m_Objects, std::bind(MaybeAddObject<CDataModelInstance, Qt3DSDMInstanceHandle>,
- std::placeholders::_1, std::ref(outInstances)));
-}
-
-// Get instances that are derived from a specific parent
-void CSimpleDataCore::GetInstancesDerivedFrom(TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParentHandle) const
-{
- do_all(m_Objects, std::bind(&CSimpleDataCore::AddInstanceIfDerivedFrom, this,
- std::placeholders::_1,
- std::ref(outInstances), inParentHandle));
-}
-
-// add instance that is derived from a specific parent
-void CSimpleDataCore::AddInstanceIfDerivedFrom(const std::pair<int, THandleObjectPtr> &inItem,
- TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParentHandle) const
-{
- if (inItem.second->GetType() == CHandleObject::EHandleObjectTypeCDataModelInstance) {
- TDataModelInstancePtr theInstance = static_pointer_cast<CDataModelInstance>(inItem.second);
- if (IsInstanceOrDerivedFromHelper(theInstance, inParentHandle))
- outInstances.push_back(inItem.first);
- }
-}
-
-// Derivation
-void CSimpleDataCore::DeriveInstance(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent)
-{
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger("CSimpleDataCore::DeriveInstance Enter");
- TDataModelInstancePtr theInstance = CSimpleDataCore::GetInstanceNF(inInstance, m_Objects);
- if (theInstance->m_Parents.find(inParent) == theInstance->m_Parents.end()) {
- std::shared_ptr<CDataModelInstance> theParent(GetInstanceNF(inParent, m_Objects));
- theInstance->m_Parents.insert(make_pair(inParent, theParent));
- }
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger("CSimpleDataCore::DeriveInstance Leave");
-}
-
-void CSimpleDataCore::GetInstanceParents(Qt3DSDMInstanceHandle inHandle,
- TInstanceHandleList &outParents) const
-{
- const TDataModelInstancePtr theInstance = GetInstanceNF(inHandle, m_Objects);
- for (CDataModelInstance::TInstancePairList::const_iterator theParent =
- theInstance->m_Parents.begin();
- theParent != theInstance->m_Parents.end(); ++theParent)
- outParents.push_back(theParent->first);
-}
-
-inline bool ComparePropertyNames(const TCharStr &inName, int inPropHandle,
- const THandleObjectMap &inObjects)
-{
- if (CSimpleDataCore::GetPropertyDefinitionNF(inPropHandle, inObjects)->m_Definition.m_Name
- == inName)
- return true;
- return false;
-}
-
-inline const wchar_t *SafeStrPtr(const wchar_t *inData)
-{
- return inData == NULL ? L"" : inData;
-}
-
-// Properties
-Qt3DSDMPropertyHandle CSimpleDataCore::AddProperty(Qt3DSDMInstanceHandle inInstance, TCharPtr inName,
- DataModelDataType::Value inPropType)
-{
- QT3DSDM_LOG_FUNCTION("CSimpleDataCore::AddProperty");
- QT3DSDM_DEBUG_LOG(m_StringTable->GetNarrowStr(inName));
- TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- TCharStr theName(inName);
- if (find_if<TIntList::iterator>(
- theInstance->m_Properties,
- std::bind(ComparePropertyNames, std::ref(theName),
- std::placeholders::_1, std::ref(m_Objects)))
- != theInstance->m_Properties.end()) {
- QT3DSDM_DEBUG_LOG("Property Exists!!");
- throw PropertyExists(L"");
- }
-
- int nextId = GetNextId();
- return AddPropertyWithHandle(nextId, inInstance, inName, inPropType);
-}
-
-void CSimpleDataCore::GetInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const
-{
- transformv_all(GetInstanceNF(inInstance, m_Objects)->m_Properties, outProperties);
-}
-
-const Qt3DSDMPropertyDefinition &CSimpleDataCore::GetProperty(Qt3DSDMPropertyHandle inProperty) const
-{
- const CDataModelPropertyDefinitionObject *theProp =
- GetPropertyDefinitionNF(inProperty, m_Objects);
- return theProp->m_Definition;
-}
-
-void CSimpleDataCore::RemoveProperty(Qt3DSDMPropertyHandle inProperty)
-{
- CDataModelPropertyDefinitionObject *theProp =
- CSimpleDataCore::GetPropertyDefinitionNF(inProperty, m_Objects);
- TDataModelInstancePtr theInstance =
- CSimpleDataCore::GetInstanceNF(theProp->m_Definition.m_Instance, m_Objects);
- erase_if(theInstance->m_Properties,
- std::bind(equal_to<int>(), inProperty.GetHandleValue(), std::placeholders::_1));
- CSimpleDataCore::EraseHandle(inProperty, m_Objects);
-}
-
-inline bool PropertyMatches(int inProperty, Qt3DSDMPropertyHandle inTarget)
-{
- return inProperty == inTarget.GetHandleValue();
-}
-
-inline bool GetInstanceValue(Qt3DSDMInstanceHandle inInstanceHandle,
- Qt3DSDMPropertyHandle inPropertyHandle, CSimpleDataCore &inDataCore,
- SValue &outValue)
-{
- const TDataModelInstancePtr theInstance =
- CSimpleDataCore::GetInstanceNF(inInstanceHandle, inDataCore.m_Objects);
-
- TPropertyPairHash::const_iterator theInstanceProp =
- theInstance->m_PropertyValues.find(inPropertyHandle.GetHandleValue());
- if (theInstanceProp != theInstance->m_PropertyValues.end()) {
- outValue = theInstanceProp->second.second.GetValue();
- return true;
- }
- return false;
-}
-
-inline void CopyInstanceProperty(Qt3DSDMPropertyHandle inSrcPropertyHandle,
- Qt3DSDMInstanceHandle inSrcInstanceHandle,
- Qt3DSDMInstanceHandle inInstanceHandle, CSimpleDataCore &inDataCore)
-{
- // create the property definition that matches the source
- const Qt3DSDMPropertyDefinition &theProperty = inDataCore.GetProperty(inSrcPropertyHandle);
- Qt3DSDMPropertyHandle theNewProperty =
- inDataCore.AddProperty(inInstanceHandle, theProperty.m_Name.wide_str(), theProperty.m_Type);
- // copy the value if one exists on the src.
- SValue theValue;
- if (GetInstanceValue(inSrcInstanceHandle, inSrcPropertyHandle, inDataCore, theValue))
- inDataCore.SetInstancePropertyValue(inInstanceHandle, theNewProperty, theValue);
-}
-
-// logic : if destination property is one gained through derivation in inSrcInstanceHandle, copy the
-// value over.
-inline void CopyAggregatedPropertyValues(Qt3DSDMPropertyHandle inDestPropertyHandle,
- Qt3DSDMInstanceHandle inSrcInstanceHandle,
- Qt3DSDMInstanceHandle inInstanceHandle,
- const TPropertyHandleList &inSrcNonAggregateList,
- CSimpleDataCore &inDataCore)
-{
- if (find_if(inSrcNonAggregateList.begin(), inSrcNonAggregateList.end(),
- bind(PropertyMatches, inDestPropertyHandle, std::placeholders::_1))
- == inSrcNonAggregateList.end()
- && inDataCore.HasAggregateInstanceProperty(inSrcInstanceHandle, inDestPropertyHandle)) {
- SValue theValue;
- if (GetInstanceValue(inSrcInstanceHandle, inDestPropertyHandle, inDataCore, theValue))
- inDataCore.SetInstancePropertyValue(inInstanceHandle, inDestPropertyHandle, theValue);
- }
-}
-
-void CSimpleDataCore::CopyInstanceProperties(Qt3DSDMInstanceHandle inSrcInstance,
- Qt3DSDMInstanceHandle inDestInstance)
-{
- TPropertyHandleList theList;
- GetInstanceProperties(inSrcInstance, theList);
- do_all(theList, bind(CopyInstanceProperty, std::placeholders::_1,
- inSrcInstance, inDestInstance, ref(*this)));
-
- TPropertyHandleList theDestList;
- GetAggregateInstanceProperties(inDestInstance, theDestList);
- do_all(theDestList, std::bind(CopyAggregatedPropertyValues, std::placeholders::_1,
- inSrcInstance, inDestInstance,
- theList, std::ref(*this)));
-}
-
-void CSimpleDataCore::RemoveCachedValues(Qt3DSDMInstanceHandle inInstance)
-{
- const TDataModelInstancePtr theInstance = CSimpleDataCore::GetInstanceNF(inInstance, m_Objects);
- theInstance->RemoveCachedValues();
-}
-
-void GetAggregateProperties(const TDataModelInstancePtr inInstance, TIntList &inVisited,
- TPropertyHandleList &outProperties)
-{
- if (find(inVisited.begin(), inVisited.end(), inInstance->m_Handle) == inVisited.end()) {
- inVisited.push_back(inInstance->m_Handle);
- size_t theSize = outProperties.size();
- outProperties.resize(theSize + inInstance->m_Properties.size());
- transform(inInstance->m_Properties.begin(), inInstance->m_Properties.end(),
- outProperties.begin() + theSize, identity<int>);
- for (CDataModelInstance::TInstancePairList::const_iterator theParent =
- inInstance->m_Parents.begin();
- theParent != inInstance->m_Parents.end(); ++theParent)
- GetAggregateProperties(theParent->second, inVisited, outProperties);
- }
-}
-
-template <typename TPredicate>
-inline std::tuple<bool, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle>
-RecurseFindProperty(const TDataModelInstancePtr inInstance, TPredicate inPredicate)
-{
- TIntList::const_iterator theFind = eastl::find_if(inInstance->m_Properties.begin(),
- inInstance->m_Properties.end(), inPredicate);
- if (theFind != inInstance->m_Properties.end())
- return make_tuple(true, inInstance->m_Handle, *theFind);
-
- for (CDataModelInstance::TInstancePairList::const_iterator theParent =
- inInstance->m_Parents.begin();
- theParent != inInstance->m_Parents.end(); ++theParent) {
- std::tuple<bool, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle> theValue =
- RecurseFindProperty(theParent->second, inPredicate);
- if (get<0>(theValue))
- return theValue;
- }
- return make_tuple(false, 0, 0);
-}
-
-inline bool PropertyNameMatches(int inProperty, const THandleObjectMap &inObjects,
- const TCharStr &inStr)
-{
- const CDataModelPropertyDefinitionObject *theProp =
- CSimpleDataCore::GetPropertyDefinitionNF(inProperty, inObjects);
- return (theProp->m_Definition.m_Name == inStr);
-}
-
-Qt3DSDMPropertyHandle
-CSimpleDataCore::GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const
-{
- const TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- return get<2>(
- RecurseFindProperty(theInstance, std::bind(PropertyNameMatches,
- std::placeholders::_1, std::ref(m_Objects),
- std::ref(inStr))));
-}
-
-// A simplified RecurseFindProperty function
-bool RecurseFindPropertyMatches(const TDataModelInstancePtr inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- TIntList::const_iterator theFind =
- find(inInstance->m_Properties.begin(), inInstance->m_Properties.end(),
- inProperty.GetHandleValue());
- if (theFind != inInstance->m_Properties.end())
- return true;
-
- for (CDataModelInstance::TInstancePairList::const_iterator theParent =
- inInstance->m_Parents.begin();
- theParent != inInstance->m_Parents.end(); ++theParent) {
- if (RecurseFindPropertyMatches(theParent->second, inProperty))
- return true;
- }
- return false;
-}
-
-bool CSimpleDataCore::HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
-{
- const TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- if (theInstance->m_PropertyValues.find(inProperty.GetHandleValue())
- != theInstance->m_PropertyValues.end())
- return true;
-
- return RecurseFindPropertyMatches(theInstance, inProperty);
-}
-
-void CSimpleDataCore::GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const
-{
- TIntList inVisited;
- const TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- GetAggregateProperties(theInstance, inVisited, outProperties);
-}
-
-void CSimpleDataCore::CheckValue(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) const
-{
- CheckPropertyExistence(GetInstanceNF(inInstance, m_Objects), inProperty, m_Objects);
- const CDataModelPropertyDefinitionObject *theDefinition =
- CSimpleDataCore::GetPropertyDefinitionNF(inProperty, m_Objects);
- CheckValueType(theDefinition->m_Definition.m_Type, inValue);
-}
-
-bool CSimpleDataCore::GetInstancePropertyValueHelper(const TDataModelInstancePtr inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- TPropertyPairHash::const_iterator theInstanceProp =
- inInstance->m_PropertyValues.find(inProperty);
- if (theInstanceProp != inInstance->m_PropertyValues.end()) {
- outValue = theInstanceProp->second.second.GetValue();
- return true;
- } else {
- // Is the property valid?
- const CDataModelPropertyDefinitionObject *theProp =
- GetPropertyDefinitionNF(inProperty, m_Objects);
- int thePropInstance = theProp->m_Definition.m_Instance;
- if (thePropInstance != inInstance->m_Handle) {
- for (CDataModelInstance::TInstancePairList::const_iterator theParent =
- inInstance->m_Parents.begin();
- theParent != inInstance->m_Parents.end(); ++theParent) {
- if (IsInstanceOrDerivedFromHelper(theParent->second, thePropInstance)
- && GetInstancePropertyValueHelper(theParent->second, inProperty, outValue)) {
- // Quietly propagate to this instance so next time we won't go through this
- // large property lookup chain.
- inInstance->m_PropertyValues.insert(std::make_pair(
- inProperty,
- TPropertyValuePair(
- PropertyValueFlags(PropertyValueFlags::SetViaAutoPropagate),
- SInternValue::ISwearThisHasAlreadyBeenInternalized(outValue))));
- return true;
- }
- }
- }
- }
- return false;
-}
-
-bool CSimpleDataCore::GetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- if (IsInstance(inHandle) == false || IsProperty(inProperty) == false) {
- Q_ASSERT(0);
- return false;
- }
- const TDataModelInstancePtr theInstance = GetInstanceNF(inHandle, m_Objects);
- return GetInstancePropertyValueHelper(theInstance, inProperty, outValue);
-}
-
-void CSimpleDataCore::SetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- if (IsInstance(inHandle) == false || IsProperty(inProperty) == false) {
- Q_ASSERT(0);
- return;
- }
- CheckValue(inHandle, inProperty, inValue);
- UncheckedSetSpecificInstancePropertyValue(inHandle, inProperty, inValue, PropertyValueFlags());
-}
-
-void CSimpleDataCore::GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inHandle,
- TPropertyHandleValuePairList &outValues)
-{
- if (IsInstance(inHandle) == false)
- return;
-
- TDataModelInstancePtr theInstance = GetInstanceNF(inHandle, m_Objects);
- for (TPropertyPairHash::const_iterator theIter = theInstance->m_PropertyValues.begin(),
- theEnd = theInstance->m_PropertyValues.end();
- theIter != theEnd; ++theIter) {
- const pair<int, TPropertyValuePair> &thePair(*theIter);
- if (thePair.second.first.IsSetViaAutoPropagation() == false) {
- Qt3DSDMPropertyHandle thePropertyHandle(thePair.first);
- SValue theValue(thePair.second.second.GetValue());
- outValues.push_back(make_pair(thePair.first, theValue));
- }
- }
-}
-
-bool CSimpleDataCore::IsInstance(int inHandle) const
-{
- return HandleObjectValid<CDataModelInstance>(inHandle, m_Objects);
-}
-bool CSimpleDataCore::IsProperty(int inHandle) const
-{
- return HandleObjectValid<CDataModelPropertyDefinitionObject>(inHandle, m_Objects);
-}
-
-Qt3DSDMInstanceHandle CSimpleDataCore::CreateInstanceWithHandle(int inHandle)
-{
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger("CSimpleDataCore::CreateInstance Enter");
- if (HandleValid(inHandle)) {
- if (g_DataModelDebugLogger) {
- g_DataModelDebugLogger("CSimpleDataCore::CreateInstance Handle Exists!!");
- char buf[32];
- sprintf(buf, "%d", inHandle);
- g_DataModelDebugLogger(buf);
- }
- throw HandleExists(L"");
- }
-
- THandleObjectPtr theHandleObjectPtr(new CDataModelInstance(inHandle));
- const pair<int, THandleObjectPtr> thePair(std::make_pair(inHandle, theHandleObjectPtr));
- m_Objects.insert(thePair);
-
- if (g_DataModelDebugLogger)
- g_DataModelDebugLogger("CSimpleDataCore::CreateInstance Leave");
-
- return inHandle;
-}
-
-Qt3DSDMPropertyHandle CSimpleDataCore::AddPropertyWithHandle(int inHandle,
- Qt3DSDMInstanceHandle inInstance,
- TCharPtr inName,
- DataModelDataType::Value inPropType)
-{
- QT3DSDM_DEBUG_LOG("CSimpleDataCore::AddPropertyWithHandle Enter");
- QT3DSDM_DEBUG_LOG(m_StringTable->GetNarrowStr(inName));
- if (HandleValid(inHandle)) {
- if (g_DataModelDebugLogger) {
- g_DataModelDebugLogger("CSimpleDataCore::AddPropertyWithHandle Handle Exists!!");
- char buf[32];
- sprintf(buf, "%d", inHandle);
- g_DataModelDebugLogger(buf);
- }
-
- throw HandleExists(L"");
- }
-
- TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
-
- Qt3DSDMPropertyDefinition theDefinition(inInstance, SafeStrPtr(inName), inPropType);
- THandleObjectPtr theHandleObjectPtr(
- new CDataModelPropertyDefinitionObject(inHandle, theDefinition));
- const pair<int, THandleObjectPtr> thePair(std::make_pair(inHandle, theHandleObjectPtr));
- m_Objects.insert(thePair);
- theInstance->m_Properties.push_back(inHandle);
- QT3DSDM_DEBUG_LOG("CSimpleDataCore::AddPropertyWithHandle Leave");
- return inHandle;
-}
-
-bool CSimpleDataCore::GetSpecificInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- const TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- TPropertyPairHash::const_iterator theInstanceProp =
- theInstance->m_PropertyValues.find(inProperty);
- if (theInstanceProp != theInstance->m_PropertyValues.end()) {
- outValue = theInstanceProp->second.second.GetValue();
- return true;
- }
- return false;
-}
-
-void CSimpleDataCore::GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inInstance,
- TPropertyPairHash &outValues) const
-{
- const TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- outValues = theInstance->m_PropertyValues;
-}
-
-void CSimpleDataCore::UncheckedSetSpecificInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue,
- PropertyValueFlags inIsUserSet)
-{
- TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- TPropertyValuePair theValuePair(inIsUserSet, SInternValue(inValue, GetStringTable()));
-
- std::pair<TPropertyPairHash::iterator, bool> theInsert = theInstance->m_PropertyValues.insert(
- std::make_pair(inProperty.GetHandleValue(), theValuePair));
- if (theInsert.second == false)
- theInsert.first->second = theValuePair;
-}
-
-bool CSimpleDataCore::CheckParentPropertyExistenceWithFail(const TDataModelInstancePtr inInstance,
- int inProperty,
- const THandleObjectMap &inObjects)
-{
- if (find(inInstance->m_Properties.begin(), inInstance->m_Properties.end(), inProperty)
- != inInstance->m_Properties.end())
- return true;
- for (CDataModelInstance::TInstancePairList::const_iterator theParent =
- inInstance->m_Parents.begin();
- theParent != inInstance->m_Parents.end(); ++theParent) {
- if (CheckParentPropertyExistenceWithFail(theParent->second, inProperty, inObjects))
- return true;
- }
- return false;
-}
-
-// safety check to see if property exists
-void CSimpleDataCore::CheckPropertyExistence(const TDataModelInstancePtr inInstance, int inProperty,
- const THandleObjectMap &inObjects)
-{
- if (!CheckParentPropertyExistenceWithFail(inInstance, inProperty, inObjects))
- throw PropertyNotFound(L"");
-}
-
-bool CSimpleDataCore::IsInstanceOrDerivedFromHelper(const TDataModelInstancePtr inInstance,
- Qt3DSDMInstanceHandle inParent) const
-{
- if (inInstance->m_Handle == inParent) // Am I this object?
- return true;
- return inInstance->IsDerivedFrom(inParent);
-}
-
-bool CSimpleDataCore::IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const
-{
- if (IsInstance(inInstance) == false || IsInstance(inParent) == false)
- return false;
- if (inInstance == inParent) // Am I this object?
- return true;
- const TDataModelInstancePtr theInstance = GetInstanceNF(inInstance, m_Objects);
- return IsInstanceOrDerivedFromHelper(theInstance, inParent);
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.h
deleted file mode 100644
index 2664dab4..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleDataCore.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef DATACOREH
-#define DATACOREH
-
-#include "Qt3DSDMDataTypes.h"
-#include "Qt3DSDMSignals.h"
-#include "HandleSystemBase.h"
-#include "Qt3DSDMPropertyDefinition.h"
-#include "Qt3DSDMDataCore.h"
-#include "Qt3DSDMStringTable.h"
-#include <unordered_set>
-#include "Qt3DSDMValue.h"
-
-namespace qt3dsdm {
-
-struct PropertyValueFlags
-{
- enum Enum {
- // Property values that are set via event propagation should
- // not be serialized to a file. The auto-propagation step
- // is meant to make looking up property values quicker because
- // the the derivation chain doesn't need to be followed to get
- // the latest default value.
- SetViaAutoPropagate = 1,
- };
-
- int m_Flags;
-
- PropertyValueFlags()
- : m_Flags(0)
- {
- }
- explicit PropertyValueFlags(int inFlags)
- : m_Flags(inFlags)
- {
- }
-
- bool IsSetViaAutoPropagation() const { return (m_Flags & SetViaAutoPropagate) > 0; }
-};
-
-// Pair of property value flags and property value. The property value flags allow
-// us to track metadata that is
-typedef std::pair<PropertyValueFlags, SInternValue> TPropertyValuePair;
-typedef std::unordered_map<int, TPropertyValuePair> TPropertyPairHash;
-// Property pairs are referred to by property handle.
-typedef std::pair<int, TPropertyValuePair> TPropertyPair;
-typedef std::vector<TPropertyPair> TPropertyPairList;
-
-class CDataModelPropertyDefinitionObject : public CHandleObject
-{
-public:
- Qt3DSDMPropertyDefinition m_Definition;
-
- CDataModelPropertyDefinitionObject(int inHandle, const Qt3DSDMPropertyDefinition &inDefinition)
- : CHandleObject(inHandle)
- , m_Definition(inDefinition)
- {
- }
- CDataModelPropertyDefinitionObject() {}
-
- static const EHandleObjectType s_Type =
- CHandleObject::EHandleObjectTypeCDataModelPropertyDefinitionObject;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-typedef std::unordered_map<int, SInternValue> TIntStringVariantList;
-
-class CDataModelInstance : public CHandleObject
-{
-public:
- typedef std::pair<int, std::shared_ptr<CDataModelInstance>> TInstancePair;
- typedef std::unordered_map<int, std::shared_ptr<CDataModelInstance>> TInstancePairList;
- typedef std::unordered_map<int, bool> TInstanceParentMap;
-
- TInstancePairList m_Parents;
- mutable TInstanceParentMap m_CachedParents;
- // Properties specific to this class
- TIntList m_Properties;
- TPropertyPairHash m_PropertyValues;
-
- CDataModelInstance() {}
- CDataModelInstance(int inHandle)
- : CHandleObject(inHandle)
- {
- }
-
- void ToPropertyPairList(TPropertyPairList &outList) const
- {
- for (TPropertyPairHash::const_iterator iter = m_PropertyValues.begin(),
- end = m_PropertyValues.end();
- iter != end; ++iter)
- outList.push_back(*iter);
- }
-
- void FromPropertyPairList(const TPropertyPairList &inList)
- {
- m_PropertyValues.clear();
- for (TPropertyPairList::const_iterator iter = inList.begin(), end = inList.end();
- iter != end; ++iter)
- m_PropertyValues.insert(*iter);
- }
-
- void ClearParentCache() const { m_CachedParents.clear(); }
-
- bool IsDerivedFrom(Qt3DSDMInstanceHandle inParent) const
- {
- std::pair<TInstanceParentMap::iterator, bool> theQueryResult =
- m_CachedParents.insert(std::make_pair(inParent.GetHandleValue(), false));
- // If the insert failed, returned what the hashtable already had in it
- if (theQueryResult.second == false)
- return theQueryResult.first->second;
-
- // Else find a valid answer
- if (m_Parents.find(inParent.GetHandleValue()) != m_Parents.end()) {
- theQueryResult.first->second = true;
- } else {
- for (TInstancePairList::const_iterator iter = m_Parents.begin(), end = m_Parents.end();
- iter != end; ++iter) {
- if (iter->second->IsDerivedFrom(inParent)) {
- theQueryResult.first->second = true;
- break;
- }
- }
- }
-
- // Note that we inserted false to begin with. This means that
- // we can return the insert result here safely as if it wasn't
- // supposed to be false, we would have set it above.
- return theQueryResult.first->second;
- }
-
- void RemoveCachedValues()
- {
- vector<int> theCachedProperties;
-
- for (TPropertyPairHash::iterator theProperty = m_PropertyValues.begin(),
- end = m_PropertyValues.end();
- theProperty != end; ++theProperty) {
- if (theProperty->second.first.IsSetViaAutoPropagation())
- theCachedProperties.push_back(theProperty->first);
- }
-
- for (size_t idx = 0, end = theCachedProperties.size(); idx < end; ++idx)
- m_PropertyValues.erase(theCachedProperties[idx]);
- }
-
- // CHandleObject
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeCDataModelInstance;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-typedef std::shared_ptr<CDataModelInstance> TDataModelInstancePtr;
-
-class CSimpleDataCore : public CHandleBase, public IDataCore
-{
- mutable TStringTablePtr m_StringTable;
-
-public:
- CSimpleDataCore(TStringTablePtr strTable)
- : m_StringTable(strTable)
- {
- }
- CSimpleDataCore(const CSimpleDataCore &inOther)
- : CHandleBase(inOther)
- , m_StringTable(inOther.m_StringTable)
- {
- }
-
- CSimpleDataCore &operator=(const CSimpleDataCore &inOther)
- {
- CHandleBase::operator=(inOther);
- return *this;
- }
-
- IStringTable &GetStringTable() const override { return *m_StringTable.get(); }
- TStringTablePtr GetStringTablePtr() const override { return m_StringTable; }
-
- // IHandleBase
- bool HandleValid(int inHandle) const override
- {
- return m_Objects.find(inHandle) != m_Objects.end();
- }
-
- // IInstancePropertyCore
- Qt3DSDMPropertyHandle GetAggregateInstancePropertyByName(Qt3DSDMInstanceHandle inInstance,
- const TCharStr &inStr) const override;
- void GetAggregateInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const override;
- void GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inHandle,
- TPropertyHandleValuePairList &outValues) override;
- bool HasAggregateInstanceProperty(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const override;
- void CheckValue(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) const override;
- bool GetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- void SetInstancePropertyValue(Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
-
- // IDataCore
- //===============================================================
- Qt3DSDMInstanceHandle CreateInstance(Qt3DSDMInstanceHandle hdl = Qt3DSDMInstanceHandle()) override;
- void DeleteInstance(Qt3DSDMInstanceHandle inHandle) override;
- void GetInstances(TInstanceHandleList &outInstances) const override;
- void GetInstancesDerivedFrom(TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParentHandle) const override;
-
- void DeriveInstance(Qt3DSDMInstanceHandle inInstance, Qt3DSDMInstanceHandle inParent) override;
- void GetInstanceParents(Qt3DSDMInstanceHandle inHandle,
- TInstanceHandleList &outParents) const override;
- // Returns true if inParent == inInstance || inInstance is derived from inParent somehow.
- // Recursive.
- bool IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMInstanceHandle inParent) const override;
-
- Qt3DSDMPropertyHandle AddProperty(Qt3DSDMInstanceHandle inClass, TCharPtr inName,
- DataModelDataType::Value inPropType) override;
- const Qt3DSDMPropertyDefinition &GetProperty(Qt3DSDMPropertyHandle inProperty) const override;
- void GetInstanceProperties(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleList &outProperties) const override;
- void RemoveProperty(Qt3DSDMPropertyHandle inProperty) override;
- void CopyInstanceProperties(Qt3DSDMInstanceHandle inSrcInstance,
- Qt3DSDMInstanceHandle inDestInstance) override;
- void RemoveCachedValues(Qt3DSDMInstanceHandle inInstance) override;
-
- bool IsInstance(int inHandle) const override;
- bool IsProperty(int inHandle) const override;
- //===============================================================
-
- bool GetSpecificInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const;
- void GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inInstance,
- TPropertyPairHash &outValues) const;
-
- static CDataModelPropertyDefinitionObject *GetPropertyDefinitionNF(int inHandle,
- THandleObjectMap &inObjects)
- {
- return const_cast<CDataModelPropertyDefinitionObject *>(
- GetPropertyDefinitionNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const CDataModelPropertyDefinitionObject *
- GetPropertyDefinitionNF(int inHandle, const THandleObjectMap &inObjects)
- {
- const CDataModelPropertyDefinitionObject *theClass =
- GetHandleObject<CDataModelPropertyDefinitionObject>(inHandle, inObjects);
- if (theClass)
- return theClass;
- throw PropertyNotFound(L"");
- }
-
- static TDataModelInstancePtr GetInstance(int inHandle, const THandleObjectMap &inObjects)
- {
- THandleObjectMap::const_iterator theFind(inObjects.find(inHandle));
- // dynamic cast isn't allowed in runtime code as the runtime doesn't enable rtti.
- if (theFind != inObjects.end())
- return std::static_pointer_cast<CDataModelInstance>(theFind->second);
- return TDataModelInstancePtr();
- }
-
- static TDataModelInstancePtr GetInstanceNF(int inHandle, const THandleObjectMap &inObjects)
- {
- TDataModelInstancePtr retval = GetInstance(inHandle, inObjects);
- if (retval)
- return retval;
- throw InstanceNotFound(L"");
- }
-
- static inline bool InstancePairMatches(int inHandle,
- const CDataModelInstance::TInstancePair &inInstancePair)
- {
- return inHandle == inInstancePair.first;
- }
-
- // if inInstance doesn't exists in inObjects, it will push back NULL instead of throwing
- // exception
- static inline void UncheckAddInstancePair(CDataModelInstance::TInstancePairList &outInstances,
- Qt3DSDMInstanceHandle inInstance,
- THandleObjectMap &inObjects)
- {
- outInstances.insert(
- std::make_pair(inInstance, CSimpleDataCore::GetInstance(inInstance, inObjects)));
- }
-
- static inline bool InstancePropertyMatches(int inProp, const TPropertyPair &inPropPair)
- {
- return inProp == inPropPair.first;
- }
-
- static bool CheckParentPropertyExistenceWithFail(const TDataModelInstancePtr inInstance,
- int inProperty,
- const THandleObjectMap &inObjects);
-
- static void CheckPropertyExistence(const TDataModelInstancePtr inInstance, int inProperty,
- const THandleObjectMap &inObjects);
-
- static inline void FindRelatedItemsForDelete(int inInstance, TIntList &outProperties,
- TIntList &outChildInstances,
- const std::pair<int, THandleObjectPtr> &inPair)
- {
-
- using namespace std;
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeCDataModelInstance) {
- TDataModelInstancePtr theInstance =
- static_pointer_cast<CDataModelInstance>(inPair.second);
- // No longer a parent class.
- if (find_if(theInstance->m_Parents.begin(), theInstance->m_Parents.end(),
- std::bind(InstancePairMatches, inInstance, std::placeholders::_1))
- != theInstance->m_Parents.end())
- outChildInstances.push_back(inPair.first);
- } else if (inPair.second->GetType()
- == CHandleObject::EHandleObjectTypeCDataModelPropertyDefinitionObject) {
- const CDataModelPropertyDefinitionObject *theProperty =
- static_cast<const CDataModelPropertyDefinitionObject *>(inPair.second.get());
- if (theProperty->m_Definition.m_Instance.GetHandleValue() == inInstance)
- outProperties.push_back(inPair.first);
- }
- }
-
-protected:
- bool IsInstanceOrDerivedFromHelper(const TDataModelInstancePtr inInstance,
- Qt3DSDMInstanceHandle inParent) const;
- void AddInstanceIfDerivedFrom(const std::pair<int, THandleObjectPtr> &inItem,
- TInstanceHandleList &outInstances,
- Qt3DSDMInstanceHandle inParentHandle) const;
-
- bool GetInstancePropertyValueHelper(const TDataModelInstancePtr inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const;
-
- // Create an instance *at* this specific handle position
- // This is used for special cases of serialization
- Qt3DSDMInstanceHandle CreateInstanceWithHandle(int inHandle);
- Qt3DSDMPropertyHandle AddPropertyWithHandle(int inHandle, Qt3DSDMInstanceHandle inClass,
- TCharPtr inName, DataModelDataType::Value inPropType);
-
- void UncheckedSetSpecificInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue,
- PropertyValueFlags inIsUserSet);
-};
-
-typedef std::shared_ptr<CSimpleDataCore> TSimpleDataCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.cpp
deleted file mode 100644
index 87eadb9f..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.cpp
+++ /dev/null
@@ -1,420 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "SimpleSlideCore.h"
-
-using namespace std;
-#ifdef _WIN32
-#pragma warning(disable : 4503)
-#endif
-
-namespace qt3dsdm {
-
-Qt3DSDMSlideHandle CSimpleSlideCore::CreateSlide(Qt3DSDMInstanceHandle inInstance)
-{
- int nextId = GetNextId();
- return CreateSlideWithHandle(nextId, inInstance);
-}
-
-Qt3DSDMInstanceHandle CSimpleSlideCore::GetSlideInstance(Qt3DSDMSlideHandle inSlide) const
-{
- return GetSlideNF(inSlide, m_Objects)->m_Instance;
-}
-
-inline bool SlideInstanceMatches(const THandleObjectPair &inPair, int inInstance)
-{
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeSSlide
- && static_cast<const SSlide *>(inPair.second.get())->m_Instance == inInstance)
- return true;
- return false;
-}
-
-Qt3DSDMSlideHandle CSimpleSlideCore::GetSlideByInstance(Qt3DSDMInstanceHandle inInstance) const
-{
- THandleObjectMap::const_iterator theSlide =
- find_if(m_Objects.begin(), m_Objects.end(),
- std::bind(SlideInstanceMatches,
- std::placeholders::_1, inInstance.GetHandleValue()));
- if (theSlide != m_Objects.end())
- return theSlide->first;
- throw SlideNotFound(L"");
-}
-
-void RecurseDeleteSlide(Qt3DSDMSlideHandle inSlide, THandleObjectMap &inObjects,
- TInstanceHandleList &outInstances)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, inObjects);
- do_all(theSlide->m_Children,
- std::bind(RecurseDeleteSlide, std::placeholders::_1,
- std::ref(inObjects), std::ref(outInstances)));
- outInstances.push_back(theSlide->m_Instance);
- CHandleBase::EraseHandle(inSlide, inObjects);
-}
-
-void CSimpleSlideCore::DeleteSlide(Qt3DSDMSlideHandle inSlide, TInstanceHandleList &outInstances)
-{
- SSlide *theSlide = GetSlideNF(inSlide, m_Objects);
- if (theSlide->m_Parent) {
- SSlide *theParent = GetSlideNF(theSlide->m_Parent, m_Objects);
- erase_if(theParent->m_Children, std::bind(equal_to<int>(), theSlide->m_Handle,
- std::placeholders::_1));
- }
- RecurseDeleteSlide(inSlide, m_Objects, outInstances);
-}
-
-template <typename TDataType, typename TVectorType>
-inline void MaybeAddObject(const THandleObjectPair &inPair, vector<TVectorType> &outVectorItems)
-{
- if (inPair.second->GetType() == TDataType::s_Type)
- outVectorItems.push_back(inPair.first);
-}
-
-void CSimpleSlideCore::GetSlides(TSlideHandleList &outSlides) const
-{
- do_all(m_Objects,
- std::bind(MaybeAddObject<SSlide, Qt3DSDMSlideHandle>,
- std::placeholders::_1, std::ref(outSlides)));
-}
-
-float CSimpleSlideCore::GetSlideTime(Qt3DSDMSlideHandle inSlide) const
-{
- return GetSlideNF(inSlide, m_Objects)->m_Time;
-}
-
-void CSimpleSlideCore::SetSlideTime(Qt3DSDMSlideHandle inSlide, float inNewTime)
-{
- GetSlideNF(inSlide, m_Objects)->m_Time = inNewTime;
-}
-
-void CSimpleSlideCore::DeriveSlide(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent,
- int inIndex)
-{
- int oldParent = GetSlideNF(inSlide, m_Objects)->m_Parent;
- if (oldParent)
- erase_if(GetSlideNF(oldParent, m_Objects)->m_Children,
- std::bind(equal_to<int>(), inSlide, std::placeholders::_1));
- if (inParent.Valid()) {
- SSlide *theParent = GetSlideNF(inParent, m_Objects);
- if (exists(theParent->m_Children, std::bind(equal_to<int>(), inSlide,
- std::placeholders::_1)))
- throw SlideDerivationError(L"Already derived");
- if (inIndex < 0 || inIndex >= (int)theParent->m_Children.size())
- inIndex = (int)theParent->m_Children.size();
- theParent->m_Children.insert(theParent->m_Children.begin() + inIndex,
- inSlide.GetHandleValue());
- }
- GetSlideNF(inSlide, m_Objects)->m_Parent = inParent;
-}
-
-Qt3DSDMSlideHandle CSimpleSlideCore::GetParentSlide(Qt3DSDMSlideHandle inSlide) const
-{
- return GetSlideNF(inSlide, m_Objects)->m_Parent;
-}
-
-void CSimpleSlideCore::GetChildSlides(Qt3DSDMSlideHandle inSlide,
- TSlideHandleList &outChildren) const
-{
- transformv_all(GetSlideNF(inSlide, m_Objects)->m_Children, outChildren);
-}
-
-int CSimpleSlideCore::GetChildIndex(Qt3DSDMSlideHandle inParent, Qt3DSDMSlideHandle inChild) const
-{
- const SSlide *theSlide = GetSlideNF(inParent, m_Objects);
- size_t dist = distance(theSlide->m_Children.begin(),
- find_if<TIntList::const_iterator>(
- theSlide->m_Children, std::bind(equal_to<int>(), inChild,
- std::placeholders::_1)));
- if (dist == theSlide->m_Children.size())
- throw SlideChildNotFoundError(L"");
- return (int)dist;
-}
-
-bool CSimpleSlideCore::GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- const SSlide *theSlide = GetSlideNF(inSlide, m_Objects);
- SInternValue *theValue = theSlide->GetInstancePropertyValue(inHandle, inProperty);
- if (theValue) {
- outValue = theValue->GetValue();
- return true;
- }
- if (theSlide->m_Parent)
- return GetInstancePropertyValue(theSlide->m_Parent, inHandle, inProperty, outValue);
- return false;
-}
-
-std::pair<SSlide *, SInternValue *> CSimpleSlideCore::ResolveSetInstancePropertyValue(
- Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle, Qt3DSDMPropertyHandle inProperty)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, m_Objects);
- SInternValue *theValue = theSlide->GetInstancePropertyValue(inHandle, inProperty);
- // If we have the value already *or* or parent is not a valid slide, then return now
- if (theValue || theSlide->m_Parent == 0)
- return std::make_pair(theSlide, theValue);
- // Else give our parent a chance.
- return ResolveSetInstancePropertyValue(theSlide->m_Parent, inHandle, inProperty);
-}
-
-void CSimpleSlideCore::SetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- std::pair<SSlide *, SInternValue *> theTarget(
- ResolveSetInstancePropertyValue(inSlide, inHandle, inProperty));
- SInternValue theValue(inValue, GetStringTable());
- if (theTarget.second)
- *theTarget.second = theValue;
- else
- theTarget.first->SetInstancePropertyValue(inHandle, inProperty, theValue);
-}
-
-void CSimpleSlideCore::ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- CSimpleSlideCore::ForceSetPropertyValue(GetStringTable(), m_Objects, inSlide, inHandle,
- inProperty, inValue);
-}
-
-void CSimpleSlideCore::forceSetInstancePropertyValueOnAllSlides(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- for (auto &it : m_Objects) {
- if (it.second->GetType() == SSlide::s_Type) {
- Qt3DSDMSlideHandle slide(it.first);
- ForceSetInstancePropertyValue(slide, inInstance, inProperty, inValue);
- }
- }
-}
-
-bool CSimpleSlideCore::GetSpecificInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- const SSlide *theSlide = GetSlideNF(inSlide, m_Objects);
- SInternValue *theValue = theSlide->GetInstancePropertyValue(inInstance, inProperty);
- if (theValue) {
- outValue = theValue->GetValue();
- return true;
- }
- return false;
-}
-
-void CSimpleSlideCore::GetSpecificInstancePropertyValues(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleValuePairList &outValues)
-{
- const SSlide *theSlide = GetSlideNF(inSlide, m_Objects);
- theSlide->GetSpecificInstancePropertyValues(inInstance, outValues);
-}
-
-void CSimpleSlideCore::GetSlidePropertyEntries(Qt3DSDMSlideHandle inSlide,
- TSlideEntryList &outEntries) const
-{
- const SSlide *theSlide = GetSlideNF(inSlide, m_Objects);
- theSlide->ToSlideEntryList(outEntries);
-}
-
-bool CSimpleSlideCore::ContainsProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) const
-{
- const SSlide *theSlide = GetSlideNF(inSlide, m_Objects);
- return theSlide->GetInstancePropertyValue(inHandle, inProperty) != NULL;
-}
-
-Qt3DSDMSlideHandle CSimpleSlideCore::CreateSlideWithHandle(int inHandle,
- Qt3DSDMInstanceHandle inInstance)
-{
- if (HandleValid(inHandle))
- throw HandleExists(L"");
- m_Objects.insert(make_pair(inHandle, (THandleObjectPtr) new SSlide(inHandle, inInstance)));
- return inHandle;
-}
-
-void CSimpleSlideCore::GetSlideProperties(Qt3DSDMSlideHandle inSlide,
- TSlideEntryList &outProperties) const
-{
- outProperties.clear();
- GetSlidePropertyEntries(inSlide, outProperties);
-}
-
-bool CSimpleSlideCore::IsSlide(Qt3DSDMSlideHandle inSlide) const
-{
- return m_Objects.find(inSlide) != m_Objects.end();
-}
-
-void CSimpleSlideCore::ForceSetPropertyValue(IStringTable &inStringTable,
- THandleObjectMap &inObjects, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue)
-{
- CSimpleSlideCore::GetSlideNF(inSlide, inObjects)
- ->SetInstancePropertyValue(inHandle, inProperty, SInternValue(inValue, inStringTable));
-}
-
-void CSimpleSlideCore::PushPropertyValueToChildren(Qt3DSDMSlideHandle inParent,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- ForceSetPropertyValue(GetStringTable(), m_Objects, inParent, inHandle, inProperty, inValue);
- do_all(CSimpleSlideCore::GetSlideNF(inParent, m_Objects)->m_Children,
- std::bind(ForceSetPropertyValue, std::ref(GetStringTable()), std::ref(m_Objects),
- std::placeholders::_1, inHandle, inProperty, inValue));
-}
-
-inline void AddIntersectingEntry(TSlideEntryList &outEntries, Qt3DSDMInstanceHandle inst,
- Qt3DSDMPropertyHandle prop, const SInternValue &inValue)
-{
- outEntries.push_back(TSlideEntry(inst, prop, inValue.GetValue()));
-}
-
-void CSimpleSlideCore::GetIntersectingProperties(Qt3DSDMSlideHandle inSlide1,
- Qt3DSDMSlideHandle inSlide2,
- TSlideEntryList &outEntries) const
-{
- const SSlide *theSlide1 = GetSlideNF(inSlide1, m_Objects);
- const SSlide *theSlide2 = GetSlideNF(inSlide2, m_Objects);
- theSlide1->IntersectProperties(
- *theSlide2, std::bind(AddIntersectingEntry, std::ref(outEntries),
- std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3));
-}
-
-void CSimpleSlideCore::PushIntersectingProperties(Qt3DSDMSlideHandle inSlide1,
- Qt3DSDMSlideHandle inSlide2,
- Qt3DSDMSlideHandle inDestination)
-{
- const SSlide *theSlide1 = GetSlideNF(inSlide1, m_Objects);
- const SSlide *theSlide2 = GetSlideNF(inSlide2, m_Objects);
- SSlide *theDest = GetSlideNF(inDestination, m_Objects);
- theSlide1->IntersectProperties(
- *theSlide2, std::bind(&SSlide::SetInstancePropertyValue, theDest,
- std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3));
-}
-
-void CSimpleSlideCore::ClearPropertyValue(THandleObjectMap &inObjects, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
-{
- CSimpleSlideCore::GetSlideNF(inSlide, inObjects)
- ->RemoveInstancePropertyValue(inInstance, inProperty);
-}
-
-inline void DoForEachSlide(std::pair<int, THandleObjectPtr> inObject,
- std::function<void(SSlide *)> inFunction)
-{
- inFunction((SSlide *)inObject.second.get());
-}
-
-void CSimpleSlideCore::ForEachSlide(std::function<void(SSlide *)> inFunction)
-{
- do_all(m_Objects, std::bind(DoForEachSlide, std::placeholders::_1, inFunction));
-}
-
-void LookupSlideAndDoSomething(Qt3DSDMSlideHandle inSlide, THandleObjectMap &inObjects,
- std::function<void(SSlide *)> inFunction)
-{
- inFunction(CSimpleSlideCore::GetSlideNF(inSlide, inObjects));
-}
-
-void CSimpleSlideCore::ForEachChild(Qt3DSDMSlideHandle inParent,
- std::function<void(SSlide *)> inFunction)
-{
- do_all(GetSlideNF(inParent, m_Objects)->m_Children,
- std::bind(LookupSlideAndDoSomething, std::placeholders::_1, m_Objects, inFunction));
-}
-
-bool InstanceMatches(Qt3DSDMInstanceHandle inTarget, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle)
-{
- return inTarget == inHandle;
-}
-
-bool PropertyMatches(Qt3DSDMPropertyHandle inTarget, Qt3DSDMInstanceHandle,
- Qt3DSDMPropertyHandle inProp)
-{
- return inTarget == inProp;
-}
-
-bool InstancePropertyMatchesVector(const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties,
- Qt3DSDMInstanceHandle slideInst, Qt3DSDMPropertyHandle slideProp)
-{
- return std::find(inInstances.begin(), inInstances.end(), slideInst) != inInstances.end()
- && std::find(inProperties.begin(), inProperties.end(), slideProp) != inProperties.end();
-}
-
-bool InstancePropertyMatches(const Qt3DSDMInstanceHandle inInstance,
- const Qt3DSDMPropertyHandle inProperty, Qt3DSDMInstanceHandle slideInst,
- Qt3DSDMPropertyHandle slideProp)
-{
- return inInstance == slideInst && inProperty == slideProp;
-}
-
-void CSimpleSlideCore::DeleteAllInstanceEntries(Qt3DSDMInstanceHandle inHandle)
-{
- std::function<bool(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> predicate(
- std::bind(InstanceMatches, inHandle, std::placeholders::_1, std::placeholders::_2));
- ForEachSlide(std::bind(&SSlide::ClearPropertiesIf, std::placeholders::_1, predicate));
-}
-
-void CSimpleSlideCore::DeleteAllPropertyEntries(Qt3DSDMPropertyHandle inHandle)
-{
- std::function<bool(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> predicate(
- std::bind(PropertyMatches, inHandle, std::placeholders::_1, std::placeholders::_2));
- ForEachSlide(std::bind(&SSlide::ClearPropertiesIf, std::placeholders::_1, predicate));
-}
-
-void CSimpleSlideCore::DeleteAllInstancePropertyEntries(const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties)
-{
- std::function<bool(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> predicate(
- std::bind(InstancePropertyMatchesVector, inInstances, inProperties,
- std::placeholders::_1, std::placeholders::_2));
- ForEachSlide(std::bind(&SSlide::ClearPropertiesIf, std::placeholders::_1, predicate));
-}
-
-void CSimpleSlideCore::ClearChildrenPropertyValues(Qt3DSDMSlideHandle inParent,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty)
-{
- std::function<bool(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> predicate(
- std::bind(InstancePropertyMatches, inHandle, inProperty,
- std::placeholders::_1, std::placeholders::_2));
- ForEachChild(inParent, std::bind(&SSlide::ClearPropertiesIf, std::placeholders::_1, predicate));
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.h
deleted file mode 100644
index 278ef777..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideCore.h
+++ /dev/null
@@ -1,408 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef SLIDECOREH
-#define SLIDECOREH
-#include "HandleSystemBase.h"
-#include "Qt3DSDMSlideCore.h"
-#include "SimpleDataCore.h"
-#include "Qt3DSDMStringTable.h"
-#include <unordered_map>
-#include <QtCore/qdebug.h>
-
-namespace std {
-
-template<> struct hash<std::pair<int,int> >
-{
- typedef std::pair<int,int> argument_type;
- typedef std::size_t result_type;
- result_type operator()(std::pair<int,int> const& pa) const
- {
- result_type const h1 ( std::hash<int>{}(pa.first) );
- result_type const h2 ( std::hash<int>{}(pa.second) );
- return h1 ^ (h2 << 1);
- }
-};
-
-}
-
-namespace qt3dsdm {
-
-// The first revision of this
-typedef std::pair<int, int> TSlideInstancePropertyPair;
-typedef std::unordered_map<TSlideInstancePropertyPair, SInternValue > TSlideEntryHash;
-
-using std::make_pair;
-
-// Abstract access to these objects a little bit because in the future we are going to
-// reorganize the data such that getting a defined set of properties for a single instance is
-// very fast.
-struct SSlide : public CHandleObject
-{
- SSlide()
- : m_Instance(0)
- , m_Parent(0)
- {
- }
- SSlide(int inHandle, int inInstance)
- : CHandleObject(inHandle)
- , m_Instance(inInstance)
- , m_Parent(0)
- , m_Time(0)
- {
- }
- int m_Instance;
- int m_Parent;
- TIntList m_Children;
- TSlideEntryHash m_Properties;
- float m_Time;
-
- // Returns true if it was inserted, false if the property value was set.
- bool SetInstancePropertyValue(Qt3DSDMInstanceHandle inInstance, Qt3DSDMPropertyHandle inProperty,
- const SInternValue &inValue)
- {
- TSlideInstancePropertyPair theKey(inInstance.GetHandleValue(), inProperty.GetHandleValue());
- std::pair<TSlideEntryHash::iterator, bool> insertResult =
- m_Properties.insert(std::make_pair(theKey, inValue));
-
- if (insertResult.second == false)
- insertResult.first->second = inValue;
- return insertResult.second;
- }
- // Returns true if the property was deleted
- bool RemoveInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty)
- {
- TSlideInstancePropertyPair theKey(inInstance.GetHandleValue(), inProperty.GetHandleValue());
- TSlideEntryHash::iterator find(m_Properties.find(theKey));
- if (find != m_Properties.end()) {
- m_Properties.erase(find);
- return true;
- }
- return false;
- }
- // Return a pointer to out property value. This allows quicker checks for isset and such
- SInternValue *GetInstancePropertyValue(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty) const
- {
- TSlideInstancePropertyPair theKey(inInstance.GetHandleValue(), inProperty.GetHandleValue());
- TSlideEntryHash::const_iterator find(m_Properties.find(theKey));
- if (find != m_Properties.end())
- return const_cast<SInternValue *>(&find->second);
- return NULL;
- }
-
- void GetSpecificInstancePropertyValues(Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleValuePairList &outProperties) const
- {
- for (TSlideEntryHash::const_iterator theIter = m_Properties.begin(),
- theEnd = m_Properties.end();
- theIter != theEnd; ++theIter) {
- if (theIter->first.first == inInstance)
- outProperties.push_back(
- make_pair(theIter->first.second, theIter->second.GetValue()));
- }
- }
-
- bool HasProperty(std::function<bool(const TSlideEntry &)> inPredicate) const
- {
- for (TSlideEntryHash::const_iterator theIter = m_Properties.begin(),
- theEnd = m_Properties.end();
- theIter != theEnd; ++theIter) {
- if (inPredicate(TSlideEntry(theIter->first.first, theIter->first.second,
- theIter->second.GetValue())))
- return true;
- }
- return false;
- }
-
- void DeleteSlideEntries(TSlideEntryList &outList,
- std::function<bool(const TSlideEntry &)> inPredicate)
- {
- for (TSlideEntryHash::const_iterator theIter = m_Properties.begin(),
- theEnd = m_Properties.end();
- theIter != theEnd; ++theIter) {
- if (inPredicate(TSlideEntry(theIter->first.first, theIter->first.second,
- theIter->second.GetValue()))) {
- outList.push_back(TSlideEntry(theIter->first.first, theIter->first.second,
- theIter->second.GetValue()));
- }
- }
- DeleteEntriesFromList(outList);
- }
-
- void DeleteEntriesFromList(const TSlideEntryList &inList)
- {
- for (size_t idx = 0, end = inList.size(); idx < end; ++idx)
- m_Properties.erase(
- std::pair<int, int>(std::get<0>(inList[idx]), std::get<1>(inList[idx])));
- }
-
- void InsertSlideEntries(const TSlideEntryList &inList, IStringTable &inStringTable)
- {
- for (size_t idx = 0, end = inList.size(); idx < end; ++idx) {
- TSlideInstancePropertyPair theKey(std::get<0>(inList[idx]), std::get<1>(inList[idx]));
-
- if (m_Properties.find(theKey) != m_Properties.end()) {
- // The only known case when this condition happens is when DnD a sub-presentation to
- // the scene as a texture rect then undoing.
- qWarning() << __FUNCTION__ << ": Instance/Property Pair" << theKey
- << "already exists, erasing it.";
- m_Properties.erase(theKey);
- }
-
- m_Properties.insert(
- std::make_pair(theKey, SInternValue(std::get<2>(inList[idx]), inStringTable)));
- }
- }
-
- // Convert to the older, straight forward representation of the
- // data in this slide.
- void ToSlideEntryList(TSlideEntryList &outList) const
- {
- for (TSlideEntryHash::const_iterator theIter = m_Properties.begin(),
- theEnd = m_Properties.end();
- theIter != theEnd; ++theIter)
- outList.push_back(TSlideEntry(theIter->first.first, theIter->first.second,
- theIter->second.GetValue()));
- }
-
- void FromSlideEntryList(const TSlideEntryList &inList, IStringTable &inStringTable)
- {
- using namespace std;
- m_Properties.clear();
- for (TSlideEntryList::const_iterator theIter = inList.begin(), theEnd = inList.end();
- theIter != theEnd; ++theIter)
- SetInstancePropertyValue(get<0>(*theIter), get<1>(*theIter),
- SInternValue(get<2>(*theIter), inStringTable));
- }
-
- // result is the instance, property, myvalue, othervalue
- void IntersectProperties(const SSlide &inOther,
- std::function<void(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- SInternValue, SInternValue)>
- inResult) const
- {
- for (TSlideEntryHash::const_iterator theIter = m_Properties.begin(),
- theEnd = m_Properties.end();
- theIter != theEnd; ++theIter) {
- SInternValue *otherValue =
- inOther.GetInstancePropertyValue(theIter->first.first, theIter->first.second);
- if (otherValue)
- inResult(theIter->first.first, theIter->first.second, theIter->second, *otherValue);
- }
- }
-
- // Call the predicate, if it returns true set the property for all properties.
- // This allows a third party to manipulate the property values during the process.
- void SetPropertyValuesIf(
- IStringTable &inStringTable,
- std::function<bool(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle, SValue &)> inPredIntercept)
- {
- for (TSlideEntryHash::iterator theIter = m_Properties.begin(), theEnd = m_Properties.end();
- theIter != theEnd; ++theIter) {
- SValue theValue(theIter->second.GetValue());
- if (inPredIntercept(theIter->first.first, theIter->first.second, theValue))
- theIter->second = SInternValue(theValue, inStringTable);
- }
- }
-
- void
- ClearPropertiesIf(std::function<bool(Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle)> inPredicate)
- {
- bool foundOne;
- do {
- foundOne = false;
- for (TSlideEntryHash::iterator theIter = m_Properties.begin(),
- theEnd = m_Properties.end();
- theIter != theEnd; ++theIter) {
- if (inPredicate(theIter->first.first, theIter->first.second)) {
- foundOne = true;
- m_Properties.erase(theIter->first);
- break;
- }
- }
-
- } while (foundOne);
- }
-
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeSSlide;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-class CSimpleSlideCore : public CHandleBase, public ISlideCore
-{
- TStringTablePtr m_StringTable;
-
-public: // use
- CSimpleSlideCore(TStringTablePtr inStrTable)
- : m_StringTable(inStrTable)
- {
- }
-
- TStringTablePtr GetStringTablePtr() const override { return m_StringTable; }
- IStringTable &GetStringTable() const override { return *m_StringTable.get(); }
- Qt3DSDMSlideHandle CreateSlide(Qt3DSDMInstanceHandle inInstance) override;
- Qt3DSDMInstanceHandle GetSlideInstance(Qt3DSDMSlideHandle inSlide) const override;
- Qt3DSDMSlideHandle GetSlideByInstance(Qt3DSDMInstanceHandle inInstance) const override;
- void DeleteSlide(Qt3DSDMSlideHandle inSlide, TInstanceHandleList &outInstances) override;
- void GetSlides(TSlideHandleList &outSlides) const override;
-
- float GetSlideTime(Qt3DSDMSlideHandle inSlide) const override;
- void SetSlideTime(Qt3DSDMSlideHandle inSlide, float inNewTime) override;
-
- void DeriveSlide(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent, int inIndex = -1) override;
- Qt3DSDMSlideHandle GetParentSlide(Qt3DSDMSlideHandle inSlide) const override;
- void GetChildSlides(Qt3DSDMSlideHandle inSlide, TSlideHandleList &outChildren) const override;
- int GetChildIndex(Qt3DSDMSlideHandle inParent, Qt3DSDMSlideHandle inChild) const override;
-
- bool GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- void SetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
-
- // Return the slide this property should be set on, along with the previous value if any.
- // Set the value on the slide.
- std::pair<SSlide *, SInternValue *>
- ResolveSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty);
- void ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
- void forceSetInstancePropertyValueOnAllSlides(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) override;
-
- bool GetSpecificInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
-
- void GetSpecificInstancePropertyValues(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleValuePairList &outValues) override;
-
- void GetSlidePropertyEntries(Qt3DSDMSlideHandle inSlide, TSlideEntryList &outEntries) const override;
-
- void PushPropertyValueToChildren(Qt3DSDMSlideHandle inParent, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
-
- void GetIntersectingProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- TSlideEntryList &outEntries) const override;
- void PushIntersectingProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- Qt3DSDMSlideHandle inDestination) override;
-
- void ClearChildrenPropertyValues(Qt3DSDMSlideHandle inParent, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) override;
-
- void DeleteAllInstanceEntries(Qt3DSDMInstanceHandle inHandle) override;
- void DeleteAllPropertyEntries(Qt3DSDMPropertyHandle inHandle) override;
- void DeleteAllInstancePropertyEntries(const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties) override;
-
- bool ContainsProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) const override;
- bool HandleValid(int inHandle) const override { return CHandleBase::HandleValid(inHandle); }
-
- Qt3DSDMSlideHandle CreateSlideWithHandle(int inHandle, Qt3DSDMInstanceHandle inInstance);
- void GetSlideProperties(Qt3DSDMSlideHandle inSlide, TSlideEntryList &outProperties) const;
-
- bool IsSlide(Qt3DSDMSlideHandle inSlide) const override;
-
- // Possibly alter every slide in the database
- void ForEachSlide(std::function<void(SSlide *)> inFunction);
- void ForEachChild(Qt3DSDMSlideHandle inSlide, std::function<void(SSlide *)> inFunction);
-
- // Only implemented at the producer level, not at this lower level.
- void CopyProperties(Qt3DSDMSlideHandle /*inSourceSlide*/,
- Qt3DSDMInstanceHandle /*inSourceInstance*/,
- Qt3DSDMSlideHandle /*inDestSlide*/, Qt3DSDMInstanceHandle /*inDestInstance*/) override
- {
- throw SlideNotFound(L"");
- }
-
- static SSlide *GetSlideNF(int inHandle, THandleObjectMap &inObjects)
- {
- return const_cast<SSlide *>(
- GetSlideNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const SSlide *GetSlideNF(int inHandle, const THandleObjectMap &inObjects)
- {
- const SSlide *theSlide = GetHandleObject<SSlide>(inHandle, inObjects);
- if (theSlide)
- return theSlide;
- throw SlideNotFound(L"");
- }
-
- static inline bool PropertyFound(int inInstance, int inProperty, const TSlideEntry &inEntry)
- {
- if (inInstance == std::get<0>(inEntry) && inProperty == std::get<1>(inEntry))
- return true;
- return false;
- }
-
- static void ForceSetPropertyValue(IStringTable &inStringTable, THandleObjectMap &inObjects,
- Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue);
-
- static void ClearPropertyValue(THandleObjectMap &inObjects, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty);
-
- static inline bool SlideEntryInstanceMatches(const TSlideEntry &inEntry,
- Qt3DSDMInstanceHandle inHandle)
- {
- using namespace std;
- if (inHandle.GetHandleValue() == get<0>(inEntry))
- return true;
- return false;
- }
-
- static inline bool SlideEntryPropertyMatches(const TSlideEntry &inEntry,
- Qt3DSDMPropertyHandle inProperty)
- {
- using namespace std;
- return inProperty.GetHandleValue() == get<1>(inEntry);
- }
-
- static inline bool SlideEntryInstancePropertyMatches(const TSlideEntry &inEntry,
- const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties)
- {
- using namespace std;
- return exists(inInstances, std::bind(equal_to<int>(), get<0>(inEntry),
- std::placeholders::_1))
- && exists(inProperties, std::bind(equal_to<int>(), get<1>(inEntry),
- std::placeholders::_1));
- }
-};
-
-typedef std::shared_ptr<CSimpleSlideCore> TSimpleSlideCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.cpp
deleted file mode 100644
index 5f1de1ea..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "SimpleSlideGraphCore.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-Qt3DSDMSlideGraphHandle CSimpleSlideGraphCore::CreateSlideGraph(Qt3DSDMSlideHandle inRoot)
-{
- int nextId = GetNextId();
- return CreateSlideGraphWithHandle(nextId, inRoot);
-}
-
-Qt3DSDMSlideHandle CSimpleSlideGraphCore::GetGraphRoot(Qt3DSDMSlideGraphHandle inGraph) const
-{
- return GetSlideGraphNF(inGraph, m_Objects)->m_Root;
-}
-
-inline bool RootSlideMatches(const THandleObjectPair &inPair, Qt3DSDMSlideHandle inSlide)
-{
- const SSlideGraph *theGraph = static_cast<SSlideGraph *>(inPair.second.get());
- if (theGraph->m_Root == inSlide)
- return true;
- return false;
-}
-
-Qt3DSDMSlideGraphHandle CSimpleSlideGraphCore::GetSlideGraph(Qt3DSDMSlideHandle inSlide) const
-{
- THandleObjectMap::const_iterator theFind = find_if<THandleObjectMap::const_iterator>(
- m_Objects, std::bind(RootSlideMatches, std::placeholders::_1, inSlide));
- if (theFind != m_Objects.end())
- return theFind->first;
- return 0;
-}
-
-inline Qt3DSDMSlideGraphHandle ToGraphHandle(const THandleObjectPair &inPair)
-{
- return inPair.first;
-}
-
-void CSimpleSlideGraphCore::GetSlideGraphs(TSlideGraphHandleList &outGraphs) const
-{
- outGraphs.resize(m_Objects.size());
- transform(m_Objects.begin(), m_Objects.end(), outGraphs.begin(), ToGraphHandle);
-}
-
-void CSimpleSlideGraphCore::DeleteSlideGraph(Qt3DSDMSlideGraphHandle inHandle)
-{
- TSlideInstancePairList theAssociatedInstances;
- GetAssociatedInstances(inHandle, theAssociatedInstances);
- for (size_t idx = 0, end = theAssociatedInstances.size(); idx < end; ++idx)
- DissociateInstance(theAssociatedInstances[idx].second);
- EraseHandle(inHandle, m_Objects);
-}
-
-void CSimpleSlideGraphCore::AssociateInstance(Qt3DSDMSlideGraphHandle inSlideGraph,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance)
-{
- pair<TInstanceToGraphMap::iterator, bool> theResult =
- m_InstanceToGraph.insert(make_pair(inInstance, make_pair(inSlideGraph, inSlide)));
- Q_ASSERT(theResult.second);
- if (theResult.second == false) {
- theResult.first->second.first = inSlideGraph;
- theResult.first->second.second = inSlide;
- }
- pair<TGraphToInstanceMap::iterator, bool> theGraphResult =
- m_GraphToInstances.insert(make_pair(inSlideGraph, TSlideInstancePairList()));
- insert_unique(theGraphResult.first->second, make_pair(inSlide, inInstance));
-}
-
-void CSimpleSlideGraphCore::GetAssociatedInstances(Qt3DSDMSlideGraphHandle inSlideGraph,
- TSlideInstancePairList &outAssociations) const
-{
- TGraphToInstanceMap::const_iterator theFind = m_GraphToInstances.find(inSlideGraph);
- if (theFind != m_GraphToInstances.end())
- outAssociations.insert(outAssociations.end(), theFind->second.begin(),
- theFind->second.end());
-}
-
-TGraphSlidePair CSimpleSlideGraphCore::GetAssociatedGraph(Qt3DSDMInstanceHandle inInstance) const
-{
- TInstanceToGraphMap::const_iterator theResult = m_InstanceToGraph.find(inInstance);
- if (theResult != m_InstanceToGraph.end())
- return theResult->second;
- return TGraphSlidePair();
-}
-
-struct SInstanceMatcher
-{
- Qt3DSDMInstanceHandle m_Instance;
- SInstanceMatcher(Qt3DSDMInstanceHandle inInst)
- : m_Instance(inInst)
- {
- }
- bool operator()(const pair<Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle> &inItem) const
- {
- return m_Instance == inItem.second;
- }
-};
-
-void CSimpleSlideGraphCore::DissociateInstance(Qt3DSDMInstanceHandle inInstance)
-{
- TGraphSlidePair theAssociatedGraph(GetAssociatedGraph(inInstance));
-
- TGraphToInstanceMap::iterator theFind = m_GraphToInstances.find(theAssociatedGraph.first);
- if (theFind != m_GraphToInstances.end()) {
- erase_if(theFind->second, SInstanceMatcher(inInstance));
- if (theFind->second.size() == 0)
- m_GraphToInstances.erase(theAssociatedGraph.first);
- }
-
- m_InstanceToGraph.erase(inInstance);
-}
-
-void CSimpleSlideGraphCore::SetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph,
- Qt3DSDMSlideHandle inSlide)
-{
- GetSlideGraphNF(inGraph, m_Objects)->m_ActiveSlide = inSlide;
-}
-
-Qt3DSDMSlideHandle CSimpleSlideGraphCore::GetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph) const
-{
- const SSlideGraph *theSlide = GetSlideGraphNF(inGraph, m_Objects);
- if (theSlide->m_ActiveSlide)
- return theSlide->m_ActiveSlide;
- return theSlide->m_Root;
-}
-
-bool CSimpleSlideGraphCore::HandleValid(int inHandle) const
-{
- return CHandleBase::HandleValid(inHandle);
-}
-
-Qt3DSDMSlideGraphHandle CSimpleSlideGraphCore::CreateSlideGraphWithHandle(int inHandle,
- Qt3DSDMSlideHandle inRoot)
-{
- m_Objects.insert(make_pair(inHandle, (THandleObjectPtr) new SSlideGraph(inHandle, inRoot)));
- return inHandle;
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.h
deleted file mode 100644
index 484d6750..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SimpleSlideGraphCore.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef SLIDEGRAPHCOREH
-#define SLIDEGRAPHCOREH
-#include "Qt3DSDMStringTable.h"
-#include "Qt3DSDMSlideGraphCore.h"
-#include "HandleSystemBase.h"
-#include "Qt3DSDMErrors.h"
-
-namespace qt3dsdm {
-using namespace std;
-struct SSlideGraph : public CHandleObject
-{
- SSlideGraph()
- : m_Root(0)
- , m_ActiveSlide(0)
- {
- }
- SSlideGraph(int inHandle, int inSlideRoot)
- : CHandleObject(inHandle)
- , m_Root(inSlideRoot)
- , m_ActiveSlide(0)
- {
- }
- Qt3DSDMSlideHandle m_Root;
- Qt3DSDMSlideHandle m_ActiveSlide;
-
- static const EHandleObjectType s_Type = CHandleObject::EHandleObjectTypeSSlideGraph;
- EHandleObjectType GetType() override { return s_Type; }
-};
-
-class CSimpleSlideGraphCore : public CHandleBase, public ISlideGraphCore
-{
- TStringTablePtr m_StringTable;
- typedef std::unordered_map<Qt3DSDMInstanceHandle,
- pair<Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle>, std::hash<int>>
- TInstanceToGraphMap;
- typedef std::unordered_map<Qt3DSDMSlideGraphHandle, TSlideInstancePairList, std::hash<int>>
- TGraphToInstanceMap;
-
- TInstanceToGraphMap m_InstanceToGraph;
- TGraphToInstanceMap m_GraphToInstances;
-
-public:
- CSimpleSlideGraphCore(TStringTablePtr strTable = TStringTablePtr())
- : m_StringTable(strTable)
- {
- }
- TStringTablePtr GetStringTablePtr() { return m_StringTable; }
- /**
- * A slide graph is used to associate a set of instances to a set of slides.
- * This allows rapid lookup of properties, as an implementation of these.
- * There are a few assumptions here. First is that a given slide can be a member
- * of one and only one graph (i.e. it does not derive from another slide outside of the graph).
- * Second is that an instance is a member of one and only one graph.
- */
- Qt3DSDMSlideGraphHandle CreateSlideGraph(Qt3DSDMSlideHandle inRoot) override;
- Qt3DSDMSlideHandle GetGraphRoot(Qt3DSDMSlideGraphHandle inGraph) const override;
- Qt3DSDMSlideGraphHandle GetSlideGraph(Qt3DSDMSlideHandle inSlide) const override;
- void GetSlideGraphs(TSlideGraphHandleList &outGraphs) const override;
- void DeleteSlideGraph(Qt3DSDMSlideGraphHandle inHandle) override;
-
- /**
- * Associate a given instance handle with a given graph. This will ensure that property
- *lookups
- * will travel through this graph before they hit the main data core. Instances may be
- *associated
- * with a sub-slide of a given graph, not just the root. An instance associated with the root
- *is
- * implicitly associated with any root-derived slides.
- */
- void AssociateInstance(Qt3DSDMSlideGraphHandle inSlideGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) override;
- void GetAssociatedInstances(Qt3DSDMSlideGraphHandle inSlideGraph,
- TSlideInstancePairList &outAssociations) const override;
- TGraphSlidePair GetAssociatedGraph(Qt3DSDMInstanceHandle inInstance) const override;
- void DissociateInstance(Qt3DSDMInstanceHandle inInstance) override;
-
- /**
- * All graphs always have an active slide. This is assumed to be the root right off the bat.
- */
- void SetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) override;
- Qt3DSDMSlideHandle GetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph) const override;
-
- bool HandleValid(int inHandle) const override;
-
- Qt3DSDMSlideGraphHandle CreateSlideGraphWithHandle(int inHandle, Qt3DSDMSlideHandle inRoot);
-
- static SSlideGraph *GetSlideGraphNF(int inHandle, THandleObjectMap &inObjects)
- {
- return const_cast<SSlideGraph *>(
- GetSlideGraphNF(inHandle, static_cast<const THandleObjectMap &>(inObjects)));
- }
-
- static const SSlideGraph *GetSlideGraphNF(int inHandle, const THandleObjectMap &inObjects)
- {
- const SSlideGraph *theSlide = GetHandleObject<SSlideGraph>(inHandle, inObjects);
- if (theSlide)
- return theSlide;
- throw SlideGraphNotFound(L"");
- }
-};
-
-typedef std::shared_ptr<CSimpleSlideGraphCore> TSimpleSlideGraphCorePtr;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.cpp
deleted file mode 100644
index 86b0d1fe..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.cpp
+++ /dev/null
@@ -1,562 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#ifdef _WIN32
-#pragma warning(disable : 4503) // decorated name length exceeded
-#endif
-#include "SlideCoreProducer.h"
-#include "HandleSystemTransactions.h"
-#include "VectorTransactions.h"
-#include "SignalsImpl.h"
-
-using namespace std;
-
-namespace qt3dsdm {
-
-Qt3DSDMSlideHandle CSlideCoreProducer::CreateSlide(Qt3DSDMInstanceHandle inInstance)
-{
- Qt3DSDMSlideHandle retval = m_Data->CreateSlide(inInstance);
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- GetSignalSender()->SendSlideCreated(retval);
- return retval;
-}
-
-Qt3DSDMInstanceHandle CSlideCoreProducer::GetSlideInstance(Qt3DSDMSlideHandle inSlide) const
-{
- return m_Data->GetSlideInstance(inSlide);
-}
-
-Qt3DSDMSlideHandle CSlideCoreProducer::GetSlideByInstance(Qt3DSDMInstanceHandle inSlide) const
-{
- return m_Data->GetSlideByInstance(inSlide);
-}
-
-void SendPropertyRemoved(const TSlideEntry &inEntry, Qt3DSDMSlideHandle inSlide,
- ISlideCoreSignalSender *inSender)
-{
- inSender->SendPropertyValueRemoved(inSlide, get<0>(inEntry), get<1>(inEntry), get<2>(inEntry));
-}
-
-void RecurseCreateDeleteTransactions(TTransactionConsumerPtr inConsumer, Qt3DSDMSlideHandle inSlide,
- THandleObjectMap &inObjects, ISlideCoreSignalSender *inSender)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, inObjects);
- inSender->SendBeforeSlideDeleted(theSlide->m_Handle);
- do_all(theSlide->m_Children, std::bind(RecurseCreateDeleteTransactions, inConsumer,
- std::placeholders::_1,
- std::ref(inObjects), inSender));
- if (inConsumer)
- CREATE_HANDLE_DELETE_TRANSACTION(inConsumer, inSlide, inObjects);
- inSender->SendSlideDeleted(theSlide->m_Handle);
-}
-
-void CSlideCoreProducer::DeleteSlide(Qt3DSDMSlideHandle inSlide, TInstanceHandleList &outInstances)
-{
- // Ensure exists
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, m_Data->m_Objects);
- if (theSlide->m_Parent) {
- SSlide *theParent = CSimpleSlideCore::GetSlideNF(theSlide->m_Parent, m_Data->m_Objects);
- CreateVecEraseTransaction<int>(__FILE__, __LINE__, m_Consumer, inSlide,
- theParent->m_Children);
- }
- RecurseCreateDeleteTransactions(m_Consumer, inSlide, m_Data->m_Objects, GetSignalSender());
- // Not any more...
- m_Data->DeleteSlide(inSlide, outInstances);
-}
-
-void CSlideCoreProducer::GetSlides(TSlideHandleList &outSlides) const
-{
- m_Data->GetSlides(outSlides);
-}
-
-float CSlideCoreProducer::GetSlideTime(Qt3DSDMSlideHandle inSlide) const
-{
- return m_Data->GetSlideTime(inSlide);
-}
-
-void CSlideCoreProducer::SetSlideTime(Qt3DSDMSlideHandle inSlide, float inNewTime)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, m_Data->m_Objects);
- float oldTime = theSlide->m_Time;
- theSlide->m_Time = inNewTime;
- if (m_Consumer) {
- m_Consumer->OnTransaction(std::shared_ptr<ITransaction>(CREATE_GENERIC_TRANSACTION(
- std::bind(&CSlideCoreProducer::SetSlideTime, this, inSlide, inNewTime),
- std::bind(&CSlideCoreProducer::SetSlideTime, this, inSlide, oldTime))));
- } else
- GetSignalSender()->SendSlideTimeChanged(inSlide);
-}
-
-inline void SetSlideParent(THandleObjectMap &inObjects, int inSlide, int inParent)
-{
- CSimpleSlideCore::GetSlideNF(inSlide, inObjects)->m_Parent = inParent;
-}
-
-void CSlideCoreProducer::DeriveSlide(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent,
- int inIndex)
-{
- // Integrity checks to ensure operation will proceed
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, m_Data->m_Objects);
- SSlide *theNewParent = NULL;
- if (inParent)
- theNewParent = CSimpleSlideCore::GetSlideNF(inParent, m_Data->m_Objects);
- SSlide *theOldParent = NULL;
- if (theSlide->m_Parent)
- theOldParent = CSimpleSlideCore::GetSlideNF(theSlide->m_Parent, m_Data->m_Objects);
-
- if (theSlide->m_Parent && m_Consumer) {
- m_Consumer->OnTransaction(TTransactionPtr(CREATE_GENERIC_TRANSACTION(
- std::bind(SetSlideParent, std::ref(m_Data->m_Objects), inSlide, inParent),
- std::bind(SetSlideParent, std::ref(m_Data->m_Objects), inSlide,
- theSlide->m_Parent))));
- if (theOldParent)
- CreateVecEraseTransaction<int>(__FILE__, __LINE__, m_Consumer, inSlide,
- theOldParent->m_Children);
- GetSignalSender()->SendSlideDerived(inSlide, 0, inIndex);
- }
- m_Data->DeriveSlide(inSlide, inParent, inIndex);
- if (theNewParent)
- CreateVecInsertTransaction<int>(__FILE__, __LINE__, m_Consumer, inSlide,
- theNewParent->m_Children);
- GetSignalSender()->SendSlideDerived(inSlide, inParent, inIndex);
-}
-
-Qt3DSDMSlideHandle CSlideCoreProducer::GetParentSlide(Qt3DSDMSlideHandle inSlide) const
-{
- return m_Data->GetParentSlide(inSlide);
-}
-
-void CSlideCoreProducer::GetChildSlides(Qt3DSDMSlideHandle inSlide,
- TSlideHandleList &outChildren) const
-{
- m_Data->GetChildSlides(inSlide, outChildren);
-}
-
-int CSlideCoreProducer::GetChildIndex(Qt3DSDMSlideHandle inParent, Qt3DSDMSlideHandle inChild) const
-{
- return m_Data->GetChildIndex(inParent, inChild);
-}
-
-bool CSlideCoreProducer::GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- return m_Data->GetInstancePropertyValue(inSlide, inHandle, inProperty, outValue);
-}
-
-inline void EraseProperty(TSlideEntryList &inProperties, int inInstance, int inProperty)
-{
- erase_if(inProperties,
- std::bind(CSimpleSlideCore::PropertyFound, inInstance, inProperty,
- std::placeholders::_1));
-}
-
-void CSlideCoreProducer::SetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- std::pair<SSlide *, SInternValue *> slideAndProp(
- m_Data->ResolveSetInstancePropertyValue(inSlide, inHandle, inProperty));
- DoForceSetInstancePropertyValue(slideAndProp.first->m_Handle, inHandle, inProperty, inValue);
-}
-
-struct HashMapDataValueInsertTransaction
- : public HashMapInsertTransaction<TSlideInstancePropertyPair, SInternValue,
- TSlideEntryHash::hasher>
-{
- typedef HashMapInsertTransaction<TSlideInstancePropertyPair, SInternValue,
- TSlideEntryHash::hasher>
- TBase;
- HashMapDataValueInsertTransaction(
- const char *inFile, int inLine, TSlideEntryHash &map,
- const std::pair<TSlideInstancePropertyPair, SInternValue> &val)
- : TBase(inFile, inLine, map, val)
- {
- }
- void Do() override
- {
- std::pair<int, int> theKey = m_Value.first;
- SValue theTempValue = m_Value.second.GetValue();
- TDataStrPtr theStrPtr;
- if (GetValueType(theTempValue) == DataModelDataType::String) {
- theStrPtr = qt3dsdm::get<TDataStrPtr>(theTempValue);
- }
- (void)theStrPtr;
- TBase::Add();
- }
-};
-
-inline void CSlideCoreProducer::DoForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, m_Data->m_Objects);
- SInternValue theNewValue(inValue, m_Data->GetStringTable());
- SInternValue *theCurrentValue(theSlide->GetInstancePropertyValue(inHandle, inProperty));
-
- std::pair<int, int> theKey(inHandle, inProperty);
- SlideInstancePropertyKey mergeMapKey(inSlide, inHandle, inProperty);
- TSlidePropertyMergeMap::iterator iter = m_PropertyMergeMap.find(mergeMapKey);
- if (iter != m_PropertyMergeMap.end()) {
- const SValue &theTempValue(theNewValue.GetValue());
- CSimpleSlideCore::ForceSetPropertyValue(m_Data->GetStringTable(), m_Data->m_Objects,
- inSlide, inHandle, inProperty, theTempValue);
- iter->second->Update(theNewValue);
- if (GetValueType(theTempValue) == DataModelDataType::String) {
- TDataStrPtr theStrPtr = qt3dsdm::get<TDataStrPtr>(theTempValue);
- QT3DSDM_DEBUG_LOG(m_Data->GetStringTable().GetNarrowStr(theStrPtr->GetData()));
- }
- return; // don't signal
- } else {
- TSlidePropertyMergeMapEntry theEntry;
- if (theCurrentValue) {
- theEntry =
- CreateHashMapSwapTransaction(__FILE__, __LINE__, m_Consumer, theKey,
- *theCurrentValue, theNewValue, theSlide->m_Properties);
- } else {
- if (m_Consumer) {
- std::shared_ptr<HashMapDataValueInsertTransaction> theTransaction =
- std::make_shared<HashMapDataValueInsertTransaction>(
- __FILE__, __LINE__, std::ref(theSlide->m_Properties),
- std::make_pair(theKey, theNewValue));
- m_Consumer->OnTransaction(theTransaction);
- theEntry = theTransaction;
- }
- }
- if (theEntry)
- m_PropertyMergeMap.insert(make_pair(mergeMapKey, theEntry));
- CSimpleSlideCore::ForceSetPropertyValue(m_Data->GetStringTable(), m_Data->m_Objects,
- inSlide, inHandle, inProperty,
- theNewValue.GetValue());
- GetSignalSender()->SendPropertyValueSet(inSlide, inHandle, inProperty,
- theNewValue.GetValue());
- }
-}
-
-void CSlideCoreProducer::ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- if (m_Consumer)
- DoForceSetInstancePropertyValue(inSlide, inHandle, inProperty, inValue);
- else
- m_Data->ForceSetInstancePropertyValue(inSlide, inHandle, inProperty, inValue);
-}
-
-void CSlideCoreProducer::forceSetInstancePropertyValueOnAllSlides(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- m_Data->forceSetInstancePropertyValueOnAllSlides(inInstance, inProperty, inValue);
-}
-
-bool CSlideCoreProducer::GetSpecificInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- SValue &outValue) const
-{
- return m_Data->GetSpecificInstancePropertyValue(inSlide, inInstance, inProperty, outValue);
-}
-
-bool CSlideCoreProducer::ContainsProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) const
-{
- return m_Data->ContainsProperty(inSlide, inHandle, inProperty);
-}
-
-void CSlideCoreProducer::GetSlidePropertyEntries(Qt3DSDMSlideHandle inSlide,
- TSlideEntryList &outEntries) const
-{
- return m_Data->GetSlidePropertyEntries(inSlide, outEntries);
-}
-
-void CSlideCoreProducer::PushPropertyValueToChildren(Qt3DSDMSlideHandle inParent,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue)
-{
- SSlide *theParent = CSimpleSlideCore::GetSlideNF(inParent, m_Data->m_Objects);
- DoForceSetInstancePropertyValue(inParent, inHandle, inProperty, inValue);
- do_all(theParent->m_Children, std::bind(&CSlideCoreProducer::DoForceSetInstancePropertyValue,
- this, std::placeholders::_1,
- inHandle, inProperty, inValue));
-}
-
-inline void ClearValueWithTransactions(TTransactionConsumerPtr inConsumer,
- THandleObjectMap &inObjects,
- ISlideCoreSignalSender *inSignalSender, int inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(inSlide, inObjects);
- SInternValue *theCurrentValue(theSlide->GetInstancePropertyValue(inHandle, inProperty));
- if (theCurrentValue) {
- SValue theValue(theCurrentValue->GetValue());
- std::pair<int, int> theKey(inHandle, inProperty);
- CreateHashMapEraseTransaction(__FILE__, __LINE__, inConsumer,
- std::make_pair(theKey, *theCurrentValue),
- theSlide->m_Properties);
- CSimpleSlideCore::ClearPropertyValue(inObjects, inSlide, inHandle, inProperty);
- inSignalSender->SendPropertyValueRemoved(inSlide, inHandle, inProperty, theValue);
- }
-}
-
-void CSlideCoreProducer::ClearChildrenPropertyValues(Qt3DSDMSlideHandle inParent,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty)
-{
- SSlide *theParent = CSimpleSlideCore::GetSlideNF(inParent, m_Data->m_Objects);
- do_all(theParent->m_Children,
- std::bind(ClearValueWithTransactions, m_Consumer, std::ref(m_Data->m_Objects),
- GetSignalSender(), std::placeholders::_1, inHandle, inProperty));
-}
-
-typedef tuple<int, TSlideEntryList, TSlideEntryList> TSlideSlideEntryTuple;
-typedef std::vector<TSlideSlideEntryTuple> TSlideSlideEntryTupleList;
-
-inline void CreateVectorPreReplaceData(THandleObjectPair inPair,
- TSlideSlideEntryTupleList &outSlideSlideEntries,
- function<bool(const TSlideEntry &)> inPredicate)
-{
- if (inPair.second->GetType() == CHandleObject::EHandleObjectTypeSSlide) {
- SSlide *theSlide = static_cast<SSlide *>(inPair.second.get());
- if (theSlide->HasProperty(inPredicate)) {
- outSlideSlideEntries.push_back(
- TSlideSlideEntryTuple(inPair.first, TSlideEntryList(), TSlideEntryList()));
- theSlide->DeleteSlideEntries(get<1>(outSlideSlideEntries.back()), inPredicate);
- }
- }
-}
-
-inline void RunInsert(tuple<int, TSlideEntryList, TSlideEntryList> &inTuple,
- THandleObjectMap &inObjects, IStringTable &inStringTable)
-{
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(get<0>(inTuple), inObjects);
- theSlide->InsertSlideEntries(get<1>(inTuple), inStringTable);
-}
-
-inline void RunFullInsert(std::shared_ptr<TSlideSlideEntryTupleList> inList,
- THandleObjectMap &inObjects, IStringTable &inStringTable)
-{
- for (TSlideSlideEntryTupleList::iterator theIter = inList->begin(); theIter != inList->end();
- ++theIter)
- RunInsert(*theIter, inObjects, inStringTable);
-}
-
-inline void RunFullErase(std::shared_ptr<TSlideSlideEntryTupleList> inList,
- THandleObjectMap &inObjects)
-{
- for (TSlideSlideEntryTupleList::iterator theIter = inList->begin(); theIter != inList->end();
- ++theIter) {
- SSlide *theSlide = CSimpleSlideCore::GetSlideNF(get<0>(*theIter), inObjects);
- theSlide->DeleteEntriesFromList(std::get<1>(*theIter));
- }
-}
-
-void DeleteAllSlideEntriesWithUndo(TTransactionConsumerPtr inConsumer, IStringTable &inStringTable,
- THandleObjectMap &inObjects,
- function<bool(const TSlideEntry &)> inPredicate)
-{
- std::shared_ptr<TSlideSlideEntryTupleList> theEntries(new TSlideSlideEntryTupleList);
- do_all(inObjects,
- std::bind(CreateVectorPreReplaceData,
- std::placeholders::_1, std::ref(*theEntries), inPredicate));
- if (inConsumer)
- CreateGenericTransactionWithConsumer(
- __FILE__, __LINE__, inConsumer,
- std::bind(RunFullErase, theEntries, std::ref(inObjects)),
- std::bind(RunFullInsert, theEntries, std::ref(inObjects),
- std::ref(inStringTable)));
-}
-
-void CSlideCoreProducer::DeleteAllInstanceEntries(Qt3DSDMInstanceHandle inInstance)
-{
- DeleteAllSlideEntriesWithUndo(
- m_Consumer, GetStringTable(), m_Data->m_Objects,
- std::bind(CSimpleSlideCore::SlideEntryInstanceMatches, std::placeholders::_1, inInstance));
-}
-void CSlideCoreProducer::DeleteAllPropertyEntries(Qt3DSDMPropertyHandle inHandle)
-{
- DeleteAllSlideEntriesWithUndo(
- m_Consumer, GetStringTable(), m_Data->m_Objects,
- std::bind(CSimpleSlideCore::SlideEntryPropertyMatches, std::placeholders::_1, inHandle));
-}
-
-void CSlideCoreProducer::DeleteAllInstancePropertyEntries(const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties)
-{
- DeleteAllSlideEntriesWithUndo(m_Consumer, GetStringTable(), m_Data->m_Objects,
- std::bind(CSimpleSlideCore::SlideEntryInstancePropertyMatches,
- std::placeholders::_1, std::cref(inInstances),
- std::cref(inProperties)));
-}
-
-void CSlideCoreProducer::GetIntersectingProperties(Qt3DSDMSlideHandle inSlide1,
- Qt3DSDMSlideHandle inSlide2,
- TSlideEntryList &outEntries) const
-{
- return m_Data->GetIntersectingProperties(inSlide1, inSlide2, outEntries);
-}
-
-bool InstancePropMatches(Qt3DSDMInstanceHandle instance, Qt3DSDMPropertyHandle prop,
- const TSlideEntry &entry)
-{
- return instance == get<0>(entry) && prop == get<1>(entry);
-}
-
-bool SendPropertyAddedIfNotInList(Qt3DSDMInstanceHandle instance, Qt3DSDMPropertyHandle prop,
- SValue & /*value*/, const TSlideEntryList &inList,
- Qt3DSDMSlideHandle inSource, Qt3DSDMSlideHandle inSlide,
- ISlideCoreSignalSender * /*inSignalSender*/)
-{
- if (find_if<TSlideEntryList::const_iterator>(
- inList, std::bind(InstancePropMatches, instance, prop, std::placeholders::_1))
- == inList.end()) {
- return true;
- }
- return false;
-}
-
-// destination gets the properties from slide 1 that have corresponding entries in slide 2
-void CSlideCoreProducer::PushIntersectingProperties(Qt3DSDMSlideHandle inSlide1,
- Qt3DSDMSlideHandle inSlide2,
- Qt3DSDMSlideHandle inDestination)
-{
- SSlide *theDest = CSimpleSlideCore::GetSlideNF(inDestination, m_Data->m_Objects);
- TSlideEntryList theProperties;
- theDest->ToSlideEntryList(theProperties);
- m_Data->PushIntersectingProperties(inSlide1, inSlide2, inDestination);
- theDest->SetPropertyValuesIf(GetStringTable(), std::bind(SendPropertyAddedIfNotInList,
- std::placeholders::_1,
- std::placeholders::_2,
- std::placeholders::_3,
- theProperties, inSlide1,
- inDestination, GetSignalSender()));
- if (m_Consumer) {
- TSlideEntryList theResult;
- theDest->ToSlideEntryList(theResult);
- m_Consumer->OnTransaction(TTransactionPtr(
- CREATE_GENERIC_TRANSACTION(std::bind(&SSlide::FromSlideEntryList, theDest, theResult,
- std::ref(GetStringTable())),
- std::bind(&SSlide::FromSlideEntryList, theDest,
- theProperties, std::ref(GetStringTable())))));
- }
-}
-
-void CSlideCoreProducer::CopyProperties(Qt3DSDMSlideHandle inSourceSlide,
- Qt3DSDMInstanceHandle inSourceInstance,
- Qt3DSDMSlideHandle inDestSlide,
- Qt3DSDMInstanceHandle inDestInstance)
-{
- SSlide *sourceSlide = CSimpleSlideCore::GetSlideNF(inSourceSlide, m_Data->m_Objects);
-
- for (TSlideEntryHash::iterator theIter = sourceSlide->m_Properties.begin(),
- theEnd = sourceSlide->m_Properties.end();
- theIter != theEnd; ++theIter) {
- if (theIter->first.first == inSourceInstance) {
- // Set it once so it appears in the slide
- // Then call the main method that will send the events.
- DoForceSetInstancePropertyValue(inDestSlide, inDestInstance, theIter->first.second,
- theIter->second.GetValue());
- }
- }
-}
-
-bool CSlideCoreProducer::HandleValid(int inHandle) const
-{
- return m_Data->HandleValid(inHandle);
-}
-
-bool CSlideCoreProducer::IsSlide(Qt3DSDMSlideHandle inSlide) const
-{
- return m_Data->IsSlide(inSlide);
-}
-
-void CSlideCoreProducer::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_Consumer = inConsumer;
- m_PropertyMergeMap.clear();
-}
-
-TSignalConnectionPtr
-CSlideCoreProducer::ConnectSlideCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectSlideCreated(inCallback);
-}
-TSignalConnectionPtr CSlideCoreProducer::ConnectBeforeSlideDeleted(
- const std::function<void(Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectBeforeSlideDeleted(inCallback);
-}
-TSignalConnectionPtr
-CSlideCoreProducer::ConnectSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectSlideDeleted(inCallback);
-}
-TSignalConnectionPtr CSlideCoreProducer::ConnectSlideDerived(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle, int)> &inCallback)
-{
- return GetSignalProvider()->ConnectSlideDerived(inCallback);
-}
-TSignalConnectionPtr CSlideCoreProducer::ConnectInstancePropertyValueSet(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback)
-{
- return GetSignalProvider()->ConnectInstancePropertyValueSet(inCallback);
-}
-TSignalConnectionPtr CSlideCoreProducer::ConnectInstancePropertyValueRemoved(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback)
-{
- return GetSignalProvider()->ConnectInstancePropertyValueRemoved(inCallback);
-}
-TSignalConnectionPtr CSlideCoreProducer::ConnectSlideTimeChanged(
- const std::function<void(Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectSlideTimeChanged(inCallback);
-}
-
-void CSlideCoreProducer::InitSignaller()
-{
- m_SlideCoreSignaller = CreateSlideCoreSignaller();
-}
-
-ISlideCoreSignalProvider *CSlideCoreProducer::GetSignalProvider()
-{
- return dynamic_cast<ISlideCoreSignalProvider *>(m_SlideCoreSignaller.get());
-}
-ISlideCoreSignalSender *CSlideCoreProducer::GetSignalSender()
-{
- return dynamic_cast<ISlideCoreSignalSender *>(m_SlideCoreSignaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.h
deleted file mode 100644
index dec0297d..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideCoreProducer.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef SLIDECOREPRODUCERH
-#define SLIDECOREPRODUCERH
-#include "Qt3DSDMTransactions.h"
-#include "SimpleSlideCore.h"
-#include "Qt3DSDMSignals.h"
-
-namespace qt3dsdm {
-struct SlideInstancePropertyKey
-{
- int m_Slide;
- int m_Instance;
- int m_Property;
- SlideInstancePropertyKey(int slide, int inst, int prop)
- : m_Slide(slide)
- , m_Instance(inst)
- , m_Property(prop)
- {
- }
- SlideInstancePropertyKey()
- : m_Slide(0)
- , m_Instance(0)
- , m_Property(0)
- {
- }
-
- bool operator==(const SlideInstancePropertyKey &inOther) const
- {
- return m_Slide == inOther.m_Slide && m_Instance == inOther.m_Instance
- && m_Property == inOther.m_Property;
- }
-};
-
-struct SlideInstancePropertyKeyHasher
-{
- std::size_t operator()(const SlideInstancePropertyKey &inEntry) const
- {
- return std::hash<int>()(inEntry.m_Slide) ^ std::hash<int>()(inEntry.m_Instance)
- ^ std::hash<int>()(inEntry.m_Property);
- }
-};
-
-typedef std::shared_ptr<IMergeableTransaction<SInternValue>> TSlidePropertyMergeMapEntry;
-typedef std::unordered_map<SlideInstancePropertyKey, TSlidePropertyMergeMapEntry,
- SlideInstancePropertyKeyHasher>
- TSlidePropertyMergeMap;
-
-class CSlideCoreProducer : public ISlideCore,
- public ITransactionProducer,
- public ISlideCoreSignalProvider
-{
- Q_DISABLE_COPY(CSlideCoreProducer)
-
- TTransactionConsumerPtr m_Consumer;
- TSimpleSlideCorePtr m_Data;
- TSignalItemPtr m_SlideCoreSignaller;
- TSlidePropertyMergeMap m_PropertyMergeMap;
-
-public:
- CSlideCoreProducer(TStringTablePtr inStrTable)
- : m_Data(new CSimpleSlideCore(inStrTable))
- {
- InitSignaller();
- }
-
- IStringTable &GetStringTable() const override { return m_Data->GetStringTable(); }
- TStringTablePtr GetStringTablePtr() const override { return m_Data->GetStringTablePtr(); }
-
- TSimpleSlideCorePtr GetTransactionlessSlideCore() { return m_Data; }
- TSimpleSlideCorePtr GetTransactionlessSlideCore() const { return m_Data; }
-
- Qt3DSDMSlideHandle CreateSlide(Qt3DSDMInstanceHandle inInstance) override;
- Qt3DSDMInstanceHandle GetSlideInstance(Qt3DSDMSlideHandle inSlide) const override;
- Qt3DSDMSlideHandle GetSlideByInstance(Qt3DSDMInstanceHandle inSlide) const override;
- void DeleteSlide(Qt3DSDMSlideHandle inSlide, TInstanceHandleList &outInstances) override;
- void GetSlides(TSlideHandleList &outSlides) const override;
-
- float GetSlideTime(Qt3DSDMSlideHandle inSlide) const override;
- void SetSlideTime(Qt3DSDMSlideHandle inSlide, float inNewTime) override;
-
- void DeriveSlide(Qt3DSDMSlideHandle inSlide, Qt3DSDMSlideHandle inParent, int inIndex = -1) override;
- Qt3DSDMSlideHandle GetParentSlide(Qt3DSDMSlideHandle inSlide) const override;
- void GetChildSlides(Qt3DSDMSlideHandle inSlide, TSlideHandleList &outChildren) const override;
- int GetChildIndex(Qt3DSDMSlideHandle inParent, Qt3DSDMSlideHandle inChild) const override;
-
- bool GetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- void SetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
- void ForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
- void forceSetInstancePropertyValueOnAllSlides(Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue) override;
- bool GetSpecificInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- Qt3DSDMPropertyHandle inProperty, SValue &outValue) const override;
- void GetSpecificInstancePropertyValues(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance,
- TPropertyHandleValuePairList &outValues) override
- {
- return m_Data->GetSpecificInstancePropertyValues(inSlide, inInstance, outValues);
- }
- bool ContainsProperty(Qt3DSDMSlideHandle inSlide, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) const override;
- void GetSlidePropertyEntries(Qt3DSDMSlideHandle inSlide, TSlideEntryList &outEntries) const override;
-
- void PushPropertyValueToChildren(Qt3DSDMSlideHandle inParent, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty, const SValue &inValue) override;
- void ClearChildrenPropertyValues(Qt3DSDMSlideHandle inParent, Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty) override;
- void DeleteAllInstanceEntries(Qt3DSDMInstanceHandle inHandle) override;
- void DeleteAllPropertyEntries(Qt3DSDMPropertyHandle inHandle) override;
- void DeleteAllInstancePropertyEntries(const TInstanceHandleList &inInstances,
- const TPropertyHandleList &inProperties) override;
-
- void GetIntersectingProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- TSlideEntryList &outEntries) const override;
- void PushIntersectingProperties(Qt3DSDMSlideHandle inSlide1, Qt3DSDMSlideHandle inSlide2,
- Qt3DSDMSlideHandle inDestination) override;
- void CopyProperties(Qt3DSDMSlideHandle inSourceSlide, Qt3DSDMInstanceHandle inSourceInstance,
- Qt3DSDMSlideHandle inDestSlide, Qt3DSDMInstanceHandle inDestInstance) override;
-
- bool IsSlide(Qt3DSDMSlideHandle inSlide) const override;
-
- bool HandleValid(int inHandle) const override;
-
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-
- //===================================================================
- // Signals
- //===================================================================
-
- virtual TSignalConnectionPtr
- ConnectSlideCreated(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectBeforeSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectSlideDeleted(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectSlideDerived(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMSlideHandle, int)> &inCallback) override;
- TSignalConnectionPtr ConnectInstancePropertyValueSet(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback) override;
- TSignalConnectionPtr ConnectInstancePropertyValueRemoved(
- const std::function<void(Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle, Qt3DSDMPropertyHandle,
- const SValue &)> &inCallback) override;
- virtual TSignalConnectionPtr
- ConnectSlideTimeChanged(const std::function<void(Qt3DSDMSlideHandle)> &inCallback) override;
-
-private:
- inline void DoForceSetInstancePropertyValue(Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inHandle,
- Qt3DSDMPropertyHandle inProperty,
- const SValue &inValue);
- void InitSignaller();
- ISlideCoreSignalProvider *GetSignalProvider();
- ISlideCoreSignalSender *GetSignalSender();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.cpp b/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.cpp
deleted file mode 100644
index c514108c..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSDMPrefix.h"
-#include "SlideGraphCoreProducer.h"
-#include "HandleSystemTransactions.h"
-#include "VectorTransactions.h"
-#include "SignalsImpl.h"
-using namespace std;
-
-namespace qt3dsdm {
-
-Qt3DSDMSlideGraphHandle CSlideGraphCoreProducer::CreateSlideGraph(Qt3DSDMSlideHandle inRoot)
-{
- Qt3DSDMSlideGraphHandle retval(m_Data->CreateSlideGraph(inRoot));
- CREATE_HANDLE_CREATE_TRANSACTION(m_Consumer, retval, m_Data->m_Objects);
- GetSignalSender()->SendGraphCreated(retval, inRoot);
- return retval;
-}
-
-Qt3DSDMSlideHandle CSlideGraphCoreProducer::GetGraphRoot(Qt3DSDMSlideGraphHandle inGraph) const
-{
- return m_Data->GetGraphRoot(inGraph);
-}
-
-Qt3DSDMSlideGraphHandle CSlideGraphCoreProducer::GetSlideGraph(Qt3DSDMSlideHandle inSlide) const
-{
- return m_Data->GetSlideGraph(inSlide);
-}
-
-void CSlideGraphCoreProducer::GetSlideGraphs(TSlideGraphHandleList &outGraphs) const
-{
- return m_Data->GetSlideGraphs(outGraphs);
-}
-
-struct DissocateAllInstanceTrans : public ITransaction
-{
- std::shared_ptr<CSimpleSlideGraphCore> m_Graph;
- Qt3DSDMSlideGraphHandle m_Handle;
- TSlideInstancePairList m_Instances;
- DissocateAllInstanceTrans(const char *inFile, int inLine,
- std::shared_ptr<CSimpleSlideGraphCore> inGraph,
- Qt3DSDMSlideGraphHandle inHandle)
- : ITransaction(inFile, inLine)
- , m_Graph(inGraph)
- , m_Handle(inHandle)
- {
- inGraph->GetAssociatedInstances(m_Handle, m_Instances);
- }
- void Do() override
- {
- for (size_t idx = 0, end = m_Instances.size(); idx < end; ++idx)
- m_Graph->DissociateInstance(m_Instances[idx].second);
- }
- void Undo() override
- {
- for (size_t idx = 0, end = m_Instances.size(); idx < end; ++idx)
- m_Graph->AssociateInstance(m_Handle, m_Instances[idx].first, m_Instances[idx].second);
- }
-};
-
-void CSlideGraphCoreProducer::DeleteSlideGraph(Qt3DSDMSlideGraphHandle inHandle)
-{
- SSlideGraph *theGraph = CSimpleSlideGraphCore::GetSlideGraphNF(inHandle, m_Data->m_Objects);
- Qt3DSDMSlideHandle theRootSlide(theGraph->m_Root);
- if (m_Consumer)
- m_Consumer->OnTransaction(
- make_shared<DissocateAllInstanceTrans>(__FILE__, __LINE__, m_Data, inHandle));
- CREATE_HANDLE_DELETE_TRANSACTION(m_Consumer, inHandle, m_Data->m_Objects);
- m_Data->DeleteSlideGraph(inHandle);
- GetSignalSender()->SendGraphDeleted(inHandle, theRootSlide);
-}
-
-struct SInstanceAssociateTrans : public ITransaction
-{
- std::shared_ptr<CSimpleSlideGraphCore> m_Graph;
- Qt3DSDMSlideGraphHandle m_GraphHandle;
- Qt3DSDMSlideHandle m_Slide;
- Qt3DSDMInstanceHandle m_Instance;
- bool m_InsertOnDo;
- SInstanceAssociateTrans(const char *inFile, int inLine,
- std::shared_ptr<CSimpleSlideGraphCore> inGraph,
- Qt3DSDMSlideGraphHandle inGraphHandle, Qt3DSDMSlideHandle inSlideHandle,
- Qt3DSDMInstanceHandle inInstance, bool inInsertOnDo)
- : ITransaction(inFile, inLine)
- , m_Graph(inGraph)
- , m_GraphHandle(inGraphHandle)
- , m_Slide(inSlideHandle)
- , m_Instance(inInstance)
- , m_InsertOnDo(inInsertOnDo)
- {
- }
- void Insert() { m_Graph->AssociateInstance(m_GraphHandle, m_Slide, m_Instance); }
- void Remove() { m_Graph->DissociateInstance(m_Instance); }
-
- void Do() override
- {
- if (m_InsertOnDo)
- Insert();
- else
- Remove();
- }
- void Undo() override
- {
- if (m_InsertOnDo)
- Remove();
- else
- Insert();
- }
-};
-
-void CSlideGraphCoreProducer::AssociateInstance(Qt3DSDMSlideGraphHandle inSlideGraph,
- Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance)
-{
- m_Data->AssociateInstance(inSlideGraph, inSlide, inInstance);
- if (m_Consumer)
- m_Consumer->OnTransaction(make_shared<SInstanceAssociateTrans>(
- __FILE__, __LINE__, m_Data, inSlideGraph, inSlide, inInstance, true));
-
- GetSignalSender()->SendInstanceAssociated(inSlideGraph, inSlide, inInstance);
-}
-void CSlideGraphCoreProducer::GetAssociatedInstances(Qt3DSDMSlideGraphHandle inSlideGraph,
- TSlideInstancePairList &outAssociations) const
-{
- m_Data->GetAssociatedInstances(inSlideGraph, outAssociations);
-}
-
-TGraphSlidePair CSlideGraphCoreProducer::GetAssociatedGraph(Qt3DSDMInstanceHandle inInstance) const
-{
- return m_Data->GetAssociatedGraph(inInstance);
-}
-
-void CSlideGraphCoreProducer::DissociateInstance(Qt3DSDMInstanceHandle inInstance)
-{
- TGraphSlidePair theAssociatedGraph(m_Data->GetAssociatedGraph(inInstance));
-
- if (theAssociatedGraph.first.Valid()) {
- m_Data->DissociateInstance(inInstance);
- if (m_Consumer)
- m_Consumer->OnTransaction(make_shared<SInstanceAssociateTrans>(
- __FILE__, __LINE__, m_Data, theAssociatedGraph.first, theAssociatedGraph.second,
- inInstance, false));
- GetSignalSender()->SendInstanceDissociated(theAssociatedGraph.first,
- theAssociatedGraph.second, inInstance);
- }
-}
-
-void CSlideGraphCoreProducer::SetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph,
- Qt3DSDMSlideHandle inSlide)
-{
- if (m_Consumer) {
- Qt3DSDMSlideHandle current = m_Data->GetGraphActiveSlide(inGraph);
- TTransactionPtr theTransaction(CREATE_GENERIC_TRANSACTION(
- bind(&CSimpleSlideGraphCore::SetGraphActiveSlide, m_Data, inGraph, inSlide),
- bind(&CSimpleSlideGraphCore::SetGraphActiveSlide, m_Data, inGraph, current)));
- m_Consumer->OnTransaction(theTransaction);
- }
- m_Data->SetGraphActiveSlide(inGraph, inSlide);
- GetSignalSender()->SendGraphActiveSlide(inGraph, inSlide);
-}
-
-Qt3DSDMSlideHandle CSlideGraphCoreProducer::GetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph) const
-{
- return m_Data->GetGraphActiveSlide(inGraph);
-}
-
-bool CSlideGraphCoreProducer::HandleValid(int inHandle) const
-{
- return m_Data->HandleValid(inHandle);
-}
-
-void CSlideGraphCoreProducer::SetConsumer(TTransactionConsumerPtr inConsumer)
-{
- m_Consumer = inConsumer;
-}
-
-TSignalConnectionPtr CSlideGraphCoreProducer::ConnectGraphCreated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectGraphCreated(inCallback);
-}
-TSignalConnectionPtr CSlideGraphCoreProducer::ConnectGraphDeleted(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectGraphDeleted(inCallback);
-}
-TSignalConnectionPtr CSlideGraphCoreProducer::ConnectInstanceAssociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback)
-{
- return GetSignalProvider()->ConnectInstanceAssociated(inCallback);
-}
-TSignalConnectionPtr CSlideGraphCoreProducer::ConnectInstanceDissociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback)
-{
- return GetSignalProvider()->ConnectInstanceDissociated(inCallback);
-}
-TSignalConnectionPtr CSlideGraphCoreProducer::ConnectGraphActiveSlide(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback)
-{
- return GetSignalProvider()->ConnectGraphActiveSlide(inCallback);
-}
-
-void CSlideGraphCoreProducer::InitSignaller()
-{
- m_Signaller = CreateSlideGraphCoreSignaller();
-}
-
-ISlideGraphCoreSignalProvider *CSlideGraphCoreProducer::GetSignalProvider()
-{
- return dynamic_cast<ISlideGraphCoreSignalProvider *>(m_Signaller.get());
-}
-
-ISlideGraphCoreSignalSender *CSlideGraphCoreProducer::GetSignalSender()
-{
- return dynamic_cast<ISlideGraphCoreSignalSender *>(m_Signaller.get());
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.h b/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.h
deleted file mode 100644
index 5b34cdb9..00000000
--- a/src/Runtime/ogl-runtime/src/dm/systems/cores/SlideGraphCoreProducer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef SLIDEGRAPHCOREPRODUCERH
-#define SLIDEGRAPHCOREPRODUCERH
-#include "SimpleSlideGraphCore.h"
-#include "Qt3DSDMTransactions.h"
-#include "Qt3DSDMSignals.h"
-
-namespace qt3dsdm {
-class CSlideGraphCoreProducer : public ISlideGraphCore,
- public ITransactionProducer,
- public ISlideGraphCoreSignalProvider
-{
- Q_DISABLE_COPY(CSlideGraphCoreProducer)
-
- TSimpleSlideGraphCorePtr m_Data;
- TTransactionConsumerPtr m_Consumer;
- TSignalItemPtr m_Signaller;
-
-public:
- CSlideGraphCoreProducer(TStringTablePtr strTable = TStringTablePtr())
- : m_Data(new CSimpleSlideGraphCore(strTable))
- {
- InitSignaller();
- }
- TSimpleSlideGraphCorePtr GetTransactionlessSlideGraphCore() { return m_Data; }
- TSimpleSlideGraphCorePtr GetTransactionlessSlideGraphCore() const { return m_Data; }
-
- Qt3DSDMSlideGraphHandle CreateSlideGraph(Qt3DSDMSlideHandle inRoot) override;
- Qt3DSDMSlideHandle GetGraphRoot(Qt3DSDMSlideGraphHandle inGraph) const override;
- Qt3DSDMSlideGraphHandle GetSlideGraph(Qt3DSDMSlideHandle inSlide) const override;
- void GetSlideGraphs(TSlideGraphHandleList &outGraphs) const override;
- void DeleteSlideGraph(Qt3DSDMSlideGraphHandle inHandle) override;
-
- void AssociateInstance(Qt3DSDMSlideGraphHandle inSlideGraph, Qt3DSDMSlideHandle inSlide,
- Qt3DSDMInstanceHandle inInstance) override;
- void GetAssociatedInstances(Qt3DSDMSlideGraphHandle inSlideGraph,
- TSlideInstancePairList &outAssociations) const override;
- TGraphSlidePair GetAssociatedGraph(Qt3DSDMInstanceHandle inInstance) const override;
- void DissociateInstance(Qt3DSDMInstanceHandle inInstance) override;
-
- void SetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph, Qt3DSDMSlideHandle inSlide) override;
- Qt3DSDMSlideHandle GetGraphActiveSlide(Qt3DSDMSlideGraphHandle inGraph) const override;
-
- bool HandleValid(int inHandle) const override;
- void SetConsumer(TTransactionConsumerPtr inConsumer) override;
-
- //===================================================================
- // Signals
- //===================================================================
- TSignalConnectionPtr ConnectGraphCreated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectGraphDeleted(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) override;
- TSignalConnectionPtr ConnectInstanceAssociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override;
- TSignalConnectionPtr ConnectInstanceDissociated(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle, Qt3DSDMInstanceHandle)>
- &inCallback) override;
- TSignalConnectionPtr ConnectGraphActiveSlide(
- const std::function<void(Qt3DSDMSlideGraphHandle, Qt3DSDMSlideHandle)> &inCallback) override;
-
-private:
- void InitSignaller();
- ISlideGraphCoreSignalProvider *GetSignalProvider();
- ISlideGraphCoreSignalSender *GetSignalSender();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/EnginePrefix.h b/src/Runtime/ogl-runtime/src/engine/EnginePrefix.h
deleted file mode 100644
index d9017850..00000000
--- a/src/Runtime/ogl-runtime/src/engine/EnginePrefix.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "render/backends/gl/Qt3DSOpenGLPrefix.h"
-
-#ifdef _WIN32
-//==============================================================================
-// DEFINES
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
-//==============================================================================
-// DISABLED WARNINGS
-//
-// Note that most of these warnings are tuned off by default by the compiler
-// even at warning level 4. Using option /Wall turns on all warnings and makes
-// even standard Microsoft include files cry. We had to turn off these or
-// turn off warnings individually for each standard include file which was
-// too much work. Point is that /Wall is like Warning Level 5 and this brings
-// it down to about Warning level 4.5, still way above /W4.
-#pragma warning(disable : 4127) // conditional expression is constant
-#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
-//#pragma warning( disable : 4355 ) // 'this' : used in base member initializer list
-//#pragma warning( disable : 4511 ) // copy constructor could not be generated
-#pragma warning(disable : 4512) // assignment operator could not be generated
-#pragma warning(disable : 4514) // unreferenced inline function has been removed
-//#pragma warning( disable : 4619 ) // #pragma warning : there is no warning number '4619' (in
-//string.h)
-#pragma warning(disable : 4625) // copy constructor could not be generated because a base class copy
- // constructor is inaccessible
-#pragma warning(disable : 4626) // assignment operator could not be generated because a base class
- // assignment operator is inaccessible
-//#pragma warning( disable : 4640 ) // TODO MF Remove - construction of local static object is
-//not thread-safe
-#pragma warning(disable : 4710) // function not inlined
-#pragma warning(disable : 4711) // function selected for automatic inline expansion
-#pragma warning( \
- disable : 4738) // storing 32-bit float result in memory, possible loss of performance
-#pragma warning(disable : 4826) // Conversion from 'const void *' to 'void *' is sign-extended
-//#pragma warning( disable : 4996 ) // _snprintf' was declared deprecated
-
-#endif //_WIN32
-
-//==============================================================================
-// Non-windows environments need to declare this
-#ifndef MAX_PATH
-#define MAX_PATH 260
-#endif
-
-//==============================================================================
-// STD - Standard includes MUST come first
-#ifdef _WIN32
-#pragma warning(push, 3)
-#pragma warning( \
- disable : 4548) // expression before comma has no effect; expected expression with side-effect
-#endif
-
-#include <stdio.h>
-#include <iostream>
-
-#if defined(_PCPLATFORM) || defined(_TEGRAPLATFORM)
-#include <tchar.h>
-#endif
-
-#ifdef _WIN32
-#pragma warning(pop)
-#endif
-
-//==============================================================================
-// Runtime
-//==============================================================================
-#include "Qt3DSAssert.h"
-#include "Qt3DSMacros.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSQmlEngine.h"
-#include "Qt3DSAttributeHashes.h"
-
-//==============================================================================
-// Additional Linux only dependencies
-//==============================================================================
-#if defined(_LINUXPLATFORM) || defined(_INTEGRITYPLATFORM)
-
-#pragma pack(1)
-struct BITMAPFILEHEADER
-{
- Q3DStudio::UINT16 bfType;
- Q3DStudio::UINT32 bfSize;
- Q3DStudio::UINT16 bfReserved1;
- Q3DStudio::UINT16 bfReserved2;
- Q3DStudio::UINT32 bfOffBits;
-};
-#pragma pack()
-
-#pragma pack(1)
-
-typedef struct tagBITMAPINFOHEADER
-{
- Q3DStudio::UINT32 biSize;
- Q3DStudio::INT32 biWidth;
- Q3DStudio::INT32 biHeight;
- Q3DStudio::UINT16 biPlanes;
- Q3DStudio::UINT16 biBitCount;
- Q3DStudio::UINT32 biCompression;
- Q3DStudio::UINT32 biSizeImage;
- Q3DStudio::INT32 biXPelsPerMeter;
- Q3DStudio::INT32 biYPelsPerMeter;
- Q3DStudio::UINT32 biClrUsed;
- Q3DStudio::UINT32 biClrImportant;
-} BITMAPINFOHEADER;
-
-#pragma pack()
-
-#define UNREFERENCED_PARAMETER(theParam) theParam;
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/NVImageScaler.h b/src/Runtime/ogl-runtime/src/engine/NVImageScaler.h
deleted file mode 100644
index 069604a6..00000000
--- a/src/Runtime/ogl-runtime/src/engine/NVImageScaler.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-namespace Q3DStudio {
-namespace ImageScaler {
-
- //==============================================================================
- /**
- *
- */
- template <INT32 TNumChannels>
- inline void BilinearReduceRows(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- CHAR *outDstBuffer, INT32 inDstHeight)
- {
- INT32 theDDAConst = static_cast<INT32>(1024.0 * inDstHeight / inSrcHeight);
- INT32 theDDAAccum = 0;
- INT32 thePixelCount;
-
- INT32 theSrcRow;
- INT32 theSrcCol;
- INT32 theDstRow;
-
- INT32 theChannelAccum[TNumChannels] = { 0 };
-
- CHAR *theDstPointer = outDstBuffer;
- const CHAR *theSrcPointer = inSrcBuffer;
- const CHAR *theSrcColPointer = NULL;
- CHAR *theDstColPointer = NULL;
-
- INT32 theStepSize = TNumChannels;
- INT32 theSrcStride = TNumChannels * inSrcWidth;
- INT32 theDstStride = TNumChannels * inSrcWidth;
-
- for (theSrcCol = 0; theSrcCol < inSrcWidth; ++theSrcCol) {
- theSrcColPointer = theSrcPointer + (theSrcCol * theStepSize);
- theDstColPointer = theDstPointer + (theSrcCol * theStepSize);
-
- theSrcRow = 0L;
- theDstRow = 0L;
- thePixelCount = 0L;
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] = 0L;
-
- theDDAAccum = 0L;
-
- while (theSrcRow < inSrcHeight) {
- while ((theDDAAccum < 1024L) && (theSrcRow < inSrcHeight)) {
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] +=
- 1024L * theSrcColPointer[(theSrcRow * theSrcStride) + idx];
-
- theDDAAccum += theDDAConst;
- thePixelCount += 1024L;
- ++theSrcRow;
- }
-
- theDDAAccum = (theSrcRow < inSrcHeight) ? (theDDAAccum - 1024L) : (0L);
- thePixelCount -= theDDAAccum;
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] -= theDDAAccum
- * (INT32)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + idx];
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theDstColPointer[(theDstRow * theDstStride) + idx] =
- (CHAR)(theChannelAccum[idx] / thePixelCount);
-
- thePixelCount = 1024L - theDDAAccum;
- ++theDstRow;
-
- if (theDstRow >= inDstHeight)
- break;
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] = thePixelCount
- * (INT32)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + idx];
- }
- }
- }
-
- inline void BilinearReduceRows(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- INT32 inChannels, CHAR *outDstBuffer, INT32 inDstHeight)
- {
- switch (inChannels) {
- case 4:
- BilinearReduceRows<4>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstHeight);
- break;
- case 3:
- BilinearReduceRows<3>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstHeight);
- break;
- case 2:
- BilinearReduceRows<2>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstHeight);
- break;
- case 1:
- BilinearReduceRows<1>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstHeight);
- break;
- }
- }
-
- template <INT32 TNumChannels>
- inline void BilinearReduceCols(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- CHAR *outDstBuffer, INT32 inDstWidth)
- {
- INT32 theDDAConst = static_cast<INT32>(1024.0 * inDstWidth / inSrcWidth);
- INT32 theDDAAccum = 0L;
- INT32 thePixelCount;
-
- INT32 theSrcRow;
- INT32 theSrcCol;
- INT32 theDstCol;
-
- INT32 theChannelAccum[TNumChannels];
-
- CHAR *theDstPointer = outDstBuffer;
- const CHAR *theSrcPointer = inSrcBuffer;
- const CHAR *theSrcRowPointer;
- CHAR *theDstRowPointer;
-
- INT32 theSrcStepSize = TNumChannels;
- INT32 theDstStepSize = TNumChannels;
-
- for (theSrcRow = 0; theSrcRow < inSrcHeight; ++theSrcRow) {
-
- theSrcRowPointer = theSrcPointer + (theSrcRow * inSrcWidth * theSrcStepSize);
- theDstRowPointer = theDstPointer + (theSrcRow * inDstWidth * theDstStepSize);
-
- theSrcCol = 0L;
- theDstCol = 0L;
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] = 0L;
- thePixelCount = 0L;
- theDDAAccum = 0L;
-
- while (theSrcCol < inSrcWidth) {
- while ((theDDAAccum < 1024L) && (theSrcCol < inSrcWidth)) {
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] +=
- 1024L * theSrcRowPointer[(theSrcCol * theSrcStepSize) + idx];
-
- theDDAAccum += theDDAConst;
- thePixelCount += 1024L;
- ++theSrcCol;
- }
-
- theDDAAccum = (theSrcCol < inSrcWidth) ? (theDDAAccum - 1024L) : (0L);
- thePixelCount -= theDDAAccum;
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] -= theDDAAccum
- * (INT32)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + idx];
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theDstRowPointer[(theDstCol * theDstStepSize) + idx] =
- (CHAR)(theChannelAccum[idx] / thePixelCount);
-
- thePixelCount = 1024L - theDDAAccum;
- ++theDstCol;
-
- if (theDstCol >= inDstWidth) {
- break;
- }
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theChannelAccum[idx] = thePixelCount
- * (INT32)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + idx];
- }
- }
- }
-
- inline void BilinearReduceCols(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- INT32 inChannels, CHAR *&outDstBuffer, INT32 inDstWidth)
- {
- switch (inChannels) {
- case 4:
- BilinearReduceCols<4>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth);
- break;
- case 3:
- BilinearReduceCols<3>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth);
- break;
- case 2:
- BilinearReduceCols<2>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth);
- break;
- case 1:
- BilinearReduceCols<1>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth);
- break;
- }
- }
-
- template <INT32 TNumChannels>
- inline void BilinearReduceImage(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- CHAR *outDstBuffer, INT32 inDstWidth, INT32 inDstHeight)
- {
- // Number larger than 1024
- // One pixel in the source image is equivalent to this much of a pixel
- // in terms of dest pixels.
- INT32 theXIncrement = static_cast<INT32>(1024.f * inSrcWidth / inDstWidth);
- // How many rows do we skip, in fixed point arithmetic, when we bump lines
- INT32 theYIncrement = static_cast<INT32>(1024.f * inSrcHeight / inDstHeight);
- // We are starting at position .5 in textel space
- INT32 theSrcYPtr = 0;
- CHAR *theDstPtr = outDstBuffer;
- for (INT32 theHeightIndex = 0; theHeightIndex < inDstHeight;
- ++theHeightIndex, theSrcYPtr += theYIncrement) {
- INT32 theSrcXPtr = 0;
- for (INT32 theWidthIndex = 0; theWidthIndex < inDstWidth;
- ++theWidthIndex, theSrcXPtr += theXIncrement, theDstPtr += TNumChannels) {
- INT32 theAccum[TNumChannels] = { 0 };
- INT32 theNumPixels = 0;
- // Pull all reasonable pixels from the source image.
- INT32 theStartRow = (theSrcYPtr / 1024);
- INT32 theStopRow = (theSrcYPtr + theYIncrement) / 1024;
- INT32 theStartColumn = theSrcXPtr / 1024;
- INT32 theStopColumn = (theSrcXPtr + theXIncrement) / 1024;
- // Average everything between the columns
- for (INT32 theRow = theStartRow; theRow < theStopRow; ++theRow) {
- INT32 theSrcAddr = (theRow * inSrcWidth + theStartColumn) * TNumChannels;
- for (INT32 theCol = theStartColumn; theCol < theStopColumn;
- ++theCol, theSrcAddr += TNumChannels) {
- ++theNumPixels;
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theAccum[idx] += inSrcBuffer[theSrcAddr + idx];
- }
- }
-
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theDstPtr[idx] = theAccum[idx] / theNumPixels;
- }
- }
- }
-
- template <INT32 TNumChannels>
- inline void NearestReduceImage(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- CHAR *outDstBuffer, INT32 inDstWidth, INT32 inDstHeight)
- {
- // Number larger than 1024
- // One pixel in the source image is equivalent to this much of a pixel
- // in terms of dest pixels.
- INT32 theXIncrement = static_cast<INT32>(1024.f * inSrcWidth / inDstWidth);
- // How many rows do we skip, in fixed point arithmetic, when we bump lines
- INT32 theYIncrement = static_cast<INT32>(1024.f * inSrcHeight / inDstHeight);
- // We are starting at position .5 in textel space
- INT32 theSrcYPtr = theYIncrement / 2;
- CHAR *theDstPtr = outDstBuffer;
- for (INT32 theHeightIndex = 0; theHeightIndex < inDstHeight;
- ++theHeightIndex, theSrcYPtr += theYIncrement) {
- INT32 theSrcRow = (theSrcYPtr / 1024) * inSrcWidth * TNumChannels;
- INT32 theSrcXPtr = theXIncrement / 2;
- for (INT32 theWidthIndex = 0; theWidthIndex < inDstWidth;
- ++theWidthIndex, theSrcXPtr += theXIncrement, theDstPtr += TNumChannels) {
- INT32 theSrcPtr = theSrcRow + (theSrcXPtr >> 10) * TNumChannels;
- for (INT32 idx = 0; idx < TNumChannels; ++idx)
- theDstPtr[idx] = inSrcBuffer[theSrcPtr + idx];
- }
- }
- }
-
- inline void NearestReduceImage(const CHAR *inSrcBuffer, INT32 inSrcWidth, INT32 inSrcHeight,
- INT32 inChannels, CHAR *outDstBuffer, INT32 inDstWidth,
- INT32 inDstHeight)
- {
- switch (inChannels) {
- case 4:
- NearestReduceImage<4>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth,
- inDstHeight);
- break;
- case 3:
- NearestReduceImage<3>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth,
- inDstHeight);
- break;
- case 2:
- NearestReduceImage<2>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth,
- inDstHeight);
- break;
- case 1:
- NearestReduceImage<1>(inSrcBuffer, inSrcWidth, inSrcHeight, outDstBuffer, inDstWidth,
- inDstHeight);
- break;
- }
- }
-}
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/engine/OpenKodeInclude.h b/src/Runtime/ogl-runtime/src/engine/OpenKodeInclude.h
deleted file mode 100644
index 06bdf006..00000000
--- a/src/Runtime/ogl-runtime/src/engine/OpenKodeInclude.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Includes
-//==============================================================================
-
-// Wrap the <kd/kd.h> include so we can ensure it gets compiled with 8 byte alignment
-// also, this means we need to compile nv_main.c (via right click -> properties) with 8 byte
-// alignment too!
-
-#pragma pack(push)
-#pragma pack(8)
-#include <KD/kd.h>
-#pragma pack(pop)
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace NVUI {
-
-} // namespace NVUI
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSEGLInfo.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSEGLInfo.h
deleted file mode 100644
index 7be2c09e..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSEGLInfo.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_EGLINFO_H
-#define QT3DS_EGLINFO_H
-
-#ifdef _PLATFORM_USE_EGL
-#include <EGL/egl.h>
-
-namespace Q3DStudio {
-struct SEGLInfo
-{
- EGLDisplay display;
- EGLSurface surface;
- EGLContext context;
- EGLConfig config;
- EGLNativeWindowType nativewin;
-};
-};
-
-#else
-namespace Q3DStudio {
-struct SEGLInfo
-{
- void *display;
- void *surface;
- void *context;
- void *config;
- void *nativewin;
-};
-};
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSEGLWindowSystem.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSEGLWindowSystem.h
deleted file mode 100644
index 770f5c9f..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSEGLWindowSystem.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_EGL_WINDOW_SYSTEM_H
-#define QT3DS_EGL_WINDOW_SYSTEM_H
-#include "Qt3DSEGLInfo.h"
-#include "Qt3DSWindowSystem.h"
-#include "nv_main/nv_main.h"
-
-namespace Q3DStudio {
-struct SEGLWindowSystemImpl : public IWindowSystem
-{
- SEGLInfo m_EGLInfo;
-
- virtual QSize GetWindowDimensions()
- {
- int w, h;
-
- eglQuerySurface(gEGLHandles[0].display, gEGLHandles[0].surface, EGL_WIDTH, &w);
- eglQuerySurface(gEGLHandles[0].display, gEGLHandles[0].surface, EGL_HEIGHT, &h);
-
- return QSize(w, h);
- }
- virtual void SetWindowDimensions(const QSize &) {}
- // For platforms that support it, we get the egl info for render plugins
- // Feel free to return NULL.
- virtual SEGLInfo *GetEGLInfo()
- {
- m_EGLInfo.display = gEGLHandles[0].display;
- m_EGLInfo.surface = gEGLHandles[0].surface;
- m_EGLInfo.context = gEGLHandles[0].context;
- m_EGLInfo.config = gEGLHandles[0].config;
- m_EGLInfo.nativewin = gEGLHandles[0].nativewin;
- return &m_EGLInfo;
- }
- // on some systems we allow our default render target to be a offscreen buffer
- // otherwise return 0;
- virtual int GetDefaultRenderTargetID() { return 0; }
- // returns the depth buffer bit count for the render window
- // overwrite this one for your own needs
- virtual int GetDepthBitCount()
- {
- EGLint depth = 16;
-#ifdef _PLATFORM_USE_EGL
- if (gEGLHandles[0].display && gEGLHandles[0].config)
- eglGetConfigAttrib(gEGLHandles[0].display, gEGLHandles[0].config, EGL_DEPTH_SIZE,
- &depth);
-#endif
-
- return depth;
- }
-};
-};
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSPluginDLL.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSPluginDLL.h
deleted file mode 100644
index 1ba7cf08..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSPluginDLL.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//==============================================================================
-// Includes
-//==============================================================================
-#pragma once
-#include "Qt3DSBasicPluginDLL.h"
-
-#include <QtGlobal>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//==============================================================================
-// Enums
-//==============================================================================
-// Texture format
-typedef enum _ETEXTUREFORMAT {
- ETEXTUREFORMAT_Unknown = 0,
- ETEXTUREFORMAT_RGBA8,
- ETEXTUREFORMAT_RGB8,
- ETEXTUREFORMAT_RGB565,
- ETEXTUREFORMAT_RGBA5551,
- ETEXTUREFORMAT_Alpha8,
- ETEXTUREFORMAT_Luminance8,
- ETEXTUREFORMAT_LuminanceAlpha8,
- ETEXTUREFORMAT_RGBA_DXT1,
- ETEXTUREFORMAT_RGB_DXT1,
- ETEXTUREFORMAT_RGBA_DXT3,
- ETEXTUREFORMAT_RGBA_DXT5,
-} ETEXTUREFORMAT;
-
-//==============================================================================
-// Functions declarations
-//==============================================================================
-
-//==============================================================================
-/**
- * Perform plugin initialization.
- * @param inArgs string arguments from XIF arg parameter
- * @return EDLLSTATUS_OK if initialization suceeds
- */
-typedef long (*PROC_Initialize)(const char *inArgs);
-Q_DECL_EXPORT long Initialize(const char *inArgs);
-
-//==============================================================================
-/**
- * Passes the current screen size and format to the plugin.
- * Plugin should override with it's own desired settings.
- * This affects the size and format of the allocated offscreen texture.
- * When resources are allocated, SetAllocatedRenderInfo will be called to
- * inform the plugin of the allocated resources
- * @param ioWidth width
- * @param ioHeight height
- * @param ioTextureFormat See ETEXTUREFORMAT
- */
-typedef void (*PROC_GetDesiredTextureSize)(long *ioWidth, long *ioHeight,
- ETEXTUREFORMAT *ioTextureFormat);
-Q_DECL_EXPORT void GetDesiredTextureSize(long *ioWidth, long *ioHeight,
- ETEXTUREFORMAT *ioTextureFormat);
-
-//==============================================================================
-/**
- * Information about the current EGL environment.
- * Useful if plugin wishes to switch EGLContext to manage it's own state.
- * Optional
- * @param inEGLDisplay pointer to EGLDisplay
- * @param inEGLCurrentContext pointer to current EGLContext
- * @param inEGLSurface pointer to EGLSurface
- * @param inEGLConfig pointer to EGLConfig attributes
- */
-typedef void (*PROC_SetEGLInfo)(void *inEGLDisplay, void *inEGLCurrentContext, void *inEGLSurface,
- void *inEGLConfig);
-Q_DECL_EXPORT void SetEGLInfo(void *inEGLDisplay, void *inEGLCurrentContext,
- void *inEGLSurface, void *inEGLConfig);
-
-//==============================================================================
-/**
- * Render pulse whenever the runtime requires a frame from the plugin.
- * Note that if plugin wishes to switch EGLContext,
- * it should restore the previous EGLContext(obtained from SetEGLInfo) at the end of this
- *function.
- * @param inHostWidth width of the host rectangle
- * @param inHostHeight height of the host rectangle
- * @param inDrawTime current time in milliseconds
- */
-typedef void (*PROC_Render)(long inHostWidth, long inHostHeight, long inDrawTime);
-Q_DECL_EXPORT void Render(long inHostWidth, long inHostHeight, long inDrawTime);
-
-//==============================================================================
-/**
- * Perform plugin uninitialization.
- * @return EDLLSTATUS_OK if successful
- */
-typedef long (*PROC_Uninitialize)();
-Q_DECL_EXPORT long Uninitialize();
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.cpp b/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.cpp
deleted file mode 100644
index cd99a95b..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.cpp
+++ /dev/null
@@ -1,1919 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "EnginePrefix.h"
-#include "Qt3DSRenderRuntimeBindingImpl.h"
-#include "Qt3DSSceneManager.h"
-#include "Qt3DSIScene.h"
-#include "Qt3DSRuntimeView.h"
-#include "Qt3DSQmlEngine.h"
-#include "Qt3DSRenderUIPLoader.h"
-#include "Qt3DSPresentationFrameData.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "Qt3DSRenderSubpresentation.h"
-#include "Qt3DSIScriptBridge.h"
-#include "Qt3DSFileStream.h"
-#include "Qt3DSDMPrefix.h"
-#include "foundation/IOStreams.h"
-#include "Qt3DSDMStringTable.h"
-#include "Qt3DSDMXML.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "foundation/SerializationTypes.h"
-#include "Qt3DSRenderGraphObjectSerializer.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderImageBatchLoader.h"
-#include "Qt3DSPresentation.h"
-
-#include "Qt3DSDLLManager.h"
-#include "Qt3DSBasicPluginDLL.h"
-#include "Qt3DSPluginDLL.h"
-#include "Qt3DSRenderPlugin.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSStateVisualBindingContextCommands.h"
-#include "Qt3DSStateScriptContext.h"
-#include "EventPollingSystem.h"
-#include "EventSystem.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSMatrix.h"
-#include "Qt3DSWindowSystem.h"
-#if !defined (Q_OS_MACOS)
-#include "Qt3DSEGLInfo.h"
-#endif
-#include "Qt3DSOffscreenRenderKey.h"
-#include "Qt3DSOldNBustedRenderPlugin.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "Qt3DSRenderBufferLoader.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRenderPrefilterTexture.h"
-#include "foundation/PoolingAllocator.h"
-#include "q3dsqmlrender.h"
-
-#ifdef EA_PLATFORM_WINDOWS
-#pragma warning(disable : 4355)
-#endif
-
-using namespace qt3ds::render;
-using eastl::make_pair;
-using eastl::pair;
-using qt3ds::runtime::IApplication;
-
-#ifndef _WIN32
-#define stricmp strcasecmp
-#endif
-namespace qt3ds {
-namespace render {
- qt3ds::foundation::MallocAllocator g_BaseAllocator;
-}
-}
-namespace {
-struct Qt3DSRenderScene;
-
-struct Qt3DSRenderSceneSubPresRenderer : public CSubPresentationRenderer
-{
- Qt3DSRenderScene &m_Scene;
- Qt3DSRenderSceneSubPresRenderer(Qt3DSRenderScene &inScene, IQt3DSRenderContext &inRenderContext,
- SPresentation &inPresentation)
- : CSubPresentationRenderer(inRenderContext, inPresentation)
- , m_Scene(inScene)
- {
- }
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext.GetAllocator())
- SOffscreenRenderFlags NeedsRender(const SOffscreenRendererEnvironment &inEnvironment,
- QT3DSVec2 inPresScale,
- const SRenderInstanceId instanceId) override;
- void Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresScale,
- SScene::RenderClearCommand inClearBuffer,
- const SRenderInstanceId instanceId) override;
- void RenderWithClear(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresScale,
- SScene::RenderClearCommand inClearBuffer, QT3DSVec4 inClearColor,
- const SRenderInstanceId instanceId) override;
-};
-
-struct SSceneLoadData
-{
- NVAllocatorCallback &m_Allocator;
- NVScopedRefCounted<ILoadedBuffer> m_Data;
- SPresentation *m_Presentation;
- NVDataRef<QT3DSU8> m_TranslatorData;
- NVDataRef<QT3DSU8> m_SceneGraphData;
- eastl::vector<Qt3DSTranslator *> m_Translators;
- SPoolingAllocator m_AutoAllocator;
- Q3DStudio::IPresentation *m_RuntimePresentation;
- QT3DSI32 mRefCount;
-
- SSceneLoadData(NVAllocatorCallback &alloc)
- : m_Allocator(alloc)
- , m_Presentation(nullptr)
- , m_AutoAllocator(alloc)
- , m_RuntimePresentation(nullptr)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Allocator)
-};
-
-struct Qt3DSRenderScene : public Q3DStudio::IScene
-{
- SBindingCore &m_BindingCore;
- NVScopedRefCounted<IQt3DSRenderContext> m_Context;
- NVScopedRefCounted<SSceneLoadData> m_LoadData;
- // The scene graph gets allocated kind of on its own
- // So do the smaller translation objects that translate TElement properties
- // into the graph.
- SPresentation *m_Presentation;
- Q3DStudio::IPresentation *m_RuntimePresentation;
- void *m_UserData;
- TTranslatorDirytSet m_DirtySet;
- CRegisteredString m_OffscreenRendererId;
- IOffscreenRenderer *m_OffscreenRenderer;
- CRegisteredString m_SubPresentationType;
- nvvector<SGraphObject *> m_GraphObjectList;
- bool m_LoggedPickLastFrame;
- NVRenderRect m_LastRenderViewport;
- CRegisteredString m_PathSubPathType;
-
- Qt3DSRenderScene(SBindingCore &inBindingCore, IQt3DSRenderContext &inContext,
- SSceneLoadData &inLoadData)
- : m_BindingCore(inBindingCore)
- , m_Context(inContext)
- , m_LoadData(inLoadData)
- , m_Presentation(inLoadData.m_Presentation)
- , m_RuntimePresentation(inLoadData.m_RuntimePresentation)
- , m_UserData(nullptr)
- , m_DirtySet(inContext.GetAllocator(), "Qt3DSRenderScene::m_DirtySet")
- , m_OffscreenRenderer(nullptr)
- , m_SubPresentationType(
- inContext.GetStringTable().RegisterStr(CSubPresentationRenderer::GetRendererName()))
- , m_GraphObjectList(inContext.GetAllocator(), "Qt3DSDSRenderScene::m_GraphObjectList")
- , m_LoggedPickLastFrame(false)
- {
- for (QT3DSU32 idx = 0, end = inLoadData.m_Translators.size(); idx < end; ++idx) {
- m_DirtySet.insert(*inLoadData.m_Translators[idx]);
- }
- m_PathSubPathType = inContext.GetStringTable().RegisterStr("PathAnchorPoint");
- }
-
- virtual ~Qt3DSRenderScene()
- {
- if (m_OffscreenRenderer)
- m_Context->GetOffscreenRenderManager().ReleaseOffscreenRenderer(m_OffscreenRendererId);
- m_OffscreenRenderer = nullptr;
- if (m_Presentation && m_Presentation->m_Scene) {
- for (SLayer *theLayer = m_Presentation->m_Scene->m_FirstChild; theLayer;
- theLayer = static_cast<SLayer *>(theLayer->m_NextSibling)) {
- m_Context->GetRenderer().ReleaseLayerRenderResources(*theLayer, nullptr);
- }
- }
- }
-
- qt3ds::NVAllocatorCallback &allocator() override { return m_LoadData->m_AutoAllocator; }
- Q3DStudio::IPresentation &GetPresentation() override { return *m_RuntimePresentation; }
-
- bool preferKtx() const override
- {
- return m_Presentation->m_preferKTX;
- }
-
- // Update really just adds objects to the dirty set
- bool Update()
- {
- Q3DStudio::TElementList &theDirtyList =
- m_RuntimePresentation->GetFrameData().GetDirtyList();
- for (QT3DSU32 idx = 0, end = theDirtyList.GetCount(); idx < end; ++idx) {
- Q3DStudio::TElement &theElement = *theDirtyList[idx];
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(theElement.GetAssociation());
- if (!theTranslator && theElement.GetType() == m_PathSubPathType) {
- Q3DStudio::TElement *theParent = theElement.GetParent();
- if (theParent) {
- theTranslator = reinterpret_cast<Qt3DSTranslator *>(theParent->GetAssociation());
- // The path translator responds to anchor point changes as well as its own data
- // changes.
- if (theTranslator
- && theTranslator->RenderObject().m_Type != GraphObjectTypes::PathSubPath)
- theTranslator = nullptr;
- }
- }
- if (theTranslator)
- m_DirtySet.insert(*theTranslator);
- }
- return m_DirtySet.size() > 0;
- }
-
- void TransferDirtyProperties()
- {
- if (m_Presentation) {
- for (QT3DSU32 idx = 0, end = m_DirtySet.size(); idx < end; ++idx) {
- QT3DS_ASSERT(m_DirtySet.size() == end);
- m_DirtySet[idx]->OnElementChanged(*m_Presentation, *m_Context,
- *m_RuntimePresentation);
- }
- m_DirtySet.clear();
- }
- }
-
- bool PrepareForRender()
- {
- TransferDirtyProperties();
- m_LastRenderViewport = m_Context->GetRenderList().GetViewport();
- if (m_Presentation && m_Presentation->m_Scene) {
- NVRenderRect theViewportSize(m_LastRenderViewport);
- return m_Presentation->m_Scene->PrepareForRender(
- QT3DSVec2((QT3DSF32)theViewportSize.m_Width, (QT3DSF32)theViewportSize.m_Height),
- *m_Context);
- }
- return false;
- }
-
- void Render()
- {
- if (m_Presentation && m_Presentation->m_Scene) {
- NVRenderRect theViewportSize(m_LastRenderViewport);
- m_Presentation->m_Scene->Render(
- QT3DSVec2((QT3DSF32)theViewportSize.m_Width, (QT3DSF32)theViewportSize.m_Height), *m_Context,
- SScene::DoNotClear);
- }
- }
-
- // Note that we do not need to call WindowToPresentation on the mouse coordinates because they
- // are specifically
- // supposed to be the return values from getMousePosition which applies that transformation. We
- // do, however need
- // to reverse part of this transformation; whatever part happens after
- // m_Context->GetMousePickMouseCoords
- Q3DStudio::TElement *UserPick(float mouseX, float mouseY)
- {
- // Note that the pick code below only calls GetMousePickMouseCoords
- // while windowToPresentation subtracts the window positional offset from
- // the mouse position.
- // Thus we have to add it back.
- QT3DSVec2 mousePos(mouseX + m_LastRenderViewport.m_X, mouseY + m_LastRenderViewport.m_Y);
-
- Qt3DSRenderPickResult thePickResult = m_Context->GetRenderer().Pick(
- *m_Presentation->m_Scene->m_FirstChild, m_Context->GetMousePickViewport()
- // GetMousePickMouseCoords is called by the renderer to setup the pick frame.
- // This is so that the presentation's lastMouseX and lastMouseY variables are correctly
- // setup.
- ,
- mousePos, true, true);
-
- if (thePickResult.m_HitObject != nullptr) {
- SModel *theHitModel =
- static_cast<SModel *>(const_cast<SGraphObject *>(thePickResult.m_HitObject));
- return &Qt3DSTranslator::GetTranslatorFromGraphNode(*theHitModel)->Element();
- }
- return nullptr;
- }
-
- virtual Option<QT3DSVec2> FacePosition(Q3DStudio::TElement &inElement, float mouseX, float mouseY,
- NVDataRef<Q3DStudio::TElement *> inMapperElements,
- Q3DStudio::FacePositionPlanes::Enum inPlane)
- {
- if (inElement.GetBelongedPresentation() != this->m_RuntimePresentation
- && inMapperElements.size() == 0) {
- return Empty();
- }
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement.GetAssociation());
- if (theTranslator == nullptr)
- return Empty();
- bool isValidPickObject =
- GraphObjectTypes::IsNodeType(theTranslator->m_RenderObject->m_Type);
- if (isValidPickObject == false)
- return Empty();
- SNode &theNode = static_cast<SNode &>(*theTranslator->m_RenderObject);
- NVBounds3 theBounds = GetNodeLocalBoundingBox(&inElement, false);
- // See commens in UserPick
- QT3DSVec2 mousePos(mouseX + m_LastRenderViewport.m_X, mouseY + m_LastRenderViewport.m_Y);
- eastl::vector<SGraphObject *> theMapperObjects(inMapperElements.size());
- for (QT3DSU32 idx = 0, end = inMapperElements.size(); idx < end; ++idx) {
- Qt3DSTranslator *theMapperTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inMapperElements[idx]->GetAssociation());
- SGraphObject *theMapperObject = nullptr;
- if (theMapperTranslator) {
- theMapperObject = theMapperTranslator->m_RenderObject;
- }
- if (theMapperObject == nullptr) {
- QT3DS_ASSERT(false);
- } else {
- theMapperObjects[idx] = theMapperObject;
- }
- }
- qt3ds::render::SBasisPlanes::Enum thePlane(qt3ds::render::SBasisPlanes::XY);
- switch (inPlane) {
- case Q3DStudio::FacePositionPlanes::XY:
- thePlane = qt3ds::render::SBasisPlanes::XY;
- break;
- case Q3DStudio::FacePositionPlanes::YZ:
- thePlane = qt3ds::render::SBasisPlanes::YZ;
- break;
- case Q3DStudio::FacePositionPlanes::XZ:
- thePlane = qt3ds::render::SBasisPlanes::XZ;
- break;
- }
- if (theBounds.isEmpty() == false)
- return m_Context->GetRenderer().FacePosition(
- theNode, theBounds, theNode.m_GlobalTransform, m_Context->GetMousePickViewport(),
- mousePos,
- NVDataRef<SGraphObject *>(theMapperObjects.data(), (QT3DSU32)theMapperObjects.size()),
- thePlane);
- return Empty();
- }
-
- void Pick(Q3DStudio::SPickFrame &ioPickFrame)
- {
- // Presentation's m_Hide can disable rendering
- bool wasPickLoggedLastFrame = m_LoggedPickLastFrame;
- m_LoggedPickLastFrame = false;
- if (ioPickFrame.m_InputFrame.m_PickValid) {
- // If we have not already found a valid pick on a previous layer
- if (!ioPickFrame.m_ResultValid && m_Presentation && m_Presentation->m_Scene
- && m_Presentation->m_Scene->m_FirstChild) {
- Qt3DSRenderPickResult thePickResult = m_Context->GetRenderer().Pick(
- *m_Presentation->m_Scene->m_FirstChild, m_Context->GetMousePickViewport()
- // GetMousePickMouseCoords is called by the renderer to setup the pick frame.
- // This is so that the presentation's lastMouseX and lastMouseY variables are
- // correctly setup.
- ,
- m_Context->GetMousePickMouseCoords(
- QT3DSVec2(ioPickFrame.m_InputFrame.m_PickX, ioPickFrame.m_InputFrame.m_PickY)),
- true);
- if (thePickResult.m_HitObject != nullptr) {
- SModel *theHitModel = static_cast<SModel *>(
- const_cast<SGraphObject *>(thePickResult.m_HitObject));
- ioPickFrame.m_Model =
- &Qt3DSTranslator::GetTranslatorFromGraphNode(*theHitModel)->Element();
- // I don't think local hit is used any more, but not sure. If they are used,
- // then the code below is probably wrong.
- ioPickFrame.m_LocalHit[0] = thePickResult.m_LocalUVCoords.x;
- ioPickFrame.m_LocalHit[1] = thePickResult.m_LocalUVCoords.y;
- ioPickFrame.m_SquaredDistance = thePickResult.m_CameraDistanceSq;
- ioPickFrame.m_ResultValid = true;
- if (wasPickLoggedLastFrame == false) {
- m_LoggedPickLastFrame = true;
- Q3DStudio::IPresentation *thePresentation =
- ioPickFrame.m_Model->GetBelongedPresentation();
- IApplication &theRuntime = thePresentation->GetApplication();
- // We are picking against the previous frame of information.
- qCInfo(TRACE_INFO, "Model Picked: %s on frame %d",
- theHitModel->m_Id.c_str(),
- theRuntime.GetFrameCount() - 1);
- }
- } else {
- // The scene is always picked if it is pickable; nothing else really makes
- // sense.
- Qt3DSTranslator *theTranslator =
- Qt3DSTranslator::GetTranslatorFromGraphNode(*m_Presentation->m_Scene);
-
- if (theTranslator) {
- ioPickFrame.m_Model = &theTranslator->Element();
- // I don't think local hit is used any more, but not sure. If they are
- // used, then the code below is probably wrong.
- ioPickFrame.m_LocalHit[0] = ioPickFrame.m_InputFrame.m_PickX
- / m_Presentation->m_PresentationDimensions.x;
- ioPickFrame.m_LocalHit[1] = 1.0f
- - ioPickFrame.m_InputFrame.m_PickY
- / m_Presentation->m_PresentationDimensions.y;
- ioPickFrame.m_SquaredDistance = 0;
- ioPickFrame.m_ResultValid = true;
- }
- }
- }
- }
- }
-
- void SetUserData(void *inUserData) override { m_UserData = inUserData; }
- void *GetUserData() override { return m_UserData; }
-
- // Unfortunately, you should expect the node to be dirty at this point so we may need to force
- // an update
- void CalculateGlobalTransform(Q3DStudio::TElement *inElement,
- Q3DStudio::RuntimeMatrix &outTransform) override
- {
- if (inElement == nullptr) {
- QT3DS_ASSERT(false);
- return;
- }
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement->GetAssociation());
- if (theTranslator && GraphObjectTypes::IsNodeType(theTranslator->GetUIPType())) {
- Update();
- TransferDirtyProperties();
- SNode *theNode = static_cast<SNode *>(&theTranslator->RenderObject());
- // Ensure the node stays dirty
- bool wasDirty = theNode->m_Flags.IsDirty();
- theNode->CalculateGlobalVariables();
- theNode->m_Flags.SetDirty(wasDirty);
- memCopy(outTransform.m_Data, theNode->m_GlobalTransform.front(), sizeof(QT3DSMat44));
- } else {
- qCCritical(INVALID_OPERATION, "Calculate global transform called on invalide object");
- QT3DS_ASSERT(false);
- }
- }
-
- void SetLocalTransformMatrix(Q3DStudio::TElement *inElement,
- const Q3DStudio::RuntimeMatrix &inTransform) override
- {
- if (inElement == nullptr) {
- QT3DS_ASSERT(false);
- return;
- }
-
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement->GetAssociation());
- if (theTranslator && GraphObjectTypes::IsNodeType(theTranslator->GetUIPType())) {
- SNode *theNode = static_cast<SNode *>(&theTranslator->RenderObject());
- QT3DSMat44 transform;
- memCopy(transform.front(), inTransform.m_Data, sizeof(QT3DSMat44));
- theNode->SetLocalTransformFromMatrix(transform);
- theNode->MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- }
- }
-
- void EnsureNodeIsUpToDate(SNode &inNode, bool inIncludeChildren)
- {
- bool wasDirty = inNode.m_Flags.IsDirty();
- if (wasDirty) {
- inNode.CalculateGlobalVariables();
- inNode.m_Flags.SetDirty(wasDirty);
- if (inIncludeChildren) {
- for (SNode *theChild = inNode.m_FirstChild; theChild;
- theChild = theChild->m_NextSibling)
- EnsureNodeIsUpToDate(*theChild, inIncludeChildren);
- }
- }
- }
-
- NVBounds3 GetNodeLocalBoundingBox(Q3DStudio::TElement *inElement, bool inSelfOnly)
- {
- NVBounds3 retval(NVBounds3::empty());
- if (inElement == nullptr) {
- QT3DS_ASSERT(false);
- return retval;
- }
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement->GetAssociation());
- if (theTranslator && GraphObjectTypes::IsNodeType(theTranslator->GetUIPType())) {
- Update();
- TransferDirtyProperties();
- SNode *theNode = static_cast<SNode *>(&theTranslator->RenderObject());
- bool theIncludeChildren = !inSelfOnly;
- EnsureNodeIsUpToDate(*theNode, theIncludeChildren);
- IBufferManager &theBufferManager(m_Context->GetBufferManager());
- return theNode->GetBounds(theBufferManager, m_Context->GetPathManager(),
- theIncludeChildren);
- } else {
- qCCritical(INVALID_OPERATION, "GetBoundingBox called on invalid object");
- QT3DS_ASSERT(false);
- }
- return retval;
- }
-
- static void Assign(Q3DStudio::CBoundingBox &lhs, NVBounds3 &rhs)
- {
- lhs.m_Min.m_X = rhs.minimum.x;
- lhs.m_Min.m_Y = rhs.minimum.y;
- lhs.m_Min.m_Z = rhs.minimum.z;
-
- lhs.m_Max.m_X = rhs.maximum.x;
- lhs.m_Max.m_Y = rhs.maximum.y;
- lhs.m_Max.m_Z = rhs.maximum.z;
- }
-
- Q3DStudio::CBoundingBox GetBoundingBox(Q3DStudio::TElement *inElement, bool inSelfOnly) override
- {
- Q3DStudio::CBoundingBox retval;
- retval.SetEmpty();
- NVBounds3 theLocalBox = GetNodeLocalBoundingBox(inElement, inSelfOnly);
- if (theLocalBox.isEmpty() == false) {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement->GetAssociation());
- if (theTranslator && GraphObjectTypes::IsNodeType(theTranslator->GetUIPType())) {
- SNode *theNode = static_cast<SNode *>(&theTranslator->RenderObject());
- theLocalBox.transform(theNode->m_GlobalTransform);
- Assign(retval, theLocalBox);
- // Left handed nodes need to return values in their space, not in the global space
- // This is a hack fix due to a bug.
- if (theNode->m_Flags.IsLeftHanded()) {
- eastl::swap(retval.m_Min.m_Z, retval.m_Max.m_Z);
- retval.m_Min.m_Z *= -1;
- retval.m_Max.m_Z *= -1;
- }
- }
- }
- return retval;
- }
-
- Q3DStudio::CBoundingBox GetLocalBoundingBox(Q3DStudio::TElement *inElement,
- bool inSelfOnly) override
- {
- Q3DStudio::CBoundingBox retval;
- retval.SetEmpty();
- if (inElement == nullptr) {
- QT3DS_ASSERT(false);
- return retval;
- }
- NVBounds3 theLocalBounds = GetNodeLocalBoundingBox(inElement, inSelfOnly);
- if (theLocalBounds.isEmpty() == false)
- Assign(retval, theLocalBounds);
-
- return retval;
- }
-
- Q3DStudio::SCameraRect GetCameraBounds(Q3DStudio::TElement &inElem) override
- {
- Qt3DSTranslator *theTranslator = reinterpret_cast<Qt3DSTranslator *>(inElem.GetAssociation());
- if (theTranslator && theTranslator->m_RenderObject) {
- Option<qt3ds::render::SCuboidRect> theRectOpt =
- m_Context->GetRenderer().GetCameraBounds(*theTranslator->m_RenderObject);
- if (theRectOpt.hasValue()) {
- qt3ds::render::SCuboidRect theRect(*theRectOpt);
- return Q3DStudio::SCameraRect(theRect.m_Left, theRect.m_Top, theRect.m_Right,
- theRect.m_Bottom);
- }
- }
- return Q3DStudio::SCameraRect();
- }
-
- void PositionToScreen(Q3DStudio::TElement &inElement, QT3DSVec3 &inPos, QT3DSVec3 &outScreen) override
- {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement.GetAssociation());
- if (theTranslator && theTranslator->m_RenderObject) {
- SNode *theNode = reinterpret_cast<SNode *>(theTranslator->m_RenderObject);
- QT3DSVec3 thePos = theNode->m_GlobalTransform.transform(inPos);
- outScreen = m_Context->GetRenderer().ProjectPosition(*theNode, thePos);
- }
- }
-
- void ScreenToPosition(Q3DStudio::TElement &inElement, QT3DSVec3 &inScreen, QT3DSVec3 &outPos) override
- {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement.GetAssociation());
- if (theTranslator && theTranslator->m_RenderObject) {
- SNode *theNode = reinterpret_cast<SNode *>(theTranslator->m_RenderObject);
- QT3DSVec3 objPos = theNode->GetGlobalPos();
- outPos = m_Context->GetRenderer().UnprojectWithDepth(*(theNode), objPos, inScreen);
- }
- }
-
- static inline int wrapMod(int a, int base) { return (a >= 0) ? a % base : (a % base) + base; }
- static inline float fMin(float a, float b) { return (a < b) ? a : b; }
- static inline int iMax(int a, int b) { return (a > b) ? a : b; }
-
- static inline void getWrappedCoords(int &sX, int &sY, int width, int height)
- {
- if (sY < 0) {
- sX -= width >> 1;
- sY = -sY;
- }
- if (sY >= height) {
- sX += width >> 1;
- sY = height - sY;
- }
- sX = wrapMod(sX, width);
- sY = wrapMod(sY, height);
- }
-
- static void GenerateBsdfMipmaps(SImage *theImage, const unsigned char *inBuffer,
- Q3DStudio::INT32 inBufferLength, Q3DStudio::INT32 inWidth,
- Q3DStudio::INT32 inHeight,
- qt3ds::render::NVRenderTextureFormats::Enum inFormat,
- IQt3DSRenderContext *theContext)
- {
- NVRenderTextureFormats::Enum destFormat = qt3ds::render::NVRenderTextureFormats::RGBA16F;
-
- Qt3DSRenderPrefilterTexture *theBSDFMipMap = theImage->m_TextureData.m_BSDFMipMap;
- if (theBSDFMipMap == nullptr) {
- theBSDFMipMap = Qt3DSRenderPrefilterTexture::Create(
- &theContext->GetRenderContext(), inWidth, inHeight,
- *theImage->m_TextureData.m_Texture, destFormat, theContext->GetFoundation());
- theImage->m_TextureData.m_BSDFMipMap = theBSDFMipMap;
- }
-
- if (theBSDFMipMap)
- theBSDFMipMap->Build((void *)inBuffer, inBufferLength, inFormat);
- }
-
- // This could cause some significant drama.
- void SetTextureData(Q3DStudio::TElement *inElement, const unsigned char *inBuffer,
- Q3DStudio::INT32 inBufferLength, Q3DStudio::INT32 inWidth,
- Q3DStudio::INT32 inHeight,
- qt3ds::render::NVRenderTextureFormats::Enum inFormat,
- Q3DStudio::INT32 inHasTransparency) override
- {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement->GetAssociation());
- if (theTranslator && theTranslator->GetUIPType() == GraphObjectTypes::Image) {
- SImage *theImage = static_cast<SImage *>(&theTranslator->RenderObject());
- // Attempt to resolve the image's path
- if (!theImage->m_TextureData.m_Texture) {
- if (theImage->m_ImagePath.IsValid())
- theImage->m_TextureData = m_Context->GetBufferManager().LoadRenderImage(
- theImage->m_ImagePath, false,
- theImage->m_MappingMode == ImageMappingModes::LightProbe);
- }
- // Here we go, updating the texture.
- if (theImage->m_TextureData.m_Texture) {
-
- if (theImage->m_MappingMode == ImageMappingModes::LightProbe) {
- // theImage->m_TextureData.m_Texture->GenerateMipmaps();
- GenerateBsdfMipmaps(theImage, inBuffer, inBufferLength, inWidth, inHeight,
- inFormat, m_Context);
- } else
- theImage->m_TextureData.m_Texture->SetTextureData(
- NVDataRef<QT3DSU8>((QT3DSU8 *)inBuffer, (QT3DSU32)inBufferLength), 0, inWidth,
- inHeight, inFormat);
-
- if (inHasTransparency >= 0) {
- bool hasTransparency = inHasTransparency ? true : false;
- theImage->m_TextureData.m_TextureFlags.SetHasTransparency(hasTransparency);
- m_Context->GetBufferManager().SetImageHasTransparency(theImage->m_ImagePath,
- hasTransparency);
- }
- theImage->m_Flags.SetDirty(true);
- }
- } else {
- qCCritical(INVALID_OPERATION, "SetTextureData called on object that is not an image");
- QT3DS_ASSERT(false);
- }
- }
-
- bool CreateOrSetMeshData(const char *inPathStr, unsigned char *vertData,
- unsigned int numVerts, unsigned int vertStride,
- unsigned int *indexData, unsigned int numIndices,
- qt3ds::NVBounds3 &objBounds) override
- {
- SRenderMesh *theMesh = nullptr;
-
- if (inPathStr && vertData && indexData) {
- theMesh = m_Context->GetBufferManager().CreateMesh(
- inPathStr, vertData, numVerts, vertStride, indexData, numIndices, objBounds);
- } else {
- qCCritical(INVALID_OPERATION,
- "CreateOrSetMeshData was not supplied necessary buffers or object path");
- }
-
- return (theMesh != nullptr);
- }
-
- Q3DStudio::STextSizes MeasureText(Q3DStudio::TElement *inElement, const char *inTextStr) override
- {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inElement->GetAssociation());
- Q3DStudio::STextSizes retval;
- if (theTranslator && theTranslator->GetUIPType() == GraphObjectTypes::Text) {
- if (inElement->IsDirty()) {
- theTranslator->OnElementChanged(*m_Presentation, *m_Context,
- *m_RuntimePresentation);
- }
- SText *theText = static_cast<SText *>(&theTranslator->RenderObject());
- if (theText) {
-
- STextDimensions theDimensions =
- m_Context->GetTextRenderer()->MeasureText(*theText, 1.0f, inTextStr);
-
- retval = Q3DStudio::STextSizes((Q3DStudio::INT32)theDimensions.m_TextWidth,
- (Q3DStudio::INT32)theDimensions.m_TextHeight);
- }
- } else {
- qCCritical(INVALID_OPERATION, "MeasureText called on object that is not text");
- QT3DS_ASSERT(false);
-
- }
- return retval;
- }
-
- Q3DStudio::STextSizes GetPresentationDesignDimensions() override
- {
- if (m_Presentation) {
- return Q3DStudio::STextSizes(
- static_cast<Q3DStudio::INT32>(m_Presentation->m_PresentationDimensions.x),
- static_cast<Q3DStudio::INT32>(m_Presentation->m_PresentationDimensions.y));
- }
- QT3DS_ASSERT(false);
- return Q3DStudio::STextSizes();
- }
-
- virtual Q3DStudio::SMousePosition
- WindowToPresentation(const Q3DStudio::SMousePosition &inWindowCoords) override
- {
- // If there aren't any rotations, then account for the difference in width/height of the
- // presentation and the window
- QT3DSVec2 theCoords = m_Context->GetMousePickMouseCoords(
- QT3DSVec2((QT3DSF32)inWindowCoords.m_X, (QT3DSF32)inWindowCoords.m_Y));
- theCoords.x -= m_LastRenderViewport.m_X;
- // Note that the mouse Y is reversed. Thus a positive offset of the viewport will reduce
- // the mouse value.
- theCoords.y -= m_LastRenderViewport.m_Y;
- return Q3DStudio::SMousePosition(theCoords.x, theCoords.y);
- }
-
- qt3ds::foundation::CRegisteredString RegisterStr(const char *inStr) override
- {
- return m_Context->GetStringTable().RegisterStr(inStr);
- }
-
- Q3DStudio::INT32 LoadImageBatch(qt3ds::foundation::CRegisteredString *inFullPaths,
- Q3DStudio::INT32 inNumPaths,
- qt3ds::foundation::CRegisteredString inDefaultImage,
- qt3ds::render::IImageLoadListener *inLoadCallback) override
- {
- return static_cast<Q3DStudio::INT32>(m_Context->GetImageBatchLoader().LoadImageBatch(
- toConstDataRef(inFullPaths, (QT3DSU32)inNumPaths), inDefaultImage, inLoadCallback,
- m_Context->GetRenderContext().GetRenderContextType(), m_Presentation->m_preferKTX));
- }
-
- void RegisterOffscreenRenderer(const char *inKey) override
- {
- m_OffscreenRenderer = QT3DS_NEW(m_Context->GetAllocator(), Qt3DSRenderSceneSubPresRenderer)(
- *this, *m_Context, *m_Presentation);
- m_OffscreenRendererId = m_Context->GetStringTable().RegisterStr(inKey);
- m_Context->GetOffscreenRenderManager().RegisterOffscreenRenderer(m_OffscreenRendererId,
- *m_OffscreenRenderer);
- }
-
- template <typename T, typename C>
- void forAllObjects(nvvector<SGraphObject *> &vec, GraphObjectTypes::Enum type, C callable)
- {
- nvvector<SGraphObject *>::iterator it = vec.begin();
- nvvector<SGraphObject *>::iterator end = vec.end();
- while (it != end) {
- if ((*it)->m_Type == type)
- callable(static_cast<T*>(*it));
- ++it;
- }
- }
-
- void PostLoadStep()
- {
- IBufferManager &mgr = m_Context->GetBufferManager();
- forAllObjects<SImage>(m_GraphObjectList, GraphObjectTypes::Image, [&mgr](SImage *image){
- if (image->m_ImagePath.IsValid() && qt3ds::runtime::isImagePath(
- image->m_ImagePath.c_str())) {
- image->m_LoadedTextureData = mgr.CreateReloadableImage(image->m_ImagePath,
- false, false);
- image->m_LoadedTextureData->m_callbacks.push_back(image);
- }
- });
- }
-
- void Release() override { NVDelete(m_Context->GetAllocator(), this); }
-};
-
-SOffscreenRenderFlags
-Qt3DSRenderSceneSubPresRenderer::NeedsRender(const SOffscreenRendererEnvironment &inEnvironment,
- QT3DSVec2 inPresScale,
- const SRenderInstanceId instanceId)
-{
- m_Scene.TransferDirtyProperties();
- return CSubPresentationRenderer::NeedsRender(inEnvironment, inPresScale, instanceId);
-}
-
-void Qt3DSRenderSceneSubPresRenderer::Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext,
- QT3DSVec2 inPresScale,
- SScene::RenderClearCommand inClearBuffer,
- const SRenderInstanceId instanceId)
-{
- CSubPresentationRenderer::Render(inEnvironment, inRenderContext, inPresScale, inClearBuffer,
- instanceId);
-}
-
-void Qt3DSRenderSceneSubPresRenderer::RenderWithClear(
- const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresScale,
- SScene::RenderClearCommand inClearBuffer, QT3DSVec4 inClearColor,
- const SRenderInstanceId id)
-{
- CSubPresentationRenderer::RenderWithClear(inEnvironment, inRenderContext,
- inPresScale, inClearBuffer,
- inClearColor, id);
-}
-
-//////////////////////////////////////////////////////////////////
-// Scene Manager
-//////////////////////////////////////////////////////////////////
-
-struct Qt3DSRenderSceneManager : public Q3DStudio::ISceneManager,
- public Q3DStudio::ISceneBinaryLoader
-{
- typedef nvhash_map<CRegisteredString, bool> TStrBoolMap;
-
- NVScopedRefCounted<SBindingCore> m_Context;
- nvvector<pair<Q3DStudio::IPresentation *, Qt3DSRenderScene *>> m_Scenes;
- nvvector<pair<qt3ds::foundation::CRegisteredString, long>> m_RenderPlugins;
- Q3DStudio::INT32 m_ViewWidth;
- Q3DStudio::INT32 m_ViewHeight;
- Q3DStudio::SPickFrame m_PickFrame;
- NVDataRef<QT3DSU8> m_StrTableData;
- // The boolean is to mark transparent images
- nvvector<eastl::pair<CRegisteredString, bool>> m_SourcePaths;
- eastl::hash_set<CRegisteredString> m_SourcePathSet;
-
- Qt3DSRenderScene *m_LastRenderedScene;
- Q3DStudio::IWindowSystem &m_WindowSystem;
- Mutex m_LoadingScenesMutex;
- eastl::vector<NVScopedRefCounted<SSceneLoadData>> m_LoadingScenes;
- CRegisteredString m_ProjectDir;
- CRegisteredString m_BinaryDir;
- bool m_ProjectInitialized;
- QT3DSI32 mRefCount;
-
- Qt3DSRenderSceneManager(SBindingCore &ctx, Q3DStudio::IWindowSystem &inWindowSystem)
- : m_Context(ctx)
- , m_Scenes(ctx.GetAllocator(), "Qt3DSRenderSceneManager::m_Scenes")
- , m_RenderPlugins(ctx.GetAllocator(), "Qt3DSRenderSceneManager::m_RenderPlugins")
- , m_ViewWidth(0)
- , m_ViewHeight(0)
- , m_SourcePaths(ctx.GetAllocator(), "Qt3DSRenderSceneManager::m_SourcePaths")
- , m_LastRenderedScene(nullptr)
- , m_WindowSystem(inWindowSystem)
- , m_LoadingScenesMutex(ctx.GetAllocator())
- , m_ProjectInitialized(false)
- , mRefCount(0)
- {
- memZero(&m_PickFrame, sizeof(m_PickFrame));
- }
- virtual ~Qt3DSRenderSceneManager()
- {
- for (QT3DSU32 idx = 0, end = m_Scenes.size(); idx < end; ++idx)
- m_Scenes[idx].second->Release();
- m_Scenes.clear();
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Context->GetAllocator())
-
- static QT3DSU32 GetFileTag()
- {
- const char *fileTag = "Qt3DSS";
- const QT3DSU32 *theTagPtr = reinterpret_cast<const QT3DSU32 *>(fileTag);
- return *theTagPtr;
- }
-
- static bool IsMesh(const char *ending)
- {
- if (!ending)
- return false;
- return stricmp(ending, "mesh") == 0;
- }
-
- void FinalizeScene(Q3DStudio::IPresentation &inPresentation, Qt3DSRenderScene &inScene)
- {
- inPresentation.SetScene(&inScene);
- if (m_ProjectInitialized == false) {
- m_ProjectInitialized = true;
- // For QT3DS-3353 assume project fonts are in a subdirectory relative to presentation.
- QString projectFontDir = inPresentation.getProjectPath() + QStringLiteral("/fonts");
- if (m_Context->m_Context->GetTextRenderer()) {
- m_Context->m_Context->GetTextRenderer()->AddProjectFontDirectory(
- projectFontDir.toUtf8().data());
- }
- if (m_Context->m_Context->getDistanceFieldRenderer()) {
- m_Context->m_Context->getDistanceFieldRenderer()->AddProjectFontDirectory(
- projectFontDir.toUtf8().data());
- }
- eastl::string theBinaryPath(inPresentation.GetFilePath().toLatin1().constData());
- qt3ds::foundation::CFileTools::AppendDirectoryInPathToFile(theBinaryPath, "binary");
- eastl::string theBinaryDir(theBinaryPath);
- qt3ds::foundation::CFileTools::GetDirectory(theBinaryDir);
- if (m_Context->m_WriteOutShaderCache)
- qt3ds::foundation::CFileTools::CreateDir(theBinaryDir.c_str());
- }
- inScene.m_RuntimePresentation = &inPresentation;
- m_Scenes.push_back(make_pair(&inPresentation, &inScene));
- Qt3DSTranslator::AssignUserData(inPresentation, *inScene.m_Presentation);
- }
-
- static const char *GetBinaryExtension() { return "uibsg"; }
-
- struct SPluginInstanceTableProvider : public Q3DStudio::IScriptTableProvider
- {
- IRenderPluginInstance &m_Instance;
- SPluginInstanceTableProvider(IRenderPluginInstance &ins)
- : m_Instance(ins)
- {
- }
- void CreateTable(script_State *inState) override { m_Instance.CreateScriptProxy(inState); }
- };
-
- void InitializeTranslator(Qt3DSTranslator &inTranslator, Q3DStudio::IScriptBridge &inBridge)
- {
- if (inTranslator.m_RenderObject->m_Type == GraphObjectTypes::RenderPlugin) {
- SRenderPlugin &theRenderPlugin =
- static_cast<SRenderPlugin &>(*inTranslator.m_RenderObject);
- IRenderPluginInstance *thePluginInstance =
- m_Context->m_Context->GetRenderPluginManager().GetOrCreateRenderPluginInstance(
- theRenderPlugin.m_PluginPath, &theRenderPlugin);
- if (thePluginInstance) {
- SPluginInstanceTableProvider theProvider(*thePluginInstance);
- inBridge.SetTableForElement(*inTranslator.m_Element, theProvider);
- }
- }
- }
-
- struct SResolver : public qt3ds::render::IUIPReferenceResolver
- {
- IStringTable &m_StringTable;
- Q3DStudio::IUIPParser &m_Parser;
- SResolver(IStringTable &strt, Q3DStudio::IUIPParser &p)
- : m_StringTable(strt)
- , m_Parser(p)
- {
- }
-
- CRegisteredString ResolveReference(CRegisteredString inStart,
- const char *inReference) override
- {
- eastl::string theResolvedId = m_Parser.ResolveReference(inStart, inReference);
- if (theResolvedId.size())
- return m_StringTable.RegisterStr(theResolvedId.c_str());
- return CRegisteredString();
- }
- };
-
- Q3DStudio::IScene *LoadScene(Q3DStudio::IPresentation *inPresentation,
- Q3DStudio::IUIPParser *inParser,
- Q3DStudio::IScriptBridge &inBridge,
- const qt3ds::Q3DSVariantConfig &variantConfig) override
- {
- // We have to initialize the tags late so that we can load flow data before adding anything
- // to the string table.
- Qt3DSTranslator::InitializePointerTags(m_Context->m_RenderContext->GetStringTable());
- NVScopedRefCounted<SSceneLoadData> theScene =
- QT3DS_NEW(m_Context->GetAllocator(), SSceneLoadData)(m_Context->GetAllocator());
- Qt3DSRenderScene *theIScene = nullptr;
- if (inParser) {
- QString thePath(inPresentation->GetFilePath());
- QFileInfo fileInfo(thePath);
- TIdObjectMap theObjMap(m_Context->GetAllocator(), "LoadScene::theObjMap");
- SResolver theResolver(m_Context->m_CoreContext->GetStringTable(), *inParser);
-
- theScene->m_Presentation = IUIPLoader::LoadUIPFile(
- inParser->GetDOMReader(),
- fileInfo.absoluteFilePath().toLatin1().constData(),
- inParser->GetMetaData(),
- m_Context->m_CoreContext->GetStringTable(),
- m_Context->m_RenderContext->GetFoundation(),
- theScene->m_AutoAllocator, theObjMap,
- m_Context->m_Context->GetBufferManager(),
- m_Context->m_Context->GetEffectSystem(),
- fileInfo.path().toLatin1().constData(),
- m_Context->m_Context->GetRenderPluginManager(),
- m_Context->m_Context->GetCustomMaterialSystem(),
- m_Context->m_Context->GetDynamicObjectSystem(),
- m_Context->m_Context->GetPathManager(), &theResolver,
- variantConfig, false);
- if (!theScene->m_Presentation) {
- QT3DS_ASSERT(false);
- return nullptr;
- }
-
- NVConstDataRef<eastl::string> theSourcePathData(inParser->GetSourcePaths());
- const QVector<QString> slideSourcePaths = inParser->GetSlideSourcePaths();
- IBufferManager &theManager(m_Context->m_Context->GetBufferManager());
- // List of image paths to be loaded in parallel at the end.
- eastl::vector<CRegisteredString> theSourcePathList;
- for (QT3DSU32 idx = 0, end = theSourcePathData.size(); idx < end; ++idx) {
- const eastl::string &theValue = theSourcePathData[idx];
- CRegisteredString theSourcePath =
- m_Context->m_CoreContext->GetStringTable().RegisterStr(theValue.c_str());
- size_t theValueSize = theValue.size();
- if (theValueSize > 3) {
- CRegisteredString theObjectPath = theSourcePath;
- if (qt3ds::runtime::isImagePath(theValue.c_str())) {
- // load only images not on any slide
- if (!theManager.isReloadableResourcesEnabled() ||
- !slideSourcePaths.contains(QString::fromLatin1(theValue.c_str()))) {
- theManager.SetImageTransparencyToFalseIfNotSet(theObjectPath);
- if (m_SourcePathSet.insert(theSourcePath).second) {
- m_SourcePaths.push_back(eastl::make_pair(theSourcePath,
- theManager.GetImageHasTransparency(theObjectPath)));
- }
- theSourcePathList.push_back(theObjectPath);
- }
- } else if (theValue.find(".mesh") != eastl::string::npos) {
- theManager.LoadMesh(theObjectPath);
- }
- }
- }
-
- // Fire off parallel loading of the source paths
- QT3DSU64 imageBatchId = m_Context->m_Context->GetImageBatchLoader().LoadImageBatch(
- toConstDataRef(theSourcePathList.data(), theSourcePathList.size()),
- CRegisteredString(), nullptr, m_Context->m_Context->GetRenderContext()
- .GetRenderContextType(),
- theScene->m_Presentation->m_preferKTX);
- m_Context->m_Context->GetImageBatchLoader().BlockUntilLoaded(
- static_cast<TImageBatchId>(imageBatchId));
-
- theIScene = QT3DS_NEW(m_Context->GetAllocator(),
- Qt3DSRenderScene)(*m_Context, *m_Context->m_Context, *theScene);
- // Now we need to associate the presentation with everything else.
- NVAllocatorCallback &translatorAllocator = theScene->m_AutoAllocator;
- for (TIdObjectMap::iterator iter = theObjMap.begin(), end = theObjMap.end();
- iter != end; ++iter) {
- theIScene->m_GraphObjectList.push_back(iter->second);
- Q3DStudio::SElementAndType theElement =
- inParser->GetElementForID(iter->first.c_str());
- if (theElement.m_Element
- && theElement.m_Type != Q3DStudio::UIPElementTypes::Unknown) {
- Qt3DSTranslator *theTranslator = Qt3DSTranslator::CreateTranslatorForElement(
- *theElement.m_Element, *iter->second, translatorAllocator);
- if (theTranslator) {
- theIScene->m_DirtySet.insert(*theTranslator);
- InitializeTranslator(*theTranslator, inBridge);
- }
- }
- }
- theIScene->PostLoadStep();
- } else {
- // Binary load path is quite different than normal load path and
- // nothing else will load here.
- QT3DS_ASSERT(false);
- }
- if (inPresentation && theIScene)
- FinalizeScene(*inPresentation, *theIScene);
- return theIScene;
- }
-
- // threadsafe
- // Can be called from any thread
- bool GetBinaryLoadFileName(eastl::string &inPresentationFilename,
- eastl::string &outResult) override
- {
- eastl::string theBinaryPath(inPresentationFilename.c_str());
- qt3ds::foundation::CFileTools::AppendDirectoryInPathToFile(theBinaryPath, "binary");
- qt3ds::foundation::CFileTools::SetExtension(
- theBinaryPath, GetBinaryExtension()); // uibb: short for ui binary binding
- outResult = theBinaryPath;
- return true;
- }
-
- // threadsafe
- // returns a handle to the loaded object. Return value of zero means error.
- qt3ds::QT3DSU32 LoadSceneStage1(CRegisteredString inPresentationDirectory,
- qt3ds::render::ILoadedBuffer &inData) override
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load Scene Graph Stage 1");
- NVDataRef<QT3DSU8> theLoadedData(inData.Data());
- SDataReader theReader(theLoadedData.begin(), theLoadedData.end());
-
- QT3DSU32 theFileSig = theReader.LoadRef<QT3DSU32>();
- QT3DSU32 theBinaryVersion = theReader.LoadRef<QT3DSU32>();
- QT3DSU32 theDataSectionSize = (QT3DSU32)(theReader.m_EndPtr - theReader.m_CurrentPtr);
-
- if (theFileSig != GetFileTag()
- || theBinaryVersion != SGraphObject::GetSceneGraphBinaryVersion()) {
- QT3DS_ASSERT(false);
- return 0;
- }
- QT3DSU32 theLoadingSceneIndex = 0;
- SSceneLoadData *theScene;
- {
- Mutex::ScopedLock __locker(m_LoadingScenesMutex);
- theLoadingSceneIndex = (QT3DSU32)m_LoadingScenes.size() + 1;
- m_LoadingScenes.push_back(
- QT3DS_NEW(m_Context->GetAllocator(), SSceneLoadData)(m_Context->GetAllocator()));
- theScene = m_LoadingScenes.back();
- }
- // preserve the data buffer because we run directly from it; there isn't a memcopy.
- theScene->m_Data = inData;
-
- QT3DSU32 theTranslatorOffset = theReader.LoadRef<QT3DSU32>();
-
- NVDataRef<QT3DSU8> theSGData = NVDataRef<QT3DSU8>(theReader.m_CurrentPtr, theTranslatorOffset);
- NVDataRef<QT3DSU8> theTranslatorData = NVDataRef<QT3DSU8>(
- theReader.m_CurrentPtr + theTranslatorOffset, theDataSectionSize - theTranslatorOffset);
-
- CStrTableOrDataRef theStrTableData(m_Context->m_CoreContext->GetStringTable());
- if (m_StrTableData.size())
- theStrTableData = CStrTableOrDataRef(m_StrTableData);
-
- theScene->m_Presentation = SGraphObjectSerializer::Load(
- theSGData, m_StrTableData, m_Context->m_CoreContext->GetDynamicObjectSystemCore(),
- m_Context->m_CoreContext->GetPathManagerCore(), m_Context->GetAllocator(),
- inPresentationDirectory);
- if (theScene->m_Presentation)
- theScene->m_Presentation->m_PresentationDirectory = inPresentationDirectory;
-
- theScene->m_TranslatorData = theTranslatorData;
- theScene->m_SceneGraphData = theSGData;
-
- {
- Mutex::ScopedLock __locker(m_LoadingScenesMutex);
- m_LoadingScenes[theLoadingSceneIndex - 1] = theScene;
- }
- return theLoadingSceneIndex;
- }
-
- // threadsafe
- // still does not require openGL context but has dependency on a few other things.
- void LoadSceneStage2(qt3ds::QT3DSU32 inSceneHandle, Q3DStudio::IPresentation &inPresentation,
- size_t inElementMemoryOffset, Q3DStudio::IScriptBridge &inBridge) override
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load Scene Graph Stage 2");
- QT3DSU32 theSceneIndex = QT3DS_MAX_U32;
- SSceneLoadData *theScene;
- {
- Mutex::ScopedLock __locker(m_LoadingScenesMutex);
- QT3DSU32 numLoadingScenes = (QT3DSU32)m_LoadingScenes.size();
- if (inSceneHandle && inSceneHandle <= numLoadingScenes) {
- theSceneIndex = inSceneHandle - 1;
- theScene = m_LoadingScenes[theSceneIndex];
- } else {
- QT3DS_ASSERT(false);
- return;
- }
- }
- SDataReader theReader(theScene->m_TranslatorData.begin(), theScene->m_TranslatorData.end());
- QT3DSU32 theNumTranslators = theReader.LoadRef<QT3DSU32>();
- theScene->m_Translators.resize(theNumTranslators);
- theScene->m_RuntimePresentation = &inPresentation;
- for (QT3DSU32 idx = 0, end = theNumTranslators; idx < end; ++idx) {
- Qt3DSTranslator *theTranslator = Qt3DSTranslator::LoadTranslator(
- theReader, inElementMemoryOffset, theScene->m_SceneGraphData,
- theScene->m_AutoAllocator);
- if (theTranslator) {
- InitializeTranslator(*theTranslator, inBridge);
- }
- theScene->m_Translators[idx] = theTranslator;
- }
- }
-
- void OnGraphicsInitialized()
- {
- QT3DS_ASSERT(m_Context->m_Context.mPtr);
- // this means graphics have been initialized
- eastl::string theSourcePathStr;
- IBufferManager &theManager(m_Context->m_Context->GetBufferManager());
- nvvector<CRegisteredString> theSourcePathList(m_Context->GetAllocator(),
- "TempSourcePathList");
- for (QT3DSU32 idx = 0, end = m_SourcePaths.size(); idx < end; ++idx) {
- theSourcePathStr.assign(m_SourcePaths[idx].first);
- bool hasTransparency = m_SourcePaths[idx].second;
- if (theSourcePathStr.size() > 4) {
- CRegisteredString theObjectPath = m_SourcePaths[idx].first;
- if (qt3ds::runtime::isImagePath(theSourcePathStr.c_str())) {
- theManager.SetImageHasTransparency(theObjectPath, hasTransparency);
- theSourcePathList.push_back(theObjectPath);
- } else {
- if (theSourcePathStr.find(".mesh") != eastl::string::npos)
- theManager.LoadMesh(theObjectPath);
- }
- }
- }
-
- bool pktx = false;
- for (int i = 0; i < m_Scenes.size(); ++i) {
- if (m_Scenes[i].second->m_Presentation->m_preferKTX) {
- pktx = true;
- break;
- }
- }
-
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Initial Batch Image Load");
-
- m_Context->m_Context->GetImageBatchLoader().LoadImageBatch(
- toConstDataRef(theSourcePathList.data(), theSourcePathList.size()),
- CRegisteredString(), nullptr, m_Context->m_Context->GetRenderContext()
- .GetRenderContextType(), pktx);
- }
-
- {
-
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Initialize Scenes");
- for (QT3DSU32 idx = 0, end = m_LoadingScenes.size(); idx < end; ++idx) {
- SSceneLoadData &theScene = *m_LoadingScenes[idx];
- // m_Context->m_Foundation->error( QT3DS_WARN, "Finalizing scene %d", (int)idx+1 );
- if (theScene.m_RuntimePresentation) {
- Qt3DSRenderScene *theIScene = QT3DS_NEW(m_Context->GetAllocator(), Qt3DSRenderScene)(
- *m_Context, *m_Context->m_Context, theScene);
- FinalizeScene(*theScene.m_RuntimePresentation, *theIScene);
- theIScene->PostLoadStep();
- } else {
- qCWarning(WARNING, "Failed to finalize scene %d", (int)idx + 1);
- }
- }
- }
- }
-
- void LoadRenderPlugin(const char *inAssetIDString, const char *inPath,
- const char *inArgs) override
- {
- Q3DStudio::CDLLManager &theDLLManager = Q3DStudio::CDLLManager::GetDLLManager();
- long theHandle = theDLLManager.LoadLibrary(inPath, EDLLTYPE_RENDERABLE_PLUGIN);
- if (theHandle >= 0) {
- qt3ds::render::IOffscreenRenderer *theOffscreenRenderer =
- QT3DS_NEW(m_Context->GetAllocator(),
- qt3ds::render::COldNBustedPluginRenderer)(*m_Context->m_Context, theHandle);
- qt3ds::foundation::CRegisteredString theAssetString =
- m_Context->m_CoreContext->GetStringTable().RegisterStr(inAssetIDString);
-
- m_Context->m_Context->GetOffscreenRenderManager().RegisterOffscreenRenderer(
- theAssetString, *theOffscreenRenderer);
-
- PROC_Initialize theInitializeProc =
- reinterpret_cast<PROC_Initialize>(theDLLManager.GetProc("Initialize", theHandle));
- Q3DStudio_ASSERT(theInitializeProc);
-#if !defined (Q_OS_MACOS)
- PROC_SetEGLInfo theSetEGLInfoProc =
- reinterpret_cast<PROC_SetEGLInfo>(theDLLManager.GetProc("SetEGLInfo", theHandle));
- // Set EGL parameters used for optional context creation
- if (theSetEGLInfoProc) {
- Q3DStudio::SEGLInfo *theInfo = m_WindowSystem.GetEGLInfo();
- if (theInfo)
- theSetEGLInfoProc(theInfo->display, theInfo->context, theInfo->surface,
- theInfo->config);
- }
-#endif
- if (theInitializeProc && theInitializeProc(inArgs) == EDLLSTATUS_OK)
- m_RenderPlugins.push_back(make_pair(theAssetString, theHandle));
- else
- qCWarning(qt3ds::INVALID_OPERATION) << "Unable to load plugin " << inAssetIDString;
- } else
- qCWarning(qt3ds::INVALID_OPERATION) << "Unable to load plugin " << inAssetIDString;
-
- return;
- }
-
- void LoadQmlStreamerPlugin(const char *inAssetIDString) override
- {
- qt3ds::render::IOffscreenRenderer *theOffscreenRenderer =
- QT3DS_NEW(m_Context->GetAllocator(),
- Q3DSQmlRender)(*m_Context->m_Context, inAssetIDString);
- if (theOffscreenRenderer) {
- qt3ds::foundation::CRegisteredString theAssetString =
- m_Context->m_CoreContext->GetStringTable().RegisterStr(inAssetIDString);
- m_Context->m_Context->GetOffscreenRenderManager().RegisterOffscreenRenderer(
- SOffscreenRendererKey(theAssetString), *theOffscreenRenderer);
-
- m_RenderPlugins.push_back(make_pair(theAssetString, 0));
- }
- }
-
- void BinarySave(Q3DStudio::IScene &inScene) override
- {
- Qt3DSRenderScene &theScene = static_cast<Qt3DSRenderScene &>(inScene);
- qt3ds::render::SWriteBuffer theWriteBuffer(m_Context->GetAllocator(), "BinarySaveBuffer");
- qt3ds::render::SPtrOffsetMap theSGOffsetMap(m_Context->GetAllocator(), "PointerOffsetMap");
- // Start with some versioning and sanity checks.
- theWriteBuffer.write(GetFileTag());
- theWriteBuffer.write(SGraphObject::GetSceneGraphBinaryVersion());
- QT3DSU32 theTranslatorOffsetAddress = theWriteBuffer.size();
- // Now the data section starts. Offsets should be relative to here, not the first
- // 8 bytes.
- theWriteBuffer.writeZeros(4); // offset where the translator data starts;
- QT3DSU32 theDataSectionStart = theWriteBuffer.size();
-
- // These offsets are after we have read in the data section
- SGraphObjectSerializer::Save(
- m_Context->m_RenderContext->GetFoundation(), *theScene.m_Presentation, theWriteBuffer,
- m_Context->m_Context->GetDynamicObjectSystem(),
- m_Context->m_Context->GetPathManager(), theSGOffsetMap,
- m_Context->m_CoreContext->GetStringTable(), theScene.m_GraphObjectList);
-
- theWriteBuffer.align(sizeof(void *));
- QT3DSU32 theTranslatorCountAddress = theWriteBuffer.size();
- QT3DSU32 theTranslatorOffset = theTranslatorCountAddress - theDataSectionStart;
-
- theWriteBuffer.writeZeros(4);
- // Now write out the translators verbatim. We get an adjustment parameter on save that
- // allows a translation
- // from old element ptr->new element ptr.
- QT3DSU32 theTranslatorCount = 0;
- for (QT3DSU32 idx = 0, end = theScene.m_GraphObjectList.size(); idx < end; ++idx) {
- Qt3DSTranslator *theTranslator =
- Qt3DSTranslator::GetTranslatorFromGraphNode(*theScene.m_GraphObjectList[idx]);
- // Presentation nodes don't have translator
- if (theTranslator) {
- qt3ds::render::SPtrOffsetMap::iterator theIter =
- theSGOffsetMap.find(theScene.m_GraphObjectList[idx]);
- if (theIter != theSGOffsetMap.end()) {
- QT3DSU32 theOffset = theIter->second;
- theTranslator->Save(theWriteBuffer, theOffset);
- ++theTranslatorCount;
- } else {
- QT3DS_ASSERT(false);
- }
- }
- }
- QT3DSU32 *theTranslatorCountPtr =
- reinterpret_cast<QT3DSU32 *>(theWriteBuffer.begin() + theTranslatorCountAddress);
- *theTranslatorCountPtr = theTranslatorCount;
- QT3DSU32 *theTranslatorOffsetPtr =
- reinterpret_cast<QT3DSU32 *>(theWriteBuffer.begin() + theTranslatorOffsetAddress);
- *theTranslatorOffsetPtr = theTranslatorOffset;
-
- Q3DStudio::IPresentation &thePresentation = *theScene.m_RuntimePresentation;
- eastl::string theBinaryPath(thePresentation.GetFilePath().toLatin1().constData());
- qt3ds::foundation::CFileTools::AppendDirectoryInPathToFile(theBinaryPath, "binary");
- eastl::string theBinaryDir(theBinaryPath);
- qt3ds::foundation::CFileTools::GetDirectory(theBinaryDir);
- qt3ds::foundation::CFileTools::SetExtension(
- theBinaryPath, GetBinaryExtension()); // uibb: short for ui binary binding
-
- Q3DStudio::CFileStream theStream(theBinaryPath.c_str(), "wb");
- if (theStream.IsOpen() == false) {
- QT3DS_ASSERT(false);
- }
-
- theStream.WriteRaw(theWriteBuffer.begin(), theWriteBuffer.size());
- theStream.Close();
- }
-
- // We save in the reverse order that we load because the effect system may add strings
- // to the string table when it is writing its data out, this the string table needs to come
- // last.
- // Loading, obviously, the string table needs to be the first object loaded.
- void BinarySaveManagerData(qt3ds::foundation::IOutStream &inStream,
- const char *inBinaryDir) override
- {
- qt3ds::render::SWriteBuffer theWriteBuffer(m_Context->GetAllocator(), "BinarySaveBuffer");
- IStringTable &theStrTable = m_Context->m_CoreContext->GetStringTable();
- eastl::string theProjectDir(inBinaryDir);
- qt3ds::foundation::CFileTools::GetDirectory(theProjectDir);
-
- // We save everything before the string table because often times saving something creates
- // new strings.
- theWriteBuffer.writeZeros(4); // Total data size
- // Dynamic object system
- theWriteBuffer.writeZeros(4); // Effect system offset
- // effect system
- theWriteBuffer.writeZeros(4); // Material system offset
- // material system
- theWriteBuffer.writeZeros(4); // Binary path offset
- // binary path data
- theWriteBuffer.writeZeros(4); // Plugin manager offset
- // plugin manager
- theWriteBuffer.writeZeros(4); // String system offset
- // string system last.
- QT3DSU32 theOffsetStart = theWriteBuffer.size();
- m_Context->m_Context->GetDynamicObjectSystem().Save(
- theWriteBuffer, theStrTable.GetRemapMap(), theProjectDir.c_str());
- theWriteBuffer.align(sizeof(void *));
- QT3DSU32 theEffectSystemOffset = theWriteBuffer.size() - theOffsetStart;
- m_Context->m_Context->GetEffectSystem().Save(theWriteBuffer, theStrTable.GetRemapMap(),
- theProjectDir.c_str());
- theWriteBuffer.align(sizeof(void *));
- QT3DSU32 theMaterialSystemOffset = theWriteBuffer.size() - theOffsetStart;
- m_Context->m_Context->GetCustomMaterialSystem().Save(
- theWriteBuffer, theStrTable.GetRemapMap(), theProjectDir.c_str());
- QT3DSU32 theBinaryPathOffset = theWriteBuffer.size() - theOffsetStart;
-
- theWriteBuffer.write((QT3DSU32)m_SourcePaths.size());
- for (nvvector<pair<CRegisteredString, bool>>::iterator iter = m_SourcePaths.begin(),
- end = m_SourcePaths.end();
- iter != end; ++iter) {
- CRegisteredString theStr(iter->first);
- theStr.Remap(theStrTable.GetRemapMap());
- theWriteBuffer.write((size_t)theStr.c_str());
- QT3DSU32 theSourcePathFlags = iter->second ? 1 : 0;
- theWriteBuffer.write(theSourcePathFlags);
- }
-
- QT3DSU32 thePluginManagerOffset = theWriteBuffer.size() - theOffsetStart;
-
- m_Context->m_Context->GetRenderPluginManager().Save(
- theWriteBuffer, theStrTable.GetRemapMap(), theProjectDir.c_str());
-
- QT3DSU32 theStringTableOffset = theWriteBuffer.size() - theOffsetStart;
-
- theStrTable.Save(theWriteBuffer);
-
- QT3DSU32 *theSizePtr = reinterpret_cast<QT3DSU32 *>(theWriteBuffer.begin());
-
- theSizePtr[0] = theWriteBuffer.size() - 4; // overall size
- theSizePtr[1] = theEffectSystemOffset;
- theSizePtr[2] = theMaterialSystemOffset;
- theSizePtr[3] = theBinaryPathOffset; // thePathOffset
- theSizePtr[4] = thePluginManagerOffset;
- theSizePtr[5] = theStringTableOffset;
-
- inStream.Write(theWriteBuffer.begin(), theWriteBuffer.size());
- }
-
- NVDataRef<qt3ds::QT3DSU8> BinaryLoadManagerData(qt3ds::foundation::IInStream &inStream,
- const char *inBinaryDir) override
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - String Table + Render Objects");
- QT3DS_ASSERT(m_Context->m_FlowData == nullptr);
- QT3DSU32 dataSize = 0;
- inStream.Read(dataSize);
- m_Context->m_FlowData = (QT3DSU8 *)m_Context->m_CoreContext->GetAllocator().allocate(
- dataSize, "SceneManager::BinaryFlowData", __FILE__, __LINE__);
-
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - Initial Data Load");
- inStream.Read(m_Context->m_FlowData, dataSize);
- }
- SDataReader theReader(m_Context->m_FlowData, m_Context->m_FlowData + dataSize);
- QT3DSU32 theEffectSystemOffset = theReader.LoadRef<QT3DSU32>();
- QT3DSU32 theMaterialSystemOffset = theReader.LoadRef<QT3DSU32>();
- QT3DSU32 theBinaryPathOffset = theReader.LoadRef<QT3DSU32>();
- QT3DSU32 thePluginManagerOffset = theReader.LoadRef<QT3DSU32>();
- QT3DSU32 theStringTableOffset = theReader.LoadRef<QT3DSU32>();
- QT3DSU8 *theStartOffset = theReader.m_CurrentPtr;
- IStringTable &theStrTable = m_Context->m_CoreContext->GetStringTable();
-
- // Load string table.
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - Load String Table");
- m_StrTableData = toDataRef(theReader.m_CurrentPtr + theStringTableOffset,
- dataSize - theStringTableOffset);
- theStrTable.Load(m_StrTableData);
- }
-
- // Load source paths to preload heavy data
- theReader.m_CurrentPtr = theStartOffset + theBinaryPathOffset;
- QT3DSU32 theNumSourcePaths = theReader.LoadRef<QT3DSU32>();
- eastl::string theSourcePathStr;
- eastl::string theProjectDir(inBinaryDir);
- eastl::string theShaderCacheDir(inBinaryDir);
-
- // Up one moves to the project directory.
- qt3ds::foundation::CFileTools::GetDirectory(theProjectDir);
- const char8_t *theBasePath(theProjectDir.c_str());
-
- m_ProjectDir = theStrTable.RegisterStr(theProjectDir.c_str());
- m_BinaryDir = theStrTable.RegisterStr(theShaderCacheDir.c_str());
-
- // Preload the heavy buffers
- m_SourcePaths.resize(theNumSourcePaths);
- for (QT3DSU32 idx = 0, end = theNumSourcePaths; idx < end; ++idx) {
- CRegisteredString thePath = theReader.LoadRef<CRegisteredString>();
- QT3DSU32 theFlags = theReader.LoadRef<QT3DSU32>();
- thePath.Remap(m_StrTableData);
- bool theBoolFlagValue = theFlags ? true : false;
- m_SourcePaths[idx] = eastl::make_pair(thePath, theBoolFlagValue);
- }
-
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - Base Dynamic System");
- // Load effect system.
- NVDataRef<QT3DSU8> theDynamicSystemData(theStartOffset, theEffectSystemOffset);
- m_Context->m_CoreContext->GetDynamicObjectSystemCore().Load(
- theDynamicSystemData, m_StrTableData, theBasePath);
- }
-
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - Effect System");
- NVDataRef<QT3DSU8> theEffectSystemData(theStartOffset + theEffectSystemOffset,
- theMaterialSystemOffset - theEffectSystemOffset);
- m_Context->m_CoreContext->GetEffectSystemCore().Load(theEffectSystemData,
- m_StrTableData, theBasePath);
- }
-
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - Material System");
- NVDataRef<QT3DSU8> theMaterialSystemData(theStartOffset + theMaterialSystemOffset,
- thePluginManagerOffset - theMaterialSystemOffset);
- m_Context->m_CoreContext->GetMaterialSystemCore().Load(theMaterialSystemData,
- m_StrTableData, theBasePath);
- }
-
- {
- SStackPerfTimer __perfTimer(m_Context->m_CoreContext->GetPerfTimer(),
- "Load UIAB - Plugin Manager Data");
- NVDataRef<QT3DSU8> thePluginManagerData(theStartOffset + thePluginManagerOffset,
- theStringTableOffset - thePluginManagerOffset);
- m_Context->m_CoreContext->GetRenderPluginCore().Load(thePluginManagerData,
- m_StrTableData, theBasePath);
- }
-
- return m_StrTableData;
- }
-
- virtual void DeleteScene(Q3DStudio::IPresentation *inPresentation)
- {
- QT3DSU32 idx;
- QT3DSU32 end;
- for (idx = 0, end = m_Scenes.size(); idx < end; ++idx) {
- if (m_Scenes[idx].first == inPresentation)
- break;
- }
- if (idx < m_Scenes.size()) {
- m_Scenes[idx].second->Release();
- m_Scenes.erase(m_Scenes.begin() + idx);
- }
- }
-
- Q3DStudio::BOOL Update() override
- {
- bool theResult = false;
- long theSceneCount = m_Scenes.size();
- for (long theSceneIndex = 0; theSceneIndex < theSceneCount; ++theSceneIndex) {
- Qt3DSRenderScene *theScene = m_Scenes[theSceneIndex].second;
- theResult |= theScene->Update();
- }
- return theResult;
- }
-
- Q3DStudio::BOOL RenderPresentation(Q3DStudio::IPresentation *inPresentation,
- bool firstFrame) override
- {
- Qt3DSRenderScene *theFirstScene = nullptr;
- for (QT3DSU32 idx = 0, end = m_Scenes.size(); idx < end && theFirstScene == nullptr; ++idx)
- if (m_Scenes[idx].second->m_RuntimePresentation == inPresentation)
- theFirstScene = m_Scenes[idx].second;
-
- if (theFirstScene && theFirstScene->m_Presentation) {
- m_LastRenderedScene = theFirstScene;
- if (theFirstScene->m_Presentation->m_Scene
- && theFirstScene->m_Presentation->m_Scene->m_UseClearColor) {
- m_Context->m_Context->SetSceneColor(
- theFirstScene->m_Presentation->m_Scene->m_ClearColor);
- } else
- m_Context->m_Context->SetSceneColor(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
-
- // Setup the render rotation *before* rendering so that the magic can happen on begin
- // render.
- if (m_Context->m_RenderRotationsEnabled)
- m_Context->m_Context->SetRenderRotation(
- theFirstScene->m_Presentation->m_PresentationRotation);
- else
- m_Context->m_Context->SetRenderRotation(RenderRotationValues::NoRotation);
-
- m_Context->m_Context->SetPresentationDimensions(QSize(
- (QT3DSU32)theFirstScene->m_Presentation->m_PresentationDimensions.x,
- (QT3DSU32)theFirstScene->m_Presentation->m_PresentationDimensions.y));
- }
-
- m_Context->m_Context->BeginFrame(firstFrame);
- m_Context->m_RenderContext->ResetBlendState();
-
- // How exactly does this work, I have no idea.
- // Should we only render the first scene and not every scene, perhaps?
- bool wasDirty = false;
- if (theFirstScene)
- wasDirty = theFirstScene->PrepareForRender();
- else {
- m_Context->m_RenderContext->SetClearColor(QT3DSVec4(0, 0, 0, 0));
- m_Context->m_RenderContext->Clear(qt3ds::render::NVRenderClearFlags(
- NVRenderClearValues::Color | NVRenderClearValues::Depth));
- }
- m_Context->m_Context->RunRenderTasks();
- if (theFirstScene)
- theFirstScene->Render();
-
- m_Context->m_Context->EndFrame();
-
- return wasDirty;
- }
- // I think render::check resize is called so this isn't necessary
- void OnViewResize(Q3DStudio::INT32 inViewWidth, Q3DStudio::INT32 inViewHeight) override
- {
- m_ViewWidth = inViewWidth;
- m_ViewHeight = inViewHeight;
- }
- void GetViewSize(Q3DStudio::INT32 &outWidth, Q3DStudio::INT32 &outHeight) override
- {
- outWidth = m_ViewWidth;
- outHeight = m_ViewHeight;
- }
-
- Q3DStudio::STextSizes GetDisplayDimensions(Q3DStudio::IPresentation *inPresentation) override
- {
- Qt3DSRenderScene *theFirstScene = nullptr;
- for (QT3DSU32 idx = 0, end = m_Scenes.size(); idx < end && theFirstScene == nullptr; ++idx)
- if (m_Scenes[idx].second->m_RuntimePresentation == inPresentation)
- theFirstScene = m_Scenes[idx].second;
- if (theFirstScene) {
- m_Context->m_Context->SetPresentationDimensions(QSize(
- (QT3DSU32)theFirstScene->m_Presentation->m_PresentationDimensions.x,
- (QT3DSU32)theFirstScene->m_Presentation->m_PresentationDimensions.y));
- render::NVRenderRectF theDisplayViewport =
- m_Context->m_Context->GetDisplayViewport();
- return Q3DStudio::STextSizes(
- static_cast<Q3DStudio::INT32>(theDisplayViewport.m_Width),
- static_cast<Q3DStudio::INT32>(theDisplayViewport.m_Height));
- }
- return Q3DStudio::STextSizes(static_cast<Q3DStudio::INT32>(0),
- static_cast<Q3DStudio::INT32>(0));
- }
-
- Q3DStudio::TElement *UserPick(float mouseX, float mouseY) override
- {
- if (m_LastRenderedScene) {
- return m_LastRenderedScene->UserPick(mouseX, mouseY);
- }
- return nullptr;
- }
-
- Option<QT3DSVec2> FacePosition(Q3DStudio::TElement &inElement, float mouseX, float mouseY,
- NVDataRef<Q3DStudio::TElement *> inElements,
- Q3DStudio::FacePositionPlanes::Enum inPlane) override
- {
- if (m_LastRenderedScene) {
-
- return m_LastRenderedScene->FacePosition(inElement, mouseX, mouseY, inElements,
- inPlane);
- }
- return Empty();
- }
-
- Q3DStudio::SPickFrame AdvancePickFrame(const Q3DStudio::SInputFrame &inInputFrame) override
- {
- // We now have a new input frame, and our results are invalid but ready to be filled
- m_PickFrame.m_InputFrame = inInputFrame;
- m_PickFrame.m_Model = nullptr;
- m_PickFrame.m_ResultValid = false;
- if (m_LastRenderedScene) {
- if (m_PickFrame.m_InputFrame.m_PickValid)
- m_LastRenderedScene->Pick(m_PickFrame);
- }
- return m_PickFrame;
- }
-
- void Release() override
- {
- long theRenderPluginSize = m_RenderPlugins.size();
- Q3DStudio::CDLLManager &theDLLManager = Q3DStudio::CDLLManager::GetDLLManager();
- for (int theRenderPluginIndex = 0; theRenderPluginIndex < theRenderPluginSize;
- ++theRenderPluginIndex) {
- long theDLLHandle = m_RenderPlugins[theRenderPluginIndex].second;
- PROC_Uninitialize theUninitializeProc = reinterpret_cast<PROC_Uninitialize>(
- theDLLManager.GetProc("Uninitialize", theDLLHandle));
- Q3DStudio_ASSERT(theUninitializeProc);
- theUninitializeProc &&theUninitializeProc();
-
- theDLLManager.UnloadLibrary(theDLLHandle);
- }
-
- // Ensure the binding core doesn't get released until after we get released.
- NVScopedRefCounted<SBindingCore> theContext(m_Context);
- NVDelete(m_Context->GetAllocator(), this);
- }
-};
-
-struct SRenderFactory;
-
-struct SRenderFactory : public IQt3DSRenderFactoryCore, public IQt3DSRenderFactory
-{
- NVScopedRefCounted<SBindingCore> m_Context;
-
- NVScopedRefCounted<Q3DStudio::CQmlEngine> m_ScriptBridgeQml;
- NVScopedRefCounted<Qt3DSRenderSceneManager> m_SceneManager;
- NVScopedRefCounted<qt3ds::evt::IEventSystem> m_EventSystem;
- qt3ds::runtime::IApplication *m_Application;
- QT3DSI32 m_RefCount;
-
- SRenderFactory(SBindingCore &inCore)
- : m_Context(inCore)
- , m_ScriptBridgeQml(nullptr)
- , m_SceneManager(nullptr)
- , m_Application(nullptr)
- , m_RefCount(0)
- {
- }
-
- ~SRenderFactory()
- {
- using namespace Q3DStudio;
- // Release the event system, it must be released before script engine
- m_EventSystem = nullptr;
- m_ScriptBridgeQml->Shutdown(*m_Context->m_Foundation);
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
-
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVScopedRefCounted<SBindingCore> theContext(m_Context);
- NVDelete(m_Context->GetAllocator(), this);
- }
- }
-
- qt3ds::render::IQt3DSRenderContextCore &GetRenderContextCore() override
- {
- return *m_Context->m_CoreContext;
- }
-
- qt3ds::runtime::IApplication *GetApplicationCore() override { return m_Application; }
- void SetApplicationCore(qt3ds::runtime::IApplication *app) override
- {
- m_Application = app;
- }
-
- Q3DStudio::ISceneBinaryLoader &GetSceneLoader() override
- {
- if (m_SceneManager == nullptr)
- m_SceneManager = QT3DS_NEW(m_Context->GetAllocator(),
- Qt3DSRenderSceneManager)(*m_Context, m_Context->m_WindowSystem);
- return *m_SceneManager;
- }
-
- Q3DStudio::ITegraApplicationRenderEngine &CreateRenderEngine() override
- {
- return m_Context->CreateRenderer();
- }
- Q3DStudio::ISceneManager &GetSceneManager() override
- {
- if (m_SceneManager == nullptr)
- m_SceneManager = QT3DS_NEW(m_Context->GetAllocator(),
- Qt3DSRenderSceneManager)(*m_Context, m_Context->m_WindowSystem);
- return *m_SceneManager;
- }
- Q3DStudio::IScriptBridge &GetScriptEngineQml() override
- {
- if (m_ScriptBridgeQml == nullptr) {
- m_ScriptBridgeQml =
- Q3DStudio::CQmlEngine::Create(*m_Context->m_Foundation, m_Context->m_TimeProvider);
- }
-
- return *m_ScriptBridgeQml;
- }
- qt3ds::render::IInputStreamFactory &GetInputStreamFactory() override
- {
- return m_Context->m_CoreContext->GetInputStreamFactory();
- }
-
- qt3ds::render::IQt3DSRenderContext &GetQt3DSRenderContext() override
- {
- return *m_Context->m_Context;
- }
-
- qt3ds::evt::IEventSystem &GetEventSystem() override
- {
- if (!m_EventSystem) {
- m_EventSystem = qt3ds::evt::IEventSystem::Create(*m_Context->m_Foundation);
- }
- return *m_EventSystem;
- }
- Q3DStudio::ITimeProvider &GetTimeProvider() override { return m_Context->m_TimeProvider; }
- qt3ds::foundation::IStringTable &GetStringTable() override
- {
- return m_Context->m_CoreContext->GetStringTable();
- }
- qt3ds::NVFoundationBase &GetFoundation() override { return *m_Context->m_Foundation.mPtr; }
- qt3ds::foundation::IPerfTimer &GetPerfTimer() override
- {
- return m_Context->m_CoreContext->GetPerfTimer();
- }
- qt3ds::runtime::IApplication *GetApplication() override { return m_Application; }
- void SetApplication(qt3ds::runtime::IApplication *app) override
- {
- m_Application = app;
- if (app) {
- // QML engine
- GetScriptEngineQml();
- m_ScriptBridgeQml->SetApplication(*app);
- m_ScriptBridgeQml->Initialize();
- }
- }
- void SetDllDir(const char *dllDir) override
- {
- m_Context->m_CoreContext->GetRenderPluginCore().SetDllDir(dllDir);
- }
-
- void AddSearchPath(const char8_t *inFile) override
- {
- m_Context->m_CoreContext->GetInputStreamFactory().AddSearchDirectory(inFile);
- }
- virtual void Release() { NVDelete(m_Context->GetAllocator(), this); }
-
- struct SContextTypeRenderFactory : public IRuntimeFactoryRenderFactory
- {
- QSurfaceFormat format;
- SContextTypeRenderFactory(const QSurfaceFormat &fmt)
- : format(fmt)
- {
- }
-
- qt3ds::render::NVRenderContext *CreateRenderContext(qt3ds::NVFoundationBase &foundat,
- IStringTable &strt) override
- {
-#ifndef Qt3DS_NO_RENDER_SYMBOLS
- qt3ds::render::NVRenderContext &retval = NVRenderContext::CreateGL(foundat, strt, format);
- return &retval;
-#else
- qt3ds::render::NVRenderContext &retval = NVRenderContext::Createnullptr(foundat, strt);
- return &retval;
-#endif
- }
- };
-
- IQt3DSRenderFactory &CreateRenderFactory(const QSurfaceFormat& format,
- bool delayedLoading) override
- {
-
- SContextTypeRenderFactory theContextFactory(format);
- m_Context->CreateRenderContext(theContextFactory, delayedLoading);
-
- GetSceneLoader();
- {
- SStackPerfTimer __loadTimer(GetPerfTimer(), "SceneManager OnGraphicsInitialized");
- m_SceneManager->OnGraphicsInitialized();
- }
- return *this;
- }
-};
-
-Q3DStudio::SScriptEngineGotoSlideArgs ToEngine(const qt3ds::state::SGotoSlideData &inData)
-{
- using namespace qt3ds::state;
- Q3DStudio::SScriptEngineGotoSlideArgs retval;
- if (inData.m_Mode.hasValue()) {
- switch (*inData.m_Mode) {
- case SlidePlaybackModes::StopAtEnd:
- retval.m_Mode = Q3DStudio::TimePolicyModes::StopAtEnd;
- break;
- case SlidePlaybackModes::Looping:
- retval.m_Mode = Q3DStudio::TimePolicyModes::Looping;
- break;
- case SlidePlaybackModes::Ping:
- retval.m_Mode = Q3DStudio::TimePolicyModes::Ping;
- break;
- case SlidePlaybackModes::PingPong:
- retval.m_Mode = Q3DStudio::TimePolicyModes::PingPong;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- if (inData.m_PlaythroughTo.hasValue())
- retval.m_PlaythroughTo = inData.m_PlaythroughTo->c_str();
- if (inData.m_Paused.hasValue())
- retval.m_Paused = inData.m_Paused;
- retval.m_Rate = inData.m_Rate;
- retval.m_Reverse = inData.m_Reverse;
- if (inData.m_StartTime.hasValue())
- retval.m_StartTime = *inData.m_StartTime;
- return retval;
-}
-
-class CStateScriptEngineCallFunctionArgRetriever
- : public Q3DStudio::CScriptEngineCallFunctionArgRetriever
-{
-public:
- CStateScriptEngineCallFunctionArgRetriever(const char *inArguments,
- qt3ds::state::IScriptContext &inScriptContext)
- : CScriptEngineCallFunctionArgRetriever(inArguments)
- , m_ScriptContext(inScriptContext)
- {
- }
- int RetrieveArgument(script_State *inState) override
- {
- (void *)inState;
- return m_ScriptContext.ExecuteStr(m_ArgumentString, true) ? 1 : -1;
- }
-
-private:
- qt3ds::state::IScriptContext &m_ScriptContext;
-};
-}
-
-IQt3DSRenderFactoryCore &IQt3DSRenderFactoryCore::CreateRenderFactoryCore(
- const char8_t *inApplicationDirectory,
- Q3DStudio::IWindowSystem &inWindowSystem,
- Q3DStudio::ITimeProvider &inTimeProvider)
-{
- SBindingCore *theCore = (SBindingCore *)malloc(sizeof(SBindingCore));
- new (theCore) SBindingCore(inApplicationDirectory, inWindowSystem, inTimeProvider);
- return *QT3DS_NEW(theCore->GetAllocator(), SRenderFactory)(*theCore);
-}
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.h
deleted file mode 100644
index ad0c4e6b..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBinding.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_RENDER_RUNTIME_BINDING_H
-#define QT3DS_RENDER_RUNTIME_BINDING_H
-
-#include "Qt3DSRuntimeFactory.h"
-#include "EABase/eabase.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-
-#include <QSurfaceFormat>
-
-namespace Q3DStudio {
-class ITegraApplicationRenderEngine;
-class ITimeProvider;
-class IWindowSystem;
-}
-
-namespace qt3ds {
-namespace render {
-
- class ITextRenderer;
- class IRuntimeFactoryRenderFactory
- {
- protected:
- virtual ~IRuntimeFactoryRenderFactory() {}
- public:
- virtual qt3ds::render::NVRenderContext *
- CreateRenderContext(qt3ds::NVFoundationBase &foundat, qt3ds::foundation::IStringTable &strt) = 0;
- };
-
- class IQt3DSRenderFactory;
-
- class QT3DS_AUTOTEST_EXPORT IQt3DSRenderFactoryCore : public Q3DStudio::IRuntimeFactoryCore
- {
- public:
- virtual IQt3DSRenderFactory &
- CreateRenderFactory(const QSurfaceFormat &format, bool delayedLoading) = 0;
-
- static IQt3DSRenderFactoryCore &
- CreateRenderFactoryCore(const char8_t *inApplicationDirectory,
- Q3DStudio::IWindowSystem &inWindowSystem,
- Q3DStudio::ITimeProvider &inTimeProvider);
- };
-
- class IQt3DSRenderFactory : public Q3DStudio::IRuntimeFactory
- {
- public:
- virtual Q3DStudio::ITegraApplicationRenderEngine &CreateRenderEngine() = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImpl.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImpl.h
deleted file mode 100644
index 92cb8658..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImpl.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_RENDER_RUNTIME_BINDING_IMPL_H
-#define QT3DS_RENDER_RUNTIME_BINDING_IMPL_H
-
-#include "Qt3DSRenderRuntimeBinding.h"
-#include "foundation/TrackingAllocator.h"
-#include "foundation/Utils.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderContextCore.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSIPresentation.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSRenderPresentation.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSUIPParser.h"
-#include "Qt3DSRenderEffect.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "foundation/Qt3DSInvasiveSet.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderText.h"
-#include "foundation/StrConvertUTF.h"
-#include "Qt3DSMetadata.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSWindowSystem.h"
-#include "Qt3DSRenderPluginGraphObject.h"
-#include "Qt3DSRenderReferencedMaterial.h"
-#include "Qt3DSRenderText.h"
-#include "foundation/Qt3DSMutex.h"
-
-#ifdef EA_PLATFORM_WINDOWS
-#pragma warning(disable : 4355)
-#else
-#define stricmp strcasecmp
-#endif
-
-using namespace qt3ds::render;
-using eastl::make_pair;
-using eastl::pair;
-
-namespace qt3ds {
-namespace render {
-
- extern qt3ds::foundation::MallocAllocator g_BaseAllocator;
- // Small core object shared between the larger objects.
- // creates the object stack needed by the rest of the system.
- struct SBindingCore : public NVRefCounted
- {
- qt3ds::render::CAllocator m_Allocator;
- QT3DSU8 *m_FlowData;
- NVScopedRefCounted<NVFoundation> m_Foundation;
- NVScopedRefCounted<IStringTable> m_StringTable;
- NVScopedRefCounted<IQt3DSRenderContextCore> m_CoreContext;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- NVScopedRefCounted<IQt3DSRenderContext> m_Context;
- QSize m_WindowDimensions;
- eastl::string m_PrimitivePath;
- bool m_RenderRotationsEnabled;
- bool m_WriteOutShaderCache;
- volatile QT3DSI32 mRefCount;
- Q3DStudio::IWindowSystem &m_WindowSystem;
- Q3DStudio::ITimeProvider &m_TimeProvider;
-
- SBindingCore(const char8_t *inPrimitivePath, Q3DStudio::IWindowSystem &inWindowSystem,
- Q3DStudio::ITimeProvider &inTimeProvider)
- : m_Allocator()
- , m_FlowData(NULL)
- , m_Foundation(NVCreateFoundation(QT3DS_FOUNDATION_VERSION, m_Allocator))
- , m_StringTable(IStringTable::CreateStringTable(m_Foundation->getAllocator()))
- , m_CoreContext(IQt3DSRenderContextCore::Create(*m_Foundation, *m_StringTable))
- , m_PrimitivePath(inPrimitivePath)
- , m_RenderRotationsEnabled(false)
- , m_WriteOutShaderCache(false)
- , mRefCount(0)
- , m_WindowSystem(inWindowSystem)
- , m_TimeProvider(inTimeProvider)
- {
- m_CoreContext->SetTextRendererCore(
- ITextRendererCore::CreateQtTextRenderer(*m_Foundation, *m_StringTable));
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- m_CoreContext->setDistanceFieldRenderer(
- ITextRendererCore::createDistanceFieldRenderer(*m_Foundation));
-#endif
-
- m_CoreContext->SetOnscreenTextRendererCore(
- ITextRendererCore::CreateOnscreenTextRenderer(*m_Foundation));
- }
- virtual ~SBindingCore()
- {
- m_CoreContext = NULL;
- m_Context = NULL;
- m_RenderContext = NULL;
- if (m_FlowData)
- m_Allocator.deallocate(m_FlowData);
- m_FlowData = NULL;
- }
-
- void CreateRenderContext(qt3ds::render::IRuntimeFactoryRenderFactory &inContextFactory,
- bool delayedLoading)
- {
- m_RenderContext = inContextFactory.CreateRenderContext(*m_Foundation, *m_StringTable);
- if (m_RenderContext) {
- m_Context =
- m_CoreContext->CreateRenderContext(*m_RenderContext, m_PrimitivePath.c_str(),
- delayedLoading);
- }
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(g_BaseAllocator)
-
- NVAllocatorCallback &GetAllocator() { return m_Allocator; }
-
- Q3DStudio::ITegraApplicationRenderEngine &CreateRenderer();
- };
- struct STranslatorContext
- {
- };
-
- ////////////////////////////////////////
- // Translators are the set of objects that translate
- // changes in the elements to changes in the scene graph.
- // TODO - get rid of the virtual functions and just do dispatch
- // on the m_RenderObject.m_Type.
- ////////////////////////////////////////
- class Qt3DSTranslator
- {
- public:
- QT3DSU32 m_DirtyIndex;
- Q3DStudio::TElement *m_Element;
- SGraphObject *m_RenderObject;
- STranslatorContext *m_TranslatorContext;
-
- Qt3DSTranslator(Q3DStudio::TElement &inElement, SGraphObject &inRenderObject);
- GraphObjectTypes::Enum GetUIPType() const { return m_RenderObject->m_Type; }
- Q3DStudio::TElement &Element() { return *m_Element; }
- SGraphObject &RenderObject() { return *m_RenderObject; }
-
- // This function is done via a dispatch mechanism on the graph object type.
- void OnElementChanged(SPresentation &inPresentation, IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &inStudioPresentation);
-
- void Save(SWriteBuffer &inWriteBuffer, QT3DSU32 inGraphObjectOffset);
- // Most translators don't need an extra allocation but effects due because the mapping from
- // effect property
- // to runtime property is too complex to do quickly.
- static Qt3DSTranslator *LoadTranslator(SDataReader &inReader, size_t inElemOffset,
- NVDataRef<QT3DSU8> inSGSection,
- NVAllocatorCallback &inAllocator);
-
- static Qt3DSTranslator *GetTranslatorFromGraphNode(SGraphObject &inObject);
- static Qt3DSTranslator *CreateTranslatorForElement(Q3DStudio::TElement &inElement,
- SGraphObject &inGraphObject,
- NVAllocatorCallback &inAlloc);
- static Q3DStudio::IPresentation *
- GetPresentationFromPresentation(SPresentation &inPresentation);
- static void InitializePointerTags(IStringTable &inTable);
- static void AssignUserData(Q3DStudio::IPresentation &inPresentation,
- SPresentation &inGraphPresentation);
- };
-
- struct STranslatorGetOp
- {
- QT3DSU32 operator()(const Qt3DSTranslator &translator) { return translator.m_DirtyIndex; }
- };
- struct STranslatorSetOp
- {
- void operator()(Qt3DSTranslator &translator, QT3DSU32 value)
- {
- translator.m_DirtyIndex = value;
- }
- };
-
- typedef InvasiveSet<Qt3DSTranslator, STranslatorGetOp, STranslatorSetOp> TTranslatorDirytSet;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp b/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp
deleted file mode 100644
index b41c83b9..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "EnginePrefix.h"
-#include "Qt3DSRenderRuntimeBindingImpl.h"
-#include "Qt3DSRuntimeView.h"
-#include "Qt3DSWindowSystem.h"
-#include "Qt3DSRenderLoadedTexture.h"
-
-struct SRenderer;
-struct SRendererRSM : public Q3DStudio::ITegraRenderStateManager
-{
- SRenderer &m_Renderer;
-
-public:
- SRendererRSM(SRenderer &renderer)
- : m_Renderer(renderer)
- {
- }
-
- void SetViewport(Q3DStudio::INT32 inX, Q3DStudio::INT32 inY, Q3DStudio::INT32 inWidth,
- Q3DStudio::INT32 inHeight) override;
- void PushState() override;
- void PopState() override;
- void SetScissorTestEnabled(bool inValue) override;
- void SaveAllState() override;
- void RestoreAllState() override;
-};
-
-struct SRenderer : public Q3DStudio::ITegraApplicationRenderEngine
-{
- NVScopedRefCounted<SBindingCore> m_BindingCore;
- NVScopedRefCounted<IQt3DSRenderContext> m_Context;
- NVRenderRect m_Viewport;
- nvvector<NVRenderRect> m_StateStack;
- QSize m_PresentationDimensions;
- SRendererRSM m_RSM;
- Q3DStudio::IWindowSystem &m_WindowSystem;
-
- SRenderer(SBindingCore &inCore, Q3DStudio::IWindowSystem &inWindowSystem)
- : m_BindingCore(inCore)
- , m_Context(*inCore.m_Context)
- , m_StateStack(inCore.m_Context->GetAllocator(), "SRenderer::m_StateStack")
- , m_RSM(*this)
- , m_WindowSystem(inWindowSystem)
- {
- m_Context->SetSceneColor(QT3DSVec4(0, 0, 0, 0.0f));
- if (m_BindingCore->m_RenderContext) {
- m_BindingCore->m_RenderContext->SetDefaultRenderTarget(
- m_WindowSystem.GetDefaultRenderTargetID());
- m_BindingCore->m_RenderContext->SetDefaultDepthBufferBitCount(
- m_WindowSystem.GetDepthBitCount());
- }
- }
-
- void ensureRenderTarget() override
- {
- m_BindingCore->m_RenderContext->SetDefaultRenderTarget(
- m_WindowSystem.GetDefaultRenderTargetID());
- }
-
- void CheckResize(bool, Q3DStudio::IPresentation & /*inPresentation*/) override
- {
- QSize theWindowDims(m_WindowSystem.GetWindowDimensions());
- m_BindingCore->m_WindowDimensions = theWindowDims;
- m_BindingCore->m_Context->SetWindowDimensions(m_BindingCore->m_WindowDimensions);
- }
- Q3DStudio::BOOL LoadShaderCache(const char * /*inFilePath*/) override { return true; }
-
- void AbandonLoadingImages(Q3DStudio::IScene & /*inScene*/) override {}
-
- Q3DStudio::BOOL IsPickValid(Q3DStudio::FLOAT &outX, Q3DStudio::FLOAT &outY,
- const Q3DStudio::IPresentation & /*inPresentation*/) const override
- {
- Q3DStudio::FLOAT theX = outX;
- Q3DStudio::FLOAT theY = outY;
- theX = theX / static_cast<Q3DStudio::FLOAT>(m_BindingCore->m_WindowDimensions.width());
- theY = theY / static_cast<Q3DStudio::FLOAT>(m_BindingCore->m_WindowDimensions.height());
- Q3DStudio::BOOL theValid = false;
-
- if ((theX >= 0.0f) && (theY >= 0.0f) && (theX <= 1.0f) && (theY <= 1.0f))
- theValid = true;
- return theValid;
- }
-
- void SetScaleMode(Q3DStudio::TegraRenderScaleModes::Enum inScale) override
- {
- if (m_BindingCore && m_BindingCore->m_Context)
- m_BindingCore->m_Context->SetScaleMode(static_cast<ScaleModes::Enum>(inScale));
- }
- Q3DStudio::TegraRenderScaleModes::Enum GetScaleMode() const override
- {
- if (m_BindingCore && m_BindingCore->m_Context)
- return static_cast<Q3DStudio::TegraRenderScaleModes::Enum>(
- const_cast<SRenderer &>(*this).m_BindingCore->m_Context->GetScaleMode());
-
- QT3DS_ASSERT(false);
- return Q3DStudio::TegraRenderScaleModes::ExactSize;
- }
-
- void SetShadeMode(Q3DStudio::TegraRenderShadeModes::Enum inShade) override
- {
- if (m_BindingCore && m_BindingCore->m_Context) {
- m_BindingCore->m_Context->SetWireframeMode(
- (inShade == Q3DStudio::TegraRenderShadeModes::Shaded) ? false : true);
- }
- }
-
- void EnableRenderRotation(bool inEnable) override
- {
- m_BindingCore->m_RenderRotationsEnabled = inEnable;
- }
-
- void SetWriteOutShaderCache(bool inWriteOutShaderCache) override
- {
- m_BindingCore->m_WriteOutShaderCache = inWriteOutShaderCache;
- }
-
- Q3DStudio::ITegraRenderStateManager &GetTegraRenderStateManager() override { return m_RSM; }
- qt3ds::render::NVRenderContext &GetRenderContext() override
- {
- return *m_BindingCore->m_RenderContext;
- }
-
- void Release() override
- {
- // Ensure the core doesn't die until after we do.
- NVScopedRefCounted<SBindingCore> theContext(m_BindingCore);
- NVDelete(m_Context->GetAllocator(), this);
- }
-
- void SetViewport(Q3DStudio::INT32 inX, Q3DStudio::INT32 inY, Q3DStudio::INT32 inWidth,
- Q3DStudio::INT32 inHeight) override
- {
- m_Viewport = NVRenderRect(inX, inY, inWidth, inHeight);
- m_BindingCore->m_RenderContext->SetViewport(m_Viewport);
- }
- void SetApplicationViewport(const qt3ds::render::NVRenderRect &inViewport) override
- {
- m_BindingCore->m_Context->SetViewport(inViewport);
- }
-
- void SetMatteColor(Option<QT3DSVec4> inColor) override { m_Context->SetMatteColor(inColor); }
- virtual void PushState() { m_StateStack.push_back(m_Viewport); }
- virtual void PopState()
- {
- m_Viewport = m_StateStack.back();
- m_StateStack.pop_back();
- SetViewport(m_Viewport.m_X, m_Viewport.m_Y, m_Viewport.m_Width, m_Viewport.m_Height);
- }
-
- void RenderText2D(Q3DStudio::FLOAT x, Q3DStudio::FLOAT y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor, const char *text) override
- {
- m_Context->RenderText2D(x, y, inColor, text);
- }
-
- void RenderGpuProfilerStats(Q3DStudio::FLOAT x, Q3DStudio::FLOAT y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor) override
- {
- m_Context->RenderGpuProfilerStats(x, y, inColor);
- }
-};
-
-void SRendererRSM::SetViewport(Q3DStudio::INT32 inX, Q3DStudio::INT32 inY, Q3DStudio::INT32 inWidth,
- Q3DStudio::INT32 inHeight)
-{
- m_Renderer.SetViewport(inX, inY, inWidth, inHeight);
-}
-void SRendererRSM::PushState()
-{
- m_Renderer.PushState();
-}
-void SRendererRSM::PopState()
-{
- m_Renderer.PopState();
-}
-void SRendererRSM::SetScissorTestEnabled(bool inValue)
-{
- m_Renderer.m_BindingCore->m_RenderContext->SetScissorTestEnabled(inValue);
-}
-void SRendererRSM::SaveAllState()
-{
- m_Renderer.m_BindingCore->m_RenderContext->PushPropertySet();
-}
-void SRendererRSM::RestoreAllState()
-{
- m_Renderer.m_BindingCore->m_RenderContext->PopPropertySet(true);
-}
-
-Q3DStudio::ITegraApplicationRenderEngine &SBindingCore::CreateRenderer()
-{
- SRenderer *retval = NULL;
- if (m_Context)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SRenderer)(*this, this->m_WindowSystem);
-
- return *retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp b/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp
deleted file mode 100644
index a4b3bc7e..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp
+++ /dev/null
@@ -1,1841 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "EnginePrefix.h"
-#include "Qt3DSRenderRuntimeBindingImpl.h"
-#include "Qt3DSRenderUIPSharedTranslation.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "foundation/SerializationTypes.h"
-#include "StringTools.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSHash.h"
-#include "Qt3DSRenderPlugin.h"
-#include "Qt3DSRenderPluginPropertyValue.h"
-#include "Qt3DSElementHelper.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderPathSubPath.h"
-#include "Qt3DSRenderPathManager.h"
-
-using namespace qt3ds::foundation;
-
-namespace Q3DStudio {
-enum ExtendedAttributes {
- ATTRIBUTE_NONE = 0,
- ATTRIBUTE_NONE_R,
- ATTRIBUTE_NONE_G,
- ATTRIBUTE_NONE_B
-};
-}
-
-namespace {
-QT3DSU32 g_TranslatorTag;
-QT3DSU32 g_PresentationTag;
-}
-
-// Add specializations for the tagged pointer operations to make casting
-// a bit safer and more transparent.
-namespace qt3ds {
-namespace render {
- template <>
- struct SPointerTag<Qt3DSTranslator>
- {
- static QT3DSU32 GetTag() { return g_TranslatorTag; }
- };
- template <>
- struct SPointerTag<Q3DStudio::IPresentation>
- {
- static QT3DSU32 GetTag() { return g_PresentationTag; }
- };
-}
-}
-
-namespace {
-
-template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
-struct SDirtySetter
-{
-};
-
-template <>
-struct SDirtySetter<Qt3DSRenderDirtyFlags::Dirty>
-{
- static void Set(bool &dirty, bool & /*transformDirty*/, bool & /*textDirty*/) { dirty = true; }
-};
-template <>
-struct SDirtySetter<Qt3DSRenderDirtyFlags::TransformDirty>
-{
- static void Set(bool &dirty, bool &transformDirty, bool & /*textDirty*/)
- {
- dirty = true;
- transformDirty = true;
- }
-};
-template <>
-struct SDirtySetter<Qt3DSRenderDirtyFlags::TextDirty>
-{
- static void Set(bool &dirty, bool & /*transformDirty*/, bool &textDirty)
- {
- dirty = true;
- textDirty = true;
- }
-};
-template <>
-struct SDirtySetter<Qt3DSRenderDirtyFlags::Unknown>
-{
- static void Set(bool & /*dirty*/, bool & /*transformDirty*/, bool & /*textDirty*/) {}
-};
-
-// Translates individual property values from the runtime into the rendering system.
-struct SRuntimePropertyParser
-{
- QT3DSI32 m_PropertyName;
- Q3DStudio::UVariant m_Value;
- Q3DStudio::EAttributeType m_Type;
- Q3DStudio::TElement &m_Element;
- SPresentation &m_Presentation;
- IQt3DSRenderContext &m_RenderContext;
- bool m_Dirty;
- bool m_TransformDirty;
- bool m_TextDirty;
-
- SRuntimePropertyParser(SPresentation &inPresentation, IQt3DSRenderContext &inRenderContext,
- Q3DStudio::TElement &inElement)
- : m_PropertyName(0)
- , m_Type((Q3DStudio::EAttributeType)0)
- , m_Element(inElement)
- , m_Presentation(inPresentation)
- , m_RenderContext(inRenderContext)
- , m_Dirty(false)
- , m_TransformDirty(false)
- , m_TextDirty(false)
- {
- }
-
- void Setup(QT3DSI32 inPropName, Q3DStudio::UVariant inValue, Q3DStudio::EAttributeType inType)
- {
- m_PropertyName = inPropName;
- m_Value = inValue;
- m_Type = inType;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- void SetDirty()
- {
- SDirtySetter<TDirtyType>::Set(m_Dirty, m_TransformDirty, m_TextDirty);
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(QT3DSF32 &outValue)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_FLOAT) {
- QT3DSF32 newValue = m_Value.m_FLOAT;
- if (outValue != newValue) {
- outValue = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- };
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(QT3DSU32 &outValue)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_INT32) {
- QT3DSU32 newValue = (QT3DSU32)m_Value.m_INT32;
- if (outValue != newValue) {
- outValue = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- };
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(SGraphObject *&outValue)
- {
- Q3DStudio::TElement *theElem = NULL;
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_ELEMENTREF) {
- theElem = m_Element.GetBelongedPresentation()->GetApplication().GetElementByHandle(
- m_Value.m_ElementHandle);
- } else if (m_Type == Q3DStudio::ATTRIBUTETYPE_STRING) {
- CRegisteredString theString =
- m_RenderContext.GetStringTable().HandleToStr(m_Value.m_StringHandle);
- theElem = Q3DStudio::CElementHelper::GetElement(
- m_Element.GetBelongedPresentation()->GetApplication(),
- m_Element.GetBelongedPresentation(), theString.c_str(), &m_Element);
- }
-
- SGraphObject *newValue = NULL;
- if (theElem) {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(theElem->GetAssociation());
- if (theTranslator)
- newValue = theTranslator->m_RenderObject;
- }
- if (outValue != newValue) {
- outValue = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- return false;
- };
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseRadianProperty(QT3DSF32 &outValue)
- {
- if (ParseProperty<TDirtyType>(outValue)) {
- TORAD(outValue);
- return true;
- }
- return false;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseOpacityProperty(QT3DSF32 &outValue)
- {
- if (ParseProperty<TDirtyType>(outValue)) {
- outValue *= 1.0f / 100.0f;
- return true;
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseOrientationProperty(bool &ioCurrent)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_STRING) {
- CRegisteredString strValue =
- m_RenderContext.GetStringTable().HandleToStr(m_Value.m_StringHandle);
- bool newValue = AreEqual(strValue.c_str(), "Left Handed") ? true : false;
- if (ioCurrent != newValue) {
- ioCurrent = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(bool &ioCurrent)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_BOOL || m_Type == Q3DStudio::ATTRIBUTETYPE_INT32) {
- bool newValue = m_Value.m_INT32 ? true : false;
- if (ioCurrent != newValue) {
- ioCurrent = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseInverseBoolean(bool &ioCurrent)
- {
- bool temp = !ioCurrent;
- if (ParseProperty<TDirtyType>(temp)) {
- ioCurrent = temp;
- return true;
- }
- return false;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(QT3DSVec3 &outValue)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_FLOAT3) {
- QT3DSVec3 newValue(m_Value.m_FLOAT3[0], m_Value.m_FLOAT3[1], m_Value.m_FLOAT3[2]);
- if (outValue != newValue) {
- outValue = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(QT3DSVec4 &outValue)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_FLOAT4) {
- QT3DSVec4 newValue(m_Value.m_FLOAT4[0], m_Value.m_FLOAT4[1], m_Value.m_FLOAT4[2],
- m_Value.m_FLOAT4[3]);
- if (outValue != newValue) {
- outValue = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(CRegisteredString &outValue)
- {
- if (m_Type == Q3DStudio::ATTRIBUTETYPE_STRING) {
- CRegisteredString newValue =
- m_RenderContext.GetStringTable().HandleToStr(m_Value.m_StringHandle);
- if (newValue.c_str() != outValue.c_str()) {
- outValue = newValue;
- SetDirty<TDirtyType>();
- return true;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseRotationOrder(QT3DSU32 &outValue)
- {
- CRegisteredString theString;
- ParseProperty<Qt3DSRenderDirtyFlags::Unknown>(theString);
- if (theString.IsValid()) {
- QT3DSU32 newRotationOrder = MapRotationOrder(theString);
- if (newRotationOrder != outValue) {
- outValue = newRotationOrder;
- SetDirty<TDirtyType>();
- return true;
- }
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseOrientation(NodeFlags &outValue)
- {
- bool temp = false;
- ParseOrientationProperty<TDirtyType>(temp);
- bool wasLeftHanded = outValue.IsLeftHanded();
- if (wasLeftHanded != temp) {
- outValue.SetLeftHanded(temp);
- SetDirty<TDirtyType>();
- return true;
- }
- return false;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseNodeFlagsProperty(NodeFlags &outValue, NodeFlagValues::Enum inFlag)
- {
- bool temp = false;
- ParseProperty<Qt3DSRenderDirtyFlags::Unknown>(temp);
- bool wasSet = outValue & inFlag;
- if (temp != wasSet) {
- outValue.ClearOrSet(temp, inFlag);
- SetDirty<TDirtyType>();
- return true;
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseNodeFlagsInverseProperty(NodeFlags &outValue, NodeFlagValues::Enum inFlag)
- {
- bool temp = false;
- ParseProperty<Qt3DSRenderDirtyFlags::Unknown>(temp);
- temp = !temp;
- bool wasSet = outValue & inFlag;
- if (temp != wasSet) {
- outValue.ClearOrSet(temp, inFlag);
- SetDirty<TDirtyType>();
- return true;
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType, typename TEnumType>
- bool ParseEnumProperty(TEnumType &outValue)
- {
- CRegisteredString theString;
- ParseProperty<Qt3DSRenderDirtyFlags::Unknown>(theString);
- if (theString.IsValid()) {
- SEnumNameMap *theMap = SEnumParseMap<TEnumType>::GetMap();
- for (SEnumNameMap *theItem = theMap; theItem->m_Name && *theItem->m_Name; ++theItem) {
- // hack to match advanced overlay types, whose name start with a '*'
- const char8_t *p = theString.c_str();
- if (*p == '*')
- ++p;
- if (strcmp(p, theItem->m_Name) == 0) {
- TEnumType theNewValue = static_cast<TEnumType>(theItem->m_Enum);
- if (outValue != theNewValue) {
- outValue = theNewValue;
- SetDirty<TDirtyType>();
- return true;
- }
- }
- }
- }
- return false;
- }
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseAndResolveSourcePath(CRegisteredString &outValue)
- {
- CRegisteredString theTemp;
- ParseProperty<Qt3DSRenderDirtyFlags::Unknown>(theTemp);
- CRegisteredString theNewStr = theTemp;
- if (outValue.c_str() != theNewStr.c_str()) {
- SetDirty<TDirtyType>();
- outValue = theNewStr;
- return true;
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(SImage *&ioImagePtr)
- {
- Q3DStudio::TElement *theElem =
- m_Element.GetBelongedPresentation()->GetApplication().GetElementByHandle(
- m_Value.m_ElementHandle);
- // Try to be very careful in here as casting things around like crazy is a sure
- // way to crash the runtime at a bad point.
- if (theElem != NULL) {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(theElem->GetAssociation());
- if (theTranslator != NULL && theTranslator->GetUIPType() == GraphObjectTypes::Image) {
- SImage *theImage = static_cast<SImage *>(theTranslator->m_RenderObject);
- if (ioImagePtr != theImage) {
- ioImagePtr = theImage;
- SetDirty<TDirtyType>();
- return true;
- }
- }
- }
- return false;
- }
-
- template <Qt3DSRenderDirtyFlags::Enum TDirtyType>
- bool ParseProperty(SNode *&ioNodePtr)
- {
- Q3DStudio::TElement *theElem =
- m_Element.GetBelongedPresentation()->GetApplication().GetElementByHandle(
- m_Value.m_ElementHandle);
- // Try to be very careful in here as casting things around like crazy is a sure
- // way to crash the runtime at a bad point.
- SNode *theNode = NULL;
- if (theElem != NULL
- && theElem->GetBelongedPresentation() == m_Element.GetBelongedPresentation()) {
- Qt3DSTranslator *theTranslator =
- reinterpret_cast<Qt3DSTranslator *>(theElem->GetAssociation());
- if (theTranslator != NULL
- && GraphObjectTypes::IsNodeType(theTranslator->GetUIPType())) {
- theNode = static_cast<SNode *>(theTranslator->m_RenderObject);
- }
- }
- if (ioNodePtr != theNode) {
- ioNodePtr = theNode;
- SetDirty<TDirtyType>();
- return true;
- }
- return false;
- }
-};
-
-// Fill out parse name table.
-#define Scene_ClearColor_R ATTRIBUTE_BACKGROUNDCOLOR_R
-#define Scene_ClearColor_G ATTRIBUTE_BACKGROUNDCOLOR_G
-#define Scene_ClearColor_B ATTRIBUTE_BACKGROUNDCOLOR_B
-#define Scene_ClearColor_A ATTRIBUTE_BACKGROUNDCOLOR_A
-#define Scene_UseClearColor ATTRIBUTE_BGCOLORENABLE
-#define Node_Rotation ATTRIBUTE_ROTATION
-#define Node_Rotation_X ATTRIBUTE_ROTATION_X
-#define Node_Rotation_Y ATTRIBUTE_ROTATION_Y
-#define Node_Rotation_Z ATTRIBUTE_ROTATION_Z
-#define Node_Position ATTRIBUTE_POSITION
-#define Node_Position_X ATTRIBUTE_POSITION_X
-#define Node_Position_Y ATTRIBUTE_POSITION_Y
-#define Node_Position_Z ATTRIBUTE_POSITION_Z
-#define Node_Scale ATTRIBUTE_SCALE
-#define Node_Scale_X ATTRIBUTE_SCALE_X
-#define Node_Scale_Y ATTRIBUTE_SCALE_Y
-#define Node_Scale_Z ATTRIBUTE_SCALE_Z
-#define Node_Pivot ATTRIBUTE_PIVOT
-#define Node_Pivot_X ATTRIBUTE_PIVOT_X
-#define Node_Pivot_Y ATTRIBUTE_PIVOT_Y
-#define Node_Pivot_Z ATTRIBUTE_PIVOT_Z
-#define Node_LocalOpacity ATTRIBUTE_OPACITY
-#define Node_RotationOrder ATTRIBUTE_ROTATIONORDER
-#define Node_LeftHanded ATTRIBUTE_ORIENTATION
-#define Layer_TemporalAAEnabled ATTRIBUTE_TEMPORALAA
-#define Layer_LayerEnableDepthTest ATTRIBUTE_DISABLEDEPTHTEST
-#define Layer_LayerEnableDepthPrePass ATTRIBUTE_DISABLEDEPTHPREPASS
-#define Layer_ClearColor_R ATTRIBUTE_BACKGROUNDCOLOR_R
-#define Layer_ClearColor_G ATTRIBUTE_BACKGROUNDCOLOR_G
-#define Layer_ClearColor_B ATTRIBUTE_BACKGROUNDCOLOR_B
-#define Layer_ClearColor_A ATTRIBUTE_BACKGROUNDCOLOR_A
-#define Layer_Background ATTRIBUTE_BACKGROUND
-#define Layer_BlendType ATTRIBUTE_BLENDTYPE
-#define Layer_ProgressiveAAMode ATTRIBUTE_PROGRESSIVEAA
-#define Layer_MultisampleAAMode ATTRIBUTE_MULTISAMPLEAA
-#define Layer_HorizontalFieldValues ATTRIBUTE_HORZFIELDS
-#define Layer_Left ATTRIBUTE_LEFT
-#define Layer_LeftUnits ATTRIBUTE_LEFTUNITS
-#define Layer_Width ATTRIBUTE_WIDTH
-#define Layer_WidthUnits ATTRIBUTE_WIDTHUNITS
-#define Layer_Right ATTRIBUTE_RIGHT
-#define Layer_RightUnits ATTRIBUTE_RIGHTUNITS
-#define Layer_VerticalFieldValues ATTRIBUTE_VERTFIELDS
-#define Layer_Top ATTRIBUTE_TOP
-#define Layer_TopUnits ATTRIBUTE_TOPUNITS
-#define Layer_Height ATTRIBUTE_HEIGHT
-#define Layer_HeightUnits ATTRIBUTE_HEIGHTUNITS
-#define Layer_Bottom ATTRIBUTE_BOTTOM
-#define Layer_BottomUnits ATTRIBUTE_BOTTOMUNITS
-#define Layer_AoStrength ATTRIBUTE_AOSTRENGTH
-#define Layer_AoDistance ATTRIBUTE_AODISTANCE
-#define Layer_AoSoftness ATTRIBUTE_AOSOFTNESS
-#define Layer_AoBias ATTRIBUTE_AOBIAS
-#define Layer_AoSamplerate ATTRIBUTE_AOSAMPLERATE
-#define Layer_AoDither ATTRIBUTE_AODITHER
-#define Layer_ShadowStrength ATTRIBUTE_SHADOWSTRENGTH
-#define Layer_ShadowDist ATTRIBUTE_SHADOWDIST
-#define Layer_ShadowSoftness ATTRIBUTE_SHADOWSOFTNESS
-#define Layer_ShadowBias ATTRIBUTE_SHADOWBIAS
-#define Layer_LightProbe ATTRIBUTE_LIGHTPROBE
-#define Layer_ProbeBright ATTRIBUTE_PROBEBRIGHT
-#define Layer_FastIbl ATTRIBUTE_FASTIBL
-#define Layer_ProbeTheta ATTRIBUTE_PROBETHETA
-#define Layer_ProbePhi ATTRIBUTE_PROBEPHI
-#define Layer_ProbeHorizon ATTRIBUTE_PROBEHORIZON
-#define Layer_LightProbe2 ATTRIBUTE_LIGHTPROBE2
-#define Layer_Probe2Fade ATTRIBUTE_PROBE2FADE
-#define Layer_Probe2Window ATTRIBUTE_PROBE2WINDOW
-#define Layer_Probe2Pos ATTRIBUTE_PROBE2POS
-#define Layer_ProbeFov ATTRIBUTE_PROBEFOV
-#define Layer_TexturePath ATTRIBUTE_SOURCEPATH
-#define Camera_ClipNear ATTRIBUTE_CLIPNEAR
-#define Camera_ClipFar ATTRIBUTE_CLIPFAR
-#define Camera_FOV ATTRIBUTE_FOV
-#define Camera_FOVHorizontal ATTRIBUTE_FOVHORIZONTAL
-#define Camera_Orthographic ATTRIBUTE_ORTHOGRAPHIC
-#define Camera_ScaleMode ATTRIBUTE_SCALEMODE
-#define Camera_ScaleAnchor ATTRIBUTE_SCALEANCHOR
-#define Light_ImageSource ATTRIBUTE_IMAGESOURCE
-#define Light_Scope ATTRIBUTE_SCOPE
-#define Light_ImageSetsColor ATTRIBUTE_IMAGESETSCOLOR
-#define Light_ImageSetsRotation ATTRIBUTE_IMAGESETSROTATION
-#define Light_ImageHFov ATTRIBUTE_IMAGEHFOV
-#define Light_ImageIsFisheye ATTRIBUTE_IMAGEISFISHEYE
-#define Light_LightType ATTRIBUTE_LIGHTTYPE
-#define Light_DiffuseColor ATTRIBUTE_LIGHTDIFFUSE
-#define Light_DiffuseColor_R ATTRIBUTE_LIGHTDIFFUSE_R
-#define Light_DiffuseColor_G ATTRIBUTE_LIGHTDIFFUSE_G
-#define Light_DiffuseColor_B ATTRIBUTE_LIGHTDIFFUSE_B
-#define Light_DiffuseColor_A ATTRIBUTE_LIGHTDIFFUSE_A
-#define Light_SpecularColor ATTRIBUTE_LIGHTSPECULAR
-#define Light_SpecularColor_R ATTRIBUTE_LIGHTSPECULAR_R
-#define Light_SpecularColor_G ATTRIBUTE_LIGHTSPECULAR_G
-#define Light_SpecularColor_B ATTRIBUTE_LIGHTSPECULAR_B
-#define Light_SpecularColor_A ATTRIBUTE_LIGHTSPECULAR_A
-#define Light_AmbientColor ATTRIBUTE_LIGHTAMBIENT
-#define Light_AmbientColor_R ATTRIBUTE_LIGHTAMBIENT_R
-#define Light_AmbientColor_G ATTRIBUTE_LIGHTAMBIENT_G
-#define Light_AmbientColor_B ATTRIBUTE_LIGHTAMBIENT_B
-#define Light_AmbientColor_A ATTRIBUTE_LIGHTAMBIENT_A
-#define Light_Brightness ATTRIBUTE_BRIGHTNESS
-#define Light_LinearFade ATTRIBUTE_LINEARFADE
-#define Light_ExponentialFade ATTRIBUTE_EXPFADE
-#define Light_AreaWidth ATTRIBUTE_AREAWIDTH
-#define Light_AreaHeight ATTRIBUTE_AREAHEIGHT
-#define Light_CastShadow ATTRIBUTE_CASTSHADOW
-#define Light_ShadowBias ATTRIBUTE_SHDWBIAS
-#define Light_ShadowFactor ATTRIBUTE_SHDWFACTOR
-#define Light_ShadowMapRes ATTRIBUTE_SHDWMAPRES
-#define Light_ShadowMapFar ATTRIBUTE_SHDWMAPFAR
-#define Light_ShadowMapFov ATTRIBUTE_SHDWMAPFOV
-#define Light_ShadowFilter ATTRIBUTE_SHDWFILTER
-#define Model_MeshPath ATTRIBUTE_SOURCEPATH
-#define Model_ShadowCaster ATTRIBUTE_SHADOWCASTER
-#define Model_TessellationMode ATTRIBUTE_TESSELLATION
-#define Model_EdgeTess ATTRIBUTE_EDGETESS
-#define Model_InnerTess ATTRIBUTE_INNERTESS
-#define Lightmaps_LightmapIndirect ATTRIBUTE_LIGHTMAPINDIRECT
-#define Lightmaps_LightmapRadiosity ATTRIBUTE_LIGHTMAPRADIOSITY
-#define Lightmaps_LightmapShadow ATTRIBUTE_LIGHTMAPSHADOW
-#define Material_Lighting ATTRIBUTE_SHADERLIGHTING
-#define Material_BlendMode ATTRIBUTE_BLENDMODE
-#define MaterialBase_IblProbe ATTRIBUTE_IBLPROBE
-#define Material_DiffuseColor ATTRIBUTE_DIFFUSE
-#define Material_DiffuseColor_R ATTRIBUTE_DIFFUSE_R
-#define Material_DiffuseColor_G ATTRIBUTE_DIFFUSE_G
-#define Material_DiffuseColor_B ATTRIBUTE_DIFFUSE_B
-#define Material_DiffuseColor_A ATTRIBUTE_DIFFUSE_A
-#define Material_DiffuseMaps_0 ATTRIBUTE_DIFFUSEMAP
-#define Material_DiffuseMaps_1 ATTRIBUTE_DIFFUSEMAP2
-#define Material_DiffuseMaps_2 ATTRIBUTE_DIFFUSEMAP3
-#define Material_EmissivePower ATTRIBUTE_EMISSIVEPOWER
-#define Material_EmissiveColor ATTRIBUTE_EMISSIVECOLOR
-#define Material_EmissiveColor_R ATTRIBUTE_EMISSIVECOLOR_R
-#define Material_EmissiveColor_G ATTRIBUTE_EMISSIVECOLOR_G
-#define Material_EmissiveColor_B ATTRIBUTE_EMISSIVECOLOR_B
-#define Material_EmissiveColor_A ATTRIBUTE_EMISSIVECOLOR_A
-#define Material_EmissiveMap ATTRIBUTE_EMISSIVEMAP
-#define Material_EmissiveMap2 ATTRIBUTE_EMISSIVEMAP2
-#define Material_SpecularReflection ATTRIBUTE_SPECULARREFLECTION
-#define Material_SpecularMap ATTRIBUTE_SPECULARMAP
-#define Material_SpecularModel ATTRIBUTE_SPECULARMODEL
-#define Material_SpecularTint ATTRIBUTE_SPECULARTINT
-#define Material_SpecularTint_R ATTRIBUTE_SPECULARTINT_R
-#define Material_SpecularTint_G ATTRIBUTE_SPECULARTINT_G
-#define Material_SpecularTint_B ATTRIBUTE_SPECULARTINT_B
-#define Material_SpecularTint_A ATTRIBUTE_SPECULARTINT_A
-#define Material_IOR ATTRIBUTE_IOR
-#define Material_FresnelPower ATTRIBUTE_FRESNELPOWER
-#define Material_SpecularAmount ATTRIBUTE_SPECULARAMOUNT
-#define Material_SpecularRoughness ATTRIBUTE_SPECULARROUGHNESS
-#define Material_RoughnessMap ATTRIBUTE_ROUGHNESSMAP
-#define Material_Opacity ATTRIBUTE_OPACITY
-#define Material_OpacityMap ATTRIBUTE_OPACITYMAP
-#define Material_BumpAmount ATTRIBUTE_BUMPAMOUNT
-#define Material_BumpMap ATTRIBUTE_BUMPMAP
-#define Material_NormalMap ATTRIBUTE_NORMALMAP
-#define Material_DisplaceAmount ATTRIBUTE_DISPLACEAMOUNT
-#define Material_DisplacementMap ATTRIBUTE_DISPLACEMENTMAP
-#define Material_TranslucentFalloff ATTRIBUTE_TRANSLUCENTFALLOFF
-#define Material_TranslucencyMap ATTRIBUTE_TRANSLUCENCYMAP
-#define Material_DiffuseLightWrap ATTRIBUTE_DIFFUSELIGHTWRAP
-#define Material_ReferencedMaterial ATTRIBUTE_REFERENCEDMATERIAL
-#define Material_VertexColors ATTRIBUTE_VERTEXCOLORS
-#define Image_ImagePath ATTRIBUTE_SOURCEPATH
-#define Image_OffscreenRendererId ATTRIBUTE_SUBPRESENTATION
-#define Image_Scale_X ATTRIBUTE_SCALEU
-#define Image_Scale_Y ATTRIBUTE_SCALEV
-#define Image_Pivot_X ATTRIBUTE_PIVOTU
-#define Image_Pivot_Y ATTRIBUTE_PIVOTV
-#define Image_Rotation ATTRIBUTE_ROTATIONUV
-#define Image_Position_X ATTRIBUTE_POSITIONU
-#define Image_Position_Y ATTRIBUTE_POSITIONV
-#define Image_MappingMode ATTRIBUTE_MAPPINGMODE
-#define Image_HorizontalTilingMode ATTRIBUTE_TILINGMODEHORZ
-#define Image_VerticalTilingMode ATTRIBUTE_TILINGMODEVERT
-#define Text_Text ATTRIBUTE_TEXTSTRING
-#define Text_Font ATTRIBUTE_FONT
-#define Text_FontSize ATTRIBUTE_SIZE
-#define Text_HorizontalAlignment ATTRIBUTE_HORZALIGN
-#define Text_VerticalAlignment ATTRIBUTE_VERTALIGN
-#define Text_Leading ATTRIBUTE_LEADING
-#define Text_Tracking ATTRIBUTE_TRACKING
-#define Text_DropShadow ATTRIBUTE_DROPSHADOW
-#define Text_DropShadowStrength ATTRIBUTE_DROPSHADOWSTRENGTH
-#define Text_DropShadowOffsetX ATTRIBUTE_DROPSHADOWOFFSETX
-#define Text_DropShadowOffsetY ATTRIBUTE_DROPSHADOWOFFSETY
-#define Text_WordWrap ATTRIBUTE_WORDWRAP
-#define Text_BoundingBox ATTRIBUTE_BOUNDINGBOX
-#define Text_BoundingBox_X ATTRIBUTE_BOUNDINGBOX_X
-#define Text_BoundingBox_Y ATTRIBUTE_BOUNDINGBOX_Y
-#define Text_Elide ATTRIBUTE_ELIDE
-#define Text_TextColor ATTRIBUTE_TEXTCOLOR
-#define Text_TextColor_R ATTRIBUTE_TEXTCOLOR_R
-#define Text_TextColor_G ATTRIBUTE_TEXTCOLOR_G
-#define Text_TextColor_B ATTRIBUTE_TEXTCOLOR_B
-#define Text_TextColor_A ATTRIBUTE_TEXTCOLOR_A
-#define Text_BackColor_R ATTRIBUTE_BACKCOLOR_R
-#define Text_BackColor_G ATTRIBUTE_BACKCOLOR_G
-#define Text_BackColor_B ATTRIBUTE_BACKCOLOR_B
-#define Text_BackColor_A ATTRIBUTE_BACKCOLOR_A
-#define Text_UseBackColor ATTRIBUTE_USEBACKCOLOR
-#define Text_EnableAcceleratedFont ATTRIBUTE_ENABLEACCELERATEDFONT
-#define Path_PathType ATTRIBUTE_PATHTYPE
-#define Path_Width ATTRIBUTE_WIDTH
-#define Path_LinearError ATTRIBUTE_LINEARERROR
-#define Path_EdgeTessAmount ATTRIBUTE_EDGETESSAMOUNT
-#define Path_InnerTessAmount ATTRIBUTE_INNERTESSAMOUNT
-#define Path_BeginCapping ATTRIBUTE_BEGINCAP
-#define Path_BeginCapOffset ATTRIBUTE_BEGINCAPOFFSET
-#define Path_BeginCapOpacity ATTRIBUTE_BEGINCAPOPACITY
-#define Path_BeginCapWidth ATTRIBUTE_BEGINCAPWIDTH
-#define Path_EndCapping ATTRIBUTE_ENDCAP
-#define Path_EndCapOffset ATTRIBUTE_ENDCAPOFFSET
-#define Path_EndCapOpacity ATTRIBUTE_ENDCAPOPACITY
-#define Path_EndCapWidth ATTRIBUTE_ENDCAPWIDTH
-#define Path_PaintStyle ATTRIBUTE_PAINTSTYLE
-#define Path_PathBuffer ATTRIBUTE_SOURCEPATH
-#define SubPath_Closed ATTRIBUTE_CLOSED
-
-// Fill in implementations for the actual parse tables.
-#define HANDLE_QT3DS_RENDER_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_RENDER_VEC3_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name##_X: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.x); \
- break; \
- case Q3DStudio::type##_##name##_Y: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.y); \
- break; \
- case Q3DStudio::type##_##name##_Z: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.z); \
- break;
-
-#define HANDLE_QT3DS_RENDER_REAL_VEC2_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name##_X: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.x); \
- break; \
- case Q3DStudio::type##_##name##_Y: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.y); \
- break;
-
-#define HANDLE_QT3DS_RENDER_COLOR_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name##_R: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.x); \
- break; \
- case Q3DStudio::type##_##name##_G: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.y); \
- break; \
- case Q3DStudio::type##_##name##_B: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.z); \
- break; \
- case Q3DStudio::type##_##name##_A: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.w); \
- break;
-
-#define HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_RENDER_TRANSFORM_VEC3_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_RENDER_RADIAN_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseRadianProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-// The runtime converts rotations for us.
-#define HANDLE_QT3DS_RENDER_VEC3_RADIAN_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name##_X: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.x); \
- break; \
- case Q3DStudio::type##_##name##_Y: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.y); \
- break; \
- case Q3DStudio::type##_##name##_Z: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.z); \
- break;
-
-#define HANDLE_QT3DS_RENDER_OPACITY_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseOpacityProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_ROTATION_ORDER_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseRotationOrder<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_NODE_ORIENTATION_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseOrientation<Qt3DSRenderDirtyFlags::dirty>(theItem.m_Flags); \
- break;
-
-#define HANDLE_QT3DS_RENDER_DEPTH_TEST_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseInverseBoolean<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_NODE_FLAGS_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseNodeFlagsProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_Flags, \
- NodeFlagValues::name); \
- break;
-
-#define HANDLE_QT3DS_NODE_FLAGS_INVERSE_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseNodeFlagsInverseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_Flags, \
- NodeFlagValues::name); \
- break;
-
-#define HANDLE_QT3DS_RENDER_ENUM_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseEnumProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name: \
- inParser.ParseAndResolveSourcePath<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name); \
- break;
-
-#define HANDLE_QT3DS_RENDER_ARRAY_PROPERTY(type, name, index, dirty) \
- case Q3DStudio::type##_##name##_##index: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name[index]); \
- break;
-
-#define HANDLE_QT3DS_RENDER_VEC2_PROPERTY(type, name, dirty) \
- case Q3DStudio::type##_##name##_X: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.x); \
- break; \
- case Q3DStudio::type##_##name##_Y: \
- inParser.ParseProperty<Qt3DSRenderDirtyFlags::dirty>(theItem.m_##name.y); \
- break;
-
-struct SSceneTranslator : public Qt3DSTranslator
-{
- typedef SScene TNodeType;
- SSceneTranslator(Q3DStudio::TElement &inElement, SScene &inRenderObject)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- }
- // Ignored, scenes are always active
- void SetActive(bool /*inElementActive*/) {}
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SScene &theItem = *static_cast<SScene *>(m_RenderObject);
-
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_SCENE_PROPERTIES
- // These are ignored by the renderer
- case Q3DStudio::ATTRIBUTE_NAME:
- case Q3DStudio::ATTRIBUTE_STARTTIME:
- case Q3DStudio::ATTRIBUTE_ENDTIME:
- case Q3DStudio::ATTRIBUTE_IMPORTID:
- case Q3DStudio::ATTRIBUTE_EYEBALL:
- break;
- default:
- // Unknown attribute
- // QT3DS_ASSERT( false );
- break;
- }
- }
- void PostPropertyChanged(const SRuntimePropertyParser &, Q3DStudio::IPresentation &) {}
-};
-
-struct SNodeTranslator : public Qt3DSTranslator
-{
- typedef SNode TNodeType;
- SNodeTranslator(Q3DStudio::TElement &inElement, SNode &inRenderObject)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- SNode &theItem = *static_cast<SNode *>(m_RenderObject);
- theItem.m_Flags.SetLocallyPickable(false);
- }
- void SetActive(bool inElementActive)
- {
- SNode &theItem = *static_cast<SNode *>(m_RenderObject);
- if (theItem.m_Flags.IsActive() != inElementActive) {
- theItem.m_Flags.SetActive(inElementActive);
- theItem.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- }
- }
-
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SNode &theItem = *static_cast<SNode *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_NODE_PROPERTIES
- case Q3DStudio::ATTRIBUTE_NAME:
- case Q3DStudio::ATTRIBUTE_STARTTIME:
- case Q3DStudio::ATTRIBUTE_ENDTIME:
- case Q3DStudio::ATTRIBUTE_IMPORTID:
- case Q3DStudio::ATTRIBUTE_EYEBALL:
- // Groups have a source path property on them that we like to ignore.
- case Q3DStudio::ATTRIBUTE_SOURCEPATH:
- break;
- default:
- // Unknown attribute
- // QT3DS_ASSERT( false );
- break;
- }
- }
- void PostPropertyChanged(const SRuntimePropertyParser &inParser,
- Q3DStudio::IPresentation & /*inStudioPresentation*/)
- {
- SNode &theItem = *static_cast<SNode *>(m_RenderObject);
- if (inParser.m_TransformDirty)
- theItem.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- else if (inParser.m_Dirty)
- theItem.MarkDirty(NodeTransformDirtyFlag::TransformNotDirty);
- if (inParser.m_TextDirty)
- theItem.m_Flags.SetTextDirty(true);
- SetActive(Element().GetActive());
- bool isNodePickable = m_Element->IsPickEnabled();
- if (theItem.m_Flags.IsLocallyPickable() != isNodePickable) {
- theItem.m_Flags.SetLocallyPickable(isNodePickable);
- theItem.MarkDirty(NodeTransformDirtyFlag::TransformNotDirty);
- }
- }
-};
-
-struct SLayerTranslator : public SNodeTranslator
-{
- typedef SLayer TNodeType;
- SLayerTranslator(Q3DStudio::TElement &inElement, SLayer &inRenderObject)
- : SNodeTranslator(inElement, inRenderObject)
- {
- }
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- const char *propName =
- Q3DStudio::GetAttributeString((Q3DStudio::EAttribute)inParser.m_PropertyName);
- (void)propName;
- SLayer &theItem = *static_cast<SLayer *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_LAYER_PROPERTIES
- // Ignored
- default:
- SNodeTranslator::OnSpecificPropertyChange(inParser);
- }
- }
-};
-
-struct SLightTranslator : public SNodeTranslator
-{
- typedef SLight TNodeType;
- SLightTranslator(Q3DStudio::TElement &inElement, SLight &inRenderObject)
- : SNodeTranslator(inElement, inRenderObject)
- {
- }
-
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SLight &theItem = *static_cast<SLight *>(m_RenderObject);
- // I guess there is no switching of light type in the runtime right now.
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_LIGHT_PROPERTIES
- default:
- SNodeTranslator::OnSpecificPropertyChange(inParser);
- break;
- }
- }
-};
-struct SCameraTranslator : public SNodeTranslator
-{
- typedef SCamera TNodeType;
- SCameraTranslator(Q3DStudio::TElement &inElement, SCamera &inRenderObject)
- : SNodeTranslator(inElement, inRenderObject)
- {
- }
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SCamera &theItem = *static_cast<SCamera *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_CAMERA_PROPERTIES
- default:
- SNodeTranslator::OnSpecificPropertyChange(inParser);
- break;
- }
- }
-};
-
-struct SModelTranslator : public SNodeTranslator
-{
- typedef SModel TNodeType;
- SModelTranslator(Q3DStudio::TElement &inElement, SModel &inRenderObject)
- : SNodeTranslator(inElement, inRenderObject)
- {
- }
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SModel &theItem = *static_cast<SModel *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_MODEL_PROPERTIES
- default:
- SNodeTranslator::OnSpecificPropertyChange(inParser);
- break;
- }
- }
-};
-
-struct SPathTranslator : public SNodeTranslator
-{
- typedef SPath TNodeType;
- SPathTranslator(Q3DStudio::TElement &inElement, SPath &inRenderObject)
- : SNodeTranslator(inElement, inRenderObject)
- {
- }
-
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SPath &theItem = *static_cast<SPath *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_PATH_PROPERTIES
- default:
- SNodeTranslator::OnSpecificPropertyChange(inParser);
- break;
- }
- }
-};
-
-struct SPathSubPathTranslator : public Qt3DSTranslator
-{
-
- typedef SPathSubPath TNodeType;
-
- SPathSubPathTranslator(Q3DStudio::TElement &inElement, SPathSubPath &inRenderObject)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- }
-
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SPathSubPath &theItem = *static_cast<SPathSubPath *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_PATH_SUBPATH_PROPERTIES
- default:
- break;
- }
- }
-
- void PostPropertyChanged(const SRuntimePropertyParser &inParser,
- Q3DStudio::IPresentation & /*inStudioPresentation*/)
- {
- SPathSubPath &theItem = *static_cast<SPathSubPath *>(m_RenderObject);
- qt3ds::render::IPathManager &theManager = inParser.m_RenderContext.GetPathManager();
- QT3DSU32 numAnchors = 0;
- bool updatePath = false;
- CRegisteredString theAnchorType =
- inParser.m_RenderContext.GetStringTable().RegisterStr("PathAnchorPoint");
- for (Q3DStudio::TElement *theChild = Element().GetChild(); theChild;
- theChild = theChild->GetSibling()) {
- if (theChild->GetType() == theAnchorType) {
- ++numAnchors;
- if (theChild->IsDirty())
- updatePath = true;
- }
- }
- if (updatePath) {
- NVDataRef<qt3ds::render::SPathAnchorPoint> thePathBuffer =
- theManager.ResizePathSubPathBuffer(theItem, numAnchors);
- if (thePathBuffer.size()) {
- QT3DSU32 anchorIndex = 0;
- for (Q3DStudio::TElement *theChild = Element().GetChild(); theChild;
- theChild = theChild->GetSibling()) {
- if (theChild->GetType() == theAnchorType) {
- if (theChild->IsDirty()) {
- qt3ds::render::SPathAnchorPoint &thePoint(thePathBuffer[anchorIndex]);
-
- for (QT3DSI32 idx = 0, end = theChild->GetAttributeCount(); idx < end;
- ++idx) {
- qt3ds::runtime::element::TPropertyDescAndValuePtr thePropInfo =
- theChild->GetPropertyByIndex(idx);
- switch (thePropInfo.first.GetNameHash()) {
- case Q3DStudio::ATTRIBUTE_POSITION_X:
- thePoint.m_Position.x = thePropInfo.second->m_FLOAT;
- break;
- case Q3DStudio::ATTRIBUTE_POSITION_Y:
- thePoint.m_Position.y = thePropInfo.second->m_FLOAT;
- break;
- case Q3DStudio::ATTRIBUTE_INCOMINGANGLE:
- thePoint.m_IncomingAngle = thePropInfo.second->m_FLOAT;
- thePoint.m_OutgoingAngle = thePoint.m_IncomingAngle + 180.0f;
- break;
- case Q3DStudio::ATTRIBUTE_INCOMINGDISTANCE:
- thePoint.m_IncomingDistance = thePropInfo.second->m_FLOAT;
- break;
- case Q3DStudio::ATTRIBUTE_OUTGOINGDISTANCE:
- thePoint.m_OutgoingDistance = thePropInfo.second->m_FLOAT;
- break;
- default: // ignored
- break;
- }
- }
- }
- ++anchorIndex;
- }
- }
- }
- }
- }
-};
-
-struct SDefaultMaterialTranslator : public Qt3DSTranslator
-{
- typedef SDefaultMaterial TNodeType;
- SDefaultMaterialTranslator(Q3DStudio::TElement &inElement, SDefaultMaterial &inRenderObject)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- }
- // Right now materials do not respect the active flag
- void SetActive(bool) {}
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SDefaultMaterial &theItem = *static_cast<SDefaultMaterial *>(m_RenderObject);
- // There is no render-time caching on a material, so the dirty flag doesn't do much.
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_MATERIAL_PROPERTIES
-
- case Q3DStudio::ATTRIBUTE_NAME:
- case Q3DStudio::ATTRIBUTE_STARTTIME:
- case Q3DStudio::ATTRIBUTE_ENDTIME:
- case Q3DStudio::ATTRIBUTE_IMPORTID:
- case Q3DStudio::ATTRIBUTE_EYEBALL:
- case Q3DStudio::ATTRIBUTE_SOURCEPATH:
- break;
- default:
- // Unknown attribute
- // QT3DS_ASSERT( false );
- break;
- }
- }
-
- void PostPropertyChanged(const SRuntimePropertyParser &, Q3DStudio::IPresentation &)
- {
- SDefaultMaterial &theItem = *static_cast<SDefaultMaterial *>(m_RenderObject);
- theItem.m_Dirty.SetDirty();
- }
-};
-
-struct SImageTranslator : public Qt3DSTranslator
-{
- typedef SImage TNodeType;
- SImageTranslator(Q3DStudio::TElement &inElement, SImage &inRenderObject)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- }
-
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SImage &theItem = *static_cast<SImage *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_IMAGE_PROPERTIES
- case Q3DStudio::ATTRIBUTE_STARTTIME:
- case Q3DStudio::ATTRIBUTE_ENDTIME:
- case Q3DStudio::ATTRIBUTE_NAME:
- case Q3DStudio::ATTRIBUTE_EYEBALL:
- break;
- default:
- // Unknown attribute
- // QT3DS_ASSERT( false );
- break;
- }
- }
- void PostPropertyChanged(const SRuntimePropertyParser &inParser, Q3DStudio::IPresentation &)
- {
- SImage &theItem = *static_cast<SImage *>(m_RenderObject);
- if (inParser.m_Dirty)
- theItem.m_Flags.SetDirty(true);
- if (inParser.m_TransformDirty)
- theItem.m_Flags.SetTransformDirty(true);
- }
-};
-
-struct SReferencedMaterialTranslator : public Qt3DSTranslator
-{
- typedef SReferencedMaterial TNodeType;
- SReferencedMaterialTranslator(Q3DStudio::TElement &inElement, TNodeType &inRenderObject)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- }
-
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- TNodeType &theItem = *static_cast<TNodeType *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_REFERENCED_MATERIAL_PROPERTIES
- case Q3DStudio::ATTRIBUTE_STARTTIME:
- case Q3DStudio::ATTRIBUTE_ENDTIME:
- case Q3DStudio::ATTRIBUTE_NAME:
- case Q3DStudio::ATTRIBUTE_EYEBALL:
- break;
- default:
- // Unknown attribute
- // QT3DS_ASSERT( false );
- break;
- }
- }
- void PostPropertyChanged(const SRuntimePropertyParser &inParser, Q3DStudio::IPresentation &)
- {
- TNodeType &theItem = *static_cast<TNodeType *>(m_RenderObject);
- if (inParser.m_Dirty)
- theItem.m_Dirty.SetDirty();
- }
-};
-
-struct STextTranslator : public SNodeTranslator
-{
- typedef SText TNodeType;
- STextTranslator(Q3DStudio::TElement &inElement, SText &inRenderObject)
- : SNodeTranslator(inElement, inRenderObject)
- {
- }
- void OnSpecificPropertyChange(SRuntimePropertyParser &inParser)
- {
- SText &theItem = *static_cast<SText *>(m_RenderObject);
- switch (inParser.m_PropertyName) {
- ITERATE_QT3DS_RENDER_TEXT_PROPERTIES
- case Q3DStudio::ATTRIBUTE_TEXTTYPE:
- case Q3DStudio::ATTRIBUTE_RENDERSTYLE:
- case Q3DStudio::ATTRIBUTE_HORZSCROLL:
- case Q3DStudio::ATTRIBUTE_VERTSCROLL:
- case Q3DStudio::ATTRIBUTE_BOXHEIGHT:
- case Q3DStudio::ATTRIBUTE_BOXWIDTH:
- case Q3DStudio::ATTRIBUTE_REMOTESTRINGSOURCE:
- case Q3DStudio::ATTRIBUTE_CACHEDTEXTSTRING:
- // These text properties are ignored for now.
- break;
- default:
- SNodeTranslator::OnSpecificPropertyChange(inParser);
- break;
- }
- }
-};
-
-struct SEffectPropertyEntry
-{
- Q3DStudio::EAttributeType m_AttributeType;
- QT3DSU32 m_PropertyOffset; // offset into the property array for the property def
- QT3DSU32 m_DataOffset;
- SEffectPropertyEntry(Q3DStudio::EAttributeType attType, QT3DSU32 poff, QT3DSU32 doff = 0)
- : m_AttributeType(attType)
- , m_PropertyOffset(poff)
- , m_DataOffset(doff)
- {
- }
-};
-
-struct SDynamicObjectTranslatorContext : public STranslatorContext
-{
- typedef nvhash_map<Q3DStudio::INT32, SEffectPropertyEntry> THashToOffsetMap;
- THashToOffsetMap m_PropertyHashes;
- NVAllocatorCallback &m_Allocator;
- Qt3DSString m_Workspace;
- SDynamicObjectTranslatorContext(NVAllocatorCallback &inCallback)
- : m_PropertyHashes(inCallback, "SEffectTranslatorContext::PropertyHashes")
- , m_Allocator(inCallback)
- {
- }
- ~SDynamicObjectTranslatorContext() {}
- void AddEffectExtendedProperty(const qt3ds::render::dynamic::SPropertyDefinition &thePropDef,
- const char *inExtension, Q3DStudio::EAttributeType inType,
- Qt3DSString &ioStringBuilder, QT3DSU32 inOffset, QT3DSU32 dataOffset)
- {
- ioStringBuilder.fromUtf8(thePropDef.m_Name.c_str());
- ioStringBuilder.append(inExtension);
- Q3DStudio::INT32 theHash = Q3DStudio::CHash::HashAttribute(
- ioStringBuilder.toUtf8().constData());
- m_PropertyHashes.insert(
- eastl::make_pair(theHash, SEffectPropertyEntry(inType, inOffset, dataOffset)));
- }
- void BuildPropertyHashes(NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> inProperties)
- {
- if (m_PropertyHashes.size() == 0) {
- qt3ds::foundation::Qt3DSString theNameBuilder;
- for (QT3DSU32 idx = 0, end = inProperties.size(); idx < end; ++idx) {
- const qt3ds::render::dynamic::SPropertyDefinition &thePropDef = inProperties[idx];
- switch (thePropDef.m_DataType) {
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSF32:
- m_PropertyHashes.insert(eastl::make_pair(
- Q3DStudio::CHash::HashAttribute(thePropDef.m_Name.c_str()),
- SEffectPropertyEntry(Q3DStudio::ATTRIBUTETYPE_FLOAT, idx)));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSRenderBool:
- m_PropertyHashes.insert(
- eastl::make_pair(Q3DStudio::CHash::HashAttribute(thePropDef.m_Name.c_str()),
- SEffectPropertyEntry(Q3DStudio::ATTRIBUTETYPE_BOOL, idx)));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSI32:
- if (thePropDef.m_IsEnumProperty == false) {
- m_PropertyHashes.insert(eastl::make_pair(
- Q3DStudio::CHash::HashAttribute(thePropDef.m_Name.c_str()),
- SEffectPropertyEntry(Q3DStudio::ATTRIBUTETYPE_INT32, idx)));
- } else {
- m_PropertyHashes.insert(eastl::make_pair(
- Q3DStudio::CHash::HashAttribute(thePropDef.m_Name.c_str()),
- SEffectPropertyEntry(Q3DStudio::ATTRIBUTETYPE_STRING, idx)));
- }
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec2:
- AddEffectExtendedProperty(thePropDef, ".x", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".y", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec3:
- AddEffectExtendedProperty(thePropDef, ".x", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".y", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".z", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 2 * sizeof(QT3DSF32));
-
- AddEffectExtendedProperty(thePropDef, ".r", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".g", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".b", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 2 * sizeof(QT3DSF32));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4:
- AddEffectExtendedProperty(thePropDef, ".x", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".y", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".z", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 2 * sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".w", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 3 * sizeof(QT3DSF32));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr:
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderImage2DPtr:
- m_PropertyHashes.insert(eastl::make_pair(
- Q3DStudio::CHash::HashAttribute(thePropDef.m_Name.c_str()),
- SEffectPropertyEntry(Q3DStudio::ATTRIBUTETYPE_STRING, idx)));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderDataBufferPtr:
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- }
- }
- void ApplyChanges(SPresentation &inPresentation, IQt3DSRenderContext &inRenderContext,
- SDynamicObject &inObject, Q3DStudio::TElement &element,
- IDynamicObjectSystem &inSystem)
- {
- if (element.GetActive()) {
- NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> theProperties =
- inSystem.GetProperties(inObject.m_ClassName);
- BuildPropertyHashes(theProperties);
- SDynamicObject &theItem(inObject);
- for (long idx = 0, end = element.GetAttributeCount(); idx < end; ++idx) {
- qt3ds::runtime::element::TPropertyDescAndValuePtr thePropInfo =
- *element.GetPropertyByIndex(idx);
- THashToOffsetMap::iterator theFind =
- m_PropertyHashes.find(thePropInfo.first.GetNameHash());
- if (theFind != m_PropertyHashes.end()) {
- const SEffectPropertyEntry &theEntry(theFind->second);
- const qt3ds::render::dynamic::SPropertyDefinition &theDefinition(
- theProperties[theEntry.m_PropertyOffset]);
- if (theEntry.m_AttributeType
- == (Q3DStudio::EAttributeType)thePropInfo.first.m_Type) {
- switch (theEntry.m_AttributeType) {
- case Q3DStudio::ATTRIBUTETYPE_BOOL:
- theItem.SetPropertyValue(theDefinition,
- thePropInfo.second->m_INT32 ? true : false);
- break;
- case Q3DStudio::ATTRIBUTETYPE_FLOAT:
- theItem.SetPropertyValue(theDefinition, thePropInfo.second->m_FLOAT,
- theEntry.m_DataOffset);
- break;
- case Q3DStudio::ATTRIBUTETYPE_INT32:
- theItem.SetPropertyValue(theDefinition,
- (QT3DSI32)thePropInfo.second->m_INT32);
- break;
- case Q3DStudio::ATTRIBUTETYPE_STRING: {
- CRegisteredString theStr =
- element.GetBelongedPresentation()->GetStringTable().HandleToStr(
- thePropInfo.second->m_StringHandle);
- theItem.SetPropertyValue(theDefinition, theStr.c_str(),
- inPresentation.m_PresentationDirectory.c_str(),
- m_Workspace, inRenderContext.GetStringTable());
- } break;
- default:
- // QT3DS_ASSERT( false );
- break;
- }
- } else {
- // QT3DS_ASSERT( false );
- }
- }
- }
- theItem.m_Flags.SetDirty(true);
- }
- }
-};
-
-struct SEffectTranslator : public Qt3DSTranslator
-{
- typedef SEffect TNodeType;
- SEffectTranslator(Q3DStudio::TElement &inElement, SEffect &inRenderObject,
- NVAllocatorCallback &inCallback)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- m_TranslatorContext = QT3DS_NEW(inCallback, SDynamicObjectTranslatorContext)(inCallback);
- }
-
- void OnElementChanged(SPresentation &inPresentation, IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &)
- {
- SRuntimePropertyParser theParser(inPresentation, inRenderContext, *m_Element);
- SEffect &theItem = *static_cast<SEffect *>(m_RenderObject);
- static_cast<SDynamicObjectTranslatorContext *>(m_TranslatorContext)
- ->ApplyChanges(inPresentation, inRenderContext, theItem, Element(),
- inRenderContext.GetDynamicObjectSystem());
- theItem.SetActive(Element().GetActive(), inRenderContext.GetEffectSystem());
- }
-};
-
-struct SCustomMaterialTranslator : public Qt3DSTranslator
-{
- typedef SCustomMaterial TNodeType;
- SCustomMaterialTranslator(Q3DStudio::TElement &inElement, SCustomMaterial &inRenderObject,
- NVAllocatorCallback &inCallback)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- m_TranslatorContext = QT3DS_NEW(inCallback, SDynamicObjectTranslatorContext)(inCallback);
- }
-
- void OnElementChanged(SPresentation &inPresentation, IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &)
- {
- SRuntimePropertyParser theParser(inPresentation, inRenderContext, *m_Element);
- SCustomMaterial &theItem = *static_cast<SCustomMaterial *>(m_RenderObject);
- static_cast<SDynamicObjectTranslatorContext *>(m_TranslatorContext)
- ->ApplyChanges(inPresentation, inRenderContext, theItem, Element(),
- inRenderContext.GetDynamicObjectSystem());
- bool active = m_Element->GetActive();
- if (active != theItem.m_Flags.IsActive()) {
- theItem.m_Flags.SetActive(active);
- ICustomMaterialSystem &theSystem(inRenderContext.GetCustomMaterialSystem());
- theSystem.OnMaterialActivationChange(theItem, active);
- }
- }
-};
-
-struct SRenderPluginTranslatorContext : public STranslatorContext
-{
- NVAllocatorCallback &m_Allocator;
- nvhash_map<int, CRegisteredString> m_AttribHashIndexMap;
- nvvector<SRenderPropertyValueUpdate> m_PropertyUpdates;
- SRenderPluginTranslatorContext(NVAllocatorCallback &alloc)
- : m_Allocator(alloc)
- , m_AttribHashIndexMap(alloc, "SRenderPluginTranslatorContext::AttribIndexMap")
- , m_PropertyUpdates(alloc, "SRenderPluginTranslatorContext::m_PropertyUpdates")
- {
- }
- void ReverseMap(CRegisteredString str)
- {
- m_AttribHashIndexMap.insert(
- eastl::make_pair(Q3DStudio::CHash::HashAttribute(str.c_str()), str));
- }
-};
-
-struct SRenderPluginTranslator : public Qt3DSTranslator
-{
- typedef SRenderPlugin TNodeType;
- SRenderPluginTranslator(Q3DStudio::TElement &inElement, SRenderPlugin &inRenderObject,
- NVAllocatorCallback &inCallback)
- : Qt3DSTranslator(inElement, inRenderObject)
- {
- m_TranslatorContext = QT3DS_NEW(inCallback, SRenderPluginTranslatorContext)(inCallback);
- }
-
- void OnElementChanged(SPresentation & /*inPresentation*/, IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &)
- {
- SRenderPlugin &theItem = *static_cast<SRenderPlugin *>(m_RenderObject);
- theItem.m_Flags.SetActive(Element().GetActive());
- IRenderPluginInstance *theInstance =
- inRenderContext.GetRenderPluginManager().GetOrCreateRenderPluginInstance(
- theItem.m_PluginPath, &theItem);
- if (theInstance != NULL) {
- IRenderPluginClass &theClass(theInstance->GetPluginClass());
- SRenderPluginTranslatorContext &theTransContext =
- static_cast<SRenderPluginTranslatorContext &>(*m_TranslatorContext);
- if (theTransContext.m_AttribHashIndexMap.empty()) {
- NVConstDataRef<SRenderPluginPropertyDeclaration> theProperties(
- theClass.GetRegisteredProperties());
- for (QT3DSU32 idx = 0, end = theProperties.size(); idx < end; ++idx) {
- const SRenderPluginPropertyDeclaration &theDec(theProperties[idx]);
- switch (theDec.m_Type) {
- case SRenderPluginPropertyTypes::Boolean:
- theTransContext.ReverseMap(theDec.m_Name);
- break;
- case SRenderPluginPropertyTypes::Float:
- theTransContext.ReverseMap(theDec.m_Name);
- break;
- case SRenderPluginPropertyTypes::Long:
- theTransContext.ReverseMap(theDec.m_Name);
- break;
- case SRenderPluginPropertyTypes::String:
- theTransContext.ReverseMap(theDec.m_Name);
- break;
- case SRenderPluginPropertyTypes::Vector2:
- theTransContext.ReverseMap(
- theClass.GetPropertyValueInfo(theDec.m_StartOffset).first);
- theTransContext.ReverseMap(
- theClass.GetPropertyValueInfo(theDec.m_StartOffset + 1).first);
- break;
- case SRenderPluginPropertyTypes::Vector3:
- case SRenderPluginPropertyTypes::Color:
- theTransContext.ReverseMap(
- theClass.GetPropertyValueInfo(theDec.m_StartOffset).first);
- theTransContext.ReverseMap(
- theClass.GetPropertyValueInfo(theDec.m_StartOffset + 1).first);
- theTransContext.ReverseMap(
- theClass.GetPropertyValueInfo(theDec.m_StartOffset + 2).first);
- break;
- default:
- // QT3DS_ASSERT( false );
- break;
- }
- }
- } // ok, now we have an efficient mapping from attribute to plugin value name.
- theTransContext.m_PropertyUpdates.clear();
- for (long idx = 0, end = Element().GetAttributeCount(); idx < end; ++idx) {
- qt3ds::runtime::element::TPropertyDescAndValuePtr thePropInfo =
- *Element().GetPropertyByIndex(idx);
- nvhash_map<int, CRegisteredString>::iterator theFind =
- theTransContext.m_AttribHashIndexMap.find(thePropInfo.first.GetNameHash());
- if (theFind != theTransContext.m_AttribHashIndexMap.end()) {
- CRegisteredString thePropName(theFind->second);
- Q3DStudio::EAttributeType theType =
- (Q3DStudio::EAttributeType)thePropInfo.first.m_Type;
- switch (theType) {
- case Q3DStudio::ATTRIBUTETYPE_BOOL:
- theTransContext.m_PropertyUpdates.push_back(SRenderPropertyValueUpdate(
- thePropName, thePropInfo.second->m_INT32 ? true : false));
- break;
- case Q3DStudio::ATTRIBUTETYPE_FLOAT:
- theTransContext.m_PropertyUpdates.push_back(
- SRenderPropertyValueUpdate(thePropName, thePropInfo.second->m_FLOAT));
- break;
- case Q3DStudio::ATTRIBUTETYPE_INT32:
- theTransContext.m_PropertyUpdates.push_back(SRenderPropertyValueUpdate(
- thePropName, (QT3DSI32)thePropInfo.second->m_INT32));
- break;
- case Q3DStudio::ATTRIBUTETYPE_STRING: {
- CRegisteredString theStr = inRenderContext.GetStringTable().HandleToStr(
- thePropInfo.second->m_StringHandle);
- theTransContext.m_PropertyUpdates.push_back(
- SRenderPropertyValueUpdate(thePropName, theStr));
- } break;
- default:
- // QT3DS_ASSERT( false );
- break;
- }
- }
- }
- if (theTransContext.m_PropertyUpdates.empty() == false) {
- theInstance->Update(toConstDataRef(theTransContext.m_PropertyUpdates.data(),
- theTransContext.m_PropertyUpdates.size()));
- }
- }
- }
-};
-}
-
-Qt3DSTranslator::Qt3DSTranslator(Q3DStudio::TElement &inElement, SGraphObject &inRenderObject)
- : m_DirtyIndex(QT3DS_MAX_U32)
- , m_Element(&inElement)
- , m_RenderObject(&inRenderObject)
- , m_TranslatorContext(NULL)
-{
- Element().SetAssociation(reinterpret_cast<void *>(this));
- inRenderObject.m_UserData = STaggedPointer(this);
-}
-
-void Qt3DSTranslator::Save(SWriteBuffer &inWriteBuffer, QT3DSU32 inGraphObjectOffset)
-{
- // We have to start on pointer aligned boundaries.
- QT3DS_ASSERT(inWriteBuffer.size() % 4 == 0);
- QT3DSU32 theOffset = inWriteBuffer.size();
- inWriteBuffer.write(*this);
- Qt3DSTranslator *theNewTranslator =
- reinterpret_cast<Qt3DSTranslator *>(inWriteBuffer.begin() + theOffset);
- theNewTranslator->m_DirtyIndex = QT3DS_MAX_U32;
- if (theNewTranslator->m_Element)
- theNewTranslator->m_Element = m_Element->GetBelongedPresentation()
- ->GetApplication()
- .GetElementAllocator()
- .GetRemappedElementAddress(m_Element);
- size_t *graphObjPtr = reinterpret_cast<size_t *>(&theNewTranslator->m_RenderObject);
- *graphObjPtr = inGraphObjectOffset;
-}
-
-Qt3DSTranslator *Qt3DSTranslator::GetTranslatorFromGraphNode(SGraphObject &inObject)
-{
- return inObject.m_UserData.DynamicCast<Qt3DSTranslator>();
-}
-
-namespace {
-struct SPresentationTranslator;
-struct SEffectTranslator;
-template <typename TTranslatorType>
-struct STranslatorCreator
-{
- static TTranslatorType *Create(Q3DStudio::TElement &inElement, SGraphObject &inObject,
- NVAllocatorCallback &inAllocator)
- {
- typedef typename TTranslatorType::TNodeType TNodeType;
- // This assert needs to be here because we serialize all translators generically without
- // regard for type.
- StaticAssert<sizeof(TTranslatorType) == sizeof(Qt3DSTranslator)>::valid_expression();
- return QT3DS_NEW(inAllocator, TTranslatorType)(inElement, static_cast<TNodeType &>(inObject));
- }
- static void InitializeTranslator(Qt3DSTranslator &inTranslator, NVAllocatorCallback &)
- {
- typedef typename TTranslatorType::TNodeType TNodeType;
- // Initialize the vtable.
- new (&inTranslator) TTranslatorType(inTranslator.Element(),
- static_cast<TNodeType &>(inTranslator.RenderObject()));
- }
-
- static void OnElementChanged(Qt3DSTranslator &inTranslator, SPresentation &inPresentation,
- IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &inStudioPresentation)
- {
- TTranslatorType &theTranslator(static_cast<TTranslatorType &>(inTranslator));
- SRuntimePropertyParser theParser(inPresentation, inRenderContext, *theTranslator.m_Element);
- if (theTranslator.Element().GetActive()) {
- // Don't push properties from inactive elements.
- for (long idx = 0, end = theTranslator.Element().GetAttributeCount(); idx < end;
- ++idx) {
- qt3ds::runtime::element::TPropertyDescAndValuePtr thePropInfo =
- *theTranslator.Element().GetPropertyByIndex(idx);
- theParser.Setup(thePropInfo.first.GetNameHash(), *thePropInfo.second,
- (Q3DStudio::EAttributeType)thePropInfo.first.m_Type);
- // right now, this is the best we can do because the attribute's dirty system
- // is all jacked up.
- theTranslator.OnSpecificPropertyChange(theParser);
- }
- // same for dynamic properties
- for (long idx = 0, end = theTranslator.Element().GetDynamicAttributeCount(); idx < end;
- ++idx) {
- qt3ds::runtime::element::TPropertyDescAndValuePtr thePropInfo =
- *theTranslator.Element().GetDynamicPropertyByIndex(idx);
- theParser.Setup(thePropInfo.first.GetNameHash(), *thePropInfo.second,
- (Q3DStudio::EAttributeType)thePropInfo.first.m_Type);
- // right now, this is the best we can do because the attribute's dirty system
- // is all jacked up.
- theTranslator.OnSpecificPropertyChange(theParser);
- }
- // Set appropriate dirty flags
- }
- theTranslator.PostPropertyChanged(theParser, inStudioPresentation);
- }
-};
-
-template <>
-struct STranslatorCreator<SPresentationTranslator>
-{
- static Qt3DSTranslator *Create(Q3DStudio::TElement &, SGraphObject &, NVAllocatorCallback &)
- {
- return NULL;
- }
- static void InitializeTranslator(Qt3DSTranslator &, NVAllocatorCallback &) {}
- static void OnElementChanged(Qt3DSTranslator & /*inTranslator*/,
- SPresentation & /*inPresentation*/
- ,
- IQt3DSRenderContext & /*inRenderContext*/,
- Q3DStudio::IPresentation & /*inStudioPresentation*/)
- {
- QT3DS_ASSERT(false);
- }
-};
-
-template <>
-struct STranslatorCreator<SEffectTranslator>
-{
- static SEffectTranslator *Create(Q3DStudio::TElement &inElement, SGraphObject &inObject,
- NVAllocatorCallback &inAllocator)
- {
- typedef SEffectTranslator::TNodeType TNodeType;
- // This assert needs to be here because we serialize all translators generically without
- // regard for type.
- StaticAssert<sizeof(SEffectTranslator) == sizeof(Qt3DSTranslator)>::valid_expression();
- return QT3DS_NEW(inAllocator, SEffectTranslator)(inElement, static_cast<TNodeType &>(inObject),
- inAllocator);
- }
-
- static void InitializeTranslator(Qt3DSTranslator &inTranslator, NVAllocatorCallback &inAllocator)
- {
- typedef SEffectTranslator::TNodeType TNodeType;
- // Initialize the vtable.
- new (&inTranslator)
- SEffectTranslator(inTranslator.Element(),
- static_cast<TNodeType &>(inTranslator.RenderObject()), inAllocator);
- }
- static void OnElementChanged(Qt3DSTranslator &inTranslator, SPresentation &inPresentation,
- IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &inStudioPresentation)
- {
- static_cast<SEffectTranslator &>(inTranslator)
- .OnElementChanged(inPresentation, inRenderContext, inStudioPresentation);
- }
-};
-
-template <>
-struct STranslatorCreator<SCustomMaterialTranslator>
-{
- static SCustomMaterialTranslator *Create(Q3DStudio::TElement &inElement, SGraphObject &inObject,
- NVAllocatorCallback &inAllocator)
- {
- typedef SCustomMaterialTranslator::TNodeType TNodeType;
- // This assert needs to be here because we serialize all translators generically without
- // regard for type.
- StaticAssert<sizeof(SCustomMaterialTranslator)
- == sizeof(Qt3DSTranslator)>::valid_expression();
- return QT3DS_NEW(inAllocator, SCustomMaterialTranslator)(
- inElement, static_cast<TNodeType &>(inObject), inAllocator);
- }
-
- static void InitializeTranslator(Qt3DSTranslator &inTranslator, NVAllocatorCallback &inAllocator)
- {
- typedef SCustomMaterialTranslator::TNodeType TNodeType;
- // Initialize the vtable.
- new (&inTranslator) SCustomMaterialTranslator(
- inTranslator.Element(), static_cast<TNodeType &>(inTranslator.RenderObject()),
- inAllocator);
- }
-
- static void OnElementChanged(Qt3DSTranslator &inTranslator, SPresentation &inPresentation,
- IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &inStudioPresentation)
- {
- static_cast<SCustomMaterialTranslator &>(inTranslator)
- .OnElementChanged(inPresentation, inRenderContext, inStudioPresentation);
- }
-};
-
-template <>
-struct STranslatorCreator<SRenderPluginTranslator>
-{
- static SRenderPluginTranslator *Create(Q3DStudio::TElement &inElement, SGraphObject &inObject,
- NVAllocatorCallback &inAllocator)
- {
- typedef SRenderPluginTranslator::TNodeType TNodeType;
- // This assert needs to be here because we serialize all translators generically without
- // regard for type.
- StaticAssert<sizeof(SRenderPluginTranslator) == sizeof(Qt3DSTranslator)>::valid_expression();
- return QT3DS_NEW(inAllocator, SRenderPluginTranslator)(
- inElement, static_cast<TNodeType &>(inObject), inAllocator);
- }
-
- static void InitializeTranslator(Qt3DSTranslator &inTranslator, NVAllocatorCallback &inAllocator)
- {
- typedef SRenderPluginTranslator::TNodeType TNodeType;
- // Initialize the vtable.
- new (&inTranslator) SRenderPluginTranslator(
- inTranslator.Element(), static_cast<TNodeType &>(inTranslator.RenderObject()),
- inAllocator);
- }
- static void OnElementChanged(Qt3DSTranslator &inTranslator, SPresentation &inPresentation,
- IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &inStudioPresentation)
- {
- static_cast<SRenderPluginTranslator &>(inTranslator)
- .OnElementChanged(inPresentation, inRenderContext, inStudioPresentation);
- }
-};
-}
-Qt3DSTranslator *Qt3DSTranslator::CreateTranslatorForElement(Q3DStudio::TElement &inElement,
- SGraphObject &inObject,
- NVAllocatorCallback &inAlloc)
-{
- Qt3DSTranslator *theTranslator = NULL;
- switch (inObject.m_Type) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case GraphObjectTypes::type: \
- theTranslator = \
- STranslatorCreator<S##type##Translator>::Create(inElement, inObject, inAlloc); \
- break;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
- return theTranslator;
-}
-
-void Qt3DSTranslator::OnElementChanged(SPresentation &inPresentation,
- IQt3DSRenderContext &inRenderContext,
- Q3DStudio::IPresentation &inStudioPresentation)
-{
- switch (m_RenderObject->m_Type) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case GraphObjectTypes::type: \
- STranslatorCreator<S##type##Translator>::OnElementChanged( \
- *this, inPresentation, inRenderContext, inStudioPresentation); \
- break;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
-}
-
-Qt3DSTranslator *Qt3DSTranslator::LoadTranslator(SDataReader &inReader, size_t inElemOffset,
- NVDataRef<QT3DSU8> inSGSection,
- NVAllocatorCallback &inAllocator)
-{
- // Reader points to a new translator but we don't know what type
- QT3DSU8 *theTranslatorStart = inReader.m_CurrentPtr;
- // Make sure things are aligned
- (void)theTranslatorStart;
- QT3DS_ASSERT((size_t)theTranslatorStart % 4 == 0);
- Qt3DSTranslator *theTranslator = inReader.Load<Qt3DSTranslator>();
- if (theTranslator) {
- size_t *elemPtr = reinterpret_cast<size_t *>(&theTranslator->m_Element);
- *elemPtr += inElemOffset;
- size_t *graphObjPtr = reinterpret_cast<size_t *>(&theTranslator->m_RenderObject);
- size_t sgSectionStart = reinterpret_cast<size_t>(inSGSection.begin());
- *graphObjPtr += sgSectionStart;
- // Call actual constructor to initialize vtable.
- switch (theTranslator->RenderObject().m_Type) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case GraphObjectTypes::type: \
- STranslatorCreator<S##type##Translator>::InitializeTranslator(*theTranslator, \
- inAllocator); \
- break;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- return theTranslator;
-}
-Q3DStudio::IPresentation *
-Qt3DSTranslator::GetPresentationFromPresentation(SPresentation &inPresentation)
-{
- return inPresentation.m_UserData.DynamicCast<Q3DStudio::IPresentation>();
-}
-
-void Qt3DSTranslator::InitializePointerTags(IStringTable &)
-{
- g_TranslatorTag = 0x0044FEED;
- g_PresentationTag = 0x0022ABBA;
-}
-
-void Qt3DSTranslator::AssignUserData(Q3DStudio::IPresentation &inPresentation,
- SPresentation &inGraphPresentation)
-{
- inGraphPresentation.m_UserData = STaggedPointer(&inPresentation);
-}
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.cpp b/src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.cpp
deleted file mode 100644
index fc6c3cac..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.cpp
+++ /dev/null
@@ -1,853 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSRuntimeView.h"
-#include "Qt3DSTegraInputEngine.h"
-#include "Qt3DSDataLogger.h"
-#include "Qt3DSFileStream.h"
-#include "Qt3DSArray.h"
-#include "Qt3DSApplication.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSPresentation.h"
-#include "EASTL/string.h"
-#include "Qt3DSMemory.h"
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderRuntimeBindingImpl.h"
-#include "Qt3DSImportMesh.h"
-
-#include "Qt3DSDLLManager.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/TrackingAllocator.h"
-// For perf log timestamp
-#include <time.h>
-#include "Qt3DSArray.h"
-// For perf log timestamp
-#include <time.h>
-
-#ifdef _LINUXPLATFORM
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#ifdef ANDROID
-#include <android/log.h>
-#endif
-
-#include <QCoreApplication>
-#include <QSurfaceFormat>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace qt3ds {
-namespace render {
-extern qt3ds::foundation::MallocAllocator g_BaseAllocator;
-}
-}
-
-namespace Q3DStudio {
-
-namespace {
-
-bool CaselessEqual(const char *lhs, const char *rhs)
-{
- if (lhs == nullptr)
- lhs = "";
- if (rhs == nullptr)
- rhs = "";
- return Q3DStudio_stricmp(lhs, rhs) == 0;
-}
-
-CInputEngine *CreateInputEngine()
-{
- return Q3DStudio_virtual_new(CTegraInputEngine) CTegraInputEngine();
-}
-
-static eastl::string *theAppDir = nullptr;
-const eastl::string &GetAppDir(const eastl::string &inAppExe)
-{
- if (!theAppDir)
- theAppDir = new eastl::string;
-#ifndef __ANDROID__
- theAppDir->assign(inAppExe.empty() == false ? inAppExe : "");
-#ifdef Qt3DS_OS_LINUX
- char theBuf[1024] = { 0 };
- int rc = readlink("/proc/self/exe", theBuf, sizeof(theBuf));
- if (rc > 0)
- theAppDir->assign(theBuf);
-#endif
-#ifdef Qt3DS_OS_QNX
- char theBuf[1024] = { 0 };
- FILE *exefile = fopen("/proc/self/exefile", "r");
- if (exefile != nullptr) {
- fgets(theBuf, sizeof(theBuf), exefile);
- fclose(exefile);
- theAppDir->assign(theBuf);
- }
-#endif
- eastl::string::size_type pos = theAppDir->find_last_of("\\/");
- if (pos != eastl::string::npos)
- *theAppDir = theAppDir->substr(0, pos);
- theAppDir->append("\\");
-#endif
- return *theAppDir;
-}
-}
-
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-
-class CRuntimeView : public IRuntimeView
-{
- //==============================================================================
- // Fields
- //==============================================================================
-private:
- ITegraApplicationRenderEngine *m_RenderEngine; ///< Handles all rendering functions
- CTegraInputEngine *m_InputEngine; ///< Handles all user input events
- // Pre graphics init objects
- NVScopedRefCounted<qt3ds::render::IQt3DSRenderFactoryCore> m_RuntimeFactoryCore;
- ///< Base application before graphics
- NVScopedRefCounted<qt3ds::runtime::IApplication> m_ApplicationCore;
-
- // Post graphics init objects
- NVScopedRefCounted<qt3ds::render::IQt3DSRenderFactory> m_RuntimeFactory;
- NVScopedRefCounted<qt3ds::runtime::IApplication> m_Application; ///< Application after graphics
- ///< Currently loaded presentation, this should be removed in the future
- CPresentation *m_Presentation;
-
- CPausingTimeProvider m_TimeProvider;
- IWindowSystem &m_WindowSystem;
- IAudioPlayer *m_AudioPlayer;
-
- volatile QT3DSI32 mRefCount;
-
- qt3ds::Qt3DSAssetVisitor *m_visitor;
- bool m_showOnScreenStats;
- QElapsedTimer *m_startupTimer;
- qint64 m_startupTime;
-
-public:
- CRuntimeView(ITimeProvider &inTimeProvider, IWindowSystem &inWindowSystem,
- IAudioPlayer *inAudioPlayer, QElapsedTimer *startupTimer);
- ~CRuntimeView() override;
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(qt3ds::render::g_BaseAllocator)
-
- bool BeginLoad(const QString &sourcePath, const QStringList &variantList) override;
- bool HasOfflineLoadingCompleted() override;
- bool InitializeGraphics(const QSurfaceFormat &format, bool delayedLoading) override;
-
- void Cleanup() override;
-
- bool CanRender() override;
- void Render() override;
- bool WasLastFrameDirty() override;
-
- bool HandleMessage(const QEvent *inEvent) override;
-
- void Pause() override;
- void UnPause() override;
- bool IsPaused() override;
- void setAssetVisitor(qt3ds::Qt3DSAssetVisitor *) override;
-
- INT32 GetFrameCount() override;
- void showOnScreenStats(bool) override;
-
- CInputEngine *GetInputEngine() override;
- // Only valid after InitializeGraphics
- ITegraApplicationRenderEngine *GetTegraRenderEngine() override { return m_RenderEngine; }
-
- void GoToSlideByName(const char *elementPath, const char *slideName) override;
- void GoToSlideByIndex(const char *elementPath, const int slideIndex) override;
- void GoToSlideRelative(const char *elementPath, const bool next, const bool wrap) override;
- bool GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName) override;
- void SetPresentationAttribute(const char *presId, const char *, const char *value) override;
- void GoToTime(const char *elementPath, const float time) override;
- void SetGlobalAnimationTime(qint64 inMilliSecs) override;
- void SetDataInputValue(const QString &name, const QVariant &value,
- int property) override;
-
- void setPresentationId(const QString &id) override
- {
- m_Application->setPresentationId(id);
- }
-
- QList<QString> dataInputs() const override;
- QList<QString> dataOutputs() const override;
- float dataInputMax(const QString &name) const override;
- float dataInputMin(const QString &name) const override;
-
- void createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties) override;
- void deleteElements(const QStringList &elementPaths) override;
- void createMaterials(const QString &elementPath,
- const QStringList &materialDefinitions) override;
- void deleteMaterials(const QString &elementPath, const QStringList &materialNames) override;
- void createMesh(const QString &name, qt3dsimp::Mesh *mesh) override;
- void deleteMeshes(const QStringList &meshNames) override;
- void SetAttribute(const char *elementPath, const char *attributeName,
- const char *value) override;
- bool GetAttribute(const char *elementPath, const char *attributeName, void *value) override;
- void FireEvent(const char *element, const char *evtName) override;
- bool PeekCustomAction(char *&outElementPath, char *&outActionName) override;
- bool RegisterScriptCallback(int callbackType, qml_Function func, void *inUserData) override;
- void FireEvent(const TEventCommandHash inEventType, eastl::string inArgument) override;
- qt3ds::foundation::Option<SPresentationSize> GetPresentationSize() override;
- void preloadSlide(const QString &slide) override;
- void unloadSlide(const QString &slide) override;
- void setDelayedLoading(bool enable) override;
- void BootupPreGraphicsInitObjects();
-};
-
-CRuntimeView::CRuntimeView(ITimeProvider &inTimeProvider, IWindowSystem &inWindowSystem,
- IAudioPlayer *inAudioPlayer, QElapsedTimer *startupTimer)
- : m_RenderEngine(nullptr)
- , m_InputEngine(nullptr)
- , m_Application(nullptr)
- , m_Presentation(nullptr)
- , m_TimeProvider(inTimeProvider)
- , m_WindowSystem(inWindowSystem)
- , m_AudioPlayer(inAudioPlayer)
- , mRefCount(0)
- , m_visitor(nullptr)
- , m_showOnScreenStats(false)
- , m_startupTimer(startupTimer)
- , m_startupTime(-1)
-{
-}
-
-CRuntimeView::~CRuntimeView()
-{
-}
-
-bool CRuntimeView::BeginLoad(const QString &sourcePath, const QStringList &variantList)
-{
- bool theResult = false;
-
- // boot up the application
- BootupPreGraphicsInitObjects();
-
- // If there was a presentation file then we have to load it or something failed.
- if (m_ApplicationCore->BeginLoad(sourcePath.toUtf8(), variantList))
- theResult = true;
- else
- theResult = false;
-
- // If Initialize wasn't successful - this means the CShaderFactory failed to initialize
- // or, the presentation failed to load.
- //
- // NOTE: if no presentation was passed, this is 'ok'
- if (!theResult)
- Cleanup();
-
- return theResult;
-}
-
-bool CRuntimeView::HasOfflineLoadingCompleted()
-{
- if (m_Application.mPtr == nullptr) {
- if (m_ApplicationCore)
- return m_ApplicationCore->HasCompletedLoading();
- else
- return false;
- }
- return true;
-}
-
-bool CRuntimeView::InitializeGraphics(const QSurfaceFormat &format, bool delayedLoading)
-{
- m_ApplicationCore->EndLoad();
- // Next call will initialize the render portion of the scenes. This *must* have a loaded
- // application to go further as it will bind scene graph data to application data.
- m_RuntimeFactory = m_RuntimeFactoryCore->CreateRenderFactory(format, delayedLoading);
- m_Application
- = m_ApplicationCore->CreateApplication(*m_InputEngine, m_AudioPlayer,
- *m_RuntimeFactory);
- if (!m_Application->createSuccessful())
- return false;
-
- m_Application->ResetTime();
- m_RenderEngine = &m_RuntimeFactory->CreateRenderEngine();
- m_Presentation = m_Application->GetPrimaryPresentation();
-
- QObject::connect(m_Presentation->signalProxy(), &QPresentationSignalProxy::SigSlideEntered,
- signalProxy(), &QRuntimeViewSignalProxy::SigSlideEntered);
- QObject::connect(m_Presentation->signalProxy(), &QPresentationSignalProxy::SigSlideExited,
- signalProxy(), &QRuntimeViewSignalProxy::SigSlideExited);
- QObject::connect(m_Presentation->signalProxy(), &QPresentationSignalProxy::SigCustomSignal,
- signalProxy(), &QRuntimeViewSignalProxy::SigCustomSignal);
- QObject::connect(m_Presentation->signalProxy(),
- &QPresentationSignalProxy::SigPresentationReady,
- signalProxy(), &QRuntimeViewSignalProxy::SigPresentationReady);
- QObject::connect(m_Presentation->signalProxy(), &QPresentationSignalProxy::SigElementsCreated,
- signalProxy(), &QRuntimeViewSignalProxy::SigElementsCreated);
- QObject::connect(m_Presentation->signalProxy(), &QPresentationSignalProxy::SigMaterialsCreated,
- signalProxy(), &QRuntimeViewSignalProxy::SigMaterialsCreated);
- QObject::connect(m_Presentation->signalProxy(),
- &QPresentationSignalProxy::SigDataOutputValueUpdated,
- signalProxy(),
- &QRuntimeViewSignalProxy::SigDataOutputValueUpdated);
-
- m_TimeProvider.Reset();
- return true;
-}
-
-void CRuntimeView::Cleanup()
-{
- // Q3DStudio_virtual_delete( m_Timer, CTimer );
- // Q3DStudio_virtual_delete( m_PerfFileStream, CFileStream );
- m_Application = nullptr;
- Q3DStudio_virtual_delete(m_InputEngine, CTegraInputEngine);
- if (m_RenderEngine) {
- m_RenderEngine->Release();
- m_RenderEngine = nullptr;
- }
-
- CDLLManager &theDLLManager = CDLLManager::GetDLLManager();
- theDLLManager.Cleanup();
- if (m_Presentation)
- QObject::disconnect(m_Presentation->signalProxy(), 0, signalProxy(), 0);
-
- m_InputEngine = nullptr;
- m_RenderEngine = nullptr;
- m_Presentation = nullptr;
-}
-
-bool CRuntimeView::CanRender()
-{
- return m_Application.mPtr != nullptr;
-}
-
-//==============================================================================
-/**
- * nv_main APP-SPECIFIC rendering call
- * returns KD_TRUE to call egl_render and swap properly, KD_FALSE if there has been no scene update
- *or redraw.
- */
-void CRuntimeView::Render()
-{
- if (m_Application.mPtr == nullptr) {
- // InitializeGraphics has not been called
- QT3DS_ASSERT(false);
- }
-
- PerfLogGeneralEvent1(DATALOGGER_FRAME);
-
- m_Application->UpdateAndRender();
-
- if (m_startupTime < 0 && m_startupTimer) {
- m_startupTime = m_startupTimer->elapsed();
- m_startupTimer->invalidate();
- }
-
- if (m_showOnScreenStats) {
- ITegraRenderStateManager &manager
- = GetTegraRenderEngine()->GetTegraRenderStateManager();
- manager.PushState();
-
- QSize dim = m_WindowSystem.GetWindowDimensions();
- manager.SetScissorTestEnabled(false);
- manager.SetViewport(0, 0, dim.width(), dim.height());
-
- QPair<QT3DSF32, QT3DSF32> fps
- = m_RuntimeFactory->GetQt3DSRenderContext().GetFPS();
- const QVector<QT3DSF32> times = m_RuntimeFactory->GetQt3DSRenderContext().GetFrameTimes();
-
- QString text;
- QTextStream stream(&text);
- stream << QStringLiteral("Render Statistics: ");
- stream << QString::number(fps.first, 'f', 2);
- stream << " fps, frame count ";
- stream << QString::number(fps.second);
- stream << ", frame time ";
- stream << QString::number(times[0], 'f', 2);
- stream << " ms";
- if (m_startupTime) {
- stream << ", Init time: ";
- stream << QString::number(m_startupTime);
- stream << " ms";
- }
-
- // bottom left coordinates
- GetTegraRenderEngine()->RenderText2D(
- dim.width() / 4, dim.height() - 25, qt3ds::QT3DSVec3(0.0, 1.0, 0.0),
- text.toLatin1().constData());
- GetTegraRenderEngine()->RenderGpuProfilerStats(
- 20.0, dim.height() - 80, qt3ds::QT3DSVec3(0.0, 1.0, 0.0));
-
- manager.PopState();
- }
-}
-
-bool CRuntimeView::WasLastFrameDirty()
-{
- if (m_Application)
- return m_Application->IsApplicationDirty();
- return false;
-}
-
-//==============================================================================
-/**
- * nv_main APP-SPECIFIC message call
- * HandleMessage
- */
-bool CRuntimeView::HandleMessage(const QEvent *inEvent)
-{
- if (m_Application.mPtr == nullptr || m_RenderEngine == nullptr)
- return 0;
-
- bool ret = false;
- switch (inEvent->type()) {
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- {
- const QMouseEvent *event = static_cast<const QMouseEvent *>(inEvent);
- m_InputEngine->SetPickInput(static_cast<FLOAT>(event->x()),
- static_cast<FLOAT>(event->y()), true);
- m_InputEngine->SetPickFlags(inEvent->type() == QEvent::MouseButtonPress
- ? LMOUSE_DOWN : LMOUSE_UP);
- ret = true;
- }
- break;
- case QEvent::Resize:
- {
- if (m_Application->GetPrimaryPresentation())
- m_RenderEngine->CheckResize(true, *m_Application->GetPrimaryPresentation());
- ret = true;
- }
- break;
- default:
- break;
- }
-
- m_InputEngine->HandleMessage(inEvent, *m_RenderEngine, m_Application->GetPrimaryPresentation());
- return ret ? 1 : 0;
-}
-
-void CRuntimeView::Pause()
-{
- m_TimeProvider.Pause();
-}
-
-void CRuntimeView::UnPause()
-{
- m_TimeProvider.UnPause();
-}
-
-bool CRuntimeView::IsPaused()
-{
- return m_TimeProvider.IsPaused();
-}
-
-INT32 CRuntimeView::GetFrameCount()
-{
- return m_Application->GetFrameCount();
-}
-
-void CRuntimeView::showOnScreenStats(bool show)
-{
- m_showOnScreenStats = show;
- m_RuntimeFactory->GetQt3DSRenderContext().GetRenderer().EnableLayerGpuProfiling(show);
-}
-
-CInputEngine *CRuntimeView::GetInputEngine()
-{
- return m_InputEngine;
-}
-
-//==============================================================================
-/**
- * Generates an event in the presentation.
- */
-void CRuntimeView::GoToSlideByName(const char *elementPath, const char *slideName)
-{
- if (m_Application) {
- if (!elementPath || !slideName)
- return;
-
- CPresentation *thePresentation = m_Application->GetPrimaryPresentation();
- IScriptBridge *theBridge = thePresentation->GetScriptBridgeQml();
-
- if (!theBridge)
- return;
-
- theBridge->GotoSlide(elementPath, slideName, SScriptEngineGotoSlideArgs());
- }
-}
-
-void CRuntimeView::GoToSlideByIndex(const char *elementPath, const int slideIndex)
-{
- if (m_Application) {
- if (!elementPath || slideIndex < 0)
- return;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- theBridgeEngine.GotoSlideIndex(elementPath, slideIndex, SScriptEngineGotoSlideArgs());
- }
-}
-
-void CRuntimeView::GoToSlideRelative(const char *elementPath, const bool next, const bool wrap)
-{
- if (m_Application) {
- if (!elementPath)
- return;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- theBridgeEngine.GotoSlideRelative(elementPath, next, wrap, SScriptEngineGotoSlideArgs());
- }
-}
-
-bool CRuntimeView::GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName)
-{
- if (m_Application && elementPath) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- return theBridgeEngine.GetSlideInfo(elementPath, currentIndex, previousIndex,
- currentName, previousName);
- }
- return false;
-}
-
-void CRuntimeView::SetPresentationAttribute(const char *presId, const char *, const char *value)
-{
- if (m_Application) {
- if (!presId || !value)
- return;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- theBridgeEngine.SetPresentationAttribute(presId, nullptr, value);
- }
-}
-
-bool CRuntimeView::RegisterScriptCallback(int callbackType, qml_Function func, void *inUserData)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- return theBridgeEngine.RegisterCallback(callbackType, func, inUserData);
- }
-
- return false;
-}
-
-void CRuntimeView::GoToTime(const char *elementPath, const float time)
-{
- if (m_Application) {
- if (!elementPath || time < 0.0)
- return;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- theBridgeEngine.GotoTime(elementPath, time);
- }
-}
-
-void CRuntimeView::SetGlobalAnimationTime(qint64 inMilliSecs)
-{
- if (m_Application)
- m_Application->SetTimeMilliSecs(inMilliSecs);
-}
-
-void CRuntimeView::SetDataInputValue(
- const QString &name, const QVariant &value,
- int property = 0)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.SetDataInputValue(name, value, (qt3ds::runtime::DataInputValueRole)property);
- }
-}
-
-QList<QString> CRuntimeView::dataInputs() const
-{
- if (m_Application)
- return m_Application->dataInputs();
-
- return {};
-}
-
-QList<QString> CRuntimeView::dataOutputs() const
-{
- if (m_Application)
- return m_Application->dataOutputs();
-
- return {};
-}
-
-float CRuntimeView::dataInputMax(const QString &name) const
-{
- if (m_Application)
- return m_Application->dataInputMax(name);
-
- return 0;
-}
-
-float CRuntimeView::dataInputMin(const QString &name) const
-{
- if (m_Application)
- return m_Application->dataInputMin(name);
-
- return 0;
-}
-
-void CRuntimeView::createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.createElements(parentElementPath, slideName, properties,
- &m_RuntimeFactory->GetQt3DSRenderContext().GetRenderer());
- }
-}
-
-void CRuntimeView::deleteElements(const QStringList &elementPaths)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.deleteElements(elementPaths,
- &m_RuntimeFactory->GetQt3DSRenderContext().GetRenderer());
- }
-}
-
-void CRuntimeView::createMaterials(const QString &elementPath,
- const QStringList &materialDefinitions)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.createMaterials(
- elementPath, materialDefinitions,
- &m_RuntimeFactory->GetQt3DSRenderContext().GetCustomMaterialSystem(),
- &m_RuntimeFactory->GetQt3DSRenderContext().GetDynamicObjectSystem(),
- &m_RuntimeFactory->GetQt3DSRenderContext().GetRenderer());
- }
-}
-
-void CRuntimeView::deleteMaterials(const QString &elementPath, const QStringList &materialNames)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.deleteMaterials(elementPath, materialNames,
- &m_RuntimeFactory->GetQt3DSRenderContext().GetRenderer());
- }
-}
-
-void CRuntimeView::createMesh(const QString &name, qt3dsimp::Mesh *mesh)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.createMesh(
- name, mesh, &m_RuntimeFactory->GetQt3DSRenderContext().GetBufferManager());
- }
-}
-
-void CRuntimeView::deleteMeshes(const QStringList &meshNames)
-{
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.deleteMeshes(
- meshNames, &m_RuntimeFactory->GetQt3DSRenderContext().GetBufferManager());
- }
-}
-
-void CRuntimeView::SetAttribute(const char *elementPath, const char *attributeName,
- const char *value)
-{
- if (m_Application) {
- if (!elementPath || !attributeName || !value)
- return;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- theBridgeEngine.SetAttribute(elementPath, attributeName, value);
- }
-}
-
-bool CRuntimeView::GetAttribute(const char *elementPath, const char *attributeName, void *value)
-{
- if (m_Application) {
- if (!elementPath || !attributeName || !value)
- return false;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- return theBridgeEngine.GetAttribute(elementPath, attributeName, (char *)value);
- }
-
- return false;
-}
-
-void CRuntimeView::FireEvent(const char *element, const char *evtName)
-{
- if (m_Application) {
- if (!element || !evtName)
- return;
-
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- theBridgeEngine.FireEvent(element, evtName);
- }
-}
-
-bool CRuntimeView::PeekCustomAction(char *&outElementPath, char *&outActionName)
-{
- bool actionAvailable = true;
-
- if (m_Application) {
- Q3DStudio::CQmlEngine &theBridgeEngine
- = static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
-
- Q3DStudio::TElement *theElement = nullptr;
- actionAvailable = theBridgeEngine.PeekSignal(theElement, outActionName);
- if (actionAvailable && theElement)
- outElementPath = (char *)theElement->m_Path.c_str();
- }
-
- return actionAvailable;
-}
-
-void CRuntimeView::FireEvent(const TEventCommandHash inEventType, eastl::string inArgument)
-{
- if (m_Application) {
- CPresentation *thePresentation = m_Application->GetPrimaryPresentation();
- TElement *theScene = thePresentation->GetRoot();
- if (inArgument.empty()) {
- thePresentation->FireEvent(inEventType, theScene, nullptr, nullptr, ATTRIBUTETYPE_NONE,
- ATTRIBUTETYPE_NONE);
- } else {
- UVariant inArg;
- inArg.m_StringHandle = thePresentation->GetStringTable().GetHandle(inArgument.c_str());
- thePresentation->FireEvent(inEventType, theScene, &inArg, nullptr, ATTRIBUTETYPE_STRING,
- ATTRIBUTETYPE_NONE);
- }
- }
-}
-
-void CRuntimeView::preloadSlide(const QString &slide)
-{
- if (m_Application)
- m_Application->preloadSlide(slide);
-}
-
-void CRuntimeView::unloadSlide(const QString &slide)
-{
- if (m_Application)
- m_Application->unloadSlide(slide);
-}
-
-void CRuntimeView::setDelayedLoading(bool enable)
-{
- if (m_Application)
- m_Application->setDelayedLoading(enable);
-}
-
-qt3ds::foundation::Option<SPresentationSize> CRuntimeView::GetPresentationSize()
-{
- if (m_Application) {
- CPresentation *thePresentation = m_Application->GetPrimaryPresentation();
- if (thePresentation)
- return thePresentation->GetSize();
- }
- return qt3ds::foundation::Empty();
-}
-
-//==============================================================================
-/**
- * Perform the initialization steps prior to loading any presentation.
- */
-void CRuntimeView::BootupPreGraphicsInitObjects()
-{
- qCInfo(TRACE_INFO) << "CNDDView::BootupPreGraphicsInitObjects: DoInitialize";
- // Create engines and runtime
- const eastl::string &theAppDir = QCoreApplication::applicationDirPath().toLatin1().constData();
-
- m_RuntimeFactoryCore = qt3ds::render::IQt3DSRenderFactoryCore::CreateRenderFactoryCore(
- theAppDir.c_str(), m_WindowSystem, m_TimeProvider);
- m_ApplicationCore = qt3ds::runtime::IApplication::CreateApplicationCore(*m_RuntimeFactoryCore,
- theAppDir.c_str());
-
- if (m_ApplicationCore && m_visitor)
- m_ApplicationCore->setAssetVisitor(m_visitor);
-
- m_InputEngine = static_cast<CTegraInputEngine *>(CreateInputEngine());
- Q3DStudio_ASSERT(m_InputEngine != nullptr);
-
- qCInfo(TRACE_INFO) << "CNDDView::DoInitialize: Successfully initialized!";
-}
-
-void CRuntimeView::setAssetVisitor(qt3ds::Qt3DSAssetVisitor *v)
-{
- m_visitor = v;
- if (m_ApplicationCore)
- m_ApplicationCore->setAssetVisitor(v);
-}
-
-IRuntimeView &IRuntimeView::Create(ITimeProvider &inProvider, IWindowSystem &inWindowSystem,
- IAudioPlayer *inAudioPlayer, QElapsedTimer *startupTimer)
-{
- return *QT3DS_NEW(qt3ds::render::g_BaseAllocator, CRuntimeView)(inProvider, inWindowSystem,
- inAudioPlayer, startupTimer);
-}
-
-QRuntimeViewSignalProxy *IRuntimeView::signalProxy()
-{
- return &m_SignalProxy;
-}
-
-} // namespace Q3DStudio
-
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.h
deleted file mode 100644
index 9ade9c7f..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSRuntimeView.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_RUNTIME_VIEW_H
-#define QT3DS_RUNTIME_VIEW_H
-
-#include "EnginePrefix.h"
-#include "Qt3DSIStateful.h"
-#include "foundation/Qt3DSVec4.h"
-#include "foundation/Qt3DSOption.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSWindowSystem.h"
-#include "Qt3DSTimer.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSRenderRuntimeBinding.h"
-#include <QtCore/qobject.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qstringlist.h>
-#include <QtGui/qsurfaceformat.h>
-
-typedef void (*qml_Function)(void *inUserData);
-
-namespace qt3dsimp {
- struct Mesh;
-}
-
-class QRuntimeViewSignalProxy : public QObject
-{
- Q_OBJECT
-Q_SIGNALS:
- void SigSlideEntered(const QString &elementPath, unsigned int index, const QString &name);
- void SigSlideExited(const QString &elementPath, unsigned int index, const QString &name);
- void SigCustomSignal(const QString &elementPath, const QString &name);
- void SigPresentationReady();
- void SigElementsCreated(const QStringList &elementPaths, const QString &error);
- void SigMaterialsCreated(const QStringList &materialNames, const QString &error);
- void SigDataOutputValueUpdated(const QString &name, const QVariant &value);
-};
-
-namespace qt3ds {
-class Qt3DSAssetVisitor;
-}
-
-namespace qt3ds {
-namespace render {
-class NVRenderContext;
-}
-}
-
-namespace Q3DStudio {
-
-class CTegraInputEngine;
-class CTegraRenderEngine;
-class IScene;
-class CInputEngine;
-class IAudioPlayer;
-
-class ITegraRenderStateManager : public IStatefulStackBase
-{
-protected:
- virtual ~ITegraRenderStateManager() {}
-public:
- virtual void SetViewport(INT32 inX, INT32 inY, INT32 inWidth, INT32 inHeight) = 0;
- virtual void SetScissorTestEnabled(bool inValue) = 0;
- virtual void SaveAllState() = 0;
- virtual void RestoreAllState() = 0;
-};
-
-struct TegraRenderScaleModes
-{
- enum Enum {
- ExactSize = 0, // Ensure the viewport is exactly same size as application
- ScaleToFit = 1, // Resize viewport keeping aspect ratio
- ScaleToFill = 2, // Resize viewport to entire window
- };
-};
-
-struct TegraRenderShadeModes
-{
- enum Enum {
- Shaded = 0, // Geometry is shaded only
- ShadedWireframe = 1, // Wireframe is drawn on top shaded geometry
- Wireframe = 2, // Wireframe only
- };
-};
-
-class ITegraApplicationRenderEngine
-{
-protected:
- virtual ~ITegraApplicationRenderEngine() {}
-
-public:
- virtual void SetViewport(INT32 inX, INT32 inY, INT32 inWidth, INT32 inHeight) = 0;
- virtual void SetApplicationViewport(const qt3ds::render::NVRenderRect &inViewport) = 0;
- virtual void ensureRenderTarget() = 0;
- virtual void CheckResize(bool inForce, IPresentation &inActivePresentation) = 0;
- virtual BOOL LoadShaderCache(const CHAR *inFilePath) = 0;
- virtual void AbandonLoadingImages(IScene &inScene) = 0;
- virtual BOOL IsPickValid(FLOAT &outX, FLOAT &outY,
- const IPresentation &inPresentation) const = 0;
- virtual void SetScaleMode(TegraRenderScaleModes::Enum inScale) = 0;
- virtual void SetShadeMode(TegraRenderShadeModes::Enum inShade) = 0;
- virtual TegraRenderScaleModes::Enum GetScaleMode() const = 0;
-
- // TODO: To be removed, not used anywhere anymore
- void CycleScaleMode()
- {
- int mode = (int)GetScaleMode();
- mode = (mode + 1) % 3;
- SetScaleMode((TegraRenderScaleModes::Enum)mode);
- }
-
- virtual ITegraRenderStateManager &GetTegraRenderStateManager() = 0;
- virtual qt3ds::render::NVRenderContext &GetRenderContext() = 0;
- virtual void SetMatteColor(qt3ds::foundation::Option<qt3ds::QT3DSVec4> inColor) = 0;
- virtual void EnableRenderRotation(bool inEnable) = 0;
- virtual void SetWriteOutShaderCache(bool inWriteOutShaderCache) = 0;
- virtual void Release() = 0;
- virtual void RenderText2D(FLOAT x, FLOAT y, qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
- const char *text) = 0;
- virtual void RenderGpuProfilerStats(FLOAT x, FLOAT y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor) = 0;
-};
-
-class IRuntimeView : public qt3ds::foundation::NVRefCounted
-{
-public:
- virtual ~IRuntimeView(){}
-
-public: // loading
- virtual bool BeginLoad(const QString &sourcePath, const QStringList &variantList) = 0;
- virtual bool HasOfflineLoadingCompleted() = 0;
- virtual bool InitializeGraphics(const QSurfaceFormat &format, bool delayedLoading) = 0;
-
- virtual void Cleanup() = 0;
-
- virtual bool CanRender() = 0;
-
- virtual void Render() = 0;
-
- virtual bool WasLastFrameDirty() = 0;
-
- virtual bool HandleMessage(const QEvent *inEvent) = 0;
-
- virtual void Pause() = 0;
- virtual void UnPause() = 0;
- virtual bool IsPaused() = 0;
- virtual INT32 GetFrameCount() = 0;
- virtual void showOnScreenStats(bool) = 0;
-
- virtual void setPresentationId(const QString &id) = 0;
-
-public: // Input engine access
- virtual CInputEngine *GetInputEngine() = 0;
- // Only valid after InitializeGraphics
- virtual ITegraApplicationRenderEngine *GetTegraRenderEngine() = 0;
-
-public:
- virtual void GoToSlideByName(const char *elementPath, const char *slideName) = 0;
- virtual void GoToSlideByIndex(const char *elementPath, const int slideIndex) = 0;
- virtual void GoToSlideRelative(const char *elementPath, const bool next, const bool wrap) = 0;
- virtual bool GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName) = 0;
- virtual void SetPresentationAttribute(const char *presId, const char *, const char *value) = 0;
- virtual void GoToTime(const char *elementPath, const float time) = 0;
- virtual void SetGlobalAnimationTime(qint64 inMilliSecs) = 0;
- virtual void SetDataInputValue(const QString &name, const QVariant &value,
- int property) = 0;
- virtual QList<QString> dataInputs() const = 0;
- virtual QList<QString> dataOutputs() const = 0;
- virtual float dataInputMax(const QString &name) const = 0;
- virtual float dataInputMin(const QString &name) const = 0;
- virtual void createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties) = 0;
- virtual void deleteElements(const QStringList &elementPaths) = 0;
- virtual void createMaterials(const QString &elementPath,
- const QStringList &materialDefinitions) = 0;
- virtual void deleteMaterials(const QString &elementPath, const QStringList &materialNames) = 0;
- virtual void createMesh(const QString &name, qt3dsimp::Mesh *mesh) = 0;
- virtual void deleteMeshes(const QStringList &meshNames) = 0;
- virtual void SetAttribute(const char *elementPath, const char *attributeName,
- const char *value) = 0;
- virtual bool GetAttribute(const char *elementPath, const char *attributeName, void *value) = 0;
- virtual void FireEvent(const char *element, const char *evtName) = 0;
- virtual bool PeekCustomAction(char *&outElementPath, char *&outActionName) = 0;
- virtual bool RegisterScriptCallback(int callbackType, qml_Function func, void *inUserData) = 0;
- virtual void FireEvent(const TEventCommandHash inEventType, eastl::string inArgument) = 0;
- virtual qt3ds::foundation::Option<SPresentationSize> GetPresentationSize() = 0;
- virtual void setAssetVisitor(qt3ds::Qt3DSAssetVisitor *) = 0;
- virtual void preloadSlide(const QString &slide) = 0;
- virtual void unloadSlide(const QString &slide) = 0;
- virtual void setDelayedLoading(bool enable) = 0;
-
-public:
- static IRuntimeView &Create(ITimeProvider &inProvider, IWindowSystem &inWindowSystem,
- IAudioPlayer *inAudioPlayer = nullptr,
- QElapsedTimer *startupTimer = nullptr);
-
-public:
- QRuntimeViewSignalProxy *signalProxy();
-private:
- QRuntimeViewSignalProxy m_SignalProxy;
-};
-
-} // namespace Q3DStudio
-
-#endif // QT3DS_RUNTIME_VIEW_H
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.cpp b/src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.cpp
deleted file mode 100644
index bb9a7f95..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "EnginePrefix.h"
-#include "Qt3DSTegraInputEngine.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * XXX
- */
-CTegraInputEngine::CTegraInputEngine()
-{
-}
-
-//==============================================================================
-/**
- * XXX
- */
-CTegraInputEngine::~CTegraInputEngine()
-{
-}
-
-//==============================================================================
-/**
- * Returns the structure that contains the input information for the current frame.
- */
-SInputFrame &CTegraInputEngine::GetInputFrame()
-{
- return m_InputFrame;
-}
-
-//==============================================================================
-/**
- * Handles the input message.
- */
-void CTegraInputEngine::HandleMessage(const QEvent *inEvent,
- ITegraApplicationRenderEngine &inRenderEngine,
- CPresentation *inPresentation)
-{
- static bool s_PointerWasDown = false;
-
- if (NULL == inPresentation)
- return;
-
- switch (inEvent->type()) {
-
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- {
- const QMouseEvent *event = static_cast<const QMouseEvent *>(inEvent);
-
- QPointF pos = event->localPos();
- FLOAT x = pos.x();
- FLOAT y = pos.y();
-
- const bool pressed = inEvent->type() == QEvent::MouseButtonPress;
-
- if (inRenderEngine.IsPickValid(x, y, *inPresentation)) {
- // printf( "INPUT x %ld y %ld\n", (int)x, (int)y );
- SetPickInput(x, y, (pressed || s_PointerWasDown) ? true : false);
-
- if (pressed) {
- if (s_PointerWasDown)
- SetPickFlags(LMOUSE_DOWN);
- else
- SetPickFlags(LMOUSE_PRESSED);
-
- s_PointerWasDown = true;
- } else {
- if (s_PointerWasDown)
- SetPickFlags(LMOUSE_RELEASED);
- else
- SetPickFlags(LMOUSE_UP);
-
- s_PointerWasDown = false;
- }
- } else {
- if (s_PointerWasDown)
- SetPickFlags(LMOUSE_RELEASED);
- else
- SetPickFlags(LMOUSE_UP);
-
- s_PointerWasDown = false;
- }
- }
- break;
- default:
- break;
- }
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.h
deleted file mode 100644
index 29f20f29..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSTegraInputEngine.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_TEGRA_INPUT_ENGINE_H
-#define QT3DS_TEGRA_INPUT_ENGINE_H
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSInputEngine.h"
-#include "Qt3DSRuntimeView.h"
-#include "Qt3DSInputEventTypes.h"
-#include "Qt3DSPresentation.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class CTegraRenderEngine;
-class CPresentation;
-class ITegraApplicationRenderEngine;
-
-//==============================================================================
-/**
-* @class CTegraInputEngine
-* @brief
-*/
-class CTegraInputEngine : public CInputEngine
-{
- //==============================================================================
- // Fields
- //==============================================================================
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CTegraInputEngine();
- virtual ~CTegraInputEngine();
-
-public: // Access
- SInputFrame &GetInputFrame() override;
-
- void HandleMessage(const QEvent *inEvent, ITegraApplicationRenderEngine &inRenderEngine,
- CPresentation *inPresentation);
-};
-
-} // namespace Q3DStudio
-
-#endif // QT3DS_TEGRA_INPUT_ENGINE_H
diff --git a/src/Runtime/ogl-runtime/src/engine/Qt3DSWindowSystem.h b/src/Runtime/ogl-runtime/src/engine/Qt3DSWindowSystem.h
deleted file mode 100644
index 173dd837..00000000
--- a/src/Runtime/ogl-runtime/src/engine/Qt3DSWindowSystem.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_WINDOW_SYSTEM_H
-#define QT3DS_WINDOW_SYSTEM_H
-
-#include <QtCore/qsize.h>
-
-namespace Q3DStudio {
-
-struct SEGLInfo;
-
-class IWindowSystem
-{
-protected:
- virtual ~IWindowSystem() {}
-public:
- virtual QSize GetWindowDimensions() = 0;
- virtual void SetWindowDimensions(const QSize &inSize) = 0;
- // For platforms that support it, we get the egl info for render plugins
- // Feel free to return NULL.
- virtual SEGLInfo *GetEGLInfo() = 0;
- // on some systems we allow our default render target to be a offscreen buffer
- // otherwise return 0;
- virtual int GetDefaultRenderTargetID() = 0;
- // returns the depth buffer bit count for the render window
- virtual int GetDepthBitCount() = 0;
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/event/EventFactory.cpp b/src/Runtime/ogl-runtime/src/event/EventFactory.cpp
deleted file mode 100644
index 4bf776c6..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventFactory.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "EventFactory.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/StringTable.h"
-#include "foundation/Utils.h"
-
-using namespace qt3ds::evt;
-
-typedef char TEventChar;
-using qt3ds::QT3DSU32;
-
-class CInitableRegisteredStr : public Qt3DSEventSystemRegisteredStr
-{
-public:
- CInitableRegisteredStr(const TEventStr inString) { m_Data = inString; }
-};
-
-CFactory &CFactory::Create(qt3ds::NVFoundationBase &inFoundation)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), CFactory)(inFoundation);
-}
-
-CFactory::CFactory(qt3ds::NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , m_Allocator(inFoundation.getAllocator(), "event factory allocator")
- , m_StringTable(qt3ds::foundation::IStringTable::CreateStringTable(inFoundation.getAllocator()))
-{
-}
-
-CFactory::~CFactory()
-{
-}
-
-Qt3DSEventSystemEvent &CFactory::CreateEvent(int inNumData)
-{
- // Ensure num data is in range
- inNumData = qt3ds::NVMax(0, inNumData);
- // Ensure we can actually allocate something that big
- QT3DSU32 dataSize = static_cast<QT3DSU32>(
- qt3ds::NVMin((size_t)inNumData * sizeof(Qt3DSEventSystemEventData),
- TEventAllocator::getSlabSize() - sizeof(Qt3DSEventSystemEvent)));
- // get the actual num data after safety checks.
- inNumData = (int)(dataSize / sizeof(Qt3DSEventSystemEventData));
-
- QT3DSU32 allocSize = sizeof(Qt3DSEventSystemEvent) + inNumData * sizeof(Qt3DSEventSystemEventData);
-
- Qt3DSEventSystemEvent *theEvent = (Qt3DSEventSystemEvent *)m_Allocator.allocate(
- allocSize, "Event allocation", __FILE__, __LINE__);
- theEvent->m_NumData = inNumData;
- theEvent->m_Data = reinterpret_cast<Qt3DSEventSystemEventData *>(((qt3ds::QT3DSU8 *)theEvent)
- + sizeof(Qt3DSEventSystemEvent));
-
- // Initialize the event data to zero so that a free event won't cause a calamity.
- qt3ds::intrinsics::memZero(theEvent->m_Data, dataSize);
-
- return *theEvent;
-}
-
-size_t CFactory::GetMaxNumEventData()
-{
- return m_Allocator.getSlabSize() - sizeof(Qt3DSEventSystemEvent);
-}
-
-size_t CFactory::GetMaxStrLength()
-{
- return m_Allocator.getSlabSize();
-}
-
-void CFactory::ReleaseOutstandingEvents()
-{
- m_Allocator.reset();
-}
-
-Qt3DSEventSystemRegisteredStr CFactory::RegisterStr(TEventStr inSrc)
-{
- return CInitableRegisteredStr(m_StringTable->RegisterStr(inSrc));
-}
-
-TEventStr CFactory::AllocateStr(TEventStr inSrc)
-{
- size_t theSizeInByte = sizeof(TEventChar) * (strlen(qt3ds::foundation::nonNull(inSrc)) + 1);
- theSizeInByte = qt3ds::NVMin(theSizeInByte, TEventAllocator::getSlabSize());
-
- TEventChar *theNewString = (TEventChar *)m_Allocator.allocate(
- theSizeInByte, "Qt3DS::evt::CFactory::UnManagedString", __FILE__, __LINE__);
-
- if (theNewString)
- memcpy(theNewString, inSrc, theSizeInByte);
-
- theNewString[theSizeInByte - 1] = 0;
-
- return theNewString;
-}
-
-TEventStr CFactory::AllocateStr(int inLength)
-{
- ++inLength;
- int safeLen = (int)qt3ds::NVMin((size_t)inLength, TEventAllocator::getSlabSize());
- // Either give the users what they ask for or return nothing.
- if (safeLen != inLength)
- return NULL;
-
- void *retval = m_Allocator.allocate(inLength * sizeof(TEventChar),
- "Qt3DS::evt::CFactory::UnManagedString", __FILE__, __LINE__);
- qt3ds::intrinsics::memZero(retval, inLength);
- return (TEventStr)retval;
-}
-
-void CFactory::Release()
-{
- this->~CFactory();
- QT3DS_FREE(m_Foundation.getAllocator(), this);
-}
diff --git a/src/Runtime/ogl-runtime/src/event/EventFactory.h b/src/Runtime/ogl-runtime/src/event/EventFactory.h
deleted file mode 100644
index 10fe6b72..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventFactory.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef EVENT_FACTORY_H
-#define EVENT_FACTORY_H
-
-#include "EventSystem.h"
-#include "EventPollingSystem.h"
-
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/FastAllocator.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-namespace foundation {
- class IStringTable;
-}
-}
-
-namespace qt3ds {
-namespace evt {
-
- class CEventProviderRefCounted;
-
- class CFactory : public IEventFactory
- {
- private:
- explicit CFactory(qt3ds::NVFoundationBase &inFoundation);
- virtual ~CFactory();
-
- CFactory &operator=(const CFactory &) { return *this; }
- public:
- // Interfaces from IEventFactory
- Qt3DSEventSystemEvent &CreateEvent(int inNumData) override;
- size_t GetMaxNumEventData() override;
- size_t GetMaxStrLength() override;
-
- Qt3DSEventSystemRegisteredStr RegisterStr(TEventStr inSrc) override;
- // Null terminates if strlen(inSrc) > getMaxStrLength
- TEventStr AllocateStr(TEventStr inSrc) override;
-
- // Returns null if inLength > getMaxStrLength
- TEventStr AllocateStr(int inLength) override;
-
- void ReleaseOutstandingEvents();
- void Release();
-
- static CFactory &Create(qt3ds::NVFoundationBase &inFoundation);
-
- private:
- typedef qt3ds::foundation::SFastAllocator<> TEventAllocator;
-
- qt3ds::NVFoundationBase &m_Foundation;
- TEventAllocator m_Allocator;
- qt3ds::foundation::NVScopedRefCounted<qt3ds::foundation::IStringTable> m_StringTable;
- };
-}
-}
-
-#endif // EVENT_FACTORY_H
diff --git a/src/Runtime/ogl-runtime/src/event/EventPoller.cpp b/src/Runtime/ogl-runtime/src/event/EventPoller.cpp
deleted file mode 100644
index a8115953..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventPoller.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <EASTL/algorithm.h>
-
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAllocator.h"
-
-#include "EventPoller.h"
-#include "EventFactory.h"
-
-#define MAX_EVENTS 256
-
-using namespace qt3ds::evt;
-using qt3ds::QT3DSU32;
-
-IEventSystem &IEventSystem::Create(qt3ds::NVFoundationBase &inFoundation)
-{
- return CPoller::Create(inFoundation);
-}
-
-CPoller &CPoller::Create(qt3ds::NVFoundationBase &inFoundation)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), CPoller)(inFoundation);
-}
-
-CPoller::~CPoller()
-{
- for (QT3DSU32 idx = 0, end = m_Providers.size(); idx < end; ++idx)
- m_Providers[idx].first->Release();
- m_Providers.clear();
- ReleaseEvents();
- m_EventFactory.Release();
-}
-
-void CPoller::ReleaseEvents()
-{
- m_EventFactory.ReleaseOutstandingEvents();
-
- m_EventList.clear();
- m_EventIndex = 0;
-}
-
-static void AddProviderFn(void *inPoller, Qt3DSEventSystemEventProvider inProvider)
-{
- CPoller *thePoller = reinterpret_cast<CPoller *>(inPoller);
- thePoller->AddProvider(*thePoller->GetOrCreateEventProviderWrapper(inProvider));
-}
-
-static void RemoveProviderFn(void *inPoller, Qt3DSEventSystemEventProvider inProvider)
-{
- CPoller *thePoller = reinterpret_cast<CPoller *>(inPoller);
- CPoller::TProvider theProvider = thePoller->GetEventProviderWrapper(inProvider);
- if (theProvider)
- thePoller->RemoveProvider(*theProvider);
- thePoller->ReleaseEventProviderWrapper(inProvider);
-}
-
-static int IgnoreProviderFn(void *inPoller, Qt3DSEventSystemEventProvider inProvider)
-{
- CPoller *thePoller = reinterpret_cast<CPoller *>(inPoller);
- CPoller::TProvider theProvider = thePoller->GetEventProviderWrapper(inProvider);
- if (theProvider)
- return thePoller->IgnoreProvider(*theProvider);
- return 0;
-}
-
-static int ActivateProviderFn(void *inPoller, Qt3DSEventSystemEventProvider inProvider)
-{
- CPoller *thePoller = reinterpret_cast<CPoller *>(inPoller);
- CPoller::TProvider theProvider = thePoller->GetEventProviderWrapper(inProvider);
- if (theProvider)
- return thePoller->ActivateProvider(*theProvider);
- return 0;
-}
-
-CPoller::CPoller(qt3ds::NVFoundationBase &inFoundation)
- : mRefCount(0)
- , m_Foundation(inFoundation)
- , m_EventFactory(CFactory::Create(inFoundation))
- , m_Providers(inFoundation.getAllocator(), "CPoller::m_Providers")
- , m_EventList(inFoundation.getAllocator(), "CPoller::m_EventList")
- , m_EventIndex(0)
- , m_EventFetched(false)
-{
- m_CInterface.m_Poller = this;
- m_CInterface.addProvider = AddProviderFn;
- m_CInterface.removeProvider = RemoveProviderFn;
- m_CInterface.ignoreProvider = IgnoreProviderFn;
- m_CInterface.activateProvider = ActivateProviderFn;
-}
-
-struct SProviderSearch
-{
- IEventProvider *m_Provider;
- SProviderSearch(IEventProvider &inProvider)
- : m_Provider(&inProvider)
- {
- }
- bool operator()(const eastl::pair<CPoller::TProvider, bool> &item)
- {
- return item.first == m_Provider;
- }
-};
-
-void CPoller::AddProvider(IEventProvider &inProvider)
-{
- TProviderList::iterator iter =
- eastl::find_if(m_Providers.begin(), m_Providers.end(), SProviderSearch(inProvider));
- if (iter == m_Providers.end())
- m_Providers.push_back(eastl::make_pair(&inProvider, true));
-}
-
-void CPoller::RemoveProvider(IEventProvider &inProvider)
-{
- TProviderList::iterator thePos =
- eastl::find_if(m_Providers.begin(), m_Providers.end(), SProviderSearch(inProvider));
- if (thePos != m_Providers.end())
- m_Providers.erase(thePos);
-}
-
-bool CPoller::IgnoreProvider(IEventProvider &inProvider)
-{
- TProviderList::iterator thePos =
- eastl::find_if(m_Providers.begin(), m_Providers.end(), SProviderSearch(inProvider));
- if (thePos != m_Providers.end()) {
- thePos->second = false;
- return true;
- }
- return false;
-}
-
-bool CPoller::ActivateProvider(IEventProvider &inProvider)
-{
- TProviderList::iterator thePos =
- eastl::find_if(m_Providers.begin(), m_Providers.end(), SProviderSearch(inProvider));
- if (thePos != m_Providers.end()) {
- thePos->second = true;
- return true;
- }
- return false;
-}
-
-Qt3DSEventSystemEvent *CPoller::GetNextEvent(bool inAllowResetBuffer)
-{
- if (m_EventIndex < m_EventList.size()) {
- Qt3DSEventSystemEvent *retval = m_EventList[m_EventIndex];
- ++m_EventIndex;
- return retval;
- }
- if (inAllowResetBuffer) {
- ReleaseEvents();
- }
- size_t theNewEventCount = 0;
- for (QT3DSU32 idx = 0, end = m_Providers.size(); idx < end; ++idx) {
- if (m_Providers[idx].second) {
- Qt3DSEventSystemEvent *evtBuffer[MAX_EVENTS];
- for (QT3DSU32 numEvents = (QT3DSU32)(m_Providers[idx].first)
- ->GetNextEvents(m_EventFactory, evtBuffer, MAX_EVENTS);
- numEvents;
- numEvents = (QT3DSU32)(m_Providers[idx].first)
- ->GetNextEvents(m_EventFactory, evtBuffer, MAX_EVENTS)) {
- m_EventList.insert(m_EventList.end(), evtBuffer, evtBuffer + numEvents);
- ++theNewEventCount;
- }
- }
- }
- if (theNewEventCount)
- return GetNextEvent(inAllowResetBuffer);
-
- return NULL;
-}
-
-size_t CPoller::GetNextEvents(Qt3DSEventSystemEvent **outBuffer, size_t bufLen)
-{
- m_EventFetched = true;
- size_t bufIdx = 0;
- bool theAllowResetBuffer = true;
- for (; bufIdx < bufLen; ++bufIdx) {
- Qt3DSEventSystemEvent *evt = GetNextEvent(theAllowResetBuffer);
- if (!evt)
- break;
- theAllowResetBuffer = false;
- outBuffer[bufIdx] = evt;
- }
- return bufIdx;
-}
-
-IEventFactory &CPoller::GetEventFactory()
-{
- return m_EventFactory;
-}
-
-Qt3DSEventSystemEventPoller *CPoller::GetCInterface()
-{
- return &m_CInterface;
-}
-
-bool CPoller::GetAndClearEventFetchedFlag()
-{
- bool theOld = m_EventFetched;
- m_EventFetched = false;
- return theOld;
-}
-
-void CPoller::PurgeEvents()
-{
- // Get events from providers and drop,
- // so the providers need not to provide an additional interface for clear events
- static const size_t EVENTS_NUM_ONCE_CLEAR = 512;
- Qt3DSEventSystemEvent *theEvents[EVENTS_NUM_ONCE_CLEAR];
- GetNextEvents(theEvents, EVENTS_NUM_ONCE_CLEAR);
- ReleaseEvents();
-}
-
-void CPoller::addRef()
-{
- qt3ds::foundation::atomicIncrement(&mRefCount);
-}
-
-void CPoller::release()
-{
- qt3ds::QT3DSI32 value = qt3ds::foundation::atomicDecrement(&mRefCount);
- if (value <= 0) {
- qt3ds::NVAllocatorCallback &alloc(m_Foundation.getAllocator());
- this->~CPoller();
- QT3DS_FREE(alloc, this);
- }
-}
-
-struct SProviderFinder
-{
- void *m_Key;
- SProviderFinder(void *k)
- : m_Key(k)
- {
- }
- bool operator()(const CPoller::TCEventProviderPair &inPair)
- {
- if (inPair.first == m_Key)
- return true;
- return false;
- }
-};
-
-static Qt3DSEventSystemEvent *CreateEventFn(void *inFactory, int numData)
-{
- IEventFactory *theFactory = reinterpret_cast<IEventFactory *>(inFactory);
- return &theFactory->CreateEvent(numData);
-}
-
-static size_t MaxNumEventDataFn(void *inFactory)
-{
- IEventFactory *theFactory = reinterpret_cast<IEventFactory *>(inFactory);
- return theFactory->GetMaxNumEventData();
-}
-
-static size_t MaxStrLenFn(void *inFactory)
-{
- IEventFactory *theFactory = reinterpret_cast<IEventFactory *>(inFactory);
- return theFactory->GetMaxStrLength();
-}
-
-static Qt3DSEventSystemRegisteredStr RegisterStrFn(void *inFactory, Qt3DSEventSystemStr inStr)
-{
- IEventFactory *theFactory = reinterpret_cast<IEventFactory *>(inFactory);
- return theFactory->RegisterStr(inStr);
-}
-
-static Qt3DSEventSystemStr AllocateStrFn(void *inFactory, Qt3DSEventSystemStr inStr)
-{
- IEventFactory *theFactory = reinterpret_cast<IEventFactory *>(inFactory);
- return theFactory->AllocateStr(inStr);
-}
-
-static Qt3DSEventSystemStr AllocateStrLenFn(void *inFactory, int len)
-{
- IEventFactory *theFactory = reinterpret_cast<IEventFactory *>(inFactory);
- return theFactory->AllocateStr(len);
-}
-
-struct SWrappedProvider : public IEventProvider
-{
- Qt3DSEventSystemEventProvider m_Provider;
- SWrappedProvider(Qt3DSEventSystemEventProvider prov)
- : m_Provider(prov)
- {
- }
-
- size_t GetNextEvents(IEventFactory &inFactory, Qt3DSEventSystemEvent **outBuffer,
- size_t bufLen) override
- {
- if (m_Provider.m_Provider) {
- Qt3DSEventSystemEventFactory theFactory;
- theFactory.m_Factory = &inFactory;
- theFactory.createEvent = CreateEventFn;
- theFactory.getMaxNumEventData = MaxNumEventDataFn;
- theFactory.getMaxStrLength = MaxStrLenFn;
- theFactory.registerStr = RegisterStrFn;
- theFactory.allocateStr = AllocateStrFn;
- theFactory.allocateStrLen = AllocateStrLenFn;
- return m_Provider.getNextEvents(m_Provider.m_Provider, theFactory, outBuffer, bufLen);
- }
- return 0;
- }
-
- void Release() override
- {
- if (m_Provider.m_Provider)
- m_Provider.release(m_Provider.m_Provider);
- delete this;
- }
-};
-
-CPoller::TProvider CPoller::GetEventProviderWrapper(Qt3DSEventSystemEventProvider inProvider)
-{
- TCEventProviderList::iterator iter = eastl::find_if(
- m_CEventProviders.begin(), m_CEventProviders.end(), SProviderFinder(inProvider.m_Provider));
- if (iter != m_CEventProviders.end())
- return iter->second;
- return TProvider();
-}
-
-CPoller::TProvider CPoller::GetOrCreateEventProviderWrapper(Qt3DSEventSystemEventProvider inProvider)
-{
- TCEventProviderList::iterator iter = eastl::find_if(
- m_CEventProviders.begin(), m_CEventProviders.end(), SProviderFinder(inProvider.m_Provider));
- if (iter == m_CEventProviders.end()) {
- TProvider retval = new SWrappedProvider(inProvider);
- m_CEventProviders.push_back(eastl::make_pair(inProvider.m_Provider, retval));
- return retval;
- }
- return iter->second;
-}
-
-void CPoller::ReleaseEventProviderWrapper(Qt3DSEventSystemEventProvider inProvider)
-{
- TCEventProviderList::iterator iter = eastl::find_if(
- m_CEventProviders.begin(), m_CEventProviders.end(), SProviderFinder(inProvider.m_Provider));
- if (iter != m_CEventProviders.end()) {
- SWrappedProvider &wrappedProvider = static_cast<SWrappedProvider &>(*iter->second);
- wrappedProvider.m_Provider.m_Provider = NULL;
- m_CEventProviders.erase(
- iter); // deletes the wrapper but does not release the wrapped provider.
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/event/EventPoller.h b/src/Runtime/ogl-runtime/src/event/EventPoller.h
deleted file mode 100644
index 99ac27d6..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventPoller.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef EVENT_POLLER_H
-#define EVENT_POLLER_H
-
-#include <EASTL/vector.h>
-
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSContainers.h"
-
-#include "EventSystem.h"
-#include "EventPollingSystem.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace evt {
-
- class CFactory;
-
- class CPoller : public IEventSystem
- {
- public:
- typedef IEventProvider *TProvider;
- typedef qt3ds::foundation::nvvector<eastl::pair<TProvider, bool>> TProviderList;
- typedef qt3ds::foundation::nvvector<Qt3DSEventSystemEvent *> TEventList;
- typedef eastl::pair<void *, TProvider> TCEventProviderPair;
- typedef eastl::vector<TCEventProviderPair> TCEventProviderList;
-
- private:
- explicit CPoller(qt3ds::NVFoundationBase &inFoundation);
- virtual ~CPoller();
-
- public:
- // Providers once added are released if the poller goes out of scope.
- void AddProvider(IEventProvider &inProvider) override;
- void RemoveProvider(IEventProvider &inProvider) override;
- bool IgnoreProvider(IEventProvider &inProvider) override;
- bool ActivateProvider(IEventProvider &inProvider) override;
- size_t GetNextEvents(Qt3DSEventSystemEvent **outBuffer, size_t bufLen) override;
- IEventFactory &GetEventFactory() override;
- Qt3DSEventSystemEventPoller *GetCInterface() override;
- bool GetAndClearEventFetchedFlag() override;
- void PurgeEvents() override;
-
- void ReleaseEvents();
-
- void addRef() override;
- void release() override;
-
- TProvider GetEventProviderWrapper(Qt3DSEventSystemEventProvider inProvider);
- TProvider GetOrCreateEventProviderWrapper(Qt3DSEventSystemEventProvider inProvider);
- void ReleaseEventProviderWrapper(Qt3DSEventSystemEventProvider inProvider);
-
- static CPoller &Create(qt3ds::NVFoundationBase &inFoundation);
-
- private:
- Qt3DSEventSystemEvent *GetNextEvent(bool inAllowResetBuffer /* = true*/);
-
- qt3ds::QT3DSI32 mRefCount;
- qt3ds::NVFoundationBase &m_Foundation;
- CFactory &m_EventFactory;
- TProviderList m_Providers;
- TEventList m_EventList;
- qt3ds::QT3DSU32 m_EventIndex;
- Qt3DSEventSystemEventPoller m_CInterface;
- TCEventProviderList m_CEventProviders;
- bool m_EventFetched;
- };
-}
-}
-
-#endif // EVENT_POLLER_H
diff --git a/src/Runtime/ogl-runtime/src/event/EventPollingSystem.h b/src/Runtime/ogl-runtime/src/event/EventPollingSystem.h
deleted file mode 100644
index 4d414066..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventPollingSystem.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef EVENT_SYSTEM_H
-#define EVENT_SYSTEM_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "EventSystem.h"
-
-namespace qt3ds {
-namespace evt {
-
- class CEventProviderRefCounted;
-
- class IEventSystem : public qt3ds::foundation::NVRefCounted
- {
- protected:
- virtual ~IEventSystem() {}
- public:
- // Providers once added are released if the poller goes out of scope.
- // Adding the same provider twice has no effect.
- virtual void AddProvider(IEventProvider &inProvider) = 0;
-
- // removeProvider does not release the provider; callers are expected to release the
- // provider themselves after calling remove provider. Calling remove provider
- // with a provider that isn't in the system has no effect.
- virtual void RemoveProvider(IEventProvider &inProvider) = 0;
-
- // Ignore events from this provider. Returns true if provider is added.
- virtual bool IgnoreProvider(IEventProvider &inProvider) = 0;
-
- // Listen on this provider. Returns true if provider is added.
- virtual bool ActivateProvider(IEventProvider &inProvider) = 0;
-
- // Get a set of events from the poller. The poller will simply run through and ask each
- // provider
- // for events and then begin returning the set of events.
- // Note: this interface needs to set the event fetched flag.
- virtual size_t GetNextEvents(Qt3DSEventSystemEvent **outBuffer, size_t bufLen) = 0;
-
- // Get the event factory used for this poller.
- virtual IEventFactory &GetEventFactory() = 0;
-
- virtual Qt3DSEventSystemEventPoller *GetCInterface() = 0;
-
- // Get and clear the flag indicates whether GetNextEvents has been called after last call of
- // this interface
- // Note: the event fetched flag is set by GetNextEvents
- virtual bool GetAndClearEventFetchedFlag() = 0;
-
- // Clear events in event system and events in all providers
- virtual void PurgeEvents() = 0;
-
- static IEventSystem &Create(qt3ds::NVFoundationBase &inFoundation);
- };
-}
-}
-
-#endif // EVENT_SYSTEM_H
diff --git a/src/Runtime/ogl-runtime/src/event/EventSystem.h b/src/Runtime/ogl-runtime/src/event/EventSystem.h
deleted file mode 100644
index a9e3dbc5..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventSystem.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MESSAGE_SYSTEM_H
-#define MESSAGE_SYSTEM_H
-#include <cstdlib>
-#include "EventSystemC.h"
-
-namespace qt3ds {
-namespace evt {
-
- typedef Qt3DSEventSystemStr TEventStr;
-
- // Factory from the provider's perspective.
- class IEventFactory
- {
- protected:
- virtual ~IEventFactory() {}
- public:
- virtual Qt3DSEventSystemEvent &CreateEvent(int numData) = 0;
- // Guaranteed to be at least 4K - sizeof(Qt3DSEventSystemEvent)
- virtual size_t GetMaxNumEventData() = 0;
- // Guaranteed to be at least 4K
- virtual size_t GetMaxStrLength() = 0;
-
- virtual Qt3DSEventSystemRegisteredStr RegisterStr(TEventStr inSrc) = 0;
- // Null terminates if strlen(inSrc) > getMaxStrLength
- virtual TEventStr AllocateStr(TEventStr inSrc) = 0;
- // Returns null if inLength > getMaxStrLength
- virtual TEventStr AllocateStr(int inLength) = 0;
- };
-
- class IEventProvider
- {
- protected:
- virtual ~IEventProvider() {}
- public:
- // Return the next N events, placed into the event buffer.
- virtual size_t GetNextEvents(IEventFactory &inFactory, Qt3DSEventSystemEvent **outBuffer,
- size_t bufLen) = 0;
- virtual void Release() = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/event/EventSystemC.cpp b/src/Runtime/ogl-runtime/src/event/EventSystemC.cpp
deleted file mode 100644
index 8bfdb81c..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventSystemC.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "EventSystemC.h"
-
-const char *PROVIDER_TABLE_ENTRY = "__provider_impl";
-const char *POLLER_TABLE_ENTRY = "__poller_impl"; \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/event/EventSystemC.h b/src/Runtime/ogl-runtime/src/event/EventSystemC.h
deleted file mode 100644
index 2517eae4..00000000
--- a/src/Runtime/ogl-runtime/src/event/EventSystemC.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_EVENT_SYSTEM_C_H
-#define QT3DS_EVENT_SYSTEM_C_H
-#include <stddef.h> //size_t
-
-// Interface we expect plugins to use in order to interace with the event system.
-// This interface is design to avoid using c++ vtables and the C++ abi isn't stable
-// across compilers.
-
-#ifdef _cplusplus
-extern "C" {
-#endif
-
-// Obnoxious long names to void namespace conflicts
-enum QT3DSEventSystemEventTypes {
- QT3DSEventSystemEventTypesNoData = 0,
- QT3DSEventSystemEventTypesString = 1,
- QT3DSEventSystemEventTypesNumber = 2,
-};
-
-typedef const char *Qt3DSEventSystemStr;
-
-typedef struct _Qt3DSEventSystemEventValue
-{
- QT3DSEventSystemEventTypes m_Type;
- double m_Number;
- Qt3DSEventSystemStr m_String;
-} Qt3DSEventSystemEventValue;
-
-typedef struct _Qt3DSEventSystemRegisteredStr
-{
- Qt3DSEventSystemStr m_Data;
-} Qt3DSEventSystemRegisteredStr;
-
-typedef struct _Qt3DSEventSystemEventData
-{
- Qt3DSEventSystemRegisteredStr m_Name;
- Qt3DSEventSystemEventValue m_Value;
-} Qt3DSEventSystemEventData;
-
-typedef struct _Qt3DSEventSystemEvent
-{
- Qt3DSEventSystemEventData *m_Data; // contiguous block of event data.
- int m_NumData;
-} Qt3DSEventSystemEvent;
-
-typedef Qt3DSEventSystemEvent *(*Qt3DSEventSystemEventFactoryCreateEventFn)(void *inFactory,
- int numData);
-typedef size_t (*Qt3DSEventSystemEventFactoryMaxNumEventDataFn)(void *inFactory);
-typedef size_t (*Qt3DSEventSystemEventFactoryMaxStrLenFn)(void *inFactory);
-typedef Qt3DSEventSystemRegisteredStr (*Qt3DSEventSystemEventFactoryRegisterStrFn)(
- void *inFactory, Qt3DSEventSystemStr inStr);
-typedef Qt3DSEventSystemStr (*Qt3DSEventSystemEventFactoryAllocateStrFn)(void *inFactory,
- Qt3DSEventSystemStr inStr);
-typedef Qt3DSEventSystemStr (*Qt3DSEventSystemEventFactoryAllocateStrLenFn)(void *inFactory, int len);
-
-// Factory from the provider's perspective.
-typedef struct _Qt3DSEventSystemEventFactory
-{
- void *m_Factory;
- Qt3DSEventSystemEventFactoryCreateEventFn createEvent;
- Qt3DSEventSystemEventFactoryMaxNumEventDataFn getMaxNumEventData;
- Qt3DSEventSystemEventFactoryMaxStrLenFn getMaxStrLength;
- Qt3DSEventSystemEventFactoryRegisterStrFn registerStr;
- Qt3DSEventSystemEventFactoryAllocateStrFn allocateStr;
- Qt3DSEventSystemEventFactoryAllocateStrLenFn allocateStrLen;
-
-} Qt3DSEventSystemEventFactory;
-
-typedef size_t (*Qt3DSEventSystemProviderGetNextEventsFn)(void *inProvider,
- Qt3DSEventSystemEventFactory inFactory,
- Qt3DSEventSystemEvent **outBuffer,
- size_t outBufLen);
-typedef void (*Qt3DSEventSystemProviderReleaseFn)(void *inProvider);
-
-typedef struct _Qt3DSEventSystemEventProvider
-{
- void *m_Provider;
- Qt3DSEventSystemProviderGetNextEventsFn getNextEvents;
- Qt3DSEventSystemProviderReleaseFn release;
-} Qt3DSEventSystemEventProvider;
-
-typedef void (*Qt3DSEventSystemPollerAddProviderFn)(void *inPoller,
- Qt3DSEventSystemEventProvider inProvider);
-typedef void (*Qt3DSEventSystemPollerRemoveProviderFn)(void *inPoller,
- Qt3DSEventSystemEventProvider inProvider);
-typedef int (*Qt3DSEventSystemPollerignoreProviderFn)(void *inPoller,
- Qt3DSEventSystemEventProvider inProvider);
-typedef int (*Qt3DSEventSystemPolleractivateProviderFn)(void *inPoller,
- Qt3DSEventSystemEventProvider inProvider);
-
-typedef struct _Qt3DSEventSystemEventPoller
-{
- void *m_Poller;
- // Providers, once added, will be released by the event poller unless removed
- Qt3DSEventSystemPollerAddProviderFn addProvider;
- // Callers are responsible for releasing removed providers.
- Qt3DSEventSystemPollerRemoveProviderFn removeProvider;
- Qt3DSEventSystemPollerignoreProviderFn ignoreProvider;
- Qt3DSEventSystemPolleractivateProviderFn activateProvider;
-
-} Qt3DSEventSystemEventPoller;
-
-extern const char *PROVIDER_TABLE_ENTRY;
-extern const char *POLLER_TABLE_ENTRY;
-
-#ifdef _cplusplus
-}
-#endif
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.cpp b/src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.cpp
deleted file mode 100644
index dc51e9db..00000000
--- a/src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <time.h>
-#include <math.h>
-
-#include "CanProviderDemo.h"
-
-CCanProviderDemo::CCanProviderDemo()
- : m_Frame(0)
- , m_LastClock(0)
-{
-}
-
-CCanProviderDemo::~CCanProviderDemo()
-{
-}
-
-unsigned short g_VehicleSpeedData[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14, 16,
- 18, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136,
- 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264,
- 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392,
- 400, 408, 416, 424, 432, 440, 448, 456, 462, 468, 474, 480, 486, 492, 498, 504,
- 510, 516, 522, 528, 534, 540, 546, 552, 558, 564, 570, 576, 582, 588, 594, 600,
- 606, 612, 618, 624, 630, 636, 642, 648, 654, 660, 666, 672, 678, 684, 690, 696,
- 702, 708, 714, 720, 726, 732, 738, 744, 750, 756, 762, 768, 774, 780, 786, 792,
- 798, 804, 810, 816, 820, 824, 828, 832, 836, 840, 844, 848, 852, 856, 860, 864,
- 868, 872, 876, 880, 884, 888, 892, 896, 900, 904, 908, 912, 916, 920, 924, 928,
- 932, 936, 940, 944, 948, 952, 956, 960, 964, 968, 972, 976, 980, 984, 988, 992,
- 996, 1000, 1004, 1008, 1012, 1016, 1020, 1024, 1028, 1032, 1036, 1040, 1044, 1048, 1052, 1056,
- 1054, 1052, 1050, 1048, 1046, 1044, 1042, 1040, 1038, 1036, 1034, 1032, 1030, 1028, 1026, 1024,
- 1022, 1020, 1018, 1016, 1014, 1012, 1010, 1008, 1006, 1004, 1002, 1000, 998, 996, 994, 992,
- 990, 988, 986, 984, 982, 980, 978, 976, 974, 972, 970, 968, 966, 964, 962, 960,
- 958, 956, 954, 952, 950, 948, 946, 944, 942, 940, 938, 936, 934, 932, 930, 928,
- 926, 924, 922, 920, 918, 916, 914, 912, 910, 908, 906, 904, 902, 900, 898, 896,
- 894, 892, 890, 888, 886, 884, 882, 880, 878, 876, 874, 872, 870, 868, 866, 864,
- 862, 860, 858, 856, 854, 852, 850, 848, 846, 844, 842, 840, 838, 836, 834, 832,
- 830, 828, 826, 824, 822, 820, 818, 816, 823, 830, 837, 844, 851, 858, 865, 872,
- 879, 886, 893, 900, 907, 914, 921, 928, 935, 942, 949, 956, 963, 970, 977, 984,
- 991, 998, 1005, 1012, 1019, 1026, 1033, 1040, 1047, 1054, 1061, 1068, 1075, 1082, 1089, 1096,
- 1103, 1110, 1117, 1124, 1131, 1138, 1145, 1152, 1159, 1166, 1173, 1180, 1187, 1194, 1201, 1208,
- 1215, 1222, 1229, 1236, 1246, 1256, 1266, 1276, 1286, 1296, 1306, 1316, 1326, 1336, 1346, 1356,
- 1366, 1376, 1386, 1396, 1406, 1416, 1426, 1436, 1446, 1456, 1466, 1476, 1486, 1496, 1506, 1516,
- 1526, 1536, 1546, 1556, 1566, 1576, 1586, 1596, 1606, 1616, 1626, 1636, 1646, 1656, 1666, 1676,
- 1686, 1696, 1706, 1716, 1726, 1736, 1746, 1756, 1766, 1776, 1786, 1796, 1806, 1816, 1826, 1836,
- 1836, 1836, 1836, 1834, 1832, 1830, 1828, 1826, 1824, 1822, 1820, 1818, 1816, 1814, 1812, 1810,
- 1808, 1806, 1804, 1802, 1800, 1798, 1796, 1794, 1792, 1790, 1788, 1786, 1784, 1782, 1780, 1778,
- 1776, 1774, 1772, 1770, 1768, 1766, 1764, 1762, 1760, 1758, 1756, 1754, 1752, 1750, 1748, 1746,
- 1744, 1742, 1740, 1738, 1736, 1734, 1732, 1730, 1728, 1726, 1724, 1722, 1723, 1724, 1725, 1726,
- 1728, 1730, 1732, 1734, 1736, 1738, 1740, 1742, 1744, 1746, 1748, 1750, 1753, 1756, 1759, 1762,
- 1765, 1768, 1771, 1774, 1777, 1780, 1783, 1786, 1789, 1792, 1795, 1798, 1801, 1804, 1807, 1810,
- 1813, 1816, 1819, 1822, 1825, 1828, 1831, 1834, 1837, 1840, 1843, 1846, 1849, 1852, 1855, 1858,
- 1861, 1864, 1867, 1870, 1873, 1876, 1879, 1882, 1885, 1888, 1891, 1894, 1897, 1900, 1903, 1906,
- 1909, 1912, 1915, 1918, 1921, 1924, 1927, 1930, 1933, 1936, 1939, 1942, 1945, 1948, 1951, 1954,
- 1957, 1960, 1963, 1966, 1969, 1972, 1975, 1978, 1981, 1984, 1987, 1990, 1993, 1996, 1999, 2002,
- 2005, 2008, 2011, 2014, 2017, 2020, 2023, 2026, 2029, 2032, 2035, 2038, 2041, 2044, 2047, 2050,
- 2053, 2056, 2059, 2062, 2064, 2066, 2068, 2070, 2072, 2074, 2076, 2078, 2080, 2082, 2084, 2086,
- 2088, 2090, 2092, 2094, 2096, 2098, 2100, 2102, 2104, 2106, 2108, 2110, 2112, 2114, 2116, 2118,
- 2120, 2122, 2124, 2126, 2128, 2130, 2132, 2134, 2136, 2138, 2140, 2142, 2144, 2146, 2148, 2150,
- 2152, 2154, 2156, 2158, 2160, 2162, 2164, 2166, 2168, 2170, 2172, 2174, 2176, 2178, 2180, 2182,
- 2184, 2186, 2188, 2190, 2192, 2194, 2196, 2198, 2200, 2202, 2204, 2206, 2208, 2210, 2212, 2214,
- 2216, 2218, 2220, 2222, 2224, 2226, 2228, 2230, 2232, 2234, 2236, 2238, 2240, 2242, 2244, 2246,
- 2248, 2250, 2252, 2254, 2256, 2258, 2260, 2262, 2264, 2266, 2268, 2270, 2272, 2274, 2276, 2278,
- 2280, 2282, 2284, 2286, 2288, 2290, 2292, 2294, 2296, 2298, 2300, 2302, 2301, 2300, 2299, 2298,
- 2297, 2296, 2295, 2294, 2293, 2292, 2291, 2290, 2289, 2288, 2287, 2286, 2285, 2284, 2283, 2282,
- 2281, 2280, 2279, 2278, 2277, 2276, 2275, 2274, 2273, 2272, 2271, 2270, 2269, 2268, 2267, 2266,
- 2265, 2264, 2263, 2262, 2261, 2260, 2259, 2258, 2257, 2256, 2255, 2254, 2253, 2252, 2251, 2250,
- 2249, 2248, 2247, 2246, 2245, 2244, 2243, 2242, 2239, 2236, 2233, 2230, 2227, 2224, 2221, 2218,
- 2215, 2212, 2209, 2206, 2203, 2200, 2197, 2194, 2191, 2188, 2185, 2182, 2179, 2176, 2173, 2170,
- 2167, 2164, 2161, 2158, 2155, 2152, 2149, 2146, 2143, 2140, 2137, 2134, 2131, 2128, 2125, 2122,
- 2119, 2116, 2113, 2110, 2107, 2104, 2101, 2098, 2095, 2092, 2089, 2086, 2083, 2080, 2077, 2074,
- 2071, 2068, 2065, 2062, 2058, 2054, 2050, 2046, 2042, 2038, 2034, 2030, 2026, 2022, 2018, 2014,
- 2010, 2006, 2001, 1996, 1991, 1986, 1981, 1976, 1971, 1966, 1961, 1956, 1951, 1946, 1941, 1936,
- 1931, 1926, 1921, 1916, 1911, 1906, 1901, 1896, 1891, 1886, 1881, 1876, 1871, 1866, 1861, 1856,
- 1851, 1846, 1841, 1836, 1831, 1826, 1821, 1816, 1811, 1806, 1801, 1796, 1791, 1786, 1781, 1776,
- 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776,
- 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776,
- 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776,
- 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1779, 1782, 1785, 1788,
- 1791, 1794, 1797, 1800, 1803, 1806, 1809, 1812, 1815, 1818, 1821, 1824, 1827, 1830, 1833, 1836,
- 1839, 1842, 1845, 1848, 1851, 1854, 1857, 1860, 1863, 1866, 1869, 1872, 1875, 1878, 1881, 1884,
- 1887, 1890, 1893, 1896, 1899, 1902, 1905, 1908, 1911, 1914, 1917, 1920, 1923, 1926, 1929, 1932,
- 1935, 1938, 1941, 1944, 1947, 1950, 1953, 1956, 1958, 1960, 1962, 1964, 1966, 1968, 1970, 1972,
- 1974, 1976, 1978, 1980, 1982, 1984, 1986, 1988, 1990, 1992, 1994, 1996, 1998, 2000, 2002, 2004,
- 2006, 2008, 2010, 2012, 2014, 2016, 2018, 2020, 2022, 2024, 2026, 2028, 2030, 2032, 2034, 2036,
- 2038, 2040, 2042, 2044, 2046, 2048, 2050, 2052, 2054, 2056, 2058, 2060, 2062, 2064, 2066, 2068,
- 2070, 2072, 2074, 2076, 2078, 2080, 2082, 2084, 2086, 2088, 2090, 2092, 2094, 2096, 2098, 2100,
- 2102, 2104, 2106, 2108, 2110, 2112, 2114, 2116, 2118, 2120, 2122, 2124, 2126, 2128, 2130, 2132,
- 2134, 2136, 2138, 2140, 2142, 2144, 2146, 2148, 2150, 2152, 2154, 2156, 2158, 2160, 2162, 2164,
- 2166, 2168, 2170, 2172, 2174, 2176, 2178, 2180, 2182, 2184, 2186, 2188, 2190, 2192, 2194, 2196,
- 2198, 2200, 2202, 2204, 2206, 2208, 2210, 2212, 2214, 2216, 2218, 2220, 2222, 2224, 2226, 2228,
- 2230, 2232, 2234, 2236, 2238, 2240, 2242, 2244, 2246, 2248, 2250, 2252, 2254, 2256, 2258, 2260,
- 2262, 2264, 2266, 2268, 2270, 2272, 2274, 2276, 2278, 2280, 2282, 2284, 2286, 2288, 2290, 2292,
- 2294, 2296, 2298, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312,
- 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328,
- 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344,
- 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360,
- 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2366, 2364, 2362, 2360, 2358, 2356, 2354, 2352,
- 2350, 2348, 2346, 2344, 2342, 2340, 2338, 2336, 2334, 2332, 2330, 2328, 2326, 2324, 2322, 2320,
- 2318, 2316, 2314, 2312, 2310, 2308, 2306, 2304, 2302, 2300, 2298, 2296, 2294, 2292, 2290, 2288,
- 2286, 2284, 2282, 2280, 2278, 2276, 2274, 2272, 2270, 2268, 2266, 2264, 2262, 2260, 2258, 2256,
- 2254, 2252, 2250, 2248, 2240, 2230, 2220, 2210, 2200, 2190, 2180, 2170, 2160, 2150, 2140, 2130,
- 2120, 2110, 2100, 2090, 2080, 2070, 2060, 2050, 2040, 2030, 2020, 2010, 2000, 1990, 1980, 1970,
- 1960, 1950, 1940, 1930, 1920, 1910, 1900, 1890, 1880, 1870, 1860, 1850, 1840, 1830, 1820, 1810,
- 1800, 1790, 1780, 1770, 1760, 1750, 1740, 1730, 1720, 1710, 1700, 1690, 1680, 1670, 1660, 1650,
- 1645, 1640, 1635, 1630, 1625, 1620, 1615, 1610, 1605, 1600, 1595, 1590, 1585, 1580, 1575, 1570,
- 1565, 1560, 1555, 1550, 1545, 1540, 1535, 1530, 1525, 1520, 1515, 1510, 1505, 1500, 1495, 1490,
- 1485, 1480, 1475, 1470, 1465, 1460, 1455, 1450, 1445, 1440, 1435, 1430, 1425, 1420, 1415, 1410,
- 1405, 1400, 1395, 1390, 1385, 1380, 1375, 1370, 1365, 1360, 1355, 1350, 1345, 1340, 1335, 1330,
- 1325, 1320, 1315, 1310, 1305, 1300, 1295, 1290, 1285, 1280, 1275, 1270, 1265, 1260, 1255, 1250,
- 1245, 1240, 1235, 1230, 1225, 1220, 1215, 1210, 1205, 1200, 1195, 1190, 1185, 1180, 1175, 1170,
- 1165, 1160, 1155, 1150, 1145, 1140, 1135, 1130, 1125, 1120, 1115, 1110, 1105, 1100, 1090, 1088,
- 1086, 1084, 1082, 1080, 1078, 1076, 1074, 1072, 1070, 1065, 1060, 1055, 1050, 1045, 1040, 1035,
- 1030, 1025, 1020, 1015, 1010, 1005, 1000, 995, 990, 985, 980, 975, 970, 965, 960, 955,
- 950, 945, 940, 935, 930, 925, 920, 915, 910, 905, 900, 895, 890, 885, 880, 875,
- 870, 865, 860, 855, 850, 845, 840, 835, 830, 825, 820, 815, 810, 805, 800, 795,
- 790, 785, 780, 775, 772, 769, 766, 763, 760, 757, 754, 751, 748, 745, 742, 739,
- 736, 733, 730, 727, 724, 721, 718, 715, 712, 709, 706, 703, 700, 697, 694, 691,
- 688, 685, 682, 679, 676, 673, 670, 667, 664, 661, 658, 655, 652, 649, 646, 643,
- 640, 637, 634, 631, 628, 625, 622, 619, 616, 613, 610, 607, 604, 601, 598, 595,
- 597, 599, 601, 603, 605, 607, 609, 611, 613, 615, 617, 619, 621, 623, 625, 627,
- 629, 631, 633, 635, 637, 639, 641, 643, 645, 647, 649, 651, 653, 655, 657, 659,
- 661, 663, 665, 667, 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, 689, 691,
- 693, 695, 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, 715, 715, 715, 715,
- 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
- 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
- 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, 715,
- 715, 715, 715, 715, 715, 715, 715, 715, 710, 705, 700, 695, 690, 685, 680, 675,
- 670, 665, 660, 655, 650, 645, 640, 635, 630, 625, 620, 615, 610, 605, 600, 595,
- 590, 585, 580, 575, 570, 565, 560, 555, 550, 545, 540, 535, 530, 525, 520, 515,
- 510, 505, 500, 495, 490, 485, 480, 475, 470, 465, 460, 455, 450, 445, 440, 435,
- 430, 425, 420, 415, 417, 419, 421, 423, 425, 427, 429, 431, 433, 435, 437, 439,
- 441, 443, 445, 447, 449, 451, 453, 455, 457, 459, 461, 463, 465, 467, 469, 471,
- 473, 475, 477, 479, 481, 483, 485, 487, 489, 491, 493, 495, 497, 499, 501, 503,
- 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535,
- 536, 532, 528, 524, 520, 516, 512, 508, 504, 500, 496, 492, 488, 484, 480, 476,
- 472, 468, 464, 460, 456, 452, 448, 444, 440, 436, 432, 428, 424, 420, 416, 412,
- 408, 404, 400, 396, 392, 388, 384, 380, 376, 372, 368, 364, 360, 356, 352, 348,
- 344, 340, 336, 332, 328, 324, 320, 316, 312, 308, 304, 300, 295, 290, 285, 280,
- 275, 270, 265, 260, 255, 250, 245, 240, 235, 230, 225, 220, 215, 210, 205, 200,
- 195, 190, 185, 180, 175, 170, 165, 160, 155, 150, 145, 140, 135, 130, 125, 120,
- 115, 110, 105, 100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40,
- 35, 30, 25, 20, 15, 10, 5, 0
-};
-
-Qt3DSEventSystemEvent *CCanProviderDemo::GetNextEvent(IEventFactory &inFactory)
-{
- clock_t theCurClock = clock();
- if (theCurClock > m_LastClock
- && (theCurClock - m_LastClock) / (CLOCKS_PER_SEC / 1000) < 1000 / 6)
- return 0;
- m_LastClock = theCurClock;
- unsigned char theLength = 0;
- unsigned char theData[8];
- theData[0] = 81;
-#define SIN_SAMPLE(s, m) ((sin((float)s) / 2 + 0.5) * m)
- switch (rand() % 2) {
- case 0:
- theData[1] = 1;
- { // Vehicle speed
- int theIndex = m_Frame % (sizeof(g_VehicleSpeedData) / sizeof(g_VehicleSpeedData[0]));
- theData[2] = (unsigned short)(g_VehicleSpeedData[theIndex] * 0.06) >> 8;
- theData[3] = (unsigned char)(g_VehicleSpeedData[theIndex] * 0.06);
- }
- {
- unsigned short theOdo = m_Frame;
- theData[4] = theOdo >> 8;
- theData[5] = (unsigned char)theOdo;
- }
- theLength = 6;
- break;
- case 1:
- theData[1] = 2;
- {
- unsigned short theTrip = m_Frame;
- theData[2] = theTrip >> 8;
- theData[3] = (unsigned char)theTrip;
- }
- {
- unsigned short theCoolant = (unsigned char)SIN_SAMPLE(m_Frame / 170, 300);
- theData[4] = theCoolant >> 8;
- theData[5] = (unsigned char)theCoolant;
- }
- theLength = 6;
- break;
- default:
- return 0;
- }
- ++m_Frame;
- Qt3DSEventSystemEvent &theEvent = inFactory.CreateEvent(9);
- Qt3DSEventSystemEventData *theCurrentData = theEvent.m_Data;
- theCurrentData->m_Name = inFactory.RegisterStr("device_type");
- theCurrentData->m_Value.m_Type = QT3DSEventSystemEventTypesString;
- theCurrentData->m_Value.m_String = inFactory.AllocateStr("CAN");
- ++theCurrentData;
- theCurrentData->m_Name = inFactory.RegisterStr("id");
- theCurrentData->m_Value.m_Type = QT3DSEventSystemEventTypesNumber;
- theCurrentData->m_Value.m_Number = 101;
- ++theCurrentData;
- theCurrentData->m_Name = inFactory.RegisterStr("length");
- theCurrentData->m_Value.m_Type = QT3DSEventSystemEventTypesNumber;
- theCurrentData->m_Value.m_Number = 6;
- ++theCurrentData;
- for (int i = 0; i < theLength; ++i) {
- theCurrentData->m_Name = inFactory.RegisterStr("data");
- theCurrentData->m_Value.m_Type = QT3DSEventSystemEventTypesNumber;
- theCurrentData->m_Value.m_Number = theData[i];
- ++theCurrentData;
- }
-
- return &theEvent;
-}
-
-size_t CCanProviderDemo::GetNextEvents(IEventFactory &inFactory, Qt3DSEventSystemEvent **outBuffer,
- size_t bufLen)
-{
- size_t bufIdx = 0;
- Qt3DSEventSystemEvent *evt = NULL;
- for (evt = GetNextEvent(inFactory); evt && bufIdx < bufLen;
- evt = GetNextEvent(inFactory), ++bufIdx)
- outBuffer[bufIdx] = evt;
- return bufIdx;
-}
-
-void CCanProviderDemo::Release()
-{
- delete this;
-}
diff --git a/src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.h b/src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.h
deleted file mode 100644
index 7d6788bc..00000000
--- a/src/Runtime/ogl-runtime/src/event/test/CanProviderDemo.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CAN_PROVIDER_DEMO_H
-#define CAN_PROVIDER_DEMO_H
-
-#include <ctime>
-
-#include <EventSystem.h>
-
-using namespace qt3ds::evt;
-
-class CCanProviderDemo : public IEventProvider
-{
-public:
- CCanProviderDemo();
- virtual ~CCanProviderDemo();
-
- Qt3DSEventSystemEvent *GetNextEvent(IEventFactory &inFactory);
- virtual size_t GetNextEvents(IEventFactory &inFactory, Qt3DSEventSystemEvent **outBuffer,
- size_t bufLen);
- virtual void Release();
-
-private:
- unsigned int m_Frame;
- clock_t m_LastClock;
-};
-
-#endif // CAN_PROVIDER_DEMO_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/AutoDeallocatorAllocator.h b/src/Runtime/ogl-runtime/src/foundation/AutoDeallocatorAllocator.h
deleted file mode 100644
index 5cbbc8bb..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/AutoDeallocatorAllocator.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_FOUNDATION_AUTO_DEALLOCATOR_ALLOCATOR_H
-#define QT3DS_FOUNDATION_AUTO_DEALLOCATOR_ALLOCATOR_H
-#pragma once
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-
-namespace qt3ds {
-namespace foundation {
-
- using eastl::make_pair;
- using eastl::pair;
-
- struct SSAutoDeallocatorAllocator : public NVAllocatorCallback
- {
- NVAllocatorCallback &m_Allocator;
- nvhash_map<void *, size_t> m_Allocations;
- SSAutoDeallocatorAllocator(NVFoundationBase &inFnd)
- : m_Allocator(inFnd.getAllocator())
- , m_Allocations(inFnd.getAllocator(), "SSAutoDeallocatorAllocator::m_Allocations")
- {
- }
-
- SSAutoDeallocatorAllocator(NVAllocatorCallback &inAlloc)
- : m_Allocator(inAlloc)
- , m_Allocations(inAlloc, "SSAutoDeallocatorAllocator::m_Allocations")
- {
- }
-
- // Automatically deallocates everything that hasn't already been deallocated.
- ~SSAutoDeallocatorAllocator() { deallocateAllAllocations(); }
-
- void deallocateAllAllocations()
- {
- for (nvhash_map<void *, size_t>::iterator iter = m_Allocations.begin(),
- end = m_Allocations.end();
- iter != end; ++iter)
- m_Allocator.deallocate(iter->first);
- m_Allocations.clear();
- }
-
- void *allocate(size_t size, const char *typeName, const char *filename, int line,
- int flags = 0) override
- {
- void *value = m_Allocator.allocate(size, typeName, filename, line, flags);
- m_Allocations.insert(make_pair(value, size));
- return value;
- }
-
- void *allocate(size_t size, const char *typeName, const char *filename, int line,
- size_t alignment, size_t alignmentOffset) override
- {
- void *value =
- m_Allocator.allocate(size, typeName, filename, line, alignment, alignmentOffset);
- m_Allocations.insert(make_pair(value, size));
- return value;
- }
- void deallocate(void *ptr) override
- {
- nvhash_map<void *, size_t>::iterator iter = m_Allocations.find(ptr);
- QT3DS_ASSERT(iter != m_Allocations.end());
- m_Allocator.deallocate(iter->first);
- m_Allocations.erase(iter);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/ConvertUTF.cpp b/src/Runtime/ogl-runtime/src/foundation/ConvertUTF.cpp
deleted file mode 100644
index a71a3aeb..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/ConvertUTF.cpp
+++ /dev/null
@@ -1,661 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
-* Copyright 2001-2004 Unicode, Inc.
-*
-* Disclaimer
-*
-* This source code is provided as is by Unicode, Inc. No claims are
-* made as to fitness for any particular purpose. No warranties of any
-* kind are expressed or implied. The recipient agrees to determine
-* applicability of information provided. If this file has been
-* purchased on magnetic or optical media from Unicode, Inc., the
-* sole remedy for any claim will be exchange of defective media
-* within 90 days of receipt.
-*
-* Limitations on Rights to Redistribute This Code
-*
-* Unicode, Inc. hereby grants the right to freely use the information
-* supplied in this file in the creation of products supporting the
-* Unicode Standard, and to make copies of this file in any form
-* for internal or external distribution as long as this notice
-* remains attached.
-*/
-
-/* ---------------------------------------------------------------------
- Conversions between UTF32, UTF-16, and UTF-8. Source code file.
- Author: Mark E. Davis, 1994.
- Rev History: Rick McGowan, fixes & updates May 2001.
- Sept 2001: fixed const & error conditions per
- mods suggested by S. Parent & A. Lillich.
- June 2002: Tim Dodd added detection and handling of incomplete
- source sequences, enhanced error detection, added casts
- to eliminate compiler warnings.
- July 2003: slight mods to back out aggressive FFFE detection.
- Jan 2004: updated switches in from-UTF8 conversions.
- Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
- See the header file "ConvertUTF.h" for complete documentation.
------------------------------------------------------------------------- */
-
-#include "foundation/ConvertUTF.h"
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4365) // warnings on conversion from unsigned int to int
-#endif
-
-#ifdef CVTUTF_DEBUG
-#include <stdio.h>
-#endif
-
-static const int halfShift = 10; /* used for shifting by 10 bits */
-
-static const UTF32 halfBase = 0x0010000UL;
-static const UTF32 halfMask = 0x3FFUL;
-
-#define UNI_SUR_HIGH_START (UTF32)0xD800
-#define UNI_SUR_HIGH_END (UTF32)0xDBFF
-#define UNI_SUR_LOW_START (UTF32)0xDC00
-#define UNI_SUR_LOW_END (UTF32)0xDFFF
-#define false 0
-#define true 1
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult Q3DSConvertUTF32toUTF16(const UTF32 **sourceStart, const UTF32 *sourceEnd,
- UTF16 **targetStart, UTF16 *targetEnd,
- ConversionFlags flags)
-{
- ConversionResult result = conversionOK;
- const UTF32 *source = *sourceStart;
- UTF16 *target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- if (target >= targetEnd) {
- result = targetExhausted;
- break;
- }
- ch = *source++;
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved
- * values */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_LEGAL_UTF32) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- --source; /* Back up source pointer! */
- result = targetExhausted;
- break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult Q3DSConvertUTF16toUTF32(const UTF16 **sourceStart, const UTF16 *sourceEnd,
- UTF32 **targetStart, UTF32 *targetEnd,
- ConversionFlags flags)
-{
- ConversionResult result = conversionOK;
- const UTF16 *source = *sourceStart;
- UTF32 *target = *targetStart;
- UTF32 ch, ch2;
- while (source < sourceEnd) {
- const UTF16 *oldSource =
- source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START)
- + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- if (target >= targetEnd) {
- source = oldSource; /* Back up source pointer! */
- result = targetExhausted;
- break;
- }
- *target++ = ch;
- }
- *sourceStart = source;
- *targetStart = target;
-#ifdef CVTUTF_DEBUG
- if (result == sourceIllegal) {
- fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2);
- fflush(stderr);
- }
-#endif
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Index into the table below with the first byte of a UTF-8 sequence to
- * get the number of trailing bytes that are supposed to follow it.
- * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
- * left as-is for anyone who may want to do such conversion, which was
- * allowed in earlier algorithms.
- */
-static const char trailingBytesForUTF8[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
-};
-
-/*
- * Magic values subtracted from a buffer value during UTF8 conversion.
- * This table contains as many values as there might be trailing bytes
- * in a UTF-8 sequence.
- */
-static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
- 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
-
-/*
- * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
- * into the first byte, depending on how many bytes follow. There are
- * as many entries in this table as there are UTF-8 sequence types.
- * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
- * for *legal* UTF-8 will be 4 or fewer bytes total.
- */
-static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-
-/* --------------------------------------------------------------------- */
-
-/* The interface converts a whole buffer to avoid function-call overhead.
- * Constants have been gathered. Loops & conditionals have been removed as
- * much as possible for efficiency, in favor of drop-through switches.
- * (See "Note A" at the bottom of the file for equivalent code.)
- * If your compiler supports it, the "isLegalUTF8" call can be turned
- * into an inline function.
- */
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult Q3DSConvertUTF16toUTF8(const UTF16 **sourceStart, const UTF16 *sourceEnd,
- UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
-{
- ConversionResult result = conversionOK;
- const UTF16 *source = *sourceStart;
- UTF8 *target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- const UTF16 *oldSource =
- source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- UTF32 ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START)
- + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /* Figure out how many bytes the result will require */
- if (ch < (UTF32)0x80) {
- bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) {
- bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) {
- bytesToWrite = 3;
- } else if (ch < (UTF32)0x110000) {
- bytesToWrite = 4;
- } else {
- bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- source = oldSource; /* Back up source pointer! */
- target -= bytesToWrite;
- result = targetExhausted;
- break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4:
- *--target = (UTF8)((ch | byteMark) & byteMask);
- ch >>= 6;
- case 3:
- *--target = (UTF8)((ch | byteMark) & byteMask);
- ch >>= 6;
- case 2:
- *--target = (UTF8)((ch | byteMark) & byteMask);
- ch >>= 6;
- case 1:
- *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Utility routine to tell whether a sequence of bytes is legal UTF-8.
- * This must be called with the length pre-determined by the first byte.
- * If not calling this from ConvertUTF8to*, then the length can be set by:
- * length = trailingBytesForUTF8[*source]+1;
- * and the sequence is illegal right away if there aren't that many bytes
- * available.
- * If presented with a length > 4, this returns false. The Unicode
- * definition of UTF-8 goes up to 4-byte sequences.
- */
-
-static Boolean isLegalUTF8(const UTF8 *source, int length)
-{
- UTF8 a;
- const UTF8 *srcptr = source + length;
- switch (length) {
- default:
- return false;
- /* Everything else falls through when "true"... */
- case 4:
- if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
- return false;
- case 3:
- if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
- return false;
- case 2:
- if ((a = (*--srcptr)) > 0xBF)
- return false;
-
- switch (*source) {
- /* no fall-through in this inner switch */
- case 0xE0:
- if (a < 0xA0)
- return false;
- break;
- case 0xED:
- if (a > 0x9F)
- return false;
- break;
- case 0xF0:
- if (a < 0x90)
- return false;
- break;
- case 0xF4:
- if (a > 0x8F)
- return false;
- break;
- default:
- if (a < 0x80)
- return false;
- }
-
- case 1:
- if (*source >= 0x80 && *source < 0xC2)
- return false;
- }
- if (*source > 0xF4)
- return false;
- return true;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Exported function to return whether a UTF-8 sequence is legal or not.
- * This is not used here; it's just exported.
- */
-Boolean Q3DSIsLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd)
-{
- int length = trailingBytesForUTF8[*source] + 1;
- if (source + length > sourceEnd) {
- return false;
- }
- return isLegalUTF8(source, length);
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult Q3DSConvertUTF8toUTF16(const UTF8 **sourceStart, const UTF8 *sourceEnd,
- UTF16 **targetStart, UTF16 *targetEnd,
- ConversionFlags flags)
-{
- ConversionResult result = conversionOK;
- const UTF8 *source = *sourceStart;
- UTF16 *target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted;
- break;
- }
- /* Do this check whether lenient or strict */
- if (!isLegalUTF8(source, extraBytesToRead + 1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5:
- ch += *source++;
- ch <<= 6; /* remember, illegal UTF-8 */
- case 4:
- ch += *source++;
- ch <<= 6; /* remember, illegal UTF-8 */
- case 3:
- ch += *source++;
- ch <<= 6;
- case 2:
- ch += *source++;
- ch <<= 6;
- case 1:
- ch += *source++;
- ch <<= 6;
- case 0:
- ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead + 1); /* Back up source pointer! */
- result = targetExhausted;
- break;
- }
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead + 1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_UTF16) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- source -= (extraBytesToRead + 1); /* return to the start */
- break; /* Bail out; shouldn't continue */
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- source -= (extraBytesToRead + 1); /* Back up source pointer! */
- result = targetExhausted;
- break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult Q3DSConvertUTF32toUTF8(const UTF32 **sourceStart, const UTF32 *sourceEnd,
- UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
-{
- ConversionResult result = conversionOK;
- const UTF32 *source = *sourceStart;
- UTF8 *target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- ch = *source++;
- if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /*
- * Figure out how many bytes the result will require. Turn any
- * illegally large UTF32 things (> Plane 17) into replacement chars.
- */
- if (ch < (UTF32)0x80) {
- bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) {
- bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) {
- bytesToWrite = 3;
- } else if (ch <= UNI_MAX_LEGAL_UTF32) {
- bytesToWrite = 4;
- } else {
- bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- result = sourceIllegal;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- --source; /* Back up source pointer! */
- target -= bytesToWrite;
- result = targetExhausted;
- break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4:
- *--target = (UTF8)((ch | byteMark) & byteMask);
- ch >>= 6;
- case 3:
- *--target = (UTF8)((ch | byteMark) & byteMask);
- ch >>= 6;
- case 2:
- *--target = (UTF8)((ch | byteMark) & byteMask);
- ch >>= 6;
- case 1:
- *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult Q3DSConvertUTF8toUTF32(const UTF8 **sourceStart, const UTF8 *sourceEnd,
- UTF32 **targetStart, UTF32 *targetEnd,
- ConversionFlags flags)
-{
- ConversionResult result = conversionOK;
- const UTF8 *source = *sourceStart;
- UTF32 *target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted;
- break;
- }
- /* Do this check whether lenient or strict */
- if (!isLegalUTF8(source, extraBytesToRead + 1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5:
- ch += *source++;
- ch <<= 6;
- case 4:
- ch += *source++;
- ch <<= 6;
- case 3:
- ch += *source++;
- ch <<= 6;
- case 2:
- ch += *source++;
- ch <<= 6;
- case 1:
- ch += *source++;
- ch <<= 6;
- case 0:
- ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead + 1); /* Back up the source pointer! */
- result = targetExhausted;
- break;
- }
- if (ch <= UNI_MAX_LEGAL_UTF32) {
- /*
- * UTF-16 surrogate values are illegal in UTF-32, and anything
- * over Plane 17 (> 0x10FFFF) is illegal.
- */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead + 1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = ch;
- }
- } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
- result = sourceIllegal;
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* ---------------------------------------------------------------------
-
- Note A.
- The fall-through switches in UTF-8 reading code save a
- temp variable, some decrements & conditionals. The switches
- are equivalent to the following loop:
- {
- int tmpBytesToRead = extraBytesToRead+1;
- do {
- ch += *source++;
- --tmpBytesToRead;
- if (tmpBytesToRead) ch <<= 6;
- } while (tmpBytesToRead > 0);
- }
- In UTF-8 writing code, the switches on "bytesToWrite" are
- similarly unrolled loops.
-
- --------------------------------------------------------------------- */
diff --git a/src/Runtime/ogl-runtime/src/foundation/ConvertUTF.h b/src/Runtime/ogl-runtime/src/foundation/ConvertUTF.h
deleted file mode 100644
index 93614a0c..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/ConvertUTF.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-/*
- * Copyright 2001-2004 Unicode, Inc.
- *
- * Disclaimer
- *
- * This source code is provided as is by Unicode, Inc. No claims are
- * made as to fitness for any particular purpose. No warranties of any
- * kind are expressed or implied. The recipient agrees to determine
- * applicability of information provided. If this file has been
- * purchased on magnetic or optical media from Unicode, Inc., the
- * sole remedy for any claim will be exchange of defective media
- * within 90 days of receipt.
- *
- * Limitations on Rights to Redistribute This Code
- *
- * Unicode, Inc. hereby grants the right to freely use the information
- * supplied in this file in the creation of products supporting the
- * Unicode Standard, and to make copies of this file in any form
- * for internal or external distribution as long as this notice
- * remains attached.
- */
-
-/* ---------------------------------------------------------------------
-
- Conversions between UTF32, UTF-16, and UTF-8. Header file.
-
- Several funtions are included here, forming a complete set of
- conversions between the three formats. UTF-7 is not included
- here, but is handled in a separate source file.
-
- Each of these routines takes pointers to input buffers and output
- buffers. The input buffers are const.
-
- Each routine converts the text between *sourceStart and sourceEnd,
- putting the result into the buffer between *targetStart and
- targetEnd. Note: the end pointers are *after* the last item: e.g.
- *(sourceEnd - 1) is the last item.
-
- The return result indicates whether the conversion was successful,
- and if not, whether the problem was in the source or target buffers.
- (Only the first encountered problem is indicated.)
-
- After the conversion, *sourceStart and *targetStart are both
- updated to point to the end of last text successfully converted in
- the respective buffers.
-
- Input parameters:
- sourceStart - pointer to a pointer to the source buffer.
- The contents of this are modified on return so that
- it points at the next thing to be converted.
- targetStart - similarly, pointer to pointer to the target buffer.
- sourceEnd, targetEnd - respectively pointers to the ends of the
- two buffers, for overflow checking only.
-
- These conversion functions take a ConversionFlags argument. When this
- flag is set to strict, both irregular sequences and isolated surrogates
- will cause an error. When the flag is set to lenient, both irregular
- sequences and isolated surrogates are converted.
-
- Whether the flag is strict or lenient, all illegal sequences will cause
- an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
- or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
- must check for illegal sequences.
-
- When the flag is set to lenient, characters over 0x10FFFF are converted
- to the replacement character; otherwise (when the flag is set to strict)
- they constitute an error.
-
- Output parameters:
- The value "sourceIllegal" is returned from some routines if the input
- sequence is malformed. When "sourceIllegal" is returned, the source
- value will point to the illegal value that caused the problem. E.g.,
- in UTF-8 when a sequence is malformed, it points to the start of the
- malformed sequence.
-
- Author: Mark E. Davis, 1994.
- Rev History: Rick McGowan, fixes & updates May 2001.
- Fixes & updates, Sept 2001.
-
------------------------------------------------------------------------- */
-
-/* ---------------------------------------------------------------------
- The following 4 definitions are compiler-specific.
- The C standard does not guarantee that wchar_t has at least
- 16 bits, so wchar_t is no less portable than unsigned short!
- All should be unsigned values to avoid sign extension during
- bit mask & shift operations.
------------------------------------------------------------------------- */
-
-typedef unsigned int UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
-typedef unsigned char Boolean; /* 0 or 1 */
-
-/* Some fundamental constants */
-
-#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
-#define UNI_MAX_BMP (UTF32)0x0000FFFF
-#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
-#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
-#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
-
-typedef enum {
- conversionOK, /* conversion successful */
- sourceExhausted, /* partial character in source, but hit end */
- targetExhausted, /* insuff. room in target for conversion */
- sourceIllegal /* source sequence is illegal/malformed */
-} ConversionResult;
-
-typedef enum { strictConversion = 0, lenientConversion } ConversionFlags;
-
-/* This is for C++ and does no harm in C */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-ConversionResult Q3DSConvertUTF8toUTF16(const UTF8 **sourceStart, const UTF8 *sourceEnd,
- UTF16 **targetStart, UTF16 *targetEnd,
- ConversionFlags flags);
-
-ConversionResult Q3DSConvertUTF16toUTF8(const UTF16 **sourceStart, const UTF16 *sourceEnd,
- UTF8 **targetStart, UTF8 *targetEnd,
- ConversionFlags flags);
-
-ConversionResult Q3DSConvertUTF8toUTF32(const UTF8 **sourceStart, const UTF8 *sourceEnd,
- UTF32 **targetStart, UTF32 *targetEnd,
- ConversionFlags flags);
-
-ConversionResult Q3DSConvertUTF32toUTF8(const UTF32 **sourceStart, const UTF32 *sourceEnd,
- UTF8 **targetStart, UTF8 *targetEnd,
- ConversionFlags flags);
-
-ConversionResult Q3DSConvertUTF16toUTF32(const UTF16 **sourceStart, const UTF16 *sourceEnd,
- UTF32 **targetStart, UTF32 *targetEnd,
- ConversionFlags flags);
-
-ConversionResult Q3DSConvertUTF32toUTF16(const UTF32 **sourceStart, const UTF32 *sourceEnd,
- UTF16 **targetStart, UTF16 *targetEnd,
- ConversionFlags flags);
-
-Boolean Q3DSIsLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
-
-#ifdef __cplusplus
-}
-#endif
-
-/* --------------------------------------------------------------------- */
diff --git a/src/Runtime/ogl-runtime/src/foundation/EASTL_new.cpp b/src/Runtime/ogl-runtime/src/foundation/EASTL_new.cpp
deleted file mode 100644
index 61e8e0b4..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/EASTL_new.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// we have some build dependencies which forces us to include
-// this on linux to recognize malloc
-#include <stdio.h>
-#include <stdarg.h>
-
-#if !defined(_MSC_VER)
-#include <stdlib.h>
-#endif
-
-#include "EASTL/allocator.h"
-
-void *operator new[](size_t size, const char *, int, unsigned, const char *, int)
-{
- return malloc(size);
-}
-
-void *operator new[](size_t size, size_t, size_t, const char *, int, unsigned, const char *, int)
-{
- return malloc(size);
-}
-// EASTL also wants us to define this (see string.h line 197)
-int Vsnprintf8(char8_t *pDestination, size_t n, const char8_t *pFormat, va_list arguments)
-{
-#ifdef _MSC_VER
- return _vsnprintf(pDestination, n, pFormat, arguments);
-#else
- return vsnprintf(pDestination, n, pFormat, arguments);
-#endif
-}
-int Vsnprintf16(char8_t *pDestination, size_t n, const char16_t *pFormat, va_list arguments)
-{
-#ifdef _MSC_VER
- return _vsnprintf(pDestination, n, (char *)pFormat, arguments);
-#else
- return vsnprintf(pDestination, n, (char *)pFormat, arguments);
-#endif
-}
-int Vsnprintf32(char8_t *pDestination, size_t n, const char32_t *pFormat, va_list arguments)
-{
-#ifdef _MSC_VER
- return _vsnprintf(pDestination, n, (char *)pFormat, arguments);
-#else
- return vsnprintf(pDestination, n, (char *)pFormat, arguments);
-#endif
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/FastAllocator.h b/src/Runtime/ogl-runtime/src/foundation/FastAllocator.h
deleted file mode 100644
index c296bcb6..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/FastAllocator.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSContainers.h"
-
-namespace qt3ds {
-namespace foundation {
-
- /**
- * Allocator that allocates slabs of a certain size and objects then
- * get allocated from those slabs. This allocator is designed to reset,
- * meaning every frame you can call reset and the objects get freed but
- * not destructed. This allocator does not call destructors!!
- */
- template <QT3DSU32 alignmentInBytes = 4, QT3DSU32 slabSize = 8192>
- struct SFastAllocator : NVAllocatorCallback
- {
- ForwardingAllocator m_Allocator;
- nvvector<QT3DSU8 *> m_Slabs;
- QT3DSU32 m_Offset;
-
- enum {
- SlabSize = slabSize,
- };
-
- static size_t getSlabSize() { return slabSize; }
-
- SFastAllocator(NVAllocatorCallback &alloc, const char *memName)
- : m_Allocator(alloc, memName)
- , m_Slabs(alloc, "SFastAllocator::m_Slabs")
- , m_Offset(0)
- {
- }
-
- ~SFastAllocator()
- {
- for (QT3DSU32 idx = 0, end = m_Slabs.size(); idx < end; ++idx)
- m_Allocator.deallocate(m_Slabs[idx]);
- m_Slabs.clear();
- m_Offset = 0;
- }
- void *allocate(size_t inSize, const char *inFile, int inLine, int inFlags = 0)
- {
- (void)inFlags;
- if (inSize > slabSize) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- QT3DSU32 misalign = m_Offset % alignmentInBytes;
- if (misalign)
- m_Offset = m_Offset + (alignmentInBytes - misalign);
-
- QT3DSU32 currentSlab = m_Offset / slabSize;
- QT3DSU32 slabOffset = m_Offset % slabSize;
- QT3DSU32 amountLeftInSlab = slabSize - slabOffset;
- if (inSize > amountLeftInSlab) {
- ++currentSlab;
- slabOffset = 0;
- m_Offset = currentSlab * slabSize;
- }
- while (currentSlab >= m_Slabs.size()) {
- m_Slabs.push_back((QT3DSU8 *)m_Allocator.allocate(slabSize, inFile, inLine));
- }
- QT3DSU8 *data = m_Slabs[currentSlab] + slabOffset;
- // This would indicate the underlying allocator isn't handing back aligned memory.
- QT3DS_ASSERT(reinterpret_cast<size_t>(data) % alignmentInBytes == 0);
- m_Offset += (QT3DSU32)inSize;
- return data;
- }
- void *allocate(size_t size, const char * /*typeName*/, const char *filename, int line,
- int flags = 0) override
- {
- return allocate(size, filename, line, flags);
- }
- void *allocate(size_t size, const char * /*typeName*/, const char *filename, int line,
- size_t alignment, size_t /*alignmentOffset*/) override
- {
- QT3DS_ASSERT(alignment == alignmentInBytes);
- if (alignment == alignmentInBytes)
- return allocate(size, filename, line);
- return NULL;
- }
- // only reset works with deallocation
- void deallocate(void *) override {}
- void reset() { m_Offset = 0; }
- };
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/FileTools.cpp b/src/Runtime/ogl-runtime/src/foundation/FileTools.cpp
deleted file mode 100644
index aa1e7384..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/FileTools.cpp
+++ /dev/null
@@ -1,545 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/FileTools.h"
-#include "foundation/Utils.h"
-#include <string.h>
-#
-#ifdef EA_PLATFORM_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#else // posix
-#include <stdio.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <dirent.h>
-#endif
-#include <QDir>
-#include <QFile>
-#include <QUrl>
-
-using namespace qt3ds::foundation;
-
-namespace {
-// State machine where you can add a character
-// and it will tell you how many characters to erase
-struct SPathStateMachine
-{
- struct States
- {
- enum Enum {
- NoState = 0, // Don't care
- Slash, // Last char was either a forward or backward slash
- Period, // Last char was a period
- TwoPeriods, // Last two characters were periods
- };
- };
- struct Actions
- {
- enum Enum {
- NoAction = 0,
- DeleteBack1Slash,
- DeleteBack2Slashes,
- };
- };
-
- States::Enum m_State;
-
- SPathStateMachine()
- : m_State(States::NoState)
- {
- }
-
- Actions::Enum AnalyzeChar(char32_t inChar)
- {
- switch (inChar) {
- case '\\':
- case '/':
- switch (m_State) {
- case States::NoState:
- m_State = States::Slash;
- break;
- case States::Period:
- m_State = States::Slash;
- return Actions::DeleteBack1Slash;
-
- case States::TwoPeriods:
- m_State = States::Slash;
- return Actions::DeleteBack2Slashes;
- case States::Slash:
- return Actions::DeleteBack1Slash;
- }
- break;
- case '.':
- switch (m_State) {
- case States::Slash:
- case States::NoState:
- m_State = States::Period;
- break;
- case States::Period:
- m_State = States::TwoPeriods;
- break;
- case States::TwoPeriods:
- break;
- }
- break;
- default:
- m_State = States::NoState;
- break;
- }
- return Actions::NoAction;
- }
-};
-
-template <typename TStrType>
-inline bool DoDeleteBack1Slash(TStr::size_type &idx, TStrType &ioPath)
-{
- TStr::size_type slashLoc = ioPath.rfind('/', idx - 1);
- if ((slashLoc != TStr::npos) && (slashLoc > 2)
- // and the next *two* characters aren't both dots.
- && ((ioPath[slashLoc - 1] != '.') || (ioPath[slashLoc - 2] != '.'))) {
-
- ioPath.erase(ioPath.begin() + slashLoc, ioPath.begin() + idx);
- idx = slashLoc;
- return true;
- }
- return false;
-}
-
-template <typename TStrType>
-void NormalizePathT(TStrType &ioPath)
-{
- TStr::size_type pathLen = ioPath.size();
- SPathStateMachine theStateMachine;
- for (TStr::size_type idx = 0; idx < pathLen; ++idx) {
- char8_t &currentChar = ioPath[idx];
- if (currentChar == '\\')
- currentChar = '/';
- SPathStateMachine::Actions::Enum action = theStateMachine.AnalyzeChar(currentChar);
- switch (action) {
- case SPathStateMachine::Actions::DeleteBack2Slashes:
- if (DoDeleteBack1Slash(idx, ioPath))
- DoDeleteBack1Slash(idx, ioPath);
- pathLen = ioPath.size();
- break;
-
- case SPathStateMachine::Actions::DeleteBack1Slash:
- DoDeleteBack1Slash(idx, ioPath);
- pathLen = ioPath.size();
- break;
- default:
- break;
- }
- }
-}
-
-bool IsAbsolute(const char8_t *inPath, size_t inLen)
-{
- if (inLen > 2 && inPath[1] == ':')
- return true;
- else if (inLen > 1 && (inPath[0] == '\\' || inPath[0] == '/'))
- return true;
- return false;
-}
-
-template <typename TStrType>
-void CombineBaseAndRelativeT(const char8_t *inBase, const char8_t *inRelative, TStrType &outString)
-{
- if (IsAbsolute(inRelative, StrLen(inRelative))) {
- outString.assign(nonNull(inRelative));
- } else {
- if (inRelative && *inRelative) {
- if (inRelative[0] == '#')
- outString.assign(inRelative);
- else {
- if (IsAbsolute(inRelative, strlen(inRelative))) {
- outString.assign(inRelative);
- } else {
- outString = inBase ? inBase : "";
- if (outString.size())
- outString.append("/");
- outString.append(inRelative ? inRelative : (const char8_t *)L"");
- }
- NormalizePathT(outString);
- }
- }
- }
-}
-
-template <typename TStrType>
-void GetRelativeFromBaseT(TStrType &inBaseStr, TStrType &inRelativeStr, TStrType &outString)
-{
- outString.clear();
- NormalizePathT(inBaseStr);
- NormalizePathT(inRelativeStr);
- if (inBaseStr.size() == 0) {
- outString.assign(inRelativeStr.c_str());
- return;
- }
- if (inRelativeStr.size() == 0) {
- outString.clear();
- return;
- }
- // find longest common string
- const char8_t *inBase = inBaseStr.c_str();
- const char8_t *baseEnd = inBaseStr.c_str() + inBaseStr.size();
- const char8_t *inRelative = inRelativeStr.c_str();
- size_t relativeLen = inRelativeStr.size();
- const char8_t *relativeEnd = inRelative + relativeLen;
-
- for (; inRelative < relativeEnd && inBase < baseEnd && *inRelative == *inBase;
- ++inRelative, ++inBase)
- ;
-
- // They had nothing in common.
- if (inBase == inBaseStr.c_str()) {
- outString.assign(inRelativeStr.c_str());
- return;
- }
-
- if (inRelative && (*inRelative == '\\' || *inRelative == '/'))
- ++inRelative;
-
- const char *common = inBase;
- if (common == NULL || *common == 0) {
- outString.assign("./");
- outString.append(inRelative);
- NormalizePathT(outString);
- return;
- }
- // Backtrack to the nearest slash.
- while (*common && *common != '\\' && *common != '/')
- --common;
-
- bool foundNonSlash = false;
- for (; common != baseEnd; ++common) {
- if (*common != '\\' && *common != '/') {
- if (foundNonSlash == false)
- outString.append("..\\");
- foundNonSlash = true;
- } else
- foundNonSlash = false;
- }
- if (inRelative < relativeEnd) {
- if (outString.size() == 0)
- outString.assign("./");
- outString.append(inRelative);
- }
- NormalizePathT(outString);
-}
-}
-
-void CFileTools::NormalizePath(TStr &ioPath)
-{
- NormalizePathT(ioPath);
-}
-
-void CFileTools::NormalizePath(eastl::string &ioPath)
-{
- NormalizePathT(ioPath);
-}
-
-QString CFileTools::NormalizePathForQtUsage(const QString &path)
-{
- // path can be a file path or a qrc URL string.
-
- QString filePath = QDir::cleanPath(path);
-
- if (filePath.startsWith(QLatin1String("qrc:/")))
- return filePath.mid(3);
- else
- return filePath;
-}
-
-void CFileTools::CombineBaseAndRelative(const char8_t *inBase, const char8_t *inRelative,
- TStr &outString)
-{
- CombineBaseAndRelativeT(inBase, inRelative, outString);
-}
-
-void CFileTools::CombineBaseAndRelative(const char8_t *inBase, const char8_t *inRelative,
- eastl::string &outString)
-{
- CombineBaseAndRelativeT(inBase, inRelative, outString);
-}
-
-void CFileTools::GetRelativeFromBase(TStr &inBaseStr, TStr &inRelativeStr, TStr &outString)
-{
- GetRelativeFromBaseT(inBaseStr, inRelativeStr, outString);
-}
-
-void CFileTools::GetRelativeFromBase(eastl::string &inBaseStr, eastl::string &inRelativeStr,
- eastl::string &outString)
-{
- GetRelativeFromBaseT(inBaseStr, inRelativeStr, outString);
-}
-
-bool CFileTools::RequiresCombineBaseAndRelative(const char8_t *inPath)
-{
- if (inPath && *inPath)
- return inPath[0] == '.';
- return false;
-}
-
-template <typename TStrType>
-void ToPlatformPathT(TStrType &outString)
-{
-#ifndef EA_PLATFORM_WINDOWS
- for (TStr::size_type pos = outString.find('\\'); pos != TStr::npos;
- pos = outString.find('\\', pos + 1))
- outString.replace(outString.begin() + pos, outString.begin() + pos + 1, "/");
-#else
- (void)outString;
-#endif
-}
-
-void CFileTools::ToPlatformPath(TStr &outString)
-{
- ToPlatformPathT(outString);
-}
-
-void CFileTools::ToPlatformPath(eastl::string &outString)
-{
- ToPlatformPathT(outString);
-}
-
-CRegisteredString CFileTools::RemapPathToBinaryFormat(TStr &inPath, TStr &inPresentationDir,
- TStr &ioWorkspaceStr,
- IStringTable &inStringTable)
-{
- GetRelativeFromBase(inPresentationDir, inPath, ioWorkspaceStr);
- CRegisteredString theNewStr = inStringTable.RegisterStr(ioWorkspaceStr.c_str());
- theNewStr.Remap(inStringTable.GetRemapMap());
- return theNewStr;
-}
-
-CRegisteredString CFileTools::RemapPathFromBinaryFormat(CRegisteredString inPath,
- const char8_t *inPresDir,
- TStr &ioWorkspaceStr,
- const CStrTableOrDataRef &inRef,
- IStringTable &inStringTable)
-{
- inPath.Remap(inRef);
- if (RequiresCombineBaseAndRelative(inPath.c_str())) {
- CombineBaseAndRelative(inPresDir, inPath, ioWorkspaceStr);
- return inStringTable.RegisterStr(ioWorkspaceStr.c_str());
- }
- return inPath;
-}
-
-void CFileTools::GetDirectory(eastl::string &ioPath)
-{
- eastl::string::size_type theSlashPos = ioPath.find_last_of("\\/");
- if (theSlashPos == eastl::string::npos) {
- ioPath.clear();
- return;
- }
- ioPath.resize(theSlashPos);
-}
-
-bool CFileTools::DirectoryExists(const char8_t *inPath)
-{
-#ifdef EA_PLATFORM_WINDOWS
- DWORD theAtts = GetFileAttributesA(inPath);
- return theAtts != INVALID_FILE_ATTRIBUTES && (theAtts & FILE_ATTRIBUTE_DIRECTORY);
-#else // Posix style check for directory
- int status;
- struct stat st_buf;
- status = stat(inPath, &st_buf);
- if (status == 0 && S_ISDIR(st_buf.st_mode))
- return true;
- return false;
-#endif
-}
-
-bool CFileTools::FileExists(const char8_t *inPath)
-{
-#ifdef EA_PLATFORM_WINDOWS
- DWORD theAtts = GetFileAttributesA(inPath);
- return theAtts != INVALID_FILE_ATTRIBUTES;
-#else // Posix style check for directory
- int status;
- struct stat st_buf;
- status = stat(inPath, &st_buf);
- if (status == 0)
- return true;
- return false;
-#endif
-}
-
-eastl::string CFileTools::GetFileOrAssetPath(const char8_t *inPath)
-{
- QFile tmp(inPath);
- if (tmp.exists())
- return inPath;
- return eastl::string("assets:/") + inPath;
-}
-
-void CFileTools::SetStreamPosition(QIODevice& device, qint64 inOffset,
- qt3ds::foundation::SeekPosition::Enum inEnum)
-{
- if (inEnum == qt3ds::foundation::SeekPosition::Begin)
- device.seek(inOffset);
- else if (inEnum == qt3ds::foundation::SeekPosition::Current)
- device.seek(device.pos() + inOffset);
- else if (inEnum == qt3ds::foundation::SeekPosition::End)
- device.seek(device.size() + inOffset);
-}
-
-void CFileTools::GetExtension(const char8_t *inPath, eastl::string &outExt)
-{
- outExt.assign(nonNull(inPath));
- size_t dotPos = outExt.find_last_of('.');
- if (dotPos != eastl::string::npos)
- outExt.erase(outExt.begin(), outExt.begin() + dotPos + 1);
-}
-
-void CFileTools::Split(const char8_t *inPath, eastl::string &outDir, eastl::string &outFileStem,
- eastl::string &outExtension)
-{
- outDir.assign(nonNull(inPath));
- NormalizePath(outDir);
- outFileStem = outDir;
- GetDirectory(outDir);
- size_t lenDiff = outFileStem.size() - outDir.size();
- if (lenDiff > 0) {
- if (outDir.size())
- outFileStem = outFileStem.substr(outDir.size() + 1);
-
- eastl::string::size_type lastDot = outFileStem.find_last_of('.');
- if (lastDot != eastl::string::npos) {
- outExtension = outFileStem.substr(lastDot + 1);
- outFileStem.resize(lastDot);
- }
- }
-}
-
-#ifdef EA_PLATFORM_WINDOWS
-void CFileTools::GetDirectoryEntries(const eastl::string &inPath,
- eastl::vector<eastl::string> &outFiles)
-{
- if (inPath.size() == 0)
- return;
- eastl::string tempPath(inPath);
- NormalizePath(tempPath);
- for (eastl::string::size_type pos = tempPath.find_first_of('/'); pos != eastl::string::npos;
- pos = tempPath.find_first_of('/', pos + 1))
- tempPath[pos] = '\\';
- if (tempPath.back() != '\\')
- tempPath.append("\\");
- tempPath.append(1, '*');
- WIN32_FIND_DATAA ffd;
- HANDLE hFind = FindFirstFileA(tempPath.c_str(), &ffd);
- outFiles.clear();
- if (INVALID_HANDLE_VALUE == hFind)
- return;
-
- do {
- if (strcmp(ffd.cFileName, ".") == 0 || strcmp(ffd.cFileName, "..") == 0)
- continue;
- outFiles.push_back(eastl::string(ffd.cFileName));
- } while (FindNextFileA(hFind, &ffd) != 0);
-}
-#else
-void CFileTools::GetDirectoryEntries(const eastl::string &inPath,
- eastl::vector<eastl::string> &outFiles)
-{
- if (inPath.size() == 0)
- return;
- eastl::string tempPath(inPath);
- NormalizePath(tempPath);
- struct dirent *dent;
- DIR *srcdir = opendir(tempPath.c_str());
- if (srcdir) {
- while ((dent = readdir(srcdir)) != NULL) {
- if (strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0)
- continue;
- outFiles.push_back(eastl::string(dent->d_name));
- }
- closedir(srcdir);
- }
-}
-#endif
-
-bool CFileTools::CreateDir(const eastl::string &inPath, bool inRecurse)
-{
- if (DirectoryExists(inPath.c_str()))
- return true;
-
- eastl::string temp(inPath);
- GetDirectory(temp);
- if (temp.size() && !DirectoryExists(temp.c_str())) {
- if (inRecurse)
- CreateDir(temp, inRecurse);
- else
- return false;
- }
-
-#ifdef EA_PLATFORM_WINDOWS
- BOOL result = CreateDirectoryA(inPath.c_str(), NULL);
- return result != 0;
-#else
- int result = mkdir(inPath.c_str(), 0777);
- return result == 0;
-#endif
-}
-
-void CFileTools::AppendDirectoryInPathToFile(eastl::string &ioPath, const char8_t *dirName)
-{
- eastl::string::size_type lastSlash = ioPath.find_last_of("\\/");
- if (lastSlash != eastl::string::npos) {
- if (dirName == NULL)
- dirName = ""; // avoid crashes on null strings
- ioPath.insert(lastSlash + 1, "/");
- ioPath.insert(lastSlash + 1, dirName);
- } else {
- ioPath.insert(0, "/");
- ioPath.insert(0, dirName);
- }
-}
-
-void CFileTools::RemoveLastDirectoryInPathToFile(eastl::string &ioPath)
-{
- eastl::string::size_type lastSlash = ioPath.find_last_of("\\/");
- if (lastSlash != eastl::string::npos) {
- eastl::string::size_type secondToLastSlash = ioPath.find_last_of("\\/", lastSlash - 1);
- if (secondToLastSlash != eastl::string::npos)
- ioPath = ioPath.erase(secondToLastSlash, lastSlash - secondToLastSlash);
- }
-}
-
-void CFileTools::SetExtension(eastl::string &ioPath, const char8_t *inExt)
-{
- eastl::string::size_type thePos = ioPath.find_last_of(".");
- if (thePos != eastl::string::npos) {
- ++thePos;
- ioPath = ioPath.replace(thePos, ioPath.size() - thePos, inExt);
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/FileTools.h b/src/Runtime/ogl-runtime/src/foundation/FileTools.h
deleted file mode 100644
index 57455256..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/FileTools.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_FILE_TOOLS_H
-#define QT3DS_FOUNDATION_FILE_TOOLS_H
-
-#include "EASTL/string.h"
-#include "EASTL/vector.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/StringTable.h"
-#include "foundation/IOStreams.h"
-#include <QtGlobal>
-
-QT_FORWARD_DECLARE_CLASS(QIODevice)
-
-namespace qt3ds {
-namespace foundation {
-
- typedef eastl::basic_string<char8_t, ForwardingAllocator> TStr;
-
- class CFileTools
- {
- public:
- // Normalizes all slashes to be windows-like
- static void NormalizePath(TStr &ioPath);
- static void NormalizePath(eastl::string &ioPath);
-
- // This is kind of the opposite of the 'NormalizePath' methods above in
- // that it forces usage of unix style directory separators rather than
- // windows separators. In addition, the path here can be a file path or
- // a qrc URL string. This function will eventually be refactored away
- // when we've converted to using Qt's file system abstraction throughout
- // the code base and use QUrl's throughout instead of raw strings to
- // represent resources.
- static QString NormalizePathForQtUsage(const QString &path);
-
- static void CombineBaseAndRelative(const char8_t *inBase, const char8_t *inRelative,
- TStr &outString);
- static void CombineBaseAndRelative(const char8_t *inBase, const char8_t *inRelative,
- eastl::string &outString);
-
- // inBase and inRelative will get normalized
- // This algorithm changes based on the platform. On windows it is not case sensitive, on
- // not-windows it is.
- static void GetRelativeFromBase(TStr &inBase, TStr &inRelative, TStr &outString);
- static void GetRelativeFromBase(eastl::string &inBase, eastl::string &inRelative,
- eastl::string &outString);
-
- // A remapped path is a file path that starts with a '.' or a '/'. GetRelativeFromBase
- // *always*
- // places a '.' or a '/' at the front of the path, so if you *know* the path came from
- // GetRelativeFromBase then you also know this function returns true of GetRelativeFromBase
- // actually generated a path that needs CombineBaseAndRelative.
- static bool RequiresCombineBaseAndRelative(const char8_t *inPath);
-
- // Search/replace so that all slashes are unix-like but only on non-windows platforms
- // Assumes the incoming path has been normalized
- static void ToPlatformPath(TStr &ioPath);
- static void ToPlatformPath(eastl::string &ioPath);
-
- static CRegisteredString RemapPathToBinaryFormat(TStr &inPath, TStr &inPresentationDir,
- TStr &ioWorkspaceStr,
- IStringTable &inStringTable);
- static CRegisteredString RemapPathFromBinaryFormat(CRegisteredString inPath,
- const char8_t *inPresDir,
- TStr &ioWorkspaceStr,
- const CStrTableOrDataRef &inRef,
- IStringTable &inStringTable);
- // I
- static void GetDirectory(eastl::string &ioPath);
- static bool DirectoryExists(const char8_t *inPath);
- static void GetExtension(const char8_t *inPath, eastl::string &outExt);
- static void Split(const char8_t *inPath, eastl::string &outDir, eastl::string &outFileStem,
- eastl::string &outExtension);
-
- // Only implemented for windows. Does not return '.' and '..' special entries
- // inPath is mangled in a platform specific way
- static void GetDirectoryEntries(const eastl::string &inPath,
- eastl::vector<eastl::string> &outFiles);
-
- static bool CreateDir(const eastl::string &inPath, bool inRecurse = true);
-
- // Given a/b.txt, we will end up with a/dirName/b.txt
- static void AppendDirectoryInPathToFile(eastl::string &ioPath, const char8_t *dirName);
- static void RemoveLastDirectoryInPathToFile(eastl::string &ioPath);
-
- static void SetExtension(eastl::string &ioPath, const char8_t *inExt);
-
- static bool FileExists(const char8_t *inPath);
- static eastl::string GetFileOrAssetPath(const char8_t *inPath);
- static void SetStreamPosition(QIODevice& device, qint64 inOffset,
- qt3ds::foundation::SeekPosition::Enum inEnum);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/IOStreams.cpp b/src/Runtime/ogl-runtime/src/foundation/IOStreams.cpp
deleted file mode 100644
index f1adfbc0..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/IOStreams.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/IOStreams.h"
-#include "foundation/FileTools.h"
-#include "foundation/StrConvertUTF.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSThread.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-
-using namespace qt3ds::foundation;
-
-#ifndef _WIN32
-
-inline int _fseeki64(FILE *inFile, int64_t pos, int seekFlags)
-{
- return fseek(inFile, (int32_t)pos, seekFlags);
-}
-
-inline int64_t _ftelli64(FILE *inFile)
-{
- return ftell(inFile);
-}
-
-#endif
-
-CFileSeekableIOStream::CFileSeekableIOStream(const char *inFileName, FileOpenFlags inFlags)
-{
- openFile(QString(inFileName), inFlags);
-}
-
-#ifdef WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
-
-CFileSeekableIOStream::CFileSeekableIOStream(const wchar_t *inFileName, FileOpenFlags inFlags)
-{
- openFile(QString::fromWCharArray(inFileName), inFlags);
-}
-
-#endif
-
-CFileSeekableIOStream::CFileSeekableIOStream(const char16_t *inWideName, FileOpenFlags inFlags)
-{
- openFile(QString::fromUtf16(inWideName), inFlags);
-}
-
-CFileSeekableIOStream::CFileSeekableIOStream(const QString &inFIle, FileOpenFlags inFlags)
-{
- openFile(inFIle, inFlags);
-}
-
-void CFileSeekableIOStream::openFile(const QString &path, FileOpenFlags inFlags)
-{
- if (path.isEmpty())
- return;
-
- QIODevice::OpenMode fileFlags = QIODevice::ReadOnly;
- if (inFlags & FileOpenFlagValues::Write)
- fileFlags = QIODevice::ReadWrite;
- if (inFlags & FileOpenFlagValues::Truncate)
- fileFlags |= QIODevice::Truncate;
-
- m_File.setFileName(CFileTools::NormalizePathForQtUsage(path));
- if (!m_File.open(fileFlags)) {
- qCCritical(INTERNAL_ERROR) << "failed to open file"
- << path << "with error" << m_File.errorString();
- QT3DS_ASSERT(false);
- }
-}
-
-CFileSeekableIOStream::~CFileSeekableIOStream()
-{
- m_File.close();
-}
-
-bool CFileSeekableIOStream::IsOpen()
-{
- return m_File.isOpen();
-}
-
-void CFileSeekableIOStream::SetPosition(QT3DSI64 inOffset, SeekPosition::Enum inEnum)
-{
- if (inOffset > QT3DS_MAX_I32 || inOffset < QT3DS_MIN_I32) {
- qCCritical(INVALID_OPERATION, "Attempt to seek further than platform allows");
- QT3DS_ASSERT(false);
- return;
- } else {
- CFileTools::SetStreamPosition(m_File, inOffset, inEnum);
- }
-}
-
-QT3DSI64 CFileSeekableIOStream::GetPosition() const
-{
- return m_File.pos();
-}
-
-QT3DSU32 CFileSeekableIOStream::Read(NVDataRef<QT3DSU8> data)
-{
- return m_File.read((char *)data.begin(), data.size());
-}
-
-bool CFileSeekableIOStream::Write(NVConstDataRef<QT3DSU8> data)
-{
- if (!m_File.isOpen()) {
- QT3DS_ASSERT(false);
- return 0;
- }
- qint64 numBytes = m_File.write((char*)data.begin(), data.size());
- return numBytes == data.size();
-}
-
-CMemorySeekableIOStream::CMemorySeekableIOStream(NVAllocatorCallback &inAlloc,
- const char *inAllocName)
- : m_Allocator(inAlloc)
- , m_AllocationName(inAllocName)
- , m_Data(NULL)
- , m_Size(0)
- , m_Offset(0)
- , m_Capacity(0)
-{
-}
-
-CMemorySeekableIOStream::~CMemorySeekableIOStream()
-{
- if (m_Data)
- m_Allocator.deallocate(m_Data);
- m_Data = NULL;
- m_Size = 0;
- m_Capacity = 0;
- m_Offset = 0;
-}
-
-void CMemorySeekableIOStream::SetPosition(QT3DSI64 inOffset, SeekPosition::Enum inEnum)
-{
- QT3DSI64 startPos = 0;
-
- switch (inEnum) {
- case SeekPosition::Begin:
- startPos = 0;
- break;
- case SeekPosition::Current:
- startPos = m_Offset;
- break;
- case SeekPosition::End:
- startPos = m_Size;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- startPos += inOffset;
- if (m_Size == 0 && inOffset != 0) {
- QT3DS_ASSERT(false);
- return;
- }
- if (startPos < 0) {
- QT3DS_ASSERT(false);
- startPos = 0;
- }
- if (startPos >= m_Size && startPos != 0) {
- QT3DS_ASSERT(false);
- startPos = m_Size - 1;
- }
- m_Offset = static_cast<QT3DSU32>(startPos);
-}
-
-QT3DSU32 CMemorySeekableIOStream::Read(NVDataRef<QT3DSU8> data)
-{
- if (m_Data == NULL)
- return 0;
- QT3DSU32 amountLeft = m_Size - m_Offset;
- QT3DSU32 numBytes = NVMin(amountLeft, data.size());
- intrinsics::memCopy(data.begin(), m_Data + m_Offset, numBytes);
- m_Offset += numBytes;
- return numBytes;
-}
-
-bool CMemorySeekableIOStream::Write(NVConstDataRef<QT3DSU8> data)
-{
- reserve(data.size() + m_Offset);
- intrinsics::memCopy(m_Data + m_Offset, data.begin(), data.size());
- m_Offset += data.size();
- m_Size = NVMax(m_Size, m_Offset);
- return true;
-}
-
-void CMemorySeekableIOStream::reserve(QT3DSU32 inNewSize)
-{
- if (inNewSize > m_Capacity) {
- if (inNewSize < 100000)
- inNewSize *= 2;
- QT3DSU8 *newData =
- (QT3DSU8 *)m_Allocator.allocate(inNewSize, m_AllocationName, __FILE__, __LINE__);
- if (m_Size) {
- intrinsics::memCopy(newData, m_Data, m_Size);
- m_Allocator.deallocate(m_Data);
- }
- m_Data = newData;
- m_Capacity = inNewSize;
- }
-}
-
-namespace {
-
-struct WriteBufferedStreamImpl;
-struct WriteBufferThread : public Thread
-{
- // When a buffer is available
- WriteBufferedStreamImpl &m_Impl;
- WriteBufferThread(NVFoundationBase &fnd, WriteBufferedStreamImpl &i)
- : Thread(fnd)
- , m_Impl(i)
- {
- setName("WriteBufferThread");
- }
- void execute() override;
-};
-
-#ifdef _WIN32
-#pragma warning(disable : 4355)
-#endif
-/* Double buffered stream implementation with a sending thread constantly
- * pulling data from the main thread and writing it out to socket.
- */
-struct WriteBufferedStreamImpl : public WriteBufferedOutStream
-{
- NVFoundationBase &m_Foundation;
- IOutStream &m_Stream;
- MemoryBuffer<> m_Buf1;
- MemoryBuffer<> m_Buf2;
- MemoryBuffer<> *m_CurrentBuffer;
- MemoryBuffer<> *m_WriteBuffer;
- QT3DSU32 m_BufferSize;
- volatile bool m_StreamValid;
- Mutex m_BufferLock;
- Sync m_DataAvailable;
- Sync m_WriteFinished;
- WriteBufferThread m_Thread;
- QT3DSI32 mRefCount;
-
- WriteBufferedStreamImpl(NVFoundationBase &fnd, QT3DSU32 totalBufSize, IOutStream &s)
- : m_Foundation(fnd)
- , m_Stream(s)
- , m_Buf1(ForwardingAllocator(fnd.getAllocator(), "WriteBufferedStreamImpl::buffer"))
- , m_Buf2(ForwardingAllocator(fnd.getAllocator(), "WriteBufferedStreamImpl::buffer"))
- , m_CurrentBuffer(&m_Buf1)
- , m_WriteBuffer(NULL)
- , m_BufferSize(totalBufSize / 2)
- , m_StreamValid(true)
- , m_BufferLock(fnd.getAllocator())
- , m_DataAvailable(fnd.getAllocator())
- , m_WriteFinished(fnd.getAllocator())
- , m_Thread(fnd, *this)
- , mRefCount(0)
- {
- m_Buf1.reserve(m_BufferSize);
- m_Buf2.reserve(m_BufferSize);
- }
- ~WriteBufferedStreamImpl()
- {
- m_Thread.signalQuit();
- m_DataAvailable.set();
- m_Thread.waitForQuit();
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- bool Write(NVConstDataRef<QT3DSU8> data) override
- {
- while (data.size() && m_StreamValid) {
- QT3DSU32 currentBufferSize;
- QT3DSU32 amountCanWrite;
- {
- Mutex::ScopedLock locker(m_BufferLock);
- currentBufferSize = m_CurrentBuffer->size();
- amountCanWrite = NVMin(data.size(), m_BufferSize - currentBufferSize);
- m_CurrentBuffer->write(data.begin(), amountCanWrite);
- currentBufferSize += amountCanWrite;
- }
- m_DataAvailable.set();
- if (currentBufferSize == m_BufferSize) {
- m_WriteFinished.wait();
- m_WriteFinished.reset();
- // Blocking call if we are already sending data.
- data = NVConstDataRef<QT3DSU8>(data.begin() + amountCanWrite,
- data.size() - amountCanWrite);
- }
- }
- return m_StreamValid;
- }
-
- IOutStream &wrappedStream() override { return m_Stream; }
-
- QT3DSU32 getTotalBufferSize()
- {
- Mutex::ScopedLock locker(m_BufferLock);
- QT3DSU32 retval = m_CurrentBuffer->size();
- if (m_WriteBuffer)
- retval += m_WriteBuffer->size();
- return retval;
- }
-
- QT3DSU32 getWriteBufferSize()
- {
- Mutex::ScopedLock locker(m_BufferLock);
- if (m_WriteBuffer)
- return m_WriteBuffer->size();
- return 0;
- }
-
- void flush() override
- {
- while (getTotalBufferSize()) {
- m_WriteFinished.wait();
- m_WriteFinished.reset();
- }
- }
-};
-
-void WriteBufferThread::execute()
-{
- while (!quitIsSignalled()) {
- m_Impl.m_DataAvailable.wait();
-
- if (!quitIsSignalled() && m_Impl.m_StreamValid) {
- m_Impl.m_DataAvailable.reset();
- {
- Mutex::ScopedLock locker(m_Impl.m_BufferLock);
- m_Impl.m_WriteBuffer = m_Impl.m_CurrentBuffer;
- m_Impl.m_CurrentBuffer =
- m_Impl.m_CurrentBuffer == &m_Impl.m_Buf1 ? &m_Impl.m_Buf2 : &m_Impl.m_Buf1;
- QT3DS_ASSERT(m_Impl.m_WriteBuffer != m_Impl.m_CurrentBuffer);
- }
- NVConstDataRef<QT3DSU8> dataBuffer(*m_Impl.m_WriteBuffer);
- if (dataBuffer.size()) {
- m_Impl.m_StreamValid = m_Impl.m_Stream.Write(dataBuffer);
- {
- Mutex::ScopedLock locker(m_Impl.m_BufferLock);
- m_Impl.m_WriteBuffer->clear();
- m_Impl.m_WriteBuffer = NULL;
- }
- }
- m_Impl.m_WriteFinished.set();
- }
- }
- quit();
-}
-}
-
-NVScopedRefCounted<WriteBufferedOutStream>
-WriteBufferedOutStreamCreate(NVFoundationBase &fnd, IOutStream &stream, QT3DSU32 totalBufferSize)
-{
- return QT3DS_NEW(fnd.getAllocator(), WriteBufferedStreamImpl)(fnd, totalBufferSize, stream);
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/IOStreams.h b/src/Runtime/ogl-runtime/src/foundation/IOStreams.h
deleted file mode 100644
index 855e5209..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/IOStreams.h
+++ /dev/null
@@ -1,278 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_IO_STREAMS_H
-#define QT3DS_FOUNDATION_IO_STREAMS_H
-
-#include "EABase/eabase.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/TrackingAllocator.h"
-#include "foundation/Qt3DSMath.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Utils.h"
-#include "foundation/Qt3DSRefCounted.h"
-
-#include <QFile>
-#include <QString>
-
-namespace qt3ds {
-class NVFoundationBase;
-
-namespace foundation {
-
- class IOutStream
- {
- protected:
- virtual ~IOutStream() {}
- public:
- virtual bool Write(NVConstDataRef<QT3DSU8> data) = 0;
- void WriteWithLen(NVConstDataRef<QT3DSU8> data)
- {
- Write(data.size());
- Write(data);
- }
- template <typename TDataType>
- void Write(const TDataType &type)
- {
- Write(toU8ConstDataRef(type));
- }
- template <typename TDataType>
- void Write(const TDataType *data, QT3DSU32 numItems)
- {
- Write(toU8ConstDataRef(data, numItems));
- }
- void Write(const wchar_t *data)
- {
- if (data == NULL)
- data = L"";
- // Write the null character at the end of the string.
- // This just makes reading and debugging a lot less error prone.
- // at the expense of 2 bytes.
- Write(data, (QT3DSU32)StrLen(data) + 1);
- }
- template <typename TDataType>
- void WriteWithLen(const TDataType *data, QT3DSU32 numItems)
- {
- WriteWithLen(toU8ConstDataRef(data, numItems));
- }
- };
-
- class IInStream
- {
- protected:
- virtual ~IInStream() {}
- public:
- // Semantics are precisely that you return the amount read
- virtual QT3DSU32 Read(NVDataRef<QT3DSU8> data) = 0;
-
- QT3DSU32 SafeRead(NVDataRef<QT3DSU8> data)
- {
- QT3DSU32 amountRead = Read(data);
- QT3DS_ASSERT(amountRead == data.size());
- if (amountRead < data.size())
- intrinsics::memZero(data.begin() + amountRead, data.size() - amountRead);
- return amountRead;
- }
- QT3DSU32 ReadWithLen(NVDataRef<QT3DSU8> data)
- {
- QT3DSU32 len = 0;
- Read(len);
- return SafeRead(toDataRef(data.begin(), len));
- }
- template <typename TDataType>
- QT3DSU32 Read(TDataType &type)
- {
- return SafeRead(toU8DataRef(type));
- }
- template <typename TDataType>
- QT3DSU32 Read(TDataType *data, QT3DSU32 numItems)
- {
- return SafeRead(toU8DataRef(data, numItems));
- }
- };
-
- struct SeekPosition
- {
- enum Enum {
- Unknown,
- Begin,
- Current,
- End,
- };
- };
-
- class ISeekable
- {
- protected:
- virtual ~ISeekable() {}
- public:
- virtual void SetPosition(QT3DSI64 inOffset, SeekPosition::Enum inEnum) = 0;
- virtual QT3DSI64 GetPosition() const = 0;
- virtual QT3DSI64 GetLength() const
- {
- ISeekable &seekable(const_cast<ISeekable &>(*this));
- QT3DSI64 currentPos(GetPosition());
- seekable.SetPosition(0, SeekPosition::End);
- QT3DSI64 retval(GetPosition());
- seekable.SetPosition(currentPos, SeekPosition::Begin);
- return retval;
- }
- };
-
- class ISeekableIOStream : public IInStream, public IOutStream, public ISeekable
- {
- };
-
- struct FileOpenFlagValues
- {
- enum Enum {
- Open = 1, // Without this flag, function fails if file exists
- Truncate = 1 << 1, // Truncate the file so an immediate close will empty it.
- Create = 1 << 2,
- Write = 1 << 3,
- };
- };
-
- typedef NVFlags<FileOpenFlagValues::Enum, int> FileOpenFlags;
-
- static inline FileOpenFlags FileReadFlags() { return FileOpenFlags(FileOpenFlagValues::Open); }
-
- static inline FileOpenFlags FileWriteFlags()
- {
- return FileOpenFlags(FileOpenFlagValues::Create | FileOpenFlagValues::Open
- | FileOpenFlagValues::Write | FileOpenFlagValues::Truncate);
- }
- static inline FileOpenFlags FileAppendFlags()
- {
- return FileOpenFlags(FileOpenFlagValues::Create | FileOpenFlagValues::Open
- | FileOpenFlagValues::Write);
- }
-
- class CFileSeekableIOStream : public ISeekableIOStream
- {
- protected:
- QFile m_File;
-
- public:
- // Enabling append also enables reading from the file while being able to
- // write to it.
- CFileSeekableIOStream(const char *inFile, FileOpenFlags inFlags);
-#ifdef WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
- CFileSeekableIOStream(const wchar_t *inFile, FileOpenFlags inFlags);
-#endif
-
- CFileSeekableIOStream(const char16_t *inFile, FileOpenFlags inFlags);
- CFileSeekableIOStream(const QString &inFIle, FileOpenFlags inFlags);
- virtual ~CFileSeekableIOStream();
- virtual bool IsOpen();
- void SetPosition(QT3DSI64 inOffset, SeekPosition::Enum inEnum) override;
- QT3DSI64 GetPosition() const override;
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override;
- bool Write(NVConstDataRef<QT3DSU8> data) override;
-
- private:
- void openFile(const QString &path, FileOpenFlags inFlags);
- };
-
- class CMemorySeekableIOStream : public ISeekableIOStream
- {
- protected:
- NVAllocatorCallback &m_Allocator;
- const char *m_AllocationName;
- QT3DSU8 *m_Data;
- QT3DSU32 m_Size;
- QT3DSU32 m_Offset;
- QT3DSU32 m_Capacity;
-
- public:
- CMemorySeekableIOStream(NVAllocatorCallback &inAlloc, const char *inAllocName);
- virtual ~CMemorySeekableIOStream();
- void SetPosition(QT3DSI64 inOffset, SeekPosition::Enum inEnum) override;
- QT3DSI64 GetPosition() const override { return m_Offset; }
- QT3DSI64 GetLength() const override { return m_Size; }
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override;
- bool Write(NVConstDataRef<QT3DSU8> data) override;
-
- // Add in the standard container functions
- QT3DSU8 *begin() { return m_Data; }
- QT3DSU8 *end() { return m_Data + m_Size; }
- const QT3DSU8 *begin() const { return m_Data; }
- const QT3DSU8 *end() const { return m_Data + m_Size; }
- void clear()
- {
- m_Offset = 0;
- m_Size = 0;
- }
- QT3DSU32 size() const { return m_Size; }
- void reserve(QT3DSU32 inNewSize);
- void resize(QT3DSU32 inNewSize)
- {
- reserve(inNewSize);
- m_Size = inNewSize;
- }
- };
-
- // Simple, one way input stream.
- struct SMemoryInStream : public IInStream
- {
- const QT3DSU8 *m_Begin;
- const QT3DSU8 *m_End;
- SMemoryInStream(const QT3DSU8 *b, const QT3DSU8 *e)
- : m_Begin(b)
- , m_End(e)
- {
- }
-
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- size_t available = m_End - m_Begin;
- size_t requested = data.size();
- size_t amount = NVMin(available, requested);
- qt3ds::intrinsics::memCopy(data.mData, m_Begin, (QT3DSU32)amount);
- m_Begin += amount;
- return (QT3DSU32)amount;
- }
- };
-
- class WriteBufferedOutStream : public IOutStream, public NVRefCounted
- {
- public:
- virtual IOutStream &wrappedStream() = 0;
- virtual void flush() = 0;
-
- static NVScopedRefCounted<WriteBufferedOutStream>
- Create(NVFoundationBase &fnd, IOutStream &stream, QT3DSU32 totalBufferSize = 128 * 1024);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/LICENCE_SOCKET.TXT b/src/Runtime/ogl-runtime/src/foundation/LICENCE_SOCKET.TXT
deleted file mode 100644
index 9b9ab805..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/LICENCE_SOCKET.TXT
+++ /dev/null
@@ -1,20 +0,0 @@
-LuaSocket 3.0 license
-Copyright (C) 2004-2013 Diego Nehab
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/src/Runtime/ogl-runtime/src/foundation/LICENSE_CONVERTUTF.TXT b/src/Runtime/ogl-runtime/src/foundation/LICENSE_CONVERTUTF.TXT
deleted file mode 100644
index 254acdfe..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/LICENSE_CONVERTUTF.TXT
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright 2001-2004 Unicode, Inc.
-
-Disclaimer
-
-This source code is provided as is by Unicode, Inc. No claims are
-made as to fitness for any particular purpose. No warranties of any
-kind are expressed or implied. The recipient agrees to determine
-applicability of information provided. If this file has been
-purchased on magnetic or optical media from Unicode, Inc., the
-sole remedy for any claim will be exchange of defective media
-within 90 days of receipt.
-
-Limitations on Rights to Redistribute This Code
-
-Unicode, Inc. hereby grants the right to freely use the information
-supplied in this file in the creation of products supporting the
-Unicode Standard, and to make copies of this file in any form
-for internal or external distribution as long as this notice
-remains attached.
diff --git a/src/Runtime/ogl-runtime/src/foundation/PoolingAllocator.h b/src/Runtime/ogl-runtime/src/foundation/PoolingAllocator.h
deleted file mode 100644
index 9d939fdc..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/PoolingAllocator.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_FOUNDATION_POOLING_ALLOCATOR_H
-#define QT3DS_FOUNDATION_POOLING_ALLOCATOR_H
-#pragma once
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "foundation/Qt3DSMutex.h"
-
-// Pooling allocator. Not designed for small allocations
-// starting at 64 bytes and up to 4 K, allocator uses pools.
-// Above that, uses default allocator. THis object is absolutely not threadsafe.
-// This addes 8 bytes to each allocation in order to safely track the allocation size.
-// There is no strict requirement to deallocate; this allocator automatically deallocates
-// anything allocated through it.
-namespace qt3ds {
-namespace foundation {
- struct SPoolingAllocator : public NVAllocatorCallback
- {
- typedef Mutex TMutexType;
- typedef Mutex::ScopedLock TLockType;
-
- NVAllocatorCallback &m_Allocator;
- TMutexType m_Mutex;
-
- struct SAllocationTag
- {
- QT3DSU32 m_Tag;
- size_t m_Size;
- SAllocationTag(size_t inSize = 0)
- : m_Tag(0xAB5534CD)
- , m_Size(inSize)
- {
- }
- };
-
- template <size_t TObjSize>
- struct SPoolObj
- {
- QT3DSU32 m_Buffer[TObjSize / 4];
- SPoolObj() {}
- };
-#define ITERATE_POOLING_ALLOCATOR_POOL_SIZES \
- HANDLE_POOLING_ALLOCATOR_POOL_SIZE(64) \
- HANDLE_POOLING_ALLOCATOR_POOL_SIZE(128) \
- HANDLE_POOLING_ALLOCATOR_POOL_SIZE(256) \
- HANDLE_POOLING_ALLOCATOR_POOL_SIZE(512) \
- HANDLE_POOLING_ALLOCATOR_POOL_SIZE(1024)
-
-#define HANDLE_POOLING_ALLOCATOR_POOL_SIZE(sz) \
- Pool<SPoolObj<sz>, ForwardingAllocator, 4> m_Pool##sz;
- ITERATE_POOLING_ALLOCATOR_POOL_SIZES
-#undef HANDLE_POOLING_ALLOCATOR_POOL_SIZE
-
- SSAutoDeallocatorAllocator m_LargeAllocator;
-
-#define HANDLE_POOLING_ALLOCATOR_POOL_SIZE(sz) \
- , m_Pool##sz(ForwardingAllocator(inAllocator, "PoolingAllocatorPool"))
-
- SPoolingAllocator(NVAllocatorCallback &inAllocator)
- : m_Allocator(inAllocator)
- , m_Mutex(inAllocator) ITERATE_POOLING_ALLOCATOR_POOL_SIZES
- , m_LargeAllocator(inAllocator)
- {
- }
-#undef HANDLE_POOLING_ALLOCATOR_POOL_SIZE
-
- void *doAllocateFromPool(size_t size)
- {
- TLockType locker(m_Mutex);
-
-#define HANDLE_POOLING_ALLOCATOR_POOL_SIZE(sz) \
- if (size <= sz) \
- return m_Pool##sz.allocate(__FILE__, __LINE__);
- ITERATE_POOLING_ALLOCATOR_POOL_SIZES
-#undef HANDLE_POOLING_ALLOCATOR_POOL_SIZE
-
- return m_LargeAllocator.allocate(size, "largetype", __FILE__, __LINE__, 0);
- }
-
- void *doAllocate(size_t size)
- {
- size += sizeof(SAllocationTag);
- SAllocationTag *tag = reinterpret_cast<SAllocationTag *>(doAllocateFromPool(size));
- new (tag) SAllocationTag(size);
- QT3DSU8 *data = reinterpret_cast<QT3DSU8 *>(tag);
- return data + sizeof(SAllocationTag);
- }
-
- void *allocate(size_t size, const char * /*typeName*/, const char * /*filename*/,
- int /*line*/, int /*flags*/ = 0) override
- {
- return doAllocate(size);
- }
-
- void *allocate(size_t size, const char * /*typeName*/, const char * /*filename*/,
- int /*line*/, size_t /*alignment*/, size_t /*alignmentOffset*/) override
- {
- return doAllocate(size);
- }
-
- /**
- \brief Frees memory previously allocated by allocate().
-
- <b>Threading:</b> This function should be thread safe as it can be called in the context of
- the user thread
- and physics processing thread(s).
-
- \param ptr Memory to free.
- */
- void deallocate(void *ptr) override
- {
- TLockType locker(m_Mutex);
-
- // Deallocate on null is fine.
- if (ptr == NULL)
- return;
-
- SAllocationTag tempTag;
- QT3DSU8 *dataPtr = reinterpret_cast<QT3DSU8 *>(ptr);
- SAllocationTag *theTag =
- reinterpret_cast<SAllocationTag *>(dataPtr - sizeof(SAllocationTag));
- if (theTag->m_Tag != tempTag.m_Tag) {
- QT3DS_ASSERT(false);
- return;
- }
-
- size_t size = theTag->m_Size;
-
- // We add this offset at allocation time
- ptr = dataPtr - sizeof(SAllocationTag);
-
-#define HANDLE_POOLING_ALLOCATOR_POOL_SIZE(sz) \
- if (size <= sz) { \
- m_Pool##sz.deallocate(ptr); \
- return; \
- }
- ITERATE_POOLING_ALLOCATOR_POOL_SIZES
-#undef HANDLE_POOLING_ALLOCATOR_POOL_SIZE
- m_LargeAllocator.deallocate(ptr);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/PreAllocatedAllocator.h b/src/Runtime/ogl-runtime/src/foundation/PreAllocatedAllocator.h
deleted file mode 100644
index aea03577..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/PreAllocatedAllocator.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_RENDER_PRE_ALLOCATED_ALLOCATOR_H
-#define QT3DS_RENDER_PRE_ALLOCATED_ALLOCATOR_H
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace foundation {
-
- // Ignores deallocate calls if they originate withing the pre-allocation block
- struct SPreAllocatedAllocator : public NVAllocatorCallback
- {
- NVAllocatorCallback &m_Allocator;
- NVDataRef<QT3DSU8> m_PreAllocatedBlock;
- bool m_OwnsMemory; // then we attempt to deallocate on destruction
-
- SPreAllocatedAllocator(NVAllocatorCallback &inAllocator)
- : m_Allocator(inAllocator)
- , m_OwnsMemory(false)
- {
- }
-
- SPreAllocatedAllocator(NVAllocatorCallback &inAllocator, NVDataRef<QT3DSU8> inData,
- bool inOwnsMemory)
- : m_Allocator(inAllocator)
- , m_PreAllocatedBlock(inData)
- , m_OwnsMemory(inOwnsMemory)
- {
- }
-
- virtual ~SPreAllocatedAllocator()
- {
- if (m_OwnsMemory)
- m_Allocator.deallocate(m_PreAllocatedBlock.begin());
- }
-
- void *allocate(size_t size, const char *typeName, const char *filename, int line,
- int flags = 0) override
- {
- return m_Allocator.allocate(size, typeName, filename, line, flags);
- }
-
- void *allocate(size_t size, const char *typeName, const char *filename, int line,
- size_t alignment, size_t alignmentOffset) override
- {
- return m_Allocator.allocate(size, typeName, filename, line, alignment, alignmentOffset);
- }
-
- void deallocate(void *ptr) override
- {
- if (!ptr)
- return;
- if (ptr < m_PreAllocatedBlock.begin() || ptr >= m_PreAllocatedBlock.end())
- m_Allocator.deallocate(ptr);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DS.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DS.h
deleted file mode 100644
index 041923c3..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DS.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_H
-#define QT3DS_H
-#include "EABase/eabase.h"
-#include "foundation/Qt3DSPreprocessor.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSAssert.h"
-
-namespace eastl {
-}
-
-namespace qt3ds {
-class NVEmpty
-{
-};
-class QT3DSMat33;
-class QT3DSMat44;
-class QT3DSVec2;
-class QT3DSVec3;
-class QT3DSVec4;
-class NVTransform;
-
-#if !defined QT3DS_DONT_PRAGMA_WARNINGS && defined EA_COMPILER_MSVC
-#pragma warning(disable : 4512) // assignment operator not generated
-#endif
-
-#define QT3DS_SIGN_BITMASK 0x80000000
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocator.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocator.h
deleted file mode 100644
index cdbbe5f9..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocator.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSALLOCATOR_H
-#define QT3DS_FOUNDATION_PSALLOCATOR_H
-
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-
-#if (defined(QT3DS_WINDOWS) | defined(QT3DS_X360))
-#include <typeinfo.h>
-#endif
-#if (defined(QT3DS_APPLE))
-#include <typeinfo>
-#endif
-
-#include <new>
-
-// Allocation macros going through user allocator
-#define QT3DS_ALLOC(alloc, n, name) alloc.allocate(n, name, __FILE__, __LINE__)
-#define QT3DS_ALLOC_TEMP(alloc, n, name) QT3DS_ALLOC(n, name)
-#define QT3DS_FREE(alloc, x) alloc.deallocate(x)
-#define QT3DS_FREE_AND_RESET(x) \
-{ \
- QT3DS_FREE(x); \
- x = 0; \
- }
-
-// The following macros support plain-old-types and classes derived from UserAllocated.
-#define QT3DS_NEW(alloc, T) new (QT3DS_ALLOC(alloc, sizeof(T), #T)) T
-#define QT3DS_NEW_TEMP(alloc, T) QT3DS_NEW(alloc, T)
-#define QT3DS_DELETE_POD(x) \
-{ \
- QT3DS_FREE(x); \
- x = 0; \
- }
-
-namespace qt3ds {
-namespace foundation {
-template <typename TObjType>
-inline void NVDelete(NVAllocatorCallback &alloc, TObjType *item)
-{
- if (item) {
- item->~TObjType();
- alloc.deallocate(item);
- }
-}
-}
-}
-
-//! placement new macro to make it easy to spot bad use of 'new'
-#define QT3DS_PLACEMENT_NEW(p, T) new (p) T
-
-// Don't use inline for alloca !!!
-#ifdef QT3DS_WINDOWS
-#include <malloc.h>
-#define NVAlloca(x) _alloca(x)
-#elif defined(QT3DS_LINUX) || defined(QT3DS_ANDROID) || defined(QT3DS_QNX)
-#if defined(__INTEGRITY)
-#include <alloca.h>
-#else
-#include <malloc.h>
-#endif
-#define NVAlloca(x) alloca(x)
-#elif defined(QT3DS_PSP2)
-#include <alloca.h>
-#define NVAlloca(x) alloca(x)
-#elif defined(QT3DS_APPLE)
-#include <stdlib.h>
-#include <alloca.h>
-#define NVAlloca(x) alloca(x)
-#elif defined(QT3DS_PS3)
-#include <alloca.h>
-#define NVAlloca(x) alloca(x)
-#elif defined(QT3DS_X360)
-#include <malloc.h>
-#define NVAlloca(x) _alloca(x)
-#elif defined(QT3DS_WII)
-#include <alloca.h>
-#define NVAlloca(x) alloca(x)
-#endif
-
-namespace qt3ds {
-namespace foundation {
-/*
- * Bootstrap allocator using malloc/free.
- * Don't use unless your objects get allocated before foundation is initialized.
- */
-class RawAllocator
-{
-public:
- RawAllocator(const char * = 0) {}
- void *allocate(size_t size, const char *, int)
- {
-#if defined(QT3DS_APPLE)
- // malloc returns valid pointer for size==0, no need to check
- return malloc(size);
-#else
- // malloc returns valid pointer for size==0, no need to check
- return ::malloc(size);
-#endif
- }
- void deallocate(void *ptr)
- {
-#if defined(QT3DS_APPLE)
- free(ptr);
-#else
- // free(0) is guaranteed to have no side effect, no need to check
- ::free(ptr);
-#endif
- }
-};
-
-struct ForwardingAllocator
-{
- NVAllocatorCallback *mAllocator;
- const char *mTypeName;
- ForwardingAllocator(const char *typeName)
- : mTypeName(typeName)
- {
- }
- ForwardingAllocator(NVAllocatorCallback &alloc, const char *typeName)
- : mAllocator(&alloc)
- , mTypeName(typeName)
- {
- }
- ForwardingAllocator(NVAllocatorCallback *alloc = NULL)
- : mAllocator(alloc)
- , mTypeName("__error__")
- {
- QT3DS_ASSERT(false);
- }
- ForwardingAllocator(const ForwardingAllocator &other)
- : mAllocator(other.mAllocator)
- , mTypeName(other.mTypeName)
- {
- }
- ForwardingAllocator &operator=(const ForwardingAllocator &other)
- {
- mAllocator = other.mAllocator;
- mTypeName = other.mTypeName;
- return *this;
- }
- bool operator==(const ForwardingAllocator &other) const
- {
- return mAllocator == other.mAllocator;
- }
- NVAllocatorCallback &getAllocator() { return *mAllocator; }
- // flags are unused
- void *allocate(size_t size, const char *filename, int line, int flags = 0)
- {
- return getAllocator().allocate(size, mTypeName, filename, line, flags);
- }
- void *allocate(size_t size, const char *filename, int line, size_t alignment,
- size_t alignmentOffset)
- {
- return getAllocator().allocate(size, mTypeName, filename, line, alignment,
- alignmentOffset);
- }
- void deallocate(void *ptr, size_t) { getAllocator().deallocate(ptr); }
- void deallocate(void *ptr) { getAllocator().deallocate(ptr); }
-};
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocatorCallback.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocatorCallback.h
deleted file mode 100644
index ebbf8198..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAllocatorCallback.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_ALLOCATOR_CALLBACK_H
-#define QT3DS_FOUNDATION_QT3DS_ALLOCATOR_CALLBACK_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DS.h"
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/**
-\brief Abstract base class for an application defined memory allocator that can be used by the NV
-library.
-
-\note The SDK state should not be modified from within any allocation/free function.
-
-<b>Threading:</b> All methods of this class should be thread safe as it can be called from the user
-thread
-or the physics processing thread(s).
-*/
-
-class NVAllocatorCallback
-{
-public:
- /**
- \brief destructor
- */
- virtual ~NVAllocatorCallback() {}
-
- /**
- \brief Allocates size bytes of memory, which must be 16-byte aligned.
-
- This method should never return NULL. If you run out of memory, then
- you should terminate the app or take some other appropriate action.
-
- <b>Threading:</b> This function should be thread safe as it can be called in the context of the
- user thread
- and physics processing thread(s).
-
- \param size Number of bytes to allocate.
- \param typeName Name of the datatype that is being allocated
- \param filename The source file which allocated the memory
- \param line The source line which allocated the memory
- \return The allocated block of memory.
- */
- virtual void *allocate(size_t size, const char *typeName, const char *filename, int line,
- int flags = 0) = 0;
- virtual void *allocate(size_t size, const char *typeName, const char *filename, int line,
- size_t alignment, size_t alignmentOffset) = 0;
-
- /**
- \brief Frees memory previously allocated by allocate().
-
- <b>Threading:</b> This function should be thread safe as it can be called in the context of the
- user thread
- and physics processing thread(s).
-
- \param ptr Memory to free.
- */
- virtual void deallocate(void *ptr) = 0;
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAssert.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSAssert.h
deleted file mode 100644
index a628159f..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAssert.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_ASSERT_H
-#define QT3DS_ASSERT_H
-#include "foundation/Qt3DSPreprocessor.h"
-
-// Force the user to define the Qt3DSAssert function
-namespace qt3ds {
-void Qt3DSAssert(const char *exp, const char *file, int line, bool *ignore);
-}
-
-#ifdef __CUDACC__
-#define QT3DS_ASSERT(exp) ((void)0)
-#define QT3DS_ALWAYS_ASSERT_MESSAGE(exp) ((void)0)
-#else // __CUDACC__
-#ifndef NDEBUG
-#define QT3DS_ASSERT(exp) \
- { \
- static bool ignore = false; \
- (void)((!!(exp)) || (qt3ds::Qt3DSAssert(#exp, __FILE__, __LINE__, &ignore), false)); \
- }
-#else // NDEBUG
-#define QT3DS_ASSERT(exp) ((void)0)
-#endif // NDEBUG
-#define QT3DS_ALWAYS_ASSERT_MESSAGE(exp) \
- { \
- static bool ignore = false; \
- (void)((qt3ds::Qt3DSAssert(exp, __FILE__, __LINE__, &ignore), false)); \
- }
-#endif // __CUDACC__
-
-#define QT3DS_ALWAYS_ASSERT() QT3DS_ASSERT(0)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAtomic.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSAtomic.h
deleted file mode 100644
index 69c7d3b4..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSAtomic.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSATOMIC_H
-#define QT3DS_FOUNDATION_PSATOMIC_H
-
-#include "foundation/Qt3DS.h"
-
-namespace qt3ds {
-namespace foundation {
- /* set *dest equal to val. Return the old value of *dest */
- QT3DS_AUTOTEST_EXPORT QT3DSI32 atomicExchange(volatile QT3DSI32 *dest, QT3DSI32 val);
-
- /* if *dest == comp, replace with exch. Return original value of *dest */
- QT3DS_AUTOTEST_EXPORT QT3DSI32 atomicCompareExchange(volatile QT3DSI32 *dest, QT3DSI32 exch, QT3DSI32 comp);
-
- /* if *dest == comp, replace with exch. Return original value of *dest */
- QT3DS_AUTOTEST_EXPORT void *atomicCompareExchangePointer(volatile void **dest, void *exch,
- void *comp);
-
- /* increment the specified location. Return the incremented value */
- QT3DS_AUTOTEST_EXPORT QT3DSI32 atomicIncrement(volatile QT3DSI32 *val);
-
- /* decrement the specified location. Return the decremented value */
- QT3DS_AUTOTEST_EXPORT QT3DSI32 atomicDecrement(volatile QT3DSI32 *val);
-
- /* add delta to *val. Return the new value */
- QT3DS_AUTOTEST_EXPORT QT3DSI32 atomicAdd(volatile QT3DSI32 *val, QT3DSI32 delta);
-
- /* compute the maximum of dest and val. Return the new value */
- QT3DS_AUTOTEST_EXPORT QT3DSI32 atomicMax(volatile QT3DSI32 *val, QT3DSI32 val2);
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSBasicTemplates.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSBasicTemplates.h
deleted file mode 100644
index f14c7b32..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSBasicTemplates.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSBASICTEMPLATES_H
-#define QT3DS_FOUNDATION_PSBASICTEMPLATES_H
-
-#include "foundation/Qt3DS.h"
-
-namespace qt3ds {
-namespace foundation {
- template <typename A>
- struct Equal
- {
- bool operator()(const A &a, const A &b) const { return a == b; }
- };
-
- template <typename A>
- struct Less
- {
- bool operator()(const A &a, const A &b) const { return a < b; }
- };
-
- template <typename A>
- struct Greater
- {
- bool operator()(const A &a, const A &b) const { return a > b; }
- };
-
- template <class F, class S>
- class Pair
- {
- public:
- F first;
- S second;
- Pair()
- : first(F())
- , second(S())
- {
- }
- Pair(const F &f, const S &s)
- : first(f)
- , second(s)
- {
- }
- Pair(const Pair &p)
- : first(p.first)
- , second(p.second)
- {
- }
- // CN - fix for /.../Qt3DSBasicTemplates.h(61) : warning C4512: 'nv::foundation::Pair<F,S>' :
- // assignment operator could not be generated
- Pair &operator=(const Pair &p)
- {
- first = p.first;
- second = p.second;
- return *this;
- }
- bool operator==(const Pair &p) const { return first == p.first && second == p.second; }
- };
-
- template <unsigned int A>
- struct LogTwo
- {
- static const unsigned int value = LogTwo<(A >> 1)>::value + 1;
- };
- template <>
- struct LogTwo<1>
- {
- static const unsigned int value = 0;
- };
-
- template <typename T>
- struct UnConst
- {
- typedef T Type;
- };
- template <typename T>
- struct UnConst<const T>
- {
- typedef T Type;
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSBounds3.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSBounds3.h
deleted file mode 100644
index fda4a6d4..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSBounds3.h
+++ /dev/null
@@ -1,443 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_BOUNDS3_H
-#define QT3DS_FOUNDATION_QT3DS_BOUNDS3_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSTransform.h"
-#include "foundation/Qt3DSMat33.h"
-#include "foundation/Qt3DSMat44.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-typedef QT3DSVec3 TNVBounds2BoxPoints[8];
-
-/**
-\brief Class representing 3D range or axis aligned bounding box.
-
-Stored as minimum and maximum extent corners. Alternate representation
-would be center and dimensions.
-May be empty or nonempty. If not empty, minimum <= maximum has to hold.
-*/
-class NVBounds3
-{
-public:
- /**
- \brief Default constructor, not performing any initialization for performance reason.
- \remark Use empty() function below to construct empty bounds.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3() {}
-
- /**
- \brief Construct from two bounding points
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3(const QT3DSVec3 &minimum, const QT3DSVec3 &maximum);
-
- /**
- \brief Return empty bounds.
- */
- static QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3 empty();
-
- /**
- \brief returns the AABB containing v0 and v1.
- \param v0 first point included in the AABB.
- \param v1 second point included in the AABB.
- */
- static QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3 boundsOfPoints(const QT3DSVec3 &v0,
- const QT3DSVec3 &v1);
-
- /**
- \brief returns the AABB from center and extents vectors.
- \param center Center vector
- \param extent Extents vector
- */
- static QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3 centerExtents(const QT3DSVec3 &center,
- const QT3DSVec3 &extent);
-
- /**
- \brief Construct from center, extent, and (not necessarily orthogonal) basis
- */
- static QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 basisExtent(const QT3DSVec3 &center,
- const QT3DSMat33 &basis,
- const QT3DSVec3 &extent);
-
- /**
- \brief Construct from pose and extent
- */
- static QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 poseExtent(const NVTransform &pose,
- const QT3DSVec3 &extent);
-
- /**
- \brief gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
- \param[in] matrix Transform to apply, can contain scaling as well
- \param[in] bounds The bounds to transform.
- */
- static QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 transform(const QT3DSMat33 &matrix,
- const NVBounds3 &bounds);
-
- /**
- \brief gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
- \param[in] transform Transform to apply, can contain scaling as well
- \param[in] bounds The bounds to transform.
- */
- static QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 transform(const NVTransform &transform,
- const NVBounds3 &bounds);
-
- /**
- \brief Sets empty to true
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void setEmpty();
-
- /**
- \brief Sets infinite bounds
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void setInfinite();
-
- /**
- \brief expands the volume to include v
- \param v Point to expand to.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void include(const QT3DSVec3 &v);
-
- /**
- \brief expands the volume to include b.
- \param b Bounds to perform union with.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void include(const NVBounds3 &b);
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isEmpty() const;
-
- /**
- \brief indicates whether the intersection of this and b is empty or not.
- \param b Bounds to test for intersection.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool intersects(const NVBounds3 &b) const;
-
- /**
- \brief computes the 1D-intersection between two AABBs, on a given axis.
- \param a the other AABB
- \param axis the axis (0, 1, 2)
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool intersects1D(const NVBounds3 &a, QT3DSU32 axis) const;
-
- /**
- \brief indicates if these bounds contain v.
- \param v Point to test against bounds.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool contains(const QT3DSVec3 &v) const;
-
- /**
- \brief checks a box is inside another box.
- \param box the other AABB
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isInside(const NVBounds3 &box) const;
-
- /**
- \brief returns the center of this axis aligned box.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getCenter() const;
-
- /**
- \brief get component of the box's center along a given axis
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float getCenter(QT3DSU32 axis) const;
-
- /**
- \brief get component of the box's extents along a given axis
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float getExtents(QT3DSU32 axis) const;
-
- /**
- \brief returns the dimensions (width/height/depth) of this axis aligned box.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getDimensions() const;
-
- /**
- \brief returns the extents, which are half of the width/height/depth.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getExtents() const;
-
- /**
- \brief scales the AABB.
- \param scale Factor to scale AABB by.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void scale(QT3DSF32 scale);
-
- /**
- fattens the AABB in all 3 dimensions by the given distance.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void fatten(NVReal distance);
-
- /**
- checks that the AABB values are not NaN
- */
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isFinite() const;
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void expand(TNVBounds2BoxPoints &outPoints) const;
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void transform(const QT3DSMat44 &inMatrix);
-
- QT3DSVec3 minimum, maximum;
-};
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3::NVBounds3(const QT3DSVec3 &minimum, const QT3DSVec3 &maximum)
- : minimum(minimum)
- , maximum(maximum)
-{
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3 NVBounds3::empty()
-{
- return NVBounds3(QT3DSVec3(QT3DS_MAX_REAL), QT3DSVec3(-QT3DS_MAX_REAL));
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVBounds3::isFinite() const
-{
- return minimum.isFinite() && maximum.isFinite();
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3 NVBounds3::boundsOfPoints(const QT3DSVec3 &v0,
- const QT3DSVec3 &v1)
-{
- return NVBounds3(v0.minimum(v1), v0.maximum(v1));
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVBounds3 NVBounds3::centerExtents(const QT3DSVec3 &center,
- const QT3DSVec3 &extent)
-{
- return NVBounds3(center - extent, center + extent);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 NVBounds3::basisExtent(const QT3DSVec3 &center,
- const QT3DSMat33 &basis,
- const QT3DSVec3 &extent)
-{
- // extended basis vectors
- QT3DSVec3 c0 = basis.column0 * extent.x;
- QT3DSVec3 c1 = basis.column1 * extent.y;
- QT3DSVec3 c2 = basis.column2 * extent.z;
-
- QT3DSVec3 w;
- // find combination of base vectors that produces max. distance for each component = sum of
- // abs()
- w.x = NVAbs(c0.x) + NVAbs(c1.x) + NVAbs(c2.x);
- w.y = NVAbs(c0.y) + NVAbs(c1.y) + NVAbs(c2.y);
- w.z = NVAbs(c0.z) + NVAbs(c1.z) + NVAbs(c2.z);
-
- return NVBounds3(center - w, center + w);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 NVBounds3::poseExtent(const NVTransform &pose,
- const QT3DSVec3 &extent)
-{
- return basisExtent(pose.p, QT3DSMat33(pose.q), extent);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::setEmpty()
-{
- minimum = QT3DSVec3(QT3DS_MAX_REAL);
- maximum = QT3DSVec3(-QT3DS_MAX_REAL);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::setInfinite()
-{
- minimum = QT3DSVec3(-QT3DS_MAX_REAL);
- maximum = QT3DSVec3(QT3DS_MAX_REAL);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::include(const QT3DSVec3 &v)
-{
- QT3DS_ASSERT(isFinite());
- minimum = minimum.minimum(v);
- maximum = maximum.maximum(v);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::include(const NVBounds3 &b)
-{
- QT3DS_ASSERT(isFinite());
- minimum = minimum.minimum(b.minimum);
- maximum = maximum.maximum(b.maximum);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVBounds3::isEmpty() const
-{
- QT3DS_ASSERT(isFinite());
- // Consistency condition for (Min, Max) boxes: minimum < maximum
- return minimum.x > maximum.x || minimum.y > maximum.y || minimum.z > maximum.z;
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVBounds3::intersects(const NVBounds3 &b) const
-{
- QT3DS_ASSERT(isFinite() && b.isFinite());
- return !(b.minimum.x > maximum.x || minimum.x > b.maximum.x || b.minimum.y > maximum.y
- || minimum.y > b.maximum.y || b.minimum.z > maximum.z || minimum.z > b.maximum.z);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVBounds3::intersects1D(const NVBounds3 &a, QT3DSU32 axis) const
-{
- QT3DS_ASSERT(isFinite() && a.isFinite());
- return maximum[axis] >= a.minimum[axis] && a.maximum[axis] >= minimum[axis];
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVBounds3::contains(const QT3DSVec3 &v) const
-{
- QT3DS_ASSERT(isFinite());
-
- return !(v.x < minimum.x || v.x > maximum.x || v.y < minimum.y || v.y > maximum.y
- || v.z < minimum.z || v.z > maximum.z);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVBounds3::isInside(const NVBounds3 &box) const
-{
- QT3DS_ASSERT(isFinite() && box.isFinite());
- if (box.minimum.x > minimum.x)
- return false;
- if (box.minimum.y > minimum.y)
- return false;
- if (box.minimum.z > minimum.z)
- return false;
- if (box.maximum.x < maximum.x)
- return false;
- if (box.maximum.y < maximum.y)
- return false;
- if (box.maximum.z < maximum.z)
- return false;
- return true;
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 NVBounds3::getCenter() const
-{
- QT3DS_ASSERT(isFinite());
- return (minimum + maximum) * NVReal(0.5);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float NVBounds3::getCenter(QT3DSU32 axis) const
-{
- QT3DS_ASSERT(isFinite());
- return (minimum[axis] + maximum[axis]) * NVReal(0.5);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float NVBounds3::getExtents(QT3DSU32 axis) const
-{
- QT3DS_ASSERT(isFinite());
- return (maximum[axis] - minimum[axis]) * NVReal(0.5);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 NVBounds3::getDimensions() const
-{
- QT3DS_ASSERT(isFinite());
- return maximum - minimum;
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 NVBounds3::getExtents() const
-{
- QT3DS_ASSERT(isFinite());
- return getDimensions() * NVReal(0.5);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::scale(QT3DSF32 scale)
-{
- QT3DS_ASSERT(isFinite());
- *this = centerExtents(getCenter(), getExtents() * scale);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::fatten(NVReal distance)
-{
- QT3DS_ASSERT(isFinite());
- minimum.x -= distance;
- minimum.y -= distance;
- minimum.z -= distance;
-
- maximum.x += distance;
- maximum.y += distance;
- maximum.z += distance;
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 NVBounds3::transform(const QT3DSMat33 &matrix,
- const NVBounds3 &bounds)
-{
- QT3DS_ASSERT(bounds.isFinite());
- return bounds.isEmpty() ? bounds : NVBounds3::basisExtent(matrix * bounds.getCenter(), matrix,
- bounds.getExtents());
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_INLINE NVBounds3 NVBounds3::transform(const NVTransform &transform,
- const NVBounds3 &bounds)
-{
- QT3DS_ASSERT(bounds.isFinite());
- return bounds.isEmpty() ? bounds
- : NVBounds3::basisExtent(transform.transform(bounds.getCenter()),
- QT3DSMat33(transform.q), bounds.getExtents());
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::expand(TNVBounds2BoxPoints &outPoints) const
-{
- if (isEmpty()) {
- for (QT3DSU32 idx = 0; idx < 8; ++idx)
- outPoints[idx] = QT3DSVec3(0, 0, 0);
- } else {
- // Min corner of box
- outPoints[0] = QT3DSVec3(minimum[0], minimum[1], minimum[2]);
- outPoints[1] = QT3DSVec3(maximum[0], minimum[1], minimum[2]);
- outPoints[2] = QT3DSVec3(minimum[0], maximum[1], minimum[2]);
- outPoints[3] = QT3DSVec3(minimum[0], minimum[1], maximum[2]);
-
- // Max corner of box
- outPoints[4] = QT3DSVec3(maximum[0], maximum[1], maximum[2]);
- outPoints[5] = QT3DSVec3(minimum[0], maximum[1], maximum[2]);
- outPoints[6] = QT3DSVec3(maximum[0], minimum[1], maximum[2]);
- outPoints[7] = QT3DSVec3(maximum[0], maximum[1], minimum[2]);
- }
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void NVBounds3::transform(const QT3DSMat44 &inMatrix)
-{
- if (!isEmpty()) {
- TNVBounds2BoxPoints thePoints;
- expand(thePoints);
- setEmpty();
- for (QT3DSU32 idx = 0; idx < 8; ++idx)
- include(inMatrix.transform(thePoints[idx]));
- }
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_BOUNDS3_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSBroadcastingAllocator.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSBroadcastingAllocator.h
deleted file mode 100644
index dc6ae7b5..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSBroadcastingAllocator.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_BROADCASTING_ALLOCATOR_H
-#define QT3DS_FOUNDATION_QT3DS_BROADCASTING_ALLOCATOR_H
-
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-/** \addtogroup foundation
- @{
-*/
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/**
-\brief Abstract listener class that listens to allocation and deallocation events from the
- foundation memory system.
-
-<b>Threading:</b> All methods of this class should be thread safe as it can be called from the user
-thread
-or the physics processing thread(s).
-*/
-class NVAllocationListener
-{
-protected:
- virtual ~NVAllocationListener() {}
-
-public:
- /**
- \brief callback when memory is allocated.
- \param size Size of the allocation in bytes.
- \param typeName Type this data is being allocated for.
- \param filename File the allocation came from.
- \param line the allocation came from.
- \param allocatedMemory memory that will be returned from the allocation.
- */
- virtual void onAllocation(size_t size, const char *typeName, const char *filename, int line,
- void *allocatedMemory) = 0;
-
- /**
- /brief callback when memory is deallocated.
- /param allocatedMemory memory just before allocation.
- */
- virtual void onDeallocation(void *allocatedMemory) = 0;
-};
-
-/**
-\brief Abstract base class for an application defined memory allocator that allows an external
-listener
-to audit the memory allocations.
-
-<b>Threading:</b> Register/deregister are *not* threadsafe!!!
-You need to be sure multiple threads are using this allocator when you are adding
-new listeners.
-*/
-class NVBroadcastingAllocator : public NVAllocatorCallback
-{
-protected:
- virtual ~NVBroadcastingAllocator() {}
-
-public:
- /**
- \brief Register an allocation listener. This object will be notified whenever an
- allocation happens.
-
- <b>Threading:</b>Not threadsafe if you are allocating and deallocating in another
- thread using this allocator.
- */
- virtual void registerAllocationListener(NVAllocationListener &inListener) = 0;
- /**
- \brief Deregister an allocation listener. This object will no longer receive
- notifications upon allocation.
-
- <b>Threading:</b>Not threadsafe if you are allocating and deallocating in another
- thread using this allocator.
- */
- virtual void deregisterAllocationListener(NVAllocationListener &inListener) = 0;
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_BROADCASTING_ALLOCATOR_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSContainers.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSContainers.h
deleted file mode 100644
index de86d856..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSContainers.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_CONTAINERS_H
-#define QT3DS_CONTAINERS_H
-#include "foundation/Qt3DS.h"
-#include "EASTL/vector.h"
-#include "EASTL/hash_map.h"
-#include "EASTL/hash_set.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename T>
- class nvvector : public eastl::vector<T, ForwardingAllocator>
- {
- typedef eastl::vector<T, ForwardingAllocator> base_type;
-
- public:
- using base_type::data;
- using base_type::size;
-
- nvvector(NVAllocatorCallback &inAllocator, const char *inTypeName)
- : eastl::vector<T, ForwardingAllocator>(ForwardingAllocator(inAllocator, inTypeName))
- {
- }
- nvvector(const nvvector<T> &inOther)
- : eastl::vector<T, ForwardingAllocator>(inOther)
- {
- }
- nvvector<T> &operator=(const nvvector<T> &inOther)
- {
- eastl::vector<T, ForwardingAllocator>::operator=(inOther);
- return *this;
- }
- operator NVConstDataRef<T>() const { return NVConstDataRef<T>(data(), size()); }
- operator NVDataRef<T>() { return NVDataRef<T>(data(), size()); }
- };
-
- template <typename TKey, typename TValue, typename THash = eastl::hash<TKey>,
- typename TPredicate = eastl::equal_to<TKey>>
- class nvhash_map : public eastl::hash_map<TKey, TValue, THash, TPredicate, ForwardingAllocator>
- {
- typedef eastl::hash_map<TKey, TValue, THash, TPredicate, ForwardingAllocator> base_type;
-
- public:
- using base_type::find;
- using base_type::end;
-
- nvhash_map(NVAllocatorCallback &inAllocator, const char *inTypeName)
- : eastl::hash_map<TKey, TValue, THash, TPredicate, ForwardingAllocator>(
- ForwardingAllocator(inAllocator, inTypeName))
- {
- }
- nvhash_map(const nvhash_map<TKey, TValue, THash, TPredicate> &inOther)
- : eastl::hash_map<TKey, TValue, THash, TPredicate, ForwardingAllocator>(inOther)
- {
- }
- nvhash_map<TKey, TValue, THash, TPredicate> &
- operator=(const nvhash_map<TKey, TValue, THash, TPredicate> &inOther)
- {
- eastl::hash_map<TKey, TValue, THash, TPredicate, ForwardingAllocator>::operator=(
- inOther);
- return *this;
- }
- bool contains(const TKey &inKey) const { return find(inKey) != end(); }
- };
-
- template <typename TKey, typename THash = eastl::hash<TKey>,
- typename TPredicate = eastl::equal_to<TKey>>
- class nvhash_set : public eastl::hash_set<TKey, THash, TPredicate, ForwardingAllocator>
- {
- typedef eastl::hash_set<TKey, THash, TPredicate, ForwardingAllocator> base_type;
-
- public:
- using base_type::find;
- using base_type::end;
-
- nvhash_set(NVAllocatorCallback &inAllocator, const char *inTypeName)
- : eastl::hash_set<TKey, THash, TPredicate, ForwardingAllocator>(
- ForwardingAllocator(inAllocator, inTypeName))
- {
- }
- nvhash_set(const nvhash_map<TKey, THash, TPredicate> &inOther)
- : eastl::hash_set<TKey, THash, TPredicate, ForwardingAllocator>(inOther)
- {
- }
- nvhash_set<TKey, THash, TPredicate> &
- operator=(const nvhash_set<TKey, THash, TPredicate> &inOther)
- {
- eastl::hash_set<TKey, THash, TPredicate, ForwardingAllocator>::operator=(inOther);
- return *this;
- }
- bool contains(const TKey &inKey) const { return find(inKey) != end(); }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSDataRef.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSDataRef.h
deleted file mode 100644
index ad860cef..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSDataRef.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_DATA_REF_H
-#define QT3DS_FOUNDATION_DATA_REF_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename TDataType>
- struct NVConstDataRef
- {
- const TDataType *mData;
- QT3DSU32 mSize;
-
- NVConstDataRef(const TDataType *inData, QT3DSU32 inSize)
- : mData(inData)
- , mSize(inSize)
- {
- }
- NVConstDataRef()
- : mData(0)
- , mSize(0)
- {
- }
-
- QT3DSU32 size() const { return mSize; }
-
- const TDataType *begin() const { return mData; }
- const TDataType *end() const { return mData + mSize; }
-
- const TDataType &operator[](QT3DSU32 index) const
- {
- QT3DS_ASSERT(index < mSize);
- return mData[index];
- }
- };
-
- template <typename TDataType>
- inline NVConstDataRef<TDataType> toConstDataRef(const TDataType &type)
- {
- return NVConstDataRef<TDataType>(&type, 1);
- }
-
- template <typename TDataType>
- inline NVConstDataRef<QT3DSU8> toU8ConstDataRef(const TDataType &type)
- {
- return NVConstDataRef<QT3DSU8>(reinterpret_cast<const QT3DSU8 *>(&type), sizeof(TDataType));
- }
-
- template <typename TDataType>
- inline NVConstDataRef<TDataType> toConstDataRef(const TDataType *type, QT3DSU32 count)
- {
- return NVConstDataRef<TDataType>(type, count);
- }
-
- template <typename TDataType>
- inline NVConstDataRef<QT3DSU8> toU8ConstDataRef(const TDataType *type, QT3DSU32 count)
- {
- return NVConstDataRef<QT3DSU8>(reinterpret_cast<const QT3DSU8 *>(type),
- sizeof(TDataType) * count);
- }
-
- template <typename TDataType>
- struct NVDataRef
- {
- TDataType *mData;
- QT3DSU32 mSize;
-
- NVDataRef(TDataType *inData, QT3DSU32 inSize)
- : mData(inData)
- , mSize(inSize)
- {
- }
- NVDataRef()
- : mData(0)
- , mSize(0)
- {
- }
- QT3DSU32 size() const { return mSize; }
-
- TDataType *begin() { return mData; }
- TDataType *end() { return mData + mSize; }
-
- TDataType *begin() const { return mData; }
- TDataType *end() const { return mData + mSize; }
-
- TDataType &operator[](QT3DSU32 index)
- {
- QT3DS_ASSERT(index < mSize);
- return mData[index];
- }
-
- const TDataType &operator[](QT3DSU32 index) const
- {
- QT3DS_ASSERT(index < mSize);
- return mData[index];
- }
-
- operator NVConstDataRef<TDataType>() const
- {
- return NVConstDataRef<TDataType>(mData, mSize);
- }
- };
-
- template <typename TDataType>
- inline NVDataRef<TDataType> toDataRef(TDataType &type)
- {
- return NVDataRef<TDataType>(&type, 1);
- }
-
- template <typename TDataType>
- inline NVDataRef<QT3DSU8> toU8DataRef(TDataType &type)
- {
- return NVDataRef<QT3DSU8>(reinterpret_cast<QT3DSU8 *>(&type), sizeof(TDataType));
- }
-
- template <typename TDataType>
- inline NVDataRef<TDataType> toDataRef(TDataType *type, QT3DSU32 count)
- {
- return NVDataRef<TDataType>(type, count);
- }
-
- template <typename TDataType>
- inline NVDataRef<QT3DSU8> toU8DataRef(TDataType *type, QT3DSU32 count)
- {
- return NVDataRef<QT3DSU8>(reinterpret_cast<QT3DSU8 *>(type), sizeof(TDataType) * count);
- }
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSDiscriminatedUnion.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSDiscriminatedUnion.h
deleted file mode 100644
index 1957eb23..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSDiscriminatedUnion.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_DISCRIMINATED_UNION_H
-#define QT3DS_FOUNDATION_DISCRIMINATED_UNION_H
-#include "Qt3DSAssert.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSUnionCast.h"
-
-#ifdef WIN32
-#pragma warning(disable : 4100)
-#endif
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename TUnionTraits, int TBufferSize>
- class DiscriminatedUnion
- {
- public:
- typedef DiscriminatedUnion<TUnionTraits, TBufferSize> TThisType;
- typedef TUnionTraits TTraits;
- typedef typename TTraits::TIdType TIdType;
-
- protected:
- char m_Data[TBufferSize];
- // Id type must include a no-data type.
- TIdType m_DataType;
-
- public:
- DiscriminatedUnion() { TTraits::defaultConstruct(m_Data, m_DataType); }
-
- DiscriminatedUnion(const TThisType &inOther)
- : m_DataType(inOther.m_DataType)
- {
- TTraits::copyConstruct(m_Data, inOther.m_Data, m_DataType);
- }
-
- template <typename TDataType>
- DiscriminatedUnion(const TDataType &inType)
- {
- TTraits::copyConstruct(m_Data, m_DataType, inType);
- }
-
- ~DiscriminatedUnion() { TTraits::destruct(m_Data, m_DataType); }
-
- TThisType &operator=(const TThisType &inType)
- {
- if (this != &inType) {
- TTraits::destruct(m_Data, m_DataType);
- m_DataType = inType.m_DataType;
- TTraits::copyConstruct(m_Data, inType.m_Data, inType.m_DataType);
- }
- return *this;
- }
-
- typename TTraits::TIdType getType() const { return m_DataType; }
-
- template <typename TDataType>
- const TDataType *getDataPtr() const
- {
- return TTraits::template getDataPtr<TDataType>(m_Data, m_DataType);
- }
-
- template <typename TDataType>
- TDataType *getDataPtr()
- {
- return TTraits::template getDataPtr<TDataType>(m_Data, m_DataType);
- }
-
- template <typename TDataType>
- TDataType getData() const
- {
- const TDataType *dataPtr = getDataPtr<TDataType>();
- if (dataPtr)
- return *dataPtr;
- QT3DS_ASSERT(false);
- return TDataType();
- }
-
- bool operator==(const TThisType &inOther) const
- {
- return m_DataType == inOther.m_DataType
- && TTraits::areEqual(m_Data, inOther.m_Data, m_DataType);
- }
-
- bool operator!=(const TThisType &inOther) const
- {
- return m_DataType != inOther.m_DataType
- || TTraits::areEqual(m_Data, inOther.m_Data, m_DataType) == false;
- }
-
- template <typename TRetType, typename TVisitorType>
- TRetType visit(TVisitorType inVisitor)
- {
- return TTraits::template visit<TRetType>(m_Data, m_DataType, inVisitor);
- }
-
- template <typename TRetType, typename TVisitorType>
- TRetType visit(TVisitorType inVisitor) const
- {
- return TTraits::template visit<TRetType>(m_Data, m_DataType, inVisitor);
- }
- };
-
- // Helper system to enable quicker and correct construction of union traits types
-
- struct CopyConstructVisitor
- {
- const char *m_Src;
- CopyConstructVisitor(const char *inSrc)
- : m_Src(inSrc)
- {
- }
-
- template <typename TDataType>
- void operator()(TDataType &inDst)
- {
- new (&inDst) TDataType(*NVUnionCast<const TDataType *>(m_Src));
- }
- void operator()() { QT3DS_ASSERT(false); }
- };
-
- template <typename TDataType>
- struct DestructTraits
- {
- void destruct(TDataType &inType) { inType.~TDataType(); }
- };
-
- // Until compilers improve a bit, you need this for POD types else you get
- // unused parameter warnings.
- template <>
- struct DestructTraits<QT3DSU8>
- {
- void destruct(QT3DSU8 &) {}
- };
- template <>
- struct DestructTraits<QT3DSI8>
- {
- void destruct(QT3DSI8 &) {}
- };
- template <>
- struct DestructTraits<QT3DSU16>
- {
- void destruct(QT3DSU16 &) {}
- };
- template <>
- struct DestructTraits<QT3DSI16>
- {
- void destruct(QT3DSI16 &) {}
- };
- template <>
- struct DestructTraits<QT3DSU32>
- {
- void destruct(QT3DSU32 &) {}
- };
- template <>
- struct DestructTraits<QT3DSI32>
- {
- void destruct(QT3DSI32 &) {}
- };
- template <>
- struct DestructTraits<QT3DSU64>
- {
- void destruct(QT3DSU64 &) {}
- };
- template <>
- struct DestructTraits<QT3DSI64>
- {
- void destruct(QT3DSI64 &) {}
- };
- template <>
- struct DestructTraits<QT3DSF32>
- {
- void destruct(QT3DSF32 &) {}
- };
- template <>
- struct DestructTraits<QT3DSF64>
- {
- void destruct(QT3DSF64 &) {}
- };
- template <>
- struct DestructTraits<bool>
- {
- void destruct(bool &) {}
- };
- template <>
- struct DestructTraits<void *>
- {
- void destruct(void *&) {}
- };
-#ifdef __INTEGRITY
- template <>
- struct DestructTraits<QT3DSVec2>
- {
- void destruct(QT3DSVec2 &) {}
- };
- template <>
- struct DestructTraits<QT3DSVec3>
- {
- void destruct(QT3DSVec3 &) {}
- };
-#endif
-
- struct DestructVisitor
- {
- template <typename TDataType>
- void operator()(TDataType &inDst)
- {
- DestructTraits<TDataType>().destruct(inDst);
- }
- void operator()() { QT3DS_ASSERT(false); }
- };
-
- template <typename TDataType>
- struct EqualVisitorTraits
- {
- bool operator()(const TDataType &lhs, const TDataType &rhs) { return lhs == rhs; }
- };
-
- struct EqualVisitor
- {
- const char *m_Rhs;
- EqualVisitor(const char *rhs)
- : m_Rhs(rhs)
- {
- }
- template <typename TDataType>
- bool operator()(const TDataType &lhs)
- {
- const TDataType &rhs(*NVUnionCast<const TDataType *>(m_Rhs));
- return EqualVisitorTraits<TDataType>()(lhs, rhs);
- }
- bool operator()()
- {
- QT3DS_ASSERT(false);
- return true;
- }
- };
-
- template <typename TBase, QT3DSU32 TBufferSize>
- struct DiscriminatedUnionGenericBase : public TBase
- {
- typedef typename TBase::TIdType TIdType;
-
- static void zeroBuf(char *outDst) { qt3ds::intrinsics::memZero(outDst, TBufferSize); }
-
- static void defaultConstruct(char *outDst, TIdType &outType)
- {
- zeroBuf(outDst);
- outType = TBase::getNoDataId();
- }
-
- template <typename TDataType>
- static void copyConstruct(char *outDst, TIdType &outType, const TDataType &inSrc)
- {
- zeroBuf(outDst);
- StaticAssert<sizeof(TDataType) <= TBufferSize>::valid_expression();
- outType = TBase::template getType<TDataType>();
- new (outDst) TDataType(inSrc);
- }
-
- static void copyConstruct(char *inDst, const char *inSrc, TIdType inType)
- {
- if (inType == TBase::getNoDataId())
- zeroBuf(inDst);
- else
- TBase::template visit<void>(inDst, inType, CopyConstructVisitor(inSrc));
- }
-
- static void destruct(char *inDst, TIdType inType)
- {
- if (inType != TBase::getNoDataId())
- TBase::template visit<void>(inDst, inType, DestructVisitor());
- zeroBuf(inDst);
- }
-
- template <typename TDataType>
- static const TDataType *getDataPtr(const char *inData, const TIdType &inType)
- {
- if (TBase::template getType<TDataType>() == inType)
- return NVUnionCast<const TDataType *>(inData);
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- template <typename TDataType>
- static TDataType *getDataPtr(char *inData, const TIdType &inType)
- {
- if (TBase::template getType<TDataType>() == inType)
- return NVUnionCast<TDataType *>(inData);
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- static bool areEqual(const char *inLhs, const char *inRhs, TIdType inType)
- {
- if (inType != TBase::getNoDataId())
- return TBase::template visit<bool>(inLhs, inType, EqualVisitor(inRhs));
- else
- return true;
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFPU.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSFPU.h
deleted file mode 100644
index e4a47f0c..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFPU.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSFPU_H
-#define QT3DS_FOUNDATION_PSFPU_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSUnionCast.h"
-
-// unsigned integer representation of a floating-point value.
-#ifdef QT3DS_PS3
-QT3DS_FORCE_INLINE unsigned int QT3DS_IR(const float x)
-{
- return qt3ds::NVUnionCast<unsigned int, float>(x);
-}
-#else
-#define QT3DS_IR(x) ((QT3DSU32 &)(x))
-#endif
-
-// signed integer representation of a floating-point value.
-#ifdef QT3DS_PS3
-QT3DS_FORCE_INLINE int QT3DS_SIR(const float x)
-{
- return qt3ds::NVUnionCast<int, float>(x);
-}
-#else
-#define QT3DS_SIR(x) ((QT3DSI32 &)(x))
-#endif
-
-// Floating-point representation of a integer value.
-#ifdef QT3DS_PS3
-QT3DS_FORCE_INLINE float QT3DS_FR(const unsigned int x)
-{
- return qt3ds::NVUnionCast<float, unsigned int>(x);
-}
-#else
-#define QT3DS_FR(x) ((QT3DSF32 &)(x))
-#endif
-
-#ifdef QT3DS_PS3
-QT3DS_FORCE_INLINE float *QT3DS_FPTR(unsigned int *x)
-{
- return qt3ds::NVUnionCast<float *, unsigned int *>(x);
-}
-
-QT3DS_FORCE_INLINE float *QT3DS_FPTR(int *x)
-{
- return qt3ds::NVUnionCast<float *, int *>(x);
-}
-#else
-#define QT3DS_FPTR(x) ((QT3DSF32 *)(x))
-#endif
-
-#define QT3DS_SIGN_BITMASK 0x80000000
-
-namespace qt3ds {
-namespace foundation {
-class QT3DS_FOUNDATION_API FPUGuard
-{
-public:
- FPUGuard(); // set fpu control word for PhysX
- ~FPUGuard(); // restore fpu control word
-private:
- QT3DSU32 mControlWords[8];
-};
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFastIPC.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSFastIPC.h
deleted file mode 100644
index 800c3dfd..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFastIPC.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FAST_IPC_H
-#define QT3DS_FAST_IPC_H
-
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSIPC.h"
-
-namespace qt3ds {
-namespace foundation {
-
- NVIPC *createFastIPC(
- NVIPC::ErrorCode &errorCode, // error code return if creation fails
- NVIPC::ConnectionType connectionType =
- NVIPC::CT_CLIENT_OR_SERVER, // how to establish the connection
- const char *mappingObject = "Global\\FastIPC", // Name of communications channel
- QT3DSU32 serverRingBufferSize = 1024 * 4, // buffer size for outgoing server messages.
- QT3DSU32 clientRingBufferSize = 1024 * 4, // buffer size for incoming client messages.
- bool allowLongMessages = true,
- bool bufferSends = false,
- QT3DSU32 maxBufferSendSize = 1024 * 8); // True if we want to buffer sends, if true, then
- // pumpSendBuffers should be called by the send thread.
-
- void releaseFastIPC(NVIPC *f);
-
-}; // end of namespace
-}; // end of namespace
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFlags.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSFlags.h
deleted file mode 100644
index 765f386f..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFlags.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_FLAGS_H
-#define QT3DS_FOUNDATION_QT3DS_FLAGS_H
-
-/** \addtogroup foundation
- @{
-*/
-
-#include "foundation/Qt3DS.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-/**
-\brief Container for bitfield flag variables associated with a specific enum type.
-
-This allows for type safe manipulation for bitfields.
-
-<h3>Example</h3>
- // enum that defines each bit...
- struct MyEnum
- {
- enum Enum
- {
- eMAN = 1,
- eBEAR = 2,
- ePIG = 4,
- };
- };
-
- // implements some convenient global operators.
- QT3DS_FLAGS_OPERATORS(MyEnum::Enum, QT3DSU8);
-
- NVFlags<MyEnum::Enum, QT3DSU8> myFlags;
- myFlags |= MyEnum::eMAN;
- myFlags |= MyEnum::eBEAR | MyEnum::ePIG;
- if(myFlags & MyEnum::eBEAR)
- {
- doSomething();
- }
-*/
-template <typename enumtype, typename storagetype = QT3DSU32>
-class NVFlags
-{
-public:
- QT3DS_INLINE explicit NVFlags(const NVEmpty &) {}
- QT3DS_INLINE NVFlags(void);
- QT3DS_INLINE NVFlags(enumtype e);
- QT3DS_INLINE NVFlags(const NVFlags<enumtype, storagetype> &f);
- QT3DS_INLINE explicit NVFlags(storagetype b);
-
- QT3DS_INLINE bool operator==(enumtype e) const;
- QT3DS_INLINE bool operator==(const NVFlags<enumtype, storagetype> &f) const;
- QT3DS_INLINE bool operator==(bool b) const;
- QT3DS_INLINE bool operator!=(enumtype e) const;
- QT3DS_INLINE bool operator!=(const NVFlags<enumtype, storagetype> &f) const;
-
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator=(enumtype e);
-
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator|=(enumtype e);
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator|=(const NVFlags<enumtype, storagetype> &f);
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator|(enumtype e) const;
- QT3DS_INLINE NVFlags<enumtype, storagetype>
- operator|(const NVFlags<enumtype, storagetype> &f) const;
-
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator&=(enumtype e);
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator&=(const NVFlags<enumtype, storagetype> &f);
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator&(enumtype e) const;
- QT3DS_INLINE NVFlags<enumtype, storagetype>
- operator&(const NVFlags<enumtype, storagetype> &f) const;
-
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator^=(enumtype e);
- QT3DS_INLINE NVFlags<enumtype, storagetype> &operator^=(const NVFlags<enumtype, storagetype> &f);
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator^(enumtype e) const;
- QT3DS_INLINE NVFlags<enumtype, storagetype>
- operator^(const NVFlags<enumtype, storagetype> &f) const;
-
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator~(void)const;
-
- QT3DS_INLINE operator bool(void) const;
- QT3DS_INLINE operator QT3DSU8(void) const;
- QT3DS_INLINE operator QT3DSU16(void) const;
- QT3DS_INLINE operator QT3DSU32(void) const;
-
- QT3DS_INLINE void clear(enumtype e);
-
- QT3DS_INLINE void clearOrSet(bool value, enumtype enumVal);
-
-public:
- friend QT3DS_INLINE NVFlags<enumtype, storagetype> operator&(enumtype a,
- NVFlags<enumtype, storagetype> &b)
- {
- NVFlags<enumtype, storagetype> out;
- out.mBits = a & b.mBits;
- return out;
- }
-
-private:
- storagetype mBits;
-};
-
-#define QT3DS_FLAGS_OPERATORS(enumtype, storagetype) \
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator|(enumtype a, enumtype b) \
-{ \
- NVFlags<enumtype, storagetype> r(a); \
- r |= b; \
- return r; \
-} \
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator&(enumtype a, enumtype b) \
-{ \
- NVFlags<enumtype, storagetype> r(a); \
- r &= b; \
- return r; \
-} \
- QT3DS_INLINE NVFlags<enumtype, storagetype> operator~(enumtype a) \
-{ \
- return ~NVFlags<enumtype, storagetype>(a); \
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::NVFlags(void)
-{
- mBits = 0;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::NVFlags(enumtype e)
-{
- mBits = static_cast<storagetype>(e);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::NVFlags(const NVFlags<enumtype, storagetype> &f)
-{
- mBits = f.mBits;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::NVFlags(storagetype b)
-{
- mBits = b;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE bool NVFlags<enumtype, storagetype>::operator==(enumtype e) const
-{
- return mBits == static_cast<storagetype>(e);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE bool NVFlags<enumtype, storagetype>::
-operator==(const NVFlags<enumtype, storagetype> &f) const
-{
- return mBits == f.mBits;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE bool NVFlags<enumtype, storagetype>::operator==(bool b) const
-{
- return ((bool)*this) == b;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE bool NVFlags<enumtype, storagetype>::operator!=(enumtype e) const
-{
- return mBits != static_cast<storagetype>(e);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE bool NVFlags<enumtype, storagetype>::
-operator!=(const NVFlags<enumtype, storagetype> &f) const
-{
- return mBits != f.mBits;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::operator=(enumtype e)
-{
- mBits = static_cast<storagetype>(e);
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::operator|=(enumtype e)
-{
- mBits |= static_cast<storagetype>(e);
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::
-operator|=(const NVFlags<enumtype, storagetype> &f)
-{
- mBits |= f.mBits;
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::operator|(enumtype e) const
-{
- NVFlags<enumtype, storagetype> out(*this);
- out |= e;
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::
-operator|(const NVFlags<enumtype, storagetype> &f) const
-{
- NVFlags<enumtype, storagetype> out(*this);
- out |= f;
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::operator&=(enumtype e)
-{
- mBits &= static_cast<storagetype>(e);
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::
-operator&=(const NVFlags<enumtype, storagetype> &f)
-{
- mBits &= f.mBits;
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::operator&(enumtype e) const
-{
- NVFlags<enumtype, storagetype> out = *this;
- out.mBits &= static_cast<storagetype>(e);
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::
-operator&(const NVFlags<enumtype, storagetype> &f) const
-{
- NVFlags<enumtype, storagetype> out = *this;
- out.mBits &= f.mBits;
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::operator^=(enumtype e)
-{
- mBits ^= static_cast<storagetype>(e);
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> &NVFlags<enumtype, storagetype>::
-operator^=(const NVFlags<enumtype, storagetype> &f)
-{
- mBits ^= f.mBits;
- return *this;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::operator^(enumtype e) const
-{
- NVFlags<enumtype, storagetype> out = *this;
- out.mBits ^= static_cast<storagetype>(e);
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::
-operator^(const NVFlags<enumtype, storagetype> &f) const
-{
- NVFlags<enumtype, storagetype> out = *this;
- out.mBits ^= f.mBits;
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype> NVFlags<enumtype, storagetype>::operator~(void)const
-{
- NVFlags<enumtype, storagetype> out;
- out.mBits = ~mBits;
- return out;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::operator bool(void) const
-{
- return mBits ? true : false;
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::operator QT3DSU8(void) const
-{
- return static_cast<QT3DSU8>(mBits);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::operator QT3DSU16(void) const
-{
- return static_cast<QT3DSU16>(mBits);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE NVFlags<enumtype, storagetype>::operator QT3DSU32(void) const
-{
- return static_cast<QT3DSU32>(mBits);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE void NVFlags<enumtype, storagetype>::clear(enumtype e)
-{
- mBits &= ~static_cast<storagetype>(e);
-}
-
-template <typename enumtype, typename storagetype>
-QT3DS_INLINE void NVFlags<enumtype, storagetype>::clearOrSet(bool value, enumtype enumVal)
-{
- if (value)
- this->operator|=(enumVal);
- else
- clear(enumVal);
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // #ifndef QT3DS_FOUNDATION_QT3DS_FLAGS_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.cpp b/src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.cpp
deleted file mode 100644
index 8687cd69..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSFoundation.h"
-
-#include "foundation/Qt3DSQuat.h"
-#include "foundation/Qt3DSThread.h"
-#include "foundation/Qt3DSUtilities.h"
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSLogging.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "EASTL/hash_map.h"
-
-#include <stdio.h>
-#ifdef _WIN32
-#pragma warning(disable : 4996) // intentionally suppressing this warning message
-#endif
-namespace qt3ds {
-namespace foundation {
- using namespace intrinsics;
- union TempAllocatorChunk;
-
- class NVAllocatorListenerManager;
-
- class QT3DS_FOUNDATION_API Foundation : public NVFoundation
- {
-
- Foundation(NVAllocatorCallback &alloc);
- ~Foundation();
-
- public:
- void addRef() override;
- void release() override;
-
- // factory
- static Foundation *createInstance(QT3DSU32 version, NVAllocatorCallback &alloc);
-
- NVBroadcastingAllocator &getAllocator() const override { return mAllocator; }
- NVAllocatorCallback &getAllocatorCallback() const override;
- NVAllocatorCallback &getCheckedAllocator() { return mAllocator; }
-
- private:
- class AlignCheckAllocator : public NVBroadcastingAllocator
- {
- static const QT3DSU32 MaxListenerCount = 5;
-
- public:
- AlignCheckAllocator(NVAllocatorCallback &originalAllocator)
- : mAllocator(originalAllocator)
- , mListenerCount(0)
- {
- }
-
- void deallocate(void *ptr) override
- {
- // So here, for performance reasons I don't grab the mutex.
- // The listener array is very rarely changing; for most situations
- // only at startup. So it is unlikely that using the mutex
- // will help a lot but it could have serious perf implications.
- QT3DSU32 theCount = mListenerCount;
- for (QT3DSU32 idx = 0; idx < theCount; ++idx)
- mListeners[idx]->onDeallocation(ptr);
- mAllocator.deallocate(ptr);
- }
- void *allocate(size_t size, const char *typeName, const char *filename, int line,
- int flags) override;
- void *allocate(size_t size, const char *typeName, const char *filename, int line,
- size_t alignment, size_t alignmentOffset) override;
- NVAllocatorCallback &getBaseAllocator() const { return mAllocator; }
- void registerAllocationListener(NVAllocationListener &inListener) override
- {
- QT3DS_ASSERT(mListenerCount < MaxListenerCount);
- if (mListenerCount < MaxListenerCount) {
- mListeners[mListenerCount] = &inListener;
- ++mListenerCount;
- }
- }
- void deregisterAllocationListener(NVAllocationListener &inListener) override
- {
- for (QT3DSU32 idx = 0; idx < mListenerCount; ++idx) {
- if (mListeners[idx] == &inListener) {
- mListeners[idx] = mListeners[mListenerCount - 1];
- --mListenerCount;
- break;
- }
- }
- }
-
- private:
- NVAllocatorCallback &mAllocator;
- // I am not sure about using a NVArray here.
- // For now, this is fine.
- NVAllocationListener *mListeners[MaxListenerCount];
- volatile QT3DSU32 mListenerCount;
- };
-
- mutable AlignCheckAllocator mAllocator;
- QT3DSU32 mRefCount;
- Mutex mRefCountMutex;
- };
-
- Foundation::Foundation(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- , mRefCount(0)
- , mRefCountMutex(alloc)
-
- {
- }
-
- Foundation::~Foundation() {}
-
- NVAllocatorCallback &Foundation::getAllocatorCallback() const
- {
- return mAllocator.getBaseAllocator();
- }
-
- Foundation *Foundation::createInstance(QT3DSU32 version, NVAllocatorCallback &alloc)
- {
- if (version != QT3DS_FOUNDATION_VERSION) {
- qCCritical(INVALID_PARAMETER, "Wrong version: foundation version is %d, tried to create %d",
- QT3DS_FOUNDATION_VERSION, version);
- return 0;
- }
- Foundation *mInstance = NULL;
-
- if (!mInstance) {
- // if we don't assign this here, the Foundation object can't create member
- // subobjects which require the allocator
-
- mInstance = reinterpret_cast<Foundation *>(
- alloc.allocate(sizeof(Foundation), "Foundation", __FILE__, __LINE__));
-
- if (mInstance) {
- QT3DS_PLACEMENT_NEW(mInstance, Foundation)(alloc);
-
- QT3DS_ASSERT(mInstance->mRefCount == 0);
-
- return mInstance;
- } else {
- qCCritical(INTERNAL_ERROR, "Memory allocation for foundation object failed.");
- }
- } else {
- qCCritical(
- INVALID_OPERATION,
- "Foundation object exists already. Only one instance per process can be created.");
- }
-
- return 0;
- }
-
- void Foundation::addRef()
- {
- mRefCountMutex.lock();
- ++mRefCount;
- mRefCountMutex.unlock();
- }
-
- void Foundation::release()
- {
- mRefCountMutex.lock();
- if (mRefCount)
- --mRefCount;
- QT3DSU32 refCount = mRefCount;
- mRefCountMutex.unlock();
- if (!refCount) {
- NVAllocatorCallback &alloc = mAllocator.getBaseAllocator();
- this->~Foundation();
- alloc.deallocate(this);
- }
- }
-
- void *Foundation::AlignCheckAllocator::allocate(size_t size, const char *typeName,
- const char *filename, int line, int)
- {
- void *addr = mAllocator.allocate(size, typeName, filename, line);
-
- if (!addr)
- qFatal("User allocator returned NULL.");
-
- if (!(reinterpret_cast<size_t>(addr) & 15)) {
- // Same comment as before in the allocation system.
- // We don't lock the listener array mutex because of an assumption
- // where the listener array is rarely changing.
- QT3DSU32 theCount = mListenerCount;
- for (QT3DSU32 idx = 0; idx < theCount; ++idx)
- mListeners[idx]->onAllocation(size, typeName, filename, line, addr);
- return addr;
- }
-
- qFatal("Allocations for qt3ds::foundation must be 16-byte aligned.");
- return 0;
- }
-
- void *Foundation::AlignCheckAllocator::allocate(size_t size, const char *typeName,
- const char *filename, int line,
- size_t /*alignment*/,
- size_t /*alignmentOffset*/)
- {
- return allocate(size, typeName, filename, line, 0);
- }
-
-} // namespace foundation
-} // namespace qt3ds
-
-qt3ds::NVFoundation *NVCreateFoundation(qt3ds::QT3DSU32 version, qt3ds::NVAllocatorCallback &allocator)
-{
- return qt3ds::foundation::Foundation::createInstance(version, allocator);
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.h
deleted file mode 100644
index 19065d20..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSFoundation.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_FOUNDATION_H
-#define QT3DS_FOUNDATION_QT3DS_FOUNDATION_H
-
-/** \addtogroup foundation
- @{
-*/
-
-#include <stdarg.h>
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSVersionNumber.h"
-#include "foundation/Qt3DSLogging.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-class NVAllocatorCallback;
-class NVProfilingZone;
-class NVBroadcastingAllocator;
-
-class NVFoundationBase
-{
-public:
- /**
- retrieves the current allocator.
- */
- virtual NVBroadcastingAllocator &getAllocator() const = 0;
-};
-
-namespace foundation {
-template <typename TObjType>
-inline void NVDelete(NVFoundationBase &alloc, TObjType *item)
-{
- NVDelete(alloc.getAllocator(), item);
-}
-}
-
-/**
-\brief Foundation SDK singleton class.
-
-You need to have an instance of this class to instance the higher level SDKs.
-*/
-class QT3DS_FOUNDATION_API NVFoundation : public NVFoundationBase
-{
-public:
- virtual void addRef() = 0;
- /**
- \brief Destroys the instance it is called on.
-
- The operation will fail, if there are still modules referencing the foundation object. Release
- all dependent modules prior
- to calling this method.
-
- @see NVCreateFoundation()
- */
- virtual void release() = 0;
-
- /**
- Retrieves the allocator this object was created with.
- */
- virtual NVAllocatorCallback &getAllocatorCallback() const = 0;
-
-protected:
- virtual ~NVFoundation() {}
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/**
-\brief Creates an instance of the foundation class
-
-\param version Version number we are expecting (should be QT3DS_FOUNDATION_VERSION)
-\param allocator User supplied interface for allocating memory(see #NVAllocatorCallback)
-\return Foundation instance on success, NULL if operation failed
-
-@see NVFoundation
-*/
-
-#ifdef QT3DS_FOUNDATION_NO_EXPORTS
-QT3DS_AUTOTEST_EXPORT
-#else
-QT3DS_FOUNDATION_API
-#endif
-qt3ds::NVFoundation *QT3DS_CALL_CONV NVCreateFoundation(
- qt3ds::QT3DSU32 version, qt3ds::NVAllocatorCallback &allocator);
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_FOUNDATION_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSIPC.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSIPC.h
deleted file mode 100644
index 9bcea1af..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSIPC.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_IPC_H
-#define QT3DS_IPC_H
-
-#include "foundation/Qt3DS.h"
-
-namespace qt3ds {
-namespace foundation {
-
- class NVIPC
- {
- public:
- enum ConnectionType {
- CT_CLIENT, // start up as a client, will succeed even if the server has not yet been
- // found.
- CT_CLIENT_REQUIRE_SERVER, // start up as a client, but only if the server already
- // exists.
- CT_SERVER, // will start up as a server, will fail if an existing server is already
- // open.
- CT_CLIENT_OR_SERVER, // connect as either a client or server, don't care who is created
- // first.
- CT_LAST
- };
-
- enum ErrorCode {
- EC_OK, // no error.
- EC_FAIL, // generic failure.
- EC_SERVER_ALREADY_EXISTS, // couldn't create a server, because the server already
- // exists.
- EC_CLIENT_ALREADY_EXISTS, // couldn't create a client, because an existing client is
- // already registered.
- EC_CLIENT_SERVER_ALREADY_EXISTS, // both the client and server channels are already used
- EC_SERVER_NOT_FOUND, // client opened with a required server, which was not found.
- EC_BUFFER_MISSMATCH, // the reserved buffers for client/server do not match up.
- EC_MAPFILE_CREATE, // failed to create the shared memory map file.
- EC_MAPFILE_VIEW, // failed to map the memory view of he
- // communications errors.
- EC_SEND_DATA_EXCEEDS_MAX_BUFFER, // trying to send more data than can even fit in the
- // sednd buffe.
- EC_SEND_DATA_TOO_LARGE, // the data we tried to send exceeds the available room int the
- // output ring buffer.
- EC_SEND_BUFFER_FULL, // the send buffer is completely full.
- EC_SEND_FROM_WRONG_THREAD, // Tried to do a send from a different thread
- EC_RECEIVE_FROM_WRONG_THREAD, // Tried to do a recieve from a different thread
- EC_NO_RECEIVE_PENDING, // tried to acknowledge a receive but none was pending.
- };
-
- virtual bool pumpPendingSends(void) = 0; // give up a time slice to pending sends; returns
- // true if there are still pends sending.
- virtual ErrorCode sendData(const void *data, QT3DSU32 data_len, bool bufferIfFull) = 0;
- virtual const void *receiveData(QT3DSU32 &data_len) = 0;
- virtual ErrorCode receiveAcknowledge(void) = 0; // acknowledge that we have processed the
- // incoming message and can advance the read
- // buffer.
-
- virtual bool isServer(void) const = 0; // returns true if we are opened as a server.
-
- virtual bool haveConnection(void) const = 0;
-
- virtual bool canSend(QT3DSU32 len) = 0; // return true if we can send a message of this size.
-
- virtual void release(void) = 0;
-
- protected:
- virtual ~NVIPC(void){}
- };
-}; // end of namespace
-}; // end of namespace
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSIndexableLinkedList.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSIndexableLinkedList.h
deleted file mode 100644
index ff36b42a..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSIndexableLinkedList.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_INDEXABLE_LINKED_LIST_H
-#define QT3DS_FOUNDATION_INDEXABLE_LINKED_LIST_H
-#include "foundation/Qt3DSPool.h"
-
-namespace qt3ds {
-namespace foundation {
- // Set of helper functions for manipulation of lists that are
- // somewhat indexable but also amenable to using a pool structure.
- template <typename TNodeType, typename TObjType, QT3DSU32 TObjCount>
- struct IndexableLinkedList
- {
- typedef TNodeType SNode;
-
- typedef Pool<SNode, ForwardingAllocator> TPoolType;
-
- static TObjType &Create(SNode *&inInitialNode, QT3DSU32 &ioCurrentCount, TPoolType &ioPool)
- {
- QT3DSU32 idx = ioCurrentCount;
- ++ioCurrentCount;
- QT3DSU32 numGroups = (ioCurrentCount + TObjCount - 1) / TObjCount;
- QT3DSU32 localIdx = idx % TObjCount;
-
- SNode *theCurrentNode = inInitialNode;
- for (QT3DSU32 idx = 0, end = numGroups; idx < end; ++idx) {
- if (idx == 0) {
- if (theCurrentNode == NULL)
- inInitialNode = ioPool.construct(__FILE__, __LINE__);
-
- theCurrentNode = inInitialNode;
- } else {
- if (theCurrentNode->m_NextNode == NULL)
- theCurrentNode->m_NextNode = ioPool.construct(__FILE__, __LINE__);
- theCurrentNode = theCurrentNode->m_NextNode;
- }
- }
- return theCurrentNode->m_Data[localIdx];
- }
-
- static void CreateAll(SNode *&inInitialNode, QT3DSU32 inCount, TPoolType &ioPool)
- {
- QT3DSU32 numGroups = (inCount + TObjCount - 1) / TObjCount;
- SNode *lastNode = NULL;
- for (QT3DSU32 idx = 0, end = numGroups; idx < end; ++idx) {
- SNode *nextNode = ioPool.construct(__FILE__, __LINE__);
- if (idx == 0)
- inInitialNode = nextNode;
- else
- lastNode->m_NextNode = nextNode;
- lastNode = nextNode;
- }
- }
-
- static void DeleteList(SNode *&inInitialNode, TPoolType &ioPool)
- {
- SNode *theNode = inInitialNode;
- inInitialNode = NULL;
- while (theNode) {
- SNode *theNext = theNode->m_NextNode;
- theNode->m_NextNode = NULL;
- ioPool.deallocate(theNode);
- theNode = theNext;
- }
- }
-
- // Performs no checking, so you need to have already allocated what you need.
- static const TObjType &GetObjAtIdx(const SNode *inInitialNode, QT3DSU32 inIdx)
- {
- QT3DSU32 groupIdx = inIdx / TObjCount;
- QT3DSU32 localIdx = inIdx % TObjCount;
- for (QT3DSU32 idx = 0; idx < groupIdx; ++idx)
- inInitialNode = inInitialNode->m_NextNode;
- return inInitialNode->m_Data[inIdx];
- }
-
- static TObjType &GetObjAtIdx(SNode *inInitialNode, QT3DSU32 inIdx)
- {
- QT3DSU32 groupIdx = inIdx / TObjCount;
- QT3DSU32 localIdx = inIdx % TObjCount;
- for (QT3DSU32 idx = 0; idx < groupIdx; ++idx)
- inInitialNode = inInitialNode->m_NextNode;
- return inInitialNode->m_Data[localIdx];
- }
-
- struct SIteratorType
- {
- QT3DSU32 m_Idx;
- QT3DSU32 m_Count;
- SNode *m_Node;
-
- SIteratorType()
- : m_Idx(0)
- , m_Count(0)
- , m_Node(NULL)
- {
- }
- SIteratorType(const SIteratorType &iter)
- : m_Idx(iter.m_Idx)
- , m_Count(iter.m_Count)
- , m_Node(iter.m_Node)
- {
- }
- SIteratorType(SNode *inNode, QT3DSU32 inCount, QT3DSU32 inIdx)
- : m_Idx(inIdx)
- , m_Count(inCount)
- , m_Node(inNode)
- {
- }
-
- bool operator==(const SIteratorType &iter) const { return m_Idx == iter.m_Idx; }
-
- bool operator!=(const SIteratorType &iter) const { return m_Idx != iter.m_Idx; }
-
- TObjType &operator*()
- {
- QT3DSU32 localIdx = m_Idx % TObjCount;
- return m_Node->m_Data[localIdx];
- }
-
- SIteratorType &operator++()
- {
- ++m_Idx;
- if ((m_Idx % TObjCount) == 0)
- m_Node = m_Node->m_NextNode;
-
- return *this;
- }
- };
-
- struct SConstIteratorType
- {
- QT3DSU32 m_Idx;
- QT3DSU32 m_Count;
- const SNode *m_Node;
-
- SConstIteratorType()
- : m_Idx(0)
- , m_Count(0)
- , m_Node(NULL)
- {
- }
- SConstIteratorType(const SIteratorType &iter)
- : m_Idx(iter.m_Idx)
- , m_Count(iter.m_Count)
- , m_Node(iter.m_Node)
- {
- }
- SConstIteratorType(const SConstIteratorType &iter)
- : m_Idx(iter.m_Idx)
- , m_Count(iter.m_Count)
- , m_Node(iter.m_Node)
- {
- }
- SConstIteratorType(const SNode *inNode, QT3DSU32 inCount, QT3DSU32 inIdx)
- : m_Idx(inIdx)
- , m_Count(inCount)
- , m_Node(inNode)
- {
- }
-
- bool operator==(const SConstIteratorType &iter) const { return m_Idx == iter.m_Idx; }
-
- bool operator!=(const SConstIteratorType &iter) const { return m_Idx != iter.m_Idx; }
-
- const TObjType &operator*()
- {
- QT3DSU32 localIdx = m_Idx % TObjCount;
- return m_Node->m_Data[localIdx];
- }
-
- SConstIteratorType &operator++()
- {
- ++m_Idx;
- if ((m_Idx % TObjCount) == 0)
- m_Node = m_Node->m_NextNode;
-
- return *this;
- }
- };
-
- typedef SIteratorType iterator;
- typedef SConstIteratorType const_iterator;
-
- static iterator begin(SNode *inInitialNode, QT3DSU32 inItemCount)
- {
- return SIteratorType(inInitialNode, inItemCount, 0);
- }
-
- static iterator end(SNode * /*inInitialNode*/, QT3DSU32 inItemCount)
- {
- return SIteratorType(NULL, inItemCount, inItemCount);
- }
-
- static const_iterator begin(const SNode *inInitialNode, QT3DSU32 inItemCount)
- {
- return SConstIteratorType(inInitialNode, inItemCount, 0);
- }
-
- static const_iterator end(const SNode * /*inInitialNode*/, QT3DSU32 inItemCount)
- {
- return SConstIteratorType(NULL, inItemCount, inItemCount);
- }
-
- struct SNodeIteratorType
- {
- SNode *m_Node;
-
- SNodeIteratorType()
- : m_Node(NULL)
- {
- }
- SNodeIteratorType(const SNodeIteratorType &iter)
- : m_Node(iter.m_Node)
- {
- }
- SNodeIteratorType(SNode *inNode)
- : m_Node(inNode)
- {
- }
-
- bool operator==(const SNodeIteratorType &iter) const { return m_Node == iter.m_Node; }
-
- bool operator!=(const SNodeIteratorType &iter) const { return m_Node != iter.m_Node; }
-
- TNodeType &operator*() { return *m_Node; }
-
- SNodeIteratorType &operator++()
- {
- if (m_Node)
- m_Node = m_Node->m_NextNode;
-
- return *this;
- }
- };
-
- typedef SNodeIteratorType node_iterator;
- static node_iterator node_begin(SNode *inFirstNode) { return node_iterator(inFirstNode); }
- static node_iterator node_end(SNode * /*inFirstNode*/) { return node_iterator(NULL); }
-
- // Iterates through the number of nodes required for a given count of objects
- struct SCountIteratorType
- {
- QT3DSU32 m_Idx;
- QT3DSU32 m_Count;
-
- SCountIteratorType()
- : m_Idx(0)
- , m_Count(0)
- {
- }
- SCountIteratorType(const SCountIteratorType &iter)
- : m_Idx(iter.m_Idx)
- , m_Count(iter.m_Count)
- {
- }
- SCountIteratorType(QT3DSU32 idx, QT3DSU32 count)
- : m_Idx(idx)
- , m_Count(count)
- {
- }
-
- bool operator==(const SCountIteratorType &iter) const { return m_Idx == iter.m_Idx; }
-
- bool operator!=(const SCountIteratorType &iter) const { return m_Idx != iter.m_Idx; }
-
- SCountIteratorType &operator++()
- {
- m_Idx = NVMin(m_Idx + TObjCount, m_Count);
- return *this;
- }
- };
-
- typedef SCountIteratorType count_iterator;
- static count_iterator count_begin(QT3DSU32 count) { return SCountIteratorType(0, count); }
- static count_iterator count_end(QT3DSU32 count) { return SCountIteratorType(count, count); }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSIntrinsics.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSIntrinsics.h
deleted file mode 100644
index 1d6ac7a5..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSIntrinsics.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_INTRINSICS_H
-#define QT3DS_FOUNDATION_QT3DS_INTRINSICS_H
-
-#include "foundation/Qt3DSPreprocessor.h"
-
-#if defined QT3DS_WINDOWS || defined QT3DS_WIN8ARM
-#include "windows/Qt3DSWindowsIntrinsics.h"
-#elif defined QT3DS_X360
-#include "xbox360/NVXbox360Intrinsics.h"
-#elif (defined QT3DS_LINUX || defined QT3DS_ANDROID || defined QT3DS_APPLE || defined QT3DS_QNX)
-#include "linux/Qt3DSLinuxIntrinsics.h"
-#elif defined QT3DS_PS3
-#include "ps3/NVPS3Intrinsics.h"
-#elif defined QT3DS_PSP2
-#include "psp2/NVPSP2Intrinsics.h"
-#else
-#error "Platform not supported!"
-#endif
-
-#endif // QT3DS_FOUNDATION_QT3DS_INTRINSICS_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveLinkedList.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveLinkedList.h
deleted file mode 100644
index da90e120..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveLinkedList.h
+++ /dev/null
@@ -1,361 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_INVASIVE_LINKED_LIST_H
-#define QT3DS_FOUNDATION_INVASIVE_LINKED_LIST_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSContainers.h"
-
-namespace qt3ds {
-namespace foundation {
-
- // Base linked list without an included head or tail member.
- template <typename TObjType, typename TObjHeadOp, typename TObjTailOp>
- struct SInvasiveLinkListBase
- {
- TObjType *tail(TObjType *inObj)
- {
- if (inObj)
- return TObjTailOp().get(inObj);
- return NULL;
- }
-
- TObjType *head(TObjType *inObj)
- {
- if (inObj)
- return TObjHeadOp().get(inObj);
- return NULL;
- }
-
- const TObjType *tail(const TObjType *inObj)
- {
- if (inObj)
- return TObjTailOp().get(inObj);
- return NULL;
- }
-
- const TObjType *head(const TObjType *inObj)
- {
- if (inObj)
- return TObjHeadOp().get(inObj);
- return NULL;
- }
-
- void remove(TObjType &inObj)
- {
- TObjHeadOp theHeadOp;
- TObjTailOp theTailOp;
- TObjType *theHead = theHeadOp.get(inObj);
- TObjType *theTail = theTailOp.get(inObj);
- if (theHead)
- theTailOp.set(*theHead, theTail);
- if (theTail)
- theHeadOp.set(*theTail, theHead);
- theHeadOp.set(inObj, NULL);
- theTailOp.set(inObj, NULL);
- }
-
- void insert_after(TObjType &inPosition, TObjType &inObj)
- {
- TObjTailOp theTailOp;
- TObjType *theHead = &inPosition;
- TObjType *theTail = theTailOp.get(inPosition);
- insert(theHead, theTail, inObj);
- }
-
- void insert_before(TObjType &inPosition, TObjType &inObj)
- {
- TObjHeadOp theHeadOp;
- TObjType *theHead = theHeadOp.get(inPosition);
- TObjType *theTail = &inPosition;
- insert(theHead, theTail, inObj);
- }
-
- void insert(TObjType *inHead, TObjType *inTail, TObjType &inObj)
- {
- TObjHeadOp theHeadOp;
- TObjTailOp theTailOp;
- if (inHead)
- theTailOp.set(*inHead, &inObj);
- if (inTail)
- theHeadOp.set(*inTail, &inObj);
- theHeadOp.set(inObj, inHead);
- theTailOp.set(inObj, inTail);
- }
- };
-
- template <typename TObjType, typename TObjTailOp>
- struct SLinkedListIterator
- {
- typedef SLinkedListIterator<TObjType, TObjTailOp> TMyType;
- TObjType *m_Obj;
- SLinkedListIterator(TObjType *inObj = NULL)
- : m_Obj(inObj)
- {
- }
-
- bool operator!=(const TMyType &inIter) const { return m_Obj != inIter.m_Obj; }
- bool operator==(const TMyType &inIter) const { return m_Obj == inIter.m_Obj; }
-
- TMyType &operator++()
- {
- if (m_Obj)
- m_Obj = TObjTailOp().get(*m_Obj);
- return *this;
- }
-
- TMyType &operator++(int)
- {
- TMyType retval(*this);
- ++(*this);
- return retval;
- }
-
- TObjType &operator*() { return *m_Obj; }
- TObjType *operator->() { return m_Obj; }
- };
-
- // Used for singly linked list where
- // items have either no head or tail ptr.
- template <typename TObjType>
- struct SNullOp
- {
- void set(TObjType &, TObjType *) {}
- TObjType *get(const TObjType &) { return NULL; }
- };
-
- template <typename TObjType, typename TObjTailOp>
- struct InvasiveSingleLinkedList
- : public SInvasiveLinkListBase<TObjType, SNullOp<TObjType>, TObjTailOp>
- {
- typedef InvasiveSingleLinkedList<TObjType, TObjTailOp> TMyType;
- typedef SInvasiveLinkListBase<TObjType, SNullOp<TObjType>, TObjTailOp> TBaseType;
- typedef SLinkedListIterator<TObjType, TObjTailOp> iterator;
- typedef iterator const_iterator;
- TObjType *m_Head;
- InvasiveSingleLinkedList()
- : m_Head(NULL)
- {
- }
- InvasiveSingleLinkedList(const TMyType &inOther)
- : m_Head(inOther.m_Head)
- {
- }
- TMyType &operator=(const TMyType &inOther)
- {
- m_Head = inOther.m_Head;
- return *this;
- }
-
- TObjType &front() const { return *m_Head; }
-
- void push_front(TObjType &inObj)
- {
- if (m_Head != NULL)
- TBaseType::insert_before(*m_Head, inObj);
- m_Head = &inObj;
- }
-
- void push_back(TObjType &inObj)
- {
- if (m_Head == NULL)
- m_Head = &inObj;
- else {
- TObjType *lastObj = NULL;
- for (iterator iter = begin(), endIter = end(); iter != endIter; ++iter)
- lastObj = &(*iter);
-
- QT3DS_ASSERT(lastObj);
- if (lastObj)
- TObjTailOp().set(*lastObj, &inObj);
- }
- }
-
- void remove(TObjType &inObj)
- {
- if (m_Head == &inObj)
- m_Head = TObjTailOp().get(inObj);
- TBaseType::remove(inObj);
- }
-
- bool empty() const { return m_Head == NULL; }
-
- iterator begin() { return iterator(m_Head); }
- iterator end() { return iterator(NULL); }
-
- const_iterator begin() const { return iterator(m_Head); }
- const_iterator end() const { return iterator(NULL); }
- };
-
- template <typename TObjType, typename TObjHeadOp, typename TObjTailOp>
- struct InvasiveLinkedList : public SInvasiveLinkListBase<TObjType, TObjHeadOp, TObjTailOp>
- {
- typedef InvasiveLinkedList<TObjType, TObjHeadOp, TObjTailOp> TMyType;
- typedef SInvasiveLinkListBase<TObjType, TObjHeadOp, TObjTailOp> TBaseType;
- typedef SLinkedListIterator<TObjType, TObjTailOp> iterator;
- typedef iterator const_iterator;
- typedef SLinkedListIterator<TObjType, TObjHeadOp> reverse_iterator;
- typedef reverse_iterator const_reverse_iterator;
-
- TObjType *m_Head;
- TObjType *m_Tail;
-
- InvasiveLinkedList()
- : m_Head(NULL)
- , m_Tail(NULL)
- {
- }
- InvasiveLinkedList(const TMyType &inOther)
- : m_Head(inOther.m_Head)
- , m_Tail(inOther.m_Tail)
- {
- }
- TMyType &operator=(const TMyType &inOther)
- {
- m_Head = inOther.m_Head;
- m_Tail = inOther.m_Tail;
- return *this;
- }
-
- TObjType &front() const
- {
- QT3DS_ASSERT(m_Head);
- return *m_Head;
- }
- TObjType &back() const
- {
- QT3DS_ASSERT(m_Tail);
- return *m_Tail;
- }
-
- TObjType *front_ptr() const { return m_Head; }
- TObjType *back_ptr() const { return m_Tail; }
-
- void push_front(TObjType &inObj)
- {
- if (m_Head != NULL)
- TBaseType::insert_before(*m_Head, inObj);
- m_Head = &inObj;
-
- if (m_Tail == NULL)
- m_Tail = &inObj;
- }
-
- void push_back(TObjType &inObj)
- {
- if (m_Tail != NULL)
- TBaseType::insert_after(*m_Tail, inObj);
- m_Tail = &inObj;
-
- if (m_Head == NULL)
- m_Head = &inObj;
- }
-
- void remove(TObjType &inObj)
- {
- if (m_Head == &inObj)
- m_Head = TObjTailOp().get(inObj);
- if (m_Tail == &inObj)
- m_Tail = TObjHeadOp().get(inObj);
-
- TBaseType::remove(inObj);
- }
-
- bool empty() const { return m_Head == NULL; }
-
- iterator begin() { return iterator(m_Head); }
- iterator end() { return iterator(NULL); }
-
- const_iterator begin() const { return iterator(m_Head); }
- const_iterator end() const { return iterator(NULL); }
-
- reverse_iterator rbegin() { return reverse_iterator(m_Tail); }
- reverse_iterator rend() { return reverse_iterator(NULL); }
-
- const_reverse_iterator rbegin() const { return reverse_iterator(m_Tail); }
- const_reverse_iterator rend() const { return reverse_iterator(NULL); }
- };
-
-// Macros to speed up the definitely of invasive linked lists.
-#define DEFINE_INVASIVE_SINGLE_LIST(type) \
- struct S##type; \
- struct S##type##NextOp \
- { \
- S##type *get(S##type &s); \
- const S##type *get(const S##type &s) const; \
- void set(S##type &inItem, S##type *inNext); \
- }; \
- typedef InvasiveSingleLinkedList<S##type, S##type##NextOp> T##type##List;
-
-#define DEFINE_INVASIVE_LIST(type) \
- struct S##type; \
- struct S##type##NextOp \
- { \
- S##type *get(S##type &s); \
- const S##type *get(const S##type &s) const; \
- void set(S##type &inItem, S##type *inNext); \
- }; \
- struct S##type##PreviousOp \
- { \
- S##type *get(S##type &s); \
- const S##type *get(const S##type &s) const; \
- void set(S##type &inItem, S##type *inNext); \
- }; \
- typedef InvasiveLinkedList<S##type, S##type##PreviousOp, S##type##NextOp> T##type##List;
-
-#define IMPLEMENT_INVASIVE_LIST(type, prevMember, nextMember) \
- inline S##type *S##type##NextOp::get(S##type &s) { return s.nextMember; } \
- inline const S##type *S##type##NextOp::get(const S##type &s) const { return s.nextMember; } \
- inline void S##type##NextOp::set(S##type &inItem, S##type *inNext) \
- { \
- inItem.nextMember = inNext; \
- } \
- inline S##type *S##type##PreviousOp::get(S##type &s) { return s.prevMember; } \
- inline const S##type *S##type##PreviousOp::get(const S##type &s) const \
- { \
- return s.prevMember; \
- } \
- inline void S##type##PreviousOp::set(S##type &inItem, S##type *inNext) \
- { \
- inItem.prevMember = inNext; \
- }
-
-#define IMPLEMENT_INVASIVE_SINGLE_LIST(type, nextMember) \
- inline S##type *S##type##NextOp::get(S##type &s) { return s.nextMember; } \
- inline const S##type *S##type##NextOp::get(const S##type &s) const { return s.nextMember; } \
- inline void S##type##NextOp::set(S##type &inItem, S##type *inNext) \
- { \
- inItem.nextMember = inNext; \
- }
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveSet.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveSet.h
deleted file mode 100644
index 772a2308..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSInvasiveSet.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_INVASIVE_SET_H
-#define QT3DS_FOUNDATION_INVASIVE_SET_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSContainers.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename TObjectType, typename TGetSetIndexOp, typename TSetSetIndexOp>
- class InvasiveSet
- {
- nvvector<TObjectType *> mSet;
-
- InvasiveSet(const InvasiveSet &other);
- InvasiveSet &operator=(const InvasiveSet &other);
-
- public:
- InvasiveSet(NVAllocatorCallback &callback, const char *allocName)
- : mSet(callback, allocName)
- {
- }
-
- bool insert(TObjectType &inObject)
- {
- QT3DSU32 currentIdx = TGetSetIndexOp()(inObject);
- if (currentIdx == QT3DS_MAX_U32) {
- TSetSetIndexOp()(inObject, mSet.size());
- mSet.push_back(&inObject);
- return true;
- }
- return false;
- }
-
- bool remove(TObjectType &inObject)
- {
- QT3DSU32 currentIdx = TGetSetIndexOp()(inObject);
- if (currentIdx != QT3DS_MAX_U32) {
- TObjectType *theEnd = mSet.back();
- TObjectType *theObj = &inObject;
- if (theEnd != theObj) {
- TSetSetIndexOp()(*theEnd, currentIdx);
- mSet[currentIdx] = theEnd;
- }
- mSet.pop_back();
- TSetSetIndexOp()(inObject, QT3DS_MAX_U32);
- return true;
- }
- return false;
- }
-
- bool contains(TObjectType &inObject) { return TGetSetIndexOp()(inObject) != QT3DS_MAX_U32; }
-
- void clear()
- {
- for (QT3DSU32 idx = 0; idx < mSet.size(); ++idx)
- TSetSetIndexOp()(*(mSet[idx]), QT3DS_MAX_U32);
- mSet.clear();
- }
-
- TObjectType *operator[](QT3DSU32 idx) { return mSet[idx]; }
- const TObjectType *operator[](QT3DSU32 idx) const { return mSet[idx]; }
- QT3DSU32 size() const { return mSet.size(); }
- TObjectType **begin() { return mSet.begin(); }
- TObjectType **end() { return mSet.end(); }
- const TObjectType **begin() const { return mSet.begin(); }
- const TObjectType **end() const { return mSet.end(); }
- const TObjectType *back() const { return mSet.back(); }
- TObjectType *back() { return mSet.back(); }
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.cpp b/src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.cpp
deleted file mode 100644
index 257b39b2..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSLogging.h"
-
-namespace qt3ds {
-
-Q_LOGGING_CATEGORY(GL_ERROR, "qt3ds.gl_error")
-Q_LOGGING_CATEGORY(INVALID_PARAMETER, "qt3ds.invalid_parameter")
-Q_LOGGING_CATEGORY(INVALID_OPERATION, "qt3ds.invalid_operation")
-Q_LOGGING_CATEGORY(OUT_OF_MEMORY, "qt3ds.out_of_memory")
-Q_LOGGING_CATEGORY(INTERNAL_ERROR, "qt3ds.internal_error")
-Q_LOGGING_CATEGORY(PERF_WARNING, "qt3ds.perf_warning")
-Q_LOGGING_CATEGORY(PERF_INFO, "qt3ds.perf_info")
-Q_LOGGING_CATEGORY(TRACE_INFO, "qt3ds.trace_info")
-Q_LOGGING_CATEGORY(WARNING, "qt3ds.warning")
-
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.h
deleted file mode 100644
index 4fcb77b5..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSLogging.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_ERRORS_H
-#define QT3DS_FOUNDATION_QT3DS_ERRORS_H
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qloggingcategory.h>
-
-namespace qt3ds {
-
-Q_DECLARE_LOGGING_CATEGORY(GL_ERROR)
-Q_DECLARE_LOGGING_CATEGORY(INVALID_PARAMETER)
-Q_DECLARE_LOGGING_CATEGORY(INVALID_OPERATION)
-Q_DECLARE_LOGGING_CATEGORY(OUT_OF_MEMORY)
-Q_DECLARE_LOGGING_CATEGORY(INTERNAL_ERROR)
-Q_DECLARE_LOGGING_CATEGORY(PERF_WARNING)
-Q_DECLARE_LOGGING_CATEGORY(PERF_INFO)
-Q_DECLARE_LOGGING_CATEGORY(TRACE_INFO)
-Q_DECLARE_LOGGING_CATEGORY(WARNING)
-
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMat33.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMat33.h
deleted file mode 100644
index 6fa69eb5..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMat33.h
+++ /dev/null
@@ -1,385 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_MAT33_H
-#define QT3DS_FOUNDATION_QT3DS_MAT33_H
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSQuat.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-/*!
-\brief 3x3 matrix class
-
-Some clarifications, as there have been much confusion about matrix formats etc in the past.
-
-Short:
-- Matrix have base vectors in columns (vectors are column matrices, 3x1 matrices).
-- Matrix is physically stored in column major format
-- Matrices are concaternated from left
-
-Long:
-Given three base vectors a, b and c the matrix is stored as
-
-|a.x b.x c.x|
-|a.y b.y c.y|
-|a.z b.z c.z|
-
-Vectors are treated as columns, so the vector v is
-
-|x|
-|y|
-|z|
-
-And matrices are applied _before_ the vector (pre-multiplication)
-v' = M*v
-
-|x'| |a.x b.x c.x| |x| |a.x*x + b.x*y + c.x*z|
-|y'| = |a.y b.y c.y| * |y| = |a.y*x + b.y*y + c.y*z|
-|z'| |a.z b.z c.z| |z| |a.z*x + b.z*y + c.z*z|
-
-
-Physical storage and indexing:
-To be compatible with popular 3d rendering APIs (read D3d and OpenGL)
-the physical indexing is
-
-|0 3 6|
-|1 4 7|
-|2 5 8|
-
-index = column*3 + row
-
-which in C++ translates to M[column][row]
-
-The mathematical indexing is M_row,column and this is what is used for _-notation
-so _12 is 1st row, second column and operator(row, column)!
-
-@see QT3DSMat44
-
-*/
-class QT3DSMat33
-{
-public:
- //! Default constructor
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33() {}
-
- //! Construct from three base vectors
- QT3DS_CUDA_CALLABLE QT3DSMat33(const QT3DSVec3 &col0, const QT3DSVec3 &col1, const QT3DSVec3 &col2)
- : column0(col0)
- , column1(col1)
- , column2(col2)
- {
- }
-
- //! Construct from float[9]
- QT3DS_CUDA_CALLABLE explicit QT3DS_INLINE QT3DSMat33(NVReal values[])
- : column0(values[0], values[1], values[2])
- , column1(values[3], values[4], values[5])
- , column2(values[6], values[7], values[8])
- {
- }
-
- //! Construct from a quaternion
- QT3DS_CUDA_CALLABLE explicit QT3DS_FORCE_INLINE QT3DSMat33(const QT3DSQuat &q)
- {
- const NVReal x = q.x;
- const NVReal y = q.y;
- const NVReal z = q.z;
- const NVReal w = q.w;
-
- const NVReal x2 = x + x;
- const NVReal y2 = y + y;
- const NVReal z2 = z + z;
-
- const NVReal xx = x2 * x;
- const NVReal yy = y2 * y;
- const NVReal zz = z2 * z;
-
- const NVReal xy = x2 * y;
- const NVReal xz = x2 * z;
- const NVReal xw = x2 * w;
-
- const NVReal yz = y2 * z;
- const NVReal yw = y2 * w;
- const NVReal zw = z2 * w;
-
- column0 = QT3DSVec3(1.0f - yy - zz, xy + zw, xz - yw);
- column1 = QT3DSVec3(xy - zw, 1.0f - xx - zz, yz + xw);
- column2 = QT3DSVec3(xz + yw, yz - xw, 1.0f - xx - yy);
- }
-
- //! Copy constructor
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33(const QT3DSMat33 &other)
- : column0(other.column0)
- , column1(other.column1)
- , column2(other.column2)
- {
- }
-
- //! Assignment operator
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSMat33 &operator=(const QT3DSMat33 &other)
- {
- column0 = other.column0;
- column1 = other.column1;
- column2 = other.column2;
- return *this;
- }
-
- //! Set to identity matrix
- QT3DS_CUDA_CALLABLE QT3DS_INLINE static QT3DSMat33 createIdentity()
- {
- return QT3DSMat33(QT3DSVec3(1, 0, 0), QT3DSVec3(0, 1, 0), QT3DSVec3(0, 0, 1));
- }
-
- //! Set to zero matrix
- QT3DS_CUDA_CALLABLE QT3DS_INLINE static QT3DSMat33 createZero()
- {
- return QT3DSMat33(QT3DSVec3(0.0f), QT3DSVec3(0.0f), QT3DSVec3(0.0f));
- }
-
- //! Construct from diagonal, off-diagonals are zero.
- QT3DS_CUDA_CALLABLE QT3DS_INLINE static QT3DSMat33 createDiagonal(const QT3DSVec3 &d)
- {
- return QT3DSMat33(QT3DSVec3(d.x, 0.0f, 0.0f), QT3DSVec3(0.0f, d.y, 0.0f), QT3DSVec3(0.0f, 0.0f, d.z));
- }
-
- //! Get transposed matrix
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSMat33 getTranspose() const
- {
- const QT3DSVec3 v0(column0.x, column1.x, column2.x);
- const QT3DSVec3 v1(column0.y, column1.y, column2.y);
- const QT3DSVec3 v2(column0.z, column1.z, column2.z);
-
- return QT3DSMat33(v0, v1, v2);
- }
-
- //! Get the real inverse
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 getInverse() const
- {
- const NVReal det = getDeterminant();
- QT3DSMat33 inverse;
-
- if (det != 0) {
- const NVReal invDet = 1.0f / det;
-
- inverse.column0[0] = invDet * (column1[1] * column2[2] - column2[1] * column1[2]);
- inverse.column0[1] = invDet * -(column0[1] * column2[2] - column2[1] * column0[2]);
- inverse.column0[2] = invDet * (column0[1] * column1[2] - column0[2] * column1[1]);
-
- inverse.column1[0] = invDet * -(column1[0] * column2[2] - column1[2] * column2[0]);
- inverse.column1[1] = invDet * (column0[0] * column2[2] - column0[2] * column2[0]);
- inverse.column1[2] = invDet * -(column0[0] * column1[2] - column0[2] * column1[0]);
-
- inverse.column2[0] = invDet * (column1[0] * column2[1] - column1[1] * column2[0]);
- inverse.column2[1] = invDet * -(column0[0] * column2[1] - column0[1] * column2[0]);
- inverse.column2[2] = invDet * (column0[0] * column1[1] - column1[0] * column0[1]);
-
- return inverse;
- } else {
- return createIdentity();
- }
- }
-
- //! Get determinant
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal getDeterminant() const
- {
- return column0.dot(column1.cross(column2));
- }
-
- //! Unary minus
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 operator-() const
- {
- return QT3DSMat33(-column0, -column1, -column2);
- }
-
- //! Add
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 operator+(const QT3DSMat33 &other) const
- {
- return QT3DSMat33(column0 + other.column0, column1 + other.column1, column2 + other.column2);
- }
-
- //! Subtract
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 operator-(const QT3DSMat33 &other) const
- {
- return QT3DSMat33(column0 - other.column0, column1 - other.column1, column2 - other.column2);
- }
-
- //! Scalar multiplication
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 operator*(NVReal scalar) const
- {
- return QT3DSMat33(column0 * scalar, column1 * scalar, column2 * scalar);
- }
-
- friend QT3DSMat33 operator*(NVReal, const QT3DSMat33 &);
-
- //! Matrix vector multiplication (returns 'this->transform(vec)')
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 operator*(const QT3DSVec3 &vec) const { return transform(vec); }
-
- //! Matrix multiplication
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSMat33 operator*(const QT3DSMat33 &other) const
- {
- // Rows from this <dot> columns from other
- // column0 = transform(other.column0) etc
- return QT3DSMat33(transform(other.column0), transform(other.column1),
- transform(other.column2));
- }
-
- // a <op>= b operators
-
- //! Equals-add
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 &operator+=(const QT3DSMat33 &other)
- {
- column0 += other.column0;
- column1 += other.column1;
- column2 += other.column2;
- return *this;
- }
-
- //! Equals-sub
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 &operator-=(const QT3DSMat33 &other)
- {
- column0 -= other.column0;
- column1 -= other.column1;
- column2 -= other.column2;
- return *this;
- }
-
- //! Equals scalar multiplication
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 &operator*=(NVReal scalar)
- {
- column0 *= scalar;
- column1 *= scalar;
- column2 *= scalar;
- return *this;
- }
-
- //! Element access, mathematical way!
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal operator()(unsigned int row, unsigned int col) const
- {
- return (*this)[col][row];
- }
-
- //! Element access, mathematical way!
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal &operator()(unsigned int row, unsigned int col)
- {
- return (*this)[col][row];
- }
-
- // Transform etc
-
- //! Transform vector by matrix, equal to v' = M*v
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 transform(const QT3DSVec3 &other) const
- {
- return column0 * other.x + column1 * other.y + column2 * other.z;
- }
-
- //! Transform vector by matrix transpose, v' = M^t*v
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 transformTranspose(const QT3DSVec3 &other) const
- {
- return QT3DSVec3(column0.dot(other), column1.dot(other), column2.dot(other));
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const NVReal *front() const { return &column0.x; }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 &operator[](int num) { return (&column0)[num]; }
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const QT3DSVec3 &operator[](int num) const
- {
- return (&column0)[num];
- }
-
- // Data, see above for format!
-
- QT3DSVec3 column0, column1, column2; // the three base vectors
-};
-
-// implementation from Qt3DSQuat.h
-QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat::QT3DSQuat(const QT3DSMat33 &m)
-{
- NVReal tr = m(0, 0) + m(1, 1) + m(2, 2), h;
- if (tr >= 0) {
- h = NVSqrt(tr + 1);
- w = NVReal(0.5) * h;
- h = NVReal(0.5) / h;
-
- x = (m(2, 1) - m(1, 2)) * h;
- y = (m(0, 2) - m(2, 0)) * h;
- z = (m(1, 0) - m(0, 1)) * h;
- } else {
- int i = 0;
- if (m(1, 1) > m(0, 0))
- i = 1;
- if (m(2, 2) > m(i, i))
- i = 2;
- switch (i) {
- case 0:
- h = NVSqrt((m(0, 0) - (m(1, 1) + m(2, 2))) + 1);
- x = NVReal(0.5) * h;
- h = NVReal(0.5) / h;
-
- y = (m(0, 1) + m(1, 0)) * h;
- z = (m(2, 0) + m(0, 2)) * h;
- w = (m(2, 1) - m(1, 2)) * h;
- break;
- case 1:
- h = NVSqrt((m(1, 1) - (m(2, 2) + m(0, 0))) + 1);
- y = NVReal(0.5) * h;
- h = NVReal(0.5) / h;
-
- z = (m(1, 2) + m(2, 1)) * h;
- x = (m(0, 1) + m(1, 0)) * h;
- w = (m(0, 2) - m(2, 0)) * h;
- break;
- case 2:
- h = NVSqrt((m(2, 2) - (m(0, 0) + m(1, 1))) + 1);
- z = NVReal(0.5) * h;
- h = NVReal(0.5) / h;
-
- x = (m(2, 0) + m(0, 2)) * h;
- y = (m(1, 2) + m(2, 1)) * h;
- w = (m(1, 0) - m(0, 1)) * h;
- break;
- default: // Make compiler happy
- x = y = z = w = 0;
- break;
- }
- }
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_MAT33_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMat44.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMat44.h
deleted file mode 100644
index 53a66e2b..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMat44.h
+++ /dev/null
@@ -1,497 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_MAT44_H
-#define QT3DS_FOUNDATION_QT3DS_MAT44_H
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSQuat.h"
-#include "foundation/Qt3DSVec4.h"
-#include "foundation/Qt3DSMat33.h"
-#include "foundation/Qt3DSTransform.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/*!
-\brief 4x4 matrix class
-
-This class is layout-compatible with D3D and OpenGL matrices. More notes on layout are given in the QT3DSMat33
-Graphics matrices always (by which I mean DX and OpenGL) have the rotation basis vectors stored contiguously
-in 0-2, 3-5, 6-8 and the the translation stored contiguously in 12-14. However, DX calls this row major and GL calls it column-major.
-http://www.mindcontrol.org/~hplus/graphics/matrix-layout.html
-
-you can blat these directly into GL (or DX)
-
---Dilip Sequeira
-
-@see QT3DSMat33 NVTransform
-*/
-
-class QT3DSMat44
-{
-public:
- //! Default constructor
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44() {}
-
- //! Construct from four 4-vectors
- QT3DS_CUDA_CALLABLE QT3DSMat44(const QT3DSVec4 &col0, const QT3DSVec4 &col1, const QT3DSVec4 &col2,
- const QT3DSVec4 &col3)
- : column0(col0)
- , column1(col1)
- , column2(col2)
- , column3(col3)
- {
- }
-
- //! Construct from three base vectors and a translation
- QT3DS_CUDA_CALLABLE QT3DSMat44(const QT3DSVec3 &column0, const QT3DSVec3 &column1, const QT3DSVec3 &column2,
- const QT3DSVec3 &column3)
- : column0(column0, 0)
- , column1(column1, 0)
- , column2(column2, 0)
- , column3(column3, 1)
- {
- }
-
- //! Construct from float[16]
- explicit QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44(NVReal values[])
- : column0(values[0], values[1], values[2], values[3])
- , column1(values[4], values[5], values[6], values[7])
- , column2(values[8], values[9], values[10], values[11])
- , column3(values[12], values[13], values[14], values[15])
- {
- }
-
- //! Construct from a quaternion
- explicit QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44(const QT3DSQuat &q)
- {
- const NVReal x = q.x;
- const NVReal y = q.y;
- const NVReal z = q.z;
- const NVReal w = q.w;
-
- const NVReal x2 = x + x;
- const NVReal y2 = y + y;
- const NVReal z2 = z + z;
-
- const NVReal xx = x2 * x;
- const NVReal yy = y2 * y;
- const NVReal zz = z2 * z;
-
- const NVReal xy = x2 * y;
- const NVReal xz = x2 * z;
- const NVReal xw = x2 * w;
-
- const NVReal yz = y2 * z;
- const NVReal yw = y2 * w;
- const NVReal zw = z2 * w;
-
- column0 = QT3DSVec4(1.0f - yy - zz, xy + zw, xz - yw, 0.0f);
- column1 = QT3DSVec4(xy - zw, 1.0f - xx - zz, yz + xw, 0.0f);
- column2 = QT3DSVec4(xz + yw, yz - xw, 1.0f - xx - yy, 0.0f);
- column3 = QT3DSVec4(0.0f, 0.0f, 0.0f, 1.0f);
- }
-
- //! Construct from a diagonal vector
- explicit QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44(const QT3DSVec4 &diagonal)
- : column0(diagonal.x, 0.0f, 0.0f, 0.0f)
- , column1(0.0f, diagonal.y, 0.0f, 0.0f)
- , column2(0.0f, 0.0f, diagonal.z, 0.0f)
- , column3(0.0f, 0.0f, 0.0f, diagonal.w)
- {
- }
-
- QT3DS_CUDA_CALLABLE QT3DSMat44(const QT3DSMat33 &orientation, const QT3DSVec3 &position)
- : column0(orientation.column0, 0.0f)
- , column1(orientation.column1, 0.0f)
- , column2(orientation.column2, 0.0f)
- , column3(position, 1)
- {
- }
-
- QT3DS_CUDA_CALLABLE QT3DSMat44(const NVTransform &t) { *this = QT3DSMat44(QT3DSMat33(t.q), t.p); }
-
- //! Copy constructor
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44(const QT3DSMat44 &other)
- : column0(other.column0)
- , column1(other.column1)
- , column2(other.column2)
- , column3(other.column3)
- {
- }
-
- //! Assignment operator
- QT3DS_CUDA_CALLABLE QT3DS_INLINE const QT3DSMat44 &operator=(const QT3DSMat44 &other)
- {
- column0 = other.column0;
- column1 = other.column1;
- column2 = other.column2;
- column3 = other.column3;
- return *this;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE static QT3DSMat44 createIdentity()
- {
- return QT3DSMat44(QT3DSVec4(1.0f, 0.0f, 0.0f, 0.0f), QT3DSVec4(0.0f, 1.0f, 0.0f, 0.0f),
- QT3DSVec4(0.0f, 0.0f, 1.0f, 0.0f), QT3DSVec4(0.0f, 0.0f, 0.0f, 1.0f));
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE static QT3DSMat44 createZero()
- {
- return QT3DSMat44(QT3DSVec4(0.0f), QT3DSVec4(0.0f), QT3DSVec4(0.0f), QT3DSVec4(0.0f));
- }
-
- //! Get transposed matrix
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 getTranspose() const
- {
- return QT3DSMat44(QT3DSVec4(column0.x, column1.x, column2.x, column3.x),
- QT3DSVec4(column0.y, column1.y, column2.y, column3.y),
- QT3DSVec4(column0.z, column1.z, column2.z, column3.z),
- QT3DSVec4(column0.w, column1.w, column2.w, column3.w));
- }
-
- //! Unary minus
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 operator-() const
- {
- return QT3DSMat44(-column0, -column1, -column2, -column3);
- }
-
- //! Add
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 operator+(const QT3DSMat44 &other) const
- {
- return QT3DSMat44(column0 + other.column0, column1 + other.column1, column2 + other.column2,
- column3 + other.column3);
- }
-
- //! Subtract
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 operator-(const QT3DSMat44 &other) const
- {
- return QT3DSMat44(column0 - other.column0, column1 - other.column1, column2 - other.column2,
- column3 - other.column3);
- }
-
- //! Scalar multiplication
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 operator*(NVReal scalar) const
- {
- return QT3DSMat44(column0 * scalar, column1 * scalar, column2 * scalar, column3 * scalar);
- }
-
- friend QT3DSMat44 operator*(NVReal, const QT3DSMat44 &);
-
- //! Matrix multiplication
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 operator*(const QT3DSMat44 &other) const
- {
- // Rows from this <dot> columns from other
- // column0 = transform(other.column0) etc
- return QT3DSMat44(transform(other.column0), transform(other.column1), transform(other.column2),
- transform(other.column3));
- }
-
- // a <op>= b operators
-
- //! Equals-add
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 &operator+=(const QT3DSMat44 &other)
- {
- column0 += other.column0;
- column1 += other.column1;
- column2 += other.column2;
- column3 += other.column3;
- return *this;
- }
-
- //! Equals-sub
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 &operator-=(const QT3DSMat44 &other)
- {
- column0 -= other.column0;
- column1 -= other.column1;
- column2 -= other.column2;
- column3 -= other.column3;
- return *this;
- }
-
- //! Equals scalar multiplication
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 &operator*=(NVReal scalar)
- {
- column0 *= scalar;
- column1 *= scalar;
- column2 *= scalar;
- column3 *= scalar;
- return *this;
- }
-
- //! Element access, mathematical way!
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal operator()(unsigned int row, unsigned int col) const
- {
- return (*this)[col][row];
- }
-
- //! Element access, mathematical way!
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal &operator()(unsigned int row, unsigned int col)
- {
- return (*this)[col][row];
- }
-
- //! Transform vector by matrix, equal to v' = M*v
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 transform(const QT3DSVec4 &other) const
- {
- return column0 * other.x + column1 * other.y + column2 * other.z + column3 * other.w;
- }
-
- //! Transform vector by matrix, equal to v' = M*v
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 transform(const QT3DSVec3 &other) const
- {
- return transform(QT3DSVec4(other, 1)).getXYZ();
- }
-
- //! Rotate vector by matrix, equal to v' = M*v
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 rotate(const QT3DSVec4 &other) const
- {
- return column0 * other.x + column1 * other.y + column2 * other.z; // + column3*0;
- }
-
- //! Rotate vector by matrix, equal to v' = M*v
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 rotate(const QT3DSVec3 &other) const
- {
- return rotate(QT3DSVec4(other, 1)).getXYZ();
- }
-
- /**
-* Shamelessly pulled from gl-matrix.js
- * Rotates a matrix by the given angle around the specified axis
-*
-* @param angle Angle (in radians) to rotate
-* @param axis vec3 representing the axis to rotate around
-*/
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool rotate(QT3DSF32 angleRadians, QT3DSVec3 axis)
- {
- QT3DSF32 x = axis[0], y = axis[1], z = axis[2], len = x * x + y * y + z * z, s, c, t, a00, a01,
- a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, b00, b01, b02, b10, b11, b12, b20,
- b21, b22;
-
- if (!len) {
- return false;
- }
- if (len != 1.0f) {
- len = 1 / (NVSqrt(len));
- x *= len;
- y *= len;
- z *= len;
- }
-
- s = NVSin(angleRadians);
- c = NVCos(angleRadians);
- t = 1 - c;
-
- QT3DSF32 *dataPtr(front());
-
-// inverse algorithm was written for row-major matrixes.
-#define mat(idx) dataPtr[idx]
-
- a00 = mat(0);
- a01 = mat(1);
- a02 = mat(2);
- a03 = mat(3);
- a10 = mat(4);
- a11 = mat(5);
- a12 = mat(6);
- a13 = mat(7);
- a20 = mat(8);
- a21 = mat(9);
- a22 = mat(10);
- a23 = mat(11);
-#undef mat
-
- // Construct the elements of the rotation matrix
- b00 = x * x * t + c;
- b01 = y * x * t + z * s;
- b02 = z * x * t - y * s;
- b10 = x * y * t - z * s;
- b11 = y * y * t + c;
- b12 = z * y * t + x * s;
- b20 = x * z * t + y * s;
- b21 = y * z * t - x * s;
- b22 = z * z * t + c;
-
-// Perform rotation-specific matrix multiplication
-
-#define dest(idx) dataPtr[idx]
-
- dest(0) = a00 * b00 + a10 * b01 + a20 * b02;
- dest(1) = a01 * b00 + a11 * b01 + a21 * b02;
- dest(2) = a02 * b00 + a12 * b01 + a22 * b02;
- dest(3) = a03 * b00 + a13 * b01 + a23 * b02;
-
- dest(4) = a00 * b10 + a10 * b11 + a20 * b12;
- dest(5) = a01 * b10 + a11 * b11 + a21 * b12;
- dest(6) = a02 * b10 + a12 * b11 + a22 * b12;
- dest(7) = a03 * b10 + a13 * b11 + a23 * b12;
-
- dest(8) = a00 * b20 + a10 * b21 + a20 * b22;
- dest(9) = a01 * b20 + a11 * b21 + a21 * b22;
- dest(10) = a02 * b20 + a12 * b21 + a22 * b22;
- dest(11) = a03 * b20 + a13 * b21 + a23 * b22;
-
-#undef dest
-
- return true;
- };
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 getBasis(int num) const
- {
- QT3DS_ASSERT(num >= 0 && num < 3);
- return (&column0)[num].getXYZ();
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 getPosition() const { return column3.getXYZ(); }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE void setPosition(const QT3DSVec3 &position)
- {
- column3.x = position.x;
- column3.y = position.y;
- column3.z = position.z;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal *front() { return &column0.x; }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const NVReal *front() const { return &column0.x; }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec4 &operator[](int num) { return (&column0)[num]; }
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const QT3DSVec4 &operator[](int num) const
- {
- return (&column0)[num];
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE void scale(const QT3DSVec4 &p)
- {
- column0 *= p.x;
- column1 *= p.y;
- column2 *= p.z;
- column3 *= p.w;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 inverseRT(void) const
- {
- QT3DSVec3 r0(column0.x, column1.x, column2.x), r1(column0.y, column1.y, column2.y),
- r2(column0.z, column1.z, column2.z);
-
- return QT3DSMat44(r0, r1, r2, -(r0 * column3.x + r1 * column3.y + r2 * column3.z));
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat44 getInverse(void) const
- {
- // inverse algorithm was written for row-major matrixes.
- const QT3DSF32 *myPtr(front());
-#define mat(idx) myPtr[idx]
-
- QT3DSF32 a00 = mat(0), a01 = mat(1), a02 = mat(2), a03 = mat(3), a10 = mat(4), a11 = mat(5),
- a12 = mat(6), a13 = mat(7), a20 = mat(8), a21 = mat(9), a22 = mat(10), a23 = mat(11),
- a30 = mat(12), a31 = mat(13), a32 = mat(14), a33 = mat(15),
-#undef mat
-
- b00 = a00 * a11 - a01 * a10, b01 = a00 * a12 - a02 * a10, b02 = a00 * a13 - a03 * a10,
- b03 = a01 * a12 - a02 * a11, b04 = a01 * a13 - a03 * a11, b05 = a02 * a13 - a03 * a12,
- b06 = a20 * a31 - a21 * a30, b07 = a20 * a32 - a22 * a30, b08 = a20 * a33 - a23 * a30,
- b09 = a21 * a32 - a22 * a31, b10 = a21 * a33 - a23 * a31, b11 = a22 * a33 - a23 * a32,
-
- d = (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06), invDet;
-
- // Calculate the determinant
- if (!d) {
- QT3DS_ASSERT(false);
- return QT3DSMat44::createIdentity();
- }
- invDet = 1 / d;
-
- QT3DSMat44 retval;
- QT3DSF32 *destPtr = retval.front();
-
-#define dest(idx) destPtr[idx]
- dest(0) = (a11 * b11 - a12 * b10 + a13 * b09) * invDet;
- dest(1) = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet;
- dest(2) = (a31 * b05 - a32 * b04 + a33 * b03) * invDet;
- dest(3) = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet;
- dest(4) = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet;
- dest(5) = (a00 * b11 - a02 * b08 + a03 * b07) * invDet;
- dest(6) = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet;
- dest(7) = (a20 * b05 - a22 * b02 + a23 * b01) * invDet;
- dest(8) = (a10 * b10 - a11 * b08 + a13 * b06) * invDet;
- dest(9) = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet;
- dest(10) = (a30 * b04 - a31 * b02 + a33 * b00) * invDet;
- dest(11) = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet;
- dest(12) = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet;
- dest(13) = (a00 * b09 - a01 * b07 + a02 * b06) * invDet;
- dest(14) = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet;
- dest(15) = (a20 * b03 - a21 * b01 + a22 * b00) * invDet;
-#undef dest
-
- return retval;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool isFinite() const
- {
- return column0.isFinite() && column1.isFinite() && column2.isFinite() && column3.isFinite();
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 getUpper3x3() const
- {
- return QT3DSMat33(column0.getXYZ(), column1.getXYZ(), column2.getXYZ());
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSMat33 getUpper3x3InverseTranspose() const
- {
- return getUpper3x3().getInverse().getTranspose();
- }
-
- // Data, see above for format!
-
- QT3DSVec4 column0, column1, column2, column3; // the four base vectors
-};
-
-// implementation from Qt3DSTransform.h
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform::NVTransform(const QT3DSMat44 &m)
-{
- QT3DSVec3 column0 = QT3DSVec3(m.column0.x, m.column0.y, m.column0.z);
- QT3DSVec3 column1 = QT3DSVec3(m.column1.x, m.column1.y, m.column1.z);
- QT3DSVec3 column2 = QT3DSVec3(m.column2.x, m.column2.y, m.column2.z);
-
- q = QT3DSQuat(QT3DSMat33(column0, column1, column2));
- p = QT3DSVec3(m.column3.x, m.column3.y, m.column3.z);
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_MAT44_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMath.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMath.h
deleted file mode 100644
index 931852e7..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMath.h
+++ /dev/null
@@ -1,323 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_MATH_H
-#define QT3DS_FOUNDATION_QT3DS_MATH_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include <math.h>
-#include <float.h>
-#include <stdlib.h>
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSAssert.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-// constants
-static const NVReal NVPi = NVReal(3.141592653589793);
-static const NVReal NVHalfPi = NVReal(1.57079632679489661923);
-static const NVReal NVTwoPi = NVReal(6.28318530717958647692);
-static const NVReal NVInvPi = NVReal(0.31830988618379067154);
-
-/**
-\brief The return value is the greater of the two specified values.
-*/
-template <class T>
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE T NVMax(T a, T b)
-{
- return a < b ? b : a;
-}
-
-//! overload for float to use fsel on xbox
-template <>
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float NVMax(float a, float b)
-{
- return intrinsics::selectMax(a, b);
-}
-
-/**
-\brief The return value is the lesser of the two specified values.
-*/
-template <class T>
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE T NVMin(T a, T b)
-{
- return a < b ? a : b;
-}
-
-template <>
-//! overload for float to use fsel on xbox
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float NVMin(float a, float b)
-{
- return intrinsics::selectMin(a, b);
-}
-
-/*
-Many of these are just implemented as QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE calls to the C lib right now,
-but later we could replace some of them with some approximations or more
-clever stuff.
-*/
-
-/**
-\brief abs returns the absolute value of its argument.
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVAbs(QT3DSF32 a)
-{
- return intrinsics::abs(a);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVEquals(QT3DSF32 a, QT3DSF32 b, QT3DSF32 epsilon)
-{
- return (NVAbs(a - b) < epsilon);
-}
-
-/**
-\brief abs returns the absolute value of its argument.
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVAbs(QT3DSF64 a)
-{
- return ::fabs(a);
-}
-
-/**
-\brief abs returns the absolute value of its argument.
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSI32 NVAbs(QT3DSI32 a)
-{
- return ::abs(a);
-}
-
-/**
-\brief Clamps v to the range [hi,lo]
-*/
-template <class T>
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE T NVClamp(T v, T lo, T hi)
-{
- QT3DS_ASSERT(lo <= hi);
- return NVMin(hi, NVMax(lo, v));
-}
-
-//! \brief Square root.
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVSqrt(QT3DSF32 a)
-{
- return intrinsics::sqrt(a);
-}
-
-//! \brief Square root.
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVSqrt(QT3DSF64 a)
-{
- return ::sqrt(a);
-}
-
-//! \brief reciprocal square root.
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVRecipSqrt(QT3DSF32 a)
-{
- return intrinsics::recipSqrt(a);
-}
-
-//! \brief reciprocal square root.
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVRecipSqrt(QT3DSF64 a)
-{
- return 1 / ::sqrt(a);
-}
-
-//!trigonometry -- all angles are in radians.
-
-//! \brief Sine of an angle ( <b>Unit:</b> Radians )
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVSin(QT3DSF32 a)
-{
- return intrinsics::sin(a);
-}
-
-//! \brief Sine of an angle ( <b>Unit:</b> Radians )
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVSin(QT3DSF64 a)
-{
- return ::sin(a);
-}
-
-//! \brief Cosine of an angle (<b>Unit:</b> Radians)
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVCos(QT3DSF32 a)
-{
- return intrinsics::cos(a);
-}
-
-//! \brief Cosine of an angle (<b>Unit:</b> Radians)
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVCos(QT3DSF64 a)
-{
- return ::cos(a);
-}
-
-/**
-\brief Tangent of an angle.
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVTan(QT3DSF32 a)
-{
- return QT3DSF32(::tan(a));
-}
-
-/**
-\brief Tangent of an angle.
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVTan(QT3DSF64 a)
-{
- return ::tan(a);
-}
-
-/**
-\brief Arcsine.
-Returns angle between -PI/2 and PI/2 in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVAsin(QT3DSF32 f)
-{
- return QT3DSF32(::asin(NVClamp(f, -1.0f, 1.0f)));
-}
-
-/**
-\brief Arcsine.
-Returns angle between -PI/2 and PI/2 in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVAsin(QT3DSF64 f)
-{
- return ::asin(NVClamp(f, -1.0, 1.0));
-}
-
-/**
-\brief Arccosine.
-Returns angle between 0 and PI in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVAcos(QT3DSF32 f)
-{
- return QT3DSF32(::acos(NVClamp(f, -1.0f, 1.0f)));
-}
-
-/**
-\brief Arccosine.
-Returns angle between 0 and PI in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVAcos(QT3DSF64 f)
-{
- return ::acos(NVClamp(f, -1.0, 1.0));
-}
-
-/**
-\brief ArcTangent.
-Returns angle between -PI/2 and PI/2 in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVAtan(QT3DSF32 a)
-{
- return QT3DSF32(::atan(a));
-}
-
-/**
-\brief ArcTangent.
-Returns angle between -PI/2 and PI/2 in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVAtan(QT3DSF64 a)
-{
- return ::atan(a);
-}
-
-/**
-\brief Arctangent of (x/y) with correct sign.
-Returns angle between -PI and PI in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVAtan2(QT3DSF32 x, QT3DSF32 y)
-{
- return QT3DSF32(::atan2(x, y));
-}
-
-/**
-\brief Arctangent of (x/y) with correct sign.
-Returns angle between -PI and PI in radians
-<b>Unit:</b> Radians
-*/
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 NVAtan2(QT3DSF64 x, QT3DSF64 y)
-{
- return ::atan2(x, y);
-}
-
-//! \brief returns true if the passed number is a finite floating point number as opposed to INF, NAN, etc.
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVIsFinite(QT3DSF32 f)
-{
- return intrinsics::isFinite(f);
-}
-
-//! \brief returns true if the passed number is a finite floating point number as opposed to INF, NAN, etc.
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool NVIsFinite(QT3DSF64 f)
-{
- return intrinsics::isFinite(f);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVFloor(QT3DSF32 a)
-{
- return ::floorf(a);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVExp(QT3DSF32 a)
-{
- return ::expf(a);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVCeil(QT3DSF32 a)
-{
- return ::ceilf(a);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVSign(QT3DSF32 a)
-{
- return qt3ds::intrinsics::sign(a);
-}
-
-QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 NVPow(QT3DSF32 x, QT3DSF32 y)
-{
- return ::powf(x, y);
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_MATH_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.cpp b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.cpp
deleted file mode 100644
index 7eee7405..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSMathUtils.h"
-#include "foundation/Qt3DSUtilities.h"
-#include "foundation/Qt3DSMat33.h"
-
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::intrinsics;
-
-QT3DSQuat qt3ds::foundation::computeQuatFromNormal(const QT3DSVec3 &n)
-{
- // parallel or anti-parallel
- if (n.x > 0.9999f) {
- // parallel
- return QT3DSQuat::createIdentity();
- } else if (n.x < -0.9999f) {
- // anti-parallel
- // contactQuaternion.fromAngleAxisFast(PXD_PI, Vector3(0.0f, 1.0f, 0.0f));
- return QT3DSQuat(0.0f, 1.0f, 0.0f, 0.0f);
- } else {
- QT3DSVec3 rotVec(0.0f, -n.z, n.y);
-
- // Convert to quat
- NVReal angle = rotVec.magnitude();
- rotVec *= 1.0f / angle;
- // if(angle > 1.0f) angle = 1.0f;
- angle = selectMin(angle, 1.0f);
-
- // djs: injudiciously imbecilic use of trig functions, good thing Adam is going to trample
- // this path like a
- // frustrated rhinoceros in mating season
-
- angle = NVAsin(angle);
-
- // if(n.x < 0)
- // angle = NVPi - angle;
- angle = fsel(n.x, angle, NVPi - angle);
-
- return QT3DSQuat(angle, rotVec);
- }
-}
-
-/**
-\brief computes a oriented bounding box around the scaled basis.
-\param basis Input = skewed basis, Output = (normalized) orthogonal basis.
-\return Bounding box extent.
-*/
-QT3DSVec3 qt3ds::foundation::optimizeBoundingBox(QT3DSMat33 &basis)
-{
- QT3DSVec3 *QT3DS_RESTRICT vec = &basis[0]; // PT: don't copy vectors if not needed...
-
- // PT: since we store the magnitudes to memory, we can avoid the FCMNV afterwards
- QT3DSVec3 magnitude(vec[0].magnitudeSquared(), vec[1].magnitudeSquared(),
- vec[2].magnitudeSquared());
-
-// find indices sorted by magnitude
-#ifdef QT3DS_X360
- int i = (QT3DSU32 &)(magnitude[1]) > (QT3DSU32 &)(magnitude[0]) ? 1 : 0;
- int j = (QT3DSU32 &)(magnitude[2]) > (QT3DSU32 &)(magnitude[1 - i]) ? 2 : 1 - i;
-#else
- int i = magnitude[1] > magnitude[0] ? 1 : 0;
- int j = magnitude[2] > magnitude[1 - i] ? 2 : 1 - i;
-#endif
- const int k = 3 - i - j;
-#ifdef QT3DS_X360
- if ((QT3DSU32 &)(magnitude[i]) < (QT3DSU32 &)(magnitude[j]))
-#else
- if (magnitude[i] < magnitude[j])
-#endif
- swap(i, j);
-
- // ortho-normalize basis
-
- NVReal invSqrt = NVRecipSqrt(magnitude[i]);
- magnitude[i] *= invSqrt;
- vec[i] *= invSqrt; // normalize the first axis
- NVReal dotij = vec[i].dot(vec[j]);
- NVReal dotik = vec[i].dot(vec[k]);
- magnitude[i] += NVAbs(dotij) + NVAbs(dotik); // elongate the axis by projection of the other two
- vec[j] -= vec[i] * dotij; // orthogonize the two remaining axii relative to vec[i]
- vec[k] -= vec[i] * dotik;
-
- magnitude[j] = vec[j].normalize();
- NVReal dotjk = vec[j].dot(vec[k]);
- magnitude[j] += NVAbs(dotjk); // elongate the axis by projection of the other one
- vec[k] -= vec[j] * dotjk; // orthogonize vec[k] relative to vec[j]
-
- magnitude[k] = vec[k].normalize();
-
- return magnitude;
-}
-
-QT3DSQuat qt3ds::foundation::slerp(const NVReal t, const QT3DSQuat &left, const QT3DSQuat &right)
-{
- const NVReal quatEpsilon = (NVReal(1.0e-8f));
-
- NVReal cosine = left.dot(right);
- NVReal sign = NVReal(1);
- if (cosine < 0) {
- cosine = -cosine;
- sign = NVReal(-1);
- }
-
- NVReal sine = NVReal(1) - cosine * cosine;
-
- if (sine >= quatEpsilon * quatEpsilon) {
- sine = NVSqrt(sine);
- const NVReal angle = NVAtan2(sine, cosine);
- const NVReal i_sin_angle = NVReal(1) / sine;
-
- const NVReal leftw = NVSin(angle * (NVReal(1) - t)) * i_sin_angle;
- const NVReal rightw = NVSin(angle * t) * i_sin_angle * sign;
-
- return left * leftw + right * rightw;
- }
-
- return left;
-}
-
-void qt3ds::foundation::integrateTransform(const NVTransform &curTrans, const QT3DSVec3 &linvel,
- const QT3DSVec3 &angvel, NVReal timeStep, NVTransform &result)
-{
- result.p = curTrans.p + linvel * timeStep;
-
- // from void NVsDynamicsContext::integrateAtomPose(NVsRigidBody* atom, Cm::BitMap
- // &shapeChangedMap) const:
- // Integrate the rotation using closed form quaternion integrator
- NVReal w = angvel.magnitudeSquared();
-
- if (w != 0.0f) {
- w = NVSqrt(w);
- if (w != 0.0f) {
- const NVReal v = timeStep * w * 0.5f;
- const NVReal q = NVCos(v);
- const NVReal s = NVSin(v) / w;
-
- const QT3DSVec3 pqr = angvel * s;
- const QT3DSQuat quatVel(pqr.x, pqr.y, pqr.z, 0);
- QT3DSQuat out; // need to have temporary, otherwise we may overwrite input if &curTrans ==
- // &result.
- out = quatVel * curTrans.q;
- out.x += curTrans.q.x * q;
- out.y += curTrans.q.y * q;
- out.z += curTrans.q.z * q;
- out.w += curTrans.q.w * q;
- result.q = out;
- return;
- }
- }
- // orientation stays the same - convert from quat to matrix:
- result.q = curTrans.q;
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.h
deleted file mode 100644
index 6d3d0abc..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMathUtils.h
+++ /dev/null
@@ -1,571 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSMATHUTILS_H
-#define QT3DS_FOUNDATION_PSMATHUTILS_H
-
-#include "foundation/Qt3DSTransform.h"
-#include "foundation/Qt3DSMat33.h"
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include <stdlib.h>
-
-// General guideline is: if it's an abstract math function, it belongs here.
-// If it's a math function where the inputs have specific semantics (e.g.
-// separateSwingTwist) it doesn't.
-
-namespace qt3ds {
-namespace foundation {
- using namespace intrinsics;
- /**
- \brief sign returns the sign of its argument. The sign of zero is undefined.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 sign(const QT3DSF32 a) {
- return intrinsics::sign(a);
- }
-
- /**
- \brief sign returns the sign of its argument. The sign of zero is undefined.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 sign(const QT3DSF64 a) { return (a >= 0.0) ? 1.0 : -1.0; }
-
- /**
- \brief sign returns the sign of its argument. The sign of zero is undefined.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSI32 sign(const QT3DSI32 a) { return (a >= 0) ? 1 : -1; }
-
- /**
- \brief Returns true if the two numbers are within eps of each other.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool equals(const QT3DSF32 a, const QT3DSF32 b, const QT3DSF32 eps)
- {
- return (NVAbs(a - b) < eps);
- }
-
- /**
- \brief Returns true if the two numbers are within eps of each other.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool equals(const QT3DSF64 a, const QT3DSF64 b, const QT3DSF64 eps)
- {
- return (NVAbs(a - b) < eps);
- }
-
- /**
- \brief The floor function returns a floating-point value representing the largest integer that
- is less than or equal to x.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 floor(const QT3DSF32 a) { return floatFloor(a); }
-
- /**
- \brief The floor function returns a floating-point value representing the largest integer that
- is less than or equal to x.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 floor(const QT3DSF64 a) { return ::floor(a); }
-
- /**
- \brief The ceil function returns a single value representing the smallest integer that is
- greater than or equal to x.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 ceil(const QT3DSF32 a) { return ::ceilf(a); }
-
- /**
- \brief The ceil function returns a double value representing the smallest integer that is
- greater than or equal to x.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 ceil(const QT3DSF64 a) { return ::ceil(a); }
-
- /**
- \brief mod returns the floating-point remainder of x / y.
-
- If the value of y is 0.0, mod returns a quiet NaN.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 mod(const QT3DSF32 x, const QT3DSF32 y)
- {
- return (QT3DSF32)::fmod(x, y);
- }
-
- /**
- \brief mod returns the floating-point remainder of x / y.
-
- If the value of y is 0.0, mod returns a quiet NaN.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 mod(const QT3DSF64 x, const QT3DSF64 y)
- {
- return ::fmod(x, y);
- }
-
- /**
- \brief Square.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 sqr(const QT3DSF32 a) { return a * a; }
-
- /**
- \brief Square.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 sqr(const QT3DSF64 a) { return a * a; }
-
- /**
- \brief Calculates x raised to the power of y.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 pow(const QT3DSF32 x, const QT3DSF32 y)
- {
- return ::powf(x, y);
- }
-
- /**
- \brief Calculates x raised to the power of y.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 pow(const QT3DSF64 x, const QT3DSF64 y) { return ::pow(x, y); }
-
- /**
- \brief Calculates e^n
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 exp(const QT3DSF32 a) { return QT3DSF32(::exp(a)); }
- /**
-
- \brief Calculates e^n
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 exp(const QT3DSF64 a) { return ::exp(a); }
-
- /**
- \brief Calculates logarithms.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 logE(const QT3DSF32 a) { return QT3DSF32(::log(a)); }
-
- /**
- \brief Calculates logarithms.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 logE(const QT3DSF64 a) { return ::log(a); }
-
- /**
- \brief Calculates logarithms.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 log2(const QT3DSF32 a)
- {
- return QT3DSF32(::log(a)) / 0.693147180559945309417f;
- }
-
- /**
- \brief Calculates logarithms.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 log2(const QT3DSF64 a)
- {
- return ::log(a) / 0.693147180559945309417;
- }
-
- /**
- \brief Calculates logarithms.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 log10(const QT3DSF32 a) { return (QT3DSF32)::log10(a); }
-
- /**
- \brief Calculates logarithms.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 log10(const QT3DSF64 a) { return ::log10(a); }
-
- /**
- \brief Converts degrees to radians.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 degToRad(const QT3DSF32 a)
- {
- return (QT3DSF32)0.01745329251994329547 * a;
- }
-
- /**
- \brief Converts degrees to radians.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 degToRad(const QT3DSF64 a)
- {
- return (QT3DSF64)0.01745329251994329547 * a;
- }
-
- /**
- \brief Converts radians to degrees.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 radToDeg(const QT3DSF32 a)
- {
- return (QT3DSF32)57.29577951308232286465 * a;
- }
-
- /**
- \brief Converts radians to degrees.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF64 radToDeg(const QT3DSF64 a)
- {
- return (QT3DSF64)57.29577951308232286465 * a;
- }
-
- //! \brief compute sine and cosine at the same time. There is a 'fsincos' on PC that we probably want to use here
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void sincos(const QT3DSF32 radians, QT3DSF32 &sin, QT3DSF32 &cos)
- {
- /* something like:
- _asm fld Local
- _asm fsincos
- _asm fstp LocalCos
- _asm fstp LocalSin
- */
- sin = NVSin(radians);
- cos = NVCos(radians);
- }
-
- /**
- \brief uniform random number in [a,b]
- */
- QT3DS_FORCE_INLINE QT3DSI32 rand(const QT3DSI32 a, const QT3DSI32 b)
- {
- return a + (QT3DSI32)(::rand() % (b - a + 1));
- }
-
- /**
- \brief uniform random number in [a,b]
- */
- QT3DS_FORCE_INLINE QT3DSF32 rand(const QT3DSF32 a, const QT3DSF32 b)
- {
- return a + (b - a) * ::rand() / RAND_MAX;
- }
-
- //! \brief return angle between two vectors in radians
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSF32 angle(const QT3DSVec3 &v0, const QT3DSVec3 &v1)
- {
- const QT3DSF32 cos = v0.dot(v1); // |v0|*|v1|*Cos(Angle)
- const QT3DSF32 sin = (v0.cross(v1)).magnitude(); // |v0|*|v1|*Sin(Angle)
- return NVAtan2(sin, cos);
- }
-
- //! If possible use instead fsel on the dot product /*fsel(d.dot(p),onething,anotherthing);*/
- //! Compares orientations (more readable, user-friendly function)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool sameDirection(const QT3DSVec3 &d, const QT3DSVec3 &p)
- {
- return d.dot(p) >= 0.0f;
- }
-
- //! Checks 2 values have different signs
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE IntBool differentSign(NVReal f0, NVReal f1)
- {
- union {
- QT3DSU32 u;
- NVReal f;
- } u1, u2;
- u1.f = f0;
- u2.f = f1;
- return (u1.u ^ u2.u) & QT3DS_SIGN_BITMASK;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSMat33 star(const QT3DSVec3 &v)
- {
- return QT3DSMat33(QT3DSVec3(0, v.z, -v.y), QT3DSVec3(-v.z, 0, v.x), QT3DSVec3(v.y, -v.x, 0));
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 log(const QT3DSQuat &q)
- {
- const NVReal s = q.getImaginaryPart().magnitude();
- if (s < 1e-12)
- return QT3DSVec3(0.0f);
- // force the half-angle to have magnitude <= pi/2
- NVReal halfAngle = q.w < 0 ? NVAtan2(-s, -q.w) : NVAtan2(s, q.w);
- QT3DS_ASSERT(halfAngle >= -NVPi / 2 && halfAngle <= NVPi / 2);
-
- return q.getImaginaryPart().getNormalized() * 2 * halfAngle;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat exp(const QT3DSVec3 &v)
- {
- const NVReal m = v.magnitudeSquared();
- return m < 1e-24 ? QT3DSQuat::createIdentity() : QT3DSQuat(NVSqrt(m), v * NVRecipSqrt(m));
- }
-
- // quat to rotate v0 t0 v1
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat rotationArc(const QT3DSVec3 &v0, const QT3DSVec3 &v1)
- {
- const QT3DSVec3 cross = v0.cross(v1);
- const NVReal d = v0.dot(v1);
- if (d <= -0.99999f)
- return (NVAbs(v0.x) < 0.1f ? QT3DSQuat(0.0f, v0.z, -v0.y, 0.0f)
- : QT3DSQuat(v0.y, -v0.x, 0.0, 0.0))
- .getNormalized();
-
- const NVReal s = NVSqrt((1 + d) * 2), r = 1 / s;
-
- return QT3DSQuat(cross.x * r, cross.y * r, cross.z * r, s * 0.5f).getNormalized();
- }
-
- //! Computes the maximum delta to another transform
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal maxComponentDelta(const NVTransform &t0,
- const NVTransform &t1)
- {
- NVReal delta = NVAbs(t0.p.x - t1.p.x);
- delta = NVMax(delta, NVAbs(t0.p.y - t1.p.y));
- delta = NVMax(delta, NVAbs(t0.p.z - t1.p.z));
- delta = NVMax(delta, NVAbs(t0.q.x - t1.q.x));
- delta = NVMax(delta, NVAbs(t0.q.y - t1.q.y));
- delta = NVMax(delta, NVAbs(t0.q.z - t1.q.z));
- delta = NVMax(delta, NVAbs(t0.q.w - t1.q.w));
-
- return delta;
- }
-
- /**
- \brief returns largest axis
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSU32 largestAxis(const QT3DSVec3 &v)
- {
- QT3DSU32 m = v.y > v.x ? 1 : 0;
- return v.z > v[m] ? 2 : m;
- }
-
- /**
- \brief returns axis with smallest absolute value
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSU32 closestAxis(const QT3DSVec3 &v)
- {
- QT3DSU32 m = NVAbs(v.y) > NVAbs(v.x) ? 1 : 0;
- return NVAbs(v.z) > NVAbs(v[m]) ? 2 : m;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSU32 closestAxis(const QT3DSVec3 &v, QT3DSU32 &j, QT3DSU32 &k)
- {
- // find largest 2D plane projection
- const QT3DSF32 absNV = NVAbs(v.x);
- const QT3DSF32 absNy = NVAbs(v.y);
- const QT3DSF32 absNz = NVAbs(v.z);
-
- QT3DSU32 m = 0; // x biggest axis
- j = 1;
- k = 2;
- if (absNy > absNV && absNy > absNz) {
- // y biggest
- j = 2;
- k = 0;
- m = 1;
- } else if (absNz > absNV) {
- // z biggest
- j = 0;
- k = 1;
- m = 2;
- }
- return m;
- }
-
- /*!
- Extend an edge along its length by a factor
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void makeFatEdge(QT3DSVec3 &p0, QT3DSVec3 &p1, NVReal fatCoeff)
- {
- QT3DSVec3 delta = p1 - p0;
-
- const NVReal m = delta.magnitude();
- if (m > 0.0f) {
- delta *= fatCoeff / m;
- p0 -= delta;
- p1 += delta;
- }
- }
-
- //! Compute point as combination of barycentric coordinates
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 computeBarycentricPoint(const QT3DSVec3 &p0,
- const QT3DSVec3 &p1,
- const QT3DSVec3 &p2, NVReal u,
- NVReal v)
- {
- // This seems to confuse the compiler...
- // return (1.0f - u - v)*p0 + u*p1 + v*p2;
- const QT3DSF32 w = 1.0f - u - v;
- return QT3DSVec3(w * p0.x + u * p1.x + v * p2.x, w * p0.y + u * p1.y + v * p2.y,
- w * p0.z + u * p1.z + v * p2.z);
- }
-
- // generates a pair of quaternions (swing, twist) such that in = swing * twist, with
- // swing.x = 0
- // twist.y = twist.z = 0, and twist is a unit quat
- QT3DS_FORCE_INLINE void separateSwingTwist(const QT3DSQuat &q, QT3DSQuat &swing, QT3DSQuat &twist)
- {
- twist = q.x != 0.0f ? QT3DSQuat(q.x, 0, 0, q.w).getNormalized() : QT3DSQuat::createIdentity();
- swing = q * twist.getConjugate();
- }
-
- // generate two tangent vectors to a given normal
- QT3DS_FORCE_INLINE void normalToTangents(const QT3DSVec3 &normal, QT3DSVec3 &tangent0, QT3DSVec3 &tangent1)
- {
- tangent0 = NVAbs(normal.x) < 0.70710678f ? QT3DSVec3(0, -normal.z, normal.y)
- : QT3DSVec3(-normal.y, normal.x, 0);
- tangent0.normalize();
- tangent1 = normal.cross(tangent0);
- }
-
- // todo: what is this function doing?
- QT3DS_FOUNDATION_API QT3DSQuat computeQuatFromNormal(const QT3DSVec3 &n);
-
- /**
- \brief computes a oriented bounding box around the scaled basis.
- \param basis Input = skewed basis, Output = (normalized) orthogonal basis.
- \return Bounding box extent.
- */
- QT3DS_FOUNDATION_API QT3DSVec3 optimizeBoundingBox(QT3DSMat33 &basis);
-
- QT3DS_FOUNDATION_API QT3DSQuat slerp(const NVReal t, const QT3DSQuat &left, const QT3DSQuat &right);
-
- QT3DS_INLINE QT3DSVec3 ellipseClamp(const QT3DSVec3 &point, const QT3DSVec3 &radii)
- {
- // This function need to be implemented in the header file because
- // it is included in a spu shader program.
-
- // finds the closest point on the ellipse to a given point
-
- // (p.y, p.z) is the input point
- // (e.y, e.z) are the radii of the ellipse
-
- // lagrange multiplier method with Newton/Halley hybrid root-finder.
- // see http://www.geometrictools.com/Documentation/DistancePointToEllipse2.pdf
- // for proof of Newton step robustness and initial estimate.
- // Halley converges much faster but sometimes overshoots - when that happens we take
- // a newton step instead
-
- // converges in 1-2 iterations where D&C works well, and it's good with 4 iterations
- // with any ellipse that isn't completely crazy
-
- const QT3DSU32 MAX_ITERATIONS = 20;
- const NVReal convergenceThreshold = 1e-4f;
-
- // iteration requires first quadrant but we recover generality later
-
- QT3DSVec3 q(0, NVAbs(point.y), NVAbs(point.z));
- const NVReal tinyEps =
- (NVReal)(1e-6f); // very close to minor axis is numerically problematic but trivial
- if (radii.y >= radii.z) {
- if (q.z < tinyEps)
- return QT3DSVec3(0, point.y > 0 ? radii.y : -radii.y, 0);
- } else {
- if (q.y < tinyEps)
- return QT3DSVec3(0, 0, point.z > 0 ? radii.z : -radii.z);
- }
-
- QT3DSVec3 denom, e2 = radii.multiply(radii), eq = radii.multiply(q);
-
- // we can use any initial guess which is > maximum(-e.y^2,-e.z^2) and for which f(t) is > 0.
- // this guess works well near the axes, but is weak along the diagonals.
-
- NVReal t = NVMax(eq.y - e2.y, eq.z - e2.z);
-
- for (QT3DSU32 i = 0; i < MAX_ITERATIONS; i++) {
- denom = QT3DSVec3(0, 1 / (t + e2.y), 1 / (t + e2.z));
- QT3DSVec3 denom2 = eq.multiply(denom);
-
- QT3DSVec3 fv = denom2.multiply(denom2);
- NVReal f = fv.y + fv.z - 1;
-
- // although in exact arithmetic we are guaranteed f>0, we can get here
- // on the first iteration via catastrophic cancellation if the point is
- // very close to the origin. In that case we just behave as if f=0
-
- if (f < convergenceThreshold)
- return e2.multiply(point).multiply(denom);
-
- NVReal df = fv.dot(denom) * -2.0f;
- t = t - f / df;
- }
-
- // we didn't converge, so clamp what we have
- QT3DSVec3 r = e2.multiply(point).multiply(denom);
- return r * NVRecipSqrt(sqr(r.y / radii.y) + sqr(r.z / radii.z));
- }
-
- QT3DS_INLINE NVReal tanHalf(NVReal sin, NVReal cos) { return sin / (1 + cos); }
-
- QT3DS_INLINE QT3DSQuat quatFromTanQVector(const QT3DSVec3 &v)
- {
- NVReal v2 = v.dot(v);
- if (v2 < 1e-12f)
- return QT3DSQuat::createIdentity();
- NVReal d = 1 / (1 + v2);
- return QT3DSQuat(v.x * 2, v.y * 2, v.z * 2, 1 - v2) * d;
- }
-
- QT3DS_FORCE_INLINE QT3DSVec3 cross100(const QT3DSVec3 &b) { return QT3DSVec3(0.0f, -b.z, b.y); }
- QT3DS_FORCE_INLINE QT3DSVec3 cross010(const QT3DSVec3 &b) { return QT3DSVec3(b.z, 0.0f, -b.x); }
- QT3DS_FORCE_INLINE QT3DSVec3 cross001(const QT3DSVec3 &b) { return QT3DSVec3(-b.y, b.x, 0.0f); }
-
- QT3DS_INLINE void decomposeVector(QT3DSVec3 &normalCompo, QT3DSVec3 &tangentCompo,
- const QT3DSVec3 &outwardDir, const QT3DSVec3 &outwardNormal)
- {
- normalCompo = outwardNormal * (outwardDir.dot(outwardNormal));
- tangentCompo = outwardDir - normalCompo;
- }
-
- //! \brief Return (i+1)%3
- // Avoid variable shift for XBox:
- // QT3DS_INLINE QT3DSU32 NV::getNextIndex3(QT3DSU32 i) { return (1<<i) & 3;
- // }
- QT3DS_INLINE QT3DSU32 getNextIndex3(QT3DSU32 i) { return (i + 1 + (i >> 1)) & 3; }
-
- QT3DS_INLINE QT3DSMat33 rotFrom2Vectors(const QT3DSVec3 &from, const QT3DSVec3 &to)
- {
- // See bottom of
- // http://www.euclideanspace.com/maths/algebra/matrix/orthogonal/rotation/index.htm
-
- // Early exit if to = from
- if ((from - to).magnitudeSquared() < 1e-4f)
- return QT3DSMat33::createIdentity();
-
- // Early exit if to = -from
- if ((from + to).magnitudeSquared() < 1e-4f)
- return QT3DSMat33::createDiagonal(QT3DSVec3(1.0f, -1.0f, -1.0f));
-
- QT3DSVec3 n = from.cross(to);
-
- NVReal C = from.dot(to), S = NVSqrt(1 - C * C), CC = 1 - C;
-
- NVReal xx = n.x * n.x, yy = n.y * n.y, zz = n.z * n.z, xy = n.x * n.y, yz = n.y * n.z,
- xz = n.x * n.z;
-
- QT3DSMat33 R;
-
- R(0, 0) = 1 + CC * (xx - 1);
- R(0, 1) = -n.z * S + CC * xy;
- R(0, 2) = n.y * S + CC * xz;
-
- R(1, 0) = n.z * S + CC * xy;
- R(1, 1) = 1 + CC * (yy - 1);
- R(1, 2) = -n.x * S + CC * yz;
-
- R(2, 0) = -n.y * S + CC * xz;
- R(2, 1) = n.x * S + CC * yz;
- R(2, 2) = 1 + CC * (zz - 1);
-
- return R;
- }
-
- QT3DS_FOUNDATION_API void integrateTransform(const NVTransform &curTrans, const QT3DSVec3 &linvel,
- const QT3DSVec3 &angvel, NVReal timeStep,
- NVTransform &result);
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMemoryBuffer.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMemoryBuffer.h
deleted file mode 100644
index bee2f0c2..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMemoryBuffer.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_MEMORYBUFFER_H
-#define QT3DS_FOUNDATION_MEMORYBUFFER_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSIntrinsics.h"
-
-#ifdef __INTEGRITY
-#define __restrict
-#endif
-
-namespace qt3ds {
-namespace foundation {
- using namespace intrinsics;
-
- template <typename TAllocator = ForwardingAllocator>
- class MemoryBuffer : public TAllocator
- {
- QT3DSU8 *mBegin;
- QT3DSU8 *mEnd;
- QT3DSU8 *mCapacityEnd;
-
- public:
- MemoryBuffer(const TAllocator &inAlloc = TAllocator())
- : TAllocator(inAlloc)
- , mBegin(0)
- , mEnd(0)
- , mCapacityEnd(0)
- {
- }
- ~MemoryBuffer()
- {
- if (mBegin)
- TAllocator::deallocate(mBegin);
- }
- QT3DSU32 size() const { return static_cast<QT3DSU32>(mEnd - mBegin); }
- QT3DSU32 capacity() const { return static_cast<QT3DSU32>(mCapacityEnd - mBegin); }
- QT3DSU8 *begin() { return mBegin; }
- QT3DSU8 *end() { return mEnd; }
- const QT3DSU8 *begin() const { return mBegin; }
- const QT3DSU8 *end() const { return mEnd; }
- void clear() { mEnd = mBegin; }
- void write(QT3DSU8 inValue) { *growBuf(1) = inValue; }
-
- template <typename TDataType>
- void write(const TDataType &inValue)
- {
- const QT3DSU8 *__restrict readPtr = reinterpret_cast<const QT3DSU8 *>(&inValue);
- QT3DSU8 *__restrict writePtr = growBuf(sizeof(TDataType));
- for (QT3DSU32 idx = 0; idx < sizeof(TDataType); ++idx)
- writePtr[idx] = readPtr[idx];
- }
-
- template <typename TDataType>
- void write(const TDataType *inValue, QT3DSU32 inLength)
- {
- using namespace qt3ds::intrinsics;
- if (inValue && inLength) {
- QT3DSU32 writeSize = inLength * sizeof(TDataType);
- memCopy(growBuf(writeSize), inValue, writeSize);
- }
- if (inLength && !inValue) {
- QT3DS_ASSERT(false);
- // You can't not write something, because that will cause
- // the receiving end to crash.
- QT3DSU32 writeSize = inLength * sizeof(TDataType);
- for (QT3DSU32 idx = 0; idx < writeSize; ++idx)
- write((QT3DSU8)0);
- }
- }
-
- void writeStrided(const QT3DSU8 *__restrict inData, QT3DSU32 inItemSize, QT3DSU32 inLength,
- QT3DSU32 inStride)
- {
- if (inStride == 0 || inStride == inItemSize)
- write(inData, inLength * inItemSize);
- else if (inData && inLength) {
- QT3DSU32 writeSize = inLength * inItemSize;
- QT3DSU8 *__restrict writePtr = growBuf(writeSize);
- for (QT3DSU32 idx = 0; idx < inLength;
- ++idx, writePtr += inItemSize, inData += inStride)
- memCopy(writePtr, inData, inItemSize);
- }
- }
- QT3DSU8 *growBuf(QT3DSU32 inAmount)
- {
- QT3DSU32 offset = size();
- QT3DSU32 newSize = offset + inAmount;
- reserve(newSize);
- mEnd += inAmount;
- return mBegin + offset;
- }
- void writeZeros(QT3DSU32 inAmount)
- {
- QT3DSU32 offset = size();
- growBuf(inAmount);
- qt3ds::foundation::memZero(begin() + offset, inAmount);
- }
- void align(QT3DSU32 inAmount)
- {
- QT3DSU32 leftover = size() % inAmount;
- if (leftover)
- writeZeros(inAmount - leftover);
- }
- void reserve(QT3DSU32 newSize)
- {
- using namespace qt3ds::intrinsics;
- QT3DSU32 currentSize = size();
- if (newSize && newSize >= capacity()) {
- QT3DSU32 newDataSize = newSize * 2;
- if (newDataSize > 8192)
- newDataSize = (QT3DSU32)((QT3DSU32)newSize * 1.2f);
- QT3DSU8 *newData =
- static_cast<QT3DSU8 *>(TAllocator::allocate(newDataSize, __FILE__, __LINE__));
- if (mBegin) {
- memCopy(newData, mBegin, currentSize);
- TAllocator::deallocate(mBegin);
- }
- mBegin = newData;
- mEnd = mBegin + currentSize;
- mCapacityEnd = mBegin + newDataSize;
- }
- }
- operator NVDataRef<QT3DSU8>() { return NVDataRef<QT3DSU8>(begin(), size()); }
- operator NVConstDataRef<QT3DSU8>() const { return NVConstDataRef<QT3DSU8>(begin(), size()); }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMutex.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSMutex.h
deleted file mode 100644
index 5b717e5c..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSMutex.h
+++ /dev/null
@@ -1,376 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSMUTEX_H
-#define QT3DS_FOUNDATION_PSMUTEX_H
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSNoCopy.h"
-
-/*
- * This <new> inclusion is a best known fix for gcc 4.4.1 error:
- * Creating object file for apex/src/NVAllocator.cpp ...
- * In file included from apex/include/Qt3DSFoundation.h:30,
- * from apex/src/NVAllocator.cpp:26:
- * apex/include/Qt3DSMutex.h: In constructor 'nv::foundation::MutexT<Alloc>::MutexT(const Alloc&)':
- * apex/include/Qt3DSMutex.h:92: error: no matching function for call to 'operator new(unsigned int,
- * qt3ds::foundation::MutexImpl*&)'
- * <built-in>:0: note: candidates are: void* operator new(unsigned int)
- */
-#include <new>
-
-namespace qt3ds {
-namespace foundation {
-#ifdef QT3DS_FOUNDATION_NO_EXPORTS
- class QT3DS_AUTOTEST_EXPORT MutexImpl
-#else
- class QT3DS_FOUNDATION_API MutexImpl
-#endif
- {
- public:
- /**
- The constructor for Mutex creates a mutex. It is initially unlocked.
- */
- MutexImpl();
-
- /**
- The destructor for Mutex deletes the mutex.
- */
- ~MutexImpl();
-
- /**
- Acquire (lock) the mutex. If the mutex is already locked
- by another thread, this method blocks until the mutex is
- unlocked.
- */
- bool lock();
-
- /**
- Acquire (lock) the mutex. If the mutex is already locked
- by another thread, this method returns false without blocking.
- */
- bool trylock();
-
- /**
- Release (unlock) the mutex.
- */
- bool unlock();
-
- /**
- Size of this class.
- */
- static const QT3DSU32 size;
- };
-
- class Mutex
- {
- public:
- class ScopedLock : private NoCopy
- {
- Mutex &mMutex;
-
- public:
- QT3DS_INLINE ScopedLock(Mutex &mutex)
- : mMutex(mutex)
- {
- mMutex.lock();
- }
- QT3DS_INLINE ~ScopedLock() { mMutex.unlock(); }
- };
-
- /**
- The constructor for Mutex creates a mutex. It is initially unlocked.
- */
- Mutex(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- mImpl = (MutexImpl *)QT3DS_ALLOC(alloc, MutexImpl::size, "MutexImpl");
- QT3DS_PLACEMENT_NEW(mImpl, MutexImpl)();
- }
-
- /**
- The destructor for Mutex deletes the mutex.
- */
- ~Mutex()
- {
- mImpl->~MutexImpl();
- QT3DS_FREE(mAllocator, mImpl);
- }
-
- /**
- Acquire (lock) the mutex. If the mutex is already locked
- by another thread, this method blocks until the mutex is
- unlocked.
- */
- bool lock() const { return mImpl->lock(); }
-
- /**
- Acquire (lock) the mutex. If the mutex is already locked
- by another thread, this method returns false without blocking.
- */
- bool trylock() const { return mImpl->trylock(); }
-
- /**
- Release (unlock) the mutex.
- */
- bool unlock() const { return mImpl->unlock(); }
-
- private:
- NVAllocatorCallback &mAllocator;
- MutexImpl *mImpl;
- };
-
- class QT3DS_FOUNDATION_API ReadWriteLock : private NoCopy
- {
- public:
- ReadWriteLock(NVAllocatorCallback &alloc);
- ~ReadWriteLock();
-
- void lockReader();
- void lockWriter();
-
- void unlockReader();
- void unlockWriter();
-
- private:
- class ReadWriteLockImpl *mImpl;
- };
-
- class ScopedReadLock : private NoCopy
- {
- public:
- QT3DS_INLINE ScopedReadLock(ReadWriteLock &lock)
- : mLock(lock)
- {
- mLock.lockReader();
- }
- QT3DS_INLINE ~ScopedReadLock() { mLock.unlockReader(); }
-
- private:
- ReadWriteLock &mLock;
- };
-
- class ScopedWriteLock : private NoCopy
- {
- public:
- QT3DS_INLINE ScopedWriteLock(ReadWriteLock &lock)
- : mLock(lock)
- {
- mLock.lockWriter();
- }
- QT3DS_INLINE ~ScopedWriteLock() { mLock.unlockWriter(); }
-
- private:
- ReadWriteLock &mLock;
- };
-
-/*
- * Use this type of lock for mutex behaviour that must operate on SPU and PPU
- * On non-PS3 platforms, it is implemented using Mutex
- */
-#ifndef QT3DS_PS3
-
- class AtomicLock : private NoCopy
- {
- Mutex mMutex;
-
- public:
- AtomicLock(NVAllocatorCallback &alloc)
- : mMutex(alloc)
- {
- }
-
- bool lock() { return mMutex.lock(); }
-
- bool trylock() { return mMutex.trylock(); }
-
- bool unlock() { return mMutex.unlock(); }
- };
-
- class AtomicLockCopy
- {
- AtomicLock *pLock;
-
- public:
- AtomicLockCopy()
- : pLock(NULL)
- {
- }
-
- AtomicLockCopy &operator=(AtomicLock &lock)
- {
- pLock = &lock;
- return *this;
- }
-
- bool lock() { return pLock->lock(); }
-
- bool trylock() { return pLock->trylock(); }
-
- bool unlock() { return pLock->unlock(); }
- };
-#else
- struct AtomicLockImpl
- {
- QT3DS_ALIGN(128, QT3DSU32 m_Lock);
- QT3DSI32 m_LockId;
- QT3DSU32 m_LockCount;
-
- AtomicLockImpl();
- };
- class AtomicLock //: private NoCopy
- {
- friend class AtomicLockCopy;
- AtomicLockImpl *m_pImpl;
-
- public:
- AtomicLock();
-
- ~AtomicLock();
-
- bool lock();
-
- bool trylock();
-
- bool unlock();
- };
-
- // if an AtomicLock is copied and then the copy goes out of scope, it'll delete the atomic
- // primitive
- // (just a 128-byte aligned int) and cause a crash when it tries to delete it again
- // This class just uses the atomic primitive without releasing it in the end.
-
- class AtomicLockCopy
- {
- AtomicLockImpl *m_pImpl;
-
- public:
- AtomicLockCopy()
- : m_pImpl(NULL)
- {
- }
-
- AtomicLockCopy(const AtomicLock &lock)
- : m_pImpl(lock.m_pImpl)
- {
- }
-
- ~AtomicLockCopy() {}
-
- AtomicLockCopy &operator=(const AtomicLock &lock)
- {
- m_pImpl = lock.m_pImpl;
- return *this;
- }
-
- bool lock();
-
- bool trylock();
-
- bool unlock();
- };
-#endif
-
-#ifndef QT3DS_PS3
-
- class AtomicRwLock : private NoCopy
- {
- ReadWriteLock m_Lock;
-
- public:
- AtomicRwLock(NVAllocatorCallback &alloc)
- : m_Lock(alloc)
- {
- }
-
- void lockReader() { m_Lock.lockReader(); }
- void lockWriter() { m_Lock.lockWriter(); }
-
- bool tryLockReader()
- {
- // Todo - implement this
- m_Lock.lockReader();
- return true;
- }
-
- void unlockReader() { m_Lock.unlockReader(); }
- void unlockWriter() { m_Lock.unlockWriter(); }
- };
-#else
-
- struct AtomicRwLockImpl
- {
- QT3DS_ALIGN(128, volatile QT3DSU32 m_Lock);
- QT3DS_ALIGN(128, volatile QT3DSU32 m_ReadCounter);
- QT3DSI32 m_LockId;
- QT3DSU32 m_LockCount;
-
- AtomicRwLockImpl();
- };
-
- class AtomicRwLock : private NoCopy
- {
- AtomicRwLockImpl *m_pImpl;
-
- public:
- AtomicRwLock();
-
- ~AtomicRwLock();
-
- void lockReader();
-
- bool tryLockReader();
-
- void lockWriter();
-
- void unlockReader();
-
- void unlockWriter();
- };
-
-#endif
-
- class ScopedAtomicLock : private NoCopy
- {
- QT3DS_INLINE ScopedAtomicLock(AtomicLock &lock)
- : mLock(lock)
- {
- mLock.lock();
- }
- QT3DS_INLINE ~ScopedAtomicLock() { mLock.unlock(); }
-
- private:
- AtomicLock &mLock;
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSNoCopy.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSNoCopy.h
deleted file mode 100644
index 817f5e19..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSNoCopy.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSNOCOPY_H
-#define QT3DS_FOUNDATION_PSNOCOPY_H
-
-#include "foundation/Qt3DS.h"
-
-namespace qt3ds {
-namespace foundation {
- class NoCopy
- {
- NoCopy(const NoCopy &c);
- NoCopy &operator=(const NoCopy &c);
-
- public:
- NoCopy() {}
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSOption.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSOption.h
deleted file mode 100644
index 18d6c3b2..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSOption.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_OPTION_H
-#define QT3DS_FOUNDATION_OPTION_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-
-namespace qt3ds {
-namespace foundation {
-
- struct Empty
- {
- };
-
- template <typename TDataType>
- class Option
- {
- TDataType mData;
- bool mHasValue;
-
- public:
- Option(const TDataType &data)
- : mData(data)
- , mHasValue(true)
- {
- }
- Option(const Empty &)
- : mHasValue(false)
- {
- }
- Option()
- : mHasValue(false)
- {
- }
- Option(const Option &other)
- : mData(other.mData)
- , mHasValue(other.mHasValue)
- {
- }
- Option &operator=(const Option &other)
- {
- mData = other.mData;
- mHasValue = other.mHasValue;
- return *this;
- }
-
- bool isEmpty() const { return !mHasValue; }
- void setEmpty() { mHasValue = false; }
- bool hasValue() const { return mHasValue; }
-
- const TDataType &getValue() const
- {
- QT3DS_ASSERT(mHasValue);
- return mData;
- }
- TDataType &getValue()
- {
- QT3DS_ASSERT(mHasValue);
- return mData;
- }
- TDataType &unsafeGetValue() { return mData; }
-
- operator const TDataType &() const { return getValue(); }
- operator TDataType &() { return getValue(); }
-
- const TDataType *operator->() const { return &getValue(); }
- TDataType *operator->() { return &getValue(); }
-
- const TDataType &operator*() const { return getValue(); }
- TDataType &operator*() { return getValue(); }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.cpp b/src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.cpp
deleted file mode 100644
index 06fb5d38..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "EASTL/hash_map.h"
-#include "EASTL/string.h"
-#include "EASTL/vector.h"
-#include "EASTL/sort.h"
-
-using namespace qt3ds::foundation;
-using namespace qt3ds;
-
-namespace {
-struct STimerEntry
-{
- QT3DSU64 m_Total;
- QT3DSU64 m_Max;
- QT3DSU32 m_UpdateCount;
- CRegisteredString m_Tag;
- size_t m_Order;
-
- STimerEntry(CRegisteredString tag, size_t order)
- : m_Total(0)
- , m_Max(0)
- , m_UpdateCount(0)
- , m_Tag(tag)
- , m_Order(order)
- {
- }
- void Update(QT3DSU64 increment)
- {
- m_Total += increment;
- m_Max = increment > m_Max ? increment : m_Max;
- ++m_UpdateCount;
- }
-
- void Output(NVFoundationBase &fnd, QT3DSU32 inFramesPassed)
- {
- Q_UNUSED(fnd)
- if (m_Total) {
- QT3DSU64 tensNanos = Time::sCounterFreq.toTensOfNanos(m_Total);
- QT3DSU64 maxNanos = Time::sCounterFreq.toTensOfNanos(m_Max);
-
- double milliseconds = tensNanos / 100000.0;
- double maxMilliseconds = maxNanos / 100000.0;
- if (inFramesPassed == 0)
- qCWarning(WARNING, PERF_INFO, "%s - %fms", m_Tag.c_str(), milliseconds);
- else {
- milliseconds /= inFramesPassed;
- qCWarning(WARNING, PERF_INFO, "%s - %fms/frame-total %fms-max %u hits",
- m_Tag.c_str(), milliseconds, maxMilliseconds, m_UpdateCount);
- }
- }
- }
-
- void Reset()
- {
- m_Total = 0;
- m_Max = 0;
- m_UpdateCount = 0;
- }
-
- bool operator<(const STimerEntry &other) const { return m_Order < other.m_Order; }
-};
-struct SPerfTimer : public IPerfTimer
-{
- typedef eastl::hash_map<CRegisteredString, STimerEntry> THashMapType;
- NVFoundationBase &m_Foundation;
- // This object needs its own string table because it is used during the binary load process with
- // the application string table gets booted up.
- NVScopedRefCounted<IStringTable> m_StringTable;
- THashMapType m_Entries;
- eastl::vector<STimerEntry> m_PrintEntries;
- Mutex m_Mutex;
- QT3DSI32 mRefCount;
-
- SPerfTimer(NVFoundationBase &fnd)
- : m_Foundation(fnd)
- , m_StringTable(IStringTable::CreateStringTable(fnd.getAllocator()))
- , m_Mutex(fnd.getAllocator())
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- void Update(const char *inId, QT3DSU64 inAmount) override
- {
- Mutex::ScopedLock __locker(m_Mutex);
- CRegisteredString theStr(m_StringTable->RegisterStr(inId));
- THashMapType::iterator theFind =
- m_Entries.insert(eastl::make_pair(theStr, STimerEntry(theStr, m_Entries.size()))).first;
- theFind->second.Update(inAmount);
- }
-
- // Dump current summation of timer data.
- void OutputTimerData(QT3DSU32 inFramesPassed = 0) override
- {
- Mutex::ScopedLock __locker(m_Mutex);
- m_PrintEntries.clear();
- for (THashMapType::iterator iter = m_Entries.begin(), end = m_Entries.end(); iter != end;
- ++iter) {
- m_PrintEntries.push_back(iter->second);
- iter->second.Reset();
- }
-
- eastl::sort(m_PrintEntries.begin(), m_PrintEntries.end());
-
- for (QT3DSU32 idx = 0, end = (QT3DSU32)m_PrintEntries.size(); idx < end; ++idx) {
- m_PrintEntries[idx].Output(m_Foundation, inFramesPassed);
- }
- }
-
- void ResetTimerData() override
- {
- Mutex::ScopedLock __locker(m_Mutex);
- for (THashMapType::iterator iter = m_Entries.begin(), end = m_Entries.end(); iter != end;
- ++iter) {
- iter->second.Reset();
- }
- }
-
- virtual void ClearPerfKeys()
- {
- Mutex::ScopedLock __locker(m_Mutex);
- m_Entries.clear();
- }
-};
-}
-
-IPerfTimer &IPerfTimer::CreatePerfTimer(NVFoundationBase &fnd)
-{
- return *QT3DS_NEW(fnd.getAllocator(), SPerfTimer)(fnd);
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.h
deleted file mode 100644
index c63091c0..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPerfTimer.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PERFTIMER_H
-#define QT3DS_FOUNDATION_PERFTIMER_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSTime.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace foundation {
-
- class IPerfTimer : public NVRefCounted
- {
- protected:
- virtual ~IPerfTimer() {}
- public:
- // amount is in counter frequency units
- virtual void Update(const char *inTag, QT3DSU64 inAmount) = 0;
- // Dump current summation of timer data.
- virtual void OutputTimerData(QT3DSU32 inFrameCount = 0) = 0;
- virtual void ResetTimerData() = 0;
-
- static IPerfTimer &CreatePerfTimer(NVFoundationBase &inFoundation);
- };
-
- // Specialize this struct to get the perf timer in different contexts.
- template <typename TTimerProvider>
- struct STimerProvider
- {
- static IPerfTimer &getPerfTimer(TTimerProvider &inProvider)
- {
- return inProvider.getPerfTimer();
- }
- };
-
- template <typename TTimerProvider>
- IPerfTimer &getPerfTimer(TTimerProvider &inProvider)
- {
- return STimerProvider<TTimerProvider>::getPerfTimer(inProvider);
- }
-
- struct SStackPerfTimer
- {
- IPerfTimer *m_Timer;
- QT3DSU64 m_Start;
- const char *m_Id;
-
- SStackPerfTimer(IPerfTimer &destination, const char *inId)
- : m_Timer(&destination)
- , m_Start(Time::getCurrentCounterValue())
- , m_Id(inId)
- {
- }
-
- SStackPerfTimer(IPerfTimer *destination, const char *inId)
- : m_Timer(destination)
- , m_Start(Time::getCurrentCounterValue())
- , m_Id(inId)
- {
- }
-
- ~SStackPerfTimer()
- {
- if (m_Timer) {
- QT3DSU64 theStop = Time::getCurrentCounterValue();
- QT3DSU64 theAmount = theStop - m_Start;
- m_Timer->Update(m_Id, theAmount);
- }
- }
- };
-}
-}
-
-#define QT3DS_FOUNDATION_PERF_SCOPED_TIMER(context, name) \
- SStackPerfTimer __perfTimer(getPerfTimer(context), #name);
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPlane.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSPlane.h
deleted file mode 100644
index 378c3bc9..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPlane.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_PLANE_H
-#define QT3DS_FOUNDATION_QT3DS_PLANE_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSMath.h"
-#include "foundation/Qt3DSVec3.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/**
-\brief Representation of a plane.
-
- Plane equation used: n.dot(v) + d = 0
-*/
-class NVPlane
-{
-public:
- /**
- \brief Constructor
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane() {}
-
- /**
- \brief Constructor from a normal and a distance
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane(NVReal nx, NVReal ny, NVReal nz, NVReal distance)
- : n(nx, ny, nz)
- , d(distance)
- {
- }
-
- /**
- \brief Constructor from a normal and a distance
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane(const QT3DSVec3 &normal, NVReal distance)
- : n(normal)
- , d(distance)
- {
- }
-
- /**
- \brief Constructor from a point on the plane and a normal
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane(const QT3DSVec3 &point, const QT3DSVec3 &normal)
- : n(normal)
- , d(-point.dot(n)) // p satisfies normal.dot(p) + d = 0
- {
- }
-
- /**
- \brief Constructor from three points
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane(const QT3DSVec3 &p0, const QT3DSVec3 &p1, const QT3DSVec3 &p2)
- {
- n = (p1 - p0).cross(p2 - p0).getNormalized();
- d = -p0.dot(n);
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal distance(const QT3DSVec3 &p) const { return p.dot(n) + d; }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool contains(const QT3DSVec3 &p) const
- {
- return NVAbs(distance(p)) < (1.0e-7f);
- }
-
- /**
- \brief projects p into the plane
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 project(const QT3DSVec3 &p) const
- {
- return p - n * distance(p);
- }
-
- /**
- \brief find an arbitrary point in the plane
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 pointInPlane() const { return -n * d; }
-
- /**
- \brief equivalent plane with unit normal
- */
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void normalize()
- {
- NVReal denom = 1.0f / n.magnitude();
- n *= denom;
- d *= denom;
- }
-
- QT3DSVec3 n; //!< The normal to the plane
- NVReal d; //!< The distance from the origin
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPool.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSPool.h
deleted file mode 100644
index 5bd07f86..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPool.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_POOL_H
-#define QT3DS_POOL_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSMath.h" //NVMax
-#include "EASTL/vector.h"
-
-namespace qt3ds {
-namespace foundation {
- // Pool of fixed size objects.
- template <typename TObjType, typename TAllocator = EASTLAllocatorType,
- QT3DSU32 alignmentInBytes = 4, QT3DSU32 slabSize = 4096>
- class Pool
- {
- protected:
- TAllocator mAllocator;
- struct Link
- {
- Link *mNext;
- Link(Link *next = NULL)
- : mNext(next)
- {
- }
- };
- eastl::vector<void *, TAllocator> mSlabs;
- Link *mFreeList;
-
- public:
- Pool(const TAllocator &alloc = TAllocator())
- : mAllocator(alloc)
- , mSlabs(alloc)
- , mFreeList(NULL)
- {
- StaticAssert<sizeof(TObjType) < slabSize>::valid_expression();
- }
- ~Pool()
- {
- for (QT3DSU32 idx = 0, end = mSlabs.size(); idx < end; ++idx)
- mAllocator.deallocate(mSlabs[idx], slabSize);
- mSlabs.clear();
- mFreeList = NULL;
- }
- void appendToFreeList(Link *inLink)
- {
- inLink->mNext = mFreeList;
- mFreeList = inLink;
- }
- void appendSlabToFreeList(void *slab)
- {
- QT3DSU8 *newMem = reinterpret_cast<QT3DSU8 *>(slab);
- QT3DSU32 objSize = (QT3DSU32)qt3ds::NVMax(sizeof(TObjType), sizeof(Link));
- // align the memory correctly
- if (objSize % alignmentInBytes)
- objSize += alignmentInBytes - (objSize % alignmentInBytes);
-
- QT3DSU32 numObjsInSlab = slabSize / objSize;
- for (QT3DSU32 idx = 0; idx < numObjsInSlab; ++idx) {
- QT3DSU8 *objPtr = newMem + idx * objSize;
- appendToFreeList(reinterpret_cast<Link *>(objPtr));
- }
- }
- void allocateSlab(const char *file, int line)
- {
- QT3DSU32 objSize = (QT3DSU32)NVMax(sizeof(TObjType), sizeof(Link));
- // align the memory correctly
- if (objSize % alignmentInBytes)
- objSize += alignmentInBytes - (objSize % alignmentInBytes);
-
- QT3DSU8 *newMem = (QT3DSU8 *)mAllocator.allocate(slabSize, file, line);
- if (newMem == NULL)
- return; // out of mem, bad error
- mSlabs.push_back(newMem);
- appendSlabToFreeList(newMem);
- }
-
- void *allocate(const char *file, int line)
- {
- if (!mFreeList)
- allocateSlab(file, line);
-
- if (mFreeList) {
- Link *retval = mFreeList;
- mFreeList = retval->mNext;
- return retval;
- }
-
- return NULL;
- }
-
- void deallocate(void *inPtr)
- {
-#if _DEBUG
- // Ensure inPtr came from a known slab.
- bool found = false;
- for (QT3DSU32 idx = 0, end = mSlabs.size(); idx < end && !found; ++idx) {
- QT3DSU8 *slabMem = reinterpret_cast<QT3DSU8 *>(mSlabs[idx]);
- QT3DSU8 *slabEnd = slabMem + slabSize;
- QT3DSU8 *memPtr = reinterpret_cast<QT3DSU8 *>(inPtr);
-
- if (memPtr >= mSlabs[idx] && memPtr < slabEnd)
- found = true;
- }
- QT3DS_ASSERT(found);
-#endif
- appendToFreeList(reinterpret_cast<Link *>(inPtr));
- }
-
- template <typename TArg1, typename TArg2>
- TObjType *construct(const TArg1 &arg1, const TArg2 &arg2, const char *file, int line)
- {
- TObjType *newMem = (TObjType *)allocate(file, line);
- return new (newMem) TObjType(arg1, arg2);
- }
-
- template <typename TArg1>
- TObjType *construct(const TArg1 &arg1, const char *file, int line)
- {
- TObjType *newMem = (TObjType *)allocate(file, line);
- return new (newMem) TObjType(arg1);
- }
-
- TObjType *construct(const char *file, int line)
- {
- TObjType *newMem = (TObjType *)allocate(file, line);
- return new (newMem) TObjType();
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPreprocessor.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSPreprocessor.h
deleted file mode 100644
index 371d3e67..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSPreprocessor.h
+++ /dev/null
@@ -1,375 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_PREPROCESSOR_H
-#define QT3DS_FOUNDATION_QT3DS_PREPROCESSOR_H
-
-#include <stddef.h>
-/** \addtogroup foundation
- @{
-*/
-
-/**
-List of preprocessor defines used to configure the SDK
-- NDEBUG/_DEBUG: enable asserts (exactly one needs to be defined)
-- QT3DS_CHECKED: enable run time checks, mostly unused or equiv. to _DEBUG
-- QT3DS_SUPPORT_VISUAL_DEBUGGER: ...
-- AG_PERFMON: ...
-*/
-
-/**
-Compiler define
-*/
-#ifdef _MSC_VER
-#define QT3DS_VC
-#if _MSC_VER >= 1600
-#define QT3DS_VC10
-#elif _MSC_VER >= 1500
-#define QT3DS_VC9
-#elif _MSC_VER >= 1400
-#define QT3DS_VC8
-#elif _MSC_VER >= 1300
-#define QT3DS_VC7
-#else
-#define QT3DS_VC6
-#endif
-#elif __GNUC__ || __SNC__
-#define QT3DS_GNUC
-#elif defined(__MWERKS__)
-#define QT3DS_CW
-#elif defined(__ghs__)
-#define QT3DS_GHS
-#else
-#error "Unknown compiler"
-#endif
-
-/**
-Platform define
-*/
-#ifdef QT3DS_VC
-#ifdef _M_IX86
-#define QT3DS_X86
-#define QT3DS_WINDOWS
-#elif defined(_M_X64)
-#define QT3DS_X64
-#define QT3DS_WINDOWS
-#elif defined(_M_PPC)
-#define QT3DS_PPC
-#define QT3DS_X360
-#define QT3DS_VMX
-#elif defined(_M_ARM)
-#define QT3DS_ARM
-#define QT3DS_WIN8ARM
-#define QT3DS_ARM_NEON
-#else
-#error "Unknown platform"
-#endif
-#elif defined QT3DS_GNUC
-#ifdef __CELLOS_LV2__
-#define QT3DS_PS3
-#define QT3DS_VMX
-#elif defined(__arm__)
-#define QT3DS_ARM
-#if defined(__SNC__)
-#define QT3DS_PSP2
-#endif
-#if defined(__ARM_PCS_VFP)
-#define QT3DS_ARM_HARDFP
-#else
-#define QT3DS_ARM_SOFTFP
-#endif
-#elif defined(__aarch64__)
-#define QT3DS_ARM
-#elif defined(__i386__)
-#define QT3DS_X86
-#define QT3DS_VMX
-#elif defined(__x86_64__)
-#define QT3DS_X64
-#elif defined(__ppc__)
-#define QT3DS_PPC
-#elif defined(__ppc64__)
-#define QT3DS_PPC
-#define QT3DS_PPC64
-//# elif defined(__aarch64__)
-//# define QT3DS_ARM_64
-#else
-#error "Unknown platform"
-#endif
-#if defined(ANDROID)
-#define QT3DS_ANDROID
-#elif defined(__linux__)
-#define QT3DS_LINUX
-#elif defined(__APPLE__)
-#define QT3DS_APPLE
-#if defined(__arm__)
-#define QT3DS_APPLE_IOS
-#endif
-#elif defined(__CYGWIN__)
-#define QT3DS_CYGWIN
-#define QT3DS_LINUX
-#elif defined(__QNX__)
-#define QT3DS_QNX
-#elif defined(_WIN32)
-#define QT3DS_WINDOWS
-#else
-#error "Unkown OS"
-#endif
-#elif defined QT3DS_CW
-#if defined(__PPCGEKKO__)
-#if defined(RVL)
-#define QT3DS_WII
-#else
-#define QT3DS_GC
-#endif
-#else
-#error "Unknown platform"
-#endif
-#elif defined QT3DS_GHS
-#define QT3DS_LINUX // INTEGRITY deviations flagged with __INTEGRITY
-#if defined(__arm__) || defined(__aarch64__) || defined(__ARM64__)
-#define QT3DS_ARM
-#endif
-#endif
-
-/**
-DLL export macros
-*/
-#ifndef QT3DS_C_EXPORT
-#define QT3DS_C_EXPORT extern "C"
-#endif
-
-/**
-Define API function declaration
-
-QT3DS_FOUNDATION_EXPORTS - used by the DLL library (PhysXCommon) to export the API
-QT3DS_FOUNDATION_NO_EXPORTS - exists because there are windows configurations where
- the QT3DS_FOUNDATION_API is linked through standard
-static linking
-no definition - this will allow DLLs and libraries to use the exported API from PhysXCommon
-
-*/
-#if defined(QT3DS_WINDOWS) && !defined(__CUDACC__)
-#if defined QT3DS_FOUNDATION_EXPORTS
-#define QT3DS_FOUNDATION_API __declspec(dllexport)
-#elif defined QT3DS_FOUNDATION_NO_EXPORTS
-#define QT3DS_FOUNDATION_API
-#else
-#define QT3DS_FOUNDATION_API __declspec(dllimport)
-#endif
-#else
-#define QT3DS_FOUNDATION_API
-#endif
-
-
-#if defined(QT3DS_AUTOTESTS_ENABLED)
-#include <qglobal.h>
-#if defined(QT3DS_BUILDING_LIBRARY)
-#define QT3DS_AUTOTEST_EXPORT Q_DECL_EXPORT
-#else
-#define QT3DS_AUTOTEST_EXPORT Q_DECL_IMPORT
-#endif
-#else
-#define QT3DS_AUTOTEST_EXPORT
-#endif
-
-/**
-Calling convention
-*/
-#ifndef QT3DS_CALL_CONV
-#if defined QT3DS_WINDOWS
-#define QT3DS_CALL_CONV __cdecl
-#else
-#define QT3DS_CALL_CONV
-#endif
-#endif
-
-/**
-Pack macros - disabled on SPU because they are not supported
-*/
-#if defined(QT3DS_VC)
-#define QT3DS_PUSH_PACK_DEFAULT __pragma(pack(push, 8))
-#define QT3DS_POP_PACK __pragma(pack(pop))
-#elif defined(QT3DS_GNUC) && !defined(__SPU__)
-#define QT3DS_PUSH_PACK_DEFAULT _Pragma("pack(push, 8)")
-#define QT3DS_POP_PACK _Pragma("pack(pop)")
-#else
-#define QT3DS_PUSH_PACK_DEFAULT
-#define QT3DS_POP_PACK
-#endif
-
-/**
-Inline macro
-*/
-#if defined(QT3DS_WINDOWS) || defined(QT3DS_X360)
-#define QT3DS_INLINE inline
-#ifdef QT3DS_VC
-#pragma inline_depth(255)
-#endif
-#else
-#define QT3DS_INLINE inline
-#endif
-
-/**
-Force inline macro
-*/
-#if defined(QT3DS_VC)
-#define QT3DS_FORCE_INLINE __forceinline
-#elif defined(QT3DS_LINUX) \
- || defined(QT3DS_QNX) // Workaround; Fedora Core 3 do not agree with force inline and NVcPool
-#define QT3DS_FORCE_INLINE inline
-#elif defined(QT3DS_GNUC)
-#define QT3DS_FORCE_INLINE inline __attribute__((always_inline))
-#else
-#define QT3DS_FORCE_INLINE inline
-#endif
-
-/**
-Noinline macro
-*/
-#if defined QT3DS_WINDOWS
-#define QT3DS_NOINLINE __declspec(noinline)
-#elif defined(QT3DS_GNUC)
-#define QT3DS_NOINLINE __attribute__((noinline))
-#else
-#define QT3DS_NOINLINE
-#endif
-
-/*! restrict macro */
-#if __CUDACC__
-#define QT3DS_RESTRICT __restrict__
-#elif defined(QT3DS_GNUC) || defined(QT3DS_VC)
-#define QT3DS_RESTRICT __restrict
-#elif defined(QT3DS_CW) && __STDC_VERSION__ >= 199901L
-#define QT3DS_RESTRICT restrict
-#else
-#define QT3DS_RESTRICT
-#endif
-
-#if defined(QT3DS_WINDOWS) || defined(QT3DS_X360)
-#define QT3DS_NOALIAS __declspec(noalias)
-#else
-#define QT3DS_NOALIAS
-#endif
-
-/**
-Alignment macros
-
-QT3DS_ALIGN_PREFIX and QT3DS_ALIGN_SUFFIX can be used for type alignment instead of aligning individual
-variables as follows:
-QT3DS_ALIGN_PREFIX(16)
-struct A {
-...
-} QT3DS_ALIGN_SUFFIX(16);
-This declaration style is parsed correctly by Visual Assist.
-
-*/
-#ifndef QT3DS_ALIGN
-#if defined(QT3DS_VC)
-#define QT3DS_ALIGN(alignment, decl) __declspec(align(alignment)) decl
-#define QT3DS_ALIGN_PREFIX(alignment) __declspec(align(alignment))
-#define QT3DS_ALIGN_SUFFIX(alignment)
-#elif defined(QT3DS_GNUC)
-#define QT3DS_ALIGN(alignment, decl) decl __attribute__((aligned(alignment)))
-#define QT3DS_ALIGN_PREFIX(alignment)
-#define QT3DS_ALIGN_SUFFIX(alignment) __attribute__((aligned(alignment)))
-#elif defined(QT3DS_CW)
-#define QT3DS_ALIGN(alignment, decl) decl __attribute__((aligned(alignment)))
-#define QT3DS_ALIGN_PREFIX(alignment)
-#define QT3DS_ALIGN_SUFFIX(alignment) __attribute__((aligned(alignment)))
-#else
-#define QT3DS_ALIGN(alignment, decl)
-#define QT3DS_ALIGN_PREFIX(alignment)
-#define QT3DS_ALIGN_SUFFIX(alignment)
-#endif
-#endif
-
-/**
-Deprecated marco
-*/
-#if 0 // set to 1 to create warnings for deprecated functions
-#define QT3DS_DEPRECATED __declspec(deprecated)
-#else
-#define QT3DS_DEPRECATED
-#endif
-
-// VC6 no '__FUNCTION__' workaround
-#if defined QT3DS_VC6 && !defined __FUNCTION__
-#define __FUNCTION__ "Undefined"
-#endif
-
-/**
-General defines
-*/
-
-// Assertion type
-template <bool b>
-struct StaticAssert
-{
-};
-// Specialisation with member function
-template <>
-struct StaticAssert<true>
-{
-public:
- static void valid_expression(){}
-};
-
-// static assert
-#define QT3DS_COMPILE_TIME_ASSERT(exp) typedef char NVCompileTimeAssert_Dummy[(exp) ? 1 : -1]
-
-#ifdef QT3DS_GNUC
-#define QT3DS_OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
-#else
-#define QT3DS_OFFSET_OF(X, Y) offsetof(X, Y)
-#endif
-
-// avoid unreferenced parameter warning (why not just disable it?)
-// PT: or why not just omit the parameter's name from the declaration????
-#define QT3DS_FORCE_PARAMETER_REFERENCE(_P) (void)(_P);
-#define QT3DS_UNUSED(_P) QT3DS_FORCE_PARAMETER_REFERENCE(_P)
-
-// check that exactly one of NDEBUG and _DEBUG is defined
-#if !(defined NDEBUG ^ defined _DEBUG)
-#error Exactly one of NDEBUG and _DEBUG needs to be defined by preprocessor
-#endif
-
-// make sure QT3DS_CHECKED is defined in all _DEBUG configurations as well
-#if !defined(QT3DS_CHECKED) && _DEBUG
-#define QT3DS_CHECKED
-#endif
-
-#ifdef __CUDACC__
-#define QT3DS_CUDA_CALLABLE __host__ __device__
-#else
-#define QT3DS_CUDA_CALLABLE
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_PREPROCESSOR_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSQuat.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSQuat.h
deleted file mode 100644
index 2792f977..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSQuat.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_QUAT_H
-#define QT3DS_FOUNDATION_QT3DS_QUAT_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSVec3.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/**
-\brief This is a quaternion class. For more information on quaternion mathematics
-consult a mathematics source on complex numbers.
-
-*/
-
-class QT3DSQuat
-{
-public:
- /**
- \brief Default constructor, does not do any initialization.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat() {}
-
- /**
- \brief Constructor. Take note of the order of the elements!
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat(NVReal nx, NVReal ny, NVReal nz, NVReal nw)
- : x(nx)
- , y(ny)
- , z(nz)
- , w(nw)
- {
- }
-
- /**
- \brief Creates from angle-axis representation.
-
- Axis must be normalized!
-
- Angle is in radians!
-
- <b>Unit:</b> Radians
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat(NVReal angleRadians, const QT3DSVec3 &unitAxis)
- {
- QT3DS_ASSERT(NVAbs(1.0f - unitAxis.magnitude()) < 1e-3f);
- const NVReal a = angleRadians * 0.5f;
- const NVReal s = NVSin(a);
- w = NVCos(a);
- x = unitAxis.x * s;
- y = unitAxis.y * s;
- z = unitAxis.z * s;
- }
-
- /**
- \brief Copy ctor.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat(const QT3DSQuat &v)
- : x(v.x)
- , y(v.y)
- , z(v.z)
- , w(v.w)
- {
- }
-
- /**
- \brief Creates from orientation matrix.
-
- \param[in] m Rotation matrix to extract quaternion from.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE explicit QT3DSQuat(const QT3DSMat33 &m); /* defined in Qt3DSMat33.h */
-
- /**
- \brief returns true if all elements are finite (not NAN or INF, etc.)
- */
- QT3DS_CUDA_CALLABLE bool isFinite() const
- {
- return NVIsFinite(x) && NVIsFinite(y) && NVIsFinite(z) && NVIsFinite(w);
- }
-
- /**
- \brief returns true if finite and magnitude is close to unit
- */
-
- QT3DS_CUDA_CALLABLE bool isUnit() const
- {
- const NVReal unitTolerance = NVReal(1e-4);
- return isFinite() && NVAbs(magnitude() - 1) < unitTolerance;
- }
-
- /**
- \brief returns true if finite and magnitude is reasonably close to unit to allow for some
- accumulation of error vs isValid
- */
-
- QT3DS_CUDA_CALLABLE bool isSane() const
- {
- const NVReal unitTolerance = NVReal(1e-2);
- return isFinite() && NVAbs(magnitude() - 1) < unitTolerance;
- }
-
- /**
- \brief converts this quaternion to angle-axis representation
- */
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE void toRadiansAndUnitAxis(NVReal &angle, QT3DSVec3 &axis) const
- {
- const NVReal quatEpsilon = (NVReal(1.0e-8f));
- const NVReal s2 = x * x + y * y + z * z;
- if (s2 < quatEpsilon * quatEpsilon) // can't extract a sensible axis
- {
- angle = 0;
- axis = QT3DSVec3(1, 0, 0);
- } else {
- const NVReal s = NVRecipSqrt(s2);
- axis = QT3DSVec3(x, y, z) * s;
- angle = w < quatEpsilon ? NVPi : NVAtan2(s2 * s, w) * 2;
- }
- }
-
- /**
- \brief Gets the angle between this quat and the identity quaternion.
-
- <b>Unit:</b> Radians
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal getAngle() const { return NVAcos(w) * NVReal(2); }
-
- /**
- \brief Gets the angle between this quat and the argument
-
- <b>Unit:</b> Radians
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal getAngle(const QT3DSQuat &q) const
- {
- return NVAcos(dot(q)) * NVReal(2);
- }
-
- /**
- \brief This is the squared 4D vector length, should be 1 for unit quaternions.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal magnitudeSquared() const
- {
- return x * x + y * y + z * z + w * w;
- }
-
- /**
- \brief returns the scalar product of this and other.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal dot(const QT3DSQuat &v) const
- {
- return x * v.x + y * v.y + z * v.z + w * v.w;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat getNormalized() const
- {
- const NVReal s = 1.0f / magnitude();
- return QT3DSQuat(x * s, y * s, z * s, w * s);
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE float magnitude() const { return NVSqrt(magnitudeSquared()); }
-
- // modifiers:
- /**
- \brief maps to the closest unit quaternion.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal normalize() // convert this QT3DSQuat to a unit quaternion
- {
- const NVReal mag = magnitude();
- if (mag) {
- const NVReal imag = NVReal(1) / mag;
-
- x *= imag;
- y *= imag;
- z *= imag;
- w *= imag;
- }
- return mag;
- }
-
- /*
- \brief returns the conjugate.
-
- \note for unit quaternions, this is the inverse.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat getConjugate() const { return QT3DSQuat(-x, -y, -z, w); }
-
- /*
- \brief returns imaginary part.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 getImaginaryPart() const { return QT3DSVec3(x, y, z); }
-
- /** brief computes rotation of x-axis */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getBasisVector0() const
- {
- // return rotate(QT3DSVec3(1,0,0));
- const QT3DSF32 x2 = x * 2.0f;
- const QT3DSF32 w2 = w * 2.0f;
- return QT3DSVec3((w * w2) - 1.0f + x * x2, (z * w2) + y * x2, (-y * w2) + z * x2);
- }
-
- /** brief computes rotation of y-axis */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getBasisVector1() const
- {
- // return rotate(QT3DSVec3(0,1,0));
- const QT3DSF32 y2 = y * 2.0f;
- const QT3DSF32 w2 = w * 2.0f;
- return QT3DSVec3((-z * w2) + x * y2, (w * w2) - 1.0f + y * y2, (x * w2) + z * y2);
- }
-
- /** brief computes rotation of z-axis */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getBasisVector2() const
- {
- // return rotate(QT3DSVec3(0,0,1));
- const QT3DSF32 z2 = z * 2.0f;
- const QT3DSF32 w2 = w * 2.0f;
- return QT3DSVec3((y * w2) + x * z2, (-x * w2) + y * z2, (w * w2) - 1.0f + z * z2);
- }
-
- /**
- rotates passed vec by this (assumed unitary)
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const QT3DSVec3 rotate(const QT3DSVec3 &v) const
- // QT3DS_CUDA_CALLABLE QT3DS_INLINE const QT3DSVec3 rotate(const QT3DSVec3& v) const
- {
- const QT3DSF32 vx = 2.0f * v.x;
- const QT3DSF32 vy = 2.0f * v.y;
- const QT3DSF32 vz = 2.0f * v.z;
- const QT3DSF32 w2 = w * w - 0.5f;
- const QT3DSF32 dot2 = (x * vx + y * vy + z * vz);
- return QT3DSVec3((vx * w2 + (y * vz - z * vy) * w + x * dot2),
- (vy * w2 + (z * vx - x * vz) * w + y * dot2),
- (vz * w2 + (x * vy - y * vx) * w + z * dot2));
- /*
- const QT3DSVec3 qv(x,y,z);
- return (v*(w*w-0.5f) + (qv.cross(v))*w + qv*(qv.dot(v)))*2;
- */
- }
-
- /**
- inverse rotates passed vec by this (assumed unitary)
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const QT3DSVec3 rotateInv(const QT3DSVec3 &v) const
- // QT3DS_CUDA_CALLABLE QT3DS_INLINE const QT3DSVec3 rotateInv(const QT3DSVec3& v) const
- {
- const QT3DSF32 vx = 2.0f * v.x;
- const QT3DSF32 vy = 2.0f * v.y;
- const QT3DSF32 vz = 2.0f * v.z;
- const QT3DSF32 w2 = w * w - 0.5f;
- const QT3DSF32 dot2 = (x * vx + y * vy + z * vz);
- return QT3DSVec3((vx * w2 - (y * vz - z * vy) * w + x * dot2),
- (vy * w2 - (z * vx - x * vz) * w + y * dot2),
- (vz * w2 - (x * vy - y * vx) * w + z * dot2));
- // const QT3DSVec3 qv(x,y,z);
- // return (v*(w*w-0.5f) - (qv.cross(v))*w + qv*(qv.dot(v)))*2;
- }
-
- /**
- \brief Assignment operator
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat &operator=(const QT3DSQuat &p)
- {
- x = p.x;
- y = p.y;
- z = p.z;
- w = p.w;
- return *this;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat &operator*=(const QT3DSQuat &q)
- {
- const NVReal tx = w * q.x + q.w * x + y * q.z - q.y * z;
- const NVReal ty = w * q.y + q.w * y + z * q.x - q.z * x;
- const NVReal tz = w * q.z + q.w * z + x * q.y - q.x * y;
-
- w = w * q.w - q.x * x - y * q.y - q.z * z;
- x = tx;
- y = ty;
- z = tz;
-
- return *this;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat &operator+=(const QT3DSQuat &q)
- {
- x += q.x;
- y += q.y;
- z += q.z;
- w += q.w;
- return *this;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat &operator-=(const QT3DSQuat &q)
- {
- x -= q.x;
- y -= q.y;
- z -= q.z;
- w -= q.w;
- return *this;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat &operator*=(const NVReal s)
- {
- x *= s;
- y *= s;
- z *= s;
- w *= s;
- return *this;
- }
-
- /** quaternion multiplication */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat operator*(const QT3DSQuat &q) const
- {
- return QT3DSQuat(w * q.x + q.w * x + y * q.z - q.y * z, w * q.y + q.w * y + z * q.x - q.z * x,
- w * q.z + q.w * z + x * q.y - q.x * y, w * q.w - x * q.x - y * q.y - z * q.z);
- }
-
- /** quaternion addition */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat operator+(const QT3DSQuat &q) const
- {
- return QT3DSQuat(x + q.x, y + q.y, z + q.z, w + q.w);
- }
-
- /** quaternion subtraction */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat operator-() const { return QT3DSQuat(-x, -y, -z, -w); }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat operator-(const QT3DSQuat &q) const
- {
- return QT3DSQuat(x - q.x, y - q.y, z - q.z, w - q.w);
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSQuat operator*(NVReal r) const
- {
- return QT3DSQuat(x * r, y * r, z * r, w * r);
- }
-
- static QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSQuat createIdentity() { return QT3DSQuat(0, 0, 0, 1); }
-
- /** the quaternion elements */
- NVReal x, y, z, w;
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_QUAT_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSRefCounted.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSRefCounted.h
deleted file mode 100644
index b500b5fc..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSRefCounted.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_REFCOUNTED_H
-#define QT3DS_FOUNDATION_QT3DS_REFCOUNTED_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSNoCopy.h"
-
-namespace qt3ds {
-namespace foundation {
- /**
- Marker class for objects that have a release method that is expected
- to destroy or release the object.
- */
- class NVReleasable
- {
- protected:
- virtual ~NVReleasable() {}
- public:
- virtual void release() = 0;
- };
-
- template <typename TObjType>
- inline void NVSafeRelease(TObjType *&item)
- {
- if (item) {
- item->release();
- item = NULL;
- }
- }
-
- /**Scoped pointer that releases its data
- when it is being destroyed*/
- template <typename TObjType>
- struct NVScopedReleasable : public NoCopy
- {
- TObjType *mPtr;
- NVScopedReleasable()
- : mPtr(NULL)
- {
- }
- NVScopedReleasable(TObjType *item)
- : mPtr(item)
- {
- }
- NVScopedReleasable(TObjType &item)
- : mPtr(&item)
- {
- }
- ~NVScopedReleasable() { NVSafeRelease(mPtr); }
-
- NVScopedReleasable &operator=(TObjType *inItem)
- {
- if (inItem != mPtr) {
- if (mPtr)
- mPtr->release();
- mPtr = inItem;
- }
- return *this;
- }
-
- NVScopedReleasable &operator=(const NVScopedReleasable<TObjType> inItem)
- {
- QT3DS_ASSERT(false);
- // try to do the right thing.
- mPtr = inItem.mPtr;
- const_cast<NVScopedReleasable<TObjType> &>(inItem).mPtr = NULL;
- return *this;
- }
-
- TObjType *forget_unsafe()
- {
- mPtr = NULL;
- return mPtr;
- }
-
- TObjType *operator->() { return mPtr; }
- const TObjType *operator->() const { return mPtr; }
- TObjType &operator*() { return *mPtr; }
- const TObjType &operator*() const { return *mPtr; }
- operator TObjType *() { return mPtr; }
- operator const TObjType *() const { return mPtr; }
- };
-
- // Marker class for objects that are ref counted.
- class NVRefCounted : public NVReleasable
- {
- public:
- virtual void addRef() = 0;
- };
-
-/**Helpers to make implementing ref counted objects as concise as possible*/
-#define QT3DS_IMPLEMENT_REF_COUNT_RELEASE(alloc) \
- QT3DSI32 value = atomicDecrement(&mRefCount); \
- if (value <= 0) \
- NVDelete(alloc, this);
-
-#define QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(alloc) \
- void addRef() { atomicIncrement(&mRefCount); } \
- void release() { QT3DS_IMPLEMENT_REF_COUNT_RELEASE(alloc); }
-
-
-#define QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(alloc) \
- void addRef() override { atomicIncrement(&mRefCount); } \
- void release() override { QT3DS_IMPLEMENT_REF_COUNT_RELEASE(alloc); }
-
- /**Safe function that checks for null before addrefing the object*/
- template <typename TObjType>
- inline TObjType *NVSafeAddRef(TObjType *item)
- {
- if (item) {
- item->addRef();
- }
- return item;
- }
-
- /**Scoped pointer that addref's its data upon acquisition and releases its data
- when it is being destroyed*/
- template <typename TObjType>
- struct NVScopedRefCounted
- {
- TObjType *mPtr;
- ~NVScopedRefCounted() { NVSafeRelease(mPtr); }
- NVScopedRefCounted(TObjType *item = NULL)
- : mPtr(item)
- {
- NVSafeAddRef(mPtr);
- }
- NVScopedRefCounted(TObjType &item)
- : mPtr(&item)
- {
- NVSafeAddRef(mPtr);
- }
- NVScopedRefCounted(const NVScopedRefCounted<TObjType> &other)
- : mPtr(const_cast<TObjType *>(other.mPtr))
- {
- NVSafeAddRef(mPtr);
- }
- NVScopedRefCounted<TObjType> &operator=(const NVScopedRefCounted<TObjType> &other)
- {
- if (other.mPtr != mPtr) {
- NVSafeRelease(mPtr);
- mPtr = const_cast<TObjType *>(other.mPtr);
- NVSafeAddRef(mPtr);
- }
- return *this;
- }
- TObjType *forget_unsafe()
- {
- mPtr = NULL;
- return mPtr;
- }
-
- TObjType *operator->() { return mPtr; }
- const TObjType *operator->() const { return mPtr; }
- TObjType &operator*() { return *mPtr; }
- const TObjType &operator*() const { return *mPtr; }
- operator TObjType *() { return mPtr; }
- operator const TObjType *() const { return mPtr; }
- bool operator==(NVScopedRefCounted<TObjType> &inOther) const
- {
- return mPtr == inOther.mPtr;
- }
- bool operator!=(NVScopedRefCounted<TObjType> &inOther) const
- {
- return mPtr != inOther.mPtr;
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSemaphore.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSSemaphore.h
deleted file mode 100644
index f58bb6e0..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSemaphore.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSSEMAPHORE_H
-#define QT3DS_FOUNDATION_PSSEMAPHORE_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-namespace qt3ds {
-namespace foundation {
- class QT3DS_FOUNDATION_API Semaphore
- {
- public:
- static const QT3DSU32 waitForever = 0xffffffff;
-
- Semaphore(NVAllocatorCallback &alloc, QT3DSU32 initialCount, QT3DSU32 maxCount);
-
- ~Semaphore();
-
- /**Decrements (locks) the semaphore. If the semaphore's value is greater than zero,
- * then the decrement proceeds, and the function returns, immediately. Otherwise
- * Wait for at most the given number of ms. Returns true if the Semaphore is signaled.
- * Semaphore::waitForever will block forever or until the semaphore is signaled.
- */
-
- bool wait(QT3DSU32 milliseconds = waitForever);
-
- /** increments (unlocks) the semaphore */
-
- void post();
-
- private:
- class SemaphoreImpl *mImpl;
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSimpleTypes.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSSimpleTypes.h
deleted file mode 100644
index 92f17245..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSimpleTypes.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_QT3DS_SIMPLE_TYPES_H
-#define QT3DS_FOUNDATION_QT3DS_SIMPLE_TYPES_H
-
-/** \addtogroup foundation
- @{
-*/
-
-// Platform specific types:
-// Design note: Its OK to use int for general loop variables and temps.
-
-#include <QtCore/qglobal.h>
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSPreprocessor.h"
-#include "EABase/eabase.h"
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif //#ifndef QT3DS_DOXYGEN
-
-typedef quint8 QT3DSU8;
-typedef qint8 QT3DSI8;
-typedef quint16 QT3DSU16;
-typedef qint16 QT3DSI16;
-typedef quint32 QT3DSU32;
-typedef qint32 QT3DSI32;
-
-// Android's definition of GLuint64 as unsigned long (64-bits) requires this workaround
-#if Q_PROCESSOR_WORDSIZE == 8 && defined(Q_OS_ANDROID)
-typedef unsigned long QT3DSU64;
-#else
-typedef quint64 QT3DSU64;
-#endif
-
-typedef qint64 QT3DSI64;
-typedef float QT3DSF32;
-typedef double QT3DSF64;
-typedef QT3DSI32 IntBool;
-
-struct QT3DSF16
-{
- QT3DSU16 mData;
-};
-
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSI8) == 1);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSU8) == 1);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSI16) == 2);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSU16) == 2);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSI32) == 4);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSU32) == 4);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSI64) == 8);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(QT3DSU64) == 8);
-
-// Type ranges
-#define QT3DS_MAX_I8 127 // maximum possible sbyte value, 0x7f
-#define QT3DS_MIN_I8 (-128) // minimum possible sbyte value, 0x80
-#define QT3DS_MAX_U8 255U // maximum possible ubyte value, 0xff
-#define QT3DS_MIN_U8 0 // minimum possible ubyte value, 0x00
-#define QT3DS_MAX_I16 32767 // maximum possible sword value, 0x7fff
-#define QT3DS_MIN_I16 (-32768) // minimum possible sword value, 0x8000
-#define QT3DS_MAX_U16 65535U // maximum possible uword value, 0xffff
-#define QT3DS_MIN_U16 0 // minimum possible uword value, 0x0000
-#define QT3DS_MAX_I32 2147483647 // maximum possible sdword value, 0x7fffffff
-#define QT3DS_MIN_I32 (-2147483647 - 1) // minimum possible sdword value, 0x80000000
-#define QT3DS_MAX_U32 4294967295U // maximum possible udword value, 0xffffffff
-#define QT3DS_MIN_U32 0 // minimum possible udword value, 0x00000000
-#define QT3DS_MAX_F32 3.4028234663852885981170418348452e+38F
-// maximum possible float value
-#define QT3DS_MAX_F64 DBL_MAX // maximum possible double value
-
-#define QT3DS_ENV_F32 FLT_EPSILON // maximum relative error of float rounding
-#define QT3DS_ENV_F64 DBL_EPSILON // maximum relative error of double rounding
-
-#ifndef QT3DS_FOUNDATION_USE_F64
-
-typedef QT3DSF32 NVReal;
-
-#define QT3DS_MAX_REAL QT3DS_MAX_F32
-#define QT3DS_ENV_REAL QT3DS_ENV_F32
-#define QT3DS_NORMALIZATION_EPSILON NVReal(1e-20f)
-
-#else
-
-typedef QT3DSF64 NVReal;
-
-#define QT3DS_MAX_REAL QT3DS_MAX_F64
-#define QT3DS_ENV_REAL QT3DS_ENV_F64
-#define QT3DS_NORMALIZATION_EPSILON NVReal(1e-180)
-
-#endif
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_SIMPLE_TYPES_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSStringTokenizer.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSStringTokenizer.h
deleted file mode 100644
index 5229babd..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSStringTokenizer.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_STRING_TOKENIZER_H
-#define QT3DS_FOUNDATION_STRING_TOKENIZER_H
-
-#include "EASTL/string.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename TStrType>
- class QT3DS_FOUNDATION_API StringTokenizer
- {
- typedef typename eastl::basic_string<TStrType>::size_type size_t;
-
- public:
- StringTokenizer(const eastl::basic_string<TStrType> &inString,
- const eastl::basic_string<TStrType> &inToken)
- {
- eastl::basic_string<TStrType> mStr = inString;
- eastl::basic_string<TStrType> theTempString = inString.substr(0, inToken.length());
-
- while (inToken.length() && theTempString.compare(inToken) == 0) {
- mStr = mStr.substr(inToken.length());
- theTempString = mStr.substr(0, inToken.length());
- }
-
- theTempString = mStr.substr(mStr.length() - 1 - inToken.length());
- while (theTempString.compare(inToken) == 0) {
- mStr = mStr.substr(0, mStr.length() - inToken.length());
- theTempString = mStr.substr(mStr.length() - 1 - inToken.length());
- }
-
- m_OriginalString = mStr;
- m_Token = inToken;
- m_Index = 0;
- }
-
- eastl::basic_string<TStrType> GetCurrentPartition()
- {
- eastl::basic_string<TStrType> theReturnString;
- if (m_Index != eastl::basic_string<TStrType>::npos) {
- size_t theCurrentTokenIndex = m_OriginalString.find(m_Token, m_Index);
- if (theCurrentTokenIndex == eastl::basic_string<TStrType>::npos) {
- theReturnString = m_OriginalString.substr(m_Index);
- } else {
- theReturnString =
- m_OriginalString.substr(m_Index, theCurrentTokenIndex - m_Index);
- }
- }
-
- return theReturnString;
- }
-
- bool HasNextPartition() { return m_Index != eastl::basic_string<TStrType>::npos; }
-
- void operator++()
- {
- if (m_Index != eastl::basic_string<TStrType>::npos) {
- size_t theCurrentTokenIndex = m_OriginalString.find(m_Token, m_Index);
- if (theCurrentTokenIndex == eastl::basic_string<TStrType>::npos) {
- m_Index = eastl::basic_string<TStrType>::npos;
- } else {
- m_Index = theCurrentTokenIndex + m_Token.length();
- if (m_Index > m_OriginalString.length())
- m_Index = eastl::basic_string<TStrType>::npos;
- }
- }
- }
-
- private:
- size_t m_Index;
- eastl::basic_string<TStrType> m_Token;
- eastl::basic_string<TStrType> m_OriginalString;
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSync.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSSync.h
deleted file mode 100644
index a36afaeb..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSync.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSSYNC_H
-#define QT3DS_FOUNDATION_PSSYNC_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-namespace qt3ds {
-namespace foundation {
- class QT3DS_FOUNDATION_API Sync
- {
- public:
- static const QT3DSU32 waitForever = 0xffffffff;
-
- Sync(NVAllocatorCallback &alloc);
-
- ~Sync();
-
- /** Wait on the object for at most the given number of ms. Returns
- * true if the object is signaled. Sync::waitForever will block forever
- * or until the object is signaled.
- */
-
- bool wait(QT3DSU32 milliseconds = waitForever);
-
- /** Signal the synchronization object, waking all threads waiting on it */
-
- void set();
-
- /** Reset the synchronization object */
-
- void reset();
-
- private:
- class SyncImpl *mImpl;
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.cpp b/src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.cpp
deleted file mode 100644
index e87a25ea..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSSystem.h"
-#include "foundation/Qt3DSPreprocessor.h"
-#include "EASTL/string.h"
-
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-
-#if defined(QT3DS_ANDROID)
-const char *qt3ds::foundation::System::g_OS = "android";
-const char *qt3ds::foundation::System::g_DLLExtension = ".so";
-#elif defined(QT3DS_APPLE)
-const char *qt3ds::foundation::System::g_OS = "osx";
-const char *qt3ds::foundation::System::g_DLLExtension = ".dylib";
-#elif defined(QT3DS_LINUX)
-const char *qt3ds::foundation::System::g_OS = "linux";
-const char *qt3ds::foundation::System::g_DLLExtension = ".so";
-#elif defined(QT3DS_QNX)
-const char *qt3ds::foundation::System::g_OS = "qnx";
-const char *qt3ds::foundation::System::g_DLLExtension = ".so";
-#elif defined(QT3DS_WINDOWS)
-const char *qt3ds::foundation::System::g_OS = "windows";
-const char *qt3ds::foundation::System::g_DLLExtension = ".dll";
-#else
-#error "Unknown Operating System"
-#endif
-
-#if defined(QT3DS_X86)
-const char *qt3ds::foundation::System::g_Processor = "x86";
-const char *qt3ds::foundation::System::g_BitWidth = "32";
-const char *qt3ds::foundation::System::g_FloatingPointModel = "";
-#elif defined(QT3DS_X64)
-const char *qt3ds::foundation::System::g_Processor = "x64";
-const char *qt3ds::foundation::System::g_BitWidth = "64";
-const char *qt3ds::foundation::System::g_FloatingPointModel = "";
-#elif defined(QT3DS_ARM)
-#if defined(__aarch64__) || defined(__ARM64__)
-const char *qt3ds::foundation::System::g_Processor = "arm";
-const char *qt3ds::foundation::System::g_BitWidth = "64";
-const char *qt3ds::foundation::System::g_FloatingPointModel = "softfp";
-#else
-const char *qt3ds::foundation::System::g_Processor = "arm";
-const char *qt3ds::foundation::System::g_BitWidth = "32";
-#if defined(QT3DS_ARM_HARDFP)
-const char *qt3ds::foundation::System::g_FloatingPointModel = "hardfp";
-#elif defined(QT3DS_ARM_SOFTFP)
-const char *qt3ds::foundation::System::g_FloatingPointModel = "softfp";
-#else
-#error "Unknown floating point model!"
-#endif
-#endif
-#else
-#error "Unknown Platform"
-#endif
-
-#if defined(QT3DS_ARM)
-#if defined(QT3DS_GRAPHICS_API_GLES2)
-const char *qt3ds::foundation::System::g_GPUType = "gles2";
-#elif defined(QT3DS_GRAPHICS_API_GL)
-const char *qt3ds::foundation::System::g_GPUType = "gl";
-#elif defined(QT3DS_GRAPHICS_API_GLES3)
-const char *qt3ds::foundation::System::g_GPUType = "gles3";
-#else
-#error \
- "Must define a GPU type for arm platforms (QT3DS_GRAPHICS_API_GLES2, QT3DS_GRAPHICS_API_GLES3, QT3DS_GRAPHICS_API_GL)"
-#endif
-#elif defined(QT3DS_X86)
-const char *qt3ds::foundation::System::g_GPUType = "";
-#elif defined(QT3DS_X64)
-const char *qt3ds::foundation::System::g_GPUType = "";
-#else
-#error "Must define a processor type (QT3DS_ARM or QT3DS_X86)"
-#endif
-
-namespace {
-static const unsigned SYSTEM_STR_SIZE = 100;
-void SystemAppendString(eastl::string &str, const char *delim, const char *string)
-{
- if (string && *string) {
- str.append(delim);
- str.append(string);
- }
-}
-}
-const char *System::getPlatformStr()
-{
- static char text[SYSTEM_STR_SIZE];
- {
- eastl::string str(g_Processor);
- SystemAppendString(str, "_", g_BitWidth);
- SystemAppendString(str, "_", g_FloatingPointModel);
- SystemAppendString(str, "_", g_OS);
- strcpy(text, str.c_str());
- }
- return text;
-}
-
-const char *System::getPlatformGLStr()
-{
- static char text[SYSTEM_STR_SIZE];
- {
- eastl::string str(g_Processor);
- SystemAppendString(str, "_", g_BitWidth);
- SystemAppendString(str, "_", g_FloatingPointModel);
- SystemAppendString(str, "_", g_GPUType);
- SystemAppendString(str, "_", g_OS);
- strcpy(text, str.c_str());
- }
- return text;
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.h
deleted file mode 100644
index 84ca87d1..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSSystem.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_FOUNDATION_SYSTEM_H
-#define QT3DS_FOUNDATION_SYSTEM_H
-
-#include "foundation/Qt3DS.h"
-
-namespace qt3ds {
-namespace foundation {
- class QT3DS_FOUNDATION_API System
- {
- public:
- static const char *g_OS;
- static const char *g_Processor;
- static const char *g_BitWidth;
- static const char *g_FloatingPointModel;
- static const char *g_GPUType;
- static const char *g_DLLExtension;
- static const char *getPlatformStr();
- static const char *getPlatformGLStr();
-
- private:
- System();
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSThread.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSThread.h
deleted file mode 100644
index 84e169d6..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSThread.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSTHREAD_H
-#define QT3DS_FOUNDATION_PSTHREAD_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSFoundation.h"
-
-// dsequeira: according to existing comment here (David Black would be my guess)
-// "This is useful to reduce bus contention on tight spin locks. And it needs
-// to be a macro as the xenon compiler often ignores even __forceinline." What's not
-// clear is why a pause function needs inlining...? (TODO: check with XBox team)
-
-// todo: these need to go somewhere else
-
-#if defined(QT3DS_WINDOWS)
-#define NVSpinLockPause() __asm pause
-#elif defined(QT3DS_X360)
-#define NVSpinLockPause() __asm nop
-#elif defined(QT3DS_LINUX) || defined(QT3DS_ANDROID) || defined(QT3DS_APPLE) || defined(QT3DS_QNX)
-#define NVSpinLockPause() asm("nop")
-#elif defined(QT3DS_PS3)
-#define NVSpinLockPause() asm("nop") // don't know if it's correct yet...
-#define QT3DS_TLS_MAX_SLOTS 64
-#elif defined(QT3DS_WII)
-#define NVSpinLockPause() asm { nop } // don't know if it's correct yet...
-#endif
-
-namespace qt3ds {
-namespace foundation {
- struct ThreadPriority // todo: put in some other header file
- {
- enum Enum {
- /**
- \brief High priority
- */
- eHIGH = 0,
-
- /**
- \brief Above Normal priority
- */
- eABOVE_NORMAL = 1,
-
- /**
- \brief Normal/default priority
- */
- eNORMAL = 2,
-
- /**
- \brief Below Normal priority
- */
- eBELOW_NORMAL = 3,
-
- /**
- \brief Low priority.
- */
- eLOW = 4,
-
- eFORCE_DWORD = 0xffFFffFF
- };
- };
-
- /**
- Thread abstraction API
- */
-
- class QT3DS_FOUNDATION_API Thread
- {
- public:
- static const QT3DSU32 DEFAULT_STACK_SIZE;
- typedef size_t Id; // space for a pointer or an integer
- typedef void *(*ExecuteFn)(void *);
-
- static Id getId();
-
- /**
- Construct (but do not start) the thread object. Executes in the context
- of the spawning thread
- */
-
- Thread(NVFoundationBase &foundation);
-
- /**
- Construct and start the the thread, passing the given arg to the given fn. (pthread style)
- */
-
- Thread(NVFoundationBase &foundation, ExecuteFn fn, void *arg);
-
- /**
- Deallocate all resources associated with the thread. Should be called in the
- context of the spawning thread.
- */
-
- virtual ~Thread();
-
- /**
- start the thread running. Called in the context of the spawning thread.
- */
-
- void start(QT3DSU32 stackSize);
-
- /**
- Violently kill the current thread. Blunt instrument, not recommended since
- it can leave all kinds of things unreleased (stack, memory, mutexes...) Should
- be called in the context of the spawning thread.
- */
-
- void kill();
-
- /**
- The virtual execute() method is the user defined function that will
- run in the new thread. Called in the context of the spawned thread.
- */
-
- virtual void execute(void);
-
- /**
- stop the thread. Signals the spawned thread that it should stop, so the
- thread should check regularly
- */
-
- void signalQuit();
-
- /**
- Wait for a thread to stop. Should be called in the context of the spawning
- thread. Returns false if the thread has not been started.
- */
-
- bool waitForQuit();
-
- /**
- check whether the thread is signalled to quit. Called in the context of the
- spawned thread.
- */
-
- bool quitIsSignalled();
-
- /**
- Cleanly shut down this thread. Called in the context of the spawned thread.
- */
- void quit();
-
- /**
- Change the affinity mask for this thread.
- On Xbox360, sets the hardware thread to the first non-zero bit.
-
- Returns previous mask if successful, or zero on failure
- */
- virtual QT3DSU32 setAffinityMask(QT3DSU32 mask);
-
- static ThreadPriority::Enum getPriority(Id threadId);
-
- /** Set thread priority. */
- void setPriority(ThreadPriority::Enum prio);
-
- /** set the thread's name */
- void setName(const char *name);
-
- /** Put the current thread to sleep for the given number of milliseconds */
- static void sleep(QT3DSU32 ms);
-
- /** Yield the current thread's slot on the CPU */
- static void yield();
-
- private:
- class ThreadImpl *mImpl;
- };
-
- QT3DS_FOUNDATION_API QT3DSU32 TlsAlloc();
- QT3DS_FOUNDATION_API void TlsFree(QT3DSU32 index);
- QT3DS_FOUNDATION_API void *TlsGet(QT3DSU32 index);
- QT3DS_FOUNDATION_API QT3DSU32 TlsSet(QT3DSU32 index, void *value);
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSTime.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSTime.h
deleted file mode 100644
index 955bd7e0..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSTime.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSTIME_H
-#define QT3DS_FOUNDATION_PSTIME_H
-
-#include "foundation/Qt3DS.h"
-
-#if defined(QT3DS_LINUX) || defined(QT3DS_ANDROID) || defined(QT3DS_QNX)
-#include <time.h>
-#endif
-
-namespace qt3ds {
-namespace foundation {
-
- struct CounterFrequencyToTensOfNanos
- {
- QT3DSU64 mNumerator;
- QT3DSU64 mDenominator;
- CounterFrequencyToTensOfNanos(QT3DSU64 inNum, QT3DSU64 inDenom)
- : mNumerator(inNum)
- , mDenominator(inDenom)
- {
- }
-
- // quite slow.
- QT3DSU64 toTensOfNanos(QT3DSU64 inCounter) const
- {
- return (inCounter * mNumerator) / mDenominator;
- }
- };
-
- class QT3DS_FOUNDATION_API Time
- {
- public:
- typedef double Second;
- static const QT3DSU64 sNumTensOfNanoSecondsInASecond = 100000000;
- // This is supposedly guaranteed to not change after system boot
- // regardless of processors, speedstep, etc.
- static const CounterFrequencyToTensOfNanos sCounterFreq;
-
- static CounterFrequencyToTensOfNanos getCounterFrequency();
-
- static QT3DSU64 getCurrentCounterValue();
-
- // SLOW!!
- // Thar be a 64 bit divide in thar!
- static QT3DSU64 getCurrentTimeInTensOfNanoSeconds()
- {
- QT3DSU64 ticks = getCurrentCounterValue();
- return sCounterFreq.toTensOfNanos(ticks);
- }
-
- Time();
- Second getElapsedSeconds();
- Second peekElapsedSeconds();
- Second getLastTime() const;
-
- private:
-#if defined(QT3DS_LINUX) || defined(QT3DS_ANDROID) || defined(QT3DS_APPLE) || defined(QT3DS_PSP2) \
- || defined(QT3DS_QNX)
- Second mLastTime;
-#else
- QT3DSI64 mTickCount;
-#endif
- };
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSTransform.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSTransform.h
deleted file mode 100644
index 0fee0a81..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSTransform.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_TRANSFORM_H
-#define QT3DS_FOUNDATION_QT3DS_TRANSFORM_H
-/** \addtogroup foundation
- @{
-*/
-
-#include "foundation/Qt3DSQuat.h"
-#include "foundation/Qt3DSPlane.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/*!
-\brief class representing a rigid euclidean transform as a quaternion and a vector
-*/
-
-class NVTransform
-{
-public:
- QT3DSQuat q;
- QT3DSVec3 p;
-
- //#define PXTRANSFORM_DEFAULT_CONSTRUCT_NAN
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform()
-#ifdef PXTRANSFORM_DEFAULT_CONSTRUCT_IDENTITY
- : q(0, 0, 0, 1)
- , p(0, 0, 0)
-#elif defined(PXTRANSFORM_DEFAULT_CONSTRUCT_NAN)
-#define invalid NVSqrt(-1.0f)
- : q(invalid, invalid, invalid, invalid)
- , p(invalid, invalid, invalid)
-#undef invalid
-#endif
- {
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE explicit NVTransform(const QT3DSVec3 &position)
- : q(0, 0, 0, 1)
- , p(position)
- {
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE explicit NVTransform(const QT3DSQuat &orientation)
- : q(orientation)
- , p(0, 0, 0)
- {
- QT3DS_ASSERT(orientation.isSane());
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform(const QT3DSVec3 &p0, const QT3DSQuat &q0)
- : q(q0)
- , p(p0)
- {
- QT3DS_ASSERT(q0.isSane());
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE explicit NVTransform(const QT3DSMat44 &m); // defined in Qt3DSMat44.h
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform operator*(const NVTransform &x) const
- {
- QT3DS_ASSERT(x.isSane());
- return transform(x);
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform getInverse() const
- {
- QT3DS_ASSERT(isFinite());
- return NVTransform(q.rotateInv(-p), q.getConjugate());
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 transform(const QT3DSVec3 &input) const
- {
- QT3DS_ASSERT(isFinite());
- return q.rotate(input) + p;
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 transformInv(const QT3DSVec3 &input) const
- {
- QT3DS_ASSERT(isFinite());
- return q.rotateInv(input - p);
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 rotate(const QT3DSVec3 &input) const
- {
- QT3DS_ASSERT(isFinite());
- return q.rotate(input);
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 rotateInv(const QT3DSVec3 &input) const
- {
- QT3DS_ASSERT(isFinite());
- return q.rotateInv(input);
- }
-
- //! Transform transform to parent (returns compound transform: first src, then *this)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform transform(const NVTransform &src) const
- {
- QT3DS_ASSERT(src.isSane());
- QT3DS_ASSERT(isSane());
- // src = [srct, srcr] -> [r*srct + t, r*srcr]
- return NVTransform(q.rotate(src.p) + p, q * src.q);
- }
-
- /**
- \brief returns true if finite and q is a unit quaternion
- */
-
- QT3DS_CUDA_CALLABLE bool isValid() const { return p.isFinite() && q.isFinite() && q.isUnit(); }
-
- /**
- \brief returns true if finite and quat magnitude is reasonably close to unit to allow for some
- accumulation of error vs isValid
- */
-
- QT3DS_CUDA_CALLABLE bool isSane() const { return isFinite() && q.isSane(); }
-
- /**
- \brief returns true if all elems are finite (not NAN or INF, etc.)
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isFinite() const { return p.isFinite() && q.isFinite(); }
-
- //! Transform transform from parent (returns compound transform: first src, then this->inverse)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVTransform transformInv(const NVTransform &src) const
- {
- QT3DS_ASSERT(src.isSane());
- QT3DS_ASSERT(isFinite());
- // src = [srct, srcr] -> [r^-1*(srct-t), r^-1*srcr]
- QT3DSQuat qinv = q.getConjugate();
- return NVTransform(qinv.rotate(src.p - p), qinv * src.q);
- }
-
- QT3DS_CUDA_CALLABLE static QT3DS_FORCE_INLINE NVTransform createIdentity()
- {
- return NVTransform(QT3DSVec3(0));
- }
-
- /**
- \brief transform plane
- */
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane transform(const NVPlane &plane) const
- {
- QT3DSVec3 transformedNormal = rotate(plane.n);
- return NVPlane(transformedNormal, plane.d - p.dot(transformedNormal));
- }
-
- /**
- \brief inverse-transform plane
- */
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVPlane inverseTransform(const NVPlane &plane) const
- {
- QT3DSVec3 transformedNormal = rotateInv(plane.n);
- return NVPlane(transformedNormal, plane.d + p.dot(plane.n));
- }
-};
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_TRANSFORM_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSUnionCast.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSUnionCast.h
deleted file mode 100644
index a3d03555..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSUnionCast.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_UNION_CAST_H
-#define QT3DS_FOUNDATION_QT3DS_UNION_CAST_H
-
-#include "foundation/Qt3DSPreprocessor.h"
-
-/** \addtogroup foundation
-@{
-*/
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-template <class A, class B>
-QT3DS_FORCE_INLINE A NVUnionCast(B b)
-{
- union AB {
- AB(B bb)
- : _b(bb)
- {
- }
- B _b;
- A _a;
- } u(b);
- return u._a;
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSUtilities.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSUtilities.h
deleted file mode 100644
index cb9ae6a2..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSUtilities.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_PSUTILITIES_H
-#define QT3DS_FOUNDATION_PSUTILITIES_H
-
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSIntrinsics.h"
-
-namespace qt3ds {
-namespace foundation {
-
- // PT: checked casts
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSU16 to16(QT3DSU32 value)
- {
- QT3DS_ASSERT(value <= 0xffff);
- return QT3DSU16(value);
- }
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSU8 to8(QT3DSU16 value)
- {
- QT3DS_ASSERT(value <= 0xff);
- return QT3DSU8(value);
- }
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSU8 to8(QT3DSU32 value)
- {
- QT3DS_ASSERT(value <= 0xff);
- return QT3DSU8(value);
- }
-
- template <class T>
- QT3DS_CUDA_CALLABLE QT3DS_INLINE void swap(T &x, T &y)
- {
-// crash with optimizations enabled, ticket in Sony
-#ifdef QT3DS_PSP2
-#pragma control % push O = 0
-#endif
- T tmp = x;
- x = y;
- y = tmp;
-#ifdef QT3DS_PSP2
-#pragma control % pop O
-#endif
- }
-
- /*!
-Get number of elements in array
-*/
- template <typename T, size_t N>
- char (&ArraySizeHelper(T (&array)[N]))[N];
-#define QT3DS_ARRAY_SIZE(_array) (sizeof(qt3ds::foundation::ArraySizeHelper(_array)))
-
- /*!
-Sort two elements using operator<
-
-On return x will be the smaller of the two
-*/
- template <class T>
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void order(T &x, T &y)
- {
- if (y < x)
- swap(x, y);
- }
-
- // most architectures can do predication on real comparisons, and on VMX, it matters
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void order(NVReal &x, NVReal &y)
- {
- NVReal newX = NVMin(x, y);
- NVReal newY = NVMax(x, y);
- x = newX;
- y = newY;
- }
-
- /*!
- Sort two elements using operator< and also keep order
- of any extra data
- */
- template <class T, class E1>
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE void order(T &x, T &y, E1 &xe1, E1 &ye1)
- {
- if (y < x) {
- swap(x, y);
- swap(xe1, ye1);
- }
- }
-
- QT3DS_INLINE void debugBreak()
- {
-#if defined(QT3DS_WINDOWS)
- __debugbreak();
-#elif defined(QT3DS_LINUX) || defined(QT3DS_ANDROID) || defined(QT3DS_QNX)
- asm("int $3");
-#elif defined(QT3DS_GNUC)
- __builtin_trap();
-#else
- QT3DS_ASSERT(false);
-#endif
- }
-
- bool checkValid(const float &);
- bool checkValid(const QT3DSVec3 &);
- bool checkValid(const QT3DSQuat &);
- bool checkValid(const QT3DSMat33 &);
- bool checkValid(const NVTransform &);
- bool checkValid(const char *);
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSI32 getPadding2(size_t value, QT3DSU32 alignment)
- {
- const QT3DSI32 mask = alignment - 1;
- const QT3DSI32 overhead = QT3DSI32(value) & mask;
- return (alignment - overhead) & mask;
- }
-
- // PT: "After doing a dcbz128, there is a delay of about 140 cycles before writes to that cache
- // line can proceed without stalling.
- // This is much faster than an L2 cache miss, but for ideal performance, it is best to avoid
- // this stall by doing the cache-line
- // zeroing a few cache lines ahead of where you are writing."
- QT3DS_FORCE_INLINE void invalidateCache(void *QT3DS_RESTRICT voidPtr, QT3DSI32 size)
- {
-#ifdef QT3DS_X360
- QT3DSU8 *QT3DS_RESTRICT ptr = reinterpret_cast<QT3DSU8 *>(voidPtr);
- const QT3DSI32 padding = getPadding2(size_t(ptr), 128);
- const QT3DSI32 sizeToCover = size - padding;
- if (sizeToCover >= 128) {
- QT3DSU8 *ptr128 = ptr + padding;
- QT3DSU32 nb128 = sizeToCover / 128;
- while (nb128--) {
- // NV::memZero128(ptr128);
- qt3ds::foundation::memZero128(ptr128);
- ptr128 += 128;
- }
- }
-#else
- (void)voidPtr;
- (void)size;
-#endif
- }
-
- // equivalent to std::max_element
- template <typename T>
- inline const T *maxElement(const T *first, const T *last)
- {
- const T *m = first;
- for (const T *it = first + 1; it < last; ++it)
- if (*m < *it)
- m = it;
-
- return m;
- }
-
-} // namespace foundation
-} // namespace qt3ds
-
-#define QT3DS_STRINGIZE_HELPER(X) #X
-#define QT3DS_STRINGIZE(X) QT3DS_STRINGIZE_HELPER(X)
-
-#define QT3DS_CONCAT_HELPER(X, Y) X##Y
-#define QT3DS_CONCAT(X, Y) QT3DS_CONCAT_HELPER(X, Y)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec2.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec2.h
deleted file mode 100644
index 0d86c915..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec2.h
+++ /dev/null
@@ -1,321 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_VEC2_H
-#define QT3DS_FOUNDATION_QT3DS_VEC2_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSMath.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/**
-\brief 2 Element vector class.
-
-This is a vector class with public data members.
-This is not nice but it has become such a standard that hiding the xy data members
-makes it difficult to reuse external code that assumes that these are public in the library.
-The vector class can be made to use float or double precision by appropriately defining NVReal.
-This has been chosen as a cleaner alternative to a template class.
-*/
-class QT3DSVec2
-{
-public:
- /**
- \brief default constructor leaves data uninitialized.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2() {}
-
- /**
- \brief Assigns scalar parameter to all elements.
-
- Useful to initialize to zero or one.
-
- \param[in] a Value to assign to elements.
- */
- explicit QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2(NVReal a)
- : x(a)
- , y(a)
- {
- }
-
- /**
- \brief Initializes from 2 scalar parameters.
-
- \param[in] nx Value to initialize X component.
- \param[in] ny Value to initialize Y component.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2(NVReal nx, NVReal ny)
- : x(nx)
- , y(ny)
- {
- }
-
- /**
- \brief Copy ctor.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2(const QT3DSVec2 &v)
- : x(v.x)
- , y(v.y)
- {
- }
-
- // Operators
-
- /**
- \brief Assignment operator
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 &operator=(const QT3DSVec2 &p)
- {
- x = p.x;
- y = p.y;
- return *this;
- }
-
- /**
- \brief element access
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal &operator[](int index)
- {
- QT3DS_ASSERT(index >= 0 && index <= 1);
- return (&x)[index];
- }
-
- /**
- \brief element access
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const NVReal &operator[](int index) const
- {
- QT3DS_ASSERT(index >= 0 && index <= 1);
- return (&x)[index];
- }
-
- /**
- \brief returns true if the two vectors are exactly equal.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool operator==(const QT3DSVec2 &v) const
- {
- return x == v.x && y == v.y;
- }
-
- /**
- \brief returns true if the two vectors are not exactly equal.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool operator!=(const QT3DSVec2 &v) const
- {
- return x != v.x || y != v.y;
- }
-
- /**
- \brief tests for exact zero vector
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isZero() const { return x == 0.0f && y == 0.0f; }
-
- /**
- \brief returns true if all 2 elems of the vector are finite (not NAN or INF, etc.)
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool isFinite() const { return NVIsFinite(x) && NVIsFinite(y); }
-
- /**
- \brief is normalized - used by API parameter validation
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isNormalized() const
- {
- const float unitTolerance = NVReal(1e-4);
- return isFinite() && NVAbs(magnitude() - 1) < unitTolerance;
- }
-
- /**
- \brief returns the squared magnitude
-
- Avoids calling NVSqrt()!
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal magnitudeSquared() const { return x * x + y * y; }
-
- /**
- \brief returns the magnitude
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal magnitude() const { return NVSqrt(magnitudeSquared()); }
-
- /**
- \brief negation
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 operator-() const { return QT3DSVec2(-x, -y); }
-
- /**
- \brief vector addition
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 operator+(const QT3DSVec2 &v) const
- {
- return QT3DSVec2(x + v.x, y + v.y);
- }
-
- /**
- \brief vector difference
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 operator-(const QT3DSVec2 &v) const
- {
- return QT3DSVec2(x - v.x, y - v.y);
- }
-
- /**
- \brief scalar post-multiplication
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 operator*(NVReal f) const
- {
- return QT3DSVec2(x * f, y * f);
- }
-
- /**
- \brief scalar division
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 operator/(NVReal f) const
- {
- f = NVReal(1) / f; // PT: inconsistent notation with operator /=
- return QT3DSVec2(x * f, y * f);
- }
-
- /**
- \brief vector addition
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 &operator+=(const QT3DSVec2 &v)
- {
- x += v.x;
- y += v.y;
- return *this;
- }
-
- /**
- \brief vector difference
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 &operator-=(const QT3DSVec2 &v)
- {
- x -= v.x;
- y -= v.y;
- return *this;
- }
-
- /**
- \brief scalar multiplication
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 &operator*=(NVReal f)
- {
- x *= f;
- y *= f;
- return *this;
- }
- /**
- \brief scalar division
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 &operator/=(NVReal f)
- {
- f = 1.0f / f; // PT: inconsistent notation with operator /
- x *= f;
- y *= f;
- return *this;
- }
-
- /**
- \brief returns the scalar product of this and other.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal dot(const QT3DSVec2 &v) const { return x * v.x + y * v.y; }
-
- /** return a unit vector */
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 getNormalized() const
- {
- const NVReal m = magnitudeSquared();
- return m > 0 ? *this * NVRecipSqrt(m) : QT3DSVec2(0, 0);
- }
-
- /**
- \brief normalizes the vector in place
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal normalize()
- {
- const NVReal m = magnitude();
- if (m > 0)
- *this /= m;
- return m;
- }
-
- /**
- \brief a[i] * b[i], for all i.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 multiply(const QT3DSVec2 &a) const
- {
- return QT3DSVec2(x * a.x, y * a.y);
- }
-
- /**
- \brief element-wise minimum
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 minimum(const QT3DSVec2 &v) const
- {
- return QT3DSVec2(NVMin(x, v.x), NVMin(y, v.y));
- }
-
- /**
- \brief returns MIN(x, y);
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float minElement() const { return NVMin(x, y); }
-
- /**
- \brief element-wise maximum
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec2 maximum(const QT3DSVec2 &v) const
- {
- return QT3DSVec2(NVMax(x, v.x), NVMax(y, v.y));
- }
-
- /**
- \brief returns MAX(x, y);
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float maxElement() const { return NVMax(x, y); }
-
- NVReal x, y;
-};
-
-QT3DS_CUDA_CALLABLE static QT3DS_FORCE_INLINE QT3DSVec2 operator*(NVReal f, const QT3DSVec2 &v)
-{
- return QT3DSVec2(f * v.x, f * v.y);
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_VEC2_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec3.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec3.h
deleted file mode 100644
index 24ab8231..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec3.h
+++ /dev/null
@@ -1,377 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_VEC3_H
-#define QT3DS_FOUNDATION_QT3DS_VEC3_H
-
-/** \addtogroup foundation
-@{
-*/
-
-#include "foundation/Qt3DSMath.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-/**
-\brief 3 Element vector class.
-
-This is a vector class with public data members.
-This is not nice but it has become such a standard that hiding the xyz data members
-makes it difficult to reuse external code that assumes that these are public in the library.
-The vector class can be made to use float or double precision by appropriately defining NVReal.
-This has been chosen as a cleaner alternative to a template class.
-*/
-class QT3DSVec3
-{
-public:
- /**
- \brief default constructor leaves data uninitialized.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3() {}
-
- /**
- \brief Assigns scalar parameter to all elements.
-
- Useful to initialize to zero or one.
-
- \param[in] a Value to assign to elements.
- */
- explicit QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3(NVReal a)
- : x(a)
- , y(a)
- , z(a)
- {
- }
-
- /**
- \brief Initializes from 3 scalar parameters.
-
- \param[in] nx Value to initialize X component.
- \param[in] ny Value to initialize Y component.
- \param[in] nz Value to initialize Z component.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3(NVReal nx, NVReal ny, NVReal nz)
- : x(nx)
- , y(ny)
- , z(nz)
- {
- }
-
- /**
- \brief Copy ctor.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3(const QT3DSVec3 &v)
- : x(v.x)
- , y(v.y)
- , z(v.z)
- {
- }
-
- // Operators
-
- /**
- \brief Assignment operator
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 &operator=(const QT3DSVec3 &p)
- {
- x = p.x;
- y = p.y;
- z = p.z;
- return *this;
- }
-
- /**
- \brief element access
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal &operator[](int index)
- {
- QT3DS_ASSERT(index >= 0 && index <= 2);
- return (&x)[index];
- }
-
- /**
- \brief element access
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE const NVReal &operator[](int index) const
- {
- QT3DS_ASSERT(index >= 0 && index <= 2);
- return (&x)[index];
- }
-
- /**
- \brief returns true if the two vectors are exactly equal.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool operator==(const QT3DSVec3 &v) const
- {
- return x == v.x && y == v.y && z == v.z;
- }
-
- /**
- \brief returns true if the two vectors are not exactly equal.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool operator!=(const QT3DSVec3 &v) const
- {
- return x != v.x || y != v.y || z != v.z;
- }
-
- /**
- \brief tests for exact zero vector
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isZero() const
- {
- return x == 0.0f && y == 0.0f && z == 0.0f;
- }
-
- /**
- \brief returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool isFinite() const
- {
- return NVIsFinite(x) && NVIsFinite(y) && NVIsFinite(z);
- }
-
- /**
- \brief is normalized - used by API parameter validation
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isNormalized() const
- {
- const float unitTolerance = NVReal(1e-4);
- return isFinite() && NVAbs(magnitude() - 1) < unitTolerance;
- }
-
- /**
- \brief returns the squared magnitude
-
- Avoids calling NVSqrt()!
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal magnitudeSquared() const
- {
- return x * x + y * y + z * z;
- }
-
- /**
- \brief returns the magnitude
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal magnitude() const { return NVSqrt(magnitudeSquared()); }
-
- /**
- \brief negation
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 operator-() const { return QT3DSVec3(-x, -y, -z); }
-
- /**
- \brief vector addition
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 operator+(const QT3DSVec3 &v) const
- {
- return QT3DSVec3(x + v.x, y + v.y, z + v.z);
- }
-
- /**
- \brief vector difference
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 operator-(const QT3DSVec3 &v) const
- {
- return QT3DSVec3(x - v.x, y - v.y, z - v.z);
- }
-
- /**
- \brief scalar post-multiplication
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 operator*(NVReal f) const
- {
- return QT3DSVec3(x * f, y * f, z * f);
- }
-
- /**
- \brief scalar division
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 operator/(NVReal f) const
- {
- f = NVReal(1) / f; // PT: inconsistent notation with operator /=
- return QT3DSVec3(x * f, y * f, z * f);
- }
-
- /**
- \brief vector addition
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 &operator+=(const QT3DSVec3 &v)
- {
- x += v.x;
- y += v.y;
- z += v.z;
- return *this;
- }
-
- /**
- \brief vector difference
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 &operator-=(const QT3DSVec3 &v)
- {
- x -= v.x;
- y -= v.y;
- z -= v.z;
- return *this;
- }
-
- /**
- \brief scalar multiplication
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 &operator*=(NVReal f)
- {
- x *= f;
- y *= f;
- z *= f;
- return *this;
- }
- /**
- \brief scalar division
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 &operator/=(NVReal f)
- {
- f = 1.0f / f; // PT: inconsistent notation with operator /
- x *= f;
- y *= f;
- z *= f;
- return *this;
- }
-
- /**
- \brief returns the scalar product of this and other.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal dot(const QT3DSVec3 &v) const
- {
- return x * v.x + y * v.y + z * v.z;
- }
-
- /**
- \brief cross product
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 cross(const QT3DSVec3 &v) const
- {
- return QT3DSVec3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
- }
-
- /** return a unit vector */
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 getNormalized() const
- {
- const NVReal m = magnitudeSquared();
- return m > 0 ? *this * NVRecipSqrt(m) : QT3DSVec3(0, 0, 0);
- }
-
- /**
- \brief normalizes the vector in place
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal normalize()
- {
- const NVReal m = magnitude();
- if (m > 0)
- *this /= m;
- return m;
- }
-
- /**
- \brief normalizes the vector in place. Does nothing if vector magnitude is under
- QT3DS_NORMALIZATION_EPSILON.
- Returns vector magnitude if >= QT3DS_NORMALIZATION_EPSILON and 0.0f otherwise.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal normalizeSafe()
- {
- const NVReal mag = magnitude();
- if (mag < QT3DS_NORMALIZATION_EPSILON)
- return 0.0f;
- *this *= NVReal(1) / mag;
- return mag;
- }
-
- /**
- \brief normalizes the vector in place. Asserts if vector magnitude is under
- QT3DS_NORMALIZATION_EPSILON.
- returns vector magnitude.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE NVReal normalizeFast()
- {
- const NVReal mag = magnitude();
- QT3DS_ASSERT(mag >= QT3DS_NORMALIZATION_EPSILON);
- *this *= NVReal(1) / mag;
- return mag;
- }
-
- /**
- \brief a[i] * b[i], for all i.
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 multiply(const QT3DSVec3 &a) const
- {
- return QT3DSVec3(x * a.x, y * a.y, z * a.z);
- }
-
- /**
- \brief element-wise minimum
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 minimum(const QT3DSVec3 &v) const
- {
- return QT3DSVec3(NVMin(x, v.x), NVMin(y, v.y), NVMin(z, v.z));
- }
-
- /**
- \brief returns MIN(x, y, z);
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float minElement() const { return NVMin(x, NVMin(y, z)); }
-
- /**
- \brief element-wise maximum
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE QT3DSVec3 maximum(const QT3DSVec3 &v) const
- {
- return QT3DSVec3(NVMax(x, v.x), NVMax(y, v.y), NVMax(z, v.z));
- }
-
- /**
- \brief returns MAX(x, y, z);
- */
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float maxElement() const { return NVMax(x, NVMax(y, z)); }
-
- NVReal x, y, z;
-};
-
-QT3DS_CUDA_CALLABLE static QT3DS_FORCE_INLINE QT3DSVec3 operator*(NVReal f, const QT3DSVec3 &v)
-{
- return QT3DSVec3(f * v.x, f * v.y, f * v.z);
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_VEC3_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec4.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec4.h
deleted file mode 100644
index acccd48c..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVec4.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_VEC4_H
-#define QT3DS_FOUNDATION_QT3DS_VEC4_H
-/** \addtogroup foundation
-@{
-*/
-#include "foundation/Qt3DSMath.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSAssert.h"
-
-/**
-\brief 4 Element vector class.
-
-This is a vector class with public data members.
-This is not nice but it has become such a standard that hiding the xyz data members
-makes it difficult to reuse external code that assumes that these are public in the library.
-The vector class can be made to use float or double precision by appropriately defining NVReal.
-This has been chosen as a cleaner alternative to a template class.
-*/
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-class QT3DSVec4
-{
-public:
- /**
- \brief default constructor leaves data uninitialized.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4() {}
-
- /**
- \brief Assigns scalar parameter to all elements.
-
- Useful to initialize to zero or one.
-
- \param[in] a Value to assign to elements.
- */
- explicit QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4(NVReal a)
- : x(a)
- , y(a)
- , z(a)
- , w(a)
- {
- }
-
- /**
- \brief Initializes from 3 scalar parameters.
-
- \param[in] nx Value to initialize X component.
- \param[in] ny Value to initialize Y component.
- \param[in] nz Value to initialize Z component.
- \param[in] nw Value to initialize W component.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4(NVReal nx, NVReal ny, NVReal nz, NVReal nw)
- : x(nx)
- , y(ny)
- , z(nz)
- , w(nw)
- {
- }
-
- /**
- \brief Initializes from 3 scalar parameters.
-
- \param[in] v Value to initialize the X, Y, and Z components.
- \param[in] nw Value to initialize W component.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4(const QT3DSVec3 &v, NVReal nw)
- : x(v.x)
- , y(v.y)
- , z(v.z)
- , w(nw)
- {
- }
-
- /**
- \brief Initializes from an array of scalar parameters.
-
- \param[in] v Value to initialize with.
- */
- explicit QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4(const NVReal v[])
- : x(v[0])
- , y(v[1])
- , z(v[2])
- , w(v[3])
- {
- }
-
- /**
- \brief Copy ctor.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4(const QT3DSVec4 &v)
- : x(v.x)
- , y(v.y)
- , z(v.z)
- , w(v.w)
- {
- }
-
- // Operators
-
- /**
- \brief Assignment operator
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 &operator=(const QT3DSVec4 &p)
- {
- x = p.x;
- y = p.y;
- z = p.z;
- w = p.w;
- return *this;
- }
-
- /**
- \brief element access
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal &operator[](int index)
- {
- QT3DS_ASSERT(index >= 0 && index <= 3);
- return (&x)[index];
- }
-
- /**
- \brief element access
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE const NVReal &operator[](int index) const
- {
- QT3DS_ASSERT(index >= 0 && index <= 3);
- return (&x)[index];
- }
-
- /**
- \brief returns true if the two vectors are exactly equal.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool operator==(const QT3DSVec4 &v) const
- {
- return x == v.x && y == v.y && z == v.z && w == v.w;
- }
-
- /**
- \brief returns true if the two vectors are not exactly equal.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool operator!=(const QT3DSVec4 &v) const
- {
- return x != v.x || y != v.y || z != v.z || w != v.w;
- }
-
- /**
- \brief tests for exact zero vector
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool isZero() const { return x == 0 && y == 0 && z == 0 && w == 0; }
-
- /**
- \brief returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool isFinite() const
- {
- return NVIsFinite(x) && NVIsFinite(y) && NVIsFinite(z) && NVIsFinite(w);
- }
-
- /**
- \brief is normalized - used by API parameter validation
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE bool isNormalized() const
- {
- const float unitTolerance = NVReal(1e-4);
- return isFinite() && NVAbs(magnitude() - 1) < unitTolerance;
- }
-
- /**
- \brief returns the squared magnitude
-
- Avoids calling NVSqrt()!
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal magnitudeSquared() const
- {
- return x * x + y * y + z * z + w * w;
- }
-
- /**
- \brief returns the magnitude
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal magnitude() const { return NVSqrt(magnitudeSquared()); }
-
- /**
- \brief negation
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 operator-() const { return QT3DSVec4(-x, -y, -z, -w); }
-
- /**
- \brief vector addition
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 operator+(const QT3DSVec4 &v) const
- {
- return QT3DSVec4(x + v.x, y + v.y, z + v.z, w + v.w);
- }
-
- /**
- \brief vector difference
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 operator-(const QT3DSVec4 &v) const
- {
- return QT3DSVec4(x - v.x, y - v.y, z - v.z, w - v.w);
- }
-
- /**
- \brief scalar post-multiplication
- */
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 operator*(NVReal f) const
- {
- return QT3DSVec4(x * f, y * f, z * f, w * f);
- }
-
- /**
- \brief scalar division
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 operator/(NVReal f) const
- {
- f = NVReal(1) / f;
- return QT3DSVec4(x * f, y * f, z * f, w * f);
- }
-
- /**
- \brief vector addition
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 &operator+=(const QT3DSVec4 &v)
- {
- x += v.x;
- y += v.y;
- z += v.z;
- w += v.w;
- return *this;
- }
-
- /**
- \brief vector difference
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 &operator-=(const QT3DSVec4 &v)
- {
- x -= v.x;
- y -= v.y;
- z -= v.z;
- w -= v.w;
- return *this;
- }
-
- /**
- \brief scalar multiplication
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 &operator*=(NVReal f)
- {
- x *= f;
- y *= f;
- z *= f;
- w *= f;
- return *this;
- }
- /**
- \brief scalar division
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 &operator/=(NVReal f)
- {
- f = 1.0f / f;
- x *= f;
- y *= f;
- z *= f;
- w *= f;
- return *this;
- }
-
- /**
- \brief returns the scalar product of this and other.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal dot(const QT3DSVec4 &v) const
- {
- return x * v.x + y * v.y + z * v.z + w * v.w;
- }
-
- /** return a unit vector */
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 getNormalized() const
- {
- NVReal m = magnitudeSquared();
- return m > 0 ? *this * NVRecipSqrt(m) : QT3DSVec4(0, 0, 0, 0);
- }
-
- /**
- \brief normalizes the vector in place
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE NVReal normalize()
- {
- NVReal m = magnitude();
- if (m > 0)
- *this /= m;
- return m;
- }
-
- /**
- \brief a[i] * b[i], for all i.
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 multiply(const QT3DSVec4 &a) const
- {
- return QT3DSVec4(x * a.x, y * a.y, z * a.z, w * a.w);
- }
-
- /**
- \brief element-wise minimum
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 minimum(const QT3DSVec4 &v) const
- {
- return QT3DSVec4(NVMin(x, v.x), NVMin(y, v.y), NVMin(z, v.z), NVMin(w, v.w));
- }
-
- /**
- \brief element-wise maximum
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec4 maximum(const QT3DSVec4 &v) const
- {
- return QT3DSVec4(NVMax(x, v.x), NVMax(y, v.y), NVMax(z, v.z), NVMax(w, v.w));
- }
-
- QT3DS_CUDA_CALLABLE QT3DS_INLINE QT3DSVec3 getXYZ() const { return QT3DSVec3(x, y, z); }
-
- /**
- \brief set vector elements to zero
- */
- QT3DS_CUDA_CALLABLE QT3DS_INLINE void setZero() { x = y = z = w = NVReal(0); }
-
- NVReal x, y, z, w;
-};
-
-QT3DS_CUDA_CALLABLE static QT3DS_INLINE QT3DSVec4 operator*(NVReal f, const QT3DSVec4 &v)
-{
- return QT3DSVec4(f * v.x, f * v.y, f * v.z, f * v.w);
-}
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-/** @} */
-#endif // QT3DS_FOUNDATION_QT3DS_VEC4_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVersionNumber.h b/src/Runtime/ogl-runtime/src/foundation/Qt3DSVersionNumber.h
deleted file mode 100644
index 5942ef72..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Qt3DSVersionNumber.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
-VersionNumbers: The combination of these
-numbers uniquely identifies the API, and should
-be incremented when the SDK API changes. This may
-include changes to file formats.
-
-This header is included in the main SDK header files
-so that the entire SDK and everything that builds on it
-is completely rebuilt when this file changes. Thus,
-this file is not to include a frequently changing
-build number. See BuildNumber.h for that.
-
-Each of these three values should stay below 255 because
-sometimes they are stored in a byte.
-*/
-/** \addtogroup foundation
- @{
-*/
-#ifndef QT3DS_FOUNDATION_QT3DS_VERSION_NUMBER_H
-#define QT3DS_FOUNDATION_QT3DS_VERSION_NUMBER_H
-
-#define QT3DS_FOUNDATION_VERSION_MAJOR 3
-#define QT3DS_FOUNDATION_VERSION_MINOR 3
-#define QT3DS_FOUNDATION_VERSION_BUGFIX 0
-
-/**
-The constant QT3DS_FOUNDATION_VERSION is used when creating certain PhysX module objects.
-This is to ensure that the application is using the same header version as the library was built
-with.
-*/
-#define QT3DS_FOUNDATION_VERSION \
- ((QT3DS_FOUNDATION_VERSION_MAJOR << 24) + (QT3DS_FOUNDATION_VERSION_MINOR << 16) \
- + (QT3DS_FOUNDATION_VERSION_BUGFIX << 8) + 0)
-
-#endif // QT3DS_FOUNDATION_QT3DS_VERSION_NUMBER_H
-
-/** @} */
diff --git a/src/Runtime/ogl-runtime/src/foundation/SerializationTypes.h b/src/Runtime/ogl-runtime/src/foundation/SerializationTypes.h
deleted file mode 100644
index c7fe5ce7..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/SerializationTypes.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SERIALIZATION_TYPES_H
-#define QT3DS_RENDER_SERIALIZATION_TYPES_H
-#include "EASTL/hash_map.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "foundation/Qt3DSContainers.h"
-
-namespace qt3ds {
-namespace foundation {
-
- struct SStrRemapMap : public nvhash_map<char8_t *, QT3DSU32>
- {
- typedef nvhash_map<char8_t *, QT3DSU32> TBaseType;
- SStrRemapMap(NVAllocatorCallback &inAlloc, const char *inName)
- : TBaseType(inAlloc, inName)
- {
- }
- };
-
- struct SPtrOffsetMap : public nvhash_map<const void *, QT3DSU32>
- {
- typedef nvhash_map<const void *, QT3DSU32> TBaseType;
- SPtrOffsetMap(NVAllocatorCallback &inAlloc, const char *inName)
- : TBaseType(inAlloc, inName)
- {
- }
- };
-
- struct SWriteBuffer : public MemoryBuffer<>
- {
- SWriteBuffer(NVAllocatorCallback &inAlloc, const char *inName)
- : MemoryBuffer<>(ForwardingAllocator(inAlloc, inName))
- {
- }
- };
-
- // Simple data reader that mimics a string
- struct SDataReader
- {
- QT3DSU8 *m_CurrentPtr;
- QT3DSU8 *m_EndPtr;
- SDataReader(QT3DSU8 *inStartPtr, QT3DSU8 *inEndPtr)
- : m_CurrentPtr(inStartPtr)
- , m_EndPtr(inEndPtr)
- {
- }
-
- template <typename TDataType>
- TDataType *Load()
- {
- if ((m_CurrentPtr + sizeof(TDataType)) > m_EndPtr) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- TDataType *theType = reinterpret_cast<TDataType *>(m_CurrentPtr);
- m_CurrentPtr += sizeof(TDataType);
- return theType;
- }
-
- template <typename TDataType>
- void MemCopy(TDataType *dt, QT3DSU32 count)
- {
- if (count) {
- QT3DSU32 loadSize = count * sizeof(TDataType);
- QT3DSU32 amountLeft = (QT3DSU32)(m_EndPtr - m_CurrentPtr);
- QT3DSU32 amountLoaded = NVMin(loadSize, amountLeft);
- memCopy(dt, m_CurrentPtr, amountLoaded);
- m_CurrentPtr += amountLoaded;
- if (amountLoaded < loadSize) {
- QT3DS_ASSERT(false);
- QT3DSU8 *rawPtr = (QT3DSU8 *)dt;
- rawPtr += amountLoaded;
- size_t leftover = loadSize - amountLoaded;
- // zeroing things out at least is an attempt to provide ordered
- // data that may prevent a crash in some cases.
- memZero(rawPtr, (QT3DSU32)leftover);
- }
- }
- }
-
- // Don't make a habit of using this a lot.
- template <typename TDataType>
- TDataType &LoadRef()
- {
- TDataType *retval = Load<TDataType>();
- if (!retval)
- QT3DS_ASSERT(false);
- return *retval;
- }
-
- void Align(size_t alignment)
- {
- size_t offset = (size_t)(m_CurrentPtr);
- if (offset % alignment)
- m_CurrentPtr += (alignment - (offset % alignment));
- }
-
- void Align() { Align(sizeof(void *)); }
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/Socket.cpp b/src/Runtime/ogl-runtime/src/foundation/Socket.cpp
deleted file mode 100644
index df00e606..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Socket.cpp
+++ /dev/null
@@ -1,472 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
-LuaSocket 3.0 license
-Copyright � 2004-2013 Diego Nehab
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-#include "foundation/Socket.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-
-#if defined QT3DS_WINDOWS || defined QT3DS_WIN8ARM
-#include "windows/SocketImpl.h"
-#else
-#include "linux/SocketImpl.h"
-#endif
-
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::foundation::socketimpl;
-
-namespace {
-
-#if defined QT3DS_WINDOWS || defined QT3DS_WIN8ARM
-/*-------------------------------------------------------------------------*\
-* Some systems do not provide this so that we provide our own. It's not
-* marvelously fast, but it works just fine.
-\*-------------------------------------------------------------------------*/
-int inet_aton(const char *cp, struct in_addr *inp)
-{
- unsigned int a = 0, b = 0, c = 0, d = 0;
- int n = 0, r;
- unsigned long int addr = 0;
- r = sscanf(cp, "%u.%u.%u.%u%n", &a, &b, &c, &d, &n);
- if (r == 0 || n == 0)
- return 0;
- cp += n;
- if (*cp)
- return 0;
- if (a > 255 || b > 255 || c > 255 || d > 255)
- return 0;
- if (inp) {
- addr += a;
- addr <<= 8;
- addr += b;
- addr <<= 8;
- addr += c;
- addr <<= 8;
- addr += d;
- inp->s_addr = htonl(addr);
- }
- return 1;
-}
-#endif
-
-/*-------------------------------------------------------------------------*\
-* Tries to connect to remote address (address, port)
-\*-------------------------------------------------------------------------*/
-int inet_tryconnect(p_socket ps, const char *address, unsigned short port, QT3DSU32 tm, SA *remoteAddr)
-{
- struct sockaddr_in remote;
- int err;
- memset(&remote, 0, sizeof(remote));
- remote.sin_family = AF_INET;
- remote.sin_port = htons(port);
- if (strcmp(address, "*")) {
- if (!inet_aton(address, &remote.sin_addr)) {
- struct hostent *hp = NULL;
- struct in_addr **addr;
- err = socket_gethostbyname(address, &hp);
- if (err != IO_DONE)
- return err;
- addr = (struct in_addr **)hp->h_addr_list;
- memcpy(&remote.sin_addr, *addr, sizeof(struct in_addr));
- }
- } else
- remote.sin_family = AF_UNSPEC;
- if (remoteAddr)
- memcpy(remoteAddr, &remote, sizeof(remote));
- err = socket_connect(ps, (SA *)&remote, sizeof(remote), tm);
- return err;
-}
-
-/*-------------------------------------------------------------------------*\
-* Tries to bind socket to (address, port)
-\*-------------------------------------------------------------------------*/
-int inet_trybind(p_socket ps, const char *address, unsigned short port)
-{
- struct sockaddr_in local;
- int err;
- memset(&local, 0, sizeof(local));
- /* address is either wildcard or a valid ip address */
- local.sin_addr.s_addr = htonl(INADDR_ANY);
- local.sin_port = htons(port);
- local.sin_family = AF_INET;
- if (strcmp(address, "*") && !inet_aton(address, &local.sin_addr)) {
- struct hostent *hp = NULL;
- struct in_addr **addr;
- err = socket_gethostbyname(address, &hp);
- if (err != IO_DONE)
- return err;
- addr = (struct in_addr **)hp->h_addr_list;
- memcpy(&local.sin_addr, *addr, sizeof(struct in_addr));
- }
- err = socket_bind(ps, (SA *)&local, sizeof(local));
- if (err != IO_DONE)
- socket_destroy(ps);
- return err;
-}
-
-static bool is_socket_error(int errcode)
-{
- return errcode != IO_DONE && errcode != IO_TIMEOUT;
-}
-
-const char *generalized_strerror(int err)
-{
- if (err <= 0)
- return io_strerror(err);
- else
- return socket_strerror(err);
-}
-
-struct SocketSystemCore : public NVRefCounted
-{
- NVFoundationBase &m_Foundation;
- QT3DSI32 mRefCount;
- SocketSystemCore(NVFoundationBase &fnd)
- : m_Foundation(fnd)
- , mRefCount(0)
- {
- }
- ~SocketSystemCore() { socket_close(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- static NVScopedRefCounted<SocketSystemCore> Create(NVFoundationBase &fnd)
- {
- int success = socket_open();
- if (!success) {
- qCCritical(INVALID_OPERATION, "Failed to initialize network subsystem");
- return NVScopedRefCounted<SocketSystemCore>();
- }
- return QT3DS_NEW(fnd.getAllocator(), SocketSystemCore)(fnd);
- }
-};
-
-struct SocketStreamImpl : public SocketStream
-{
- NVScopedRefCounted<SocketSystemCore> m_SocketCore;
- NVFoundationBase &m_Foundation;
- t_socket m_Socket;
- SA m_Destination;
- bool m_Connected;
- QT3DSU32 m_Timeout;
- QT3DSI32 mRefCount;
- SocketStreamImpl(SocketSystemCore &core, NVFoundationBase &fnd, t_socket s, SA dest)
- : m_SocketCore(core)
- , m_Foundation(fnd)
- , m_Socket(s)
- , m_Destination(dest)
- , m_Connected(true)
- , m_Timeout(10000)
- , mRefCount(0)
- {
- // We use wait functions in order to block.
- socket_setnonblocking(&m_Socket);
- }
-
- ~SocketStreamImpl()
- {
- shutdown();
- socket_destroy(&m_Socket);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- void setTimeout(QT3DSU32 milliseconds) override { m_Timeout = milliseconds; }
-
- bool Write(NVConstDataRef<QT3DSU8> data) override
- {
- if (m_Connected == false)
- return false;
-
- size_t totalSent = 0;
- const char *writePtr(reinterpret_cast<const char *>(data.begin()));
- size_t amountLeft = data.size();
- do {
-
- size_t amountSent = 0;
- int errcode =
- socket_send(&m_Socket, writePtr + totalSent, amountLeft, &amountSent, m_Timeout);
-
- if (is_socket_error(errcode)) {
- m_Connected = false;
- qCWarning(WARNING, "Networking error during send: %s", generalized_strerror(errcode));
- return false;
- }
- totalSent += amountSent;
- amountLeft -= amountSent;
- } while (amountLeft);
- return true;
- }
-
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- if (m_Connected == false)
- return 0;
- size_t amountReceived = 0;
- int errcode = socket_recv(&m_Socket, reinterpret_cast<char *>(data.begin()), data.size(),
- &amountReceived, m_Timeout);
- if (is_socket_error(errcode)) {
- m_Connected = false;
- qCWarning(WARNING, "Networking error during receive: %s", generalized_strerror(errcode));
- return false;
- }
- return static_cast<QT3DSU32>(amountReceived);
- }
-
- QT3DSU32 nonBlockingRead(NVDataRef<QT3DSU8> data) override
- {
- if (m_Connected == false)
- return 0;
- size_t amountReceived = 0;
- int errcode = socket_recv(&m_Socket, reinterpret_cast<char *>(data.begin()), data.size(),
- &amountReceived, 0);
- if (is_socket_error(errcode)) {
- m_Connected = false;
- qCWarning(WARNING, "Networking error during receive: %s",
- generalized_strerror(errcode));
- return false;
- }
- return static_cast<QT3DSU32>(amountReceived);
- }
-
- bool connected() override { return m_Connected; }
-
- void shutdown() override
- {
- if (m_Connected) {
- socket_shutdown(&m_Socket, 2);
- m_Connected = false;
- }
- }
-};
-
-struct FileSocketStreamImpl : public SocketStream
-{
- NVFoundationBase &m_Foundation;
- CFileSeekableIOStream m_Stream;
- FileOpenFlags m_FileFlags;
- bool m_Connected;
- QT3DSI32 mRefCount;
-
- FileSocketStreamImpl(NVFoundationBase &fnd, const char *fname, FileOpenFlags fileFlags)
- : m_Foundation(fnd)
- , m_Stream(fname, fileFlags)
- , m_FileFlags(fileFlags)
- , m_Connected(false)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- bool IsOpen() { return m_Connected && m_Stream.IsOpen(); }
-
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- if (IsOpen()) {
- QT3DSU32 retval = m_Stream.Read(data);
- if (retval < data.size())
- m_Connected = false;
- return retval;
- }
-
- return 0;
- }
-
- bool Write(NVConstDataRef<QT3DSU8> data) override
- {
- bool canWrite = m_FileFlags & FileOpenFlagValues::Write;
- if (IsOpen() && canWrite) {
- m_Stream.Write(data);
- return true;
- }
- return false;
- }
-
- void setTimeout(QT3DSU32) override {}
-
- QT3DSU32 nonBlockingRead(NVDataRef<QT3DSU8> data) override { return Read(data); }
-
- bool connected() override { return m_Connected; }
-
- void shutdown() override { m_Connected = false; }
-};
-
-struct SocketServerImpl : public SocketServer
-{
- NVScopedRefCounted<SocketSystemCore> m_SocketCore;
- NVFoundationBase &m_Foundation;
- t_socket m_Socket;
- int m_Port;
- QT3DSU32 m_Timeout;
- QT3DSI32 mRefCount;
- SocketServerImpl(SocketSystemCore &core, NVFoundationBase &fnd, t_socket s, int port)
- : m_SocketCore(core)
- , m_Foundation(fnd)
- , m_Socket(s)
- , m_Port(port)
- , m_Timeout(10000)
- , mRefCount(0)
- {
- }
-
- ~SocketServerImpl() { socket_destroy(&m_Socket); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- int port() override { return m_Port; }
-
- void setTimeout(QT3DSU32 milliseconds) override { m_Timeout = milliseconds; }
-
- NVScopedRefCounted<SocketStream> nextClient() override
- {
- SA daddr;
- memset(&daddr, 0, sizeof(daddr));
- t_socket new_socket;
- int errcode = socket_accept(&m_Socket, &new_socket, NULL, NULL, m_Timeout);
-
- if (is_socket_error(errcode)) {
- return NVScopedRefCounted<SocketStream>();
- } else if (errcode == IO_DONE) {
- return QT3DS_NEW(m_Foundation.getAllocator(),
- SocketStreamImpl)(*m_SocketCore, m_Foundation, new_socket, daddr);
- }
- return NVScopedRefCounted<SocketStream>();
- }
-};
-
-struct SocketSystemImpl : public SocketSystem
-{
- NVScopedRefCounted<SocketSystemCore> m_SocketCore;
- NVFoundationBase &m_Foundation;
- QT3DSI32 mRefCount;
- SocketSystemImpl(SocketSystemCore &core, NVFoundationBase &fnd)
- : m_SocketCore(core)
- , m_Foundation(fnd)
- , mRefCount(0)
-
- {
- }
- ~SocketSystemImpl() {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- NVScopedRefCounted<SocketStream> createStream(const char *host, QT3DSI32 port,
- QT3DSU32 timeoutMilliseconds) override
- {
- t_socket newSocket(SOCKET_INVALID);
- int errcode = socket_create(&newSocket, PF_INET, SOCK_STREAM, 0);
- if (is_socket_error(errcode)) {
- qCWarning(WARNING, "Error during connect: %s", generalized_strerror(errcode));
- return NVScopedRefCounted<SocketStream>();
- }
- SA remoteAddr;
- memset(&remoteAddr, 0, sizeof(SA));
- errcode = inet_tryconnect(&newSocket, host, (unsigned short)port, timeoutMilliseconds,
- &remoteAddr);
- if (is_socket_error(errcode)) {
- qCWarning(WARNING, "Error during connect: %s", generalized_strerror(errcode));
- return NVScopedRefCounted<SocketStream>();
- } else if (errcode == IO_DONE) {
- return QT3DS_NEW(m_Foundation.getAllocator(),
- SocketStreamImpl)(*m_SocketCore, m_Foundation, newSocket, remoteAddr);
- }
- return NVScopedRefCounted<SocketStream>();
- }
-
- NVScopedRefCounted<SocketServer> createServer(QT3DSI32 port) override
- {
- t_socket newSocket(SOCKET_INVALID);
- int errcode = socket_create(&newSocket, PF_INET, SOCK_STREAM, 0);
- if (is_socket_error(errcode)) {
- qCWarning(WARNING, "Error during create server create socket: %s",
- generalized_strerror(errcode));
- return NVScopedRefCounted<SocketServer>();
- }
- errcode = inet_trybind(&newSocket, "*", (unsigned short)port);
- if (is_socket_error(errcode)) {
- qCWarning(WARNING, "Error during create server bind: %s",
- generalized_strerror(errcode));
- return NVScopedRefCounted<SocketServer>();
- } else if (errcode == IO_DONE) {
- errcode = socket_listen(&newSocket, 10);
- if (errcode == IO_DONE) {
- return QT3DS_NEW(m_Foundation.getAllocator(),
- SocketServerImpl)(*m_SocketCore, m_Foundation, newSocket, port);
- } else
- qCWarning(WARNING, "Error during create server listen: %s",
- generalized_strerror(errcode));
- }
- return NVScopedRefCounted<SocketServer>();
- }
-};
-}
-
-NVScopedRefCounted<SocketStream>
-SocketStream::CreateFileStream(NVFoundationBase &fnd, const char *fname, FileOpenFlags flags)
-{
- return QT3DS_NEW(fnd.getAllocator(), FileSocketStreamImpl)(fnd, fname, flags);
-}
-
-NVScopedRefCounted<SocketSystem> SocketSystem::createSocketSystem(NVFoundationBase &fnd)
-{
- NVScopedRefCounted<SocketSystemCore> theCore = SocketSystemCore::Create(fnd);
- if (theCore) {
- return QT3DS_NEW(fnd.getAllocator(), SocketSystemImpl)(*theCore, fnd);
- }
- return NVScopedRefCounted<SocketSystem>();
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/Socket.h b/src/Runtime/ogl-runtime/src/foundation/Socket.h
deleted file mode 100644
index f561ab83..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Socket.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_SOCKET_H
-#define QT3DS_FOUNDATION_SOCKET_H
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-
-namespace qt3ds {
-
-class NVFoundationBase;
-namespace foundation {
-
- class SocketStream : public IInStream, public IOutStream, public NVRefCounted
- {
- public:
- // set timeout for write and blocking read operations
- // Setting to zero makes all operations nonblocking.
- virtual void setTimeout(QT3DSU32 milliseconds) = 0;
- virtual QT3DSU32 nonBlockingRead(NVDataRef<QT3DSU8> ioBuffer) = 0;
- virtual bool connected() = 0;
- virtual void shutdown() = 0;
-
- // Useful to testing systems without going into the issues that a network connection can
- // cause.
- static NVScopedRefCounted<SocketStream>
- CreateFileStream(NVFoundationBase &fnd, const char *fname, FileOpenFlags flags);
- };
-
- class SocketServer : public NVRefCounted
- {
- public:
- virtual int port() = 0;
- virtual void setTimeout(QT3DSU32 milliseconds) = 0;
- virtual NVScopedRefCounted<SocketStream> nextClient() = 0;
- };
-
- class SocketSystem : public NVRefCounted
- {
- public:
- // timeout of 0 means wait forever
- virtual NVScopedRefCounted<SocketStream>
- createStream(const char *host, QT3DSI32 port, QT3DSU32 timeoutMilliseconds = 10000) = 0;
- virtual NVScopedRefCounted<SocketServer> createServer(QT3DSI32 port) = 0;
-
- static NVScopedRefCounted<SocketSystem> createSocketSystem(NVFoundationBase &fnd);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/StrConvertUTF.h b/src/Runtime/ogl-runtime/src/foundation/StrConvertUTF.h
deleted file mode 100644
index 965867c9..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/StrConvertUTF.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_RENDER_STR_CONVERT_UTF_H
-#define QT3DS_RENDER_STR_CONVERT_UTF_H
-#include <EASTL/string.h>
-#include "foundation/ConvertUTF.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-
-namespace qt3ds {
-namespace foundation {
-
- using namespace qt3ds;
- template <typename TSrcType>
- struct ConverterType
- {
- };
- template <>
- struct ConverterType<char8_t>
- {
- typedef UTF8 TConverterType;
- };
- template <>
- struct ConverterType<char16_t>
- {
- typedef UTF16 TConverterType;
- };
- template <>
- struct ConverterType<char32_t>
- {
- typedef UTF32 TConverterType;
- };
-
- template <QT3DSU32 TWCharSize>
- struct WCharType
- {
- };
-
- template <>
- struct WCharType<2>
- {
- typedef char16_t TCharType;
- };
-
- template <>
- struct WCharType<4>
- {
- typedef char32_t TCharType;
- };
-
- typedef WCharType<sizeof(wchar_t)> TWCharEASTLConverter;
-
- template <typename TSrcType, typename TDestType>
- struct UTFConversionSelector
- {
- };
-
- template <>
- struct UTFConversionSelector<char8_t, char16_t>
- {
- static ConversionResult Convert(const UTF8 **sourceStart, const UTF8 *sourceEnd,
- UTF16 **targetStart, UTF16 *targetEnd,
- ConversionFlags flags)
- {
- return Q3DSConvertUTF8toUTF16(sourceStart, sourceEnd, targetStart, targetEnd, flags);
- }
- };
-
- template <>
- struct UTFConversionSelector<char8_t, char32_t>
- {
- static ConversionResult Convert(const UTF8 **sourceStart, const UTF8 *sourceEnd,
- UTF32 **targetStart, UTF32 *targetEnd,
- ConversionFlags flags)
- {
- return Q3DSConvertUTF8toUTF32(sourceStart, sourceEnd, targetStart, targetEnd, flags);
- }
- };
- template <>
- struct UTFConversionSelector<char16_t, char8_t>
- {
- static ConversionResult Convert(const UTF16 **sourceStart, const UTF16 *sourceEnd,
- UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
- {
- return Q3DSConvertUTF16toUTF8(sourceStart, sourceEnd, targetStart, targetEnd, flags);
- }
- };
- template <>
- struct UTFConversionSelector<char16_t, char32_t>
- {
- static ConversionResult Convert(const UTF16 **sourceStart, const UTF16 *sourceEnd,
- UTF32 **targetStart, UTF32 *targetEnd,
- ConversionFlags flags)
- {
- return Q3DSConvertUTF16toUTF32(sourceStart, sourceEnd, targetStart, targetEnd, flags);
- }
- };
- template <>
- struct UTFConversionSelector<char32_t, char8_t>
- {
- static ConversionResult Convert(const UTF32 **sourceStart, const UTF32 *sourceEnd,
- UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
- {
- return Q3DSConvertUTF32toUTF8(sourceStart, sourceEnd, targetStart, targetEnd, flags);
- }
- };
- template <>
- struct UTFConversionSelector<char32_t, char16_t>
- {
- static ConversionResult Convert(const UTF32 **sourceStart, const UTF32 *sourceEnd,
- UTF16 **targetStart, UTF16 *targetEnd,
- ConversionFlags flags)
- {
- return Q3DSConvertUTF32toUTF16(sourceStart, sourceEnd, targetStart, targetEnd, flags);
- }
- };
-
- // Convert into an EASTL string type.
- // inSrcLen may be zero in which case we analyze the string looking for the zero element.
- template <typename TSrcType, typename TDestType, typename TAllocType>
- bool ConvertUTF(const TSrcType *inSrc, size_t inSrcLen,
- eastl::basic_string<TDestType, TAllocType> &outString)
- {
- typedef typename ConverterType<TDestType>::TConverterType TDestUTFType;
- typedef typename ConverterType<TSrcType>::TConverterType TSrcUTFType;
- if (inSrc == 0 || *inSrc == 0) {
- outString.clear();
- return true;
- }
-
- if (inSrcLen == 0) {
- // empty loop intentional.
- for (const TSrcType *ptr = inSrc; ptr && *ptr; ++ptr, ++inSrcLen) {
- }
- }
-
- typename eastl::basic_string<TDestType, TAllocType>::size_type capacity =
- outString.capacity();
- if (capacity == 0)
- outString.resize((QT3DSU32)inSrcLen * 2);
- else
- outString.resize(capacity);
-
- ConversionResult theConversionResult(conversionOK);
- TDestUTFType *writePtr = NULL;
- do {
- writePtr = reinterpret_cast<TDestUTFType *>(const_cast<TDestType *>(outString.data()));
- TDestUTFType *writeEnd(writePtr + outString.size());
- const TSrcUTFType *readPtr(reinterpret_cast<const TSrcUTFType *>(inSrc));
- const TSrcUTFType *readEnd = readPtr + inSrcLen;
- theConversionResult = UTFConversionSelector<TSrcType, TDestType>::Convert(
- &readPtr, readEnd, &writePtr, writeEnd, lenientConversion);
- if (theConversionResult == targetExhausted) {
- capacity = outString.capacity() * 2;
- outString.resize(capacity);
- }
- } while (theConversionResult == targetExhausted);
-
- if (theConversionResult == conversionOK) {
- TDestUTFType *writeStart =
- reinterpret_cast<TDestUTFType *>(const_cast<TDestType *>(outString.data()));
- outString.resize((QT3DSU32)(writePtr - writeStart));
- return true;
- } else {
- outString.clear();
- QT3DS_ASSERT(false);
- return false;
- }
- }
-
-#ifdef WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
-
- template <typename TDestType, typename TAllocType>
- bool ConvertWideUTF(const wchar_t *inSrc, size_t inSrcLen,
- eastl::basic_string<TDestType, TAllocType> &outString)
- {
- return ConvertUTF((const TWCharEASTLConverter::TCharType *)inSrc, inSrcLen, outString);
- }
-
-#endif
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/StringConversion.h b/src/Runtime/ogl-runtime/src/foundation/StringConversion.h
deleted file mode 100644
index a55ebb3e..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/StringConversion.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_STRING_CONVERSION_H
-#define QT3DS_FOUNDATION_STRING_CONVERSION_H
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Utils.h"
-
-namespace qt3ds {
-namespace foundation {
-
- // Template base class so that we can convert items to and from char* and wchar_t*
- // representations
- template <typename TDataType>
- struct StringConversion
- {
- bool force_compile_error;
- };
-
- // Write the char8_t but exlude the null terminator
- // Meant to write data model values.
- // Memory buffer contains a non-null-terminated
- // char8_t string
- struct Char8TWriter
- {
- MemoryBuffer<ForwardingAllocator> &m_Buffer;
- Char8TWriter(MemoryBuffer<ForwardingAllocator> &buf)
- : m_Buffer(buf)
- {
- }
- void Write(const char8_t *value, QT3DSU32 len = 0)
- {
- if (isTrivial(value))
- return;
- if (len == 0)
- len = (QT3DSU32)StrLen(value);
- m_Buffer.write(value, len);
- }
- void Write(char8_t value) { m_Buffer.write(value); }
- void Write(bool value) { Write(value ? "True" : "False"); }
-
- // Takes care of long and float
- template <typename TDataType>
- void Write(TDataType value)
- {
- char8_t buf[256];
- QT3DSU32 numWritten =
- StringConversion<TDataType>().ToStr(value, NVDataRef<char8_t>(buf, 256));
- if (numWritten)
- Write((const char8_t *)buf);
- else {
- QT3DS_ASSERT(false);
- }
- }
-
- template <typename TDataType>
- void Write(NVConstDataRef<TDataType> values, QT3DSU32 grouping = 6, QT3DSU32 tabCount = 0)
- {
- for (QT3DSU32 idx = 0; idx < values.size(); ++idx) {
- if (idx) {
- if ((idx % grouping) == 0) {
- Write((char8_t)'\n');
- for (QT3DSU32 tabIdx = 0; tabIdx < tabCount; ++tabIdx)
- Write((char8_t)'\t');
- } else
- Write((char8_t)' ');
- }
- Write(values[idx]);
- }
- }
-
- void Write(NVConstDataRef<char8_t> values, QT3DSU32 ignored = 6)
- {
- (void)ignored;
- if (values.size() && values[0] != 0) {
- QT3DSU32 lastItem = values.size() - 1;
- if (values[lastItem] == 0)
- --lastItem;
- Write(values.begin(), lastItem + 1);
- }
- }
- };
-
- inline bool IsWhite(char8_t value)
- {
- return value == '\n' || value == '\r' || value == ' ' || value == '\t';
- }
-
- // skip until we find whitespace.
- inline char8_t *FindNextWhitespace(char8_t *input)
- {
- if (input == NULL)
- return input;
- char8_t *marker = input;
- // Empty loop intentional
- for (; *marker && !IsWhite(*marker); ++marker)
- ;
- return marker;
- }
-
- // skip until we find something that isn't whitespace.
- inline char8_t *FindNextNonWhitespace(char8_t *input)
- {
- if (input == NULL)
- return input;
- char8_t *marker = input;
- // Empty loop intentional
- for (; *marker && IsWhite(*marker); ++marker)
- ;
- return marker;
- }
-
- // Reading is destructive in the case of floating point lists, so we may
- // destroy the incoming string.
- // We are assuming the string is null-terminated at end ptr.
- struct Char8TReader
- {
- char8_t *m_StartPtr;
- // Buffer used for temp storage
- MemoryBuffer<ForwardingAllocator> &m_Buffer;
- Char8TReader(char8_t *sp, MemoryBuffer<ForwardingAllocator> &buf)
- : m_StartPtr(sp)
- , m_Buffer(buf)
- {
- }
- void Read(const char8_t *&outPtr) { outPtr = m_StartPtr; }
-
- template <typename TDataType>
- void Read(TDataType &data)
- {
- bool success = StringConversion<TDataType>().StrTo(m_StartPtr, data);
- QT3DS_ASSERT(success);
- (void)success;
- }
- // Destructive operation because we can't trust
- // strtod to do the right thing. On windows, for long strings,
- // it calls strlen every operation thus leading to basically N^2
- // behavior
- template <typename TDataType>
- void ReadRef(NVDataRef<TDataType> data)
- {
- QT3DSU32 idx = 0;
- m_StartPtr = FindNextNonWhitespace(m_StartPtr);
- for (; idx < data.size() && m_StartPtr && *m_StartPtr; ++idx) {
- char8_t *nextPtr = FindNextWhitespace(m_StartPtr);
- if (nextPtr && *nextPtr)
- *nextPtr = 0;
- else
- nextPtr = NULL;
- StringConversion<TDataType>().StrTo(m_StartPtr, data[idx]);
- m_StartPtr = nextPtr;
- if (m_StartPtr)
- m_StartPtr = FindNextNonWhitespace(m_StartPtr + 1);
- }
- QT3DS_ASSERT(idx == data.size());
- }
-
- void ReadBuffer(NVConstDataRef<char8_t> &outBuffer)
- {
- if (m_StartPtr && *m_StartPtr) {
- QT3DSU32 len = (QT3DSU32)strlen(m_StartPtr);
- outBuffer = NVConstDataRef<char8_t>(m_StartPtr, len + 1);
- }
- }
-
- // Destructive operation because we can't trust
- // strtod to do the right thing. On windows, for long strings,
- // it calls strlen every operation thus leading to basically N^2
- // behavior
- template <typename TDataType>
- void ReadBuffer(NVConstDataRef<TDataType> &outBuffer)
- {
- m_Buffer.clear();
- m_StartPtr = FindNextNonWhitespace(m_StartPtr);
- while (m_StartPtr && *m_StartPtr) {
- char8_t *nextPtr = FindNextWhitespace(m_StartPtr);
- if (nextPtr && *nextPtr)
- *nextPtr = 0;
- else
- nextPtr = NULL;
- TDataType temp;
- StringConversion<TDataType>().StrTo(m_StartPtr, temp);
- m_Buffer.write(temp);
- m_StartPtr = nextPtr;
- if (m_StartPtr)
- m_StartPtr = FindNextNonWhitespace(m_StartPtr + 1);
- }
- QT3DSU32 numItems = m_Buffer.size() / sizeof(TDataType);
- if (numItems)
- outBuffer = NVConstDataRef<TDataType>((TDataType *)m_Buffer.begin(), numItems);
- else
- outBuffer = NVConstDataRef<TDataType>();
- }
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/StringConversionImpl.h b/src/Runtime/ogl-runtime/src/foundation/StringConversionImpl.h
deleted file mode 100644
index c5063e6d..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/StringConversionImpl.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_STRING_CONVERSION_IMPL_H
-#define QT3DS_FOUNDATION_STRING_CONVERSION_IMPL_H
-#include "foundation/StringConversion.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "EABase/eabase.h"
-#include "foundation/StringTable.h"
-#include "foundation/Utils.h"
-#include "stdlib.h"
-#include "stdio.h" //snprintf
-#include <QLocale>
-
-#if !defined EA_PLATFORM_WINDOWS
-#define _snprintf snprintf
-#endif
-
-namespace qt3ds {
-namespace foundation {
-
- template <>
- struct StringConversion<bool>
- {
- QT3DSU32 ToStr(bool item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(
- _snprintf(buffer.begin(), buffer.size(), "%s", item ? "True" : "False"));
- }
- bool StrTo(const char8_t *buffer, bool &item)
- {
- if (AreEqualCaseless(buffer, "True"))
- item = true;
- else
- item = false;
- return true;
- }
- };
-
- template <>
- struct StringConversion<QT3DSU8>
- {
- QT3DSU32 ToStr(QT3DSU8 item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(
- _snprintf(buffer.begin(), buffer.size(), "%hu", static_cast<QT3DSU16>(item)));
- }
- bool StrTo(const char8_t *buffer, QT3DSU8 &item)
- {
- item = static_cast<QT3DSU8>(strtoul(buffer, NULL, 10));
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSI8>
- {
- QT3DSU32 ToStr(QT3DSI8 item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(
- _snprintf(buffer.begin(), buffer.size(), "%hd", static_cast<QT3DSI16>(item)));
- }
- bool StrTo(const char8_t *buffer, QT3DSI8 &item)
- {
- item = static_cast<QT3DSI8>(strtol(buffer, NULL, 10));
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSU16>
- {
- QT3DSU32 ToStr(QT3DSU16 item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%hu", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSU16 &item)
- {
- item = static_cast<QT3DSU16>(strtoul(buffer, NULL, 10));
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSI16>
- {
- QT3DSU32 ToStr(QT3DSI16 item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%hd", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSI16 &item)
- {
- item = static_cast<QT3DSI16>(strtol(buffer, NULL, 10));
- return true;
- }
- };
-
- template <>
- struct StringConversion<QT3DSU32>
- {
- QT3DSU32 ToStr(QT3DSU32 item, NVDataRef<char8_t> buffer)
- {
- // hope the buffer is big enough...
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%u", item));
- }
- bool StrTo(const char8_t *buffer, QT3DSU32 &item)
- {
- item = strtoul(buffer, NULL, 10);
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSI32>
- {
- QT3DSU32 ToStr(QT3DSI32 item, NVDataRef<char8_t> buffer)
- {
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%d", (int)item));
- }
- bool StrTo(const char8_t *buffer, QT3DSI32 &item)
- {
- item = strtol(buffer, NULL, 10);
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSU64>
- {
- QT3DSU32 ToStr(QT3DSU64 item, NVDataRef<char8_t> buffer)
- {
-#ifdef _WIN32
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%I64u", item));
-#else
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%lu", item));
-#endif
- }
- bool StrTo(const char8_t *buffer, QT3DSU64 &item)
- {
- item = strtoul(buffer, NULL, 10);
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSI64>
- {
- QT3DSU32 ToStr(QT3DSI64 item, NVDataRef<char8_t> buffer)
- {
-#ifdef _WIN32
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%I64d", item));
-#else
- return static_cast<QT3DSU32>(_snprintf(buffer.begin(), buffer.size(), "%ld", item));
-#endif
- }
- bool StrTo(const char8_t *buffer, QT3DSI64 &item)
- {
- item = strtol(buffer, NULL, 10);
- return true;
- }
- };
- template <>
- struct StringConversion<QT3DSF32>
- {
- QT3DSU32 ToStr(QT3DSF32 item, NVDataRef<char8_t> buffer)
- {
- QString s = QLocale::c().toString(item);
- strncpy(buffer.begin(), s.toStdString().c_str(), buffer.size());
- return s.length();
- }
- bool StrTo(const char8_t *buffer, QT3DSF32 &item)
- {
- bool ok;
- item = QLocale::c().toFloat(buffer, &ok);
- return ok;
- }
- };
-
- template <>
- struct StringConversion<QT3DSF64>
- {
- QT3DSU32 ToStr(QT3DSF64 item, NVDataRef<char8_t> buffer)
- {
- QString s = QLocale::c().toString(item);
- strncpy(buffer.begin(), s.toStdString().c_str(), buffer.size());
- return s.length();
- }
- bool StrTo(const char8_t *buffer, QT3DSF64 &item)
- {
- bool ok;
- item = QLocale::c().toDouble(buffer, &ok);
- return ok;
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/StringTable.cpp b/src/Runtime/ogl-runtime/src/foundation/StringTable.cpp
deleted file mode 100644
index 47130dca..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/StringTable.cpp
+++ /dev/null
@@ -1,700 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Utils.h"
-#include "EASTL/string.h"
-#include "EASTL/sort.h"
-#include "foundation/StrConvertUTF.h"
-#include "foundation/PreAllocatedAllocator.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/Qt3DSMutex.h"
-
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace eastl;
-
-namespace eastl {
-struct SCharAndHash
-{
- const char8_t *m_Data;
- size_t m_Hash;
- // Cache the generated hash code.
- SCharAndHash(const char8_t *inData)
- : m_Data(inData)
- , m_Hash(eastl::hash<const char8_t *>()(inData))
- {
- }
- SCharAndHash()
- : m_Data(nullptr)
- , m_Hash(0)
- {
- }
- operator const char *() const { return m_Data; }
-};
-template <>
-struct hash<SCharAndHash>
-{
- size_t operator()(const SCharAndHash &inItem) const { return inItem.m_Hash; }
-};
-
-template <>
-struct equal_to<SCharAndHash>
-{
- bool operator()(const SCharAndHash &inLhs, const SCharAndHash &inRhs) const
- {
- return char_equal_to()(inLhs.m_Data, inRhs.m_Data);
- }
-};
-}
-
-void CRegisteredString::Remap(const IStringTable &inTable)
-{
- Remap(const_cast<IStringTable &>(inTable).GetRemapMap());
-}
-
-void CRegisteredString::Remap(const SStrRemapMap &inMap)
-{
- if (IsValid()) {
- SStrRemapMap::const_iterator theIter = inMap.find((char8_t *)m_String);
- if (theIter != inMap.end())
- m_String = reinterpret_cast<const char8_t *>(theIter->second);
- else {
- QT3DS_ASSERT(false);
- // Ensure a failure here doesn't *guarantee* a crash somewhere else.
- m_String = nullptr;
- }
- } else {
- // Indicates an invalid string.
- m_String = reinterpret_cast<const char8_t *>(QT3DS_MAX_U32);
- }
-}
-
-void CRegisteredString::Remap(NVDataRef<QT3DSU8> inDataPtr)
-{
- size_t theOffset = reinterpret_cast<size_t>(m_String);
- if (theOffset >= QT3DS_MAX_U32)
- m_String = "";
- else {
- if (theOffset < inDataPtr.size())
- m_String = reinterpret_cast<char8_t *>(inDataPtr.begin() + theOffset);
- else {
- QT3DS_ASSERT(false);
- m_String = "";
- }
- }
-}
-
-namespace {
-
-const char16_t g_char16EmptyStr[] = { 0, 0, 0, 0 };
-const char32_t g_char32EmptyStr[] = { 0, 0, 0, 0 };
-
-typedef eastl::basic_string<char8_t, ForwardingAllocator> TNarrowStr;
-typedef eastl::basic_string<TWCharEASTLConverter::TCharType, ForwardingAllocator> TWideStr;
-
-inline bool isTrivialWide(const wchar_t *str)
-{
- return str == nullptr || *str == 0;
-}
-
-QT3DSU8 *AlignPointer(QT3DSU8 *inStart, QT3DSU8 *inPtr)
-{
- QT3DSU32 alignment = sizeof(void *);
- size_t numBytes = (size_t)(inPtr - inStart);
- QT3DS_ASSERT(inStart < inPtr);
- if (numBytes % alignment)
- inPtr += alignment - (numBytes % alignment);
- return inPtr;
-}
-
-QT3DSU32 Align(QT3DSU32 inValue)
-{
- QT3DSU32 alignment = sizeof(void *);
- QT3DSU32 leftover = inValue % alignment;
- if (leftover)
- inValue += alignment - leftover;
- return inValue;
-}
-
-// Structure that is written out to the file.
-// Directly after this is the string character data.
-// TWideStr& inConvertStr
-struct SStringFileData
-{
- QT3DSU32 m_StartOffset;
- QT3DSU32 m_StrLen;
- QT3DSU32 m_Handle;
- char8_t *m_Str;
- SStringFileData(QT3DSU32 len, QT3DSU32 off, QT3DSU32 handle, char8_t *data)
- : m_StartOffset(off)
- , m_StrLen(len)
- , m_Handle(handle)
- , m_Str(data)
- {
- }
- SStringFileData()
- : m_StartOffset(0)
- , m_StrLen(0)
- , m_Handle(0)
- , m_Str(nullptr)
- {
- }
- void Deallocate(NVAllocatorCallback &inAlloc)
- {
- inAlloc.deallocate(m_Str);
- m_Str = nullptr;
- }
- const char8_t *GetNarrow() { return m_Str; }
- operator CRegisteredString() const
- {
- return CRegisteredString::ISwearThisHasBeenRegistered(m_Str);
- }
- QT3DSU32 EndOffset() const { return m_StartOffset + m_StrLen; }
-
- // Used only for the lower bound operation to find a given object by offset.
- bool operator<(const SStringFileData &inOther) const
- {
- return m_StartOffset < inOther.m_StartOffset;
- }
-};
-
-struct SCharAndHandle
-{
- const char8_t *m_Data;
- QT3DSU32 m_Handle;
- SCharAndHandle()
- : m_Data(nullptr)
- , m_Handle(0)
- {
- }
- SCharAndHandle(const char8_t *data, QT3DSU32 hdl)
- : m_Data(data)
- , m_Handle(hdl)
- {
- }
- operator const char *() const { return m_Data; }
-};
-
-struct SStringFileHeader
-{
- QT3DSU32 m_NumStrings;
- QT3DSU32 m_NextHandleValue;
- // offset to the items of fixed size. Variable sized data is stored
- // up front.
- QT3DSU32 m_FixedBufferOffset;
- SStringFileHeader()
- : m_NumStrings(0)
- , m_NextHandleValue(0)
- , m_FixedBufferOffset(0)
- {
- }
-
- SStringFileHeader(QT3DSU32 ns, QT3DSU32 hv, QT3DSU32 fbo)
- : m_NumStrings(ns)
- , m_NextHandleValue(hv)
- , m_FixedBufferOffset(fbo)
- {
- }
-};
-
-// This is the core of the string table.
-struct SStringFileDataList
-{
- typedef nvhash_map<SCharAndHash, SCharAndHandle> TMapType;
- typedef nvhash_map<QT3DSU32, const char8_t *> THandleMapType;
-
- mutable SPreAllocatedAllocator m_Allocator;
-
- // When we load from a file, we get a these items
- NVConstDataRef<SStringFileData> m_DataBlock;
- NVConstDataRef<eastl::pair<size_t, QT3DSU32>> m_HashDataBlockOffset;
- NVConstDataRef<eastl::pair<QT3DSU32, QT3DSU32>> m_HandleDataBlockOffset;
-
- // When we are running normally, this items get mangled
- nvvector<SStringFileData> m_AppendedStrings;
-
-protected:
- // Built roughly on demand
- SStrRemapMap m_StrRemapMap;
- TMapType m_HashToStrMap;
- THandleMapType m_HandleToStrMap;
- QT3DSU32 m_NextHandleValue;
-
-public:
- SStringFileDataList(NVAllocatorCallback &inAlloc)
- : m_Allocator(inAlloc)
- , m_AppendedStrings(inAlloc, "StringTable::m_AppendedStrings")
- , m_StrRemapMap(inAlloc, "StringTable::m_StrRemapMap")
- , m_HashToStrMap(inAlloc, "StringTable::m_HashToStrMap")
- , m_HandleToStrMap(inAlloc, "StringTable::m_HashToStrMap")
- , m_NextHandleValue(1)
- {
- }
- ~SStringFileDataList()
- {
- for (QT3DSU32 idx = 0, end = m_AppendedStrings.size(); idx < end; ++idx)
- m_AppendedStrings[idx].Deallocate(m_Allocator);
- }
-
- SStrRemapMap &GetRemapMap()
- {
- if (m_StrRemapMap.empty()) {
- for (QT3DSU32 idx = 0, end = m_DataBlock.size(); idx < end; ++idx)
- m_StrRemapMap.insert(
- eastl::make_pair(m_DataBlock[idx].m_Str, m_DataBlock[idx].m_StartOffset));
- for (QT3DSU32 idx = 0, end = m_AppendedStrings.size(); idx < end; ++idx)
- m_StrRemapMap.insert(eastl::make_pair(m_AppendedStrings[idx].m_Str,
- m_AppendedStrings[idx].m_StartOffset));
- }
- return m_StrRemapMap;
- }
-
- struct SHashPairComparator
- {
- bool operator()(const eastl::pair<size_t, QT3DSU32> &lhs,
- const eastl::pair<size_t, QT3DSU32> &rhs) const
- {
- return lhs.first < rhs.first;
- }
- };
-
- struct SHandlePairComparator
- {
- bool operator()(const eastl::pair<QT3DSU32, QT3DSU32> &lhs,
- const eastl::pair<QT3DSU32, QT3DSU32> &rhs) const
- {
- return lhs.first < rhs.first;
- }
- };
-
- SCharAndHandle DoFindStr(SCharAndHash hashCode)
- {
- if (isTrivial(hashCode.m_Data))
- return SCharAndHandle();
- TMapType::iterator theFind = m_HashToStrMap.find(hashCode);
- if (theFind == m_HashToStrMap.end()) {
- SCharAndHandle newStr = FindStrByHash(hashCode);
- if (!newStr.m_Data)
- newStr = Append(hashCode);
-
- // It may not be obvious why we have to reset the data member.
- // we have to do this so the hashtable keys don't change if the user isn't
- // passing in a persistent string.
- hashCode.m_Data = newStr;
-
- theFind = m_HashToStrMap.insert(eastl::make_pair(hashCode, newStr)).first;
- m_HandleToStrMap.insert(eastl::make_pair(theFind->second.m_Handle, newStr));
- }
- return theFind->second;
- }
-
- const CRegisteredString FindStr(SCharAndHash hashCode)
- {
- SCharAndHandle result = DoFindStr(hashCode);
- if (result.m_Data)
- return CRegisteredString::ISwearThisHasBeenRegistered(result.m_Data);
- return CRegisteredString();
- }
-
- const CStringHandle FindStrHandle(SCharAndHash hashCode)
- {
- SCharAndHandle result = DoFindStr(hashCode);
- return CStringHandle::ISwearThisHasBeenRegistered(result.m_Handle);
- }
-
- const CRegisteredString FindStrByHandle(QT3DSU32 handle)
- {
- if (handle == 0)
- return CRegisteredString();
-
- THandleMapType::iterator theFind = m_HandleToStrMap.find(handle);
- if (theFind == m_HandleToStrMap.end()) {
- const char8_t *newStr = FindStrByHandleData(handle);
- if (!newStr)
- return CRegisteredString();
- theFind = m_HandleToStrMap.insert(eastl::make_pair(handle, newStr)).first;
- }
- return CRegisteredString::ISwearThisHasBeenRegistered(theFind->second);
- }
-
- void Save(SWriteBuffer &ioBuffer) const
- {
- // Buffer should be aligned before we get to it.
- QT3DS_ASSERT(ioBuffer.size() % 4 == 0);
-
- QT3DSU32 numStrs = Size();
- size_t bufferBegin = ioBuffer.size();
- SStringFileHeader theHeader;
- ioBuffer.write(theHeader);
- QT3DSU32 startOffset = ioBuffer.size();
-
- eastl::vector<eastl::pair<size_t, QT3DSU32>> hashToStringIndex;
- eastl::vector<eastl::pair<QT3DSU32, QT3DSU32>> handleToStringIndex;
- hashToStringIndex.reserve(numStrs);
- handleToStringIndex.reserve(numStrs);
- WriteStringBlockData(m_DataBlock.begin(), m_DataBlock.end(), ioBuffer, hashToStringIndex,
- handleToStringIndex);
- WriteStringBlockData(m_AppendedStrings.data(),
- m_AppendedStrings.data() + m_AppendedStrings.size(), ioBuffer,
- hashToStringIndex, handleToStringIndex);
- ioBuffer.align(4);
-
- QT3DSU32 fixedOffset = ioBuffer.size() - startOffset;
- WriteStringBlock(m_DataBlock.begin(), m_DataBlock.end(), ioBuffer);
- WriteStringBlock(m_AppendedStrings.data(),
- m_AppendedStrings.data() + m_AppendedStrings.size(), ioBuffer);
-
- // sort by hash code so we can do binary lookups later.
- eastl::sort(hashToStringIndex.begin(), hashToStringIndex.end(), SHashPairComparator());
- ioBuffer.write(hashToStringIndex.data(), (QT3DSU32)hashToStringIndex.size());
-
- eastl::sort(handleToStringIndex.begin(), handleToStringIndex.end(),
- SHandlePairComparator());
- ioBuffer.write(handleToStringIndex.data(), (QT3DSU32)handleToStringIndex.size());
-
- SStringFileHeader *fixedOffsetPtr =
- reinterpret_cast<SStringFileHeader *>(ioBuffer.begin() + bufferBegin);
- *fixedOffsetPtr = SStringFileHeader(numStrs, m_NextHandleValue, fixedOffset);
- }
-
- void Load(NVDataRef<QT3DSU8> inMemory)
- {
- QT3DS_ASSERT(m_AppendedStrings.empty());
- m_Allocator.m_PreAllocatedBlock = inMemory;
- m_Allocator.m_OwnsMemory = false;
- SDataReader theReader(inMemory.begin(), inMemory.end());
- SStringFileHeader theHeader = theReader.LoadRef<SStringFileHeader>();
- QT3DSU32 numStrs = theHeader.m_NumStrings;
- m_NextHandleValue = theHeader.m_NextHandleValue;
- QT3DSU32 fixedOffset = theHeader.m_FixedBufferOffset;
- theReader.m_CurrentPtr += fixedOffset;
- m_DataBlock = NVConstDataRef<SStringFileData>(
- reinterpret_cast<const SStringFileData *>(theReader.m_CurrentPtr), numStrs);
- theReader.m_CurrentPtr += sizeof(SStringFileData) * numStrs;
-
- m_HashDataBlockOffset = NVConstDataRef<eastl::pair<size_t, QT3DSU32>>(
- reinterpret_cast<const eastl::pair<size_t, QT3DSU32> *>(theReader.m_CurrentPtr), numStrs);
- theReader.m_CurrentPtr += sizeof(eastl::pair<size_t, QT3DSU32>) * numStrs;
-
- m_HandleDataBlockOffset = NVConstDataRef<eastl::pair<QT3DSU32, QT3DSU32>>(
- reinterpret_cast<const eastl::pair<QT3DSU32, QT3DSU32> *>(theReader.m_CurrentPtr), numStrs);
-
- for (QT3DSU32 idx = 0, end = m_DataBlock.size(); idx < end; ++idx) {
- SStringFileData &theData = const_cast<SStringFileData &>(m_DataBlock[idx]);
- theData.m_Str = reinterpret_cast<char8_t *>(inMemory.mData + theData.m_StartOffset);
- }
- }
-
-protected:
- // When we load from a file, we do not put every string into the hash because building
- // hashtables takes
- // time. We only put them into the hash on demand; this avoids building a giant hashtable upon
- // load.
- // and since in general we do not need to lookup all hash values again it avoids building the
- // hashtable
- // in general.
- SCharAndHandle FindStrByHash(SCharAndHash hashCode) const
- {
- const eastl::pair<size_t, QT3DSU32> *iter =
- eastl::lower_bound(m_HashDataBlockOffset.begin(), m_HashDataBlockOffset.end(),
- eastl::make_pair(hashCode.m_Hash, (QT3DSU32)0), SHashPairComparator());
-
- for (; iter != m_HashDataBlockOffset.end() && iter->first == hashCode.m_Hash; ++iter) {
- if (AreEqual(m_DataBlock[iter->second].m_Str, hashCode.m_Data))
- return SCharAndHandle(m_DataBlock[iter->second].m_Str,
- m_DataBlock[iter->second].m_Handle);
- }
- return SCharAndHandle();
- }
-
- const char8_t *FindStrByHandleData(QT3DSU32 handle) const
- {
- const eastl::pair<QT3DSU32, QT3DSU32> *iter =
- eastl::lower_bound(m_HandleDataBlockOffset.begin(), m_HandleDataBlockOffset.end(),
- eastl::make_pair(handle, (QT3DSU32)0), SHandlePairComparator());
-
- if (iter != m_HandleDataBlockOffset.end() && iter->first == handle
- && m_DataBlock[iter->second].m_Handle == handle)
- return m_DataBlock[iter->second].m_Str;
- return nullptr;
- }
-
- void WriteStringBlockData(const SStringFileData *begin, const SStringFileData *end,
- SWriteBuffer &ioBuffer,
- eastl::vector<eastl::pair<size_t, QT3DSU32>> &ioHashToStringIndex,
- eastl::vector<eastl::pair<QT3DSU32, QT3DSU32>> &ioHandleToStringIndex) const
- {
- for (const SStringFileData *iter = begin; iter != end; ++iter) {
- size_t idx = ioHashToStringIndex.size();
- SCharAndHash theHash(iter->m_Str);
- ioHashToStringIndex.push_back(eastl::make_pair(theHash.m_Hash, (QT3DSU32)idx));
- ioHandleToStringIndex.push_back(eastl::make_pair(iter->m_Handle, (QT3DSU32)idx));
- ioBuffer.write(iter->m_Str, iter->m_StrLen);
- }
- }
-
- void WriteStringBlock(const SStringFileData *begin, const SStringFileData *end,
- SWriteBuffer &ioBuffer) const
- {
- for (const SStringFileData *iter = begin; iter != end; ++iter)
- ioBuffer.write(*iter);
- }
-
- SCharAndHandle Append(SCharAndHash inStrHash)
- {
- if (isTrivial(inStrHash.m_Data))
- return SCharAndHandle();
-
- const char8_t *inStr(inStrHash.m_Data);
- QT3DSU32 len = (QT3DSU32)strlen(inStr) + 1;
- char8_t *newStr = (char8_t *)m_Allocator.allocate(len, "StringData", __FILE__, __LINE__);
- memCopy(newStr, inStr, len);
-
- // We write the number of strings to the file just after the header.
- QT3DSU32 theOffset = sizeof(SStringFileHeader);
- if (Size())
- theOffset = Back().EndOffset();
-
- QT3DSU32 handleValue = m_NextHandleValue;
- ++m_NextHandleValue;
- m_AppendedStrings.push_back(SStringFileData(len, theOffset, handleValue, newStr));
-
- // Only add to the str map if necessary because building it could be expensive.
- if (m_StrRemapMap.empty() == false)
- m_StrRemapMap.insert(eastl::make_pair(newStr, theOffset));
-
- return SCharAndHandle(newStr, handleValue);
- }
- // precondition is that size != 0
- const SStringFileData &Back() const
- {
- QT3DS_ASSERT(Size());
-
- if (m_AppendedStrings.size()) {
- return m_AppendedStrings.back();
- } else {
- return m_DataBlock[m_DataBlock.size() - 1];
- }
- }
-
- QT3DSU32 Size() const { return static_cast<QT3DSU32>(m_AppendedStrings.size() + m_DataBlock.size()); }
-};
-
-struct SStringTableMutexScope
-{
- Mutex *m_Mutex;
- SStringTableMutexScope(Mutex *inM)
- : m_Mutex(inM)
- {
- if (m_Mutex)
- m_Mutex->lock();
- }
- ~SStringTableMutexScope()
- {
- if (m_Mutex)
- m_Mutex->unlock();
- }
-};
-
-#define STRING_TABLE_MULTITHREADED_METHOD SStringTableMutexScope __locker(m_MultithreadMutex)
-
-class StringTable : public IStringTable
-{
- typedef nvhash_map<SCharAndHash, QT3DSU32> TMapType;
- typedef nvhash_map<CRegisteredString, TWideStr> TNarrowToWideMapType;
- SStringFileDataList m_FileData;
- NVAllocatorCallback &m_Allocator;
- TNarrowToWideMapType m_StrWideMap;
- volatile QT3DSI32 mRefCount; // fnd's naming convention
- eastl::basic_string<char8_t, ForwardingAllocator> m_ConvertBuffer;
- TWideStr m_WideConvertBuffer;
- Mutex m_MultithreadMutexBacker;
- Mutex *m_MultithreadMutex;
- // Data that will be written out to the file.
-
-public:
- StringTable(NVAllocatorCallback &alloc)
- : m_FileData(alloc)
- , m_Allocator(m_FileData.m_Allocator)
- , m_StrWideMap(alloc, "StringTable::m_StrWideMap")
- , mRefCount(0)
- , m_ConvertBuffer(ForwardingAllocator(alloc, "StringTable::m_ConvertBuffer"))
- , m_WideConvertBuffer(ForwardingAllocator(alloc, "StringTable::m_WideConvertBuffer"))
- , m_MultithreadMutexBacker(alloc)
- , m_MultithreadMutex(nullptr)
- {
- }
-
- virtual ~StringTable() override {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_FileData.m_Allocator.m_Allocator)
-
- void EnableMultithreadedAccess() override
- {
- m_MultithreadMutex = &m_MultithreadMutexBacker;
- }
-
- void DisableMultithreadedAccess() override
- {
- m_MultithreadMutex = nullptr;
- }
-
- CRegisteredString RegisterStr(const QString &str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- if (str.isEmpty())
- return CRegisteredString();
- return RegisterStr(str.toUtf8());
- }
-
- CRegisteredString RegisterStr(const QByteArray &str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- if (str.isEmpty())
- return CRegisteredString();
- return RegisterStr(str.constData());
- }
-
- CRegisteredString RegisterStr(const eastl::string &string) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- return RegisterStr(string.c_str());
- }
-
- CRegisteredString RegisterStr(Qt3DSBCharPtr str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- if (isTrivial(str))
- return CRegisteredString();
- return m_FileData.FindStr(str);
- }
-
- // utf-16->utf-8
- CRegisteredString RegisterStr(const char16_t *str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- qt3ds::foundation::ConvertUTF(str, 0, m_ConvertBuffer);
- return RegisterStr(m_ConvertBuffer.c_str());
- }
- // utf-32->utf-8
- CRegisteredString RegisterStr(const char32_t *str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- qt3ds::foundation::ConvertUTF(str, 0, m_ConvertBuffer);
- return RegisterStr(m_ConvertBuffer.c_str());
- }
-
- CRegisteredString RegisterStr(const wchar_t *str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- if (isTrivialWide(str))
- return CRegisteredString();
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const TWCharEASTLConverter::TCharType *>(str), 0,
- m_ConvertBuffer);
- return RegisterStr(m_ConvertBuffer.c_str());
- }
-
- CStringHandle GetHandle(Qt3DSBCharPtr str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- return m_FileData.FindStrHandle(str);
- }
-
- CRegisteredString HandleToStr(QT3DSU32 strHandle) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- return m_FileData.FindStrByHandle(strHandle);
- }
-
- const wchar_t *GetWideStr(CRegisteredString theStr)
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- eastl::pair<TNarrowToWideMapType::iterator, bool> pair_iter = m_StrWideMap.insert(
- eastl::make_pair(theStr, TWideStr(ForwardingAllocator(m_Allocator, "WideString"))));
- if (pair_iter.second)
- qt3ds::foundation::ConvertUTF(theStr.c_str(), 0, pair_iter.first->second);
- return reinterpret_cast<const wchar_t *>(pair_iter.first->second.c_str());
- }
-
- const wchar_t *GetWideStr(Qt3DSBCharPtr src) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- if (isTrivial(src))
- return L"";
- return GetWideStr(RegisterStr(src));
- }
-
- const wchar_t *GetWideStr(const wchar_t *str) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- if (isTrivialWide(str))
- return L"";
- qt3ds::foundation::ConvertUTF(
- reinterpret_cast<const TWCharEASTLConverter::TCharType *>(str), 0,
- m_ConvertBuffer);
- return GetWideStr(RegisterStr(m_ConvertBuffer.c_str()));
- }
-
- const SStrRemapMap &GetRemapMap() override { return m_FileData.GetRemapMap(); }
-
- NVAllocatorCallback &GetAllocator() override { return m_FileData.m_Allocator.m_Allocator; }
-
- // Save to a block of memory. It is up the callers to deallocate using allocator
- // from GetAllocator(). Returns a remap map that takes existing strings and changes their
- // address such that they are offsets into the block of memory where this object
- // started saving. Returns a map that converts registered strings into offsets of the
- // written buffer.
- void Save(SWriteBuffer &ioBuffer) const override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- m_FileData.Save(ioBuffer);
- }
-
- // Load all the strings from inMemory. inMemory is not freed by this object
- // Finally, you will need to take inMemory and call remap on all strings
- // from offsets back into their correct address into inMemory.
- void Load(qt3ds::foundation::NVDataRef<QT3DSU8> inMemory) override
- {
- STRING_TABLE_MULTITHREADED_METHOD;
- m_FileData.Load(inMemory);
- }
-};
-}
-
-const char16_t *char16EmptyStr = g_char16EmptyStr;
-const char32_t *char32EmptyStr = g_char32EmptyStr;
-
-IStringTable &IStringTable::CreateStringTable(NVAllocatorCallback &alloc)
-{
- return *QT3DS_NEW(alloc, StringTable)(alloc);
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/StringTable.h b/src/Runtime/ogl-runtime/src/foundation/StringTable.h
deleted file mode 100644
index aa57857a..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/StringTable.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_STRING_TABLE_H
-#define QT3DS_RENDER_STRING_TABLE_H
-
-#if defined(_WIN32) || defined(__QNXNTO__)
-#include <wchar.h>
-#ifndef WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
-#define WIDE_IS_DIFFERENT_TYPE_THAN_CHAR16_T
-#endif
-#endif
-
-#include <QtCore/qstring.h>
-#include <QtCore/qbytearray.h>
-
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "EASTL/string.h"
-#include "EASTL/functional.h"
-#include "EABase/eabase.h" //char16_t definition
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSOption.h"
-
-#include <QtCore/qstring.h>
-
-namespace qt3ds {
-namespace foundation {
- typedef char8_t Qt3DSBChar;
- typedef const char8_t *Qt3DSBCharPtr;
- class IStringTable;
-
- // Serialization types, NVRenderSerializationTypes.h
- struct SStrRemapMap;
- struct SWriteBuffer;
-
- class CRegisteredString;
-
- // Discriminated union of either data ref or str table
- // used so clients can test serialization without actually saving
- // the string table out and rebooting the entire system.
- class CStrTableOrDataRef
- {
- Option<NVDataRef<QT3DSU8>> m_DataRef;
- IStringTable *m_StrTable;
-
- public:
- CStrTableOrDataRef()
- : m_StrTable(NULL)
- {
- }
- CStrTableOrDataRef(NVDataRef<QT3DSU8> inData)
- : m_DataRef(inData)
- {
- }
- CStrTableOrDataRef(IStringTable &inStrTable)
- : m_StrTable(&inStrTable)
- {
- }
- CStrTableOrDataRef(const CStrTableOrDataRef &inOther)
- : m_DataRef(inOther.m_DataRef)
- , m_StrTable(inOther.m_StrTable)
- {
- }
- CStrTableOrDataRef &operator=(const CStrTableOrDataRef &inOther)
- {
- m_DataRef = inOther.m_DataRef;
- m_StrTable = inOther.m_StrTable;
- return *this;
- }
- bool HasStrTable() const { return m_StrTable != NULL; }
- bool HasDataRef() const { return m_DataRef.hasValue(); }
- NVDataRef<QT3DSU8> GetDataRef() const { return *m_DataRef; }
- IStringTable *GetStringTable() const
- {
- QT3DS_ASSERT(m_StrTable);
- return m_StrTable;
- }
- };
-
- // String that can only be constructed from strings in the string table.
- // These strings are valid utf-8 strings
- class CRegisteredString
- {
- Qt3DSBCharPtr m_String;
-
- public:
- CRegisteredString()
- : m_String("")
- {
- }
- CRegisteredString(const CRegisteredString &inOther)
- : m_String(inOther.m_String)
- {
- }
- CRegisteredString &operator=(const CRegisteredString &inOther)
- {
- m_String = inOther.m_String;
- return *this;
- }
-
- bool operator==(const CRegisteredString &inStr) const { return m_String == inStr.m_String; }
- // If you use this in a real map then you will get them sorted roughly by the correct
- // order.
- bool operator<(const char *inStr) const
- {
- // Ensure non-null strings to strcmp.
- const char *myStr = m_String ? m_String : "";
- inStr = inStr ? inStr : "";
- int answer;
- while (*myStr && *inStr) {
- answer = *inStr - *myStr;
- if (answer)
- return answer < 0;
- ++myStr;
- ++inStr;
- }
- answer = *inStr - *myStr;
- return answer < 0;
- }
- size_t hash() const { return eastl::hash<size_t>()(reinterpret_cast<size_t>(m_String)); }
- operator Qt3DSBCharPtr() const { return c_str(); }
- Qt3DSBCharPtr c_str() const { return m_String ? m_String : ""; }
- bool IsValid() const { return m_String && *m_String; }
-
- // If this string is in the map, changes it to the map value.
- void Remap(const SStrRemapMap &inMap);
-
- void Remap(const IStringTable &inTable);
-
- // Using m_String as an offset, if possible remap into
- // inDataPtr's block of memory
- void Remap(NVDataRef<QT3DSU8> inDataPtr);
-
- void Remap(const CStrTableOrDataRef &inRef)
- {
- if (inRef.HasDataRef())
- Remap(inRef.GetDataRef());
- else if (inRef.HasStrTable())
- Remap(*inRef.GetStringTable());
- else {
- QT3DS_ASSERT(false);
- }
- }
-
- static CRegisteredString ISwearThisHasBeenRegistered(Qt3DSBCharPtr str)
- {
- CRegisteredString retval;
- retval.m_String = str;
- return retval;
- }
- };
-
- inline uint qHash(const CRegisteredString &rString)
- {
- return eastl::hash<uint>()(reinterpret_cast<size_t>(rString.c_str()));
- }
-
- class IStringTable;
-
- class CStringHandle
- {
- QT3DSU32 m_Data;
-
- CStringHandle(QT3DSU32 hdl)
- : m_Data(hdl)
- {
- }
-
- public:
- CStringHandle()
- : m_Data(0)
- {
- }
- CStringHandle(const CStringHandle &other)
- : m_Data(other.m_Data)
- {
- }
- CStringHandle &operator=(const CStringHandle &other)
- {
- m_Data = other.m_Data;
- return *this;
- }
- bool IsValid() const { return m_Data != 0; }
- QT3DSU32 handle() const { return m_Data; }
- inline const char8_t *c_str(IStringTable &strTable) const;
- operator QT3DSU32() const { return m_Data; }
- static CStringHandle ISwearThisHasBeenRegistered(QT3DSU32 strHandle)
- {
- return CStringHandle(strHandle);
- }
- };
-
- // String table stores strings in utf-8 format and does valid utf-16,utf-32 -> utf-8
- // also converts utf8 -> either utf-32 or utf-16, depending on sizeof( wchar_t ) if
- // requested.
- // UICStrConvertUTF.h
- // Also generates offsets that are consistent so clients can convert their strings
- // to offsets during save and convert from offset to string during load regardless
- // of if they load before or after this table.
- class QT3DS_AUTOTEST_EXPORT IStringTable : public NVRefCounted
- {
- public:
- // default state is for multithreaded access to be disabled.
- // remember to implement in CNullStringManager in UICTestPresentation.hxx
- virtual void EnableMultithreadedAccess() = 0;
- virtual void DisableMultithreadedAccess() = 0;
-
- virtual CRegisteredString RegisterStr(const QByteArray &str) = 0;
- virtual CRegisteredString RegisterStr(const QString &str) = 0;
- virtual CRegisteredString RegisterStr(const eastl::string &string) = 0;
-
- virtual CRegisteredString RegisterStr(Qt3DSBCharPtr str) = 0;
- // utf-16->utf-8
- virtual CRegisteredString RegisterStr(const char16_t *str) = 0;
- // utf-32->utf-8
- virtual CRegisteredString RegisterStr(const char32_t *str) = 0;
-
- virtual CStringHandle GetHandle(Qt3DSBCharPtr str) = 0;
- virtual CRegisteredString HandleToStr(QT3DSU32 strHandle) = 0;
-
- virtual CRegisteredString RegisterStr(const wchar_t *str) = 0;
-
- virtual const wchar_t *GetWideStr(Qt3DSBCharPtr src) = 0;
- virtual const wchar_t *GetWideStr(const wchar_t *str) = 0;
-
- Qt3DSBCharPtr GetNarrowStr(const wchar_t *src) { return RegisterStr(src); }
- Qt3DSBCharPtr GetNarrowStr(Qt3DSBCharPtr src) { return RegisterStr(src); }
-
- // The string table maintains a map that will tell clients where their strings will be
- // in terms of offsets into the data that the string table writes.
- // This map will change each time a new string is added to the string table.
- // Conversion from string -> data offset.
- virtual const SStrRemapMap &GetRemapMap() = 0;
-
- virtual NVAllocatorCallback &GetAllocator() = 0;
-
- // Save to a block of memory. It is up the callers to deallocate using allocator
- // from GetAllocator(). Returns a remap map that takes existing strings and changes their
- // address such that they are offsets into the block of memory where this object
- // started saving. Returns a map that converts registered strings into offsets of the
- // written buffer.
- virtual void Save(SWriteBuffer &ioBuffer) const = 0;
-
- // Load all the strings from inMemory. inMemory is not freed by this object
- // Finally, you will need to take inMemory and call remap on all strings
- // from offsets back into their correct address into inMemory.
- virtual void Load(qt3ds::foundation::NVDataRef<QT3DSU8> inMemory) = 0;
-
- static IStringTable &CreateStringTable(NVAllocatorCallback &alloc);
- };
-
- inline const char8_t *CStringHandle::c_str(IStringTable &strTable) const
- {
- return strTable.HandleToStr(m_Data);
- }
-}
-}
-
-// eastl extensions to allow easy hashtable creation using string table strings.
-namespace eastl {
-
-template <>
-struct hash<qt3ds::foundation::CRegisteredString>
-{
- size_t operator()(const qt3ds::foundation::CRegisteredString &str) const { return str.hash(); }
-};
-
-template <>
-struct equal_to<qt3ds::foundation::CRegisteredString>
-{
- bool operator()(const qt3ds::foundation::CRegisteredString &lhs,
- const qt3ds::foundation::CRegisteredString &rhs) const
- {
- return lhs == rhs;
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/StringTools.h b/src/Runtime/ogl-runtime/src/foundation/StringTools.h
deleted file mode 100644
index 43324b46..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/StringTools.h
+++ /dev/null
@@ -1,614 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_STRING_H
-#define QT3DS_RENDER_STRING_H
-#include <QtCore/qstring.h>
-#include <QtCore/qbytearray.h>
-#include <QtCore/qhash.h>
-#include <string>
-
-#include "Qt3DSRender.h"
-#include "EASTL/string.h"
-
-namespace qt3ds {
-namespace foundation {
-
-class Qt3DSStringUtils {
-public:
- static inline QString ConvertUTFtoQString(const char16_t *string)
- {
- return QString::fromUtf16(string);
- }
-
- static inline QString ConvertUTFtoQString(const char32_t *string)
- {
- return QString::fromUcs4(string);
- }
-
- static inline QString ConvertUTFtoQString(const wchar_t *string)
- {
- return QString::fromWCharArray(string);
- }
-
- static inline QString &append(QString &target, QString::iterator begin,
- QString::iterator end)
- {
- for (QString::iterator iter = begin;iter != end;++iter)
- target.append(*iter);
- return target;
- }
-
- static inline QString &append(QString &target, QString::const_iterator begin,
- QString::const_iterator end)
- {
- for (QString::const_iterator iter = begin;iter != end;++iter)
- target.append(*iter);
- return target;
- }
-
- /**
- * @brief replace Replaces specified portion of a string.
- * @param source Source text that will be used. Note: This is const and will
- * not be directly modified.
- * @param first First character in the range that will be replaced.
- * @param last Last character in the range that will be replaced.
- * @param replaceText Pointer to the character string to use for replacement.
- * @param len Length of the replacement character string.
- * @return Returns a new QString containing the modified result.
- */
- static inline QString replace(const QString &source,
- QString::const_iterator first,
- QString::const_iterator last,
- const char *replaceText, int len)
- {
- return replace(source, first, last, QString::fromUtf8(replaceText, len));
- }
-
- /**
- * @brief replace Replaces specified portion of a string.
- * @param source Source text that will be used. Note: This is const and will
- * not be directly modified.
- * @param first First character in the range that will be replaced.
- * @param last Last character in the range that will be replaced.
- * @param replaceText String to use for replacement.
- * @return Returns a new QString containing the modified result.
- */
- static inline QString replace(const QString &source,
- QString::const_iterator first,
- QString::const_iterator last,
- const QString &replaceText)
- {
- QString newStr;
- for (QString::const_iterator iter = source.constBegin(); iter != first;
- iter++)
- newStr.append(*iter);
-
- newStr.append(replaceText);
-
- for (QString::const_iterator iter = last; iter != source.constEnd();
- iter++)
- newStr.append(*iter);
- return newStr;
- }
-
- /**
- * @brief replace Replaces specified portion of a string.
- * @param source Source text that will be used. Note: This is const and
- * will not be directly modified.
- * @param first First character in the range that will be replaced.
- * @param last Last character in the range that will be replaced.
- * @param replaceText Pointer to the character string to use for replacement.
- * @param len Length of the replacement character string.
- * @return Returns a temporary object allocated on the stack containing
- * the modified result.
- */
- static inline QString &replace(QString &target,
- QString::iterator first,
- QString::iterator last,
- const char *replaceText, int len)
- {
- return replace(target, first, last, QString::fromUtf8(replaceText, len));
- }
-
- /**
- * @brief replace Replaces specified portion of a string.
- * @param target Target QString that will be modified.
- * @param first First character in the range that will be replaced.
- * @param last Last character in the range that will be replaced.
- * @param replaceText String to use for replacement.
- * @return Returns the string given in target, containing the modified result.
- */
- static inline QString &replace(QString &target,
- QString::iterator first,
- QString::iterator last,
- const QString &replaceText)
- {
- QString newStr;
- for (QString::iterator iter = target.begin(); iter != first; iter++)
- newStr.append(*iter);
-
- newStr.append(replaceText);
-
- for (QString::iterator iter = last; iter != target.end(); iter++)
- newStr.append(*iter);
-
- target = newStr;
- return target;
- }
-};
-
-class Qt3DSString {
-public:
- inline Qt3DSString() {}
-
- Qt3DSString(QChar c) : m_string(QString(c)) {}
-
- Qt3DSString(int size, QChar c) : m_string(size, c) {}
-
- inline Qt3DSString(QLatin1String latin1)
- : m_string(latin1) {}
-
- explicit Qt3DSString(const QChar *unicode, int size = -1)
- : m_string(unicode,size) {}
-
- inline Qt3DSString(const QString &str) Q_DECL_NOTHROW
- : m_string(str) {}
-
- inline Qt3DSString(const Qt3DSString &str) Q_DECL_NOTHROW
- : m_string(str.m_string) {}
-
- ~Qt3DSString() {}
-
- inline operator QString() const
- {
- return m_string;
- }
-
- inline void operator=(const Qt3DSString &text)
- {
- m_string = text.m_string;
- m_isDirty = true;
- }
-
- inline void operator=(const QString &text)
- {
- m_string = text;
- m_isDirty = true;
- }
-
- // QString method wrappers
- static inline Qt3DSString fromUtf8(const char *str, int size = -1)
- {
- return Qt3DSString(QString::fromUtf8(str, size));
- }
-
- typedef int size_type;
- typedef qptrdiff difference_type;
- typedef const QChar & const_reference;
- typedef QChar & reference;
- typedef QChar *pointer;
- typedef const QChar *const_pointer;
- typedef QChar value_type;
- typedef QChar *iterator;
- typedef const QChar *const_iterator;
- typedef iterator Iterator;
- typedef const_iterator ConstIterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- inline iterator begin() { return m_string.begin(); }
- inline const_iterator begin() const { return m_string.begin(); }
- inline const_iterator cbegin() const { return m_string.cbegin(); }
- inline const_iterator constBegin() const { return m_string.constBegin(); }
- inline iterator end() { return m_string.end(); }
- inline const_iterator end() const { return m_string.end(); }
- inline const_iterator cend() const { return m_string.cend(); }
- inline const_iterator constEnd() const { return m_string.constEnd(); }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
-
- inline void push_back(QChar c)
- {
- m_string.push_back(c);
- m_isDirty = true;
- }
-
- inline void push_back(const QString &s)
- {
- m_string.push_back(s);
- m_isDirty = true;
- }
-
- inline void push_front(QChar c)
- {
- m_string.push_front(c);
- m_isDirty = true;
- }
-
- inline void push_front(const QString &s)
- {
- m_string.push_front(s);
- m_isDirty = true;
- }
-
- inline bool operator==(const QString &rhs)
- {
- return rhs == m_string;
- }
-
- inline bool operator<(const QString &rhs)
- {
- return m_string < rhs;
- }
-
- inline bool operator!=(const QString &rhs)
- {
- return !(*this == rhs);
- }
-
- inline bool operator>(const QString& rhs)
- {
- return (rhs < m_string);
- }
-
- inline bool operator<=(const QString& rhs)
- {
- return !operator> (rhs);
- }
-
- inline bool operator>=(const QString& rhs)
- {
- return !operator< (rhs);
- }
-
- inline Qt3DSString& operator+=(const QString &rhs)
- {
- m_string += rhs;
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString& operator+=(const char *s)
- {
- m_string += s;
- m_isDirty = true;
- return *this;
- }
-
- inline bool isEmpty() const
- {
- return m_string.isEmpty();
- }
-
- int indexOf(const QString &str, int from = 0,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.indexOf(str, from, cs);
- }
-
- int indexOf(QChar ch, int from = 0,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.indexOf(ch, from, cs);
- }
-
- int indexOf(QLatin1String str, int from = 0,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.indexOf(str, from, cs);
- }
-
- int indexOf(const QStringRef &str, int from = 0,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.indexOf(str, from, cs);
- }
-
- int lastIndexOf(const QString &str, int from = -1,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.lastIndexOf(str, from, cs);
- }
-
- int lastIndexOf(QChar ch, int from = -1,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.lastIndexOf(ch, from, cs);
- }
-
- int lastIndexOf(QLatin1String str, int from = -1,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.lastIndexOf(str, from, cs);
- }
-
- int lastIndexOf(const QStringRef &str, int from = -1,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.lastIndexOf(str, from, cs);
- }
-
- inline void clear()
- {
- m_string.clear();
- m_isDirty = true;
- }
-
- inline Qt3DSString &insert(int i, QChar c)
- {
- m_string.insert(i,c);
- m_isDirty = true;
- return *this;
- }
- inline Qt3DSString &insert(int i, const QChar *uc, int len)
- {
- m_string.insert(i,uc, len);
- m_isDirty = true;
- return *this;
- }
- inline Qt3DSString &insert(int i, const QString &s)
- {
- m_string.insert(i,s);
- m_isDirty = true;
- return *this;
- }
- inline Qt3DSString &insert(int i, const QStringRef &s)
- {
- m_string.insert(i,s);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &insert(int i, QLatin1String s)
- {
- m_string.insert(i,s);
- m_isDirty = true;
- return *this;
- }
-
- inline int size() const
- {
- return m_string.size();
- }
-
- inline int length() const {
- return m_string.length();
- }
-
- inline Qt3DSString &append(QChar c)
- {
- m_string.append(c);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(const QChar *uc, int len)
- {
- m_string.append(uc, len);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(const QString &s)
- {
- m_string.append(s);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(const QStringRef &s)
- {
- m_string.append(s);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(QLatin1String s)
- {
- m_string.append(s);
- m_isDirty = true;
- return *this;
- }
-
- inline int compare(const QString &s,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) const
- {
- return m_string.compare(s, cs);
- }
-
- // Compatibility wrappers for std::basic_string and eastl::basic_string
- // Required for now for the Qt 3D Studio's template classes.
- static const int npos = -1;
-
- inline char operator[](int idx) const
- {
- return m_string[idx].toLatin1();
- }
-
- inline void assign(const char *text)
- {
- m_string = QString::fromUtf8(text);
- m_isDirty = true;
- }
-
- inline void assign(const char16_t *text)
- {
- m_string = QString::fromUtf16(text);
- m_isDirty = true;
- }
-
- inline void assign(const char32_t *text)
- {
- m_string = QString::fromUcs4(text);
- m_isDirty = true;
- }
-
- inline void assign(const wchar_t *text)
- {
- m_string = QString::fromWCharArray(text);
- m_isDirty = true;
- }
-
- inline void assign(const eastl::string &text)
- {
- m_string = QString::fromUtf8(text.c_str());
- m_isDirty = true;
- }
-
- inline void operator=(const char *text)
- {
- assign(text);
- }
-
- inline void operator=(const char16_t *text)
- {
- assign(text);
- }
-
- inline void operator=(const char32_t *text)
- {
- assign(text);
- }
-
- inline void operator=(const wchar_t *text)
- {
- assign(text);
- }
-
- inline void operator=(const eastl::string &text)
- {
- assign(text);
- }
-
- inline void operator=(const eastl::basic_string<char*> &text)
- {
- assign(*text.c_str());
- }
-
- inline Qt3DSString &append(QString::iterator first,
- QString::iterator last)
- {
- Qt3DSStringUtils::append(m_string, first, last);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(QString::const_iterator first,
- QString::const_iterator last)
- {
- Qt3DSStringUtils::append(m_string, first, last);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(const char *text, int size)
- {
- m_string.append(QString::fromUtf8(text, size));
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &append(const char *text)
- {
- m_string.append(QString::fromUtf8(text));
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &replace(QString::iterator replaceBegin,
- QString::iterator replaceEnd,
- const char *replaceText, int len)
- {
- return replace(replaceBegin, replaceEnd,
- QString::fromUtf8(replaceText, len));
- }
-
- inline Qt3DSString &replace(QString::iterator replaceBegin,
- QString::iterator replaceEnd,
- const QString &replaceText)
- {
- m_string = Qt3DSStringUtils::replace(this->m_string,
- replaceBegin, replaceEnd,
- replaceText);
- m_isDirty = true;
- return *this;
- }
-
- inline Qt3DSString &replace(QString::const_iterator replaceBegin,
- QString::const_iterator replaceEnd,
- const QString &replaceText)
- {
- m_string = Qt3DSStringUtils::replace(this->m_string,
- replaceBegin, replaceEnd,
- replaceText);
- m_isDirty = true;
- return *this;
- }
-
- inline QByteArray toUtf8() const
- {
- updateCache();
- return m_array;
- }
-
- inline const char *c_str() const
- {
- updateCache();
- return m_array.constData();
- }
-
- inline const char *c_str()
- {
- updateCache();
- return m_array.constData();
- }
-
-private:
- inline void updateCache() const
- {
- if (m_isDirty) {
- m_array = m_string.toUtf8();
- m_isDirty = false;
- }
- }
-
- QString m_string;
- mutable bool m_isDirty = true;
- mutable QByteArray m_array;
-};
-
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/TaggedPointer.h b/src/Runtime/ogl-runtime/src/foundation/TaggedPointer.h
deleted file mode 100644
index aa227250..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/TaggedPointer.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_TAGGED_POINTER_H
-#define QT3DS_FOUNDATION_TAGGED_POINTER_H
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename TDataType>
- struct SPointerTag
- {
- /* Expected API for runtime RTTI
- static CRegisteredString GetTag() { return g_dtype_specific_string; }
- */
- };
-
- // A pointer tagged with an identifier so we can have generic
- // user data that is still somewhat typesafe.
- struct STaggedPointer
- {
- void *m_UserData;
- CRegisteredString m_Tag;
- STaggedPointer()
- : m_UserData(NULL)
- {
- }
-
- STaggedPointer(void *inUserData, CRegisteredString inTag)
- : m_UserData(inUserData)
- , m_Tag(inTag)
- {
- }
-
- template <typename TDataType>
- STaggedPointer(TDataType *inType)
- : m_UserData(reinterpret_cast<void *>(inType))
- , m_Tag(SPointerTag<TDataType>::GetTag())
- {
- }
-
- template <typename TDataType>
- TDataType *DynamicCast() const
- {
- if (m_Tag == SPointerTag<TDataType>::GetTag())
- return reinterpret_cast<TDataType *>(m_UserData);
- return NULL;
- }
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/ThreadSafeQueue.h b/src/Runtime/ogl-runtime/src/foundation/ThreadSafeQueue.h
deleted file mode 100644
index 462b6d49..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/ThreadSafeQueue.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_FOUNDATION_THREAD_SAFE_QUEUE_H
-#define QT3DS_FOUNDATION_THREAD_SAFE_QUEUE_H
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSSemaphore.h"
-#include "EASTL/vector.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <typename TObjType, typename TAllocator = EASTLAllocatorType>
- class ThreadSafeQueue
- {
- public:
- static const QT3DSU32 MaxQueue = 0xffffffff;
-
- protected:
- eastl::vector<TObjType, TAllocator> mQueue;
- Semaphore mGetSemaphore;
- Semaphore mPutSemaphore;
- Mutex mMutex;
- const QT3DSU32 mMaxCount;
-
- public:
- ThreadSafeQueue(NVAllocatorCallback &alloc, QT3DSU32 maxCount = MaxQueue)
- : mMutex(alloc)
- , mGetSemaphore(alloc, 0, maxCount)
- , mPutSemaphore(alloc, maxCount, maxCount)
- , mMaxCount(maxCount)
- {
- mQueue.clear();
- }
-
- bool push(const TObjType &obj, QT3DSU32 milliseconds = MaxQueue)
- {
- if (mPutSemaphore.wait(milliseconds)) {
- Mutex::ScopedLock __locker(mMutex);
- mQueue.push_back(obj);
- mGetSemaphore.post();
- return true;
- }
- return false;
- }
-
- bool pop(TObjType &obj, QT3DSU32 milliseconds = 0)
- {
- if (mGetSemaphore.wait(milliseconds)) {
- Mutex::ScopedLock __locker(mMutex);
- obj = mQueue.back();
- mQueue.pop_back();
- mPutSemaphore.post();
- return true;
- }
- return false;
- }
-
- bool isFull()
- {
- Mutex::ScopedLock __locker(mMutex);
- return mQueue.size() >= mMaxCount;
- }
-
- bool isEmpty()
- {
- Mutex::ScopedLock __locker(mMutex);
- return mQueue.size() == 0;
- }
-
- void clear()
- {
- Mutex::ScopedLock __locker(mMutex);
- while (!mQueue.empty()) {
- if (mGetSemaphore.wait(MaxQueue)) {
- mQueue.pop_back();
- mPutSemaphore.post();
- }
- }
- }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.cpp b/src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.cpp
deleted file mode 100644
index 242b0ac0..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/TrackingAllocator.h"
-
-namespace qt3ds {
-namespace foundation {
-
-CAllocator::~CAllocator()
-{
- QT3DS_ASSERT(mAllocations.size() == 0);
- MemInfo info;
- for (PtrToInfoMap::iterator iter = mAllocations.begin(), end = mAllocations.end();
- iter != end; ++iter) {
- info = iter->second;
- qCCritical(INTERNAL_ERROR, "!!Outstanding allocation of %lu bytes from %s::%d, %s",
- info.size, info.file, info.line, info.name ? info.name : "");
- }
- QT3DS_UNUSED(info);
-}
-
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.h b/src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.h
deleted file mode 100644
index 4fd58069..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/TrackingAllocator.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_RENDER_ALLOCATOR_H
-#define QT3DS_RENDER_ALLOCATOR_H
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSMutex.h"
-#include "EASTL/hash_map.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSLogging.h"
-
-namespace qt3ds {
-namespace foundation {
-
- // The simplest allocator. Performs no alignment nor memory checking.
- struct MallocAllocator : public NVAllocatorCallback
- {
- void *allocate(size_t size, const char *, const char *, int, int = 0) override
- {
- return malloc(size);
- }
- void *allocate(size_t size, const char *, const char *, int, size_t, size_t) override
- {
- return malloc(size);
- }
- void deallocate(void *ptr) override { free(ptr); }
- };
-
- struct MemInfo
- {
- size_t size;
- void *originalAddress;
- const char *name;
- const char *file;
- int line;
- MemInfo(size_t _size = 0, void *addr = 0, const char *_name = "", const char *_file = "",
- int _line = 0)
- : size(_size)
- , originalAddress(addr)
- , name(_name)
- , file(_file)
- , line(_line)
- {
- }
- };
-
- struct FileAndLine
- {
- const char *mFile;
- QT3DSU32 mLine;
- FileAndLine(const char *f, QT3DSU32 l)
- : mFile(f)
- , mLine(l)
- {
- }
- };
-} // namespace foundation
-} // namespace qt3ds
-
-namespace eastl {
-template <>
-struct hash<qt3ds::foundation::FileAndLine>
-{
- size_t operator()(const qt3ds::foundation::FileAndLine &fl) const
- {
- return hash<const void *>()((const void *)fl.mFile) ^ hash<int>()(fl.mLine);
- }
-};
-
-template <>
-struct equal_to<qt3ds::foundation::FileAndLine>
-{
- bool operator()(const qt3ds::foundation::FileAndLine &fl1,
- const qt3ds::foundation::FileAndLine &fl2) const
- {
- size_t fl1File(reinterpret_cast<size_t>(fl1.mFile));
- size_t fl2File(reinterpret_cast<size_t>(fl2.mFile));
-
- return fl1File == fl2File && fl1.mLine == fl2.mLine;
- }
-};
-}
-
-namespace qt3ds {
-namespace foundation {
-
- struct MemInfoAndCount : MemInfo
- {
- QT3DSU32 mCount;
- QT3DSU64 mTotalBytes;
- MemInfoAndCount(const MemInfo &info)
- : MemInfo(info)
- , mCount(1)
- , mTotalBytes(info.size)
- {
- }
- void increment(const MemInfo &otherInfo)
- {
- ++mCount;
- mTotalBytes += otherInfo.size;
- }
- };
-
- typedef nvhash_map<FileAndLine, MemInfoAndCount> TFileAndLineMemHash;
-
- class AllocationCheckPrinter
- {
- protected:
- virtual ~AllocationCheckPrinter() {}
- public:
- virtual void printMissing(const MemInfoAndCount &item) = 0;
- virtual void printIncorrectCount(const MemInfoAndCount &later,
- const MemInfoAndCount &earlier) = 0;
- };
-
- // All allocations are 16 byte aligned.
- // Prints out unallocated memory at destruction.
- class QT3DS_AUTOTEST_EXPORT CAllocator : public NVAllocatorCallback
- {
- public:
- typedef Mutex TMutexType;
- typedef Mutex::ScopedLock TLockType;
- typedef nvhash_map<void *, MemInfo> PtrToInfoMap;
-
- private:
- MallocAllocator mAlloc;
- PtrToInfoMap mAllocations;
- PtrToInfoMap mStoredAllocations;
- TMutexType mMutex;
-
- public:
- CAllocator()
- : mAllocations(mAlloc, "MemInfo")
- , mStoredAllocations(mAlloc, "MemInfo")
- , mMutex(mAlloc)
- {
- }
- virtual ~CAllocator();
-
- void *allocate(size_t size, const char *tn, const char *fl, int ln, int flags) override
- {
- QT3DS_ASSERT(size);
- if (size) {
- size += 15;
- TLockType locker(mMutex);
- void *original = mAlloc.allocate(size, tn, fl, ln, flags);
- size_t temp = (size_t)original;
- temp = (temp + 15) & (~15);
- void *retval = (void *)temp;
- mAllocations.insert(eastl::make_pair(retval, MemInfo(size, original, tn, fl, ln)));
- return retval;
- }
- return NULL;
- }
- void *allocate(size_t size, const char *tn, const char *fl, int ln, size_t, size_t) override
- {
- return allocate(size, tn, fl, ln, 0);
- }
- void deallocate(void *ptr) override
- {
- if (ptr) {
- TLockType locker(mMutex);
- PtrToInfoMap::iterator entry(mAllocations.find(ptr));
- if (entry != mAllocations.end()) {
- mAlloc.deallocate(entry->second.originalAddress);
- mAllocations.erase(ptr);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- }
- const PtrToInfoMap &getOutstandingAllocations() const { return mAllocations; }
- static void convert(const CAllocator::PtrToInfoMap &map, TFileAndLineMemHash &fl)
- {
- for (CAllocator::PtrToInfoMap::const_iterator iter = map.begin(), end = map.end();
- iter != end; ++iter) {
- const MemInfo &info(iter->second);
- FileAndLine flKey(info.file, info.line);
- TFileAndLineMemHash::const_iterator find(fl.find(flKey));
- if (find == fl.end())
- fl.insert(eastl::make_pair(flKey, MemInfoAndCount(info)));
- else
- const_cast<MemInfoAndCount &>(find->second).increment(info);
- }
- }
- static void copyMap(const CAllocator::PtrToInfoMap &map1, CAllocator::PtrToInfoMap &map2)
- {
- for (CAllocator::PtrToInfoMap::const_iterator iter = map1.begin(), end = map1.end();
- iter != end; ++iter) {
- map2.insert(eastl::make_pair(iter->first, iter->second));
- }
- }
-
- static void printDiffs(const TFileAndLineMemHash &fl1, const TFileAndLineMemHash &fl2,
- AllocationCheckPrinter &printer)
- {
- using namespace std;
- for (TFileAndLineMemHash::const_iterator iter = fl1.begin(), end = fl1.end();
- iter != end; ++iter) {
- TFileAndLineMemHash::const_iterator entry = fl2.find(iter->first);
- if (entry != fl2.end()) {
- printer.printMissing(iter->second);
- } else if (iter->second.mCount > entry->second.mCount) {
- printer.printIncorrectCount(iter->second, entry->second);
- }
- }
- }
-
- void printAllocationDiff(AllocationCheckPrinter &printer)
- {
- TFileAndLineMemHash map1fl(mAlloc, "printAllocationDiff");
- TFileAndLineMemHash map2fl(mAlloc, "printAllocationDiff");
- convert(mStoredAllocations, map1fl);
- convert(mAllocations, map2fl);
- printDiffs(map2fl, map1fl, printer);
- }
- void storeAllocations()
- {
- mStoredAllocations.clear();
- copyMap(mAllocations, mStoredAllocations);
- }
- bool hasStoredAllocations() { return mStoredAllocations.size() > 0; }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/Utils.h b/src/Runtime/ogl-runtime/src/foundation/Utils.h
deleted file mode 100644
index 33c24004..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/Utils.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_UTILS_H
-#define QT3DS_RENDER_UTILS_H
-#include "EASTL/hash_map.h"
-#include "EASTL/hash_set.h"
-#include "EASTL/vector.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSMath.h"
-#include <ctype.h>
-
-namespace qt3ds {
-namespace foundation {
-
- // Defined in IStringTable.cpp
- extern const char16_t *char16EmptyStr;
- extern const char32_t *char32EmptyStr;
-
- inline const char *nonNull(const char *src) { return src == NULL ? "" : src; }
- inline bool isTrivial(const char *str) { return str == NULL || *str == 0; }
- inline const char16_t *nonNull(const char16_t *src)
- {
- return src == NULL ? char16EmptyStr : src;
- }
- inline bool isTrivial(const char16_t *str) { return str == NULL || *str == 0; }
- inline const char32_t *nonNull(const char32_t *src)
- {
- return src == NULL ? char32EmptyStr : src;
- }
- inline bool isTrivial(const char32_t *str) { return str == NULL || *str == 0; }
-
- // Note this is safe to call on null strings.
- template <typename TCharType>
- inline QT3DSU32 StrLen(const TCharType *inType)
- {
- QT3DSU32 retval = 0;
- while (inType && *inType) {
- ++retval;
- ++inType;
- }
- return retval;
- }
-
- template <typename TCharType>
- inline QT3DSI32 Compare(const TCharType *inLhs, const TCharType *inRhs)
- {
- inLhs = nonNull(inLhs);
- inRhs = nonNull(inRhs);
- while (*inLhs && *inRhs) {
- QT3DSI32 diff = *inLhs - *inRhs;
- if (diff)
- return diff;
- ++inLhs;
- ++inRhs;
- }
- return *inLhs - *inRhs;
- }
-
- template <typename TCharType>
- inline QT3DSI32 CompareCaseless(const TCharType *inLhs, const TCharType *inRhs)
- {
- inLhs = nonNull(inLhs);
- inRhs = nonNull(inRhs);
- while (*inLhs && *inRhs) {
- QT3DSI32 diff = tolower(*inLhs) - tolower(*inRhs);
- if (diff)
- return diff;
- ++inLhs;
- ++inRhs;
- }
- return *inLhs - *inRhs;
- }
-
- template <typename TCharType>
- inline QT3DSI32 CompareNChars(const TCharType *inLhs, const TCharType *inRhs, QT3DSU32 inNumChars)
- {
- inLhs = nonNull(inLhs);
- inRhs = nonNull(inRhs);
- while (*inLhs && *inRhs && inNumChars) {
- QT3DSI32 diff = *inLhs - *inRhs;
- if (diff)
- return diff;
- ++inLhs;
- ++inRhs;
- --inNumChars;
- }
- if (inNumChars)
- return *inLhs - *inRhs;
- return 0;
- }
-
- template <typename TCharType>
- bool AreEqual(const TCharType *inLhs, const TCharType *inRhs)
- {
- return Compare(inLhs, inRhs) == 0;
- }
-
- template <typename TCharType>
- bool AreEqualCaseless(const TCharType *inLhs, const TCharType *inRhs)
- {
- return CompareCaseless(inLhs, inRhs) == 0;
- }
-
- inline QT3DSU32 IsBitSetInBitmap(NVConstDataRef<QT3DSU32> bitmap, QT3DSU32 entryIndex)
- {
- QT3DSU32 bitMapIndex = entryIndex / 32;
- QT3DSU32 bitIndex = entryIndex % 32;
- QT3DSU32 shouldApply = 0;
- if (bitMapIndex < bitmap.mSize)
- shouldApply = (1 << bitIndex) & bitmap[bitMapIndex];
- return shouldApply;
- }
-
- inline void SetBitInBitmap(nvvector<QT3DSU32> &bitmap, QT3DSU32 entryIndex)
- {
- QT3DSU32 bitMapIndex = entryIndex / 32;
- QT3DSU32 bitIndex = entryIndex % 32;
- while (bitmap.size() <= bitMapIndex)
- bitmap.push_back(0);
- bitmap[bitMapIndex] |= (QT3DSU32)(1 << bitIndex);
- }
- inline void UnsetBitInBitmap(nvvector<QT3DSU32> &bitmap, QT3DSU32 entryIndex)
- {
- QT3DSU32 bitMapIndex = entryIndex / 32;
- QT3DSU32 bitIndex = entryIndex % 32;
- if (bitMapIndex < bitmap.size())
- bitmap[bitMapIndex] &= ~((QT3DSU32)(1 << bitIndex));
- }
-
-#define CHECK_CONDITION_AND_RETURN_FALSE(cond, errorType, message) \
- if (cond) { \
- m_Foundation.error(errorType, message); \
- QT3DS_ASSERT(false); \
- return false; \
- }
-// Returns false if the property type doesn't match the incoming type.
-#define CHECK_CONDITION_AND_RETURN(cond, errorType, message) \
- if (cond) { \
- m_Foundation.error(errorType, message); \
- QT3DS_ASSERT(false); \
- }
-
-#define QT3DS_FOREACH(varname, stop) for (QT3DSU32 varname = 0, end = stop; varname < end; ++varname)
-
- template <typename TKeyType, typename TValueType, typename THashType, typename TPredicate,
- typename TBufType, typename TOperator>
- QT3DSU32 GetMapKeysOp(const eastl::hash_map<TKeyType, TValueType, THashType, TPredicate,
- ForwardingAllocator> &map,
- TBufType *buffer, QT3DSU32 bufSize, QT3DSU32 startIdx, TOperator op)
- {
- QT3DSU32 numItems = static_cast<QT3DSU32>(map.size());
- if (numItems == 0 || bufSize == 0)
- return 0;
-
- startIdx = NVMin(numItems - 1, startIdx);
- QT3DSU32 retval = 0;
- for (typename eastl::hash_map<TKeyType, TValueType, THashType, TPredicate,
- ForwardingAllocator>::const_iterator iter = map.begin(),
- end = map.end();
- iter != end && bufSize; ++iter) {
- if (startIdx)
- --startIdx;
- else {
- buffer[retval] = op(iter->first);
- --bufSize;
- ++retval;
- }
- }
- return retval;
- }
-
- struct IdOp
- {
- template <typename TDataType>
- TDataType operator()(const TDataType &item)
- {
- return item;
- }
- };
-
- template <typename TKeyType, typename TValueType, typename THashType, typename TPredicateType>
- QT3DSU32
- GetMapKeys(const eastl::hash_map<TKeyType, TValueType, THashType, ForwardingAllocator> &map,
- TKeyType *buffer, QT3DSU32 bufSize, QT3DSU32 startIdx)
- {
- return GetMapKeysOp(map, buffer, bufSize, startIdx, IdOp());
- }
-
- struct DerefOp
- {
- template <typename TDataType>
- TDataType operator()(const TDataType *item)
- {
- return *item;
- }
- };
-
- template <typename TKeyType, typename TValueType, typename THashType, typename TPredicateType,
- typename TAllocatorType, typename TBufType, typename TOp>
- QT3DSU32 GetMapValues(
- const eastl::hash_map<TKeyType, TValueType, THashType, TPredicateType, TAllocatorType> &map,
- TBufType *buffer, QT3DSU32 bufSize, QT3DSU32 startIdx, TOp op)
- {
- QT3DSU32 numItems = static_cast<QT3DSU32>(map.size());
- if (numItems == 0 || bufSize == 0)
- return 0;
-
- startIdx = NVMin(numItems - 1, startIdx);
- QT3DSU32 retval = 0;
- for (typename eastl::hash_map<TKeyType, TValueType, THashType, TPredicateType,
- TAllocatorType>::const_iterator iter = map.begin(),
- end = map.end();
- iter != end && bufSize; ++iter) {
- if (startIdx)
- --startIdx;
- else {
- buffer[retval] = op(iter->second);
- --bufSize;
- ++retval;
- }
- }
- return retval;
- }
-
- template <typename TValueType, typename TBufType>
- QT3DSU32 GetArrayEntries(const nvvector<TValueType> &data, TBufType *buffer, QT3DSU32 bufSize,
- QT3DSU32 startIdx)
- {
- QT3DSU32 numItems = static_cast<QT3DSU32>(data.size());
- if (numItems == 0 || bufSize == 0)
- return 0;
-
- startIdx = NVMin(numItems - 1, startIdx);
- QT3DSU32 available = NVMin(numItems - startIdx, bufSize);
- QT3DS_FOREACH(idx, available)
- buffer[idx] = data[idx + startIdx];
- return available;
- }
-
- template <typename TValueType, typename TBufType>
- QT3DSU32 GetDataRefEntries(const NVDataRef<TValueType> &data, TBufType *buffer, QT3DSU32 bufSize,
- QT3DSU32 startIdx)
- {
- QT3DSU32 numItems = static_cast<QT3DSU32>(data.size());
- if (numItems == 0 || bufSize == 0)
- return 0;
-
- startIdx = NVMin(numItems - 1, startIdx);
- QT3DSU32 available = NVMin(numItems - startIdx, bufSize);
- QT3DS_FOREACH(idx, available)
- buffer[idx] = data.mData[idx + startIdx];
- return available;
- }
-
- template <typename TValueType, typename TBufType>
- QT3DSU32 GetDataRefEntries(const NVConstDataRef<TValueType> &data, TBufType *buffer, QT3DSU32 bufSize,
- QT3DSU32 startIdx)
- {
- QT3DSU32 numItems = static_cast<QT3DSU32>(data.size());
- if (numItems == 0 || bufSize == 0)
- return 0;
-
- startIdx = NVMin(numItems - 1, startIdx);
- QT3DSU32 available = NVMin(numItems - startIdx, bufSize);
- QT3DS_FOREACH(idx, available)
- buffer[idx] = data.mData[idx + startIdx];
- return available;
- }
-
- template <typename TKeyType, typename THashType, typename TPredicate, typename TAllocator>
- QT3DSU32 GetHashSetEntries(eastl::hash_set<TKeyType, THashType, TPredicate, TAllocator> &data,
- TKeyType *buffer, QT3DSU32 bufSize, QT3DSU32 startIdx)
- {
- QT3DSU32 numItems = static_cast<QT3DSU32>(data.size());
- if (numItems == 0 || bufSize == 0)
- return 0;
- startIdx = NVMin(numItems - 1, startIdx);
- QT3DSU32 available = NVMin(numItems - startIdx, bufSize);
- QT3DSU32 idx = 0;
- for (typename eastl::hash_set<TKeyType, THashType, TPredicate, TAllocator>::const_iterator
- iter = data.begin(),
- end = data.end();
- iter != end && idx < available; ++iter, ++idx) {
- if (startIdx) {
- --startIdx;
- continue;
- }
- buffer[idx] = *iter;
- }
- return available;
- }
-
- template <typename TDataType>
- void memCopyT(TDataType *dest, const TDataType *src, QT3DSU32 size)
- {
- memCopy(dest, src, size * sizeof(TDataType));
- }
-
- template <typename TDataType>
- NVDataRef<TDataType> PtrAtOffset(QT3DSU8 *baseData, QT3DSU32 offset, QT3DSU32 byteSize)
- {
- return NVDataRef<TDataType>(byteSize ? (TDataType *)(baseData + offset) : NULL,
- byteSize / sizeof(TDataType));
- }
-
- struct char_hasher
- {
- size_t operator()(const char *item) const { return eastl::hash<const char8_t *>()(item); }
- };
-
- struct char_equal_to
- {
- bool operator()(const char *lhs, const char *rhs) const
- {
- if (lhs == NULL)
- lhs = "";
- if (rhs == NULL)
- rhs = "";
- return strcmp(lhs, rhs) == 0;
- }
- };
-
- struct wide_char_hasher
- {
- size_t operator()(const char16_t *item) const
- {
- return eastl::hash<const char16_t *>()(item);
- }
- };
-
- struct wide_char_equal_to
- {
- bool operator()(const char16_t *lhs, const char16_t *rhs) const
- {
- if (lhs == NULL)
- lhs = reinterpret_cast<const char16_t *>(L"");
- if (rhs == NULL)
- rhs = reinterpret_cast<const char16_t *>(L"");
- while (*lhs && *rhs) {
- int answer = *lhs - *rhs;
- if (answer)
- return false;
- ++lhs;
- ++rhs;
- }
- return *lhs == *rhs;
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/XML.cpp b/src/Runtime/ogl-runtime/src/foundation/XML.cpp
deleted file mode 100644
index bd12dfaf..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/XML.cpp
+++ /dev/null
@@ -1,948 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/XML.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "foundation/IOStreams.h"
-#include "foundation/StringConversionImpl.h"
-#include "foundation/StrConvertUTF.h"
-#include "foundation/StringTable.h"
-#include "foundation/Utils.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/hash_map.h"
-
-#ifdef QT3DS_VC
-#include <windows.h> //output debug string
-#endif
-
-#include <QtCore/qxmlstream.h>
-
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::intrinsics;
-
-typedef char XML_Char;
-
-namespace {
-
-const QT3DSU16 g_BOMMarker = (QT3DSU16)0xFEFF;
-
-// Some DOM parsing operations are destructive. If you need
-// them to not be destructive, then we need to modify
-// the reader. Specifically parsing lists of floats, due
-// to a bug in strtod, is destructive.
-struct SDOMReader : public IDOMReader
-{
- SReaderScope m_TopElement;
- eastl::vector<SReaderScope> m_ScopeStack;
- NVScopedRefCounted<IDOMFactory> m_Factory;
- volatile QT3DSI32 mRefCount;
-
- SDOMReader(NVAllocatorCallback &inAlloc, SDOMElement &te, NVScopedRefCounted<IStringTable> s,
- NVScopedRefCounted<IDOMFactory> inFactory)
- : IDOMReader(inAlloc, s)
- , m_TopElement(&te)
- , m_Factory(inFactory)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Factory->GetAllocator())
-
- SDOMElement *Current() const { return m_TopElement.m_Element; }
-
- void PushScope() override { m_ScopeStack.push_back(SReaderScope(m_TopElement)); }
-
- void PopScope() override
- {
- if (m_ScopeStack.size()) {
- m_TopElement = m_ScopeStack.back();
- m_ScopeStack.pop_back();
- } else
- m_TopElement = SReaderScope();
- }
-
- SReaderScope GetScope() override { return m_TopElement; }
-
- void SetScope(SReaderScope inScope) override { m_TopElement = inScope; }
-
- SDOMElement *GetElement() const override { return m_TopElement.m_Element; }
-
- Option<CRegisteredString> RegisterNS(TXMLCharPtr ns)
- {
- if (ns) {
- return m_StringTable->RegisterStr(ns);
- }
- return Empty();
- }
-
- bool UnregisteredAtt(TXMLCharPtr name, TXMLCharPtr &outValue, TXMLCharPtr ns = NULL) override
- {
- outValue = "";
- SDOMElement *current(Current());
- if (current) {
- return current->AttValue(m_StringTable->RegisterStr(name), RegisterNS(ns), outValue);
- } else {
- QT3DS_ASSERT(false);
- }
- return false;
- }
-
- bool Att(TXMLCharPtr name, CRegisteredString &outValue, TXMLCharPtr ns = NULL) override
- {
- const char8_t *unregValue = NULL;
- if (UnregisteredAtt(name, unregValue, ns)) {
- outValue = m_StringTable->RegisterStr(unregValue);
- return true;
- }
- return false;
- }
-
- QT3DSU32 CountChildren(TXMLCharPtr childName = NULL, TXMLCharPtr ns = NULL) override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return 0;
- }
- return elem->GetNumChildren(m_StringTable->RegisterStr(childName), RegisterNS(ns));
- }
-
- SDOMAttribute *CurrentAtt()
- {
- if (m_TopElement.m_Attribute)
- return m_TopElement.m_Attribute;
- return NULL;
- }
-
- SDOMAttribute *GetFirstAttribute() override
- {
- if (m_TopElement.m_Element)
- m_TopElement.m_Attribute = m_TopElement.m_Element->m_Attributes.m_Head;
- return m_TopElement.m_Attribute;
- }
-
- SDOMAttribute *GetNextAttribute() override
- {
- if (m_TopElement.m_Attribute)
- m_TopElement.m_Attribute = m_TopElement.m_Attribute->m_NextAttribute;
- return CurrentAtt();
- }
-
- bool MoveToFirstChild(TXMLCharPtr childName = NULL, TXMLCharPtr ns = NULL) override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- SDOMElement *child = elem->FindChild(m_StringTable->RegisterStr(childName), RegisterNS(ns));
- if (child != NULL) {
- m_TopElement = child;
- return true;
- }
- return false;
- }
-
- bool MoveToNextSibling(TXMLCharPtr childName = NULL, TXMLCharPtr ns = NULL) override
- {
- SDOMElement *elem = Current();
- if (elem == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- SDOMElement *nextSibling =
- elem->FindSibling(m_StringTable->RegisterStr(childName), RegisterNS(ns));
- if (nextSibling) {
- m_TopElement = nextSibling;
- return true;
- }
- return false;
- }
- // Leave element means go to its parent.
- void Leave() override
- {
- QT3DS_ASSERT(m_TopElement.m_Element);
- if (m_TopElement.m_Element)
- m_TopElement = m_TopElement.m_Element->m_Parent;
- }
-
- bool Value(TXMLCharPtr &outValue) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return false;
- }
- outValue = current->m_Value;
- return true;
- }
-
- SDOMElement *GetTopElement() override
- {
- SDOMElement *current(Current());
- while (current && current->m_Parent)
- current = current->m_Parent;
- return current;
- }
-
- virtual NVScopedRefCounted<IDOMFactory> GetFactory() { return m_Factory; }
-};
-
-struct SDOMWriter : public IDOMWriter, public SDOMReader
-{
- NVScopedRefCounted<IDOMFactory> m_FactoryPtr;
- IDOMFactory &m_Factory;
-
- SDOMWriter(NVScopedRefCounted<IDOMFactory> inDOMFactory,
- NVScopedRefCounted<IStringTable> inStringTable, SDOMElement &inTopElem)
- : SDOMReader(inDOMFactory->GetAllocator(), inTopElem, inStringTable, *inDOMFactory)
- , m_FactoryPtr(inDOMFactory)
- , m_Factory(*inDOMFactory)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Factory.GetAllocator())
-
- void Begin(TXMLCharPtr inElemName, TXMLCharPtr inNamespace = NULL, int inLine = 0) override
- {
- if (!m_TopElement.m_Element) {
- QT3DS_ASSERT(false);
- return;
- }
- SDOMElement *current(Current());
- SDOMElement *newElement(m_Factory.NextElement(m_StringTable->RegisterStr(inElemName),
- m_StringTable->RegisterStr(inNamespace),
- inLine));
- current->AppendChild(*newElement);
- m_TopElement = newElement;
- }
-
- void Att(TXMLCharPtr name, TXMLCharPtr value, TXMLCharPtr ns, int inLine) override
- {
- if (!m_TopElement.m_Element) {
- QT3DS_ASSERT(false);
- return;
- }
- m_TopElement.m_Element->SetAttributeValue(m_StringTable->RegisterStr(name), RegisterNS(ns),
- value, m_Factory, inLine);
- }
-
- void Value(TXMLCharPtr value) override
- {
- if (!m_TopElement.m_Element) {
- QT3DS_ASSERT(false);
- return;
- }
- if (value == NULL)
- value = "";
- size_t len = strlen(value);
- m_Factory.AppendStrBuf(value, (QT3DSU32)len);
- m_TopElement.m_Element->m_Value = m_Factory.FinalizeStrBuf();
- }
-
- void End() override
- {
- if (!m_TopElement.m_Element) {
- QT3DS_ASSERT(false);
- return;
- }
- Leave();
- }
- void RemoveCurrent() override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
- if (current->m_Parent) {
- m_TopElement = current->m_Parent;
- m_TopElement.m_Element->RemoveChild(*current);
- }
- }
- void RemoveAttribute(TXMLCharPtr inItem, TXMLCharPtr inNamespace) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
- current->RemoveAttribute(m_StringTable->RegisterStr(inItem), RegisterNS(inNamespace));
- }
-
- void MoveBefore(TXMLCharPtr inItem, TXMLCharPtr inSibling, TXMLCharPtr inNs = NULL) override
- {
- SDOMElement *current(Current());
- if (!current) {
- QT3DS_ASSERT(false);
- return;
- }
-
- SDOMElement *theItem =
- current->FindChild(m_StringTable->RegisterStr(inItem), RegisterNS(inNs));
- SDOMElement *theSibling =
- current->FindChild(m_StringTable->RegisterStr(inSibling), RegisterNS(inNs));
- QT3DS_ASSERT(theItem && theSibling);
- if (theItem && theSibling)
- current->PrependChild(*theItem, theSibling);
- }
-
- // If current has no parent, then we are at the top
- // of the tree and we should return 0. Or if there is no
- // current.
- // If there is one parent, we should return 1.
- QT3DSU32 GetTabs() override
- {
- QT3DSU32 retval = 0;
- SDOMElement *current(Current());
- do {
- if (current)
- current = current->m_Parent;
- if (current)
- ++retval;
- } while (current);
- return retval;
- }
-
- SDOMElement *GetTopElement() override { return SDOMReader::GetTopElement(); }
-
- NVScopedRefCounted<IDOMFactory> GetFactory() override { return m_FactoryPtr; }
-
- NVAllocatorCallback &GetAllocator() override { return m_Factory.GetAllocator(); }
-};
-
-struct SimpleXmlWriter
-{
-
- struct SNameNS
- {
- TXMLCharPtr name;
- TXMLCharPtr ns;
- SNameNS(TXMLCharPtr _name = NULL, TXMLCharPtr _ns = NULL)
- : name(_name)
- , ns(_ns)
- {
- }
- };
- IOutStream &m_Stream;
- eastl::vector<eastl::pair<SNameNS, bool>> m_OpenElements;
- bool m_ElementOpen;
- char8_t m_PrintBuf[256];
- QT3DSU32 m_Tabs;
- eastl::basic_string<char8_t, ForwardingAllocator> m_Buffer;
-
- SimpleXmlWriter(NVAllocatorCallback &inAlloc, IOutStream &stream, QT3DSU32 inTabs = 0)
- : m_Stream(stream)
- , m_ElementOpen(false)
- , m_Tabs(inTabs)
- , m_Buffer(ForwardingAllocator(inAlloc, "SimpleXMLWriter::m_Buffer"))
- {
- }
-
- void Write(const SNameNS &data)
- {
- if (data.ns && *data.ns) {
- Write(data.ns);
- Write(':');
- }
- Write(data.name);
- }
-
- void Write(const char8_t *data, QT3DSU32 inLen = 0)
- {
- if (!isTrivial(data)) {
- if (inLen == 0)
- inLen = StrLen(data);
- m_Stream.Write(data, inLen);
- }
- }
- void BeginWrite() { m_Buffer.clear(); }
- void WriteTemp(char8_t data) { m_Buffer.append(1, data); }
- void WriteTemp(const char8_t *data) { m_Buffer.append(data); }
- void EndWrite() { Write(reinterpret_cast<const char8_t *>(m_Buffer.c_str()), m_Buffer.size()); }
- void Write(char8_t data) { m_Stream.Write(data); }
- void Tabs()
- {
- QT3DS_FOREACH(idx, (m_OpenElements.size() + m_Tabs))
- Write('\t');
- }
- void Close(bool newline)
- {
- if (m_ElementOpen) {
- Write(">");
- if (newline)
- Write('\n');
- }
- m_ElementOpen = false;
- }
- void Begin(TXMLCharPtr name, TXMLCharPtr ns)
- {
- Close(true);
- Tabs();
- Write('<');
- SNameNS theName(name, ns);
- Write(theName);
- m_OpenElements.push_back(eastl::pair<SNameNS, bool>(theName, false));
- m_ElementOpen = true;
- }
- TXMLCharPtr ToStr(char8_t val)
- {
- m_PrintBuf[0] = val;
- m_PrintBuf[1] = 0;
- return m_PrintBuf;
- }
- template <typename TDataType>
- TXMLCharPtr ToStr(TDataType val)
- {
- StringConversion<TDataType>().ToStr(val, NVDataRef<char8_t>(m_PrintBuf, 256));
- return m_PrintBuf;
- }
- void Att(TXMLCharPtr name, TXMLCharPtr ns, TXMLCharPtr value)
- {
- QT3DS_ASSERT(m_ElementOpen);
- Write(' ');
- Write(SNameNS(name, ns));
-
- Write("=\"");
-
- QString str = QString::fromUtf8(nonNull(value)).toHtmlEscaped();
- Write(str.toUtf8().constData());
- Write("\"");
- }
- template <typename TData>
- void Att(TXMLCharPtr name, TXMLCharPtr ns, TData value)
- {
- Att(name, ns, ToStr(value));
- }
-
- void Value(TXMLCharPtr value)
- {
- if (!isTrivial(value)) {
- Close(false);
-
- QString str = QString::fromUtf8(nonNull(value)).toHtmlEscaped();
- Write(str.toUtf8().constData());
- m_OpenElements.back().second = true;
- }
- }
- void ChildValue(TXMLCharPtr name, TXMLCharPtr ns, TXMLCharPtr value)
- {
- Begin(name, ns);
- Value(value);
- End();
- }
- void End(bool newlineAfterClose = true)
- {
- QT3DS_ASSERT(m_OpenElements.size());
- eastl::pair<SNameNS, bool> topElem = m_OpenElements.back();
- m_OpenElements.pop_back();
- if (m_ElementOpen)
- Write("/>");
- else {
- if (topElem.second == false)
- Tabs();
- Write("</");
- Write(topElem.first);
- Write(">");
- }
- m_ElementOpen = false;
- if (newlineAfterClose == true)
- Write('\n');
- }
-};
-
-struct DOMParser
-{
- IDOMFactory &m_Factory;
- SDOMElement *m_TopElement;
- SDOMElement *m_FirstElement;
- char8_t m_nsSeparator;
- typedef eastl::basic_string<char8_t, ForwardingAllocator> TStrType;
- TStrType m_NSBuffer;
- TStrType m_NameBuffer;
- CRegisteredString m_RegName;
- CRegisteredString m_RegNS;
- SNamespacePairNode *m_FirstPair;
- SNamespacePairNode *m_LastPair;
- QXmlStreamReader *m_XMLParser;
-
- DOMParser(IDOMFactory &factory, QXmlStreamReader &parser, char8_t nsSeparator)
- : m_Factory(factory)
- , m_FirstElement(NULL)
- , m_nsSeparator(nsSeparator)
- , m_NSBuffer(ForwardingAllocator(factory.GetAllocator(), "DOMParser::m_NSBuffer"))
- , m_NameBuffer(ForwardingAllocator(factory.GetAllocator(), "DOMParser::m_NameBuffer"))
- , m_FirstPair(NULL)
- , m_LastPair(NULL)
- , m_XMLParser(&parser)
- {
- }
-
- void ParseName(const XML_Char *name)
- {
- m_NSBuffer.assign(name);
- eastl::string::size_type pos = m_NSBuffer.find(m_nsSeparator);
- if (pos != TStrType::npos) {
- m_NameBuffer.assign(m_NSBuffer.c_str() + pos + 1);
- m_NSBuffer.resize(pos);
- } else {
- m_NameBuffer = m_NSBuffer;
- m_NSBuffer.clear();
- // Find the namespace with no abbreviation.
- for (SNamespacePairNode *theNode = m_FirstPair; theNode;
- theNode = theNode->m_NextNode) {
- if (theNode->m_Abbreviation.IsValid() == false)
- m_NSBuffer.assign(theNode->m_Namespace.c_str());
- }
- }
- m_RegName = m_Factory.GetStringTable()->RegisterStr(m_NameBuffer.c_str());
- m_RegNS = m_Factory.GetStringTable()->RegisterStr(m_NSBuffer.c_str());
- }
-
- struct SimpleXmlErrorHandler : public CXmlErrorHandler
- {
- void OnXmlError(TXMLCharPtr errorName, int line, int column) override
- {
- char8_t buffer[1024];
- _snprintf(buffer, 1024, "%s(%d): Xml Error %s on line %d, column %d", __FILE__,
- __LINE__, errorName, line, column);
-#ifdef QT3DS_VC
- OutputDebugStringA(buffer);
-#endif
- printf("%s\n", buffer);
- }
- };
-
- template <QT3DSU32 THeaderLen>
- struct SHeaderInStream : public IInStream
- {
- QT3DSU8 m_Header[THeaderLen];
- IInStream &m_InStream;
- QT3DSU32 m_BytesRead;
-
- SHeaderInStream(IInStream &inStream)
- : m_InStream(inStream)
- , m_BytesRead(0)
- {
- }
- bool readHeader()
- {
- QT3DSU32 amountRead = m_InStream.Read(NVDataRef<QT3DSU8>(m_Header, THeaderLen));
- return amountRead == THeaderLen;
- }
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- if (data.size() == 0)
- return 0;
- QT3DSU8 *writePtr(data.begin());
- QT3DSU32 amountToRead(data.size());
- QT3DSU32 amountRead = 0;
- if (m_BytesRead < THeaderLen) {
- QT3DSU32 headerLeft = NVMin(THeaderLen - m_BytesRead, amountToRead);
- memCopy(writePtr, m_Header + m_BytesRead, headerLeft);
- writePtr += headerLeft;
- amountToRead -= headerLeft;
- amountRead += headerLeft;
- }
- if (amountToRead)
- amountRead += m_InStream.Read(NVDataRef<QT3DSU8>(writePtr, amountToRead));
- m_BytesRead += amountRead;
- return amountRead;
- }
- };
-
- static eastl::pair<SNamespacePairNode *, SDOMElement *>
- ParseXMLFile(IDOMFactory &factory, IInStream &inStream, CXmlErrorHandler *handler = NULL)
- {
- SimpleXmlErrorHandler simpleHandler;
- if (handler == NULL)
- handler = &simpleHandler;
-
- // look for BOM (Byte-Order-Marker) in the file
- // if found, pass in UTF-16 as the format. else
- // pass in UTF-8 as the format.
- SHeaderInStream<sizeof(g_BOMMarker)> theInStream(inStream);
- if (theInStream.readHeader() == false) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- QT3DSU16 theHeaderData;
- memCopy(&theHeaderData, theInStream.m_Header, sizeof(g_BOMMarker));
-
- char8_t nsSeparator = '$';
-
- if (theHeaderData == g_BOMMarker)
- qFatal("UTF-16 files not supported");
-
- QXmlStreamReader sreader;
- DOMParser domParser(factory, sreader, nsSeparator);
- QT3DSU8 dataBuf[2048];
- QT3DSU32 amountRead = 0;
- do {
- amountRead = theInStream.Read(toDataRef(dataBuf, 2048));
- if (amountRead) {
- QByteArray tmp = QByteArray::fromRawData((char*)dataBuf,amountRead);
- sreader.addData(tmp);
- }
- } while (amountRead > 0);
- while (!sreader.atEnd()) {
- QXmlStreamReader::TokenType token = sreader.readNext();
- if (token == QXmlStreamReader::StartElement) {
- domParser.m_Factory.IgnoreStrBuf();
- domParser.ParseName((TXMLCharPtr)sreader.name().toUtf8().data());
- int line = sreader.lineNumber();
- SDOMElement *newElem =
- domParser.m_Factory.NextElement(domParser.m_RegName, domParser.m_RegNS, line);
- if (domParser.m_FirstElement == NULL) {
- domParser.m_FirstElement = newElem;
- domParser.m_TopElement = newElem;
- } else {
- domParser.m_TopElement->AppendChild(*newElem);
- domParser.m_TopElement = newElem;
- }
- const QXmlStreamAttributes& attributes = sreader.attributes();
- for (auto attrib : attributes) {
- domParser.ParseName((TXMLCharPtr)attrib.name().toUtf8().data());
- SDOMAttribute *att =
- domParser.m_Factory.NextAttribute(domParser.m_RegName,
- (TXMLCharPtr)attrib.value()
- .toUtf8().data(),
- domParser.m_RegNS, line);
- newElem->m_Attributes.push_back(*att);
- }
- } else if (token == QXmlStreamReader::Characters) {
- QByteArray text = sreader.text().toUtf8();
- domParser.m_Factory.AppendStrBuf(text.data(), text.length());
- } else if (token == QXmlStreamReader::EndElement) {
- domParser.m_TopElement->m_Value = domParser.m_Factory.FinalizeStrBuf();
- domParser.m_TopElement = domParser.m_TopElement->m_Parent;
- }
-
- if (sreader.hasError()) {
- TXMLCharPtr error = (TXMLCharPtr)sreader.errorString().toUtf8().data();
- handler->OnXmlError(error, sreader.lineNumber(), sreader.columnNumber());
- return nullptr;
- }
-
- }
- return eastl::make_pair(domParser.m_FirstPair, domParser.m_FirstElement);
- }
-};
-
-class SimpleDomFactory : public IDOMFactory
-{
- typedef eastl::basic_string<char8_t, ForwardingAllocator> TNarrowStr;
- NVAllocatorCallback &m_Allocator;
- Pool<SDOMElement> m_ElementPool;
- Pool<SDOMAttribute> m_AttributePool;
- Pool<SNamespacePairNode> m_NamespaceNodePool;
- eastl::vector<char8_t *> m_BigStrings;
- NVScopedRefCounted<IStringTable> m_StringTable;
- TNarrowStr m_StringBuilder;
- volatile QT3DSI32 mRefCount;
-
-public:
- SimpleDomFactory(NVAllocatorCallback &alloc, NVScopedRefCounted<IStringTable> strt)
- : m_Allocator(alloc)
- , m_StringTable(strt)
- , m_StringBuilder(ForwardingAllocator(alloc, "SimpleDomFactory::m_StringBuilder"))
- , mRefCount(0)
- {
- }
-
- ~SimpleDomFactory()
- {
- QT3DS_FOREACH(idx, m_BigStrings.size())
- m_Allocator.deallocate(m_BigStrings[idx]);
- m_BigStrings.clear();
- }
-
- NVAllocatorCallback &GetAllocator() override { return m_Allocator; }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Allocator)
-
- TXMLCharPtr RegisterStr(TXMLCharPtr str)
- {
- if (str == NULL || *str == 0)
- return "";
- return m_StringTable->RegisterStr(str);
- }
-
- virtual void Release() { delete this; }
- void AppendStrBuf(TXMLCharPtr str, QT3DSU32 len) override
- {
- if (len && *str) {
- m_StringBuilder.append(str, str + len);
- }
- }
-
- // Null terminate what is there and return the buffer.
- // This pointer needs to be persistent.
- TXMLCharPtr FinalizeStrBuf() override
- {
- if (m_StringBuilder.size() == 0)
- return "";
- QT3DSU32 len = m_StringBuilder.size() + 1;
- QT3DSU32 numBytes = len * sizeof(char8_t);
- char8_t *newMem =
- (char8_t *)m_Allocator.allocate(numBytes, "DOMFactory::ValueStr", __FILE__, __LINE__);
- memCopy(newMem, m_StringBuilder.c_str(), numBytes);
- m_BigStrings.push_back(newMem);
- m_StringBuilder.clear();
- return newMem;
- }
- void IgnoreStrBuf() override { m_StringBuilder.clear(); }
-
- SDOMAttribute *NextAttribute(CRegisteredString name, TXMLCharPtr val,
- CRegisteredString ns, int inLine) override
- {
- TXMLCharPtr v(RegisterValue(val));
- SDOMAttribute *att = (SDOMAttribute *)m_AttributePool.allocate(__FILE__, __LINE__);
- new (att) SDOMAttribute(name, ns, v, inLine);
- return att;
- }
-
- SDOMElement *NextElement(CRegisteredString name, CRegisteredString ns, int inLine) override
- {
- IgnoreStrBuf();
- SDOMElement *elem = (SDOMElement *)(m_ElementPool.allocate(__FILE__, __LINE__));
- new (elem) SDOMElement(name, ns, inLine);
- return elem;
- }
-
- SNamespacePairNode *NextNSPairNode(CRegisteredString ns, CRegisteredString abbr) override
- {
- return m_NamespaceNodePool.construct(SNamespacePair(ns, abbr), __FILE__, __LINE__);
- }
-
- NVScopedRefCounted<IStringTable> GetStringTable() override { return m_StringTable; }
-};
-}
-
-NVScopedRefCounted<IDOMReader>
-IDOMReader::CreateDOMReader(NVAllocatorCallback &inAlloc, SDOMElement &inRootElement,
- NVScopedRefCounted<IStringTable> inStringTable,
- NVScopedRefCounted<IDOMFactory> inFactory)
-{
- return QT3DS_NEW(inAlloc, SDOMReader)(inAlloc, inRootElement, inStringTable, inFactory);
-}
-
-eastl::pair<NVScopedRefCounted<IDOMWriter>, NVScopedRefCounted<IDOMReader>>
-IDOMWriter::CreateDOMWriter(NVScopedRefCounted<IDOMFactory> inFactory, SDOMElement &inRootElement,
- NVScopedRefCounted<IStringTable> inStringTable)
-{
- NVScopedRefCounted<SDOMWriter> writer(
- QT3DS_NEW(inFactory->GetAllocator(), SDOMWriter)(inFactory, inStringTable, inRootElement));
- return eastl::make_pair(writer.mPtr, writer.mPtr);
-}
-
-TXMLCharPtr IDOMFactory::RegisterValue(TXMLCharPtr inValue)
-{
- if (isTrivial(inValue))
- return "";
- IgnoreStrBuf();
- AppendStrBuf(inValue, (QT3DSU32)strlen(inValue));
- return FinalizeStrBuf();
-}
-
-NVScopedRefCounted<IDOMFactory>
-IDOMFactory::CreateDOMFactory(NVAllocatorCallback &inAlloc,
- NVScopedRefCounted<IStringTable> inStrTable)
-{
- return QT3DS_NEW(inAlloc, SimpleDomFactory)(inAlloc, inStrTable);
-}
-
-void CDOMSerializer::WriteXMLHeader(IOutStream &inStream)
-{
- const char8_t *header = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
- QT3DSU32 len = (QT3DSU32)strlen(header);
- inStream.Write(header, len);
-}
-
-// Lexigraphically sort the attributes.
-struct SAttributeComparator
-{
- bool operator()(const SDOMAttribute *lhs, const SDOMAttribute *rhs)
- {
- int nsCmp = strcmp(lhs->m_Namespace, rhs->m_Namespace);
- if (nsCmp)
- return nsCmp < 0;
-
- return strcmp(lhs->m_Name, rhs->m_Name) < 0;
- }
-};
-
-typedef eastl::vector<SDOMAttribute *, ForwardingAllocator> TAttVector;
-typedef eastl::hash_map<CRegisteredString, CRegisteredString, eastl::hash<CRegisteredString>,
- eastl::equal_to<CRegisteredString>, ForwardingAllocator>
- TNSMap;
-
-CRegisteredString GetOrCreateNamespaceAbbr(NVAllocatorCallback &inAlloc, CRegisteredString theNs,
- TNSMap &inNamespace, TNSMap &inReverseNamespaces,
- IStringTable &inStrTable, bool &outCreated)
-{
- CRegisteredString abbr;
- if (theNs.IsValid()) {
- TNSMap::iterator nsIter = inNamespace.find(theNs);
- if (nsIter != inNamespace.end()) {
- abbr = nsIter->second;
- outCreated = false;
- } else {
- eastl::basic_string<char8_t, ForwardingAllocator> theStr(
- ForwardingAllocator(inAlloc, "nsBuilderString"));
- theStr.assign("a");
- eastl::basic_string<char8_t, ForwardingAllocator> theNsStr(
- ForwardingAllocator(inAlloc, "nsBuilderString"));
- CRegisteredString theNS = inStrTable.RegisterStr(theStr.c_str());
- while (inReverseNamespaces.find(theNS) != inReverseNamespaces.end()) {
- for (int idx = 0;
- idx < 26 && inReverseNamespaces.find(theNS) == inReverseNamespaces.end();
- ++idx) {
- theNsStr = theStr;
- theNsStr.append(1, (char8_t)('a' + idx));
- theNS = inStrTable.RegisterStr(theNsStr.c_str());
- }
- theStr.append(1, 'a');
- }
- inNamespace.insert(eastl::make_pair(theNs, theNS));
- abbr = theNS;
- outCreated = true;
- }
- }
- return abbr;
-}
-
-// Write an element with attributes sorted by name so a file diff is effective.
-void WriteElement(NVAllocatorCallback &inAlloc, SDOMElement &inElement, SimpleXmlWriter &inWriter,
- TAttVector &inAttSorter, TNSMap &inNamespace, TNSMap &inReverseNamespaces,
- IStringTable &inStrTable, bool inTrimEmptyElems, bool inWriteXMLNS)
-{
- inAttSorter.clear();
-
- // We decided that we don't want attribute sorting; the code that adds attributes needs
- // to be consistent.
- // This element doesn't add anything to the system in this case.
- if (inTrimEmptyElems && inElement.m_Attributes.empty() && inElement.m_Children.empty()
- && isTrivial(inElement.m_Value))
- return;
-
- for (TAttributeList::iterator iter = inElement.m_Attributes.begin(),
- end = inElement.m_Attributes.end();
- iter != end; ++iter)
- inAttSorter.push_back(&(*iter));
-
- // Find the namespace for the element
- bool createdAbbr = false;
- CRegisteredString abbr = GetOrCreateNamespaceAbbr(inAlloc, inElement.m_Namespace, inNamespace,
- inReverseNamespaces, inStrTable, createdAbbr);
-
- inWriter.Begin(inElement.m_Name, abbr);
- eastl::basic_string<char8_t, ForwardingAllocator> theStr(
- ForwardingAllocator(inAlloc, "nsBuilderString"));
- if (inWriteXMLNS) {
- for (TNSMap::iterator iter = inNamespace.begin(), end = inNamespace.end(); iter != end;
- ++iter) {
- theStr.assign("xmlns");
- if (iter->second.IsValid()) {
- theStr.append(1, ':');
- theStr.append(iter->second.c_str());
- }
- inWriter.Att(theStr.c_str(), NULL, iter->first.c_str());
- }
- } else if (createdAbbr) {
- theStr.assign("xmlns:");
- theStr.append(abbr.c_str());
- inWriter.Att(theStr.c_str(), NULL, inElement.m_Namespace.c_str());
- }
-
- const char8_t *theLastAttName = 0;
- const char8_t *theLastAttNamespace = 0;
- for (QT3DSU32 idx = 0, end = inAttSorter.size(); idx < end; ++idx) {
- SDOMAttribute *theAtt(inAttSorter[idx]);
- if (theAtt->m_Name != theLastAttName || theAtt->m_Namespace != theLastAttNamespace) {
- abbr = GetOrCreateNamespaceAbbr(inAlloc, theAtt->m_Namespace, inNamespace,
- inReverseNamespaces, inStrTable, createdAbbr);
- if (createdAbbr) {
- theStr.assign("xmlns:");
- theStr.append(abbr.c_str());
- inWriter.Att(theStr.c_str(), NULL, inElement.m_Namespace.c_str());
- }
-
- inWriter.Att(theAtt->m_Name, abbr, theAtt->m_Value);
- } else {
- QT3DS_ASSERT(false);
- }
- theLastAttName = theAtt->m_Name;
- theLastAttNamespace = theAtt->m_Namespace;
- }
- // Elements can either have children or values but not both at this point.
- if (inElement.m_Children.empty() == false) {
- for (SDOMElement::TElementChildList::iterator iter = inElement.m_Children.begin(),
- end = inElement.m_Children.end();
- iter != end; ++iter)
- WriteElement(inAlloc, *iter, inWriter, inAttSorter, inNamespace, inReverseNamespaces,
- inStrTable, inTrimEmptyElems, false);
-
- inWriter.End();
- } else {
- if (!isTrivial(inElement.m_Value))
- inWriter.Value(inElement.m_Value);
-
- inWriter.End();
- }
-}
-
-void CDOMSerializer::Write(NVAllocatorCallback &inAlloc, SDOMElement &inElement,
- IOutStream &inStream, IStringTable &inStrTable,
- NVConstDataRef<SNamespacePair> inNamespaces, bool inTrimEmptyElements,
- QT3DSU32 inTabs, bool inWriteNamespaces)
-{
- TAttVector theAttSorter(ForwardingAllocator(inAlloc, "CDOMSerializer::AttributeList"));
- TNSMap theNamespaces(ForwardingAllocator(inAlloc, "CDOMSerializer::NamespaceMap"));
- TNSMap theReverseNamespaces(ForwardingAllocator(inAlloc, "CDOMSerializer::NamespaceMap"));
- for (QT3DSU32 idx = 0, end = inNamespaces.size(); idx < end; ++idx) {
- theNamespaces.insert(
- eastl::make_pair(inNamespaces[idx].m_Namespace, inNamespaces[idx].m_Abbreviation));
- theReverseNamespaces.insert(
- eastl::make_pair(inNamespaces[idx].m_Abbreviation, inNamespaces[idx].m_Namespace));
- }
- SimpleXmlWriter writer(inAlloc, inStream, inTabs);
- WriteElement(inAlloc, inElement, writer, theAttSorter, theNamespaces, theReverseNamespaces,
- inStrTable, inTrimEmptyElements, inWriteNamespaces);
-}
-
-eastl::pair<SNamespacePairNode *, SDOMElement *>
-CDOMSerializer::Read(IDOMFactory &inFactory, IInStream &inStream, CXmlErrorHandler *inErrorHandler)
-{
- return DOMParser::ParseXMLFile(inFactory, inStream, inErrorHandler);
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/XML.h b/src/Runtime/ogl-runtime/src/foundation/XML.h
deleted file mode 100644
index 360bfdd7..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/XML.h
+++ /dev/null
@@ -1,680 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_FOUNDATION_XML_H
-#define QT3DS_FOUNDATION_XML_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "foundation/StringConversion.h" //Conversion between string and various datatypes.
-#include "foundation/Qt3DSFlags.h"
-#include "EASTL/algorithm.h"
-#include "foundation/IOStreams.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-
-namespace qt3ds {
-namespace foundation {
-
- class IStringTable;
-
- class IDOMFactory;
-
- class IInStream;
- class IOutStream;
- struct SDOMAttribute;
- struct SDOMElement;
- struct SNamespacePairNode;
-
- typedef const char8_t *TXMLCharPtr;
-
- typedef eastl::basic_string<char8_t, ForwardingAllocator> TXMLStr;
-
- // When the factor is destroyed, all elements and attributes are destroyed.
- class IDOMFactory : public NVRefCounted
- {
- protected:
- virtual ~IDOMFactory() {}
- public:
- // Str does not need to be null terminated.
- virtual void AppendStrBuf(TXMLCharPtr str, QT3DSU32 len) = 0;
- // Null terminate what is there and return the buffer.
- // This pointer needs to be persistent.
- virtual TXMLCharPtr FinalizeStrBuf() = 0;
- virtual void IgnoreStrBuf() = 0;
-
- virtual SDOMAttribute *NextAttribute(CRegisteredString name, TXMLCharPtr val,
- CRegisteredString ns = CRegisteredString(),
- int inLine = 0) = 0;
- virtual SDOMElement *NextElement(CRegisteredString name,
- CRegisteredString ns = CRegisteredString(),
- int inLine = 0) = 0;
- virtual SNamespacePairNode *NextNSPairNode(CRegisteredString ns,
- CRegisteredString abbr) = 0;
-
- TXMLCharPtr RegisterValue(TXMLCharPtr inValue);
-
- virtual NVScopedRefCounted<IStringTable> GetStringTable() = 0;
- virtual NVAllocatorCallback &GetAllocator() = 0;
-
- static NVScopedRefCounted<IDOMFactory>
- CreateDOMFactory(NVAllocatorCallback &inAllocator,
- NVScopedRefCounted<IStringTable> inStrTable);
- };
-
- struct SDOMAttribute
- {
- CRegisteredString m_Namespace;
- CRegisteredString m_Name;
- const char8_t *m_Value;
- SDOMAttribute *m_NextAttribute;
- SDOMAttribute *m_PreviousAttribute;
- int m_Line;
- SDOMAttribute()
- : m_Value(NULL)
- , m_NextAttribute(NULL)
- , m_PreviousAttribute(NULL)
- , m_Line(0)
- {
- }
-
- SDOMAttribute(CRegisteredString inName, CRegisteredString inNs, const char8_t *inValue,
- int line)
- : m_Namespace(inNs)
- , m_Name(inName)
- , m_Value(inValue)
- , m_NextAttribute(NULL)
- , m_PreviousAttribute(NULL)
- , m_Line(line)
- {
- }
-
- bool Value(const char8_t *&outValue)
- {
- outValue = m_Value;
- return true;
- }
-
- template <typename TDataType>
- bool Value(TDataType &outValue)
- {
- StringConversion<TDataType>().StrTo(m_Value, outValue);
- return true;
- }
- };
-
- struct SNextAttOp
- {
- SDOMAttribute *get(SDOMAttribute &inAtt) { return inAtt.m_NextAttribute; }
- const SDOMAttribute *get(const SDOMAttribute &inAtt) { return inAtt.m_NextAttribute; }
- void set(SDOMAttribute &inAtt, SDOMAttribute *next) { inAtt.m_NextAttribute = next; }
- };
- struct SPrevAttOp
- {
- SDOMAttribute *get(SDOMAttribute &inAtt) { return inAtt.m_PreviousAttribute; }
- const SDOMAttribute *get(const SDOMAttribute &inAtt) { return inAtt.m_PreviousAttribute; }
- void set(SDOMAttribute &inAtt, SDOMAttribute *prev) { inAtt.m_PreviousAttribute = prev; }
- };
-
- typedef InvasiveLinkedList<SDOMAttribute, SPrevAttOp, SNextAttOp> TAttributeList;
-
- struct SNamespacePair
- {
- CRegisteredString m_Namespace;
- CRegisteredString m_Abbreviation;
- SNamespacePair(CRegisteredString ns = CRegisteredString(),
- CRegisteredString abbr = CRegisteredString())
- : m_Namespace(ns)
- , m_Abbreviation(abbr)
- {
- }
- };
-
- struct SNamespacePairNode : public SNamespacePair
- {
- SNamespacePairNode *m_NextNode;
- SNamespacePairNode(const SNamespacePair &inSrc = SNamespacePair())
- : SNamespacePair(inSrc)
- , m_NextNode(NULL)
- {
- }
- };
-
- // Simplified dom element. All it has is one character value and list of attributes
- // and children. So you can't mix elements and character data like you can in
- // full xml, but this simplifies parsing.
- struct SDOMElement
- {
- struct SNextElemOp
- {
- SDOMElement *get(SDOMElement &elem) { return elem.m_NextSibling; }
- const SDOMElement *get(const SDOMElement &elem) { return elem.m_NextSibling; }
- void set(SDOMElement &elem, SDOMElement *next) { elem.m_NextSibling = next; }
- };
- struct SPrevElemOp
- {
- SDOMElement *get(SDOMElement &elem) { return elem.m_PreviousSibling; }
- const SDOMElement *get(const SDOMElement &elem) { return elem.m_PreviousSibling; }
- void set(SDOMElement &elem, SDOMElement *prev) { elem.m_PreviousSibling = prev; }
- };
- typedef InvasiveLinkedList<SDOMElement, SPrevElemOp, SNextElemOp> TElementChildList;
-
- CRegisteredString m_Namespace;
- CRegisteredString m_Name;
- const char8_t *m_Value;
- SDOMElement *m_Parent;
- SDOMElement *m_NextSibling;
- SDOMElement *m_PreviousSibling;
- TAttributeList m_Attributes;
- TElementChildList m_Children;
- int m_Line;
-
- SDOMElement()
- : m_Value(NULL)
- , m_Parent(NULL)
- , m_NextSibling(NULL)
- , m_PreviousSibling(NULL)
- , m_Line(0)
- {
- }
-
- SDOMElement(CRegisteredString name, CRegisteredString ns, int inLine)
- : m_Namespace(ns)
- , m_Name(name)
- , m_Value(NULL)
- , m_Parent(NULL)
- , m_NextSibling(NULL)
- , m_PreviousSibling(NULL)
- , m_Line(inLine)
- {
- }
-
- void AppendChild(SDOMElement &inElem, SDOMElement *inPos = NULL)
- {
- if (inElem.m_Parent)
- inElem.m_Parent->RemoveChild(inElem);
- inElem.m_Parent = this;
- if (inPos) {
- QT3DS_ASSERT(inPos->m_Parent == this);
- m_Children.insert_after(*inPos, inElem);
- } else
- m_Children.push_back(inElem);
- }
-
- void PrependChild(SDOMElement &inElem, SDOMElement *inPos = NULL)
- {
- if (inElem.m_Parent)
- inElem.m_Parent->RemoveChild(inElem);
- inElem.m_Parent = this;
- if (inPos) {
- QT3DS_ASSERT(inPos->m_Parent == this);
- m_Children.insert_before(*inPos, inElem);
- } else
- m_Children.push_front(inElem);
- }
-
- void RemoveChild(SDOMElement &inElem)
- {
- if (inElem.m_Parent == this) {
- m_Children.remove(inElem);
- } else {
- if (inElem.m_Parent) {
- QT3DS_ASSERT(false);
- }
- }
- }
- SDOMElement *FindNext(CRegisteredString inName, Option<CRegisteredString> inNamespace,
- TElementChildList::iterator iter)
- {
- for (TElementChildList::iterator end(NULL); iter != end; ++iter) {
- if (inName.IsValid() == false || inName == iter->m_Name) {
- if (inNamespace.hasValue() == false || *inNamespace == iter->m_Namespace)
- return &(*iter);
- }
- }
- return NULL;
- }
- // Search starts just *after inStartPos if provided
- SDOMElement *FindChild(CRegisteredString inName, Option<CRegisteredString> inNamespace,
- SDOMElement *inStartPos = NULL)
- {
- TElementChildList::iterator iter = m_Children.begin();
- if (inStartPos) {
- QT3DS_ASSERT(inStartPos->m_Parent == this);
- iter = TElementChildList::iterator(inStartPos->m_NextSibling);
- }
- return FindNext(inName, inNamespace, iter);
- }
- // Search starts just *after inStartPos if provided
- SDOMElement *FindSibling(CRegisteredString inName, Option<CRegisteredString> inNamespace)
- {
- TElementChildList::iterator iter(m_NextSibling);
- return FindNext(inName, inNamespace, iter);
- }
-
- SDOMAttribute *FindAttribute(CRegisteredString inName,
- Option<CRegisteredString> inNamespace)
- {
- for (TAttributeList::iterator iter = m_Attributes.begin(), end = m_Attributes.end();
- iter != end; ++iter) {
- if (iter->m_Name == inName) {
- if (inNamespace.hasValue() == false || *inNamespace == iter->m_Namespace)
- return &(*iter);
- }
- }
- return NULL;
- }
-
- template <typename TDataType>
- bool AttValue(CRegisteredString inName, Option<CRegisteredString> inNamespace,
- TDataType &outValue)
- {
- SDOMAttribute *att = FindAttribute(inName, inNamespace);
- if (att)
- return att->Value(outValue);
- return false;
- }
-
- QT3DSU32 GetNumChildren(CRegisteredString inName,
- Option<CRegisteredString> inNamespace = Empty()) const
- {
- QT3DSU32 count = 0;
- if (inName.IsValid() == false) {
- // empty loop intentional
- for (TElementChildList::iterator iter = m_Children.begin(), end = m_Children.end();
- iter != end; ++iter, ++count)
- ;
- } else {
- for (TElementChildList::iterator iter = m_Children.begin(), end = m_Children.end();
- iter != end; ++iter) {
- if (iter->m_Name == inName
- && (inNamespace.isEmpty() || iter->m_Namespace == *inNamespace))
- ++count;
- }
- }
- return count;
- }
-
- void SetAttributeValue(CRegisteredString inName, Option<CRegisteredString> inNamespace,
- TXMLCharPtr inValue, IDOMFactory &inFactory, int inLine)
- {
- SDOMAttribute *att = FindAttribute(inName, inNamespace);
- if (att) {
- att->m_Value = inFactory.RegisterValue(inValue);
- } else {
- m_Attributes.push_back(*inFactory.NextAttribute(
- inName, inValue, inNamespace.unsafeGetValue(), inLine));
- }
- }
-
- void RemoveAttribute(CRegisteredString nm, Option<CRegisteredString> inNamespace)
- {
- SDOMAttribute *theAttribute = FindAttribute(nm, inNamespace);
- if (theAttribute)
- m_Attributes.remove(*theAttribute);
- }
- };
-
- struct SReaderScope
- {
- SDOMElement *m_Element;
- SDOMAttribute *m_Attribute;
- SReaderScope(SDOMElement *inElem = NULL, SDOMAttribute *inAtt = NULL)
- : m_Element(inElem)
- , m_Attribute(inAtt)
- {
- }
- };
-
- class IDOMReader : public NVRefCounted
- {
- protected:
- virtual ~IDOMReader() {}
- public:
- // Stack object to save the reader's state.
- struct Scope
- {
- IDOMReader &m_Reader;
- Scope(IDOMReader &reader)
- : m_Reader(reader)
- {
- m_Reader.PushScope();
- }
- Scope(NVScopedRefCounted<IDOMReader> reader)
- : m_Reader(*reader)
- {
- m_Reader.PushScope();
- }
- ~Scope() { m_Reader.PopScope(); }
- };
-
- // Parse buffer
- MemoryBuffer<ForwardingAllocator> m_TempBuf;
- NVScopedRefCounted<IStringTable> m_StringTable;
-
- IDOMReader(NVAllocatorCallback &inAlloc, NVScopedRefCounted<IStringTable> inStringTable)
- : m_TempBuf(ForwardingAllocator(inAlloc, "IDOMReader::m_TempBuf"))
- , m_StringTable(inStringTable)
- {
- }
-
- NVScopedRefCounted<IStringTable> GetStringTable() { return m_StringTable; }
-
- // Pushing scope saves your state so no matter where you are when
- // you next pop scope, you come back to the same state.
- virtual void PushScope() = 0;
- virtual void PopScope() = 0;
-
- // Sometimes pushing and popping scope isn't enough and you need
- // somewhat random access to scope.
- // This scope does not remember the current attribute.
- virtual SReaderScope GetScope() = 0;
- virtual void SetScope(SReaderScope inScope) = 0;
- // Return an attribute whose value is *not* registered with the string table.
- // You can't hold onto this value for any length of time, but when you need to
- // immediately convert to a different value this is the most efficient way.
- virtual bool UnregisteredAtt(TXMLCharPtr name, TXMLCharPtr &outValue,
- TXMLCharPtr ns = NULL) = 0;
- // Return an attribute whose value *is* registered with the string table.
- virtual bool Att(TXMLCharPtr name, CRegisteredString &outValue, TXMLCharPtr ns = NULL) = 0;
- virtual SDOMAttribute *GetFirstAttribute() = 0;
- virtual SDOMAttribute *GetNextAttribute() = 0;
- virtual QT3DSU32 CountChildren(TXMLCharPtr childName = NULL, TXMLCharPtr ns = NULL) = 0;
- virtual bool MoveToFirstChild(TXMLCharPtr childName = NULL, TXMLCharPtr ns = NULL) = 0;
- virtual bool MoveToNextSibling(TXMLCharPtr siblingName = NULL, TXMLCharPtr ns = NULL) = 0;
- // Leave element means go to its parent.
- virtual void Leave() = 0;
- virtual SDOMElement *GetElement() const = 0;
- CRegisteredString GetElementName() const
- {
- SDOMElement *elem = GetElement();
- if (elem)
- return elem->m_Name;
- return CRegisteredString();
- }
-
- // Value is the concatentated text node values inside the element
- virtual bool Value(TXMLCharPtr &outValue) = 0;
-
- // Get the element this reader was created with
- virtual SDOMElement *GetTopElement() = 0;
-
- bool Att(TXMLCharPtr name, TXMLStr &outValue)
- {
- TXMLCharPtr temp;
- if (UnregisteredAtt(name, temp)) {
- outValue.assign(temp);
- return true;
- }
- return false;
- }
-
- template <typename TDataType>
- bool Att(TXMLCharPtr name, TDataType &outValue)
- {
- TXMLCharPtr temp;
- if (UnregisteredAtt(name, temp)) {
- StringConversion<TDataType>().StrTo(temp, outValue);
- return true;
- } else {
- return false;
- }
- }
-
- bool ChildValue(TXMLCharPtr name, TXMLCharPtr &value)
- {
- if (MoveToFirstChild(name)) {
- Value(value);
- Leave();
- return true;
- }
- return false;
- }
-
- bool RegisteredChildValue(TXMLCharPtr name, TXMLCharPtr &value)
- {
- if (MoveToFirstChild(name)) {
- RegisteredValue(value);
- Leave();
- return true;
- }
- return false;
- }
- bool RegisteredValue(TXMLCharPtr &outValue)
- {
- bool retval = Value(outValue);
- if (retval)
- outValue = m_StringTable->RegisterStr(outValue);
- return retval;
- }
-
- template <typename TDataType>
- bool Value(TDataType &outValue)
- {
- TXMLCharPtr value;
- if (Value(value)) {
- StringConversion<TDataType>().StrTo(value, outValue);
- return true;
- }
- return false;
- }
-
- // IDOMReader implementations
- template <typename TDataType>
- bool ValueList(NVDataRef<TDataType> data)
- {
- const char8_t *value;
- if (Value(value)) {
- Char8TReader reader(const_cast<char8_t *>(value), m_TempBuf);
- reader.ReadRef(data);
- }
- return true;
- }
-
- // Destructive operation because we can't trust
- // strtod to do the right thing. On windows, for long strings,
- // it calls strlen every operation thus leading to basically N^2
- // behavior
- template <typename TDataType>
- NVConstDataRef<TDataType> ChildValueList(TXMLCharPtr listName)
- {
- NVConstDataRef<TDataType> retval;
- TXMLCharPtr childValue = NULL;
- if (ChildValue(listName, childValue)) {
- Char8TReader reader(const_cast<char8_t *>(childValue), m_TempBuf);
- reader.ReadBuffer(retval);
- }
- return retval;
- }
-
- template <typename TSerializer>
- void Serialize(const char8_t *elemName, TSerializer &serializer,
- const char8_t *inNamespace = NULL)
- {
- IDOMReader::Scope __theScope(*this);
- if (MoveToFirstChild(elemName, inNamespace)) {
- serializer.Serialize(*this);
- }
- }
- // Optionally hold on to the factory to keep our elements in memory as long as we are.
- static NVScopedRefCounted<IDOMReader> CreateDOMReader(
- NVAllocatorCallback &inAlloc, SDOMElement &inRootElement,
- NVScopedRefCounted<IStringTable> inStringTable,
- NVScopedRefCounted<IDOMFactory> inFactory = NVScopedRefCounted<IDOMFactory>());
- };
-
- // Write out data in an xml-like fasion without specifying exactly
- // where that data is being written.
- class IDOMWriter : public NVRefCounted
- {
- protected:
- virtual ~IDOMWriter() {}
- public:
- // Control the element scope.
- struct Scope
- {
- IDOMWriter &m_Writer;
- Scope(IDOMWriter &writer, TXMLCharPtr inElemName, TXMLCharPtr inNamespace = NULL)
- : m_Writer(writer)
- {
- m_Writer.Begin(inElemName, inNamespace);
- }
- ~Scope() { m_Writer.End(); }
- };
-
- char8_t m_NarrowBuf[256];
-
- // There tend to be two types of elements.
- // Containers (<a>\n\t<b/><b/>\n</a>)
- // and Values <b>onetwothree</b>
- virtual void Begin(TXMLCharPtr inElemName, TXMLCharPtr inNamespace = NULL,
- int inLine = 0) = 0;
- // Attributes. They may be sorted just before write
- virtual void Att(TXMLCharPtr name, TXMLCharPtr value, TXMLCharPtr inNamespace = NULL,
- int inLine = 0) = 0;
- virtual void Value(TXMLCharPtr value) = 0;
- virtual void End() = 0;
- virtual void RemoveCurrent() = 0;
- virtual void RemoveAttribute(TXMLCharPtr inItem, TXMLCharPtr inNamespace = NULL) = 0;
- // Get the number of tabs required to line up the next line
- // with the opening of the previous line
- virtual QT3DSU32 GetTabs() = 0;
- virtual SDOMElement *GetTopElement() = 0;
- virtual NVScopedRefCounted<IDOMFactory> GetFactory() = 0;
- // Move this item before this sibling. Function does not rearrange the
- // tree in any major way and will not work if inItem and inSibling aren't
- // siblings.
- virtual void MoveBefore(TXMLCharPtr inItem, TXMLCharPtr inSibling,
- TXMLCharPtr inNamespace = NULL) = 0;
- virtual NVAllocatorCallback &GetAllocator() = 0;
-
- virtual void ChildValue(TXMLCharPtr name, TXMLCharPtr value, TXMLCharPtr inNamespace = NULL)
- {
- Begin(name, inNamespace);
- Value(value);
- End();
- }
-
- TXMLCharPtr ToStr(char8_t val)
- {
- m_NarrowBuf[0] = val;
- m_NarrowBuf[1] = 0;
- return m_NarrowBuf;
- }
-
- template <typename TDataType>
- TXMLCharPtr ToStr(TDataType val)
- {
- StringConversion<TDataType>().ToStr(val, NVDataRef<char8_t>(m_NarrowBuf, 256));
- return m_NarrowBuf;
- }
-
- void Att(TXMLCharPtr name, const TXMLStr &inValue, TXMLCharPtr inNamespace = NULL)
- {
- return Att(name, inValue.c_str(), inNamespace);
- }
-
- template <typename TData>
- void Att(TXMLCharPtr name, TData value, TXMLCharPtr inNamespace = NULL)
- {
- Att(name, ToStr(value), inNamespace);
- }
-
- template <typename TSerializer>
- void Serialize(const char8_t *elemName, TSerializer &serializer,
- TXMLCharPtr inNamespace = NULL)
- {
- IDOMWriter::Scope __theScope(*this, elemName, inNamespace);
- serializer.Serialize(*this);
- }
-
- NVScopedRefCounted<IDOMReader> CreateDOMReader()
- {
- NVScopedRefCounted<IDOMFactory> theFactory(GetFactory());
- return IDOMReader::CreateDOMReader(GetAllocator(), *GetTopElement(),
- theFactory->GetStringTable(), theFactory);
- }
-
- // Note that the default method of creating a writer also creates a reader; they can
- // both manipulation the DOM hierarch.
- static eastl::pair<NVScopedRefCounted<IDOMWriter>, NVScopedRefCounted<IDOMReader>>
- CreateDOMWriter(NVScopedRefCounted<IDOMFactory> inFactory, SDOMElement &inRootElement,
- NVScopedRefCounted<IStringTable> inStringTable);
-
- static eastl::pair<NVScopedRefCounted<IDOMWriter>, NVScopedRefCounted<IDOMReader>>
- CreateDOMWriter(NVAllocatorCallback &inAlloc, const char8_t *inTopElemName,
- NVScopedRefCounted<IStringTable> inStringTable,
- const char8_t *inNamespace = NULL)
- {
- NVScopedRefCounted<IDOMFactory> theFactory(
- IDOMFactory::CreateDOMFactory(inAlloc, inStringTable));
- SDOMElement *theRoot =
- theFactory->NextElement(theFactory->GetStringTable()->RegisterStr(inTopElemName),
- theFactory->GetStringTable()->RegisterStr(inNamespace));
- return CreateDOMWriter(theFactory, *theRoot, inStringTable);
- }
- };
-
- class CXmlErrorHandler
- {
- protected:
- virtual ~CXmlErrorHandler() {}
- public:
- virtual void OnXmlError(TXMLCharPtr errorName, int line, int column) = 0;
- };
-
- class CDOMSerializer
- {
- public:
- static void WriteXMLHeader(IOutStream &inStream);
-
- // Write out the elements. These pairs will be used in order to abbreviate namespaces with
- // nicer abbreviations.
- // Any namespaces not found in those pairs will get auto-generated abbreviations
- // The document will be assumed to be in the namespace that has no abbreviation.
- // For fragments or snippets, it is better to avoid writing out the namespace declarations
- static void
- Write(NVAllocatorCallback &inAlloc, SDOMElement &inElement, IOutStream &inStream,
- IStringTable &inStrTable,
- NVConstDataRef<SNamespacePair> inNamespaces = NVConstDataRef<SNamespacePair>(),
- bool inTrimEmptyElements = true, QT3DSU32 inTabs = 0, bool inWriteNamespaces = true);
-
- // Returns a pair of the namespace pair nodes and the dom element. The ns pair nodes allow
- // us to at least keep the same abbreviations
- // used if namespace are used.
- static eastl::pair<SNamespacePairNode *, SDOMElement *>
- Read(IDOMFactory &inFactory, IInStream &inStream, CXmlErrorHandler *inErrorHandler = NULL);
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/LICENSE.TXT b/src/Runtime/ogl-runtime/src/foundation/linux/LICENSE.TXT
deleted file mode 100644
index f40caef8..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/LICENSE.TXT
+++ /dev/null
@@ -1,7 +0,0 @@
- Copyright (c) 2001 Intel Corporation.
-
-Permition is granted to use, copy, distribute and prepare derivative works
-of this library for any purpose and without fee, provided, that the above
-copyright notice and this statement appear in all copies.
-Intel makes no representations about the suitability of this library for
-any purpose, and specifically disclaims all warranties.
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAoS.h b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAoS.h
deleted file mode 100644
index 6bcb4406..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAoS.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_LINUX_AOS_H
-#define QT3DS_LINUX_AOS_H
-
-// no includes here! this file should be included from NVcVecMath.h only!!!
-
-#if !COMPILE_VECTOR_INTRINSICS
-#error Vector intrinsics should not be included when using scalar implementation.
-#endif
-
-// only SSE compatible platforms should reach this
-// likely to be split up when we add NEON support.
-#include <xmmintrin.h>
-
-typedef union UnionM128 {
- UnionM128() {}
- UnionM128(__m128 in) { m128 = in; }
-
- UnionM128(__m128i in) { m128i = in; }
-
- operator __m128() { return m128; }
-
- operator const __m128() const { return m128; }
-
- float m128_f32[4];
- __int8_t m128_i8[16];
- __int16_t m128_i16[8];
- __int32_t m128_i32[4];
- __int64_t m128_i64[2];
- __uint16_t m128_u16[8];
- __uint32_t m128_u32[4];
- __uint64_t m128_u64[2];
- __m128 m128;
- __m128i m128i;
-} UnionM128;
-
-typedef __m128 FloatV;
-typedef __m128 Vec3V;
-typedef __m128 Vec4V;
-typedef __m128 BoolV;
-typedef __m128 QuatV;
-// typedef __m128 VecU32V;
-// typedef __m128 VecI32V;
-// typedef __m128 VecU16V;
-// typedef __m128 VecI16V;
-// typedef __m128 VecU8V;
-typedef UnionM128 VecU32V;
-typedef UnionM128 VecI32V;
-typedef UnionM128 VecU16V;
-typedef UnionM128 VecI16V;
-typedef UnionM128 VecU8V;
-
-#define FloatVArg FloatV &
-#define Vec3VArg Vec3V &
-#define Vec4VArg Vec4V &
-#define BoolVArg BoolV &
-#define VecU32VArg VecU32V &
-#define VecI32VArg VecI32V &
-#define VecU16VArg VecU16V &
-#define VecI16VArg VecI16V &
-#define VecU8VArg VecU8V &
-#define QuatVArg QuatV &
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat33V
-{
- Mat33V() {}
- Mat33V(const Vec3V &c0, const Vec3V &c1, const Vec3V &c2)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- {
- }
- Vec3V QT3DS_ALIGN(16, col0);
- Vec3V QT3DS_ALIGN(16, col1);
- Vec3V QT3DS_ALIGN(16, col2);
-} QT3DS_ALIGN_SUFFIX(16);
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat34V
-{
- Mat34V() {}
- Mat34V(const Vec3V &c0, const Vec3V &c1, const Vec3V &c2, const Vec3V &c3)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- , col3(c3)
- {
- }
- Vec3V QT3DS_ALIGN(16, col0);
- Vec3V QT3DS_ALIGN(16, col1);
- Vec3V QT3DS_ALIGN(16, col2);
- Vec3V QT3DS_ALIGN(16, col3);
-} QT3DS_ALIGN_SUFFIX(16);
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat43V
-{
- Mat43V() {}
- Mat43V(const Vec4V &c0, const Vec4V &c1, const Vec4V &c2)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- {
- }
- Vec4V QT3DS_ALIGN(16, col0);
- Vec4V QT3DS_ALIGN(16, col1);
- Vec4V QT3DS_ALIGN(16, col2);
-} QT3DS_ALIGN_SUFFIX(16);
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat44V
-{
- Mat44V() {}
- Mat44V(const Vec4V &c0, const Vec4V &c1, const Vec4V &c2, const Vec4V &c3)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- , col3(c3)
- {
- }
- Vec4V QT3DS_ALIGN(16, col0);
- Vec4V QT3DS_ALIGN(16, col1);
- Vec4V QT3DS_ALIGN(16, col2);
- Vec4V QT3DS_ALIGN(16, col3);
-} QT3DS_ALIGN_SUFFIX(16);
-
-#endif // QT3DS_LINUX_AOS_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAtomic.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAtomic.cpp
deleted file mode 100644
index f0045dd9..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxAtomic.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAtomic.h"
-#ifdef __QNX__
-#include <atomic.h>
-#endif
-#ifdef __INTEGRITY
-#include <QtCore/qmutex.h>
-#endif
-
-#define PAUSE() asm("nop")
-
-namespace qt3ds {
-namespace foundation {
-#ifdef __QNX__
- QT3DSI32 atomicIncrement(volatile QT3DSI32 *val)
- {
- atomic_add((volatile unsigned *)val, 1);
- return *val;
- }
-
- QT3DSI32 atomicDecrement(volatile QT3DSI32 *val)
- {
- atomic_sub((volatile unsigned *)val, 1);
- return *val;
- }
-#elif defined (__INTEGRITY)
- // TestAndSet and AtomicModify take in volatile Address* leading to overflow error if used
-
- QT3DSI32 atomicCompareExchange(volatile QT3DSI32 *dest, QT3DSI32 exch, QT3DSI32 comp)
- {
- static QMutex mutex;
- QMutexLocker lock(&mutex);
- QT3DSI32 ret = *dest;
- *dest = (*dest == comp) ? exch : ret;
- return ret;
- }
-
- QT3DSI32 atomicIncrement(volatile QT3DSI32 *val)
- {
- static QMutex mutex;
- QMutexLocker lock(&mutex);
- return ++(*val);
- }
-
- QT3DSI32 atomicDecrement(volatile QT3DSI32 *val)
- {
- static QMutex mutex;
- QMutexLocker lock(&mutex);
- return --(*val);
- }
-#else
- void *atomicCompareExchangePointer(volatile void **dest, void *exch, void *comp)
- {
- return __sync_val_compare_and_swap((void **)dest, comp, exch);
- }
-
- QT3DSI32 atomicCompareExchange(volatile QT3DSI32 *dest, QT3DSI32 exch, QT3DSI32 comp)
- {
- return __sync_val_compare_and_swap(dest, comp, exch);
- }
-
- QT3DSI32 atomicIncrement(volatile QT3DSI32 *val) { return __sync_add_and_fetch(val, 1); }
-
- QT3DSI32 atomicDecrement(volatile QT3DSI32 *val) { return __sync_sub_and_fetch(val, 1); }
-
- QT3DSI32 atomicAdd(volatile QT3DSI32 *val, QT3DSI32 delta) { return __sync_add_and_fetch(val, delta); }
-
- QT3DSI32 atomicMax(volatile QT3DSI32 *val, QT3DSI32 val2)
- {
- QT3DSI32 oldVal, newVal;
-
- do {
- PAUSE();
- oldVal = *val;
-
- if (val2 > oldVal)
- newVal = val2;
- else
- newVal = oldVal;
-
- } while (atomicCompareExchange(val, newVal, oldVal) != oldVal);
-
- return *val;
- }
-
- QT3DSI32 atomicExchange(volatile QT3DSI32 *val, QT3DSI32 val2)
- {
- QT3DSI32 newVal, oldVal;
-
- do {
- PAUSE();
- oldVal = *val;
- newVal = val2;
- } while (atomicCompareExchange(val, newVal, oldVal) != oldVal);
-
- return newVal;
- }
-#endif
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFPU.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFPU.cpp
deleted file mode 100644
index c3eae215..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFPU.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/Qt3DSFPU.h"
-#include <fenv.h>
-
-QT3DS_COMPILE_TIME_ASSERT(8 * sizeof(qt3ds::QT3DSU32) >= sizeof(fenv_t));
-
-qt3ds::foundation::FPUGuard::FPUGuard()
-{
-#ifdef __CYGWIN__
-#pragma message "FPUGuard::FPUGuard() is not implemented"
-#else
- fegetenv(reinterpret_cast<fenv_t *>(mControlWords));
- fesetenv(FE_DFL_ENV);
-#endif
-}
-
-qt3ds::foundation::FPUGuard::~FPUGuard()
-{
-#ifdef __CYGWIN__
-#pragma message "FPUGuard::~FPUGuard() is not implemented"
-#else
- fesetenv(reinterpret_cast<fenv_t *>(mControlWords));
-#endif
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFile.h b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFile.h
deleted file mode 100644
index 1369735f..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxFile.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_LINUX_FILE_H
-#define QT3DS_FOUNDATION_QT3DS_LINUX_FILE_H
-
-#include "foundation/Qt3DS.h"
-#include <stdio.h>
-
-namespace qt3ds {
-namespace foundation {
- QT3DS_INLINE int fopen_s(FILE **_File, const char *_Filename, const char *_Mode)
- {
- FILE *fp = ::fopen(_Filename, _Mode);
- return fp ? *_File = fp, 0 : -1;
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxInlineAoS.h b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxInlineAoS.h
deleted file mode 100644
index 0443ba90..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxInlineAoS.h
+++ /dev/null
@@ -1,2666 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// Copyright (c) 2001 Intel Corporation.
-//
-// Permition is granted to use, copy, distribute and prepare derivative works
-// of this library for any purpose and without fee, provided, that the above
-// copyright notice and this statement appear in all copies.
-// Intel makes no representations about the suitability of this library for
-// any purpose, and specifically disclaims all warranties.
-// See LEGAL.TXT for all the legal information.
-//
-
-#ifndef QT3DS_LINUX_INLINE_AOS_H
-#define QT3DS_LINUX_INLINE_AOS_H
-
-#if !COMPILE_VECTOR_INTRINSICS
-#error Vector intrinsics should not be included when using scalar implementation.
-#endif
-
-// Remove this define when all platforms use simd solver.
-#define QT3DS_SUPPORT_SIMD
-
-#define _QT3DS_FPCLASS_SNAN 0x0001 /* signaling NaN */
-#define _QT3DS_FPCLASS_QNAN 0x0002 /* quiet NaN */
-#define _QT3DS_FPCLASS_NINF 0x0004 /* negative infinity */
-#define _QT3DS_FPCLASS_PINF 0x0200 /* positive infinity */
-
-QT3DS_FORCE_INLINE __m128 m128_I2F(__m128i n)
-{
- return _mm_castsi128_ps(n);
-}
-QT3DS_FORCE_INLINE __m128i m128_F2I(__m128 n)
-{
- return _mm_castps_si128(n);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAllTrue4_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return moveMask == (0xf);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAnyTrue4_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return moveMask != (0x0);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAllTrue3_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return (moveMask & 0x7) == (0x7);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAnyTrue3_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return (moveMask & 0x7) != (0x0);
-}
-
-/////////////////////////////////////////////////////////////////////
-////FUNCTIONS USED ONLY FOR ASSERTS IN VECTORISED IMPLEMENTATIONS
-/////////////////////////////////////////////////////////////////////
-
-QT3DS_FORCE_INLINE QT3DSU32 FiniteTestEq(const Vec4V a, const Vec4V b)
-{
- // This is a bit of a bodge.
- //_mm_comieq_ss returns 1 if either value is nan so we need to re-cast a and b with true encoded
- //as a non-nan number.
- // There must be a better way of doing this in sse.
- const BoolV one = FOne();
- const BoolV zero = FZero();
- const BoolV a1 = V4Sel(a, one, zero);
- const BoolV b1 = V4Sel(b, one, zero);
- return (_mm_comieq_ss(a1, b1) && _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(1, 1, 1, 1)),
- _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(1, 1, 1, 1)))
- && _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(2, 2, 2, 2)),
- _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(2, 2, 2, 2)))
- && _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(3, 3, 3, 3)),
- _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(3, 3, 3, 3))));
-}
-
-QT3DS_FORCE_INLINE bool isValidFloatV(const FloatV a)
-{
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)))
- && _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)))
- && _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3))));
-}
-
-QT3DS_FORCE_INLINE bool isValidVec3V(const Vec3V a)
-{
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3)), FZero()) ? true : false);
-}
-
-QT3DS_FORCE_INLINE bool isFiniteFloatV(const FloatV a)
-{
- const QT3DSU32 badNumber =
- (_QT3DS_FPCLASS_SNAN | _QT3DS_FPCLASS_QNAN | _QT3DS_FPCLASS_NINF | _QT3DS_FPCLASS_PINF);
- const FloatV vBadNum = FloatV_From_F32((QT3DSF32 &)badNumber);
- const BoolV vMask = BAnd(vBadNum, a);
- return FiniteTestEq(vMask, BFFFF()) == 1;
-}
-
-QT3DS_FORCE_INLINE bool isFiniteVec3V(const Vec3V a)
-{
- const QT3DSU32 badNumber =
- (_QT3DS_FPCLASS_SNAN | _QT3DS_FPCLASS_QNAN | _QT3DS_FPCLASS_NINF | _QT3DS_FPCLASS_PINF);
- const Vec3V vBadNum = Vec3V_From_F32((QT3DSF32 &)badNumber);
- const BoolV vMask = BAnd(BAnd(vBadNum, a), BTTTF());
- return FiniteTestEq(vMask, BFFFF()) == 1;
-}
-
-QT3DS_FORCE_INLINE bool isFiniteVec4V(const Vec4V a)
-{
- /*Vec4V a;
- QT3DS_ALIGN(16, QT3DSF32 f[4]);
- F32Array_Aligned_From_Vec4V(a, f);
- return NVIsFinite(f[0])
- && NVIsFinite(f[1])
- && NVIsFinite(f[2])
- && NVIsFinite(f[3]);*/
-
- const QT3DSU32 badNumber =
- (_QT3DS_FPCLASS_SNAN | _QT3DS_FPCLASS_QNAN | _QT3DS_FPCLASS_NINF | _QT3DS_FPCLASS_PINF);
- const Vec4V vBadNum = Vec4V_From_F32((QT3DSF32 &)badNumber);
- const BoolV vMask = BAnd(vBadNum, a);
-
- return FiniteTestEq(vMask, BFFFF()) == 1;
-}
-
-QT3DS_FORCE_INLINE bool hasZeroElementinFloatV(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)), FloatV_From_F32(0.0f))
- ? true
- : false);
-}
-
-QT3DS_FORCE_INLINE bool hasZeroElementInVec3V(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)), FloatV_From_F32(0.0f))
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)), FloatV_From_F32(0.0f))
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)), FloatV_From_F32(0.0f)));
-}
-
-QT3DS_FORCE_INLINE bool hasZeroElementInVec4V(const Vec4V a)
-{
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)), FloatV_From_F32(0.0f))
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)), FloatV_From_F32(0.0f))
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)), FloatV_From_F32(0.0f))
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3)), FloatV_From_F32(0.0f)));
-}
-
-/////////////////////////////////////////////////////////////////////
-////VECTORISED FUNCTION IMPLEMENTATIONS
-/////////////////////////////////////////////////////////////////////
-
-QT3DS_FORCE_INLINE FloatV FloatV_From_F32(const QT3DSF32 f)
-{
- return (_mm_load1_ps(&f));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_F32(const QT3DSF32 f)
-{
- return _mm_set_ps(0.0f, f, f, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_F32(const QT3DSF32 f)
-{
- return (_mm_load1_ps(&f));
-}
-
-QT3DS_FORCE_INLINE BoolV BoolV_From_Bool32(const bool f)
-{
- const QT3DSU32 i = -(QT3DSI32)f;
- return _mm_load1_ps((float *)&i);
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_NVVec3_Aligned(const QT3DSVec3 &f)
-{
- VECMATHAOS_ASSERT(0 == ((size_t)&f & 0x0f));
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_NVVec3(const QT3DSVec3 &f)
-{
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_NVVec3_WUndefined(const QT3DSVec3 &f)
-{
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_Vec4V(Vec4V v)
-{
- return V4SetW(v, V4Zero());
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_Vec3V(Vec3V f)
-{
- return f; // ok if it is implemented as the same type.
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_NVVec3_WUndefined(const QT3DSVec3 &f)
-{
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Mat33V Mat33V_From_NVMat33(const QT3DSMat33 &m)
-{
- return Mat33V(Vec3V_From_NVVec3(m.column0), Vec3V_From_NVVec3(m.column1),
- Vec3V_From_NVVec3(m.column2));
-}
-
-QT3DS_FORCE_INLINE void NVMat33_From_Mat33V(const Mat33V &m, QT3DSMat33 &out)
-{
- QT3DS_ASSERT((size_t(&out) & 15) == 0);
- NVVec3_From_Vec3V(m.col0, out.column0);
- NVVec3_From_Vec3V(m.col1, out.column1);
- NVVec3_From_Vec3V(m.col2, out.column2);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_F32Array_Aligned(const QT3DSF32 *const f)
-{
- VECMATHAOS_ASSERT(0 == ((QT3DSU64)f & 0x0f));
- return (_mm_load_ps(f));
-}
-
-QT3DS_FORCE_INLINE void F32Array_Aligned_From_Vec4V(Vec4V a, QT3DSF32 *f)
-{
- VECMATHAOS_ASSERT(0 == ((QT3DSU64)f & 0x0f));
- _mm_store_ps(f, a);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_F32Array(const QT3DSF32 *const f)
-{
- return (_mm_loadu_ps(f));
-}
-
-QT3DS_FORCE_INLINE BoolV BoolV_From_Bool32Array(const bool *const f)
-{
- const QT3DS_ALIGN(16, QT3DSU32) b[4] = { -(QT3DSI32)f[0], -(QT3DSI32)f[1], -(QT3DSI32)f[2], -(QT3DSI32)f[3] };
- return _mm_load1_ps((float *)&b);
-}
-
-QT3DS_FORCE_INLINE QT3DSF32 NVF32_From_FloatV(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- QT3DSF32 f;
- _mm_store_ss(&f, a);
- return f;
-}
-
-QT3DS_FORCE_INLINE void NVF32_From_FloatV(const FloatV a, QT3DSF32 *QT3DS_RESTRICT f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- _mm_store_ss(f, a);
-}
-
-QT3DS_FORCE_INLINE void NVVec3Aligned_From_Vec3V(const Vec3V a, QT3DSVec3 &f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(0 == ((int)&a & 0x0F));
- VECMATHAOS_ASSERT(0 == ((int)&f & 0x0F));
- QT3DS_ALIGN(16, QT3DSF32) f2[4];
- _mm_store_ps(f2, a);
- f = QT3DSVec3(f2[0], f2[1], f2[2]);
-}
-
-QT3DS_FORCE_INLINE void NVVec3_From_Vec3V(const Vec3V a, QT3DSVec3 &f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(0 == ((int)&a & 0x0F));
- QT3DS_ALIGN(16, QT3DSF32) f2[4];
- _mm_store_ps(f2, a);
- f = QT3DSVec3(f2[0], f2[1], f2[2]);
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualFloatV(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return (_mm_comieq_ss(a, b) != 0);
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualVec3V(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return V3AllEq(a, b) != 0;
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualVec4V(const Vec4V a, const Vec4V b)
-{
- return V4AllEq(a, b) != 0;
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualBoolV(const BoolV a, const BoolV b)
-{
- return BAllTrue4_R(VecI32V_IsEq(a, b)) != 0;
-}
-
-#define VECMATH_AOS_EPSILON (1e-3f)
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsNearEqualFloatV(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- const FloatV c = FSub(a, b);
- const FloatV minError = FloatV_From_F32(-VECMATH_AOS_EPSILON);
- const FloatV maxError = FloatV_From_F32(VECMATH_AOS_EPSILON);
- return (_mm_comigt_ss(c, minError) && _mm_comilt_ss(c, maxError));
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsNearEqualVec3V(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- const Vec3V c = V3Sub(a, b);
- const Vec3V minError = Vec3V_From_F32(-VECMATH_AOS_EPSILON);
- const Vec3V maxError = Vec3V_From_F32(VECMATH_AOS_EPSILON);
- return (_mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), maxError));
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsNearEqualVec4V(const Vec4V a, const Vec4V b)
-{
- const Vec4V c = V4Sub(a, b);
- const Vec4V minError = Vec4V_From_F32(-VECMATH_AOS_EPSILON);
- const Vec4V maxError = Vec4V_From_F32(VECMATH_AOS_EPSILON);
- return (_mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3)), maxError));
-}
-
-//////////////////////////////////
-// FLOATV
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE FloatV FZero()
-{
- return FloatV_From_F32(0.0f);
-}
-
-QT3DS_FORCE_INLINE FloatV FOne()
-{
- return FloatV_From_F32(1.0f);
-}
-
-QT3DS_FORCE_INLINE FloatV FHalf()
-{
- return FloatV_From_F32(0.5f);
-}
-
-QT3DS_FORCE_INLINE FloatV FEps()
-{
- return FloatV_From_F32(QT3DS_ENV_REAL);
-}
-
-QT3DS_FORCE_INLINE FloatV FEps6()
-{
- return FloatV_From_F32(1e-6f);
-}
-
-QT3DS_FORCE_INLINE FloatV FMax()
-{
- return FloatV_From_F32(QT3DS_MAX_REAL);
-}
-
-QT3DS_FORCE_INLINE FloatV FNegMax()
-{
- return FloatV_From_F32(-QT3DS_MAX_REAL);
-}
-
-QT3DS_FORCE_INLINE FloatV IZero()
-{
- const QT3DSU32 zero = 0;
- return _mm_load1_ps((QT3DSF32 *)&zero);
-}
-
-QT3DS_FORCE_INLINE FloatV IOne()
-{
- const QT3DSU32 one = 1;
- return _mm_load1_ps((QT3DSF32 *)&one);
-}
-
-QT3DS_FORCE_INLINE FloatV ITwo()
-{
- const QT3DSU32 two = 2;
- return _mm_load1_ps((QT3DSF32 *)&two);
-}
-
-QT3DS_FORCE_INLINE FloatV IThree()
-{
- const QT3DSU32 three = 3;
- return _mm_load1_ps((QT3DSF32 *)&three);
-}
-
-QT3DS_FORCE_INLINE FloatV IFour()
-{
- QT3DSU32 four = 4;
- return _mm_load1_ps((QT3DSF32 *)&four);
-}
-
-QT3DS_FORCE_INLINE FloatV FNeg(const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return _mm_sub_ps(_mm_setzero_ps(), f);
-}
-
-QT3DS_FORCE_INLINE FloatV FAdd(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_add_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FSub(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_sub_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FMul(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FDiv(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FDivFast(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE FloatV FRecip(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return _mm_rcp_ps(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FRecipFast(const FloatV a)
-{
- return FRecip(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FRsqrt(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return _mm_rsqrt_ps(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FSqrt(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return _mm_sqrt_ps(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FRsqrtFast(const FloatV a)
-{
- return FRsqrt(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FScaleAdd(const FloatV a, const FloatV b, const FloatV c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidFloatV(c));
- return FAdd(FMul(a, b), c);
-}
-
-QT3DS_FORCE_INLINE FloatV FNegScaleSub(const FloatV a, const FloatV b, const FloatV c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidFloatV(c));
- return FSub(c, FMul(a, b));
-}
-
-QT3DS_FORCE_INLINE FloatV FAbs(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- QT3DS_ALIGN(16, const QT3DSU32) absMask[4] = { 0x7fFFffFF, 0x7fFFffFF, 0x7fFFffFF, 0x7fFFffFF };
- return _mm_and_ps(a, _mm_load_ps((QT3DSF32 *)absMask));
-}
-
-QT3DS_FORCE_INLINE FloatV FSel(const BoolV c, const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(_VecMathTests::allElementsEqualBoolV(c, BTTTT())
- || _VecMathTests::allElementsEqualBoolV(c, BFFFF()));
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_or_ps(_mm_andnot_ps(c, b), _mm_and_ps(c, a));
-}
-
-QT3DS_FORCE_INLINE BoolV FIsGrtr(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_cmpgt_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV FIsGrtrOrEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_cmpge_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV FIsEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FMax(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_max_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FMin(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_min_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FClamp(const FloatV a, const FloatV minV, const FloatV maxV)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(minV));
- VECMATHAOS_ASSERT(isValidFloatV(maxV));
- return FMax(FMin(a, maxV), minV);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FAllGrtr(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return (_mm_comigt_ss(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FAllGrtrOrEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
-
- return (_mm_comige_ss(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FAllEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
-
- return (_mm_comieq_ss(a, b));
-}
-
-QT3DS_FORCE_INLINE FloatV FRound(const FloatV a)
-{
- // return _mm_round_ps(a, 0x0);
- const Vec3V half = Vec3V_From_F32(0.5f);
- const Vec3V aPlusHalf = V3Add(a, half);
- __m128i tmp = _mm_cvttps_epi32(aPlusHalf);
- return _mm_cvtepi32_ps(tmp);
-}
-
-QT3DS_FORCE_INLINE FloatV FSin(const FloatV a)
-{
- // Vec4V V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- // Vec4V S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- FloatV Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const FloatV twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const FloatV tmp = FMul(a, twoPi);
- const FloatV b = FRound(tmp);
- const FloatV V1 = FNegMulSub(twoPi, b, a);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- const FloatV V2 = FMul(V1, V1);
- const FloatV V3 = FMul(V2, V1);
- const FloatV V5 = FMul(V3, V2);
- const FloatV V7 = FMul(V5, V2);
- const FloatV V9 = FMul(V7, V2);
- const FloatV V11 = FMul(V9, V2);
- const FloatV V13 = FMul(V11, V2);
- const FloatV V15 = FMul(V13, V2);
- const FloatV V17 = FMul(V15, V2);
- const FloatV V19 = FMul(V17, V2);
- const FloatV V21 = FMul(V19, V2);
- const FloatV V23 = FMul(V21, V2);
-
- const Vec4V sinCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients0.f);
- const Vec4V sinCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients1.f);
- const Vec4V sinCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients2.f);
-
- const FloatV S1 = V4GetY(sinCoefficients0);
- const FloatV S2 = V4GetZ(sinCoefficients0);
- const FloatV S3 = V4GetW(sinCoefficients0);
- const FloatV S4 = V4GetX(sinCoefficients1);
- const FloatV S5 = V4GetY(sinCoefficients1);
- const FloatV S6 = V4GetZ(sinCoefficients1);
- const FloatV S7 = V4GetW(sinCoefficients1);
- const FloatV S8 = V4GetX(sinCoefficients2);
- const FloatV S9 = V4GetY(sinCoefficients2);
- const FloatV S10 = V4GetZ(sinCoefficients2);
- const FloatV S11 = V4GetW(sinCoefficients2);
-
- Result = FMulAdd(S1, V3, V1);
- Result = FMulAdd(S2, V5, Result);
- Result = FMulAdd(S3, V7, Result);
- Result = FMulAdd(S4, V9, Result);
- Result = FMulAdd(S5, V11, Result);
- Result = FMulAdd(S6, V13, Result);
- Result = FMulAdd(S7, V15, Result);
- Result = FMulAdd(S8, V17, Result);
- Result = FMulAdd(S9, V19, Result);
- Result = FMulAdd(S10, V21, Result);
- Result = FMulAdd(S11, V23, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE FloatV FCos(const FloatV a)
-{
- // XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- // XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- FloatV Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const FloatV twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const FloatV tmp = FMul(a, twoPi);
- const FloatV b = FRound(tmp);
- const FloatV V1 = FNegMulSub(twoPi, b, a);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- const FloatV V2 = FMul(V1, V1);
- const FloatV V4 = FMul(V2, V2);
- const FloatV V6 = FMul(V4, V2);
- const FloatV V8 = FMul(V4, V4);
- const FloatV V10 = FMul(V6, V4);
- const FloatV V12 = FMul(V6, V6);
- const FloatV V14 = FMul(V8, V6);
- const FloatV V16 = FMul(V8, V8);
- const FloatV V18 = FMul(V10, V8);
- const FloatV V20 = FMul(V10, V10);
- const FloatV V22 = FMul(V12, V10);
-
- const Vec4V cosCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients0.f);
- const Vec4V cosCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients1.f);
- const Vec4V cosCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients2.f);
-
- const FloatV C1 = V4GetY(cosCoefficients0);
- const FloatV C2 = V4GetZ(cosCoefficients0);
- const FloatV C3 = V4GetW(cosCoefficients0);
- const FloatV C4 = V4GetX(cosCoefficients1);
- const FloatV C5 = V4GetY(cosCoefficients1);
- const FloatV C6 = V4GetZ(cosCoefficients1);
- const FloatV C7 = V4GetW(cosCoefficients1);
- const FloatV C8 = V4GetX(cosCoefficients2);
- const FloatV C9 = V4GetY(cosCoefficients2);
- const FloatV C10 = V4GetZ(cosCoefficients2);
- const FloatV C11 = V4GetW(cosCoefficients2);
-
- Result = FMulAdd(C1, V2, V4One());
- Result = FMulAdd(C2, V4, Result);
- Result = FMulAdd(C3, V6, Result);
- Result = FMulAdd(C4, V8, Result);
- Result = FMulAdd(C5, V10, Result);
- Result = FMulAdd(C6, V12, Result);
- Result = FMulAdd(C7, V14, Result);
- Result = FMulAdd(C8, V16, Result);
- Result = FMulAdd(C9, V18, Result);
- Result = FMulAdd(C10, V20, Result);
- Result = FMulAdd(C11, V22, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FOutOfBounds(const FloatV a, const FloatV min, const FloatV max)
-{
- const BoolV ffff = BFFFF();
- const BoolV c = BOr(FIsGrtr(a, max), FIsGrtr(min, a));
- return !BAllEq(c, ffff);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FInBounds(const FloatV a, const FloatV min, const FloatV max)
-{
- const BoolV tttt = BTTTT();
- const BoolV c = BAnd(FIsGrtrOrEq(a, min), FIsGrtrOrEq(max, a));
- return BAllEq(c, tttt);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FOutOfBounds(const FloatV a, const FloatV bounds)
-{
- return FOutOfBounds(a, FNeg(bounds), bounds);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FInBounds(const FloatV a, const FloatV bounds)
-{
- return FInBounds(a, FNeg(bounds), bounds);
-}
-
-//////////////////////////////////
-// VEC3V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec3V V3Splat(const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- const __m128 zero = FloatV_From_F32(0.0f);
- const __m128 fff0 = _mm_move_ss(f, zero);
- return _mm_shuffle_ps(fff0, fff0, _MM_SHUFFLE(0, 1, 2, 3));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Merge(const FloatVArg x, const FloatVArg y, const FloatVArg z)
-{
- VECMATHAOS_ASSERT(isValidFloatV(x));
- VECMATHAOS_ASSERT(isValidFloatV(y));
- VECMATHAOS_ASSERT(isValidFloatV(z));
- // static on zero causes compiler crash on x64 debug_opt
- const __m128 zero = FloatV_From_F32(0.0f);
- const __m128 xy = _mm_move_ss(x, y);
- const __m128 z0 = _mm_move_ss(zero, z);
-
- return _mm_shuffle_ps(xy, z0, _MM_SHUFFLE(1, 0, 0, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3UnitX()
-{
- const QT3DS_ALIGN(16, QT3DSF32) x[4] = { 1.0f, 0.0f, 0.0f, 0.0f };
- const __m128 x128 = _mm_load_ps(x);
- return x128;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3UnitY()
-{
- const QT3DS_ALIGN(16, QT3DSF32) y[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
- const __m128 y128 = _mm_load_ps(y);
- return y128;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3UnitZ()
-{
- const QT3DS_ALIGN(16, QT3DSF32) z[4] = { 0.0f, 0.0f, 1.0f, 0.0f };
- const __m128 z128 = _mm_load_ps(z);
- return z128;
-}
-
-QT3DS_FORCE_INLINE FloatV V3GetX(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE FloatV V3GetY(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(1, 1, 1, 1));
-}
-
-QT3DS_FORCE_INLINE FloatV V3GetZ(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(2, 2, 2, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3SetX(const Vec3V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V3Sel(BFTTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3SetY(const Vec3V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V3Sel(BTFTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3SetZ(const Vec3V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V3Sel(BTTFT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ColX(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- Vec3V r = _mm_shuffle_ps(a, c, _MM_SHUFFLE(3, 0, 3, 0));
- return V3SetY(r, V3GetX(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ColY(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- Vec3V r = _mm_shuffle_ps(a, c, _MM_SHUFFLE(3, 1, 3, 1));
- return V3SetY(r, V3GetY(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ColZ(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- Vec3V r = _mm_shuffle_ps(a, c, _MM_SHUFFLE(3, 2, 3, 2));
- return V3SetY(r, V3GetZ(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Zero()
-{
- return Vec3V_From_F32(0.0f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Eps()
-{
- return Vec3V_From_F32(QT3DS_ENV_REAL);
-}
-QT3DS_FORCE_INLINE Vec3V V3One()
-{
- return Vec3V_From_F32(1.0f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Neg(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_sub_ps(_mm_setzero_ps(), f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Add(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_add_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Sub(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_sub_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Scale(const Vec3V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Mul(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ScaleInv(const Vec3V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Div(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- const __m128 one = Vec3V_From_F32(1.0f);
- const __m128 tttf = BTTTF();
- const __m128 b1 = V3Sel(tttf, b, one);
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ScaleInvFast(const Vec3V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3DivFast(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- const __m128 one = Vec3V_From_F32(1.0f);
- const __m128 tttf = BTTTF();
- const __m128 b1 = V3Sel(tttf, b, one);
- return _mm_mul_ps(a, _mm_rcp_ps(b1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Recip(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = Vec3V_From_F32(0.0f);
- const __m128 tttf = BTTTF();
- const __m128 recipA = _mm_rcp_ps(a);
- return V3Sel(tttf, recipA, zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3RecipFast(const Vec3V a)
-{
- return V3Recip(a);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Rsqrt(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = Vec3V_From_F32(0.0f);
- const __m128 tttf = BTTTF();
- const __m128 recipA = _mm_rsqrt_ps(a);
- return V3Sel(tttf, recipA, zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3RsqrtFast(const Vec3V a)
-{
- return V3Rsqrt(a);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ScaleAdd(const Vec3V a, const FloatV b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Add(V3Scale(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NegScaleSub(const Vec3V a, const FloatV b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Sub(c, V3Scale(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3MulAdd(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Add(V3Mul(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NegMulSub(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Sub(c, V3Scale(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Abs(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Max(
- a, V3Neg(a)); // sw/physx/shared/reviewed/3/feature/sdk/include/windows/Qt3DSWindowsInlineAoS.h
-}
-
-QT3DS_FORCE_INLINE FloatV V3Dot(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- //__m128 dot1 = _mm_mul_ps(a, b);
- ////w,z,y,x
- //__m128 shuf1 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(2,1,0,3)); //z,y,x,w
- //__m128 shuf2 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(1,0,3,2)); //y,x,w,z
- //__m128 shuf3 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(0,3,2,1)); //x,w,z,y
- // return _mm_add_ps(_mm_add_ps(shuf2, shuf3), _mm_add_ps(dot1,shuf1));
-
- __m128 dot1 = _mm_mul_ps(a, b);
- __m128 shuf1 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(0, 0, 0, 0)); // z,y,x,w
- __m128 shuf2 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(1, 1, 1, 1)); // y,x,w,z
- __m128 shuf3 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(2, 2, 2, 2)); // x,w,z,y
- return _mm_add_ps(_mm_add_ps(shuf2, shuf3), shuf1);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Cross(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- __m128 l1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 2, 1)); // y,z,x,w
- __m128 l2 = _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 1, 0, 2)); // z,x,y,w
- __m128 r1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 1, 0, 2)); // z,x,y,w
- __m128 r2 = _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 0, 2, 1)); // y,z,x,w
- return _mm_sub_ps(_mm_mul_ps(l1, l2), _mm_mul_ps(r1, r2));
-}
-
-QT3DS_FORCE_INLINE FloatV V3Length(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_sqrt_ps(V3Dot(a, a));
-}
-
-QT3DS_FORCE_INLINE FloatV V3LengthSq(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Dot(a, a);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Normalize(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Scale(a, _mm_rsqrt_ps(V3Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NormalizeFast(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Scale(a, _mm_rsqrt_ps(V3Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NormalizeSafe(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = FloatV_From_F32(0.0f);
- const __m128 length = V3Length(a);
- const __m128 isGreaterThanZero = FIsGrtr(length, zero);
- return V3Sel(isGreaterThanZero, V3ScaleInv(a, length), zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Sel(const BoolV c, const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_or_ps(_mm_andnot_ps(c, b), _mm_and_ps(c, a));
-}
-
-QT3DS_FORCE_INLINE BoolV V3IsGrtr(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_cmpgt_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V3IsGrtrOrEq(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_cmpge_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V3IsEq(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Max(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_max_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Min(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_min_ps(a, b);
-}
-
-// Extract the maximum value from a
-QT3DS_FORCE_INLINE FloatV V3ExtractMax(const Vec3V a)
-{
- const __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0));
- const __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1));
- const __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2));
-
- return _mm_max_ps(_mm_max_ps(shuf1, shuf2), shuf3);
-}
-
-// Extract the maximum value from a
-QT3DS_FORCE_INLINE FloatV V3ExtractMin(const Vec3V a)
-{
- const __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0));
- const __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1));
- const __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2));
-
- return _mm_min_ps(_mm_min_ps(shuf1, shuf2), shuf3);
-}
-
-// return (a >= 0.0f) ? 1.0f : -1.0f;
-QT3DS_FORCE_INLINE Vec3V V3Sign(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 one = V3One();
- const __m128 none = V3Neg(one);
- return V3Sel(V3IsGrtrOrEq(a, zero), one, none);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Clamp(const Vec3V a, const Vec3V minV, const Vec3V maxV)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(minV));
- VECMATHAOS_ASSERT(isValidVec3V(maxV));
- return V3Max(V3Min(a, maxV), minV);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3AllGrtr(const Vec3V a, const Vec3V b)
-{
- return BAllTrue3_R(V4IsGrtr(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3AllGrtrOrEq(const Vec3V a, const Vec3V b)
-{
- return BAllTrue3_R(V4IsGrtrOrEq(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3AllEq(const Vec3V a, const Vec3V b)
-{
- return BAllTrue3_R(V4IsEq(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Round(const Vec3V a)
-{
- // return _mm_round_ps(a, 0x0);
- const Vec3V half = Vec3V_From_F32(0.5f);
- const Vec3V aPlusHalf = V3Add(a, half);
- __m128i tmp = _mm_cvttps_epi32(aPlusHalf);
- return _mm_cvtepi32_ps(tmp);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Sin(const Vec3V a)
-{
- // Vec4V V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- // Vec4V S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- Vec3V Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const Vec3V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec3V tmp = V3Mul(a, twoPi);
- const Vec3V b = V3Round(tmp);
- const Vec3V V1 = V3NegMulSub(twoPi, b, a);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- const Vec3V V2 = V3Mul(V1, V1);
- const Vec3V V3 = V3Mul(V2, V1);
- const Vec3V V5 = V3Mul(V3, V2);
- const Vec3V V7 = V3Mul(V5, V2);
- const Vec3V V9 = V3Mul(V7, V2);
- const Vec3V V11 = V3Mul(V9, V2);
- const Vec3V V13 = V3Mul(V11, V2);
- const Vec3V V15 = V3Mul(V13, V2);
- const Vec3V V17 = V3Mul(V15, V2);
- const Vec3V V19 = V3Mul(V17, V2);
- const Vec3V V21 = V3Mul(V19, V2);
- const Vec3V V23 = V3Mul(V21, V2);
-
- const Vec4V sinCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients0.f);
- const Vec4V sinCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients1.f);
- const Vec4V sinCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients2.f);
-
- const FloatV S1 = V4GetY(sinCoefficients0);
- const FloatV S2 = V4GetZ(sinCoefficients0);
- const FloatV S3 = V4GetW(sinCoefficients0);
- const FloatV S4 = V4GetX(sinCoefficients1);
- const FloatV S5 = V4GetY(sinCoefficients1);
- const FloatV S6 = V4GetZ(sinCoefficients1);
- const FloatV S7 = V4GetW(sinCoefficients1);
- const FloatV S8 = V4GetX(sinCoefficients2);
- const FloatV S9 = V4GetY(sinCoefficients2);
- const FloatV S10 = V4GetZ(sinCoefficients2);
- const FloatV S11 = V4GetW(sinCoefficients2);
-
- Result = V3MulAdd(S1, V3, V1);
- Result = V3MulAdd(S2, V5, Result);
- Result = V3MulAdd(S3, V7, Result);
- Result = V3MulAdd(S4, V9, Result);
- Result = V3MulAdd(S5, V11, Result);
- Result = V3MulAdd(S6, V13, Result);
- Result = V3MulAdd(S7, V15, Result);
- Result = V3MulAdd(S8, V17, Result);
- Result = V3MulAdd(S9, V19, Result);
- Result = V3MulAdd(S10, V21, Result);
- Result = V3MulAdd(S11, V23, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Cos(const Vec3V a)
-{
- // XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- // XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- Vec3V Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const Vec3V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec3V tmp = V3Mul(a, twoPi);
- const Vec3V b = V3Round(tmp);
- const Vec3V V1 = V3NegMulSub(twoPi, b, a);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- const Vec3V V2 = V3Mul(V1, V1);
- const Vec3V V4 = V3Mul(V2, V2);
- const Vec3V V6 = V3Mul(V4, V2);
- const Vec3V V8 = V3Mul(V4, V4);
- const Vec3V V10 = V3Mul(V6, V4);
- const Vec3V V12 = V3Mul(V6, V6);
- const Vec3V V14 = V3Mul(V8, V6);
- const Vec3V V16 = V3Mul(V8, V8);
- const Vec3V V18 = V3Mul(V10, V8);
- const Vec3V V20 = V3Mul(V10, V10);
- const Vec3V V22 = V3Mul(V12, V10);
-
- const Vec4V cosCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients0.f);
- const Vec4V cosCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients1.f);
- const Vec4V cosCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients2.f);
-
- const FloatV C1 = V4GetY(cosCoefficients0);
- const FloatV C2 = V4GetZ(cosCoefficients0);
- const FloatV C3 = V4GetW(cosCoefficients0);
- const FloatV C4 = V4GetX(cosCoefficients1);
- const FloatV C5 = V4GetY(cosCoefficients1);
- const FloatV C6 = V4GetZ(cosCoefficients1);
- const FloatV C7 = V4GetW(cosCoefficients1);
- const FloatV C8 = V4GetX(cosCoefficients2);
- const FloatV C9 = V4GetY(cosCoefficients2);
- const FloatV C10 = V4GetZ(cosCoefficients2);
- const FloatV C11 = V4GetW(cosCoefficients2);
-
- Result = V3MulAdd(C1, V2, V4One());
- Result = V3MulAdd(C2, V4, Result);
- Result = V3MulAdd(C3, V6, Result);
- Result = V3MulAdd(C4, V8, Result);
- Result = V3MulAdd(C5, V10, Result);
- Result = V3MulAdd(C6, V12, Result);
- Result = V3MulAdd(C7, V14, Result);
- Result = V3MulAdd(C8, V16, Result);
- Result = V3MulAdd(C9, V18, Result);
- Result = V3MulAdd(C10, V20, Result);
- Result = V3MulAdd(C11, V22, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermYZZ(const Vec3V a)
-{
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 2, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermXYX(const Vec3V a)
-{
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 1, 0));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermYZX(const Vec3V a)
-{
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 2, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermZXY(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 1, 0, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermZZY(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 1, 2, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermYXX(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 0, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Perm_Zero_1Z_0Y(const Vec3V v0, const Vec3V v1)
-{
- return _mm_shuffle_ps(v1, v0, _MM_SHUFFLE(3, 1, 2, 3));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Perm_0Z_Zero_1X(const Vec3V v0, const Vec3V v1)
-{
- return _mm_shuffle_ps(v0, v1, _MM_SHUFFLE(3, 0, 3, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Perm_1Y_0X_Zero(const Vec3V v0, const Vec3V v1)
-{
- // There must be a better way to do this.
- Vec3V v2 = V3Zero();
- FloatV y1 = V3GetY(v1);
- FloatV x0 = V3GetX(v0);
- v2 = V3SetX(v2, y1);
- return V3SetY(v2, x0);
-}
-
-QT3DS_FORCE_INLINE FloatV V3SumElems(const Vec3V a)
-{
- __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)); // z,y,x,w
- __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)); // y,x,w,z
- __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)); // x,w,z,y
- return _mm_add_ps(_mm_add_ps(shuf1, shuf2), shuf3);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3OutOfBounds(const Vec3V a, const Vec3V min, const Vec3V max)
-{
- const BoolV ffff = BFFFF();
- const BoolV c = BOr(V3IsGrtr(a, max), V3IsGrtr(min, a));
- return !BAllEq(c, ffff);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3InBounds(const Vec3V a, const Vec3V min, const Vec3V max)
-{
- const BoolV tttt = BTTTT();
- const BoolV c = BAnd(V3IsGrtrOrEq(a, min), V3IsGrtrOrEq(max, a));
- return BAllEq(c, tttt);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3OutOfBounds(const Vec3V a, const Vec3V bounds)
-{
- return V3OutOfBounds(a, V3Neg(bounds), bounds);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3InBounds(const Vec3V a, const Vec3V bounds)
-{
- return V3InBounds(a, V3Neg(bounds), bounds);
-}
-
-//////////////////////////////////
-// VEC4V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec4V V4Splat(const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Merge(const FloatV *const floatVArray)
-{
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[0]));
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[1]));
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[2]));
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[3]));
- __m128 xw = _mm_move_ss(floatVArray[1], floatVArray[0]); // y, y, y, x
- __m128 yz = _mm_move_ss(floatVArray[2], floatVArray[3]); // z, z, z, w
- return (_mm_shuffle_ps(xw, yz, _MM_SHUFFLE(0, 2, 1, 0)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Merge(const FloatVArg x, const FloatVArg y, const FloatVArg z,
- const FloatVArg w)
-{
- VECMATHAOS_ASSERT(isValidFloatV(x));
- VECMATHAOS_ASSERT(isValidFloatV(y));
- VECMATHAOS_ASSERT(isValidFloatV(z));
- VECMATHAOS_ASSERT(isValidFloatV(w));
- __m128 xw = _mm_move_ss(y, x); // y, y, y, x
- __m128 yz = _mm_move_ss(z, w); // z, z, z, w
- return (_mm_shuffle_ps(xw, yz, _MM_SHUFFLE(0, 2, 1, 0)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitW()
-{
- const QT3DS_ALIGN(16, QT3DSF32) w[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
- const __m128 w128 = _mm_load_ps(w);
- return w128;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitX()
-{
- const QT3DS_ALIGN(16, QT3DSF32) x[4] = { 1.0f, 0.0f, 0.0f, 0.0f };
- const __m128 x128 = _mm_load_ps(x);
- return x128;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitY()
-{
- const QT3DS_ALIGN(16, QT3DSF32) y[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
- const __m128 y128 = _mm_load_ps(y);
- return y128;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitZ()
-{
- const QT3DS_ALIGN(16, QT3DSF32) z[4] = { 0.0f, 0.0f, 1.0f, 0.0f };
- const __m128 z128 = _mm_load_ps(z);
- return z128;
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetW(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(3, 3, 3, 3));
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetX(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetY(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(1, 1, 1, 1));
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetZ(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(2, 2, 2, 2));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetW(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BTTTF(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetX(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BFTTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetY(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BTFTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetZ(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BTTFT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Zero()
-{
- return Vec4V_From_F32(0.0f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4One()
-{
- return Vec4V_From_F32(1.0f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V4Eps()
-{
- return Vec3V_From_F32(QT3DS_ENV_REAL);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Neg(const Vec4V f)
-{
- return _mm_sub_ps(_mm_setzero_ps(), f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Add(const Vec4V a, const Vec4V b)
-{
- return _mm_add_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Sub(const Vec4V a, const Vec4V b)
-{
- return _mm_sub_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Scale(const Vec4V a, const FloatV b)
-{
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Mul(const Vec4V a, const Vec4V b)
-{
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4ScaleInv(const Vec4V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Div(const Vec4V a, const Vec4V b)
-{
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4ScaleInvFast(const Vec4V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4DivFast(const Vec4V a, const Vec4V b)
-{
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Recip(const Vec4V a)
-{
- return _mm_rcp_ps(a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4RecipFast(const Vec4V a)
-{
- return V4Recip(a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Rsqrt(const Vec4V a)
-{
- return _mm_rsqrt_ps(a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4RsqrtFast(const Vec4V a)
-{
- return V4Rsqrt(a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4ScaleAdd(const Vec4V a, const FloatV b, const Vec4V c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return V4Add(V4Scale(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NegScaleSub(const Vec4V a, const FloatV b, const Vec4V c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return V4Sub(c, V4Scale(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4MulAdd(const Vec4V a, const Vec4V b, const Vec4V c)
-{
- return V4Add(V4Scale(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NegMulSub(const Vec4V a, const Vec4V b, const Vec4V c)
-{
- return V4Sub(c, V4Scale(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Abs(const Vec4V a)
-{
- return V4Max(a, V3Neg(a));
-}
-
-QT3DS_FORCE_INLINE FloatV V4Dot(const Vec4V a, const Vec4V b)
-{
- __m128 dot1 = _mm_mul_ps(a, b); // x,y,z,w
- __m128 shuf1 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(2, 1, 0, 3)); // w,x,y,z
- __m128 shuf2 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(1, 0, 3, 2)); // z,w,x,y
- __m128 shuf3 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(0, 3, 2, 1)); // y,z,w,x
- return _mm_add_ps(_mm_add_ps(shuf2, shuf3), _mm_add_ps(dot1, shuf1));
-}
-
-QT3DS_FORCE_INLINE FloatV V4Length(const Vec4V a)
-{
- return _mm_sqrt_ps(V4Dot(a, a));
-}
-
-QT3DS_FORCE_INLINE FloatV V4LengthSq(const Vec4V a)
-{
- return V4Dot(a, a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Normalize(const Vec4V a)
-{
- return V4ScaleInv(a, _mm_sqrt_ps(V4Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NormalizeFast(const Vec4V a)
-{
- return V4ScaleInvFast(a, _mm_sqrt_ps(V4Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NormalizeSafe(const Vec4V a)
-{
- const __m128 zero = FloatV_From_F32(0.0f);
- const __m128 length = V4Length(a);
- const __m128 isGreaterThanZero = FIsGrtr(length, zero);
- return V4Sel(isGreaterThanZero, V4ScaleInv(a, length), zero);
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsEqU32(const VecU32V a, const VecU32V b)
-{
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Sel(const BoolV c, const Vec4V a, const Vec4V b)
-{
- return _mm_or_ps(_mm_andnot_ps(c, b), _mm_and_ps(c, a));
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsGrtr(const Vec4V a, const Vec4V b)
-{
- return _mm_cmpgt_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsGrtrOrEq(const Vec4V a, const Vec4V b)
-{
- return _mm_cmpge_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsEq(const Vec4V a, const Vec4V b)
-{
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V4Max(const Vec4V a, const Vec4V b)
-{
- return _mm_max_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Min(const Vec4V a, const Vec4V b)
-{
- return _mm_min_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV V4ExtractMax(const Vec4V a)
-{
- __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 1, 0, 3));
- __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 0, 3, 2));
- __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 3, 2, 1));
-
- return _mm_max_ps(_mm_max_ps(a, shuf1), _mm_max_ps(shuf2, shuf3));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Clamp(const Vec4V a, const Vec4V minV, const Vec4V maxV)
-{
- return V4Max(V4Min(a, maxV), minV);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V4AllGrtr(const Vec4V a, const Vec4V b)
-{
- return BAllTrue4_R(V4IsGrtr(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V4AllGrtrOrEq(const Vec4V a, const Vec4V b)
-{
- return BAllTrue4_R(V4IsGrtrOrEq(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V4AllEq(const Vec4V a, const Vec4V b)
-{
- return BAllTrue4_R(V4IsEq(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Round(const Vec4V a)
-{
- // return _mm_round_ps(a, 0x0);
- const Vec3V half = Vec3V_From_F32(0.5f);
- const Vec3V aPlusHalf = V3Add(a, half);
- __m128i tmp = _mm_cvttps_epi32(aPlusHalf);
- return _mm_cvtepi32_ps(tmp);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Sin(const Vec4V a)
-{
- // Vec4V V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- // Vec4V S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- Vec4V Result;
-
- const Vec4V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec4V tmp = V4Mul(a, twoPi);
- const Vec4V b = V4Round(tmp);
- const Vec4V V1 = V4NegMulSub(twoPi, b, a);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- const Vec4V V2 = V4Mul(V1, V1);
- const Vec4V V3 = V4Mul(V2, V1);
- const Vec4V V5 = V4Mul(V3, V2);
- const Vec4V V7 = V4Mul(V5, V2);
- const Vec4V V9 = V4Mul(V7, V2);
- const Vec4V V11 = V4Mul(V9, V2);
- const Vec4V V13 = V4Mul(V11, V2);
- const Vec4V V15 = V4Mul(V13, V2);
- const Vec4V V17 = V4Mul(V15, V2);
- const Vec4V V19 = V4Mul(V17, V2);
- const Vec4V V21 = V4Mul(V19, V2);
- const Vec4V V23 = V4Mul(V21, V2);
-
- const Vec4V sinCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients0.f);
- const Vec4V sinCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients1.f);
- const Vec4V sinCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients2.f);
-
- const FloatV S1 = V4GetY(sinCoefficients0);
- const FloatV S2 = V4GetZ(sinCoefficients0);
- const FloatV S3 = V4GetW(sinCoefficients0);
- const FloatV S4 = V4GetX(sinCoefficients1);
- const FloatV S5 = V4GetY(sinCoefficients1);
- const FloatV S6 = V4GetZ(sinCoefficients1);
- const FloatV S7 = V4GetW(sinCoefficients1);
- const FloatV S8 = V4GetX(sinCoefficients2);
- const FloatV S9 = V4GetY(sinCoefficients2);
- const FloatV S10 = V4GetZ(sinCoefficients2);
- const FloatV S11 = V4GetW(sinCoefficients2);
-
- Result = V4MulAdd(S1, V3, V1);
- Result = V4MulAdd(S2, V5, Result);
- Result = V4MulAdd(S3, V7, Result);
- Result = V4MulAdd(S4, V9, Result);
- Result = V4MulAdd(S5, V11, Result);
- Result = V4MulAdd(S6, V13, Result);
- Result = V4MulAdd(S7, V15, Result);
- Result = V4MulAdd(S8, V17, Result);
- Result = V4MulAdd(S9, V19, Result);
- Result = V4MulAdd(S10, V21, Result);
- Result = V4MulAdd(S11, V23, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Cos(const Vec4V a)
-{
- // XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- // XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- Vec4V Result;
-
- const Vec4V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec4V tmp = V4Mul(a, twoPi);
- const Vec4V b = V4Round(tmp);
- const Vec4V V1 = V4NegMulSub(twoPi, b, a);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- const Vec4V V2 = V4Mul(V1, V1);
- const Vec4V V4 = V4Mul(V2, V2);
- const Vec4V V6 = V4Mul(V4, V2);
- const Vec4V V8 = V4Mul(V4, V4);
- const Vec4V V10 = V4Mul(V6, V4);
- const Vec4V V12 = V4Mul(V6, V6);
- const Vec4V V14 = V4Mul(V8, V6);
- const Vec4V V16 = V4Mul(V8, V8);
- const Vec4V V18 = V4Mul(V10, V8);
- const Vec4V V20 = V4Mul(V10, V10);
- const Vec4V V22 = V4Mul(V12, V10);
-
- const Vec4V cosCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients0.f);
- const Vec4V cosCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients1.f);
- const Vec4V cosCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients2.f);
-
- const FloatV C1 = V4GetY(cosCoefficients0);
- const FloatV C2 = V4GetZ(cosCoefficients0);
- const FloatV C3 = V4GetW(cosCoefficients0);
- const FloatV C4 = V4GetX(cosCoefficients1);
- const FloatV C5 = V4GetY(cosCoefficients1);
- const FloatV C6 = V4GetZ(cosCoefficients1);
- const FloatV C7 = V4GetW(cosCoefficients1);
- const FloatV C8 = V4GetX(cosCoefficients2);
- const FloatV C9 = V4GetY(cosCoefficients2);
- const FloatV C10 = V4GetZ(cosCoefficients2);
- const FloatV C11 = V4GetW(cosCoefficients2);
-
- Result = V4MulAdd(C1, V2, V4One());
- Result = V4MulAdd(C2, V4, Result);
- Result = V4MulAdd(C3, V6, Result);
- Result = V4MulAdd(C4, V8, Result);
- Result = V4MulAdd(C5, V10, Result);
- Result = V4MulAdd(C6, V12, Result);
- Result = V4MulAdd(C7, V14, Result);
- Result = V4MulAdd(C8, V16, Result);
- Result = V4MulAdd(C9, V18, Result);
- Result = V4MulAdd(C10, V20, Result);
- Result = V4MulAdd(C11, V22, Result);
-
- return Result;
-}
-
-//////////////////////////////////
-// VEC4V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE BoolV BFFFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0, 0, 0 };
- const __m128 ffff = _mm_load_ps((float *)&f);
- return ffff;
-}
-
-QT3DS_FORCE_INLINE BoolV BFFFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0, 0, 0xFFFFFFFF };
- const __m128 ffft = _mm_load_ps((float *)&f);
- return ffft;
-}
-
-QT3DS_FORCE_INLINE BoolV BFFTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0, 0xFFFFFFFF, 0 };
- const __m128 fftf = _mm_load_ps((float *)&f);
- return fftf;
-}
-
-QT3DS_FORCE_INLINE BoolV BFFTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 fftt = _mm_load_ps((float *)&f);
- return fftt;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0xFFFFFFFF, 0, 0 };
- const __m128 ftff = _mm_load_ps((float *)&f);
- return ftff;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0xFFFFFFFF, 0, 0xFFFFFFFF };
- const __m128 ftft = _mm_load_ps((float *)&f);
- return ftft;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0xFFFFFFFF, 0xFFFFFFFF, 0 };
- const __m128 fttf = _mm_load_ps((float *)&f);
- return fttf;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 fttt = _mm_load_ps((float *)&f);
- return fttt;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0, 0, 0 };
- const __m128 tfff = _mm_load_ps((float *)&f);
- return tfff;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0, 0, 0xFFFFFFFF };
- const __m128 tfft = _mm_load_ps((float *)&f);
- return tfft;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0, 0xFFFFFFFF, 0 };
- const __m128 tftf = _mm_load_ps((float *)&f);
- return tftf;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 tftt = _mm_load_ps((float *)&f);
- return tftt;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0, 0 };
- const __m128 ttff = _mm_load_ps((float *)&f);
- return ttff;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0, 0xFFFFFFFF };
- const __m128 ttft = _mm_load_ps((float *)&f);
- return ttft;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0 };
- const __m128 tttf = _mm_load_ps((float *)&f);
- return tttf;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 tttt = _mm_load_ps((float *)&f);
- return tttt;
-}
-
-QT3DS_FORCE_INLINE BoolV BXMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0xFFFFFFFF, 0, 0, 0 };
- const __m128 tfff = _mm_load_ps((float *)&f);
- return tfff;
-}
-
-QT3DS_FORCE_INLINE BoolV BYMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0xFFFFFFFF, 0, 0 };
- const __m128 ftff = _mm_load_ps((float *)&f);
- return ftff;
-}
-
-QT3DS_FORCE_INLINE BoolV BZMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0, 0xFFFFFFFF, 0 };
- const __m128 fftf = _mm_load_ps((float *)&f);
- return fftf;
-}
-
-QT3DS_FORCE_INLINE BoolV BWMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32) f[4] = { 0, 0, 0, 0xFFFFFFFF };
- const __m128 ffft = _mm_load_ps((float *)&f);
- return ffft;
-}
-
-QT3DS_FORCE_INLINE BoolV BGetX(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE BoolV BGetY(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(1, 1, 1, 1));
-}
-
-QT3DS_FORCE_INLINE BoolV BGetZ(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(2, 2, 2, 2));
-}
-
-QT3DS_FORCE_INLINE BoolV BGetW(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(3, 3, 3, 3));
-}
-
-QT3DS_FORCE_INLINE BoolV BAnd(const BoolV a, const BoolV b)
-{
- return (_mm_and_ps(a, b));
-}
-
-QT3DS_FORCE_INLINE BoolV BNot(const BoolV a)
-{
- const BoolV bAllTrue(BTTTT());
- return _mm_xor_ps(a, bAllTrue);
-}
-
-QT3DS_FORCE_INLINE BoolV BAndNot(const BoolV a, const BoolV b)
-{
- return (_mm_andnot_ps(a, b));
-}
-
-QT3DS_FORCE_INLINE BoolV BOr(const BoolV a, const BoolV b)
-{
- return (_mm_or_ps(a, b));
-}
-
-QT3DS_FORCE_INLINE BoolV BAllTrue4(const BoolV a)
-{
- const BoolV bTmp = _mm_and_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 3, 2, 3)));
- return _mm_and_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE BoolV BAnyTrue4(const BoolV a)
-{
- const BoolV bTmp = _mm_or_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 3, 2, 3)));
- return _mm_or_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE BoolV BAllTrue3(const BoolV a)
-{
- const BoolV bTmp = _mm_and_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)));
- return _mm_and_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE BoolV BAnyTrue3(const BoolV a)
-{
- const BoolV bTmp = _mm_or_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)));
- return _mm_or_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAllEq(const BoolV a, const BoolV b)
-{
- const BoolV bTest = m128_I2F(_mm_cmpeq_epi32(m128_F2I(a), m128_F2I(b)));
- return BAllTrue4_R(bTest);
-}
-
-//////////////////////////////////
-// MAT33V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec3V M33MulV3(const Mat33V &a, const Vec3V b)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- const Vec3V v0 = V3Scale(a.col0, x);
- const Vec3V v1 = V3Scale(a.col1, y);
- const Vec3V v2 = V3Scale(a.col2, z);
- const Vec3V v0PlusV1 = V3Add(v0, v1);
- return V3Add(v0PlusV1, v2);
-}
-
-QT3DS_FORCE_INLINE Vec3V M33TrnspsMulV3(const Mat33V &a, const Vec3V b)
-{
- const FloatV x = V3Dot(a.col0, b);
- const FloatV y = V3Dot(a.col1, b);
- const FloatV z = V3Dot(a.col2, b);
- return V3Merge(x, y, z);
-}
-
-QT3DS_FORCE_INLINE Vec3V M33MulV3AddV3(const Mat33V &A, const Vec3V b, const Vec3V c)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- Vec3V result = V3MulAdd(A.col0, x, c);
- result = V3MulAdd(A.col1, y, result);
- return V3MulAdd(A.col2, z, result);
-}
-
-QT3DS_FORCE_INLINE Mat33V M33MulM33(const Mat33V &a, const Mat33V &b)
-{
- return Mat33V(M33MulV3(a, b.col0), M33MulV3(a, b.col1), M33MulV3(a, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Add(const Mat33V &a, const Mat33V &b)
-{
- return Mat33V(V3Add(a.col0, b.col0), V3Add(a.col1, b.col1), V3Add(a.col2, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Inverse(const Mat33V &a)
-{
- const BoolV tfft = BTFFT();
- const BoolV tttf = BTTTF();
- const FloatV zero = FloatV_From_F32(0.0f);
- const Vec3V cross01 = V3Cross(a.col0, a.col1);
- const Vec3V cross12 = V3Cross(a.col1, a.col2);
- const Vec3V cross20 = V3Cross(a.col2, a.col0);
- const FloatV dot = V3Dot(cross01, a.col2);
- const FloatV invDet = _mm_rcp_ps(dot);
- const Vec3V mergeh = _mm_unpacklo_ps(cross12, cross01);
- const Vec3V mergel = _mm_unpackhi_ps(cross12, cross01);
- Vec3V colInv0 = _mm_unpacklo_ps(mergeh, cross20);
- colInv0 = _mm_or_ps(_mm_andnot_ps(tttf, zero), _mm_and_ps(tttf, colInv0));
- const Vec3V zppd = _mm_shuffle_ps(mergeh, cross20, _MM_SHUFFLE(3, 0, 0, 2));
- const Vec3V pbwp = _mm_shuffle_ps(cross20, mergeh, _MM_SHUFFLE(3, 3, 1, 0));
- const Vec3V colInv1 = _mm_or_ps(_mm_andnot_ps(BTFFT(), pbwp), _mm_and_ps(BTFFT(), zppd));
- const Vec3V xppd = _mm_shuffle_ps(mergel, cross20, _MM_SHUFFLE(3, 0, 0, 0));
- const Vec3V pcyp = _mm_shuffle_ps(cross20, mergel, _MM_SHUFFLE(3, 1, 2, 0));
- const Vec3V colInv2 = _mm_or_ps(_mm_andnot_ps(tfft, pcyp), _mm_and_ps(tfft, xppd));
-
- return Mat33V(_mm_mul_ps(colInv0, invDet), _mm_mul_ps(colInv1, invDet),
- _mm_mul_ps(colInv2, invDet));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Trnsps(const Mat33V &a)
-{
- return Mat33V(V3Merge(V3GetX(a.col0), V3GetX(a.col1), V3GetX(a.col2)),
- V3Merge(V3GetY(a.col0), V3GetY(a.col1), V3GetY(a.col2)),
- V3Merge(V3GetZ(a.col0), V3GetZ(a.col1), V3GetZ(a.col2)));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Identity()
-{
- return Mat33V(V3UnitX(), V3UnitY(), V3UnitZ());
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Sub(const Mat33V &a, const Mat33V &b)
-{
- return Mat33V(V3Sub(a.col0, b.col0), V3Sub(a.col1, b.col1), V3Sub(a.col2, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Neg(const Mat33V &a)
-{
- return Mat33V(V3Neg(a.col0), V3Neg(a.col1), V3Neg(a.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Abs(const Mat33V &a)
-{
- return Mat33V(V3Abs(a.col0), V3Abs(a.col1), V3Abs(a.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V PromoteVec3V(const Vec3V v)
-{
- const BoolV bTFFF = BTFFF();
- const BoolV bFTFF = BFTFF();
- const BoolV bFFTF = BTFTF();
-
- const Vec3V zero = V3Zero();
-
- return Mat33V(V3Sel(bTFFF, v, zero), V3Sel(bFTFF, v, zero), V3Sel(bFFTF, v, zero));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Diagonal(const Vec3VArg d)
-{
- const FloatV x = V3Mul(V3UnitX(), d);
- const FloatV y = V3Mul(V3UnitY(), d);
- const FloatV z = V3Mul(V3UnitZ(), d);
- return Mat33V(x, y, z);
-}
-
-//////////////////////////////////
-// MAT34V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec3V M34MulV3(const Mat34V &a, const Vec3V b)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- const Vec3V v0 = V3Scale(a.col0, x);
- const Vec3V v1 = V3Scale(a.col1, y);
- const Vec3V v2 = V3Scale(a.col2, z);
- const Vec3V v0PlusV1 = V3Add(v0, v1);
- const Vec3V v0PlusV1Plusv2 = V3Add(v0PlusV1, v2);
- return (V3Add(v0PlusV1Plusv2, a.col3));
-}
-
-QT3DS_FORCE_INLINE Vec3V M34Mul33V3(const Mat34V &a, const Vec3V b)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- const Vec3V v0 = V3Scale(a.col0, x);
- const Vec3V v1 = V3Scale(a.col1, y);
- const Vec3V v2 = V3Scale(a.col2, z);
- const Vec3V v0PlusV1 = V3Add(v0, v1);
- return V3Add(v0PlusV1, v2);
-}
-
-QT3DS_FORCE_INLINE Vec3V M34TrnspsMul33V3(const Mat34V &a, const Vec3V b)
-{
- const FloatV x = V3Dot(a.col0, b);
- const FloatV y = V3Dot(a.col1, b);
- const FloatV z = V3Dot(a.col2, b);
- return V3Merge(x, y, z);
-}
-
-QT3DS_FORCE_INLINE Mat34V M34MulM34(const Mat34V &a, const Mat34V &b)
-{
- return Mat34V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2),
- M34MulV3(a, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat33V M34MulM33(const Mat34V &a, const Mat33V &b)
-{
- return Mat33V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M34Mul33MM34(const Mat34V &a, const Mat34V &b)
-{
- return Mat33V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat34V M34Add(const Mat34V &a, const Mat34V &b)
-{
- return Mat34V(V3Add(a.col0, b.col0), V3Add(a.col1, b.col1), V3Add(a.col2, b.col2),
- V3Add(a.col3, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat34V M34InverseV(const Mat34V &a)
-{
- Mat34V aInv;
- const BoolV tfft = BTFFT();
- const BoolV tttf = BTTTF();
- const FloatV zero = FloatV_From_F32(0.0f);
- const Vec3V cross01 = V3Cross(a.col0, a.col1);
- const Vec3V cross12 = V3Cross(a.col1, a.col2);
- const Vec3V cross20 = V3Cross(a.col2, a.col0);
- const FloatV dot = V3Dot(cross01, a.col2);
- const FloatV invDet = _mm_rcp_ps(dot);
- const Vec3V mergeh = _mm_unpacklo_ps(cross12, cross01);
- const Vec3V mergel = _mm_unpackhi_ps(cross12, cross01);
- Vec3V colInv0 = _mm_unpacklo_ps(mergeh, cross20);
- colInv0 = _mm_or_ps(_mm_andnot_ps(tttf, zero), _mm_and_ps(tttf, colInv0));
- const Vec3V zppd = _mm_shuffle_ps(mergeh, cross20, _MM_SHUFFLE(3, 0, 0, 2));
- const Vec3V pbwp = _mm_shuffle_ps(cross20, mergeh, _MM_SHUFFLE(3, 3, 1, 0));
- const Vec3V colInv1 = _mm_or_ps(_mm_andnot_ps(BTFFT(), pbwp), _mm_and_ps(BTFFT(), zppd));
- const Vec3V xppd = _mm_shuffle_ps(mergel, cross20, _MM_SHUFFLE(3, 0, 0, 0));
- const Vec3V pcyp = _mm_shuffle_ps(cross20, mergel, _MM_SHUFFLE(3, 1, 2, 0));
- const Vec3V colInv2 = _mm_or_ps(_mm_andnot_ps(tfft, pcyp), _mm_and_ps(tfft, xppd));
- aInv.col0 = _mm_mul_ps(colInv0, invDet);
- aInv.col1 = _mm_mul_ps(colInv1, invDet);
- aInv.col2 = _mm_mul_ps(colInv2, invDet);
- aInv.col3 = M34Mul33V3(aInv, V3Neg(a.col3));
- return aInv;
-}
-
-QT3DS_FORCE_INLINE Mat33V M34Trnsps33(const Mat34V &a)
-{
- return Mat33V(V3Merge(V3GetX(a.col0), V3GetX(a.col1), V3GetX(a.col2)),
- V3Merge(V3GetY(a.col0), V3GetY(a.col1), V3GetY(a.col2)),
- V3Merge(V3GetZ(a.col0), V3GetZ(a.col1), V3GetZ(a.col2)));
-}
-
-//////////////////////////////////
-// MAT44V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec4V M44MulV4(const Mat44V &a, const Vec4V b)
-{
- const FloatV x = V4GetX(b);
- const FloatV y = V4GetY(b);
- const FloatV z = V4GetZ(b);
- const FloatV w = V4GetW(b);
-
- const Vec4V v0 = V4Scale(a.col0, x);
- const Vec4V v1 = V4Scale(a.col1, y);
- const Vec4V v2 = V4Scale(a.col2, z);
- const Vec4V v3 = V4Scale(a.col3, w);
- const Vec4V v0PlusV1 = V4Add(v0, v1);
- const Vec4V v0PlusV1Plusv2 = V4Add(v0PlusV1, v2);
- return (V4Add(v0PlusV1Plusv2, v3));
-}
-
-QT3DS_FORCE_INLINE Vec4V M44TrnspsMulV4(const Mat44V &a, const Vec4V b)
-{
- QT3DS_ALIGN(16, FloatV)
- dotProdArray[4] = { V4Dot(a.col0, b), V4Dot(a.col1, b), V4Dot(a.col2, b), V4Dot(a.col3, b) };
- return V4Merge(dotProdArray);
-}
-
-QT3DS_FORCE_INLINE Mat44V M44MulM44(const Mat44V &a, const Mat44V &b)
-{
- return Mat44V(M44MulV4(a, b.col0), M44MulV4(a, b.col1), M44MulV4(a, b.col2),
- M44MulV4(a, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat44V M44Add(const Mat44V &a, const Mat44V &b)
-{
- return Mat44V(V4Add(a.col0, b.col0), V4Add(a.col1, b.col1), V4Add(a.col2, b.col2),
- V4Add(a.col3, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat44V M44Trnsps(const Mat44V &a)
-{
- const Vec4V v0 = _mm_unpacklo_ps(a.col0, a.col2);
- const Vec4V v1 = _mm_unpackhi_ps(a.col0, a.col2);
- const Vec4V v2 = _mm_unpacklo_ps(a.col1, a.col3);
- const Vec4V v3 = _mm_unpackhi_ps(a.col1, a.col3);
- return Mat44V(_mm_unpacklo_ps(v0, v2), _mm_unpackhi_ps(v0, v2), _mm_unpacklo_ps(v1, v3),
- _mm_unpackhi_ps(v1, v3));
-}
-
-QT3DS_FORCE_INLINE Mat44V M44Inverse(const Mat44V &a)
-{
- __m128 minor0, minor1, minor2, minor3;
- __m128 row0, row1, row2, row3;
- __m128 det, tmp1;
-
- tmp1 = FloatV_From_F32(0.0f);
- row1 = FloatV_From_F32(0.0f);
- row3 = FloatV_From_F32(0.0f);
-
- row0 = a.col0;
- row1 = _mm_shuffle_ps(a.col1, a.col1, _MM_SHUFFLE(1, 0, 3, 2));
- row2 = a.col2;
- row3 = _mm_shuffle_ps(a.col3, a.col3, _MM_SHUFFLE(1, 0, 3, 2));
-
- tmp1 = _mm_mul_ps(row2, row3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor0 = _mm_mul_ps(row1, tmp1);
- minor1 = _mm_mul_ps(row0, tmp1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor0 = _mm_sub_ps(_mm_mul_ps(row1, tmp1), minor0);
- minor1 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor1);
- minor1 = _mm_shuffle_ps(minor1, minor1, 0x4E);
-
- tmp1 = _mm_mul_ps(row1, row2);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor0 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor0);
- minor3 = _mm_mul_ps(row0, tmp1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor0 = _mm_sub_ps(minor0, _mm_mul_ps(row3, tmp1));
- minor3 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor3);
- minor3 = _mm_shuffle_ps(minor3, minor3, 0x4E);
-
- tmp1 = _mm_mul_ps(_mm_shuffle_ps(row1, row1, 0x4E), row3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- row2 = _mm_shuffle_ps(row2, row2, 0x4E);
- minor0 = _mm_add_ps(_mm_mul_ps(row2, tmp1), minor0);
- minor2 = _mm_mul_ps(row0, tmp1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor0 = _mm_sub_ps(minor0, _mm_mul_ps(row2, tmp1));
- minor2 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor2);
- minor2 = _mm_shuffle_ps(minor2, minor2, 0x4E);
-
- tmp1 = _mm_mul_ps(row0, row1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor2 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor2);
- minor3 = _mm_sub_ps(_mm_mul_ps(row2, tmp1), minor3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor2 = _mm_sub_ps(_mm_mul_ps(row3, tmp1), minor2);
- minor3 = _mm_sub_ps(minor3, _mm_mul_ps(row2, tmp1));
-
- tmp1 = _mm_mul_ps(row0, row3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor1 = _mm_sub_ps(minor1, _mm_mul_ps(row2, tmp1));
- minor2 = _mm_add_ps(_mm_mul_ps(row1, tmp1), minor2);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor1 = _mm_add_ps(_mm_mul_ps(row2, tmp1), minor1);
- minor2 = _mm_sub_ps(minor2, _mm_mul_ps(row1, tmp1));
-
- tmp1 = _mm_mul_ps(row0, row2);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor1 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor1);
- minor3 = _mm_sub_ps(minor3, _mm_mul_ps(row1, tmp1));
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor1 = _mm_sub_ps(minor1, _mm_mul_ps(row3, tmp1));
- minor3 = _mm_add_ps(_mm_mul_ps(row1, tmp1), minor3);
-
- det = _mm_mul_ps(row0, minor0);
- det = _mm_add_ps(_mm_shuffle_ps(det, det, 0x4E), det);
- det = _mm_add_ss(_mm_shuffle_ps(det, det, 0xB1), det);
- tmp1 = _mm_rcp_ss(det);
-#if 0
- det = _mm_sub_ss(_mm_add_ss(tmp1, tmp1), _mm_mul_ss(det, _mm_mul_ss(tmp1, tmp1)));
- det = _mm_shuffle_ps(det, det, 0x00);
-#else
- det = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(0, 0, 0, 0));
-#endif
-
- minor0 = _mm_mul_ps(det, minor0);
- minor1 = _mm_mul_ps(det, minor1);
- minor2 = _mm_mul_ps(det, minor2);
- minor3 = _mm_mul_ps(det, minor3);
- Mat44V invTrans(minor0, minor1, minor2, minor3);
- return M44Trnsps(invTrans);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_XYZW(QT3DSF32 x, QT3DSF32 y, QT3DSF32 z, QT3DSF32 w)
-{
- return _mm_set_ps(w, z, y, x);
-}
-
-// AP: work in progress - use proper SSE intrinsics where possible
-QT3DS_FORCE_INLINE VecU16V V4U32PK(VecU32V a, VecU32V b)
-{
- VecU16V result;
- result.m128_u16[0] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[0], 0, 0xFFFF));
- result.m128_u16[1] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[1], 0, 0xFFFF));
- result.m128_u16[2] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[2], 0, 0xFFFF));
- result.m128_u16[3] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[3], 0, 0xFFFF));
- result.m128_u16[4] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[0], 0, 0xFFFF));
- result.m128_u16[5] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[1], 0, 0xFFFF));
- result.m128_u16[6] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[2], 0, 0xFFFF));
- result.m128_u16[7] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[3], 0, 0xFFFF));
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U32or(VecU32V a, VecU32V b)
-{
- return m128_I2F(_mm_or_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U32and(VecU32V a, VecU32V b)
-{
- return m128_I2F(_mm_and_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U32Andc(VecU32V a, VecU32V b)
-{
- return m128_I2F(_mm_andnot_si128(m128_F2I(b), m128_F2I(a)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16Or(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_or_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16And(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_and_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16Andc(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_andnot_si128(m128_F2I(b), m128_F2I(a)));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_From_I32(const QT3DSI32 i)
-{
- return (_mm_load1_ps((QT3DSF32 *)&i));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_From_I32Array(const QT3DSI32 *i)
-{
- return _mm_loadu_ps((QT3DSF32 *)i);
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_From_I32Array_Aligned(const QT3DSI32 *i)
-{
- return _mm_load_ps((QT3DSF32 *)i);
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Add(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_add_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Sub(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_sub_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE BoolV VecI32V_IsGrtr(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_cmpgt_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE BoolV VecI32V_IsEq(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_cmpeq_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Zero()
-{
- return V4Zero();
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Merge(const VecI32VArg a, const VecI32VArg b, const VecI32VArg c,
- const VecI32VArg d)
-{
- return V4Merge(a, b, c, d);
-}
-
-template <int a>
-QT3DS_FORCE_INLINE VecI32V V4ISplat()
-{
- VecI32V result;
- result.m128_i32[0] = a;
- result.m128_i32[1] = a;
- result.m128_i32[2] = a;
- result.m128_i32[3] = a;
- return result;
-}
-
-QT3DS_FORCE_INLINE void V4U16StoreAligned(VecU16V val, VecU16V *address)
-{
- *address = val;
-}
-
-QT3DS_FORCE_INLINE void V4U32StoreAligned(VecU32V val, VecU32V *address)
-{
- *address = val;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4LoadAligned(Vec4V *addr)
-{
- return *addr;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4LoadUnaligned(Vec4V *addr)
-{
- return Vec4V_From_F32Array((float *)addr);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Andc(const Vec4V a, const VecU32V b)
-{
- VecU32V result32(a);
- result32 = V4U32Andc(result32, b);
- return Vec4V(result32);
-}
-
-QT3DS_FORCE_INLINE VecU32V V4IsGrtrV32u(const Vec4V a, const Vec4V b)
-{
- return V4IsGrtr(a, b);
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16LoadAligned(VecU16V *addr)
-{
- return *addr;
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16LoadUnaligned(VecU16V *addr)
-{
- return *addr;
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16CompareGt(VecU16V a, VecU16V b)
-{
- // _mm_cmpgt_epi16 doesn't work for unsigned values unfortunately
- // return m128_I2F(_mm_cmpgt_epi16(m128_F2I(a), m128_F2I(b)));
- VecU16V result;
- result.m128_u16[0] = (a).m128_u16[0] > (b).m128_u16[0];
- result.m128_u16[1] = (a).m128_u16[1] > (b).m128_u16[1];
- result.m128_u16[2] = (a).m128_u16[2] > (b).m128_u16[2];
- result.m128_u16[3] = (a).m128_u16[3] > (b).m128_u16[3];
- result.m128_u16[4] = (a).m128_u16[4] > (b).m128_u16[4];
- result.m128_u16[5] = (a).m128_u16[5] > (b).m128_u16[5];
- result.m128_u16[6] = (a).m128_u16[6] > (b).m128_u16[6];
- result.m128_u16[7] = (a).m128_u16[7] > (b).m128_u16[7];
- return result;
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_VecU32V(VecU32V a)
-{
- Vec4V result = Vec4V_From_XYZW(QT3DSF32(a.m128_u32[0]), QT3DSF32(a.m128_u32[1]), QT3DSF32(a.m128_u32[2]),
- QT3DSF32(a.m128_u32[3]));
- return result;
-}
-
-template <int index>
-QT3DS_FORCE_INLINE VecU32V V4U32SplatElement(VecU32V a)
-{
- VecU32V result;
- result.m128_u32[0] = result.m128_u32[1] = result.m128_u32[2] = result.m128_u32[3] =
- a.m128_u32[index];
- return result;
-}
-
-template <int index>
-QT3DS_FORCE_INLINE Vec4V V4SplatElement(Vec4V a)
-{
- float *data = (float *)&a;
- return Vec4V_From_F32(data[index]);
-}
-
-template <int index>
-QT3DS_FORCE_INLINE VecU16V V4U16SplatElement(VecU16V a)
-{
- VecU16V result;
- for (int i = 0; i < 8; i++)
- result.m128_u16[i] = a.m128_u16[index];
- return result;
-}
-
-template <int imm>
-QT3DS_FORCE_INLINE VecI16V V4I16SplatImmediate()
-{
- VecI16V result;
- result.m128_i16[0] = imm;
- result.m128_i16[1] = imm;
- result.m128_i16[2] = imm;
- result.m128_i16[3] = imm;
- result.m128_i16[4] = imm;
- result.m128_i16[5] = imm;
- result.m128_i16[6] = imm;
- result.m128_i16[7] = imm;
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16SubtractModulo(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_sub_epi16(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16AddModulo(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_add_epi16(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U16GetLo16(VecU16V a)
-{
- VecU32V result;
- result.m128_u32[0] = a.m128_u16[0];
- result.m128_u32[1] = a.m128_u16[2];
- result.m128_u32[2] = a.m128_u16[4];
- result.m128_u32[3] = a.m128_u16[6];
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U16GetHi16(VecU16V a)
-{
- VecU32V result;
- result.m128_u32[0] = a.m128_u16[1];
- result.m128_u32[1] = a.m128_u16[3];
- result.m128_u32[2] = a.m128_u16[5];
- result.m128_u32[3] = a.m128_u16[7];
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU32V VecU32V_From_XYZW(QT3DSU32 x, QT3DSU32 y, QT3DSU32 z, QT3DSU32 w)
-{
- VecU32V result;
- result.m128_u32[0] = x;
- result.m128_u32[1] = y;
- result.m128_u32[2] = z;
- result.m128_u32[3] = w;
- return result;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Ceil(const Vec4V in)
-{
- UnionM128 a(in);
- return Vec4V_From_XYZW(NVCeil(a.m128_f32[0]), NVCeil(a.m128_f32[1]), NVCeil(a.m128_f32[2]),
- NVCeil(a.m128_f32[3]));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Floor(const Vec4V in)
-{
- UnionM128 a(in);
- return Vec4V_From_XYZW(NVFloor(a.m128_f32[0]), NVFloor(a.m128_f32[1]), NVFloor(a.m128_f32[2]),
- NVFloor(a.m128_f32[3]));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4ConvertToU32VSaturate(const Vec4V in, QT3DSU32 power)
-{
- QT3DS_ASSERT(power == 0 && "Non-zero power not supported in convertToU32VSaturate");
- QT3DS_FORCE_PARAMETER_REFERENCE(power); // prevent warning in release builds
- QT3DSF32 ffffFFFFasFloat = QT3DSF32(0xFFFF0000);
- UnionM128 a(in);
- VecU32V result;
- result.m128_u32[0] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[0], 0.0f, ffffFFFFasFloat));
- result.m128_u32[1] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[1], 0.0f, ffffFFFFasFloat));
- result.m128_u32[2] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[2], 0.0f, ffffFFFFasFloat));
- result.m128_u32[3] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[3], 0.0f, ffffFFFFasFloat));
- return result;
-}
-
-#endif // QT3DS_LINUX_INLINE_AOS_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxIntrinsics.h b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxIntrinsics.h
deleted file mode 100644
index 70974609..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxIntrinsics.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_LINUX_INTRINSICS_H
-#define QT3DS_FOUNDATION_QT3DS_LINUX_INTRINSICS_H
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-
-#if !(defined QT3DS_LINUX || defined QT3DS_ANDROID || defined QT3DS_APPLE || defined QT3DS_QNX)
-#error "This file should only be included by Linux builds!!"
-#endif
-
-#include <cmath>
-#include <math.h>
-#include <float.h>
-#include <string.h>
-
-namespace qt3ds {
-namespace intrinsics {
- //! \brief platform-specific absolute value
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float abs(float a) { return ::fabs(a); }
-
- //! \brief platform-specific select float
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float fsel(float a, float b, float c)
- {
- return (a >= 0.0f) ? b : c;
- }
-
- //! \brief platform-specific sign
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float sign(float a) { return (a >= 0.0f) ? 1.0f : -1.0f; }
-
- //! \brief platform-specific reciprocal
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recip(float a) { return 1.0f / a; }
-
- //! \brief platform-specific reciprocal estimate
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recipFast(float a) { return 1.0f / a; }
-
- //! \brief platform-specific square root
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float sqrt(float a) { return ::sqrtf(a); }
-
- //! \brief platform-specific reciprocal square root
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recipSqrt(float a) { return 1.0f / ::sqrtf(a); }
-
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recipSqrtFast(float a) { return 1.0f / ::sqrtf(a); }
-
- //! \brief platform-specific sine
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float sin(float a) { return ::sinf(a); }
-
- //! \brief platform-specific cosine
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float cos(float a) { return ::cosf(a); }
-
- //! \brief platform-specific minimum
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float selectMin(float a, float b) { return a < b ? a : b; }
-
- //! \brief platform-specific maximum
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float selectMax(float a, float b) { return a > b ? a : b; }
-
- //! \brief platform-specific finiteness check (not INF or NAN)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isFinite(float a) { return std::isfinite(a); }
-
- //! \brief platform-specific finiteness check (not INF or NAN)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isFinite(double a) { return std::isfinite(a); }
- QT3DS_FORCE_INLINE void memoryBarrier()
- {
-#if 0 //!defined (QT3DS_ARM)
- smp_mb();
-#endif
- }
-
- /*!
- Return the index of the highest set bit. Undefined for zero arg.
- */
- QT3DS_INLINE QT3DSU32 highestSetBitUnsafe(QT3DSU32 v)
- {
-
- // http://graphics.stanford.edu/~seander/bithacks.html
- static const QT3DSU32 MultiplyDeBruijnBitPosition[32] = { 0, 9, 1, 10, 13, 21, 2, 29,
- 11, 14, 16, 18, 22, 25, 3, 30,
- 8, 12, 20, 28, 15, 17, 24, 7,
- 19, 27, 23, 6, 26, 5, 4, 31 };
-
- v |= v >> 1; // first round up to one less than a power of 2
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
-
- return MultiplyDeBruijnBitPosition[(QT3DSU32)(v * 0x07C4ACDDU) >> 27];
- }
-
- /*!
- Return the index of the highest set bit. Undefined for zero arg.
- */
- QT3DS_INLINE QT3DSI32 lowestSetBitUnsafe(QT3DSU32 v)
- {
- // http://graphics.stanford.edu/~seander/bithacks.html
- static const QT3DSU32 MultiplyDeBruijnBitPosition[32] = { 0, 1, 28, 2, 29, 14, 24, 3,
- 30, 22, 20, 15, 25, 17, 4, 8,
- 31, 27, 13, 23, 21, 19, 16, 7,
- 26, 12, 18, 6, 11, 5, 10, 9 };
- QT3DSI32 w = v;
- return MultiplyDeBruijnBitPosition[(QT3DSU32)((w & -w) * 0x077CB531U) >> 27];
- }
-
- /*!
- Returns the index of the highest set bit. Undefined for zero arg.
- */
- QT3DS_INLINE QT3DSU32 countLeadingZeros(QT3DSU32 v)
- {
- QT3DSI32 result = 0;
-#ifdef _INTEGRITYPLATFORM
- QT3DSU32 testBit = (1U << 31);
-#else
- QT3DSU32 testBit = (1 << 31);
-#endif
- while ((v & testBit) == 0 && testBit != 0)
- result++, testBit >>= 1;
- return result;
- }
-
- /*!
- Sets \c count bytes starting at \c dst to zero.
- */
- QT3DS_FORCE_INLINE void *memZero(void *QT3DS_RESTRICT dest, QT3DSU32 count)
- {
- return memset(dest, 0, count);
- }
-
- /*!
- Sets \c count bytes starting at \c dst to \c c.
- */
- QT3DS_FORCE_INLINE void *memSet(void *QT3DS_RESTRICT dest, QT3DSI32 c, QT3DSU32 count)
- {
- return memset(dest, c, count);
- }
-
- /*!
- Copies \c count bytes from \c src to \c dst. User memMove if regions overlap.
- */
- QT3DS_FORCE_INLINE void *memCopy(void *QT3DS_RESTRICT dest, const void *QT3DS_RESTRICT src, QT3DSU32 count)
- {
- return memcpy(dest, src, count);
- }
-
- /*!
- Copies \c count bytes from \c src to \c dst. Supports overlapping regions.
- */
- QT3DS_FORCE_INLINE void *memMove(void *QT3DS_RESTRICT dest, const void *QT3DS_RESTRICT src, QT3DSU32 count)
- {
- return memmove(dest, src, count);
- }
-
- /*!
- Set 128B to zero starting at \c dst+offset. Must be aligned.
- */
- QT3DS_FORCE_INLINE void memZero128(void *QT3DS_RESTRICT dest, QT3DSU32 offset = 0)
- {
- QT3DS_ASSERT(((size_t(dest) + offset) & 0x7f) == 0);
- memSet((char *QT3DS_RESTRICT)dest + offset, 0, 128);
- }
-
- /*!
- Prefetch aligned 128B around \c ptr+offset.
- */
- QT3DS_FORCE_INLINE void prefetch128(const void *, QT3DSU32 = 0) {}
-
- /*!
- Prefetch \c count bytes starting at \c ptr.
- */
- QT3DS_FORCE_INLINE void prefetch(const void *ptr, QT3DSU32 count = 0)
- {
- for (QT3DSU32 i = 0; i <= count; i += 128)
- prefetch128(ptr, i);
- }
-
- //! \brief platform-specific floor
- QT3DS_FORCE_INLINE float floatFloor(float x) { return ::floorf(x); }
-} // namespace intrinsics
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxMutex.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxMutex.cpp
deleted file mode 100644
index bbc55829..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxMutex.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAtomic.h"
-
-#include <pthread.h>
-
-namespace qt3ds {
-namespace foundation {
-
- namespace {
- pthread_mutex_t *getMutex(MutexImpl *impl)
- {
- return reinterpret_cast<pthread_mutex_t *>(impl);
- }
- }
-
- MutexImpl::MutexImpl()
- {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(getMutex(this), &attr);
- pthread_mutexattr_destroy(&attr);
- }
-
- MutexImpl::~MutexImpl() { pthread_mutex_destroy(getMutex(this)); }
-
- bool MutexImpl::lock() { return !pthread_mutex_lock(getMutex(this)); }
-
- bool MutexImpl::trylock() { return !pthread_mutex_trylock(getMutex(this)); }
-
- bool MutexImpl::unlock() { return !pthread_mutex_unlock(getMutex(this)); }
-
- const QT3DSU32 MutexImpl::size = sizeof(pthread_mutex_t);
-
- class ReadWriteLockImpl
- {
- public:
- ReadWriteLockImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- pthread_mutex_t mutex;
- volatile int readerCounter;
- };
-
- ReadWriteLock::ReadWriteLock(NVAllocatorCallback &alloc)
- {
- mImpl = QT3DS_NEW(alloc, ReadWriteLockImpl)(alloc);
-
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&mImpl->mutex, &attr);
- pthread_mutexattr_destroy(&attr);
-
- mImpl->readerCounter = 0;
- }
-
- ReadWriteLock::~ReadWriteLock()
- {
- pthread_mutex_destroy(&mImpl->mutex);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- void ReadWriteLock::lockReader()
- {
- pthread_mutex_lock(&mImpl->mutex);
-
- atomicIncrement(&mImpl->readerCounter);
-
- pthread_mutex_unlock(&mImpl->mutex);
- }
-
- void ReadWriteLock::lockWriter()
- {
- pthread_mutex_lock(&mImpl->mutex);
-
- while (mImpl->readerCounter != 0)
- ;
- }
-
- void ReadWriteLock::unlockReader() { atomicDecrement(&mImpl->readerCounter); }
-
- void ReadWriteLock::unlockWriter() { pthread_mutex_unlock(&mImpl->mutex); }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSemaphore.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSemaphore.cpp
deleted file mode 100644
index 90aab79a..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSemaphore.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSSemaphore.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <time.h>
-#include <sys/time.h>
-
-namespace qt3ds {
-namespace foundation {
-
- class SemaphoreImpl
- {
- public:
- SemaphoreImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- QT3DSU32 count;
- QT3DSU32 maxCount;
- };
-
- struct NVLinuxScopeLock
- {
- NVLinuxScopeLock(pthread_mutex_t &m)
- : mMutex(m)
- {
- pthread_mutex_lock(&mMutex);
- }
-
- ~NVLinuxScopeLock() { pthread_mutex_unlock(&mMutex); }
- private:
- pthread_mutex_t &mMutex;
- };
-
- Semaphore::Semaphore(NVAllocatorCallback &alloc, QT3DSU32 initialCount, QT3DSU32 maxCount)
- {
- mImpl = QT3DS_NEW(alloc, SemaphoreImpl)(alloc);
- int status = pthread_mutex_init(&mImpl->mutex, 0);
- QT3DS_ASSERT(!status);
- status = pthread_cond_init(&mImpl->cond, 0);
- QT3DS_ASSERT(!status);
- mImpl->count = initialCount;
- mImpl->maxCount = maxCount;
- QT3DS_ASSERT(initialCount <= maxCount);
- }
-
- Semaphore::~Semaphore()
- {
- pthread_cond_destroy(&mImpl->cond);
- pthread_mutex_destroy(&mImpl->mutex);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- bool Semaphore::wait(QT3DSU32 milliseconds)
- {
- NVLinuxScopeLock lock(mImpl->mutex);
-
- if (mImpl->count > 0) {
- mImpl->count--;
- return true;
- }
-
- if (milliseconds == 0) {
- return false;
- }
-
- if (milliseconds == QT3DSU32(-1)) {
- int status = pthread_cond_wait(&mImpl->cond, &mImpl->mutex);
- QT3DS_ASSERT(!status);
- (void)status;
- } else {
- timespec ts;
- timeval tp;
- gettimeofday(&tp, NULL);
- QT3DSU32 sec = milliseconds / 1000;
- QT3DSU32 usec = (milliseconds - 1000 * sec) * 1000;
-
- // sschirm: taking into account that us might accumulate to a second
- // otherwise the pthread_cond_timedwait complains on osx.
- usec = tp.tv_usec + usec;
- QT3DSU32 div_sec = usec / 1000000;
- QT3DSU32 rem_usec = usec - div_sec * 1000000;
-
- ts.tv_sec = tp.tv_sec + sec + div_sec;
- ts.tv_nsec = rem_usec * 1000;
-
- int ierr = pthread_cond_timedwait(&mImpl->cond, &mImpl->mutex, &ts);
- QT3DS_ASSERT((ierr == 0) || (ierr == ETIMEDOUT));
- (void)ierr;
- return false;
- }
-
- return true;
- }
-
- void Semaphore::post()
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- mImpl->count++;
- if (mImpl->count > mImpl->maxCount)
- mImpl->count = mImpl->maxCount;
- else {
- pthread_cond_broadcast(&mImpl->cond);
- }
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxString.h b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxString.h
deleted file mode 100644
index a4645f2b..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxString.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_LINUX_STRING_H
-#define QT3DS_FOUNDATION_QT3DS_LINUX_STRING_H
-
-#include "foundation/Qt3DS.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-
-#pragma warning(push)
-#pragma warning(disable : 4995 4996)
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-QT3DS_INLINE void NVStrcpy(char *dest, size_t size, const char *src)
-{
- ::strncpy(dest, src, size);
-}
-
-QT3DS_INLINE int NVStrcat(char *dest, size_t size, const char *src)
-{
- ::strcat(dest, src);
- return 0;
-}
-QT3DS_INLINE int NVVsprintf(char *dest, size_t size, const char *src, va_list arg)
-{
- int r = ::vsprintf(dest, src, arg);
-
- return r;
-}
-QT3DS_INLINE int NVStricmp(const char *str, const char *str1)
-{
- return (::strcasecmp(str, str1));
-}
-
-namespace string {
-
- QT3DS_INLINE void strcpy(char *dest, size_t size, const char *src) { ::strcpy(dest, src); }
- QT3DS_INLINE void strcat(char *dest, size_t size, const char *src) { ::strcat(dest, src); }
- // QT3DS_INLINE int strcasecmp(const char *str, const char *str1) {return(::strcasecmp(str,
- // str1));}
- QT3DS_INLINE QT3DSI32 stricmp(const char *str, const char *str1) { return (::strcasecmp(str, str1)); }
- QT3DS_INLINE QT3DSI32 strnicmp(const char *str, const char *str1, size_t len)
- {
- return (::strncasecmp(str, str1, len));
- }
-
- QT3DS_INLINE QT3DSI32 strncat_s(char *dstBfr, size_t dstSize, const char *srcBfr, size_t numCpy)
- {
- if (!dstBfr || !srcBfr || !dstSize)
- return -1;
-
- size_t len = strlen(dstBfr);
-
- if (len >= dstSize)
- return -1;
-
- size_t remain = dstSize - len - 1;
- size_t transfer = remain > numCpy ? numCpy : remain;
- ::memmove(dstBfr + len, srcBfr, transfer);
- dstBfr[len + transfer] = '\0';
- return numCpy <= remain ? 0 : -1;
- }
-
- QT3DS_INLINE QT3DSI32 _vsnprintf(char *dest, size_t size, const char *src, va_list arg)
- {
- QT3DSI32 r = ::vsnprintf(dest, size, src, arg);
-
- return r;
- }
- QT3DS_INLINE QT3DSI32 vsprintf(char *dest, size_t size, const char *src, va_list arg)
- {
- QT3DSI32 r = ::vsprintf(dest, src, arg);
-
- return r;
- }
- QT3DS_INLINE int vsprintf_s(char *dest, size_t size, const char *src, va_list arg)
- {
- int r = ::vsprintf(dest, src, arg);
-
- return r;
- }
-
- QT3DS_INLINE int sprintf_s(char *_DstBuf, size_t _DstSize, const char *_Format, ...)
- {
- if (_DstBuf == NULL || _Format == NULL) {
- return -1;
- }
-
- va_list arg;
- va_start(arg, _Format);
- int r = ::vsprintf(_DstBuf, _Format, arg);
- va_end(arg);
-
- return r;
- }
-
- QT3DS_INLINE QT3DSI32 sprintf(char *_DstBuf, size_t _DstSize, const char *_Format, ...)
- {
- va_list arg;
- va_start(arg, _Format);
- QT3DSI32 r = ::vsprintf(_DstBuf, _Format, arg);
- va_end(arg);
-
- return r;
- }
-
- QT3DS_INLINE int strncpy_s(char *strDest, size_t sizeInBytes, const char *strSource, size_t count)
- {
- if (strDest == NULL || strSource == NULL || sizeInBytes == 0) {
- return -1;
- }
-
- if (sizeInBytes < count) {
- strDest[0] = 0;
- return -1;
- }
-
- ::strncpy(strDest, strSource, count);
- return 0;
- }
-
- QT3DS_INLINE void strcpy_s(char *dest, size_t size, const char *src)
- {
- ::strncpy(dest, src, size);
- }
-
- QT3DS_INLINE int strcat_s(char *dest, size_t size, const char *src)
- {
- ::strcat(dest, src);
- return 0;
- }
-
- QT3DS_INLINE QT3DSI32 sscanf(const char *buffer, const char *format, ...)
- {
- va_list arg;
- va_start(arg, format);
- QT3DSI32 r = ::sscanf(buffer, format, arg);
- va_end(arg);
-
- return r;
- };
-
- QT3DS_INLINE void strlwr(char *str)
- {
- while (*str) {
- if (*str >= 'A' && *str <= 'Z')
- *str += 32;
- str++;
- }
- }
-
- QT3DS_INLINE void strupr(char *str)
- {
- while (*str) {
- if (*str >= 'a' && *str <= 'z')
- *str -= 32;
- str++;
- }
- }
-
-} // namespace string
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-#pragma warning(pop)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSync.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSync.cpp
deleted file mode 100644
index 52f9d7ab..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxSync.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <time.h>
-#include <sys/time.h>
-
-namespace qt3ds {
-namespace foundation {
-
- class SyncImpl
- {
- public:
- SyncImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- volatile bool is_set;
- };
-
- struct NVLinuxScopeLock
- {
- NVLinuxScopeLock(pthread_mutex_t &m)
- : mMutex(m)
- {
- pthread_mutex_lock(&mMutex);
- }
-
- ~NVLinuxScopeLock() { pthread_mutex_unlock(&mMutex); }
- private:
- pthread_mutex_t &mMutex;
- };
-
- Sync::Sync(NVAllocatorCallback &alloc)
- {
- mImpl = QT3DS_NEW(alloc, SyncImpl)(alloc);
- int status = pthread_mutex_init(&mImpl->mutex, 0);
- QT3DS_ASSERT(!status);
- status = pthread_cond_init(&mImpl->cond, 0);
- QT3DS_ASSERT(!status);
- mImpl->is_set = false;
- }
-
- Sync::~Sync()
- {
- pthread_cond_destroy(&mImpl->cond);
- pthread_mutex_destroy(&mImpl->mutex);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- void Sync::reset()
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- mImpl->is_set = false;
- }
-
- void Sync::set()
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- if (!mImpl->is_set) {
- mImpl->is_set = true;
- pthread_cond_broadcast(&mImpl->cond);
- }
- }
-
- bool Sync::wait(QT3DSU32 ms)
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- if (!mImpl->is_set) {
- if (ms == QT3DSU32(-1)) {
- int status = pthread_cond_wait(&mImpl->cond, &mImpl->mutex);
- QT3DS_ASSERT(!status);
- (void)status;
- } else {
- timespec ts;
- timeval tp;
- gettimeofday(&tp, NULL);
- QT3DSU32 sec = ms / 1000;
- QT3DSU32 usec = (ms - 1000 * sec) * 1000;
-
- // sschirm: taking into account that us might accumulate to a second
- // otherwise the pthread_cond_timedwait complains on osx.
- usec = tp.tv_usec + usec;
- QT3DSU32 div_sec = usec / 1000000;
- QT3DSU32 rem_usec = usec - div_sec * 1000000;
-
- ts.tv_sec = tp.tv_sec + sec + div_sec;
- ts.tv_nsec = rem_usec * 1000;
-
- int ierr = pthread_cond_timedwait(&mImpl->cond, &mImpl->mutex, &ts);
- QT3DS_ASSERT((ierr == 0) || (ierr == ETIMEDOUT));
- (void)ierr;
- }
- }
- return mImpl->is_set;
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxThread.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxThread.cpp
deleted file mode 100644
index fa6e069e..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxThread.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSThread.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#if !defined(QT3DS_APPLE) && !defined(ANDROID) && !defined(__CYGWIN__) && !defined(__QNX__) && !defined(__INTEGRITY)
-#include <bits/local_lim.h> // PTHREAD_STACK_MIN
-#endif
-#include <stdio.h>
-#include <pthread.h>
-#if !defined(__QNX__) && !defined(__INTEGRITY)
-#include <unistd.h>
-#include <sys/syscall.h>
-#if !defined(QT3DS_APPLE)
-#include <asm/unistd.h>
-#include <sys/resource.h>
-#endif
-#endif
-
-#define NVSpinLockPause() asm("nop")
-
-namespace qt3ds {
-namespace foundation {
- using namespace intrinsics;
-
- typedef enum { _NVThreadNotStarted, _NVThreadStarted, _NVThreadStopped } NVThreadState;
-
- class ThreadImpl
- {
- public:
- ThreadImpl(NVFoundationBase &foundation)
- : mFoundation(foundation)
- {
- }
- NVFoundationBase &mFoundation;
- Thread::ExecuteFn fn;
- void *arg;
- volatile QT3DSI32 quitNow;
- volatile QT3DSI32 threadStarted;
- NVThreadState state;
-
- pthread_t thread;
- pid_t tid;
- };
-
- void *NVThreadStart(void *arg);
-
- Thread::Id Thread::getId() { return Id(pthread_self()); }
-
- Thread::Thread(NVFoundationBase &foundation)
- {
- mImpl = QT3DS_NEW(foundation.getAllocator(), ThreadImpl)(foundation);
- mImpl->thread = 0;
- mImpl->tid = 0;
- mImpl->state = _NVThreadNotStarted;
- mImpl->quitNow = 0;
- mImpl->threadStarted = 0;
- mImpl->fn = NULL;
- mImpl->arg = NULL;
- }
-
- Thread::Thread(NVFoundationBase &foundation, Thread::ExecuteFn fn, void *arg)
- {
- mImpl = (ThreadImpl *)QT3DS_NEW(foundation.getAllocator(), ThreadImpl)(foundation);
- mImpl->thread = 0;
- mImpl->tid = 0;
- mImpl->state = _NVThreadNotStarted;
- mImpl->quitNow = 0;
- mImpl->threadStarted = 0;
- mImpl->fn = fn;
- mImpl->arg = arg;
-
- start(0);
- }
-
- Thread::~Thread()
- {
- if (mImpl->state == _NVThreadStarted)
- kill();
- QT3DS_FREE(mImpl->mFoundation.getAllocator(), mImpl);
- }
-
- void Thread::start(QT3DSU32 stackSize)
- {
- if (mImpl->state != _NVThreadNotStarted)
- return;
-
- if (stackSize == 0)
- stackSize = DEFAULT_STACK_SIZE;
-
-#if defined(PTHREAD_STACK_MIN) && !defined(ANDROID)
- if (stackSize < PTHREAD_STACK_MIN) {
- qCWarning(WARNING, "Thread::start(): stack size was set below PTHREAD_STACK_MIN");
- stackSize = PTHREAD_STACK_MIN;
- }
-#endif
-
- pthread_attr_t attr;
- int status = pthread_attr_init(&attr);
- QT3DS_ASSERT(!status);
-
- status = pthread_attr_setstacksize(&attr, stackSize);
- QT3DS_ASSERT(!status);
- status = pthread_create(&mImpl->thread, &attr, NVThreadStart, this);
- QT3DS_ASSERT(!status);
-
-#ifndef __QNX__
- // wait for thread to startup and write out TID
- // otherwise TID dependent calls like setAffinity will fail.
- while (atomicCompareExchange(&(mImpl->threadStarted), 1, 1) == 0)
- yield();
-#endif
-
- mImpl->state = _NVThreadStarted;
-
- status = pthread_attr_destroy(&attr);
- QT3DS_ASSERT(!status);
- }
-
- static void setTid(ThreadImpl &threadImpl)
- {
-#ifndef __QNX__
-// query TID
-#ifdef QT3DS_APPLE
- threadImpl.tid = syscall(SYS_gettid);
-#elif defined(__INTEGRITY)
- pthread_t ptid = pthread_self();
- uint64_t threadId = 0;
- memcpy(&threadId, &ptid, std::min(sizeof(threadId), sizeof(ptid)));
- threadImpl.tid = threadId;
-#else
- threadImpl.tid = syscall(__NR_gettid);
-#endif
-
- // notify/unblock parent thread
- atomicCompareExchange(&(threadImpl.threadStarted), 1, 0);
-#else
- QT3DS_ASSERT(false);
-#endif
- }
-
- void *NVThreadStart(void *arg)
- {
- // run execute from base class to run gettid in the new thread's context
- ((Thread *)arg)->Thread::execute();
- return 0;
- }
-
- void Thread::execute(void)
- {
- // run setTid in thread's context
- setTid(*mImpl);
-
- // then run either the passed in function or execute from the derived class.
- if (mImpl->fn)
- (*mImpl->fn)(mImpl->arg);
- else
- this->execute();
- }
-
- void Thread::signalQuit() { atomicIncrement(&(mImpl->quitNow)); }
-
- bool Thread::waitForQuit()
- {
- if (mImpl->state == _NVThreadNotStarted)
- return false;
-
- pthread_join(mImpl->thread, NULL);
- return true;
- }
-
- bool Thread::quitIsSignalled()
- {
-#ifndef __QNX__
- return atomicCompareExchange(&(mImpl->quitNow), 0, 0) != 0;
-#else
- // Hope for memory locking on the arm.
- return mImpl->quitNow != 0;
-#endif
- }
-
- void Thread::quit()
- {
- mImpl->state = _NVThreadStopped;
- pthread_exit(0);
- }
-
- void Thread::kill()
- {
-#ifndef ANDROID
- if (mImpl->state == _NVThreadStarted)
- pthread_cancel(mImpl->thread);
- mImpl->state = _NVThreadStopped;
-#else
- qCWarning(WARNING, "Thread::kill() called, but is not implemented");
-#endif
- }
-
- void Thread::sleep(QT3DSU32 ms)
- {
- timespec sleepTime;
- QT3DSU32 remainder = ms % 1000;
- sleepTime.tv_sec = ms - remainder;
- sleepTime.tv_nsec = remainder * 1000000L;
-
- while (nanosleep(&sleepTime, &sleepTime) == -1)
- continue;
- }
-
- void Thread::yield() { sched_yield(); }
-
- QT3DSU32 Thread::setAffinityMask(QT3DSU32 mask)
- {
- // Same as windows impl if mask is zero
- if (!mask)
- return 0;
-
-#ifndef __QNX__
- QT3DSU64 prevMask = 0;
-
-// Apple doesn't support syscall with getaffinity and setaffinity
-#if !defined(QT3DS_APPLE) && !defined(__INTEGRITY)
- QT3DSI32 errGet = syscall(__NR_sched_getaffinity, mImpl->tid, sizeof(prevMask), &prevMask);
- if (errGet < 0)
- return 0;
-
- QT3DSI32 errSet = syscall(__NR_sched_setaffinity, mImpl->tid, sizeof(mask), &mask);
- if (errSet != 0)
- return 0;
-#endif
-
- return QT3DSU32(prevMask);
-#else
- QT3DS_ASSERT(false);
- return 0;
-#endif
- }
-
- void Thread::setName(const char *name)
- {
-#if (defined(ANDROID) && (__ANDROID_API__ > 8))
- pthread_setname_np(mImpl->thread, name);
-#else
-// not implemented because most unix APIs expect setName()
-// to be called from the thread's context. Example see next comment:
-
-// this works only with the current thread and can rename
-// the main process if used in the wrong context:
-// prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name) ,0,0,0);
-#endif
- }
-
-#if !defined(QT3DS_APPLE) && !defined(__INTEGRITY)
- static ThreadPriority::Enum convertPriorityFromLinux(QT3DSU32 inPrio, int policy)
- {
- QT3DS_COMPILE_TIME_ASSERT(ThreadPriority::eLOW > ThreadPriority::eHIGH);
- QT3DS_COMPILE_TIME_ASSERT(ThreadPriority::eHIGH == 0);
-
- int maxL = sched_get_priority_max(policy);
- int minL = sched_get_priority_min(policy);
- int rangeL = maxL - minL;
- int rangeNV = ThreadPriority::eLOW - ThreadPriority::eHIGH;
-
- // case for default scheduler policy
- if (rangeL == 0)
- return ThreadPriority::eNORMAL;
-
- float floatPrio = (float(maxL - inPrio) * float(rangeNV)) / float(rangeL);
-
- return ThreadPriority::Enum(int(roundf(floatPrio)));
- }
-
- static int convertPriorityToLinux(ThreadPriority::Enum inPrio, int policy)
- {
- int maxL = sched_get_priority_max(policy);
- int minL = sched_get_priority_min(policy);
- int rangeL = maxL - minL;
- int rangeNV = ThreadPriority::eLOW - ThreadPriority::eHIGH;
-
- // case for default scheduler policy
- if (rangeL == 0)
- return 0;
-
- float floatPrio = (float(ThreadPriority::eLOW - inPrio) * float(rangeL)) / float(rangeNV);
-
- return minL + int(roundf(floatPrio));
- }
-#endif
-
- void Thread::setPriority(ThreadPriority::Enum val)
- {
-#if !defined(QT3DS_APPLE) && !defined(__INTEGRITY)
- int policy;
- sched_param s_param;
- pthread_getschedparam(mImpl->thread, &policy, &s_param);
- s_param.sched_priority = convertPriorityToLinux(val, policy);
- pthread_setschedparam(mImpl->thread, policy, &s_param);
-#endif
- }
-
- ThreadPriority::Enum Thread::getPriority(Id pthread)
- {
-#if !defined(QT3DS_APPLE) && !defined(__INTEGRITY)
- int policy;
- sched_param s_param;
- int ret = pthread_getschedparam(pthread_t(pthread), &policy, &s_param);
- if (ret == 0)
- return convertPriorityFromLinux(s_param.sched_priority, policy);
- else
- return ThreadPriority::eNORMAL;
-#else
- return ThreadPriority::eNORMAL;
-#endif
- }
-
- QT3DSU32 TlsAlloc()
- {
-#if !defined(__INTEGRITY)
- pthread_key_t key;
- int status = pthread_key_create(&key, NULL);
- QT3DS_ASSERT(!status);
- (void)status;
- return (QT3DSU32)key;
-#else
- QT3DS_ASSERT(false);
- return 0;
-#endif
- }
-
- void TlsFree(QT3DSU32 index)
- {
- int status = pthread_key_delete((pthread_key_t)index);
- QT3DS_ASSERT(!status);
- (void)status;
- }
-
- void *TlsGet(QT3DSU32 index) { return (void *)pthread_getspecific((pthread_key_t)index); }
-
- QT3DSU32 TlsSet(QT3DSU32 index, void *value)
- {
- int status = pthread_setspecific((pthread_key_t)index, value);
- QT3DS_ASSERT(!status);
- return !status;
- }
-
- // DM: On Linux x86-32, without implementation-specific restrictions
- // the default stack size for a new thread should be 2 megabytes (kernel.org).
- // NOTE: take care of this value on other architecutres!
- const QT3DSU32 Thread::DEFAULT_STACK_SIZE = 1 << 21;
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTime.cpp b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTime.cpp
deleted file mode 100644
index 6b3e93e4..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTime.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSTime.h"
-
-#include <time.h>
-#include <sys/time.h>
-
-#if defined QT3DS_APPLE
-#include <mach/mach_time.h>
-#endif
-
-// Use real-time high-precision timer.
-#ifndef QT3DS_APPLE
-#define CLOCKID CLOCK_REALTIME
-#endif
-
-namespace qt3ds {
-namespace foundation {
-
- const CounterFrequencyToTensOfNanos Time::sCounterFreq = Time::getCounterFrequency();
-
- static Time::Second getTimeSeconds()
- {
- static struct timeval _tv;
- gettimeofday(&_tv, NULL);
- return double(_tv.tv_sec) + double(_tv.tv_usec) * 0.000001;
- }
-
- Time::Time() { mLastTime = getTimeSeconds(); }
-
- Time::Second Time::getElapsedSeconds()
- {
- Time::Second curTime = getTimeSeconds();
- Time::Second diff = curTime - mLastTime;
- mLastTime = curTime;
- return diff;
- }
-
- Time::Second Time::peekElapsedSeconds()
- {
- Time::Second curTime = getTimeSeconds();
- Time::Second diff = curTime - mLastTime;
- return diff;
- }
-
- Time::Second Time::getLastTime() const { return mLastTime; }
-
-#ifdef QT3DS_APPLE
- CounterFrequencyToTensOfNanos Time::getCounterFrequency()
- {
- mach_timebase_info_data_t info;
- mach_timebase_info(&info);
- // sschirm: some code in the PhysX samples assumes that
- // CounterFrequencyToTensOfNanos::mDenominator is #ticks/second
- // which is bad since it ignores the numenator. This is a temporary fix
- // with the same setup as windows
- // return CounterFrequencyToTensOfNanos( info.numer, info.denom*10 );
- return CounterFrequencyToTensOfNanos(sNumTensOfNanoSecondsInASecond,
- info.denom * 1000000000 / info.numer);
- }
-
- QT3DSU64 Time::getCurrentCounterValue() { return mach_absolute_time(); }
-
-#else
-
- CounterFrequencyToTensOfNanos Time::getCounterFrequency()
- {
- return CounterFrequencyToTensOfNanos(1, 10);
- }
-
- QT3DSU64 Time::getCurrentCounterValue()
- {
- struct timespec mCurrTimeInt;
- clock_gettime(CLOCKID, &mCurrTimeInt);
- // Convert to nanos as this doesn't cause a large divide here
- return (static_cast<QT3DSU64>(mCurrTimeInt.tv_sec) * 1000000000)
- + (static_cast<QT3DSU64>(mCurrTimeInt.tv_nsec));
- }
-#endif
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTrigConstants.h b/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTrigConstants.h
deleted file mode 100644
index 120dec78..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/Qt3DSLinuxTrigConstants.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_LINUX_TRIG_CONSTANTS_H
-#define QT3DS_LINUX_TRIG_CONSTANTS_H
-
-//#define QT3DS_GLOBALCONST extern const __declspec(selectany)
-
-#define QT3DS_GLOBALCONST extern const __attribute__((weak))
-
-QT3DS_ALIGN_PREFIX(16)
-struct QT3DS_VECTORF32
-{
- float f[4];
-};
-
-#define QT3DS_PI 3.141592654f
-#define QT3DS_2PI 6.283185307f
-#define QT3DS_1DIVPI 0.318309886f
-#define QT3DS_1DIV2PI 0.159154943f
-#define QT3DS_PIDIV2 1.570796327f
-#define QT3DS_PIDIV4 0.785398163f
-
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinCoefficients0 = { 1.0f, -0.166666667f, 8.333333333e-3f,
- -1.984126984e-4f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinCoefficients1 = { 2.755731922e-6f, -2.505210839e-8f,
- 1.605904384e-10f, -7.647163732e-13f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinCoefficients2 = { 2.811457254e-15f, -8.220635247e-18f,
- 1.957294106e-20f, -3.868170171e-23f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosCoefficients0 = { 1.0f, -0.5f, 4.166666667e-2f,
- -1.388888889e-3f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosCoefficients1 = { 2.480158730e-5f, -2.755731922e-7f,
- 2.087675699e-9f, -1.147074560e-11f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosCoefficients2 = { 4.779477332e-14f, -1.561920697e-16f,
- 4.110317623e-19f, -8.896791392e-22f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanCoefficients0 = { 1.0f, 0.333333333f, 0.133333333f,
- 5.396825397e-2f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanCoefficients1 = { 2.186948854e-2f, 8.863235530e-3f,
- 3.592128167e-3f, 1.455834485e-3f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanCoefficients2 = { 5.900274264e-4f, 2.391290764e-4f,
- 9.691537707e-5f, 3.927832950e-5f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinCoefficients0 = { -0.05806367563904f, -0.41861972469416f,
- 0.22480114791621f, 2.17337241360606f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinCoefficients1 = { 0.61657275907170f, 4.29696498283455f,
- -1.18942822255452f, -6.53784832094831f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinCoefficients2 = { -1.36926553863413f, -4.48179294237210f,
- 1.41810672941833f, 5.48179257935713f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanCoefficients0 = { 1.0f, 0.333333334f, 0.2f, 0.142857143f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanCoefficients1 = { 1.111111111e-1f, 9.090909091e-2f,
- 7.692307692e-2f, 6.666666667e-2f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanCoefficients2 = { 5.882352941e-2f, 5.263157895e-2f,
- 4.761904762e-2f, 4.347826087e-2f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinEstCoefficients = { 1.0f, -1.66521856991541e-1f,
- 8.199913018755e-3f, -1.61475937228e-4f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosEstCoefficients = { 1.0f, -4.95348008918096e-1f,
- 3.878259962881e-2f, -9.24587976263e-4f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanEstCoefficients = { 2.484f, -1.954923183e-1f, 2.467401101f,
- QT3DS_1DIVPI };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanEstCoefficients = { 7.689891418951e-1f, 1.104742493348f,
- 8.661844266006e-1f, QT3DS_PIDIV2 };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinEstCoefficients = { -1.36178272886711f, 2.37949493464538f,
- -8.08228565650486e-1f,
- 2.78440142746736e-1f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinEstConstants = { 1.00000011921f, QT3DS_PIDIV2, 0.0f, 0.0f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXPiConstants0 = { QT3DS_PI, QT3DS_2PI, QT3DS_1DIVPI, QT3DS_1DIV2PI };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXReciprocalTwoPi = { QT3DS_1DIV2PI, QT3DS_1DIV2PI, QT3DS_1DIV2PI,
- QT3DS_1DIV2PI };
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/SocketImpl.h b/src/Runtime/ogl-runtime/src/foundation/linux/SocketImpl.h
deleted file mode 100644
index 4c3fcb73..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/SocketImpl.h
+++ /dev/null
@@ -1,424 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef FOUNDATION_LINUX_SOCKET_IMPL_H
-#define FOUNDATION_LINUX_SOCKET_IMPL_H
-#pragma once
-
-/*=========================================================================*\
-* BSD include files
-\*=========================================================================*/
-/* error codes */
-#include <errno.h>
-/* close function */
-#include <unistd.h>
-/* fnctnl function and associated constants */
-#include <fcntl.h>
-/* struct sockaddr */
-#include <sys/types.h>
-/* socket function */
-#include <sys/socket.h>
-/* struct timeval */
-#include <sys/time.h>
-/* gethostbyname and gethostbyaddr functions */
-#include <netdb.h>
-/* sigpipe handling */
-#include <signal.h>
-/* IP stuff*/
-#include <netinet/in.h>
-#include <arpa/inet.h>
-/* TCP options (nagle algorithm disable) */
-#include <netinet/tcp.h>
-
-namespace qt3ds {
-namespace foundation {
- namespace socketimpl {
- // Functions take from lua socket implementation. Note that it has an MIT license.
-
- enum {
- IO_DONE = 0, /* operation completed successfully */
- IO_TIMEOUT = -1, /* operation timed out */
- IO_CLOSED = -2, /* the connection has been closed */
- IO_UNKNOWN = -3
- };
-
- /*-------------------------------------------------------------------------*\
- * I/O error strings
- \*-------------------------------------------------------------------------*/
- const char *io_strerror(int err)
- {
- switch (err) {
- case IO_DONE:
- return NULL;
- case IO_CLOSED:
- return "closed";
- case IO_TIMEOUT:
- return "timeout";
- default:
- return "unknown error";
- }
- }
-
- typedef int t_socket;
- typedef t_socket *p_socket;
- typedef struct sockaddr SA;
-
-#define SOCKET_INVALID (-1)
-
-#define WAITFD_R 1
-#define WAITFD_W 2
-#define WAITFD_C (WAITFD_R | WAITFD_W)
-
- int socket_waitfd(p_socket ps, int sw, QT3DSU32 tm)
- {
- int ret;
- fd_set rfds, wfds, *rp, *wp;
- struct timeval tv, *tp = NULL;
- if (tm == 0)
- return IO_TIMEOUT; /* optimize timeout == 0 case */
- if (tm < QT3DS_MAX_U32) {
- // shoule consider max timeout specially by setting tp = NULL
- // or you get invalid argument errno = 22
- tv.tv_sec = (int)(tm / 1000);
- QT3DSU32 leftover = tm % 1000;
- tv.tv_usec = (int)(leftover * 100000);
- tp = &tv;
- }
- do {
- /* must set bits within loop, because select may have modifed them */
- rp = wp = NULL;
- if (sw & WAITFD_R) {
- FD_ZERO(&rfds);
- FD_SET(*ps, &rfds);
- rp = &rfds;
- }
- if (sw & WAITFD_W) {
- FD_ZERO(&wfds);
- FD_SET(*ps, &wfds);
- wp = &wfds;
- }
- ret = select(*ps + 1, rp, wp, NULL, tp);
- } while (ret == -1 && errno == EINTR);
- if (ret == -1)
- return errno;
- if (ret == 0)
- return IO_TIMEOUT;
- if (sw == WAITFD_C && FD_ISSET(*ps, &rfds))
- return IO_CLOSED;
- return IO_DONE;
- }
-
- /*-------------------------------------------------------------------------*\
- * Initializes module
- \*-------------------------------------------------------------------------*/
- int socket_open(void)
- {
- /* instals a handler to ignore sigpipe or it will crash us */
- signal(SIGPIPE, SIG_IGN);
- return 1;
- }
-
- /*-------------------------------------------------------------------------*\
- * Close module
- \*-------------------------------------------------------------------------*/
- int socket_close(void) { return 1; }
-
- /*-------------------------------------------------------------------------*\
- * Put socket into blocking mode
- \*-------------------------------------------------------------------------*/
- void socket_setblocking(p_socket ps)
- {
- int flags = fcntl(*ps, F_GETFL, 0);
- flags &= (~(O_NONBLOCK));
- fcntl(*ps, F_SETFL, flags);
- }
-
- /*-------------------------------------------------------------------------*\
- * Put socket into non-blocking mode
- \*-------------------------------------------------------------------------*/
- void socket_setnonblocking(p_socket ps)
- {
- int flags = fcntl(*ps, F_GETFL, 0);
- flags |= O_NONBLOCK;
- fcntl(*ps, F_SETFL, flags);
- }
-
- /*-------------------------------------------------------------------------*\
- * Close and inutilize socket
- \*-------------------------------------------------------------------------*/
- void socket_destroy(p_socket ps)
- {
- if (*ps != SOCKET_INVALID) {
- socket_setblocking(ps);
- close(*ps);
- *ps = SOCKET_INVALID;
- }
- }
- /*-------------------------------------------------------------------------*\
- *
- \*-------------------------------------------------------------------------*/
- void socket_shutdown(p_socket ps, int how)
- {
- socket_setblocking(ps);
- shutdown(*ps, how);
- socket_setnonblocking(ps);
- }
-
- /*-------------------------------------------------------------------------*\
- * Creates and sets up a socket
- \*-------------------------------------------------------------------------*/
- int socket_create(p_socket ps, int domain, int type, int protocol)
- {
- *ps = socket(domain, type, protocol);
- if (*ps != SOCKET_INVALID)
- return IO_DONE;
- else
- return errno;
- }
-
- /*-------------------------------------------------------------------------*\
- *
- \*-------------------------------------------------------------------------*/
- int socket_listen(p_socket ps, int backlog)
- {
- int err = IO_DONE;
- socket_setblocking(ps);
- if (listen(*ps, backlog))
- err = errno;
- socket_setnonblocking(ps);
- return err;
- }
-
- /*-------------------------------------------------------------------------*\
- * Binds or returns error message
- \*-------------------------------------------------------------------------*/
- int socket_bind(p_socket ps, SA *addr, socklen_t len)
- {
- int err = IO_DONE;
- socket_setblocking(ps);
- if (bind(*ps, addr, len) < 0)
- err = errno;
- socket_setnonblocking(ps);
- return err;
- }
-
- /*-------------------------------------------------------------------------*\
- * Connects or returns error message
- \*-------------------------------------------------------------------------*/
- int socket_connect(p_socket ps, SA *addr, socklen_t len, QT3DSU32 tm)
- {
- int err;
- /* avoid calling on closed sockets */
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- /* call connect until done or failed without being interrupted */
- do
- if (connect(*ps, addr, len) == 0)
- return IO_DONE;
- while ((err = errno) == EINTR);
- /* if connection failed immediately, return error code */
- if (err != EINPROGRESS && err != EAGAIN)
- return err;
- /* zero timeout case optimization */
- if (tm == 0)
- return IO_TIMEOUT;
- /* wait until we have the result of the connection attempt or timeout */
- err = socket_waitfd(ps, WAITFD_C, tm);
- if (err == IO_CLOSED) {
- if (recv(*ps, (char *)&err, 0, 0) == 0)
- return IO_DONE;
- else
- return errno;
- } else
- return err;
- }
-
- /*-------------------------------------------------------------------------*\
- * Accept with timeout
- \*-------------------------------------------------------------------------*/
- int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, QT3DSU32 tm)
- {
- SA daddr;
- socklen_t dlen = sizeof(daddr);
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- if (!addr)
- addr = &daddr;
- if (!len)
- len = &dlen;
- for (;;) {
- int err;
- if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID)
- return IO_DONE;
- err = errno;
- if (err == EINTR)
- continue;
- if (err != EAGAIN && err != ECONNABORTED)
- return err;
- if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE)
- return err;
- }
- /* can't reach here */
- return IO_UNKNOWN;
- }
-
- /*-------------------------------------------------------------------------*\
- * Send with timeout
- \*-------------------------------------------------------------------------*/
- int socket_send(p_socket ps, const char *data, size_t count, size_t *sent, QT3DSU32 tm)
- {
- int err;
- *sent = 0;
- /* avoid making system calls on closed sockets */
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- /* loop until we send something or we give up on error */
- for (;;) {
- long put = (long)send(*ps, data, count, 0);
- /* if we sent anything, we are done */
- if (put > 0) {
- *sent = put;
- return IO_DONE;
- }
- err = errno;
- /* send can't really return 0, but EPIPE means the connection was closed */
- if (put == 0 || err == EPIPE)
- return IO_CLOSED;
- /* we call was interrupted, just try again */
- if (err == EINTR)
- continue;
- /* if failed fatal reason, report error */
- if (err != EAGAIN)
- return err;
- /* wait until we can send something or we timeout */
- if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE)
- return err;
- }
- /* can't reach here */
- return IO_UNKNOWN;
- }
-
- /*-------------------------------------------------------------------------*\
- * Receive with timeout
- \*-------------------------------------------------------------------------*/
- int socket_recv(p_socket ps, char *data, size_t count, size_t *got, QT3DSU32 tm)
- {
- int err;
- *got = 0;
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- for (;;) {
- long taken = (long)recv(*ps, data, count, 0);
- if (taken > 0) {
- *got = taken;
- return IO_DONE;
- }
- err = errno;
- if (taken == 0)
- return IO_CLOSED;
- if (err == EINTR)
- continue;
- if (err != EAGAIN)
- return err;
- if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE)
- return err;
- }
- return IO_UNKNOWN;
- }
-
- int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp)
- {
- *hp = gethostbyaddr(addr, len, AF_INET);
- if (*hp)
- return IO_DONE;
- else if (h_errno)
- return h_errno;
- else if (errno)
- return errno;
- else
- return IO_UNKNOWN;
- }
-
- int socket_gethostbyname(const char *addr, struct hostent **hp)
- {
- *hp = gethostbyname(addr);
- if (*hp)
- return IO_DONE;
- else if (h_errno)
- return h_errno;
- else if (errno)
- return errno;
- else
- return IO_UNKNOWN;
- }
-
- /*-------------------------------------------------------------------------*\
- * Error translation functions
- * Make sure important error messages are standard
- \*-------------------------------------------------------------------------*/
- const char *socket_hoststrerror(int err)
- {
- if (err <= 0)
- return io_strerror(err);
- switch (err) {
- case HOST_NOT_FOUND:
- return "host not found";
- default:
- return hstrerror(err);
- }
- }
-
- const char *socket_strerror(int err)
- {
- if (err <= 0)
- return io_strerror(err);
- switch (err) {
- case EADDRINUSE:
- return "address already in use";
- case EISCONN:
- return "already connected";
- case EACCES:
- return "permission denied";
- case ECONNREFUSED:
- return "connection refused";
- case ECONNABORTED:
- return "closed";
- case ECONNRESET:
- return "closed";
- case ETIMEDOUT:
- return "timeout";
- default:
- return strerror(errno);
- }
- }
- }
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/linux/qt_attribution.json b/src/Runtime/ogl-runtime/src/foundation/linux/qt_attribution.json
deleted file mode 100644
index 3c3bed6b..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/linux/qt_attribution.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "Id": "qt3dslinuxinlineaos",
- "Name": "Qt3DSLinuxInlineAoS",
- "QDocModule": "qt3dstudio",
- "QtUsage": "Used by Qt3DStudio, Runtime component.",
-
- "License": "Other",
- "LicenseFile": "LICENSE.TXT",
- "Copyright": "Copyright (c) 2001 Intel Corporation."
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixAtomic.cpp b/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixAtomic.cpp
deleted file mode 100644
index c1ac3965..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixAtomic.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2001-2004 NovodeX AG.
-** Copyright (C) 2004-2008 AGEIA Technologies, Inc.
-** Copyright (C) 2008-2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAtomic.h"
-
-#define PAUSE() asm("nop")
-
-namespace qt3ds {
-namespace foundation {
-
- void *atomicCompareExchangePointer(volatile void **dest, void *exch, void *comp)
- {
- return __sync_val_compare_and_swap((void **)dest, comp, exch);
- }
-
- QT3DSI32 atomicCompareExchange(volatile QT3DSI32 *dest, QT3DSI32 exch, QT3DSI32 comp)
- {
- return __sync_val_compare_and_swap(dest, comp, exch);
- }
-
- QT3DSI32 atomicIncrement(volatile QT3DSI32 *val) { return __sync_add_and_fetch(val, 1); }
-
- QT3DSI32 atomicDecrement(volatile QT3DSI32 *val) { return __sync_sub_and_fetch(val, 1); }
-
- QT3DSI32 atomicAdd(volatile QT3DSI32 *val, QT3DSI32 delta) { return __sync_add_and_fetch(val, delta); }
-
- QT3DSI32 atomicMax(volatile QT3DSI32 *val, QT3DSI32 val2)
- {
- QT3DSI32 oldVal, newVal;
-
- do {
- PAUSE();
- oldVal = *val;
-
- if (val2 > oldVal)
- newVal = val2;
- else
- newVal = oldVal;
-
- } while (atomicCompareExchange(val, newVal, oldVal) != oldVal);
-
- return *val;
- }
-
- QT3DSI32 atomicExchange(volatile QT3DSI32 *val, QT3DSI32 val2)
- {
- QT3DSI32 newVal, oldVal;
-
- do {
- PAUSE();
- oldVal = *val;
- newVal = val2;
- } while (atomicCompareExchange(val, newVal, oldVal) != oldVal);
-
- return oldVal;
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixFPU.cpp b/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixFPU.cpp
deleted file mode 100644
index 59c9850d..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixFPU.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2001-2004 NovodeX AG.
-** Copyright (C) 2004-2008 AGEIA Technologies, Inc.
-** Copyright (C) 2008-2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSFPU.h"
-#include <fenv.h>
-
-#if !(defined(__CYGWIN__) || defined(PX_ANDROID))
-QT3DS_COMPILE_TIME_ASSERT(8 * sizeof(qt3ds::QT3DSU32) >= sizeof(fenv_t));
-#endif
-
-qt3ds::foundation::FPUGuard::FPUGuard()
-{
-#if defined(__CYGWIN__)
-#pragma message "FPUGuard::FPUGuard() is not implemented"
-#elif defined(PX_ANDROID)
-// not supported unless ARM_HARD_FLOAT is enabled.
-#else
- fegetenv(reinterpret_cast<fenv_t *>(mControlWords));
- fesetenv(FE_DFL_ENV);
-#endif
-}
-
-qt3ds::foundation::FPUGuard::~FPUGuard()
-{
-#if defined(__CYGWIN__)
-#pragma message "FPUGuard::~FPUGuard() is not implemented"
-#elif defined(PX_ANDROID)
-// not supported unless ARM_HARD_FLOAT is enabled.
-#else
- fesetenv(reinterpret_cast<fenv_t *>(mControlWords));
-#endif
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixMutex.cpp b/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixMutex.cpp
deleted file mode 100644
index bbc55829..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixMutex.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAtomic.h"
-
-#include <pthread.h>
-
-namespace qt3ds {
-namespace foundation {
-
- namespace {
- pthread_mutex_t *getMutex(MutexImpl *impl)
- {
- return reinterpret_cast<pthread_mutex_t *>(impl);
- }
- }
-
- MutexImpl::MutexImpl()
- {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(getMutex(this), &attr);
- pthread_mutexattr_destroy(&attr);
- }
-
- MutexImpl::~MutexImpl() { pthread_mutex_destroy(getMutex(this)); }
-
- bool MutexImpl::lock() { return !pthread_mutex_lock(getMutex(this)); }
-
- bool MutexImpl::trylock() { return !pthread_mutex_trylock(getMutex(this)); }
-
- bool MutexImpl::unlock() { return !pthread_mutex_unlock(getMutex(this)); }
-
- const QT3DSU32 MutexImpl::size = sizeof(pthread_mutex_t);
-
- class ReadWriteLockImpl
- {
- public:
- ReadWriteLockImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- pthread_mutex_t mutex;
- volatile int readerCounter;
- };
-
- ReadWriteLock::ReadWriteLock(NVAllocatorCallback &alloc)
- {
- mImpl = QT3DS_NEW(alloc, ReadWriteLockImpl)(alloc);
-
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&mImpl->mutex, &attr);
- pthread_mutexattr_destroy(&attr);
-
- mImpl->readerCounter = 0;
- }
-
- ReadWriteLock::~ReadWriteLock()
- {
- pthread_mutex_destroy(&mImpl->mutex);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- void ReadWriteLock::lockReader()
- {
- pthread_mutex_lock(&mImpl->mutex);
-
- atomicIncrement(&mImpl->readerCounter);
-
- pthread_mutex_unlock(&mImpl->mutex);
- }
-
- void ReadWriteLock::lockWriter()
- {
- pthread_mutex_lock(&mImpl->mutex);
-
- while (mImpl->readerCounter != 0)
- ;
- }
-
- void ReadWriteLock::unlockReader() { atomicDecrement(&mImpl->readerCounter); }
-
- void ReadWriteLock::unlockWriter() { pthread_mutex_unlock(&mImpl->mutex); }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSemaphore.cpp b/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSemaphore.cpp
deleted file mode 100644
index 90aab79a..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSemaphore.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSSemaphore.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <time.h>
-#include <sys/time.h>
-
-namespace qt3ds {
-namespace foundation {
-
- class SemaphoreImpl
- {
- public:
- SemaphoreImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- QT3DSU32 count;
- QT3DSU32 maxCount;
- };
-
- struct NVLinuxScopeLock
- {
- NVLinuxScopeLock(pthread_mutex_t &m)
- : mMutex(m)
- {
- pthread_mutex_lock(&mMutex);
- }
-
- ~NVLinuxScopeLock() { pthread_mutex_unlock(&mMutex); }
- private:
- pthread_mutex_t &mMutex;
- };
-
- Semaphore::Semaphore(NVAllocatorCallback &alloc, QT3DSU32 initialCount, QT3DSU32 maxCount)
- {
- mImpl = QT3DS_NEW(alloc, SemaphoreImpl)(alloc);
- int status = pthread_mutex_init(&mImpl->mutex, 0);
- QT3DS_ASSERT(!status);
- status = pthread_cond_init(&mImpl->cond, 0);
- QT3DS_ASSERT(!status);
- mImpl->count = initialCount;
- mImpl->maxCount = maxCount;
- QT3DS_ASSERT(initialCount <= maxCount);
- }
-
- Semaphore::~Semaphore()
- {
- pthread_cond_destroy(&mImpl->cond);
- pthread_mutex_destroy(&mImpl->mutex);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- bool Semaphore::wait(QT3DSU32 milliseconds)
- {
- NVLinuxScopeLock lock(mImpl->mutex);
-
- if (mImpl->count > 0) {
- mImpl->count--;
- return true;
- }
-
- if (milliseconds == 0) {
- return false;
- }
-
- if (milliseconds == QT3DSU32(-1)) {
- int status = pthread_cond_wait(&mImpl->cond, &mImpl->mutex);
- QT3DS_ASSERT(!status);
- (void)status;
- } else {
- timespec ts;
- timeval tp;
- gettimeofday(&tp, NULL);
- QT3DSU32 sec = milliseconds / 1000;
- QT3DSU32 usec = (milliseconds - 1000 * sec) * 1000;
-
- // sschirm: taking into account that us might accumulate to a second
- // otherwise the pthread_cond_timedwait complains on osx.
- usec = tp.tv_usec + usec;
- QT3DSU32 div_sec = usec / 1000000;
- QT3DSU32 rem_usec = usec - div_sec * 1000000;
-
- ts.tv_sec = tp.tv_sec + sec + div_sec;
- ts.tv_nsec = rem_usec * 1000;
-
- int ierr = pthread_cond_timedwait(&mImpl->cond, &mImpl->mutex, &ts);
- QT3DS_ASSERT((ierr == 0) || (ierr == ETIMEDOUT));
- (void)ierr;
- return false;
- }
-
- return true;
- }
-
- void Semaphore::post()
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- mImpl->count++;
- if (mImpl->count > mImpl->maxCount)
- mImpl->count = mImpl->maxCount;
- else {
- pthread_cond_broadcast(&mImpl->cond);
- }
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSync.cpp b/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSync.cpp
deleted file mode 100644
index 52f9d7ab..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixSync.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <time.h>
-#include <sys/time.h>
-
-namespace qt3ds {
-namespace foundation {
-
- class SyncImpl
- {
- public:
- SyncImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- volatile bool is_set;
- };
-
- struct NVLinuxScopeLock
- {
- NVLinuxScopeLock(pthread_mutex_t &m)
- : mMutex(m)
- {
- pthread_mutex_lock(&mMutex);
- }
-
- ~NVLinuxScopeLock() { pthread_mutex_unlock(&mMutex); }
- private:
- pthread_mutex_t &mMutex;
- };
-
- Sync::Sync(NVAllocatorCallback &alloc)
- {
- mImpl = QT3DS_NEW(alloc, SyncImpl)(alloc);
- int status = pthread_mutex_init(&mImpl->mutex, 0);
- QT3DS_ASSERT(!status);
- status = pthread_cond_init(&mImpl->cond, 0);
- QT3DS_ASSERT(!status);
- mImpl->is_set = false;
- }
-
- Sync::~Sync()
- {
- pthread_cond_destroy(&mImpl->cond);
- pthread_mutex_destroy(&mImpl->mutex);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- void Sync::reset()
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- mImpl->is_set = false;
- }
-
- void Sync::set()
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- if (!mImpl->is_set) {
- mImpl->is_set = true;
- pthread_cond_broadcast(&mImpl->cond);
- }
- }
-
- bool Sync::wait(QT3DSU32 ms)
- {
- NVLinuxScopeLock lock(mImpl->mutex);
- if (!mImpl->is_set) {
- if (ms == QT3DSU32(-1)) {
- int status = pthread_cond_wait(&mImpl->cond, &mImpl->mutex);
- QT3DS_ASSERT(!status);
- (void)status;
- } else {
- timespec ts;
- timeval tp;
- gettimeofday(&tp, NULL);
- QT3DSU32 sec = ms / 1000;
- QT3DSU32 usec = (ms - 1000 * sec) * 1000;
-
- // sschirm: taking into account that us might accumulate to a second
- // otherwise the pthread_cond_timedwait complains on osx.
- usec = tp.tv_usec + usec;
- QT3DSU32 div_sec = usec / 1000000;
- QT3DSU32 rem_usec = usec - div_sec * 1000000;
-
- ts.tv_sec = tp.tv_sec + sec + div_sec;
- ts.tv_nsec = rem_usec * 1000;
-
- int ierr = pthread_cond_timedwait(&mImpl->cond, &mImpl->mutex, &ts);
- QT3DS_ASSERT((ierr == 0) || (ierr == ETIMEDOUT));
- (void)ierr;
- }
- }
- return mImpl->is_set;
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixTime.cpp b/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixTime.cpp
deleted file mode 100644
index 58eadcb6..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/macos/Qt3DSUnixTime.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2001-2004 NovodeX AG.
-** Copyright (C) 2004-2008 AGEIA Technologies, Inc.
-** Copyright (C) 2008-2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSTime.h"
-
-#include <time.h>
-#include <sys/time.h>
-
-#if defined QT3DS_APPLE
-#include <mach/mach_time.h>
-#endif
-
-// Use real-time high-precision timer.
-#ifndef QT3DS_APPLE
-#define CLOCKID CLOCK_REALTIME
-#endif
-
-namespace qt3ds {
-namespace foundation {
-
- const CounterFrequencyToTensOfNanos Time::sCounterFreq = Time::getCounterFrequency();
-
- static Time::Second getTimeSeconds()
- {
- static struct timeval _tv;
- gettimeofday(&_tv, NULL);
- return double(_tv.tv_sec) + double(_tv.tv_usec) * 0.000001;
- }
-
- Time::Time() { mLastTime = getTimeSeconds(); }
-
- Time::Second Time::getElapsedSeconds()
- {
- Time::Second curTime = getTimeSeconds();
- Time::Second diff = curTime - mLastTime;
- mLastTime = curTime;
- return diff;
- }
-
- Time::Second Time::peekElapsedSeconds()
- {
- Time::Second curTime = getTimeSeconds();
- Time::Second diff = curTime - mLastTime;
- return diff;
- }
-
- Time::Second Time::getLastTime() const { return mLastTime; }
-
-#ifdef QT3DS_APPLE
- CounterFrequencyToTensOfNanos Time::getCounterFrequency()
- {
- mach_timebase_info_data_t info;
- mach_timebase_info(&info);
- // mach_absolute_time * (info.numer/info.denom) is in units of nano seconds
- return CounterFrequencyToTensOfNanos(info.numer, info.denom * 10);
- }
-
- QT3DSU64 Time::getCurrentCounterValue() { return mach_absolute_time(); }
-
-#else
-
- CounterFrequencyToTensOfNanos Time::getCounterFrequency()
- {
- return CounterFrequencyToTensOfNanos(1, 10);
- }
-
- PxU64 Time::getCurrentCounterValue()
- {
- struct timespec mCurrTimeInt;
- clock_gettime(CLOCKID, &mCurrTimeInt);
- // Convert to nanos as this doesn't cause a large divide here
- return (static_cast<PxU64>(mCurrTimeInt.tv_sec) * 1000000000)
- + (static_cast<PxU64>(mCurrTimeInt.tv_nsec));
- }
-#endif
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/qt_attribution.json b/src/Runtime/ogl-runtime/src/foundation/qt_attribution.json
deleted file mode 100644
index 537d8be3..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/qt_attribution.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "Id": "convertutf",
- "Name": "ConvertUTF",
- "QDocModule": "qt3dstudio",
- "QtUsage": "Used by Qt3DStudio, Studio and Runtime components.",
-
- "License": "Other",
- "LicenseFile": "LICENSE_CONVERTUTF.TXT",
- "Copyright": "Copyright 2001-2004 Unicode, Inc."
-}
-,
-{
- "Id": "socket",
- "Name": "Socket",
- "QDocModule": "qt3dstudio",
- "QtUsage": "Used by Qt3DStudio, Runtime component.",
-
- "License": "MIT license",
- "LicenseId": "MIT",
- "LicenseFile": "LICENCE_SOCKET.TXT",
- "Copyright": "Copyright (C) 2004-2013 Diego Nehab."
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/LICENSE.TXT b/src/Runtime/ogl-runtime/src/foundation/windows/LICENSE.TXT
deleted file mode 100644
index f40caef8..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/LICENSE.TXT
+++ /dev/null
@@ -1,7 +0,0 @@
- Copyright (c) 2001 Intel Corporation.
-
-Permition is granted to use, copy, distribute and prepare derivative works
-of this library for any purpose and without fee, provided, that the above
-copyright notice and this statement appear in all copies.
-Intel makes no representations about the suitability of this library for
-any purpose, and specifically disclaims all warranties.
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAoS.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAoS.h
deleted file mode 100644
index c654ec79..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAoS.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_WINDOWS_AOS_H
-#define QT3DS_WINDOWS_AOS_H
-
-// no includes here! this file should be included from NVcVecMath.h only!!!
-
-#if !COMPILE_VECTOR_INTRINSICS
-#error Vector intrinsics should not be included when using scalar implementation.
-#endif
-
-typedef __m128 FloatV;
-typedef __m128 Vec3V;
-typedef __m128 Vec4V;
-typedef __m128 BoolV;
-typedef __m128 VecU32V;
-typedef __m128 VecI32V;
-typedef __m128 VecU16V;
-typedef __m128 VecI16V;
-typedef __m128 VecU8V;
-typedef __m128 QuatV;
-
-#define FloatVArg FloatV &
-#define Vec3VArg Vec3V &
-#define Vec4VArg Vec4V &
-#define BoolVArg BoolV &
-#define VecU32VArg VecU32V &
-#define VecI32VArg VecI32V &
-#define VecU16VArg VecU16V &
-#define VecI16VArg VecI16V &
-#define VecU8VArg VecU8V &
-#define QuatVArg QuatV &
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat33V
-{
- Mat33V() {}
- Mat33V(const Vec3V &c0, const Vec3V &c1, const Vec3V &c2)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- {
- }
- Vec3V QT3DS_ALIGN(16, col0);
- Vec3V QT3DS_ALIGN(16, col1);
- Vec3V QT3DS_ALIGN(16, col2);
-} QT3DS_ALIGN_SUFFIX(16);
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat34V
-{
- Mat34V() {}
- Mat34V(const Vec3V &c0, const Vec3V &c1, const Vec3V &c2, const Vec3V &c3)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- , col3(c3)
- {
- }
- Vec3V QT3DS_ALIGN(16, col0);
- Vec3V QT3DS_ALIGN(16, col1);
- Vec3V QT3DS_ALIGN(16, col2);
- Vec3V QT3DS_ALIGN(16, col3);
-} QT3DS_ALIGN_SUFFIX(16);
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat43V
-{
- Mat43V() {}
- Mat43V(const Vec4V &c0, const Vec4V &c1, const Vec4V &c2)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- {
- }
- Vec4V QT3DS_ALIGN(16, col0);
- Vec4V QT3DS_ALIGN(16, col1);
- Vec4V QT3DS_ALIGN(16, col2);
-} QT3DS_ALIGN_SUFFIX(16);
-
-QT3DS_ALIGN_PREFIX(16)
-struct Mat44V
-{
- Mat44V() {}
- Mat44V(const Vec4V &c0, const Vec4V &c1, const Vec4V &c2, const Vec4V &c3)
- : col0(c0)
- , col1(c1)
- , col2(c2)
- , col3(c3)
- {
- }
- Vec4V QT3DS_ALIGN(16, col0);
- Vec4V QT3DS_ALIGN(16, col1);
- Vec4V QT3DS_ALIGN(16, col2);
- Vec4V QT3DS_ALIGN(16, col3);
-} QT3DS_ALIGN_SUFFIX(16);
-
-#endif // QT3DS_WINDOWS_AOS_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAtomic.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAtomic.cpp
deleted file mode 100644
index 4f95d3dd..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsAtomic.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/windows/Qt3DSWindowsInclude.h"
-#include "foundation/Qt3DSAtomic.h"
-
-namespace qt3ds {
-namespace foundation {
-
- QT3DSI32 atomicExchange(volatile QT3DSI32 *val, QT3DSI32 val2)
- {
- return (QT3DSI32)InterlockedExchange((volatile LONG *)val, (LONG)val2);
- }
-
- QT3DSI32 atomicCompareExchange(volatile QT3DSI32 *dest, QT3DSI32 exch, QT3DSI32 comp)
- {
- return (QT3DSI32)InterlockedCompareExchange((volatile LONG *)dest, exch, comp);
- }
-
- void *atomicCompareExchangePointer(volatile void **dest, void *exch, void *comp)
- {
- return InterlockedCompareExchangePointer((volatile PVOID *)dest, exch, comp);
- }
-
- QT3DSI32 atomicIncrement(volatile QT3DSI32 *val)
- {
- return (QT3DSI32)InterlockedIncrement((volatile LONG *)val);
- }
-
- QT3DSI32 atomicDecrement(volatile QT3DSI32 *val)
- {
- return (QT3DSI32)InterlockedDecrement((volatile LONG *)val);
- }
-
- QT3DSI32 atomicAdd(volatile QT3DSI32 *val, QT3DSI32 delta)
- {
- LONG newValue, oldValue;
- do {
- oldValue = *val;
- newValue = oldValue + delta;
- } while (InterlockedCompareExchange((volatile LONG *)val, newValue, oldValue) != oldValue);
-
- return newValue;
- }
-
- QT3DSI32 atomicMax(volatile QT3DSI32 *val, QT3DSI32 val2)
- {
- // Could do this more efficiently in asm...
-
- LONG newValue, oldValue;
-
- do {
- oldValue = *val;
-
- if (val2 > oldValue)
- newValue = val2;
- else
- newValue = oldValue;
-
- } while (InterlockedCompareExchange((volatile LONG *)val, newValue, oldValue) != oldValue);
-
- return newValue;
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFPU.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFPU.cpp
deleted file mode 100644
index 47242801..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFPU.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "foundation/Qt3DSFPU.h"
-#include "float.h"
-
-#ifdef QT3DS_X64
-#define _MCW_ALL _MCW_DN | _MCW_EM | _MCW_RC
-#else
-#define _MCW_ALL _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC
-#endif
-
-qt3ds::foundation::FPUGuard::FPUGuard()
-{
-// default plus FTZ and DAZ
-#if defined(QT3DS_WINDOWS) && defined(QT3DS_VC)
-#ifdef QT3DS_X64
- _controlfp_s(mControlWords, _CW_DEFAULT | _DN_FLUSH, _MCW_ALL);
-#else
- __control87_2(_CW_DEFAULT | _DN_FLUSH, _MCW_ALL, mControlWords, mControlWords + 1);
-#endif
-#endif
-}
-
-qt3ds::foundation::FPUGuard::~FPUGuard()
-{
-#if defined(QT3DS_WINDOWS) && defined(QT3DS_VC)
-#ifdef QT3DS_X64
- _controlfp_s(mControlWords, *mControlWords, _MCW_ALL);
-#else
- __control87_2(mControlWords[0], _MCW_ALL, mControlWords, 0);
- __control87_2(mControlWords[1], _MCW_ALL, 0, mControlWords + 1);
-#endif
-#endif
-}
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFile.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFile.h
deleted file mode 100644
index 6c232a54..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsFile.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_WINDOWS_FILE_H
-#define QT3DS_FOUNDATION_QT3DS_WINDOWS_FILE_H
-
-#include "foundation/Qt3DS.h"
-
-#include <stdio.h>
-
-namespace qt3ds {
-namespace foundation {
- QT3DS_INLINE errno_t fopen_s(FILE **_File, const char *_Filename, const char *_Mode)
- {
- return ::fopen_s(_File, _Filename, _Mode);
- };
-
-} // namespace foundation
-} // namespace qt3ds
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInclude.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInclude.h
deleted file mode 100644
index f01c9f1a..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInclude.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef WINDOWSINCLUDE_H
-#define WINDOWSINCLUDE_H
-
-#include "foundation/Qt3DS.h"
-
-#ifndef _WIN32
-#error "This file should only be included by Windows builds!!"
-#endif
-
-#ifdef _WINDOWS_ // windows already included
-#error "Only include windows.h through this file!!"
-#endif
-
-// We only support >= Windows XP, and we need this for critical section and
-#define _WIN32_WINNT 0x0500
-
-// turn off as much as we can for windows. All we really need is the thread functions(critical
-// sections/Interlocked* etc)
-#define NOGDICAPMASKS
-#define NOVIRTUALKEYCODES
-#define NOWINMESSAGES
-#define NOWINSTYLES
-#define NOSYSMETRICS
-#define NOMENUS
-#define NOICONS
-#define NOKEYSTATES
-#define NOSYSCOMMANDS
-#define NORASTEROPS
-#define NOSHOWWINDOW
-#define NOATOM
-#define NOCLIPBOARD
-#define NOCOLOR
-#define NOCTLMGR
-#define NODRAWTEXT
-#define NOGDI
-#define NOUSER
-#define NONLS
-#define NOMB
-#define NOMEMMGR
-#define NOMETAFILE
-#define NOMSG
-#define NOOPENFILE
-#define NOSCROLL
-#define NOSERVICE
-#define NOSOUND
-#define NOTEXTMETRIC
-#define NOWH
-#define NOWINOFFSETS
-#define NOCOMM
-#define NOKANJI
-#define NOHELP
-#define NOPROFILER
-#define NODEFERWINDOWPOS
-#define NOMCX
-#define WIN32_LEAN_AND_MEAN
-
-#include <windows.h>
-
-#ifdef QT3DS_SUPPORT_SSE
-#include <xmmintrin.h>
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInlineAoS.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInlineAoS.h
deleted file mode 100644
index 60c57894..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsInlineAoS.h
+++ /dev/null
@@ -1,2715 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// Copyright (c) 2001 Intel Corporation.
-//
-// Permition is granted to use, copy, distribute and prepare derivative works
-// of this library for any purpose and without fee, provided, that the above
-// copyright notice and this statement appear in all copies.
-// Intel makes no representations about the suitability of this library for
-// any purpose, and specifically disclaims all warranties.
-// See LEGAL.TXT for all the legal information.
-//
-
-#ifndef QT3DS_WINDOWS_INLINE_AOS_H
-#define QT3DS_WINDOWS_INLINE_AOS_H
-
-#if !COMPILE_VECTOR_INTRINSICS
-#error Vector intrinsics should not be included when using scalar implementation.
-#endif
-
-// Remove this define when all platforms use simd solver.
-#define QT3DS_SUPPORT_SIMD
-
-QT3DS_FORCE_INLINE __m128 m128_I2F(__m128i n)
-{
- return _mm_castsi128_ps(n);
-}
-QT3DS_FORCE_INLINE __m128i m128_F2I(__m128 n)
-{
- return _mm_castps_si128(n);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAllTrue4_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return moveMask == (0xf);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAnyTrue4_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return moveMask != (0x0);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAllTrue3_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return (moveMask & 0x7) == (0x7);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAnyTrue3_R(const BoolV a)
-{
- const QT3DSI32 moveMask = _mm_movemask_ps(a);
- return (moveMask & 0x7) != (0x0);
-}
-
-/////////////////////////////////////////////////////////////////////
-////FUNCTIONS USED ONLY FOR ASSERTS IN VECTORISED IMPLEMENTATIONS
-/////////////////////////////////////////////////////////////////////
-
-QT3DS_FORCE_INLINE QT3DSU32 FiniteTestEq(const Vec4V a, const Vec4V b)
-{
- // This is a bit of a bodge.
- //_mm_comieq_ss returns 1 if either value is nan so we need to re-cast a and b with true encoded
- //as a non-nan number.
- // There must be a better way of doing this in sse.
- const BoolV one = FOne();
- const BoolV zero = FZero();
- const BoolV a1 = V4Sel(a, one, zero);
- const BoolV b1 = V4Sel(b, one, zero);
- return (_mm_comieq_ss(a1, b1) && _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(1, 1, 1, 1)),
- _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(1, 1, 1, 1)))
- && _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(2, 2, 2, 2)),
- _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(2, 2, 2, 2)))
- && _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(3, 3, 3, 3)),
- _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(3, 3, 3, 3))));
-}
-
-QT3DS_FORCE_INLINE bool isValidFloatV(const FloatV a)
-{
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)))
- && _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)))
- && _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3))));
-}
-
-QT3DS_FORCE_INLINE bool isValidVec3V(const Vec3V a)
-{
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3)), FZero()) ? true : false);
-}
-
-QT3DS_FORCE_INLINE bool isFiniteFloatV(const FloatV a)
-{
- const QT3DSU32 badNumber = (_FPCLASS_SNAN | _FPCLASS_QNAN | _FPCLASS_NINF | _FPCLASS_PINF);
- const FloatV vBadNum = FloatV_From_F32((QT3DSF32 &)badNumber);
- const BoolV vMask = BAnd(vBadNum, a);
- return FiniteTestEq(vMask, BFFFF()) == 1;
-}
-
-QT3DS_FORCE_INLINE bool isFiniteVec3V(const Vec3V a)
-{
- const QT3DSU32 badNumber = (_FPCLASS_SNAN | _FPCLASS_QNAN | _FPCLASS_NINF | _FPCLASS_PINF);
- const Vec3V vBadNum = Vec3V_From_F32((QT3DSF32 &)badNumber);
- const BoolV vMask = BAnd(BAnd(vBadNum, a), BTTTF());
- return FiniteTestEq(vMask, BFFFF()) == 1;
-}
-
-QT3DS_FORCE_INLINE bool isFiniteVec4V(const Vec4V a)
-{
- /*Vec4V a;
- QT3DS_ALIGN(16, QT3DSF32 f[4]);
- F32Array_Aligned_From_Vec4V(a, f);
- return NVIsFinite(f[0])
- && NVIsFinite(f[1])
- && NVIsFinite(f[2])
- && NVIsFinite(f[3]);*/
-
- const QT3DSU32 badNumber = (_FPCLASS_SNAN | _FPCLASS_QNAN | _FPCLASS_NINF | _FPCLASS_PINF);
- const Vec4V vBadNum = Vec4V_From_F32((QT3DSF32 &)badNumber);
- const BoolV vMask = BAnd(vBadNum, a);
-
- return FiniteTestEq(vMask, BFFFF()) == 1;
-}
-
-QT3DS_FORCE_INLINE bool hasZeroElementinFloatV(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)), FZero()) ? true : false);
-}
-
-QT3DS_FORCE_INLINE bool hasZeroElementInVec3V(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)), FZero())
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)), FZero())
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)), FZero()));
-}
-
-QT3DS_FORCE_INLINE bool hasZeroElementInVec4V(const Vec4V a)
-{
- return (_mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)), FZero())
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)), FZero())
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)), FZero())
- || _mm_comieq_ss(_mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3)), FZero()));
-}
-
-/////////////////////////////////////////////////////////////////////
-////VECTORISED FUNCTION IMPLEMENTATIONS
-/////////////////////////////////////////////////////////////////////
-
-QT3DS_FORCE_INLINE FloatV FloatV_From_F32(const QT3DSF32 f)
-{
- return (_mm_load1_ps(&f));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_F32(const QT3DSF32 f)
-{
- return _mm_set_ps(0.0f, f, f, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_F32(const QT3DSF32 f)
-{
- return (_mm_load1_ps(&f));
-}
-
-QT3DS_FORCE_INLINE BoolV BoolV_From_Bool32(const bool f)
-{
- const QT3DSU32 i = -(QT3DSI32)f;
- return _mm_load1_ps((float *)&i);
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_NVVec3_Aligned(const QT3DSVec3 &f)
-{
- VECMATHAOS_ASSERT(0 == ((size_t)&f & 0x0f));
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_NVVec3(const QT3DSVec3 &f)
-{
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_NVVec3_WUndefined(const QT3DSVec3 &f)
-{
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_Vec4V(Vec4V v)
-{
- return V4SetW(v, V4Zero());
-}
-
-QT3DS_FORCE_INLINE Vec3V Vec3V_From_F32Array_Aligned(const QT3DSF32 *const f)
-{
- VECMATHAOS_ASSERT(0 == ((QT3DSU64)f & 0x0f));
- return (_mm_load_ps(f));
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_Vec3V(Vec3V f)
-{
- return f; // ok if it is implemented as the same type.
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_NVVec3_WUndefined(const QT3DSVec3 &f)
-{
- return (_mm_set_ps(0.0f, f.z, f.y, f.x));
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_F32Array_Aligned(const QT3DSF32 *const f)
-{
- VECMATHAOS_ASSERT(0 == ((QT3DSU64)f & 0x0f));
- return (_mm_load_ps(f));
-}
-
-QT3DS_FORCE_INLINE void F32Array_Aligned_From_Vec4V(const Vec4V a, QT3DSF32 *f)
-{
- VECMATHAOS_ASSERT(0 == ((QT3DSU64)f & 0x0f));
- _mm_store_ps(f, a);
-}
-
-QT3DS_FORCE_INLINE void NVU32Array_Aligned_From_BoolV(const BoolV a, QT3DSU32 *f)
-{
- VECMATHAOS_ASSERT(0 == ((QT3DSU64)f & 0x0f));
- _mm_store_ps((QT3DSF32 *)f, a);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_F32Array(const QT3DSF32 *const f)
-{
- return (_mm_loadu_ps(f));
-}
-
-QT3DS_FORCE_INLINE BoolV BoolV_From_Bool32Array(const bool *const f)
-{
- const QT3DS_ALIGN(16, QT3DSU32 b[4]) = { -(QT3DSI32)f[0], -(QT3DSI32)f[1], -(QT3DSI32)f[2], -(QT3DSI32)f[3] };
- return _mm_load1_ps((float *)&b);
-}
-
-QT3DS_FORCE_INLINE QT3DSF32 NVF32_From_FloatV(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- QT3DSF32 f;
- _mm_store_ss(&f, a);
- return f;
-}
-
-QT3DS_FORCE_INLINE void NVF32_From_FloatV(const FloatV a, QT3DSF32 *QT3DS_RESTRICT f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- _mm_store_ss(f, a);
-}
-
-QT3DS_FORCE_INLINE void NVVec3Aligned_From_Vec3V(const Vec3V a, QT3DSVec3 &f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(0 == ((int)&a & 0x0F));
- VECMATHAOS_ASSERT(0 == ((int)&f & 0x0F));
- QT3DS_ALIGN(16, QT3DSF32 f2[4]);
- _mm_store_ps(f2, a);
- f = QT3DSVec3(f2[0], f2[1], f2[2]);
-}
-
-QT3DS_FORCE_INLINE void Store_From_BoolV(const BoolV b, QT3DSU32 *b2)
-{
- _mm_store_ss((QT3DSF32 *)b2, b);
-}
-
-QT3DS_FORCE_INLINE void NVVec3_From_Vec3V(const Vec3V a, QT3DSVec3 &f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(0 == ((int)&a & 0x0F));
- QT3DS_ALIGN(16, QT3DSF32 f2[4]);
- _mm_store_ps(f2, a);
- f = QT3DSVec3(f2[0], f2[1], f2[2]);
-}
-
-QT3DS_FORCE_INLINE Mat33V Mat33V_From_NVMat33(const QT3DSMat33 &m)
-{
- return Mat33V(Vec3V_From_NVVec3(m.column0), Vec3V_From_NVVec3(m.column1),
- Vec3V_From_NVVec3(m.column2));
-}
-
-QT3DS_FORCE_INLINE void NVMat33_From_Mat33V(const Mat33V &m, QT3DSMat33 &out)
-{
- QT3DS_ASSERT((size_t(&out) & 15) == 0);
- NVVec3_From_Vec3V(m.col0, out.column0);
- NVVec3_From_Vec3V(m.col1, out.column1);
- NVVec3_From_Vec3V(m.col2, out.column2);
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualFloatV(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return (_mm_comieq_ss(a, b) != 0);
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualVec3V(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return V3AllEq(a, b) != 0;
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualVec4V(const Vec4V a, const Vec4V b)
-{
- return V4AllEq(a, b) != 0;
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsEqualBoolV(const BoolV a, const BoolV b)
-{
- return BAllTrue4_R(VecI32V_IsEq(a, b)) != 0;
-}
-
-#define VECMATH_AOS_EPSILON (1e-3f)
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsNearEqualFloatV(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- const FloatV c = FSub(a, b);
- static const FloatV minError = FloatV_From_F32(-VECMATH_AOS_EPSILON);
- static const FloatV maxError = FloatV_From_F32(VECMATH_AOS_EPSILON);
- return (_mm_comigt_ss(c, minError) && _mm_comilt_ss(c, maxError));
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsNearEqualVec3V(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- const Vec3V c = V3Sub(a, b);
- static const Vec3V minError = Vec3V_From_F32(-VECMATH_AOS_EPSILON);
- static const Vec3V maxError = Vec3V_From_F32(VECMATH_AOS_EPSILON);
- return (_mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), maxError));
-}
-
-QT3DS_FORCE_INLINE bool _VecMathTests::allElementsNearEqualVec4V(const Vec4V a, const Vec4V b)
-{
- const Vec4V c = V4Sub(a, b);
- static const Vec4V minError = Vec4V_From_F32(-VECMATH_AOS_EPSILON);
- static const Vec4V maxError = Vec4V_From_F32(VECMATH_AOS_EPSILON);
- return (_mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2)), maxError)
- && _mm_comigt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3)), minError)
- && _mm_comilt_ss(_mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3)), maxError));
-}
-
-//////////////////////////////////
-// FLOATV
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE FloatV FZero()
-{
- return FloatV_From_F32(0.0f);
-}
-
-QT3DS_FORCE_INLINE FloatV FOne()
-{
- return FloatV_From_F32(1.0f);
-}
-
-QT3DS_FORCE_INLINE FloatV FHalf()
-{
- return FloatV_From_F32(0.5f);
-}
-
-QT3DS_FORCE_INLINE FloatV FEps()
-{
- return FloatV_From_F32(QT3DS_ENV_REAL);
-}
-
-QT3DS_FORCE_INLINE FloatV FEps6()
-{
- return FloatV_From_F32(1e-6f);
-}
-
-QT3DS_FORCE_INLINE FloatV FMax()
-{
- return FloatV_From_F32(QT3DS_MAX_REAL);
-}
-
-QT3DS_FORCE_INLINE FloatV FNegMax()
-{
- return FloatV_From_F32(-QT3DS_MAX_REAL);
-}
-
-QT3DS_FORCE_INLINE FloatV IZero()
-{
- const QT3DSU32 zero = 0;
- return _mm_load1_ps((QT3DSF32 *)&zero);
-}
-
-QT3DS_FORCE_INLINE FloatV IOne()
-{
- const QT3DSU32 one = 1;
- return _mm_load1_ps((QT3DSF32 *)&one);
-}
-
-QT3DS_FORCE_INLINE FloatV ITwo()
-{
- const QT3DSU32 two = 2;
- return _mm_load1_ps((QT3DSF32 *)&two);
-}
-
-QT3DS_FORCE_INLINE FloatV IThree()
-{
- const QT3DSU32 three = 3;
- return _mm_load1_ps((QT3DSF32 *)&three);
-}
-
-QT3DS_FORCE_INLINE FloatV IFour()
-{
- QT3DSU32 four = 4;
- return _mm_load1_ps((QT3DSF32 *)&four);
-}
-
-QT3DS_FORCE_INLINE FloatV FNeg(const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return _mm_sub_ps(_mm_setzero_ps(), f);
-}
-
-QT3DS_FORCE_INLINE FloatV FAdd(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_add_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FSub(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_sub_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FMul(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FDiv(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FDivFast(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE FloatV FRecip(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return _mm_div_ps(FOne(), a);
-}
-
-QT3DS_FORCE_INLINE FloatV FRecipFast(const FloatV a)
-{
- return _mm_rcp_ps(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FRsqrt(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return _mm_div_ps(FOne(), _mm_sqrt_ps(a));
-}
-
-QT3DS_FORCE_INLINE FloatV FSqrt(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- return _mm_sqrt_ps(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FRsqrtFast(const FloatV a)
-{
- return _mm_rsqrt_ps(a);
-}
-
-QT3DS_FORCE_INLINE FloatV FScaleAdd(const FloatV a, const FloatV b, const FloatV c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidFloatV(c));
- return FAdd(FMul(a, b), c);
-}
-
-QT3DS_FORCE_INLINE FloatV FNegScaleSub(const FloatV a, const FloatV b, const FloatV c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidFloatV(c));
- return FSub(c, FMul(a, b));
-}
-
-QT3DS_FORCE_INLINE FloatV FAbs(const FloatV a)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- QT3DS_ALIGN(16, const static QT3DSU32 absMask[4]) = { 0x7fFFffFF, 0x7fFFffFF, 0x7fFFffFF,
- 0x7fFFffFF };
- return _mm_and_ps(a, _mm_load_ps((QT3DSF32 *)absMask));
-}
-
-QT3DS_FORCE_INLINE FloatV FSel(const BoolV c, const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(_VecMathTests::allElementsEqualBoolV(c, BTTTT())
- || _VecMathTests::allElementsEqualBoolV(c, BFFFF()));
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_or_ps(_mm_andnot_ps(c, b), _mm_and_ps(c, a));
-}
-
-QT3DS_FORCE_INLINE BoolV FIsGrtr(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_cmpgt_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV FIsGrtrOrEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_cmpge_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV FIsEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FMax(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_max_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FMin(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_min_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE FloatV FClamp(const FloatV a, const FloatV minV, const FloatV maxV)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(minV));
- VECMATHAOS_ASSERT(isValidFloatV(maxV));
- return FMax(FMin(a, maxV), minV);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FAllGrtr(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return (_mm_comigt_ss(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FAllGrtrOrEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
-
- return (_mm_comige_ss(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FAllEq(const FloatV a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
-
- return (_mm_comieq_ss(a, b));
-}
-
-QT3DS_FORCE_INLINE FloatV FRound(const FloatV a)
-{
- // return _mm_round_ps(a, 0x0);
- const Vec3V half = Vec3V_From_F32(0.5f);
- const Vec3V aPlusHalf = V3Add(a, half);
- __m128i tmp = _mm_cvttps_epi32(aPlusHalf);
- return _mm_cvtepi32_ps(tmp);
-}
-
-QT3DS_FORCE_INLINE FloatV FSin(const FloatV a)
-{
- // Vec4V V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- // Vec4V S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- FloatV Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const FloatV twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const FloatV tmp = FMul(a, twoPi);
- const FloatV b = FRound(tmp);
- const FloatV V1 = FNegMulSub(twoPi, b, a);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- const FloatV V2 = FMul(V1, V1);
- const FloatV V3 = FMul(V2, V1);
- const FloatV V5 = FMul(V3, V2);
- const FloatV V7 = FMul(V5, V2);
- const FloatV V9 = FMul(V7, V2);
- const FloatV V11 = FMul(V9, V2);
- const FloatV V13 = FMul(V11, V2);
- const FloatV V15 = FMul(V13, V2);
- const FloatV V17 = FMul(V15, V2);
- const FloatV V19 = FMul(V17, V2);
- const FloatV V21 = FMul(V19, V2);
- const FloatV V23 = FMul(V21, V2);
-
- const Vec4V sinCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients0.f);
- const Vec4V sinCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients1.f);
- const Vec4V sinCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients2.f);
-
- const FloatV S1 = V4GetY(sinCoefficients0);
- const FloatV S2 = V4GetZ(sinCoefficients0);
- const FloatV S3 = V4GetW(sinCoefficients0);
- const FloatV S4 = V4GetX(sinCoefficients1);
- const FloatV S5 = V4GetY(sinCoefficients1);
- const FloatV S6 = V4GetZ(sinCoefficients1);
- const FloatV S7 = V4GetW(sinCoefficients1);
- const FloatV S8 = V4GetX(sinCoefficients2);
- const FloatV S9 = V4GetY(sinCoefficients2);
- const FloatV S10 = V4GetZ(sinCoefficients2);
- const FloatV S11 = V4GetW(sinCoefficients2);
-
- Result = FMulAdd(S1, V3, V1);
- Result = FMulAdd(S2, V5, Result);
- Result = FMulAdd(S3, V7, Result);
- Result = FMulAdd(S4, V9, Result);
- Result = FMulAdd(S5, V11, Result);
- Result = FMulAdd(S6, V13, Result);
- Result = FMulAdd(S7, V15, Result);
- Result = FMulAdd(S8, V17, Result);
- Result = FMulAdd(S9, V19, Result);
- Result = FMulAdd(S10, V21, Result);
- Result = FMulAdd(S11, V23, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE FloatV FCos(const FloatV a)
-{
- // XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- // XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- FloatV Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const FloatV twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const FloatV tmp = FMul(a, twoPi);
- const FloatV b = FRound(tmp);
- const FloatV V1 = FNegMulSub(twoPi, b, a);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- const FloatV V2 = FMul(V1, V1);
- const FloatV V4 = FMul(V2, V2);
- const FloatV V6 = FMul(V4, V2);
- const FloatV V8 = FMul(V4, V4);
- const FloatV V10 = FMul(V6, V4);
- const FloatV V12 = FMul(V6, V6);
- const FloatV V14 = FMul(V8, V6);
- const FloatV V16 = FMul(V8, V8);
- const FloatV V18 = FMul(V10, V8);
- const FloatV V20 = FMul(V10, V10);
- const FloatV V22 = FMul(V12, V10);
-
- const Vec4V cosCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients0.f);
- const Vec4V cosCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients1.f);
- const Vec4V cosCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients2.f);
-
- const FloatV C1 = V4GetY(cosCoefficients0);
- const FloatV C2 = V4GetZ(cosCoefficients0);
- const FloatV C3 = V4GetW(cosCoefficients0);
- const FloatV C4 = V4GetX(cosCoefficients1);
- const FloatV C5 = V4GetY(cosCoefficients1);
- const FloatV C6 = V4GetZ(cosCoefficients1);
- const FloatV C7 = V4GetW(cosCoefficients1);
- const FloatV C8 = V4GetX(cosCoefficients2);
- const FloatV C9 = V4GetY(cosCoefficients2);
- const FloatV C10 = V4GetZ(cosCoefficients2);
- const FloatV C11 = V4GetW(cosCoefficients2);
-
- Result = FMulAdd(C1, V2, V4One());
- Result = FMulAdd(C2, V4, Result);
- Result = FMulAdd(C3, V6, Result);
- Result = FMulAdd(C4, V8, Result);
- Result = FMulAdd(C5, V10, Result);
- Result = FMulAdd(C6, V12, Result);
- Result = FMulAdd(C7, V14, Result);
- Result = FMulAdd(C8, V16, Result);
- Result = FMulAdd(C9, V18, Result);
- Result = FMulAdd(C10, V20, Result);
- Result = FMulAdd(C11, V22, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FOutOfBounds(const FloatV a, const FloatV min, const FloatV max)
-{
- const BoolV ffff = BFFFF();
- const BoolV c = BOr(FIsGrtr(a, max), FIsGrtr(min, a));
- return !BAllEq(c, ffff);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FInBounds(const FloatV a, const FloatV min, const FloatV max)
-{
- const BoolV tttt = BTTTT();
- const BoolV c = BAnd(FIsGrtrOrEq(a, min), FIsGrtrOrEq(max, a));
- return BAllEq(c, tttt);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FOutOfBounds(const FloatV a, const FloatV bounds)
-{
- return FOutOfBounds(a, FNeg(bounds), bounds);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 FInBounds(const FloatV a, const FloatV bounds)
-{
- return FInBounds(a, FNeg(bounds), bounds);
-}
-
-//////////////////////////////////
-// VEC3V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec3V V3Splat(const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- const __m128 zero = V3Zero();
- const __m128 fff0 = _mm_move_ss(f, zero);
- return _mm_shuffle_ps(fff0, fff0, _MM_SHUFFLE(0, 1, 2, 3));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Merge(const FloatVArg x, const FloatVArg y, const FloatVArg z)
-{
- VECMATHAOS_ASSERT(isValidFloatV(x));
- VECMATHAOS_ASSERT(isValidFloatV(y));
- VECMATHAOS_ASSERT(isValidFloatV(z));
- // static on zero causes compiler crash on x64 debug_opt
- const __m128 zero = V3Zero();
- const __m128 xy = _mm_move_ss(x, y);
- const __m128 z0 = _mm_move_ss(zero, z);
-
- return _mm_shuffle_ps(xy, z0, _MM_SHUFFLE(1, 0, 0, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3UnitX()
-{
- const QT3DS_ALIGN(16, QT3DSF32 x[4]) = { 1.0f, 0.0f, 0.0f, 0.0f };
- const __m128 x128 = _mm_load_ps(x);
- return x128;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3UnitY()
-{
- const QT3DS_ALIGN(16, QT3DSF32 y[4]) = { 0.0f, 1.0f, 0.0f, 0.0f };
- const __m128 y128 = _mm_load_ps(y);
- return y128;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3UnitZ()
-{
- const QT3DS_ALIGN(16, QT3DSF32 z[4]) = { 0.0f, 0.0f, 1.0f, 0.0f };
- const __m128 z128 = _mm_load_ps(z);
- return z128;
-}
-
-QT3DS_FORCE_INLINE FloatV V3GetX(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE FloatV V3GetY(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(1, 1, 1, 1));
-}
-
-QT3DS_FORCE_INLINE FloatV V3GetZ(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(2, 2, 2, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3SetX(const Vec3V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V3Sel(BFTTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3SetY(const Vec3V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V3Sel(BTFTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3SetZ(const Vec3V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V3Sel(BTTFT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ColX(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- Vec3V r = _mm_shuffle_ps(a, c, _MM_SHUFFLE(3, 0, 3, 0));
- return V3SetY(r, V3GetX(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ColY(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- Vec3V r = _mm_shuffle_ps(a, c, _MM_SHUFFLE(3, 1, 3, 1));
- return V3SetY(r, V3GetY(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ColZ(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- Vec3V r = _mm_shuffle_ps(a, c, _MM_SHUFFLE(3, 2, 3, 2));
- return V3SetY(r, V3GetZ(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Zero()
-{
- return Vec3V_From_F32(0.0f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3One()
-{
- return Vec3V_From_F32(1.0f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Eps()
-{
- return Vec3V_From_F32(QT3DS_ENV_REAL);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Neg(const Vec3V f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(f));
- return _mm_sub_ps(_mm_setzero_ps(), f);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Add(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_add_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Sub(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_sub_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Scale(const Vec3V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Mul(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ScaleInv(const Vec3V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Div(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- // why are these here?
- // static const __m128 one=V3One();
- // static const __m128 tttf=BTTTF();
- // const __m128 b1=V3Sel(tttf,b,one);
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ScaleInvFast(const Vec3V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3DivFast(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- const __m128 one = V3One();
- const __m128 tttf = BTTTF();
- const __m128 b1 = V3Sel(tttf, b, one);
- return _mm_mul_ps(a, _mm_rcp_ps(b1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Recip(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 tttf = BTTTF();
- const __m128 recipA = _mm_div_ps(V3One(), a);
- return V3Sel(tttf, recipA, zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3RecipFast(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 tttf = BTTTF();
- const __m128 recipA = _mm_rcp_ps(a);
- return V3Sel(tttf, recipA, zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Rsqrt(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 tttf = BTTTF();
- const __m128 recipA = _mm_div_ps(V3One(), _mm_sqrt_ps(a));
- return V3Sel(tttf, recipA, zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3RsqrtFast(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 tttf = BTTTF();
- const __m128 recipA = _mm_rsqrt_ps(a);
- return V3Sel(tttf, recipA, zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3ScaleAdd(const Vec3V a, const FloatV b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Add(V3Scale(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NegScaleSub(const Vec3V a, const FloatV b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidFloatV(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Sub(c, V3Scale(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3MulAdd(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Add(V3Mul(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NegMulSub(const Vec3V a, const Vec3V b, const Vec3V c)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- VECMATHAOS_ASSERT(isValidVec3V(c));
- return V3Sub(c, V3Mul(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Abs(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Max(a, V3Neg(a));
-}
-
-QT3DS_FORCE_INLINE FloatV V3Dot(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- __m128 dot1 = _mm_mul_ps(a, b); // w,z,y,x
- //__m128 shuf1 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(2,1,0,3)); //z,y,x,w
- //__m128 shuf2 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(1,0,3,2)); //y,x,w,z
- //__m128 shuf3 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(0,3,2,1)); //x,w,z,y
- // return _mm_add_ps(_mm_add_ps(shuf2, shuf3), _mm_add_ps(dot1,shuf1));
-
- __m128 shuf1 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(0, 0, 0, 0)); // z,y,x,w
- __m128 shuf2 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(1, 1, 1, 1)); // y,x,w,z
- __m128 shuf3 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(2, 2, 2, 2)); // x,w,z,y
- return _mm_add_ps(_mm_add_ps(shuf1, shuf2), shuf3);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Cross(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- __m128 l1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 2, 1)); // y,z,x,w
- __m128 l2 = _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 1, 0, 2)); // z,x,y,w
- __m128 r1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 1, 0, 2)); // z,x,y,w
- __m128 r2 = _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 0, 2, 1)); // y,z,x,w
- return _mm_sub_ps(_mm_mul_ps(l1, l2), _mm_mul_ps(r1, r2));
-}
-
-QT3DS_FORCE_INLINE FloatV V3Length(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_sqrt_ps(V3Dot(a, a));
-}
-
-QT3DS_FORCE_INLINE FloatV V3LengthSq(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Dot(a, a);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Normalize(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(V3Dot(a, a) != FZero())
- return V3ScaleInv(a, _mm_sqrt_ps(V3Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NormalizeFast(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return V3Mul(a, _mm_rsqrt_ps(V3Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3NormalizeSafe(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 eps = V3Eps();
- const __m128 length = V3Length(a);
- const __m128 isGreaterThanZero = FIsGrtr(length, eps);
- return V3Sel(isGreaterThanZero, V3ScaleInv(a, length), zero);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Sel(const BoolV c, const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_or_ps(_mm_andnot_ps(c, b), _mm_and_ps(c, a));
-}
-
-QT3DS_FORCE_INLINE BoolV V3IsGrtr(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_cmpgt_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V3IsGrtrOrEq(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_cmpge_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V3IsEq(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Max(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_max_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Min(const Vec3V a, const Vec3V b)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(b));
- return _mm_min_ps(a, b);
-}
-
-// Extract the maximum value from a
-QT3DS_FORCE_INLINE FloatV V3ExtractMax(const Vec3V a)
-{
- const __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0));
- const __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1));
- const __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2));
-
- return _mm_max_ps(_mm_max_ps(shuf1, shuf2), shuf3);
-}
-
-// Extract the maximum value from a
-QT3DS_FORCE_INLINE FloatV V3ExtractMin(const Vec3V a)
-{
- const __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0));
- const __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1));
- const __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2));
-
- return _mm_min_ps(_mm_min_ps(shuf1, shuf2), shuf3);
-}
-
-//// if(a > 0.0f) return 1.0f; else if a == 0.f return 0.f, else return -1.f;
-// QT3DS_FORCE_INLINE Vec3V V3MathSign(const Vec3V a)
-//{
-// VECMATHAOS_ASSERT(isValidVec3V(a));
-//
-// const __m128i ai = _mm_cvtps_epi32(a);
-// const __m128i bi = _mm_cvtps_epi32(V3Neg(a));
-// const __m128 aa = _mm_cvtepi32_ps(_mm_srai_epi32(ai, 31));
-// const __m128 bb = _mm_cvtepi32_ps(_mm_srai_epi32(bi, 31));
-// return _mm_or_ps(aa, bb);
-//}
-
-// return (a >= 0.0f) ? 1.0f : -1.0f;
-QT3DS_FORCE_INLINE Vec3V V3Sign(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- const __m128 zero = V3Zero();
- const __m128 one = V3One();
- const __m128 none = V3Neg(one);
- return V3Sel(V3IsGrtrOrEq(a, zero), one, none);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Clamp(const Vec3V a, const Vec3V minV, const Vec3V maxV)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(minV));
- VECMATHAOS_ASSERT(isValidVec3V(maxV));
- return V3Max(V3Min(a, maxV), minV);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3AllGrtr(const Vec3V a, const Vec3V b)
-{
- return BAllTrue3_R(V4IsGrtr(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3AllGrtrOrEq(const Vec3V a, const Vec3V b)
-{
- return BAllTrue3_R(V4IsGrtrOrEq(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3AllEq(const Vec3V a, const Vec3V b)
-{
- return BAllTrue3_R(V4IsEq(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Round(const Vec3V a)
-{
- // return _mm_round_ps(a, 0x0);
- const Vec3V half = Vec3V_From_F32(0.5f);
- const Vec3V aPlusHalf = V3Add(a, half);
- const __m128i tmp = _mm_cvttps_epi32(aPlusHalf);
- return _mm_cvtepi32_ps(tmp);
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Sin(const Vec3V a)
-{
- // Vec4V V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- // Vec4V S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- Vec3V Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const Vec3V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec3V tmp = V3Mul(a, twoPi);
- const Vec3V b = V3Round(tmp);
- const Vec3V V1 = V3NegMulSub(twoPi, b, a);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- const Vec3V V2 = V3Mul(V1, V1);
- const Vec3V V3 = V3Mul(V2, V1);
- const Vec3V V5 = V3Mul(V3, V2);
- const Vec3V V7 = V3Mul(V5, V2);
- const Vec3V V9 = V3Mul(V7, V2);
- const Vec3V V11 = V3Mul(V9, V2);
- const Vec3V V13 = V3Mul(V11, V2);
- const Vec3V V15 = V3Mul(V13, V2);
- const Vec3V V17 = V3Mul(V15, V2);
- const Vec3V V19 = V3Mul(V17, V2);
- const Vec3V V21 = V3Mul(V19, V2);
- const Vec3V V23 = V3Mul(V21, V2);
-
- const Vec4V sinCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients0.f);
- const Vec4V sinCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients1.f);
- const Vec4V sinCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients2.f);
-
- const FloatV S1 = V4GetY(sinCoefficients0);
- const FloatV S2 = V4GetZ(sinCoefficients0);
- const FloatV S3 = V4GetW(sinCoefficients0);
- const FloatV S4 = V4GetX(sinCoefficients1);
- const FloatV S5 = V4GetY(sinCoefficients1);
- const FloatV S6 = V4GetZ(sinCoefficients1);
- const FloatV S7 = V4GetW(sinCoefficients1);
- const FloatV S8 = V4GetX(sinCoefficients2);
- const FloatV S9 = V4GetY(sinCoefficients2);
- const FloatV S10 = V4GetZ(sinCoefficients2);
- const FloatV S11 = V4GetW(sinCoefficients2);
-
- Result = V3MulAdd(S1, V3, V1);
- Result = V3MulAdd(S2, V5, Result);
- Result = V3MulAdd(S3, V7, Result);
- Result = V3MulAdd(S4, V9, Result);
- Result = V3MulAdd(S5, V11, Result);
- Result = V3MulAdd(S6, V13, Result);
- Result = V3MulAdd(S7, V15, Result);
- Result = V3MulAdd(S8, V17, Result);
- Result = V3MulAdd(S9, V19, Result);
- Result = V3MulAdd(S10, V21, Result);
- Result = V3MulAdd(S11, V23, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Cos(const Vec3V a)
-{
- // XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- // XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- Vec3V Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- const Vec3V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec3V tmp = V3Mul(a, twoPi);
- const Vec3V b = V3Round(tmp);
- const Vec3V V1 = V3NegMulSub(twoPi, b, a);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- const Vec3V V2 = V3Mul(V1, V1);
- const Vec3V V4 = V3Mul(V2, V2);
- const Vec3V V6 = V3Mul(V4, V2);
- const Vec3V V8 = V3Mul(V4, V4);
- const Vec3V V10 = V3Mul(V6, V4);
- const Vec3V V12 = V3Mul(V6, V6);
- const Vec3V V14 = V3Mul(V8, V6);
- const Vec3V V16 = V3Mul(V8, V8);
- const Vec3V V18 = V3Mul(V10, V8);
- const Vec3V V20 = V3Mul(V10, V10);
- const Vec3V V22 = V3Mul(V12, V10);
-
- const Vec4V cosCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients0.f);
- const Vec4V cosCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients1.f);
- const Vec4V cosCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients2.f);
-
- const FloatV C1 = V4GetY(cosCoefficients0);
- const FloatV C2 = V4GetZ(cosCoefficients0);
- const FloatV C3 = V4GetW(cosCoefficients0);
- const FloatV C4 = V4GetX(cosCoefficients1);
- const FloatV C5 = V4GetY(cosCoefficients1);
- const FloatV C6 = V4GetZ(cosCoefficients1);
- const FloatV C7 = V4GetW(cosCoefficients1);
- const FloatV C8 = V4GetX(cosCoefficients2);
- const FloatV C9 = V4GetY(cosCoefficients2);
- const FloatV C10 = V4GetZ(cosCoefficients2);
- const FloatV C11 = V4GetW(cosCoefficients2);
-
- Result = V3MulAdd(C1, V2, V4One());
- Result = V3MulAdd(C2, V4, Result);
- Result = V3MulAdd(C3, V6, Result);
- Result = V3MulAdd(C4, V8, Result);
- Result = V3MulAdd(C5, V10, Result);
- Result = V3MulAdd(C6, V12, Result);
- Result = V3MulAdd(C7, V14, Result);
- Result = V3MulAdd(C8, V16, Result);
- Result = V3MulAdd(C9, V18, Result);
- Result = V3MulAdd(C10, V20, Result);
- Result = V3MulAdd(C11, V22, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermYZZ(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 2, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermXYX(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 1, 0));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermYZX(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a))
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 2, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermZXY(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 1, 0, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermZZY(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 1, 2, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3PermYXX(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 0, 1));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Perm_Zero_1Z_0Y(const Vec3V v0, const Vec3V v1)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v0));
- VECMATHAOS_ASSERT(isValidVec3V(v1));
- return _mm_shuffle_ps(v1, v0, _MM_SHUFFLE(3, 1, 2, 3));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Perm_0Z_Zero_1X(const Vec3V v0, const Vec3V v1)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v0));
- VECMATHAOS_ASSERT(isValidVec3V(v1));
- return _mm_shuffle_ps(v0, v1, _MM_SHUFFLE(3, 0, 3, 2));
-}
-
-QT3DS_FORCE_INLINE Vec3V V3Perm_1Y_0X_Zero(const Vec3V v0, const Vec3V v1)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v0));
- VECMATHAOS_ASSERT(isValidVec3V(v1));
- // There must be a better way to do this.
- Vec3V v2 = V3Zero();
- FloatV y1 = V3GetY(v1);
- FloatV x0 = V3GetX(v0);
- v2 = V3SetX(v2, y1);
- return V3SetY(v2, x0);
-}
-
-QT3DS_FORCE_INLINE FloatV V3SumElems(const Vec3V a)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
-
- __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0)); // z,y,x,w
- __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1)); // y,x,w,z
- __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)); // x,w,z,y
- return _mm_add_ps(_mm_add_ps(shuf1, shuf2), shuf3);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3OutOfBounds(const Vec3V a, const Vec3V min, const Vec3V max)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(min));
- VECMATHAOS_ASSERT(isValidVec3V(max));
- const BoolV ffff = BFFFF();
- const BoolV c = BOr(V3IsGrtr(a, max), V3IsGrtr(min, a));
- return !BAllEq(c, ffff);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3InBounds(const Vec3V a, const Vec3V min, const Vec3V max)
-{
- VECMATHAOS_ASSERT(isValidVec3V(a));
- VECMATHAOS_ASSERT(isValidVec3V(min));
- VECMATHAOS_ASSERT(isValidVec3V(max));
- const BoolV tttt = BTTTT();
- const BoolV c = BAnd(V3IsGrtrOrEq(a, min), V3IsGrtrOrEq(max, a));
- return BAllEq(c, tttt);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3OutOfBounds(const Vec3V a, const Vec3V bounds)
-{
- return V3OutOfBounds(a, V3Neg(bounds), bounds);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V3InBounds(const Vec3V a, const Vec3V bounds)
-{
- return V3InBounds(a, V3Neg(bounds), bounds);
-}
-
-//////////////////////////////////
-// VEC4V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec4V V4Splat(const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- // return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0,0,0,0));
- return f;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Merge(const FloatV *const floatVArray)
-{
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[0]));
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[1]));
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[2]));
- VECMATHAOS_ASSERT(isValidFloatV(floatVArray[3]));
- __m128 xw = _mm_move_ss(floatVArray[1], floatVArray[0]); // y, y, y, x
- __m128 yz = _mm_move_ss(floatVArray[2], floatVArray[3]); // z, z, z, w
- return (_mm_shuffle_ps(xw, yz, _MM_SHUFFLE(0, 2, 1, 0)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Merge(const FloatVArg x, const FloatVArg y, const FloatVArg z,
- const FloatVArg w)
-{
- VECMATHAOS_ASSERT(isValidFloatV(x));
- VECMATHAOS_ASSERT(isValidFloatV(y));
- VECMATHAOS_ASSERT(isValidFloatV(z));
- VECMATHAOS_ASSERT(isValidFloatV(w));
- __m128 xw = _mm_move_ss(y, x); // y, y, y, x
- __m128 yz = _mm_move_ss(z, w); // z, z, z, w
- return (_mm_shuffle_ps(xw, yz, _MM_SHUFFLE(0, 2, 1, 0)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitW()
-{
- const QT3DS_ALIGN(16, QT3DSF32 w[4]) = { 0.0f, 0.0f, 0.0f, 1.0f };
- const __m128 w128 = _mm_load_ps(w);
- return w128;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitX()
-{
- const QT3DS_ALIGN(16, QT3DSF32 x[4]) = { 1.0f, 0.0f, 0.0f, 0.0f };
- const __m128 x128 = _mm_load_ps(x);
- return x128;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitY()
-{
- const QT3DS_ALIGN(16, QT3DSF32 y[4]) = { 0.0f, 1.0f, 0.0f, 0.0f };
- const __m128 y128 = _mm_load_ps(y);
- return y128;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4UnitZ()
-{
- const QT3DS_ALIGN(16, QT3DSF32 z[4]) = { 0.0f, 0.0f, 1.0f, 0.0f };
- const __m128 z128 = _mm_load_ps(z);
- return z128;
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetW(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(3, 3, 3, 3));
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetX(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetY(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(1, 1, 1, 1));
-}
-
-QT3DS_FORCE_INLINE FloatV V4GetZ(const Vec4V f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(2, 2, 2, 2));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetW(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BTTTF(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetX(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BFTTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetY(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BTFTT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4SetZ(const Vec4V v, const FloatV f)
-{
- VECMATHAOS_ASSERT(isValidVec3V(v));
- VECMATHAOS_ASSERT(isValidFloatV(f));
- return V4Sel(BTTFT(), v, f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Zero()
-{
- return Vec4V_From_F32(0.0f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4One()
-{
- return Vec4V_From_F32(1.0f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Eps()
-{
- return Vec4V_From_F32(QT3DS_ENV_REAL);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Neg(const Vec4V f)
-{
- return _mm_sub_ps(_mm_setzero_ps(), f);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Add(const Vec4V a, const Vec4V b)
-{
- return _mm_add_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Sub(const Vec4V a, const Vec4V b)
-{
- return _mm_sub_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Scale(const Vec4V a, const FloatV b)
-{
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Mul(const Vec4V a, const Vec4V b)
-{
- return _mm_mul_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4ScaleInv(const Vec4V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Div(const Vec4V a, const Vec4V b)
-{
- return _mm_div_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4ScaleInvFast(const Vec4V a, const FloatV b)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4DivFast(const Vec4V a, const Vec4V b)
-{
- return _mm_mul_ps(a, _mm_rcp_ps(b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Recip(const Vec4V a)
-{
- return _mm_div_ps(V4One(), a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4RecipFast(const Vec4V a)
-{
- return _mm_rcp_ps(a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Rsqrt(const Vec4V a)
-{
- return _mm_div_ps(V4One(), _mm_sqrt_ps(a));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4RsqrtFast(const Vec4V a)
-{
- return _mm_rsqrt_ps(a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4ScaleAdd(const Vec4V a, const FloatV b, const Vec4V c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return V4Add(V4Scale(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NegScaleSub(const Vec4V a, const FloatV b, const Vec4V c)
-{
- VECMATHAOS_ASSERT(isValidFloatV(b));
- return V4Sub(c, V4Scale(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4MulAdd(const Vec4V a, const Vec4V b, const Vec4V c)
-{
- return V4Add(V4Mul(a, b), c);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NegMulSub(const Vec4V a, const Vec4V b, const Vec4V c)
-{
- return V4Sub(c, V4Mul(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Abs(const Vec4V a)
-{
- return V4Max(a, V4Neg(a));
-}
-
-QT3DS_FORCE_INLINE FloatV V4Dot(const Vec4V a, const Vec4V b)
-{
- __m128 dot1 = _mm_mul_ps(a, b); // x,y,z,w
- __m128 shuf1 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(2, 1, 0, 3)); // w,x,y,z
- __m128 shuf2 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(1, 0, 3, 2)); // z,w,x,y
- __m128 shuf3 = _mm_shuffle_ps(dot1, dot1, _MM_SHUFFLE(0, 3, 2, 1)); // y,z,w,x
- return _mm_add_ps(_mm_add_ps(shuf2, shuf3), _mm_add_ps(dot1, shuf1));
-}
-
-QT3DS_FORCE_INLINE FloatV V4Length(const Vec4V a)
-{
- return _mm_sqrt_ps(V4Dot(a, a));
-}
-
-QT3DS_FORCE_INLINE FloatV V4LengthSq(const Vec4V a)
-{
- return V4Dot(a, a);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Normalize(const Vec4V a)
-{
- VECMATHAOS_ASSERT(V4Dot(a, a) != FZero())
- return V4ScaleInv(a, _mm_sqrt_ps(V4Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NormalizeFast(const Vec4V a)
-{
- return V4ScaleInvFast(a, _mm_sqrt_ps(V4Dot(a, a)));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4NormalizeSafe(const Vec4V a)
-{
- const __m128 zero = FZero();
- const __m128 eps = V3Eps();
- const __m128 length = V4Length(a);
- const __m128 isGreaterThanZero = V4IsGrtr(length, eps);
- return V4Sel(isGreaterThanZero, V4ScaleInv(a, length), zero);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Sel(const BoolV c, const Vec4V a, const Vec4V b)
-{
- return _mm_or_ps(_mm_andnot_ps(c, b), _mm_and_ps(c, a));
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsGrtr(const Vec4V a, const Vec4V b)
-{
- return _mm_cmpgt_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsGrtrOrEq(const Vec4V a, const Vec4V b)
-{
- return _mm_cmpge_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsEq(const Vec4V a, const Vec4V b)
-{
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE BoolV V4IsEqU32(const VecU32V a, const VecU32V b)
-{
- return _mm_cmpeq_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec3V V4Max(const Vec4V a, const Vec4V b)
-{
- return _mm_max_ps(a, b);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Min(const Vec4V a, const Vec4V b)
-{
- return _mm_min_ps(a, b);
-}
-
-// Extract the maximum value from a
-QT3DS_FORCE_INLINE FloatV V4ExtractMax(const Vec4V a)
-{
- __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 1, 0, 3));
- __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 0, 3, 2));
- __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 3, 2, 1));
-
- return _mm_max_ps(_mm_max_ps(a, shuf1), _mm_max_ps(shuf2, shuf3));
-}
-
-// Extract the maximum value from a
-QT3DS_FORCE_INLINE FloatV V4ExtractMin(const Vec4V a)
-{
- __m128 shuf1 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 1, 0, 3));
- __m128 shuf2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 0, 3, 2));
- __m128 shuf3 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 3, 2, 1));
-
- return _mm_min_ps(_mm_min_ps(a, shuf1), _mm_min_ps(shuf2, shuf3));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Clamp(const Vec4V a, const Vec4V minV, const Vec4V maxV)
-{
- return V4Max(V4Min(a, maxV), minV);
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V4AllGrtr(const Vec4V a, const Vec4V b)
-{
- return BAllTrue4_R(V4IsGrtr(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V4AllGrtrOrEq(const Vec4V a, const Vec4V b)
-{
- return BAllTrue4_R(V4IsGrtrOrEq(a, b));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 V4AllEq(const Vec4V a, const Vec4V b)
-{
- return BAllTrue4_R(V4IsEq(a, b));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Round(const Vec4V a)
-{
- // return _mm_round_ps(a, 0x0);
- const Vec3V half = Vec3V_From_F32(0.5f);
- const Vec3V aPlusHalf = V3Add(a, half);
- __m128i tmp = _mm_cvttps_epi32(aPlusHalf);
- return _mm_cvtepi32_ps(tmp);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Sin(const Vec4V a)
-{
- // Vec4V V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- // Vec4V S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- Vec4V Result;
-
- const Vec4V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec4V tmp = V4Mul(a, twoPi);
- const Vec4V b = V4Round(tmp);
- const Vec4V V1 = V4NegMulSub(twoPi, b, a);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- const Vec4V V2 = V4Mul(V1, V1);
- const Vec4V V3 = V4Mul(V2, V1);
- const Vec4V V5 = V4Mul(V3, V2);
- const Vec4V V7 = V4Mul(V5, V2);
- const Vec4V V9 = V4Mul(V7, V2);
- const Vec4V V11 = V4Mul(V9, V2);
- const Vec4V V13 = V4Mul(V11, V2);
- const Vec4V V15 = V4Mul(V13, V2);
- const Vec4V V17 = V4Mul(V15, V2);
- const Vec4V V19 = V4Mul(V17, V2);
- const Vec4V V21 = V4Mul(V19, V2);
- const Vec4V V23 = V4Mul(V21, V2);
-
- const Vec4V sinCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients0.f);
- const Vec4V sinCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients1.f);
- const Vec4V sinCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXSinCoefficients2.f);
-
- const FloatV S1 = V4GetY(sinCoefficients0);
- const FloatV S2 = V4GetZ(sinCoefficients0);
- const FloatV S3 = V4GetW(sinCoefficients0);
- const FloatV S4 = V4GetX(sinCoefficients1);
- const FloatV S5 = V4GetY(sinCoefficients1);
- const FloatV S6 = V4GetZ(sinCoefficients1);
- const FloatV S7 = V4GetW(sinCoefficients1);
- const FloatV S8 = V4GetX(sinCoefficients2);
- const FloatV S9 = V4GetY(sinCoefficients2);
- const FloatV S10 = V4GetZ(sinCoefficients2);
- const FloatV S11 = V4GetW(sinCoefficients2);
-
- Result = V4MulAdd(S1, V3, V1);
- Result = V4MulAdd(S2, V5, Result);
- Result = V4MulAdd(S3, V7, Result);
- Result = V4MulAdd(S4, V9, Result);
- Result = V4MulAdd(S5, V11, Result);
- Result = V4MulAdd(S6, V13, Result);
- Result = V4MulAdd(S7, V15, Result);
- Result = V4MulAdd(S8, V17, Result);
- Result = V4MulAdd(S9, V19, Result);
- Result = V4MulAdd(S10, V21, Result);
- Result = V4MulAdd(S11, V23, Result);
-
- return Result;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Cos(const Vec4V a)
-{
- // XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- // XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- Vec4V Result;
-
- const Vec4V twoPi = Vec4V_From_F32Array_Aligned(g_PXReciprocalTwoPi.f);
- const Vec4V tmp = V4Mul(a, twoPi);
- const Vec4V b = V4Round(tmp);
- const Vec4V V1 = V4NegMulSub(twoPi, b, a);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- const Vec4V V2 = V4Mul(V1, V1);
- const Vec4V V4 = V4Mul(V2, V2);
- const Vec4V V6 = V4Mul(V4, V2);
- const Vec4V V8 = V4Mul(V4, V4);
- const Vec4V V10 = V4Mul(V6, V4);
- const Vec4V V12 = V4Mul(V6, V6);
- const Vec4V V14 = V4Mul(V8, V6);
- const Vec4V V16 = V4Mul(V8, V8);
- const Vec4V V18 = V4Mul(V10, V8);
- const Vec4V V20 = V4Mul(V10, V10);
- const Vec4V V22 = V4Mul(V12, V10);
-
- const Vec4V cosCoefficients0 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients0.f);
- const Vec4V cosCoefficients1 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients1.f);
- const Vec4V cosCoefficients2 = Vec4V_From_F32Array_Aligned(g_PXCosCoefficients2.f);
-
- const FloatV C1 = V4GetY(cosCoefficients0);
- const FloatV C2 = V4GetZ(cosCoefficients0);
- const FloatV C3 = V4GetW(cosCoefficients0);
- const FloatV C4 = V4GetX(cosCoefficients1);
- const FloatV C5 = V4GetY(cosCoefficients1);
- const FloatV C6 = V4GetZ(cosCoefficients1);
- const FloatV C7 = V4GetW(cosCoefficients1);
- const FloatV C8 = V4GetX(cosCoefficients2);
- const FloatV C9 = V4GetY(cosCoefficients2);
- const FloatV C10 = V4GetZ(cosCoefficients2);
- const FloatV C11 = V4GetW(cosCoefficients2);
-
- Result = V4MulAdd(C1, V2, V4One());
- Result = V4MulAdd(C2, V4, Result);
- Result = V4MulAdd(C3, V6, Result);
- Result = V4MulAdd(C4, V8, Result);
- Result = V4MulAdd(C5, V10, Result);
- Result = V4MulAdd(C6, V12, Result);
- Result = V4MulAdd(C7, V14, Result);
- Result = V4MulAdd(C8, V16, Result);
- Result = V4MulAdd(C9, V18, Result);
- Result = V4MulAdd(C10, V20, Result);
- Result = V4MulAdd(C11, V22, Result);
-
- return Result;
-}
-
-//////////////////////////////////
-// BoolV
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE BoolV BFFFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0, 0, 0 };
- const __m128 ffff = _mm_load_ps((float *)&f);
- return ffff;
-}
-
-QT3DS_FORCE_INLINE BoolV BFFFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0, 0, 0xFFFFFFFF };
- const __m128 ffft = _mm_load_ps((float *)&f);
- return ffft;
-}
-
-QT3DS_FORCE_INLINE BoolV BFFTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0, 0xFFFFFFFF, 0 };
- const __m128 fftf = _mm_load_ps((float *)&f);
- return fftf;
-}
-
-QT3DS_FORCE_INLINE BoolV BFFTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 fftt = _mm_load_ps((float *)&f);
- return fftt;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0xFFFFFFFF, 0, 0 };
- const __m128 ftff = _mm_load_ps((float *)&f);
- return ftff;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0xFFFFFFFF, 0, 0xFFFFFFFF };
- const __m128 ftft = _mm_load_ps((float *)&f);
- return ftft;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0xFFFFFFFF, 0xFFFFFFFF, 0 };
- const __m128 fttf = _mm_load_ps((float *)&f);
- return fttf;
-}
-
-QT3DS_FORCE_INLINE BoolV BFTTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 fttt = _mm_load_ps((float *)&f);
- return fttt;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0, 0, 0 };
- const __m128 tfff = _mm_load_ps((float *)&f);
- return tfff;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0, 0, 0xFFFFFFFF };
- const __m128 tfft = _mm_load_ps((float *)&f);
- return tfft;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0, 0xFFFFFFFF, 0 };
- const __m128 tftf = _mm_load_ps((float *)&f);
- return tftf;
-}
-
-QT3DS_FORCE_INLINE BoolV BTFTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 tftt = _mm_load_ps((float *)&f);
- return tftt;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTFF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0, 0 };
- const __m128 ttff = _mm_load_ps((float *)&f);
- return ttff;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTFT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0, 0xFFFFFFFF };
- const __m128 ttft = _mm_load_ps((float *)&f);
- return ttft;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTTF()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0 };
- const __m128 tttf = _mm_load_ps((float *)&f);
- return tttf;
-}
-
-QT3DS_FORCE_INLINE BoolV BTTTT()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
- const __m128 tttt = _mm_load_ps((float *)&f);
- return tttt;
-}
-
-QT3DS_FORCE_INLINE BoolV BXMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0xFFFFFFFF, 0, 0, 0 };
- const __m128 tfff = _mm_load_ps((float *)&f);
- return tfff;
-}
-
-QT3DS_FORCE_INLINE BoolV BYMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0xFFFFFFFF, 0, 0 };
- const __m128 ftff = _mm_load_ps((float *)&f);
- return ftff;
-}
-
-QT3DS_FORCE_INLINE BoolV BZMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0, 0xFFFFFFFF, 0 };
- const __m128 fftf = _mm_load_ps((float *)&f);
- return fftf;
-}
-
-QT3DS_FORCE_INLINE BoolV BWMask()
-{
- const QT3DS_ALIGN(16, QT3DSU32 f[4]) = { 0, 0, 0, 0xFFFFFFFF };
- const __m128 ffft = _mm_load_ps((float *)&f);
- return ffft;
-}
-
-QT3DS_FORCE_INLINE BoolV BGetX(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-QT3DS_FORCE_INLINE BoolV BGetY(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(1, 1, 1, 1));
-}
-
-QT3DS_FORCE_INLINE BoolV BGetZ(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(2, 2, 2, 2));
-}
-
-QT3DS_FORCE_INLINE BoolV BGetW(const BoolV f)
-{
- return _mm_shuffle_ps(f, f, _MM_SHUFFLE(3, 3, 3, 3));
-}
-
-QT3DS_FORCE_INLINE BoolV BAnd(const BoolV a, const BoolV b)
-{
- return (_mm_and_ps(a, b));
-}
-
-QT3DS_FORCE_INLINE BoolV BNot(const BoolV a)
-{
- const BoolV bAllTrue(BTTTT());
- return _mm_xor_ps(a, bAllTrue);
-}
-
-QT3DS_FORCE_INLINE BoolV BAndNot(const BoolV a, const BoolV b)
-{
- return (_mm_andnot_ps(a, b));
-}
-
-QT3DS_FORCE_INLINE BoolV BOr(const BoolV a, const BoolV b)
-{
- return (_mm_or_ps(a, b));
-}
-
-QT3DS_FORCE_INLINE BoolV BAllTrue4(const BoolV a)
-{
- const BoolV bTmp = _mm_and_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 3, 2, 3)));
- return _mm_and_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE BoolV BAnyTrue4(const BoolV a)
-{
- const BoolV bTmp = _mm_or_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 3, 2, 3)));
- return _mm_or_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE BoolV BAllTrue3(const BoolV a)
-{
- const BoolV bTmp = _mm_and_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)));
- return _mm_and_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE BoolV BAnyTrue3(const BoolV a)
-{
- const BoolV bTmp = _mm_or_ps(_mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 1, 0, 1)),
- _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2)));
- return _mm_or_ps(_mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(0, 0, 0, 0)),
- _mm_shuffle_ps(bTmp, bTmp, _MM_SHUFFLE(1, 1, 1, 1)));
-}
-
-QT3DS_FORCE_INLINE QT3DSU32 BAllEq(const BoolV a, const BoolV b)
-{
- const BoolV bTest = m128_I2F(_mm_cmpeq_epi32(m128_F2I(a), m128_F2I(b)));
- return BAllTrue4_R(bTest);
-}
-
-//////////////////////////////////
-// MAT33V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec3V M33MulV3(const Mat33V &a, const Vec3V b)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- const Vec3V v0 = V3Scale(a.col0, x);
- const Vec3V v1 = V3Scale(a.col1, y);
- const Vec3V v2 = V3Scale(a.col2, z);
- const Vec3V v0PlusV1 = V3Add(v0, v1);
- return V3Add(v0PlusV1, v2);
-}
-
-QT3DS_FORCE_INLINE Vec3V M33TrnspsMulV3(const Mat33V &a, const Vec3V b)
-{
- const FloatV x = V3Dot(a.col0, b);
- const FloatV y = V3Dot(a.col1, b);
- const FloatV z = V3Dot(a.col2, b);
- return V3Merge(x, y, z);
-}
-
-QT3DS_FORCE_INLINE Vec3V M33MulV3AddV3(const Mat33V &A, const Vec3V b, const Vec3V c)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- Vec3V result = V3MulAdd(A.col0, x, c);
- result = V3MulAdd(A.col1, y, result);
- return V3MulAdd(A.col2, z, result);
-}
-
-QT3DS_FORCE_INLINE Mat33V M33MulM33(const Mat33V &a, const Mat33V &b)
-{
- return Mat33V(M33MulV3(a, b.col0), M33MulV3(a, b.col1), M33MulV3(a, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Add(const Mat33V &a, const Mat33V &b)
-{
- return Mat33V(V3Add(a.col0, b.col0), V3Add(a.col1, b.col1), V3Add(a.col2, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Sub(const Mat33V &a, const Mat33V &b)
-{
- return Mat33V(V3Sub(a.col0, b.col0), V3Sub(a.col1, b.col1), V3Sub(a.col2, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Neg(const Mat33V &a)
-{
- return Mat33V(V3Neg(a.col0), V3Neg(a.col1), V3Neg(a.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Abs(const Mat33V &a)
-{
- return Mat33V(V3Abs(a.col0), V3Abs(a.col1), V3Abs(a.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Inverse(const Mat33V &a)
-{
- const BoolV tfft = BTFFT();
- const BoolV tttf = BTTTF();
- const FloatV zero = V3Zero();
- const Vec3V cross01 = V3Cross(a.col0, a.col1);
- const Vec3V cross12 = V3Cross(a.col1, a.col2);
- const Vec3V cross20 = V3Cross(a.col2, a.col0);
- const FloatV dot = V3Dot(cross01, a.col2);
- const FloatV invDet = _mm_rcp_ps(dot);
- const Vec3V mergeh = _mm_unpacklo_ps(cross12, cross01);
- const Vec3V mergel = _mm_unpackhi_ps(cross12, cross01);
- Vec3V colInv0 = _mm_unpacklo_ps(mergeh, cross20);
- colInv0 = _mm_or_ps(_mm_andnot_ps(tttf, zero), _mm_and_ps(tttf, colInv0));
- const Vec3V zppd = _mm_shuffle_ps(mergeh, cross20, _MM_SHUFFLE(3, 0, 0, 2));
- const Vec3V pbwp = _mm_shuffle_ps(cross20, mergeh, _MM_SHUFFLE(3, 3, 1, 0));
- const Vec3V colInv1 = _mm_or_ps(_mm_andnot_ps(BTFFT(), pbwp), _mm_and_ps(BTFFT(), zppd));
- const Vec3V xppd = _mm_shuffle_ps(mergel, cross20, _MM_SHUFFLE(3, 0, 0, 0));
- const Vec3V pcyp = _mm_shuffle_ps(cross20, mergel, _MM_SHUFFLE(3, 1, 2, 0));
- const Vec3V colInv2 = _mm_or_ps(_mm_andnot_ps(tfft, pcyp), _mm_and_ps(tfft, xppd));
-
- return Mat33V(_mm_mul_ps(colInv0, invDet), _mm_mul_ps(colInv1, invDet),
- _mm_mul_ps(colInv2, invDet));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Trnsps(const Mat33V &a)
-{
- return Mat33V(V3Merge(V3GetX(a.col0), V3GetX(a.col1), V3GetX(a.col2)),
- V3Merge(V3GetY(a.col0), V3GetY(a.col1), V3GetY(a.col2)),
- V3Merge(V3GetZ(a.col0), V3GetZ(a.col1), V3GetZ(a.col2)));
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Identity()
-{
- return Mat33V(V3UnitX(), V3UnitY(), V3UnitZ());
-}
-
-QT3DS_FORCE_INLINE Mat33V M33Diagonal(const Vec3VArg d)
-{
- const FloatV x = V3Mul(V3UnitX(), d);
- const FloatV y = V3Mul(V3UnitY(), d);
- const FloatV z = V3Mul(V3UnitZ(), d);
- return Mat33V(x, y, z);
-}
-
-//////////////////////////////////
-// MAT34V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec3V M34MulV3(const Mat34V &a, const Vec3V b)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- const Vec3V v0 = V3Scale(a.col0, x);
- const Vec3V v1 = V3Scale(a.col1, y);
- const Vec3V v2 = V3Scale(a.col2, z);
- const Vec3V v0PlusV1 = V3Add(v0, v1);
- const Vec3V v0PlusV1Plusv2 = V3Add(v0PlusV1, v2);
- return (V3Add(v0PlusV1Plusv2, a.col3));
-}
-
-QT3DS_FORCE_INLINE Vec3V M34Mul33V3(const Mat34V &a, const Vec3V b)
-{
- const FloatV x = V3GetX(b);
- const FloatV y = V3GetY(b);
- const FloatV z = V3GetZ(b);
- const Vec3V v0 = V3Scale(a.col0, x);
- const Vec3V v1 = V3Scale(a.col1, y);
- const Vec3V v2 = V3Scale(a.col2, z);
- const Vec3V v0PlusV1 = V3Add(v0, v1);
- return V3Add(v0PlusV1, v2);
-}
-
-QT3DS_FORCE_INLINE Vec3V M34TrnspsMul33V3(const Mat34V &a, const Vec3V b)
-{
- const FloatV x = V3Dot(a.col0, b);
- const FloatV y = V3Dot(a.col1, b);
- const FloatV z = V3Dot(a.col2, b);
- return V3Merge(x, y, z);
-}
-
-QT3DS_FORCE_INLINE Mat34V M34MulM34(const Mat34V &a, const Mat34V &b)
-{
- return Mat34V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2),
- M34MulV3(a, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat33V M34MulM33(const Mat34V &a, const Mat33V &b)
-{
- return Mat33V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat33V M34Mul33MM34(const Mat34V &a, const Mat34V &b)
-{
- return Mat33V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2));
-}
-
-QT3DS_FORCE_INLINE Mat34V M34Add(const Mat34V &a, const Mat34V &b)
-{
- return Mat34V(V3Add(a.col0, b.col0), V3Add(a.col1, b.col1), V3Add(a.col2, b.col2),
- V3Add(a.col3, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat34V M34Inverse(const Mat34V &a)
-{
- Mat34V aInv;
- const BoolV tfft = BTFFT();
- const BoolV tttf = BTTTF();
- const FloatV zero = V3Zero();
- const Vec3V cross01 = V3Cross(a.col0, a.col1);
- const Vec3V cross12 = V3Cross(a.col1, a.col2);
- const Vec3V cross20 = V3Cross(a.col2, a.col0);
- const FloatV dot = V3Dot(cross01, a.col2);
- const FloatV invDet = _mm_rcp_ps(dot);
- const Vec3V mergeh = _mm_unpacklo_ps(cross12, cross01);
- const Vec3V mergel = _mm_unpackhi_ps(cross12, cross01);
- Vec3V colInv0 = _mm_unpacklo_ps(mergeh, cross20);
- colInv0 = _mm_or_ps(_mm_andnot_ps(tttf, zero), _mm_and_ps(tttf, colInv0));
- const Vec3V zppd = _mm_shuffle_ps(mergeh, cross20, _MM_SHUFFLE(3, 0, 0, 2));
- const Vec3V pbwp = _mm_shuffle_ps(cross20, mergeh, _MM_SHUFFLE(3, 3, 1, 0));
- const Vec3V colInv1 = _mm_or_ps(_mm_andnot_ps(BTFFT(), pbwp), _mm_and_ps(BTFFT(), zppd));
- const Vec3V xppd = _mm_shuffle_ps(mergel, cross20, _MM_SHUFFLE(3, 0, 0, 0));
- const Vec3V pcyp = _mm_shuffle_ps(cross20, mergel, _MM_SHUFFLE(3, 1, 2, 0));
- const Vec3V colInv2 = _mm_or_ps(_mm_andnot_ps(tfft, pcyp), _mm_and_ps(tfft, xppd));
- aInv.col0 = _mm_mul_ps(colInv0, invDet);
- aInv.col1 = _mm_mul_ps(colInv1, invDet);
- aInv.col2 = _mm_mul_ps(colInv2, invDet);
- aInv.col3 = M34Mul33V3(aInv, V3Neg(a.col3));
- return aInv;
-}
-
-QT3DS_FORCE_INLINE Mat33V M34Trnsps33(const Mat34V &a)
-{
- return Mat33V(V3Merge(V3GetX(a.col0), V3GetX(a.col1), V3GetX(a.col2)),
- V3Merge(V3GetY(a.col0), V3GetY(a.col1), V3GetY(a.col2)),
- V3Merge(V3GetZ(a.col0), V3GetZ(a.col1), V3GetZ(a.col2)));
-}
-
-//////////////////////////////////
-// MAT44V
-//////////////////////////////////
-
-QT3DS_FORCE_INLINE Vec4V M44MulV4(const Mat44V &a, const Vec4V b)
-{
- const FloatV x = V4GetX(b);
- const FloatV y = V4GetY(b);
- const FloatV z = V4GetZ(b);
- const FloatV w = V4GetW(b);
-
- const Vec4V v0 = V4Scale(a.col0, x);
- const Vec4V v1 = V4Scale(a.col1, y);
- const Vec4V v2 = V4Scale(a.col2, z);
- const Vec4V v3 = V4Scale(a.col3, w);
- const Vec4V v0PlusV1 = V4Add(v0, v1);
- const Vec4V v0PlusV1Plusv2 = V4Add(v0PlusV1, v2);
- return (V4Add(v0PlusV1Plusv2, v3));
-}
-
-QT3DS_FORCE_INLINE Vec4V M44TrnspsMulV4(const Mat44V &a, const Vec4V b)
-{
- QT3DS_ALIGN(16, FloatV dotProdArray[4]) = { V4Dot(a.col0, b), V4Dot(a.col1, b), V4Dot(a.col2, b),
- V4Dot(a.col3, b) };
- return V4Merge(dotProdArray);
-}
-
-QT3DS_FORCE_INLINE Mat44V M44MulM44(const Mat44V &a, const Mat44V &b)
-{
- return Mat44V(M44MulV4(a, b.col0), M44MulV4(a, b.col1), M44MulV4(a, b.col2),
- M44MulV4(a, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat44V M44Add(const Mat44V &a, const Mat44V &b)
-{
- return Mat44V(V4Add(a.col0, b.col0), V4Add(a.col1, b.col1), V4Add(a.col2, b.col2),
- V4Add(a.col3, b.col3));
-}
-
-QT3DS_FORCE_INLINE Mat44V M44Trnsps(const Mat44V &a)
-{
- const Vec4V v0 = _mm_unpacklo_ps(a.col0, a.col2);
- const Vec4V v1 = _mm_unpackhi_ps(a.col0, a.col2);
- const Vec4V v2 = _mm_unpacklo_ps(a.col1, a.col3);
- const Vec4V v3 = _mm_unpackhi_ps(a.col1, a.col3);
- return Mat44V(_mm_unpacklo_ps(v0, v2), _mm_unpackhi_ps(v0, v2), _mm_unpacklo_ps(v1, v3),
- _mm_unpackhi_ps(v1, v3));
-}
-
-// The original code as provided by Intel in
-// "Streaming SIMD Extensions - Inverse of 4x4 Matrix"
-// (ftp://download.intel.com/design/pentiumiii/sml/24504301.pdf)
-QT3DS_FORCE_INLINE Mat44V M44Inverse(const Mat44V &a)
-{
- __m128 minor0, minor1, minor2, minor3;
- __m128 row0, row1, row2, row3;
- __m128 det, tmp1;
-
- tmp1 = V4Zero();
- row1 = V4Zero();
- row3 = V4Zero();
-
- row0 = a.col0;
- row1 = _mm_shuffle_ps(a.col1, a.col1, _MM_SHUFFLE(1, 0, 3, 2));
- row2 = a.col2;
- row3 = _mm_shuffle_ps(a.col3, a.col3, _MM_SHUFFLE(1, 0, 3, 2));
-
- tmp1 = _mm_mul_ps(row2, row3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor0 = _mm_mul_ps(row1, tmp1);
- minor1 = _mm_mul_ps(row0, tmp1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor0 = _mm_sub_ps(_mm_mul_ps(row1, tmp1), minor0);
- minor1 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor1);
- minor1 = _mm_shuffle_ps(minor1, minor1, 0x4E);
-
- tmp1 = _mm_mul_ps(row1, row2);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor0 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor0);
- minor3 = _mm_mul_ps(row0, tmp1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor0 = _mm_sub_ps(minor0, _mm_mul_ps(row3, tmp1));
- minor3 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor3);
- minor3 = _mm_shuffle_ps(minor3, minor3, 0x4E);
-
- tmp1 = _mm_mul_ps(_mm_shuffle_ps(row1, row1, 0x4E), row3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- row2 = _mm_shuffle_ps(row2, row2, 0x4E);
- minor0 = _mm_add_ps(_mm_mul_ps(row2, tmp1), minor0);
- minor2 = _mm_mul_ps(row0, tmp1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor0 = _mm_sub_ps(minor0, _mm_mul_ps(row2, tmp1));
- minor2 = _mm_sub_ps(_mm_mul_ps(row0, tmp1), minor2);
- minor2 = _mm_shuffle_ps(minor2, minor2, 0x4E);
-
- tmp1 = _mm_mul_ps(row0, row1);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor2 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor2);
- minor3 = _mm_sub_ps(_mm_mul_ps(row2, tmp1), minor3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor2 = _mm_sub_ps(_mm_mul_ps(row3, tmp1), minor2);
- minor3 = _mm_sub_ps(minor3, _mm_mul_ps(row2, tmp1));
-
- tmp1 = _mm_mul_ps(row0, row3);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor1 = _mm_sub_ps(minor1, _mm_mul_ps(row2, tmp1));
- minor2 = _mm_add_ps(_mm_mul_ps(row1, tmp1), minor2);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor1 = _mm_add_ps(_mm_mul_ps(row2, tmp1), minor1);
- minor2 = _mm_sub_ps(minor2, _mm_mul_ps(row1, tmp1));
-
- tmp1 = _mm_mul_ps(row0, row2);
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0xB1);
- minor1 = _mm_add_ps(_mm_mul_ps(row3, tmp1), minor1);
- minor3 = _mm_sub_ps(minor3, _mm_mul_ps(row1, tmp1));
- tmp1 = _mm_shuffle_ps(tmp1, tmp1, 0x4E);
- minor1 = _mm_sub_ps(minor1, _mm_mul_ps(row3, tmp1));
- minor3 = _mm_add_ps(_mm_mul_ps(row1, tmp1), minor3);
-
- det = _mm_mul_ps(row0, minor0);
- det = _mm_add_ps(_mm_shuffle_ps(det, det, 0x4E), det);
- det = _mm_add_ss(_mm_shuffle_ps(det, det, 0xB1), det);
- tmp1 = _mm_rcp_ss(det);
-#if 0
- det = _mm_sub_ss(_mm_add_ss(tmp1, tmp1), _mm_mul_ss(det, _mm_mul_ss(tmp1, tmp1)));
- det = _mm_shuffle_ps(det, det, 0x00);
-#else
- det = _mm_shuffle_ps(tmp1, tmp1, _MM_SHUFFLE(0, 0, 0, 0));
-#endif
-
- minor0 = _mm_mul_ps(det, minor0);
- minor1 = _mm_mul_ps(det, minor1);
- minor2 = _mm_mul_ps(det, minor2);
- minor3 = _mm_mul_ps(det, minor3);
- Mat44V invTrans(minor0, minor1, minor2, minor3);
- return M44Trnsps(invTrans);
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_XYZW(QT3DSF32 x, QT3DSF32 y, QT3DSF32 z, QT3DSF32 w)
-{
- return _mm_set_ps(w, z, y, x);
-}
-
-// AP: work in progress - use proper SSE intrinsics where possible
-QT3DS_FORCE_INLINE VecU16V V4U32PK(VecU32V a, VecU32V b)
-{
- VecU16V result;
- result.m128_u16[0] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[0], 0, 0xFFFF));
- result.m128_u16[1] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[1], 0, 0xFFFF));
- result.m128_u16[2] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[2], 0, 0xFFFF));
- result.m128_u16[3] = QT3DSU16(NVClamp<QT3DSU32>((a).m128_u32[3], 0, 0xFFFF));
- result.m128_u16[4] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[0], 0, 0xFFFF));
- result.m128_u16[5] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[1], 0, 0xFFFF));
- result.m128_u16[6] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[2], 0, 0xFFFF));
- result.m128_u16[7] = QT3DSU16(NVClamp<QT3DSU32>((b).m128_u32[3], 0, 0xFFFF));
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U32or(VecU32V a, VecU32V b)
-{
- return m128_I2F(_mm_or_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U32and(VecU32V a, VecU32V b)
-{
- return m128_I2F(_mm_and_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U32Andc(VecU32V a, VecU32V b)
-{
- return m128_I2F(_mm_andnot_si128(m128_F2I(b), m128_F2I(a)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16Or(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_or_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16And(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_and_si128(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16Andc(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_andnot_si128(m128_F2I(b), m128_F2I(a)));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_From_I32(const QT3DSI32 i)
-{
- return (_mm_load1_ps((QT3DSF32 *)&i));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_From_I32Array(const QT3DSI32 *i)
-{
- return _mm_loadu_ps((QT3DSF32 *)i);
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_From_I32Array_Aligned(const QT3DSI32 *i)
-{
- return _mm_load_ps((QT3DSF32 *)i);
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Add(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_add_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Sub(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_sub_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE BoolV VecI32V_IsGrtr(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_cmpgt_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE BoolV VecI32V_IsEq(const VecI32VArg a, const VecI32VArg b)
-{
- return m128_I2F(_mm_cmpeq_epi32(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Zero()
-{
- return V4Zero();
-}
-
-QT3DS_FORCE_INLINE VecI32V VecI32V_Merge(const VecI32VArg a, const VecI32VArg b, const VecI32VArg c,
- const VecI32VArg d)
-{
- return V4Merge(a, b, c, d);
-}
-
-template <int a>
-QT3DS_FORCE_INLINE VecI32V V4ISplat()
-{
- VecI32V result;
- result.m128_i32[0] = a;
- result.m128_i32[1] = a;
- result.m128_i32[2] = a;
- result.m128_i32[3] = a;
- return result;
-}
-
-QT3DS_FORCE_INLINE void V4U16StoreAligned(VecU16V val, VecU16V *address)
-{
- *address = val;
-}
-
-QT3DS_FORCE_INLINE void V4U32StoreAligned(VecU32V val, VecU32V *address)
-{
- *address = val;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4LoadAligned(Vec4V *addr)
-{
- return *addr;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4LoadUnaligned(Vec4V *addr)
-{
- return Vec4V_From_F32Array((float *)addr);
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Andc(const Vec4V a, const VecU32V b)
-{
- VecU32V result32(a);
- result32 = V4U32Andc(result32, b);
- return Vec4V(result32);
-}
-
-QT3DS_FORCE_INLINE VecU32V V4IsGrtrV32u(const Vec4V a, const Vec4V b)
-{
- return V4IsGrtr(a, b);
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16LoadAligned(VecU16V *addr)
-{
- return *addr;
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16LoadUnaligned(VecU16V *addr)
-{
- return *addr;
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16CompareGt(VecU16V a, VecU16V b)
-{
- // _mm_cmpgt_epi16 doesn't work for unsigned values unfortunately
- // return m128_I2F(_mm_cmpgt_epi16(m128_F2I(a), m128_F2I(b)));
- VecU16V result;
- result.m128_u16[0] = (a).m128_u16[0] > (b).m128_u16[0];
- result.m128_u16[1] = (a).m128_u16[1] > (b).m128_u16[1];
- result.m128_u16[2] = (a).m128_u16[2] > (b).m128_u16[2];
- result.m128_u16[3] = (a).m128_u16[3] > (b).m128_u16[3];
- result.m128_u16[4] = (a).m128_u16[4] > (b).m128_u16[4];
- result.m128_u16[5] = (a).m128_u16[5] > (b).m128_u16[5];
- result.m128_u16[6] = (a).m128_u16[6] > (b).m128_u16[6];
- result.m128_u16[7] = (a).m128_u16[7] > (b).m128_u16[7];
- return result;
-}
-
-QT3DS_FORCE_INLINE Vec4V Vec4V_From_VecU32V(VecU32V a)
-{
- Vec4V result = Vec4V_From_XYZW(QT3DSF32(a.m128_u32[0]), QT3DSF32(a.m128_u32[1]), QT3DSF32(a.m128_u32[2]),
- QT3DSF32(a.m128_u32[3]));
- return result;
-}
-
-template <int index>
-QT3DS_FORCE_INLINE VecU32V V4U32SplatElement(VecU32V a)
-{
- VecU32V result;
- result.m128_u32[0] = result.m128_u32[1] = result.m128_u32[2] = result.m128_u32[3] =
- a.m128_u32[index];
- return result;
-}
-
-template <int index>
-QT3DS_FORCE_INLINE Vec4V V4SplatElement(Vec4V a)
-{
- float *data = (float *)&a;
- return Vec4V_From_F32(data[index]);
-}
-
-template <int index>
-QT3DS_FORCE_INLINE VecU16V V4U16SplatElement(VecU16V a)
-{
- VecU16V result = a; // AM: initializing to avoid nonsensical warning 4701 here with VC10.
- for (int i = 0; i < 8; i++)
- result.m128_u16[i] = a.m128_u16[index];
- return result;
-}
-
-template <int imm>
-QT3DS_FORCE_INLINE VecI16V V4I16SplatImmediate()
-{
- VecI16V result;
- result.m128_i16[0] = imm;
- result.m128_i16[1] = imm;
- result.m128_i16[2] = imm;
- result.m128_i16[3] = imm;
- result.m128_i16[4] = imm;
- result.m128_i16[5] = imm;
- result.m128_i16[6] = imm;
- result.m128_i16[7] = imm;
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16SubtractModulo(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_sub_epi16(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU16V V4U16AddModulo(VecU16V a, VecU16V b)
-{
- return m128_I2F(_mm_add_epi16(m128_F2I(a), m128_F2I(b)));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U16GetLo16(VecU16V a)
-{
- VecU32V result;
- result.m128_u32[0] = a.m128_u16[0];
- result.m128_u32[1] = a.m128_u16[2];
- result.m128_u32[2] = a.m128_u16[4];
- result.m128_u32[3] = a.m128_u16[6];
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU32V V4U16GetHi16(VecU16V a)
-{
- VecU32V result;
- result.m128_u32[0] = a.m128_u16[1];
- result.m128_u32[1] = a.m128_u16[3];
- result.m128_u32[2] = a.m128_u16[5];
- result.m128_u32[3] = a.m128_u16[7];
- return result;
-}
-
-QT3DS_FORCE_INLINE VecU32V VecU32V_From_XYZW(QT3DSU32 x, QT3DSU32 y, QT3DSU32 z, QT3DSU32 w)
-{
- VecU32V result;
- result.m128_u32[0] = x;
- result.m128_u32[1] = y;
- result.m128_u32[2] = z;
- result.m128_u32[3] = w;
- return result;
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Ceil(const Vec4V a)
-{
- return Vec4V_From_XYZW(NVCeil(a.m128_f32[0]), NVCeil(a.m128_f32[1]), NVCeil(a.m128_f32[2]),
- NVCeil(a.m128_f32[3]));
-}
-
-QT3DS_FORCE_INLINE Vec4V V4Floor(const Vec4V a)
-{
- return Vec4V_From_XYZW(NVFloor(a.m128_f32[0]), NVFloor(a.m128_f32[1]), NVFloor(a.m128_f32[2]),
- NVFloor(a.m128_f32[3]));
-}
-
-QT3DS_FORCE_INLINE VecU32V V4ConvertToU32VSaturate(const Vec4V a, QT3DSU32 power)
-{
- QT3DS_ASSERT(power == 0 && "Non-zero power not supported in convertToU32VSaturate");
- QT3DS_FORCE_PARAMETER_REFERENCE(power); // prevent warning in release builds
- QT3DSF32 ffffFFFFasFloat = QT3DSF32(0xFFFF0000);
- VecU32V result;
- result.m128_u32[0] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[0], 0.0f, ffffFFFFasFloat));
- result.m128_u32[1] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[1], 0.0f, ffffFFFFasFloat));
- result.m128_u32[2] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[2], 0.0f, ffffFFFFasFloat));
- result.m128_u32[3] = QT3DSU32(NVClamp<QT3DSF32>((a).m128_f32[3], 0.0f, ffffFFFFasFloat));
- return result;
-}
-
-#endif // QT3DS_WINDOWS_INLINE_AOS_H
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsIntrinsics.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsIntrinsics.h
deleted file mode 100644
index 3e0b3e8f..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsIntrinsics.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_WINDOWS_INTRINSICS_H
-#define QT3DS_FOUNDATION_QT3DS_WINDOWS_INTRINSICS_H
-
-#include "foundation/Qt3DS.h"
-
-#if !defined QT3DS_WINDOWS && !defined QT3DS_WIN8ARM
-#error "This file should only be included by Windows builds!!"
-#endif
-
-#ifdef QT3DS_GNUC
-#include <cmath>
-#else
-#include <math.h>
-#endif
-#include <float.h>
-#include <intrin.h>
-#include <string.h>
-#include "foundation/Qt3DSAssert.h"
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-namespace intrinsics {
-#endif
-
- //! \brief platform-specific absolute value
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float abs(float a) { return float(::fabs(a)); }
-
- //! \brief platform-specific select float
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float fsel(float a, float b, float c)
- {
- return (a >= 0.0f) ? b : c;
- }
-
- //! \brief platform-specific sign
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float sign(float a) { return (a >= 0.0f) ? 1.0f : -1.0f; }
-
- //! \brief platform-specific reciprocal
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recip(float a) { return 1.0f / a; }
-
- //! \brief platform-specific square root
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float sqrt(float a) { return ::sqrtf(a); }
-
- //! \brief platform-specific reciprocal square root
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recipSqrt(float a) { return 1.0f / ::sqrtf(a); }
-
- //! \brief platform-specific sine
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float sin(float a) { return ::sinf(a); }
-
- //! \brief platform-specific cosine
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float cos(float a) { return ::cosf(a); }
-
- //! \brief platform-specific minimum
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float selectMin(float a, float b) { return a < b ? a : b; }
-
- //! \brief platform-specific maximum
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float selectMax(float a, float b) { return a > b ? a : b; }
-
- //! \brief platform-specific finiteness check (not INF or NAN)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isFinite(float a)
- {
-#if defined(__CUDACC__)
- return isfinite(a)? true : false;
-#elif defined(QT3DS_GNUC)
- return (std::isfinite(a) && !std::isinf(a)) ? true : false;
-#else
- return (0 == ((_FPCLASS_SNAN | _FPCLASS_QNAN | _FPCLASS_NINF | _FPCLASS_PINF) & _fpclass(a)));
-#endif
- }
-
- //! \brief platform-specific finiteness check (not INF or NAN)
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE bool isFinite(double a)
- {
-#if defined(__CUDACC__)
- return isfinite(a)? true : false;
-#elif defined(QT3DS_GNUC)
- return (std::isfinite(a) && !std::isinf(a)) ? true : false;
-#else
- return (0 == ((_FPCLASS_SNAN | _FPCLASS_QNAN | _FPCLASS_NINF | _FPCLASS_PINF) & _fpclass(a)));
-#endif
- }
- /*
-* Implements a memory barrier
-*/
- QT3DS_FORCE_INLINE void memoryBarrier()
- {
- _ReadWriteBarrier();
- /* long Barrier;
- __asm {
- xchg Barrier, eax
- }*/
- }
-
- /*!
- Returns the index of the highest set bit. Not valid for zero arg.
- */
- QT3DS_FORCE_INLINE QT3DSU32 highestSetBitUnsafe(QT3DSU32 v)
- {
- unsigned long retval;
- _BitScanReverse(&retval, v);
- return retval;
- }
-
- /*!
- Returns the index of the highest set bit. Undefined for zero arg.
- */
- QT3DS_FORCE_INLINE QT3DSU32 lowestSetBitUnsafe(QT3DSU32 v)
- {
- unsigned long retval;
- _BitScanForward(&retval, v);
- return retval;
- }
-
- /*!
- Returns the number of leading zeros in v. Returns 32 for v=0.
- */
- QT3DS_FORCE_INLINE QT3DSU32 countLeadingZeros(QT3DSU32 v)
- {
- if (v) {
- unsigned long bsr = (unsigned long)-1;
- _BitScanReverse(&bsr, v);
- return 31 - bsr;
- } else
- return 32;
- }
-
- /*!
- Sets \c count bytes starting at \c dst to zero.
- */
- QT3DS_FORCE_INLINE void *memZero(void *QT3DS_RESTRICT dest, QT3DSU32 count)
- {
- return memset(dest, 0, count);
- }
-
- /*!
- Sets \c count bytes starting at \c dst to \c c.
- */
- QT3DS_FORCE_INLINE void *memSet(void *QT3DS_RESTRICT dest, QT3DSI32 c, QT3DSU32 count)
- {
- return memset(dest, c, count);
- }
-
- /*!
- Copies \c count bytes from \c src to \c dst. User memMove if regions overlap.
- */
- QT3DS_FORCE_INLINE void *memCopy(void *QT3DS_RESTRICT dest, const void *QT3DS_RESTRICT src, QT3DSU32 count)
- {
- return memcpy(dest, src, count);
- }
-
- /*!
- Copies \c count bytes from \c src to \c dst. Supports overlapping regions.
- */
- QT3DS_FORCE_INLINE void *memMove(void *QT3DS_RESTRICT dest, const void *QT3DS_RESTRICT src, QT3DSU32 count)
- {
- return memmove(dest, src, count);
- }
-
- /*!
- Set 128B to zero starting at \c dst+offset. Must be aligned.
- */
- QT3DS_FORCE_INLINE void memZero128(void *QT3DS_RESTRICT dest, QT3DSU32 offset = 0)
- {
- QT3DS_ASSERT(((size_t(dest) + offset) & 0x7f) == 0);
- memSet((char *QT3DS_RESTRICT)dest + offset, 0, 128);
- }
-
- /*!
- Prefetch aligned 128B around \c ptr+offset.
- */
- QT3DS_FORCE_INLINE void prefetch128(const void *ptr, QT3DSU32 offset = 0)
- {
-#ifdef QT3DS_WINDOWS
- _mm_prefetch(((const char *)ptr + offset), _MM_HINT_T0);
-#endif
- }
-
- /*!
- Prefetch \c count bytes starting at \c ptr.
- */
- QT3DS_FORCE_INLINE void prefetch(const void *ptr, QT3DSU32 count = 0)
- {
- for (QT3DSU32 i = 0; i <= count; i += 128)
- prefetch128(ptr, i);
- }
-
- //! \brief platform-specific reciprocal
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recipFast(float a) { return 1.0f / a; }
-
- //! \brief platform-specific fast reciprocal square root
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float recipSqrtFast(float a) { return 1.0f / ::sqrtf(a); }
-
- //! \brief platform-specific floor
- QT3DS_CUDA_CALLABLE QT3DS_FORCE_INLINE float floatFloor(float x) { return ::floorf(x); }
-
-#ifndef QT3DS_DOXYGEN
-} // namespace intrinsics
-} // namespace qt3ds
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsMutex.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsMutex.cpp
deleted file mode 100644
index c5fef09f..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsMutex.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/windows/Qt3DSWindowsInclude.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSAssert.h"
-
-namespace qt3ds {
-namespace foundation {
-
- namespace {
- CRITICAL_SECTION *getMutex(MutexImpl *impl)
- {
- return reinterpret_cast<CRITICAL_SECTION *>(impl);
- }
- }
-
- MutexImpl::MutexImpl() { InitializeCriticalSection(getMutex(this)); }
-
- MutexImpl::~MutexImpl() { DeleteCriticalSection(getMutex(this)); }
-
- bool MutexImpl::lock()
- {
- EnterCriticalSection(getMutex(this));
- return true;
- }
-
- bool MutexImpl::trylock() { return TryEnterCriticalSection(getMutex(this)) != 0; }
-
- bool MutexImpl::unlock()
- {
- LeaveCriticalSection(getMutex(this));
- return true;
- }
-
- const QT3DSU32 MutexImpl::size = sizeof(CRITICAL_SECTION);
-
- class ReadWriteLockImpl
- {
- public:
- ReadWriteLockImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- HANDLE hReaderEvent;
- HANDLE hMutex;
- CRITICAL_SECTION writerMutex;
- LONG counter; // count the number of readers in the lock.
- LONG recursionCounter; // handle recursive writer locking
- };
-
- ReadWriteLock::ReadWriteLock(NVAllocatorCallback &alloc)
- {
- mImpl = QT3DS_NEW(alloc, ReadWriteLockImpl)(alloc);
-
- mImpl->hReaderEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- QT3DS_ASSERT(mImpl->hReaderEvent != NULL);
-
- mImpl->hMutex = CreateEvent(NULL, FALSE, TRUE, NULL);
- QT3DS_ASSERT(mImpl->hMutex != NULL);
-
- InitializeCriticalSection(&mImpl->writerMutex);
- mImpl->counter = -1;
- mImpl->recursionCounter = 0;
- }
-
- ReadWriteLock::~ReadWriteLock()
- {
- if (mImpl->hReaderEvent != NULL) {
- CloseHandle(mImpl->hReaderEvent);
- }
-
- if (mImpl->hMutex != NULL) {
- CloseHandle(mImpl->hMutex);
- }
-
- DeleteCriticalSection(&mImpl->writerMutex);
-
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- void ReadWriteLock::lockReader()
- {
- if (InterlockedIncrement(&mImpl->counter) == 0) {
- WaitForSingleObject(mImpl->hMutex, INFINITE);
- SetEvent(mImpl->hReaderEvent);
- }
-
- WaitForSingleObject(mImpl->hReaderEvent, INFINITE);
- }
-
- void ReadWriteLock::lockWriter()
- {
- EnterCriticalSection(&mImpl->writerMutex);
-
- // we may already have the global mutex(really an event so we have to handle recursion
- // ourselves)
- if (++mImpl->recursionCounter == 1) {
- WaitForSingleObject(mImpl->hMutex, INFINITE);
- }
- }
-
- void ReadWriteLock::unlockReader()
- {
- if (InterlockedDecrement(&mImpl->counter) < 0) {
- ResetEvent(mImpl->hReaderEvent);
- SetEvent(mImpl->hMutex);
- }
- }
-
- void ReadWriteLock::unlockWriter()
- {
- if (--mImpl->recursionCounter == 0) {
- SetEvent(mImpl->hMutex);
- }
-
- LeaveCriticalSection(&mImpl->writerMutex);
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSemaphore.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSemaphore.cpp
deleted file mode 100644
index bb14c104..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSemaphore.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/windows/Qt3DSWindowsInclude.h"
-#include "foundation/Qt3DSSemaphore.h"
-#include "foundation/Qt3DSAllocator.h"
-
-namespace qt3ds {
-namespace foundation {
-
- class SemaphoreImpl
- {
- public:
- SemaphoreImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- HANDLE handle;
- };
-
- Semaphore::Semaphore(NVAllocatorCallback &alloc, QT3DSU32 initialCount, QT3DSU32 maxCount)
- {
- mImpl = QT3DS_NEW(alloc, SemaphoreImpl)(alloc);
- mImpl->handle = CreateSemaphore(0, initialCount, maxCount, (LPCTSTR)NULL);
- }
-
- Semaphore::~Semaphore()
- {
- CloseHandle(mImpl->handle);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- bool Semaphore::wait(QT3DSU32 milliseconds)
- {
- if (milliseconds == -1)
- milliseconds = INFINITE;
-
- return WaitForSingleObject(mImpl->handle, milliseconds) == WAIT_OBJECT_0 ? true : false;
- }
-
- void Semaphore::post() { ReleaseSemaphore(mImpl->handle, 1, (LPLONG)NULL); }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsString.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsString.h
deleted file mode 100644
index 8d5fcd31..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsString.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_FOUNDATION_QT3DS_WINDOWS_STRING_H
-#define QT3DS_FOUNDATION_QT3DS_WINDOWS_STRING_H
-
-#include "foundation/Qt3DS.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-
-#pragma warning(push)
-#pragma warning(disable : 4995 4996)
-
-#ifndef QT3DS_DOXYGEN
-namespace qt3ds {
-#endif
-
-QT3DS_INLINE void NVStrcpy(char *dest, size_t size, const char *src)
-{
- ::strcpy_s(dest, size, src);
-}
-QT3DS_INLINE void NVStrcat(char *dest, size_t size, const char *src)
-{
- ::strcat_s(dest, size, src);
-}
-QT3DS_INLINE QT3DSI32 NVVsprintf(char *dest, size_t size, const char *src, va_list arg)
-{
- QT3DSI32 r = ::vsprintf_s(dest, size, src, arg);
-
- return r;
-}
-QT3DS_INLINE QT3DSI32 NVStricmp(const char *str, const char *str1)
-{
- return (::_stricmp(str, str1));
-}
-
-namespace string {
- QT3DS_INLINE QT3DSI32 stricmp(const char *str, const char *str1) { return (::_stricmp(str, str1)); }
- QT3DS_INLINE QT3DSI32 strnicmp(const char *str, const char *str1, size_t len)
- {
- return (::_strnicmp(str, str1, len));
- }
- QT3DS_INLINE QT3DSI32 strncat_s(char *a, QT3DSI32 b, const char *c, size_t d)
- {
- return (::strncat_s(a, b, c, d));
- }
- QT3DS_INLINE QT3DSI32 strncpy_s(char *strDest, size_t sizeInBytes, const char *strSource,
- size_t count)
- {
- return (::strncpy_s(strDest, sizeInBytes, strSource, count));
- }
- QT3DS_INLINE void strcpy_s(char *dest, size_t size, const char *src)
- {
- ::strcpy_s(dest, size, src);
- }
- QT3DS_INLINE void strcat_s(char *dest, size_t size, const char *src)
- {
- ::strcat_s(dest, size, src);
- }
- QT3DS_INLINE QT3DSI32 _vsnprintf(char *dest, size_t size, const char *src, va_list arg)
- {
- QT3DSI32 r = ::_vsnprintf(dest, size, src, arg);
-
- return r;
- }
- QT3DS_INLINE QT3DSI32 vsprintf_s(char *dest, size_t size, const char *src, va_list arg)
- {
- QT3DSI32 r = ::vsprintf_s(dest, size, src, arg);
-
- return r;
- }
-
- QT3DS_INLINE QT3DSI32 sprintf_s(char *_DstBuf, size_t _DstSize, const char *_Format, ...)
- {
- va_list arg;
- va_start(arg, _Format);
- QT3DSI32 r = ::vsprintf_s(_DstBuf, _DstSize, _Format, arg);
- va_end(arg);
-
- return r;
- }
- QT3DS_INLINE QT3DSI32 sscanf_s(const char *buffer, const char *format, ...)
- {
- va_list arg;
- va_start(arg, format);
- QT3DSI32 r = ::sscanf_s(buffer, format, arg);
- va_end(arg);
-
- return r;
- };
-
- QT3DS_INLINE void strlwr(char *str)
- {
- while (*str) {
- if (*str >= 'A' && *str <= 'Z')
- *str += 32;
- str++;
- }
- }
-
- QT3DS_INLINE void strupr(char *str)
- {
- while (*str) {
- if (*str >= 'a' && *str <= 'z')
- *str -= 32;
- str++;
- }
- }
-
-} // namespace string
-
-#ifndef QT3DS_DOXYGEN
-} // namespace qt3ds
-#endif
-
-#pragma warning(pop)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSync.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSync.cpp
deleted file mode 100644
index 49667e94..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsSync.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/windows/Qt3DSWindowsInclude.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSAllocator.h"
-
-namespace qt3ds {
-namespace foundation {
-
- class SyncImpl
- {
- public:
- SyncImpl(NVAllocatorCallback &alloc)
- : mAllocator(alloc)
- {
- }
- NVAllocatorCallback &mAllocator;
- HANDLE handle;
- };
-
- Sync::Sync(NVAllocatorCallback &alloc)
- {
- mImpl = QT3DS_NEW(alloc, SyncImpl)(alloc);
- mImpl->handle = CreateEvent(0, true, false, 0);
- }
-
- Sync::~Sync()
- {
- CloseHandle(mImpl->handle);
- QT3DS_FREE(mImpl->mAllocator, mImpl);
- }
-
- void Sync::reset() { ResetEvent(mImpl->handle); }
-
- void Sync::set() { SetEvent(mImpl->handle); }
-
- bool Sync::wait(QT3DSU32 milliseconds)
- {
- if (milliseconds == -1)
- milliseconds = INFINITE;
-
- return WaitForSingleObject(mImpl->handle, milliseconds) == WAIT_OBJECT_0 ? true : false;
- }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsThread.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsThread.cpp
deleted file mode 100644
index 3a30de8c..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsThread.cpp
+++ /dev/null
@@ -1,241 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/windows/Qt3DSWindowsInclude.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSThread.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-
-// an exception for setting the thread name in microsoft debuggers
-#define QT3DS_MS_VC_EXCEPTION 0x406D1388
-
-namespace qt3ds {
-namespace foundation {
-
-// struct for naming a thread in the debugger
-#pragma pack(push, 8)
-
- typedef struct tagTHREADNAME_INFO
- {
- DWORD dwType; // Must be 0x1000.
- LPCSTR szName; // Pointer to name (in user addr space).
- DWORD dwThreadID; // Thread ID (-1=caller thread).
- DWORD dwFlags; // Reserved for future use, must be zero.
- } THREADNAME_INFO;
-
-#pragma pack(pop)
-
- namespace {
-
- DWORD WINAPI NVThreadStart(LPVOID arg)
- {
- ((Thread *)arg)->execute();
- return 0;
- }
- }
-
- class ThreadImpl
- {
- public:
- enum State { NotStarted, Started, Stopped };
- ThreadImpl(NVFoundationBase &foundation)
- : mFoundation(foundation)
- {
- }
- NVFoundationBase &mFoundation;
- HANDLE thread;
- LONG quitNow; // Should be 32bit aligned on SMP systems.
- State state;
- DWORD threadID;
-
- Thread::ExecuteFn fn;
- void *arg;
- };
-
- Thread::Id Thread::getId() { return static_cast<Id>(GetCurrentThreadId()); }
-
- Thread::Thread(NVFoundationBase &foundation)
- {
- mImpl = (ThreadImpl *)QT3DS_NEW(foundation.getAllocator(), ThreadImpl)(foundation);
- mImpl->thread = NULL;
- mImpl->state = ThreadImpl::NotStarted;
- mImpl->quitNow = 0;
- }
-
- Thread::Thread(NVFoundationBase &foundation, ExecuteFn fn, void *arg)
- {
- mImpl = (ThreadImpl *)QT3DS_NEW(foundation.getAllocator(), ThreadImpl)(foundation);
- mImpl->thread = NULL;
- mImpl->state = ThreadImpl::NotStarted;
- mImpl->quitNow = 0;
- mImpl->fn = fn;
- mImpl->arg = arg;
-
- start(0);
- }
-
- Thread::~Thread()
- {
- if (mImpl->state == ThreadImpl::Started)
- kill();
- CloseHandle(mImpl->thread);
- QT3DS_FREE(mImpl->mFoundation.getAllocator(), mImpl);
- }
-
- void Thread::start(QT3DSU32 stackSize)
- {
- if (mImpl->state != ThreadImpl::NotStarted)
- return;
- mImpl->state = ThreadImpl::Started;
-
- mImpl->thread =
- CreateThread(NULL, stackSize, NVThreadStart, (LPVOID)this, 0, &mImpl->threadID);
- }
-
- void Thread::signalQuit() { InterlockedIncrement(&(mImpl->quitNow)); }
-
- bool Thread::waitForQuit()
- {
- if (mImpl->state == ThreadImpl::NotStarted)
- return false;
-
- WaitForSingleObject(mImpl->thread, INFINITE);
- return true;
- }
-
- bool Thread::quitIsSignalled()
- {
- return InterlockedCompareExchange(&(mImpl->quitNow), 0, 0) != 0;
- }
-
- void Thread::quit()
- {
- mImpl->state = ThreadImpl::Stopped;
- ExitThread(0);
- }
-
- void Thread::kill()
- {
- if (mImpl->state == ThreadImpl::Started)
- TerminateThread(mImpl->thread, 0);
- mImpl->state = ThreadImpl::Stopped;
- }
-
- void Thread::sleep(QT3DSU32 ms) { Sleep(ms); }
-
- void Thread::yield() { SwitchToThread(); }
-
- void Thread::execute(void) { (*mImpl->fn)(mImpl->arg); }
-
- QT3DSU32 Thread::setAffinityMask(QT3DSU32 mask)
- {
- return mask ? (QT3DSU32)SetThreadAffinityMask(mImpl->thread, mask) : 0;
- }
-
- void Thread::setName(const char *name)
- {
- THREADNAME_INFO info;
- info.dwType = 0x1000;
- info.szName = name;
- info.dwThreadID = mImpl->threadID;
- info.dwFlags = 0;
-
-#ifdef QT3DS_VC
- // C++ Exceptions are disabled for this project, but SEH is not (and cannot be)
- // http://stackoverflow.com/questions/943087/what-exactly-will-happen-if-i-disable-c-exceptions-in-a-project
- __try {
- RaiseException(QT3DS_MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR),
- (ULONG_PTR *)&info);
- } __except (EXCEPTION_EXECUTE_HANDLER) {
- // this runs if not attached to a debugger (thus not really naming the thread)
- }
-#else
- RaiseException(QT3DS_MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR),
- (ULONG_PTR *)&info);
-#endif
- }
-
- void Thread::setPriority(ThreadPriority::Enum prio)
- {
- switch (prio) {
- case ThreadPriority::eHIGH:
- SetThreadPriority(mImpl->thread, THREAD_PRIORITY_HIGHEST);
- break;
- case ThreadPriority::eABOVE_NORMAL:
- SetThreadPriority(mImpl->thread, THREAD_PRIORITY_ABOVE_NORMAL);
- break;
- case ThreadPriority::eNORMAL:
- SetThreadPriority(mImpl->thread, THREAD_PRIORITY_NORMAL);
- break;
- case ThreadPriority::eBELOW_NORMAL:
- SetThreadPriority(mImpl->thread, THREAD_PRIORITY_BELOW_NORMAL);
- break;
- case ThreadPriority::eLOW:
- SetThreadPriority(mImpl->thread, THREAD_PRIORITY_LOWEST);
- break;
- default:
- break;
- }
- }
-
- ThreadPriority::Enum Thread::getPriority(Id threadId)
- {
- ThreadPriority::Enum retval = ThreadPriority::eLOW;
- int priority = GetThreadPriority((HANDLE)threadId);
- StaticAssert<(THREAD_PRIORITY_HIGHEST > THREAD_PRIORITY_ABOVE_NORMAL)>::valid_expression();
- if (priority >= THREAD_PRIORITY_HIGHEST)
- retval = ThreadPriority::eHIGH;
- else if (priority >= THREAD_PRIORITY_ABOVE_NORMAL)
- retval = ThreadPriority::eABOVE_NORMAL;
- else if (priority >= THREAD_PRIORITY_NORMAL)
- retval = ThreadPriority::eNORMAL;
- else if (priority >= THREAD_PRIORITY_BELOW_NORMAL)
- retval = ThreadPriority::eBELOW_NORMAL;
- return retval;
- }
-
- QT3DSU32 TlsAlloc()
- {
- DWORD rv = ::TlsAlloc();
- QT3DS_ASSERT(rv != TLS_OUT_OF_INDEXES);
- return (QT3DSU32)rv;
- }
-
- void TlsFree(QT3DSU32 index) { ::TlsFree(index); }
-
- void *TlsGet(QT3DSU32 index) { return ::TlsGetValue(index); }
-
- QT3DSU32 TlsSet(QT3DSU32 index, void *value) { return ::TlsSetValue(index, value); }
-
- const QT3DSU32 Thread::DEFAULT_STACK_SIZE = 1048576;
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTime.cpp b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTime.cpp
deleted file mode 100644
index 9215d642..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTime.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSTime.h"
-#include "foundation/windows/Qt3DSWindowsInclude.h"
-
-namespace {
-::qt3ds::QT3DSI64 getTimeTicks()
-{
- LARGE_INTEGER a;
- QueryPerformanceCounter(&a);
- return a.QuadPart;
-}
-
-double getTickDuration()
-{
- LARGE_INTEGER a;
- QueryPerformanceFrequency(&a);
- return 1.0f / double(a.QuadPart);
-}
-
-double sTickDuration = getTickDuration();
-} // namespace
-
-namespace qt3ds {
-namespace foundation {
-
- const CounterFrequencyToTensOfNanos Time::sCounterFreq = Time::getCounterFrequency();
-
- CounterFrequencyToTensOfNanos Time::getCounterFrequency()
- {
- LARGE_INTEGER freq;
- QueryPerformanceFrequency(&freq);
- return CounterFrequencyToTensOfNanos(Time::sNumTensOfNanoSecondsInASecond, freq.QuadPart);
- }
-
- QT3DSU64 Time::getCurrentCounterValue()
- {
- LARGE_INTEGER ticks;
- QueryPerformanceCounter(&ticks);
- return ticks.QuadPart;
- }
-
- Time::Time()
- : mTickCount(0)
- {
- getElapsedSeconds();
- }
-
- Time::Second Time::getElapsedSeconds()
- {
- QT3DSI64 lastTickCount = mTickCount;
- mTickCount = getTimeTicks();
- return (mTickCount - lastTickCount) * sTickDuration;
- }
-
- Time::Second Time::peekElapsedSeconds()
- {
- return (getTimeTicks() - mTickCount) * sTickDuration;
- }
-
- Time::Second Time::getLastTime() const { return mTickCount * sTickDuration; }
-
-} // namespace foundation
-} // namespace qt3ds
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTrigConstants.h b/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTrigConstants.h
deleted file mode 100644
index e3da844c..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/Qt3DSWindowsTrigConstants.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_WINDOWS_TRIG_CONSTANTS_H
-#define QT3DS_WINDOWS_TRIG_CONSTANTS_H
-
-#define QT3DS_GLOBALCONST extern const __declspec(selectany)
-
-__declspec(align(16)) struct QT3DS_VECTORF32
-{
- float f[4];
-};
-
-#define QT3DS_PI 3.141592654f
-#define QT3DS_2PI 6.283185307f
-#define QT3DS_1DIVPI 0.318309886f
-#define QT3DS_1DIV2PI 0.159154943f
-#define QT3DS_PIDIV2 1.570796327f
-#define QT3DS_PIDIV4 0.785398163f
-
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinCoefficients0 = { 1.0f, -0.166666667f, 8.333333333e-3f,
- -1.984126984e-4f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinCoefficients1 = { 2.755731922e-6f, -2.505210839e-8f,
- 1.605904384e-10f, -7.647163732e-13f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinCoefficients2 = { 2.811457254e-15f, -8.220635247e-18f,
- 1.957294106e-20f, -3.868170171e-23f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosCoefficients0 = { 1.0f, -0.5f, 4.166666667e-2f,
- -1.388888889e-3f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosCoefficients1 = { 2.480158730e-5f, -2.755731922e-7f,
- 2.087675699e-9f, -1.147074560e-11f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosCoefficients2 = { 4.779477332e-14f, -1.561920697e-16f,
- 4.110317623e-19f, -8.896791392e-22f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanCoefficients0 = { 1.0f, 0.333333333f, 0.133333333f,
- 5.396825397e-2f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanCoefficients1 = { 2.186948854e-2f, 8.863235530e-3f,
- 3.592128167e-3f, 1.455834485e-3f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanCoefficients2 = { 5.900274264e-4f, 2.391290764e-4f,
- 9.691537707e-5f, 3.927832950e-5f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinCoefficients0 = { -0.05806367563904f, -0.41861972469416f,
- 0.22480114791621f, 2.17337241360606f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinCoefficients1 = { 0.61657275907170f, 4.29696498283455f,
- -1.18942822255452f, -6.53784832094831f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinCoefficients2 = { -1.36926553863413f, -4.48179294237210f,
- 1.41810672941833f, 5.48179257935713f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanCoefficients0 = { 1.0f, 0.333333334f, 0.2f, 0.142857143f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanCoefficients1 = { 1.111111111e-1f, 9.090909091e-2f,
- 7.692307692e-2f, 6.666666667e-2f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanCoefficients2 = { 5.882352941e-2f, 5.263157895e-2f,
- 4.761904762e-2f, 4.347826087e-2f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXSinEstCoefficients = { 1.0f, -1.66521856991541e-1f,
- 8.199913018755e-3f, -1.61475937228e-4f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXCosEstCoefficients = { 1.0f, -4.95348008918096e-1f,
- 3.878259962881e-2f, -9.24587976263e-4f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXTanEstCoefficients = { 2.484f, -1.954923183e-1f, 2.467401101f,
- QT3DS_1DIVPI };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXATanEstCoefficients = { 7.689891418951e-1f, 1.104742493348f,
- 8.661844266006e-1f, QT3DS_PIDIV2 };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinEstCoefficients = { -1.36178272886711f, 2.37949493464538f,
- -8.08228565650486e-1f,
- 2.78440142746736e-1f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXASinEstConstants = { 1.00000011921f, QT3DS_PIDIV2, 0.0f, 0.0f };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXPiConstants0 = { QT3DS_PI, QT3DS_2PI, QT3DS_1DIVPI, QT3DS_1DIV2PI };
-QT3DS_GLOBALCONST QT3DS_VECTORF32 g_PXReciprocalTwoPi = { QT3DS_1DIV2PI, QT3DS_1DIV2PI, QT3DS_1DIV2PI,
- QT3DS_1DIV2PI };
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/SocketImpl.h b/src/Runtime/ogl-runtime/src/foundation/windows/SocketImpl.h
deleted file mode 100644
index f72203bd..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/SocketImpl.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*
-LuaSocket 3.0 license
-Copyright � 2004-2013 Diego Nehab
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef FOUNDATION_WINDOWS_SOCKET_IMPL_H
-#define FOUNDATION_WINDOWS_SOCKET_IMPL_H
-#pragma once
-#include <winsock.h>
-#pragma warning(disable : 4127)
-#pragma warning(disable : 4702)
-
-namespace qt3ds {
-namespace foundation {
- namespace socketimpl {
-
- // Functions take from lua socket implementation. Note that it has an MIT license.
-
- enum {
- IO_DONE = 0, /* operation completed successfully */
- IO_TIMEOUT = -1, /* operation timed out */
- IO_CLOSED = -2, /* the connection has been closed */
- IO_UNKNOWN = -3
- };
-
- /*-------------------------------------------------------------------------*\
- * I/O error strings
- \*-------------------------------------------------------------------------*/
- const char *io_strerror(int err)
- {
- switch (err) {
- case IO_DONE:
- return NULL;
- case IO_CLOSED:
- return "closed";
- case IO_TIMEOUT:
- return "timeout";
- default:
- return "unknown error";
- }
- }
-
- typedef int socklen_t;
- typedef SOCKET t_socket;
- typedef t_socket *p_socket;
- typedef struct sockaddr SA;
-
-#define SOCKET_INVALID (INVALID_SOCKET)
-
- static const char *wstrerror(int err)
- {
- switch (err) {
- case WSAEINTR:
- return "Interrupted function call";
- case WSAEACCES:
- return "Permission denied";
- case WSAEFAULT:
- return "Bad address";
- case WSAEINVAL:
- return "Invalid argument";
- case WSAEMFILE:
- return "Too many open files";
- case WSAEWOULDBLOCK:
- return "Resource temporarily unavailable";
- case WSAEINPROGRESS:
- return "Operation now in progress";
- case WSAEALREADY:
- return "Operation already in progress";
- case WSAENOTSOCK:
- return "Socket operation on nonsocket";
- case WSAEDESTADDRREQ:
- return "Destination address required";
- case WSAEMSGSIZE:
- return "Message too long";
- case WSAEPROTOTYPE:
- return "Protocol wrong type for socket";
- case WSAENOPROTOOPT:
- return "Bad protocol option";
- case WSAEPROTONOSUPPORT:
- return "Protocol not supported";
- case WSAESOCKTNOSUPPORT:
- return "Socket type not supported";
- case WSAEOPNOTSUPP:
- return "Operation not supported";
- case WSAEPFNOSUPPORT:
- return "Protocol family not supported";
- case WSAEAFNOSUPPORT:
- return "Address family not supported by protocol family";
- case WSAEADDRINUSE:
- return "Address already in use";
- case WSAEADDRNOTAVAIL:
- return "Cannot assign requested address";
- case WSAENETDOWN:
- return "Network is down";
- case WSAENETUNREACH:
- return "Network is unreachable";
- case WSAENETRESET:
- return "Network dropped connection on reset";
- case WSAECONNABORTED:
- return "Software caused connection abort";
- case WSAECONNRESET:
- return "Connection reset by peer";
- case WSAENOBUFS:
- return "No buffer space available";
- case WSAEISCONN:
- return "Socket is already connected";
- case WSAENOTCONN:
- return "Socket is not connected";
- case WSAESHUTDOWN:
- return "Cannot send after socket shutdown";
- case WSAETIMEDOUT:
- return "Connection timed out";
- case WSAECONNREFUSED:
- return "Connection refused";
- case WSAEHOSTDOWN:
- return "Host is down";
- case WSAEHOSTUNREACH:
- return "No route to host";
- case WSAEPROCLIM:
- return "Too many processes";
- case WSASYSNOTREADY:
- return "Network subsystem is unavailable";
- case WSAVERNOTSUPPORTED:
- return "Winsock.dll version out of range";
- case WSANOTINITIALISED:
- return "Successful WSAStartup not yet performed";
- case WSAEDISCON:
- return "Graceful shutdown in progress";
- case WSAHOST_NOT_FOUND:
- return "Host not found";
- case WSATRY_AGAIN:
- return "Nonauthoritative host not found";
- case WSANO_RECOVERY:
- return "Nonrecoverable name lookup error";
- case WSANO_DATA:
- return "Valid name, no data record of requested type";
- default:
- return "Unknown error";
- }
- }
-
- const char *socket_strerror(int err)
- {
- switch (err) {
- case WSAEADDRINUSE:
- return "address already in use";
- case WSAECONNREFUSED:
- return "connection refused";
- case WSAEISCONN:
- return "already connected";
- case WSAEACCES:
- return "permission denied";
- case WSAECONNABORTED:
- return "closed";
- case WSAECONNRESET:
- return "closed";
- case WSAETIMEDOUT:
- return "timeout";
- default:
- return wstrerror(err);
- }
- }
-
- int socket_open(void)
- {
- WSADATA wsaData;
- WORD wVersionRequested = MAKEWORD(2, 0);
- int err = WSAStartup(wVersionRequested, &wsaData);
- if (err != 0)
- return 0;
- if ((LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0)
- && (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1)) {
- WSACleanup();
- return 0;
- }
- return 1;
- }
-
- /*-------------------------------------------------------------------------*\
- * Close module
- \*-------------------------------------------------------------------------*/
- int socket_close(void)
- {
- WSACleanup();
- return 1;
- }
-
-/*-------------------------------------------------------------------------*\
-* Wait for readable/writable/connected socket with timeout
-\*-------------------------------------------------------------------------*/
-#define WAITFD_R 1
-#define WAITFD_W 2
-#define WAITFD_E 4
-#define WAITFD_C (WAITFD_E | WAITFD_W)
-
- static int socket_waitfd(p_socket ps, int sw, QT3DSU32 timeoutMilliseconds)
- {
- int ret;
- fd_set rfds, wfds, efds, *rp = NULL, *wp = NULL, *ep = NULL;
- struct timeval tv, *tp = NULL;
- if (timeoutMilliseconds == 0)
- return IO_TIMEOUT; /* optimize timeout == 0 case */
- if (sw & WAITFD_R) {
- FD_ZERO(&rfds);
- FD_SET(*ps, &rfds);
- rp = &rfds;
- }
- if (sw & WAITFD_W) {
- FD_ZERO(&wfds);
- FD_SET(*ps, &wfds);
- wp = &wfds;
- }
- if (sw & WAITFD_C) {
- FD_ZERO(&efds);
- FD_SET(*ps, &efds);
- ep = &efds;
- }
- if (timeoutMilliseconds >= 0.0) {
- tv.tv_sec = (int)(timeoutMilliseconds / 1000);
- QT3DSU32 leftover = timeoutMilliseconds % 1000;
- tv.tv_usec = (int)(leftover * 100000);
- tp = &tv;
- }
- ret = select(0, rp, wp, ep, tp);
- if (ret == -1)
- return WSAGetLastError();
- if (ret == 0)
- return IO_TIMEOUT;
- if (sw == WAITFD_C && FD_ISSET(*ps, &efds))
- return IO_CLOSED;
- return IO_DONE;
- }
-
- static int socket_send(p_socket ps, const char *data, size_t count, size_t *sent,
- QT3DSU32 timeoutMilliseconds)
- {
- int err;
- *sent = 0;
- /* avoid making system calls on closed sockets */
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- /* loop until we send something or we give up on error */
- for (;;) {
- /* try to send something */
- int put = send(*ps, data, (int)count, 0);
- /* if we sent something, we are done */
- if (put > 0) {
- *sent = put;
- return IO_DONE;
- }
- /* deal with failure */
- err = WSAGetLastError();
- /* we can only proceed if there was no serious error */
- if (err != WSAEWOULDBLOCK)
- return err;
- /* avoid busy wait */
- if ((err = socket_waitfd(ps, WAITFD_W, timeoutMilliseconds)) != IO_DONE)
- return err;
- }
- /* can't reach here */
- return IO_UNKNOWN;
- }
- /*-------------------------------------------------------------------------*\
- * Receive with timeout
- \*-------------------------------------------------------------------------*/
- static int socket_recv(p_socket ps, char *data, size_t count, size_t *got,
- QT3DSU32 timeoutMilliseconds)
- {
- int err;
- *got = 0;
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- for (;;) {
- int taken = recv(*ps, data, (int)count, 0);
- if (taken > 0) {
- *got = taken;
- return IO_DONE;
- }
- if (taken == 0)
- return IO_CLOSED;
- err = WSAGetLastError();
- if (err != WSAEWOULDBLOCK)
- return err;
- if ((err = socket_waitfd(ps, WAITFD_R, timeoutMilliseconds)) != IO_DONE)
- return err;
- }
- return IO_UNKNOWN;
- }
-
- void socket_setblocking(p_socket ps)
- {
- u_long argp = 0;
- ioctlsocket(*ps, FIONBIO, &argp);
- }
-
- /*-------------------------------------------------------------------------*\
- * Put socket into non-blocking mode
- \*-------------------------------------------------------------------------*/
- void socket_setnonblocking(p_socket ps)
- {
- u_long argp = 1;
- ioctlsocket(*ps, FIONBIO, &argp);
- }
-
- int socket_listen(p_socket ps, int backlog)
- {
- int err = IO_DONE;
- socket_setblocking(ps);
- if (listen(*ps, backlog) < 0)
- err = WSAGetLastError();
- socket_setnonblocking(ps);
- return err;
- }
-
- /*-------------------------------------------------------------------------*\
- * Accept with timeout
- \*-------------------------------------------------------------------------*/
- static int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, QT3DSU32 tm)
- {
- SA daddr;
- socklen_t dlen = sizeof(daddr);
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- if (!addr)
- addr = &daddr;
- if (!len)
- len = &dlen;
- for (;;) {
- int err;
- /* try to get client socket */
- if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID)
- return IO_DONE;
- /* find out why we failed */
- err = WSAGetLastError();
- /* if we failed because there was no connectoin, keep trying */
- if (err != WSAEWOULDBLOCK && err != WSAECONNABORTED)
- return err;
- /* call select to avoid busy wait */
- if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE)
- return err;
- }
- /* can't reach here */
- return IO_UNKNOWN;
- }
-
- int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp)
- {
- *hp = gethostbyaddr(addr, len, AF_INET);
- if (*hp)
- return IO_DONE;
- else
- return WSAGetLastError();
- }
-
- int socket_gethostbyname(const char *addr, struct hostent **hp)
- {
- *hp = gethostbyname(addr);
- if (*hp)
- return IO_DONE;
- else
- return WSAGetLastError();
- }
-
- /*-------------------------------------------------------------------------*\
- * Error translation functions
- \*-------------------------------------------------------------------------*/
- const char *socket_hoststrerror(int err)
- {
- if (err <= 0)
- return io_strerror(err);
- switch (err) {
- case WSAHOST_NOT_FOUND:
- return "host not found";
- default:
- return wstrerror(err);
- }
- }
- /*-------------------------------------------------------------------------*\
- * Close and inutilize socket
- \*-------------------------------------------------------------------------*/
- void socket_destroy(p_socket ps)
- {
- if (*ps != SOCKET_INVALID) {
- socket_setblocking(ps); /* close can take a long time on WIN32 */
- closesocket(*ps);
- *ps = SOCKET_INVALID;
- }
- }
-
- /*-------------------------------------------------------------------------*\
- *
- \*-------------------------------------------------------------------------*/
- void socket_shutdown(p_socket ps, int how)
- {
- socket_setblocking(ps);
- shutdown(*ps, how);
- }
-
- int socket_create(p_socket ps, int domain, int type, int protocol)
- {
- *ps = socket(domain, type, protocol);
- if (*ps != SOCKET_INVALID)
- return IO_DONE;
- else
- return WSAGetLastError();
- }
-
- /*-------------------------------------------------------------------------*\
- * Connects or returns error message
- \*-------------------------------------------------------------------------*/
- int socket_connect(p_socket ps, SA *addr, socklen_t len, QT3DSU32 tm)
- {
- int err;
- /* don't call on closed socket */
- if (*ps == SOCKET_INVALID)
- return IO_CLOSED;
- /* ask system to connect */
- if (connect(*ps, addr, len) == 0)
- return IO_DONE;
- /* make sure the system is trying to connect */
- err = WSAGetLastError();
- if (err != WSAEWOULDBLOCK && err != WSAEINPROGRESS)
- return err;
- /* zero timeout case optimization */
- if (tm == 0)
- return IO_TIMEOUT;
- /* we wait until something happens */
- err = socket_waitfd(ps, WAITFD_C, tm);
- if (err == IO_CLOSED) {
- int len = sizeof(err);
- /* give windows time to set the error (yes, disgusting) */
- Sleep(10);
- /* find out why we failed */
- getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len);
- /* we KNOW there was an error. if 'why' is 0, we will return
- * "unknown error", but it's not really our fault */
- return err > 0 ? err : IO_UNKNOWN;
- } else
- return err;
- }
-
- /*-------------------------------------------------------------------------*\
- * Binds or returns error message
- \*-------------------------------------------------------------------------*/
- int socket_bind(p_socket ps, SA *addr, socklen_t len)
- {
- int err = IO_DONE;
- socket_setblocking(ps);
- if (bind(*ps, addr, len) < 0)
- err = WSAGetLastError();
- socket_setnonblocking(ps);
- return err;
- }
- }
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/foundation/windows/qt_attribution.json b/src/Runtime/ogl-runtime/src/foundation/windows/qt_attribution.json
deleted file mode 100644
index e0310cfa..00000000
--- a/src/Runtime/ogl-runtime/src/foundation/windows/qt_attribution.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "Id": "qt3dswindowsaos",
- "Name": "Qt3DSWindowsAoS",
- "QDocModule": "qt3dstudio",
- "QtUsage": "Used by Qt3DStudio, Runtime component.",
-
- "License": "Other",
- "LicenseFile": "LICENSE.TXT",
- "Copyright": "Copyright (c) 2001 Intel Corporation."
-}
diff --git a/src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.cpp b/src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.cpp
deleted file mode 100644
index 94f6712f..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifdef PLATFORM_HAS_CUDA
-
-#include "CUDABSDFMipmap.h"
-#include "cuda.h"
-#include "cuda_runtime.h"
-#include "cuda_gl_interop.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "nv_log.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-
-__host__ void jerror1(cudaError error);
-#ifdef _DEBUG
-#define CHECK_AND_HANDLE_CUDA_ERROR(func) \
- func; \
- { \
- cudaError error = cudaGetLastError(); \
- if (error != cudaSuccess) { \
- printf("%s\n", cudaGetErrorString(error)); \
- jerror1(error); \
- QT3DS_ASSERT(false); \
- } \
- }
-#else
-#define CHECK_AND_HANDLE_CUDA_ERROR(func) func;
-#endif
-
-CUDABSDFMipMap::CUDABSDFMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat, NVFoundationBase &inFnd)
- : BSDFMipMap(inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd)
- , m_TextureBinded(false)
-{
-
- // CHECK_AND_HANDLE_CUDA_ERROR( cudaFree( 0 ); )
- m_Pitches = (size_t *)QT3DS_ALLOC(m_Foundation.getAllocator(),
- sizeof(size_t) * m_MaxMipMapLevel + 1, "BSDF MipMap pitches");
- md_MipMapsData = (void **)QT3DS_ALLOC(m_Foundation.getAllocator(),
- sizeof(void *) * m_MaxMipMapLevel + 1, "BSDF MipMap data");
- // CHECK_AND_HANDLE_CUDA_ERROR();
- size_t imagePitch;
- int width = m_Width;
- int height = m_Height;
-
- for (int i = 0; i <= m_MaxMipMapLevel; ++i) {
- imagePitch = m_SizeOfFormat * width;
- // checkCudaErrors(cudaMalloc((void **)&cuda_dest_resource[mip], size_tex_data));
- CHECK_AND_HANDLE_CUDA_ERROR(
- cudaMallocPitch((void **)&md_MipMapsData[i], &m_Pitches[i], imagePitch, height);)
- CHECK_AND_HANDLE_CUDA_ERROR(cudaMemset(md_MipMapsData[i], -1, m_Pitches[i] * height);)
-
- width = width > 2 ? width >> 1 : 1;
- height = height > 2 ? height >> 1 : 1;
- }
-}
-
-CUDABSDFMipMap::~CUDABSDFMipMap()
-{
- // CHECK_AND_HANDLE_CUDA_ERROR( cudaDeviceReset(); )
- CHECK_AND_HANDLE_CUDA_ERROR(cudaDeviceSynchronize();)
- for (int i = 0; i <= m_MaxMipMapLevel; ++i) {
- CHECK_AND_HANDLE_CUDA_ERROR(cudaFree(md_MipMapsData[i]);)
- }
- QT3DS_FREE(m_Foundation.getAllocator(), md_MipMapsData);
- QT3DS_FREE(m_Foundation.getAllocator(), m_Pitches);
-}
-
-void CUDABSDFMipMap::BindTexture()
-{
- if (!m_TextureBinded) {
- m_TextureBinded = true;
-
- int width = m_Width;
- int height = m_Height;
- for (int i = 0; i <= m_MaxMipMapLevel; ++i) {
- // if you wwant to change some texture filter settings use m_Texture2D object
- m_Texture2D.SetTextureData(NVDataRef<QT3DSU8>(), (QT3DSU8)i, width, height,
- NVRenderTextureFormats::RGBA16F,
- NVRenderTextureFormats::RGBA16F);
-
- width = width > 2 ? width >> 1 : 1;
- height = height > 2 ? height >> 1 : 1;
- }
- // CHECK_AND_HANDLE_CUDA_ERROR( cudaGraphicsGLRegisterImage( &m_CudaMipMapResource,
- // (GLuint)m_TextureHandle, GL_TEXTURE_2D, cudaGraphicsRegisterFlagsWriteDiscard |
- // cudaGraphicsRegisterFlagsTextureGather) )
- CHECK_AND_HANDLE_CUDA_ERROR(cudaGraphicsGLRegisterImage(
- &m_CudaMipMapResource, (GLuint)m_TextureHandle, GL_TEXTURE_2D,
- cudaGraphicsRegisterFlagsWriteDiscard | cudaGraphicsRegisterFlagsTextureGather))
- }
-}
-
-void CUDABSDFMipMap::TransferTexture() // after cuda generation
-{
- cudaArray *texturePtr;
- CHECK_AND_HANDLE_CUDA_ERROR(cudaGraphicsMapResources(1, &m_CudaMipMapResource, 0))
- int width = m_Width;
- int height = m_Height;
- for (int i = 0; i <= m_MaxMipMapLevel; ++i) {
- CHECK_AND_HANDLE_CUDA_ERROR(
- cudaGraphicsSubResourceGetMappedArray(&texturePtr, m_CudaMipMapResource, 0, i))
- CHECK_AND_HANDLE_CUDA_ERROR(cudaMemcpy2DToArray(texturePtr, 0, 0, md_MipMapsData[i],
- m_Pitches[i], width * m_SizeOfFormat,
- height, cudaMemcpyDeviceToDevice));
-
- width = width > 2 ? width >> 1 : 1;
- height = height > 2 ? height >> 1 : 1;
- }
- CHECK_AND_HANDLE_CUDA_ERROR(cudaGraphicsUnmapResources(1, &m_CudaMipMapResource, 0))
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.h b/src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.h
deleted file mode 100644
index 33e0b91c..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/CUDABSDFMipmap.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CUDABSDfMIPMAP_H
-#define CUDABSDFMIPMAP_H
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "MipmapBSDF.h"
-
-#include "Qt3DSRenderLoadedTexture.h"
-
-#include "Qt3DSTypes.h"
-struct cudaGraphicsResource;
-#ifdef _LINUXPLATFORM
-#define __declspec(dllexport)
-#define __cdecl
-
-#endif
-using namespace qt3ds::render;
-
-class CUDABSDFMipMap : public BSDFMipMap
-{
-public:
- CUDABSDFMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture, NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
- ~CUDABSDFMipMap();
- void Build(void *inTextureData, int inTextureDataSize,
- NVRenderBackend::NVRenderBackendTextureObject inTextureHandle,
- NVRenderTextureFormats::Enum inFormat);
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation);
-
-private:
- void CreateBsdfMipMaps(qt3ds::render::SLoadedTexture &inLoadedImage, void **result, int width,
- int height); //, qt3ds::foundation::IPerfTimer& inPerfTimer);
-
- void BindTexture();
- void TransferTexture();
-
- cudaGraphicsResource *m_CudaMipMapResource;
- void **md_MipMapsData;
- size_t *m_Pitches;
- NVRenderBackend::NVRenderBackendTextureObject m_TextureHandle;
- bool m_TextureBinded;
-};
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/hdr/GLComputeMipMap.h b/src/Runtime/ogl-runtime/src/hdr/GLComputeMipMap.h
deleted file mode 100644
index a1a7ce5f..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/GLComputeMipMap.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GLCOMPUTE_BSDF_MIMAP_H
-#define GLCOMPUTE_BSDF_MIMAP_H
-
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "MipmapBSDF.h"
-
-#include "Qt3DSRenderLoadedTexture.h"
-#include "Qt3DSTypes.h"
-
-using namespace qt3ds::render;
-
-class qt3ds::render::NVRenderContext;
-class qt3ds::render::NVRenderShaderProgram;
-class qt3ds::render::NVRenderTexture2D;
-
-class GLComputeMipMap : public BSDFMipMap
-{
-public:
- GLComputeMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture, NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
- ~GLComputeMipMap();
- void Build(void *inTextureData, int inTextureDataSize,
- NVRenderBackend::NVRenderBackendTextureObject inTextureHandle,
- NVRenderTextureFormats::Enum inFormat);
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation);
-
-private:
- void CreateLevel0Tex(void *inTextureData, int inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat);
-
- NVScopedRefCounted<NVRenderShaderProgram> m_BSDFProgram;
- NVScopedRefCounted<NVRenderShaderProgram> m_UploadProgram_RGBA8;
- NVScopedRefCounted<NVRenderShaderProgram> m_UploadProgram_RGB8;
- NVScopedRefCounted<NVRenderTexture2D> m_Level0Tex;
- bool m_TextureCreated;
-
- void createComputeProgram(NVRenderContext *context);
- NVRenderShaderProgram *getOrCreateUploadComputeProgram(NVRenderContext *context,
- NVRenderTextureFormats::Enum inFormat);
-};
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/hdr/GLComputeMipmap.cpp b/src/Runtime/ogl-runtime/src/hdr/GLComputeMipmap.cpp
deleted file mode 100644
index 36b550dd..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/GLComputeMipmap.cpp
+++ /dev/null
@@ -1,394 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "GLComputeMipMap.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "render/Qt3DSRenderContext.h"
-#include "nv_log.h"
-#include <string>
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-
-static const char *computeUploadShader(std::string &prog, NVRenderTextureFormats::Enum inFormat,
- bool binESContext)
-{
- if (binESContext) {
- prog += "#version 310 es\n"
- "#extension GL_ARB_compute_shader : enable\n"
- "precision highp float;\n"
- "precision highp int;\n"
- "precision mediump image2D;\n";
- } else {
- prog += "#version 430\n"
- "#extension GL_ARB_compute_shader : enable\n";
- }
-
- if (inFormat == NVRenderTextureFormats::RGBA8) {
- prog += "// Set workgroup layout;\n"
- "layout (local_size_x = 16, local_size_y = 16) in;\n\n"
- "layout (rgba8, binding = 1) uniform image2D inputImage;\n\n"
- "layout (rgba16f, binding = 2) uniform image2D outputImage;\n\n"
- "void main()\n"
- "{\n"
- " if ( gl_GlobalInvocationID.x >= gl_NumWorkGroups.x || gl_GlobalInvocationID.y "
- ">= gl_NumWorkGroups.y )\n"
- " return;\n"
- " vec4 value = imageLoad(inputImage, ivec2(gl_GlobalInvocationID.xy));\n"
- " imageStore( outputImage, ivec2(gl_GlobalInvocationID.xy), value );\n"
- "}\n";
- } else {
- prog += "float convertToFloat( in uint inValue )\n"
- "{\n"
- " uint v = inValue & uint(0xFF);\n"
- " float f = float(v)/256.0;\n"
- " return f;\n"
- "}\n";
-
- prog += "int getMod( in int inValue, in int mod )\n"
- "{\n"
- " int v = mod * (inValue/mod);\n"
- " return inValue - v;\n"
- "}\n";
-
- prog += "vec4 getRGBValue( in int byteNo, vec4 inVal, vec4 inVal1 )\n"
- "{\n"
- " vec4 result= vec4(0.0);\n"
- " if( byteNo == 0) {\n"
- " result.r = inVal.r;\n"
- " result.g = inVal.g;\n"
- " result.b = inVal.b;\n"
- " }\n"
- " else if( byteNo == 1) {\n"
- " result.r = inVal.g;\n"
- " result.g = inVal.b;\n"
- " result.b = inVal.a;\n"
- " }\n"
- " else if( byteNo == 2) {\n"
- " result.r = inVal.b;\n"
- " result.g = inVal.a;\n"
- " result.b = inVal1.r;\n"
- " }\n"
- " else if( byteNo == 3) {\n"
- " result.r = inVal.a;\n"
- " result.g = inVal1.r;\n"
- " result.b = inVal1.g;\n"
- " }\n"
- " return result;\n"
- "}\n";
-
- prog += "// Set workgroup layout;\n"
- "layout (local_size_x = 16, local_size_y = 16) in;\n\n"
- "layout (rgba8, binding = 1) uniform image2D inputImage;\n\n"
- "layout (rgba16f, binding = 2) uniform image2D outputImage;\n\n"
- "void main()\n"
- "{\n"
- " vec4 result = vec4(0.0);\n"
- " if ( gl_GlobalInvocationID.x >= gl_NumWorkGroups.x || gl_GlobalInvocationID.y "
- ">= gl_NumWorkGroups.y )\n"
- " return;\n"
- " int xpos = (int(gl_GlobalInvocationID.x)*3)/4;\n"
- " int xmod = getMod(int(gl_GlobalInvocationID.x)*3, 4);\n"
- " ivec2 readPos = ivec2(xpos, gl_GlobalInvocationID.y);\n"
- " vec4 value = imageLoad(inputImage, readPos);\n"
- " vec4 value1 = imageLoad(inputImage, ivec2(readPos.x + 1, readPos.y));\n"
- " result = getRGBValue( xmod, value, value1);\n"
- " imageStore( outputImage, ivec2(gl_GlobalInvocationID.xy), result );\n"
- "}\n";
- }
- return prog.c_str();
-}
-
-static const char *computeWorkShader(std::string &prog, bool binESContext)
-{
- if (binESContext) {
- prog += "#version 310 es\n"
- "#extension GL_ARB_compute_shader : enable\n"
- "precision highp float;\n"
- "precision highp int;\n"
- "precision mediump image2D;\n";
- } else {
- prog += "#version 430\n"
- "#extension GL_ARB_compute_shader : enable\n";
- }
-
- prog += "int wrapMod( in int a, in int base )\n"
- "{\n"
- " return ( a >= 0 ) ? a % base : -(a % base) + base;\n"
- "}\n";
-
- prog += "void getWrappedCoords( inout int sX, inout int sY, in int width, in int height )\n"
- "{\n"
- " if (sY < 0) { sX -= width >> 1; sY = -sY; }\n"
- " if (sY >= height) { sX += width >> 1; sY = height - sY; }\n"
- " sX = wrapMod( sX, width );\n"
- "}\n";
-
- prog += "// Set workgroup layout;\n"
- "layout (local_size_x = 16, local_size_y = 16) in;\n\n"
- "layout (rgba16f, binding = 1) uniform image2D inputImage;\n\n"
- "layout (rgba16f, binding = 2) uniform image2D outputImage;\n\n"
- "void main()\n"
- "{\n"
- " int prevWidth = int(gl_NumWorkGroups.x) << 1;\n"
- " int prevHeight = int(gl_NumWorkGroups.y) << 1;\n"
- " if ( gl_GlobalInvocationID.x >= gl_NumWorkGroups.x || gl_GlobalInvocationID.y >= "
- "gl_NumWorkGroups.y )\n"
- " return;\n"
- " vec4 accumVal = vec4(0.0);\n"
- " for ( int sy = -2; sy <= 2; ++sy )\n"
- " {\n"
- " for ( int sx = -2; sx <= 2; ++sx )\n"
- " {\n"
- " int sampleX = sx + (int(gl_GlobalInvocationID.x) << 1);\n"
- " int sampleY = sy + (int(gl_GlobalInvocationID.y) << 1);\n"
- " getWrappedCoords(sampleX, sampleY, prevWidth, prevHeight);\n"
- " if ((sampleY * prevWidth + sampleX) < 0 )\n"
- " sampleY = prevHeight + sampleY;\n"
- " ivec2 pos = ivec2(sampleX, sampleY);\n"
- " vec4 value = imageLoad(inputImage, pos);\n"
- " float filterPdf = 1.0 / ( 1.0 + float(sx*sx + sy*sy)*2.0 );\n"
- " filterPdf /= 4.71238898;\n"
- " accumVal[0] += filterPdf * value.r;\n"
- " accumVal[1] += filterPdf * value.g;\n"
- " accumVal[2] += filterPdf * value.b;\n"
- " accumVal[3] += filterPdf * value.a;\n"
- " }\n"
- " }\n"
- " imageStore( outputImage, ivec2(gl_GlobalInvocationID.xy), accumVal );\n"
- "}\n";
-
- return prog.c_str();
-}
-
-GLComputeMipMap::GLComputeMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat, NVFoundationBase &inFnd)
- : BSDFMipMap(inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd)
- , m_BSDFProgram(NULL)
- , m_UploadProgram_RGBA8(NULL)
- , m_UploadProgram_RGB8(NULL)
- , m_Level0Tex(NULL)
- , m_TextureCreated(false)
-{
-}
-
-GLComputeMipMap::~GLComputeMipMap()
-{
- m_UploadProgram_RGB8 = NULL;
- m_UploadProgram_RGBA8 = NULL;
- m_BSDFProgram = NULL;
- m_Level0Tex = NULL;
-}
-
-inline NVConstDataRef<QT3DSI8> toRef(const char *data)
-{
- size_t len = strlen(data) + 1;
- return NVConstDataRef<QT3DSI8>((const QT3DSI8 *)data, (QT3DSU32)len);
-}
-
-static bool isGLESContext(NVRenderContext *context)
-{
- NVRenderContextType ctxType = context->GetRenderContextType();
-
- // Need minimum of GL3 or GLES3
- if (ctxType == NVRenderContextValues::GLES2 || ctxType == NVRenderContextValues::GLES3
- || ctxType == NVRenderContextValues::GLES31) {
- return true;
- }
-
- return false;
-}
-
-#define WORKGROUP_SIZE 16
-
-void GLComputeMipMap::createComputeProgram(NVRenderContext *context)
-{
- std::string computeProg;
-
- if (!m_BSDFProgram) {
- m_BSDFProgram = context
- ->CompileComputeSource(
- "Compute BSDF mipmap shader",
- toRef(computeWorkShader(computeProg, isGLESContext(context))))
- .mShader;
- }
-}
-
-NVRenderShaderProgram *
-GLComputeMipMap::getOrCreateUploadComputeProgram(NVRenderContext *context,
- NVRenderTextureFormats::Enum inFormat)
-{
- std::string computeProg;
-
- if (inFormat == NVRenderTextureFormats::RGB8) {
- if (!m_UploadProgram_RGB8) {
- m_UploadProgram_RGB8 =
- context
- ->CompileComputeSource(
- "Compute BSDF mipmap level 0 RGB8 shader",
- toRef(computeUploadShader(computeProg, inFormat, isGLESContext(context))))
- .mShader;
- }
-
- return m_UploadProgram_RGB8;
- } else {
- if (!m_UploadProgram_RGBA8) {
- m_UploadProgram_RGBA8 =
- context
- ->CompileComputeSource(
- "Compute BSDF mipmap level 0 RGBA8 shader",
- toRef(computeUploadShader(computeProg, inFormat, isGLESContext(context))))
- .mShader;
- }
-
- return m_UploadProgram_RGBA8;
- }
-}
-
-void GLComputeMipMap::CreateLevel0Tex(void *inTextureData, int inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat)
-{
- NVRenderTextureFormats::Enum theFormat = inFormat;
- int theWidth = m_Width;
-
- // Since we cannot use RGB format in GL compute
- // we treat it as a RGBA component format
- if (inFormat == NVRenderTextureFormats::RGB8) {
- // This works only with 4 byte aligned data
- QT3DS_ASSERT(m_Width % 4 == 0);
- theFormat = NVRenderTextureFormats::RGBA8;
- theWidth = (m_Width * 3) / 4;
- }
-
- if (m_Level0Tex == NULL) {
- m_Level0Tex = m_NVRenderContext->CreateTexture2D();
- m_Level0Tex->SetTextureStorage(1, theWidth, m_Height, theFormat, theFormat,
- NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize));
- } else {
- m_Level0Tex->SetTextureSubData(NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize), 0,
- 0, 0, theWidth, m_Height, theFormat);
- }
-}
-
-void GLComputeMipMap::Build(void *inTextureData, int inTextureDataSize,
- NVRenderBackend::NVRenderBackendTextureObject,
- NVRenderTextureFormats::Enum inFormat)
-{
- bool needMipUpload = (inFormat != m_DestinationFormat);
- // re-upload data
- if (!m_TextureCreated) {
- m_Texture2D.SetTextureStorage(
- m_MaxMipMapLevel + 1, m_Width, m_Height, m_DestinationFormat, inFormat, (needMipUpload)
- ? NVDataRef<QT3DSU8>()
- : NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize));
- m_Texture2D.addRef();
- // create a compute shader (if not aloread done) which computes the BSDF mipmaps for this
- // texture
- createComputeProgram(m_NVRenderContext);
-
- if (!m_BSDFProgram) {
- QT3DS_ASSERT(false);
- return;
- }
-
- m_TextureCreated = true;
- } else if (!needMipUpload) {
- m_Texture2D.SetTextureSubData(NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize), 0,
- 0, 0, m_Width, m_Height, inFormat);
- }
-
- if (needMipUpload) {
- CreateLevel0Tex(inTextureData, inTextureDataSize, inFormat);
- }
-
- NVScopedRefCounted<NVRenderImage2D> theInputImage;
- NVScopedRefCounted<NVRenderImage2D> theOutputImage;
- theInputImage =
- m_NVRenderContext->CreateImage2D(&m_Texture2D, NVRenderImageAccessType::ReadWrite);
- theOutputImage =
- m_NVRenderContext->CreateImage2D(&m_Texture2D, NVRenderImageAccessType::ReadWrite);
-
- if (needMipUpload && m_Level0Tex) {
- NVRenderShaderProgram *uploadProg =
- getOrCreateUploadComputeProgram(m_NVRenderContext, inFormat);
- if (!uploadProg)
- return;
-
- m_NVRenderContext->SetActiveShader(uploadProg);
-
- NVScopedRefCounted<NVRenderImage2D> theInputImage0;
- theInputImage0 =
- m_NVRenderContext->CreateImage2D(m_Level0Tex, NVRenderImageAccessType::ReadWrite);
-
- theInputImage0->SetTextureLevel(0);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedinputImage0("inputImage",
- *uploadProg);
- theCachedinputImage0.Set(theInputImage0);
-
- theOutputImage->SetTextureLevel(0);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedOutputImage("outputImage",
- *uploadProg);
- theCachedOutputImage.Set(theOutputImage);
-
- m_NVRenderContext->DispatchCompute(uploadProg, m_Width, m_Height, 1);
-
- // sync
- NVRenderBufferBarrierFlags flags(NVRenderBufferBarrierValues::ShaderImageAccess);
- m_NVRenderContext->SetMemoryBarrier(flags);
- }
-
- int width = m_Width >> 1;
- int height = m_Height >> 1;
-
- m_NVRenderContext->SetActiveShader(m_BSDFProgram);
-
- for (int i = 1; i <= m_MaxMipMapLevel; ++i) {
- theOutputImage->SetTextureLevel(i);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedOutputImage("outputImage",
- *m_BSDFProgram);
- theCachedOutputImage.Set(theOutputImage);
- theInputImage->SetTextureLevel(i - 1);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedinputImage("inputImage",
- *m_BSDFProgram);
- theCachedinputImage.Set(theInputImage);
-
- m_NVRenderContext->DispatchCompute(m_BSDFProgram, width, height, 1);
-
- width = width > 2 ? width >> 1 : 1;
- height = height > 2 ? height >> 1 : 1;
-
- // sync
- NVRenderBufferBarrierFlags flags(NVRenderBufferBarrierValues::ShaderImageAccess);
- m_NVRenderContext->SetMemoryBarrier(flags);
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/hdr/HDR.cpp b/src/Runtime/ogl-runtime/src/hdr/HDR.cpp
deleted file mode 100644
index 9abe2b3b..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/HDR.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "HDR.h"
diff --git a/src/Runtime/ogl-runtime/src/hdr/HDR.h b/src/Runtime/ogl-runtime/src/hdr/HDR.h
deleted file mode 100644
index fbc4ea41..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/HDR.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef HDR_H
-#define HDR_H
-
-#include "foundation/Qt3DSVec3.h"
-//#include "HDR.h"
-
-namespace qt3ds {
-class QT3DSVec3;
-
-namespace HDR {
-
- template <int N>
- class HDRConfiguration;
-
- template <int N>
- class Histogram
- {
- public:
- /**
- * @brief build the histogram based on 2^10 binning.
- *
- * @param[in] inImage Pointer to image
- * @param[in] inWidth Width of image
- * @param[in] inHeight Height of image
- * @param[out] outHistogram
- *
- * @return No return
- */
- static void Build(QT3DSVec3 *inImage, int inWidth, int inHeight, QT3DSVec3 *outHistogram)
- {
- long noPixels = inWidth * inHeight;
-
- for (int i = 0; i < noPixels; ++i) {
- outHistogram[(int)inImage[i].x].x++;
- outHistogram[(int)inImage[i].y].y++;
- outHistogram[(int)inImage[i].z].z++;
- }
- }
- };
-
- template <int N>
- class HDR
- {
-
- public:
- HDR(HDRConfiguration<N> *inConfiguration) { mHDRConfiguration = inConfiguration; }
-
- void Build(QT3DSVec3 **inImages, int inNoImages, int inWidth, int inHeight, float *inExposures,
- QT3DSVec3 *outRadiance)
- {
- for (int x = 0; x < inWidth; ++x) {
- for (int y = 0; y < inHeight; ++y) {
- QT3DSVec3 divisor(0.0f);
- QT3DSVec3 dividend(0.0f);
- for (int i = 0; i < inNoImages; ++i) {
- QT3DSVec3 pixel = inImages[i][x + y * inWidth];
-
- dividend += (LUT(mHDRConfiguration->weights, pixel) * inExposures[i])
- .multiply(LUT(mHDRConfiguration->CRF, pixel));
- divisor += LUT(mHDRConfiguration->weights, pixel) * inExposures[i]
- * inExposures[i];
- }
- divisor.x = 1.0f / divisor.x;
- divisor.y = 1.0f / divisor.y;
- divisor.z = 1.0f / divisor.z;
-
- outRadiance[x + y * inWidth] = dividend.multiply(divisor);
- }
- }
- }
-
- private:
- /**
- * @brief Return the value based off from array as a LUT
- *
- * @param[in] inLUT The LUT table of interest
- * @param[in] inValue The value that you have
- * @param[out] QT3DSVec3 The corresponding value of array based on input
- * tuple
- *
- * @return No return
- */
- QT3DSVec3 LUT(float *inLUT, QT3DSVec3 inValue)
- {
- return QT3DSVec3(inLUT[(int)inValue.x], inLUT[(int)inValue.y], inLUT[(int)inValue.z]);
- }
-
- QT3DSVec3 LUT(QT3DSVec3 *inLUT, QT3DSVec3 inValue)
- {
- return QT3DSVec3(inLUT[(int)inValue.x].x, inLUT[(int)inValue.y].y,
- inLUT[(int)inValue.z].z);
- }
-
- HDRConfiguration<N> *mHDRConfiguration;
- };
-
- template <int N>
- class HDRConfiguration
- {
- public:
- HDRConfiguration()
- {
- threshold = 0.1f;
- maxIterations = 30;
- GenerateRobertsonWeighting();
- }
-
- void SetCRF(QT3DSVec3 *inCRF) { memcpy(CRF, inCRF, sizeof(QT3DSVec3) * N); }
-
- /**
- * @brief build the camera response function
- *
- * @param[in] inImages Pointer to images
- * @param[in] inNoImages Number of images
- * @param[in] inWidth Width of image
- * @param[in] inHeight Height of image
- * @param[out] outHistogram
- *
- * @return No return
- */
- void BuildCRF(QT3DSVec3 **inImages, int inNoImages, int inWidth, int inHeight,
- float *inExposures)
- {
- QT3DSVec3 histogram[N];
- QT3DSVec3 newCRF[N];
-
- HDR<N> hdr(this);
-
- memset(histogram, 0, sizeof(QT3DSVec3) * N);
-
- for (int i = 0; i < inNoImages; ++i) {
- Histogram<N>::Build(inImages[i], inWidth, inHeight, histogram);
- }
-
- for (int i = 0; i < N; ++i) {
- histogram[i].x = histogram[i].x > 0 ? 1 / histogram[i].x : 0;
- histogram[i].y = histogram[i].y > 0 ? 1 / histogram[i].y : 0;
- histogram[i].z = histogram[i].z > 0 ? 1 / histogram[i].z : 0;
- }
-
- QT3DSVec3 *radiance = new QT3DSVec3[inWidth * inHeight * sizeof(QT3DSVec3)];
-
- // iteration 0, linearize CRF
- for (int i = 0; i < N; ++i) {
- CRF[i] = QT3DSVec3((float)i) * 2.0f / N;
- }
-
- for (int iteration = 0; iteration < maxIterations; ++iteration) {
- hdr.Build(inImages, inNoImages, inWidth, inHeight, inExposures, radiance);
-
- memset(newCRF, 0, sizeof(QT3DSVec3) * N);
-
- for (int i = 0; i < inNoImages; ++i) {
- for (int x = 0; x < inWidth; ++x) {
- for (int y = 0; y < inHeight; ++y) {
- long offset = x + y * inWidth;
- QT3DSVec3 pixel = inImages[i][offset];
- newCRF[(int)pixel.x].x += (inExposures[i] * radiance[offset].x);
- newCRF[(int)pixel.y].y += (inExposures[i] * radiance[offset].y);
- newCRF[(int)pixel.z].z += (inExposures[i] * radiance[offset].z);
- }
- }
- }
-
- float difference = 0;
- for (int i = 0; i < N; ++i) {
- newCRF[i] = newCRF[i].multiply(histogram[i]);
- }
-
- QT3DSVec3 middle = newCRF[N / 2];
- for (int i = 0; i < N; ++i) {
- newCRF[i].x = newCRF[i].x / middle.x;
- newCRF[i].y = newCRF[i].y / middle.y;
- newCRF[i].z = newCRF[i].z / middle.z;
- difference += (CRF[i] - newCRF[i]).magnitude();
- }
- for (int i = 0; i < N; ++i) {
- CRF[i] = newCRF[i];
- }
- if (difference < threshold) {
- break;
- }
- }
- delete[] radiance;
- }
-
- float weights[N];
- QT3DSVec3 CRF[N];
-
- private:
- void GenerateRobertsonWeighting()
- {
- // Dynamic Range Improvement Through Multiple Exposures (5)
- // gaussian random weighting
- float divisor = (N - 1) * (N - 1) / 4.0;
- for (int i = 0; i < N; ++i) {
- float dividend = (i - (N - 1) / 2.0f);
- dividend *= dividend;
- weights[i] = exp(-4.0f * dividend / divisor);
- }
- }
-
- int maxIterations;
- float threshold;
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cpp b/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cpp
deleted file mode 100644
index fd57015e..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "MipmapBSDF.h"
-#include "GLComputeMipMap.h"
-
-#ifdef PLATFORM_HAS_CUDA
-#include "cuda.h"
-#include "cuda_runtime.h"
-#include "CUDABSDFMipmap.h"
-#endif
-
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "nv_log.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-
-BSDFMipMap::BSDFMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture2D, NVRenderTextureFormats::Enum inDestFormat,
- NVFoundationBase &inFnd)
- : m_Foundation(inFnd)
- , m_Texture2D(inTexture2D)
- , m_Width(inWidth)
- , m_Height(inHeight)
- , m_DestinationFormat(inDestFormat)
- , m_NVRenderContext(inNVRenderContext)
-{
- // Calculate mip level
- int maxDim = inWidth >= inHeight ? inWidth : inHeight;
-
- m_MaxMipMapLevel = static_cast<int>(logf((float)maxDim) / logf(2.0f));
- // no concept of sizeOfFormat just does'nt make sense
- m_SizeOfFormat = NVRenderTextureFormats::getSizeofFormat(m_DestinationFormat);
- m_NoOfComponent = NVRenderTextureFormats::getNumberOfComponent(m_DestinationFormat);
-}
-
-BSDFMipMap *BSDFMipMap::Create(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd)
-{
- BSDFMipMap *theBSDFMipMap = NULL;
-#ifdef PLATFORM_HAS_CUDA
- int deviceCount;
- cudaError_t e = cudaGetDeviceCount(&deviceCount);
-#endif
-
- if (inNVRenderContext->IsComputeSupported()) {
- theBSDFMipMap = QT3DS_NEW(inFnd.getAllocator(), GLComputeMipMap)(
- inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd);
- } else
-#ifdef PLATFORM_HAS_CUDA
- if (e == cudaSuccess && deviceCount > 0) {
- theBSDFMipMap = QT3DS_NEW(inFnd.getAllocator(), CUDABSDFMipMap)(
- inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd);
- } else
-#endif
- if (!theBSDFMipMap) {
- theBSDFMipMap = QT3DS_NEW(inFnd.getAllocator(), BasicBSDFMipMap)(
- inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd);
- }
-
- return theBSDFMipMap;
-}
-
-BasicBSDFMipMap::BasicBSDFMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat, NVFoundationBase &inFnd)
- : BSDFMipMap(inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd)
-{
-}
-
-BSDFMipMap::~BSDFMipMap()
-{
-}
-
-void BasicBSDFMipMap::Build(void *inTextureData, int inTextureDataSize,
- NVRenderBackend::NVRenderBackendTextureObject,
- NVRenderTextureFormats::Enum inFormat)
-{
-
- m_InternalFormat = inFormat;
- m_SizeOfInternalFormat = NVRenderTextureFormats::getSizeofFormat(m_InternalFormat);
- m_InternalNoOfComponent = NVRenderTextureFormats::getNumberOfComponent(m_InternalFormat);
-
- m_Texture2D.SetTextureData(NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize), 0,
- m_Width, m_Height, inFormat, m_DestinationFormat);
-
- STextureData theMipImage;
- STextureData prevImage;
- prevImage.data = inTextureData;
- prevImage.dataSizeInBytes = inTextureDataSize;
- prevImage.format = inFormat;
- int curWidth = m_Width;
- int curHeight = m_Height;
- int size = NVRenderTextureFormats::getSizeofFormat(m_InternalFormat);
- for (int idx = 1; idx <= m_MaxMipMapLevel; ++idx) {
- theMipImage =
- CreateBsdfMipLevel(theMipImage, prevImage, curWidth, curHeight); //, m_PerfTimer );
- curWidth = curWidth >> 1;
- curHeight = curHeight >> 1;
- curWidth = curWidth >= 1 ? curWidth : 1;
- curHeight = curHeight >= 1 ? curHeight : 1;
- inTextureDataSize = curWidth * curHeight * size;
-
- m_Texture2D.SetTextureData(toU8DataRef((char *)theMipImage.data, (QT3DSU32)inTextureDataSize),
- (QT3DSU8)idx, (QT3DSU32)curWidth, (QT3DSU32)curHeight, theMipImage.format,
- m_DestinationFormat);
-
- if (prevImage.data == inTextureData)
- prevImage = STextureData();
-
- STextureData temp = prevImage;
- prevImage = theMipImage;
- theMipImage = temp;
- }
- QT3DS_FREE(m_Foundation.getAllocator(), theMipImage.data);
- QT3DS_FREE(m_Foundation.getAllocator(), prevImage.data);
-}
-
-inline int BasicBSDFMipMap::wrapMod(int a, int base)
-{
- return (a >= 0) ? a % base : (a % base) + base;
-}
-
-inline void BasicBSDFMipMap::getWrappedCoords(int &sX, int &sY, int width, int height)
-{
- if (sY < 0) {
- sX -= width >> 1;
- sY = -sY;
- }
- if (sY >= height) {
- sX += width >> 1;
- sY = height - sY;
- }
- sX = wrapMod(sX, width);
-}
-
-STextureData BasicBSDFMipMap::CreateBsdfMipLevel(STextureData &inCurMipLevel,
- STextureData &inPrevMipLevel, int width,
- int height) //, IPerfTimer& inPerfTimer )
-{
- // SStackPerfTimer __timer( inPerfTimer, "Image BSDF Mip Level" );
- STextureData retval;
- int newWidth = width >> 1;
- int newHeight = height >> 1;
- newWidth = newWidth >= 1 ? newWidth : 1;
- newHeight = newHeight >= 1 ? newHeight : 1;
-
- if (inCurMipLevel.data) {
- retval = inCurMipLevel;
- retval.dataSizeInBytes =
- newWidth * newHeight * NVRenderTextureFormats::getSizeofFormat(inPrevMipLevel.format);
- } else {
- retval.dataSizeInBytes =
- newWidth * newHeight * NVRenderTextureFormats::getSizeofFormat(inPrevMipLevel.format);
- retval.format = inPrevMipLevel.format; // inLoadedImage.format;
- retval.data = m_Foundation.getAllocator().allocate(
- retval.dataSizeInBytes, "Bsdf Scaled Image Data", __FILE__, __LINE__);
- }
-
- for (int y = 0; y < newHeight; ++y) {
- for (int x = 0; x < newWidth; ++x) {
- float accumVal[4];
- accumVal[0] = 0;
- accumVal[1] = 0;
- accumVal[2] = 0;
- accumVal[3] = 0;
- for (int sy = -2; sy <= 2; ++sy) {
- for (int sx = -2; sx <= 2; ++sx) {
- int sampleX = sx + (x << 1);
- int sampleY = sy + (y << 1);
- getWrappedCoords(sampleX, sampleY, width, height);
-
- // Cauchy filter (this is simply because it's the easiest to evaluate, and
- // requires no complex
- // functions).
- float filterPdf = 1.f / (1.f + float(sx * sx + sy * sy) * 2.f);
- // With FP HDR formats, we're not worried about intensity loss so much as
- // unnecessary energy gain,
- // whereas with LDR formats, the fear with a continuous normalization factor is
- // that we'd lose
- // intensity and saturation as well.
- filterPdf /= (NVRenderTextureFormats::getSizeofFormat(retval.format) >= 8)
- ? 4.71238898f
- : 4.5403446f;
- // filterPdf /= 4.5403446f; // Discrete normalization factor
- // filterPdf /= 4.71238898f; // Continuous normalization factor
- float curPix[4];
- QT3DSI32 byteOffset = (sampleY * width + sampleX)
- * NVRenderTextureFormats::getSizeofFormat(retval.format);
- if (byteOffset < 0) {
- sampleY = height + sampleY;
- byteOffset = (sampleY * width + sampleX)
- * NVRenderTextureFormats::getSizeofFormat(retval.format);
- }
-
- NVRenderTextureFormats::decodeToFloat(inPrevMipLevel.data, byteOffset, curPix,
- retval.format);
-
- accumVal[0] += filterPdf * curPix[0];
- accumVal[1] += filterPdf * curPix[1];
- accumVal[2] += filterPdf * curPix[2];
- accumVal[3] += filterPdf * curPix[3];
- }
- }
-
- /*
- // Re-adjustment after the fact for the RGBD hack.
- if (retval.format == NVRenderTextureFormats::RGBA8 || retval.format ==
- NVRenderTextureFormats::SRGB8A8)
- {
- float divVal = (accumVal[0] > accumVal[1]) ? accumVal[0] : accumVal[1];
- divVal = (divVal > accumVal[2]) ? divVal : accumVal[2];
- if (divVal > 1.0)
- {
- divVal = 1.0f / divVal;
- accumVal[0] *= divVal;
- accumVal[1] *= divVal;
- accumVal[2] *= divVal;
- accumVal[3] = divVal;
- }
- else
- accumVal[3] = 1.0f;
- }
- */
- QT3DSU32 newIdx =
- (y * newWidth + x) * NVRenderTextureFormats::getSizeofFormat(retval.format);
-
- NVRenderTextureFormats::encodeToPixel(accumVal, retval.data, newIdx, retval.format);
- }
- }
-
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cu b/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cu
deleted file mode 100644
index 6ddac4be..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.cu
+++ /dev/null
@@ -1,404 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#if defined (_PLATFORM_USE_EGL)
-#include <GLES31/gl31.h>
-#include <GLES31/gl2ext.h>
-#endif
-
-#include "CUDABSDFMipmap.h"
-#include "cuda.h"
-#include "cuda_runtime.h"
-#include "cuda_gl_interop.h"
-#include <iostream>
-
-using namespace nv;
-using namespace nv::render;
-__host__ void jerror1(cudaError error)
-{
- static int i = 0;
- ++i;
-}
-#ifdef _DEBUG
-#define CHECK_AND_HANDLE_CUDA_ERROR(func) \
- func; \
- { \
- cudaError error = cudaGetLastError(); \
- if ( error != cudaSuccess ) \
- { \
- printf("%s\n", cudaGetErrorString(error)); \
- jerror1(error);\
- NV_ASSERT( false ); \
- } \
- }
-#else
-#define CHECK_AND_HANDLE_CUDA_ERROR(func) \
-func;
-#endif
-
-__device__ inline int wrapMod( int a, int base )
-{
- int ret = a % base;
- if (ret < 0 ) ret += base;
- return ret;
-}
-
-__device__ inline void getWrappedCoords( int &sX, int &sY, int width, int height )
-{
- if (sY < 0) { sX -= width >> 1; sY = -sY; }
- if (sY >= height) { sX += width >> 1; sY = height - sY; }
- sX = wrapMod( sX, width );
- sY = wrapMod( sY, height );
-}
-
-__device__ void decodeToFloat( void *inPtr, NVU32 byteOfs, float *outPtr, NVRenderTextureFormats::Enum inFmt, unsigned int numberOfComponent )
-{
- outPtr[0] = 0.0f; outPtr[1] = 0.0f; outPtr[2] = 0.0f; outPtr[3] = 0.0f;
- NVU8 *src = reinterpret_cast<NVU8 *>(inPtr);
- //float divisor; // If we want to support RGBD?
- switch(inFmt)
- {
- case NVRenderTextureFormats::Alpha8:
- outPtr[0] = ((float)src[byteOfs]) / 255.0f;
- break;
-
- case NVRenderTextureFormats::Luminance8:
- case NVRenderTextureFormats::LuminanceAlpha8:
- case NVRenderTextureFormats::R8:
- case NVRenderTextureFormats::RG8:
- case NVRenderTextureFormats::RGB8:
- case NVRenderTextureFormats::RGBA8:
- case NVRenderTextureFormats::SRGB8:
- case NVRenderTextureFormats::SRGB8A8:
- // NOTE : RGBD Hack here for reference. Not meant for installation.
- //divisor = (NVRenderTextureFormats::getSizeofFormat(inFmt) == 4) ? ((float)src[byteOfs+3]) / 255.0f : 1.0f;
- for ( NVU32 i = 0; i < numberOfComponent; ++i )
- {
- float val = ((float)src[byteOfs + i]) / 255.0f;
- outPtr[i] = (i < 3) ? powf(val, 0.4545454545f) : val;
- // Assuming RGBA8 actually means RGBD (which is stupid, I know)
- //if ( NVRenderTextureFormats::getSizeofFormat(inFmt) == 4 ) { outPtr[i] /= divisor; }
- }
- //outPtr[3] = divisor;
- break;
-
- case NVRenderTextureFormats::RGBA32F:
- outPtr[0] = reinterpret_cast<float *>(src+byteOfs)[0];
- outPtr[1] = reinterpret_cast<float *>(src+byteOfs)[1];
- outPtr[2] = reinterpret_cast<float *>(src+byteOfs)[2];
- outPtr[3] = reinterpret_cast<float *>(src+byteOfs)[3];
- break;
- case NVRenderTextureFormats::RGB32F:
- outPtr[0] = reinterpret_cast<float *>(src+byteOfs)[0];
- outPtr[1] = reinterpret_cast<float *>(src+byteOfs)[1];
- outPtr[2] = reinterpret_cast<float *>(src+byteOfs)[2];
- break;
-
- case NVRenderTextureFormats::RGBA16F:
- /*
- for ( NVU32 i = 0; i < 4; ++i )
- {
- // NOTE : This only works on the assumption that we don't have any denormals, Infs or NaNs.
- // Every pixel in our source image should be "regular"
- NVU16 h = reinterpret_cast<NVU16 *>(src + byteOfs)[i];
- NVU32 sign = (h & 0x8000) << 16;
- NVU32 exponent = (((((h & 0x7c00) >> 10) - 15) + 127) << 23);
- NVU32 mantissa = ((h & 0x3ff) << 13);
- NVU32 result = sign | exponent | mantissa;
-
- if (h == 0 || h == 0x8000) { result = 0; } // Special case for zero and negative zero
- memcpy( reinterpret_cast<NVU32 *>(outPtr) + i, &result, 4 );
- }*/
-
- for ( NVU32 i = 0; i < 2; i++ )
- {
- // NOTE : This only works on the assumption that we don't have any denormals, Infs or NaNs.
- // Every pixel in our source image should be "regular"
-
- NVU32 h1 = reinterpret_cast<NVU32 *>(src + byteOfs)[i];
-
- for ( NVU8 j = 0; j < 2; j++ )
- {
- NVU16 h = (h1 & (0x0000FFFF << j*16 )) >> j*16;
- NVU32 sign = (h & 0x8000) << 16;
- NVU32 exponent = (((((h & 0x7c00) >> 10) - 15) + 127) << 23);
- NVU32 mantissa = ((h & 0x3ff) << 13);
- NVU32 result = sign | exponent | mantissa;
-
- if (h == 0 || h == 0x8000) { result = 0; } // Special case for zero and negative zero
- memcpy( reinterpret_cast<NVU32 *>(outPtr) + i*2 + j, &result, 4 );
- }
- }
- break;
-
- case NVRenderTextureFormats::R11G11B10:
- // place holder
- NV_ASSERT( false );
- break;
-
- default:
- outPtr[0] = 0.0f;
- outPtr[1] = 0.0f;
- outPtr[2] = 0.0f;
- outPtr[3] = 0.0f;
- break;
- }
-}
-
-void __device__ encodeToPixel( float *inPtr, void *outPtr, NVU32 byteOfs, NVRenderTextureFormats::Enum inFmt, unsigned int noOfComponent )
-{
- NVU8 *dest = reinterpret_cast<NVU8 *>(outPtr);
- switch(inFmt)
- {
- case NVRenderTextureFormats::Alpha8:
- dest[byteOfs] = NVU8( inPtr[0] * 255.0f );
- break;
-
- case NVRenderTextureFormats::Luminance8:
- case NVRenderTextureFormats::LuminanceAlpha8:
- case NVRenderTextureFormats::R8:
- case NVRenderTextureFormats::RG8:
- case NVRenderTextureFormats::RGB8:
- case NVRenderTextureFormats::RGBA8:
- case NVRenderTextureFormats::SRGB8:
- case NVRenderTextureFormats::SRGB8A8:
- for ( NVU32 i = 0; i < noOfComponent; ++i )
- {
- inPtr[i] = (inPtr[i] > 1.0f) ? 1.0f : inPtr[i];
- if (i < 3)
- dest[byteOfs+i] = NVU8( powf( inPtr[i], 2.2f ) * 255.0f);
- else
- dest[byteOfs+i] = NVU8( inPtr[i] * 255.0f );
- }
- break;
-
- case NVRenderTextureFormats::RGBA32F:
- reinterpret_cast<float *>(dest+byteOfs)[0] = inPtr[0];
- reinterpret_cast<float *>(dest+byteOfs)[1] = inPtr[1];
- reinterpret_cast<float *>(dest+byteOfs)[2] = inPtr[2];
- reinterpret_cast<float *>(dest+byteOfs)[3] = inPtr[3];
- break;
- case NVRenderTextureFormats::RGB32F:
- reinterpret_cast<float *>(dest+byteOfs)[0] = inPtr[0];
- reinterpret_cast<float *>(dest+byteOfs)[1] = inPtr[1];
- reinterpret_cast<float *>(dest+byteOfs)[2] = inPtr[2];
- break;
-
- case NVRenderTextureFormats::RGBA16F:
- for ( NVU32 i = 0; i < 4; ++i )
- {
- // NOTE : This also has the limitation of not handling infs, NaNs and denormals, but it should be
- // sufficient for our purposes.
- if (inPtr[i] > 65519.0f) { inPtr[i] = 65519.0f; }
- if (fabs(inPtr[i]) < 6.10352E-5f) { inPtr[i] = 0.0f; }
- NVU32 f = reinterpret_cast<NVU32 *>(inPtr)[i];
- NVU32 sign = (f & 0x80000000) >> 16;
- NVI32 exponent = (f & 0x7f800000) >> 23;
- NVU32 mantissa = (f >> 13) & 0x3ff;
- exponent = exponent - 112;
- if (exponent > 31) { exponent = 31; }
- if (exponent < 0) { exponent = 0; }
- exponent = exponent << 10;
- reinterpret_cast<NVU16 *>(dest + byteOfs)[i] = NVU16(sign | exponent | mantissa);
- }
- break;
-
- case NVRenderTextureFormats::R11G11B10:
- // place holder
- NV_ASSERT( false );
- break;
-
- default:
- dest[byteOfs] = 0;
- dest[byteOfs+1] = 0;
- dest[byteOfs+2] = 0;
- dest[byteOfs+3] = 0;
- break;
- }
-}
-
-void __global__ Convert3To4Component( cudaTextureObject_t tex, float *d_outBuffer, Q3DStudio::INT32 dpitch, Q3DStudio::INT32 width, Q3DStudio::INT32 height )
-{
- float *dest = d_outBuffer;
-
- int x = threadIdx.x + blockIdx.x * blockDim.x;
- int y = threadIdx.y + blockIdx.y * blockDim.y;
- if ( x >= width || y >= height )
- return;
- int inX = x * 3;
- int outX = x * 4;
- dest[outX + y * width * 4] = tex2D<float>(tex, inX, y);
- dest[outX + y * width * 4 + 1] = tex2D<float>(tex, inX + 1, y);
- dest[outX + y * width * 4 + 2] = tex2D<float>(tex, inX + 2, y);
- dest[outX + y * width * 4 + 3] = 255 * 255;
-}
-
-void __global__ ConvertData( void* d_InBuffer, NVRenderTextureFormats::Enum inFmt, int inSizeOfFormat, int inNoOfComponent, int inPitch,
- void* d_OutBuffer, NVRenderTextureFormats::Enum outFmt, int outSizeOfFormat, int outNoOfComponent, int outPitch, int width, int height )
-{
-
- int x = threadIdx.x + blockIdx.x * blockDim.x;
- int y = threadIdx.y + blockIdx.y * blockDim.y;
- if ( x >= width || y >= height )
- return;
- float values[4];
-
- decodeToFloat( d_InBuffer, (inPitch * y) + (x * inSizeOfFormat), values, inFmt, inNoOfComponent );
- encodeToPixel( values, d_OutBuffer, (outPitch * y) + (x * outSizeOfFormat), outFmt, outSizeOfFormat );
-}
-
-void __global__ CreateBsdfMipLevel( cudaTextureObject_t tex, void *d_curBuffer, void *d_prevBuffer, Q3DStudio::INT32 pitch, Q3DStudio::INT32 width, Q3DStudio::INT32 height,
- nv::render::NVRenderTextureFormats::Enum inFormat, unsigned int sizeOfFormat )
-{
- float accumVal[4];
- //unsigned int sizeofFormat = getSizeofFormat(inFormat);
- //__shared__ float dataBlock[ ]; //(32+4) * (32+4) * 12
- int x = threadIdx.x + blockIdx.x * blockDim.x;
- int y = threadIdx.y + blockIdx.y * blockDim.y;
-
- if ( x >= (width > 2 ? width >> 1 : 1) || y >= (height > 2 ? height >> 1 : 1)) return;
-
- accumVal[0] = 0; accumVal[1] = 0; accumVal[2] = 0; accumVal[3] = 0;
-
- for ( int sy = -2; sy <= 2; ++sy )
- {
- for ( int sx = -2; sx <= 2; ++sx )
- {
- int sampleX = sx + (x << 1);
- int sampleY = sy + (y << 1);
- //getWrappedCoords(sampleX, sampleY, width, height);
- // Cauchy filter (this is simply because it's the easiest to evaluate, and requires no complex
- // functions).
- float filterPdf = 1.f / ( 1.f + float(sx*sx + sy*sy)*2.f );
- // With FP HDR formats, we're not worried about intensity loss so much as unnecessary energy gain,
- // whereas with LDR formats, the fear with a continuous normalization factor is that we'd lose
- // intensity and saturation as well.
- filterPdf /= sizeOfFormat >= 8 ? 4.71238898f : 4.5403446f;
- //filterPdf /= 4.5403446f; // Discrete normalization factor
- //filterPdf /= 4.71238898f; // Continuous normalization factor
- //float curPix[4];
- sampleX = sampleX*4;
- getWrappedCoords(sampleX, sampleY, width*4, height);
- accumVal[0] += filterPdf * tex2D<float>(tex, sampleX, sampleY);
- accumVal[1] += filterPdf * tex2D<float>(tex, sampleX + 1, sampleY);
- accumVal[2] += filterPdf * tex2D<float>(tex, sampleX + 2, sampleY);
- accumVal[3] += filterPdf * tex2D<float>(tex, sampleX + 3, sampleY);
- }
- }
-
- encodeToPixel(accumVal, d_curBuffer, y * pitch + x * sizeOfFormat, inFormat, sizeOfFormat);
-}
-
-struct SMipTextureData
-{
- void* data;
- unsigned int dataSize;
- unsigned int mipLevel;
- unsigned int width;
- unsigned int height;
- NVRenderTextureFormats::Enum format;
-};
-
-__host__ void CUDABSDFMipMap::Build( void* inTextureData, int inTextureDataSize, NVRenderBackend::NVRenderBackendTextureObject inTextureHandle, NVRenderTextureFormats::Enum inFormat )
-{
- m_TextureHandle = inTextureHandle;
- m_InternalFormat = inFormat;
- m_SizeOfInternalFormat = NVRenderTextureFormats::getSizeofFormat( m_InternalFormat );
- m_InternalNoOfComponent = NVRenderTextureFormats::getNumberOfComponent( m_InternalFormat );
-
- m_Texture2D.SetTextureData( NVDataRef<NVU8>( (NVU8*)inTextureData, inTextureDataSize )
- , 0
- , m_Width
- , m_Height
- , inFormat
- , m_DestinationFormat );
-
- size_t pitch;
- float* d_inTextureData;
-
- cudaMallocPitch(&d_inTextureData, &pitch, m_Width * m_SizeOfInternalFormat, m_Height); CHECK_AND_HANDLE_CUDA_ERROR();
- CHECK_AND_HANDLE_CUDA_ERROR( cudaMemcpy2D( d_inTextureData, pitch, inTextureData, m_Width * m_SizeOfInternalFormat, m_Width * m_SizeOfInternalFormat, m_Height, cudaMemcpyHostToDevice ) );
- {
- dim3 blockDim(16, 16, 1);
- dim3 gridDim(ceil(m_Width / 16.0f), ceil(m_Height / 16.0f) ,1 );
-
- //std::cerr << "if= " << m_InternalFormat << " sizeOut= " << m_SizeOfInternalFormat << " numOfIntComp" << m_InternalNoOfComponent << " pitch= " << pitch << " destFormat= " << m_DestinationFormat << " sizeFormat= " << m_SizeOfFormat << " numOfComp= " << m_NoOfComponent << " Pitch0=" << m_Pitches[0] << std::endl;
- //NVLogWarn("cuda", "%i %i %i %i %i %i %i %i\n",(int)m_InternalFormat ,m_SizeOfInternalFormat ,m_InternalNoOfComponent , pitch, (int)m_DestinationFormat, m_SizeOfFormat, m_NoOfComponent ,m_Pitches[0]);
- ConvertData<<<gridDim, blockDim>>>( d_inTextureData, m_InternalFormat, m_SizeOfInternalFormat, m_InternalNoOfComponent, pitch,
- md_MipMapsData[0], m_DestinationFormat, m_SizeOfFormat, m_NoOfComponent, m_Pitches[0], m_Width, m_Height );
- }
- cudaFree(d_inTextureData);
-
- int curWidth = m_Width;
- int curHeight = m_Height;
-
- cudaTextureObject_t* tex;
- tex = new cudaTextureObject_t[m_MaxMipMapLevel];
- for ( int idx = 1; idx <= m_MaxMipMapLevel; ++idx )
- {
- tex[idx-1] = -1;
- dim3 blockDim(16, 16, 1);
- dim3 gridDim(ceil(curWidth / 32.0f), ceil(curHeight / 32.0f) ,1 );
-
- cudaResourceDesc resDesc;
- memset(&resDesc, 0, sizeof(resDesc));
- resDesc.res.pitch2D.desc.f = cudaChannelFormatKindFloat;
- resDesc.res.pitch2D.desc.x = m_SizeOfFormat / m_NoOfComponent * 8; // bits per channel
- resDesc.resType = cudaResourceTypePitch2D;
- resDesc.res.pitch2D.devPtr = (char*)(md_MipMapsData[idx-1]);
- resDesc.res.pitch2D.height = curHeight;
- resDesc.res.pitch2D.width = curWidth * m_NoOfComponent;
- resDesc.res.pitch2D.pitchInBytes = m_Pitches[idx-1];// aligned to texturePitchAlignment
-
- cudaTextureDesc texDesc;
- memset(&texDesc, 0, sizeof(texDesc));
- texDesc.addressMode[0] = cudaAddressModeWrap;
- texDesc.addressMode[1] = cudaAddressModeWrap;
- texDesc.readMode = cudaReadModeElementType;
- //texDesc.normalizedCoords = 1;
-
-
- CHECK_AND_HANDLE_CUDA_ERROR( cudaCreateTextureObject( &tex[idx-1], &resDesc, &texDesc, NULL ) );
- CreateBsdfMipLevel<<<gridDim, blockDim>>>( tex[idx-1], (reinterpret_cast<NVU8 *>(md_MipMapsData[idx])), (reinterpret_cast<NVU8 *>(md_MipMapsData[idx-1])), m_Pitches[idx], curWidth, curHeight, m_DestinationFormat, m_SizeOfFormat );
-
- curWidth = curWidth > 2 ? curWidth >> 1 : 1;
- curHeight = curHeight > 2 ? curHeight >> 1 : 1;
- }
-
- CHECK_AND_HANDLE_CUDA_ERROR( cudaDeviceSynchronize(); )
- BindTexture();
- TransferTexture();
- for (int idx = 0; idx < m_MaxMipMapLevel;++idx )
- cudaDestroyTextureObject(tex[idx]);
-// CHECK_AND_HANDLE_CUDA_ERROR( cudaDeviceReset(); )
- CHECK_AND_HANDLE_CUDA_ERROR( cudaDeviceSynchronize(); )
-
- //NV_FREE( m_Foundation.getAllocator(), inTextureData );
-
-}
diff --git a/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.h b/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.h
deleted file mode 100644
index be8f1366..00000000
--- a/src/Runtime/ogl-runtime/src/hdr/MipmapBSDF.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MIPMAPBSDF_H
-#define MIPMAPBSDF_H
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/backends/gl/Qt3DSOpenGLUtil.h"
-
-#include "Qt3DSRenderLoadedTexture.h"
-
-#include "Qt3DSTypes.h"
-#ifdef _LINUXPLATFORM
-#define __declspec(dllexport)
-#define __cdecl
-
-#endif
-using namespace qt3ds::render;
-
-class BSDFMipMap : public NVRefCounted
-{
-public:
- BSDFMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture, NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
- virtual ~BSDFMipMap();
-
- virtual void Build(void *inTextureData, int inTextureDataSize,
- NVRenderBackend::NVRenderBackendTextureObject inTextureHandle,
- NVRenderTextureFormats::Enum inFormat) = 0;
- static BSDFMipMap *Create(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
-
-protected:
- volatile QT3DSI32 mRefCount; ///< reference count
- NVFoundationBase &m_Foundation; ///< Foundation class for allocations and other base things
-
- NVRenderTexture2D &m_Texture2D;
- NVRenderTextureFormats::Enum m_InternalFormat;
- NVRenderTextureFormats::Enum m_DestinationFormat;
- int m_Width;
- int m_Height;
- int m_MaxMipMapLevel;
- int m_SizeOfFormat;
- int m_SizeOfInternalFormat;
- int m_InternalNoOfComponent;
- int m_NoOfComponent;
- NVRenderContext *m_NVRenderContext;
-};
-
-class BasicBSDFMipMap : public BSDFMipMap
-{
-public:
- BasicBSDFMipMap(NVRenderContext *inNVRenderContext, int inWidth, int inHeight,
- NVRenderTexture2D &inTexture, NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
-
- void Build(void *inTextureData, int inTextureDataSize,
- NVRenderBackend::NVRenderBackendTextureObject inTextureHandle,
- NVRenderTextureFormats::Enum inFormat);
-
- STextureData CreateBsdfMipLevel(STextureData &inCurMipLevel, STextureData &inPrevMipLevel,
- int width, int height); //, IPerfTimer& inPerfTimer );
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation);
-
- int wrapMod(int a, int base);
- void getWrappedCoords(int &sX, int &sY, int width, int height);
- NVRenderBackend::NVRenderBackendTextureObject m_TextureHandle;
-};
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportContainers.h b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportContainers.h
deleted file mode 100644
index 2f2a72ee..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportContainers.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_IMPORT_CONTAINERS_H
-#define QT3DS_IMPORT_CONTAINERS_H
-
-#include "EASTL/hash_map.h"
-#include "EASTL/hash_set.h"
-#include "EASTL/vector.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "Qt3DSDMWStrOps.h"
-
-namespace qt3dsimp {
-
-#define QT3DSIMP_FOREACH(idxnm, val) \
- for (QT3DSU32 idxnm = 0, __numItems = (QT3DSU32)val; idxnm < __numItems; ++idxnm)
-
-template <typename TKey, typename TValue, typename THash = eastl::hash<TKey>,
- typename TPredicate = eastl::equal_to<TKey>>
-struct ImportHashMap : public eastl::hash_map<TKey, TValue, THash, TPredicate>
-{
- using base_type = eastl::hash_map<TKey, TValue, THash, TPredicate>;
-
- ImportHashMap() {}
-
-
-
- bool contains(const TKey &key) const { return find(key) != base_type::end(); }
-};
-template <typename TKey>
-struct ImportHashSet : public eastl::hash_set<TKey, eastl::hash<TKey>, eastl::equal_to<TKey>>
-{
- using base_type = eastl::hash_set<TKey, eastl::hash<TKey>, eastl::equal_to<TKey>>;
- ImportHashSet() {}
- bool contains(const TKey &key) const { return base_type::find(key) != base_type::end(); }
-};
-template <typename TValue>
-struct ImportArray : public eastl::vector<TValue>
-{
- using base_type = eastl::vector<TValue>;
-
- ImportArray() {}
- operator NVConstDataRef<TValue>() const
- {
- return NVConstDataRef<TValue>(base_type::data(), (QT3DSU32) base_type::size());
- }
-
- operator NVDataRef<TValue>() {
- return NVDataRef<TValue>(base_type::data(), (QT3DSU32) base_type::size());
- }
-};
-
-inline NVConstDataRef<wchar_t> toRef(const wchar_t *data, QT3DSU32 len = 0)
-{
- if (IsTrivial(data))
- return NVConstDataRef<wchar_t>(L"", 0);
- len = len ? len : (QT3DSU32)wcslen(data);
- return NVConstDataRef<wchar_t>(data, len);
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportLibPrecompile.h b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportLibPrecompile.h
deleted file mode 100644
index 34da79d0..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportLibPrecompile.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSOption.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include <map>
-#include <vector>
-#include <string>
-#include <exception>
-#include <set>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include "Qt3DSDMDataTypes.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSBasicTemplates.h"
-
-namespace qt3dsimp {
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::render;
-using namespace qt3dsdm;
-using namespace std;
-}
-
-// TODO: reference additional headers your program requires here
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.cpp b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.cpp
deleted file mode 100644
index 1535b911..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.cpp
+++ /dev/null
@@ -1,829 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifdef WIN32
-#pragma warning(disable : 4100)
-#endif
-#include "Qt3DSImportLibPrecompile.h"
-#include "Qt3DSImportMesh.h"
-
-using namespace qt3dsimp;
-
-#ifdef QT3DS_X86
-
-// Ensure our objects are of expected sizes. This keeps us honest
-// And ensures that we can load the datastructures we expect to by simply
-// mapping the memory.
-QT3DS_COMPILE_TIME_ASSERT(sizeof(NVRenderComponentTypes::Enum) == 4);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(NVRenderDrawMode::Enum) == 4);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(NVRenderVertexBufferEntry) == 20);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(VertexBuffer) == 20);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(IndexBuffer) == 12);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(MeshSubset) == 40);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(MeshDataHeader) == 12);
-QT3DS_COMPILE_TIME_ASSERT(sizeof(Mesh) == 56);
-
-#endif
-
-#define QT3DSIMP_FOREACH(idxnm, val) \
- for (QT3DSU32 idxnm = 0, __numItems = (QT3DSU32)val; idxnm < __numItems; ++idxnm)
-
-namespace {
-
-struct MeshSubsetV1
-{
- // See description of a logical vertex buffer below
- QT3DSU32 m_LogicalVbufIndex;
- // QT3DS_MAX_U32 means use all available items
- QT3DSU32 m_Count;
- // Offset is in item size, not bytes.
- QT3DSU32 m_Offset;
- // Bounds of this subset. This is filled in by the builder
- // see AddMeshSubset
- NVBounds3 m_Bounds;
-};
-
-struct LogicalVertexBuffer
-{
- QT3DSU32 m_ByteOffset;
- QT3DSU32 m_ByteSize;
- LogicalVertexBuffer(QT3DSU32 byteOff, QT3DSU32 byteSize)
- : m_ByteOffset(byteOff)
- , m_ByteSize(byteSize)
- {
- }
- LogicalVertexBuffer()
- : m_ByteOffset(0)
- , m_ByteSize(0)
- {
- }
-};
-
-struct MeshV1
-{
- VertexBuffer m_VertexBuffer;
- IndexBuffer m_IndexBuffer;
- SOffsetDataRef<LogicalVertexBuffer> m_LogicalVertexBuffers; // may be empty
- SOffsetDataRef<MeshSubsetV1> m_Subsets;
- NVRenderDrawMode::Enum m_DrawMode;
- NVRenderWinding::Enum m_Winding;
- typedef MeshSubsetV1 TSubsetType;
-};
-
-template <typename TSerializer>
-void Serialize(TSerializer &serializer, MeshV1 &mesh)
-{
- QT3DSU8 *baseAddr = reinterpret_cast<QT3DSU8 *>(&mesh);
- serializer.streamify(mesh.m_VertexBuffer.m_Entries);
- serializer.align();
- QT3DSIMP_FOREACH(entry, mesh.m_VertexBuffer.m_Entries.size())
- {
- MeshVertexBufferEntry &entryData = const_cast<MeshVertexBufferEntry &>(
- mesh.m_VertexBuffer.m_Entries.index(baseAddr, entry));
- serializer.streamifyCharPointerOffset(entryData.m_NameOffset);
- serializer.align();
- }
- serializer.streamify(mesh.m_VertexBuffer.m_Data);
- serializer.align();
- serializer.streamify(mesh.m_IndexBuffer.m_Data);
- serializer.align();
- serializer.streamify(mesh.m_LogicalVertexBuffers);
- serializer.align();
- serializer.streamify(mesh.m_Subsets);
- serializer.align();
-}
-
-struct MeshSubsetV2
-{
- QT3DSU32 m_LogicalVbufIndex;
- QT3DSU32 m_Count;
- QT3DSU32 m_Offset;
- NVBounds3 m_Bounds;
- SOffsetDataRef<char16_t> m_Name;
-};
-
-struct MeshV2
-{
- static const char16_t *s_DefaultName;
-
- VertexBuffer m_VertexBuffer;
- IndexBuffer m_IndexBuffer;
- SOffsetDataRef<LogicalVertexBuffer> m_LogicalVertexBuffers; // may be empty
- SOffsetDataRef<MeshSubsetV2> m_Subsets;
- NVRenderDrawMode::Enum m_DrawMode;
- NVRenderWinding::Enum m_Winding;
- typedef MeshSubsetV2 TSubsetType;
-};
-
-template <typename TSerializer>
-void Serialize(TSerializer &serializer, MeshV2 &mesh)
-{
- QT3DSU8 *baseAddr = reinterpret_cast<QT3DSU8 *>(&mesh);
- serializer.streamify(mesh.m_VertexBuffer.m_Entries);
- serializer.align();
- QT3DSIMP_FOREACH(entry, mesh.m_VertexBuffer.m_Entries.size())
- {
- MeshVertexBufferEntry &entryData = const_cast<MeshVertexBufferEntry &>(
- mesh.m_VertexBuffer.m_Entries.index(baseAddr, entry));
- serializer.streamifyCharPointerOffset(entryData.m_NameOffset);
- serializer.align();
- }
- serializer.streamify(mesh.m_VertexBuffer.m_Data);
- serializer.align();
- serializer.streamify(mesh.m_IndexBuffer.m_Data);
- serializer.align();
- serializer.streamify(mesh.m_LogicalVertexBuffers);
- serializer.align();
- serializer.streamify(mesh.m_Subsets);
- serializer.align();
- QT3DSIMP_FOREACH(entry, mesh.m_Subsets.size())
- {
- MeshSubsetV2 &theSubset = const_cast<MeshSubsetV2 &>(mesh.m_Subsets.index(baseAddr, entry));
- serializer.streamify(theSubset.m_Name);
- serializer.align();
- }
-}
-
-// Localize the knowledge required to read/write a mesh into one function
-// written in such a way that you can both read and write by passing
-// in one serializer type or another.
-// This function needs to be careful to request alignment after every write of a
-// buffer that may leave us unaligned. The easiest way to be correct is to request
-// alignment a lot. The hardest way is to use knowledge of the datatypes and
-// only request alignment when necessary.
-template <typename TSerializer>
-void Serialize(TSerializer &serializer, Mesh &mesh)
-{
- QT3DSU8 *baseAddr = reinterpret_cast<QT3DSU8 *>(&mesh);
- serializer.streamify(mesh.m_VertexBuffer.m_Entries);
- serializer.align();
- QT3DSIMP_FOREACH(entry, mesh.m_VertexBuffer.m_Entries.size())
- {
- MeshVertexBufferEntry &entryData = mesh.m_VertexBuffer.m_Entries.index(baseAddr, entry);
- serializer.streamifyCharPointerOffset(entryData.m_NameOffset);
- serializer.align();
- }
- serializer.streamify(mesh.m_VertexBuffer.m_Data);
- serializer.align();
- serializer.streamify(mesh.m_IndexBuffer.m_Data);
- serializer.align();
- serializer.streamify(mesh.m_Subsets);
- serializer.align();
- QT3DSIMP_FOREACH(entry, mesh.m_Subsets.size())
- {
- MeshSubset &theSubset = const_cast<MeshSubset &>(mesh.m_Subsets.index(baseAddr, entry));
- serializer.streamify(theSubset.m_Name);
- serializer.align();
- }
- serializer.streamify(mesh.m_Joints);
- serializer.align();
-}
-
-struct TotallingSerializer
-{
- QT3DSU32 m_NumBytes;
- QT3DSU8 *m_BaseAddress;
- TotallingSerializer(QT3DSU8 *inBaseAddr)
- : m_NumBytes(0)
- , m_BaseAddress(inBaseAddr)
- {
- }
- template <typename TDataType>
- void streamify(const SOffsetDataRef<TDataType> &data)
- {
- m_NumBytes += data.size() * sizeof(TDataType);
- }
- void streamify(const char *data)
- {
- if (data == NULL)
- data = "";
- QT3DSU32 len = (QT3DSU32)strlen(data) + 1;
- m_NumBytes += 4;
- m_NumBytes += len;
- }
- void streamifyCharPointerOffset(QT3DSU32 inOffset)
- {
- if (inOffset) {
- const char *dataPtr = (const char *)(inOffset + m_BaseAddress);
- streamify(dataPtr);
- } else
- streamify("");
- }
- bool needsAlignment() const { return getAlignmentAmount() > 0; }
- QT3DSU32 getAlignmentAmount() const { return 4 - (m_NumBytes % 4); }
- void align()
- {
- if (needsAlignment())
- m_NumBytes += getAlignmentAmount();
- }
-};
-
-struct ByteWritingSerializer
-{
- IOutStream &m_Stream;
- TotallingSerializer m_ByteCounter;
- QT3DSU8 *m_BaseAddress;
- ByteWritingSerializer(IOutStream &str, QT3DSU8 *inBaseAddress)
- : m_Stream(str)
- , m_ByteCounter(inBaseAddress)
- , m_BaseAddress(inBaseAddress)
- {
- }
-
- template <typename TDataType>
- void streamify(const SOffsetDataRef<TDataType> &data)
- {
- m_ByteCounter.streamify(data);
- m_Stream.Write(data.begin(m_BaseAddress), data.size());
- }
- void streamify(const char *data)
- {
- m_ByteCounter.streamify(data);
- if (data == NULL)
- data = "";
- QT3DSU32 len = (QT3DSU32)strlen(data) + 1;
- m_Stream.Write(len);
- m_Stream.Write(data, len);
- }
- void streamifyCharPointerOffset(QT3DSU32 inOffset)
- {
- const char *dataPtr = (const char *)(inOffset + m_BaseAddress);
- streamify(dataPtr);
- }
-
- void align()
- {
- if (m_ByteCounter.needsAlignment()) {
- QT3DSU8 buffer[] = { 0, 0, 0, 0 };
- m_Stream.Write(buffer, m_ByteCounter.getAlignmentAmount());
- m_ByteCounter.align();
- }
- }
-};
-
-struct MemoryAssigningSerializer
-{
- QT3DSU8 *m_Memory;
- QT3DSU8 *m_BaseAddress;
- QT3DSU32 m_Size;
- TotallingSerializer m_ByteCounter;
- bool m_Failure;
- MemoryAssigningSerializer(QT3DSU8 *data, QT3DSU32 size, QT3DSU32 startOffset)
- : m_Memory(data + startOffset)
- , m_BaseAddress(data)
- , m_Size(size)
- , m_ByteCounter(data)
- , m_Failure(false)
- {
- // We expect 4 byte aligned memory to begin with
- QT3DS_ASSERT((((size_t)m_Memory) % 4) == 0);
- }
-
- template <typename TDataType>
- void streamify(const SOffsetDataRef<TDataType> &_data)
- {
- SOffsetDataRef<TDataType> &data = const_cast<SOffsetDataRef<TDataType> &>(_data);
- if (m_Failure) {
- data.m_Size = 0;
- data.m_Offset = 0;
- return;
- }
- QT3DSU32 current = m_ByteCounter.m_NumBytes;
- m_ByteCounter.streamify(_data);
- if (m_ByteCounter.m_NumBytes > m_Size) {
- data.m_Size = 0;
- data.m_Offset = 0;
- m_Failure = true;
- return;
- }
- QT3DSU32 numBytes = m_ByteCounter.m_NumBytes - current;
- if (numBytes) {
- data.m_Offset = (QT3DSU32)(m_Memory - m_BaseAddress);
- updateMemoryBuffer(numBytes);
- } else {
- data.m_Offset = 0;
- data.m_Size = 0;
- }
- }
- void streamify(const char *&_data)
- {
- QT3DSU32 len;
- m_ByteCounter.m_NumBytes += 4;
- if (m_ByteCounter.m_NumBytes > m_Size) {
- _data = "";
- m_Failure = true;
- return;
- }
- qt3ds::intrinsics::memCopy(&len, m_Memory, 4);
- updateMemoryBuffer(4);
- m_ByteCounter.m_NumBytes += len;
- if (m_ByteCounter.m_NumBytes > m_Size) {
- _data = "";
- m_Failure = true;
- return;
- }
- _data = (const char *)m_Memory;
- updateMemoryBuffer(len);
- }
- void streamifyCharPointerOffset(QT3DSU32 &inOffset)
- {
- const char *dataPtr;
- streamify(dataPtr);
- inOffset = (QT3DSU32)(dataPtr - (const char *)m_BaseAddress);
- }
- void align()
- {
- if (m_ByteCounter.needsAlignment()) {
- QT3DSU32 numBytes = m_ByteCounter.getAlignmentAmount();
- m_ByteCounter.align();
- updateMemoryBuffer(numBytes);
- }
- }
- void updateMemoryBuffer(QT3DSU32 numBytes) { m_Memory += numBytes; }
-};
-
-inline QT3DSU32 GetMeshDataSize(Mesh &mesh)
-{
- TotallingSerializer s(reinterpret_cast<QT3DSU8 *>(&mesh));
- Serialize(s, mesh);
- return s.m_NumBytes;
-}
-
-template <typename TDataType>
-QT3DSU32 NextIndex(const QT3DSU8 *inBaseAddress, const SOffsetDataRef<QT3DSU8> data, QT3DSU32 idx)
-{
- QT3DSU32 numItems = data.size() / sizeof(TDataType);
- if (idx < numItems) {
- const TDataType *dataPtr(reinterpret_cast<const TDataType *>(data.begin(inBaseAddress)));
- return dataPtr[idx];
- } else {
- QT3DS_ASSERT(false);
- return 0;
- }
-}
-
-template <typename TDataType>
-QT3DSU32 NextIndex(NVConstDataRef<QT3DSU8> data, QT3DSU32 idx)
-{
- QT3DSU32 numItems = data.size() / sizeof(TDataType);
- if (idx < numItems) {
- const TDataType *dataPtr(reinterpret_cast<const TDataType *>(data.begin()));
- return dataPtr[idx];
- } else {
- QT3DS_ASSERT(false);
- return 0;
- }
-}
-
-inline QT3DSU32 NextIndex(NVConstDataRef<QT3DSU8> inData,
- qt3ds::render::NVRenderComponentTypes::Enum inCompType, QT3DSU32 idx)
-{
- if (inData.size() == 0)
- return idx;
- switch (inCompType) {
- case NVRenderComponentTypes::QT3DSU8:
- return NextIndex<QT3DSU8>(inData, idx);
- case NVRenderComponentTypes::QT3DSI8:
- return NextIndex<QT3DSI8>(inData, idx);
- case NVRenderComponentTypes::QT3DSU16:
- return NextIndex<QT3DSU16>(inData, idx);
- case NVRenderComponentTypes::QT3DSI16:
- return NextIndex<QT3DSI16>(inData, idx);
- case NVRenderComponentTypes::QT3DSU32:
- return NextIndex<QT3DSU32>(inData, idx);
- case NVRenderComponentTypes::QT3DSI32:
- return NextIndex<QT3DSI32>(inData, idx);
- default:
- break;
- }
-
- // Invalid index buffer index type.
- QT3DS_ASSERT(false);
- return 0;
-}
-
-template <typename TMeshType>
-// Not exposed to the outside world
-TMeshType *DoInitialize(MeshBufHeaderFlags /*meshFlags*/, NVDataRef<QT3DSU8> data)
-{
- QT3DSU8 *newMem = data.begin();
- QT3DSU32 amountLeft = data.size() - sizeof(TMeshType);
- MemoryAssigningSerializer s(newMem, amountLeft, sizeof(TMeshType));
- TMeshType *retval = (TMeshType *)newMem;
- Serialize(s, *retval);
- if (s.m_Failure)
- return NULL;
- return retval;
-}
-}
-
-NVBounds3 Mesh::CalculateSubsetBounds(const NVRenderVertexBufferEntry &inEntry,
- NVConstDataRef<QT3DSU8> inVertxData, QT3DSU32 inStride,
- NVConstDataRef<QT3DSU8> inIndexData,
- qt3ds::render::NVRenderComponentTypes::Enum inIndexCompType,
- QT3DSU32 inSubsetCount, QT3DSU32 inSubsetOffset)
-{
- NVBounds3 retval(NVBounds3::empty());
- const NVRenderVertexBufferEntry &entry(inEntry);
- if (entry.m_ComponentType != NVRenderComponentTypes::QT3DSF32 || entry.m_NumComponents != 3) {
- QT3DS_ASSERT(false);
- return retval;
- }
-
- const QT3DSU8 *beginPtr = inVertxData.begin();
- QT3DSU32 numBytes = inVertxData.size();
- QT3DSU32 dataStride = inStride;
- QT3DSU32 posOffset = entry.m_FirstItemOffset;
- // The loop below could be template specialized *if* we wanted to do this.
- // and the perf of the existing loop was determined to be a problem.
- // Else I would rather stay way from the template specialization.
- QT3DSIMP_FOREACH(idx, inSubsetCount)
- {
- QT3DSU32 dataIdx = NextIndex(inIndexData, inIndexCompType, idx + inSubsetOffset);
- QT3DSU32 finalOffset = (dataIdx * dataStride) + posOffset;
- if (finalOffset + sizeof(QT3DSVec3) <= numBytes) {
- const QT3DSU8 *dataPtr = beginPtr + finalOffset;
- retval.include(*reinterpret_cast<const QT3DSVec3 *>(dataPtr));
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- return retval;
-}
-
-void Mesh::Save(IOutStream &outStream) const
-{
- Mesh &mesh(const_cast<Mesh &>(*this));
- QT3DSU8 *baseAddress = reinterpret_cast<QT3DSU8 *>(&mesh);
- QT3DSU32 numBytes = sizeof(Mesh) + GetMeshDataSize(mesh);
- MeshDataHeader header(numBytes);
- outStream.Write(header);
- outStream.Write(*this);
- ByteWritingSerializer writer(outStream, baseAddress);
- Serialize(writer, mesh);
-}
-
-wchar_t g_DefaultName[] = { 0 };
-
-const wchar_t *Mesh::s_DefaultName = g_DefaultName;
-
-template <typename TMeshType>
-struct SubsetNameHandler
-{
-};
-
-template <>
-struct SubsetNameHandler<MeshV1>
-{
- void AssignName(const QT3DSU8 * /*v1BaseAddress*/, const MeshSubsetV1 & /*mesh*/,
- QT3DSU8 * /*baseAddress*/, QT3DSU8 *& /*nameBuffer*/, MeshSubset &outDest)
- {
- outDest.m_Name = SOffsetDataRef<char16_t>();
- }
- QT3DSU32 NameLength(const MeshSubsetV1 &) { return 0; }
-};
-
-using qt3ds::intrinsics::memCopy;
-
-template <>
-struct SubsetNameHandler<MeshV2>
-{
- void AssignName(const QT3DSU8 *v2BaseAddress, const MeshSubsetV2 &mesh, QT3DSU8 *baseAddress,
- QT3DSU8 *&nameBuffer, MeshSubset &outDest)
- {
- outDest.m_Name.m_Size = mesh.m_Name.m_Size;
- outDest.m_Name.m_Offset = (QT3DSU32)(nameBuffer - baseAddress);
- QT3DSU32 dtypeSize = mesh.m_Name.m_Size * 2;
- memCopy(nameBuffer, mesh.m_Name.begin(v2BaseAddress), dtypeSize);
- nameBuffer += dtypeSize;
- }
- QT3DSU32 NameLength(const MeshSubsetV2 &mesh) { return (mesh.m_Name.size() + 1) * 2; }
-};
-
-QT3DSU32 GetAlignedOffset(QT3DSU32 offset, QT3DSU32 align)
-{
- QT3DSU32 leftover = offset % align;
- if (leftover)
- return offset + (align - leftover);
- return offset;
-}
-
-template <typename TPreviousMeshType>
-Mesh *CreateMeshFromPreviousMesh(TPreviousMeshType *temp, NVAllocatorCallback &alloc)
-{
- QT3DSU32 newMeshSize = sizeof(Mesh);
- QT3DSU8 *tempBaseAddress = reinterpret_cast<QT3DSU8 *>(temp);
- QT3DSU32 alignment = sizeof(void *);
-
- QT3DSU32 vertBufferSize = GetAlignedOffset(temp->m_VertexBuffer.m_Data.size(), alignment);
- newMeshSize += vertBufferSize;
- QT3DSU32 entryDataSize = temp->m_VertexBuffer.m_Entries.size() * sizeof(MeshVertexBufferEntry);
- newMeshSize += entryDataSize;
- QT3DSU32 indexBufferSize = GetAlignedOffset(temp->m_IndexBuffer.m_Data.size(), alignment);
- newMeshSize += indexBufferSize;
- QT3DSU32 entryNameSize = 0;
- for (QT3DSU32 entryIdx = 0, entryEnd = temp->m_VertexBuffer.m_Entries.size(); entryIdx < entryEnd;
- ++entryIdx) {
- const qt3ds::render::NVRenderVertexBufferEntry theEntry =
- temp->m_VertexBuffer.m_Entries.index(tempBaseAddress, entryIdx)
- .ToVertexBufferEntry(tempBaseAddress);
- const char *namePtr = theEntry.m_Name;
- if (namePtr == NULL)
- namePtr = "";
-
- entryNameSize += (QT3DSU32)strlen(theEntry.m_Name) + 1;
- }
- entryNameSize = GetAlignedOffset(entryNameSize, alignment);
-
- newMeshSize += entryNameSize;
- QT3DSU32 subsetBufferSize = temp->m_Subsets.size() * sizeof(MeshSubset);
- newMeshSize += subsetBufferSize;
- QT3DSU32 nameLength = 0;
- for (QT3DSU32 subsetIdx = 0, subsetEnd = temp->m_Subsets.size(); subsetIdx < subsetEnd;
- ++subsetIdx) {
- nameLength += SubsetNameHandler<TPreviousMeshType>().NameLength(
- temp->m_Subsets.index(tempBaseAddress, subsetIdx));
- }
- nameLength = GetAlignedOffset(nameLength, alignment);
-
- newMeshSize += nameLength;
-
- Mesh *retval = (Mesh *)alloc.allocate(newMeshSize, "TempData", __FILE__, __LINE__);
- new (retval) Mesh();
- QT3DSU8 *baseOffset = reinterpret_cast<QT3DSU8 *>(retval);
- QT3DSU8 *vertBufferData = baseOffset + sizeof(Mesh);
- QT3DSU8 *entryBufferData = vertBufferData + vertBufferSize;
- QT3DSU8 *entryNameBuffer = entryBufferData + entryDataSize;
- QT3DSU8 *indexBufferData = entryNameBuffer + entryNameSize;
- QT3DSU8 *subsetBufferData = indexBufferData + indexBufferSize;
- QT3DSU8 *nameData = subsetBufferData + subsetBufferSize;
-
- retval->m_DrawMode = temp->m_DrawMode;
- retval->m_Winding = temp->m_Winding;
- retval->m_VertexBuffer = temp->m_VertexBuffer;
- retval->m_VertexBuffer.m_Data.m_Offset = (QT3DSU32)(vertBufferData - baseOffset);
- retval->m_VertexBuffer.m_Entries.m_Offset = (QT3DSU32)(entryBufferData - baseOffset);
- memCopy(vertBufferData, temp->m_VertexBuffer.m_Data.begin(tempBaseAddress),
- temp->m_VertexBuffer.m_Data.size());
- memCopy(entryBufferData, temp->m_VertexBuffer.m_Entries.begin(tempBaseAddress), entryDataSize);
- QT3DSIMP_FOREACH(idx, temp->m_VertexBuffer.m_Entries.size())
- {
- const MeshVertexBufferEntry &src =
- temp->m_VertexBuffer.m_Entries.index(tempBaseAddress, idx);
- MeshVertexBufferEntry &dest = retval->m_VertexBuffer.m_Entries.index(baseOffset, idx);
-
- const char *targetName = reinterpret_cast<const char *>(src.m_NameOffset + tempBaseAddress);
- if (src.m_NameOffset == 0)
- targetName = "";
- QT3DSU32 nameLen = (QT3DSU32)strlen(targetName) + 1;
- dest.m_NameOffset = (QT3DSU32)(entryNameBuffer - baseOffset);
- memCopy(entryNameBuffer, targetName, nameLen);
- entryNameBuffer += nameLen;
- }
-
- retval->m_IndexBuffer = temp->m_IndexBuffer;
- retval->m_IndexBuffer.m_Data.m_Offset = (QT3DSU32)(indexBufferData - baseOffset);
- memCopy(indexBufferData, temp->m_IndexBuffer.m_Data.begin(tempBaseAddress),
- temp->m_IndexBuffer.m_Data.size());
-
- retval->m_Subsets.m_Size = temp->m_Subsets.m_Size;
- retval->m_Subsets.m_Offset = (QT3DSU32)(subsetBufferData - baseOffset);
- QT3DSIMP_FOREACH(idx, temp->m_Subsets.size())
- {
- MeshSubset &dest = const_cast<MeshSubset &>(retval->m_Subsets.index(baseOffset, idx));
- const typename TPreviousMeshType::TSubsetType &src =
- temp->m_Subsets.index(tempBaseAddress, idx);
- dest.m_Count = src.m_Count;
- dest.m_Offset = src.m_Offset;
- dest.m_Bounds = src.m_Bounds;
- SubsetNameHandler<TPreviousMeshType>().AssignName(tempBaseAddress, src, baseOffset,
- nameData, dest);
- }
- alloc.deallocate(temp);
- return retval;
-}
-
-Mesh *Mesh::Load(NVAllocatorCallback &alloc, IInStream &inStream)
-{
- MeshDataHeader header;
- inStream.Read(header);
- QT3DS_ASSERT(header.m_FileId == MeshDataHeader::GetFileId());
- if (header.m_FileId != MeshDataHeader::GetFileId())
- return NULL;
- if (header.m_FileVersion < 1 || header.m_FileVersion > MeshDataHeader::GetCurrentFileVersion())
- return NULL;
- if (header.m_SizeInBytes < sizeof(Mesh))
- return NULL;
- QT3DSU8 *newMem = (QT3DSU8 *)alloc.allocate(header.m_SizeInBytes, "Mesh", __FILE__, __LINE__);
- QT3DSU32 amountRead = inStream.Read(NVDataRef<QT3DSU8>(newMem, header.m_SizeInBytes));
- if (amountRead != header.m_SizeInBytes)
- goto failure;
-
- if (header.m_FileVersion == 1) {
- MeshV1 *temp = DoInitialize<MeshV1>(header.m_HeaderFlags,
- NVDataRef<QT3DSU8>(newMem, header.m_SizeInBytes));
- if (temp == NULL)
- goto failure;
- return CreateMeshFromPreviousMesh(temp, alloc);
-
- } else if (header.m_FileVersion == 2) {
- MeshV2 *temp = DoInitialize<MeshV2>(header.m_HeaderFlags,
- NVDataRef<QT3DSU8>(newMem, header.m_SizeInBytes));
- if (temp == NULL)
- goto failure;
- return CreateMeshFromPreviousMesh(temp, alloc);
- } else {
- Mesh *retval = Initialize(header.m_FileVersion, header.m_HeaderFlags,
- NVDataRef<QT3DSU8>(newMem, header.m_SizeInBytes));
- if (retval == NULL)
- goto failure;
- return retval;
- }
-
-failure:
- QT3DS_ASSERT(false);
- alloc.deallocate(newMem);
- return NULL;
-}
-
-Mesh *Mesh::Initialize(QT3DSU16 meshVersion, MeshBufHeaderFlags meshFlags, NVDataRef<QT3DSU8> data)
-{
- if (meshVersion != MeshDataHeader::GetCurrentFileVersion())
- return NULL;
- return DoInitialize<Mesh>(meshFlags, data);
-}
-
-// Multimesh support where you have multiple meshes in a single file.
-// Save multi where you have overridden the allocator.
-QT3DSU32 Mesh::SaveMulti(NVAllocatorCallback &alloc, ISeekableIOStream &inStream, QT3DSU32 inId) const
-{
- QT3DSU32 nextId = 1;
- MeshMultiHeader tempHeader;
- MeshMultiHeader *theHeader = NULL;
- MeshMultiHeader *theWriteHeader = NULL;
-
- QT3DSI64 newMeshStartPos = 0;
- if (inStream.GetLength() != 0) {
- theHeader = LoadMultiHeader(alloc, inStream);
- if (theHeader == NULL) {
- QT3DS_ASSERT(false);
- return 0;
- }
- QT3DSU8 *headerBaseAddr = reinterpret_cast<QT3DSU8 *>(theHeader);
- for (QT3DSU32 idx = 0, end = theHeader->m_Entries.size(); idx < end; ++idx) {
- if (inId != 0) {
- QT3DS_ASSERT(inId != theHeader->m_Entries.index(headerBaseAddr, idx).m_MeshId);
- }
- nextId = qMax(nextId, theHeader->m_Entries.index(headerBaseAddr, idx).m_MeshId + 1);
- }
- newMeshStartPos =
- sizeof(MeshMultiHeader) + theHeader->m_Entries.size() * sizeof(MeshMultiEntry);
- theWriteHeader = theHeader;
- } else
- theWriteHeader = &tempHeader;
-
- inStream.SetPosition(-newMeshStartPos, SeekPosition::End);
- QT3DSI64 meshOffset = inStream.GetPosition();
-
- Save(inStream);
-
- if (inId != 0)
- nextId = inId;
- QT3DSU8 *theWriteBaseAddr = reinterpret_cast<QT3DSU8 *>(theWriteHeader);
- // Now write a new header out.
- inStream.Write(theWriteHeader->m_Entries.begin(theWriteBaseAddr),
- theWriteHeader->m_Entries.size());
- MeshMultiEntry newEntry(static_cast<QT3DSI64>(meshOffset), nextId);
- inStream.Write(newEntry);
- theWriteHeader->m_Entries.m_Size++;
- inStream.Write(*theWriteHeader);
-
- if (theHeader != NULL) {
- alloc.deallocate(theHeader);
- }
- return static_cast<QT3DSU32>(nextId);
-}
-
-// Load a single mesh directly from a multi file with the provided overridden items
-SMultiLoadResult Mesh::LoadMulti(NVAllocatorCallback &alloc, ISeekableIOStream &inStream,
- QT3DSU32 inId)
-{
- MeshMultiHeader *theHeader(LoadMultiHeader(alloc, inStream));
- if (theHeader == NULL) {
- return SMultiLoadResult();
- }
- QT3DSU64 fileOffset = (QT3DSU64)-1;
- QT3DSU32 theId = inId;
- QT3DSU8 *theHeaderBaseAddr = reinterpret_cast<QT3DSU8 *>(theHeader);
- bool foundMesh = false;
- for (QT3DSU32 idx = 0, end = theHeader->m_Entries.size(); idx < end && !foundMesh; ++idx) {
- const MeshMultiEntry &theEntry(theHeader->m_Entries.index(theHeaderBaseAddr, idx));
- if (theEntry.m_MeshId == inId || (inId == 0 && theEntry.m_MeshId > theId)) {
- if (theEntry.m_MeshId == inId)
- foundMesh = true;
- theId = qMax(theId, (QT3DSU32)theEntry.m_MeshId);
- fileOffset = theEntry.m_MeshOffset;
- }
- }
- Mesh *retval = NULL;
- if (fileOffset == (QT3DSU64)-1) {
- goto endFunction;
- }
-
- inStream.SetPosition(static_cast<QT3DSI64>(fileOffset), SeekPosition::Begin);
- retval = Load(alloc, inStream);
-endFunction:
- if (theHeader != NULL)
- alloc.deallocate(theHeader);
- return SMultiLoadResult(retval, theId);
-}
-
-// Returns true if this is a multimesh (several meshes in one file).
-bool Mesh::IsMulti(ISeekableIOStream &inStream)
-{
- MeshMultiHeader theHeader;
- inStream.SetPosition(-((QT3DSI64)(sizeof(MeshMultiHeader))), SeekPosition::End);
- QT3DSU32 numBytes = inStream.Read(theHeader);
- if (numBytes != sizeof(MeshMultiHeader))
- return false;
- return theHeader.m_Version == MeshMultiHeader::GetMultiStaticFileId();
-}
-// Load a multi header from a stream.
-MeshMultiHeader *Mesh::LoadMultiHeader(NVAllocatorCallback &alloc, ISeekableIOStream &inStream)
-{
- MeshMultiHeader theHeader;
- inStream.SetPosition(-((QT3DSI64)sizeof(MeshMultiHeader)), SeekPosition::End);
- QT3DSU32 numBytes = inStream.Read(theHeader);
- if (numBytes != sizeof(MeshMultiHeader)
- || theHeader.m_FileId != MeshMultiHeader::GetMultiStaticFileId()
- || theHeader.m_Version > MeshMultiHeader::GetMultiStaticVersion()) {
- return NULL;
- }
- size_t allocSize =
- sizeof(MeshMultiHeader) + theHeader.m_Entries.m_Size * sizeof(MeshMultiEntry);
- MeshMultiHeader *retval =
- (MeshMultiHeader *)alloc.allocate(allocSize, "MeshMultiHeader", __FILE__, __LINE__);
- if (retval == NULL) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- QT3DSU8 *baseAddr = reinterpret_cast<QT3DSU8 *>(retval);
- QT3DSU8 *entryData = baseAddr + sizeof(MeshMultiHeader);
- *retval = theHeader;
- retval->m_Entries.m_Offset = (QT3DSU32)(entryData - baseAddr);
- inStream.SetPosition(-((QT3DSI64)allocSize), SeekPosition::End);
-
- numBytes =
- inStream.Read(reinterpret_cast<MeshMultiEntry *>(entryData), retval->m_Entries.m_Size);
- if (numBytes != retval->m_Entries.m_Size * sizeof(MeshMultiEntry)) {
- QT3DS_ASSERT(false);
- alloc.deallocate(retval);
- retval = NULL;
- }
- return retval;
-}
-
-QT3DSU32 GetHighestId(NVAllocatorCallback &inAlloc, MeshMultiHeader *inHeader)
-{
- if (inHeader == NULL) {
- QT3DS_ASSERT(false);
- return 0;
- }
- QT3DSU8 *baseHeaderAddr = reinterpret_cast<QT3DSU8 *>(inHeader);
- QT3DSU32 highestId = 0;
- for (QT3DSU32 idx = 0, end = inHeader->m_Entries.size(); idx < end; ++idx)
- highestId = qMax(highestId, inHeader->m_Entries.index(baseHeaderAddr, idx).m_MeshId);
- inAlloc.deallocate(inHeader);
- return highestId;
-}
-
-QT3DSU32 Mesh::GetHighestMultiVersion(NVAllocatorCallback &alloc, ISeekableIOStream &inStream)
-{
- return GetHighestId(alloc, LoadMultiHeader(alloc, inStream));
-}
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.h b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.h
deleted file mode 100644
index 36b7a841..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMesh.h
+++ /dev/null
@@ -1,530 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_IMPORT_MESH_H
-#define QT3DS_IMPORT_MESH_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/IOStreams.h"
-
-namespace qt3dsimp {
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::render;
-template <typename TDataType>
-struct SOffsetDataRef
-{
- QT3DSU32 m_Offset;
- QT3DSU32 m_Size;
- SOffsetDataRef()
- : m_Offset(0)
- , m_Size(0)
- {
- }
- TDataType *begin(QT3DSU8 *inBase) { return reinterpret_cast<TDataType *>(inBase + m_Offset); }
- TDataType *end(QT3DSU8 *inBase) { return begin(inBase) + m_Size; }
- const TDataType *begin(const QT3DSU8 *inBase) const
- {
- return reinterpret_cast<const TDataType *>(inBase + m_Offset);
- }
- const TDataType *end(const QT3DSU8 *inBase) const { return begin(inBase) + m_Size; }
- QT3DSU32 size() const { return m_Size; }
- bool empty() const { return m_Size == 0; }
- TDataType &index(QT3DSU8 *inBase, QT3DSU32 idx)
- {
- QT3DS_ASSERT(idx < m_Size);
- return begin(inBase)[idx];
- }
- const TDataType &index(const QT3DSU8 *inBase, QT3DSU32 idx) const
- {
- QT3DS_ASSERT(idx < m_Size);
- return begin(inBase)[idx];
- }
-};
-
-struct MeshVertexBufferEntry
-{
- QT3DSU32 m_NameOffset;
- /** Datatype of the this entry points to in the buffer */
- NVRenderComponentTypes::Enum m_ComponentType;
- /** Number of components of each data member. 1,2,3, or 4. Don't be stupid.*/
- QT3DSU32 m_NumComponents;
- /** Offset from the beginning of the buffer of the first item */
- QT3DSU32 m_FirstItemOffset;
- MeshVertexBufferEntry()
- : m_NameOffset(0)
- , m_ComponentType(NVRenderComponentTypes::QT3DSF32)
- , m_NumComponents(3)
- , m_FirstItemOffset(0)
- {
- }
- NVRenderVertexBufferEntry ToVertexBufferEntry(QT3DSU8 *inBaseAddress)
- {
- const char *nameBuffer = "";
- if (m_NameOffset)
- nameBuffer = reinterpret_cast<const char *>(inBaseAddress + m_NameOffset);
- return NVRenderVertexBufferEntry(nameBuffer, m_ComponentType, m_NumComponents,
- m_FirstItemOffset);
- }
-};
-
-struct VertexBuffer
-{
- SOffsetDataRef<MeshVertexBufferEntry> m_Entries;
- QT3DSU32 m_Stride;
- SOffsetDataRef<QT3DSU8> m_Data;
- VertexBuffer(SOffsetDataRef<MeshVertexBufferEntry> entries, QT3DSU32 stride,
- SOffsetDataRef<QT3DSU8> data)
- : m_Entries(entries)
- , m_Stride(stride)
- , m_Data(data)
- {
- }
- VertexBuffer()
- : m_Stride(0)
- {
- }
-};
-
-struct IndexBuffer
-{
- // Component types must be either QT3DSU16 or QT3DSU8 in order for the
- // graphics hardware to deal with the buffer correctly.
- NVRenderComponentTypes::Enum m_ComponentType;
- SOffsetDataRef<QT3DSU8> m_Data;
- // Either QT3DSU8 or QT3DSU16 component types are allowed by the underlying rendering
- // system, so you would be wise to stick with those.
- IndexBuffer(NVRenderComponentTypes::Enum compType, SOffsetDataRef<QT3DSU8> data)
- : m_ComponentType(compType)
- , m_Data(data)
- {
- }
- IndexBuffer()
- : m_ComponentType(NVRenderComponentTypes::Unknown)
- {
- }
-};
-
-template <QT3DSU32 TNumBytes>
-struct MeshPadding
-{
- QT3DSU8 m_Padding[TNumBytes];
- MeshPadding() { memZero(m_Padding, TNumBytes); }
-};
-
-struct MeshSubset
-{
- // QT3DS_MAX_U32 means use all available items
- QT3DSU32 m_Count;
- // Offset is in item size, not bytes.
- QT3DSU32 m_Offset;
- // Bounds of this subset. This is filled in by the builder
- // see AddMeshSubset
- NVBounds3 m_Bounds;
-
- // Subsets have to be named else artists will be unable to use
- // a mesh with multiple subsets as they won't have any idea
- // while part of the model a given mesh actually maps to.
- SOffsetDataRef<char16_t> m_Name;
-
- MeshSubset(QT3DSU32 count, QT3DSU32 off, const NVBounds3 &bounds, SOffsetDataRef<char16_t> inName)
- : m_Count(count)
- , m_Offset(off)
- , m_Bounds(bounds)
- , m_Name(inName)
- {
- }
- MeshSubset()
- : m_Count((QT3DSU32)-1)
- , m_Offset(0)
- , m_Bounds(NVBounds3::empty())
- {
- }
- bool HasCount() const { return m_Count != QT3DS_MAX_U32; }
-};
-
-// Placeholder for bitflags in the mesh header.
-struct MeshBufHeaderFlagValues
-{
- enum Enum {};
-};
-
-struct MeshBufHeaderFlags : NVFlags<MeshBufHeaderFlagValues::Enum, QT3DSU16>
-{
- MeshBufHeaderFlags() {}
- MeshBufHeaderFlags(QT3DSU16 value)
- : NVFlags<MeshBufHeaderFlagValues::Enum, QT3DSU16>(value)
- {
- }
- // Binary or creates an integer.
- MeshBufHeaderFlags(int value)
- : NVFlags<MeshBufHeaderFlagValues::Enum, QT3DSU16>((QT3DSU16)value)
- {
- }
-};
-
-struct MeshDataHeader
-{
- static QT3DSU32 GetFileId() { return (QT3DSU32)-929005747; }
- static QT3DSU16 GetCurrentFileVersion() { return 3; }
- QT3DSU32 m_FileId;
- QT3DSU16 m_FileVersion;
- MeshBufHeaderFlags m_HeaderFlags;
- QT3DSU32 m_SizeInBytes;
- MeshDataHeader(QT3DSU32 size = 0)
- : m_FileId(GetFileId())
- , m_FileVersion(GetCurrentFileVersion())
- , m_SizeInBytes(size)
- {
- }
-};
-
-struct Joint
-{
- QT3DSI32 m_JointID;
- QT3DSI32 m_ParentID;
- QT3DSF32 m_invBindPose[16];
- QT3DSF32 m_localToGlobalBoneSpace[16];
-
- Joint(QT3DSI32 jointID, QT3DSI32 parentID, const QT3DSF32 *invBindPose,
- const QT3DSF32 *localToGlobalBoneSpace)
- : m_JointID(jointID)
- , m_ParentID(parentID)
- {
- ::memcpy(m_invBindPose, invBindPose, sizeof(float) * 16);
- ::memcpy(m_localToGlobalBoneSpace, localToGlobalBoneSpace, sizeof(float) * 16);
- }
- Joint()
- : m_JointID(-1)
- , m_ParentID(-1)
- {
- ::memset(m_invBindPose, 0, sizeof(float) * 16);
- ::memset(m_localToGlobalBoneSpace, 0, sizeof(float) * 16);
- }
-};
-
-// Tells us what offset a mesh with this ID starts.
-struct MeshMultiEntry
-{
- QT3DSU64 m_MeshOffset;
- QT3DSU32 m_MeshId;
- QT3DSU32 m_Padding;
- MeshMultiEntry()
- : m_MeshOffset(0)
- , m_MeshId(0)
- , m_Padding(0)
- {
- }
- MeshMultiEntry(QT3DSU64 mo, QT3DSU32 meshId)
- : m_MeshOffset(mo)
- , m_MeshId(meshId)
- , m_Padding(0)
- {
- }
-};
-
-// The multi headers are actually saved at the end of the file.
-// Thus when you append to the file we overwrite the last header
-// then write out a new header structure.
-// The last 8 bytes of the file contain the multi header.
-// The previous N*8 bytes contain the mesh entries.
-struct MeshMultiHeader
-{
- QT3DSU32 m_FileId;
- QT3DSU32 m_Version;
- SOffsetDataRef<MeshMultiEntry> m_Entries;
- static QT3DSU32 GetMultiStaticFileId() { return (QT3DSU32)555777497; }
- static QT3DSU32 GetMultiStaticVersion() { return 1; }
-
- MeshMultiHeader()
- : m_FileId(GetMultiStaticFileId())
- , m_Version(GetMultiStaticVersion())
- {
- }
-};
-
-struct Mesh;
-
-// Result of a multi-load operation. This returns both the mesh
-// and the id of the mesh that was loaded.
-struct SMultiLoadResult
-{
- Mesh *m_Mesh;
- QT3DSU32 m_Id;
- SMultiLoadResult(Mesh *inMesh, QT3DSU32 inId)
- : m_Mesh(inMesh)
- , m_Id(inId)
- {
- }
- SMultiLoadResult()
- : m_Mesh(NULL)
- , m_Id(0)
- {
- }
- operator Mesh *() { return m_Mesh; }
-};
-
-/**
-* A Mesh defines one vertex buffer layout, one or more logical vertex buffers
-* one index buffer, and a set of defined draw calls (subsets).
-*
-* The vertex buffer data is held together continguously and the layout cannot
-* change. There can be several actual vertex buffers on the card, however, in order
-* to facilitate using index buffer components of smaller component sizes than there
-* are actual vertex buffer data entries. For instance, you may have a very large vertex
-* buffer, larger than 64 K but openglES has a restriction on the size of the index buffer
-*component
-* that it cannot be larger than two bytes per entry. So you would need to split the vertex
-*buffer
-* into multiple logical vertex buffers and adjust your indexes such that you indexed into
-* only one logical vertex buffer per draw call.
-*
-* No logical vertex buffers means that the vertex buffer index on a mesh subset will be
-*ignored.
-*/
-struct Mesh
-{
- static const wchar_t *s_DefaultName;
-
- VertexBuffer m_VertexBuffer;
- IndexBuffer m_IndexBuffer;
- SOffsetDataRef<MeshSubset> m_Subsets;
- SOffsetDataRef<Joint> m_Joints;
- NVRenderDrawMode::Enum m_DrawMode;
- NVRenderWinding::Enum m_Winding;
-
- Mesh()
- : m_DrawMode(NVRenderDrawMode::Triangles)
- , m_Winding(NVRenderWinding::CounterClockwise)
- {
- }
- Mesh(VertexBuffer vbuf, IndexBuffer ibuf, const SOffsetDataRef<MeshSubset> &insts,
- const SOffsetDataRef<Joint> &joints,
- NVRenderDrawMode::Enum drawMode = NVRenderDrawMode::Triangles,
- NVRenderWinding::Enum winding = NVRenderWinding::CounterClockwise)
- : m_VertexBuffer(vbuf)
- , m_IndexBuffer(ibuf)
- , m_Subsets(insts)
- , m_Joints(joints)
- , m_DrawMode(drawMode)
- , m_Winding(winding)
- {
- }
-
- QT3DSU8 *GetBaseAddress() { return reinterpret_cast<QT3DSU8 *>(this); }
- const QT3DSU8 *GetBaseAddress() const { return reinterpret_cast<const QT3DSU8 *>(this); }
-
- static const char *GetPositionAttrName() { return "attr_pos"; }
- static const char *GetNormalAttrName() { return "attr_norm"; }
- static const char *GetUVAttrName() { return "attr_uv0"; }
- static const char *GetUV2AttrName() { return "attr_uv1"; }
- static const char *GetTexTanAttrName() { return "attr_textan"; }
- static const char *GetTexBinormalAttrName() { return "attr_binormal"; }
- static const char *GetWeightAttrName() { return "attr_weight"; }
- static const char *GetBoneIndexAttrName() { return "attr_boneid"; }
- static const char *GetColorAttrName() { return "attr_color"; }
-
- // Run through the vertex buffer items indicated by subset
- // Assume vbuf entry[posEntryIndex] is the position entry
- // This entry has to be QT3DSF32 and 3 components.
- // Using this entry and the (possibly empty) index buffer
- // along with the (possibly emtpy) logical vbuf data
- // return a bounds of the given vertex buffer.
- static NVBounds3 CalculateSubsetBounds(const NVRenderVertexBufferEntry &inEntry,
- NVConstDataRef<QT3DSU8> inVertxData, QT3DSU32 inStride,
- NVConstDataRef<QT3DSU8> inIndexData,
- qt3ds::render::NVRenderComponentTypes::Enum inIndexCompType,
- QT3DSU32 inSubsetCount, QT3DSU32 inSubsetOffset);
-
- // Format is:
- // MeshDataHeader
- // mesh data.
- void Save(IOutStream &outStream) const;
-
- // Save a mesh using fopen and fwrite
- bool Save(const char *inFilePath) const;
-
- // read the header, then read the object.
- // Object data is written in LE format for now.
- // Free the new mesh by calling:
- // alloc.deallocate( mesh );
- // All the memory is allocated once and then pointers are back
- // filled, so this will work.
- static Mesh *Load(NVAllocatorCallback &alloc, IInStream &inStream);
-
- // Load a mesh using fopen and fread
- // Mesh needs to be freed by the caller using free
- static Mesh *Load(const char *inFilePath);
-
- // Create a mesh given this header, and that data. data.size() must match
- // header.SizeInBytes. The mesh returned starts a data[0], so however data
- // was allocated is how the mesh should be deallocated.
- static Mesh *Initialize(QT3DSU16 meshVersion, MeshBufHeaderFlags meshFlags, NVDataRef<QT3DSU8> data);
-
- // Multimesh support where you have multiple meshes in a single file.
- // Save multi where you have overridden the allocator.
- QT3DSU32 SaveMulti(NVAllocatorCallback &alloc, ISeekableIOStream &inStream, QT3DSU32 inId = 0) const;
- // You can save multiple meshes in a file. Each mesh returns an incrementing
- // integer for the multi file. The original meshes aren't changed, and the file
- // is appended to.
- QT3DSU32 SaveMulti(const char *inFilePath) const;
-
- // Load a single mesh directly from a multi file with the provided overridden items
- // Loading a multimesh with id == 0 indicates to just load the mesh with the highest id.
- static SMultiLoadResult LoadMulti(NVAllocatorCallback &alloc, ISeekableIOStream &inStream,
- QT3DSU32 inId = 0);
- // Load a single mesh using c file API and malloc/free.
- static SMultiLoadResult LoadMulti(const char *inFilePath, QT3DSU32 inId);
- // Returns true if this is a multimesh (several meshes in one file).
- static bool IsMulti(ISeekableIOStream &inStream);
- // Load a multi header from a stream.
- static MeshMultiHeader *LoadMultiHeader(NVAllocatorCallback &alloc,
- ISeekableIOStream &inStream);
- // Load a multi header from a file using malloc. Header needs to be freed using free.
- static MeshMultiHeader *LoadMultiHeader(const char *inFilePath);
-
- // Get the highest mesh version from a stream.
- static QT3DSU32 GetHighestMultiVersion(NVAllocatorCallback &alloc, ISeekableIOStream &inStream);
- // Get the highest mesh version from a file.
- static QT3DSU32 GetHighestMultiVersion(const char *inFilePath);
-};
-
-struct ScopedMesh
-{
- Mesh *m_Mesh;
- NVAllocatorCallback *m_Callback;
- ScopedMesh(Mesh *m, NVAllocatorCallback *cback = NULL)
- : m_Mesh(m)
- , m_Callback(cback)
- {
- }
- ~ScopedMesh()
- {
- if (m_Mesh) {
- if (m_Callback)
- m_Callback->deallocate(m_Mesh);
- else
- free(m_Mesh);
- }
- }
- Mesh *operator->() { return m_Mesh; }
- operator Mesh *() { return m_Mesh; }
-};
-
-struct MeshBuilderVBufEntry
-{
- const char *m_Name;
- NVConstDataRef<QT3DSU8> m_Data;
- NVRenderComponentTypes::Enum m_ComponentType;
- QT3DSU32 m_NumComponents;
- MeshBuilderVBufEntry()
- : m_Name(NULL)
- , m_ComponentType(NVRenderComponentTypes::Unknown)
- , m_NumComponents(0)
- {
- }
- MeshBuilderVBufEntry(const char *name, NVConstDataRef<QT3DSU8> data,
- NVRenderComponentTypes::Enum componentType, QT3DSU32 numComponents)
- : m_Name(name)
- , m_Data(data)
- , m_ComponentType(componentType)
- , m_NumComponents(numComponents)
- {
- }
-};
-
-// Useful class to build up a mesh. Necessary since meshes don't include that
-// sort of utility.
-class MeshBuilder
-{
-protected:
- virtual ~MeshBuilder() {}
-public:
- virtual void Release() = 0;
- virtual void Reset() = 0;
- // Set the draw parameters for any subsets. Defaults to triangles and counter clockwise
- virtual void SetDrawParameters(NVRenderDrawMode::Enum drawMode,
- NVRenderWinding::Enum winding) = 0;
- // Set the vertex buffer and have the mesh builder interleave the data for you
- virtual bool SetVertexBuffer(NVConstDataRef<MeshBuilderVBufEntry> entries) = 0;
- // Set the vertex buffer from interleaved data.
- virtual void SetVertexBuffer(NVConstDataRef<NVRenderVertexBufferEntry> entries, QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> data) = 0;
- // The builder (and the majority of the rest of the product) only supports unsigned 16 bit
- // indexes
- virtual void SetIndexBuffer(NVConstDataRef<QT3DSU8> data, NVRenderComponentTypes::Enum comp) = 0;
- // Assets if the supplied parameters are out of range.
- virtual void AddJoint(QT3DSI32 jointID, QT3DSI32 parentID, const QT3DSF32 *invBindPose,
- const QT3DSF32 *localToGlobalBoneSpace) = 0;
- /**
- * Add a subset, which equates roughly to a draw call.
- * A logical vertex buffer allows you to have more that 64K vertexes but still
- * use u16 index buffers. In any case, if the mesh has an index buffer then this subset
- * refers to that index buffer, else it is assumed to index into the vertex buffer.
- * count and offset do exactly what they seem to do, while boundsPositionEntryIndex, if set to
- * something other than QT3DS_MAX_U32, drives the calculation of the aa-bounds of the subset
- * using mesh::CalculateSubsetBounds
- */
- virtual void AddMeshSubset(const wchar_t *inSubsetName = Mesh::s_DefaultName,
- QT3DSU32 count = QT3DS_MAX_U32, QT3DSU32 offset = 0,
- QT3DSU32 boundsPositionEntryIndex = QT3DS_MAX_U32) = 0;
-
- virtual void AddMeshSubset(const wchar_t *inSubsetName, QT3DSU32 count, QT3DSU32 offset,
- const NVBounds3 &inBounds) = 0;
-
- // Call to optimize the index and vertex buffers. This doesn't change the subset information,
- // each triangle is rendered precisely the same.
- // It just orders the vertex data so we iterate through it as linearly as possible.
- // This *only* works if the *entire* builder is using triangles as the draw mode. This will be
- // a disaster if that
- // condition is not met.
- virtual void OptimizeMesh() = 0;
-
- /**
- * @brief This functions stitches together sub-meshes with the same material.
- * This re-writes the index buffer
- *
- * @return no return.
- */
- virtual void ConnectSubMeshes() = 0;
-
- // Return the current mesh. This is only good for this function call, item may change or be
- // released
- // due to any further function calls.
- virtual Mesh &GetMesh() = 0;
-
- // Uses new/delete.
- static MeshBuilder &CreateMeshBuilder();
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMeshBuilder.cpp b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMeshBuilder.cpp
deleted file mode 100644
index e8c6d92e..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportMeshBuilder.cpp
+++ /dev/null
@@ -1,598 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSImportLibPrecompile.h"
-#include "Qt3DSImportMesh.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "Qt3DSImportContainers.h"
-
-using namespace qt3dsimp;
-
-// Disable mesh optimization. TODO: After removing NvTriStrip need
-// to implement mesh optimization.
-//#define DISABLE_MESH_OPTIMIZATION 1
-
-// It turns out we can't enable vertex remapping because it would break
-// mesh morphing.
-#define DISABLE_VERTEX_REMAP 1
-
-namespace {
-template <typename TDataType>
-NVConstDataRef<TDataType> toRefBuf(QT3DSU8 *bufData, QT3DSU32 off, QT3DSU32 size)
-{
- QT3DS_ASSERT(size % sizeof(TDataType) == 0);
- if (size)
- return NVConstDataRef<TDataType>((TDataType *)(bufData + off), size / sizeof(TDataType));
- return NVConstDataRef<TDataType>();
-}
-struct DynamicVBuf
-{
- QT3DSU32 m_Stride;
- ImportArray<NVRenderVertexBufferEntry> m_VertexBufferEntries;
- MemoryBuffer<RawAllocator> m_VertexData;
-
- void clear()
- {
- m_Stride = 0;
- m_VertexBufferEntries.clear();
- m_VertexData.clear();
- }
-};
-struct DynamicIndexBuf
-{
- NVRenderComponentTypes::Enum m_CompType;
- MemoryBuffer<RawAllocator> m_IndexData;
- DynamicIndexBuf() {}
-
- void clear() { m_IndexData.clear(); }
-};
-
-struct SubsetDesc
-{
- QT3DSU32 m_Count;
- QT3DSU32 m_Offset;
-
- NVBounds3 m_Bounds;
- QString m_Name;
- SubsetDesc(QT3DSU32 c, QT3DSU32 off)
- : m_Count(c)
- , m_Offset(off)
- {
- }
- SubsetDesc()
- : m_Count(0)
- , m_Offset(0)
- {
- }
-};
-
-QT3DSU32 GetAlignedOffset(QT3DSU32 offset, QT3DSU32 align)
-{
- QT3DSU32 leftover = offset % align;
- if (leftover)
- return offset + (align - leftover);
- return offset;
-}
-
-class MeshBuilderImpl : public MeshBuilder
-{
- DynamicVBuf m_VertexBuffer;
- DynamicIndexBuf m_IndexBuffer;
- ImportArray<Joint> m_Joints;
- ImportArray<SubsetDesc> m_MeshSubsetDescs;
- NVRenderDrawMode::Enum m_DrawMode;
- NVRenderWinding::Enum m_Winding;
- MemoryBuffer<RawAllocator> m_RemappedVertexData;
- MemoryBuffer<RawAllocator> m_NewIndexBuffer;
- ImportArray<QT3DSU8> m_MeshBuffer;
-
-public:
- MeshBuilderImpl() { Reset(); }
- virtual ~MeshBuilderImpl() { Reset(); }
- void Release() override { delete this; }
- void Reset() override
- {
- m_VertexBuffer.clear();
- m_IndexBuffer.clear();
- m_Joints.clear();
- m_MeshSubsetDescs.clear();
- m_DrawMode = NVRenderDrawMode::Triangles;
- m_Winding = NVRenderWinding::CounterClockwise;
- m_MeshBuffer.clear();
- }
-
- void SetDrawParameters(NVRenderDrawMode::Enum drawMode, NVRenderWinding::Enum winding) override
- {
- m_DrawMode = drawMode;
- m_Winding = winding;
- }
-
- // Somewhat burly method to interleave the data as tightly as possible
- // while taking alignment into account.
- bool SetVertexBuffer(NVConstDataRef<MeshBuilderVBufEntry> entries) override
- {
- QT3DSU32 currentOffset = 0;
- QT3DSU32 bufferAlignment = 0;
- QT3DSU32 numItems = 0;
- bool retval = true;
- QT3DSIMP_FOREACH(idx, entries.size())
- {
- const MeshBuilderVBufEntry &entry(entries[idx]);
- // Ignore entries with no data.
- if (entry.m_Data.begin() == NULL || entry.m_Data.size() == 0)
- continue;
-
- QT3DSU32 alignment = NVRenderComponentTypes::getSizeofType(entry.m_ComponentType);
- bufferAlignment = qMax(bufferAlignment, alignment);
- QT3DSU32 byteSize = alignment * entry.m_NumComponents;
-
- if (entry.m_Data.size() % alignment != 0) {
- QT3DS_ASSERT(false);
- retval = false;
- }
-
- QT3DSU32 localNumItems = entry.m_Data.size() / byteSize;
- if (numItems == 0) {
- numItems = localNumItems;
- } else if (numItems != localNumItems) {
- QT3DS_ASSERT(false);
- retval = false;
- numItems = qMin(numItems, localNumItems);
- }
- // Lots of platforms can't handle non-aligned data.
- // so ensure we are aligned.
- currentOffset = GetAlignedOffset(currentOffset, alignment);
- NVRenderVertexBufferEntry vbufEntry(entry.m_Name, entry.m_ComponentType,
- entry.m_NumComponents, currentOffset);
- m_VertexBuffer.m_VertexBufferEntries.push_back(vbufEntry);
- currentOffset += byteSize;
- }
- m_VertexBuffer.m_Stride = GetAlignedOffset(currentOffset, bufferAlignment);
-
- // Packed interleave the data
- QT3DSIMP_FOREACH(idx, numItems)
- {
- QT3DSU32 dataOffset = 0;
- QT3DSIMP_FOREACH(entryIdx, entries.size())
- {
- const MeshBuilderVBufEntry &entry(entries[entryIdx]);
- // Ignore entries with no data.
- if (entry.m_Data.begin() == NULL || entry.m_Data.size() == 0)
- continue;
-
- QT3DSU32 alignment = NVRenderComponentTypes::getSizeofType(entry.m_ComponentType);
- QT3DSU32 byteSize = alignment * entry.m_NumComponents;
- QT3DSU32 offset = byteSize * idx;
- QT3DSU32 newOffset = GetAlignedOffset(dataOffset, alignment);
- if (newOffset != dataOffset)
- m_VertexBuffer.m_VertexData.writeZeros(newOffset - dataOffset);
- m_VertexBuffer.m_VertexData.write(entry.m_Data.begin() + offset, byteSize);
- dataOffset = newOffset + byteSize;
- }
- QT3DS_ASSERT(dataOffset == m_VertexBuffer.m_Stride);
- }
- return retval;
- }
-
- void SetVertexBuffer(NVConstDataRef<NVRenderVertexBufferEntry> entries, QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> data) override
- {
- QT3DSIMP_FOREACH(idx, (QT3DSU32)entries.size())
- {
- m_VertexBuffer.m_VertexBufferEntries.push_back(entries[idx]);
- }
- m_VertexBuffer.m_VertexData.write(data.begin(), data.size());
- if (stride == 0) {
- // Calculate the stride of the buffer using the vbuf entries
- QT3DSIMP_FOREACH(idx, entries.size())
- {
- const NVRenderVertexBufferEntry &entry(entries[idx]);
- stride = qMax(stride, entry.m_FirstItemOffset
- + (entry.m_NumComponents * NVRenderComponentTypes::getSizeofType(
- entry.m_ComponentType)));
- }
- }
- m_VertexBuffer.m_Stride = stride;
- }
-
- void SetIndexBuffer(NVConstDataRef<QT3DSU8> data, NVRenderComponentTypes::Enum comp) override
- {
- m_IndexBuffer.m_CompType = comp;
- m_IndexBuffer.m_IndexData.write(data.begin(), data.size());
- }
-
- void AddJoint(QT3DSI32 jointID, QT3DSI32 parentID, const QT3DSF32 *invBindPose,
- const QT3DSF32 *localToGlobalBoneSpace) override
- {
- m_Joints.push_back(Joint(jointID, parentID, invBindPose, localToGlobalBoneSpace));
- }
-
- SubsetDesc CreateSubset(const wchar_t *inName, QT3DSU32 count, QT3DSU32 offset)
- {
- if (inName == NULL)
- inName = L"";
- SubsetDesc retval(count, offset);
- retval.m_Name = QString::fromWCharArray(inName);
- return retval;
- }
-
- // indexBuffer QT3DS_MAX_U32 means no index buffer.
- // count of QT3DS_MAX_U32 means use all available items
- // offset means exactly what you would think. Offset is in item size, not bytes.
- void AddMeshSubset(const wchar_t *inName, QT3DSU32 count, QT3DSU32 offset,
- QT3DSU32 boundsPositionEntryIndex) override
- {
- SubsetDesc retval = CreateSubset(inName, count, offset);
- if (boundsPositionEntryIndex != QT3DS_MAX_U32) {
- retval.m_Bounds = Mesh::CalculateSubsetBounds(
- m_VertexBuffer.m_VertexBufferEntries[boundsPositionEntryIndex],
- m_VertexBuffer.m_VertexData, m_VertexBuffer.m_Stride, m_IndexBuffer.m_IndexData,
- m_IndexBuffer.m_CompType, count, offset);
- }
- m_MeshSubsetDescs.push_back(retval);
- }
-
- void AddMeshSubset(const wchar_t *inName, QT3DSU32 count, QT3DSU32 offset,
- const NVBounds3 &inBounds) override
- {
- SubsetDesc retval = CreateSubset(inName, count, offset);
- retval.m_Bounds = inBounds;
- m_MeshSubsetDescs.push_back(retval);
- }
-#ifndef DISABLE_MESH_OPTIMIZATION
- void DeletePrimitiveGroup(PrimitiveGroup *&inGroup)
- {
- if (inGroup)
- delete[] inGroup;
- inGroup = NULL;
- }
-#endif
- // We connect sub meshes which habe the same material
- void ConnectSubMeshes() override
- {
- if (m_MeshSubsetDescs.size() < 2) {
- // nothing to do
- return;
- }
-
- QT3DSU32 matDuplicates = 0;
-
- // as a pre-step we check if we have duplicate material at all
- for (QT3DSU32 i = 0, subsetEnd = m_MeshSubsetDescs.size(); i < subsetEnd && !matDuplicates;
- ++i) {
- SubsetDesc &currentSubset = m_MeshSubsetDescs[i];
-
- for (QT3DSU32 j = 0, subsetEnd = m_MeshSubsetDescs.size(); j < subsetEnd; ++j) {
- SubsetDesc &theSubset = m_MeshSubsetDescs[j];
-
- if (i == j)
- continue;
-
- if (currentSubset.m_Name == theSubset.m_Name) {
- matDuplicates++;
- break; // found a duplicate bail out
- }
- }
- }
-
- // did we find some duplicates?
- if (matDuplicates) {
- ImportArray<SubsetDesc> newMeshSubsetDescs;
- ImportArray<SubsetDesc>::iterator theIter;
- QString curMatName;
- m_NewIndexBuffer.clear();
-
- for (theIter = m_MeshSubsetDescs.begin(); theIter != m_MeshSubsetDescs.end();
- ++theIter) {
- bool bProcessed = false;
-
- for (ImportArray<SubsetDesc>::iterator iter = newMeshSubsetDescs.begin();
- iter != newMeshSubsetDescs.end(); ++iter) {
- if (theIter->m_Name == iter->m_Name) {
- bProcessed = true;
- break;
- }
- }
-
- if (bProcessed)
- continue;
-
- curMatName = theIter->m_Name;
-
- QT3DSU32 theIndexCompSize =
- NVRenderComponentTypes::getSizeofType(m_IndexBuffer.m_CompType);
- // get pointer to indices
- QT3DSU8 *theIndices =
- (m_IndexBuffer.m_IndexData.begin()) + (theIter->m_Offset * theIndexCompSize);
- // write new offset
- theIter->m_Offset = m_NewIndexBuffer.size() / theIndexCompSize;
- // store indices
- m_NewIndexBuffer.write(theIndices, theIter->m_Count * theIndexCompSize);
-
- for (QT3DSU32 j = 0, subsetEnd = m_MeshSubsetDescs.size(); j < subsetEnd; ++j) {
- if (theIter == &m_MeshSubsetDescs[j])
- continue;
-
- SubsetDesc &theSubset = m_MeshSubsetDescs[j];
-
- if (curMatName == theSubset.m_Name) {
- // get pointer to indices
- QT3DSU8 *theIndices = (m_IndexBuffer.m_IndexData.begin())
- + (theSubset.m_Offset * theIndexCompSize);
- // store indices
- m_NewIndexBuffer.write(theIndices, theSubset.m_Count * theIndexCompSize);
- // increment indices count
- theIter->m_Count += theSubset.m_Count;
- }
- }
-
- newMeshSubsetDescs.push_back(*theIter);
- }
-
- m_MeshSubsetDescs.clear();
- m_MeshSubsetDescs = newMeshSubsetDescs;
- m_IndexBuffer.m_IndexData.clear();
- m_IndexBuffer.m_IndexData.write(m_NewIndexBuffer.begin(), m_NewIndexBuffer.size());
-
- // compute new bounding box
- for (theIter = m_MeshSubsetDescs.begin(); theIter != m_MeshSubsetDescs.end();
- ++theIter) {
- theIter->m_Bounds = Mesh::CalculateSubsetBounds(
- m_VertexBuffer.m_VertexBufferEntries[0], m_VertexBuffer.m_VertexData,
- m_VertexBuffer.m_Stride, m_IndexBuffer.m_IndexData, m_IndexBuffer.m_CompType,
- theIter->m_Count, theIter->m_Offset);
- }
- }
- }
-
- // Here is the NVTriStrip magic.
- void OptimizeMesh() override
- {
- if (NVRenderComponentTypes::getSizeofType(m_IndexBuffer.m_CompType) != 2) {
- // we currently re-arrange unsigned int indices.
- // this is because NvTriStrip only supports short indices
- QT3DS_ASSERT(NVRenderComponentTypes::getSizeofType(m_IndexBuffer.m_CompType) == 4);
- return;
- }
-#ifndef DISABLE_MESH_OPTIMIZATION
- SetCacheSize(CACHESIZE_GEFORCE3);
- SetStitchStrips(true);
- SetMinStripSize(0);
- // Create the optimized list indices
- SetListsOnly(true);
- // Optimize the indices using NvTriStrip
-
- // First, nv-tri-strip all of the indexes. They shouldn't be interleaved, meaning
- // there is an assumption here that mesh subset1 doesn't uses indexes from mesh subset 2.
- // They may share vertexes, however, which means that we need to be careful when remapping
- // them.
- // Have to go subset by subset in order for the tri-strip to avoid stepping on subsets.
- m_NewIndexBuffer.clear();
- for (QT3DSU32 subsetIdx = 0, subsetEnd = m_MeshSubsetDescs.size(); subsetIdx < subsetEnd;
- ++subsetIdx) {
- SubsetDesc &theSubset = m_MeshSubsetDescs[subsetIdx];
- QT3DSU16 *theIndices =
- reinterpret_cast<QT3DSU16 *>(m_IndexBuffer.m_IndexData.begin()) + theSubset.m_Offset;
- QT3DSU32 theIndexCount = theSubset.m_Count;
- QT3DSU16 theNumGroups = 0;
- PrimitiveGroup *thePrimitiveGroupsList = NULL;
- theSubset.m_Offset = m_NewIndexBuffer.size() / sizeof(QT3DSU16);
- theSubset.m_Count = 0;
-
- // We don't support larger vertex buffers. That requires splitting the buffer,
- // an operation we haven't implemented (yet).
- if (GenerateStrips(theIndices, theIndexCount, &thePrimitiveGroupsList, &theNumGroups)) {
- if (theNumGroups) {
- QT3DS_ASSERT(theNumGroups == 1);
- PrimitiveGroup &srcGroup(thePrimitiveGroupsList[0]);
- QT3DS_ASSERT(srcGroup.type == PT_LIST);
- m_NewIndexBuffer.write(srcGroup.indices, srcGroup.numIndices);
- theSubset.m_Count = srcGroup.numIndices;
- }
- }
-
- DeletePrimitiveGroup(thePrimitiveGroupsList);
- }
- m_IndexBuffer.m_IndexData.clear();
- m_IndexBuffer.m_IndexData.write(m_NewIndexBuffer.begin(), m_NewIndexBuffer.size());
-
-#ifndef DISABLE_VERTEX_REMAP
- // This operation does not go subset by subset
- // by rather remaps the entire vertex buffer in one shot
- // once all of the index buffers are setup.
- QT3DSU16 *theIndices = reinterpret_cast<QT3DSU16 *>(m_IndexBuffer.m_IndexData.begin());
- QT3DSU32 theIndexCount = m_IndexBuffer.m_IndexData.size() / sizeof(QT3DSU16);
-
- // Setup input to the remap system
- QT3DSU16 theNumGroups = 1;
- PrimitiveGroup thePrimitiveGroup;
- thePrimitiveGroup.type = PT_LIST;
- thePrimitiveGroup.numIndices = theIndexCount;
- thePrimitiveGroup.indices = new QT3DSU16[theIndexCount];
- memCopy(thePrimitiveGroup.indices, theIndices, theIndexCount * sizeof(QT3DSU16));
-
- PrimitiveGroup *theRemappedGroup = NULL;
- QT3DSU32 vertBufByteSize = m_VertexBuffer.m_VertexData.size();
- QT3DSU32 numVertexIndices = vertBufByteSize / m_VertexBuffer.m_Stride;
- QT3DS_ASSERT(numVertexIndices < QT3DS_MAX_U16);
- QT3DSU32 vertBufStride = m_VertexBuffer.m_Stride;
- // This remaps the vertexes
- RemapIndices(&thePrimitiveGroup, theNumGroups, static_cast<QT3DSU16>(numVertexIndices),
- &theRemappedGroup);
- m_RemappedVertexData.reserve(vertBufByteSize);
- const QT3DSU8 *srcVertexPtr(m_VertexBuffer.m_VertexData.begin());
- QT3DSU8 *dstVertexPtr(m_RemappedVertexData.begin());
- QT3DS_ASSERT(theNumGroups == 1);
- for (QT3DSU32 theGroupIdx = 0; theGroupIdx < 1; ++theGroupIdx) {
- PrimitiveGroup &srcGroup(thePrimitiveGroup);
- PrimitiveGroup &dstGroup(theRemappedGroup[theGroupIdx]);
- QT3DS_ASSERT(srcGroup.type == PT_LIST);
-
- for (QT3DSU32 theIndexIdx = 0; theIndexIdx < srcGroup.numIndices; ++theIndexIdx) {
- QT3DSU16 srcIndex = srcGroup.indices[theIndexIdx];
- QT3DSU16 dstIndex = dstGroup.indices[theIndexIdx];
- QT3DS_ASSERT(dstIndex * m_VertexBuffer.m_Stride < vertBufByteSize);
- QT3DS_ASSERT(srcIndex * m_VertexBuffer.m_Stride < vertBufByteSize);
- // Maybe add in a check to see if we possibly already copied this information
- // That would of course be only an optimization.
- memCopy(dstVertexPtr + dstIndex * vertBufStride,
- srcVertexPtr + srcIndex * vertBufStride, vertBufStride);
- theIndices[theIndexIdx] = dstIndex;
- }
- memCopy(m_VertexBuffer.m_VertexData.begin(), m_RemappedVertexData.begin(),
- vertBufByteSize);
- }
-
- DeletePrimitiveGroup(theRemappedGroup);
-#endif // DISABLE_VERTEX_REMAP
-#endif // DISABLE_MESH_OPTIMIZATION
- }
-
- template <typename TDataType>
- static void Assign(QT3DSU8 *inBaseAddress, QT3DSU8 *inDataAddress,
- SOffsetDataRef<TDataType> &inBuffer, const TDataType *inDestData,
- QT3DSU32 inDestSize)
- {
- inBuffer.m_Offset = (QT3DSU32)(inDataAddress - inBaseAddress);
- inBuffer.m_Size = inDestSize;
- memCopy(inDataAddress, inDestData, inDestSize * sizeof(TDataType));
- }
- template <typename TDataType>
- static void Assign(QT3DSU8 *inBaseAddress, QT3DSU8 *inDataAddress,
- SOffsetDataRef<TDataType> &inBuffer, QT3DSU32 inDestSize)
- {
- inBuffer.m_Offset = (QT3DSU32)(inDataAddress - inBaseAddress);
- inBuffer.m_Size = inDestSize;
- }
- // Return the current mesh. This is only good for this function call, item may change or be
- // released
- // due to any further function calls.
- Mesh &GetMesh() override
- {
- QT3DSU32 meshSize = sizeof(Mesh);
- QT3DSU32 alignment = sizeof(void *);
- QT3DSU32 vertDataSize = GetAlignedOffset(m_VertexBuffer.m_VertexData.size(), alignment);
- meshSize += vertDataSize;
- QT3DSU32 entrySize = m_VertexBuffer.m_VertexBufferEntries.size()
- * sizeof(qt3ds::render::NVRenderVertexBufferEntry);
- meshSize += entrySize;
- QT3DSU32 entryNameSize = 0;
- for (QT3DSU32 idx = 0, end = m_VertexBuffer.m_VertexBufferEntries.size(); idx < end; ++idx) {
- const qt3ds::render::NVRenderVertexBufferEntry &theEntry(
- m_VertexBuffer.m_VertexBufferEntries[idx]);
- const char *entryName = theEntry.m_Name;
- if (entryName == NULL)
- entryName = "";
- entryNameSize += (QT3DSU32)(strlen(theEntry.m_Name)) + 1;
- }
- entryNameSize = GetAlignedOffset(entryNameSize, alignment);
- meshSize += entryNameSize;
- QT3DSU32 indexBufferSize = GetAlignedOffset(m_IndexBuffer.m_IndexData.size(), alignment);
- meshSize += indexBufferSize;
- QT3DSU32 subsetSize = m_MeshSubsetDescs.size() * sizeof(MeshSubset);
- QT3DSU32 nameSize = 0;
- for (QT3DSU32 idx = 0, end = m_MeshSubsetDescs.size(); idx < end; ++idx) {
- if (!m_MeshSubsetDescs[idx].m_Name.isEmpty())
- nameSize += m_MeshSubsetDescs[idx].m_Name.size() + 1;
- }
- nameSize *= sizeof(char16_t);
- nameSize = GetAlignedOffset(nameSize, alignment);
-
- meshSize += subsetSize + nameSize;
- QT3DSU32 jointsSize = m_Joints.size() * sizeof(qt3dsimp::Joint);
- meshSize += jointsSize;
- m_MeshBuffer.resize(meshSize);
- QT3DSU8 *baseAddress = m_MeshBuffer.data();
- Mesh *retval = reinterpret_cast<Mesh *>(baseAddress);
- retval->m_DrawMode = m_DrawMode;
- retval->m_Winding = m_Winding;
- QT3DSU8 *vertBufferData = baseAddress + sizeof(Mesh);
- QT3DSU8 *vertEntryData = vertBufferData + vertDataSize;
- QT3DSU8 *vertEntryNameData = vertEntryData + entrySize;
- QT3DSU8 *indexBufferData = vertEntryNameData + entryNameSize;
- QT3DSU8 *subsetBufferData = indexBufferData + indexBufferSize;
- QT3DSU8 *nameBufferData = subsetBufferData + subsetSize;
- QT3DSU8 *jointBufferData = nameBufferData + nameSize;
-
- retval->m_VertexBuffer.m_Stride = m_VertexBuffer.m_Stride;
- Assign(baseAddress, vertBufferData, retval->m_VertexBuffer.m_Data,
- m_VertexBuffer.m_VertexData.begin(), m_VertexBuffer.m_VertexData.size());
- retval->m_VertexBuffer.m_Entries.m_Size = m_VertexBuffer.m_VertexBufferEntries.size();
- retval->m_VertexBuffer.m_Entries.m_Offset = (QT3DSU32)(vertEntryData - baseAddress);
- for (QT3DSU32 idx = 0, end = m_VertexBuffer.m_VertexBufferEntries.size(); idx < end; ++idx) {
- const qt3ds::render::NVRenderVertexBufferEntry &theEntry(
- m_VertexBuffer.m_VertexBufferEntries[idx]);
- MeshVertexBufferEntry &theDestEntry(
- retval->m_VertexBuffer.m_Entries.index(baseAddress, idx));
- theDestEntry.m_ComponentType = theEntry.m_ComponentType;
- theDestEntry.m_FirstItemOffset = theEntry.m_FirstItemOffset;
- theDestEntry.m_NumComponents = theEntry.m_NumComponents;
- const char *targetName = theEntry.m_Name;
- if (targetName == NULL)
- targetName = "";
-
- QT3DSU32 entryNameLen = (QT3DSU32)(strlen(targetName)) + 1;
- theDestEntry.m_NameOffset = (QT3DSU32)(vertEntryNameData - baseAddress);
- memCopy(vertEntryNameData, theEntry.m_Name, entryNameLen);
- vertEntryNameData += entryNameLen;
- }
-
- retval->m_IndexBuffer.m_ComponentType = m_IndexBuffer.m_CompType;
- Assign(baseAddress, indexBufferData, retval->m_IndexBuffer.m_Data,
- m_IndexBuffer.m_IndexData.begin(), m_IndexBuffer.m_IndexData.size());
- Assign(baseAddress, subsetBufferData, retval->m_Subsets, m_MeshSubsetDescs.size());
- for (QT3DSU32 idx = 0, end = m_MeshSubsetDescs.size(); idx < end; ++idx) {
- SubsetDesc &theDesc = m_MeshSubsetDescs[idx];
- MeshSubset &theSubset = reinterpret_cast<MeshSubset *>(subsetBufferData)[idx];
- theSubset.m_Bounds = theDesc.m_Bounds;
- theSubset.m_Count = theDesc.m_Count;
- theSubset.m_Offset = theDesc.m_Offset;
- if (!theDesc.m_Name.isEmpty()) {
- theSubset.m_Name.m_Size = theDesc.m_Name.size() + 1;
- theSubset.m_Name.m_Offset = (QT3DSU32)(nameBufferData - baseAddress);
- std::transform(theDesc.m_Name.begin(), theDesc.m_Name.end(),
- reinterpret_cast<char16_t *>(nameBufferData),
- [](QChar c) { return static_cast<char16_t>(c.unicode()); });
- reinterpret_cast<char16_t *>(nameBufferData)[theDesc.m_Name.size()] = 0;
- nameBufferData += (theDesc.m_Name.size() + 1) * sizeof(char16_t);
- } else {
- theSubset.m_Name.m_Size = 0;
- theSubset.m_Name.m_Offset = 0;
- }
- }
- Assign(baseAddress, jointBufferData, retval->m_Joints, m_Joints.data(), m_Joints.size());
- return *retval;
- }
-};
-}
-
-// Uses new/delete.
-MeshBuilder &MeshBuilder::CreateMeshBuilder()
-{
- return *(new MeshBuilderImpl());
-}
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.cpp b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.cpp
deleted file mode 100644
index 3523ef59..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSImportLibPrecompile.h"
-#include "Qt3DSImportPath.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-
-using namespace qt3dsimp;
-
-void SPathBuffer::Save(IOutStream &outStream) const
-{
- outStream.Write(GetFileTag());
- outStream.Write(GetFileVersion());
- outStream.Write((QT3DSU32)m_Commands.size());
- outStream.Write((QT3DSU32)m_Data.size());
- outStream.Write(toU8ConstDataRef((PathCommand::Enum *)m_Commands.begin(), m_Commands.size()));
- outStream.Write(toU8ConstDataRef((QT3DSF32 *)m_Data.begin(), m_Data.size()));
-}
-
-SPathBuffer *SPathBuffer::Load(IInStream &inStream, NVFoundationBase &inFoundation)
-{
- QT3DSU64 fileTag;
- QT3DSU32 version, numCommands, numData;
- inStream.Read(fileTag);
- inStream.Read(version);
- inStream.Read(numCommands);
- inStream.Read(numData);
- if (fileTag != GetFileTag()) {
- qCCritical(INVALID_OPERATION, "Invalid file, not a path file");
- return NULL;
- }
- if (version > GetFileVersion()) {
- qCCritical(INVALID_OPERATION, "Version number out of range.");
- return NULL;
- }
- QT3DSU32 commandSize = numCommands * sizeof(QT3DSU32);
- QT3DSU32 dataSize = numData * sizeof(QT3DSF32);
- QT3DSU32 objectSize = sizeof(SPathBuffer);
- QT3DSU32 allocSize = objectSize + commandSize + dataSize;
- QT3DSU8 *rawData =
- (QT3DSU8 *)inFoundation.getAllocator().allocate(allocSize, "SPathBuffer", __FILE__, __LINE__);
- SPathBuffer *retval = new (rawData) SPathBuffer();
- QT3DSU8 *commandBuffer = rawData + sizeof(SPathBuffer);
- QT3DSU8 *dataBuffer = commandBuffer + commandSize;
- inStream.Read(commandBuffer, commandSize);
- inStream.Read(dataBuffer, dataSize);
- retval->m_Commands = toDataRef((PathCommand::Enum *)commandBuffer, numCommands);
- retval->m_Data = toDataRef((QT3DSF32 *)dataBuffer, numData);
- return retval;
-}
-
-void SPathBuffer::Free(NVAllocatorCallback &inAllocator)
-{
- inAllocator.deallocate(this);
-}
-
-namespace {
-struct SBuilder : public IPathBufferBuilder
-{
- NVFoundationBase &m_Foundation;
- nvvector<PathCommand::Enum> m_Commands;
- nvvector<QT3DSF32> m_Data;
- QT3DSI32 m_RefCount;
-
- SBuilder(NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , m_Commands(inFoundation.getAllocator(), "m_Commands")
- , m_Data(inFoundation.getAllocator(), "m_Data")
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
-
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &theAlloc(m_Foundation.getAllocator());
- NVDelete(theAlloc, this);
- }
- }
-
- void Clear() override
- {
- m_Commands.clear();
- m_Data.clear();
- }
-
- void Push(const QT3DSVec2 inPos)
- {
- m_Data.push_back(inPos.x);
- m_Data.push_back(inPos.y);
- }
-
- void MoveTo(const QT3DSVec2 &inPos) override
- {
- m_Commands.push_back(PathCommand::MoveTo);
- Push(inPos);
- }
-
- void CubicCurveTo(const QT3DSVec2 &inC1, const QT3DSVec2 &inC2, const QT3DSVec2 &inP2) override
- {
- m_Commands.push_back(PathCommand::CubicCurveTo);
- Push(inC1);
- Push(inC2);
- Push(inP2);
- }
-
- void Close() override { m_Commands.push_back(PathCommand::Close); }
-
- // Points back to internal data structures, must use or copy.
- SPathBuffer GetPathBuffer() override
- {
- SPathBuffer retval;
- retval.m_Data = m_Data;
- retval.m_Commands = m_Commands;
- return retval;
- }
-};
-}
-
-IPathBufferBuilder &IPathBufferBuilder::CreateBuilder(NVFoundationBase &inFoundation)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), SBuilder)(inFoundation);
-}
diff --git a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.h b/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.h
deleted file mode 100644
index 3b52c8ce..00000000
--- a/src/Runtime/ogl-runtime/src/importlib/Qt3DSImportPath.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_IMPORT_PATH_H
-#define QT3DS_IMPORT_PATH_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSVec2.h"
-
-namespace qt3dsimp {
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::render;
-struct PathCommand
-{
- enum Enum {
- Noner = 0,
- MoveTo, // 2 floats
- CubicCurveTo, // 6 floats, c1, c2, p2. p1 is existing location
- Close, // 0 floats
- };
-};
-
-struct SPathBuffer
-{
- // 64 bit random number to uniquely identify this file type.
- static QT3DSU64 GetFileTag() { return 0x7b1a41633c43a6afULL; }
- static QT3DSU32 GetFileVersion() { return 1; }
- NVConstDataRef<PathCommand::Enum> m_Commands;
- NVConstDataRef<QT3DSF32> m_Data;
- SPathBuffer() {}
- void Save(IOutStream &outStream) const;
- static SPathBuffer *Load(IInStream &inStream, NVFoundationBase &inFoundation);
-
- // Object is unused after this call. Anything created with Load must use this function.
- void Free(NVAllocatorCallback &inAllocator);
- SPathBuffer *Copy(NVAllocatorCallback &inAllocator) const;
-};
-
-class IPathBufferBuilder : public NVRefCounted
-{
-public:
- virtual void Clear() = 0;
-
- virtual void MoveTo(const QT3DSVec2 &inPos) = 0;
- virtual void CubicCurveTo(const QT3DSVec2 &inC1, const QT3DSVec2 &inC2, const QT3DSVec2 &inP2) = 0;
- virtual void Close() = 0;
- // Points back to internal data structures, must use or copy.
- virtual SPathBuffer GetPathBuffer() = 0;
-
- static IPathBufferBuilder &CreateBuilder(NVFoundationBase &inFoundation);
-};
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/ogl-runtime-dylib/ogl-runtime-dylib.pro b/src/Runtime/ogl-runtime/src/ogl-runtime-dylib/ogl-runtime-dylib.pro
deleted file mode 100644
index 48929cfc..00000000
--- a/src/Runtime/ogl-runtime/src/ogl-runtime-dylib/ogl-runtime-dylib.pro
+++ /dev/null
@@ -1,73 +0,0 @@
-TEMPLATE = lib
-TARGET = qt3dsopengl
-VERSION = $$MODULE_VERSION
-
-DEFINES += QT3DS_RUNTIME_EXPORTS
-
-CONFIG += installed
-include(../commoninclude.pri)
-QT += qml
-
-boot2qt: {
- RESOURCES += ../../res.qrc
- DEFINES += EMBEDDED_LINUX # TODO: Is there a compile-time flag for boot2qt?
-}
-
-integrity|ios {
- RESOURCES += ../../res.qrc
-}
-
-SOURCES += \
- ../viewer/Qt3DSAudioPlayerImpl.cpp \
- ../viewer/Qt3DSViewerApp.cpp
-
-HEADERS += \
- ../viewer/qt3dsruntimeglobal.h \
- ../viewer/Qt3DSAudioPlayerImpl.h \
- ../viewer/Qt3DSViewerApp.h \
- ../viewer/Qt3DSViewerTimer.h
-
-linux|qnx|mingw {
- BEGIN_ARCHIVE = -Wl,--whole-archive
- END_ARCHIVE = -Wl,--no-whole-archive
-}
-
-STATICRUNTIME = \
- $$BEGIN_ARCHIVE \
- -lqt3dsruntimestatic$$qtPlatformTargetSuffix() \
- -lEASTL$$qtPlatformTargetSuffix() \
- $$END_ARCHIVE
-
-# On non-windows systems link the whole static archives and do not put them
-# in the prl file to prevent them being linked again by targets that depend
-# upon this shared library
-!win32:!CONFIG(static){
- QMAKE_LFLAGS += $$STATICRUNTIME
- LIBS += -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
-} else {
- LIBS += \
- $$STATICRUNTIME \
- -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
-}
-
-win32 {
- LIBS += \
- -lws2_32
-
- RESOURCES += ../../platformres.qrc
-}
-
-linux {
- LIBS += \
- -ldl \
- -lEGL
-}
-
-macos {
- QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
-}
-
-PREDEPS_LIBS = qt3dsruntimestatic
-
-include(../../utils.pri)
-PRE_TARGETDEPS += $$fixLibPredeps($$LIBDIR, PREDEPS_LIBS)
diff --git a/src/Runtime/ogl-runtime/src/ogl-runtime-static/ogl-runtime-static.pro b/src/Runtime/ogl-runtime/src/ogl-runtime-static/ogl-runtime-static.pro
deleted file mode 100644
index 8b2c95a4..00000000
--- a/src/Runtime/ogl-runtime/src/ogl-runtime-static/ogl-runtime-static.pro
+++ /dev/null
@@ -1,656 +0,0 @@
-TEMPLATE = lib
-TARGET = qt3dsruntimestatic
-CONFIG += staticlib
-include(../commoninclude.pri)
-
-!boot2qt:!integrity:!ios {
- RESOURCES += ../../res.qrc
-}
-
-linux {
- DEFINES += _POSIX_C_SOURCE=199309L
- QMAKE_LFLAGS += -lrt
-}
-
-DEFINES += QT3DS_BUILDING_LIBRARY DISABLE_MESH_OPTIMIZATION
-
-QT += qml
-QT += quick-private
-
-# Foundation
-SOURCES += \
- ../foundation/ConvertUTF.cpp \
- ../foundation/EASTL_new.cpp \
- ../foundation/FileTools.cpp \
- ../foundation/IOStreams.cpp \
- ../foundation/Qt3DSLogging.cpp \
- ../foundation/Qt3DSFoundation.cpp \
- ../foundation/Qt3DSMathUtils.cpp \
- ../foundation/Qt3DSPerfTimer.cpp \
- ../foundation/Qt3DSSystem.cpp \
- ../foundation/Socket.cpp \
- ../foundation/StringTable.cpp \
- ../foundation/XML.cpp \
- ../foundation/TrackingAllocator.cpp \
- ../runtimerender/q3dsqmlrender.cpp \
- ../engine/Qt3DSRenderRuntimeBinding.cpp \
- ../engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp \
- ../engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp \
- ../engine/Qt3DSTegraInputEngine.cpp \
- ../runtime/Qt3DSActivationManager.cpp \
- ../runtime/Qt3DSAnimationSystem.cpp \
- ../runtime/Qt3DSApplication.cpp \
- ../runtime/Qt3DSAttributeHashes.cpp \
- ../runtime/Qt3DSComponentManager.cpp \
- ../runtime/Qt3DSElementSystem.cpp \
- ../runtime/Qt3DSEventCallbacks.cpp \
- ../runtime/Qt3DSInputEngine.cpp \
- ../runtime/Qt3DSLogicSystem.cpp \
- ../runtime/Qt3DSCommandHelper.cpp \
- ../runtime/Qt3DSElementHelper.cpp \
- ../runtime/Qt3DSOutputMemoryStream.cpp \
- ../runtime/Qt3DSParametersSystem.cpp \
- ../runtime/Qt3DSPresentation.cpp \
- ../runtime/Qt3DSPresentationFrameData.cpp \
- ../runtime/Qt3DSQmlElementHelper.cpp \
- ../runtime/Qt3DSQmlEngine.cpp \
- ../runtime/Qt3DSSlideSystem.cpp \
- ../runtime/Qt3DSTimePolicy.cpp \
- ../runtime/q3dsvariantconfig.cpp \
- ../runtime/q3dsmaterialdefinitionparser.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderCamera.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderDynamicObject.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderEffect.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderImage.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderLayer.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderLight.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderLightmaps.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderModel.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderNode.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderPath.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderPresentation.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderScene.cpp \
- ../runtimerender/graphobjects/Qt3DSRenderText.cpp \
- ../runtimerender/rendererimpl/Qt3DSRenderableObjects.cpp \
- ../runtimerender/rendererimpl/Qt3DSRendererImpl.cpp \
- ../runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp \
- ../runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.cpp \
- ../runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp \
- ../runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderBufferLoader.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureBMP.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureGIF.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureHDR.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderResourceManager.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.cpp \
- ../runtimerender/Qt3DSOffscreenRenderManager.cpp \
- ../runtimerender/Qt3DSOldNBustedRenderPlugin.cpp \
- ../runtimerender/Qt3DSOnscreenTextRenderer.cpp \
- ../runtimerender/Qt3DSQtTextRenderer.cpp \
- ../runtimerender/Qt3DSRenderClippingFrustum.cpp \
- ../runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.cpp \
- ../runtimerender/Qt3DSRenderCustomMaterialSystem.cpp \
- ../runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp \
- ../runtimerender/Qt3DSRenderDynamicObjectSystem.cpp \
- ../runtimerender/Qt3DSRenderEffectSystem.cpp \
- ../runtimerender/Qt3DSRendererUtil.cpp \
- ../runtimerender/Qt3DSRenderEulerAngles.cpp \
- ../runtimerender/Qt3DSRenderGpuProfiler.cpp \
- ../runtimerender/Qt3DSRenderGraphObjectSerializer.cpp \
- ../runtimerender/Qt3DSRenderImageScaler.cpp \
- ../runtimerender/Qt3DSRenderInputStreamFactory.cpp \
- ../runtimerender/Qt3DSRenderPathManager.cpp \
- ../runtimerender/Qt3DSRenderPixelGraphicsRenderer.cpp \
- ../runtimerender/Qt3DSRenderPixelGraphicsTypes.cpp \
- ../runtimerender/Qt3DSRenderPlugin.cpp \
- ../runtimerender/Qt3DSRenderRay.cpp \
- ../runtimerender/Qt3DSRenderRenderList.cpp \
- ../runtimerender/Qt3DSRenderShaderCache.cpp \
- ../runtimerender/Qt3DSRenderShaderCodeGenerator.cpp \
- ../runtimerender/Qt3DSRenderShaderCodeGeneratorV2.cpp \
- ../runtimerender/Qt3DSRenderShadowMap.cpp \
- ../runtimerender/Qt3DSRenderSubpresentation.cpp \
- ../runtimerender/Qt3DSRenderTextTextureAtlas.cpp \
- ../runtimerender/Qt3DSRenderTextTextureCache.cpp \
- ../runtimerender/Qt3DSRenderTextureAtlas.cpp \
- ../runtimerender/Qt3DSRenderThreadPool.cpp \
- ../runtimerender/Qt3DSRenderUIPLoader.cpp \
- ../runtimerender/Qt3DSRenderUIPSharedTranslation.cpp \
- ../runtimerender/Qt3DSRenderWidgets.cpp \
- ../runtimerender/Qt3DSTextRenderer.cpp \
- ../system/Qt3DSAssert.cpp \
- ../system/Qt3DSBoundingBox.cpp \
- ../system/Qt3DSColor.cpp \
- ../system/Qt3DSCubicRoots.cpp \
- ../system/Qt3DSDataLogger.cpp \
- ../system/Qt3DSDLLManager.cpp \
- ../system/Qt3DSEulerAngles.cpp \
- ../system/Qt3DSFile.cpp \
- ../system/Qt3DSFileStream.cpp \
- ../system/Qt3DSFunctionWrappers.cpp \
- ../system/Qt3DSMatrix.cpp \
- ../system/Qt3DSMemory.cpp \
- ../system/Qt3DSMemoryFilter.cpp \
- ../system/Qt3DSMemoryHeap.cpp \
- ../system/Qt3DSMemoryManager.cpp \
- ../system/Qt3DSMemoryPool.cpp \
- ../system/Qt3DSMemoryProbe.cpp \
- ../system/Qt3DSMemoryStatistics.cpp \
- ../system/Qt3DSMemoryTracker.cpp \
- ../system/Qt3DSTimer.cpp \
- ../system/Qt3DSTypes.cpp \
- ../system/Qt3DSVector3.cpp \
- ../uipparser/Qt3DSUIPParserActionHelper.cpp \
- ../uipparser/Qt3DSUIPParserImpl.cpp \
- ../uipparser/Qt3DSUIPParserObjectRefHelper.cpp \
- ../runtimerender/Qt3DSRenderContextCore.cpp \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.cpp \
- ../runtimerender/Qt3DSDistanceFieldRenderer.cpp \
- ../runtimerender/Qt3DSFontDatabase.cpp \
- ../runtimerender/Qt3DSDistanceFieldGlyphCacheManager.cpp \
- ../runtimerender/Qt3DSDistanceFieldGlyphCache.cpp \
- ../engine/Qt3DSRuntimeView.cpp
-
-HEADERS += \
- ../foundation/ConvertUTF.h \
- ../foundation/FileTools.h \
- ../foundation/StringTools.h \
- ../foundation/IOStreams.h \
- ../foundation/Qt3DSLogging.h \
- ../foundation/Qt3DSFoundation.h \
- ../foundation/Qt3DSMathUtils.h \
- ../foundation/Qt3DSPerfTimer.h \
- ../foundation/Qt3DSSystem.h \
- ../foundation/Socket.h \
- ../foundation/StringTable.h \
- ../foundation/XML.h \
- ../foundation/AutoDeallocatorAllocator.h \
- ../foundation/FastAllocator.h \
- ../foundation/PoolingAllocator.h \
- ../foundation/PreAllocatedAllocator.h \
- ../foundation/Qt3DS.h \
- ../foundation/Qt3DSAllocator.h \
- ../foundation/Qt3DSAllocatorCallback.h \
- ../foundation/Qt3DSAssert.h \
- ../foundation/Qt3DSAtomic.h \
- ../foundation/Qt3DSBasicTemplates.h \
- ../foundation/Qt3DSBounds3.h \
- ../foundation/Qt3DSBroadcastingAllocator.h \
- ../foundation/Qt3DSContainers.h \
- ../foundation/Qt3DSDataRef.h \
- ../foundation/Qt3DSDiscriminatedUnion.h \
- ../foundation/Qt3DSFastIPC.h \
- ../foundation/Qt3DSFlags.h \
- ../foundation/Qt3DSFPU.h \
- ../foundation/Qt3DSIndexableLinkedList.h \
- ../foundation/Qt3DSIntrinsics.h \
- ../foundation/Qt3DSInvasiveLinkedList.h \
- ../foundation/Qt3DSInvasiveSet.h \
- ../foundation/Qt3DSIPC.h \
- ../foundation/Qt3DSMat33.h \
- ../foundation/Qt3DSMat44.h \
- ../foundation/Qt3DSMath.h \
- ../foundation/Qt3DSMemoryBuffer.h \
- ../foundation/Qt3DSMutex.h \
- ../foundation/Qt3DSNoCopy.h \
- ../foundation/Qt3DSOption.h \
- ../foundation/Qt3DSPlane.h \
- ../foundation/Qt3DSPool.h \
- ../foundation/Qt3DSPreprocessor.h \
- ../foundation/Qt3DSQuat.h \
- ../foundation/Qt3DSRefCounted.h \
- ../foundation/Qt3DSSemaphore.h \
- ../foundation/Qt3DSSimpleTypes.h \
- ../foundation/Qt3DSStringTokenizer.h \
- ../foundation/Qt3DSSync.h \
- ../foundation/Qt3DSThread.h \
- ../foundation/Qt3DSTime.h \
- ../foundation/Qt3DSTransform.h \
- ../foundation/Qt3DSUnionCast.h \
- ../foundation/Qt3DSUtilities.h \
- ../foundation/Qt3DSVec2.h \
- ../foundation/Qt3DSVec3.h \
- ../foundation/Qt3DSVec4.h \
- ../foundation/Qt3DSVersionNumber.h \
- ../foundation/SerializationTypes.h \
- ../foundation/StrConvertUTF.h \
- ../foundation/StringConversion.h \
- ../foundation/StringConversionImpl.h \
- ../foundation/TaggedPointer.h \
- ../foundation/ThreadSafeQueue.h \
- ../foundation/TrackingAllocator.h \
- ../foundation/Utils.h \
- ../runtimerender/q3dsqmlrender.h \
- ../engine/Qt3DSRenderRuntimeBinding.h \
- ../engine/Qt3DSRenderRuntimeBindingImpl.h \
- ../engine/Qt3DSTegraInputEngine.h \
- ../runtime/Qt3DSActivationManager.h \
- ../runtime/Qt3DSAnimationSystem.h \
- ../runtime/Qt3DSApplication.h \
- ../runtime/Qt3DSAttributeHashes.h \
- ../runtime/Qt3DSComponentManager.h \
- ../runtime/Qt3DSElementSystem.h \
- ../runtime/Qt3DSEventCallbacks.h \
- ../runtime/Qt3DSInputEngine.h \
- ../runtime/Qt3DSLogicSystem.h \
- ../runtime/Qt3DSCommandHelper.h \
- ../runtime/Qt3DSElementHelper.h \
- ../runtime/Qt3DSOutputMemoryStream.h \
- ../runtime/Qt3DSParametersSystem.h \
- ../runtime/Qt3DSPresentation.h \
- ../runtime/Qt3DSPresentationFrameData.h \
- ../runtime/Qt3DSQmlElementHelper.h \
- ../runtime/Qt3DSQmlEngine.h \
- ../runtime/Qt3DSSlideSystem.h \
- ../runtime/Qt3DSTimePolicy.h \
- ../runtime/Qt3DSApplicationValues.h \
- ../runtime/Qt3DSIComponentManager.h \
- ../runtime/Qt3DSIInputSystem.h \
- ../runtime/Qt3DSInputDefs.h \
- ../runtime/Qt3DSInputEventTypes.h \
- ../runtime/Qt3DSIStateful.h \
- ../runtime/Qt3DSIText.h \
- ../runtime/Qt3DSKernelTypes.h \
- ../runtime/q3dsvariantconfig_p.h \
- ../runtime/q3dsmaterialdefinitionparser.h \
- ../runtimerender/graphobjects/Qt3DSRenderCamera.h \
- ../runtimerender/graphobjects/Qt3DSRenderCustomMaterial.h \
- ../runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.h \
- ../runtimerender/graphobjects/Qt3DSRenderDynamicObject.h \
- ../runtimerender/graphobjects/Qt3DSRenderEffect.h \
- ../runtimerender/graphobjects/Qt3DSRenderGraphObject.h \
- ../runtimerender/graphobjects/Qt3DSRenderImage.h \
- ../runtimerender/graphobjects/Qt3DSRenderLayer.h \
- ../runtimerender/graphobjects/Qt3DSRenderLight.h \
- ../runtimerender/graphobjects/Qt3DSRenderLightmaps.h \
- ../runtimerender/graphobjects/Qt3DSRenderMaterialDirty.h \
- ../runtimerender/graphobjects/Qt3DSRenderModel.h \
- ../runtimerender/graphobjects/Qt3DSRenderNode.h \
- ../runtimerender/graphobjects/Qt3DSRenderPath.h \
- ../runtimerender/graphobjects/Qt3DSRenderPathSubPath.h \
- ../runtimerender/graphobjects/Qt3DSRenderPresentation.h \
- ../runtimerender/graphobjects/Qt3DSRenderReferencedMaterial.h \
- ../runtimerender/graphobjects/Qt3DSRenderScene.h \
- ../runtimerender/graphobjects/Qt3DSRenderText.h \
- ../runtimerender/Qt3DSOffscreenRenderKey.h \
- ../runtimerender/Qt3DSOffscreenRenderManager.h \
- ../runtimerender/Qt3DSOldNBustedRenderPlugin.h \
- ../runtimerender/Qt3DSRender.h \
- ../runtimerender/Qt3DSRenderableImage.h \
- ../runtimerender/Qt3DSRenderClippingFrustum.h \
- ../runtimerender/Qt3DSRenderCustomMaterialRenderContext.h \
- ../runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.h \
- ../runtimerender/Qt3DSRenderCustomMaterialSystem.h \
- ../runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.h \
- ../runtimerender/Qt3DSRenderDynamicObjectSystem.h \
- ../runtimerender/Qt3DSRenderDynamicObjectSystemCommands.h \
- ../runtimerender/Qt3DSRenderDynamicObjectSystemUtil.h \
- ../runtimerender/Qt3DSRenderEffectSystem.h \
- ../runtimerender/Qt3DSRenderer.h \
- ../runtimerender/Qt3DSRendererUtil.h \
- ../runtimerender/Qt3DSRenderEulerAngles.h \
- ../runtimerender/Qt3DSRenderGraphObjectPickQuery.h \
- ../runtimerender/Qt3DSRenderGraphObjectSerializer.h \
- ../runtimerender/Qt3DSRenderGraphObjectTypes.h \
- ../runtimerender/Qt3DSRenderImageScaler.h \
- ../runtimerender/Qt3DSRenderImageTextureData.h \
- ../runtimerender/Qt3DSRenderInputStreamFactory.h \
- ../runtimerender/Qt3DSRenderMaterialHelpers.h \
- ../runtimerender/Qt3DSRenderMaterialShaderGenerator.h \
- ../runtimerender/Qt3DSRenderMesh.h \
- ../runtimerender/Qt3DSRenderPathManager.h \
- ../runtimerender/Qt3DSRenderPathMath.h \
- ../runtimerender/Qt3DSRenderPathRenderContext.h \
- ../runtimerender/Qt3DSRenderPixelGraphicsRenderer.h \
- ../runtimerender/Qt3DSRenderPixelGraphicsTypes.h \
- ../runtimerender/Qt3DSRenderPlugin.h \
- ../runtimerender/Qt3DSRenderPluginCInterface.h \
- ../runtimerender/Qt3DSRenderPluginGraphObject.h \
- ../runtimerender/Qt3DSRenderPluginPropertyValue.h \
- ../runtimerender/Qt3DSRenderProfiler.h \
- ../runtimerender/Qt3DSRenderRay.h \
- ../runtimerender/Qt3DSRenderRenderList.h \
- ../runtimerender/Qt3DSRenderRotationHelper.h \
- ../runtimerender/Qt3DSRenderShaderCache.h \
- ../runtimerender/Qt3DSRenderShaderCodeGenerator.h \
- ../runtimerender/Qt3DSRenderShaderCodeGeneratorV2.h \
- ../runtimerender/Qt3DSRenderShaderKeys.h \
- ../runtimerender/Qt3DSRenderShadowMap.h \
- ../runtimerender/Qt3DSRenderSubpresentation.h \
- ../runtimerender/Qt3DSRenderSubPresentationHelper.h \
- ../runtimerender/Qt3DSRenderTaggedPointer.h \
- ../runtimerender/Qt3DSRenderTessModeValues.h \
- ../runtimerender/Qt3DSRenderTextTextureAtlas.h \
- ../runtimerender/Qt3DSRenderTextTextureCache.h \
- ../runtimerender/Qt3DSRenderTextTypes.h \
- ../runtimerender/Qt3DSRenderTextureAtlas.h \
- ../runtimerender/Qt3DSRenderThreadPool.h \
- ../runtimerender/Qt3DSRenderUIPLoader.h \
- ../runtimerender/Qt3DSRenderUIPSharedTranslation.h \
- ../runtimerender/Qt3DSRenderWidgets.h \
- ../runtimerender/Qt3DSTextRenderer.h \
- ../runtimerender/rendererimpl/Qt3DSRenderableObjects.h \
- ../runtimerender/rendererimpl/Qt3DSRendererImpl.h \
- ../runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.h \
- ../runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.h \
- ../runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h \
- ../runtimerender/rendererimpl/Qt3DSRendererImplShaders.h \
- ../runtimerender/rendererimpl/Qt3DSVertexPipelineImpl.h \
- ../runtimerender/resourcemanager/Qt3DSRenderBufferLoader.h \
- ../runtimerender/resourcemanager/Qt3DSRenderBufferManager.h \
- ../runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.h \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.h \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.h \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureFreeImageCompat.h \
- ../runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.h \
- ../runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.h \
- ../runtimerender/resourcemanager/Qt3DSRenderResourceManager.h \
- ../runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.h \
- ../system/Qt3DSArray.h \
- ../system/Qt3DSAssert.h \
- ../system/Qt3DSAudioPlayer.h \
- ../system/Qt3DSBasicPluginDLL.h \
- ../system/Qt3DSBezierEval.h \
- ../system/Qt3DSBoundingBox.h \
- ../system/Qt3DSCircularArray.h \
- ../system/Qt3DSColor.h \
- ../system/Qt3DSConfig.h \
- ../system/Qt3DSCubicRoots.h \
- ../system/Qt3DSCubicRootsImpl.h \
- ../system/Qt3DSDataLogger.h \
- ../system/Qt3DSDataLogger.hpp \
- ../system/Qt3DSDataLoggerEnums.h \
- ../system/Qt3DSDataLoggerViewer.h \
- ../system/Qt3DSDLLManager.h \
- ../system/Qt3DSEGLTimer.h \
- ../system/Qt3DSEndian.h \
- ../system/Qt3DSEulerAngles.h \
- ../system/Qt3DSFile.h \
- ../system/Qt3DSFileStream.h \
- ../system/Qt3DSFixedArray.h \
- ../system/Qt3DSFNDTimer.h \
- ../system/Qt3DSFunctionWrappers.h \
- ../system/Qt3DSHash.h \
- ../system/Qt3DSIFileStream.h \
- ../system/Qt3DSIStream.h \
- ../system/Qt3DSITimer.h \
- ../system/Qt3DSMacros.h \
- ../system/Qt3DSMatrix.h \
- ../system/Qt3DSMemory.h \
- ../system/Qt3DSMemoryFilter.h \
- ../system/Qt3DSMemoryHeap.h \
- ../system/Qt3DSMemoryManager.h \
- ../system/Qt3DSMemoryPool.h \
- ../system/Qt3DSMemoryProbe.h \
- ../system/Qt3DSMemorySettings.h \
- ../system/Qt3DSMemoryStatistics.h \
- ../system/Qt3DSMemoryTracker.h \
- ../system/Qt3DSPlatformSpecific.h \
- ../system/Qt3DSTimer.h \
- ../system/Qt3DSTypes.h \
- ../system/Qt3DSVector3.h \
- ../system/Qt3DSArray.inl \
- ../system/Qt3DSCircularArray.inl \
- ../system/Qt3DSFixedArray.inl \
- ../state/Qt3DSState.h \
- ../state/Qt3DSStateTypes.h \
- ../state/Qt3DSStateScriptContext.h \
- ../state/Qt3DSStateVisualBindingContextCommands.h \
- ../uipparser/Qt3DSIPresentation.h \
- ../uipparser/Qt3DSUIPParser.h \
- ../uipparser/Qt3DSUIPParserActionHelper.h \
- ../uipparser/Qt3DSUIPParserImpl.h \
- ../uipparser/Qt3DSUIPParserObjectRefHelper.h \
- ../runtime/Qt3DSCommandEventTypes.h \
- ../runtime/Qt3DSEvent.h \
- ../runtime/Qt3DSFrameworkTypes.h \
- ../runtime/Qt3DSInputFrame.h \
- ../runtime/Qt3DSIScene.h \
- ../runtime/Qt3DSIScriptBridge.h \
- ../runtime/Qt3DSPickFrame.h \
- ../runtime/Qt3DSRuntimeFactory.h \
- ../runtime/Qt3DSSceneManager.h \
- ../engine/Qt3DSEGLInfo.h \
- ../engine/Qt3DSEGLWindowSystem.h \
- ../engine/Qt3DSPluginDLL.h \
- ../engine/Qt3DSWindowSystem.h \
- ../runtimerender/Qt3DSRenderContextCore.h \
- ../runtimerender/Qt3DSRenderLightConstantProperties.h \
- ../runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.h \
- ../runtimerender/Qt3DSDistanceFieldRenderer.h \
- ../runtimerender/Qt3DSFontDatabase_p.h \
- ../runtimerender/Qt3DSDistanceFieldGlyphCacheManager_p.h \
- ../runtimerender/Qt3DSDistanceFieldGlyphCache_p.h \
- ../engine/Qt3DSRuntimeView.h
-
-win32 {
-SOURCES += \
- ../foundation/windows/Qt3DSWindowsAtomic.cpp \
- ../foundation/windows/Qt3DSWindowsFPU.cpp \
- ../foundation/windows/Qt3DSWindowsMutex.cpp \
- ../foundation/windows/Qt3DSWindowsSemaphore.cpp \
- ../foundation/windows/Qt3DSWindowsSync.cpp \
- ../foundation/windows/Qt3DSWindowsThread.cpp \
- ../foundation/windows/Qt3DSWindowsTime.cpp
-
-HEADERS += \
- ../foundation/windows/Qt3DSWindowsAoS.h \
- ../foundation/windows/Qt3DSWindowsFile.h \
- ../foundation/windows/Qt3DSWindowsInclude.h \
- ../foundation/windows/Qt3DSWindowsInlineAoS.h \
- ../foundation/windows/Qt3DSWindowsIntrinsics.h \
- ../foundation/windows/Qt3DSWindowsString.h \
- ../foundation/windows/Qt3DSWindowsTrigConstants.h
-}
-
-macos: SOURCES += \
- ../foundation/macos/Qt3DSUnixAtomic.cpp \
- ../foundation/macos/Qt3DSUnixFPU.cpp \
- ../foundation/macos/Qt3DSUnixMutex.cpp \
- ../foundation/macos/Qt3DSUnixSemaphore.cpp \
- ../foundation/macos/Qt3DSUnixSync.cpp \
- ../foundation/linux/Qt3DSLinuxThread.cpp \
- ../foundation/macos/Qt3DSUnixTime.cpp
-
-linux|integrity|qnx {
-SOURCES += \
- ../foundation/linux/Qt3DSLinuxAtomic.cpp \
- ../foundation/linux/Qt3DSLinuxFPU.cpp \
- ../foundation/linux/Qt3DSLinuxMutex.cpp \
- ../foundation/linux/Qt3DSLinuxSemaphore.cpp \
- ../foundation/linux/Qt3DSLinuxSync.cpp \
- ../foundation/linux/Qt3DSLinuxThread.cpp \
- ../foundation/linux/Qt3DSLinuxTime.cpp
-
-HEADERS += \
- ../foundation/linux/Qt3DSLinuxAoS.h \
- ../foundation/linux/Qt3DSLinuxFile.h \
- ../foundation/linux/Qt3DSLinuxInlineAoS.h \
- ../foundation/linux/Qt3DSLinuxIntrinsics.h \
- ../foundation/linux/Qt3DSLinuxString.h \
- ../foundation/linux/Qt3DSLinuxTrigConstants.h
-}
-
-# Libs
-SOURCES += \
- ../platformspecific/$$PlatformSpecificDir/libs/nv_math/nv_math.cpp \
- ../platformspecific/$$PlatformSpecificDir/libs/nv_math/nv_matrix.cpp \
- ../platformspecific/$$PlatformSpecificDir/libs/nv_math/nv_quat.cpp
-
-# RenderBase
-SOURCES += \
- ../render/Qt3DSRenderAtomicCounterBuffer.cpp \
- ../render/Qt3DSRenderAttribLayout.cpp \
- ../render/Qt3DSRenderBaseTypes.cpp \
- ../render/Qt3DSRenderComputeShader.cpp \
- ../render/Qt3DSRenderConstantBuffer.cpp \
- ../render/Qt3DSRenderContext.cpp \
- ../render/Qt3DSRenderDataBuffer.cpp \
- ../render/Qt3DSRenderDepthStencilState.cpp \
- ../render/Qt3DSRenderDrawIndirectBuffer.cpp \
- ../render/Qt3DSRenderFragmentShader.cpp \
- ../render/Qt3DSRenderFrameBuffer.cpp \
- ../render/Qt3DSRenderGeometryShader.cpp \
- ../render/Qt3DSRenderImageTexture.cpp \
- ../render/Qt3DSRenderIndexBuffer.cpp \
- ../render/Qt3DSRenderInputAssembler.cpp \
- ../render/Qt3DSRenderOcclusionQuery.cpp \
- ../render/Qt3DSRenderPathFontSpecification.cpp \
- ../render/Qt3DSRenderPathFontText.cpp \
- ../render/Qt3DSRenderPathRender.cpp \
- ../render/Qt3DSRenderPathSpecification.cpp \
- ../render/Qt3DSRenderProgramPipeline.cpp \
- ../render/Qt3DSRenderQueryBase.cpp \
- ../render/Qt3DSRenderRasterizerState.cpp \
- ../render/Qt3DSRenderRenderBuffer.cpp \
- ../render/Qt3DSRenderSampler.cpp \
- ../render/Qt3DSRenderShaderProgram.cpp \
- ../render/Qt3DSRenderStorageBuffer.cpp \
- ../render/Qt3DSRenderSync.cpp \
- ../render/Qt3DSRenderTessellationShader.cpp \
- ../render/Qt3DSRenderTexture2D.cpp \
- ../render/Qt3DSRenderTexture2DArray.cpp \
- ../render/Qt3DSRenderTextureBase.cpp \
- ../render/Qt3DSRenderTextureCube.cpp \
- ../render/Qt3DSRenderTimerQuery.cpp \
- ../render/Qt3DSRenderVertexBuffer.cpp \
- ../render/Qt3DSRenderVertexShader.cpp
-
-HEADERS += \
- ../render/Qt3DSRenderAtomicCounterBuffer.h \
- ../render/Qt3DSRenderAttribLayout.h \
- ../render/Qt3DSRenderBaseTypes.h \
- ../render/Qt3DSRenderComputeShader.h \
- ../render/Qt3DSRenderConstantBuffer.h \
- ../render/Qt3DSRenderContext.h \
- ../render/Qt3DSRenderDataBuffer.h \
- ../render/Qt3DSRenderDepthStencilState.h \
- ../render/Qt3DSRenderDrawable.h \
- ../render/Qt3DSRenderDrawIndirectBuffer.h \
- ../render/Qt3DSRenderFragmentShader.h \
- ../render/Qt3DSRenderFrameBuffer.h \
- ../render/Qt3DSRenderGeometryShader.h \
- ../render/Qt3DSRenderImageTexture.h \
- ../render/Qt3DSRenderIndexBuffer.h \
- ../render/Qt3DSRenderInputAssembler.h \
- ../render/Qt3DSRenderOcclusionQuery.h \
- ../render/Qt3DSRenderPathFontSpecification.h \
- ../render/Qt3DSRenderPathFontText.h \
- ../render/Qt3DSRenderPathRender.h \
- ../render/Qt3DSRenderPathSpecification.h \
- ../render/Qt3DSRenderProgramPipeline.h \
- ../render/Qt3DSRenderQueryBase.h \
- ../render/Qt3DSRenderRasterizerState.h \
- ../render/Qt3DSRenderRenderBuffer.h \
- ../render/Qt3DSRenderSampler.h \
- ../render/Qt3DSRenderShader.h \
- ../render/Qt3DSRenderShaderConstant.h \
- ../render/Qt3DSRenderShaderProgram.h \
- ../render/Qt3DSRenderStorageBuffer.h \
- ../render/Qt3DSRenderSync.h \
- ../render/Qt3DSRenderTessellationShader.h \
- ../render/Qt3DSRenderTexture2D.h \
- ../render/Qt3DSRenderTexture2DArray.h \
- ../render/Qt3DSRenderTextureBase.h \
- ../render/Qt3DSRenderTextureCube.h \
- ../render/Qt3DSRenderTimerQuery.h \
- ../render/Qt3DSRenderVertexBuffer.h \
- ../render/Qt3DSRenderVertexShader.h \
- ../render/glg/Qt3DSGLImplObjects.h
-
-# Render
-SOURCES += \
- ../render/backends/gl/Qt3DSOpenGLExtensions.cpp \
- ../render/backends/gl/Qt3DSRenderBackendGL3.cpp \
- ../render/backends/gl/Qt3DSRenderBackendGL4.cpp \
- ../render/backends/gl/Qt3DSRenderBackendGLBase.cpp \
- ../render/backends/gl/Qt3DSRenderContextGL.cpp \
- ../render/backends/software/Qt3DSRenderBackendNULL.cpp \
- ../render/backends/gl/Q3DSRenderBackendGLES2.cpp
-
-HEADERS += \
- ../render/backends/Qt3DSRenderBackend.h \
- ../render/backends/gl/Qt3DSOpenGLPrefix.h \
- ../render/backends/gl/Qt3DSOpenGLUtil.h \
- ../render/backends/gl/Qt3DSOpenGLExtensions.h \
- ../render/backends/gl/Qt3DSRenderBackendGL3.h \
- ../render/backends/gl/Qt3DSRenderBackendGL4.h \
- ../render/backends/gl/Qt3DSRenderBackendGLBase.h \
- ../render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h \
- ../render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h \
- ../render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h \
- ../render/backends/software/Qt3DSRenderBackendNULL.h \
- ../render/backends/gl/Q3DSRenderBackendGLES2.h
-
-# DataModel
-SOURCES += \
- ../datamodel/Qt3DSMetadata.cpp \
- ../importlib/Qt3DSImportMesh.cpp \
- ../importlib/Qt3DSImportMeshBuilder.cpp \
- ../importlib/Qt3DSImportPath.cpp \
- ../dm/systems/Qt3DSDMMetaData.cpp \
- ../dm/systems/Qt3DSDMXML.cpp \
- ../dm/systems/Qt3DSDMStringTable.cpp \
- ../dm/systems/Qt3DSDMComposerTypeDefinitions.cpp \
- ../dm/systems/Qt3DSDMValue.cpp \
- ../dm/systems/cores/SimpleDataCore.cpp
-
-HEADERS += \
- ../datamodel/Qt3DSMetadata.h \
- ../datamodel/DocumentResourceManagerScriptParser.h \
- ../importlib/Qt3DSImportMesh.h \
- ../importlib/Qt3DSImportPath.h \
- ../dm/systems/Qt3DSDMMetaData.h \
- ../dm/systems/Qt3DSDMXML.h \
- ../dm/systems/Qt3DSDMStringTable.h \
- ../dm/systems/Qt3DSDMHandles.h \
- ../dm/systems/Qt3DSDMComposerTypeDefinitions.h \
- ../dm/systems/Qt3DSDMValue.h \
- ../dm/systems/cores/SimpleDataCore.h
-
-# Engine
-HEADERS += \
- ../engine/EnginePrefix.h
-
-# Event
-SOURCES += \
- ../event/EventFactory.cpp \
- ../event/EventPoller.cpp \
- ../event/EventSystemC.cpp
-
-HEADERS += \
- ../event/EventPollingSystem.h \
- ../event/EventSystem.h \
- ../event/EventSystemC.h
-
-# Render
-HEADERS += \
- ../runtimerender/android/DynamicLibLoader.h \
- ../runtimerender/linux/DynamicLibLoader.h \
- ../runtimerender/macos/DynamicLibLoader.h \
- ../runtimerender/qnx/DynamicLibLoader.h \
- ../runtimerender/windows/DynamicLibLoader.h
-
-# Runtime
-HEADERS += \
- ../runtime/RuntimePrefix.h \
- ../runtime/q3dsqmlscript.h \
- ../runtime/q3dsqmlbehavior.h
-
-SOURCES += \
- ../runtime/q3dsqmlscript.cpp \
- ../runtime/q3dsqmlbehavior.cpp
-
-# System
-HEADERS += \
- ../system/SystemPrefix.h
-
-DISTFILES += \
- ../runtime/Qt3DSAttributeHashes.txt
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/NvVec.h b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/NvVec.h
deleted file mode 100644
index 4e5b09ce..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/NvVec.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_VEC_H
-#define INCLUDED_QT3DS_MATH_CPP_VEC_H
-
-#include "misc.h"
-
-struct _NvVec3
-{
- union {
- struct
- {
- float x, y, z;
- };
- float v[3];
- };
-};
-
-struct NvVec3 : public _NvVec3
-{
- NvVec3() { zero(); }
-
- NvVec3(float x, float y, float z)
- {
- v[0] = x;
- v[1] = y;
- v[2] = z;
- }
-
- NvVec3(NvVec3 const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- v[2] = that.v[2];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- v[2] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- NvVec3 &operator+=(NvVec3 const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- v[2] += that.v[2];
- return *this;
- }
-
- NvVec3 &operator-=(NvVec3 const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- v[2] -= that.v[2];
- return *this;
- }
-
- NvVec3 &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- v[2] *= s;
- return *this;
- }
-
- NvVec3 &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- v[2] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec3 const &a, NvVec3 const &b)
-{
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
-}
-
-inline NvVec3 operator+(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] + b.v[0], a.v[1] + b.v[1], a.v[2] + b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] - b.v[0], a.v[1] - b.v[1], a.v[2] - b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a)
-{
-
- return NvVec3(-a.v[0], -a.v[1], -a.v[2]);
-}
-
-inline NvVec3 operator*(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] * s, a.v[1] * s, a.v[2] * s);
-}
-
-inline NvVec3 operator*(float s, NvVec3 const &a)
-{
-
- return NvVec3(s * a.v[0], s * a.v[1], s * a.v[2]);
-}
-
-inline NvVec3 operator/(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] / s, a.v[1] / s, a.v[2] / s);
-}
-
-inline float magnitude(NvVec3 const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec3 normalize(NvVec3 const &v)
-{
- float l = magnitude(v);
- return NvVec3(v[0] / l, v[1] / l, v[2] / l);
-}
-
-inline NvVec3 cross(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[1] * b.v[2] - a.v[2] * b.v[1], a.v[2] * b.v[0] - a.v[0] * b.v[2],
- a.v[0] * b.v[1] - a.v[1] * b.v[0]);
-}
-
-inline bool operator==(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] == b.v[0] && a.v[1] == b.v[1] && a.v[2] == b.v[2]);
-}
-
-inline bool operator!=(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] != b.v[0] || a.v[1] != b.v[1] || a.v[2] != b.v[2]);
-}
-
-struct NvVec2f
-{
- union {
- struct
- {
- float x, y;
- float v[2];
- };
- };
-
- NvVec2f() { zero(); }
-
- NvVec2f(float x, float y)
- {
- v[0] = x;
- v[1] = y;
- }
-
- NvVec2f(NvVec2f const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- NvVec2f &operator+=(NvVec2f const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- return *this;
- }
-
- NvVec2f &operator-=(NvVec2f const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- return *this;
- }
-
- NvVec2f &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- return *this;
- }
-
- NvVec2f &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a[0] * b[0] + a[1] * b[1];
-}
-
-inline NvVec2f operator+(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] + b.v[0], a.v[1] + b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] - b.v[0], a.v[1] - b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a)
-{
-
- return NvVec2f(-a.v[0], -a.v[1]);
-}
-
-inline NvVec2f operator*(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] * s, a.v[1] * s);
-}
-
-inline NvVec2f operator*(float s, NvVec2f const &a)
-{
-
- return NvVec2f(s * a.v[0], s * a.v[1]);
-}
-
-inline NvVec2f operator/(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] / s, a.v[1] / s);
-}
-
-inline float magnitude(NvVec2f const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec2f normalize(NvVec2f const &v)
-{
- float l = dot(v, v);
- return NvVec2f(v[0] / l, v[1] / l);
-}
-
-inline float cross(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a.v[0] * b.v[1] - b.v[0] * a.v[1];
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/misc.h b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/misc.h
deleted file mode 100644
index 983410f3..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/misc.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_MISC_H
-#define INCLUDED_QT3DS_MATH_CPP_MISC_H
-
-inline bool nvIsPowerOfTwo(unsigned int i)
-{
- return (i & (i - 1)) == 0;
-}
-
-inline float nvDegToRadf(float d)
-{
- return d * 3.14159265358979323846f / 180.0f;
-}
-
-inline float nvRadToDegf(float r)
-{
- return r * 180.0f / 3.14159265358979323846f;
-}
-
-/*
- 'mod' differs from '%' in that it behaves correctly when either the
- numerator or denominator is negative.
-*/
-
-inline int nvMod(int n, int d)
-{
- int m = n % d;
- return (((m < 0) && (d > 0)) || ((m > 0) && (d < 0))) ? (m + d) : m;
-}
-
-inline int nvAbs(int n)
-{
- if (n < 0)
- return -n;
- return n;
-}
-
-inline int nvSign(int n)
-{
- if (n > 0)
- return 1;
- if (n < 0)
- return -1;
- return 0;
-}
-
-/*
- This returns the smallest amplitude value x such that
- nvMod(b + x, m) == a
-*/
-
-inline int nvDifMod(int a, int b, int m)
-{
-
- int x1 = a - b;
- int x2 = (x1 > 0) ? x1 - m : x1 + m;
- return (nvAbs(x1) < nvAbs(x2)) ? x1 : x2;
-}
-
-inline float nvWrapf(float a, float min, float max)
-{
-
- assert(max > min);
-
- float d = max - min;
- float s = a - min;
- float q = s / d;
- float m = q - floorf(q);
- return m * d + min;
-}
-
-inline float nvClampf(float a, float min, float max)
-{
- return (a < min) ? min : ((a > max) ? max : a);
-}
-
-inline int nvClampi(int i, int min, int max)
-{
- return (i < min) ? min : ((i > max) ? max : i);
-}
-
-inline float nvGaussian(float x, float s)
-{
- float c = s * sqrtf(2.0f * 3.14159265358979323846f);
- return expf(-(x * x) / (2.0f * s * s)) / c;
-}
-
-inline float nvLerpf(float a, float b, float t)
-{
- return a * (1.0f - t) + b * t;
-}
-
-inline float nvEasef(float t)
-{
-
- float t_2 = t * t;
- float t_3 = t_2 * t;
- return 3.0f * t_2 - 2.0f * t_3;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.cpp b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.cpp
deleted file mode 100644
index b83cb39e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_math.h"
-
-static const double a = 16807.0;
-static const double m = 2147483647.0;
-
-static double nextSeed(double seed)
-{
- double t = a * seed;
- return t - m * (double)((int)(t / m));
-}
-
-GLfloat NvRandf()
-{
- static double seed = 1.0;
- seed = nextSeed(seed);
- return (GLfloat)(seed * (1 / m));
-}
-
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime)
-{
- // kdGetTimeUST is never supposed to decrease (i.e. that
- // means it can't wrap, either. IIRC, it will wrap in
- // 593 years). So we ignore that option...
-
- // Used for frame-to-frame diffs, this will fit in 32b
- // as long as the times are < ~4.3s apart
- long long int diffTime = newTime - oldTime;
-
- // Need to find a better way to do this.
- // However, I believe we will be uSec precise (not run
- // out of mantissa bits for uSecs) as long as the diff
- // is < ~16s (1e-6 * (2^24))
- return ((GLfloat)diffTime) / 1.0e9f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.h b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.h
deleted file mode 100644
index cf2d8b30..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_math.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_MATH_H
-#define _QT3DS_MATH_H
-
-#include <GLES2/gl2.h>
-
-GLfloat NvRandf();
-
-/* These are the recommended "safer" ways to use GLfloat for time */
-
-/* Returns the seconds between the two given times */
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime);
-
-#define QT3DS_MILISECS_TO_UST(ms) ((long long int)(ms)*1000000)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.cpp b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.cpp
deleted file mode 100644
index e208ac31..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.cpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_matrix.h"
-
-int NvDifferentMatsf(GLfloat a[4][4], const GLfloat b[4][4])
-{
- return ((&a[3][3] < &b[0][0]) || (&b[3][3] < &a[0][0]));
-}
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-}
-
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
-}
-
-GLfloat NvVecLengthf(const GLfloat v[3])
-{
- return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-}
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3])
-{
- GLfloat const l = NvVecLengthf(v);
- r[0] = v[0] / l;
- r[1] = v[1] / l;
- r[2] = v[2] / l;
-}
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] + b[0];
- r[1] = a[1] + b[1];
- r[2] = a[2] + b[2];
-}
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] - b[0];
- r[1] = a[1] - b[1];
- r[2] = a[2] - b[2];
-}
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- GLfloat t[3];
-
- t[0] = a[1] * b[2] - a[2] * b[1];
- t[1] = a[2] * b[0] - a[0] * b[2];
- t[2] = a[0] * b[1] - a[1] * b[0];
-
- r[0] = t[0];
- r[1] = t[1];
- r[2] = t[2];
-}
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- GLfloat inv_w = 1.0f / (m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3]);
-
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * inv_w;
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * inv_w;
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * inv_w;
-}
-
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * a[3];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * a[3];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * a[3];
- r[3] = m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3] * a[3];
-}
-
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2];
-}
-
-static void NvMultMat3x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2];
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x4f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2] + a[3][0] * b[0][3];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2] + a[3][1] * b[0][3];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2] + a[3][2] * b[0][3];
- r[0][3] = a[0][3] * b[0][0] + a[1][3] * b[0][1] + a[2][3] * b[0][2] + a[3][3] * b[0][3];
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2] + a[3][0] * b[1][3];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2] + a[3][1] * b[1][3];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2] + a[3][2] * b[1][3];
- r[1][3] = a[0][3] * b[1][0] + a[1][3] * b[1][1] + a[2][3] * b[1][2] + a[3][3] * b[1][3];
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2] + a[3][0] * b[2][3];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2] + a[3][1] * b[2][3];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2] + a[3][2] * b[2][3];
- r[2][3] = a[0][3] * b[2][0] + a[1][3] * b[2][1] + a[2][3] * b[2][2] + a[3][3] * b[2][3];
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0] * b[3][3];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1] * b[3][3];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2] * b[3][3];
- r[3][3] = a[0][3] * b[3][0] + a[1][3] * b[3][1] + a[2][3] * b[3][2] + a[3][3] * b[3][3];
-}
-
-void NvMultMatf(GLfloat result[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((a[0][3] == 0.0f) && (a[1][3] == 0.0f) && (a[2][3] == 0.0f) && (a[2][3] == 1.0f)
- && (b[0][3] == 0.0f) && (b[1][3] == 0.0f) && (b[2][3] == 0.0f) && (b[2][3] == 1.0f)) {
- if ((a[3][0] == 0.0f) && (a[3][1] == 0.0f) && (a[3][2] == 0.0f) && (b[3][0] == 0.0f)
- && (b[3][1] == 0.0f) && (b[3][2] == 0.0f)) {
- NvMultMat3x3f(r, a, b);
- } else {
- NvMultMat4x3f(r, a, b);
- }
- } else {
- NvMultMat4x4f(r, a, b);
- }
-
- NvCopyMatf(result, r);
-}
-
-static void NvInvMat3x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- /* x */
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- /* y */
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- /* z */
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x4f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] * m[3][3] + m[0][0] * m[1][2] * m[2][3] * m[3][1]
- + m[0][0] * m[1][3] * m[2][1] * m[3][2] + m[0][1] * m[1][0] * m[2][3] * m[3][2]
- + m[0][1] * m[1][2] * m[2][0] * m[3][3] + m[0][1] * m[1][3] * m[2][2] * m[3][0]
- + m[0][2] * m[1][0] * m[2][1] * m[3][3] + m[0][2] * m[1][1] * m[2][3] * m[3][0]
- + m[0][2] * m[1][3] * m[2][0] * m[3][1] + m[0][3] * m[1][0] * m[2][2] * m[3][1]
- + m[0][3] * m[1][1] * m[2][0] * m[3][2] + m[0][3] * m[1][2] * m[2][1] * m[3][0]
- + -m[0][0] * m[1][1] * m[2][3] * m[3][2] + -m[0][0] * m[1][2] * m[2][1] * m[3][3]
- + -m[0][0] * m[1][3] * m[2][2] * m[3][1] + -m[0][1] * m[1][0] * m[2][2] * m[3][3]
- + -m[0][1] * m[1][2] * m[2][3] * m[3][0] + -m[0][1] * m[1][3] * m[2][0] * m[3][2]
- + -m[0][2] * m[1][0] * m[2][3] * m[3][1] + -m[0][2] * m[1][1] * m[2][0] * m[3][3]
- + -m[0][2] * m[1][3] * m[2][1] * m[3][0] + -m[0][3] * m[1][0] * m[2][1] * m[3][2]
- + -m[0][3] * m[1][1] * m[2][2] * m[3][0] + -m[0][3] * m[1][2] * m[2][0] * m[3][1];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] * m[3][3] + m[1][2] * m[2][3] * m[3][1]
- + m[1][3] * m[2][1] * m[3][2] + -m[1][1] * m[2][3] * m[3][2]
- + -m[1][2] * m[2][1] * m[3][3] + -m[1][3] * m[2][2] * m[3][1])
- / d;
-
- r[0][1] = (m[0][1] * m[2][3] * m[3][2] + m[0][2] * m[2][1] * m[3][3]
- + m[0][3] * m[2][2] * m[3][1] + -m[0][1] * m[2][2] * m[3][3]
- + -m[0][2] * m[2][3] * m[3][1] + -m[0][3] * m[2][1] * m[3][2])
- / d;
-
- r[0][2] = (m[0][1] * m[1][2] * m[3][3] + m[0][2] * m[1][3] * m[3][1]
- + m[0][3] * m[1][1] * m[3][2] + -m[0][1] * m[1][3] * m[3][2]
- + -m[0][2] * m[1][1] * m[3][3] + -m[0][3] * m[1][2] * m[3][1])
- / d;
-
- r[0][3] = (m[0][1] * m[1][3] * m[2][2] + m[0][2] * m[1][1] * m[2][3]
- + m[0][3] * m[1][2] * m[2][1] + -m[0][1] * m[1][2] * m[2][3]
- + -m[0][2] * m[1][3] * m[2][1] + -m[0][3] * m[1][1] * m[2][2])
- / d;
-
- r[1][0] = (m[1][0] * m[2][3] * m[3][2] + m[1][2] * m[2][0] * m[3][3]
- + m[1][3] * m[2][2] * m[3][0] + -m[1][0] * m[2][2] * m[3][3]
- + -m[1][2] * m[2][3] * m[3][0] + -m[1][3] * m[2][0] * m[3][2])
- / d;
-
- r[1][1] = (m[0][0] * m[2][2] * m[3][3] + m[0][2] * m[2][3] * m[3][0]
- + m[0][3] * m[2][0] * m[3][2] + -m[0][0] * m[2][3] * m[3][2]
- + -m[0][2] * m[2][0] * m[3][3] + -m[0][3] * m[2][2] * m[3][0])
- / d;
-
- r[1][2] = (m[0][0] * m[1][3] * m[3][2] + m[0][2] * m[1][0] * m[3][3]
- + m[0][3] * m[1][2] * m[3][0] + -m[0][0] * m[1][2] * m[3][3]
- + -m[0][2] * m[1][3] * m[3][0] + -m[0][3] * m[1][0] * m[3][2])
- / d;
-
- r[1][3] = (m[0][0] * m[1][2] * m[2][3] + m[0][2] * m[1][3] * m[2][0]
- + m[0][3] * m[1][0] * m[2][2] + -m[0][0] * m[1][3] * m[2][2]
- + -m[0][2] * m[1][0] * m[2][3] + -m[0][3] * m[1][2] * m[2][0])
- / d;
-
- r[2][0] = (m[1][0] * m[2][1] * m[3][3] + m[1][1] * m[2][3] * m[3][0]
- + m[1][3] * m[2][0] * m[3][1] + -m[1][0] * m[2][3] * m[3][1]
- + -m[1][1] * m[2][0] * m[3][3] + -m[1][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][1] =
- (-m[0][0] * m[2][1] * m[3][3] + -m[0][1] * m[2][3] * m[3][0] + -m[0][3] * m[2][0] * m[3][1]
- + m[0][0] * m[2][3] * m[3][1] + m[0][1] * m[2][0] * m[3][3] + m[0][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][2] = (m[0][0] * m[1][1] * m[3][3] + m[0][1] * m[1][3] * m[3][0]
- + m[0][3] * m[1][0] * m[3][1] + -m[0][0] * m[1][3] * m[3][1]
- + -m[0][1] * m[1][0] * m[3][3] + -m[0][3] * m[1][1] * m[3][0])
- / d;
-
- r[2][3] = (m[0][0] * m[1][3] * m[2][1] + m[0][1] * m[1][0] * m[2][3]
- + m[0][3] * m[1][1] * m[2][0] + -m[0][1] * m[1][3] * m[2][0]
- + -m[0][3] * m[1][0] * m[2][1] + -m[0][0] * m[1][1] * m[2][3])
- / d;
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = (m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1]
- + -m[0][1] * m[1][0] * m[2][2] + -m[0][2] * m[1][1] * m[2][0])
- / d;
-}
-
-void NvInvMatf(GLfloat result[4][4], const GLfloat m[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((m[0][3] == 0.0f) && (m[1][3] == 0.0f) && (m[2][3] == 0.0f) && (m[2][3] == 1.0f)) {
- if ((m[3][0] == 0.0f) && (m[3][1] == 0.0f) && (m[3][2] == 0.0f)) {
- NvInvMat3x3f(r, m);
- } else {
- NvInvMat4x3f(r, m);
- }
- } else {
- NvInvMat4x4f(r, m);
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildIdentityMatf(GLfloat r[4][4])
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = x;
- r[3][1] = y;
- r[3][2] = z;
- r[3][3] = 1.0f;
-}
-
-void NvMultTranslateMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y,
- GLfloat z)
-{
- GLfloat r[4][4]; /*temporary storage for result */
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[0][0] * x + m[1][0] * y + m[2][0] * z + m[3][0];
- r[3][1] = m[0][1] * x + m[1][1] * y + m[2][1] * z + m[3][1];
- r[3][2] = m[0][2] * x + m[1][2] * y + m[2][2] * z + m[3][2];
- r[3][3] = m[0][3] * x + m[1][3] * y + m[2][3] * z + m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = x;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = y;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = z;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultScaleMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * x;
- r[0][1] = m[0][1] * x;
- r[0][2] = m[0][2] * x;
- r[0][3] = m[0][3] * x;
-
- r[1][0] = m[1][0] * y;
- r[1][1] = m[1][1] * y;
- r[1][2] = m[1][2] * y;
- r[1][3] = m[1][3] * y;
-
- r[2][0] = m[2][0] * z;
- r[2][1] = m[2][1] * z;
- r[2][2] = m[2][2] * z;
- r[2][3] = m[2][3] * z;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians)
-{
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = c;
- r[1][2] = s;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = -s;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = 0.0f;
- r[0][2] = -s;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = s;
- r[2][1] = 0.0f;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = s;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = -s;
- r[1][1] = c;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultRotXRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0] * c + m[2][0] * s;
- r[1][1] = m[1][1] * c + m[2][1] * s;
- r[1][2] = m[1][2] * c + m[2][2] * s;
- r[1][3] = m[1][3] * c + m[2][3] * s;
-
- r[2][0] = m[1][0] * -s + m[2][0] * c;
- r[2][1] = m[1][1] * -s + m[2][1] * c;
- r[2][2] = m[1][2] * -s + m[2][2] * c;
- r[2][3] = m[1][3] * -s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotYRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[2][0] * -s;
- r[0][1] = m[0][1] * c + m[2][1] * -s;
- r[0][2] = m[0][2] * c + m[2][2] * -s;
- r[0][3] = m[0][3] * c + m[2][3] * -s;
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[0][0] * s + m[2][0] * c;
- r[2][1] = m[0][1] * s + m[2][1] * c;
- r[2][2] = m[0][2] * s + m[2][2] * c;
- r[2][3] = m[0][3] * s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotZRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[1][0] * s;
- r[0][1] = m[0][1] * c + m[1][1] * s;
- r[0][2] = m[0][2] * c + m[1][2] * s;
- r[0][3] = m[0][3] * c + m[1][3] * s;
-
- r[1][0] = m[0][0] * -s + m[1][0] * c;
- r[1][1] = m[0][1] * -s + m[1][1] * c;
- r[1][2] = m[0][2] * -s + m[1][2] * c;
- r[1][3] = m[0][3] * -s + m[1][3] * c;
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotRadMatf(GLfloat result[4][4], const GLfloat axis[3], GLfloat radians)
-{
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- /* build a matrix from the quat */
-
- result[0][0] = 1.0f - 2.0f * (j * j + k * k);
- result[0][1] = 2.0f * (i * j + r * k);
- result[0][2] = 2.0f * (i * k - r * j);
- result[0][3] = 0.0f;
-
- result[1][0] = 2.0f * (i * j - r * k);
- result[1][1] = 1.0f - 2.0f * (i * i + k * k);
- result[1][2] = 2.0f * (j * k + r * i);
- result[1][3] = 0.0f;
-
- result[2][0] = 2.0f * (i * k + r * j);
- result[2][1] = 2.0f * (j * k - r * i);
- result[2][2] = 1.0f - 2.0f * (i * i + j * j);
- result[2][3] = 0.0f;
-
- result[3][0] = 0.0f;
- result[3][1] = 0.0f;
- result[3][2] = 0.0f;
- result[3][3] = 1.0f;
-}
-
-void NvMultRotRadMatf(GLfloat result[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians)
-{
- GLfloat r[4][4];
-
- {
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat const dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- {
- /* build a matrix from the quat */
-
- GLfloat const a00 = 1.0f - 2.0f * (j * j + k * k);
- GLfloat const a01 = 2.0f * (i * j + r * k);
- GLfloat const a02 = 2.0f * (i * k - r * j);
-
- GLfloat const a10 = 2.0f * (i * j - r * k);
- GLfloat const a11 = 1.0f - 2.0f * (i * i + k * k);
- GLfloat const a12 = 2.0f * (j * k + r * i);
-
- GLfloat const a20 = 2.0f * (i * k + r * j);
- GLfloat const a21 = 2.0f * (j * k - r * i);
- GLfloat const a22 = 1.0f - 2.0f * (i * i + j * j);
-
- result[0][0] = m[0][0] * a00 + m[1][0] * a01 + m[2][0] * a02;
- result[0][1] = m[0][1] * a00 + m[1][1] * a01 + m[2][1] * a02;
- result[0][2] = m[0][2] * a00 + m[1][2] * a01 + m[2][2] * a02;
- result[0][3] = m[0][3] * a00 + m[1][3] * a01 + m[2][3] * a02;
-
- result[1][0] = m[0][0] * a10 + m[1][0] * a11 + m[2][0] * a12;
- result[1][1] = m[0][1] * a10 + m[1][1] * a11 + m[2][1] * a12;
- result[1][2] = m[0][2] * a10 + m[1][2] * a11 + m[2][2] * a12;
- result[1][3] = m[0][3] * a10 + m[1][3] * a11 + m[2][3] * a12;
-
- result[2][0] = m[0][0] * a20 + m[1][0] * a21 + m[2][0] * a22;
- result[2][1] = m[0][1] * a20 + m[1][1] * a21 + m[2][1] * a22;
- result[2][2] = m[0][2] * a20 + m[1][2] * a21 + m[2][2] * a22;
- result[2][3] = m[0][3] * a20 + m[1][3] * a21 + m[2][3] * a22;
-
- result[3][0] = m[3][0];
- result[3][1] = m[3][1];
- result[3][2] = m[3][2];
- result[3][3] = m[3][3];
- }
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotXRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotYRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotZRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotXRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotYRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotZRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees)
-{
- NvBuildRotRadMatf(r, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees)
-{
- NvMultRotRadMatf(r, m, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3])
-{
- GLfloat ev[3];
- GLfloat z[3];
- GLfloat x_tmp[3];
- GLfloat x[3];
- GLfloat y[3];
-
- NvSubVecf(ev, eye, obj);
-
- NvNormalizeVecf(z, ev);
-
- NvCrossProductf(x_tmp, up, z);
-
- NvNormalizeVecf(x, x_tmp);
-
- NvCrossProductf(y, z, x);
-
- r[0][0] = x[0];
- r[0][1] = y[0];
- r[0][2] = z[0];
- r[0][3] = 0.0f;
-
- r[1][0] = x[1];
- r[1][1] = y[1];
- r[1][2] = z[1];
- r[1][3] = 0.0f;
-
- r[2][0] = x[2];
- r[2][1] = y[2];
- r[2][2] = z[2];
- r[2][3] = 0.0f;
-
- r[3][0] = -x[0] * eye[0] + -x[1] * eye[1] + -x[2] * eye[2];
- r[3][1] = -y[0] * eye[0] + -y[1] * eye[1] + -y[2] * eye[2];
- r[3][2] = -z[0] * eye[0] + -z[1] * eye[1] + -z[2] * eye[2];
- r[3][3] = 1.0f;
-}
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const m00 = znear * 2.0f / (right - left);
- GLfloat const m11 = znear * 2.0f / (top - bottom);
- GLfloat const m22 = -(zfar + znear) / (zfar - znear);
-
- GLfloat const m20 = (right + left) / (right - left);
- GLfloat const m21 = (top + bottom) / (top - bottom);
-
- GLfloat const m32 = -(2.0f * zfar * znear) / (zfar - znear);
- GLfloat const m23 = -1.0f;
-
- r[0][0] = m00;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = m11;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = m20;
- r[2][1] = m21;
- r[2][2] = m22;
- r[2][3] = m23;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = m32;
- r[3][3] = 0.0f;
-}
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
- GLfloat const sz = -2.0f / (zfar - znear);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
- GLfloat const tz = -(zfar + znear) / (zfar - znear);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = sz;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = tz;
- r[3][3] = 1.0f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.h b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.h
deleted file mode 100644
index 2a8e186e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_matrix.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_MATRIX_H
-#define INCLUDED_MATRIX_H
-
-#include <GLES2/gl2.h>
-#include <math.h>
-#include <assert.h>
-
-#define KD_FLT_EPSILON 1.19209290E-07F
-#define KD_DEG_TO_RAD_F 0.0174532924F
-#define KD_RAD_TO_DEG_F 57.2957802F
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4]);
-
-/* vector utilities */
-
-GLfloat NvVecLengthf(const GLfloat v[3]);
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3]);
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4]);
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-
-/* matrix utilities */
-
-void NvMultMatf(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4]);
-
-void NvInvMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-
-/* matrix building utilities */
-
-void NvBuildIdentityMatf(GLfloat r[4][4]);
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees);
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees);
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians);
-
-void NvBuildRotRadMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat radians);
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3]);
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top);
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-/* matrix concatenation utilities */
-
-void NvMultTranslateMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-void NvMultScaleMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees);
-
-void NvMultRotXRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotYRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotZRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-
-void NvMultRotRadMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.cpp b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.cpp
deleted file mode 100644
index 6dc6d1a7..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_quat.h"
-#include <stdlib.h>
-#include <cstring>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4])
-{
- memcpy(r, q, 4 * sizeof(GLfloat));
-}
-
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4])
-{
- // Assumes that the quaternion is normalized!
- GLfloat x2 = q[0] * 2.0f;
- GLfloat y2 = q[1] * 2.0f;
- GLfloat z2 = q[2] * 2.0f;
- GLfloat xSq2 = x2 * q[0];
- GLfloat ySq2 = y2 * q[1];
- GLfloat zSq2 = z2 * q[2];
- GLfloat xy2 = x2 * q[1];
- GLfloat xz2 = x2 * q[2];
- GLfloat xw2 = x2 * q[3];
- GLfloat yz2 = y2 * q[2];
- GLfloat yw2 = y2 * q[3];
- GLfloat zw2 = z2 * q[3];
-
- /* Matrix is
- * | 1 - 2y^2 - 2z^2 2xy - 2zw 2xz + 2yw |
- * | 2xy + 2zw 1 - 2x^2 - 2z^2 2yz - 2xw |
- * | 2xz - 2yw 2yz + 2xw 1 - 2x^2 - 2y^2 |
- */
- r[0][0] = 1.0f - ySq2 - zSq2;
- r[0][1] = xy2 - zw2;
- r[0][2] = xz2 + yw2;
-
- r[1][0] = xy2 + zw2;
- r[1][1] = 1.0f - xSq2 - zSq2;
- r[1][2] = yz2 - xw2;
-
- r[2][0] = xz2 - yw2;
- r[2][1] = yz2 + xw2;
- r[2][2] = 1.0f - xSq2 - ySq2;
-}
-
-void NvQuatIdentity(GLfloat r[4])
-{
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = 1.0f;
-}
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3])
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = axis[0] * sina;
- r[1] = axis[1] * sina;
- r[2] = axis[2] * sina;
- r[3] = cosa;
-}
-
-void NvQuatX(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = sina;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatY(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = sina;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatZ(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = sina;
- r[3] = cosa;
-}
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatY(h, heading);
- NvQuatX(p, pitch);
- NvQuatZ(ro, roll);
-
- NvQuatMult(r, h, p);
- NvQuatMult(r, ro, r);
-}
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatZ(ro, roll);
- NvQuatX(p, pitch);
- NvQuatY(h, heading);
-
- NvQuatMult(r, p, h);
- NvQuatMult(r, r, ro);
-}
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4])
-{
- return q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3];
-}
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4])
-{
- const GLfloat q1x = q1[0];
- const GLfloat q1y = q1[1];
- const GLfloat q1z = q1[2];
- const GLfloat q1w = q1[3];
- const GLfloat q2x = q2[0];
- const GLfloat q2y = q2[1];
- const GLfloat q2z = q2[2];
- const GLfloat q2w = q2[3];
-
- r[0] = q1y * q2z - q2y * q1z + q1w * q2x + q2w * q1x;
- r[1] = q1z * q2x - q2z * q1x + q1w * q2y + q2w * q1y;
- r[2] = q1x * q2y - q2x * q1y + q1w * q2z + q2w * q1z;
- r[3] = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z;
-}
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t)
-{
- GLfloat omt = 1.0f - t;
-
- if (NvQuatDot(q1, q2) < 0.0f) {
- r[0] = -q1[0] * omt + q2[0] * t;
- r[1] = -q1[1] * omt + q2[1] * t;
- r[2] = -q1[2] * omt + q2[2] * t;
- r[3] = -q1[3] * omt + q2[3] * t;
- } else {
- r[0] = q1[0] * omt + q2[0] * t;
- r[1] = q1[1] * omt + q2[1] * t;
- r[2] = q1[2] * omt + q2[2] * t;
- r[3] = q1[3] * omt + q2[3] * t;
- }
-
- NvQuatNormalize(r, r);
-}
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4])
-{
- GLfloat invLength = 1.0f / sqrtf(NvQuatDot(q, q));
-
- r[0] = invLength * q[0];
- r[1] = invLength * q[1];
- r[2] = invLength * q[2];
- r[3] = invLength * q[3];
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.h b/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.h
deleted file mode 100644
index 688c30a7..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/android/jni/libs/nv_math/nv_quat.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QUAT_H
-#define INCLUDED_QUAT_H
-
-#include <GLES2/gl2.h>
-#include <math.h>
-#include <assert.h>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4]);
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4]);
-
-void NvQuatIdentity(GLfloat r[4]);
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3]);
-
-void NvQuatX(GLfloat r[4], GLfloat radians);
-
-void NvQuatY(GLfloat r[4], GLfloat radians);
-
-void NvQuatZ(GLfloat r[4], GLfloat radians);
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t);
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4]);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.abc b/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.abc
deleted file mode 100644
index f7e3c2f6..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.abc
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.dds b/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.dds
deleted file mode 100644
index 5bde760b..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_256.dds
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.abc b/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.abc
deleted file mode 100644
index 2ff78757..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.abc
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.dds b/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.dds
deleted file mode 100644
index f9e76d94..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/courier+lucida_512.dds
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.frag b/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.frag
deleted file mode 100644
index e4673cf8..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.frag
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-uniform sampler2D fontTex;
-
-varying lowp vec4 col_var;
-varying lowp vec2 tex_var;
-
-void main()
-{
- gl_FragColor = texture2D(fontTex, tex_var).a * col_var;
-}
-
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.vert b/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.vert
deleted file mode 100644
index 9f307a2f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/assets/font.vert
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// this is set from higher level. think of it as the upper model matrix
-uniform mat4 pixelToClipMat;
-
-uniform vec4 col_uni;
-
-attribute vec2 pos_attr;
-attribute vec2 tex_attr;
-attribute vec4 col_attr;
-
-varying vec4 col_var;
-varying vec2 tex_var;
-
-void main()
-{
- // account for translation and rotation of the primitive into [-1,1] spatial default.
- gl_Position = pixelToClipMat * vec4(pos_attr.x, pos_attr.y, 0, 1);
-
- col_var = col_attr * col_uni;
- tex_var = tex_attr;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_color.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_color.h
deleted file mode 100644
index b9347529..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_color.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_COLOR_H
-#define _QT3DS_COLOR_H
-
-/** @file nv_color.h
- Simple abstraction for RGBA colors as parameters to various libraries/functions.
-*/
-
-/** Base type for a single color channel (8-bit unsigned). */
-typedef unsigned char NvPCColor8;
-
-//#define NV_COLOR_BREAKOLD
-#ifdef NV_COLOR_BREAKOLD // uses a struct to break backwards-compat and accidental uses
-
-typedef struct
-{
- NvPCColor8 r;
- NvPCColor8 g;
- NvPCColor8 b;
- NvPCColor8 a;
-} NvPackedColor;
-
-static const NvPackedColor gnvpcwhite = { 255, 255, 255, 255 };
-static const NvPackedColor gnvpcblack = { 0, 0, 0, 255 };
-
-#define NV_PACKED_COLOR(r, g, b, a) \
- { \
- (NvPCColor8)(r), (NvPCColor8)(g), (NvPCColor8)(b), (NvPCColor8)(a) \
- }
-
-#define NV_PC_PREDEF_WHITE gnvpcwhite
-#define NV_PC_PREDEF_BLACK gnvpcblack
-
-#define NV_PC_RED(c) (c.r)
-#define NV_PC_GREEN(c) (c.g)
-#define NV_PC_BLUE(c) (c.b)
-#define NV_PC_ALPHA(c) (c.a)
-
-#define NV_PC_PACK_UINT(c) (*(unsigned int *)(&(c)))
-
-#define NV_PC_EQUAL(x, y) ((x).r == (y).r && (x).g == (y).g && (x).b == (y).b && (x).a == (y).a)
-
-#else /* code that doesn't break old pass-as-uint stuff */
-
-/** Main type declaration for a packed 4-color construct. */
-typedef unsigned int NvPackedColor;
-
-/** A macro to build a packed color, passing in RGBA as four 8-bit integer values. */
-#define NV_PACKED_COLOR(r, g, b, a) \
- ((NvPackedColor)(((((int)(a)) & 0xFF) << 24) | ((((int)(b)) & 0xFF) << 16) \
- | ((((int)(g)) & 0xFF) << 8) | ((((int)(r)) & 0xFF))))
-
-/** A predefined constant for WHITE. */
-#define NV_PC_PREDEF_WHITE NV_PACKED_COLOR(0xFF, 0xFF, 0xFF, 0xFF)
-/** A predefined constant for BLACK. */
-#define NV_PC_PREDEF_BLACK NV_PACKED_COLOR(0x00, 0x00, 0x00, 0xFF)
-
-/** A macro for 'extracting' the red value from an NvPackedColor. */
-#define NV_PC_RED(c) ((c >> 0) & 0xff)
-/** A macro for 'extracting' the green value from an NvPackedColor. */
-#define NV_PC_GREEN(c) ((c >> 8) & 0xff)
-/** A macro for 'extracting' the blue value from an NvPackedColor. */
-#define NV_PC_BLUE(c) ((c >> 16) & 0xff)
-/** A macro for 'extracting' the alpha value from an NvPackedColor. */
-#define NV_PC_ALPHA(c) ((c >> 24) & 0xff)
-
-/** A macro requesting the packed color repacked into a 32-bit unsigned int.
- This is a no-op for the color-as-uint approach.
-*/
-#define NV_PC_PACK_UINT(c) (c)
-/** A macro for testing the equality of two NvPackedColors. */
-#define NV_PC_EQUAL(x, y) (x == y)
-#endif
-
-/** A macro for mapping a single packed color channel into its floating point [0,1] rep. */
-#define NV_PC_TO_FLOAT(c) (c / 255.0f)
-
-#endif /*_QT3DS_COLOR_H*/
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_debug.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_debug.h
deleted file mode 100644
index 2559dd6f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_debug.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_DEBUG_H
-#define __INCLUDED_QT3DS_DEBUG_H
-
-#define CT_ASSERT(tag, cond) enum { COMPILE_TIME_ASSERT__##tag = 1 / (cond) }
-
-#define dimof(x) (sizeof(x) / sizeof(x[0]))
-#include <android/log.h>
-
-#define DBG_DETAILED 0
-
-#if 0
-
- // the detailed prefix can be customised by setting DBG_DETAILED_PREFIX. See
- // below as a reference.
- // NOTE: fmt is the desired format string and must be in the prefix.
- //#ifndef DBG_DETAILED_PREFIX
- // #define DBG_DETAILED_PREFIX "%s, %s, line %d: " fmt, __FILE__, __FUNCTION__, __LINE__,
- //#endif
- //#define DEBUG_D_(fmt, args...)
- //#define DEBUG_D(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, (DBG_DETAILED_PREFIX) ## args)
-
-#else
-
-#ifdef STRINGIFY
-#pragma push_macro("STRINGIFY")
-#undef STRINGIFY
-#define STRINGIFYPUSHED_____
-#endif
-#define STRINGIFY(x) #x
-
-// debug macro, includes file name function name and line number
-#define TO(x) typeof(x)
-#define DEBUG_D_(file, line, fmt, args...) \
- __android_log_print(ANDROID_LOG_DEBUG, MODULE, file ", %s, line(" STRINGIFY(line) "): " fmt, \
- __FUNCTION__, ##args)
-#define DEBUG_D(fmt, args...) DEBUG_D_(__FILE__, __LINE__, fmt, ##args)
-
-#ifdef STRINGIFYPUSHED_____
-#undef STRINGIFYPUSHED_____
-#pragma pop_macro("STRINGIFY")
-#endif
-
-#endif
-
-// basic debug macro
-#define DEBUG_(fmt, args...) (__android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ##args))
-
-// Debug macro that can be switched to spew a file name,
-// function and line number using DEBUG_DETAILED
-#if DBG_DETAILED == 1
-#define DEBUG(fmt, args...) DEBUG_D(fmt, ##args)
-#else
-#define DEBUG(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ##args)
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_global.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_global.h
deleted file mode 100644
index 9d23d45f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_global.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_GLOBAL_H
-#define __INCLUDED_QT3DS_GLOBAL_H
-
-#include "nv_types.h"
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/NvVec.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/NvVec.h
deleted file mode 100644
index 4e5b09ce..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/NvVec.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_VEC_H
-#define INCLUDED_QT3DS_MATH_CPP_VEC_H
-
-#include "misc.h"
-
-struct _NvVec3
-{
- union {
- struct
- {
- float x, y, z;
- };
- float v[3];
- };
-};
-
-struct NvVec3 : public _NvVec3
-{
- NvVec3() { zero(); }
-
- NvVec3(float x, float y, float z)
- {
- v[0] = x;
- v[1] = y;
- v[2] = z;
- }
-
- NvVec3(NvVec3 const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- v[2] = that.v[2];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- v[2] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- NvVec3 &operator+=(NvVec3 const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- v[2] += that.v[2];
- return *this;
- }
-
- NvVec3 &operator-=(NvVec3 const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- v[2] -= that.v[2];
- return *this;
- }
-
- NvVec3 &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- v[2] *= s;
- return *this;
- }
-
- NvVec3 &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- v[2] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec3 const &a, NvVec3 const &b)
-{
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
-}
-
-inline NvVec3 operator+(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] + b.v[0], a.v[1] + b.v[1], a.v[2] + b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] - b.v[0], a.v[1] - b.v[1], a.v[2] - b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a)
-{
-
- return NvVec3(-a.v[0], -a.v[1], -a.v[2]);
-}
-
-inline NvVec3 operator*(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] * s, a.v[1] * s, a.v[2] * s);
-}
-
-inline NvVec3 operator*(float s, NvVec3 const &a)
-{
-
- return NvVec3(s * a.v[0], s * a.v[1], s * a.v[2]);
-}
-
-inline NvVec3 operator/(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] / s, a.v[1] / s, a.v[2] / s);
-}
-
-inline float magnitude(NvVec3 const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec3 normalize(NvVec3 const &v)
-{
- float l = magnitude(v);
- return NvVec3(v[0] / l, v[1] / l, v[2] / l);
-}
-
-inline NvVec3 cross(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[1] * b.v[2] - a.v[2] * b.v[1], a.v[2] * b.v[0] - a.v[0] * b.v[2],
- a.v[0] * b.v[1] - a.v[1] * b.v[0]);
-}
-
-inline bool operator==(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] == b.v[0] && a.v[1] == b.v[1] && a.v[2] == b.v[2]);
-}
-
-inline bool operator!=(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] != b.v[0] || a.v[1] != b.v[1] || a.v[2] != b.v[2]);
-}
-
-struct NvVec2f
-{
- union {
- struct
- {
- float x, y;
- float v[2];
- };
- };
-
- NvVec2f() { zero(); }
-
- NvVec2f(float x, float y)
- {
- v[0] = x;
- v[1] = y;
- }
-
- NvVec2f(NvVec2f const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- NvVec2f &operator+=(NvVec2f const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- return *this;
- }
-
- NvVec2f &operator-=(NvVec2f const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- return *this;
- }
-
- NvVec2f &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- return *this;
- }
-
- NvVec2f &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a[0] * b[0] + a[1] * b[1];
-}
-
-inline NvVec2f operator+(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] + b.v[0], a.v[1] + b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] - b.v[0], a.v[1] - b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a)
-{
-
- return NvVec2f(-a.v[0], -a.v[1]);
-}
-
-inline NvVec2f operator*(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] * s, a.v[1] * s);
-}
-
-inline NvVec2f operator*(float s, NvVec2f const &a)
-{
-
- return NvVec2f(s * a.v[0], s * a.v[1]);
-}
-
-inline NvVec2f operator/(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] / s, a.v[1] / s);
-}
-
-inline float magnitude(NvVec2f const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec2f normalize(NvVec2f const &v)
-{
- float l = dot(v, v);
- return NvVec2f(v[0] / l, v[1] / l);
-}
-
-inline float cross(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a.v[0] * b.v[1] - b.v[0] * a.v[1];
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/misc.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/misc.h
deleted file mode 100644
index 983410f3..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/misc.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_MISC_H
-#define INCLUDED_QT3DS_MATH_CPP_MISC_H
-
-inline bool nvIsPowerOfTwo(unsigned int i)
-{
- return (i & (i - 1)) == 0;
-}
-
-inline float nvDegToRadf(float d)
-{
- return d * 3.14159265358979323846f / 180.0f;
-}
-
-inline float nvRadToDegf(float r)
-{
- return r * 180.0f / 3.14159265358979323846f;
-}
-
-/*
- 'mod' differs from '%' in that it behaves correctly when either the
- numerator or denominator is negative.
-*/
-
-inline int nvMod(int n, int d)
-{
- int m = n % d;
- return (((m < 0) && (d > 0)) || ((m > 0) && (d < 0))) ? (m + d) : m;
-}
-
-inline int nvAbs(int n)
-{
- if (n < 0)
- return -n;
- return n;
-}
-
-inline int nvSign(int n)
-{
- if (n > 0)
- return 1;
- if (n < 0)
- return -1;
- return 0;
-}
-
-/*
- This returns the smallest amplitude value x such that
- nvMod(b + x, m) == a
-*/
-
-inline int nvDifMod(int a, int b, int m)
-{
-
- int x1 = a - b;
- int x2 = (x1 > 0) ? x1 - m : x1 + m;
- return (nvAbs(x1) < nvAbs(x2)) ? x1 : x2;
-}
-
-inline float nvWrapf(float a, float min, float max)
-{
-
- assert(max > min);
-
- float d = max - min;
- float s = a - min;
- float q = s / d;
- float m = q - floorf(q);
- return m * d + min;
-}
-
-inline float nvClampf(float a, float min, float max)
-{
- return (a < min) ? min : ((a > max) ? max : a);
-}
-
-inline int nvClampi(int i, int min, int max)
-{
- return (i < min) ? min : ((i > max) ? max : i);
-}
-
-inline float nvGaussian(float x, float s)
-{
- float c = s * sqrtf(2.0f * 3.14159265358979323846f);
- return expf(-(x * x) / (2.0f * s * s)) / c;
-}
-
-inline float nvLerpf(float a, float b, float t)
-{
- return a * (1.0f - t) + b * t;
-}
-
-inline float nvEasef(float t)
-{
-
- float t_2 = t * t;
- float t_3 = t_2 * t;
- return 3.0f * t_2 - 2.0f * t_3;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.cpp b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.cpp
deleted file mode 100644
index b83cb39e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_math.h"
-
-static const double a = 16807.0;
-static const double m = 2147483647.0;
-
-static double nextSeed(double seed)
-{
- double t = a * seed;
- return t - m * (double)((int)(t / m));
-}
-
-GLfloat NvRandf()
-{
- static double seed = 1.0;
- seed = nextSeed(seed);
- return (GLfloat)(seed * (1 / m));
-}
-
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime)
-{
- // kdGetTimeUST is never supposed to decrease (i.e. that
- // means it can't wrap, either. IIRC, it will wrap in
- // 593 years). So we ignore that option...
-
- // Used for frame-to-frame diffs, this will fit in 32b
- // as long as the times are < ~4.3s apart
- long long int diffTime = newTime - oldTime;
-
- // Need to find a better way to do this.
- // However, I believe we will be uSec precise (not run
- // out of mantissa bits for uSecs) as long as the diff
- // is < ~16s (1e-6 * (2^24))
- return ((GLfloat)diffTime) / 1.0e9f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.h
deleted file mode 100644
index 2ef7bba0..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_math.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_MATH_H
-#define _QT3DS_MATH_H
-
-#include <QtGui/qopengl.h>
-
-GLfloat NvRandf();
-
-/* These are the recommended "safer" ways to use GLfloat for time */
-
-/* Returns the seconds between the two given times */
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime);
-
-#define QT3DS_MILISECS_TO_UST(ms) ((long long int)(ms)*1000000)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.cpp b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.cpp
deleted file mode 100644
index e208ac31..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.cpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_matrix.h"
-
-int NvDifferentMatsf(GLfloat a[4][4], const GLfloat b[4][4])
-{
- return ((&a[3][3] < &b[0][0]) || (&b[3][3] < &a[0][0]));
-}
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-}
-
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
-}
-
-GLfloat NvVecLengthf(const GLfloat v[3])
-{
- return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-}
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3])
-{
- GLfloat const l = NvVecLengthf(v);
- r[0] = v[0] / l;
- r[1] = v[1] / l;
- r[2] = v[2] / l;
-}
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] + b[0];
- r[1] = a[1] + b[1];
- r[2] = a[2] + b[2];
-}
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] - b[0];
- r[1] = a[1] - b[1];
- r[2] = a[2] - b[2];
-}
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- GLfloat t[3];
-
- t[0] = a[1] * b[2] - a[2] * b[1];
- t[1] = a[2] * b[0] - a[0] * b[2];
- t[2] = a[0] * b[1] - a[1] * b[0];
-
- r[0] = t[0];
- r[1] = t[1];
- r[2] = t[2];
-}
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- GLfloat inv_w = 1.0f / (m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3]);
-
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * inv_w;
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * inv_w;
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * inv_w;
-}
-
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * a[3];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * a[3];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * a[3];
- r[3] = m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3] * a[3];
-}
-
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2];
-}
-
-static void NvMultMat3x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2];
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x4f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2] + a[3][0] * b[0][3];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2] + a[3][1] * b[0][3];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2] + a[3][2] * b[0][3];
- r[0][3] = a[0][3] * b[0][0] + a[1][3] * b[0][1] + a[2][3] * b[0][2] + a[3][3] * b[0][3];
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2] + a[3][0] * b[1][3];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2] + a[3][1] * b[1][3];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2] + a[3][2] * b[1][3];
- r[1][3] = a[0][3] * b[1][0] + a[1][3] * b[1][1] + a[2][3] * b[1][2] + a[3][3] * b[1][3];
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2] + a[3][0] * b[2][3];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2] + a[3][1] * b[2][3];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2] + a[3][2] * b[2][3];
- r[2][3] = a[0][3] * b[2][0] + a[1][3] * b[2][1] + a[2][3] * b[2][2] + a[3][3] * b[2][3];
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0] * b[3][3];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1] * b[3][3];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2] * b[3][3];
- r[3][3] = a[0][3] * b[3][0] + a[1][3] * b[3][1] + a[2][3] * b[3][2] + a[3][3] * b[3][3];
-}
-
-void NvMultMatf(GLfloat result[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((a[0][3] == 0.0f) && (a[1][3] == 0.0f) && (a[2][3] == 0.0f) && (a[2][3] == 1.0f)
- && (b[0][3] == 0.0f) && (b[1][3] == 0.0f) && (b[2][3] == 0.0f) && (b[2][3] == 1.0f)) {
- if ((a[3][0] == 0.0f) && (a[3][1] == 0.0f) && (a[3][2] == 0.0f) && (b[3][0] == 0.0f)
- && (b[3][1] == 0.0f) && (b[3][2] == 0.0f)) {
- NvMultMat3x3f(r, a, b);
- } else {
- NvMultMat4x3f(r, a, b);
- }
- } else {
- NvMultMat4x4f(r, a, b);
- }
-
- NvCopyMatf(result, r);
-}
-
-static void NvInvMat3x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- /* x */
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- /* y */
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- /* z */
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x4f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] * m[3][3] + m[0][0] * m[1][2] * m[2][3] * m[3][1]
- + m[0][0] * m[1][3] * m[2][1] * m[3][2] + m[0][1] * m[1][0] * m[2][3] * m[3][2]
- + m[0][1] * m[1][2] * m[2][0] * m[3][3] + m[0][1] * m[1][3] * m[2][2] * m[3][0]
- + m[0][2] * m[1][0] * m[2][1] * m[3][3] + m[0][2] * m[1][1] * m[2][3] * m[3][0]
- + m[0][2] * m[1][3] * m[2][0] * m[3][1] + m[0][3] * m[1][0] * m[2][2] * m[3][1]
- + m[0][3] * m[1][1] * m[2][0] * m[3][2] + m[0][3] * m[1][2] * m[2][1] * m[3][0]
- + -m[0][0] * m[1][1] * m[2][3] * m[3][2] + -m[0][0] * m[1][2] * m[2][1] * m[3][3]
- + -m[0][0] * m[1][3] * m[2][2] * m[3][1] + -m[0][1] * m[1][0] * m[2][2] * m[3][3]
- + -m[0][1] * m[1][2] * m[2][3] * m[3][0] + -m[0][1] * m[1][3] * m[2][0] * m[3][2]
- + -m[0][2] * m[1][0] * m[2][3] * m[3][1] + -m[0][2] * m[1][1] * m[2][0] * m[3][3]
- + -m[0][2] * m[1][3] * m[2][1] * m[3][0] + -m[0][3] * m[1][0] * m[2][1] * m[3][2]
- + -m[0][3] * m[1][1] * m[2][2] * m[3][0] + -m[0][3] * m[1][2] * m[2][0] * m[3][1];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] * m[3][3] + m[1][2] * m[2][3] * m[3][1]
- + m[1][3] * m[2][1] * m[3][2] + -m[1][1] * m[2][3] * m[3][2]
- + -m[1][2] * m[2][1] * m[3][3] + -m[1][3] * m[2][2] * m[3][1])
- / d;
-
- r[0][1] = (m[0][1] * m[2][3] * m[3][2] + m[0][2] * m[2][1] * m[3][3]
- + m[0][3] * m[2][2] * m[3][1] + -m[0][1] * m[2][2] * m[3][3]
- + -m[0][2] * m[2][3] * m[3][1] + -m[0][3] * m[2][1] * m[3][2])
- / d;
-
- r[0][2] = (m[0][1] * m[1][2] * m[3][3] + m[0][2] * m[1][3] * m[3][1]
- + m[0][3] * m[1][1] * m[3][2] + -m[0][1] * m[1][3] * m[3][2]
- + -m[0][2] * m[1][1] * m[3][3] + -m[0][3] * m[1][2] * m[3][1])
- / d;
-
- r[0][3] = (m[0][1] * m[1][3] * m[2][2] + m[0][2] * m[1][1] * m[2][3]
- + m[0][3] * m[1][2] * m[2][1] + -m[0][1] * m[1][2] * m[2][3]
- + -m[0][2] * m[1][3] * m[2][1] + -m[0][3] * m[1][1] * m[2][2])
- / d;
-
- r[1][0] = (m[1][0] * m[2][3] * m[3][2] + m[1][2] * m[2][0] * m[3][3]
- + m[1][3] * m[2][2] * m[3][0] + -m[1][0] * m[2][2] * m[3][3]
- + -m[1][2] * m[2][3] * m[3][0] + -m[1][3] * m[2][0] * m[3][2])
- / d;
-
- r[1][1] = (m[0][0] * m[2][2] * m[3][3] + m[0][2] * m[2][3] * m[3][0]
- + m[0][3] * m[2][0] * m[3][2] + -m[0][0] * m[2][3] * m[3][2]
- + -m[0][2] * m[2][0] * m[3][3] + -m[0][3] * m[2][2] * m[3][0])
- / d;
-
- r[1][2] = (m[0][0] * m[1][3] * m[3][2] + m[0][2] * m[1][0] * m[3][3]
- + m[0][3] * m[1][2] * m[3][0] + -m[0][0] * m[1][2] * m[3][3]
- + -m[0][2] * m[1][3] * m[3][0] + -m[0][3] * m[1][0] * m[3][2])
- / d;
-
- r[1][3] = (m[0][0] * m[1][2] * m[2][3] + m[0][2] * m[1][3] * m[2][0]
- + m[0][3] * m[1][0] * m[2][2] + -m[0][0] * m[1][3] * m[2][2]
- + -m[0][2] * m[1][0] * m[2][3] + -m[0][3] * m[1][2] * m[2][0])
- / d;
-
- r[2][0] = (m[1][0] * m[2][1] * m[3][3] + m[1][1] * m[2][3] * m[3][0]
- + m[1][3] * m[2][0] * m[3][1] + -m[1][0] * m[2][3] * m[3][1]
- + -m[1][1] * m[2][0] * m[3][3] + -m[1][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][1] =
- (-m[0][0] * m[2][1] * m[3][3] + -m[0][1] * m[2][3] * m[3][0] + -m[0][3] * m[2][0] * m[3][1]
- + m[0][0] * m[2][3] * m[3][1] + m[0][1] * m[2][0] * m[3][3] + m[0][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][2] = (m[0][0] * m[1][1] * m[3][3] + m[0][1] * m[1][3] * m[3][0]
- + m[0][3] * m[1][0] * m[3][1] + -m[0][0] * m[1][3] * m[3][1]
- + -m[0][1] * m[1][0] * m[3][3] + -m[0][3] * m[1][1] * m[3][0])
- / d;
-
- r[2][3] = (m[0][0] * m[1][3] * m[2][1] + m[0][1] * m[1][0] * m[2][3]
- + m[0][3] * m[1][1] * m[2][0] + -m[0][1] * m[1][3] * m[2][0]
- + -m[0][3] * m[1][0] * m[2][1] + -m[0][0] * m[1][1] * m[2][3])
- / d;
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = (m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1]
- + -m[0][1] * m[1][0] * m[2][2] + -m[0][2] * m[1][1] * m[2][0])
- / d;
-}
-
-void NvInvMatf(GLfloat result[4][4], const GLfloat m[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((m[0][3] == 0.0f) && (m[1][3] == 0.0f) && (m[2][3] == 0.0f) && (m[2][3] == 1.0f)) {
- if ((m[3][0] == 0.0f) && (m[3][1] == 0.0f) && (m[3][2] == 0.0f)) {
- NvInvMat3x3f(r, m);
- } else {
- NvInvMat4x3f(r, m);
- }
- } else {
- NvInvMat4x4f(r, m);
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildIdentityMatf(GLfloat r[4][4])
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = x;
- r[3][1] = y;
- r[3][2] = z;
- r[3][3] = 1.0f;
-}
-
-void NvMultTranslateMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y,
- GLfloat z)
-{
- GLfloat r[4][4]; /*temporary storage for result */
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[0][0] * x + m[1][0] * y + m[2][0] * z + m[3][0];
- r[3][1] = m[0][1] * x + m[1][1] * y + m[2][1] * z + m[3][1];
- r[3][2] = m[0][2] * x + m[1][2] * y + m[2][2] * z + m[3][2];
- r[3][3] = m[0][3] * x + m[1][3] * y + m[2][3] * z + m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = x;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = y;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = z;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultScaleMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * x;
- r[0][1] = m[0][1] * x;
- r[0][2] = m[0][2] * x;
- r[0][3] = m[0][3] * x;
-
- r[1][0] = m[1][0] * y;
- r[1][1] = m[1][1] * y;
- r[1][2] = m[1][2] * y;
- r[1][3] = m[1][3] * y;
-
- r[2][0] = m[2][0] * z;
- r[2][1] = m[2][1] * z;
- r[2][2] = m[2][2] * z;
- r[2][3] = m[2][3] * z;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians)
-{
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = c;
- r[1][2] = s;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = -s;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = 0.0f;
- r[0][2] = -s;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = s;
- r[2][1] = 0.0f;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = s;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = -s;
- r[1][1] = c;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultRotXRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0] * c + m[2][0] * s;
- r[1][1] = m[1][1] * c + m[2][1] * s;
- r[1][2] = m[1][2] * c + m[2][2] * s;
- r[1][3] = m[1][3] * c + m[2][3] * s;
-
- r[2][0] = m[1][0] * -s + m[2][0] * c;
- r[2][1] = m[1][1] * -s + m[2][1] * c;
- r[2][2] = m[1][2] * -s + m[2][2] * c;
- r[2][3] = m[1][3] * -s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotYRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[2][0] * -s;
- r[0][1] = m[0][1] * c + m[2][1] * -s;
- r[0][2] = m[0][2] * c + m[2][2] * -s;
- r[0][3] = m[0][3] * c + m[2][3] * -s;
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[0][0] * s + m[2][0] * c;
- r[2][1] = m[0][1] * s + m[2][1] * c;
- r[2][2] = m[0][2] * s + m[2][2] * c;
- r[2][3] = m[0][3] * s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotZRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[1][0] * s;
- r[0][1] = m[0][1] * c + m[1][1] * s;
- r[0][2] = m[0][2] * c + m[1][2] * s;
- r[0][3] = m[0][3] * c + m[1][3] * s;
-
- r[1][0] = m[0][0] * -s + m[1][0] * c;
- r[1][1] = m[0][1] * -s + m[1][1] * c;
- r[1][2] = m[0][2] * -s + m[1][2] * c;
- r[1][3] = m[0][3] * -s + m[1][3] * c;
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotRadMatf(GLfloat result[4][4], const GLfloat axis[3], GLfloat radians)
-{
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- /* build a matrix from the quat */
-
- result[0][0] = 1.0f - 2.0f * (j * j + k * k);
- result[0][1] = 2.0f * (i * j + r * k);
- result[0][2] = 2.0f * (i * k - r * j);
- result[0][3] = 0.0f;
-
- result[1][0] = 2.0f * (i * j - r * k);
- result[1][1] = 1.0f - 2.0f * (i * i + k * k);
- result[1][2] = 2.0f * (j * k + r * i);
- result[1][3] = 0.0f;
-
- result[2][0] = 2.0f * (i * k + r * j);
- result[2][1] = 2.0f * (j * k - r * i);
- result[2][2] = 1.0f - 2.0f * (i * i + j * j);
- result[2][3] = 0.0f;
-
- result[3][0] = 0.0f;
- result[3][1] = 0.0f;
- result[3][2] = 0.0f;
- result[3][3] = 1.0f;
-}
-
-void NvMultRotRadMatf(GLfloat result[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians)
-{
- GLfloat r[4][4];
-
- {
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat const dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- {
- /* build a matrix from the quat */
-
- GLfloat const a00 = 1.0f - 2.0f * (j * j + k * k);
- GLfloat const a01 = 2.0f * (i * j + r * k);
- GLfloat const a02 = 2.0f * (i * k - r * j);
-
- GLfloat const a10 = 2.0f * (i * j - r * k);
- GLfloat const a11 = 1.0f - 2.0f * (i * i + k * k);
- GLfloat const a12 = 2.0f * (j * k + r * i);
-
- GLfloat const a20 = 2.0f * (i * k + r * j);
- GLfloat const a21 = 2.0f * (j * k - r * i);
- GLfloat const a22 = 1.0f - 2.0f * (i * i + j * j);
-
- result[0][0] = m[0][0] * a00 + m[1][0] * a01 + m[2][0] * a02;
- result[0][1] = m[0][1] * a00 + m[1][1] * a01 + m[2][1] * a02;
- result[0][2] = m[0][2] * a00 + m[1][2] * a01 + m[2][2] * a02;
- result[0][3] = m[0][3] * a00 + m[1][3] * a01 + m[2][3] * a02;
-
- result[1][0] = m[0][0] * a10 + m[1][0] * a11 + m[2][0] * a12;
- result[1][1] = m[0][1] * a10 + m[1][1] * a11 + m[2][1] * a12;
- result[1][2] = m[0][2] * a10 + m[1][2] * a11 + m[2][2] * a12;
- result[1][3] = m[0][3] * a10 + m[1][3] * a11 + m[2][3] * a12;
-
- result[2][0] = m[0][0] * a20 + m[1][0] * a21 + m[2][0] * a22;
- result[2][1] = m[0][1] * a20 + m[1][1] * a21 + m[2][1] * a22;
- result[2][2] = m[0][2] * a20 + m[1][2] * a21 + m[2][2] * a22;
- result[2][3] = m[0][3] * a20 + m[1][3] * a21 + m[2][3] * a22;
-
- result[3][0] = m[3][0];
- result[3][1] = m[3][1];
- result[3][2] = m[3][2];
- result[3][3] = m[3][3];
- }
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotXRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotYRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotZRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotXRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotYRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotZRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees)
-{
- NvBuildRotRadMatf(r, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees)
-{
- NvMultRotRadMatf(r, m, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3])
-{
- GLfloat ev[3];
- GLfloat z[3];
- GLfloat x_tmp[3];
- GLfloat x[3];
- GLfloat y[3];
-
- NvSubVecf(ev, eye, obj);
-
- NvNormalizeVecf(z, ev);
-
- NvCrossProductf(x_tmp, up, z);
-
- NvNormalizeVecf(x, x_tmp);
-
- NvCrossProductf(y, z, x);
-
- r[0][0] = x[0];
- r[0][1] = y[0];
- r[0][2] = z[0];
- r[0][3] = 0.0f;
-
- r[1][0] = x[1];
- r[1][1] = y[1];
- r[1][2] = z[1];
- r[1][3] = 0.0f;
-
- r[2][0] = x[2];
- r[2][1] = y[2];
- r[2][2] = z[2];
- r[2][3] = 0.0f;
-
- r[3][0] = -x[0] * eye[0] + -x[1] * eye[1] + -x[2] * eye[2];
- r[3][1] = -y[0] * eye[0] + -y[1] * eye[1] + -y[2] * eye[2];
- r[3][2] = -z[0] * eye[0] + -z[1] * eye[1] + -z[2] * eye[2];
- r[3][3] = 1.0f;
-}
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const m00 = znear * 2.0f / (right - left);
- GLfloat const m11 = znear * 2.0f / (top - bottom);
- GLfloat const m22 = -(zfar + znear) / (zfar - znear);
-
- GLfloat const m20 = (right + left) / (right - left);
- GLfloat const m21 = (top + bottom) / (top - bottom);
-
- GLfloat const m32 = -(2.0f * zfar * znear) / (zfar - znear);
- GLfloat const m23 = -1.0f;
-
- r[0][0] = m00;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = m11;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = m20;
- r[2][1] = m21;
- r[2][2] = m22;
- r[2][3] = m23;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = m32;
- r[3][3] = 0.0f;
-}
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
- GLfloat const sz = -2.0f / (zfar - znear);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
- GLfloat const tz = -(zfar + znear) / (zfar - znear);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = sz;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = tz;
- r[3][3] = 1.0f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.h
deleted file mode 100644
index 5f567f06..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_matrix.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_MATRIX_H
-#define INCLUDED_MATRIX_H
-
-#include <QtGui/qopengl.h>
-
-#include <math.h>
-#include <assert.h>
-
-#define KD_FLT_EPSILON 1.19209290E-07F
-#define KD_DEG_TO_RAD_F 0.0174532924F
-#define KD_RAD_TO_DEG_F 57.2957802F
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4]);
-
-/* vector utilities */
-
-GLfloat NvVecLengthf(const GLfloat v[3]);
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3]);
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4]);
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-
-/* matrix utilities */
-
-void NvMultMatf(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4]);
-
-void NvInvMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-
-/* matrix building utilities */
-
-void NvBuildIdentityMatf(GLfloat r[4][4]);
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees);
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees);
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians);
-
-void NvBuildRotRadMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat radians);
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3]);
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top);
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-/* matrix concatenation utilities */
-
-void NvMultTranslateMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-void NvMultScaleMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees);
-
-void NvMultRotXRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotYRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotZRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-
-void NvMultRotRadMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.cpp b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.cpp
deleted file mode 100644
index e66420c6..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_quat.h"
-#include <stdlib.h>
-#ifdef _INTEGRITYPLATFORM
-#include <string.h>
-#else
-#include <memory.h>
-#endif
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4])
-{
- memcpy(r, q, 4 * sizeof(GLfloat));
-}
-
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4])
-{
- // Assumes that the quaternion is normalized!
- GLfloat x2 = q[0] * 2.0f;
- GLfloat y2 = q[1] * 2.0f;
- GLfloat z2 = q[2] * 2.0f;
- GLfloat xSq2 = x2 * q[0];
- GLfloat ySq2 = y2 * q[1];
- GLfloat zSq2 = z2 * q[2];
- GLfloat xy2 = x2 * q[1];
- GLfloat xz2 = x2 * q[2];
- GLfloat xw2 = x2 * q[3];
- GLfloat yz2 = y2 * q[2];
- GLfloat yw2 = y2 * q[3];
- GLfloat zw2 = z2 * q[3];
-
- /* Matrix is
- * | 1 - 2y^2 - 2z^2 2xy - 2zw 2xz + 2yw |
- * | 2xy + 2zw 1 - 2x^2 - 2z^2 2yz - 2xw |
- * | 2xz - 2yw 2yz + 2xw 1 - 2x^2 - 2y^2 |
- */
- r[0][0] = 1.0f - ySq2 - zSq2;
- r[0][1] = xy2 - zw2;
- r[0][2] = xz2 + yw2;
-
- r[1][0] = xy2 + zw2;
- r[1][1] = 1.0f - xSq2 - zSq2;
- r[1][2] = yz2 - xw2;
-
- r[2][0] = xz2 - yw2;
- r[2][1] = yz2 + xw2;
- r[2][2] = 1.0f - xSq2 - ySq2;
-}
-
-void NvQuatIdentity(GLfloat r[4])
-{
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = 1.0f;
-}
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3])
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = axis[0] * sina;
- r[1] = axis[1] * sina;
- r[2] = axis[2] * sina;
- r[3] = cosa;
-}
-
-void NvQuatX(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = sina;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatY(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = sina;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatZ(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = sina;
- r[3] = cosa;
-}
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatY(h, heading);
- NvQuatX(p, pitch);
- NvQuatZ(ro, roll);
-
- NvQuatMult(r, h, p);
- NvQuatMult(r, ro, r);
-}
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatZ(ro, roll);
- NvQuatX(p, pitch);
- NvQuatY(h, heading);
-
- NvQuatMult(r, p, h);
- NvQuatMult(r, r, ro);
-}
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4])
-{
- return q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3];
-}
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4])
-{
- const GLfloat q1x = q1[0];
- const GLfloat q1y = q1[1];
- const GLfloat q1z = q1[2];
- const GLfloat q1w = q1[3];
- const GLfloat q2x = q2[0];
- const GLfloat q2y = q2[1];
- const GLfloat q2z = q2[2];
- const GLfloat q2w = q2[3];
-
- r[0] = q1y * q2z - q2y * q1z + q1w * q2x + q2w * q1x;
- r[1] = q1z * q2x - q2z * q1x + q1w * q2y + q2w * q1y;
- r[2] = q1x * q2y - q2x * q1y + q1w * q2z + q2w * q1z;
- r[3] = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z;
-}
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t)
-{
- GLfloat omt = 1.0f - t;
-
- if (NvQuatDot(q1, q2) < 0.0f) {
- r[0] = -q1[0] * omt + q2[0] * t;
- r[1] = -q1[1] * omt + q2[1] * t;
- r[2] = -q1[2] * omt + q2[2] * t;
- r[3] = -q1[3] * omt + q2[3] * t;
- } else {
- r[0] = q1[0] * omt + q2[0] * t;
- r[1] = q1[1] * omt + q2[1] * t;
- r[2] = q1[2] * omt + q2[2] * t;
- r[3] = q1[3] * omt + q2[3] * t;
- }
-
- NvQuatNormalize(r, r);
-}
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4])
-{
- GLfloat invLength = 1.0f / sqrtf(NvQuatDot(q, q));
-
- r[0] = invLength * q[0];
- r[1] = invLength * q[1];
- r[2] = invLength * q[2];
- r[3] = invLength * q[3];
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.h
deleted file mode 100644
index 2e97c717..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_math/nv_quat.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QUAT_H
-#define INCLUDED_QUAT_H
-
-#include <QtGui/qopengl.h>
-
-#include <math.h>
-#include <assert.h>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4]);
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4]);
-
-void NvQuatIdentity(GLfloat r[4]);
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3]);
-
-void NvQuatX(GLfloat r[4], GLfloat radians);
-
-void NvQuatY(GLfloat r[4], GLfloat radians);
-
-void NvQuatZ(GLfloat r[4], GLfloat radians);
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t);
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4]);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_types.h b/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_types.h
deleted file mode 100644
index 1d1b0300..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/linux/libs/nv_types.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_TYPES_H
-#define __INCLUDED_QT3DS_TYPES_H
-
-typedef unsigned char NvU8; // 0 to 255
-typedef unsigned short NvU16; // 0 to 65535
-typedef unsigned int NvU32; // 0 to 4294967295
-typedef unsigned long long NvU64; // 0 to 18446744073709551615
-typedef signed char NvS8; // -128 to 127
-typedef signed short NvS16; // -32768 to 32767
-typedef signed int NvS32; // -2147483648 to 2147483647
-typedef signed long long NvS64; // 2^-63 to 2^63-1
-
-// Explicitly sized floats
-typedef float NvF32; // IEEE Single Precision (S1E8M23)
-typedef double NvF64; // IEEE Double Precision (S1E11M52)
-
-// Boolean type
-#define QT3DS_FALSE 0
-#define QT3DS_TRUE 1
-typedef NvU8 NvBool;
-
-// Result of sizeof operator
-typedef unsigned long NvSize;
-
-// Type large enough to hold a relative file offset
-typedef long NvOffset;
-
-// Base NULL type.
-#define QT3DS_NULL 0
-
-// Error related
-typedef enum {
- NvError_Success = 0,
- NvError_NotSupported,
- NvError_NotInitialized,
- NvError_BadParameter,
- NvError_InsufficientMemory,
- NvError_NoEntries,
- NvError_UnknownError,
-} NvError;
-
-#if 1 // defined(_DEBUG) // !!!!TBD TODO
-#define NvAssert(c)
-#else
-#define NvAssert(c) ((void)((c) ? 0 : (NvHandleAssertion(#c, __FILE__, __LINE__), 0)))
-#endif
-
-// Other standardized typedefs
-typedef NvU64 NvUST; // U64 unadjusted system time value
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.abc b/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.abc
deleted file mode 100644
index f7e3c2f6..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.abc
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.dds b/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.dds
deleted file mode 100644
index 5bde760b..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_256.dds
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.abc b/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.abc
deleted file mode 100644
index 2ff78757..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.abc
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.dds b/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.dds
deleted file mode 100644
index f9e76d94..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/courier+lucida_512.dds
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.frag b/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.frag
deleted file mode 100644
index e4673cf8..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.frag
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-uniform sampler2D fontTex;
-
-varying lowp vec4 col_var;
-varying lowp vec2 tex_var;
-
-void main()
-{
- gl_FragColor = texture2D(fontTex, tex_var).a * col_var;
-}
-
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.vert b/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.vert
deleted file mode 100644
index 9f307a2f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/assets/font.vert
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// this is set from higher level. think of it as the upper model matrix
-uniform mat4 pixelToClipMat;
-
-uniform vec4 col_uni;
-
-attribute vec2 pos_attr;
-attribute vec2 tex_attr;
-attribute vec4 col_attr;
-
-varying vec4 col_var;
-varying vec2 tex_var;
-
-void main()
-{
- // account for translation and rotation of the primitive into [-1,1] spatial default.
- gl_Position = pixelToClipMat * vec4(pos_attr.x, pos_attr.y, 0, 1);
-
- col_var = col_attr * col_uni;
- tex_var = tex_attr;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_color.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_color.h
deleted file mode 100644
index b9347529..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_color.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_COLOR_H
-#define _QT3DS_COLOR_H
-
-/** @file nv_color.h
- Simple abstraction for RGBA colors as parameters to various libraries/functions.
-*/
-
-/** Base type for a single color channel (8-bit unsigned). */
-typedef unsigned char NvPCColor8;
-
-//#define NV_COLOR_BREAKOLD
-#ifdef NV_COLOR_BREAKOLD // uses a struct to break backwards-compat and accidental uses
-
-typedef struct
-{
- NvPCColor8 r;
- NvPCColor8 g;
- NvPCColor8 b;
- NvPCColor8 a;
-} NvPackedColor;
-
-static const NvPackedColor gnvpcwhite = { 255, 255, 255, 255 };
-static const NvPackedColor gnvpcblack = { 0, 0, 0, 255 };
-
-#define NV_PACKED_COLOR(r, g, b, a) \
- { \
- (NvPCColor8)(r), (NvPCColor8)(g), (NvPCColor8)(b), (NvPCColor8)(a) \
- }
-
-#define NV_PC_PREDEF_WHITE gnvpcwhite
-#define NV_PC_PREDEF_BLACK gnvpcblack
-
-#define NV_PC_RED(c) (c.r)
-#define NV_PC_GREEN(c) (c.g)
-#define NV_PC_BLUE(c) (c.b)
-#define NV_PC_ALPHA(c) (c.a)
-
-#define NV_PC_PACK_UINT(c) (*(unsigned int *)(&(c)))
-
-#define NV_PC_EQUAL(x, y) ((x).r == (y).r && (x).g == (y).g && (x).b == (y).b && (x).a == (y).a)
-
-#else /* code that doesn't break old pass-as-uint stuff */
-
-/** Main type declaration for a packed 4-color construct. */
-typedef unsigned int NvPackedColor;
-
-/** A macro to build a packed color, passing in RGBA as four 8-bit integer values. */
-#define NV_PACKED_COLOR(r, g, b, a) \
- ((NvPackedColor)(((((int)(a)) & 0xFF) << 24) | ((((int)(b)) & 0xFF) << 16) \
- | ((((int)(g)) & 0xFF) << 8) | ((((int)(r)) & 0xFF))))
-
-/** A predefined constant for WHITE. */
-#define NV_PC_PREDEF_WHITE NV_PACKED_COLOR(0xFF, 0xFF, 0xFF, 0xFF)
-/** A predefined constant for BLACK. */
-#define NV_PC_PREDEF_BLACK NV_PACKED_COLOR(0x00, 0x00, 0x00, 0xFF)
-
-/** A macro for 'extracting' the red value from an NvPackedColor. */
-#define NV_PC_RED(c) ((c >> 0) & 0xff)
-/** A macro for 'extracting' the green value from an NvPackedColor. */
-#define NV_PC_GREEN(c) ((c >> 8) & 0xff)
-/** A macro for 'extracting' the blue value from an NvPackedColor. */
-#define NV_PC_BLUE(c) ((c >> 16) & 0xff)
-/** A macro for 'extracting' the alpha value from an NvPackedColor. */
-#define NV_PC_ALPHA(c) ((c >> 24) & 0xff)
-
-/** A macro requesting the packed color repacked into a 32-bit unsigned int.
- This is a no-op for the color-as-uint approach.
-*/
-#define NV_PC_PACK_UINT(c) (c)
-/** A macro for testing the equality of two NvPackedColors. */
-#define NV_PC_EQUAL(x, y) (x == y)
-#endif
-
-/** A macro for mapping a single packed color channel into its floating point [0,1] rep. */
-#define NV_PC_TO_FLOAT(c) (c / 255.0f)
-
-#endif /*_QT3DS_COLOR_H*/
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_debug.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_debug.h
deleted file mode 100644
index 2559dd6f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_debug.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_DEBUG_H
-#define __INCLUDED_QT3DS_DEBUG_H
-
-#define CT_ASSERT(tag, cond) enum { COMPILE_TIME_ASSERT__##tag = 1 / (cond) }
-
-#define dimof(x) (sizeof(x) / sizeof(x[0]))
-#include <android/log.h>
-
-#define DBG_DETAILED 0
-
-#if 0
-
- // the detailed prefix can be customised by setting DBG_DETAILED_PREFIX. See
- // below as a reference.
- // NOTE: fmt is the desired format string and must be in the prefix.
- //#ifndef DBG_DETAILED_PREFIX
- // #define DBG_DETAILED_PREFIX "%s, %s, line %d: " fmt, __FILE__, __FUNCTION__, __LINE__,
- //#endif
- //#define DEBUG_D_(fmt, args...)
- //#define DEBUG_D(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, (DBG_DETAILED_PREFIX) ## args)
-
-#else
-
-#ifdef STRINGIFY
-#pragma push_macro("STRINGIFY")
-#undef STRINGIFY
-#define STRINGIFYPUSHED_____
-#endif
-#define STRINGIFY(x) #x
-
-// debug macro, includes file name function name and line number
-#define TO(x) typeof(x)
-#define DEBUG_D_(file, line, fmt, args...) \
- __android_log_print(ANDROID_LOG_DEBUG, MODULE, file ", %s, line(" STRINGIFY(line) "): " fmt, \
- __FUNCTION__, ##args)
-#define DEBUG_D(fmt, args...) DEBUG_D_(__FILE__, __LINE__, fmt, ##args)
-
-#ifdef STRINGIFYPUSHED_____
-#undef STRINGIFYPUSHED_____
-#pragma pop_macro("STRINGIFY")
-#endif
-
-#endif
-
-// basic debug macro
-#define DEBUG_(fmt, args...) (__android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ##args))
-
-// Debug macro that can be switched to spew a file name,
-// function and line number using DEBUG_DETAILED
-#if DBG_DETAILED == 1
-#define DEBUG(fmt, args...) DEBUG_D(fmt, ##args)
-#else
-#define DEBUG(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ##args)
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_global.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_global.h
deleted file mode 100644
index 9d23d45f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_global.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_GLOBAL_H
-#define __INCLUDED_QT3DS_GLOBAL_H
-
-#include "nv_types.h"
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/NvVec.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/NvVec.h
deleted file mode 100644
index 4e5b09ce..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/NvVec.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_VEC_H
-#define INCLUDED_QT3DS_MATH_CPP_VEC_H
-
-#include "misc.h"
-
-struct _NvVec3
-{
- union {
- struct
- {
- float x, y, z;
- };
- float v[3];
- };
-};
-
-struct NvVec3 : public _NvVec3
-{
- NvVec3() { zero(); }
-
- NvVec3(float x, float y, float z)
- {
- v[0] = x;
- v[1] = y;
- v[2] = z;
- }
-
- NvVec3(NvVec3 const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- v[2] = that.v[2];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- v[2] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- NvVec3 &operator+=(NvVec3 const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- v[2] += that.v[2];
- return *this;
- }
-
- NvVec3 &operator-=(NvVec3 const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- v[2] -= that.v[2];
- return *this;
- }
-
- NvVec3 &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- v[2] *= s;
- return *this;
- }
-
- NvVec3 &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- v[2] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec3 const &a, NvVec3 const &b)
-{
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
-}
-
-inline NvVec3 operator+(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] + b.v[0], a.v[1] + b.v[1], a.v[2] + b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] - b.v[0], a.v[1] - b.v[1], a.v[2] - b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a)
-{
-
- return NvVec3(-a.v[0], -a.v[1], -a.v[2]);
-}
-
-inline NvVec3 operator*(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] * s, a.v[1] * s, a.v[2] * s);
-}
-
-inline NvVec3 operator*(float s, NvVec3 const &a)
-{
-
- return NvVec3(s * a.v[0], s * a.v[1], s * a.v[2]);
-}
-
-inline NvVec3 operator/(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] / s, a.v[1] / s, a.v[2] / s);
-}
-
-inline float magnitude(NvVec3 const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec3 normalize(NvVec3 const &v)
-{
- float l = magnitude(v);
- return NvVec3(v[0] / l, v[1] / l, v[2] / l);
-}
-
-inline NvVec3 cross(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[1] * b.v[2] - a.v[2] * b.v[1], a.v[2] * b.v[0] - a.v[0] * b.v[2],
- a.v[0] * b.v[1] - a.v[1] * b.v[0]);
-}
-
-inline bool operator==(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] == b.v[0] && a.v[1] == b.v[1] && a.v[2] == b.v[2]);
-}
-
-inline bool operator!=(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] != b.v[0] || a.v[1] != b.v[1] || a.v[2] != b.v[2]);
-}
-
-struct NvVec2f
-{
- union {
- struct
- {
- float x, y;
- float v[2];
- };
- };
-
- NvVec2f() { zero(); }
-
- NvVec2f(float x, float y)
- {
- v[0] = x;
- v[1] = y;
- }
-
- NvVec2f(NvVec2f const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- NvVec2f &operator+=(NvVec2f const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- return *this;
- }
-
- NvVec2f &operator-=(NvVec2f const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- return *this;
- }
-
- NvVec2f &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- return *this;
- }
-
- NvVec2f &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a[0] * b[0] + a[1] * b[1];
-}
-
-inline NvVec2f operator+(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] + b.v[0], a.v[1] + b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] - b.v[0], a.v[1] - b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a)
-{
-
- return NvVec2f(-a.v[0], -a.v[1]);
-}
-
-inline NvVec2f operator*(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] * s, a.v[1] * s);
-}
-
-inline NvVec2f operator*(float s, NvVec2f const &a)
-{
-
- return NvVec2f(s * a.v[0], s * a.v[1]);
-}
-
-inline NvVec2f operator/(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] / s, a.v[1] / s);
-}
-
-inline float magnitude(NvVec2f const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec2f normalize(NvVec2f const &v)
-{
- float l = dot(v, v);
- return NvVec2f(v[0] / l, v[1] / l);
-}
-
-inline float cross(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a.v[0] * b.v[1] - b.v[0] * a.v[1];
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/misc.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/misc.h
deleted file mode 100644
index 983410f3..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/misc.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_MISC_H
-#define INCLUDED_QT3DS_MATH_CPP_MISC_H
-
-inline bool nvIsPowerOfTwo(unsigned int i)
-{
- return (i & (i - 1)) == 0;
-}
-
-inline float nvDegToRadf(float d)
-{
- return d * 3.14159265358979323846f / 180.0f;
-}
-
-inline float nvRadToDegf(float r)
-{
- return r * 180.0f / 3.14159265358979323846f;
-}
-
-/*
- 'mod' differs from '%' in that it behaves correctly when either the
- numerator or denominator is negative.
-*/
-
-inline int nvMod(int n, int d)
-{
- int m = n % d;
- return (((m < 0) && (d > 0)) || ((m > 0) && (d < 0))) ? (m + d) : m;
-}
-
-inline int nvAbs(int n)
-{
- if (n < 0)
- return -n;
- return n;
-}
-
-inline int nvSign(int n)
-{
- if (n > 0)
- return 1;
- if (n < 0)
- return -1;
- return 0;
-}
-
-/*
- This returns the smallest amplitude value x such that
- nvMod(b + x, m) == a
-*/
-
-inline int nvDifMod(int a, int b, int m)
-{
-
- int x1 = a - b;
- int x2 = (x1 > 0) ? x1 - m : x1 + m;
- return (nvAbs(x1) < nvAbs(x2)) ? x1 : x2;
-}
-
-inline float nvWrapf(float a, float min, float max)
-{
-
- assert(max > min);
-
- float d = max - min;
- float s = a - min;
- float q = s / d;
- float m = q - floorf(q);
- return m * d + min;
-}
-
-inline float nvClampf(float a, float min, float max)
-{
- return (a < min) ? min : ((a > max) ? max : a);
-}
-
-inline int nvClampi(int i, int min, int max)
-{
- return (i < min) ? min : ((i > max) ? max : i);
-}
-
-inline float nvGaussian(float x, float s)
-{
- float c = s * sqrtf(2.0f * 3.14159265358979323846f);
- return expf(-(x * x) / (2.0f * s * s)) / c;
-}
-
-inline float nvLerpf(float a, float b, float t)
-{
- return a * (1.0f - t) + b * t;
-}
-
-inline float nvEasef(float t)
-{
-
- float t_2 = t * t;
- float t_3 = t_2 * t;
- return 3.0f * t_2 - 2.0f * t_3;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.cpp b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.cpp
deleted file mode 100644
index b83cb39e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_math.h"
-
-static const double a = 16807.0;
-static const double m = 2147483647.0;
-
-static double nextSeed(double seed)
-{
- double t = a * seed;
- return t - m * (double)((int)(t / m));
-}
-
-GLfloat NvRandf()
-{
- static double seed = 1.0;
- seed = nextSeed(seed);
- return (GLfloat)(seed * (1 / m));
-}
-
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime)
-{
- // kdGetTimeUST is never supposed to decrease (i.e. that
- // means it can't wrap, either. IIRC, it will wrap in
- // 593 years). So we ignore that option...
-
- // Used for frame-to-frame diffs, this will fit in 32b
- // as long as the times are < ~4.3s apart
- long long int diffTime = newTime - oldTime;
-
- // Need to find a better way to do this.
- // However, I believe we will be uSec precise (not run
- // out of mantissa bits for uSecs) as long as the diff
- // is < ~16s (1e-6 * (2^24))
- return ((GLfloat)diffTime) / 1.0e9f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.h
deleted file mode 100644
index e777e409..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_math.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_MATH_H
-#define _QT3DS_MATH_H
-
-#include <OpenGL/gl.h>
-
-GLfloat NvRandf();
-
-/* These are the recommended "safer" ways to use GLfloat for time */
-
-/* Returns the seconds between the two given times */
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime);
-
-#define QT3DS_MILISECS_TO_UST(ms) ((long long int)(ms)*1000000)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.cpp b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.cpp
deleted file mode 100644
index e208ac31..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.cpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_matrix.h"
-
-int NvDifferentMatsf(GLfloat a[4][4], const GLfloat b[4][4])
-{
- return ((&a[3][3] < &b[0][0]) || (&b[3][3] < &a[0][0]));
-}
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-}
-
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
-}
-
-GLfloat NvVecLengthf(const GLfloat v[3])
-{
- return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-}
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3])
-{
- GLfloat const l = NvVecLengthf(v);
- r[0] = v[0] / l;
- r[1] = v[1] / l;
- r[2] = v[2] / l;
-}
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] + b[0];
- r[1] = a[1] + b[1];
- r[2] = a[2] + b[2];
-}
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] - b[0];
- r[1] = a[1] - b[1];
- r[2] = a[2] - b[2];
-}
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- GLfloat t[3];
-
- t[0] = a[1] * b[2] - a[2] * b[1];
- t[1] = a[2] * b[0] - a[0] * b[2];
- t[2] = a[0] * b[1] - a[1] * b[0];
-
- r[0] = t[0];
- r[1] = t[1];
- r[2] = t[2];
-}
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- GLfloat inv_w = 1.0f / (m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3]);
-
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * inv_w;
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * inv_w;
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * inv_w;
-}
-
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * a[3];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * a[3];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * a[3];
- r[3] = m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3] * a[3];
-}
-
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2];
-}
-
-static void NvMultMat3x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2];
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x4f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2] + a[3][0] * b[0][3];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2] + a[3][1] * b[0][3];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2] + a[3][2] * b[0][3];
- r[0][3] = a[0][3] * b[0][0] + a[1][3] * b[0][1] + a[2][3] * b[0][2] + a[3][3] * b[0][3];
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2] + a[3][0] * b[1][3];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2] + a[3][1] * b[1][3];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2] + a[3][2] * b[1][3];
- r[1][3] = a[0][3] * b[1][0] + a[1][3] * b[1][1] + a[2][3] * b[1][2] + a[3][3] * b[1][3];
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2] + a[3][0] * b[2][3];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2] + a[3][1] * b[2][3];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2] + a[3][2] * b[2][3];
- r[2][3] = a[0][3] * b[2][0] + a[1][3] * b[2][1] + a[2][3] * b[2][2] + a[3][3] * b[2][3];
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0] * b[3][3];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1] * b[3][3];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2] * b[3][3];
- r[3][3] = a[0][3] * b[3][0] + a[1][3] * b[3][1] + a[2][3] * b[3][2] + a[3][3] * b[3][3];
-}
-
-void NvMultMatf(GLfloat result[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((a[0][3] == 0.0f) && (a[1][3] == 0.0f) && (a[2][3] == 0.0f) && (a[2][3] == 1.0f)
- && (b[0][3] == 0.0f) && (b[1][3] == 0.0f) && (b[2][3] == 0.0f) && (b[2][3] == 1.0f)) {
- if ((a[3][0] == 0.0f) && (a[3][1] == 0.0f) && (a[3][2] == 0.0f) && (b[3][0] == 0.0f)
- && (b[3][1] == 0.0f) && (b[3][2] == 0.0f)) {
- NvMultMat3x3f(r, a, b);
- } else {
- NvMultMat4x3f(r, a, b);
- }
- } else {
- NvMultMat4x4f(r, a, b);
- }
-
- NvCopyMatf(result, r);
-}
-
-static void NvInvMat3x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- /* x */
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- /* y */
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- /* z */
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x4f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] * m[3][3] + m[0][0] * m[1][2] * m[2][3] * m[3][1]
- + m[0][0] * m[1][3] * m[2][1] * m[3][2] + m[0][1] * m[1][0] * m[2][3] * m[3][2]
- + m[0][1] * m[1][2] * m[2][0] * m[3][3] + m[0][1] * m[1][3] * m[2][2] * m[3][0]
- + m[0][2] * m[1][0] * m[2][1] * m[3][3] + m[0][2] * m[1][1] * m[2][3] * m[3][0]
- + m[0][2] * m[1][3] * m[2][0] * m[3][1] + m[0][3] * m[1][0] * m[2][2] * m[3][1]
- + m[0][3] * m[1][1] * m[2][0] * m[3][2] + m[0][3] * m[1][2] * m[2][1] * m[3][0]
- + -m[0][0] * m[1][1] * m[2][3] * m[3][2] + -m[0][0] * m[1][2] * m[2][1] * m[3][3]
- + -m[0][0] * m[1][3] * m[2][2] * m[3][1] + -m[0][1] * m[1][0] * m[2][2] * m[3][3]
- + -m[0][1] * m[1][2] * m[2][3] * m[3][0] + -m[0][1] * m[1][3] * m[2][0] * m[3][2]
- + -m[0][2] * m[1][0] * m[2][3] * m[3][1] + -m[0][2] * m[1][1] * m[2][0] * m[3][3]
- + -m[0][2] * m[1][3] * m[2][1] * m[3][0] + -m[0][3] * m[1][0] * m[2][1] * m[3][2]
- + -m[0][3] * m[1][1] * m[2][2] * m[3][0] + -m[0][3] * m[1][2] * m[2][0] * m[3][1];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] * m[3][3] + m[1][2] * m[2][3] * m[3][1]
- + m[1][3] * m[2][1] * m[3][2] + -m[1][1] * m[2][3] * m[3][2]
- + -m[1][2] * m[2][1] * m[3][3] + -m[1][3] * m[2][2] * m[3][1])
- / d;
-
- r[0][1] = (m[0][1] * m[2][3] * m[3][2] + m[0][2] * m[2][1] * m[3][3]
- + m[0][3] * m[2][2] * m[3][1] + -m[0][1] * m[2][2] * m[3][3]
- + -m[0][2] * m[2][3] * m[3][1] + -m[0][3] * m[2][1] * m[3][2])
- / d;
-
- r[0][2] = (m[0][1] * m[1][2] * m[3][3] + m[0][2] * m[1][3] * m[3][1]
- + m[0][3] * m[1][1] * m[3][2] + -m[0][1] * m[1][3] * m[3][2]
- + -m[0][2] * m[1][1] * m[3][3] + -m[0][3] * m[1][2] * m[3][1])
- / d;
-
- r[0][3] = (m[0][1] * m[1][3] * m[2][2] + m[0][2] * m[1][1] * m[2][3]
- + m[0][3] * m[1][2] * m[2][1] + -m[0][1] * m[1][2] * m[2][3]
- + -m[0][2] * m[1][3] * m[2][1] + -m[0][3] * m[1][1] * m[2][2])
- / d;
-
- r[1][0] = (m[1][0] * m[2][3] * m[3][2] + m[1][2] * m[2][0] * m[3][3]
- + m[1][3] * m[2][2] * m[3][0] + -m[1][0] * m[2][2] * m[3][3]
- + -m[1][2] * m[2][3] * m[3][0] + -m[1][3] * m[2][0] * m[3][2])
- / d;
-
- r[1][1] = (m[0][0] * m[2][2] * m[3][3] + m[0][2] * m[2][3] * m[3][0]
- + m[0][3] * m[2][0] * m[3][2] + -m[0][0] * m[2][3] * m[3][2]
- + -m[0][2] * m[2][0] * m[3][3] + -m[0][3] * m[2][2] * m[3][0])
- / d;
-
- r[1][2] = (m[0][0] * m[1][3] * m[3][2] + m[0][2] * m[1][0] * m[3][3]
- + m[0][3] * m[1][2] * m[3][0] + -m[0][0] * m[1][2] * m[3][3]
- + -m[0][2] * m[1][3] * m[3][0] + -m[0][3] * m[1][0] * m[3][2])
- / d;
-
- r[1][3] = (m[0][0] * m[1][2] * m[2][3] + m[0][2] * m[1][3] * m[2][0]
- + m[0][3] * m[1][0] * m[2][2] + -m[0][0] * m[1][3] * m[2][2]
- + -m[0][2] * m[1][0] * m[2][3] + -m[0][3] * m[1][2] * m[2][0])
- / d;
-
- r[2][0] = (m[1][0] * m[2][1] * m[3][3] + m[1][1] * m[2][3] * m[3][0]
- + m[1][3] * m[2][0] * m[3][1] + -m[1][0] * m[2][3] * m[3][1]
- + -m[1][1] * m[2][0] * m[3][3] + -m[1][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][1] =
- (-m[0][0] * m[2][1] * m[3][3] + -m[0][1] * m[2][3] * m[3][0] + -m[0][3] * m[2][0] * m[3][1]
- + m[0][0] * m[2][3] * m[3][1] + m[0][1] * m[2][0] * m[3][3] + m[0][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][2] = (m[0][0] * m[1][1] * m[3][3] + m[0][1] * m[1][3] * m[3][0]
- + m[0][3] * m[1][0] * m[3][1] + -m[0][0] * m[1][3] * m[3][1]
- + -m[0][1] * m[1][0] * m[3][3] + -m[0][3] * m[1][1] * m[3][0])
- / d;
-
- r[2][3] = (m[0][0] * m[1][3] * m[2][1] + m[0][1] * m[1][0] * m[2][3]
- + m[0][3] * m[1][1] * m[2][0] + -m[0][1] * m[1][3] * m[2][0]
- + -m[0][3] * m[1][0] * m[2][1] + -m[0][0] * m[1][1] * m[2][3])
- / d;
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = (m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1]
- + -m[0][1] * m[1][0] * m[2][2] + -m[0][2] * m[1][1] * m[2][0])
- / d;
-}
-
-void NvInvMatf(GLfloat result[4][4], const GLfloat m[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((m[0][3] == 0.0f) && (m[1][3] == 0.0f) && (m[2][3] == 0.0f) && (m[2][3] == 1.0f)) {
- if ((m[3][0] == 0.0f) && (m[3][1] == 0.0f) && (m[3][2] == 0.0f)) {
- NvInvMat3x3f(r, m);
- } else {
- NvInvMat4x3f(r, m);
- }
- } else {
- NvInvMat4x4f(r, m);
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildIdentityMatf(GLfloat r[4][4])
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = x;
- r[3][1] = y;
- r[3][2] = z;
- r[3][3] = 1.0f;
-}
-
-void NvMultTranslateMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y,
- GLfloat z)
-{
- GLfloat r[4][4]; /*temporary storage for result */
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[0][0] * x + m[1][0] * y + m[2][0] * z + m[3][0];
- r[3][1] = m[0][1] * x + m[1][1] * y + m[2][1] * z + m[3][1];
- r[3][2] = m[0][2] * x + m[1][2] * y + m[2][2] * z + m[3][2];
- r[3][3] = m[0][3] * x + m[1][3] * y + m[2][3] * z + m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = x;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = y;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = z;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultScaleMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * x;
- r[0][1] = m[0][1] * x;
- r[0][2] = m[0][2] * x;
- r[0][3] = m[0][3] * x;
-
- r[1][0] = m[1][0] * y;
- r[1][1] = m[1][1] * y;
- r[1][2] = m[1][2] * y;
- r[1][3] = m[1][3] * y;
-
- r[2][0] = m[2][0] * z;
- r[2][1] = m[2][1] * z;
- r[2][2] = m[2][2] * z;
- r[2][3] = m[2][3] * z;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians)
-{
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = c;
- r[1][2] = s;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = -s;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = 0.0f;
- r[0][2] = -s;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = s;
- r[2][1] = 0.0f;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = s;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = -s;
- r[1][1] = c;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultRotXRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0] * c + m[2][0] * s;
- r[1][1] = m[1][1] * c + m[2][1] * s;
- r[1][2] = m[1][2] * c + m[2][2] * s;
- r[1][3] = m[1][3] * c + m[2][3] * s;
-
- r[2][0] = m[1][0] * -s + m[2][0] * c;
- r[2][1] = m[1][1] * -s + m[2][1] * c;
- r[2][2] = m[1][2] * -s + m[2][2] * c;
- r[2][3] = m[1][3] * -s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotYRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[2][0] * -s;
- r[0][1] = m[0][1] * c + m[2][1] * -s;
- r[0][2] = m[0][2] * c + m[2][2] * -s;
- r[0][3] = m[0][3] * c + m[2][3] * -s;
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[0][0] * s + m[2][0] * c;
- r[2][1] = m[0][1] * s + m[2][1] * c;
- r[2][2] = m[0][2] * s + m[2][2] * c;
- r[2][3] = m[0][3] * s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotZRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[1][0] * s;
- r[0][1] = m[0][1] * c + m[1][1] * s;
- r[0][2] = m[0][2] * c + m[1][2] * s;
- r[0][3] = m[0][3] * c + m[1][3] * s;
-
- r[1][0] = m[0][0] * -s + m[1][0] * c;
- r[1][1] = m[0][1] * -s + m[1][1] * c;
- r[1][2] = m[0][2] * -s + m[1][2] * c;
- r[1][3] = m[0][3] * -s + m[1][3] * c;
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotRadMatf(GLfloat result[4][4], const GLfloat axis[3], GLfloat radians)
-{
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- /* build a matrix from the quat */
-
- result[0][0] = 1.0f - 2.0f * (j * j + k * k);
- result[0][1] = 2.0f * (i * j + r * k);
- result[0][2] = 2.0f * (i * k - r * j);
- result[0][3] = 0.0f;
-
- result[1][0] = 2.0f * (i * j - r * k);
- result[1][1] = 1.0f - 2.0f * (i * i + k * k);
- result[1][2] = 2.0f * (j * k + r * i);
- result[1][3] = 0.0f;
-
- result[2][0] = 2.0f * (i * k + r * j);
- result[2][1] = 2.0f * (j * k - r * i);
- result[2][2] = 1.0f - 2.0f * (i * i + j * j);
- result[2][3] = 0.0f;
-
- result[3][0] = 0.0f;
- result[3][1] = 0.0f;
- result[3][2] = 0.0f;
- result[3][3] = 1.0f;
-}
-
-void NvMultRotRadMatf(GLfloat result[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians)
-{
- GLfloat r[4][4];
-
- {
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat const dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- {
- /* build a matrix from the quat */
-
- GLfloat const a00 = 1.0f - 2.0f * (j * j + k * k);
- GLfloat const a01 = 2.0f * (i * j + r * k);
- GLfloat const a02 = 2.0f * (i * k - r * j);
-
- GLfloat const a10 = 2.0f * (i * j - r * k);
- GLfloat const a11 = 1.0f - 2.0f * (i * i + k * k);
- GLfloat const a12 = 2.0f * (j * k + r * i);
-
- GLfloat const a20 = 2.0f * (i * k + r * j);
- GLfloat const a21 = 2.0f * (j * k - r * i);
- GLfloat const a22 = 1.0f - 2.0f * (i * i + j * j);
-
- result[0][0] = m[0][0] * a00 + m[1][0] * a01 + m[2][0] * a02;
- result[0][1] = m[0][1] * a00 + m[1][1] * a01 + m[2][1] * a02;
- result[0][2] = m[0][2] * a00 + m[1][2] * a01 + m[2][2] * a02;
- result[0][3] = m[0][3] * a00 + m[1][3] * a01 + m[2][3] * a02;
-
- result[1][0] = m[0][0] * a10 + m[1][0] * a11 + m[2][0] * a12;
- result[1][1] = m[0][1] * a10 + m[1][1] * a11 + m[2][1] * a12;
- result[1][2] = m[0][2] * a10 + m[1][2] * a11 + m[2][2] * a12;
- result[1][3] = m[0][3] * a10 + m[1][3] * a11 + m[2][3] * a12;
-
- result[2][0] = m[0][0] * a20 + m[1][0] * a21 + m[2][0] * a22;
- result[2][1] = m[0][1] * a20 + m[1][1] * a21 + m[2][1] * a22;
- result[2][2] = m[0][2] * a20 + m[1][2] * a21 + m[2][2] * a22;
- result[2][3] = m[0][3] * a20 + m[1][3] * a21 + m[2][3] * a22;
-
- result[3][0] = m[3][0];
- result[3][1] = m[3][1];
- result[3][2] = m[3][2];
- result[3][3] = m[3][3];
- }
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotXRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotYRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotZRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotXRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotYRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotZRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees)
-{
- NvBuildRotRadMatf(r, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees)
-{
- NvMultRotRadMatf(r, m, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3])
-{
- GLfloat ev[3];
- GLfloat z[3];
- GLfloat x_tmp[3];
- GLfloat x[3];
- GLfloat y[3];
-
- NvSubVecf(ev, eye, obj);
-
- NvNormalizeVecf(z, ev);
-
- NvCrossProductf(x_tmp, up, z);
-
- NvNormalizeVecf(x, x_tmp);
-
- NvCrossProductf(y, z, x);
-
- r[0][0] = x[0];
- r[0][1] = y[0];
- r[0][2] = z[0];
- r[0][3] = 0.0f;
-
- r[1][0] = x[1];
- r[1][1] = y[1];
- r[1][2] = z[1];
- r[1][3] = 0.0f;
-
- r[2][0] = x[2];
- r[2][1] = y[2];
- r[2][2] = z[2];
- r[2][3] = 0.0f;
-
- r[3][0] = -x[0] * eye[0] + -x[1] * eye[1] + -x[2] * eye[2];
- r[3][1] = -y[0] * eye[0] + -y[1] * eye[1] + -y[2] * eye[2];
- r[3][2] = -z[0] * eye[0] + -z[1] * eye[1] + -z[2] * eye[2];
- r[3][3] = 1.0f;
-}
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const m00 = znear * 2.0f / (right - left);
- GLfloat const m11 = znear * 2.0f / (top - bottom);
- GLfloat const m22 = -(zfar + znear) / (zfar - znear);
-
- GLfloat const m20 = (right + left) / (right - left);
- GLfloat const m21 = (top + bottom) / (top - bottom);
-
- GLfloat const m32 = -(2.0f * zfar * znear) / (zfar - znear);
- GLfloat const m23 = -1.0f;
-
- r[0][0] = m00;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = m11;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = m20;
- r[2][1] = m21;
- r[2][2] = m22;
- r[2][3] = m23;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = m32;
- r[3][3] = 0.0f;
-}
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
- GLfloat const sz = -2.0f / (zfar - znear);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
- GLfloat const tz = -(zfar + znear) / (zfar - znear);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = sz;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = tz;
- r[3][3] = 1.0f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.h
deleted file mode 100644
index 0709f117..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_matrix.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_MATRIX_H
-#define INCLUDED_MATRIX_H
-
-#include <OpenGL/gl.h>
-#include <math.h>
-#include <assert.h>
-
-#define KD_FLT_EPSILON 1.19209290E-07F
-#define KD_DEG_TO_RAD_F 0.0174532924F
-#define KD_RAD_TO_DEG_F 57.2957802F
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4]);
-
-/* vector utilities */
-
-GLfloat NvVecLengthf(const GLfloat v[3]);
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3]);
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4]);
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-
-/* matrix utilities */
-
-void NvMultMatf(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4]);
-
-void NvInvMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-
-/* matrix building utilities */
-
-void NvBuildIdentityMatf(GLfloat r[4][4]);
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees);
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees);
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians);
-
-void NvBuildRotRadMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat radians);
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3]);
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top);
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-/* matrix concatenation utilities */
-
-void NvMultTranslateMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-void NvMultScaleMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees);
-
-void NvMultRotXRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotYRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotZRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-
-void NvMultRotRadMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.cpp b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.cpp
deleted file mode 100644
index ec497941..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_quat.h"
-#include <stdlib.h>
-#include <memory.h>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4])
-{
- memcpy(r, q, 4 * sizeof(GLfloat));
-}
-
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4])
-{
- // Assumes that the quaternion is normalized!
- GLfloat x2 = q[0] * 2.0f;
- GLfloat y2 = q[1] * 2.0f;
- GLfloat z2 = q[2] * 2.0f;
- GLfloat xSq2 = x2 * q[0];
- GLfloat ySq2 = y2 * q[1];
- GLfloat zSq2 = z2 * q[2];
- GLfloat xy2 = x2 * q[1];
- GLfloat xz2 = x2 * q[2];
- GLfloat xw2 = x2 * q[3];
- GLfloat yz2 = y2 * q[2];
- GLfloat yw2 = y2 * q[3];
- GLfloat zw2 = z2 * q[3];
-
- /* Matrix is
- * | 1 - 2y^2 - 2z^2 2xy - 2zw 2xz + 2yw |
- * | 2xy + 2zw 1 - 2x^2 - 2z^2 2yz - 2xw |
- * | 2xz - 2yw 2yz + 2xw 1 - 2x^2 - 2y^2 |
- */
- r[0][0] = 1.0f - ySq2 - zSq2;
- r[0][1] = xy2 - zw2;
- r[0][2] = xz2 + yw2;
-
- r[1][0] = xy2 + zw2;
- r[1][1] = 1.0f - xSq2 - zSq2;
- r[1][2] = yz2 - xw2;
-
- r[2][0] = xz2 - yw2;
- r[2][1] = yz2 + xw2;
- r[2][2] = 1.0f - xSq2 - ySq2;
-}
-
-void NvQuatIdentity(GLfloat r[4])
-{
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = 1.0f;
-}
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3])
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = axis[0] * sina;
- r[1] = axis[1] * sina;
- r[2] = axis[2] * sina;
- r[3] = cosa;
-}
-
-void NvQuatX(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = sina;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatY(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = sina;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatZ(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = sina;
- r[3] = cosa;
-}
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatY(h, heading);
- NvQuatX(p, pitch);
- NvQuatZ(ro, roll);
-
- NvQuatMult(r, h, p);
- NvQuatMult(r, ro, r);
-}
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatZ(ro, roll);
- NvQuatX(p, pitch);
- NvQuatY(h, heading);
-
- NvQuatMult(r, p, h);
- NvQuatMult(r, r, ro);
-}
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4])
-{
- return q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3];
-}
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4])
-{
- const GLfloat q1x = q1[0];
- const GLfloat q1y = q1[1];
- const GLfloat q1z = q1[2];
- const GLfloat q1w = q1[3];
- const GLfloat q2x = q2[0];
- const GLfloat q2y = q2[1];
- const GLfloat q2z = q2[2];
- const GLfloat q2w = q2[3];
-
- r[0] = q1y * q2z - q2y * q1z + q1w * q2x + q2w * q1x;
- r[1] = q1z * q2x - q2z * q1x + q1w * q2y + q2w * q1y;
- r[2] = q1x * q2y - q2x * q1y + q1w * q2z + q2w * q1z;
- r[3] = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z;
-}
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t)
-{
- GLfloat omt = 1.0f - t;
-
- if (NvQuatDot(q1, q2) < 0.0f) {
- r[0] = -q1[0] * omt + q2[0] * t;
- r[1] = -q1[1] * omt + q2[1] * t;
- r[2] = -q1[2] * omt + q2[2] * t;
- r[3] = -q1[3] * omt + q2[3] * t;
- } else {
- r[0] = q1[0] * omt + q2[0] * t;
- r[1] = q1[1] * omt + q2[1] * t;
- r[2] = q1[2] * omt + q2[2] * t;
- r[3] = q1[3] * omt + q2[3] * t;
- }
-
- NvQuatNormalize(r, r);
-}
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4])
-{
- GLfloat invLength = 1.0f / sqrtf(NvQuatDot(q, q));
-
- r[0] = invLength * q[0];
- r[1] = invLength * q[1];
- r[2] = invLength * q[2];
- r[3] = invLength * q[3];
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.h
deleted file mode 100644
index 2afdcb71..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_math/nv_quat.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QUAT_H
-#define INCLUDED_QUAT_H
-
-#include <OpenGL/gl.h>
-#include <math.h>
-#include <assert.h>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4]);
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4]);
-
-void NvQuatIdentity(GLfloat r[4]);
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3]);
-
-void NvQuatX(GLfloat r[4], GLfloat radians);
-
-void NvQuatY(GLfloat r[4], GLfloat radians);
-
-void NvQuatZ(GLfloat r[4], GLfloat radians);
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t);
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4]);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_types.h b/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_types.h
deleted file mode 100644
index 1d1b0300..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/macos/libs/nv_types.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_TYPES_H
-#define __INCLUDED_QT3DS_TYPES_H
-
-typedef unsigned char NvU8; // 0 to 255
-typedef unsigned short NvU16; // 0 to 65535
-typedef unsigned int NvU32; // 0 to 4294967295
-typedef unsigned long long NvU64; // 0 to 18446744073709551615
-typedef signed char NvS8; // -128 to 127
-typedef signed short NvS16; // -32768 to 32767
-typedef signed int NvS32; // -2147483648 to 2147483647
-typedef signed long long NvS64; // 2^-63 to 2^63-1
-
-// Explicitly sized floats
-typedef float NvF32; // IEEE Single Precision (S1E8M23)
-typedef double NvF64; // IEEE Double Precision (S1E11M52)
-
-// Boolean type
-#define QT3DS_FALSE 0
-#define QT3DS_TRUE 1
-typedef NvU8 NvBool;
-
-// Result of sizeof operator
-typedef unsigned long NvSize;
-
-// Type large enough to hold a relative file offset
-typedef long NvOffset;
-
-// Base NULL type.
-#define QT3DS_NULL 0
-
-// Error related
-typedef enum {
- NvError_Success = 0,
- NvError_NotSupported,
- NvError_NotInitialized,
- NvError_BadParameter,
- NvError_InsufficientMemory,
- NvError_NoEntries,
- NvError_UnknownError,
-} NvError;
-
-#if 1 // defined(_DEBUG) // !!!!TBD TODO
-#define NvAssert(c)
-#else
-#define NvAssert(c) ((void)((c) ? 0 : (NvHandleAssertion(#c, __FILE__, __LINE__), 0)))
-#endif
-
-// Other standardized typedefs
-typedef NvU64 NvUST; // U64 unadjusted system time value
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.abc b/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.abc
deleted file mode 100644
index f7e3c2f6..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.abc
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.dds b/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.dds
deleted file mode 100644
index 5bde760b..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_256.dds
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.abc b/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.abc
deleted file mode 100644
index 2ff78757..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.abc
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.dds b/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.dds
deleted file mode 100644
index f9e76d94..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/courier+lucida_512.dds
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.frag b/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.frag
deleted file mode 100644
index e4673cf8..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.frag
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-uniform sampler2D fontTex;
-
-varying lowp vec4 col_var;
-varying lowp vec2 tex_var;
-
-void main()
-{
- gl_FragColor = texture2D(fontTex, tex_var).a * col_var;
-}
-
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.vert b/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.vert
deleted file mode 100644
index 9f307a2f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/assets/font.vert
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// this is set from higher level. think of it as the upper model matrix
-uniform mat4 pixelToClipMat;
-
-uniform vec4 col_uni;
-
-attribute vec2 pos_attr;
-attribute vec2 tex_attr;
-attribute vec4 col_attr;
-
-varying vec4 col_var;
-varying vec2 tex_var;
-
-void main()
-{
- // account for translation and rotation of the primitive into [-1,1] spatial default.
- gl_Position = pixelToClipMat * vec4(pos_attr.x, pos_attr.y, 0, 1);
-
- col_var = col_attr * col_uni;
- tex_var = tex_attr;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_color.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_color.h
deleted file mode 100644
index b9347529..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_color.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_COLOR_H
-#define _QT3DS_COLOR_H
-
-/** @file nv_color.h
- Simple abstraction for RGBA colors as parameters to various libraries/functions.
-*/
-
-/** Base type for a single color channel (8-bit unsigned). */
-typedef unsigned char NvPCColor8;
-
-//#define NV_COLOR_BREAKOLD
-#ifdef NV_COLOR_BREAKOLD // uses a struct to break backwards-compat and accidental uses
-
-typedef struct
-{
- NvPCColor8 r;
- NvPCColor8 g;
- NvPCColor8 b;
- NvPCColor8 a;
-} NvPackedColor;
-
-static const NvPackedColor gnvpcwhite = { 255, 255, 255, 255 };
-static const NvPackedColor gnvpcblack = { 0, 0, 0, 255 };
-
-#define NV_PACKED_COLOR(r, g, b, a) \
- { \
- (NvPCColor8)(r), (NvPCColor8)(g), (NvPCColor8)(b), (NvPCColor8)(a) \
- }
-
-#define NV_PC_PREDEF_WHITE gnvpcwhite
-#define NV_PC_PREDEF_BLACK gnvpcblack
-
-#define NV_PC_RED(c) (c.r)
-#define NV_PC_GREEN(c) (c.g)
-#define NV_PC_BLUE(c) (c.b)
-#define NV_PC_ALPHA(c) (c.a)
-
-#define NV_PC_PACK_UINT(c) (*(unsigned int *)(&(c)))
-
-#define NV_PC_EQUAL(x, y) ((x).r == (y).r && (x).g == (y).g && (x).b == (y).b && (x).a == (y).a)
-
-#else /* code that doesn't break old pass-as-uint stuff */
-
-/** Main type declaration for a packed 4-color construct. */
-typedef unsigned int NvPackedColor;
-
-/** A macro to build a packed color, passing in RGBA as four 8-bit integer values. */
-#define NV_PACKED_COLOR(r, g, b, a) \
- ((NvPackedColor)(((((int)(a)) & 0xFF) << 24) | ((((int)(b)) & 0xFF) << 16) \
- | ((((int)(g)) & 0xFF) << 8) | ((((int)(r)) & 0xFF))))
-
-/** A predefined constant for WHITE. */
-#define NV_PC_PREDEF_WHITE NV_PACKED_COLOR(0xFF, 0xFF, 0xFF, 0xFF)
-/** A predefined constant for BLACK. */
-#define NV_PC_PREDEF_BLACK NV_PACKED_COLOR(0x00, 0x00, 0x00, 0xFF)
-
-/** A macro for 'extracting' the red value from an NvPackedColor. */
-#define NV_PC_RED(c) ((c >> 0) & 0xff)
-/** A macro for 'extracting' the green value from an NvPackedColor. */
-#define NV_PC_GREEN(c) ((c >> 8) & 0xff)
-/** A macro for 'extracting' the blue value from an NvPackedColor. */
-#define NV_PC_BLUE(c) ((c >> 16) & 0xff)
-/** A macro for 'extracting' the alpha value from an NvPackedColor. */
-#define NV_PC_ALPHA(c) ((c >> 24) & 0xff)
-
-/** A macro requesting the packed color repacked into a 32-bit unsigned int.
- This is a no-op for the color-as-uint approach.
-*/
-#define NV_PC_PACK_UINT(c) (c)
-/** A macro for testing the equality of two NvPackedColors. */
-#define NV_PC_EQUAL(x, y) (x == y)
-#endif
-
-/** A macro for mapping a single packed color channel into its floating point [0,1] rep. */
-#define NV_PC_TO_FLOAT(c) (c / 255.0f)
-
-#endif /*_QT3DS_COLOR_H*/
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_config/nv_config.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_config/nv_config.h
deleted file mode 100644
index fb0b88af..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_config/nv_config.h
+++ /dev/null
@@ -1,278 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2007-2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef _QT3DS_CONFIG_H
-#define _QT3DS_CONFIG_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <KD/kd.h>
-
-/** \file nv_config.h
- Support for block-based text config files.
-
- Supports:
- <ul>
- <li> C-style comment blocks
- <li> C++-style comment lines
- <li> Line continuation via backslash
- <li> Linux, Mac and Windows line endings
- <li> Arrays of tokens, broken out by line
- <li> Tokens are split by commas and whitespace
- <li> Quoted string tokens containing any characters
- </ul>
- */
-
-/** The in-memory representation of a loaded config file.
-
- This opaque data structure is passed by pointer to all of the
- configuration functions and represents the loaded configuration
- file. Once loaded, there is no mutable persistent state in this
- object. It is passed as const to all functions
-*/
-typedef struct NvConfigData NvConfigData;
-
-/** The representation of a sub-range of lines in a config file.
-
- This structure is application-readable and mutable, and is used to
- represent a subset of the lines in a config file. Generally, these
- ranges represent delineated blocks in the config file. Special versions
- of many of the config file functions take data ranges instead of
- entire config files
-
- @see NvConfigFindDelimitedBlock()
-*/
-typedef struct NvConfigDataRange
-{
- /** A reference to the "parent" config file for this range */
- NvConfigData *data;
- /** The first line of the range (inclusive) */
- KDint startLine;
- /** The last line of the range (inclusive) */
- KDint endLine;
-} NvConfigDataRange;
-
-/** Creates a config data object that represents an existing config file
-
- @return A pointer to the allocated config data, or NULL if the file cannot
- be found or does not conform to the basic config file format
- @param filename The path of the config file to be loaded
- @see NvConfigFree()
-*/
-NvConfigData *NvConfigCreateFromFile(const KDchar *filename);
-
-/** Creates a config data object from an-in memory string
-
- Useful when the config file is loaded from a larger, packed data file,
- or generated on-the-fly in the application. Note that the code does not
- automatically handle NULL-terminated strings
-
- @return A pointer to the allocated config data, or NULL if the string
- does not conform to the basic config file format
- @param fileBuffer A pointer to the start of the string of config data
- @param fileSize The length of the string in characters
- @see NvConfigFree()
-*/
-NvConfigData *NvConfigCreateFromBuffer(const KDchar *fileBuffer, KDint fileSize);
-
-/** Deletes an existing config file data object
-
- @param data A pointer to the data object to delete
-*/
-void NvConfigFree(NvConfigData *data);
-
-/** Returns the number of token-bearing lines in the config data object.
-
- This does not count merged lines, comment lines, or whitespace. This
- value is one greater than the maximum valid line index in the file
-
- @return The line count
- @param data A pointer to the data object
-*/
-KDint NvConfigGetLineCount(const NvConfigData *data);
-
-/** Returns the number of tokens in the indexed line
-
- @return The token count
- @param data A pointer to the data object
- @param line The line whose count is to be returned. This parameter must
- be at least 0 and must be less than the line count of the object
- @see NvConfigGetLineCount
-*/
-KDint NvConfigGetTokenCount(const NvConfigData *data, KDint line);
-
-/** Returns a NULL-terminated string token at the given line and token index
-
- The parameters are unchecked.
-
- @return A non-mutable token pointer for the referenced token
- @param data A pointer to the data object
- @param line The line whose token is to be returned. This parameter must
- be at least 0 and must be less than the line count of the object
- @param token The token index of the token to be returned. This parameter must
- be at least 0 and must be less than the token count of the line
- @see NvConfigGetLineCount
- @see NvConfigGetTokenCount
-*/
-const KDchar *NvConfigGetToken(const NvConfigData *data, KDint line, KDint token);
-
-/** Returns the string token converted to an integer
-
- Returns the string token at the given line and token index converted to an integer.
- The parameters are unchecked, and the string token is assumed to be convertible to
- an integer value.
-
- @return The integer value of the referenced token
- @param data A pointer to the data object
- @param line The line whose token is to be returned. This parameter must
- be at least 0 and must be less than the line count of the object
- @param token The token index of the token to be returned. This parameter must
- be at least 0 and must be less than the token count of the line
- @see NvConfigGetLineCount
- @see NvConfigGetTokenCount
-*/
-KDint NvConfigGetIntToken(const NvConfigData *data, KDint line, KDint token);
-
-/** Returns the string token converted to a floating-point value
-
- Returns the string token at the given line and token index converted to a
- floating-point number. The parameters are unchecked, and the string token
- is assumed to be convertible to a real value.
-
- @return The floating-point value of the referenced token
- @param data A pointer to the data object
- @param line The line whose token is to be returned. This parameter must
- be at least 0 and must be less than the line count of the object
- @param token The token index of the token to be returned. This parameter must
- be at least 0 and must be less than the token count of the line
- @see NvConfigGetLineCount
- @see NvConfigGetTokenCount
-*/
-KDfloat32 NvConfigGetFloatToken(const NvConfigData *data, KDint line, KDint token);
-
-/** Returns the count of lines in the config data whose leading token
- matches a given string
-
- The search starts at the indicated line and continues to the end of the file
-
- @return The count of matching lines
- @param data A pointer to the data object
- @param name The string to be matched (case-sensitive)
- @param startLine The line at which the search should start. This parameter must
- be at least 0 and must be less than the line count of the object
- @see NvConfigGetLineCount
-*/
-KDint NvConfigCountMatchingLines(const NvConfigData *data, const KDchar *name, KDint startLine);
-
-/** Returns the count of lines in the subrange of the config data
- whose leading token matches a given string
-
- The search is run only in the given subrange of the file
-
- @return The count of matching lines
- @param range A pointer to the subrange of the data object
- @param name The string to be matched (case-sensitive)
-*/
-KDint NvConfigCountMatchingLinesInRange(const NvConfigDataRange *range, const KDchar *name);
-
-/** Returns the index of the first line in the config data (at or after
- the given start line) whose leading token matches a given string
-
- The search starts at the indicated line and continues to the end of the
- file
-
- @return The index of the first matching line, or -1 if no match
- @param data A pointer to the data object
- @param name The string to be matched (case-sensitive)
- @param startLine The line at which the search should start. This parameter must
- be at least 0 and must be less than the line count of the object
- @see NvConfigGetLineCount
-*/
-KDint NvConfigFindMatchingLine(const NvConfigData *data, const KDchar *name, KDint startLine);
-
-/** Returns the index of the first line in the subrange of the config data
- whose leading token matches a given string
-
- The search is run only in the given subrange of the file
-
- @return The index of the first matching line, or -1 if no match
- @param range A pointer to the subrange of the data object
- @param name The string to be matched (case-sensitive)
-*/
-KDint NvConfigFindMatchingLineInRange(const NvConfigDataRange *range, const KDchar *name);
-
-/** Finds a matching token-delimited block in the file and returns it as a subrange.
-
- Searches for a token-delimited open/close block in the given line range.
- If the nested parameter is true, then additional nested open/close blocks
- are tracked and the returned block is the one that properly closes the
- given open block. If the nested flag is false, then the open/close are
- treated like C-comments, and the first closing token found is returned
-
- @return KD_TRUE if a block with both an open and a close token is found,
- KD_FALSE otherwise
- @param data A pointer to the data object
- @param openText The string token to be matched as the start of a block.
- (case-sensitive) Only the leading token of each line is tested
- @param closeText The string token to be matched as the end of a block.
- (case-sensitive) Only the leading token of each line is tested
- @param nested If KD_TRUE, C-bracket-style nesting is used to determine
- which end token is matched. If KD_FALSE, C-comment-style flat matching
- is used to match the end token.
- @param startLine The index of the first line to search (inclusive)
- @param endLine The index of the last line to search (inclusive)
- @param range Output: A pointer to the subrange of the data object. This
- should be a pointer to an allocated struct
-*/
-KDboolean NvConfigFindDelimitedBlock(const NvConfigData *data, const KDchar *openText,
- const KDchar *closeText, KDboolean nested, KDint startLine,
- KDint endLine, NvConfigDataRange *range);
-
-/** Returns the index of the first matching token in the given line
-
- Returns the index of the first token on the given line (if any) that
- matches the given string.
-
- @return The index of the matching string token in the line, or else -1 if
- the token is not found in the line
- @param data A pointer to the data object
- @param token The string to be matched (case-sensitive)
- @param line The line to search. This parameter must
- be at least 0 and must be less than the line count of the object
- @see NvConfigGetLineCount
-*/
-KDint NvConfigFindMatchingTokenInLine(const NvConfigData *data, const KDchar *token, KDint line);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_debug.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_debug.h
deleted file mode 100644
index 2559dd6f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_debug.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_DEBUG_H
-#define __INCLUDED_QT3DS_DEBUG_H
-
-#define CT_ASSERT(tag, cond) enum { COMPILE_TIME_ASSERT__##tag = 1 / (cond) }
-
-#define dimof(x) (sizeof(x) / sizeof(x[0]))
-#include <android/log.h>
-
-#define DBG_DETAILED 0
-
-#if 0
-
- // the detailed prefix can be customised by setting DBG_DETAILED_PREFIX. See
- // below as a reference.
- // NOTE: fmt is the desired format string and must be in the prefix.
- //#ifndef DBG_DETAILED_PREFIX
- // #define DBG_DETAILED_PREFIX "%s, %s, line %d: " fmt, __FILE__, __FUNCTION__, __LINE__,
- //#endif
- //#define DEBUG_D_(fmt, args...)
- //#define DEBUG_D(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, (DBG_DETAILED_PREFIX) ## args)
-
-#else
-
-#ifdef STRINGIFY
-#pragma push_macro("STRINGIFY")
-#undef STRINGIFY
-#define STRINGIFYPUSHED_____
-#endif
-#define STRINGIFY(x) #x
-
-// debug macro, includes file name function name and line number
-#define TO(x) typeof(x)
-#define DEBUG_D_(file, line, fmt, args...) \
- __android_log_print(ANDROID_LOG_DEBUG, MODULE, file ", %s, line(" STRINGIFY(line) "): " fmt, \
- __FUNCTION__, ##args)
-#define DEBUG_D(fmt, args...) DEBUG_D_(__FILE__, __LINE__, fmt, ##args)
-
-#ifdef STRINGIFYPUSHED_____
-#undef STRINGIFYPUSHED_____
-#pragma pop_macro("STRINGIFY")
-#endif
-
-#endif
-
-// basic debug macro
-#define DEBUG_(fmt, args...) (__android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ##args))
-
-// Debug macro that can be switched to spew a file name,
-// function and line number using DEBUG_DETAILED
-#if DBG_DETAILED == 1
-#define DEBUG(fmt, args...) DEBUG_D(fmt, ##args)
-#else
-#define DEBUG(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ##args)
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_global.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_global.h
deleted file mode 100644
index 9d23d45f..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_global.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_GLOBAL_H
-#define __INCLUDED_QT3DS_GLOBAL_H
-
-#include "nv_types.h"
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/NvVec.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/NvVec.h
deleted file mode 100644
index 4e5b09ce..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/NvVec.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_VEC_H
-#define INCLUDED_QT3DS_MATH_CPP_VEC_H
-
-#include "misc.h"
-
-struct _NvVec3
-{
- union {
- struct
- {
- float x, y, z;
- };
- float v[3];
- };
-};
-
-struct NvVec3 : public _NvVec3
-{
- NvVec3() { zero(); }
-
- NvVec3(float x, float y, float z)
- {
- v[0] = x;
- v[1] = y;
- v[2] = z;
- }
-
- NvVec3(NvVec3 const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- v[2] = that.v[2];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- v[2] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 3) && (i >= 0));
- return v[i];
- }
-
- NvVec3 &operator+=(NvVec3 const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- v[2] += that.v[2];
- return *this;
- }
-
- NvVec3 &operator-=(NvVec3 const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- v[2] -= that.v[2];
- return *this;
- }
-
- NvVec3 &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- v[2] *= s;
- return *this;
- }
-
- NvVec3 &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- v[2] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec3 const &a, NvVec3 const &b)
-{
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
-}
-
-inline NvVec3 operator+(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] + b.v[0], a.v[1] + b.v[1], a.v[2] + b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[0] - b.v[0], a.v[1] - b.v[1], a.v[2] - b.v[2]);
-}
-
-inline NvVec3 operator-(NvVec3 const &a)
-{
-
- return NvVec3(-a.v[0], -a.v[1], -a.v[2]);
-}
-
-inline NvVec3 operator*(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] * s, a.v[1] * s, a.v[2] * s);
-}
-
-inline NvVec3 operator*(float s, NvVec3 const &a)
-{
-
- return NvVec3(s * a.v[0], s * a.v[1], s * a.v[2]);
-}
-
-inline NvVec3 operator/(NvVec3 const &a, float s)
-{
-
- return NvVec3(a.v[0] / s, a.v[1] / s, a.v[2] / s);
-}
-
-inline float magnitude(NvVec3 const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec3 normalize(NvVec3 const &v)
-{
- float l = magnitude(v);
- return NvVec3(v[0] / l, v[1] / l, v[2] / l);
-}
-
-inline NvVec3 cross(NvVec3 const &a, NvVec3 const &b)
-{
-
- return NvVec3(a.v[1] * b.v[2] - a.v[2] * b.v[1], a.v[2] * b.v[0] - a.v[0] * b.v[2],
- a.v[0] * b.v[1] - a.v[1] * b.v[0]);
-}
-
-inline bool operator==(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] == b.v[0] && a.v[1] == b.v[1] && a.v[2] == b.v[2]);
-}
-
-inline bool operator!=(NvVec3 const &a, NvVec3 const &b)
-{
- return (a.v[0] != b.v[0] || a.v[1] != b.v[1] || a.v[2] != b.v[2]);
-}
-
-struct NvVec2f
-{
- union {
- struct
- {
- float x, y;
- float v[2];
- };
- };
-
- NvVec2f() { zero(); }
-
- NvVec2f(float x, float y)
- {
- v[0] = x;
- v[1] = y;
- }
-
- NvVec2f(NvVec2f const &that)
- {
- v[0] = that.v[0];
- v[1] = that.v[1];
- }
-
- inline void zero()
- {
- v[0] = 0.0f;
- v[1] = 0.0f;
- }
-
- inline float &operator[](int i)
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- inline float const &operator[](int i) const
- {
- assert((i < 2) && (i >= 0));
- return v[i];
- }
-
- NvVec2f &operator+=(NvVec2f const &that)
- {
- v[0] += that.v[0];
- v[1] += that.v[1];
- return *this;
- }
-
- NvVec2f &operator-=(NvVec2f const &that)
- {
- v[0] -= that.v[0];
- v[1] -= that.v[1];
- return *this;
- }
-
- NvVec2f &operator*=(float s)
- {
- v[0] *= s;
- v[1] *= s;
- return *this;
- }
-
- NvVec2f &operator/=(float s)
- {
- v[0] /= s;
- v[1] /= s;
- return *this;
- }
-};
-
-inline float dot(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a[0] * b[0] + a[1] * b[1];
-}
-
-inline NvVec2f operator+(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] + b.v[0], a.v[1] + b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a, NvVec2f const &b)
-{
-
- return NvVec2f(a.v[0] - b.v[0], a.v[1] - b.v[1]);
-}
-
-inline NvVec2f operator-(NvVec2f const &a)
-{
-
- return NvVec2f(-a.v[0], -a.v[1]);
-}
-
-inline NvVec2f operator*(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] * s, a.v[1] * s);
-}
-
-inline NvVec2f operator*(float s, NvVec2f const &a)
-{
-
- return NvVec2f(s * a.v[0], s * a.v[1]);
-}
-
-inline NvVec2f operator/(NvVec2f const &a, float s)
-{
-
- return NvVec2f(a.v[0] / s, a.v[1] / s);
-}
-
-inline float magnitude(NvVec2f const &v)
-{
- return sqrtf(dot(v, v));
-}
-
-inline NvVec2f normalize(NvVec2f const &v)
-{
- float l = dot(v, v);
- return NvVec2f(v[0] / l, v[1] / l);
-}
-
-inline float cross(NvVec2f const &a, NvVec2f const &b)
-{
-
- return a.v[0] * b.v[1] - b.v[0] * a.v[1];
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/misc.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/misc.h
deleted file mode 100644
index 983410f3..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/misc.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QT3DS_MATH_CPP_MISC_H
-#define INCLUDED_QT3DS_MATH_CPP_MISC_H
-
-inline bool nvIsPowerOfTwo(unsigned int i)
-{
- return (i & (i - 1)) == 0;
-}
-
-inline float nvDegToRadf(float d)
-{
- return d * 3.14159265358979323846f / 180.0f;
-}
-
-inline float nvRadToDegf(float r)
-{
- return r * 180.0f / 3.14159265358979323846f;
-}
-
-/*
- 'mod' differs from '%' in that it behaves correctly when either the
- numerator or denominator is negative.
-*/
-
-inline int nvMod(int n, int d)
-{
- int m = n % d;
- return (((m < 0) && (d > 0)) || ((m > 0) && (d < 0))) ? (m + d) : m;
-}
-
-inline int nvAbs(int n)
-{
- if (n < 0)
- return -n;
- return n;
-}
-
-inline int nvSign(int n)
-{
- if (n > 0)
- return 1;
- if (n < 0)
- return -1;
- return 0;
-}
-
-/*
- This returns the smallest amplitude value x such that
- nvMod(b + x, m) == a
-*/
-
-inline int nvDifMod(int a, int b, int m)
-{
-
- int x1 = a - b;
- int x2 = (x1 > 0) ? x1 - m : x1 + m;
- return (nvAbs(x1) < nvAbs(x2)) ? x1 : x2;
-}
-
-inline float nvWrapf(float a, float min, float max)
-{
-
- assert(max > min);
-
- float d = max - min;
- float s = a - min;
- float q = s / d;
- float m = q - floorf(q);
- return m * d + min;
-}
-
-inline float nvClampf(float a, float min, float max)
-{
- return (a < min) ? min : ((a > max) ? max : a);
-}
-
-inline int nvClampi(int i, int min, int max)
-{
- return (i < min) ? min : ((i > max) ? max : i);
-}
-
-inline float nvGaussian(float x, float s)
-{
- float c = s * sqrtf(2.0f * 3.14159265358979323846f);
- return expf(-(x * x) / (2.0f * s * s)) / c;
-}
-
-inline float nvLerpf(float a, float b, float t)
-{
- return a * (1.0f - t) + b * t;
-}
-
-inline float nvEasef(float t)
-{
-
- float t_2 = t * t;
- float t_3 = t_2 * t;
- return 3.0f * t_2 - 2.0f * t_3;
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.cpp b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.cpp
deleted file mode 100644
index b83cb39e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_math.h"
-
-static const double a = 16807.0;
-static const double m = 2147483647.0;
-
-static double nextSeed(double seed)
-{
- double t = a * seed;
- return t - m * (double)((int)(t / m));
-}
-
-GLfloat NvRandf()
-{
- static double seed = 1.0;
- seed = nextSeed(seed);
- return (GLfloat)(seed * (1 / m));
-}
-
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime)
-{
- // kdGetTimeUST is never supposed to decrease (i.e. that
- // means it can't wrap, either. IIRC, it will wrap in
- // 593 years). So we ignore that option...
-
- // Used for frame-to-frame diffs, this will fit in 32b
- // as long as the times are < ~4.3s apart
- long long int diffTime = newTime - oldTime;
-
- // Need to find a better way to do this.
- // However, I believe we will be uSec precise (not run
- // out of mantissa bits for uSecs) as long as the diff
- // is < ~16s (1e-6 * (2^24))
- return ((GLfloat)diffTime) / 1.0e9f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.h
deleted file mode 100644
index ec729a79..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_math.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _QT3DS_MATH_H
-#define _QT3DS_MATH_H
-
-#include <QtOpenGL/qgl.h>
-
-GLfloat NvRandf();
-
-/* These are the recommended "safer" ways to use GLfloat for time */
-
-/* Returns the seconds between the two given times */
-GLfloat NvClockDiffInSecs(long long int newTime, long long int oldTime);
-
-#define QT3DS_MILISECS_TO_UST(ms) ((long long int)(ms)*1000000)
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.cpp b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.cpp
deleted file mode 100644
index e208ac31..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.cpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_matrix.h"
-
-int NvDifferentMatsf(GLfloat a[4][4], const GLfloat b[4][4])
-{
- return ((&a[3][3] < &b[0][0]) || (&b[3][3] < &a[0][0]));
-}
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-}
-
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4])
-{
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
-}
-
-GLfloat NvVecLengthf(const GLfloat v[3])
-{
- return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-}
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3])
-{
- GLfloat const l = NvVecLengthf(v);
- r[0] = v[0] / l;
- r[1] = v[1] / l;
- r[2] = v[2] / l;
-}
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] + b[0];
- r[1] = a[1] + b[1];
- r[2] = a[2] + b[2];
-}
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- r[0] = a[0] - b[0];
- r[1] = a[1] - b[1];
- r[2] = a[2] - b[2];
-}
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3])
-{
- GLfloat t[3];
-
- t[0] = a[1] * b[2] - a[2] * b[1];
- t[1] = a[2] * b[0] - a[0] * b[2];
- t[2] = a[0] * b[1] - a[1] * b[0];
-
- r[0] = t[0];
- r[1] = t[1];
- r[2] = t[2];
-}
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- GLfloat inv_w = 1.0f / (m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3]);
-
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * inv_w;
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * inv_w;
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * inv_w;
-}
-
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2] + m[3][0] * a[3];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2] + m[3][1] * a[3];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2] + m[3][2] * a[3];
- r[3] = m[0][3] * a[0] + m[1][3] * a[1] + m[2][3] * a[2] + m[3][3] * a[3];
-}
-
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3])
-{
- r[0] = m[0][0] * a[0] + m[1][0] * a[1] + m[2][0] * a[2];
- r[1] = m[0][1] * a[0] + m[1][1] * a[1] + m[2][1] * a[2];
- r[2] = m[0][2] * a[0] + m[1][2] * a[1] + m[2][2] * a[2];
-}
-
-static void NvMultMat3x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x3f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2];
- r[0][3] = 0.0f;
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2];
- r[1][3] = 0.0f;
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2];
- r[2][3] = 0.0f;
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2];
- r[3][3] = 1.0f;
-}
-
-static void NvMultMat4x4f(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- assert(NvDifferentMatsf(r, a) && NvDifferentMatsf(r, b));
-
- r[0][0] = a[0][0] * b[0][0] + a[1][0] * b[0][1] + a[2][0] * b[0][2] + a[3][0] * b[0][3];
- r[0][1] = a[0][1] * b[0][0] + a[1][1] * b[0][1] + a[2][1] * b[0][2] + a[3][1] * b[0][3];
- r[0][2] = a[0][2] * b[0][0] + a[1][2] * b[0][1] + a[2][2] * b[0][2] + a[3][2] * b[0][3];
- r[0][3] = a[0][3] * b[0][0] + a[1][3] * b[0][1] + a[2][3] * b[0][2] + a[3][3] * b[0][3];
-
- r[1][0] = a[0][0] * b[1][0] + a[1][0] * b[1][1] + a[2][0] * b[1][2] + a[3][0] * b[1][3];
- r[1][1] = a[0][1] * b[1][0] + a[1][1] * b[1][1] + a[2][1] * b[1][2] + a[3][1] * b[1][3];
- r[1][2] = a[0][2] * b[1][0] + a[1][2] * b[1][1] + a[2][2] * b[1][2] + a[3][2] * b[1][3];
- r[1][3] = a[0][3] * b[1][0] + a[1][3] * b[1][1] + a[2][3] * b[1][2] + a[3][3] * b[1][3];
-
- r[2][0] = a[0][0] * b[2][0] + a[1][0] * b[2][1] + a[2][0] * b[2][2] + a[3][0] * b[2][3];
- r[2][1] = a[0][1] * b[2][0] + a[1][1] * b[2][1] + a[2][1] * b[2][2] + a[3][1] * b[2][3];
- r[2][2] = a[0][2] * b[2][0] + a[1][2] * b[2][1] + a[2][2] * b[2][2] + a[3][2] * b[2][3];
- r[2][3] = a[0][3] * b[2][0] + a[1][3] * b[2][1] + a[2][3] * b[2][2] + a[3][3] * b[2][3];
-
- r[3][0] = a[0][0] * b[3][0] + a[1][0] * b[3][1] + a[2][0] * b[3][2] + a[3][0] * b[3][3];
- r[3][1] = a[0][1] * b[3][0] + a[1][1] * b[3][1] + a[2][1] * b[3][2] + a[3][1] * b[3][3];
- r[3][2] = a[0][2] * b[3][0] + a[1][2] * b[3][1] + a[2][2] * b[3][2] + a[3][2] * b[3][3];
- r[3][3] = a[0][3] * b[3][0] + a[1][3] * b[3][1] + a[2][3] * b[3][2] + a[3][3] * b[3][3];
-}
-
-void NvMultMatf(GLfloat result[4][4], const GLfloat a[4][4], const GLfloat b[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((a[0][3] == 0.0f) && (a[1][3] == 0.0f) && (a[2][3] == 0.0f) && (a[2][3] == 1.0f)
- && (b[0][3] == 0.0f) && (b[1][3] == 0.0f) && (b[2][3] == 0.0f) && (b[2][3] == 1.0f)) {
- if ((a[3][0] == 0.0f) && (a[3][1] == 0.0f) && (a[3][2] == 0.0f) && (b[3][0] == 0.0f)
- && (b[3][1] == 0.0f) && (b[3][2] == 0.0f)) {
- NvMultMat3x3f(r, a, b);
- } else {
- NvMultMat4x3f(r, a, b);
- }
- } else {
- NvMultMat4x4f(r, a, b);
- }
-
- NvCopyMatf(result, r);
-}
-
-static void NvInvMat3x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x3f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1] + -m[0][1] * m[1][0] * m[2][2]
- + -m[0][2] * m[1][1] * m[2][0];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / d;
- r[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) / d;
- r[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / d;
- r[0][3] = 0.0f;
-
- r[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) / d;
- r[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / d;
- r[1][2] = (m[0][2] * m[1][0] - m[0][0] * m[1][2]) / d;
- r[1][3] = 0.0f;
-
- r[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / d;
- r[2][1] = (m[0][1] * m[2][0] - m[0][0] * m[2][1]) / d;
- r[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / d;
- r[2][3] = 0.0f;
-
- /* x */
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- /* y */
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- /* z */
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = 1.0f;
-}
-
-static void NvInvMat4x4f(GLfloat r[4][4], const GLfloat m[4][4])
-{
- GLfloat d = m[0][0] * m[1][1] * m[2][2] * m[3][3] + m[0][0] * m[1][2] * m[2][3] * m[3][1]
- + m[0][0] * m[1][3] * m[2][1] * m[3][2] + m[0][1] * m[1][0] * m[2][3] * m[3][2]
- + m[0][1] * m[1][2] * m[2][0] * m[3][3] + m[0][1] * m[1][3] * m[2][2] * m[3][0]
- + m[0][2] * m[1][0] * m[2][1] * m[3][3] + m[0][2] * m[1][1] * m[2][3] * m[3][0]
- + m[0][2] * m[1][3] * m[2][0] * m[3][1] + m[0][3] * m[1][0] * m[2][2] * m[3][1]
- + m[0][3] * m[1][1] * m[2][0] * m[3][2] + m[0][3] * m[1][2] * m[2][1] * m[3][0]
- + -m[0][0] * m[1][1] * m[2][3] * m[3][2] + -m[0][0] * m[1][2] * m[2][1] * m[3][3]
- + -m[0][0] * m[1][3] * m[2][2] * m[3][1] + -m[0][1] * m[1][0] * m[2][2] * m[3][3]
- + -m[0][1] * m[1][2] * m[2][3] * m[3][0] + -m[0][1] * m[1][3] * m[2][0] * m[3][2]
- + -m[0][2] * m[1][0] * m[2][3] * m[3][1] + -m[0][2] * m[1][1] * m[2][0] * m[3][3]
- + -m[0][2] * m[1][3] * m[2][1] * m[3][0] + -m[0][3] * m[1][0] * m[2][1] * m[3][2]
- + -m[0][3] * m[1][1] * m[2][2] * m[3][0] + -m[0][3] * m[1][2] * m[2][0] * m[3][1];
-
- assert(NvDifferentMatsf(r, m));
-
- r[0][0] = (m[1][1] * m[2][2] * m[3][3] + m[1][2] * m[2][3] * m[3][1]
- + m[1][3] * m[2][1] * m[3][2] + -m[1][1] * m[2][3] * m[3][2]
- + -m[1][2] * m[2][1] * m[3][3] + -m[1][3] * m[2][2] * m[3][1])
- / d;
-
- r[0][1] = (m[0][1] * m[2][3] * m[3][2] + m[0][2] * m[2][1] * m[3][3]
- + m[0][3] * m[2][2] * m[3][1] + -m[0][1] * m[2][2] * m[3][3]
- + -m[0][2] * m[2][3] * m[3][1] + -m[0][3] * m[2][1] * m[3][2])
- / d;
-
- r[0][2] = (m[0][1] * m[1][2] * m[3][3] + m[0][2] * m[1][3] * m[3][1]
- + m[0][3] * m[1][1] * m[3][2] + -m[0][1] * m[1][3] * m[3][2]
- + -m[0][2] * m[1][1] * m[3][3] + -m[0][3] * m[1][2] * m[3][1])
- / d;
-
- r[0][3] = (m[0][1] * m[1][3] * m[2][2] + m[0][2] * m[1][1] * m[2][3]
- + m[0][3] * m[1][2] * m[2][1] + -m[0][1] * m[1][2] * m[2][3]
- + -m[0][2] * m[1][3] * m[2][1] + -m[0][3] * m[1][1] * m[2][2])
- / d;
-
- r[1][0] = (m[1][0] * m[2][3] * m[3][2] + m[1][2] * m[2][0] * m[3][3]
- + m[1][3] * m[2][2] * m[3][0] + -m[1][0] * m[2][2] * m[3][3]
- + -m[1][2] * m[2][3] * m[3][0] + -m[1][3] * m[2][0] * m[3][2])
- / d;
-
- r[1][1] = (m[0][0] * m[2][2] * m[3][3] + m[0][2] * m[2][3] * m[3][0]
- + m[0][3] * m[2][0] * m[3][2] + -m[0][0] * m[2][3] * m[3][2]
- + -m[0][2] * m[2][0] * m[3][3] + -m[0][3] * m[2][2] * m[3][0])
- / d;
-
- r[1][2] = (m[0][0] * m[1][3] * m[3][2] + m[0][2] * m[1][0] * m[3][3]
- + m[0][3] * m[1][2] * m[3][0] + -m[0][0] * m[1][2] * m[3][3]
- + -m[0][2] * m[1][3] * m[3][0] + -m[0][3] * m[1][0] * m[3][2])
- / d;
-
- r[1][3] = (m[0][0] * m[1][2] * m[2][3] + m[0][2] * m[1][3] * m[2][0]
- + m[0][3] * m[1][0] * m[2][2] + -m[0][0] * m[1][3] * m[2][2]
- + -m[0][2] * m[1][0] * m[2][3] + -m[0][3] * m[1][2] * m[2][0])
- / d;
-
- r[2][0] = (m[1][0] * m[2][1] * m[3][3] + m[1][1] * m[2][3] * m[3][0]
- + m[1][3] * m[2][0] * m[3][1] + -m[1][0] * m[2][3] * m[3][1]
- + -m[1][1] * m[2][0] * m[3][3] + -m[1][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][1] =
- (-m[0][0] * m[2][1] * m[3][3] + -m[0][1] * m[2][3] * m[3][0] + -m[0][3] * m[2][0] * m[3][1]
- + m[0][0] * m[2][3] * m[3][1] + m[0][1] * m[2][0] * m[3][3] + m[0][3] * m[2][1] * m[3][0])
- / d;
-
- r[2][2] = (m[0][0] * m[1][1] * m[3][3] + m[0][1] * m[1][3] * m[3][0]
- + m[0][3] * m[1][0] * m[3][1] + -m[0][0] * m[1][3] * m[3][1]
- + -m[0][1] * m[1][0] * m[3][3] + -m[0][3] * m[1][1] * m[3][0])
- / d;
-
- r[2][3] = (m[0][0] * m[1][3] * m[2][1] + m[0][1] * m[1][0] * m[2][3]
- + m[0][3] * m[1][1] * m[2][0] + -m[0][1] * m[1][3] * m[2][0]
- + -m[0][3] * m[1][0] * m[2][1] + -m[0][0] * m[1][1] * m[2][3])
- / d;
-
- r[3][0] = (m[1][0] * m[2][2] * m[3][1] + m[1][1] * m[2][0] * m[3][2]
- + m[1][2] * m[2][1] * m[3][0] + -m[1][0] * m[2][1] * m[3][2]
- + -m[1][1] * m[2][2] * m[3][0] + -m[1][2] * m[2][0] * m[3][1])
- / d;
-
- r[3][1] = (m[0][0] * m[2][1] * m[3][2] + m[0][1] * m[2][2] * m[3][0]
- + m[0][2] * m[2][0] * m[3][1] + -m[0][0] * m[2][2] * m[3][1]
- + -m[0][1] * m[2][0] * m[3][2] + -m[0][2] * m[2][1] * m[3][0])
- / d;
-
- r[3][2] = (m[0][0] * m[1][2] * m[3][1] + m[0][1] * m[1][0] * m[3][2]
- + m[0][2] * m[1][1] * m[3][0] + -m[0][0] * m[1][1] * m[3][2]
- + -m[0][1] * m[1][2] * m[3][0] + -m[0][2] * m[1][0] * m[3][1])
- / d;
-
- r[3][3] = (m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0]
- + m[0][2] * m[1][0] * m[2][1] + -m[0][0] * m[1][2] * m[2][1]
- + -m[0][1] * m[1][0] * m[2][2] + -m[0][2] * m[1][1] * m[2][0])
- / d;
-}
-
-void NvInvMatf(GLfloat result[4][4], const GLfloat m[4][4])
-{
- /*
- Use a temporary matrix for the result and copy the temporary
- into the result when finished. Doing this instead of writing
- the result directly guarantees that the routine will work even
- if the result overlaps one or more of the arguments in
- memory.
- */
-
- GLfloat r[4][4];
-
- if ((m[0][3] == 0.0f) && (m[1][3] == 0.0f) && (m[2][3] == 0.0f) && (m[2][3] == 1.0f)) {
- if ((m[3][0] == 0.0f) && (m[3][1] == 0.0f) && (m[3][2] == 0.0f)) {
- NvInvMat3x3f(r, m);
- } else {
- NvInvMat4x3f(r, m);
- }
- } else {
- NvInvMat4x4f(r, m);
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildIdentityMatf(GLfloat r[4][4])
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = x;
- r[3][1] = y;
- r[3][2] = z;
- r[3][3] = 1.0f;
-}
-
-void NvMultTranslateMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y,
- GLfloat z)
-{
- GLfloat r[4][4]; /*temporary storage for result */
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[0][0] * x + m[1][0] * y + m[2][0] * z + m[3][0];
- r[3][1] = m[0][1] * x + m[1][1] * y + m[2][1] * z + m[3][1];
- r[3][2] = m[0][2] * x + m[1][2] * y + m[2][2] * z + m[3][2];
- r[3][3] = m[0][3] * x + m[1][3] * y + m[2][3] * z + m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
- r[0][0] = x;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = y;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = z;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultScaleMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z)
-{
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * x;
- r[0][1] = m[0][1] * x;
- r[0][2] = m[0][2] * x;
- r[0][3] = m[0][3] * x;
-
- r[1][0] = m[1][0] * y;
- r[1][1] = m[1][1] * y;
- r[1][2] = m[1][2] * y;
- r[1][3] = m[1][3] * y;
-
- r[2][0] = m[2][0] * z;
- r[2][1] = m[2][1] * z;
- r[2][2] = m[2][2] * z;
- r[2][3] = m[2][3] * z;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians)
-{
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = 1.0f;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = c;
- r[1][2] = s;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = -s;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = 0.0f;
- r[0][2] = -s;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = 1.0f;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = s;
- r[2][1] = 0.0f;
- r[2][2] = c;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- r[0][0] = c;
- r[0][1] = s;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = -s;
- r[1][1] = c;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvMultRotXRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0];
- r[0][1] = m[0][1];
- r[0][2] = m[0][2];
- r[0][3] = m[0][3];
-
- r[1][0] = m[1][0] * c + m[2][0] * s;
- r[1][1] = m[1][1] * c + m[2][1] * s;
- r[1][2] = m[1][2] * c + m[2][2] * s;
- r[1][3] = m[1][3] * c + m[2][3] * s;
-
- r[2][0] = m[1][0] * -s + m[2][0] * c;
- r[2][1] = m[1][1] * -s + m[2][1] * c;
- r[2][2] = m[1][2] * -s + m[2][2] * c;
- r[2][3] = m[1][3] * -s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotYRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[2][0] * -s;
- r[0][1] = m[0][1] * c + m[2][1] * -s;
- r[0][2] = m[0][2] * c + m[2][2] * -s;
- r[0][3] = m[0][3] * c + m[2][3] * -s;
-
- r[1][0] = m[1][0];
- r[1][1] = m[1][1];
- r[1][2] = m[1][2];
- r[1][3] = m[1][3];
-
- r[2][0] = m[0][0] * s + m[2][0] * c;
- r[2][1] = m[0][1] * s + m[2][1] * c;
- r[2][2] = m[0][2] * s + m[2][2] * c;
- r[2][3] = m[0][3] * s + m[2][3] * c;
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvMultRotZRadMatf(GLfloat result[4][4], const GLfloat m[4][4], GLfloat radians)
-{
-
- GLfloat const s = sinf(radians);
- GLfloat const c = cosf(radians);
-
- GLfloat r[4][4];
-
- r[0][0] = m[0][0] * c + m[1][0] * s;
- r[0][1] = m[0][1] * c + m[1][1] * s;
- r[0][2] = m[0][2] * c + m[1][2] * s;
- r[0][3] = m[0][3] * c + m[1][3] * s;
-
- r[1][0] = m[0][0] * -s + m[1][0] * c;
- r[1][1] = m[0][1] * -s + m[1][1] * c;
- r[1][2] = m[0][2] * -s + m[1][2] * c;
- r[1][3] = m[0][3] * -s + m[1][3] * c;
-
- r[2][0] = m[2][0];
- r[2][1] = m[2][1];
- r[2][2] = m[2][2];
- r[2][3] = m[2][3];
-
- r[3][0] = m[3][0];
- r[3][1] = m[3][1];
- r[3][2] = m[3][2];
- r[3][3] = m[3][3];
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotRadMatf(GLfloat result[4][4], const GLfloat axis[3], GLfloat radians)
-{
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- /* build a matrix from the quat */
-
- result[0][0] = 1.0f - 2.0f * (j * j + k * k);
- result[0][1] = 2.0f * (i * j + r * k);
- result[0][2] = 2.0f * (i * k - r * j);
- result[0][3] = 0.0f;
-
- result[1][0] = 2.0f * (i * j - r * k);
- result[1][1] = 1.0f - 2.0f * (i * i + k * k);
- result[1][2] = 2.0f * (j * k + r * i);
- result[1][3] = 0.0f;
-
- result[2][0] = 2.0f * (i * k + r * j);
- result[2][1] = 2.0f * (j * k - r * i);
- result[2][2] = 1.0f - 2.0f * (i * i + j * j);
- result[2][3] = 0.0f;
-
- result[3][0] = 0.0f;
- result[3][1] = 0.0f;
- result[3][2] = 0.0f;
- result[3][3] = 1.0f;
-}
-
-void NvMultRotRadMatf(GLfloat result[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians)
-{
- GLfloat r[4][4];
-
- {
- /* build a quat first */
-
- GLfloat i, j, k, r;
-
- /* should be */
- GLfloat const dst_l = sinf(radians / 2.0f);
-
- /* actually is */
- GLfloat const src_l = sqrtf(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);
-
- if (src_l <= KD_FLT_EPSILON) {
- i = 0.0f;
- j = 0.0f;
- k = 0.0f;
- r = 1.0f;
- } else {
- GLfloat const s = dst_l / src_l;
- i = axis[0] * s;
- j = axis[1] * s;
- k = axis[2] * s;
- r = cosf(radians / 2.0f);
- }
-
- {
- /* build a matrix from the quat */
-
- GLfloat const a00 = 1.0f - 2.0f * (j * j + k * k);
- GLfloat const a01 = 2.0f * (i * j + r * k);
- GLfloat const a02 = 2.0f * (i * k - r * j);
-
- GLfloat const a10 = 2.0f * (i * j - r * k);
- GLfloat const a11 = 1.0f - 2.0f * (i * i + k * k);
- GLfloat const a12 = 2.0f * (j * k + r * i);
-
- GLfloat const a20 = 2.0f * (i * k + r * j);
- GLfloat const a21 = 2.0f * (j * k - r * i);
- GLfloat const a22 = 1.0f - 2.0f * (i * i + j * j);
-
- result[0][0] = m[0][0] * a00 + m[1][0] * a01 + m[2][0] * a02;
- result[0][1] = m[0][1] * a00 + m[1][1] * a01 + m[2][1] * a02;
- result[0][2] = m[0][2] * a00 + m[1][2] * a01 + m[2][2] * a02;
- result[0][3] = m[0][3] * a00 + m[1][3] * a01 + m[2][3] * a02;
-
- result[1][0] = m[0][0] * a10 + m[1][0] * a11 + m[2][0] * a12;
- result[1][1] = m[0][1] * a10 + m[1][1] * a11 + m[2][1] * a12;
- result[1][2] = m[0][2] * a10 + m[1][2] * a11 + m[2][2] * a12;
- result[1][3] = m[0][3] * a10 + m[1][3] * a11 + m[2][3] * a12;
-
- result[2][0] = m[0][0] * a20 + m[1][0] * a21 + m[2][0] * a22;
- result[2][1] = m[0][1] * a20 + m[1][1] * a21 + m[2][1] * a22;
- result[2][2] = m[0][2] * a20 + m[1][2] * a21 + m[2][2] * a22;
- result[2][3] = m[0][3] * a20 + m[1][3] * a21 + m[2][3] * a22;
-
- result[3][0] = m[3][0];
- result[3][1] = m[3][1];
- result[3][2] = m[3][2];
- result[3][3] = m[3][3];
- }
- }
-
- NvCopyMatf(result, r);
-}
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotXRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotYRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees)
-{
- NvBuildRotZRadMatf(r, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotXRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotYRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees)
-{
- NvMultRotZRadMatf(r, m, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees)
-{
- NvBuildRotRadMatf(r, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees)
-{
- NvMultRotRadMatf(r, m, axis, degrees * KD_DEG_TO_RAD_F);
-}
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3])
-{
- GLfloat ev[3];
- GLfloat z[3];
- GLfloat x_tmp[3];
- GLfloat x[3];
- GLfloat y[3];
-
- NvSubVecf(ev, eye, obj);
-
- NvNormalizeVecf(z, ev);
-
- NvCrossProductf(x_tmp, up, z);
-
- NvNormalizeVecf(x, x_tmp);
-
- NvCrossProductf(y, z, x);
-
- r[0][0] = x[0];
- r[0][1] = y[0];
- r[0][2] = z[0];
- r[0][3] = 0.0f;
-
- r[1][0] = x[1];
- r[1][1] = y[1];
- r[1][2] = z[1];
- r[1][3] = 0.0f;
-
- r[2][0] = x[2];
- r[2][1] = y[2];
- r[2][2] = z[2];
- r[2][3] = 0.0f;
-
- r[3][0] = -x[0] * eye[0] + -x[1] * eye[1] + -x[2] * eye[2];
- r[3][1] = -y[0] * eye[0] + -y[1] * eye[1] + -y[2] * eye[2];
- r[3][2] = -z[0] * eye[0] + -z[1] * eye[1] + -z[2] * eye[2];
- r[3][3] = 1.0f;
-}
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const m00 = znear * 2.0f / (right - left);
- GLfloat const m11 = znear * 2.0f / (top - bottom);
- GLfloat const m22 = -(zfar + znear) / (zfar - znear);
-
- GLfloat const m20 = (right + left) / (right - left);
- GLfloat const m21 = (top + bottom) / (top - bottom);
-
- GLfloat const m32 = -(2.0f * zfar * znear) / (zfar - znear);
- GLfloat const m23 = -1.0f;
-
- r[0][0] = m00;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = m11;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = m20;
- r[2][1] = m21;
- r[2][2] = m22;
- r[2][3] = m23;
-
- r[3][0] = 0.0f;
- r[3][1] = 0.0f;
- r[3][2] = m32;
- r[3][3] = 0.0f;
-}
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = 1.0f;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = 0.0f;
- r[3][3] = 1.0f;
-}
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar)
-{
- GLfloat const sx = 2.0f / (right - left);
- GLfloat const sy = 2.0f / (top - bottom);
- GLfloat const sz = -2.0f / (zfar - znear);
-
- GLfloat const tx = -(right + left) / (right - left);
- GLfloat const ty = -(top + bottom) / (top - bottom);
- GLfloat const tz = -(zfar + znear) / (zfar - znear);
-
- r[0][0] = sx;
- r[0][1] = 0.0f;
- r[0][2] = 0.0f;
- r[0][3] = 0.0f;
-
- r[1][0] = 0.0f;
- r[1][1] = sy;
- r[1][2] = 0.0f;
- r[1][3] = 0.0f;
-
- r[2][0] = 0.0f;
- r[2][1] = 0.0f;
- r[2][2] = sz;
- r[2][3] = 0.0f;
-
- r[3][0] = tx;
- r[3][1] = ty;
- r[3][2] = tz;
- r[3][3] = 1.0f;
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.h
deleted file mode 100644
index 0e04568e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_matrix.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_MATRIX_H
-#define INCLUDED_MATRIX_H
-
-#include <QtOpenGL/qgl.h>
-#include <math.h>
-#include <assert.h>
-
-#define KD_FLT_EPSILON 1.19209290E-07F
-#define KD_DEG_TO_RAD_F 0.0174532924F
-#define KD_RAD_TO_DEG_F 57.2957802F
-
-void NvCopyMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-void NvExtract3x3Matf(GLfloat r[3][3], const GLfloat m[4][4]);
-
-/* vector utilities */
-
-GLfloat NvVecLengthf(const GLfloat v[3]);
-
-void NvNormalizeVecf(GLfloat r[3], const GLfloat v[3]);
-
-void NvAddVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvSubVecf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvCrossProductf(GLfloat r[3], const GLfloat a[3], const GLfloat b[3]);
-
-void NvTransformPointf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-void NvTransformHomPointf(GLfloat r[4], const GLfloat m[4][4], const GLfloat a[4]);
-void NvTransformVecf(GLfloat r[3], const GLfloat m[4][4], const GLfloat a[3]);
-
-/* matrix utilities */
-
-void NvMultMatf(GLfloat r[4][4], const GLfloat a[4][4], const GLfloat b[4][4]);
-
-void NvInvMatf(GLfloat r[4][4], const GLfloat m[4][4]);
-
-/* matrix building utilities */
-
-void NvBuildIdentityMatf(GLfloat r[4][4]);
-
-void NvBuildTranslateMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildScaleMatf(GLfloat r[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvBuildRotXDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotYDegMatf(GLfloat r[4][4], GLfloat degrees);
-void NvBuildRotZDegMatf(GLfloat r[4][4], GLfloat degrees);
-
-void NvBuildRotDegMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat degrees);
-
-void NvBuildRotXRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotYRadMatf(GLfloat r[4][4], GLfloat radians);
-void NvBuildRotZRadMatf(GLfloat r[4][4], GLfloat radians);
-
-void NvBuildRotRadMatf(GLfloat r[4][4], const GLfloat axis[3], GLfloat radians);
-
-void NvBuildLookatMatf(GLfloat r[4][4], const GLfloat eye[3], const GLfloat obj[3],
- const GLfloat up[3]);
-
-void NvBuildFrustumMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-void NvBuildOrtho2Matf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top);
-
-void NvBuildOrthoMatf(GLfloat r[4][4], GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
- GLfloat znear, GLfloat zfar);
-
-/* matrix concatenation utilities */
-
-void NvMultTranslateMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-void NvMultScaleMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat x, GLfloat y, GLfloat z);
-
-void NvMultRotXDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotYDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-void NvMultRotZDegMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat degrees);
-
-void NvMultRotDegMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat degrees);
-
-void NvMultRotXRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotYRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-void NvMultRotZRadMatf(GLfloat r[4][4], const GLfloat m[4][4], GLfloat radians);
-
-void NvMultRotRadMatf(GLfloat r[4][4], const GLfloat m[4][4], const GLfloat axis[3],
- GLfloat radians);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.cpp b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.cpp
deleted file mode 100644
index 9626eb8c..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "nv_quat.h"
-#include <stdlib.h>
-#include <string.h>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4])
-{
- memcpy(r, q, 4 * sizeof(GLfloat));
-}
-
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4])
-{
- // Assumes that the quaternion is normalized!
- GLfloat x2 = q[0] * 2.0f;
- GLfloat y2 = q[1] * 2.0f;
- GLfloat z2 = q[2] * 2.0f;
- GLfloat xSq2 = x2 * q[0];
- GLfloat ySq2 = y2 * q[1];
- GLfloat zSq2 = z2 * q[2];
- GLfloat xy2 = x2 * q[1];
- GLfloat xz2 = x2 * q[2];
- GLfloat xw2 = x2 * q[3];
- GLfloat yz2 = y2 * q[2];
- GLfloat yw2 = y2 * q[3];
- GLfloat zw2 = z2 * q[3];
-
- /* Matrix is
- * | 1 - 2y^2 - 2z^2 2xy - 2zw 2xz + 2yw |
- * | 2xy + 2zw 1 - 2x^2 - 2z^2 2yz - 2xw |
- * | 2xz - 2yw 2yz + 2xw 1 - 2x^2 - 2y^2 |
- */
- r[0][0] = 1.0f - ySq2 - zSq2;
- r[0][1] = xy2 - zw2;
- r[0][2] = xz2 + yw2;
-
- r[1][0] = xy2 + zw2;
- r[1][1] = 1.0f - xSq2 - zSq2;
- r[1][2] = yz2 - xw2;
-
- r[2][0] = xz2 - yw2;
- r[2][1] = yz2 + xw2;
- r[2][2] = 1.0f - xSq2 - ySq2;
-}
-
-void NvQuatIdentity(GLfloat r[4])
-{
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = 1.0f;
-}
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3])
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = axis[0] * sina;
- r[1] = axis[1] * sina;
- r[2] = axis[2] * sina;
- r[3] = cosa;
-}
-
-void NvQuatX(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = sina;
- r[1] = 0.0f;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatY(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = sina;
- r[2] = 0.0f;
- r[3] = cosa;
-}
-
-void NvQuatZ(GLfloat r[4], GLfloat radians)
-{
- GLfloat cosa = cosf(radians * 0.5f);
- GLfloat sina = sinf(radians * 0.5f);
-
- r[0] = 0.0f;
- r[1] = 0.0f;
- r[2] = sina;
- r[3] = cosa;
-}
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatY(h, heading);
- NvQuatX(p, pitch);
- NvQuatZ(ro, roll);
-
- NvQuatMult(r, h, p);
- NvQuatMult(r, ro, r);
-}
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll)
-{
- GLfloat h[4], p[4], ro[4];
-
- NvQuatZ(ro, roll);
- NvQuatX(p, pitch);
- NvQuatY(h, heading);
-
- NvQuatMult(r, p, h);
- NvQuatMult(r, r, ro);
-}
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4])
-{
- return q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3];
-}
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4])
-{
- const GLfloat q1x = q1[0];
- const GLfloat q1y = q1[1];
- const GLfloat q1z = q1[2];
- const GLfloat q1w = q1[3];
- const GLfloat q2x = q2[0];
- const GLfloat q2y = q2[1];
- const GLfloat q2z = q2[2];
- const GLfloat q2w = q2[3];
-
- r[0] = q1y * q2z - q2y * q1z + q1w * q2x + q2w * q1x;
- r[1] = q1z * q2x - q2z * q1x + q1w * q2y + q2w * q1y;
- r[2] = q1x * q2y - q2x * q1y + q1w * q2z + q2w * q1z;
- r[3] = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z;
-}
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t)
-{
- GLfloat omt = 1.0f - t;
-
- if (NvQuatDot(q1, q2) < 0.0f) {
- r[0] = -q1[0] * omt + q2[0] * t;
- r[1] = -q1[1] * omt + q2[1] * t;
- r[2] = -q1[2] * omt + q2[2] * t;
- r[3] = -q1[3] * omt + q2[3] * t;
- } else {
- r[0] = q1[0] * omt + q2[0] * t;
- r[1] = q1[1] * omt + q2[1] * t;
- r[2] = q1[2] * omt + q2[2] * t;
- r[3] = q1[3] * omt + q2[3] * t;
- }
-
- NvQuatNormalize(r, r);
-}
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4])
-{
- GLfloat invLength = 1.0f / sqrtf(NvQuatDot(q, q));
-
- r[0] = invLength * q[0];
- r[1] = invLength * q[1];
- r[2] = invLength * q[2];
- r[3] = invLength * q[3];
-}
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.h
deleted file mode 100644
index 4c65cb9e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_math/nv_quat.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef INCLUDED_QUAT_H
-#define INCLUDED_QUAT_H
-
-#include <QtOpenGL/qgl.h>
-#include <math.h>
-#include <assert.h>
-
-void NvQuatCopy(GLfloat r[4], const GLfloat q[4]);
-void NvQuatConvertTo3x3Mat(GLfloat r[3][3], const GLfloat q[4]);
-
-void NvQuatIdentity(GLfloat r[4]);
-
-void NvQuatFromAngleAxis(GLfloat r[4], GLfloat radians, const GLfloat axis[3]);
-
-void NvQuatX(GLfloat r[4], GLfloat radians);
-
-void NvQuatY(GLfloat r[4], GLfloat radians);
-
-void NvQuatZ(GLfloat r[4], GLfloat radians);
-
-void NvQuatFromEuler(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-void NvQuatFromEulerReverse(GLfloat r[4], GLfloat heading, GLfloat pitch, GLfloat roll);
-
-GLfloat NvQuatDot(const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatMult(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4]);
-
-void NvQuatNLerp(GLfloat r[4], const GLfloat q1[4], const GLfloat q2[4], GLfloat t);
-
-void NvQuatNormalize(GLfloat r[4], const GLfloat q[4]);
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_types.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_types.h
deleted file mode 100644
index 1d1b0300..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/libs/nv_types.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009-2011 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef __INCLUDED_QT3DS_TYPES_H
-#define __INCLUDED_QT3DS_TYPES_H
-
-typedef unsigned char NvU8; // 0 to 255
-typedef unsigned short NvU16; // 0 to 65535
-typedef unsigned int NvU32; // 0 to 4294967295
-typedef unsigned long long NvU64; // 0 to 18446744073709551615
-typedef signed char NvS8; // -128 to 127
-typedef signed short NvS16; // -32768 to 32767
-typedef signed int NvS32; // -2147483648 to 2147483647
-typedef signed long long NvS64; // 2^-63 to 2^63-1
-
-// Explicitly sized floats
-typedef float NvF32; // IEEE Single Precision (S1E8M23)
-typedef double NvF64; // IEEE Double Precision (S1E11M52)
-
-// Boolean type
-#define QT3DS_FALSE 0
-#define QT3DS_TRUE 1
-typedef NvU8 NvBool;
-
-// Result of sizeof operator
-typedef unsigned long NvSize;
-
-// Type large enough to hold a relative file offset
-typedef long NvOffset;
-
-// Base NULL type.
-#define QT3DS_NULL 0
-
-// Error related
-typedef enum {
- NvError_Success = 0,
- NvError_NotSupported,
- NvError_NotInitialized,
- NvError_BadParameter,
- NvError_InsufficientMemory,
- NvError_NoEntries,
- NvError_UnknownError,
-} NvError;
-
-#if 1 // defined(_DEBUG) // !!!!TBD TODO
-#define NvAssert(c)
-#else
-#define NvAssert(c) ((void)((c) ? 0 : (NvHandleAssertion(#c, __FILE__, __LINE__), 0)))
-#endif
-
-// Other standardized typedefs
-typedef NvU64 NvUST; // U64 unadjusted system time value
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/platformspecific/windows/viewer/Resource.h b/src/Runtime/ogl-runtime/src/platformspecific/windows/viewer/Resource.h
deleted file mode 100644
index 58c9336e..00000000
--- a/src/Runtime/ogl-runtime/src/platformspecific/windows/viewer/Resource.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#define IDI_ICON1 103
-#define IDI_ICON2 105
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 106
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsincubationcontroller.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsincubationcontroller.h
deleted file mode 100644
index 733037c6..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsincubationcontroller.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QCoreApplication>
-#include <QGuiApplication>
-#include <QQmlComponent>
-#include <QQuickItem>
-#include <QQmlIncubationController>
-#include <QScreen>
-
-class Q3DSIncubationController : public QObject, public QQmlIncubationController
-{
- Q_OBJECT
-public:
- explicit Q3DSIncubationController(QObject *parent = nullptr)
- : QObject(parent)
- , m_incubationTime(std::max(1, int(333 / QGuiApplication::primaryScreen()->refreshRate())))
- {
- startTimer(QGuiApplication::primaryScreen()->refreshRate());
- }
-
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE
- {
- incubateFor(m_incubationTime);
- }
-
-private:
- const int m_incubationTime;
-};
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.cpp b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.cpp
deleted file mode 100644
index e1b9e857..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlstream.h"
-
-/*!
- \qmltype QmlStream
- \instantiates Q3DSQmlStream
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief Allows streaming of QML as subpresentation.
-
- \sa Studio3D, Presentation, SubPresentation
-*/
-/*!
- \class Q3DSQmlStream
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
- \brief Allows streaming of QML as subpresentation.
- \param parent
- */
-
-/*!
- * \brief Q3DSQmlStream::Q3DSQmlStream Constructor
- * \param parent Optional parent object.
- */
-Q3DSQmlStream::Q3DSQmlStream(QObject *parent)
- : QObject(parent)
- , m_item(nullptr)
-{
-}
-
-/*!
- * \brief Q3DSQmlStream::~Q3DSQmlStream Destructor.
- */
-Q3DSQmlStream::~Q3DSQmlStream()
-{
-}
-
-/*!
- * \qmlproperty string QmlStream::presentationId
- * Contains the presentation id of this subpresentation.
- */
-/*!
- * \property Q3DSQmlStream::presentationId
- * Contains the presentation id of this subpresentation.
- */
-QString Q3DSQmlStream::presentationId() const
-{
- return m_presentationId;
-}
-
-/*!
- * \qmlproperty Item QmlStream::item
- * Contains the Item to be streamed as subpresentation.
- */
-/*!
- * \property Q3DSQmlStream::item
- * Contains the QQuickItem to be streamed as subpresentation.
- */
-QQuickItem *Q3DSQmlStream::item() const
-{
- return m_item;
-}
-
-void Q3DSQmlStream::setPresentationId(const QString presentationId)
-{
- if (m_presentationId != presentationId) {
- m_presentationId = presentationId;
- emit presentationIdChanged(presentationId);
- }
-}
-
-void Q3DSQmlStream::setItem(QQuickItem *item)
-{
- if (m_item != item) {
- m_item = item;
- emit itemChanged(item);
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.h
deleted file mode 100644
index 74825902..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstream.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAM_H
-#define Q3DS_QMLSTREAM_H
-
-#include <QObject>
-
-#include "q3dsqmlstreamer_global.h"
-
-QT_BEGIN_NAMESPACE
-class QQuickItem;
-QT_END_NAMESPACE
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT Q3DSQmlStream : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString presentationId READ presentationId WRITE setPresentationId NOTIFY presentationIdChanged)
- Q_PROPERTY(QQuickItem *item READ item WRITE setItem NOTIFY itemChanged)
-
- Q_CLASSINFO("DefaultProperty", "item")
-public:
- Q3DSQmlStream(QObject *parent = nullptr);
- ~Q3DSQmlStream();
-
- QString presentationId() const;
- QQuickItem *item() const;
-
-public Q_SLOTS:
- void setPresentationId(const QString presentationId);
- void setItem(QQuickItem *item);
-
-Q_SIGNALS:
- void presentationIdChanged(const QString presentationId);
- void itemChanged(QQuickItem *item);
-
-private:
- QString m_presentationId;
- QQuickItem *m_item;
-};
-
-#endif // Q3DSQMLSTREAM_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamer_global.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamer_global.h
deleted file mode 100644
index af12e6f0..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamer_global.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAMER_GLOBAL_H
-#define Q3DS_QMLSTREAMER_GLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-#if defined(QMLSTREAMER_LIBRARY)
-# define Q3DS_QMLSTREAMERSHARED_EXPORT Q_DECL_EXPORT
-#else
-# define Q3DS_QMLSTREAMERSHARED_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // Q3DS_QMLSTREAMER_GLOBAL_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.cpp b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.cpp
deleted file mode 100644
index 78c0a36a..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlstreamerserviceimpl.h"
-
-Q3DSQmlStreamServiceImpl::Q3DSQmlStreamServiceImpl()
-{
-
-}
-
-IQ3DSQmlStreamRenderer *Q3DSQmlStreamServiceImpl::getRenderer(const char *id)
-{
- if (m_producers[QString(id)])
- return m_producers[QString(id)]->getRenderer();
- return nullptr;
-}
-
-bool Q3DSQmlStreamServiceImpl::registerProducer(IQ3DSQmlStreamProducer *producer, const char *id)
-{
- m_producers[QString(id)] = producer;
- return true;
-}
-
-void Q3DSQmlStreamServiceImpl::unregisterProducer(IQ3DSQmlStreamProducer *producer)
-{
- auto iter = m_producers.begin();
- for (; iter != m_producers.end(); ++iter) {
- if (*iter == producer) {
- m_producers.erase(iter);
- return;
- }
- }
-}
-
-static Q3DSQmlStreamServiceImpl *service = nullptr;
-IQ3DSQmlStreamService *IQ3DSQmlStreamService::getQmlStreamService()
-{
- if (!service)
- service = new Q3DSQmlStreamServiceImpl();
- return service;
-}
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.h
deleted file mode 100644
index a17bf340..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamerserviceimpl.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAM_SERVICE_IMPL_H
-#define Q3DS_QMLSTREAM_SERVICE_IMPL_H
-
-#include <QMap>
-
-#include "q3dsqmlstreamservice.h"
-
-#include "q3dsqmlstreamer_global.h"
-
-class Q3DSQmlStreamServiceImpl : public IQ3DSQmlStreamService
-{
-public:
- Q3DSQmlStreamServiceImpl();
-
- IQ3DSQmlStreamRenderer *getRenderer(const char *id) override;
- bool registerProducer(IQ3DSQmlStreamProducer *producer, const char *id) override;
- void unregisterProducer(IQ3DSQmlStreamProducer *producer) override;
-private:
-
- QMap<QString, IQ3DSQmlStreamProducer *> m_producers;
-};
-
-#endif // Q3DS_QMLSTREAMER_SERVICE_IMPL_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.cpp b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.cpp
deleted file mode 100644
index 39eccb1b..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlstreamproducer.h"
-#include "q3dsqmlstreamrenderer.h"
-
-Q3DSQmlStreamProducer::Q3DSQmlStreamProducer(const QString &id, const QString &args,
- QObject *parent)
- : QObject(parent), m_id(id), m_args(args), m_renderer(new Q3DSQmlStreamRenderer)
-{
-
-}
-
-Q3DSQmlStreamProducer::~Q3DSQmlStreamProducer()
-{
- delete m_renderer;
-}
-
-IQ3DSQmlStreamRenderer* Q3DSQmlStreamProducer::getRenderer()
-{
- return m_renderer;
-}
-
-void Q3DSQmlStreamProducer::setPresentationItem(QQuickItem *item)
-{
- m_renderer->setItem(item);
-}
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.h
deleted file mode 100644
index d3b330d1..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproducer.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAM_PRODUCER_H
-#define Q3DS_QMLSTREAM_PRODUCER_H
-
-#include <QObject>
-#include "q3dsqmlstreamservice.h"
-#include "q3dsqmlstreamer_global.h"
-
-QT_BEGIN_NAMESPACE
-class QQuickItem;
-QT_END_NAMESPACE
-
-class Q3DSQmlStreamRenderer;
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT Q3DSQmlStreamProducer : public QObject,
- public IQ3DSQmlStreamProducer
-{
- Q_OBJECT
-public:
- Q3DSQmlStreamProducer(const QString &id, const QString &args, QObject *parent = nullptr);
- virtual ~Q3DSQmlStreamProducer();
-
- IQ3DSQmlStreamRenderer* getRenderer() override;
-
- void setPresentationItem(QQuickItem *item);
-
-private:
- QString m_id;
- QString m_args;
- Q3DSQmlStreamRenderer *m_renderer;
-};
-
-#endif // Q3DS_QMLSTREAM_PRODUCER_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.cpp b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.cpp
deleted file mode 100644
index 9b8550cf..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlstreamservice.h"
-#include "q3dsqmlstreamproxy.h"
-#include "q3dsqmlstreamproducer.h"
-#include "q3dsincubationcontroller.h"
-
-#include <QCoreApplication>
-#include <QGuiApplication>
-#include <QQmlComponent>
-#include <QQuickItem>
-#include <QQmlIncubationController>
-#include <QScreen>
-#include <QFileInfo>
-
-class Qt3DSQmlStreamEvent : public QEvent
-{
-public:
- Qt3DSQmlStreamEvent(const QString &id, const QString &args)
- : QEvent(QEvent::User), presentationId(id), presentationArgs(args), unregister(false)
- {
-
- }
-
- Qt3DSQmlStreamEvent(const QString &id)
- : QEvent(QEvent::User), presentationId(id), unregister(true)
- {
-
- }
-
- QString presentationId;
- QString presentationArgs;
- bool unregister;
-};
-
-Q3DSQmlStreamProxy::renderitem::~renderitem()
-{
- delete item;
- delete component;
-}
-
-Q3DSQmlStreamProxy::Q3DSQmlStreamProxy(QObject *parent)
- : QObject(parent), m_engine(nullptr), m_settings(nullptr)
-{
-}
-
-Q3DSQmlStreamProxy::~Q3DSQmlStreamProxy()
-{
- for (Q3DSQmlStreamProducer *p : m_streamProducers) {
- IQ3DSQmlStreamService::getQmlStreamService()->unregisterProducer(p);
- delete p;
- }
-}
-
-void Q3DSQmlStreamProxy::loadPresentationItem(const QString& presentationId,
- const QString& presentationArgs)
-{
- if (!m_engine) {
- m_engine = new QQmlEngine;
-
- // Add extra import path for binary installations
- QString extraImportPath(QStringLiteral("%1/qml"));
- m_engine->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath()));
-
- m_engine->setIncubationController(new Q3DSIncubationController(this));
- }
-
- QString itemPath = presentationArgs;
- itemPath.replace("\\", "/");
-
- QUrl purl = QUrl(itemPath);
- if (purl.isRelative()) {
- purl.setPath(m_path.path() + QStringLiteral("/") + purl.path());
- purl.setScheme(m_path.scheme());
- } else {
- purl = pathToUrl(itemPath);
- }
-
- QQmlComponent *component = new QQmlComponent(m_engine, purl);
- if (!component)
- return;
- renderitem *item = new renderitem;
- item->args = itemPath;
- item->component = component;
- item->presentationId = presentationId;
- m_loadedItems.push_back(item);
-
- if (component->isLoading())
- connect(component, &QQmlComponent::statusChanged, this, &Q3DSQmlStreamProxy::itemLoaded);
- else
- itemLoaded();
-}
-
-void Q3DSQmlStreamProxy::itemLoaded()
-{
- for (renderitem *item : m_loadedItems) {
- if (item->item == nullptr && item->component->isLoading() == false) {
- disconnect(item->component, &QQmlComponent::statusChanged,
- this, &Q3DSQmlStreamProxy::itemLoaded);
- if (!item->component->errors().isEmpty()) {
- QList<QQmlError> errorList = item->component->errors();
- for (const QQmlError &error: errorList)
- qWarning() << error.url() << error.line() << error;
- m_loadedItems.removeAll(item);
- delete item;
- } else {
- QObject *root = item->component->create();
- if (!root) {
- QList<QQmlError> errorList = item->component->errors();
- for (const QQmlError &error: errorList)
- qWarning() << error.url() << error.line() << error;
- m_loadedItems.removeAll(item);
- delete item;
- } else {
- QQuickItem *qi = qobject_cast<QQuickItem *>(root);
- if (!qi) {
- m_loadedItems.removeAll(item);
- delete item;
- } else {
- item->item = qi;
- m_streamProducers[item->presentationId]->setPresentationItem(qi);
- }
- }
- }
- }
- }
-}
-
-QUrl Q3DSQmlStreamProxy::pathToUrl(const QString &path)
-{
- QUrl retval;
- if (path.startsWith(QStringLiteral(":"))) {
- retval.setScheme(QStringLiteral("qrc"));
- retval.setPath(path.mid(1));
- } else if (path.startsWith(QStringLiteral("qrc:"), Qt::CaseInsensitive)) {
- retval.setScheme(QStringLiteral("qrc"));
- retval.setPath(path.mid(4));
- } else {
- retval.setScheme(QStringLiteral("file"));
- retval.setPath(path);
- }
- return retval;
-}
-
-bool Q3DSQmlStreamProxy::event(QEvent *event)
-{
- if (event->type() == QEvent::User) {
- Qt3DSQmlStreamEvent *e = static_cast<Qt3DSQmlStreamEvent *>(event);
- Q3DSQmlStreamProducer *producer = nullptr;
- if (e->unregister && m_streamProducers.contains(e->presentationId)) {
- for (int i = 0; i < m_loadedItems.size(); i++) {
- if (m_loadedItems[i]->presentationId == e->presentationId) {
- delete m_loadedItems[i];
- m_loadedItems.remove(i);
- break;
- }
- }
- producer = static_cast<Q3DSQmlStreamProducer *>(
- m_streamProducers.take(e->presentationId));
- IQ3DSQmlStreamService::getQmlStreamService()->unregisterProducer(producer);
- delete producer;
- return true;
- }
- if (!m_streamProducers.contains(e->presentationId)) {
- producer = new Q3DSQmlStreamProducer(e->presentationId, e->presentationArgs, this);
- m_streamProducers[e->presentationId] = producer;
- IQ3DSQmlStreamService::getQmlStreamService()
- ->registerProducer(producer, e->presentationId.toLatin1().data());
- } else {
- producer = static_cast<Q3DSQmlStreamProducer *>(m_streamProducers[e->presentationId]);
- }
-
- if (m_settings) {
- bool streamFound = false;
- for (Q3DSQmlStream *s : m_settings->qmlStreamsList()) {
- if (s->presentationId() == e->presentationId) {
- producer->setPresentationItem(s->item());
- streamFound = true;
- break;
- }
- }
- if (!streamFound && !e->presentationArgs.isNull())
- loadPresentationItem(e->presentationId, e->presentationArgs);
- } else if (!e->presentationArgs.isNull()){
- loadPresentationItem(e->presentationId, e->presentationArgs);
- }
- return true;
- }
- return false;
-}
-
-void Q3DSQmlStreamProxy::registerPresentation(const QString &presentationId, const QString &args)
-{
- QCoreApplication::postEvent(this,
- new Qt3DSQmlStreamEvent(QString(presentationId), QString(args)));
-}
-
-void Q3DSQmlStreamProxy::unregisterPresentation(const QString &presentationId)
-{
- QCoreApplication::postEvent(this, new Qt3DSQmlStreamEvent(QString(presentationId)));
-}
-
-void Q3DSQmlStreamProxy::setSettings(Q3DSSubPresentationSettings *settings)
-{
- m_settings = settings;
-}
-
-void Q3DSQmlStreamProxy::setPath(const QString& path)
-{
- QString modPath = QFileInfo(path).path(); // path() strips filename out
- m_path = pathToUrl(modPath);
-}
-
-void Q3DSQmlStreamProxy::setEngine(QQmlEngine *engine)
-{
- if (m_engine)
- delete m_engine;
-
- m_engine = engine;
-
- // Add extra import path for binary installations
- QString extraImportPath(QStringLiteral("%1/qml"));
- m_engine->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath()));
-
- m_engine->setIncubationController(new Q3DSIncubationController(this));
-}
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.h
deleted file mode 100644
index 85a1cc6d..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamproxy.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAM_PROXY_H
-#define Q3DS_QMLSTREAM_PROXY_H
-
-#include <QtCore/QObject>
-#include <QtCore/QEvent>
-#include <QtCore/QString>
-#include <QtCore/QVector>
-#include <QtQml/QQmlEngine>
-
-#include "q3dsqmlstreamproducer.h"
-#include "q3dsqmlsubpresentationsettings.h"
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT Q3DSQmlStreamProxy : public QObject
-{
- Q_OBJECT
-
-public:
- Q3DSQmlStreamProxy(QObject *parent = nullptr);
- ~Q3DSQmlStreamProxy();
-
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void registerPresentation(const QString &presentationId, const QString &args);
- void unregisterPresentation(const QString &presentationId);
- void setSettings(Q3DSSubPresentationSettings *settings);
- void setPath(const QString& path);
- void setEngine(QQmlEngine *engine);
-
-private:
- void loadPresentationItem(const QString& presentationId, const QString& presentationArgs);
- void itemLoaded();
- QUrl pathToUrl(const QString &path);
-
- QQmlEngine *m_engine;
- Q3DSSubPresentationSettings *m_settings;
- QMap<QString, Q3DSQmlStreamProducer *> m_streamProducers;
- struct renderitem {
- QString args;
- QString presentationId;
- QQmlComponent *component;
- QQuickItem *item;
- renderitem()
- : component(nullptr), item(nullptr) {}
- ~renderitem();
- };
-
- QUrl m_path;
- QVector<renderitem *> m_loadedItems;
-};
-
-#endif // Q3DS_QMLSTREAM_PROXY_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.cpp b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.cpp
deleted file mode 100644
index f1879a6e..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.cpp
+++ /dev/null
@@ -1,483 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlstreamrenderer.h"
-
-#include <QCoreApplication>
-#include <qdebug.h>
-#include <QOpenGLContext>
-#include <QSurface>
-#include <QPainter>
-#include <QOpenGLFunctions>
-#include <QWindow>
-#include <QQuickWindow>
-#include <QQuickRenderControl>
-#include <QtQml/QQmlEngine>
-#include <QtQml/QQmlContext>
-#include <QQuickWindow>
-#include <QQuickItem>
-#include <QThread>
-#include <QOffscreenSurface>
-#include <QOpenGLFramebufferObject>
-#include <QOpenGLShaderProgram>
-#include <QOpenGLBuffer>
-#include <QOpenGLVertexArrayObject>
-
-Q_GLOBAL_STATIC(QThread, renderThread)
-Q_GLOBAL_STATIC(QAtomicInt, renderThreadClientCount)
-
-#define RenderEvent(name, value) \
- class name : public QEvent \
- { \
- public: \
- name() : QEvent(_type) {} \
- static const QEvent::Type _type; \
- }; \
- const QEvent::Type name::_type = QEvent::Type(value);
-
-RenderEvent(InitializeRender, QEvent::User + 1)
-RenderEvent(RequestUpdate, QEvent::User + 2)
-RenderEvent(InitializeRenderThread, QEvent::User + 3)
-RenderEvent(PrepareRender, QEvent::User + 4)
-RenderEvent(Cleanup, QEvent::User + 5)
-
-#define EventType(e) (e::_type)
-
-class RenderControl : public QQuickRenderControl
-{
-public:
- RenderControl(QWindow *w)
- : m_window(w)
- {
- }
-
- QWindow *renderWindow(QPoint *offset) Q_DECL_OVERRIDE
- {
- if (offset)
- *offset = QPoint(0, 0);
- return m_window;
- }
-
-private:
- QWindow *m_window;
-};
-
-Q3DSQmlStreamEventHandler::Q3DSQmlStreamEventHandler(Q3DSQmlStreamRenderer *renderer)
- : m_renderer(renderer)
-{
-
-}
-
-bool Q3DSQmlStreamEventHandler::event(QEvent *e)
-{
- switch (e->type()) {
-
- case EventType(RequestUpdate): {
- m_renderer->renderTexture();
- return true;
- }
-
- case EventType(InitializeRenderThread): {
- m_renderer->initializeRender();
- return true;
- }
-
- case EventType(Cleanup): {
- m_renderer->cleanup();
- return true;
- }
-
- default:
- break;
- }
- return QObject::event(e);
-}
-
-Q3DSQmlStreamRenderer::Q3DSQmlStreamRenderer()
- : m_renderControl(nullptr)
- , m_quickWindow(nullptr)
- , m_rootItem(nullptr)
- , m_frameBuffer(nullptr)
- , m_program(nullptr)
- , m_vao(nullptr)
- , m_vertices(nullptr)
- , m_context(nullptr)
- , m_offscreenSurface(nullptr)
- , m_renderObject(nullptr)
- , m_renderThread(nullptr)
- , m_requestUpdate(false)
- , m_initialized(false)
- , m_prepared(false)
- , m_update(false)
- , m_delayedUpdateRequest(false)
-{
- renderThreadClientCount->fetchAndAddAcquire(1);
-
- QSurfaceFormat format = QSurfaceFormat::defaultFormat();
- if (QOpenGLContext::currentContext())
- format = QOpenGLContext::currentContext()->format();
- else {
- format.setDepthBufferSize(24);
- format.setStencilBufferSize(8);
- }
-
- m_offscreenSurface = new QOffscreenSurface;
- m_offscreenSurface->setFormat(format);
- m_offscreenSurface->create();
-
- m_renderControl = new RenderControl(nullptr);
-
- connect(m_renderControl, &QQuickRenderControl::renderRequested,
- this, &Q3DSQmlStreamRenderer::requestUpdate);
- connect(m_renderControl, &QQuickRenderControl::sceneChanged,
- this, &Q3DSQmlStreamRenderer::requestUpdate);
-
- m_quickWindow = new QQuickWindow(m_renderControl);
- m_quickWindow->setClearBeforeRendering(true);
- m_quickWindow->setColor(Qt::transparent);
-
- m_renderObject = new Q3DSQmlStreamEventHandler(this);
- renderThread->setObjectName(QStringLiteral("Qt3DSQmlStreamRenderer::renderThread"));
- m_renderThread = renderThread;
-
- m_renderObject->moveToThread(m_renderThread);
- if (!m_renderThread->isRunning())
- m_renderThread->start();
-}
-
-Q3DSQmlStreamRenderer::~Q3DSQmlStreamRenderer()
-{
- QMutexLocker lock(&m_mutex);
- QCoreApplication::postEvent(m_renderObject, new Cleanup());
- m_waitCondition.wait(&m_mutex);
-
- delete m_offscreenSurface;
- delete m_renderControl;
- delete m_quickWindow;
- delete m_renderObject;
-
- renderThreadClientCount->fetchAndSubAcquire(1);
- if (renderThreadClientCount->load() == 0)
- renderThread->quit();
-}
-
-void Q3DSQmlStreamRenderer::cleanup()
-{
- if (m_context)
- m_context->makeCurrent(m_offscreenSurface);
- if (m_renderControl)
- m_renderControl->invalidate();
-
- delete m_frameBuffer;
- delete m_program;
- delete m_vertices;
-
- if (m_context)
- m_context->doneCurrent();
- delete m_context;
-
- if (m_renderObject)
- m_renderObject->moveToThread(QCoreApplication::instance()->thread());
- m_waitCondition.wakeOne();
-}
-
-bool Q3DSQmlStreamRenderer::initialize(QOpenGLContext *context, QSurface *surface)
-{
- Q_UNUSED(surface);
- QMutexLocker lock(&m_renderMutex);
- if (!m_context) {
- m_context = new QOpenGLContext();
- m_context->setShareContext(context);
- m_context->setFormat(context->format());
- m_context->create();
- m_context->moveToThread(m_renderThread);
- }
-
- if (!m_rootItem) {
- return true;
- }
-
- if (m_initialized) {
- Q_ASSERT(QOpenGLContext::areSharing(context, m_context));
- return true;
- }
-
- m_rootItem->setParentItem(m_quickWindow->contentItem());
-
- updateSizes();
-
- m_initialized = true;
- // Initialize render thread
- QCoreApplication::postEvent(m_renderObject,
- new InitializeRenderThread());
- return true;
-}
-void Q3DSQmlStreamRenderer::initializeFboCopy()
-{
- m_program = new QOpenGLShaderProgram;
- if (m_context->format().renderableType() == QSurfaceFormat::OpenGLES) {
- static const char *vsSource =
- "attribute highp vec4 pos;\n"
- "attribute highp vec2 tc;\n"
- "varying lowp vec2 texcoord;\n"
- "void main() {\n"
- " texcoord = tc;\n"
- " gl_Position = pos;\n"
- "}\n";
- static const char *fsSource =
- "varying highp vec2 texcoord;\n"
- "uniform sampler2D sampler;\n"
- "void main() {\n"
- " gl_FragColor = texture2D(sampler, texcoord);\n"
- "}\n";
- m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, vsSource);
- m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, fsSource);
- } else {
- static const char *vsSource =
- "#version 150 core\n"
- "in vec4 pos;\n"
- "in vec2 tc;\n"
- "out vec2 texcoord;\n"
- "void main() {\n"
- " texcoord = tc;\n"
- " gl_Position = pos;\n"
- "}\n";
- static const char *fsSource =
- "#version 150 core\n"
- "in vec2 texcoord;\n"
- "out vec4 fragColor;\n"
- "uniform sampler2D sampler;\n"
- "void main() {\n"
- " fragColor = texture(sampler, texcoord);\n"
- "}\n";
- m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, vsSource);
- m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, fsSource);
- }
-
- m_program->bindAttributeLocation("pos", 0);
- m_program->bindAttributeLocation("tc", 1);
-
- if (!m_program->link()) {
- QByteArray logData(m_program->log().toLocal8Bit());
- const char *log = logData.data();
- qFatal("Failed to create shader program: %s", log);
- }
-
- m_vertices = new QOpenGLBuffer;
- m_vertices->create();
- m_vertices->bind();
-
- static const float vertices[] =
- {
- -1, -1, 0, 1, 0, 0,
- 1, -1, 0, 1, 1, 0,
- 1, 1, 0, 1, 1, 1,
- -1, -1, 0, 1, 0, 0,
- 1, 1, 0, 1, 1, 1,
- -1, 1, 0, 1, 0, 1,
- };
-
- m_vertices->allocate(vertices, sizeof(vertices));
- m_vertices->release();
-}
-
-void Q3DSQmlStreamRenderer::initializeRender()
-{
- QMutexLocker lock(&m_renderMutex);
- m_context->makeCurrent(m_offscreenSurface);
- m_renderControl->initialize(m_context);
- m_context->doneCurrent();
- QCoreApplication::postEvent(this, new PrepareRender());
-}
-
-QSize Q3DSQmlStreamRenderer::getDesiredSize()
-{
- return m_size;
-}
-
-E_TEXTURE_FORMAT Q3DSQmlStreamRenderer::getDesiredFormat()
-{
- return E_TEXTURE_RGBA8;
-}
-
-bool Q3DSQmlStreamRenderer::isUpdateRequested()
-{
- return m_update;
-}
-
-// Called by stream renderer client when it stops using the renderer
-// TODO: We are sharing the context so stop using it.
-void Q3DSQmlStreamRenderer::uninitialize()
-{
-}
-
-void Q3DSQmlStreamRenderer::setItem(QQuickItem *item)
-{
- if (item && m_rootItem && m_initialized) {
- QMutexLocker lock(&m_renderMutex);
- m_rootItem->setParentItem(nullptr);
- m_rootItem = item;
- m_rootItem->setParentItem(m_quickWindow->contentItem());
- updateSizes();
- } else {
- if (item && m_rootItem != item) {
- m_rootItem = item;
-
- if (m_context)
- initialize(m_context, nullptr);
- }
- }
-}
-
-bool Q3DSQmlStreamRenderer::event(QEvent *event)
-{
- switch (event->type()) {
-
- case EventType(PrepareRender): {
-
- m_renderControl->prepareThread(m_renderThread);
- m_prepared = true;
-
- if (m_delayedUpdateRequest) {
- QCoreApplication::postEvent(this, new RequestUpdate());
- m_delayedUpdateRequest = false;
- }
-
- return true;
- }
-
- case EventType(RequestUpdate): {
-
- m_renderControl->polishItems();
- QMutexLocker lock(&m_mutex);
- QCoreApplication::postEvent(m_renderObject, new RequestUpdate());
- m_waitCondition.wait(&m_mutex);
- return true;
- }
-
- default:
- break;
- }
-
- return QObject::event(event);
-}
-
-void Q3DSQmlStreamRenderer::updateSizes()
-{
- if (m_rootItem->width() > 0 && m_rootItem->height() > 0) {
- m_size = QSize(m_rootItem->width(), m_rootItem->height());
- } else {
- m_rootItem->setWidth(256);
- m_rootItem->setHeight(256);
- }
-
- m_quickWindow->setGeometry(0, 0, m_size.width(), m_size.height());
-}
-
-void Q3DSQmlStreamRenderer::requestUpdate()
-{
- if (!m_requestUpdate) {
- m_requestUpdate = true;
- if (m_initialized)
- QCoreApplication::postEvent(this, new RequestUpdate());
- else
- m_delayedUpdateRequest = true;
- }
-}
-
-void Q3DSQmlStreamRenderer::renderTexture()
-{
- QMutexLocker lock(&m_renderMutex);
- m_context->makeCurrent(m_offscreenSurface);
-
- if (!m_frameBuffer || m_frameBuffer->size() != m_size) {
- if (m_frameBuffer)
- delete m_frameBuffer;
-
- m_frameBuffer = new QOpenGLFramebufferObject(m_size);
- m_frameBuffer->setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
- m_quickWindow->setRenderTarget(m_frameBuffer);
- }
-
- {
- QMutexLocker lock(&m_mutex);
- if (m_requestUpdate) {
- m_requestUpdate = false;
- m_renderControl->sync();
- m_renderControl->render();
- m_waitCondition.wakeOne();
- }
- }
-
- m_context->functions()->glFlush();
- m_quickWindow->resetOpenGLState();
- m_context->doneCurrent();
- m_update = true;
-}
-
-void Q3DSQmlStreamRenderer::render()
-{
- QMutexLocker lock(&m_renderMutex);
- if (m_update && m_initialized) {
- QOpenGLContext *context = QOpenGLContext::currentContext();
- QOpenGLFunctions *func = context->functions();
- GLuint texture = m_frameBuffer->texture();
- func->glDisable(GL_DEPTH_TEST);
- func->glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-
- if (!m_program)
- initializeFboCopy();
-
- m_program->bind();
-
- if (!m_vao) {
- m_vao = new QOpenGLVertexArrayObject;
- m_vao->create();
- m_vao->bind();
- m_vertices->bind();
-
- m_program->enableAttributeArray(0);
- m_program->enableAttributeArray(1);
- func->glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 6 * sizeof(float), 0);
- func->glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 6 * sizeof(float),
- (const void *)(4 * sizeof(GLfloat)));
- m_vertices->release();
- } else {
- m_vao->bind();
- }
-
- func->glActiveTexture(GL_TEXTURE0);
- func->glBindTexture(GL_TEXTURE_2D, texture);
- func->glDrawArrays(GL_TRIANGLES, 0, 6);
- func->glEnable(GL_DEPTH_TEST);
-
- m_program->release();
- m_vao->release();
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.h
deleted file mode 100644
index e9274794..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamrenderer.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAM_RENDERER_H
-#define Q3DS_QMLSTREAM_RENDERER_H
-
-#include "q3dsqmlstreamservice.h"
-
-#include <QOpenGLFunctions>
-#include <QSize>
-#include <QThread>
-#include <QWaitCondition>
-#include <QMutex>
-
-QT_BEGIN_NAMESPACE
-class QQuickRenderControl;
-class QQuickWindow;
-class QQuickItem;
-class QOpenGLContext;
-class QOffscreenSurface;
-class QOpenGLFramebufferObject;
-class QOpenGLShaderProgram;
-class QOpenGLBuffer;
-class QOpenGLVertexArrayObject;
-QT_END_NAMESPACE
-
-class Q3DSQmlStreamRenderer;
-
-class Q3DSQmlStreamEventHandler : public QObject
-{
- Q_OBJECT
-public:
- Q3DSQmlStreamEventHandler(Q3DSQmlStreamRenderer *renderer);
- bool event(QEvent *e) Q_DECL_OVERRIDE;
-
-private:
- Q3DSQmlStreamRenderer *m_renderer;
-};
-
-class Q3DSQmlStreamRenderer : public QObject,
- public IQ3DSQmlStreamRenderer
-{
- Q_OBJECT
-public:
- Q3DSQmlStreamRenderer();
- virtual ~Q3DSQmlStreamRenderer();
-
- bool initialize(QOpenGLContext *context, QSurface *surface) override;
-
- QSize getDesiredSize() override;
- E_TEXTURE_FORMAT getDesiredFormat() override;
- bool isUpdateRequested() override;
-
- void render() override;
-
- void uninitialize() override;
-
- void setItem(QQuickItem *item);
-
- bool event(QEvent *event) Q_DECL_OVERRIDE;
-
-private:
-
- void updateSizes();
- void requestUpdate();
- void cleanup();
- void initializeRender();
- void renderTexture();
- void initializeFboCopy();
-
- QSize m_size;
- QMutex m_mutex, m_renderMutex;
- QWaitCondition m_waitCondition;
-
- QQuickRenderControl *m_renderControl;
- QQuickWindow *m_quickWindow;
- QQuickItem *m_rootItem;
-
- QOpenGLFramebufferObject *m_frameBuffer;
- QOpenGLShaderProgram *m_program;
- QOpenGLVertexArrayObject *m_vao;
- QOpenGLBuffer *m_vertices;
- QOpenGLContext *m_context;
- QOffscreenSurface *m_offscreenSurface;
-
- Q3DSQmlStreamEventHandler *m_renderObject;
- QThread *m_renderThread;
-
- bool m_requestUpdate;
- bool m_initialized;
- bool m_prepared;
- bool m_update;
- bool m_delayedUpdateRequest;
-
- friend class Q3DSQmlStreamEventHandler;
-};
-
-#endif // Q3DS_QMLSTREAM_RENDERER_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamservice.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamservice.h
deleted file mode 100644
index 2b44fe3b..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlstreamservice.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QMLSTREAM_SERVICE_H
-#define Q3DS_QMLSTREAM_SERVICE_H
-
-#include <qglobal.h>
-#include <q3dsqmlstreamer_global.h>
-
-QT_BEGIN_NAMESPACE
-class QOpenGLContext;
-class QSurface;
-class QSize;
-QT_END_NAMESPACE
-
-enum E_TEXTURE_FORMAT
-{
- E_TEXTURE_RGBA8,
- E_TEXTURE_UNKNOWN
-};
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT IQ3DSQmlStreamRenderer
-{
-public:
- virtual bool initialize(QT_PREPEND_NAMESPACE(QOpenGLContext) *context, QSurface *surface) = 0;
-
- virtual QSize getDesiredSize() = 0;
- virtual E_TEXTURE_FORMAT getDesiredFormat() = 0;
- virtual bool isUpdateRequested() = 0;
-
- virtual void render() = 0;
-
- virtual void uninitialize() = 0;
-};
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT IQ3DSQmlStreamProducer
-{
-public:
- virtual IQ3DSQmlStreamRenderer *getRenderer() = 0;
-};
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT IQ3DSQmlStreamService
-{
-public:
- virtual IQ3DSQmlStreamRenderer *getRenderer(const char *id) = 0;
- virtual bool registerProducer(IQ3DSQmlStreamProducer *producer, const char *id) = 0;
- virtual void unregisterProducer(IQ3DSQmlStreamProducer *producer) = 0;
-
- static IQ3DSQmlStreamService *getQmlStreamService();
-};
-
-#endif // Q3DS_QMLSTREAM_SERVICE_H
-
-
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp
deleted file mode 100644
index bde5ad31..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlsubpresentationsettings.h"
-#include "q3dsqmlstream.h"
-
-/*!
- \qmltype SubPresentationSettings
- \instantiates Q3DSSubPresentationSettings
- \inqmlmodule Qt3DStudio
- \ingroup OpenGLRuntime
- \brief
-
- \sa Studio3D, Presentation, QmlStream
-*/
-/*!
- \class Q3DSSubPresentationSettings
- \inmodule OpenGLRuntime
- \since Qt 3D Studio 2.0
- \brief Settings for subpresentations.
- \param parent
-
- \sa Q3DSPresentation, Q3DSQmlStream
- */
-Q3DSSubPresentationSettings::Q3DSSubPresentationSettings(QObject *parent)
- : QObject(parent)
-{
-}
-
-Q3DSSubPresentationSettings::~Q3DSSubPresentationSettings()
-{
- qDeleteAll(m_list);
-}
-
-/*!
- * \qmlproperty variant SubPresentationSettings::qmlStream
- * Contains the QML streams to be used as subpresentations.
- */
-/*!
- * \property Q3DSSubPresentationSettings::qmlStreams
- * Contains the QML streams to be used as subpresentations.
- */
-QQmlListProperty<Q3DSQmlStream> Q3DSSubPresentationSettings::qmlStreams()
-{
- return QQmlListProperty<Q3DSQmlStream>(this, m_list);
-}
-
-QList<Q3DSQmlStream *> Q3DSSubPresentationSettings::qmlStreamsList()
-{
- return m_list;
-}
-
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.h b/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.h
deleted file mode 100644
index b295f2a0..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/q3dsqmlsubpresentationsettings.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DS_QML_SUBPRESENTATION_SETTINGS_H
-#define Q3DS_QML_SUBPRESENTATION_SETTINGS_H
-
-#include <QtCore/QObject>
-#include <QtCore/QList>
-#include <QtQml/QQmlListProperty>
-
-#include "q3dsqmlstream.h"
-#include "q3dsqmlstreamer_global.h"
-
-class Q3DS_QMLSTREAMERSHARED_EXPORT Q3DSSubPresentationSettings : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QQmlListProperty<Q3DSQmlStream> qmlStreams READ qmlStreams)
-public:
-
- Q3DSSubPresentationSettings(QObject *parent = nullptr);
- ~Q3DSSubPresentationSettings();
-
- QQmlListProperty<Q3DSQmlStream> qmlStreams();
- QList<Q3DSQmlStream *> qmlStreamsList();
-private:
- QList<Q3DSQmlStream *> m_list;
-};
-
-#endif // Q3DS_QML_SUBPRESENTATION_SETTINGS_H
diff --git a/src/Runtime/ogl-runtime/src/qmlstreamer/qmlstreamer.pro b/src/Runtime/ogl-runtime/src/qmlstreamer/qmlstreamer.pro
deleted file mode 100644
index 5e82c7c0..00000000
--- a/src/Runtime/ogl-runtime/src/qmlstreamer/qmlstreamer.pro
+++ /dev/null
@@ -1,50 +0,0 @@
-TEMPLATE = lib
-TARGET = qt3dsqmlstreamer
-VERSION = $$MODULE_VERSION
-include($$PWD/../../commonplatform.pri)
-
-CONFIG += installed
-load(qt_helper_lib)
-
-# qt_helper_lib assumes non-qt lib, so it clears some qt variables, reset those
-CONFIG += qt
-QT += core qml quick opengl
-
-DEFINES += QMLSTREAMER_LIBRARY
-
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which as been marked as deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
-DEFINES += QT_DEPRECATED_WARNINGS
-
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
-
-SOURCES += \
- q3dsqmlstream.cpp \
- q3dsqmlstreamerserviceimpl.cpp \
- q3dsqmlstreamproducer.cpp \
- q3dsqmlstreamproxy.cpp \
- q3dsqmlstreamrenderer.cpp \
- q3dsqmlsubpresentationsettings.cpp
-
-HEADERS += \
- q3dsincubationcontroller.h \
- q3dsqmlstream.h \
- q3dsqmlstreamer_global.h \
- q3dsqmlstreamerserviceimpl.h \
- q3dsqmlstreamproducer.h \
- q3dsqmlstreamproxy.h \
- q3dsqmlstreamrenderer.h \
- q3dsqmlstreamservice.h \
- q3dsqmlsubpresentationsettings.h
-
-INCLUDEPATH += \
- $$PWD/../Runtime/ogl-runtime/src/engine \
- $$PWD/../Runtime/ogl-runtime/src/system \
- $$PWD/../QtExtras/qmlstreamer
-
-macos:QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderClearColorExample.cpp b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderClearColorExample.cpp
deleted file mode 100644
index f67cf717..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderClearColorExample.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderExample.h"
-#include "foundation/Qt3DSVec4.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-namespace {
-class ClearColor : public NVRenderExample
-{
- NVRenderContext &m_Context;
-
-public:
- ClearColor(NVRenderContext &ctx)
- : m_Context(ctx)
- {
- }
- virtual void drawFrame(double currentSeconds)
- {
- // Apply this value immediately but track it so that a later pop will in fact
- // restore this value.
- if (currentSeconds < 1)
- m_Context.SetClearColor(QT3DSVec4(.8f, .0f, .0f, 1.f));
- else if (currentSeconds < 2)
- m_Context.SetClearColor(QT3DSVec4(0.f, .0f, 1.f, 1.f));
- else
- m_Context.SetClearColor(QT3DSVec4(0.f, 1.0f, 1.f, 1.f));
- m_Context.Clear(NVRenderClearFlags(NVRenderClearValues::Color));
- }
- virtual QT3DSU32 getRuntimeInSeconds() { return 2; }
- virtual void release() { NVDelete(m_Context.GetFoundation(), this); }
-};
-}
-
-// QT3DS_RENDER_REGISTER_EXAMPLE( ClearColor ); \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.cpp b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.cpp
deleted file mode 100644
index d866cda0..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.cpp
+++ /dev/null
@@ -1,491 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderExample.h"
-#include "render/NvRenderBaseTypes.h"
-#include "render_util/NVRenderAllocator.h"
-#include "render_util/NVRenderErrorStream.h"
-#include "render_util/NVRenderUtils.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSTime.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSMath.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-static TExampleCreateFunc gCreateFuncs[128];
-
-TExampleCreateFunc *NVRenderExampleFactory::mExampleCreators = gCreateFuncs;
-QT3DSU32 NVRenderExampleFactory::mMaxCreators = 128;
-QT3DSU32 NVRenderExampleFactory::mNumCreators = 0;
-namespace {
-NVRenderErrorStream g_errorStream;
-NVRenderAllocator g_allocator(g_errorStream);
-NVFoundation *g_foundation(NULL);
-NVRenderContext *g_renderContext(NULL);
-NVRenderExample *g_example(NULL);
-QT3DSI32 g_exampleIdx(0);
-Time::Second g_runTime;
-Time g_timer;
-}
-
-bool NVRenderExampleFactory::nextExample()
-{
- if (g_example)
- g_example->release();
- g_example = 0;
- if (g_exampleIdx < (int)mNumCreators) {
- g_example = mExampleCreators[g_exampleIdx](*g_renderContext);
- ++g_exampleIdx;
- g_runTime = g_example->getRuntimeInSeconds();
- g_timer = Time();
- return true;
- }
- return false;
-}
-
-void NVRenderExampleFactory::beginExamples()
-{
- g_foundation = NVCreateFoundation(QT3DS_FOUNDATION_VERSION, g_allocator, g_errorStream);
- g_renderContext =
- &NVRenderContext::CreateGL(*g_foundation, NVRenderContextType(NVRenderContextValues::GL2));
- nextExample();
-}
-bool NVRenderExampleFactory::update()
-{
- Time::Second currentTime = g_timer.peekElapsedSeconds();
- if (currentTime > g_runTime)
- nextExample();
- if (g_example)
- g_example->drawFrame(currentTime);
-
- return g_example != NULL;
-}
-
-void NVRenderExampleFactory::endExamples()
-{
- g_exampleIdx = mNumCreators;
- nextExample();
- if (g_renderContext)
- g_renderContext->release();
- if (g_foundation)
- g_foundation->release();
-
- g_renderContext = NULL;
- g_foundation = NULL;
-}
-
-namespace qt3ds {
-namespace render {
- ///////////////////////////////////////////////////////////////////////////////
-
- // Math stuff
-
- int eq(float a, float b)
- {
- float diff = a - b;
- if (diff < 0) {
- diff = -diff;
- }
- return diff <= eps;
- }
-
- //
- // Matrix functions, since GLES 2.x doesn't provide them
- //
-
- void NvGl2DemoMatrixIdentity(float m[16])
- {
- memset(m, 0, sizeof(float) * 16);
- m[4 * 0 + 0] = m[4 * 1 + 1] = m[4 * 2 + 2] = m[4 * 3 + 3] = 1.0;
- }
-
- int NvGl2DemoMatrixEquals(float a[16], float b[16])
- {
- int i;
- for (i = 0; i < 16; ++i)
- if (!eq(a[i], b[i]))
- return 0;
-
- return 1;
- }
-
- void NvGl2DemoMatrixTranspose(float m[16])
- {
- int i, j;
- float t;
- for (i = 1; i < 4; ++i)
- for (j = 0; j < i; ++j) {
- t = m[4 * i + j];
- m[4 * i + j] = m[4 * j + i];
- m[4 * j + i] = t;
- }
- }
-
- void NvGl2DemoMatrixMultiply(float m0[16], float m1[16])
- {
- int r, c, i;
- for (r = 0; r < 4; r++) {
- float m[4] = { 0.0, 0.0, 0.0, 0.0 };
- for (c = 0; c < 4; c++) {
- for (i = 0; i < 4; i++) {
- m[c] += m0[4 * i + r] * m1[4 * c + i];
- }
- }
- for (c = 0; c < 4; c++) {
- m0[4 * c + r] = m[c];
- }
- }
- }
-
- void NvGl2DemoMatrixMultiply_4x4_3x3(float m0[16], float m1[9])
- {
- int r, c, i;
- for (r = 0; r < 4; r++) {
- float m[3] = { 0.0, 0.0, 0.0 };
- for (c = 0; c < 3; c++) {
- for (i = 0; i < 3; i++) {
- m[c] += m0[4 * i + r] * m1[3 * c + i];
- }
- }
- for (c = 0; c < 3; c++) {
- m0[4 * c + r] = m[c];
- }
- }
- }
-
- void NvGl2DemoMatrixMultiply_3x3(float m0[9], float m1[9])
- {
- int r, c, i;
- for (r = 0; r < 3; r++) {
- float m[3] = { 0.0, 0.0, 0.0 };
- for (c = 0; c < 3; c++) {
- for (i = 0; i < 3; i++) {
- m[c] += m0[3 * i + r] * m1[3 * c + i];
- }
- }
- for (c = 0; c < 3; c++) {
- m0[3 * c + r] = m[c];
- }
- }
- }
-
- void NvGl2DemoMatrixFrustum(float m[16], float l, float r, float b, float t, float n, float f)
- {
- float m1[16];
- float rightMinusLeftInv, topMinusBottomInv, farMinusNearInv, twoNear;
-
- rightMinusLeftInv = 1.0f / (r - l);
- topMinusBottomInv = 1.0f / (t - b);
- farMinusNearInv = 1.0f / (f - n);
- twoNear = 2.0f * n;
-
- m1[0] = twoNear * rightMinusLeftInv;
- m1[1] = 0.0f;
- m1[2] = 0.0f;
- m1[3] = 0.0f;
-
- m1[4] = 0.0f;
- m1[5] = twoNear * topMinusBottomInv;
- m1[6] = 0.0f;
- m1[7] = 0.0f;
-
- m1[8] = (r + l) * rightMinusLeftInv;
- m1[9] = (t + b) * topMinusBottomInv;
- m1[10] = -(f + n) * farMinusNearInv;
- m1[11] = -1.0f;
-
- m1[12] = 0.0f;
- m1[13] = 0.0f;
- m1[14] = -(twoNear * f) * farMinusNearInv;
- m1[15] = 0.0f;
-
- NvGl2DemoMatrixMultiply(m, m1);
- }
-
- void NvGl2DemoMatrixOrtho(float m[16], float l, float r, float b, float t, float n, float f)
- {
- float m1[16];
- float rightMinusLeftInv, topMinusBottomInv, farMinusNearInv;
-
- rightMinusLeftInv = 1.0f / (r - l);
- topMinusBottomInv = 1.0f / (t - b);
- farMinusNearInv = 1.0f / (f - n);
-
- m1[0] = 2.0f * rightMinusLeftInv;
- m1[1] = 0.0f;
- m1[2] = 0.0f;
- m1[3] = 0.0f;
-
- m1[4] = 0.0f;
- m1[5] = 2.0f * topMinusBottomInv;
- m1[6] = 0.0f;
- m1[7] = 0.0f;
-
- m1[8] = 0.0f;
- m1[9] = 0.0f;
- m1[10] = -2.0f * farMinusNearInv;
- m1[11] = 0.0f;
-
- m1[12] = -(r + l) * rightMinusLeftInv;
- m1[13] = -(t + b) * topMinusBottomInv;
- m1[14] = -(f + n) * farMinusNearInv;
- m1[15] = 1.0f;
-
- NvGl2DemoMatrixMultiply(m, m1);
- }
-
- void NvGl2DemoMatrixTranslate(float m[16], float x, float y, float z)
- {
- float m1[16];
- NvGl2DemoMatrixIdentity(m1);
-
- m1[4 * 3 + 0] = x;
- m1[4 * 3 + 1] = y;
- m1[4 * 3 + 2] = z;
-
- NvGl2DemoMatrixMultiply(m, m1);
- }
-
- void NvGl2DemoMatrixRotate_create3x3(float m[9], float theta, float x, float y, float z)
- {
- float len = (float)sqrtf(x * x + y * y + z * z);
- float u0 = x / len;
- float u1 = y / len;
- float u2 = z / len;
- float rad = (float)(theta / 180 * NVPi);
- float c = (float)cosf(rad);
- float s = (float)sinf(rad);
- m[3 * 0 + 0] = u0 * u0 + c * (1 - u0 * u0) + s * 0;
- m[3 * 0 + 1] = u0 * u1 + c * (0 - u0 * u1) + s * u2;
- m[3 * 0 + 2] = u0 * u2 + c * (0 - u0 * u2) - s * u1;
-
- m[3 * 1 + 0] = u1 * u0 + c * (0 - u1 * u0) - s * u2;
- m[3 * 1 + 1] = u1 * u1 + c * (1 - u1 * u1) + s * 0;
- m[3 * 1 + 2] = u1 * u2 + c * (0 - u1 * u2) + s * u0;
-
- m[3 * 2 + 0] = u2 * u0 + c * (0 - u2 * u0) + s * u1;
- m[3 * 2 + 1] = u2 * u1 + c * (0 - u2 * u1) - s * u0;
- m[3 * 2 + 2] = u2 * u2 + c * (1 - u2 * u2) + s * 0;
- }
-
- void NvGl2DemoMatrixRotate(float m[16], float theta, float x, float y, float z)
- {
- float r[9];
- NvGl2DemoMatrixRotate_create3x3(r, theta, x, y, z);
- NvGl2DemoMatrixMultiply_4x4_3x3(m, r);
- }
-
- void NvGl2DemoMatrixRotate_3x3(float m[9], float theta, float x, float y, float z)
- {
- float r[9];
- NvGl2DemoMatrixRotate_create3x3(r, theta, x, y, z);
- NvGl2DemoMatrixMultiply_3x3(m, r);
- }
-
- float NvGl2DemoMatrixDeterminant(float m[16])
- {
- return m[4 * 0 + 3] * m[4 * 1 + 2] * m[4 * 2 + 1] * m[4 * 3 + 0]
- - m[4 * 0 + 2] * m[4 * 1 + 3] * m[4 * 2 + 1] * m[4 * 3 + 0]
- - m[4 * 0 + 3] * m[4 * 1 + 1] * m[4 * 2 + 2] * m[4 * 3 + 0]
- + m[4 * 0 + 1] * m[4 * 1 + 3] * m[4 * 2 + 2] * m[4 * 3 + 0]
- + m[4 * 0 + 2] * m[4 * 1 + 1] * m[4 * 2 + 3] * m[4 * 3 + 0]
- - m[4 * 0 + 1] * m[4 * 1 + 2] * m[4 * 2 + 3] * m[4 * 3 + 0]
- - m[4 * 0 + 3] * m[4 * 1 + 2] * m[4 * 2 + 0] * m[4 * 3 + 1]
- + m[4 * 0 + 2] * m[4 * 1 + 3] * m[4 * 2 + 0] * m[4 * 3 + 1]
- + m[4 * 0 + 3] * m[4 * 1 + 0] * m[4 * 2 + 2] * m[4 * 3 + 1]
- - m[4 * 0 + 0] * m[4 * 1 + 3] * m[4 * 2 + 2] * m[4 * 3 + 1]
- - m[4 * 0 + 2] * m[4 * 1 + 0] * m[4 * 2 + 3] * m[4 * 3 + 1]
- + m[4 * 0 + 0] * m[4 * 1 + 2] * m[4 * 2 + 3] * m[4 * 3 + 1]
- + m[4 * 0 + 3] * m[4 * 1 + 1] * m[4 * 2 + 0] * m[4 * 3 + 2]
- - m[4 * 0 + 1] * m[4 * 1 + 3] * m[4 * 2 + 0] * m[4 * 3 + 2]
- - m[4 * 0 + 3] * m[4 * 1 + 0] * m[4 * 2 + 1] * m[4 * 3 + 2]
- + m[4 * 0 + 0] * m[4 * 1 + 3] * m[4 * 2 + 1] * m[4 * 3 + 2]
- + m[4 * 0 + 1] * m[4 * 1 + 0] * m[4 * 2 + 3] * m[4 * 3 + 2]
- - m[4 * 0 + 0] * m[4 * 1 + 1] * m[4 * 2 + 3] * m[4 * 3 + 2]
- - m[4 * 0 + 2] * m[4 * 1 + 1] * m[4 * 2 + 0] * m[4 * 3 + 3]
- + m[4 * 0 + 1] * m[4 * 1 + 2] * m[4 * 2 + 0] * m[4 * 3 + 3]
- + m[4 * 0 + 2] * m[4 * 1 + 0] * m[4 * 2 + 1] * m[4 * 3 + 3]
- - m[4 * 0 + 0] * m[4 * 1 + 2] * m[4 * 2 + 1] * m[4 * 3 + 3]
- - m[4 * 0 + 1] * m[4 * 1 + 0] * m[4 * 2 + 2] * m[4 * 3 + 3]
- + m[4 * 0 + 0] * m[4 * 1 + 1] * m[4 * 2 + 2] * m[4 * 3 + 3];
- }
-
- void NvGl2DemoMatrixInverse(float m[16])
- {
- float a[16];
- float det;
- int i;
- float b[16], e[16];
-
- a[4 * 0 + 0] = m[4 * 1 + 2] * m[4 * 2 + 3] * m[4 * 3 + 1]
- - m[4 * 1 + 3] * m[4 * 2 + 2] * m[4 * 3 + 1]
- + m[4 * 1 + 3] * m[4 * 2 + 1] * m[4 * 3 + 2]
- - m[4 * 1 + 1] * m[4 * 2 + 3] * m[4 * 3 + 2]
- - m[4 * 1 + 2] * m[4 * 2 + 1] * m[4 * 3 + 3]
- + m[4 * 1 + 1] * m[4 * 2 + 2] * m[4 * 3 + 3];
- a[4 * 0 + 1] = m[4 * 0 + 3] * m[4 * 2 + 2] * m[4 * 3 + 1]
- - m[4 * 0 + 2] * m[4 * 2 + 3] * m[4 * 3 + 1]
- - m[4 * 0 + 3] * m[4 * 2 + 1] * m[4 * 3 + 2]
- + m[4 * 0 + 1] * m[4 * 2 + 3] * m[4 * 3 + 2]
- + m[4 * 0 + 2] * m[4 * 2 + 1] * m[4 * 3 + 3]
- - m[4 * 0 + 1] * m[4 * 2 + 2] * m[4 * 3 + 3];
- a[4 * 0 + 2] = m[4 * 0 + 2] * m[4 * 1 + 3] * m[4 * 3 + 1]
- - m[4 * 0 + 3] * m[4 * 1 + 2] * m[4 * 3 + 1]
- + m[4 * 0 + 3] * m[4 * 1 + 1] * m[4 * 3 + 2]
- - m[4 * 0 + 1] * m[4 * 1 + 3] * m[4 * 3 + 2]
- - m[4 * 0 + 2] * m[4 * 1 + 1] * m[4 * 3 + 3]
- + m[4 * 0 + 1] * m[4 * 1 + 2] * m[4 * 3 + 3];
- a[4 * 0 + 3] = m[4 * 0 + 3] * m[4 * 1 + 2] * m[4 * 2 + 1]
- - m[4 * 0 + 2] * m[4 * 1 + 3] * m[4 * 2 + 1]
- - m[4 * 0 + 3] * m[4 * 1 + 1] * m[4 * 2 + 2]
- + m[4 * 0 + 1] * m[4 * 1 + 3] * m[4 * 2 + 2]
- + m[4 * 0 + 2] * m[4 * 1 + 1] * m[4 * 2 + 3]
- - m[4 * 0 + 1] * m[4 * 1 + 2] * m[4 * 2 + 3];
- a[4 * 1 + 0] = m[4 * 1 + 3] * m[4 * 2 + 2] * m[4 * 3 + 0]
- - m[4 * 1 + 2] * m[4 * 2 + 3] * m[4 * 3 + 0]
- - m[4 * 1 + 3] * m[4 * 2 + 0] * m[4 * 3 + 2]
- + m[4 * 1 + 0] * m[4 * 2 + 3] * m[4 * 3 + 2]
- + m[4 * 1 + 2] * m[4 * 2 + 0] * m[4 * 3 + 3]
- - m[4 * 1 + 0] * m[4 * 2 + 2] * m[4 * 3 + 3];
- a[4 * 1 + 1] = m[4 * 0 + 2] * m[4 * 2 + 3] * m[4 * 3 + 0]
- - m[4 * 0 + 3] * m[4 * 2 + 2] * m[4 * 3 + 0]
- + m[4 * 0 + 3] * m[4 * 2 + 0] * m[4 * 3 + 2]
- - m[4 * 0 + 0] * m[4 * 2 + 3] * m[4 * 3 + 2]
- - m[4 * 0 + 2] * m[4 * 2 + 0] * m[4 * 3 + 3]
- + m[4 * 0 + 0] * m[4 * 2 + 2] * m[4 * 3 + 3];
- a[4 * 1 + 2] = m[4 * 0 + 3] * m[4 * 1 + 2] * m[4 * 3 + 0]
- - m[4 * 0 + 2] * m[4 * 1 + 3] * m[4 * 3 + 0]
- - m[4 * 0 + 3] * m[4 * 1 + 0] * m[4 * 3 + 2]
- + m[4 * 0 + 0] * m[4 * 1 + 3] * m[4 * 3 + 2]
- + m[4 * 0 + 2] * m[4 * 1 + 0] * m[4 * 3 + 3]
- - m[4 * 0 + 0] * m[4 * 1 + 2] * m[4 * 3 + 3];
- a[4 * 1 + 3] = m[4 * 0 + 2] * m[4 * 1 + 3] * m[4 * 2 + 0]
- - m[4 * 0 + 3] * m[4 * 1 + 2] * m[4 * 2 + 0]
- + m[4 * 0 + 3] * m[4 * 1 + 0] * m[4 * 2 + 2]
- - m[4 * 0 + 0] * m[4 * 1 + 3] * m[4 * 2 + 2]
- - m[4 * 0 + 2] * m[4 * 1 + 0] * m[4 * 2 + 3]
- + m[4 * 0 + 0] * m[4 * 1 + 2] * m[4 * 2 + 3];
- a[4 * 2 + 0] = m[4 * 1 + 1] * m[4 * 2 + 3] * m[4 * 3 + 0]
- - m[4 * 1 + 3] * m[4 * 2 + 1] * m[4 * 3 + 0]
- + m[4 * 1 + 3] * m[4 * 2 + 0] * m[4 * 3 + 1]
- - m[4 * 1 + 0] * m[4 * 2 + 3] * m[4 * 3 + 1]
- - m[4 * 1 + 1] * m[4 * 2 + 0] * m[4 * 3 + 3]
- + m[4 * 1 + 0] * m[4 * 2 + 1] * m[4 * 3 + 3];
- a[4 * 2 + 1] = m[4 * 0 + 3] * m[4 * 2 + 1] * m[4 * 3 + 0]
- - m[4 * 0 + 1] * m[4 * 2 + 3] * m[4 * 3 + 0]
- - m[4 * 0 + 3] * m[4 * 2 + 0] * m[4 * 3 + 1]
- + m[4 * 0 + 0] * m[4 * 2 + 3] * m[4 * 3 + 1]
- + m[4 * 0 + 1] * m[4 * 2 + 0] * m[4 * 3 + 3]
- - m[4 * 0 + 0] * m[4 * 2 + 1] * m[4 * 3 + 3];
- a[4 * 2 + 2] = m[4 * 0 + 1] * m[4 * 1 + 3] * m[4 * 3 + 0]
- - m[4 * 0 + 3] * m[4 * 1 + 1] * m[4 * 3 + 0]
- + m[4 * 0 + 3] * m[4 * 1 + 0] * m[4 * 3 + 1]
- - m[4 * 0 + 0] * m[4 * 1 + 3] * m[4 * 3 + 1]
- - m[4 * 0 + 1] * m[4 * 1 + 0] * m[4 * 3 + 3]
- + m[4 * 0 + 0] * m[4 * 1 + 1] * m[4 * 3 + 3];
- a[4 * 2 + 3] = m[4 * 0 + 3] * m[4 * 1 + 1] * m[4 * 2 + 0]
- - m[4 * 0 + 1] * m[4 * 1 + 3] * m[4 * 2 + 0]
- - m[4 * 0 + 3] * m[4 * 1 + 0] * m[4 * 2 + 1]
- + m[4 * 0 + 0] * m[4 * 1 + 3] * m[4 * 2 + 1]
- + m[4 * 0 + 1] * m[4 * 1 + 0] * m[4 * 2 + 3]
- - m[4 * 0 + 0] * m[4 * 1 + 1] * m[4 * 2 + 3];
- a[4 * 3 + 0] = m[4 * 1 + 2] * m[4 * 2 + 1] * m[4 * 3 + 0]
- - m[4 * 1 + 1] * m[4 * 2 + 2] * m[4 * 3 + 0]
- - m[4 * 1 + 2] * m[4 * 2 + 0] * m[4 * 3 + 1]
- + m[4 * 1 + 0] * m[4 * 2 + 2] * m[4 * 3 + 1]
- + m[4 * 1 + 1] * m[4 * 2 + 0] * m[4 * 3 + 2]
- - m[4 * 1 + 0] * m[4 * 2 + 1] * m[4 * 3 + 2];
- a[4 * 3 + 1] = m[4 * 0 + 1] * m[4 * 2 + 2] * m[4 * 3 + 0]
- - m[4 * 0 + 2] * m[4 * 2 + 1] * m[4 * 3 + 0]
- + m[4 * 0 + 2] * m[4 * 2 + 0] * m[4 * 3 + 1]
- - m[4 * 0 + 0] * m[4 * 2 + 2] * m[4 * 3 + 1]
- - m[4 * 0 + 1] * m[4 * 2 + 0] * m[4 * 3 + 2]
- + m[4 * 0 + 0] * m[4 * 2 + 1] * m[4 * 3 + 2];
- a[4 * 3 + 2] = m[4 * 0 + 2] * m[4 * 1 + 1] * m[4 * 3 + 0]
- - m[4 * 0 + 1] * m[4 * 1 + 2] * m[4 * 3 + 0]
- - m[4 * 0 + 2] * m[4 * 1 + 0] * m[4 * 3 + 1]
- + m[4 * 0 + 0] * m[4 * 1 + 2] * m[4 * 3 + 1]
- + m[4 * 0 + 1] * m[4 * 1 + 0] * m[4 * 3 + 2]
- - m[4 * 0 + 0] * m[4 * 1 + 1] * m[4 * 3 + 2];
- a[4 * 3 + 3] = m[4 * 0 + 1] * m[4 * 1 + 2] * m[4 * 2 + 0]
- - m[4 * 0 + 2] * m[4 * 1 + 1] * m[4 * 2 + 0]
- + m[4 * 0 + 2] * m[4 * 1 + 0] * m[4 * 2 + 1]
- - m[4 * 0 + 0] * m[4 * 1 + 2] * m[4 * 2 + 1]
- - m[4 * 0 + 1] * m[4 * 1 + 0] * m[4 * 2 + 2]
- + m[4 * 0 + 0] * m[4 * 1 + 1] * m[4 * 2 + 2];
-
- det = NvGl2DemoMatrixDeterminant(m);
-
- for (i = 0; i < 16; ++i)
- a[i] /= det;
-
- NvGl2DemoMatrixIdentity(e);
-
- NvGl2DemoMatrixCopy(b, m);
- NvGl2DemoMatrixMultiply(b, a);
-
- NvGl2DemoMatrixCopy(m, a);
- }
-
- void NvGl2DemoMatrixCopy(float dest[16], float src[16])
- {
- memcpy(dest, src, 16 * sizeof(float));
- }
-
- void NvGl2DemoMatrixPrint(float a[16])
- {
- int i, j;
-
- for (i = 0; i < 4; ++i)
- for (j = 0; j < 4; ++j)
- printf("%f%c", a[4 * i + j], j == 3 ? '\n' : ' ');
- }
-
- void NvGl2DemoMatrixVectorMultiply(float m[16], float v[4])
- {
- float res[4];
- int i, j;
-
- for (i = 0; i < 4; ++i) {
- res[i] = 0;
- for (j = 0; j < 4; ++j)
- res[i] += m[i * 4 + j] * v[j];
- }
-
- memcpy(v, res, sizeof(res));
- }
-}
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.h b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.h
deleted file mode 100644
index 79bfd911..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExample.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_EXAMPLE_H
-#define QT3DS_RENDER_EXAMPLE_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/NvRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContext;
-
- class NVRenderExample
- {
- protected:
- virtual ~NVRenderExample() {}
- public:
- virtual void drawFrame(double currentSeconds) = 0;
- virtual QT3DSU32 getRuntimeInSeconds() { return 5; }
- virtual void handleKeypress(int /*keypress*/) {}
- virtual void release() = 0;
- };
-
- typedef NVRenderExample *(*TExampleCreateFunc)(NVRenderContext &context);
-
- struct NVRenderExampleFactory
- {
- static TExampleCreateFunc *mExampleCreators;
- static QT3DSU32 mMaxCreators;
- static QT3DSU32 mNumCreators;
-
- static void addCreator(TExampleCreateFunc creator)
- {
- if (mNumCreators < mMaxCreators) {
- mExampleCreators[mNumCreators] = creator;
- ++mNumCreators;
- } else
- QT3DS_ASSERT(false);
- }
-
- // Assuming that the render context is egl
- // Relies on the global structures defined in demo common
- // to figure out window state.
- static bool nextExample();
- static void beginExamples();
- static bool update();
- static void endExamples();
- };
-
- template <typename TExample>
- struct NVRenderExampleCreator
- {
-
- static NVRenderExample *createExample(NVRenderContext &context)
- {
- return QT3DS_NEW(context.GetFoundation().getAllocator(), TExample)(context);
- }
- NVRenderExampleCreator() { NVRenderExampleFactory::addCreator(createExample); }
- };
-
-#define QT3DS_RENDER_REGISTER_EXAMPLE(dtype) static NVRenderExampleCreator<dtype> dtype##Creator
-
-#define eps 1e-4
-
- int eq(float a, float b);
-
- // Matrix functions
- void NvGl2DemoMatrixIdentity(float m[16]);
- int NvGl2DemoMatrixEquals(float a[16], float b[16]);
- void NvGl2DemoMatrixTranspose(float m[16]);
- void NvGl2DemoMatrixMultiply(float m0[16], float m1[16]);
- void NvGl2DemoMatrixMultiply_4x4_3x3(float m0[16], float m1[9]);
- void NvGl2DemoMatrixMultiply_3x3(float m0[9], float m1[9]);
- void NvGl2DemoMatrixFrustum(float m[16], float l, float r, float b, float t, float n, float f);
- void NvGl2DemoMatrixOrtho(float m[16], float l, float r, float b, float t, float n, float f);
- void NvGl2DemoMatrixTranslate(float m[16], float x, float y, float z);
- void NvGl2DemoMatrixRotate_create3x3(float m[9], float theta, float x, float y, float z);
- void NvGl2DemoMatrixRotate(float m[16], float theta, float x, float y, float z);
- void NvGl2DemoMatrixRotate_3x3(float m[9], float theta, float x, float y, float z);
-
- float NvGl2DemoMatrixDeterminant(float m[16]);
- void NvGl2DemoMatrixInverse(float m[16]);
- void NvGl2DemoMatrixCopy(float dest[16], float src[16]);
-
- void NvGl2DemoMatrixPrint(float a[16]);
-
- void NvGl2DemoMatrixVectorMultiply(float m[16], float v[4]);
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.cpp b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.cpp
deleted file mode 100644
index efae6f5e..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderExampleTools.h"
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render_util/NVRenderUtils.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSVec4.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-struct BoxFace
-{
- QT3DSVec3 positions[4];
- QT3DSVec3 normal;
-};
-
-static const BoxFace g_BoxFaces[] = {
- { // Z+
- QT3DSVec3(-1, -1, 1), QT3DSVec3(-1, 1, 1), QT3DSVec3(1, 1, 1), QT3DSVec3(1, -1, 1), QT3DSVec3(0, 0, 1) },
- { // X+
- QT3DSVec3(1, -1, 1), QT3DSVec3(1, 1, 1), QT3DSVec3(1, 1, -1), QT3DSVec3(1, -1, -1), QT3DSVec3(1, 0, 0) },
- { // Z-
- QT3DSVec3(1, -1, -1), QT3DSVec3(1, 1, -1), QT3DSVec3(-1, 1, -1), QT3DSVec3(-1, -1, -1),
- QT3DSVec3(0, 0, -1) },
- { // X-
- QT3DSVec3(-1, -1, -1), QT3DSVec3(-1, 1, -1), QT3DSVec3(-1, 1, 1), QT3DSVec3(-1, -1, 1),
- QT3DSVec3(-1, 0, 0) },
- { // Y+
- QT3DSVec3(-1, 1, 1), QT3DSVec3(-1, 1, -1), QT3DSVec3(1, 1, -1), QT3DSVec3(1, 1, 1), QT3DSVec3(0, 1, 0) },
- { // Y-
- QT3DSVec3(-1, -1, -1), QT3DSVec3(-1, -1, 1), QT3DSVec3(1, -1, 1), QT3DSVec3(1, -1, -1), QT3DSVec3(0, -1, 0) }
-};
-
-static const QT3DSVec3 g_BoxUVs[] = {
- QT3DSVec3(0, 1, 0), QT3DSVec3(0, 0, 0), QT3DSVec3(1, 0, 0), QT3DSVec3(1, 1, 0),
-};
-
-void NVRenderExampleTools::createBox(NVRenderContext &context,
- NVRenderVertexBuffer *&outVertexBuffer,
- NVRenderIndexBuffer *&outIndexBuffer, bool releaseMemory)
-{
- const QT3DSU32 numVerts = 24;
- const QT3DSU32 numIndices = 36;
- QT3DSVec3 extents = QT3DSVec3(1, 1, 1);
-
- NVRenderVertexBufferEntry entries[] = {
- NVRenderVertexBufferEntry("attr_pos", NVRenderComponentTypes::QT3DSF32, 3, 0),
- NVRenderVertexBufferEntry("attr_norm", NVRenderComponentTypes::QT3DSF32, 3, 3 * sizeof(QT3DSF32)),
- NVRenderVertexBufferEntry("attr_uv", NVRenderComponentTypes::QT3DSF32, 2, 6 * sizeof(QT3DSF32)),
- };
-
- QT3DSU32 bufStride = 8 * sizeof(QT3DSF32);
- QT3DSU32 bufSize = bufStride * numVerts;
- outVertexBuffer = context.CreateVertexBuffer(
- NVRenderBufferUsageType::Static, NVConstDataRef<NVRenderVertexBufferEntry>(entries, 3), 0,
- releaseMemory ? 0 : bufSize);
- QT3DS_ASSERT(bufStride == outVertexBuffer->GetStride());
- NVDataRef<QT3DSU8> vertData;
- if (releaseMemory)
- vertData = NVDataRef<QT3DSU8>(
- (QT3DSU8 *)QT3DS_ALLOC(context.GetFoundation().getAllocator(), bufSize, "VertexBufferData"),
- bufSize);
- else
- vertData = outVertexBuffer->LockBuffer(bufSize);
- QT3DSU8 *positions = (QT3DSU8 *)vertData.begin();
- QT3DSU8 *normals = positions + 3 * sizeof(QT3DSF32);
- QT3DSU8 *uvs = normals + 3 * sizeof(QT3DSF32);
-
- for (QT3DSU32 i = 0; i < 6; i++) {
- const BoxFace &bf = g_BoxFaces[i];
- for (QT3DSU32 j = 0; j < 4; j++) {
- QT3DSVec3 &p = *(QT3DSVec3 *)positions;
- positions = ((QT3DSU8 *)positions) + bufStride;
- QT3DSVec3 &n = *(QT3DSVec3 *)normals;
- normals = ((QT3DSU8 *)normals) + bufStride;
- QT3DSF32 *uv = (QT3DSF32 *)uvs;
- uvs = ((QT3DSU8 *)uvs) + bufStride;
- n = bf.normal;
- p = bf.positions[j].multiply(extents);
- uv[0] = g_BoxUVs[j].x;
- uv[1] = g_BoxUVs[j].y;
- }
- }
-
- if (releaseMemory) {
- outVertexBuffer->SetBuffer(vertData, false);
- context.GetFoundation().getAllocator().deallocate(vertData.begin());
- } else
- outVertexBuffer->UnlockBuffer();
-
- bufSize = numIndices * sizeof(QT3DSU16);
- outIndexBuffer =
- context.CreateIndexBuffer(NVRenderBufferUsageType::Static, NVRenderComponentTypes::QT3DSU16,
- releaseMemory ? 0 : bufSize);
- NVDataRef<QT3DSU8> indexData;
- if (releaseMemory)
- indexData = NVDataRef<QT3DSU8>(
- (QT3DSU8 *)QT3DS_ALLOC(context.GetFoundation().getAllocator(), bufSize, "IndexData"),
- bufSize);
- else
- indexData = outIndexBuffer->LockBuffer(bufSize);
- QT3DSU16 *indices = reinterpret_cast<QT3DSU16 *>(indexData.begin());
- for (QT3DSU8 i = 0; i < 6; i++) {
- const QT3DSU16 base = i * 4;
- *(indices++) = base + 0;
- *(indices++) = base + 1;
- *(indices++) = base + 2;
- *(indices++) = base + 0;
- *(indices++) = base + 2;
- *(indices++) = base + 3;
- }
- if (releaseMemory) {
- outIndexBuffer->SetBuffer(indexData, false);
- context.GetFoundation().getAllocator().deallocate(indexData.begin());
- } else
- outIndexBuffer->UnlockBuffer();
-}
-
-namespace {
-
-inline NVConstDataRef<QT3DSI8> toRef(const char *data)
-{
- size_t len = strlen(data) + 1;
- return NVConstDataRef<QT3DSI8>((const QT3DSI8 *)data, len);
-}
-
-static void dumpShaderOutput(NVRenderContext &ctx,
- const NVRenderVertFragCompilationResult &compResult)
-{
- if (!isTrivial(compResult.mFragCompilationOutput)) {
- ctx.GetFoundation().error(QT3DS_WARN, "Frag output:\n%s", compResult.mFragCompilationOutput);
- }
- if (!isTrivial(compResult.mVertCompilationOutput)) {
- ctx.GetFoundation().error(QT3DS_WARN, "Vert output:\n%s", compResult.mVertCompilationOutput);
- }
- if (!isTrivial(compResult.mLinkOutput)) {
- ctx.GetFoundation().error(QT3DS_WARN, "Link output:\n%s", compResult.mLinkOutput);
- }
-}
-
-NVRenderVertFragShader *compileAndDump(NVRenderContext &ctx, const char *name,
- const char *vertShader, const char *fragShader)
-{
- NVRenderVertFragCompilationResult compResult =
- ctx.CompileSource(name, toRef(vertShader), toRef(fragShader));
- dumpShaderOutput(ctx, compResult);
- return compResult.mShader;
-}
-}
-
-NVRenderVertFragShader *NVRenderExampleTools::createSimpleShader(NVRenderContext &ctx)
-{
- return compileAndDump(ctx, "SimpleShader", getSimpleVertShader(), getSimpleFragShader());
-}
-
-NVRenderVertFragShader *NVRenderExampleTools::createSimpleShaderTex(NVRenderContext &ctx)
-{
- return compileAndDump(ctx, "SimpleShader", getSimpleVertShader(), getSimpleFragShaderTex());
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.h b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.h
deleted file mode 100644
index 5b402868..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderExampleTools.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_EXAMPLE_TOOLS_H
-#define QT3DS_RENDER_EXAMPLE_TOOLS_H
-#include "Qt3DSRenderExample.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderExampleTools
- {
- public:
- static const char *getSimpleVertShader()
- {
- return "uniform mat4 mat_mvp;\n"
- "attribute vec3 attr_pos; // Vertex pos\n"
- "attribute vec3 attr_norm; // Vertex pos\n"
- "attribute vec2 attr_uv; // UV coords\n"
- "varying vec4 color_to_add;\n"
- "varying vec2 uv_coords;\n"
- "void main()\n"
- "{\n"
- "gl_Position = mat_mvp * vec4(attr_pos, 1.0);\n"
- "color_to_add.xyz = attr_norm * attr_norm;\n"
- "color_to_add.a = 1.0;\n"
- "uv_coords = attr_uv;\n"
- "}\n";
- }
-
- static const char *getSimpleFragShader()
- {
- return "precision mediump sampler2D;\n"
- "precision mediump float;\n"
- "varying vec4 color_to_add;\n"
- "void main()\n"
- "{\n"
- "gl_FragColor=color_to_add;\n"
- "}\n";
- }
-
- static const char *getSimpleFragShaderTex()
- {
- return "precision mediump sampler2D;\n"
- "precision mediump float;\n"
- "uniform sampler2D image0;\n"
- "varying vec2 uv_coords;\n"
- "void main()\n"
- "{\n"
- "gl_FragColor=vec4(texture2D( image0, uv_coords ).xyz, 1.0 );\n"
- "}\n";
- }
-
- static void createBox(NVRenderContext &context, NVRenderVertexBuffer *&outVertexBuffer,
- NVRenderIndexBuffer *&outIndexBuffer, bool releaseMemory = true);
- static NVRenderVertFragShader *createSimpleShader(NVRenderContext &context);
- static NVRenderVertFragShader *createSimpleShaderTex(NVRenderContext &context);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderRenderToTextureExample.cpp b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderRenderToTextureExample.cpp
deleted file mode 100644
index e2cb4149..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderRenderToTextureExample.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderExample.h"
-#include "Qt3DSRenderExampleTools.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "foundation/Qt3DSVec4.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-namespace {
-struct ShaderArgs
-{
- float mvp[16];
- NVRenderTexture2DPtr texture;
- NVRenderVertFragShaderPtr shader;
- ShaderArgs() {}
-};
-class RenderToTexture : public NVRenderExample
-{
- NVRenderContext &m_Context;
- NVScopedRefCounted<NVRenderVertexBuffer> mVertexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> mIndexBuffer;
- // Simple shader
- NVScopedRefCounted<NVRenderVertFragShader> mSimpleShader;
- // Simple shader with texture lookup.
- NVScopedRefCounted<NVRenderVertFragShader> mSimpleShaderTex;
-
- NVScopedRefCounted<NVRenderFrameBuffer> mFrameBuffer;
- NVScopedRefCounted<NVRenderTexture2D> mColorBuffer;
- NVScopedRefCounted<NVRenderTexture2D> mDepthBuffer;
-
- NVRenderHandle mGroupId;
- QT3DSU32 mFBWidth;
- QT3DSU32 mFBHeight;
-
- ShaderArgs mShaderArgs;
- float frus[16];
- float model[16];
- float rot[9];
-
-public:
- RenderToTexture(NVRenderContext &context)
- : m_Context(context)
- , mFBWidth(400)
- , mFBHeight(400)
- {
- NVRenderExampleTools::createBox(m_Context, mVertexBuffer.mPtr, mIndexBuffer.mPtr);
- mVertexBuffer->addRef();
- mIndexBuffer->addRef();
- mSimpleShader = NVRenderExampleTools::createSimpleShader(m_Context);
- mSimpleShaderTex = NVRenderExampleTools::createSimpleShaderTex(m_Context);
- // If you don't want the depth buffer information back out of the system, then you can
- // do this.
- // mDepthBuffer = m_Context.CreateRenderBuffer( NVRenderRenderBufferFormats::Depth16,
- // mFBWidth, mFBHeight );
-
- mDepthBuffer = m_Context.CreateTexture2D();
- mDepthBuffer->SetTextureData(NVDataRef<QT3DSU8>(), 0, mFBWidth, mFBHeight,
- NVRenderTextureFormats::Depth16);
- mColorBuffer = m_Context.CreateTexture2D();
- mColorBuffer->SetTextureData(NVDataRef<QT3DSU8>(), 0, mFBWidth, mFBHeight,
- NVRenderTextureFormats::RGBA8);
- if (mDepthBuffer.mPtr && mColorBuffer.mPtr) {
- // Creating objects tends to Bind them to their active state hooks.
- // So to protect the rest of the system against what they are doing (if we care), we
- // need
- // to push the current state
- // Auto-binds the framebuffer.
- mFrameBuffer = m_Context.CreateFrameBuffer();
- mFrameBuffer->Attach(NVRenderFrameBufferAttachments::Color0, *mColorBuffer.mPtr);
- mFrameBuffer->Attach(NVRenderFrameBufferAttachments::Depth, *mDepthBuffer.mPtr);
- QT3DS_ASSERT(mFrameBuffer->IsComplete());
-
- m_Context.SetRenderTarget(NULL);
- }
- mColorBuffer->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- mColorBuffer->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- m_Context.SetVertexBuffer(mVertexBuffer);
- m_Context.SetIndexBuffer(mIndexBuffer);
- m_Context.SetDepthTestEnabled(true);
- m_Context.SetDepthWriteEnabled(true);
- m_Context.SetClearColor(QT3DSVec4(.3f));
- // Setup various matrici
- NvGl2DemoMatrixIdentity(model);
- NvGl2DemoMatrixIdentity(frus);
- NvGl2DemoMatrixFrustum(frus, -1, 1, -1, 1, 1, 10);
- NvGl2DemoMatrixTranslate(model, 0, 0, -4);
- mShaderArgs.texture = mColorBuffer.mPtr;
- }
- void setupMVP(QT3DSVec3 translation)
- {
- float *mvp(mShaderArgs.mvp);
- memCopy(mvp, frus, 16 * sizeof(float));
- NvGl2DemoMatrixMultiply(mvp, model);
- NvGl2DemoMatrixTranslate(mvp, translation.x, translation.y, translation.z);
- NvGl2DemoMatrixMultiply_4x4_3x3(mvp, rot);
- }
- void DrawIndexedArrays(QT3DSVec3 translation)
- {
- setupMVP(translation);
- m_Context.SetActiveShader(mShaderArgs.shader);
- mShaderArgs.shader->Bind();
- mShaderArgs.shader->SetPropertyValue("mat_mvp",
- *reinterpret_cast<QT3DSMat44 *>(mShaderArgs.mvp));
- mShaderArgs.shader->SetPropertyValue("image0", mShaderArgs.texture);
- m_Context.Draw(NVRenderDrawMode::Triangles, mIndexBuffer->GetNumIndices(), 0);
- }
-
- virtual void drawFrame(double currentSeconds)
- {
- NvGl2DemoMatrixRotate_create3x3(rot, (float)currentSeconds * 50, .707f, .707f, 0);
- NVRenderClearFlags clearFlags(NVRenderClearValues::Color | NVRenderClearValues::Depth);
- // render to frame buffer
- {
- NVRenderContextScopedProperty<NVRenderFrameBufferPtr> __framebuffer(
- m_Context, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget,
- mFrameBuffer);
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- m_Context, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport,
- NVRenderRect(0, 0, mFBWidth, mFBHeight));
- NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- m_Context, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
- QT3DSVec4(.6f));
- m_Context.Clear(clearFlags);
- mShaderArgs.shader = mSimpleShader;
- DrawIndexedArrays(QT3DSVec3(0.f));
- }
- m_Context.Clear(clearFlags);
- mShaderArgs.texture = mColorBuffer;
- mShaderArgs.shader = mSimpleShaderTex;
-
- DrawIndexedArrays(QT3DSVec3(-2.f, 0.f, 0.f));
-
- mShaderArgs.texture = mDepthBuffer;
- DrawIndexedArrays(QT3DSVec3(2.f, 0.f, 0.f));
- }
- virtual QT3DSU32 getRuntimeInSeconds()
- {
- return mSimpleShader.mPtr && mSimpleShaderTex.mPtr ? 5 : 0;
- }
- virtual void release() { NVDelete(m_Context.GetFoundation(), this); }
-};
-}
-
-QT3DS_RENDER_REGISTER_EXAMPLE(RenderToTexture); \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderSpinningCubeExample.cpp b/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderSpinningCubeExample.cpp
deleted file mode 100644
index 807f0821..00000000
--- a/src/Runtime/ogl-runtime/src/render/Examples/Qt3DSRenderSpinningCubeExample.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderExample.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "render/NVRenderVertFragShader.h"
-#include "render_util/NVRenderUtils.h"
-#include "Qt3DSRenderExampleTools.h"
-#include "foundation/Qt3DSMat44.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-#pragma warning(disable : 4189)
-#pragma warning(disable : 4100)
-
-namespace {
-
-struct ShaderArguments
-{
- QT3DSMat44 mMatrix;
-};
-
-class SpinningCube : public NVRenderExample
-{
- NVRenderContext &m_Context;
- NVScopedRefCounted<NVRenderVertexBuffer> mVertexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> mIndexBuffer;
- NVScopedRefCounted<NVRenderVertFragShader> mShader;
- NVRenderHandle mShaderArgGroupId;
- float frus[16];
- float model[16];
- float rot[9];
-
-public:
- SpinningCube(NVRenderContext &ctx)
- : m_Context(ctx)
- {
- NVRenderExampleTools::createBox(ctx, mVertexBuffer.mPtr, mIndexBuffer.mPtr, false);
- mVertexBuffer->addRef();
- mIndexBuffer->addRef();
- mShader = NVRenderExampleTools::createSimpleShader(ctx);
- ctx.SetViewport(NVRenderRect(0, 0, 400, 400));
- // These properties will get applied just before render no matter what
- // so we can just use the default settings here.
- ctx.SetVertexBuffer(mVertexBuffer);
- ctx.SetIndexBuffer(mIndexBuffer);
- if (mShader) {
- ctx.SetActiveShader(mShader);
- }
- ctx.SetDepthTestEnabled(true);
- ctx.SetDepthWriteEnabled(true);
- NvGl2DemoMatrixIdentity(model);
- NvGl2DemoMatrixIdentity(frus);
- NvGl2DemoMatrixFrustum(frus, -1, 1, -1, 1, 1, 10);
- NvGl2DemoMatrixTranslate(model, 0, 0, -4);
- }
- virtual void drawFrame(double currentSeconds)
- {
- NvGl2DemoMatrixRotate_create3x3(rot, (float)currentSeconds * 50, .707f, .707f, 0);
- float mvp[16];
- NvGl2DemoMatrixIdentity(mvp);
- NvGl2DemoMatrixMultiply(mvp, frus);
- NvGl2DemoMatrixMultiply(mvp, model);
- NvGl2DemoMatrixMultiply_4x4_3x3(mvp, rot);
-
- NVConstDataRef<QT3DSU8> instance((QT3DSU8 *)mvp, 16 * sizeof(float));
- m_Context.Clear(
- NVRenderClearFlags(NVRenderClearValues::Color | NVRenderClearValues::Depth));
- mShader->SetPropertyValue("mat_mvp", *reinterpret_cast<QT3DSMat44 *>(mvp));
- m_Context.Draw(NVRenderDrawMode::Triangles, mIndexBuffer->GetNumIndices(), 0);
- }
- virtual QT3DSU32 getRuntimeInSeconds() { return mShader.mPtr ? 5 : 0; }
- virtual void release() { NVDelete(m_Context.GetFoundation(), this); }
-};
-}
-QT3DS_RENDER_REGISTER_EXAMPLE(SpinningCube); \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.cpp
deleted file mode 100644
index 272c3e8c..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderAtomicCounterBuffer.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-namespace qt3ds {
-namespace render {
-
- ///< struct handling a constant buffer entry
- class AtomicCounterBufferEntry
- {
- public:
- CRegisteredString m_Name; ///< parameter Name
- QT3DSI32 m_Offset; ///< offset into the memory buffer
-
- AtomicCounterBufferEntry(CRegisteredString name, QT3DSI32 offset)
- : m_Name(name)
- , m_Offset(offset)
- {
- }
- };
-
- NVRenderAtomicCounterBuffer::NVRenderAtomicCounterBuffer(
- NVRenderContextImpl &context, CRegisteredString bufferName, size_t size,
- NVRenderBufferUsageType::Enum usageType, NVDataRef<QT3DSU8> data)
- : NVRenderDataBuffer(context, context.GetFoundation(), size,
- NVRenderBufferBindValues::Storage, usageType, data)
- , m_Name(bufferName)
- , m_AtomicCounterBufferEntryMap(
- m_Foundation.getAllocator(),
- "NVRenderAtomicCounterBuffer::m_AtomicCounterBufferEntryMap")
- , m_Dirty(true)
- {
- QT3DS_ASSERT(context.IsStorageBufferSupported());
- }
-
- NVRenderAtomicCounterBuffer::~NVRenderAtomicCounterBuffer()
- {
- for (TRenderAtomiCounterBufferEntryMap::iterator
- iter = m_AtomicCounterBufferEntryMap.begin(),
- end = m_AtomicCounterBufferEntryMap.end();
- iter != end; ++iter) {
- NVDelete(m_Foundation.getAllocator(), iter->second);
- }
-
- m_AtomicCounterBufferEntryMap.clear();
-
- m_Context.BufferDestroyed(*this);
- }
-
- void NVRenderAtomicCounterBuffer::Bind()
- {
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to Bind a locked buffer");
- QT3DS_ASSERT(false);
- }
-
- m_Backend->BindBuffer(m_BufferHandle, m_BindFlags);
- }
-
- void NVRenderAtomicCounterBuffer::BindToShaderProgram(QT3DSU32 index)
- {
- m_Backend->ProgramSetAtomicCounterBuffer(index, m_BufferHandle);
- }
-
- void NVRenderAtomicCounterBuffer::Update()
- {
- // we only update the buffer if it is dirty and we actually have some data
- if (m_Dirty && m_BufferData.size()) {
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, m_BufferData.size(), m_UsageType,
- m_BufferData.begin());
- m_Dirty = false;
- }
- }
-
- void NVRenderAtomicCounterBuffer::UpdateData(QT3DSI32 offset, NVDataRef<QT3DSU8> data)
- {
- // we only update the buffer if we something
- if (data.size())
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, data.size(), m_UsageType,
- data.begin() + offset);
- }
-
- void NVRenderAtomicCounterBuffer::AddParam(CRegisteredString name, QT3DSU32 offset)
- {
- if (m_AtomicCounterBufferEntryMap.find(name) == m_AtomicCounterBufferEntryMap.end()) {
- AtomicCounterBufferEntry *newEntry =
- QT3DS_NEW(m_Foundation.getAllocator(), AtomicCounterBufferEntry)(name, offset);
-
- if (newEntry)
- m_AtomicCounterBufferEntryMap.insert(eastl::make_pair(name, newEntry));
- } else {
- // no duplicated entries
- return;
- }
- }
-
- bool NVRenderAtomicCounterBuffer::ContainsParam(CRegisteredString name)
- {
- if (m_AtomicCounterBufferEntryMap.find(name) != m_AtomicCounterBufferEntryMap.end())
- return true;
- else
- return false;
- }
-
- NVRenderAtomicCounterBuffer *
- NVRenderAtomicCounterBuffer::Create(NVRenderContextImpl &context, const char *bufferName,
- NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVFoundationBase &fnd(context.GetFoundation());
- NVRenderAtomicCounterBuffer *retval = NULL;
-
- if (context.IsAtomicCounterBufferSupported()) {
- CRegisteredString theBufferName(context.GetStringTable().RegisterStr(bufferName));
- QT3DSU32 bufSize = sizeof(NVRenderAtomicCounterBuffer);
- QT3DSU8 *newMem = (QT3DSU8 *)QT3DS_ALLOC(fnd.getAllocator(), bufSize, "AtomicCounterBuffer");
- retval = new (newMem) NVRenderAtomicCounterBuffer(
- context, theBufferName, size, usageType,
- toDataRef(const_cast<QT3DSU8 *>(bufferData.begin()), bufferData.size()));
- } else {
- QT3DS_ASSERT(false);
- }
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.h
deleted file mode 100644
index 5ff449ea..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAtomicCounterBuffer.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_ATOMIC_COUNTER_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_ATOMIC_COUNTER_BUFFER_H
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Utils.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderDataBuffer.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- // forward declaration
- class NVRenderContextImpl;
- class AtomicCounterBufferEntry;
-
- typedef nvhash_map<CRegisteredString, AtomicCounterBufferEntry *>
- TRenderAtomiCounterBufferEntryMap;
-
- ///< Constant (uniform) buffer representation
- class QT3DS_AUTOTEST_EXPORT NVRenderAtomicCounterBuffer : public NVRenderDataBuffer
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] bufferName Name of the buffer. Must match the name used in programs
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return.
- */
- NVRenderAtomicCounterBuffer(NVRenderContextImpl &context, CRegisteredString bufferName,
- size_t size, NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data);
-
- ///< destructor
- virtual ~NVRenderAtomicCounterBuffer();
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- void Bind() override;
-
- /**
- * @brief bind the buffer to a shader program
- *
- * @param[in] index Index of the constant buffer within the program
- *
- * @return no return.
- */
- virtual void BindToShaderProgram(QT3DSU32 index);
-
- /**
- * @brief update the buffer to hardware
- *
- * @return no return.
- */
- virtual void Update();
-
- /**
- * @brief update a piece of memory directly within the storage buffer
- *
- * Note: When you use this function you should know what you are doing.
- * The memory layout within C++ must exactly match the memory layout in the
- *shader.
- * We use std140 (430) layout which guarantees a specific layout behavior across
- *all HW vendors.
- * How the memory layout is computed can be found in the GL spec.
- *
- * @param[in] offset offset into storage buffer
- * @param[in] data pointer to data
- *
- * @return no return
- */
- void UpdateData(QT3DSI32 offset, NVDataRef<QT3DSU8> data);
-
- /**
- * @brief add a parameter to the atomic counter buffer
- *
- * @param[in] name Name of the parameter (must match the name in the shader
- * program)
- * @param[in] offset Offset in bytes into the buffer
- *
- * @return no return
- */
- void AddParam(CRegisteredString name, QT3DSU32 offset);
-
- /**
- * @brief Check if the buffer contains this param
- *
- * @param[in] name Name of the parameter (must match the name in the shader
- * program)
- *
- * @return no return
- */
- bool ContainsParam(CRegisteredString name);
-
- /**
- * @brief get the buffer name
- *
- * @return the buffer name
- */
- CRegisteredString GetBufferName() const { return m_Name; }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const override
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
-
- /**
- * @brief create a NVRenderAtomicCounterBuffer object
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return the buffer object or NULL
- */
- static NVRenderAtomicCounterBuffer *Create(NVRenderContextImpl &context,
- const char *bufferName,
- NVRenderBufferUsageType::Enum usageType,
- size_t size, NVConstDataRef<QT3DSU8> bufferData);
-
- private:
- CRegisteredString m_Name; ///< buffer name
- TRenderAtomiCounterBufferEntryMap
- m_AtomicCounterBufferEntryMap; ///< holds the entries of a atomic counter buffer
- bool m_Dirty; ///< true if buffer is dirty
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.cpp
deleted file mode 100644
index 42641a04..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderAttribLayout.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- ///< constructor
- NVRenderAttribLayout::NVRenderAttribLayout(NVRenderContextImpl &context,
- NVConstDataRef<NVRenderVertexBufferEntry> attribs)
- : m_Context(context)
- , m_Foundation(context.GetFoundation())
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- {
- m_AttribLayoutHandle = m_Backend->CreateAttribLayout(attribs);
- QT3DS_ASSERT(m_AttribLayoutHandle);
- }
-
- ///< destructor
- NVRenderAttribLayout::~NVRenderAttribLayout()
- {
- if (m_AttribLayoutHandle) {
- m_Backend->ReleaseAttribLayout(m_AttribLayoutHandle);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.h
deleted file mode 100644
index da801c8e..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderAttribLayout.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_ATTRIB_LAYOUT_H
-#define QT3DS_RENDER_ATTRIB_LAYOUT_H
-
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Utils.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- // forward declarations
- class NVRenderContextImpl;
- class NVRenderBackend;
-
- ///< this class handles the vertex attribute layout setup
- class NVRenderAttribLayout : public NVRefCounted
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] attribs Pointer to attribute list
- *
- * @return No return.
- */
- NVRenderAttribLayout(NVRenderContextImpl &context,
- NVConstDataRef<NVRenderVertexBufferEntry> attribs);
- ///< destructor
- ~NVRenderAttribLayout();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendAttribLayoutObject GetAttribLayoutHandle() const
- {
- return m_AttribLayoutHandle;
- }
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
-
- NVRenderBackend::NVRenderBackendAttribLayoutObject
- m_AttribLayoutHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.cpp
deleted file mode 100644
index e881d27f..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.cpp
+++ /dev/null
@@ -1,1049 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qdebug.h>
-
-#include "Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
-
-using namespace foundation;
-
-QDebug operator<<(QDebug debug, const NVRenderComponentTypes::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderComponentTypes::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderContextValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderContextValues::Enum::GLES2:
- debug.nospace() << "GLES2";
- break;
- case NVRenderContextValues::Enum::GL2:
- debug.nospace() << "GL2";
- break;
- case NVRenderContextValues::Enum::GLES3:
- debug.nospace() << "GLES3";
- break;
- case NVRenderContextValues::Enum::GL3:
- debug.nospace() << "GL3";
- break;
- case NVRenderContextValues::Enum::GLES3PLUS:
- debug.nospace() << "GLES3PLUS";
- break;
- case NVRenderContextValues::Enum::GL4:
- debug.nospace() << "GL4";
- break;
- case NVRenderContextValues::Enum::NullContext:
- debug.nospace() << "NullContext";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderClearValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderClearValues::Enum::Color:
- debug.nospace() << "Color";
- break;
- case NVRenderClearValues::Enum::Depth:
- debug.nospace() << "Depth";
- break;
- case NVRenderClearValues::Enum::Stencil:
- debug.nospace() << "Stencil";
- break;
- case NVRenderClearValues::Enum::Coverage:
- debug.nospace() << "Coverage";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderQueryType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderQueryType::Enum::Samples:
- debug.nospace() << "Samples";
- break;
- case NVRenderQueryType::Enum::Timer:
- debug.nospace() << "Timer";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderQueryResultType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderQueryResultType::Enum::ResultAvailable:
- debug.nospace() << "ResultAvailable";
- break;
- case NVRenderQueryResultType::Enum::Result:
- debug.nospace() << "Result";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderSyncType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderSyncType::Enum::GpuCommandsComplete:
- debug.nospace() << "GpuCommandsComplete";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderSyncValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "Unknown";
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderCommandFlushValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderCommandFlushValues::Enum::SyncFlushCommands:
- debug.nospace() << "SyncFlushCommands";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBufferBindValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderBufferBindValues::Enum::Vertex:
- debug.nospace() << "Vertex";
- break;
- case NVRenderBufferBindValues::Enum::Index:
- debug.nospace() << "Index";
- break;
- case NVRenderBufferBindValues::Enum::Constant:
- debug.nospace() << "Constant";
- break;
- case NVRenderBufferBindValues::Enum::Storage:
- debug.nospace() << "Storage";
- break;
- case NVRenderBufferBindValues::Enum::Atomic_Counter:
- debug.nospace() << "Atomic_Counter";
- break;
- case NVRenderBufferBindValues::Enum::Draw_Indirect:
- debug.nospace() << "Draw_Indirect";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBufferUsageType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderBufferUsageType::Enum::Static:
- debug.nospace() << "Static";
- break;
- case NVRenderBufferUsageType::Enum::Dynamic:
- debug.nospace() << "Dynamic";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderImageAccessType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderImageAccessType::Enum::Read:
- debug.nospace() << "Read";
- break;
- case NVRenderImageAccessType::Enum::Write:
- debug.nospace() << "Write";
- break;
- case NVRenderImageAccessType::Enum::ReadWrite:
- debug.nospace() << "ReadWrite";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBufferAccessTypeValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderBufferAccessTypeValues::Enum::Read:
- debug.nospace() << "Read";
- break;
- case NVRenderBufferAccessTypeValues::Enum::Write:
- debug.nospace() << "Write";
- break;
- case NVRenderBufferAccessTypeValues::Enum::Invalid:
- debug.nospace() << "Invalid";
- break;
- case NVRenderBufferAccessTypeValues::Enum::InvalidRange:
- debug.nospace() << "InvalidRange";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBufferBarrierValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderBufferBarrierValues::Enum::VertexAttribArray:
- debug.nospace() << "VertexAttribArray";
- break;
- case NVRenderBufferBarrierValues::Enum::ElementArray:
- debug.nospace() << "ElementArray";
- break;
- case NVRenderBufferBarrierValues::Enum::UniformBuffer:
- debug.nospace() << "UniformBuffer";
- break;
- case NVRenderBufferBarrierValues::Enum::TextureFetch:
- debug.nospace() << "TextureFetch";
- break;
- case NVRenderBufferBarrierValues::Enum::ShaderImageAccess:
- debug.nospace() << "ShaderImageAccess";
- break;
- case NVRenderBufferBarrierValues::Enum::CommandBuffer:
- debug.nospace() << "CommandBuffer";
- break;
- case NVRenderBufferBarrierValues::Enum::PixelBuffer:
- debug.nospace() << "PixelBuffer";
- break;
- case NVRenderBufferBarrierValues::Enum::TextureUpdate:
- debug.nospace() << "TextureUpdate";
- break;
- case NVRenderBufferBarrierValues::Enum::BufferUpdate:
- debug.nospace() << "BufferUpdate";
- break;
- case NVRenderBufferBarrierValues::Enum::Framebuffer:
- debug.nospace() << "Framebuffer";
- break;
- case NVRenderBufferBarrierValues::Enum::TransformFeedback:
- debug.nospace() << "TransformFeedback";
- break;
- case NVRenderBufferBarrierValues::Enum::AtomicCounter:
- debug.nospace() << "AtomicCounter";
- break;
- case NVRenderBufferBarrierValues::Enum::ShaderStorage:
- debug.nospace() << "ShaderStorage";
- break;
- case NVRenderBufferBarrierValues::Enum::All:
- debug.nospace() << "All";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderRenderBufferFormats::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderRenderBufferFormats::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureFormats::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderTextureFormats::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureTargetType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderTextureTargetType::Enum::Texture2D:
- debug.nospace() << "Texture2D";
- break;
- case NVRenderTextureTargetType::Enum::Texture2D_MS:
- debug.nospace() << "Texture2D_MS";
- break;
- case NVRenderTextureTargetType::Enum::Texture2D_Array:
- debug.nospace() << "Texture2D_Array";
- break;
- case NVRenderTextureTargetType::Enum::TextureCube:
- debug.nospace() << "TextureCube";
- break;
- case NVRenderTextureTargetType::Enum::TextureCubePosX:
- debug.nospace() << "TextureCubePosX";
- break;
- case NVRenderTextureTargetType::Enum::TextureCubeNegX:
- debug.nospace() << "TextureCubeNegX";
- break;
- case NVRenderTextureTargetType::Enum::TextureCubePosY:
- debug.nospace() << "TextureCubePosY";
- break;
- case NVRenderTextureTargetType::Enum::TextureCubeNegY:
- debug.nospace() << "TextureCubeNegY";
- break;
- case NVRenderTextureTargetType::Enum::TextureCubePosZ:
- debug.nospace() << "TextureCubePosZ";
- break;
- case NVRenderTextureTargetType::Enum::TextureCubeNegZ:
- debug.nospace() << "TextureCubeNegZ";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureUnit::Enum value)
-{
- QDebugStateSaver saver(debug);
- if (value > NVRenderTextureUnit::Enum::TextureUnit_31)
- debug.nospace() << "Unknown";
- else
- debug.nospace() << "TextureUnit_" << value;
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureCompareMode::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderTextureCompareMode::Enum::NoCompare:
- debug.nospace() << "NoCompare";
- break;
- case NVRenderTextureCompareMode::Enum::CompareToRef:
- debug.nospace() << "CompareToRef";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureSwizzleMode::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderTextureSwizzleMode::Enum::NoSwizzle:
- debug.nospace() << "NoSwizzle";
- break;
- case NVRenderTextureSwizzleMode::Enum::L8toR8:
- debug.nospace() << "L8toR8";
- break;
- case NVRenderTextureSwizzleMode::Enum::A8toR8:
- debug.nospace() << "A8toR8";
- break;
- case NVRenderTextureSwizzleMode::Enum::L8A8toRG8:
- debug.nospace() << "L8A8toRG8";
- break;
- case NVRenderTextureSwizzleMode::Enum::L16toR16:
- debug.nospace() << "L16toR16";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureCompareOp::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
-#define QT3DS_RENDER_HANDLE_BOOL_OP(x) \
- case NVRenderTextureCompareOp::Enum::x: \
- debug.nospace() << #x; \
- break;
- QT3DS_RENDER_ITERATE_BOOL_OP
- #undef QT3DS_RENDER_HANDLE_BOOL_OP
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureMinifyingOp::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderTextureMinifyingOp::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureMagnifyingOp::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderTextureMagnifyingOp::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureCoordOp::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderTextureCoordOp::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderHint::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderHint::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderVertexBufferEntry value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderVertexBufferEntry(name:" << value.m_Name
- << ",componentType:" << value.m_ComponentType
- << ",numComponents" << value.m_NumComponents
- << ",firstItemOffset" << value.m_FirstItemOffset
- << ",inputSlot" << value.m_InputSlot;
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderVertFragCompilationResult value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderVertFragCompilationResult(ShaderName:" << value.mShaderName
- << ",Shader:" << value.mShader;
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderDrawMode::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderDrawMode::Enum::Points:
- debug.nospace() << "Points";
- break;
- case NVRenderDrawMode::Enum::LineStrip:
- debug.nospace() << "LineStrip";
- break;
- case NVRenderDrawMode::Enum::LineLoop:
- debug.nospace() << "LineLoop";
- break;
- case NVRenderDrawMode::Enum::Lines:
- debug.nospace() << "Lines";
- break;
- case NVRenderDrawMode::Enum::TriangleStrip:
- debug.nospace() << "TriangleStrip";
- break;
- case NVRenderDrawMode::Enum::TriangleFan:
- debug.nospace() << "TriangleFan";
- break;
- case NVRenderDrawMode::Enum::Triangles:
- debug.nospace() << "Triangles";
- break;
- case NVRenderDrawMode::Enum::Patches:
- debug.nospace() << "Patches";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureCubeFaces::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderTextureCubeFaces::Enum::InvalidFace:
- debug.nospace() << "InvalidFace";
- break;
- case NVRenderTextureCubeFaces::Enum::CubePosX:
- debug.nospace() << "CubePosX";
- break;
- case NVRenderTextureCubeFaces::Enum::CubeNegX:
- debug.nospace() << "CubeNegX";
- break;
- case NVRenderTextureCubeFaces::Enum::CubePosY:
- debug.nospace() << "CubePosY";
- break;
- case NVRenderTextureCubeFaces::Enum::CubeNegY:
- debug.nospace() << "CubeNegY";
- break;
- case NVRenderTextureCubeFaces::Enum::CubePosZ:
- debug.nospace() << "CubePosZ";
- break;
- case NVRenderTextureCubeFaces::Enum::CubeNegZ:
- debug.nospace() << "CubeNegZ";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathCommands::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathCommands::Enum::Close:
- debug.nospace() << "Close";
- break;
- case NVRenderPathCommands::Enum::MoveTo:
- debug.nospace() << "MoveTo";
- break;
- case NVRenderPathCommands::Enum::CubicCurveTo:
- debug.nospace() << "CubicCurveTo";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathFontTarget::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathFontTarget::Enum::StandardFont:
- debug.nospace() << "StandardFont";
- break;
- case NVRenderPathFontTarget::Enum::SystemFont:
- debug.nospace() << "SystemFont";
- break;
- case NVRenderPathFontTarget::Enum::FileFont:
- debug.nospace() << "FileFont";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathMissingGlyphs::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathMissingGlyphs::Enum::SkipMissing:
- debug.nospace() << "SkipMissing";
- break;
- case NVRenderPathMissingGlyphs::Enum::UseMissing:
- debug.nospace() << "UseMissing";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathFontStyleValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathFontStyleValues::Enum::Bold:
- debug.nospace() << "Bold";
- break;
- case NVRenderPathFontStyleValues::Enum::Italic:
- debug.nospace() << "Italic";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathReturnValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathReturnValues::Enum::FontGlypsAvailable:
- debug.nospace() << "FontGlypsAvailable";
- break;
- case NVRenderPathReturnValues::Enum::FontTargetUnavailable:
- debug.nospace() << "FontTargetUnavailable";
- break;
- case NVRenderPathReturnValues::Enum::FontUnavailable:
- debug.nospace() << "FontUnavailable";
- break;
- case NVRenderPathReturnValues::Enum::FontUnintelligible:
- debug.nospace() << "FontUnintelligible";
- break;
- case NVRenderPathReturnValues::Enum::InvalidEnum:
- debug.nospace() << "InvalidEnum";
- break;
- case NVRenderPathReturnValues::Enum::OutOfMemory:
- debug.nospace() << "OutOfMemory";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathFormatType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathFormatType::Enum::Byte:
- debug.nospace() << "Byte";
- break;
- case NVRenderPathFormatType::Enum::UByte:
- debug.nospace() << "UByte";
- break;
- case NVRenderPathFormatType::Enum::Short:
- debug.nospace() << "Short";
- break;
- case NVRenderPathFormatType::Enum::UShort:
- debug.nospace() << "UShort";
- break;
- case NVRenderPathFormatType::Enum::Int:
- debug.nospace() << "Int";
- break;
- case NVRenderPathFormatType::Enum::Uint:
- debug.nospace() << "Uint";
- break;
- case NVRenderPathFormatType::Enum::Float:
- debug.nospace() << "Float";
- break;
- case NVRenderPathFormatType::Enum::Utf8:
- debug.nospace() << "Utf8";
- break;
- case NVRenderPathFormatType::Enum::Utf16:
- debug.nospace() << "Utf16";
- break;
- case NVRenderPathFormatType::Enum::Bytes2:
- debug.nospace() << "Bytes2";
- break;
- case NVRenderPathFormatType::Enum::Bytes3:
- debug.nospace() << "Bytes3";
- break;
- case NVRenderPathFormatType::Enum::Bytes4:
- debug.nospace() << "Bytes4";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathGlyphFontMetricValues::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphWidth:
- debug.nospace() << "GlyphWidth";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphHeight:
- debug.nospace() << "GlyphHeight";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphHorizontalBearingX:
- debug.nospace() << "GlyphHorizontalBearingX";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphHorizontalBearingY:
- debug.nospace() << "GlyphHorizontalBearingY";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphHorizontalBearingAdvance:
- debug.nospace() << "GlyphHorizontalBearingAdvance";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphVerticalBearingX:
- debug.nospace() << "GlyphVerticalBearingX";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphVerticalBearingY:
- debug.nospace() << "GlyphVerticalBearingY";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphVerticalBearingAdvance:
- debug.nospace() << "GlyphVerticalBearingAdvance";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::GlyphHasKerning:
- debug.nospace() << "GlyphHasKerning";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontXMinBounds:
- debug.nospace() << "FontXMinBounds";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontYMinBounds:
- debug.nospace() << "FontYMinBounds";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontXMaxBounds:
- debug.nospace() << "FontXMaxBounds";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontYMaxBounds:
- debug.nospace() << "FontYMaxBounds";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontUnitsPerEm:
- debug.nospace() << "FontUnitsPerEm";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontAscender:
- debug.nospace() << "FontAscender";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontDescender:
- debug.nospace() << "FontDescender";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontHeight:
- debug.nospace() << "FontHeight";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontMaxAdvanceWidth:
- debug.nospace() << "FontMaxAdvanceWidth";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontMaxAdvanceHeight:
- debug.nospace() << "FontMaxAdvanceHeight";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontUnderlinePosition:
- debug.nospace() << "FontUnderlinePosition";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontUnderlineThickness:
- debug.nospace() << "FontUnderlineThickness";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontHasKerning:
- debug.nospace() << "FontHasKerning";
- break;
- case NVRenderPathGlyphFontMetricValues::Enum::FontNumGlyphIndices:
- debug.nospace() << "FontNumGlyphIndices";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathListMode::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathListMode::Enum::AccumAdjacentPairs:
- debug.nospace() << "AccumAdjacentPairs";
- break;
- case NVRenderPathListMode::Enum::AdjacentPairs:
- debug.nospace() << "AdjacentPairs";
- break;
- case NVRenderPathListMode::Enum::FirstToRest:
- debug.nospace() << "FirstToRest";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathFillMode::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathFillMode::Enum::Fill:
- debug.nospace() << "Fill";
- break;
- case NVRenderPathFillMode::Enum::CountUp:
- debug.nospace() << "CountUp";
- break;
- case NVRenderPathFillMode::Enum::CountDown:
- debug.nospace() << "CountDown";
- break;
- case NVRenderPathFillMode::Enum::Invert:
- debug.nospace() << "Invert";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathCoverMode::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathCoverMode::Enum::ConvexHull:
- debug.nospace() << "ConvexHull";
- break;
- case NVRenderPathCoverMode::Enum::BoundingBox:
- debug.nospace() << "BoundingBox";
- break;
- case NVRenderPathCoverMode::Enum::BoundingBoxOfBoundingBox:
- debug.nospace() << "BoundingBoxOfBoundingBox";
- break;
- case NVRenderPathCoverMode::Enum::PathFillCover:
- debug.nospace() << "PathFillCover";
- break;
- case NVRenderPathCoverMode::Enum::PathStrokeCover:
- debug.nospace() << "PathStrokeCover";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderPathTransformType::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderPathTransformType::Enum::NoTransform:
- debug.nospace() << "NoTransform";
- break;
- case NVRenderPathTransformType::Enum::TranslateX:
- debug.nospace() << "TranslateX";
- break;
- case NVRenderPathTransformType::Enum::TranslateY:
- debug.nospace() << "TranslateY";
- break;
- case NVRenderPathTransformType::Enum::Translate2D:
- debug.nospace() << "Translate2D";
- break;
- case NVRenderPathTransformType::Enum::Translate3D:
- debug.nospace() << "Translate3D";
- break;
- case NVRenderPathTransformType::Enum::Affine2D:
- debug.nospace() << "Affine2D";
- break;
- case NVRenderPathTransformType::Enum::Affine3D:
- debug.nospace() << "Affine3D";
- break;
- case NVRenderPathTransformType::Enum::TransposeAffine2D:
- debug.nospace() << "TransposeAffine2D";
- break;
- case NVRenderPathTransformType::Enum::TransposeAffine3D:
- debug.nospace() << "TransposeAffine3D";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderWinding::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderWinding::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderState::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderState::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderSrcBlendFunc::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderSrcBlendFunc::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderDstBlendFunc::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderDstBlendFunc::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBlendEquation::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderBlendEquation::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderFaces::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderFaces::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVReadFaces::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVReadFaces::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBoolOp::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderBoolOp::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderStencilOp::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderStencilOp::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBlendFunctionArgument &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderBlendFunctionArgument(SrcRGB:" << value.m_SrcRGB
- << ", DstRGB:" << value.m_DstRGB
- << ", SrcAlpha:" << value.m_SrcAlpha
- << ", DstAlpha:" << value.m_DstAlpha
- << ')';
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderBlendEquationArgument &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderBlendEquationArgument(RGBEquation:" << value.m_RGBEquation
- << ", AlphaEquation:" << value.m_AlphaEquation
- << ')';
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderStencilOperationArgument &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderStencilOperationArgument(StencilFail:" << value.m_StencilFail
- << ", DepthFail:" << value.m_DepthFail
- << ", DepthPass:" << value.m_DepthPass
- << ')';
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderStencilFunctionArgument &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderStencilFunctionArgument(Function:" << value.m_Function
- << ", ReferenceValue:" << value.m_ReferenceValue
- << ", Mask:" << value.m_Mask
- << ')';
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderRect &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderRect(x:" << value.m_X
- << ", y:" << value.m_Y
- << ", width:" << value.m_Width
- << ", height:" << value.m_Height
- << ')';
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderRectF &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "NVRenderRectF(x:" << value.m_X
- << ", y:" << value.m_Y
- << ", width:" << value.m_Width
- << ", height:" << value.m_Height
- << ')';
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderShaderDataTypes::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(x) \
- case NVRenderShaderDataTypes::Enum::x: \
- debug.nospace() << #x; \
- break;
- ITERATE_QT3DS_SHADER_DATA_TYPES
- #undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderShaderTypeValue::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
- case NVRenderShaderTypeValue::Enum::Vertex:
- debug.nospace() << "Vertex";
- break;
- case NVRenderShaderTypeValue::Enum::Fragment:
- debug.nospace() << "Fragment";
- break;
- case NVRenderShaderTypeValue::Enum::TessControl:
- debug.nospace() << "TessControl";
- break;
- case NVRenderShaderTypeValue::Enum::TessEvaluation:
- debug.nospace() << "TessEvaluation";
- break;
- case NVRenderShaderTypeValue::Enum::Geometry:
- debug.nospace() << "Geometry";
- break;
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderTextureTypeValue::Enum value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << NVRenderTextureTypeValue::toString(value);
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const NVRenderReadPixelFormats::Enum value)
-{
- QDebugStateSaver saver(debug);
- switch (value) {
-#define HANDLE_QT3DS_READ_PIXEL_FORMAT(x) \
- case NVRenderReadPixelFormats::Enum::x: \
- debug.nospace() << #x; \
- break;
- ITERATE_QT3DS_READ_PIXEL_FORMATS
- #undef HANDLE_QT3DS_READ_PIXEL_FORMAT
- default:
- debug.nospace() << "Unknown";
- }
- return debug;
-}
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.h
deleted file mode 100644
index fa5e6fcd..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderBaseTypes.h
+++ /dev/null
@@ -1,2103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_TYPES_H
-#define QT3DS_RENDER_QT3DS_RENDER_TYPES_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSMath.h"
-#include "foundation/Qt3DSVec2.h"
-
-namespace qt3ds {
-
-namespace render {
-using namespace foundation;
-
-#define QT3DS_RENDER_ITERATE_COMPONENT_TYPES \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSU8) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSI8) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSU16) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSI16) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSU32) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSI32) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSU64) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSI64) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSF16) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSF32) \
- QT3DS_RENDER_HANDLE_COMPONENT_TYPE(QT3DSF64)
-
-struct NVRenderComponentTypes
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_COMPONENT_TYPE(x) x,
- QT3DS_RENDER_ITERATE_COMPONENT_TYPES
-#undef QT3DS_RENDER_HANDLE_COMPONENT_TYPE
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_COMPONENT_TYPE(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_COMPONENT_TYPES
- #undef QT3DS_RENDER_HANDLE_COMPONENT_TYPE
- default:
- break;
- }
- return "Unknown";
- }
-
- static qt3ds::QT3DSU32 getSizeofType(Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_COMPONENT_TYPE(x) \
- case x: \
- return sizeof(qt3ds::x);
- QT3DS_RENDER_ITERATE_COMPONENT_TYPES
- #undef QT3DS_RENDER_HANDLE_COMPONENT_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-};
-
-/**
- Define a set of compile-time trait classes that map the enumerations
- to actual compile time types and sizeof so we can deal with the enumeration
- in generic ways.
- */
-template <NVRenderComponentTypes::Enum TraitType>
-struct NVRenderComponentTraits
-{
- bool force_compile_error;
-};
-
-/**
- Define a compile time mapping from datatype to enumeration. Not that if you
- use this with a type that isn't a component type you will get a compilation
- error.
- */
-template <typename TDataType>
-struct NVRenderComponentTypeToTypeMap
-{
- bool force_compile_error;
-};
-
-#define QT3DS_RENDER_HANDLE_COMPONENT_TYPE(x) \
- template <> \
- struct NVRenderComponentTraits<NVRenderComponentTypes::x> \
-{ \
- typedef x TComponentType; \
- QT3DSU8 mComponentSize; \
- NVRenderComponentTraits<NVRenderComponentTypes::x>() \
- : mComponentSize(sizeof(x)) \
-{ \
-} \
-}; \
- template <> \
- struct NVRenderComponentTypeToTypeMap<x> \
-{ \
- NVRenderComponentTypes::Enum m_ComponentType; \
- NVRenderComponentTypeToTypeMap<x>() \
- : m_ComponentType(NVRenderComponentTypes::x) \
-{ \
-} \
-};
-
-QT3DS_RENDER_ITERATE_COMPONENT_TYPES;
-
-#undef QT3DS_RENDER_HANDLE_COMPONENT_TYPE
-
-// Map at compile time from component type to datatype;
-template <typename TDataType>
-inline NVRenderComponentTypes::Enum getComponentTypeForType()
-{
- return NVRenderComponentTypeToTypeMap<TDataType>().m_ComponentType;
-}
-
-struct NVRenderContextValues
-{
- enum Enum {
- GLES2 = 1 << 0,
- GL2 = 1 << 1,
- GLES3 = 1 << 2,
- GL3 = 1 << 3,
- GLES3PLUS = 1 << 4,
- GL4 = 1 << 5,
- NullContext = 1 << 6,
- };
-};
-
-typedef NVFlags<NVRenderContextValues::Enum, QT3DSU32> NVRenderContextType;
-
-struct NVRenderClearValues
-{
- enum Enum {
- Color = 1 << 0,
- Depth = 1 << 1,
- Stencil = 1 << 3,
- Coverage = 1 << 4,
- };
-};
-
-typedef NVFlags<NVRenderClearValues::Enum, QT3DSU32> NVRenderClearFlags;
-
-struct NVRenderQueryType
-{
- enum Enum {
- Unknown = 0,
- Samples, ///< samples query object
- Timer, ///< timer query object
- };
-};
-
-struct NVRenderQueryResultType
-{
- enum Enum {
- Unknown = 0,
- ResultAvailable, ///< Check if query result is available
- Result, ///< Get actual result
- };
-};
-
-struct NVRenderSyncType
-{
- enum Enum {
- Unknown = 0,
- GpuCommandsComplete, ///< sync to Gpu commands finished
- };
-};
-
-struct NVRenderSyncValues
-{
- enum Enum {
- Unknown = 0, ///< for future usage
- };
-};
-
-typedef NVFlags<NVRenderSyncValues::Enum, QT3DSU32> NVRenderSyncFlags;
-
-struct NVRenderCommandFlushValues
-{
- enum Enum {
- SyncFlushCommands = 0, ///< sync for flushing command
- };
-};
-
-typedef NVFlags<NVRenderCommandFlushValues::Enum, QT3DSU32> NVRenderCommandFlushFlags;
-
-struct NVRenderBufferBindValues
-{
- enum Enum {
- Unknown = 0,
- Vertex = 1 << 0, ///< Bind as vertex buffer
- Index = 1 << 1, ///< Bind as index buffer
- Constant = 1 << 2, ///< Bind as constant buffer
- Storage = 1 << 3, ///< Bind as shader storage buffer
- Atomic_Counter = 1 << 4, ///< Bind as atomic counter buffer
- Draw_Indirect = 1 << 5, ///< Bind as draw indirect buffer
- };
-};
-
-typedef NVFlags<NVRenderBufferBindValues::Enum, QT3DSU32> NVRenderBufferBindFlags;
-
-struct NVRenderBufferUsageType
-{
- enum Enum {
- Unknown = 0,
- Static, ///< Rarely updated
- Dynamic, ///< Most likely updated every frame
- };
-};
-
-struct NVRenderImageAccessType
-{
- enum Enum {
- Unknown = 0,
- Read, ///< Read only access
- Write, ///< Write only access
- ReadWrite, ///< Read and write access
- };
-};
-
-struct NVRenderBufferAccessTypeValues
-{
- enum Enum {
- Unknown = 0,
- Read = 1 << 0, ///< Read access
- Write = 1 << 1, ///< Write access
- Invalid = 1 << 2, ///< No sync
- InvalidRange = 1 << 3, ///< No sync
-
- };
-};
-
-typedef NVFlags<NVRenderBufferAccessTypeValues::Enum, QT3DSU32> NVRenderBufferAccessFlags;
-
-///< defines a barrier of ordering the memory transactions to a command relative to those issued
-///before the barrier
-struct NVRenderBufferBarrierValues
-{
- enum Enum {
- Unknown = 0,
- VertexAttribArray = 1 << 0, ///< Barrier for vertex attributes sourced from a buffer
- ElementArray = 1 << 1, ///< Barrier for indices sourced from a buffer
- UniformBuffer = 1 << 2, ///< Barrier for shader uniforms sourced from a buffer
- TextureFetch = 1 << 3, ///< Barrier for texture fetches within shaders
- ShaderImageAccess = 1 << 4, ///< Barrier for image access using load / store
- CommandBuffer = 1 << 5, ///< Barrier for indirect drawing
- PixelBuffer = 1 << 6, ///< Barrier for pixel buffer access
- TextureUpdate = 1 << 7, ///< Barrier for texture writes
- BufferUpdate = 1 << 8, ///< Barrier for buffer writes
- Framebuffer = 1 << 9, ///< Barrier for framebuffer writes
- TransformFeedback = 1 << 10, ///< Barrier for transform feedback writes
- AtomicCounter = 1 << 11, ///< Barrier for atomic counter writes
- ShaderStorage = 1 << 12, ///< Barrier for shader storage blocks writes
- All = 0xFFFF, ///< Barrier for all of the above
- };
-};
-
-typedef NVFlags<NVRenderBufferBarrierValues::Enum, QT3DSU32> NVRenderBufferBarrierFlags;
-
-#define QT3DS_RENDER_ITERATE_RENDERBUFFER_FORMATS \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(RGBA4) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(RGB565) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(RGBA5551) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(Depth16) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(Depth24) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(Depth32) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(StencilIndex8) \
- QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(CoverageNV)
-
-struct NVRenderRenderBufferFormats
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(x) x,
- QT3DS_RENDER_ITERATE_RENDERBUFFER_FORMATS
-#undef QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_RENDERBUFFER_FORMATS
- #undef QT3DS_RENDER_HANDLE_RENDERBUFFER_FORMAT
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_TEXTURE_FORMATS \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R16) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R16F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R32I) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R32UI) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R32F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RG8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGBA8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGB8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(SRGB8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(SRGB8A8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGB565) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGBA5551) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(Alpha8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(Luminance8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(Luminance16) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(LuminanceAlpha8) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGBA16F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RG16F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RG32F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGB32F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGBA32F) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(R11G11B10) \
- QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(RGB9E5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_DXT1) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB_DXT1) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_DXT3) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_DXT5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB8_ETC1) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB8_ETC2) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_ETC2) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB8_PunchThrough_Alpha1_ETC2) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_PunchThrough_Alpha1_ETC2) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(R11_EAC_UNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(R11_EAC_SNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RG11_EAC_UNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RG11_EAC_SNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA8_ETC2_EAC) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ETC2_EAC) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(R_ATI1N_UNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(R_ATI1N_SNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RG_ATI2N_UNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RG_ATI2N_SNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB_BP_UNSIGNED_FLOAT) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB_BP_SIGNED_FLOAT) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGB_BP_UNorm) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_4x4) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_5x4) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_5x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_6x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_6x6) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_8x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_8x6) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_8x8) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_10x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_10x6) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_10x8) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_10x10) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_12x10) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(RGBA_ASTC_12x12) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_4x4) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_5x4) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_5x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_6x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_6x6) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_8x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_8x6) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_8x8) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_10x5) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_10x6) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_10x8) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_10x10) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_12x10) \
- QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(SRGB8_Alpha8_ASTC_12x12) \
- QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(Depth16) \
- QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(Depth24) \
- QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(Depth32) \
- QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(Depth24Stencil8)
-
-struct NVRenderTextureFormats
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(x) x,
-#define QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(x) x,
-#define QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(x) x,
- QT3DS_RENDER_ITERATE_TEXTURE_FORMATS
-#undef QT3DS_RENDER_HANDLE_TEXTURE_FORMAT
-#undef QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT
-#undef QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT
- };
-
- static bool isUncompressedTextureFormat(NVRenderTextureFormats::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(x) \
- case NVRenderTextureFormats::x: \
- return true;
-#define QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(x)
-#define QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(x)
- QT3DS_RENDER_ITERATE_TEXTURE_FORMATS
- #undef QT3DS_RENDER_HANDLE_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_GL_QT3DS_DEPTH_TEXTURE_FORMAT
- default:
- break;
- }
- return false;
- }
-
- static bool isCompressedTextureFormat(NVRenderTextureFormats::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(x)
-#define QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(x) \
- case NVRenderTextureFormats::x: \
- return true;
-#define QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(x)
- QT3DS_RENDER_ITERATE_TEXTURE_FORMATS
- #undef QT3DS_RENDER_HANDLE_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_GL_QT3DS_DEPTH_TEXTURE_FORMAT
- default:
- break;
- }
- return false;
- }
-
- static bool isDepthTextureFormat(NVRenderTextureFormats::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(x)
-#define QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(x)
-#define QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(x) \
- case NVRenderTextureFormats::x: \
- return true;
- QT3DS_RENDER_ITERATE_TEXTURE_FORMATS
- #undef QT3DS_RENDER_HANDLE_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_GL_QT3DS_DEPTH_TEXTURE_FORMAT
- default:
- break;
- }
- return false;
- }
-
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_FORMAT(x) \
- case x: \
- return #x;
-#define QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT(x) \
- case x: \
- return #x;
-#define QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_TEXTURE_FORMATS
- #undef QT3DS_RENDER_HANDLE_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_COMPRESSED_TEXTURE_FORMAT
- #undef QT3DS_RENDER_HANDLE_DEPTH_TEXTURE_FORMAT
- default:
- break;
- }
- return "Unknown";
- }
-
- static QT3DSU32 getSizeofFormat(Enum value)
- {
- switch (value) {
- case R8:
- return 1;
- case R16F:
- return 2;
- case R16:
- return 2;
- case R32I:
- return 4;
- case R32F:
- return 4;
- case RGBA8:
- return 4;
- case RGB8:
- return 3;
- case RGB565:
- return 2;
- case RGBA5551:
- return 2;
- case Alpha8:
- return 1;
- case Luminance8:
- return 1;
- case LuminanceAlpha8:
- return 1;
- case Depth16:
- return 2;
- case Depth24:
- return 3;
- case Depth32:
- return 4;
- case Depth24Stencil8:
- return 4;
- case RGB9E5:
- return 4;
- case SRGB8:
- return 3;
- case SRGB8A8:
- return 4;
- case RGBA16F:
- return 8;
- case RG16F:
- return 4;
- case RG32F:
- return 8;
- case RGBA32F:
- return 16;
- case RGB32F:
- return 12;
- case R11G11B10:
- return 4;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static QT3DSU32 getNumberOfComponent(Enum value)
- {
- switch (value) {
- case R8:
- return 1;
- case R16F:
- return 1;
- case R16:
- return 1;
- case R32I:
- return 1;
- case R32F:
- return 1;
- case RGBA8:
- return 4;
- case RGB8:
- return 3;
- case RGB565:
- return 3;
- case RGBA5551:
- return 4;
- case Alpha8:
- return 1;
- case Luminance8:
- return 1;
- case LuminanceAlpha8:
- return 2;
- case Depth16:
- return 1;
- case Depth24:
- return 1;
- case Depth32:
- return 1;
- case Depth24Stencil8:
- return 2;
- case RGB9E5:
- return 3;
- case SRGB8:
- return 3;
- case SRGB8A8:
- return 4;
- case RGBA16F:
- return 4;
- case RG16F:
- return 2;
- case RG32F:
- return 2;
- case RGBA32F:
- return 4;
- case RGB32F:
- return 3;
- case R11G11B10:
- return 3;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static void decodeToFloat(void *inPtr, QT3DSU32 byteOfs, float *outPtr,
- NVRenderTextureFormats::Enum inFmt)
- {
- outPtr[0] = 0.0f;
- outPtr[1] = 0.0f;
- outPtr[2] = 0.0f;
- outPtr[3] = 0.0f;
- QT3DSU8 *src = reinterpret_cast<QT3DSU8 *>(inPtr);
- // float divisor; // If we want to support RGBD?
- switch (inFmt) {
- case Alpha8:
- outPtr[0] = ((float)src[byteOfs]) / 255.0f;
- break;
-
- case Luminance8:
- case LuminanceAlpha8:
- case R8:
- case RG8:
- case RGB8:
- case RGBA8:
- case SRGB8:
- case SRGB8A8:
- // NOTE : RGBD Hack here for reference. Not meant for installation.
- // divisor = (NVRenderTextureFormats::getSizeofFormat(inFmt) == 4) ?
- // ((float)src[byteOfs+3]) / 255.0f : 1.0f;
- for (QT3DSU32 i = 0; i < NVRenderTextureFormats::getSizeofFormat(inFmt); ++i) {
- float val = ((float)src[byteOfs + i]) / 255.0f;
- outPtr[i] = (i < 3) ? powf(val, 0.4545454545f) : val;
- // Assuming RGBA8 actually means RGBD (which is stupid, I know)
- // if ( NVRenderTextureFormats::getSizeofFormat(inFmt) == 4 ) { outPtr[i] /=
- // divisor; }
- }
- // outPtr[3] = divisor;
- break;
-
- case R32F:
- outPtr[0] = reinterpret_cast<float *>(src + byteOfs)[0];
- break;
- case RG32F:
- outPtr[0] = reinterpret_cast<float *>(src + byteOfs)[0];
- outPtr[1] = reinterpret_cast<float *>(src + byteOfs)[1];
- break;
- case RGBA32F:
- outPtr[0] = reinterpret_cast<float *>(src + byteOfs)[0];
- outPtr[1] = reinterpret_cast<float *>(src + byteOfs)[1];
- outPtr[2] = reinterpret_cast<float *>(src + byteOfs)[2];
- outPtr[3] = reinterpret_cast<float *>(src + byteOfs)[3];
- break;
- case RGB32F:
- outPtr[0] = reinterpret_cast<float *>(src + byteOfs)[0];
- outPtr[1] = reinterpret_cast<float *>(src + byteOfs)[1];
- outPtr[2] = reinterpret_cast<float *>(src + byteOfs)[2];
- break;
-
- case R16F:
- case RG16F:
- case RGBA16F:
- for (QT3DSU32 i = 0; i < (NVRenderTextureFormats::getSizeofFormat(inFmt) >> 1); ++i) {
- // NOTE : This only works on the assumption that we don't have any denormals,
- // Infs or NaNs.
- // Every pixel in our source image should be "regular"
- QT3DSU16 h = reinterpret_cast<QT3DSU16 *>(src + byteOfs)[i];
- QT3DSU32 sign = (h & 0x8000) << 16;
- QT3DSU32 exponent = (((((h & 0x7c00) >> 10) - 15) + 127) << 23);
- QT3DSU32 mantissa = ((h & 0x3ff) << 13);
- QT3DSU32 result = sign | exponent | mantissa;
-
- if (h == 0 || h == 0x8000) {
- result = 0;
- } // Special case for zero and negative zero
- qt3ds::intrinsics::memCopy(reinterpret_cast<QT3DSU32 *>(outPtr) + i, &result, 4);
- }
- break;
-
- case R11G11B10:
- // place holder
- QT3DS_ASSERT(false);
- break;
-
- default:
- outPtr[0] = 0.0f;
- outPtr[1] = 0.0f;
- outPtr[2] = 0.0f;
- outPtr[3] = 0.0f;
- break;
- }
- }
-
- static void encodeToPixel(float *inPtr, void *outPtr, QT3DSU32 byteOfs,
- NVRenderTextureFormats::Enum inFmt)
- {
- QT3DSU8 *dest = reinterpret_cast<QT3DSU8 *>(outPtr);
- switch (inFmt) {
- case NVRenderTextureFormats::Alpha8:
- dest[byteOfs] = QT3DSU8(inPtr[0] * 255.0f);
- break;
-
- case Luminance8:
- case LuminanceAlpha8:
- case R8:
- case RG8:
- case RGB8:
- case RGBA8:
- case SRGB8:
- case SRGB8A8:
- for (QT3DSU32 i = 0; i < NVRenderTextureFormats::getSizeofFormat(inFmt); ++i) {
- inPtr[i] = (inPtr[i] > 1.0f) ? 1.0f : inPtr[i];
- if (i < 3)
- dest[byteOfs + i] = QT3DSU8(powf(inPtr[i], 2.2f) * 255.0f);
- else
- dest[byteOfs + i] = QT3DSU8(inPtr[i] * 255.0f);
- }
- break;
-
- case R32F:
- reinterpret_cast<float *>(dest + byteOfs)[0] = inPtr[0];
- break;
- case RG32F:
- reinterpret_cast<float *>(dest + byteOfs)[0] = inPtr[0];
- reinterpret_cast<float *>(dest + byteOfs)[1] = inPtr[1];
- break;
- case RGBA32F:
- reinterpret_cast<float *>(dest + byteOfs)[0] = inPtr[0];
- reinterpret_cast<float *>(dest + byteOfs)[1] = inPtr[1];
- reinterpret_cast<float *>(dest + byteOfs)[2] = inPtr[2];
- reinterpret_cast<float *>(dest + byteOfs)[3] = inPtr[3];
- break;
- case RGB32F:
- reinterpret_cast<float *>(dest + byteOfs)[0] = inPtr[0];
- reinterpret_cast<float *>(dest + byteOfs)[1] = inPtr[1];
- reinterpret_cast<float *>(dest + byteOfs)[2] = inPtr[2];
- break;
-
- case R16F:
- case RG16F:
- case RGBA16F:
- for (QT3DSU32 i = 0; i < (NVRenderTextureFormats::getSizeofFormat(inFmt) >> 1); ++i) {
- // NOTE : This also has the limitation of not handling infs, NaNs and
- // denormals, but it should be
- // sufficient for our purposes.
- if (inPtr[i] > 65519.0f) {
- inPtr[i] = 65519.0f;
- }
- if (fabs(inPtr[i]) < 6.10352E-5f) {
- inPtr[i] = 0.0f;
- }
- QT3DSU32 f = reinterpret_cast<QT3DSU32 *>(inPtr)[i];
- QT3DSU32 sign = (f & 0x80000000) >> 16;
- QT3DSI32 exponent = (f & 0x7f800000) >> 23;
- QT3DSU32 mantissa = (f >> 13) & 0x3ff;
- exponent = exponent - 112;
- if (exponent > 31) {
- exponent = 31;
- }
- if (exponent < 0) {
- exponent = 0;
- }
- exponent = exponent << 10;
- reinterpret_cast<QT3DSU16 *>(dest + byteOfs)[i] =
- QT3DSU16(sign | exponent | mantissa);
- }
- break;
-
- case R11G11B10:
- // place holder
- QT3DS_ASSERT(false);
- break;
-
- default:
- dest[byteOfs] = 0;
- dest[byteOfs + 1] = 0;
- dest[byteOfs + 2] = 0;
- dest[byteOfs + 3] = 0;
- break;
- }
- }
-};
-
-struct NVRenderTextureTargetType
-{
- enum Enum {
- Unknown = 0,
- Texture2D,
- Texture2D_MS,
- Texture2D_Array,
- TextureCube,
- TextureCubePosX,
- TextureCubeNegX,
- TextureCubePosY,
- TextureCubeNegY,
- TextureCubePosZ,
- TextureCubeNegZ,
- };
-};
-
-struct NVRenderTextureUnit
-{
- enum Enum {
- TextureUnit_0 = 0,
- TextureUnit_1,
- TextureUnit_2,
- TextureUnit_3,
- TextureUnit_4,
- TextureUnit_5,
- TextureUnit_6,
- TextureUnit_7,
- TextureUnit_8,
- TextureUnit_9,
- TextureUnit_10,
- TextureUnit_11,
- TextureUnit_12,
- TextureUnit_13,
- TextureUnit_14,
- TextureUnit_15,
- TextureUnit_16,
- TextureUnit_17,
- TextureUnit_18,
- TextureUnit_19,
- TextureUnit_20,
- TextureUnit_21,
- TextureUnit_22,
- TextureUnit_23,
- TextureUnit_24,
- TextureUnit_25,
- TextureUnit_26,
- TextureUnit_27,
- TextureUnit_28,
- TextureUnit_29,
- TextureUnit_30,
- TextureUnit_31
- };
-};
-
-struct NVRenderTextureCompareMode
-{
- enum Enum { Unknown = 0, NoCompare, CompareToRef };
-};
-
-struct NVRenderTextureSwizzleMode
-{
- enum Enum { NoSwizzle = 0, L8toR8, A8toR8, L8A8toRG8, L16toR16 };
-};
-
-#define QT3DS_RENDER_ITERATE_BOOL_OP \
- QT3DS_RENDER_HANDLE_BOOL_OP(Never) \
- QT3DS_RENDER_HANDLE_BOOL_OP(Less) \
- QT3DS_RENDER_HANDLE_BOOL_OP(LessThanOrEqual) \
- QT3DS_RENDER_HANDLE_BOOL_OP(Equal) \
- QT3DS_RENDER_HANDLE_BOOL_OP(NotEqual) \
- QT3DS_RENDER_HANDLE_BOOL_OP(Greater) \
- QT3DS_RENDER_HANDLE_BOOL_OP(GreaterThanOrEqual) \
- QT3DS_RENDER_HANDLE_BOOL_OP(AlwaysTrue)
-
-struct NVRenderTextureCompareOp
-{
- enum Enum {
-#define QT3DS_RENDER_HANDLE_BOOL_OP(x) x,
- QT3DS_RENDER_ITERATE_BOOL_OP
-#undef QT3DS_RENDER_HANDLE_BOOL_OP
- };
-};
-
-#define QT3DS_RENDER_ITERATE_TEXTURE_FILTER_OP \
- QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP(Nearest) \
- QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP(Linear) \
- QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(NearestMipmapNearest) \
- QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(LinearMipmapNearest) \
- QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(NearestMipmapLinear) \
- QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(LinearMipmapLinear)
-
-struct NVRenderTextureMinifyingOp
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP(x) x,
-#define QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(x) x,
- QT3DS_RENDER_ITERATE_TEXTURE_FILTER_OP
-#undef QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP
-#undef QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP
- };
-
- static const char *toString(const NVRenderTextureMinifyingOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP(x) \
- case x: \
- return #x;
-#define QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_TEXTURE_FILTER_OP
- #undef QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP
- #undef QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-struct NVRenderTextureMagnifyingOp
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP(x) x,
-#define QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(x)
- QT3DS_RENDER_ITERATE_TEXTURE_FILTER_OP
-#undef QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP
-#undef QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP
- };
- static const char *toString(const NVRenderTextureMagnifyingOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP(x) \
- case x: \
- return #x;
-#define QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP(x)
- QT3DS_RENDER_ITERATE_TEXTURE_FILTER_OP
- #undef QT3DS_RENDER_HANDLE_TEXTURE_MINIFYING_OP
- #undef QT3DS_RENDER_HANDLE_TEXTURE_FILTER_OP
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_TEXTURE_WRAP_OP \
- QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP(ClampToEdge) \
- QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP(MirroredRepeat) \
- QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP(Repeat)
-
-struct NVRenderTextureCoordOp
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP(x) x,
- QT3DS_RENDER_ITERATE_TEXTURE_WRAP_OP
-#undef QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP
- };
-
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_TEXTURE_WRAP_OP
- #undef QT3DS_RENDER_HANDLE_TEXTURE_WRAP_OP
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_HINT \
- QT3DS_RENDER_HANDLE_HINT(Fastest) \
- QT3DS_RENDER_HANDLE_HINT(Nicest) \
- QT3DS_RENDER_HANDLE_HINT(Unspecified)
-
-struct NVRenderHint
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_HINT(x) x,
- QT3DS_RENDER_ITERATE_HINT
-#undef QT3DS_RENDER_HANDLE_HINT
- };
-
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_HINT(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_HINT
- #undef QT3DS_RENDER_HANDLE_HINT
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-class NVRenderImplemented
-{
-protected:
- virtual ~NVRenderImplemented() {}
-public:
- // Get the handle that binds us to the implementation.
- // For instance, return the GLuint that came back from
- // glGenTextures.
- virtual const void *GetImplementationHandle() const = 0;
-};
-
-struct NVRenderVertexBufferEntry
-{
- const char *m_Name;
- /** Datatype of the this entry points to in the buffer */
- NVRenderComponentTypes::Enum m_ComponentType;
- /** Number of components of each data member. 1,2,3, or 4. Don't be stupid.*/
- QT3DSU32 m_NumComponents;
- /** Offset from the beginning of the buffer of the first item */
- QT3DSU32 m_FirstItemOffset;
- /** Attribute input slot used for this entry*/
- QT3DSU32 m_InputSlot;
-
- NVRenderVertexBufferEntry(const char *nm, NVRenderComponentTypes::Enum type,
- QT3DSU32 numComponents, QT3DSU32 firstItemOffset = 0,
- QT3DSU32 inputSlot = 0)
- : m_Name(nm)
- , m_ComponentType(type)
- , m_NumComponents(numComponents)
- , m_FirstItemOffset(firstItemOffset)
- , m_InputSlot(inputSlot)
- {
- }
-
- NVRenderVertexBufferEntry()
- : m_Name(NULL)
- , m_ComponentType(NVRenderComponentTypes::Unknown)
- , m_NumComponents(0)
- , m_FirstItemOffset(0)
- , m_InputSlot(0)
- {
- }
-
- NVRenderVertexBufferEntry(const NVRenderVertexBufferEntry &inOther)
- : m_Name(inOther.m_Name)
- , m_ComponentType(inOther.m_ComponentType)
- , m_NumComponents(inOther.m_NumComponents)
- , m_FirstItemOffset(inOther.m_FirstItemOffset)
- , m_InputSlot(inOther.m_InputSlot)
- {
- }
-
- NVRenderVertexBufferEntry &operator=(const NVRenderVertexBufferEntry &inOther)
- {
- if (this != &inOther) {
- m_Name = inOther.m_Name;
- m_ComponentType = inOther.m_ComponentType;
- m_NumComponents = inOther.m_NumComponents;
- m_FirstItemOffset = inOther.m_FirstItemOffset;
- m_InputSlot = inOther.m_InputSlot;
- }
- return *this;
- }
-};
-
-class NVRenderShaderProgram;
-
-typedef NVConstDataRef<QT3DSI8> TConstI8Ref;
-
-struct NVRenderVertFragCompilationResult
-{
- const char *mShaderName;
-
- NVRenderShaderProgram *mShader; ///< contains the program
-
- NVRenderVertFragCompilationResult()
- : mShaderName("")
- , mShader(NULL)
- {
- }
-};
-
-#define QT3DS_RENDER_ITERATE_FRAMEBUFFER_ATTACHMENTS \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color0) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color1) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color2) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color3) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color4) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color5) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color6) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Color7) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Depth) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(Stencil) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(DepthStencil) \
- QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(CoverageNV)
-
-struct NVRenderFrameBufferAttachments
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT(x) x,
- QT3DS_RENDER_ITERATE_FRAMEBUFFER_ATTACHMENTS
-#undef QT3DS_RENDER_HANDLE_FRAMEBUFFER_ATTACHMENT
- LastAttachment,
- };
-};
-
-struct NVRenderDrawMode
-{
- enum Enum {
- Unknown = 0,
- Points,
- LineStrip,
- LineLoop,
- Lines,
- TriangleStrip,
- TriangleFan,
- Triangles,
- Patches,
- };
-};
-
-struct NVRenderTextureCubeFaces
-{
- enum Enum {
- InvalidFace = 0,
- CubePosX = 1,
- CubeNegX,
- CubePosY,
- CubeNegY,
- CubePosZ,
- CubeNegZ,
- };
-};
-
-// enums match the NV path extensions
-struct NVRenderPathCommands
-{
- enum Enum {
- Close = 0,
- MoveTo = 2,
- CubicCurveTo = 12,
- };
-};
-
-struct NVRenderPathFontTarget
-{
- enum Enum {
- StandardFont = 0,
- SystemFont = 1,
- FileFont = 2,
- };
-};
-
-struct NVRenderPathMissingGlyphs
-{
- enum Enum {
- SkipMissing = 0,
- UseMissing = 1,
- };
-};
-
-struct NVRenderPathFontStyleValues
-{
- enum Enum {
- Bold = 1 << 0,
- Italic = 1 << 1,
- };
-};
-
-typedef NVFlags<NVRenderPathFontStyleValues::Enum, QT3DSU32> NVRenderPathFontStyleFlags;
-
-struct NVRenderPathReturnValues
-{
- enum Enum {
- FontGlypsAvailable = 0,
- FontTargetUnavailable = 1,
- FontUnavailable = 2,
- FontUnintelligible = 3,
- InvalidEnum = 4,
- OutOfMemory = 5,
- };
-};
-
-struct NVRenderPathFormatType
-{
- enum Enum {
- Byte = 1,
- UByte,
- Short,
- UShort,
- Int,
- Uint,
- Float,
- Utf8,
- Utf16,
- Bytes2,
- Bytes3,
- Bytes4,
- };
-};
-
-struct NVRenderPathGlyphFontMetricValues
-{
- enum Enum {
- GlyphWidth = 1 << 0,
- GlyphHeight = 1 << 1,
- GlyphHorizontalBearingX = 1 << 2,
- GlyphHorizontalBearingY = 1 << 3,
- GlyphHorizontalBearingAdvance = 1 << 4,
- GlyphVerticalBearingX = 1 << 5,
- GlyphVerticalBearingY = 1 << 6,
- GlyphVerticalBearingAdvance = 1 << 7,
- GlyphHasKerning = 1 << 8,
-
- FontXMinBounds = 1 << 9,
- FontYMinBounds = 1 << 10,
- FontXMaxBounds = 1 << 11,
- FontYMaxBounds = 1 << 12,
- FontUnitsPerEm = 1 << 13,
- FontAscender = 1 << 14,
- FontDescender = 1 << 15,
- FontHeight = 1 << 16,
- FontMaxAdvanceWidth = 1 << 17,
- FontMaxAdvanceHeight = 1 << 18,
- FontUnderlinePosition = 1 << 19,
- FontUnderlineThickness = 1 << 20,
- FontHasKerning = 1 << 21,
- FontNumGlyphIndices = 1 << 22,
- };
-};
-
-typedef NVFlags<NVRenderPathGlyphFontMetricValues::Enum, QT3DSU32>
-NVRenderPathGlyphFontMetricFlags;
-
-struct NVRenderPathListMode
-{
- enum Enum {
- AccumAdjacentPairs = 1,
- AdjacentPairs,
- FirstToRest,
- };
-};
-
-struct NVRenderPathFillMode
-{
- enum Enum {
- Fill = 1,
- CountUp,
- CountDown,
- Invert,
- };
-};
-
-struct NVRenderPathCoverMode
-{
- enum Enum {
- ConvexHull = 1,
- BoundingBox,
- BoundingBoxOfBoundingBox,
- PathFillCover,
- PathStrokeCover,
- };
-};
-
-struct NVRenderPathTransformType
-{
- enum Enum {
- NoTransform = 0,
- TranslateX,
- TranslateY,
- Translate2D,
- Translate3D,
- Affine2D,
- Affine3D,
- TransposeAffine2D,
- TransposeAffine3D,
- };
-};
-
-#define QT3DS_RENDER_ITERATE_WINDING \
- QT3DS_RENDER_HANDLE_WINDING(Clockwise) \
- QT3DS_RENDER_HANDLE_WINDING(CounterClockwise)
-
-struct NVRenderWinding
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_WINDING(x) x,
- QT3DS_RENDER_ITERATE_WINDING
-#undef QT3DS_RENDER_HANDLE_WINDING
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_WINDING(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_WINDING
- #undef QT3DS_RENDER_HANDLE_WINDING
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_RENDER_STATE \
- QT3DS_RENDER_HANDLE_RENDER_STATE(Blend) \
- QT3DS_RENDER_HANDLE_RENDER_STATE(CullFace) \
- QT3DS_RENDER_HANDLE_RENDER_STATE(DepthTest) \
- QT3DS_RENDER_HANDLE_RENDER_STATE(StencilTest) \
- QT3DS_RENDER_HANDLE_RENDER_STATE(ScissorTest) \
- QT3DS_RENDER_HANDLE_RENDER_STATE(DepthWrite) \
- QT3DS_RENDER_HANDLE_RENDER_STATE(Multisample)
-
-struct NVRenderState
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_RENDER_STATE(x) x,
- QT3DS_RENDER_ITERATE_RENDER_STATE
-#undef QT3DS_RENDER_HANDLE_RENDER_STATE
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_RENDER_STATE(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_RENDER_STATE
- #undef QT3DS_RENDER_HANDLE_RENDER_STATE
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_BLEND_FUNC \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(Zero) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(One) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(SrcColor) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(OneMinusSrcColor) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(DstColor) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(OneMinusDstColor) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(SrcAlpha) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(OneMinusSrcAlpha) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(DstAlpha) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(OneMinusDstAlpha) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(ConstantColor) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(OneMinusConstantColor) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(ConstantAlpha) \
- QT3DS_RENDER_HANDLE_BLEND_FUNC(OneMinusConstantAlpha) \
- QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC(SrcAlphaSaturate)
-
-struct NVRenderSrcBlendFunc
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_BLEND_FUNC(x) x,
-#define QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC(x) x,
- QT3DS_RENDER_ITERATE_BLEND_FUNC
-#undef QT3DS_RENDER_HANDLE_BLEND_FUNC
-#undef QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC
- };
-
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_BLEND_FUNC(x) \
- case x: \
- return #x;
-#define QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_BLEND_FUNC
- #undef QT3DS_RENDER_HANDLE_BLEND_FUNC
- #undef QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-struct NVRenderDstBlendFunc
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_BLEND_FUNC(x) x,
-#define QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC(x)
- QT3DS_RENDER_ITERATE_BLEND_FUNC
-#undef QT3DS_RENDER_HANDLE_BLEND_FUNC
-#undef QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC
- };
-
- static const char *toString(const Enum value)
- {
- return NVRenderSrcBlendFunc::toString((NVRenderSrcBlendFunc::Enum)value);
- }
-};
-
-#define QT3DS_RENDER_ITERATE_BLEND_EQUATION \
- QT3DS_RENDER_HANDLE_BLEND_EQUATION(Add) \
- QT3DS_RENDER_HANDLE_BLEND_EQUATION(Subtract) \
- QT3DS_RENDER_HANDLE_BLEND_EQUATION(ReverseSubtract) \
- QT3DS_RENDER_HANDLE_BLEND_EQUATION(Overlay) \
- QT3DS_RENDER_HANDLE_BLEND_EQUATION(ColorBurn) \
- QT3DS_RENDER_HANDLE_BLEND_EQUATION(ColorDodge)
-
-struct NVRenderBlendEquation
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_BLEND_EQUATION(x) x,
- QT3DS_RENDER_ITERATE_BLEND_EQUATION
-#undef QT3DS_RENDER_HANDLE_BLEND_EQUATION
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_BLEND_EQUATION(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_BLEND_EQUATION
- #undef QT3DS_RENDER_HANDLE_BLEND_EQUATION
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_FACES \
- QT3DS_RENDER_HANDLE_FACES(Front) \
- QT3DS_RENDER_HANDLE_FACES(Back) \
- QT3DS_RENDER_HANDLE_FACES(FrontAndBack)
-
-struct NVRenderFaces
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_FACES(x) x,
- QT3DS_RENDER_ITERATE_FACES
-#undef QT3DS_RENDER_HANDLE_FACES
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_FACES(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_FACES
- #undef QT3DS_RENDER_HANDLE_FACES
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_READ_FACES \
- QT3DS_RENDER_HANDLE_READ_FACES(Front) \
- QT3DS_RENDER_HANDLE_READ_FACES(Back) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color0) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color1) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color2) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color3) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color4) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color5) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color6) \
- QT3DS_RENDER_HANDLE_READ_FACES(Color7)
-
-struct NVReadFaces
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_READ_FACES(x) x,
- QT3DS_RENDER_ITERATE_READ_FACES
-#undef QT3DS_RENDER_HANDLE_READ_FACES
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_READ_FACES(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_READ_FACES
- #undef QT3DS_RENDER_HANDLE_READ_FACES
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-struct NVRenderBoolOp
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_BOOL_OP(x) x,
- QT3DS_RENDER_ITERATE_BOOL_OP
-#undef QT3DS_RENDER_HANDLE_BOOL_OP
- };
-
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_BOOL_OP(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_BOOL_OP
- #undef QT3DS_RENDER_HANDLE_BOOL_OP
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-#define QT3DS_RENDER_ITERATE_STENCIL_OP \
- QT3DS_RENDER_HANDLE_STENCIL_OP(Keep) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(Zero) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(Replace) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(Increment) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(IncrementWrap) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(Decrement) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(DecrementWrap) \
- QT3DS_RENDER_HANDLE_STENCIL_OP(Invert)
-
-struct NVRenderStencilOp
-{
- enum Enum {
- Unknown = 0,
-#define QT3DS_RENDER_HANDLE_STENCIL_OP(x) x,
- QT3DS_RENDER_ITERATE_STENCIL_OP
-#undef QT3DS_RENDER_HANDLE_STENCIL_OP
- };
- static const char *toString(const Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_STENCIL_OP(x) \
- case x: \
- return #x;
- QT3DS_RENDER_ITERATE_STENCIL_OP
- #undef QT3DS_RENDER_HANDLE_STENCIL_OP
- default:
- break;
- }
- return "Unknown";
- }
-};
-
-struct NVRenderBlendFunctionArgument
-{
- NVRenderSrcBlendFunc::Enum m_SrcRGB;
- NVRenderDstBlendFunc::Enum m_DstRGB;
- NVRenderSrcBlendFunc::Enum m_SrcAlpha;
- NVRenderDstBlendFunc::Enum m_DstAlpha;
-
- NVRenderBlendFunctionArgument(NVRenderSrcBlendFunc::Enum srcRGB,
- NVRenderDstBlendFunc::Enum dstRGB,
- NVRenderSrcBlendFunc::Enum srcAlpha,
- NVRenderDstBlendFunc::Enum dstAlpha)
- : m_SrcRGB(srcRGB)
- , m_DstRGB(dstRGB)
- , m_SrcAlpha(srcAlpha)
- , m_DstAlpha(dstAlpha)
- {
- }
-
- // Default blend system premultiplies values.
- NVRenderBlendFunctionArgument()
- : m_SrcRGB(NVRenderSrcBlendFunc::SrcAlpha)
- , m_DstRGB(NVRenderDstBlendFunc::OneMinusSrcAlpha)
- , m_SrcAlpha(NVRenderSrcBlendFunc::One)
- , m_DstAlpha(NVRenderDstBlendFunc::OneMinusSrcAlpha)
- {
- }
-};
-
-struct NVRenderBlendEquationArgument
-{
- NVRenderBlendEquation::Enum m_RGBEquation;
- NVRenderBlendEquation::Enum m_AlphaEquation;
-
- NVRenderBlendEquationArgument(NVRenderBlendEquation::Enum rgb,
- NVRenderBlendEquation::Enum alpha)
- : m_RGBEquation(rgb)
- , m_AlphaEquation(alpha)
- {
- }
- NVRenderBlendEquationArgument()
- : m_RGBEquation(NVRenderBlendEquation::Add)
- , m_AlphaEquation(NVRenderBlendEquation::Add)
- {
- }
-};
-
-struct NVRenderStencilOperationArgument
-{
- NVRenderStencilOp::Enum m_StencilFail; // What happens when stencil test fails.
- // These values assume the stencil passed
- NVRenderStencilOp::Enum
- m_DepthFail; // What happens when the stencil passes but depth test fail.
- NVRenderStencilOp::Enum m_DepthPass; // What happens when the stencil and depth tests pass.
-
- NVRenderStencilOperationArgument(NVRenderStencilOp::Enum fail,
- NVRenderStencilOp::Enum depthFail,
- NVRenderStencilOp::Enum depthPass)
- : m_StencilFail(fail)
- , m_DepthFail(depthFail)
- , m_DepthPass(depthPass)
- {
- }
- NVRenderStencilOperationArgument()
- : m_StencilFail(NVRenderStencilOp::Keep)
- , m_DepthFail(NVRenderStencilOp::Keep)
- , m_DepthPass(NVRenderStencilOp::Keep)
- {
- }
- NVRenderStencilOperationArgument(const NVRenderStencilOperationArgument &StencilOp)
- : m_StencilFail(StencilOp.m_StencilFail)
- , m_DepthFail(StencilOp.m_DepthFail)
- , m_DepthPass(StencilOp.m_DepthPass)
- {
- }
-
- NVRenderStencilOperationArgument &operator=(const NVRenderStencilOperationArgument &rhs)
- {
- // Check for self-assignment!
- if (this == &rhs)
- return *this;
-
- m_StencilFail = rhs.m_StencilFail;
- m_DepthFail = rhs.m_DepthFail;
- m_DepthPass = rhs.m_DepthPass;
-
- return *this;
- }
-
- bool operator==(const NVRenderStencilOperationArgument &other) const
- {
- return (m_StencilFail == other.m_StencilFail && m_DepthFail == other.m_DepthFail
- && m_DepthPass == other.m_DepthPass);
- }
-};
-
-// see glStencilFuncSeparate
-struct NVRenderStencilFunctionArgument
-{
- NVRenderBoolOp::Enum m_Function;
- QT3DSU32 m_ReferenceValue;
- QT3DSU32 m_Mask;
-
- NVRenderStencilFunctionArgument(NVRenderBoolOp::Enum function, QT3DSU32 referenceValue,
- QT3DSU32 mask)
- : m_Function(function)
- , m_ReferenceValue(referenceValue)
- , m_Mask(mask)
- {
- }
- NVRenderStencilFunctionArgument()
- : m_Function(NVRenderBoolOp::AlwaysTrue)
- , m_ReferenceValue(0)
- , m_Mask((QT3DSU32)-1)
- {
- }
- NVRenderStencilFunctionArgument(const NVRenderStencilFunctionArgument &StencilFunc)
- : m_Function(StencilFunc.m_Function)
- , m_ReferenceValue(StencilFunc.m_ReferenceValue)
- , m_Mask(StencilFunc.m_Mask)
- {
- }
-
- NVRenderStencilFunctionArgument &operator=(const NVRenderStencilFunctionArgument &rhs)
- {
- // Check for self-assignment!
- if (this == &rhs)
- return *this;
-
- m_Function = rhs.m_Function;
- m_ReferenceValue = rhs.m_ReferenceValue;
- m_Mask = rhs.m_Mask;
-
- return *this;
- }
-
- bool operator==(const NVRenderStencilFunctionArgument &other) const
- {
- return (m_Function == other.m_Function && m_ReferenceValue == other.m_ReferenceValue
- && m_Mask == other.m_Mask);
- }
-};
-
-class NVRenderFrameBuffer;
-class NVRenderVertexBuffer;
-class NVRenderIndexBuffer;
-class NVRenderShaderProgram;
-class NVRenderProgramPipeline;
-class NVRenderTextureBase;
-class NVRenderTexture2D;
-class NVRenderTexture2DArray;
-class NVRenderTextureCube;
-class NVRenderImage2D;
-class NVRenderDataBuffer;
-class NVRenderAttribLayout;
-class NVRenderInputAssembler;
-
-typedef NVRenderFrameBuffer *NVRenderFrameBufferPtr;
-typedef NVRenderVertexBuffer *NVRenderVertexBufferPtr;
-typedef NVRenderIndexBuffer *NVRenderIndexBufferPtr;
-typedef NVRenderTexture2D *NVRenderTexture2DPtr;
-typedef NVRenderTexture2DPtr *NVRenderTexture2DHandle;
-typedef NVRenderTexture2DArray *NVRenderTexture2DArrayPtr;
-typedef NVRenderTextureCube *NVRenderTextureCubePtr;
-typedef NVRenderTextureCubePtr *NVRenderTextureCubeHandle;
-typedef NVRenderImage2D *NVRenderImage2DPtr;
-typedef NVRenderDataBuffer *NVRenderDataBufferPtr;
-typedef const char *NVRenderConstCharPtr;
-typedef bool QT3DSRenderBool;
-typedef NVRenderShaderProgram *NVRenderShaderProgramPtr;
-typedef NVDataRef<QT3DSU32> NVU32List;
-typedef NVDataRef<const char *> NVConstCharPtrList;
-
-template <typename TDataType>
-struct NVRenderRectT
-{
- typedef TDataType TRectType;
- TDataType m_X;
- TDataType m_Y;
- TDataType m_Width;
- TDataType m_Height;
- NVRenderRectT(TDataType x, TDataType y, TDataType w, TDataType h)
- : m_X(x)
- , m_Y(y)
- , m_Width(w)
- , m_Height(h)
- {
- }
- NVRenderRectT()
- : m_X(0)
- , m_Y(0)
- , m_Width(0)
- , m_Height(0)
- {
- }
- bool operator==(const NVRenderRectT<TDataType> &inOther) const
- {
- return m_X == inOther.m_X && m_Y == inOther.m_Y && m_Width == inOther.m_Width
- && m_Height == inOther.m_Height;
- }
- bool operator!=(const NVRenderRectT<TDataType> &inOther) const
- {
- return !(*this == inOther);
- }
- TDataType GetRightExtent() const { return m_X + m_Width; }
- TDataType GetBottomExtent() const { return m_Y + m_Height; }
- // Ensure this rect is inside the bounds of the other rect
- void EnsureInBounds(const NVRenderRectT<TDataType> &inOther)
- {
- TDataType rightExtent = qt3ds::NVMin(GetRightExtent(), inOther.GetRightExtent());
- TDataType bottomExtent = qt3ds::NVMin(GetBottomExtent(), inOther.GetBottomExtent());
- m_X = qt3ds::NVMax(m_X, inOther.m_X);
- m_Y = qt3ds::NVMax(m_Y, inOther.m_Y);
- m_Width = NVMax(static_cast<TDataType>(0), rightExtent - m_X);
- m_Height = NVMax(static_cast<TDataType>(0), bottomExtent - m_Y);
- }
-};
-
-// Render rects are setup to be in the coordinate space of the gl viewport,
-// so x, y are left, bottom with increasing units going to the right and
-// up respectively.
-struct NVRenderRect : public NVRenderRectT<QT3DSI32>
-{
- typedef NVRenderRectT<QT3DSI32> TBase;
- NVRenderRect(QT3DSI32 x, QT3DSI32 y, QT3DSI32 w, QT3DSI32 h)
- : TBase(x, y, w, h)
- {
- }
- NVRenderRect()
- : TBase()
- {
- }
-};
-
-struct NVRenderRectF : public NVRenderRectT<QT3DSF32>
-{
- typedef NVRenderRectT<QT3DSF32> TBase;
- NVRenderRectF(QT3DSF32 x, QT3DSF32 y, QT3DSF32 w, QT3DSF32 h)
- : TBase(x, y, w, h)
- {
- }
- NVRenderRectF()
- : TBase()
- {
- }
- NVRenderRectF(const NVRenderRect &inRect)
- : TBase((QT3DSF32)inRect.m_X, (QT3DSF32)inRect.m_Y, (QT3DSF32)inRect.m_Width,
- (QT3DSF32)inRect.m_Height)
- {
- }
- NVRenderRect ToIntegerRect() const
- {
- return NVRenderRect((QT3DSI32)m_X, (QT3DSI32)m_Y, (QT3DSU32)(m_Width + .5f),
- (QT3DSU32)(m_Height + .5f));
- }
- QT3DSVec2 BottomLeft() const { return QT3DSVec2(m_X, m_Y); }
- QT3DSVec2 Center() const
- {
- QT3DSVec2 halfDims = HalfDims();
- return QT3DSVec2(m_X + halfDims.x, m_Y + halfDims.y);
- }
- QT3DSVec2 HalfDims() const { return QT3DSVec2(m_Width / 2.0f, m_Height / 2.0f); }
- // Normalized coordinates are in the range of -1,1 where -1 is the left, bottom edges
- // and 1 is the top,right edges.
- QT3DSVec2 AbsoluteToNormalizedCoordinates(QT3DSVec2 absoluteCoordinates) const
- {
- QT3DSVec2 relativeCoords(ToRectRelative(absoluteCoordinates));
- return RelativeToNormalizedCoordinates(relativeCoords);
- };
-
- QT3DSVec2 RelativeToNormalizedCoordinates(QT3DSVec2 rectRelativeCoords) const
- {
- QT3DSVec2 halfDims(HalfDims());
- QT3DSVec2 retval((rectRelativeCoords.x / halfDims.x) - 1.0f,
- (rectRelativeCoords.y / halfDims.y) - 1.0f);
- return retval;
- }
-
- // Take coordinates in global space and move local space where 0,0 is the center
- // of the rect but return value in pixels, not in normalized -1,1 range
- QT3DSVec2 ToNormalizedRectRelative(QT3DSVec2 absoluteCoordinates) const
- {
- // normalize them
- QT3DSVec2 relativeCoords(ToRectRelative(absoluteCoordinates));
- QT3DSVec2 halfDims(HalfDims());
- QT3DSVec2 normalized((relativeCoords.x / halfDims.x) - 1.0f,
- (relativeCoords.y / halfDims.y) - 1.0f);
- return QT3DSVec2(normalized.x * halfDims.x, normalized.y * halfDims.y);
- }
-
- // Return coordinates in pixels but relative to this rect.
- QT3DSVec2 ToRectRelative(QT3DSVec2 absoluteCoordinates) const
- {
- return QT3DSVec2(absoluteCoordinates.x - m_X, absoluteCoordinates.y - m_Y);
- }
-
- QT3DSVec2 ToAbsoluteCoords(QT3DSVec2 inRelativeCoords) const
- {
- return QT3DSVec2(inRelativeCoords.x + m_X, inRelativeCoords.y + m_Y);
- }
-};
-
-template <typename TDataType>
-struct NVRenderGenericVec2
-{
- TDataType x;
- TDataType y;
- NVRenderGenericVec2(TDataType _x, TDataType _y)
- : x(_x)
- , y(_y)
- {
- }
- NVRenderGenericVec2() {}
- bool operator==(const NVRenderGenericVec2 &inOther) const
- {
- return x == inOther.x && y == inOther.y;
- }
-};
-
-template <typename TDataType>
-struct NVRenderGenericVec3
-{
- TDataType x;
- TDataType y;
- TDataType z;
- NVRenderGenericVec3(TDataType _x, TDataType _y, TDataType _z)
- : x(_x)
- , y(_y)
- , z(_z)
- {
- }
- NVRenderGenericVec3() {}
- bool operator==(const NVRenderGenericVec3 &inOther) const
- {
- return x == inOther.x && y == inOther.y && z == inOther.z;
- }
-};
-
-template <typename TDataType>
-struct NVRenderGenericVec4
-{
- TDataType x;
- TDataType y;
- TDataType z;
- TDataType w;
- NVRenderGenericVec4(TDataType _x, TDataType _y, TDataType _z, TDataType _w)
- : x(_x)
- , y(_y)
- , z(_z)
- , w(_w)
- {
- }
- NVRenderGenericVec4() {}
- bool operator==(const NVRenderGenericVec4 &inOther) const
- {
- return x == inOther.x && y == inOther.y && z == inOther.z && w == inOther.w;
- }
-};
-
-#define DECLARE_GENERIC_VECTOR_TYPE(type, numElems) \
- typedef NVRenderGenericVec##numElems<type> type##_##numElems
-DECLARE_GENERIC_VECTOR_TYPE(bool, 2);
-DECLARE_GENERIC_VECTOR_TYPE(bool, 3);
-DECLARE_GENERIC_VECTOR_TYPE(bool, 4);
-DECLARE_GENERIC_VECTOR_TYPE(QT3DSU32, 2);
-DECLARE_GENERIC_VECTOR_TYPE(QT3DSU32, 3);
-DECLARE_GENERIC_VECTOR_TYPE(QT3DSU32, 4);
-DECLARE_GENERIC_VECTOR_TYPE(QT3DSI32, 2);
-DECLARE_GENERIC_VECTOR_TYPE(QT3DSI32, 3);
-DECLARE_GENERIC_VECTOR_TYPE(QT3DSI32, 4);
-
-#define ITERATE_QT3DS_SHADER_DATA_TYPES \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSI32) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSI32_2) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSI32_3) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSI32_4) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSRenderBool) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(bool_2) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(bool_3) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(bool_4) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSF32) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSVec2) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSVec3) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSVec4) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSU32) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSU32_2) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSU32_3) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSU32_4) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSMat33) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(QT3DSMat44) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderTexture2DPtr) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderTexture2DHandle) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderTexture2DArrayPtr) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderTextureCubePtr) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderTextureCubeHandle) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderImage2DPtr) \
- HANDLE_QT3DS_SHADER_DATA_TYPE(NVRenderDataBufferPtr)
-
-struct NVRenderShaderDataTypes
-{
- enum Enum {
- Unknown = 0,
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(type) type,
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- };
-};
-
-template <typename TDataType>
-struct NVDataTypeToShaderDataTypeMap
-{
-};
-
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(type) \
- template <> \
- struct NVDataTypeToShaderDataTypeMap<type> \
-{ \
- static NVRenderShaderDataTypes::Enum GetType() { return NVRenderShaderDataTypes::type; } \
-};
-ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
-
-template <>
-struct NVDataTypeToShaderDataTypeMap<NVConstDataRef<QT3DSMat44>>
-{
- static NVRenderShaderDataTypes::Enum GetType() { return NVRenderShaderDataTypes::QT3DSMat44; }
-};
-
-struct NVRenderShaderTypeValue
-{
- enum Enum {
- Unknown = 1 << 0,
- Vertex = 1 << 1,
- Fragment = 1 << 2,
- TessControl = 1 << 3,
- TessEvaluation = 1 << 4,
- Geometry = 1 << 5
- };
-};
-
-typedef NVFlags<NVRenderShaderTypeValue::Enum, QT3DSU32> NVRenderShaderTypeFlags;
-
-struct NVRenderTextureTypeValue
-{
- enum Enum {
- Unknown = 0,
- Diffuse,
- Specular,
- Environment,
- Bump,
- Normal,
- Displace,
- Emissive,
- Emissive2,
- Anisotropy,
- Translucent,
- LightmapIndirect,
- LightmapRadiosity,
- LightmapShadow
- };
-
- static const char *toString(const NVRenderTextureTypeValue::Enum value)
- {
- switch (value) {
- case Unknown:
- return "Unknown";
- case Diffuse:
- return "Diffuse";
- case Specular:
- return "Specular";
- case Environment:
- return "Environment";
- case Bump:
- return "Bump";
- case Normal:
- return "Normal";
- case Displace:
- return "Displace";
- case Emissive:
- return "Emissive";
- case Emissive2:
- return "Emissive2";
- case Anisotropy:
- return "Anisotropy";
- case Translucent:
- return "Translucent";
- case LightmapIndirect:
- return "LightmapIndirect";
- case LightmapRadiosity:
- return "LightmapRadiosity";
- case LightmapShadow:
- return "LightmapShadow";
- default:
- return "Unknown";
- }
- }
-};
-
-#define ITERATE_QT3DS_READ_PIXEL_FORMATS \
- HANDLE_QT3DS_READ_PIXEL_FORMAT(Alpha8) \
- HANDLE_QT3DS_READ_PIXEL_FORMAT(RGB565) \
- HANDLE_QT3DS_READ_PIXEL_FORMAT(RGB8) \
- HANDLE_QT3DS_READ_PIXEL_FORMAT(RGBA4444) \
- HANDLE_QT3DS_READ_PIXEL_FORMAT(RGBA5551) \
- HANDLE_QT3DS_READ_PIXEL_FORMAT(RGBA8)
-
-struct NVRenderReadPixelFormats
-{
- enum Enum {
- Unknown = 0,
-#define HANDLE_QT3DS_READ_PIXEL_FORMAT(format) format,
- ITERATE_QT3DS_READ_PIXEL_FORMATS
-#undef HANDLE_QT3DS_READ_PIXEL_FORMAT
- };
-};
-
-// Now for scoped property access.
-template <typename TBaseType, typename TDataType>
-struct NVRenderGenericScopedProperty
-{
- typedef void (TBaseType::*TSetter)(TDataType inType);
- typedef TDataType (TBaseType::*TGetter)() const;
-
- TBaseType &m_Context;
- TSetter m_Setter;
- TDataType m_InitialValue;
- NVRenderGenericScopedProperty(TBaseType &ctx, TGetter getter, TSetter setter)
- : m_Context(ctx)
- , m_Setter(setter)
- , m_InitialValue(((ctx).*getter)())
- {
- }
- NVRenderGenericScopedProperty(TBaseType &ctx, TGetter getter, TSetter setter,
- const TDataType &inNewValue)
- : m_Context(ctx)
- , m_Setter(setter)
- , m_InitialValue(((ctx).*getter)())
- {
- ((m_Context).*m_Setter)(inNewValue);
- }
- ~NVRenderGenericScopedProperty() { ((m_Context).*m_Setter)(m_InitialValue); }
-};
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.cpp
deleted file mode 100644
index 01aef473..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderComputeShader.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderComputeShader::NVRenderComputeShader(NVRenderContextImpl &context,
- NVFoundationBase &fnd, NVConstDataRef<QT3DSI8> source,
- bool binaryProgram)
- : NVRenderShader(context, fnd, source, binaryProgram)
- , m_ShaderHandle(NULL)
- {
- m_ShaderHandle = m_Backend->CreateComputeShader(source, m_ErrorMessage, binaryProgram);
- }
-
- NVRenderComputeShader::~NVRenderComputeShader()
- {
- if (m_ShaderHandle) {
- m_Backend->ReleaseComputeShader(m_ShaderHandle);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.h
deleted file mode 100644
index 1ab36bc0..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderComputeShader.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_COMPUTE_SHADER_H
-#define QT3DS_RENDER_COMPUTE_SHADER_H
-
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderShader.h"
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- ///< This class represents a compute shader
- class NVRenderComputeShader : public NVRenderShader
- {
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] source Pointer to shader source code
- * @param[in] binaryProgram true if this is a binary program
- *
- * @return No return.
- */
- NVRenderComputeShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram);
-
- /// @brief destructor
- ~NVRenderComputeShader();
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- bool IsValid() override { return (m_ShaderHandle != NULL); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendComputeShaderObject GetShaderHandle()
- {
- return m_ShaderHandle;
- }
-
- private:
- NVRenderBackend::NVRenderBackendComputeShaderObject
- m_ShaderHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.cpp
deleted file mode 100644
index 1b3c43a9..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderConstantBuffer.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-namespace qt3ds {
-namespace render {
-
- ///< struct handling a constant buffer entry
- class ConstantBufferParamEntry
- {
- public:
- CRegisteredString m_Name; ///< parameter Name
- NVRenderShaderDataTypes::Enum m_Type; ///< parameter type
- QT3DSI32 m_Count; ///< one or array size
- QT3DSI32 m_Offset; ///< offset into the memory buffer
-
- ConstantBufferParamEntry(CRegisteredString name, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 count, QT3DSI32 offset)
- : m_Name(name)
- , m_Type(type)
- , m_Count(count)
- , m_Offset(offset)
- {
- }
- };
-
- NVRenderConstantBuffer::NVRenderConstantBuffer(NVRenderContextImpl &context,
- CRegisteredString bufferName, size_t size,
- NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data)
- : NVRenderDataBuffer(context, context.GetFoundation(), size,
- NVRenderBufferBindValues::Constant, usageType, NVDataRef<QT3DSU8>())
- , m_Name(bufferName)
- , m_ConstantBufferEntryMap(m_Foundation.getAllocator(),
- "NVRenderConstantBuffer::m_ConstantBufferEntryMap")
- , m_CurrentOffset(0)
- , m_CurrentSize(0)
- , m_HWBufferInitialized(false)
- , m_Dirty(true)
- , m_RangeStart(0)
- , m_RangeEnd(0)
- , m_MaxBlockSize(0)
- {
- QT3DS_ASSERT(context.GetConstantBufferSupport());
-
- m_Backend->GetRenderBackendValue(
- NVRenderBackend::NVRenderBackendQuery::MaxConstantBufferBlockSize, &m_MaxBlockSize);
-
- if (size && data.size() && size == data.size()) {
- QT3DS_ASSERT(size < (QT3DSU32)m_MaxBlockSize);
- if (allocateShadowBuffer(data.size())) {
- memcpy(m_ShadowCopy.begin(), data.begin(), data.size());
- }
- }
- }
-
- NVRenderConstantBuffer::~NVRenderConstantBuffer()
- {
- // check if we should release memory
- if (m_ShadowCopy.size()) {
- m_Foundation.getAllocator().deallocate(m_ShadowCopy.begin());
- }
-
- m_ShadowCopy = NVDataRef<QT3DSU8>();
-
- for (TRenderConstantBufferEntryMap::iterator iter = m_ConstantBufferEntryMap.begin(),
- end = m_ConstantBufferEntryMap.end();
- iter != end; ++iter) {
- NVDelete(m_Foundation.getAllocator(), iter->second);
- }
-
- m_ConstantBufferEntryMap.clear();
-
- m_Context.BufferDestroyed(*this);
- }
-
- void NVRenderConstantBuffer::Bind()
- {
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to Bind a locked buffer");
- QT3DS_ASSERT(false);
- }
-
- m_Backend->BindBuffer(m_BufferHandle, m_BindFlags);
- }
-
- void NVRenderConstantBuffer::BindToShaderProgram(NVRenderShaderProgram *inShader,
- QT3DSU32 blockIndex, QT3DSU32 binding)
- {
- if ((QT3DSI32)binding == -1) {
- binding = m_Context.GetNextConstantBufferUnit();
- m_Backend->ProgramSetConstantBlock(inShader->GetShaderProgramHandle(), blockIndex,
- binding);
- }
-
- m_Backend->ProgramSetConstantBuffer(binding, m_BufferHandle);
- }
-
- bool NVRenderConstantBuffer::SetupBuffer(NVRenderShaderProgram *pProgram, QT3DSI32 index,
- QT3DSI32 bufSize, QT3DSI32 paramCount)
- {
- bool bSuccess = false;
-
- if (!m_HWBufferInitialized) {
- // allocate shadow buffer
- QT3DSU8 *newMem = (QT3DSU8 *)m_Foundation.getAllocator().allocate(
- bufSize, "NVRenderConstantBuffer", __FILE__, __LINE__);
- if (!newMem)
- return false;
-
- // allocate temp buffers to hold constant buffer information
- QT3DSI32 *theIndices = NULL, *theTypes = NULL, *theSizes = NULL, *theOffsets = NULL;
- theIndices = (QT3DSI32 *)QT3DS_ALLOC(m_Foundation.getAllocator(), paramCount * sizeof(QT3DSI32),
- "NVRenderConstantBuffer");
- if (!theIndices)
- goto fail;
- theTypes = (QT3DSI32 *)QT3DS_ALLOC(m_Foundation.getAllocator(), paramCount * sizeof(QT3DSI32),
- "NVRenderConstantBuffer");
- if (!theTypes)
- goto fail;
- theSizes = (QT3DSI32 *)QT3DS_ALLOC(m_Foundation.getAllocator(), paramCount * sizeof(QT3DSI32),
- "NVRenderConstantBuffer");
- if (!theSizes)
- goto fail;
- theOffsets = (QT3DSI32 *)QT3DS_ALLOC(m_Foundation.getAllocator(), paramCount * sizeof(QT3DSI32),
- "NVRenderConstantBuffer");
- if (!theOffsets)
- goto fail;
-
- bSuccess = true;
-
- // get indices for the individal constant buffer entries
- m_Backend->GetConstantBufferParamIndices(pProgram->GetShaderProgramHandle(), index,
- theIndices);
-
- // get constant buffer uniform information
- m_Backend->GetConstantBufferParamInfoByIndices(pProgram->GetShaderProgramHandle(),
- paramCount, (QT3DSU32 *)theIndices,
- theTypes, theSizes, theOffsets);
-
- // get the names of the uniforms
- char nameBuf[512];
- QT3DSI32 elementCount, binding;
- NVRenderShaderDataTypes::Enum type;
-
- QT3DS_FOREACH(idx, paramCount)
- {
- m_Backend->GetConstantInfoByID(pProgram->GetShaderProgramHandle(), theIndices[idx],
- 512, &elementCount, &type, &binding, nameBuf);
- // check if we already have this entry
- CRegisteredString theName(m_Context.GetStringTable().RegisterStr(nameBuf));
- TRenderConstantBufferEntryMap::iterator entry =
- m_ConstantBufferEntryMap.find(theName);
- if (entry != m_ConstantBufferEntryMap.end()) {
- ConstantBufferParamEntry *pParam = entry->second;
- // copy content
- if (m_ShadowCopy.size())
- memcpy(newMem + theOffsets[idx],
- m_ShadowCopy.begin() + entry->second->m_Offset,
- entry->second->m_Count * getUniformTypeSize(pParam->m_Type));
-
- pParam->m_Offset = theOffsets[idx];
- QT3DS_ASSERT(type == pParam->m_Type);
- QT3DS_ASSERT(elementCount == pParam->m_Count);
- } else {
- // create one
- m_ConstantBufferEntryMap.insert(eastl::make_pair(
- theName,
- createParamEntry(theName, (NVRenderShaderDataTypes::Enum)theTypes[idx],
- theSizes[idx], theOffsets[idx])));
- }
- }
-
- // release previous one
- if (m_ShadowCopy.size()) {
- m_Foundation.getAllocator().deallocate(m_ShadowCopy.begin());
- }
- // set new one
- m_ShadowCopy = NVDataRef<QT3DSU8>(newMem, bufSize);
-
- m_HWBufferInitialized = true;
-
- fail:
- if (theIndices)
- QT3DS_FREE(m_Foundation.getAllocator(), theIndices);
- if (theTypes)
- QT3DS_FREE(m_Foundation.getAllocator(), theTypes);
- if (theSizes)
- QT3DS_FREE(m_Foundation.getAllocator(), theSizes);
- if (theOffsets)
- QT3DS_FREE(m_Foundation.getAllocator(), theOffsets);
-
- } else {
- // some sanity checks
- bSuccess = true;
- bSuccess &= (m_ShadowCopy.size() <= (QT3DSU32)bufSize);
- }
-
- return bSuccess;
- }
-
- void NVRenderConstantBuffer::Update()
- {
- // we only update the buffer if the buffer is already on hardware
- // and if it is dirty
- if (m_Dirty && m_HWBufferInitialized) {
- if (m_RangeEnd == 0)
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, m_ShadowCopy.size(),
- m_UsageType, m_ShadowCopy.begin());
- else
- UpdateRange();
-
- m_Dirty = false;
- m_RangeStart = m_RangeEnd = 0;
- }
- }
-
- void NVRenderConstantBuffer::UpdateRange()
- {
- if ((m_RangeStart + m_RangeEnd) > m_ShadowCopy.size()) {
- QT3DS_ASSERT(false);
- return;
- }
-
- m_Backend->UpdateBufferRange(m_BufferHandle, m_BindFlags, m_RangeStart,
- m_RangeEnd - m_RangeStart,
- m_ShadowCopy.begin() + m_RangeStart);
- }
-
- void NVRenderConstantBuffer::AddParam(CRegisteredString name,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count)
- {
- if (m_ConstantBufferEntryMap.find(name) == m_ConstantBufferEntryMap.end()) {
- ConstantBufferParamEntry *newEntry =
- QT3DS_NEW(m_Foundation.getAllocator(), ConstantBufferParamEntry)(name, type, count,
- m_CurrentOffset);
-
- if (newEntry)
- m_ConstantBufferEntryMap.insert(eastl::make_pair(name, newEntry));
- } else {
- // no duplicated entries
- return;
- }
-
- // compute new current buffer size and offset
- QT3DSI32 constantSize = getUniformTypeSize(type) * count;
- m_CurrentSize += constantSize;
- m_CurrentOffset += constantSize;
- }
-
- void NVRenderConstantBuffer::UpdateParam(const char *inName, NVDataRef<QT3DSU8> value)
- {
- // allocate space if not done yet
- // NOTE this gets reallocated once we get the real constant buffer size from a program
- if (!m_ShadowCopy.size()) {
- // allocate shadow buffer
- if (!allocateShadowBuffer(m_CurrentSize))
- return;
- }
-
- CRegisteredString theName(m_Context.GetStringTable().RegisterStr(inName));
- TRenderConstantBufferEntryMap::iterator entry = m_ConstantBufferEntryMap.find(theName);
- if (entry != m_ConstantBufferEntryMap.end()) {
- if (!memcmp(m_ShadowCopy.begin() + entry->second->m_Offset, value.begin(),
- entry->second->m_Count * getUniformTypeSize(entry->second->m_Type))) {
- return;
- }
- memcpy(m_ShadowCopy.begin() + entry->second->m_Offset, value.begin(),
- entry->second->m_Count * getUniformTypeSize(entry->second->m_Type));
- m_Dirty = true;
- }
- }
-
- void NVRenderConstantBuffer::UpdateRaw(QT3DSI32 offset, NVDataRef<QT3DSU8> data)
- {
- // allocate space if yet done
- if (!m_ShadowCopy.size()) {
- // allocate shadow buffer
- if (!allocateShadowBuffer(data.size()))
- return;
- }
-
- QT3DS_ASSERT((offset + data.size()) < (QT3DSU32)m_MaxBlockSize);
-
- // we do not initialize anything when this is used
- m_HWBufferInitialized = true;
-
- // we do not allow resize once allocated
- if ((offset + data.size()) > m_ShadowCopy.size())
- return;
-
- // copy data
- if (!memcmp(m_ShadowCopy.begin() + offset, data.begin(), data.size())) {
- return;
- }
- memcpy(m_ShadowCopy.begin() + offset, data.begin(), data.size());
-
- // update start
- m_RangeStart = (m_Dirty) ? (m_RangeStart > (QT3DSU32)offset) ? offset : m_RangeStart : offset;
- m_RangeEnd = (offset + data.size() > m_RangeEnd) ? offset + data.size() : m_RangeEnd;
-
- m_Dirty = true;
- }
-
- ConstantBufferParamEntry *NVRenderConstantBuffer::createParamEntry(
- CRegisteredString name, NVRenderShaderDataTypes::Enum type, QT3DSI32 count, QT3DSI32 offset)
- {
- ConstantBufferParamEntry *newEntry = QT3DS_NEW(
- m_Foundation.getAllocator(), ConstantBufferParamEntry)(name, type, count, offset);
-
- return newEntry;
- }
-
- QT3DSI32
- NVRenderConstantBuffer::getUniformTypeSize(NVRenderShaderDataTypes::Enum type)
- {
- switch (type) {
- case NVRenderShaderDataTypes::QT3DSF32:
- return sizeof(QT3DSF32);
- case NVRenderShaderDataTypes::QT3DSI32:
- return sizeof(QT3DSI32);
- case NVRenderShaderDataTypes::QT3DSI32_2:
- return sizeof(QT3DSI32) * 2;
- case NVRenderShaderDataTypes::QT3DSI32_3:
- return sizeof(QT3DSI32) * 3;
- case NVRenderShaderDataTypes::QT3DSI32_4:
- return sizeof(QT3DSI32) * 4;
- case NVRenderShaderDataTypes::QT3DSU32:
- return sizeof(QT3DSU32);
- case NVRenderShaderDataTypes::QT3DSU32_2:
- return sizeof(QT3DSU32) * 2;
- case NVRenderShaderDataTypes::QT3DSU32_3:
- return sizeof(QT3DSU32) * 3;
- case NVRenderShaderDataTypes::QT3DSU32_4:
- return sizeof(QT3DSU32) * 4;
- case NVRenderShaderDataTypes::QT3DSVec2:
- return sizeof(QT3DSF32) * 2;
- case NVRenderShaderDataTypes::QT3DSVec3:
- return sizeof(QT3DSF32) * 3;
- case NVRenderShaderDataTypes::QT3DSVec4:
- return sizeof(QT3DSF32) * 4;
- case NVRenderShaderDataTypes::QT3DSMat33:
- return sizeof(QT3DSF32) * 9;
- case NVRenderShaderDataTypes::QT3DSMat44:
- return sizeof(QT3DSF32) * 16;
- default:
- QT3DS_ASSERT(!"Unhandled type in NVRenderConstantBuffer::getUniformTypeSize");
- break;
- }
-
- return 0;
- }
-
- bool NVRenderConstantBuffer::allocateShadowBuffer(QT3DSU32 size)
- {
- // allocate shadow buffer
- QT3DSU8 *newMem = (QT3DSU8 *)m_Foundation.getAllocator().allocate(size, "NVRenderConstantBuffer",
- __FILE__, __LINE__);
- if (!newMem)
- return false;
-
- m_ShadowCopy = NVDataRef<QT3DSU8>(newMem, size);
-
- m_BufferCapacity = size;
-
- return true;
- }
-
- NVRenderConstantBuffer *NVRenderConstantBuffer::Create(NVRenderContextImpl &context,
- const char *bufferName,
- NVRenderBufferUsageType::Enum usageType,
- size_t size,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVFoundationBase &fnd(context.GetFoundation());
- NVRenderConstantBuffer *retval = NULL;
-
- if (context.GetConstantBufferSupport()) {
- CRegisteredString theBufferName(context.GetStringTable().RegisterStr(bufferName));
- QT3DSU32 cbufSize = sizeof(NVRenderConstantBuffer);
- QT3DSU8 *newMem = (QT3DSU8 *)QT3DS_ALLOC(fnd.getAllocator(), cbufSize, "ConstantBuffer");
- retval = new (newMem) NVRenderConstantBuffer(
- context, theBufferName, size, usageType,
- toDataRef(const_cast<QT3DSU8 *>(bufferData.begin()), bufferData.size()));
- } else {
- QT3DS_ASSERT(false);
- }
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.h
deleted file mode 100644
index 5ede23b9..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderConstantBuffer.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_CONSTANT_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_CONSTANT_BUFFER_H
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Utils.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderDataBuffer.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- // forward declaration
- class NVRenderContextImpl;
- class ConstantBufferParamEntry;
- class NVRenderShaderProgram;
-
- typedef nvhash_map<CRegisteredString, ConstantBufferParamEntry *> TRenderConstantBufferEntryMap;
-
- ///< Constant (uniform) buffer representation
- class QT3DS_AUTOTEST_EXPORT NVRenderConstantBuffer : public NVRenderDataBuffer
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] bufferName Name of the buffer. Must match the name used in programs
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return.
- */
- NVRenderConstantBuffer(NVRenderContextImpl &context, CRegisteredString bufferName,
- size_t size, NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data);
-
- ///< destructor
- virtual ~NVRenderConstantBuffer();
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- void Bind() override;
-
- /**
- * @brief bind the buffer to a shader program
- *
- * @param[in] inShader Pointer to active program
- * @param[in] blockIndex Index of the constant block within the program
- * @param[in] binding Binding point of constant buffer
- *
- * @return no return.
- */
- virtual void BindToShaderProgram(NVRenderShaderProgram *inShader, QT3DSU32 blockIndex,
- QT3DSU32 binding);
-
- /**
- * @brief update the buffer to hardware
- *
- * @return no return.
- */
- virtual void Update();
-
- /**
- * @brief setup constant buffer
- *
- * @param[in] pProgram Pointer to the shader program
- * @param[in] index Index of the constant buffer within the program
- * @param[in] bufSize Size of the constant buffer
- * @param[in] paramCount Parameter entry count of the constant buffer
- *
- * @return return if successful
- */
- bool SetupBuffer(NVRenderShaderProgram *pProgram, QT3DSI32 index, QT3DSI32 bufSize,
- QT3DSI32 paramCount);
-
- /**
- * @brief add a parameter to the constant buffer
- *
- * @param[in] name Name of the parameter (must match the name in the shader
- * program)
- * @param[in] type Type of the parameter like Mat44
- * @param[in] count One or size of array
- *
- * @return no return
- */
- void AddParam(CRegisteredString name, NVRenderShaderDataTypes::Enum type, QT3DSI32 count);
-
- /**
- * @brief update a parameter in the constant buffer
- *
- * @param[in] name Name of the parameter (must match the name in the shader
- * program)
- * @param[in] value New value
- *
- * @return no return
- */
- void UpdateParam(const char *name, NVDataRef<QT3DSU8> value);
-
- /**
- * @brief update a piece of memory directly within the constant buffer
- *
- * Note: When you use this function you should know what you are doing.
- * The memory layout within C++ must exactly match the memory layout in the
- *shader.
- * We use std140 layout which guarantees a specific layout behavior across all
- *HW vendors.
- * How the memory layout is computed can be found in the GL spec.
- *
- * @param[in] offset offset into constant buffer
- * @param[in] data pointer to new data
- *
- * @return no return
- */
- void UpdateRaw(QT3DSI32 offset, NVDataRef<QT3DSU8> data);
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const override
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
-
- /**
- * @brief create a NVRenderConstantBuffer object
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return the backend object handle.
- */
- static NVRenderConstantBuffer *Create(NVRenderContextImpl &context, const char *bufferName,
- NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData);
-
- /**
- * @brief get the buffer name
- *
- * @return the buffer name
- */
- CRegisteredString GetBufferName() const { return m_Name; }
-
- private:
- /**
- * @brief Create a parameter entry
- *
- * @param[in] name Name of the parameter (must match the name in the shader
- * program)
- * @param[in] type Type of the parameter like Mat44
- * @param[in] count One or size of array
- * @param[in] offset Offset of the parameter in the memory buffer
- *
- * @return return new Entry
- */
- ConstantBufferParamEntry *createParamEntry(CRegisteredString name,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count,
- QT3DSI32 offset);
-
- /**
- * @brief get size of a uniform type
- *
- * @param[in] type type of uniform
- *
- * @return return uniform size
- */
- QT3DSI32
- getUniformTypeSize(NVRenderShaderDataTypes::Enum type);
-
- /**
- * @brief allocate the shadow buffer
- *
- * @param[in] size size of buffer
- *
- * @return return true on success
- */
- bool allocateShadowBuffer(QT3DSU32 size);
-
- /**
- * @brief update a certain range of the buffer to hardware
- *
- * @return no return.
- */
- virtual void UpdateRange();
-
- private:
- CRegisteredString m_Name; ///< buffer name
- TRenderConstantBufferEntryMap
- m_ConstantBufferEntryMap; ///< holds the entries of a constant buffer
- QT3DSU32 m_CurrentOffset; ///< holds the current offset
- QT3DSU32 m_CurrentSize; ///< holds the current size
- bool m_HWBufferInitialized; ///< true if the hardware version of the buffer is initialized
- bool m_Dirty; ///< true if buffer is dirty
- QT3DSU32 m_RangeStart; ///< start offset of the range to update
- QT3DSU32 m_RangeEnd; ///< size of the range to update
- QT3DSI32 m_MaxBlockSize; ///< maximum size for a single constant buffer
- NVDataRef<QT3DSU8> m_ShadowCopy; ///< host copy of the data in the GPU
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.cpp
deleted file mode 100644
index aa2cb30f..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.cpp
+++ /dev/null
@@ -1,1107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSMat44.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Utils.h"
-#include "EASTL/set.h"
-#include "EASTL/utility.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace eastl;
-
-namespace qt3ds {
-namespace render {
-
- NVRenderContextImpl::NVRenderContextImpl(NVFoundationBase &fnd, NVRenderBackend &inBackend,
- IStringTable &inStrTable)
- : m_backend(inBackend)
- , m_DirtyFlags(0)
- , m_DefaultOffscreenRenderTarget((NVRenderBackend::NVRenderBackendRenderTargetObject)NULL)
- , m_DephBits(16)
- , m_StencilBits(8)
- , mRefCount(0)
- , m_Foundation(fnd)
- , m_StringTable(inStrTable)
- , m_VertToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_VertToImpMap")
- , m_IndexToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_IndexToImpMap")
- , m_ConstantToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_ConstantToImpMap")
- , m_StorageToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_StorageToImpMap")
- , m_AtomicCounterToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_AtomicCounterToImpMap")
- , m_DrawIndirectToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_DrawIndirectToImpMap")
- , m_DepthStencilStateToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_DepthStencilStateToImpMap")
- , m_RasterizerStateToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_RasterizerStateToImpMap")
- , m_PathFontSpecToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_RasterizerStateToImpMap")
- , m_Tex2DToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_Tex2DToImpMap")
- , m_Tex2DArrayToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_Tex2DArrayToImpMap")
- , m_TexCubeToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_TexCubeToImpMap")
- , m_Image2DtoImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_Image2DtoImpMap")
- , m_ShaderToImpMap(m_Foundation.getAllocator(), "NVRenderContextImpl::m_ShaderToImpMap")
- , m_RenderBufferToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_RenderBufferToImpMap")
- , m_FrameBufferToImpMap(m_Foundation.getAllocator(),
- "NVRenderContextImpl::m_FrameBufferToImpMap")
- , m_NextTextureUnit(1)
- , m_NextConstantBufferUnit(1)
- , m_PropertyStack(m_Foundation.getAllocator(), "NVRenderContextImpl::m_PropertyStack")
- {
-
- m_StringTable.addRef();
-
- m_MaxTextureUnits = m_backend->GetMaxCombinedTextureUnits();
- m_MaxConstantBufferUnits = 16; // need backend query
-
- // get initial state
- memZero(&m_HardwarePropertyContext, sizeof(m_HardwarePropertyContext));
-
- // get default blending functions
- m_backend->GetBlendFunc(&m_HardwarePropertyContext.m_BlendFunction);
- // set default blend euqation
- m_HardwarePropertyContext.m_BlendEquation.m_RGBEquation = NVRenderBlendEquation::Add;
- m_HardwarePropertyContext.m_BlendEquation.m_AlphaEquation = NVRenderBlendEquation::Add;
- // default state
- m_HardwarePropertyContext.m_CullingEnabled =
- m_backend->GetRenderState(NVRenderState::CullFace);
- m_HardwarePropertyContext.m_DepthFunction = m_backend->GetDepthFunc();
- m_HardwarePropertyContext.m_BlendingEnabled =
- m_backend->GetRenderState(NVRenderState::Blend);
- m_HardwarePropertyContext.m_DepthWriteEnabled = m_backend->GetDepthWrite();
- m_HardwarePropertyContext.m_DepthTestEnabled =
- m_backend->GetRenderState(NVRenderState::DepthTest);
- m_HardwarePropertyContext.m_ScissorTestEnabled =
- m_backend->GetRenderState(NVRenderState::ScissorTest);
- m_backend->GetScissorRect(&m_HardwarePropertyContext.m_ScissorRect);
- m_backend->GetViewportRect(&m_HardwarePropertyContext.m_Viewport);
-
- DoSetClearColor(m_HardwarePropertyContext.m_ClearColor);
- }
-
- NVRenderContextImpl::~NVRenderContextImpl()
- {
- m_StringTable.release();
- QT3DS_ASSERT(m_VertToImpMap.size() == 0);
- m_VertToImpMap.clear();
- QT3DS_ASSERT(m_IndexToImpMap.size() == 0);
- m_IndexToImpMap.clear();
- QT3DS_ASSERT(m_ConstantToImpMap.size() == 0);
- m_ConstantToImpMap.clear();
- QT3DS_ASSERT(m_StorageToImpMap.size() == 0);
- m_StorageToImpMap.clear();
- QT3DS_ASSERT(m_DepthStencilStateToImpMap.size() == 0);
- m_DepthStencilStateToImpMap.clear();
- QT3DS_ASSERT(m_RasterizerStateToImpMap.size() == 0);
- m_RasterizerStateToImpMap.clear();
- QT3DS_ASSERT(m_PathFontSpecToImpMap.size() == 0);
- m_PathFontSpecToImpMap.clear();
- QT3DS_ASSERT(m_Tex2DToImpMap.size() == 0);
- m_Tex2DToImpMap.clear();
- QT3DS_ASSERT(m_Tex2DArrayToImpMap.size() == 0);
- m_Tex2DArrayToImpMap.clear();
- QT3DS_ASSERT(m_Image2DtoImpMap.size() == 0);
- m_Image2DtoImpMap.clear();
- QT3DS_ASSERT(m_ShaderToImpMap.size() == 0);
- m_ShaderToImpMap.clear();
- QT3DS_ASSERT(m_RenderBufferToImpMap.size() == 0);
- m_RenderBufferToImpMap.clear();
- QT3DS_ASSERT(m_FrameBufferToImpMap.size() == 0);
- m_FrameBufferToImpMap.clear();
-
- m_backend = NULL;
- }
-
- void NVRenderContextImpl::getMaxTextureSize(QT3DSU32 &oWidth, QT3DSU32 &oHeight)
- {
- QT3DSI32 theMaxTextureSize = 0;
- m_backend->GetRenderBackendValue(NVRenderBackend::NVRenderBackendQuery::MaxTextureSize,
- &theMaxTextureSize);
-
- oWidth = (QT3DSU32)theMaxTextureSize;
- oHeight = (QT3DSU32)theMaxTextureSize;
- }
-
- NVRenderDepthStencilState *NVRenderContextImpl::CreateDepthStencilState(
- bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc, bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack)
- {
- NVRenderDepthStencilState *state = NVRenderDepthStencilState::Create(
- *this, enableDepth, depthMask, depthFunc, enableStencil, stencilFuncFront,
- stencilFuncBack, depthStencilOpFront, depthStencilOpBack);
- if (state)
- m_DepthStencilStateToImpMap.insert(
- make_pair(state->GetDepthStencilObjectHandle(), state));
-
- return state;
- }
-
- void NVRenderContextImpl::SetDepthStencilState(NVRenderDepthStencilState *inDepthStencilState)
- {
- if (inDepthStencilState) {
- m_backend->SetDepthStencilState(inDepthStencilState->GetDepthStencilObjectHandle());
- // currently we have a mixture therefore we need to update the context state
- SetDepthFunction(inDepthStencilState->GetDepthFunc());
- SetDepthWriteEnabled(inDepthStencilState->GetDepthMask());
- SetDepthTestEnabled(inDepthStencilState->GetDepthEnabled());
- SetStencilTestEnabled(inDepthStencilState->GetStencilEnabled());
- }
- }
-
- void NVRenderContextImpl::StateDestroyed(NVRenderDepthStencilState &state)
- {
- m_DepthStencilStateToImpMap.erase(state.GetDepthStencilObjectHandle());
- }
-
- NVRenderRasterizerState *
- NVRenderContextImpl::CreateRasterizerState(QT3DSF32 depthBias, QT3DSF32 depthScale,
- NVRenderFaces::Enum cullFace)
- {
- NVRenderRasterizerState *state =
- NVRenderRasterizerState::Create(*this, depthBias, depthScale, cullFace);
- if (state)
- m_RasterizerStateToImpMap.insert(make_pair(state->GetRasterizerObjectHandle(), state));
-
- return state;
- }
-
- void NVRenderContextImpl::SetRasterizerState(NVRenderRasterizerState *inRasterizerState)
- {
- if (inRasterizerState)
- m_backend->SetRasterizerState(inRasterizerState->GetRasterizerObjectHandle());
- }
-
- void NVRenderContextImpl::StateDestroyed(NVRenderRasterizerState &state)
- {
- m_RasterizerStateToImpMap.erase(state.GetRasterizerObjectHandle());
- }
-
- NVRenderVertexBuffer *
- NVRenderContextImpl::CreateVertexBuffer(NVRenderBufferUsageType::Enum usageType, size_t size,
- QT3DSU32 stride, NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderVertexBuffer *buffer =
- NVRenderVertexBuffer::Create(*this, usageType, size, stride, bufferData);
- if (buffer)
- m_VertToImpMap.insert(make_pair(buffer->GetImplementationHandle(), buffer));
- return buffer;
- }
-
- NVRenderVertexBuffer *NVRenderContextImpl::GetVertexBuffer(const void *implementationHandle)
- {
- nvhash_map<const void *, NVRenderVertexBuffer *>::const_iterator entry =
- m_VertToImpMap.find(implementationHandle);
- if (entry != m_VertToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::BufferDestroyed(NVRenderVertexBuffer &buffer)
- {
- m_VertToImpMap.erase(buffer.GetImplementationHandle());
- }
-
- NVRenderIndexBuffer *
- NVRenderContextImpl::CreateIndexBuffer(qt3ds::render::NVRenderBufferUsageType::Enum usageType,
- qt3ds::render::NVRenderComponentTypes::Enum componentType,
- size_t size, NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderIndexBuffer *buffer =
- NVRenderIndexBuffer::Create(*this, usageType, componentType, size, bufferData);
-
- if (buffer) {
- m_IndexToImpMap.insert(make_pair(buffer->GetImplementationHandle(), buffer));
- }
-
- return buffer;
- }
-
- NVRenderIndexBuffer *NVRenderContextImpl::GetIndexBuffer(const void *implementationHandle)
- {
- const nvhash_map<const void *, NVRenderIndexBuffer *>::iterator entry =
- m_IndexToImpMap.find(implementationHandle);
- if (entry != m_IndexToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::BufferDestroyed(NVRenderIndexBuffer &buffer)
- {
- m_IndexToImpMap.erase(buffer.GetImplementationHandle());
- }
-
- NVRenderConstantBuffer *
- NVRenderContextImpl::CreateConstantBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType,
- size_t size, NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderConstantBuffer *buffer =
- NVRenderConstantBuffer::Create(*this, bufferName, usageType, size, bufferData);
-
- if (buffer) {
- m_ConstantToImpMap.insert(make_pair(buffer->GetBufferName(), buffer));
- }
-
- return buffer;
- }
-
- NVRenderConstantBuffer *NVRenderContextImpl::GetConstantBuffer(CRegisteredString bufferName)
- {
- TContextConstantBufferMap::iterator entry = m_ConstantToImpMap.find(bufferName);
- if (entry != m_ConstantToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::BufferDestroyed(NVRenderConstantBuffer &buffer)
- {
- m_ConstantToImpMap.erase(buffer.GetBufferName());
- }
-
- QT3DSU32 NVRenderContextImpl::GetNextConstantBufferUnit()
- {
- QT3DSU32 retval = m_NextConstantBufferUnit;
- ++m_NextConstantBufferUnit;
- // Too many texture units for a single draw call.
- if (retval >= m_MaxConstantBufferUnits) {
- QT3DS_ASSERT(false);
- retval = retval % m_MaxConstantBufferUnits;
- }
- return retval;
- }
-
- NVRenderStorageBuffer *NVRenderContextImpl::CreateStorageBuffer(
- const char *bufferName, qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData, NVRenderDataBuffer *pBuffer)
- {
- NVRenderStorageBuffer *buffer =
- NVRenderStorageBuffer::Create(*this, bufferName, usageType, size, bufferData, pBuffer);
-
- if (buffer) {
- m_StorageToImpMap.insert(make_pair(buffer->GetBufferName(), buffer));
- }
-
- return buffer;
- }
-
- NVRenderStorageBuffer *NVRenderContextImpl::GetStorageBuffer(CRegisteredString bufferName)
- {
- TContextStorageBufferMap::iterator entry = m_StorageToImpMap.find(bufferName);
- if (entry != m_StorageToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::BufferDestroyed(NVRenderStorageBuffer &buffer)
- {
- m_StorageToImpMap.erase(buffer.GetBufferName());
- }
-
- NVRenderAtomicCounterBuffer *NVRenderContextImpl::CreateAtomicCounterBuffer(
- const char *bufferName, qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderAtomicCounterBuffer *buffer =
- NVRenderAtomicCounterBuffer::Create(*this, bufferName, usageType, size, bufferData);
-
- if (buffer) {
- m_AtomicCounterToImpMap.insert(make_pair(buffer->GetBufferName(), buffer));
- }
-
- return buffer;
- }
-
- NVRenderAtomicCounterBuffer *
- NVRenderContextImpl::GetAtomicCounterBuffer(CRegisteredString bufferName)
- {
- TContextAtomicCounterBufferMap::iterator entry = m_AtomicCounterToImpMap.find(bufferName);
- if (entry != m_AtomicCounterToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- NVRenderAtomicCounterBuffer *
- NVRenderContextImpl::GetAtomicCounterBufferByParam(CRegisteredString paramName)
- {
- // iterate through all atomic counter buffers
- for (TContextAtomicCounterBufferMap::iterator iter = m_AtomicCounterToImpMap.begin(),
- end = m_AtomicCounterToImpMap.end();
- iter != end; ++iter) {
- if (iter->second && iter->second->ContainsParam(paramName))
- return iter->second;
- }
-
- return NULL;
- }
-
- void NVRenderContextImpl::BufferDestroyed(NVRenderAtomicCounterBuffer &buffer)
- {
- m_AtomicCounterToImpMap.erase(buffer.GetBufferName());
- }
-
- NVRenderDrawIndirectBuffer *NVRenderContextImpl::CreateDrawIndirectBuffer(
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderDrawIndirectBuffer *buffer =
- NVRenderDrawIndirectBuffer::Create(*this, usageType, size, bufferData);
-
- if (buffer) {
- m_DrawIndirectToImpMap.insert(make_pair(buffer->GetBuffertHandle(), buffer));
- }
-
- return buffer;
- }
-
- NVRenderDrawIndirectBuffer *NVRenderContextImpl::GetDrawIndirectBuffer(
- NVRenderBackend::NVRenderBackendBufferObject implementationHandle)
- {
- TContextDrawIndirectBufferMap::iterator entry =
- m_DrawIndirectToImpMap.find(implementationHandle);
- if (entry != m_DrawIndirectToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::BufferDestroyed(NVRenderDrawIndirectBuffer &buffer)
- {
- m_DrawIndirectToImpMap.erase(buffer.GetBuffertHandle());
- }
-
- void NVRenderContextImpl::SetMemoryBarrier(NVRenderBufferBarrierFlags barriers)
- {
- m_backend->SetMemoryBarrier(barriers);
- }
-
- NVRenderOcclusionQuery *NVRenderContextImpl::CreateOcclusionQuery()
- {
- NVRenderOcclusionQuery *theQuery = NVRenderOcclusionQuery::Create(*this);
-
- return theQuery;
- }
-
- NVRenderTimerQuery *NVRenderContextImpl::CreateTimerQuery()
- {
- NVRenderTimerQuery *theQuery = NVRenderTimerQuery::Create(*this);
-
- return theQuery;
- }
-
- NVRenderSync *NVRenderContextImpl::CreateSync()
- {
- NVRenderSync *theSync = NVRenderSync::Create(*this);
-
- return theSync;
- }
-
- NVRenderTexture2D *NVRenderContextImpl::CreateTexture2D()
- {
- NVRenderTexture2D *retval = NVRenderTexture2D::Create(*this);
- if (retval)
- m_Tex2DToImpMap.insert(make_pair(retval->GetImplementationHandle(), retval));
- return retval;
- }
-
- NVRenderTexture2DArray *NVRenderContextImpl::CreateTexture2DArray()
- {
- NVRenderTexture2DArray *retval = NVRenderTexture2DArray::Create(*this);
- if (retval)
- m_Tex2DArrayToImpMap.insert(make_pair(retval->GetTextureObjectHandle(), retval));
-
- return retval;
- }
-
- NVRenderTextureCube *NVRenderContextImpl::CreateTextureCube()
- {
- NVRenderTextureCube *retval = NVRenderTextureCube::Create(*this);
- if (retval)
- m_TexCubeToImpMap.insert(make_pair(retval->GetTextureObjectHandle(), retval));
-
- return retval;
- }
-
- NVRenderTexture2D *NVRenderContextImpl::GetTexture2D(const void *implementationHandle)
- {
- const nvhash_map<const void *, NVRenderTexture2D *>::iterator entry =
- m_Tex2DToImpMap.find(implementationHandle);
- if (entry != m_Tex2DToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::TextureDestroyed(NVRenderTexture2D &buffer)
- {
- m_Tex2DToImpMap.erase(buffer.GetImplementationHandle());
- // We would like to find and catch any situations where this texture is being used
- // but that would require some real work that we don't want to do right now.
- }
-
- void NVRenderContextImpl::TextureDestroyed(NVRenderTexture2DArray &buffer)
- {
- m_Tex2DArrayToImpMap.erase(buffer.GetTextureObjectHandle());
- }
-
- void NVRenderContextImpl::TextureDestroyed(NVRenderTextureCube &buffer)
- {
- m_TexCubeToImpMap.erase(buffer.GetTextureObjectHandle());
- }
-
- NVRenderImage2D *NVRenderContextImpl::CreateImage2D(NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess)
- {
- NVRenderImage2D *retval = NVRenderImage2D::Create(*this, inTexture, inAccess);
- if (retval)
- m_Image2DtoImpMap.insert(make_pair(retval->GetTextureObjectHandle(), retval));
-
- return retval;
- }
-
- void NVRenderContextImpl::ImageDestroyed(NVRenderImage2D &image)
- {
- m_Image2DtoImpMap.erase(image.GetTextureObjectHandle());
- }
-
- // IF this texture isn't on a texture unit, put it on one.
- // If it is on a texture unit, mark it as the most recently used texture.
- QT3DSU32 NVRenderContextImpl::GetNextTextureUnit()
- {
- QT3DSU32 retval = m_NextTextureUnit;
- ++m_NextTextureUnit;
- // Too many texture units for a single draw call.
- if (retval >= m_MaxTextureUnits) {
- QT3DS_ASSERT(false);
- retval = retval % m_MaxTextureUnits;
- }
- return retval;
- }
-
- NVRenderRenderBuffer *
- NVRenderContextImpl::CreateRenderBuffer(NVRenderRenderBufferFormats::Enum bufferFormat,
- QT3DSU32 width, QT3DSU32 height)
- {
- NVRenderRenderBuffer *retval =
- NVRenderRenderBuffer::Create(*this, bufferFormat, width, height);
- if (retval != NULL)
- m_RenderBufferToImpMap.insert(make_pair(retval->GetImplementationHandle(), retval));
- return retval;
- }
-
- NVRenderRenderBuffer *NVRenderContextImpl::GetRenderBuffer(const void *implementationHandle)
- {
- const nvhash_map<const void *, NVRenderRenderBuffer *>::iterator entry =
- m_RenderBufferToImpMap.find(implementationHandle);
- if (entry != m_RenderBufferToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::RenderBufferDestroyed(NVRenderRenderBuffer &buffer)
- {
- m_RenderBufferToImpMap.erase(buffer.GetImplementationHandle());
- }
-
- NVRenderFrameBuffer *NVRenderContextImpl::CreateFrameBuffer()
- {
- NVRenderFrameBuffer *retval = NVRenderFrameBuffer::Create(*this);
- if (retval != NULL)
- m_FrameBufferToImpMap.insert(make_pair(retval->GetImplementationHandle(), retval));
- return retval;
- }
-
- NVRenderFrameBuffer *NVRenderContextImpl::GetFrameBuffer(const void *implementationHandle)
- {
- const nvhash_map<const void *, NVRenderFrameBuffer *>::iterator entry =
- m_FrameBufferToImpMap.find(implementationHandle);
- if (entry != m_FrameBufferToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::FrameBufferDestroyed(NVRenderFrameBuffer &fb)
- {
- m_FrameBufferToImpMap.erase(fb.GetImplementationHandle());
- if (m_HardwarePropertyContext.m_FrameBuffer == &fb)
- m_HardwarePropertyContext.m_FrameBuffer = NULL;
- }
-
- NVRenderAttribLayout *
- NVRenderContextImpl::CreateAttributeLayout(NVConstDataRef<NVRenderVertexBufferEntry> attribs)
- {
- return QT3DS_NEW(GetFoundation().getAllocator(), NVRenderAttribLayout)(*this, attribs);
- }
-
- NVRenderInputAssembler *NVRenderContextImpl::CreateInputAssembler(
- NVRenderAttribLayout *attribLayout, NVConstDataRef<NVRenderVertexBuffer *> buffers,
- const NVRenderIndexBuffer *indexBuffer, NVConstDataRef<QT3DSU32> strides,
- NVConstDataRef<QT3DSU32> offsets, NVRenderDrawMode::Enum primType, QT3DSU32 patchVertexCount)
- {
- return QT3DS_NEW(GetFoundation().getAllocator(),
- NVRenderInputAssembler)(*this, attribLayout, buffers, indexBuffer, strides,
- offsets, primType, patchVertexCount);
- }
-
- void NVRenderContextImpl::SetInputAssembler(NVRenderInputAssembler *inputAssembler)
- {
- if (m_HardwarePropertyContext.m_InputAssembler != inputAssembler) {
- DoSetInputAssembler(inputAssembler);
- }
- }
-
- NVRenderVertFragCompilationResult NVRenderContextImpl::CompileSource(
- const char *shaderName, NVConstDataRef<QT3DSI8> vertShader, NVConstDataRef<QT3DSI8> fragShader,
- NVConstDataRef<QT3DSI8> tessControlShaderSource,
- NVConstDataRef<QT3DSI8> tessEvaluationShaderSource, NVConstDataRef<QT3DSI8> geometryShaderSource,
- bool separateProgram, NVRenderShaderProgramBinaryType::Enum type, bool binaryProgram)
- {
- NVRenderVertFragCompilationResult result = NVRenderShaderProgram::Create(
- *this, shaderName, vertShader, fragShader, tessControlShaderSource,
- tessEvaluationShaderSource, geometryShaderSource, separateProgram, type, binaryProgram);
-
- if (result.mShader != NULL)
- m_ShaderToImpMap.insert(
- make_pair(result.mShader->GetShaderProgramHandle(), result.mShader));
-
- return result;
- }
-
- NVRenderVertFragCompilationResult NVRenderContextImpl::CompileBinary(
- const char *shaderName, NVRenderShaderProgramBinaryType::Enum type,
- NVDataRef<QT3DSI8> vertShader, NVDataRef<QT3DSI8> fragShader,
- NVDataRef<QT3DSI8> tessControlShaderSource, NVDataRef<QT3DSI8> tessEvaluationShaderSource,
- NVConstDataRef<QT3DSI8> geometryShaderSource)
- {
-#ifndef _MACOSX
- NVRenderVertFragCompilationResult result = NVRenderShaderProgram::Create(
- *this, shaderName, vertShader, fragShader, tessControlShaderSource,
- tessEvaluationShaderSource, geometryShaderSource, false, type, true);
-
- if (result.mShader != NULL)
- m_ShaderToImpMap.insert(
- make_pair(result.mShader->GetShaderProgramHandle(), result.mShader));
-
- return result;
-#else
- QT3DS_ASSERT(false);
- return NVRenderVertFragCompilationResult();
-#endif
- }
-
- NVRenderVertFragCompilationResult
- NVRenderContextImpl::CompileComputeSource(const char *shaderName,
- NVConstDataRef<QT3DSI8> computeShaderSource)
- {
- NVRenderVertFragCompilationResult result =
- NVRenderShaderProgram::CreateCompute(*this, shaderName, computeShaderSource);
-
- if (result.mShader != NULL)
- m_ShaderToImpMap.insert(
- make_pair(result.mShader->GetShaderProgramHandle(), result.mShader));
-
- return result;
- }
-
- NVRenderShaderProgram *NVRenderContextImpl::GetShaderProgram(const void *implementationHandle)
- {
- const nvhash_map<const void *, NVRenderShaderProgram *>::iterator entry =
- m_ShaderToImpMap.find(implementationHandle);
- if (entry != m_ShaderToImpMap.end())
- return entry->second;
- return NULL;
- }
-
- void NVRenderContextImpl::ShaderDestroyed(NVRenderShaderProgram &shader)
- {
- m_ShaderToImpMap.erase(shader.GetShaderProgramHandle());
- if (m_HardwarePropertyContext.m_ActiveShader == &shader)
- SetActiveShader(NULL);
- }
-
- NVRenderProgramPipeline *NVRenderContextImpl::CreateProgramPipeline()
- {
- return QT3DS_NEW(GetFoundation().getAllocator(), NVRenderProgramPipeline)(*this,
- GetFoundation());
- }
-
- NVRenderPathSpecification *NVRenderContextImpl::CreatePathSpecification()
- {
- return NVRenderPathSpecification::CreatePathSpecification(*this);
- }
-
- NVRenderPathRender *NVRenderContextImpl::CreatePathRender(size_t range)
- {
- return NVRenderPathRender::Create(*this, range);
- }
-
- void NVRenderContextImpl::SetPathProjectionMatrix(const QT3DSMat44 inPathProjection)
- {
- m_backend->SetPathProjectionMatrix(inPathProjection);
- }
-
- void NVRenderContextImpl::SetPathModelViewMatrix(const QT3DSMat44 inPathModelview)
- {
- m_backend->SetPathModelViewMatrix(inPathModelview);
- }
-
- void NVRenderContextImpl::SetPathStencilDepthOffset(QT3DSF32 inSlope, QT3DSF32 inBias)
- {
- m_backend->SetPathStencilDepthOffset(inSlope, inBias);
- }
- void NVRenderContextImpl::SetPathCoverDepthFunc(NVRenderBoolOp::Enum inFunc)
- {
- m_backend->SetPathCoverDepthFunc(inFunc);
- }
-
- NVRenderPathFontSpecification *
- NVRenderContextImpl::CreatePathFontSpecification(CRegisteredString fontName)
- {
- // first check if it already exists
- nvhash_map<CRegisteredString, NVRenderPathFontSpecification *>::const_iterator entry =
- m_PathFontSpecToImpMap.find(fontName);
- if (entry != m_PathFontSpecToImpMap.end())
- return entry->second;
-
- // if not create new one
- NVRenderPathFontSpecification *pPathFontSpec =
- NVRenderPathFontSpecification::CreatePathFontSpecification(*this, fontName);
-
- if (pPathFontSpec)
- m_PathFontSpecToImpMap.insert(make_pair(fontName, pPathFontSpec));
-
- return pPathFontSpec;
- }
-
- void
- NVRenderContextImpl::ReleasePathFontSpecification(NVRenderPathFontSpecification &inPathSpec)
- {
- m_PathFontSpecToImpMap.erase(inPathSpec.GetFontName());
- }
-
- NVRenderPathFontItem *NVRenderContextImpl::CreatePathFontItem()
- {
- // if not create new one
- return NVRenderPathFontItem::CreatePathFontItem(*this);
- }
-
- void NVRenderContextImpl::SetClearColor(QT3DSVec4 inClearColor)
- {
- if (m_HardwarePropertyContext.m_ClearColor != inClearColor)
- DoSetClearColor(inClearColor);
- }
-
- void NVRenderContextImpl::SetBlendFunction(NVRenderBlendFunctionArgument inFunctions)
- {
- if (memcmp(&inFunctions, &m_HardwarePropertyContext.m_BlendFunction,
- sizeof(NVRenderBlendFunctionArgument))) {
- DoSetBlendFunction(inFunctions);
- }
- }
-
- void NVRenderContextImpl::SetBlendEquation(NVRenderBlendEquationArgument inEquations)
- {
- if (memcmp(&inEquations, &m_HardwarePropertyContext.m_BlendEquation,
- sizeof(NVRenderBlendEquationArgument))) {
- DoSetBlendEquation(inEquations);
- }
- }
-
- void NVRenderContextImpl::SetCullingEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_CullingEnabled) {
- DoSetCullingEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetDepthFunction(qt3ds::render::NVRenderBoolOp::Enum inFunction)
- {
- if (inFunction != m_HardwarePropertyContext.m_DepthFunction) {
- DoSetDepthFunction(inFunction);
- }
- }
-
- void NVRenderContextImpl::SetBlendingEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_BlendingEnabled) {
- DoSetBlendingEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetColorWritesEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_ColorWritesEnabled) {
- DoSetColorWritesEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetDepthWriteEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_DepthWriteEnabled) {
- m_HardwarePropertyContext.m_DepthWriteEnabled = inEnabled;
- m_backend->SetRenderState(inEnabled, NVRenderState::DepthWrite);
- }
- }
-
- void NVRenderContextImpl::SetDepthTestEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_DepthTestEnabled) {
- DoSetDepthTestEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetMultisampleEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_MultisampleEnabled) {
- DoSetMultisampleEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetStencilTestEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_StencilTestEnabled) {
- DoSetStencilTestEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetScissorTestEnabled(bool inEnabled)
- {
- if (inEnabled != m_HardwarePropertyContext.m_ScissorTestEnabled) {
- DoSetScissorTestEnabled(inEnabled);
- }
- }
-
- void NVRenderContextImpl::SetScissorRect(NVRenderRect inRect)
- {
- if (memcmp(&inRect, &m_HardwarePropertyContext.m_ScissorRect, sizeof(NVRenderRect))) {
- DoSetScissorRect(inRect);
- }
- }
-
- void NVRenderContextImpl::SetViewport(NVRenderRect inViewport)
- {
- if (memcmp(&inViewport, &m_HardwarePropertyContext.m_Viewport, sizeof(NVRenderRect))) {
- DoSetViewport(inViewport);
- }
- }
-
- void NVRenderContextImpl::SetActiveShader(NVRenderShaderProgram *inShader)
- {
- if (inShader != m_HardwarePropertyContext.m_ActiveShader)
- DoSetActiveShader(inShader);
- }
-
- void NVRenderContextImpl::SetActiveProgramPipeline(NVRenderProgramPipeline *inProgramPipeline)
- {
- if (inProgramPipeline != m_HardwarePropertyContext.m_ActiveProgramPipeline)
- DoSetActiveProgramPipeline(inProgramPipeline);
- }
-
- void NVRenderContextImpl::DispatchCompute(NVRenderShaderProgram *inShader, QT3DSU32 numGroupsX,
- QT3DSU32 numGroupsY, QT3DSU32 numGroupsZ)
- {
- QT3DS_ASSERT(inShader);
-
- if (inShader != m_HardwarePropertyContext.m_ActiveShader)
- DoSetActiveShader(inShader);
-
- m_backend->DispatchCompute(inShader->GetShaderProgramHandle(), numGroupsX, numGroupsY,
- numGroupsZ);
-
- OnPostDraw();
- }
-
- void NVRenderContextImpl::SetDrawBuffers(NVConstDataRef<QT3DSI32> inDrawBufferSet)
- {
- m_backend->SetDrawBuffers(
- (m_HardwarePropertyContext.m_FrameBuffer)
- ? m_HardwarePropertyContext.m_FrameBuffer->GetFrameBuffertHandle()
- : NULL,
- inDrawBufferSet);
- }
-
- void NVRenderContextImpl::SetReadBuffer(NVReadFaces::Enum inReadFace)
- {
- // currently NULL which means the read target must be set with setReadTarget
- m_backend->SetReadBuffer(NULL, inReadFace);
- }
-
- void NVRenderContextImpl::ReadPixels(NVRenderRect inRect,
- NVRenderReadPixelFormats::Enum inFormat,
- NVDataRef<QT3DSU8> inWriteBuffer)
- {
- // NULL means read from current render target
- m_backend->ReadPixel(NULL, inRect.m_X, inRect.m_Y, inRect.m_Width, inRect.m_Height,
- inFormat, (void *)inWriteBuffer.begin());
- }
-
- void NVRenderContextImpl::SetRenderTarget(NVRenderFrameBuffer *inBuffer)
- {
- if (inBuffer != m_HardwarePropertyContext.m_FrameBuffer) {
- DoSetRenderTarget(inBuffer);
- }
- }
-
- void NVRenderContextImpl::SetReadTarget(NVRenderFrameBuffer *inBuffer)
- {
- if (inBuffer != m_HardwarePropertyContext.m_FrameBuffer) {
- DoSetReadTarget(inBuffer);
- }
- }
-
- void NVRenderContextImpl::ResetBlendState()
- {
- QT3DSI32_4 values;
-
- m_backend->SetRenderState(m_HardwarePropertyContext.m_BlendingEnabled,
- NVRenderState::Blend);
- const NVRenderBlendFunctionArgument &theBlendArg(m_HardwarePropertyContext.m_BlendFunction);
- m_backend->SetBlendFunc(theBlendArg);
- }
-
- // Pop the entire set of properties, potentially forcing the values
- // to opengl.
- void NVRenderContextImpl::PopPropertySet(bool inForceSetProperties)
- {
- if (!m_PropertyStack.empty()) {
- SNVGLHardPropertyContext &theTopContext(m_PropertyStack.back());
- if (inForceSetProperties) {
-#define HANDLE_CONTEXT_HARDWARE_PROPERTY(setterName, propName) \
- DoSet##setterName(theTopContext.m_##propName);
-
- ITERATE_HARDWARE_CONTEXT_PROPERTIES
-
-#undef HANDLE_CONTEXT_HARDWARE_PROPERTY
- } else {
-#define HANDLE_CONTEXT_HARDWARE_PROPERTY(setterName, propName) \
- Set##setterName(theTopContext.m_##propName);
-
- ITERATE_HARDWARE_CONTEXT_PROPERTIES
-
-#undef HANDLE_CONTEXT_HARDWARE_PROPERTY
- }
- m_PropertyStack.pop_back();
- }
- }
-
- void NVRenderContextImpl::Clear(NVRenderClearFlags flags)
- {
- if ((flags & NVRenderClearValues::Depth)
- && m_HardwarePropertyContext.m_DepthWriteEnabled == false) {
- QT3DS_ASSERT(false);
- SetDepthWriteEnabled(true);
- }
- m_backend->Clear(flags);
- }
-
- void NVRenderContextImpl::Clear(NVRenderFrameBuffer &fb, NVRenderClearFlags flags)
- {
- NVRenderFrameBuffer *previous = m_HardwarePropertyContext.m_FrameBuffer;
- if (previous != &fb)
- SetRenderTarget(&fb);
-
- Clear(flags);
-
- if (previous != &fb)
- SetRenderTarget(previous);
- }
-
- void NVRenderContextImpl::BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter)
- {
- m_backend->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, flags,
- filter);
- }
-
- bool
- NVRenderContextImpl::BindShaderToInputAssembler(const NVRenderInputAssembler *inputAssembler,
- NVRenderShaderProgram *shader)
- {
- // setup the input assembler object
- return m_backend->SetInputAssembler(inputAssembler->GetInputAssemblerHandle(),
- shader->GetShaderProgramHandle());
- }
-
- bool NVRenderContextImpl::ApplyPreDrawProperties()
- {
- // Get the currently bound vertex and shader
- NVRenderInputAssembler *inputAssembler = this->m_HardwarePropertyContext.m_InputAssembler;
- NVRenderShaderProgram *shader = this->m_HardwarePropertyContext.m_ActiveShader;
-
- // we could render through a program pipline
- if (shader == NULL && this->m_HardwarePropertyContext.m_ActiveProgramPipeline)
- shader = this->m_HardwarePropertyContext.m_ActiveProgramPipeline->GetVertexStage();
-
- if (inputAssembler == NULL || shader == NULL) {
- qCCritical(INVALID_OPERATION,
- "Attempting to render no valid shader or input assembler setup");
- QT3DS_ASSERT(false);
- return false;
- }
-
- return BindShaderToInputAssembler(inputAssembler, shader);
- }
-
- void NVRenderContextImpl::OnPostDraw()
- {
- // reset input assembler binding
- m_backend->SetInputAssembler(NULL, 0);
- // Texture unit 0 is used for setting up and loading textures.
- // Bugs happen if we load a texture then setup the sampler.
- // Then we load another texture. Because when loading we use texture unit 0,
- // the render bindings for the first texture are blown away.
- // Again, for this reason, texture unit 0 is reserved for loading textures.
- m_NextTextureUnit = 1;
- m_NextConstantBufferUnit = 0;
- }
-
- void NVRenderContextImpl::Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 count, QT3DSU32 offset)
- {
- if (!ApplyPreDrawProperties())
- return;
-
- NVRenderIndexBuffer *theIndexBuffer = const_cast<NVRenderIndexBuffer *>(
- m_HardwarePropertyContext.m_InputAssembler->GetIndexBuffer());
- if (theIndexBuffer == NULL)
- m_backend->Draw(drawMode, offset, count);
- else
- theIndexBuffer->Draw(drawMode, count, offset);
-
- OnPostDraw();
- }
-
- void NVRenderContextImpl::DrawIndirect(NVRenderDrawMode::Enum drawMode, QT3DSU32 offset)
- {
- if (!ApplyPreDrawProperties())
- return;
-
- NVRenderIndexBuffer *theIndexBuffer = const_cast<NVRenderIndexBuffer *>(
- m_HardwarePropertyContext.m_InputAssembler->GetIndexBuffer());
- if (theIndexBuffer == NULL)
- m_backend->DrawIndirect(drawMode, (const void *)offset);
- else
- theIndexBuffer->DrawIndirect(drawMode, offset);
-
- OnPostDraw();
- }
-
- QT3DSMat44
- NVRenderContext::ApplyVirtualViewportToProjectionMatrix(const QT3DSMat44 &inProjection,
- const NVRenderRectF &inViewport,
- const NVRenderRectF &inVirtualViewport)
- {
- if (inVirtualViewport == inViewport)
- return inProjection;
- // Run conversion to floating point once.
- NVRenderRectF theVirtualViewport(inVirtualViewport);
- NVRenderRectF theViewport(inViewport);
- if (theVirtualViewport.m_Width == 0 || theVirtualViewport.m_Height == 0
- || theViewport.m_Width == 0 || theViewport.m_Height == 0) {
- QT3DS_ASSERT(false);
- return inProjection;
- }
- QT3DSMat44 theScaleTransMat(QT3DSMat44::createIdentity());
- QT3DSF32 theHeightDiff = theViewport.m_Height - theVirtualViewport.m_Height;
- QT3DSF32 theViewportOffY = theVirtualViewport.m_Y - theViewport.m_Y;
- QT3DSVec2 theCameraOffsets = QT3DSVec2(theVirtualViewport.m_Width - theViewport.m_Width
- + (theVirtualViewport.m_X - theViewport.m_X) * 2.0f,
- theHeightDiff + (theViewportOffY - theHeightDiff) * 2.0f);
- QT3DSVec2 theCameraScale = QT3DSVec2(theVirtualViewport.m_Width / theViewport.m_Width,
- theVirtualViewport.m_Height / theViewport.m_Height);
-
- QT3DSVec3 theTranslation(theCameraOffsets.x / theViewport.m_Width,
- theCameraOffsets.y / theViewport.m_Height, 0);
- theScaleTransMat.column3[0] = theTranslation.x;
- theScaleTransMat.column3[1] = theTranslation.y;
- theScaleTransMat.column0[0] = theCameraScale.x;
- theScaleTransMat.column1[1] = theCameraScale.y;
-
- return theScaleTransMat * inProjection;
- }
-
- NVRenderVertFragCompilationResult NVRenderContext::CompileSource(
- const char *shaderName, const char *vertShader, QT3DSU32 inVertLen, const char *fragShader,
- QT3DSU32 inFragLen, const char *tessControlShaderSource, QT3DSU32 inTCLen,
- const char *tessEvaluationShaderSource, QT3DSU32 inTELen, const char *geometryShaderSource,
- QT3DSU32 inGSLen, bool separableProgram)
- {
- return CompileSource(
- shaderName, NVConstDataRef<QT3DSI8>((const QT3DSI8 *)vertShader, inVertLen),
- NVConstDataRef<QT3DSI8>((const QT3DSI8 *)fragShader, inFragLen),
- NVConstDataRef<QT3DSI8>((const QT3DSI8 *)tessControlShaderSource, inTCLen),
- NVConstDataRef<QT3DSI8>((const QT3DSI8 *)tessEvaluationShaderSource, inTELen),
- NVConstDataRef<QT3DSI8>((const QT3DSI8 *)geometryShaderSource, inGSLen), separableProgram);
- }
-
- void NVRenderContextImpl::DoSetActiveShader(NVRenderShaderProgram *inShader)
- {
- m_HardwarePropertyContext.m_ActiveShader = NULL;
- if (inShader)
- m_backend->SetActiveProgram(inShader->GetShaderProgramHandle());
- else {
- m_backend->SetActiveProgram(NULL);
- }
- m_HardwarePropertyContext.m_ActiveShader = inShader;
- }
-
- void NVRenderContextImpl::DoSetActiveProgramPipeline(NVRenderProgramPipeline *inProgramPipeline)
- {
- if (inProgramPipeline) {
- // invalid any bound shader
- DoSetActiveShader(NULL);
- inProgramPipeline->Bind();
- } else
- m_backend->SetActiveProgramPipeline(NULL);
-
- m_HardwarePropertyContext.m_ActiveProgramPipeline = inProgramPipeline;
- }
-
- NVRenderContext &NVRenderContext::CreateNULL(NVFoundationBase &foundation,
- IStringTable &inStringTable)
- {
- NVRenderContext *retval = NULL;
-
- // create backend
- NVScopedRefCounted<IStringTable> theStringTable(inStringTable);
- NVScopedRefCounted<NVRenderBackend> theBackend =
- NVRenderBackendNULL::CreateBackend(foundation);
- retval = QT3DS_NEW(foundation.getAllocator(), NVRenderContextImpl)(foundation, *theBackend,
- *theStringTable);
- return *retval;
- }
-}
-} // end namespace
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.h
deleted file mode 100644
index dfaf1bb9..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderContext.h
+++ /dev/null
@@ -1,1075 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CONTEXT_H
-#define QT3DS_RENDER_CONTEXT_H
-#include "foundation/Qt3DS.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include "render/glg/Qt3DSGLImplObjects.h"
-#include "render/backends/gl/Q3DSRenderBackendGLES2.h"
-#include "render/backends/gl/Qt3DSRenderBackendGL3.h"
-#include "render/backends/gl/Qt3DSRenderBackendGL4.h"
-#include "render/backends/software/Qt3DSRenderBackendNULL.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "render/Qt3DSRenderConstantBuffer.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "render/Qt3DSRenderDepthStencilState.h"
-#include "render/Qt3DSRenderRasterizerState.h"
-#include "render/Qt3DSRenderDrawable.h"
-#include "render/Qt3DSRenderInputAssembler.h"
-#include "render/Qt3DSRenderAttribLayout.h"
-#include "render/Qt3DSRenderImageTexture.h"
-#include "render/Qt3DSRenderOcclusionQuery.h"
-#include "render/Qt3DSRenderTimerQuery.h"
-#include "render/Qt3DSRenderSync.h"
-#include "render/Qt3DSRenderTexture2DArray.h"
-#include "render/Qt3DSRenderTextureCube.h"
-#include "render/Qt3DSRenderStorageBuffer.h"
-#include "render/Qt3DSRenderAtomicCounterBuffer.h"
-#include "render/Qt3DSRenderDrawIndirectBuffer.h"
-#include "render/Qt3DSRenderProgramPipeline.h"
-#include "render/Qt3DSRenderPathRender.h"
-#include "render/Qt3DSRenderPathSpecification.h"
-#include "render/Qt3DSRenderPathFontSpecification.h"
-#include "render/Qt3DSRenderPathFontText.h"
-
-#include <QSurfaceFormat>
-
-// When SW fallback is defined we can support (some) object/layer advanced blend modes. If defined,
-// the HW implementation is still preperred if available through extensions. SW fallback can't be
-// used in custom shaders.
-#define ADVANCED_BLEND_SW_FALLBACK
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- struct NVRenderShaderProgramBinaryType
- {
- enum Enum {
- Unknown = 0,
- NVBinary = 1,
- };
- };
-
- // context dirty flags
- struct NVRenderContextDirtyValues
- {
- enum Enum {
- InputAssembler = 1 << 0,
- };
- };
-
- typedef NVFlags<NVRenderContextDirtyValues::Enum, QT3DSU32> NVRenderContextDirtyFlags;
- typedef nvhash_map<CRegisteredString, NVRenderConstantBuffer *> TContextConstantBufferMap;
- typedef nvhash_map<CRegisteredString, NVRenderStorageBuffer *> TContextStorageBufferMap;
- typedef nvhash_map<CRegisteredString, NVRenderAtomicCounterBuffer *>
- TContextAtomicCounterBufferMap;
- typedef nvhash_map<NVRenderBackend::NVRenderBackendBufferObject, NVRenderDrawIndirectBuffer *>
- TContextDrawIndirectBufferMap;
- typedef nvhash_map<NVRenderBackend::NVRenderBackendDepthStencilStateObject,
- NVRenderDepthStencilState *>
- TContextDepthStencilStateMap;
- typedef nvhash_map<NVRenderBackend::NVRenderBackendRasterizerStateObject,
- NVRenderRasterizerState *>
- TContextRasterizerStateMap;
- typedef nvhash_map<NVRenderBackend::NVRenderBackendTextureObject, NVRenderTexture2DArray *>
- TContextTex2DArrayToImpMap;
- typedef nvhash_map<NVRenderBackend::NVRenderBackendTextureObject, NVRenderTextureCube *>
- TContextTexCubeToImpMap;
- typedef nvhash_map<NVRenderBackend::NVRenderBackendTextureObject, NVRenderImage2D *>
- TContextImage2DToImpMap;
- typedef nvhash_map<CRegisteredString, NVRenderPathFontSpecification *>
- TContextPathFontSpecificationMap;
-
- class QT3DS_AUTOTEST_EXPORT NVRenderContext : public NVRefCounted, public NVRenderDrawable
- {
- public:
- virtual NVRenderContextType GetRenderContextType() const = 0;
- virtual bool AreMultisampleTexturesSupported() const = 0;
- virtual bool GetConstantBufferSupport() const = 0;
- virtual void getMaxTextureSize(QT3DSU32 &oWidth, QT3DSU32 &oHeight) = 0;
- virtual const char *GetShadingLanguageVersion() = 0;
- // Get the bit depth of the currently bound depth buffer.
- virtual QT3DSU32 GetDepthBits() const = 0;
- virtual QT3DSU32 GetStencilBits() const = 0;
- virtual bool
- GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::Enum inCap) const = 0;
- virtual bool AreDXTImagesSupported() const = 0;
- virtual bool IsDepthStencilSupported() const = 0;
- virtual bool IsFpRenderTargetSupported() const = 0;
- virtual bool IsTessellationSupported() const = 0;
- virtual bool IsGeometryStageSupported() const = 0;
- virtual bool IsComputeSupported() const = 0;
- virtual bool IsSampleQuerySupported() const = 0;
- virtual bool IsTimerQuerySupported() const = 0;
- virtual bool IsCommandSyncSupported() const = 0;
- virtual bool IsTextureArraySupported() const = 0;
- virtual bool IsStorageBufferSupported() const = 0;
- virtual bool IsAtomicCounterBufferSupported() const = 0;
- virtual bool IsShaderImageLoadStoreSupported() const = 0;
- virtual bool IsProgramPipelineSupported() const = 0;
- virtual bool IsPathRenderingSupported() const = 0;
- virtual bool IsBlendCoherencySupported() const = 0;
- virtual bool IsAdvancedBlendHwSupported() const = 0;
- virtual bool IsAdvancedBlendHwSupportedKHR() const = 0;
- virtual bool IsStandardDerivativesSupported() const = 0;
- virtual bool IsTextureLodSupported() const = 0;
- virtual bool isSceneCameraView() const = 0;
-
- virtual void SetDefaultRenderTarget(QT3DSU64 targetID) = 0;
- virtual void SetDefaultDepthBufferBitCount(QT3DSI32 depthBits) = 0;
- virtual void setIsSceneCameraView(bool sceneCameraView) = 0;
-
- virtual NVRenderDepthStencilState *
- CreateDepthStencilState(bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc,
- bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack) = 0;
-
- virtual NVRenderRasterizerState *CreateRasterizerState(QT3DSF32 depthBias, QT3DSF32 depthScale,
- NVRenderFaces::Enum cullFace) = 0;
-
- virtual NVRenderVertexBuffer *
- CreateVertexBuffer(NVRenderBufferUsageType::Enum usageType, size_t size, QT3DSU32 stride = 0,
- NVConstDataRef<QT3DSU8> bufferData = NVConstDataRef<QT3DSU8>()) = 0;
- virtual NVRenderVertexBuffer *GetVertexBuffer(const void *implementationHandle) = 0;
-
- virtual NVRenderIndexBuffer *
- CreateIndexBuffer(NVRenderBufferUsageType::Enum usageType,
- NVRenderComponentTypes::Enum componentType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData = NVConstDataRef<QT3DSU8>()) = 0;
- virtual NVRenderIndexBuffer *GetIndexBuffer(const void *implementationHandle) = 0;
-
- virtual NVRenderConstantBuffer *
- CreateConstantBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) = 0;
- virtual NVRenderConstantBuffer *GetConstantBuffer(CRegisteredString bufferName) = 0;
-
- virtual NVRenderStorageBuffer *
- CreateStorageBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData, NVRenderDataBuffer *pBuffer) = 0;
- virtual NVRenderStorageBuffer *GetStorageBuffer(CRegisteredString bufferName) = 0;
-
- virtual NVRenderAtomicCounterBuffer *
- CreateAtomicCounterBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) = 0;
- virtual NVRenderAtomicCounterBuffer *
- GetAtomicCounterBuffer(CRegisteredString bufferName) = 0;
- virtual NVRenderAtomicCounterBuffer *
- GetAtomicCounterBufferByParam(CRegisteredString paramName) = 0;
-
- virtual NVRenderDrawIndirectBuffer *
- CreateDrawIndirectBuffer(qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) = 0;
- virtual NVRenderDrawIndirectBuffer *GetDrawIndirectBuffer(
- NVRenderBackend::NVRenderBackendBufferObject implementationHandle) = 0;
-
- virtual void SetMemoryBarrier(NVRenderBufferBarrierFlags barriers) = 0;
-
- virtual NVRenderOcclusionQuery *CreateOcclusionQuery() = 0;
- virtual NVRenderTimerQuery *CreateTimerQuery() = 0;
- virtual NVRenderSync *CreateSync() = 0;
-
- virtual NVRenderTexture2D *CreateTexture2D() = 0;
- virtual NVRenderTexture2D *GetTexture2D(const void *implementationHandle) = 0;
- virtual NVRenderBackend *GetBackend() = 0;
-
- virtual NVRenderTexture2DArray *CreateTexture2DArray() = 0;
-
- virtual NVRenderTextureCube *CreateTextureCube() = 0;
-
- virtual NVRenderImage2D *CreateImage2D(NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess) = 0;
-
- virtual NVRenderRenderBuffer *
- CreateRenderBuffer(NVRenderRenderBufferFormats::Enum bufferFormat, QT3DSU32 width,
- QT3DSU32 height) = 0;
- virtual NVRenderRenderBuffer *GetRenderBuffer(const void *implementationHandle) = 0;
- // Create a new frame buffer and set the current render target to that frame buffer.
- virtual NVRenderFrameBuffer *CreateFrameBuffer() = 0;
- virtual NVRenderFrameBuffer *GetFrameBuffer(const void *implementationHandle) = 0;
-
- virtual NVRenderAttribLayout *
- CreateAttributeLayout(NVConstDataRef<NVRenderVertexBufferEntry> attribs) = 0;
-
- virtual NVRenderInputAssembler *
- CreateInputAssembler(NVRenderAttribLayout *attribLayout,
- NVConstDataRef<NVRenderVertexBuffer *> buffers,
- const NVRenderIndexBuffer *indexBuffer, NVConstDataRef<QT3DSU32> strides,
- NVConstDataRef<QT3DSU32> offsets,
- NVRenderDrawMode::Enum primType = NVRenderDrawMode::Triangles,
- QT3DSU32 patchVertexCount = 1) = 0;
- virtual void SetInputAssembler(NVRenderInputAssembler *inputAssembler) = 0;
-
- virtual NVRenderVertFragCompilationResult CompileSource(
- const char *shaderName, NVConstDataRef<QT3DSI8> vertShader,
- NVConstDataRef<QT3DSI8> fragShader,
- NVConstDataRef<QT3DSI8> tessControlShaderSource = NVConstDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> tessEvaluationShaderSource = NVConstDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> geometryShaderSource = NVConstDataRef<QT3DSI8>(),
- bool separateProgram = false,
- NVRenderShaderProgramBinaryType::Enum type = NVRenderShaderProgramBinaryType::Unknown,
- bool binaryProgram = false) = 0;
-
- // You must figure out inVertLen and inFragLen yourself, this object doesn't do that.
- NVRenderVertFragCompilationResult
- CompileSource(const char *shaderName, const char *vertShader, QT3DSU32 inVertLen,
- const char *fragShader, QT3DSU32 inFragLen, const char * = NULL,
- QT3DSU32 inTCLen = 0, const char *tessEvaluationShaderSource = NULL,
- QT3DSU32 inTELen = 0, const char *geometryShaderSource = NULL, QT3DSU32 inGSLen = 0,
- bool separableProgram = false);
-
- virtual NVRenderVertFragCompilationResult
- CompileBinary(const char *shaderName, NVRenderShaderProgramBinaryType::Enum type,
- NVDataRef<QT3DSI8> vertShader, NVDataRef<QT3DSI8> fragShader,
- NVDataRef<QT3DSI8> tessControlShaderSource = NVDataRef<QT3DSI8>(),
- NVDataRef<QT3DSI8> tessEvaluationShaderSource = NVDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> geometryShaderSource = NVConstDataRef<QT3DSI8>()) = 0;
-
- virtual NVRenderVertFragCompilationResult
- CompileComputeSource(const char *shaderName, NVConstDataRef<QT3DSI8> computeShaderSource) = 0;
-
- virtual NVRenderShaderProgram *GetShaderProgram(const void *implementationHandle) = 0;
-
- virtual NVRenderProgramPipeline *CreateProgramPipeline() = 0;
-
- virtual NVRenderPathSpecification *CreatePathSpecification() = 0;
- virtual NVRenderPathRender *CreatePathRender(size_t range = 1) = 0;
- virtual void SetPathProjectionMatrix(const QT3DSMat44 inPathProjection) = 0;
- virtual void SetPathModelViewMatrix(const QT3DSMat44 inPathModelview) = 0;
- virtual void SetPathStencilDepthOffset(QT3DSF32 inSlope, QT3DSF32 inBias) = 0;
- virtual void SetPathCoverDepthFunc(NVRenderBoolOp::Enum inFunc) = 0;
-
- virtual NVRenderPathFontSpecification *
- CreatePathFontSpecification(CRegisteredString fontName) = 0;
- virtual NVRenderPathFontItem *CreatePathFontItem() = 0;
-
- // Specific setters for the guaranteed-to-exist context properties to set them as fast as
- // possible.
- // Note that this bypasses the property manage so push/pop will have no effect (unless you
- // set these already
- // once after a push using the property manager.
- virtual void SetClearColor(QT3DSVec4 inClearColor) = 0;
- virtual QT3DSVec4 GetClearColor() const = 0;
-
- virtual void SetBlendFunction(NVRenderBlendFunctionArgument inFunctions) = 0;
- virtual NVRenderBlendFunctionArgument GetBlendFunction() const = 0;
-
- virtual void SetBlendEquation(NVRenderBlendEquationArgument inEquations) = 0;
- virtual NVRenderBlendEquationArgument GetBlendEquation() const = 0;
-
- virtual void SetCullingEnabled(bool inEnabled) = 0;
- virtual bool IsCullingEnabled() const = 0;
-
- virtual void SetDepthFunction(NVRenderBoolOp::Enum inFunction) = 0;
- virtual qt3ds::render::NVRenderBoolOp::Enum GetDepthFunction() const = 0;
-
- virtual void SetBlendingEnabled(bool inEnabled) = 0;
- virtual bool IsBlendingEnabled() const = 0;
-
- virtual void SetDepthWriteEnabled(bool inEnabled) = 0;
- virtual bool IsDepthWriteEnabled() const = 0;
-
- virtual void SetDepthTestEnabled(bool inEnabled) = 0;
- virtual bool IsDepthTestEnabled() const = 0;
-
- virtual void SetDepthStencilState(NVRenderDepthStencilState *inDepthStencilState) = 0;
- virtual void SetStencilTestEnabled(bool inEnabled) = 0;
- virtual bool IsStencilTestEnabled() const = 0;
-
- virtual void SetRasterizerState(NVRenderRasterizerState *inRasterizerState) = 0;
-
- virtual void SetScissorTestEnabled(bool inEnabled) = 0;
- virtual bool IsScissorTestEnabled() const = 0;
-
- virtual void SetScissorRect(NVRenderRect inRect) = 0;
- virtual NVRenderRect GetScissorRect() const = 0;
-
- virtual void SetViewport(NVRenderRect inViewport) = 0;
- virtual NVRenderRect GetViewport() const = 0;
-
- virtual void SetColorWritesEnabled(bool inEnabled) = 0;
- virtual bool IsColorWritesEnabled() const = 0;
-
- virtual void SetMultisampleEnabled(bool inEnabled) = 0;
- virtual bool IsMultisampleEnabled() const = 0;
-
- // Used during layer rendering because we can't set the *actual* viewport to what it should
- // be due to hardware problems.
- // Set during begin render.
- static QT3DSMat44
- ApplyVirtualViewportToProjectionMatrix(const QT3DSMat44 &inProjection,
- const NVRenderRectF &inViewport,
- const NVRenderRectF &inVirtualViewport);
-
- virtual void SetRenderTarget(NVRenderFrameBuffer *inBuffer) = 0;
- virtual void SetReadTarget(NVRenderFrameBuffer *inBuffer) = 0;
- virtual NVRenderFrameBuffer *GetRenderTarget() const = 0;
-
- virtual void SetActiveShader(NVRenderShaderProgram *inShader) = 0;
- virtual NVRenderShaderProgram *GetActiveShader() const = 0;
-
- virtual void SetActiveProgramPipeline(NVRenderProgramPipeline *inProgramPipeline) = 0;
- virtual NVRenderProgramPipeline *GetActiveProgramPipeline() const = 0;
-
- virtual void DispatchCompute(NVRenderShaderProgram *inShader, QT3DSU32 numGroupsX,
- QT3DSU32 numGroupsY, QT3DSU32 numGroupsZ) = 0;
-
- // Push the entire set of properties.
- virtual void PushPropertySet() = 0;
- // Pop the entire set of properties, potentially forcing the values
- // to opengl. Will set the hardware state to whatever at the time of push.
- virtual void PopPropertySet(bool inForceSetProperties) = 0;
-
- // Ensure the hardware state matches the state we expect.
- virtual void ResetBlendState() = 0;
-
- // Draw buffers are what the system will render to.. Applies to the current render context.
- //-1 means none, else the integer is assumed to be an index past the draw buffer index.
- // This applies only to the currently bound framebuffer.
- virtual void SetDrawBuffers(NVConstDataRef<QT3DSI32> inDrawBufferSet) = 0;
- virtual void SetReadBuffer(NVReadFaces::Enum inReadFace) = 0;
-
- virtual void ReadPixels(NVRenderRect inRect, NVRenderReadPixelFormats::Enum inFormat,
- NVDataRef<QT3DSU8> inWriteBuffer) = 0;
-
- // Return the property manager for this render context
- // virtual NVRenderPropertyManager& GetPropertyManager() = 0;
- // Clear the current render target
- virtual void Clear(NVRenderClearFlags flags) = 0;
- // Clear this framebuffer without changing the active frame buffer
- virtual void Clear(NVRenderFrameBuffer &framebuffer, NVRenderClearFlags flags) = 0;
- // copy framebuffer content between read target and render target
- virtual void BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter) = 0;
-
- // Render, applying these immediate property values just before render. The hardware
- // properties are tracked for push/pop
- // but the shader properties are just set on the active shader *after* the hardware
- // properties have been set. The shader properties are not tracked for push/pop.
- // This call is meant to come directly before each draw call to setup the last bit of state
- // before the draw operation. Note that there isn't another way to set the immedate
- // property values for a given shader because it isn't clear which shader is active
- // when the properties are getting set.
- void Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 count, QT3DSU32 offset) override = 0;
-
- /**
- * @brief Draw the current active vertex buffer using an indirect buffer
- * This means the setup of the draw call is stored in a buffer bound to
- * NVRenderBufferBindValues::Draw_Indirect
- *
- * @param[in] drawMode Draw mode (Triangles, ....)
- * @param[in] indirect Offset into a indirect drawing setup buffer
- *
- * @return no return.
- */
- virtual void DrawIndirect(NVRenderDrawMode::Enum drawMode, QT3DSU32 offset) = 0;
-
- virtual NVFoundationBase &GetFoundation() = 0;
- virtual qt3ds::foundation::IStringTable &GetStringTable() = 0;
- virtual NVAllocatorCallback &GetAllocator() = 0;
-
- virtual QSurfaceFormat format() const = 0;
-
- virtual void resetStates() = 0;
-
- static NVRenderContext &CreateGL(NVFoundationBase &foundation, IStringTable &inStringTable,
- const QSurfaceFormat &format);
-
- static NVRenderContext &CreateNULL(NVFoundationBase &foundation,
- IStringTable &inStringTable);
- };
-
- // Now for scoped property access.
- template <typename TDataType>
- struct NVRenderContextScopedProperty
- : public NVRenderGenericScopedProperty<NVRenderContext, TDataType>
- {
- typedef typename NVRenderGenericScopedProperty<NVRenderContext, TDataType>::TGetter TGetter;
- typedef typename NVRenderGenericScopedProperty<NVRenderContext, TDataType>::TSetter TSetter;
- NVRenderContextScopedProperty(NVRenderContext &ctx, TGetter getter, TSetter setter)
- : NVRenderGenericScopedProperty<NVRenderContext, TDataType>(ctx, getter, setter)
- {
- }
- NVRenderContextScopedProperty(NVRenderContext &ctx, TGetter getter, TSetter setter,
- const TDataType &inNewValue)
- : NVRenderGenericScopedProperty<NVRenderContext, TDataType>(ctx, getter, setter,
- inNewValue)
- {
- }
- };
-
-/**
- * A Render Context implementation class
- *
- */
-
-#define ITERATE_HARDWARE_CONTEXT_PROPERTIES \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(RenderTarget, FrameBuffer) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(ActiveShader, ActiveShader) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(ActiveProgramPipeline, ActiveProgramPipeline) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(InputAssembler, InputAssembler) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(BlendFunction, BlendFunction) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(CullingEnabled, CullingEnabled) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(DepthFunction, DepthFunction) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(BlendingEnabled, BlendingEnabled) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(DepthWriteEnabled, DepthWriteEnabled) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(DepthTestEnabled, DepthTestEnabled) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(StencilTestEnabled, StencilTestEnabled) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(ScissorTestEnabled, ScissorTestEnabled) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(ScissorRect, ScissorRect) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(Viewport, Viewport) \
- HANDLE_CONTEXT_HARDWARE_PROPERTY(ClearColor, ClearColor)
-
- // forward declarations
-
- class NVRenderContextImpl : public NVRenderContext, public NoCopy
- {
- public:
- // these variables represent the current hardware state of the render context.
- SNVGLHardPropertyContext m_HardwarePropertyContext;
-
- private:
- NVScopedRefCounted<NVRenderBackend> m_backend; ///< pointer to our render backend
- NVRenderContextDirtyFlags m_DirtyFlags; ///< context dirty flags
-
- NVRenderBackend::NVRenderBackendRenderTargetObject
- m_DefaultOffscreenRenderTarget; ///< this is a special target set from outside if we
- ///never render to a window directly (GL only)
- QT3DSI32 m_DephBits; ///< this is the depth bits count of the default window render target
- QT3DSI32 m_StencilBits; ///< this is the stencil bits count of the default window render target
- bool m_isSceneCameraView = true; ///< true in viewer and in editor when in scene camera view mode
-
- protected:
- volatile QT3DSI32 mRefCount;
- NVFoundationBase &m_Foundation;
- qt3ds::foundation::IStringTable &m_StringTable;
-
- nvhash_map<const void *, NVRenderVertexBuffer *> m_VertToImpMap;
- nvhash_map<const void *, NVRenderIndexBuffer *> m_IndexToImpMap;
- TContextConstantBufferMap m_ConstantToImpMap;
- TContextStorageBufferMap m_StorageToImpMap;
- TContextAtomicCounterBufferMap m_AtomicCounterToImpMap;
- TContextDrawIndirectBufferMap m_DrawIndirectToImpMap;
- TContextDepthStencilStateMap m_DepthStencilStateToImpMap;
- TContextRasterizerStateMap m_RasterizerStateToImpMap;
- TContextPathFontSpecificationMap m_PathFontSpecToImpMap;
-
- nvhash_map<const void *, NVRenderTexture2D *> m_Tex2DToImpMap;
- TContextTex2DArrayToImpMap m_Tex2DArrayToImpMap;
- TContextTexCubeToImpMap m_TexCubeToImpMap;
- TContextImage2DToImpMap m_Image2DtoImpMap;
- nvhash_map<const void *, NVRenderShaderProgram *> m_ShaderToImpMap;
- nvhash_map<const void *, NVRenderRenderBuffer *> m_RenderBufferToImpMap;
- nvhash_map<const void *, NVRenderFrameBuffer *> m_FrameBufferToImpMap;
- QT3DSU32 m_MaxTextureUnits;
- QT3DSU32 m_NextTextureUnit;
- QT3DSU32 m_MaxConstantBufferUnits;
- QT3DSU32 m_NextConstantBufferUnit;
-
- nvvector<SNVGLHardPropertyContext> m_PropertyStack;
-
- void DoSetClearColor(QT3DSVec4 inClearColor)
- {
- m_HardwarePropertyContext.m_ClearColor = inClearColor;
- m_backend->SetClearColor(&inClearColor);
- }
-
- void DoSetBlendFunction(NVRenderBlendFunctionArgument inFunctions)
- {
- QT3DSI32_4 values;
- m_HardwarePropertyContext.m_BlendFunction = inFunctions;
-
- m_backend->SetBlendFunc(inFunctions);
- }
-
- void DoSetBlendEquation(NVRenderBlendEquationArgument inEquations)
- {
- QT3DSI32_4 values;
- m_HardwarePropertyContext.m_BlendEquation = inEquations;
-
- m_backend->SetBlendEquation(inEquations);
- }
-
- void DoSetCullingEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_CullingEnabled = inEnabled;
- m_backend->SetRenderState(inEnabled, NVRenderState::CullFace);
- }
-
- void DoSetDepthFunction(qt3ds::render::NVRenderBoolOp::Enum inFunction)
- {
- m_HardwarePropertyContext.m_DepthFunction = inFunction;
- m_backend->SetDepthFunc(inFunction);
- }
-
- void DoSetBlendingEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_BlendingEnabled = inEnabled;
- m_backend->SetRenderState(inEnabled, NVRenderState::Blend);
- }
-
- void DoSetColorWritesEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_ColorWritesEnabled = inEnabled;
- m_backend->SetColorWrites(inEnabled, inEnabled, inEnabled, inEnabled);
- }
-
- void DoSetMultisampleEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_MultisampleEnabled = inEnabled;
- m_backend->SetMultisample(inEnabled);
- }
-
- void DoSetDepthWriteEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_DepthWriteEnabled = inEnabled;
- m_backend->SetDepthWrite(inEnabled);
- }
-
- void DoSetDepthTestEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_DepthTestEnabled = inEnabled;
- m_backend->SetRenderState(inEnabled, NVRenderState::DepthTest);
- }
-
- void DoSetStencilTestEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_StencilTestEnabled = inEnabled;
- m_backend->SetRenderState(inEnabled, NVRenderState::StencilTest);
- }
-
- void DoSetScissorTestEnabled(bool inEnabled)
- {
- m_HardwarePropertyContext.m_ScissorTestEnabled = inEnabled;
- m_backend->SetRenderState(inEnabled, NVRenderState::ScissorTest);
- }
-
- void DoSetScissorRect(NVRenderRect inRect)
- {
- m_HardwarePropertyContext.m_ScissorRect = inRect;
- m_backend->SetScissorRect(inRect);
- }
-
- void DoSetViewport(NVRenderRect inViewport)
- {
- m_HardwarePropertyContext.m_Viewport = inViewport;
- m_backend->SetViewportRect(inViewport);
- }
-
- // Circular dependencies between shader constants and shader programs preclude
- // implementation in header
- void DoSetActiveShader(NVRenderShaderProgram *inShader);
- void DoSetActiveProgramPipeline(NVRenderProgramPipeline *inProgramPipeline);
-
- void DoSetInputAssembler(NVRenderInputAssembler *inAssembler)
- {
- m_HardwarePropertyContext.m_InputAssembler = inAssembler;
- m_DirtyFlags |= NVRenderContextDirtyValues::InputAssembler;
- }
-
- void DoSetRenderTarget(NVRenderFrameBuffer *inBuffer)
- {
- if (inBuffer)
- m_backend->SetRenderTarget(inBuffer->GetFrameBuffertHandle());
- else
- m_backend->SetRenderTarget(m_DefaultOffscreenRenderTarget);
-
- m_HardwarePropertyContext.m_FrameBuffer = inBuffer;
- }
-
- void DoSetReadTarget(NVRenderFrameBuffer *inBuffer)
- {
- if (inBuffer)
- m_backend->SetReadTarget(inBuffer->GetFrameBuffertHandle());
- else
- m_backend->SetReadTarget(NVRenderBackend::NVRenderBackendRenderTargetObject(NULL));
- }
-
- bool BindShaderToInputAssembler(const NVRenderInputAssembler *inputAssembler,
- NVRenderShaderProgram *shader);
- bool ApplyPreDrawProperties();
- void OnPostDraw();
-
- public:
- NVRenderContextImpl(NVFoundationBase &fnd, NVRenderBackend &inBackend,
- IStringTable &inStrTable);
- virtual ~NVRenderContextImpl();
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation);
-
- NVRenderBackend *GetBackend() override { return m_backend; }
-
- void getMaxTextureSize(QT3DSU32 &oWidth, QT3DSU32 &oHeight) override;
-
- const char *GetShadingLanguageVersion() override
- {
- return m_backend->GetShadingLanguageVersion();
- }
-
- NVRenderContextType GetRenderContextType() const override
- {
- return m_backend->GetRenderContextType();
- }
-
- QT3DSU32 GetDepthBits() const override
- {
- // only query this if a framebuffer is bound
- if (m_HardwarePropertyContext.m_FrameBuffer)
- return m_backend->GetDepthBits();
- else
- return m_DephBits;
- }
-
- QT3DSU32 GetStencilBits() const override
- {
- // only query this if a framebuffer is bound
- if (m_HardwarePropertyContext.m_FrameBuffer)
- return m_backend->GetStencilBits();
- else
- return m_StencilBits;
- }
-
- bool GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::Enum inCap) const override
- {
- return m_backend->GetRenderBackendCap(inCap);
- }
-
- bool AreMultisampleTexturesSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::MsTexture);
- }
-
- bool GetConstantBufferSupport() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::ConstantBuffer);
- }
-
- bool AreDXTImagesSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::DxtImages);
- }
-
- bool IsDepthStencilSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::DepthStencilTexture);
- }
-
- bool IsFpRenderTargetSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::FpRenderTarget);
- }
-
- bool IsTessellationSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::Tessellation);
- }
-
- bool IsGeometryStageSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::Geometry);
- }
-
- bool IsComputeSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::Compute);
- }
-
- bool IsSampleQuerySupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::SampleQuery);
- }
-
- bool IsTimerQuerySupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::TimerQuery);
- }
-
- bool IsCommandSyncSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::CommandSync);
- }
- bool IsTextureArraySupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::TextureArray);
- }
- bool IsStorageBufferSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::StorageBuffer);
- }
- bool IsAtomicCounterBufferSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::AtomicCounterBuffer);
- }
- bool IsShaderImageLoadStoreSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::ShaderImageLoadStore);
- }
- bool IsProgramPipelineSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::ProgramPipeline);
- }
- bool IsPathRenderingSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::PathRendering);
- }
- // Are blend modes really supported in HW?
- bool IsAdvancedBlendHwSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::AdvancedBlend);
- }
- bool IsAdvancedBlendHwSupportedKHR() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::AdvancedBlendKHR);
- }
- bool IsBlendCoherencySupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::BlendCoherency);
- }
- bool IsStandardDerivativesSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::StandardDerivatives);
- }
- bool IsTextureLodSupported() const override
- {
- return GetRenderBackendCap(NVRenderBackend::NVRenderBackendCaps::TextureLod);
- }
-
- bool isSceneCameraView() const override
- {
- return m_isSceneCameraView;
- }
-
- void SetDefaultRenderTarget(QT3DSU64 targetID) override
- {
- m_DefaultOffscreenRenderTarget =
- (NVRenderBackend::NVRenderBackendRenderTargetObject)targetID;
- }
-
- void SetDefaultDepthBufferBitCount(QT3DSI32 depthBits) override { m_DephBits = depthBits; }
-
- void setIsSceneCameraView(bool sceneCameraView) override {
- m_isSceneCameraView = sceneCameraView;
- }
-
- virtual NVRenderDepthStencilState *
- CreateDepthStencilState(bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc,
- bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack) override;
- void SetDepthStencilState(NVRenderDepthStencilState *inDepthStencilState) override;
- virtual void StateDestroyed(NVRenderDepthStencilState &state);
-
- NVRenderRasterizerState *CreateRasterizerState(QT3DSF32 depthBias, QT3DSF32 depthScale,
- NVRenderFaces::Enum cullFace) override;
- void SetRasterizerState(NVRenderRasterizerState *inRasterizerState) override;
- virtual void StateDestroyed(NVRenderRasterizerState &state);
-
- NVRenderVertexBuffer *CreateVertexBuffer(NVRenderBufferUsageType::Enum usageType,
- size_t size, QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> bufferData) override;
- NVRenderVertexBuffer *GetVertexBuffer(const void *implementationHandle) override;
- virtual void BufferDestroyed(NVRenderVertexBuffer &buffer);
-
- virtual NVRenderIndexBuffer *
- CreateIndexBuffer(qt3ds::render::NVRenderBufferUsageType::Enum usageType,
- qt3ds::render::NVRenderComponentTypes::Enum componentType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) override;
- NVRenderIndexBuffer *GetIndexBuffer(const void *implementationHandle) override;
- virtual void BufferDestroyed(NVRenderIndexBuffer &buffer);
-
- virtual NVRenderConstantBuffer *
- CreateConstantBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) override;
- NVRenderConstantBuffer *GetConstantBuffer(CRegisteredString bufferName) override;
- virtual void BufferDestroyed(NVRenderConstantBuffer &buffer);
-
- virtual QT3DSU32 GetNextConstantBufferUnit();
-
- virtual NVRenderStorageBuffer *
- CreateStorageBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData, NVRenderDataBuffer *pBuffer) override;
- NVRenderStorageBuffer *GetStorageBuffer(CRegisteredString bufferName) override;
- virtual void BufferDestroyed(NVRenderStorageBuffer &buffer);
-
- virtual NVRenderAtomicCounterBuffer *
- CreateAtomicCounterBuffer(const char *bufferName,
- qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) override;
- NVRenderAtomicCounterBuffer *GetAtomicCounterBuffer(CRegisteredString bufferName) override;
- virtual NVRenderAtomicCounterBuffer *
- GetAtomicCounterBufferByParam(CRegisteredString paramName) override;
- virtual void BufferDestroyed(NVRenderAtomicCounterBuffer &buffer);
-
- virtual NVRenderDrawIndirectBuffer *
- CreateDrawIndirectBuffer(qt3ds::render::NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData) override;
- virtual NVRenderDrawIndirectBuffer *
- GetDrawIndirectBuffer(NVRenderBackend::NVRenderBackendBufferObject implementationHandle) override;
- virtual void BufferDestroyed(NVRenderDrawIndirectBuffer &buffer);
-
- void SetMemoryBarrier(NVRenderBufferBarrierFlags barriers) override;
-
- NVRenderOcclusionQuery *CreateOcclusionQuery() override;
- NVRenderTimerQuery *CreateTimerQuery() override;
- NVRenderSync *CreateSync() override;
-
- NVRenderTexture2D *CreateTexture2D() override;
- NVRenderTexture2D *GetTexture2D(const void *implementationHandle) override;
- virtual void TextureDestroyed(NVRenderTexture2D &buffer);
-
- NVRenderTexture2DArray *CreateTexture2DArray() override;
- virtual void TextureDestroyed(NVRenderTexture2DArray &buffer);
-
- NVRenderTextureCube *CreateTextureCube() override;
- virtual void TextureDestroyed(NVRenderTextureCube &buffer);
-
- virtual QT3DSU32 GetNextTextureUnit();
-
- NVRenderImage2D *CreateImage2D(NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess) override;
- virtual void ImageDestroyed(NVRenderImage2D &buffer);
-
- virtual NVRenderRenderBuffer *
- CreateRenderBuffer(NVRenderRenderBufferFormats::Enum bufferFormat, QT3DSU32 width,
- QT3DSU32 height) override;
- NVRenderRenderBuffer *GetRenderBuffer(const void *implementationHandle) override;
- virtual void RenderBufferDestroyed(NVRenderRenderBuffer &buffer);
-
- NVRenderFrameBuffer *CreateFrameBuffer() override;
- NVRenderFrameBuffer *GetFrameBuffer(const void *implementationHandle) override;
- virtual void FrameBufferDestroyed(NVRenderFrameBuffer &fb);
-
- virtual NVRenderAttribLayout *
- CreateAttributeLayout(NVConstDataRef<NVRenderVertexBufferEntry> attribs) override;
- NVRenderInputAssembler *CreateInputAssembler(
- NVRenderAttribLayout *attribLayout, NVConstDataRef<NVRenderVertexBuffer *> buffers,
- const NVRenderIndexBuffer *indexBuffer, NVConstDataRef<QT3DSU32> strides,
- NVConstDataRef<QT3DSU32> offsets, NVRenderDrawMode::Enum primType, QT3DSU32 patchVertexCount) override;
- void SetInputAssembler(NVRenderInputAssembler *inputAssembler) override;
-
- NVRenderVertFragCompilationResult CompileSource(
- const char *shaderName, NVConstDataRef<QT3DSI8> vertShader,
- NVConstDataRef<QT3DSI8> fragShader,
- NVConstDataRef<QT3DSI8> tessControlShaderSource = NVConstDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> tessEvaluationShaderSource = NVConstDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> geometryShaderSource = NVConstDataRef<QT3DSI8>(),
- bool separateProgram = false,
- NVRenderShaderProgramBinaryType::Enum type = NVRenderShaderProgramBinaryType::Unknown,
- bool binaryProgram = false) override;
-
- virtual NVRenderVertFragCompilationResult
- CompileBinary(const char *shaderName, NVRenderShaderProgramBinaryType::Enum type,
- NVDataRef<QT3DSI8> vertShader, NVDataRef<QT3DSI8> fragShader,
- NVDataRef<QT3DSI8> tessControlShaderSource = NVDataRef<QT3DSI8>(),
- NVDataRef<QT3DSI8> tessEvaluationShaderSource = NVDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> geometryShaderSource = NVConstDataRef<QT3DSI8>()) override;
-
- virtual NVRenderVertFragCompilationResult
- CompileComputeSource(const char *shaderName, NVConstDataRef<QT3DSI8> computeShaderSource) override;
-
- NVRenderShaderProgram *GetShaderProgram(const void *implementationHandle) override;
- virtual void ShaderDestroyed(NVRenderShaderProgram &shader);
-
- NVRenderProgramPipeline *CreateProgramPipeline() override;
- NVRenderPathSpecification *CreatePathSpecification() override;
- NVRenderPathRender *CreatePathRender(size_t range = 1) override;
- void SetPathProjectionMatrix(const QT3DSMat44 inPathProjection) override;
- void SetPathModelViewMatrix(const QT3DSMat44 inPathModelview) override;
- void SetPathStencilDepthOffset(QT3DSF32 inSlope, QT3DSF32 inBias) override;
- void SetPathCoverDepthFunc(NVRenderBoolOp::Enum inFunc) override;
-
- virtual NVRenderPathFontSpecification *
- CreatePathFontSpecification(CRegisteredString fontName) override;
- virtual void ReleasePathFontSpecification(NVRenderPathFontSpecification &inPathSpec);
- NVRenderPathFontItem *CreatePathFontItem() override;
-
- void SetClearColor(QT3DSVec4 inClearColor) override;
- QT3DSVec4 GetClearColor() const override { return m_HardwarePropertyContext.m_ClearColor; }
-
- void SetBlendFunction(NVRenderBlendFunctionArgument inFunctions) override;
- NVRenderBlendFunctionArgument GetBlendFunction() const override
- {
- return m_HardwarePropertyContext.m_BlendFunction;
- }
-
- void SetBlendEquation(NVRenderBlendEquationArgument inEquations) override;
- NVRenderBlendEquationArgument GetBlendEquation() const override
- {
- return m_HardwarePropertyContext.m_BlendEquation;
- };
-
- void SetCullingEnabled(bool inEnabled) override;
- bool IsCullingEnabled() const override { return m_HardwarePropertyContext.m_CullingEnabled; }
-
- void SetDepthFunction(qt3ds::render::NVRenderBoolOp::Enum inFunction) override;
- qt3ds::render::NVRenderBoolOp::Enum GetDepthFunction() const override
- {
- return m_HardwarePropertyContext.m_DepthFunction;
- }
-
- void SetBlendingEnabled(bool inEnabled) override;
- bool IsBlendingEnabled() const override
- {
- return m_HardwarePropertyContext.m_BlendingEnabled;
- }
-
- void SetDepthWriteEnabled(bool inEnabled) override;
- bool IsDepthWriteEnabled() const override
- {
- return m_HardwarePropertyContext.m_DepthWriteEnabled;
- }
- void SetDepthTestEnabled(bool inEnabled) override;
- bool IsDepthTestEnabled() const override
- {
- return m_HardwarePropertyContext.m_DepthTestEnabled;
- }
-
- void SetStencilTestEnabled(bool inEnabled) override;
- bool IsStencilTestEnabled() const override
- {
- return m_HardwarePropertyContext.m_StencilTestEnabled;
- }
-
- void SetScissorTestEnabled(bool inEnabled) override;
- bool IsScissorTestEnabled() const override
- {
- return m_HardwarePropertyContext.m_ScissorTestEnabled;
- }
- void SetScissorRect(NVRenderRect inRect) override;
- NVRenderRect GetScissorRect() const override
- {
- return m_HardwarePropertyContext.m_ScissorRect;
- }
-
- void SetViewport(NVRenderRect inViewport) override;
- NVRenderRect GetViewport() const override { return m_HardwarePropertyContext.m_Viewport; }
-
- void SetColorWritesEnabled(bool inEnabled) override;
- bool IsColorWritesEnabled() const override
- {
- return m_HardwarePropertyContext.m_ColorWritesEnabled;
- }
-
- void SetMultisampleEnabled(bool inEnabled) override;
- bool IsMultisampleEnabled() const override
- {
- return m_HardwarePropertyContext.m_MultisampleEnabled;
- }
-
- void SetActiveShader(NVRenderShaderProgram *inShader) override;
- NVRenderShaderProgram *GetActiveShader() const override
- {
- return m_HardwarePropertyContext.m_ActiveShader;
- }
-
- void SetActiveProgramPipeline(NVRenderProgramPipeline *inProgramPipeline) override;
- NVRenderProgramPipeline *GetActiveProgramPipeline() const override
- {
- return m_HardwarePropertyContext.m_ActiveProgramPipeline;
- }
-
- void DispatchCompute(NVRenderShaderProgram *inShader, QT3DSU32 numGroupsX,
- QT3DSU32 numGroupsY, QT3DSU32 numGroupsZ) override;
-
- void SetDrawBuffers(NVConstDataRef<QT3DSI32> inDrawBufferSet) override;
- void SetReadBuffer(NVReadFaces::Enum inReadFace) override;
-
- void ReadPixels(NVRenderRect inRect, NVRenderReadPixelFormats::Enum inFormat,
- NVDataRef<QT3DSU8> inWriteBuffer) override;
-
- void SetRenderTarget(NVRenderFrameBuffer *inBuffer) override;
- void SetReadTarget(NVRenderFrameBuffer *inBuffer) override;
- NVRenderFrameBuffer *GetRenderTarget() const override
- {
- return m_HardwarePropertyContext.m_FrameBuffer;
- }
-
- void ResetBlendState() override;
-
- // Push the entire set of properties.
- void PushPropertySet() override { m_PropertyStack.push_back(m_HardwarePropertyContext); }
-
- // Pop the entire set of properties, potentially forcing the values
- // to opengl.
- void PopPropertySet(bool inForceSetProperties) override;
-
- // clear current bound render target
- void Clear(NVRenderClearFlags flags) override;
- // clear passed in rendertarget
- void Clear(NVRenderFrameBuffer &fb, NVRenderClearFlags flags) override;
-
- // copy framebuffer content between read target and render target
- void BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter) override;
-
- void Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 count, QT3DSU32 offset) override;
- void DrawIndirect(NVRenderDrawMode::Enum drawMode, QT3DSU32 offset) override;
-
- NVFoundationBase &GetFoundation() override { return m_Foundation; }
- qt3ds::foundation::IStringTable &GetStringTable() override { return m_StringTable; }
- NVAllocatorCallback &GetAllocator() override { return m_Foundation.getAllocator(); }
- QSurfaceFormat format() const override
- {
- return m_backend->format();
- }
- virtual void resetStates()
- {
- PushPropertySet();
- PopPropertySet(true);
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.cpp
deleted file mode 100644
index b00b0af0..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderDataBuffer.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSFoundation.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderDataBuffer::NVRenderDataBuffer(NVRenderContextImpl &context, NVFoundationBase &fnd,
- size_t size, NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_UsageType(usageType)
- , m_BindFlags(bindFlags)
- , m_BufferData(data)
- , m_BufferCapacity(data.size())
- , m_BufferSize(size)
- , m_OwnsData(false)
- , m_Mapped(false)
- {
- m_BufferHandle =
- m_Backend->CreateBuffer(size, bindFlags, usageType, (const void *)m_BufferData.begin());
- }
-
- NVRenderDataBuffer::~NVRenderDataBuffer()
- {
- if (m_BufferHandle) {
- m_Backend->ReleaseBuffer(m_BufferHandle);
- }
- m_BufferHandle = 0;
-
- releaseMemory();
- }
-
- void NVRenderDataBuffer::releaseMemory()
- {
- // chekc if we should release memory
- if (m_BufferData.size() && m_OwnsData) {
- m_Foundation.getAllocator().deallocate(m_BufferData.begin());
- }
-
- m_BufferData = NVDataRef<QT3DSU8>();
- m_OwnsData = false;
- }
-
- NVDataRef<QT3DSU8> NVRenderDataBuffer::MapBuffer()
- {
- // don't map twice
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to map a mapped buffer");
- QT3DS_ASSERT(false);
- }
-
- QT3DSU8 *pData = (QT3DSU8 *)m_Backend->MapBuffer(
- m_BufferHandle, m_BindFlags, 0, m_BufferSize,
- NVRenderBufferAccessFlags(NVRenderBufferAccessTypeValues::Read
- | NVRenderBufferAccessTypeValues::Write));
-
- releaseMemory();
- m_BufferData = toDataRef(const_cast<QT3DSU8 *>(pData), (QT3DSU32)m_BufferSize);
- m_BufferCapacity = (QT3DSU32)m_BufferSize;
- m_OwnsData = false;
-
- // currently we return a reference to the system memory
- m_Mapped = true;
- return m_BufferData;
- }
-
- NVDataRef<QT3DSU8> NVRenderDataBuffer::MapBufferRange(size_t offset, size_t size,
- NVRenderBufferAccessFlags flags)
- {
- // don't map twice
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to map a mapped buffer");
- QT3DS_ASSERT(false);
- }
- // don't map out of range
- if ((m_BufferSize < (offset + size)) || (size == 0)) {
- qCCritical(INVALID_OPERATION, "Attempting to map out of buffer range");
- QT3DS_ASSERT(false);
- }
-
- QT3DSU8 *pData =
- (QT3DSU8 *)m_Backend->MapBuffer(m_BufferHandle, m_BindFlags, offset, size, flags);
-
- releaseMemory();
- m_BufferData = toDataRef(const_cast<QT3DSU8 *>(pData), (QT3DSU32)size);
- m_BufferCapacity = (QT3DSU32)size;
- m_OwnsData = false;
-
- // currently we return a reference to the system memory
- m_Mapped = true;
- return m_BufferData;
- }
-
- void NVRenderDataBuffer::UnmapBuffer()
- {
- if (m_Mapped) {
- // update hardware
- m_Backend->UnmapBuffer(m_BufferHandle, m_BindFlags);
- m_Mapped = false;
- releaseMemory();
- }
- }
-
- void NVRenderDataBuffer::UpdateBuffer(NVConstDataRef<QT3DSU8> data, bool ownsMemory)
- {
- // don't update a mapped buffer
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to update a mapped buffer");
- QT3DS_ASSERT(false);
- }
-
- releaseMemory();
-
- m_BufferData = toDataRef(const_cast<QT3DSU8 *>(data.begin()), data.size());
- m_BufferCapacity = data.mSize;
- m_OwnsData = ownsMemory;
- // update hardware
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, m_BufferCapacity, m_UsageType,
- (const void *)m_BufferData.begin());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.h
deleted file mode 100644
index 579e2361..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDataBuffer.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DATA_BUFFER_H
-#define QT3DS_RENDER_DATA_BUFFER_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
- class NVRenderBackend;
-
- ///< Base class
- class NVRenderDataBuffer : public NVRefCounted, public NVRenderImplemented
- {
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBufferUsageType::Enum m_UsageType; ///< usage type
- NVRenderBufferBindFlags m_BindFlags; ///< bind flags
- NVDataRef<QT3DSU8> m_BufferData; ///< buffer data pointer
- QT3DSU32 m_BufferCapacity; ///< size of internal backup buffer (m_BufferData)
- size_t m_BufferSize; ///< size of buffer
- bool m_OwnsData; ///< true when we own m_BufferData
- bool m_Mapped; ///< true when locked for reading or writing to m_BufferData
- NVRenderBackend::NVRenderBackendBufferObject m_BufferHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] bindFlags Where to binf this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- *application.
- *
- * @return No return.
- */
- NVRenderDataBuffer(NVRenderContextImpl &context, NVFoundationBase &fnd, size_t size,
- NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usageType, NVDataRef<QT3DSU8> data);
-
- virtual ~NVRenderDataBuffer();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- /**
- * @brief Get Buffer usage type
- *
- * @return Return usage tyoe
- */
- virtual NVRenderBufferUsageType::Enum GetBufferUsageType() const
- {
- return m_UsageType;
- }
-
- /**
- * @brief Get Buffer usage type
- * Should be overwritten
- *
- * @return Return usage tyoe
- */
- virtual NVRenderBufferBindFlags GetBufferBindings() const { return m_BindFlags; }
-
- /**
- * @brief Return buffer size in byte
- *
- * @return Return size
- */
- virtual QT3DSU32 Size() { return (QT3DSU32)m_BufferSize; }
-
- /**
- * @brief Get a pointer to the foundation
- *
- * @return pointer to foundation
- */
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- virtual void Bind() = 0;
-
- /**
- * @brief Map the buffer
- * Mapped buffers cannot be used for rendering
- *
- * @return Return mapped pointer to data
- */
- virtual NVDataRef<QT3DSU8> MapBuffer();
-
- /**
- * @brief Map a range of a buffer
- * Mapped buffers cannot be used for rendering
- *
- * @param[in] offset Offset in bytes into the buffer
- * @param[in] size Range in bytes to map
- * @param[in] flags Buffer access flags
- *
- * @return Return mapped pointer to data
- */
- virtual NVDataRef<QT3DSU8> MapBufferRange(size_t offset, size_t size,
- NVRenderBufferAccessFlags flags);
-
- /**
- * @brief Unmap the buffer
- * This updates the data to the hardware
- *
- * @return no return
- */
- virtual void UnmapBuffer();
-
- /**
- * @brief constructor
- *
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- * @param[in] ownsMemory If true data will be owned by this object and can therefore be
- * released
- *
- * @return No return.
- */
- virtual void UpdateBuffer(NVConstDataRef<QT3DSU8> data, bool ownsMemory = false);
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const = 0;
-
- // this will be obsolete
- const void *GetImplementationHandle() const override = 0;
-
- private:
- void releaseMemory();
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.cpp
deleted file mode 100644
index 3ea47e23..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderDepthStencilState.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderDepthStencilState::NVRenderDepthStencilState(
- NVRenderContextImpl &context, NVFoundationBase &fnd, bool enableDepth, bool depthMask,
- NVRenderBoolOp::Enum depthFunc, bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_DepthEnabled(enableDepth)
- , m_DepthMask(depthMask)
- , m_DepthFunc(depthFunc)
- , m_StencilEnabled(enableStencil)
- , m_StencilFuncFront(stencilFuncFront)
- , m_StencilFuncBack(stencilFuncBack)
- , m_DepthStencilOpFront(depthStencilOpFront)
- , m_DepthStencilOpBack(depthStencilOpBack)
- {
- // create backend handle
- m_StateHandle = m_Backend->CreateDepthStencilState(
- enableDepth, depthMask, depthFunc, enableStencil, stencilFuncFront, stencilFuncBack,
- depthStencilOpFront, depthStencilOpBack);
- }
-
- NVRenderDepthStencilState::~NVRenderDepthStencilState()
- {
- if (m_StateHandle) {
- m_Context.StateDestroyed(*this);
- m_Backend->ReleaseDepthStencilState(m_StateHandle);
- }
- }
-
- NVRenderDepthStencilState *
- NVRenderDepthStencilState::Create(NVRenderContextImpl &context, bool enableDepth,
- bool depthMask, NVRenderBoolOp::Enum depthFunc,
- bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack)
- {
- return QT3DS_NEW(context.GetFoundation().getAllocator(), NVRenderDepthStencilState)(
- context, context.GetFoundation(), enableDepth, depthMask, depthFunc, enableStencil,
- stencilFuncFront, stencilFuncBack, depthStencilOpFront, depthStencilOpBack);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.h
deleted file mode 100644
index e6b31981..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDepthStencilState.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DEPTH_STENCIL_STATE_H
-#define QT3DS_RENDER_DEPTH_STENCIL_STATE_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
-
- // currently this handles only stencil state
- class NVRenderDepthStencilState : public NVRefCounted
- {
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBackend::NVRenderBackendDepthStencilStateObject
- m_StateHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] enableDepth enable depth test
- * @param[in] depthMask enable depth writes
- * @param[in] depthFunc depth compare function
- * @param[in] enableStencil enable stencil test
- * @param[in] stencilFuncFront stencil setup front faces
- * @param[in] stencilFuncBack stencil setup back faces
- * @param[in] depthStencilOpFront depth/stencil operations front faces
- * @param[in] depthStencilOpBack depth/stencil operations back faces
- *
- * @return No return.
- */
- NVRenderDepthStencilState(NVRenderContextImpl &context, NVFoundationBase &fnd,
- bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc,
- bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack);
-
- virtual ~NVRenderDepthStencilState();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- ///< various get functions
- const NVRenderStencilFunctionArgument GetStencilFunc(NVRenderFaces::Enum face) const
- {
- return (face == NVRenderFaces::Back) ? m_StencilFuncBack : m_StencilFuncFront;
- }
- const NVRenderStencilOperationArgument GetStencilOp(NVRenderFaces::Enum face) const
- {
- return (face == NVRenderFaces::Back) ? m_DepthStencilOpBack : m_DepthStencilOpFront;
- }
- NVRenderBoolOp::Enum GetDepthFunc() const { return m_DepthFunc; }
- bool GetDepthEnabled() const { return m_DepthEnabled; }
- bool GetStencilEnabled() const { return m_StencilEnabled; }
- bool GetDepthMask() const { return m_DepthMask; }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendDepthStencilStateObject
- GetDepthStencilObjectHandle()
- {
- return m_StateHandle;
- }
-
- static NVRenderDepthStencilState *
- Create(NVRenderContextImpl &context, bool enableDepth, bool depthMask,
- NVRenderBoolOp::Enum depthFunc, bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack);
-
- private:
- bool m_DepthEnabled; ///< depth test enabled
- bool m_DepthMask; ///< depth writes enabled
- NVRenderBoolOp::Enum m_DepthFunc; ///< depth comparison func
- bool m_StencilEnabled; ///< stencil test enabled
- NVRenderStencilFunctionArgument m_StencilFuncFront; ///< stencil setup front faces
- NVRenderStencilFunctionArgument m_StencilFuncBack; ///< stencil setup back faces
- NVRenderStencilOperationArgument
- m_DepthStencilOpFront; ///< depth stencil operation front faces
- NVRenderStencilOperationArgument
- m_DepthStencilOpBack; ///< depth stencil operation back faces
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.cpp
deleted file mode 100644
index 9940003f..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderDrawIndirectBuffer.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderDrawIndirectBuffer::NVRenderDrawIndirectBuffer(NVRenderContextImpl &context,
- size_t size,
- NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data)
- : NVRenderDataBuffer(context, context.GetFoundation(), size,
- NVRenderBufferBindValues::Draw_Indirect, usageType, data)
- , m_Dirty(true)
- {
- }
-
- NVRenderDrawIndirectBuffer::~NVRenderDrawIndirectBuffer() { m_Context.BufferDestroyed(*this); }
-
- void NVRenderDrawIndirectBuffer::Bind()
- {
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to Bind a locked buffer");
- QT3DS_ASSERT(false);
- }
-
- m_Backend->BindBuffer(m_BufferHandle, m_BindFlags);
- }
-
- void NVRenderDrawIndirectBuffer::Update()
- {
- // we only update the buffer if it is dirty and we actually have some data
- if (m_Dirty && m_BufferData.size()) {
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, m_BufferData.size(), m_UsageType,
- m_BufferData.begin());
- m_Dirty = false;
- }
- }
-
- void NVRenderDrawIndirectBuffer::UpdateData(QT3DSI32 offset, NVDataRef<QT3DSU8> data)
- {
- // we only update the buffer if we something
- if (data.size())
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, data.size(), m_UsageType,
- data.begin() + offset);
- }
-
- NVRenderDrawIndirectBuffer *
- NVRenderDrawIndirectBuffer::Create(NVRenderContextImpl &context,
- NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVFoundationBase &fnd(context.GetFoundation());
- NVRenderDrawIndirectBuffer *retval = NULL;
-
- // these are the context flags which do not support this drawing mode
- NVRenderContextType noDrawIndirectSupported(
- NVRenderContextValues::GL2 | NVRenderContextValues::GLES2 | NVRenderContextValues::GL3
- | NVRenderContextValues::GLES3);
- NVRenderContextType ctxType = context.GetRenderContextType();
-
- if (!(ctxType & noDrawIndirectSupported)) {
- QT3DSU32 bufSize = sizeof(NVRenderDrawIndirectBuffer);
- QT3DSU8 *newMem = (QT3DSU8 *)QT3DS_ALLOC(fnd.getAllocator(), bufSize, "DrawIndirectBuffer");
- retval = new (newMem) NVRenderDrawIndirectBuffer(
- context, size, usageType,
- toDataRef(const_cast<QT3DSU8 *>(bufferData.begin()), bufferData.size()));
- } else {
- QT3DS_ASSERT(false);
- }
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.h
deleted file mode 100644
index 81cd59d1..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawIndirectBuffer.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_DRAW_INDIRECT_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_DRAW_INDIRECT_BUFFER_H
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Utils.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderDataBuffer.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- // forward declaration
- class NVRenderContextImpl;
-
- struct DrawArraysIndirectCommand
- {
- QT3DSU32 count;
- QT3DSU32 primCount;
- QT3DSU32 first;
- QT3DSU32 baseInstance;
- };
-
- struct DrawElementsIndirectCommand
- {
- QT3DSU32 count;
- QT3DSU32 primCount;
- QT3DSU32 firstIndex;
- QT3DSU32 baseVertex;
- QT3DSU32 baseInstance;
- };
-
- ///< Constant (uniform) buffer representation
- class NVRenderDrawIndirectBuffer : public NVRenderDataBuffer
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return.
- */
- NVRenderDrawIndirectBuffer(NVRenderContextImpl &context, size_t size,
- NVRenderBufferUsageType::Enum usageType, NVDataRef<QT3DSU8> data);
-
- ///< destructor
- virtual ~NVRenderDrawIndirectBuffer();
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- void Bind() override;
-
- /**
- * @brief update the buffer to hardware
- *
- * @return no return.
- */
- virtual void Update();
-
- /**
- * @brief update a piece of memory directly within the storage buffer
- *
- * Note: When you use this function you should know what you are doing.
- * The memory layout within C++ must exactly match the memory layout in the
- *shader.
- * We use std140 (430) layout which guarantees a specific layout behavior across
- *all HW vendors.
- * How the memory layout is computed can be found in the GL spec.
- *
- * @param[in] offset offset into storage buffer
- * @param[in] data pointer to data
- *
- * @return no return
- */
- void UpdateData(QT3DSI32 offset, NVDataRef<QT3DSU8> data);
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const override
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
-
- /**
- * @brief create a NVRenderDrawIndirectBuffer object
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return the buffer object or NULL
- */
- static NVRenderDrawIndirectBuffer *Create(NVRenderContextImpl &context,
- NVRenderBufferUsageType::Enum usageType,
- size_t size, NVConstDataRef<QT3DSU8> bufferData);
-
- private:
- bool m_Dirty; ///< true if buffer is dirty
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawable.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawable.h
deleted file mode 100644
index 0f78aacc..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderDrawable.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_DRAWABLE_H
-#define QT3DS_RENDER_QT3DS_RENDER_DRAWABLE_H
-#include "Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
- class NVRenderDrawable
- {
- protected:
- virtual ~NVRenderDrawable() {}
-
- public:
- /**
- * Draw using this object.
- * offset is in num elements, not in number of bytes
- * because the various different draw functions differ in what datatype
- * offset is (gl drawarrays vs gl drawindexedarras).
- */
- virtual void Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 count, QT3DSU32 offset) = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.cpp
deleted file mode 100644
index e2f31f1b..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderFragmentShader.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderFragmentShader::NVRenderFragmentShader(NVRenderContextImpl &context,
- NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram)
- : NVRenderShader(context, fnd, source, binaryProgram)
- , m_ShaderHandle(NULL)
- {
- m_ShaderHandle = m_Backend->CreateFragmentShader(source, m_ErrorMessage, binaryProgram);
- }
-
- NVRenderFragmentShader::~NVRenderFragmentShader()
- {
- if (m_ShaderHandle) {
- m_Backend->ReleaseFragmentShader(m_ShaderHandle);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.h
deleted file mode 100644
index f661605c..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFragmentShader.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_FRAGMENT_SHADER_H
-#define QT3DS_RENDER_FRAGMENT_SHADER_H
-
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderShader.h"
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- ///< This class represents a fragment shader
- class NVRenderFragmentShader : public NVRenderShader
- {
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] source Pointer to shader source code
- * @param[in] binaryProgram true if this is a binary program
- *
- * @return No return.
- */
- NVRenderFragmentShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram);
-
- /// @brief destructor
- ~NVRenderFragmentShader();
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- bool IsValid() override { return (m_ShaderHandle != NULL); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendFragmentShaderObject GetShaderHandle()
- {
- return m_ShaderHandle;
- }
-
- private:
- NVRenderBackend::NVRenderBackendFragmentShaderObject
- m_ShaderHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.cpp
deleted file mode 100644
index 0ab38428..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderFrameBuffer::NVRenderFrameBuffer(NVRenderContextImpl &context, NVFoundationBase &fnd)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_BufferHandle(NULL)
- , m_AttachmentBits(0)
- {
- m_BufferHandle = m_Backend->CreateRenderTarget();
- QT3DS_ASSERT(m_BufferHandle);
- }
-
- NVRenderFrameBuffer::~NVRenderFrameBuffer()
- {
- m_Context.FrameBufferDestroyed(*this);
- m_Backend->ReleaseRenderTarget(m_BufferHandle);
- m_BufferHandle = 0;
- m_AttachmentBits = 0;
-
- // release attachments
- QT3DS_FOREACH(idx, (QT3DSU32)NVRenderFrameBufferAttachments::LastAttachment)
- {
- if ((NVRenderFrameBufferAttachments::Enum)idx
- != NVRenderFrameBufferAttachments::DepthStencil
- || m_Context.IsDepthStencilSupported())
- releaseAttachment((NVRenderFrameBufferAttachments::Enum)idx);
- }
- }
-
- inline void CheckAttachment(NVRenderContext &ctx,
- NVRenderFrameBufferAttachments::Enum attachment)
- {
-#ifdef _DEBUG
- QT3DS_ASSERT(attachment != NVRenderFrameBufferAttachments::DepthStencil
- || ctx.IsDepthStencilSupported());
-#endif
- (void)ctx;
- (void)attachment;
- }
-
- NVRenderTextureTargetType::Enum
- NVRenderFrameBuffer::releaseAttachment(NVRenderFrameBufferAttachments::Enum idx)
- {
- NVRenderTextureTargetType::Enum target = NVRenderTextureTargetType::Unknown;
-
- NVRenderTextureOrRenderBuffer Attach = m_Attachments[idx];
- if (Attach.HasTexture2D()) {
- target = (Attach.GetTexture2D()->IsMultisampleTexture())
- ? NVRenderTextureTargetType::Texture2D_MS
- : NVRenderTextureTargetType::Texture2D;
- Attach.GetTexture2D()->release();
- } else if (Attach.HasTexture2DArray()) {
- target = (Attach.GetTexture2DArray()->IsMultisampleTexture())
- ? NVRenderTextureTargetType::Texture2D_MS
- : NVRenderTextureTargetType::Texture2D_Array;
- Attach.GetTexture2DArray()->release();
- } else if (Attach.HasTextureCube()) {
- target = (Attach.GetTextureCube()->IsMultisampleTexture())
- ? NVRenderTextureTargetType::Texture2D_MS
- : NVRenderTextureTargetType::TextureCube;
- Attach.GetTextureCube()->release();
- } else if (Attach.HasRenderBuffer())
- Attach.GetRenderBuffer()->release();
-
- CheckAttachment(m_Context, idx);
- m_Attachments[idx] = NVRenderTextureOrRenderBuffer();
-
- m_AttachmentBits &= ~(1 << idx);
-
- return target;
- }
-
- NVRenderTextureOrRenderBuffer
- NVRenderFrameBuffer::GetAttachment(NVRenderFrameBufferAttachments::Enum attachment)
- {
- if (attachment == NVRenderFrameBufferAttachments::Unknown
- || attachment > NVRenderFrameBufferAttachments::LastAttachment) {
- qCCritical(INVALID_PARAMETER, "Attachment out of range");
- return NVRenderTextureOrRenderBuffer();
- }
- CheckAttachment(m_Context, attachment);
- return m_Attachments[attachment];
- }
-
- void NVRenderFrameBuffer::Attach(NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderTextureOrRenderBuffer buffer,
- NVRenderTextureTargetType::Enum target)
- {
- if (attachment == NVRenderFrameBufferAttachments::Unknown
- || attachment > NVRenderFrameBufferAttachments::LastAttachment) {
- qCCritical(INVALID_PARAMETER, "Attachment out of range");
- return;
- }
-
- // early out
- // if there is nothing to detach
- if (!buffer.HasTexture2D() && !buffer.HasRenderBuffer() && !buffer.HasTexture2DArray()
- && !(m_AttachmentBits & (1 << attachment)))
- return;
-
- CheckAttachment(m_Context, attachment);
- // Ensure we are the bound framebuffer
- m_Context.SetRenderTarget(this);
-
- // release previous attachments
- NVRenderTextureTargetType::Enum theRelTarget = releaseAttachment(attachment);
-
- if (buffer.HasTexture2D()) {
- // On the same attachment point there could be a something attached with a different
- // target MSAA <--> NoMSAA
- if (theRelTarget != NVRenderTextureTargetType::Unknown && theRelTarget != target)
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- NVRenderBackend::NVRenderBackendTextureObject(NULL),
- theRelTarget);
-
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- buffer.GetTexture2D()->GetTextureObjectHandle(), target);
- buffer.GetTexture2D()->addRef();
- m_AttachmentBits |= (1 << attachment);
- } else if (buffer.HasTexture2DArray()) {
- // On the same attachment point there could be a something attached with a different
- // target MSAA <--> NoMSAA
- if (theRelTarget != NVRenderTextureTargetType::Unknown && theRelTarget != target)
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- NVRenderBackend::NVRenderBackendTextureObject(NULL),
- theRelTarget);
-
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- buffer.GetTexture2D()->GetTextureObjectHandle(), target);
- buffer.GetTexture2DArray()->addRef();
- m_AttachmentBits |= (1 << attachment);
- } else if (buffer.HasRenderBuffer()) {
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- buffer.GetRenderBuffer()->GetRenderBuffertHandle());
- buffer.GetRenderBuffer()->addRef();
- m_AttachmentBits |= (1 << attachment);
- } else if (theRelTarget == NVRenderTextureTargetType::Unknown) {
- // detach renderbuffer
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- NVRenderBackend::NVRenderBackendRenderbufferObject(NULL));
- } else {
- // detach texture
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- NVRenderBackend::NVRenderBackendTextureObject(NULL),
- theRelTarget);
- }
- m_Attachments[attachment] = buffer;
- }
-
- void NVRenderFrameBuffer::AttachLayer(NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderTextureOrRenderBuffer buffer, QT3DSI32 layer,
- QT3DSI32 level)
- {
- if (attachment == NVRenderFrameBufferAttachments::Unknown
- || attachment > NVRenderFrameBufferAttachments::LastAttachment) {
- qCCritical(INVALID_PARAMETER, "Attachment out of range");
- return;
- }
-
- // This function is only used for attaching a layer
- // If texture exists probably something is wrong
- if (!buffer.HasTexture2DArray()) {
- QT3DS_ASSERT(false);
- return;
- }
-
- CheckAttachment(m_Context, attachment);
- // Ensure we are the bound framebuffer
- m_Context.SetRenderTarget(this);
-
- // release previous attachments
- NVRenderTextureTargetType::Enum theRelTarget = releaseAttachment(attachment);
-
- // On the same attachment point there could be a something attached with a different target
- // MSAA <--> NoMSAA
- if (theRelTarget != NVRenderTextureTargetType::Unknown
- && theRelTarget != NVRenderTextureTargetType::Texture2D_Array)
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- NVRenderBackend::NVRenderBackendTextureObject(NULL),
- theRelTarget);
-
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- buffer.GetTexture2DArray()->GetTextureObjectHandle(), level,
- layer);
- buffer.GetTexture2DArray()->addRef();
- m_AttachmentBits |= (1 << attachment);
-
- m_Attachments[attachment] = buffer;
- }
-
- void NVRenderFrameBuffer::AttachFace(NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderTextureOrRenderBuffer buffer,
- NVRenderTextureCubeFaces::Enum face)
- {
- if (attachment == NVRenderFrameBufferAttachments::Unknown
- || attachment > NVRenderFrameBufferAttachments::LastAttachment) {
- qCCritical(INVALID_PARAMETER, "Attachment out of range");
- return;
- }
-
- if (face == NVRenderTextureCubeFaces::InvalidFace) {
- QT3DS_ASSERT(false);
- return;
- }
-
- CheckAttachment(m_Context, attachment);
- // Ensure we are the bound framebuffer
- m_Context.SetRenderTarget(this);
-
- // release previous attachments
- NVRenderTextureTargetType::Enum attachTarget = static_cast<NVRenderTextureTargetType::Enum>(
- (int)NVRenderTextureTargetType::TextureCube + (int)face);
- NVRenderTextureTargetType::Enum theRelTarget = releaseAttachment(attachment);
-
- // If buffer has no texture cube, this call is used to detach faces.
- // If release target is not cube, there is something else attached to that
- // attachment point, so we want to release that first. E.g (MSAA <--> NoMSAA)
- if (theRelTarget == NVRenderTextureTargetType::TextureCube && !buffer.HasTextureCube()) {
- theRelTarget = attachTarget;
- attachTarget = NVRenderTextureTargetType::Unknown;
- } else if (theRelTarget == NVRenderTextureTargetType::TextureCube) {
- theRelTarget = NVRenderTextureTargetType::Unknown;
- }
- if (theRelTarget != NVRenderTextureTargetType::Unknown) {
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- NVRenderBackend::NVRenderBackendTextureObject(NULL),
- theRelTarget);
- }
-
- if (attachTarget != NVRenderTextureTargetType::Unknown) {
- m_Backend->RenderTargetAttach(m_BufferHandle, attachment,
- buffer.GetTextureCube()->GetTextureObjectHandle(),
- attachTarget);
- buffer.GetTextureCube()->addRef();
- m_AttachmentBits |= (1 << attachment);
- }
-
- m_Attachments[attachment] = buffer;
- }
-
- bool NVRenderFrameBuffer::IsComplete()
- {
- // Ensure we are the bound framebuffer
- m_Context.SetRenderTarget(this);
-
- return m_Backend->RenderTargetIsValid(m_BufferHandle);
- }
-}
-}
-
-qt3ds::render::NVRenderFrameBuffer *
-qt3ds::render::NVRenderFrameBuffer::Create(NVRenderContextImpl &context)
-{
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderFrameBuffer)(context, context.GetFoundation());
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.h
deleted file mode 100644
index 1882a27d..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderFrameBuffer.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_FRAME_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_FRAME_BUFFER_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAssert.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
- class NVRenderTexture2D;
- class NVRenderRenderBuffer;
- class NVRenderTexture2DArray;
- class NVRenderTextureCube;
-
- class NVRenderTextureOrRenderBuffer
- {
- NVRenderTexture2D *m_Texture2D;
- NVRenderTexture2DArray *m_Texture2DArray;
- NVRenderTextureCube *m_TextureCube;
- NVRenderRenderBuffer *m_RenderBuffer;
-
- public:
- NVRenderTextureOrRenderBuffer(NVRenderTexture2D &texture)
- : m_Texture2D(&texture)
- , m_Texture2DArray(NULL)
- , m_TextureCube(NULL)
- , m_RenderBuffer(NULL)
- {
- }
- NVRenderTextureOrRenderBuffer(NVRenderRenderBuffer &render)
- : m_Texture2D(NULL)
- , m_Texture2DArray(NULL)
- , m_TextureCube(NULL)
- , m_RenderBuffer(&render)
- {
- }
- NVRenderTextureOrRenderBuffer(NVRenderTexture2DArray &textureArray)
- : m_Texture2D(NULL)
- , m_Texture2DArray(&textureArray)
- , m_TextureCube(NULL)
- , m_RenderBuffer(NULL)
- {
- }
- NVRenderTextureOrRenderBuffer(NVRenderTextureCube &textureCube)
- : m_Texture2D(NULL)
- , m_Texture2DArray(NULL)
- , m_TextureCube(&textureCube)
- , m_RenderBuffer(NULL)
- {
- }
- NVRenderTextureOrRenderBuffer()
- : m_Texture2D(NULL)
- , m_Texture2DArray(NULL)
- , m_TextureCube(NULL)
- , m_RenderBuffer(NULL)
- {
- }
- NVRenderTextureOrRenderBuffer(const NVRenderTextureOrRenderBuffer &other)
- : m_Texture2D(other.m_Texture2D)
- , m_Texture2DArray(other.m_Texture2DArray)
- , m_TextureCube(other.m_TextureCube)
- , m_RenderBuffer(other.m_RenderBuffer)
- {
- }
- NVRenderTextureOrRenderBuffer &operator=(const NVRenderTextureOrRenderBuffer &other)
- {
- if (this != &other) {
- m_Texture2D = const_cast<NVRenderTexture2D *>(other.m_Texture2D);
- m_Texture2DArray = const_cast<NVRenderTexture2DArray *>(other.m_Texture2DArray);
- m_RenderBuffer = const_cast<NVRenderRenderBuffer *>(other.m_RenderBuffer);
- m_TextureCube = const_cast<NVRenderTextureCube *>(other.m_TextureCube);
- }
- return *this;
- }
-
- bool HasTexture2D() const { return m_Texture2D != NULL; }
- bool HasTexture2DArray() const { return m_Texture2DArray != NULL; }
- bool HasTextureCube() const { return m_TextureCube != NULL; }
- bool HasRenderBuffer() const { return m_RenderBuffer != NULL; }
-
- NVRenderTexture2D *GetTexture2D() const
- {
- QT3DS_ASSERT(HasTexture2D());
- return m_Texture2D;
- }
- NVRenderTexture2DArray *GetTexture2DArray() const
- {
- QT3DS_ASSERT(HasTexture2DArray());
- return m_Texture2DArray;
- }
- NVRenderTextureCube *GetTextureCube() const
- {
- QT3DS_ASSERT(HasTextureCube());
- return m_TextureCube;
- }
- NVRenderRenderBuffer *GetRenderBuffer() const
- {
- QT3DS_ASSERT(HasRenderBuffer());
- return m_RenderBuffer;
- }
- };
-
- class NVRenderFrameBuffer : public NVRefCounted, public NVRenderImplemented
- {
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
-
- NVRenderTextureOrRenderBuffer
- m_Attachments[NVRenderFrameBufferAttachments::LastAttachment]; ///< attachments array
- NVRenderBackend::NVRenderBackendRenderTargetObject
- m_BufferHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderFrameBuffer(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- /// destructor
- virtual ~NVRenderFrameBuffer();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- /**
- * @brief query attachment
- *
- *
- * @return buffer format
- */
- virtual NVRenderTextureOrRenderBuffer
- GetAttachment(NVRenderFrameBufferAttachments::Enum attachment);
-
- /**
- * @brief Attach a render or texture buffer to a render target
- * For texture attachments we use always level 0
- *
- * @param[in] attachment Attachment point (e.g. COLOR0, DEPTH...)
- * @param[in] buffer Contains a pointer to the attachment
- * @param[in] target Attachment texture target
- *
- * @return no return
- */
- virtual void
- Attach(NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderTextureOrRenderBuffer buffer,
- NVRenderTextureTargetType::Enum target = NVRenderTextureTargetType::Texture2D);
-
- /**
- * @brief Attach a particular layer of the texture 2D array to a render target
- *
- * @param[in] attachment Attachment point (e.g. COLOR0, DEPTH...)
- * @param[in] buffer Pointer to the Texture Array which contains the
- * layers
- * @param[in] layer The index to the layer that will be attached to the
- * target
- * @param[in] level Mip level of the texture that will be attached
- * (default 0)
- *
- * @return no return
- */
- virtual void AttachLayer(NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderTextureOrRenderBuffer buffer, QT3DSI32 layer,
- QT3DSI32 level = 0);
-
- /**
- * @brief Attach a particular face of the texture cubemap to a render target
- *
- * @param[in] attachment Attachment point (e.g. COLOR0, DEPTH...)
- * @param[in] buffer Pointer to the Texture Array which contains the
- * layers
- * @param[in] face The face of the cubemap that will be attached to the
- * target
- * @param[in] level Mip level of the texture that will be attached
- * (default 0)
- *
- * @return no return
- */
- virtual void AttachFace(NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderTextureOrRenderBuffer buffer,
- NVRenderTextureCubeFaces::Enum face);
-
- /**
- * @brief Check that this framebuffer is complete and can be rendered to.
- *
- *
- * @return true if complete
- */
- virtual bool IsComplete();
-
- /**
- * @brief query if framebuffer has any attachment
- *
- * @return true if any attachment
- */
- virtual bool HasAnyAttachment() { return (m_AttachmentBits != 0); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendRenderTargetObject GetFrameBuffertHandle()
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<const void *>(m_BufferHandle);
- }
-
- /**
- * @brief static creator function
- *
- * @param[in] context Pointer to context
- *
- * @return a pointer to framebuffer object.
- */
- static NVRenderFrameBuffer *Create(NVRenderContextImpl &context);
-
- private:
- /**
- * @brief releaes an attached object
- *
- * @return which target we released
- */
- NVRenderTextureTargetType::Enum releaseAttachment(NVRenderFrameBufferAttachments::Enum idx);
-
- QT3DSU32 m_AttachmentBits; ///< holds flags for current attached buffers
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.cpp
deleted file mode 100644
index 50567287..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderGeometryShader.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderGeometryShader::NVRenderGeometryShader(NVRenderContextImpl &context,
- NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram)
- : NVRenderShader(context, fnd, source, binaryProgram)
- , m_ShaderHandle(NULL)
- {
- m_ShaderHandle = m_Backend->CreateGeometryShader(source, m_ErrorMessage, binaryProgram);
- }
-
- NVRenderGeometryShader::~NVRenderGeometryShader()
- {
- if (m_ShaderHandle) {
- m_Backend->ReleaseGeometryShader(m_ShaderHandle);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.h
deleted file mode 100644
index 2a643cfc..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderGeometryShader.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_GEOMETRY_SHADER_H
-#define QT3DS_RENDER_GEOMETRY_SHADER_H
-
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderShader.h"
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- ///< This class represents a vertex shader
- class NVRenderGeometryShader : public NVRenderShader
- {
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] source Pointer to shader source code
- * @param[in] binaryProgram true if this is a binary program
- *
- * @return No return.
- */
- NVRenderGeometryShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram);
-
- /// @brief destructor
- ~NVRenderGeometryShader();
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- bool IsValid() override { return (m_ShaderHandle != NULL); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendGeometryShaderObject GetShaderHandle()
- {
- return m_ShaderHandle;
- }
-
- private:
- NVRenderBackend::NVRenderBackendGeometryShaderObject
- m_ShaderHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.cpp
deleted file mode 100644
index e987cc31..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderImageTexture.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderImage2D::NVRenderImage2D(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_Texture2D(inTexture)
- , m_TextureUnit(QT3DS_MAX_U32)
- , m_AccessType(inAccess)
- , m_TextureLevel(0)
- {
- inTexture->addRef();
- }
-
- NVRenderImage2D::~NVRenderImage2D()
- {
- m_Context.ImageDestroyed(*this);
- m_Texture2D->release();
- }
-
- void NVRenderImage2D::SetTextureLevel(QT3DSI32 inLevel)
- {
- if (m_Texture2D && m_Texture2D->GetNumMipmaps() >= (QT3DSU32)inLevel) {
- m_TextureLevel = inLevel;
- }
- }
-
- void NVRenderImage2D::Bind(QT3DSU32 unit)
- {
- if (unit == -1)
- m_TextureUnit = m_Context.GetNextTextureUnit();
- else
- m_TextureUnit = unit;
-
- STextureDetails theDetails(m_Texture2D->GetTextureDetails());
-
- // note it is the callers responsibility that the texture format is supported by the compute
- // shader
- m_Backend->BindImageTexture(m_Texture2D->GetTextureObjectHandle(), m_TextureUnit,
- m_TextureLevel, false, 0, m_AccessType, theDetails.m_Format);
- }
-
- NVRenderBackend::NVRenderBackendTextureObject NVRenderImage2D::GetTextureObjectHandle()
- {
- return m_Texture2D->GetTextureObjectHandle();
- }
-
- NVRenderImage2D *NVRenderImage2D::Create(NVRenderContextImpl &context,
- NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess)
- {
- if (inTexture)
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderImage2D)(context, context.GetFoundation(), inTexture, inAccess);
- else
- return NULL;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.h
deleted file mode 100644
index 8b3469b0..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderImageTexture.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_IMAGE_TEXTURE_H
-#define QT3DS_RENDER_QT3DS_RENDER_IMAGE_TEXTURE_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
- class NVRenderTexture2D;
-
- // a wrapper class for NVRenderTexture2D
- // to use with compute shaders and load / store image shaders
-
- class NVRenderImage2D : public NVRefCounted
- {
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderTexture2D *m_Texture2D; ///< pointer to texture
- QT3DSI32 m_TextureUnit; ///< texture unit this texture should use
- NVRenderImageAccessType::Enum
- m_AccessType; ///< texture / image access type ( read, write, read_write )
- QT3DSU32 m_TextureLevel; ///< texture level we use for this image
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] inTexture Pointer to a NVRenderTexture2D object
- * @param[in] inAccess Image access type ( read, write, read_write )
- *
- * @return No return.
- */
- NVRenderImage2D(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTexture2D *inTexture, NVRenderImageAccessType::Enum inAccess);
-
- virtual ~NVRenderImage2D();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief Set the access rights within the shader.
- * Can be read, write or read_write.
- *
- * @param[in] inAccess Image access type ( read, write, read_write )
- *
- * @return No return.
- */
- virtual void SetAccessType(NVRenderImageAccessType::Enum inAccess)
- {
- m_AccessType = inAccess;
- }
-
- /**
- * @brief Set the texture level we use for this image
- *
- * @param[in] inLevel texture level ( must be in range of max levels )
- *
- * @return No return.
- */
- virtual void SetTextureLevel(QT3DSI32 inLevel);
-
- /**
- * @brief Get texture unit used
- *
- *
- * @return texture unit bound to.
- */
- virtual QT3DSU32 GetTextureUnit() const { return m_TextureUnit; }
-
- /**
- * @brief Bind a texture for shader access
- *
- * @param[in] unit The binding point
- *
- * @return No return.
- */
- virtual void Bind(QT3DSU32 unit);
-
- /**
- * @brief get the backend object handle
- * here we return the handle from the wrapped texture
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendTextureObject GetTextureObjectHandle();
-
- /**
- * @brief static creation function
- *
- * @param[in] context Pointer to context
- * @param[in] inTexture Pointer to a NVRenderTexture2D object
- * @param[in] inAccess Image access type ( read, write, read_write )
- *
- * @return No return.
- */
- static NVRenderImage2D *Create(NVRenderContextImpl &context, NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.cpp
deleted file mode 100644
index 37f56bd2..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderIndexBuffer::NVRenderIndexBuffer(NVRenderContextImpl &context, size_t size,
- NVRenderComponentTypes::Enum componentType,
- NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data)
- : NVRenderDataBuffer(context, context.GetFoundation(), size,
- NVRenderBufferBindValues::Index, usageType, data)
- , m_ComponentType(componentType)
- {
- }
-
- NVRenderIndexBuffer::~NVRenderIndexBuffer() { m_Context.BufferDestroyed(*this); }
-
- QT3DSU32 NVRenderIndexBuffer::GetNumIndices() const
- {
- QT3DSU32 dtypeSize = NVRenderComponentTypes::getSizeofType(m_ComponentType);
- return m_BufferCapacity / dtypeSize;
- }
-
- void NVRenderIndexBuffer::Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 count, QT3DSU32 offset)
- {
- m_Backend->DrawIndexed(
- drawMode, count, m_ComponentType,
- (const void *)(offset * NVRenderComponentTypes::getSizeofType(m_ComponentType)));
- }
-
- void NVRenderIndexBuffer::DrawIndirect(NVRenderDrawMode::Enum drawMode, QT3DSU32 offset)
- {
- m_Backend->DrawIndexedIndirect(drawMode, m_ComponentType, (const void *)offset);
- }
-
- void NVRenderIndexBuffer::Bind()
- {
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to Bind a locked buffer");
- QT3DS_ASSERT(false);
- }
-
- m_Backend->BindBuffer(m_BufferHandle, m_BindFlags);
- }
-
- NVRenderIndexBuffer *NVRenderIndexBuffer::Create(NVRenderContextImpl &context,
- NVRenderBufferUsageType::Enum usageType,
- NVRenderComponentTypes::Enum componentType,
- size_t size, NVConstDataRef<QT3DSU8> bufferData)
- {
- NVFoundationBase &fnd(context.GetFoundation());
- if (componentType != NVRenderComponentTypes::QT3DSU32
- && componentType != NVRenderComponentTypes::QT3DSU16
- && componentType != NVRenderComponentTypes::QT3DSU8) {
- qCCritical(INVALID_PARAMETER, "Invalid component type for index buffer");
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- QT3DSU32 ibufSize = sizeof(NVRenderIndexBuffer);
- QT3DSU8 *baseMem = (QT3DSU8 *)QT3DS_ALLOC(fnd.getAllocator(), ibufSize, "IndexBuffer");
- NVRenderIndexBuffer *retval = new (baseMem) NVRenderIndexBuffer(
- context, size, componentType, usageType,
- toDataRef(const_cast<QT3DSU8 *>(bufferData.begin()), bufferData.size()));
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.h
deleted file mode 100644
index 6b9c4711..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderIndexBuffer.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_INDEX_BUFFER_H
-#define QT3DS_RENDER_INDEX_BUFFER_H
-#include "render/Qt3DSRenderDataBuffer.h"
-#include "render/Qt3DSRenderDrawable.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
-
- class NVRenderIndexBuffer : public NVRenderDataBuffer, public NVRenderDrawable
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] componentType Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return.
- */
- NVRenderIndexBuffer(NVRenderContextImpl &context, size_t size,
- NVRenderComponentTypes::Enum componentType,
- NVRenderBufferUsageType::Enum usageType, NVDataRef<QT3DSU8> data);
-
- ///< destruvtor
- ~NVRenderIndexBuffer();
-
- /**
- * @brief get the component type (QT3DSU8, QT3DSU16)
- *
- * @return the component type
- */
- virtual NVRenderComponentTypes::Enum GetComponentType() const { return m_ComponentType; }
-
- /**
- * @brief get the index count
- *
- * @return actual index count
- */
- virtual QT3DSU32 GetNumIndices() const;
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- void Bind() override;
-
- /**
- * @brief draw the buffer
- *
- * @param[in] drawMode draw mode (e.g Triangles...)
- * @param[in] count vertex count
- * @param[in] offset start offset in byte
- *
- * @return no return.
- */
- void Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 count, QT3DSU32 offset) override;
-
- /**
- * @brief draw the buffer via indirec draw buffer setup
- *
- * @param[in] drawMode draw mode (e.g Triangles...)
- * @param[in] offset byte offset into the bound drawIndirectBuffer see
- * NVRenderDrawIndirectBuffer
- *
- * @return no return.
- */
- virtual void DrawIndirect(NVRenderDrawMode::Enum drawMode, QT3DSU32 offset);
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const override
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
-
- static NVRenderIndexBuffer *Create(NVRenderContextImpl &context,
- NVRenderBufferUsageType::Enum usageType,
- NVRenderComponentTypes::Enum componentType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData);
-
- private:
- NVRenderComponentTypes::Enum m_ComponentType; ///< component type (QT3DSU8, QT3DSU16)
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.cpp
deleted file mode 100644
index e4d38b9d..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderInputAssembler.h"
-#include "render/Qt3DSRenderAttribLayout.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- ///< constructor
- NVRenderInputAssembler::NVRenderInputAssembler(
- NVRenderContextImpl &context, NVRenderAttribLayout *attribLayout,
- NVConstDataRef<NVRenderVertexBuffer *> buffers, const NVRenderIndexBuffer *indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets,
- NVRenderDrawMode::Enum primType, QT3DSU32 patchVertexCount)
- : m_Context(context)
- , m_Foundation(context.GetFoundation())
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_AttribLayout(attribLayout)
- , m_VertexBuffers(context.GetAllocator(), "m_VertexBuffers")
- , m_IndexBuffer(indexBuffer)
- , m_PrimitiveType(primType)
- , m_PatchVertexCount(patchVertexCount)
- {
- // we cannot currently attach more than 16 vertex buffers
- QT3DS_ASSERT(buffers.size() < 16);
- // if primitive is "Patch" we need a patch per vertex count > 0
- QT3DS_ASSERT(m_PrimitiveType != NVRenderDrawMode::Patches || m_PatchVertexCount > 1);
-
- QT3DSU32 entrySize = sizeof(NVRenderBackend::NVRenderBackendBufferObject) * buffers.size();
- NVRenderBackend::NVRenderBackendBufferObject *bufferHandle =
- (NVRenderBackend::NVRenderBackendBufferObject *)QT3DS_ALLOC(
- m_Foundation.getAllocator(), entrySize, "NVRenderInputAssembler");
- // setup vertex buffer backend handle array
- QT3DS_FOREACH(idx, buffers.size())
- {
- m_VertexBuffers.push_back(buffers.mData[idx]);
- bufferHandle[idx] = buffers.mData[idx]->GetBuffertHandle();
- };
-
- m_VertexbufferHandles = toConstDataRef(bufferHandle, buffers.size());
-
- m_InputAssemblertHandle = m_Backend->CreateInputAssembler(
- m_AttribLayout->GetAttribLayoutHandle(), m_VertexbufferHandles,
- (m_IndexBuffer) ? m_IndexBuffer->GetBuffertHandle() : NULL, strides, offsets,
- patchVertexCount);
-
- attribLayout->addRef();
- }
-
- ///< destructor
- NVRenderInputAssembler::~NVRenderInputAssembler()
- {
- m_AttribLayout->release();
-
- if (m_InputAssemblertHandle) {
- m_Backend->ReleaseInputAssembler(m_InputAssemblertHandle);
- }
-
- QT3DS_FREE(m_Foundation.getAllocator(), (void *)m_VertexbufferHandles.mData);
- }
-
- QT3DSU32 NVRenderInputAssembler::GetIndexCount() const
- {
- return (m_IndexBuffer) ? m_IndexBuffer->GetNumIndices() : 0;
- }
-
- QT3DSU32 NVRenderInputAssembler::GetVertexCount() const
- {
- // makes only sense if we have a single vertex buffer
- QT3DS_ASSERT(m_VertexBuffers.size() == 1);
-
- return m_VertexBuffers[0]->GetNumVertexes();
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.h
deleted file mode 100644
index adac4c42..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderInputAssembler.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_INPUT_ASSEMBLER_H
-#define QT3DS_RENDER_INPUT_ASSEMBLER_H
-
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Utils.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- // forward declarations
- class NVRenderContextImpl;
- class NVRenderBackend;
- class NVRenderAttribLayout;
-
- ///< this class handles the vertex attribute layout setup
- class NVRenderInputAssembler : public NVRefCounted
- {
- public:
- /**
- * @brief constructor
- *
- * NOTE: The limit for buffers count is currently 16
- *
- * @param[in] context Pointer to context
- * @param[in] attribLayout Pointer to NVRenderAttribLayout object
- * @param[in] buffers list of vertex buffers
- * @param[in] indexBuffer pointer to index buffer. Can be NULL
- * @param[in] strides list of strides of the buffer
- * @param[in] offsets list of offsets into the buffer
- * @param[in] primType primitive type used for drawing
- * @param[in] patchVertexCount if primitive is "Patch" this is the vertex count for a
- *single patch
- *
- * @return No return.
- */
- NVRenderInputAssembler(NVRenderContextImpl &context, NVRenderAttribLayout *attribLayout,
- NVConstDataRef<NVRenderVertexBuffer *> buffers,
- const NVRenderIndexBuffer *indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets,
- NVRenderDrawMode::Enum primType = NVRenderDrawMode::Triangles,
- QT3DSU32 patchVertexCount = 1);
- ///< destructor
- ~NVRenderInputAssembler();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendInputAssemblerObject GetInputAssemblerHandle() const
- {
- return m_InputAssemblertHandle;
- }
-
- /**
- * @brief get the attached index buffer
- *
- * @return the index buffer
- */
- const NVRenderIndexBuffer *GetIndexBuffer() { return m_IndexBuffer; }
-
- /**
- * @brief get the index count of the attached index buffer (if any)
- *
- * @return the index buffer count
- */
- QT3DSU32 GetIndexCount() const;
-
- /**
- * @brief get the vertex count of the buffer
- * Note this makes only sense if we have a single
- * interleaved buffer
- *
- * @return the vertex buffer count
- */
- QT3DSU32 GetVertexCount() const;
-
- /**
- * @brief get the primitive type used for drawing
- *
- * @return primitive type
- */
- NVRenderDrawMode::Enum GetPrimitiveType() const { return m_PrimitiveType; }
-
- /**
- * @brief set the per vertex patch count
- *
- * @return none
- */
- void SetPatchVertexCount(QT3DSU32 count)
- {
- if (count != m_PatchVertexCount) {
- // clamp to 1;
- m_PatchVertexCount = (count == 0) ? 1 : count;
- ;
- m_Backend->SetPatchVertexCount(m_InputAssemblertHandle, m_PatchVertexCount);
- }
- }
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
-
- NVRenderAttribLayout *m_AttribLayout; ///< pointer to attribute layout
- nvvector<NVRenderVertexBuffer *> m_VertexBuffers; ///< vertex buffers
- const NVRenderIndexBuffer *m_IndexBuffer; ///< index buffer
- NVConstDataRef<NVRenderBackend::NVRenderBackendBufferObject>
- m_VertexbufferHandles; ///< opaque vertex buffer backend handles
-
- NVRenderBackend::NVRenderBackendInputAssemblerObject
- m_InputAssemblertHandle; ///< opaque backend handle
- NVRenderDrawMode::Enum m_PrimitiveType; ///< primitive type used for drawing
- QT3DSU32 m_PatchVertexCount; ///< vertex count if primitive type is patch
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.cpp
deleted file mode 100644
index d1b62d4c..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderOcclusionQuery.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderOcclusionQuery::NVRenderOcclusionQuery(NVRenderContextImpl &context,
- NVFoundationBase &fnd)
- : NVRenderQueryBase(context, fnd)
- {
- }
-
- NVRenderOcclusionQuery::~NVRenderOcclusionQuery() {}
-
- void NVRenderOcclusionQuery::Begin()
- {
- m_Backend->BeginQuery(m_QueryHandle, NVRenderQueryType::Samples);
- }
-
- void NVRenderOcclusionQuery::End()
- {
- m_Backend->EndQuery(m_QueryHandle, NVRenderQueryType::Samples);
- }
-
- void NVRenderOcclusionQuery::GetResult(QT3DSU32 *params)
- {
- m_Backend->GetQueryResult(m_QueryHandle, NVRenderQueryResultType::Result, params);
- }
-
- bool NVRenderOcclusionQuery::GetResultAvailable()
- {
- QT3DSU32 param;
-
- m_Backend->GetQueryResult(m_QueryHandle, NVRenderQueryResultType::ResultAvailable, &param);
-
- return (param == 1);
- }
-
- NVRenderOcclusionQuery *NVRenderOcclusionQuery::Create(NVRenderContextImpl &context)
- {
- if (!context.IsSampleQuerySupported())
- return NULL;
-
- NVRenderOcclusionQuery *retval =
- QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderOcclusionQuery)(context, context.GetFoundation());
-
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.h
deleted file mode 100644
index 04f64e97..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderOcclusionQuery.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_OCCLUSION_QUERY_H
-#define QT3DS_RENDER_OCCLUSION_QUERY_H
-
-#include "render/Qt3DSRenderQueryBase.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
-
- class NVRenderOcclusionQuery : public NVRenderQueryBase
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderOcclusionQuery(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- ///< destructor
- ~NVRenderOcclusionQuery();
-
- /**
- * @brief Get query type
- *
- * @return Return query type
- */
- NVRenderQueryType::Enum GetQueryType() const override
- {
- return NVRenderQueryType::Samples;
- }
-
- /**
- * @brief Get a pointer to the foundation
- *
- * @return pointer to foundation
- */
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- /**
- * @brief begin a query
- *
- * @return no return.
- */
- void Begin() override;
-
- /**
- * @brief end a query
- *
- * @return no return.
- */
- void End() override;
-
- /**
- * @brief Get the result of a query
- *
- * @param[out] params Contains result of query regarding query type
- *
- * @return no return.
- */
- void GetResult(QT3DSU32 *params) override;
-
- /**
- * @brief query if a result is available
- *
- *
- * @return true if available.
- */
- virtual bool GetResultAvailable();
-
- /*
- * @brief static creation function
- *
- * * @return a occlusion query object on success
- */
- static NVRenderOcclusionQuery *Create(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.cpp
deleted file mode 100644
index 3e9276aa..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderPathFontSpecification.h"
-#include "render/Qt3DSRenderPathFontText.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderPathFontSpecification::NVRenderPathFontSpecification(NVRenderContextImpl &context,
- NVFoundationBase &fnd,
- CRegisteredString fontName)
- : m_Context(context)
- , m_Foundation(fnd)
- , m_Backend(context.GetBackend())
- , mRefCount(0)
- , m_NumFontGlyphs(0)
- , m_EmScale(2048) // 2048 is default true type scale
- , m_Type(NVRenderPathFormatType::UByte)
- , m_TransformType(NVRenderPathTransformType::Translate2D)
- , m_FontName(fontName)
- {
- }
-
- NVRenderPathFontSpecification::~NVRenderPathFontSpecification()
- {
- m_Context.ReleasePathFontSpecification(*this);
- }
-
- void NVRenderPathFontSpecification::LoadPathGlyphs(const char *fontName,
- NVRenderPathFormatType::Enum type)
- {
- // check if we already created it
- if (m_NumFontGlyphs)
- return;
-
- m_Type = type;
-
- // create fonts based on the input
- m_PathRenderHandle = m_Backend->LoadPathGlyphsIndexedRange(
- NVRenderPathFontTarget::FileFont, fontName, NVRenderPathFontStyleFlags(), 0, m_EmScale,
- &m_NumFontGlyphs);
-
- // Fallback in case the previuos call fails
- // This is a no-op if the previous call succeeds
- // Note that sans is an inbuild driver font
- if (!m_PathRenderHandle) {
- m_PathRenderHandle = m_Backend->LoadPathGlyphsIndexedRange(
- NVRenderPathFontTarget::SystemFont, "Arial", NVRenderPathFontStyleFlags(), 0,
- m_EmScale, &m_NumFontGlyphs);
- }
-
- // we should have some glyphs
- QT3DS_ASSERT(m_NumFontGlyphs);
- }
-
- void
- NVRenderPathFontSpecification::StencilFillPathInstanced(NVRenderPathFontItem &inPathFontItem)
- {
- const void *glyphIDs = inPathFontItem.GetGlyphIDs();
- const QT3DSF32 *spacing = inPathFontItem.GetSpacing();
- if (!glyphIDs || !spacing || !inPathFontItem.GetGlyphsCount()) {
- QT3DS_ASSERT(false || !inPathFontItem.GetGlyphsCount());
- return;
- }
-
- m_Backend->StencilFillPathInstanced(m_PathRenderHandle, inPathFontItem.GetGlyphsCount(),
- m_Type, glyphIDs, NVRenderPathFillMode::Fill, 0xFF,
- m_TransformType, spacing);
- }
-
- void NVRenderPathFontSpecification::CoverFillPathInstanced(NVRenderPathFontItem &inPathFontItem)
- {
- const void *glyphIDs = inPathFontItem.GetGlyphIDs();
- const QT3DSF32 *spacing = inPathFontItem.GetSpacing();
- if (!glyphIDs || !spacing || !inPathFontItem.GetGlyphsCount()) {
- QT3DS_ASSERT(false || !inPathFontItem.GetGlyphsCount());
- return;
- }
-
- m_Backend->CoverFillPathInstanced(
- m_PathRenderHandle, inPathFontItem.GetGlyphsCount(), m_Type, glyphIDs,
- NVRenderPathCoverMode::BoundingBoxOfBoundingBox, m_TransformType, spacing);
- }
-
- QT3DSU32
- NVRenderPathFontSpecification::getSizeofType(NVRenderPathFormatType::Enum type)
- {
- switch (type) {
- case NVRenderPathFormatType::Byte:
- return sizeof(QT3DSI8);
- case NVRenderPathFormatType::UByte:
- return sizeof(QT3DSU8);
- case NVRenderPathFormatType::Bytes2:
- return sizeof(QT3DSU16);
- case NVRenderPathFormatType::Uint:
- return sizeof(QT3DSU32);
- case NVRenderPathFormatType::Utf8:
- return sizeof(QT3DSU32);
- default:
- QT3DS_ASSERT(false);
- return 1;
- }
- }
-
- NVRenderPathFontSpecification *
- NVRenderPathFontSpecification::CreatePathFontSpecification(NVRenderContextImpl &context,
- CRegisteredString fontName)
- {
- QT3DS_ASSERT(context.IsPathRenderingSupported());
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderPathFontSpecification)(context, context.GetFoundation(), fontName);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.h
deleted file mode 100644
index dad3f6bb..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontSpecification.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/ #pragma once
-#ifndef QT3DS_RENDER_PATH_FONT_SPECIFICATION_H
-#define QT3DS_RENDER_PATH_FONT_SPECIFICATION_H
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/StringTable.h"
-#include "EASTL/string.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
- namespace qt3ds
-{
- namespace render {
-
- using namespace foundation;
-
- class NVRenderContextImpl;
- class NVRenderPathRender;
- class NVRenderPathFontItem;
-
- class NVRenderPathFontSpecification : public NVRefCounted
- {
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- NVRenderBackend *m_Backend; ///< pointer to backend
- volatile QT3DSI32
- mRefCount; ///< Using foundations' naming convention to ease implementation
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] fontName Name of font ( may include path
- * )
- *
- * @return No return.
- */
- NVRenderPathFontSpecification(NVRenderContextImpl &context, NVFoundationBase &fnd,
- CRegisteredString fontName);
-
- /// @NVRenderPathSpecification destructor
- ~NVRenderPathFontSpecification();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief Load numGlyphs glyphs from specified font file
- *
- * @param[in] pathBase Base of path objects
- * @param[in] fontName Name of font ( may include path
- * )
- * @param[in] numGlyphs Glyph count
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes character string
- *
- * @return No return
- */
- virtual void LoadPathGlyphs(const char *fontName, NVRenderPathFormatType::Enum type);
-
- /**
- * @brief Render a stencil fill pass for fonts
- *
- * @param[in] inPathFontSpec Pointer to NVRenderPathFontSpecification
- *
- * @return no return
- */
- void StencilFillPathInstanced(NVRenderPathFontItem &inPathFontItem);
-
- /**
- * @brief Render a cover fill pass for fonts
- *
- * @param[in] inPathFontSpec Pointer to NVRenderPathFontSpecification
- *
- * @return no return
- */
- void CoverFillPathInstanced(NVRenderPathFontItem &inPathFontItem);
-
- /**
- * @brief get type for font path set
- *
- * @return path font type
- */
- NVRenderPathFormatType::Enum GetPathFontType() { return m_Type; }
-
- /**
- * @brief get font glyph count
- *
- * @return get glyph count
- */
- QT3DSU32 GetFontGlyphsCount() { return m_NumFontGlyphs; }
-
- /**
- * @brief get spacing for char set
- *
- * @return spacing array
- */
- QT3DSF32 GetEmScale() const { return m_EmScale; }
-
- /**
- * @brief Get font name
- *
- * @return name set
- */
- CRegisteredString GetFontName() const { return m_FontName; }
-
- private:
- QT3DSU32 m_NumFontGlyphs; ///< glyph count of the entire font set
- QT3DSF32 m_EmScale; ///< true type scale
- NVRenderPathFormatType::Enum m_Type; ///< type ( byte, int,... )
- NVRenderPathTransformType::Enum m_TransformType; ///< transform type default 2D
- CRegisteredString m_FontName; ///< Name of Font
- NVRenderBackend::NVRenderBackendPathObject
- m_PathRenderHandle; ///< opaque backend handle
-
- private:
- /**
- * @brief Get size of type
- *
- * @param[in] type type ( byte, int,... )
- *
- * @return true if successful
- */
- QT3DSU32 getSizeofType(NVRenderPathFormatType::Enum type);
-
- public:
- static NVRenderPathFontSpecification *
- CreatePathFontSpecification(NVRenderContextImpl &context, CRegisteredString fontName);
- };
- }
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.cpp
deleted file mode 100644
index aeaad13c..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderPathFontText.h"
-#include "render/Qt3DSRenderPathFontSpecification.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderPathRender.h"
-
-namespace qt3ds {
-namespace render {
-
- // see NVprSDK for explanation
- // Math from page 54-56 of "Digital Image Warping" by George Wolberg,
- // though credited to Paul Heckert's "Fundamentals of Texture
- // Mapping and Image Warping" 1989 Master's thesis.
- static QT3DSMat33 mapSquareToQuad(QT3DSVec2 inSquare[4])
- {
- QT3DSMat33 ret;
-
- QT3DSVec2 d1(inSquare[1] - inSquare[2]);
- QT3DSVec2 d2(inSquare[3] - inSquare[2]);
- QT3DSVec2 d3(inSquare[0] - inSquare[1] + inSquare[2] - inSquare[3]);
-
- QT3DSF32 denom = d1.x * d2.y - d2.x * d1.y;
- if (denom == 0.0) {
- return QT3DSMat33::createIdentity();
- }
-
- ret[2][0] = (d3.x * d2.y - d2.x * d3.y) / denom;
- ret[2][1] = (d1.x * d3.y - d3.x * d1.y) / denom;
- ret[2][2] = 1.0;
- ret[0][0] = inSquare[1].x - inSquare[0].x + ret[2][0] * inSquare[1].x;
- ret[1][0] = inSquare[1].y - inSquare[0].y + ret[2][0] * inSquare[1].y;
- ret[0][1] = inSquare[3].x - inSquare[0].x + ret[2][1] * inSquare[3].x;
- ret[1][1] = inSquare[3].y - inSquare[0].y + ret[2][1] * inSquare[3].y;
- ret[0][2] = inSquare[0].x;
- ret[1][2] = inSquare[0].y;
-
- return ret;
- }
-
- static QT3DSMat33 mapQuadToSquare(QT3DSVec2 inSquare[4])
- {
- return mapSquareToQuad(inSquare).getInverse();
- }
-
- static QT3DSMat33 mapQuadToQuad(QT3DSVec2 fromSquare[4], QT3DSVec2 toSquare[4])
- {
- return (mapSquareToQuad(toSquare) * mapQuadToSquare(fromSquare));
- }
-
- static QT3DSMat44 mapBoxToQuad(QT3DSVec4 inBox, QT3DSVec2 inSquare[4])
- {
- QT3DSVec2 fromSquare[4] = { QT3DSVec2(inBox.x, inBox.y), QT3DSVec2(inBox.z, inBox.y),
- QT3DSVec2(inBox.z, inBox.w), QT3DSVec2(inBox.x, inBox.w) };
-
- QT3DSMat33 ret = mapQuadToQuad(fromSquare, inSquare);
-
- return QT3DSMat44(ret.column0, ret.column1, ret.column2, QT3DSVec3(0.0, 0.0, 0.0));
- }
-
- NVRenderPathFontItem::NVRenderPathFontItem(NVFoundationBase &fnd)
- : m_Foundation(fnd)
- , mRefCount(0)
- , m_NumGlyphs(0)
- , m_GlyphIDs(NULL)
- , m_TranslateXY(NULL)
- {
- }
-
- NVRenderPathFontItem::~NVRenderPathFontItem()
- {
- if (m_TranslateXY)
- QT3DS_FREE(m_Foundation.getAllocator(), m_TranslateXY);
- if (m_GlyphIDs)
- QT3DS_FREE(m_Foundation.getAllocator(), m_GlyphIDs);
- }
-
- void NVRenderPathFontItem::InitTextItem(size_t glyphCount, const QT3DSU32 *glyphIDs,
- NVRenderPathFormatType::Enum type, QT3DSF32 *posArray,
- QT3DSVec2 pixelBound, QT3DSVec2 logicalBound, QT3DSF32 emScale)
- {
- m_NumGlyphs = glyphCount;
-
- // allocate glyphs array
- if (m_GlyphIDs)
- QT3DS_FREE(m_Foundation.getAllocator(), m_GlyphIDs);
-
- // allocate position array
- if (m_TranslateXY)
- QT3DS_FREE(m_Foundation.getAllocator(), m_TranslateXY);
-
- m_GlyphIDs = (QT3DSU32 *)QT3DS_ALLOC(m_Foundation.getAllocator(),
- glyphCount * getSizeofType(type), "NVRenderPathFontItem");
- m_TranslateXY =
- (QT3DSF32 *)QT3DS_ALLOC(m_Foundation.getAllocator(), 2 * (glyphCount + 1) * sizeof(QT3DSF32),
- "NVRenderPathFontItem");
-
- if (!m_GlyphIDs || !m_TranslateXY)
- return;
-
- QT3DSU32 *pTheGlyphIDs = (QT3DSU32 *)m_GlyphIDs;
- QT3DSU32 *pInGlyphs = (QT3DSU32 *)glyphIDs;
-
- /// copy glyphs array
- for (size_t i = 0; i < glyphCount; i++) {
- pTheGlyphIDs[i] = pInGlyphs[i];
- }
-
- // copy position array
- // we copy what we got from our layout system
- if (posArray != NULL) {
- for (size_t i = 0, k = 0; i < glyphCount * 2; i += 2, k++) {
- m_TranslateXY[i] = posArray[i] * emScale;
- m_TranslateXY[i + 1] = posArray[i + 1] * emScale;
- }
- }
-
- // setup transform
- QT3DSVec2 square[4] = { QT3DSVec2(0.0, 0.0), QT3DSVec2(pixelBound.x, 0.0),
- QT3DSVec2(pixelBound.x, pixelBound.y), QT3DSVec2(0.0, pixelBound.y) };
- QT3DSVec4 box(0.0, 0.0, logicalBound.x * emScale, logicalBound.y * emScale);
-
- m_ModelMatrix = mapBoxToQuad(box, square);
- }
-
- const QT3DSMat44 NVRenderPathFontItem::GetTransform()
- {
- return QT3DSMat44(QT3DSVec4(m_ModelMatrix[0][0], m_ModelMatrix[1][0], 0.0, m_ModelMatrix[2][0]),
- QT3DSVec4(m_ModelMatrix[0][1], m_ModelMatrix[1][1], 0.0, m_ModelMatrix[2][1]),
- QT3DSVec4(0.0, 0.0, 1.0, 0.0),
- QT3DSVec4(m_ModelMatrix[0][2], m_ModelMatrix[1][2], 0.0, m_ModelMatrix[2][2]));
- }
-
- QT3DSU32
- NVRenderPathFontItem::getSizeofType(NVRenderPathFormatType::Enum type)
- {
- switch (type) {
- case NVRenderPathFormatType::Byte:
- return sizeof(QT3DSI8);
- case NVRenderPathFormatType::UByte:
- return sizeof(QT3DSU8);
- case NVRenderPathFormatType::Bytes2:
- return sizeof(QT3DSU16);
- case NVRenderPathFormatType::Uint:
- return sizeof(QT3DSU32);
- case NVRenderPathFormatType::Utf8:
- return sizeof(QT3DSU32);
- default:
- QT3DS_ASSERT(false);
- return 1;
- }
- }
-
- NVRenderPathFontItem *NVRenderPathFontItem::CreatePathFontItem(NVRenderContextImpl &context)
- {
- QT3DS_ASSERT(context.IsPathRenderingSupported());
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderPathFontItem)(context.GetFoundation());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.h
deleted file mode 100644
index a1d103ac..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathFontText.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/ #pragma once
-#ifndef QT3DS_RENDER_PATH_FONT_TEXT_H
-#define QT3DS_RENDER_PATH_FONT_TEXT_H
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "EASTL/string.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
- namespace qt3ds
-{
- namespace render {
-
- using namespace foundation;
-
- class NVRenderContextImpl;
- class NVRenderPathFontSpecification;
-
- class NVRenderPathFontItem : public NVRefCounted
- {
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32
- mRefCount; ///< Using foundations' naming convention to ease implementation
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderPathFontItem(NVFoundationBase &fnd);
-
- /// @NVRenderPathFontItem destructor
- ~NVRenderPathFontItem();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief Setup text
- *
- * @param[in] glyphCount number of glyphs
- * @param[in] glyphIDs array of glyhp ID's
- * @param[in] type type ( byte, int,... )
- * @param[in] posArray array of glyhp positions
- * @param[in] pixelBound pixel boundary
- * @param[in] logicalBound logical boundary
- * @param[in] emScale true type scale
- *
- * @return No return.
- */
- void InitTextItem(size_t glyphCount, const QT3DSU32 *glyphIDs,
- NVRenderPathFormatType::Enum type, QT3DSF32 *posArray, QT3DSVec2 pixelBound,
- QT3DSVec2 logicalBound, QT3DSF32 emScale);
-
- /**
- * @brief get glyph count
- *
- * @return get glyph count
- */
- size_t GetGlyphsCount() { return m_NumGlyphs; }
-
- /**
- * @brief get spacing for char set
- *
- * @return spacing array
- */
- const QT3DSF32 *GetSpacing() { return m_TranslateXY; }
-
- /**
- * @brief get name set
- *
- * @return name set
- */
- const void *GetGlyphIDs() { return (void *)m_GlyphIDs; }
-
- /**
- * @brief Get Y bound of font metric
- *
- * @return transform matrix
- */
- const QT3DSMat44 GetTransform();
-
- private:
- /**
- * @brief Get size of type
- *
- * @param[in] type type ( byte, int,... )
- *
- * @return true if successful
- */
- QT3DSU32 getSizeofType(NVRenderPathFormatType::Enum type);
-
- private:
- size_t m_NumGlyphs; ///< glyph count
- QT3DSU32 *m_GlyphIDs; ///< array glyph ID's
- QT3DSF32 *
- m_TranslateXY; ///< pointer to arrray for character advance information like kerning
- QT3DSMat44 m_ModelMatrix; ///< Matrix which converts from font space to box space
-
- public:
- static NVRenderPathFontItem *CreatePathFontItem(NVRenderContextImpl &context);
- };
- }
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.cpp
deleted file mode 100644
index 42982498..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderPathRender.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderPathSpecification.h"
-#include "render/Qt3DSRenderPathFontSpecification.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderPathRender::NVRenderPathRender(NVRenderContextImpl &context, NVFoundationBase &fnd,
- size_t range)
- : m_Context(context)
- , m_Foundation(fnd)
- , m_Backend(context.GetBackend())
- , mRefCount(0)
- , m_StrokeWidth(0.0f)
- {
- m_Range = range;
- m_PathRenderHandle = m_Backend->CreatePathNVObject(range);
- }
-
- NVRenderPathRender::~NVRenderPathRender()
- {
- if (m_PathRenderHandle) {
- m_Backend->ReleasePathNVObject(m_PathRenderHandle, m_Range);
- }
- }
-
- void NVRenderPathRender::SetPathSpecification(NVRenderPathSpecification &inCommandBuffer)
- {
- m_Backend->SetPathSpecification(m_PathRenderHandle, inCommandBuffer.GetPathCommands(),
- inCommandBuffer.GetPathCoords());
- }
-
- NVBounds3 NVRenderPathRender::GetPathObjectBoundingBox()
- {
- return m_Backend->GetPathObjectBoundingBox(m_PathRenderHandle);
- }
-
- NVBounds3 NVRenderPathRender::GetPathObjectFillBox()
- {
- return m_Backend->GetPathObjectFillBox(m_PathRenderHandle);
- }
-
- NVBounds3 NVRenderPathRender::GetPathObjectStrokeBox()
- {
- return m_Backend->GetPathObjectStrokeBox(m_PathRenderHandle);
- }
-
- void NVRenderPathRender::SetStrokeWidth(QT3DSF32 inStrokeWidth)
- {
- if (inStrokeWidth != m_StrokeWidth) {
- m_StrokeWidth = inStrokeWidth;
- m_Backend->SetStrokeWidth(m_PathRenderHandle, inStrokeWidth);
- }
- }
-
- QT3DSF32 NVRenderPathRender::GetStrokeWidth() const { return m_StrokeWidth; }
-
- void NVRenderPathRender::StencilStroke() { m_Backend->StencilStrokePath(m_PathRenderHandle); }
-
- void NVRenderPathRender::StencilFill() { m_Backend->StencilFillPath(m_PathRenderHandle); }
-
- NVRenderPathRender *NVRenderPathRender::Create(NVRenderContextImpl &context, size_t range)
- {
- if (!context.IsPathRenderingSupported())
- return NULL;
-
- NVRenderPathRender *retval =
- QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderPathRender)(context, context.GetFoundation(), range);
-
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.h
deleted file mode 100644
index c261ca31..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathRender.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PATH_RENDER_H
-#define QT3DS_RENDER_PATH_RENDER_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "foundation/Qt3DSBounds3.h"
-#include <EASTL/string.h>
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
- class NVRenderPathSpecification;
- class NVRenderPathFontSpecification;
-
- ///< A program pipeline is a collection of a multiple programs (vertex, fragment, geometry,....)
- class NVRenderPathRender : public NVRefCounted
- {
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- NVRenderBackend *m_Backend; ///< pointer to backend
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] range Number of internal objects
- *
- * @return No return.
- */
- NVRenderPathRender(NVRenderContextImpl &context, NVFoundationBase &fnd, size_t range);
-
- /// @brief destructor
- ~NVRenderPathRender();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendPathObject GetPathHandle() { return m_PathRenderHandle; }
-
- // The render context can create a path specification object.
- void SetPathSpecification(NVRenderPathSpecification &inCommandBuffer);
-
- NVBounds3 GetPathObjectBoundingBox();
- NVBounds3 GetPathObjectFillBox();
- NVBounds3 GetPathObjectStrokeBox();
-
- void SetStrokeWidth(QT3DSF32 inStrokeWidth);
- QT3DSF32 GetStrokeWidth() const;
-
- void StencilStroke();
- void StencilFill();
-
- /**
- * @brief static create function
- *
- * @param[in] context Pointer to render context
- * @param[in] range Number of internal objects
- *
- * @return the backend object handle.
- */
- static NVRenderPathRender *Create(NVRenderContextImpl &context, size_t range);
-
- private:
- NVRenderBackend::NVRenderBackendPathObject m_PathRenderHandle; ///< opaque backend handle
- size_t m_Range; ///< range of internal objects
- QT3DSF32 m_StrokeWidth;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.cpp
deleted file mode 100644
index f4b26f11..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderPathSpecification.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderPathSpecification::NVRenderPathSpecification(NVRenderContextImpl &context,
- NVFoundationBase &fnd)
- : m_Context(context)
- , m_Foundation(fnd)
- , m_Backend(context.GetBackend())
- , mRefCount(0)
- , m_PathCommands(fnd.getAllocator(), "m_PathCommands")
- , m_PathCoords(fnd.getAllocator(), "m_PathCoords")
- {
- }
-
- NVRenderPathSpecification::~NVRenderPathSpecification() {}
-
- void NVRenderPathSpecification::Reset()
- {
- m_PathCommands.clear();
- m_PathCoords.clear();
- }
-
- void NVRenderPathSpecification::P(QT3DSVec2 inData)
- {
- m_PathCoords.push_back(inData.x);
- m_PathCoords.push_back(inData.y);
- }
-
- void NVRenderPathSpecification::MoveTo(QT3DSVec2 inPoint)
- {
- // we should actually query the backend for command converesion
- // but will we support any other pather render system than nv path?
- StaticAssert<NVRenderPathCommands::MoveTo == 0x02>::valid_expression();
-
- m_PathCommands.push_back(NVRenderPathCommands::MoveTo);
- P(inPoint);
- }
-
- void NVRenderPathSpecification::CubicCurveTo(QT3DSVec2 inC1, QT3DSVec2 inC2, QT3DSVec2 inDest)
- {
- // we should actually query the backend for command converesion
- // but will we support any other pather render system than nv path?
- StaticAssert<NVRenderPathCommands::CubicCurveTo == 0x0C>::valid_expression();
-
- m_PathCommands.push_back(NVRenderPathCommands::CubicCurveTo);
- P(inC1);
- P(inC2);
- P(inDest);
- }
-
- void NVRenderPathSpecification::ClosePath()
- {
- // we should actually query the backend for command converesion
- // but will we support any other pather render system than nv path?
- StaticAssert<NVRenderPathCommands::Close == 0x00>::valid_expression();
-
- m_PathCommands.push_back(NVRenderPathCommands::Close);
- }
-
- NVRenderPathSpecification *
- NVRenderPathSpecification::CreatePathSpecification(NVRenderContextImpl &context)
- {
- QT3DS_ASSERT(context.IsPathRenderingSupported());
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderPathSpecification)(context, context.GetFoundation());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.h
deleted file mode 100644
index 7c6faeda..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderPathSpecification.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PATH_SPECIFICATION_H
-#define QT3DS_RENDER_PATH_SPECIFICATION_H
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- class NVRenderPathSpecification : public NVRefCounted
- {
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- NVRenderBackend *m_Backend; ///< pointer to backend
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderPathSpecification(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- /// @NVRenderPathSpecification destructor
- ~NVRenderPathSpecification();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief reset commands and coordiantes
- *
- * @return No return.
- */
- virtual void Reset();
-
- /**
- * @brief add new move to command
- *
- * @param[in] inPoint Coordinate
- *
- * @return No return.
- */
- virtual void MoveTo(QT3DSVec2 inPoint);
-
- /**
- * @brief add new cubic curve command
- *
- * @param[in] inC1 control point 1
- * @param[in] inC2 control point 2
- * @param[in] inDest final point
- *
- * @return No return.
- */
- virtual void CubicCurveTo(QT3DSVec2 inC1, QT3DSVec2 inC2, QT3DSVec2 inDest);
-
- /**
- * @brief add new close command
- *
- *
- * @return No return.
- */
- virtual void ClosePath();
-
- /**
- * @brief Get path command list
- *
- *
- * @return path commands
- */
- virtual NVConstDataRef<QT3DSU8> GetPathCommands() { return m_PathCommands; }
-
- /**
- * @brief Get path coordinates list
- *
- *
- * @return path coordinates
- */
- virtual NVConstDataRef<QT3DSF32> GetPathCoords() { return m_PathCoords; }
-
- private:
- nvvector<QT3DSU8> m_PathCommands;
- nvvector<QT3DSF32> m_PathCoords;
-
- /**
- * @brief add a new point to the coordinates
- *
- * @param[in] inPoint Coordinate
- *
- * @return No return.
- */
- void P(QT3DSVec2 inData);
-
- public:
- static NVRenderPathSpecification *CreatePathSpecification(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.cpp
deleted file mode 100644
index b0a9f271..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderProgramPipeline.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderProgramPipeline::NVRenderProgramPipeline(NVRenderContextImpl &context,
- NVFoundationBase &fnd)
- : m_Context(context)
- , m_Foundation(fnd)
- , m_Backend(context.GetBackend())
- , mRefCount(0)
- , m_Program(NULL)
- , m_VertexProgram(NULL)
- , m_FragmentProgram(NULL)
- , m_TessControlProgram(NULL)
- , m_TessEvalProgram(NULL)
- , m_GeometryProgram(NULL)
- , m_ComputProgram(NULL)
- {
- m_ProgramPipelineHandle = m_Backend->CreateProgramPipeline();
- }
-
- NVRenderProgramPipeline::~NVRenderProgramPipeline()
- {
- if (m_ProgramPipelineHandle) {
- m_Backend->ReleaseProgramPipeline(m_ProgramPipelineHandle);
- }
-
- if (m_VertexProgram)
- m_VertexProgram->release();
- if (m_FragmentProgram)
- m_FragmentProgram->release();
- if (m_TessControlProgram)
- m_TessControlProgram->release();
- if (m_TessEvalProgram)
- m_TessEvalProgram->release();
- if (m_GeometryProgram)
- m_GeometryProgram->release();
- }
-
- bool NVRenderProgramPipeline::IsValid() { return (m_ProgramPipelineHandle != NULL); }
-
- void NVRenderProgramPipeline::SetProgramStages(NVRenderShaderProgram *inProgram,
- NVRenderShaderTypeFlags flags)
- {
- bool bDirty = false;
-
- if (flags & NVRenderShaderTypeValue::Vertex && inProgram != m_VertexProgram) {
- if (m_VertexProgram)
- m_VertexProgram->release();
- if (inProgram)
- inProgram->addRef();
- m_VertexProgram = inProgram;
- bDirty = true;
- }
- if (flags & NVRenderShaderTypeValue::Fragment && inProgram != m_FragmentProgram) {
- if (m_FragmentProgram)
- m_FragmentProgram->release();
- if (inProgram)
- inProgram->addRef();
- m_FragmentProgram = inProgram;
- bDirty = true;
- }
- if (flags & NVRenderShaderTypeValue::TessControl && inProgram != m_TessControlProgram) {
- if (m_TessControlProgram)
- m_TessControlProgram->release();
- if (inProgram)
- inProgram->addRef();
- m_TessControlProgram = inProgram;
- bDirty = true;
- }
- if (flags & NVRenderShaderTypeValue::TessEvaluation && inProgram != m_TessEvalProgram) {
- if (m_TessEvalProgram)
- m_TessEvalProgram->release();
- if (inProgram)
- inProgram->addRef();
- m_TessEvalProgram = inProgram;
- bDirty = true;
- }
- if (flags & NVRenderShaderTypeValue::Geometry && inProgram != m_GeometryProgram) {
- if (m_GeometryProgram)
- m_GeometryProgram->release();
- if (inProgram)
- inProgram->addRef();
- m_GeometryProgram = inProgram;
- bDirty = true;
- }
-
- if (bDirty) {
- m_Backend->SetProgramStages(m_ProgramPipelineHandle, flags,
- (inProgram) ? inProgram->GetShaderProgramHandle() : NULL);
- }
- }
-
- void NVRenderProgramPipeline::Bind()
- {
- m_Backend->SetActiveProgramPipeline(m_ProgramPipelineHandle);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.h
deleted file mode 100644
index ce47146a..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderProgramPipeline.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PROGRAM_PIPLINE_H
-#define QT3DS_RENDER_PROGRAM_PIPLINE_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include <EASTL/string.h>
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
- class NVRenderShaderProgram;
-
- ///< A program pipeline is a collection of a multiple programs (vertex, fragment, geometry,....)
- class QT3DS_AUTOTEST_EXPORT NVRenderProgramPipeline : public NVRefCounted
- {
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- NVRenderBackend *m_Backend; ///< pointer to backend
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderProgramPipeline(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- /// @brief destructor
- ~NVRenderProgramPipeline();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief Query if pipeline is valid
- *
- * @return True if valid.
- */
- bool IsValid();
-
- /**
- * @brief enable / disable a program stage in the pipeline
- *
- * @param[in] pProgram Pointer to program. If NULL stage will be disabled
- * @param[in] flags Flags to which stage this program is bound to. Can more than
- * one stage
- *
- * @return no return.
- */
- void SetProgramStages(NVRenderShaderProgram *pProgram, NVRenderShaderTypeFlags flags);
-
- /**
- * @brief Make the program pipeline active
- *
- * @return True if valid.
- */
- void Bind();
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendProgramPipeline GetShaderHandle()
- {
- return m_ProgramPipelineHandle;
- }
-
- /**
- * @brief get the vertex stage program
- *
- * @return the backend object handle.
- */
- NVRenderShaderProgram *GetVertexStage() { return m_VertexProgram; }
-
- private:
- NVRenderBackend::NVRenderBackendProgramPipeline
- m_ProgramPipelineHandle; ///< opaque backend handle
-
- NVRenderShaderProgram
- *m_Program; ///< for non separable programs this contains the entire program
- NVRenderShaderProgram
- *m_VertexProgram; ///< for separable programs this contains the vertex program
- NVRenderShaderProgram
- *m_FragmentProgram; ///< for separable programs this contains the fragment program
- NVRenderShaderProgram *m_TessControlProgram; ///< for separable programs this contains the
- ///tessellation control program
- NVRenderShaderProgram *m_TessEvalProgram; ///< for separable programs this contains the
- ///tessellation evaluation program
- NVRenderShaderProgram
- *m_GeometryProgram; ///< for separable programs this contains the geometry program
- NVRenderShaderProgram
- *m_ComputProgram; ///< for separable programs this contains the compute program
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.cpp
deleted file mode 100644
index f13bc499..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderQueryBase.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSFoundation.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderQueryBase::NVRenderQueryBase(NVRenderContextImpl &context, NVFoundationBase &fnd)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- {
- m_QueryHandle = m_Backend->CreateQuery();
- }
-
- NVRenderQueryBase::~NVRenderQueryBase()
- {
- if (m_QueryHandle)
- m_Backend->ReleaseQuery(m_QueryHandle);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.h
deleted file mode 100644
index 7a7ead87..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderQueryBase.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QUERY_BASE_H
-#define QT3DS_RENDER_QUERY_BASE_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
- class NVRenderBackend;
-
- ///< Base class
- class NVRenderQueryBase : public NVRefCounted
- {
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBackend::NVRenderBackendQueryObject m_QueryHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderQueryBase(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- virtual ~NVRenderQueryBase();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief Get query type
- *
- * @return Return query type
- */
- virtual NVRenderQueryType::Enum GetQueryType() const = 0;
-
- /**
- * @brief Get a pointer to the foundation
- *
- * @return pointer to foundation
- */
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- /**
- * @brief begin a query
- *
- * @return no return.
- */
- virtual void Begin() = 0;
-
- /**
- * @brief end a query
- *
- * @return no return.
- */
- virtual void End() = 0;
-
- /**
- * @brief Get the result of a query
- *
- * @param[out] params Contains result of query regarding query type
- *
- * @return no return.
- */
- virtual void GetResult(QT3DSU32 *params) = 0;
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendQueryObject GetQuerytHandle() const
- {
- return m_QueryHandle;
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.cpp
deleted file mode 100644
index e7daf7f4..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderRasterizerState.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderRasterizerState::NVRenderRasterizerState(NVRenderContextImpl &context,
- NVFoundationBase &fnd, QT3DSF32 depthBias,
- QT3DSF32 depthScale, NVRenderFaces::Enum cullFace)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- {
- // create backend handle
- m_StateHandle = m_Backend->CreateRasterizerState(depthBias, depthScale, cullFace);
- }
-
- NVRenderRasterizerState::~NVRenderRasterizerState()
- {
- if (m_StateHandle) {
- m_Backend->ReleaseRasterizerState(m_StateHandle);
- m_Context.StateDestroyed(*this);
- }
- }
-
- NVRenderRasterizerState *NVRenderRasterizerState::Create(NVRenderContextImpl &context,
- QT3DSF32 depthBias, QT3DSF32 depthScale,
- NVRenderFaces::Enum cullFace)
- {
- return QT3DS_NEW(context.GetFoundation().getAllocator(), NVRenderRasterizerState)(
- context, context.GetFoundation(), depthBias, depthScale, cullFace);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.h
deleted file mode 100644
index 9b71ae42..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRasterizerState.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_RASTERIZER_STATE_H
-#define QT3DS_RENDER_RASTERIZER_STATE_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
-
- // currently this handles only stencil state
- class NVRenderRasterizerState : public NVRefCounted
- {
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBackend::NVRenderBackendRasterizerStateObject
- m_StateHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] depthBias depth bias
- * @param[in] depthScale depth multiplicator
- * @param[in] cullFace which face to cull front or back
- *
- * @return No return.
- */
- NVRenderRasterizerState(NVRenderContextImpl &context, NVFoundationBase &fnd,
- QT3DSF32 depthBias, QT3DSF32 depthScale, NVRenderFaces::Enum cullFace);
-
- virtual ~NVRenderRasterizerState();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendRasterizerStateObject GetRasterizerObjectHandle()
- {
- return m_StateHandle;
- }
-
- static NVRenderRasterizerState *Create(NVRenderContextImpl &context, QT3DSF32 depthBias,
- QT3DSF32 depthScale, NVRenderFaces::Enum cullFace);
-
- private:
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.cpp
deleted file mode 100644
index b682bc1b..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSFoundation.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderRenderBuffer::NVRenderRenderBuffer(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderRenderBufferFormats::Enum format,
- QT3DSU32 width, QT3DSU32 height)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_Width(width)
- , m_Height(height)
- , m_StorageFormat(format)
- , m_BufferHandle(NULL)
- {
- SetDimensions(NVRenderRenderBufferDimensions(width, height));
- }
-
- NVRenderRenderBuffer::~NVRenderRenderBuffer()
- {
- m_Context.RenderBufferDestroyed(*this);
- m_Backend->ReleaseRenderbuffer(m_BufferHandle);
- m_BufferHandle = 0;
- }
-
- void NVRenderRenderBuffer::SetDimensions(const NVRenderRenderBufferDimensions &inDimensions)
- {
- QT3DSU32 maxWidth, maxHeight;
- m_Width = inDimensions.m_Width;
- m_Height = inDimensions.m_Height;
-
- // get max size and clamp to max value
- m_Context.getMaxTextureSize(maxWidth, maxHeight);
- if (m_Width > maxWidth || m_Height > maxHeight) {
- qCCritical(INVALID_OPERATION, "Width or height is greater than max texture size (%d, %d)",
- maxWidth, maxHeight);
- m_Width = NVMin(m_Width, maxWidth);
- m_Height = NVMin(m_Height, maxHeight);
- }
-
- bool success = true;
-
- if (m_BufferHandle == NULL)
- m_BufferHandle = m_Backend->CreateRenderbuffer(m_StorageFormat, m_Width, m_Height);
- else
- success =
- m_Backend->ResizeRenderbuffer(m_BufferHandle, m_StorageFormat, m_Width, m_Height);
-
- if (m_BufferHandle == NULL || !success) {
- // We could try smaller sizes
- QT3DS_ASSERT(false);
- qCCritical(INTERNAL_ERROR, "Unable to create render buffer %s, %dx%d",
- NVRenderRenderBufferFormats::toString(m_StorageFormat), m_Width,
- m_Height);
- }
- }
-}
-}
-
-qt3ds::render::NVRenderRenderBuffer *
-qt3ds::render::NVRenderRenderBuffer::Create(NVRenderContextImpl &context,
- NVRenderRenderBufferFormats::Enum format, QT3DSU32 width,
- QT3DSU32 height)
-{
- NVRenderRenderBuffer *retval = NULL;
- if (width == 0 || height == 0) {
- qCCritical(INVALID_PARAMETER, "Invalid renderbuffer width or height");
- return retval;
- }
-
- retval = QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderRenderBuffer)(context, context.GetFoundation(), format, width, height);
-
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.h
deleted file mode 100644
index 41f4068a..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderRenderBuffer.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_RENDER_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_RENDER_BUFFER_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
- class NVRenderContextImpl;
-
- struct NVRenderRenderBufferDimensions
- {
- QT3DSU32 m_Width; ///< buffer width
- QT3DSU32 m_Height; ///< buffer height
-
- NVRenderRenderBufferDimensions(QT3DSU32 w, QT3DSU32 h)
- : m_Width(w)
- , m_Height(h)
- {
- }
- NVRenderRenderBufferDimensions()
- : m_Width(0)
- , m_Height(0)
- {
- }
- };
-
- class NVRenderRenderBuffer : public NVRefCounted, public NVRenderImplemented
- {
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- QT3DSU32 m_Width; ///< buffer width
- QT3DSU32 m_Height; ///< buffer height
- NVRenderRenderBufferFormats::Enum m_StorageFormat; ///< buffer storage format
-
- NVRenderBackend::NVRenderBackendRenderbufferObject
- m_BufferHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] format Renderbuffer format
- * @param[in] width Renderbuffer width
- * @param[in] height Renderbuffer height
- *
- * @return No return.
- */
- NVRenderRenderBuffer(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderRenderBufferFormats::Enum format, QT3DSU32 width, QT3DSU32 height);
-
- /// destructor
- virtual ~NVRenderRenderBuffer();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- /**
- * @brief query buffer format
- *
- *
- * @return buffer format
- */
- virtual NVRenderRenderBufferFormats::Enum GetStorageFormat() const
- {
- return m_StorageFormat;
- }
-
- /**
- * @brief query buffer dimension
- *
- *
- * @return NVRenderRenderBufferDimensions object
- */
- virtual NVRenderRenderBufferDimensions GetDimensions() const
- {
- return NVRenderRenderBufferDimensions(m_Width, m_Height);
- }
-
- /**
- * @brief constructor
- *
- * @param[in] inDimensions A dimension object
- *
- * @return buffer format
- */
- virtual void SetDimensions(const NVRenderRenderBufferDimensions &inDimensions);
-
- /**
- * @brief static creator function
- *
- * @param[in] context Pointer to context
- * @param[in] format Renderbuffer format
- * @param[in] width Renderbuffer width
- * @param[in] height Renderbuffer height
- *
- * @return No return.
- */
- static NVRenderRenderBuffer *Create(NVRenderContextImpl &context,
- NVRenderRenderBufferFormats::Enum format, QT3DSU32 width,
- QT3DSU32 height);
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendRenderbufferObject GetRenderBuffertHandle()
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.cpp
deleted file mode 100644
index b02fc615..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderSampler.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTextureSampler::NVRenderTextureSampler(
- NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureMinifyingOp::Enum minFilter, NVRenderTextureMagnifyingOp::Enum magFilter,
- NVRenderTextureCoordOp::Enum wrapS, NVRenderTextureCoordOp::Enum wrapT,
- NVRenderTextureCoordOp::Enum wrapR, NVRenderTextureSwizzleMode::Enum swizzleMode,
- QT3DSF32 minLod, QT3DSF32 maxLod, QT3DSF32 lodBias, NVRenderTextureCompareMode::Enum compareMode,
- NVRenderTextureCompareOp::Enum compareFunc, QT3DSF32 anisotropy, QT3DSF32 *borderColor)
- : m_MinFilter(minFilter)
- , m_MagFilter(magFilter)
- , m_WrapS(wrapS)
- , m_WrapT(wrapT)
- , m_WrapR(wrapR)
- , m_SwizzleMode(swizzleMode)
- , m_MinLod(minLod)
- , m_MaxLod(maxLod)
- , m_LodBias(lodBias)
- , m_CompareMode(compareMode)
- , m_CompareOp(compareFunc)
- , m_Anisotropy(anisotropy)
- , m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_SamplerHandle(NULL)
- {
- // create backend handle
- m_SamplerHandle = m_Backend->CreateSampler();
-
- if (borderColor) {
- m_BorderColor[0] = borderColor[0];
- m_BorderColor[1] = borderColor[1];
- m_BorderColor[2] = borderColor[2];
- m_BorderColor[3] = borderColor[3];
- }
- }
-
- NVRenderTextureSampler::~NVRenderTextureSampler()
- {
- if (m_SamplerHandle)
- m_Backend->ReleaseSampler(m_SamplerHandle);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.h
deleted file mode 100644
index 77d3f008..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSampler.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_SAMPLER_H
-#define QT3DS_RENDER_QT3DS_RENDER_SAMPLER_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
-
- class NVRenderTextureSampler
- {
- public:
- NVRenderTextureMinifyingOp::Enum m_MinFilter;
- NVRenderTextureMagnifyingOp::Enum m_MagFilter;
- NVRenderTextureCoordOp::Enum m_WrapS;
- NVRenderTextureCoordOp::Enum m_WrapT;
- NVRenderTextureCoordOp::Enum m_WrapR;
- NVRenderTextureSwizzleMode::Enum m_SwizzleMode;
- QT3DSF32 m_MinLod;
- QT3DSF32 m_MaxLod;
- QT3DSF32 m_LodBias;
- NVRenderTextureCompareMode::Enum m_CompareMode;
- NVRenderTextureCompareOp::Enum m_CompareOp;
- QT3DSF32 m_Anisotropy;
- QT3DSF32 m_BorderColor[4];
-
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] minFilter Texture min filter
- * @param[in] magFilter Texture mag filter
- * @param[in] wrapS Texture coord generation for S
- * @param[in] wrapT Texture coord generation for T
- * @param[in] wrapR Texture coord generation for R
- * @param[in] swizzleMode Texture swizzle mode
- * @param[in] minLod Texture min level of detail
- * @param[in] maxLod Texture max level of detail
- * @param[in] lodBias Texture level of detail bias (unused)
- * @param[in] compareMode Texture compare mode
- * @param[in] compareFunc Texture compare function
- * @param[in] anisoFilter Aniso filter value [1.0, 16.0]
- * @param[in] borderColor Texture border color float[4] (unused)
- *
- * @return No return.
- */
- NVRenderTextureSampler(
- NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle,
- QT3DSF32 minLod = -1000.0, QT3DSF32 maxLod = 1000.0, QT3DSF32 lodBias = 0.0,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0, QT3DSF32 *borderColor = NULL);
-
- /**
- * @brief destructor
- *
- */
- virtual ~NVRenderTextureSampler();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendSamplerObject GetSamplerHandle() const
- {
- return m_SamplerHandle;
- }
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBackend::NVRenderBackendSamplerObject m_SamplerHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShader.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShader.h
deleted file mode 100644
index 8d0a62c4..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShader.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_H
-#define QT3DS_RENDER_SHADER_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include <EASTL/string.h>
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- ///< A shader program is an object composed of a multiple shaders (vertex, fragment,
- ///geometry,....)
- class NVRenderShader
- {
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVConstDataRef<QT3DSI8> m_Source; ///< shader source code
- bool m_Binary; ///< true for binary programs
- eastl::string m_ErrorMessage; ///< contains the error message if linking fails
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram)
- : m_Context(context)
- , m_Foundation(fnd)
- , m_Backend(context.GetBackend())
- , m_Source(source)
- , m_Binary(binaryProgram)
- {
- }
-
- /// @brief destructor
- ~NVRenderShader(){}
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- virtual bool IsValid() = 0;
-
- /**
- * @brief Get Error Message
- *
- * @param[out] messageLength Pointer to error string
- * @param[out] messageLength Size of error meesage
- *
- * @return no return
- */
- virtual void GetErrorMessage(QT3DSI32 *messageLength, const char *errorMessage)
- {
- // Since we do not have any error message just generate a generic one
- if (m_Binary)
- m_ErrorMessage = "Binary shader compilation failed";
-
- *messageLength = m_ErrorMessage.size();
- errorMessage = m_ErrorMessage.c_str();
- }
-
- /**
- * @brief Get Error Message
- *
- *
- * @return error message.
- */
- virtual const char *GetErrorMessage()
- {
- if (m_Binary)
- m_ErrorMessage = "Binary shader compilation failed";
-
- return m_ErrorMessage.c_str();
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderConstant.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderConstant.h
deleted file mode 100644
index 7fb57ffe..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderConstant.h
+++ /dev/null
@@ -1,448 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_CONSTANT_H
-#define QT3DS_RENDER_SHADER_CONSTANT_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSMat33.h"
-#include "foundation/Qt3DSMat44.h"
-#include "EASTL/string.h"
-#include "EASTL/utility.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- ///< forward declarations
- class NVRenderContextImpl;
- class NVRenderConstantBuffer;
-
- ///< A shader constant belongs to a program
- class QT3DS_AUTOTEST_EXPORT NVRenderShaderConstantBase
- {
- public:
- NVRenderBackend *m_Backend; ///< pointer to backend
- CRegisteredString m_Name; ///< register constant name
- QT3DSI32 m_Location; ///< constant index
- QT3DSI32 m_ElementCount; ///< constant element count for arrays
- NVRenderShaderDataTypes::Enum m_Type; ///< constant type
- QT3DSI32 m_Binding; ///< sampler/imnage binding point
-
- public:
- NVRenderShaderConstantBase(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding)
- : m_Backend(backend)
- , m_Name(name)
- , m_Location(location)
- , m_ElementCount(elementCount)
- , m_Type(type)
- , m_Binding(binding)
- {
- }
-
- NVRenderShaderDataTypes::Enum GetShaderConstantType() const { return m_Type; }
-
- virtual void Release() = 0;
- };
-
- ///< A general class for shader types
- template <typename TDataType>
- class NVRenderShaderConstant : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- TDataType m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- memset(&m_Value, 0, sizeof(TDataType));
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< A specialized class for textures
- template <>
- class NVRenderShaderConstant<NVRenderTexture2DPtr> : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSU32 m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- m_Value = QT3DS_MAX_U32;
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< A specialized class for textures
- template <>
- class NVRenderShaderConstant<NVRenderTexture2DHandle> : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QVector<QT3DSU32> m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- m_Value.resize(elementCount);
- m_Value.fill(QT3DS_MAX_U32);
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< A specialized class for texture arrays
- template <>
- class NVRenderShaderConstant<NVRenderTexture2DArrayPtr> : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSU32 m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- m_Value = QT3DS_MAX_U32;
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< A specialized class for cubemap textures
- template <>
- class NVRenderShaderConstant<NVRenderTextureCubePtr> : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSU32 m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- m_Value = QT3DS_MAX_U32;
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< A specialized class for cubemap textures
- template <>
- class NVRenderShaderConstant<NVRenderTextureCubeHandle> : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QVector<QT3DSU32> m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- m_Value.resize(elementCount);
- m_Value.fill(QT3DS_MAX_U32);
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< A specialized class for texture image buffer
- template <>
- class NVRenderShaderConstant<NVRenderImage2DPtr> : public NVRenderShaderConstantBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSU32 m_Value; ///< constant value
-
- public:
- NVRenderShaderConstant(NVRenderBackend *backend, CRegisteredString name, QT3DSI32 location,
- QT3DSI32 elementCount, NVRenderShaderDataTypes::Enum type,
- QT3DSI32 binding, NVFoundationBase &allocator)
- : NVRenderShaderConstantBase(backend, name, location, elementCount, type, binding)
- , m_Foundation(allocator)
- {
- m_Value = QT3DS_MAX_U32;
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override { NVDelete(GetFoundation().getAllocator(), this); }
- };
-
- ///< Base for any buffer ( constant, texture, ... ) which is used by this program
- class NVRenderShaderBufferBase
- {
- public:
- NVRenderContextImpl &m_Context; ///< pointer to context
- CRegisteredString m_Name; ///< buffer name
- QT3DSU32 m_Location; ///< program buffer block location
- QT3DSU32 m_Binding; ///< program buffer binding
- QT3DSI32 m_Size; ///< buffer size
-
- public:
- NVRenderShaderBufferBase(NVRenderContextImpl &context, CRegisteredString name,
- QT3DSI32 location, QT3DSI32 binding, QT3DSI32 size)
- : m_Context(context)
- , m_Name(name)
- , m_Location(location)
- , m_Binding(binding)
- , m_Size(size)
- {
- }
-
- virtual void Release() = 0;
-
- virtual void Validate(NVRenderShaderProgram *inShader) = 0;
- virtual void BindToProgram(NVRenderShaderProgram *inShader) = 0;
- virtual void Update() = 0;
- };
-
- class NVRenderShaderConstantBuffer : public NVRenderShaderBufferBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSI32 m_ParamCount; ///< count of parameters contained in the constant buffer
- NVRenderConstantBuffer *m_pCB; ///< pointer to constant buffer
-
- public:
- NVRenderShaderConstantBuffer(NVRenderContextImpl &context, CRegisteredString name,
- QT3DSU32 location, QT3DSI32 binding, QT3DSI32 size, QT3DSI32 count,
- NVRenderConstantBuffer *pCB, NVFoundationBase &allocator)
- : NVRenderShaderBufferBase(context, name, location, binding, size)
- , m_Foundation(allocator)
- , m_ParamCount(count)
- , m_pCB(pCB)
- {
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override
- {
- if (m_pCB)
- m_pCB->release();
-
- NVDelete(GetFoundation().getAllocator(), this);
- }
-
- void Validate(NVRenderShaderProgram *inShader) override
- {
- // A constant buffer might not be set at first call
- // due to the fact that they are compiled from a cache file
- // Now it must exists.
- if (m_pCB)
- return;
-
- NVRenderConstantBuffer *cb = m_Context.GetConstantBuffer(m_Name);
- if (cb) {
- cb->SetupBuffer(inShader, m_Location, m_Size, m_ParamCount);
- cb->addRef();
- m_pCB = cb;
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void Update() override
- {
- if (m_pCB)
- m_pCB->Update();
- }
-
- void BindToProgram(NVRenderShaderProgram *inShader) override
- {
- if (m_pCB)
- m_pCB->BindToShaderProgram(inShader, m_Location, m_Binding);
- }
- };
-
- class NVRenderShaderStorageBuffer : public NVRenderShaderBufferBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSI32 m_ParamCount; ///< count of parameters contained in the constant buffer
- NVRenderStorageBuffer *m_pSB; ///< pointer to storage buffer
-
- public:
- NVRenderShaderStorageBuffer(NVRenderContextImpl &context, CRegisteredString name,
- QT3DSU32 location, QT3DSI32 binding, QT3DSI32 size, QT3DSI32 count,
- NVRenderStorageBuffer *pSB, NVFoundationBase &allocator)
- : NVRenderShaderBufferBase(context, name, location, binding, size)
- , m_Foundation(allocator)
- , m_ParamCount(count)
- , m_pSB(pSB)
- {
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override
- {
- if (m_pSB)
- m_pSB->release();
-
- NVDelete(GetFoundation().getAllocator(), this);
- }
-
- void Validate(NVRenderShaderProgram * /*inShader*/) override
- {
- // A constant buffer might not be set at first call
- // due to the fact that they are compile from a cache file
- // Now it must exists.
- if (m_pSB)
- return;
-
- NVRenderStorageBuffer *sb = m_Context.GetStorageBuffer(m_Name);
- if (sb) {
- sb->addRef();
- m_pSB = sb;
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void Update() override
- {
- if (m_pSB)
- m_pSB->Update();
- }
-
- void BindToProgram(NVRenderShaderProgram * /*inShader*/) override
- {
- if (m_pSB)
- m_pSB->BindToShaderProgram(m_Location);
- }
- };
-
- class NVRenderShaderAtomicCounterBuffer : public NVRenderShaderBufferBase
- {
- public:
- NVFoundationBase &m_Foundation; ///< allocator
- QT3DSI32 m_ParamCount; ///< count of parameters contained in the constant buffer
- NVRenderAtomicCounterBuffer *m_pAcB; ///< pointer to atomic counter buffer
-
- public:
- NVRenderShaderAtomicCounterBuffer(NVRenderContextImpl &context, CRegisteredString name,
- QT3DSU32 location, QT3DSI32 binding, QT3DSI32 size, QT3DSI32 count,
- NVRenderAtomicCounterBuffer *pAcB,
- NVFoundationBase &allocator)
- : NVRenderShaderBufferBase(context, name, location, binding, size)
- , m_Foundation(allocator)
- , m_ParamCount(count)
- , m_pAcB(pAcB)
- {
- }
-
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- void Release() override
- {
- if (m_pAcB)
- m_pAcB->release();
-
- NVDelete(GetFoundation().getAllocator(), this);
- }
-
- void Validate(NVRenderShaderProgram * /*inShader*/) override
- {
- // A constant buffer might not be set at first call
- // due to the fact that they are compile from a cache file
- // Now it must exists.
- if (m_pAcB)
- return;
-
- NVRenderAtomicCounterBuffer *acb = m_Context.GetAtomicCounterBuffer(m_Name);
- if (acb) {
- acb->addRef();
- m_pAcB = acb;
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void Update() override
- {
- if (m_pAcB)
- m_pAcB->Update();
- }
-
- void BindToProgram(NVRenderShaderProgram * /*inShader*/) override
- {
- if (m_pAcB)
- m_pAcB->BindToShaderProgram(m_Location);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.cpp
deleted file mode 100644
index 09f1094b..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.cpp
+++ /dev/null
@@ -1,1248 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "render/Qt3DSRenderVertexShader.h"
-#include "render/Qt3DSRenderFragmentShader.h"
-#include "render/Qt3DSRenderTessellationShader.h"
-#include "render/Qt3DSRenderGeometryShader.h"
-#include "render/Qt3DSRenderComputeShader.h"
-#include "render/Qt3DSRenderImageTexture.h"
-
-namespace qt3ds {
-namespace render {
-
- template <typename TDataType>
- struct ShaderConstantApplier
- {
- bool force_compile_error;
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSI32>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSI32 &inValue,
- QT3DSI32 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSI32_2>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSI32_2 &inValue,
- QT3DSI32_2 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue.x);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSI32_3>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSI32_3 &inValue,
- QT3DSI32_3 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue.x);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSI32_4>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSI32_4 &inValue,
- QT3DSI32_4 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue.x);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSRenderBool>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- const QT3DSRenderBool inValue, QT3DSRenderBool &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<bool_2>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const bool_2 &inValue,
- bool_2 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<bool_3>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const bool_3 &inValue,
- bool_3 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<bool_4>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const bool_4 &inValue,
- bool_4 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSF32>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSF32 &inValue,
- QT3DSF32 &oldValue)
- {
- if (count > 1 || !(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSVec2>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSVec2 &inValue,
- QT3DSVec2 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSVec3>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSVec3 &inValue,
- QT3DSVec3 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSVec4>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSVec4 &inValue,
- QT3DSVec4 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSU32>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSU32 &inValue,
- QT3DSU32 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSU32_2>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSU32_2 &inValue,
- QT3DSU32_2 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue.x);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSU32_3>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSU32_3 &inValue,
- QT3DSU32_3 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue.x);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSU32_4>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSU32_4 &inValue,
- QT3DSU32_4 &oldValue)
- {
- if (!(inValue == oldValue)) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- &inValue.x);
- oldValue = inValue;
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSMat33>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSMat33 inValue,
- QT3DSMat33 &, bool inTranspose)
- {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- inValue.front(), inTranspose);
- }
- };
-
- template <>
- struct ShaderConstantApplier<QT3DSMat44>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type, const QT3DSMat44 inValue,
- QT3DSMat44 &, bool inTranspose)
- {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- inValue.front(), inTranspose);
- }
-
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVConstDataRef<QT3DSMat44> inValue, QT3DSMat44 &, bool inTranspose)
- {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type, count,
- reinterpret_cast<const GLfloat *>(inValue.begin()),
- inTranspose);
- }
- };
-
- template <>
- struct ShaderConstantApplier<NVRenderTexture2DPtr>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVRenderTexture2DPtr inValue, QT3DSU32 &oldValue)
- {
- if (inValue) {
- NVRenderTexture2D *texObj = reinterpret_cast<NVRenderTexture2D *>(inValue);
- texObj->Bind();
- QT3DSU32 texUnit = texObj->GetTextureUnit();
- if (texUnit != oldValue) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type,
- count, &texUnit);
- oldValue = texUnit;
- }
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<NVRenderTexture2DHandle>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend,
- QT3DSI32 location, QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVRenderTexture2DHandle inValue, QVector<QT3DSU32> &oldValue)
- {
- Q_UNUSED(type)
- if (inValue) {
- bool update = false;
- for (int i = 0; i < count; i++) {
- NVRenderTexture2D *texObj = reinterpret_cast<NVRenderTexture2D *>(inValue[i]);
- QT3DSU32 texUnit = QT3DS_MAX_U32;
- if (texObj) {
- texObj->Bind();
- texUnit = texObj->GetTextureUnit();
- }
- if (texUnit != oldValue[i]) {
- update = true;
- oldValue[i] = texUnit;
- }
- }
- if (update)
- backend->SetConstantValue(program->GetShaderProgramHandle(), location,
- NVRenderShaderDataTypes::NVRenderTexture2DPtr,
- count, oldValue.data());
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<NVRenderTexture2DArrayPtr>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVRenderTexture2DArrayPtr inValue, QT3DSU32 &oldValue)
- {
- if (inValue) {
- NVRenderTexture2DArray *texObj =
- reinterpret_cast<NVRenderTexture2DArray *>(inValue);
- texObj->Bind();
- QT3DSU32 texUnit = texObj->GetTextureUnit();
- if (texUnit != oldValue) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type,
- count, &texUnit);
- oldValue = texUnit;
- }
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<NVRenderTextureCubePtr>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVRenderTextureCubePtr inValue, QT3DSU32 &oldValue)
- {
- if (inValue) {
- NVRenderTextureCube *texObj = reinterpret_cast<NVRenderTextureCube *>(inValue);
- texObj->Bind();
- QT3DSU32 texUnit = texObj->GetTextureUnit();
- if (texUnit != oldValue) {
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type,
- count, &texUnit);
- oldValue = texUnit;
- }
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<NVRenderTextureCubeHandle>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend,
- QT3DSI32 location, QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVRenderTextureCubeHandle inValue, QVector<QT3DSU32> &oldValue)
- {
- Q_UNUSED(type)
- if (inValue) {
- bool update = false;
- for (int i = 0; i < count; i++) {
- NVRenderTextureCube *texObj = reinterpret_cast<NVRenderTextureCube *>(inValue[i]);
- QT3DSU32 texUnit = QT3DS_MAX_U32;
- if (texObj) {
- texObj->Bind();
- texUnit = texObj->GetTextureUnit();
- }
- if (texUnit != oldValue[i]) {
- update = true;
- oldValue[i] = texUnit;
- }
- }
- if (update)
- backend->SetConstantValue(program->GetShaderProgramHandle(), location,
- NVRenderShaderDataTypes::NVRenderTextureCubePtr,
- count, oldValue.data());
- }
- }
- };
-
- template <>
- struct ShaderConstantApplier<NVRenderImage2DPtr>
- {
- void ApplyConstant(NVRenderShaderProgram *program, NVRenderBackend *backend, QT3DSI32 location,
- QT3DSI32 count, NVRenderShaderDataTypes::Enum type,
- NVRenderImage2DPtr inValue, QT3DSU32 &oldValue, QT3DSI32 binding)
- {
- if (inValue) {
- NVRenderImage2D *imgObj = reinterpret_cast<NVRenderImage2D *>(inValue);
- imgObj->Bind(binding);
- QT3DSU32 texUnit = imgObj->GetTextureUnit();
- if (texUnit != oldValue) {
- // on ES we need a explicit binding value
- QT3DS_ASSERT(backend->GetRenderContextType() != NVRenderContextValues::GLES3PLUS
- || binding != -1);
- // this is not allowed on ES 3+ for image types
- if (backend->GetRenderContextType() != NVRenderContextValues::GLES3PLUS)
- backend->SetConstantValue(program->GetShaderProgramHandle(), location, type,
- count, &texUnit);
-
- oldValue = texUnit;
- }
- }
- }
- };
-
- NVRenderShaderProgram::NVRenderShaderProgram(NVRenderContextImpl &context,
- NVFoundationBase &fnd, const char *programName,
- bool separableProgram)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_ProgramName(programName)
- , m_ProgramHandle(NULL)
- , m_Constants(context.GetFoundation().getAllocator(), "NVRenderShaderProgram::m_Constants")
- , m_ShaderBuffers(context.GetFoundation().getAllocator(),
- "NVRenderShaderProgram::m_ShaderBuffers")
- , m_ProgramType(ProgramType::Graphics)
- {
- m_ProgramHandle = m_Backend->CreateShaderProgram(separableProgram);
-
- QT3DS_ASSERT(m_ProgramHandle);
- }
-
- NVRenderShaderProgram::~NVRenderShaderProgram()
- {
- m_Context.ShaderDestroyed(*this);
-
- if (m_ProgramHandle)
- m_Backend->ReleaseShaderProgram(m_ProgramHandle);
-
- for (TShaderConstantMap::iterator iter = m_Constants.begin(), end = m_Constants.end();
- iter != end; ++iter) {
- iter->second->Release();
- }
-
- m_Constants.clear();
-
- for (TShaderBufferMap::iterator iter = m_ShaderBuffers.begin(), end = m_ShaderBuffers.end();
- iter != end; ++iter) {
- iter->second->Release();
- }
-
- m_ShaderBuffers.clear();
-
- m_ProgramHandle = NULL;
- }
-
- template <typename TShaderObject>
- void NVRenderShaderProgram::Attach(TShaderObject *pShader)
- {
- m_Backend->AttachShader(m_ProgramHandle, pShader->GetShaderHandle());
- }
-
- template <typename TShaderObject>
- void NVRenderShaderProgram::Detach(TShaderObject *pShader)
- {
- m_Backend->DetachShader(m_ProgramHandle, pShader->GetShaderHandle());
- }
-
- static NVRenderShaderConstantBase *
- ShaderConstantFactory(NVRenderBackend *backend, CRegisteredString inName,
- NVFoundationBase &alloc, QT3DSI32 uniLoc, QT3DSI32 elementCount,
- NVRenderShaderDataTypes::Enum inConstantType, QT3DSI32 binding)
- {
- switch (inConstantType) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(nv) \
- case NVRenderShaderDataTypes::nv: \
- return QT3DS_NEW(alloc.getAllocator(), NVRenderShaderConstant<nv>)( \
- backend, inName, uniLoc, elementCount, inConstantType, binding, alloc);
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- template <typename TShaderBufferType, typename TBufferDataType>
- static NVRenderShaderBufferBase *
- ShaderBufferFactory(NVRenderContextImpl &context, CRegisteredString inName,
- NVFoundationBase &alloc, QT3DSI32 cbLoc, QT3DSI32 cbBinding, QT3DSI32 cbSize,
- QT3DSI32 cbCount, TBufferDataType *pBuffer)
- {
- return QT3DS_NEW(alloc.getAllocator(), TShaderBufferType)(context, inName, cbLoc, cbBinding,
- cbSize, cbCount, pBuffer, alloc);
- }
-
- bool NVRenderShaderProgram::Link()
- {
- bool success = m_Backend->LinkProgram(m_ProgramHandle, m_ErrorMessage);
-
- if (success) {
- char nameBuf[512];
- QT3DSI32 location, elementCount, binding;
- NVRenderShaderDataTypes::Enum type;
-
- QT3DSI32 constantCount = m_Backend->GetConstantCount(m_ProgramHandle);
-
- QT3DS_FOREACH(idx, constantCount)
- {
- location = m_Backend->GetConstantInfoByID(m_ProgramHandle, idx, 512, &elementCount,
- &type, &binding, nameBuf);
-
- // sampler arrays have different type
- if (type == NVRenderShaderDataTypes::NVRenderTexture2DPtr && elementCount > 1) {
- type = NVRenderShaderDataTypes::NVRenderTexture2DHandle;
- } else if (type == NVRenderShaderDataTypes::NVRenderTextureCubePtr
- && elementCount > 1) {
- type = NVRenderShaderDataTypes::NVRenderTextureCubeHandle;
- }
- if (location != -1) {
- CRegisteredString theName(m_Context.GetStringTable().RegisterStr(nameBuf));
- m_Constants.insert(eastl::make_pair(
- theName,
- ShaderConstantFactory(m_Backend, theName, m_Context.GetFoundation(),
- location, elementCount, type, binding)));
- }
- }
-
- // next query constant buffers info
- QT3DSI32 length, bufferSize, paramCount;
- QT3DSI32 constantBufferCount = m_Backend->GetConstantBufferCount(m_ProgramHandle);
- QT3DS_FOREACH(idx, constantBufferCount)
- {
- location = m_Backend->GetConstantBufferInfoByID(
- m_ProgramHandle, idx, 512, &paramCount, &bufferSize, &length, nameBuf);
-
- if (location != -1) {
- CRegisteredString theName(m_Context.GetStringTable().RegisterStr(nameBuf));
-
- // find constant buffer in our DB
- NVRenderConstantBuffer *cb = m_Context.GetConstantBuffer(theName);
- if (cb) {
- cb->SetupBuffer(this, location, bufferSize, paramCount);
- cb->addRef();
- }
-
- m_ShaderBuffers.insert(eastl::make_pair(
- theName,
- ShaderBufferFactory<NVRenderShaderConstantBuffer, NVRenderConstantBuffer>(
- m_Context, theName, m_Context.GetFoundation(), location, -1, bufferSize,
- paramCount, cb)));
- }
- }
-
- // next query storage buffers
- QT3DSI32 storageBufferCount = m_Backend->GetStorageBufferCount(m_ProgramHandle);
- QT3DS_FOREACH(idx, storageBufferCount)
- {
- location = m_Backend->GetStorageBufferInfoByID(
- m_ProgramHandle, idx, 512, &paramCount, &bufferSize, &length, nameBuf);
-
- if (location != -1) {
- CRegisteredString theName(m_Context.GetStringTable().RegisterStr(nameBuf));
-
- // find constant buffer in our DB
- NVRenderStorageBuffer *sb = m_Context.GetStorageBuffer(theName);
- if (sb) {
- sb->addRef();
- }
-
- m_ShaderBuffers.insert(eastl::make_pair(
- theName,
- ShaderBufferFactory<NVRenderShaderStorageBuffer, NVRenderStorageBuffer>(
- m_Context, theName, m_Context.GetFoundation(), location, -1, bufferSize,
- paramCount, sb)));
- }
- }
-
- // next query atomic counter buffers
- QT3DSI32 atomicBufferCount = m_Backend->GetAtomicCounterBufferCount(m_ProgramHandle);
- QT3DS_FOREACH(idx, atomicBufferCount)
- {
- location = m_Backend->GetAtomicCounterBufferInfoByID(
- m_ProgramHandle, idx, 512, &paramCount, &bufferSize, &length, nameBuf);
-
- if (location != -1) {
- CRegisteredString theName(m_Context.GetStringTable().RegisterStr(nameBuf));
-
- // find atomic counter buffer in our DB
- // The buffer itself is not used in the program itself.
- // Instead uniform variables are used but the interface to set the value is like
- // for buffers.
- // This is a bit insane but that is how it is.
- // The theName variable contains the uniform name associated with an atomic
- // counter buffer.
- // We get the actual buffer name by searching for this uniform name
- // See NVRenderTestAtomicCounterBuffer.cpp how the setup works
- NVRenderAtomicCounterBuffer *acb =
- m_Context.GetAtomicCounterBufferByParam(theName);
- if (acb) {
- acb->addRef();
-
- m_ShaderBuffers.insert(eastl::make_pair(
- acb->GetBufferName(),
- ShaderBufferFactory<NVRenderShaderAtomicCounterBuffer,
- NVRenderAtomicCounterBuffer>(
- m_Context, acb->GetBufferName(), m_Context.GetFoundation(),
- location, -1, bufferSize, paramCount, acb)));
- }
- }
- }
- }
-
- return success;
- }
-
- void NVRenderShaderProgram::GetErrorMessage(QT3DSI32 *messageLength, const char *errorMessage)
- {
- *messageLength = m_ErrorMessage.size();
- errorMessage = m_ErrorMessage.c_str();
- }
-
- const char *NVRenderShaderProgram::GetErrorMessage() { return m_ErrorMessage.c_str(); }
-
- NVRenderShaderConstantBase *NVRenderShaderProgram::GetShaderConstant(const char *constantName)
- {
- TShaderConstantMap::iterator theIter =
- m_Constants.find(m_Context.GetStringTable().RegisterStr(constantName));
-
- if (theIter != m_Constants.end()) {
- NVRenderShaderConstantBase *theConstant =
- static_cast<NVRenderShaderConstantBase *>(theIter->second);
- return theConstant;
- }
-
- return NULL;
- }
-
- NVRenderShaderBufferBase *NVRenderShaderProgram::GetShaderBuffer(const char *bufferName)
- {
- TShaderBufferMap::iterator theIter =
- m_ShaderBuffers.find(m_Context.GetStringTable().RegisterStr(bufferName));
-
- if (theIter != m_ShaderBuffers.end()) {
- return theIter->second;
- }
-
- return NULL;
- }
-
- NVRenderContextImpl &NVRenderShaderProgram::GetRenderContext() { return m_Context; }
-
- template <typename TDataType>
- void SetConstantValueOfType(NVRenderShaderProgram *program,
- NVRenderShaderConstantBase *inConstantBase,
- const TDataType &inValue, const QT3DSI32 inCount)
- {
- if (inConstantBase == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- QT3DS_ASSERT(inConstantBase->m_ElementCount >= inCount);
-
- if (inConstantBase->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- NVRenderShaderConstant<TDataType> *inConstant =
- static_cast<NVRenderShaderConstant<TDataType> *>(inConstantBase);
- ShaderConstantApplier<TDataType>().ApplyConstant(
- program, inConstant->m_Backend, inConstant->m_Location, inCount, inConstant->m_Type,
- inValue, inConstant->m_Value);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- template <typename TDataType>
- void SetSamplerConstantValueOfType(NVRenderShaderProgram *program,
- NVRenderShaderConstantBase *inConstantBase,
- const TDataType &inValue, const QT3DSI32 inCount)
- {
- if (inConstantBase == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- QT3DS_ASSERT(inConstantBase->m_ElementCount >= inCount);
-
- if (inConstantBase->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- NVRenderShaderConstant<TDataType> *inConstant =
- static_cast<NVRenderShaderConstant<TDataType> *>(inConstantBase);
- ShaderConstantApplier<TDataType>().ApplyConstant(
- program, inConstant->m_Backend, inConstant->m_Location, inCount, inConstant->m_Type,
- inValue, inConstant->m_Value, inConstant->m_Binding);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- template <typename TDataType>
- void SetMatrixConstantValueOfType(NVRenderShaderProgram *program,
- NVRenderShaderConstantBase *inConstantBase,
- const TDataType &inValue, const QT3DSI32 inCount,
- bool inTranspose)
- {
- if (inConstantBase == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- QT3DS_ASSERT(inConstantBase->m_ElementCount >= inCount);
-
- if (inConstantBase->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- NVRenderShaderConstant<TDataType> *inConstant =
- static_cast<NVRenderShaderConstant<TDataType> *>(inConstantBase);
- ShaderConstantApplier<TDataType>().ApplyConstant(
- program, inConstant->m_Backend, inConstant->m_Location, inCount, inConstant->m_Type,
- inValue, inConstant->m_Value, inTranspose);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- template <typename TDataType>
- void SetMatrixConstantValueOfType(NVRenderShaderProgram *program,
- NVRenderShaderConstantBase *inConstantBase,
- const NVConstDataRef<TDataType> inValue,
- const QT3DSI32 /*inCount*/, bool inTranspose)
- {
- if (inConstantBase == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- QT3DS_ASSERT(inConstantBase->m_ElementCount >= (QT3DSI32)inValue.size());
-
- if (inConstantBase->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- NVRenderShaderConstant<TDataType> *inConstant =
- static_cast<NVRenderShaderConstant<TDataType> *>(inConstantBase);
- ShaderConstantApplier<TDataType>().ApplyConstant(
- program, inConstant->m_Backend, inConstant->m_Location, inValue.size(),
- inConstant->m_Type, inValue, inConstant->m_Value, inTranspose);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- QT3DSI32 inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSI32_2 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSI32_3 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSI32_4 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- QT3DSRenderBool inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const bool_2 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const bool_3 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const bool_4 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSF32 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSVec2 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSVec3 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSVec4 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSU32 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSU32_2 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSU32_3 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSU32_4 &inValue, const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSMat33 &inValue, const QT3DSI32 inCount,
- bool inTranspose)
- {
- SetMatrixConstantValueOfType(this, inConstant, inValue, inCount, inTranspose);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const QT3DSMat44 &inValue, const QT3DSI32 inCount,
- bool inTranspose)
- {
- SetMatrixConstantValueOfType(this, inConstant, inValue, inCount, inTranspose);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const NVConstDataRef<QT3DSMat44> inValue,
- const QT3DSI32 inCount)
- {
- SetMatrixConstantValueOfType(this, inConstant, inValue, inCount, false);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderTexture2D *inValue, const QT3DSI32 inCount)
- {
- Q_UNUSED(inCount)
- SetConstantValueOfType(this, inConstant, inValue, 1);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderTexture2D **inValue,
- const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderTexture2DArray *inValue,
- const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderTextureCube *inValue, const QT3DSI32 inCount)
- {
- Q_UNUSED(inCount)
- SetConstantValueOfType(this, inConstant, inValue, 1);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderTextureCube **inValue,
- const QT3DSI32 inCount)
- {
- SetConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderImage2D *inValue, const QT3DSI32 inCount)
- {
- SetSamplerConstantValueOfType(this, inConstant, inValue, inCount);
- }
- void NVRenderShaderProgram::SetConstantValue(NVRenderShaderConstantBase *, NVRenderDataBuffer *,
- const QT3DSI32)
- {
- // this is merely a dummy right now
- }
-
- void NVRenderShaderProgram::BindComputeInput(NVRenderDataBuffer *inBuffer, QT3DSU32 inIndex)
- {
- NVRenderBackend::NVRenderBackendBufferObject obj(NULL);
- if (inBuffer)
- obj = inBuffer->GetBuffertHandle();
- m_Backend->ProgramSetStorageBuffer(inIndex, obj);
- }
-
- namespace {
- void WriteErrorMessage(NVFoundationBase &fnd, const char *tag, const char *message)
- {
- Q_UNUSED(fnd)
- eastl::string messageData(nonNull(message));
- eastl::vector<eastl::string> lines;
- for (eastl::string::size_type pos = messageData.find('\n'); pos != eastl::string::npos;
- pos = messageData.find('\n')) {
- eastl::string line = messageData.substr(0, pos);
- messageData.erase(messageData.begin(), messageData.begin() + pos + 1);
- if (line.size())
- qCCritical(INVALID_OPERATION, "%s: %s", tag, line.c_str());
- }
- }
- }
-
- Option<NVRenderVertexShader *> NVRenderShaderProgram::createVertexShader(
- NVRenderContextImpl &context, NVConstDataRef<QT3DSI8> vertexShaderSource, bool binaryProgram)
- {
- if (vertexShaderSource.size() == 0)
- return Empty();
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderVertexShader(context, context.GetFoundation(), vertexShaderSource,
- binaryProgram));
- }
-
- Option<NVRenderFragmentShader *> NVRenderShaderProgram::createFragmentShader(
- NVRenderContextImpl &context, NVConstDataRef<QT3DSI8> fragmentShaderSource, bool binaryProgram)
- {
- if (fragmentShaderSource.size() == 0)
- return Empty();
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderFragmentShader(context, context.GetFoundation(), fragmentShaderSource,
- binaryProgram));
- }
-
- Option<NVRenderTessControlShader *>
- NVRenderShaderProgram::createTessControlShader(NVRenderContextImpl &context,
- NVConstDataRef<QT3DSI8> tessControlShaderSource,
- bool binaryProgram)
- {
- if (tessControlShaderSource.size() == 0)
- return Empty();
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderTessControlShader(context, context.GetFoundation(),
- tessControlShaderSource, binaryProgram));
- }
-
- Option<NVRenderTessEvaluationShader *>
- NVRenderShaderProgram::createTessEvaluationShader(NVRenderContextImpl &context,
- NVConstDataRef<QT3DSI8> tessControlShaderSource,
- bool binaryProgram)
- {
- if (tessControlShaderSource.size() == 0)
- return Empty();
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderTessEvaluationShader(context, context.GetFoundation(),
- tessControlShaderSource, binaryProgram));
- }
-
- Option<NVRenderGeometryShader *> NVRenderShaderProgram::createGeometryShader(
- NVRenderContextImpl &context, NVConstDataRef<QT3DSI8> geometryShaderSource, bool binaryProgram)
- {
- if (geometryShaderSource.size() == 0)
- return Empty();
-
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderGeometryShader(context, context.GetFoundation(), geometryShaderSource,
- binaryProgram));
- }
-
- NVRenderVertFragCompilationResult NVRenderShaderProgram::Create(
- NVRenderContextImpl &context, const char *programName,
- NVConstDataRef<QT3DSI8> vertShaderSource, NVConstDataRef<QT3DSI8> fragShaderSource,
- NVConstDataRef<QT3DSI8> tessControlShaderSource,
- NVConstDataRef<QT3DSI8> tessEvaluationShaderSource, NVConstDataRef<QT3DSI8> geometryShaderSource,
- bool separateProgram, NVRenderShaderProgramBinaryType::Enum type, bool binaryProgram)
- {
- NVRenderVertFragCompilationResult result;
- NVRenderShaderProgram *pProgram = NULL;
- bool bProgramIsValid = false;
-
- result.mShaderName = programName;
-
- // our minimum requirement is a vertex and a fragment shader or geometry shader
- // if we should treat it as a separate program we don't care
- if (!separateProgram
- && (vertShaderSource.size() == 0
- || (fragShaderSource.size() == 0 && geometryShaderSource.size() == 0))) {
- qCCritical(INVALID_PARAMETER,
- "Vertex or fragment (geometry) source have 0 length");
- QT3DS_ASSERT(false);
- return result;
- }
-
- if (binaryProgram && type != NVRenderShaderProgramBinaryType::NVBinary) {
- qCCritical(INVALID_PARAMETER, "Unrecoginzed binary format");
- QT3DS_ASSERT(false);
- return result;
- }
-
- // first create and compile shader
- Option<NVRenderVertexShader *> vtxShader =
- createVertexShader(context, vertShaderSource, binaryProgram);
- Option<NVRenderFragmentShader *> fragShader =
- createFragmentShader(context, fragShaderSource, binaryProgram);
- Option<NVRenderTessControlShader *> tcShader =
- createTessControlShader(context, tessControlShaderSource, binaryProgram);
- Option<NVRenderTessEvaluationShader *> teShader =
- createTessEvaluationShader(context, tessEvaluationShaderSource, binaryProgram);
- Option<NVRenderGeometryShader *> geShader =
- createGeometryShader(context, geometryShaderSource, binaryProgram);
-
- bool vertexValid = (vtxShader.hasValue()) ? vtxShader.getValue()->IsValid() : true;
- bool fragValid = (fragShader.hasValue()) ? fragShader.getValue()->IsValid() : true;
- bool tcValid = (tcShader.hasValue()) ? tcShader.getValue()->IsValid() : true;
- bool teValid = (teShader.hasValue()) ? teShader.getValue()->IsValid() : true;
- bool geValid = (geShader.hasValue()) ? geShader.getValue()->IsValid() : true;
-
- if (vertexValid && fragValid && tcValid && teValid && geValid) {
- // shaders were succesfuly created
- pProgram = QT3DS_NEW(context.GetFoundation().getAllocator(), NVRenderShaderProgram)(
- context, context.GetFoundation(), programName, separateProgram);
-
- if (pProgram) {
- // attach programs
- if (vtxShader.hasValue() && vtxShader.getValue()->IsValid())
- pProgram->Attach(vtxShader.getValue());
- if (fragShader.hasValue() && fragShader.getValue()->IsValid())
- pProgram->Attach(fragShader.getValue());
- if (tcShader.hasValue() && tcShader.getValue()->IsValid())
- pProgram->Attach(tcShader.getValue());
- if (teShader.hasValue() && teShader.getValue()->IsValid())
- pProgram->Attach(teShader.getValue());
- if (geShader.hasValue() && geShader.getValue()->IsValid())
- pProgram->Attach(geShader.getValue());
-
- // link program
- bProgramIsValid = pProgram->Link();
- }
- }
-
- // if anything went wrong print out
- if (!vertexValid || !fragValid || !tcValid || !teValid || !geValid || !bProgramIsValid) {
- NVFoundationBase &foundation(context.GetFoundation());
-
- if (!vertexValid) {
- qCCritical(INTERNAL_ERROR, "Failed to generate vertex shader!!");
- qCCritical(INTERNAL_ERROR, "Vertex source:\n%s",
- nonNull((const char *)vertShaderSource.begin()));
- WriteErrorMessage(foundation, "Vertex compilation output:",
- vtxShader.getValue()->GetErrorMessage());
- }
-
- if (!fragValid) {
- qCCritical(INTERNAL_ERROR, "Failed to generate fragment shader!!");
- qCCritical(INTERNAL_ERROR, "Fragment source:\n%s",
- nonNull((const char *)fragShaderSource.begin()));
- WriteErrorMessage(foundation, "Fragment compilation output:",
- fragShader.getValue()->GetErrorMessage());
- }
-
- if (!tcValid) {
- qCCritical(INTERNAL_ERROR,
- "Failed to generate tessellation control shader!!");
- qCCritical(INTERNAL_ERROR, "Tessellation control source:\n%s",
- nonNull((const char *)tessControlShaderSource.begin()));
- WriteErrorMessage(foundation, "Tessellation control compilation output:",
- tcShader.getValue()->GetErrorMessage());
- }
-
- if (!teValid) {
- qCCritical(INTERNAL_ERROR,
- "Failed to generate tessellation evaluation shader!!");
- qCCritical(INTERNAL_ERROR, "Tessellation evaluation source:\n%s",
- nonNull((const char *)tessEvaluationShaderSource.begin()));
- WriteErrorMessage(foundation, "Tessellation evaluation compilation output:",
- teShader.getValue()->GetErrorMessage());
- }
-
- if (!geValid) {
- qCCritical(INTERNAL_ERROR, "Failed to generate geometry shader!!");
- qCCritical(INTERNAL_ERROR, "Geometry source:\n%s",
- nonNull((const char *)geometryShaderSource.begin()));
- WriteErrorMessage(foundation, "Geometry compilation output:",
- geShader.getValue()->GetErrorMessage());
- }
-
- if (!bProgramIsValid && pProgram) {
- qCCritical(INTERNAL_ERROR, "Failed to link program!!");
- WriteErrorMessage(foundation, "Program link output:", pProgram->GetErrorMessage());
-
- // delete program
- QT3DS_FREE(context.GetFoundation().getAllocator(), pProgram);
- pProgram = NULL;
- }
- }
-
- // clean up
- if (vtxShader.hasValue()) {
- if (bProgramIsValid && vtxShader.getValue()->IsValid())
- pProgram->Detach(vtxShader.getValue());
- QT3DS_FREE(context.GetFoundation().getAllocator(), vtxShader.getValue());
- }
- if (fragShader.hasValue()) {
- if (bProgramIsValid && fragShader.getValue()->IsValid())
- pProgram->Detach(fragShader.getValue());
- QT3DS_FREE(context.GetFoundation().getAllocator(), fragShader.getValue());
- }
- if (tcShader.hasValue()) {
- if (bProgramIsValid && tcShader.getValue()->IsValid())
- pProgram->Detach(tcShader.getValue());
- QT3DS_FREE(context.GetFoundation().getAllocator(), tcShader.getValue());
- }
- if (teShader.hasValue()) {
- if (bProgramIsValid && teShader.getValue()->IsValid())
- pProgram->Detach(teShader.getValue());
- QT3DS_FREE(context.GetFoundation().getAllocator(), teShader.getValue());
- }
- if (geShader.hasValue()) {
- if (bProgramIsValid && geShader.getValue()->IsValid())
- pProgram->Detach(geShader.getValue());
- QT3DS_FREE(context.GetFoundation().getAllocator(), geShader.getValue());
- }
-
- // set program
- result.mShader = pProgram;
-
- return result;
- }
-
- NVRenderVertFragCompilationResult
- NVRenderShaderProgram::CreateCompute(NVRenderContextImpl &context, const char *programName,
- NVConstDataRef<QT3DSI8> computeShaderSource)
- {
- NVRenderVertFragCompilationResult result;
- NVRenderShaderProgram *pProgram = NULL;
- bool bProgramIsValid = true;
-
- result.mShaderName = programName;
-
- // check source
- if (computeShaderSource.size() == 0) {
- qCCritical(INVALID_PARAMETER, "compute source has 0 length");
- QT3DS_ASSERT(false);
- return result;
- }
-
- NVRenderComputeShader computeShader(context, context.GetFoundation(), computeShaderSource,
- false);
-
- if (computeShader.IsValid()) {
- // shaders were succesfuly created
- pProgram = QT3DS_NEW(context.GetFoundation().getAllocator(), NVRenderShaderProgram)(
- context, context.GetFoundation(), programName, false);
-
- if (pProgram) {
- // attach programs
- pProgram->Attach(&computeShader);
-
- // link program
- bProgramIsValid = pProgram->Link();
-
- // set program type
- pProgram->SetProgramType(ProgramType::Compute);
- }
- }
-
- // if anything went wrong print out
- if (!computeShader.IsValid() || !bProgramIsValid) {
- NVFoundationBase &foundation(context.GetFoundation());
-
- if (!computeShader.IsValid()) {
- qCCritical(INTERNAL_ERROR, "Failed to generate compute shader!!");
- qCCritical(INTERNAL_ERROR, "Vertex source:\n%s",
- nonNull((const char *)computeShaderSource.begin()));
- WriteErrorMessage(foundation, "Compute shader compilation output:",
- computeShader.GetErrorMessage());
- }
- }
-
- // set program
- result.mShader = pProgram;
-
- return result;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.h
deleted file mode 100644
index 054db64b..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderShaderProgram.h
+++ /dev/null
@@ -1,540 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_PROGRAM_H
-#define QT3DS_RENDER_SHADER_PROGRAM_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderShaderConstant.h"
-#include "EASTL/string.h"
-#include "EASTL/utility.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- ///< forward declarations
- class NVRenderContextImpl;
- class NVRenderVertexShader;
- class NVRenderFragmentShader;
- class NVRenderTessControlShader;
- class NVRenderTessEvaluationShader;
- class NVRenderGeometryShader;
- class NVRenderShaderConstantBase;
- class NVRenderShaderBufferBase;
- class NVRenderComputeShader;
-
- typedef nvhash_map<CRegisteredString, NVRenderShaderConstantBase *> TShaderConstantMap;
- typedef nvhash_map<CRegisteredString, NVRenderShaderBufferBase *> TShaderBufferMap;
-
- ///< A shader program is an object composed of a multiple shaders (vertex, fragment,
- ///geometry,....)
- class QT3DS_AUTOTEST_EXPORT NVRenderShaderProgram : public NVRefCounted
- {
- public:
- struct ProgramType
- {
- enum Enum { Graphics, Compute };
- };
-
- private:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- const char *m_ProgramName; /// Name of the program
- NVRenderBackend::NVRenderBackendShaderProgramObject
- m_ProgramHandle; ///< opaque backend handle
- TShaderConstantMap m_Constants; ///< map of shader constants
- TShaderBufferMap m_ShaderBuffers; ///< map of shader buffers
- ProgramType::Enum m_ProgramType; ///< shader type
- eastl::string m_ErrorMessage; ///< contains the error message if linking fails
-
- /**
- * @brief create vertex shader
- *
- * @param[in] context Pointer to render context
- * @param[in] vertexShaderSource Fragment shader source code
- * @param[in] binaryProgram True if binary program
- *
- * @return pointer to vertex shader object
- */
- static Option<NVRenderVertexShader *>
- createVertexShader(NVRenderContextImpl &context, NVConstDataRef<QT3DSI8> vertexShaderSource,
- bool binaryProgram = false);
-
- /**
- * @brief create fragment shader
- *
- * @param[in] context Pointer to render context
- * @param[in] fragmentShaderSource Fragment shader source code
- * @param[in] binaryProgram True if binary program
- *
- * @return pointer to fragment shader object
- */
- static Option<NVRenderFragmentShader *>
- createFragmentShader(NVRenderContextImpl &context,
- NVConstDataRef<QT3DSI8> fragmentShaderSource, bool binaryProgram = false);
-
- /**
- * @brief create tesselation control shader
- *
- * @param[in] context Pointer to render context
- * @param[in] tessControlShaderSource Tessellation control shader source code
- * @param[in] binaryProgram True if binary program
- *
- * @return pointer to tessellation control shader
- */
- static Option<NVRenderTessControlShader *>
- createTessControlShader(NVRenderContextImpl &context,
- NVConstDataRef<QT3DSI8> tessControlShaderSource,
- bool binaryProgram = false);
-
- /**
- * @brief create tesselation evaluation shader
- *
- * @param[in] context Pointer to render context
- * @param[in] tessEvaluationShaderSource Tessellation evaluation shader source code
- * @param[in] binaryProgram True if binary program
- *
- * @return pointer to tessellation evaluation shader
- */
- static Option<NVRenderTessEvaluationShader *>
- createTessEvaluationShader(NVRenderContextImpl &context,
- NVConstDataRef<QT3DSI8> tessEvaluationShaderSource,
- bool binaryProgram = false);
-
- /**
- * @brief create geometry shader
- *
- * @param[in] context Pointer to render context
- * @param[in] geometryShaderSource Geometry shader source code
- * @param[in] binaryProgram True if binary program
- *
- * @return pointer to geometry shader
- */
- static Option<NVRenderGeometryShader *>
- createGeometryShader(NVRenderContextImpl &context,
- NVConstDataRef<QT3DSI8> geometryShaderSource, bool binaryProgram = false);
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] programName Pointer to string of program name
- * @param[in] separableProgram True if this is a separable program
- *
- * @return No return.
- */
- NVRenderShaderProgram(NVRenderContextImpl &context, NVFoundationBase &fnd,
- const char *programName, bool separableProgram);
-
- /// destructor
- ~NVRenderShaderProgram();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief attach a shader to the program
- *
- * @param[in] pShader Pointer to shader object
- *
- * @return No return.
- */
- template <typename TShaderObject>
- void Attach(TShaderObject *pShader);
-
- /**
- * @brief detach a shader from the program
- *
- * @param[in] pShader Pointer to shader object
- *
- * @return No return.
- */
- template <typename TShaderObject>
- void Detach(TShaderObject *pShader);
-
- /**
- * @brief link a program
- *
- *
- * @return true if succesfuly linked.
- */
- bool Link();
-
- /**
- * @brief set a shader type
- *
- * @param[in] type shader type ( graphics or compute )
- *
- * @return No return.
- */
- void SetProgramType(ProgramType::Enum type) { m_ProgramType = type; }
- ProgramType::Enum GetProgramType() const { return m_ProgramType; }
-
- /**
- * @brief Get Error Message
- *
- * @param[out] messageLength Pointer to error string
- * @param[out] messageLength Size of error meesage
- *
- * @return no return.
- */
- void GetErrorMessage(QT3DSI32 *messageLength, const char *errorMessage);
-
- /**
- * @brief Get Error Message
- *
- *
- * @return error message.
- */
- const char *GetErrorMessage();
-
- /**
- * @brief Query constant class
- *
- * @param[in] constantName Pointer to constant name
- *
- * @return return a pointer to a constant class.
- */
- NVRenderShaderConstantBase *GetShaderConstant(const char *constantName);
-
- /**
- * @brief Query a shader buffer (constant, ... )
- *
- * @param[in] bufferName Pointer to constant name
- *
- * @return return a pointer to a constant class.
- */
- NVRenderShaderBufferBase *GetShaderBuffer(const char *bufferName);
-
- // concrete set functions
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, QT3DSI32 inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSI32_2 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSI32_3 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSI32_4 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, QT3DSRenderBool inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const bool_2 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const bool_3 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const bool_4 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSF32 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSVec2 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSVec3 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSVec4 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSU32 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSU32_2 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSU32_3 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSU32_4 &inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSMat33 &inValue,
- const QT3DSI32 inCount, bool inTranspose = false);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, const QT3DSMat44 &inValue,
- const QT3DSI32 inCount, bool inTranspose = false);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant,
- const NVConstDataRef<QT3DSMat44> inValue, const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, NVRenderTexture2D *inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, NVRenderTexture2D **inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant,
- NVRenderTexture2DArray *inValue, const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, NVRenderTextureCube *inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, NVRenderTextureCube **inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, NVRenderImage2D *inValue,
- const QT3DSI32 inCount);
- void SetConstantValue(NVRenderShaderConstantBase *inConstant, NVRenderDataBuffer *inValue,
- const QT3DSI32 inCount);
-
- /**
- * @brief Template to set constant value via name
- *
- * @param[in] inConstantName Pointer to constant name
- * @param[in] inValue Pointer to data
- * @param[in] inCount Number of elements (array count)
- *
- * @return return a pointer to a constant class.
- */
- template <typename TDataType>
- void SetPropertyValue(const char *inConstantName, const TDataType &inValue,
- const QT3DSI32 inCount = 1)
- {
- NVRenderShaderConstantBase *theConstant = GetShaderConstant(inConstantName);
-
- if (theConstant) {
- if (theConstant->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- SetConstantValue(theConstant, inValue, inCount);
- } else {
- // Types don't match or property not found
- QT3DS_ASSERT(false);
- }
- }
- }
-
- /**
- * @brief Template to set constant value shader constant object
- *
- * @param[in] inConstant Pointer shader constant object
- * @param[in] inValue Pointer to data
- * @param[in] inCount Number of elements (array count)
- *
- * @return return a pointer to a constant class.
- */
- template <typename TDataType>
- void SetPropertyValue(NVRenderShaderConstantBase *inConstant, const TDataType &inValue,
- const QT3DSI32 inCount = 1)
- {
- if (inConstant) {
- if (inConstant->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- SetConstantValue(inConstant, inValue, inCount);
- } else {
- // Types don't match or property not found
- QT3DS_ASSERT(false);
- }
- }
- }
-
- virtual void BindComputeInput(NVRenderDataBuffer *inBuffer, QT3DSU32 inIndex);
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendShaderProgramObject GetShaderProgramHandle() const
- {
- return m_ProgramHandle;
- }
-
- /**
- * @brief get the context object
- *
- * @return context which this shader belongs to.
- */
- NVRenderContextImpl &GetRenderContext();
-
- /**
- * @brief Create a shader program
- *
- * @param[in] context Pointer to context
- * @param[in] programName Name of the program
- * @param[in] vertShaderSource Vertex shader source code
- * @param[in] fragShaderSource Fragment shader source code
- * @param[in] tessControlShaderSource tessellation control shader source code
- * @param[in] tessEvaluationShaderSource tessellation evaluation shader source code
- * @param[in] separateProgram True if this will we a separate
- * program
- * @param[in] type Binary program type
- * @param[in] binaryProgram True if program is binary
- *
- * @return a render result
- */
- static NVRenderVertFragCompilationResult Create(
- NVRenderContextImpl &context, const char *programName,
- NVConstDataRef<QT3DSI8> vertShaderSource, NVConstDataRef<QT3DSI8> fragShaderSource,
- NVConstDataRef<QT3DSI8> tessControlShaderSource = NVConstDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> tessEvaluationShaderSource = NVConstDataRef<QT3DSI8>(),
- NVConstDataRef<QT3DSI8> geometryShaderSource = NVConstDataRef<QT3DSI8>(),
- bool separateProgram = false,
- NVRenderShaderProgramBinaryType::Enum type = NVRenderShaderProgramBinaryType::Unknown,
- bool binaryProgram = false);
-
- /**
- * @brief Create a compute shader program
- *
- * @param[in] context Pointer to context
- * @param[in] programName Name of the program
- * @param[in] computeShaderSource Compute shader source code
- *
- * @return a render result
- */
- static NVRenderVertFragCompilationResult
- CreateCompute(NVRenderContextImpl &context, const char *programName,
- NVConstDataRef<QT3DSI8> computeShaderSource);
- };
-
- // Helper class to cache the lookup of shader properties and apply them quickly in a typesafe
- // way.
- template <typename TDataType>
- struct NVRenderCachedShaderProperty
- {
- NVRenderShaderProgram *m_Shader; ///< pointer to shader program
- NVRenderShaderConstantBase *m_Constant; ///< poiner to shader constant object
-
- NVRenderCachedShaderProperty(const QString &inConstantName, NVRenderShaderProgram &inShader)
- : NVRenderCachedShaderProperty(qPrintable(inConstantName), inShader)
- {
- }
-
- NVRenderCachedShaderProperty(const char *inConstantName, NVRenderShaderProgram &inShader)
- : m_Shader(&inShader)
- , m_Constant(NULL)
- {
- NVRenderShaderConstantBase *theConstant = inShader.GetShaderConstant(inConstantName);
- if (theConstant) {
- if (theConstant->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType>::GetType()) {
- m_Constant = theConstant;
- } else {
- // Property types do not match, this probably indicates that the shader changed
- // while the
- // code creating this object did not change.
- QT3DS_ASSERT(false);
- }
- }
- }
-
- NVRenderCachedShaderProperty()
- : m_Shader(NULL)
- , m_Constant(NULL)
- {
- }
-
- void Set(const TDataType &inValue)
- {
- if (m_Constant)
- m_Shader->SetPropertyValue(m_Constant, inValue);
- }
-
- bool IsValid() const { return m_Constant != 0; }
- };
-
- template <typename TDataType, int size>
- struct NVRenderCachedShaderPropertyArray
- {
- NVRenderShaderProgram *m_Shader; ///< pointer to shader program
- NVRenderShaderConstantBase *m_Constant; ///< poiner to shader constant object
- TDataType m_array[size];
-
- NVRenderCachedShaderPropertyArray(const QString &inConstantName,
- NVRenderShaderProgram &inShader)
- : NVRenderCachedShaderPropertyArray(qPrintable(inConstantName), inShader)
- {
-
- }
-
- NVRenderCachedShaderPropertyArray(const char *inConstantName,
- NVRenderShaderProgram &inShader)
- : m_Shader(&inShader)
- , m_Constant(nullptr)
- {
- memset(m_array, 0, sizeof(m_array));
- NVRenderShaderConstantBase *theConstant = inShader.GetShaderConstant(inConstantName);
- if (theConstant) {
- if (theConstant->m_ElementCount > 1 && theConstant->m_ElementCount <= size &&
- theConstant->GetShaderConstantType()
- == NVDataTypeToShaderDataTypeMap<TDataType*>::GetType()) {
- m_Constant = theConstant;
- } else {
- // Property types do not match, this probably indicates that the shader changed
- // while the code creating this object did not change.
- QT3DS_ASSERT(false);
- }
- }
- }
-
- NVRenderCachedShaderPropertyArray()
- : m_Shader(nullptr)
- , m_Constant(nullptr)
- {
- memset(m_array, 0, sizeof(m_array));
- }
-
- void Set(int count)
- {
- if (m_Constant)
- m_Shader->SetPropertyValue(m_Constant, (TDataType*)m_array, qMin(size, count));
- }
-
- bool IsValid() const { return m_Constant != 0; }
- };
-
- // Helper class to cache the lookup of shader properties and apply them quickly in a typesafe
- // way.
- template <typename TDataType>
- struct NVRenderCachedShaderBuffer
- {
- NVRenderShaderProgram *m_Shader; ///< pointer to shader program
- TDataType m_ShaderBuffer; ///< poiner to shader buffer object
-
- NVRenderCachedShaderBuffer(const char *inShaderBufferName, NVRenderShaderProgram &inShader)
- : m_Shader(&inShader)
- , m_ShaderBuffer(NULL)
- {
- TDataType theShaderBuffer =
- static_cast<TDataType>(inShader.GetShaderBuffer(inShaderBufferName));
- if (theShaderBuffer) {
- m_ShaderBuffer = theShaderBuffer;
- }
- }
- NVRenderCachedShaderBuffer()
- : m_Shader(NULL)
- , m_ShaderBuffer(NULL)
- {
- }
-
- void Set()
- {
- if (m_ShaderBuffer) {
- m_ShaderBuffer->Validate(m_Shader);
- m_ShaderBuffer->Update();
- m_ShaderBuffer->BindToProgram(m_Shader);
- }
- }
-
- bool IsValid() const { return m_ShaderBuffer != 0; }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.cpp
deleted file mode 100644
index ab632189..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderStorageBuffer.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderStorageBuffer::NVRenderStorageBuffer(NVRenderContextImpl &context,
- CRegisteredString bufferName, size_t size,
- NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data, NVRenderDataBuffer *pBuffer)
- : NVRenderDataBuffer(context, context.GetFoundation(), size,
- NVRenderBufferBindValues::Storage, usageType, data)
- , m_Name(bufferName)
- , m_WrappedBuffer(pBuffer)
- , m_Dirty(true)
- {
- QT3DS_ASSERT(context.IsStorageBufferSupported());
-
- if (pBuffer)
- pBuffer->addRef();
- }
-
- NVRenderStorageBuffer::~NVRenderStorageBuffer()
- {
- if (m_WrappedBuffer)
- m_WrappedBuffer->release();
-
- m_Context.BufferDestroyed(*this);
- }
-
- void NVRenderStorageBuffer::Bind()
- {
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to Bind a locked buffer");
- QT3DS_ASSERT(false);
- }
-
- if (m_WrappedBuffer)
- m_WrappedBuffer->Bind();
- else
- m_Backend->BindBuffer(m_BufferHandle, m_BindFlags);
- }
-
- void NVRenderStorageBuffer::BindToShaderProgram(QT3DSU32 index)
- {
- m_Backend->ProgramSetStorageBuffer(
- index, (m_WrappedBuffer) ? m_WrappedBuffer->GetBuffertHandle() : m_BufferHandle);
- }
-
- void NVRenderStorageBuffer::Update()
- {
- // we only update the buffer if it is dirty and we actually have some data
- if (m_Dirty && m_BufferData.size()) {
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, m_BufferData.size(), m_UsageType,
- m_BufferData.begin());
- m_Dirty = false;
- }
- }
-
- void NVRenderStorageBuffer::UpdateData(QT3DSI32 offset, NVDataRef<QT3DSU8> data)
- {
- // we only update the buffer if it is not just a wrapper
- if (!m_WrappedBuffer)
- m_Backend->UpdateBuffer(m_BufferHandle, m_BindFlags, data.size(), m_UsageType,
- data.begin() + offset);
- }
-
- NVRenderStorageBuffer *
- NVRenderStorageBuffer::Create(NVRenderContextImpl &context, const char *bufferName,
- NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData, NVRenderDataBuffer *pBuffer)
- {
- NVFoundationBase &fnd(context.GetFoundation());
- NVRenderStorageBuffer *retval = NULL;
-
- if (context.IsStorageBufferSupported()) {
- CRegisteredString theBufferName(context.GetStringTable().RegisterStr(bufferName));
- QT3DSU32 cbufSize = sizeof(NVRenderStorageBuffer);
- QT3DSU8 *newMem = (QT3DSU8 *)QT3DS_ALLOC(fnd.getAllocator(), cbufSize, "StorageBuffer");
- retval = new (newMem) NVRenderStorageBuffer(
- context, theBufferName, size, usageType,
- toDataRef(const_cast<QT3DSU8 *>(bufferData.begin()), bufferData.size()), pBuffer);
- } else {
- QString errorMsg = QObject::tr("Shader storage buffers are not supported: %1")
- .arg(bufferName);
- qCCritical(INVALID_OPERATION) << errorMsg;
- QT3DS_ALWAYS_ASSERT_MESSAGE(errorMsg.toUtf8());
- }
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.h
deleted file mode 100644
index fefe6b08..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderStorageBuffer.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_STORAGE_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_STORAGE_BUFFER_H
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Utils.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderDataBuffer.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- // forward declaration
- class NVRenderContextImpl;
- class NVRenderVertexBuffer;
-
- ///< Constant (uniform) buffer representation
- class NVRenderStorageBuffer : public NVRenderDataBuffer
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] bufferName Name of the buffer. Must match the name used in programs
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- * @param[in] pBuffer Pointer to the buffer
- *
- * @return No return.
- */
- NVRenderStorageBuffer(NVRenderContextImpl &context, CRegisteredString bufferName,
- size_t size, NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data, NVRenderDataBuffer *pBuffer = NULL);
-
- ///< destructor
- virtual ~NVRenderStorageBuffer();
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- void Bind() override;
-
- /**
- * @brief bind the buffer to a shader program
- *
- * @param[in] index Index of the constant buffer within the program
- *
- * @return no return.
- */
- virtual void BindToShaderProgram(QT3DSU32 index);
-
- /**
- * @brief update the buffer to hardware
- *
- * @return no return.
- */
- virtual void Update();
-
- /**
- * @brief update a piece of memory directly within the storage buffer
- *
- * Note: When you use this function you should know what you are doing.
- * The memory layout within C++ must exactly match the memory layout in the
- *shader.
- * We use std140 (430) layout which guarantees a specific layout behavior across
- *all HW vendors.
- * How the memory layout is computed can be found in the GL spec.
- *
- * @param[in] offset offset into storage buffer
- * @param[in] data pointer to data
- *
- * @return no return
- */
- void UpdateData(QT3DSI32 offset, NVDataRef<QT3DSU8> data);
-
- /**
- * @brief get the buffer name
- *
- * @return the buffer name
- */
- CRegisteredString GetBufferName() const { return m_Name; }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const override
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
-
- /**
- * @brief create a NVRenderStorageBuffer object
- *
- * @param[in] context Pointer to context
- * @param[in] size Size of the buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return the buffer object or NULL
- */
- static NVRenderStorageBuffer *Create(NVRenderContextImpl &context, const char *bufferName,
- NVRenderBufferUsageType::Enum usageType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData,
- NVRenderDataBuffer *pBuffer);
-
- private:
- CRegisteredString m_Name; ///< buffer name
- NVRenderDataBuffer *m_WrappedBuffer; ///< pointer to wrapped buffer
- bool m_Dirty; ///< true if buffer is dirty
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.cpp
deleted file mode 100644
index 02d153a6..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderSync.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSFoundation.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderSync::NVRenderSync(NVRenderContextImpl &context, NVFoundationBase &fnd)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_SyncHandle(NULL)
- {
- }
-
- NVRenderSync::~NVRenderSync()
- {
- if (m_SyncHandle)
- m_Backend->ReleaseSync(m_SyncHandle);
- }
-
- void NVRenderSync::Sync()
- {
- // On every sync call we need to create a new sync object
- // A sync object can only be used once
-
- // First delete the old object
- // We can safely do this because it is actually not deleted until
- // it is unused
- if (m_SyncHandle)
- m_Backend->ReleaseSync(m_SyncHandle);
-
- m_SyncHandle =
- m_Backend->CreateSync(NVRenderSyncType::GpuCommandsComplete, NVRenderSyncFlags());
- }
-
- void NVRenderSync::Wait()
- {
- // wait until the sync object is signaled or a timeout happens
- if (m_SyncHandle)
- m_Backend->WaitSync(m_SyncHandle, NVRenderCommandFlushFlags(), 0);
- }
-
- NVRenderSync *NVRenderSync::Create(NVRenderContextImpl &context)
- {
- if (!context.IsCommandSyncSupported())
- return NULL;
-
- NVRenderSync *retval = QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderSync)(context, context.GetFoundation());
-
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.h
deleted file mode 100644
index 9dfeb28a..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderSync.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SYNC_H
-#define QT3DS_RENDER_SYNC_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
- class NVRenderBackend;
-
- ///< Base class
- class NVRenderSync : public NVRefCounted
- {
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBackend::NVRenderBackendSyncObject m_SyncHandle; ///< opaque backend handle
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderSync(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- virtual ~NVRenderSync();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- /**
- * @brief Get sync type
- *
- * @return Return query type
- */
- virtual NVRenderSyncType::Enum GetSyncType() const
- {
- return NVRenderSyncType::GpuCommandsComplete;
- }
-
- /**
- * @brief Get a pointer to the foundation
- *
- * @return pointer to foundation
- */
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- /**
- * @brief Create a sync object and place it in command stream.
- * Note every syncobject can only be used once.
- * This function creates a new sync object on ever call
- * and deletes the previous one
- *
- * @return no return.
- */
- virtual void Sync();
-
- /**
- * @brief Wait for a sync to be signaled
- * Note this blocks until the sync is signaled
- *
- * @return no return.
- */
- virtual void Wait();
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendSyncObject GetSyncHandle() const
- {
- return m_SyncHandle;
- }
-
- /*
- * @brief static creation function
- *
- * @return a sync object on success
- */
- static NVRenderSync *Create(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.cpp
deleted file mode 100644
index 7a0fd897..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderTessellationShader.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTessControlShader::NVRenderTessControlShader(NVRenderContextImpl &context,
- NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source,
- bool binaryProgram)
- : NVRenderShader(context, fnd, source, binaryProgram)
- , m_ShaderHandle(NULL)
- {
- m_ShaderHandle = m_Backend->CreateTessControlShader(source, m_ErrorMessage, binaryProgram);
- }
-
- NVRenderTessControlShader::~NVRenderTessControlShader()
- {
- if (m_ShaderHandle) {
- m_Backend->ReleaseTessControlShader(m_ShaderHandle);
- }
- }
-
- NVRenderTessEvaluationShader::NVRenderTessEvaluationShader(NVRenderContextImpl &context,
- NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source,
- bool binaryProgram)
- : NVRenderShader(context, fnd, source, binaryProgram)
- , m_ShaderHandle(NULL)
- {
- m_ShaderHandle =
- m_Backend->CreateTessEvaluationShader(source, m_ErrorMessage, binaryProgram);
- }
-
- NVRenderTessEvaluationShader::~NVRenderTessEvaluationShader()
- {
- if (m_ShaderHandle) {
- m_Backend->ReleaseTessEvaluationShader(m_ShaderHandle);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.h
deleted file mode 100644
index b69e56b1..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTessellationShader.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TESSELLATION_SHADER_H
-#define QT3DS_RENDER_TESSELLATION_SHADER_H
-
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderShader.h"
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- ///< This class represents a tessellation control shader
- class NVRenderTessControlShader : public NVRenderShader
- {
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] source Pointer to shader source code
- * @param[in] binaryProgram true if this is a binary program
- *
- * @return No return.
- */
- NVRenderTessControlShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram);
-
- /// @brief destructor
- ~NVRenderTessControlShader();
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- bool IsValid() override { return (m_ShaderHandle != NULL); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendTessControlShaderObject GetShaderHandle()
- {
- return m_ShaderHandle;
- }
-
- private:
- NVRenderBackend::NVRenderBackendTessControlShaderObject
- m_ShaderHandle; ///< opaque backend handle
- };
-
- ///< This class represents a tessellation evaluation shader
- class NVRenderTessEvaluationShader : public NVRenderShader
- {
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] source Pointer to shader source code
- * @param[in] binaryProgram true if this is a binary program
- *
- * @return No return.
- */
- NVRenderTessEvaluationShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram);
-
- /// @brief destructor
- ~NVRenderTessEvaluationShader();
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- bool IsValid() override { return (m_ShaderHandle != NULL); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendTessEvaluationShaderObject GetShaderHandle()
- {
- return m_ShaderHandle;
- }
-
- private:
- NVRenderBackend::NVRenderBackendTessEvaluationShaderObject
- m_ShaderHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.cpp
deleted file mode 100644
index c5ea4750..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderSampler.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTexture2D::NVRenderTexture2D(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget)
- : NVRenderTextureBase(context, fnd, texTarget)
- , m_Width(0)
- , m_Height(0)
- {
- }
-
- NVRenderTexture2D::~NVRenderTexture2D() { m_Context.TextureDestroyed(*this); }
-
- STextureDetails NVRenderTexture2D::GetTextureDetails() const
- {
- return STextureDetails(m_Width, m_Height, 0, m_SampleCount, m_Format);
- }
-
- void NVRenderTexture2D::SetTextureData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel, QT3DSU32 width,
- QT3DSU32 height, NVRenderTextureFormats::Enum format,
- NVRenderTextureFormats::Enum formatDest)
- {
- QT3DS_ASSERT(m_TextureHandle);
-
- // check if we should compress this texture
-
- if (inMipLevel == 0) {
- m_Width = width;
- m_Height = height;
- m_Format = format;
-
- // We re-use textures and this might have been a MSAA texture before
- // for resue we must completely destroy the texture object and create a new one
- // The same is true for immutable textures
- if (m_TexTarget == NVRenderTextureTargetType::Texture2D_MS || m_Immutable) {
- m_Backend->ReleaseTexture(m_TextureHandle);
- m_TexTarget = NVRenderTextureTargetType::Texture2D;
- m_SampleCount = 1;
- m_TextureHandle = m_Backend->CreateTexture();
- }
-
- if (NVRenderTextureFormats::isCompressedTextureFormat(formatDest)) {
- bool compress = NVRenderTextureFormats::isUncompressedTextureFormat(format);
- bool appropriateSizes = ((width % 4) || (height % 4)) == false;
-
- // we only compress multiple of 4 textures
- if (compress && !appropriateSizes)
- compress = false;
-
- if (compress) {
- // This seems like a very dubious line here. If we are compressing then the
- // image
- // is really 1/4 the width and height? - CN
- m_Width = width / 4;
- m_Height = height / 4;
- m_Format = formatDest;
- }
- } else if (NVRenderTextureFormats::isUncompressedTextureFormat(formatDest)) {
- m_Format = formatDest;
- }
- }
-
- if (m_MaxMipLevel < inMipLevel) {
- m_MaxMipLevel = inMipLevel;
- }
-
- // get max size and check value
- QT3DSU32 maxWidth, maxHeight;
- m_Context.getMaxTextureSize(maxWidth, maxHeight);
- if (width > maxWidth || height > maxHeight) {
- qCCritical(INVALID_OPERATION, "Width or height is greater than max texture size (%d, %d)",
- maxWidth, maxHeight);
- }
- if (NVRenderTextureFormats::isUncompressedTextureFormat(format)
- || NVRenderTextureFormats::isDepthTextureFormat(format)) {
- m_Backend->SetTextureData2D(m_TextureHandle, m_TexTarget, inMipLevel, m_Format, width,
- height, 0, format, newBuffer.begin());
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(format)) {
- m_Backend->SetCompressedTextureData2D(m_TextureHandle, m_TexTarget, inMipLevel, format,
- width, height, 0, newBuffer.size(),
- newBuffer.begin());
- }
- // Set our texture parameters to a default that will look the best
- if (inMipLevel > 0)
- SetMinFilter(NVRenderTextureMinifyingOp::LinearMipmapLinear);
- }
-
- void NVRenderTexture2D::SetTextureStorage(QT3DSU32 inLevels, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum formaInternal,
- NVRenderTextureFormats::Enum format,
- NVDataRef<QT3DSU8> dataBuffer)
- {
- QT3DS_ASSERT(m_TextureHandle);
-
- if (!m_Context.IsShaderImageLoadStoreSupported()) {
- qCCritical(INVALID_OPERATION, "The extension Shader_Image_Load_Store is not supported");
- return;
- }
-
- m_Width = width;
- m_Height = height;
- m_Format = formaInternal;
- if (format == NVRenderTextureFormats::Unknown)
- format = formaInternal;
-
- // get max size and check value
- QT3DSU32 maxWidth, maxHeight;
- m_Context.getMaxTextureSize(maxWidth, maxHeight);
- if (width > maxWidth || height > maxHeight) {
- qCCritical(INVALID_OPERATION, "Width or height is greater than max texture size (%d, %d)",
- maxWidth, maxHeight);
- }
-
- if (inLevels < 1) {
- qCCritical(INVALID_PARAMETER, "inLevels is less than 1 (%d)", inLevels);
- }
-
- m_MaxMipLevel = inLevels - 1; // we count from 0
-
- // only uncompressed formats are supported and no depth
- if (NVRenderTextureFormats::isUncompressedTextureFormat(formaInternal)) {
- m_Backend->CreateTextureStorage2D(m_TextureHandle, m_TexTarget, inLevels, formaInternal,
- width, height);
-
- m_Immutable = true;
- m_TexTarget = NVRenderTextureTargetType::Texture2D;
-
- if (dataBuffer.size() > 0)
- m_Backend->SetTextureSubData2D(m_TextureHandle, m_TexTarget, 0, 0, 0, width, height,
- format, dataBuffer.begin());
-
- if (inLevels > 1)
- SetMinFilter(NVRenderTextureMinifyingOp::LinearMipmapLinear);
- }
- }
-
- void NVRenderTexture2D::SetTextureDataMultisample(QT3DSU32 sampleCount, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum format)
- {
- QT3DS_ASSERT(m_TextureHandle);
- QT3DS_ASSERT(m_MaxMipLevel == 0);
-
- m_TexTarget = NVRenderTextureTargetType::Texture2D_MS;
-
- QT3DSU32 maxWidth, maxHeight;
- m_Context.getMaxTextureSize(maxWidth, maxHeight);
- if (width > maxWidth || height > maxHeight) {
- qCCritical(INVALID_OPERATION, "Width or height is greater than max texture size (%d, %d)",
- maxWidth, maxHeight);
- }
-
- QT3DS_ASSERT(NVRenderTextureFormats::isUncompressedTextureFormat(format)
- || NVRenderTextureFormats::isDepthTextureFormat(format));
-
- m_Backend->SetMultisampledTextureData2D(m_TextureHandle, m_TexTarget, sampleCount, format,
- width, height, true);
-
- m_Width = width;
- m_Height = height;
- m_SampleCount = sampleCount;
- m_Format = format;
- }
-
- void NVRenderTexture2D::SetTextureSubData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel,
- QT3DSU32 inXOffset, QT3DSU32 inYOffset, QT3DSU32 width,
- QT3DSU32 height, NVRenderTextureFormats::Enum format)
- {
- QT3DS_ASSERT(m_TextureHandle);
-
- if (!NVRenderTextureFormats::isUncompressedTextureFormat(format)) {
- qCCritical(INVALID_PARAMETER, "Cannot set sub data for depth or compressed formats");
- QT3DS_ASSERT(false);
- return;
- }
- QT3DSU32 subRectStride = width * NVRenderTextureFormats::getSizeofFormat(format);
- if (newBuffer.size() < subRectStride * height) {
- qCCritical(INVALID_PARAMETER, "Invalid sub rect buffer size");
- QT3DS_ASSERT(false);
- return;
- }
- // nop
- if (width == 0 || height == 0)
- return;
-
- if (inXOffset + width > m_Width || inYOffset + height > m_Height) {
- qCCritical(INVALID_PARAMETER, "Sub rect outside existing image bounds");
- QT3DS_ASSERT(false);
- return;
- }
-
- // not handled yet
- QT3DS_ASSERT(!NVRenderTextureFormats::isDepthTextureFormat(format));
-
- m_Backend->SetTextureSubData2D(m_TextureHandle, m_TexTarget, inMipLevel, inXOffset,
- inYOffset, width, height, format, newBuffer.begin());
- }
-
- void NVRenderTexture2D::GenerateMipmaps(NVRenderHint::Enum genType)
- {
- applyTexParams();
- m_Backend->GenerateMipMaps(m_TextureHandle, m_TexTarget, genType);
- QT3DSU32 maxDim = (m_Width >= m_Height) ? m_Width : m_Height;
- m_MaxMipLevel = static_cast<QT3DSU32>(logf((float)maxDim) / logf(2.0f));
- // we never create more level than m_MaxLevel
- m_MaxMipLevel = qt3ds::NVMin(m_MaxMipLevel, (QT3DSU32)m_MaxLevel);
- }
-
- void NVRenderTexture2D::Bind()
- {
- m_TextureUnit = m_Context.GetNextTextureUnit();
-
- m_Backend->BindTexture(m_TextureHandle, m_TexTarget, m_TextureUnit);
-
- applyTexParams();
- applyTexSwizzle();
- }
-
- NVRenderTexture2D *NVRenderTexture2D::Create(NVRenderContextImpl &context)
- {
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderTexture2D)(context, context.GetFoundation());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.h
deleted file mode 100644
index 29c7c1b4..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2D.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_TEXTURE_2D_H
-#define QT3DS_RENDER_QT3DS_RENDER_TEXTURE_2D_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "render/Qt3DSRenderTextureBase.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
- class NVRenderTextureSampler;
-
- class NVRenderTexture2D : public NVRenderTextureBase, public NVRenderImplemented
- {
-
- private:
- QT3DSU32 m_Width; ///< texture width
- QT3DSU32 m_Height; ///< texture height
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] texTarget Texture target
- *
- * @return No return.
- */
- NVRenderTexture2D(
- NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget = NVRenderTextureTargetType::Texture2D);
-
- virtual ~NVRenderTexture2D();
-
- // Get the texture details for mipmap level 0 if it was set.
- STextureDetails GetTextureDetails() const override;
-
- /**
- * @brief Create GL texture object and upload data
- *
- * @param[in] newBuffer Texture data for level 0
- * @param[in] inMipLevel Texture level count
- * @param[in] width Texture width
- * @param[in] height Texture height
- * @param[in] format Texture data format
- * @param[in] formaInternal Texture internal format
- *
- * @return No return.
- */
- virtual void SetTextureData(
- NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum format,
- NVRenderTextureFormats::Enum formaInternal = NVRenderTextureFormats::Unknown);
-
- /**
- * @brief Create memory storage for a texture object
- * This create a texture storage which is immutable in size and format
- * Use this for textures used within compute shaders
- *
- * @param[in] inLevels Texture level count
- * @param[in] width Texture width
- * @param[in] height Texture height
- * @param[in] formaInternal Texture internal format
- * @param[in] format Texture data format of dataBuffer
- * @param[in] dataBuffer Texture data for level 0
- *
- * @return No return.
- */
- virtual void
- SetTextureStorage(QT3DSU32 inLevels, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum formaInternal,
- NVRenderTextureFormats::Enum format = NVRenderTextureFormats::Unknown,
- NVDataRef<QT3DSU8> dataBuffer = NVDataRef<QT3DSU8>());
-
- virtual void SetTextureDataMultisample(QT3DSU32 sampleCount, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum format);
-
- bool IsMultisampleTexture() const override
- {
- return (m_TexTarget == NVRenderTextureTargetType::Texture2D_MS);
- }
- QT3DSU32 GetSampleCount() const override { return m_SampleCount; }
- bool IsImmutableTexture() const override { return m_Immutable; }
-
- // Update a sub-rect of the image. newBuffer is expected to be a continguous subrect of the
- // image.
- virtual void SetTextureSubData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel, QT3DSU32 inXOffset,
- QT3DSU32 inYOffset, QT3DSU32 inSubImageWidth,
- QT3DSU32 inSubImageHeight, NVRenderTextureFormats::Enum format);
- // Generate a set of mipmaps from mipLevel( 0 ). Uses the graphis layer to do this if
- // possible
- // glGenerateMipmap
- virtual void GenerateMipmaps(NVRenderHint::Enum genType = NVRenderHint::Nicest);
-
- /**
- * @brief Bind a texture for shader access
- *
- *
- * @return No return.
- */
- void Bind() override;
-
- QT3DSU32 GetNumMipmaps() override { return m_MaxMipLevel; }
-
- /**
- * @brief Query if texture needs coordinate swizzle
- *
- * @return texture swizzle mode
- */
- NVRenderTextureSwizzleMode::Enum GetTextureSwizzleMode() override
- {
- // if our backend supports hardware texture swizzle then there is no need for a shader
- // swizzle
- return (m_Backend->GetRenderBackendCap(
- NVRenderBackend::NVRenderBackendCaps::TexSwizzle))
- ? NVRenderTextureSwizzleMode::NoSwizzle
- : m_Backend->GetTextureSwizzleMode(m_Format);
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_TextureHandle);
- }
-
- static NVRenderTexture2D *Create(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.cpp
deleted file mode 100644
index fc0dfa45..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderSampler.h"
-#include "render/Qt3DSRenderTexture2DArray.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTexture2DArray::NVRenderTexture2DArray(NVRenderContextImpl &context,
- NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget)
- : NVRenderTextureBase(context, fnd, texTarget)
- , m_Width(0)
- , m_Height(0)
- , m_Slices(0)
- {
- }
-
- NVRenderTexture2DArray::~NVRenderTexture2DArray() { m_Context.TextureDestroyed(*this); }
-
- void NVRenderTexture2DArray::SetTextureData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel,
- QT3DSU32 width, QT3DSU32 height, QT3DSU32 slices,
- NVRenderTextureFormats::Enum format)
- {
- QT3DS_ASSERT(m_TextureHandle);
-
- if (inMipLevel == 0) {
- m_Width = width;
- m_Height = height;
- m_Slices = slices;
- m_Format = format;
- m_MaxMipLevel = inMipLevel;
- }
-
- if (m_MaxMipLevel < inMipLevel) {
- m_MaxMipLevel = inMipLevel;
- }
-
- // get max size and check value
- QT3DSI32 theMaxLayerSize, theMaxSize;
- m_Backend->GetRenderBackendValue(NVRenderBackend::NVRenderBackendQuery::MaxTextureSize,
- &theMaxSize);
- m_Backend->GetRenderBackendValue(
- NVRenderBackend::NVRenderBackendQuery::MaxTextureArrayLayers, &theMaxLayerSize);
- if (width > (QT3DSU32)theMaxSize || height > (QT3DSU32)theMaxSize
- || slices > (QT3DSU32)theMaxLayerSize) {
- qCCritical(INVALID_OPERATION,
- "Width or height or Slices is greater than max texture size (%d, %d, %d)",
- theMaxSize, theMaxSize, theMaxLayerSize);
- }
-
- // currently we do not support compressed texture arrays
- QT3DS_ASSERT(NVRenderTextureFormats::isUncompressedTextureFormat(format)
- || NVRenderTextureFormats::isDepthTextureFormat(format));
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(format)
- || NVRenderTextureFormats::isDepthTextureFormat(format)) {
- m_Backend->SetTextureData3D(m_TextureHandle, m_TexTarget, inMipLevel, m_Format, width,
- height, slices, 0, format, newBuffer.begin());
- }
-
- // Set our texture parameters to a default that will look the best
- if (inMipLevel > 0)
- SetMinFilter(NVRenderTextureMinifyingOp::LinearMipmapLinear);
- }
-
- STextureDetails NVRenderTexture2DArray::GetTextureDetails() const
- {
- return STextureDetails(m_Width, m_Height, m_Slices, m_SampleCount, m_Format);
- }
-
- void NVRenderTexture2DArray::Bind()
- {
- m_TextureUnit = m_Context.GetNextTextureUnit();
-
- m_Backend->BindTexture(m_TextureHandle, m_TexTarget, m_TextureUnit);
-
- applyTexParams();
- applyTexSwizzle();
- }
-
- NVRenderTexture2DArray *NVRenderTexture2DArray::Create(NVRenderContextImpl &context)
- {
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderTexture2DArray)(context, context.GetFoundation());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.h
deleted file mode 100644
index 30ed6dbb..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTexture2DArray.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_TEXTURE_2D_ARRAY_H
-#define QT3DS_RENDER_QT3DS_RENDER_TEXTURE_2D_ARRAY_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "render/Qt3DSRenderTextureBase.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
- class NVRenderTextureSampler;
-
- class QT3DS_AUTOTEST_EXPORT NVRenderTexture2DArray : public NVRenderTextureBase
- {
- private:
- QT3DSU32 m_Width; ///< texture width
- QT3DSU32 m_Height; ///< texture height
- QT3DSU32 m_Slices; ///< texture slices
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] texTarget Texture target
- *
- * @return No return.
- */
- NVRenderTexture2DArray(
- NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget = NVRenderTextureTargetType::Texture2D_Array);
-
- virtual ~NVRenderTexture2DArray();
-
- /**
- * @brief constructor
- *
- * @param[in] newBuffer Pointer to pixel buffer
- * @param[in] inMipLevel Pointer to foundation
- * @param[in] width Texture target
- * @param[in] height Texture target
- * @param[in] slices Texture target
- * @param[in] format Texture target
- *
- * @return No return.
- */
- void SetTextureData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel, QT3DSU32 width, QT3DSU32 height,
- QT3DSU32 slices, NVRenderTextureFormats::Enum format);
-
- // Get the texture details for mipmap level 0 if it was set.
- STextureDetails GetTextureDetails() const override;
-
- /**
- * @brief Bind a texture for shader access
- *
- *
- * @return No return.
- */
- void Bind() override;
-
- /**
- * @brief create a texture array object
- *
- *
- * @ return a texture array object
- */
- static NVRenderTexture2DArray *Create(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.cpp
deleted file mode 100644
index c1c3e97d..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderSampler.h"
-#include "render/Qt3DSRenderTextureBase.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTextureBase::NVRenderTextureBase(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget)
- : m_Context(context)
- , m_Foundation(fnd)
- , mRefCount(0)
- , m_Backend(context.GetBackend())
- , m_TextureHandle(NULL)
- , m_TextureUnit(QT3DS_MAX_U32)
- , m_SamplerParamsDirty(true)
- , m_TexStateDirty(false)
- , m_SampleCount(1)
- , m_Format(NVRenderTextureFormats::Unknown)
- , m_TexTarget(texTarget)
- , m_BaseLevel(0)
- , m_MaxLevel(1000)
- , m_MaxMipLevel(0)
- , m_Immutable(false)
- {
- m_TextureHandle = m_Backend->CreateTexture();
- m_Sampler = QT3DS_NEW(m_Context.GetFoundation().getAllocator(),
- NVRenderTextureSampler)(context, context.GetFoundation());
- }
-
- NVRenderTextureBase::~NVRenderTextureBase()
- {
- if (m_Sampler)
- QT3DS_FREE(m_Context.GetFoundation().getAllocator(), m_Sampler);
- if (m_TextureHandle)
- m_Backend->ReleaseTexture(m_TextureHandle);
- }
-
- void NVRenderTextureBase::SetBaseLevel(QT3DSI32 value)
- {
- if (m_BaseLevel != value) {
- m_BaseLevel = value;
- m_TexStateDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetMaxLevel(QT3DSI32 value)
- {
- if (m_MaxLevel != value) {
- m_MaxLevel = value;
- m_TexStateDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetMinFilter(NVRenderTextureMinifyingOp::Enum value)
- {
- if (m_Sampler->m_MinFilter != value) {
- m_Sampler->m_MinFilter = value;
- m_SamplerParamsDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetMagFilter(NVRenderTextureMagnifyingOp::Enum value)
- {
- if (m_Sampler->m_MagFilter != value) {
- m_Sampler->m_MagFilter = value;
- m_SamplerParamsDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetTextureWrapS(NVRenderTextureCoordOp::Enum value)
- {
- if (m_Sampler->m_WrapS != value) {
- m_Sampler->m_WrapS = value;
- m_SamplerParamsDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetTextureWrapT(NVRenderTextureCoordOp::Enum value)
- {
- if (m_Sampler->m_WrapT != value) {
- m_Sampler->m_WrapT = value;
- m_SamplerParamsDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetTextureCompareMode(NVRenderTextureCompareMode::Enum value)
- {
- if (m_Sampler->m_CompareMode != value) {
- m_Sampler->m_CompareMode = value;
- m_SamplerParamsDirty = true;
- }
- }
-
- void NVRenderTextureBase::SetTextureCompareFunc(NVRenderTextureCompareOp::Enum value)
- {
- if (m_Sampler->m_CompareOp != value) {
- m_Sampler->m_CompareOp = value;
- m_SamplerParamsDirty = true;
- }
- }
-
- static GLfloat getMaxAnisotropy()
- {
- static GLfloat val = (GLfloat)qEnvironmentVariableIntValue("QT3DS_ANISOTROPIC_VALUE");
- return val > 0 ? val : 1.0f;
- }
-
- void NVRenderTextureBase::applyTexParams()
- {
- if (m_SamplerParamsDirty) {
- m_Backend->UpdateSampler(m_Sampler->GetSamplerHandle(), m_TexTarget,
- m_Sampler->m_MinFilter, m_Sampler->m_MagFilter,
- m_Sampler->m_WrapS, m_Sampler->m_WrapT, m_Sampler->m_WrapR,
- m_Sampler->m_MinLod, m_Sampler->m_MaxLod, m_Sampler->m_LodBias,
- m_Sampler->m_CompareMode, m_Sampler->m_CompareOp,
- getMaxAnisotropy());
-
- m_SamplerParamsDirty = false;
- }
-
- if (m_TexStateDirty) {
- m_Backend->UpdateTextureObject(m_TextureHandle, m_TexTarget, m_BaseLevel, m_MaxLevel);
- m_TexStateDirty = false;
- }
- }
-
- void NVRenderTextureBase::applyTexSwizzle()
- {
- NVRenderTextureSwizzleMode::Enum theSwizzleMode =
- m_Backend->GetTextureSwizzleMode(m_Format);
- if (theSwizzleMode != m_Sampler->m_SwizzleMode) {
- m_Sampler->m_SwizzleMode = theSwizzleMode;
- m_Backend->UpdateTextureSwizzle(m_TextureHandle, m_TexTarget, theSwizzleMode);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.h
deleted file mode 100644
index 872a634e..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureBase.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_TEXTURE_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_TEXTURE_BUFFER_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
- class NVRenderTextureSampler;
-
- struct STextureDetails
- {
- QT3DSU32 m_Width;
- QT3DSU32 m_Height;
- QT3DSU32 m_Depth;
- QT3DSU32 m_SampleCount;
- NVRenderTextureFormats::Enum m_Format;
-
- STextureDetails(QT3DSU32 w, QT3DSU32 h, QT3DSU32 d, QT3DSU32 samples, NVRenderTextureFormats::Enum f)
- : m_Width(w)
- , m_Height(h)
- , m_Depth(d)
- , m_SampleCount(samples)
- , m_Format(f)
- {
- }
- STextureDetails()
- : m_Width(0)
- , m_Height(0)
- , m_Depth(0)
- , m_SampleCount(1)
- , m_Format(NVRenderTextureFormats::Unknown)
- {
- }
- };
-
- class NVRenderTextureBase : public NVRefCounted
- {
-
- protected:
- NVRenderContextImpl &m_Context; ///< pointer to context
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- volatile QT3DSI32 mRefCount; ///< Using foundations' naming convention to ease implementation
- NVRenderBackend *m_Backend; ///< pointer to backend
- NVRenderBackend::NVRenderBackendTextureObject m_TextureHandle; ///< opaque backend handle
- QT3DSU32 m_TextureUnit; ///< texture unit this texture should use
- bool m_SamplerParamsDirty; ///< true if sampler state is dirty
- bool m_TexStateDirty; ///< true if texture object state is dirty
- QT3DSU32 m_SampleCount; ///< texture height
- NVRenderTextureFormats::Enum m_Format; ///< texture format
- NVRenderTextureTargetType::Enum m_TexTarget; ///< texture target
- NVRenderTextureSampler *m_Sampler; ///< current texture sampler state
- QT3DSI32 m_BaseLevel; ///< minimum lod specified
- QT3DSI32 m_MaxLevel; ///< maximum lod specified
- QT3DSU32 m_MaxMipLevel; ///< highest mip level
- bool m_Immutable; ///< true if this is a immutable texture ( size and format )
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] texTarget Texture target
- *
- * @return No return.
- */
- NVRenderTextureBase(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget);
-
- virtual ~NVRenderTextureBase();
-
- // define refcount functions
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation)
-
- virtual void SetMinFilter(NVRenderTextureMinifyingOp::Enum value);
- virtual void SetMagFilter(NVRenderTextureMagnifyingOp::Enum value);
-
- virtual void SetBaseLevel(QT3DSI32 value);
- virtual void SetMaxLevel(QT3DSI32 value);
-
- virtual void SetTextureWrapS(NVRenderTextureCoordOp::Enum value);
- virtual void SetTextureWrapT(NVRenderTextureCoordOp::Enum value);
-
- virtual void SetTextureCompareMode(NVRenderTextureCompareMode::Enum value);
- virtual void SetTextureCompareFunc(NVRenderTextureCompareOp::Enum value);
-
- virtual void SetTextureUnit(QT3DSU32 unit) { m_TextureUnit = unit; }
- virtual QT3DSU32 GetTextureUnit() const { return m_TextureUnit; }
-
- // Get the texture details for mipmap level 0 if it was set.
- virtual STextureDetails GetTextureDetails() const = 0;
-
- virtual bool IsMultisampleTexture() const
- {
- return (m_TexTarget == NVRenderTextureTargetType::Texture2D_MS);
- }
- virtual QT3DSU32 GetSampleCount() const { return m_SampleCount; }
- virtual bool IsImmutableTexture() const { return m_Immutable; }
-
- /**
- * @brief Bind a texture for shader access
- *
- *
- * @return No return.
- */
- virtual void Bind() = 0;
-
- virtual QT3DSU32 GetNumMipmaps() { return m_MaxMipLevel; }
-
- /**
- * @brief Query if texture needs coordinate swizzle
- *
- * @return texture swizzle mode
- */
- virtual NVRenderTextureSwizzleMode::Enum GetTextureSwizzleMode()
- {
- // if our backend supports hardware texture swizzle then there is no need for a shader
- // swizzle
- return (m_Backend->GetRenderBackendCap(
- NVRenderBackend::NVRenderBackendCaps::TexSwizzle))
- ? NVRenderTextureSwizzleMode::NoSwizzle
- : m_Backend->GetTextureSwizzleMode(m_Format);
- }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendTextureObject GetTextureObjectHandle()
- {
- return m_TextureHandle;
- }
-
- protected:
- void applyTexParams();
- void applyTexSwizzle();
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.cpp
deleted file mode 100644
index 0919daf3..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/vector.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderSampler.h"
-#include "render/Qt3DSRenderTextureCube.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTextureCube::NVRenderTextureCube(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget)
- : NVRenderTextureBase(context, fnd, texTarget)
- , m_Width(0)
- , m_Height(0)
- {
- }
-
- NVRenderTextureCube::~NVRenderTextureCube() { m_Context.TextureDestroyed(*this); }
-
- void NVRenderTextureCube::SetTextureData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel,
- NVRenderTextureCubeFaces::Enum inFace, QT3DSU32 width,
- QT3DSU32 height, NVRenderTextureFormats::Enum format)
- {
- QT3DS_ASSERT(m_TextureHandle);
- QT3DS_ASSERT(inFace != NVRenderTextureCubeFaces::InvalidFace);
-
- if (inMipLevel == 0) {
- m_Width = width;
- m_Height = height;
- m_Format = format;
- m_MaxMipLevel = inMipLevel;
- }
-
- if (m_MaxMipLevel < inMipLevel) {
- m_MaxMipLevel = inMipLevel;
- }
-
- // get max size and check value
- QT3DSI32 theMaxSize;
- m_Backend->GetRenderBackendValue(NVRenderBackend::NVRenderBackendQuery::MaxTextureSize,
- &theMaxSize);
- if (width > (QT3DSU32)theMaxSize || height > (QT3DSU32)theMaxSize) {
- qCCritical(INVALID_OPERATION, "Width or height is greater than max texture size (%d, %d)",
- theMaxSize, theMaxSize);
- }
-
- NVRenderTextureTargetType::Enum outTarget =
- static_cast<NVRenderTextureTargetType::Enum>((int)m_TexTarget + (int)inFace);
- if (NVRenderTextureFormats::isUncompressedTextureFormat(format)
- || NVRenderTextureFormats::isDepthTextureFormat(format)) {
- m_Backend->SetTextureDataCubeFace(m_TextureHandle, outTarget, inMipLevel, format, width,
- height, 0, format, newBuffer.begin());
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(format)) {
- m_Backend->SetCompressedTextureDataCubeFace(m_TextureHandle, outTarget, inMipLevel,
- format, width, height, 0, newBuffer.size(),
- newBuffer.begin());
- }
-
- // Set our texture parameters to a default that will look the best
- if (inMipLevel > 0)
- SetMinFilter(NVRenderTextureMinifyingOp::LinearMipmapLinear);
- }
-
- STextureDetails NVRenderTextureCube::GetTextureDetails() const
- {
- return STextureDetails(m_Width, m_Height, 6, m_SampleCount, m_Format);
- }
-
- void NVRenderTextureCube::Bind()
- {
- m_TextureUnit = m_Context.GetNextTextureUnit();
-
- m_Backend->BindTexture(m_TextureHandle, m_TexTarget, m_TextureUnit);
-
- applyTexParams();
- applyTexSwizzle();
- }
-
- NVRenderTextureCube *NVRenderTextureCube::Create(NVRenderContextImpl &context)
- {
- return QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderTextureCube)(context, context.GetFoundation());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.h
deleted file mode 100644
index 7310d44d..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTextureCube.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_TEXTURE_CUBE_H
-#define QT3DS_RENDER_QT3DS_RENDER_TEXTURE_CUBE_H
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "render/Qt3DSRenderTextureBase.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderContextImpl;
- class NVRenderTextureSampler;
-
- class NVRenderTextureCube : public NVRenderTextureBase
- {
- private:
- QT3DSU32 m_Width; ///< texture width (per face)
- QT3DSU32 m_Height; ///< texture height (per face)
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- * @param[in] texTarget Texture target
- *
- * @return No return.
- */
- NVRenderTextureCube(
- NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVRenderTextureTargetType::Enum texTarget = NVRenderTextureTargetType::TextureCube);
-
- virtual ~NVRenderTextureCube();
-
- /**
- * @brief constructor
- *
- * @param[in] newBuffer Pointer to pixel buffer
- * @param[in] inMipLevel Pointer to foundation
- * @param[in] width Texture target
- * @param[in] height Texture target
- * @param[in] slices Texture target
- * @param[in] format Texture target
- *
- * @return No return.
- */
- void SetTextureData(NVDataRef<QT3DSU8> newBuffer, QT3DSU8 inMipLevel,
- NVRenderTextureCubeFaces::Enum inFace, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum format);
-
- // Get the texture details for mipmap level 0 if it was set.
- STextureDetails GetTextureDetails() const override;
-
- /**
- * @brief Bind a texture for shader access
- *
- *
- * @return No return.
- */
- void Bind() override;
-
- /**
- * @brief create a texture array object
- *
- *
- * @ return a texture array object
- */
- static NVRenderTextureCube *Create(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.cpp
deleted file mode 100644
index 4184436a..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderTimerQuery.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderTimerQuery::NVRenderTimerQuery(NVRenderContextImpl &context, NVFoundationBase &fnd)
- : NVRenderQueryBase(context, fnd)
- {
- }
-
- NVRenderTimerQuery::~NVRenderTimerQuery() {}
-
- void NVRenderTimerQuery::Begin()
- {
- m_Backend->BeginQuery(m_QueryHandle, NVRenderQueryType::Timer);
- }
-
- void NVRenderTimerQuery::End() { m_Backend->EndQuery(m_QueryHandle, NVRenderQueryType::Timer); }
-
- void NVRenderTimerQuery::GetResult(QT3DSU32 *params)
- {
- m_Backend->GetQueryResult(m_QueryHandle, NVRenderQueryResultType::Result, params);
- }
-
- void NVRenderTimerQuery::GetResult(QT3DSU64 *params)
- {
- m_Backend->GetQueryResult(m_QueryHandle, NVRenderQueryResultType::Result, params);
- }
-
- void NVRenderTimerQuery::SetTimerQuery() { m_Backend->SetQueryTimer(m_QueryHandle); }
-
- NVRenderTimerQuery *NVRenderTimerQuery::Create(NVRenderContextImpl &context)
- {
- if (!context.IsTimerQuerySupported())
- return NULL;
-
- NVRenderTimerQuery *retval = QT3DS_NEW(context.GetFoundation().getAllocator(),
- NVRenderTimerQuery)(context, context.GetFoundation());
-
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.h
deleted file mode 100644
index f909f374..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderTimerQuery.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TIMER_QUERY_H
-#define QT3DS_RENDER_TIMER_QUERY_H
-
-#include "render/Qt3DSRenderQueryBase.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
-
- class NVRenderTimerQuery : public NVRenderQueryBase
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] fnd Pointer to foundation
- *
- * @return No return.
- */
- NVRenderTimerQuery(NVRenderContextImpl &context, NVFoundationBase &fnd);
-
- ///< destructor
- ~NVRenderTimerQuery();
-
- /**
- * @brief Get query type
- *
- * @return Return query type
- */
- NVRenderQueryType::Enum GetQueryType() const override
- {
- return NVRenderQueryType::Timer;
- }
-
- /**
- * @brief Get a pointer to the foundation
- *
- * @return pointer to foundation
- */
- NVFoundationBase &GetFoundation() { return m_Foundation; }
-
- /**
- * @brief begin a query
- *
- * @return no return.
- */
- void Begin() override;
-
- /**
- * @brief end a query
- *
- * @return no return.
- */
- void End() override;
-
- /**
- * @brief Get the result of a query
- *
- * @param[out] params Contains result of query regarding query type
- *
- * @return no return.
- */
- void GetResult(QT3DSU32 *params) override;
-
- /**
- * @brief Get the result of a query
- *
- * @param[out] params Contains result of query regarding query type
- *
- * @return no return.
- */
- virtual void GetResult(QT3DSU64 *params);
-
- /**
- * @brief Places an absolute timer query into the render queue
- * The result can be queried with GetResult
- *
- * @return no return.
- */
- virtual void SetTimerQuery();
-
- /*
- * @brief static creation function
- *
- * * @return a timer query object on success
- */
- static NVRenderTimerQuery *Create(NVRenderContextImpl &context);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.cpp
deleted file mode 100644
index 89d6204e..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderVertexBuffer::NVRenderVertexBuffer(NVRenderContextImpl &context, size_t size,
- QT3DSU32 stride, NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usageType,
- NVDataRef<QT3DSU8> data)
- : NVRenderDataBuffer(context, context.GetFoundation(), size, bindFlags, usageType, data)
- , m_Stride(stride)
- {
- QT3DS_ASSERT(m_Stride);
- }
-
- NVRenderVertexBuffer::~NVRenderVertexBuffer() { m_Context.BufferDestroyed(*this); }
-
- void NVRenderVertexBuffer::Bind()
- {
- if (m_Mapped) {
- qCCritical(INVALID_OPERATION, "Attempting to Bind a locked buffer");
- QT3DS_ASSERT(false);
- }
-
- m_Backend->BindBuffer(m_BufferHandle, m_BindFlags);
- }
-
- NVRenderVertexBuffer *NVRenderVertexBuffer::Create(NVRenderContextImpl &context,
- NVRenderBufferUsageType::Enum usageType,
- size_t size, QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVFoundationBase &fnd(context.GetFoundation());
-
- QT3DSU32 vbufSize = sizeof(NVRenderVertexBuffer);
- QT3DSU8 *newMem = (QT3DSU8 *)QT3DS_ALLOC(fnd.getAllocator(), vbufSize, "VertexBuffer");
- NVRenderVertexBuffer *retval = new (newMem) NVRenderVertexBuffer(
- context, size, stride, NVRenderBufferBindValues::Vertex, usageType,
- toDataRef(const_cast<QT3DSU8 *>(bufferData.begin()), bufferData.size()));
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.h
deleted file mode 100644
index 914afe27..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexBuffer.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_QT3DS_RENDER_VERTEX_BUFFER_H
-#define QT3DS_RENDER_QT3DS_RENDER_VERTEX_BUFFER_H
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Utils.h"
-#include "render/Qt3DSRenderDrawable.h"
-#include "render/Qt3DSRenderDataBuffer.h"
-
-namespace qt3ds {
-namespace render {
-
- // forward declaration
- class NVRenderContextImpl;
-
- ///< Vertex buffer representation
- class NVRenderVertexBuffer : public NVRenderDataBuffer
- {
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to context
- * @param[in] entries Vertex buffer attribute layout entries
- * @param[in] size Size of the buffer
- * @param[in] bindFlags Where to binf this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- *application.
- *
- * @return No return.
- */
- NVRenderVertexBuffer(NVRenderContextImpl &context, size_t size, QT3DSU32 stride,
- NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usageType, NVDataRef<QT3DSU8> data);
-
- ///< destructor
- virtual ~NVRenderVertexBuffer();
-
- /**
- * @brief return vertex data stride
- *
- * @return data stride.
- */
- virtual QT3DSU32 GetStride() const { return m_Stride; }
-
- /**
- * @brief get vertex count
- *
- * @return vertex count
- */
- virtual QT3DSU32 GetNumVertexes() const
- {
- QT3DS_ASSERT((m_BufferCapacity % m_Stride) == 0);
- return m_BufferCapacity / m_Stride;
- }
-
- /**
- * @brief bind the buffer bypasses the context state
- *
- * @return no return.
- */
- void Bind() override;
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- NVRenderBackend::NVRenderBackendBufferObject GetBuffertHandle() const override
- {
- return m_BufferHandle;
- }
-
- // this will be obsolete
- const void *GetImplementationHandle() const override
- {
- return reinterpret_cast<void *>(m_BufferHandle);
- }
-
- // No stride means that stride is calculated from the size of last entry found via entry
- // offset
- // Leaves this buffer temporarily bound.
- static NVRenderVertexBuffer *Create(NVRenderContextImpl &context,
- NVRenderBufferUsageType::Enum usageType, size_t size,
- QT3DSU32 stride, NVConstDataRef<QT3DSU8> bufferData);
-
- private:
- QT3DSU32 m_Stride; ///< veretex data stride
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.cpp b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.cpp
deleted file mode 100644
index 3a53ad50..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderVertexShader.h"
-
-namespace qt3ds {
-namespace render {
-
- NVRenderVertexShader::NVRenderVertexShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram)
- : NVRenderShader(context, fnd, source, binaryProgram)
- , m_ShaderHandle(NULL)
- {
- m_ShaderHandle = m_Backend->CreateVertexShader(source, m_ErrorMessage, binaryProgram);
- }
-
- NVRenderVertexShader::~NVRenderVertexShader()
- {
- if (m_ShaderHandle) {
- m_Backend->ReleaseVertexShader(m_ShaderHandle);
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.h b/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.h
deleted file mode 100644
index 0a96045b..00000000
--- a/src/Runtime/ogl-runtime/src/render/Qt3DSRenderVertexShader.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_VERTEX_SHADER_H
-#define QT3DS_RENDER_VERTEX_SHADER_H
-
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderShader.h"
-
-namespace qt3ds {
-namespace render {
- using namespace foundation;
-
- class NVRenderContextImpl;
-
- ///< This class represents a vertex shader
- class NVRenderVertexShader : public NVRenderShader
- {
-
- public:
- /**
- * @brief constructor
- *
- * @param[in] context Pointer to render context
- * @param[in] fnd Pointer to foundation
- * @param[in] source Pointer to shader source code
- * @param[in] binaryProgram true if this is a binary program
- *
- * @return No return.
- */
- NVRenderVertexShader(NVRenderContextImpl &context, NVFoundationBase &fnd,
- NVConstDataRef<QT3DSI8> source, bool binaryProgram);
-
- /// @brief destructor
- ~NVRenderVertexShader();
-
- /**
- * @brief Query if shader compiled succesfuly
- *
- * @return True if shader is valid.
- */
- bool IsValid() override { return (m_ShaderHandle != NULL); }
-
- /**
- * @brief get the backend object handle
- *
- * @return the backend object handle.
- */
- virtual NVRenderBackend::NVRenderBackendVertexShaderObject GetShaderHandle()
- {
- return m_ShaderHandle;
- }
-
- private:
- NVRenderBackend::NVRenderBackendVertexShaderObject
- m_ShaderHandle; ///< opaque backend handle
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/Qt3DSRenderBackend.h b/src/Runtime/ogl-runtime/src/render/backends/Qt3DSRenderBackend.h
deleted file mode 100644
index 12de5d88..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/Qt3DSRenderBackend.h
+++ /dev/null
@@ -1,2245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_H
-#define QT3DS_RENDER_BACKEND_H
-
-/// @file Qt3DSRenderBackend.h
-/// NVRender backend definition.
-
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Qt3DSNoCopy.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSBounds3.h"
-#include <EASTL/string.h>
-
-#include <QtGui/qsurfaceformat.h>
-
-namespace qt3ds {
-namespace render {
-
-#define HandleToID_cast(staticType, dynamicType, handle) \
- static_cast<staticType>(reinterpret_cast<dynamicType>(handle))
-
- class NVRenderBackend : public NVRefCounted, public NoCopy
- {
-
- public:
- /// opaque buffer object handle
- typedef struct _NVRenderBackendBufferObject *NVRenderBackendBufferObject;
- /// opaque attribute layout object handle
- typedef struct _NVRenderBackendAttribLayoutObject *NVRenderBackendAttribLayoutObject;
- /// opaque input assembler object handle
- typedef struct _NVRenderBackendInputAssemblerObject *NVRenderBackendInputAssemblerObject;
- /// opaque texture object handle
- typedef struct _NVRenderBackendTextureObject *NVRenderBackendTextureObject;
- /// opaque sampler object handle
- typedef struct _NVRenderBackendSamplerObject *NVRenderBackendSamplerObject;
- /// opaque renderbuffer object handle
- typedef struct _NVRenderBackendRenderbufferObject *NVRenderBackendRenderbufferObject;
- /// opaque framebuffer object handle
- typedef struct _NVRenderBackendRenderTargetObject *NVRenderBackendRenderTargetObject;
- /// opaque vertex shader object handle
- typedef struct _NVRenderBackendVertexShaderObject *NVRenderBackendVertexShaderObject;
- /// opaque fragment shader object handle
- typedef struct _NVRenderBackendFragmentShaderObject *NVRenderBackendFragmentShaderObject;
- /// opaque tesselation control shader object handle
- typedef struct _NVRenderBackendTessControlShaderObject
- *NVRenderBackendTessControlShaderObject;
- /// opaque tesselation evaluation shader object handle
- typedef struct _NVRenderBackendTessEvaluationShaderObject
- *NVRenderBackendTessEvaluationShaderObject;
- /// opaque geometry shader object handle
- typedef struct _NVRenderBackendGeometryShaderObject *NVRenderBackendGeometryShaderObject;
- /// opaque compute shader object handle
- typedef struct _NVRenderBackendComputeShaderObject *NVRenderBackendComputeShaderObject;
- /// opaque shader program object handle
- typedef struct _NVRenderBackendShaderProgramObject *NVRenderBackendShaderProgramObject;
- /// opaque depth stencil state object handle
- typedef struct _NVRenderBackendDepthStencilStateObject
- *NVRenderBackendDepthStencilStateObject;
- /// opaque rasterizer state object handle
- typedef struct _NVRenderBackendRasterizerStateObject *NVRenderBackendRasterizerStateObject;
- /// opaque query object handle
- typedef struct _NVRenderBackendQueryObject *NVRenderBackendQueryObject;
- /// opaque sync object handle
- typedef struct _NVRenderBackendSyncObject *NVRenderBackendSyncObject;
- /// opaque sync object handle
- typedef struct _NVRenderBackendProgramPipeline *NVRenderBackendProgramPipeline;
- /// opaque sync object handle
- typedef struct _NVRenderBackendPathObject *NVRenderBackendPathObject;
-
- // backend capability caps
- typedef struct
- {
- enum Enum {
- ConstantBuffer, ///< Constant buffer support query
- DepthStencilTexture, ///< depth stencil texture format suport query
- DxtImages, ///< DXT image support query
- FpRenderTarget, ///< render to floating point target support query
- MsTexture, ///< Multisample texture support query
- TexSwizzle, ///< Texture swizzle support query
- FastBlits, ///< Hardware supports fast blits
- Tessellation, ///< Hardware supports tessellation
- Compute, ///< Hardware supports compute shader
- Geometry, ///< Hardware supports geometry shader
- SampleQuery, ///< Hardware supports query calls of type samples
- TimerQuery, ///< Hardware supports query calls of type timer
- CommandSync, ///< Hardware supports command sync object
- TextureArray, ///< Hardware supports texture arrays
- StorageBuffer, ///< Hardware supports shader storage buffers
- AtomicCounterBuffer, ///< Hardware supports atomic counter buffers
- ShaderImageLoadStore, ///< Hardware supports shader image load store operations
- ProgramPipeline, ///< Driver supports separate programs
- PathRendering, ///< Driver support path rendering
- AdvancedBlend, ///< Driver supports advanced blend modes
- BlendCoherency, ///< Hardware supports blend coherency
- gpuShader5, // for high precision sampling
- AdvancedBlendKHR, ///< Driver supports advanced blend modes
- VertexArrayObject,
- StandardDerivatives,
- TextureLod
- };
- } NVRenderBackendCaps;
-
- // backend queries
- typedef struct
- {
- enum Enum {
- MaxTextureSize, ///< Return max supported texture size
- MaxTextureArrayLayers, ///< Return max supported layer count for texture arrays
- MaxConstantBufferSlots, ///< Return max supported constant buffe slots for a single
- ///shader stage
- MaxConstantBufferBlockSize ///< Return max supported size for a single constant
- ///buffer block
- };
- } NVRenderBackendQuery;
-
- /// backend interface
-
- /**
- * @brief get the backend type
- *
- * @return true backend type
- */
- virtual NVRenderContextType GetRenderContextType() const = 0;
-
- /**
- * @brief get the version of the shading language
- * @return version string, must be copied by clients to be retained.
- */
- virtual const char *GetShadingLanguageVersion() = 0;
-
- /**
- * @brief get maximum supported texture image units that
- * can be used to access texture maps from the vertex shader and the fragment processor
- *combined.
- *
- * @return max texture size
- */
- virtual QT3DSU32 GetMaxCombinedTextureUnits() = 0;
-
- /**
- * @brief query Backend capabilities
- *
- * @param[in] inCap CAPS flag to query
- * @ConstantBuffer, @DepthStencilTexture, ...
- *
- * @return true if supported
- */
- virtual bool GetRenderBackendCap(NVRenderBackendCaps::Enum inCap) const = 0;
-
- /**
- * @brief query Backend values
- *
- * @param[in] inQuery Query flag to get value for
- * @MaxTextureSize, @MaxTextureArrayLayers,
- *...
- * @param[in/out] params the query result is stored here
- *
- * @return no return
- */
- virtual void GetRenderBackendValue(NVRenderBackendQuery::Enum inQuery,
- QT3DSI32 *params) const = 0;
-
- /**
- * @brief query for bit depth of the depth buffer
- *
- * @return depth buffer bitplanes
- */
- virtual QT3DSU32 GetDepthBits() const = 0;
-
- /**
- * @brief query for bit depth of the stencil buffer
- *
- * @return stencil buffer bitplanes
- */
- virtual QT3DSU32 GetStencilBits() const = 0;
-
- /*
- * @brief set a backend rende state
- *
- * @param[in] bEnable enable/disable state
- * @param[in] value type of state
- *
- * @return no return
- */
- virtual void SetRenderState(bool bEnable, const NVRenderState::Enum value) = 0;
-
- /**
- * @brief get a backend rende state
- *
- * @param[in] value type of state
- *
- * @return true if state enabled otherwise false
- */
- virtual bool GetRenderState(const NVRenderState::Enum value) = 0;
-
- /**
- * @brief get current depth function
- *
- * @return active depth function
- */
- virtual NVRenderBoolOp::Enum GetDepthFunc() = 0;
-
- /**
- * @brief create a depth stencil state object
- *
- * @param[in] enableDepth enable depth test
- * @param[in] depthMask enable depth writes
- * @param[in] depthFunc depth compare function
- * @param[in] enableStencil enable stencil test
- * @param[in] stencilFuncFront stencil setup front faces
- * @param[in] stencilFuncBack stencil setup back faces
- * @param[in] depthStencilOpFront depth/stencil operations front faces
- * @param[in] depthStencilOpBack depth/stencil operations back faces
- *
- * @return opaque handle to state object
- */
- virtual NVRenderBackendDepthStencilStateObject
- CreateDepthStencilState(bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc,
- bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack) = 0;
-
- /**
- * @brief release a depth stencil state object
- *
- * @param[in] depthStencilState pointer to state object
- *
- * @return none
- */
- virtual void
- ReleaseDepthStencilState(NVRenderBackendDepthStencilStateObject depthStencilState) = 0;
-
- /**
- * @brief create a rasterizer state object
- *
- * @param[in] depthBias any othe value than 0 enables depth bias
- * @param[in] depthScale any othe value than 0 enables depth scale
- * @param[in] cullFace select face to cull front or back
- *
- * @return opaque handle to state object
- */
- virtual NVRenderBackendRasterizerStateObject
- CreateRasterizerState(QT3DSF32 depthBias, QT3DSF32 depthScale, NVRenderFaces::Enum cullFace) = 0;
-
- /**
- * @brief release a rasterizer state object
- *
- * @param[in] rasterizerState pointer to state object
- *
- * @return none
- */
- virtual void
- ReleaseRasterizerState(NVRenderBackendRasterizerStateObject rasterizerState) = 0;
-
- /**
- * @brief set depth stencil state
- *
- * @param[in] depthStencilState pointer to state object
- *
- * @return none
- */
- virtual void
- SetDepthStencilState(NVRenderBackendDepthStencilStateObject depthStencilState) = 0;
-
- /**
- * @brief set rasterizer state
- *
- * @param[in] rasterizerState pointer to state object
- *
- * @return none
- */
- virtual void SetRasterizerState(NVRenderBackendRasterizerStateObject rasterizerState) = 0;
-
- /**
- * @brief set current depth function
- *
- * @param[in] func type of function
- *
- * @return no return
- */
- virtual void SetDepthFunc(const NVRenderBoolOp::Enum func) = 0;
-
- /**
- * @brief query if depth write is enabled
- *
- * @return true if enabled
- */
- virtual bool GetDepthWrite() = 0;
-
- /**
- * @brief enable / disable depth writes
- *
- * @param[in] bEnable true for enable
- *
- * @return no return
- */
- virtual void SetDepthWrite(bool bEnable) = 0;
-
- /**
- * @brief enable / disable color channel writes
- *
- * @param[in] bRed true for enable red channel
- * @param[in] bGreen true for enable green channel
- * @param[in] bBlue true for enable blue channel
- * @param[in] bAlpha true for enable alpha channel
- *
- * @return no return
- */
- virtual void SetColorWrites(bool bRed, bool bGreen, bool bBlue, bool bAlpha) = 0;
-
- /**
- * @brief enable / disable multisample rendering
- *
- * @param[in] bEnable true for enable
- *
- * @return no return
- */
- virtual void SetMultisample(bool bEnable) = 0;
-
- /**
- * @brief query blend functions
- *
- * @param[out] pBlendFuncArg blending functions
- *
- * @return no return
- */
- virtual void GetBlendFunc(NVRenderBlendFunctionArgument *pBlendFuncArg) = 0;
-
- /**
- * @brief set blend functions
- *
- * @param[in] pBlendFuncArg blending functions
- *
- * @return no return
- */
- virtual void SetBlendFunc(const NVRenderBlendFunctionArgument &blendFuncArg) = 0;
-
- /**
- * @brief set blend equation
- *
- * @param[in] pBlendEquArg blending equation
- *
- * @return no return
- */
- virtual void SetBlendEquation(const NVRenderBlendEquationArgument &pBlendEquArg) = 0;
-
- /**
- * @brief guarantee blend coherency
- *
- *
- * @return no return
- */
- virtual void SetBlendBarrier(void) = 0;
-
- /**
- * @brief query scissor rectangle
- *
- * @param[out] pRect contains scissor rect
- *
- * @return no return
- */
- virtual void GetScissorRect(NVRenderRect *pRect) = 0;
-
- /**
- * @brief set scissor rectangle
- *
- * @param[out] pRect contains scissor rect
- *
- * @return no return
- */
- virtual void SetScissorRect(const NVRenderRect &rect) = 0;
-
- /**
- * @brief query viewport rectangle
- *
- * @param[out] pRect contains viewport rect
- *
- * @return no return
- */
- virtual void GetViewportRect(NVRenderRect *pRect) = 0;
-
- /**
- * @brief set viewport rectangle
- *
- * @param[out] pRect contains viewport rect
- *
- * @return no return
- */
- virtual void SetViewportRect(const NVRenderRect &rect) = 0;
-
- /**
- * @brief query viewport rectangle
- *
- * @param[in] clearColor clear color
- *
- * @return no return
- */
- virtual void SetClearColor(const QT3DSVec4 *pClearColor) = 0;
-
- /**
- * @brief query viewport rectangle
- *
- * @param[in] flags clear flags
- *
- * @return no return
- */
- virtual void Clear(NVRenderClearFlags flags) = 0;
-
- /**
- * @brief create a buffer object
- *
- * @param[in] size Size of the buffer
- * @param[in] bindFlags Where to bind this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- *application.
- *
- * @return The created buffer object or NULL if the creation failed.
- */
- virtual NVRenderBackendBufferObject CreateBuffer(size_t size,
- NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usage,
- const void *hostPtr = NULL) = 0;
-
- /**
- * @brief bind a buffer object
- *
- * @param[in] bo Pointer to buffer object
- * @param[in] bindFlags Where to bind this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- *
- * @return no return.
- */
- virtual void BindBuffer(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags) = 0;
-
- /**
- * @brief Release a single buffer object
- *
- * @param[in] bo Pointer to buffer object
- *
- * @return no return.
- */
- virtual void ReleaseBuffer(NVRenderBackendBufferObject bo) = 0;
-
- /**
- * @brief update a whole buffer object
- *
- * @param[in] bo Pointer to buffer object
- * @param[in] bindFlags Where to bind this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- * @param[in] size Size of the data buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- *application.
- *
- * @return no return.
- */
- virtual void UpdateBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags,
- size_t size, NVRenderBufferUsageType::Enum usage,
- const void *data) = 0;
-
- /**
- * @brief update a range of a buffer object
- *
- * @param[in] bo Pointer to buffer object
- * @param[in] bindFlags Where to bind this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- * @param[in] size Size of the data buffer
- * @param[in] usage Usage of the buffer (e.g. static, dynamic...)
- * @param[in] data A pointer to the buffer data that is allocated by the
- *application.
- *
- * @return no return.
- */
- virtual void UpdateBufferRange(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags, size_t offset,
- size_t size, const void *data) = 0;
-
- /**
- * @brief Get a pointer to the buffer data ( GL(ES) >= 3 only )
- *
- * @param[in] bo Pointer to buffer object
- * @param[in] bindFlags Where to bind this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- * @param[in] offset Byte offset into the data buffer
- * @param[in] length Byte length of mapping size
- * @param[in] access Access of the buffer (e.g. read, write, ...)
- *
- * @return pointer to mapped data or null.
- */
- virtual void *MapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags,
- size_t offset, size_t length,
- NVRenderBufferAccessFlags accessFlags) = 0;
-
- /**
- * @brief Unmap a previously mapped buffer ( GL(ES) >= 3 only )
- * This functions transfers the content to the hardware buffer
- *
- * @param[in] bo Pointer to buffer object
- * @param[in] bindFlags Where to bind this buffer (e.g. vertex, index, ...)
- * For OpenGL this should be a single
- *value
- *
- * @return true if successful
- */
- virtual bool UnmapBuffer(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags) = 0;
-
- /**
- * @brief Set a memory barrier
- *
- * @param[in] barriers Flags for barriers
- *
- * @return no return.
- */
- virtual void SetMemoryBarrier(NVRenderBufferBarrierFlags barriers) = 0;
-
- /**
- * @brief create a query object
- *
- * @return The created query object or NULL if the creation failed.
- */
- virtual NVRenderBackendQueryObject CreateQuery() = 0;
-
- /**
- * @brief delete query objects
- *
- * @param[in] qo Handle to query object
- *
- * @return no return
- */
- virtual void ReleaseQuery(NVRenderBackendQueryObject qo) = 0;
-
- /**
- * @brief Start query recording
- *
- * @param[in] qo Handle to query object
- * @param[in] type Type of query
- *
- * @return no return
- */
- virtual void BeginQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) = 0;
-
- /**
- * @brief End query recording
- *
- * @param[in] qo Handle to query object
- * @param[in] type Type of query
- *
- * @return no return
- */
- virtual void EndQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) = 0;
-
- /**
- * @brief Get a query result
- *
- * @param[in] qo Handle to query object
- * @param[in] type Type of query
- * @param[out] params Contains result of query regarding query type
- *
- * @return no return
- */
- virtual void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU32 *params) = 0;
-
- /**
- * @brief Get a query result
- *
- * @param[in] qo Handle to query object
- * @param[in] type Type of query
- * @param[out] params Contains result of query regarding query type 64 bit returns
- *
- * @return no return
- */
- virtual void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU64 *params) = 0;
-
- /**
- * @brief Record the GPU time using the query object
- *
- * @param[in] qo Handle to query object
- *
- * @return no return
- */
- virtual void SetQueryTimer(NVRenderBackendQueryObject qo) = 0;
-
- /**
- * @brief create a sync object and place it in the command queue
- *
- * @param[in] tpye Type to sync
- * @param[in] syncFlags Currently unused
- *
- * @return The created sync object or NULL if the creation failed.
- */
- virtual NVRenderBackendSyncObject CreateSync(NVRenderSyncType::Enum tpye,
- NVRenderSyncFlags syncFlags) = 0;
-
- /**
- * @brief delete sync object
- *
- * @param[in] so Handle to sync object
- *
- * @return no return
- */
- virtual void ReleaseSync(NVRenderBackendSyncObject so) = 0;
-
- /**
- * @brief wait for sync object to be signaled
- *
- * @param[in] so Handle to sync object
- * @param[in] syncFlags Currently unused
- * @param[in] timeout Currently ignored
- *
- * @return no return
- */
- virtual void WaitSync(NVRenderBackendSyncObject so, NVRenderCommandFlushFlags syncFlags,
- QT3DSU64 timeout) = 0;
-
- /**
- * @brief create a render target object
- *
- *
- * @return The created render target object or NULL if the creation failed.
- */
- virtual NVRenderBackendRenderTargetObject CreateRenderTarget() = 0;
-
- /**
- * @brief Release a single render target object
- *
- * @param[in] rto Pointer to render target object
- *
- * @return no return.
- */
- virtual void ReleaseRenderTarget(NVRenderBackendRenderTargetObject rto) = 0;
-
- /**
- * @brief Attach a renderbuffer object to the framebuffer
- *
- * @param[in] rto Pointer to render target object
- * @param[in] attachment Attachment point (e.g COLOR0, DEPTH)
- * @param[in] rbo Pointer to renderbuffer object
- *
- * @return no return.
- */
- virtual void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendRenderbufferObject rbo) = 0;
-
- /**
- * @brief Attach a texture object to the render target
- *
- * @param[in] rto Pointer to render target object
- * @param[in] attachment Attachment point (e.g COLOR0, DEPTH)
- * @param[in] to Pointer to texture object
- * @param[in] target Attachment texture target
- *
- * @return no return.
- */
- virtual void RenderTargetAttach(
- NVRenderBackendRenderTargetObject rto, NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target = NVRenderTextureTargetType::Texture2D) = 0;
-
- /**
- * @brief Attach a texture object to the render target
- *
- * @param[in] rto Pointer to render target object
- * @param[in] attachment Attachment point (e.g COLOR0, DEPTH)
- * @param[in] to Pointer to texture object
- * @param[in] level Texture mip level
- * @param[in] layer Texture layer or slice
- *
- * @return no return.
- */
- virtual void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to, QT3DSI32 level,
- QT3DSI32 layer) = 0;
-
- /**
- * @brief Make a render target active
- *
- * @param[in] rto Pointer to render target object
- *
- * @return no return.
- */
- virtual void SetRenderTarget(NVRenderBackendRenderTargetObject rto) = 0;
-
- /**
- * @brief Check if a render target is ready for render
- *
- * @param[in] rto Pointer to render target object
- *
- * @return true if usable.
- */
- virtual bool RenderTargetIsValid(NVRenderBackendRenderTargetObject rto) = 0;
-
- /**
- * @brief Make a render target active for reading
- *
- * @param[in] rto Pointer to render target object
- *
- * @return no return.
- */
- virtual void SetReadTarget(NVRenderBackendRenderTargetObject rto) = 0;
-
- /**
- * @brief Set active buffers for drawing
- *
- * @param[in] rto Pointer to render target object
- * @param[in] inDrawBufferSet Pointer to array of enabled render targets
- *
- * @return no return.
- */
- virtual void SetDrawBuffers(NVRenderBackendRenderTargetObject rto,
- NVConstDataRef<QT3DSI32> inDrawBufferSet) = 0;
-
- /**
- * @brief Set active buffer for reading
- *
- * @param[in] rto Pointer to render target object
- * @param[in] inReadFace Buffer to read from
- *
- * @return no return.
- */
- virtual void SetReadBuffer(NVRenderBackendRenderTargetObject rto,
- NVReadFaces::Enum inReadFace) = 0;
-
- /**
- * @brief Copy framebuffer attachments. Source is set with SetReadTarget dest with
- * SetRenderTarget
- *
- * @param[in] srcX0 Lower left X coord of source rectangle
- * @param[in] srcY0 Lower left Y coord of source rectangle
- * @param[in] srcX1 Upper right X coord of source rectangle
- * @param[in] srcY1 Upper right Y coord of source rectangle
- * @param[in] dstX0 Lower left X coord of dest rectangle
- * @param[in] dstY0 Lower left Y coord of dest rectangle
- * @param[in] dstX1 Upper right X coord of dest rectangle
- * @param[in] dstY1 Upper right Y coord of dest rectangle
- * @param[in] inDrawBufferSet pointer to array of enabled render targets
- * @param[in] filter Copy filter method (NEAREST or LINEAR)
- *
- * @return no return.
- */
- virtual void BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter) = 0;
-
- /**
- * @brief create a render buffer object
- *
- * @param[in] storageFormat Format of the buffer
- * @param[in] width Buffer with
- * @param[in] height Buffer height
- *
- * @return The created render buffer object or NULL if the creation failed.
- */
- virtual NVRenderBackendRenderbufferObject
- CreateRenderbuffer(NVRenderRenderBufferFormats::Enum storageFormat, size_t width,
- size_t height) = 0;
-
- /**
- * @brief Release a single renderbuffer object
- *
- * @param[in] bo Pointer to renderbuffer object
- *
- * @return no return.
- */
- virtual void ReleaseRenderbuffer(NVRenderBackendRenderbufferObject rbo) = 0;
-
- /**
- * @brief resize a render buffer object
- *
- * @param[in] storageFormat Format of the buffer
- * @param[in] width Buffer with
- * @param[in] height Buffer height
- *
- * @return True on success
- */
- virtual bool ResizeRenderbuffer(NVRenderBackendRenderbufferObject rbo,
- NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height) = 0;
-
- /**
- * @brief create a texture object
- *
- * @return The created texture object or NULL if the creation failed..
- */
- virtual NVRenderBackendTextureObject CreateTexture() = 0;
-
- /**
- * @brief set texture data for a 2D texture
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] level Texture mip level
- * @param[in] internalFormat format of the texture
- * @param[in] width texture width
- * @param[in] height texture height
- * @param[in] border border
- * @param[in] format format of provided pixel data
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) = 0;
-
- /**
- * @brief set texture data for the face of a Cube map
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target face
- * @param[in] level Texture mip level
- * @param[in] internalFormat format of the texture
- * @param[in] width texture width
- * @param[in] height texture height
- * @param[in] border border
- * @param[in] format format of provided pixel data
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetTextureDataCubeFace(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) = 0;
-
- /**
- * @brief create a storage for a 2D texture including mip levels
- * Note that this makes texture immutable in size and format
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] levels Texture mip level count
- * @param[in] internalFormat format of the texture
- * @param[in] width texture width
- * @param[in] height texture height
- *
- * @return No return
- */
- virtual void CreateTextureStorage2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 levels,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height) = 0;
-
- /**
- * @brief set texture sub data for a 2D texture
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] level Texture mip level
- * @param[in] xOffset Texture x offset
- * @param[in] yOffset Texture y offset
- * @param[in] width Texture width
- * @param[in] height Texture height
- * @param[in] border border
- * @param[in] format format of texture
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetTextureSubData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- QT3DSI32 xOffset, QT3DSI32 yOffset, size_t width, size_t height,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) = 0;
-
- /**
- * @brief set compressed texture data for a 2D texture
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] level Texture mip level
- * @param[in] internalFormat format of the texture
- * @param[in] width texture width
- * @param[in] height texture height
- * @param[in] border border
- * @param[in] imageSize image size in bytes located at hostPtr
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetCompressedTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height, QT3DSI32 border,
- size_t imageSize, const void *hostPtr = NULL) = 0;
-
- /**
- * @brief set compressed texture data for a Cubemap face
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] level Texture mip level
- * @param[in] internalFormat format of the texture
- * @param[in] width texture width
- * @param[in] height texture height
- * @param[in] border border
- * @param[in] imageSize image size in bytes located at hostPtr
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetCompressedTextureDataCubeFace(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, QT3DSI32 border,
- size_t imageSize, const void *hostPtr = NULL) = 0;
-
- /**
- * @brief set compressed texture sub data for a 2D texture
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] level Texture mip level
- * @param[in] xOffset Texture x offset
- * @param[in] yOffset Texture y offset
- * @param[in] width texture width
- * @param[in] height texture height
- * @param[in] format format of provided pixel data
- * @param[in] imageSize image size in bytes located at hostPtr
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetCompressedTextureSubData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- QT3DSI32 xOffset, QT3DSI32 yOffset, size_t width, size_t height,
- NVRenderTextureFormats::Enum format, size_t imageSize, const void *hostPtr = NULL) = 0;
-
- /**
- * @brief establish a multisampled 2D texture
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D MS
- * @param[in] samples Textures sample count
- * @param[in] internalFormat Format of the texture
- * @param[in] width Texture width
- * @param[in] height Texture height
- * @param[in] bool Fixed sample locations
- *
- * @return No return
- */
- virtual void SetMultisampledTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- size_t samples,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height,
- bool fixedsamplelocations) = 0;
-
- /**
- * @brief set texture data for a 3D texture or 2D texture array
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] level Texture mip level
- * @param[in] internalFormat format of the texture
- * @param[in] width texture width
- * @param[in] height texture height
- * @param[in] depth texture depth or slice count
- * @param[in] border border
- * @param[in] format format of provided pixel data
- * @param[in] hostPtr A pointer to the buffer data that is allocated by the
- * application.
- *
- * @return No return
- */
- virtual void SetTextureData3D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, size_t depth, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) = 0;
-
- /**
- * @brief generate mipmap levels
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Texture target 2D,...
- * @param[in] hint How to generate mips (Nicest)
- *
- * @return No return
- */
- virtual void GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum genType) = 0;
-
- /**
- * @brief bind a texture object
- *
- * @param[in] to Pointer to texture object
- * @param[in] target Where to bind this texture (e.g. 2D, 3D, ...)
- * @param[in] unit Which unit to bind this texture
- *
- * @return no return.
- */
- virtual void BindTexture(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 unit) = 0;
-
- /**
- * @brief bind a image/texture object
- *
- * @param[in] to Pointer to texture object
- * @param[in] unit Which unit to bind this texture
- * @param[in] level Which level to bind
- * @param[in] layered Bind layered texture (cube map, array,... )
- * @param[in] level Specify layer. Only valid of layered=false.
- * @param[in] access Access mode ( read, write, read-write )
- * @param[in] format Texture format must be compatible with Image format
- *
- * @return no return.
- */
- virtual void BindImageTexture(NVRenderBackendTextureObject to, QT3DSU32 unit, QT3DSI32 level,
- bool layered, QT3DSI32 layer,
- NVRenderImageAccessType::Enum accessFlags,
- NVRenderTextureFormats::Enum format) = 0;
-
- /**
- * @brief Release a single texture object
- *
- * @param[in] to Pointer to buffer object
- *
- * @return no return.
- */
- virtual void ReleaseTexture(NVRenderBackendTextureObject to) = 0;
-
- /**
- * @brief query texture swizzle mode
- * This is mainly for luminance, alpha replacement with R8 formats
- *
- * @param[in] inFormat input texture format to check
- *
- * @return texture swizzle mode
- */
- virtual NVRenderTextureSwizzleMode::Enum
- GetTextureSwizzleMode(const NVRenderTextureFormats::Enum inFormat) const = 0;
-
- /**
- * @ brief create a sampler
- *
- * @param[in] minFilter Texture min filter
- * @param[in] magFilter Texture mag filter
- * @param[in] wrapS Texture coord generation for S
- * @param[in] wrapT Texture coord generation for T
- * @param[in] wrapR Texture coord generation for R
- * @param[in] minLod Texture min level of detail
- * @param[in] maxLod Texture max level of detail
- * @param[in] lodBias Texture level of detail example
- * @param[in] compareMode Texture compare mode
- * @param[in] compareFunc Texture compare function
- * @param[in] anisoFilter Aniso filter value [1.0, 16.0]
- * @param[in] borderColor Texture border color float[4]
- *
- * @return The created sampler object or NULL if the creation failed.
- */
- virtual NVRenderBackendSamplerObject CreateSampler(
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- QT3DSI32 minLod = -1000, QT3DSI32 maxLod = 1000, QT3DSF32 lodBias = 0.0,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0, QT3DSF32 *borderColor = NULL) = 0;
-
- /**
- * @ brief update a sampler
- *
- * @param[in] so Pointer to sampler object
- * @param[in] target Texture target 2D, 3D
- * @param[in] minFilter Texture min filter
- * @param[in] magFilter Texture mag filter
- * @param[in] wrapS Texture coord generation for S
- * @param[in] wrapT Texture coord generation for T
- * @param[in] wrapR Texture coord generation for R
- * @param[in] minLod Texture min level of detail
- * @param[in] maxLod Texture max level of detail
- * @param[in] lodBias Texture level of detail bias (unused)
- * @param[in] compareMode Texture compare mode
- * @param[in] compareFunc Texture compare function
- * @param[in] anisoFilter Aniso filter value [1.0, 16.0]
- * @param[in] borderColor Texture border color float[4] (unused)
- *
- * @return No return
- */
- virtual void UpdateSampler(
- NVRenderBackendSamplerObject so, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- QT3DSF32 minLod = -1000.0, QT3DSF32 maxLod = 1000.0, QT3DSF32 lodBias = 0.0,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0, QT3DSF32 *borderColor = NULL) = 0;
-
- /**
- * @ brief Update a textures swizzle mode
- *
- * @param[in] so Pointer to texture object
- * @param[in] target Texture target 2D, 3D
- * @param[in] swizzleMode Texture swizzle mode
- *
- * @return No return
- */
- virtual void UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode) = 0;
-
- /**
- * @ brief Update state belonging to a texture object
- *
- * @param[in] so Pointer to texture object
- * @param[in] target Texture target 2D, 3D, Cube
- * @param[in] baseLevel Texture base level
- * @param[in] maxLevel Texture max level
- *
- * @return No return
- */
- virtual void UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSI32 baseLevel,
- QT3DSI32 maxLevel) = 0;
-
- /**
- * @brief Release a single sampler object
- *
- * @param[in] so Pointer to sampler object
- *
- * @return no return.
- */
- virtual void ReleaseSampler(NVRenderBackendSamplerObject so) = 0;
-
- /**
- * @brief create a attribute layout object
- *
- * @param[in] attribs Array off vertex attributes.
- *
- * @return The created attribute layout object or NULL if the creation failed.
- */
- virtual NVRenderBackendAttribLayoutObject
- CreateAttribLayout(NVConstDataRef<NVRenderVertexBufferEntry> attribs) = 0;
-
- /**
- * @brief Release a attribute layoutr object
- *
- * @param[in] ao Pointer to attribute layout object
- *
- * @return no return.
- */
- virtual void ReleaseAttribLayout(NVRenderBackendAttribLayoutObject ao) = 0;
-
- /**
- * @brief create a input assembler object
- *
- * @param[in] attribLayout Pointer to NVRenderBackendAttribLayoutObject object
- * @param[in] buffers list of vertex buffers
- * @param[in] indexBuffer index buffer object
- * @param[in] strides list of strides of the buffer
- * @param[in] offsets list of offsets into the buffer
- * @param[in] patchVertexCount vertext count for a patch. Only valid for patch primitives
- *
- * @return The created input assembler object or NULL if the creation failed.
- */
- virtual NVRenderBackendInputAssemblerObject
- CreateInputAssembler(NVRenderBackendAttribLayoutObject attribLayout,
- NVConstDataRef<NVRenderBackendBufferObject> buffers,
- const NVRenderBackendBufferObject indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets,
- QT3DSU32 patchVertexCount) = 0;
-
- /**
- * @brief Release a input assembler object
- *
- * @param[in] iao Pointer to attribute layout object
- *
- * @return no return.
- */
- virtual void ReleaseInputAssembler(NVRenderBackendInputAssemblerObject iao) = 0;
-
- /**
- * @brief Set a input assembler object.
- * This setup the render engine vertex assmebly
- *
- * @param[in] iao Pointer to attribute layout object
- * @param[in] po Pointer program object
- *
- * @return false if it fails.
- */
- virtual bool SetInputAssembler(NVRenderBackendInputAssemblerObject iao,
- NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief Set the per patch vertex count
- *
- * @param[in] iao Pointer to attribute layout object
- * @param[in] count Count of vertices per patch
- *
- * @return false if it fails.
- */
- virtual void SetPatchVertexCount(NVRenderBackendInputAssemblerObject iao, QT3DSU32 count) = 0;
-
- /**
- * @brief create a vertex shader object
- *
- * @param[in] source Pointer to shader source
- * @param[in/out] errorMessage Pointer to copy the error message
- * @param[in] binary True if the source is actually a binary program
- *
- * @return The created vertex shader object or NULL if the creation failed.
- */
- virtual NVRenderBackendVertexShaderObject CreateVertexShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage,
- bool binary) = 0;
-
- /**
- * @brief release a vertex shader object
- *
- * @param[in] vso Pointer to vertex shader object
- *
- * @return No Return.
- */
- virtual void ReleaseVertexShader(NVRenderBackendVertexShaderObject vso) = 0;
-
- /**
- * @brief create a fragment shader object
- *
- * @param[in] source Pointer to shader source
- * @param[in/out] errorMessage Pointer to copy the error message
- * @param[in] binary True if the source is actually a binary program
- *
- * @return The created vertex shader object or NULL if the creation failed.
- */
- virtual NVRenderBackendFragmentShaderObject
- CreateFragmentShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) = 0;
-
- /**
- * @brief release a fragment shader object
- *
- * @param[in] vso Pointer to fragment shader object
- *
- * @return No Return.
- */
- virtual void ReleaseFragmentShader(NVRenderBackendFragmentShaderObject fso) = 0;
-
- /**
- * @brief create a tessellation control shader object
- *
- * @param[in] source Pointer to shader source
- * @param[in/out] errorMessage Pointer to copy the error message
- * @param[in] binary True if the source is actually a binary program
- *
- * @return The created tessellation control shader object or NULL if the creation failed.
- */
- virtual NVRenderBackendTessControlShaderObject
- CreateTessControlShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) = 0;
-
- /**
- * @brief release a tessellation control shader object
- *
- * @param[in] tcso Pointer to tessellation control shader object
- *
- * @return No Return.
- */
- virtual void ReleaseTessControlShader(NVRenderBackendTessControlShaderObject tcso) = 0;
-
- /**
- * @brief create a tessellation evaluation shader object
- *
- * @param[in] source Pointer to shader source
- * @param[in/out] errorMessage Pointer to copy the error message
- * @param[in] binary True if the source is actually a binary program
- *
- * @return The created tessellation evaluation shader object or NULL if the creation failed.
- */
- virtual NVRenderBackendTessEvaluationShaderObject
- CreateTessEvaluationShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) = 0;
-
- /**
- * @brief release a tessellation evaluation shader object
- *
- * @param[in] tcso Pointer to tessellation evaluation shader object
- *
- * @return No Return.
- */
- virtual void
- ReleaseTessEvaluationShader(NVRenderBackendTessEvaluationShaderObject teso) = 0;
-
- /**
- * @brief create a geometry shader object
- *
- * @param[in] source Pointer to shader source
- * @param[in/out] errorMessage Pointer to copy the error message
- * @param[in] binary True if the source is actually a binary program
- *
- * @return The created geometry shader object or NULL if the creation failed.
- */
- virtual NVRenderBackendGeometryShaderObject
- CreateGeometryShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) = 0;
-
- /**
- * @brief release a geometry shader object
- *
- * @param[in] tcso Pointer to geometry shader object
- *
- * @return No Return.
- */
- virtual void ReleaseGeometryShader(NVRenderBackendGeometryShaderObject gso) = 0;
-
- /**
- * @brief create a compute shader object
- *
- * @param[in] source Pointer to shader source
- * @param[in/out] errorMessage Pointer to copy the error message
- * @param[in] binary True if the source is actually a binary program
- *
- * @return The created compute shader object or NULL if the creation failed.
- */
- virtual NVRenderBackendComputeShaderObject CreateComputeShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage,
- bool binary) = 0;
-
- /**
- * @brief release a compute shader object
- *
- * @param[in] cso Pointer to compute shader object
- *
- * @return No Return.
- */
- virtual void ReleaseComputeShader(NVRenderBackendComputeShaderObject cso) = 0;
-
- /**
- * @brief attach a vertex shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] vso Pointer to vertex shader object
- *
- * @return No Return.
- */
- virtual void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendVertexShaderObject vso) = 0;
-
- /**
- * @brief detach a vertex shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] vso Pointer to vertex shader object
- *
- * @return No Return.
- */
- virtual void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendVertexShaderObject vso) = 0;
-
- /**
- * @brief attach a fragment shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] fso Pointer to fragment shader object
- *
- * @return No Return.
- */
- virtual void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendFragmentShaderObject fso) = 0;
-
- /**
- * @brief detach a fragment shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] fso Pointer to fragment shader object
- *
- * @return No Return.
- */
- virtual void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendFragmentShaderObject fso) = 0;
-
- /**
- * @brief attach a tessellation control shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] tcso Pointer to tessellation control shader object
- *
- * @return No Return.
- */
- virtual void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessControlShaderObject tcso) = 0;
-
- /**
- * @brief detach a tessellation control shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] tcso Pointer to tessellation control shader object
- *
- * @return No Return.
- */
- virtual void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessControlShaderObject tcso) = 0;
-
- /**
- * @brief attach a tessellation evaluation shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] teso Pointer to tessellation evaluation shader object
- *
- * @return No Return.
- */
- virtual void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessEvaluationShaderObject teso) = 0;
-
- /**
- * @brief detach a tessellation evaluation shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] teso Pointer to tessellation evaluation shader object
- *
- * @return No Return.
- */
- virtual void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessEvaluationShaderObject teso) = 0;
-
- /**
- * @brief attach a geometry shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] teso Pointer to geometry shader object
- *
- * @return No Return.
- */
- virtual void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendGeometryShaderObject gso) = 0;
-
- /**
- * @brief detach a geometry shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] teso Pointer to geometry shader object
- *
- * @return No Return.
- */
- virtual void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendGeometryShaderObject gso) = 0;
-
- /**
- * @brief attach a compute shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] cso Pointer to compute shader object
- *
- * @return No Return.
- */
- virtual void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendComputeShaderObject cso) = 0;
-
- /**
- * @brief detach a compute shader object to a program object
- *
- * @param[in] po Pointer to program object
- * @param[in] cso Pointer to compute shader object
- *
- * @return No Return.
- */
- virtual void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendComputeShaderObject cso) = 0;
-
- /**
- * @brief create a shader program object
- *
- * @param[in] isSeparable Tell the backend that this program is separable
- *
- * @return The created shader program object or NULL if the creation failed.
- */
- virtual NVRenderBackendShaderProgramObject CreateShaderProgram(bool isSeparable) = 0;
-
- /**
- * @brief release a shader program object
- *
- * @param[in] po Pointer to shader program object
- *
- * @return No Return.
- */
- virtual void ReleaseShaderProgram(NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief link a shader program object
- *
- * @param[in] po Pointer to shader program object
- * @param[in/out] errorMessage Pointer to copy the error message
- *
- * @return True if program is succesful linked.
- */
- virtual bool LinkProgram(NVRenderBackendShaderProgramObject po,
- eastl::string &errorMessage) = 0;
-
- /**
- * @brief Make a program current
- *
- * @param[in] po Pointer to shader program object
- *
- * @return No return
- */
- virtual void SetActiveProgram(NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief create a program pipeline object
- *
- *
- * @return The created program pipeline object or NULL if the creation failed.
- */
- virtual NVRenderBackendProgramPipeline CreateProgramPipeline() = 0;
-
- /**
- * @brief release a program pipeline object
- *
- * @param[in] ppo Pointer to program pipeline object
- *
- * @return No Return.
- */
- virtual void ReleaseProgramPipeline(NVRenderBackendProgramPipeline ppo) = 0;
-
- /**
- * @brief Make a program pipeline current
- *
- * @param[in] ppo Pointer to program pipeline object
- *
- * @return No return
- */
- virtual void SetActiveProgramPipeline(NVRenderBackendProgramPipeline ppo) = 0;
-
- /**
- * @brief Make a program stage active for this pipeline
- *
- * @param[in] ppo Pointer to program pipeline object
- * @param[in] flags Shader stage flags to which this po is bound to
- * @param[in] po Pointer to shader program object
- *
- * @return No return
- */
- virtual void SetProgramStages(NVRenderBackendProgramPipeline ppo,
- NVRenderShaderTypeFlags flags,
- NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief Runs a compute program
- *
- * @param[in] po Pointer to shader program object
- * @param[in] numGroupsX The number of work groups to be launched in the X
- * dimension
- * @param[in] numGroupsY The number of work groups to be launched in the Y
- * dimension
- * @param[in] numGroupsZ The number of work groups to be launched in the Z
- * dimension
- *
- * @return No return
- */
- virtual void DispatchCompute(NVRenderBackendShaderProgramObject po, QT3DSU32 numGroupsX,
- QT3DSU32 numGroupsY, QT3DSU32 numGroupsZ) = 0;
-
- /**
- * @brief Query constant count for a program object
- *
- * @param[in] po Pointer to shader program object
- *
- * @return Return active constant count
- */
- virtual QT3DSI32 GetConstantCount(NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief Query constant buffer count for a program object
- *
- * @param[in] po Pointer to shader program object
- *
- * @return Return active constant buffer count
- */
- virtual QT3DSI32 GetConstantBufferCount(NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief Query constant information by ID
- *
- * @param[in] po Pointer to shader program object
- * @param[in] id Constant ID
- * @param[in] bufSize Max char for nameBuf
- * @param[out] numElem Usually one unless for arrays
- * @param[out] type Constant data type (QT3DSVec4, QT3DSVec3,...)
- * @param[out] binding Unit binding point for samplers and images
- * @param[out] nameBuf Name of the constant
- *
- * @return Return current constant location or -1 if not found
- */
- virtual QT3DSI32 GetConstantInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 bufSize, QT3DSI32 *numElem,
- NVRenderShaderDataTypes::Enum *type, QT3DSI32 *binding,
- char *nameBuf) = 0;
-
- /**
- * @brief Query constant buffer information by ID
- *
- * @param[in] po Pointer to shader program object
- * @param[in] id Constant buffer ID
- * @param[in] nameBufSize Size of nameBuf
- * @param[out] paramCount Count ot parameter contained in the buffer
- * @param[out] bufferSize Data size of the constant buffer
- * @param[out] length Actual characters written
- * @param[out] nameBuf Receives the name of the buffer
- *
- * @return Return current constant buffer location or -1 if not found
- */
- virtual QT3DSI32 GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf) = 0;
-
- /**
- * @brief Query constant buffer param indices
- *
- * @param[in] po Pointer to shader program object
- * @param[in] id Constant buffer ID
- * @param[out] indices Receives the indices of the uniforms within the
- * constant buffer
- *
- * @return no return value
- */
- virtual void GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSI32 *indices) = 0;
-
- /**
- * @brief Query constant buffer param info by indices
- *
- * @param[in] po Pointer to shader program object
- * @param[in] count Number of indices
- * @param[in] indices The indices of the uniforms within the constant
- * buffer
- * @param[out] type Array of param types ( float ,int, ...)
- * @param[out] size Array of param size
- * @param[out] offset Array of param offsets within the constant buffer
- *
- * @return no return value
- */
- virtual void GetConstantBufferParamInfoByIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 count, QT3DSU32 *indices, QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset) = 0;
-
- /**
- * @brief Bind program constant block
- *
- * @param[in] po Pointer to shader program object
- * @param[in] blockIndex Constant block index returned by
- * GetConstantBufferInfoByID
- * @param[in] binding Block binding location which should be the same as index
- * in ProgramSetConstantBlock
- *
- * @return No return
- */
- virtual void ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding) = 0;
-
- /**
- * @brief Bind constant buffer for usage in the current active shader program
- *
- * @param[in] index Constant ID
- * @param[in] bo Pointer to constant buffer object
- *
- * @return No return
- */
- virtual void ProgramSetConstantBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) = 0;
-
- /**
- * @brief Query storage buffer count for a program object
- *
- * @param[in] po Pointer to shader program object
- *
- * @return Return active storage buffer count
- */
- virtual QT3DSI32 GetStorageBufferCount(NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief Query storage buffer information by ID
- *
- * @param[in] po Pointer to shader program object
- * @param[in] id Storage buffer ID
- * @param[in] nameBufSize Size of nameBuf
- * @param[out] paramCount Count of parameter contained in the buffer
- * @param[out] bufferSize Data size of the constant buffer
- * @param[out] length Actual characters written
- * @param[out] nameBuf Receives the name of the buffer
- *
- * @return Return current storage buffer binding or -1 if not found
- */
- virtual QT3DSI32 GetStorageBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length, char *nameBuf) = 0;
-
- /**
- * @brief Bind a storage buffer for usage in the current active shader program
- *
- * @param[in] index Constant ID
- * @param[in] bo Pointer to storage buffer object
- *
- * @return No return
- */
- virtual void ProgramSetStorageBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) = 0;
-
- /**
- * @brief Query atomic counter buffer count for a program object
- *
- * @param[in] po Pointer to shader program object
- *
- * @return Return active atomic buffer count
- */
- virtual QT3DSI32 GetAtomicCounterBufferCount(NVRenderBackendShaderProgramObject po) = 0;
-
- /**
- * @brief Query atomic counter buffer information by ID
- *
- * @param[in] po Pointer to shader program object
- * @param[in] id Storage buffer ID
- * @param[in] nameBufSize Size of nameBuf
- * @param[out] paramCount Count of parameter contained in the buffer
- * @param[out] bufferSize Data size of the constant buffer
- * @param[out] length Actual characters written
- * @param[out] nameBuf Receives the name of the buffer
- *
- * @return Return current storage buffer binding or -1 if not found
- */
- virtual QT3DSI32 GetAtomicCounterBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf) = 0;
-
- /**
- * @brief Bind a atomic counter buffer for usage in the current active shader program
- *
- * @param[in] index Constant ID
- * @param[in] bo Pointer to atomic counter buffer object
- *
- * @return No return
- */
- virtual void ProgramSetAtomicCounterBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) = 0;
-
- /**
- * @brief Set constant value
- *
- * @param[in] po Pointer program object
- * @param[in] id Constant ID
- * @param[in] type Constant data type (QT3DSVec4, QT3DSVec3,...)
- * @param[in] count Element count
- * @param[in] value Pointer to constant value
- * @param[in] transpose Transpose a matrix
- *
- * @return No return
- */
- virtual void SetConstantValue(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count,
- const void *value, bool transpose = false) = 0;
-
- /**
- * @brief Draw the current active vertex buffer
- *
- * @param[in] drawMode Draw mode (Triangles, ....)
- * @param[in] start Start vertex
- * @param[in] count Vertex count
- *
- * @return no return.
- */
- virtual void Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 start, QT3DSU32 count) = 0;
-
- /**
- * @brief Draw the current active vertex buffer using an indirect buffer
- * This means the setup of the draw call is stored in a buffer bound to
- * NVRenderBufferBindValues::Draw_Indirect
- *
- * @param[in] drawMode Draw mode (Triangles, ....)
- * @param[in] indirect Offset into a indirect drawing setup buffer
- *
- * @return no return.
- */
- virtual void DrawIndirect(NVRenderDrawMode::Enum drawMode, const void *indirect) = 0;
-
- /**
- * @brief Draw the current active index buffer
- *
- * @param[in] drawMode Draw mode (Triangles, ....)
- * @param[in] count Index count
- * @param[in] type Index type (QT3DSU16, QT3DSU8)
- * @param[in] indices Pointer to index buffer. In the case of buffer objects
- * this is an offset into the active index buffer
- *object.
- *
- * @return no return.
- */
- virtual void DrawIndexed(NVRenderDrawMode::Enum drawMode, QT3DSU32 count,
- NVRenderComponentTypes::Enum type, const void *indices) = 0;
-
- /**
- * @brief Draw the current active index buffer using an indirect buffer
- * This means the setup of the draw call is stored in a buffer bound to
- * NVRenderBufferBindValues::Draw_Indirect
- *
- * @param[in] drawMode Draw mode (Triangles, ....)
- * @param[in] type Index type (QT3DSU16, QT3DSU8)
- * @param[in] indices Offset into a indirect drawing setup buffer
- *
- * @return no return.
- */
- virtual void DrawIndexedIndirect(NVRenderDrawMode::Enum drawMode,
- NVRenderComponentTypes::Enum type,
- const void *indirect) = 0;
-
- /**
- * @brief Read a pixel rectangle from render target (from bottom left)
- *
- * @param[in] rto Pointer to render target object
- * @param[in] x Windows X start coord
- * @param[in] y Windows Y start coord
- * @param[in] width Read width dim
- * @param[in] height Read height dim
- * @param[out] pixels Returned pixel data
- *
- * @return No return
- */
- virtual void ReadPixel(NVRenderBackendRenderTargetObject rto, QT3DSI32 x, QT3DSI32 y, QT3DSI32 width,
- QT3DSI32 height, NVRenderReadPixelFormats::Enum inFormat,
- void *pixels) = 0;
-
- /**
- * @brief Create a NV path render object
- *
- * @param[in] range Number of internal objects
- *
- * @return return path object on success or NULL
- */
- virtual NVRenderBackendPathObject CreatePathNVObject(size_t range) = 0;
-
- /**
- * @brief Relase a NV path render object
- *
- * @param[in] po Created path object
- * @param[in] range Number of internal objects
- *
- * @return return path object on success or NULL
- */
- virtual void ReleasePathNVObject(NVRenderBackendPathObject po, size_t range) = 0;
-
- /**
- * @brief Set the path commands and data.
- *
- * @param[in] inPathObject Pointer to NV path object
- * @param[in] inPathCommands vector of path commands ( moveTo,... )
- * @param[in] inPathCoords vector of path coords
- *
- * @return No return
- */
- virtual void SetPathSpecification(NVRenderBackendPathObject inPathObject,
- NVConstDataRef<QT3DSU8> inPathCommands,
- NVConstDataRef<QT3DSF32> inPathCoords) = 0;
-
- /**
- * @brief Get Bounds of the path object
- *
- * @param[in] inPathObject Pointer to NV path object
- *
- * @return return bounds
- */
- virtual NVBounds3 GetPathObjectBoundingBox(NVRenderBackendPathObject inPathObject) = 0;
- virtual NVBounds3 GetPathObjectFillBox(NVRenderBackendPathObject inPathObject) = 0;
- virtual NVBounds3 GetPathObjectStrokeBox(NVRenderBackendPathObject inPathObject) = 0;
-
- /**
- * @brief Set stroke width. Defaults to 0 if unset.
- *
- * @param[in] inPathObject Pointer to NV path object
- *
- * @return No return
- */
- virtual void SetStrokeWidth(NVRenderBackendPathObject inPathObject,
- QT3DSF32 inStrokeWidth) = 0;
-
- /**
- * @brief Path transform commands
- *
- * @param[in] inPathObject Pointer to NV path object
- *
- * @return No return
- */
- virtual void SetPathProjectionMatrix(const QT3DSMat44 inPathProjection) = 0;
- virtual void SetPathModelViewMatrix(const QT3DSMat44 inPathModelview) = 0;
-
- /**
- * @brief Path stencil pass operations
- *
- * @param[in] inPathObject Pointer to NV path object
- *
- * @return No return
- */
- virtual void StencilStrokePath(NVRenderBackendPathObject inPathObject) = 0;
- virtual void StencilFillPath(NVRenderBackendPathObject inPathObject) = 0;
-
- /**
- * @brief Does a instanced stencil fill pass
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] fillMode Fille mode
- * @param[in] stencilMask Stencil mask
- * @param[in] transformType Transforming glyphs
- * @param[in] transformValues Pointer to array of transforms
- *
- * @return No return
- */
- virtual void StencilFillPathInstanced(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathFormatType::Enum type,
- const void *charCodes, NVRenderPathFillMode::Enum fillMode, QT3DSU32 stencilMask,
- NVRenderPathTransformType::Enum transformType, const QT3DSF32 *transformValues) = 0;
-
- /**
- * @brief Does a instanced stencil stroke pass
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] stencilRef Stencil reference
- * @param[in] stencilMask Stencil mask
- * @param[in] transformType Transforming glyphs
- * @param[in] transformValues Pointer to array of transforms
- *
- * @return No return
- */
- virtual void StencilStrokePathInstancedN(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathFormatType::Enum type,
- const void *charCodes, QT3DSI32 stencilRef,
- QT3DSU32 stencilMask,
- NVRenderPathTransformType::Enum transformType,
- const QT3DSF32 *transformValues) = 0;
-
- /**
- * @brief Does a instanced cover fill pass
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] coverMode Cover mode
- * @param[in] transformType Transforming glyphs
- * @param[in] transformValues Pointer to array of transforms
- *
- * @return No return
- */
- virtual void CoverFillPathInstanced(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathFormatType::Enum type,
- const void *charCodes,
- NVRenderPathCoverMode::Enum coverMode,
- NVRenderPathTransformType::Enum transformType,
- const QT3DSF32 *transformValues) = 0;
-
- /**
- * @brief Does a instanced cover stroke pass
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] coverMode Cover mode
- * @param[in] transformType Transforming glyphs
- * @param[in] transformValues Pointer to array of transforms
- *
- * @return No return
- */
- virtual void CoverStrokePathInstanced(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathFormatType::Enum type,
- const void *charCodes,
- NVRenderPathCoverMode::Enum coverMode,
- NVRenderPathTransformType::Enum transformType,
- const QT3DSF32 *transformValues) = 0;
-
- /**
- * @brief Path stencil and depth offset
- *
- * @param[in] inSlope slope
- * @param[in] inBias bias
- *
- * @return No return
- */
- virtual void SetPathStencilDepthOffset(QT3DSF32 inSlope, QT3DSF32 inBias) = 0;
-
- /**
- * @brief Path cover function
- *
- * @param[in] inDepthFunction depth function
- *
- * @return No return
- */
- virtual void SetPathCoverDepthFunc(NVRenderBoolOp::Enum inDepthFunction) = 0;
-
- /**
- * @brief Load glyphs
- *
- * @param[in] po Base of path objects
- * @param[in] fontTarget System font, or application font,...
- * @param[in] fontName Name of font ( may include path )
- * @param[in] fontStyle Bold or italic
- * @param[in] numGlyphs Glyph count
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] handleMissingGlyphs skip or use
- * @param[in] pathParameterTemplate template
- * @param[in] emScale scale ( true type scale e.g. 2048 )
- *
- * @return No return
- */
- virtual void LoadPathGlyphs(NVRenderBackendPathObject po,
- NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle, size_t numGlyphs,
- NVRenderPathFormatType::Enum type, const void *charCodes,
- NVRenderPathMissingGlyphs::Enum handleMissingGlyphs,
- NVRenderBackendPathObject pathParameterTemplate,
- QT3DSF32 emScale) = 0;
-
- /**
- * @brief Load indexed font set
- *
- * @param[in] po Base of path objects
- * @param[in] fontTarget System font, or application font,...
- * @param[in] fontName Name of font ( may include path )
- * @param[in] fontStyle Bold or italic
- * @param[in] firstGlyphIndex First glyph
- * @param[in] numGlyphs Glyph count
- * @param[in] pathParameterTemplate template
- * @param[in] emScale scale ( true type scale e.g. 2048 )
- *
- * @return return load status
- */
- virtual NVRenderPathReturnValues::Enum
- LoadPathGlyphsIndexed(NVRenderBackendPathObject po, NVRenderPathFontTarget::Enum fontTarget,
- const void *fontName, NVRenderPathFontStyleFlags fontStyle,
- QT3DSU32 firstGlyphIndex, size_t numGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale) = 0;
-
- /**
- * @brief Load indexed font set
- *
- * @param[in] fontTarget System font, or application font,...
- * @param[in] fontName Name of font ( may include path )
- * @param[in] fontStyle Bold or italic
- * @param[in] pathParameterTemplate template
- * @param[in] emScale scale ( true type scale e.g. 2048 )
- * @param[out] po contains glyph count
- *
- * @return returnr base path object
- */
- virtual NVRenderBackendPathObject
- LoadPathGlyphsIndexedRange(NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale,
- QT3DSU32 *count) = 0;
-
- /**
- * @brief Load font set
- *
- * @param[in] po Base of path objects
- * @param[in] fontTarget System font, or application font,...
- * @param[in] fontName Name of font ( may include path )
- * @param[in] fontStyle Bold or italic
- * @param[in] firstGlyph First glyph
- * @param[in] numGlyphs Glyph count
- * @param[in] handleMissingGlyphs skip or use
- * @param[in] pathParameterTemplate template
- * @param[in] emScale scale ( true type scale e.g. 2048 )
- *
- * @return No return
- */
- virtual void LoadPathGlyphRange(NVRenderBackendPathObject po,
- NVRenderPathFontTarget::Enum fontTarget,
- const void *fontName, NVRenderPathFontStyleFlags fontStyle,
- QT3DSU32 firstGlyph, size_t numGlyphs,
- NVRenderPathMissingGlyphs::Enum handleMissingGlyphs,
- NVRenderBackendPathObject pathParameterTemplate,
- QT3DSF32 emScale) = 0;
-
- /**
- * @brief Query font metrics
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] metricQueryMask Qeury bit mask
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] stride scale ( true type scale e.g. 2048 )
- * @param[out] metrics Filled with font metric values
- *
- * @return No return
- */
- virtual void GetPathMetrics(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathGlyphFontMetricFlags metricQueryMask,
- NVRenderPathFormatType::Enum type, const void *charCodes,
- size_t stride, QT3DSF32 *metrics) = 0;
-
- /**
- * @brief Query font metrics
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] metricQueryMask Qeury bit mask
- * @param[in] stride scale ( true type scale e.g. 2048 )
- * @param[out] metrics Filled with font metric values
- *
- * @return No return
- */
- virtual void GetPathMetricsRange(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathGlyphFontMetricFlags metricQueryMask,
- size_t stride, QT3DSF32 *metrics) = 0;
-
- /**
- * @brief Query path spacing
- *
- * @param[in] po Base of path objects
- * @param[in] numPaths Number path objects
- * @param[in] pathListMode How to compute spacing
- * @param[in] type type ( byte, int,... )
- * @param[in] charCodes charachter string
- * @param[in] advanceScale
- * @param[in] kerningScale
- * @param[in] transformType
- * @param[out] metrics Filled with font metric values
- *
- * @return No return
- */
- virtual void GetPathSpacing(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathListMode::Enum pathListMode,
- NVRenderPathFormatType::Enum type, const void *charCodes,
- QT3DSF32 advanceScale, QT3DSF32 kerningScale,
- NVRenderPathTransformType::Enum transformType,
- QT3DSF32 *spacing) = 0;
-
- virtual QSurfaceFormat format() const = 0;
-
- protected:
- /// struct for what the backend supports
- typedef struct NVRenderBackendSupport
- {
- union {
- struct
- {
- bool bDXTImagesSupported : 1; ///< compressed images supported
- bool bAnistropySupported : 1; ///< anistropic filtering supported
- bool bTextureSwizzleSupported : 1; ///< texture swizzle supported
- bool bDepthStencilSupported : 1; ///< depth stencil textures are supported
- bool bFPRenderTargetsSupported : 1; ///< floating point render targets are
- ///supported
- bool bConstantBufferSupported : 1; ///< Constant (uniform) buffers are supported
- bool bMsTextureSupported : 1; ///< Multisample textures are esupported
- bool bFastBlitsSupported : 1; ///< The hardware supports fast memor blits
- bool bTessellationSupported : 1; ///< Hardware supports tessellation
- bool bComputeSupported : 1; ///< Hardware supports compute shader
- bool bGeometrySupported : 1; ///< Hardware supports geometry shader
- bool bTimerQuerySupported : 1; ///< Hardware supports timer queries
- bool bProgramInterfaceSupported : 1; ///< API supports program interface queries
- bool bStorageBufferSupported : 1; ///< Shader storage buffers are supported
- bool bAtomicCounterBufferSupported : 1; ///< Atomic counter buffers are
- /// supported
- bool bShaderImageLoadStoreSupported : 1; ///< Shader image load / store
- ///operations are supported
- bool bProgramPipelineSupported : 1; ///< Driver supports separate programs
- bool bNVPathRenderingSupported : 1; ///< Driver NV path rendering
- bool bNVAdvancedBlendSupported : 1; ///< Advanced blend modes supported
- bool bNVBlendCoherenceSupported : 1; ///< Advanced blend done coherently
- ///supported
- bool bGPUShader5ExtensionSupported : 1;
- bool bKHRAdvancedBlendSupported : 1; ///< Advanced blend modes supported
- bool bKHRBlendCoherenceSupported : 1; ///< Advanced blend done coherently
- bool bVertexArrayObjectSupported : 1;
- bool bStandardDerivativesSupported : 1;
- bool bTextureLodSupported : 1;
- } bits;
-
- QT3DSU32 u32Values;
- } caps;
- } NVRenderBackendSupportBits;
-
- NVRenderBackendSupportBits m_backendSupport; ///< holds the backend support bits
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.cpp b/src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.cpp
deleted file mode 100644
index d38c330c..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.cpp
+++ /dev/null
@@ -1,887 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/backends/gl/Q3DSRenderBackendGLES2.h"
-#include "render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h"
-
-#ifdef RENDER_BACKEND_LOG_GL_ERRORS
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError(#x, __FILE__, __LINE__)
-#else
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError()
-#endif
-
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
-#define GL_CALL_TIMER_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_TESSELATION_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_MULTISAMPLE_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_EXTRA_FUNCTION(x) m_glExtraFunctions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_EXTENSION_FUNCTION(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#else
-#define GL_CALL_TIMER_EXT(x)
-#define GL_CALL_TESSELATION_EXT(x)
-#define GL_CALL_MULTISAMPLE_EXT(x)
-#define GL_CALL_EXTRA_FUNCTION(x) m_glExtraFunctions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_EXTENSION_FUNCTION(x)
-#endif
-
-#ifndef GL_DEPTH_STENCIL_OES
-#define GL_DEPTH_STENCIL_OES 0x84F9
-#endif
-
-namespace qt3ds {
-namespace render {
-
-/// constructor
-NVRenderBackendGLES2Impl::NVRenderBackendGLES2Impl(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format)
- : NVRenderBackendGLBase(fnd, stringTable, format)
-{
- QString exts3tc = QStringLiteral("GL_EXT_texture_compression_s3tc");
- QString extsdxt = QStringLiteral("GL_EXT_texture_compression_dxt1");
- QString extsAniso = QStringLiteral("GL_EXT_texture_filter_anisotropic");
- QString extsTexSwizzle = QStringLiteral("GL_ARB_texture_swizzle");
- QString extsFPRenderTarget = QStringLiteral("GL_EXT_color_buffer_float");
- QString extsTimerQuery = QStringLiteral("GL_EXT_timer_query");
- QString extsGpuShader5 = QStringLiteral("EXT_gpu_shader5");
- QString extDepthTexture = QStringLiteral("GL_OES_packed_depth_stencil");
- QString extvao = QStringLiteral("GL_OES_vertex_array_object");
- QString extStdDd = QStringLiteral("GL_OES_standard_derivatives");
- QString extTexLod = QStringLiteral("GL_EXT_shader_texture_lod");
-
- const char *languageVersion = GetShadingLanguageVersion();
- qCInfo(TRACE_INFO, "GLSL version: %s", languageVersion);
-
- eastl::string apiVersion(getVersionString());
- qCInfo(TRACE_INFO, "GL version: %s", apiVersion.c_str());
-
- eastl::string apiVendor(getVendorString());
- qCInfo(TRACE_INFO, "HW vendor: %s", apiVendor.c_str());
-
- eastl::string apiRenderer(getRendererString());
- qCInfo(TRACE_INFO, "Vendor renderer: %s", apiRenderer.c_str());
-
- // clear support bits
- m_backendSupport.caps.u32Values = 0;
-
- const char *extensions = getExtensionString();
- m_extensions = QString::fromLocal8Bit(extensions).split(" ");
-
- // get extension count
- GLint numExtensions = m_extensions.size();
-
- for (QT3DSI32 i = 0; i < numExtensions; i++) {
-
- const QString &extensionString = m_extensions.at(i);
-
- // search for extension
- if (!m_backendSupport.caps.bits.bDXTImagesSupported
- && (exts3tc.compare(extensionString) == 0 || extsdxt.compare(extensionString) == 0)) {
- m_backendSupport.caps.bits.bDXTImagesSupported = true;
- } else if (!m_backendSupport.caps.bits.bAnistropySupported
- && extsAniso.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bAnistropySupported = true;
- } else if (!m_backendSupport.caps.bits.bFPRenderTargetsSupported
- && extsFPRenderTarget.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bFPRenderTargetsSupported = true;
- } else if (!m_backendSupport.caps.bits.bTimerQuerySupported
- && extsTimerQuery.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bTimerQuerySupported = true;
- } else if (!m_backendSupport.caps.bits.bGPUShader5ExtensionSupported
- && extsGpuShader5.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bGPUShader5ExtensionSupported = true;
- } else if (!m_backendSupport.caps.bits.bTextureSwizzleSupported
- && extsTexSwizzle.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bTextureSwizzleSupported = true;
- } else if (!m_backendSupport.caps.bits.bDepthStencilSupported
- && extDepthTexture.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bDepthStencilSupported = true;
- } else if (!m_backendSupport.caps.bits.bVertexArrayObjectSupported
- && extvao.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bVertexArrayObjectSupported = true;
- } else if (!m_backendSupport.caps.bits.bStandardDerivativesSupported
- && extStdDd.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bStandardDerivativesSupported = true;
- } else if (!m_backendSupport.caps.bits.bTextureLodSupported
- && extTexLod.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bTextureLodSupported = true;
- }
- }
-
- qCInfo(TRACE_INFO, "OpenGL extensions: %s", extensions);
-
- // constant buffers support is always not true
- m_backendSupport.caps.bits.bConstantBufferSupported = false;
-
- // query hardware
- GL_CALL_EXTRA_FUNCTION(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &m_MaxAttribCount));
-
- // internal state tracker
- m_pCurrentMiscState = QT3DS_NEW(m_Foundation.getAllocator(), NVRenderBackendMiscStateGL)();
-
- // finally setup caps based on device
- setAndInspectHardwareCaps();
-
- // Initialize extensions
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
- m_qt3dsExtensions = new Qt3DSOpenGLES2Extensions;
- m_qt3dsExtensions->initializeOpenGLFunctions();
-#endif
-}
-/// destructor
-NVRenderBackendGLES2Impl::~NVRenderBackendGLES2Impl()
-{
- if (m_pCurrentMiscState)
- NVDelete(m_Foundation.getAllocator(), m_pCurrentMiscState);
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
- if (m_qt3dsExtensions)
- delete m_qt3dsExtensions;
-#endif
-}
-
-void NVRenderBackendGLES2Impl::SetMultisampledTextureData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, size_t samples,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height,
- bool fixedsamplelocations)
-{
- NVRENDER_BACKEND_UNUSED(to);
- NVRENDER_BACKEND_UNUSED(target);
- NVRENDER_BACKEND_UNUSED(samples);
- NVRENDER_BACKEND_UNUSED(internalFormat);
- NVRENDER_BACKEND_UNUSED(width);
- NVRENDER_BACKEND_UNUSED(height);
- NVRENDER_BACKEND_UNUSED(fixedsamplelocations);
-}
-
-void NVRenderBackendGLES2Impl::SetTextureData3D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, size_t depth,
- QT3DSI32 border, NVRenderTextureFormats::Enum format, const void *hostPtr)
-{
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
- bool conversionRequired = format != internalFormat;
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
- }
-
- if (conversionRequired) {
- GLenum dummy;
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, dummy);
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- glInternalFormat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- } else if (NVRenderTextureFormats::isDepthTextureFormat(format)) {
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- }
-
- GL_CALL_EXTRA_FUNCTION(glTexImage3D(glTarget, level, glInternalFormat, (GLsizei)width,
- (GLsizei)height, (GLsizei)depth, border, glformat,
- gltype, hostPtr));
-
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
-}
-
-void NVRenderBackendGLES2Impl::SetTextureData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format, const void *hostPtr)
-{
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
- bool conversionRequired = format != internalFormat;
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
- glInternalFormat = glformat;
- }
-
- if (conversionRequired) {
- GLenum dummy;
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, dummy);
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- glInternalFormat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- } else if (NVRenderTextureFormats::isDepthTextureFormat(format)) {
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- if (format == NVRenderTextureFormats::Depth24Stencil8) {
- glformat = GL_DEPTH_STENCIL_OES;
- gltype = GL_UNSIGNED_INT_24_8;
- }
- glInternalFormat = glformat;
- }
-
- Q_ASSERT(glformat == glInternalFormat);
- GL_CALL_EXTRA_FUNCTION(glTexImage2D(glTarget, level, glInternalFormat, (GLsizei)width,
- (GLsizei)height, border, glformat, gltype, hostPtr));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
-}
-
-void NVRenderBackendGLES2Impl::UpdateSampler(
- NVRenderBackendSamplerObject /* so */, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter, NVRenderTextureMagnifyingOp::Enum magFilter,
- NVRenderTextureCoordOp::Enum wrapS, NVRenderTextureCoordOp::Enum wrapT,
- NVRenderTextureCoordOp::Enum wrapR, QT3DSF32 minLod, QT3DSF32 maxLod, QT3DSF32 lodBias,
- NVRenderTextureCompareMode::Enum compareMode, NVRenderTextureCompareOp::Enum compareFunc,
- QT3DSF32 anisotropy, QT3DSF32 *borderColor)
-{
-
- // Satisfy the compiler
- // These are not available in GLES 3 and we don't use them right now
- QT3DS_ASSERT(lodBias == 0.0);
- QT3DS_ASSERT(!borderColor);
- NVRENDER_BACKEND_UNUSED(lodBias);
- NVRENDER_BACKEND_UNUSED(borderColor);
- NVRENDER_BACKEND_UNUSED(wrapR);
- NVRENDER_BACKEND_UNUSED(minLod);
- NVRENDER_BACKEND_UNUSED(maxLod);
- NVRENDER_BACKEND_UNUSED(compareMode);
- NVRENDER_BACKEND_UNUSED(compareFunc);
-
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MIN_FILTER,
- m_Conversion.fromTextureMinifyingOpToGL(minFilter)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MAG_FILTER,
- m_Conversion.fromTextureMagnifyingOpToGL(magFilter)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_S,
- m_Conversion.fromTextureCoordOpToGL(wrapS)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_T,
- m_Conversion.fromTextureCoordOpToGL(wrapT)));
-
- if (m_backendSupport.caps.bits.bAnistropySupported) {
- GL_CALL_EXTRA_FUNCTION(glTexParameterf(glTarget, GL_TEXTURE_MAX_ANISOTROPY_EXT,
- anisotropy));
- }
-}
-
-void NVRenderBackendGLES2Impl::UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSI32 baseLevel, QT3DSI32 maxLevel)
-{
- NVRENDER_BACKEND_UNUSED(to);
-
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_BASE_LEVEL, baseLevel));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MAX_LEVEL, maxLevel));
-}
-
-void NVRenderBackendGLES2Impl::UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode)
-{
- NVRENDER_BACKEND_UNUSED(to);
- NVRENDER_BACKEND_UNUSED(target);
- NVRENDER_BACKEND_UNUSED(swizzleMode);
-#if defined(QT_OPENGL_ES)
- if (m_backendSupport.caps.bits.bTextureSwizzleSupported) {
- GLint glSwizzle[4];
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- m_Conversion.NVRenderConvertSwizzleModeToGL(swizzleMode, glSwizzle);
-
- // since ES3 spec has no GL_TEXTURE_SWIZZLE_RGBA set it separately
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_R, glSwizzle[0]));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_G, glSwizzle[1]));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_B, glSwizzle[2]));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_A, glSwizzle[3]));
-
- }
-#endif
-}
-
-QT3DSU32
-NVRenderBackendGLES2Impl::GetDepthBits() const
-{
- QT3DSI32 depthBits;
- GL_CALL_EXTRA_FUNCTION(
- glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
- GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &depthBits));
-
- return depthBits;
-}
-
-QT3DSU32
-NVRenderBackendGLES2Impl::GetStencilBits() const
-{
- QT3DSI32 stencilBits;
- GL_CALL_EXTRA_FUNCTION(
- glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER,
- GL_DEPTH_ATTACHMENT,
- GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
- &stencilBits));
-
- return stencilBits;
-}
-
-void NVRenderBackendGLES2Impl::GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum /*genType*/)
-{
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
- GL_CALL_EXTRA_FUNCTION(glGenerateMipmap(glTarget));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
-}
-
-bool NVRenderBackendGLES2Impl::SetInputAssembler(NVRenderBackendInputAssemblerObject iao,
- NVRenderBackendShaderProgramObject po)
-{
- if (iao == nullptr) {
- // unbind and return;
- GL_CALL_EXTENSION_FUNCTION(glBindVertexArrayOES(0));
- return true;
- }
-
- NVRenderBackendInputAssemblerGL *inputAssembler = (NVRenderBackendInputAssemblerGL *)iao;
- NVRenderBackendAttributeLayoutGL *attribLayout = inputAssembler->m_attribLayout;
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
- NVDataRef<NVRenderBackendShaderInputEntryGL> shaderAttribBuffer;
- if (pProgram->m_shaderInput)
- shaderAttribBuffer = pProgram->m_shaderInput->m_ShaderInputEntries;
-
- if ((attribLayout->m_LayoutAttribEntries.size() < shaderAttribBuffer.size())
- || (inputAssembler->m_VertexbufferHandles.size() <= attribLayout->m_MaxInputSlot)) {
- return false;
- }
-
- if (inputAssembler->m_VaoID == 0) {
- // generate vao
- GL_CALL_EXTENSION_FUNCTION(glGenVertexArraysOES(1, &inputAssembler->m_VaoID));
- QT3DS_ASSERT(inputAssembler->m_VaoID);
- }
-
- if (inputAssembler->m_cachedShaderHandle != programID) {
- GL_CALL_EXTENSION_FUNCTION(glBindVertexArrayOES(inputAssembler->m_VaoID));
- inputAssembler->m_cachedShaderHandle = programID;
-
- QT3DS_FOREACH(idx, shaderAttribBuffer.size())
- {
- const NVRenderBackendShaderInputEntryGL &attrib(shaderAttribBuffer[idx]);
- NVRenderBackendLayoutEntryGL *entry =
- attribLayout->getEntryByName(attrib.m_AttribName);
-
- if (entry) {
- NVRenderBackendLayoutEntryGL &entryData(*entry);
- if (entryData.m_Type != attrib.m_Type
- || entryData.m_NumComponents != attrib.m_NumComponents) {
- qCCritical(INVALID_OPERATION, "Attrib %s dn't match vertex layout",
- attrib.m_AttribName.c_str());
- QT3DS_ASSERT(false);
- return false;
- } else {
- entryData.m_AttribIndex = attrib.m_AttribLocation;
- }
- } else {
- qCWarning(WARNING, "Failed to Bind attribute %s", attrib.m_AttribName.c_str());
- }
- }
-
- // disable max possible used first
- // this is currently sufficient since we always re-arrange input attributes from 0
- for (QT3DSU32 i = 0; i < attribLayout->m_LayoutAttribEntries.size(); i++)
- GL_CALL_EXTRA_FUNCTION(glDisableVertexAttribArray(i));
-
- // setup all attribs
- QT3DS_FOREACH(idx, shaderAttribBuffer.size())
- {
- NVRenderBackendLayoutEntryGL *entry =
- attribLayout->getEntryByName(shaderAttribBuffer[idx].m_AttribName);
- if (entry) {
- const NVRenderBackendLayoutEntryGL &entryData(*entry);
- GLuint id = HandleToID_cast(
- GLuint, size_t,
- inputAssembler->m_VertexbufferHandles.mData[entryData.m_InputSlot]);
- GL_CALL_EXTRA_FUNCTION(glBindBuffer(GL_ARRAY_BUFFER, id));
- GL_CALL_EXTRA_FUNCTION(glEnableVertexAttribArray(entryData.m_AttribIndex));
- GLuint offset = inputAssembler->m_offsets[entryData.m_InputSlot];
- GLuint stride = inputAssembler->m_strides[entryData.m_InputSlot];
- GL_CALL_EXTRA_FUNCTION(glVertexAttribPointer(
- entryData.m_AttribIndex, entryData.m_NumComponents, GL_FLOAT, GL_FALSE,
- stride, (const void *)(entryData.m_Offset + offset)));
-
- } else {
- GL_CALL_EXTRA_FUNCTION(glDisableVertexAttribArray(idx));
- }
- }
-
- // setup index buffer.
- if (inputAssembler->m_IndexbufferHandle) {
- GL_CALL_EXTRA_FUNCTION(glBindBuffer(
- GL_ELEMENT_ARRAY_BUFFER,
- HandleToID_cast(GLuint, size_t, inputAssembler->m_IndexbufferHandle)));
- } else {
- GL_CALL_EXTRA_FUNCTION(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
- }
- } else {
- GL_CALL_EXTENSION_FUNCTION(glBindVertexArrayOES(inputAssembler->m_VaoID));
- }
-#ifdef _DEBUG
- if (inputAssembler->m_VaoID) {
- QT3DS_FOREACH(idx, shaderAttribBuffer.size())
- {
- const NVRenderBackendShaderInputEntryGL &attrib(shaderAttribBuffer[idx]);
- NVRenderBackendLayoutEntryGL *entry =
- attribLayout->getEntryByName(attrib.m_AttribName);
-
- if (entry) {
- NVRenderBackendLayoutEntryGL &entryData(*entry);
- if (entryData.m_Type != attrib.m_Type
- || entryData.m_NumComponents != attrib.m_NumComponents
- || entryData.m_AttribIndex != attrib.m_AttribLocation) {
- qCCritical(INVALID_OPERATION, "Attrib %s dn't match vertex layout",
- attrib.m_AttribName.c_str());
- QT3DS_ASSERT(false);
- }
- } else {
- qCWarning(WARNING, "Failed to Bind attribute %s", attrib.m_AttribName.c_str());
- }
- }
- }
-#endif // _DEBUG
-
- return true;
-}
-
-void NVRenderBackendGLES2Impl::SetDrawBuffers(NVRenderBackendRenderTargetObject rto,
- NVConstDataRef<QT3DSI32> inDrawBufferSet)
-{
- NVRENDER_BACKEND_UNUSED(rto);
-
- m_DrawBuffersArray.clear();
-
- for (QT3DSU32 idx = 0, end = inDrawBufferSet.size(); idx < end; ++idx) {
- if (inDrawBufferSet[idx] < 0)
- m_DrawBuffersArray.push_back(GL_NONE);
- else
- m_DrawBuffersArray.push_back(GL_COLOR_ATTACHMENT0 + inDrawBufferSet[idx]);
- }
-
- GL_CALL_EXTRA_FUNCTION(glDrawBuffers((int)m_DrawBuffersArray.size(),
- m_DrawBuffersArray.data()));
-}
-
-void NVRenderBackendGLES2Impl::SetReadBuffer(NVRenderBackendRenderTargetObject rto,
- NVReadFaces::Enum inReadFace)
-{
- NVRENDER_BACKEND_UNUSED(rto);
- NVRENDER_BACKEND_UNUSED(inReadFace);
-}
-
-void NVRenderBackendGLES2Impl::RenderTargetAttach(NVRenderBackendRenderTargetObject,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to, QT3DSI32 level,
- QT3DSI32 layer)
-{
- NVRENDER_BACKEND_UNUSED(attachment);
- NVRENDER_BACKEND_UNUSED(to);
- NVRENDER_BACKEND_UNUSED(level);
- NVRENDER_BACKEND_UNUSED(layer);
- Q_ASSERT(false);
-}
-
-void NVRenderBackendGLES2Impl::BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1,
- QT3DSI32 srcY1, QT3DSI32 dstX0, QT3DSI32 dstY0,
- QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter)
-{
- GL_CALL_EXTRA_FUNCTION(glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1,
- dstY1,
- m_Conversion.fromClearFlagsToGL(flags),
- m_Conversion.fromTextureMagnifyingOpToGL(filter)));
-}
-
-
-NVRenderBackend::NVRenderBackendRenderTargetObject NVRenderBackendGLES2Impl::CreateRenderTarget()
-{
- GLuint fboID = 0;
- GL_CALL_EXTRA_FUNCTION(glGenFramebuffers(1, &fboID));
- return (NVRenderBackend::NVRenderBackendRenderTargetObject)fboID;
-}
-
-void NVRenderBackendGLES2Impl::ReleaseRenderTarget(NVRenderBackendRenderTargetObject rto)
-{
- GLuint fboID = HandleToID_cast(GLuint, size_t, rto);
-
- if (fboID)
- GL_CALL_EXTRA_FUNCTION(glDeleteFramebuffers(1, &fboID));
-}
-
-void NVRenderBackendGLES2Impl::RenderTargetAttach(NVRenderBackendRenderTargetObject /* rto */,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendRenderbufferObject rbo)
-{
- // rto must be the current render target
- GLuint rbID = HandleToID_cast(GLuint, size_t, rbo);
-
- GLenum glAttach = GLConversion::fromFramebufferAttachmentsToGL(attachment);
-
- GL_CALL_EXTRA_FUNCTION(glFramebufferRenderbuffer(GL_FRAMEBUFFER, glAttach, GL_RENDERBUFFER,
- rbID));
-}
-
-void NVRenderBackendGLES2Impl::RenderTargetAttach(NVRenderBackendRenderTargetObject /* rto */,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target)
-{
- // rto must be the current render target
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
-
- QT3DS_ASSERT(target == NVRenderTextureTargetType::Texture2D
- || m_backendSupport.caps.bits.bMsTextureSupported);
-
- GLenum glAttach = GLConversion::fromFramebufferAttachmentsToGL(attachment);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- if (attachment == NVRenderFrameBufferAttachments::DepthStencil) {
- GL_CALL_EXTRA_FUNCTION(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
- glTarget, texID, 0));
- GL_CALL_EXTRA_FUNCTION(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
- glTarget, texID, 0));
- } else {
- GL_CALL_EXTRA_FUNCTION(glFramebufferTexture2D(GL_FRAMEBUFFER, glAttach, glTarget, texID,
- 0));
- }
-}
-
-void NVRenderBackendGLES2Impl::SetRenderTarget(NVRenderBackendRenderTargetObject rto)
-{
- GLuint fboID = HandleToID_cast(GLuint, size_t, rto);
-
- GL_CALL_EXTRA_FUNCTION(glBindFramebuffer(GL_FRAMEBUFFER, fboID));
-}
-
-void NVRenderBackendGLES2Impl::SetReadTarget(NVRenderBackendRenderTargetObject rto)
-{
- GLuint fboID = HandleToID_cast(GLuint, size_t, rto);
-
- GL_CALL_EXTRA_FUNCTION(glBindFramebuffer(GL_READ_FRAMEBUFFER, fboID));
-}
-
-bool NVRenderBackendGLES2Impl::RenderTargetIsValid(NVRenderBackendRenderTargetObject /* rto */)
-{
- GLenum completeStatus = GL_CALL_EXTRA_FUNCTION(glCheckFramebufferStatus(GL_FRAMEBUFFER));
- switch (completeStatus) {
-#define HANDLE_INCOMPLETE_STATUS(x) \
- case x: \
- qCCritical(INTERNAL_ERROR, "Framebuffer is not complete: %s", #x); \
- return false;
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS)
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_UNSUPPORTED)
- #undef HANDLE_INCOMPLETE_STATUS
- }
- return true;
-}
-
-NVRenderBackend::NVRenderBackendRenderbufferObject
-NVRenderBackendGLES2Impl::CreateRenderbuffer(NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height)
-{
- GLuint bufID = 0;
-
- GL_CALL_EXTRA_FUNCTION(glGenRenderbuffers(1, &bufID));
- GL_CALL_EXTRA_FUNCTION(glBindRenderbuffer(GL_RENDERBUFFER, bufID));
- GL_CALL_EXTRA_FUNCTION(glRenderbufferStorage(GL_RENDERBUFFER,
- GLConversion::fromRenderBufferFormatsToRenderBufferGL(storageFormat),
- (GLsizei)width, (GLsizei)height));
-
- // check for error
- GLenum error = m_glFunctions->glGetError();
- if (error != GL_NO_ERROR) {
- qCCritical(GL_ERROR, GLConversion::processGLError(error));
- QT3DS_ASSERT(false);
- GL_CALL_EXTRA_FUNCTION(glDeleteRenderbuffers(1, &bufID));
- bufID = 0;
- }
-
- GL_CALL_EXTRA_FUNCTION(glBindRenderbuffer(GL_RENDERBUFFER, 0));
-
- return (NVRenderBackend::NVRenderBackendRenderbufferObject)bufID;
-}
-
-void NVRenderBackendGLES2Impl::ReleaseRenderbuffer(NVRenderBackendRenderbufferObject rbo)
-{
- GLuint bufID = HandleToID_cast(GLuint, size_t, rbo);
-
- if (bufID)
- GL_CALL_EXTRA_FUNCTION(glDeleteRenderbuffers(1, &bufID));
-}
-
-bool NVRenderBackendGLES2Impl::ResizeRenderbuffer(NVRenderBackendRenderbufferObject rbo,
- NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height)
-{
- bool success = true;
- GLuint bufID = HandleToID_cast(GLuint, size_t, rbo);
-
- QT3DS_ASSERT(bufID);
-
- GL_CALL_EXTRA_FUNCTION(glBindRenderbuffer(GL_RENDERBUFFER, bufID));
- GL_CALL_EXTRA_FUNCTION(glRenderbufferStorage(GL_RENDERBUFFER,
- GLConversion::fromRenderBufferFormatsToRenderBufferGL(storageFormat),
- (GLsizei)width, (GLsizei)height));
-
- // check for error
- GLenum error = m_glFunctions->glGetError();
- if (error != GL_NO_ERROR) {
- qCCritical(GL_ERROR, GLConversion::processGLError(error));
- QT3DS_ASSERT(false);
- success = false;
- }
-
- return success;
-}
-
-void *NVRenderBackendGLES2Impl::MapBuffer(NVRenderBackendBufferObject,
- NVRenderBufferBindFlags bindFlags, size_t offset,
- size_t length, NVRenderBufferAccessFlags accessFlags)
-{
- void *ret = nullptr;
- ret = GL_CALL_EXTRA_FUNCTION(
- glMapBufferRange(m_Conversion.fromBindBufferFlagsToGL(bindFlags), offset,
- length, m_Conversion.fromBufferAccessBitToGL(accessFlags)));
-
- return ret;
-}
-
-bool NVRenderBackendGLES2Impl::UnmapBuffer(NVRenderBackendBufferObject,
- NVRenderBufferBindFlags bindFlags)
-{
- GLboolean ret;
-
- ret = GL_CALL_EXTRA_FUNCTION(glUnmapBuffer(m_Conversion.fromBindBufferFlagsToGL(bindFlags)));
-
- return (ret) ? true : false;
-}
-
-QT3DSI32 NVRenderBackendGLES2Impl::GetConstantBufferCount(NVRenderBackendShaderProgramObject po)
-{
- QT3DS_ASSERT(po);
- GLint numUniformBuffers = 0;
- if (GetRenderBackendCap(NVRenderBackendCaps::ConstantBuffer)) {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GL_CALL_EXTRA_FUNCTION(glGetProgramiv(programID, GL_ACTIVE_UNIFORM_BLOCKS,
- &numUniformBuffers));
- }
- return numUniformBuffers;
-}
-
-QT3DSI32 NVRenderBackendGLES2Impl::GetConstantBufferInfoByID(
- NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize,
- QT3DSI32 *paramCount, QT3DSI32 *bufferSize,
- QT3DSI32 *length, char *nameBuf)
-{
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(length);
- QT3DS_ASSERT(nameBuf);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
- GLuint blockIndex = GL_INVALID_INDEX;
-
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockName(programID, id, nameBufSize, length,
- nameBuf));
-
- if (*length > 0) {
- blockIndex = GL_CALL_EXTRA_FUNCTION(glGetUniformBlockIndex(programID, nameBuf));
- if (blockIndex != GL_INVALID_INDEX) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockiv(programID, blockIndex,
- GL_UNIFORM_BLOCK_DATA_SIZE, bufferSize));
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockiv(programID, blockIndex,
- GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, paramCount));
- }
- }
-
- return blockIndex;
-}
-
-void NVRenderBackendGLES2Impl::GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSI32 *indices)
-{
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(indices);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- if (indices) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockiv(programID, id,
- GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
- indices));
- }
-}
-
-void NVRenderBackendGLES2Impl::GetConstantBufferParamInfoByIndices(
- NVRenderBackendShaderProgramObject po, QT3DSU32 count, QT3DSU32 *indices, QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset)
-{
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(count);
- QT3DS_ASSERT(indices);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- if (count && indices) {
- if (type) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformsiv(programID, count, indices,
- GL_UNIFORM_TYPE, type));
- // convert to UIC types
- QT3DS_FOREACH(idx, count)
- {
- type[idx] = m_Conversion.fromShaderGLToPropertyDataTypes(type[idx]);
- }
- }
- if (size) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformsiv(programID, count, indices,
- GL_UNIFORM_SIZE, size));
- }
- if (offset) {
- GL_CALL_EXTRA_FUNCTION(
- glGetActiveUniformsiv(programID, count, indices, GL_UNIFORM_OFFSET, offset));
- }
- }
-}
-
-void NVRenderBackendGLES2Impl::ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding)
-{
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GL_CALL_EXTRA_FUNCTION(glUniformBlockBinding(programID, blockIndex, binding));
-}
-
-void NVRenderBackendGLES2Impl::ProgramSetConstantBuffer(QT3DSU32 index,
- NVRenderBackendBufferObject bo)
-{
- QT3DS_ASSERT(bo);
-
- GLuint bufID = HandleToID_cast(GLuint, size_t, bo);
- GL_CALL_EXTRA_FUNCTION(glBindBufferBase(GL_UNIFORM_BUFFER, index, bufID));
-}
-
-NVRenderBackend::NVRenderBackendQueryObject NVRenderBackendGLES2Impl::CreateQuery()
-{
- QT3DSU32 glQueryID = 0;
-
- return (NVRenderBackendQueryObject)glQueryID;
-}
-
-void NVRenderBackendGLES2Impl::ReleaseQuery(NVRenderBackendQueryObject)
-{
-
-}
-
-void NVRenderBackendGLES2Impl::BeginQuery(NVRenderBackendQueryObject,
- NVRenderQueryType::Enum)
-{
-
-}
-
-void NVRenderBackendGLES2Impl::EndQuery(NVRenderBackendQueryObject, NVRenderQueryType::Enum)
-{
-
-}
-
-void NVRenderBackendGLES2Impl::GetQueryResult(NVRenderBackendQueryObject,
- NVRenderQueryResultType::Enum,
- QT3DSU32 *)
-{
-
-}
-
-void NVRenderBackendGLES2Impl::GetQueryResult(NVRenderBackendQueryObject,
- NVRenderQueryResultType::Enum,
- QT3DSU64 *)
-{
-
-}
-
-void NVRenderBackendGLES2Impl::SetQueryTimer(NVRenderBackendQueryObject)
-{
-
-}
-
-NVRenderBackend::NVRenderBackendSyncObject
-NVRenderBackendGLES2Impl::CreateSync(NVRenderSyncType::Enum, NVRenderSyncFlags)
-{
- GLsync syncID = 0;
- return NVRenderBackendSyncObject(syncID);
-}
-
-void NVRenderBackendGLES2Impl::ReleaseSync(NVRenderBackendSyncObject)
-{
-
-}
-
-void NVRenderBackendGLES2Impl::WaitSync(NVRenderBackendSyncObject, NVRenderCommandFlushFlags,
- QT3DSU64)
-{
-
-}
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.h
deleted file mode 100644
index 4890de0e..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Q3DSRenderBackendGLES2.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_RENDER_BACKEND_GLES2_H
-#define QT3DS_RENDER_BACKEND_GLES2_H
-
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/gl/Qt3DSRenderBackendGLBase.h"
-#include "render/backends/gl/Qt3DSOpenGLExtensions.h"
-
-#include <QtGui/qopenglextrafunctions.h>
-#include <QtOpenGLExtensions/QtOpenGLExtensions>
-
-namespace qt3ds {
-namespace render {
-
- ///< forward declaration
- class NVRenderBackendMiscStateGL;
-
- using namespace foundation;
-
- class NVRenderBackendGLES2Impl : public NVRenderBackendGLBase
- {
- public:
- /// constructor
- NVRenderBackendGLES2Impl(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format);
- /// destructor
- virtual ~NVRenderBackendGLES2Impl();
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- public:
- QT3DSU32 GetDepthBits() const override;
- QT3DSU32 GetStencilBits() const override;
- void GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum genType) override;
-
- void SetMultisampledTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- size_t samples,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height,
- bool fixedsamplelocations) override;
-
- void SetTextureData3D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, size_t depth, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = nullptr) override;
-
- void SetTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = nullptr) override;
-
- void UpdateSampler(
- NVRenderBackendSamplerObject so, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- QT3DSF32 minLod = -1000.0f, QT3DSF32 maxLod = 1000.0f, QT3DSF32 lodBias = 0.0f,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0f, QT3DSF32 *borderColor = nullptr) override;
-
- void UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSI32 baseLevel,
- QT3DSI32 maxLevel) override;
-
- void UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode) override;
-
- bool SetInputAssembler(NVRenderBackendInputAssemblerObject iao,
- NVRenderBackendShaderProgramObject po) override;
-
- void SetDrawBuffers(NVRenderBackendRenderTargetObject rto,
- NVConstDataRef<QT3DSI32> inDrawBufferSet) override;
- void SetReadBuffer(NVRenderBackendRenderTargetObject rto,
- NVReadFaces::Enum inReadFace) override;
-
- void BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter) override;
-
-
- NVRenderBackendRenderTargetObject CreateRenderTarget() override;
- void ReleaseRenderTarget(NVRenderBackendRenderTargetObject rto) override;
- void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendRenderbufferObject rbo) override;
- void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target
- = NVRenderTextureTargetType::Texture2D) override;
- void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to, QT3DSI32 level,
- QT3DSI32 layer) override;
- void SetRenderTarget(NVRenderBackendRenderTargetObject rto) override;
- bool RenderTargetIsValid(NVRenderBackendRenderTargetObject rto) override;
-
- virtual NVRenderBackendRenderbufferObject
- CreateRenderbuffer(NVRenderRenderBufferFormats::Enum storageFormat, size_t width,
- size_t height) override;
- void SetReadTarget(NVRenderBackendRenderTargetObject rto) override;
- void ReleaseRenderbuffer(NVRenderBackendRenderbufferObject rbo) override;
- bool ResizeRenderbuffer(NVRenderBackendRenderbufferObject rbo,
- NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height) override;
-
- void *MapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags,
- size_t offset, size_t length,
- NVRenderBufferAccessFlags accessFlags) override;
- bool UnmapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags) override;
-
- QT3DSI32 GetConstantBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf) override;
- void GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSI32 *indices) override;
- void GetConstantBufferParamInfoByIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 count, QT3DSU32 *indices,
- QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset) override;
- void ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding) override;
- void ProgramSetConstantBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- NVRenderBackendQueryObject CreateQuery() override;
- void ReleaseQuery(NVRenderBackendQueryObject qo) override;
- void BeginQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) override;
- void EndQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) override;
- void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU32 *params) override;
- void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU64 *params) override;
- void SetQueryTimer(NVRenderBackendQueryObject qo) override;
-
- NVRenderBackendSyncObject CreateSync(NVRenderSyncType::Enum tpye,
- NVRenderSyncFlags syncFlags) override;
- void ReleaseSync(NVRenderBackendSyncObject so) override;
- void WaitSync(NVRenderBackendSyncObject so, NVRenderCommandFlushFlags syncFlags,
- QT3DSU64 timeout) override;
-
- protected:
- NVRenderBackendMiscStateGL *m_pCurrentMiscState; ///< this holds the current misc state
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
- Qt3DSOpenGLES2Extensions *m_qt3dsExtensions;
-#endif
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.cpp b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.cpp
deleted file mode 100644
index 564ecd5a..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/backends/gl/Qt3DSOpenGLExtensions.h"
-
-Qt3DSOpenGLExtensions::Qt3DSOpenGLExtensions()
- : QAbstractOpenGLExtension(*(new Qt3DSOpenGLExtensionsPrivate))
-{
-}
-
-bool Qt3DSOpenGLExtensions::initializeOpenGLFunctions()
-{
- if (isInitialized())
- return true;
-
- QT_PREPEND_NAMESPACE(QOpenGLContext) *context =
- QT_PREPEND_NAMESPACE(QOpenGLContext)::currentContext();
- if (!context) {
- qWarning("A current OpenGL context is required to resolve functions");
- return false;
- }
-
- Q_D(Qt3DSOpenGLExtensions);
-
- d->BlendBarrierNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)()>(
- context->getProcAddress("glBlendBarrierNV"));
- d->PathGlyphIndexArrayNV = reinterpret_cast<GLenum (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, const void*, GLbitfield, GLuint, GLsizei, GLuint,
- GLfloat)>(
- context->getProcAddress("glPathGlyphIndexArrayNV"));
- d->PathGlyphIndexRangeNV = reinterpret_cast<GLenum (QOPENGLF_APIENTRYP)(
- GLenum, const void*, GLbitfield, GLuint, GLfloat, GLuint[2])>(
- context->getProcAddress("glPathGlyphIndexRangeNV"));
- QAbstractOpenGLExtension::initializeOpenGLFunctions();
- return true;
-}
-
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
-Qt3DSOpenGLES2Extensions::Qt3DSOpenGLES2Extensions()
-{
-}
-
-bool Qt3DSOpenGLES2Extensions::initializeOpenGLFunctions()
-{
- if (isInitialized())
- return true;
-
- QT_PREPEND_NAMESPACE(QOpenGLContext) *context =
- QT_PREPEND_NAMESPACE(QOpenGLContext)::currentContext();
- if (!context) {
- qWarning("A current OpenGL context is required to resolve functions");
- return false;
- }
-
- Q_D(Qt3DSOpenGLExtensions);
-
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
- d->PatchParameteriEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLenum, GLint)>(
- context->getProcAddress("glPatchParameteriEXT"));
- d->QueryCounterEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum)>(
- context->getProcAddress("glQueryCounterEXT"));
- d->GetQueryObjectui64vEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, GLuint64 *)>(
- context->getProcAddress("glGetQueryObjectui64vEXT"));
- d->GenPathsNV = reinterpret_cast<GLuint (QOPENGLF_APIENTRYP)(
- GLsizei)>(
- context->getProcAddress("glGenPathsNV"));
- d->DeletePathsNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLsizei)>(
- context->getProcAddress("glDeletePathsNV"));
- d->PathCommandsNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLsizei, const GLubyte *, GLsizei, GLenum, const void *)>(
- context->getProcAddress("glPathCommandsNV"));
- d->PathGlyphsNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, const void *, GLbitfield, GLsizei, GLenum, const void *,
- GLenum, GLuint, GLfloat)>(
- context->getProcAddress("glPathGlyphsNV"));
- d->PathGlyphRangeNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, const void *, GLbitfield, GLuint, GLsizei, GLenum,
- GLuint, GLfloat)>(
- context->getProcAddress("glPathGlyphRangeNV"));
- d->PathParameterfNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, GLfloat)>(
- context->getProcAddress("glPathParameterfNV"));
- d->PathStencilDepthOffsetNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLfloat, GLfloat)>(
- context->getProcAddress("glPathStencilDepthOffsetNV"));
- d->StencilFillPathNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, GLuint)>(
- context->getProcAddress("glStencilFillPathNV"));
- d->StencilStrokePathNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLint, GLuint)>(
- context->getProcAddress("glStencilStrokePathNV"));
- d->StencilFillPathInstancedNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLsizei, GLenum, const void *, GLuint, GLenum, GLuint, GLenum,
- const GLfloat *)>(
- context->getProcAddress("glStencilFillPathInstancedNV"));
- d->StencilStrokePathInstancedNV
- = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLenum,
- const void *, GLuint, GLint, GLuint, GLenum, const GLfloat *)>(
- context->getProcAddress("glStencilStrokePathInstancedNV"));
- d->PathCoverDepthFuncNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLenum func)>(
- context->getProcAddress("glPathCoverDepthFuncNV"));
- d->CoverFillPathInstancedNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLsizei, GLenum, const void *, GLuint, GLenum, GLenum,
- const GLfloat *)>(
- context->getProcAddress("glCoverFillPathInstancedNV"));
- d->CoverStrokePathInstancedNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLsizei, GLenum, const void *, GLuint, GLenum, GLenum,
- const GLfloat *)>(
- context->getProcAddress("glCoverStrokePathInstancedNV"));
- d->GetPathParameterfvNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLuint, GLenum, GLfloat *)>(
- context->getProcAddress("glGetPathParameterfvNV"));
- d->GetPathMetricsNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLbitfield, GLsizei, GLenum, const void *, GLuint, GLsizei, GLfloat *)>(
- context->getProcAddress("glGetPathMetricsNV"));
- d->GetPathMetricRangeNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLbitfield, GLuint, GLsizei, GLsizei, GLfloat *)>(
- context->getProcAddress("glGetPathMetricRangeNV"));
- d->GetPathSpacingNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(
- GLenum, GLsizei, GLenum, const void *, GLuint, GLfloat, GLfloat, GLenum,
- GLfloat *)>(
- context->getProcAddress("glGetPathSpacingNV"));
- d->BindVertexArrayOES = reinterpret_cast<void (QOPENGLF_APIENTRYP)
- (GLuint)>(
- context->getProcAddress("glBindVertexArrayOES"));
- d->DeleteVertexArraysOES = reinterpret_cast<void (QOPENGLF_APIENTRYP)
- (GLsizei, const GLuint *)>(
- context->getProcAddress("glDeleteVertexArraysOES"));
- d->GenVertexArraysOES = reinterpret_cast<void (QOPENGLF_APIENTRYP)
- (GLsizei, GLuint *)>(
- context->getProcAddress("glGenVertexArraysOES"));
- d->IsVertexArrayOES = reinterpret_cast<GLboolean (QOPENGLF_APIENTRYP)
- (GLuint)>(
- context->getProcAddress("glIsVertexArrayOES"));
-#endif
- Qt3DSOpenGLExtensions::initializeOpenGLFunctions();
- return true;
-}
-#endif // QT_OPENGL_ES
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.h
deleted file mode 100644
index c9ba76a6..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLExtensions.h
+++ /dev/null
@@ -1,392 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DSOPENGLEXTENSIONS_H
-#define QT3DSOPENGLEXTENSIONS_H
-
-#include <QtOpenGLExtensions/QtOpenGLExtensions>
-
-/* Some OpenGL extensions that are not (yet) found in Qt's OpenGL extensions.
- * These should be auto-generated and added to QtOpenGLExtensions module */
-class Qt3DSOpenGLExtensionsPrivate : public QAbstractOpenGLExtensionPrivate
-{
-public:
- void (QOPENGLF_APIENTRYP BlendBarrierNV)();
- GLenum (QOPENGLF_APIENTRYP PathGlyphIndexArrayNV)(
- GLuint, GLenum, const void*, GLbitfield, GLuint, GLsizei, GLuint,
- GLfloat);
- GLenum (QOPENGLF_APIENTRYP PathGlyphIndexRangeNV)(
- GLenum, const void*, GLbitfield, GLuint, GLfloat, GLuint[2]);
-
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
- void (QOPENGLF_APIENTRYP PatchParameteriEXT)(GLenum, GLint);
- void (QOPENGLF_APIENTRYP QueryCounterEXT)(GLuint, GLenum);
- void (QOPENGLF_APIENTRYP GetQueryObjectui64vEXT)(GLuint, GLenum,
- GLuint64 *);
- GLuint (QOPENGLF_APIENTRYP GenPathsNV)(GLsizei);
- void (QOPENGLF_APIENTRYP DeletePathsNV)(GLuint, GLsizei);
- void (QOPENGLF_APIENTRYP PathCommandsNV)(GLuint, GLsizei, const GLubyte *,
- GLsizei, GLenum, const void *);
- void (QOPENGLF_APIENTRYP PathGlyphsNV)(GLuint, GLenum, const void *,
- GLbitfield, GLsizei, GLenum, const void *, GLenum, GLuint, GLfloat);
- void (QOPENGLF_APIENTRYP PathGlyphRangeNV)(GLuint, GLenum, const void *,
- GLbitfield, GLuint, GLsizei, GLenum, GLuint, GLfloat);
- void (QOPENGLF_APIENTRYP PathParameterfNV)(GLuint, GLenum, GLfloat);
- void (QOPENGLF_APIENTRYP PathStencilDepthOffsetNV)(GLfloat, GLfloat);
- void (QOPENGLF_APIENTRYP StencilFillPathNV)(GLuint, GLenum, GLuint);
- void (QOPENGLF_APIENTRYP StencilStrokePathNV)(GLuint, GLint, GLuint);
- void (QOPENGLF_APIENTRYP StencilFillPathInstancedNV)(GLsizei, GLenum,
- const void *, GLuint, GLenum, GLuint, GLenum, const GLfloat *);
- void (QOPENGLF_APIENTRYP StencilStrokePathInstancedNV)(GLsizei, GLenum,
- const void *, GLuint, GLint, GLuint, GLenum, const GLfloat *);
- void (QOPENGLF_APIENTRYP PathCoverDepthFuncNV)(GLenum);
- void (QOPENGLF_APIENTRYP CoverFillPathInstancedNV)(GLsizei, GLenum,
- const void *, GLuint, GLenum, GLenum, const GLfloat *);
- void (QOPENGLF_APIENTRYP CoverStrokePathInstancedNV)(GLsizei, GLenum,
- const void *, GLuint, GLenum, GLenum, const GLfloat *);
- void (QOPENGLF_APIENTRYP GetPathParameterfvNV)(GLuint, GLenum, GLfloat *);
- void (QOPENGLF_APIENTRYP GetPathMetricsNV)(GLbitfield, GLsizei, GLenum,
- const void *, GLuint, GLsizei, GLfloat *);
- void (QOPENGLF_APIENTRYP GetPathMetricRangeNV)(GLbitfield, GLuint, GLsizei,
- GLsizei, GLfloat *);
- void (QOPENGLF_APIENTRYP GetPathSpacingNV)(GLenum, GLsizei, GLenum,
- const void *, GLuint, GLfloat, GLfloat, GLenum, GLfloat *);
- void (QOPENGLF_APIENTRYP BindVertexArrayOES) (GLuint array);
- void (QOPENGLF_APIENTRYP DeleteVertexArraysOES) (GLsizei n, const GLuint *arrays);
- void (QOPENGLF_APIENTRYP GenVertexArraysOES) (GLsizei n, GLuint *arrays);
- GLboolean (QOPENGLF_APIENTRYP IsVertexArrayOES) (GLuint array);
-#endif
-};
-
-class Qt3DSOpenGLExtensions : public QAbstractOpenGLExtension
-{
-public:
- Qt3DSOpenGLExtensions();
-
- bool initializeOpenGLFunctions() override;
-
- void glBlendBarrierNV();
- GLenum glPathGlyphIndexArrayNV(GLuint firstPathName, GLenum fontTarget,
- const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex,
- GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
- GLenum glPathGlyphIndexRangeNV(GLenum fontTarget, const void *fontName,
- GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale,
- GLuint baseAndCount[2]);
-
-protected:
- Q_DECLARE_PRIVATE(Qt3DSOpenGLExtensions)
-};
-
-inline void Qt3DSOpenGLExtensions::glBlendBarrierNV()
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->BlendBarrierNV();
-}
-
-inline GLenum Qt3DSOpenGLExtensions::glPathGlyphIndexArrayNV(
- GLuint firstPathName, GLenum fontTarget, const void *fontName,
- GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs,
- GLuint pathParameterTemplate, GLfloat emScale)
-{
- Q_D(Qt3DSOpenGLExtensions);
- return d->PathGlyphIndexArrayNV(firstPathName, fontTarget, fontName,
- fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale);
-}
-
-inline GLenum Qt3DSOpenGLExtensions::glPathGlyphIndexRangeNV(GLenum fontTarget,
- const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate,
- GLfloat emScale, GLuint baseAndCount[2])
-{
- Q_D(Qt3DSOpenGLExtensions);
- return d->PathGlyphIndexRangeNV(fontTarget, fontName, fontStyle,
- pathParameterTemplate, emScale, baseAndCount);
-}
-
-#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2_ANGLE)
-class Qt3DSOpenGLES2Extensions : public Qt3DSOpenGLExtensions
-{
-public:
- Qt3DSOpenGLES2Extensions();
-
- // tesselation shader
- void glPatchParameteriEXT(GLenum pname, GLint value);
-
- // timer
- void glQueryCounterEXT(GLuint id, GLenum target);
- void glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params);
-
- // nv paths
-
- GLuint glGenPathsNV(GLsizei range);
- void glDeletePathsNV(GLuint path, GLsizei range);
- void glPathCommandsNV(GLuint path, GLsizei numCommands,
- const GLubyte *commands, GLsizei numCoords, GLenum coordType,
- const void *coords);
- void glPathGlyphsNV(GLuint firstPathName, GLenum fontTarget,
- const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs,
- GLenum type, const void *charcodes, GLenum handleMissingGlyphs,
- GLuint pathParameterTemplate, GLfloat emScale);
- void glPathGlyphRangeNV(GLuint firstPathName, GLenum fontTarget,
- const void *fontName, GLbitfield fontStyle, GLuint firstGlyph,
- GLsizei numGlyphs, GLenum handleMissingGlyphs,
- GLuint pathParameterTemplate, GLfloat emScale);
- void glPathParameterfNV(GLuint path, GLenum pname, GLfloat value);
- void glPathStencilDepthOffsetNV(GLfloat factor, GLfloat units);
- void glStencilFillPathNV(GLuint path, GLenum fillMode, GLuint mask);
- void glStencilStrokePathNV(GLuint path, GLint reference, GLuint mask);
- void glStencilFillPathInstancedNV(GLsizei numPaths, GLenum pathNameType,
- const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask,
- GLenum transformType, const GLfloat *transformValues);
- void glStencilStrokePathInstancedNV(GLsizei numPaths, GLenum pathNameType,
- const void *paths, GLuint pathBase, GLint reference, GLuint mask,
- GLenum transformType, const GLfloat *transformValues);
- void glPathCoverDepthFuncNV(GLenum func);
- void glCoverFillPathInstancedNV(GLsizei numPaths, GLenum pathNameType,
- const void *paths, GLuint pathBase, GLenum coverMode,
- GLenum transformType, const GLfloat *transformValues);
- void glCoverStrokePathInstancedNV(GLsizei numPaths, GLenum pathNameType,
- const void *paths, GLuint pathBase, GLenum coverMode,
- GLenum transformType, const GLfloat *transformValues);
- void glGetPathParameterfvNV(GLuint path, GLenum pname, GLfloat *value);
- void glGetPathMetricsNV(GLbitfield metricQueryMask, GLsizei numPaths,
- GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride,
- GLfloat *metrics);
- void glGetPathMetricRangeNV(GLbitfield metricQueryMask,
- GLuint firstPathName, GLsizei numPaths, GLsizei stride,
- GLfloat *metrics);
- void glGetPathSpacingNV(GLenum pathListMode, GLsizei numPaths,
- GLenum pathNameType, const void *paths, GLuint pathBase,
- GLfloat advanceScale, GLfloat kerningScale, GLenum transformType,
- GLfloat *returnedSpacing);
- void glBindVertexArrayOES(GLuint array);
- void glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays);
- void glGenVertexArraysOES(GLsizei n, GLuint *arrays);
- GLboolean glIsVertexArrayOES(GLuint array);
-
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
-};
-
-inline void Qt3DSOpenGLES2Extensions::glPatchParameteriEXT(GLenum pname,
- GLint value)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PatchParameteriEXT(pname, value);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glQueryCounterEXT(GLuint id,
- GLenum target)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->QueryCounterEXT(id, target);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glGetQueryObjectui64vEXT(GLuint id,
- GLenum pname, GLuint64 *params)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->GetQueryObjectui64vEXT(id, pname, params);
-}
-
-inline GLuint Qt3DSOpenGLES2Extensions::glGenPathsNV(GLsizei range)
-{
- Q_D(Qt3DSOpenGLExtensions);
- return d->GenPathsNV(range);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glDeletePathsNV(GLuint path,
- GLsizei range)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->DeletePathsNV(path, range);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glPathCommandsNV(GLuint path,
- GLsizei numCommands, const GLubyte *commands, GLsizei numCoords,
- GLenum coordType, const void *coords)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PathCommandsNV(path, numCommands, commands, numCoords, coordType,
- coords);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glPathGlyphsNV(GLuint firstPathName,
- GLenum fontTarget, const void *fontName, GLbitfield fontStyle,
- GLsizei numGlyphs, GLenum type, const void *charcodes,
- GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PathGlyphsNV(firstPathName, fontTarget, fontName, fontStyle, numGlyphs,
- type, charcodes, handleMissingGlyphs, pathParameterTemplate, emScale);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glPathGlyphRangeNV(GLuint firstPathName,
- GLenum fontTarget, const void *fontName, GLbitfield fontStyle,
- GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs,
- GLuint pathParameterTemplate, GLfloat emScale)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PathGlyphRangeNV(firstPathName, fontTarget, fontName, fontStyle,
- firstGlyph, numGlyphs, handleMissingGlyphs, pathParameterTemplate,
- emScale);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glPathParameterfNV(GLuint path,
- GLenum pname, GLfloat value)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PathParameterfNV(path, pname, value);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glPathStencilDepthOffsetNV(GLfloat factor,
- GLfloat units)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PathStencilDepthOffsetNV(factor, units);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glStencilFillPathNV(GLuint path,
- GLenum fillMode, GLuint mask)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->StencilFillPathNV(path, fillMode, mask);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glStencilStrokePathNV(GLuint path,
- GLint reference, GLuint mask)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->StencilStrokePathNV(path, reference, mask);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glStencilFillPathInstancedNV(
- GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase,
- GLenum fillMode, GLuint mask, GLenum transformType,
- const GLfloat *transformValues)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->StencilFillPathInstancedNV(numPaths, pathNameType, paths, pathBase,
- fillMode, mask, transformType, transformValues);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glStencilStrokePathInstancedNV(
- GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase,
- GLint reference, GLuint mask, GLenum transformType,
- const GLfloat *transformValues)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->StencilStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase,
- reference, mask, transformType, transformValues);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glPathCoverDepthFuncNV(GLenum func)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->PathCoverDepthFuncNV(func);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glCoverFillPathInstancedNV(
- GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase,
- GLenum coverMode, GLenum transformType, const GLfloat *transformValues)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->CoverFillPathInstancedNV(numPaths, pathNameType, paths, pathBase,
- coverMode, transformType, transformValues);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glCoverStrokePathInstancedNV(
- GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase,
- GLenum coverMode, GLenum transformType, const GLfloat *transformValues)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->CoverStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase,
- coverMode, transformType, transformValues);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glGetPathParameterfvNV(GLuint path,
- GLenum pname, GLfloat *value)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->GetPathParameterfvNV(path, pname, value);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glGetPathMetricsNV(
- GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType,
- const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->GetPathMetricsNV(metricQueryMask, numPaths, pathNameType, paths,
- pathBase, stride, metrics);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glGetPathMetricRangeNV(
- GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths,
- GLsizei stride, GLfloat *metrics)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->GetPathMetricRangeNV(metricQueryMask, firstPathName, numPaths, stride,
- metrics);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glGetPathSpacingNV(GLenum pathListMode,
- GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase,
- GLfloat advanceScale, GLfloat kerningScale, GLenum transformType,
- GLfloat *returnedSpacing)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->GetPathSpacingNV(pathListMode, numPaths, pathNameType, paths, pathBase,
- advanceScale, kerningScale, transformType, returnedSpacing);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glBindVertexArrayOES(GLuint array)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->BindVertexArrayOES(array);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->DeleteVertexArraysOES(n, arrays);
-}
-
-inline void Qt3DSOpenGLES2Extensions::glGenVertexArraysOES(GLsizei n, GLuint *arrays)
-{
- Q_D(Qt3DSOpenGLExtensions);
- d->GenVertexArraysOES(n, arrays);
-}
-
-inline GLboolean Qt3DSOpenGLES2Extensions::glIsVertexArrayOES(GLuint array)
-{
- Q_D(Qt3DSOpenGLExtensions);
- return d->IsVertexArrayOES(array);
-}
-
-#endif // QT_OPENGL_ES
-
-#endif // QT3DSOPENGLEXTENSIONS_H
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLPrefix.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLPrefix.h
deleted file mode 100644
index 0e6dc6d4..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLPrefix.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DSOPENGLPREFIX_H
-#define QT3DSOPENGLPREFIX_H
-
-#include <QtGui/qtguiglobal.h>
-#if defined(QT_OPENGL_ES)
-#define GL_GLEXT_PROTOTYPES
-#if defined(QT_OPENGL_ES_3_2)
-#include <GLES3/gl32.h>
-#else
-#include <GLES2/gl2.h>
-#include <GLES3/gl3.h>
-#endif
-
-// Adding this to ensure that platform version of gl2ext.h is included
-// before Qt's qopengles2ext.h which is missing symbols we need
-#include <GLES2/gl2ext.h>
-#endif
-
-#endif // QT3DSOPENGLPREFIX_H
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLTokens.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLTokens.h
deleted file mode 100644
index 882e2761..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLTokens.h
+++ /dev/null
@@ -1,408 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DSOPENGLTOKENS_H
-#define QT3DSOPENGLTOKENS_H
-
-/**
- * This is our general internal to GL type conversion routines
- * Add defines which are not in standard GL(ext) header but in GL2(ext)
- * The define are the same with different names
- * Expectation is the NVIDIA defines (need for compile)
- */
-#ifndef GL_NVIDIA_PLATFORM_BINARY_NV
-#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B
-#endif
-#ifndef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
-#endif
-
-#if defined(__APPLE__) || defined(ANDROID) || defined(__INTEGRITY)
-#ifndef GL_DEPTH_COMPONENT24
-#define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
-#endif
-#ifndef GL_DEPTH_COMPONENT32
-#define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES
-#endif
-
-/**
-_* tessellation_shader defines
- */
-#ifndef GL_TESS_EVALUATION_SHADER
-#define GL_TESS_EVALUATION_SHADER GL_TESS_EVALUATION_SHADER_EXT
-#endif
-#ifndef GL_TESS_CONTROL_SHADER
-#define GL_TESS_CONTROL_SHADER GL_TESS_CONTROL_SHADER_EXT
-#endif
-#ifndef GL_PATCHES
-#define GL_PATCHES GL_PATCHES_EXT
-#endif
-#ifndef GL_PATCH_VERTICES
-#define GL_PATCH_VERTICES GL_PATCH_VERTICES_EXT
-#endif
-#ifndef GL_TESS_CONTROL_SHADER_BIT
-#define GL_TESS_CONTROL_SHADER_BIT GL_TESS_CONTROL_SHADER_BIT_EXT
-#endif
-#ifndef GL_TESS_EVALUATION_SHADER_BIT
-#define GL_TESS_EVALUATION_SHADER_BIT GL_TESS_EVALUATION_SHADER_BIT_EXT
-#endif
-#ifndef GL_VERTEX_SHADER_BIT
-#define GL_VERTEX_SHADER_BIT GL_VERTEX_SHADER_BIT_EXT
-#endif
-#ifndef GL_FRAGMENT_SHADER_BIT
-#define GL_FRAGMENT_SHADER_BIT GL_FRAGMENT_SHADER_BIT_EXT
-#endif
-#ifndef GL_GEOMETRY_SHADER_BIT
-#define GL_GEOMETRY_SHADER_BIT GL_GEOMETRY_SHADER_BIT_EXT
-#endif
-
-
-/**
- * sample shading extension
- */
-#ifndef GL_SAMPLE_SHADING
-#define GL_SAMPLE_SHADING GL_SAMPLE_SHADING_OES
-#endif
-#ifndef GL_MIN_SAMPLE_SHADING_VALUE
-#define GL_MIN_SAMPLE_SHADING_VALUE GL_MIN_SAMPLE_SHADING_VALUE_OES
-#endif
-
-/**
- * Timer query extension
- */
-#ifndef GL_TIME_ELAPSED
-#define GL_TIME_ELAPSED GL_TIME_ELAPSED_EXT
-#endif
-#ifndef GL_TIMESTAMP
-#define GL_TIMESTAMP GL_TIMESTAMP_EXT
-#endif
-
-/**
- * compute shader
- */
-#ifndef GL_IMAGE_2D
-#define GL_IMAGE_2D 0x904D
-#endif
-
-/**
- * texture formats ( make build happy )
- */
-#ifndef GL_R16
-#define GL_R16 0x822A
-#endif
-
-#endif // __APPLE__ || ANDROID || __INTEGRITY
-
-#if defined(__APPLE__) || defined(ANDROID)
-
-#ifndef GL_NV_blend_equation_advanced
-#define GL_NV_blend_equation_advanced 1
-#define GL_BLEND_OVERLAP_NV 0x9281
-#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280
-#define GL_BLUE_NV 0x1905
-#define GL_COLORBURN_NV 0x929A
-#define GL_COLORDODGE_NV 0x9299
-#define GL_CONJOINT_NV 0x9284
-#define GL_CONTRAST_NV 0x92A1
-#define GL_DARKEN_NV 0x9297
-#define GL_DIFFERENCE_NV 0x929E
-#define GL_DISJOINT_NV 0x9283
-#define GL_DST_ATOP_NV 0x928F
-#define GL_DST_IN_NV 0x928B
-#define GL_DST_NV 0x9287
-#define GL_DST_OUT_NV 0x928D
-#define GL_DST_OVER_NV 0x9289
-#define GL_EXCLUSION_NV 0x92A0
-#define GL_GREEN_NV 0x1904
-#define GL_HARDLIGHT_NV 0x929B
-#define GL_HARDMIX_NV 0x92A9
-#define GL_HSL_COLOR_NV 0x92AF
-#define GL_HSL_HUE_NV 0x92AD
-#define GL_HSL_LUMINOSITY_NV 0x92B0
-#define GL_HSL_SATURATION_NV 0x92AE
-#define GL_INVERT_OVG_NV 0x92B4
-#define GL_INVERT_RGB_NV 0x92A3
-#define GL_LIGHTEN_NV 0x9298
-#define GL_LINEARBURN_NV 0x92A5
-#define GL_LINEARDODGE_NV 0x92A4
-#define GL_LINEARLIGHT_NV 0x92A7
-#define GL_MINUS_CLAMPED_NV 0x92B3
-#define GL_MINUS_NV 0x929F
-#define GL_MULTIPLY_NV 0x9294
-#define GL_OVERLAY_NV 0x9296
-#define GL_PINLIGHT_NV 0x92A8
-#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2
-#define GL_PLUS_CLAMPED_NV 0x92B1
-#define GL_PLUS_DARKER_NV 0x9292
-#define GL_PLUS_NV 0x9291
-#define GL_RED_NV 0x1903
-#define GL_SCREEN_NV 0x9295
-#define GL_SOFTLIGHT_NV 0x929C
-#define GL_SRC_ATOP_NV 0x928E
-#define GL_SRC_IN_NV 0x928A
-#define GL_SRC_NV 0x9286
-#define GL_SRC_OUT_NV 0x928C
-#define GL_SRC_OVER_NV 0x9288
-#define GL_UNCORRELATED_NV 0x9282
-#define GL_VIVIDLIGHT_NV 0x92A6
-#define GL_XOR_NV 0x1506
-#endif /* GL_NV_blend_equation_advanced */
-
-#ifndef GL_SHADER_STORAGE_BUFFER
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#endif
-
-#ifndef GL_ATOMIC_COUNTER_BUFFER
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#endif
-
-#ifndef GL_ALL_BARRIER_BITS
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-#endif
-
-#ifndef GL_SHADER_STORAGE_BARRIER_BIT
-#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
-#endif
-
-#ifndef GL_UNSIGNED_INT_ATOMIC_COUNTER
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#endif
-
-#ifndef GL_UNSIGNED_INT_IMAGE_2D
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#endif
-
-
-
-#ifndef GL_NV_path_rendering
-#define GL_NV_path_rendering 1
-#define GL_PATH_FORMAT_SVG_NV 0x9070
-#define GL_PATH_FORMAT_PS_NV 0x9071
-#define GL_STANDARD_FONT_NAME_NV 0x9072
-#define GL_SYSTEM_FONT_NAME_NV 0x9073
-#define GL_FILE_NAME_NV 0x9074
-#define GL_PATH_STROKE_WIDTH_NV 0x9075
-#define GL_PATH_END_CAPS_NV 0x9076
-#define GL_PATH_INITIAL_END_CAP_NV 0x9077
-#define GL_PATH_TERMINAL_END_CAP_NV 0x9078
-#define GL_PATH_JOIN_STYLE_NV 0x9079
-#define GL_PATH_MITER_LIMIT_NV 0x907A
-#define GL_PATH_DASH_CAPS_NV 0x907B
-#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C
-#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D
-#define GL_PATH_DASH_OFFSET_NV 0x907E
-#define GL_PATH_CLIENT_LENGTH_NV 0x907F
-#define GL_PATH_FILL_MODE_NV 0x9080
-#define GL_PATH_FILL_MASK_NV 0x9081
-#define GL_PATH_FILL_COVER_MODE_NV 0x9082
-#define GL_PATH_STROKE_COVER_MODE_NV 0x9083
-#define GL_PATH_STROKE_MASK_NV 0x9084
-#define GL_COUNT_UP_NV 0x9088
-#define GL_COUNT_DOWN_NV 0x9089
-#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A
-#define GL_CONVEX_HULL_NV 0x908B
-#define GL_BOUNDING_BOX_NV 0x908D
-#define GL_TRANSLATE_X_NV 0x908E
-#define GL_TRANSLATE_Y_NV 0x908F
-#define GL_TRANSLATE_2D_NV 0x9090
-#define GL_TRANSLATE_3D_NV 0x9091
-#define GL_AFFINE_2D_NV 0x9092
-#define GL_AFFINE_3D_NV 0x9094
-#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
-#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
-#define GL_UTF8_NV 0x909A
-#define GL_UTF16_NV 0x909B
-#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
-#define GL_PATH_COMMAND_COUNT_NV 0x909D
-#define GL_PATH_COORD_COUNT_NV 0x909E
-#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F
-#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0
-#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1
-#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2
-#define GL_SQUARE_NV 0x90A3
-#define GL_ROUND_NV 0x90A4
-#define GL_TRIANGULAR_NV 0x90A5
-#define GL_BEVEL_NV 0x90A6
-#define GL_MITER_REVERT_NV 0x90A7
-#define GL_MITER_TRUNCATE_NV 0x90A8
-#define GL_SKIP_MISSING_GLYPH_NV 0x90A9
-#define GL_USE_MISSING_GLYPH_NV 0x90AA
-#define GL_PATH_ERROR_POSITION_NV 0x90AB
-#define GL_PATH_FOG_GEN_MODE_NV 0x90AC
-#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD
-#define GL_ADJACENT_PAIRS_NV 0x90AE
-#define GL_FIRST_TO_REST_NV 0x90AF
-#define GL_PATH_GEN_MODE_NV 0x90B0
-#define GL_PATH_GEN_COEFF_NV 0x90B1
-#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2
-#define GL_PATH_GEN_COMPONENTS_NV 0x90B3
-#define GL_PATH_STENCIL_FUNC_NV 0x90B7
-#define GL_PATH_STENCIL_REF_NV 0x90B8
-#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9
-#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
-#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
-#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF
-#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4
-#define GL_MOVE_TO_RESETS_NV 0x90B5
-#define GL_MOVE_TO_CONTINUES_NV 0x90B6
-#define GL_CLOSE_PATH_NV 0x00
-#define GL_MOVE_TO_NV 0x02
-#define GL_RELATIVE_MOVE_TO_NV 0x03
-#define GL_LINE_TO_NV 0x04
-#define GL_RELATIVE_LINE_TO_NV 0x05
-#define GL_HORIZONTAL_LINE_TO_NV 0x06
-#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
-#define GL_VERTICAL_LINE_TO_NV 0x08
-#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09
-#define GL_QUADRATIC_CURVE_TO_NV 0x0A
-#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
-#define GL_CUBIC_CURVE_TO_NV 0x0C
-#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D
-#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E
-#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
-#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10
-#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
-#define GL_SMALL_CCW_ARC_TO_NV 0x12
-#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13
-#define GL_SMALL_CW_ARC_TO_NV 0x14
-#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15
-#define GL_LARGE_CCW_ARC_TO_NV 0x16
-#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17
-#define GL_LARGE_CW_ARC_TO_NV 0x18
-#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19
-#define GL_RESTART_PATH_NV 0xF0
-#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2
-#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4
-#define GL_RECT_NV 0xF6
-#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8
-#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA
-#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC
-#define GL_ARC_TO_NV 0xFE
-#define GL_RELATIVE_ARC_TO_NV 0xFF
-#define GL_BOLD_BIT_NV 0x01
-#define GL_ITALIC_BIT_NV 0x02
-#define GL_GLYPH_WIDTH_BIT_NV 0x01
-#define GL_GLYPH_HEIGHT_BIT_NV 0x02
-#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
-#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
-#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
-#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
-#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
-#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
-#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100
-#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000
-#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000
-#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000
-#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000
-#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000
-#define GL_FONT_ASCENDER_BIT_NV 0x00200000
-#define GL_FONT_DESCENDER_BIT_NV 0x00400000
-#define GL_FONT_HEIGHT_BIT_NV 0x00800000
-#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000
-#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000
-#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000
-#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000
-#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_ROUNDED_RECT_NV 0xE8
-#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9
-#define GL_ROUNDED_RECT2_NV 0xEA
-#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB
-#define GL_ROUNDED_RECT4_NV 0xEC
-#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED
-#define GL_ROUNDED_RECT8_NV 0xEE
-#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF
-#define GL_RELATIVE_RECT_NV 0xF7
-#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368
-#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369
-#define GL_FONT_UNAVAILABLE_NV 0x936A
-#define GL_FONT_UNINTELLIGIBLE_NV 0x936B
-#define GL_CONIC_CURVE_TO_NV 0x1A
-#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B
-#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000
-#define GL_STANDARD_FONT_FORMAT_NV 0x936C
-#define GL_2_BYTES_NV 0x1407
-#define GL_3_BYTES_NV 0x1408
-#define GL_4_BYTES_NV 0x1409
-#define GL_EYE_LINEAR_NV 0x2400
-#define GL_OBJECT_LINEAR_NV 0x2401
-#define GL_CONSTANT_NV 0x8576
-#define GL_PATH_PROJECTION_NV 0x1701
-#define GL_PATH_MODELVIEW_NV 0x1700
-#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3
-#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6
-#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36
-#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3
-#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4
-#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7
-#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38
-#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4
-#define GL_FRAGMENT_INPUT_NV 0x936D
-#endif /* GL_NV_path_rendering */
-
-#ifndef GL_SHADER_STORAGE_BLOCK
-#define GL_SHADER_STORAGE_BLOCK 0x92E6
-#endif
-
-#ifndef GL_ACTIVE_RESOURCES
-#define GL_ACTIVE_RESOURCES 0x92F5
-#endif
-
-#ifndef GL_BUFFER_BINDING
-#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
-#define GL_BUFFER_BINDING 0x9302
-#define GL_BUFFER_DATA_SIZE 0x9303
-#define GL_NUM_ACTIVE_VARIABLES 0x9304
-#define GL_ACTIVE_VARIABLES 0x9305
-#endif
-
-#ifndef GL_UNIFORM
-#define GL_UNIFORM 0x92E1
-#endif
-
-#ifndef GL_COMPUTE_SHADER
-#define GL_COMPUTE_SHADER 0x91B9
-#endif
-
-#endif // __APPLE__ || ANDROID
-
-#endif // QT3DSOPENGLTOKENS_H
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLUtil.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLUtil.h
deleted file mode 100644
index 32f7dad7..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSOpenGLUtil.h
+++ /dev/null
@@ -1,2201 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DSOPENGLUTIL_H
-#define QT3DSOPENGLUTIL_H
-
-#include "render/backends/gl/Qt3DSOpenGLPrefix.h"
-#include "render/backends/gl/Qt3DSOpenGLTokens.h"
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLExtraFunctions>
-
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSVec4.h"
-#include "foundation/Qt3DSFoundation.h"
-
-// The actual binding to the hardware the does some minor conversions between gles and
-// the nv render enumeration types
-namespace qt3ds {
-namespace render {
-
-#ifndef GL_TEXTURE_2D_MULTISAMPLE
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#endif
-
-#ifndef GL_IMAGE_2D
-#define GL_IMAGE_2D 0x904D
-#endif
-
-#ifndef GL_MULTISAMPLE_EXT
-#define GL_MULTISAMPLE_EXT 0x809D
-#endif
-
-#ifndef GL_COLOR_ATTACHMENT1
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#endif
-
-#ifndef GL_RED
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#endif
-
-#ifndef GL_PATCHES
-#define GL_PATCHES 0x000E
-#endif
-
-#ifndef GL_READ_ONLY
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#endif
-
-#ifndef GL_SHADER_STORAGE_BUFFER
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#endif
-
-#ifndef GL_ATOMIC_COUNTER_BUFFER
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#endif
-
-#ifndef GL_DRAW_INDIRECT_BUFFER
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#endif
-
-#ifndef GL_VERTEX_SHADER_BIT
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#endif
-
-#ifndef GL_FRAGMENT_SHADER_BIT
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#endif
-
-#ifndef GL_GEOMETRY_SHADER_BIT
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#endif
-
-#ifndef GL_TESS_CONTROL_SHADER_BIT
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#endif
-
-#ifndef GL_TESS_EVALUATION_SHADER_BIT
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#endif
-
-#ifndef GL_ETC1_RGB8_OES
-#define GL_ETC1_RGB8_OES 0x8D64
-#endif
-
-#ifndef GL_COMPRESSED_RED_RGTC1
-#define GL_COMPRESSED_RED_RGTC1 0x8DBB
-#endif
-
-#ifndef GL_COMPRESSED_SIGNED_RED_RGTC1
-#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
-#endif
-
-#ifndef GL_COMPRESSED_RG_RGTC2
-#define GL_COMPRESSED_RG_RGTC2 0x8DBD
-#endif
-
-#ifndef GL_COMPRESSED_SIGNED_RG_RGTC2
-#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
-#endif
-
-#ifndef GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-#endif
-
-#ifndef GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#endif
-
-#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#endif
-
-#ifndef GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#endif
-
-#ifndef GL_COMPRESSED_RGB8_ETC2
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#endif
-
-#ifndef GL_COMPRESSED_SRGB8_ETC2
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#endif
-
-#ifndef GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#endif
-
-#ifndef GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#endif
-
-#ifndef GL_COMPRESSED_RGBA8_ETC2_EAC
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#endif
-
-#ifndef GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-#endif
-
-#ifndef GL_COMPRESSED_R11_EAC
-#define GL_COMPRESSED_R11_EAC 0x9270
-#endif
-
-#ifndef GL_COMPRESSED_SIGNED_R11_EAC
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#endif
-
-#ifndef GL_COMPRESSED_RG11_EAC
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#endif
-
-#ifndef GL_COMPRESSED_SIGNED_RG11_EAC
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#endif
-
-#define QT3DS_RENDER_ITERATE_QT3DS_GL_COLOR_FUNC \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ZERO, Zero) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE, One) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_SRC_COLOR, SrcColor) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE_MINUS_SRC_COLOR, OneMinusSrcColor) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_DST_COLOR, DstColor) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE_MINUS_DST_COLOR, OneMinusDstColor) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_SRC_ALPHA, SrcAlpha) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE_MINUS_SRC_ALPHA, OneMinusSrcAlpha) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_DST_ALPHA, DstAlpha) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE_MINUS_DST_ALPHA, OneMinusDstAlpha) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_CONSTANT_COLOR, ConstantColor) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE_MINUS_CONSTANT_COLOR, OneMinusConstantColor) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_CONSTANT_ALPHA, ConstantAlpha) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(GL_ONE_MINUS_CONSTANT_ALPHA, OneMinusConstantAlpha) \
- QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY(GL_SRC_ALPHA_SATURATE, SrcAlphaSaturate)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_RENDER_FACE \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE(GL_FRONT, Front) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE(GL_BACK, Back) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE(GL_FRONT_AND_BACK, FrontAndBack)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_RENDER_WINDING \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_WINDING(GL_CW, Clockwise) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_WINDING(GL_CCW, CounterClockwise)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_BOOL_OP \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_NEVER, Never) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_LESS, Less) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_EQUAL, Equal) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_LEQUAL, LessThanOrEqual) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_GREATER, Greater) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_NOTEQUAL, NotEqual) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_GEQUAL, GreaterThanOrEqual) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(GL_ALWAYS, AlwaysTrue)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_HINT \
- QT3DS_RENDER_HANDLE_GL_QT3DS_HINT(GL_FASTEST, Fastest) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_HINT(GL_NICEST, Nicest) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_HINT(GL_DONT_CARE, Unspecified)
-
-#define QT3DS_RENDER_ITERATE_QT3DS_GL_STENCIL_OP \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_KEEP, Keep) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_ZERO, Zero) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_REPLACE, Replace) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_INCR, Increment) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_INCR_WRAP, IncrementWrap) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_DECR, Decrement) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_DECR_WRAP, DecrementWrap) \
- QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(GL_INVERT, Invert)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_BUFFER_COMPONENT_TYPES \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(GL_UNSIGNED_BYTE, QT3DSU8) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(GL_BYTE, QT3DSI8) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(GL_UNSIGNED_SHORT, QT3DSU16) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(GL_SHORT, QT3DSI16) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(GL_UNSIGNED_INT, QT3DSU32) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE_ALIAS(GL_INT, QT3DSI32) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(GL_FLOAT, QT3DSF32)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_BUFFER_USAGE_TYPE \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BUFFER_USAGE_TYPE(GL_STATIC_DRAW, Static) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_BUFFER_USAGE_TYPE(GL_DYNAMIC_DRAW, Dynamic)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_SCALE_OP \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP(GL_NEAREST, Nearest) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP(GL_LINEAR, Linear) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(GL_NEAREST_MIPMAP_NEAREST, NearestMipmapNearest) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(GL_LINEAR_MIPMAP_NEAREST, LinearMipmapNearest) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(GL_NEAREST_MIPMAP_LINEAR, NearestMipmapLinear) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(GL_LINEAR_MIPMAP_LINEAR, LinearMipmapLinear)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_WRAP_OP \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP(GL_CLAMP_TO_EDGE, ClampToEdge) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP(GL_MIRRORED_REPEAT, MirroredRepeat) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP(GL_REPEAT, Repeat)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_SHADER_UNIFORM_TYPES \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_FLOAT, QT3DSF32) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_FLOAT_VEC2, QT3DSVec2) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_FLOAT_VEC3, QT3DSVec3) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_FLOAT_VEC4, QT3DSVec4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_INT, QT3DSI32) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_INT_VEC2, QT3DSI32_2) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_INT_VEC3, QT3DSI32_3) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_INT_VEC4, QT3DSI32_4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_BOOL, QT3DSRenderBool) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_BOOL_VEC2, bool_2) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_BOOL_VEC3, bool_3) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_BOOL_VEC4, bool_4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_UNSIGNED_INT, QT3DSU32) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_UNSIGNED_INT_VEC2, QT3DSU32_2) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_UNSIGNED_INT_VEC3, QT3DSU32_3) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_UNSIGNED_INT_VEC4, QT3DSU32_4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_FLOAT_MAT3, QT3DSMat33) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_FLOAT_MAT4, QT3DSMat44) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_SAMPLER_2D, NVRenderTexture2DPtr) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_SAMPLER_2D_ARRAY, NVRenderTexture2DArrayPtr) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_SAMPLER_CUBE, NVRenderTextureCubePtr) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(GL_IMAGE_2D, NVRenderImage2DPtr)
-// cube Sampler and mat22 unsupported
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_SHADER_ATTRIB_TYPES \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT, QT3DSF32, 1) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT_VEC2, QT3DSF32, 2) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT_VEC3, QT3DSF32, 3) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT_VEC4, QT3DSF32, 4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT_MAT2, QT3DSF32, 4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT_MAT3, QT3DSF32, 9) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(GL_FLOAT_MAT4, QT3DSF32, 16)
-#if defined(GL_DEPTH_COMPONENT32)
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_FORMATS \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_RGBA4, RGBA4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_RGB565, RGB565) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_RGB5_A1, RGBA5551) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_DEPTH_COMPONENT16, Depth16) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_DEPTH_COMPONENT24, Depth24) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_DEPTH_COMPONENT32, Depth32) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_STENCIL_INDEX8, StencilIndex8)
-#else
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_FORMATS \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_RGBA4, RGBA4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_RGB565, RGB565) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_RGB5_A1, RGBA5551) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_DEPTH_COMPONENT16, Depth16) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_DEPTH_COMPONENT24, Depth24) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(GL_STENCIL_INDEX8, StencilIndex8)
-#endif
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_FRAMEBUFFER_ATTACHMENTS \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color0, 0) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color1, 1) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color2, 2) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color3, 3) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color4, 4) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color5, 5) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color6, 6) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(Color7, 7) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT(GL_DEPTH_ATTACHMENT, Depth) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT(GL_STENCIL_ATTACHMENT, Stencil) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT(GL_DEPTH_STENCIL_ATTACHMENT, DepthStencil)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_CLEAR_FLAGS \
- QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS(GL_COLOR_BUFFER_BIT, Color) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS(GL_DEPTH_BUFFER_BIT, Depth) \
- QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS(GL_STENCIL_BUFFER_BIT, Stencil)
-
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_COVERAGE_FORMATS
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_FRAMEBUFFER_COVERAGE_ATTACHMENTS
-#define QT3DS_RENDER_ITERATE_GL_QT3DS_CLEAR_COVERAGE_FLAGS
-
- static bool IsGlEsContext(NVRenderContextType inContextType)
- {
- NVRenderContextType esContextTypes(NVRenderContextValues::GLES2
- | NVRenderContextValues::GLES3
- | NVRenderContextValues::GLES3PLUS);
-
- if ((inContextType & esContextTypes))
- return true;
-
- return false;
- }
-
- struct GLConversion
- {
- GLConversion()
- { }
-
- static const char *processGLError(GLenum error)
- {
- const char *errorString = "";
- switch (error) {
-#define stringiseError(error) \
- case error: \
- errorString = #error; \
- break
- stringiseError(GL_NO_ERROR);
- stringiseError(GL_INVALID_ENUM);
- stringiseError(GL_INVALID_VALUE);
- stringiseError(GL_INVALID_OPERATION);
- stringiseError(GL_INVALID_FRAMEBUFFER_OPERATION);
- stringiseError(GL_OUT_OF_MEMORY);
-#undef stringiseError
- default:
- errorString = "Unknown GL error";
- break;
- }
- return errorString;
- }
-
- static NVRenderSrcBlendFunc::Enum fromGLToSrcBlendFunc(QT3DSI32 value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(srcVal, enumVal) \
- case srcVal: \
- return NVRenderSrcBlendFunc::enumVal;
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY(srcVal, enumVal) \
- case srcVal: \
- return NVRenderSrcBlendFunc::enumVal;
- QT3DS_RENDER_ITERATE_QT3DS_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY
- default:
- QT3DS_ASSERT(false);
- return NVRenderSrcBlendFunc::Unknown;
- }
- }
-
- static GLenum fromSrcBlendFuncToGL(NVRenderSrcBlendFunc::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(srcVal, enumVal) \
- case NVRenderSrcBlendFunc::enumVal: \
- return srcVal;
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY(srcVal, enumVal) \
- case NVRenderSrcBlendFunc::enumVal: \
- return srcVal;
- QT3DS_RENDER_ITERATE_QT3DS_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY
- default:
- QT3DS_ASSERT(false);
- return 0;
- }
- }
-
- static NVRenderDstBlendFunc::Enum fromGLToDstBlendFunc(QT3DSI32 value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(srcVal, enumVal) \
- case srcVal: \
- return NVRenderDstBlendFunc::enumVal;
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY(srcVal, enumVal)
- QT3DS_RENDER_ITERATE_QT3DS_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY
- default:
- QT3DS_ASSERT(false);
- return NVRenderDstBlendFunc::Unknown;
- }
- }
-
- static GLenum fromDstBlendFuncToGL(NVRenderDstBlendFunc::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC(srcVal, enumVal) \
- case NVRenderDstBlendFunc::enumVal: \
- return srcVal;
-#define QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY(srcVal, enumVal)
- QT3DS_RENDER_ITERATE_QT3DS_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC
-#undef QT3DS_RENDER_HANDLE_GL_COLOR_FUNC_SRC_ONLY
- default:
- QT3DS_ASSERT(false);
- return 0;
- }
- }
-
- static GLenum fromBlendEquationToGL(NVRenderBlendEquation::Enum value,
- bool nvAdvancedBlendSupported,
- bool khrAdvancedBlendSupported)
- {
- switch (value) {
- case NVRenderBlendEquation::Add:
- return GL_FUNC_ADD;
- case NVRenderBlendEquation::Subtract:
- return GL_FUNC_SUBTRACT;
- case NVRenderBlendEquation::ReverseSubtract:
- return GL_FUNC_REVERSE_SUBTRACT;
- default:
- QT3DS_ASSERT(nvAdvancedBlendSupported || khrAdvancedBlendSupported);
- break;
- }
-
- if (nvAdvancedBlendSupported) {
- switch (value) {
- case NVRenderBlendEquation::Overlay:
- return GL_OVERLAY_NV;
- case NVRenderBlendEquation::ColorBurn:
- return GL_COLORBURN_NV;
- case NVRenderBlendEquation::ColorDodge:
- return GL_COLORDODGE_NV;
- default:
- break;
- }
- }
-
-#if defined(GL_KHR_blend_equation_advanced)
- if (khrAdvancedBlendSupported) {
- switch (value) {
- case NVRenderBlendEquation::Overlay:
- return GL_OVERLAY_KHR;
- case NVRenderBlendEquation::ColorBurn:
- return GL_COLORBURN_KHR;
- case NVRenderBlendEquation::ColorDodge:
- return GL_COLORDODGE_KHR;
- default:
- break;
- }
- }
-#endif
-
- QT3DS_ASSERT(false);
- return GL_FUNC_ADD;
- }
-
- static NVRenderFaces::Enum fromGLToFaces(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE(x, y) \
- case x: \
- return NVRenderFaces::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDER_FACE
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderFaces::Unknown;
- }
-
- static GLenum fromFacesToGL(NVRenderFaces::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE(x, y) \
- case NVRenderFaces::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDER_FACE
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_FACE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVReadFaces::Enum fromGLToReadFaces(GLenum value)
- {
- switch (value) {
- case GL_FRONT:
- return NVReadFaces::Front;
- case GL_BACK:
- return NVReadFaces::Back;
- case GL_COLOR_ATTACHMENT0:
- return NVReadFaces::Color0;
- case GL_COLOR_ATTACHMENT1:
- return NVReadFaces::Color1;
- case GL_COLOR_ATTACHMENT2:
- return NVReadFaces::Color2;
- case GL_COLOR_ATTACHMENT3:
- return NVReadFaces::Color3;
- case GL_COLOR_ATTACHMENT4:
- return NVReadFaces::Color4;
- case GL_COLOR_ATTACHMENT5:
- return NVReadFaces::Color5;
- case GL_COLOR_ATTACHMENT6:
- return NVReadFaces::Color6;
- case GL_COLOR_ATTACHMENT7:
- return NVReadFaces::Color7;
-
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVReadFaces::Unknown;
- }
-
- static GLenum fromReadFacesToGL(NVReadFaces::Enum value)
- {
- switch (value) {
- case NVReadFaces::Front:
- return GL_FRONT;
- case NVReadFaces::Back:
- return GL_BACK;
- case NVReadFaces::Color0:
- return GL_COLOR_ATTACHMENT0;
- case NVReadFaces::Color1:
- return GL_COLOR_ATTACHMENT1;
- case NVReadFaces::Color2:
- return GL_COLOR_ATTACHMENT2;
- case NVReadFaces::Color3:
- return GL_COLOR_ATTACHMENT3;
- case NVReadFaces::Color4:
- return GL_COLOR_ATTACHMENT4;
- case NVReadFaces::Color5:
- return GL_COLOR_ATTACHMENT5;
- case NVReadFaces::Color6:
- return GL_COLOR_ATTACHMENT6;
- case NVReadFaces::Color7:
- return GL_COLOR_ATTACHMENT7;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderWinding::Enum fromGLToWinding(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_WINDING(x, y) \
- case x: \
- return NVRenderWinding::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDER_WINDING
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_WINDING
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderWinding::Unknown;
- }
-
- static GLenum fromWindingToGL(NVRenderWinding::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_WINDING(x, y) \
- case NVRenderWinding::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDER_WINDING
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_RENDER_WINDING
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderBoolOp::Enum fromGLToBoolOp(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(x, y) \
- case x: \
- return NVRenderBoolOp::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_BOOL_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderBoolOp::Unknown;
- }
-
- static GLenum fromBoolOpToGL(NVRenderBoolOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(x, y) \
- case NVRenderBoolOp::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_BOOL_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderHint::Enum fromGLToHint(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_HINT(x, y) \
- case x: \
- return NVRenderHint::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_HINT
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_HINT
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderHint::Unknown;
- }
-
- static GLenum fromHintToGL(NVRenderHint::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_HINT(x, y) \
- case NVRenderHint::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_HINT
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_HINT
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderStencilOp::Enum fromGLToStencilOp(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(x, y) \
- case x: \
- return NVRenderStencilOp::y;
- QT3DS_RENDER_ITERATE_QT3DS_GL_STENCIL_OP
-#undef QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return NVRenderStencilOp::Unknown;
- }
-
- static GLenum fromStencilOpToGL(NVRenderStencilOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP(x, y) \
- case NVRenderStencilOp::y: \
- return x;
- QT3DS_RENDER_ITERATE_QT3DS_GL_STENCIL_OP
-#undef QT3DS_RENDER_HANDLE_QT3DS_GL_STENCIL_OP
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderComponentTypes::Enum fromGLToBufferComponentTypes(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(x, y) \
- case x: \
- return NVRenderComponentTypes::y;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE_ALIAS(x, y)
- QT3DS_RENDER_ITERATE_GL_QT3DS_BUFFER_COMPONENT_TYPES
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE_ALIAS
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderComponentTypes::Unknown;
- }
-
- static GLenum fromBufferComponentTypesToGL(NVRenderComponentTypes::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE(x, y) \
- case NVRenderComponentTypes::y: \
- return x;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE_ALIAS(x, y) \
- case NVRenderComponentTypes::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_BUFFER_COMPONENT_TYPES
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_COMPONENT_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static GLenum fromIndexBufferComponentsTypesToGL(NVRenderComponentTypes::Enum value)
- {
- switch (value) {
- case NVRenderComponentTypes::QT3DSU8:
- return GL_UNSIGNED_BYTE;
- case NVRenderComponentTypes::QT3DSU16:
- return GL_UNSIGNED_SHORT;
- case NVRenderComponentTypes::QT3DSU32:
- return GL_UNSIGNED_INT;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static GLenum fromBindBufferFlagsToGL(NVRenderBufferBindFlags flags)
- {
- QT3DSU32 value = flags;
- GLenum retval = GL_INVALID_ENUM;
- if (value & NVRenderBufferBindValues::Vertex)
- retval = GL_ARRAY_BUFFER;
- else if (value & NVRenderBufferBindValues::Index)
- retval = GL_ELEMENT_ARRAY_BUFFER;
- else if (value & NVRenderBufferBindValues::Constant)
- retval = GL_UNIFORM_BUFFER;
- else if (value & NVRenderBufferBindValues::Storage)
- retval = GL_SHADER_STORAGE_BUFFER;
- else if (value & NVRenderBufferBindValues::Atomic_Counter)
- retval = GL_ATOMIC_COUNTER_BUFFER;
- else if (value & NVRenderBufferBindValues::Draw_Indirect)
- retval = GL_DRAW_INDIRECT_BUFFER;
- else
- QT3DS_ASSERT(false);
-
- return retval;
- }
-
- static NVRenderBufferBindFlags fromGLToBindBufferFlags(GLenum value)
- {
- QT3DSU32 retval = 0;
-
- if (value == GL_ARRAY_BUFFER)
- retval |= NVRenderBufferBindValues::Vertex;
- else if (value == GL_ELEMENT_ARRAY_BUFFER)
- retval |= NVRenderBufferBindValues::Index;
- else if (value == GL_UNIFORM_BUFFER)
- retval |= NVRenderBufferBindValues::Constant;
- else if (value == GL_SHADER_STORAGE_BUFFER)
- retval |= NVRenderBufferBindValues::Storage;
- else if (value == GL_ATOMIC_COUNTER_BUFFER)
- retval |= NVRenderBufferBindValues::Atomic_Counter;
- else if (value == GL_DRAW_INDIRECT_BUFFER)
- retval |= NVRenderBufferBindValues::Draw_Indirect;
- else
- QT3DS_ASSERT(false);
-
- return NVRenderBufferBindFlags(retval);
- }
-
- static NVRenderBufferUsageType::Enum fromGLToBufferUsageType(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_BUFFER_USAGE_TYPE(x, y) \
- case x: \
- return NVRenderBufferUsageType::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_BUFFER_USAGE_TYPE
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_BUFFER_USAGE_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderBufferUsageType::Unknown;
- }
-
- static GLenum fromBufferUsageTypeToGL(NVRenderBufferUsageType::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_BUFFER_USAGE_TYPE(x, y) \
- case NVRenderBufferUsageType::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_BUFFER_USAGE_TYPE
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_BUFFER_USAGE_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static GLenum fromQueryTypeToGL(NVRenderQueryType::Enum type)
- {
- GLenum retval = GL_INVALID_ENUM;
- if (type == NVRenderQueryType::Samples)
- retval = GL_ANY_SAMPLES_PASSED;
-#if defined(GL_TIME_ELAPSED)
- else if (type == NVRenderQueryType::Timer)
- retval = GL_TIME_ELAPSED;
-#elif defined(GL_TIME_ELAPSED_EXT)
- else if (type == NVRenderQueryType::Timer)
- retval = GL_TIME_ELAPSED_EXT;
-#endif
- else
- QT3DS_ASSERT(false);
-
- return retval;
- }
-
- static GLenum fromQueryResultTypeToGL(NVRenderQueryResultType::Enum type)
- {
- GLenum retval = GL_INVALID_ENUM;
- if (type == NVRenderQueryResultType::ResultAvailable)
- retval = GL_QUERY_RESULT_AVAILABLE;
- else if (type == NVRenderQueryResultType::Result)
- retval = GL_QUERY_RESULT;
- else
- QT3DS_ASSERT(false);
-
- return retval;
- }
-
- static GLenum fromSyncTypeToGL(NVRenderSyncType::Enum type)
- {
- GLenum retval = GL_INVALID_ENUM;
- if (type == NVRenderSyncType::GpuCommandsComplete)
- retval = GL_SYNC_GPU_COMMANDS_COMPLETE;
- else
- QT3DS_ASSERT(false);
-
- return retval;
- }
-
- static NVRenderTextureFormats::Enum
- replaceDeprecatedTextureFormat(NVRenderContextType type, NVRenderTextureFormats::Enum value,
- NVRenderTextureSwizzleMode::Enum &swizzleMode)
- {
- NVRenderContextType deprecatedContextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
- NVRenderTextureFormats::Enum newValue = value;
- swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
-
- if (!(type & deprecatedContextFlags)) {
- switch (value) {
- case NVRenderTextureFormats::Luminance8:
- newValue = NVRenderTextureFormats::R8;
- swizzleMode = NVRenderTextureSwizzleMode::L8toR8;
- break;
- case NVRenderTextureFormats::LuminanceAlpha8:
- newValue = NVRenderTextureFormats::RG8;
- swizzleMode = NVRenderTextureSwizzleMode::L8A8toRG8;
- break;
- case NVRenderTextureFormats::Alpha8:
- newValue = NVRenderTextureFormats::R8;
- swizzleMode = NVRenderTextureSwizzleMode::A8toR8;
- break;
- case NVRenderTextureFormats::Luminance16:
- newValue = NVRenderTextureFormats::R16;
- swizzleMode = NVRenderTextureSwizzleMode::L16toR16;
- break;
- default:
- break;
- }
- }
-
- return newValue;
- }
-
- static void
- NVRenderConvertSwizzleModeToGL(const NVRenderTextureSwizzleMode::Enum swizzleMode,
- GLint glSwizzle[4])
- {
- switch (swizzleMode) {
- case NVRenderTextureSwizzleMode::L16toR16:
- case NVRenderTextureSwizzleMode::L8toR8:
- glSwizzle[0] = GL_RED;
- glSwizzle[1] = GL_RED;
- glSwizzle[2] = GL_RED;
- glSwizzle[3] = GL_ONE;
- break;
- case NVRenderTextureSwizzleMode::L8A8toRG8:
- glSwizzle[0] = GL_RED;
- glSwizzle[1] = GL_RED;
- glSwizzle[2] = GL_RED;
- glSwizzle[3] = GL_GREEN;
- break;
- case NVRenderTextureSwizzleMode::A8toR8:
- glSwizzle[0] = GL_ZERO;
- glSwizzle[1] = GL_ZERO;
- glSwizzle[2] = GL_ZERO;
- glSwizzle[3] = GL_RED;
- break;
- case NVRenderTextureSwizzleMode::NoSwizzle:
- default:
- glSwizzle[0] = GL_RED;
- glSwizzle[1] = GL_GREEN;
- glSwizzle[2] = GL_BLUE;
- glSwizzle[3] = GL_ALPHA;
- break;
- }
- }
-
- static bool fromUncompressedTextureFormatToGL(NVRenderContextType type,
- NVRenderTextureFormats::Enum value,
- GLenum &outFormat, GLenum &outDataType,
- GLenum &outInternalFormat)
- {
- switch (value) {
- case NVRenderTextureFormats::R8:
- if (type == NVRenderContextValues::GLES2) {
- outFormat = GL_ALPHA;
- outInternalFormat = GL_ALPHA;
- } else {
- outFormat = GL_RED;
- outInternalFormat = GL_R8;
- }
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::RG8:
- outFormat = GL_RG;
- outInternalFormat = GL_RG8;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::RGBA8:
- outFormat = GL_RGBA;
- outInternalFormat = GL_RGBA8;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::RGB8:
- outFormat = GL_RGB;
- outInternalFormat = GL_RGB8;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::RGB565:
- outFormat = GL_RGB;
- outInternalFormat = GL_RGB8;
- outDataType = GL_UNSIGNED_SHORT_5_6_5;
- return true;
- case NVRenderTextureFormats::RGBA5551:
- outFormat = GL_RGBA;
- outInternalFormat = GL_RGBA8;
- outDataType = GL_UNSIGNED_SHORT_5_5_5_1;
- return true;
- case NVRenderTextureFormats::Alpha8:
- outFormat = GL_ALPHA;
- outInternalFormat = GL_ALPHA;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::Luminance8:
- outFormat = GL_LUMINANCE;
- outInternalFormat = GL_LUMINANCE;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::LuminanceAlpha8:
- outFormat = GL_LUMINANCE_ALPHA;
- outInternalFormat = GL_LUMINANCE_ALPHA;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::Luminance16:
-#if defined(QT_OPENGL_ES)
- outFormat = GL_LUMINANCE16F_EXT;
- outInternalFormat = GL_LUMINANCE16F_EXT;
-#else
- outFormat = GL_LUMINANCE;
- outInternalFormat = GL_LUMINANCE;
-#endif
- outDataType = GL_UNSIGNED_INT;
- return true;
- default:
- break;
- }
-
- NVRenderContextType contextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
- // check extented texture formats
- if (!(type & contextFlags)) {
- switch (value) {
-#if !defined(QT_OPENGL_ES)
- case NVRenderTextureFormats::R16: {
- if (IsGlEsContext(type)) {
- outFormat = GL_RED_INTEGER;
- outInternalFormat = GL_R16UI;
- } else {
- outFormat = GL_RED;
- outInternalFormat = GL_R16;
- }
- outDataType = GL_UNSIGNED_SHORT;
- return true;
- }
-#endif
- case NVRenderTextureFormats::R16F:
- outFormat = GL_RED;
- outInternalFormat = GL_R16F;
- outDataType = GL_HALF_FLOAT;
- return true;
- case NVRenderTextureFormats::R32UI:
- outFormat = GL_RED_INTEGER;
- outInternalFormat = GL_R32UI;
- outDataType = GL_UNSIGNED_INT;
- return true;
- case NVRenderTextureFormats::R32F:
- outFormat = GL_RED;
- outInternalFormat = GL_R32F;
- outDataType = GL_FLOAT;
- return true;
- case NVRenderTextureFormats::RGBA16F:
- outFormat = GL_RGBA;
- outInternalFormat = GL_RGBA16F;
- outDataType = GL_HALF_FLOAT;
- return true;
- case NVRenderTextureFormats::RG16F:
- outFormat = GL_RG;
- outInternalFormat = GL_RG16F;
- outDataType = GL_HALF_FLOAT;
- return true;
- case NVRenderTextureFormats::RG32F:
- outFormat = GL_RG;
- outInternalFormat = GL_RG32F;
- outDataType = GL_FLOAT;
- return true;
- case NVRenderTextureFormats::RGBA32F:
- outFormat = GL_RGBA;
- outInternalFormat = GL_RGBA32F;
- outDataType = GL_FLOAT;
- return true;
- case NVRenderTextureFormats::RGB32F:
- outFormat = GL_RGB;
- outInternalFormat = GL_RGB32F;
- outDataType = GL_FLOAT;
- return true;
- case NVRenderTextureFormats::R11G11B10:
- outFormat = GL_RGB;
- outInternalFormat = GL_R11F_G11F_B10F;
- outDataType = GL_UNSIGNED_INT_10F_11F_11F_REV;
- return true;
- case NVRenderTextureFormats::RGB9E5:
- outFormat = GL_RGB;
- outInternalFormat = GL_RGB9_E5;
- outDataType = GL_UNSIGNED_INT_5_9_9_9_REV;
- return true;
- case NVRenderTextureFormats::SRGB8:
- outFormat = GL_RGB;
- outInternalFormat = GL_SRGB8;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- case NVRenderTextureFormats::SRGB8A8:
- outFormat = GL_RGBA;
- outInternalFormat = GL_SRGB8_ALPHA8;
- outDataType = GL_UNSIGNED_BYTE;
- return true;
- default:
- break;
- }
- }
-
- QT3DS_ASSERT(false);
- return false;
- }
-
- static GLenum fromCompressedTextureFormatToGL(NVRenderTextureFormats::Enum value)
- {
- switch (value) {
- case NVRenderTextureFormats::RGBA_DXT1:
- return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- case NVRenderTextureFormats::RGB_DXT1:
- return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
- case NVRenderTextureFormats::RGBA_DXT3:
- return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
- case NVRenderTextureFormats::RGBA_DXT5:
- return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
- case NVRenderTextureFormats::R_ATI1N_UNorm:
- return GL_COMPRESSED_RED_RGTC1;
- case NVRenderTextureFormats::R_ATI1N_SNorm:
- return GL_COMPRESSED_SIGNED_RED_RGTC1;
- case NVRenderTextureFormats::RG_ATI2N_UNorm:
- return GL_COMPRESSED_RG_RGTC2;
- case NVRenderTextureFormats::RG_ATI2N_SNorm:
- return GL_COMPRESSED_SIGNED_RG_RGTC2;
- case NVRenderTextureFormats::RGB_BP_UNSIGNED_FLOAT:
- return GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB;
- case NVRenderTextureFormats::RGB_BP_SIGNED_FLOAT:
- return GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB;
- case NVRenderTextureFormats::RGB_BP_UNorm:
- return GL_COMPRESSED_RGBA_BPTC_UNORM_ARB;
- case NVRenderTextureFormats::R11_EAC_UNorm:
- return GL_COMPRESSED_R11_EAC;
- case NVRenderTextureFormats::R11_EAC_SNorm:
- return GL_COMPRESSED_SIGNED_R11_EAC;
- case NVRenderTextureFormats::RG11_EAC_UNorm:
- return GL_COMPRESSED_RG11_EAC;
- case NVRenderTextureFormats::RG11_EAC_SNorm:
- return GL_COMPRESSED_SIGNED_RG11_EAC;
- case NVRenderTextureFormats::RGB8_ETC2:
- return GL_COMPRESSED_RGB8_ETC2;
- case NVRenderTextureFormats::SRGB8_ETC2:
- return GL_COMPRESSED_SRGB8_ETC2;
- case NVRenderTextureFormats::RGB8_PunchThrough_Alpha1_ETC2:
- return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
- case NVRenderTextureFormats::SRGB8_PunchThrough_Alpha1_ETC2:
- return GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
- case NVRenderTextureFormats::RGBA8_ETC2_EAC:
- return GL_COMPRESSED_RGBA8_ETC2_EAC;
- case NVRenderTextureFormats::SRGB8_Alpha8_ETC2_EAC:
- return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
- case NVRenderTextureFormats::RGB8_ETC1:
- return GL_ETC1_RGB8_OES;
-#ifdef GL_KHR_texture_compression_astc_hdr
- case NVRenderTextureFormats::RGBA_ASTC_4x4:
- return GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_5x4:
- return GL_COMPRESSED_RGBA_ASTC_5x4_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_5x5:
- return GL_COMPRESSED_RGBA_ASTC_5x5_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_6x5:
- return GL_COMPRESSED_RGBA_ASTC_6x5_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_6x6:
- return GL_COMPRESSED_RGBA_ASTC_6x6_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_8x5:
- return GL_COMPRESSED_RGBA_ASTC_8x5_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_8x6:
- return GL_COMPRESSED_RGBA_ASTC_8x6_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_8x8:
- return GL_COMPRESSED_RGBA_ASTC_8x8_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_10x5:
- return GL_COMPRESSED_RGBA_ASTC_10x5_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_10x6:
- return GL_COMPRESSED_RGBA_ASTC_10x6_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_10x8:
- return GL_COMPRESSED_RGBA_ASTC_10x8_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_10x10:
- return GL_COMPRESSED_RGBA_ASTC_10x10_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_12x10:
- return GL_COMPRESSED_RGBA_ASTC_12x10_KHR;
- case NVRenderTextureFormats::RGBA_ASTC_12x12:
- return GL_COMPRESSED_RGBA_ASTC_12x12_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_4x4:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_5x4:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_5x5:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_6x5:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_6x6:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_8x5:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_8x6:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_8x8:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_10x5:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_10x6:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_10x8:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_10x10:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_12x10:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;
- case NVRenderTextureFormats::SRGB8_Alpha8_ASTC_12x12:
- return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
-#endif // GL_KHR_texture_compression_astc_hdr
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static bool fromDepthTextureFormatToGL(NVRenderContextType type,
- NVRenderTextureFormats::Enum value,
- GLenum &outFormat, GLenum &outDataType,
- GLenum &outInternalFormat)
- {
- NVRenderContextType theContextFlags(NVRenderContextValues::GLES2
- | NVRenderContextValues::GL2);
-
- bool supportDepth24 = !(type & theContextFlags);
- bool supportDepth32f = !(type & theContextFlags);
- bool supportDepth24Stencil8 = !(type & theContextFlags);
-
- switch (value) {
- case NVRenderTextureFormats::Depth16:
- outFormat = GL_DEPTH_COMPONENT;
- outInternalFormat = GL_DEPTH_COMPONENT16;
- outDataType = GL_UNSIGNED_SHORT;
- return true;
- case NVRenderTextureFormats::Depth24:
- outFormat = GL_DEPTH_COMPONENT;
- outInternalFormat = (supportDepth24) ? GL_DEPTH_COMPONENT24 : GL_DEPTH_COMPONENT16;
- outDataType = (supportDepth24) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT;
- return true;
- case NVRenderTextureFormats::Depth32:
- outFormat = GL_DEPTH_COMPONENT;
- outInternalFormat =
- (supportDepth32f) ? GL_DEPTH_COMPONENT32F : GL_DEPTH_COMPONENT16;
- outDataType = (supportDepth32f) ? GL_FLOAT : GL_UNSIGNED_SHORT;
- return true;
- case NVRenderTextureFormats::Depth24Stencil8:
- outFormat = (supportDepth24Stencil8) ? GL_DEPTH_STENCIL : GL_DEPTH_COMPONENT;
- outInternalFormat =
- (supportDepth24Stencil8) ? GL_DEPTH24_STENCIL8 : GL_DEPTH_COMPONENT16;
- outDataType = (supportDepth24Stencil8) ? GL_UNSIGNED_INT_24_8 : GL_UNSIGNED_SHORT;
- return true;
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return false;
- }
-
- static GLenum fromTextureTargetToGL(NVRenderTextureTargetType::Enum value)
- {
- GLenum retval = 0;
- if (value == NVRenderTextureTargetType::Texture2D)
- retval = GL_TEXTURE_2D;
- else if (value == NVRenderTextureTargetType::Texture2D_MS)
- retval = GL_TEXTURE_2D_MULTISAMPLE;
- else if (value == NVRenderTextureTargetType::Texture2D_Array)
- retval = GL_TEXTURE_2D_ARRAY;
- else if (value == NVRenderTextureTargetType::TextureCube)
- retval = GL_TEXTURE_CUBE_MAP;
- else if (value == NVRenderTextureTargetType::TextureCubeNegX)
- retval = GL_TEXTURE_CUBE_MAP_NEGATIVE_X;
- else if (value == NVRenderTextureTargetType::TextureCubePosX)
- retval = GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- else if (value == NVRenderTextureTargetType::TextureCubeNegY)
- retval = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y;
- else if (value == NVRenderTextureTargetType::TextureCubePosY)
- retval = GL_TEXTURE_CUBE_MAP_POSITIVE_Y;
- else if (value == NVRenderTextureTargetType::TextureCubeNegZ)
- retval = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
- else if (value == NVRenderTextureTargetType::TextureCubePosZ)
- retval = GL_TEXTURE_CUBE_MAP_POSITIVE_Z;
- else
- QT3DS_ASSERT(false);
-
- return retval;
- }
-
- static NVRenderTextureTargetType::Enum fromGLToTextureTarget(GLenum value)
- {
- NVRenderTextureTargetType::Enum retval = NVRenderTextureTargetType::Unknown;
-
- if (value == GL_TEXTURE_2D)
- retval = NVRenderTextureTargetType::Texture2D;
- else if (value == GL_TEXTURE_2D_MULTISAMPLE)
- retval = NVRenderTextureTargetType::Texture2D_MS;
- else
- QT3DS_ASSERT(false);
-
- return retval;
- }
-
- static GLenum fromTextureUnitToGL(NVRenderTextureUnit::Enum value)
- {
- QT3DSU32 v = value;
- GLenum retval = GL_TEXTURE0;
- retval = GL_TEXTURE0 + v;
-
- return retval;
- }
-
- static GLenum fromGLToTextureUnit(GLenum value)
- {
- QT3DS_ASSERT(value > GL_TEXTURE0);
-
- QT3DSU32 v = value - GL_TEXTURE0;
- NVRenderTextureUnit::Enum retval =
- NVRenderTextureUnit::Enum(NVRenderTextureUnit::TextureUnit_0 + v);
-
- return retval;
- }
-
- static GLenum fromTextureMinifyingOpToGL(NVRenderTextureMinifyingOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP(x, y) \
- case NVRenderTextureMinifyingOp::y: \
- return x;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(x, y) \
- case NVRenderTextureMinifyingOp::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderTextureMinifyingOp::Enum fromGLToTextureMinifyingOp(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP(x, y) \
- case x: \
- return NVRenderTextureMinifyingOp::y;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(x, y) \
- case x: \
- return NVRenderTextureMinifyingOp::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderTextureMinifyingOp::Unknown;
- }
-
- static GLenum fromTextureMagnifyingOpToGL(NVRenderTextureMagnifyingOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP(x, y) \
- case NVRenderTextureMagnifyingOp::y: \
- return x;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(x, y)
- QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderTextureMagnifyingOp::Enum fromGLToTextureMagnifyingOp(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP(x, y) \
- case x: \
- return NVRenderTextureMagnifyingOp::y;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP(x, y)
- QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_SCALE_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_MINIFYING_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderTextureMagnifyingOp::Unknown;
- }
-
- static GLenum fromTextureCoordOpToGL(NVRenderTextureCoordOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP(x, y) \
- case NVRenderTextureCoordOp::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_WRAP_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderTextureCoordOp::Enum fromGLToTextureCoordOp(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP(x, y) \
- case x: \
- return NVRenderTextureCoordOp::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_TEXTURE_WRAP_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_TEXTURE_WRAP_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderTextureCoordOp::Unknown;
- }
-
- static GLenum fromTextureCompareModeToGL(NVRenderTextureCompareMode::Enum value)
- {
- switch (value) {
- case NVRenderTextureCompareMode::NoCompare:
- return GL_NONE;
- case NVRenderTextureCompareMode::CompareToRef:
- return GL_COMPARE_REF_TO_TEXTURE;
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return NVRenderTextureCompareMode::Unknown;
- }
-
- static GLenum fromGLToTextureCompareMode(GLenum value)
- {
- switch (value) {
- case GL_NONE:
- return NVRenderTextureCompareMode::NoCompare;
- case GL_COMPARE_REF_TO_TEXTURE:
- return NVRenderTextureCompareMode::CompareToRef;
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return GL_INVALID_ENUM;
- }
-
- static GLenum fromTextureCompareFuncToGL(NVRenderTextureCompareOp::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP(x, y) \
- case NVRenderTextureCompareOp::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_BOOL_OP
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_BOOL_OP
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static GLenum fromImageFormatToGL(NVRenderTextureFormats::Enum value)
- {
- switch (value) {
- case NVRenderTextureFormats::R8:
- return GL_R8;
- case NVRenderTextureFormats::R32I:
- return GL_R32I;
- case NVRenderTextureFormats::R32UI:
- return GL_R32UI;
- case NVRenderTextureFormats::R32F:
- return GL_R32F;
- case NVRenderTextureFormats::RGBA8:
- return GL_RGBA8;
- case NVRenderTextureFormats::SRGB8A8:
- return GL_RGBA8_SNORM;
- case NVRenderTextureFormats::RG16F:
- return GL_RG16F;
- case NVRenderTextureFormats::RGBA16F:
- return GL_RGBA16F;
- case NVRenderTextureFormats::RGBA32F:
- return GL_RGBA32F;
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return GL_INVALID_ENUM;
- }
-
-
- static GLenum fromImageAccessToGL(NVRenderImageAccessType::Enum value)
- {
- switch (value) {
- case NVRenderImageAccessType::Read:
- return GL_READ_ONLY;
- case NVRenderImageAccessType::Write:
- return GL_WRITE_ONLY;
- case NVRenderImageAccessType::ReadWrite:
- return GL_READ_WRITE;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return GL_INVALID_ENUM;
- }
-
- static GLbitfield fromBufferAccessBitToGL(NVRenderBufferAccessFlags flags)
- {
- QT3DSU32 value = flags;
- GLbitfield retval = 0;
-
- if (value & NVRenderBufferAccessTypeValues::Read)
- retval |= GL_MAP_READ_BIT;
- if (value & NVRenderBufferAccessTypeValues::Write)
- retval |= GL_MAP_WRITE_BIT;
- if (value & NVRenderBufferAccessTypeValues::Invalid)
- retval |= GL_MAP_INVALIDATE_BUFFER_BIT;
- if (value & NVRenderBufferAccessTypeValues::InvalidRange)
- retval |= GL_MAP_INVALIDATE_RANGE_BIT;
-
- QT3DS_ASSERT(retval);
- return retval;
- }
-
- static GLbitfield fromMemoryBarrierFlagsToGL(NVRenderBufferBarrierFlags flags)
- {
- QT3DSU32 value = flags;
- GLbitfield retval = 0;
-#if !defined(QT_OPENGL_ES)
- if (value & NVRenderBufferBarrierValues::AtomicCounter)
- retval |= GL_ATOMIC_COUNTER_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::BufferUpdate)
- retval |= GL_BUFFER_UPDATE_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::CommandBuffer)
- retval |= GL_COMMAND_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::ElementArray)
- retval |= GL_ELEMENT_ARRAY_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::Framebuffer)
- retval |= GL_FRAMEBUFFER_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::PixelBuffer)
- retval |= GL_PIXEL_BUFFER_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::ShaderImageAccess)
- retval |= GL_SHADER_IMAGE_ACCESS_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::ShaderStorage)
- retval |= GL_SHADER_STORAGE_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::TextureFetch)
- retval |= GL_TEXTURE_FETCH_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::TextureUpdate)
- retval |= GL_TEXTURE_UPDATE_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::TransformFeedback)
- retval |= GL_TRANSFORM_FEEDBACK_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::UniformBuffer)
- retval |= GL_UNIFORM_BARRIER_BIT;
- if (value & NVRenderBufferBarrierValues::VertexAttribArray)
- retval |= GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT;
-#endif
- QT3DS_ASSERT(retval);
- return retval;
- }
-
- static GLbitfield fromShaderTypeFlagsToGL(NVRenderShaderTypeFlags flags)
- {
- QT3DSU32 value = flags;
- GLbitfield retval = 0;
- if (value & NVRenderShaderTypeValue::Vertex)
- retval |= GL_VERTEX_SHADER_BIT;
- if (value & NVRenderShaderTypeValue::Fragment)
- retval |= GL_FRAGMENT_SHADER_BIT;
- if (value & NVRenderShaderTypeValue::TessControl)
- retval |= GL_TESS_CONTROL_SHADER_BIT;
- if (value & NVRenderShaderTypeValue::TessEvaluation)
- retval |= GL_TESS_EVALUATION_SHADER_BIT;
- if (value & NVRenderShaderTypeValue::Geometry)
-#if defined(QT_OPENGL_ES_3_1)
- retval |= GL_GEOMETRY_SHADER_BIT_EXT;
-#else
- retval |= GL_GEOMETRY_SHADER_BIT;
-#endif
- QT3DS_ASSERT(retval || !value);
- return retval;
- }
-
- static GLenum fromPropertyDataTypesToShaderGL(NVRenderShaderDataTypes::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(gl, nv) \
- case NVRenderShaderDataTypes::nv: \
- return gl;
- QT3DS_RENDER_ITERATE_GL_QT3DS_SHADER_UNIFORM_TYPES
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderShaderDataTypes::Enum fromShaderGLToPropertyDataTypes(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES(gl, nv) \
- case gl: \
- return NVRenderShaderDataTypes::nv;
- QT3DS_RENDER_ITERATE_GL_QT3DS_SHADER_UNIFORM_TYPES
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_UNIFORM_TYPES
- case GL_SAMPLER_2D_SHADOW:
- return NVRenderShaderDataTypes::NVRenderTexture2DPtr;
-#if !defined(QT_OPENGL_ES)
- case GL_UNSIGNED_INT_ATOMIC_COUNTER:
- return NVRenderShaderDataTypes::QT3DSU32;
- case GL_UNSIGNED_INT_IMAGE_2D:
- return NVRenderShaderDataTypes::NVRenderImage2DPtr;
-#endif
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderShaderDataTypes::Unknown;
- }
-
- static GLenum fromComponentTypeAndNumCompsToAttribGL(NVRenderComponentTypes::Enum compType,
- QT3DSU32 numComps)
- {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(gl, ct, nc) \
- if (compType == NVRenderComponentTypes::ct && numComps == nc) \
- return gl;
- QT3DS_RENDER_ITERATE_GL_QT3DS_SHADER_ATTRIB_TYPES
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static void fromAttribGLToComponentTypeAndNumComps(
- GLenum enumVal, NVRenderComponentTypes::Enum &outCompType, QT3DSU32 &outNumComps)
- {
- switch (enumVal) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES(gl, ct, nc) \
- case gl: \
- outCompType = NVRenderComponentTypes::ct; \
- outNumComps = nc; \
- return;
- QT3DS_RENDER_ITERATE_GL_QT3DS_SHADER_ATTRIB_TYPES
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_SHADER_ATTRIB_TYPES
- default:
- break;
- }
- QT3DS_ASSERT(false);
- outCompType = NVRenderComponentTypes::Unknown;
- outNumComps = 0;
- }
-
- static GLenum
- fromRenderBufferFormatsToRenderBufferGL(NVRenderRenderBufferFormats::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(gl, nv) \
- case NVRenderRenderBufferFormats::nv: \
- return gl;
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_FORMATS
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_COVERAGE_FORMATS
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderRenderBufferFormats::Enum
- fromRenderBufferGLToRenderBufferFormats(GLenum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT(gl, nv) \
- case gl: \
- return NVRenderRenderBufferFormats::nv;
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_FORMATS
- QT3DS_RENDER_ITERATE_GL_QT3DS_RENDERBUFFER_COVERAGE_FORMATS
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_RENDERBUFFER_FORMAT
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderRenderBufferFormats::Unknown;
- }
-
- static GLenum fromFramebufferAttachmentsToGL(NVRenderFrameBufferAttachments::Enum value)
- {
- switch (value) {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(x, idx) \
- case NVRenderFrameBufferAttachments::x: \
- return GL_COLOR_ATTACHMENT0 + idx;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT(x, y) \
- case NVRenderFrameBufferAttachments::y: \
- return x;
- QT3DS_RENDER_ITERATE_GL_QT3DS_FRAMEBUFFER_ATTACHMENTS
- QT3DS_RENDER_ITERATE_GL_QT3DS_FRAMEBUFFER_COVERAGE_ATTACHMENTS
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderFrameBufferAttachments::Unknown;
- }
-
- static NVRenderFrameBufferAttachments::Enum fromGLToFramebufferAttachments(GLenum value)
- {
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT(x, idx) \
- if (value == GL_COLOR_ATTACHMENT0 + idx) \
- return NVRenderFrameBufferAttachments::x;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT(x, y) \
- if (value == x) \
- return NVRenderFrameBufferAttachments::y;
- QT3DS_RENDER_ITERATE_GL_QT3DS_FRAMEBUFFER_ATTACHMENTS
- QT3DS_RENDER_ITERATE_GL_QT3DS_FRAMEBUFFER_COVERAGE_ATTACHMENTS
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_COLOR_ATTACHMENT
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_FRAMEBUFFER_ATTACHMENT
- QT3DS_ASSERT(false);
- return NVRenderFrameBufferAttachments::Unknown;
- }
-
- static GLbitfield fromClearFlagsToGL(NVRenderClearFlags flags)
- {
- QT3DSU32 value = flags;
- GLbitfield retval = 0;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS(gl, nv) \
- if ((value & NVRenderClearValues::nv)) \
- retval |= gl;
- QT3DS_RENDER_ITERATE_GL_QT3DS_CLEAR_FLAGS
- QT3DS_RENDER_ITERATE_GL_QT3DS_CLEAR_COVERAGE_FLAGS
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS
- return retval;
- }
-
- static NVRenderClearFlags fromGLToClearFlags(GLbitfield value)
- {
- QT3DSU32 retval = 0;
-#define QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS(gl, nv) \
- if ((value & gl)) \
- retval |= NVRenderClearValues::nv;
- QT3DS_RENDER_ITERATE_GL_QT3DS_CLEAR_FLAGS
- QT3DS_RENDER_ITERATE_GL_QT3DS_CLEAR_COVERAGE_FLAGS
-#undef QT3DS_RENDER_HANDLE_GL_QT3DS_CLEAR_FLAGS
- return NVRenderClearFlags(retval);
- }
-
- static GLenum fromDrawModeToGL(NVRenderDrawMode::Enum value, bool inTesselationSupported)
- {
- switch (value) {
- case NVRenderDrawMode::Points:
- return GL_POINTS;
- case NVRenderDrawMode::Lines:
- return GL_LINES;
- case NVRenderDrawMode::LineStrip:
- return GL_LINE_STRIP;
- case NVRenderDrawMode::LineLoop:
- return GL_LINE_LOOP;
- case NVRenderDrawMode::TriangleStrip:
- return GL_TRIANGLE_STRIP;
- case NVRenderDrawMode::TriangleFan:
- return GL_TRIANGLE_FAN;
- case NVRenderDrawMode::Triangles:
- return GL_TRIANGLES;
- case NVRenderDrawMode::Patches:
- return (inTesselationSupported) ? GL_PATCHES : GL_TRIANGLES;
- default:
- break;
- }
-
- QT3DS_ASSERT(false);
- return GL_INVALID_ENUM;
- }
-
- static NVRenderDrawMode::Enum fromGLToDrawMode(GLenum value)
- {
- switch (value) {
- case GL_POINTS:
- return NVRenderDrawMode::Points;
- case GL_LINES:
- return NVRenderDrawMode::Lines;
- case GL_LINE_STRIP:
- return NVRenderDrawMode::LineStrip;
- case GL_LINE_LOOP:
- return NVRenderDrawMode::LineLoop;
- case GL_TRIANGLE_STRIP:
- return NVRenderDrawMode::TriangleStrip;
- case GL_TRIANGLE_FAN:
- return NVRenderDrawMode::TriangleFan;
- case GL_TRIANGLES:
- return NVRenderDrawMode::Triangles;
- case GL_PATCHES:
- return NVRenderDrawMode::Patches;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderDrawMode::Unknown;
- }
-
- static GLenum fromRenderStateToGL(NVRenderState::Enum value)
- {
- switch (value) {
- case NVRenderState::Blend:
- return GL_BLEND;
- case NVRenderState::CullFace:
- return GL_CULL_FACE;
- case NVRenderState::DepthTest:
- return GL_DEPTH_TEST;
- case NVRenderState::Multisample:
-#if defined(QT_OPENGL_ES)
- return GL_MULTISAMPLE_EXT;
-#else
- return GL_MULTISAMPLE;
-#endif
- case NVRenderState::StencilTest:
- return GL_STENCIL_TEST;
- case NVRenderState::ScissorTest:
- return GL_SCISSOR_TEST;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- static NVRenderState::Enum fromGLToRenderState(GLenum value)
- {
- switch (value) {
- case GL_BLEND:
- return NVRenderState::Blend;
- case GL_CULL_FACE:
- return NVRenderState::CullFace;
- case GL_DEPTH_TEST:
- return NVRenderState::DepthTest;
-#if defined(QT_OPENGL_ES)
- case GL_MULTISAMPLE_EXT:
-#else
- case GL_MULTISAMPLE:
-#endif
- return NVRenderState::Multisample;
- case GL_STENCIL_TEST:
- return NVRenderState::StencilTest;
- case GL_SCISSOR_TEST:
- return NVRenderState::ScissorTest;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return NVRenderState::Unknown;
- }
-
- static bool fromReadPixelsToGlFormatAndType(NVRenderReadPixelFormats::Enum inReadPixels,
- GLuint *outFormat, GLuint *outType)
- {
- switch (inReadPixels) {
- case NVRenderReadPixelFormats::Alpha8:
- *outFormat = GL_ALPHA;
- *outType = GL_UNSIGNED_BYTE;
- break;
- case NVRenderReadPixelFormats::RGB565:
- *outFormat = GL_RGB;
- *outType = GL_UNSIGNED_SHORT_5_6_5;
- case NVRenderReadPixelFormats::RGB8:
- *outFormat = GL_RGB;
- *outType = GL_UNSIGNED_BYTE;
- break;
- case NVRenderReadPixelFormats::RGBA4444:
- *outFormat = GL_RGBA;
- *outType = GL_UNSIGNED_SHORT_4_4_4_4;
- break;
- case NVRenderReadPixelFormats::RGBA5551:
- *outFormat = GL_RGBA;
- *outType = GL_UNSIGNED_SHORT_5_5_5_1;
- break;
- case NVRenderReadPixelFormats::RGBA8:
- *outFormat = GL_RGBA;
- *outType = GL_UNSIGNED_BYTE;
- break;
- default:
- *outFormat = 0;
- *outType = 0;
- QT3DS_ASSERT(false);
- return false;
- };
-
- return true;
- }
-
- static GLenum fromPathFillModeToGL(NVRenderPathFillMode::Enum inMode)
- {
- GLenum glFillMode;
-
- switch (inMode) {
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathFillMode::Fill:
- glFillMode = GL_PATH_FILL_MODE_NV;
- break;
- case NVRenderPathFillMode::CountUp:
- glFillMode = GL_COUNT_UP_NV;
- break;
- case NVRenderPathFillMode::CountDown:
- glFillMode = GL_COUNT_DOWN_NV;
- break;
- case NVRenderPathFillMode::Invert:
- glFillMode = GL_INVERT;
- break;
-#endif
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- return glFillMode;
- }
-
- static GLenum fromPathFontTargetToGL(NVRenderPathFontTarget::Enum inFontTarget)
- {
- GLenum glFontTarget;
-
- switch (inFontTarget) {
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathFontTarget::StandardFont:
- glFontTarget = GL_STANDARD_FONT_NAME_NV;
- break;
- case NVRenderPathFontTarget::SystemFont:
- glFontTarget = GL_SYSTEM_FONT_NAME_NV;
- break;
- case NVRenderPathFontTarget::FileFont:
- glFontTarget = GL_FILE_NAME_NV;
- break;
-#endif
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- return glFontTarget;
- }
-
- static NVRenderPathReturnValues::Enum fromGLToPathFontReturn(GLenum inReturnValue)
- {
- NVRenderPathReturnValues::Enum returnValue;
-
- switch (inReturnValue) {
-#if !defined(QT_OPENGL_ES)
- case GL_FONT_GLYPHS_AVAILABLE_NV:
- returnValue = NVRenderPathReturnValues::FontGlypsAvailable;
- break;
- case GL_FONT_TARGET_UNAVAILABLE_NV:
- returnValue = NVRenderPathReturnValues::FontTargetUnavailable;
- break;
- case GL_FONT_UNAVAILABLE_NV:
- returnValue = NVRenderPathReturnValues::FontUnavailable;
- break;
- case GL_FONT_UNINTELLIGIBLE_NV:
- returnValue = NVRenderPathReturnValues::FontUnintelligible;
- break;
-#endif
- case GL_INVALID_ENUM:
- case GL_INVALID_VALUE:
- returnValue = NVRenderPathReturnValues::InvalidEnum;
- break;
- case GL_OUT_OF_MEMORY:
- returnValue = NVRenderPathReturnValues::OutOfMemory;
- break;
- default:
- QT3DS_ASSERT(false);
- returnValue = NVRenderPathReturnValues::FontTargetUnavailable;
- break;
- }
-
- return returnValue;
- }
-
- static GLenum fromPathMissingGlyphsToGL(NVRenderPathMissingGlyphs::Enum inHandleGlyphs)
- {
- GLenum glMissingGlyphs;
-
- switch (inHandleGlyphs) {
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathMissingGlyphs::SkipMissing:
- glMissingGlyphs = GL_SKIP_MISSING_GLYPH_NV;
- break;
- case NVRenderPathMissingGlyphs::UseMissing:
- glMissingGlyphs = GL_USE_MISSING_GLYPH_NV;
- break;
-#endif
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- return glMissingGlyphs;
- }
-
- static GLenum fromPathListModeToGL(NVRenderPathListMode::Enum inListMode)
- {
- GLenum glListMode;
-
- switch (inListMode) {
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathListMode::AccumAdjacentPairs:
- glListMode = GL_ACCUM_ADJACENT_PAIRS_NV;
- break;
- case NVRenderPathListMode::AdjacentPairs:
- glListMode = GL_ADJACENT_PAIRS_NV;
- break;
- case NVRenderPathListMode::FirstToRest:
- glListMode = GL_FIRST_TO_REST_NV;
- break;
-#endif
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- return glListMode;
- }
-
- static GLenum fromPathCoverModeToGL(NVRenderPathCoverMode::Enum inMode)
- {
- GLenum glCoverMode;
-
- switch (inMode) {
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathCoverMode::ConvexHull:
- glCoverMode = GL_CONVEX_HULL_NV;
- break;
- case NVRenderPathCoverMode::BoundingBox:
- glCoverMode = GL_BOUNDING_BOX_NV;
- break;
- case NVRenderPathCoverMode::BoundingBoxOfBoundingBox:
- glCoverMode = GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV;
- break;
- case NVRenderPathCoverMode::PathFillCover:
- glCoverMode = GL_PATH_FILL_COVER_MODE_NV;
- break;
- case NVRenderPathCoverMode::PathStrokeCover:
- glCoverMode = GL_PATH_STROKE_COVER_MODE_NV;
- break;
-#endif
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- return glCoverMode;
- }
-
- static GLenum fromPathTypeToGL(NVRenderPathFormatType::Enum value)
- {
- switch (value) {
- case NVRenderPathFormatType::Byte:
- return GL_BYTE;
- case NVRenderPathFormatType::UByte:
- return GL_UNSIGNED_BYTE;
- case NVRenderPathFormatType::Short:
- return GL_SHORT;
- case NVRenderPathFormatType::UShort:
- return GL_UNSIGNED_SHORT;
- case NVRenderPathFormatType::Int:
- return GL_INT;
- case NVRenderPathFormatType::Uint:
- return GL_UNSIGNED_INT;
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathFormatType::Bytes2:
- return GL_2_BYTES_NV;
- case NVRenderPathFormatType::Bytes3:
- return GL_3_BYTES_NV;
- case NVRenderPathFormatType::Bytes4:
- return GL_4_BYTES_NV;
- case NVRenderPathFormatType::Utf8:
- return GL_UTF8_NV;
- case NVRenderPathFormatType::Utf16:
- return GL_UTF16_NV;
-#endif
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return GL_UNSIGNED_BYTE;
- }
-
- static GLbitfield fromPathFontStyleToGL(NVRenderPathFontStyleFlags flags)
- {
- QT3DSU32 value = flags;
- GLbitfield retval = 0;
-#if !defined(QT_OPENGL_ES)
- if (value & NVRenderPathFontStyleValues::Bold)
- retval |= GL_BOLD_BIT_NV;
- if (value & NVRenderPathFontStyleValues::Italic)
- retval |= GL_ITALIC_BIT_NV;
-#endif
- QT3DS_ASSERT(retval || !value);
- return retval;
- }
-
- static GLenum fromPathTransformToGL(NVRenderPathTransformType::Enum value)
- {
- switch (value) {
- case NVRenderPathTransformType::NoTransform:
- return GL_NONE;
-#if !defined(QT_OPENGL_ES)
- case NVRenderPathTransformType::TranslateX:
- return GL_TRANSLATE_X_NV;
- case NVRenderPathTransformType::TranslateY:
- return GL_TRANSLATE_Y_NV;
- case NVRenderPathTransformType::Translate2D:
- return GL_TRANSLATE_2D_NV;
- case NVRenderPathTransformType::Translate3D:
- return GL_TRANSLATE_3D_NV;
- case NVRenderPathTransformType::Affine2D:
- return GL_AFFINE_2D_NV;
- case NVRenderPathTransformType::Affine3D:
- return GL_AFFINE_3D_NV;
- case NVRenderPathTransformType::TransposeAffine2D:
- return GL_TRANSPOSE_AFFINE_2D_NV;
- case NVRenderPathTransformType::TransposeAffine3D:
- return GL_TRANSPOSE_AFFINE_3D_NV;
-#endif
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return GL_UNSIGNED_BYTE;
- }
-
- static GLbitfield fromPathMetricQueryFlagsToGL(NVRenderPathGlyphFontMetricFlags flags)
- {
- QT3DSU32 value = flags;
- GLbitfield retval = 0;
-#if !defined(QT_OPENGL_ES)
- if (value & NVRenderPathGlyphFontMetricValues::GlyphWidth)
- retval |= GL_GLYPH_WIDTH_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphHeight)
- retval |= GL_GLYPH_HEIGHT_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphHorizontalBearingX)
- retval |= GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphHorizontalBearingY)
- retval |= GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphHorizontalBearingAdvance)
- retval |= GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphVerticalBearingX)
- retval |= GL_GLYPH_VERTICAL_BEARING_X_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphVerticalBearingY)
- retval |= GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphVerticalBearingAdvance)
- retval |= GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::GlyphHasKerning)
- retval |= GL_GLYPH_HAS_KERNING_BIT_NV;
-
- if (value & NVRenderPathGlyphFontMetricValues::FontXMinBounds)
- retval |= GL_FONT_X_MIN_BOUNDS_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontYMinBounds)
- retval |= GL_FONT_Y_MIN_BOUNDS_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontXMaxBounds)
- retval |= GL_FONT_X_MAX_BOUNDS_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontYMaxBounds)
- retval |= GL_FONT_Y_MAX_BOUNDS_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontUnitsPerEm)
- retval |= GL_FONT_UNITS_PER_EM_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontAscender)
- retval |= GL_FONT_ASCENDER_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontDescender)
- retval |= GL_FONT_DESCENDER_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontHeight)
- retval |= GL_FONT_HEIGHT_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontMaxAdvanceWidth)
- retval |= GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontMaxAdvanceHeight)
- retval |= GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontUnderlinePosition)
- retval |= GL_FONT_UNDERLINE_POSITION_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontMaxAdvanceWidth)
- retval |= GL_FONT_UNDERLINE_THICKNESS_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontHasKerning)
- retval |= GL_FONT_HAS_KERNING_BIT_NV;
- if (value & NVRenderPathGlyphFontMetricValues::FontNumGlyphIndices)
- retval |= GL_FONT_NUM_GLYPH_INDICES_BIT_NV;
-#endif
- QT3DS_ASSERT(retval || !value);
- return retval;
- }
- };
-}
-}
-
-#endif // QT3DSOPENGLUTIL_H
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.cpp b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.cpp
deleted file mode 100644
index f49f3a16..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.cpp
+++ /dev/null
@@ -1,785 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/backends/gl/Qt3DSRenderBackendGL3.h"
-#include "render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h"
-
-#ifdef RENDER_BACKEND_LOG_GL_ERRORS
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError(#x, __FILE__, __LINE__)
-#else
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError()
-#endif
-
-#define GL_CALL_EXTRA_FUNCTION(x) m_glExtraFunctions->x; RENDER_LOG_ERROR_PARAMS(x);
-
-#if defined(QT_OPENGL_ES)
-#define GL_CALL_TIMER_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_TESSELATION_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#else
-#define GL_CALL_TIMER_EXT(x) m_timerExtension->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_TESSELATION_EXT(x) m_tessellationShader->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_MULTISAMPLE_EXT(x) m_multiSample->x; RENDER_LOG_ERROR_PARAMS(x);
-#endif
-
-namespace qt3ds {
-namespace render {
-
-#ifndef GL_PATCH_VERTICES
-#define GL_PATCH_VERTICES 0x8E72
-#endif
-
- /// constructor
- NVRenderBackendGL3Impl::NVRenderBackendGL3Impl(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format)
- : NVRenderBackendGLBase(fnd, stringTable, format)
- {
- eastl::string exts3tc("GL_EXT_texture_compression_s3tc");
- eastl::string extsdxt("GL_EXT_texture_compression_dxt1");
- eastl::string extsAniso("GL_EXT_texture_filter_anisotropic");
- eastl::string extsTexSwizzle("GL_ARB_texture_swizzle");
- eastl::string extsAstcHDR("GL_KHR_texture_compression_astc_hdr");
- eastl::string extsAstcLDR("GL_KHR_texture_compression_astc_ldr");
- eastl::string extsFPRenderTarget("GL_EXT_color_buffer_float");
- eastl::string extsTimerQuery("GL_EXT_timer_query");
- eastl::string extsGpuShader5("EXT_gpu_shader5");
-
- const char *languageVersion = GetShadingLanguageVersion();
- qCInfo(TRACE_INFO, "GLSL version: %s", languageVersion);
-
- eastl::string apiVersion(getVersionString());
- qCInfo(TRACE_INFO, "GL version: %s", apiVersion.c_str());
-
- eastl::string apiVendor(getVendorString());
- qCInfo(TRACE_INFO, "HW vendor: %s", apiVendor.c_str());
-
- eastl::string apiRenderer(getRendererString());
- qCInfo(TRACE_INFO, "Vendor renderer: %s", apiRenderer.c_str());
-
- // clear support bits
- m_backendSupport.caps.u32Values = 0;
-
- // get extension count
- GLint numExtensions = 0;
- GL_CALL_EXTRA_FUNCTION(glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions));
-
- eastl::string extensionBuffer;
-
- for (QT3DSI32 i = 0; i < numExtensions; i++) {
- char *extensionString = (char *)GL_CALL_EXTRA_FUNCTION(glGetStringi(GL_EXTENSIONS, i));
-
- m_extensions.push_back(QString::fromLocal8Bit(extensionString));
-
- if (extensionBuffer.size())
- extensionBuffer.append(" ");
- extensionBuffer.append(extensionString);
-
- // search for extension
- if (!m_backendSupport.caps.bits.bDXTImagesSupported
- && (exts3tc.compare(extensionString) == 0 || extsdxt.compare(extensionString) == 0)) {
- m_backendSupport.caps.bits.bDXTImagesSupported = true;
- } else if (!m_backendSupport.caps.bits.bAnistropySupported
- && extsAniso.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bAnistropySupported = true;
- } else if (!m_backendSupport.caps.bits.bFPRenderTargetsSupported
- && extsFPRenderTarget.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bFPRenderTargetsSupported = true;
- } else if (!m_backendSupport.caps.bits.bTimerQuerySupported
- && extsTimerQuery.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bTimerQuerySupported = true;
- } else if (!m_backendSupport.caps.bits.bGPUShader5ExtensionSupported
- && extsGpuShader5.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bGPUShader5ExtensionSupported = true;
- }
-
- }
-
- qCInfo(TRACE_INFO, "OpenGL extensions: %s", extensionBuffer.c_str());
-
- // texture swizzle is always true
- m_backendSupport.caps.bits.bTextureSwizzleSupported = true;
- // depthstencil renderbuffer support is always true
- m_backendSupport.caps.bits.bDepthStencilSupported = true;
- // constant buffers support is always true
- m_backendSupport.caps.bits.bConstantBufferSupported = true;
- m_backendSupport.caps.bits.bStandardDerivativesSupported = true;
- m_backendSupport.caps.bits.bVertexArrayObjectSupported = true;
- m_backendSupport.caps.bits.bTextureLodSupported = true;
-
- if (!isESCompatible()) {
- // render to float textures is always supported on none ES systems which support >=GL3
- m_backendSupport.caps.bits.bFPRenderTargetsSupported = true;
- // multisampled texture is always supported on none ES systems which support >=GL3
- m_backendSupport.caps.bits.bMsTextureSupported = true;
- // timer queries are always supported on none ES systems which support >=GL3
- m_backendSupport.caps.bits.bTimerQuerySupported = true;
- }
-
- // query hardware
- GL_CALL_EXTRA_FUNCTION(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &m_MaxAttribCount));
-
- // internal state tracker
- m_pCurrentMiscState = QT3DS_NEW(m_Foundation.getAllocator(), NVRenderBackendMiscStateGL)();
-
- // finally setup caps based on device
- setAndInspectHardwareCaps();
-
- // Initialize extensions
-#if defined(QT_OPENGL_ES_2)
- m_qt3dsExtensions = new Qt3DSOpenGLES2Extensions;
- m_qt3dsExtensions->initializeOpenGLFunctions();
-#else
- m_timerExtension = new QOpenGLExtension_ARB_timer_query;
- m_timerExtension->initializeOpenGLFunctions();
- m_tessellationShader = new QOpenGLExtension_ARB_tessellation_shader;
- m_tessellationShader->initializeOpenGLFunctions();
- m_multiSample = new QOpenGLExtension_ARB_texture_multisample;
- m_multiSample->initializeOpenGLFunctions();
- m_qt3dsExtensions = new Qt3DSOpenGLExtensions;
- m_qt3dsExtensions->initializeOpenGLFunctions();
-#endif
- }
- /// destructor
- NVRenderBackendGL3Impl::~NVRenderBackendGL3Impl()
- {
- if (m_pCurrentMiscState)
- NVDelete(m_Foundation.getAllocator(), m_pCurrentMiscState);
-#if !defined(QT_OPENGL_ES_2)
- if (m_timerExtension)
- delete m_timerExtension;
- if (m_tessellationShader)
- delete m_tessellationShader;
- if (m_multiSample)
- delete m_multiSample;
-#endif
- if (m_qt3dsExtensions)
- delete m_qt3dsExtensions;
- }
-
- void NVRenderBackendGL3Impl::SetMultisampledTextureData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, size_t samples,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height,
- bool fixedsamplelocations)
- {
-// Not supported by ES 3 yet
-#if defined(QT_OPENGL_ES)
- NVRENDER_BACKEND_UNUSED(to);
- NVRENDER_BACKEND_UNUSED(target);
- NVRENDER_BACKEND_UNUSED(samples);
- NVRENDER_BACKEND_UNUSED(internalFormat);
- NVRENDER_BACKEND_UNUSED(width);
- NVRENDER_BACKEND_UNUSED(height);
- NVRENDER_BACKEND_UNUSED(fixedsamplelocations);
-#else
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat))
- GLConversion::fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
- else if (NVRenderTextureFormats::isDepthTextureFormat(internalFormat))
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
-
- GL_CALL_MULTISAMPLE_EXT(glTexImage2DMultisample(glTarget, (GLsizei)samples, glInternalFormat,
- (GLsizei)width, (GLsizei)height, fixedsamplelocations));
-
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
-#endif
- }
-
- void NVRenderBackendGL3Impl::SetTextureData3D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, size_t depth,
- QT3DSI32 border, NVRenderTextureFormats::Enum format, const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
- bool conversionRequired = format != internalFormat;
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat))
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
-
- if (conversionRequired) {
- GLenum dummy;
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, dummy);
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- glInternalFormat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- } else if (NVRenderTextureFormats::isDepthTextureFormat(format))
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
-
- GL_CALL_EXTRA_FUNCTION(glTexImage3D(glTarget, level, glInternalFormat, (GLsizei)width, (GLsizei)height,
- (GLsizei)depth, border, glformat, gltype, hostPtr));
-
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- void NVRenderBackendGL3Impl::UpdateSampler(
- NVRenderBackendSamplerObject /* so */, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter, NVRenderTextureMagnifyingOp::Enum magFilter,
- NVRenderTextureCoordOp::Enum wrapS, NVRenderTextureCoordOp::Enum wrapT,
- NVRenderTextureCoordOp::Enum wrapR, QT3DSF32 minLod, QT3DSF32 maxLod, QT3DSF32 lodBias,
- NVRenderTextureCompareMode::Enum compareMode, NVRenderTextureCompareOp::Enum compareFunc,
- QT3DSF32 anisotropy, QT3DSF32 *borderColor)
- {
-
- // Satisfy the compiler
- // These are not available in GLES 3 and we don't use them right now
- QT3DS_ASSERT(lodBias == 0.0);
- QT3DS_ASSERT(!borderColor);
- NVRENDER_BACKEND_UNUSED(lodBias);
- NVRENDER_BACKEND_UNUSED(borderColor);
-
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MIN_FILTER,
- m_Conversion.fromTextureMinifyingOpToGL(minFilter)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MAG_FILTER,
- m_Conversion.fromTextureMagnifyingOpToGL(magFilter)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_S,
- m_Conversion.fromTextureCoordOpToGL(wrapS)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_T,
- m_Conversion.fromTextureCoordOpToGL(wrapT)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_R,
- m_Conversion.fromTextureCoordOpToGL(wrapR)));
- GL_CALL_EXTRA_FUNCTION(glTexParameterf(glTarget, GL_TEXTURE_MIN_LOD, minLod));
- GL_CALL_EXTRA_FUNCTION(glTexParameterf(glTarget, GL_TEXTURE_MAX_LOD, maxLod));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_COMPARE_MODE,
- m_Conversion.fromTextureCompareModeToGL(compareMode)));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_COMPARE_FUNC,
- m_Conversion.fromTextureCompareFuncToGL(compareFunc)));
-
- if (m_backendSupport.caps.bits.bAnistropySupported) {
- GL_CALL_EXTRA_FUNCTION(glTexParameterf(glTarget, GL_TEXTURE_MAX_ANISOTROPY_EXT,
- qMin(anisotropy, m_maxAnisotropy)));
- }
- }
-
- void NVRenderBackendGL3Impl::UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSI32 baseLevel, QT3DSI32 maxLevel)
- {
- NVRENDER_BACKEND_UNUSED(to);
-
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_BASE_LEVEL, baseLevel));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MAX_LEVEL, maxLevel));
- }
-
- void NVRenderBackendGL3Impl::UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode)
- {
- NVRENDER_BACKEND_UNUSED(to);
- if (m_backendSupport.caps.bits.bTextureSwizzleSupported) {
- GLint glSwizzle[4];
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- m_Conversion.NVRenderConvertSwizzleModeToGL(swizzleMode, glSwizzle);
-#if defined(QT_OPENGL_ES)
- // since ES3 spec has no GL_TEXTURE_SWIZZLE_RGBA set it separately
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_R, glSwizzle[0]));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_G, glSwizzle[1]));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_B, glSwizzle[2]));
- GL_CALL_EXTRA_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_SWIZZLE_A, glSwizzle[3]));
-#else
- GL_CALL_EXTRA_FUNCTION(glTexParameteriv(glTarget, GL_TEXTURE_SWIZZLE_RGBA, glSwizzle));
-#endif
- }
- }
-
- QT3DSU32
- NVRenderBackendGL3Impl::GetDepthBits() const
- {
- QT3DSI32 depthBits;
- GL_CALL_EXTRA_FUNCTION(glGetFramebufferAttachmentParameteriv(
- GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &depthBits));
-
- return depthBits;
- }
-
- QT3DSU32
- NVRenderBackendGL3Impl::GetStencilBits() const
- {
- QT3DSI32 stencilBits;
- GL_CALL_EXTRA_FUNCTION(glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
- GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
- &stencilBits));
-
- return stencilBits;
- }
-
- void NVRenderBackendGL3Impl::GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum /*genType*/)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
- GL_CALL_EXTRA_FUNCTION(glGenerateMipmap(glTarget));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- bool NVRenderBackendGL3Impl::SetInputAssembler(NVRenderBackendInputAssemblerObject iao,
- NVRenderBackendShaderProgramObject po)
- {
- if (iao == NULL) {
- // unbind and return;
- GL_CALL_EXTRA_FUNCTION(glBindVertexArray(0));
- return true;
- }
-
- NVRenderBackendInputAssemblerGL *inputAssembler = (NVRenderBackendInputAssemblerGL *)iao;
- NVRenderBackendAttributeLayoutGL *attribLayout = inputAssembler->m_attribLayout;
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
- NVDataRef<NVRenderBackendShaderInputEntryGL> shaderAttribBuffer;
- if (pProgram->m_shaderInput)
- shaderAttribBuffer = pProgram->m_shaderInput->m_ShaderInputEntries;
-
- if (attribLayout->m_LayoutAttribEntries.size() < shaderAttribBuffer.size())
- return false;
-
- if (inputAssembler->m_VertexbufferHandles.size() <= attribLayout->m_MaxInputSlot) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- if (inputAssembler->m_VaoID == 0) {
- // generate vao
- GL_CALL_EXTRA_FUNCTION(glGenVertexArrays(1, &inputAssembler->m_VaoID));
- QT3DS_ASSERT(inputAssembler->m_VaoID);
- }
-
- // set patch parameter count if changed
- if (m_backendSupport.caps.bits.bTessellationSupported
- && m_pCurrentMiscState->m_PatchVertexCount != inputAssembler->m_PatchVertexCount) {
- m_pCurrentMiscState->m_PatchVertexCount = inputAssembler->m_PatchVertexCount;
-#if defined(QT_OPENGL_ES)
- GL_CALL_TESSELATION_EXT(glPatchParameteriEXT(GL_PATCH_VERTICES, inputAssembler->m_PatchVertexCount));
-#else
- GL_CALL_TESSELATION_EXT(glPatchParameteri(GL_PATCH_VERTICES, inputAssembler->m_PatchVertexCount));
-#endif
- }
-
- if (inputAssembler->m_cachedShaderHandle != programID) {
- GL_CALL_EXTRA_FUNCTION(glBindVertexArray(inputAssembler->m_VaoID));
- inputAssembler->m_cachedShaderHandle = programID;
-
- QT3DS_FOREACH(idx, shaderAttribBuffer.size())
- {
- const NVRenderBackendShaderInputEntryGL &attrib(shaderAttribBuffer[idx]);
- NVRenderBackendLayoutEntryGL *entry =
- attribLayout->getEntryByName(attrib.m_AttribName);
-
- if (entry) {
- NVRenderBackendLayoutEntryGL &entryData(*entry);
- if (entryData.m_Type != attrib.m_Type
- || entryData.m_NumComponents != attrib.m_NumComponents) {
- qCCritical(INVALID_OPERATION, "Attrib %s doesn't match vertex layout",
- attrib.m_AttribName.c_str());
- QT3DS_ASSERT(false);
- return false;
- } else {
- entryData.m_AttribIndex = attrib.m_AttribLocation;
- }
- } else {
- qCWarning(WARNING, "Failed to Bind attribute %s", attrib.m_AttribName.c_str());
- }
- }
-
- // disable max possible used first
- // this is currently sufficient since we always re-arrange input attributes from 0
- for (QT3DSU32 i = 0; i < attribLayout->m_LayoutAttribEntries.size(); i++) {
- GL_CALL_EXTRA_FUNCTION(glDisableVertexAttribArray(i));
- }
-
- // setup all attribs
- QT3DS_FOREACH(idx, shaderAttribBuffer.size())
- {
- NVRenderBackendLayoutEntryGL *entry =
- attribLayout->getEntryByName(shaderAttribBuffer[idx].m_AttribName);
- if (entry) {
- const NVRenderBackendLayoutEntryGL &entryData(*entry);
- GLuint id = HandleToID_cast(
- GLuint, size_t,
- inputAssembler->m_VertexbufferHandles.mData[entryData.m_InputSlot]);
- GL_CALL_EXTRA_FUNCTION(glBindBuffer(GL_ARRAY_BUFFER, id));
- GL_CALL_EXTRA_FUNCTION(glEnableVertexAttribArray(entryData.m_AttribIndex));
- GLuint offset = inputAssembler->m_offsets[entryData.m_InputSlot];
- GLuint stride = inputAssembler->m_strides[entryData.m_InputSlot];
- GL_CALL_EXTRA_FUNCTION(glVertexAttribPointer(
- entryData.m_AttribIndex, entryData.m_NumComponents, GL_FLOAT, GL_FALSE,
- stride, (const void *)(entryData.m_Offset + offset)));
-
- } else {
- GL_CALL_EXTRA_FUNCTION(glDisableVertexAttribArray(idx));
- }
- }
-
- // setup index buffer.
- if (inputAssembler->m_IndexbufferHandle) {
- GL_CALL_EXTRA_FUNCTION(glBindBuffer(
- GL_ELEMENT_ARRAY_BUFFER,
- HandleToID_cast(GLuint, size_t, inputAssembler->m_IndexbufferHandle)));
- } else {
- GL_CALL_EXTRA_FUNCTION(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
- }
- } else {
- GL_CALL_EXTRA_FUNCTION(glBindVertexArray(inputAssembler->m_VaoID));
- }
-#ifdef _DEBUG
- if (inputAssembler->m_VaoID) {
- QT3DS_FOREACH(idx, shaderAttribBuffer.size())
- {
- const NVRenderBackendShaderInputEntryGL &attrib(shaderAttribBuffer[idx]);
- NVRenderBackendLayoutEntryGL *entry =
- attribLayout->getEntryByName(attrib.m_AttribName);
-
- if (entry) {
- NVRenderBackendLayoutEntryGL &entryData(*entry);
- if (entryData.m_Type != attrib.m_Type
- || entryData.m_NumComponents != attrib.m_NumComponents
- || entryData.m_AttribIndex != attrib.m_AttribLocation) {
- qCCritical(INVALID_OPERATION, "Attrib %s doesn't match vertex layout",
- attrib.m_AttribName.c_str());
- QT3DS_ASSERT(false);
- }
- } else {
- qCWarning(WARNING, "Failed to Bind attribute %s", attrib.m_AttribName.c_str());
- }
- }
- }
-#endif // _DEBUG
-
- return true;
- }
-
- void NVRenderBackendGL3Impl::SetDrawBuffers(NVRenderBackendRenderTargetObject rto,
- NVConstDataRef<QT3DSI32> inDrawBufferSet)
- {
- NVRENDER_BACKEND_UNUSED(rto);
-
- m_DrawBuffersArray.clear();
-
- for (QT3DSU32 idx = 0, end = inDrawBufferSet.size(); idx < end; ++idx) {
- if (inDrawBufferSet[idx] < 0)
- m_DrawBuffersArray.push_back(GL_NONE);
- else
- m_DrawBuffersArray.push_back(GL_COLOR_ATTACHMENT0 + inDrawBufferSet[idx]);
- }
-
- GL_CALL_EXTRA_FUNCTION(glDrawBuffers((int)m_DrawBuffersArray.size(), m_DrawBuffersArray.data()));
- }
-
- void NVRenderBackendGL3Impl::SetReadBuffer(NVRenderBackendRenderTargetObject rto,
- NVReadFaces::Enum inReadFace)
- {
- NVRENDER_BACKEND_UNUSED(rto);
-
- GL_CALL_EXTRA_FUNCTION(glReadBuffer(m_Conversion.fromReadFacesToGL(inReadFace)));
- }
-
- void NVRenderBackendGL3Impl::RenderTargetAttach(NVRenderBackendRenderTargetObject,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to, QT3DSI32 level,
- QT3DSI32 layer)
- {
- // rto must be the current render target
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
-
- GLenum glAttach = GLConversion::fromFramebufferAttachmentsToGL(attachment);
-
- GL_CALL_EXTRA_FUNCTION(glFramebufferTextureLayer(GL_FRAMEBUFFER, glAttach, texID, level, layer))
- }
-
- void NVRenderBackendGL3Impl::SetReadTarget(NVRenderBackendRenderTargetObject rto)
- {
- GLuint fboID = HandleToID_cast(GLuint, size_t, rto);
-
- GL_CALL_EXTRA_FUNCTION(glBindFramebuffer(GL_READ_FRAMEBUFFER, fboID));
- }
-
- void NVRenderBackendGL3Impl::BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter)
- {
- GL_CALL_EXTRA_FUNCTION(glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
- m_Conversion.fromClearFlagsToGL(flags),
- m_Conversion.fromTextureMagnifyingOpToGL(filter)));
- }
-
- void *NVRenderBackendGL3Impl::MapBuffer(NVRenderBackendBufferObject,
- NVRenderBufferBindFlags bindFlags, size_t offset,
- size_t length, NVRenderBufferAccessFlags accessFlags)
- {
- void *ret = NULL;
- ret = GL_CALL_EXTRA_FUNCTION(glMapBufferRange(m_Conversion.fromBindBufferFlagsToGL(bindFlags), offset,
- length, m_Conversion.fromBufferAccessBitToGL(accessFlags)));
-
- return ret;
- }
-
- bool NVRenderBackendGL3Impl::UnmapBuffer(NVRenderBackendBufferObject,
- NVRenderBufferBindFlags bindFlags)
- {
- GLboolean ret;
-
- ret = GL_CALL_EXTRA_FUNCTION(glUnmapBuffer(m_Conversion.fromBindBufferFlagsToGL(bindFlags)));
-
- return (ret) ? true : false;
- }
-
- QT3DSI32 NVRenderBackendGL3Impl::GetConstantBufferCount(NVRenderBackendShaderProgramObject po)
- {
- QT3DS_ASSERT(po);
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GLint numUniformBuffers;
- GL_CALL_EXTRA_FUNCTION(glGetProgramiv(programID, GL_ACTIVE_UNIFORM_BLOCKS, &numUniformBuffers));
-
- return numUniformBuffers;
- }
-
- QT3DSI32
- NVRenderBackendGL3Impl::GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize,
- QT3DSI32 *paramCount, QT3DSI32 *bufferSize,
- QT3DSI32 *length, char *nameBuf)
- {
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(length);
- QT3DS_ASSERT(nameBuf);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
- GLuint blockIndex = GL_INVALID_INDEX;
-
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockName(programID, id, nameBufSize, length, nameBuf));
-
- if (*length > 0) {
- blockIndex = GL_CALL_EXTRA_FUNCTION(glGetUniformBlockIndex(programID, nameBuf));
- if (blockIndex != GL_INVALID_INDEX) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockiv(programID, blockIndex,
- GL_UNIFORM_BLOCK_DATA_SIZE, bufferSize));
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockiv(programID, blockIndex,
- GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, paramCount));
- }
- }
-
- return blockIndex;
- }
-
- void
- NVRenderBackendGL3Impl::GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSI32 *indices)
- {
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(indices);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- if (indices) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformBlockiv(programID, id,
- GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, indices));
- }
- }
-
- void NVRenderBackendGL3Impl::GetConstantBufferParamInfoByIndices(
- NVRenderBackendShaderProgramObject po, QT3DSU32 count, QT3DSU32 *indices, QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset)
- {
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(count);
- QT3DS_ASSERT(indices);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- if (count && indices) {
- if (type) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformsiv(programID, count, indices, GL_UNIFORM_TYPE, type));
- // convert to UIC types
- QT3DS_FOREACH(idx, count)
- {
- type[idx] = m_Conversion.fromShaderGLToPropertyDataTypes(type[idx]);
- }
- }
- if (size) {
- GL_CALL_EXTRA_FUNCTION(glGetActiveUniformsiv(programID, count, indices, GL_UNIFORM_SIZE, size));
- }
- if (offset) {
- GL_CALL_EXTRA_FUNCTION(
- glGetActiveUniformsiv(programID, count, indices, GL_UNIFORM_OFFSET, offset));
- }
- }
- }
-
- void NVRenderBackendGL3Impl::ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GL_CALL_EXTRA_FUNCTION(glUniformBlockBinding(programID, blockIndex, binding));
- }
-
- void NVRenderBackendGL3Impl::ProgramSetConstantBuffer(QT3DSU32 index,
- NVRenderBackendBufferObject bo)
- {
- QT3DS_ASSERT(bo);
-
- GLuint bufID = HandleToID_cast(GLuint, size_t, bo);
- GL_CALL_EXTRA_FUNCTION(glBindBufferBase(GL_UNIFORM_BUFFER, index, bufID));
- }
-
- NVRenderBackend::NVRenderBackendQueryObject NVRenderBackendGL3Impl::CreateQuery()
- {
- QT3DSU32 glQueryID = 0;
-
- GL_CALL_EXTRA_FUNCTION(glGenQueries(1, &glQueryID));
-
- return (NVRenderBackendQueryObject)glQueryID;
- }
-
- void NVRenderBackendGL3Impl::ReleaseQuery(NVRenderBackendQueryObject qo)
- {
- GLuint queryID = HandleToID_cast(GLuint, size_t, qo);
-
- GL_CALL_EXTRA_FUNCTION(glDeleteQueries(1, &queryID));
- }
-
- void NVRenderBackendGL3Impl::BeginQuery(NVRenderBackendQueryObject qo,
- NVRenderQueryType::Enum type)
- {
- GLuint queryID = HandleToID_cast(GLuint, size_t, qo);
-
- GL_CALL_EXTRA_FUNCTION(glBeginQuery(m_Conversion.fromQueryTypeToGL(type), queryID));
- }
-
- void NVRenderBackendGL3Impl::EndQuery(NVRenderBackendQueryObject, NVRenderQueryType::Enum type)
- {
- GL_CALL_EXTRA_FUNCTION(glEndQuery(m_Conversion.fromQueryTypeToGL(type)));
- }
-
- void NVRenderBackendGL3Impl::GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType,
- QT3DSU32 *params)
- {
- GLuint queryID = HandleToID_cast(GLuint, size_t, qo);
-
- if (params)
- GL_CALL_EXTRA_FUNCTION(glGetQueryObjectuiv(
- queryID, m_Conversion.fromQueryResultTypeToGL(resultType), params));
- }
-
- void NVRenderBackendGL3Impl::GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType,
- QT3DSU64 *params)
- {
- if (m_backendSupport.caps.bits.bTimerQuerySupported) {
- GLuint queryID = HandleToID_cast(GLuint, size_t, qo);
-
- if (params)
-#if defined(QT_OPENGL_ES)
- GL_CALL_TIMER_EXT(glGetQueryObjectui64vEXT(
- queryID, m_Conversion.fromQueryResultTypeToGL(resultType), params));
-#else
- GL_CALL_TIMER_EXT(glGetQueryObjectui64v(
- queryID, m_Conversion.fromQueryResultTypeToGL(resultType), params));
-#endif
- }
- }
-
- void NVRenderBackendGL3Impl::SetQueryTimer(NVRenderBackendQueryObject qo)
- {
- if (m_backendSupport.caps.bits.bTimerQuerySupported) {
- GLuint queryID = HandleToID_cast(GLuint, size_t, qo);
-#if defined(QT_OPENGL_ES)
- GL_CALL_TIMER_EXT(glQueryCounterEXT(queryID, GL_TIMESTAMP_EXT));
-#else
- GL_CALL_TIMER_EXT(glQueryCounter(queryID, GL_TIMESTAMP));
-#endif
- }
- }
-
- NVRenderBackend::NVRenderBackendSyncObject
- NVRenderBackendGL3Impl::CreateSync(NVRenderSyncType::Enum syncType, NVRenderSyncFlags)
- {
- GLsync syncID = 0;
-
- syncID = GL_CALL_EXTRA_FUNCTION(glFenceSync(m_Conversion.fromSyncTypeToGL(syncType), 0));
-
- return NVRenderBackendSyncObject(syncID);
- }
-
- void NVRenderBackendGL3Impl::ReleaseSync(NVRenderBackendSyncObject so)
- {
- GLsync syncID = (GLsync)so;
-
- GL_CALL_EXTRA_FUNCTION(glDeleteSync(syncID));
- }
-
- void NVRenderBackendGL3Impl::WaitSync(NVRenderBackendSyncObject so, NVRenderCommandFlushFlags,
- QT3DSU64)
- {
- GLsync syncID = (GLsync)so;
-
- GL_CALL_EXTRA_FUNCTION(glWaitSync(syncID, 0, GL_TIMEOUT_IGNORED));
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.h
deleted file mode 100644
index 7147b341..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL3.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_GL3_H
-#define QT3DS_RENDER_BACKEND_GL3_H
-
-/// @file Qt3DSRenderBackendGL3.h
-/// NVRender OpenGL 3 backend definition.
-
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/gl/Qt3DSRenderBackendGLBase.h"
-#include "render/backends/gl/Qt3DSOpenGLExtensions.h"
-
-#include <QtGui/QOpenGLExtraFunctions>
-#include <QtOpenGLExtensions/QtOpenGLExtensions>
-
-namespace qt3ds {
-namespace render {
-
- ///< forward declaration
- class NVRenderBackendMiscStateGL;
-
- using namespace foundation;
-
- class NVRenderBackendGL3Impl : public NVRenderBackendGLBase
- {
- public:
- /// constructor
- NVRenderBackendGL3Impl(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format);
- /// destructor
- virtual ~NVRenderBackendGL3Impl();
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- public:
- QT3DSU32 GetDepthBits() const override;
- QT3DSU32 GetStencilBits() const override;
- void GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum genType) override;
-
- void SetMultisampledTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- size_t samples,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height,
- bool fixedsamplelocations) override;
-
- void SetTextureData3D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, size_t depth, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) override;
-
- void UpdateSampler(
- NVRenderBackendSamplerObject so, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- QT3DSF32 minLod = -1000.0, QT3DSF32 maxLod = 1000.0, QT3DSF32 lodBias = 0.0,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0, QT3DSF32 *borderColor = NULL) override;
-
- void UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSI32 baseLevel,
- QT3DSI32 maxLevel) override;
-
- void UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode) override;
-
- bool SetInputAssembler(NVRenderBackendInputAssemblerObject iao,
- NVRenderBackendShaderProgramObject po) override;
-
- void SetDrawBuffers(NVRenderBackendRenderTargetObject rto,
- NVConstDataRef<QT3DSI32> inDrawBufferSet) override;
- void SetReadBuffer(NVRenderBackendRenderTargetObject rto,
- NVReadFaces::Enum inReadFace) override;
-
- void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to, QT3DSI32 level, QT3DSI32 layer) override;
- void SetReadTarget(NVRenderBackendRenderTargetObject rto) override;
-
- void BlitFramebuffer(QT3DSI32 srcX0, QT3DSI32 srcY0, QT3DSI32 srcX1, QT3DSI32 srcY1,
- QT3DSI32 dstX0, QT3DSI32 dstY0, QT3DSI32 dstX1, QT3DSI32 dstY1,
- NVRenderClearFlags flags,
- NVRenderTextureMagnifyingOp::Enum filter) override;
-
- void *MapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags,
- size_t offset, size_t length,
- NVRenderBufferAccessFlags accessFlags) override;
- bool UnmapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags) override;
-
- QT3DSI32 GetConstantBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length, char *nameBuf) override;
- void GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSI32 *indices) override;
- void GetConstantBufferParamInfoByIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 count, QT3DSU32 *indices, QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset) override;
- void ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding) override;
- void ProgramSetConstantBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- NVRenderBackendQueryObject CreateQuery() override;
- void ReleaseQuery(NVRenderBackendQueryObject qo) override;
- void BeginQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) override;
- void EndQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) override;
- void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU32 *params) override;
- void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU64 *params) override;
- void SetQueryTimer(NVRenderBackendQueryObject qo) override;
-
- NVRenderBackendSyncObject CreateSync(NVRenderSyncType::Enum tpye,
- NVRenderSyncFlags syncFlags) override;
- void ReleaseSync(NVRenderBackendSyncObject so) override;
- void WaitSync(NVRenderBackendSyncObject so, NVRenderCommandFlushFlags syncFlags,
- QT3DSU64 timeout) override;
-
- protected:
- NVRenderBackendMiscStateGL *m_pCurrentMiscState; ///< this holds the current misc state
-#if defined(QT_OPENGL_ES_2)
- Qt3DSOpenGLES2Extensions *m_qt3dsExtensions;
-#else
- QOpenGLExtension_ARB_timer_query *m_timerExtension;
- QOpenGLExtension_ARB_tessellation_shader *m_tessellationShader;
- QOpenGLExtension_ARB_texture_multisample *m_multiSample;
- Qt3DSOpenGLExtensions *m_qt3dsExtensions;
-#endif
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.cpp b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.cpp
deleted file mode 100644
index 083fc35e..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.cpp
+++ /dev/null
@@ -1,875 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/backends/gl/Qt3DSRenderBackendGL4.h"
-#include "render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h"
-
-#define NVRENDER_BACKEND_UNUSED(arg) (void)arg;
-
-#ifdef RENDER_BACKEND_LOG_GL_ERRORS
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError(#x, __FILE__, __LINE__)
-#else
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError()
-#endif
-
-#define GL_CALL_EXTRA_FUNCTION(x) m_glExtraFunctions->x; RENDER_LOG_ERROR_PARAMS(x);
-
-#if defined(QT_OPENGL_ES)
-#define GL_CALL_NVPATH_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_QT3DS_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#else
-#define GL_CALL_NVPATH_EXT(x) m_nvPathRendering->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_DIRECTSTATE_EXT(x) m_directStateAccess->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_QT3DS_EXT(x) m_qt3dsExtensions->x; RENDER_LOG_ERROR_PARAMS(x);
-#endif
-
-#ifndef GL_GEOMETRY_SHADER_EXT
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-#endif
-
-namespace qt3ds {
-namespace render {
-
- /// constructor
- NVRenderBackendGL4Impl::NVRenderBackendGL4Impl(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format)
- : NVRenderBackendGL3Impl(fnd, stringTable, format)
- {
- eastl::string extTess("GL_ARB_tessellation_shader");
- eastl::string extGeometry("GL_EXT_geometry_shader4");
- eastl::string arbCompute("GL_ARB_compute_shader");
- eastl::string arbStorageBuffer("GL_ARB_shader_storage_buffer_object");
- eastl::string arbAtomicCounterBuffer("GL_ARB_shader_atomic_counters");
- eastl::string arbProgInterface("GL_ARB_program_interface_query");
- eastl::string arbShaderImageLoadStore("GL_ARB_shader_image_load_store");
- eastl::string nvPathRendering("GL_NV_path_rendering");
- eastl::string nvBlendAdvanced("GL_NV_blend_equation_advanced");
- eastl::string khrBlendAdvanced("GL_KHR_blend_equation_advanced");
- eastl::string nvBlendAdvancedCoherent("GL_NV_blend_equation_advanced_coherent");
- eastl::string khrBlendAdvancedCoherent("GL_KHR_blend_equation_advanced_coherent");
-
- eastl::string apiVersion(getVersionString());
- qCInfo(TRACE_INFO, "GL version: %s", apiVersion.c_str());
-
- // get extension count
- GLint numExtensions = 0;
- GL_CALL_EXTRA_FUNCTION(glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions));
-
- for (QT3DSI32 i = 0; i < numExtensions; i++) {
- char *extensionString = (char *)GL_CALL_EXTRA_FUNCTION(glGetStringi(GL_EXTENSIONS, i));
-
- // search for extension
- if (!m_backendSupport.caps.bits.bTessellationSupported
- && extTess.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bTessellationSupported = true;
- } else if (!m_backendSupport.caps.bits.bComputeSupported
- && arbCompute.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bComputeSupported = true;
- } else if (!m_backendSupport.caps.bits.bGeometrySupported
- && extGeometry.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bGeometrySupported = true;
- } else if (!m_backendSupport.caps.bits.bStorageBufferSupported
- && arbStorageBuffer.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bStorageBufferSupported = true;
- } else if (!m_backendSupport.caps.bits.bAtomicCounterBufferSupported
- && arbAtomicCounterBuffer.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bAtomicCounterBufferSupported = true;
- } else if (!m_backendSupport.caps.bits.bProgramInterfaceSupported
- && arbProgInterface.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bProgramInterfaceSupported = true;
- } else if (!m_backendSupport.caps.bits.bShaderImageLoadStoreSupported
- && arbShaderImageLoadStore.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bShaderImageLoadStoreSupported = true;
- } else if (!m_backendSupport.caps.bits.bNVPathRenderingSupported
- && nvPathRendering.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bNVPathRenderingSupported = true;
- } else if (!m_backendSupport.caps.bits.bNVAdvancedBlendSupported
- && nvBlendAdvanced.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bNVAdvancedBlendSupported = true;
- } else if (!m_backendSupport.caps.bits.bNVBlendCoherenceSupported
- && nvBlendAdvancedCoherent.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bNVBlendCoherenceSupported = true;
- } else if (!m_backendSupport.caps.bits.bKHRAdvancedBlendSupported
- && khrBlendAdvanced.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bKHRAdvancedBlendSupported = true;
- } else if (!m_backendSupport.caps.bits.bKHRBlendCoherenceSupported
- && khrBlendAdvancedCoherent.compare(extensionString) == 0) {
- m_backendSupport.caps.bits.bKHRBlendCoherenceSupported = true;
- }
- }
-
- // always true for GL4.1 and GLES 3.1 devices
- m_backendSupport.caps.bits.bMsTextureSupported = true;
- m_backendSupport.caps.bits.bProgramPipelineSupported = true;
-
- if (!isESCompatible()) {
- // TODO: investigate GL 4.0 support
- // we expect minimum GL 4.1 context anything beyond is handeled via extensions
- // Tessellation is always supported on none ES systems which support >=GL4
- m_backendSupport.caps.bits.bTessellationSupported = true;
- // geometry shader is always supported on none ES systems which support >=GL4 ( actually
- // 3.2 already )
- m_backendSupport.caps.bits.bGeometrySupported = true;
- } else {
- // always true for GLES 3.1 devices
- m_backendSupport.caps.bits.bComputeSupported = true;
- m_backendSupport.caps.bits.bProgramInterfaceSupported = true;
- m_backendSupport.caps.bits.bStorageBufferSupported = true;
- m_backendSupport.caps.bits.bAtomicCounterBufferSupported = true;
- m_backendSupport.caps.bits.bShaderImageLoadStoreSupported = true;
- }
-
-#if !defined(QT_OPENGL_ES)
- // Initialize extensions
- m_nvPathRendering = QT3DS_NEW(m_Foundation.getAllocator(), QOpenGLExtension_NV_path_rendering)();
- m_nvPathRendering->initializeOpenGLFunctions();
- m_directStateAccess = QT3DS_NEW(m_Foundation.getAllocator(), QOpenGLExtension_EXT_direct_state_access)();
- m_directStateAccess->initializeOpenGLFunctions();
-#endif
- }
-
- /// destructor
- NVRenderBackendGL4Impl::~NVRenderBackendGL4Impl()
- {
-#if !defined(QT_OPENGL_ES)
- if (m_nvPathRendering)
- NVDelete(m_Foundation.getAllocator(), m_nvPathRendering);
- if (m_directStateAccess)
- NVDelete(m_Foundation.getAllocator(), m_directStateAccess);
-#endif
- }
-
- void NVRenderBackendGL4Impl::DrawIndirect(NVRenderDrawMode::Enum drawMode, const void *indirect)
- {
- GL_CALL_EXTRA_FUNCTION(
- glDrawArraysIndirect(m_Conversion.fromDrawModeToGL(
- drawMode, m_backendSupport.caps.bits.bTessellationSupported),
- indirect));
- }
-
- void NVRenderBackendGL4Impl::DrawIndexedIndirect(NVRenderDrawMode::Enum drawMode,
- NVRenderComponentTypes::Enum type,
- const void *indirect)
- {
- GL_CALL_EXTRA_FUNCTION(glDrawElementsIndirect(
- m_Conversion.fromDrawModeToGL(drawMode,
- m_backendSupport.caps.bits.bTessellationSupported),
- m_Conversion.fromIndexBufferComponentsTypesToGL(type), indirect));
- }
-
- void NVRenderBackendGL4Impl::CreateTextureStorage2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSU32 levels,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
-
- // up to now compressed is not supported
- QT3DS_ASSERT(NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat));
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
- GLConversion::fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
-
- GL_CALL_EXTRA_FUNCTION(
- glTexStorage2D(glTarget, levels, glInternalFormat, (GLsizei)width, (GLsizei)height));
-
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- void NVRenderBackendGL4Impl::SetMultisampledTextureData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, size_t samples,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height,
- bool fixedsamplelocations)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_EXTRA_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, texID));
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat))
- GLConversion::fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
- else if (NVRenderTextureFormats::isDepthTextureFormat(internalFormat))
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
- GL_CALL_EXTRA_FUNCTION(glTexStorage2DMultisample(glTarget, (GLsizei)samples, glInternalFormat,
- (GLsizei)width, (GLsizei)height,
- fixedsamplelocations));
-
- GL_CALL_EXTRA_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- NVRenderBackend::NVRenderBackendTessControlShaderObject
- NVRenderBackendGL4Impl::CreateTessControlShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
-#if !defined(QT_OPENGL_ES)
- GLuint shaderID = GL_CALL_EXTRA_FUNCTION(glCreateShader(GL_TESS_CONTROL_SHADER));
-#else
- GLuint shaderID = 0;
-#endif
- if (shaderID && !compileSource(shaderID, source, errorMessage, binary)) {
- GL_CALL_EXTRA_FUNCTION(glDeleteShader(shaderID));
- shaderID = 0;
- }
-
- return (NVRenderBackend::NVRenderBackendTessControlShaderObject)shaderID;
- }
-
- NVRenderBackend::NVRenderBackendTessEvaluationShaderObject
- NVRenderBackendGL4Impl::CreateTessEvaluationShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
-#if !defined(QT_OPENGL_ES)
- GLuint shaderID = GL_CALL_EXTRA_FUNCTION(glCreateShader(GL_TESS_EVALUATION_SHADER));
-#else
- GLuint shaderID = 0;
-#endif
-
- if (shaderID && !compileSource(shaderID, source, errorMessage, binary)) {
- GL_CALL_EXTRA_FUNCTION(glDeleteShader(shaderID));
- shaderID = 0;
- }
-
- return (NVRenderBackend::NVRenderBackendTessEvaluationShaderObject)shaderID;
- }
-
- NVRenderBackend::NVRenderBackendGeometryShaderObject
- NVRenderBackendGL4Impl::CreateGeometryShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
-#if defined(QT_OPENGL_ES)
- GLuint shaderID = GL_CALL_EXTRA_FUNCTION(glCreateShader(GL_GEOMETRY_SHADER_EXT));
-#else
- GLuint shaderID = GL_CALL_EXTRA_FUNCTION(glCreateShader(GL_GEOMETRY_SHADER));
-#endif
- if (shaderID && !compileSource(shaderID, source, errorMessage, binary)) {
- GL_CALL_EXTRA_FUNCTION(glDeleteShader(shaderID));
- shaderID = 0;
- }
-
- return (NVRenderBackend::NVRenderBackendGeometryShaderObject)shaderID;
- }
-
- void NVRenderBackendGL4Impl::SetPatchVertexCount(NVRenderBackendInputAssemblerObject iao,
- QT3DSU32 count)
- {
- QT3DS_ASSERT(iao);
- QT3DS_ASSERT(count);
- NVRenderBackendInputAssemblerGL *inputAssembler = (NVRenderBackendInputAssemblerGL *)iao;
- inputAssembler->m_PatchVertexCount = count;
- }
-
- void NVRenderBackendGL4Impl::SetMemoryBarrier(NVRenderBufferBarrierFlags barriers)
- {
- GL_CALL_EXTRA_FUNCTION(glMemoryBarrier(m_Conversion.fromMemoryBarrierFlagsToGL(barriers)));
- }
-
- void NVRenderBackendGL4Impl::BindImageTexture(NVRenderBackendTextureObject to, QT3DSU32 unit,
- QT3DSI32 level, bool layered, QT3DSI32 layer,
- NVRenderImageAccessType::Enum access,
- NVRenderTextureFormats::Enum format)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
-
- GL_CALL_EXTRA_FUNCTION(glBindImageTexture(unit, texID, level, layered, layer,
- m_Conversion.fromImageAccessToGL(access),
- m_Conversion.fromImageFormatToGL(format)));
- }
-
- QT3DSI32 NVRenderBackendGL4Impl::GetStorageBufferCount(NVRenderBackendShaderProgramObject po)
- {
- GLint numStorageBuffers = 0;
- QT3DS_ASSERT(po);
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
-#if defined(GL_VERSION_4_3) || defined (QT_OPENGL_ES_3_1)
- if (m_backendSupport.caps.bits.bProgramInterfaceSupported)
- GL_CALL_EXTRA_FUNCTION(glGetProgramInterfaceiv(programID, GL_SHADER_STORAGE_BLOCK,
- GL_ACTIVE_RESOURCES, &numStorageBuffers));
-#endif
- return numStorageBuffers;
- }
-
- QT3DSI32
- NVRenderBackendGL4Impl::GetStorageBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf)
- {
- GLint bufferIndex = GL_INVALID_INDEX;
-
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(length);
- QT3DS_ASSERT(nameBuf);
- QT3DS_ASSERT(bufferSize);
- QT3DS_ASSERT(paramCount);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-#if defined(GL_VERSION_4_3) || defined (QT_OPENGL_ES_3_1)
- if (m_backendSupport.caps.bits.bProgramInterfaceSupported) {
- GL_CALL_EXTRA_FUNCTION(glGetProgramResourceName(programID, GL_SHADER_STORAGE_BLOCK, id, nameBufSize,
- length, nameBuf));
-
- if (*length > 0) {
-#define QUERY_COUNT 3
- GLsizei actualCount;
- GLenum props[QUERY_COUNT] = { GL_BUFFER_BINDING, GL_BUFFER_DATA_SIZE,
- GL_NUM_ACTIVE_VARIABLES };
- GLint params[QUERY_COUNT];
- GL_CALL_EXTRA_FUNCTION(glGetProgramResourceiv(programID, GL_SHADER_STORAGE_BLOCK, id,
- QUERY_COUNT, props, QUERY_COUNT, &actualCount,
- params));
-
- QT3DS_ASSERT(actualCount == QUERY_COUNT);
-
- bufferIndex = params[0];
- *bufferSize = params[1];
- *paramCount = params[2];
- }
- }
-#endif
- return bufferIndex;
- }
-
- void NVRenderBackendGL4Impl::ProgramSetStorageBuffer(QT3DSU32 index,
- NVRenderBackendBufferObject bo)
- {
-#if defined(GL_VERSION_4_3) || defined (QT_OPENGL_ES_3_1)
- GL_CALL_EXTRA_FUNCTION(
- glBindBufferBase(GL_SHADER_STORAGE_BUFFER, index, HandleToID_cast(GLuint, size_t, bo)));
-#endif
- }
-
- QT3DSI32 NVRenderBackendGL4Impl::GetAtomicCounterBufferCount(NVRenderBackendShaderProgramObject po)
- {
- GLint numAtomicCounterBuffers = 0;
- QT3DS_ASSERT(po);
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-#if defined(GL_VERSION_4_3) || defined (QT_OPENGL_ES_3_1)
- if (m_backendSupport.caps.bits.bProgramInterfaceSupported)
- GL_CALL_EXTRA_FUNCTION(glGetProgramInterfaceiv(programID, GL_ATOMIC_COUNTER_BUFFER,
- GL_ACTIVE_RESOURCES, &numAtomicCounterBuffers));
-#endif
- return numAtomicCounterBuffers;
- }
-
- QT3DSI32
- NVRenderBackendGL4Impl::GetAtomicCounterBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize,
- QT3DSI32 *paramCount, QT3DSI32 *bufferSize,
- QT3DSI32 *length, char *nameBuf)
- {
- GLint bufferIndex = GL_INVALID_INDEX;
-
- QT3DS_ASSERT(po);
- QT3DS_ASSERT(length);
- QT3DS_ASSERT(nameBuf);
- QT3DS_ASSERT(bufferSize);
- QT3DS_ASSERT(paramCount);
-
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-#if defined(GL_VERSION_4_3) || defined (QT_OPENGL_ES_3_1)
- if (m_backendSupport.caps.bits.bProgramInterfaceSupported) {
- {
-#define QUERY_COUNT 3
- GLsizei actualCount;
- GLenum props[QUERY_COUNT] = { GL_BUFFER_BINDING, GL_BUFFER_DATA_SIZE,
- GL_NUM_ACTIVE_VARIABLES };
- GLint params[QUERY_COUNT];
- GL_CALL_EXTRA_FUNCTION(glGetProgramResourceiv(programID, GL_ATOMIC_COUNTER_BUFFER, id,
- QUERY_COUNT, props, QUERY_COUNT, &actualCount,
- params));
-
- QT3DS_ASSERT(actualCount == QUERY_COUNT);
-
- bufferIndex = params[0];
- *bufferSize = params[1];
- *paramCount = params[2];
-
- GLenum props1[1] = { GL_ATOMIC_COUNTER_BUFFER_INDEX };
- GL_CALL_EXTRA_FUNCTION(glGetProgramResourceiv(programID, GL_UNIFORM, id, 1, props1, 1,
- &actualCount, params));
-
- QT3DS_ASSERT(actualCount == 1);
-
- *nameBuf = '\0';
- GL_CALL_EXTRA_FUNCTION(glGetProgramResourceName(programID, GL_UNIFORM, params[0], nameBufSize,
- length, nameBuf));
- }
- }
-#endif
- return bufferIndex;
- }
-
- void NVRenderBackendGL4Impl::ProgramSetAtomicCounterBuffer(QT3DSU32 index,
- NVRenderBackendBufferObject bo)
- {
-#if defined(GL_VERSION_4_3) || defined (QT_OPENGL_ES_3_1)
- GL_CALL_EXTRA_FUNCTION(
- glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, index, HandleToID_cast(GLuint, size_t, bo)));
-#endif
- }
-
- void NVRenderBackendGL4Impl::SetConstantValue(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count,
- const void *value, bool transpose)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GLenum glType = m_Conversion.fromPropertyDataTypesToShaderGL(type);
-
- switch (glType) {
- case GL_FLOAT:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform1fv(programID, id, count, (GLfloat *)value));
- break;
- case GL_FLOAT_VEC2:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform2fv(programID, id, count, (GLfloat *)value));
- break;
- case GL_FLOAT_VEC3:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform3fv(programID, id, count, (GLfloat *)value));
- break;
- case GL_FLOAT_VEC4:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform4fv(programID, id, count, (GLfloat *)value));
- break;
- case GL_INT:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform1iv(programID, id, count, (GLint *)value));
- break;
- case GL_BOOL:
- {
- GLint boolValue = *(GLboolean *)value;
- GL_CALL_EXTRA_FUNCTION(glProgramUniform1iv(programID, id, count, &boolValue));
- }
- break;
- case GL_INT_VEC2:
- case GL_BOOL_VEC2:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform2iv(programID, id, count, (GLint *)value));
- break;
- case GL_INT_VEC3:
- case GL_BOOL_VEC3:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform3iv(programID, id, count, (GLint *)value));
- break;
- case GL_INT_VEC4:
- case GL_BOOL_VEC4:
- GL_CALL_EXTRA_FUNCTION(glProgramUniform4iv(programID, id, count, (GLint *)value));
- break;
- case GL_FLOAT_MAT3:
- GL_CALL_EXTRA_FUNCTION(
- glProgramUniformMatrix3fv(programID, id, count, transpose, (GLfloat *)value));
- break;
- case GL_FLOAT_MAT4:
- GL_CALL_EXTRA_FUNCTION(
- glProgramUniformMatrix4fv(programID, id, count, transpose, (GLfloat *)value));
- break;
- case GL_IMAGE_2D:
- case GL_SAMPLER_2D:
- case GL_SAMPLER_2D_ARRAY:
- case GL_SAMPLER_2D_SHADOW:
- case GL_SAMPLER_CUBE: {
- if (count <= 1) {
- GLint sampler = *(GLint *)value;
- GL_CALL_EXTRA_FUNCTION(glProgramUniform1i(programID, id, sampler));
- } else {
- GLint *sampler = (GLint *)value;
- GL_CALL_EXTRA_FUNCTION(glProgramUniform1iv(programID, id, count, sampler));
- }
- } break;
- default:
- qCCritical(INTERNAL_ERROR, "Unknown shader type format %d", type);
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- NVRenderBackend::NVRenderBackendComputeShaderObject
- NVRenderBackendGL4Impl::CreateComputeShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- GLuint shaderID = 0;
-#if defined(GL_COMPUTE_SHADER)
- shaderID = m_glExtraFunctions->glCreateShader(GL_COMPUTE_SHADER);
-
- if (shaderID && !compileSource(shaderID, source, errorMessage, binary)) {
- GL_CALL_EXTRA_FUNCTION(glDeleteShader(shaderID));
- shaderID = 0;
- }
-#endif
- return (NVRenderBackend::NVRenderBackendComputeShaderObject)shaderID;
- }
-
- void NVRenderBackendGL4Impl::DispatchCompute(NVRenderBackendShaderProgramObject,
- QT3DSU32 numGroupsX, QT3DSU32 numGroupsY,
- QT3DSU32 numGroupsZ)
- {
- GL_CALL_EXTRA_FUNCTION(glDispatchCompute(numGroupsX, numGroupsY, numGroupsZ));
- }
-
- NVRenderBackend::NVRenderBackendProgramPipeline NVRenderBackendGL4Impl::CreateProgramPipeline()
- {
- GLuint pipeline;
- GL_CALL_EXTRA_FUNCTION(glGenProgramPipelines(1, &pipeline));
-
- return NVRenderBackend::NVRenderBackendProgramPipeline(pipeline);
- }
-
- void NVRenderBackendGL4Impl::ReleaseProgramPipeline(NVRenderBackendProgramPipeline ppo)
- {
- GLuint pipeline = HandleToID_cast(GLuint, size_t, ppo);
- GL_CALL_EXTRA_FUNCTION(glDeleteProgramPipelines(1, &pipeline));
- }
-
- void NVRenderBackendGL4Impl::SetActiveProgramPipeline(NVRenderBackendProgramPipeline ppo)
- {
- GLuint pipeline = HandleToID_cast(GLuint, size_t, ppo);
-
- GL_CALL_EXTRA_FUNCTION(glBindProgramPipeline(pipeline));
- }
-
- void NVRenderBackendGL4Impl::SetProgramStages(NVRenderBackendProgramPipeline ppo,
- NVRenderShaderTypeFlags flags,
- NVRenderBackendShaderProgramObject po)
- {
- GLuint pipeline = HandleToID_cast(GLuint, size_t, ppo);
- GLuint programID = 0;
-
- if (po) {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- programID = static_cast<GLuint>(pProgram->m_ProgramID);
- }
-
- GL_CALL_EXTRA_FUNCTION(
- glUseProgramStages(pipeline, m_Conversion.fromShaderTypeFlagsToGL(flags), programID));
- }
-
- void NVRenderBackendGL4Impl::SetBlendEquation(const NVRenderBlendEquationArgument &pBlendEquArg)
- {
- if (m_backendSupport.caps.bits.bNVAdvancedBlendSupported ||
- m_backendSupport.caps.bits.bKHRAdvancedBlendSupported)
- GL_CALL_EXTRA_FUNCTION(glBlendEquation(m_Conversion.fromBlendEquationToGL(
- pBlendEquArg.m_RGBEquation, m_backendSupport.caps.bits.bNVAdvancedBlendSupported,
- m_backendSupport.caps.bits.bKHRAdvancedBlendSupported)));
- }
-
- void NVRenderBackendGL4Impl::SetBlendBarrier(void)
- {
- if (m_backendSupport.caps.bits.bNVAdvancedBlendSupported)
- GL_CALL_QT3DS_EXT(glBlendBarrierNV());
- }
-
- NVRenderBackend::NVRenderBackendPathObject
- NVRenderBackendGL4Impl::CreatePathNVObject(size_t range)
- {
- GLuint pathID = GL_CALL_NVPATH_EXT(glGenPathsNV((GLsizei)range));
-
- return NVRenderBackend::NVRenderBackendPathObject(pathID);
- }
- void NVRenderBackendGL4Impl::SetPathSpecification(NVRenderBackendPathObject inPathObject,
- NVConstDataRef<QT3DSU8> inPathCommands,
- NVConstDataRef<QT3DSF32> inPathCoords)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, inPathObject);
- GL_CALL_NVPATH_EXT(glPathCommandsNV(pathID, inPathCommands.size(), inPathCommands.begin(),
- inPathCoords.size(), GL_FLOAT, inPathCoords.begin()));
- }
-
- NVBounds3
- NVRenderBackendGL4Impl::GetPathObjectBoundingBox(NVRenderBackendPathObject inPathObject)
- {
- float data[4];
-#if defined(GL_NV_path_rendering)
- GL_CALL_NVPATH_EXT(glGetPathParameterfvNV(
- HandleToID_cast(GLuint, size_t, inPathObject),
- GL_PATH_OBJECT_BOUNDING_BOX_NV, data));
-#endif
- return NVBounds3(QT3DSVec3(data[0], data[1], 0.0f), QT3DSVec3(data[2], data[3], 0.0f));
- }
-
- NVBounds3 NVRenderBackendGL4Impl::GetPathObjectFillBox(NVRenderBackendPathObject inPathObject)
- {
- float data[4];
-#if defined(GL_NV_path_rendering)
- GL_CALL_NVPATH_EXT(glGetPathParameterfvNV(
- HandleToID_cast(GLuint, size_t, inPathObject),
- GL_PATH_FILL_BOUNDING_BOX_NV, data));
-#endif
- return NVBounds3(QT3DSVec3(data[0], data[1], 0.0f), QT3DSVec3(data[2], data[3], 0.0f));
- }
-
- NVBounds3 NVRenderBackendGL4Impl::GetPathObjectStrokeBox(NVRenderBackendPathObject inPathObject)
- {
- float data[4];
-#if defined(GL_NV_path_rendering)
- GL_CALL_NVPATH_EXT(glGetPathParameterfvNV(
- HandleToID_cast(GLuint, size_t, inPathObject),
- GL_PATH_STROKE_BOUNDING_BOX_NV, data));
-#endif
- return NVBounds3(QT3DSVec3(data[0], data[1], 0.0f), QT3DSVec3(data[2], data[3], 0.0f));
- }
-
- void NVRenderBackendGL4Impl::SetStrokeWidth(NVRenderBackendPathObject inPathObject,
- QT3DSF32 inStrokeWidth)
- {
-#if defined(GL_NV_path_rendering)
- GL_CALL_NVPATH_EXT(glPathParameterfNV(HandleToID_cast(GLuint, size_t, inPathObject),
- GL_PATH_STROKE_WIDTH_NV, inStrokeWidth));
-#endif
- }
-
- void NVRenderBackendGL4Impl::SetPathProjectionMatrix(const QT3DSMat44 inPathProjection)
- {
-#if defined(QT_OPENGL_ES)
- NVRENDER_BACKEND_UNUSED(inPathProjection);
-#else
- GL_CALL_DIRECTSTATE_EXT(glMatrixLoadfEXT(GL_PROJECTION, inPathProjection.front()));
-#endif
- }
-
- void NVRenderBackendGL4Impl::SetPathModelViewMatrix(const QT3DSMat44 inPathModelview)
- {
-#if defined(QT_OPENGL_ES)
- NVRENDER_BACKEND_UNUSED(inPathModelview);
-#else
- GL_CALL_DIRECTSTATE_EXT(glMatrixLoadfEXT(GL_MODELVIEW, inPathModelview.front()));
-#endif
- }
-
- void NVRenderBackendGL4Impl::SetPathStencilDepthOffset(QT3DSF32 inSlope, QT3DSF32 inBias)
- {
- GL_CALL_NVPATH_EXT(glPathStencilDepthOffsetNV(inSlope, inBias));
- }
-
- void NVRenderBackendGL4Impl::SetPathCoverDepthFunc(NVRenderBoolOp::Enum inDepthFunction)
- {
- GL_CALL_NVPATH_EXT(glPathCoverDepthFuncNV(m_Conversion.fromBoolOpToGL(inDepthFunction)));
- }
-
- void NVRenderBackendGL4Impl::StencilStrokePath(NVRenderBackendPathObject inPathObject)
- {
- GL_CALL_NVPATH_EXT(glStencilStrokePathNV(HandleToID_cast(GLuint, size_t, inPathObject), 0x1, (GLuint)~0));
- }
-
- void NVRenderBackendGL4Impl::StencilFillPath(NVRenderBackendPathObject inPathObject)
- {
-#if defined(GL_NV_path_rendering)
- GL_CALL_NVPATH_EXT(glStencilFillPathNV(HandleToID_cast(GLuint, size_t, inPathObject),
- GL_COUNT_UP_NV, (GLuint)~0));
-#endif
- }
-
- void NVRenderBackendGL4Impl::ReleasePathNVObject(NVRenderBackendPathObject po, size_t range)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glDeletePathsNV(pathID, (GLsizei)range));
- }
-
- void NVRenderBackendGL4Impl::StencilFillPathInstanced(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathFormatType::Enum type,
- const void *charCodes, NVRenderPathFillMode::Enum fillMode, QT3DSU32 stencilMask,
- NVRenderPathTransformType::Enum transformType, const QT3DSF32 *transformValues)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glStencilFillPathInstancedNV(
- (GLsizei)numPaths, m_Conversion.fromPathTypeToGL(type), charCodes, pathID,
- m_Conversion.fromPathFillModeToGL(fillMode), stencilMask,
- m_Conversion.fromPathTransformToGL(transformType), transformValues));
- }
-
- void NVRenderBackendGL4Impl::StencilStrokePathInstancedN(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathFormatType::Enum type,
- const void *charCodes, QT3DSI32 stencilRef, QT3DSU32 stencilMask,
- NVRenderPathTransformType::Enum transformType, const QT3DSF32 *transformValues)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glStencilStrokePathInstancedNV(
- (GLsizei)numPaths, m_Conversion.fromPathTypeToGL(type), charCodes, pathID, stencilRef,
- stencilMask, m_Conversion.fromPathTransformToGL(transformType), transformValues));
- }
-
- void NVRenderBackendGL4Impl::CoverFillPathInstanced(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathFormatType::Enum type,
- const void *charCodes, NVRenderPathCoverMode::Enum coverMode,
- NVRenderPathTransformType::Enum transformType, const QT3DSF32 *transformValues)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glCoverFillPathInstancedNV(
- (GLsizei)numPaths, m_Conversion.fromPathTypeToGL(type), charCodes, pathID,
- m_Conversion.fromPathCoverModeToGL(coverMode),
- m_Conversion.fromPathTransformToGL(transformType), transformValues));
- }
-
- void NVRenderBackendGL4Impl::CoverStrokePathInstanced(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathFormatType::Enum type,
- const void *charCodes, NVRenderPathCoverMode::Enum coverMode,
- NVRenderPathTransformType::Enum transformType, const QT3DSF32 *transformValues)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glCoverStrokePathInstancedNV(
- (GLsizei)numPaths, m_Conversion.fromPathTypeToGL(type), charCodes, pathID,
- m_Conversion.fromPathCoverModeToGL(coverMode),
- m_Conversion.fromPathTransformToGL(transformType), transformValues));
- }
-
- void NVRenderBackendGL4Impl::LoadPathGlyphs(
- NVRenderBackendPathObject po, NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle, size_t numGlyphs, NVRenderPathFormatType::Enum type,
- const void *charCodes, NVRenderPathMissingGlyphs::Enum handleMissingGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
- GLuint pathTemplateID = (pathParameterTemplate == NULL)
- ? ~0
- : HandleToID_cast(GLuint, size_t, pathParameterTemplate);
-
- GL_CALL_NVPATH_EXT(glPathGlyphsNV(pathID, m_Conversion.fromPathFontTargetToGL(fontTarget), fontName,
- m_Conversion.fromPathFontStyleToGL(fontStyle), (GLsizei)numGlyphs,
- m_Conversion.fromPathTypeToGL(type), charCodes,
- m_Conversion.fromPathMissingGlyphsToGL(handleMissingGlyphs),
- pathTemplateID, emScale));
- }
-
- NVRenderPathReturnValues::Enum NVRenderBackendGL4Impl::LoadPathGlyphsIndexed(
- NVRenderBackendPathObject po, NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle, QT3DSU32 firstGlyphIndex, size_t numGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
- GLuint pathTemplateID = (pathParameterTemplate == NULL)
- ? ~0
- : HandleToID_cast(GLuint, size_t, pathParameterTemplate);
- GLenum glRet = 0;
-
- glRet = GL_CALL_QT3DS_EXT(glPathGlyphIndexArrayNV(
- pathID, m_Conversion.fromPathFontTargetToGL(fontTarget), fontName,
- m_Conversion.fromPathFontStyleToGL(fontStyle), firstGlyphIndex,
- (GLsizei)numGlyphs, pathTemplateID, emScale));
-
- return m_Conversion.fromGLToPathFontReturn(glRet);
- }
-
- NVRenderBackend::NVRenderBackendPathObject NVRenderBackendGL4Impl::LoadPathGlyphsIndexedRange(
- NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle, NVRenderBackendPathObject pathParameterTemplate,
- QT3DSF32 emScale, QT3DSU32 *count)
- {
- GLuint pathTemplateID = (pathParameterTemplate == NULL)
- ? ~0
- : HandleToID_cast(GLuint, size_t, pathParameterTemplate);
- GLenum glRet = 0;
- GLuint baseAndCount[2] = { 0, 0 };
-
- glRet = GL_CALL_QT3DS_EXT(glPathGlyphIndexRangeNV(m_Conversion.fromPathFontTargetToGL(fontTarget),
- fontName,
- m_Conversion.fromPathFontStyleToGL(fontStyle),
- pathTemplateID, emScale, baseAndCount));
-
- if (count)
- *count = baseAndCount[1];
-
- return NVRenderBackend::NVRenderBackendPathObject(baseAndCount[0]);
- }
-
- void NVRenderBackendGL4Impl::LoadPathGlyphRange(
- NVRenderBackendPathObject po, NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle, QT3DSU32 firstGlyph, size_t numGlyphs,
- NVRenderPathMissingGlyphs::Enum handleMissingGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
- GLuint pathTemplateID = (pathParameterTemplate == NULL)
- ? ~0
- : HandleToID_cast(GLuint, size_t, pathParameterTemplate);
-
- GL_CALL_NVPATH_EXT(glPathGlyphRangeNV(
- pathID, m_Conversion.fromPathFontTargetToGL(fontTarget), fontName,
- m_Conversion.fromPathFontStyleToGL(fontStyle), firstGlyph, (GLsizei)numGlyphs,
- m_Conversion.fromPathMissingGlyphsToGL(handleMissingGlyphs), pathTemplateID, emScale));
- }
-
- void NVRenderBackendGL4Impl::GetPathMetrics(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathGlyphFontMetricFlags metricQueryMask,
- NVRenderPathFormatType::Enum type,
- const void *charCodes, size_t stride,
- QT3DSF32 *metrics)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glGetPathMetricsNV(m_Conversion.fromPathMetricQueryFlagsToGL(metricQueryMask),
- (GLsizei)numPaths, m_Conversion.fromPathTypeToGL(type),
- charCodes, pathID, (GLsizei)stride, metrics));
- }
-
- void
- NVRenderBackendGL4Impl::GetPathMetricsRange(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathGlyphFontMetricFlags metricQueryMask,
- size_t stride, QT3DSF32 *metrics)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glGetPathMetricRangeNV(m_Conversion.fromPathMetricQueryFlagsToGL(metricQueryMask),
- pathID, (GLsizei)numPaths, (GLsizei)stride, metrics));
- }
-
- void NVRenderBackendGL4Impl::GetPathSpacing(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathListMode::Enum pathListMode,
- NVRenderPathFormatType::Enum type, const void *charCodes, QT3DSF32 advanceScale,
- QT3DSF32 kerningScale, NVRenderPathTransformType::Enum transformType, QT3DSF32 *spacing)
- {
- GLuint pathID = HandleToID_cast(GLuint, size_t, po);
-
- GL_CALL_NVPATH_EXT(glGetPathSpacingNV(m_Conversion.fromPathListModeToGL(pathListMode),
- (GLsizei)numPaths, m_Conversion.fromPathTypeToGL(type),
- charCodes, pathID, advanceScale, kerningScale,
- m_Conversion.fromPathTransformToGL(transformType), spacing));
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.h
deleted file mode 100644
index bfdc03b7..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGL4.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_GL4_H
-#define QT3DS_RENDER_BACKEND_GL4_H
-
-/// @file Qt3DSRenderBackendGL4.h
-/// NVRender OpenGL 4 backend definition.
-
-#include "foundation/Qt3DSAtomic.h"
-#include "render/backends/gl/Qt3DSRenderBackendGL3.h"
-
-namespace qt3ds {
-namespace render {
-
- using namespace foundation;
-
- class NVRenderBackendGL4Impl : public NVRenderBackendGL3Impl
- {
- public:
- /// constructor
- NVRenderBackendGL4Impl(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format);
- /// destructor
- virtual ~NVRenderBackendGL4Impl();
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- public:
- void DrawIndirect(NVRenderDrawMode::Enum drawMode, const void *indirect) override;
- void DrawIndexedIndirect(NVRenderDrawMode::Enum drawMode,
- NVRenderComponentTypes::Enum type, const void *indirect) override;
-
- void CreateTextureStorage2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 levels,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height) override;
-
- void SetMultisampledTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- size_t samples,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height,
- bool fixedsamplelocations) override;
-
- void SetConstantValue(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count, const void *value,
- bool transpose) override;
-
- void SetPatchVertexCount(NVRenderBackendInputAssemblerObject iao, QT3DSU32 count) override;
- virtual NVRenderBackendTessControlShaderObject
- CreateTessControlShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) override;
- virtual NVRenderBackendTessEvaluationShaderObject
- CreateTessEvaluationShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) override;
- virtual NVRenderBackendGeometryShaderObject
- CreateGeometryShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage, bool binary) override;
-
- QT3DSI32 GetStorageBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetStorageBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length, char *nameBuf) override;
- void ProgramSetStorageBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- QT3DSI32 GetAtomicCounterBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetAtomicCounterBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf) override;
- void ProgramSetAtomicCounterBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- void SetMemoryBarrier(NVRenderBufferBarrierFlags barriers) override;
- void BindImageTexture(NVRenderBackendTextureObject to, QT3DSU32 unit, QT3DSI32 level,
- bool layered, QT3DSI32 layer,
- NVRenderImageAccessType::Enum access,
- NVRenderTextureFormats::Enum format) override;
-
- virtual NVRenderBackendComputeShaderObject
- CreateComputeShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage, bool binary) override;
- void DispatchCompute(NVRenderBackendShaderProgramObject po, QT3DSU32 numGroupsX,
- QT3DSU32 numGroupsY, QT3DSU32 numGroupsZ) override;
-
- NVRenderBackendProgramPipeline CreateProgramPipeline() override;
- void ReleaseProgramPipeline(NVRenderBackendProgramPipeline ppo) override;
- void SetActiveProgramPipeline(NVRenderBackendProgramPipeline ppo) override;
- void SetProgramStages(NVRenderBackendProgramPipeline ppo,
- NVRenderShaderTypeFlags flags,
- NVRenderBackendShaderProgramObject po) override;
-
- void SetBlendEquation(const NVRenderBlendEquationArgument &pBlendEquArg) override;
- void SetBlendBarrier(void) override;
-
- NVRenderBackendPathObject CreatePathNVObject(size_t range) override;
- void SetPathSpecification(NVRenderBackendPathObject inPathObject,
- NVConstDataRef<QT3DSU8> inPathCommands,
- NVConstDataRef<QT3DSF32> inPathCoords) override;
- NVBounds3 GetPathObjectBoundingBox(NVRenderBackendPathObject inPathObject) override;
- NVBounds3 GetPathObjectFillBox(NVRenderBackendPathObject inPathObject) override;
- NVBounds3 GetPathObjectStrokeBox(NVRenderBackendPathObject inPathObject) override;
- void SetStrokeWidth(NVRenderBackendPathObject inPathObject, QT3DSF32 inStrokeWidth) override;
-
- void SetPathProjectionMatrix(const QT3DSMat44 inPathProjection) override;
- void SetPathModelViewMatrix(const QT3DSMat44 inPathModelview) override;
- void SetPathStencilDepthOffset(QT3DSF32 inSlope, QT3DSF32 inBias) override;
- void SetPathCoverDepthFunc(NVRenderBoolOp::Enum inDepthFunction) override;
- void StencilStrokePath(NVRenderBackendPathObject inPathObject) override;
- void StencilFillPath(NVRenderBackendPathObject inPathObject) override;
- void ReleasePathNVObject(NVRenderBackendPathObject po, size_t range) override;
-
- void StencilFillPathInstanced(
- NVRenderBackendPathObject po, size_t numPaths, NVRenderPathFormatType::Enum type,
- const void *charCodes, NVRenderPathFillMode::Enum fillMode, QT3DSU32 stencilMask,
- NVRenderPathTransformType::Enum transformType, const QT3DSF32 *transformValues) override;
- void StencilStrokePathInstancedN(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathFormatType::Enum type,
- const void *charCodes, QT3DSI32 stencilRef,
- QT3DSU32 stencilMask,
- NVRenderPathTransformType::Enum transformType,
- const QT3DSF32 *transformValues) override;
- void CoverFillPathInstanced(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathFormatType::Enum type,
- const void *charCodes,
- NVRenderPathCoverMode::Enum coverMode,
- NVRenderPathTransformType::Enum transformType,
- const QT3DSF32 *transformValues) override;
- void CoverStrokePathInstanced(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathFormatType::Enum type,
- const void *charCodes,
- NVRenderPathCoverMode::Enum coverMode,
- NVRenderPathTransformType::Enum transformType,
- const QT3DSF32 *transformValues) override;
- void LoadPathGlyphs(NVRenderBackendPathObject po,
- NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle, size_t numGlyphs,
- NVRenderPathFormatType::Enum type, const void *charCodes,
- NVRenderPathMissingGlyphs::Enum handleMissingGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale) override;
- virtual NVRenderPathReturnValues::Enum
- LoadPathGlyphsIndexed(NVRenderBackendPathObject po, NVRenderPathFontTarget::Enum fontTarget,
- const void *fontName, NVRenderPathFontStyleFlags fontStyle,
- QT3DSU32 firstGlyphIndex, size_t numGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale) override;
- virtual NVRenderBackendPathObject
- LoadPathGlyphsIndexedRange(NVRenderPathFontTarget::Enum fontTarget, const void *fontName,
- NVRenderPathFontStyleFlags fontStyle,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale,
- QT3DSU32 *count) override;
- void LoadPathGlyphRange(NVRenderBackendPathObject po,
- NVRenderPathFontTarget::Enum fontTarget,
- const void *fontName, NVRenderPathFontStyleFlags fontStyle,
- QT3DSU32 firstGlyph, size_t numGlyphs,
- NVRenderPathMissingGlyphs::Enum handleMissingGlyphs,
- NVRenderBackendPathObject pathParameterTemplate,
- QT3DSF32 emScale) override;
- void GetPathMetrics(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathGlyphFontMetricFlags metricQueryMask,
- NVRenderPathFormatType::Enum type, const void *charCodes,
- size_t stride, QT3DSF32 *metrics) override;
- void GetPathMetricsRange(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathGlyphFontMetricFlags metricQueryMask,
- size_t stride, QT3DSF32 *metrics) override;
- void GetPathSpacing(NVRenderBackendPathObject po, size_t numPaths,
- NVRenderPathListMode::Enum pathListMode,
- NVRenderPathFormatType::Enum type, const void *charCodes,
- QT3DSF32 advanceScale, QT3DSF32 kerningScale,
- NVRenderPathTransformType::Enum transformType, QT3DSF32 *spacing) override;
- private:
-#if !defined(QT_OPENGL_ES)
- QOpenGLExtension_NV_path_rendering *m_nvPathRendering;
- QOpenGLExtension_EXT_direct_state_access *m_directStateAccess;
-#endif
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.cpp b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.cpp
deleted file mode 100644
index ba25ae7e..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.cpp
+++ /dev/null
@@ -1,2223 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render/backends/gl/Qt3DSRenderBackendGLBase.h"
-#include "render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h"
-#include "render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h"
-#include "foundation/StringTable.h"
-
-#ifdef RENDER_BACKEND_LOG_GL_ERRORS
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError(#x, __FILE__, __LINE__)
-#else
-#define RENDER_LOG_ERROR_PARAMS(x) checkGLError()
-#endif
-
-#define GL_CALL_FUNCTION(x) m_glFunctions->x; RENDER_LOG_ERROR_PARAMS(x);
-#define GL_CALL_EXTRA_FUNCTION(x) m_glExtraFunctions->x; RENDER_LOG_ERROR_PARAMS(x);
-
-namespace qt3ds {
-namespace render {
-
-#ifndef GL_PROGRAM_SEPARABLE
-#define GL_PROGRAM_SEPARABLE 0x8258
-#endif
-
-#ifndef GL_UNSIGNED_INT_IMAGE_2D
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#endif
-
-#ifndef GL_UNSIGNED_INT_ATOMIC_COUNTER
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#endif
-
- /// constructor
- NVRenderBackendGLBase::NVRenderBackendGLBase(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format)
- : mRefCount(0)
- , m_Foundation(fnd)
- , m_StringTable(stringTable)
- , m_Conversion()
- , m_MaxAttribCount(0)
- , m_DrawBuffersArray(m_Foundation.getAllocator(),
- "NVRenderBackendGLBase::m_DrawBuffersArray")
- , m_format(format)
- {
- m_glFunctions = new QOpenGLFunctions;
- m_glFunctions->initializeOpenGLFunctions();
- m_glExtraFunctions = new QOpenGLExtraFunctions;
- m_glExtraFunctions->initializeOpenGLFunctions();
-
- // internal state tracker
- m_pCurrentRasterizerState =
- QT3DS_NEW(m_Foundation.getAllocator(), NVRenderBackendRasterizerStateGL)();
- m_pCurrentDepthStencilState =
- QT3DS_NEW(m_Foundation.getAllocator(), NVRenderBackendDepthStencilStateGL)();
-
- m_glFunctions->glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &m_maxAnisotropy);
- }
- /// destructor
- NVRenderBackendGLBase::~NVRenderBackendGLBase()
- {
- if (m_pCurrentRasterizerState)
- NVDelete(m_Foundation.getAllocator(), m_pCurrentRasterizerState);
- if (m_pCurrentDepthStencilState)
- NVDelete(m_Foundation.getAllocator(), m_pCurrentDepthStencilState);
- if (m_glFunctions)
- delete m_glFunctions;
- if (m_glExtraFunctions)
- delete m_glExtraFunctions;
- }
-
- NVRenderContextType NVRenderBackendGLBase::GetRenderContextType() const
- {
- if (m_format.renderableType() == QSurfaceFormat::OpenGLES) {
- if (m_format.majorVersion() == 2)
- return NVRenderContextValues::GLES2;
-
- if (m_format.majorVersion() == 3) {
- if (m_format.minorVersion() >= 1)
- return NVRenderContextValues::GLES3PLUS;
- else
- return NVRenderContextValues::GLES3;
- }
- } else if (m_format.majorVersion() == 2) {
- return NVRenderContextValues::GL2;
- } else if (m_format.majorVersion() == 3) {
- return NVRenderContextValues::GL3;
- } else if (m_format.majorVersion() == 4) {
- return NVRenderContextValues::GL4;
- }
-
- return NVRenderContextValues::NullContext;
- }
-
- bool NVRenderBackendGLBase::isESCompatible() const
- {
- return m_format.renderableType() == QSurfaceFormat::OpenGLES;
- }
-
- const char *NVRenderBackendGLBase::GetShadingLanguageVersion()
- {
- const char *retval = (const char *)GL_CALL_FUNCTION(
- glGetString(GL_SHADING_LANGUAGE_VERSION));
- if (retval == NULL)
- return "";
-
- return retval;
- }
-
- QT3DSU32
- NVRenderBackendGLBase::GetMaxCombinedTextureUnits()
- {
- QT3DSI32 maxUnits;
- GL_CALL_FUNCTION(glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxUnits));
- return maxUnits;
- }
-
- bool NVRenderBackendGLBase::GetRenderBackendCap(
- NVRenderBackend::NVRenderBackendCaps::Enum inCap) const
- {
- bool bSupported = false;
-
- switch (inCap) {
- case NVRenderBackendCaps::FpRenderTarget:
- bSupported = m_backendSupport.caps.bits.bFPRenderTargetsSupported;
- break;
- case NVRenderBackendCaps::DepthStencilTexture:
- bSupported = m_backendSupport.caps.bits.bDepthStencilSupported;
- break;
- case NVRenderBackendCaps::ConstantBuffer:
- bSupported = m_backendSupport.caps.bits.bConstantBufferSupported;
- break;
- case NVRenderBackendCaps::DxtImages:
- bSupported = m_backendSupport.caps.bits.bDXTImagesSupported;
- break;
- case NVRenderBackendCaps::MsTexture:
- bSupported = m_backendSupport.caps.bits.bMsTextureSupported;
- break;
- case NVRenderBackendCaps::TexSwizzle:
- bSupported = m_backendSupport.caps.bits.bTextureSwizzleSupported;
- break;
- case NVRenderBackendCaps::FastBlits:
- bSupported = m_backendSupport.caps.bits.bFastBlitsSupported;
- break;
- case NVRenderBackendCaps::Tessellation:
- bSupported = m_backendSupport.caps.bits.bTessellationSupported;
- break;
- case NVRenderBackendCaps::Compute:
- bSupported = m_backendSupport.caps.bits.bComputeSupported;
- break;
- case NVRenderBackendCaps::Geometry:
- bSupported = m_backendSupport.caps.bits.bGeometrySupported;
- break;
- case NVRenderBackendCaps::SampleQuery: {
- // On the following context sample query is not supported
- NVRenderContextType noSamplesQuerySupportedContextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
- NVRenderContextType ctxType = GetRenderContextType();
- bSupported = !(ctxType & noSamplesQuerySupportedContextFlags);
- } break;
- case NVRenderBackendCaps::TimerQuery:
- bSupported = m_backendSupport.caps.bits.bTimerQuerySupported;
- break;
- case NVRenderBackendCaps::CommandSync: {
- // On the following context sync objects are not supported
- NVRenderContextType noSyncObjectSupportedContextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
- NVRenderContextType ctxType = GetRenderContextType();
- bSupported = !(ctxType & noSyncObjectSupportedContextFlags);
- } break;
- case NVRenderBackendCaps::TextureArray: {
- // On the following context texture arrays are not supported
- NVRenderContextType noTextureArraySupportedContextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
- NVRenderContextType ctxType = GetRenderContextType();
- bSupported = !(ctxType & noTextureArraySupportedContextFlags);
- } break;
- case NVRenderBackendCaps::StorageBuffer:
- bSupported = m_backendSupport.caps.bits.bStorageBufferSupported;
- break;
- case NVRenderBackendCaps::AtomicCounterBuffer:
- bSupported = m_backendSupport.caps.bits.bAtomicCounterBufferSupported;
- break;
- case NVRenderBackendCaps::ShaderImageLoadStore:
- bSupported = m_backendSupport.caps.bits.bShaderImageLoadStoreSupported;
- break;
- case NVRenderBackendCaps::ProgramPipeline:
- bSupported = m_backendSupport.caps.bits.bProgramPipelineSupported;
- break;
- case NVRenderBackendCaps::PathRendering:
- bSupported = m_backendSupport.caps.bits.bNVPathRenderingSupported;
- break;
- case NVRenderBackendCaps::AdvancedBlend:
- bSupported = m_backendSupport.caps.bits.bNVAdvancedBlendSupported |
- m_backendSupport.caps.bits.bKHRAdvancedBlendSupported;
- break;
- case NVRenderBackendCaps::AdvancedBlendKHR:
- bSupported = m_backendSupport.caps.bits.bKHRAdvancedBlendSupported;
- break;
- case NVRenderBackendCaps::BlendCoherency:
- bSupported = m_backendSupport.caps.bits.bNVBlendCoherenceSupported |
- m_backendSupport.caps.bits.bKHRBlendCoherenceSupported;
- break;
- case NVRenderBackendCaps::gpuShader5:
- bSupported = m_backendSupport.caps.bits.bGPUShader5ExtensionSupported;
- break;
- case NVRenderBackendCaps::VertexArrayObject:
- bSupported = m_backendSupport.caps.bits.bVertexArrayObjectSupported;
- break;
- case NVRenderBackendCaps::StandardDerivatives:
- bSupported = m_backendSupport.caps.bits.bStandardDerivativesSupported;
- break;
- case NVRenderBackendCaps::TextureLod:
- bSupported = m_backendSupport.caps.bits.bTextureLodSupported;
- break;
- default:
- QT3DS_ASSERT(false);
- bSupported = false;
- break;
- }
-
- return bSupported;
- }
-
- void NVRenderBackendGLBase::GetRenderBackendValue(NVRenderBackendQuery::Enum inQuery,
- QT3DSI32 *params) const
- {
- if (params) {
- switch (inQuery) {
- case NVRenderBackendQuery::MaxTextureSize:
- GL_CALL_FUNCTION(glGetIntegerv(GL_MAX_TEXTURE_SIZE, params));
- break;
- case NVRenderBackendQuery::MaxTextureArrayLayers: {
- NVRenderContextType noTextureArraySupportedContextFlags(
- NVRenderContextValues::GL2 | NVRenderContextValues::GLES2);
- NVRenderContextType ctxType = GetRenderContextType();
- if (!(ctxType & noTextureArraySupportedContextFlags)) {
- GL_CALL_FUNCTION(glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, params));
- } else {
- *params = 0;
- }
- } break;
- case NVRenderBackendQuery::MaxConstantBufferSlots: {
- NVRenderContextType noConstantBufferSupportedContextFlags(
- NVRenderContextValues::GL2 | NVRenderContextValues::GLES2);
- NVRenderContextType ctxType = GetRenderContextType();
- if (!(ctxType & noConstantBufferSupportedContextFlags)) {
- GL_CALL_FUNCTION(glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, params));
- } else {
- *params = 0;
- }
- } break;
- case NVRenderBackendQuery::MaxConstantBufferBlockSize: {
- NVRenderContextType noConstantBufferSupportedContextFlags(
- NVRenderContextValues::GL2 | NVRenderContextValues::GLES2);
- NVRenderContextType ctxType = GetRenderContextType();
- if (!(ctxType & noConstantBufferSupportedContextFlags)) {
- GL_CALL_FUNCTION(glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, params));
- } else {
- *params = 0;
- }
- } break;
- default:
- QT3DS_ASSERT(false);
- *params = 0;
- break;
- }
- }
- }
-
- QT3DSU32
- NVRenderBackendGLBase::GetDepthBits() const
- {
- QT3DSI32 depthBits;
- GL_CALL_FUNCTION(glGetIntegerv(GL_DEPTH_BITS, &depthBits));
- return depthBits;
- }
-
- QT3DSU32
- NVRenderBackendGLBase::GetStencilBits() const
- {
- QT3DSI32 stencilBits;
- GL_CALL_FUNCTION(glGetIntegerv(GL_STENCIL_BITS, &stencilBits));
- return stencilBits;
- }
-
- void NVRenderBackendGLBase::SetMultisample(bool bEnable)
- {
- QT3DS_ASSERT(m_backendSupport.caps.bits.bMsTextureSupported || !bEnable);
- // For GL ES explicit multisample enabling is not needed
- // and does not exist
- NVRenderContextType noMsaaEnableContextFlags(NVRenderContextValues::GLES2
- | NVRenderContextValues::GLES3
- | NVRenderContextValues::GLES3PLUS);
- NVRenderContextType ctxType = GetRenderContextType();
- if (!(ctxType & noMsaaEnableContextFlags)) {
- SetRenderState(bEnable, NVRenderState::Multisample);
- }
- }
-
- void NVRenderBackendGLBase::SetRenderState(bool bEnable, const NVRenderState::Enum value)
- {
- if (value == NVRenderState::DepthWrite) {
- GL_CALL_FUNCTION(glDepthMask(bEnable));
- } else {
- if (bEnable) {
- GL_CALL_FUNCTION(glEnable(m_Conversion.fromRenderStateToGL(value)));
- } else {
- GL_CALL_FUNCTION(glDisable(m_Conversion.fromRenderStateToGL(value)));
- }
- }
- }
-
- NVRenderBackend::NVRenderBackendDepthStencilStateObject
- NVRenderBackendGLBase::CreateDepthStencilState(
- bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc, bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack)
- {
- NVRenderBackendDepthStencilStateGL *retval =
- QT3DS_NEW(m_Foundation.getAllocator(), NVRenderBackendDepthStencilStateGL)(
- enableDepth, depthMask, depthFunc, enableStencil, stencilFuncFront, stencilFuncBack,
- depthStencilOpFront, depthStencilOpBack);
-
- return (NVRenderBackend::NVRenderBackendDepthStencilStateObject)retval;
- }
-
- void NVRenderBackendGLBase::ReleaseDepthStencilState(
- NVRenderBackendDepthStencilStateObject inDepthStencilState)
- {
- NVRenderBackendDepthStencilStateGL *inputState =
- (NVRenderBackendDepthStencilStateGL *)inDepthStencilState;
- if (inputState)
- NVDelete(m_Foundation.getAllocator(), inputState);
- }
-
- NVRenderBackend::NVRenderBackendRasterizerStateObject
- NVRenderBackendGLBase::CreateRasterizerState(QT3DSF32 depthBias, QT3DSF32 depthScale,
- NVRenderFaces::Enum cullFace)
- {
- NVRenderBackendRasterizerStateGL *retval =
- QT3DS_NEW(m_Foundation.getAllocator(),
- NVRenderBackendRasterizerStateGL)(depthBias, depthScale, cullFace);
-
- return (NVRenderBackend::NVRenderBackendRasterizerStateObject)retval;
- }
-
- void NVRenderBackendGLBase::ReleaseRasterizerState(
- NVRenderBackendRasterizerStateObject rasterizerState)
- {
- NVRenderBackendRasterizerStateGL *inputState =
- (NVRenderBackendRasterizerStateGL *)rasterizerState;
- if (inputState)
- NVDelete(m_Foundation.getAllocator(), inputState);
- }
-
- void NVRenderBackendGLBase::SetDepthStencilState(
- NVRenderBackendDepthStencilStateObject inDepthStencilState)
- {
- NVRenderBackendDepthStencilStateGL *inputState =
- (NVRenderBackendDepthStencilStateGL *)inDepthStencilState;
- if (inputState && !(*m_pCurrentDepthStencilState == *inputState)) {
- // we check on a per single state base
- if (inputState->m_DepthEnable != m_pCurrentDepthStencilState->m_DepthEnable) {
- SetRenderState(inputState->m_DepthEnable, NVRenderState::DepthTest);
- m_pCurrentDepthStencilState->m_DepthEnable = inputState->m_DepthEnable;
- }
- if (inputState->m_StencilEnable != m_pCurrentDepthStencilState->m_StencilEnable) {
- SetRenderState(inputState->m_StencilEnable, NVRenderState::StencilTest);
- m_pCurrentDepthStencilState->m_StencilEnable = inputState->m_StencilEnable;
- }
-
- if (inputState->m_DepthMask != m_pCurrentDepthStencilState->m_DepthMask) {
- GL_CALL_FUNCTION(glDepthMask(inputState->m_DepthMask));
- m_pCurrentDepthStencilState->m_DepthMask = inputState->m_DepthMask;
- }
-
- if (inputState->m_DepthFunc != m_pCurrentDepthStencilState->m_DepthFunc) {
- GL_CALL_FUNCTION(glDepthFunc(m_Conversion.fromBoolOpToGL(inputState->m_DepthFunc)));
- m_pCurrentDepthStencilState->m_DepthFunc = inputState->m_DepthFunc;
- }
-
- if (!(inputState->m_DepthStencilOpFront
- == m_pCurrentDepthStencilState->m_DepthStencilOpFront)) {
- GL_CALL_FUNCTION(glStencilOpSeparate(
- GL_FRONT,
- m_Conversion.fromStencilOpToGL(inputState->m_DepthStencilOpFront.m_StencilFail),
- m_Conversion.fromStencilOpToGL(inputState->m_DepthStencilOpFront.m_DepthFail),
- m_Conversion.fromStencilOpToGL(inputState->m_DepthStencilOpFront.m_DepthPass)));
- m_pCurrentDepthStencilState->m_DepthStencilOpFront =
- inputState->m_DepthStencilOpFront;
- }
-
- if (!(inputState->m_DepthStencilOpBack
- == m_pCurrentDepthStencilState->m_DepthStencilOpBack)) {
- GL_CALL_FUNCTION(glStencilOpSeparate(
- GL_BACK,
- m_Conversion.fromStencilOpToGL(inputState->m_DepthStencilOpBack.m_StencilFail),
- m_Conversion.fromStencilOpToGL(inputState->m_DepthStencilOpBack.m_DepthFail),
- m_Conversion.fromStencilOpToGL(inputState->m_DepthStencilOpBack.m_DepthPass)));
- m_pCurrentDepthStencilState->m_DepthStencilOpBack =
- inputState->m_DepthStencilOpBack;
- }
-
- if (!(inputState->m_StencilFuncFront
- == m_pCurrentDepthStencilState->m_StencilFuncFront)) {
- GL_CALL_FUNCTION(glStencilFuncSeparate(
- GL_FRONT,
- m_Conversion.fromBoolOpToGL(inputState->m_StencilFuncFront.m_Function),
- inputState->m_StencilFuncFront.m_ReferenceValue,
- inputState->m_StencilFuncFront.m_Mask));
- m_pCurrentDepthStencilState->m_StencilFuncFront = inputState->m_StencilFuncFront;
- }
-
- if (!(inputState->m_StencilFuncBack
- == m_pCurrentDepthStencilState->m_StencilFuncBack)) {
- GL_CALL_FUNCTION(glStencilFuncSeparate(
- GL_BACK, m_Conversion.fromBoolOpToGL(inputState->m_StencilFuncBack.m_Function),
- inputState->m_StencilFuncBack.m_ReferenceValue,
- inputState->m_StencilFuncBack.m_Mask));
- m_pCurrentDepthStencilState->m_StencilFuncBack = inputState->m_StencilFuncBack;
- }
- }
- }
-
- void
- NVRenderBackendGLBase::SetRasterizerState(NVRenderBackendRasterizerStateObject rasterizerState)
- {
- NVRenderBackendRasterizerStateGL *inputState =
- (NVRenderBackendRasterizerStateGL *)rasterizerState;
- if (inputState && !(*m_pCurrentRasterizerState == *inputState)) {
- // store current state
- *m_pCurrentRasterizerState = *inputState;
-
- if (m_pCurrentRasterizerState->m_DepthBias != 0.0
- || m_pCurrentRasterizerState->m_DepthScale != 0.0) {
- GL_CALL_FUNCTION(glEnable(GL_POLYGON_OFFSET_FILL));
- } else {
- GL_CALL_FUNCTION(glDisable(GL_POLYGON_OFFSET_FILL));
- }
-
- GL_CALL_FUNCTION(glPolygonOffset(m_pCurrentRasterizerState->m_DepthBias,
- m_pCurrentRasterizerState->m_DepthScale));
-
- GL_CALL_FUNCTION(
- glCullFace(m_Conversion.fromFacesToGL(m_pCurrentRasterizerState->m_CullFace)));
- }
- }
-
- bool NVRenderBackendGLBase::GetRenderState(const NVRenderState::Enum value)
- {
- bool enabled = GL_CALL_FUNCTION(glIsEnabled(m_Conversion.fromRenderStateToGL(value)));
- return enabled;
- }
-
- NVRenderBoolOp::Enum NVRenderBackendGLBase::GetDepthFunc()
- {
- QT3DSI32 value;
- GL_CALL_FUNCTION(glGetIntegerv(GL_DEPTH_FUNC, &value));
- return m_Conversion.fromGLToBoolOp(value);
- }
-
- void NVRenderBackendGLBase::SetDepthFunc(const NVRenderBoolOp::Enum func)
- {
- GL_CALL_FUNCTION(glDepthFunc(m_Conversion.fromBoolOpToGL(func)));
- }
-
- bool NVRenderBackendGLBase::GetDepthWrite()
- {
- QT3DSI32 value;
- GL_CALL_FUNCTION(glGetIntegerv(GL_DEPTH_WRITEMASK, (GLint *)&value));
- return value ? true : false;
- }
-
- void NVRenderBackendGLBase::SetDepthWrite(bool bEnable) { GL_CALL_FUNCTION(glDepthMask(bEnable)); }
-
- void NVRenderBackendGLBase::SetColorWrites(bool bRed, bool bGreen, bool bBlue, bool bAlpha)
- {
- GL_CALL_FUNCTION(glColorMask(bRed, bGreen, bBlue, bAlpha));
- }
-
- void NVRenderBackendGLBase::GetBlendFunc(NVRenderBlendFunctionArgument *pBlendFuncArg)
- {
- QT3DS_ASSERT(pBlendFuncArg);
- QT3DSI32_4 values;
-
- GL_CALL_FUNCTION(glGetIntegerv(GL_BLEND_SRC_RGB, (GLint *)&values.x));
- GL_CALL_FUNCTION(glGetIntegerv(GL_BLEND_SRC_ALPHA, (GLint *)&values.y));
- GL_CALL_FUNCTION(glGetIntegerv(GL_BLEND_DST_RGB, (GLint *)&values.z));
- GL_CALL_FUNCTION(glGetIntegerv(GL_BLEND_DST_ALPHA, (GLint *)&values.w));
-
- pBlendFuncArg->m_SrcRGB = m_Conversion.fromGLToSrcBlendFunc(values.x);
- pBlendFuncArg->m_SrcAlpha = m_Conversion.fromGLToSrcBlendFunc(values.y);
- pBlendFuncArg->m_DstRGB = m_Conversion.fromGLToDstBlendFunc(values.z);
- pBlendFuncArg->m_DstAlpha = m_Conversion.fromGLToDstBlendFunc(values.w);
- }
-
- void NVRenderBackendGLBase::SetBlendFunc(const NVRenderBlendFunctionArgument &blendFuncArg)
- {
- QT3DSI32_4 values;
-
- values.x = m_Conversion.fromSrcBlendFuncToGL(blendFuncArg.m_SrcRGB);
- values.y = m_Conversion.fromDstBlendFuncToGL(blendFuncArg.m_DstRGB);
- values.z = m_Conversion.fromSrcBlendFuncToGL(blendFuncArg.m_SrcAlpha);
- values.w = m_Conversion.fromDstBlendFuncToGL(blendFuncArg.m_DstAlpha);
-
- GL_CALL_FUNCTION(glBlendFuncSeparate(values.x, values.y, values.z, values.w));
- }
-
- void NVRenderBackendGLBase::SetBlendEquation(const NVRenderBlendEquationArgument &)
- {
- // needs GL4 / GLES 3.1
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::SetBlendBarrier()
- {
- // needs GL4 / GLES 3.1
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GetScissorRect(NVRenderRect *pRect)
- {
- QT3DS_ASSERT(pRect);
- GL_CALL_FUNCTION(glGetIntegerv(GL_SCISSOR_BOX, (GLint *)pRect));
- }
-
- void NVRenderBackendGLBase::SetScissorRect(const NVRenderRect &rect)
- {
- GL_CALL_FUNCTION(glScissor(rect.m_X, rect.m_Y, rect.m_Width, rect.m_Height));
- }
-
- void NVRenderBackendGLBase::GetViewportRect(NVRenderRect *pRect)
- {
- QT3DS_ASSERT(pRect);
- GL_CALL_FUNCTION(glGetIntegerv(GL_VIEWPORT, (GLint *)pRect));
- }
-
- void NVRenderBackendGLBase::SetViewportRect(const NVRenderRect &rect)
- {
- GL_CALL_FUNCTION(glViewport(rect.m_X, rect.m_Y, rect.m_Width, rect.m_Height););
- }
-
- void NVRenderBackendGLBase::SetClearColor(const QT3DSVec4 *pClearColor)
- {
- QT3DS_ASSERT(pClearColor);
-
- GL_CALL_FUNCTION(glClearColor(pClearColor->x, pClearColor->y,
- pClearColor->z, pClearColor->w));
- }
-
- void NVRenderBackendGLBase::Clear(NVRenderClearFlags flags)
- {
- GL_CALL_FUNCTION(glClear(m_Conversion.fromClearFlagsToGL(flags)));
- }
-
- NVRenderBackend::NVRenderBackendBufferObject
- NVRenderBackendGLBase::CreateBuffer(size_t size, NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usage, const void *hostPtr)
- {
- GLuint bufID = 0;
-
- GL_CALL_FUNCTION(glGenBuffers(1, &bufID));
-
- if (bufID && size) {
- GLenum target = m_Conversion.fromBindBufferFlagsToGL(bindFlags);
- if (target != GL_INVALID_ENUM) {
- GL_CALL_FUNCTION(glBindBuffer(target, bufID));
- GL_CALL_FUNCTION(glBufferData(target, size, hostPtr,
- m_Conversion.fromBufferUsageTypeToGL(usage)));
- } else {
- GL_CALL_FUNCTION(glDeleteBuffers(1, &bufID));
- bufID = 0;
- qCCritical(GL_ERROR, GLConversion::processGLError(target));
- }
- }
-
- return (NVRenderBackend::NVRenderBackendBufferObject)bufID;
- }
-
- void NVRenderBackendGLBase::BindBuffer(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags)
- {
- GLuint bufID = HandleToID_cast(GLuint, size_t, bo);
- GL_CALL_FUNCTION(glBindBuffer(m_Conversion.fromBindBufferFlagsToGL(bindFlags), bufID));
- }
-
- void NVRenderBackendGLBase::ReleaseBuffer(NVRenderBackendBufferObject bo)
- {
- GLuint bufID = HandleToID_cast(GLuint, size_t, bo);
- GL_CALL_FUNCTION(glDeleteBuffers(1, &bufID));
- }
-
- void NVRenderBackendGLBase::UpdateBuffer(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags, size_t size,
- NVRenderBufferUsageType::Enum usage, const void *data)
- {
- GLuint bufID = HandleToID_cast(GLuint, size_t, bo);
- GLenum target = m_Conversion.fromBindBufferFlagsToGL(bindFlags);
- GL_CALL_FUNCTION(glBindBuffer(target, bufID));
- GL_CALL_FUNCTION(glBufferData(target, size, data, m_Conversion.fromBufferUsageTypeToGL(usage)));
- }
-
- void NVRenderBackendGLBase::UpdateBufferRange(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags, size_t offset,
- size_t size, const void *data)
- {
- GLuint bufID = HandleToID_cast(GLuint, size_t, bo);
- GLenum target = m_Conversion.fromBindBufferFlagsToGL(bindFlags);
- GL_CALL_FUNCTION(glBindBuffer(target, bufID));
- GL_CALL_FUNCTION(glBufferSubData(target, offset, size, data));
- }
-
- void *NVRenderBackendGLBase::MapBuffer(NVRenderBackendBufferObject, NVRenderBufferBindFlags,
- size_t, size_t, NVRenderBufferAccessFlags)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return NULL;
- }
-
- bool NVRenderBackendGLBase::UnmapBuffer(NVRenderBackendBufferObject, NVRenderBufferBindFlags)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return true;
- }
-
- void NVRenderBackendGLBase::SetMemoryBarrier(NVRenderBufferBarrierFlags)
- {
- // needs GL 4 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- NVRenderBackend::NVRenderBackendQueryObject NVRenderBackendGLBase::CreateQuery()
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return NVRenderBackendQueryObject(0);
- }
-
- void NVRenderBackendGLBase::ReleaseQuery(NVRenderBackendQueryObject)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::BeginQuery(NVRenderBackendQueryObject, NVRenderQueryType::Enum)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::EndQuery(NVRenderBackendQueryObject, NVRenderQueryType::Enum)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GetQueryResult(NVRenderBackendQueryObject,
- NVRenderQueryResultType::Enum, QT3DSU32 *)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GetQueryResult(NVRenderBackendQueryObject,
- NVRenderQueryResultType::Enum, QT3DSU64 *)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::SetQueryTimer(NVRenderBackendQueryObject)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- NVRenderBackend::NVRenderBackendSyncObject
- NVRenderBackendGLBase::CreateSync(NVRenderSyncType::Enum, NVRenderSyncFlags)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return NVRenderBackendSyncObject(0);
- }
-
- void NVRenderBackendGLBase::ReleaseSync(NVRenderBackendSyncObject)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::WaitSync(NVRenderBackendSyncObject, NVRenderCommandFlushFlags,
- QT3DSU64)
- {
- // needs GL 3 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- NVRenderBackend::NVRenderBackendRenderTargetObject NVRenderBackendGLBase::CreateRenderTarget()
- {
- GLuint fboID = 0;
-
- GL_CALL_FUNCTION(glGenFramebuffers(1, &fboID));
-
- return (NVRenderBackend::NVRenderBackendRenderTargetObject)fboID;
- }
-
- void NVRenderBackendGLBase::ReleaseRenderTarget(NVRenderBackendRenderTargetObject rto)
- {
- GLuint fboID = HandleToID_cast(GLuint, size_t, rto);
-
- if (fboID) {
- GL_CALL_FUNCTION(glDeleteFramebuffers(1, &fboID));
- }
- }
-
- void NVRenderBackendGLBase::RenderTargetAttach(NVRenderBackendRenderTargetObject /* rto */,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendRenderbufferObject rbo)
- {
- // rto must be the current render target
- GLuint rbID = HandleToID_cast(GLuint, size_t, rbo);
-
- GLenum glAttach = GLConversion::fromFramebufferAttachmentsToGL(attachment);
-
- GL_CALL_FUNCTION(glFramebufferRenderbuffer(GL_FRAMEBUFFER, glAttach, GL_RENDERBUFFER, rbID));
- }
-
- void NVRenderBackendGLBase::RenderTargetAttach(NVRenderBackendRenderTargetObject /* rto */,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target)
- {
- // rto must be the current render target
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
-
- QT3DS_ASSERT(target == NVRenderTextureTargetType::Texture2D
- || m_backendSupport.caps.bits.bMsTextureSupported);
-
- GLenum glAttach = GLConversion::fromFramebufferAttachmentsToGL(attachment);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- GL_CALL_FUNCTION(glFramebufferTexture2D(GL_FRAMEBUFFER, glAttach, glTarget, texID, 0))
- }
-
- void NVRenderBackendGLBase::RenderTargetAttach(NVRenderBackendRenderTargetObject,
- NVRenderFrameBufferAttachments::Enum,
- NVRenderBackendTextureObject, QT3DSI32, QT3DSI32)
- {
- // Needs GL3 or GLES 3
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::SetRenderTarget(NVRenderBackendRenderTargetObject rto)
- {
- GLuint fboID = HandleToID_cast(GLuint, size_t, rto);
-
- GL_CALL_FUNCTION(glBindFramebuffer(GL_FRAMEBUFFER, fboID));
- }
-
- bool NVRenderBackendGLBase::RenderTargetIsValid(NVRenderBackendRenderTargetObject /* rto */)
- {
- // rto must be the current render target
- GLenum completeStatus = GL_CALL_FUNCTION(glCheckFramebufferStatus(GL_FRAMEBUFFER));
- switch (completeStatus) {
-#define HANDLE_INCOMPLETE_STATUS(x) \
- case x: \
- qCCritical(INTERNAL_ERROR, "Framebuffer is not complete: %s", #x); \
- return false;
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS)
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
- HANDLE_INCOMPLETE_STATUS(GL_FRAMEBUFFER_UNSUPPORTED)
-#undef HANDLE_INCOMPLETE_STATUS
- }
- return true;
- }
-
- NVRenderBackend::NVRenderBackendRenderbufferObject
- NVRenderBackendGLBase::CreateRenderbuffer(NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height)
- {
- GLuint bufID = 0;
-
- GL_CALL_FUNCTION(glGenRenderbuffers(1, &bufID));
- GL_CALL_FUNCTION(glBindRenderbuffer(GL_RENDERBUFFER, bufID));
- GL_CALL_FUNCTION(glRenderbufferStorage(GL_RENDERBUFFER,
- GLConversion::fromRenderBufferFormatsToRenderBufferGL(storageFormat),
- (GLsizei)width, (GLsizei)height));
-
- // check for error
- GLenum error = m_glFunctions->glGetError();
- if (error != GL_NO_ERROR) {
- qCCritical(GL_ERROR, GLConversion::processGLError(error));
- QT3DS_ASSERT(false);
- GL_CALL_FUNCTION(glDeleteRenderbuffers(1, &bufID));
- bufID = 0;
- }
-
- GL_CALL_FUNCTION(glBindRenderbuffer(GL_RENDERBUFFER, 0));
-
- return (NVRenderBackend::NVRenderBackendRenderbufferObject)bufID;
- }
-
- void NVRenderBackendGLBase::ReleaseRenderbuffer(NVRenderBackendRenderbufferObject rbo)
- {
- GLuint bufID = HandleToID_cast(GLuint, size_t, rbo);
-
- if (bufID) {
- GL_CALL_FUNCTION(glDeleteRenderbuffers(1, &bufID));
- }
- }
-
- bool NVRenderBackendGLBase::ResizeRenderbuffer(NVRenderBackendRenderbufferObject rbo,
- NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height)
- {
- bool success = true;
- GLuint bufID = HandleToID_cast(GLuint, size_t, rbo);
-
- QT3DS_ASSERT(bufID);
-
- GL_CALL_FUNCTION(glBindRenderbuffer(GL_RENDERBUFFER, bufID));
- GL_CALL_FUNCTION(glRenderbufferStorage(GL_RENDERBUFFER,
- GLConversion::fromRenderBufferFormatsToRenderBufferGL(storageFormat),
- (GLsizei)width, (GLsizei)height));
-
- // check for error
- GLenum error = m_glFunctions->glGetError();
- if (error != GL_NO_ERROR) {
- qCCritical(GL_ERROR, GLConversion::processGLError(error));
- QT3DS_ASSERT(false);
- success = false;
- }
-
- return success;
- }
-
- NVRenderBackend::NVRenderBackendTextureObject NVRenderBackendGLBase::CreateTexture()
- {
- GLuint texID = 0;
-
- GL_CALL_FUNCTION(glGenTextures(1, &texID));
- return (NVRenderBackend::NVRenderBackendTextureObject)texID;
- }
-
- void NVRenderBackendGLBase::BindTexture(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 unit)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0 + unit));
- GL_CALL_FUNCTION(glBindTexture(m_Conversion.fromTextureTargetToGL(target), texID));
- }
-
- void NVRenderBackendGLBase::BindImageTexture(NVRenderBackendTextureObject, QT3DSU32, QT3DSI32, bool,
- QT3DSI32, NVRenderImageAccessType::Enum,
- NVRenderTextureFormats::Enum)
- {
- // needs GL 4 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::ReleaseTexture(NVRenderBackendTextureObject to)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GL_CALL_FUNCTION(glDeleteTextures(1, &texID));
- }
-
- void NVRenderBackendGLBase::SetTextureData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format, const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTarget, texID));
- bool conversionRequired = format != internalFormat;
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat))
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
-
- if (conversionRequired) {
- GLenum dummy;
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, dummy);
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- glInternalFormat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- } else if (NVRenderTextureFormats::isDepthTextureFormat(format))
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
-
- GL_CALL_FUNCTION(glTexImage2D(glTarget, level, glInternalFormat, (GLsizei)width, (GLsizei)height,
- border, glformat, gltype, hostPtr));
-
- GL_CALL_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- // This will look very SetTextureData2D, but the target for glBindTexture will be different from
- // the target for
- // glTexImage2D.
- void NVRenderBackendGLBase::SetTextureDataCubeFace(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format, const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GLenum glTexTarget =
- m_Conversion.fromTextureTargetToGL(NVRenderTextureTargetType::TextureCube);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTexTarget, texID));
- bool conversionRequired = format != internalFormat;
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- internalFormat = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(),
- internalFormat, swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = GL_UNSIGNED_BYTE;
-
- if (NVRenderTextureFormats::isUncompressedTextureFormat(internalFormat))
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), internalFormat,
- glformat, gltype, glInternalFormat);
-
-
- if (conversionRequired) {
- GLenum dummy;
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, dummy);
- } else if (NVRenderTextureFormats::isCompressedTextureFormat(internalFormat)) {
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- glInternalFormat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- } else if (NVRenderTextureFormats::isDepthTextureFormat(format))
- m_Conversion.fromDepthTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
-
- // for es2 internal format must be same as format
- if (GetRenderContextType() == NVRenderContextValues::GLES2)
- glInternalFormat = glformat;
-
- GL_CALL_FUNCTION(glTexImage2D(glTarget, level, glInternalFormat, (GLsizei)width, (GLsizei)height,
- border, glformat, gltype, hostPtr));
-
- GL_CALL_FUNCTION(glBindTexture(glTexTarget, 0));
- }
-
- void NVRenderBackendGLBase::CreateTextureStorage2D(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32,
- NVRenderTextureFormats::Enum, size_t, size_t)
- {
- // you need GL 4.2 or GLES 3.1
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::SetTextureSubData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSU32 level, QT3DSI32 xOffset, QT3DSI32 yOffset,
- size_t width, size_t height,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTarget, texID));
-
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- format = m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(), format,
- swizzleMode);
-
- GLenum glformat = 0, glInternalFormat = 0, gltype = 0;
- m_Conversion.fromUncompressedTextureFormatToGL(GetRenderContextType(), format, glformat,
- gltype, glInternalFormat);
- GL_CALL_FUNCTION(glTexSubImage2D(glTarget, level, xOffset, yOffset, (GLsizei)width,
- (GLsizei)height, glformat, gltype, hostPtr));
-
- GL_CALL_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- void NVRenderBackendGLBase::SetCompressedTextureData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, QT3DSI32 border,
- size_t imageSize, const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTarget, texID));
-
- GLenum glformat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- GL_CALL_FUNCTION(glCompressedTexImage2D(glTarget, level, glformat, (GLsizei)width,
- (GLsizei)height, border, (GLsizei)imageSize, hostPtr));
-
- GL_CALL_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- void NVRenderBackendGLBase::SetCompressedTextureDataCubeFace(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width, size_t height, QT3DSI32 border,
- size_t imageSize, const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GLenum glTexTarget =
- m_Conversion.fromTextureTargetToGL(NVRenderTextureTargetType::TextureCube);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTexTarget, texID));
-
- GLenum glformat = m_Conversion.fromCompressedTextureFormatToGL(internalFormat);
- GL_CALL_FUNCTION(glCompressedTexImage2D(glTarget, level, glformat, (GLsizei)width,
- (GLsizei)height, border, (GLsizei)imageSize, hostPtr));
-
- GL_CALL_FUNCTION(glBindTexture(glTexTarget, 0));
- }
-
- void NVRenderBackendGLBase::SetCompressedTextureSubData2D(
- NVRenderBackendTextureObject to, NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- QT3DSI32 xOffset, QT3DSI32 yOffset, size_t width, size_t height,
- NVRenderTextureFormats::Enum format, size_t imageSize, const void *hostPtr)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTarget, texID));
-
- GLenum glformat = m_Conversion.fromCompressedTextureFormatToGL(format);
- GL_CALL_FUNCTION(glCompressedTexSubImage2D(glTarget, level, xOffset, yOffset, (GLsizei)width,
- (GLsizei)height, glformat, (GLsizei)imageSize,
- hostPtr));
-
- GL_CALL_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- void NVRenderBackendGLBase::SetTextureData3D(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32,
- NVRenderTextureFormats::Enum, size_t, size_t,
- size_t, QT3DSI32, NVRenderTextureFormats::Enum,
- const void *)
- {
- // needs GL3 or GLES3
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum genType)
- {
- GLuint texID = HandleToID_cast(GLuint, size_t, to);
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
- GL_CALL_FUNCTION(glActiveTexture(GL_TEXTURE0));
- GL_CALL_FUNCTION(glBindTexture(glTarget, texID));
-
- GLenum glValue = GLConversion::fromHintToGL(genType);
- GL_CALL_FUNCTION(glHint(GL_GENERATE_MIPMAP_HINT, glValue));
- GL_CALL_FUNCTION(glGenerateMipmap(glTarget));
-
- GL_CALL_FUNCTION(glBindTexture(glTarget, 0));
- }
-
- NVRenderTextureSwizzleMode::Enum
- NVRenderBackendGLBase::GetTextureSwizzleMode(const NVRenderTextureFormats::Enum inFormat) const
- {
- NVRenderTextureSwizzleMode::Enum swizzleMode = NVRenderTextureSwizzleMode::NoSwizzle;
- m_Conversion.replaceDeprecatedTextureFormat(GetRenderContextType(), inFormat, swizzleMode);
-
- return swizzleMode;
- }
-
- NVRenderBackend::NVRenderBackendSamplerObject NVRenderBackendGLBase::CreateSampler(
- NVRenderTextureMinifyingOp::Enum minFilter, NVRenderTextureMagnifyingOp::Enum magFilter,
- NVRenderTextureCoordOp::Enum wrapS, NVRenderTextureCoordOp::Enum wrapT,
- NVRenderTextureCoordOp::Enum wrapR, QT3DSI32 minLod, QT3DSI32 maxLod, QT3DSF32 lodBias,
- NVRenderTextureCompareMode::Enum compareMode, NVRenderTextureCompareOp::Enum compareFunc,
- QT3DSF32 anisotropy, QT3DSF32 *borderColor)
- {
- // Satisfy the compiler
- // We don"t setup the state here for GL
- // but we need to pass on the variables here
- // to satisfy the interface
- NVRENDER_BACKEND_UNUSED(minFilter);
- NVRENDER_BACKEND_UNUSED(magFilter);
- NVRENDER_BACKEND_UNUSED(wrapS);
- NVRENDER_BACKEND_UNUSED(wrapT);
- NVRENDER_BACKEND_UNUSED(wrapR);
- NVRENDER_BACKEND_UNUSED(minLod);
- NVRENDER_BACKEND_UNUSED(maxLod);
- NVRENDER_BACKEND_UNUSED(lodBias);
- NVRENDER_BACKEND_UNUSED(compareMode);
- NVRENDER_BACKEND_UNUSED(compareFunc);
- NVRENDER_BACKEND_UNUSED(anisotropy);
- NVRENDER_BACKEND_UNUSED(borderColor);
-
- // return a dummy handle
- return (NVRenderBackend::NVRenderBackendSamplerObject)0x0001;
- }
-
- void NVRenderBackendGLBase::UpdateSampler(
- NVRenderBackendSamplerObject /* so */, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter, NVRenderTextureMagnifyingOp::Enum magFilter,
- NVRenderTextureCoordOp::Enum wrapS, NVRenderTextureCoordOp::Enum wrapT,
- NVRenderTextureCoordOp::Enum wrapR, QT3DSF32 minLod, QT3DSF32 maxLod, QT3DSF32 lodBias,
- NVRenderTextureCompareMode::Enum compareMode, NVRenderTextureCompareOp::Enum compareFunc,
- QT3DSF32 anisotropy, QT3DSF32 *borderColor)
- {
- // Satisfy the compiler
- // These are not available in GLES 2 and we don't use them right now
- NVRENDER_BACKEND_UNUSED(wrapR);
- NVRENDER_BACKEND_UNUSED(lodBias);
- NVRENDER_BACKEND_UNUSED(minLod);
- NVRENDER_BACKEND_UNUSED(maxLod);
- NVRENDER_BACKEND_UNUSED(compareMode);
- NVRENDER_BACKEND_UNUSED(compareFunc);
- NVRENDER_BACKEND_UNUSED(borderColor);
-
- GLenum glTarget = m_Conversion.fromTextureTargetToGL(target);
-
- GL_CALL_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MIN_FILTER,
- m_Conversion.fromTextureMinifyingOpToGL(minFilter)));
- GL_CALL_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_MAG_FILTER,
- m_Conversion.fromTextureMagnifyingOpToGL(magFilter)));
- GL_CALL_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_S,
- m_Conversion.fromTextureCoordOpToGL(wrapS)));
- GL_CALL_FUNCTION(glTexParameteri(glTarget, GL_TEXTURE_WRAP_T,
- m_Conversion.fromTextureCoordOpToGL(wrapT)));
- if (m_backendSupport.caps.bits.bAnistropySupported) {
- GL_CALL_FUNCTION(glTexParameterf(glTarget, GL_TEXTURE_MAX_ANISOTROPY_EXT,
- qMin(m_maxAnisotropy, anisotropy)));
- }
- }
-
- void NVRenderBackendGLBase::UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSI32 baseLevel, QT3DSI32 maxLevel)
- {
- NVRENDER_BACKEND_UNUSED(to);
- NVRENDER_BACKEND_UNUSED(target);
- NVRENDER_BACKEND_UNUSED(baseLevel);
- NVRENDER_BACKEND_UNUSED(maxLevel);
- }
-
- void NVRenderBackendGLBase::UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode)
- {
- NVRENDER_BACKEND_UNUSED(to);
- NVRENDER_BACKEND_UNUSED(target);
-
- // Nothing to do here still might be called
- QT3DS_ASSERT(swizzleMode == NVRenderTextureSwizzleMode::NoSwizzle);
-
- NVRENDER_BACKEND_UNUSED(swizzleMode);
- }
-
- void NVRenderBackendGLBase::ReleaseSampler(NVRenderBackendSamplerObject so)
- {
- GLuint samplerID = HandleToID_cast(GLuint, size_t, so);
- if (!samplerID)
- return;
- // otherwise nothing to do
- }
-
- NVRenderBackend::NVRenderBackendAttribLayoutObject
- NVRenderBackendGLBase::CreateAttribLayout(NVConstDataRef<NVRenderVertexBufferEntry> attribs)
- {
- QT3DSU32 attribLayoutSize = sizeof(NVRenderBackendAttributeLayoutGL);
- QT3DSU32 entrySize = sizeof(NVRenderBackendLayoutEntryGL) * attribs.size();
- QT3DSU8 *newMem = (QT3DSU8 *)QT3DS_ALLOC(m_Foundation.getAllocator(), attribLayoutSize + entrySize,
- "BackendAttributeLayoutGL");
- NVDataRef<NVRenderBackendLayoutEntryGL> entryRef =
- PtrAtOffset<NVRenderBackendLayoutEntryGL>(newMem, attribLayoutSize, entrySize);
- QT3DSU32 maxInputSlot = 0;
-
- // copy data
- QT3DS_FOREACH(idx, attribs.size())
- {
- entryRef[idx].m_AttribName = m_StringTable->RegisterStr(attribs.mData[idx].m_Name);
- entryRef[idx].m_Normalize = 0;
- entryRef[idx].m_AttribIndex = 0; // will be set later
- entryRef[idx].m_Type = m_Conversion.fromComponentTypeAndNumCompsToAttribGL(
- attribs.mData[idx].m_ComponentType, attribs.mData[idx].m_NumComponents);
- entryRef[idx].m_NumComponents = attribs.mData[idx].m_NumComponents;
- entryRef[idx].m_InputSlot = attribs.mData[idx].m_InputSlot;
- entryRef[idx].m_Offset = attribs.mData[idx].m_FirstItemOffset;
-
- if (maxInputSlot < entryRef[idx].m_InputSlot)
- maxInputSlot = entryRef[idx].m_InputSlot;
- }
-
- NVRenderBackendAttributeLayoutGL *retval =
- new (newMem) NVRenderBackendAttributeLayoutGL(entryRef, maxInputSlot);
-
- return (NVRenderBackend::NVRenderBackendAttribLayoutObject)retval;
- }
-
- void NVRenderBackendGLBase::ReleaseAttribLayout(NVRenderBackendAttribLayoutObject ao)
- {
- NVRenderBackendAttributeLayoutGL *attribLayout = (NVRenderBackendAttributeLayoutGL *)ao;
-
- NVDelete(m_Foundation.getAllocator(), attribLayout);
- };
-
- NVRenderBackend::NVRenderBackendInputAssemblerObject
- NVRenderBackendGLBase::CreateInputAssembler(NVRenderBackendAttribLayoutObject attribLayout,
- NVConstDataRef<NVRenderBackendBufferObject> buffers,
- const NVRenderBackendBufferObject indexBuffer,
- NVConstDataRef<QT3DSU32> strides,
- NVConstDataRef<QT3DSU32> offsets,
- QT3DSU32 patchVertexCount)
- {
- NVRenderBackendAttributeLayoutGL *attribLayoutGL =
- (NVRenderBackendAttributeLayoutGL *)attribLayout;
-
- NVRenderBackendInputAssemblerGL *retval = QT3DS_NEW(m_Foundation.getAllocator(),
- NVRenderBackendInputAssemblerGL)(
- m_Foundation, attribLayoutGL, buffers, indexBuffer, strides, offsets, patchVertexCount);
-
- return (NVRenderBackend::NVRenderBackendInputAssemblerObject)retval;
- }
-
- void NVRenderBackendGLBase::ReleaseInputAssembler(NVRenderBackendInputAssemblerObject iao)
- {
- NVRenderBackendInputAssemblerGL *inputAssembler = (NVRenderBackendInputAssemblerGL *)iao;
- NVDelete(m_Foundation.getAllocator(), inputAssembler);
- }
-
- bool NVRenderBackendGLBase::compileSource(GLuint shaderID, NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- GLint shaderSourceSize = static_cast<GLint>(source.size());
- const char *shaderSourceData = (const char *)source.begin();
- GLint shaderStatus = GL_TRUE;
-
- if (!binary) {
-
- GL_CALL_FUNCTION(glShaderSource(shaderID, 1, &shaderSourceData, &shaderSourceSize));
- GL_CALL_FUNCTION(glCompileShader(shaderID));
-
- GLint logLen;
- GL_CALL_FUNCTION(glGetShaderiv(shaderID, GL_COMPILE_STATUS, &shaderStatus));
- GL_CALL_FUNCTION(glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &logLen));
-
- // Check if some log exists. We also write warnings here
- // Should at least contain more than the null termination
- if (logLen > 2) {
- errorMessage.resize(logLen + 1);
-
- GLint lenWithoutNull;
- GL_CALL_FUNCTION(glGetShaderInfoLog(shaderID, logLen, &lenWithoutNull,
- (char *)errorMessage.c_str()));
- }
- } else {
- GL_CALL_FUNCTION(glShaderBinary(1, &shaderID, GL_NVIDIA_PLATFORM_BINARY_NV, shaderSourceData,
- shaderSourceSize));
- GLenum binaryError = m_glFunctions->glGetError();
- if (binaryError != GL_NO_ERROR) {
- shaderStatus = GL_FALSE;
- qCCritical(GL_ERROR, GLConversion::processGLError(binaryError));
- }
- }
-
- return (shaderStatus == GL_TRUE);
- }
-
- NVRenderBackend::NVRenderBackendVertexShaderObject
- NVRenderBackendGLBase::CreateVertexShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- GLuint shaderID = GL_CALL_FUNCTION(glCreateShader(GL_VERTEX_SHADER));
-
- if (shaderID && !compileSource(shaderID, source, errorMessage, binary)) {
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- shaderID = 0;
- }
-
- return (NVRenderBackend::NVRenderBackendVertexShaderObject)shaderID;
- }
-
- NVRenderBackend::NVRenderBackendFragmentShaderObject
- NVRenderBackendGLBase::CreateFragmentShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- GLuint shaderID = GL_CALL_FUNCTION(glCreateShader(GL_FRAGMENT_SHADER));
-
- if (shaderID && !compileSource(shaderID, source, errorMessage, binary)) {
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- shaderID = 0;
- }
-
- return (NVRenderBackend::NVRenderBackendFragmentShaderObject)shaderID;
- }
-
- NVRenderBackend::NVRenderBackendTessControlShaderObject
- NVRenderBackendGLBase::CreateTessControlShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- // needs GL 4 or GLES EXT_tessellation_shader support
- NVRENDER_BACKEND_UNUSED(source);
- NVRENDER_BACKEND_UNUSED(errorMessage);
- NVRENDER_BACKEND_UNUSED(binary);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return (NVRenderBackend::NVRenderBackendTessControlShaderObject)0;
- }
-
- NVRenderBackend::NVRenderBackendTessEvaluationShaderObject
- NVRenderBackendGLBase::CreateTessEvaluationShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- // needs GL 4 or GLES EXT_tessellation_shader support
- NVRENDER_BACKEND_UNUSED(source);
- NVRENDER_BACKEND_UNUSED(errorMessage);
- NVRENDER_BACKEND_UNUSED(binary);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return (NVRenderBackend::NVRenderBackendTessEvaluationShaderObject)0;
- }
-
- NVRenderBackend::NVRenderBackendGeometryShaderObject
- NVRenderBackendGLBase::CreateGeometryShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- // needs GL 4 or GLES EXT_geometry_shader support
- NVRENDER_BACKEND_UNUSED(source);
- NVRENDER_BACKEND_UNUSED(errorMessage);
- NVRENDER_BACKEND_UNUSED(binary);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return (NVRenderBackend::NVRenderBackendGeometryShaderObject)0;
- }
-
- NVRenderBackend::NVRenderBackendComputeShaderObject
- NVRenderBackendGLBase::CreateComputeShader(NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary)
- {
- // needs GL 4.3 or GLES3.1 support
- NVRENDER_BACKEND_UNUSED(source);
- NVRENDER_BACKEND_UNUSED(errorMessage);
- NVRENDER_BACKEND_UNUSED(binary);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return (NVRenderBackend::NVRenderBackendComputeShaderObject)0;
- }
-
- void NVRenderBackendGLBase::ReleaseVertexShader(NVRenderBackendVertexShaderObject vso)
- {
- GLuint shaderID = HandleToID_cast(GLuint, size_t, vso);
-
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- }
-
- void NVRenderBackendGLBase::ReleaseFragmentShader(NVRenderBackendFragmentShaderObject fso)
- {
- GLuint shaderID = HandleToID_cast(GLuint, size_t, fso);
-
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- }
-
- void
- NVRenderBackendGLBase::ReleaseTessControlShader(NVRenderBackendTessControlShaderObject tcso)
- {
- GLuint shaderID = HandleToID_cast(GLuint, size_t, tcso);
-
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- }
-
- void NVRenderBackendGLBase::ReleaseTessEvaluationShader(
- NVRenderBackendTessEvaluationShaderObject teso)
- {
- GLuint shaderID = HandleToID_cast(GLuint, size_t, teso);
-
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- }
-
- void NVRenderBackendGLBase::ReleaseGeometryShader(NVRenderBackendGeometryShaderObject gso)
- {
- GLuint shaderID = HandleToID_cast(GLuint, size_t, gso);
-
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- }
-
- void NVRenderBackendGLBase::ReleaseComputeShader(NVRenderBackendComputeShaderObject cso)
- {
- GLuint shaderID = HandleToID_cast(GLuint, size_t, cso);
-
- GL_CALL_FUNCTION(glDeleteShader(shaderID));
- }
-
- void NVRenderBackendGLBase::AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendVertexShaderObject vso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, vso);
-
- GL_CALL_FUNCTION(glAttachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendFragmentShaderObject fso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, fso);
-
- GL_CALL_FUNCTION(glAttachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessControlShaderObject tcso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, tcso);
-
- GL_CALL_FUNCTION(glAttachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessEvaluationShaderObject teso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, teso);
-
- GL_CALL_FUNCTION(glAttachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendGeometryShaderObject gso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, gso);
-
- GL_CALL_FUNCTION(glAttachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendComputeShaderObject cso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, cso);
-
- GL_CALL_FUNCTION(glAttachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendVertexShaderObject vso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, vso);
-
- GL_CALL_FUNCTION(glDetachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendFragmentShaderObject fso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, fso);
-
- GL_CALL_FUNCTION(glDetachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessControlShaderObject tcso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, tcso);
-
- GL_CALL_FUNCTION(glDetachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessEvaluationShaderObject teso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, teso);
-
- GL_CALL_FUNCTION(glDetachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendGeometryShaderObject gso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, gso);
-
- GL_CALL_FUNCTION(glDetachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- void NVRenderBackendGLBase::DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendComputeShaderObject cso)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint shaderID = HandleToID_cast(GLuint, size_t, cso);
-
- GL_CALL_FUNCTION(glDetachShader(static_cast<GLuint>(pProgram->m_ProgramID), shaderID));
- }
-
- NVRenderBackend::NVRenderBackendShaderProgramObject
- NVRenderBackendGLBase::CreateShaderProgram(bool isSeparable)
- {
- NVRenderBackendShaderProgramGL *theProgram = NULL;
- GLuint programID = GL_CALL_FUNCTION(glCreateProgram());
-
- if (programID) {
- theProgram =
- QT3DS_NEW(m_Foundation.getAllocator(), NVRenderBackendShaderProgramGL)(programID);
-
- if (!theProgram) {
- GL_CALL_FUNCTION(glDeleteProgram(programID));
- } else if (isSeparable && m_backendSupport.caps.bits.bProgramPipelineSupported) {
- GL_CALL_EXTRA_FUNCTION(glProgramParameteri(programID, GL_PROGRAM_SEPARABLE, GL_TRUE));
- }
- }
-
- return (NVRenderBackend::NVRenderBackendShaderProgramObject)theProgram;
- }
-
- void NVRenderBackendGLBase::ReleaseShaderProgram(NVRenderBackendShaderProgramObject po)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GL_CALL_FUNCTION(glDeleteProgram(programID));
-
- if (pProgram->m_shaderInput) {
- NVDelete(m_Foundation.getAllocator(), pProgram->m_shaderInput);
- pProgram->m_shaderInput = NULL;
- }
-
- NVDelete(m_Foundation.getAllocator(), pProgram);
- }
-
- bool NVRenderBackendGLBase::LinkProgram(NVRenderBackendShaderProgramObject po,
- eastl::string &errorMessage)
- {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GL_CALL_FUNCTION(glLinkProgram(programID));
-
- GLint linkStatus, logLen;
- GL_CALL_FUNCTION(glGetProgramiv(programID, GL_LINK_STATUS, &linkStatus));
- GL_CALL_FUNCTION(glGetProgramiv(programID, GL_INFO_LOG_LENGTH, &logLen));
-
- // if succesfuly linked get the attribute information
- if (linkStatus) {
- // release old stuff
- if (pProgram->m_shaderInput) {
- NVDelete(m_Foundation.getAllocator(), pProgram->m_shaderInput);
- pProgram->m_shaderInput = NULL;
- }
-
- GLint numAttribs;
- GL_CALL_FUNCTION(glGetProgramiv(programID, GL_ACTIVE_ATTRIBUTES, &numAttribs));
-
- if (numAttribs) {
- NVRenderBackendShaderInputEntryGL *tempShaderInputEntry =
- (NVRenderBackendShaderInputEntryGL *)QT3DS_ALLOC(
- m_Foundation.getAllocator(),
- sizeof(NVRenderBackendShaderInputEntryGL) * m_MaxAttribCount,
- "BackendShaderInputEntryGL");
-
- GLint maxLength;
- GL_CALL_FUNCTION(glGetProgramiv(programID, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength));
- QT3DSI8 *nameBuf =
- (QT3DSI8 *)QT3DS_ALLOC(m_Foundation.getAllocator(), maxLength, "LinkProgram");
-
- // fill in data
- QT3DSU32 count = 0;
- QT3DS_FOREACH(idx, numAttribs)
- {
- GLint size = 0;
- GLenum glType;
- NVRenderComponentTypes::Enum compType = NVRenderComponentTypes::Unknown;
- QT3DSU32 numComps = 0;
-
- GL_CALL_FUNCTION(glGetActiveAttrib(programID, idx, maxLength, NULL, &size, &glType,
- (char *)nameBuf));
- // Skip anything named with gl_
- if (memcmp(nameBuf, "gl_", 3) == 0)
- continue;
-
- m_Conversion.fromAttribGLToComponentTypeAndNumComps(glType, compType, numComps);
-
- tempShaderInputEntry[count].m_AttribName =
- m_StringTable->RegisterStr((char *)nameBuf);
- tempShaderInputEntry[count].m_AttribLocation =
- GL_CALL_FUNCTION(glGetAttribLocation(programID, (char *)nameBuf));
- tempShaderInputEntry[count].m_Type = glType;
- tempShaderInputEntry[count].m_NumComponents = numComps;
-
- ++count;
- }
-
- // Now allocate space for the actuall entries
- QT3DSU32 shaderInputSize = sizeof(NVRenderBackendShaderInputGL);
- QT3DSU32 entrySize = sizeof(NVRenderBackendShaderInputEntryGL) * count;
- QT3DSU8 *newMem =
- (QT3DSU8 *)QT3DS_ALLOC(m_Foundation.getAllocator(), shaderInputSize + entrySize,
- "BackendShaderInputEntryGL");
- NVDataRef<NVRenderBackendShaderInputEntryGL> entryRef =
- PtrAtOffset<NVRenderBackendShaderInputEntryGL>(newMem, shaderInputSize,
- entrySize);
- // fill data
- QT3DS_FOREACH(idx, count)
- {
- entryRef[idx].m_AttribName = tempShaderInputEntry[idx].m_AttribName;
- entryRef[idx].m_AttribLocation = tempShaderInputEntry[idx].m_AttribLocation;
- entryRef[idx].m_Type = tempShaderInputEntry[idx].m_Type;
- entryRef[idx].m_NumComponents = tempShaderInputEntry[idx].m_NumComponents;
- }
-
- // placement new
- NVRenderBackendShaderInputGL *shaderInput =
- new (newMem) NVRenderBackendShaderInputGL(entryRef);
- // set the pointer
- pProgram->m_shaderInput = shaderInput;
-
- QT3DS_FREE(m_Foundation.getAllocator(), nameBuf);
- QT3DS_FREE(m_Foundation.getAllocator(), tempShaderInputEntry);
- }
- }
-
- // Check if some log exists. We also write warnings here
- // Should at least contain more than the null termination
- if (logLen > 2) {
- errorMessage.resize(logLen + 1);
-
- GLint lenWithoutNull;
- GL_CALL_FUNCTION(glGetProgramInfoLog(programID, logLen, &lenWithoutNull,
- (char *)errorMessage.c_str()));
- }
-
- return (linkStatus == GL_TRUE);
- }
-
- void NVRenderBackendGLBase::SetActiveProgram(NVRenderBackendShaderProgramObject po)
- {
- GLuint programID = 0;
-
- if (po) {
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- programID = static_cast<GLuint>(pProgram->m_ProgramID);
- }
-
- GL_CALL_FUNCTION(glUseProgram(programID));
- }
-
- NVRenderBackend::NVRenderBackendProgramPipeline NVRenderBackendGLBase::CreateProgramPipeline()
- {
- // needs GL 4 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- return NVRenderBackend::NVRenderBackendProgramPipeline(0);
- }
-
- void NVRenderBackendGLBase::ReleaseProgramPipeline(NVRenderBackendProgramPipeline)
- {
- // needs GL 4 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::SetActiveProgramPipeline(NVRenderBackendProgramPipeline)
- {
- // needs GL 4 context
- //TODO: should be fixed?
- // QT3DS_ASSERT(false);
- }
-
- void NVRenderBackendGLBase::SetProgramStages(NVRenderBackendProgramPipeline,
- NVRenderShaderTypeFlags,
- NVRenderBackendShaderProgramObject)
- {
- // needs GL 4 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::DispatchCompute(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32,
- QT3DSU32)
- {
- // needs GL 4 context
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- QT3DSI32 NVRenderBackendGLBase::GetConstantCount(NVRenderBackendShaderProgramObject po)
- {
- QT3DS_ASSERT(po);
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GLint numUniforms;
- GL_CALL_FUNCTION(glGetProgramiv(programID, GL_ACTIVE_UNIFORMS, &numUniforms));
-
- return numUniforms;
- }
-
- QT3DSI32 NVRenderBackendGLBase::GetConstantBufferCount(NVRenderBackendShaderProgramObject po)
- {
- // needs GL3 and above
- NVRENDER_BACKEND_UNUSED(po);
-
- return 0;
- }
-
- QT3DSI32
- NVRenderBackendGLBase::GetConstantInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 bufSize, QT3DSI32 *numElem,
- NVRenderShaderDataTypes::Enum *type, QT3DSI32 *binding,
- char *nameBuf)
- {
- QT3DS_ASSERT(po);
- NVRenderBackendShaderProgramGL *pProgram = (NVRenderBackendShaderProgramGL *)po;
- GLuint programID = static_cast<GLuint>(pProgram->m_ProgramID);
-
- GLenum glType;
- GL_CALL_FUNCTION(glGetActiveUniform(programID, id, bufSize, NULL, numElem, &glType, nameBuf));
- *type = m_Conversion.fromShaderGLToPropertyDataTypes(glType);
-
- QT3DSI32 uniformLoc = GL_CALL_FUNCTION(glGetUniformLocation(programID, nameBuf));
-
- // get unit binding point
- *binding = -1;
- if (uniformLoc != -1 && (glType == GL_IMAGE_2D || glType == GL_UNSIGNED_INT_IMAGE_2D
- || glType == GL_UNSIGNED_INT_ATOMIC_COUNTER)) {
- GL_CALL_FUNCTION(glGetUniformiv(programID, uniformLoc, binding));
- }
-
- return uniformLoc;
- }
-
- QT3DSI32
- NVRenderBackendGLBase::GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf)
- {
- // needs GL3 and above
- NVRENDER_BACKEND_UNUSED(po);
- NVRENDER_BACKEND_UNUSED(id);
- NVRENDER_BACKEND_UNUSED(nameBufSize);
- NVRENDER_BACKEND_UNUSED(paramCount);
- NVRENDER_BACKEND_UNUSED(bufferSize);
- NVRENDER_BACKEND_UNUSED(length);
- NVRENDER_BACKEND_UNUSED(nameBuf);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return -1;
- }
-
- void NVRenderBackendGLBase::GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSI32 *indices)
- {
- // needs GL3 and above
- NVRENDER_BACKEND_UNUSED(po);
- NVRENDER_BACKEND_UNUSED(id);
- NVRENDER_BACKEND_UNUSED(indices);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GetConstantBufferParamInfoByIndices(
- NVRenderBackendShaderProgramObject po, QT3DSU32 count, QT3DSU32 *indices, QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset)
- {
- // needs GL3 and above
- NVRENDER_BACKEND_UNUSED(po);
- NVRENDER_BACKEND_UNUSED(count);
- NVRENDER_BACKEND_UNUSED(indices);
- NVRENDER_BACKEND_UNUSED(type);
- NVRENDER_BACKEND_UNUSED(size);
- NVRENDER_BACKEND_UNUSED(offset);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding)
- {
- // needs GL3 and above
- NVRENDER_BACKEND_UNUSED(po);
- NVRENDER_BACKEND_UNUSED(blockIndex);
- NVRENDER_BACKEND_UNUSED(binding);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::ProgramSetConstantBuffer(QT3DSU32 index,
- NVRenderBackendBufferObject bo)
- {
- // needs GL3 and above
- NVRENDER_BACKEND_UNUSED(index);
- NVRENDER_BACKEND_UNUSED(bo);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- QT3DSI32 NVRenderBackendGLBase::GetStorageBufferCount(NVRenderBackendShaderProgramObject po)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(po);
-
- return 0;
- }
-
- QT3DSI32
- NVRenderBackendGLBase::GetStorageBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length, char *nameBuf)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(po);
- NVRENDER_BACKEND_UNUSED(id);
- NVRENDER_BACKEND_UNUSED(nameBufSize);
- NVRENDER_BACKEND_UNUSED(paramCount);
- NVRENDER_BACKEND_UNUSED(bufferSize);
- NVRENDER_BACKEND_UNUSED(length);
- NVRENDER_BACKEND_UNUSED(nameBuf);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return -1;
- }
-
- void NVRenderBackendGLBase::ProgramSetStorageBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(index);
- NVRENDER_BACKEND_UNUSED(bo);
- }
-
- QT3DSI32 NVRenderBackendGLBase::GetAtomicCounterBufferCount(NVRenderBackendShaderProgramObject po)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(po);
-
- return 0;
- }
-
- QT3DSI32
- NVRenderBackendGLBase::GetAtomicCounterBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize,
- QT3DSI32 *paramCount, QT3DSI32 *bufferSize,
- QT3DSI32 *length, char *nameBuf)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(po);
- NVRENDER_BACKEND_UNUSED(id);
- NVRENDER_BACKEND_UNUSED(nameBufSize);
- NVRENDER_BACKEND_UNUSED(paramCount);
- NVRENDER_BACKEND_UNUSED(bufferSize);
- NVRENDER_BACKEND_UNUSED(length);
- NVRENDER_BACKEND_UNUSED(nameBuf);
-
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return -1;
- }
-
- void NVRenderBackendGLBase::ProgramSetAtomicCounterBuffer(QT3DSU32 index,
- NVRenderBackendBufferObject bo)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(index);
- NVRENDER_BACKEND_UNUSED(bo);
- }
-
- void NVRenderBackendGLBase::SetConstantValue(NVRenderBackendShaderProgramObject, QT3DSU32 id,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count,
- const void *value, bool transpose)
- {
- GLenum glType = m_Conversion.fromPropertyDataTypesToShaderGL(type);
-
- switch (glType) {
- case GL_FLOAT:
- GL_CALL_FUNCTION(glUniform1fv(id, count, (GLfloat *)value));
- break;
- case GL_FLOAT_VEC2:
- GL_CALL_FUNCTION(glUniform2fv(id, count, (GLfloat *)value));
- break;
- case GL_FLOAT_VEC3:
- GL_CALL_FUNCTION(glUniform3fv(id, count, (GLfloat *)value));
- break;
- case GL_FLOAT_VEC4:
- GL_CALL_FUNCTION(glUniform4fv(id, count, (GLfloat *)value));
- break;
- case GL_INT:
- GL_CALL_FUNCTION(glUniform1iv(id, count, (GLint *)value));
- break;
- case GL_BOOL:
- {
- GLint boolValue = *(GLboolean *)value;
- GL_CALL_FUNCTION(glUniform1iv(id, count, &boolValue));
- }
- break;
- case GL_INT_VEC2:
- case GL_BOOL_VEC2:
- GL_CALL_FUNCTION(glUniform2iv(id, count, (GLint *)value));
- break;
- case GL_INT_VEC3:
- case GL_BOOL_VEC3:
- GL_CALL_FUNCTION(glUniform3iv(id, count, (GLint *)value));
- break;
- case GL_INT_VEC4:
- case GL_BOOL_VEC4:
- GL_CALL_FUNCTION(glUniform4iv(id, count, (GLint *)value));
- break;
- case GL_FLOAT_MAT3:
- GL_CALL_FUNCTION(glUniformMatrix3fv(id, count, transpose, (GLfloat *)value));
- break;
- case GL_FLOAT_MAT4:
- GL_CALL_FUNCTION(glUniformMatrix4fv(id, count, transpose, (GLfloat *)value));
- break;
- case GL_IMAGE_2D:
- case GL_SAMPLER_2D:
- case GL_SAMPLER_2D_ARRAY:
- case GL_SAMPLER_2D_SHADOW:
- case GL_SAMPLER_CUBE: {
- if (count > 1) {
- GLint *sampler = (GLint *)value;
- GL_CALL_FUNCTION(glUniform1iv(id, count, sampler));
- } else {
- GLint sampler = *(GLint *)value;
- GL_CALL_FUNCTION(glUniform1i(id, sampler));
- }
- } break;
- default:
- qCCritical(INTERNAL_ERROR, "Unknown shader type format %d", type);
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- void NVRenderBackendGLBase::Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 start, QT3DSU32 count)
- {
- GL_CALL_FUNCTION(glDrawArrays(m_Conversion.fromDrawModeToGL(
- drawMode, m_backendSupport.caps.bits.bTessellationSupported),
- start, count));
- }
-
- void NVRenderBackendGLBase::DrawIndirect(NVRenderDrawMode::Enum drawMode, const void *indirect)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(drawMode);
- NVRENDER_BACKEND_UNUSED(indirect);
- }
-
- void NVRenderBackendGLBase::DrawIndexed(NVRenderDrawMode::Enum drawMode, QT3DSU32 count,
- NVRenderComponentTypes::Enum type, const void *indices)
- {
- GL_CALL_FUNCTION(glDrawElements(m_Conversion.fromDrawModeToGL(
- drawMode, m_backendSupport.caps.bits.bTessellationSupported),
- count, m_Conversion.fromIndexBufferComponentsTypesToGL(type),
- indices));
- }
-
- void NVRenderBackendGLBase::DrawIndexedIndirect(NVRenderDrawMode::Enum drawMode,
- NVRenderComponentTypes::Enum type,
- const void *indirect)
- {
- // needs GL4 and above
- NVRENDER_BACKEND_UNUSED(drawMode);
- NVRENDER_BACKEND_UNUSED(type);
- NVRENDER_BACKEND_UNUSED(indirect);
- }
-
- void NVRenderBackendGLBase::ReadPixel(NVRenderBackendRenderTargetObject /* rto */, QT3DSI32 x,
- QT3DSI32 y, QT3DSI32 width, QT3DSI32 height,
- NVRenderReadPixelFormats::Enum inFormat, void *pixels)
- {
- GLuint glFormat;
- GLuint glType;
- if (m_Conversion.fromReadPixelsToGlFormatAndType(inFormat, &glFormat, &glType)) {
- GL_CALL_FUNCTION(glReadPixels(x, y, width, height, glFormat, glType, pixels));
- }
- }
-
- NVRenderBackend::NVRenderBackendPathObject NVRenderBackendGLBase::CreatePathNVObject(size_t)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return NVRenderBackend::NVRenderBackendPathObject(0);
- }
-
- void NVRenderBackendGLBase::ReleasePathNVObject(NVRenderBackendPathObject, size_t)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::LoadPathGlyphs(NVRenderBackendPathObject,
- NVRenderPathFontTarget::Enum, const void *,
- NVRenderPathFontStyleFlags, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathMissingGlyphs::Enum,
- NVRenderBackendPathObject, QT3DSF32)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::LoadPathGlyphRange(NVRenderBackendPathObject,
- NVRenderPathFontTarget::Enum, const void *,
- NVRenderPathFontStyleFlags, QT3DSU32, size_t,
- NVRenderPathMissingGlyphs::Enum,
- NVRenderBackendPathObject, QT3DSF32)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- NVRenderPathReturnValues::Enum NVRenderBackendGLBase::LoadPathGlyphsIndexed(
- NVRenderBackendPathObject, NVRenderPathFontTarget::Enum, const void *,
- NVRenderPathFontStyleFlags, QT3DSU32, size_t, NVRenderBackendPathObject, QT3DSF32)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
-
- return NVRenderPathReturnValues::FontUnavailable;
- }
-
- NVRenderBackend::NVRenderBackendPathObject NVRenderBackendGLBase::LoadPathGlyphsIndexedRange(
- NVRenderPathFontTarget::Enum, const void *, NVRenderPathFontStyleFlags,
- NVRenderBackend::NVRenderBackendPathObject, QT3DSF32, QT3DSU32 *)
- {
- return NVRenderBackendPathObject(0);
- }
-
- void NVRenderBackendGLBase::GetPathMetrics(NVRenderBackendPathObject, size_t,
- NVRenderPathGlyphFontMetricFlags,
- NVRenderPathFormatType::Enum, const void *, size_t,
- QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GetPathMetricsRange(NVRenderBackendPathObject, size_t,
- NVRenderPathGlyphFontMetricFlags, size_t,
- QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::GetPathSpacing(NVRenderBackendPathObject, size_t,
- NVRenderPathListMode::Enum,
- NVRenderPathFormatType::Enum, const void *, QT3DSF32,
- QT3DSF32, NVRenderPathTransformType::Enum, QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::StencilFillPathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathFillMode::Enum, QT3DSU32,
- NVRenderPathTransformType::Enum,
- const QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::StencilStrokePathInstancedN(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum,
- const void *, QT3DSI32, QT3DSU32,
- NVRenderPathTransformType::Enum,
- const QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::CoverFillPathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathCoverMode::Enum,
- NVRenderPathTransformType::Enum,
- const QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- void NVRenderBackendGLBase::CoverStrokePathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathCoverMode::Enum,
- NVRenderPathTransformType::Enum,
- const QT3DSF32 *)
- {
- // Needs GL 4 backend
- qCCritical(INVALID_OPERATION) << QObject::tr("Unsupported method: ") << __FUNCTION__;
- }
-
- ///< private calls
- const char *NVRenderBackendGLBase::getVersionString()
- {
- const char *retval = (const char *)GL_CALL_FUNCTION(glGetString(GL_VERSION));
- if (retval == NULL)
- return "";
-
- return retval;
- }
-
- const char *NVRenderBackendGLBase::getVendorString()
- {
- const char *retval = (const char *)GL_CALL_FUNCTION(glGetString(GL_VENDOR));
- if (retval == NULL)
- return "";
-
- return retval;
- }
-
- const char *NVRenderBackendGLBase::getRendererString()
- {
- const char *retval = (const char *)GL_CALL_FUNCTION(glGetString(GL_RENDERER));
- if (retval == NULL)
- return "";
-
- return retval;
- }
-
- const char *NVRenderBackendGLBase::getExtensionString()
- {
- const char *retval = (const char *)GL_CALL_FUNCTION(glGetString(GL_EXTENSIONS));
- if (retval == NULL)
- return "";
-
- return retval;
- }
-
- /**
- * @brief This function inspects the various strings to setup
- * HW capabilities of the device.
- * We can do a lot of smart things here based on GL version
- * renderer string and vendor.
- *
- * @return No return
- */
- void NVRenderBackendGLBase::setAndInspectHardwareCaps()
- {
- eastl::string apiVersion(getVersionString());
- qCInfo(TRACE_INFO, "GL version: %s", apiVersion.c_str());
-
- // we assume all GLES versions running on mobile with shared memory
- // this means framebuffer blits are slow and should be optimized or avoided
- if (apiVersion.find("OpenGL ES") == eastl::string::npos) {
- // no ES device
- m_backendSupport.caps.bits.bFastBlitsSupported = true;
- }
- }
-
-#ifdef RENDER_BACKEND_LOG_GL_ERRORS
- void NVRenderBackendGLBase::checkGLError(const char *function, const char *file,
- const unsigned int line) const
- {
- GLenum error = m_glFunctions->glGetError();
- if (error != GL_NO_ERROR) {
- qCCritical(GL_ERROR) << GLConversion::processGLError(error) << " "
- << function << " " << file << " " << line;
- }
- }
-#else
- void NVRenderBackendGLBase::checkGLError() const
- {
-#if !defined(NDEBUG) || defined(_DEBUG)
- GLenum error = m_glFunctions->glGetError();
- if (error != GL_NO_ERROR)
- qCCritical(GL_ERROR) << GLConversion::processGLError(error);
-#endif
- }
-#endif
-
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.h
deleted file mode 100644
index 28e4dbb1..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendGLBase.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_GL_BASE_H
-#define QT3DS_RENDER_BACKEND_GL_BASE_H
-
-/// @file Qt3DSRenderBackendGLBase.h
-/// NVRender OpenGL Core backend definition.
-
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/StringTable.h"
-#include "render/backends/Qt3DSRenderBackend.h"
-#include "render/backends/gl/Qt3DSOpenGLUtil.h"
-#include <EASTL/string.h>
-
-#include <QtGui/QSurfaceFormat>
-#include <QtGui/QOpenGLFunctions>
-#include <QtOpenGLExtensions/QtOpenGLExtensions>
-
-#define NVRENDER_BACKEND_UNUSED(arg) (void)arg;
-
-// Enable this to log opengl errors instead of an assert
-//#define RENDER_BACKEND_LOG_GL_ERRORS
-
-namespace qt3ds {
-namespace render {
-
- ///< forward declaration
- class NVRenderBackendRasterizerStateGL;
- class NVRenderBackendDepthStencilStateGL;
-
- using namespace foundation;
-
- typedef eastl::basic_string<char8_t, ForwardingAllocator> TContextStr;
-
- class NVRenderBackendGLBase : public NVRenderBackend
- {
- public:
- /// constructor
- NVRenderBackendGLBase(NVFoundationBase &fnd,
- qt3ds::foundation::IStringTable &stringTable,
- const QSurfaceFormat &format);
- /// destructor
- virtual ~NVRenderBackendGLBase();
-
- public:
- /// API Interface
- NVRenderContextType GetRenderContextType() const override;
- bool isESCompatible() const;
-
- const char *GetShadingLanguageVersion() override;
- /// get implementation depended values
- QT3DSU32 GetMaxCombinedTextureUnits() override;
- bool GetRenderBackendCap(NVRenderBackendCaps::Enum inCap) const override;
- QT3DSU32 GetDepthBits() const override;
- QT3DSU32 GetStencilBits() const override;
- void GetRenderBackendValue(NVRenderBackendQuery::Enum inQuery, QT3DSI32 *params) const override;
-
- /// state get/set functions
- void SetRenderState(bool bEnable, const NVRenderState::Enum value) override;
- bool GetRenderState(const NVRenderState::Enum value) override;
- virtual NVRenderBackendDepthStencilStateObject
- CreateDepthStencilState(bool enableDepth, bool depthMask, NVRenderBoolOp::Enum depthFunc,
- bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack) override;
- virtual void
- ReleaseDepthStencilState(NVRenderBackendDepthStencilStateObject inDepthStencilState) override;
- virtual NVRenderBackendRasterizerStateObject
- CreateRasterizerState(QT3DSF32 depthBias, QT3DSF32 depthScale, NVRenderFaces::Enum cullFace) override;
- void ReleaseRasterizerState(NVRenderBackendRasterizerStateObject rasterizerState) override;
- virtual void
- SetDepthStencilState(NVRenderBackendDepthStencilStateObject inDepthStencilState) override;
- void SetRasterizerState(NVRenderBackendRasterizerStateObject rasterizerState) override;
- NVRenderBoolOp::Enum GetDepthFunc() override;
- void SetDepthFunc(const NVRenderBoolOp::Enum func) override;
- bool GetDepthWrite() override;
- void SetDepthWrite(bool bEnable) override;
- void SetColorWrites(bool bRed, bool bGreen, bool bBlue, bool bAlpha) override;
- void SetMultisample(bool bEnable) override;
- void GetBlendFunc(NVRenderBlendFunctionArgument *pBlendFuncArg) override;
- void SetBlendFunc(const NVRenderBlendFunctionArgument &blendFuncArg) override;
- void SetBlendEquation(const NVRenderBlendEquationArgument &pBlendEquArg) override;
- void SetBlendBarrier(void) override;
- void GetScissorRect(NVRenderRect *pRect) override;
- void SetScissorRect(const NVRenderRect &rect) override;
- void GetViewportRect(NVRenderRect *pRect) override;
- void SetViewportRect(const NVRenderRect &rect) override;
-
- void SetClearColor(const QT3DSVec4 *pClearColor) override;
- void Clear(NVRenderClearFlags flags) override;
-
- /// resource handling
- NVRenderBackendBufferObject CreateBuffer(size_t size,
- NVRenderBufferBindFlags bindFlags,
- NVRenderBufferUsageType::Enum usage,
- const void *hostPtr = NULL) override;
- void BindBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags) override;
- void ReleaseBuffer(NVRenderBackendBufferObject bo) override;
- void UpdateBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags,
- size_t size, NVRenderBufferUsageType::Enum usage,
- const void *data) override;
- void UpdateBufferRange(NVRenderBackendBufferObject bo,
- NVRenderBufferBindFlags bindFlags, size_t offset,
- size_t size, const void *data) override;
- void *MapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags,
- size_t offset, size_t length,
- NVRenderBufferAccessFlags accessFlags) override;
- bool UnmapBuffer(NVRenderBackendBufferObject bo, NVRenderBufferBindFlags bindFlags) override;
- void SetMemoryBarrier(NVRenderBufferBarrierFlags barriers) override;
-
- NVRenderBackendQueryObject CreateQuery() override;
- void ReleaseQuery(NVRenderBackendQueryObject qo) override;
- void BeginQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) override;
- void EndQuery(NVRenderBackendQueryObject qo, NVRenderQueryType::Enum type) override;
- void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU32 *params) override;
- void GetQueryResult(NVRenderBackendQueryObject qo,
- NVRenderQueryResultType::Enum resultType, QT3DSU64 *params) override;
- void SetQueryTimer(NVRenderBackendQueryObject qo) override;
-
- NVRenderBackendSyncObject CreateSync(NVRenderSyncType::Enum tpye,
- NVRenderSyncFlags syncFlags) override;
- void ReleaseSync(NVRenderBackendSyncObject so) override;
- void WaitSync(NVRenderBackendSyncObject so, NVRenderCommandFlushFlags syncFlags,
- QT3DSU64 timeout) override;
-
- NVRenderBackendRenderTargetObject CreateRenderTarget() override;
- void ReleaseRenderTarget(NVRenderBackendRenderTargetObject rto) override;
- void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendRenderbufferObject rbo) override;
- void RenderTargetAttach(
- NVRenderBackendRenderTargetObject rto, NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target = NVRenderTextureTargetType::Texture2D) override;
- void RenderTargetAttach(NVRenderBackendRenderTargetObject rto,
- NVRenderFrameBufferAttachments::Enum attachment,
- NVRenderBackendTextureObject to, QT3DSI32 level, QT3DSI32 layer) override;
- void SetRenderTarget(NVRenderBackendRenderTargetObject rto) override;
- bool RenderTargetIsValid(NVRenderBackendRenderTargetObject rto) override;
-
- virtual NVRenderBackendRenderbufferObject
- CreateRenderbuffer(NVRenderRenderBufferFormats::Enum storageFormat, size_t width,
- size_t height) override;
- void ReleaseRenderbuffer(NVRenderBackendRenderbufferObject rbo) override;
- bool ResizeRenderbuffer(NVRenderBackendRenderbufferObject rbo,
- NVRenderRenderBufferFormats::Enum storageFormat,
- size_t width, size_t height) override;
-
- NVRenderBackendTextureObject CreateTexture() override;
- void BindTexture(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 unit) override;
- void BindImageTexture(NVRenderBackendTextureObject to, QT3DSU32 unit, QT3DSI32 level,
- bool layered, QT3DSI32 layer,
- NVRenderImageAccessType::Enum access,
- NVRenderTextureFormats::Enum format) override;
- void ReleaseTexture(NVRenderBackendTextureObject to) override;
- void SetTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) override;
- void SetTextureDataCubeFace(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) override;
- void CreateTextureStorage2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 levels,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height) override;
- void SetTextureSubData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- QT3DSI32 xOffset, QT3DSI32 yOffset, size_t width, size_t height,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) override;
- void SetCompressedTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height, QT3DSI32 border,
- size_t imageSize, const void *hostPtr = NULL) override;
- void SetCompressedTextureDataCubeFace(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height, QT3DSI32 border,
- size_t imageSize, const void *hostPtr = NULL) override;
- void SetCompressedTextureSubData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- QT3DSU32 level, QT3DSI32 xOffset, QT3DSI32 yOffset,
- size_t width, size_t height,
- NVRenderTextureFormats::Enum format,
- size_t imageSize, const void *hostPtr = NULL) override;
- void SetMultisampledTextureData2D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- size_t samples,
- NVRenderTextureFormats::Enum internalFormat,
- size_t width, size_t height,
- bool fixedsamplelocations) override = 0;
-
- void SetTextureData3D(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSU32 level,
- NVRenderTextureFormats::Enum internalFormat, size_t width,
- size_t height, size_t depth, QT3DSI32 border,
- NVRenderTextureFormats::Enum format,
- const void *hostPtr = NULL) override;
-
- void GenerateMipMaps(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderHint::Enum genType) override;
-
- virtual NVRenderTextureSwizzleMode::Enum
- GetTextureSwizzleMode(const NVRenderTextureFormats::Enum inFormat) const override;
-
- NVRenderBackendSamplerObject CreateSampler(
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- QT3DSI32 minLod = -1000, QT3DSI32 maxLod = 1000, QT3DSF32 lodBias = 0.0,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0, QT3DSF32 *borderColor = NULL) override;
-
- void UpdateSampler(
- NVRenderBackendSamplerObject so, NVRenderTextureTargetType::Enum target,
- NVRenderTextureMinifyingOp::Enum minFilter = NVRenderTextureMinifyingOp::Linear,
- NVRenderTextureMagnifyingOp::Enum magFilter = NVRenderTextureMagnifyingOp::Linear,
- NVRenderTextureCoordOp::Enum wrapS = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapT = NVRenderTextureCoordOp::ClampToEdge,
- NVRenderTextureCoordOp::Enum wrapR = NVRenderTextureCoordOp::ClampToEdge,
- QT3DSF32 minLod = -1000.0, QT3DSF32 maxLod = 1000.0, QT3DSF32 lodBias = 0.0,
- NVRenderTextureCompareMode::Enum compareMode = NVRenderTextureCompareMode::NoCompare,
- NVRenderTextureCompareOp::Enum compareFunc = NVRenderTextureCompareOp::LessThanOrEqual,
- QT3DSF32 anisotropy = 1.0, QT3DSF32 *borderColor = NULL) override;
-
- void UpdateTextureObject(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target, QT3DSI32 baseLevel,
- QT3DSI32 maxLevel) override;
-
- void UpdateTextureSwizzle(NVRenderBackendTextureObject to,
- NVRenderTextureTargetType::Enum target,
- NVRenderTextureSwizzleMode::Enum swizzleMode) override;
-
- void ReleaseSampler(NVRenderBackendSamplerObject so) override;
-
- virtual NVRenderBackendAttribLayoutObject
- CreateAttribLayout(NVConstDataRef<NVRenderVertexBufferEntry> attribs) override;
- void ReleaseAttribLayout(NVRenderBackendAttribLayoutObject ao) override;
-
- virtual NVRenderBackendInputAssemblerObject
- CreateInputAssembler(NVRenderBackendAttribLayoutObject attribLayout,
- NVConstDataRef<NVRenderBackendBufferObject> buffers,
- const NVRenderBackendBufferObject indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets,
- QT3DSU32 patchVertexCount) override;
- void ReleaseInputAssembler(NVRenderBackendInputAssemblerObject iao) override;
-
- bool SetInputAssembler(NVRenderBackendInputAssemblerObject iao,
- NVRenderBackendShaderProgramObject po) override = 0;
- void SetPatchVertexCount(NVRenderBackendInputAssemblerObject, QT3DSU32) override
- {
- QT3DS_ASSERT(false);
- }
-
- // shader
- virtual NVRenderBackendVertexShaderObject
- CreateVertexShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage, bool binary) override;
- virtual NVRenderBackendFragmentShaderObject
- CreateFragmentShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage, bool binary) override;
- virtual NVRenderBackendTessControlShaderObject
- CreateTessControlShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) override;
- virtual NVRenderBackendTessEvaluationShaderObject
- CreateTessEvaluationShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage,
- bool binary) override;
- virtual NVRenderBackendGeometryShaderObject
- CreateGeometryShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage, bool binary) override;
- virtual NVRenderBackendComputeShaderObject
- CreateComputeShader(NVConstDataRef<QT3DSI8> source, eastl::string &errorMessage, bool binary) override;
- void ReleaseVertexShader(NVRenderBackendVertexShaderObject vso) override;
- void ReleaseFragmentShader(NVRenderBackendFragmentShaderObject fso) override;
- void ReleaseTessControlShader(NVRenderBackendTessControlShaderObject tcso) override;
- void ReleaseTessEvaluationShader(NVRenderBackendTessEvaluationShaderObject teso) override;
- void ReleaseGeometryShader(NVRenderBackendGeometryShaderObject gso) override;
- void ReleaseComputeShader(NVRenderBackendComputeShaderObject cso) override;
- void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendVertexShaderObject vso) override;
- void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendFragmentShaderObject fso) override;
- void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessControlShaderObject tcso) override;
- void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessEvaluationShaderObject teso) override;
- void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendGeometryShaderObject gso) override;
- void AttachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendComputeShaderObject cso) override;
- void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendVertexShaderObject vso) override;
- void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendFragmentShaderObject fso) override;
- void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessControlShaderObject tcso) override;
- void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendTessEvaluationShaderObject teso) override;
- void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendGeometryShaderObject gso) override;
- void DetachShader(NVRenderBackendShaderProgramObject po,
- NVRenderBackendComputeShaderObject cso) override;
- NVRenderBackendShaderProgramObject CreateShaderProgram(bool isSeparable) override;
- void ReleaseShaderProgram(NVRenderBackendShaderProgramObject po) override;
- bool LinkProgram(NVRenderBackendShaderProgramObject po,
- eastl::string &errorMessage) override;
- void SetActiveProgram(NVRenderBackendShaderProgramObject po) override;
- void DispatchCompute(NVRenderBackendShaderProgramObject po, QT3DSU32 numGroupsX,
- QT3DSU32 numGroupsY, QT3DSU32 numGroupsZ) override;
- NVRenderBackendProgramPipeline CreateProgramPipeline() override;
- void ReleaseProgramPipeline(NVRenderBackendProgramPipeline po) override;
- void SetActiveProgramPipeline(NVRenderBackendProgramPipeline po) override;
- void SetProgramStages(NVRenderBackendProgramPipeline ppo,
- NVRenderShaderTypeFlags flags,
- NVRenderBackendShaderProgramObject po) override;
-
- // uniforms
- QT3DSI32 GetConstantCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetConstantInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 bufSize, QT3DSI32 *numElem,
- NVRenderShaderDataTypes::Enum *type, QT3DSI32 *binding,
- char *nameBuf) override;
- void SetConstantValue(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- NVRenderShaderDataTypes::Enum type, QT3DSI32 count,
- const void *value, bool transpose) override;
-
- // uniform buffers
- QT3DSI32 GetConstantBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length, char *nameBuf) override;
- void GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSI32 *indices) override;
- void GetConstantBufferParamInfoByIndices(NVRenderBackendShaderProgramObject po,
- QT3DSU32 count, QT3DSU32 *indices, QT3DSI32 *type,
- QT3DSI32 *size, QT3DSI32 *offset) override;
- void ProgramSetConstantBlock(NVRenderBackendShaderProgramObject po,
- QT3DSU32 blockIndex, QT3DSU32 binding) override;
- void ProgramSetConstantBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- // storage buffers
- QT3DSI32 GetStorageBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetStorageBufferInfoByID(NVRenderBackendShaderProgramObject po, QT3DSU32 id,
- QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length, char *nameBuf) override;
- void ProgramSetStorageBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- // atomic counter buffers
- QT3DSI32 GetAtomicCounterBufferCount(NVRenderBackendShaderProgramObject po) override;
- QT3DSI32 GetAtomicCounterBufferInfoByID(NVRenderBackendShaderProgramObject po,
- QT3DSU32 id, QT3DSU32 nameBufSize, QT3DSI32 *paramCount,
- QT3DSI32 *bufferSize, QT3DSI32 *length,
- char *nameBuf) override;
- void ProgramSetAtomicCounterBuffer(QT3DSU32 index, NVRenderBackendBufferObject bo) override;
-
- /// draw calls
- void Draw(NVRenderDrawMode::Enum drawMode, QT3DSU32 start, QT3DSU32 count) override;
- void DrawIndirect(NVRenderDrawMode::Enum drawMode, const void *indirect) override;
- void DrawIndexed(NVRenderDrawMode::Enum drawMode, QT3DSU32 count,
- NVRenderComponentTypes::Enum type, const void *indices) override;
- void DrawIndexedIndirect(NVRenderDrawMode::Enum drawMode,
- NVRenderComponentTypes::Enum type, const void *indirect) override;
-
- // read calls
- void ReadPixel(NVRenderBackendRenderTargetObject rto, QT3DSI32 x, QT3DSI32 y, QT3DSI32 width,
- QT3DSI32 height, NVRenderReadPixelFormats::Enum inFormat, void *pixels) override;
-
- // NV path rendering
- NVRenderBackendPathObject CreatePathNVObject(size_t range) override;
- // Pathing requires gl4 backend.
- void SetPathSpecification(NVRenderBackendPathObject, NVConstDataRef<QT3DSU8>,
- NVConstDataRef<QT3DSF32>) override
- {
- }
-
- ///< Bounds of the fill and stroke
- NVBounds3 GetPathObjectBoundingBox(NVRenderBackendPathObject /*inPathObject*/) override
- {
- return NVBounds3();
- }
- NVBounds3 GetPathObjectFillBox(NVRenderBackendPathObject /*inPathObject*/) override
- {
- return NVBounds3();
- }
- NVBounds3 GetPathObjectStrokeBox(NVRenderBackendPathObject /*inPathObject*/) override
- {
- return NVBounds3();
- }
-
- /**
- * Defaults to 0 if unset.
- */
- void SetStrokeWidth(NVRenderBackendPathObject /*inPathObject*/, QT3DSF32) override {}
- void SetPathProjectionMatrix(const QT3DSMat44 /*inPathProjection*/) override {}
- void SetPathModelViewMatrix(const QT3DSMat44 /*inPathModelview*/) override {}
- void SetPathStencilDepthOffset(QT3DSF32 /*inSlope*/, QT3DSF32 /*inBias*/) override {}
- void SetPathCoverDepthFunc(NVRenderBoolOp::Enum /*inDepthFunction*/) override {}
- void StencilStrokePath(NVRenderBackendPathObject /*inPathObject*/) override {}
- void StencilFillPath(NVRenderBackendPathObject /*inPathObject*/) override {}
- void ReleasePathNVObject(NVRenderBackendPathObject po, size_t range) override;
-
- void LoadPathGlyphs(NVRenderBackendPathObject, NVRenderPathFontTarget::Enum,
- const void *, NVRenderPathFontStyleFlags, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathMissingGlyphs::Enum, NVRenderBackendPathObject,
- QT3DSF32) override;
- virtual NVRenderPathReturnValues::Enum
- LoadPathGlyphsIndexed(NVRenderBackendPathObject po, NVRenderPathFontTarget::Enum fontTarget,
- const void *fontName, NVRenderPathFontStyleFlags fontStyle,
- QT3DSU32 firstGlyphIndex, size_t numGlyphs,
- NVRenderBackendPathObject pathParameterTemplate, QT3DSF32 emScale) override;
- virtual NVRenderBackendPathObject
- LoadPathGlyphsIndexedRange(NVRenderPathFontTarget::Enum, const void *,
- NVRenderPathFontStyleFlags,
- NVRenderBackend::NVRenderBackendPathObject, QT3DSF32, QT3DSU32 *) override;
- void LoadPathGlyphRange(NVRenderBackendPathObject, NVRenderPathFontTarget::Enum,
- const void *, NVRenderPathFontStyleFlags, QT3DSU32, size_t,
- NVRenderPathMissingGlyphs::Enum, NVRenderBackendPathObject,
- QT3DSF32) override;
- void GetPathMetrics(NVRenderBackendPathObject, size_t,
- NVRenderPathGlyphFontMetricFlags, NVRenderPathFormatType::Enum,
- const void *, size_t, QT3DSF32 *) override;
- void GetPathMetricsRange(NVRenderBackendPathObject, size_t,
- NVRenderPathGlyphFontMetricFlags, size_t, QT3DSF32 *) override;
- void GetPathSpacing(NVRenderBackendPathObject, size_t, NVRenderPathListMode::Enum,
- NVRenderPathFormatType::Enum, const void *, QT3DSF32, QT3DSF32,
- NVRenderPathTransformType::Enum, QT3DSF32 *) override;
-
- void StencilFillPathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathFillMode::Enum, QT3DSU32,
- NVRenderPathTransformType::Enum, const QT3DSF32 *) override;
- void StencilStrokePathInstancedN(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *, QT3DSI32,
- QT3DSU32, NVRenderPathTransformType::Enum,
- const QT3DSF32 *) override;
- void CoverFillPathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathCoverMode::Enum,
- NVRenderPathTransformType::Enum, const QT3DSF32 *) override;
- void CoverStrokePathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathCoverMode::Enum,
- NVRenderPathTransformType::Enum, const QT3DSF32 *) override;
-
- QSurfaceFormat format() const override
- {
- return m_format;
- }
-
- protected:
- virtual NVFoundationBase &GetFoundation() { return m_Foundation; }
- virtual bool compileSource(GLuint shaderID, NVConstDataRef<QT3DSI8> source,
- eastl::string &errorMessage, bool binary);
- virtual const char *getVersionString();
- virtual const char *getVendorString();
- virtual const char *getRendererString();
- virtual const char *getExtensionString();
-
- virtual void setAndInspectHardwareCaps();
-
- protected:
- volatile QT3DSI32 mRefCount; ///< reference count
- NVFoundationBase &m_Foundation; ///< Foundation class for allocations and other base things
- NVScopedRefCounted<qt3ds::foundation::IStringTable>
- m_StringTable; ///< pointer to a string table
- GLConversion m_Conversion; ///< Class for conversion from base type to GL types
- QStringList m_extensions; ///< contains the OpenGL extension string
- QT3DSI32 m_MaxAttribCount; ///< Maximum attributes which can be used
- nvvector<GLenum> m_DrawBuffersArray; ///< Contains the drawbuffer enums
- QSurfaceFormat m_format;
-
- NVRenderBackendRasterizerStateGL
- *m_pCurrentRasterizerState; ///< this holds the current rasterizer state
- NVRenderBackendDepthStencilStateGL
- *m_pCurrentDepthStencilState; ///< this holds the current depth stencil state
-
-#ifdef RENDER_BACKEND_LOG_GL_ERRORS
- void checkGLError(const char *function, const char *file, const unsigned int line) const;
-#else
- void checkGLError() const;
-#endif
- QOpenGLFunctions *m_glFunctions;
- QOpenGLExtraFunctions *m_glExtraFunctions;
- GLfloat m_maxAnisotropy;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h
deleted file mode 100644
index e14111af..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendInputAssemblerGL.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_INPUT_ASSEMBLER_GL_H
-#define QT3DS_RENDER_BACKEND_INPUT_ASSEMBLER_GL_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/StringTable.h"
-#include "foundation/Utils.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- struct NVRenderBackendLayoutEntryGL
- {
- CRegisteredString m_AttribName; ///< must be the same name as used in the vertex shader
- QT3DSU8 m_Normalize; ///< normalize parameter
- QT3DSU32 m_AttribIndex; ///< attribute index
- QT3DSU32 m_Type; ///< GL vertex format type @sa GL_FLOAT, GL_INT
- QT3DSU32 m_NumComponents; ///< component count. max 4
- QT3DSU32 m_InputSlot; ///< Input slot where to fetch the data from
- QT3DSU32 m_Offset; ///< offset in byte
- };
-
- ///< this class handles the vertex attribute layout setup
- class NVRenderBackendAttributeLayoutGL
- {
- public:
- ///< constructor
- NVRenderBackendAttributeLayoutGL(NVDataRef<NVRenderBackendLayoutEntryGL> entries,
- QT3DSU32 maxInputSlot)
- : m_LayoutAttribEntries(entries)
- , m_MaxInputSlot(maxInputSlot)
- {
- }
- ///< destructor
- ~NVRenderBackendAttributeLayoutGL(){}
-
- NVRenderBackendLayoutEntryGL *getEntryByName(CRegisteredString entryName) const
- {
- QT3DS_FOREACH(idx, m_LayoutAttribEntries.size())
- {
- if (m_LayoutAttribEntries[idx].m_AttribName == entryName)
- return &m_LayoutAttribEntries.mData[idx];
- }
- return NULL;
- }
-
- Option<NVRenderBackendLayoutEntryGL> getEntryByAttribIndex(QT3DSU32 attribIndex) const
- {
- QT3DS_FOREACH(idx, m_LayoutAttribEntries.size())
- {
- if (m_LayoutAttribEntries[idx].m_AttribIndex == attribIndex)
- return m_LayoutAttribEntries[idx];
- }
- return Empty();
- }
-
- NVDataRef<NVRenderBackendLayoutEntryGL>
- m_LayoutAttribEntries; ///< vertex attribute layout entries
- QT3DSU32 m_MaxInputSlot; ///< max used input slot
- };
-
- ///< this class handles the input assembler setup
- class NVRenderBackendInputAssemblerGL
- {
- public:
- ///< constructor
- NVRenderBackendInputAssemblerGL(
- NVFoundationBase &fnd, NVRenderBackendAttributeLayoutGL *attribLayout,
- NVConstDataRef<NVRenderBackend::NVRenderBackendBufferObject> buffers,
- const NVRenderBackend::NVRenderBackendBufferObject indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets, QT3DSU32 patchVertexCount)
- : m_Foundation(fnd)
- , m_attribLayout(attribLayout)
- , m_VertexbufferHandles(buffers)
- , m_IndexbufferHandle(indexBuffer)
- , m_VaoID(0)
- , m_cachedShaderHandle(0)
- , m_PatchVertexCount(patchVertexCount)
- {
- QT3DSU32 *strideMem = (QT3DSU32 *)QT3DS_ALLOC(fnd.getAllocator(), strides.mSize * sizeof(QT3DSU32),
- "BackendAttributeLayoutGL:m_strides");
- QT3DSU32 *offsetMem = (QT3DSU32 *)QT3DS_ALLOC(fnd.getAllocator(), strides.mSize * sizeof(QT3DSU32),
- "BackendAttributeLayoutGL:m_strides");
- // copy offsets and strides
- QT3DS_FOREACH(idx, strides.size())
- {
- strideMem[idx] = strides.mData[idx];
- offsetMem[idx] = offsets.mData[idx];
- }
-
- m_strides = toDataRef(strideMem, strides.size());
- m_offsets = toDataRef(offsetMem, offsets.size());
- }
- ///< destructor
- ~NVRenderBackendInputAssemblerGL()
- {
- QT3DS_FREE(m_Foundation.getAllocator(), m_strides.mData);
- QT3DS_FREE(m_Foundation.getAllocator(), m_offsets.mData);
- };
-
- NVFoundationBase &m_Foundation; ///< pointer to foundation
- NVRenderBackendAttributeLayoutGL *m_attribLayout; ///< pointer to attribute layout
- NVConstDataRef<NVRenderBackend::NVRenderBackendBufferObject>
- m_VertexbufferHandles; ///< opaque vertex buffer backend handles
- NVRenderBackend::NVRenderBackendBufferObject
- m_IndexbufferHandle; ///< opaque index buffer backend handles
- QT3DSU32 m_VaoID; ///< this is only used if GL version is greater or equal 3
- QT3DSU32 m_cachedShaderHandle; ///< this is the shader id which was last used with this object
- QT3DSU32 m_PatchVertexCount; ///< vertex count for a single patch primitive
- NVDataRef<QT3DSU32> m_strides; ///< buffer strides
- NVDataRef<QT3DSU32> m_offsets; ///< buffer offsets
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h
deleted file mode 100644
index 3a74a8e3..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendRenderStatesGL.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_RENDER_STATE_OBJECTS_GL_H
-#define QT3DS_RENDER_BACKEND_RENDER_STATE_OBJECTS_GL_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Utils.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- ///< this class handles the shader input variables
- class NVRenderBackendDepthStencilStateGL
- {
- public:
- ///< constructor
- NVRenderBackendDepthStencilStateGL(bool enableDepth, bool depthMask,
- NVRenderBoolOp::Enum depthFunc, bool enableStencil,
- NVRenderStencilFunctionArgument &stencilFuncFront,
- NVRenderStencilFunctionArgument &stencilFuncBack,
- NVRenderStencilOperationArgument &depthStencilOpFront,
- NVRenderStencilOperationArgument &depthStencilOpBack)
- : m_DepthEnable(enableDepth)
- , m_DepthMask(depthMask)
- , m_DepthFunc(depthFunc)
- , m_StencilEnable(enableStencil)
- , m_StencilFuncFront(stencilFuncFront)
- , m_StencilFuncBack(stencilFuncBack)
- , m_DepthStencilOpFront(depthStencilOpFront)
- , m_DepthStencilOpBack(depthStencilOpBack)
- {
- }
-
- ///< constructor
- NVRenderBackendDepthStencilStateGL()
- : m_DepthEnable(true)
- , m_DepthMask(true)
- , m_DepthFunc(NVRenderBoolOp::LessThanOrEqual)
- , m_StencilEnable(false)
- {
- }
-
- ///< destructor
- ~NVRenderBackendDepthStencilStateGL(){}
-
- ///< assignement
- NVRenderBackendDepthStencilStateGL &operator=(const NVRenderBackendDepthStencilStateGL &rhs)
- {
- // Check for self-assignment!
- if (this == &rhs)
- return *this;
-
- m_DepthEnable = rhs.m_DepthEnable;
- m_DepthMask = rhs.m_DepthMask;
- m_DepthFunc = rhs.m_DepthFunc;
- m_StencilEnable = rhs.m_StencilEnable;
- m_StencilFuncFront = rhs.m_StencilFuncFront;
- m_StencilFuncBack = rhs.m_StencilFuncBack;
- m_DepthStencilOpFront = rhs.m_DepthStencilOpFront;
- m_DepthStencilOpBack = rhs.m_DepthStencilOpBack;
-
- return *this;
- }
-
- bool operator==(const NVRenderBackendDepthStencilStateGL &other) const
- {
- return (m_DepthEnable == other.m_DepthEnable && m_DepthMask == other.m_DepthMask
- && m_DepthFunc == other.m_DepthFunc && m_StencilEnable == other.m_StencilEnable
- && m_StencilFuncFront == other.m_StencilFuncFront
- && m_StencilFuncBack == other.m_StencilFuncBack
- && m_DepthStencilOpFront == other.m_DepthStencilOpFront
- && m_DepthStencilOpBack == other.m_DepthStencilOpBack);
- }
-
- bool m_DepthEnable; ///< depth test enabled
- bool m_DepthMask; ///< enable / disable depth writes
- NVRenderBoolOp::Enum m_DepthFunc; ///< depth comparison func
- bool m_StencilEnable; ///< enable disable stencil test
- NVRenderStencilFunctionArgument m_StencilFuncFront; ///< stencil setup for front faces
- NVRenderStencilFunctionArgument m_StencilFuncBack; ///< stencil setup for back faces
- NVRenderStencilOperationArgument
- m_DepthStencilOpFront; ///< depth stencil operation for front faces
- NVRenderStencilOperationArgument
- m_DepthStencilOpBack; ///< depth stencil operation for back faces
- };
-
- class NVRenderBackendMiscStateGL
- {
- public:
- ///< constructor
- NVRenderBackendMiscStateGL()
- : m_PatchVertexCount(1)
- {
- }
-
- QT3DSU32 m_PatchVertexCount; ///< vertex count for a single patch primitive
- };
-
- class NVRenderBackendRasterizerStateGL
- {
- public:
- ///< constructor
- NVRenderBackendRasterizerStateGL(QT3DSF32 depthBias, QT3DSF32 depthScale,
- NVRenderFaces::Enum cullFace)
- : m_DepthBias(depthBias)
- , m_DepthScale(depthScale)
- , m_CullFace(cullFace)
- {
- }
- ///< constructor
- NVRenderBackendRasterizerStateGL()
- : m_DepthBias(0.0)
- , m_DepthScale(0.0)
- , m_CullFace(NVRenderFaces::Back)
- {
- }
-
- NVRenderBackendRasterizerStateGL &operator=(const NVRenderBackendRasterizerStateGL &rhs)
- {
- // Check for self-assignment!
- if (this == &rhs)
- return *this;
-
- m_DepthBias = rhs.m_DepthBias;
- m_DepthScale = rhs.m_DepthScale;
- m_CullFace = rhs.m_CullFace;
-
- return *this;
- }
-
- bool operator==(const NVRenderBackendRasterizerStateGL &other) const
- {
- return (m_DepthBias == other.m_DepthBias && m_DepthScale == other.m_DepthScale
- && m_CullFace == other.m_CullFace);
- }
-
- QT3DSF32 m_DepthBias; ///< depth bias
- QT3DSF32 m_DepthScale; ///< mulitply constant
- NVRenderFaces::Enum m_CullFace; ///< cull face front or back
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h
deleted file mode 100644
index f7caffd8..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderBackendShaderProgramGL.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_SHADER_PROGRAM_GL_H
-#define QT3DS_RENDER_BACKEND_SHADER_PROGRAM_GL_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Utils.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- struct NVRenderBackendShaderInputEntryGL
- {
- CRegisteredString m_AttribName; ///< must be the same name as used in the vertex shader
- QT3DSU32 m_AttribLocation; ///< attribute index
- QT3DSU32 m_Type; ///< GL vertex format type @sa GL_FLOAT, GL_INT
- QT3DSU32 m_NumComponents; ///< component count. max 4
- };
-
- ///< this class handles the shader input variables
- class NVRenderBackendShaderInputGL
- {
- public:
- ///< constructor
- NVRenderBackendShaderInputGL(NVDataRef<NVRenderBackendShaderInputEntryGL> entries)
- : m_ShaderInputEntries(entries)
- {
- }
- ///< destructor
- ~NVRenderBackendShaderInputGL(){}
-
- NVRenderBackendShaderInputEntryGL *getEntryByName(CRegisteredString entryName) const
- {
- QT3DS_FOREACH(idx, m_ShaderInputEntries.size())
- {
- if (m_ShaderInputEntries[idx].m_AttribName == entryName)
- return &m_ShaderInputEntries.mData[idx];
- }
- return NULL;
- }
-
- Option<NVRenderBackendShaderInputEntryGL>
- getEntryByAttribLocation(QT3DSU32 attribLocation) const
- {
- QT3DS_FOREACH(idx, m_ShaderInputEntries.size())
- {
- if (m_ShaderInputEntries[idx].m_AttribLocation == attribLocation)
- return m_ShaderInputEntries[idx];
- }
- return Empty();
- }
-
- NVDataRef<NVRenderBackendShaderInputEntryGL> m_ShaderInputEntries; ///< shader input entries
- };
-
- ///< this class represents the internals of a GL program
- class NVRenderBackendShaderProgramGL
- {
- public:
- ///< constructor
- NVRenderBackendShaderProgramGL(QT3DSU32 programID)
- : m_ProgramID(programID)
- , m_shaderInput(NULL)
- {
- }
-
- ///< destructor
- ~NVRenderBackendShaderProgramGL(){}
-
- QT3DSU32 m_ProgramID; ///< this is the OpenGL object ID
- NVRenderBackendShaderInputGL *m_shaderInput; ///< pointer to shader input object
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderContextGL.cpp b/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderContextGL.cpp
deleted file mode 100644
index 88670ef7..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/gl/Qt3DSRenderContextGL.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSMat44.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Utils.h"
-#include "EASTL/set.h"
-#include "EASTL/utility.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace eastl;
-
-namespace qt3ds {
-namespace render {
-
- NVRenderContext &NVRenderContext::CreateGL(NVFoundationBase &foundation,
- IStringTable &inStringTable,
- const QSurfaceFormat &format)
- {
- NVRenderContext *retval = NULL;
-
- QT3DS_ASSERT(format.majorVersion() >= 2);
-
- // create backend
- NVScopedRefCounted<IStringTable> theStringTable(inStringTable);
- NVScopedRefCounted<NVRenderBackend> theBackend;
- bool isES = format.renderableType() == QSurfaceFormat::OpenGLES;
- if (isES && (format.majorVersion() == 2
- || (format.majorVersion() == 3 && format.minorVersion() == 0))) {
- theBackend = QT3DS_NEW(foundation.getAllocator(), NVRenderBackendGLES2Impl)(foundation,
- *theStringTable,
- format);
- } else if (format.majorVersion() == 3 && format.minorVersion() >= 1 && !isES) {
- theBackend = QT3DS_NEW(foundation.getAllocator(), NVRenderBackendGL3Impl)(foundation,
- *theStringTable,
- format);
- } else if (format.majorVersion() == 4
- || (isES && format.majorVersion() == 3 && format.minorVersion() >= 1)) {
-#ifdef Q_OS_MACOS
- // TODO: macOS crashes with glTextStorage2DMultisample, so fall back to OpenGL3
- // for now (QT3DS-590)
- theBackend = QT3DS_NEW(foundation.getAllocator(), NVRenderBackendGL3Impl)(foundation,
- *theStringTable,
- format);
-#else
- theBackend = QT3DS_NEW(foundation.getAllocator(), NVRenderBackendGL4Impl)(foundation,
- *theStringTable,
- format);
-#endif
- } else {
- QT3DS_ASSERT(false);
- qCCritical(INTERNAL_ERROR) << "Can't find a suitable OpenGL version for" << format;
- }
-
-
- retval = QT3DS_NEW(foundation.getAllocator(), NVRenderContextImpl)(foundation, *theBackend,
- *theStringTable);
-
- return *retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.cpp b/src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.cpp
deleted file mode 100644
index af93e928..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.cpp
+++ /dev/null
@@ -1,588 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "render/backends/software/Qt3DSRenderBackendNULL.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-
-#include <QSurfaceFormat>
-
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-using namespace qt3ds;
-
-namespace {
-struct SNullBackend : public NVRenderBackend
-{
- NVFoundationBase &m_Foundation;
- QT3DSI32 mRefCount;
-
- SNullBackend(NVFoundationBase &fnd)
- : m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- /// backend interface
-
- NVRenderContextType GetRenderContextType() const override
- {
- return NVRenderContextValues::NullContext;
- }
- const char *GetShadingLanguageVersion() override { return ""; }
- QT3DSU32 GetMaxCombinedTextureUnits() override { return 32; }
- bool GetRenderBackendCap(NVRenderBackendCaps::Enum) const override { return false; }
- void GetRenderBackendValue(NVRenderBackendQuery::Enum inQuery, QT3DSI32 *params) const override
- {
- if (params) {
- switch (inQuery) {
- case NVRenderBackendQuery::MaxTextureSize:
- *params = 4096;
- break;
- case NVRenderBackendQuery::MaxTextureArrayLayers:
- *params = 0;
- break;
- default:
- QT3DS_ASSERT(false);
- *params = 0;
- break;
- }
- }
- }
- QT3DSU32 GetDepthBits() const override { return 16; }
- QT3DSU32 GetStencilBits() const override { return 0; }
- void SetRenderState(bool, const NVRenderState::Enum) override {}
- bool GetRenderState(const NVRenderState::Enum) override { return false; }
- virtual NVRenderBackendDepthStencilStateObject
- CreateDepthStencilState(bool, bool, NVRenderBoolOp::Enum, bool,
- NVRenderStencilFunctionArgument &, NVRenderStencilFunctionArgument &,
- NVRenderStencilOperationArgument &, NVRenderStencilOperationArgument &) override
- {
- return NVRenderBackendDepthStencilStateObject(1);
- }
- void ReleaseDepthStencilState(NVRenderBackendDepthStencilStateObject) override {}
- NVRenderBackendRasterizerStateObject CreateRasterizerState(QT3DSF32, QT3DSF32,
- NVRenderFaces::Enum) override
- {
- return NVRenderBackendRasterizerStateObject(1);
- }
- void ReleaseRasterizerState(NVRenderBackendRasterizerStateObject) override {}
- void SetDepthStencilState(NVRenderBackendDepthStencilStateObject) override {}
- void SetRasterizerState(NVRenderBackendRasterizerStateObject) override {}
- NVRenderBoolOp::Enum GetDepthFunc() override { return NVRenderBoolOp::Equal; }
- void SetDepthFunc(const NVRenderBoolOp::Enum) override {}
- bool GetDepthWrite() override { return false; }
-
- void SetDepthWrite(bool) override {}
- void SetColorWrites(bool, bool, bool, bool) override {}
- void SetMultisample(bool) override {}
- void GetBlendFunc(NVRenderBlendFunctionArgument *) override {}
- void SetBlendFunc(const NVRenderBlendFunctionArgument &) override {}
- void SetBlendEquation(const NVRenderBlendEquationArgument &) override {}
- void SetBlendBarrier(void) override {}
- void GetScissorRect(NVRenderRect *) override {}
- void SetScissorRect(const NVRenderRect &) override {}
- void GetViewportRect(NVRenderRect *) override {}
- void SetViewportRect(const NVRenderRect &) override {}
- void SetClearColor(const QT3DSVec4 *) override {}
- void Clear(NVRenderClearFlags) override {}
- NVRenderBackendBufferObject CreateBuffer(size_t, NVRenderBufferBindFlags,
- NVRenderBufferUsageType::Enum, const void *) override
- {
- return NVRenderBackendBufferObject(1);
- }
- void BindBuffer(NVRenderBackendBufferObject, NVRenderBufferBindFlags) override {}
- void ReleaseBuffer(NVRenderBackendBufferObject) override {}
-
- void UpdateBuffer(NVRenderBackendBufferObject, NVRenderBufferBindFlags, size_t,
- NVRenderBufferUsageType::Enum, const void *) override
- {
- }
- void UpdateBufferRange(NVRenderBackendBufferObject, NVRenderBufferBindFlags, size_t, size_t,
- const void *) override
- {
- }
- void *MapBuffer(NVRenderBackendBufferObject, NVRenderBufferBindFlags, size_t, size_t,
- NVRenderBufferAccessFlags) override
- {
- return NULL;
- }
- bool UnmapBuffer(NVRenderBackendBufferObject, NVRenderBufferBindFlags) override { return true; }
- void SetMemoryBarrier(NVRenderBufferBarrierFlags) override {}
- NVRenderBackendQueryObject CreateQuery() override { return NVRenderBackendQueryObject(1); }
- void ReleaseQuery(NVRenderBackendQueryObject) override {}
- void BeginQuery(NVRenderBackendQueryObject, NVRenderQueryType::Enum) override {}
- void EndQuery(NVRenderBackendQueryObject, NVRenderQueryType::Enum) override {}
- void GetQueryResult(NVRenderBackendQueryObject, NVRenderQueryResultType::Enum,
- QT3DSU32 *) override {}
- void GetQueryResult(NVRenderBackendQueryObject, NVRenderQueryResultType::Enum,
- QT3DSU64 *) override {}
- void SetQueryTimer(NVRenderBackendQueryObject) override {}
- NVRenderBackendSyncObject CreateSync(NVRenderSyncType::Enum, NVRenderSyncFlags) override
- {
- return NVRenderBackendSyncObject(1);
- };
- void ReleaseSync(NVRenderBackendSyncObject) override {}
- void WaitSync(NVRenderBackendSyncObject, NVRenderCommandFlushFlags, QT3DSU64) override {}
- NVRenderBackendRenderTargetObject CreateRenderTarget() override
- {
- return NVRenderBackendRenderTargetObject(1);
- }
- void ReleaseRenderTarget(NVRenderBackendRenderTargetObject) override {}
- void RenderTargetAttach(NVRenderBackendRenderTargetObject,
- NVRenderFrameBufferAttachments::Enum,
- NVRenderBackendRenderbufferObject) override
- {
- }
- void RenderTargetAttach(NVRenderBackendRenderTargetObject,
- NVRenderFrameBufferAttachments::Enum,
- NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum) override
- {
- }
- void RenderTargetAttach(NVRenderBackendRenderTargetObject,
- NVRenderFrameBufferAttachments::Enum,
- NVRenderBackendTextureObject, QT3DSI32, QT3DSI32) override
- {
- }
- void SetRenderTarget(NVRenderBackendRenderTargetObject) override {}
- bool RenderTargetIsValid(NVRenderBackendRenderTargetObject) override { return false; }
- void SetReadTarget(NVRenderBackendRenderTargetObject) override {}
- void SetDrawBuffers(NVRenderBackendRenderTargetObject, NVConstDataRef<QT3DSI32>) override {}
- void SetReadBuffer(NVRenderBackendRenderTargetObject, NVReadFaces::Enum) override {}
-
- void BlitFramebuffer(QT3DSI32, QT3DSI32, QT3DSI32, QT3DSI32, QT3DSI32, QT3DSI32, QT3DSI32, QT3DSI32,
- NVRenderClearFlags, NVRenderTextureMagnifyingOp::Enum) override
- {
- }
- NVRenderBackendRenderbufferObject CreateRenderbuffer(NVRenderRenderBufferFormats::Enum,
- size_t, size_t) override
- {
- return NVRenderBackendRenderbufferObject(1);
- }
- void ReleaseRenderbuffer(NVRenderBackendRenderbufferObject) override {}
-
- bool ResizeRenderbuffer(NVRenderBackendRenderbufferObject,
- NVRenderRenderBufferFormats::Enum, size_t, size_t) override
- {
- return false;
- }
- NVRenderBackendTextureObject CreateTexture() override { return NVRenderBackendTextureObject(1); }
-
- void SetTextureData2D(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum,
- QT3DSU32, NVRenderTextureFormats::Enum, size_t, size_t, QT3DSI32,
- NVRenderTextureFormats::Enum, const void *) override
- {
- }
- void SetTextureDataCubeFace(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32,
- NVRenderTextureFormats::Enum, size_t, size_t, QT3DSI32,
- NVRenderTextureFormats::Enum, const void *) override
- {
- }
- void CreateTextureStorage2D(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32,
- NVRenderTextureFormats::Enum, size_t, size_t) override
- {
- }
- void SetTextureSubData2D(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum,
- QT3DSU32, QT3DSI32, QT3DSI32, size_t, size_t,
- NVRenderTextureFormats::Enum, const void *) override
- {
- }
- void SetCompressedTextureData2D(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32,
- NVRenderTextureFormats::Enum, size_t, size_t, QT3DSI32,
- size_t, const void *) override
- {
- }
- void SetCompressedTextureDataCubeFace(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32,
- NVRenderTextureFormats::Enum, size_t, size_t,
- QT3DSI32, size_t, const void *) override
- {
- }
- void SetCompressedTextureSubData2D(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, QT3DSU32, QT3DSI32, QT3DSI32,
- size_t, size_t, NVRenderTextureFormats::Enum, size_t,
- const void *) override
- {
- }
- void SetMultisampledTextureData2D(NVRenderBackendTextureObject,
- NVRenderTextureTargetType::Enum, size_t,
- NVRenderTextureFormats::Enum, size_t, size_t, bool) override
- {
- }
- void SetTextureData3D(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum,
- QT3DSU32, NVRenderTextureFormats::Enum, size_t, size_t, size_t,
- QT3DSI32, NVRenderTextureFormats::Enum, const void *) override
- {
- }
- void GenerateMipMaps(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum,
- NVRenderHint::Enum) override
- {
- }
- void BindTexture(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum, QT3DSU32) override
- {
- }
- void BindImageTexture(NVRenderBackendTextureObject, QT3DSU32, QT3DSI32, bool, QT3DSI32,
- NVRenderImageAccessType::Enum, NVRenderTextureFormats::Enum) override
- {
- }
- void ReleaseTexture(NVRenderBackendTextureObject) override {}
-
- virtual NVRenderTextureSwizzleMode::Enum
- GetTextureSwizzleMode(const NVRenderTextureFormats::Enum) const override
- {
- return NVRenderTextureSwizzleMode::NoSwizzle;
- }
-
- virtual NVRenderBackendSamplerObject
- CreateSampler(NVRenderTextureMinifyingOp::Enum, NVRenderTextureMagnifyingOp::Enum,
- NVRenderTextureCoordOp::Enum, NVRenderTextureCoordOp::Enum,
- NVRenderTextureCoordOp::Enum, QT3DSI32, QT3DSI32, QT3DSF32,
- NVRenderTextureCompareMode::Enum, NVRenderTextureCompareOp::Enum, QT3DSF32, QT3DSF32 *) override
- {
- return NVRenderBackendSamplerObject(1);
- }
-
- void UpdateSampler(NVRenderBackendSamplerObject, NVRenderTextureTargetType::Enum,
- NVRenderTextureMinifyingOp::Enum, NVRenderTextureMagnifyingOp::Enum,
- NVRenderTextureCoordOp::Enum, NVRenderTextureCoordOp::Enum,
- NVRenderTextureCoordOp::Enum, QT3DSF32, QT3DSF32, QT3DSF32,
- NVRenderTextureCompareMode::Enum, NVRenderTextureCompareOp::Enum,
- QT3DSF32, QT3DSF32 *) override
- {
- }
-
- void UpdateTextureObject(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum,
- QT3DSI32, QT3DSI32) override
- {
- }
-
- void UpdateTextureSwizzle(NVRenderBackendTextureObject, NVRenderTextureTargetType::Enum,
- NVRenderTextureSwizzleMode::Enum) override
- {
- }
-
- void ReleaseSampler(NVRenderBackendSamplerObject) override {}
-
- virtual NVRenderBackendAttribLayoutObject
- CreateAttribLayout(NVConstDataRef<NVRenderVertexBufferEntry>) override
- {
- return NVRenderBackendAttribLayoutObject(1);
- }
-
- void ReleaseAttribLayout(NVRenderBackendAttribLayoutObject) override {}
-
- NVRenderBackendInputAssemblerObject CreateInputAssembler(
- NVRenderBackendAttribLayoutObject, NVConstDataRef<NVRenderBackendBufferObject>,
- const NVRenderBackendBufferObject, NVConstDataRef<QT3DSU32>, NVConstDataRef<QT3DSU32>, QT3DSU32) override
- {
- return NVRenderBackendInputAssemblerObject(1);
- }
- void ReleaseInputAssembler(NVRenderBackendInputAssemblerObject) override {}
- bool SetInputAssembler(NVRenderBackendInputAssemblerObject,
- NVRenderBackendShaderProgramObject) override
- {
- return false;
- }
- void SetPatchVertexCount(NVRenderBackendInputAssemblerObject, QT3DSU32) override {}
- NVRenderBackendVertexShaderObject CreateVertexShader(NVConstDataRef<QT3DSI8>,
- eastl::string &, bool) override
- {
- return NVRenderBackendVertexShaderObject(1);
- }
- void ReleaseVertexShader(NVRenderBackendVertexShaderObject) override {}
- NVRenderBackendFragmentShaderObject CreateFragmentShader(NVConstDataRef<QT3DSI8>,
- eastl::string &, bool) override
- {
- return NVRenderBackendFragmentShaderObject(1);
- }
- void ReleaseFragmentShader(NVRenderBackendFragmentShaderObject) override {}
- NVRenderBackendTessControlShaderObject CreateTessControlShader(NVConstDataRef<QT3DSI8>,
- eastl::string &, bool) override
- {
- return NVRenderBackendTessControlShaderObject(1);
- }
- void ReleaseTessControlShader(NVRenderBackendTessControlShaderObject) override {}
- virtual NVRenderBackendTessEvaluationShaderObject
- CreateTessEvaluationShader(NVConstDataRef<QT3DSI8>, eastl::string &, bool) override
- {
- return NVRenderBackendTessEvaluationShaderObject(1);
- }
- void ReleaseTessEvaluationShader(NVRenderBackendTessEvaluationShaderObject) override {}
- NVRenderBackendGeometryShaderObject CreateGeometryShader(NVConstDataRef<QT3DSI8>,
- eastl::string &, bool) override
- {
- return NVRenderBackendGeometryShaderObject(1);
- }
- void ReleaseGeometryShader(NVRenderBackendGeometryShaderObject) override {}
- NVRenderBackendComputeShaderObject CreateComputeShader(NVConstDataRef<QT3DSI8>,
- eastl::string &, bool) override
- {
- return NVRenderBackendComputeShaderObject(1);
- }
- void ReleaseComputeShader(NVRenderBackendComputeShaderObject) override {}
- void AttachShader(NVRenderBackendShaderProgramObject, NVRenderBackendVertexShaderObject) override
- {
- }
- void AttachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendFragmentShaderObject) override
- {
- }
- void AttachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendTessControlShaderObject) override
- {
- }
- void AttachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendTessEvaluationShaderObject) override
- {
- }
- void AttachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendGeometryShaderObject) override
- {
- }
- void AttachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendComputeShaderObject) override
- {
- }
- void DetachShader(NVRenderBackendShaderProgramObject, NVRenderBackendVertexShaderObject) override
- {
- }
- void DetachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendFragmentShaderObject) override
- {
- }
- void DetachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendTessControlShaderObject) override
- {
- }
- void DetachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendTessEvaluationShaderObject) override
- {
- }
- void DetachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendGeometryShaderObject) override
- {
- }
- void DetachShader(NVRenderBackendShaderProgramObject,
- NVRenderBackendComputeShaderObject) override
- {
- }
- NVRenderBackendShaderProgramObject CreateShaderProgram(bool) override
- {
- return NVRenderBackendShaderProgramObject(1);
- }
- void ReleaseShaderProgram(NVRenderBackendShaderProgramObject) override {}
- NVRenderBackendProgramPipeline CreateProgramPipeline() override
- {
- return NVRenderBackendProgramPipeline(1);
- }
- void ReleaseProgramPipeline(NVRenderBackendProgramPipeline) override {}
-
- bool LinkProgram(NVRenderBackendShaderProgramObject, eastl::string &) override { return false; }
- void SetActiveProgram(NVRenderBackendShaderProgramObject) override {}
- void SetActiveProgramPipeline(NVRenderBackendProgramPipeline) override {}
- void SetProgramStages(NVRenderBackendProgramPipeline, NVRenderShaderTypeFlags,
- NVRenderBackendShaderProgramObject) override {}
- void DispatchCompute(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32, QT3DSU32) override {}
- QT3DSI32 GetConstantCount(NVRenderBackendShaderProgramObject) override { return 0; }
- QT3DSI32 GetConstantBufferCount(NVRenderBackendShaderProgramObject) override { return 0; }
- QT3DSI32 GetConstantInfoByID(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32, QT3DSI32 *,
- NVRenderShaderDataTypes::Enum *, QT3DSI32 *, char *) override
- {
- return 0;
- }
-
- QT3DSI32 GetConstantBufferInfoByID(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32,
- QT3DSI32 *, QT3DSI32 *, QT3DSI32 *, char *) override
- {
- return 0;
- }
-
- void GetConstantBufferParamIndices(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSI32 *) override
- {
- }
- void GetConstantBufferParamInfoByIndices(NVRenderBackendShaderProgramObject, QT3DSU32,
- QT3DSU32 *, QT3DSI32 *, QT3DSI32 *, QT3DSI32 *) override {}
- void ProgramSetConstantBlock(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32) override {}
- void ProgramSetConstantBuffer(QT3DSU32, NVRenderBackendBufferObject) override {}
-
- QT3DSI32 GetStorageBufferCount(NVRenderBackendShaderProgramObject) override { return 0; };
- QT3DSI32 GetStorageBufferInfoByID(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32,
- QT3DSI32 *, QT3DSI32 *, QT3DSI32 *, char *) override
- {
- return -1;
- }
- void ProgramSetStorageBuffer(QT3DSU32, NVRenderBackendBufferObject) override {}
-
- QT3DSI32 GetAtomicCounterBufferCount(NVRenderBackendShaderProgramObject) override { return 0; }
- QT3DSI32 GetAtomicCounterBufferInfoByID(NVRenderBackendShaderProgramObject, QT3DSU32, QT3DSU32,
- QT3DSI32 *, QT3DSI32 *, QT3DSI32 *, char *) override
- {
- return -1;
- };
- void ProgramSetAtomicCounterBuffer(QT3DSU32, NVRenderBackendBufferObject) override {}
-
- void SetConstantValue(NVRenderBackendShaderProgramObject, QT3DSU32,
- NVRenderShaderDataTypes::Enum, QT3DSI32, const void *, bool) override
- {
- }
-
- void Draw(NVRenderDrawMode::Enum, QT3DSU32, QT3DSU32) override {}
- void DrawIndirect(NVRenderDrawMode::Enum, const void *) override {}
-
- void DrawIndexed(NVRenderDrawMode::Enum, QT3DSU32, NVRenderComponentTypes::Enum,
- const void *) override
- {
- }
- void DrawIndexedIndirect(NVRenderDrawMode::Enum, NVRenderComponentTypes::Enum,
- const void *) override
- {
- }
-
- void ReadPixel(NVRenderBackendRenderTargetObject, QT3DSI32, QT3DSI32, QT3DSI32, QT3DSI32,
- NVRenderReadPixelFormats::Enum, void *) override
- {
- }
-
- NVRenderBackendPathObject CreatePathNVObject(size_t) override
- {
- return NVRenderBackendPathObject(1);
- };
- void SetPathSpecification(NVRenderBackendPathObject, NVConstDataRef<QT3DSU8>,
- NVConstDataRef<QT3DSF32>) override
- {
- }
-
- ///< Bounds of the fill and stroke
- NVBounds3 GetPathObjectBoundingBox(NVRenderBackendPathObject /*inPathObject*/) override
- {
- return NVBounds3();
- }
- NVBounds3 GetPathObjectFillBox(NVRenderBackendPathObject /*inPathObject*/) override
- {
- return NVBounds3();
- }
- NVBounds3 GetPathObjectStrokeBox(NVRenderBackendPathObject /*inPathObject*/) override
- {
- return NVBounds3();
- }
-
- /**
- * Defaults to 0 if unset.
- */
- void SetStrokeWidth(NVRenderBackendPathObject /*inPathObject*/, QT3DSF32) override {}
- void SetPathProjectionMatrix(const QT3DSMat44 /*inPathProjection*/) override {}
- void SetPathModelViewMatrix(const QT3DSMat44 /*inPathModelview*/) override {}
-
- void SetPathStencilDepthOffset(QT3DSF32 /*inSlope*/, QT3DSF32 /*inBias*/) override {}
- void SetPathCoverDepthFunc(NVRenderBoolOp::Enum /*inDepthFunction*/) override {}
- void StencilStrokePath(NVRenderBackendPathObject /*inPathObject*/) override {}
- void StencilFillPath(NVRenderBackendPathObject /*inPathObject*/) override {}
- void ReleasePathNVObject(NVRenderBackendPathObject, size_t) override {}
-
- void LoadPathGlyphs(NVRenderBackendPathObject, NVRenderPathFontTarget::Enum,
- const void *, NVRenderPathFontStyleFlags, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathMissingGlyphs::Enum, NVRenderBackendPathObject, QT3DSF32) override
- {
- }
- virtual NVRenderPathReturnValues::Enum
- LoadPathGlyphsIndexed(NVRenderBackendPathObject, NVRenderPathFontTarget::Enum, const void *,
- NVRenderPathFontStyleFlags, QT3DSU32, size_t, NVRenderBackendPathObject,
- QT3DSF32) override
- {
- return NVRenderPathReturnValues::FontUnavailable;
- }
- NVRenderBackendPathObject LoadPathGlyphsIndexedRange(NVRenderPathFontTarget::Enum,
- const void *,
- NVRenderPathFontStyleFlags,
- NVRenderBackendPathObject, QT3DSF32,
- QT3DSU32 *) override
- {
- return NVRenderBackendPathObject(1);
- }
- void LoadPathGlyphRange(NVRenderBackendPathObject, NVRenderPathFontTarget::Enum,
- const void *, NVRenderPathFontStyleFlags, QT3DSU32, size_t,
- NVRenderPathMissingGlyphs::Enum, NVRenderBackendPathObject,
- QT3DSF32) override
- {
- }
- void GetPathMetrics(NVRenderBackendPathObject, size_t, NVRenderPathGlyphFontMetricFlags,
- NVRenderPathFormatType::Enum, const void *, size_t, QT3DSF32 *) override
- {
- }
- void GetPathMetricsRange(NVRenderBackendPathObject, size_t,
- NVRenderPathGlyphFontMetricFlags, size_t, QT3DSF32 *) override
- {
- }
- void GetPathSpacing(NVRenderBackendPathObject, size_t, NVRenderPathListMode::Enum,
- NVRenderPathFormatType::Enum, const void *, QT3DSF32, QT3DSF32,
- NVRenderPathTransformType::Enum, QT3DSF32 *) override
- {
- }
-
- void StencilFillPathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathFillMode::Enum, QT3DSU32,
- NVRenderPathTransformType::Enum, const QT3DSF32 *) override
- {
- }
- void StencilStrokePathInstancedN(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *, QT3DSI32,
- QT3DSU32, NVRenderPathTransformType::Enum, const QT3DSF32 *) override
- {
- }
- void CoverFillPathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathCoverMode::Enum,
- NVRenderPathTransformType::Enum, const QT3DSF32 *) override
- {
- }
- void CoverStrokePathInstanced(NVRenderBackendPathObject, size_t,
- NVRenderPathFormatType::Enum, const void *,
- NVRenderPathCoverMode::Enum,
- NVRenderPathTransformType::Enum, const QT3DSF32 *) override
- {
- }
- QSurfaceFormat format() const override
- {
- return QSurfaceFormat();
- }
-};
-}
-
-NVRenderBackend &NVRenderBackendNULL::CreateBackend(NVFoundationBase &foundation)
-{
- return *QT3DS_NEW(foundation.getAllocator(), SNullBackend)(foundation);
-}
diff --git a/src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.h b/src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.h
deleted file mode 100644
index 397ecfb1..00000000
--- a/src/Runtime/ogl-runtime/src/render/backends/software/Qt3DSRenderBackendNULL.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BACKEND_NULL_H
-#define QT3DS_RENDER_BACKEND_NULL_H
-#include "render/backends/Qt3DSRenderBackend.h"
-
-namespace qt3ds {
-namespace render {
-
- class NVRenderBackendNULL : public NVRenderBackend
- {
- public:
- static NVRenderBackend &CreateBackend(NVFoundationBase &foundation);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/render/glg/Qt3DSGLImplObjects.h b/src/Runtime/ogl-runtime/src/render/glg/Qt3DSGLImplObjects.h
deleted file mode 100644
index 28f246fd..00000000
--- a/src/Runtime/ogl-runtime/src/render/glg/Qt3DSGLImplObjects.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_GL_IMPL_OBJECTS_H
-#define QT3DS_RENDER_GL_IMPL_OBJECTS_H
-#include "render/backends/gl/Qt3DSOpenGLUtil.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSContainers.h"
-
-namespace qt3ds {
-namespace render {
-
- // The set of all properties as they are currently set in hardware.
- struct SNVGLHardPropertyContext
- {
- NVRenderFrameBuffer *m_FrameBuffer;
- NVRenderShaderProgram *m_ActiveShader;
- NVRenderProgramPipeline *m_ActiveProgramPipeline;
- NVRenderInputAssembler *m_InputAssembler;
- NVRenderBlendFunctionArgument m_BlendFunction;
- NVRenderBlendEquationArgument m_BlendEquation;
- bool m_CullingEnabled;
- NVRenderBoolOp::Enum m_DepthFunction;
- bool m_BlendingEnabled;
- bool m_DepthWriteEnabled;
- bool m_DepthTestEnabled;
- bool m_StencilTestEnabled;
- bool m_ScissorTestEnabled;
- bool m_ColorWritesEnabled;
- bool m_MultisampleEnabled;
- NVRenderRect m_ScissorRect;
- NVRenderRect m_Viewport;
- QT3DSVec4 m_ClearColor;
-
- SNVGLHardPropertyContext()
- : m_FrameBuffer(NULL)
- , m_ActiveShader(NULL)
- , m_ActiveProgramPipeline(NULL)
- , m_InputAssembler(NULL)
- , m_CullingEnabled(true)
- , m_DepthFunction(NVRenderBoolOp::Less)
- , m_BlendingEnabled(true)
- , m_DepthWriteEnabled(true)
- , m_DepthTestEnabled(true)
- , m_StencilTestEnabled(false)
- , m_ScissorTestEnabled(true)
- , m_ColorWritesEnabled(true)
- , m_MultisampleEnabled(false)
- , m_ClearColor(0, 0, 0, 1)
- {
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.cpp
deleted file mode 100644
index 3d052742..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.cpp
+++ /dev/null
@@ -1,1027 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "RuntimePrefix.h"
-#include "Qt3DSActivationManager.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSComponentManager.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSInvasiveSet.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/StringTable.h"
-#include "EASTL/sort.h"
-#include "Qt3DSAttributeHashes.h"
-#include "Qt3DSPresentation.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSSync.h"
-#include "Qt3DSRenderThreadPool.h"
-
-using namespace qt3ds::runtime;
-using namespace qt3ds::runtime::element;
-using qt3ds::render::IThreadPool;
-using qt3ds::foundation::Time;
-
-namespace {
-
-typedef nvvector<TElementAndSortKey> TElementAndSortKeyList;
-
-struct STimeEvent
-{
- enum Type {
- Start = 0,
- Stop,
- };
-
- Type m_Type;
- TTimeUnit m_Time;
- nvvector<SElement *> m_AffectedNodes;
-
- STimeEvent(Type inType, NVAllocatorCallback &alloc, TTimeUnit inTime)
- : m_Type(inType)
- , m_Time(inTime)
- , m_AffectedNodes(alloc, "TimeEvent")
- {
- }
-
- void Reset()
- {
- m_Time = 0;
- m_AffectedNodes.clear();
- }
-};
-
-struct STimeEventGreaterThan
-{
- bool operator()(const STimeEvent *lhs, const STimeEvent *rhs) const
- {
- if (lhs->m_Time == rhs->m_Time)
- return lhs->m_Type > rhs->m_Type;
-
- return lhs->m_Time > rhs->m_Time;
- }
-};
-
-struct STimeEventLessThan
-{
- bool operator()(const STimeEvent *lhs, const STimeEvent *rhs) const
- {
- if (lhs->m_Time == rhs->m_Time)
- return lhs->m_Type < rhs->m_Type;
-
- return lhs->m_Time < rhs->m_Time;
- }
-};
-
-typedef nvvector<STimeEvent *> TTimeEventList;
-struct STimeContext;
-typedef NVDataRef<NVScopedRefCounted<STimeContext>> TTimeContextSet;
-
-// Tree navigation
-
-SElement *GetElementNodeFirstChild(SElement &inNode)
-{
- return inNode.m_Child;
-}
-SElement *GetElementNodeNextSibling(SElement &inNode)
-{
- return inNode.m_Sibling;
-}
-SElement *GetElementNodeParent(SElement &inNode)
-{
- return inNode.m_Parent;
-}
-
-struct SScanBufferEntry
-{
- SElement *m_Node;
- QT3DSU32 m_StartTime;
- QT3DSU32 m_EndTime;
-
- SScanBufferEntry()
- : m_Node(NULL)
- , m_StartTime(0)
- , m_EndTime(QT3DS_MAX_U32)
- {
- }
- SScanBufferEntry(SElement *inNode)
- : m_Node(inNode)
- , m_StartTime(0)
- , m_EndTime(QT3DS_MAX_U32)
- {
- }
- SScanBufferEntry(SElement *inNode, QT3DSU32 start, QT3DSU32 end)
- : m_Node(inNode)
- , m_StartTime(start)
- , m_EndTime(end)
- {
- }
-
- SScanBufferEntry(SElement *inNode, bool inParentActive)
- : m_Node(inNode)
- , m_StartTime(inParentActive ? 1 : 0)
- , m_EndTime(0)
- {
- }
-
- bool IsParentActive() const { return m_StartTime ? true : false; }
-};
-
-typedef nvvector<SScanBufferEntry> TScanBuffer;
-typedef nvvector<SElement *> TElementNodePtrList;
-
-struct SElementIndexPairSorter
-{
- bool operator()(const eastl::pair<element::SElement *, QT3DSU32> &lhs,
- const eastl::pair<element::SElement *, QT3DSU32> &rhs) const
- {
- return lhs.second < rhs.second;
- }
-};
-
-struct SElementPtrSort
-{
- bool operator()(const SElement *lhs, const SElement *rhs)
- {
- return lhs->Depth() < rhs->Depth();
- }
-};
-
-DEFINE_INVASIVE_SINGLE_LIST(TimeContext);
-
-struct STimeContext
-{
- NVAllocatorCallback &m_Allocator;
- SComponent &m_Component;
- CTimePolicy m_TimePolicy;
- SComponentTimePolicyOverride *m_TimePolicyOverride;
- TTimeUnit m_CurrentTime;
- TElementNodePtrList m_Elements;
- TTimeEventList m_TimeEventBackingStore;
- TTimeEventList m_TimeEvents;
- SActivationManagerNodeDirtyList m_DirtyList;
- QT3DSU32 m_TimeEventBackingStoreIndex;
- QT3DSI32 mRefCount;
- STimeContext *m_NextSibling;
- TTimeContextList m_Children;
- Mutex &m_ElementAccessMutex;
- bool m_AllNodesDirty;
- bool m_TimeDataNeedsUpdate;
-
- STimeContext(NVAllocatorCallback &alloc, SComponent &inComponent, Mutex &inElementAccessMutex)
- : m_Allocator(alloc)
- , m_Component(inComponent)
- , m_TimePolicyOverride(NULL)
- , m_CurrentTime(-1)
- , m_Elements(alloc, "m_Elements")
- , m_TimeEventBackingStore(alloc, "TimeEventBackingStore")
- , m_TimeEvents(alloc, "TimeEvents")
- , m_DirtyList(alloc)
- , m_TimeEventBackingStoreIndex(0)
- , mRefCount(0)
- , m_NextSibling(NULL)
- , m_ElementAccessMutex(inElementAccessMutex)
- , m_AllNodesDirty(true)
- , m_TimeDataNeedsUpdate(true)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Allocator)
- ~STimeContext()
- {
- Reset();
- for (TTimeEventList::iterator iter = m_TimeEventBackingStore.begin(),
- end = m_TimeEventBackingStore.end();
- iter != end; ++iter) {
- NVDelete(m_Allocator, *iter);
- }
-
- m_TimeEventBackingStore.clear();
- RemoveOverride();
- }
-
- void Reset()
- {
- for (TTimeEventList::iterator iter = m_TimeEvents.begin(), end = m_TimeEvents.end();
- iter != end; ++iter)
- (*iter)->Reset();
-
- m_TimeEvents.clear();
- m_TimeEventBackingStoreIndex = 0;
- m_CurrentTime = -1;
- m_DirtyList.clear();
- m_AllNodesDirty = true;
- m_TimeDataNeedsUpdate = true;
- }
-
- STimeEvent &GetTimeEventForTime(TTimeUnit inTime, STimeEvent::Type inType)
- {
- TTimeEventList::iterator inserter = m_TimeEvents.end();
- for (TTimeEventList::iterator iter = m_TimeEvents.begin(), end = m_TimeEvents.end();
- iter != end && inserter == end; ++iter) {
- if ((*iter)->m_Time == inTime) {
- if ((*iter)->m_Type == inType)
- return **iter;
- // Start comes before stop
- if ((*iter)->m_Type == STimeEvent::Stop)
- inserter = iter;
- }
-
- if ((*iter)->m_Time > inTime)
- inserter = iter;
- }
-
- if (m_TimeEventBackingStoreIndex == m_TimeEventBackingStore.size())
- m_TimeEventBackingStore.push_back(
- QT3DS_NEW(m_Allocator, STimeEvent)(inType, m_Allocator, inTime));
-
- STimeEvent *newEvent = m_TimeEventBackingStore[m_TimeEventBackingStoreIndex];
- ++m_TimeEventBackingStoreIndex;
-
- newEvent->m_Time = inTime;
- newEvent->m_Type = inType;
- newEvent->m_AffectedNodes.clear();
-
- if (inserter == m_TimeEvents.end())
- m_TimeEvents.push_back(newEvent);
- else
- m_TimeEvents.insert(inserter, newEvent);
-
- return *newEvent;
- };
-
- void UpdateNodeList(nvvector<SElement *> &inList, bool timeActive)
- {
- for (QT3DSU32 elemIdx = 0, endIdx = inList.size(); elemIdx < endIdx; ++elemIdx) {
- SActivationManagerNode &theNode = inList[elemIdx]->m_ActivationManagerNode;
- if (timeActive != theNode.m_Flags.IsTimeActive()) {
- theNode.m_Flags.SetTimeActive(timeActive);
- SetElementDirty(*inList[elemIdx]);
- }
- }
- }
-
- // Returns true if we have reached the end time.
- bool CalculateNewTime(TTimeUnit inGlobalTime)
- {
- Option<TTimeUnit> theNewTime;
- if (m_TimePolicyOverride) {
- SComponentTimePolicyOverride *theOverride = m_TimePolicyOverride;
- eastl::pair<Q3DStudio::BOOL, TTimeUnit> theEvalResult =
- theOverride->ComputeLocalTime(m_TimePolicy, inGlobalTime);
- if (theEvalResult.first && theOverride->m_TimeCallback) {
- Mutex::ScopedLock __locker(m_ElementAccessMutex);
- theOverride->m_TimeCallback->OnTimeFinished();
- theOverride->m_TimeCallback->Release();
- theOverride->m_TimeCallback = NULL;
- }
- return false;
- } else {
- Q3DStudio::BOOL theReachedEndTime = m_TimePolicy.ComputeTime(inGlobalTime);
- if (theReachedEndTime)
- return true;
-
- return false;
- }
- }
-
- // There are four conditions this happens:
- // 1. This object is getting destroyed
- // 2. A new override is being set.
- // 3. The compoent switched slides.
- // 4. The component was deactivated.
- void RemoveOverride()
- {
- if (m_TimePolicyOverride) {
- if (m_TimePolicyOverride->m_TimeCallback) {
- Mutex::ScopedLock __locker(m_ElementAccessMutex);
- m_TimePolicyOverride->m_TimeCallback->Release();
- m_TimePolicyOverride->m_TimeCallback = NULL;
- }
-
- NVDelete(m_Allocator, m_TimePolicyOverride);
- m_TimePolicyOverride = NULL;
- }
- }
-
- void UpdateLocalTime(TTimeUnit inNewTime, TScanBuffer &inScanBuffer, IActivityZone &inZone)
- {
- if (m_TimeDataNeedsUpdate) {
- BuildTimeContext(inScanBuffer, inZone);
- }
-
- TTimeUnit newTime = inNewTime;
- if (newTime != m_CurrentTime) {
- SComponent &myNode = m_Component;
- {
- Mutex::ScopedLock __locker(m_ElementAccessMutex);
- myNode.SetDirty();
- }
- STimeEvent searchEvent(STimeEvent::Start, m_Allocator, m_CurrentTime);
- bool forward = newTime > m_CurrentTime;
- m_CurrentTime = NVMax((TTimeUnit)0, newTime);
-
- if (forward) {
- TTimeEventList::iterator iter = eastl::lower_bound(
- m_TimeEvents.begin(), m_TimeEvents.end(), &searchEvent, STimeEventLessThan());
-
- for (TTimeEventList::iterator end = m_TimeEvents.end();
- iter != end && (*iter)->m_Time <= newTime; ++iter) {
- // Stop only works if the time is greater.
- // start works if the time is equal.
- bool isActive = true;
- if ((*iter)->m_Type == STimeEvent::Stop)
- isActive = newTime <= (*iter)->m_Time;
-
- UpdateNodeList((*iter)->m_AffectedNodes, isActive);
- }
- } else {
- searchEvent.m_Type = STimeEvent::Stop;
- TTimeEventList::reverse_iterator iter =
- eastl::lower_bound(m_TimeEvents.rbegin(), m_TimeEvents.rend(), &searchEvent,
- STimeEventGreaterThan());
-
- for (TTimeEventList::reverse_iterator end = m_TimeEvents.rend();
- iter != end && (*iter)->m_Time >= newTime; ++iter) {
- bool isActive = true;
- if ((*iter)->m_Type == STimeEvent::Start)
- isActive = newTime >= (*iter)->m_Time;
-
- UpdateNodeList((*iter)->m_AffectedNodes, isActive);
- }
- }
- }
- }
-
- void UpdateNodeElementInformation(SElement &inNode)
- {
- Q3DStudio::UVariant attValue;
- if (inNode.GetAttribute(Q3DStudio::ATTRIBUTE_STARTTIME, attValue))
- inNode.m_ActivationManagerNode.m_StartTime = (QT3DSU32)attValue.m_INT32;
-
- if (inNode.GetAttribute(Q3DStudio::ATTRIBUTE_ENDTIME, attValue))
- inNode.m_ActivationManagerNode.m_StopTime = (QT3DSU32)attValue.m_INT32;
-
- inNode.m_ActivationManagerNode.m_Flags.SetTimeActive(false);
- // Note that we don't set the script information here. The reason is that this requires the
- // script list
- // and we don't have access to it. Plus it can't change when a slide changes so it is kind
- // of irrelevant.
- }
-
- bool BuildTimeContextElementNode(SElement &inNode, QT3DSU32 inGlobalMin, QT3DSU32 inGlobalMax)
- {
- // Note that just because a node itself does not participate in the time graph,
- // this does not mean that its children do not participate in the time graph.
- if (inNode.DoesParticipateInTimeGraph()) {
- UpdateNodeElementInformation(inNode);
- if (inNode.IsUserActive()) {
- inGlobalMin = NVMax(inNode.m_ActivationManagerNode.m_StartTime, inGlobalMin);
- inGlobalMax = NVMin(inNode.m_ActivationManagerNode.m_StopTime, inGlobalMax);
- if (inGlobalMin < inGlobalMax) {
- GetTimeEventForTime(inGlobalMin, STimeEvent::Start)
- .m_AffectedNodes.push_back(&inNode);
- GetTimeEventForTime(inGlobalMax, STimeEvent::Stop)
- .m_AffectedNodes.push_back(&inNode);
- }
- }
- } else {
- inNode.m_ActivationManagerNode.m_Flags.SetTimeActive(true);
- // Carry global min/max information down so children get setup correctly.
- inNode.m_ActivationManagerNode.m_StartTime = inGlobalMin;
- inNode.m_ActivationManagerNode.m_StopTime = inGlobalMax;
- }
- // Is it worth looking at children at all
- return inNode.IsUserActive();
- }
-
- void BuildTimeContext(TScanBuffer &inScanBuffer, IActivityZone &inZone)
- {
- Mutex::ScopedLock __locker(m_ElementAccessMutex);
- QT3DS_ASSERT(m_TimeDataNeedsUpdate);
- m_TimeDataNeedsUpdate = false;
- SComponent &myNode = m_Component;
- SElement *theChild = myNode.m_Child;
- if (theChild == NULL) {
- return;
- }
- inScanBuffer.clear();
- for (SElement *theChild = myNode.m_Child; theChild; theChild = theChild->m_Sibling) {
- inScanBuffer.push_back(theChild);
- }
- for (QT3DSU32 idx = 0, end = (QT3DSU32)inScanBuffer.size(); idx < end; ++idx) {
- SScanBufferEntry theEntry(inScanBuffer[idx]);
- bool careAboutChildren = BuildTimeContextElementNode(
- *theEntry.m_Node, theEntry.m_StartTime, theEntry.m_EndTime);
- if (careAboutChildren && theEntry.m_Node->IsComponent() == false) {
- for (SElement *theChild = theEntry.m_Node->m_Child; theChild;
- theChild = theChild->m_Sibling) {
- inScanBuffer.push_back(SScanBufferEntry(
- theChild, theEntry.m_Node->m_ActivationManagerNode.m_StartTime,
- theEntry.m_Node->m_ActivationManagerNode.m_StopTime));
- }
- end = (QT3DSU32)inScanBuffer.size();
- }
- if (theEntry.m_Node->IsComponent())
- inZone.AddActivityItems(*theEntry.m_Node);
- }
- }
-
- void SetElementDirty(SElement &inNode)
- {
- SElement *theComponentParent = &inNode.GetComponentParent();
- if (inNode.IsComponent() && inNode.m_Parent)
- theComponentParent = &inNode.m_Parent->GetComponentParent();
-
- QT3DS_ASSERT(theComponentParent == &m_Component);
- if (m_AllNodesDirty == false) {
- // We check independent items every frame anyway so it isn't worth setting them dirty
- // here.
- if (inNode.IsIndependent() == false) {
- m_DirtyList.insert(inNode);
- }
-
- // Dirty to root time context. This ensures that if we run an activate scan starting at
- // a parent
- // we won't have to re-run the scan at this node because it will not be dirty.
- // This also makes sure that if we mark all nodes dirty we continue the activate scan
- // till we hit at least
- // this node.
- SElement *theParent = inNode.m_Parent;
- while (theParent) {
- if (theParent->IsComponent()
- || theParent->m_ActivationManagerNode.m_Flags.IsChildDirty())
- theParent = NULL;
- else {
- SActivationManagerNode &theNode = theParent->m_ActivationManagerNode;
- theNode.m_Flags.SetChildDirty();
- theParent = theParent->m_Parent;
- }
- }
- }
- }
-
- static void UpdateItemScriptStatus(SElement &inNode, bool activeAndHasScript,
- TElementAndSortKeyList &scriptBuffer)
- {
- QT3DSU32 theIndex = inNode.Depth();
- eastl::pair<element::SElement *, QT3DSU32> theInsertedItem(&inNode, theIndex);
- if (activeAndHasScript) {
- if (inNode.m_ActivationManagerNode.m_Flags.HasScript() == false) {
- scriptBuffer.push_back(theInsertedItem);
- inNode.m_ActivationManagerNode.m_Flags.SetHasScript(true);
- }
- } else {
- if (inNode.m_ActivationManagerNode.m_Flags.HasScript() == true) {
- TElementAndSortKeyList::iterator theFind =
- eastl::find(scriptBuffer.begin(), scriptBuffer.end(), theInsertedItem);
- if (theFind != scriptBuffer.end())
- scriptBuffer.erase(theFind);
- inNode.m_ActivationManagerNode.m_Flags.SetHasScript(false);
- }
- }
- }
-
- static void HandleActivationChange(SElement &inNode, TElementAndSortKeyList &activateBuffer,
- TElementAndSortKeyList &deactivateBuffer,
- TElementAndSortKeyList &scriptBuffer,
- Mutex &inElementAccessMutex, bool &scriptBufferRequiresSort,
- bool inIsActive)
- {
- Mutex::ScopedLock __locker(inElementAccessMutex);
- TElementAndSortKey theKey(&inNode, inNode.Depth());
- if (inIsActive) {
- activateBuffer.push_back(TElementAndSortKey(theKey));
- } else {
- deactivateBuffer.push_back(theKey);
- }
-
- if (inNode.Flags().HasScriptCallbacks()) {
- UpdateItemScriptStatus(inNode, inIsActive, scriptBuffer);
- scriptBufferRequiresSort = true;
- }
- inNode.SetGlobalActive(inIsActive);
- }
-
- // Runs once we notice that the item's global active status has changed.
- // Note we explicitly do not update independent items because those are updated
- // as the first step of each time context update itself.
- // We do, however, remove them from the dirty list here.
- static void RunActivateScan(SElement &inNode, TScanBuffer &inScanBuffer,
- TElementAndSortKeyList &activateBuffer,
- TElementAndSortKeyList &deactivateBuffer,
- TElementAndSortKeyList &scriptBuffer, Mutex &inElementAccessMutex,
- bool &scriptBufferRequiresSort, bool inRunFullScan)
- {
- inScanBuffer.clear();
-
- // Block used to hide variables to avoid an error.
- {
- bool parentActive = true;
- SElement *theParent = inNode.m_Parent;
- if (theParent != NULL)
- parentActive = theParent->IsGlobalActive();
-
- inScanBuffer.push_back(SScanBufferEntry(&inNode, parentActive));
- }
-
- for (QT3DSU32 idx = 0, end = inScanBuffer.size(); idx < end; ++idx) {
- SScanBufferEntry theEntry(inScanBuffer[idx]);
- SElement *theScanNode = theEntry.m_Node;
- QT3DS_ASSERT(theScanNode->IsIndependent() == false);
- bool parentActive = theEntry.IsParentActive();
- bool wasActive = theScanNode->IsGlobalActive();
- bool isActive = theScanNode->IsGlobalActive(parentActive);
- bool wasChildDirty = theScanNode->m_ActivationManagerNode.m_Flags.IsChildDirty();
- theScanNode->m_ActivationManagerNode.m_Flags.ClearChildDirty();
- bool activateChange = isActive != wasActive;
- bool checkChildren = activateChange || (isActive && (wasChildDirty || inRunFullScan));
- if (activateChange) {
- HandleActivationChange(*theScanNode, activateBuffer, deactivateBuffer, scriptBuffer,
- inElementAccessMutex, scriptBufferRequiresSort, isActive);
- }
-
- if (checkChildren && theScanNode->m_Child) {
- for (SElement *theScanNodeChild = theScanNode->m_Child; theScanNodeChild;
- theScanNodeChild = theScanNodeChild->m_Sibling) {
- if (theScanNodeChild->IsIndependent() == false)
- inScanBuffer.push_back(SScanBufferEntry(theScanNodeChild, isActive));
- }
- end = inScanBuffer.size();
- }
- }
- }
-
- void RunDirtyScan(TScanBuffer &inScanBuffer, TElementNodePtrList &inTempDirtyList,
- TElementAndSortKeyList &activateBuffer,
- TElementAndSortKeyList &deactivateBuffer,
- TElementAndSortKeyList &scriptBuffer, bool &scriptBufferRequiresSort)
- {
- if (m_AllNodesDirty == true) {
- inTempDirtyList.clear();
- SComponent &myNode = m_Component;
- for (SElement *theChild = myNode.m_Child; theChild; theChild = theChild->m_Sibling) {
- // Independent nodes don't need to be in the dirty list.
- if (theChild->IsIndependent() == false)
- inTempDirtyList.push_back(theChild);
- }
- } else {
- inTempDirtyList.assign(m_DirtyList.begin(), m_DirtyList.end());
- // Reset nodes that are dirty to *not* be dirty.
- m_DirtyList.clear();
- // We have to sort the dirty list because it may have nodes out of order and the active
- // algorithm requires parents before children. We use the depth member variable to
- // achieve this.
- eastl::sort(inTempDirtyList.begin(), inTempDirtyList.end(), SElementPtrSort());
- }
- for (QT3DSU32 idx = 0, end = (QT3DSU32)inTempDirtyList.size(); idx < end; ++idx) {
- SElement &dirtyNode(*inTempDirtyList[idx]);
- // This is slightly inefficient in the case where a both a child and parent are in the
- // dirty list.
- // This case has got to be extremely rare in practice, however.
- RunActivateScan(dirtyNode, inScanBuffer, activateBuffer, deactivateBuffer, scriptBuffer,
- m_ElementAccessMutex, scriptBufferRequiresSort, m_AllNodesDirty);
- }
- // Set at end so while debugging you can see if all nodes were dirty on method entry.
- m_AllNodesDirty = false;
- }
-
- bool Update(TTimeUnit inGlobalTime, TScanBuffer &inScanBuffer,
- TElementNodePtrList &inTempDirtyList, TElementAndSortKeyList &activateBuffer,
- TElementAndSortKeyList &deactivateBuffer, TElementAndSortKeyList &scriptBuffer,
- bool &scriptBufferRequiresSort, Q3DStudio::CComponentManager &inComponentManager,
- IPerfTimer &inPerfTimer, IActivityZone &inZone)
- {
- QT3DSU64 start = qt3ds::foundation::Time::getCurrentCounterValue();
- SComponent &theContextNode = m_Component;
- bool parentActive = true;
- SElement *theParent = theContextNode.m_Parent;
- if (theParent != NULL)
- parentActive = theParent->IsGlobalActive();
-
- bool wasActive = theContextNode.IsGlobalActive();
- bool isActive = theContextNode.IsGlobalActive(parentActive);
- bool activationChange = isActive != wasActive;
- inPerfTimer.Update("ActivationManager - Update Initial Vars",
- qt3ds::foundation::Time::getCurrentCounterValue() - start);
- if (activationChange) {
- SStackPerfTimer __timer(inPerfTimer, "ActivationManager - Activation Change");
- HandleActivationChange(theContextNode, activateBuffer, deactivateBuffer, scriptBuffer,
- m_ElementAccessMutex, scriptBufferRequiresSort, isActive);
- m_DirtyList.clear();
- m_AllNodesDirty = true;
- if (isActive) {
- Mutex::ScopedLock __locker(m_ElementAccessMutex);
- inComponentManager.GotoSlideIndex(&theContextNode, 1, false);
- } else
- RemoveOverride();
- }
- if (isActive) {
- SStackPerfTimer __timer(inPerfTimer, "ActivationManager - Update Local Time");
- bool atEndOfTime = CalculateNewTime(inGlobalTime);
- if (atEndOfTime) {
- Mutex::ScopedLock __locker(m_ElementAccessMutex);
- if (theContextNode.IsPlayThrough())
- inComponentManager.PlaythroughToSlide(&theContextNode);
- }
- // Note the slide may have changed here and thus updated our time policy.
- // Set time active flags based on time.
- UpdateLocalTime(m_TimePolicy.GetTime(), inScanBuffer, inZone);
- }
- if (isActive || activationChange) {
- if (m_AllNodesDirty || m_DirtyList.size()) {
- SStackPerfTimer __timer(inPerfTimer, "ActivationManager - Dirty Scan");
- RunDirtyScan(inScanBuffer, inTempDirtyList, activateBuffer, deactivateBuffer,
- scriptBuffer, scriptBufferRequiresSort);
- }
- }
- return isActive || activationChange;
- }
-
- void GoToTime(TTimeUnit inTime)
- {
- if (m_TimePolicyOverride) {
- m_TimePolicyOverride->SetTime(m_TimePolicy, inTime);
- } else {
- m_TimePolicy.SetTime(inTime);
- }
- }
-};
-
-IMPLEMENT_INVASIVE_SINGLE_LIST(TimeContext, m_NextSibling);
-
-struct SActivityZone : public IActivityZone
-{
- typedef nvhash_map<SElement *, NVScopedRefCounted<STimeContext>> TComponentTimeContextMap;
- NVFoundationBase &m_Foundation;
- Q3DStudio::CPresentation &m_Presentation;
- IStringTable &m_StringTable;
- nvvector<SElement *> m_RootElements;
- TComponentTimeContextMap m_TimeContexts;
- // These could potentially not be sorted but for 7.5 and TZ3 I don't want to risk the
- // bugs assocated with not producing the exact same output as the original algorithm.
- TElementAndSortKeyList m_ActivatedItems;
- TElementAndSortKeyList m_DeactivatedItems;
-
- // This will always need to be sorted because it is maintained across update calls
- TElementAndSortKeyList m_ScriptItems;
-
- // Temporaries used while scanning nodes for various features.
- TScanBuffer m_ScanBuffer;
- TElementNodePtrList m_TempDirtyList;
- nvvector<STimeContext *> m_TimeContextScanBuffer;
-
- TTimeContextList m_RootContexts;
- Mutex &m_ElementAccessMutex;
- Mutex m_UpdateCheckMutex;
- Sync m_UpdateSync;
- TTimeUnit m_GlobalTime;
- IPerfTimer *m_PerfTimer;
- STypeDesc m_DummyTypeDesc;
- SComponent m_DummyComponent;
- STimeContext m_DummyContext;
- bool m_Active;
- // True if m_ScriptItems needs to be resorted.
- bool m_ScriptRequiresSort;
- bool m_Updating;
-
- QT3DSI32 mRefCount;
-
- SActivityZone(NVFoundationBase &inFnd, Q3DStudio::CPresentation &inPres,
- IStringTable &inStrTable, Mutex &inElementAccessMutex)
- : m_Foundation(inFnd)
- , m_Presentation(inPres)
- , m_StringTable(inStrTable)
- , m_RootElements(inFnd.getAllocator(), "Elements")
- , m_TimeContexts(inFnd.getAllocator(), "TimeContexts")
- , m_ActivatedItems(inFnd.getAllocator(), "m_ActivatedItems")
- , m_DeactivatedItems(inFnd.getAllocator(), "m_DeactivatedItems")
- , m_ScriptItems(inFnd.getAllocator(), "m_ScriptItems")
- , m_ScanBuffer(inFnd.getAllocator(), "m_ScanBuffer")
- , m_TempDirtyList(inFnd.getAllocator(), "m_TempDirtyList")
- , m_TimeContextScanBuffer(inFnd.getAllocator(), "m_TimeContextScanBuffer")
- , m_ElementAccessMutex(inElementAccessMutex)
- , m_UpdateCheckMutex(inFnd.getAllocator())
- , m_UpdateSync(inFnd.getAllocator())
- , m_GlobalTime(0)
- , m_PerfTimer(NULL)
- , m_DummyComponent(m_DummyTypeDesc)
- , m_DummyContext(m_Foundation.getAllocator(), m_DummyComponent, m_ElementAccessMutex)
- , m_Active(true)
- , m_ScriptRequiresSort(true)
- , m_Updating(false)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- Q3DStudio::CPresentation &GetPresentation() override { return m_Presentation; }
-
- static void SortElementBuffer(nvvector<eastl::pair<element::SElement *, QT3DSU32>> &inBuffer)
- {
- eastl::sort(inBuffer.begin(), inBuffer.end(), SElementIndexPairSorter());
- }
-
- static void AddElementNodeToBuffer(nvvector<eastl::pair<element::SElement *, QT3DSU32>> &inBuffer,
- SElement &inNode)
- {
- eastl::pair<element::SElement *, QT3DSU32> insertItem(&inNode, inNode.Depth());
- QT3DS_ASSERT(eastl::find(inBuffer.begin(), inBuffer.end(), insertItem) == inBuffer.end());
- inBuffer.push_back(insertItem);
- }
-
- TActivityItemBuffer GetActivatedItems() override { return m_ActivatedItems; }
-
- TActivityItemBuffer GetDeactivatedItems() override { return m_DeactivatedItems; }
- // All active items that are script enabled.
- TActivityItemBuffer GetScriptItems() override
- {
- // Created in a delayed way.
- if (m_ScriptRequiresSort) {
- m_ScriptRequiresSort = false;
- SortElementBuffer(m_ScriptItems);
- }
- return m_ScriptItems;
- }
-
- void SetZoneActive(bool inActive) override { m_Active = inActive; }
- bool IsZoneActive() override { return m_Active; }
-
- SActivationManagerNode *GetElementNodeForElement(TActivityItem item)
- {
- return &item.m_ActivationManagerNode;
- }
-
- STimeContext &GetItemTimeContext(SElement &inNode)
- {
- SElement &theComponent = inNode.GetComponentParent();
- if (!theComponent.IsComponent()) {
- QT3DS_ASSERT(false);
- return m_DummyContext;
- }
-
- eastl::pair<TComponentTimeContextMap::iterator, bool> inserter = m_TimeContexts.insert(
- eastl::make_pair(&theComponent, NVScopedRefCounted<STimeContext>()));
- if (inserter.second) {
- inserter.first->second = QT3DS_NEW(m_Foundation.getAllocator(), STimeContext)(
- m_Foundation.getAllocator(), static_cast<SComponent &>(theComponent),
- m_ElementAccessMutex);
- STimeContext &theNewContext = *inserter.first->second;
- if (theComponent.m_Parent == NULL)
- m_RootContexts.push_back(theNewContext);
- else {
- STimeContext &parentContext = GetItemTimeContext(*theComponent.m_Parent);
- parentContext.m_Children.push_back(theNewContext);
- }
- }
- return *inserter.first->second.mPtr;
- }
-
- void AddActivityItems(TActivityItem inNode) override
- {
- if (inNode.m_Parent == NULL)
- m_RootElements.push_back(&inNode);
-
- GetItemTimeContext(inNode);
- }
-
- CTimePolicy *GetOwnedTimePolicy(TActivityItem item) override
- {
- return &GetItemTimeContext(item).m_TimePolicy;
- }
-
- virtual SComponentTimePolicyOverride *
- GetOrCreateItemComponentOverride(TActivityItem item, float inMultiplier, TTimeUnit inEndTime,
- IComponentTimeOverrideFinishedCallback *inCallback) override
- {
- STimeContext &theContext = GetItemTimeContext(item);
-
- theContext.RemoveOverride();
- theContext.m_TimePolicyOverride =
- QT3DS_NEW(m_Foundation.getAllocator(),
- SComponentTimePolicyOverride)(&item, inMultiplier, inEndTime, inCallback);
- theContext.m_TimePolicy.SetPaused(false);
-
- return theContext.m_TimePolicyOverride;
- }
-
- // If I am independent, then I am my own time parent.
- // else travel up the chain till you find an indpendent node.
- SElement &GetItemTimeParentNode(SElement &inNode)
- {
- if (inNode.m_Parent != NULL) {
- SElement &theParent = *inNode.m_Parent;
- if (theParent.IsIndependent())
- return theParent;
- return GetItemTimeParentNode(theParent);
- }
- // All roots are time independent by definition.
- return inNode;
- }
-
- TActivityItemPtr GetItemTimeParent(SElement &inNode) override
- {
- return &GetItemTimeParentNode(inNode);
- }
-
- void InsertIntoAppropriateDirtyList(SElement &inNode)
- {
- // This may need to be faster at some point...
- GetItemTimeContext(inNode).SetElementDirty(inNode);
- }
-
- bool GetItemUserActive(TActivityItem item) override { return item.IsExplicitActive(); }
-
- void UpdateItemScriptStatus(TActivityItem item) override
- {
- if (item.IsGlobalActive()) {
- STimeContext::UpdateItemScriptStatus(item, item.Flags().HasScriptCallbacks(),
- m_ScriptItems);
- m_ScriptRequiresSort = true;
- }
- }
-
- void UpdateItemInfo(TActivityItem item) override { GetItemTimeContext(item).Reset(); }
-
- // Order of events will be:
- // 1. On Slide Change
- // 2. Time Update
- // 3. On Slide Change
- // 4. Update Local Time
- void OnSlideChange(TActivityItem item) override
- {
- STimeContext &theContext = GetItemTimeContext(item);
- // Rebuilding the context sets all the elements dirty.
- // This takes care of everything *but* the script item changes.
- theContext.Reset();
- theContext.RemoveOverride();
- }
-
- bool GetItemTimeActive(TActivityItem item) override
- {
- SActivationManagerNode *theNode = GetElementNodeForElement(item);
- if (theNode)
- return theNode->m_Flags.IsTimeActive();
- return false;
- }
-
- TTimeUnit GetItemLocalTime(TActivityItem item) override
- {
- SElement *theElem = &item.GetComponentParent();
- if (item.IsComponent() && item.m_Parent)
- theElem = &item.m_Parent->GetComponentParent();
-
- return GetItemTimeContext(*theElem).m_CurrentTime;
- }
-
- TTimeUnit GetItemComponentTime(TActivityItem item) override
- {
- return GetItemTimeContext(item).m_CurrentTime;
- }
-
- bool IsUpdating() override
- {
- Mutex::ScopedLock __locker(m_UpdateCheckMutex);
- return m_Updating;
- }
-
- void EndUpdate() override
- {
- m_UpdateSync.reset();
- while (IsUpdating())
- m_UpdateSync.wait();
- }
-
- void DoUpdate()
- {
- SStackPerfTimer __timer(m_PerfTimer, "ActivationManager - DoUpdate");
- if (m_Active) {
- // We know that parent elements are added before children.
- // So we know the time contexts are in an appropriate order, assuming they completely
- // resolve their results before the next time context runs.
- Q3DStudio::CComponentManager &theManager =
- static_cast<Q3DStudio::CComponentManager &>(m_Presentation.GetComponentManager());
- m_TimeContextScanBuffer.clear();
-
- for (TTimeContextList::iterator iter = m_RootContexts.begin(),
- end = m_RootContexts.end();
- iter != end; ++iter)
- m_TimeContextScanBuffer.push_back(&(*iter));
-
- for (QT3DSU32 idx = 0, end = m_TimeContextScanBuffer.size(); idx < end; ++idx) {
- STimeContext &theContext = *m_TimeContextScanBuffer[idx];
- bool checkChildren =
- theContext.Update(m_GlobalTime, m_ScanBuffer, m_TempDirtyList, m_ActivatedItems,
- m_DeactivatedItems, m_ScriptItems, m_ScriptRequiresSort,
- theManager, *m_PerfTimer, *this);
- if (checkChildren) {
- for (TTimeContextList::iterator timeIter = theContext.m_Children.begin(),
- timeEnd = theContext.m_Children.end();
- timeIter != timeEnd; ++timeIter) {
- m_TimeContextScanBuffer.push_back(&(*timeIter));
- }
- end = m_TimeContextScanBuffer.size();
- }
- }
- }
-
- eastl::sort(m_ActivatedItems.begin(), m_ActivatedItems.end(), SElementIndexPairSorter());
- eastl::sort(m_DeactivatedItems.begin(), m_DeactivatedItems.end(),
- SElementIndexPairSorter());
- Mutex::ScopedLock __locker(m_UpdateCheckMutex);
- {
- m_Updating = false;
- m_UpdateSync.set();
- }
- }
-
- static void UpdateCallback(void *data)
- {
- SActivityZone *theZone = reinterpret_cast<SActivityZone *>(data);
- theZone->DoUpdate();
- }
-
- void BeginUpdate(TTimeUnit inGlobalTime, IPerfTimer &inPerfTimer,
- IThreadPool &inThreadPool) override
- {
- // It is expected that an update is not running.
- m_ActivatedItems.clear();
- m_DeactivatedItems.clear();
- m_GlobalTime = inGlobalTime;
- m_PerfTimer = &inPerfTimer;
- m_Updating = true;
- inThreadPool.AddTask(this, UpdateCallback, NULL);
- }
-
- void GoToTime(TActivityItem inItem, TTimeUnit inTime) override
- {
- GetItemTimeContext(inItem).GoToTime(inTime);
- }
-};
-
-struct SActivityZoneManager : public IActivityZoneManager
-{
- NVFoundationBase &m_Foundation;
- IStringTable &m_StringTable;
- // Zones may access the element mutex on destruction *so* it is important that
- // it is destroyed *after* the zone list.
- Mutex m_ElementAccessMutex;
- nvvector<NVScopedRefCounted<SActivityZone>> m_Zones;
- QT3DSI32 mRefCount;
-
- SActivityZoneManager(NVFoundationBase &fnd, IStringTable &inStrTable)
- : m_Foundation(fnd)
- , m_StringTable(inStrTable)
- , m_ElementAccessMutex(m_Foundation.getAllocator())
- , m_Zones(m_Foundation.getAllocator(), "m_Zones")
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- IActivityZone &CreateActivityZone(Q3DStudio::CPresentation &inPresentation) override
- {
- m_Zones.push_back(QT3DS_NEW(m_Foundation.getAllocator(), SActivityZone)(
- m_Foundation, inPresentation, m_StringTable, m_ElementAccessMutex));
- return *m_Zones.back().mPtr;
- }
-};
-}
-
-IActivityZoneManager &
-IActivityZoneManager::CreateActivityZoneManager(NVFoundationBase &inFoundation,
- IStringTable &inStrTable)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), SActivityZoneManager)(inFoundation, inStrTable);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.h
deleted file mode 100644
index f343ac9b..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSActivationManager.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_ACTIVATION_MANAGER_H
-#define QT3DS_ACTIVATION_MANAGER_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Utils.h"
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSMetadata.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSTimePolicy.h"
-
-namespace Q3DStudio {
-struct IComponentTimeOverrideFinishedCallback;
-struct SComponentTimePolicyOverride;
-class CPresentation;
-}
-
-namespace qt3ds {
-namespace foundation {
- class IPerfTimer;
-}
-}
-
-namespace qt3ds {
-namespace render {
- class IThreadPool;
-}
-}
-
-namespace qt3ds {
-namespace runtime {
- using namespace qt3ds::foundation;
- using namespace qt3ds;
- using Q3DStudio::CTimePolicy;
- using Q3DStudio::SComponentTimePolicyOverride;
- using Q3DStudio::IComponentTimeOverrideFinishedCallback;
- using Q3DStudio::CPresentation;
- using Q3DStudio::TTimeUnit;
- using qt3ds::render::IThreadPool;
-
- class IActivationManager;
-
- typedef element::SElement &TActivityItem;
- typedef element::SElement *TActivityItemPtr;
-
- typedef eastl::pair<element::SElement *, QT3DSU32> TElementAndSortKey;
-
- typedef NVConstDataRef<TElementAndSortKey> TActivityItemBuffer;
-
- // Items can have user active and time active. Time active is controlled by this object
- // but user active can be set. An item is only active if it both actives are true.
- // Inactive items have completely inactive children.
- class IActivityZone
- {
- protected:
- virtual ~IActivityZone() {}
- public:
- virtual Q3DStudio::CPresentation &GetPresentation() = 0;
-
- // Items activated this cycle
- virtual TActivityItemBuffer GetActivatedItems() = 0;
- // Items deactivated this cycle
- virtual TActivityItemBuffer GetDeactivatedItems() = 0;
- // All active items that are script enabled.
- virtual TActivityItemBuffer GetScriptItems() = 0;
-
- // Inactive zones don't update their item lists when the manager updates.
- virtual void SetZoneActive(bool inActive) = 0;
- virtual bool IsZoneActive() = 0;
-
- virtual void AddActivityItems(TActivityItem root) = 0;
-
- // Get the time policy that is owned by this element.
- virtual CTimePolicy *GetOwnedTimePolicy(TActivityItem item) = 0;
- // Get the local time for this element. This is the time the animation system should see
- virtual TTimeUnit GetItemLocalTime(TActivityItem item) = 0;
- // Get the local time if this isn't independent, else get the time context time for the
- // component.
- virtual TTimeUnit GetItemComponentTime(TActivityItem item) = 0;
-
- virtual SComponentTimePolicyOverride *
- GetOrCreateItemComponentOverride(TActivityItem item, float inMultiplier,
- TTimeUnit inEndTime,
- IComponentTimeOverrideFinishedCallback *inCallback) = 0;
-
- // If this item is independent, return this item.
- // else get time parent of my parent.
- virtual TActivityItemPtr GetItemTimeParent(TActivityItem item) = 0;
-
- bool IsIndependent(TActivityItem item) { return GetOwnedTimePolicy(item) != NULL; }
-
- // Any time the item has script flag changes after its initial creation.
- // Note that this flag cannot change due to slide changes, it can only change due
- // to something that had a script error and thus is disabled.
- virtual void UpdateItemScriptStatus(TActivityItem item) = 0;
-
- // If the start, end, or explicit active flags change *outside* of a slide change.
- virtual void UpdateItemInfo(TActivityItem item) = 0;
- virtual bool GetItemUserActive(TActivityItem item) = 0;
-
- // Callback when the slide changes, the time context needs to be rebuilt in this case.
- virtual void OnSlideChange(TActivityItem item) = 0;
-
- virtual bool GetItemTimeActive(TActivityItem item) = 0;
-
- virtual void BeginUpdate(QT3DSI64 inGlobalTime, IPerfTimer &inPerfTimer,
- IThreadPool &inThreadPool) = 0;
- virtual bool IsUpdating() = 0;
- virtual void EndUpdate() = 0;
-
- virtual void GoToTime(TActivityItem item, TTimeUnit inTime) = 0;
- };
-
- class IActivityZoneManager : public NVRefCounted
- {
- protected:
- virtual ~IActivityZoneManager() {}
- public:
- virtual IActivityZone &CreateActivityZone(Q3DStudio::CPresentation &inPresentation) = 0;
-
- static IActivityZoneManager &CreateActivityZoneManager(NVFoundationBase &inFoundation,
- IStringTable &inStrTable);
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.cpp
deleted file mode 100644
index 84d1c6db..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.cpp
+++ /dev/null
@@ -1,432 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "RuntimePrefix.h"
-#include "Qt3DSTypes.h"
-#include "Qt3DSAnimationSystem.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSInvasiveSet.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSPool.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSCubicRoots.h"
-#include "Qt3DSBezierEval.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/IOStreams.h"
-#include "EASTL/sort.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSIndexableLinkedList.h"
-
-using namespace qt3ds::runtime;
-using namespace qt3ds::runtime::element;
-
-namespace {
-
-struct SAnimationKey
-{
- QT3DSF32 m_Time; ///< Time
- QT3DSF32 m_Value; ///< Value
- QT3DSF32 m_C1Time; ///< Control 1 time
- QT3DSF32 m_C1Value; ///< Control 1 value
- QT3DSF32 m_C2Time; ///< Control 2 time
- QT3DSF32 m_C2Value; ///< Control 2 value
- SAnimationKey()
- : m_Time(0)
- , m_Value(0)
- , m_C1Time(0)
- , m_C1Value(0)
- , m_C2Time(0)
- , m_C2Value(0)
- {
- }
-
- SAnimationKey(float time, float val, float c1time, float c1value, float c2time, float c2value)
- : m_Time(time)
- , m_Value(val)
- , m_C1Time(c1time)
- , m_C1Value(c1value)
- , m_C2Time(c2time)
- , m_C2Value(c2value)
- {
- }
-};
-
-struct SAnimationKeyNode
-{
- enum {
- AnimationKeyArraySize = 4,
- };
-
- SAnimationKey m_Data[AnimationKeyArraySize];
- SAnimationKeyNode *m_NextNode;
- SAnimationKeyNode()
- : m_NextNode(NULL)
- {
- }
-};
-
-typedef IndexableLinkedList<SAnimationKeyNode, SAnimationKey,
- SAnimationKeyNode::AnimationKeyArraySize>
- TAnimationKeyNodeList;
-
-struct SAnimationTrack
-{
- SElement *m_Element;
- QT3DSI32 m_Id;
- QT3DSU32 m_PropertyIndex;
- QT3DSU32 m_KeyCount;
- SAnimationKeyNode *m_Keys;
- QT3DSU32 m_ActiveSetIndex;
- bool m_Dynamic;
-
- SAnimationTrack()
- : m_Element(NULL)
- , m_Id(0)
- , m_PropertyIndex(0)
- , m_KeyCount(0)
- , m_Keys(NULL)
- , m_ActiveSetIndex(QT3DS_MAX_U32)
- , m_Dynamic(false)
- {
- }
- SAnimationTrack(SElement &inElement, QT3DSI32 inId, QT3DSU32 inPropertyIndex, bool inIsDynamic)
- : m_Element(&inElement)
- , m_Id(inId)
- , m_PropertyIndex(inPropertyIndex)
- , m_KeyCount(0)
- , m_Keys(NULL)
- , m_ActiveSetIndex(QT3DS_MAX_U32)
- , m_Dynamic(inIsDynamic)
- {
- }
-};
-
-struct GetAnimationTrackActiveSetIndex
-{
- QT3DSU32 operator()(const SAnimationTrack &inTrack) const { return inTrack.m_ActiveSetIndex; }
-};
-
-struct SetAnimationTrackActiveSetIndex
-{
- void operator()(SAnimationTrack &inTrack, QT3DSU32 inIdx) { inTrack.m_ActiveSetIndex = inIdx; }
-};
-
-typedef InvasiveSet<SAnimationTrack, GetAnimationTrackActiveSetIndex,
- SetAnimationTrackActiveSetIndex>
- TAnimationTrackActiveSet;
-
-struct SAnimationTrackComparator
-{
- bool operator()(SAnimationTrack *lhs, SAnimationTrack *rhs) const
- {
- return lhs->m_Id < rhs->m_Id;
- }
-};
-
-struct SAnimSystem : public IAnimationSystem
-{
- typedef nvhash_map<QT3DSI32, SAnimationTrack *> TAnimationTrackHash;
-
- NVFoundationBase &m_Foundation;
- Pool<SAnimationTrack, ForwardingAllocator> m_AnimationTrackPool;
- Pool<SAnimationKeyNode, ForwardingAllocator> m_AnimationKeyNodePool;
- TAnimationTrackHash m_Tracks;
- SAnimationTrack *m_LastInsertedTrack;
- TAnimationTrackActiveSet m_ActiveSet;
- NVDataRef<QT3DSU8> m_LoadData;
- QT3DSI32 m_NextTrackId;
- QT3DSI32 m_RefCount;
-
- SAnimSystem(NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , m_AnimationTrackPool(
- ForwardingAllocator(inFoundation.getAllocator(), "AnimationTrackPool"))
- , m_AnimationKeyNodePool(
- ForwardingAllocator(inFoundation.getAllocator(), "AnimationKeyNodePool"))
- , m_Tracks(inFoundation.getAllocator(), "m_Tracks")
- , m_LastInsertedTrack(NULL)
- , m_ActiveSet(inFoundation.getAllocator(), "m_ActiveSet")
- , m_NextTrackId(1)
- , m_RefCount(0)
- {
- }
-
- static QT3DSI32 IncrementTrackId(QT3DSI32 inTrackId)
- {
- ++inTrackId;
- if (!inTrackId)
- ++inTrackId;
- return inTrackId;
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
-
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc = m_Foundation.getAllocator();
- NVDelete(alloc, this);
- }
- }
-
- QT3DSI32 CreateAnimationTrack(element::SElement &inElement, QT3DSU32 inPropertyName,
- bool inDynamic) override
- {
- // first, make sure we can find the property.
- Option<QT3DSU32> theIndex = inElement.FindPropertyIndex(inPropertyName);
- Option<TPropertyDescAndValuePtr> theProperty;
- if (theIndex.hasValue())
- theProperty = inElement.GetPropertyByIndex(*theIndex);
-
- if (theProperty.hasValue() == false
- || theProperty->first.m_Type != Q3DStudio::ATTRIBUTETYPE_FLOAT) {
- QT3DS_ASSERT(false);
- return 0;
- }
-
- eastl::pair<TAnimationTrackHash::iterator, bool> inserter;
- // Find unused track id.
- for (inserter = m_Tracks.insert(eastl::make_pair(m_NextTrackId, (SAnimationTrack *)NULL));
- inserter.second == false; m_NextTrackId = IncrementTrackId(m_NextTrackId)) {
- }
-
- SAnimationTrack *theNewTrack =
- reinterpret_cast<SAnimationTrack *>(m_AnimationTrackPool.allocate(__FILE__, __LINE__));
- new (theNewTrack) SAnimationTrack(inElement, inserter.first->first, *theIndex, inDynamic);
- inserter.first->second = theNewTrack;
- m_LastInsertedTrack = theNewTrack;
- ++m_NextTrackId;
- return inserter.first->first;
- }
-
- SAnimationKey *GetKeyByIndex(QT3DSU32 inIndex, SAnimationTrack &inTrack)
- {
- if (inIndex >= inTrack.m_KeyCount)
- return 0;
-
- return &TAnimationKeyNodeList::GetObjAtIdx(inTrack.m_Keys, inIndex);
- }
-
- SAnimationKey &GetOrCreateKeyByIndex(QT3DSU32 inIndex, SAnimationTrack &inTrack)
- {
- if (inIndex < inTrack.m_KeyCount)
- return *GetKeyByIndex(inIndex, inTrack);
-
- return TAnimationKeyNodeList::Create(inTrack.m_Keys, inTrack.m_KeyCount,
- m_AnimationKeyNodePool);
- }
-
- void AddKey(QT3DSF32 inTime, QT3DSF32 inValue, QT3DSF32 inC1Time, QT3DSF32 inC1Value,
- QT3DSF32 inC2Time, QT3DSF32 inC2Value) override
- {
- if (m_LastInsertedTrack == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SAnimationKey &theNewKey =
- GetOrCreateKeyByIndex(m_LastInsertedTrack->m_KeyCount, *m_LastInsertedTrack);
- theNewKey = SAnimationKey(inTime, inValue, inC1Time, inC1Value, inC2Time, inC2Value);
- }
-
- SAnimationTrack *GetAnimationTrack(QT3DSI32 inTrackId)
- {
- TAnimationTrackHash::iterator iter = m_Tracks.find(inTrackId);
- if (iter != m_Tracks.end())
- return iter->second;
- return NULL;
- }
-
- struct SNextKeyRetVal
- {
- SAnimationKeyNode *m_Node;
- SAnimationKey *m_Start;
- SAnimationKey *m_End;
-
- SNextKeyRetVal(SAnimationKeyNode &inNode)
- : m_Node(&inNode)
- , m_Start(NULL)
- , m_End(NULL)
- {
- }
- SNextKeyRetVal(SAnimationKeyNode &inNode, SAnimationKey &inLastKey)
- : m_Node(&inNode)
- , m_Start(NULL)
- , m_End(&inLastKey)
- {
- }
- SNextKeyRetVal(SAnimationKeyNode &inNode, SAnimationKey &inStart, SAnimationKey &inLastKey)
- : m_Node(&inNode)
- , m_Start(&inStart)
- , m_End(&inLastKey)
- {
- }
- SNextKeyRetVal()
- : m_Node(NULL)
- , m_Start(NULL)
- , m_End(NULL)
- {
- }
- };
-
- SNextKeyRetVal NextKeyIsGreaterThan(TAnimationKeyNodeList::iterator iter, QT3DSF32 inTime)
- {
- SAnimationKey *theStartKey = &(*iter);
- QT3DSU32 nextIdx = iter.m_Idx + 1;
- if (nextIdx == iter.m_Count)
- return SNextKeyRetVal(*iter.m_Node, *theStartKey);
-
- TAnimationKeyNodeList::iterator next = iter;
- ++next;
-
- SAnimationKey &nextKey = *next;
-
- if (nextKey.m_Time >= inTime)
- return SNextKeyRetVal(*iter.m_Node, *theStartKey, nextKey);
- return SNextKeyRetVal(*iter.m_Node);
- }
-
- QT3DSF32 Evaluate(SAnimationTrack &inTrack, QT3DSF32 inTime)
- {
- if (inTrack.m_KeyCount < 2) {
- if (inTrack.m_KeyCount == 1)
- return GetKeyByIndex(0, inTrack)->m_Value;
- return 0.0f;
- }
-
- TAnimationKeyNodeList::iterator iter =
- TAnimationKeyNodeList::begin(inTrack.m_Keys, inTrack.m_KeyCount);
-
- if ((*iter).m_Time >= inTime) {
- return (*iter).m_Value;
- }
-
- // We know it isn't the first key.
- SNextKeyRetVal theKeyData;
- for (theKeyData = NextKeyIsGreaterThan(iter, inTime); theKeyData.m_End == NULL;
- ++iter, theKeyData = NextKeyIsGreaterThan(iter, inTime)) {
- }
-
- if (theKeyData.m_Node == NULL && theKeyData.m_End == NULL) {
- QT3DS_ASSERT(false);
- return 0.0f;
- }
-
- if (theKeyData.m_Start != NULL) {
- SAnimationKey &start(*theKeyData.m_Start);
- SAnimationKey &end(*theKeyData.m_End);
- return Q3DStudio::EvaluateBezierKeyframe(
- inTime, start.m_Time, start.m_Value, start.m_C1Time, start.m_C1Value,
- start.m_C2Time, start.m_C2Value, end.m_Time, end.m_Value);
- }
- return theKeyData.m_End->m_Value;
- }
-
- void Update() override
- {
- for (QT3DSU32 idx = 0, end = m_ActiveSet.size(); idx < end; ++idx) {
- SAnimationTrack &theTrack = *m_ActiveSet[idx];
- SElement &theElement = *theTrack.m_Element;
- QT3DSF32 theTime = static_cast<QT3DSF32>(theElement.GetOuterTime());
- TPropertyDescAndValuePtr theProperty =
- *theElement.GetPropertyByIndex(theTrack.m_PropertyIndex);
- Q3DStudio::UVariant &theValue(*theProperty.second);
- QT3DSF32 newValue = Evaluate(theTrack, theTime);
- if (fabs(theValue.m_FLOAT - newValue) > SElement::SmallestDifference()) {
- theValue.m_FLOAT = newValue;
- theElement.SetDirty();
- }
- }
- }
-
- void SetActive(QT3DSI32 inTrackId, bool inActive) override
- {
- SAnimationTrack *theTrack = GetAnimationTrack(inTrackId);
- if (theTrack) {
- if (inActive)
- m_ActiveSet.insert(*theTrack);
- else
- m_ActiveSet.remove(*theTrack);
- }
- }
- //==============================================================================
- /**
- * Recomputes control point values for Studio animation based off of new start
- * value.
- * @param inNewStartValue new start value for the keyframe
- * @param inKeyStart start index of the keyframes
- */
- void RecomputeControlPoints(QT3DSF32 inNewStartValue, SAnimationTrack &inTrack)
- {
- SAnimationKey &theFirstKey = *GetKeyByIndex(0, inTrack);
- SAnimationKey &theSecondKey = *GetKeyByIndex(1, inTrack);
-
- // Determine original control point ratios
- Q3DStudio::FLOAT theOriginalInterval =
- (theSecondKey.m_Value - theFirstKey.m_Value) * (1.0f / 3.0f);
- Q3DStudio::FLOAT theEaseOutRatio = theOriginalInterval != 0.0f
- ? (theFirstKey.m_C1Value - theFirstKey.m_Value) / theOriginalInterval
- : 0.0f;
- Q3DStudio::FLOAT theEaseInRatio = theOriginalInterval != 0.0f
- ? (theSecondKey.m_Value - theFirstKey.m_C2Value) / theOriginalInterval
- : 0.0f;
-
- // Apply ratios based off new start value
- Q3DStudio::FLOAT theNewInterval = (theSecondKey.m_Value - inNewStartValue) * (1.0f / 3.0f);
- theFirstKey.m_C1Value = inNewStartValue + (theNewInterval * theEaseOutRatio);
- theFirstKey.m_C2Value = theSecondKey.m_Value - (theNewInterval * theEaseInRatio);
- }
-
- void UpdateDynamicKey(QT3DSI32 inTrackId) override
- {
- SAnimationTrack *theTrack = GetAnimationTrack(inTrackId);
- if (theTrack && theTrack->m_Dynamic) {
- SAnimationKey *theFirstKey = GetKeyByIndex(0, *theTrack);
- if (theFirstKey) {
- Q3DStudio::UVariant *thePropData =
- theTrack->m_Element->GetPropertyByIndex(theTrack->m_PropertyIndex)->second;
-
- // Recompute interpolation
- if (theTrack->m_KeyCount > 1)
- RecomputeControlPoints(thePropData->m_FLOAT, *theTrack);
-
- // Update start value
- theFirstKey->m_Value = thePropData->m_FLOAT;
- }
- }
- }
-};
-}
-
-IAnimationSystem &IAnimationSystem::CreateAnimationSystem(NVFoundationBase &inFoundation)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), SAnimSystem)(inFoundation);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.h
deleted file mode 100644
index 24542ad9..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAnimationSystem.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_ANIMATION_SYSTEM_H
-#define QT3DS_ANIMATION_SYSTEM_H
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSRefCounted.h"
-
-#pragma once
-namespace qt3ds {
-namespace foundation {
- class IOutStream;
-}
-}
-
-namespace qt3ds {
-namespace runtime {
- using namespace qt3ds;
- using namespace qt3ds::foundation;
-
- namespace element {
- struct SElement;
- }
- class IElementAllocator;
-
- class IAnimationSystem : public NVRefCounted
- {
- public:
- virtual QT3DSI32 CreateAnimationTrack(element::SElement &inElement, QT3DSU32 inPropertyName,
- bool inDynamic) = 0;
- virtual void AddKey(QT3DSF32 inTime, QT3DSF32 inValue, QT3DSF32 inC1Time, QT3DSF32 inC1Value,
- QT3DSF32 inC2Time, QT3DSF32 inC2Value) = 0;
- virtual void Update() = 0;
- virtual void SetActive(QT3DSI32 inTrackId, bool inActive) = 0;
- virtual void UpdateDynamicKey(QT3DSI32 inTrackId) = 0;
-
- static IAnimationSystem &CreateAnimationSystem(NVFoundationBase &inFoundation);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.cpp
deleted file mode 100644
index df2f00fa..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.cpp
+++ /dev/null
@@ -1,2150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// We need a Qt header first here because Qt's metatype system insists that Bool
-// can not be defined first before Qt headers are included and the includes below
-// define Bool by way of Xll/XLib.h via khronos -> egl -> X11
-#include <QImage>
-
-#include "RuntimePrefix.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSApplicationValues.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSMemory.h"
-#include "Qt3DSRuntimeFactory.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSIScriptBridge.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/XML.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSContainers.h"
-#include "EASTL/hash_map.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSInputEventTypes.h"
-#include "Qt3DSSceneManager.h"
-#include "Qt3DSIScene.h"
-#include "Qt3DSInputEngine.h"
-#include "Qt3DSMetadata.h"
-#include "Qt3DSUIPParser.h"
-#include "foundation/Socket.h"
-#include "EventPollingSystem.h"
-#include "Qt3DSRenderContextCore.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/SerializationTypes.h"
-#include "EASTL/sort.h"
-#include "Qt3DSRenderBufferLoader.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSSync.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderThreadPool.h"
-#include "foundation/StringConversionImpl.h"
-#include "Qt3DSRenderLoadedTexture.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSActivationManager.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSAudioPlayer.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSSlideSystem.h"
-#include "Qt3DSQmlElementHelper.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRenderImageBatchLoader.h"
-#include <QtCore/qlibraryinfo.h>
-#include <QtCore/qpair.h>
-#include <QtCore/qdir.h>
-#include "q3dsvariantconfig_p.h"
-
-using namespace qt3ds;
-using namespace qt3ds::runtime;
-using namespace qt3ds::render;
-using namespace Q3DStudio;
-
-namespace qt3ds {
-namespace foundation {
-template <>
-struct StringConversion<QT3DSVec2>
-{
- void StrTo(const char8_t *buffer, QT3DSVec2 &item)
- {
- char *endPtr = NULL;
- item.x = (float)strtod(buffer, &endPtr);
- if (endPtr)
- item.y = (float)strtod(endPtr, NULL);
- }
-};
-}
-}
-
-bool qt3ds::runtime::isImagePath(const QString &path)
-{
- int index = path.lastIndexOf(QLatin1Char('.'));
- if (index < 0)
- return false;
- const QString ext = path.right(path.length() - index - 1);
- return (ext == QLatin1String("jpg") || ext == QLatin1String("jpeg")
- || ext == QLatin1String("png") || ext == QLatin1String("hdr")
- || ext == QLatin1String("dds") || ext == QLatin1String("ktx"));
-}
-
-struct SFrameTimer
-{
- int m_FrameCount;
- QT3DSU64 m_FrameTime;
- SFrameTimer(QT3DSU64 fc = 0)
- : m_FrameCount(fc)
- , m_FrameTime(qt3ds::foundation::Time::getCurrentCounterValue())
- {
- }
-
- QT3DSF32 GetElapsedSeconds(QT3DSU64 currentTime) const
- {
- QT3DSU64 diff = currentTime - m_FrameTime;
- QT3DSF32 diffNanos
- = static_cast<QT3DSF32>(qt3ds::foundation::Time::sCounterFreq.toTensOfNanos(diff));
- return diffNanos / qt3ds::foundation::Time::sNumTensOfNanoSecondsInASecond;
- }
-
- QT3DSF32 GetElapsedSeconds() const
- {
- return GetElapsedSeconds(qt3ds::foundation::Time::getCurrentCounterValue());
- }
-
- QPair<QT3DSF32, int> GetFPS(int updateFC)
- {
- int elapsedFrames = updateFC - m_FrameCount;
- QT3DSU64 currentTime = qt3ds::foundation::Time::getCurrentCounterValue();
- QT3DSF32 elapsedSeconds = GetElapsedSeconds(currentTime);
- QT3DSF32 retval = elapsedFrames / elapsedSeconds;
- m_FrameCount = updateFC;
- m_FrameTime = currentTime;
- return qMakePair(retval, elapsedFrames);
- }
-};
-
-struct SRefCountedAssetValue : public SAssetValue
-{
- NVFoundationBase &m_Foundation;
- QT3DSI32 mRefCount;
- SRefCountedAssetValue(NVFoundationBase &fnd)
- : SAssetValue()
- , m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- SRefCountedAssetValue(NVFoundationBase &fnd, const SAssetValue &asset)
- : SAssetValue(asset)
- , m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- SRefCountedAssetValue(NVFoundationBase &fnd, const SPresentationAsset &asset)
- : SAssetValue(asset)
- , m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- SRefCountedAssetValue(NVFoundationBase &fnd, const SBehaviorAsset &asset)
- : SAssetValue(asset)
- , m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- SRefCountedAssetValue(NVFoundationBase &fnd, const SRenderPluginAsset &asset)
- : SAssetValue(asset)
- , m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- SRefCountedAssetValue(NVFoundationBase &fnd, const SSCXMLAsset &asset)
- : SAssetValue(asset)
- , m_Foundation(fnd)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-};
-
-typedef nvhash_map<CRegisteredString, NVScopedRefCounted<SRefCountedAssetValue>> TIdAssetMap;
-typedef nvhash_map<THashValue, CRegisteredString> THashStrMap;
-typedef nvvector<eastl::pair<CRegisteredString, NVScopedRefCounted<SRefCountedAssetValue>>>
-TIdAssetList;
-typedef eastl::pair<QT3DSU32, TElement *> THandleElementPair;
-typedef NVConstDataRef<THandleElementPair> THandleElementDataBuffer;
-typedef nvvector<THandleElementDataBuffer> THandleElementDataBufferList;
-typedef nvhash_map<QT3DSU32, TElement *> THandleElementMap;
-
-struct SHandleElementPairComparator
-{
- bool operator()(const THandleElementPair &lhs, const THandleElementPair &rhs) const
- {
- return lhs.first < rhs.first;
- }
-};
-
-struct SSlideResourceCounter
-{
- QHash<QString, int> counters;
- QSet<QString> createSet;
- QSet<QString> deleteSet;
-
- QVector<QString> loadedSlides;
-
- void increment(const QSet<QString> &set)
- {
- for (auto &r : set) {
- if (counters.value(r, 0) == 0)
- createSet.insert(r);
- counters[r]++;
- }
- }
- void decrement(const QSet<QString> &set)
- {
- for (auto &r : set) {
- if (counters.contains(r)) {
- int count = qMax(counters[r] - 1, 0);
- if (count == 0)
- deleteSet.insert(r);
- counters[r] = count;
- }
- }
- }
- void begin()
- {
- createSet.clear();
- deleteSet.clear();
- }
- void reset()
- {
- loadedSlides.clear();
- counters.clear();
- begin();
- }
- QSet<QString> toImageSet(const QVector<QString> &vec)
- {
- QSet<QString> s;
- for (const auto &x : vec) {
- if (isImagePath(x))
- s.insert(x);
- }
- return s;
- }
- void handleLoadSlide(const QString &slide, SSlideKey key, ISlideSystem &slideSystem)
- {
- if (loadedSlides.contains(slide))
- return;
- loadedSlides.push_back(slide);
- begin();
- increment(toImageSet(slideSystem.GetSourcePaths(key)));
- print();
- }
- void handleUnloadSlide(const QString &slide, SSlideKey key, ISlideSystem &slideSystem)
- {
- if (!loadedSlides.contains(slide))
- return;
- loadedSlides.removeOne(slide);
- begin();
- decrement(toImageSet(slideSystem.GetSourcePaths(key)));
- print();
- }
- void print()
- {
- static const bool debugging = qEnvironmentVariableIntValue("QT3DS_DEBUG") >= 1;
- if (debugging) {
- qDebug() << "SlideResourceCounter resources:";
- const auto keys = counters.keys();
- for (auto &x : keys)
- qDebug() << x << ": " << counters[x];
- if (createSet.size()) {
- qDebug() << "New resources: ";
- for (auto y : qAsConst(createSet))
- qDebug() << y;
- }
- if (deleteSet.size()) {
- qDebug() << "Deleted resources: ";
- for (auto y : qAsConst(deleteSet))
- qDebug() << y;
- }
- }
- }
-};
-
-struct STextureUploadRenderTask : public IRenderTask, public IImageLoadListener
-{
- IImageBatchLoader &m_batchLoader;
- IBufferManager &m_bufferManager;
- NVRenderContextType m_type;
- bool m_preferKtx;
- QSet<QString> m_uploadSet;
- QSet<QString> m_uploadWaitSet;
- QSet<QString> m_deleteSet;
- QMutex m_updateMutex;
- QHash<QT3DSU32, QSet<QString>> m_batches;
- volatile QT3DSI32 mRefCount;
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_bufferManager.GetStringTable()
- .GetAllocator())
-
- STextureUploadRenderTask(IImageBatchLoader &loader, IBufferManager &mgr,
- NVRenderContextType type, bool preferKtx)
- : m_batchLoader(loader), m_bufferManager(mgr), m_type(type), m_preferKtx(preferKtx),
- mRefCount(0)
- {
-
- }
- void Run() override
- {
- QMutexLocker loc(&m_updateMutex);
- if (!m_uploadSet.isEmpty()) {
- nvvector<CRegisteredString> sourcePaths(m_bufferManager.GetStringTable().GetAllocator(),
- "TempSourcePathList");
- for (auto &s : qAsConst(m_uploadSet))
- sourcePaths.push_back(m_bufferManager.GetStringTable().RegisterStr(s));
- QT3DSU32 id = m_batchLoader.LoadImageBatch(sourcePaths, CRegisteredString(),
- this, m_type, m_preferKtx);
- if (id)
- m_batches[id] = m_uploadSet;
- }
- if (!m_uploadWaitSet.isEmpty()) {
- nvvector<CRegisteredString> sourcePaths(m_bufferManager.GetStringTable().GetAllocator(),
- "TempSourcePathList");
- for (auto &s : qAsConst(m_uploadWaitSet))
- sourcePaths.push_back(m_bufferManager.GetStringTable().RegisterStr(s));
- QT3DSU32 id = m_batchLoader.LoadImageBatch(sourcePaths, CRegisteredString(),
- this, m_type, m_preferKtx);
- if (id) {
- m_batchLoader.BlockUntilLoaded(id);
- m_bufferManager.loadSet(m_uploadWaitSet);
- }
- }
- m_bufferManager.unloadSet(m_deleteSet);
- }
- void add(const QSet<QString> &set, bool wait)
- {
- QMutexLocker loc(&m_updateMutex);
- if (wait)
- m_uploadWaitSet.unite(set);
- else
- m_uploadSet.unite(set);
- m_deleteSet.subtract(set);
- }
- void remove(const QSet<QString> &set)
- {
- QMutexLocker loc(&m_updateMutex);
- m_uploadSet.subtract(set);
- m_uploadWaitSet.subtract(set);
- m_deleteSet.unite(set);
- }
- bool persistent() const override
- {
- return true;
- }
- void OnImageLoadComplete(CRegisteredString inPath, ImageLoadResult::Enum inResult) override
- {
- Q_UNUSED(inPath);
- Q_UNUSED(inResult);
- }
- void OnImageBatchComplete(QT3DSU64 inBatch) override
- {
- m_bufferManager.loadSet(m_batches[inBatch]);
- }
-};
-
-struct SApp;
-
-class IAppLoadContext : public NVRefCounted
-{
-public:
- virtual void EndLoad() = 0;
- virtual bool OnGraphicsInitialized(IRuntimeFactory &inFactory) = 0;
- virtual bool HasCompletedLoading() = 0;
- static IAppLoadContext &CreateXMLLoadContext(
- SApp &inApp, const char8_t *inScaleMode);
-};
-
-inline float Clamp(float val, float inMin = 0.0f, float inMax = 1.0f)
-{
- if (val < inMin)
- return inMin;
- if (val > inMax)
- return inMax;
- return val;
-}
-
-// A set of common settings that may come from the UIA or from the command line.
-// command line settings always override uia settings.
-struct SApplicationSettings
-{
- Option<bool> m_LayerCacheEnabled;
- Option<bool> m_LayerGpuProfilingEnabled;
- Option<bool> m_ShaderCachePersistenceEnabled;
-
- SApplicationSettings() {}
-
- template <typename TDataType>
- static Option<TDataType> Choose(const Option<TDataType> &inCommandLine,
- const Option<TDataType> &inUIAFile)
- {
- if (inCommandLine.hasValue())
- return inCommandLine;
- return inUIAFile;
- }
-
- SApplicationSettings(const SApplicationSettings &inCommandLine,
- const SApplicationSettings &inUIAFileSettings)
- : m_LayerCacheEnabled(
- Choose(inCommandLine.m_LayerCacheEnabled, inUIAFileSettings.m_LayerCacheEnabled))
- , m_LayerGpuProfilingEnabled(Choose(inCommandLine.m_LayerGpuProfilingEnabled,
- inUIAFileSettings.m_LayerGpuProfilingEnabled))
- , m_ShaderCachePersistenceEnabled(Choose(inCommandLine.m_ShaderCachePersistenceEnabled,
- inUIAFileSettings.m_ShaderCachePersistenceEnabled))
- {
- }
-
- static const char8_t *LayerCacheName() { return "layer-caching"; }
- static const char8_t *LayerGpuProfilerName() { return "layer-gpu-profiling"; }
- static const char8_t *ShaderCacheName() { return "shader-cache-persistence"; }
-
- void ParseBoolEnableDisableItem(const IDOMReader &inReader, const char8_t *itemName,
- Option<bool> &itemValue)
- {
- const char8_t *inItem;
- if (const_cast<IDOMReader &>(inReader).UnregisteredAtt(itemName, inItem)) {
- if (AreEqualCaseless(inItem, "disabled"))
- itemValue = false;
- else
- itemValue = true;
- }
- }
-
- void ParseBoolEnableDisableItem(const eastl::vector<eastl::string> &inCommandLine,
- const char8_t *itemName, Option<bool> &itemValue)
- {
- eastl::string temp;
- temp.assign("-");
- temp.append(itemName);
- for (QT3DSU32 idx = 0, end = inCommandLine.size(); idx < end; ++idx) {
- if (inCommandLine[idx].find(temp) == 0) {
- if (inCommandLine[idx].length() == temp.size()) {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "Unable to parse parameter %s. Please pass =enable|disable as "
- << "part of the parameter. " << temp.c_str();
- } else {
- temp = inCommandLine[idx].substr(temp.size() + 1);
- eastl::string::size_type start = temp.find_first_of("'\"");
- if (start != eastl::string::npos)
- temp.erase(0, start);
-
- eastl::string::size_type end = temp.find_first_of("'\"");
- if (end != eastl::string::npos)
- temp.erase(end);
- if (AreEqualCaseless(temp.c_str(), "disabled"))
- itemValue = false;
- else
- itemValue = true;
- qCInfo(qt3ds::INVALID_OPERATION)
- << "Item " << itemName
- << (itemValue ? " enabled" : " disabled");
- }
- }
- }
- }
-
- template <typename TReaderType>
- void ParseItems(const TReaderType &inReader)
- {
- ParseBoolEnableDisableItem(inReader, LayerCacheName(), m_LayerCacheEnabled);
- ParseBoolEnableDisableItem(inReader, LayerGpuProfilerName(), m_LayerGpuProfilingEnabled);
- ParseBoolEnableDisableItem(inReader, ShaderCacheName(), m_ShaderCachePersistenceEnabled);
- }
-
- void Parse(IDOMReader &inReader) { ParseItems(inReader); }
-
- void Parse(const eastl::vector<eastl::string> &inCommandLine) { ParseItems(inCommandLine); }
-
- struct SOptionSerializer
- {
- bool m_HasValue;
- bool m_Value;
- QT3DSU8 m_Padding[2];
- SOptionSerializer(const Option<bool> &inValue = Empty())
- : m_HasValue(inValue.hasValue())
- , m_Value(inValue.hasValue() ? *inValue : false)
- {
- m_Padding[0] = 0;
- m_Padding[1] = 0;
- }
-
- operator Option<bool>() const
- {
- if (m_HasValue)
- return m_Value;
- return Empty();
- }
- };
-
- void Save(IOutStream &outStream) const
- {
- outStream.Write(SOptionSerializer(m_LayerCacheEnabled));
- outStream.Write(SOptionSerializer(m_LayerGpuProfilingEnabled));
- outStream.Write(SOptionSerializer(m_ShaderCachePersistenceEnabled));
- }
-
- void Load(IInStream &inStream)
- {
- SOptionSerializer s;
- inStream.Read(s);
- m_LayerCacheEnabled = s;
- inStream.Read(s);
- m_LayerGpuProfilingEnabled = s;
- inStream.Read(s);
- m_ShaderCachePersistenceEnabled = s;
- }
-};
-
-struct SDummyAudioPlayer : public IAudioPlayer
-{
- virtual ~SDummyAudioPlayer() {}
- bool PlaySoundFile(const char *inFilePath) override
- {
- (void *)inFilePath;
- qCWarning(qt3ds::TRACE_INFO)
- << "Qt3DSTegraApplication: Unimplemented method IAudioPlayer::PlaySoundFile";
- return false;
- }
-} g_DummyAudioPlayer;
-
-struct SAudioPlayerWrapper : public IAudioPlayer
-{
-private:
- IApplication *m_Application;
- IAudioPlayer *m_RealPlayer;
-
-public:
- SAudioPlayerWrapper()
- : m_Application(0)
- , m_RealPlayer(&g_DummyAudioPlayer)
- {
- }
- virtual ~SAudioPlayerWrapper() {}
-
- void SetApplication(IApplication &inApplication) { m_Application = &inApplication; }
-
- void SetPlayer(IAudioPlayer *inPlayer)
- {
- if (inPlayer)
- m_RealPlayer = inPlayer;
- else
- m_RealPlayer = &g_DummyAudioPlayer;
- }
-
- bool PlaySoundFile(const char *inFilePath) override
- {
- eastl::string theFilePath(nonNull(inFilePath));
- if (m_RealPlayer != &g_DummyAudioPlayer) {
- qt3ds::foundation::CFileTools::CombineBaseAndRelative(
- m_Application->GetProjectDirectory().c_str(), inFilePath, theFilePath);
- }
- return m_RealPlayer->PlaySoundFile(theFilePath.c_str());
- }
-};
-
-struct SApp : public IApplication
-{
- NVScopedRefCounted<Q3DStudio::IRuntimeFactoryCore> m_CoreFactory;
- NVScopedRefCounted<Q3DStudio::IRuntimeFactory> m_RuntimeFactory;
-
- Q3DStudio::CInputEngine *m_InputEnginePtr;
- CAppStr m_ApplicationDir;
- CAppStr m_ProjectDir;
- CAppStr m_PresentationId;
- CAppStr m_DLLDirectory;
- TIdAssetMap m_AssetMap;
- // Keep the assets ordered. This enables the uia order to mean something.
- TIdAssetList m_OrderedAssets;
- SPickFrame m_PickFrame;
- SPickFrame m_MousePickCache;
- SPickFrame m_MouseOverCache;
- THashStrMap m_HashStrMap;
- CTimer m_Timer;
- Q3DStudio::INT64 m_ManualTime;
- SFrameTimer m_FrameTimer;
- Q3DStudio::INT32 m_FrameCount;
- // the name of the file without extension.
- eastl::string m_Filename;
- Q3DSVariantConfig m_variantConfig;
- NVScopedRefCounted<STextureUploadRenderTask> m_uploadRenderTask;
-
- qt3ds::foundation::NVScopedReleasable<IRuntimeMetaData> m_MetaData;
- nvvector<eastl::pair<SBehaviorAsset, bool>> m_Behaviors;
- NVScopedRefCounted<SocketSystem> m_SocketSystem;
- NVScopedRefCounted<SocketStream> m_ServerStream;
- NVScopedRefCounted<IActivityZoneManager> m_ActivityZoneManager;
- NVScopedRefCounted<IElementAllocator> m_ElementAllocator;
-
- // Handles are loaded sorted but only added to the handle map when needed.
- nvvector<char8_t> m_LoadBuffer;
- nvvector<CPresentation *> m_PresentationBuffer;
- Mutex m_RunnableMutex;
- nvvector<NVScopedRefCounted<IAppRunnable>> m_ThreadRunnables;
- nvvector<NVScopedRefCounted<IAppRunnable>> m_MainThreadRunnables;
- NVScopedRefCounted<IAppLoadContext> m_AppLoadContext;
- bool m_DisableState;
- bool m_ProfileLogging;
- bool m_LastRenderWasDirty;
- QT3DSU64 m_LastFrameStartTime;
- QT3DSU64 m_ThisFrameStartTime;
- double m_MillisecondsSinceLastFrame;
- // We get odd oscillations if we do are too quick to report that the frame wasn't dirty
- // after input.
- int m_DirtyCountdown;
- SApplicationSettings m_UIAFileSettings;
- eastl::pair<NVDataRef<Q3DStudio::TElement *>, size_t> m_ElementLoadResult;
-
- SAudioPlayerWrapper m_AudioPlayer;
-
- Qt3DSAssetVisitor *m_visitor;
-
- bool m_createSuccessful;
-
- DataInputMap m_dataInputDefs;
- DataOutputMap m_dataOutputDefs;
-
- bool m_initialFrame = true;
-
- SSlideResourceCounter m_resourceCounter;
- QSet<QString> m_createSet;
-
- QT3DSI32 mRefCount;
- SApp(Q3DStudio::IRuntimeFactoryCore &inFactory, const char8_t *inAppDir)
- : m_CoreFactory(inFactory)
- , m_InputEnginePtr(NULL)
- , m_ApplicationDir(inFactory.GetFoundation().getAllocator())
- , m_ProjectDir(inFactory.GetFoundation().getAllocator())
- , m_PresentationId(inFactory.GetFoundation().getAllocator())
- , m_DLLDirectory(inFactory.GetFoundation().getAllocator())
- , m_AssetMap(inFactory.GetFoundation().getAllocator(), "SApp::m_AssetMap")
- , m_OrderedAssets(inFactory.GetFoundation().getAllocator(), "SApp::m_OrderedAssets")
- , m_HashStrMap(inFactory.GetFoundation().getAllocator(), "SApp::m_HashStrMap")
- , m_Timer(inFactory.GetTimeProvider())
- , m_ManualTime(0)
- , m_FrameCount(0)
- , m_Behaviors(inFactory.GetFoundation().getAllocator(), "SApp::m_Behaviors")
- , m_ActivityZoneManager(IActivityZoneManager::CreateActivityZoneManager(
- inFactory.GetFoundation(), inFactory.GetStringTable()))
- , m_ElementAllocator(IElementAllocator::CreateElementAllocator(inFactory.GetFoundation(),
- inFactory.GetStringTable()))
- , m_LoadBuffer(inFactory.GetFoundation().getAllocator(), "SApp::m_LoadBuffer")
- , m_PresentationBuffer(inFactory.GetFoundation().getAllocator(),
- "SApp::m_PresentationBuffer")
- , m_RunnableMutex(inFactory.GetFoundation().getAllocator())
- , m_ThreadRunnables(inFactory.GetFoundation().getAllocator(), "SApp::m_ThreadRunnables")
- , m_MainThreadRunnables(inFactory.GetFoundation().getAllocator(),
- "SApp::m_MainThreadRunnables")
- , m_DisableState(true)
- , m_ProfileLogging(false)
- , m_LastRenderWasDirty(true)
- , m_LastFrameStartTime(0)
- , m_ThisFrameStartTime(0)
- , m_MillisecondsSinceLastFrame(0)
- , m_DirtyCountdown(5)
- , m_visitor(nullptr)
- , m_createSuccessful(false)
- , mRefCount(0)
- {
- m_PresentationId.append("__initial");
- m_AudioPlayer.SetApplication(*this);
- eastl::string tempStr(inAppDir);
- CFileTools::NormalizePath(tempStr);
- m_ApplicationDir.assign(tempStr.c_str());
-
- Q3DStudio_memset(&m_PickFrame, 0, sizeof(SPickFrame));
- Q3DStudio_memset(&m_MousePickCache, 0, sizeof(SPickFrame));
- Q3DStudio_memset(&m_MouseOverCache, 0, sizeof(SPickFrame));
-
- m_Timer.Start();
-
- m_CoreFactory->SetApplicationCore(this);
- m_CoreFactory->GetScriptEngineQml().SetApplicationCore(*this);
-
- m_CoreFactory->AddSearchPath(tempStr.c_str());
- }
-
- ~SApp()
- {
- EndLoad();
- {
- Mutex::ScopedLock __locker(m_RunnableMutex);
- m_ThreadRunnables.clear();
- }
- // Ensure we stop the timer.
- HasCompletedLoading();
- m_AppLoadContext = NULL;
-
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- SAssetValue &theAsset = *m_OrderedAssets[idx].second;
- if (theAsset.getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &thePresAsset = *theAsset.getDataPtr<SPresentationAsset>();
- if (thePresAsset.m_Presentation) {
- Q3DStudio_delete(thePresAsset.m_Presentation, CPresentation);
- thePresAsset.m_Presentation = NULL;
- }
- }
- }
- }
-
- void setPresentationId(const QString &id) override
- {
- QString oldId = QString::fromLocal8Bit(m_PresentationId.c_str());
- if (oldId == id)
- return;
-
- CRegisteredString idStr = m_CoreFactory->GetStringTable().RegisterStr(id);
- // Update id key in m_AssetMap
- TIdAssetMap::iterator iter
- = m_AssetMap.find(m_CoreFactory->GetStringTable().RegisterStr(oldId));
- if (iter != m_AssetMap.end()
- && iter->second->getType() == AssetValueTypes::Presentation) {
- m_AssetMap.insert(eastl::make_pair(idStr, iter->second));
- m_AssetMap.erase(iter);
- }
- for (unsigned i = 0; i < m_OrderedAssets.size(); i++) {
- auto &asset = m_OrderedAssets[i];
- if (oldId == asset.first.c_str()) {
- asset.first = idStr;
- break;
- }
- }
-
- m_PresentationId.assign(qPrintable(id));
- }
-
- void setAssetVisitor(qt3ds::Qt3DSAssetVisitor *v) override
- {
- m_visitor = v;
- }
-
- NVDataRef<CPresentation *> GetPresentations()
- {
- if (m_PresentationBuffer.empty()) {
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- SAssetValue &theAsset = *m_OrderedAssets[idx].second;
- if (theAsset.getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &thePresAsset = *theAsset.getDataPtr<SPresentationAsset>();
- if (thePresAsset.m_Presentation)
- m_PresentationBuffer.push_back(thePresAsset.m_Presentation);
- }
- }
- }
- return m_PresentationBuffer;
- }
- QVector<CPresentation *> getPresentations()
- {
- QVector<CPresentation *> presentations;
- if (m_PresentationBuffer.empty()) {
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- SAssetValue &theAsset = *m_OrderedAssets[idx].second;
- if (theAsset.getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &thePresAsset = *theAsset.getDataPtr<SPresentationAsset>();
- if (thePresAsset.m_Presentation)
- presentations.push_back(thePresAsset.m_Presentation);
- }
- }
- }
- return presentations;
- }
-
- void addRef() override { atomicIncrement(&mRefCount); }
-
- void release() override
- {
- atomicDecrement(&mRefCount);
- if (mRefCount <= 0)
- NVDelete(m_CoreFactory->GetFoundation().getAllocator(), this);
- }
-
- void QueueForMainThread(IAppRunnable &inRunnable) override
- {
- Mutex::ScopedLock __locker(m_RunnableMutex);
- m_ThreadRunnables.push_back(inRunnable);
- }
-
- virtual void EnableProfileLogging()
- {
- m_ProfileLogging = true;
- if (m_RuntimeFactory)
- m_RuntimeFactory->GetScriptEngineQml().EnableProfiling();
- }
-
- // Verbose logging is disabled by default.
- virtual void SetVerboseLogging(bool inEnableVerboseLogging)
- {
-
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Update rhythm implementations
- ////////////////////////////////////////////////////////////////////////////
-
- void SetPickFrame(const SPickFrame &inPickFrame)
- {
- // The model has changed, fire enter and exit mouse events
- if (inPickFrame.m_Model != m_PickFrame.m_Model) {
- // For determining onGroupedMouseOver/Out:
- // arg1 = the original onMouseOut model and arg2 = the original onMouseOver model
- UVariant theMouseOutModel;
- UVariant theMouseOverModel;
- theMouseOutModel.m_VoidPointer = m_PickFrame.m_Model;
- theMouseOverModel.m_VoidPointer = inPickFrame.m_Model;
-
- // It seems like you would want to 'onMouseOut' before you 'onMouseOver' something new?
- if (m_PickFrame.m_Model) {
- m_PickFrame.m_Model->GetBelongedPresentation()->FireEvent(
- ON_MOUSEOUT, m_PickFrame.m_Model, &theMouseOutModel, &theMouseOverModel,
- ATTRIBUTETYPE_POINTER, ATTRIBUTETYPE_POINTER);
- }
- if (inPickFrame.m_Model) {
- inPickFrame.m_Model->GetBelongedPresentation()->FireEvent(
- ON_MOUSEOVER, inPickFrame.m_Model, &theMouseOutModel, &theMouseOverModel,
- ATTRIBUTETYPE_POINTER, ATTRIBUTETYPE_POINTER);
- m_MouseOverCache = inPickFrame;
- }
- }
-
- const TEventCommandHash *theEventArray[] = { &ON_MOUSEDOWN, &ON_MOUSEUP,
- &ON_MIDDLEMOUSEDOWN, &ON_MIDDLEMOUSEUP,
- &ON_RIGHTMOUSEDOWN, &ON_RIGHTMOUSEUP };
- const TEventCommandHash *theClickEventArray[] = { &ON_MOUSECLICK, &ON_MIDDLEMOUSECLICK,
- &ON_RIGHTMOUSECLICK };
-
- // Click events...
- // NOTE: This is a fancy way to iterate programatically over all the handled mouse inputs
- // handled (declared in AKPickFrame.h for now)
- // we iterate to INPUTBUTTONCOUNT (see comment in AKPickFrame.h) * 2, because we handle
- // mouse down and up
- for (QT3DSI32 theMouseEvtIter = 0; theMouseEvtIter < MOUSEBUTTONCOUNT - 1;
- theMouseEvtIter++) {
- // we effectively iterate to MOUSEBUTTONCOUNT * 2 (see comment in AKPickFrame.h) to
- // handle mouse down and up
- QT3DSI32 theMouseDownFlag = 1 << (theMouseEvtIter * 2);
- QT3DSI32 theMouseUpFlag = 1 << (theMouseEvtIter * 2 + 1);
-
- // on*MouseDown
- // if this frame, the mouse button is down, and last frame it wasn't (new down click)
- if (inPickFrame.m_Model && inPickFrame.m_InputFrame.m_MouseFlags & theMouseDownFlag
- && !(m_PickFrame.m_InputFrame.m_MouseFlags & theMouseDownFlag)) {
- // fire the 'on*MouseDown' event - which is at the even indices since the down
- // events for each button are before the up
- inPickFrame.m_Model->GetBelongedPresentation()->FireEvent(
- *theEventArray[theMouseEvtIter * 2], inPickFrame.m_Model);
-
- // cache this as the last item we 'onMouseDown' on
- m_MousePickCache = inPickFrame;
- }
-
- // on*MouseUp
- // if we mouse up on anything, send the event
- if (inPickFrame.m_InputFrame.m_MouseFlags & theMouseUpFlag) {
- // fire the 'on*MouseUp' event - odd indices (1,3,5 etc)
- if (m_MousePickCache.m_Model) {
- m_MousePickCache.m_Model->GetBelongedPresentation()->FireEvent(
- *theEventArray[theMouseEvtIter * 2 + 1], m_MousePickCache.m_Model);
- }
-
- // on*MouseClick
- // if we had a up click on the same item we were mouse down on last frame ... we had
- // a click
- if (inPickFrame.m_Model && inPickFrame.m_Model == m_MousePickCache.m_Model) {
- inPickFrame.m_Model->GetBelongedPresentation()->FireEvent(
- *theClickEventArray[theMouseEvtIter], inPickFrame.m_Model);
- }
-
- // clear the stored 'last mouse down' since we just got a mouse up
- Q3DStudio_memset(&m_MousePickCache, 0, sizeof(SPickFrame));
- }
-
- // on*MouseDblClick
- }
-
- if (m_MouseOverCache.m_Model) {
-
- if (inPickFrame.m_InputFrame.m_MouseFlags & VSCROLLWHEEL) {
- UVariant theScrollValue;
- theScrollValue.m_INT32 = inPickFrame.m_InputFrame.m_ScrollValue;
- m_MouseOverCache.m_Model->GetBelongedPresentation()->FireEvent(
- ON_VERTICALSCROLLWHEEL, m_MouseOverCache.m_Model, &theScrollValue,
- NULL, ATTRIBUTETYPE_INT32);
- } else if (inPickFrame.m_InputFrame.m_MouseFlags & HSCROLLWHEEL) {
- UVariant theScrollValue;
- theScrollValue.m_INT32 = inPickFrame.m_InputFrame.m_ScrollValue;
- m_MouseOverCache.m_Model->GetBelongedPresentation()->FireEvent(
- ON_HORIZONTALSCROLLWHEEL, m_MouseOverCache.m_Model, &theScrollValue,
- NULL, ATTRIBUTETYPE_INT32);
- }
- }
-
- // Do this last
- m_PickFrame = inPickFrame;
- }
-
- void ClearPresentationDirtyLists()
- {
- NVDataRef<CPresentation *> thePresentations(GetPresentations());
- for (QT3DSU32 idx = 0, end = thePresentations.size(); idx < end; ++idx)
- thePresentations[idx]->ClearDirtyList();
- }
-
- void UpdatePresentations()
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(), "UpdatePresentations");
- // Transfer the input frame to the kernel for pick processing
- // the scene manager now handles the picking on each of its scenes
- SetPickFrame(m_RuntimeFactory->GetSceneManager().AdvancePickFrame(
- m_InputEnginePtr->GetInputFrame()));
- // clear up mouse flag for horizontal and vertical scroll
- m_InputEnginePtr->GetInputFrame().m_MouseFlags &= !(HSCROLLWHEEL | VSCROLLWHEEL);
-
- // Update all the presentations.
- // Animations are advanced based on m_Timer by default, but this can be overridden via
- // SetTimeMilliSecs().
- Q3DStudio::INT64 globalTime(GetTimeMilliSecs());
-
- NVDataRef<CPresentation *> thePresentations(GetPresentations());
-
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(),
- "UpdatePresentations - pre update");
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- if (m_OrderedAssets[idx].second->getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &theAsset(
- *m_OrderedAssets[idx].second->getDataPtr<SPresentationAsset>());
- CPresentation *thePresentation = theAsset.m_Presentation;
- if (thePresentation && thePresentation->GetActive())
- thePresentation->PreUpdate(globalTime);
- }
- }
- }
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(),
- "UpdatePresentations - begin update");
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- if (m_OrderedAssets[idx].second->getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &theAsset(
- *m_OrderedAssets[idx].second->getDataPtr<SPresentationAsset>());
- CPresentation *thePresentation = theAsset.m_Presentation;
- if (thePresentation && thePresentation->GetActive())
- thePresentation->BeginUpdate();
- }
- }
- }
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(),
- "UpdatePresentations - end update");
-
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- if (m_OrderedAssets[idx].second->getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &theAsset(
- *m_OrderedAssets[idx].second->getDataPtr<SPresentationAsset>());
- CPresentation *thePresentation = theAsset.m_Presentation;
- // allow EndUpdate also for inactive presentations so that we can
- // activate it
- if (thePresentation)
- thePresentation->EndUpdate();
- }
- }
- }
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(),
- "UpdatePresentations - postupdate");
-
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- if (m_OrderedAssets[idx].second->getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &theAsset(
- *m_OrderedAssets[idx].second->getDataPtr<SPresentationAsset>());
- CPresentation *thePresentation = theAsset.m_Presentation;
- // allow PostUpdate also for inactive presentations so that we can
- // activate it
- if (thePresentation)
- thePresentation->PostUpdate(globalTime);
- }
- }
- }
-
- // Run the garbage collection
- m_CoreFactory->GetScriptEngineQml().StepGC();
- }
-
- void NotifyDataOutputs()
- {
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(),
- "NotifyDataOutputs");
-
- // Allow presentations to notify of registered data output changes
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- if (m_OrderedAssets[idx].second->getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &asset(
- *m_OrderedAssets[idx].second->getDataPtr<SPresentationAsset>());
- CPresentation *presentation = asset.m_Presentation;
- // allow PostUpdate also for inactive presentations so that we can
- // activate it
- if (presentation)
- presentation->NotifyDataOutputs();
- }
- }
-
- // Notify @timeline attribute changes and store latest value to notified DataOutputDef
- QMutableMapIterator<QString, DataOutputDef> iter(m_dataOutputDefs);
- while (iter.hasNext()) {
- iter.next();
- DataOutputDef &outDef = iter.value();
- if (outDef.observedAttribute.propertyType == ATTRIBUTETYPE_DATAINPUT_TIMELINE
- && outDef.timelineComponent) {
- qreal newValue = outDef.timelineComponent->GetTimePolicy().GetTime();
- qreal timelineEndTime
- = outDef.timelineComponent->GetTimePolicy().GetLoopingDuration();
-
- // Normalize the value to dataOutput range (if defined)
- if (outDef.min < outDef.max && timelineEndTime != 0.0) {
- newValue = (newValue/timelineEndTime) * qreal(outDef.max - outDef.min);
- newValue += qreal(outDef.min);
- } else {
- // Normalize to milliseconds
- newValue *= 1000.0;
- }
-
- if (!outDef.value.isValid() || newValue != outDef.value.toReal()) {
- outDef.value.setValue(newValue);;
- GetPrimaryPresentation()->signalProxy()->SigDataOutputValueUpdated(
- outDef.name, outDef.value);
- }
- }
- }
- } // End SStackPerfTimer scope
- }
-
- void UpdateScenes() { m_RuntimeFactory->GetSceneManager().Update(); }
-
- void Render()
- {
- SStackPerfTimer __updateTimer(m_RuntimeFactory->GetPerfTimer(), "Render");
- CPresentation *pres = GetPrimaryPresentation();
- if (pres) {
- m_LastRenderWasDirty = m_RuntimeFactory->GetSceneManager()
- .RenderPresentation(pres, m_initialFrame);
- m_initialFrame = false;
- }
- }
-
- void ResetDirtyCounter() { m_DirtyCountdown = 5; }
-
- // Update all the presentations and render them.
- void UpdateAndRender() override
- {
- QT3DS_ASSERT(m_AppLoadContext.mPtr == NULL);
- m_ThisFrameStartTime = qt3ds::foundation::Time::getCurrentCounterValue();
- if (m_LastFrameStartTime) {
- QT3DSU64 durationSinceLastFrame = m_ThisFrameStartTime - m_LastFrameStartTime;
- m_MillisecondsSinceLastFrame =
- qt3ds::foundation::Time::sCounterFreq.toTensOfNanos(durationSinceLastFrame)
- * (1.0 / 100000.0);
- } else {
- m_MillisecondsSinceLastFrame = 0;
- }
-
- ++m_FrameCount;
-
- // First off, update any application level behaviors.
- IScriptBridge &theScriptEngine = m_CoreFactory->GetScriptEngineQml();
- for (QT3DSU32 idx = 0, end = m_Behaviors.size(); idx < end; ++idx) {
- eastl::pair<SBehaviorAsset, bool> &entry(m_Behaviors[idx]);
- if (!entry.second) {
- entry.second = true;
- theScriptEngine.ExecuteApplicationScriptFunction(entry.first.m_Handle,
- "onInitialize");
- }
- }
-
- // TODO: Initialize presentations
-
- for (QT3DSU32 idx = 0, end = m_Behaviors.size(); idx < end; ++idx) {
- eastl::pair<SBehaviorAsset, bool> &entry(m_Behaviors[idx]);
- theScriptEngine.ExecuteApplicationScriptFunction(entry.first.m_Handle, "onUpdate");
- }
-
- UpdatePresentations();
-
- UpdateScenes();
-
- Render();
-
- m_InputEnginePtr->ClearInputFrame();
-
- NotifyDataOutputs();
-
- ClearPresentationDirtyLists();
-
- if (!m_CoreFactory->GetEventSystem().GetAndClearEventFetchedFlag())
- m_CoreFactory->GetEventSystem().PurgeEvents(); // GetNextEvents of event system has not
- // been called in this round, so clear
- // events to avoid events to be piled up
-
- m_RuntimeFactory->GetQt3DSRenderContext().SetFrameTime(m_MillisecondsSinceLastFrame);
- if (floor(m_FrameTimer.GetElapsedSeconds()) > 0.0f) {
- QPair<QT3DSF32, int> fps = m_FrameTimer.GetFPS(m_FrameCount);
- m_RuntimeFactory->GetQt3DSRenderContext().SetFPS(fps);
- if (m_ProfileLogging) {
- qCInfo(PERF_INFO, "Render Statistics: %3.2ffps, frame count %d",
- fps.first, fps.second);
- }
- }
-
- m_CoreFactory->GetPerfTimer().ResetTimerData();
-
- fflush(stdout);
- m_LastFrameStartTime = m_ThisFrameStartTime;
- if (m_LastRenderWasDirty)
- ResetDirtyCounter();
- else
- m_DirtyCountdown = NVMax(0, m_DirtyCountdown - 1);
- }
-
- // hook this up to -layer-caching.
- // otherwise it might be hard to measure performance
- bool IsApplicationDirty() override
- {
- return (m_DirtyCountdown > 0);
- }
-
- double GetMillisecondsSinceLastFrame() override { return m_MillisecondsSinceLastFrame; }
-
- void MarkApplicationDirty() override { ResetDirtyCounter(); }
-
- Q3DStudio::IAudioPlayer &GetAudioPlayer() override { return m_AudioPlayer; }
- ////////////////////////////////////////////////////////////////////////////////
- // Generalized save/load
- ////////////////////////////////////////////////////////////////////////////////
-
- void loadComponentSlideResources(TElement *component, CPresentation *presentation, int index,
- const QString slideName, bool wait)
- {
- if (m_RuntimeFactory->GetQt3DSRenderContext().GetBufferManager()
- .isReloadableResourcesEnabled()) {
- auto &slidesystem = presentation->GetSlideSystem();
- SSlideKey key;
- key.m_Component = component;
- key.m_Index = index;
- slidesystem.setUnloadSlide(key, false);
- const QString completeName = presentation->GetName() + QLatin1Char(':')
- + QString::fromUtf8(key.m_Component->m_Name) + QLatin1Char(':') + slideName;
- qCInfo(PERF_INFO) << "Load component slide resources: " << completeName;
- m_resourceCounter.handleLoadSlide(completeName, key, slidesystem);
- if (m_uploadRenderTask)
- m_uploadRenderTask->add(m_resourceCounter.createSet, wait);
- else
- m_createSet.unite(m_resourceCounter.createSet);
- }
- }
-
- void unloadComponentSlideResources(TElement *component, CPresentation *presentation, int index,
- const QString slideName)
- {
- if (m_RuntimeFactory->GetQt3DSRenderContext().GetBufferManager()
- .isReloadableResourcesEnabled()) {
- auto &slidesystem = presentation->GetSlideSystem();
- SSlideKey key;
- key.m_Component = component;
- key.m_Index = index;
- slidesystem.setUnloadSlide(key, true);
- if (!slidesystem.isActiveSlide(key)) {
- const QString completeName = presentation->GetName() + QLatin1Char(':')
- + QString::fromUtf8(key.m_Component->m_Name) + QLatin1Char(':') + slideName;
- qCInfo(PERF_INFO) << "Unload component slide resources: " << completeName;
- m_resourceCounter.handleUnloadSlide(completeName, key, slidesystem);
-
- if (m_uploadRenderTask)
- m_uploadRenderTask->remove(m_resourceCounter.deleteSet);
- }
- }
- }
-
- bool LoadUIP(SPresentationAsset &inAsset,
- NVConstDataRef<SElementAttributeReference> inExternalReferences)
- {
- GetMetaData();
- eastl::string theFile;
- CFileTools::CombineBaseAndRelative(GetProjectDirectory().c_str(), inAsset.m_Src.c_str(),
- theFile);
- // Check if the file event exists
- eastl::string fullPath;
- NVScopedRefCounted<qt3ds::render::IRefCountedInputStream> theStream
- = m_CoreFactory->GetRenderContextCore().GetInputStreamFactory().GetStreamForFile(
- theFile.c_str());
- if (theStream) {
- theStream = NULL;
- CPresentation *thePresentation
- = Q3DStudio_new(CPresentation) CPresentation(inAsset.m_Id.c_str(),
- GetProjectDirectory().c_str(),
- this);
- inAsset.m_Presentation = thePresentation;
- thePresentation->SetFilePath(theFile.c_str());
- NVScopedReleasable<IUIPParser> theUIPParser(IUIPParser::Create(
- theFile.c_str(), *m_MetaData,
- m_CoreFactory->GetInputStreamFactory(),
- m_CoreFactory->GetStringTable()));
- Q3DStudio::IScene *newScene = NULL;
- m_PresentationBuffer.clear();
- if (theUIPParser->Load(*thePresentation, inExternalReferences)) {
- // Load the scene graph portion of the scene.
- newScene = m_RuntimeFactory->GetSceneManager().LoadScene(
- thePresentation, theUIPParser.mPtr,
- m_CoreFactory->GetScriptEngineQml(),
- m_variantConfig);
- }
-
- if (newScene == NULL) {
- Q3DStudio_delete(thePresentation, CPresentation);
- qCWarning(qt3ds::INVALID_OPERATION)
- << "Unable to load presentation " << theFile.c_str();
- inAsset.m_Presentation = NULL;
- return false;
- } else {
- if (inAsset.m_Id.IsValid() && m_PresentationId.empty())
- m_PresentationId.assign(inAsset.m_Id);
-
- if (inAsset.m_Id.IsValid())
- newScene->RegisterOffscreenRenderer(inAsset.m_Id);
-
- QVector<TElement *> components;
- thePresentation->GetRoot()->findComponents(components);
- for (auto &component : qAsConst(components))
- loadComponentSlideResources(component, thePresentation, 0, "Master", true);
-
- return true;
- }
- }
- qCWarning(qt3ds::INVALID_OPERATION) << "Unable to load presentation " << theFile.c_str();
- return false;
- }
-
- bool LoadUIA(IDOMReader &inReader, NVFoundationBase &fnd)
- {
- IDOMReader::Scope __preparseScope(inReader);
- {
- m_UIAFileSettings.Parse(inReader);
- }
- {
- IDOMReader::Scope __assetsScope(inReader);
- if (!inReader.MoveToFirstChild("assets")) {
- qCCritical(INVALID_OPERATION,
- "UIA input xml doesn't contain <assets> tag; load failed");
- return false;
- }
-
- eastl::string pathString;
-
- const char8_t *initialItem = "";
- inReader.UnregisteredAtt("initial", initialItem);
- m_PresentationId.clear();
- if (!isTrivial(initialItem)) {
- if (initialItem[0] == '#')
- ++initialItem;
-
- m_PresentationId.assign(initialItem);
- }
- eastl::vector<SElementAttributeReference> theUIPReferences;
- eastl::string tempString;
-
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- IDOMReader::Scope __assetScope(inReader);
- const char8_t *itemId("");
- inReader.UnregisteredAtt("id", itemId);
- const char8_t *src = "";
- inReader.UnregisteredAtt("src", src);
- pathString.clear();
- if (!isTrivial(src))
- CFileTools::CombineBaseAndRelative(m_ProjectDir.c_str(), src, pathString);
-
- const char8_t *assetName = inReader.GetElementName();
- if (AreEqual(assetName, "presentation")) {
- SPresentationAsset theAsset(RegisterStr(itemId), RegisterStr(src));
- bool activeFlag;
- if (inReader.Att("active", activeFlag))
- theAsset.m_Active = activeFlag;
- RegisterAsset(theAsset);
- } else if (AreEqual(assetName, "dataInput")) {
- DataInputDef diDef;
- const char8_t *name = "";
- const char8_t *type = "";
- const char8_t *evaluator = "";
- diDef.value = QVariant::Invalid;
- inReader.UnregisteredAtt("name", name);
- inReader.UnregisteredAtt("type", type);
- inReader.Att("min", diDef.min);
- inReader.Att("max", diDef.max);
- inReader.UnregisteredAtt("evaluator", evaluator);
- if (AreEqual(type, "Ranged Number"))
- diDef.type = DataInOutTypeRangedNumber;
- else if (AreEqual(type, "String"))
- diDef.type = DataInOutTypeString;
- else if (AreEqual(type, "Float"))
- diDef.type = DataInOutTypeFloat;
- else if (AreEqual(type, "Vector4"))
- diDef.type = DataInOutTypeVector4;
- else if (AreEqual(type, "Vector3"))
- diDef.type = DataInOutTypeVector3;
- else if (AreEqual(type, "Vector2"))
- diDef.type = DataInOutTypeVector2;
- else if (AreEqual(type, "Boolean"))
- diDef.type = DataInOutTypeBoolean;
- else if (AreEqual(type, "Variant"))
- diDef.type = DataInOutTypeVariant;
-
- if (AreEqual(type, "Evaluator")) {
- diDef.type = DataInOutTypeEvaluator;
- diDef.evaluator = QString::fromUtf8(evaluator);
- }
-
- m_dataInputDefs.insert(QString::fromUtf8(name), diDef);
-// #TODO Remove below once QT3DS-3510 task has been completed.
- // By default data inputs should not have data outputs, but this is needed
- // until editor can support configuring data nodes as in/out/in-out types
- DataOutputDef outDef;
- outDef.type = diDef.type;
- outDef.value = diDef.value;
- outDef.name = QString::fromUtf8(name);
- m_dataOutputDefs.insert(QString::fromUtf8(name), outDef);
-// #TODO Remove above once QT3DS-3510 UI change has been done
- } else if (AreEqual(assetName, "dataOutput")) {
- DataOutputDef outDef;
- const char8_t *name = "";
- const char8_t *type = "";
- outDef.value = QVariant::Invalid;
- inReader.UnregisteredAtt("name", name);
- inReader.UnregisteredAtt("type", type);
- inReader.Att("min", outDef.min);
- inReader.Att("max", outDef.max);
- if (type) {
- if (AreEqual(type, "Ranged Number"))
- outDef.type = DataInOutTypeRangedNumber;
- else if (AreEqual(type, "String"))
- outDef.type = DataInOutTypeString;
- else if (AreEqual(type, "Float"))
- outDef.type = DataInOutTypeFloat;
- else if (AreEqual(type, "Vector4"))
- outDef.type = DataInOutTypeVector4;
- else if (AreEqual(type, "Vector3"))
- outDef.type = DataInOutTypeVector3;
- else if (AreEqual(type, "Vector2"))
- outDef.type = DataInOutTypeVector2;
- else if (AreEqual(type, "Boolean"))
- outDef.type = DataInOutTypeBoolean;
- else if (AreEqual(type, "Variant"))
- outDef.type = DataInOutTypeVariant;
- }
-
- outDef.name = QString::fromUtf8(name);
- m_dataOutputDefs.insert(QString::fromUtf8(name), outDef);
- } else if (AreEqual(assetName, "renderplugin")) {
- const char8_t *pluginArgs = "";
- inReader.UnregisteredAtt("args", pluginArgs);
- RegisterAsset(SRenderPluginAsset(RegisterStr(itemId), RegisterStr(src),
- RegisterStr(pluginArgs)));
- } else if (AreEqual(assetName, "behavior")) {
- SBehaviorAsset theAsset(RegisterStr(itemId), RegisterStr(src), 0);
- RegisterAsset(theAsset);
- } else if (AreEqual(assetName, "presentation-qml")) {
- const char8_t *args = "";
- inReader.UnregisteredAtt("args", args);
- RegisterAsset(SQmlPresentationAsset(RegisterStr(itemId), RegisterStr(src),
- RegisterStr(args)));
- } else {
- qCWarning(WARNING, "Unrecognized <assets> child %s", assetName);
- }
- }
- } // end assets scope
- const char8_t *initialScaleMode = "";
- inReader.UnregisteredAtt("scalemode", initialScaleMode);
-
- m_AppLoadContext
- = IAppLoadContext::CreateXMLLoadContext(*this,
- initialScaleMode);
- return true;
- }
-
- DataInputMap &dataInputMap() override
- {
- return m_dataInputDefs;
- }
-
- DataOutputMap &dataOutputMap() override
- {
- return m_dataOutputDefs;
- }
-
- QList<QString> dataInputs() const override
- {
- return m_dataInputDefs.keys();
- }
-
- QList<QString> dataOutputs() const override
- {
- return m_dataOutputDefs.keys();
- }
-
- float dataInputMax(const QString &name) const override
- {
- return m_dataInputDefs[name].max;
- }
-
- float dataInputMin(const QString &name) const override
- {
- return m_dataInputDefs[name].min;
- }
-
- struct SAppXMLErrorHandler : public qt3ds::foundation::CXmlErrorHandler
- {
- NVFoundationBase &m_Foundation;
- const char8_t *m_FilePath;
- SAppXMLErrorHandler(NVFoundationBase &fnd, const char8_t *filePath)
- : m_Foundation(fnd)
- , m_FilePath(filePath)
- {
- }
-
- void OnXmlError(TXMLCharPtr errorName, int line, int /*column*/) override
- {
- qCWarning(INVALID_OPERATION, m_FilePath, line, "%s", errorName);
- }
- };
-
- bool BeginLoad(const QString &sourcePath, const QStringList &variantList) override
- {
- SStackPerfTimer __loadTimer(m_CoreFactory->GetPerfTimer(), "Application: Begin Load");
- eastl::string directory;
- eastl::string filename;
- eastl::string extension;
- CFileTools::Split(sourcePath.toUtf8().constData(), directory, filename, extension);
- eastl::string projectDirectory(directory);
-
- m_ProjectDir.assign(projectDirectory.c_str());
- m_CoreFactory->AddSearchPath(projectDirectory.c_str());
-
- // add additional search path
- QString projectDir = CFileTools::NormalizePathForQtUsage(projectDirectory.c_str());
- if (!projectDir.startsWith(QStringLiteral(":"))) {
- eastl::string relativeProjectDir;
- CFileTools::CombineBaseAndRelative(m_ApplicationDir.c_str(), projectDirectory.c_str(),
- relativeProjectDir);
- m_CoreFactory->AddSearchPath(relativeProjectDir.c_str());
- }
-
- // For QT3DS-3353 assume project fonts are in a subdirectory relative to project.
- eastl::string projectFontDirectory = projectDirectory + "/fonts";
-
- NVFoundationBase &fnd(m_CoreFactory->GetFoundation());
-
- if (m_CoreFactory->GetRenderContextCore().getDistanceFieldRenderer()) {
- m_CoreFactory->GetRenderContextCore().getDistanceFieldRenderer()
- ->AddProjectFontDirectory(projectFontDirectory.c_str());
- }
-
- if (m_CoreFactory->GetRenderContextCore().GetTextRendererCore()) {
- m_CoreFactory->GetRenderContextCore().GetTextRendererCore()->AddProjectFontDirectory(
- projectFontDirectory.c_str());
- m_CoreFactory->GetRenderContextCore().GetTextRendererCore()->BeginPreloadFonts(
- m_CoreFactory->GetRenderContextCore().GetThreadPool(),
- m_CoreFactory->GetRenderContextCore().GetPerfTimer());
- }
- m_Filename = filename;
- m_variantConfig.setVariantList(variantList);
- bool retval = false;
- if (extension.comparei("uip") == 0) {
- m_PresentationId.assign("__initial");
- eastl::string relativePath = "./";
- relativePath.append(filename);
- relativePath.append(".");
- relativePath.append("uip");
- RegisterAsset(SPresentationAsset(RegisterStr(m_PresentationId.c_str()),
- RegisterStr(relativePath.c_str())));
- m_AppLoadContext = IAppLoadContext::CreateXMLLoadContext(*this, "");
-
- retval = true;
- } else if (extension.comparei("uia") == 0) {
- CFileSeekableIOStream inputStream(sourcePath, FileReadFlags());
- if (inputStream.IsOpen()) {
- NVScopedRefCounted<IStringTable> strTable(
- IStringTable::CreateStringTable(fnd.getAllocator()));
- NVScopedRefCounted<IDOMFactory> domFactory(
- IDOMFactory::CreateDOMFactory(fnd.getAllocator(), strTable));
- SAppXMLErrorHandler errorHandler(fnd, sourcePath.toUtf8().constData());
- eastl::pair<SNamespacePairNode *, SDOMElement *> readResult =
- CDOMSerializer::Read(*domFactory, inputStream, &errorHandler);
- if (!readResult.second) {
- qCCritical(INVALID_PARAMETER, "%s doesn't appear to be valid xml",
- sourcePath.toUtf8().constData());
- } else {
- NVScopedRefCounted<IDOMReader> domReader = IDOMReader::CreateDOMReader(
- fnd.getAllocator(), *readResult.second, strTable, domFactory);
- if (m_visitor)
- m_visitor->visit(sourcePath.toUtf8().constData());
- retval = LoadUIA(*domReader, fnd);
- }
- } else {
- qCCritical(INVALID_PARAMETER, "Unable to open input file %s",
- sourcePath.toUtf8().constData());
- }
- } else {
- QT3DS_ASSERT(false);
- }
- return retval;
- }
-
- void EndLoad() override
- {
- if (m_AppLoadContext)
- m_AppLoadContext->EndLoad();
- }
-
- void RunAllRunnables()
- {
- {
- Mutex::ScopedLock __locker(m_RunnableMutex);
- m_MainThreadRunnables = m_ThreadRunnables;
- m_ThreadRunnables.clear();
- }
- for (QT3DSU32 idx = 0, end = m_MainThreadRunnables.size(); idx < end; ++idx)
- m_MainThreadRunnables[idx]->Run();
- m_MainThreadRunnables.clear();
- }
-
- bool HasCompletedLoading() override
- {
- RunAllRunnables();
- if (m_AppLoadContext)
- return m_AppLoadContext->HasCompletedLoading();
-
- return true;
- }
-
- bool createSuccessful() override
- {
- return m_createSuccessful;
- }
-
- bool presentationComponentSlide(const QString &elementPath,
- Q3DStudio::CPresentation *&presentation,
- TElement *&component,
- QString &slideName,
- int &index)
- {
- presentation = GetPrimaryPresentation();
- slideName = elementPath;
- QString componentName;
- if (elementPath.contains(QLatin1Char(':'))) {
- // presentation : component : slide
- QStringList splits = elementPath.split(QLatin1Char(':'));
- if (splits.size() == 3) {
- presentation = GetPresentationById(qPrintable(splits[0]));
- componentName = splits[1];
- slideName = splits[2];
- } else {
- componentName = splits[0];
- slideName = splits[1];
- }
- // else assume main presentation and component:slide
- }
- component = presentation->GetRoot();
- if (!componentName.isNull() && componentName != component->m_Name)
- component = component->FindChild(CHash::HashString(qPrintable(componentName)));
- if (!component) {
- qCWarning(WARNING) << "Could not find slide: " << elementPath;
- return false;
- }
- ISlideSystem &s = presentation->GetSlideSystem();
- index = s.FindSlide(*component, qPrintable(slideName));
- return true;
- }
-
- void preloadSlide(const QString &slide) override
- {
- CPresentation *pres = nullptr;
- TElement *component = nullptr;
- QString slideName;
- int index;
- if (presentationComponentSlide(slide, pres, component, slideName, index))
- loadComponentSlideResources(component, pres, index, slideName, false);
- }
-
- void unloadSlide(const QString &slide) override
- {
- CPresentation *pres = nullptr;
- TElement *component = nullptr;
- QString slideName;
- int index;
- if (presentationComponentSlide(slide, pres, component, slideName, index))
- unloadComponentSlideResources(component, pres, index, slideName);
- }
-
- void setDelayedLoading(bool enable)
- {
- m_RuntimeFactory->GetQt3DSRenderContext().GetBufferManager()
- .enableReloadableResources(enable);
- }
-
- void ComponentSlideEntered(Q3DStudio::CPresentation *presentation,
- Q3DStudio::TElement *component,
- const QString &elementPath, int slideIndex,
- const QString &slideName) override
- {
- loadComponentSlideResources(component, presentation, slideIndex, slideName, true);
- }
-
- void ComponentSlideExited(Q3DStudio::CPresentation *presentation,
- Q3DStudio::TElement *component,
- const QString &elementPath, int slideIndex,
- const QString &slideName) override
- {
- unloadComponentSlideResources(component, presentation, slideIndex, slideName);
- }
-
- // will force loading to end if endLoad hasn't been called yet. Will fire off loading
- // of resources that need to be uploaded to opengl. Maintains reference to runtime factory
- IApplication &CreateApplication(Q3DStudio::CInputEngine &inInputEngine,
- Q3DStudio::IAudioPlayer *inAudioPlayer,
- Q3DStudio::IRuntimeFactory &inFactory) override
- {
- {
- SStackPerfTimer __loadTimer(m_CoreFactory->GetPerfTimer(),
- "Application: Initialize Graphics");
-
- {
- SStackPerfTimer __timer(m_CoreFactory->GetPerfTimer(), "Application: EndLoad");
- EndLoad();
- }
- m_InputEnginePtr = &inInputEngine;
- m_RuntimeFactory = inFactory;
-
- {
- SStackPerfTimer __timer(m_CoreFactory->GetPerfTimer(),
- "Application: Load Context Graphics Initialized");
- if (m_AppLoadContext)
- m_createSuccessful = m_AppLoadContext->OnGraphicsInitialized(inFactory);
- // Guarantees the end of the multithreaded access to the various components
- m_AppLoadContext = NULL;
- if (!m_createSuccessful)
- return *this;
- }
-
- {
- SStackPerfTimer __loadTimer(m_CoreFactory->GetPerfTimer(),
- "Application: End Font Preload");
- if (m_CoreFactory->GetRenderContextCore().GetTextRendererCore())
- m_CoreFactory->GetRenderContextCore()
- .GetTextRendererCore()
- ->EndPreloadFonts();
- }
-
- RunAllRunnables();
- // Moving set application to the end ensures that the application load context is not
- // accessing
- // the lua state in another thread while we are calling set application. This
- // apparently may cause
- // the call to set application to fail miserably.
- m_RuntimeFactory->SetApplication(this);
- m_RuntimeFactory->GetStringTable().DisableMultithreadedAccess();
-
- for (QT3DSU32 idx = 0, end = m_OrderedAssets.size(); idx < end; ++idx) {
- if (m_OrderedAssets[idx].second->getType() == AssetValueTypes::Presentation) {
- SPresentationAsset &theAsset(
- *m_OrderedAssets[idx].second->getDataPtr<SPresentationAsset>());
- CPresentation *thePresentation = theAsset.m_Presentation;
- if (thePresentation) {
- SStackPerfTimer __loadTimer(m_CoreFactory->GetPerfTimer(),
- "Application: SetActivityZone");
- thePresentation->SetActivityZone(
- &m_ActivityZoneManager->CreateActivityZone(*thePresentation));
- thePresentation->SetActive(theAsset.m_Active);
- }
- }
- }
-
- inInputEngine.SetApplication(this);
- }
- SApplicationSettings finalSettings(/*m_CommandLineSettings, */m_UIAFileSettings);
- if (finalSettings.m_LayerCacheEnabled.hasValue()) {
- inFactory.GetQt3DSRenderContext().GetRenderer().EnableLayerCaching(
- *finalSettings.m_LayerCacheEnabled);
- }
-
- m_CoreFactory->GetPerfTimer().OutputTimerData();
-
- m_AudioPlayer.SetPlayer(inAudioPlayer);
-
- auto &rc = m_RuntimeFactory->GetQt3DSRenderContext();
- m_uploadRenderTask = QT3DS_NEW(m_CoreFactory->GetFoundation().getAllocator(),
- STextureUploadRenderTask(rc.GetImageBatchLoader(),
- rc.GetBufferManager(),
- rc.GetRenderContext().GetRenderContextType(),
- GetPrimaryPresentation()->GetScene()->preferKtx()));
- m_uploadRenderTask->add(m_createSet, true);
- m_RuntimeFactory->GetQt3DSRenderContext().GetRenderList()
- .AddRenderTask(*m_uploadRenderTask);
- m_createSet.clear();
- return *this;
- }
-
- //////////////////////////////////////////////////////////////////////////////////////////////////////
- // Getters/Setters
- //////////////////////////////////////////////////////////////////////////////////////////////////////
- CRegisteredString RegisterStr(const char8_t *inStr)
- {
- return m_CoreFactory->GetStringTable().RegisterStr(inStr);
- }
-
- // The directory that contains the executable and the root resource path
- CRegisteredString GetApplicationDirectory() const override
- {
- return const_cast<SApp &>(*this).m_CoreFactory->GetStringTable().RegisterStr(
- m_ApplicationDir.c_str());
- }
- // Directory that contained the XIF file.
- CRegisteredString GetProjectDirectory() const override
- {
- QT3DS_ASSERT(m_ProjectDir.size());
- return const_cast<SApp &>(*this).m_CoreFactory->GetStringTable().RegisterStr(
- m_ProjectDir.c_str());
- }
-
- CRegisteredString GetDllDir() const override
- {
- if (m_DLLDirectory.size()) {
- return const_cast<SApp &>(*this).m_CoreFactory->GetStringTable().RegisterStr(
- m_DLLDirectory.c_str());
- }
- return CRegisteredString();
- }
-
- void SetDllDir(const char *inDllDir) override
- {
- m_DLLDirectory.assign(nonNull(inDllDir));
- m_CoreFactory->SetDllDir(inDllDir);
- }
-
- Q3DStudio::IRuntimeFactory &GetRuntimeFactory() const override { return *m_RuntimeFactory.mPtr; }
- Q3DStudio::IRuntimeFactoryCore &GetRuntimeFactoryCore() override { return *m_CoreFactory; }
-
- Q3DStudio::CPresentation *GetPrimaryPresentation() override
- {
- return GetPresentationById(m_PresentationId.c_str());
- }
-
- Q3DStudio::CPresentation *GetPresentationById(const char8_t *inId) override
- {
- if (!isTrivial(inId)) {
- TIdAssetMap::iterator iter
- = m_AssetMap.find(m_CoreFactory->GetStringTable().RegisterStr(inId));
- if (iter != m_AssetMap.end()
- && iter->second->getType() == AssetValueTypes::Presentation) {
- return iter->second->getData<SPresentationAsset>().m_Presentation;
- }
- }
- return NULL;
- }
-
- // Returns a list of all presentations in the application
- // The primary presentation is returned at index 0
- QList<Q3DStudio::CPresentation *> GetPresentationList() override
- {
- QList<Q3DStudio::CPresentation *> list;
- for (TIdAssetMap::iterator iter = m_AssetMap.begin(); iter != m_AssetMap.end(); ++iter) {
- if (iter->second->getType() == AssetValueTypes::Presentation) {
- Q3DStudio::CPresentation *presentation
- = iter->second->getData<SPresentationAsset>().m_Presentation;
- if (presentation) {
- if (iter->first == m_PresentationId)
- list.prepend(presentation);
- else
- list.append(presentation);
- }
- }
- }
- return list;
- }
-
- template <typename TAssetType>
- void RegisterAsset(const TAssetType &inAsset)
- {
- NVScopedRefCounted<SRefCountedAssetValue> theValue(
- QT3DS_NEW(m_CoreFactory->GetFoundation().getAllocator(),
- SRefCountedAssetValue(m_CoreFactory->GetFoundation(), inAsset)));
- if (inAsset.m_Id.IsValid())
- m_AssetMap.insert(eastl::make_pair(inAsset.m_Id, theValue));
-
- m_OrderedAssets.push_back(eastl::make_pair(inAsset.m_Id, theValue));
-
- if (m_visitor) {
- m_visitor->visit(inAsset.Type(), inAsset.m_Id.c_str(), inAsset.m_Src.c_str(),
- inAsset.m_Args.c_str());
- }
- }
-
- THashValue HashString(const char *inStr) override
- {
- if (inStr == NULL)
- inStr = "";
- THashValue retval = CHash::HashString(inStr);
- eastl::pair<THashStrMap::iterator, bool> insertResult
- = m_HashStrMap.insert(eastl::make_pair(retval, CRegisteredString()));
- if (insertResult.second)
- insertResult.first->second = m_CoreFactory->GetStringTable().RegisterStr(inStr);
- return retval;
- }
-
- const char *ReverseHash(THashValue theValue) override
- {
- THashStrMap::iterator find = m_HashStrMap.find(theValue);
- if (find != m_HashStrMap.end())
- return find->second.c_str();
- return "";
- }
-
- void SetFrameCount(Q3DStudio::INT32 inFrameCount) override { m_FrameCount = inFrameCount; }
-
- Q3DStudio::INT32 GetFrameCount() override { return m_FrameCount; }
-
- void SetTimeMilliSecs(Q3DStudio::INT64 inMilliSecs) override { m_ManualTime = inMilliSecs; }
-
- Q3DStudio::INT64 GetTimeMilliSecs() override
- {
- return m_ManualTime == 0 ? m_Timer.GetTimeMilliSecs() : m_ManualTime;
- }
-
- void ResetTime() override
- {
- m_Timer.Reset();
- m_ManualTime = 0;
- }
-
- Q3DStudio::CInputEngine &GetInputEngine() override
- {
- QT3DS_ASSERT(m_InputEnginePtr);
- return *m_InputEnginePtr;
- }
-
- Q3DStudio::IRuntimeMetaData &GetMetaData() override
- {
- if (!m_MetaData) {
- m_MetaData = &IRuntimeMetaData::Create(m_CoreFactory->GetInputStreamFactory());
- if (!m_MetaData) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "IRuntimeMetaData::Create: Failed to create meta data";
- }
- }
- return *m_MetaData;
- }
-
- IActivityZoneManager &GetActivityZoneManager() override { return *m_ActivityZoneManager; }
-
- IElementAllocator &GetElementAllocator() override { return *m_ElementAllocator; }
-
- Q3DStudio::UINT32 GetHandleForElement(Q3DStudio::TElement *inElement) override
- {
- return inElement->GetHandle();
- }
-
- Q3DStudio::TElement *GetElementByHandle(Q3DStudio::UINT32 inHandle) override
- {
- return GetElementAllocator().FindElementByHandle(inHandle);
- }
-};
-
-struct SXMLLoader : public IAppLoadContext
-{
- SApp &m_App;
- eastl::string m_ScaleMode;
- QT3DSI32 mRefCount;
-
- SXMLLoader(SApp &inApp, const char8_t *sc)
- : m_App(inApp)
- , m_ScaleMode(nonNull(sc))
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_App.m_CoreFactory->GetFoundation().getAllocator())
-
- void EndLoad() override {}
-
- bool HasCompletedLoading() override { return true; }
-
- bool OnGraphicsInitialized(IRuntimeFactory &inFactory) override
- {
- eastl::vector<SElementAttributeReference> theUIPReferences;
- eastl::string tempString;
- for (QT3DSU32 idx = 0, end = m_App.m_OrderedAssets.size(); idx < end; ++idx) {
- SAssetValue &theAsset = *m_App.m_OrderedAssets[idx].second;
- eastl::string thePathStr;
-
- CFileTools::CombineBaseAndRelative(m_App.GetProjectDirectory().c_str(),
- theAsset.GetSource(), thePathStr);
- switch (theAsset.getType()) {
- case AssetValueTypes::Presentation: {
- QDir::addSearchPath(QStringLiteral("qt3dstudio"),
- QFileInfo(QString(thePathStr.c_str()))
- .absoluteDir().absolutePath());
- SPresentationAsset &thePresentationAsset
- = *theAsset.getDataPtr<SPresentationAsset>();
- theUIPReferences.clear();
-
- if (!m_App.LoadUIP(thePresentationAsset,
- toConstDataRef(theUIPReferences.data(),
- (QT3DSU32)theUIPReferences.size()))) {
- qCCritical(INVALID_OPERATION, "Unable to load presentation %s",
- thePathStr.c_str());
- }
- } break;
- case AssetValueTypes::Behavior: {
- SBehaviorAsset &theBehaviorAsset = *theAsset.getDataPtr<SBehaviorAsset>();
- Q3DStudio::INT32 scriptId
- = m_App.m_CoreFactory->GetScriptEngineQml().InitializeApplicationBehavior(
- theBehaviorAsset.m_Src);
- if (scriptId == 0) {
- qCCritical(INVALID_OPERATION, "Unable to load application behavior %s",
- theBehaviorAsset.m_Src.c_str());
- } else {
- theBehaviorAsset.m_Handle = scriptId;
- m_App.m_Behaviors.push_back(eastl::make_pair(theBehaviorAsset, false));
- }
- } break;
- case AssetValueTypes::RenderPlugin: {
- SRenderPluginAsset &thePluginAsset = *theAsset.getDataPtr<SRenderPluginAsset>();
-
- inFactory.GetSceneManager().LoadRenderPlugin(
- thePluginAsset.m_Id, thePathStr.c_str(), thePluginAsset.m_Args);
- } break;
-
- case AssetValueTypes::QmlPresentation: {
- SQmlPresentationAsset &asset = *theAsset.getDataPtr<SQmlPresentationAsset>();
- inFactory.GetSceneManager().LoadQmlStreamerPlugin(asset.m_Id);
- } break;
- // SCXML, NoAssetValue do not need processing here
- default:
- break;
- }
- }
- if (m_ScaleMode.empty() == false) {
- const char8_t *initialScaleMode(m_ScaleMode.c_str());
- // Force loading to finish here, just like used to happen.
- if (AreEqual(initialScaleMode, "center")) {
- inFactory.GetQt3DSRenderContext().SetScaleMode(qt3ds::render::ScaleModes::ExactSize);
- } else if (AreEqual(initialScaleMode, "fit")) {
- inFactory.GetQt3DSRenderContext().SetScaleMode(qt3ds::render::ScaleModes::ScaleToFit);
- } else if (AreEqual(initialScaleMode, "fill")) {
- inFactory.GetQt3DSRenderContext().SetScaleMode(qt3ds::render::ScaleModes::ScaleToFill);
- } else {
- qCCritical(INVALID_PARAMETER, "Unrecognized scale mode attribute value: ",
- initialScaleMode);
- }
- }
- return true;
- }
-
- virtual void OnFirstRender() {}
-};
-
-IAppLoadContext &IAppLoadContext::CreateXMLLoadContext(
- SApp &inApp, const char8_t *inScaleMode)
-{
- return *QT3DS_NEW(inApp.m_CoreFactory->GetFoundation().getAllocator(),
- SXMLLoader)(inApp, inScaleMode);
-}
-
-CAppStr::CAppStr(NVAllocatorCallback &alloc, const char8_t *inStr)
- : TBase(inStr, ForwardingAllocator(alloc, "CAppStr"))
-{
-}
-
-CAppStr::CAppStr(const CAppStr &inOther)
- : TBase(inOther)
-{
-}
-
-CAppStr::CAppStr()
- : TBase()
-{
-}
-
-CAppStr &CAppStr::operator=(const CAppStr &inOther)
-{
- TBase::operator=(inOther);
- return *this;
-}
-
-IApplication &IApplication::CreateApplicationCore(Q3DStudio::IRuntimeFactoryCore &inFactory,
- const char8_t *inApplicationDirectory)
-{
- return *QT3DS_NEW(inFactory.GetFoundation().getAllocator(), SApp)(inFactory,
- inApplicationDirectory);
-}
-
-// Checks if the event is one that can cause picking
-bool IApplication::isPickingEvent(TEventCommandHash event)
-{
- return (event == ON_MOUSEDOWN
- || event == ON_MOUSEUP
- || event == ON_MIDDLEMOUSEDOWN
- || event == ON_MIDDLEMOUSEUP
- || event == ON_RIGHTMOUSEDOWN
- || event == ON_RIGHTMOUSEUP
- || event == ON_MOUSECLICK
- || event == ON_MIDDLEMOUSECLICK
- || event == ON_RIGHTMOUSECLICK
- || event == ON_MOUSEOVER
- || event == ON_MOUSEOUT
- || event == ON_GROUPEDMOUSEOVER
- || event == ON_GROUPEDMOUSEOUT);
-}
-
-QDebug operator<<(QDebug debug, const DataInOutAttribute &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "DataInOutAttribute(";
- debug.nospace() << "elementPath:" << value.elementPath;
- debug.nospace() << ", attributeNames: {";
- for (auto name : value.attributeName)
- debug << QString::fromUtf8(name);
-
- debug.nospace() << "}, propertyType:" << value.propertyType;
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const DataInOutType &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "DataInOutType::";
- switch (value) {
- case DataInOutType::DataInOutTypeInvalid:
- debug.nospace() << "DataInOutTypeInvalid";
- break;
- case DataInOutType::DataInOutTypeRangedNumber:
- debug.nospace() << "DataInOutTypeRangedNumber";
- break;
- case DataInOutType::DataInOutTypeString:
- debug.nospace() << "DataInOutTypeString";
- break;
- case DataInOutType::DataInOutTypeFloat:
- debug.nospace() << "DataInOutTypeFloat";
- break;
- case DataInOutType::DataInOutTypeEvaluator:
- debug.nospace() << "DataInOutTypeEvaluator";
- break;
- case DataInOutType::DataInOutTypeBoolean:
- debug.nospace() << "DataInOutTypeBoolean";
- break;
- case DataInOutType::DataInOutTypeVector4:
- debug.nospace() << "DataInOutTypeVector4";
- break;
- case DataInOutType::DataInOutTypeVector3:
- debug.nospace() << "DataInOutTypeVector3";
- break;
- case DataInOutType::DataInOutTypeVector2:
- debug.nospace() << "DataInOutTypeVector2";
- break;
- case DataInOutType::DataInOutTypeVariant:
- debug.nospace() << "DataInOutTypeVariant";
- break;
- default:
- debug.nospace() << "UNKNOWN";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const DataInputValueRole &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "DataInputValueRole::";
- switch (value) {
- case DataInputValueRole::Value:
- debug.nospace() << "Value";
- break;
- case DataInputValueRole::Min:
- debug.nospace() << "Min";
- break;
- case DataInputValueRole::Max:
- debug.nospace() << "Max";
- break;
- default:
- debug.nospace() << "UNKNOWN";
- }
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const DataInputDef &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "DataInputDef(";
- debug.nospace() << "type:" << value.type;
- debug.nospace() << ", controlledAttributes: {";
- for (auto attr : value.controlledAttributes)
- debug << attr;
-
- debug.nospace() << "}, min:" << value.min;
- debug.nospace() << ", min:" << value.min << ", max:" << value.max;
- debug.nospace() << ", evaluator:" << value.evaluator;
- debug.nospace() << ", value:" << value.value;
- debug.nospace() << ", dependents:{";
- for (auto dep : value.dependents)
- debug << dep;
-
- debug.nospace() << "})";
- return debug;
-}
-
-QDebug operator<<(QDebug debug, const DataOutputDef &value)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "DataOutputDef(";
- debug.nospace() << "name:" << value.name << ", type:" << value.type;
- debug.nospace() << ", observedHandle:" << value.observedHandle;
- debug.nospace() << ", min:" << value.min << ", max:" << value.max;
- debug.nospace() << ", timelineComponent:" << value.timelineComponent << ")";
- return debug;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.h
deleted file mode 100644
index 39cd3c4b..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplication.h
+++ /dev/null
@@ -1,261 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_APPLICATION_H
-#define QT3DS_APPLICATION_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Utils.h"
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSMetadata.h"
-#include "QtQml/qjsengine.h"
-
-namespace Q3DStudio {
-class IRuntimeFactory;
-class IRuntimeFactoryCore;
-class CRuntime;
-class CPresentation;
-class CInputEngine;
-class IAudioPlayer;
-}
-
-namespace qt3ds {
-namespace state {
-namespace debugger {
-class IDebugger;
-class ISceneGraphRuntimeDebugger;
-}
-}
-}
-
-namespace qt3ds {
-class Qt3DSAssetVisitor;
-namespace runtime {
-using namespace qt3ds::foundation;
-using namespace qt3ds;
-
-class IElementAllocator;
-class IActivityZoneManager;
-
-class CAppStr : public eastl::basic_string<char8_t, ForwardingAllocator>
-{
- typedef eastl::basic_string<char8_t, ForwardingAllocator> TBase;
-
-public:
- CAppStr(NVAllocatorCallback &alloc, const char8_t *inStr = NULL);
- CAppStr(const CAppStr &inOther);
- CAppStr();
- CAppStr &operator=(const CAppStr &inOther);
-};
-
-class IApplication;
-
-class IAppRunnable : public NVRefCounted
-{
-public:
- virtual void Run() = 0;
-};
-
-struct DataInOutAttribute
-{
- QByteArray elementPath;
- QVector<QByteArray> attributeName;
- Q3DStudio::EAttributeType propertyType = Q3DStudio::ATTRIBUTETYPE_NONE;
-};
-
-enum DataInOutType {
- DataInOutTypeInvalid = 0,
- DataInOutTypeRangedNumber,
- DataInOutTypeString,
- DataInOutTypeFloat,
- DataInOutTypeEvaluator,
- DataInOutTypeBoolean,
- DataInOutTypeVector4,
- DataInOutTypeVector3,
- DataInOutTypeVector2,
- DataInOutTypeVariant
-};
-
-// Duplicated from Q3DSDataInput class on viewer side
-enum class DataInputValueRole {
- Value = 0,
- Min = 1,
- Max = 2
-};
-
-struct DataInputDef
-{
- QVector<DataInOutAttribute> controlledAttributes;
- DataInOutType type = DataInOutTypeInvalid;
- float min = 0.0f;
- float max = 0.0f;
- QString evaluator;
- QJSValue evalFunc; // keep both evaluator string and JS function
- // to avoid having to evaluate string several times
- QVariant value; // most recently set value
- // evaluator datainputs that need to re-evaluate when this datainput changes value
- QVector<QString> dependents;
-
-};
-
-struct DataOutputDef
-{
- DataInOutAttribute observedAttribute;
- DataInOutType type = DataInOutTypeInvalid;
- QVariant value; // most recently notified value
- QString name;
- QT3DSU32 observedHandle;
- float min = 0.0f;
- float max = 0.0f;
- Q3DStudio::TComponent *timelineComponent; // Valid only for @timeline
-};
-
-typedef QMap<QString, DataInputDef> DataInputMap;
-typedef QMap<QString, DataOutputDef> DataOutputMap;
-
-class QT3DS_AUTOTEST_EXPORT IApplication : public NVRefCounted
-{
-public:
- virtual Q3DStudio::IRuntimeFactory &GetRuntimeFactory() const = 0;
-
- virtual void SetFrameCount(Q3DStudio::INT32 inFrameCount) = 0;
- virtual Q3DStudio::INT32 GetFrameCount() = 0;
-
- // Allow overriding the global wall time. This way animations can be
- // advanced at an arbitrary rate when rendering offscreen. Set to 0 to
- // disable (the default).
- virtual void SetTimeMilliSecs(Q3DStudio::INT64 inMilliSecs) = 0;
-
- virtual Q3DStudio::INT64 GetTimeMilliSecs() = 0;
- virtual void ResetTime() = 0;
-
- // Setup during UpdateAndRender. Returns 0 for first frame.
- virtual double GetMillisecondsSinceLastFrame() = 0;
-
- virtual Q3DStudio::CInputEngine &GetInputEngine() = 0;
-
- virtual Q3DStudio::CPresentation *GetPrimaryPresentation() = 0;
-
- virtual Q3DStudio::CPresentation *GetPresentationById(const char8_t *inId) = 0;
-
- virtual QList<Q3DStudio::CPresentation *> GetPresentationList() = 0;
-
- // Update all the presentations and render them. Called exactly once per frame.
- virtual void UpdateAndRender() = 0;
-
- virtual bool IsApplicationDirty() = 0;
-
- virtual void MarkApplicationDirty() = 0;
-
- virtual Q3DStudio::IAudioPlayer &GetAudioPlayer() = 0;
-
- virtual bool createSuccessful() = 0;
-
- virtual DataInputMap &dataInputMap() = 0;
- virtual DataOutputMap &dataOutputMap() = 0;
-
- virtual QList<QString> dataInputs() const = 0;
- virtual QList<QString> dataOutputs() const = 0;
-
- virtual float dataInputMax(const QString &name) const = 0;
-
- virtual float dataInputMin(const QString &name) const = 0;
-
- virtual void setPresentationId(const QString &id) = 0;
-
- virtual void preloadSlide(const QString &slide) = 0;
- virtual void unloadSlide(const QString &slide) = 0;
- virtual void setDelayedLoading(bool enable) = 0;
-
- // threadsafe call.
- virtual void QueueForMainThread(IAppRunnable &inRunnable) = 0;
-
- // The directory that contains the executable and the root resource path
- virtual CRegisteredString GetApplicationDirectory() const = 0;
- // Directory that contained the UIA file.
- virtual CRegisteredString GetProjectDirectory() const = 0;
- // Directory where we will copy shared object files to before we load them.
- // This is specifically for android and the case where the place where the project exists
- // is not always the place where we can load the project.
- virtual CRegisteredString GetDllDir() const = 0;
- virtual void SetDllDir(const char *inDllDir) = 0;
- virtual Q3DStudio::THashValue HashString(const char *inStr) = 0;
- virtual const char *ReverseHash(Q3DStudio::THashValue theValue) = 0;
-
- virtual Q3DStudio::IRuntimeMetaData &GetMetaData() = 0;
- // Element handles are unique across all presentations.
- virtual Q3DStudio::TElement *GetElementByHandle(Q3DStudio::UINT32 inHandle) = 0;
- // Passing in NULL gets you zero as the return handle.
- virtual Q3DStudio::UINT32 GetHandleForElement(Q3DStudio::TElement *inElement) = 0;
-
- virtual Q3DStudio::IRuntimeFactoryCore &GetRuntimeFactoryCore() = 0;
-
- virtual IActivityZoneManager &GetActivityZoneManager() = 0;
- virtual IElementAllocator &GetElementAllocator() = 0;
-
- // nonblocking call to begin loading, loads uia file alone and returns.
- virtual bool BeginLoad(const QString &sourcePath, const QStringList &variantList) = 0;
- // blocking call to end all loading threads and such/wait till finished
- virtual void EndLoad() = 0;
- // Will EndLoad cause nontrivial blocking.
- // Runs any queued runnables.
- virtual bool HasCompletedLoading() = 0;
-
- virtual void setAssetVisitor(qt3ds::Qt3DSAssetVisitor *) = 0;
-
- virtual void ComponentSlideEntered(Q3DStudio::CPresentation *presentation,
- Q3DStudio::TElement *component,
- const QString &elementPath, int slideIndex,
- const QString &slideName) = 0;
- virtual void ComponentSlideExited(Q3DStudio::CPresentation *presentation,
- Q3DStudio::TElement *component,
- const QString &elementPath, int slideIndex,
- const QString &slideName) = 0;
-
- // will force loading to end if endLoad hasn't been called yet. Will fire off loading
- // of resources that need to be uploaded to opengl. Maintains reference to runtime factory
- virtual IApplication &CreateApplication(Q3DStudio::CInputEngine &inInputEngine,
- Q3DStudio::IAudioPlayer *inAudioPlayer,
- Q3DStudio::IRuntimeFactory &inFactory) = 0;
-
- // maintains reference to runtime factory core. AppDir is where the executable is located;
- // the system will expect res directory
- // next to executable.
- static IApplication &CreateApplicationCore(Q3DStudio::IRuntimeFactoryCore &inFactory,
- const char8_t *inApplicationDirectory);
- static bool isPickingEvent(Q3DStudio::TEventCommandHash event);
-};
-
-bool isImagePath(const QString &path);
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplicationValues.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplicationValues.h
deleted file mode 100644
index 80e8f73f..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSApplicationValues.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#include "Qt3DSApplication.h"
-#include "foundation/Qt3DSDiscriminatedUnion.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-
-class Qt3DSAssetVisitor
-{
-public:
- virtual void visit(const char *path) = 0;
- virtual void visit(const char *type, const char *id, const char *src, const char *args) = 0;
-};
-
-namespace runtime {
-
- using qt3ds::foundation::CRegisteredString;
-
- struct AssetValueTypes
- {
- enum Enum {
- NoAssetValue = 0,
- Presentation,
- SCXML,
- RenderPlugin,
- Behavior,
- QmlPresentation,
- };
- };
- struct SAssetBase
- {
- CRegisteredString m_Id;
- CRegisteredString m_Src;
- CRegisteredString m_Args;
- SAssetBase(CRegisteredString inId = CRegisteredString(),
- CRegisteredString inSrc = CRegisteredString(),
- CRegisteredString inArgs = CRegisteredString())
- : m_Id(inId)
- , m_Src(inSrc)
- , m_Args(inArgs)
- {
- }
- bool operator==(const SAssetBase &inOther) const
- {
- return m_Id == inOther.m_Id && m_Src == inOther.m_Src
- && m_Args == inOther.m_Args;
- }
- template <typename TRemapper>
- void Remap(TRemapper &item)
- {
- item.Remap(m_Id);
- item.Remap(m_Src);
- item.Remap(m_Args);
- }
- virtual const char *Type() const
- {
- return nullptr;
- }
- };
-
- struct SPresentationAsset : public SAssetBase
- {
- Q3DStudio::CPresentation *m_Presentation;
- bool m_Active;
-
- SPresentationAsset(CRegisteredString inId = CRegisteredString(),
- CRegisteredString inRelPath = CRegisteredString(),
- Q3DStudio::CPresentation *inPresentation = NULL)
- : SAssetBase(inId, inRelPath, CRegisteredString())
- , m_Presentation(inPresentation)
- , m_Active(true)
- {
- }
-
- bool operator==(const SPresentationAsset &inOther) const
- {
- return SAssetBase::operator==(inOther) && m_Presentation == inOther.m_Presentation
- && m_Active == inOther.m_Active;
- }
-
- template <typename TRemapper>
- void Remap(TRemapper &item)
- {
- m_Presentation = NULL;
- SAssetBase::Remap(item);
- }
- const char *Type() const override
- {
- return "presentation";
- }
- };
-
- struct SSCXMLAsset : public SAssetBase
- {
- CRegisteredString m_Datamodel;
- SSCXMLAsset(CRegisteredString inId = CRegisteredString(),
- CRegisteredString inRelPath = CRegisteredString(),
- CRegisteredString inDatamodel = CRegisteredString())
- : SAssetBase(inId, inRelPath, CRegisteredString())
- , m_Datamodel(inDatamodel)
- {
- }
- bool operator==(const SSCXMLAsset &inOther) const
- {
- return SAssetBase::operator==(inOther) && m_Datamodel == inOther.m_Datamodel;
- }
- template <typename TRemapper>
- void Remap(TRemapper &item)
- {
- SAssetBase::Remap(item);
- item.Remap(m_Datamodel);
- }
- const char *Type() const override
- {
- return "scxml";
- }
- };
-
- struct SRenderPluginAsset : public SAssetBase
- {
- SRenderPluginAsset(CRegisteredString inId = CRegisteredString(),
- CRegisteredString inRelPath = CRegisteredString(),
- CRegisteredString inArgs = CRegisteredString())
- : SAssetBase(inId, inRelPath, inArgs)
- {
- }
- const char *Type() const override
- {
- return "renderplugin";
- }
- };
-
- struct SQmlPresentationAsset : public SAssetBase
- {
- SQmlPresentationAsset(CRegisteredString inId = CRegisteredString(),
- CRegisteredString inRelPath = CRegisteredString(),
- CRegisteredString inArgs = CRegisteredString())
- : SAssetBase(inId, inRelPath, inArgs)
- {
- }
- const char *Type() const override
- {
- return "presentation-qml";
- }
- };
-
- struct SBehaviorAsset : public SAssetBase
- {
- Q3DStudio::INT32 m_Handle;
- SBehaviorAsset(CRegisteredString inId = CRegisteredString(),
- CRegisteredString inRelPath = CRegisteredString(),
- Q3DStudio::INT32 inHandle = 0)
- : SAssetBase(inId, inRelPath, CRegisteredString())
- , m_Handle(inHandle)
- {
- }
- bool operator==(const SBehaviorAsset &inOther) const
- {
- return SAssetBase::operator==(inOther) && m_Handle == inOther.m_Handle;
- }
- template <typename TRemapper>
- void Remap(TRemapper &item)
- {
- m_Handle = -1;
- SAssetBase::Remap(item);
- }
- const char *Type() const override
- {
- return "behaviour";
- }
- };
-}
-}
-
-namespace qt3ds {
-namespace foundation {
- template <>
- struct DestructTraits<qt3ds::runtime::SPresentationAsset>
- {
- void destruct(qt3ds::runtime::SPresentationAsset &) {}
- };
- template <>
- struct DestructTraits<qt3ds::runtime::SSCXMLAsset>
- {
- void destruct(qt3ds::runtime::SSCXMLAsset &) {}
- };
- template <>
- struct DestructTraits<qt3ds::runtime::SRenderPluginAsset>
- {
- void destruct(qt3ds::runtime::SRenderPluginAsset &) {}
- };
- template <>
- struct DestructTraits<qt3ds::runtime::SBehaviorAsset>
- {
- void destruct(qt3ds::runtime::SBehaviorAsset &) {}
- };
-}
-}
-
-namespace qt3ds {
-namespace runtime {
-
- // Force compile error if unsupported datatype requested
- template <typename TDataType>
- struct SAssetValueTypeMap
- {
- };
-
- template <>
- struct SAssetValueTypeMap<SPresentationAsset>
- {
- static AssetValueTypes::Enum GetType() { return AssetValueTypes::Presentation; }
- };
- template <>
- struct SAssetValueTypeMap<SSCXMLAsset>
- {
- static AssetValueTypes::Enum GetType() { return AssetValueTypes::SCXML; }
- };
- template <>
- struct SAssetValueTypeMap<SRenderPluginAsset>
- {
- static AssetValueTypes::Enum GetType() { return AssetValueTypes::RenderPlugin; }
- };
- template <>
- struct SAssetValueTypeMap<SQmlPresentationAsset>
- {
- static AssetValueTypes::Enum GetType() { return AssetValueTypes::QmlPresentation; }
- };
- template <>
- struct SAssetValueTypeMap<SBehaviorAsset>
- {
- static AssetValueTypes::Enum GetType() { return AssetValueTypes::Behavior; }
- };
-
- struct SAssetValueUnionTraits
- {
- typedef AssetValueTypes::Enum TIdType;
- enum {
- TBufferSize = sizeof(SPresentationAsset),
- };
-
- static TIdType getNoDataId() { return AssetValueTypes::NoAssetValue; }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return SAssetValueTypeMap<TDataType>().GetType();
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case AssetValueTypes::Presentation:
- return inVisitor(*NVUnionCast<SPresentationAsset *>(inData));
- case AssetValueTypes::SCXML:
- return inVisitor(*NVUnionCast<SSCXMLAsset *>(inData));
- case AssetValueTypes::RenderPlugin:
- return inVisitor(*NVUnionCast<SRenderPluginAsset *>(inData));
- case AssetValueTypes::Behavior:
- return inVisitor(*NVUnionCast<SBehaviorAsset *>(inData));
- case AssetValueTypes::QmlPresentation:
- return inVisitor(*NVUnionCast<SQmlPresentationAsset*>(inData));
- default:
- QT3DS_ASSERT(false);
- case AssetValueTypes::NoAssetValue:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case AssetValueTypes::Presentation:
- return inVisitor(*NVUnionCast<const SPresentationAsset *>(inData));
- case AssetValueTypes::SCXML:
- return inVisitor(*NVUnionCast<const SSCXMLAsset *>(inData));
- case AssetValueTypes::RenderPlugin:
- return inVisitor(*NVUnionCast<const SRenderPluginAsset *>(inData));
- case AssetValueTypes::Behavior:
- return inVisitor(*NVUnionCast<const SBehaviorAsset *>(inData));
- case AssetValueTypes::QmlPresentation:
- return inVisitor(*NVUnionCast<const SQmlPresentationAsset *>(inData));
- default:
- QT3DS_ASSERT(false);
- case AssetValueTypes::NoAssetValue:
- return inVisitor();
- }
- }
- };
-
- typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SAssetValueUnionTraits,
- SAssetValueUnionTraits::TBufferSize>,
- SAssetValueUnionTraits::TBufferSize>
- TAssetValueUnionType;
-
- struct SAssetValue : public TAssetValueUnionType
- {
- SAssetValue() {}
-
- SAssetValue(const SAssetValue &inOther)
- : TAssetValueUnionType(static_cast<const TAssetValueUnionType &>(inOther))
- {
- }
-
- template <typename TDataType>
- SAssetValue(const TDataType &inDt)
- : TAssetValueUnionType(inDt)
- {
- }
-
- SAssetValue &operator=(const SAssetValue &inOther)
- {
- TAssetValueUnionType::operator=(inOther);
- return *this;
- }
-
- bool operator==(const SAssetValue &inOther) const
- {
- return TAssetValueUnionType::operator==(inOther);
- }
- bool operator!=(const SAssetValue &inOther) const
- {
- return TAssetValueUnionType::operator!=(inOther);
- }
-
- bool empty() const { return getType() == AssetValueTypes::NoAssetValue; }
-
- CRegisteredString GetSource()
- {
- if (empty())
- return CRegisteredString();
- return reinterpret_cast<SAssetBase *>(m_Data)->m_Src;
- }
- };
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.cpp
deleted file mode 100644
index 1daddc10..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSAttributeHashes.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-// !!!!! AUTOGENERATED CODE - DO NOT MODIFY MANUALLY !!!!!
-
-// Run the AttributeHashes project to regenerate this file from Attributehashes.txt list
-
-
-
-/// Function providing reverse hash lookup
-const char *GetAttributeString(const EAttribute inAttribute)
-{
- switch (inAttribute) {
- case ATTRIBUTE_NAME: return "name";
- case ATTRIBUTE_TYPE: return "type";
- case ATTRIBUTE_OPACITY: return "opacity";
- case ATTRIBUTE_STARTTIME: return "starttime";
- case ATTRIBUTE_ENDTIME: return "endtime";
- case ATTRIBUTE_SOURCEPATH: return "sourcepath";
- case ATTRIBUTE_IMPORTID: return "importid";
- case ATTRIBUTE_EYEBALL: return "eyeball";
- case ATTRIBUTE_POSITION: return "position";
- case ATTRIBUTE_POSITION_X: return "position.x";
- case ATTRIBUTE_POSITION_Y: return "position.y";
- case ATTRIBUTE_POSITION_Z: return "position.z";
- case ATTRIBUTE_ROTATION: return "rotation";
- case ATTRIBUTE_ROTATION_X: return "rotation.x";
- case ATTRIBUTE_ROTATION_Y: return "rotation.y";
- case ATTRIBUTE_ROTATION_Z: return "rotation.z";
- case ATTRIBUTE_SCALE: return "scale";
- case ATTRIBUTE_SCALE_X: return "scale.x";
- case ATTRIBUTE_SCALE_Y: return "scale.y";
- case ATTRIBUTE_SCALE_Z: return "scale.z";
- case ATTRIBUTE_PIVOT: return "pivot";
- case ATTRIBUTE_PIVOT_X: return "pivot.x";
- case ATTRIBUTE_PIVOT_Y: return "pivot.y";
- case ATTRIBUTE_PIVOT_Z: return "pivot.z";
- case ATTRIBUTE_ROTATIONORDER: return "rotationorder";
- case ATTRIBUTE_ORIENTATION: return "orientation";
- case ATTRIBUTE_SHADOWCASTER: return "shadowcaster";
- case ATTRIBUTE_TESSELLATION: return "tessellation";
- case ATTRIBUTE_EDGETESS: return "edgetess";
- case ATTRIBUTE_INNERTESS: return "innertess";
- case ATTRIBUTE_ORTHOGRAPHIC: return "orthographic";
- case ATTRIBUTE_CLIPNEAR: return "clipnear";
- case ATTRIBUTE_CLIPFAR: return "clipfar";
- case ATTRIBUTE_FOV: return "fov";
- case ATTRIBUTE_FOVHORIZONTAL: return "fovhorizontal";
- case ATTRIBUTE_SCALEMODE: return "scalemode";
- case ATTRIBUTE_SCALEANCHOR: return "scaleanchor";
- case ATTRIBUTE_BRIGHTNESS: return "brightness";
- case ATTRIBUTE_LINEARFADE: return "linearfade";
- case ATTRIBUTE_EXPFADE: return "expfade";
- case ATTRIBUTE_LIGHTTYPE: return "lighttype";
- case ATTRIBUTE_SCOPE: return "scope";
- case ATTRIBUTE_LIGHTDIFFUSE: return "lightdiffuse";
- case ATTRIBUTE_LIGHTDIFFUSE_R: return "lightdiffuse.r";
- case ATTRIBUTE_LIGHTDIFFUSE_G: return "lightdiffuse.g";
- case ATTRIBUTE_LIGHTDIFFUSE_B: return "lightdiffuse.b";
- case ATTRIBUTE_LIGHTDIFFUSE_A: return "lightdiffuse.a";
- case ATTRIBUTE_LIGHTAMBIENT: return "lightambient";
- case ATTRIBUTE_LIGHTAMBIENT_R: return "lightambient.r";
- case ATTRIBUTE_LIGHTAMBIENT_G: return "lightambient.g";
- case ATTRIBUTE_LIGHTAMBIENT_B: return "lightambient.b";
- case ATTRIBUTE_LIGHTAMBIENT_A: return "lightambient.a";
- case ATTRIBUTE_LIGHTSPECULAR: return "lightspecular";
- case ATTRIBUTE_LIGHTSPECULAR_R: return "lightspecular.r";
- case ATTRIBUTE_LIGHTSPECULAR_G: return "lightspecular.g";
- case ATTRIBUTE_LIGHTSPECULAR_B: return "lightspecular.b";
- case ATTRIBUTE_LIGHTSPECULAR_A: return "lightspecular.a";
- case ATTRIBUTE_AREAWIDTH: return "areawidth";
- case ATTRIBUTE_AREAHEIGHT: return "areaheight";
- case ATTRIBUTE_CASTSHADOW: return "castshadow";
- case ATTRIBUTE_SHDWBIAS: return "shdwbias";
- case ATTRIBUTE_SHDWFACTOR: return "shdwfactor";
- case ATTRIBUTE_SHDWMAPRES: return "shdwmapres";
- case ATTRIBUTE_SHDWMAPFAR: return "shdwmapfar";
- case ATTRIBUTE_SHDWMAPFOV: return "shdwmapfov";
- case ATTRIBUTE_SHDWFILTER: return "shdwfilter";
- case ATTRIBUTE_LIGHTMAPINDIRECT: return "lightmapindirect";
- case ATTRIBUTE_LIGHTMAPRADIOSITY: return "lightmapradiosity";
- case ATTRIBUTE_LIGHTMAPSHADOW: return "lightmapshadow";
- case ATTRIBUTE_IBLPROBE: return "iblprobe";
- case ATTRIBUTE_SHADERLIGHTING: return "shaderlighting";
- case ATTRIBUTE_EMISSIVEPOWER: return "emissivepower";
- case ATTRIBUTE_EMISSIVECOLOR: return "emissivecolor";
- case ATTRIBUTE_EMISSIVECOLOR_R: return "emissivecolor.r";
- case ATTRIBUTE_EMISSIVECOLOR_G: return "emissivecolor.g";
- case ATTRIBUTE_EMISSIVECOLOR_B: return "emissivecolor.b";
- case ATTRIBUTE_EMISSIVECOLOR_A: return "emissivecolor.a";
- case ATTRIBUTE_DIFFUSE: return "diffuse";
- case ATTRIBUTE_DIFFUSE_R: return "diffuse.r";
- case ATTRIBUTE_DIFFUSE_G: return "diffuse.g";
- case ATTRIBUTE_DIFFUSE_B: return "diffuse.b";
- case ATTRIBUTE_DIFFUSE_A: return "diffuse.a";
- case ATTRIBUTE_SPECULARMAP: return "specularmap";
- case ATTRIBUTE_SPECULARMODEL: return "specularmodel";
- case ATTRIBUTE_SPECULARTINT: return "speculartint";
- case ATTRIBUTE_SPECULARTINT_R: return "speculartint.r";
- case ATTRIBUTE_SPECULARTINT_G: return "speculartint.g";
- case ATTRIBUTE_SPECULARTINT_B: return "speculartint.b";
- case ATTRIBUTE_SPECULARTINT_A: return "speculartint.a";
- case ATTRIBUTE_IOR: return "ior";
- case ATTRIBUTE_FRESNELPOWER: return "fresnelPower";
- case ATTRIBUTE_SPECULARAMOUNT: return "specularamount";
- case ATTRIBUTE_SPECULARROUGHNESS: return "specularroughness";
- case ATTRIBUTE_ROUGHNESSMAP: return "roughnessmap";
- case ATTRIBUTE_BLENDMODE: return "blendmode";
- case ATTRIBUTE_CULLING: return "culling";
- case ATTRIBUTE_ZBUFFERWRITE: return "zbufferwrite";
- case ATTRIBUTE_DIFFUSEMAP: return "diffusemap";
- case ATTRIBUTE_DIFFUSEMAP2: return "diffusemap2";
- case ATTRIBUTE_DIFFUSEMAP3: return "diffusemap3";
- case ATTRIBUTE_SPECULARREFLECTION: return "specularreflection";
- case ATTRIBUTE_OPACITYMAP: return "opacitymap";
- case ATTRIBUTE_EMISSIVEMAP: return "emissivemap";
- case ATTRIBUTE_EMISSIVEMAP2: return "emissivemap2";
- case ATTRIBUTE_BUMPMAP: return "bumpmap";
- case ATTRIBUTE_BUMPAMOUNT: return "bumpamount";
- case ATTRIBUTE_NORMALMAP: return "normalmap";
- case ATTRIBUTE_DISPLACEMENTMAP: return "displacementmap";
- case ATTRIBUTE_DISPLACEAMOUNT: return "displaceamount";
- case ATTRIBUTE_TRANSLUCENCYMAP: return "translucencymap";
- case ATTRIBUTE_TRANSLUCENTFALLOFF: return "translucentfalloff";
- case ATTRIBUTE_DIFFUSELIGHTWRAP: return "diffuselightwrap";
- case ATTRIBUTE_REFERENCEDMATERIAL: return "referencedmaterial";
- case ATTRIBUTE_VERTEXCOLORS: return "vertexcolors";
- case ATTRIBUTE_ROTATIONUV: return "rotationuv";
- case ATTRIBUTE_POSITIONU: return "positionu";
- case ATTRIBUTE_POSITIONV: return "positionv";
- case ATTRIBUTE_SCALEU: return "scaleu";
- case ATTRIBUTE_SCALEV: return "scalev";
- case ATTRIBUTE_PIVOTU: return "pivotu";
- case ATTRIBUTE_PIVOTV: return "pivotv";
- case ATTRIBUTE_TILINGMODEHORZ: return "tilingmodehorz";
- case ATTRIBUTE_TILINGMODEVERT: return "tilingmodevert";
- case ATTRIBUTE_MAPPINGTYPE: return "mappingtype";
- case ATTRIBUTE_MAPPINGMODE: return "mappingmode";
- case ATTRIBUTE_SUBPRESENTATION: return "subpresentation";
- case ATTRIBUTE_URI: return "uri";
- case ATTRIBUTE_TRANSPARENT: return "transparent";
- case ATTRIBUTE_PROGRESSIVEAA: return "progressiveaa";
- case ATTRIBUTE_MULTISAMPLEAA: return "multisampleaa";
- case ATTRIBUTE_TEMPORALAA: return "temporalaa";
- case ATTRIBUTE_BLENDTYPE: return "blendtype";
- case ATTRIBUTE_HORZFIELDS: return "horzfields";
- case ATTRIBUTE_LEFT: return "left";
- case ATTRIBUTE_LEFTUNITS: return "leftunits";
- case ATTRIBUTE_WIDTH: return "width";
- case ATTRIBUTE_WIDTHUNITS: return "widthunits";
- case ATTRIBUTE_RIGHT: return "right";
- case ATTRIBUTE_RIGHTUNITS: return "rightunits";
- case ATTRIBUTE_VERTFIELDS: return "vertfields";
- case ATTRIBUTE_TOP: return "top";
- case ATTRIBUTE_TOPUNITS: return "topunits";
- case ATTRIBUTE_HEIGHT: return "height";
- case ATTRIBUTE_HEIGHTUNITS: return "heightunits";
- case ATTRIBUTE_BOTTOM: return "bottom";
- case ATTRIBUTE_BOTTOMUNITS: return "bottomunits";
- case ATTRIBUTE_AOSTRENGTH: return "aostrength";
- case ATTRIBUTE_AODISTANCE: return "aodistance";
- case ATTRIBUTE_AOSOFTNESS: return "aosoftness";
- case ATTRIBUTE_AOBIAS: return "aobias";
- case ATTRIBUTE_AOSAMPLERATE: return "aosamplerate";
- case ATTRIBUTE_AODITHER: return "aodither";
- case ATTRIBUTE_SHADOWSTRENGTH: return "shadowstrength";
- case ATTRIBUTE_SHADOWDIST: return "shadowdist";
- case ATTRIBUTE_SHADOWSOFTNESS: return "shadowsoftness";
- case ATTRIBUTE_SHADOWBIAS: return "shadowbias";
- case ATTRIBUTE_LIGHTPROBE: return "lightprobe";
- case ATTRIBUTE_PROBEBRIGHT: return "probebright";
- case ATTRIBUTE_FASTIBL: return "fastibl";
- case ATTRIBUTE_PROBEHORIZON: return "probehorizon";
- case ATTRIBUTE_PROBEFOV: return "probefov";
- case ATTRIBUTE_LIGHTPROBE2: return "lightprobe2";
- case ATTRIBUTE_PROBE2FADE: return "probe2fade";
- case ATTRIBUTE_PROBE2WINDOW: return "probe2window";
- case ATTRIBUTE_PROBE2POS: return "probe2pos";
- case ATTRIBUTE_DISABLEDEPTHTEST: return "disabledepthtest";
- case ATTRIBUTE_DISABLEDEPTHPREPASS: return "disabledepthprepass";
- case ATTRIBUTE_TEXTCOLOR: return "textcolor";
- case ATTRIBUTE_TEXTCOLOR_R: return "textcolor.r";
- case ATTRIBUTE_TEXTCOLOR_G: return "textcolor.g";
- case ATTRIBUTE_TEXTCOLOR_B: return "textcolor.b";
- case ATTRIBUTE_TEXTCOLOR_A: return "textcolor.a";
- case ATTRIBUTE_SIZE: return "size";
- case ATTRIBUTE_FONT: return "font";
- case ATTRIBUTE_DROPSHADOW: return "dropshadow";
- case ATTRIBUTE_DROPSHADOWSTRENGTH: return "dropshadowstrength";
- case ATTRIBUTE_DROPSHADOWOFFSETX: return "dropshadowoffsetx";
- case ATTRIBUTE_DROPSHADOWOFFSETY: return "dropshadowoffsety";
- case ATTRIBUTE_BOUNDINGBOX: return "boundingbox";
- case ATTRIBUTE_BOUNDINGBOX_X: return "boundingbox.x";
- case ATTRIBUTE_BOUNDINGBOX_Y: return "boundingbox.y";
- case ATTRIBUTE_ELIDE: return "elide";
- case ATTRIBUTE_TRACKING: return "tracking";
- case ATTRIBUTE_LEADING: return "leading";
- case ATTRIBUTE_RENDERSTYLE: return "renderstyle";
- case ATTRIBUTE_TEXTSTRING: return "textstring";
- case ATTRIBUTE_BACKCOLOR_R: return "backcolor.r";
- case ATTRIBUTE_BACKCOLOR_G: return "backcolor.g";
- case ATTRIBUTE_BACKCOLOR_B: return "backcolor.b";
- case ATTRIBUTE_BACKCOLOR_A: return "backcolor.a";
- case ATTRIBUTE_TEXTTYPE: return "texttype";
- case ATTRIBUTE_USEBACKCOLOR: return "usebackcolor";
- case ATTRIBUTE_WORDWRAP: return "wordwrap";
- case ATTRIBUTE_HORZSCROLL: return "horzscroll";
- case ATTRIBUTE_HORZALIGN: return "horzalign";
- case ATTRIBUTE_VERTSCROLL: return "vertscroll";
- case ATTRIBUTE_VERTALIGN: return "vertalign";
- case ATTRIBUTE_BOXHEIGHT: return "boxheight";
- case ATTRIBUTE_BOXWIDTH: return "boxwidth";
- case ATTRIBUTE_REMOTESTRINGSOURCE: return "remotestringsource";
- case ATTRIBUTE_CACHEDTEXTSTRING: return "cachedtextstring";
- case ATTRIBUTE_ENABLEACCELERATEDFONT: return "enableacceleratedfont";
- case ATTRIBUTE_BEHAVIORSCRIPTS: return "BehaviorScripts";
- case ATTRIBUTE_UICCUSTOMOBJTYPE: return "UICCustomObjType";
- case ATTRIBUTE_BGCOLORENABLE: return "bgcolorenable";
- case ATTRIBUTE_BACKGROUND: return "background";
- case ATTRIBUTE_BACKGROUNDCOLOR_R: return "backgroundcolor.r";
- case ATTRIBUTE_BACKGROUNDCOLOR_G: return "backgroundcolor.g";
- case ATTRIBUTE_BACKGROUNDCOLOR_B: return "backgroundcolor.b";
- case ATTRIBUTE_BACKGROUNDCOLOR_A: return "backgroundcolor.a";
- case ATTRIBUTE_PATHTYPE: return "pathtype";
- case ATTRIBUTE_LINEARERROR: return "linearerror";
- case ATTRIBUTE_EDGETESSAMOUNT: return "edgetessamount";
- case ATTRIBUTE_INNERTESSAMOUNT: return "innertessamount";
- case ATTRIBUTE_BEGINCAP: return "begincap";
- case ATTRIBUTE_BEGINCAPOFFSET: return "begincapoffset";
- case ATTRIBUTE_BEGINCAPOPACITY: return "begincapopacity";
- case ATTRIBUTE_BEGINCAPWIDTH: return "begincapwidth";
- case ATTRIBUTE_ENDCAP: return "endcap";
- case ATTRIBUTE_ENDCAPOFFSET: return "endcapoffset";
- case ATTRIBUTE_ENDCAPOPACITY: return "endcapopacity";
- case ATTRIBUTE_ENDCAPWIDTH: return "endcapwidth";
- case ATTRIBUTE_PAINTSTYLE: return "paintstyle";
- case ATTRIBUTE_CLOSED: return "closed";
- case ATTRIBUTE_INCOMINGANGLE: return "incomingangle";
- case ATTRIBUTE_INCOMINGDISTANCE: return "incomingdistance";
- case ATTRIBUTE_OUTGOINGDISTANCE: return "outgoingdistance";
- case ATTRIBUTE_PARTICLETYPE: return "particletype";
- case ATTRIBUTE_MAXPARTICLES: return "maxparticles";
- case ATTRIBUTE_PARTICLESIZE: return "particlesize";
- case ATTRIBUTE_LIFETIME: return "lifetime";
- case ATTRIBUTE_CONTROLLEDPROPERTY: return "controlledproperty";
- case ATTRIBUTE_OBSERVEDPROPERTY: return "observedproperty";
- case ATTRIBUTE_QT_IO: return "qt.io";
- default: {
- static char s_UnknownHash[16];
- sprintf(s_UnknownHash, "(0x%08X)", inAttribute);
- return s_UnknownHash;
- }
- }
-}
-
-} // namespace Q3DStudio
-
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.h
deleted file mode 100644
index 1f712a8c..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-// !!!!! AUTOGENERATED CODE - DO NOT MODIFY MANUALLY !!!!!
-
-// Run the AttributeHashes project to regenerate this file from Attributehashes.txt list
-
-/// Key for the CElement attribute-value pair
-enum EAttribute {
- ATTRIBUTE_NAME = 0x02B79D95, // name
- ATTRIBUTE_TYPE = 0x005F9806, // type
- ATTRIBUTE_OPACITY = 0x0191C315, // opacity
- ATTRIBUTE_STARTTIME = 0x010A57B1, // starttime
- ATTRIBUTE_ENDTIME = 0x003BF5F8, // endtime
- ATTRIBUTE_SOURCEPATH = 0x0009EA60, // sourcepath
- ATTRIBUTE_IMPORTID = 0x008F7900, // importid
- ATTRIBUTE_EYEBALL = 0x02F454F0, // eyeball
- ATTRIBUTE_POSITION = 0x00E9B7D7, // position
- ATTRIBUTE_POSITION_X = 0x027C230D, // position.x
- ATTRIBUTE_POSITION_Y = 0x027D234C, // position.y
- ATTRIBUTE_POSITION_Z = 0x027E238B, // position.z
- ATTRIBUTE_ROTATION = 0x03E51862, // rotation
- ATTRIBUTE_ROTATION_X = 0x0239EE18, // rotation.x
- ATTRIBUTE_ROTATION_Y = 0x023AEE57, // rotation.y
- ATTRIBUTE_ROTATION_Z = 0x023BEE96, // rotation.z
- ATTRIBUTE_SCALE = 0x01012856, // scale
- ATTRIBUTE_SCALE_X = 0x0065440C, // scale.x
- ATTRIBUTE_SCALE_Y = 0x0066444B, // scale.y
- ATTRIBUTE_SCALE_Z = 0x0067448A, // scale.z
- ATTRIBUTE_PIVOT = 0x009E907E, // pivot
- ATTRIBUTE_PIVOT_X = 0x03811834, // pivot.x
- ATTRIBUTE_PIVOT_Y = 0x03821873, // pivot.y
- ATTRIBUTE_PIVOT_Z = 0x038318B2, // pivot.z
- ATTRIBUTE_ROTATIONORDER = 0x03CE5F70, // rotationorder
- ATTRIBUTE_ORIENTATION = 0x001A90B0, // orientation
- ATTRIBUTE_SHADOWCASTER = 0x0363F874, // shadowcaster
- ATTRIBUTE_TESSELLATION = 0x0335861F, // tessellation
- ATTRIBUTE_EDGETESS = 0x023933D2, // edgetess
- ATTRIBUTE_INNERTESS = 0x01529259, // innertess
- ATTRIBUTE_ORTHOGRAPHIC = 0x0244BB70, // orthographic
- ATTRIBUTE_CLIPNEAR = 0x0068FF28, // clipnear
- ATTRIBUTE_CLIPFAR = 0x037EF699, // clipfar
- ATTRIBUTE_FOV = 0x00D60213, // fov
- ATTRIBUTE_FOVHORIZONTAL = 0x01BDB34F, // fovhorizontal
- ATTRIBUTE_SCALEMODE = 0x01FD2FD3, // scalemode
- ATTRIBUTE_SCALEANCHOR = 0x02CFCF41, // scaleanchor
- ATTRIBUTE_BRIGHTNESS = 0x0230D3AF, // brightness
- ATTRIBUTE_LINEARFADE = 0x0104E9FF, // linearfade
- ATTRIBUTE_EXPFADE = 0x006B9267, // expfade
- ATTRIBUTE_LIGHTTYPE = 0x0033F1D0, // lighttype
- ATTRIBUTE_SCOPE = 0x0258D0CC, // scope
- ATTRIBUTE_LIGHTDIFFUSE = 0x01246FD4, // lightdiffuse
- ATTRIBUTE_LIGHTDIFFUSE_R = 0x035AAB10, // lightdiffuse.r
- ATTRIBUTE_LIGHTDIFFUSE_G = 0x034FA85B, // lightdiffuse.g
- ATTRIBUTE_LIGHTDIFFUSE_B = 0x034AA720, // lightdiffuse.b
- ATTRIBUTE_LIGHTDIFFUSE_A = 0x0349A6E1, // lightdiffuse.a
- ATTRIBUTE_LIGHTAMBIENT = 0x00DA56DE, // lightambient
- ATTRIBUTE_LIGHTAMBIENT_R = 0x0179AD1A, // lightambient.r
- ATTRIBUTE_LIGHTAMBIENT_G = 0x016EAA65, // lightambient.g
- ATTRIBUTE_LIGHTAMBIENT_B = 0x0169A92A, // lightambient.b
- ATTRIBUTE_LIGHTAMBIENT_A = 0x0168A8EB, // lightambient.a
- ATTRIBUTE_LIGHTSPECULAR = 0x03E39A07, // lightspecular
- ATTRIBUTE_LIGHTSPECULAR_R = 0x0241EBC3, // lightspecular.r
- ATTRIBUTE_LIGHTSPECULAR_G = 0x0236E90E, // lightspecular.g
- ATTRIBUTE_LIGHTSPECULAR_B = 0x0231E7D3, // lightspecular.b
- ATTRIBUTE_LIGHTSPECULAR_A = 0x0230E794, // lightspecular.a
- ATTRIBUTE_AREAWIDTH = 0x005A8BE7, // areawidth
- ATTRIBUTE_AREAHEIGHT = 0x00334D2C, // areaheight
- ATTRIBUTE_CASTSHADOW = 0x0335FD81, // castshadow
- ATTRIBUTE_SHDWBIAS = 0x0125E79F, // shdwbias
- ATTRIBUTE_SHDWFACTOR = 0x01B11BE9, // shdwfactor
- ATTRIBUTE_SHDWMAPRES = 0x01E53834, // shdwmapres
- ATTRIBUTE_SHDWMAPFAR = 0x019A30FD, // shdwmapfar
- ATTRIBUTE_SHDWMAPFOV = 0x00830B07, // shdwmapfov
- ATTRIBUTE_SHDWFILTER = 0x0176E1E0, // shdwfilter
- ATTRIBUTE_LIGHTMAPINDIRECT = 0x004F1D6C, // lightmapindirect
- ATTRIBUTE_LIGHTMAPRADIOSITY = 0x00AC7C50, // lightmapradiosity
- ATTRIBUTE_LIGHTMAPSHADOW = 0x00191F3A, // lightmapshadow
- ATTRIBUTE_IBLPROBE = 0x0039FD03, // iblprobe
- ATTRIBUTE_SHADERLIGHTING = 0x0068A84F, // shaderlighting
- ATTRIBUTE_EMISSIVEPOWER = 0x03D6F9F2, // emissivepower
- ATTRIBUTE_EMISSIVECOLOR = 0x00B7AC94, // emissivecolor
- ATTRIBUTE_EMISSIVECOLOR_R = 0x039B87D0, // emissivecolor.r
- ATTRIBUTE_EMISSIVECOLOR_G = 0x0390851B, // emissivecolor.g
- ATTRIBUTE_EMISSIVECOLOR_B = 0x038B83E0, // emissivecolor.b
- ATTRIBUTE_EMISSIVECOLOR_A = 0x038A83A1, // emissivecolor.a
- ATTRIBUTE_DIFFUSE = 0x0105521E, // diffuse
- ATTRIBUTE_DIFFUSE_R = 0x015B085A, // diffuse.r
- ATTRIBUTE_DIFFUSE_G = 0x015005A5, // diffuse.g
- ATTRIBUTE_DIFFUSE_B = 0x014B046A, // diffuse.b
- ATTRIBUTE_DIFFUSE_A = 0x014A042B, // diffuse.a
- ATTRIBUTE_SPECULARMAP = 0x034CD047, // specularmap
- ATTRIBUTE_SPECULARMODEL = 0x039EBE5A, // specularmodel
- ATTRIBUTE_SPECULARTINT = 0x03535E02, // speculartint
- ATTRIBUTE_SPECULARTINT_R = 0x0399623E, // speculartint.r
- ATTRIBUTE_SPECULARTINT_G = 0x038E5F89, // speculartint.g
- ATTRIBUTE_SPECULARTINT_B = 0x03895E4E, // speculartint.b
- ATTRIBUTE_SPECULARTINT_A = 0x03885E0F, // speculartint.a
- ATTRIBUTE_IOR = 0x00667354, // ior
- ATTRIBUTE_FRESNELPOWER = 0x022178B6, // fresnelPower
- ATTRIBUTE_SPECULARAMOUNT = 0x01144425, // specularamount
- ATTRIBUTE_SPECULARROUGHNESS = 0x03925653, // specularroughness
- ATTRIBUTE_ROUGHNESSMAP = 0x01088174, // roughnessmap
- ATTRIBUTE_BLENDMODE = 0x01923A6C, // blendmode
- ATTRIBUTE_CULLING = 0x03C539F0, // culling
- ATTRIBUTE_ZBUFFERWRITE = 0x03E19B3B, // zbufferwrite
- ATTRIBUTE_DIFFUSEMAP = 0x00FF8126, // diffusemap
- ATTRIBUTE_DIFFUSEMAP2 = 0x0038D4A8, // diffusemap2
- ATTRIBUTE_DIFFUSEMAP3 = 0x0039D4E7, // diffusemap3
- ATTRIBUTE_SPECULARREFLECTION = 0x006B4C12, // specularreflection
- ATTRIBUTE_OPACITYMAP = 0x00DA796F, // opacitymap
- ATTRIBUTE_EMISSIVEMAP = 0x00F6427B, // emissivemap
- ATTRIBUTE_EMISSIVEMAP2 = 0x03476893, // emissivemap2
- ATTRIBUTE_BUMPMAP = 0x024EE11A, // bumpmap
- ATTRIBUTE_BUMPAMOUNT = 0x01BC4192, // bumpamount
- ATTRIBUTE_NORMALMAP = 0x03BD578B, // normalmap
- ATTRIBUTE_DISPLACEMENTMAP = 0x01BCD1FB, // displacementmap
- ATTRIBUTE_DISPLACEAMOUNT = 0x01EC1EAF, // displaceamount
- ATTRIBUTE_TRANSLUCENCYMAP = 0x01D8F015, // translucencymap
- ATTRIBUTE_TRANSLUCENTFALLOFF = 0x0097E985, // translucentfalloff
- ATTRIBUTE_DIFFUSELIGHTWRAP = 0x038F6522, // diffuselightwrap
- ATTRIBUTE_REFERENCEDMATERIAL = 0x035FDA80, // referencedmaterial
- ATTRIBUTE_VERTEXCOLORS = 0x000814EC, // vertexcolors
- ATTRIBUTE_ROTATIONUV = 0x012E3A61, // rotationuv
- ATTRIBUTE_POSITIONU = 0x01D05AB4, // positionu
- ATTRIBUTE_POSITIONV = 0x01D15AF3, // positionv
- ATTRIBUTE_SCALEU = 0x001409F5, // scaleu
- ATTRIBUTE_SCALEV = 0x00150A34, // scalev
- ATTRIBUTE_PIVOTU = 0x03F8ABCD, // pivotu
- ATTRIBUTE_PIVOTV = 0x03F9AC0C, // pivotv
- ATTRIBUTE_TILINGMODEHORZ = 0x02562203, // tilingmodehorz
- ATTRIBUTE_TILINGMODEVERT = 0x03F92B21, // tilingmodevert
- ATTRIBUTE_MAPPINGTYPE = 0x02CA9058, // mappingtype
- ATTRIBUTE_MAPPINGMODE = 0x002715CF, // mappingmode
- ATTRIBUTE_SUBPRESENTATION = 0x03CA7426, // subpresentation
- ATTRIBUTE_URI = 0x00296894, // uri
- ATTRIBUTE_TRANSPARENT = 0x0316BA2E, // transparent
- ATTRIBUTE_PROGRESSIVEAA = 0x019F1955, // progressiveaa
- ATTRIBUTE_MULTISAMPLEAA = 0x013D29FD, // multisampleaa
- ATTRIBUTE_TEMPORALAA = 0x00212AFE, // temporalaa
- ATTRIBUTE_BLENDTYPE = 0x0035B4F5, // blendtype
- ATTRIBUTE_HORZFIELDS = 0x02B8A818, // horzfields
- ATTRIBUTE_LEFT = 0x0196B9B9, // left
- ATTRIBUTE_LEFTUNITS = 0x02F9D2D8, // leftunits
- ATTRIBUTE_WIDTH = 0x00C4D65A, // width
- ATTRIBUTE_WIDTHUNITS = 0x01D7DF77, // widthunits
- ATTRIBUTE_RIGHT = 0x039EAB44, // right
- ATTRIBUTE_RIGHTUNITS = 0x0357EF0D, // rightunits
- ATTRIBUTE_VERTFIELDS = 0x03462436, // vertfields
- ATTRIBUTE_TOP = 0x002F6B0B, // top
- ATTRIBUTE_TOPUNITS = 0x03D58806, // topunits
- ATTRIBUTE_HEIGHT = 0x00CE9F79, // height
- ATTRIBUTE_HEIGHTUNITS = 0x00C91D18, // heightunits
- ATTRIBUTE_BOTTOM = 0x00F4EE75, // bottom
- ATTRIBUTE_BOTTOMUNITS = 0x0174091C, // bottomunits
- ATTRIBUTE_AOSTRENGTH = 0x010F7ED1, // aostrength
- ATTRIBUTE_AODISTANCE = 0x01DC349D, // aodistance
- ATTRIBUTE_AOSOFTNESS = 0x02CCDC71, // aosoftness
- ATTRIBUTE_AOBIAS = 0x01818219, // aobias
- ATTRIBUTE_AOSAMPLERATE = 0x0039B568, // aosamplerate
- ATTRIBUTE_AODITHER = 0x0274316C, // aodither
- ATTRIBUTE_SHADOWSTRENGTH = 0x0039ED5F, // shadowstrength
- ATTRIBUTE_SHADOWDIST = 0x038213FA, // shadowdist
- ATTRIBUTE_SHADOWSOFTNESS = 0x01F74AFF, // shadowsoftness
- ATTRIBUTE_SHADOWBIAS = 0x02CB3EA7, // shadowbias
- ATTRIBUTE_LIGHTPROBE = 0x02D47DC6, // lightprobe
- ATTRIBUTE_PROBEBRIGHT = 0x029DC5B6, // probebright
- ATTRIBUTE_FASTIBL = 0x02559509, // fastibl
- ATTRIBUTE_PROBEHORIZON = 0x014DAAF5, // probehorizon
- ATTRIBUTE_PROBEFOV = 0x03D66903, // probefov
- ATTRIBUTE_LIGHTPROBE2 = 0x00430008, // lightprobe2
- ATTRIBUTE_PROBE2FADE = 0x02ED0742, // probe2fade
- ATTRIBUTE_PROBE2WINDOW = 0x016B224E, // probe2window
- ATTRIBUTE_PROBE2POS = 0x024B0C0E, // probe2pos
- ATTRIBUTE_DISABLEDEPTHTEST = 0x000B8353, // disabledepthtest
- ATTRIBUTE_DISABLEDEPTHPREPASS = 0x02AE1EA7, // disabledepthprepass
- ATTRIBUTE_TEXTCOLOR = 0x02D9114A, // textcolor
- ATTRIBUTE_TEXTCOLOR_R = 0x00E9F186, // textcolor.r
- ATTRIBUTE_TEXTCOLOR_G = 0x00DEEED1, // textcolor.g
- ATTRIBUTE_TEXTCOLOR_B = 0x00D9ED96, // textcolor.b
- ATTRIBUTE_TEXTCOLOR_A = 0x00D8ED57, // textcolor.a
- ATTRIBUTE_SIZE = 0x00F2C81F, // size
- ATTRIBUTE_FONT = 0x03412331, // font
- ATTRIBUTE_DROPSHADOW = 0x03E3F231, // dropshadow
- ATTRIBUTE_DROPSHADOWSTRENGTH = 0x03F8B7D0, // dropshadowstrength
- ATTRIBUTE_DROPSHADOWOFFSETX = 0x013298AA, // dropshadowoffsetx
- ATTRIBUTE_DROPSHADOWOFFSETY = 0x013398E9, // dropshadowoffsety
- ATTRIBUTE_BOUNDINGBOX = 0x02F3B6D9, // boundingbox
- ATTRIBUTE_BOUNDINGBOX_X = 0x0272C10F, // boundingbox.x
- ATTRIBUTE_BOUNDINGBOX_Y = 0x0273C14E, // boundingbox.y
- ATTRIBUTE_ELIDE = 0x022937DD, // elide
- ATTRIBUTE_TRACKING = 0x02A25049, // tracking
- ATTRIBUTE_LEADING = 0x016A6BDA, // leading
- ATTRIBUTE_RENDERSTYLE = 0x03567B85, // renderstyle
- ATTRIBUTE_TEXTSTRING = 0x01124062, // textstring
- ATTRIBUTE_BACKCOLOR_R = 0x0290CCE0, // backcolor.r
- ATTRIBUTE_BACKCOLOR_G = 0x0285CA2B, // backcolor.g
- ATTRIBUTE_BACKCOLOR_B = 0x0280C8F0, // backcolor.b
- ATTRIBUTE_BACKCOLOR_A = 0x027FC8B1, // backcolor.a
- ATTRIBUTE_TEXTTYPE = 0x0240ADD9, // texttype
- ATTRIBUTE_USEBACKCOLOR = 0x0243BACB, // usebackcolor
- ATTRIBUTE_WORDWRAP = 0x0134B04C, // wordwrap
- ATTRIBUTE_HORZSCROLL = 0x005B3CC4, // horzscroll
- ATTRIBUTE_HORZALIGN = 0x00BA002A, // horzalign
- ATTRIBUTE_VERTSCROLL = 0x00E8B8E2, // vertscroll
- ATTRIBUTE_VERTALIGN = 0x03759C8C, // vertalign
- ATTRIBUTE_BOXHEIGHT = 0x0079AF8E, // boxheight
- ATTRIBUTE_BOXWIDTH = 0x016B7105, // boxwidth
- ATTRIBUTE_REMOTESTRINGSOURCE = 0x025DFEEE, // remotestringsource
- ATTRIBUTE_CACHEDTEXTSTRING = 0x0095DBA0, // cachedtextstring
- ATTRIBUTE_ENABLEACCELERATEDFONT = 0x0053A92D, // enableacceleratedfont
- ATTRIBUTE_BEHAVIORSCRIPTS = 0x01DF916A, // BehaviorScripts
- ATTRIBUTE_UICCUSTOMOBJTYPE = 0x029F1BCF, // UICCustomObjType
- ATTRIBUTE_BGCOLORENABLE = 0x0021EE1F, // bgcolorenable
- ATTRIBUTE_BACKGROUND = 0x006AA932, // background
- ATTRIBUTE_BACKGROUNDCOLOR_R = 0x02AF0767, // backgroundcolor.r
- ATTRIBUTE_BACKGROUNDCOLOR_G = 0x02A404B2, // backgroundcolor.g
- ATTRIBUTE_BACKGROUNDCOLOR_B = 0x029F0377, // backgroundcolor.b
- ATTRIBUTE_BACKGROUNDCOLOR_A = 0x029E0338, // backgroundcolor.a
- ATTRIBUTE_PATHTYPE = 0x02D2A5E1, // pathtype
- ATTRIBUTE_LINEARERROR = 0x0378A51D, // linearerror
- ATTRIBUTE_EDGETESSAMOUNT = 0x02577E3A, // edgetessamount
- ATTRIBUTE_INNERTESSAMOUNT = 0x0027A241, // innertessamount
- ATTRIBUTE_BEGINCAP = 0x03373D37, // begincap
- ATTRIBUTE_BEGINCAPOFFSET = 0x01FEFE64, // begincapoffset
- ATTRIBUTE_BEGINCAPOPACITY = 0x02C2761E, // begincapopacity
- ATTRIBUTE_BEGINCAPWIDTH = 0x0102BDE3, // begincapwidth
- ATTRIBUTE_ENDCAP = 0x00ADB3A9, // endcap
- ATTRIBUTE_ENDCAPOFFSET = 0x0382A9D6, // endcapoffset
- ATTRIBUTE_ENDCAPOPACITY = 0x019BA72C, // endcapopacity
- ATTRIBUTE_ENDCAPWIDTH = 0x03A315F1, // endcapwidth
- ATTRIBUTE_PAINTSTYLE = 0x03ADEC8D, // paintstyle
- ATTRIBUTE_CLOSED = 0x01807034, // closed
- ATTRIBUTE_INCOMINGANGLE = 0x03890AB3, // incomingangle
- ATTRIBUTE_INCOMINGDISTANCE = 0x005EB2A5, // incomingdistance
- ATTRIBUTE_OUTGOINGDISTANCE = 0x017C597F, // outgoingdistance
- ATTRIBUTE_PARTICLETYPE = 0x01C01260, // particletype
- ATTRIBUTE_MAXPARTICLES = 0x00BE66B7, // maxparticles
- ATTRIBUTE_PARTICLESIZE = 0x02534279, // particlesize
- ATTRIBUTE_LIFETIME = 0x0033D297, // lifetime
- ATTRIBUTE_CONTROLLEDPROPERTY = 0x022C0A1D, // controlledproperty
- ATTRIBUTE_OBSERVEDPROPERTY = 0x02D1CE03, // observedproperty
- ATTRIBUTE_QT_IO = 0x010EF2CF, // qt.io
-}; // enum EAttribute
-
-#define AK_STRING_QT_IO "qt.io"
-
-/// Function providing reverse hash lookup
-const char *GetAttributeString(const EAttribute inAttribute);
-
-} // namespace Q3DStudio
-
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.txt b/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.txt
deleted file mode 100644
index 4168bbdc..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSAttributeHashes.txt
+++ /dev/null
@@ -1,249 +0,0 @@
-name
-type
-opacity
-
-starttime
-endtime
-
-sourcepath
-importid
-eyeball
-position
-position.x
-position.y
-position.z
-rotation
-rotation.x
-rotation.y
-rotation.z
-scale
-scale.x
-scale.y
-scale.z
-pivot
-pivot.x
-pivot.y
-pivot.z
-rotationorder
-orientation
-shadowcaster
-tessellation
-edgetess
-innertess
-
-orthographic
-clipnear
-clipfar
-fov
-fovhorizontal
-scalemode
-scaleanchor
-
-brightness
-linearfade
-expfade
-lighttype
-scope
-lightdiffuse
-lightdiffuse.r
-lightdiffuse.g
-lightdiffuse.b
-lightdiffuse.a
-lightambient
-lightambient.r
-lightambient.g
-lightambient.b
-lightambient.a
-lightspecular
-lightspecular.r
-lightspecular.g
-lightspecular.b
-lightspecular.a
-areawidth
-areaheight
-castshadow
-shdwbias
-shdwfactor
-shdwmapres
-shdwmapfar
-shdwmapfov
-shdwfilter
-
-lightmapindirect
-lightmapradiosity
-lightmapshadow
-
-iblprobe
-
-shaderlighting
-emissivepower
-emissivecolor
-emissivecolor.r
-emissivecolor.g
-emissivecolor.b
-emissivecolor.a
-diffuse
-diffuse.r
-diffuse.g
-diffuse.b
-diffuse.a
-specularmap
-specularmodel
-speculartint
-speculartint.r
-speculartint.g
-speculartint.b
-speculartint.a
-ior
-fresnelPower
-specularamount
-specularroughness
-roughnessmap
-blendmode
-culling
-zbufferwrite
-diffusemap
-diffusemap2
-diffusemap3
-specularreflection
-opacitymap
-emissivemap
-emissivemap2
-bumpmap
-bumpamount
-normalmap
-displacementmap
-displaceamount
-translucencymap
-translucentfalloff
-diffuselightwrap
-referencedmaterial
-vertexcolors
-
-rotationuv
-positionu
-positionv
-scaleu
-scalev
-pivotu
-pivotv
-tilingmodehorz
-tilingmodevert
-mappingtype
-mappingmode
-subpresentation
-uri
-
-transparent
-progressiveaa
-multisampleaa
-temporalaa
-blendtype
-horzfields
-left
-leftunits
-width
-widthunits
-right
-rightunits
-vertfields
-top
-topunits
-height
-heightunits
-bottom
-bottomunits
-aostrength
-aodistance
-aosoftness
-aobias
-aosamplerate
-aodither
-shadowstrength
-shadowdist
-shadowsoftness
-shadowbias
-lightprobe
-probebright
-fastibl
-probehorizon
-probefov
-lightprobe2
-probe2fade
-probe2window
-probe2pos
-disabledepthtest
-disabledepthprepass
-
-textcolor
-textcolor.r
-textcolor.g
-textcolor.b
-textcolor.a
-size
-font
-dropshadow
-dropshadowstrength
-dropshadowoffsetx
-dropshadowoffsety
-boundingbox
-boundingbox.x
-boundingbox.y
-elide
-tracking
-leading
-renderstyle
-textstring
-backcolor.r
-backcolor.g
-backcolor.b
-backcolor.a
-texttype
-usebackcolor
-wordwrap
-horzscroll
-horzalign
-vertscroll
-vertalign
-boxheight
-boxwidth
-remotestringsource
-cachedtextstring
-enableacceleratedfont
-
-BehaviorScripts
-UICCustomObjType
-
-bgcolorenable
-background
-backgroundcolor.r
-backgroundcolor.g
-backgroundcolor.b
-backgroundcolor.a
-
-pathtype
-linearerror
-edgetessamount
-innertessamount
-begincap
-begincapoffset
-begincapopacity
-begincapwidth
-endcap
-endcapoffset
-endcapopacity
-endcapwidth
-paintstyle
-closed
-
-incomingangle
-incomingdistance
-outgoingdistance
-
-particletype
-maxparticles
-particlesize
-lifetime
-
-controlledproperty
-observedproperty
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandEventTypes.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandEventTypes.h
deleted file mode 100644
index 01a12b44..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandEventTypes.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSHash.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Commands
-//==============================================================================
-
-// Command types are 31-bit hash instead of 32-bit
-// The 1 bit flag is being used to differentiate between a Command and an Event
-// Commands trigger execution, both commands and events can trigger logic
-
-// Asset
-const TEventCommandHash COMMAND_SETPROPERTY = CHash::HashEventCommand("COMMAND_SETPROPERTY");
-const TEventCommandHash COMMAND_FIREEVENT = CHash::HashEventCommand("COMMAND_FIREEVENT");
-const TEventCommandHash COMMAND_SCRIPTLET = CHash::HashEventCommand("COMMAND_SCRIPTLET");
-const TEventCommandHash COMMAND_PLAYSOUND = CHash::HashEventCommand("COMMAND_PLAYSOUND");
-const TEventCommandHash COMMAND_EMITSIGNAL = CHash::HashEventCommand("COMMAND_EMITSIGNAL");
-
-// Time
-const TEventCommandHash COMMAND_PLAY = CHash::HashEventCommand("COMMAND_PLAY");
-const TEventCommandHash COMMAND_PAUSE = CHash::HashEventCommand("COMMAND_PAUSE");
-const TEventCommandHash COMMAND_GOTOTIME = CHash::HashEventCommand("COMMAND_GOTOTIME");
-const TEventCommandHash COMMAND_GOTOTIMELABEL = CHash::HashEventCommand("COMMAND_GOTOTIMELABEL");
-
-// Slide
-const TEventCommandHash COMMAND_GOTOSLIDE = CHash::HashEventCommand("COMMAND_GOTOSLIDE");
-const TEventCommandHash COMMAND_GOTOSLIDENAME = CHash::HashEventCommand("COMMAND_GOTOSLIDENAME");
-const TEventCommandHash COMMAND_GOTONEXTSLIDE = CHash::HashEventCommand("COMMAND_GOTONEXTSLIDE");
-const TEventCommandHash COMMAND_GOTOPREVIOUSSLIDE =
- CHash::HashEventCommand("COMMAND_GOTOPREVIOUSSLIDE");
-const TEventCommandHash COMMAND_BACKSLIDE = CHash::HashEventCommand("COMMAND_BACKSLIDE");
-
-// Behavior
-const TEventCommandHash COMMAND_CUSTOMACTION = CHash::HashEventCommand("COMMAND_CUSTOMACTION");
-const TEventCommandHash COMMAND_CUSTOMCALLBACK = CHash::HashEventCommand("COMMAND_CALLBACK");
-//==============================================================================
-// Events
-//==============================================================================
-
-// Slide Events
-const TEventCommandHash EVENT_ONSLIDEENTER = CHash::HashEventCommand("onSlideEnter");
-const TEventCommandHash EVENT_ONSLIDEEXIT = CHash::HashEventCommand("onSlideExit");
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.cpp
deleted file mode 100644
index 53c7648a..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-#include "Qt3DSCommandHelper.h"
-#include "Qt3DSCommandEventTypes.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSSlideSystem.h"
-
-namespace Q3DStudio {
-
-CCommandHelper::CCommandHelper()
-{
-}
-
-CCommandHelper::~CCommandHelper()
-{
-}
-
-static Option<Q3DStudio::UINT8> FindSlide(TElement &inElement, const char *slideName)
-{
- IPresentation *thePresentation = inElement.GetBelongedPresentation();
-
- int theSlideHashName = thePresentation->GetApplication().HashString(slideName);
- TComponent *theComponent = thePresentation->GetComponentManager().GetComponent(&inElement);
- UINT8 theSlideIndex =
- thePresentation->GetSlideSystem().FindSlide(*theComponent, theSlideHashName);
- if (theSlideIndex >= theComponent->GetSlideCount()) {
- qt3ds::foundation::CRegisteredString elemPath = thePresentation->GetElementPath(inElement);
- if (elemPath.IsValid()) {
- qCCritical(qt3ds::INVALID_PARAMETER)
- << "CCommandHelper: FindSlide: Unable to find slide "
- << slideName << " on element " << elemPath.c_str();
- } else {
- qCCritical(qt3ds::INVALID_PARAMETER)
- << "CCommandHelper: FindSlide: Unable to find slide " << slideName;
- }
- return Empty();
- }
-
- return theSlideIndex;
-}
-
-bool CCommandHelper::SetupGotoSlideCommand(TElement &inElement, Q3DStudio::INT32 inSlideIndex,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- IPresentation *thePresentation = inElement.GetBelongedPresentation();
- TElement *theTarget = GetComponentParent(&inElement);
- SComponentGotoSlideData theSlideData(inSlideIndex);
- theSlideData.m_Mode = inArgs.m_Mode;
- theSlideData.m_Paused = inArgs.m_Paused;
- theSlideData.m_Rate = inArgs.m_Rate;
- theSlideData.m_Reverse = inArgs.m_Reverse;
- theSlideData.m_StartTime = inArgs.m_StartTime;
- // Resolve playthroughto if it has a valid value.
- if (!isTrivial(inArgs.m_PlaythroughTo)) {
- if (AreEqual(inArgs.m_PlaythroughTo, "next"))
- theSlideData.m_PlaythroughTo = -1;
- else if (AreEqual(inArgs.m_PlaythroughTo, "previous"))
- theSlideData.m_PlaythroughTo = -2;
- else {
- // Find the slide if possible. If not, then just error leave things as they are.
-
- Option<UINT8> theSlideIndex = FindSlide(inElement, inArgs.m_PlaythroughTo);
- if (theSlideIndex.hasValue())
- theSlideData.m_PlaythroughTo = *theSlideIndex;
- }
- }
- thePresentation->GetComponentManager().SetupComponentGotoSlideCommand(theTarget, theSlideData);
- UVariant theArg1;
- UVariant theArg2;
- qt3ds::intrinsics::memZero(&theArg1, sizeof(UVariant));
- qt3ds::intrinsics::memZero(&theArg2, sizeof(UVariant));
- thePresentation->FireCommand(COMMAND_GOTOSLIDE, theTarget, &theArg1, &theArg2);
- return true;
-}
-
-bool CCommandHelper::SetupGotoSlideCommand(TElement &inElement, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- Option<UINT8> theSlideIndex = FindSlide(inElement, slideName);
- if (theSlideIndex.hasValue())
- return SetupGotoSlideCommand(inElement, *theSlideIndex, inArgs);
- return false;
-}
-
-//==============================================================================
-/**
- * Checks if the given element is a component. If it isn't walks up the tree and looks for one.
- * @param inElementManager the object that manages the elements in the presentation
- * @param inElement the element to check if it's a component
- * @return the component
- */
-TElement *CCommandHelper::GetComponentParent(TElement *inElement)
-{
- Q3DStudio_ASSERT(inElement);
- return &inElement->GetComponentParent();
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.h
deleted file mode 100644
index 412a51a1..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSCommandHelper.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSIScriptBridge.h"
-
-namespace Q3DStudio {
-
-class CCommandHelper
-{
-private:
- CCommandHelper();
- CCommandHelper(const CCommandHelper &);
- CCommandHelper &operator=(const CCommandHelper &);
- virtual ~CCommandHelper();
-
-public:
- static bool SetupGotoSlideCommand(TElement &inElement, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs);
- static bool SetupGotoSlideCommand(TElement &inElement, Q3DStudio::INT32 inSlide,
- const SScriptEngineGotoSlideArgs &inArgs);
-
-public:
- static TElement *GetComponentParent(TElement *inParent);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.cpp
deleted file mode 100644
index d7ce0b6a..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.cpp
+++ /dev/null
@@ -1,487 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSComponentManager.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSSlideSystem.h"
-#include "Qt3DSCommandEventTypes.h"
-#include "Qt3DSPresentationFrameData.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSActivationManager.h"
-#include "Qt3DSPresentation.h"
-
-using qt3ds::runtime::SSlideKey;
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- * @param inPresentation reference to its presentation
- */
-CComponentManager::CComponentManager(IPresentation &inPresentation)
- : m_Presentation(static_cast<CPresentation &>(inPresentation))
-{
-}
-
-//==============================================================================
-/**
- * Enforces the contract that slide switching requires a reset to the master
- * slide (slide 0) before switching to the desired slide index.
- * Also updates the TComponent's current slide number.
- * @param inComponent TComponent to set slide on
- * @param inSlideIndex relative index of the slide to switch to
- * @param inSlideExit true if exiting the slide, false otherwise
- */
-void CComponentManager::GotoSlideIndex(TElement *inComponent,
- const SComponentGotoSlideData &inGotoData,
- BOOL inSlideExit /*= true*/)
-{
- TComponent *theComponent = GetComponent(inComponent);
-
- if (theComponent == NULL) {
- return;
- }
-
- if (inGotoData.m_Slide < 1 || inGotoData.m_Slide >= theComponent->GetSlideCount()) {
- qCCritical(qt3ds::INVALID_PARAMETER)
- << "GotoSlide: Index out of range: Index " << inGotoData.m_Slide
- << " SlideCount: "<< theComponent->GetSlideCount();
- return;
- }
-
- if (theComponent->GetActive() == false) {
- m_ComponentInitialSlideMap[inComponent] = inGotoData;
- return;
- }
-
- SComponentGotoSlideData theGotoSlideData(inGotoData);
-
- TComponentGotoSlideDataMap::iterator iter = m_ComponentInitialSlideMap.find(inComponent);
- if (iter != m_ComponentInitialSlideMap.end()) {
- theGotoSlideData = iter->second;
- m_ComponentInitialSlideMap.erase(iter);
- }
-
- const UINT8 theCurrentSlideIndex = theComponent->GetCurrentSlide();
-
- QString elementPath = QString::fromUtf8(inComponent->m_Path.c_str());
-
- if (inSlideExit) {
- SEventCommand theEvent = { inComponent, EVENT_ONSLIDEEXIT };
- theEvent.m_IsEvent = true;
- m_Presentation.ProcessEvent(theEvent);
-
- m_Presentation.GetApplication().ComponentSlideExited(&m_Presentation, inComponent,
- elementPath, theCurrentSlideIndex,
- GetCurrentSlideName(inComponent));
-
- // Signal previous slide change
- m_Presentation.signalProxy()->SigSlideExited(elementPath, theCurrentSlideIndex,
- GetCurrentSlideName(inComponent));
-
- // m_Presentation.FireEvent(EVENT_ONSLIDEEXIT, inComponent);
- // m_Presentation.FlushEventCommandQueue();
- }
-
- // Update dynamic keys to use current values before slide switching, with the exception of
- // master slides because playback only starts from non-master slides.
- if (theCurrentSlideIndex > 0) {
- m_Presentation.GetSlideSystem().InitializeDynamicKeys(
- SSlideKey(*theComponent, (qt3ds::QT3DSU8)theGotoSlideData.m_Slide),
- m_Presentation.GetAnimationSystem());
- // deactivate actions and animation tracks on the current slide.
- m_Presentation.GetSlideSystem().RollbackSlide(
- SSlideKey(*inComponent, (qt3ds::QT3DSU8)theCurrentSlideIndex),
- m_Presentation.GetAnimationSystem(), m_Presentation.GetLogicSystem());
- } else {
- m_Presentation.GetSlideSystem().ExecuteSlide(SSlideKey(*inComponent, 0),
- m_Presentation.GetAnimationSystem(),
- m_Presentation.GetLogicSystem());
- }
- // Execute new slide.
- m_Presentation.GetSlideSystem().ExecuteSlide(
- SSlideKey(*inComponent, (qt3ds::QT3DSU8)theGotoSlideData.m_Slide),
- m_Presentation.GetAnimationSystem(), m_Presentation.GetLogicSystem());
- CTimePolicy &thePolicy(theComponent->GetTimePolicy());
- TTimeUnit theLoopingDuration = thePolicy.GetLoopingDuration();
- if (theGotoSlideData.m_Mode.hasValue()) {
- inComponent->SetPlayThrough(false);
- switch (*theGotoSlideData.m_Mode) {
- case TimePolicyModes::Looping:
- thePolicy.Initialize(theLoopingDuration, 0, false);
- break;
- case TimePolicyModes::PingPong:
- thePolicy.Initialize(theLoopingDuration, 0, true);
- break;
- case TimePolicyModes::StopAtEnd:
- thePolicy.Initialize(theLoopingDuration, 1, false);
- break;
- case TimePolicyModes::Ping:
- thePolicy.Initialize(theLoopingDuration, 1, true);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- // Update the current index which also updates the back index
- theComponent->SetCurrentSlide(static_cast<UINT8>(theGotoSlideData.m_Slide));
- m_PlaythroughOverrideMap.erase(inComponent);
- if (theGotoSlideData.m_PlaythroughTo.hasValue()) {
- m_PlaythroughOverrideMap.insert(
- eastl::make_pair(inComponent, *theGotoSlideData.m_PlaythroughTo));
- theComponent->SetPlayThrough(true);
- }
-
- // Reset time for component to 0
-
- if (theGotoSlideData.m_Paused.hasValue())
- thePolicy.SetPaused(*theGotoSlideData.m_Paused);
-
- thePolicy.SetRate(theGotoSlideData.m_Rate);
- thePolicy.SetReverse(theGotoSlideData.m_Reverse);
-
- if (theGotoSlideData.m_StartTime.hasValue())
- thePolicy.SetTime(*theGotoSlideData.m_StartTime);
-
- inComponent->SetDirty();
- m_Presentation.FireEvent(EVENT_ONSLIDEENTER, inComponent);
- qt3ds::runtime::IActivityZone *theZone = m_Presentation.GetActivityZone();
- if (theZone)
- theZone->OnSlideChange(*inComponent);
-
- m_Presentation.GetApplication().ComponentSlideEntered(&m_Presentation, inComponent,
- elementPath, theGotoSlideData.m_Slide,
- GetCurrentSlideName(inComponent));
- // Signal current slide change
- m_Presentation.signalProxy()->SigSlideEntered(elementPath, GetCurrentSlide(inComponent),
- GetCurrentSlideName(inComponent));
-}
-
-//==============================================================================
-/**
- * Sets a component to a specified slide using the slide name hash.
- * Performs a switch to Slide 0 (master) first, before switching to the
- * required slide.
- * @param inComponent reference to the TComponent
- * @param inSlideHashName hash of the slide to switch to
- */
-void CComponentManager::GotoSlideName(TElement *inComponent, const TStringHash inSlideHashName)
-{
- TComponent *theComponent = GetComponent(inComponent);
- UINT8 theSlideIndex = m_Presentation.GetSlideSystem().FindSlide(*theComponent, inSlideHashName);
-
- if (theSlideIndex < 1 || theSlideIndex >= theComponent->GetSlideCount()) {
- const char *slideName = m_Presentation.GetApplication().ReverseHash(inSlideHashName);
- if (slideName && *slideName)
- qCCritical(qt3ds::INVALID_PARAMETER) << "GotoSlide: Name not found: " << slideName;
- else
- qCCritical(qt3ds::INVALID_PARAMETER) << "GotoSlide: Name not found: " << inSlideHashName;
-
- } else
- GotoSlideIndex(inComponent, theSlideIndex);
-}
-
-//==============================================================================
-/**
- * Return the index of the current slide of the component.
- * @param inComponent reference to the TComponent
- * @return the index of current slide
- */
-UINT8 CComponentManager::GetCurrentSlide(TElement *inComponent)
-{
- return GetComponent(inComponent)->GetCurrentSlide();
-}
-
-//==============================================================================
-/**
- * Return the number of slides on a component.
- * @param inComponent reference to the TComponent
- * @return the number of slides
- */
-UINT8 CComponentManager::GetSlideCount(TElement *inComponent)
-{
- return GetComponent(inComponent)->GetSlideCount();
-}
-
-//==============================================================================
-/**
- * Performs a switch to the slide following the current slide (current slide + 1).
- * @param inComponent reference to the TComponent
- * @param inIncrement slide increment offset
- */
-void CComponentManager::GoToNextSlide(TElement *inComponent, const INT32 inIncrement)
-{
- TComponent *theComponent = GetComponent(inComponent);
- INT32 theNewIndex = Q3DStudio_clamp<INT32>(inIncrement + theComponent->GetCurrentSlide(), 1L,
- theComponent->GetSlideCount() - 1);
-
- // Trigger goto to slide only if the next slide is not the current
- if (theComponent->GetActive()) {
- if (theNewIndex != theComponent->GetCurrentSlide())
- GotoSlideIndex(inComponent, theNewIndex);
- } else {
- qCCritical(qt3ds::INVALID_PARAMETER)
- << "Runtime: Attempt to goto slide on an inactive component!";
- }
-}
-
-//==============================================================================
-/**
- * Performs a switch to the slide following the current slide (current slide - 1).
- * @param inComponent reference to the TComponent
- * @param inDecrement slide decrement offset
- */
-void CComponentManager::GoToPreviousSlide(TElement *inComponent, const INT32 inDecrement)
-{
- TComponent *theComponent = GetComponent(inComponent);
- INT32 theNewIndex = Q3DStudio_clamp<INT32>(theComponent->GetCurrentSlide() - inDecrement, 1L,
- theComponent->GetSlideCount() - 1);
-
- // Trigger goto to slide only if the next slide is not the current
- if (theNewIndex != theComponent->GetCurrentSlide())
- GotoSlideIndex(inComponent, theNewIndex);
-}
-
-//==============================================================================
-/**
- * Playthrough to the next slide that is specified.
- * @param inComponent reference to the TComponent
- */
-void CComponentManager::PlaythroughToSlide(TElement *inComponent)
-{
- TComponent *theComponent = GetComponent(inComponent);
- TComponentIntMap::iterator iter = m_PlaythroughOverrideMap.find(inComponent);
- INT32 thePlaythroughTo = 0;
- if (iter != m_PlaythroughOverrideMap.end()) {
- thePlaythroughTo = iter->second;
- m_PlaythroughOverrideMap.erase(iter);
- } else {
- thePlaythroughTo = m_Presentation.GetSlideSystem().GetPlaythroughToSlideIndex(
- SSlideKey(*theComponent, (qt3ds::QT3DSU8)theComponent->GetCurrentSlide()));
- if (thePlaythroughTo == -1) {
- qCCritical(qt3ds::INVALID_OPERATION) << "Missing slide to play through to";
- inComponent->SetPlayThrough(
- false); // clear this flag, so that this is equivalent to a "Stop At End"
- }
- }
-
- if (thePlaythroughTo == -2) {
- GoToPreviousSlide(inComponent, 1);
- } else if (thePlaythroughTo == -1) {
- GoToNextSlide(inComponent, 1);
- } else {
- GotoSlideIndex(inComponent, thePlaythroughTo);
- }
-}
-
-//==============================================================================
-/**
- * Performs a switch to the previous slide.
- * @param inComponent reference to the TComponent
- */
-void CComponentManager::GoToBackSlide(TElement *inComponent)
-{
- TComponent *theComponent = GetComponent(inComponent);
- GotoSlideIndex(theComponent, theComponent->GetPreviousSlide());
-}
-
-//==============================================================================
-/**
- * Set the component's local time using the supplied time.
- * @param inComponent reference to the TComponent
- * @param inTime supplied time
- */
-void CComponentManager::GoToTime(TElement *inComponent, const TTimeUnit inTime)
-{
- if (inComponent == NULL)
- return;
- if (inComponent->GetActive() == false) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Runtime: Attempt to goto time on inactive component!";
- return;
- }
- m_Presentation.GetActivityZone()->GoToTime(*inComponent, inTime);
- inComponent->SetDirty();
-}
-
-//==============================================================================
-/**
- * Get the component's playback state
- * @param inComponent reference to the TComponent
- * @return true if it's paused, false if it's playing
- */
-BOOL CComponentManager::GetPause(TElement *inComponent)
-{
- CTimePolicy &theTimePolicy = GetComponent(inComponent)->GetTimePolicy();
- return theTimePolicy.GetPaused();
-}
-
-//==============================================================================
-/**
- * Get the component's ping pong direction
- * @param inComponent reference to the TComponent
- * @return true if it's pingponging forward, false if it's pingponging backwards
- */
-BOOL CComponentManager::GetPlayBackDirection(TElement *inComponent)
-{
- return GetComponent(inComponent)->GetPlayBackDirection();
-}
-
-//==============================================================================
-/**
- * Update time policy of the component during each slide execution
- * @param inComponent reference to the TComponent
- * @param inLoopDuration loop duration of component at that slide
- * @param inRepetitions number of repetitions
- * @param inPingPong if true the component will move with respect to reverse time
- *sequence
- * @param inPlayThrough if true the component will continue to execute next slide
- */
-void CComponentManager::SetTimePolicy(TElement *inComponent, const TTimeUnit inLoopDuration,
- const UINT32 inRepetitions, const BOOL inPingPong,
- const BOOL inPlayThrough)
-{
- CTimePolicy &theTimePolicy = GetComponent(inComponent)->GetTimePolicy();
- theTimePolicy.Initialize(inLoopDuration, inRepetitions, inPingPong);
- inComponent->SetPlayThrough(inPlayThrough);
-}
-
-//==============================================================================
-/**
- * Set the component's playback to either play or pause
- * @param inComponent reference to the TComponent
- * @param inPause true = pause, false = play
- */
-void CComponentManager::SetPause(TElement *inComponent, const BOOL inPause)
-{
- CTimePolicy &theTimePolicy = GetComponent(inComponent)->GetTimePolicy();
- BOOL wasPaused = theTimePolicy.GetPaused();
- theTimePolicy.SetPaused(inPause);
- if (wasPaused != inPause)
- inComponent->SetDirty();
-}
-
-//==============================================================================
-/**
- * Promote from TElement* to TComponent.
- * @param inElement TElement pointer to be recast as TComponent
- * @return pointer to the component
- */
-TComponent *CComponentManager::GetComponent(TElement *inElement)
-{
- Q3DStudio_ASSERT(inElement->IsComponent());
- return static_cast<TComponent *>(inElement);
-}
-
-//==============================================================================
-/**
- * Gets the string name of the current slide.
- * @param inComponent the component to query for it's current slide name
- * @return the char buffer storing the name
- */
-const CHAR *CComponentManager::GetCurrentSlideName(TElement *inComponent)
-{
- TComponent *theComponent = GetComponent(inComponent);
- return m_Presentation.GetSlideSystem().GetSlideName(
- SSlideKey(*theComponent, (qt3ds::QT3DSU8)theComponent->GetCurrentSlide()));
-}
-
-void CComponentManager::OnElementDeactivated(TElement *)
-{
-}
-
-void CComponentManager::SetComponentTimeOverride(TElement *inElement, TTimeUnit inEndTime,
- FLOAT inInterpolation,
- IComponentTimeOverrideFinishedCallback *inCallback)
-{
- if (inElement->IsComponent()) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "ComponentManager: SetComponentTimeOverride called on object that "
- << "wasn't an element";
- if (inCallback)
- inCallback->Release();
- Q3DStudio_ASSERT(false);
- return;
- }
- // sanitize end time.
- CTimePolicy &theTimePolicy = GetComponent(inElement)->GetTimePolicy();
- if (inEndTime < 0)
- inEndTime = 0;
- if (inEndTime > theTimePolicy.GetLoopingDuration())
- inEndTime = theTimePolicy.GetLoopingDuration();
- m_Presentation.GetActivityZone()->GetOrCreateItemComponentOverride(*inElement, inInterpolation,
- inEndTime, inCallback);
-
- // Force the time policy object to respect its own time. If we played through till the end and
- // sat there for a while
- // we need the actual time will travel further and further from the time policy's local time.
- // If we then play backward we
- // will jump until the offset is synchronized with the actual time.
- theTimePolicy.SetTime(theTimePolicy.GetTime());
- inElement->SetDirty();
-}
-
-void CComponentManager::SetupComponentGotoSlideCommand(TElement *inElement,
- const SComponentGotoSlideData &inSlide)
-{
- m_ComponentGotoSlideMap[inElement] = inSlide;
-}
-
-bool CComponentManager::HasComponentGotoSlideCommand(TElement *inElement)
-{
- return m_ComponentGotoSlideMap.find(inElement) != m_ComponentGotoSlideMap.end();
-}
-
-SComponentGotoSlideData CComponentManager::GetComponentGotoSlideCommand(TElement *inElement)
-{
- TComponentGotoSlideDataMap::iterator iter = m_ComponentGotoSlideMap.find(inElement);
- if (iter != m_ComponentGotoSlideMap.end())
- return iter->second;
- return -1;
-}
-
-void CComponentManager::ReleaseComponentGotoSlideCommand(TElement *inElement)
-{
- TComponentGotoSlideDataMap::iterator iter = m_ComponentGotoSlideMap.find(inElement);
- if (iter != m_ComponentGotoSlideMap.end())
- m_ComponentGotoSlideMap.erase(iter);
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.h
deleted file mode 100644
index 865b8aa9..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSComponentManager.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSIComponentManager.h"
-#include "EASTL/hash_map.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-class CTimePolicy;
-class CPresentation;
-struct SComponentTimePolicyOverride
-{
- TElement *m_Element;
- FLOAT m_TimeMultiplier;
- TTimeUnit m_EndTime;
- IComponentTimeOverrideFinishedCallback *m_TimeCallback;
- SComponentTimePolicyOverride(TElement *inElement, FLOAT inMultiplier, TTimeUnit inEndTime,
- IComponentTimeOverrideFinishedCallback *inCallback)
- : m_Element(inElement)
- , m_TimeMultiplier(inMultiplier)
- , m_EndTime(inEndTime)
- , m_TimeCallback(inCallback)
- {
- }
- // Returns the local time and a boolean indicating if we have reached the end.
- // Implemented in UICTimePolicy.cpp so that I can compare the CTimePolicy::ComputeTime method
- // with
- // SComponentTimePolicyOverride::ComputLocalTime method
- eastl::pair<BOOL, TTimeUnit> ComputeLocalTime(CTimePolicy &inTimePolicy,
- TTimeUnit inGlobalTime);
- // Implemented in UICTimePolicy.cpp
- void SetTime(CTimePolicy &inTimePolicy, TTimeUnit inLocalTime);
-};
-
-typedef eastl::hash_map<TElement *, SComponentGotoSlideData> TComponentGotoSlideDataMap;
-typedef eastl::hash_map<TElement *, Q3DStudio::INT32> TComponentIntMap;
-
-//==============================================================================
-/**
- * The Component Manager is a factory and container of all components
- * within the presentation.
- */
-class CComponentManager : public IComponentManager
-{
- CPresentation &m_Presentation;
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CComponentManager(IPresentation &inPresentation);
-
-public: // Slide
- void GotoSlideIndex(TElement *inComponent, const SComponentGotoSlideData &inGotoData,
- BOOL inSlideExit = true) override;
- void GotoSlideName(TElement *inComponent, const TStringHash inSlideHashName) override;
- void GoToBackSlide(TElement *inComponent) override;
- void GoToNextSlide(TElement *inComponent, const INT32 inDecrement = 1) override;
- void GoToPreviousSlide(TElement *inComponent, const INT32 inDecrement = 1) override;
- void PlaythroughToSlide(TElement *inComponent);
-
- UINT8 GetSlideCount(TElement *inComponent) override;
- UINT8 GetCurrentSlide(TElement *inComponent) override;
- const CHAR *GetCurrentSlideName(TElement *inComponent) override;
-
- void OnElementDeactivated(TElement *inElement) override;
-
- void SetComponentTimeOverride(TElement *inElement, TTimeUnit inEndTime, FLOAT inInterpolation,
- IComponentTimeOverrideFinishedCallback *inCallback) override;
-
- // Allows multiple gotoslide command operating on the same element to work correctly.
- // This API is meant to fix a scenario where gotoslide is called multiple times in a frame
- // on the same component. This isn't avoidable in some cases without very complex scene logic.
-
- // later calls override earlier calls
- void SetupComponentGotoSlideCommand(TElement *inElement,
- const SComponentGotoSlideData &inSlide) override;
- bool HasComponentGotoSlideCommand(TElement *inElement) override;
- SComponentGotoSlideData GetComponentGotoSlideCommand(TElement *inElement) override;
- void ReleaseComponentGotoSlideCommand(TElement *inElement) override;
-
-public: // Time
- void GoToTime(TElement *inComponent, const TTimeUnit inTime) override;
- void SetPause(TElement *inComponent, const BOOL inPause) override;
- void SetTimePolicy(TElement *inComponent, const TTimeUnit inLoopDuration,
- const UINT32 inRepetitions, const BOOL inPingPong, const BOOL inPlayThrough) override;
-
- TTimeUnit ComputeComponentLocalTime(TElement *inComponent, const TTimeUnit inGlobalTime);
- BOOL GetPause(TElement *inComponent) override;
- BOOL GetPlayBackDirection(TElement *inComponent) override;
-
-protected: // Promotion
- TComponent *GetComponent(TElement *inElement) override;
-
-private:
- // Disabled Copy Construction
- CComponentManager(const CComponentManager &);
- CComponentManager &operator=(const CComponentManager &);
-
- TComponentGotoSlideDataMap m_ComponentInitialSlideMap;
- TComponentGotoSlideDataMap m_ComponentGotoSlideMap;
- TComponentIntMap m_PlaythroughOverrideMap;
-
- //==============================================================================
- // Friends
- //==============================================================================
- friend class CSlideBuilder;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.cpp
deleted file mode 100644
index acf8849e..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-#include "Qt3DSElementHelper.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSCommandEventTypes.h"
-
-using namespace qt3ds;
-
-namespace Q3DStudio {
-
-const char PRESENTATION_DELIMITER = ':';
-const char NODE_DELIMITER = '.';
-const TStringHash RESERVED_THIS = CHash::HashString("this");
-const TStringHash RESERVED_PARENT = CHash::HashString("parent");
-const TStringHash RESERVED_SCENE = CHash::HashString("Scene");
-
-CElementHelper::CElementHelper()
-{
-}
-
-CElementHelper::~CElementHelper()
-{
-}
-
-TElement *CElementHelper::GetElement(qt3ds::runtime::IApplication &inApplication,
- IPresentation *inDefaultPresentation, const char *inPath,
- TElement *inStartElement)
-{
- if (!inPath || *inPath == 0)
- return nullptr;
- const char *thePath(inPath);
- const char *theSubPath = nullptr;
- IPresentation *thePresentation = nullptr;
- size_t thePathLength = ::strlen(thePath) + 1;
- char *theToken = Q3DStudio_allocate_desc(CHAR, thePathLength, "Token:TempPath");
- // Try to get the specified presentation
- theSubPath = ::strchr(thePath, PRESENTATION_DELIMITER);
- TElement *theElement = inStartElement;
- if (theSubPath) {
- UINT32 theSubPathLength = static_cast<UINT32>(theSubPath - thePath);
-
- ::strncpy(theToken, thePath, theSubPathLength);
- theToken[theSubPathLength] = '\0';
-
- thePath = theSubPath + 1;
-
- const CHAR *thePresentationName = theToken;
-
- thePresentation = inApplication.GetPresentationById(thePresentationName);
- }
-
- if (!thePresentation)
- thePresentation = inDefaultPresentation;
-
- // Return nil if the inStartElement is not in the specified presentation
- if (theElement
- && (!theSubPath && theElement->GetBelongedPresentation() != thePresentation)) {
- thePresentation = theElement->GetBelongedPresentation();
- }
-
- if (!thePresentation)
- return nullptr;
-
- TStringHash theName;
- INT32 theParseCounter = 0;
-
- while (thePath && thePath[0] != '\0') {
- ++theParseCounter;
-
- // Do some strtok() work here
- theSubPath = ::strchr(thePath, NODE_DELIMITER);
- if (theSubPath) {
- UINT32 theSubPathLength = static_cast<UINT32>(theSubPath - thePath);
- Q3DStudio_ASSERT(theSubPathLength < thePathLength);
-
- ::strncpy(theToken, thePath, theSubPathLength);
- theToken[theSubPathLength] = '\0';
-
- thePath = theSubPath + 1;
- } else {
- ::strcpy(theToken, thePath);
- thePath = nullptr;
- }
-
- // Hash the token and do some element searching
- theName = CHash::HashString(theToken);
-
- if (theName == RESERVED_PARENT) {
- if (theElement)
- theElement = theElement->GetParent();
- } else if (theName == RESERVED_THIS) {
- ;
- } else {
- if (theName == RESERVED_SCENE && theParseCounter == 1) {
- // theElement is nullptr, so using absolute path
- theElement = thePresentation->GetRoot();
- } else if (theElement) {
- // Using relative path
- theElement = theElement->FindChild(theName);
- }
- }
-
- if (!theElement)
- thePath = nullptr;
- } // while
-
- Q3DStudio_free(theToken, CHAR, thePathLength);
- return theElement;
-}
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.h
deleted file mode 100644
index df2afddb..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementHelper.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-namespace qt3ds {
-namespace runtime {
- class IApplication;
-}
-}
-
-namespace Q3DStudio {
-
-class IPresentation;
-
-class CElementHelper
-{
-private:
- CElementHelper();
- CElementHelper(const CElementHelper &);
- CElementHelper &operator=(const CElementHelper &);
- virtual ~CElementHelper();
-
-public:
- static TElement *GetElement(qt3ds::runtime::IApplication &inApplication,
- IPresentation *inDefaultPresentation, const char *inPath,
- TElement *inStartElement = nullptr);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.cpp
deleted file mode 100644
index d8e18338..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.cpp
+++ /dev/null
@@ -1,855 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "RuntimePrefix.h"
-#include "Qt3DSElementSystem.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "EASTL/sort.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "Qt3DSHash.h"
-#include "Qt3DSActivationManager.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSPresentationFrameData.h"
-#include "Qt3DSAttributeHashes.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSIndexableLinkedList.h"
-
-using namespace qt3ds::runtime::element;
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using namespace qt3ds::intrinsics;
-namespace eastl {
-template <>
-struct hash<STypeDesc>
-{
- size_t operator()(const STypeDesc &inDesc) const { return inDesc.HashCode(); }
-};
-}
-
-namespace {
-typedef IndexableLinkedList<SPropertyValueGroup, Q3DStudio::UVariant,
- SPropertyValueGroup::NumValues>
- TElementPropertyList;
-struct SPropertyDescSorter
-{
- bool operator()(const TPropertyDescAndValue &lhs, const TPropertyDescAndValue &rhs) const
- {
- return strcmp(lhs.first.m_Name.c_str(), rhs.first.m_Name.c_str()) < 0;
- }
-};
-QT3DSU32 GetNumValueAllocations(const STypeDesc &inTypeDesc)
-{
- return ((inTypeDesc.m_Properties.size() + SPropertyValueGroup::NumValues - 1)
- / SPropertyValueGroup::NumValues);
-}
-struct SElementAllocator : public qt3ds::runtime::IElementAllocator
-{
- typedef Pool<SElement, ForwardingAllocator> TElementPool;
- typedef Pool<SComponent, ForwardingAllocator> TComponentPool;
- typedef TElementPropertyList::TPoolType TValuePool;
- typedef nvhash_map<QT3DSU32, SElement *> THandleElementMap;
- typedef nvhash_map<SElement *, QT3DSU32> TElementOffsetMap;
- typedef nvhash_set<STypeDesc> TTypeDescSet;
- typedef nvhash_map<const STypeDesc *, QT3DSU32> TTypeDescOffsetMap;
- typedef nvhash_map<QT3DSU32, const STypeDesc *> TOffsetTypeDescMap;
- typedef nvvector<NVDataRef<QT3DSU8>> TLoadBufferList;
-
- NVFoundationBase &m_Foundation;
- IStringTable &m_StringTable;
- TElementPool m_Elements;
- TComponentPool m_Components;
- TValuePool m_Values;
- THandleElementMap m_HandleToElements;
- TElementOffsetMap m_ElementOffsets;
- TTypeDescOffsetMap m_TypeDescOffsets;
- TOffsetTypeDescMap m_OffsetsToTypeDescs;
- TTypeDescSet m_TypeDescriptors;
- nvvector<TPropertyDescAndValue> m_TempPropertyDescsAndValues;
- nvvector<SPropertyDesc> m_TempPropertyDescs;
- nvvector<CRegisteredString> m_IgnoredProperties;
- // Upon load we allocate a set of buffers
- nvvector<QT3DSU8> m_LoadBuffer;
- TLoadBufferList m_AllocatedBuffers;
- SSAutoDeallocatorAllocator m_AutoAllocator;
- nvvector<SElement *> m_LoadElements;
-
- QT3DSU32 m_NextElementHandle;
-
- eastl::string m_Workspace;
- eastl::string m_WorkspaceExt;
-
- QT3DSI32 m_RefCount;
-
- SElementAllocator(NVFoundationBase &inFoundation, IStringTable &inStrTable)
- : m_Foundation(inFoundation)
- , m_StringTable(inStrTable)
- , m_Elements(ForwardingAllocator(m_Foundation.getAllocator(), "m_Elements"))
- , m_Components(ForwardingAllocator(m_Foundation.getAllocator(), "m_Components"))
- , m_Values(ForwardingAllocator(m_Foundation.getAllocator(), "m_Values"))
- , m_HandleToElements(m_Foundation.getAllocator(), "m_HandleToElements")
- , m_ElementOffsets(m_Foundation.getAllocator(), "m_ElementOffsets")
- , m_TypeDescOffsets(m_Foundation.getAllocator(), "m_TypeDescOffsets")
- , m_OffsetsToTypeDescs(m_Foundation.getAllocator(), "m_OffsetsToTypeDescs")
- , m_TypeDescriptors(m_Foundation.getAllocator(), "m_TypeDescriptors")
- , m_TempPropertyDescsAndValues(m_Foundation.getAllocator(), "m_TempPropertyDescsAndValues")
- , m_TempPropertyDescs(m_Foundation.getAllocator(), "m_TempPropertyDescs")
- , m_IgnoredProperties(m_Foundation.getAllocator(), "m_IgnoredProperties")
- , m_LoadBuffer(m_Foundation.getAllocator(), "m_LoadBuffer")
- , m_AllocatedBuffers(m_Foundation.getAllocator(), "m_AllocatedBuffers")
- , m_AutoAllocator(inFoundation)
- , m_LoadElements(inFoundation.getAllocator(), "m_LoadElements")
- , m_NextElementHandle(1)
- , m_RefCount(0)
- {
- }
-
- ~SElementAllocator() {}
-
- void GetIgnoredProperties()
- {
- if (m_IgnoredProperties.empty())
- m_IgnoredProperties.push_back(m_StringTable.RegisterStr("name"));
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
-
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Foundation.getAllocator());
- NVDelete(alloc, this);
- }
- }
-
- SElement &CreateElement(CRegisteredString inName, CRegisteredString inType,
- CRegisteredString inSubType,
- NVConstDataRef<TPropertyDescAndValue> inPropertyDescriptions,
- Q3DStudio::IPresentation *inPresentation, SElement *inParent,
- bool inIsComponent) override
- {
- m_TempPropertyDescsAndValues.clear();
- m_TempPropertyDescs.clear();
- bool participatesInTimeGraph = false;
- GetIgnoredProperties();
- for (QT3DSU32 idx = 0, end = inPropertyDescriptions.size(); idx < end; ++idx) {
- QT3DSU32 nameHash = inPropertyDescriptions[idx].first.GetNameHash();
- if (nameHash == Q3DStudio::ATTRIBUTE_STARTTIME
- || nameHash == Q3DStudio::ATTRIBUTE_ENDTIME)
- participatesInTimeGraph = true;
- if (eastl::find(m_IgnoredProperties.begin(), m_IgnoredProperties.end(),
- inPropertyDescriptions[idx].first.m_Name)
- == m_IgnoredProperties.end()) {
- m_TempPropertyDescsAndValues.push_back(inPropertyDescriptions[idx]);
- }
- }
- eastl::sort(m_TempPropertyDescsAndValues.begin(), m_TempPropertyDescsAndValues.end(),
- SPropertyDescSorter());
-
- for (QT3DSU32 idx = 0, end = m_TempPropertyDescsAndValues.size(); idx < end; ++idx) {
- m_TempPropertyDescs.push_back(m_TempPropertyDescsAndValues[idx].first);
- }
-
- STypeDesc theDesc;
- theDesc.m_TypeName = inType;
- theDesc.m_SubtypeName = inSubType;
- theDesc.m_Properties = m_TempPropertyDescs;
- theDesc.SetHashValue();
- eastl::pair<TTypeDescSet::iterator, bool> inserter = m_TypeDescriptors.insert(theDesc);
-
- const STypeDesc &theTypeDesc = *inserter.first;
- if (inserter.second) {
- size_t allocSize = theDesc.m_Properties.size() * sizeof(SPropertyDesc);
- if (allocSize) {
- SPropertyDesc *newProps = (SPropertyDesc *)m_AutoAllocator.allocate(
- allocSize, "TypeDescData", __FILE__, __LINE__, 0);
- memCopy(newProps, theDesc.m_Properties.begin(), (QT3DSU32)allocSize);
- // Note that this does not change the hash value.
- const_cast<STypeDesc &>(theTypeDesc).m_Properties =
- toConstDataRef(newProps, theDesc.m_Properties.size());
- }
- }
-
- SElement *retval = inIsComponent ? m_Components.construct(theTypeDesc, __FILE__, __LINE__)
- : m_Elements.construct(theTypeDesc, __FILE__, __LINE__);
- retval->m_BelongedPresentation = inPresentation;
- retval->m_Name = inName;
- // children
- if (inParent) {
- retval->m_Parent = inParent;
- if (inParent->m_Child == NULL) {
- inParent->m_Child = retval;
- } else {
- SElement *lastChild = inParent->m_Child;
- while (lastChild->m_Sibling)
- lastChild = lastChild->m_Sibling;
- lastChild->m_Sibling = retval;
- }
- }
- while (FindElementByHandle(m_NextElementHandle)) {
- ++m_NextElementHandle;
- if (!m_NextElementHandle)
- ++m_NextElementHandle;
- }
-
- // required flags
- retval->m_Handle = m_NextElementHandle;
- if (inIsComponent)
- retval->Flags().clearOrSet(true, Q3DStudio::ELEMENTFLAG_COMPONENT);
-
- if (participatesInTimeGraph)
- retval->Flags().clearOrSet(true, Q3DStudio::ELEMENTFLAG_TIMELINE);
-
- retval->Flags().clearOrSet(true, Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE);
-
- retval->SetDepth();
-
- retval->SetDirty();
-
- m_HandleToElements.insert(eastl::make_pair(retval->m_Handle, retval));
-
- // property values;
- QT3DSU32 propIdx = 0;
- TElementPropertyList::CreateAll(retval->m_PropertyValues, theTypeDesc.m_Properties.size(),
- m_Values);
- for (TElementPropertyList::iterator
- iter = TElementPropertyList::begin(retval->m_PropertyValues,
- theTypeDesc.m_Properties.size()),
- end = TElementPropertyList::end(retval->m_PropertyValues,
- theTypeDesc.m_Properties.size());
- iter != end; ++iter, ++propIdx) {
- (*iter) = m_TempPropertyDescsAndValues[propIdx].second;
- }
-
- return *retval;
- }
-
- void ReleaseElement(SElement &inElement, bool inRecurse) override
- {
- if (inRecurse) {
- while (inElement.m_Child)
- ReleaseElement(*inElement.m_Child, true);
- }
- // Trim out the element.
- if (inElement.m_Parent) {
- SElement *theParent = inElement.m_Parent;
- if (theParent->m_Child == &inElement)
- theParent->m_Child = inElement.m_Sibling;
- else {
- SElement *thePreviousChild = NULL;
- // Empty loop to find the previous child
- for (thePreviousChild = theParent->m_Child;
- thePreviousChild->m_Sibling != &inElement && thePreviousChild;
- thePreviousChild = thePreviousChild->m_Sibling) {
- }
- if (thePreviousChild)
- thePreviousChild->m_Sibling = inElement.m_Sibling;
- }
- }
-
- m_HandleToElements.erase(inElement.m_Handle);
-
- QT3DSU8 *elemAddr = reinterpret_cast<QT3DSU8 *>(&inElement);
- for (QT3DSU32 idx = 0, end = m_AllocatedBuffers.size(); idx < end; ++idx) {
- NVDataRef<QT3DSU8> theBuffer(m_AllocatedBuffers[idx]);
- // Preloaded element, do not release back to element pools
- if (elemAddr >= theBuffer.begin() && elemAddr < theBuffer.end())
- return;
- }
-
- SPropertyValueGroup *theValueGroup = inElement.m_PropertyValues;
- while (theValueGroup) {
- SPropertyValueGroup *currentGroup = theValueGroup;
- theValueGroup = theValueGroup->m_NextNode;
- m_Values.deallocate(currentGroup);
- }
-
- if (inElement.IsComponent())
- m_Components.deallocate(&inElement);
- else
- m_Elements.deallocate(&inElement);
- }
-
- QT3DSI32 GetExtensionIndex(eastl::string &inExt)
- {
- QT3DSI32 retVal = 0;
-
- if (!inExt.compare(".x") || !inExt.compare(".r"))
- retVal = 0;
- else if (!inExt.compare(".y") || !inExt.compare(".g"))
- retVal = 1;
- if (!inExt.compare(".z") || !inExt.compare(".b"))
- retVal = 2;
-
- return retVal;
- }
-
- virtual Option<TPropertyDescAndValuePtr>
- CreateDynamicProperty(Q3DStudio::IRuntimeMetaData &theMetaData, SElement &element,
- CRegisteredString inName) override
- {
- SPropertyDesc *newProp = NULL;
- m_TempPropertyDescsAndValues.clear();
- m_TempPropertyDescs.clear();
-
- // create dynamic descriptor
- if (!element.m_DynamicTypeDescription) {
- STypeDesc *theDesc;
- theDesc = (STypeDesc *)m_AutoAllocator.allocate(sizeof(STypeDesc), "TypeDescData",
- __FILE__, __LINE__, 0);
- theDesc->m_TypeName = element.m_TypeDescription->m_TypeName;
- theDesc->m_SubtypeName = element.m_TypeDescription->m_SubtypeName;
- theDesc->m_Properties = m_TempPropertyDescs;
- theDesc->SetHashValue();
- // we need this palcement new here
- ::new (theDesc) STypeDesc();
- element.m_DynamicTypeDescription = const_cast<STypeDesc *>(theDesc);
- }
-
- STypeDesc *theTypeDesc = element.m_DynamicTypeDescription;
-
- // remove the extension that we can find the property
- QT3DSI32 extIndex = 0;
- m_Workspace.assign(inName.c_str());
- eastl::string::size_type theCharPos = m_Workspace.rfind('.');
- if (theCharPos != eastl::string::npos) {
- m_WorkspaceExt.assign(m_Workspace, theCharPos, m_Workspace.length());
- m_Workspace.resize(theCharPos);
- extIndex = GetExtensionIndex(m_WorkspaceExt);
- }
-
- CRegisteredString theWorkSpaceString = m_StringTable.RegisterStr(m_Workspace.c_str());
- Q3DStudio::ERuntimeDataModelDataType thePropertyType =
- theMetaData.GetPropertyType(element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
-
- // using separate properties
- bool separateProperties = theCharPos != eastl::string::npos;
-
- // single property
- size_t allocSize = sizeof(SPropertyDesc);
- if (allocSize) {
- newProp = (SPropertyDesc *)m_AutoAllocator.allocate(allocSize, "SPropertyDesc",
- __FILE__, __LINE__, 0);
-
- newProp->m_Name = inName;
-
- // convert to appropriate type
- if (thePropertyType == Q3DStudio::ERuntimeDataModelDataTypeFloat) {
- float value = theMetaData.GetPropertyValueFloat(
- element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
-
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_FLOAT;
-
- Q3DStudio::UVariant theValue;
- theValue.m_FLOAT = value;
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_FLOAT), theValue));
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- } else if (thePropertyType == Q3DStudio::ERuntimeDataModelDataTypeFloat2) {
- qt3ds::QT3DSVec2 value = theMetaData.GetPropertyValueVector2(
- element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_FLOAT;
-
- Q3DStudio::UVariant theVarValue;
- theVarValue.m_FLOAT = value[extIndex];
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_FLOAT),
- theVarValue));
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- } else if (thePropertyType == Q3DStudio::ERuntimeDataModelDataTypeFloat3) {
- qt3ds::QT3DSVec3 value = theMetaData.GetPropertyValueVector3(
- element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
-
- if (separateProperties) {
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_FLOAT;
-
- Q3DStudio::UVariant theVarValue;
- theVarValue.m_FLOAT = value[extIndex];
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_FLOAT),
- theVarValue));
- } else {
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_FLOAT3;
-
- Q3DStudio::UVariant theVarValue;
- theVarValue.m_FLOAT3[0] = value[0];
- theVarValue.m_FLOAT3[1] = value[1];
- theVarValue.m_FLOAT3[2] = value[2];
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_FLOAT3),
- theVarValue));
- }
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- } else if (thePropertyType == Q3DStudio::ERuntimeDataModelDataTypeLong) {
- QT3DSI32 value = (QT3DSI32)theMetaData.GetPropertyValueLong(
- element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
-
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_INT32;
-
- Q3DStudio::UVariant theVarValue;
- theVarValue.m_INT32 = value;
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_INT32),
- theVarValue));
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- } else if (thePropertyType == Q3DStudio::ERuntimeDataModelDataTypeBool) {
- bool value = theMetaData.GetPropertyValueBool(
- element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
-
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_BOOL;
-
- Q3DStudio::UVariant theVarValue;
- theVarValue.m_INT32 = value;
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_BOOL), theVarValue));
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- } else if (thePropertyType == Q3DStudio::ERuntimeDataModelDataTypeString) {
- Option<eastl::string> theRuntimeStr = theMetaData.GetPropertyValueString(
- element.m_TypeDescription->m_TypeName, theWorkSpaceString,
- element.m_TypeDescription->m_SubtypeName);
-
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_STRING;
-
- CStringHandle theString = m_StringTable.GetHandle(theRuntimeStr->c_str());
- Q3DStudio::UVariant theVarValue;
- theVarValue.m_StringHandle = theString.handle();
- m_TempPropertyDescsAndValues.push_back(eastl::make_pair(
- SPropertyDesc(theWorkSpaceString, Q3DStudio::ATTRIBUTETYPE_STRING),
- theVarValue));
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- } else {
- newProp->m_Type = Q3DStudio::ATTRIBUTETYPE_FLOAT;
-
- theTypeDesc->m_DynamicProperties.push_back(*newProp);
- }
- }
-
- // property values;
- QT3DSU32 newListSize = theTypeDesc->m_DynamicProperties.size() - 1;
- TElementPropertyList::Create(element.m_DynamicPropertyValues, newListSize, m_Values);
-
- Q3DStudio::UVariant &propertyValue =
- TElementPropertyList::GetObjAtIdx(element.m_DynamicPropertyValues, newListSize - 1);
- propertyValue = m_TempPropertyDescsAndValues[0].second;
-
- return eastl::make_pair(
- element.m_DynamicTypeDescription->m_DynamicProperties[newListSize - 1],
- &TElementPropertyList::GetObjAtIdx(element.m_DynamicPropertyValues, newListSize - 1));
- }
-
- SElement *FindElementByHandle(QT3DSU32 inElementHandle) override
- {
- THandleElementMap::iterator theFind = m_HandleToElements.find(inElementHandle);
- if (theFind != m_HandleToElements.end())
- return theFind->second;
- return NULL;
- }
-
- // Returns an element pointer that when added to the return value of load will be a valid
- // element.
- SElement *GetRemappedElementAddress(SElement *inElement) const override
- {
- if (inElement == NULL)
- return NULL;
- TElementOffsetMap::const_iterator iter = m_ElementOffsets.find(inElement);
- if (iter != m_ElementOffsets.end())
- return reinterpret_cast<SElement *>(iter->second);
- return NULL;
- }
-
- const STypeDesc *GetRemappedTypeDescAddress(const STypeDesc *inTypeDesc) const override
- {
- TTypeDescOffsetMap::const_iterator iter = m_TypeDescOffsets.find((STypeDesc *)inTypeDesc);
- if (iter != m_TypeDescOffsets.end())
- return reinterpret_cast<STypeDesc *>(iter->second);
- return NULL;
- }
- const STypeDesc *RemapTypeDesc(const STypeDesc *inOffset)
- {
- size_t memoryOffset = reinterpret_cast<size_t>(inOffset);
- TOffsetTypeDescMap::iterator iter =
- m_OffsetsToTypeDescs.find(static_cast<QT3DSU32>(memoryOffset));
- if (iter != m_OffsetsToTypeDescs.end())
- return iter->second;
- return NULL;
- }
-
- SElement *RemapElement(SElement *inElem, size_t memoryOffset)
- {
- if (inElem)
- return reinterpret_cast<SElement *>(reinterpret_cast<size_t>(inElem) + memoryOffset);
- return NULL;
- }
-};
-}
-
-bool STypeDesc::operator==(const STypeDesc &inOther) const
-{
- if (m_TypeName == inOther.m_TypeName && m_SubtypeName == inOther.m_SubtypeName
- && m_Properties.size() == inOther.m_Properties.size()) {
- for (QT3DSU32 idx = 0, end = m_Properties.size(); idx < end; ++idx) {
- const SPropertyDesc &lhs = m_Properties[idx];
- const SPropertyDesc &rhs = inOther.m_Properties[idx];
- if (lhs.m_Name != rhs.m_Name || lhs.m_Type != rhs.m_Type)
- return false;
- }
- return true;
- }
- return false;
-}
-
-Option<QT3DSU32> STypeDesc::FindProperty(QT3DSU32 inNameHash) const
-{
- for (QT3DSU32 idx = 0, end = m_Properties.size(); idx < end; ++idx) {
- const SPropertyDesc &theDesc = m_Properties[idx];
- if (Q3DStudio::CHash::HashAttribute(theDesc.m_Name) == inNameHash)
- return idx;
- }
- return Empty();
-}
-
-Option<QT3DSU32> STypeDesc::FindProperty(CRegisteredString inName) const
-{
- for (QT3DSU32 idx = 0, end = m_Properties.size(); idx < end; ++idx) {
- const SPropertyDesc &theDesc = m_Properties[idx];
- if (theDesc.m_Name == inName)
- return idx;
- }
- return Empty();
-}
-
-Option<QT3DSU32> STypeDesc::FindDynamicProperty(QT3DSU32 inNameHash) const
-{
- for (QT3DSU32 idx = 0, end = m_DynamicProperties.size(); idx < end; ++idx) {
- const SPropertyDesc &theDesc = m_DynamicProperties[idx];
- if (Q3DStudio::CHash::HashAttribute(theDesc.m_Name) == inNameHash)
- return idx;
- }
- return Empty();
-}
-
-void STypeDesc::SetHashValue()
-{
- size_t typeDescHash = m_TypeName.hash() ^ m_SubtypeName.hash();
- for (QT3DSU32 idx = 0, end = m_Properties.size(); idx < end; ++idx) {
- typeDescHash = typeDescHash ^ m_Properties[idx].m_Name.hash();
- typeDescHash = typeDescHash ^ eastl::hash<QT3DSU32>()(m_Properties[idx].m_Type);
- }
- // TODO check 64 bit compatibility
- m_HashValue = (QT3DSU32)typeDescHash;
-}
-
-QT3DSU32 SPropertyDesc::GetNameHash() const
-{
- return Q3DStudio::CHash::HashAttribute(m_Name.c_str());
-}
-
-Q3DStudio::SAttributeKey SPropertyDesc::GetAttributeKey() const
-{
- Q3DStudio::SAttributeKey retval;
- memZero(&retval, sizeof(retval));
- retval.m_Type = m_Type;
- retval.m_Hash = GetNameHash();
- return retval;
-}
-
-bool SElement::IsUserActive() const
-{
- return m_Flags.IsExplicitActive();
-}
-
-bool SElement::IsIndependent() const
-{
- return IsComponent();
-}
-
-bool SElement::IsGlobalActive() const
-{
- return GetActive();
-}
-// This may require a mutex to be held.
-void SElement::SetGlobalActive(bool active)
-{
- SetActive(active);
-}
-
-bool SElement::GetAttribute(QT3DSU32 inHashName, Q3DStudio::UVariant &outValue) const
-{
- if (inHashName == Q3DStudio::ATTRIBUTE_NAME) {
- outValue.m_StringHandle = m_BelongedPresentation->GetStringTable().GetHandle(m_Name);
- return true;
- }
- if (inHashName == Q3DStudio::CHash::HashAttribute("path")) {
- outValue.m_StringHandle = m_BelongedPresentation->GetStringTable().GetHandle(m_Path);
- return true;
- }
- const Q3DStudio::UVariant *valPtr = FindPropertyValue(inHashName);
- if (valPtr) {
- outValue = *valPtr;
- return true;
- }
- return false;
-}
-
-void SElement::SetAttribute(const Q3DStudio::TAttributeHash inKey,
- const Q3DStudio::UVariant inValue)
-{
- Option<TPropertyDescAndValuePtr> existing = FindProperty(inKey);
- if (existing.hasValue() == false)
- return;
- SetAttribute(*existing, inValue);
-}
-
-void SElement::SetAttribute(TPropertyDescAndValuePtr inKey, const Q3DStudio::UVariant inValue)
-{
- Q3DStudio::EAttributeType theType = inKey.first.m_Type;
- Q3DStudio::UVariant *currentValue = inKey.second;
- QT3DSU32 attHash = inKey.first.GetNameHash();
- switch (theType) {
- case Q3DStudio::ATTRIBUTETYPE_FLOAT: // Early return
- if (fabs(currentValue->m_FLOAT - inValue.m_FLOAT) < SmallestDifference())
- return;
- break;
- case Q3DStudio::ATTRIBUTETYPE_FLOAT3: // Early return
- if (fabs(currentValue->m_FLOAT3[0] - inValue.m_FLOAT3[0]) < SmallestDifference()
- && fabs(currentValue->m_FLOAT3[1] - inValue.m_FLOAT3[1]) < SmallestDifference()
- && fabs(currentValue->m_FLOAT3[2] - inValue.m_FLOAT3[2]) < SmallestDifference()) {
- return;
- }
- break;
- case Q3DStudio::ATTRIBUTETYPE_STRING:
- if (currentValue->m_StringHandle == inValue.m_StringHandle)
- return;
- break;
- default: // Early return
- if (currentValue->m_INT32 == inValue.m_INT32)
- return;
- break;
- }
- *currentValue = inValue;
-
- if (Q3DStudio::ATTRIBUTE_EYEBALL == attHash)
- SetFlag(Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE, inValue.m_INT32 ? true : false);
-
- if (Q3DStudio::ATTRIBUTE_STARTTIME == attHash || Q3DStudio::ATTRIBUTE_ENDTIME == attHash)
- GetActivityZone().UpdateItemInfo(*this);
-
- /*
- if ( inElement->m_Flags & ELEMENTFLAG_REGISTEREDFORATTRIBUTECHANGE )
- m_AttributeChangeCallbacks.FireCallbacks( inElement, theAttribute->m_Key,
- thePreviousValue, inValue );
- */
- SetDirty();
-}
-
-// SElement implementation
-QT3DSU32 SElement::GetNameHash() const
-{
- return Q3DStudio::CHash::HashString(m_Name.c_str());
-}
-
-// Q3DStudio::CHash::HashAttribute
-Option<QT3DSU32> SElement::FindPropertyIndex(QT3DSU32 inNameHash) const
-{
- return m_TypeDescription->FindProperty(inNameHash);
-}
-
-Option<QT3DSU32> SElement::FindPropertyIndex(CRegisteredString inName) const
-{
- return m_TypeDescription->FindProperty(inName);
-}
-
-Option<QT3DSU32> SElement::FindDynamicPropertyIndex(QT3DSU32 inNameHash) const
-{
- if (m_DynamicTypeDescription)
- return m_DynamicTypeDescription->FindDynamicProperty(inNameHash);
- else
- return Empty();
-}
-
-QT3DSU32 SElement::GetNumProperties() const
-{
- return m_TypeDescription->m_Properties.size();
-}
-
-QT3DSU32 SElement::GetNumDynamicProperties() const
-{
- if (m_DynamicTypeDescription)
- return m_DynamicTypeDescription->m_DynamicProperties.size();
- else
- return 0;
-}
-
-Option<TPropertyDescAndValuePtr> SElement::GetPropertyByIndex(QT3DSU32 inIdx)
-{
- if (inIdx < this->m_TypeDescription->m_Properties.size())
- return eastl::make_pair(m_TypeDescription->m_Properties[inIdx],
- &TElementPropertyList::GetObjAtIdx(m_PropertyValues, inIdx));
-
- return Empty();
-}
-
-Option<TPropertyDescAndValuePtr> SElement::GetDynamicPropertyByIndex(QT3DSU32 inIdx)
-{
- if (inIdx < this->m_DynamicTypeDescription->m_DynamicProperties.size())
- return eastl::make_pair(m_DynamicTypeDescription->m_DynamicProperties[inIdx],
- &TElementPropertyList::GetObjAtIdx(m_DynamicPropertyValues, inIdx));
-
- return Empty();
-}
-
-Option<TPropertyDescAndConstValuePtr> SElement::GetPropertyByIndex(QT3DSU32 inIdx) const
-{
- Option<TPropertyDescAndValuePtr> retval =
- const_cast<SElement &>(*this).GetPropertyByIndex(inIdx);
- if (retval.hasValue())
- return TPropertyDescAndConstValuePtr(*retval);
- return Empty();
-}
-
-void SElement::SetDirty()
-{
- if (!m_Flags.IsDirty()) {
- m_Flags.SetDirty(true);
- // The element is dirty, so place it on the frame data dirty list
- m_BelongedPresentation->GetFrameData().GetDirtyList().Push(this);
- m_Flags.SetDirty(true);
- }
-}
-
-void SElement::SetFlag(Q3DStudio::EElementFlag inFlag, bool inValue)
-{
- bool existing = m_Flags & inFlag;
- if (existing != inValue && HasActivityZone()) {
- m_Flags.clearOrSet(inValue, inFlag);
- if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE)
- GetActivityZone().UpdateItemInfo(*this);
- else if (inFlag == Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS)
- GetActivityZone().UpdateItemScriptStatus(*this);
- SetDirty();
- }
-}
-
-bool SElement::HasActivityZone() const
-{
- return m_BelongedPresentation->GetActivityZone() != NULL;
-}
-
-qt3ds::runtime::IActivityZone &SElement::GetActivityZone() const
-{
- return *m_BelongedPresentation->GetActivityZone();
-}
-
-SElement &SElement::GetComponentParent()
-{
- if (IsComponent())
- return *this;
-
- SElement *theParent = GetActivityZone().GetItemTimeParent(*this);
- if (theParent)
- return *theParent;
- QT3DS_ASSERT(false);
- return *this;
-}
-
-const SElement &SElement::GetComponentParent() const
-{
- return const_cast<SElement *>(this)->GetComponentParent();
-}
-
-SElement *SElement::FindChild(QT3DSU32 inNameHash)
-{
- for (SElement *theChild = m_Child; theChild; theChild = theChild->m_Sibling) {
- if (theChild->GetNameHash() == inNameHash)
- return theChild;
- }
- return NULL;
-}
-
-Q3DStudio::TTimeUnit SElement::GetInnerTime() const
-{
- return GetActivityZone().GetItemComponentTime(const_cast<SElement &>(*this));
-}
-// Get the time I am animating at.
-Q3DStudio::TTimeUnit SElement::GetOuterTime() const
-{
- return GetActivityZone().GetItemLocalTime(const_cast<SElement &>(*this));
-}
-
-bool SElement::IsDescendent(SElement &inPossibleParent) const
-{
- if (m_Parent == NULL)
- return false;
- if (m_Parent == &inPossibleParent)
- return true;
- return m_Parent->IsDescendent(inPossibleParent);
-}
-
-bool SComponent::GetPaused() const
-{
- return GetTimePolicy().GetPaused();
-}
-
-bool SComponent::GetPlayBackDirection() const
-{
- return GetTimePolicy().GetPlayBackDirection();
-}
-
-Q3DStudio::CTimePolicy &SComponent::GetTimePolicy()
-{
- return *GetActivityZone().GetOwnedTimePolicy(*this);
-}
-
-const Q3DStudio::CTimePolicy &SComponent::GetTimePolicy() const
-{
- return const_cast<SComponent *>(this)->GetTimePolicy();
-}
-
-qt3ds::runtime::IElementAllocator &
-qt3ds::runtime::IElementAllocator::CreateElementAllocator(NVFoundationBase &inFoundation,
- IStringTable &inStringTable)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), SElementAllocator)(inFoundation, inStringTable);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.h
deleted file mode 100644
index 12ebebd9..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSElementSystem.h
+++ /dev/null
@@ -1,616 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_ELEMENT_SYSTEM_H
-#define QT3DS_ELEMENT_SYSTEM_H
-#include "foundation/Qt3DSRefCounted.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "foundation/Utils.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSKernelTypes.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSInvasiveSet.h"
-#include "Qt3DSMetadata.h"
-
-// The qt3ds runtime element system contains the element graph and the data in the element
-// graph.
-
-namespace Q3DStudio {
-// class CPresentation;
-class IPresentation;
-class CTimePolicy;
-}
-
-namespace qt3ds {
-namespace foundation {
- class IInStream;
- class IOutStream;
-}
-}
-
-namespace qt3ds {
-namespace runtime {
- using namespace qt3ds::foundation;
- using namespace qt3ds;
- class IActivityZone;
- namespace element {
- struct SPropertyDesc
- {
- CRegisteredString m_Name;
- Q3DStudio::EAttributeType m_Type;
- SPropertyDesc()
- : m_Type(Q3DStudio::ATTRIBUTETYPE_NONE)
- {
- }
- SPropertyDesc(CRegisteredString inStr, Q3DStudio::EAttributeType inType)
- : m_Name(inStr)
- , m_Type(inType)
- {
- }
- QT3DSU32 GetNameHash() const; // CHash::HashAttribute
- Q3DStudio::SAttributeKey GetAttributeKey() const;
- };
-
- struct STypeDesc
- {
- CRegisteredString m_TypeName;
- CRegisteredString m_SubtypeName;
- // Properties are sorted so that we can quickly create new type descriptions
- // when necessary.
- NVConstDataRef<SPropertyDesc> m_Properties;
- eastl::vector<SPropertyDesc> m_DynamicProperties;
-
- private:
- QT3DSU32 m_HashValue; // Cached hash value for this type descriptor
- public:
- STypeDesc()
- : m_HashValue(0)
- {
- }
- bool operator==(const STypeDesc &inOther) const;
- // Q3DStudio::CHash::HashAttribute
- Option<QT3DSU32> FindProperty(QT3DSU32 inNameHash) const;
- Option<QT3DSU32> FindProperty(CRegisteredString inName) const;
- Option<QT3DSU32> FindDynamicProperty(QT3DSU32 inNameHash) const;
- void SetHashValue();
- QT3DSU32 HashCode() const { return m_HashValue; }
- };
-
- struct SActivationManagerNodeFlagValues
- {
- enum Enum {
- TimeActive = 1 << 1,
- TempTimeActive = 1 << 4,
- ParticipatesInTimeGraph = 1 << 5,
- Script = 1 << 6,
- ChildDirty = 1 << 7,
- };
- };
-
- struct SActivationManagerNodeFlags : public NVFlags<SActivationManagerNodeFlagValues::Enum>
- {
- bool IsTimeActive() const
- {
- return operator&(SActivationManagerNodeFlagValues::TimeActive);
- }
- void SetTimeActive(bool active)
- {
- clearOrSet(active, SActivationManagerNodeFlagValues::TimeActive);
- }
-
- bool IsTempTimeActive() const
- {
- return operator&(SActivationManagerNodeFlagValues::TempTimeActive);
- }
- void SetTempTimeActive(bool value)
- {
- clearOrSet(value, SActivationManagerNodeFlagValues::TempTimeActive);
- }
-
- // Is this item in the activation manager's scripts list.
- bool HasScript() const { return operator&(SActivationManagerNodeFlagValues::Script); }
- void SetHasScript(bool value)
- {
- clearOrSet(value, SActivationManagerNodeFlagValues::Script);
- }
-
- bool IsChildDirty() const
- {
- return operator&(SActivationManagerNodeFlagValues::ChildDirty);
- }
- void SetChildDirty() { clearOrSet(true, SActivationManagerNodeFlagValues::ChildDirty); }
- void ClearChildDirty()
- {
- clearOrSet(false, SActivationManagerNodeFlagValues::ChildDirty);
- }
- };
-
- struct SElement;
-
- struct SActivationManagerNode
- {
- // IT may seem wasteful to always have start,end time on the node. We need to do this
- // however
- // in order to transmit information down the timeline at times. Furthermore the
- // activation manager
- // is free to mangle these times as it sees fit; unlike the attribute start,end time.
- QT3DSU32 m_StartTime;
- QT3DSU32 m_StopTime;
- // Used by the activation manager specifically.
- QT3DSU32 m_DirtyIndex;
-
- // If m_Flags.IsIndependent(), first child is implicitly zero and instead
- // this records the time context index assocated with this element node.
- // Else this records the first child index.
- // These could perhaps be moved to the element flags except it breaks some isolation and
- // it just doesn't seem worth it.
- SActivationManagerNodeFlags m_Flags;
-
- SActivationManagerNode()
- : m_StartTime(QT3DS_MAX_U32)
- , m_StopTime(QT3DS_MAX_U32)
- , m_DirtyIndex(QT3DS_MAX_U32)
- {
- }
- };
-
- struct SElementFlag : public NVFlags<Q3DStudio::EElementFlag, QT3DSU16>
- {
- void SetDirty(bool inDirty) { clearOrSet(inDirty, Q3DStudio::ELEMENTFLAG_DIRTY); }
- bool IsDirty() const { return this->operator&(Q3DStudio::ELEMENTFLAG_DIRTY); }
-
- bool IsComponent() const { return this->operator&(Q3DStudio::ELEMENTFLAG_COMPONENT); }
-
- void SetExplicitActive(bool inValue)
- {
- clearOrSet(inValue, Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE);
- }
- bool IsExplicitActive() const
- {
- return this->operator&(Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE);
- }
-
- void SetActive(bool inValue)
- {
- clearOrSet(inValue, Q3DStudio::ELEMENTFLAG_GLOBALACTIVE);
- }
- bool IsActive() const { return this->operator&(Q3DStudio::ELEMENTFLAG_GLOBALACTIVE); }
-
- void SetPickEnabled(bool inValue)
- {
- clearOrSet(inValue, Q3DStudio::ELEMENTFLAG_PICKENABLED);
- }
- bool IsPickEnabled() const
- {
- return this->operator&(Q3DStudio::ELEMENTFLAG_PICKENABLED);
- }
-
- void SetPlayThrough(bool inValue)
- {
- clearOrSet(inValue, Q3DStudio::ELEMENTFLAG_PLAYTHROUGH);
- }
- bool IsPlayThrough() const
- {
- return this->operator&(Q3DStudio::ELEMENTFLAG_PLAYTHROUGH);
- }
-
- void SetScriptCallbacks(bool inValue)
- {
- clearOrSet(inValue, Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS);
- }
- bool HasScriptCallbacks() const
- {
- return this->operator&(Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS);
- }
-
- bool HasStartEndTime() const
- {
- return this->operator&(Q3DStudio::ELEMENTFLAG_TIMELINE);
- }
- };
-
- typedef eastl::pair<SPropertyDesc, Q3DStudio::UVariant *> TPropertyDescAndValuePtr;
- typedef eastl::pair<SPropertyDesc, const Q3DStudio::UVariant *>
- TPropertyDescAndConstValuePtr;
- typedef eastl::pair<SPropertyDesc, Q3DStudio::UVariant> TPropertyDescAndValue;
- // There is probably some balance here between number of values in a group
- // and number of groups. A heuristic of a large application would tell you
- // the optimum number of values to groups.
- struct SPropertyValueGroup
- {
- enum {
- NumValues = 4,
- };
- Q3DStudio::UVariant m_Data[4];
- SPropertyValueGroup *m_NextNode;
- SPropertyValueGroup()
- : m_NextNode(NULL)
- {
- for (QT3DSU32 idx = 0; idx < NumValues; ++idx)
- m_Data[idx].m_INT32 = 0;
- }
- };
-
- struct SElement
- {
- CRegisteredString m_Name; // const, do not set after creation.
- CRegisteredString m_Path;
- const STypeDesc *m_TypeDescription; ///< static information created on load time
- // The property values are in order described in the type description.
- SPropertyValueGroup *m_PropertyValues;
- // dynamic section
- STypeDesc *m_DynamicTypeDescription; ///< we may create this on the fly
- SPropertyValueGroup *m_DynamicPropertyValues;
-
- protected:
- SElementFlag m_Flags; // Setting these changes things.
- public:
- QT3DSU32 m_Handle;
- QT3DSU32 m_ScriptID; ///< Superfluous, could use handle to link to script representation
- QT3DSU32 m_Depth; ///< Distance from this node to the root of the graph.
- SElement *m_Parent; ///< Parent element in activity graph
- SElement *m_Sibling; ///< Next sibling element in activity graph
- SElement *m_Child; ///< First child element in activity graph
- void *m_Association; ///< Link to associated asset in scene
- Q3DStudio::IPresentation *m_BelongedPresentation;
- SActivationManagerNode m_ActivationManagerNode;
-
- SElement(const STypeDesc &inDesc)
- : m_TypeDescription(&inDesc)
- , m_PropertyValues(NULL)
- , m_DynamicTypeDescription(NULL)
- , m_DynamicPropertyValues(NULL)
- , m_Handle(0)
- , m_ScriptID(0)
- , m_Depth(0)
- , m_Parent(NULL)
- , m_Sibling(NULL)
- , m_Child(NULL)
- , m_Association(NULL)
- , m_BelongedPresentation(NULL)
- {
- }
- QT3DSU32 GetHandle() const { return m_Handle; }
- const STypeDesc &GetTypeDescription() const { return *m_TypeDescription; }
- void SetTypeDescription(const STypeDesc *inDesc) { m_TypeDescription = inDesc; }
- // Q3DStudio::CHash::HashString
- QT3DSU32 GetNameHash() const;
- const SPropertyValueGroup *GetFirstPropertyGroup() const { return m_PropertyValues; }
- void SetFirstPropertyGroup(SPropertyValueGroup *inGroup) { m_PropertyValues = inGroup; }
-
- SPropertyValueGroup *&UnsafeGetFirstPropertyGroup() { return m_PropertyValues; }
-
- // In general, use these accessors for attributes, especially setting values.
- // The other accessors are fast paths that do not:
- // 1. Set dirty flags
- // 2. Notify the activation zone of changes if setting start,end time.
- // 3. Notify any other subsystems.
- bool GetAttribute(QT3DSU32 inHashName, Q3DStudio::UVariant &outValue) const;
- // Triggers updating various subcomponents based on attribute key.
- void SetAttribute(const Q3DStudio::TAttributeHash inKey,
- const Q3DStudio::UVariant inValue);
- // Triggers updating various subcomponents without requiring a new property lookup.
- void SetAttribute(TPropertyDescAndValuePtr inKey, const Q3DStudio::UVariant inNewValue);
-
- // Q3DStudio::CHash::HashAttribute
- Option<QT3DSU32> FindPropertyIndex(QT3DSU32 inNameHash) const;
- Option<QT3DSU32> FindPropertyIndex(CRegisteredString inName) const;
-
- Option<QT3DSU32> FindDynamicPropertyIndex(QT3DSU32 inNameHash) const;
-
- QT3DSU32 GetNumProperties() const;
- QT3DSU32 GetAttributeCount() const { return GetNumProperties(); }
-
- QT3DSU32 GetNumDynamicProperties() const;
- QT3DSU32 GetDynamicAttributeCount() const { return GetNumDynamicProperties(); }
-
- // Note that if you set a value then this object is dirty.
- // Bypasses special checks in setAttribute. In general, use setAttribute.
- Option<TPropertyDescAndValuePtr> GetPropertyByIndex(QT3DSU32 inIdx);
- Option<TPropertyDescAndConstValuePtr> GetPropertyByIndex(QT3DSU32 inIdx) const;
-
- Option<TPropertyDescAndValuePtr> GetDynamicPropertyByIndex(QT3DSU32 inIdx);
-
- Q3DStudio::UVariant *FindPropertyValue(QT3DSU32 inNameHash)
- {
- Option<QT3DSU32> idx = FindPropertyIndex(inNameHash);
- if (idx.hasValue()) {
- Option<TPropertyDescAndValuePtr> theVal = GetPropertyByIndex(idx);
- if (theVal.hasValue())
- return theVal->second;
- }
- return NULL;
- }
- const Q3DStudio::UVariant *FindPropertyValue(QT3DSU32 inNameHash) const
- {
- Option<QT3DSU32> idx = FindPropertyIndex(inNameHash);
- if (idx.hasValue()) {
- Option<TPropertyDescAndConstValuePtr> theVal = GetPropertyByIndex(idx);
- if (theVal.hasValue())
- return theVal->second;
- }
- return NULL;
- }
- Q3DStudio::UVariant *FindPropertyValue(CRegisteredString inNameHash)
- {
- Option<QT3DSU32> idx = FindPropertyIndex(inNameHash);
- if (idx.hasValue()) {
- Option<TPropertyDescAndValuePtr> theVal = GetPropertyByIndex(idx);
- if (theVal.hasValue())
- return theVal->second;
- }
- return NULL;
- }
-
- const Q3DStudio::UVariant *FindPropertyValue(CRegisteredString inNameHash) const
- {
- Option<QT3DSU32> idx = FindPropertyIndex(inNameHash);
- if (idx.hasValue()) {
- Option<TPropertyDescAndConstValuePtr> theVal = GetPropertyByIndex(idx);
- if (theVal.hasValue())
- return theVal->second;
- }
- return NULL;
- }
-
- Option<TPropertyDescAndValuePtr> FindProperty(QT3DSU32 inNameHash)
- {
- Option<QT3DSU32> idx = FindPropertyIndex(inNameHash);
- if (idx.hasValue())
- return GetPropertyByIndex(*idx);
- return Empty();
- }
-
- Option<TPropertyDescAndValuePtr> FindDynamicProperty(QT3DSU32 inNameHash)
- {
- Option<QT3DSU32> idx = FindDynamicPropertyIndex(inNameHash);
- if (idx.hasValue())
- return GetDynamicPropertyByIndex(*idx);
-
- return Empty();
- }
-
- SElement *GetParent() { return m_Parent; }
- const SElement *GetParent() const { return m_Parent; }
- SElement *GetSibling() { return m_Sibling; }
- const SElement *GetSibling() const { return m_Sibling; }
- SElement *GetChild() { return m_Child; }
- const SElement *GetChild() const { return m_Child; }
- CRegisteredString GetType() const { return m_TypeDescription->m_TypeName; }
- bool IsComponent() const { return m_Flags.IsComponent(); }
-
- Q3DStudio::IPresentation *GetBelongedPresentation() { return m_BelongedPresentation; }
- void SetBelongedPresentation(Q3DStudio::IPresentation &inPresentation)
- {
- m_BelongedPresentation = &inPresentation;
- }
-
- // Set flags bypassing the dirty system *and* updates to the activity zone.
- // do not do this unless you are sure you do not want any side effects.
- SElementFlag &Flags() { return m_Flags; }
-
- // User flag that is set and is persistent
- void SetExplicitActive(bool inValue)
- {
- SetFlag(Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE, inValue);
- }
- bool IsExplicitActive() const { return m_Flags.IsExplicitActive(); }
-
- // Flag set by the activity manager.
- void SetActive(bool inValue) { SetFlag(Q3DStudio::ELEMENTFLAG_GLOBALACTIVE, inValue); }
- bool GetActive() const { return m_Flags.IsActive(); }
-
- void SetPickEnabled(bool inValue)
- {
- SetFlag(Q3DStudio::ELEMENTFLAG_PICKENABLED, inValue);
- }
- bool IsPickEnabled() const { return m_Flags.IsPickEnabled(); }
-
- void SetPlayThrough(bool inValue)
- {
- SetFlag(Q3DStudio::ELEMENTFLAG_PLAYTHROUGH, inValue);
- }
- bool IsPlayThrough() const { return m_Flags.IsPlayThrough(); }
-
- void SetScriptCallbacks(bool inValue)
- {
- SetFlag(Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS, inValue);
- }
- bool HasScriptCallbacks() const { return m_Flags.HasScriptCallbacks(); }
-
- bool IsDirty() const { return m_Flags.IsDirty(); }
-
- bool GetFlag(Q3DStudio::EElementFlag inFlag) const { return m_Flags.operator&(inFlag); }
-
- void SetDirty();
- void SetFlag(Q3DStudio::EElementFlag inFlag, bool inValue);
- void SetFlag(Q3DStudio::EElementFlag inFlag, int inValue)
- {
- SetFlag(inFlag, inValue ? true : false);
- }
- qt3ds::runtime::IActivityZone &GetActivityZone() const;
- bool HasActivityZone() const;
- // Floating point number differences above this trigger a setDirty call.
- static float SmallestDifference() { return 0.000001f; }
- SElement &GetComponentParent();
- const SElement &GetComponentParent() const;
- SElement *FindChild(QT3DSU32 inNameHash);
- // Get the time of my first noncomponent child or
- // my time if I am not a component.
- Q3DStudio::TTimeUnit GetInnerTime() const;
- // Get the time I am animating at.
- Q3DStudio::TTimeUnit GetOuterTime() const;
- bool IsDescendent(SElement &inPossibleParent) const;
- void *GetAssociation() const { return m_Association; }
- void SetAssociation(void *inAssoc) { m_Association = inAssoc; }
- QT3DSU32 GetUncachedDepth() const
- {
- if (m_Parent)
- return m_Parent->GetUncachedDepth() + 1;
- return 0;
- }
- void SetDepth() { m_Depth = GetUncachedDepth(); }
- QT3DSU32 Depth() const { return m_Depth; }
-
- bool IsUserActive() const;
-
- bool IsIndependent() const;
-
- bool IsGlobalActive() const;
- // This may require a mutex to be held.
- void SetGlobalActive(bool active);
-
- bool IsTimeActive() const
- {
- if (m_Parent != NULL)
- return m_ActivationManagerNode.m_Flags.IsTimeActive();
- return true;
- }
-
- bool DoesParticipateInTimeGraph() const { return m_Flags.HasStartEndTime(); }
-
- bool IsGlobalActive(bool inParentActive) const
- {
- bool ta = IsTimeActive();
- bool ua = IsUserActive();
-
- return ta && ua && inParentActive;
- }
- void findComponents(QVector<SElement *> &components)
- {
- if (IsComponent())
- components.push_back(this);
- SElement *child = m_Child;
- while (child) {
- child->findComponents(components);
- child = child->m_Sibling;
- }
- }
- };
-
- struct SGetElementNodeDirtyIndex
- {
- QT3DSU32 operator()(const SElement &inNode)
- {
- return inNode.m_ActivationManagerNode.m_DirtyIndex;
- }
- };
- struct SSetElementNodeDirtyIndex
- {
- void operator()(SElement &inNode, QT3DSU32 val)
- {
- inNode.m_ActivationManagerNode.m_DirtyIndex = val;
- }
- };
-
- struct SActivationManagerNodeDirtyList
- : public InvasiveSet<SElement, SGetElementNodeDirtyIndex, SSetElementNodeDirtyIndex>
- {
- typedef InvasiveSet<SElement, SGetElementNodeDirtyIndex, SSetElementNodeDirtyIndex>
- TBaseType;
- SActivationManagerNodeDirtyList(NVAllocatorCallback &callback)
- : TBaseType(callback, "SActivationManagerNodeDirtyList")
- {
- }
- };
-
- struct SComponent : public SElement
- {
- Q3DStudio::SAlignedTimeUnit m_BeginTime;
- Q3DStudio::SAlignedTimeUnit m_Duration;
-
- // Slide related
- QT3DSU8 m_SlideCount; ///< Number of slides starting from base index
- QT3DSU8 m_CurrentSlide; ///< Current slide number
- QT3DSU8 m_PreviousSlide; ///< Previous slide number
- SComponent(const STypeDesc &inDesc)
- : SElement(inDesc)
- , m_SlideCount(0)
- , m_CurrentSlide(0)
- , m_PreviousSlide(0)
- {
- }
-
- QT3DSU8 GetCurrentSlide() const { return m_CurrentSlide; }
- void SetCurrentSlide(QT3DSU8 inSlide)
- {
- m_PreviousSlide = m_CurrentSlide;
- m_CurrentSlide = inSlide;
- }
- QT3DSU8 GetSlideCount() const { return m_SlideCount; }
- QT3DSU8 GetPreviousSlide() const { return m_PreviousSlide; }
- bool GetPaused() const;
- bool GetPlayBackDirection() const;
- Q3DStudio::CTimePolicy &GetTimePolicy();
- const Q3DStudio::CTimePolicy &GetTimePolicy() const;
- };
- }
- // Global store of all elements, values.
- class IElementAllocator : public NVRefCounted
- {
- public:
- // Performs coalesing of element types so that there are the least number of type
- // descriptions
- // Certain properties, like name, eyeball, are never in the property description.
- virtual element::SElement &
- CreateElement(CRegisteredString inName, CRegisteredString inType,
- CRegisteredString inSubType,
- NVConstDataRef<element::TPropertyDescAndValue> inPropertyDescriptions,
- Q3DStudio::IPresentation *inPresentation, element::SElement *inParent,
- bool inIsComponent) = 0;
-
- virtual void ReleaseElement(element::SElement &inElement, bool inRecurse) = 0;
-
- virtual Option<element::TPropertyDescAndValuePtr>
- CreateDynamicProperty(Q3DStudio::IRuntimeMetaData &theMetaData, element::SElement &element,
- CRegisteredString inName) = 0;
-
- virtual element::SElement *FindElementByHandle(QT3DSU32 inElementHandle) = 0;
- // Returns an element pointer that when added to the return value of load will be a valid
- // element.
- virtual element::SElement *
- GetRemappedElementAddress(element::SElement *inElement) const = 0;
- virtual const element::STypeDesc *
- GetRemappedTypeDescAddress(const element::STypeDesc *inTypeDesc) const = 0;
- // If load is successful, then returns an address that can be added to elements and the root
- // element.
-
- static IElementAllocator &CreateElementAllocator(NVFoundationBase &inFoundation,
- IStringTable &inStringTable);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSEvent.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSEvent.h
deleted file mode 100644
index aef317a5..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSEvent.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSElementSystem.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-/// Common structure used as both Events and Commands
-struct SEventCommand
-{
- TElement *m_Target; ///< The target of this action
- TEventCommandHash m_Type; ///< Type of action to perform
- UVariant m_Arg1; ///< Argument 1
- UVariant m_Arg2; ///< Argument 2
- UINT8 m_Arg1Type; ///< EAttributeType for arg1 variant
- UINT8 m_Arg2Type; ///< EAttributeType for arg2 variant
-
- BOOL m_IsEvent : 1; ///< This is an Event or Command
- BOOL m_BubbleUp : 1; ///< Bubble up to scene parent (2.4.2: theEvent:stopPropagation)
- BOOL m_BubbleDown : 1; ///< Bubble down to scene children (2.4.2: theEvent:stopPropagation)
- BOOL m_Done : 1; ///< Stop further handling (2.4.3: theEvent:stopImmediatePropagation)
-
- UINT8 m_Unused; ///< (padding)
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.cpp
deleted file mode 100644
index 25d720ea..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSEventCallbacks.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- */
-CEventCallbacks::CEventCallbacks()
- : m_EventCallbacksList(0, 0, "EventCallbacksList")
- , m_CallbackList(0, 0, "CallbackList")
-{
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CEventCallbacks::~CEventCallbacks()
-{
- UnregisterAllCallbacks();
-}
-
-//==============================================================================
-/**
- * Registers a callback to be triggered when a specific event is fired on an
- * element.
- * @param inElement element to monitor
- * @param inEventHash event hash to monitor
- * @param inCallback static callback function
- * @param inContextData arbitary data pointer
- */
-void CEventCallbacks::RegisterCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData)
-{
- TEventCallbacksList *theEventCallbackList = NULL;
-
- // Look for the list of callbacks for this element
- FOR_ARRAY(SElementCallbackEntry *, theEntry, m_EventCallbacksList)
- {
- if (inElement == (*theEntry)->m_Element) {
- theEventCallbackList = &(*theEntry)->m_EventEntries;
- break;
- }
- }
-
- // Create a new list of callbacks if it does not already exist
- if (!theEventCallbackList) {
- SElementCallbackEntry *theElementCallbackEntry =
- Q3DStudio_new(SElementCallbackEntry) SElementCallbackEntry();
- theElementCallbackEntry->m_Element = inElement;
- m_EventCallbacksList.Push(theElementCallbackEntry);
- theEventCallbackList = &m_EventCallbacksList.Top()->m_EventEntries;
- }
-
- TCallbackList *theElementCallbackList = NULL;
-
- // Look for the list of callbacks for this event
- FOR_ARRAY(SEventCallbackEntry *, theEntry, (*theEventCallbackList))
- {
- if (inEventHash == (*theEntry)->m_EventHash) {
- theElementCallbackList = &(*theEntry)->m_Callbacks;
- break;
- }
- }
-
- // Create a new list of callbacks if it does not already exist
- if (!theElementCallbackList) {
- SEventCallbackEntry *theEventCallbackEntry =
- Q3DStudio_new(SEventCallbackEntry) SEventCallbackEntry();
- theEventCallbackEntry->m_EventHash = inEventHash;
- theEventCallbackList->Push(theEventCallbackEntry);
- theElementCallbackList = &theEventCallbackList->Top()->m_Callbacks;
- }
-
- // Insert callback
- SCallbackEntry theCallbackEntry = { inCallback, inContextData };
- theElementCallbackList->Push(theCallbackEntry);
-}
-
-//==============================================================================
-/**
- * Unregisters an event callback.
- * @param inElement element to monitor
- * @param inEventHash event hash to monitor
- * @param inCallback static callback function
- * @param inContextData arbitary data pointer
- * @param outLast indicates if element no longer has callbacks registered
- * @return BOOL true if callback is unregistered successfully
- */
-BOOL CEventCallbacks::UnregisterCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData,
- BOOL &outLast)
-{
- outLast = false;
-
- TEventCallbacksList *theEventCallbackList = NULL;
-
- INT32 theEventListIndex = 0;
- SElementCallbackEntry *theFoundEntry = NULL;
- FOR_ARRAY(SElementCallbackEntry *, theEntry, m_EventCallbacksList)
- {
- if (inElement == (*theEntry)->m_Element) {
- theFoundEntry = *theEntry;
- theEventCallbackList = &(*theEntry)->m_EventEntries;
- break;
- }
- ++theEventListIndex;
- }
-
- if (!theEventCallbackList)
- return false;
-
- TCallbackList *theElementCallbackList = NULL;
-
- INT32 theElementListIndex = 0;
- SEventCallbackEntry *theEventCallbackEntry = NULL;
- FOR_ARRAY(SEventCallbackEntry *, theEntry, (*theEventCallbackList))
- {
- if (inEventHash == (*theEntry)->m_EventHash) {
- theEventCallbackEntry = *theEntry;
- theElementCallbackList = &(*theEntry)->m_Callbacks;
- break;
- }
- ++theElementListIndex;
- }
-
- if (!theElementCallbackList)
- return false;
-
- INT32 theCallbackIndex = 0;
- FOR_ARRAY(SCallbackEntry, theEntry, (*theElementCallbackList))
- {
- if (inCallback == theEntry->m_Function && inContextData == theEntry->m_ContextData) {
- theElementCallbackList->Remove(theCallbackIndex);
-
- if (theElementCallbackList->GetCount() == 0) {
- Q3DStudio_delete(theEventCallbackEntry, SEventCallbackEntry);
- theEventCallbackList->Remove(theElementListIndex);
- }
-
- if (theEventCallbackList->GetCount() == 0) {
- Q3DStudio_delete(theFoundEntry, SElementCallbackEntry);
- m_EventCallbacksList.Remove(theEventListIndex);
- outLast = true;
- }
-
- return true;
- }
- ++theCallbackIndex;
- }
-
- return false;
-}
-
-//==============================================================================
-/**
- * Unregisters all callbacks.
- */
-void CEventCallbacks::UnregisterAllCallbacks()
-{
- FOR_ARRAY(SElementCallbackEntry *, theEntry, m_EventCallbacksList)
- Q3DStudio_delete(*theEntry, SElementCallbackEntry);
- m_EventCallbacksList.Clear();
-}
-
-//==============================================================================
-/**
- * Fires event callbacks
- * @param ioEvent the event that was fired
- */
-void CEventCallbacks::FireCallbacks(SEventCommand &ioEvent)
-{
- TEventCallbacksList *theEventCallbackList = NULL;
-
- // Look for the list of callbacks for this element
- FOR_ARRAY(SElementCallbackEntry *, theEntry, m_EventCallbacksList)
- {
- if (ioEvent.m_Target == (*theEntry)->m_Element) {
- theEventCallbackList = &(*theEntry)->m_EventEntries;
- break;
- }
- }
-
- if (!theEventCallbackList)
- return;
-
- // Look for the list of callbacks for this event
- FOR_ARRAY(SEventCallbackEntry *, theEntry, (*theEventCallbackList))
- {
- if (ioEvent.m_Type == (*theEntry)->m_EventHash) {
- PerformCallbacks((*theEntry)->m_Callbacks, ioEvent);
- break;
- }
- }
-}
-
-//==============================================================================
-/**
- * Executing a list of callbacks
- * @param inCallbackList the list of callbacks to invoke
- * @param ioEvent the event to pass to the callbacks
- */
-void CEventCallbacks::PerformCallbacks(TCallbackList &inCallbackList, SEventCommand &ioEvent)
-{
- // As the callbacks can potentially do a register/unregister that would alter the call list,
- // it is safer to get a clean copy of the call list to iterate through.
-
- // Clumsy way to do a m_CallbackList = inCallbackList
- m_CallbackList.Clear(false);
- m_CallbackList.Reserve(inCallbackList.GetCount());
- FOR_ARRAY(SCallbackEntry, theEntry, inCallbackList)
- m_CallbackList.Push(*theEntry);
-
- // Invoking the callbacks
- FOR_ARRAY(SCallbackEntry, theEntry, m_CallbackList)
- theEntry->m_Function(theEntry->m_ContextData, ioEvent);
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.h
deleted file mode 100644
index 5c17477d..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSEventCallbacks.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSEvent.h"
-#include "Qt3DSMemory.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Typedefs
-//==============================================================================
-typedef void (*TEventCallback)(void *inContextData, SEventCommand &ioEvent);
-
-//==============================================================================
-/**
- * Manages the various events callbacks in the system. It fires the
- * registered callbacks when an event was triggered.
- */
-class CEventCallbacks
-{
- //==============================================================================
- // Structs
- //==============================================================================
-protected:
- struct SCallbackEntry
- {
- TEventCallback m_Function; ///< Callback function pointer
- void *m_ContextData; ///< User data
- };
- typedef CArray<SCallbackEntry> TCallbackList; ///< Array of callbacks regisgtered
-
- struct SEventCallbackEntry
- {
- SEventCallbackEntry()
- : m_EventHash(0)
- {
- }
- ~SEventCallbackEntry() {}
-
- TEventCommandHash m_EventHash; ///< The event of interest
- TCallbackList m_Callbacks; ///< List of callbacks listening to this event
-
- private: // Disabled Copy Construction
- SEventCallbackEntry(const SEventCallbackEntry &);
- SEventCallbackEntry &operator=(const SEventCallbackEntry &);
- };
- typedef CArray<SEventCallbackEntry *> TEventCallbacksList; ///< Array of events with callback
-
- struct SElementCallbackEntry
- {
- SElementCallbackEntry()
- : m_Element(NULL)
- {
- }
- ~SElementCallbackEntry()
- {
- FOR_ARRAY(SEventCallbackEntry *, theEntry, m_EventEntries)
- Q3DStudio_delete(*theEntry, SEventCallbackEntry);
- }
-
- TElement *m_Element; ///< Element to monitor for event
- TEventCallbacksList m_EventEntries; ///< List of events listened on this element
-
- private: // Disabled Copy Construction
- SElementCallbackEntry(const SElementCallbackEntry &);
- SElementCallbackEntry &operator=(const SElementCallbackEntry &);
- };
- typedef CArray<SElementCallbackEntry *>
- TElementCallbacksList; ///< Array of elements with callbacks
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- TElementCallbacksList m_EventCallbacksList; ///< List of event callbacks
- TCallbackList m_CallbackList;
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CEventCallbacks();
- ~CEventCallbacks();
-
-public: // Registration
- void RegisterCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData);
- BOOL UnregisterCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData, BOOL &outLast);
- void UnregisterAllCallbacks();
-
-public: // Operation
- void FireCallbacks(SEventCommand &ioEvent);
-
-protected:
- void PerformCallbacks(TCallbackList &inCallbackList, SEventCommand &ioEvent);
-
-private: // Disabled Copy Construction
- CEventCallbacks(const CEventCallbacks &);
- CEventCallbacks &operator=(const CEventCallbacks &);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSFrameworkTypes.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSFrameworkTypes.h
deleted file mode 100644
index 8cb5c3b8..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSFrameworkTypes.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTypes.h"
-#include "Qt3DSArray.h"
-#include "Qt3DSVector3.h"
-#include "Qt3DSMatrix.h"
-#include "Qt3DSBoundingBox.h"
-#include "Qt3DSKernelTypes.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIComponentManager.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSIComponentManager.h
deleted file mode 100644
index 8185da2d..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIComponentManager.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSTimePolicy.h"
-#include "foundation/Qt3DSOption.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-
-namespace qt3ds {
-namespace runtime {
- namespace element {
- struct TElement;
- struct TComponent;
- }
-}
-}
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-struct IComponentTimeOverrideFinishedCallback
-{
-protected:
- virtual ~IComponentTimeOverrideFinishedCallback() {}
-public:
- virtual void OnTimeFinished() = 0;
- virtual void Release() = 0;
-};
-
-typedef qt3ds::foundation::Option<TimePolicyModes::Enum> TTimePolicyModeOption;
-typedef qt3ds::foundation::Option<INT32> TInt32Option;
-typedef qt3ds::foundation::Option<unsigned long> TULongOption;
-typedef qt3ds::foundation::Option<bool> TBoolOption;
-
-struct SComponentGotoSlideData
-{
- INT32 m_Slide;
- TTimePolicyModeOption m_Mode;
- //-2 means previous, -1 means next, 1-N means slide
- TInt32Option m_PlaythroughTo;
- TULongOption m_StartTime;
- FLOAT m_Rate;
- bool m_Reverse;
- TBoolOption m_Paused;
-
- // No mode means use the mode in the slide data.
- SComponentGotoSlideData(INT32 inSlide = 0,
- TTimePolicyModeOption inMode = TTimePolicyModeOption(),
- TInt32Option inPlayThrough = TInt32Option(),
- TULongOption inStartTime = TULongOption(), FLOAT inRate = 1.0f,
- bool inReverse = false, TBoolOption inPaused = TBoolOption())
- : m_Slide(inSlide)
- , m_Mode(inMode)
- , m_PlaythroughTo(inPlayThrough)
- , m_StartTime(inStartTime)
- , m_Rate(inRate)
- , m_Reverse(inReverse)
- , m_Paused(inPaused)
- {
- }
-};
-
-//==============================================================================
-/**
- * @interface IComponentManager
- * Base interface of the container of all the components in the presentation.
- * This specify the basic operations required to implement a Component manager
- * object that works well with the kernel.
- */
-class IComponentManager
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- virtual ~IComponentManager() {}
-
-public: // Promotion
- virtual TComponent *GetComponent(TElement *inElement) = 0;
-
-public: // Slides
- virtual void GotoSlideIndex(TElement *inComponent, const SComponentGotoSlideData &inGotoData,
- BOOL inSlideExit = true) = 0;
- virtual void GotoSlideName(TElement *inComponent, const TStringHash inSlideHashName) = 0;
- virtual void GoToBackSlide(TElement *inComponent) = 0;
- virtual void GoToNextSlide(TElement *inComponent, const INT32 inDecrement = 1) = 0;
- virtual void GoToPreviousSlide(TElement *inComponent, const INT32 inDecrement = 1) = 0;
-
- virtual UINT8 GetSlideCount(TElement *inComponent) = 0;
- virtual UINT8 GetCurrentSlide(TElement *inComponent) = 0;
- virtual const CHAR *GetCurrentSlideName(TElement *inComponent) = 0;
-
- virtual void OnElementDeactivated(TElement *inElement) = 0;
-
- virtual void SetComponentTimeOverride(TElement *inElement, TTimeUnit inEndTime,
- FLOAT inInterpolation,
- IComponentTimeOverrideFinishedCallback *inCallback) = 0;
-
- virtual void SetupComponentGotoSlideCommand(TElement *inElement,
- const SComponentGotoSlideData &inGotoSlideData) = 0;
- virtual bool HasComponentGotoSlideCommand(TElement *inElement) = 0;
- virtual SComponentGotoSlideData GetComponentGotoSlideCommand(TElement *inElement) = 0;
- virtual void ReleaseComponentGotoSlideCommand(TElement *inElement) = 0;
-
-public: // Time
- virtual void GoToTime(TElement *inComponent, const TTimeUnit inTime) = 0;
- virtual void SetPause(TElement *inComponent, const BOOL inPause) = 0;
- virtual void SetTimePolicy(TElement *inComponent, const TTimeUnit inLoopDuration,
- const UINT32 inRepetitions, const BOOL inPingPong,
- const BOOL inPlayThrough) = 0;
-
- virtual BOOL GetPause(TElement *inComponent) = 0;
- virtual BOOL GetPlayBackDirection(TElement *inComponent) = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIInputSystem.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSIInputSystem.h
deleted file mode 100644
index 6cd201fb..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIInputSystem.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSInputEngine.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Input system interface
- */
-class IInputSystem : public CInputEngine
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- virtual ~IInputSystem() {}
-
-public: // Processing
- virtual void UpdateInput() = 0;
- virtual void ProcessInput() = 0;
-
-protected: // Input System handler
- virtual void CheckMouseEvent() = 0;
- virtual void CheckKeyboardEvent() = 0;
- virtual void CheckJoystickEvent() = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIScene.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSIScene.h
deleted file mode 100644
index 7494ab0f..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIScene.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "Qt3DSBoundingBox.h"
-namespace qt3ds {
-namespace render {
- class IImageLoadListener;
-}
- class NVAllocatorCallback;
-}
-
-namespace Q3DStudio {
-
-class IPresentation;
-class RuntimeMatrix;
-struct SPickFrame;
-
-/**
-* @interface IScene
-*
-* Runtime interface to the renderer's representation of a presentation. Scenes are
-* created by the SceneManager and rendered via a lower level rendering system.
-*/
-struct STextSizes
-{
- INT32 m_Width;
- INT32 m_Height;
- STextSizes()
- : m_Width(0)
- , m_Height(0)
- {
- }
- STextSizes(INT32 w, INT32 h)
- : m_Width(w)
- , m_Height(h)
- {
- }
-};
-
-struct SMousePosition
-{
- INT32 m_X;
- INT32 m_Y;
- SMousePosition(INT32 x, INT32 y)
- : m_X(x)
- , m_Y(y)
- {
- }
- SMousePosition()
- : m_X(0)
- , m_Y(0)
- {
- }
-};
-
-struct SCameraRect
-{
- float m_Left;
- float m_Top;
- float m_Right;
- float m_Bottom;
- SCameraRect(float l = 0.0f, float t = 0.0f, float r = 0.0f, float b = 0.0f)
- : m_Left(l)
- , m_Top(t)
- , m_Right(r)
- , m_Bottom(b)
- {
- }
-
- bool IsValid() const { return fabs(m_Right - m_Left) > 0.0f; }
-};
-
-class IScene
-{
-protected:
- virtual ~IScene() {}
-
-public: // Base Interface
- virtual IPresentation &GetPresentation() = 0;
-
- virtual void SetUserData(void *inUserData) = 0;
- virtual void *GetUserData() = 0;
-
- virtual void CalculateGlobalTransform(TElement *inElement, RuntimeMatrix &outTransform) = 0;
- virtual void SetLocalTransformMatrix(TElement *inElement, const RuntimeMatrix &inTransform) = 0;
- // Get bounding box in global space
- virtual CBoundingBox GetBoundingBox(TElement *inElement, bool inSelfOnly) = 0;
- // Get bounding box in local space.
- virtual CBoundingBox GetLocalBoundingBox(TElement *inElement, bool inSelfOnly) = 0;
-
- // The final argument, inHasTransparency has 3 possible values,
- // 0 for no transparency, 1 for hasTransparency, -1 for unknown
- virtual void SetTextureData(TElement *inElement, const unsigned char *inBuffer,
- INT32 inBufferLength, INT32 inWidth, INT32 inHeight,
- qt3ds::render::NVRenderTextureFormats::Enum inFormat,
- INT32 inHasTransparency = -1) = 0;
-
- virtual bool CreateOrSetMeshData(const char *inPathStr, unsigned char *vertData,
- unsigned int numVerts, unsigned int vertStride,
- unsigned int *indexData, unsigned int numIndices,
- qt3ds::NVBounds3 &objBounds) = 0;
-
- virtual STextSizes MeasureText(TElement *inElement, const char *inTextStr) = 0;
-
- virtual STextSizes GetPresentationDesignDimensions() = 0;
- // If the rect's right - left == 0.0, this method failed. Possibly because the layer is just
- // direct-rendering a sub-presentation.
- virtual SCameraRect GetCameraBounds(TElement &inElement) = 0;
-
- virtual void PositionToScreen(TElement &inElement, qt3ds::QT3DSVec3 &inPos,
- qt3ds::QT3DSVec3 &outScreen) = 0;
- virtual void ScreenToPosition(TElement &inElement, qt3ds::QT3DSVec3 &inScreen,
- qt3ds::QT3DSVec3 &outPos) = 0;
-
- virtual qt3ds::foundation::CRegisteredString RegisterStr(const char *inStr) = 0;
-
- virtual Q3DStudio::INT32
- LoadImageBatch(qt3ds::foundation::CRegisteredString *inFullPaths, INT32 inNumPaths,
- qt3ds::foundation::CRegisteredString inDefaultImage,
- qt3ds::render::IImageLoadListener *inLoadCallback = nullptr) = 0;
-
- virtual SMousePosition WindowToPresentation(const SMousePosition &inWindowPos) = 0;
-
- virtual void RegisterOffscreenRenderer(const char *inKey) = 0;
-
- virtual void Release() = 0;
-
- virtual bool preferKtx() const = 0;
-
- virtual qt3ds::NVAllocatorCallback &allocator() = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIScriptBridge.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSIScriptBridge.h
deleted file mode 100644
index abbfcd5b..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIScriptBridge.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSIComponentManager.h"
-#include "EASTL/vector.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSApplication.h"
-
-#include <QtCore/qvariant.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qstringlist.h>
-
-namespace qt3dsimp {
- struct Mesh;
-}
-
-namespace qt3ds {
-namespace runtime {
- class IApplication;
-}
-}
-namespace qt3ds {
-namespace state {
- namespace debugger {
- class IMultiProtocolSocket;
- }
-}
-}
-namespace qt3ds {
-namespace render {
- class IThreadPool;
- class IQt3DSRenderer;
- class ICustomMaterialSystem;
- class IDynamicObjectSystem;
- class IBufferManager;
-}
-}
-
-struct script_State;
-
-namespace Q3DStudio {
-
-struct SEventCommand;
-class IPresentation;
-
-/**
- * @interface IScriptBridge
- * @brief Callback and load interface for a script engine.
- */
-
-class IScriptTableProvider
-{
-protected:
- virtual ~IScriptTableProvider() {}
-public:
- virtual void CreateTable(script_State *inState) = 0;
-};
-
-struct SScriptEngineGotoSlideArgs
-{
- TTimePolicyModeOption m_Mode;
- //-2 means previous, -1 means next, 1-N means slide
- const char *m_PlaythroughTo;
- TULongOption m_StartTime;
- float m_Rate;
- bool m_Reverse;
- TBoolOption m_Paused;
- SScriptEngineGotoSlideArgs()
- : m_PlaythroughTo(NULL)
- , m_Rate(1.0f)
- , m_Reverse(false)
- {
- }
-};
-
-class CScriptEngineCallFunctionArgRetriever
-{
-public:
- CScriptEngineCallFunctionArgRetriever(const char *inArguments)
- : m_ArgumentString(inArguments)
- {
- }
- virtual ~CScriptEngineCallFunctionArgRetriever() {}
- // Retrieve argument
- // Return value: -1 error; otherwise it indicates argument count
- virtual int RetrieveArgument(script_State *inState);
- virtual eastl::string GetArgDescription();
-
-protected:
- const char *m_ArgumentString;
-};
-
-class IScriptBridge : public qt3ds::foundation::NVRefCounted
-{
-public:
- virtual ~IScriptBridge() {}
-
-public: // thread
- // After this call all public functions are protected by a mutex
- virtual void EnableMultithreadedAccess() = 0;
- // After this call all public functions are not threadsafe.
- virtual void DisableMultithreadedAccess() = 0;
-
-public: // Settings
- virtual void SetApplicationCore(qt3ds::runtime::IApplication &inApplication) = 0;
- virtual void SetApplication(qt3ds::runtime::IApplication &inApplication) = 0;
-
-public: // Scripts
- // Both loads script, create an self table -> scriptIndex in a behaviors table
- // LoadScript goes further by registering scriptIndex->inPresentation, and inOwner->m_ScriptID=
- // scriptIndex
- virtual void LoadScript(IPresentation *inPresentation, TElement *inOwner,
- const CHAR *inName) = 0;
- virtual Q3DStudio::INT32 InitializeApplicationBehavior(const char *inProjectRelativePath) = 0;
-
-public: // Script functions and Callbacks
- virtual void ProcessFrameCallbacks(IPresentation *inPresentation) = 0;
- // Call a member function inFnName from self table whose script index is given by inApp
- virtual void ExecuteApplicationScriptFunction(Q3DStudio::INT32 inApp, const char *inFnName) = 0;
- virtual void CallFunction(const char *behavior, const char *handler,
- CScriptEngineCallFunctionArgRetriever &inArgRetriever) = 0;
-
-public: // Custom Actions
- virtual void ProcessSignal(IPresentation *inPresentation,
- const SEventCommand &inCommand) = 0;
- virtual void ProcessCustomActions(IPresentation *inPresentation,
- const SEventCommand &inCommand) = 0;
- virtual void ProcessCustomCallback(IPresentation *inPresentation,
- const SEventCommand &inCommand) = 0;
-
-public: // Elements
- // Use inProvider to create a new table and associate with inElement: currently a render plugin
- // element this mimics render plugin as an behavior element
- virtual void SetTableForElement(TElement &inElement, IScriptTableProvider &inProvider) = 0;
- virtual void SetAttribute(TElement *element, const char *attName, const char *value) = 0;
- virtual void SetAttribute(const char *element, const char *attName, const char *value) = 0;
- virtual void FireEvent(const char *element, const char *evtName) = 0;
- virtual void SetDataInputValue(
- const QString &name, const QVariant &value,
- qt3ds::runtime::DataInputValueRole property
- = qt3ds::runtime::DataInputValueRole::Value) = 0;
- virtual void createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties,
- qt3ds::render::IQt3DSRenderer *renderer) = 0;
- virtual void deleteElements(const QStringList &elementPath,
- qt3ds::render::IQt3DSRenderer *renderer) = 0;
- virtual void createMaterials(const QString &elementPath, const QStringList &materialDefinitions,
- qt3ds::render::ICustomMaterialSystem *customMaterialSystem,
- qt3ds::render::IDynamicObjectSystem *dynamicObjectSystem,
- qt3ds::render::IQt3DSRenderer *renderer) = 0;
- virtual void deleteMaterials(const QString &elementPath, const QStringList &materialNames,
- qt3ds::render::IQt3DSRenderer *renderer) = 0;
- virtual void createMesh(const QString &name, qt3dsimp::Mesh *mesh,
- qt3ds::render::IBufferManager *bufferManager) = 0;
- virtual void deleteMeshes(const QStringList &elementPath,
- qt3ds::render::IBufferManager *bufferManager) = 0;
-
-public: // Components
- virtual void GotoSlide(const char *component, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs) = 0;
- virtual void GotoSlideRelative(const char *component, bool inNextSlide, bool inWrap,
- const SScriptEngineGotoSlideArgs &inArgs) = 0;
-
-public: // Presentation
- virtual void SetPresentationAttribute(const char *presId, const char *attName,
- const char *attValue) = 0;
-
-public: // Multimedia
- virtual bool PlaySoundFile(const char *soundPath) = 0;
-
-public: // Miscellaneous
- virtual void EnableDebugging(qt3ds::state::debugger::IMultiProtocolSocket &socket) = 0;
- virtual void EnableProfiling() = 0;
- virtual void StepGC() = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIStateful.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSIStateful.h
deleted file mode 100644
index 0eca293e..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIStateful.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSArray.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-class IStatefulStackBase
-{
-public:
- virtual void PushState() = 0;
- virtual void PopState() = 0;
-};
-
-template <typename T>
-class IStatefulStack : public IStatefulStackBase
-{
-public:
- IStatefulStack(T &inStateProperty)
- : m_StateProperty(inStateProperty)
- {
- }
-
- virtual ~IStatefulStack(){};
-
-public:
- virtual void PushState() { m_States.Push(m_StateProperty); }
- virtual void PopState() { m_StateProperty = m_States.Pop(); }
-
-protected:
- T &m_StateProperty;
- CArray<T> m_States;
-};
-
-} // namespace Q3DStudio \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIText.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSIText.h
deleted file mode 100644
index c4694fe2..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSIText.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class CWorld;
-class CRenderStateManager;
-
-class IText
-{
-public: // Text update
- virtual void Update(CWorld &inWorld, CVector3 &outBoxMin, CVector3 &outBoxMax) = 0;
- virtual void Apply(CRenderStateManager &inRenderStateManager) = 0;
- static IText *GetIText(INT32 inAssociation);
-};
-
-} // namespace Q3DStudio \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputDefs.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputDefs.h
deleted file mode 100644
index 447e424b..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputDefs.h
+++ /dev/null
@@ -1,413 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Mouse button state flags
- * There is some discrepancy between mouse state and mouse events.
- *
- * Mouse button state refers to the actual state of the button as captured
- * by the input engine. The logical states are: up, pressed, down and released.
- *
- * Mouse events are generated by Kernel (in CKernel::SetPickFrame), and current
- * support is only for pressed and released. This translates to the respective
- * MOUSE_DOWN and MOUSE_UP.
- *
- * Therefore, a mapping would be:
- * STATE_MOUSE_PRESSED -> EVENT_MOUSE_DOWN
- * STATE_MOUSE_RELEASED -> EVENT_MOUSE_UP
- * STATE_MOUSE_UP -> No corresponding event
- * STATE_MOUSE_DOWN -> No corresponding event
- *
- */
-enum EMouseInputFlags {
- NO_INPUT = 0,
- //
- LMOUSE_PRESSED = 1 << 0,
- LMOUSE_RELEASED = 1 << 1,
- MMOUSE_PRESSED = 1 << 2,
- MMOUSE_RELEASED = 1 << 3,
- RMOUSE_PRESSED = 1 << 4,
- RMOUSE_RELEASED = 1 << 5,
- //
- LMOUSE_DOWN = 1 << 6,
- LMOUSE_UP = 1 << 7,
- MMOUSE_DOWN = 1 << 8,
- MMOUSE_UP = 1 << 9,
- RMOUSE_DOWN = 1 << 10,
- RMOUSE_UP = 1 << 11,
- MOUSEBUTTONCOUNT = 3, // left, middle, right - could potentially have more mouse buttons
-
- HSCROLLWHEEL = 1 << 12,
- VSCROLLWHEEL = 1 << 13,
-};
-
-//==============================================================================
-/**
- * Key code/index to SInputFrame::m_KeyStates
- */
-// enum EKeyCode
-//{
-// KEY_NOKEY = 0x00,
-// KEY_ESCAPE,
-// KEY_1,
-// KEY_2,
-// KEY_3,
-// KEY_4,
-// KEY_5,
-// KEY_6,
-// KEY_7,
-// KEY_8,
-// KEY_9,
-// KEY_0,
-// KEY_MINUS, /* - on main keyboard */
-// KEY_EQUALS,
-// KEY_BACK, /* backspace */
-// KEY_TAB,
-// KEY_Q,
-// KEY_W,
-// KEY_E,
-// KEY_R,
-// KEY_T,
-// KEY_Y,
-// KEY_U,
-// KEY_I,
-// KEY_O,
-// KEY_P,
-// KEY_LBRACKET,
-// KEY_RBRACKET,
-// KEY_RETURN, /* Enter on main keyboard */
-// KEY_LCONTROL,
-// KEY_A,
-// KEY_S,
-// KEY_D,
-// KEY_F,
-// KEY_G,
-// KEY_H,
-// KEY_J,
-// KEY_K,
-// KEY_L,
-// KEY_SEMICOLON,
-// KEY_APOSTROPHE,
-// KEY_GRAVE, /* accent grave */
-// KEY_LSHIFT,
-// KEY_BACKSLASH,
-// KEY_Z,
-// KEY_X,
-// KEY_C,
-// KEY_V,
-// KEY_B,
-// KEY_N,
-// KEY_M,
-// KEY_COMMA,
-// KEY_PERIOD, /* . on main keyboard */
-// KEY_SLASH, /* / on main keyboard */
-// KEY_RSHIFT,
-// KEY_MULTIPLY, /* * on numeric keypad */
-// KEY_LMENU, /* left Alt */
-// KEY_SPACE,
-// KEY_CAPITAL,
-// KEY_F1,
-// KEY_F2,
-// KEY_F3,
-// KEY_F4,
-// KEY_F5,
-// KEY_F6,
-// KEY_F7,
-// KEY_F8,
-// KEY_F9,
-// KEY_F10,
-// KEY_NUMLOCK,
-// KEY_SCROLL, /* Scroll Lock */
-// KEY_NUMPAD7,
-// KEY_NUMPAD8,
-// KEY_NUMPAD9,
-// KEY_SUBTRACT, /* - on numeric keypad */
-// KEY_NUMPAD4,
-// KEY_NUMPAD5,
-// KEY_NUMPAD6,
-// KEY_ADD, /* + on numeric keypad */
-// KEY_NUMPAD1,
-// KEY_NUMPAD2,
-// KEY_NUMPAD3,
-// KEY_NUMPAD0,
-// KEY_DECIMAL, /* . on numeric keypad */
-// KEY_OEM_102, /* <> or \| on RT 102-key keyboard (Non-U.S.) */
-// KEY_F11,
-// KEY_F12,
-// KEY_F13, /* (NEC PC98) */
-// KEY_F14, /* (NEC PC98) */
-// KEY_F15, /* (NEC PC98) */
-// KEY_KANA, /* (Japanese keyboard) */
-// KEY_ABNT_C1, /* /? on Brazilian keyboard */
-// KEY_CONVERT, /* (Japanese keyboard) */
-// KEY_NOCONVERT, /* (Japanese keyboard) */
-// KEY_YEN, /* (Japanese keyboard) */
-// KEY_ABNT_C2, /* Numpad . on Brazilian keyboard */
-// KEY_NUMPADEQUALS, /* = on numeric keypad (NEC PC98) */
-// KEY_PREVTRACK, /* Previous Track
-// (DIK_CIRCUMFLEX on Japanese keyboard) */
-// KEY_AT, /* (NEC PC98) */
-// KEY_COLON, /* (NEC PC98) */
-// KEY_UNDERLINE, /* (NEC PC98) */
-// KEY_KANJI, /* (Japanese keyboard) */
-// KEY_STOP, /* (NEC PC98) */
-// KEY_AX, /* (Japan AX) */
-// KEY_UNLABELED, /* (J3100) */
-// KEY_NEXTTRACK, /* Next Track */
-// KEY_NUMPADENTER, /* Enter on numeric keypad */
-// KEY_RCONTROL,
-// KEY_MUTE, /* Mute */
-// KEY_CALCULATOR, /* Calculator */
-// KEY_PLAYPAUSE, /* Play / Pause */
-// KEY_MEDIASTOP, /* Media Stop */
-// KEY_VOLUMEDOWN, /* Volume - */
-// KEY_VOLUMEUP, /* Volume + */
-// KEY_WEBHOME, /* Web home */
-// KEY_NUMPADPERIOD, /* . on numeric keypad (NEC PC98) */
-// KEY_DIVIDE, /* / on numeric keypad */
-// KEY_SYSRQ,
-// KEY_RMENU, /* right Alt */
-// KEY_PAUSE, /* Pause */
-// KEY_HOME, /* Home on arrow keypad */
-// KEY_UP, /* UpArrow on arrow keypad */
-// KEY_PRIOR, /* PgUp on arrow keypad */
-// KEY_LEFT, /* LeftArrow on arrow keypad */
-// KEY_RIGHT, /* RightArrow on arrow keypad */
-// KEY_END, /* End on arrow keypad */
-// KEY_DOWN, /* DownArrow on arrow keypad */
-// KEY_NEXT, /* PgDn on arrow keypad */
-// KEY_INSERT, /* Insert on arrow keypad */
-// KEY_DELETE, /* Delete on arrow keypad */
-// KEY_LWIN, /* Left Windows key */
-// KEY_RWIN, /* Right Windows key */
-// KEY_APPS, /* AppMenu key */
-// KEY_POWER, /* System Power */
-// KEY_SLEEP, /* System Sleep */
-// KEY_WAKE, /* System Wake */
-// KEY_WEBSEARCH, /* Web Search */
-// KEY_WEBFAVORITES, /* Web Favorites */
-// KEY_WEBREFRESH, /* Web Refresh */
-// KEY_WEBSTOP, /* Web Stop */
-// KEY_WEBFORWARD, /* Web Forward */
-// KEY_WEBBACK, /* Web Back */
-// KEY_MYCOMPUTER, /* My Computer */
-// KEY_MAIL, /* Mail */
-// KEY_MEDIASELECT, /* Media Select */
-// //
-// KEY_TOTAL_COUNT
-//};
-
-typedef enum _EKeyCode {
- KEY_NOKEY = 0,
- KEY_ESCAPE,
- KEY_1,
- KEY_2,
- KEY_3,
- KEY_4,
- KEY_5,
- KEY_6,
- KEY_7,
- KEY_8,
- KEY_9,
- KEY_0,
- KEY_SUBTRACT,
- KEY_EQUALS,
- KEY_BACK,
- KEY_TAB,
- KEY_Q,
- KEY_W,
- KEY_E,
- KEY_R,
- KEY_T,
- KEY_Y,
- KEY_U,
- KEY_I,
- KEY_O,
- KEY_P,
- KEY_LBRACKET,
- KEY_RBRACKET,
- KEY_RETURN,
- KEY_LCONTROL,
- KEY_A, // 30
- KEY_S,
- KEY_D,
- KEY_F,
- KEY_G,
- KEY_H,
- KEY_J,
- KEY_K,
- KEY_L,
- KEY_SEMICOLON,
- KEY_APOSTROPHE, // 40
- KEY_GRAVE,
- KEY_LSHIFT,
- KEY_BACKSLASH,
- KEY_Z,
- KEY_X,
- KEY_C,
- KEY_V,
- KEY_B,
- KEY_N,
- KEY_M,
- KEY_COMMA,
- KEY_PERIOD,
- KEY_SLASH,
- KEY_RSHIFT,
- KEY_MULTIPLY,
- KEY_LALT,
- KEY_SPACE,
- KEY_CAPITAL,
- KEY_F1,
- KEY_F2, // 60
- KEY_F3,
- KEY_F4,
- KEY_F5,
- KEY_F6,
- KEY_F7,
- KEY_F8,
- KEY_F9,
- KEY_F10,
- KEY_NUMLOCK,
- KEY_SCROLL, // 70
- KEY_NUMPAD7,
- KEY_NUMPAD8,
- KEY_NUMPAD9,
- KEY_NUMPADSUBTRACT,
- KEY_NUMPAD4,
- KEY_NUMPAD5,
- KEY_NUMPAD6,
- KEY_NUMPADADD,
- KEY_NUMPAD1,
- KEY_NUMPAD2, // 80
- KEY_NUMPAD3,
- KEY_NUMPAD0,
- KEY_NUMPADDECIMAL,
- KEY_NOOP,
- KEY_ZENKAKUHANKAKU,
- KEY_102ND,
- KEY_F11,
- KEY_F12,
- KEY_F13,
- KEY_F14, // 90
- KEY_HIRAGANA,
- KEY_HENKAN,
- KEY_KATAKANAHIRAGANA,
- KEY_MUHENKAN,
- KEY_KPJPCOMMA,
- KEY_NUMPADENTER,
- KEY_RCONTROL,
- KEY_NUMPADDIVIDE,
- KEY_PRINTSCREEN,
- KEY_RALT, // 100
- KEY_LINEFEED,
- KEY_HOME,
- KEY_UP,
- KEY_PGUP,
- KEY_LEFT,
- KEY_RIGHT,
- KEY_END,
- KEY_DOWN,
- KEY_PGDN,
- KEY_INSERT, // 110
- KEY_DELETE,
- KEY_MACRO,
- KEY_MUTE,
- KEY_VOLUMEDOWN,
- KEY_VOLUMEUP,
- KEY_POWER,
- KEY_KPEQUAL,
- KEY_KPPLUSMINUS,
- KEY_PAUSE,
- KEY_SCALE,
- KEY_TOTAL_COUNT
-} EKeyCode;
-
-//==============================================================================
-/**
- * Keyboard modifier flags
- */
-enum EKeyboardModifierFlags {
- MODIFIER_NONE = 0,
- MODIFIER_SHIFT = 1 << 0,
- MODIFIER_CTRL = 1 << 1,
- MODIFIER_ALT = 1 << 2,
- MODIFIER_KEYDOWN = 1 << 3, ///< One or more key is down
-};
-
-//==============================================================================
-/**
- * Button codes
- */
-enum EButtonCodes {
- BUTTON_A = 0,
- BUTTON_B,
- BUTTON_X,
- BUTTON_Y,
- BUTTON_L1,
- BUTTON_R1,
- BUTTON_THUMBL,
- BUTTON_THUMBR,
- BUTTON_SELECT,
- BUTTON_START,
- BUTTON_MODE,
- BUTTON_UP,
- BUTTON_DOWN,
- BUTTON_LEFT,
- BUTTON_RIGHT,
- BUTTON_CENTER,
- BUTTON_ENTER,
- BUTTON_TOTAL_COUNT
-};
-
-//==============================================================================
-/**
- * Axis codes
- */
-enum EAxisCodes {
- AXIS_X = 0,
- AXIS_Y,
- AXIS_Z,
- AXIS_RZ,
- AXIS_HAT_X,
- AXIS_HAT_Y,
- AXIS_LTRIGGER,
- AXIS_RTRIGGER,
- AXIS_TOTAL_COUNT
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.cpp
deleted file mode 100644
index d3cbe423..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.cpp
+++ /dev/null
@@ -1,849 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-#include <EASTL/list.h>
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSInputEngine.h"
-#include "Qt3DSSceneManager.h"
-#include "Qt3DSInputEventTypes.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSRuntimeFactory.h"
-#include "EventPollingSystem.h"
-#include "foundation/Qt3DSAssert.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-class CInputEventProvider : public qt3ds::evt::IEventProvider
-{
- int m_RefCount;
-
-public:
- CInputEventProvider()
- : m_RefCount(0)
- {
- }
- ~CInputEventProvider()
- {
- while (!m_Events.empty()) {
- delete m_Events.front();
- m_Events.pop_front();
- }
- }
- struct SEvent
- {
- enum EType { TYPE_NONE = 0, TYPE_KEYBOARD, TYPE_BUTTON, TYPE_COUNT };
- SEvent(EType inType)
- : m_Type(inType)
- {
- }
- EType m_Type;
-
- virtual SEvent *Clone() const = 0;
- virtual Qt3DSEventSystemEvent *GenEventSystemEvent(qt3ds::evt::IEventFactory &inFactory) = 0;
- };
- struct SKeyboardEvent : public SEvent
- {
- SKeyboardEvent()
- : SEvent(TYPE_KEYBOARD)
- , m_KeyCode(KEY_NOKEY)
- , m_KeyEvent(0)
- {
- }
- SKeyboardEvent(INT32 inKeyCode, UINT32 inKeyEvent)
- : SEvent(TYPE_KEYBOARD)
- , m_KeyCode(inKeyCode)
- , m_KeyEvent(inKeyEvent)
- {
- }
- SEvent *Clone() const override
- {
- return new SKeyboardEvent(this->m_KeyCode, this->m_KeyEvent);
- }
- Qt3DSEventSystemEvent *GenEventSystemEvent(qt3ds::evt::IEventFactory &inFactory) override
- {
- if (m_KeyEvent == ON_KEYDOWN || m_KeyEvent == ON_KEYUP || m_KeyEvent == ON_KEYREPEAT) {
- Qt3DSEventSystemEvent &theEvent = inFactory.CreateEvent(3);
- int theIndex = 0;
- theEvent.m_Data[theIndex].m_Name = inFactory.RegisterStr("category");
- theEvent.m_Data[theIndex].m_Value.m_Type = QT3DSEventSystemEventTypesString;
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("kb");
- ++theIndex;
- theEvent.m_Data[theIndex].m_Name = inFactory.RegisterStr("code");
- theEvent.m_Data[theIndex].m_Value.m_Type = QT3DSEventSystemEventTypesNumber;
- theEvent.m_Data[theIndex].m_Value.m_Number = m_KeyCode;
- ++theIndex;
- theEvent.m_Data[theIndex].m_Name = inFactory.RegisterStr("action");
- theEvent.m_Data[theIndex].m_Value.m_Type = QT3DSEventSystemEventTypesString;
- if (m_KeyEvent == ON_KEYDOWN)
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("down");
- else if (m_KeyEvent == ON_KEYUP)
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("up");
- else if (m_KeyEvent == ON_KEYREPEAT)
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("repeat");
- ++theIndex;
- return &theEvent;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
- INT32 m_KeyCode;
- UINT32 m_KeyEvent;
- };
- struct SButtonEvent : public SEvent
- {
- SButtonEvent()
- : SEvent(TYPE_BUTTON)
- , m_ButtonCode(BUTTON_TOTAL_COUNT)
- , m_ButtonEvent(0)
- {
- }
- SButtonEvent(INT32 inButtonCode, UINT32 inButtonEvent)
- : SEvent(TYPE_BUTTON)
- , m_ButtonCode(inButtonCode)
- , m_ButtonEvent(inButtonEvent)
- {
- }
- SEvent *Clone() const override
- {
- return new SKeyboardEvent(this->m_ButtonCode, this->m_ButtonEvent);
- }
- Qt3DSEventSystemEvent *GenEventSystemEvent(qt3ds::evt::IEventFactory &inFactory) override
- {
- if (m_ButtonEvent == ON_BUTTONDOWN || m_ButtonEvent == ON_BUTTONUP
- || m_ButtonEvent == ON_BUTTONREPEAT) {
- Qt3DSEventSystemEvent &theEvent = inFactory.CreateEvent(3);
- int theIndex = 0;
- theEvent.m_Data[theIndex].m_Name = inFactory.RegisterStr("category");
- theEvent.m_Data[theIndex].m_Value.m_Type = QT3DSEventSystemEventTypesString;
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("button");
- ++theIndex;
- theEvent.m_Data[theIndex].m_Name = inFactory.RegisterStr("code");
- theEvent.m_Data[theIndex].m_Value.m_Type = QT3DSEventSystemEventTypesNumber;
- theEvent.m_Data[theIndex].m_Value.m_Number = m_ButtonCode;
- ++theIndex;
- theEvent.m_Data[theIndex].m_Name = inFactory.RegisterStr("action");
- theEvent.m_Data[theIndex].m_Value.m_Type = QT3DSEventSystemEventTypesString;
- if (m_ButtonEvent == ON_BUTTONDOWN)
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("down");
- else if (m_ButtonEvent == ON_BUTTONUP)
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("up");
- else if (m_ButtonEvent == ON_BUTTONREPEAT)
- theEvent.m_Data[theIndex].m_Value.m_String = inFactory.AllocateStr("repeat");
- ++theIndex;
- return &theEvent;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
- INT32 m_ButtonCode;
- UINT32 m_ButtonEvent;
- };
- size_t GetNextEvents(qt3ds::evt::IEventFactory &inFactory, Qt3DSEventSystemEvent **outBuffer,
- size_t inBufLenInEvent) override
- {
- size_t theEventCount = 0;
- while (!m_Events.empty() && inBufLenInEvent--) {
- SEvent *theBufferedEvent = m_Events.front();
- Qt3DSEventSystemEvent *theEventSystemEvent =
- theBufferedEvent->GenEventSystemEvent(inFactory);
- if (theEventSystemEvent)
- outBuffer[theEventCount++] = theEventSystemEvent;
- m_Events.pop_front();
- }
- return theEventCount;
- }
-
- void addRef() { ++m_RefCount; }
-
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0)
- delete this;
- }
-
- void Release() override { release(); }
-
- void AddEvent(const SEvent &inEvent)
- {
- SEvent *theEvent = inEvent.Clone();
- if (theEvent)
- m_Events.push_back(theEvent);
- else
- QT3DS_ASSERT(false);
- }
-
-private:
- eastl::list<SEvent *> m_Events;
-};
-
-//==============================================================================
-/**
- * Constructor
- */
-CInputEngine::CInputEngine()
- : m_BeginPickInput(false)
- , m_Application(NULL)
- , m_InputEventProvider(NULL)
-{
- m_InputFrame.m_PickValid = false;
- m_InputFrame.m_PickX = 0;
- m_InputFrame.m_PickY = 0;
-
- // TODO: SK - To quickly restore functionality, but this is should be in tegra-specific project.
- m_InputFrame.m_DeltaX = 0;
- m_InputFrame.m_DeltaY = 0;
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CInputEngine::~CInputEngine()
-{
-}
-
-//==============================================================================
-/**
- * Set the top-level interface of the Runtime object
- * @param inRuntime the top-level interface of the Runtime object
- */
-void CInputEngine::SetApplication(qt3ds::runtime::IApplication *inApplication)
-{
- m_Application = inApplication;
- // Create this here. If we die before the application does, then the system will crash unless
- // the application event system is reponsibe for the keyboard provider. Since the provider
- // never
- // access back to this object, this is the most sensible relationship. Furthermore if we have
- // never been given an application, it doesn't make sense to have a keyboard event provider.
- // In reality, this entire system should be ref counted.
- m_InputEventProvider = new CInputEventProvider();
-
- // Add a ref for the event system because it does not add its own ref.
- m_InputEventProvider->addRef();
- m_Application->GetRuntimeFactory().GetEventSystem().AddProvider(*m_InputEventProvider);
- MarkApplicationDirty();
-}
-
-//==============================================================================
-/**
- * Get the input information for the current frame
- * @return the SInputFrame that defines the current frame input information
- */
-SInputFrame &CInputEngine::GetInputFrame()
-{
- return m_InputFrame;
-}
-
-//==============================================================================
-/**
- * Return the key input portion of the input frame.
- */
-SKeyInputFrame &CInputEngine::GetKeyInputFrame()
-{
- return m_InputFrame.m_KeyInputFrame;
-}
-
-void CInputEngine::BeginPickInput()
-{
- m_PickInput.clear();
- m_BeginPickInput = true;
-}
-
-//==============================================================================
-/**
- * Set the pick information the the input frame structure
- * @param inX the X value of the pick position
- * @param inY the Y value of the pick position
- * @param inValid whether the X and Y value are valid
- */
-void CInputEngine::SetPickInput(FLOAT inX, FLOAT inY, BOOL inValid /*= true*/)
-{
- m_InputFrame.m_PickValid = inValid;
- m_InputFrame.m_PickX = inX;
- m_InputFrame.m_PickY = inY;
- m_InputFrame.m_MouseFlags = 0;
- MarkApplicationDirty();
- if (m_BeginPickInput && m_PickInput.size() < 1000)
- m_PickInput.push_back(eastl::make_pair(inX, inY));
-}
-
-void CInputEngine::EndPickInput()
-{
- m_BeginPickInput = false;
-}
-
-CInputEngine::TPickInputList CInputEngine::GetPickInput() const
-{
- return qt3ds::foundation::toDataRef(m_PickInput.data(), m_PickInput.size());
-}
-
-//==============================================================================
-/**
- * Set the mouse button state flag
- * @param inFlags the current mouse state
- */
-void CInputEngine::SetPickFlags(INT32 inFlags)
-{
- m_InputFrame.m_MouseFlags |= inFlags;
-}
-
-//==============================================================================
-/**
- * Set the keyboard status
- * @param inKeyCode the identifier of the key
- * @param inDown identify whether the key is down
- */
-void CInputEngine::SetKeyState(INT32 inKeyCode, BOOL inDown)
-{
- if (!inDown)
- m_InputFrame.m_KeyInputFrame.m_KeyStates.erase(inKeyCode);
- else {
- SKeyInputFrame::MAP_KEYCODE_COUNT::iterator theIter =
- m_InputFrame.m_KeyInputFrame.m_KeyStates.find(inKeyCode);
- if (theIter == m_InputFrame.m_KeyInputFrame.m_KeyStates.end())
- m_InputFrame.m_KeyInputFrame.m_KeyStates.insert(
- eastl::make_pair<INT32, UINT16>(inKeyCode, 1));
- else if (theIter->second < 255)
- ++theIter->second;
- }
- MarkApplicationDirty();
-}
-
-//==============================================================================
-/**
- * Set the button status
- * @param inButtonCode the identifier of the button
- * @param inDown identify whether the button is down
- */
-void CInputEngine::SetButtonState(INT32 inButtonCode, BOOL inDown)
-{
- if (!inDown)
- m_InputFrame.m_ButtonStates.erase(inButtonCode);
- else {
- SInputFrame::MAP_BUTTONCODE_COUNT::iterator theIter =
- m_InputFrame.m_ButtonStates.find(inButtonCode);
- if (theIter == m_InputFrame.m_ButtonStates.end())
- m_InputFrame.m_ButtonStates.insert(eastl::make_pair<INT32, UINT16>(inButtonCode, 1));
- else if (theIter->second < 255)
- ++theIter->second;
- }
- MarkApplicationDirty();
-}
-
-//==============================================================================
-/**
- * Set the scroll value
- * @param inMouseFlag flag to indicate whether this is a vertical or horizontal
- *scroll
- * @param inValue value of scroll performed
- */
-void CInputEngine::SetScrollValue(INT32 inMouseFlag, INT16 inValue)
-{
- m_InputFrame.m_MouseFlags = inMouseFlag;
- m_InputFrame.m_ScrollValue = inValue;
- MarkApplicationDirty();
-}
-//==============================================================================
-/**
- * Set whether the keyboard is modified
- * @param inFlag true if the keyboard status is modified
- */
-void CInputEngine::SetModifierFlag(INT32 inFlag)
-{
- m_InputFrame.m_KeyInputFrame.m_ModifierFlags |= inFlag;
-}
-
-// Currently unused
-//==============================================================================
-/**
- * Converts KeyCode in index format to ASCII format.
- * This will translate upper/lower-case letters too.
- * @param inKeyCode the index format keycode
- * @param inShift whether the shift button is pressed
- * @return the ASCII format keycode
- */
-// INT32 CInputEngine::ConvertKeyCode( INT32 inKeyCode, BOOL inShift )
-//{
-// static INT32 s_ASCIILowerCase[] =
-// {
-// 0,//KEY_NOKEY = 0x00,
-// 27,//KEY_ESCAPE,
-// '1',//KEY_1,
-// '2',//KEY_2,
-// '3',//KEY_3,
-// '4',//KEY_4,
-// '5',//KEY_5,
-// '6',//KEY_6,
-// '7',//KEY_7,
-// '8',//KEY_8,
-// '9',//KEY_9,
-// '0',//KEY_0,
-// '-',//KEY_MINUS, /* - on main keyboard */
-// '=',//KEY_EQUALS,
-// 8,//KEY_BACK, /* backspace */
-// '\t',//KEY_TAB,
-// 'q',//KEY_Q,
-// 'w',//KEY_W,
-// 'e',//KEY_E,
-// 'r',//KEY_R,
-// 't',//KEY_T,
-// 'y',//KEY_Y,
-// 'u',//KEY_U,
-// 'i',//KEY_I,
-// 'o',//KEY_O,
-// 'p',//KEY_P,
-// '[',//KEY_LBRACKET,
-// ']',//KEY_RBRACKET,
-// '\n',//KEY_RETURN, /* Enter on main keyboard */
-// 0,//KEY_LCONTROL,
-// 'a',//KEY_A,
-// 's',//KEY_S,
-// 'd',//KEY_D,
-// 'f',//KEY_F,
-// 'g',//KEY_G,
-// 'h',//KEY_H,
-// 'j',//KEY_J,
-// 'k',//KEY_K,
-// 'l',//KEY_L,
-// ';',//KEY_SEMICOLON,
-// '\'',//KEY_APOSTROPHE,
-// '`',//KEY_GRAVE, /* accent grave */
-// 0,//KEY_LSHIFT,
-// '\\',//KEY_BACKSLASH,
-// 'z',//KEY_Z,
-// 'x',//KEY_X,
-// 'c',//KEY_C,
-// 'v',//KEY_V,
-// 'b',//KEY_B,
-// 'n',//KEY_N,
-// 'm',//KEY_M,
-// ',',//KEY_COMMA,
-// '.',//KEY_PERIOD, /* . on main keyboard */
-// '/',//KEY_SLASH, /* / on main keyboard */
-// 0,//KEY_RSHIFT,
-// '*',//KEY_MULTIPLY, /* * on numeric keypad */
-// 0,//KEY_LMENU, /* left Alt */
-// ' ',//KEY_SPACE,
-// 0,//KEY_CAPITAL,
-// 0,//KEY_F1,
-// 0,//KEY_F2,
-// 0,//KEY_F3,
-// 0,//KEY_F4,
-// 0,//KEY_F5,
-// 0,//KEY_F6,
-// 0,//KEY_F7,
-// 0,//KEY_F8,
-// 0,//KEY_F9,
-// 0,//KEY_F10,
-// 0,//KEY_NUMLOCK,
-// 0,//KEY_SCROLL, /* Scroll Lock */
-// '7',//KEY_NUMPAD7,
-// '8',//KEY_NUMPAD8,
-// '9',//KEY_NUMPAD9,
-// '-',//KEY_SUBTRACT, /* - on numeric keypad */
-// '4',//KEY_NUMPAD4,
-// '5',//KEY_NUMPAD5,
-// '6',//KEY_NUMPAD6,
-// '+',//KEY_ADD, /* + on numeric keypad */
-// '1',//KEY_NUMPAD1,
-// '2',//KEY_NUMPAD2,
-// '3',//KEY_NUMPAD3,
-// '0',//KEY_NUMPAD0,
-// '.',//KEY_DECIMAL, /* . on numeric keypad */
-// 0,//KEY_OEM_102, /* <> or \| on RT 102-key keyboard (Non-U.S.) */
-// 0,//KEY_F11,
-// 0,//KEY_F12,
-// 0,//KEY_F13, /* (NEC PC98) */
-// 0,//KEY_F14, /* (NEC PC98) */
-// 0,//KEY_F15, /* (NEC PC98) */
-// 0,//KEY_KANA, /* (Japanese keyboard) */
-// 0,//KEY_ABNT_C1, /* /? on Brazilian keyboard */
-// 0,//KEY_CONVERT, /* (Japanese keyboard) */
-// 0,//KEY_NOCONVERT, /* (Japanese keyboard) */
-// 0,//KEY_YEN, /* (Japanese keyboard) */
-// 0,//KEY_ABNT_C2, /* Numpad . on Brazilian keyboard */
-// 0,//KEY_NUMPADEQUALS, /* = on numeric keypad (NEC PC98) */
-// 0,//KEY_PREVTRACK, /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
-// 0,//KEY_AT, /* (NEC PC98) */
-// 0,//KEY_COLON, /* (NEC PC98) */
-// 0,//KEY_UNDERLINE, /* (NEC PC98) */
-// 0,//KEY_KANJI, /* (Japanese keyboard) */
-// 0,//KEY_STOP, /* (NEC PC98) */
-// 0,//KEY_AX, /* (Japan AX) */
-// 0,//KEY_UNLABELED, /* (J3100) */
-// 0,//KEY_NEXTTRACK, /* Next Track */
-// 0,//KEY_NUMPADENTER, /* Enter on numeric keypad */
-// 0,//KEY_RCONTROL,
-// 0,//KEY_MUTE, /* Mute */
-// 0,//KEY_CALCULATOR, /* Calculator */
-// 0,//KEY_PLAYPAUSE, /* Play / Pause */
-// 0,//KEY_MEDIASTOP, /* Media Stop */
-// 0,//KEY_VOLUMEDOWN, /* Volume - */
-// 0,//KEY_VOLUMEUP, /* Volume + */
-// 0,//KEY_WEBHOME, /* Web home */
-// 0,//KEY_NUMPADCOMMA, /* , on numeric keypad (NEC PC98) */
-// 0,//KEY_DIVIDE, /* / on numeric keypad */
-// 0,//KEY_SYSRQ,
-// 0,//KEY_RMENU, /* right Alt */
-// 0,//KEY_PAUSE, /* Pause */
-// 0,//KEY_HOME, /* Home on arrow keypad */
-// 0,//KEY_UP, /* UpArrow on arrow keypad */
-// 0,//KEY_PRIOR, /* PgUp on arrow keypad */
-// 0,//KEY_LEFT, /* LeftArrow on arrow keypad */
-// 0,//KEY_RIGHT, /* RightArrow on arrow keypad */
-// 0,//KEY_END, /* End on arrow keypad */
-// 0,//KEY_DOWN, /* DownArrow on arrow keypad */
-// 0,//KEY_NEXT, /* PgDn on arrow keypad */
-// 0,//KEY_INSERT, /* Insert on arrow keypad */
-// 127,//KEY_DELETE, /* Delete on arrow keypad */
-// 0,//KEY_LWIN, /* Left Windows key */
-// 0,//KEY_RWIN, /* Right Windows key */
-// 0,//KEY_APPS, /* AppMenu key */
-// 0,//KEY_POWER, /* System Power */
-// 0,//KEY_SLEEP, /* System Sleep */
-// 0,//KEY_WAKE, /* System Wake */
-// 0,//KEY_WEBSEARCH, /* Web Search */
-// 0,//KEY_WEBFAVORITES, /* Web Favorites */
-// 0,//KEY_WEBREFRESH, /* Web Refresh */
-// 0,//KEY_WEBSTOP, /* Web Stop */
-// 0,//KEY_WEBFORWARD, /* Web Forward */
-// 0,//KEY_WEBBACK, /* Web Back */
-// 0,//KEY_MYCOMPUTER, /* My Computer */
-// 0,//KEY_MAIL, /* Mail */
-// 0//KEY_MEDIASELECT, /* Media Select */
-// };
-//
-// static INT32 s_ASCIIUpperCase[] =
-// {
-// 0,//KEY_NOKEY = 0x00,
-// 27,//KEY_ESCAPE,
-// '!',//KEY_1,
-// '@',//KEY_2,
-// '#',//KEY_3,
-// '$',//KEY_4,
-// '%',//KEY_5,
-// '^',//KEY_6,
-// '&',//KEY_7,
-// '*',//KEY_8,
-// '(',//KEY_9,
-// ')',//KEY_0,
-// '_',//KEY_MINUS, /* - on main keyboard */
-// '+',//KEY_EQUALS,
-// 8,//KEY_BACK, /* backspace */
-// '\t',//KEY_TAB,
-// 'Q',//KEY_Q,
-// 'W',//KEY_W,
-// 'E',//KEY_E,
-// 'R',//KEY_R,
-// 'T',//KEY_T,
-// 'Y',//KEY_Y,
-// 'U',//KEY_U,
-// 'I',//KEY_I,
-// 'O',//KEY_O,
-// 'P',//KEY_P,
-// '{',//KEY_LBRACKET,
-// '}',//KEY_RBRACKET,
-// '\n',//KEY_RETURN, /* Enter on main keyboard */
-// 0,//KEY_LCONTROL,
-// 'A',//KEY_A,
-// 'S',//KEY_S,
-// 'D',//KEY_D,
-// 'F',//KEY_F,
-// 'G',//KEY_G,
-// 'H',//KEY_H,
-// 'J',//KEY_J,
-// 'K',//KEY_K,
-// 'L',//KEY_L,
-// ':',//KEY_SEMICOLON,
-// '\"',//KEY_APOSTROPHE,
-// '~',//KEY_GRAVE, /* accent grave */
-// 0,//KEY_LSHIFT,
-// '|',//KEY_BACKSLASH,
-// 'Z',//KEY_Z,
-// 'X',//KEY_X,
-// 'C',//KEY_C,
-// 'V',//KEY_V,
-// 'B',//KEY_B,
-// 'N',//KEY_N,
-// 'M',//KEY_M,
-// '<',//KEY_COMMA,
-// '>',//KEY_PERIOD, /* . on main keyboard */
-// '?',//KEY_SLASH, /* / on main keyboard */
-// 0,//KEY_RSHIFT,
-// '*',//KEY_MULTIPLY, /* * on numeric keypad */
-// 0,//KEY_LMENU, /* left Alt */
-// ' ',//KEY_SPACE,
-// 0,//KEY_CAPITAL,
-// 0,//KEY_F1,
-// 0,//KEY_F2,
-// 0,//KEY_F3,
-// 0,//KEY_F4,
-// 0,//KEY_F5,
-// 0,//KEY_F6,
-// 0,//KEY_F7,
-// 0,//KEY_F8,
-// 0,//KEY_F9,
-// 0,//KEY_F10,
-// 0,//KEY_NUMLOCK,
-// 0,//KEY_SCROLL, /* Scroll Lock */
-// '7',//KEY_NUMPAD7,
-// '8',//KEY_NUMPAD8,
-// '9',//KEY_NUMPAD9,
-// '-',//KEY_SUBTRACT, /* - on numeric keypad */
-// '4',//KEY_NUMPAD4,
-// '5',//KEY_NUMPAD5,
-// '6',//KEY_NUMPAD6,
-// '+',//KEY_ADD, /* + on numeric keypad */
-// '1',//KEY_NUMPAD1,
-// '2',//KEY_NUMPAD2,
-// '3',//KEY_NUMPAD3,
-// '0',//KEY_NUMPAD0,
-// '.',//KEY_DECIMAL, /* . on numeric keypad */
-// 0,//KEY_OEM_102, /* <> or \| on RT 102-key keyboard (Non-U.S.) */
-// 0,//KEY_F11,
-// 0,//KEY_F12,
-// 0,//KEY_F13, /* (NEC PC98) */
-// 0,//KEY_F14, /* (NEC PC98) */
-// 0,//KEY_F15, /* (NEC PC98) */
-// 0,//KEY_KANA, /* (Japanese keyboard) */
-// 0,//KEY_ABNT_C1, /* /? on Brazilian keyboard */
-// 0,//KEY_CONVERT, /* (Japanese keyboard) */
-// 0,//KEY_NOCONVERT, /* (Japanese keyboard) */
-// 0,//KEY_YEN, /* (Japanese keyboard) */
-// 0,//KEY_ABNT_C2, /* Numpad . on Brazilian keyboard */
-// 0,//KEY_NUMPADEQUALS, /* = on numeric keypad (NEC PC98) */
-// 0,//KEY_PREVTRACK, /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
-// 0,//KEY_AT, /* (NEC PC98) */
-// 0,//KEY_COLON, /* (NEC PC98) */
-// 0,//KEY_UNDERLINE, /* (NEC PC98) */
-// 0,//KEY_KANJI, /* (Japanese keyboard) */
-// 0,//KEY_STOP, /* (NEC PC98) */
-// 0,//KEY_AX, /* (Japan AX) */
-// 0,//KEY_UNLABELED, /* (J3100) */
-// 0,//KEY_NEXTTRACK, /* Next Track */
-// 0,//KEY_NUMPADENTER, /* Enter on numeric keypad */
-// 0,//KEY_RCONTROL,
-// 0,//KEY_MUTE, /* Mute */
-// 0,//KEY_CALCULATOR, /* Calculator */
-// 0,//KEY_PLAYPAUSE, /* Play / Pause */
-// 0,//KEY_MEDIASTOP, /* Media Stop */
-// 0,//KEY_VOLUMEDOWN, /* Volume - */
-// 0,//KEY_VOLUMEUP, /* Volume + */
-// 0,//KEY_WEBHOME, /* Web home */
-// 0,//KEY_NUMPADCOMMA, /* , on numeric keypad (NEC PC98) */
-// 0,//KEY_DIVIDE, /* / on numeric keypad */
-// 0,//KEY_SYSRQ,
-// 0,//KEY_RMENU, /* right Alt */
-// 0,//KEY_PAUSE, /* Pause */
-// 0,//KEY_HOME, /* Home on arrow keypad */
-// 0,//KEY_UP, /* UpArrow on arrow keypad */
-// 0,//KEY_PRIOR, /* PgUp on arrow keypad */
-// 0,//KEY_LEFT, /* LeftArrow on arrow keypad */
-// 0,//KEY_RIGHT, /* RightArrow on arrow keypad */
-// 0,//KEY_END, /* End on arrow keypad */
-// 0,//KEY_DOWN, /* DownArrow on arrow keypad */
-// 0,//KEY_NEXT, /* PgDn on arrow keypad */
-// 0,//KEY_INSERT, /* Insert on arrow keypad */
-// 127,//KEY_DELETE, /* Delete on arrow keypad */
-// 0,//KEY_LWIN, /* Left Windows key */
-// 0,//KEY_RWIN, /* Right Windows key */
-// 0,//KEY_APPS, /* AppMenu key */
-// 0,//KEY_POWER, /* System Power */
-// 0,//KEY_SLEEP, /* System Sleep */
-// 0,//KEY_WAKE, /* System Wake */
-// 0,//KEY_WEBSEARCH, /* Web Search */
-// 0,//KEY_WEBFAVORITES, /* Web Favorites */
-// 0,//KEY_WEBREFRESH, /* Web Refresh */
-// 0,//KEY_WEBSTOP, /* Web Stop */
-// 0,//KEY_WEBFORWARD, /* Web Forward */
-// 0,//KEY_WEBBACK, /* Web Back */
-// 0,//KEY_MYCOMPUTER, /* My Computer */
-// 0,//KEY_MAIL, /* Mail */
-// 0//KEY_MEDIASELECT, /* Media Select */
-// };
-//
-// if ( inKeyCode < 0 || inKeyCode > KEY_TOTAL_COUNT )
-// return 0;
-//
-// if ( inShift )
-// return s_ASCIIUpperCase[inKeyCode];
-//
-// return s_ASCIILowerCase[inKeyCode];
-//}
-
-//==============================================================================
-/**
- * Clear the current input frame data, typically after the event has been processed.
- */
-void CInputEngine::ClearInputFrame()
-{
- // TODO: SK - To quickly restore functionality, but this is should be in tegra-specific project.
- m_InputFrame.m_PickValid = false;
-}
-
-//==============================================================================
-/**
- * Can be more appropriately named and perhaps moved to a COutputEngine class.
- * to translate event triggered from script back to a "device" event
- * e.g to simulate clicking on Home button.
- *
- * Base class does nothing.
- */
-BOOL CInputEngine::TranslateEvent(const CHAR *inEvent)
-{
- Q3DStudio_UNREFERENCED_PARAMETER(inEvent);
- return false;
-}
-
-//==============================================================================
-/**
- * Handle firing of keyboard events when a scancode is received.
- */
-void CInputEngine::HandleKeyboard(INT32 inKeyCode, INT32 inPressed, INT32 inRepeat)
-{
- if (inKeyCode >= KEY_TOTAL_COUNT || inKeyCode <= KEY_NOKEY) {
- qCDebug(qt3ds::TRACE_INFO)
- << "Input: Key input out of range. key code: " << inKeyCode
- << " pressed: " << inPressed << " repeat: " << inRepeat;
- }
- if (m_Application == NULL)
- return;
- MarkApplicationDirty();
-
- SetKeyState(inKeyCode, inPressed ? true : false);
-
- CPresentation *theActivePresentation(m_Application->GetPrimaryPresentation());
- if (theActivePresentation) {
- TElement *theScene = theActivePresentation->GetRoot();
- UVariant theKeycode;
- theKeycode.m_INT32 = inKeyCode;
-
- TEventCommandHash theEvent;
- if (inPressed) {
- UINT16 theKeyCount = m_InputFrame.m_KeyInputFrame.GetKeyCount(inKeyCode);
- QT3DS_ASSERT(theKeyCount >= 1);
- if (theKeyCount == 1 && inRepeat == 0)
- theEvent = ON_KEYDOWN;
- else
- theEvent = ON_KEYREPEAT;
- } else {
- theEvent = ON_KEYUP;
- }
-
- theActivePresentation->FireEvent(theEvent, theScene, &theKeycode, NULL, ATTRIBUTETYPE_INT32,
- ATTRIBUTETYPE_NONE);
- if (m_InputEventProvider)
- m_InputEventProvider->AddEvent(
- CInputEventProvider::SKeyboardEvent(theKeycode.m_INT32, theEvent));
- }
-}
-
-//==============================================================================
-/**
- * Handle button events.
- */
-void CInputEngine::HandleButton(INT32 inButtonCode, INT32 inPressed, INT32 inRepeat)
-{
- if (inButtonCode >= BUTTON_TOTAL_COUNT || inButtonCode < 0) {
- qCDebug(qt3ds::TRACE_INFO)
- << "Input: Key input out of range. key code: " << inButtonCode
- << " pressed: " << inPressed << " repeat: " << inRepeat;
- }
- if (m_Application == NULL)
- return;
- MarkApplicationDirty();
-
- SetButtonState(inButtonCode, inPressed ? true : false);
-
- CPresentation *theActivePresentation(m_Application->GetPrimaryPresentation());
- if (theActivePresentation) {
- TElement *theScene = theActivePresentation->GetRoot();
- UVariant theButtonCode;
- theButtonCode.m_INT32 = inButtonCode;
-
- TEventCommandHash theEvent;
- if (inPressed) {
- if (inRepeat == 0)
- theEvent = ON_BUTTONDOWN;
- else
- theEvent = ON_BUTTONREPEAT;
- } else {
- theEvent = ON_BUTTONUP;
- }
-
- theActivePresentation->FireEvent(theEvent, theScene, &theButtonCode, NULL,
- ATTRIBUTETYPE_INT32, ATTRIBUTETYPE_NONE);
- if (m_InputEventProvider)
- m_InputEventProvider->AddEvent(
- CInputEventProvider::SButtonEvent(theButtonCode.m_INT32, theEvent));
- }
-}
-
-//==============================================================================
-/**
- * Handle joystick events.
- */
-void CInputEngine::HandleAxis(INT32 inAxisCode, FLOAT inValue)
-{
- if (m_Application == NULL)
- return;
- MarkApplicationDirty();
- if (m_InputFrame.m_AxisStates[inAxisCode] != inValue) {
- m_InputFrame.m_AxisStates[inAxisCode] = inValue;
-
- CPresentation *theActivePresentation(m_Application->GetPrimaryPresentation());
- if (theActivePresentation) {
- TElement *theScene = theActivePresentation->GetRoot();
- UVariant theAxisCode;
- theAxisCode.m_INT32 = inAxisCode;
- UVariant theValue;
- theValue.m_FLOAT = inValue;
-
- theActivePresentation->FireEvent(ON_AXISMOVED, theScene, &theAxisCode, &theValue,
- ATTRIBUTETYPE_INT32, ATTRIBUTETYPE_FLOAT);
- }
- }
-}
-
-void CInputEngine::MarkApplicationDirty()
-{
- if (m_Application)
- m_Application->MarkApplicationDirty();
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.h
deleted file mode 100644
index bf75e5a1..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEngine.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSPickFrame.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "EASTL/vector.h"
-#include "foundation/Qt3DSDataRef.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace qt3ds {
-namespace runtime {
- class IApplication;
-}
-}
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class CRuntime;
-union UVariant;
-class CInputEventProvider;
-
-//==============================================================================
-/**
-* @class CInputEngine
-* @brief The basic input engine
-*/
-class CInputEngine
-{
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- SInputFrame m_InputFrame; ///< The data describing the input state
- eastl::vector<eastl::pair<float, float>> m_PickInput;
- bool m_BeginPickInput;
- qt3ds::runtime::IApplication *m_Application; ///< The Runtime object
- qt3ds::foundation::NVScopedRefCounted<CInputEventProvider>
- m_InputEventProvider; ///< The event provider for keyboard
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- typedef qt3ds::foundation::NVConstDataRef<const eastl::pair<float, float>> TPickInputList;
- CInputEngine();
- virtual ~CInputEngine();
-
-public: // Runtime interfaces
- void SetApplication(qt3ds::runtime::IApplication *inApplication);
-
-public:
- // Access
- virtual SInputFrame &GetInputFrame();
- virtual SKeyInputFrame &GetKeyInputFrame();
-
- // Setters
- // Multitouch is handled by using BeginPickInput, SetPickInput (several times), and EndPickInput
- // pairs.
- // The assumption here is that the pick input is static until changed. So to clear it you need
- // a
- // begin, end pair without any other pieces.
- virtual void BeginPickInput();
- virtual void SetPickInput(FLOAT inX, FLOAT inY, BOOL inValid = true);
- virtual void EndPickInput();
- virtual TPickInputList GetPickInput() const;
- virtual void SetPickFlags(INT32 inFlags);
- virtual void SetKeyState(INT32 inKeyCode, BOOL inDown);
- virtual void SetButtonState(INT32 inButtonCode, BOOL inDown);
- virtual void SetScrollValue(INT32 inFlags, INT16 value);
- virtual void SetModifierFlag(INT32 inFlag);
-
- // Keyboard hook
- virtual void HandleKeyboard(INT32 inKeyCode, INT32 inPressed, INT32 inRepeat = 0);
-
- // Other input
- virtual void HandleButton(INT32 inButtonCode, INT32 inPressed, INT32 inRepeat = 0);
- virtual void HandleAxis(INT32 inAxisCode, FLOAT inValue);
-
- // Helpers
- // virtual INT32 ConvertKeyCode( INT32 inKeyCode, BOOL inShift );
- // TODO: SK - To quickly restore functionality, but this is should be in tegra-specific project.
- virtual void ClearInputFrame();
- virtual BOOL TranslateEvent(const CHAR *inEvent);
-
- void MarkApplicationDirty();
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEventTypes.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEventTypes.h
deleted file mode 100644
index 0b3c3981..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputEventTypes.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSHash.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-// Mouse events
-const TEventCommandHash ON_MOUSEOVER = CHash::HashEventCommand("onMouseOver");
-const TEventCommandHash ON_MOUSEOUT = CHash::HashEventCommand("onMouseOut");
-const TEventCommandHash ON_GROUPEDMOUSEOVER = CHash::HashEventCommand("onGroupedMouseOver");
-const TEventCommandHash ON_GROUPEDMOUSEOUT = CHash::HashEventCommand("onGroupedMouseOut");
-
-// Crude hack to pretend mouse events are gesture events, since gesture events are all you
-// can specify in studio.
-// TODO: Fix properly, preferably by bringing back gesture support
-const TEventCommandHash ON_MOUSEDOWN = CHash::HashEventCommand("onPressureDown");
-const TEventCommandHash ON_MOUSEUP = CHash::HashEventCommand("onPressureUp");
-const TEventCommandHash ON_MOUSECLICK = CHash::HashEventCommand("onTap");
-const TEventCommandHash ON_MOUSEDBLCLICK = CHash::HashEventCommand("onDoubleTap");
-//const TEventCommandHash ON_MOUSEDOWN = CHash::HashEventCommand("onMouseDown");
-//const TEventCommandHash ON_MOUSEUP = CHash::HashEventCommand("onMouseUp");
-//const TEventCommandHash ON_MOUSECLICK = CHash::HashEventCommand("onMouseClick");
-//const TEventCommandHash ON_MOUSEDBLCLICK = CHash::HashEventCommand("onMouseDblClick");
-
-const TEventCommandHash ON_MIDDLEMOUSEDOWN = CHash::HashEventCommand("onMiddleMouseDown");
-const TEventCommandHash ON_MIDDLEMOUSEUP = CHash::HashEventCommand("onMiddleMouseUp");
-const TEventCommandHash ON_MIDDLEMOUSECLICK = CHash::HashEventCommand("onMiddleMouseClick");
-const TEventCommandHash ON_MIDDLEDBLMOUSECLICK = CHash::HashEventCommand("onMiddleMouseDblClick");
-
-const TEventCommandHash ON_RIGHTMOUSEDOWN = CHash::HashEventCommand("onRightMouseDown");
-const TEventCommandHash ON_RIGHTMOUSEUP = CHash::HashEventCommand("onRightMouseUp");
-const TEventCommandHash ON_RIGHTMOUSECLICK = CHash::HashEventCommand("onRightMouseClick");
-const TEventCommandHash ON_RIGHTDBLMOUSECLICK = CHash::HashEventCommand("onRightMouseDblClick");
-
-const TEventCommandHash ON_HORIZONTALSCROLLWHEEL =
- CHash::HashEventCommand("onHorizontalScrollWheel");
-const TEventCommandHash ON_VERTICALSCROLLWHEEL = CHash::HashEventCommand("onVerticalScrollWheel");
-
-const TEventCommandHash ON_KEYUP =
- CHash::HashEventCommand("onKeyUp"); ///< Studio's keyboard event string
-const TEventCommandHash ON_KEYDOWN =
- CHash::HashEventCommand("onKeyDown"); ///< Studio's keyboard event string
-const TEventCommandHash ON_KEYREPEAT =
- CHash::HashEventCommand("onKeyRepeat"); ///< Studio's keyboard event string
-
-const TEventCommandHash ON_BUTTONUP = CHash::HashEventCommand("onButtonUp");
-const TEventCommandHash ON_BUTTONDOWN = CHash::HashEventCommand("onButtonDown");
-const TEventCommandHash ON_BUTTONREPEAT = CHash::HashEventCommand("onButtonRepeat");
-
-const TEventCommandHash ON_AXISMOVED = CHash::HashEventCommand("onAxisMoved");
-
-// Used by UIContract
-const TEventCommandHash ON_LEFT = CHash::HashEventCommand("onLeft");
-const TEventCommandHash ON_RIGHT = CHash::HashEventCommand("onRight");
-const TEventCommandHash ON_UP = CHash::HashEventCommand("onUp");
-const TEventCommandHash ON_DOWN = CHash::HashEventCommand("onDown");
-const TEventCommandHash ON_BACK = CHash::HashEventCommand("onBack");
-const TEventCommandHash ON_SELECT = CHash::HashEventCommand("onSelect");
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputFrame.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputFrame.h
deleted file mode 100644
index f80f3ebc..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSInputFrame.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSPlatformSpecific.h"
-#include "Qt3DSInputDefs.h"
-
-#include <EASTL/map.h>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Input structure defining the values for keyboard input
- */
-struct SKeyInputFrame
-{
- UINT16 m_ModifierFlags; ///< Keyboard modifier state flags
- typedef eastl::map<INT32, UINT16> MAP_KEYCODE_COUNT;
- MAP_KEYCODE_COUNT
- m_KeyStates; ///< Keycode map representing number of frames since the keys are down
- ///< 0 - up, 255 - down for more than 254 frames
-
- SKeyInputFrame()
- : m_ModifierFlags(MODIFIER_NONE)
- {
- }
-
- UINT16 GetKeyCount(INT32 inKeyCode)
- {
- MAP_KEYCODE_COUNT::iterator theIter = m_KeyStates.find(inKeyCode);
- return theIter != m_KeyStates.end() ? theIter->second : 0;
- }
-};
-
-//==============================================================================
-/**
- * Input structure defining the values fed into input processing
- */
-struct SInputFrame
-{
- SKeyInputFrame m_KeyInputFrame; ///< Data for keyboard input
-
- typedef eastl::map<INT32, UINT16> MAP_BUTTONCODE_COUNT;
- MAP_BUTTONCODE_COUNT m_ButtonStates;
-
- FLOAT m_AxisStates[AXIS_TOTAL_COUNT];
-
- FLOAT m_PickX; ///< Horizontal screen location
- FLOAT m_PickY; ///< Vertical screen location
-
- INT32 m_MouseFlags; ///< Mouse button state flags
-
- // SK - gesture-specific variables should NOT be in core runtime, its tegra-specific
- INT32 m_GestureID; ///< a running counter/unique-id
- INT32 m_GestureKind; ///< Gesture state flags
-
- /* different gestures will interpret as different values. could be:
- * DRAG: delta position
- * FLICK: velocities
- * ZOOM: second finger or quantized delta */
- INT16 m_DeltaX;
- INT16 m_DeltaY;
-
- BOOL m_PickValid; ///< X and Y are valid inputs
- INT16 m_ScrollValue; //< Value of scrollwheel scrolled
-
- CHAR m_Padding[1];
-
- SInputFrame()
- : m_PickX(0)
- , m_PickY(0)
- , m_MouseFlags(NO_INPUT)
- , m_GestureID(0)
- , m_GestureKind(0)
- , m_DeltaX(0)
- , m_DeltaY(0)
- , m_PickValid(false)
- {
- Q3DStudio_memset(m_AxisStates, 0, sizeof(m_AxisStates));
- }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSKernelTypes.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSKernelTypes.h
deleted file mode 100644
index 0ad4ec61..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSKernelTypes.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSArray.h"
-
-namespace qt3ds {
-namespace runtime {
- namespace element {
- struct SElement;
- struct SComponent;
- }
-}
-}
-
-namespace Q3DStudio {
-typedef qt3ds::runtime::element::SElement TElement;
-typedef qt3ds::runtime::element::SComponent TComponent;
-}
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class CString;
-
-//==============================================================================
-// Typedefs
-//==============================================================================
-typedef CArray<TElement *> TElementList; ///< Dynamic list of CElements
-typedef CArray<const CString *> TEventList; ///< Dynamic list of CStrings
-typedef CArray<INT32> TAssociationList; ///< Dynamic list of IDs used for the association process
-
-typedef UINT32 TEventCommandHash; ///< Value from CHash::Hash31
-typedef UINT32 TStringHash; ///< Value from CHash::Hash
-typedef UINT32 TAttributeHash; ///< Value from CHash::Hash27
-typedef UINT32 THashValue; ///< 32 bit value indicating a hash
-
-//==============================================================================
-// Enumerations
-//==============================================================================
-
-/// Each attribute knows the type of its value and uses 4 bits for this enum
-enum EAttributeType {
- ATTRIBUTETYPE_NONE = 0,
- ATTRIBUTETYPE_INT32,
- ATTRIBUTETYPE_HASH,
- ATTRIBUTETYPE_FLOAT,
- ATTRIBUTETYPE_BOOL,
- ATTRIBUTETYPE_STRING,
- ATTRIBUTETYPE_POINTER,
- ATTRIBUTETYPE_ELEMENTREF,
- ATTRIBUTETYPE_DATADRIVEN_PARENT,
- ATTRIBUTETYPE_DATADRIVEN_CHILD,
- ATTRIBUTETYPE_FLOAT4,
- ATTRIBUTETYPE_FLOAT3,
- ATTRIBUTETYPE_FLOAT2,
- ATTRIBUTETYPE_DATAINPUT_TIMELINE,
- ATTRIBUTETYPE_DATAINPUT_SLIDE,
- ATTRIBUTETYPECOUNT
-};
-
-/// Elements represent various types of objects
-enum EElementType {
- ELEMENTTYPE_UNKNOWN = 0,
- ELEMENTTYPE_NODE,
- ELEMENTTYPE_CAMERA,
- ELEMENTTYPE_LIGHT,
- ELEMENTTYPE_TEXT,
- ELEMENTTYPE_MATERIAL,
- ELEMENTTYPE_TEXTURE,
- ELEMENTTYPE_COMPONENT,
- ELEMENTTYPE_BEHAVIOR,
- ELEMENTTYPE_PATH,
- ELEMENTTYPE_PATHANCHORPOINT,
- ELEMENTTYPE_SUBPATH,
- ELEMENTTYPECOUNT
-};
-
-//==============================================================================
-// Enumerations
-//==============================================================================
-
-/// Various bit flags packed into a single 16bit space.
-enum EElementFlag {
- // Persistent flags (set only at creation)
- ELEMENTFLAG_COMPONENT = 1, ///< Element is a component
- ELEMENTFLAG_TIMELINE = 1 << 1, ///< Element has start time and duration attributes
- ELEMENTFLAG_CLONE = 1 << 2, ///< Element is a clone
- ELEMENTFLAG_ATTRIBUTELOCK =
- 1 << 3, ///< No more attributes can be added (always true during runtime)
-
- // Configuration flags (seldom changed)
- ELEMENTFLAG_SCRIPTCALLBACKS = 1
- << 4, ///< At least one script has requested notify on onActivate, onDeactivate, onUpdate
- ELEMENTFLAG_SCRIPTINITIALIZE = 1
- << 5, ///< At least one script has requested notify on onInitialize
- ELEMENTFLAG_REGISTEREDFORATTRIBUTECHANGE = 1 << 6, ///< Element monitored for attribute change
- ELEMENTFLAG_REGISTEREDFOREVENTCALLBACK = 1 << 7, ///< Element registered for event callbacks
- ELEMENTFLAG_PICKENABLED = 1 << 8, ///< At least one script or action has registered for mouse
- ///events based on this element
-
- // Runtime flags
- ELEMENTFLAG_GLOBALACTIVE =
- 1 << 9, ///< Combination active flag based on explicit, time and parent active
- ELEMENTFLAG_EXPLICITACTIVE = 1 << 10, ///< Explicit On/Off switch on each element
- ELEMENTFLAG_PLAYTHROUGH = 1 << 11, ///< Playthrough slides enabled if this is a component
- ELEMENTFLAG_DIRTY = 1 << 12, ///< Attributes or user visible flags have changed
-
- // Flags used by the activation manager
- ELEMENTFLAG_AMGR_TIMEACTIVE = 1 << 13, ///< Is the element alive according to time information
-};
-
-// Four byte aligned time unit structure.
-struct SAlignedTimeUnit
-{
- UINT32 m_LowWord;
- UINT32 m_HighWord;
-
- SAlignedTimeUnit() {}
- SAlignedTimeUnit(const TTimeUnit &inUnit);
- SAlignedTimeUnit(const SAlignedTimeUnit &inOther)
- : m_LowWord(inOther.m_LowWord)
- , m_HighWord(inOther.m_HighWord)
- {
- }
- SAlignedTimeUnit &operator=(const SAlignedTimeUnit &inOther)
- {
- m_LowWord = inOther.m_LowWord;
- m_HighWord = inOther.m_HighWord;
- return *this;
- }
- operator TTimeUnit() const;
-
- void operator-=(const TTimeUnit &inTime);
- void operator%=(const TTimeUnit &inTime);
-};
-
-//==============================================================================
-// Defines
-//==============================================================================
-#define Q3DStudio_ATTRIBUTEKEYBITS 26 /* Number of bits to store attributes index */
-#define Q3DStudio_ATTRIBUTEKEYMASK 0x03ffffff /* Bit mask covering 26 bits */
-
-//==============================================================================
-// Structs
-//==============================================================================
-
-/// Each element has a number of attributes associated with it - This is the key.
-struct SAttributeKey
-{
- TAttributeHash m_Hash : Q3DStudio_ATTRIBUTEKEYBITS; ///< hash of attribute name
- TAttributeHash m_Type : 4; ///< Attribute type such as INT32, FLOAT, STRING
- TAttributeHash m_Dirty : 1; ///< Dirty bit signalling that the attribute value has been modified
- TAttributeHash
- m_DontOptimize : 1; ///< Used by the exporter/optimizer to flag attributes as un-optimizable
-
- void Convert(const UINT32 &inKey)
- {
- m_Hash = inKey & Q3DStudio_ATTRIBUTEKEYMASK;
- m_Type = (inKey & 0x3c000000) >> Q3DStudio_ATTRIBUTEKEYBITS;
- m_Dirty = (inKey & 0x40000000) >> (Q3DStudio_ATTRIBUTEKEYBITS + 4);
- m_DontOptimize = (inKey & 0x80000000) >> (Q3DStudio_ATTRIBUTEKEYBITS + 5);
- }
-};
-
-/// The structure to store a memory pool for clones.
-/// The actual data pool will start at the address after these 8 bytes.
-struct SClone
-{
- SClone *m_Next; ///< Pointer to the next block of memory
- UINT32 m_Size; ///< Size of the current block of memory
-};
-
-//==============================================================================
-// Unions
-//==============================================================================
-
-/// Each element has a number of attributes associated with it - This is the value.
-union UVariant {
- INT32 m_INT32; // Integer representation
- FLOAT m_FLOAT; // Float representation
- THashValue m_Hash; // Explicit hash representation
- UINT32 m_StringHandle; // Handle into the IStringTable member of the presentation
- void *m_VoidPointer; // Generic data Pointer
- UINT32 m_ElementHandle; // Element handle. Resolve using IApplication object.
- FLOAT m_FLOAT3[3]; // Vector 3 representation
- FLOAT m_FLOAT4[4]; // Vector 4 representation
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.cpp
deleted file mode 100644
index 4a8341b4..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "RuntimePrefix.h"
-#include "Qt3DSLogicSystem.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSApplication.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/IOStreams.h"
-
-using namespace qt3ds::runtime;
-using namespace qt3ds::foundation;
-using namespace qt3ds;
-using namespace qt3ds::runtime::element;
-
-namespace {
-struct SLogicKey
-{
- QT3DSU32 m_ElementHandle;
- Q3DStudio::TEventCommandHash m_CommandHash;
- SLogicKey(QT3DSU32 hdl = 0, Q3DStudio::TEventCommandHash hash = 0)
- : m_ElementHandle(hdl)
- , m_CommandHash(hash)
- {
- }
-
- bool operator==(const SLogicKey &other) const
- {
- return m_ElementHandle == other.m_ElementHandle && m_CommandHash == other.m_CommandHash;
- }
- size_t hash() const
- {
- return eastl::hash<QT3DSU32>()(m_ElementHandle) ^ eastl::hash<QT3DSU32>()((QT3DSU32)m_CommandHash);
- }
-};
-
-struct SLogicData
-{
- SLogicData *m_NextLogicData;
- QT3DSU32 m_Owner;
- QT3DSU32 m_Target;
- Q3DStudio::TEventCommandHash m_Type;
- Q3DStudio::UVariant m_Arg1;
- Q3DStudio::UVariant m_Arg2;
- QT3DSI32 m_Id;
- bool m_Active;
-
- SLogicData()
- : m_NextLogicData(NULL)
- , m_Owner(0)
- , m_Target(0)
- , m_Type(0)
- , m_Id(0)
- , m_Active(false)
- {
- m_Arg1.m_INT32 = 0;
- m_Arg2.m_INT32 = 0;
- }
-
- SLogicData(QT3DSU32 owner, QT3DSU32 target, Q3DStudio::TEventCommandHash type, Q3DStudio::UVariant a1,
- Q3DStudio::UVariant a2, bool active, QT3DSI32 inId)
- : m_NextLogicData(NULL)
- , m_Owner(owner)
- , m_Target(target)
- , m_Type(type)
- , m_Arg1(a1)
- , m_Arg2(a2)
- , m_Id(inId)
- , m_Active(active)
- {
- }
-};
-
-DEFINE_INVASIVE_SINGLE_LIST(LogicData);
-IMPLEMENT_INVASIVE_SINGLE_LIST(LogicData, m_NextLogicData);
-}
-
-namespace eastl {
-template <>
-struct hash<SLogicKey>
-{
- size_t operator()(const SLogicKey &inKey) const { return inKey.hash(); }
-};
-}
-
-namespace {
-
-struct SLogicSystem : public ILogicSystem
-{
- typedef nvhash_map<SLogicKey, TLogicDataList> TLogicKeyHash;
- typedef nvhash_map<QT3DSI32, SLogicKey> TIdLogicKeyHash;
- typedef Pool<SLogicData, ForwardingAllocator> TLogicDataPool;
-
- NVFoundationBase &m_Foundation;
-
- TLogicKeyHash m_LogicKeys;
- TIdLogicKeyHash m_IdToLogicKeys;
- TLogicDataPool m_LogicDataPool;
- QT3DSI32 m_NextId;
- NVDataRef<QT3DSU8> m_LoadData;
-
- QT3DSI32 m_RefCount;
-
- SLogicSystem(NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , m_LogicKeys(inFoundation.getAllocator(), "m_LogicKeys")
- , m_IdToLogicKeys(inFoundation.getAllocator(), "m_IdToLogicKeys")
- , m_LogicDataPool(ForwardingAllocator(inFoundation.getAllocator(), "m_LogicDataPool"))
- , m_NextId(1)
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Foundation.getAllocator());
- NVDelete(alloc, this);
- }
- }
- void IncrementNextId()
- {
- ++m_NextId;
- if (m_NextId == 0)
- ++m_NextId;
- }
- static QT3DSU32 GetHandle(element::SElement *elem)
- {
- if (elem)
- return elem->GetHandle();
- return 0;
- }
- // returns the action id
- QT3DSI32 AddAction(element::SElement &inTrigger,
- Q3DStudio::TEventCommandHash inEventNameHash,
- element::SElement *inTarget, element::SElement *inOwner,
- Q3DStudio::TEventCommandHash inType, Q3DStudio::UVariant inArg1,
- Q3DStudio::UVariant inArg2, bool inActive) override
- {
- SLogicKey theKey(inTrigger.GetHandle(), inEventNameHash);
- eastl::pair<TLogicKeyHash::iterator, bool> inserter =
- m_LogicKeys.insert(eastl::make_pair(theKey, TLogicDataList()));
-
- eastl::pair<TIdLogicKeyHash::iterator, bool> idInserter;
- for (idInserter = m_IdToLogicKeys.insert(eastl::make_pair(m_NextId, theKey));
- idInserter.second == false;
- idInserter = m_IdToLogicKeys.insert(eastl::make_pair(m_NextId, theKey))) {
- IncrementNextId();
- }
- IncrementNextId();
-
- SLogicData *theData = m_LogicDataPool.construct(__FILE__, __LINE__);
- *theData = SLogicData(GetHandle(inOwner), GetHandle(inTarget), inType, inArg1, inArg2,
- inActive, idInserter.first->first);
- inserter.first->second.push_back(*theData);
- return idInserter.first->first;
- }
-
- void OnEvent(Q3DStudio::TEventCommandHash inEventName, element::SElement &inTarget,
- Q3DStudio::IPresentation &inPresentation) const override
- {
- SLogicKey theKey(inTarget.GetHandle(), inEventName);
- TLogicKeyHash::const_iterator iter = m_LogicKeys.find(theKey);
- if (iter != m_LogicKeys.end()) {
- qt3ds::runtime::IApplication &theApplication = inPresentation.GetApplication();
- qt3ds::runtime::IElementAllocator &theElemAllocator =
- theApplication.GetElementAllocator();
- for (TLogicDataList::const_iterator listIter = iter->second.begin(),
- endIter = iter->second.end();
- listIter != endIter; ++listIter) {
- if (listIter->m_Active) {
- inPresentation.FireCommand(
- listIter->m_Type, theElemAllocator.FindElementByHandle(listIter->m_Target),
- &listIter->m_Arg1, &listIter->m_Arg2);
- }
- }
- }
- }
-
- void SetActive(QT3DSI32 inActionIndex, bool inActive, IElementAllocator &inElemAllocator) override
- {
- TIdLogicKeyHash::iterator iter = m_IdToLogicKeys.find(inActionIndex);
- if (iter != m_IdToLogicKeys.end()) {
- TLogicKeyHash::iterator logicIter = m_LogicKeys.find(iter->second);
- if (logicIter != m_LogicKeys.end()) {
- for (TLogicDataList::iterator listIter = logicIter->second.begin(),
- listEnd = logicIter->second.end();
- listIter != listEnd; ++listIter)
- if (listIter->m_Id == inActionIndex) {
- listIter->m_Active = inActive;
- if (IApplication::isPickingEvent(logicIter->first.m_CommandHash)) {
- SElement *theElement = inElemAllocator.FindElementByHandle(
- logicIter->first.m_ElementHandle);
- if (theElement && inActive)
- theElement->SetFlag(Q3DStudio::ELEMENTFLAG_PICKENABLED, true);
- }
- }
- }
- }
- }
-
- void SaveBinaryData(qt3ds::foundation::IOutStream &ioStream) override
- {
- qt3ds::foundation::SWriteBuffer theWriter(m_Foundation.getAllocator(), "WriteBuffer");
- theWriter.write(m_NextId);
- theWriter.write((QT3DSU32)m_LogicKeys.size());
- for (TLogicKeyHash::iterator iter = m_LogicKeys.begin(), end = m_LogicKeys.end();
- iter != end; ++iter) {
- if (iter->second.m_Head == NULL)
- continue;
-
- theWriter.write(iter->first);
- QT3DSU32 datumOffset = theWriter.size();
- theWriter.write((QT3DSU32)0);
- QT3DSU32 datumCount = 0;
- for (SLogicData *theDatum = iter->second.m_Head; theDatum;
- theDatum = theDatum->m_NextLogicData, ++datumCount) {
- theWriter.write(*theDatum);
- }
- QT3DSU32 *countPtr = reinterpret_cast<QT3DSU32 *>(theWriter.begin() + datumOffset);
- *countPtr = datumCount;
- }
- ioStream.Write(theWriter.begin(), theWriter.size());
- }
-
- void LoadBinaryData(NVDataRef<QT3DSU8> inLoadData) override
- {
- m_LoadData = inLoadData;
- SDataReader theReader(inLoadData.begin(), inLoadData.end());
- m_NextId = *theReader.Load<QT3DSI32>();
- QT3DSU32 numKeys = *theReader.Load<QT3DSU32>();
- for (QT3DSU32 idx = 0, end = numKeys; idx < end; ++idx) {
- SLogicKey theKey = *theReader.Load<SLogicKey>();
- QT3DSU32 numActions = *theReader.Load<QT3DSU32>();
- if (numActions == 0)
- continue;
-
- TLogicKeyHash::iterator inserter =
- m_LogicKeys.insert(eastl::make_pair(theKey, TLogicDataList())).first;
- SLogicData *lastDatum = NULL;
- for (QT3DSU32 actIdx = 0, actEnd = numActions; actIdx < actEnd; ++actIdx) {
- SLogicData *nextDatum = theReader.Load<SLogicData>();
- if (lastDatum == NULL)
- inserter->second.m_Head = nextDatum;
- else
- lastDatum->m_NextLogicData = nextDatum;
- lastDatum = nextDatum;
- m_IdToLogicKeys.insert(eastl::make_pair(nextDatum->m_Id, theKey));
- }
- if (lastDatum)
- lastDatum->m_NextLogicData = NULL;
- }
- }
-};
-}
-
-ILogicSystem &ILogicSystem::CreateLogicSystem(NVFoundationBase &inFnd)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), SLogicSystem)(inFnd);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.h
deleted file mode 100644
index af13c91f..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSLogicSystem.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_LOGIC_SYSTEM_H
-#define QT3DS_LOGIC_SYSTEM_H
-#include "Qt3DSElementSystem.h"
-
-namespace qt3ds {
-namespace runtime {
-
- class ILogicSystem : public NVRefCounted
- {
- public:
- // returns the action id
- virtual QT3DSI32 AddAction(element::SElement &inTrigger,
- Q3DStudio::TEventCommandHash inEventNameHash,
- element::SElement *inTarget, element::SElement *inOwner,
- Q3DStudio::TEventCommandHash inType, Q3DStudio::UVariant inArg1,
- Q3DStudio::UVariant inArg2, bool inActive) = 0;
-
- virtual void OnEvent(Q3DStudio::TEventCommandHash inEventName, element::SElement &inTarget,
- Q3DStudio::IPresentation &inPresentation) const = 0;
- virtual void SetActive(QT3DSI32 inActionIndex, bool inActive,
- IElementAllocator &inElemAllocator) = 0;
-
- virtual void SaveBinaryData(qt3ds::foundation::IOutStream &ioStream) = 0;
- virtual void LoadBinaryData(NVDataRef<QT3DSU8> inLoadData) = 0;
-
- static ILogicSystem &CreateLogicSystem(NVFoundationBase &inFnd);
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.cpp
deleted file mode 100644
index 06d0eee6..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSOutputMemoryStream.h"
-#include "Qt3DSHash.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * XXX
- */
-COutputMemoryStream::COutputMemoryStream()
-{
-}
-
-//==============================================================================
-/**
- * XXX
- */
-COutputMemoryStream::~COutputMemoryStream()
-{
-}
-
-//==============================================================================
-/**
- * XXX
- */
-void COutputMemoryStream::Reset()
-{
- m_Data.clear();
-}
-
-//==============================================================================
-/**
- * XXX
- */
-COutputMemoryStream &COutputMemoryStream::operator<<(const COutputMemoryStream &inStream)
-{
- size_t theSize = inStream.m_Data.size();
- for (size_t theCount = 0; theCount < theSize; ++theCount)
- m_Data.push_back(inStream.m_Data[theCount]);
- return *this;
-}
-
-//==============================================================================
-/**
- * XXX
- */
-void COutputMemoryStream::WriteStringHash(const CHAR *inItem)
-{
- TStringHash theHash = CHash::HashString(inItem);
- // DEBUG
- //{FILE*fp=fopen("hashed.txt","a");if(fp){fprintf(fp,"%ul %s\n",theHash,inItem);fclose(fp);}}
- operator<<(theHash);
-}
-
-//==============================================================================
-/**
- * XXX
- */
-void COutputMemoryStream::WriteEventCommandHash(const CHAR *inItem)
-{
- TStringHash theHash = CHash::HashEventCommand(inItem);
- // DEBUG
- //{FILE*fp=fopen("hashed.txt","a");if(fp){fprintf(fp,"%ul %s\n",theHash,inItem);fclose(fp);}}
- operator<<(theHash);
-}
-
-//==============================================================================
-/**
- * XXX
- */
-COutputMemoryStream &COutputMemoryStream::operator<<(const std::string &inString)
-{
- const UINT8 *thePtr = reinterpret_cast<const UINT8 *>(inString.c_str());
- for (size_t theCounter = 0; theCounter < inString.size(); ++theCounter) {
- m_Data.push_back(*thePtr);
- ++thePtr;
- }
-
- return *this;
-}
-
-//==============================================================================
-/**
- * XXX
- */
-COutputMemoryStream &COutputMemoryStream::operator<<(const EAttributeType inType)
-{
- UINT8 theType = static_cast<UINT8>(inType);
- m_Data.push_back(theType);
-
- return *this;
-}
-
-//==============================================================================
-/**
- * XXX
- */
-UINT32 COutputMemoryStream::GetSize() const
-{
- return static_cast<UINT32>(m_Data.size());
-}
-
-//==============================================================================
-/**
- * XXX
- */
-const UINT8 *COutputMemoryStream::GetData() const
-{
- return &m_Data[0];
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.h
deleted file mode 100644
index da28245f..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSOutputMemoryStream.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSHash.h"
-#ifdef _WIN32
-#pragma warning(push)
-#pragma warning(disable : 4820) // X bytes padding added after data member
-#pragma warning( \
- disable : 4061) // enumerator X in switch of enum Y is not explicitly handled by a case label
-#pragma warning(disable : 4062) // enumerator X in switch of enum Y is not handled
-#pragma warning(disable : 4548) // xlocale warnings
-#pragma warning( \
- disable : 4738) // storing 32-bit float result in memory, possible loss of performance
-#endif
-#include <vector>
-#include <map>
-#include <set>
-#include <string>
-
-#ifdef _WIN32
-#pragma warning(pop)
-#endif
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Class
-//==============================================================================
-class COutputMemoryStream
-{
- //==============================================================================
- // Fields
- //==============================================================================
-public:
- std::vector<UINT8> m_Data;
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- COutputMemoryStream();
- virtual ~COutputMemoryStream();
-
-public: // Access
- void Reset();
- UINT32 GetSize() const;
- const UINT8 *GetData() const;
-
-public: // Output
- void WriteStringHash(const CHAR *inItem);
- void WriteEventCommandHash(const CHAR *inItem);
-
-public: // Operators
- COutputMemoryStream &operator<<(const COutputMemoryStream &inStream);
- COutputMemoryStream &operator<<(const std::string &inString);
- COutputMemoryStream &operator<<(const EAttributeType inType);
-
- //==============================================================================
- // Template Methods
- //==============================================================================
-public:
- template <typename T>
- COutputMemoryStream &operator<<(const T &inItem)
- {
- size_t theSize = sizeof(T);
- const UINT8 *thePtr = reinterpret_cast<const UINT8 *>(&inItem);
- for (size_t theCounter = 0; theCounter < theSize; ++theCounter) {
- m_Data.push_back(*thePtr);
- ++thePtr;
- }
- return *this;
- }
-
- template <typename T>
- void SetData(const T &inItem, UINT32 inByteOffset)
- {
- UINT8 *theSourcePtr = &m_Data[inByteOffset];
- size_t theSize = sizeof(T);
- const UINT8 *thePtr = reinterpret_cast<const UINT8 *>(&inItem);
- for (size_t theCounter = 0; theCounter < theSize; ++theCounter) {
- *theSourcePtr = *thePtr;
- ++thePtr;
- ++theSourcePtr;
- }
- }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.cpp
deleted file mode 100644
index 84b642cd..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-#include "Qt3DSParametersSystem.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSIndexableLinkedList.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/IOStreams.h"
-
-using namespace qt3ds::runtime;
-
-namespace {
-
-struct SParameterGroup
-{
- enum {
- NumParametersPerGroup = 4,
- };
- TIdValuePair m_Data[NumParametersPerGroup];
- SParameterGroup *m_NextNode;
-
- SParameterGroup()
- : m_NextNode(NULL)
- {
- }
-};
-
-struct SParameterGroupEntry
-{
- QT3DSU32 m_ParameterCount;
- SParameterGroup *m_FirstGroup;
- SParameterGroupEntry()
- : m_ParameterCount(0)
- , m_FirstGroup(NULL)
- {
- }
-};
-
-typedef IndexableLinkedList<SParameterGroup, TIdValuePair, SParameterGroup::NumParametersPerGroup>
- TParametersList;
-
-struct SParamSystem : public IParametersSystem
-{
- typedef nvhash_map<QT3DSI32, SParameterGroupEntry> TIdGroupHash;
-
- NVFoundationBase &m_Foundation;
- TParametersList::TPoolType m_ParametersPool;
- TIdGroupHash m_Groups;
- QT3DSI32 m_NextId;
- NVDataRef<QT3DSU8> m_LoadData;
- QT3DSI32 m_RefCount;
-
- SParamSystem(NVFoundationBase &fnd)
- : m_Foundation(fnd)
- , m_ParametersPool(ForwardingAllocator(fnd.getAllocator(), "ParametersPool"))
- , m_Groups(fnd.getAllocator(), "m_Groups")
- , m_NextId(1)
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc = m_Foundation.getAllocator();
- NVDelete(alloc, this);
- }
- }
-
- void IncrementId()
- {
- ++m_NextId;
- if (!m_NextId)
- ++m_NextId;
- }
-
- QT3DSI32 CreateParameterGroup() override
- {
- eastl::pair<TIdGroupHash::iterator, bool> inserter =
- m_Groups.insert(eastl::make_pair(m_NextId, SParameterGroupEntry()));
- while (inserter.second == false) {
- IncrementId();
- inserter = m_Groups.insert(eastl::make_pair(m_NextId, SParameterGroupEntry()));
- }
- return inserter.first->first;
- }
-
- void AddParameter(QT3DSI32 inGroup, QT3DSU32 inNameHash, Q3DStudio::UVariant inParam) override
- {
- TIdGroupHash::iterator iter = m_Groups.find(inGroup);
- if (iter == m_Groups.end()) {
- QT3DS_ASSERT(false);
- return;
- }
-
- SParameterGroupEntry &theEntry(iter->second);
- TIdValuePair &thePair = TParametersList::Create(
- theEntry.m_FirstGroup, theEntry.m_ParameterCount, m_ParametersPool);
- thePair = eastl::make_pair(inNameHash, inParam);
- }
-
- QT3DSU32 GetNumParameters(QT3DSI32 inGroup) const override
- {
- TIdGroupHash::const_iterator iter = m_Groups.find(inGroup);
- if (iter == m_Groups.end()) {
- QT3DS_ASSERT(false);
- return 0;
- }
-
- const SParameterGroupEntry &theEntry(iter->second);
- return theEntry.m_ParameterCount;
- }
- TIdValuePair GetParameter(QT3DSI32 inGroup, QT3DSU32 inIndex) const override
- {
- Q3DStudio::UVariant dummyValue;
- dummyValue.m_INT32 = 0;
- TIdValuePair retval = TIdValuePair(0, dummyValue);
-
- TIdGroupHash::const_iterator iter = m_Groups.find(inGroup);
- if (iter == m_Groups.end()) {
- QT3DS_ASSERT(false);
- return retval;
- }
-
- const SParameterGroupEntry &theEntry(iter->second);
-
- if (inIndex < theEntry.m_ParameterCount)
- return TParametersList::GetObjAtIdx(theEntry.m_FirstGroup, inIndex);
-
- QT3DS_ASSERT(false);
- return retval;
- }
-};
-}
-
-IParametersSystem &IParametersSystem::CreateParametersSystem(NVFoundationBase &fnd)
-{
- return *QT3DS_NEW(fnd.getAllocator(), SParamSystem)(fnd);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.h
deleted file mode 100644
index 50a4652d..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSParametersSystem.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_PARAMETERS_SYSTEM_H
-#define QT3DS_PARAMETERS_SYSTEM_H
-#pragma once
-#include "Qt3DSKernelTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "EASTL/utility.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace foundation {
- class IOutStream;
-}
-}
-
-namespace qt3ds {
-namespace runtime {
- using namespace qt3ds;
- using namespace qt3ds::foundation;
-
- typedef eastl::pair<QT3DSU32, Q3DStudio::UVariant> TIdValuePair;
-
- class IParametersSystem : public NVRefCounted
- {
- public:
- virtual QT3DSI32 CreateParameterGroup() = 0;
- virtual void AddParameter(QT3DSI32 inGroup, QT3DSU32 inNameHash, Q3DStudio::UVariant inParam) = 0;
-
- virtual QT3DSU32 GetNumParameters(QT3DSI32 inGroupId) const = 0;
- virtual TIdValuePair GetParameter(QT3DSI32 inGroupId, QT3DSU32 inIndex) const = 0;
-
- static IParametersSystem &CreateParametersSystem(NVFoundationBase &inFoundation);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPickFrame.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSPickFrame.h
deleted file mode 100644
index 15da72c9..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPickFrame.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSInputFrame.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class IPresentation;
-
-//==============================================================================
-/**
- * Reporting structure describing a complete mouse pick including initial
- * mouse XY screen position, which element was hit, UV point of hit, global
- * intersection point and more.
- */
-struct SPickFrame
-{
- SInputFrame m_InputFrame; ///< Input values to process
-
- FLOAT m_PickOrigin[3]; ///< 3D pick ray start
- FLOAT m_PickDirection[3]; ///< 3D pick ray direction
-
- FLOAT m_LocalHit[2]; ///< 2D pick ray intersection
- FLOAT m_SquaredDistance; ///< Distance from camera to intersection
- TElement *m_Model; ///< Element picked
- // IPresentation* m_SubPresentation; ///< The picked element has a subpresentation
-
- BOOL m_ResultValid; ///< Model found - Whole structure is valid
- INT8 m_Unused[3]; ///< Padding
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.cpp
deleted file mode 100644
index 0792119b..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.cpp
+++ /dev/null
@@ -1,841 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSPresentation.h"
-#include "Qt3DSCommandEventTypes.h"
-#include "Qt3DSIScriptBridge.h"
-#include "Qt3DSInputEventTypes.h"
-#include "Qt3DSDataLogger.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSRuntimeFactory.h"
-#include "Qt3DSCommandHelper.h"
-#include "Qt3DSActivationManager.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSComponentManager.h"
-#include "Qt3DSRenderBufferLoader.h"
-#include "Qt3DSSlideSystem.h"
-#include "Qt3DSLogicSystem.h"
-#include "Qt3DSParametersSystem.h"
-#include "Qt3DSApplication.h"
-
-#include <QtCore/qfileinfo.h>
-#include <QtGui/qvector4d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector2d.h>
-
-namespace Q3DStudio {
-
-// Maximum number of Event/Command that can be queued in an Update cycle
-const INT32 Q3DStudio_EVENTCOMMANDQUEUECAPACITY = 512;
-
-// Limit to prevent infinite loop during queue processing
-const INT32 Q3DStudio_MAXEVENTCOMMANDLOOPCOUNT = Q3DStudio_EVENTCOMMANDQUEUECAPACITY * 10;
-
-#ifdef WIN32
-#pragma warning(push)
-#pragma warning(disable : 4355)
-#endif
-
-CPresentation::CPresentation(const QString &inName, const QString &projectPath,
- qt3ds::runtime::IApplication *inApplication)
- : m_Name(inName)
- , m_Application(inApplication)
- , m_Scene(nullptr)
- , m_ActivityZone(nullptr)
- , m_RootElement(nullptr)
- , m_EventCommandQueue(Q3DStudio_EVENTCOMMANDQUEUECAPACITY, "EventCommandQueue")
- , m_IsProcessingEventCommandQueue(false)
- , m_ComponentManager(*this)
- , m_Offset(0)
- , m_LocalTime(0)
- , m_PreviousGlobalTime(-1)
- , m_Paused(false)
- , m_OffsetInvalid(true)
- , m_Active(true)
-{
- m_projectPath = QFileInfo(projectPath).absoluteFilePath();
- m_Size.m_Width = 0;
- m_Size.m_Height = 0;
- m_Size.m_ScaleMode = SCALEMODE_UNKNOWN;
- m_AnimationSystem = IAnimationSystem::CreateAnimationSystem(
- inApplication->GetRuntimeFactoryCore().GetFoundation());
- m_SlideSystem =
- ISlideSystem::CreateSlideSystem(inApplication->GetRuntimeFactoryCore().GetFoundation(),
- inApplication->GetRuntimeFactoryCore().GetStringTable(),
- inApplication->GetElementAllocator());
- m_LogicSystem =
- ILogicSystem::CreateLogicSystem(inApplication->GetRuntimeFactoryCore().GetFoundation());
- m_ParametersSystem = IParametersSystem::CreateParametersSystem(
- inApplication->GetRuntimeFactoryCore().GetFoundation());
-}
-#ifdef _WIN32
-#pragma warning(pop)
-#endif
-
-CPresentation::~CPresentation()
-{
-}
-
-/**
- * Registers an element for notification when events fired on it.
- * @param inElement target element to monitor
- * @param inEventHash event hash to register for
- * @param inCallback static callback function
- * @param inContextData arbitrary data pointer
- */
-void CPresentation::RegisterEventCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData)
-{
- m_EventCallbacks.RegisterCallback(inElement, inEventHash, inCallback, inContextData);
- inElement->SetFlag(ELEMENTFLAG_REGISTEREDFOREVENTCALLBACK, true);
-
- if (qt3ds::runtime::IApplication::isPickingEvent(inEventHash))
- inElement->SetFlag(ELEMENTFLAG_PICKENABLED, true);
-}
-
-/**
- * Unregisters a previously registered event callback.
- * @param inElement target element to monitor
- * @param inEventHash event hash to register for
- * @param inCallback static callback function
- * @param inContextData arbitrary data pointer
- */
-BOOL CPresentation::UnregisterEventCallback(TElement *inElement,
- const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData)
-{
- BOOL theLast = false;
- BOOL theResult = m_EventCallbacks.UnregisterCallback(inElement, inEventHash, inCallback,
- inContextData, theLast);
-
- // Unflag element if there are no longer any callbacks on it
- if (theLast)
- inElement->SetFlag(ELEMENTFLAG_REGISTEREDFOREVENTCALLBACK, false);
-
- if (qt3ds::runtime::IApplication::isPickingEvent(inEventHash))
- inElement->SetFlag(ELEMENTFLAG_PICKENABLED, false);
-
- return theResult;
-}
-
-void CPresentation::ClearDirtyList()
-{
- FOR_ARRAY(TElement *, theElement, GetFrameData().GetDirtyList())
- {
- (*theElement)->Flags().SetDirty(false);
- }
- GetFrameData().Reset();
-}
-
-inline void ConvertActivityZoneBufferToElementList(qt3ds::runtime::TActivityItemBuffer inSource,
- TElementList &outResult)
-{
- for (qt3ds::QT3DSU32 idx = 0, end = inSource.size(); idx < end; ++idx)
- outResult.Push(inSource[idx].first);
-}
-
-void CPresentation::PreUpdate(const TTimeUnit inGlobalTime)
-{
- if (m_OffsetInvalid || m_Paused) {
- m_OffsetInvalid = false;
- m_Offset = m_LocalTime - inGlobalTime;
- } else
- m_LocalTime = inGlobalTime + m_Offset;
-
- // Event/Command Processing Stage
- ProcessEventCommandQueue();
-}
-
-/**
- * Update the presentation to the current time. This will start triggering the
- * various stages of the presentation frame rhythm
- * @param inGlobalTime time at which to update each presentation
- * @return true if there were events to be processed.
- */
-void CPresentation::BeginUpdate()
-{
- // Active Scan Stage
- if (m_ActivityZone) {
- m_ActivityZone->BeginUpdate(
- m_LocalTime, m_Application->GetRuntimeFactory().GetPerfTimer(),
- m_Application->GetRuntimeFactory().GetQt3DSRenderContext().GetThreadPool());
- }
-}
-
-void CPresentation::EndUpdate()
-{
- if (m_ActivityZone) {
- m_ActivityZone->EndUpdate();
- CPresentationFrameData &theFrameData = GetFrameData();
- ConvertActivityZoneBufferToElementList(m_ActivityZone->GetActivatedItems(),
- theFrameData.GetActivationList());
- ConvertActivityZoneBufferToElementList(m_ActivityZone->GetDeactivatedItems(),
- theFrameData.GetDeactivationList());
- ConvertActivityZoneBufferToElementList(m_ActivityZone->GetScriptItems(),
- theFrameData.GetScriptsList());
- }
-
- if (!m_Paused) {
- // Animation Track Evaluation Stage
- m_AnimationSystem->Update();
- }
- // Presentation is considered ready to accept external commands when the first frame property
- // updates are done.
- if (!m_presentationReady) {
- m_SignalProxy.SigPresentationReady();
- m_presentationReady = true;
- }
-}
-
-void CPresentation::PostUpdate(const TTimeUnit inGlobalTime)
-{
- if (!m_Paused) {
- // Callback Stage
- if (m_Application && m_PreviousGlobalTime != inGlobalTime)
- m_Application->GetRuntimeFactoryCore().GetScriptEngineQml().ProcessFrameCallbacks(this);
- }
-
- m_PreviousGlobalTime = inGlobalTime;
-}
-
-void CPresentation::NotifyDataOutputs()
-{
- if (m_pathToDataOutMap.size() == 0)
- return;
-
- // Based on the dirty list, check if we need to fire DataOutput notifications
- Q3DStudio::TElementList &dirtyList = GetFrameData().GetDirtyList();
- for (int idx = 0, end = dirtyList.GetCount(); idx < end; ++idx) {
- Q3DStudio::TElement &element = *dirtyList[idx];
- if (m_pathToDataOutMap.contains(element.m_Path)) {
- auto outDefIter = m_pathToDataOutMap.find(element.m_Path);
-
- while (outDefIter != m_pathToDataOutMap.end() && outDefIter.key() == element.m_Path) {
- qt3ds::runtime::DataOutputDef &outDef = outDefIter.value();
-
- // Get current value
- Q3DStudio::UVariant value;
- qt3ds::QT3DSU32 attribHash
- = CHash::HashAttribute(outDef.observedAttribute.attributeName[0]);
- element.GetAttribute(attribHash, value);
- QVariant qvar;
- switch (outDef.observedAttribute.propertyType) {
- case ATTRIBUTETYPE_INT32:
- qvar.setValue(value.m_INT32);
- break;
- case ATTRIBUTETYPE_FLOAT:
- qvar.setValue(value.m_FLOAT);
- break;
- case ATTRIBUTETYPE_BOOL:
- qvar.setValue(value.m_INT32);
- break;
- case ATTRIBUTETYPE_STRING:
- qvar.setValue(QString::fromUtf8(
- GetStringTable().HandleToStr(value.m_StringHandle).c_str()));
- break;
- case ATTRIBUTETYPE_FLOAT4: {
- QVector4D qvalue(value.m_FLOAT4[0], value.m_FLOAT4[1],
- value.m_FLOAT4[2], value.m_FLOAT4[3]);
- qvar.setValue(qvalue);
- }
- break;
- case ATTRIBUTETYPE_FLOAT3: {
- QVector3D qvalue(value.m_FLOAT3[0], value.m_FLOAT3[1], value.m_FLOAT3[2]);
- qvar.setValue(qvalue);
- }
- break;
- case ATTRIBUTETYPE_FLOAT2: {
- QVector2D qvalue(value.m_FLOAT3[0], value.m_FLOAT3[1]);
- qvar.setValue(qvalue);
- }
- break;
- default:
- break;
- }
-
- if (qvar.isValid() && (outDef.value != qvar)) {
- outDef.value.setValue(qvar);
- m_SignalProxy.SigDataOutputValueUpdated(outDef.name, outDef.value);
- }
-
- ++outDefIter;
- }
- }
- }
-}
-
-void CPresentation::AddToDataOutputMap(const QHash<qt3ds::foundation::CRegisteredString,
- qt3ds::runtime::DataOutputDef> &doMap)
-{
- if (doMap.size() > 0)
- m_pathToDataOutMap.unite(doMap);
-}
-
-/**
- * Process the Event/Command queue completely
- * PostEventCommand is the method that will add new Event/Command to the queue.
- *
- * The contract for Event/Command processing:
- * 1. If an Event or Command is posted during the processing stage, it will be added
- * to the end of the queue and is guaranteed to be processed in the current cycle.
- * For example, if an Event (which is processed) triggers a Command to set a model to red,
- * the model will turn red in the current frame.
- *
- * 2. If an Event or Command is posted after the processing stage, such as during the
- * Callback stage, it will only be processed on the next Update cycle.
- * For example, if the "turn mode to red" Command is posted in a script callback, the
- * model will turn red in the next frame.
- *
- * 3. If an Event or Command is posted before the processing stage, for example an
- * external Event posted just before the Update cycle, it will be processed in the current
- *cycle.
- * For example, if the "turn mode to red" Command is posted from the game engine prior to
- * the Update cycle, the model will turn red in the current frame.
- *
- * @see PostEventCommand
- * @return true if there were events that were processed.
- */
-BOOL CPresentation::ProcessEventCommandQueue()
-{
- PerfLogGeneralEvent2(DATALOGGER_PROCESSEVENTS);
-
- m_IsProcessingEventCommandQueue = true;
-
- BOOL theResult = !m_EventCommandQueue.IsEmpty();
- INT32 theEventProcessedCount = 0;
- while (!m_EventCommandQueue.IsEmpty()) {
- SEventCommand &theEventCommand = m_EventCommandQueue.Top();
- if (theEventCommand.m_IsEvent)
- ProcessEvent(theEventCommand, theEventProcessedCount);
- else
- ProcessCommand(theEventCommand);
-
- // Infinite-loop check
- if (theEventProcessedCount > Q3DStudio_MAXEVENTCOMMANDLOOPCOUNT) {
- // Breakout policy: Dump remaining Event/Commands
- qCCritical(qt3ds::INVALID_OPERATION)
- << "ProcessEventCommandQueue exceeded maximum loop count"
- << "Remaining Event/Commands will be cleared. Event count: "
- << theEventProcessedCount << "Limit: " << Q3DStudio_MAXEVENTCOMMANDLOOPCOUNT;
- m_EventCommandQueue.Clear();
- } else {
- m_EventCommandQueue.Pop();
- }
- }
-
- m_IsProcessingEventCommandQueue = false;
-
- return theResult;
-}
-
-/**
- * Pass incoming event to event consumers immediately
- * @param ioEvent the incoming event
- */
-void CPresentation::ProcessEvent(SEventCommand &ioEvent, INT32 &ioEventCount)
-{
- if (ioEventCount < Q3DStudio_MAXEVENTCOMMANDLOOPCOUNT) {
- ++ioEventCount;
- PerfLogPresentationEvent1(DATALOGGER_PROCESSEVENT);
-
- // Callbacks can change ioEvent's bubbling flags
- if (ioEvent.m_Target->GetFlag(ELEMENTFLAG_REGISTEREDFOREVENTCALLBACK)) {
- m_EventCallbacks.FireCallbacks(ioEvent);
- }
-
- // Do an early return if callback do a "stopImmediatePropagation"
- if (ioEvent.m_Done)
- return;
-
- if (ioEvent.m_Target) {
- // Logic should not be able to change ioEvent's bubbling flags
- // ...or can it?
- m_LogicSystem->OnEvent(ioEvent.m_Type, *ioEvent.m_Target, *this);
- }
-
- ProcessEventBubbling(ioEvent, ioEventCount);
- }
-}
-
-/**
- * Handle event bubbling
- * @param ioEvent the incoming event
- */
-void CPresentation::ProcessEventBubbling(SEventCommand &ioEvent, INT32 &ioEventCount)
-{
- PerfLogPresentationEvent1(DATALOGGER_PROCESSEVENTBUBBLING);
-
- // Check for onGroupedMouseOver/Out
- // arg1 = the original onMouseOut model and arg2 = the original onMouseOver model
- if (ioEvent.m_Type == ON_MOUSEOUT) {
- // If original onMouseOver model is nullptr or not a descendent, fire onGroupedMouseOut
- TElement *theMouseOverModel = static_cast<TElement *>(ioEvent.m_Arg2.m_VoidPointer);
- if (!theMouseOverModel || !ioEvent.m_Target->IsDescendent(*theMouseOverModel)) {
- SEventCommand theEvent = ioEvent;
- theEvent.m_Type = ON_GROUPEDMOUSEOUT;
- theEvent.m_BubbleUp = 0; // no bubbling
- theEvent.m_BubbleDown = 0;
- FireEvent(theEvent);
- }
- // set the original onMouseOver model to the target to make IsDescendent queries less
- // expensive
- else if (theMouseOverModel) {
- ioEvent.m_Arg2.m_VoidPointer = ioEvent.m_Target;
- }
- } else if (ioEvent.m_Type == ON_MOUSEOVER) {
- // If original onMouseOut model is nullptr or not a descendent, fire onGroupedMouseOver
- TElement *theMouseOutModel = static_cast<TElement *>(ioEvent.m_Arg1.m_VoidPointer);
- if (!theMouseOutModel || !ioEvent.m_Target->IsDescendent(*theMouseOutModel)) {
- SEventCommand theEvent = ioEvent;
- theEvent.m_Type = ON_GROUPEDMOUSEOVER;
- theEvent.m_BubbleUp = 0; // no bubbling
- theEvent.m_BubbleDown = 0;
- FireEvent(theEvent);
- }
- // set the original onMouseOut model to the target to make IsDescendent queries less
- // expensive
- else if (theMouseOutModel) {
- ioEvent.m_Arg1.m_VoidPointer = ioEvent.m_Target;
- }
- }
-
- // Do NOT bubble up onSlideEnter and onSlideExit events from current component to its parent
- // scene
- // since each component has its own slides.
- if (ioEvent.m_BubbleUp && (ioEvent.m_Target->Flags() & ELEMENTFLAG_COMPONENT)
- && (ioEvent.m_Type == EVENT_ONSLIDEENTER || ioEvent.m_Type == EVENT_ONSLIDEEXIT)) {
- ioEvent.m_BubbleUp = FALSE;
- }
-
- // Event bubbling
- if (ioEvent.m_BubbleUp) {
- TElement *theParent = ioEvent.m_Target->m_Parent;
- if (theParent) {
- ioEvent.m_Target = theParent;
- ProcessEvent(ioEvent, ioEventCount);
- }
- }
-}
-
-/**
- * Execute command immediately
- * @param inCommand incoming command structure
- */
-void CPresentation::ProcessCommand(const SEventCommand &inCommand)
-{
- PerfLogPresentationEvent1(DATALOGGER_PROCESSCOMMAND);
-
- // Attributes (Arg1 = key, Arg2 = value)
- if (inCommand.m_Type == COMMAND_SETPROPERTY) {
- SAttributeKey theAttributeKey;
- UINT32 theHash = static_cast<UINT32>(inCommand.m_Arg1.m_Hash);
- theAttributeKey.Convert(
- theHash); // Need this conversion to prevent problems arising due to endianess
- inCommand.m_Target->SetAttribute(theAttributeKey.m_Hash, inCommand.m_Arg2);
-
- // Events (Arg1 = hashed event name)
- } else if (inCommand.m_Type == COMMAND_FIREEVENT) {
- FireEvent(inCommand.m_Arg1.m_Hash, inCommand.m_Target);
-
- // Time (Arg1 = time)
- } else if (inCommand.m_Type == COMMAND_PLAY) {
- GetComponentManager().SetPause(inCommand.m_Target, false);
- } else if (inCommand.m_Type == COMMAND_PAUSE) {
- GetComponentManager().SetPause(inCommand.m_Target, true);
- } else if (inCommand.m_Type == COMMAND_GOTOTIME) {
- GetComponentManager().GoToTime(inCommand.m_Target, inCommand.m_Arg1.m_INT32);
-
- // Slide (Arg1 = slide index or slide name)
- } else if (inCommand.m_Type == COMMAND_GOTOSLIDE) {
- // Goto slide commands are handled differently.
- IComponentManager &theManager(GetComponentManager());
- Q3DStudio::SComponentGotoSlideData theGotoSlideData =
- theManager.GetComponentGotoSlideCommand(inCommand.m_Target);
- if (theGotoSlideData.m_Slide > 0)
- theManager.GotoSlideIndex(inCommand.m_Target, theGotoSlideData);
-
- theManager.ReleaseComponentGotoSlideCommand(inCommand.m_Target);
- } else if (inCommand.m_Type == COMMAND_GOTOSLIDENAME) {
- GetComponentManager().GotoSlideName(inCommand.m_Target, inCommand.m_Arg1.m_Hash);
- } else if (inCommand.m_Type == COMMAND_GOTONEXTSLIDE) {
- GetComponentManager().GoToNextSlide(inCommand.m_Target);
- } else if (inCommand.m_Type == COMMAND_GOTOPREVIOUSSLIDE) {
- GetComponentManager().GoToPreviousSlide(inCommand.m_Target);
- } else if (inCommand.m_Type == COMMAND_BACKSLIDE) {
- GetComponentManager().GoToBackSlide(inCommand.m_Target);
-
- // Behavior
- } else if (inCommand.m_Type == COMMAND_CUSTOMACTION) {
- m_Application->GetRuntimeFactoryCore().GetScriptEngineQml()
- .ProcessCustomActions(this, inCommand);
- } else if (inCommand.m_Type == COMMAND_CUSTOMCALLBACK) {
- m_Application->GetRuntimeFactoryCore().GetScriptEngineQml().ProcessCustomCallback(
- this, inCommand);
- } else if (inCommand.m_Type == COMMAND_PLAYSOUND) {
- CRegisteredString theSoundPathReg = GetStringTable().HandleToStr(inCommand.m_Arg1.m_INT32);
- if (theSoundPathReg.IsValid()) {
- const char *theSoundPath = theSoundPathReg.c_str();
- if (strlen(theSoundPath) > 0) {
- m_Application->GetRuntimeFactoryCore().GetScriptEngineQml().PlaySoundFile(
- theSoundPath);
- }
- }
- } else if (inCommand.m_Type == COMMAND_EMITSIGNAL) {
- CRegisteredString nameStr = GetStringTable().HandleToStr(inCommand.m_Arg1.m_INT32);
- m_Application->GetRuntimeFactoryCore().GetScriptEngineQml().ProcessSignal(this, inCommand);
- QString path = QString::fromLatin1(inCommand.m_Target->m_Path.c_str());
- QString name = QString::fromLatin1(nameStr.c_str());
- signalProxy()->SigCustomSignal(path, name);
- } else {
- qCCritical(qt3ds::INVALID_OPERATION) << "Command not implemented: " << inCommand.m_Type;
- }
-}
-
-/**
- * Put an Event in the queue to be processed later during the Event/Command
- * processing stage in Update
- * This method is used by Event-bubbling during ProcessEvent
- *
- * @param inEvent the incoming event
- * @see PostEvent
- */
-void CPresentation::FireEvent(const SEventCommand &inEvent)
-{
- SEventCommand &theEventCommand = m_EventCommandQueue.NewEntry();
-
- theEventCommand = inEvent;
-
- theEventCommand.m_IsEvent = true;
-}
-
-/**
- * Put an Event in the queue to be processed later during the Event/Command
- * processing stage in Update See ProcessEventCommandQueue for more
- * information on the contract for Event/Command processing.
- *
- * @param inEventType the incoming event type
- * @param inTarget the target for the event
- * @param inArg1 optional argument #1
- * @param inArg2 optional argument #2
- * @param inType1 optional type for argument #1
- * @param inType2 optional type for argument #2
- * @see ProcessEventCommandQueue
- * @see PostEventCommand
- */
-void CPresentation::FireEvent(const TEventCommandHash inEventType, TElement *inTarget,
- const UVariant *inArg1, const UVariant *inArg2,
- const EAttributeType inType1, const EAttributeType inType2)
-{
-
- SEventCommand theEvent = { inTarget, inEventType };
-
- theEvent.m_IsEvent = true;
- theEvent.m_BubbleUp = true;
-
- theEvent.m_Arg1Type = static_cast<UINT8>(inType1);
- theEvent.m_Arg2Type = static_cast<UINT8>(inType2);
-
- if (inArg1)
- theEvent.m_Arg1 = *inArg1;
- if (inArg2)
- theEvent.m_Arg2 = *inArg2;
-
- m_EventCommandQueue.NewEntry() = theEvent;
-}
-
-/**
- * Put a Command in the queue to be processed later during the Event/Command
- * processing stage in Update. See ProcessEventCommandQueue for more information
- * on the contract for Event/Command processing.
- *
- * For cases where the Commands need to be synchronized with the Frame-Rhythm
- * An example would be calling "SetSlide" in scripts.
- *
- * @see ProcessEventCommandQueue
- * @see PostEventCommand
- * @param inEventType the incoming command type
- * @param inTarget the target for the command
- * @param inArg1 optional argument #1
- * @param inArg2 optional argument #2
- * @param inType1 optional type for argument #1
- * @param inType2 optional type for argument #2
- */
-void CPresentation::FireCommand(const TEventCommandHash inEventType, TElement *inTarget,
- const UVariant *inArg1, const UVariant *inArg2,
- const EAttributeType inType1, const EAttributeType inType2)
-{
- // Pre-filter gotoslidename commands.
- if (inEventType == COMMAND_GOTOSLIDENAME) {
- int theSlideHashName = inArg1->m_INT32;
- TComponent *theComponent = GetComponentManager().GetComponent(inTarget);
- UINT8 theSlideIndex = GetSlideSystem().FindSlide(*theComponent, theSlideHashName);
- // Translate into a slide index command.
- CCommandHelper::SetupGotoSlideCommand(*inTarget, theSlideIndex,
- SScriptEngineGotoSlideArgs());
- } else {
- SEventCommand theCommand = { inTarget, inEventType };
-
- theCommand.m_Arg1Type = static_cast<UINT8>(inType1);
- theCommand.m_Arg2Type = static_cast<UINT8>(inType2);
-
- if (inArg1)
- theCommand.m_Arg1 = *inArg1;
- if (inArg2)
- theCommand.m_Arg2 = *inArg2;
-
- m_EventCommandQueue.NewEntry() = theCommand;
- }
-}
-
-void CPresentation::FlushEventCommandQueue(void)
-{
- if (!m_IsProcessingEventCommandQueue)
- ProcessEventCommandQueue();
-}
-
-void CPresentation::ProcessEvent(SEventCommand &inEvent)
-{
- INT32 theEventProcessedCount = 0;
- ProcessEvent(inEvent, theEventProcessedCount);
-}
-
-/**
- * This method is triggered after the presentation is streamed in. At this point,
- * all the stores will be loaded up.
- */
-void CPresentation::OnPresentationLoaded()
-{
- m_FrameData.Reserve(1000 /*m_ElementManager.GetElementCount( )*/);
-}
-
-/**
- * Set the full path for this presentation. This can be used by anyone who
- * knows the presentation to form relative paths.
- * @param inPath the path to which to set.
- */
-void CPresentation::SetFilePath(const CHAR *inPath)
-{
- m_FilePath = QFileInfo(inPath).absoluteFilePath();
-}
-
-/**
- * Gets the full file path for this presentation. This can be used by anyone who
- * knows the presentation to form relative correct paths.
- */
-QString CPresentation::GetFilePath() const
-{
- return m_FilePath;
-}
-
-/**
- * Gets the absolute file path for the project that owns this presentation.
- */
-QString CPresentation::getProjectPath() const
-{
- return m_projectPath;
-}
-
-/**
- * Gets the pause state
- * @return true if the presentation is paused, false if otherwise
- */
-BOOL CPresentation::GetPause() const
-{
- return m_Paused;
-}
-
-/**
- * Sets the pause state
- * @param inPause set true to pause, set false if otherwise
- */
-void CPresentation::SetPause(const BOOL inPause)
-{
- m_Paused = inPause ? true : false;
-}
-
-/**
- * Simple manager access: Scene
- */
-void CPresentation::SetScene(IScene *inScene)
-{
- m_Scene = inScene;
-}
-
-void CPresentation::SetActivityZone(qt3ds::runtime::IActivityZone *inZone)
-{
- m_ActivityZone = inZone;
- m_ActivityZone->SetZoneActive(m_Active);
- TElement *theSceneElement = m_RootElement;
- qt3ds::runtime::IActivityZone &theZone(*GetActivityZone());
- // The activity zone requires elements described to it in breadth first search order.
- theZone.AddActivityItems(*theSceneElement);
-}
-
-void CPresentation::SetActive(bool inValue)
-{
- m_Active = inValue;
- m_ActivityZone->SetZoneActive(m_Active);
-}
-
-bool CPresentation::GetActive() const
-{
- return m_Active;
-}
-
-/**
- * Simple manager access: Scene
- */
-IScene *CPresentation::GetScene() const
-{
- return m_Scene;
-}
-
-/**
-* Simple manager access: Script Bridge Qml
-*/
-IScriptBridge *CPresentation::GetScriptBridgeQml()
-{
- if (m_Application)
- return &m_Application->GetRuntimeFactoryCore().GetScriptEngineQml();
-
- return nullptr;
-}
-
-/**
- * Simple manager access: Component Manager
- */
-IComponentManager &CPresentation::GetComponentManager()
-{
- return m_ComponentManager;
-}
-
-/**
- * Simple manager access: Slide Manager
- */
-ISlideSystem &CPresentation::GetSlideSystem()
-{
- return *m_SlideSystem;
-}
-
-/**
- * Simple manager access: Animation Manager
- */
-qt3ds::runtime::IAnimationSystem &CPresentation::GetAnimationSystem()
-{
- return *m_AnimationSystem;
-}
-
-/**
- * Simple manager access: Logic Manager
- */
-ILogicSystem &CPresentation::GetLogicSystem()
-{
- return *m_LogicSystem;
-}
-
-/**
- * Simple manager access: Params Manager
- */
-IParametersSystem &CPresentation::GetParametersSystem()
-{
- return *m_ParametersSystem;
-}
-
-void CPresentation::SetElementPath(TElement &inElement, const char8_t *inPath)
-{
- CRegisteredString str;
- if (m_Application)
- str = m_Application->GetRuntimeFactoryCore().GetStringTable().RegisterStr(
- qt3ds::foundation::nonNull(inPath));
-
- if (str.IsValid())
- m_ElementPathMap.insert(eastl::make_pair(&inElement, str));
-}
-
-qt3ds::foundation::CRegisteredString CPresentation::GetElementPath(TElement &inElement)
-{
- TElemStringMap::iterator iter = m_ElementPathMap.find(&inElement);
- if (iter != m_ElementPathMap.end())
- return iter->second;
-
- return qt3ds::foundation::CRegisteredString();
-}
-
-qt3ds::foundation::IStringTable &CPresentation::GetStringTable()
-{
- return GetApplication().GetRuntimeFactoryCore().GetStringTable();
-}
-
-/**
- * Current frame data stores traversal lists for use later
- */
-CPresentationFrameData &CPresentation::GetFrameData()
-{
- return m_FrameData;
-}
-
-void CPresentation::SetLoadedBuffer(qt3ds::render::ILoadedBuffer &inBuffer)
-{
- m_LoadedBuffer = inBuffer;
-}
-
-/**
- * Retrieve the name of the presentation. This is actually the file path.
- * @return the name of this presentation
- */
-const QByteArray CPresentation::GetName() const
-{
- return m_Name.toLatin1();
-}
-
-/**
- * Retrieve the size of the presentation in Studio
- * @return the size of this presentation
- */
-SPresentationSize CPresentation::GetSize() const
-{
- return m_Size;
-}
-
-/**
- * Set the size of the presentation as reflected in Studio
- * @param inSize size of presentation ( width, height, scale mode ) in Studio
- */
-void CPresentation::SetSize(const SPresentationSize &inSize)
-{
- m_Size = inSize;
-}
-
-QPresentationSignalProxy *CPresentation::signalProxy()
-{
- return &m_SignalProxy;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.h
deleted file mode 100644
index 76b0a6e7..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentation.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "RuntimePrefix.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSPresentationFrameData.h"
-#include "Qt3DSAnimationSystem.h"
-#include "Qt3DSCircularArray.h"
-#include "Qt3DSEventCallbacks.h"
-#include "Qt3DSTimePolicy.h"
-#include "EASTL/hash_map.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSComponentManager.h"
-
-#include <QObject>
-
-class QPresentationSignalProxy : public QObject
-{
- Q_OBJECT
-Q_SIGNALS:
- void SigSlideEntered(const QString &elementPath, unsigned int index, const QString &name);
- void SigSlideExited(const QString &elementPath, unsigned int index, const QString &name);
- void SigCustomSignal(const QString &elementPath, const QString &name);
- void SigPresentationReady();
- void SigElementsCreated(const QStringList &elementPaths, const QString &error);
- void SigMaterialsCreated(const QStringList &materialNames, const QString &error);
- void SigDataOutputValueUpdated(const QString &name, const QVariant &value);
-};
-
-namespace qt3ds {
-namespace runtime {
- class IApplication;
- class IActivityZone;
- struct DataOutputDef;
-}
-}
-
-namespace qt3ds {
-namespace render {
- class ILoadedBuffer;
-}
-}
-
-namespace Q3DStudio {
-
-/**
- * Intelligent representation of a Studio presentation.
- */
-class CPresentation : public IPresentation
-{
-protected:
- QString m_Name; // Name of this presentation
- QString m_FilePath; // Absolute path to this presentation
- QString m_projectPath; // Absolute path to the project root
- qt3ds::runtime::IApplication *m_Application; // Runtime object
- IScene *m_Scene; // Connection to the associated scene (render) for this presentation
- qt3ds::runtime::IActivityZone *m_ActivityZone; // Controls element active status
- TElement *m_RootElement;
-
- CPresentationFrameData m_FrameData; // Storage of data of the current frame
- CCircularArray<SEventCommand> m_EventCommandQueue; // The Event/Command integrated queue
- bool m_IsProcessingEventCommandQueue;
- CEventCallbacks m_EventCallbacks; // Handles event callbacks on registered elements
- SPresentationSize m_Size; // Native width, height and mode exported from Studio
-
- qt3ds::foundation::NVScopedRefCounted<qt3ds::render::ILoadedBuffer>
- m_LoadedBuffer; // Reference to loaded data when loading from binary
-
- CComponentManager m_ComponentManager;
- qt3ds::foundation::NVScopedRefCounted<ISlideSystem>
- m_SlideSystem; // Container and factory of all slides
- qt3ds::foundation::NVScopedRefCounted<ILogicSystem>
- m_LogicSystem; // Container and factory of all logics
- qt3ds::foundation::NVScopedRefCounted<IAnimationSystem>
- m_AnimationSystem; // Container and factory of all animation tracks
- qt3ds::foundation::NVScopedRefCounted<IParametersSystem>
- m_ParametersSystem; // Container and factory of all custom actions
-
- TTimeUnit m_Offset;
- TTimeUnit m_LocalTime;
- TTimeUnit m_PreviousGlobalTime;
- bool m_Paused;
- bool m_OffsetInvalid;
- bool m_Active;
- bool m_presentationReady = false;
-
- typedef eastl::hash_map<TElement *, qt3ds::foundation::CRegisteredString> TElemStringMap;
- TElemStringMap m_ElementPathMap;
-
-public: // Construction
- CPresentation(const QString &inName, const QString &projectPath,
- qt3ds::runtime::IApplication *inRuntime);
- virtual ~CPresentation() override;
-
-public: // Execution
- void Initialize();
- // Clear dirty elements
- void ClearDirtyList() override;
- // Run events
- void PreUpdate(const TTimeUnit inGlobalTime) override;
- // update element graph
- void BeginUpdate() override;
- // end update element graph
- void EndUpdate() override;
- // Run behaviors.
- void PostUpdate(const TTimeUnit inGlobalTime) override;
- // Notify DataUpdates if any are registered to this presentation
- void NotifyDataOutputs();
-
-public: // Bridge Control
- IScene *GetScene() const override;
- IScriptBridge *GetScriptBridgeQml() override;
- void SetScene(IScene *inScene) override;
-
- void SetActivityZone(qt3ds::runtime::IActivityZone *inZone);
- qt3ds::runtime::IActivityZone *GetActivityZone() override { return m_ActivityZone; }
- void SetActive(bool inValue);
- bool GetActive() const;
- TElement *GetRoot() override { return m_RootElement; }
- void SetRoot(TElement &inRoot) override { m_RootElement = &inRoot; }
-
-public: // Commands and Events
- void FireEvent(const SEventCommand &inEvent);
- void FireEvent(const TEventCommandHash inEventType, TElement *inTarget,
- const UVariant *inArg1 = nullptr, const UVariant *inArg2 = nullptr,
- const EAttributeType inType1 = ATTRIBUTETYPE_NONE,
- const EAttributeType inType2 = ATTRIBUTETYPE_NONE) override;
- void FireCommand(const TEventCommandHash inCommandType, TElement *inTarget,
- const UVariant *inArg1 = nullptr, const UVariant *inArg2 = nullptr,
- const EAttributeType inType1 = ATTRIBUTETYPE_NONE,
- const EAttributeType inType2 = ATTRIBUTETYPE_NONE) override;
- void FlushEventCommandQueue(void) override;
- void ProcessEvent(SEventCommand &inEvent) override;
-
- QPresentationSignalProxy *signalProxy();
-
-public: // Data Output
- void AddToDataOutputMap(const QHash<qt3ds::foundation::CRegisteredString,
- qt3ds::runtime::DataOutputDef> &doMap);
-
-public: // Event Callbacks
- void RegisterEventCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData) override;
- BOOL UnregisterEventCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData) override;
-
-protected: // Execution Helper Methods
- void ProcessAllCallbacks();
- BOOL ProcessEventCommandQueue();
- void ProcessEvent(SEventCommand &ioEvent, INT32 &ioEventCount);
- void ProcessEventBubbling(SEventCommand &ioEvent, INT32 &ioEventCount);
- void ProcessCommand(const SEventCommand &inCommand);
-
-public: // Managers
- IComponentManager &GetComponentManager() override;
- ISlideSystem &GetSlideSystem() override;
- IAnimationSystem &GetAnimationSystem() override;
- ILogicSystem &GetLogicSystem() override;
- IParametersSystem &GetParametersSystem() override;
- qt3ds::foundation::IStringTable &GetStringTable() override;
- qt3ds::runtime::IApplication &GetApplication() override
- {
- QT3DS_ASSERT(m_Application);
- return *m_Application;
- }
- void SetLoadedBuffer(qt3ds::render::ILoadedBuffer &inBuffer);
-
- void SetElementPath(TElement &inElement, const char8_t *inPath) override;
- qt3ds::foundation::CRegisteredString GetElementPath(TElement &inElement) override;
-
-public: // Helpers
- CPresentationFrameData &GetFrameData() override;
- TTimeUnit GetTime() { return m_LocalTime; }
-
-public: // Hooks and callbacks
- void OnPresentationLoaded() override;
-
-public: // Configuration access
- SPresentationSize GetSize() const override;
- BOOL GetPause() const;
- const QByteArray GetName() const;
-
- void SetSize(const SPresentationSize &inSize) override;
- void SetPause(const BOOL inPause);
- void SetHide(const BOOL inHide);
- void SetUpdateLock(const BOOL inLockUpdate);
- void SetVCAA(const BOOL inVCAA);
-
-public: // Full file paths
- void SetFilePath(const CHAR *inPath) override;
- QString GetFilePath() const override;
- QString getProjectPath() const override;
-
-private: // Disabled Copy Construction
- CPresentation(CPresentation &);
- CPresentation &operator=(const CPresentation &);
-private:
- QPresentationSignalProxy m_SignalProxy;
- QHash<qt3ds::foundation::CRegisteredString, qt3ds::runtime::DataOutputDef> m_pathToDataOutMap;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.cpp
deleted file mode 100644
index 649462aa..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSPresentationFrameData.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants
-//==============================================================================
-const FLOAT DIRTY_STORE_RATIO = 0.1f;
-const FLOAT TRAVERSAL_STORE_RATIO = 0.5f;
-const FLOAT ACTIVATION_STORE_RATIO = 0.3f;
-const FLOAT DEACTIVATION_STORE_RATIO = 0.3f;
-
-//==============================================================================
-/**
- * Constructor
- */
-CPresentationFrameData::CPresentationFrameData()
- : m_DirtyList(0, 0, "Frame:DirtyList")
- , m_TraversalList(0, 0, "Frame:TraversalList")
- , m_ScriptsList(0, 0, "Frame:ScriptsList")
- , m_ActivationList(0, 0, "Frame:ActivationList")
- , m_DeactivationList(0, 0, "Frame:DeactivationList") /*,*/
-// m_SlideExitList( 0, 0, "Frame:SlideExitList" ),
-// m_SlideEnterList( 0, 0, "Frame:SlideEnterList" )
-{
-}
-
-//==============================================================================
-/**
- * Reserve memory from the memory subsytem to store the various arrays.
- * @param inElementCount the number of elements loaded
- */
-void CPresentationFrameData::Reserve(const INT32 /*inElementCount*/)
-{
-}
-
-//==============================================================================
-/**
- * Clean up the data. This is usually called at the start of the frame rhythm to
- * clean up the data from previous frame
- * Memory allocation should be clear by default.
- * Previous list could be a lot longer than current or future list which means
- * the appliation is using more memory than needed. The heuristics of both
- * initialization and runtime freeing is dependent on the presentation.
- */
-void CPresentationFrameData::Reset()
-{
- // Keep the capacity of these lists every frame since they have consistent
- // sizes from frame to frame
- m_TraversalList.Clear(false);
- m_ScriptsList.Clear(false);
-
- // These lists are more sporatic (slide changes) for now, clear them as
- // above but potential memory saving could occur by calling Clear( true ) instead
- m_ActivationList.Clear(false);
- m_DeactivationList.Clear(false);
-
- // NOTE: When we clear the dirty list, we also must ensure that the elements
- // themselves are un-dirtied to prepare for the next frame. This is done
- // by the caller of "CPresentationFrameData::Reset"
- m_DirtyList.Clear(false);
-
- // m_SlideExitList.Clear( false );
- // m_SlideEnterList.Clear( false );
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.h
deleted file mode 100644
index 332cc84a..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSPresentationFrameData.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Presentation update cycle data storage class.
- *
- * This is the data collected from the Presentation on each frame. Other subsystems
- * or external system uses these data to perform their specific operation
- */
-class CPresentationFrameData
-{
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- TElementList m_DirtyList; ///< List of elements with modified attributes
- TElementList m_TraversalList; ///< List of active elements
- TElementList m_ScriptsList; ///< List of elements where scripts are active
- TElementList
- m_ActivationList; ///< List of elements whose global active flips from false to true
- TElementList
- m_DeactivationList; ///< List of elements whose global active flops from true to false
- // TElementList m_SlideExitList; ///< List of components that exits their
- // slides
- // TElementList m_SlideEnterList; ///< List of components that enters their
- // slides
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CPresentationFrameData();
- void Reserve(const INT32 inElementCount);
-
-public: // Data Management
- void Reset();
-
- TElementList &GetDirtyList() { return m_DirtyList; }
- TElementList &GetTraversalList() { return m_TraversalList; }
- TElementList &GetScriptsList() { return m_ScriptsList; }
- TElementList &GetActivationList() { return m_ActivationList; }
- TElementList &GetDeactivationList() { return m_DeactivationList; }
- // TElementList& GetSlideExitList( ) { return m_SlideExitList;
- // }
- // TElementList& GetSlideEnterList( ) { return m_SlideEnterList; }
-
-private: // Disabled Copy Construction
- CPresentationFrameData(const CPresentationFrameData &);
- CPresentationFrameData &operator=(const CPresentationFrameData &);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.cpp
deleted file mode 100644
index 9b58a733..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSQmlElementHelper.h"
-#include "Qt3DSCommandEventTypes.h"
-#include "Qt3DSHash.h"
-#include "Qt3DSAttributeHashes.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSRuntimeFactory.h"
-#include "qmath.h"
-
-using namespace Q3DStudio;
-using namespace qt3ds;
-
-//==============================================================================
-// Constants
-//==============================================================================
-const char PRESENTATION_DELIMITER = ':';
-const char NODE_DELIMITER = '.';
-const TStringHash RESERVED_THIS = CHash::HashString("this");
-const TStringHash RESERVED_PARENT = CHash::HashString("parent");
-const TStringHash RESERVED_SCENE = CHash::HashString("Scene");
-
-//==============================================================================
-/**
-* Constructor
-*/
-CQmlElementHelper::CQmlElementHelper()
-{
-}
-
-//==============================================================================
-/**
-* Destructor
-*/
-CQmlElementHelper::~CQmlElementHelper()
-{
-}
-
-TElement *CQmlElementHelper::GetElement(qt3ds::runtime::IApplication &inApplication,
- IPresentation *inDefaultPresentation, const char *inPath,
- TElement *inStartElement)
-{
- if (inPath == nullptr || *inPath == 0)
- return nullptr;
- const char *thePath(inPath);
- const char *theSubPath = nullptr;
- IPresentation *thePresentation = nullptr;
- size_t thePathLength = ::strlen(thePath) + 1;
- char *theToken =
- Q3DStudio_allocate_desc(CHAR, thePathLength, "Token:TempPath"); // Temporary token storage
- // Try to get the specified presentation
- theSubPath = ::strchr(thePath, PRESENTATION_DELIMITER);
- TElement *theElement = inStartElement;
- if (theSubPath != nullptr) {
- UINT32 theSubPathLength = static_cast<UINT32>(theSubPath - thePath);
-
- ::strncpy(theToken, thePath, theSubPathLength);
- theToken[theSubPathLength] = '\0';
-
- thePath = theSubPath + 1;
-
- const CHAR *thePresentationName = theToken;
-
- thePresentation = inApplication.GetPresentationById(thePresentationName);
- }
- if (thePresentation == nullptr)
- thePresentation = inDefaultPresentation;
-
- // Return nil if the inStartElement is not in the specified presentation
- if (theElement != nullptr
- && (theSubPath == nullptr && theElement->GetBelongedPresentation() != thePresentation)) {
- thePresentation = theElement->GetBelongedPresentation();
- }
-
- if (thePresentation == nullptr)
- return nullptr;
-
- TStringHash theName;
- INT32 theParseCounter = 0;
-
- while (thePath != nullptr && thePath[0] != '\0') {
- ++theParseCounter;
-
- // Do some strtok() work here
- theSubPath = ::strchr(thePath, NODE_DELIMITER);
- if (theSubPath) {
- UINT32 theSubPathLength = static_cast<UINT32>(theSubPath - thePath);
- Q3DStudio_ASSERT(theSubPathLength < thePathLength);
-
- ::strncpy(theToken, thePath, theSubPathLength);
- theToken[theSubPathLength] = '\0';
-
- thePath = theSubPath + 1;
- } else {
- ::strcpy(theToken, thePath);
- thePath = nullptr;
- }
-
- // Hash the token and do some element searching
- theName = CHash::HashString(theToken);
-
- if (theName == RESERVED_PARENT) {
- if (theElement)
- theElement = theElement->GetParent();
- } else if (theName == RESERVED_THIS) {
- //Keep the original element if "this" wanted
- } else {
- if (theName == RESERVED_SCENE && theParseCounter == 1)
- theElement =
- thePresentation->GetRoot(); // theElement is nullptr, so using absolute path
-
- else if (theElement)
- theElement = theElement->FindChild(theName); // Using relative path
- }
-
- if (!theElement)
- thePath = nullptr;
- } // while
-
- Q3DStudio_free(theToken, CHAR, thePathLength);
- return theElement;
-}
-
-bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttName,
- const void *value, bool inDelay)
-{
- SAttributeKey theAttributeKey;
- theAttributeKey.m_Hash = CHash::HashAttribute(theAttName);
-
- // Early out for our single 'read only' attribute
- if (ATTRIBUTE_URI == theAttributeKey.m_Hash) {
- // we didn't push anything onto the stack
- return false;
- }
-
- // first search if it is a static property
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> thePropertyInfo =
- theElement->FindProperty(theAttributeKey.m_Hash);
-
- if (!thePropertyInfo.hasValue()) {
- // if not search in the dynamic properties
- thePropertyInfo = theElement->FindDynamicProperty(theAttributeKey.m_Hash);
- if (!thePropertyInfo.hasValue()) {
- // create a new dynamic porperty
- qt3ds::runtime::IElementAllocator &theElemAllocator(
- theElement->GetBelongedPresentation()->GetApplication().GetElementAllocator());
- qt3ds::foundation::IStringTable &theStringTable(
- theElement->GetBelongedPresentation()->GetStringTable());
- IRuntimeMetaData &theMetaData =
- theElement->GetBelongedPresentation()->GetApplication().GetMetaData();
- thePropertyInfo = theElemAllocator.CreateDynamicProperty(
- theMetaData, *theElement, theStringTable.RegisterStr(theAttName));
- }
- }
-
- if (thePropertyInfo.hasValue()) {
- UVariant theNewValue;
- QString name(thePropertyInfo->first.m_Name.c_str());
- EAttributeType theAttributeType = thePropertyInfo->first.m_Type;
- switch (theAttributeType) {
- case ATTRIBUTETYPE_INT32:
- case ATTRIBUTETYPE_HASH:
- theNewValue.m_INT32 = *(INT32 *)value;
- break;
-
- case ATTRIBUTETYPE_FLOAT:
- theNewValue.m_FLOAT = *(FLOAT *)value;
- if (name.startsWith(QLatin1String("rotation.")))
- theNewValue.m_FLOAT = qDegreesToRadians(theNewValue.m_FLOAT);
- break;
-
- case ATTRIBUTETYPE_BOOL:
- theNewValue.m_INT32 = *(INT32 *)value;
- break;
-
- case ATTRIBUTETYPE_STRING:
- theNewValue.m_StringHandle =
- theElement->GetBelongedPresentation()->GetStringTable().GetHandle(
- (const char *)value);
- break;
-
- case ATTRIBUTETYPE_POINTER:
- qCCritical(INVALID_OPERATION, "setAttribute: pointer attributes not handled.");
- return false;
- break;
-
- case ATTRIBUTETYPE_ELEMENTREF:
- qCCritical(INVALID_OPERATION, "setAttribute: ElementRef attributes are read only.");
- return false;
- break;
-
- case ATTRIBUTETYPE_FLOAT3: {
- FLOAT *vec3 = (FLOAT *)value;
- theNewValue.m_FLOAT3[0] = vec3[0];
- theNewValue.m_FLOAT3[1] = vec3[1];
- theNewValue.m_FLOAT3[2] = vec3[2];
- if (name == QLatin1String("rotation")) {
- theNewValue.m_FLOAT3[0]= qDegreesToRadians(theNewValue.m_FLOAT3[0]);
- theNewValue.m_FLOAT3[1]= qDegreesToRadians(theNewValue.m_FLOAT3[1]);
- theNewValue.m_FLOAT3[2]= qDegreesToRadians(theNewValue.m_FLOAT3[2]);
- }
- } break;
-
- case ATTRIBUTETYPE_NONE:
- case ATTRIBUTETYPE_DATADRIVEN_PARENT:
- case ATTRIBUTETYPE_DATADRIVEN_CHILD:
- case ATTRIBUTETYPECOUNT:
- default:
- qCCritical(INVALID_OPERATION, "setAttribute: Attribute has no type!");
- return false;
- break;
- }
-
- if (inDelay) {
- UVariant arg1;
- arg1.m_INT32 = theAttributeKey.m_Hash;
- theElement->GetBelongedPresentation()->FireCommand(
- COMMAND_SETPROPERTY, theElement, &arg1, &theNewValue, ATTRIBUTETYPE_HASH,
- theAttributeType);
- } else {
- theElement->SetAttribute(*thePropertyInfo, theNewValue);
- }
- } else {
- return false;
- }
- return true;
-}
-
-bool CQmlElementHelper::GetAttribute(TElement *inElement, const char *inAttribute, void *value)
-{
- SAttributeKey theAttributeKey;
- theAttributeKey.m_Hash = CHash::HashAttribute(inAttribute);
-
- // first search if it is a static property
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> thePropertyInfo =
- inElement->FindProperty(theAttributeKey.m_Hash);
-
- if (!thePropertyInfo.hasValue())
- thePropertyInfo = inElement->FindDynamicProperty(theAttributeKey.m_Hash);
-
- if (thePropertyInfo.hasValue()) {
- UVariant *theValuePtr = thePropertyInfo->second;
- EAttributeType theAttributeType = thePropertyInfo->first.m_Type;
- switch (theAttributeType) {
- case ATTRIBUTETYPE_INT32:
- case ATTRIBUTETYPE_HASH:
- *(INT32 *)value = theValuePtr->m_INT32;
- break;
-
- case ATTRIBUTETYPE_FLOAT:
- *(FLOAT *)value = theValuePtr->m_FLOAT;
- break;
-
- case ATTRIBUTETYPE_BOOL:
- *(INT32 *)value = (theValuePtr->m_INT32 != 0);
- break;
-
- case ATTRIBUTETYPE_STRING:
- *(char *)value = *inElement->GetBelongedPresentation()
- ->GetStringTable()
- .HandleToStr(theValuePtr->m_StringHandle)
- .c_str();
- break;
-
- case ATTRIBUTETYPE_POINTER:
- qCCritical(INVALID_OPERATION, "getAttribute: pointer attributes not handled.");
- return false;
- break;
-
- case ATTRIBUTETYPE_ELEMENTREF:
- qCCritical(INVALID_OPERATION, "getAttribute: ElementRef attributes are read only.");
- return false;
- break;
-
- case ATTRIBUTETYPE_FLOAT3: {
- FLOAT *vec3 = (FLOAT *)value;
- vec3[0] = theValuePtr->m_FLOAT3[0];
- vec3[1] = theValuePtr->m_FLOAT3[1];
- vec3[2] = theValuePtr->m_FLOAT3[2];
- } break;
-
- case ATTRIBUTETYPE_NONE:
- case ATTRIBUTETYPE_DATADRIVEN_PARENT:
- case ATTRIBUTETYPE_DATADRIVEN_CHILD:
- case ATTRIBUTETYPECOUNT:
- default:
- qCCritical(INVALID_OPERATION, "getAttribute: Attribute has no type!");
- return false;
- break;
- }
- } else {
- return false;
- }
- return true;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.h
deleted file mode 100644
index ec36c8ed..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlElementHelper.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_QML_ELEMENT_HELPER_H
-#define QT3DS_QML_ELEMENT_HELPER_H
-
-#include "Qt3DSApplication.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSKernelTypes.h"
-
-namespace Q3DStudio {
-
-class CQmlElementHelper
-{
-private:
- CQmlElementHelper();
- virtual ~CQmlElementHelper();
-
-public:
- static TElement *GetElement(qt3ds::runtime::IApplication &inApplication,
- IPresentation *inDefaultPresentation, const char *inPath,
- TElement *inStartElement = NULL);
-
- static bool SetAttribute(TElement *inElement, const char *inAttribute, const void *value,
- bool inDelay);
- static bool GetAttribute(TElement *inElement, const char *inAttribute, void *value);
-};
-}
-
-#endif // QT3DS_QML_ELEMENT_HELPER_H
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp
deleted file mode 100644
index e5aecc74..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp
+++ /dev/null
@@ -1,2636 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSQmlEngine.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSInputEngine.h"
-#include "Qt3DSSceneManager.h"
-#include "Qt3DSVector3.h"
-#include "Qt3DSColor.h"
-#include "Qt3DSAttributeHashes.h"
-#include "Qt3DSFileStream.h"
-#include "Qt3DSDataLogger.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/FileTools.h"
-#include "foundation/Qt3DSSystem.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSSlideSystem.h"
-#include "Qt3DSRenderModel.h"
-
-#include "EASTL/vector.h"
-#include "EASTL/list.h"
-#include <sys/stat.h>
-#include "Qt3DSCommandEventTypes.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSRuntimeFactory.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "Qt3DSRenderThreadPool.h"
-#include "Qt3DSRenderImageBatchLoader.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSAudioPlayer.h"
-#include "Qt3DSActivationManager.h"
-#include "Qt3DSParametersSystem.h"
-#include "Qt3DSQmlElementHelper.h"
-#include "q3dsqmlscript.h"
-#include "Qt3DSRenderRuntimeBindingImpl.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSImportMesh.h"
-#include "Qt3DSRenderer.h"
-#include "q3dsmaterialdefinitionparser.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "Qt3DSRenderMaterialHelpers.h"
-#include "Qt3DSRenderUIPLoader.h"
-#include "Qt3DSDMMetaData.h"
-#include "Qt3DSRenderUIPSharedTranslation.h"
-
-#include <QtQml/qqmlengine.h>
-#include <QtQml/qqmlcontext.h>
-#include <QtQml/qqmlcomponent.h>
-#include <QtQml/qjsengine.h>
-#include <QtCore/qnumeric.h>
-#include <QtCore/qfileinfo.h>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-#if defined(_DEBUG) || (_PROFILE)
-#define Q3DStudio_LOG_EVENT(S) // something
-#else
-#define Q3DStudio_LOG_EVENT(S)
-#endif
-
-using qt3ds::runtime::IApplication;
-using namespace qt3ds;
-
-namespace __SQmlEngineImpl_Basic_Structs__ {
- struct QmlScopedLock
- {
- qt3ds::foundation::Mutex *m_Mutex;
-
- QmlScopedLock(qt3ds::foundation::Mutex *mtx)
- : m_Mutex(mtx)
- {
- if (m_Mutex)
- m_Mutex->lock();
- }
-
- ~QmlScopedLock()
- {
- if (m_Mutex)
- m_Mutex->unlock();
- }
- };
-}
-
-using namespace __SQmlEngineImpl_Basic_Structs__;
-#define QML_ENGINE_MULTITHREAD_PROTECT_METHOD QmlScopedLock __locker(m_MultithreadedMutex);
-
-//==============================================================================
-// Callback handling
-/**
-* Constructor
-*/
-CScriptCallbacks::CScriptCallbacks()
- : m_CallbackList(0, 0, "CallbackList")
-{
-}
-
-/**
-* Destructor
-*/
-CScriptCallbacks::~CScriptCallbacks()
-{
- FOR_ARRAY(SFrameCallbackEntry *, theEntry, m_CallbackList)
- Q3DStudio_delete(*theEntry, SFrameCallbackEntry);
-
- m_CallbackList.Clear();
-}
-
-bool CScriptCallbacks::RegisterCallback(Q3DStudio::UINT32 callbackType,
- const TScriptCallback inCallback, void *inUserData)
-{
- // currently we only support these two types of callbacks
- if (callbackType != SCRIPT_ON_INITIALIZE && callbackType != SCRIPT_ON_UPDATE) {
- return false;
- }
-
- SFrameCallbackEntry *theFrameCallbackEntry = NULL;
-
- try {
- // note we don't care if someone registers the same function twice.
- theFrameCallbackEntry = Q3DStudio_new(SFrameCallbackEntry) SFrameCallbackEntry();
-
- if (!theFrameCallbackEntry) {
- throw "failed to allocated SFrameCallbackEntry";
- }
-
- SScriptCallbackEntry *theScriptCallbackEntry =
- Q3DStudio_new(SScriptCallbackEntry) SScriptCallbackEntry();
- if (!theScriptCallbackEntry) {
- throw "failed to allocated SScriptCallbackEntry";
- }
-
- theScriptCallbackEntry->m_CallbackType = callbackType;
- theScriptCallbackEntry->m_Function = inCallback;
- theScriptCallbackEntry->m_UserData = inUserData;
- theScriptCallbackEntry->m_Processed = false;
-
- theFrameCallbackEntry->m_Callbacks.Push(theScriptCallbackEntry);
-
- m_CallbackList.Push(theFrameCallbackEntry);
-
- } catch (const char *) {
- if (theFrameCallbackEntry)
- Q3DStudio_delete(theFrameCallbackEntry, SFrameCallbackEntry);
-
- return false;
- }
-
- return true;
-}
-
-void CScriptCallbacks::UnregisterCallback(Q3DStudio::UINT32, const TScriptCallback)
-{
- // not used so far
-}
-
-void CScriptCallbacks::ProcessCallbacks()
-{
- // Call onInitialize function
- FOR_ARRAY(SFrameCallbackEntry *, theFrameEntry, m_CallbackList)
- {
- FOR_ARRAY(SScriptCallbackEntry *, theEntry, (*theFrameEntry)->m_Callbacks)
- {
- if (((*theEntry)->m_CallbackType == SCRIPT_ON_INITIALIZE) && !(*theEntry)->m_Processed
- && (*theEntry)->m_Function) {
- (*theEntry)->m_Function((*theEntry)->m_UserData);
- (*theEntry)->m_Processed = true;
- }
- }
- }
-
- // Call onUpdate functions
- FOR_ARRAY(SFrameCallbackEntry *, theFrameEntry, m_CallbackList)
- {
- FOR_ARRAY(SScriptCallbackEntry *, theEntry, (*theFrameEntry)->m_Callbacks)
- {
- // int type = (*theEntry)->m_CallbackType;
- if ((*theEntry)->m_CallbackType == SCRIPT_ON_UPDATE && (*theEntry)->m_Function) {
- (*theEntry)->m_Function((*theEntry)->m_UserData);
- }
- }
- }
-}
-
-//==============================================================================
-//* End of helper class handling element operations
-//==============================================================================
-
-//==============================================================================
-/**
-* Helper class handling command operations
-*/
-class CQmlCommandHelper
-{
- //==============================================================================
- // Methods
- //==============================================================================
-private: // Constructors
- CQmlCommandHelper();
- virtual ~CQmlCommandHelper();
-
-public: // static Functions
- static bool SetupGotoSlideCommand(TElement &inElement, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs);
- static bool SetupGotoSlideCommand(TElement &inElement, Q3DStudio::INT32 inSlideIndex,
- const SScriptEngineGotoSlideArgs &inArgs);
-
-protected: // Static Hidden Helpers
- // static TElement* FireCommand(TEventCommandHash inCommand);
-
-public: // Static Helpers
- static TElement *GetComponentParent(TElement *inParent);
-};
-
-//==============================================================================
-/**
-* Constructor
-*/
-CQmlCommandHelper::CQmlCommandHelper()
-{
-}
-
-//==============================================================================
-/**
-* Destructor
-*/
-CQmlCommandHelper::~CQmlCommandHelper()
-{
-}
-
-static Option<Q3DStudio::UINT8> FindSlide(TElement &inElement, const char *slideName)
-{
- IPresentation *thePresentation = inElement.GetBelongedPresentation();
-
- int theSlideHashName = thePresentation->GetApplication().HashString(slideName);
- TComponent *theComponent = thePresentation->GetComponentManager().GetComponent(&inElement);
- UINT8 theSlideIndex =
- thePresentation->GetSlideSystem().FindSlide(*theComponent, theSlideHashName);
- if (theSlideIndex >= theComponent->GetSlideCount()) {
- qt3ds::foundation::CRegisteredString elemPath = thePresentation->GetElementPath(inElement);
- if (elemPath.IsValid()) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "QMLCommandHelper: goToSlide: Unable to find slide "
- << slideName <<"on element " << elemPath.c_str();
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "QMLCommandHelper: goToSlide: Unable to find slide "
- << slideName;
- }
- return Empty();
- }
-
- return theSlideIndex;
-}
-
-TElement *CQmlCommandHelper::GetComponentParent(TElement *inElement)
-{
- Q3DStudio_ASSERT(inElement);
- return &inElement->GetComponentParent();
-}
-
-bool CQmlCommandHelper::SetupGotoSlideCommand(TElement &inElement, Q3DStudio::INT32 inSlideIndex,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- IPresentation *thePresentation = inElement.GetBelongedPresentation();
- TElement *theTarget = GetComponentParent(&inElement);
- SComponentGotoSlideData theSlideData(inSlideIndex);
- theSlideData.m_Mode = inArgs.m_Mode;
- theSlideData.m_Paused = inArgs.m_Paused;
- theSlideData.m_Rate = inArgs.m_Rate;
- theSlideData.m_Reverse = inArgs.m_Reverse;
- theSlideData.m_StartTime = inArgs.m_StartTime;
- // Resolve playthroughto if it has a valid value.
- if (!isTrivial(inArgs.m_PlaythroughTo)) {
- if (AreEqual(inArgs.m_PlaythroughTo, "next"))
- theSlideData.m_PlaythroughTo = -1;
- else if (AreEqual(inArgs.m_PlaythroughTo, "previous"))
- theSlideData.m_PlaythroughTo = -2;
- else {
- // Find the slide if possible. If not, then just error leave things as they are.
-
- Option<UINT8> theSlideIndex = FindSlide(inElement, inArgs.m_PlaythroughTo);
- if (theSlideIndex.hasValue())
- theSlideData.m_PlaythroughTo = *theSlideIndex;
- }
- }
- thePresentation->GetComponentManager().SetupComponentGotoSlideCommand(theTarget, theSlideData);
- UVariant theArg1;
- UVariant theArg2;
- qt3ds::intrinsics::memZero(&theArg1, sizeof(UVariant));
- qt3ds::intrinsics::memZero(&theArg2, sizeof(UVariant));
- thePresentation->FireCommand(COMMAND_GOTOSLIDE, theTarget, &theArg1, &theArg2);
- return true;
-}
-
-bool CQmlCommandHelper::SetupGotoSlideCommand(TElement &inElement, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- Option<UINT8> theSlideIndex = FindSlide(inElement, slideName);
- if (theSlideIndex.hasValue())
- return SetupGotoSlideCommand(inElement, *theSlideIndex, inArgs);
-
- return false;
-}
-
-//==============================================================================
-//* End of helper class handling command operations
-//==============================================================================
-
-struct SEmitSignalData : public NVRefCounted
-{
- NVAllocatorCallback &m_Alloc;
- volatile QT3DSI32 mRefCount;
- INT32 m_SignalNameHandler; ///< The name of the signal to emit
- TElement *m_TargetElement; ///< The source element where the event is going to occur
-
- SEmitSignalData(NVAllocatorCallback &alloc, INT32 inSignalName, TElement *inElement)
- : m_Alloc(alloc)
- , mRefCount(0)
- , m_SignalNameHandler(inSignalName)
- , m_TargetElement(inElement)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Alloc)
-};
-
-class CQmlEngineImpl : public CQmlEngine
-{
- using TEmitSignalPtr = NVScopedRefCounted<SEmitSignalData>;
- using TEmitSignalQueue = eastl::list<TEmitSignalPtr, ForwardingAllocator>;
- using TPropertyDescAndValueList = eastl::vector<qt3ds::runtime::element::TPropertyDescAndValue>;
- using TPropertyDesc = qt3ds::runtime::element::SPropertyDesc;
-
- static const int MAX_ACTION_QUEUE_SIZE = 100;
-
-private:
- qt3ds::NVFoundationBase &m_Foundation;
- IApplication *m_Application;
- IApplication *m_ApplicationCore;
- qt3ds::foundation::Mutex m_PreloadMutex;
- qt3ds::foundation::Mutex *m_MultithreadedMutex;
-
- TEmitSignalQueue m_EmitSignalDataList;
-
- QT3DSI32 mRefCount;
-
- CScriptCallbacks m_ScriptCallbacks;
-
- QQmlEngine m_engine;
- QMap<QString, QQmlComponent *> m_components;
- QVector<Q3DSQmlScript *> m_scripts;
-
-public:
- CQmlEngineImpl(NVFoundationBase &fnd, ITimeProvider &inTimeProvider);
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- // functions from IScriptBridge
- void EnableMultithreadedAccess() override;
- void DisableMultithreadedAccess() override;
-
- void SetApplicationCore(qt3ds::runtime::IApplication &inApplication) override;
- void SetApplication(qt3ds::runtime::IApplication &inApplication) override;
- qt3ds::runtime::IApplication *GetApplication() override;
- void Initialize() override;
-
- void LoadScript(IPresentation *presentation, TElement *element, const CHAR *path) override;
- Q3DStudio::INT32 InitializeApplicationBehavior(const char *) override
- {
- return -1;
- }
-
- void ProcessFrameCallbacks(IPresentation *) override;
- void ExecuteApplicationScriptFunction(Q3DStudio::INT32, const char *) override {}
- void CallFunction(const char *, const char *,
- CScriptEngineCallFunctionArgRetriever &) override {}
-
- void ProcessSignal(IPresentation *inPresentation,
- const SEventCommand &inCommand) override;
- void ProcessCustomActions(IPresentation *inPresentation,
- const SEventCommand &inCommand) override;
- void ProcessCustomCallback(IPresentation *, const SEventCommand &) override {}
-
- void SetTableForElement(TElement &, IScriptTableProvider &) override {}
- void SetAttribute(TElement *target, const char *attName, const char *value) override;
- void SetAttribute(const char *element, const char *attName, const char *value) override;
- bool GetAttribute(TElement *target, const char *attName, char *value) override;
- bool GetAttribute(const char *element, const char *attName, char *value) override;
- void FireEvent(const char *element, const char *evtName) override;
- void SetDataInputValue(const QString &name, const QVariant &value,
- qt3ds::runtime::DataInputValueRole valueRole) override;
- void createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties,
- qt3ds::render::IQt3DSRenderer *renderer) override;
- void deleteElements(const QStringList &elementPaths,
- qt3ds::render::IQt3DSRenderer *renderer) override;
- void createMaterials(const QString &elementPath, const QStringList &materialDefinitions,
- qt3ds::render::ICustomMaterialSystem *customMaterialSystem,
- IDynamicObjectSystem *dynamicObjectSystem,
- qt3ds::render::IQt3DSRenderer *renderer) override;
- void deleteMaterials(const QString &elementPath, const QStringList &materialNames,
- qt3ds::render::IQt3DSRenderer *renderer) override;
- void createMesh(const QString &name, qt3dsimp::Mesh *mesh,
- qt3ds::render::IBufferManager *bufferManager) override;
- void deleteMeshes(const QStringList &meshNames,
- qt3ds::render::IBufferManager *bufferManager) override;
-
- void GotoSlide(const char *component, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs) override;
- void GotoSlideRelative(const char *, bool, bool, const SScriptEngineGotoSlideArgs &) override;
-
- void SetPresentationAttribute(const char *, const char *, const char *) override;
-
- // No need to implement here, as sound playing is done in Qt3DSViewerApp
- bool PlaySoundFile(const char *) override { return false; }
-
- void EnableDebugging(qt3ds::state::debugger::IMultiProtocolSocket &) override {}
- void EnableProfiling() override {}
- void StepGC() override {}
-
- // functions from CQMLEngine
- bool PeekSignal(TElement *&outElement, char *&outName) override;
- void GotoSlideIndex(const char *component, const Q3DStudio::INT32 slideIndex,
- const SScriptEngineGotoSlideArgs &inArgs) override;
- bool GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName) override;
- void GotoTime(const char *component, const Q3DStudio::FLOAT time) override;
- bool RegisterCallback(Q3DStudio::UINT32 callbackType, const TScriptCallback inCallback,
- void *inUserData) override;
- void Shutdown(qt3ds::NVFoundationBase &inFoundation) override;
-
-private:
- TElement *createMaterialContainer(TElement *parent, CPresentation *presentation);
- void createComponent(QQmlComponent *component, TElement *element);
- TElement *getTarget(const char *component);
- void listAllElements(TElement *root, QList<TElement *> &elements);
- void initializeDataInputsInPresentation(CPresentation &presentation, bool isPrimary);
- void initializeDataOutputsInPresentation(CPresentation &presentation, bool isPrimary);
- // Splits down vector attributes to components as Runtime does not really
- // handle vectors at this level anymore
- bool getAttributeVector3(QVector<QByteArray> &outAttVec, const QByteArray &attName,
- TElement *elem);
- bool getAttributeVector2(QVector<QByteArray> &outAttVec, const QByteArray &attName,
- TElement *elem);
- // build and evaluate Evaluator datainput type expression
- QJSValue buildJSFunc(const QString &userFunc);
- // pass controller name for error reporting purposes
- QVariant callJSFunc(const QString &controllerName, qt3ds::runtime::DataInputDef &diDef,
- const QVariant::Type type);
- // matches all numeric datatypes so we do not get datatype mismatch when JS
- // decides to change result datatype (f.ex from double to int when result
- // fractional part for specific input values happens to be exactly zero)
- bool isMatchingDatatype(QVariant::Type resultType, QVariant::Type propertyType);
- // find out which datainputs are used in the expression
- QVector<QString> resolveDependentDatainputs(const QString &expression,
- const QString &controllerName);
-
- // Methods to add element attributes to list for element creation
- void addStringAttribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QString &inAttName, const QString &inValue);
- void addIntAttribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QString &inAttName, int inValue);
- void addBoolAttribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QString &inAttName, bool inValue);
- void addFloatAttribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QString &inAttName, float inValue);
- void addFloat2Attribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QStringList &inAttNames, const QVector2D &inValue);
- void addFloat3Attribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QStringList &inAttNames, const QVector3D &inValue);
- void addFloat4Attribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QStringList &inAttNames, const QVector4D &inValue);
- void addElementRefAttribute(qt3ds::foundation::IStringTable &strTable,
- TPropertyDescAndValueList &list,
- const QString &inAttName, TElement *element);
- template <typename TDataType>
- void setDynamicObjectProperty(qt3ds::render::SDynamicObject &material,
- const qt3ds::render::dynamic::SPropertyDefinition &propDesc,
- const TDataType &propValue);
- QVector2D parseFloat2Property(const QString &propValue);
- QVector3D parseFloat3Property(const QString &propValue);
- QVector4D parseFloat4Property(const QString &propValue);
-
- void notifyElementCreation(const QStringList &elementNames, const QString &error);
- void notifyMaterialCreation(const QStringList &materialNames, const QString &error);
- void deleteElements(const QVector<TElement *> &elements,
- qt3ds::render::IQt3DSRenderer *renderer);
-};
-
-CQmlEngineImpl::CQmlEngineImpl(NVFoundationBase &fnd, ITimeProvider &)
- : m_Foundation(fnd)
- , m_Application(NULL)
- , m_ApplicationCore(NULL)
- , m_PreloadMutex(fnd.getAllocator())
- , m_MultithreadedMutex(NULL)
- , m_EmitSignalDataList(
- ForwardingAllocator(fnd.getAllocator(), "CQmlEngineImpl::m_EmitSignalDataList"))
- , mRefCount(0)
-{
- qmlRegisterType<Q3DSQmlBehavior>("QtStudio3D.Behavior", 1, 0, "Behavior");
- qmlRegisterType<Q3DSQmlBehavior, 1>("QtStudio3D.Behavior", 1, 1, "Behavior");
-}
-
-void CQmlEngineImpl::Shutdown(qt3ds::NVFoundationBase &inFoundation)
-{
-}
-
-void CQmlEngineImpl::EnableMultithreadedAccess()
-{
- m_MultithreadedMutex = &m_PreloadMutex;
-}
-
-void CQmlEngineImpl::DisableMultithreadedAccess()
-{
- m_MultithreadedMutex = NULL;
-}
-
-void CQmlEngineImpl::SetApplicationCore(runtime::IApplication &inApplication)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- m_ApplicationCore = &inApplication;
-}
-
-void CQmlEngineImpl::SetApplication(qt3ds::runtime::IApplication &inApplication)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- m_Application = &inApplication;
-}
-
-qt3ds::runtime::IApplication *CQmlEngineImpl::GetApplication()
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- return m_Application;
-}
-
-void CQmlEngineImpl::Initialize()
-{
- // Gather data input controlled properties
- QList<CPresentation *> presentations = m_Application->GetPresentationList();
-
- for (int i = 0; i < presentations.size(); ++i) {
- initializeDataInputsInPresentation(*presentations[i], i == 0);
- initializeDataOutputsInPresentation(*presentations[i], i == 0);
- }
-}
-
-void CQmlEngineImpl::SetAttribute(TElement *target, const char *attName, const char *value)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- if (target) {
- bool success = CQmlElementHelper::SetAttribute(target, attName, value, false);
- if (!success) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::SetAttribute: "
- << "failed to set attribute on element"
- << target << ":" << attName << ":" << value;
- }
- }
-}
-
-void CQmlEngineImpl::SetAttribute(const char *element, const char *attName, const char *value)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
-
- TElement *theTarget = getTarget(element);
- if (theTarget) {
- bool success = CQmlElementHelper::SetAttribute(theTarget, attName, value, false);
- if (!success) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::SetAttribute: "
- << "failed to set attribute on element"
- << element << ":" << attName << ":" << value;
- }
- }
-}
-
-bool CQmlEngineImpl::GetAttribute(TElement *target, const char *attName, char *value)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
-
- if (target) {
- bool success = CQmlElementHelper::GetAttribute(target, attName, value);
- if (!success) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::GetAttribute: "
- << "failed to get attribute on element"
- << target << ":" << attName << ":" << value;
- }
- return success;
- }
-
- return false;
-}
-
-bool CQmlEngineImpl::GetAttribute(const char *element, const char *attName, char *value)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
-
- TElement *theTarget = getTarget(element);
- if (theTarget) {
- bool success = CQmlElementHelper::GetAttribute(theTarget, attName, value);
- if (!success) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::GetAttribute: "
- << "failed to get attribute on element"
- << element << ":" << attName << ":" << value;
- }
- return success;
- }
-
- return false;
-}
-
-void CQmlEngineImpl::LoadScript(IPresentation *presentation, TElement *element, const CHAR *path)
-{
- QString presPath = QFileInfo(presentation->GetFilePath()).absolutePath();
-
- QString sourcePath(presPath + QLatin1Char('/') + path);
- sourcePath.replace(QLatin1Char('\\'), QLatin1Char('/'));
-
- TElement *parent = element->GetParent();
- if (!parent)
- return;
-
- if (!m_components.contains(sourcePath)) {
- m_components[sourcePath] = new QQmlComponent(&m_engine, QUrl::fromLocalFile(sourcePath),
- &m_engine);
- }
-
- QQmlComponent *component = m_components[sourcePath];
- if (component->status() == QQmlComponent::Ready) {
- createComponent(component, element);
- } else if (component->status() == QQmlComponent::Error) {
- qWarning() << "Error while loading script"
- << component->url().toString()
- << ":" << component->errorString();
- } else {
- QObject::connect(component, &QQmlComponent::statusChanged,
- [this, component, element] (QQmlComponent::Status status) {
- if (status == QQmlComponent::Ready) {
- createComponent(component, element);
- } else {
- qWarning() << "Error while loading script"
- << component->url().toString()
- << ":" << component->errorString();
- }
- }
- );
- }
-}
-
-void CQmlEngineImpl::FireEvent(const char *element, const char *evtName)
-{
- TElement *theElement = getTarget(element);
- if (theElement && theElement->GetActive() == true) {
- IPresentation *thePresentation = theElement->GetBelongedPresentation();
- thePresentation->FireEvent(CHash::HashEventCommand(evtName), theElement);
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::FireEvent: "
- << "failed to find element: "
- << element << " " << evtName;
- }
-}
-
-void CQmlEngineImpl::SetDataInputValue(
- const QString &name, const QVariant &value,
- qt3ds::runtime::DataInputValueRole valueRole = qt3ds::runtime::DataInputValueRole::Value)
-{
- qt3ds::runtime::DataInputMap &diMap = m_Application->dataInputMap();
- if (diMap.contains(name)) {
- qt3ds::runtime::DataInputDef &diDef = diMap[name];
- switch (valueRole) {
- case qt3ds::runtime::DataInputValueRole::Value: { // switch (valueRole)
- diDef.value = value;
- const QVector<qt3ds::runtime::DataInOutAttribute> &ctrlAtt
- = diDef.controlledAttributes;
- for (const qt3ds::runtime::DataInOutAttribute &ctrlElem : ctrlAtt) {
- switch (ctrlElem.propertyType) {
- case ATTRIBUTETYPE_DATAINPUT_TIMELINE: {
- // Quietly ignore other than number type data inputs when adjusting timeline
- if (diDef.type == qt3ds::runtime::DataInOutTypeRangedNumber) {
- TTimeUnit endTime = 0;
- TElement *element = getTarget(ctrlElem.elementPath.constData());
- TComponent *component = static_cast<TComponent *>(element);
- endTime = component->GetTimePolicy().GetLoopingDuration();
-
- // Normalize the value to dataInput range
- qreal newTime = qreal(endTime) * (qreal(value.toFloat() - diDef.min)
- / qreal(diDef.max - diDef.min));
- GotoTime(ctrlElem.elementPath.constData(), float(newTime / 1000.0));
- }
- break;
- }
- case ATTRIBUTETYPE_DATAINPUT_SLIDE: {
- // Quietly ignore other than string type when adjusting slide
- if (diDef.type == qt3ds::runtime::DataInOutTypeString) {
- const QByteArray valueStr = value.toString().toUtf8();
- GotoSlide(ctrlElem.elementPath.constData(), valueStr.constData(),
- SScriptEngineGotoSlideArgs());
- }
- break;
- }
- // Silently ignore invalid incoming type if it does not
- // match with the datainput type except with type Variant, for which
- // the incoming value is cast to target property type without checking.
- // Caveat emptor.
-
- // For Evaluator, typecheck the JS evaluation result to see if it
- // matches with the target property.
-
- // Handle ranged number similarly to generic float
- // if it is bound to properties other
- // than timeline animation i.e. disregard range min and max
- case ATTRIBUTETYPE_FLOAT: {
- float valueFloat;
- if (diDef.type == qt3ds::runtime::DataInOutTypeFloat
- || diDef.type == qt3ds::runtime::DataInOutTypeRangedNumber
- || diDef.type == qt3ds::runtime::DataInOutTypeVariant) {
- valueFloat = value.toFloat();
- } else if (diDef.type == qt3ds::runtime::DataInOutTypeEvaluator) {
- valueFloat = callJSFunc(name, diDef, QVariant::Type::Double).toFloat();
- } else {
- qWarning() << __FUNCTION__ << "Property type "
- << ctrlElem.propertyType
- << " not matching with Datainput " << name
- << " data type "
- << diDef.type;
- break;
- }
-
- SetAttribute(ctrlElem.elementPath.constData(),
- ctrlElem.attributeName.first().constData(),
- reinterpret_cast<const char *>(&valueFloat));
- break;
- }
- case ATTRIBUTETYPE_FLOAT4: {
- QVector4D valueVec;
- if (diDef.type == qt3ds::runtime::DataInOutTypeVector4) {
- valueVec = value.value<QVector4D>();
- } else {
- qWarning() << __FUNCTION__ << "Property type "
- << ctrlElem.propertyType
- << " not matching with Datainput " << name
- << " data type "
- << diDef.type;
- break;
- }
- // Set the values of vector attribute components separately
- for (int i = 0; i < 4; i++) {
- const float val = valueVec[i];
- SetAttribute(ctrlElem.elementPath.constData(),
- ctrlElem.attributeName[i].constData(),
- reinterpret_cast<const char *>(&val));
- }
- break;
- }
- case ATTRIBUTETYPE_FLOAT3: {
- QVector3D valueVec;
- if (diDef.type == qt3ds::runtime::DataInOutTypeVector3
- || diDef.type == qt3ds::runtime::DataInOutTypeVariant) {
- valueVec = value.value<QVector3D>();
- } else if (diDef.type == qt3ds::runtime::DataInOutTypeEvaluator) {
- const QVariant res = callJSFunc(name, diDef, QVariant::Type::Vector3D);
- valueVec = res.value<QVector3D>();
- } else {
- qWarning() << __FUNCTION__ << "Property type "
- << ctrlElem.propertyType
- << " not matching with Datainput " << name
- << " data type "
- << diDef.type;
- break;
- }
- // Set the values of vector attribute components separately
- for (int i = 0; i < 3; i++) {
- const float val = valueVec[i];
- SetAttribute(ctrlElem.elementPath.constData(),
- ctrlElem.attributeName[i].constData(),
- reinterpret_cast<const char *>(&val));
- }
- break;
- }
- case ATTRIBUTETYPE_FLOAT2:
- {
- QVector2D valueVec;
- if (diDef.type == qt3ds::runtime::DataInOutTypeVector2
- || diDef.type == qt3ds::runtime::DataInOutTypeVariant) {
- valueVec = value.value<QVector2D>();
- } else if (diDef.type == qt3ds::runtime::DataInOutTypeEvaluator) {
- const QVariant res = callJSFunc(name, diDef, QVariant::Type::Vector2D);
- valueVec = res.value<QVector2D>();
- } else {
- qWarning() << __FUNCTION__ << "Property type "
- << ctrlElem.propertyType
- << " not matching with Datainput " << name
- << " data type "
- << diDef.type;
- break;
- }
- // Set the values of vector attribute components separately
- for (int i = 0; i < 2; i++) {
- const float val = valueVec[i];
- SetAttribute(ctrlElem.elementPath.constData(),
- ctrlElem.attributeName[i].constData(),
- reinterpret_cast<const char *>(&val));
- }
- break;
- }
- case ATTRIBUTETYPE_BOOL: {
- uint valueBool; // SetAttribute requires at least 32-bit variable
- if (diDef.type == qt3ds::runtime::DataInOutTypeBoolean
- || diDef.type == qt3ds::runtime::DataInOutTypeVariant) {
- valueBool = value.toBool();
- } else if (diDef.type == qt3ds::runtime::DataInOutTypeEvaluator) {
- valueBool = callJSFunc(name, diDef, QVariant::Type::Bool).toBool();
- } else {
- qWarning() << __FUNCTION__ << "Property type "
- << ctrlElem.propertyType
- << " not matching with Datainput " << name
- << " data type "
- << diDef.type;
- break;
- }
-
- SetAttribute(ctrlElem.elementPath.constData(),
- ctrlElem.attributeName.first().constData(),
- reinterpret_cast<const char *>(&valueBool));
- break;
- }
- case ATTRIBUTETYPE_STRING: {
- QByteArray valueStr;
- // Allow scalar number types also as inputs to string attribute
- if (diDef.type == qt3ds::runtime::DataInOutTypeString
- || diDef.type == qt3ds::runtime::DataInOutTypeRangedNumber
- || diDef.type == qt3ds::runtime::DataInOutTypeFloat
- || diDef.type == qt3ds::runtime::DataInOutTypeVariant) {
- valueStr = value.toString().toUtf8();
- } else if (diDef.type == qt3ds::runtime::DataInOutTypeEvaluator) {
- valueStr = callJSFunc(name, diDef, QVariant::Type::String)
- .toString().toUtf8();
- } else {
- qWarning() << __FUNCTION__ << "Property type "
- << ctrlElem.propertyType
- << " not matching with Datainput " << name
- << " data type "
- << diDef.type;
- break;
- }
-
- SetAttribute(ctrlElem.elementPath.constData(),
- ctrlElem.attributeName.first().constData(),
- valueStr.constData());
- break;
- }
- default:
- QT3DS_ALWAYS_ASSERT_MESSAGE("Unexpected data input type");
- break;
- }
- }
-
- // Trigger re-evaluation of Evaluator datainputs that use this datainput
- // as source data. Do this by calling setDataInputValue for evaluator
- // with the current set value of the Evaluator (_not_ the evaluator result)
- for (auto dependent : diDef.dependents) {
- // Dependent list also contains the name of this datainput if
- // the value of this datainput is used as source data. In this case
- // obviously do not cause infinite recursion.
- if (dependent != name)
- SetDataInputValue(dependent, diMap[dependent].value);
- }
- break;
- }
- case qt3ds::runtime::DataInputValueRole::Max: { // switch (valueRole)
- diDef.max = value.toFloat();
- break;
- }
- case qt3ds::runtime::DataInputValueRole::Min: { // switch (valueRole)
- diDef.min = value.toFloat();
- break;
- }
- }
- }
-}
-
-static int _idCounter = 0;
-
-void CQmlEngineImpl::createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties,
- qt3ds::render::IQt3DSRenderer *renderer)
-{
- using namespace qt3ds::render;
-
- int elementIndex = -1;
- QString error;
- CPresentation *presentation = nullptr;
- QStringList elementPaths;
- elementPaths.reserve(properties.size());
- QVector<QHash<QString, QVariant>> theProperties = properties;
- const QString namePropName = QStringLiteral("name");
-
- for (int i = 0; i < theProperties.size(); ++i) {
- auto &props = theProperties[i];
- QString newElementName = props.value(namePropName).toString();
- if (newElementName.isEmpty()) {
- // The id number on generated name will match generated graph object identifiers
- newElementName = QStringLiteral("NewElement_%1").arg(_idCounter + i + 1);
- props.insert(namePropName, newElementName);
- }
- elementPaths << parentElementPath + QLatin1Char('.') + newElementName;
- }
- QVector<TElement *> createdElements;
- TElement *parentElement = nullptr;
-
- auto handleError = [&]() {
- if (!error.isEmpty())
- deleteElements(createdElements, renderer);
- notifyElementCreation(elementPaths, error);
- };
-
- // Resolve parent element
- QByteArray theParentPath = parentElementPath.toUtf8();
- parentElement = getTarget(theParentPath.constData());
-
- if (!parentElement) {
- error = QObject::tr("Invalid parent element: '%1'").arg(parentElementPath);
- handleError();
- return;
- }
-
- auto parentTranslator = static_cast<Qt3DSTranslator *>(parentElement->GetAssociation());
-
- if (!parentTranslator || !GraphObjectTypes::IsNodeType(
- parentTranslator->GetUIPType())) {
- error = QObject::tr("Parent element is not a valid node: '%1'").arg(parentElementPath);
- handleError();
- return;
- }
-
- TElement &component = parentElement->GetComponentParent();
- auto &parentObject = static_cast<SNode &>(parentTranslator->RenderObject());
- presentation = static_cast<CPresentation *>(parentElement->GetBelongedPresentation());
-
- // Resolve slide
- QByteArray theSlideName = slideName.toUtf8();
- ISlideSystem &slideSystem = presentation->GetSlideSystem();
- int slideIndex = slideSystem.FindSlide(component, theSlideName.constData());
- int currentSlide = static_cast<TComponent &>(component).GetCurrentSlide();
- if (slideIndex == 0xff) {
- error = QObject::tr("Invalid slide name for time context: '%1'").arg(slideName);
- handleError();
- return;
- }
-
- auto &strTable = presentation->GetStringTable();
-
- const QString sourcePathPropName = QStringLiteral("sourcepath");
- const QString startTimePropName = QStringLiteral("starttime");
- const QString endTimePropName = QStringLiteral("endtime");
- const QString eyeBallPropName = QStringLiteral("eyeball");
- const QString typePropName = QStringLiteral("type");
-
- Q3DStudio::UVariant attValue;
- parentElement->GetAttribute(Q3DStudio::ATTRIBUTE_STARTTIME, attValue);
- const int parentStartTime = int(attValue.m_INT32);
- parentElement->GetAttribute(Q3DStudio::ATTRIBUTE_ENDTIME, attValue);
- const int parentEndTime = int(attValue.m_INT32);
-
- for (const auto &currentProps : qAsConst(theProperties)) {
- ++_idCounter;
- ++elementIndex;
-
- // Remove properties requiring custom handling
- QHash<QString, QVariant> fixedProps = currentProps;
- QString newElementName = fixedProps.take(namePropName).toString();
- QByteArray newElementNameBa = newElementName.toUtf8();
-
- QString refMatName = fixedProps.take(QStringLiteral("material")).toString();
- if (refMatName.startsWith(QLatin1Char('#'))) // Absolute reference
- refMatName = refMatName.mid(1);
- else if (!refMatName.isEmpty() && !refMatName.contains(QLatin1Char('/')))
- refMatName = QStringLiteral("/") + refMatName;
-
- // Make sure the name is not duplicate
- TElement *existingChild
- = parentElement->FindChild(CHash::HashString(newElementNameBa.constData()));
- if (existingChild) {
- error = QObject::tr("Element already exists: '%1'").arg(elementPaths[elementIndex]);
- handleError();
- return;
- }
-
- const CRegisteredString regName = strTable.RegisterStr(newElementNameBa);
- TPropertyDescAndValueList elementProperties;
- CRegisteredString metaType;
- const CRegisteredString elementSubType;
- GraphObjectTypes::Enum objectType = GraphObjectTypes::Unknown;
-
- QString typeStr = fixedProps.take(typePropName).toString();
- if (typeStr.isEmpty() || typeStr.compare(QLatin1String("model"),
- Qt::CaseInsensitive) == 0) {
- metaType = strTable.RegisterStr("Model");
- objectType = GraphObjectTypes::Model;
- } else if (typeStr.compare(QLatin1String("group"), Qt::CaseInsensitive) == 0) {
- metaType = strTable.RegisterStr("Group");
- objectType = GraphObjectTypes::Node;
- }
-
- // Set default values for missing mandatory properties
- bool eyeBall = true;
- fixedProps.value(eyeBallPropName, true).toBool();
- if (objectType == GraphObjectTypes::Model && !fixedProps.contains(sourcePathPropName)) {
- addStringAttribute(strTable, elementProperties, sourcePathPropName,
- QStringLiteral("#Cube"));
- }
- if (!fixedProps.contains(startTimePropName))
- addIntAttribute(strTable, elementProperties, startTimePropName, parentStartTime);
- if (!fixedProps.contains(endTimePropName))
- addIntAttribute(strTable, elementProperties, endTimePropName, parentEndTime);
- if (!fixedProps.contains(eyeBallPropName))
- addBoolAttribute(strTable, elementProperties, eyeBallPropName, true);
- else
- eyeBall = fixedProps.value(eyeBallPropName).toBool();
-
- QHashIterator<QString, QVariant> it(fixedProps);
- while (it.hasNext()) {
- it.next();
- switch (it.value().type()) {
- case QVariant::Double:
- addFloatAttribute(strTable, elementProperties, it.key(), it.value().toFloat());
- break;
- case QVariant::Bool:
- addBoolAttribute(strTable, elementProperties, it.key(), it.value().toBool());
- break;
- case QVariant::Int:
- addIntAttribute(strTable, elementProperties, it.key(), it.value().toInt());
- break;
- case QVariant::String:
- addStringAttribute(strTable, elementProperties, it.key(), it.value().toString());
- break;
- case QVariant::Vector3D: {
- QVector3D vec = it.value().value<QVector3D>();
- if (it.key() == QLatin1String("rotation")) {
- vec.setX(qDegreesToRadians(vec.x()));
- vec.setY(qDegreesToRadians(vec.y()));
- vec.setZ(qDegreesToRadians(vec.z()));
- }
- // TODO: Need to support also colors if non-model elements what need colors are
- // TODO: supported (QT3DS-3381)
- QStringList atts;
- atts << (it.key() + QLatin1String(".x"))
- << (it.key() + QLatin1String(".y"))
- << (it.key() + QLatin1String(".z"));
- addFloat3Attribute(strTable, elementProperties, atts, vec);
- break;
- }
- default:
- error = QObject::tr("Unsupported property type for: '%1'").arg(it.key());
- handleError();
- return;
- }
- }
-
- // Create new element
- QString localElementPath = elementPaths[elementIndex];
- int colonIndex = localElementPath.indexOf(QLatin1Char(':'));
- if (colonIndex != -1)
- localElementPath = localElementPath.mid(colonIndex + 1);
- TElement &newElem = m_Application->GetElementAllocator().CreateElement(
- regName, metaType, elementSubType,
- toConstDataRef(elementProperties.data(), QT3DSU32(elementProperties.size())),
- presentation, parentElement, false);
- newElem.m_Path = strTable.RegisterStr(localElementPath);
-
- // Insert the new element into the correct slide
- if (!slideSystem.addSlideElement(component, slideIndex, newElem, eyeBall)) {
- // Delete created element if adding to slide failed
- m_Application->GetElementAllocator().ReleaseElement(newElem, true);
- error = QObject::tr("Failed to add the new element to a slide");
- handleError();
- return;
- }
-
- SGraphObject *referencedMaterial = nullptr;
- if (objectType == GraphObjectTypes::Model) {
- // Create material element
- const CRegisteredString matName = strTable.RegisterStr("refmat");
- const CRegisteredString matType = strTable.RegisterStr("ReferencedMaterial");
- TPropertyDescAndValueList matProperties;
- TElement &newMatElem = m_Application->GetElementAllocator().CreateElement(
- matName, matType, elementSubType,
- toConstDataRef(matProperties.data(), QT3DSU32(matProperties.size())),
- presentation, &newElem, false);
-
- QString matElemPath = localElementPath + QLatin1String(".refmat");
- newMatElem.m_Path = strTable.RegisterStr(matElemPath);
-
- if (!slideSystem.addSlideElement(component, slideIndex, newMatElem, eyeBall)) {
- // Delete created element and material element if adding to slide failed
- m_Application->GetElementAllocator().ReleaseElement(newElem, true);
- error = QObject::tr("Failed to add the new material element to a slide");
- handleError();
- return;
- }
- // First check if we can resolve the referenced material before creating any objects
- // Find a match in material container
- // If the specified material is not available in original presentation, or was not
- // specified, use the first material found as placeholder
- TElement *rootElement = presentation->GetRoot();
- TElement *container = rootElement->FindChild(CHash::HashString("__Container"));
- TElement *firstChild = nullptr;
- if (container) {
- TElement *nextChild = container->GetChild();
- firstChild = nextChild;
- while (nextChild) {
- QString childName = QString::fromUtf8(nextChild->m_Name);
- if (childName.endsWith(refMatName)) {
- auto tr = static_cast<Qt3DSTranslator *>(
- nextChild->GetAssociation());
- referencedMaterial = static_cast<SGraphObject *>(
- &tr->RenderObject());
- break;
- }
- nextChild = nextChild->GetSibling();
- }
- }
-
- if (!referencedMaterial) {
- // Empty material is assumed to be deliberate, so don't warn in that case
- if (!refMatName.isEmpty()) {
- qWarning() << __FUNCTION__ << "Requested material" << refMatName
- << "was not found. Trying to find a fallback material.";
- }
- if (firstChild) {
- auto tr = static_cast<Qt3DSTranslator *>(firstChild->GetAssociation());
- referencedMaterial = static_cast<SGraphObject *>(&tr->RenderObject());
- }
- if (!referencedMaterial) {
- // We could create default material into the container in case there is
- // no materials in there, but it is unlikely that such a presentation would
- // be used in practice.
- m_Application->GetElementAllocator().ReleaseElement(newElem, true);
- error = QObject::tr("Unable to resolve a fallback material");
- handleError();
- return;
- }
- }
- }
-
- // Create model SGraphObject
- NVAllocatorCallback &allocator = presentation->GetScene()->allocator();
- SModel *newObject = QT3DS_NEW(allocator, SModel)();
- newObject->m_Id = strTable.RegisterStr((QByteArrayLiteral("__newObj_")
- + QByteArray::number(_idCounter)).constData());
- parentObject.AddChild(*newObject);
-
- Qt3DSTranslator::CreateTranslatorForElement(newElem, *newObject, allocator);
-
- if (referencedMaterial) {
- // Create material SGraphObject
- SReferencedMaterial *newMaterial = QT3DS_NEW(allocator, SReferencedMaterial)();
- newMaterial->m_Id = strTable.RegisterStr(
- (QByteArrayLiteral("__newMat_")
- + QByteArray::number(_idCounter)).constData());
- newMaterial->m_ReferencedMaterial = referencedMaterial;
- newObject->AddMaterial(*newMaterial);
- }
-
- // Determine if element should be active based on start/end times
- TTimeUnit startTime = 0;
- TTimeUnit stopTime = 0;
- if (newElem.GetAttribute(Q3DStudio::ATTRIBUTE_STARTTIME, attValue))
- startTime = TTimeUnit(attValue.m_INT32);
- if (newElem.GetAttribute(Q3DStudio::ATTRIBUTE_ENDTIME, attValue))
- stopTime = TTimeUnit(attValue.m_INT32);
- TTimeUnit localTime = newElem.GetActivityZone().GetItemLocalTime(newElem);
-
- bool isActiveRightNow = eyeBall && localTime >= startTime && localTime <= stopTime
- && currentSlide == slideIndex;
-
- newElem.SetActive(isActiveRightNow);
- newObject->m_Flags.SetActive(isActiveRightNow);
- if (eyeBall)
- newElem.GetActivityZone().UpdateItemInfo(newElem);
-
- createdElements << &newElem;
- }
-
- renderer->ChildrenUpdated(parentObject);
-
- handleError();
-}
-
-// Only supports deleting element types that can be added via createElement.
-void CQmlEngineImpl::deleteElements(const QStringList &elementPaths,
- qt3ds::render::IQt3DSRenderer *renderer)
-{
- QVector<TElement *> elements;
- // Convert the path list to set for quicker lookups
- QSet<QString> pathSet = elementPaths.toSet();
-
- for (auto &elementPath : elementPaths) {
- // Check that parent is not already included in the deleted elements
- int idx = elementPath.lastIndexOf(QLatin1Char('.'));
- bool parentFound = false;
- while (idx != -1) {
- QString parentPath = elementPath.left(idx);
- if (pathSet.contains(parentPath)) {
- parentFound = true;
- break;
- }
- idx = parentPath.lastIndexOf(QLatin1Char('.'));
- }
- if (!parentFound) {
- // Resolve element
- QByteArray thePath = elementPath.toUtf8();
- TElement *element = getTarget(thePath.constData());
- if (element)
- elements << element;
- }
- }
- deleteElements(elements, renderer);
-}
-
-TElement *CQmlEngineImpl::createMaterialContainer(TElement *parent, CPresentation *presentation)
-{
- TPropertyDescAndValueList prop;
- auto &strTable = presentation->GetStringTable();
- const auto matName = strTable.RegisterStr(QStringLiteral("__Container"));
- const auto matType = strTable.RegisterStr(QStringLiteral("Material"));
- const auto matClass = CRegisteredString();
- TElement &element = m_Application->GetElementAllocator().CreateElement(
- matName, matType, matClass,
- toConstDataRef(prop.data(), prop.size()),
- presentation, parent, false);
- return &element;
-}
-
-/**
- Creates material into material container of the presentation that owns the specified element.
- The materialDefinition parameter can contain a .materialdef file path or
- the entire material definition in the .materialdef format.
-*/
-void CQmlEngineImpl::createMaterials(const QString &elementPath,
- const QStringList &materialDefinitions,
- ICustomMaterialSystem *customMaterialSystem,
- IDynamicObjectSystem *dynamicObjectSystem,
- qt3ds::render::IQt3DSRenderer *renderer)
-{
- CPresentation *presentation = nullptr;
- QString error;
- QString presPath;
- QString projPath;
- struct MaterialInfo {
- QString materialDefinition;
- QString materialName;
- QMap<QString, QString> materialProps;
- QMap<QString, QMap<QString, QString>> textureProps;
- };
- QVector<MaterialInfo *> materialInfos;
- QVector<TElement *> createdElements;
-
- auto handleError = [&]() {
- if (!error.isEmpty())
- deleteElements(createdElements, renderer);
- QStringList materialNames;
- for (auto &materialInfo : materialInfos)
- materialNames << materialInfo->materialName;
- qDeleteAll(materialInfos);
- notifyMaterialCreation(materialNames, error);
- };
-
- auto getMaterialInfos = [&]() {
- for (auto &materialDefinition : materialDefinitions) {
- MaterialInfo *info = new MaterialInfo;
- info->materialDefinition = materialDefinition;
- Q3DSMaterialDefinitionParser::getMaterialInfo(materialDefinition, projPath, presPath,
- info->materialName, info->materialProps,
- info->textureProps);
- materialInfos << info;
- }
- };
-
- QByteArray thePath = elementPath.toUtf8();
- TElement *element = getTarget(thePath.constData());
-
- if (!element) {
- error = QObject::tr("Invalid element: '%1'").arg(elementPath);
- presentation = m_Application->GetPrimaryPresentation();
- presPath = QFileInfo(presentation->GetFilePath()).absolutePath();
- projPath = presentation->getProjectPath();
- getMaterialInfos();
- handleError();
- return;
- }
-
- presentation = static_cast<CPresentation *>(element->GetBelongedPresentation());
- presPath = QFileInfo(presentation->GetFilePath()).absolutePath();
- projPath = presentation->getProjectPath();
- getMaterialInfos();
-
- // Find material container
- auto &strTable = presentation->GetStringTable();
- NVAllocatorCallback &allocator = presentation->GetScene()->allocator();
- TElement *rootElement = presentation->GetRoot();
- const auto containerName = strTable.RegisterStr("__Container");
- TElement *container = rootElement->FindChild(CHash::HashString(containerName.c_str()));
- if (!container)
- container = createMaterialContainer(rootElement, presentation);
-
- for (auto &materialInfo : materialInfos) {
- if (materialInfo->materialName.isEmpty() || materialInfo->materialProps.isEmpty()) {
- error = QObject::tr("Invalid material definition: '%1'")
- .arg(materialInfo->materialDefinition);
- handleError();
- return;
- }
-
- // We don't care about the path parameter
- const QString pathStr = QStringLiteral("path");
- if (materialInfo->materialProps.contains(pathStr))
- materialInfo->materialProps.remove(pathStr);
-
- // Check that the material doesn't already exist in container
- TElement *firstChild = nullptr;
- TElement *nextChild = container->GetChild();
- firstChild = nextChild;
- while (nextChild) {
- QString childName = QString::fromUtf8(nextChild->m_Name);
- if (childName == materialInfo->materialName) {
- error = QObject::tr("Material already exists in material container");
- handleError();
- return;
- }
- nextChild = nextChild->GetSibling();
- }
-
- // Create material element in the container based on the material definition
- auto &metaData = m_Application->GetMetaData();
- const auto matName = strTable.RegisterStr(materialInfo->materialName);
- const bool isCustomMaterial = (materialInfo->materialProps.value(QStringLiteral("type"))
- == QLatin1String("CustomMaterial"));
- CRegisteredString matType;
- CRegisteredString matClass;
- QHash<QString, qt3ds::render::dynamic::SPropertyDefinition> dynPropDefs;
-
- if (isCustomMaterial) {
- CRegisteredString sourcePath
- = strTable.RegisterStr(materialInfo->materialProps.value(
- QStringLiteral("sourcepath")).toUtf8());
- matType = strTable.RegisterStr("CustomMaterial");
- matClass = sourcePath; // Create just one class per shader
- if (sourcePath.IsValid()) {
- Option<qt3dsdm::SMetaDataCustomMaterial> matMetaData =
- metaData.GetMaterialMetaDataBySourcePath(sourcePath.c_str());
- if (!matMetaData.hasValue()) {
- metaData.LoadMaterialXMLFile(matType.c_str(), matClass.c_str(), matName.c_str(),
- sourcePath.c_str());
- matMetaData = metaData.GetMaterialMetaDataBySourcePath(sourcePath.c_str());
- }
- if (matMetaData.hasValue()) {
- qt3ds::render::IUIPLoader::CreateMaterialClassFromMetaMaterial(
- matClass, m_Foundation, *customMaterialSystem, matMetaData,
- strTable);
- NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> customProperties;
- customProperties = dynamicObjectSystem->GetProperties(matClass);
- for (QT3DSU32 i = 0, end = customProperties.size(); i < end; ++i) {
- QString propName = QString::fromUtf8(customProperties[i].m_Name.c_str());
- if (materialInfo->materialProps.contains(propName))
- dynPropDefs.insert(propName, customProperties[i]);
- }
- } else {
- error = QObject::tr("Could not resolve properties for CustomMaterial");
- handleError();
- return;
- }
- } else {
- error = QObject::tr("Missing sourcepath in definition of CustomMaterial");
- handleError();
- return;
- }
- } else {
- matType = strTable.RegisterStr("Material");
- }
-
- auto createElementPropsFromDefProps = [&](const QMap<QString, QString> &defProps,
- TPropertyDescAndValueList &elementProps,
- const CRegisteredString &elementType) {
- QMapIterator<QString, QString> propIter(defProps);
- while (propIter.hasNext()) {
- propIter.next();
- if (dynPropDefs.contains(propIter.key()))
- continue; // Dynamic properties are added directly to graph objects later
-
- auto propName = strTable.RegisterStr(propIter.key());
- ERuntimeDataModelDataType dataType;
- ERuntimeAdditionalMetaDataType additionalType;
- dataType = metaData.GetPropertyType(elementType, propName);
- additionalType = metaData.GetAdditionalType(elementType, propName);
-
- switch (dataType) {
- case ERuntimeDataModelDataTypeLong: {
- addIntAttribute(strTable, elementProps, propIter.key(),
- propIter.value().toInt());
- break;
- }
- case ERuntimeDataModelDataTypeFloat: {
- addFloatAttribute(strTable, elementProps, propIter.key(),
- propIter.value().toFloat());
- break;
- }
- case ERuntimeDataModelDataTypeFloat2: {
- QVector2D vec = parseFloat2Property(propIter.value());
- QStringList atts;
- atts << (propIter.key() + QLatin1String(".x"))
- << (propIter.key() + QLatin1String(".y"));
- addFloat2Attribute(strTable, elementProps, atts, vec);
- break;
- }
- case ERuntimeDataModelDataTypeFloat3: {
- QVector3D vec = parseFloat3Property(propIter.value());
- if (additionalType == ERuntimeAdditionalMetaDataTypeRotation) {
- vec.setX(qDegreesToRadians(vec.x()));
- vec.setY(qDegreesToRadians(vec.y()));
- vec.setZ(qDegreesToRadians(vec.z()));
- }
- QStringList atts;
- atts << (propIter.key() + QLatin1String(".x"))
- << (propIter.key() + QLatin1String(".y"))
- << (propIter.key() + QLatin1String(".z"));
- addFloat3Attribute(strTable, elementProps, atts, vec);
- break;
- }
- case ERuntimeDataModelDataTypeFloat4: {
- QVector4D vec = parseFloat4Property(propIter.value());
- QStringList atts;
- if (additionalType == ERuntimeAdditionalMetaDataTypeColor) {
- atts << (propIter.key() + QLatin1String(".r"))
- << (propIter.key() + QLatin1String(".g"))
- << (propIter.key() + QLatin1String(".b"))
- << (propIter.key() + QLatin1String(".a"));
- } else {
- atts << (propIter.key() + QLatin1String(".x"))
- << (propIter.key() + QLatin1String(".y"))
- << (propIter.key() + QLatin1String(".z"))
- << (propIter.key() + QLatin1String(".w"));
- }
- addFloat4Attribute(strTable, elementProps, atts, vec);
- break;
- }
- case ERuntimeDataModelDataTypeBool: {
- bool boolValue = propIter.value().compare(QLatin1String("true"),
- Qt::CaseInsensitive) == 0;
- addBoolAttribute(strTable, elementProps, propIter.key(), boolValue);
- break;
- }
- case ERuntimeDataModelDataTypeStringRef:
- case ERuntimeDataModelDataTypeString: {
- addStringAttribute(strTable, elementProps, propIter.key(), propIter.value());
- break;
- }
- case ERuntimeDataModelDataTypeLong4: {
- if (additionalType == ERuntimeAdditionalMetaDataTypeImage) {
- // Insert placeholder for now, will be patched later
- addElementRefAttribute(strTable, elementProps, propIter.key(), nullptr);
- }
- break;
- }
- default:
- error = QObject::tr("Unsupported material property type for property: '%1'")
- .arg(propIter.key());
- return;
- }
- }
- };
-
- TPropertyDescAndValueList elementProps;
- createElementPropsFromDefProps(materialInfo->materialProps, elementProps, matType);
- if (!error.isEmpty()) {
- handleError();
- return;
- }
-
- TElement &newMatElem = m_Application->GetElementAllocator().CreateElement(
- matName, matType, matClass,
- toConstDataRef(elementProps.data(), QT3DSU32(elementProps.size())),
- presentation, container, false);
- newMatElem.SetActive(true);
-
- // Create image elements
- CRegisteredString imageType = strTable.RegisterStr("Image");
- QMapIterator<QString, QMap<QString, QString>> texIter(materialInfo->textureProps);
- QHash<QString, TElement *> imageElementMap;
- while (texIter.hasNext()) {
- texIter.next();
- elementProps.clear();
- createElementPropsFromDefProps(texIter.value(), elementProps, imageType);
- if (!error.isEmpty()) {
- m_Application->GetElementAllocator().ReleaseElement(newMatElem, true);
- handleError();
- return;
- }
- CRegisteredString imageName = strTable.RegisterStr(texIter.key());
-
- TElement &newImageElem = m_Application->GetElementAllocator().CreateElement(
- imageName, imageType, CRegisteredString(),
- toConstDataRef(elementProps.data(), QT3DSU32(elementProps.size())),
- presentation, &newMatElem, false);
- imageElementMap.insert(texIter.key(), &newImageElem);
- newImageElem.SetActive(true);
- }
-
- // Create render object for the material
- qt3ds::render::SGraphObject *newMaterial = nullptr;
- CRegisteredString newMatId = strTable.RegisterStr(
- (QByteArrayLiteral("__newMat_") + QByteArray::number(++_idCounter))
- .constData());
- if (isCustomMaterial) {
- newMaterial = customMaterialSystem->CreateCustomMaterial(matClass, allocator);
- newMaterial->m_Id = newMatId;
- auto dynObj = static_cast<qt3ds::render::SDynamicObject *>(newMaterial);
-
- QHashIterator<QString, qt3ds::render::dynamic::SPropertyDefinition>
- dynPropIter(dynPropDefs);
- while (dynPropIter.hasNext()) {
- dynPropIter.next();
- QByteArray propValStr = materialInfo->materialProps.value(
- dynPropIter.key()).toUtf8();
- const auto propDesc = dynPropIter.value();
- switch (propDesc.m_DataType) {
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSRenderBool: {
- bool boolValue = propValStr.compare(QByteArrayLiteral("true"),
- Qt::CaseInsensitive) == 0;
- setDynamicObjectProperty(*dynObj, propDesc, boolValue);
- break;
- }
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSF32:
- setDynamicObjectProperty(*dynObj, propDesc, propValStr.toFloat());
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSI32:
- if (!propDesc.m_IsEnumProperty) {
- setDynamicObjectProperty(*dynObj, propDesc, propValStr.toInt());
- } else {
- const NVConstDataRef<CRegisteredString> &enumNames
- = propDesc.m_EnumValueNames;
- for (QT3DSU32 i = 0, end = enumNames.size(); i < end; ++i) {
- if (propValStr.compare(enumNames[i].c_str()) == 0) {
- setDynamicObjectProperty(*dynObj, propDesc, i);
- break;
- }
- }
- }
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec2:
- setDynamicObjectProperty(*dynObj, propDesc, parseFloat2Property(propValStr));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec3:
- setDynamicObjectProperty(*dynObj, propDesc, parseFloat3Property(propValStr));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4:
- setDynamicObjectProperty(*dynObj, propDesc, parseFloat4Property(propValStr));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr:
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderImage2DPtr: {
- CRegisteredString regStr;
- regStr = strTable.RegisterStr(propValStr);
- setDynamicObjectProperty(*dynObj, propDesc, regStr);
- break;
- }
- default:
- error = QObject::tr("Unsupported custom material property type for '%1'")
- .arg(dynPropIter.key());
- m_Application->GetElementAllocator().ReleaseElement(newMatElem, true);
- handleError();
- return;
- }
- }
- } else {
- newMaterial = QT3DS_NEW(allocator, qt3ds::render::SDefaultMaterial)();
- newMaterial->m_Id = newMatId;
-
- // Update element refs for image elements and create graph objects & translators
- QHashIterator<QString, TElement *> imageIter(imageElementMap);
- while (imageIter.hasNext()) {
- imageIter.next();
- TElement *imageElem = imageIter.value();
- UVariant *propValue = newMatElem.FindPropertyValue(imageElem->m_Name);
- if (propValue) {
- propValue->m_ElementHandle = imageIter.value()->GetHandle();
-
- qt3ds::render::SImage *newImageObj
- = QT3DS_NEW(allocator, qt3ds::render::SImage)();
- newImageObj->m_Id = strTable.RegisterStr(
- (QByteArrayLiteral("__newImage_")
- + QByteArray::number(++_idCounter)).constData());
- qt3ds::render::Qt3DSTranslator::CreateTranslatorForElement(
- *imageElem, *newImageObj, allocator);
- }
- }
- createdElements << &newMatElem;
- }
-
- qt3ds::render::Qt3DSTranslator::CreateTranslatorForElement(newMatElem, *newMaterial,
- allocator);
- }
-
- handleError();
-}
-
-void CQmlEngineImpl::deleteMaterials(const QString &elementPath,
- const QStringList &materialNames,
- IQt3DSRenderer *renderer)
-{
- // Material class (i.e. the shader) is not deleted as those can be shared between materials,
- // so we just delete the material elements from the container and the related render objects
-
- QByteArray thePath = elementPath.toUtf8();
- TElement *element = getTarget(thePath.constData());
- Q_ASSERT_X(element, __FUNCTION__, QStringLiteral("Invalid element path: '%1'")
- .arg(elementPath).toUtf8());
- CPresentation *presentation = static_cast<CPresentation *>(element->GetBelongedPresentation());
-
- // Find material container
- auto &strTable = presentation->GetStringTable();
- TElement *rootElement = presentation->GetRoot();
- const auto containerName = strTable.RegisterStr("__Container");
- TElement *container = rootElement->FindChild(CHash::HashString(containerName.c_str()));
- Q_ASSERT_X(container, __FUNCTION__,
- QStringLiteral("No material container found for element: '%1'")
- .arg(elementPath).toUtf8());
-
- QVector<TElement *> elementsToDelete;
- for (const auto &materialName : materialNames) {
- TElement *firstChild = nullptr;
- TElement *nextChild = container->GetChild();
- firstChild = nextChild;
- while (nextChild) {
- QString childName = QString::fromUtf8(nextChild->m_Name);
- if (childName == materialName)
- elementsToDelete << nextChild;
- nextChild = nextChild->GetSibling();
- }
- }
-
- deleteElements(elementsToDelete, renderer);
-}
-
-void CQmlEngineImpl::createMesh(const QString &name, qt3dsimp::Mesh *mesh,
- qt3ds::render::IBufferManager *bufferManager)
-{
- // Add the custom meshes to buffer manager.
- bufferManager->loadCustomMesh(name, mesh);
-}
-
-void CQmlEngineImpl::deleteMeshes(const QStringList &meshNames,
- qt3ds::render::IBufferManager *bufferManager)
-{
- for (const auto &meshName : meshNames) {
- if (!meshName.isEmpty()) {
- CRegisteredString regName = bufferManager->GetStringTable().RegisterStr(meshName);
- bufferManager->InvalidateBuffer(regName);
- }
- }
-}
-
-void CQmlEngineImpl::GotoSlide(const char *component, const char *slideName,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- TElement *theTarget = getTarget(component);
- if (theTarget) {
- CQmlCommandHelper::SetupGotoSlideCommand(*theTarget, slideName, inArgs);
- } else {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::GotoSlide: Unable to find component " << component;
- }
-}
-
-void CQmlEngineImpl::GotoSlideRelative(const char *component, bool inNextSlide, bool inWrap,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- TElement *theTarget = getTarget(component);
- if (theTarget) {
- theTarget = &theTarget->GetComponentParent();
- if (theTarget && theTarget->GetActive()) {
- TComponent *theComponent = static_cast<TComponent *>(theTarget);
- Q3DStudio::INT32 theSlide = theComponent->GetCurrentSlide();
- Q3DStudio::INT32 theSlideCount = theComponent->GetSlideCount();
- theSlide = inNextSlide ? theSlide + 1 : theSlide - 1;
- if (theSlide < 1) {
- if (inWrap)
- theSlide = theSlideCount - 1;
- else
- theSlide = 1;
- } else if (theSlide == theSlideCount) {
- if (inWrap)
- theSlide = 1;
- else
- theSlide = theSlideCount - 1;
- }
- if (theSlide != theComponent->GetCurrentSlide()) {
- CQmlCommandHelper::SetupGotoSlideCommand(*theTarget, theSlide, inArgs);
- }
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "QmlEngine::GotoSlideRelative: Component is not active: " << component;
- }
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "QmlEngine::GotoSlideRelative: failed to find component: " << component;
- }
-}
-
-void CQmlEngineImpl::SetPresentationAttribute(const char *presId, const char *, const char *value)
-{
- if (isTrivial(presId))
- return;
- if (presId[0] == '#')
- ++presId;
- CPresentation *thePresentation = m_Application->GetPresentationById(presId);
- if (thePresentation) {
- bool active = AreEqualCaseless(nonNull(value), "True");
- thePresentation->SetActive(active);
- }
-}
-
-void CQmlEngineImpl::GotoSlideIndex(const char *component, const Q3DStudio::INT32 slideIndex,
- const SScriptEngineGotoSlideArgs &inArgs)
-{
- TElement *theTarget = getTarget(component);
- if (theTarget) {
- CQmlCommandHelper::SetupGotoSlideCommand(*theTarget, slideIndex, inArgs);
- } else {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::GotoSlide: Unable to find component " << component;
- }
-}
-
-bool CQmlEngineImpl::GetSlideInfo(const char *element, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
-
- TElement *theTarget = getTarget(element);
- if (theTarget && theTarget->IsComponent()) {
- IPresentation *thePresentation = theTarget->GetBelongedPresentation();
- TComponent *theComponent = thePresentation->GetComponentManager().GetComponent(theTarget);
- currentIndex = int(theComponent->GetCurrentSlide());
- previousIndex = int(theComponent->GetPreviousSlide());
- if (currentIndex > 0) {
- currentName = QString::fromLocal8Bit(
- thePresentation->GetSlideSystem().GetSlideName(
- qt3ds::runtime::SSlideKey(*theComponent, QT3DSU32(currentIndex))));
- } else {
- currentName.clear();
- }
- if (previousIndex > 0) {
- previousName = QString::fromLocal8Bit(
- thePresentation->GetSlideSystem().GetSlideName(
- qt3ds::runtime::SSlideKey(*theComponent, QT3DSU32(previousIndex))));
- } else {
- previousName.clear();
- }
- return true;
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::GetSlideInfo: Supplied element is not a component " << element;
- }
- return false;
-}
-
-void CQmlEngineImpl::GotoTime(const char *component, const Q3DStudio::FLOAT time)
-{
- TElement *theTarget = getTarget(component);
- if (theTarget && theTarget->GetActive()) {
- UVariant theArg1;
- UVariant theArg2;
-
- IPresentation *thePresentation = theTarget->GetBelongedPresentation();
-
- theArg1.m_INT32 = static_cast<INT32>(time * 1000);
-
- TElement *theParentTarget = &theTarget->GetComponentParent();
-
- thePresentation->FireCommand(COMMAND_GOTOTIME, theParentTarget, &theArg1, &theArg2);
- }
-}
-
-bool CQmlEngineImpl::RegisterCallback(Q3DStudio::UINT32 callbackType,
- const TScriptCallback inCallback, void *inUserData)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- return m_ScriptCallbacks.RegisterCallback(callbackType, inCallback, inUserData);
-}
-
-void CQmlEngineImpl::ProcessFrameCallbacks(IPresentation *)
-{
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- m_ScriptCallbacks.ProcessCallbacks();
-
- for (Q3DSQmlScript *script : m_scripts)
- script->update();
-}
-
-void CQmlEngineImpl::ProcessSignal(IPresentation *inPresentation,
- const SEventCommand &inCommand)
-{
- using qt3ds::runtime::TIdValuePair;
- QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
- TElement *theElement = inCommand.m_Target; // the element that is a behavior
-
- CPresentation *thePresentation = (CPresentation *)inPresentation;
- // IParametersSystem& theParametersManager = thePresentation->GetParametersSystem();
- qt3ds::foundation::IStringTable &theStrTable(thePresentation->GetStringTable());
-
- CRegisteredString theSignal = theStrTable.HandleToStr(inCommand.m_Arg1.m_INT32);
-
- if (!theSignal.IsValid() || m_EmitSignalDataList.size() > CQmlEngineImpl::MAX_ACTION_QUEUE_SIZE)
- return;
-
- TEmitSignalPtr theTemp = QT3DS_NEW(m_Foundation.getAllocator(), SEmitSignalData)(
- m_Foundation.getAllocator(), inCommand.m_Arg1.m_INT32, theElement);
- m_EmitSignalDataList.push_back(theTemp);
-}
-
-
-//==============================================================================
-/**
-* Handle custom actions
-* @param inCommand carrier of command and parameter information
-*/
-void CQmlEngineImpl::ProcessCustomActions(IPresentation *presentation,
- const SEventCommand &command)
-{
- TElement *element = command.m_Target;
- for (Q3DSQmlScript *script : m_scripts) {
- if (script->hasBehavior(element)) {
- IParametersSystem &parametersManager
- = static_cast<CPresentation *>(presentation)->GetParametersSystem();
- INT32 groupId = command.m_Arg1.m_INT32;
- UINT32 numParams = parametersManager.GetNumParameters(groupId);
- if (numParams == 0) {
- QT3DS_ASSERT(false);
- return;
- }
-
- qt3ds::runtime::TIdValuePair tempData = parametersManager.GetParameter(groupId, 0);
- if (tempData.first != CHash::HashString("string")) {
- QT3DS_ASSERT(false);
- return;
- }
-
- CRegisteredString functionName = presentation->GetStringTable().HandleToStr(
- tempData.second.m_StringHandle);
- script->call(functionName.c_str());
- return;
- }
- }
-}
-
-bool CQmlEngineImpl::PeekSignal(TElement *&outElement, char *&outName)
-{
- if (m_EmitSignalDataList.empty())
- return false;
-
- NVScopedRefCounted<SEmitSignalData> theAction = m_EmitSignalDataList.front();
- m_EmitSignalDataList.pop_front();
-
- outElement = theAction->m_TargetElement;
- if (outElement) {
- IPresentation *thePresentation = outElement->GetBelongedPresentation();
- qt3ds::foundation::IStringTable &theStrTable(thePresentation->GetStringTable());
- CRegisteredString theSignal = theStrTable.HandleToStr(theAction->m_SignalNameHandler);
- outName = (char *)theSignal.c_str();
- } else {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "CQmlEngineImpl::PeekCustomAction: Unable to find element: EmitSignal queue error";
- outName = NULL;
- }
-
- return true;
-}
-
-void CQmlEngineImpl::createComponent(QQmlComponent *component, TElement *element)
-{
- TElement *parent = element->GetParent();
- if (!parent)
- return;
-
- QQmlContext *context = new QQmlContext(&m_engine, &m_engine);
- QObject *obj = component->beginCreate(context);
- if (!obj) {
- context->deleteLater();
- return;
- }
- Q3DSQmlBehavior *behaviorObject = qobject_cast<Q3DSQmlBehavior *>(obj);
- if (behaviorObject == nullptr) {
- obj->deleteLater();
- context->deleteLater();
- return;
- }
-
- auto script = new Q3DSQmlScript(*this, *behaviorObject, *element, *parent);
- component->completeCreate();
- behaviorObject->setScript(script);
-
- script->setParent(component);
- obj->setParent(script);
- m_scripts.push_back(script);
-}
-
-TElement *CQmlEngineImpl::getTarget(const char *component) {
- TElement *target = NULL;
- QStringList split = QString(component).split(":");
- if (split.size() > 1) {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPresentationById(split.at(0).toStdString().c_str()),
- split.at(1).toStdString().c_str(), NULL);
- } else {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPrimaryPresentation(),
- split.at(0).toStdString().c_str(), NULL);
- }
- return target;
-}
-
-void CQmlEngineImpl::listAllElements(TElement *root, QList<TElement *> &elements)
-{
- elements.append(root);
- TElement *nextChild = root->GetChild();
- while (nextChild) {
- listAllElements(nextChild, elements);
- nextChild = nextChild->GetSibling();
- }
-}
-
-void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentation,
- bool isPrimary)
-{
- TElement *parent = presentation.GetRoot();
- QList<TElement *> elements;
- listAllElements(parent, elements);
- qt3ds::runtime::DataInputMap &diMap = m_Application->dataInputMap();
-
-// #TODO: Remove below once QT3DS-3510 has been implemented in the editor
- qt3ds::runtime::DataOutputMap &doMap = m_Application->dataOutputMap();
-// #TODO: Remove above once QT3DS-3510 has been implemented in the editor
-
- qt3ds::foundation::IStringTable &strTable(presentation.GetStringTable());
- QHash<CRegisteredString, qt3ds::runtime::DataOutputDef> elementPathToDataOutputDefMap;
- for (TElement *element : qAsConst(elements)) {
- Option<QT3DSU32> ctrlIndex = element->FindPropertyIndex(ATTRIBUTE_CONTROLLEDPROPERTY);
- if (ctrlIndex.hasValue()) {
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> propertyInfo =
- element->GetPropertyByIndex(*ctrlIndex);
- UVariant *valuePtr = propertyInfo->second;
- QString valueStr =
- QString::fromUtf8(strTable.HandleToStr(valuePtr->m_StringHandle));
- if (!valueStr.isEmpty()) {
- QStringList splitValues = valueStr.split(QChar(' '));
- for (int i = 1; i < splitValues.size(); i += 2) {
- QString controllerName = splitValues[i - 1];
- // remove datainput name prefix "$"
- controllerName.remove(0, 1);
- if (diMap.contains(controllerName)) {
- qt3ds::runtime::DataInOutAttribute ctrlElem;
- if (!isPrimary) {
- // Prepend presentation id to element path
- ctrlElem.elementPath = presentation.GetName();
- ctrlElem.elementPath.append(QByteArrayLiteral(":"));
- }
- ctrlElem.attributeName.append(splitValues[i].toUtf8());
- if (ctrlElem.attributeName.first() == QByteArrayLiteral("@timeline")) {
- ctrlElem.propertyType = ATTRIBUTETYPE_DATAINPUT_TIMELINE;
- TElement *component = &element->GetComponentParent();
- ctrlElem.elementPath.append(component->m_Path);
- } else if (ctrlElem.attributeName.first() == QByteArrayLiteral("@slide")) {
- ctrlElem.propertyType = ATTRIBUTETYPE_DATAINPUT_SLIDE;
- TElement *component = &element->GetComponentParent();
- ctrlElem.elementPath.append(component->m_Path);
- } else if (diMap[controllerName].type
- == qt3ds::runtime::DataInOutTypeVector3) {
- // special handling for vector datatype to handle
- // expansion from <propertyname> to <propertyname>.x .y .z
- QVector<QByteArray> attVec;
- bool success = getAttributeVector3(
- attVec, ctrlElem.attributeName.first().constData(),
- element);
- if (!attVec.empty() && success) {
- ctrlElem.attributeName = attVec;
- ctrlElem.elementPath.append(element->m_Path);
- ctrlElem.propertyType = ATTRIBUTETYPE_FLOAT3;
- } else {
- qWarning() << __FUNCTION__ << "Property "
- << ctrlElem.attributeName.first()
- << " was not expanded to vector";
- ctrlElem.propertyType = ATTRIBUTETYPE_NONE;
- }
- } else if (diMap[controllerName].type
- == qt3ds::runtime::DataInOutTypeVector2) {
- // special handling for vector datatype to handle
- // expansion from <propertyname> to <propertyname>.x .y
- QVector<QByteArray> attVec;
- bool success = getAttributeVector2(
- attVec, ctrlElem.attributeName.first().constData(),
- element);
- if (!attVec.empty() && success) {
- ctrlElem.attributeName = attVec;
- ctrlElem.elementPath.append(element->m_Path);
- ctrlElem.propertyType = ATTRIBUTETYPE_FLOAT2;
- } else {
- qWarning() << __FUNCTION__ << "Property "
- << ctrlElem.attributeName.first()
- << " was not expanded to vector";
- ctrlElem.propertyType = ATTRIBUTETYPE_NONE;
- }
- } else if (diMap[controllerName].type
- == qt3ds::runtime::DataInOutTypeEvaluator) {
- diMap[controllerName].evalFunc
- = buildJSFunc(diMap[controllerName].evaluator);
- auto referencedDIs = resolveDependentDatainputs(
- diMap[controllerName].evaluator, controllerName);
- // add this evaluator datainput to the dependent list
- // for those datainputs that are used in the expression
- // for this evaluator
- for (auto ref : referencedDIs)
- diMap[ref].dependents.append(controllerName);
-
- ctrlElem.elementPath.append(element->m_Path);
- TStringHash attHash = CHash::HashAttribute(
- ctrlElem.attributeName.first().constData());
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> attInfo
- = element->FindProperty(attHash);
- if (attInfo.hasValue())
- ctrlElem.propertyType = attInfo->first.m_Type;
- } else {
- // all other scalar datatypes
- ctrlElem.elementPath.append(element->m_Path);
- TStringHash attHash = CHash::HashAttribute(
- ctrlElem.attributeName.first().constData());
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> attInfo
- = element->FindProperty(attHash);
- if (attInfo.hasValue()) {
- ctrlElem.propertyType = attInfo->first.m_Type;
- } else {
- ctrlElem.propertyType = ATTRIBUTETYPE_NONE;
- qWarning() << __FUNCTION__ << "Property "
- << ctrlElem.attributeName.first() << " not existing!";
- }
- }
- qt3ds::runtime::DataInputDef &diDef = diMap[controllerName];
- diDef.controlledAttributes.append(ctrlElem);
-
-// #TODO: Remove below once QT3DS-3510 has been implemented in the editor
- // Note, in this temp implementation only the LAST of multiple attributes
- // will be notified from the object under the DataInput name..
- qt3ds::runtime::DataInputDef inDef = diMap[controllerName];
- qt3ds::runtime::DataOutputDef &doDef = doMap[controllerName];
- doDef.observedAttribute = ctrlElem;
- doDef.type = inDef.type;
- doDef.min = inDef.min;
- doDef.max = inDef.max;
-
- if (ctrlElem.propertyType == ATTRIBUTETYPE_DATAINPUT_TIMELINE) {
- // Find the TElement for the @timeline attrib
- TElement *target = nullptr;
- QStringList split
- = QString(ctrlElem.elementPath).split(QLatin1Char(':'));
- if (split.size() > 1) {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPresentationById(
- split.at(0).toStdString().c_str()),
- split.at(1).toStdString().c_str(), nullptr);
- } else {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPrimaryPresentation(),
- split.at(0).toStdString().c_str(), nullptr);
- }
-
- doDef.timelineComponent = static_cast<TComponent *>(target);
- } else if (ctrlElem.propertyType == ATTRIBUTETYPE_DATAINPUT_SLIDE) {
- // Slide notifications are already done with separate signal
- // No need to process
- } else {
- // Other than slide or timeline attributes are handled by CPresentation
- CRegisteredString rString = strTable.RegisterStr(ctrlElem.elementPath);
- elementPathToDataOutputDefMap.insertMulti(rString, doDef);
- }
-// #TODO: Remove above once QT3DS-3510 has been implemented in the editor
- }
- }
- }
- }
- }
-
-// #TODO: Remove below once QT3DS-3510 has been implemented in the editor
- presentation.AddToDataOutputMap(elementPathToDataOutputDefMap);
-// #TODO: Remove above once QT3DS-3510 has been implemented in the editor
-}
-
-void CQmlEngineImpl::initializeDataOutputsInPresentation(CPresentation &presentation,
- bool isPrimary)
-{
- TElement *parent = presentation.GetRoot();
- QList<TElement *> elements;
- listAllElements(parent, elements);
- qt3ds::runtime::DataOutputMap &doMap = m_Application->dataOutputMap();
-
- qt3ds::foundation::IStringTable &strTable(presentation.GetStringTable());
- QHash<CRegisteredString, qt3ds::runtime::DataOutputDef> elementPathToDataOutputDefMap;
- for (TElement *element : qAsConst(elements)) {
- Option<QT3DSU32> ctrlIndex = element->FindPropertyIndex(ATTRIBUTE_OBSERVEDPROPERTY);
- if (ctrlIndex.hasValue()) {
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> propertyInfo =
- element->GetPropertyByIndex(*ctrlIndex);
- UVariant *valuePtr = propertyInfo->second;
- QString valueStr =
- QString::fromUtf8(strTable.HandleToStr(valuePtr->m_StringHandle));
-
- if (!valueStr.isEmpty()) {
- QStringList splitValues = valueStr.split(QLatin1Char(' '));
-
- // Single value pair expected for DataOutputs
- QString observerName = splitValues[0];
- QString observedAttribute = splitValues[1];
- // Remove DataOutput name prefix "$"
- observerName.remove(0, 1);
- qt3ds::runtime::DataOutputDef &doDef = doMap[observerName];
-
- if (doMap.contains(observerName)) {
- qt3ds::runtime::DataInOutAttribute obsElem;
- if (!isPrimary) {
- // Prepend presentation id to element path
- obsElem.elementPath = presentation.GetName();
- obsElem.elementPath.append(QByteArrayLiteral(":"));
- }
-
- obsElem.attributeName.append(observedAttribute.toUtf8());
-
- if (obsElem.attributeName.first() == QByteArrayLiteral("@timeline")) {
- // Timeline requires special additional handling
- obsElem.propertyType = ATTRIBUTETYPE_DATAINPUT_TIMELINE;
- TElement *component = &element->GetComponentParent();
- obsElem.elementPath.append(component->m_Path);
-
- // Find the TElement for the @timeline attrib
- TElement *target = nullptr;
- QStringList split = QString(obsElem.elementPath).split(QLatin1Char(':'));
- if (split.size() > 1) {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPresentationById(
- split.at(0).toStdString().c_str()),
- split.at(1).toStdString().c_str(), nullptr);
- } else {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPrimaryPresentation(),
- split.at(0).toStdString().c_str(), nullptr);
- }
- doDef.timelineComponent = static_cast<TComponent *>(target);
- } else if (obsElem.attributeName.first() == QByteArrayLiteral("@slide")) {
- // Slides are ignored if set as we have separate signal in the API for
- // slide transitions
- } else {
- // Every other type is handled by CPresentation
- obsElem.elementPath.append(element->m_Path);
- TStringHash attHash = CHash::HashAttribute(
- obsElem.attributeName.first().constData());
- Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> attInfo
- = element->FindProperty(attHash);
- if (attInfo.hasValue()) {
- obsElem.propertyType = attInfo->first.m_Type;
- } else {
- obsElem.propertyType = ATTRIBUTETYPE_NONE;
- qWarning() << __FUNCTION__ << "Property"
- << obsElem.attributeName.first() << "not existing!";
- }
-
- doDef.observedAttribute = obsElem;
- CRegisteredString rString = strTable.RegisterStr(obsElem.elementPath);
- elementPathToDataOutputDefMap.insertMulti(rString, doDef);
- }
- }
- }
- }
- }
-
- // Inform the presentation of the ready data output defs
- presentation.AddToDataOutputMap(elementPathToDataOutputDefMap);
-}
-
-// Bit clumsy way of getting from "position" to "position .x .y .z" and enabling datainput
-// support for vectorized types. UIP parser has already thrown away all vector
-// type attributes and at this point we are operating with scalar components only.
-// We check if this element has a property attName.x or attName.r to find out it
-// we should expand property attName to XYZ or RGB vector
-bool CQmlEngineImpl::getAttributeVector3(QVector<QByteArray> &outAttVec,
- const QByteArray &attName,
- TElement *elem)
-{
- auto hashName = Q3DStudio::CHash::HashAttribute(attName + ".x");
-
- if (!elem->FindProperty(hashName).isEmpty()) {
- outAttVec.append(attName + ".x");
- outAttVec.append(attName + ".y");
- outAttVec.append(attName + ".z");
- return true;
- }
- hashName = Q3DStudio::CHash::HashAttribute(attName + ".r");
- if (!elem->FindProperty(hashName).isEmpty()) {
- outAttVec.append(attName + ".r");
- outAttVec.append(attName + ".g");
- outAttVec.append(attName + ".b");
- return true;
- }
- return false;
-}
-
-bool CQmlEngineImpl::getAttributeVector2(QVector<QByteArray> &outAttVec,
- const QByteArray &attName,
- TElement *elem)
-{
- auto hashName = Q3DStudio::CHash::HashAttribute(attName + ".x");
-
- if (!elem->FindProperty(hashName).isEmpty()) {
- outAttVec.append(attName + ".x");
- outAttVec.append(attName + ".y");
- return true;
- }
-
- hashName = Q3DStudio::CHash::HashAttribute(attName + ".u");
- if (!elem->FindProperty(hashName).isEmpty()) {
- outAttVec.append(attName + ".u");
- outAttVec.append(attName + ".v");
- return true;
- }
- return false;
-}
-
-QJSValue CQmlEngineImpl::buildJSFunc(const QString &userFunc)
-{
- auto res = this->m_engine.evaluate(userFunc);
- if (res.isError()) {
- qWarning() << __FUNCTION__
- << "Uncaught exception during datainput evaluation. Evaluator function" << userFunc;
- }
- return res;
-}
-
-QVariant CQmlEngineImpl::callJSFunc(const QString &controllerName,
- qt3ds::runtime::DataInputDef &diDef,
- const QVariant::Type type)
-{
- qt3ds::runtime::DataInputMap &diMap = m_Application->dataInputMap();
- QJSValueList args;
- QVector<QString> sourceDIs = resolveDependentDatainputs(diDef.evaluator, controllerName);
-
- // get the most recent set values for datainput sources (arguments) in the expression
- for (auto diVal : sourceDIs)
- args << this->m_engine.toScriptValue(diMap[diVal].value);
-
- if (diDef.evalFunc.isCallable()) {
- QJSValue res = diDef.evalFunc.call(args);
- if (res.isError()) {
- qWarning() << __FUNCTION__ << "Error during datainput" << controllerName
- << "evaluator call:" << res.toString() << "\nEvaluator function"
- << diDef.evaluator;
- return QVariant::Invalid;
- }
-
- QVariant ret = res.toVariant();
- if (ret.isValid() && isMatchingDatatype(ret.type(), type)) {
- // further check if the result is valid number
- if (ret.type() == QVariant::Double && qIsNaN(res.toNumber())) {
- qWarning() << __FUNCTION__ << "Datainput" << controllerName << "evaluator"
- << "result not a number (NaN)."
- << "\nEvaluator function" << diDef.evaluator;
- return QVariant::Invalid;
- } else {
- return ret;
- }
- } else {
- qWarning() << __FUNCTION__ << "Datainput" << controllerName << "evaluator"
- << "result not valid or matching with target attribute type. Result type"
- << QVariant::typeToName(ret.type()) << " target attribute type "
- << QVariant::typeToName(type) << "\nEvaluator function" << diDef.evaluator;
- }
- } else {
- qWarning() << __FUNCTION__ << "Datainput" << controllerName << "evaluator"
- << diDef.evaluator << " not valid callable";
- }
- return QVariant::Invalid;
-}
-
-bool CQmlEngineImpl::isMatchingDatatype(QVariant::Type resultType, QVariant::Type propertyType)
-{
- if (resultType == propertyType)
- return true;
- // Allow binding from numeric datainput to string target
- if ((resultType == QVariant::Double || resultType == QVariant::Int
- || resultType == QVariant::LongLong)
- && (propertyType == QVariant::Double || propertyType == QVariant::Int
- || propertyType == QVariant::LongLong || propertyType == QVariant::String)) {
- return true;
- }
- return false;
-}
-
-QVector<QString> CQmlEngineImpl::resolveDependentDatainputs(const QString &expression,
- const QString &controllerName)
-{
- QVector<QString> ret;
- qt3ds::runtime::DataInputMap &diMap = m_Application->dataInputMap();
- if (!expression.contains("function", Qt::CaseInsensitive)) {
- qWarning() << __FUNCTION__ << "Function keyword not found in datainput"
- << controllerName << "evaluator";
- return QVector<QString>();
- }
-
- int argListStart = expression.indexOf("function(") + 9;
- int argListStop = expression.indexOf(')', argListStart);
- QString argstr = expression.mid(argListStart , argListStop - argListStart);
- QStringList args = argstr.split(',');
-
- for (auto di : args) {
- auto diTrim = di.trimmed();
- if (diMap.contains(diTrim)) {
- if (diMap[diTrim].type == qt3ds::runtime::DataInOutTypeEvaluator
- && diTrim != controllerName) {
- qWarning() << __FUNCTION__ << "Invalid evaluator function in" << controllerName
- << ". Another evaluator is used as source data.";
- } else {
- ret.append(diTrim);
- }
- } else {
- qWarning() << __FUNCTION__ << "Evaluator in" << controllerName << "evaluator"
- << "is using unknown datainput" << diTrim << " as input argument name";
- }
- }
- return ret;
-}
-
-void CQmlEngineImpl::addStringAttribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QString &inAttName, const QString &inValue)
-{
- QByteArray valueBa = inValue.toUtf8();
- qt3ds::foundation::CStringHandle strHandle = strTable.GetHandle(valueBa.constData());
- UVariant theValue;
- theValue.m_StringHandle = strHandle.handle();
- const CRegisteredString attStr = strTable.RegisterStr(inAttName);
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_STRING), theValue));
-}
-
-void CQmlEngineImpl::addIntAttribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QString &inAttName, int inValue)
-{
- UVariant theValue;
- theValue.m_INT32 = inValue;
- const CRegisteredString attStr = strTable.RegisterStr(inAttName);
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_INT32), theValue));
-}
-
-void CQmlEngineImpl::addBoolAttribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QString &inAttName, bool inValue)
-{
- UVariant theValue;
- theValue.m_INT32 = int(inValue);
- const CRegisteredString attStr = strTable.RegisterStr(inAttName);
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_BOOL), theValue));
-}
-
-void CQmlEngineImpl::addFloatAttribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QString &inAttName, float inValue)
-{
- UVariant theValue;
- theValue.m_FLOAT = inValue;
- const CRegisteredString attStr = strTable.RegisterStr(inAttName);
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_FLOAT), theValue));
-}
-
-void CQmlEngineImpl::addFloat2Attribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QStringList &inAttNames, const QVector2D &inValue)
-{
- for (int i = 0; i < 2; ++i) {
- UVariant theValue;
- theValue.m_FLOAT = inValue[i];
- const CRegisteredString attStr = strTable.RegisterStr(inAttNames.at(i));
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_FLOAT), theValue));
- }
-}
-
-void CQmlEngineImpl::addFloat3Attribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QStringList &inAttNames, const QVector3D &inValue)
-{
- for (int i = 0; i < 3; ++i) {
- UVariant theValue;
- theValue.m_FLOAT = inValue[i];
- const CRegisteredString attStr = strTable.RegisterStr(inAttNames.at(i));
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_FLOAT), theValue));
- }
-}
-
-void CQmlEngineImpl::addFloat4Attribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QStringList &inAttNames, const QVector4D &inValue)
-{
- for (int i = 0; i < 4; ++i) {
- UVariant theValue;
- theValue.m_FLOAT = inValue[i];
- const CRegisteredString attStr = strTable.RegisterStr(inAttNames.at(i));
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_FLOAT), theValue));
- }
-}
-
-void CQmlEngineImpl::addElementRefAttribute(IStringTable &strTable,
- CQmlEngineImpl::TPropertyDescAndValueList &list,
- const QString &inAttName, TElement *element)
-{
- UVariant theValue;
- if (element) {
- theValue.m_ElementHandle = element->GetHandle();
- QT3DS_ASSERT(theValue.m_ElementHandle);
- } else {
- theValue.m_ElementHandle = 0;
- }
- const CRegisteredString attStr = strTable.RegisterStr(inAttName);
- list.push_back(eastl::make_pair(TPropertyDesc(attStr, ATTRIBUTETYPE_ELEMENTREF), theValue));
-}
-
-QVector2D CQmlEngineImpl::parseFloat2Property(const QString &propValue)
-{
- QVector<QStringRef> values = propValue.splitRef(QLatin1Char(' '));
- QVector2D retVal;
- for (int i = 0; i < values.size() && i < 2; ++i)
- retVal[i] = values[i].toFloat();
- return retVal;
-}
-
-QVector3D CQmlEngineImpl::parseFloat3Property(const QString &propValue)
-{
- QVector<QStringRef> values = propValue.splitRef(QLatin1Char(' '));
- QVector3D retVal;
- for (int i = 0; i < values.size() && i < 3; ++i)
- retVal[i] = values[i].toFloat();
- return retVal;
-}
-
-QVector4D CQmlEngineImpl::parseFloat4Property(const QString &propValue)
-{
- QVector<QStringRef> values = propValue.splitRef(QLatin1Char(' '));
- QVector4D retVal;
- for (int i = 0; i < values.size() && i < 4; ++i)
- retVal[i] = values[i].toFloat();
- return retVal;
-}
-
-void CQmlEngineImpl::notifyElementCreation(const QStringList &elementNames, const QString &error)
-{
- // Notify presentation asynchronously to give renderer time to initialize the elements properly
- if (!error.isEmpty()) {
- qWarning() << "Warning: Element creation failed:" << error;
- QT3DS_ASSERT(false);
- }
- QTimer::singleShot(0, [this, elementNames, error]() {
- m_Application->GetPrimaryPresentation()->signalProxy()
- ->SigElementsCreated(elementNames, error);
- });
-}
-
-void CQmlEngineImpl::notifyMaterialCreation(const QStringList &materialNames, const QString &error)
-{
- // Notify presentation asynchronously to give renderer time to initialize the materials properly
- if (!error.isEmpty()) {
- qWarning() << "Warning: Material creation failed:" << materialNames << error;
- QT3DS_ASSERT(false);
- }
- QTimer::singleShot(0, [this, materialNames, error]() {
- m_Application->GetPrimaryPresentation()->signalProxy()
- ->SigMaterialsCreated(materialNames, error);
- });
-}
-
-void CQmlEngineImpl::deleteElements(const QVector<TElement *> &elements,
- IQt3DSRenderer *renderer)
-{
- TElement *lastParent = nullptr;
- IPresentation *presentation = nullptr;
- TElement *component = nullptr;
- ISlideSystem *slideSystem = nullptr;
- QSet<qt3ds::render::SNode *> parentNodes;
- for (auto element : elements) {
- TElement *parentElement = element->GetParent();
- if (parentElement != lastParent) {
- lastParent = parentElement;
- presentation = element->GetBelongedPresentation();
- component = &element->GetComponentParent();
- slideSystem = &presentation->GetSlideSystem();
- }
- // Remove element recursively from slide system
- slideSystem->removeElement(*component, *element);
-
- Q_ASSERT(parentElement);
-
- NVAllocatorCallback &allocator = presentation->GetScene()->allocator();
-
- // Recursive deleter for translators and graph objects
- std::function<void(TElement *)> deleteRenderObjects;
- deleteRenderObjects = [&](TElement *elem) {
- TElement *child = elem->m_Child;
- while (child) {
- TElement *sibling = child->m_Sibling;
- deleteRenderObjects(child);
- child = sibling;
- }
-
- auto translator = static_cast<qt3ds::render::Qt3DSTranslator *>(elem->GetAssociation());
- if (translator) {
- qt3ds::render::GraphObjectTypes::Enum type = translator->GetUIPType();
- if (type == qt3ds::render::GraphObjectTypes::Model) {
- auto model = static_cast<qt3ds::render::SModel *>(&translator->RenderObject());
- // Delete material
- if (model->m_FirstMaterial) {
- auto material = static_cast<qt3ds::render::SReferencedMaterial *>(
- model->m_FirstMaterial);
- QT3DS_FREE(allocator, material);
- }
- }
- QT3DS_FREE(allocator, &translator->RenderObject());
- QT3DS_FREE(allocator, translator);
- }
- };
-
- qt3ds::render::SNode *node = nullptr;
- qt3ds::render::SNode *parentNode = nullptr;
- auto translator = static_cast<qt3ds::render::Qt3DSTranslator *>(element->GetAssociation());
-
- if (translator) {
- if (qt3ds::render::GraphObjectTypes::IsNodeType(translator->GetUIPType())) {
- node = &static_cast<qt3ds::render::SNode &>(translator->RenderObject());
- auto parentTranslator = static_cast<qt3ds::render::Qt3DSTranslator *>(
- parentElement->GetAssociation());
- if (parentTranslator) {
- parentNode = &static_cast<qt3ds::render::SNode &>(
- parentTranslator->RenderObject());
- parentNode->RemoveChild(*node);
- parentNodes.insert(parentNode);
- }
- }
- // Release child element graph objects/translators
- deleteRenderObjects(element);
- }
-
- // Remove element recursively
- m_Application->GetElementAllocator().ReleaseElement(*element, true);
- }
- for (auto parentNode : qAsConst(parentNodes))
- renderer->ChildrenUpdated(*parentNode);
-}
-
-template<typename TDataType>
-void CQmlEngineImpl::setDynamicObjectProperty(qt3ds::render::SDynamicObject &material,
- const dynamic::SPropertyDefinition &propDesc,
- const TDataType &propValue)
-{
- memCopy(material.GetDataSectionBegin() + propDesc.m_Offset, &propValue, sizeof(TDataType));
-}
-
-/**
-* @brief Create QML engine
-*
-* @param[in] inFoundation Pointer to foundation
-* @param[in] inTimeProvider Pointer to time provider
-*
-* @return no return
-*/
-CQmlEngine *CQmlEngine::Create(qt3ds::NVFoundationBase &inFoundation, ITimeProvider &inTimeProvider)
-{
- return QT3DS_NEW(inFoundation.getAllocator(), CQmlEngineImpl)(inFoundation, inTimeProvider);
-}
-
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.h
deleted file mode 100644
index a5ad382b..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-20016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_QML_ENGINE_H
-#define QT3DS_QML_ENGINE_H
-
-#include "Qt3DSIScriptBridge.h"
-#include "Qt3DSIComponentManager.h"
-#include "EASTL/vector.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSMutex.h"
-#include "Qt3DSTimer.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-
-namespace Q3DStudio {
-//==============================================================================
-// Typedefs
-//==============================================================================
-typedef void (*TScriptCallback)(void *inUserData);
-
-//==============================================================================
-// Defines
-//==============================================================================
-#define SCRIPT_ON_INITIALIZE 1
-#define SCRIPT_ON_UPDATE 2
-
-//==============================================================================
-// Forwards
-//==============================================================================
-struct SEventCommand;
-class IPresentation;
-
-//==============================================================================
-/**
-* Manages the various events callbacks in the system. It fires the
-* registered callbacks when an event was triggered.
-*/
-class CScriptCallbacks
-{
- //==============================================================================
- // Structs
- //==============================================================================
-protected:
- struct SScriptCallbackEntry
- {
- SScriptCallbackEntry() {}
- ~SScriptCallbackEntry() {}
-
- TScriptCallback m_Function; ///< Callback function pointer
- void *m_UserData; ///< User data
- Q3DStudio::UINT32
- m_CallbackType; ///< callback type. determines when and/or how often it is called
- bool m_Processed; ///< Only used if the callback is of
-
- private: // Disabled Copy Construction
- SScriptCallbackEntry(const SScriptCallbackEntry &);
- SScriptCallbackEntry &operator=(const SScriptCallbackEntry &);
- };
- typedef CArray<SScriptCallbackEntry *> TCallbackList; ///< Array of callbacks regisgtered
-
- struct SFrameCallbackEntry
- {
- SFrameCallbackEntry() {}
- ~SFrameCallbackEntry()
- {
- FOR_ARRAY(SScriptCallbackEntry *, theEntry, m_Callbacks)
- Q3DStudio_delete(*theEntry, SScriptCallbackEntry);
- }
-
- TCallbackList m_Callbacks; ///< List of callbacks listening to this event
-
- private: // Disabled Copy Construction
- SFrameCallbackEntry(const SFrameCallbackEntry &);
- SFrameCallbackEntry &operator=(const SFrameCallbackEntry &);
- };
-
- typedef CArray<SFrameCallbackEntry *> TFrameCallbacksList; ///< Array of frame callbacks
-
-public: // Construction
- CScriptCallbacks();
- ~CScriptCallbacks();
-
- bool RegisterCallback(Q3DStudio::UINT32 callbackType, const TScriptCallback inCallback,
- void *inUserData);
- void UnregisterCallback(Q3DStudio::UINT32 callbackType, const TScriptCallback inCallback);
-
- void ProcessCallbacks();
-
-private:
- TFrameCallbacksList m_CallbackList;
-
-private: // Disabled Copy Construction
- CScriptCallbacks(const CScriptCallbacks &);
- CScriptCallbacks &operator=(const CScriptCallbacks &);
-};
-
-class CQmlEngine : public IScriptBridge
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- virtual ~CQmlEngine() {}
-
-public: // Public functions but not functions on the script bridge
- /**
- * @brief Peek a custom action from the queue
- *
- * @param[out] outElement Target Element
- * @param[out] outSignal Signal Name
- *
- * @return true if signal available
- */
- virtual bool PeekSignal(TElement *&outElement, char *&outName) = 0;
-
- /**
- * @brief Select a slide by index
- *
- * @param[in] component Component Name
- * @param[in] slideIndex Slide index
- * @param[in] inArgs Arguemnts for slide switch
- *
- * @return none
- */
- virtual void GotoSlideIndex(const char *component, const Q3DStudio::INT32 slideIndex,
- const SScriptEngineGotoSlideArgs &inArgs) = 0;
-
- virtual bool GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName) = 0;
-
- /**
- * @brief Go to specified time
- *
- * @param[in] component Component Name
- * @param[in] time New time
- *
- * @return none
- */
- virtual void GotoTime(const char *component, const Q3DStudio::FLOAT time) = 0;
-
- /**
- * @brief Return values of an attribute
- *
- * @param[in] element Element Name
- * @param[in] attName Attribute name
- * @param[out] value Attribute value
- *
- * @return none
- */
- virtual bool GetAttribute(const char *element, const char *attName, char *value) = 0;
- virtual bool GetAttribute(TElement *target, const char *attName, char *value) = 0;
-
- /**
- * @brief Register a callback
- *
- * @param[in] callbackType callback type
-* @param[in] inCallback pointer to callback
-* @param[in] inUserData pointer to user data
- *
- * @return true on success
- */
- virtual bool RegisterCallback(Q3DStudio::UINT32 callbackType, const TScriptCallback inCallback,
- void *inUserData) = 0;
-
- /**
- * @brief Shutdown QML engine
- *
- * @param[in] inFoundation Pointer to foundation
- *
- * @return no return
- */
- virtual void Shutdown(qt3ds::NVFoundationBase &inFoundation) = 0;
-
- virtual qt3ds::runtime::IApplication *GetApplication() = 0;
-
- virtual void Initialize() = 0;
-
-public:
- /**
- * @brief Create QML engine
- *
- * @param[in] inFoundation Pointer to foundation
- * @param[in] inTimeProvider Pointer to time provider
- *
- * @return no return
- */
- static CQmlEngine *Create(qt3ds::NVFoundationBase &inFoundation, ITimeProvider &inTimeProvider);
-};
-
-} // namespace Q3DStudio
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSRuntimeFactory.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSRuntimeFactory.h
deleted file mode 100644
index fb46240c..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSRuntimeFactory.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSTimer.h"
-#include "foundation/Qt3DSRefCounted.h"
-
-namespace qt3ds {
-namespace render {
- class IInputStreamFactory;
- class IQt3DSRenderContext;
- class IQt3DSRenderContextCore;
-}
-}
-
-namespace qt3ds {
-namespace runtime {
- class IApplication;
-}
-}
-
-namespace qt3ds {
-namespace evt {
- class IEventSystem;
-}
-}
-
-namespace qt3ds {
-class NVFoundationBase;
-namespace foundation {
- class IStringTable;
- class IPerfTimer;
-}
-}
-
-namespace Q3DStudio {
-
-class IScene;
-class CRenderEngine;
-class ISceneManager;
-class IRender;
-class CInputEngine;
-class IScriptBridge;
-class CPresentation;
-class IPresentation;
-class ITimeProvider;
-class ISceneBinaryLoader;
-
-// All of the interfaces available without opengl initialized.
-class IRuntimeFactoryCore : public qt3ds::foundation::NVRefCounted
-{
-public:
- virtual ISceneBinaryLoader &GetSceneLoader() = 0;
- virtual IScriptBridge &GetScriptEngineQml() = 0;
- virtual qt3ds::render::IQt3DSRenderContextCore &GetRenderContextCore() = 0;
- virtual qt3ds::render::IInputStreamFactory &GetInputStreamFactory() = 0;
- virtual qt3ds::evt::IEventSystem &GetEventSystem() = 0;
- virtual ITimeProvider &GetTimeProvider() = 0;
- virtual qt3ds::NVFoundationBase &GetFoundation() = 0;
- virtual qt3ds::foundation::IPerfTimer &GetPerfTimer() = 0;
- virtual qt3ds::foundation::IStringTable &GetStringTable() = 0;
- virtual void AddSearchPath(const char8_t *inFile) = 0;
- virtual void SetDllDir(const char *inDir) = 0;
- virtual qt3ds::runtime::IApplication *GetApplicationCore() = 0;
- virtual void SetApplicationCore(qt3ds::runtime::IApplication *app) = 0;
-};
-
-class IRuntimeFactory : public IRuntimeFactoryCore
-{
-protected:
- virtual ~IRuntimeFactory() {}
-
-public:
- virtual ISceneManager &GetSceneManager() = 0;
- virtual qt3ds::render::IQt3DSRenderContext &GetQt3DSRenderContext() = 0;
- virtual qt3ds::runtime::IApplication *GetApplication() = 0;
- virtual void SetApplication(qt3ds::runtime::IApplication *app) = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSSceneManager.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSSceneManager.h
deleted file mode 100644
index 7d8297f4..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSSceneManager.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSPickFrame.h"
-#include "Qt3DSIStateful.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSIScene.h"
-
-namespace qt3ds {
-namespace foundation {
- class IInStream;
- class IOutStream;
- class Mutex;
-}
-}
-
-namespace qt3ds {
-class Q3DSVariantConfig;
-namespace render {
- class IQt3DSRenderContextCore;
- class ILoadedBuffer;
-}
-}
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class IScene;
-class IPresentation;
-class CRenderEngine;
-class CRenderEngine;
-class IUIPParser;
-class CFileStream;
-class IRuntimeFactory;
-class IScriptBridge;
-class ISceneManager;
-
-class ISceneBinaryLoader : public qt3ds::foundation::NVRefCounted
-{
-protected:
- virtual ~ISceneBinaryLoader() {}
-
-public:
- virtual qt3ds::foundation::NVDataRef<qt3ds::QT3DSU8>
- BinaryLoadManagerData(qt3ds::foundation::IInStream &inStream, const char *inBinaryDir) = 0;
-
- // threadsafe
- // Can be called from any thread
- virtual bool GetBinaryLoadFileName(eastl::string &inPresentationFilename,
- eastl::string &outResult) = 0;
-
- // threadsafe
- // returns a handle to the loaded object. Return value of zero means error.
- virtual qt3ds::QT3DSU32 LoadSceneStage1(qt3ds::foundation::CRegisteredString inPresentationDirectory,
- qt3ds::render::ILoadedBuffer &inData) = 0;
-
- // threadsafe
- // still does not require openGL context but has dependency on a few other things.
- virtual void LoadSceneStage2(qt3ds::QT3DSU32 inSceneHandle, IPresentation &inPresentation,
- size_t inElementMemoryOffset, IScriptBridge &inBridge) = 0;
-};
-struct FacePositionPlanes
-{
- enum Enum { XY = 0, YZ, XZ };
-};
-
-//==============================================================================
-/**
-* @class ISceneManager
-* @brief Container class that creates and manages all the Scenes.
-*/
-class ISceneManager : public qt3ds::foundation::NVRefCounted
-{
-protected:
- virtual ~ISceneManager(){}
-
-public: // Presentations
- //==============================================================================
- /**
- * Load a new scene based on an existing presentation. This will create a new
- * CScene-based class from the factory method at "CreateScene". To supply
- * your own class, simply set "CreateScene" to the desired factory method.
- * After creating the new scene, a load will be triggered.
- * @param inPresentation the current presentation loaded
- */
- virtual IScene *LoadScene(IPresentation *inPresentation, IUIPParser *inParser,
- IScriptBridge &inBridge,
- const qt3ds::Q3DSVariantConfig &variantConfig) = 0;
- virtual void LoadRenderPlugin(const CHAR *inAssetIDString, const CHAR *inPath,
- const CHAR *inArgs) = 0;
-
- virtual void LoadQmlStreamerPlugin(const CHAR *inAssetIDString) = 0;
-
- virtual void BinarySaveManagerData(qt3ds::foundation::IOutStream &inStream,
- const char *inBinaryDir) = 0;
- // Loading flow data needs to return the string table memory block. This allows
- // other systems to use remap their string table strings assuming they had mapped them before
- // serialization. In general this is a horrible hack and abstraction leak but assuming you have
- // a string
- // table I guess it isn't too bad.
- virtual qt3ds::foundation::NVDataRef<qt3ds::QT3DSU8>
- BinaryLoadManagerData(qt3ds::foundation::IInStream &inStream, const char *inBinaryDir) = 0;
-
- virtual void BinarySave(Q3DStudio::IScene &inScene) = 0;
-
-public: // Update Cycle
- virtual BOOL Update() = 0;
- virtual BOOL RenderPresentation(IPresentation *inPresentation, bool firstFrame) = 0;
- virtual void OnViewResize(INT32 inViewWidth, INT32 inViewHeight) = 0;
- virtual void GetViewSize(INT32 &outWidth, INT32 &outHeight) = 0;
-
- virtual STextSizes GetDisplayDimensions(Q3DStudio::IPresentation *inPrimaryPresentation) = 0;
-
-public: // Picking
- virtual Q3DStudio::TElement *UserPick(float mouseX, float mouseY) = 0;
- virtual SPickFrame AdvancePickFrame(const SInputFrame &inInputFrame) = 0;
- // Get the relative UV coord position of an element. This matches how mouse picking works where
- // we pick out
- virtual qt3ds::foundation::Option<qt3ds::QT3DSVec2>
- FacePosition(Q3DStudio::TElement &inElement, float mouseX, float mouseY,
- qt3ds::foundation::NVDataRef<Q3DStudio::TElement *> inMapperElements,
- FacePositionPlanes::Enum inPlane) = 0;
-
- virtual void Release() = 0;
-
- static ISceneManager &Create(IRuntimeFactory &inFactory, CRenderEngine &inRenderEngine);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.cpp
deleted file mode 100644
index 33c7544d..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.cpp
+++ /dev/null
@@ -1,675 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "RuntimePrefix.h"
-#include "Qt3DSSlideSystem.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSAnimationSystem.h"
-#include "Qt3DSLogicSystem.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/IOStreams.h"
-#include "Qt3DSHash.h"
-#include "Qt3DSTimePolicy.h"
-#include "foundation/Qt3DSIndexableLinkedList.h"
-
-using namespace qt3ds::runtime;
-using namespace qt3ds::runtime::element;
-
-namespace {
-struct SSlideAttribute
-{
- QT3DSU32 m_Index = 0;
- Q3DStudio::UVariant m_Value;
- SSlideAttribute()
- {
- m_Value.m_INT32 = 0;
- }
- SSlideAttribute(QT3DSU32 idx, Q3DStudio::UVariant val)
- : m_Index(idx)
- , m_Value(val)
- {
- }
-};
-
-struct SSlideAttributeNode
-{
- enum {
- AttributeCount = 8,
- };
-
- SSlideAttribute m_Data[AttributeCount];
- SSlideAttributeNode *m_NextNode = nullptr;
-};
-
-typedef IndexableLinkedList<SSlideAttributeNode, SSlideAttribute,
- SSlideAttributeNode::AttributeCount>
- TSlideAttributeNodeList;
-
-struct SSlideElement
-{
- QT3DSU32 m_ElementHandle = 0;
- QT3DSU32 m_AttributeCount : 31;
- QT3DSU32 m_Active : 1;
- SSlideElement *m_NextElement = nullptr;
- SSlideAttributeNode *m_AttributeNodes = nullptr;
-
- SSlideElement()
- : m_AttributeCount(0)
- , m_Active(false)
- {
- }
-};
-
-struct SSlideAnimActionNode
-{
- enum {
- AnimActionCount = 8,
- };
- SSlideAnimAction m_Data[AnimActionCount];
- SSlideAnimActionNode *m_NextNode = nullptr;
-};
-
-typedef IndexableLinkedList<SSlideAnimActionNode, SSlideAnimAction,
- SSlideAnimActionNode::AnimActionCount>
- TSlideAnimActionNodeList;
-
-struct SSlide
-{
- SSlide *m_NextSlide = nullptr;
- CRegisteredString m_Name;
- QT3DSU32 m_PlayMode : 3;
- QT3DSU32 m_PlayThroughTo : 8; // OXFF means no playthrough
- QT3DSU32 m_Paused : 1;
- QT3DSU32 m_StartTime = 0;
- QT3DSU32 m_EndTime = 0;
- QT3DSU32 m_AnimActionCount = 0;
- SSlideElement *m_FirstElement = nullptr;
- SSlideElement *m_lastElement = nullptr;
- SSlideAnimActionNode *m_FirstAnimActionNode = nullptr;
- bool m_activeSlide = false;
- bool m_unloadSlide = false;
- QVector<QString> m_sourcePaths;
-
- SSlide()
- : m_PlayMode(PlayMode::StopAtEnd)
- , m_PlayThroughTo(0xFF)
- , m_Paused(false)
- {
- }
-
- void Initialize(CRegisteredString inName, PlayMode::Enum inMode, QT3DSU8 inPlayThrough,
- bool inPaused, QT3DSU32 inStartTime, QT3DSU32 inEndTime)
- {
- m_Name = inName;
- m_PlayMode = inMode;
- m_PlayThroughTo = inPlayThrough;
- m_Paused = inPaused;
- m_StartTime = inStartTime;
- m_EndTime = inEndTime;
- }
-};
-
-struct SSlideSystem : public ISlideSystem
-{
- typedef nvhash_map<SElement *, SSlide *> TComponentSlideHash;
- typedef Pool<SSlideAttributeNode, ForwardingAllocator> TAttributeNodePool;
- typedef Pool<SSlideAnimActionNode, ForwardingAllocator> TSlideAnimActionPool;
- typedef Pool<SSlideElement, ForwardingAllocator> TSlideElementPool;
- typedef Pool<SSlide, ForwardingAllocator> TSlidePool;
-
- NVFoundationBase &m_Foundation;
- IStringTable &m_StringTable;
- IElementAllocator &m_ElementSystem;
- TAttributeNodePool m_AttributeNodePool;
- TSlideAnimActionPool m_AnimActionPool;
- TSlidePool m_SlidePool;
- TSlideElementPool m_SlideElements;
- TComponentSlideHash m_Slides;
-
- SSlide *m_CurrentSlide = nullptr;
- SSlideElement *m_CurrentSlideElement = nullptr;
-
- NVDataRef<QT3DSU8> m_LoadData;
-
- QT3DSI32 m_RefCount;
-
- SSlideSystem(NVFoundationBase &inFnd, IStringTable &inStrTable, IElementAllocator &inAllocator)
- : m_Foundation(inFnd)
- , m_StringTable(inStrTable)
- , m_ElementSystem(inAllocator)
- , m_AttributeNodePool(ForwardingAllocator(inFnd.getAllocator(), "m_AttributeNodePool"))
- , m_AnimActionPool(ForwardingAllocator(inFnd.getAllocator(), "m_AnimActionPool"))
- , m_SlidePool(ForwardingAllocator(inFnd.getAllocator(), "m_SlidePool"))
- , m_SlideElements(ForwardingAllocator(inFnd.getAllocator(), "m_SlideElements"))
- , m_Slides(inFnd.getAllocator(), "m_Slides")
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
-
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Foundation.getAllocator());
- NVDelete(alloc, this);
- }
- }
-
- QT3DSU32 AddSlide(element::SElement &inComponent, const char8_t *inName,
- PlayMode::Enum inPlayMode, bool inPaused, QT3DSU8 inPlayThroughTo,
- QT3DSU32 inMinTime, QT3DSU32 inMaxTime) override
- {
- eastl::pair<TComponentSlideHash::iterator, bool> inserter =
- m_Slides.insert(eastl::make_pair(&inComponent, static_cast<SSlide *>(nullptr)));
- SSlide *newSlide = m_SlidePool.construct(__FILE__, __LINE__);
- QT3DSU32 slideIndex = 0;
- if (!inserter.first->second) {
- inserter.first->second = newSlide;
- } else {
- SSlide *theSlide = nullptr;
- for (theSlide = inserter.first->second; theSlide->m_NextSlide;
- theSlide = theSlide->m_NextSlide) {
- ++slideIndex;
- }
- theSlide->m_NextSlide = newSlide;
- }
- m_CurrentSlide = newSlide;
- newSlide->Initialize(m_StringTable.RegisterStr(inName), inPlayMode, inPlayThroughTo,
- inPaused, inMinTime, inMaxTime);
- m_CurrentSlideElement = nullptr;
- if (inComponent.IsComponent()) {
- SComponent &theComponent = static_cast<SComponent &>(inComponent);
- theComponent.m_SlideCount++;
- }
- return slideIndex;
- }
-
- void AddSourcePath(const char8_t *path) override
- {
- if (m_CurrentSlide)
- m_CurrentSlide->m_sourcePaths.push_back(QString::fromUtf8(path));
- }
-
- QVector<QString> GetSourcePaths(SSlideKey inKey) override
- {
- auto slide = FindSlide(inKey);
- if (slide)
- return slide->m_sourcePaths;
- return {};
- }
-
- void SetSlideMaxTime(QT3DSU32 inMaxTime) override
- {
- if (m_CurrentSlide)
- m_CurrentSlide->m_EndTime = inMaxTime;
- }
-
- void AddSlideElement(element::SElement &inElement, bool inActive) override
- {
- if (m_CurrentSlide) {
- SSlideElement *lastSlideElement = m_CurrentSlideElement;
- m_CurrentSlideElement = m_SlideElements.construct(__FILE__, __LINE__);
- m_CurrentSlideElement->m_Active = inActive;
- m_CurrentSlideElement->m_ElementHandle = inElement.GetHandle();
- if (!lastSlideElement) {
- QT3DS_ASSERT(!m_CurrentSlide->m_FirstElement);
- m_CurrentSlide->m_FirstElement = m_CurrentSlideElement;
- } else {
- lastSlideElement->m_NextElement = m_CurrentSlideElement;
- }
- m_CurrentSlide->m_lastElement = m_CurrentSlideElement;
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- // The parent element must be found from target slide.
- // Elements cannot be added to the master slide.
- bool addSlideElement(element::SElement &inComponent, int slideIndex,
- element::SElement &inElement, bool eyeBall) override
- {
- // Note: Slide 0 contains all loaded items in the graph with m_active set to false.
- // Other slides contain all master slide items and slide specific items with m_active
- // set to eyeball. We shouldn't need to care about slide 0 here as it won't be
- // executed/rolled back after initial loading of the scene.
-
- Q_ASSERT(slideIndex > 0);
-
- TComponentSlideHash::const_iterator theFindResult = m_Slides.find(&inComponent);
- element::SElement *parentElement = inElement.GetParent();
- if (theFindResult == m_Slides.end()) {
- qWarning() << __FUNCTION__ << "Could not find slides for component";
- return false;
- }
- if (!parentElement) {
- qWarning() << __FUNCTION__ << "Element has no parent";
- return false;
- }
-
- int parentFound = false;
- SSlide *slide = theFindResult->second;
- SSlide *targetSlide = nullptr;
- for (int idx = 0; slide && !targetSlide; slide = slide->m_NextSlide, ++idx) {
- if (slideIndex == idx) {
- targetSlide = slide;
- SSlideElement *slideElement = slide->m_FirstElement;
- while (slideElement) {
- if (slideElement->m_ElementHandle == parentElement->m_Handle) {
- parentFound = true;
- break;
- }
- slideElement = slideElement->m_NextElement;
- }
- }
- }
-
- if (!parentFound) {
- qWarning() << __FUNCTION__ << "Parent element could not be found from target slide";
- return false;
- }
-
- m_CurrentSlide = targetSlide;
- m_CurrentSlideElement = m_CurrentSlide->m_lastElement;
-
- // Explicit active state is based solely on the slide and eyeball
- int activeSlideIndex = static_cast<SComponent &>(inComponent).GetCurrentSlide();
- bool isActive = activeSlideIndex == slideIndex && eyeBall;
- inElement.Flags().SetExplicitActive(isActive);
-
- AddSlideElement(inElement, eyeBall);
-
- return true;
- }
-
- void removeElementRecursive(SSlide *slide, element::SElement &inElement)
- {
- element::SElement *child = inElement.m_Child;
- while (child) {
- removeElementRecursive(slide, *child);
- child = child->m_Sibling;
- }
-
- SSlideElement *slideElement = slide->m_FirstElement;
- SSlideElement *previousElement = nullptr;
- while (slideElement) {
- if (slideElement->m_ElementHandle == inElement.m_Handle) {
- if (slide->m_FirstElement == slideElement)
- slide->m_FirstElement = slideElement->m_NextElement;
- if (slide->m_lastElement == slideElement)
- slide->m_lastElement = previousElement;
- if (previousElement)
- previousElement->m_NextElement = slideElement->m_NextElement;
- m_SlideElements.deallocate(slideElement);
- break;
- }
- previousElement = slideElement;
- slideElement = slideElement->m_NextElement;
- }
- }
-
- // Removes element and its children from all slides
- void removeElement(element::SElement &inComponent, element::SElement &inElement) override
- {
- TComponentSlideHash::const_iterator theFindResult = m_Slides.find(&inComponent);
- if (theFindResult == m_Slides.end()) {
- qWarning() << __FUNCTION__ << "Could not find slides for component";
- return;
- }
-
- SSlide *slide = theFindResult->second;
- for (; slide; slide = slide->m_NextSlide)
- removeElementRecursive(slide, inElement);
- }
-
- void AddSlideAttribute(Q3DStudio::SAttributeKey inKey, Q3DStudio::UVariant inValue) override
- {
- if (m_CurrentSlideElement) {
- SElement *theElement =
- m_ElementSystem.FindElementByHandle(m_CurrentSlideElement->m_ElementHandle);
- Option<QT3DSU32> theIdx = theElement->FindPropertyIndex(inKey.m_Hash);
- if (theIdx.hasValue() == false) {
- QT3DS_ASSERT(false);
- return;
- }
- QT3DSU32 count = m_CurrentSlideElement->m_AttributeCount;
- TSlideAttributeNodeList::Create(m_CurrentSlideElement->m_AttributeNodes, count,
- m_AttributeNodePool) =
- SSlideAttribute(*theIdx, inValue);
- m_CurrentSlideElement->m_AttributeCount = count;
- }
- }
-
- SSlideAnimAction *AddSlideAnimAction(bool inAnimation, QT3DSI32 inId, bool inActive) override
- {
- if (m_CurrentSlide) {
- SSlideAnimAction &theAnimAction = TSlideAnimActionNodeList::Create(
- m_CurrentSlide->m_FirstAnimActionNode, m_CurrentSlide->m_AnimActionCount,
- m_AnimActionPool);
- theAnimAction = SSlideAnimAction(QT3DSI32(inId), inActive, inAnimation);
- return &theAnimAction;
- }
-
- return nullptr;
- }
-
- const SSlide *FindSlide(SSlideKey inKey) const
- {
- TComponentSlideHash::const_iterator iter = m_Slides.find(inKey.m_Component);
- if (iter == m_Slides.end())
- return nullptr;
-
- SSlide *theSlide = iter->second;
- for (QT3DSU32 idx = inKey.m_Index; idx; --idx) {
- if (theSlide)
- theSlide = theSlide->m_NextSlide;
- }
-
- return theSlide;
- }
-
- SSlide *FindSlide(SSlideKey inKey)
- {
- TComponentSlideHash::const_iterator iter = m_Slides.find(inKey.m_Component);
- if (iter == m_Slides.end())
- return nullptr;
-
- SSlide *theSlide = iter->second;
- for (QT3DSU32 idx = inKey.m_Index; idx; --idx) {
- if (theSlide)
- theSlide = theSlide->m_NextSlide;
- }
-
- return theSlide;
- }
-
- template <typename TOperator>
- static void IterateSlideAnimActions(const SSlide &inSlide, TOperator inOp)
- {
- for (TSlideAnimActionNodeList::const_iterator
- iter = TSlideAnimActionNodeList::begin(inSlide.m_FirstAnimActionNode,
- inSlide.m_AnimActionCount),
- end = TSlideAnimActionNodeList::end(inSlide.m_FirstAnimActionNode,
- inSlide.m_AnimActionCount);
- iter != end; ++iter) {
- inOp(*iter);
- }
- }
-
- template <typename TOperator>
- static void IterateSlideElementAttributes(const SSlide &inSlide, TOperator inOp,
- IElementAllocator &inAlloc)
- {
- for (SSlideElement *theElement = inSlide.m_FirstElement; theElement;
- theElement = theElement->m_NextElement) {
- SElement *theElem = inAlloc.FindElementByHandle(theElement->m_ElementHandle);
- if (!theElem) {
- QT3DS_ASSERT(false);
- } else {
- if (inOp.handleElementActive(*theElem, theElement->m_Active)) {
- for (TSlideAttributeNodeList::const_iterator
- iter = TSlideAttributeNodeList::begin(theElement->m_AttributeNodes,
- theElement->m_AttributeCount),
- end = TSlideAttributeNodeList::end(theElement->m_AttributeNodes,
- theElement->m_AttributeCount);
- iter != end; ++iter) {
- inOp.handleElementAttribute(*theElem, *iter);
- }
- }
- }
- }
- }
-
- struct SDynamicKeyOperator
- {
- IAnimationSystem &m_AnimationSystem;
- SDynamicKeyOperator(IAnimationSystem &anim)
- : m_AnimationSystem(anim)
- {
- }
- void operator()(const SSlideAnimAction &theAction)
- {
- if (theAction.m_IsAnimation && theAction.m_Active)
- m_AnimationSystem.UpdateDynamicKey(theAction.m_Id);
- }
- };
-
- struct SExecuteAnimActionOperator
- {
- IElementAllocator &m_ElementAllocator;
- IAnimationSystem &m_AnimationSystem;
- ILogicSystem &m_LogicManager;
- bool m_Invert;
-
- SExecuteAnimActionOperator(IElementAllocator &inElemAllocator, IAnimationSystem &anim,
- ILogicSystem &logic, bool inInvert = false)
- : m_ElementAllocator(inElemAllocator)
- , m_AnimationSystem(anim)
- , m_LogicManager(logic)
- , m_Invert(inInvert)
- {
- }
-
- void operator()(const SSlideAnimAction &theAction)
- {
- bool active = theAction.m_Active;
- if (m_Invert)
- active = !active;
- if (theAction.m_IsAnimation)
- m_AnimationSystem.SetActive(theAction.m_Id, active);
- else
- m_LogicManager.SetActive(theAction.m_Id, active, m_ElementAllocator);
- }
- };
-
- struct SElementOperator
- {
- bool m_InvertActive;
- SElementOperator(bool inInvert = false)
- : m_InvertActive(inInvert)
- {
- }
- bool handleElementActive(SElement &inElement, bool inActive)
- {
- if (m_InvertActive && inElement.Flags().IsExplicitActive())
- inActive = !inActive;
- inElement.Flags().SetExplicitActive(inActive);
-
- if (m_InvertActive)
- return false;
-
- return inActive;
- }
-
- void handleElementAttribute(SElement &inElement, const SSlideAttribute &inAttribute)
- {
- Option<TPropertyDescAndValuePtr> theProperty =
- inElement.GetPropertyByIndex(inAttribute.m_Index);
- if (theProperty.hasValue()) {
- inElement.SetAttribute(*theProperty, inAttribute.m_Value);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- };
-
- void InitializeDynamicKeys(SSlideKey inKey, IAnimationSystem &inAnimationSystem) const override
- {
- const SSlide *theSlide = FindSlide(inKey);
- if (theSlide) {
- IterateSlideAnimActions(*theSlide, SDynamicKeyOperator(inAnimationSystem));
- }
- }
-
- void ExecuteSlide(SSlideKey inKey, IAnimationSystem &inAnimationSystem,
- ILogicSystem &inLogicManager) override
- {
- SSlide *theSlide = FindSlide(inKey);
- if (!theSlide) {
- QT3DS_ASSERT(false);
- return;
- }
- if (inKey.m_Component->IsComponent()) {
- Q3DStudio::TTimeUnit theLoopDuration = theSlide->m_EndTime - theSlide->m_StartTime;
- SComponent &theComponent = static_cast<SComponent &>(*inKey.m_Component);
- Q3DStudio::CTimePolicy &thePolicy = theComponent.GetTimePolicy();
- Q3DStudio::TimePolicyModes::Enum theMode = Q3DStudio::TimePolicyModes::StopAtEnd;
- switch (theSlide->m_PlayMode) {
- case PlayMode::Looping:
- theMode = Q3DStudio::TimePolicyModes::Looping;
- break;
- case PlayMode::PingPong:
- theMode = Q3DStudio::TimePolicyModes::PingPong;
- break;
- case PlayMode::Ping:
- theMode = Q3DStudio::TimePolicyModes::Ping;
- break;
-
- case PlayMode::StopAtEnd:
- case PlayMode::PlayThroughTo:
- default:
- theMode = Q3DStudio::TimePolicyModes::StopAtEnd;
- break;
- }
- thePolicy.Initialize(theLoopDuration, theMode);
- thePolicy.SetPaused(theSlide->m_Paused);
-
- theComponent.SetPlayThrough(theSlide->m_PlayMode == PlayMode::PlayThroughTo);
- }
- theSlide->m_activeSlide = true;
- IterateSlideElementAttributes(*theSlide, SElementOperator(false), m_ElementSystem);
- IterateSlideAnimActions(*theSlide, SExecuteAnimActionOperator(
- m_ElementSystem, inAnimationSystem, inLogicManager));
- }
-
- void RollbackSlide(SSlideKey inKey, IAnimationSystem &inAnimationSystem,
- ILogicSystem &inLogicManager) override
- {
- SSlide *theSlide = FindSlide(inKey);
-
- if (!theSlide) {
- QT3DS_ASSERT(false);
- return;
- }
-
- theSlide->m_activeSlide = false;
- IterateSlideElementAttributes(*theSlide, SElementOperator(true), m_ElementSystem);
- IterateSlideAnimActions(
- *theSlide,
- SExecuteAnimActionOperator(m_ElementSystem, inAnimationSystem, inLogicManager, true));
- }
-
- QT3DSU8 FindSlide(element::SElement &inComponent, const char8_t *inSlideName) const override
- {
- TComponentSlideHash::const_iterator theFindResult = m_Slides.find(&inComponent);
- if (theFindResult == m_Slides.end()) {
- QT3DS_ASSERT(false);
- return 0xFF;
- }
- CRegisteredString theRegName = m_StringTable.RegisterStr(inSlideName);
- QT3DSU8 idx = 0;
- for (const SSlide *theSlide = theFindResult->second; theSlide;
- theSlide = theSlide->m_NextSlide, ++idx) {
- if (theSlide->m_Name == theRegName)
- return idx;
- }
- return 0xFF;
- }
-
- QT3DSU8 FindSlide(element::SElement &inComponent, QT3DSU32 inSlideHashName) const override
- {
- TComponentSlideHash::const_iterator theFindResult = m_Slides.find(&inComponent);
- if (theFindResult == m_Slides.end()) {
- QT3DS_ASSERT(false);
- return 0xFF;
- }
-
- QT3DSU8 idx = 0;
- for (const SSlide *theSlide = theFindResult->second; theSlide;
- theSlide = theSlide->m_NextSlide, ++idx) {
- if (Q3DStudio::CHash::HashString(theSlide->m_Name) == inSlideHashName)
- return idx;
- }
- return 0xFF;
- }
-
- const char8_t *GetSlideName(SSlideKey inKey) const override
- {
- const SSlide *theSlide = FindSlide(inKey);
- if (theSlide)
- return theSlide->m_Name.c_str();
- QT3DS_ASSERT(false);
- return "";
- }
-
- QT3DSU8 GetPlaythroughToSlideIndex(SSlideKey inKey) const override
- {
- const SSlide *theSlide = FindSlide(inKey);
- if (theSlide)
- return theSlide->m_PlayThroughTo;
- QT3DS_ASSERT(false);
- return 0xFF;
- }
-
- bool isActiveSlide(SSlideKey inKey) const override
- {
- const SSlide *theSlide = FindSlide(inKey);
- return theSlide->m_activeSlide;
- }
-
- void setUnloadSlide(SSlideKey inKey, bool unload) override
- {
- SSlide *theSlide = FindSlide(inKey);
- theSlide->m_unloadSlide = unload;
- }
-
- bool isUnloadSlideSet(SSlideKey inKey) const override
- {
- const SSlide *theSlide = FindSlide(inKey);
- return theSlide->m_unloadSlide;
- }
-
- void setIsActiveSlide(SSlideKey inKey, bool active) override
- {
- SSlide *theSlide = FindSlide(inKey);
- theSlide->m_activeSlide = active;
- }
-};
-}
-
-ISlideSystem &ISlideSystem::CreateSlideSystem(NVFoundationBase &inFnd, IStringTable &inStrTable,
- IElementAllocator &inElemAllocator)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), SSlideSystem)(inFnd, inStrTable, inElemAllocator);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.h
deleted file mode 100644
index d3accbd3..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSSlideSystem.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSElementSystem.h"
-
-namespace Q3DStudio {
-class ILogicManager;
-}
-
-namespace qt3ds {
-namespace runtime {
- class ILogicSystem;
- class IAnimationSystem;
-
- struct SSlideKey
- {
- element::SElement *m_Component;
- QT3DSU32 m_Index;
- SSlideKey()
- : m_Component(NULL)
- , m_Index(0)
- {
- }
- SSlideKey(element::SElement &inElem, QT3DSU32 inIdx)
- : m_Component(&inElem)
- , m_Index(inIdx)
- {
- }
-
- bool IsValid() const { return m_Component != NULL; }
-
- bool operator==(const SSlideKey &inOther) const
- {
- return m_Component == inOther.m_Component && m_Index == inOther.m_Index;
- }
- };
-
- struct PlayMode
- {
- enum Enum {
- Looping = 0,
- StopAtEnd,
- PingPong,
- Ping,
- PlayThroughTo,
- };
- };
-
- struct SSlidePlayInformation
- {
- PlayMode::Enum m_PlayMode;
- bool m_Paused;
- QT3DSU8 m_PlayThroughTo;
-
- SSlidePlayInformation()
- : m_PlayMode(PlayMode::Looping)
- , m_Paused(false)
- , m_PlayThroughTo(0xFF)
- {
- }
- };
-
- struct SSlideAnimAction
- {
- QT3DSI32 m_Id;
- bool m_Active;
- bool m_IsAnimation;
- SSlideAnimAction()
- : m_Id(0)
- , m_Active(false)
- , m_IsAnimation(false)
- {
- }
- SSlideAnimAction(QT3DSI32 inId, bool inActive, bool inAnimation)
- : m_Id(inId)
- , m_Active(inActive)
- , m_IsAnimation(inAnimation)
- {
- }
- };
-
- // Throughout this object, a slide index of 0xFF means invalid slide index.
- class ISlideSystem : public NVRefCounted
- {
- public:
- static QT3DSU8 InvalidSlideIndex() { return 0xFF; }
- // Building out a dataset.
- // Returns the index
- // This slide is now the active cursor. The rest of the building functions will implicitly
- // refer
- // to the last added slide
- // Playthroughto is either an index of the new slide or -1 meaning no playthough value.
- virtual QT3DSU32 AddSlide(element::SElement &inComponent, const char8_t *inName,
- PlayMode::Enum inPlayMode = PlayMode::Looping, bool inPaused = false,
- QT3DSU8 inPlaythroughTo = InvalidSlideIndex(), QT3DSU32 inMinTime = 0,
- QT3DSU32 inMaxTime = 0) = 0;
-
- virtual void SetSlideMaxTime(QT3DSU32 inMaxTime) = 0;
- virtual void AddSlideElement(element::SElement &inElement, bool inActive) = 0;
- virtual bool addSlideElement(element::SElement &inComponent, int slideIndex,
- element::SElement &inElement, bool eyeBall) = 0;
- virtual void removeElement(element::SElement &inComponent,
- element::SElement &inElement) = 0;
- virtual void AddSlideAttribute(Q3DStudio::SAttributeKey inKey,
- Q3DStudio::UVariant inValue) = 0;
- virtual SSlideAnimAction *AddSlideAnimAction(bool inAnimation, QT3DSI32 inIndex,
- bool inActive) = 0;
- virtual void AddSourcePath(const char8_t *path) = 0;
- virtual QVector<QString> GetSourcePaths(SSlideKey inKey) = 0;
- virtual void setIsActiveSlide(SSlideKey inKey, bool active) = 0;
- virtual bool isActiveSlide(SSlideKey inKey) const = 0;
- virtual void setUnloadSlide(SSlideKey inKey, bool unload) = 0;
- virtual bool isUnloadSlideSet(SSlideKey inKey) const = 0;
-
- // Using the dataset
- virtual void InitializeDynamicKeys(SSlideKey inKey,
- IAnimationSystem &inAnimationSystem) const = 0;
- virtual void ExecuteSlide(SSlideKey inKey, IAnimationSystem &inAnimationSystem,
- ILogicSystem &inLogicManager) = 0;
- virtual void RollbackSlide(SSlideKey inKey, IAnimationSystem &inAnimationSystem,
- ILogicSystem &inLogicManager) = 0;
- virtual QT3DSU8 FindSlide(element::SElement &inComponent,
- const char8_t *inSlideName) const = 0;
- virtual QT3DSU8 FindSlide(element::SElement &inComponent, QT3DSU32 inSlideHashName) const = 0;
- virtual const char8_t *GetSlideName(SSlideKey inKey) const = 0;
- virtual QT3DSU8 GetPlaythroughToSlideIndex(SSlideKey inKey) const = 0;
-
- static ISlideSystem &CreateSlideSystem(NVFoundationBase &inFnd, IStringTable &inStrTable,
- IElementAllocator &inElemAllocator);
- };
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.cpp
deleted file mode 100644
index e1efb8e0..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.cpp
+++ /dev/null
@@ -1,407 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTimePolicy.h"
-#include "foundation/Qt3DSUnionCast.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "Qt3DSComponentManager.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants
-//==============================================================================
-const TTimeUnit CTimePolicy::FOREVER = 0;
-
-SAlignedTimeUnit::SAlignedTimeUnit(const TTimeUnit &inUnit)
-{
- StaticAssert<sizeof(SAlignedTimeUnit) == sizeof(TTimeUnit)>::valid_expression();
- qt3ds::intrinsics::memCopy(this, &inUnit, sizeof(TTimeUnit));
-}
-
-SAlignedTimeUnit::operator TTimeUnit() const
-{
- TTimeUnit retval;
- qt3ds::intrinsics::memCopy(&retval, this, sizeof(TTimeUnit));
- return retval;
-}
-
-void SAlignedTimeUnit::operator-=(const TTimeUnit &inTime)
-{
- TTimeUnit theThis(*this);
- theThis -= inTime;
- *this = SAlignedTimeUnit(theThis);
-}
-
-void SAlignedTimeUnit::operator%=(const TTimeUnit &inTime)
-{
- TTimeUnit theThis(*this);
- theThis %= inTime;
- *this = SAlignedTimeUnit(theThis);
-}
-
-//==============================================================================
-/**
- * Initialization
- */
-
-void CTimePolicy::Initialize(const TTimeUnit inLoopingDuration, TimePolicyModes::Enum inMode)
-{
- m_LocalTime = 0;
- m_LoopingDuration = (unsigned long)inLoopingDuration;
- m_TimePolicyMode = inMode;
- m_Offset = 0;
- m_Paused = false;
- m_OffsetInvalid = 1;
- m_Backward = 0;
- m_Rate = 1.0f;
-}
-
-void CTimePolicy::Initialize(const TTimeUnit inLoopingDuration /*= FOREVER*/,
- UINT32 inRepetitions /*= 1*/, BOOL inPingPong /*= false*/)
-{
- // UINT8 m_Repetitions : 2; ///< Number of traversal ( 0 = forever, 1 = stop at end, 2 =
- // ping )
- TimePolicyModes::Enum theMode = TimePolicyModes::StopAtEnd;
- if (inRepetitions == 1)
- theMode = TimePolicyModes::StopAtEnd;
- else if (inRepetitions == 0) {
- if (inPingPong)
- theMode = TimePolicyModes::PingPong;
- else
- theMode = TimePolicyModes::Looping;
- } else
- theMode = TimePolicyModes::Ping;
-
- Initialize(inLoopingDuration, theMode);
-}
-
-//==============================================================================
-/**
- * Return the last computed time. This is subjected to playmodes.
- * @return local time
- */
-TTimeUnit CTimePolicy::InternalGetTime() const
-{
- if (m_LocalTime < m_LoopingDuration)
- return m_LocalTime;
- else {
- if (m_LoopingDuration == 0)
- return m_LocalTime;
-
- switch (m_TimePolicyMode) {
- case TimePolicyModes::StopAtEnd:
- return m_LoopingDuration;
- case TimePolicyModes::Looping:
- return m_LocalTime % m_LoopingDuration;
- case TimePolicyModes::Ping: {
- unsigned long interval = m_LocalTime / m_LoopingDuration;
- unsigned long leftover = m_LocalTime % m_LoopingDuration;
- if (interval == 1)
- return m_LoopingDuration - leftover;
- return 0;
- }
- case TimePolicyModes::PingPong: {
- unsigned long interval = m_LocalTime / m_LoopingDuration;
- unsigned long leftover = m_LocalTime % m_LoopingDuration;
- if (interval % 2)
- return m_LoopingDuration - leftover;
- return leftover;
- }
- default:
- QT3DS_ASSERT(false);
- return 0;
- break;
- }
- }
-}
-
-TTimeUnit CTimePolicy::GetTime() const
-{
- TTimeUnit retval = InternalGetTime();
- // Apply direction and rate.
- bool isPlayingBack = m_Backward;
- if (m_Rate < 0)
- isPlayingBack = !isPlayingBack;
-
- if (isPlayingBack)
- retval = m_LoopingDuration - retval;
- return retval;
-}
-
-static unsigned long clampTime(long inTime, unsigned long inDuration)
-{
- if (inTime < 0)
- return 0;
- if (inTime > (long)inDuration)
- return inDuration;
- return (unsigned long)inTime;
-}
-
-//==============================================================================
-/**
- * Trigger the policy to return inTime next GetTime is called.
- * This is tricky math and the m_Offset field is being used both normally to
- * simply change the time and here to calibrate itself next time ComputeTime
- * is called.
- * @param inTime time to be returned next ComputeTime
- */
-void CTimePolicy::SetTime(TTimeUnit inTime)
-{
-
- bool isPlayingBack = m_Backward;
- if (m_Rate < 0)
- isPlayingBack = !isPlayingBack;
-
- if (isPlayingBack)
- inTime = m_LoopingDuration - inTime;
-
- m_OffsetInvalid = 1;
-
- // Setup m_LocalTime such that it reflects intime.
- if (m_LoopingDuration == 0) {
- m_LocalTime = (unsigned long)inTime;
- return;
- }
-
- switch (m_TimePolicyMode) {
- case TimePolicyModes::StopAtEnd:
- m_LocalTime = clampTime((long)inTime, m_LoopingDuration);
- break;
- case TimePolicyModes::Looping: {
- long input = (long)inTime;
- while (input < 0)
- input += (long)m_LoopingDuration;
- m_LocalTime = ((unsigned long)input) % m_LoopingDuration;
- } break;
- case TimePolicyModes::Ping: {
- long input = (long)inTime;
- if (input < 0)
- input = 0;
-
- long totalInterval = (long)(m_LoopingDuration * 2);
- if (input > totalInterval)
- m_LocalTime = (unsigned long)totalInterval;
- else
- m_LocalTime = (unsigned long)input;
- } break;
- case TimePolicyModes::PingPong: {
- long totalInterval = (long)(m_LoopingDuration * 2);
- long input = (long)inTime;
- while (input < 0)
- input += totalInterval;
- m_LocalTime = (unsigned long)(input % totalInterval);
- } break;
- default:
- QT3DS_ASSERT(false);
- }
-}
-
-//==============================================================================
-/**
- * Retrieves the looping duration.
- * @see CTimePolicy::SetLoopingDuration( )
- * @return TTimeUnit looping duration
- */
-TTimeUnit CTimePolicy::GetLoopingDuration() const
-{
- return m_LoopingDuration;
-}
-
-//==============================================================================
-/**
- * Set the looping duration.
- * Looping duration is defined as the time it takes before stopping, pinging or
- * looping.
- * @param inTime looping duration
- */
-void CTimePolicy::SetLoopingDuration(const TTimeUnit inTime)
-{
- m_LoopingDuration = (unsigned long)inTime;
-}
-
-//==============================================================================
-/**
- * Return the paused state.
- * @return BOOL pause state
- */
-BOOL CTimePolicy::GetPaused() const
-{
- return m_Paused;
-}
-
-BOOL CTimePolicy::GetPlayBackDirection() const
-{
- bool reversePlaybackDirection = m_Backward;
- if (m_Rate < 0)
- reversePlaybackDirection = !reversePlaybackDirection;
-
- bool retval = m_LocalTime < m_LoopingDuration;
-
- if (reversePlaybackDirection)
- retval = !retval;
- return retval;
-}
-
-//==============================================================================
-/**
- * Sets the paused state
- * @param inPaused pause state
- */
-void CTimePolicy::SetPaused(const BOOL inPaused)
-{
- m_Paused = static_cast<UINT8>(inPaused);
-}
-
-BOOL CTimePolicy::UpdateTime(const TTimeUnit inTime)
-{
- if (fabs(m_Rate) > .001f)
- m_LocalTime =
- static_cast<unsigned long>(((unsigned long)(inTime + m_Offset)) * fabs(m_Rate));
- // else we are effectively stopped and we can't update the time.
-
- if (m_LoopingDuration == 0)
- return FALSE;
-
- unsigned long maxUsefulDuration = m_LoopingDuration * 2;
- BOOL retval = 0;
- switch (m_TimePolicyMode) {
- case TimePolicyModes::StopAtEnd:
- if (m_LocalTime > m_LoopingDuration) {
- retval = 1;
- m_LocalTime = m_LoopingDuration;
- }
- break;
- case TimePolicyModes::Looping:
- m_LocalTime = m_LocalTime % m_LoopingDuration;
- break;
- case TimePolicyModes::Ping:
- if (m_LocalTime > maxUsefulDuration) {
- retval = 1;
- m_LocalTime = maxUsefulDuration;
- }
- break;
- case TimePolicyModes::PingPong:
- m_LocalTime = m_LocalTime % maxUsefulDuration;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- return retval;
-}
-//==============================================================================
-/**
- * Compute the local time based off the current global time and the settings
- * such as duration, repetitions and ping-pong.
- * @param inTime global time being fed
- * @return BOOL true if policy has reached it's end time
- */
-BOOL CTimePolicy::ComputeTime(const TTimeUnit inTime)
-{
- // Return the last computed time if paused
- if (m_Paused || m_OffsetInvalid) {
- // m_LocalTime = inTime + m_Offset;
- if (fabs(m_Rate) > .001)
- m_Offset = (TTimeUnit)(m_LocalTime / fabs(m_Rate)) - inTime;
- else // rate is zero, this should not happen.
- m_Offset = (TTimeUnit)(m_LocalTime)-inTime;
- m_OffsetInvalid = 0;
- return false;
- }
- return UpdateTime(inTime);
-}
-
-eastl::pair<BOOL, TTimeUnit>
-SComponentTimePolicyOverride::ComputeLocalTime(CTimePolicy &inTimePolicy, TTimeUnit inGlobalTime)
-{
- TTimeUnit retval = 0;
- BOOL finished = FALSE;
- if (inTimePolicy.m_Paused || inTimePolicy.m_OffsetInvalid) {
- finished = inTimePolicy.ComputeTime(inGlobalTime);
- } else {
- Q3DStudio_ASSERT(m_EndTime <= inTimePolicy.GetLoopingDuration());
- unsigned long newLocalTime = (unsigned long)(inGlobalTime + inTimePolicy.m_Offset);
-
- float diff = static_cast<float>(newLocalTime - inTimePolicy.GetTime());
- diff *= m_TimeMultiplier;
- float updatedLocalTime = static_cast<float>(inTimePolicy.m_LocalTime) + diff;
-
- if (updatedLocalTime < 0.0f)
- updatedLocalTime = 0.0f;
-
- inTimePolicy.m_LocalTime = static_cast<unsigned long>(updatedLocalTime);
-
- bool runningBackwards = m_TimeMultiplier < 0;
-
- if (runningBackwards) {
- if (inTimePolicy.m_LocalTime <= m_EndTime) {
- finished = TRUE;
- inTimePolicy.m_LocalTime = (unsigned long)m_EndTime;
- }
- } else // running forwards
- {
- if (inTimePolicy.m_LocalTime >= m_EndTime) {
- finished = TRUE;
- inTimePolicy.m_LocalTime = (unsigned long)m_EndTime;
- }
- }
- inTimePolicy.m_Offset = inTimePolicy.m_LocalTime - inGlobalTime;
- }
- retval = inTimePolicy.GetTime();
- return eastl::make_pair(finished, retval);
-}
-
-void SComponentTimePolicyOverride::SetTime(CTimePolicy &inTimePolicy, TTimeUnit inLocalTime)
-{
- if (inLocalTime < 0)
- inLocalTime = 0;
- if (m_TimeMultiplier < 0) {
- if (inLocalTime <= m_EndTime) {
- inLocalTime = m_EndTime;
- }
- } else // running forwards
- {
- if (inLocalTime >= m_EndTime) {
- inLocalTime = m_EndTime;
- }
- }
- inTimePolicy.SetTime(inLocalTime);
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.h b/src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.h
deleted file mode 100644
index 6a137196..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSTimePolicy.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "foundation/Qt3DSOption.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-struct TimePolicyModes
-{
- enum Enum {
- StopAtEnd = 0,
- Looping,
- PingPong,
- Ping,
- };
-};
-
-//==============================================================================
-/**
- * Filter time based of parameters such as loop, duration, ping-pong etc.
- *
- * The time policy is an agnostic class that transforms time units based on
- * internal settings and times given to it. Think of it as the minimal
- * intelligence needed to support the time playback modes we use. It is simply
- * a function that takes in a source time variable, adjusts it accordingly,
- * and returns a filtered version.
- */
-
-QT3DS_ALIGN_PREFIX(4) class CTimePolicy
-{
- //==============================================================================
- // Fields and Constants
- //==============================================================================
-public:
- const static TTimeUnit FOREVER; ///< Forever repetitions means loop forever, Forever duration
- ///means infinite duration
- friend struct SComponentTimePolicyOverride; ///< This class needs to mangle some of our internal
- ///members to keep everything consistent
-
-protected:
- // Time policy related ( 20 bytes )
- unsigned long m_LocalTime; ///< Component current local time; transformed by playmodes
- unsigned long m_LoopingDuration; ///< Looping duration
- SAlignedTimeUnit m_Offset; ///< Subtraction modifier
- FLOAT m_Rate; ///< Time policy rate
- UINT8 m_TimePadding[12]; ///< Padding to keep the size of the time policy the same.
-
- UINT8
- m_TimePolicyMode : 2; ///< Number of durations before halting - FOREVER means infinite reps
- UINT8 m_Paused : 1; ///< Paused or playing
- UINT8 m_OffsetInvalid : 1; ///< True if we need to reset our offset
- UINT8 m_Backward : 1; ///< True if are in 'reverse' mode
-
- UINT8 m_Unused[3]; ///< (Padding 3 bytes)
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- void Initialize(const TTimeUnit inLoopingDuration = FOREVER,
- TimePolicyModes::Enum inMode = TimePolicyModes::StopAtEnd);
- void Initialize(const TTimeUnit inLoopingDuration, UINT32 inRepetitions, BOOL inPingPong);
-
-public: // Access Methods
- FLOAT GetRate() const { return m_Rate; }
- void SetRate(float inRate) { m_Rate = inRate; }
-
- bool IsReverse() const { return m_Backward; }
- void SetReverse(bool inIsReverse) { m_Backward = inIsReverse ? 1 : 0; }
-
- TTimeUnit GetTime() const;
- void SetTime(TTimeUnit inTime);
-
- TTimeUnit GetLoopingDuration() const;
- void SetLoopingDuration(const TTimeUnit inTime);
-
- BOOL GetPaused() const;
- void SetPaused(const BOOL inPaused);
-
- BOOL GetPlayBackDirection() const;
-
-public: // Time update
- // The addendum contains extra parameters used that can be specified in a goto-slide command
- // in the uia file.
- BOOL ComputeTime(const TTimeUnit inTime);
-
-private:
- TTimeUnit InternalGetTime() const;
-
- BOOL UpdateTime(const TTimeUnit inTime);
-} QT3DS_ALIGN_SUFFIX(4);
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtime/RuntimePrefix.h b/src/Runtime/ogl-runtime/src/runtime/RuntimePrefix.h
deleted file mode 100644
index bf729ebf..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/RuntimePrefix.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "render/backends/gl/Qt3DSOpenGLPrefix.h"
-
-#ifdef _WIN32
-//==============================================================================
-// DISABLED WARNINGS
-//
-// Note that most of these warnings are tuned off by default by the compiler
-// even at warning level 4. Using option /Wall turns on all warnings and makes
-// even standard Microsoft include files cry. We had to turn off these or
-// turn off warnings individually for each standard include file which was
-// too much work. Point is that /Wall is like Warning Level 5 and this brings
-// it down to about Warning level 4.5, still way above /W4.
-//#pragma warning( disable : 4189 ) // local variable is initialized but not referenced
-#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
-#pragma warning(disable : 4511) // copy constructor could not be generated
-#pragma warning(disable : 4512) // assignment operator could not be generated
-#pragma warning(disable : 4514) // unreferenced inline function has been removed
-#pragma warning(disable : 4619) // #pragma warning : there is no warning number '4619' (in string.h)
-#pragma warning(disable : 4625) // copy constructor could not be generated because a base class copy
- // constructor is inaccessible
-#pragma warning(disable : 4626) // assignment operator could not be generated because a base class
- // assignment operator is inaccessible
-#pragma warning( \
- disable : 4668) // not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
-#pragma warning(disable : 4826) // Conversion from 'const void *' to 'void *' is sign-extended
-#pragma warning(disable : 4996) // _snprintf' was declared deprecated
-#pragma warning(disable : 4711) // function selected for automatic inline expansion
-#pragma warning(disable : 4710) // function not inlined
-#pragma warning( \
- disable : 4738) // storing 32-bit float result in memory, possible loss of performance
-
-#pragma warning(disable : 4640) // construction of local static object is not thread-safe
-#pragma warning(disable : 4127) // conditional expression is constant
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#endif //_WIN32
-
-//==============================================================================
-// STD INCLUDES - Standard includes MUST come first
-#include <stdlib.h> // Standard functions
-#include <stdio.h> // File and IO
-#ifndef _INTEGRITYPLATFORM
-#include <memory.h> // memset, memcpy
-#endif
-#include <string.h> // strlen
-
-#if defined(_LINUXPLATFORM) || defined(_INTEGRITYPLATFORM)
-#include <stdint.h>
-
-#define UNREFERENCED_PARAMETER(theParam) theParam;
-#endif
-
-//==============================================================================
-// ROOT INCLUDES FOR FRAMEWORK
-//==============================================================================
-#include "Qt3DSTypes.h"
-#include "Qt3DSPlatformSpecific.h"
-#include "Qt3DSAssert.h"
-#include "Qt3DSMacros.h"
-#include "Qt3DSConfig.h"
-#include "Qt3DSMemorySettings.h"
-#include "Qt3DSMemory.h"
-#include "Qt3DSFrameworkTypes.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTimer.h"
-#include "Qt3DSIScene.h"
-#include "foundation/Qt3DSRefCounted.h" //scoped releasable auto ptr.
-#include "EASTL/hash_map.h"
-#include "EASTL/string.h"
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.cpp b/src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.cpp
deleted file mode 100644
index 913a24ec..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsmaterialdefinitionparser.h"
-
-#include <QtCore/qfile.h>
-#include <QtCore/qdir.h>
-#include <QtCore/qxmlstream.h>
-#include <QtCore/qtextstream.h>
-#include <QtCore/qdebug.h>
-
-namespace Q3DStudio {
-
-void Q3DSMaterialDefinitionParser::getMaterialInfo(const QString &materialDefinition,
- const QString &projPath, const QString &presPath,
- QString &outName, QMap<QString, QString> &outValues,
- QMap<QString, QMap<QString, QString>> &outTextureValues)
-{
- // materialDefinition can be the .materialdef file name or its content
- QString matDef;
- if (materialDefinition.endsWith(QLatin1String(".materialdef"), Qt::CaseInsensitive)) {
- QFile file(materialDefinition);
- if (!file.open(QFile::Text | QFile::ReadOnly)) {
- qWarning() << __FUNCTION__ << "Failed to open material definition file:"
- << file.errorString();
- return;
- }
- QTextStream stream(&file);
- matDef = stream.readAll();
- } else {
- matDef = materialDefinition;
- }
-
- QXmlStreamReader reader(matDef);
- reader.setNamespaceProcessing(false);
-
- const QDir docDir(presPath);
- const QDir projDir(projPath);
- QString textureName;
- QString propertyName;
- QString propertyType;
- QString propertyValue;
- QMap<QString, QString> textureProperties;
-
- const QString matDataVersion = QStringLiteral("1.0");
- const QString sourcePathStr = QStringLiteral("sourcepath");
- const QString nameStr = QStringLiteral("name");
- const QString typeStr = QStringLiteral("type");
- const QString versionStr = QStringLiteral("version");
-
- while (!reader.atEnd()) {
- reader.readNext();
- if (reader.tokenType() == QXmlStreamReader::StartElement) {
- if (reader.name() == QLatin1String("TextureData")) {
- textureName = reader.attributes().value(nameStr).toString();
- textureProperties.clear();
- } else if (reader.name() == QLatin1String("Property")) {
- propertyName = reader.attributes().value(nameStr).toString();
- propertyType = reader.attributes().value(typeStr).toString();
- propertyValue.clear();
- } else if (reader.name() == QLatin1String("MaterialData")) {
- QString version = reader.attributes().value(versionStr).toString();
- if (version != matDataVersion) {
- qWarning() << __FUNCTION__ << "Invalid MaterialData version; expected '"
- << matDataVersion << "', got '" << version << "'";
- outName.clear();
- outValues.clear();
- outTextureValues.clear();
- return;
- }
- }
- } else if (reader.tokenType() == QXmlStreamReader::EndElement) {
- if (reader.name() == QLatin1String("TextureData")) {
- outTextureValues[textureName] = textureProperties;
- textureName.clear();
- } else if (reader.name() == QLatin1String("Property")) {
- if (textureName.isEmpty()) {
- outValues[propertyName] = propertyValue;
- if (propertyName == nameStr)
- outName = propertyValue;
- } else {
- textureProperties[propertyName] = propertyValue;
- }
- propertyName.clear();
- propertyType.clear();
- }
- } else if (reader.tokenType() == QXmlStreamReader::Characters) {
- if (!propertyName.isEmpty()) {
- propertyValue = reader.text().toString();
- if (propertyName == sourcePathStr) {
- // Check that the referenced file exists
- const auto absSourcePath = projDir.absoluteFilePath(propertyValue);
- if (!QFileInfo(absSourcePath).exists()) {
- qWarning() << __FUNCTION__ << "Referenced file doesn't exist:"
- << propertyValue;
- outName.clear();
- outValues.clear();
- outTextureValues.clear();
- return;
- }
- }
- if (!propertyValue.isEmpty() && (propertyType == QLatin1String("Texture")
- || propertyName == sourcePathStr)) {
- propertyValue = docDir.relativeFilePath(
- projDir.absoluteFilePath(propertyValue));
- }
- }
- }
- }
-}
-
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.h b/src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.h
deleted file mode 100644
index f6d98bbf..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsmaterialdefinitionparser.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSMATERIALDEFINITIONPARSER_H
-#define Q3DSMATERIALDEFINITIONPARSER_H
-
-#include <QtCore/qstring.h>
-#include <QtCore/qmap.h>
-
-namespace Q3DStudio {
-
-class Q3DSMaterialDefinitionParser
-{
-public:
- static void getMaterialInfo(const QString &materialDefinition,
- const QString &projPath, const QString &presPath,
- QString &outName, QMap<QString, QString> &outValues,
- QMap<QString, QMap<QString, QString>> &outTextureValues);
-};
-
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.cpp b/src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.cpp
deleted file mode 100644
index 83b706eb..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlbehavior.h"
-#include "q3dsqmlscript.h"
-
-namespace Q3DStudio {
-
-Q3DSQmlBehavior::Q3DSQmlBehavior(QObject *parent)
- : QObject(parent), m_script(nullptr)
-{
-
-}
-
-void Q3DSQmlBehavior::setScript(Q3DSQmlScript *script)
-{
- m_script = script;
-}
-
-float Q3DSQmlBehavior::getDeltaTime()
-{
- return m_script->getDeltaTime();
-}
-
-float Q3DSQmlBehavior::getAttribute(const QString &attribute)
-{
- return m_script->getAttribute(attribute);
-}
-
-void Q3DSQmlBehavior::setAttribute(const QString &attribute, const QVariant &value)
-{
- m_script->setAttribute(attribute, value);
-}
-
-void Q3DSQmlBehavior::setAttribute(const QString &handle, const QString &attribute,
- const QVariant &value)
-{
- m_script->setAttribute(handle, attribute, value);
-}
-
-void Q3DSQmlBehavior::fireEvent(const QString &event)
-{
- m_script->fireEvent(event);
-}
-
-void Q3DSQmlBehavior::registerForEvent(const QString &event, const QJSValue &function)
-{
- m_script->registerForEvent(event, function);
-}
-
-void Q3DSQmlBehavior::registerForEvent(const QString &handle, const QString &event,
- const QJSValue &function)
-{
- m_script->registerForEvent(handle, event, function);
-}
-
-void Q3DSQmlBehavior::unregisterForEvent(const QString &event)
-{
- m_script->unregisterForEvent(event);
-}
-
-void Q3DSQmlBehavior::unregisterForEvent(const QString &handle, const QString &event)
-{
- m_script->unregisterForEvent(handle, event);
-}
-
-QVector2D Q3DSQmlBehavior::getMousePosition()
-{
- return m_script->getMousePosition();
-}
-
-QMatrix4x4 Q3DSQmlBehavior::calculateGlobalTransform(const QString &handle)
-{
- return m_script->calculateGlobalTransform(handle);
-}
-
-QVector3D Q3DSQmlBehavior::lookAt(const QVector3D &target)
-{
- return m_script->lookAt(target);
-}
-
-QVector3D Q3DSQmlBehavior::matrixToEuler(const QMatrix4x4 &matrix)
-{
- return m_script->matrixToEuler(matrix);
-}
-
-QString Q3DSQmlBehavior::getParent(const QString &handle)
-{
- return m_script->getParent(handle);
-}
-
-void Q3DSQmlBehavior::setDataInputValue(const QString &name, const QVariant &value)
-{
- return m_script->setDataInputValue(name, value);
-}
-
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.h b/src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.h
deleted file mode 100644
index 76f4a4a0..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlbehavior.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSQMLBEHAVIOR_H
-#define Q3DSQMLBEHAVIOR_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-#include <QtQml/qjsvalue.h>
-#include <QtGui/qvector2d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qmatrix4x4.h>
-
-namespace Q3DStudio {
-
-class Q3DSQmlScript;
-
-class Q3DSQmlBehavior : public QObject
-{
- Q_OBJECT
-public:
- Q3DSQmlBehavior(QObject *parent = nullptr);
-
- void setScript(Q3DSQmlScript *script);
-
- Q_INVOKABLE float getDeltaTime();
- Q_INVOKABLE float getAttribute(const QString &attribute);
- Q_INVOKABLE void setAttribute(const QString &attribute, const QVariant &value);
- Q_INVOKABLE void setAttribute(const QString &handle, const QString &attribute,
- const QVariant &value);
- Q_INVOKABLE void fireEvent(const QString &event);
- Q_INVOKABLE void registerForEvent(const QString &event, const QJSValue &function);
- Q_INVOKABLE void registerForEvent(const QString &handle, const QString &event,
- const QJSValue &function);
- Q_INVOKABLE void unregisterForEvent(const QString &event);
- Q_INVOKABLE void unregisterForEvent(const QString &handle, const QString &event);
- Q_INVOKABLE QVector2D getMousePosition();
- Q_INVOKABLE QMatrix4x4 calculateGlobalTransform(const QString &handle = QString());
- Q_INVOKABLE QVector3D lookAt(const QVector3D &target);
- Q_INVOKABLE QVector3D matrixToEuler(const QMatrix4x4 &matrix);
- Q_INVOKABLE QString getParent(const QString &handle = QString());
- Q_REVISION(1) Q_INVOKABLE void setDataInputValue(const QString &name, const QVariant &value);
-
-
-Q_SIGNALS:
- void initialize();
- void activate();
- void update();
- void deactivate();
-
-private:
- Q3DSQmlScript *m_script;
-};
-
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.cpp b/src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.cpp
deleted file mode 100644
index 725c7520..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.cpp
+++ /dev/null
@@ -1,742 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlscript.h"
-
-#include "Qt3DSQmlEngine.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSPresentation.h"
-#include "Qt3DSInputEngine.h"
-#include "Qt3DSInputFrame.h"
-#include "Qt3DSQmlElementHelper.h"
-#include "Qt3DSHash.h"
-#include "Qt3DSEulerAngles.h"
-#include "Qt3DSMathUtils.h"
-
-#include <QMetaProperty>
-
-using namespace Q3DStudio;
-using namespace qt3ds::runtime;
-
-QJSValue argToQJSValue(qt3ds::foundation::IStringTable &strTable,
- Q3DStudio::UINT8 type, const UVariant &value) {
- switch (type) {
- case ATTRIBUTETYPE_INT32:
- case ATTRIBUTETYPE_HASH:
- return QJSValue(value.m_INT32);
- case ATTRIBUTETYPE_FLOAT:
- return QJSValue(value.m_FLOAT);
- case ATTRIBUTETYPE_BOOL:
- return QJSValue(value.m_INT32 != 0);
- case ATTRIBUTETYPE_STRING:
- return QJSValue(strTable.HandleToStr(value.m_StringHandle));
- case ATTRIBUTETYPE_NONE:
- return QJSValue();
- default:
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Pushed event argument value of unknown type: "<< type;
- }
- return QJSValue();
-}
-
-void eventCallback(void *contextData, SEventCommand &event)
-{
- auto data = static_cast<Q3DSQmlScript::EventData *>(contextData);
- qt3ds::foundation::IStringTable &strTable(
- event.m_Target->GetBelongedPresentation()->GetStringTable());
- QJSValue arg1 = argToQJSValue(strTable, event.m_Arg1Type, event.m_Arg1);
- QJSValue arg2 = argToQJSValue(strTable, event.m_Arg2Type, event.m_Arg2);
- data->function.call({arg1, arg2});
-}
-
-Q3DSQmlScript::Q3DSQmlScript(CQmlEngine &api, Q3DSQmlBehavior &object,
- TElement &behavior, TElement &owner)
- : QObject(nullptr)
- , m_api(api)
- , m_object(object)
- , m_behavior(behavior)
- , m_owner(owner)
- , m_initialized(false)
- , m_lastActivationState(false)
- , m_deltaTime(0.0f)
- , m_lastTime(0)
-{
- qt3ds::foundation::IStringTable &strTable
- = m_behavior.GetBelongedPresentation()->GetStringTable();
- const QMetaObject *meta = object.metaObject();
- for (int i = 0; i < meta->propertyCount(); ++i) {
- QMetaProperty property = meta->property(i);
- QVariant::Type t = property.type();
- if (static_cast<QMetaType::Type>(t) == QMetaType::QVariant) {
- // detect type from behavior property
- auto nameHash = CHash::HashAttribute(property.name());
- Option<element::TPropertyDescAndValuePtr> value = behavior.FindProperty(nameHash);
- if (value.hasValue()) {
- switch (value->first.m_Type) {
- case ATTRIBUTETYPE_INT32:
- case ATTRIBUTETYPE_HASH:
- t = QVariant::Int;
- break;
- case ATTRIBUTETYPE_FLOAT:
- t = QVariant::Double;
- break;
- case ATTRIBUTETYPE_BOOL:
- t = QVariant::Bool;
- break;
- case ATTRIBUTETYPE_STRING:
- t = QVariant::String;
- break;
- case ATTRIBUTETYPE_FLOAT4:
- t = QVariant::Vector4D;
- break;
- case ATTRIBUTETYPE_FLOAT3:
- t = QVariant::Vector3D;
- break;
- case ATTRIBUTETYPE_FLOAT2:
- t = QVariant::Vector2D;
- break;
- default:
- break;
- }
- } else {
- // detect vectors
- QByteArray name(property.name());
- QByteArray xname = name + QByteArrayLiteral(".x");
- Option<element::TPropertyDescAndValuePtr> xvalue
- = behavior.FindProperty(CHash::HashAttribute(xname.data()));
- QByteArray rname = name + QByteArrayLiteral(".r");
- Option<element::TPropertyDescAndValuePtr> rvalue
- = behavior.FindProperty(CHash::HashAttribute(rname.data()));
- if (xvalue.hasValue()) {
- QByteArray yname = name + QByteArrayLiteral(".y");
- QByteArray zname = name + QByteArrayLiteral(".z");
- QByteArray wname = name + QByteArrayLiteral(".w");
-
- Option<element::TPropertyDescAndValuePtr> yvalue
- = behavior.FindProperty(CHash::HashAttribute(yname.data()));
- Option<element::TPropertyDescAndValuePtr> zvalue
- = behavior.FindProperty(CHash::HashAttribute(zname.data()));
- Option<element::TPropertyDescAndValuePtr> wvalue
- = behavior.FindProperty(CHash::HashAttribute(wname.data()));
- int count = 1;
- count += yvalue.hasValue() ? 1 : 0;
- count += zvalue.hasValue() ? 1 : 0;
- count += wvalue.hasValue() ? 1 : 0;
- if (count == 2)
- t = QVariant::Vector2D;
- else if (count == 3)
- t = QVariant::Vector3D;
- else if (count == 4)
- t = QVariant::Vector4D;
- } else if (rvalue.hasValue()) {
- QByteArray gname = name + QByteArrayLiteral(".g");
- QByteArray bname = name + QByteArrayLiteral(".b");
- QByteArray aname = name + QByteArrayLiteral(".a");
- Option<element::TPropertyDescAndValuePtr> gvalue
- = behavior.FindProperty(CHash::HashAttribute(gname.data()));
- Option<element::TPropertyDescAndValuePtr> bvalue
- = behavior.FindProperty(CHash::HashAttribute(bname.data()));
- Option<element::TPropertyDescAndValuePtr> avalue
- = behavior.FindProperty(CHash::HashAttribute(aname.data()));
- int count = 1;
- count += gvalue.hasValue() ? 1 : 0;
- count += bvalue.hasValue() ? 1 : 0;
- count += avalue.hasValue() ? 1 : 0;
- if (count == 2)
- t = QVariant::Vector2D;
- else if (count == 3)
- t = QVariant::Vector3D;
- else if (count == 4)
- t = QVariant::Vector4D;
- }
- }
- }
- switch (t) {
- case QVariant::Bool: {
- const char *name = property.name();
- auto nameHash = CHash::HashAttribute(name);
- Option<element::TPropertyDescAndValuePtr> value = behavior.FindProperty(nameHash);
- if (value.hasValue()) {
- std::function<void()> mapper = [&object, property, value]() -> void {
- Q3DStudio::UVariant *val = value->second;
- property.write(&object, QVariant::fromValue<bool>(val->m_INT32 > 0));
- };
- m_mappedProperties.push_back(mapper);
- }
- } break;
- case QVariant::Int:
- case QVariant::UInt:
- case QVariant::LongLong:
- case QVariant::ULongLong: {
- const char *name = property.name();
- auto nameHash = CHash::HashAttribute(name);
- Option<element::TPropertyDescAndValuePtr> value = behavior.FindProperty(nameHash);
- if (value.hasValue()) {
- std::function<void()> mapper = [&object, property, value]() {
- Q3DStudio::UVariant *val = value->second;
- property.write(&object, QVariant::fromValue(val->m_INT32));
- };
- m_mappedProperties.push_back(mapper);
- }
- } break;
- case QVariant::Double: {
- const char *name = property.name();
- auto nameHash = CHash::HashAttribute(name);
- Option<element::TPropertyDescAndValuePtr> value = behavior.FindProperty(nameHash);
- if (value.hasValue()) {
- std::function<void()> mapper = [&object, property, value]() {
- Q3DStudio::UVariant *val = value->second;
- property.write(&object, QVariant::fromValue(val->m_FLOAT));
- };
- m_mappedProperties.push_back(mapper);
- }
- } break;
- case QVariant::String: {
- const char *name = property.name();
- auto nameHash = CHash::HashAttribute(name);
- Option<element::TPropertyDescAndValuePtr> value = behavior.FindProperty(nameHash);
- if (value.hasValue()) {
- std::function<void()> mapper = [&object, property, value, &strTable]() {
- Q3DStudio::UVariant *val = value->second;
- property.write(&object, QVariant::fromValue(
- QString::fromUtf8(strTable.HandleToStr(val->m_StringHandle).c_str())));
- };
- m_mappedProperties.push_back(mapper);
- }
- } break;
- case QVariant::Vector2D: {
- std::function<void()> mapper;
- auto nameHash = CHash::HashAttribute(property.name());
- Option<element::TPropertyDescAndValuePtr> prop = behavior.FindProperty(nameHash);
- if (prop.hasValue() && prop->first.m_Type == Q3DStudio::ATTRIBUTETYPE_FLOAT2) {
- mapper = [&object, property, prop]() {
- QVector2D vec;
- Q3DStudio::UVariant *value = prop->second;
- vec.setX(value->m_FLOAT3[0]);
- vec.setY(value->m_FLOAT3[1]);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- } else {
- QByteArray name(property.name());
- QByteArray cname = name + QByteArrayLiteral(".x");
- auto nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> xvalue = behavior.FindProperty(nameHash);
- if (xvalue.hasValue()) {
- cname = name + QByteArrayLiteral(".y");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> yvalue
- = behavior.FindProperty(nameHash);
-
- if (xvalue.hasValue() && yvalue.hasValue()) {
- mapper = [&object, property, xvalue, yvalue]() {
- QVector2D vec;
- vec.setX(xvalue->second->m_FLOAT);
- vec.setY(yvalue->second->m_FLOAT);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- }
- }
- }
- } break;
- case QVariant::Vector3D: {
- std::function<void()> mapper;
- auto nameHash = CHash::HashAttribute(property.name());
- Option<element::TPropertyDescAndValuePtr> prop = behavior.FindProperty(nameHash);
- if (prop.hasValue() && prop->first.m_Type == Q3DStudio::ATTRIBUTETYPE_FLOAT3) {
- mapper = [&object, property, prop]() {
- QVector3D vec;
- Q3DStudio::UVariant *value = prop->second;
- vec.setX(value->m_FLOAT3[0]);
- vec.setY(value->m_FLOAT3[1]);
- vec.setZ(value->m_FLOAT3[2]);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- } else {
- QByteArray name(property.name());
- QByteArray cname = name + QByteArrayLiteral(".x");
- auto nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> xvalue = behavior.FindProperty(nameHash);
- if (xvalue.hasValue()) {
- cname = name + QByteArrayLiteral(".y");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> yvalue
- = behavior.FindProperty(nameHash);
- cname = name + QByteArrayLiteral(".z");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> zvalue
- = behavior.FindProperty(nameHash);
-
- if (xvalue.hasValue() && yvalue.hasValue() && zvalue.hasValue()) {
- mapper = [&object, property, xvalue, yvalue, zvalue]() {
- QVector3D vec;
- vec.setX(xvalue->second->m_FLOAT);
- vec.setY(yvalue->second->m_FLOAT);
- vec.setZ(zvalue->second->m_FLOAT);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- }
- }
- }
- } break;
- case QVariant::Color:
- case QVariant::Vector4D: {
- std::function<void()> mapper;
- auto nameHash = CHash::HashAttribute(property.name());
- Option<element::TPropertyDescAndValuePtr> prop = behavior.FindProperty(nameHash);
- if (prop.hasValue() && prop->first.m_Type == Q3DStudio::ATTRIBUTETYPE_FLOAT4) {
- mapper = [&object, property, prop]() {
- QVector4D vec;
- Q3DStudio::UVariant *value = prop->second;
- vec.setX(value->m_FLOAT4[0]);
- vec.setY(value->m_FLOAT4[1]);
- vec.setZ(value->m_FLOAT4[2]);
- vec.setW(value->m_FLOAT4[3]);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- } else {
- QByteArray name(property.name());
- QByteArray cname = name + QByteArrayLiteral(".x");
- auto nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> xvalue = behavior.FindProperty(nameHash);
- if (xvalue.hasValue()) {
- cname = name + QByteArrayLiteral(".y");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> yvalue
- = behavior.FindProperty(nameHash);
- cname = name + QByteArrayLiteral(".z");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> zvalue
- = behavior.FindProperty(nameHash);
- cname = name + QByteArrayLiteral(".w");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> wvalue
- = behavior.FindProperty(nameHash);
-
- if (xvalue.hasValue() && yvalue.hasValue() && zvalue.hasValue()
- && wvalue.hasValue()) {
- mapper = [&object, property, xvalue, yvalue, zvalue, wvalue]() {
- QVector4D vec;
- vec.setX(xvalue->second->m_FLOAT);
- vec.setY(yvalue->second->m_FLOAT);
- vec.setZ(zvalue->second->m_FLOAT);
- vec.setW(wvalue->second->m_FLOAT);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- }
- } else {
- cname = name + QByteArrayLiteral(".r");
- auto nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> rvalue
- = behavior.FindProperty(nameHash);
- if (rvalue.hasValue()) {
- cname = name + QByteArrayLiteral(".g");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> gvalue
- = behavior.FindProperty(nameHash);
- cname = name + QByteArrayLiteral(".b");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> bvalue
- = behavior.FindProperty(nameHash);
- cname = name + QByteArrayLiteral(".a");
- nameHash = CHash::HashAttribute(cname.data());
- Option<element::TPropertyDescAndValuePtr> avalue
- = behavior.FindProperty(nameHash);
-
- if (rvalue.hasValue() && gvalue.hasValue() && bvalue.hasValue()
- && avalue.hasValue()) {
- mapper = [&object, property, rvalue, gvalue, bvalue, avalue]() {
- QVector4D vec;
- vec.setX(rvalue->second->m_FLOAT);
- vec.setY(gvalue->second->m_FLOAT);
- vec.setZ(bvalue->second->m_FLOAT);
- vec.setW(avalue->second->m_FLOAT);
- property.write(&object, QVariant::fromValue(vec));
- };
- m_mappedProperties.push_back(mapper);
- }
- }
- }
- }
- } break;
- default:
- break;
- }
- }
-}
-
-Q3DSQmlScript::~Q3DSQmlScript()
-{
- for (const EventCallbackInfo &callback : m_eventCallbacks)
- delete callback.data;
-}
-
-void Q3DSQmlScript::update()
-{
- updateProperties();
-
- bool active = m_behavior.GetActive();
-
- if (active && !m_initialized) {
- m_initialized = true;
- Q_EMIT m_object.initialize();
- }
-
- TTimeUnit time = static_cast<CPresentation *>(m_behavior.GetBelongedPresentation())->GetTime();
- m_deltaTime = (time - m_lastTime) / 1000.0f;
- m_lastTime = time;
-
- if (m_lastActivationState != active) {
- if (active)
- Q_EMIT m_object.activate();
- else
- Q_EMIT m_object.deactivate();
- }
- m_lastActivationState = active;
- if (active)
- Q_EMIT m_object.update();
-}
-
-void Q3DSQmlScript::call(const QString &function)
-{
- const QMetaObject *meta = m_object.metaObject();
- const QString normalized = function + "()";
- if (meta->indexOfMethod(normalized.toUtf8().constData()) != -1)
- QMetaObject::invokeMethod(&m_object, function.toUtf8().constData());
-}
-
-void Q3DSQmlScript::updateProperties()
-{
- using namespace qt3ds::foundation;
- using namespace qt3ds::runtime::element;
-
- if (!m_behavior.GetActive() || !m_behavior.IsDirty())
- return;
-
- for (auto m : qAsConst(m_mappedProperties))
- m();
-}
-
-bool Q3DSQmlScript::hasBehavior(const TElement *behavior)
-{
- return &m_behavior == behavior;
-}
-
-float Q3DSQmlScript::getDeltaTime()
-{
- return m_deltaTime;
-}
-
-float Q3DSQmlScript::getAttribute(const QString &attribute)
-{
- if (!m_behavior.GetActive())
- return 0;
-
- float floatValue = 0;
- m_api.GetAttribute(&m_owner,
- attribute.toUtf8().constData(),
- (char *)&floatValue);
- return floatValue;
-}
-
-void Q3DSQmlScript::setAttribute(const QString &attribute, const QVariant &value)
-{
- setAttribute("", attribute, value);
-}
-
-void Q3DSQmlScript::setAttribute(const QString &handle, const QString &attribute,
- const QVariant &value)
-{
- if (!m_behavior.GetActive())
- return;
-
- TElement *element = &m_owner;
- if (!handle.isEmpty())
- element = getElementByPath(handle);
- if (!element)
- return;
-
- QByteArray valueStr;
- float valueFloat;
-
- const char *valuePtr = nullptr;
- switch (static_cast<QMetaType::Type>(value.type())) {
- case QMetaType::Bool:
- case QMetaType::Int:
- case QMetaType::Double:
- case QMetaType::Float:
- valueFloat = value.toFloat();
- valuePtr = reinterpret_cast<const char *>(&valueFloat);
- break;
- case QMetaType::QVector2D: {
- QVector2D vec = value.value<QVector2D>();
- float val[2];
- val[0] = vec.x();
- val[1] = vec.y();
- const QByteArray name = attribute.toUtf8();
- QByteArray cname = name + QByteArrayLiteral(".x");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val));
- cname = name + QByteArrayLiteral(".y");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val + 1));
- return;
- }
- case QMetaType::QVector3D: {
- QVector3D vec = value.value<QVector3D>();
- float val[3];
- val[0] = vec.x();
- val[1] = vec.y();
- val[2] = vec.z();
- const QByteArray name = attribute.toUtf8();
- QByteArray cname = name + QByteArrayLiteral(".x");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val));
- cname = name + QByteArrayLiteral(".y");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val + 1));
- cname = name + QByteArrayLiteral(".z");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val + 2));
- return;
- }
- case QMetaType::QColor:
- case QMetaType::QVector4D: {
- QVector4D vec = value.value<QVector4D>();
- float val[4];
- val[0] = vec.x();
- val[1] = vec.y();
- val[2] = vec.z();
- val[3] = vec.w();
- const QByteArray name = attribute.toUtf8();
- QByteArray cname = name + QByteArrayLiteral(".x");
- if (m_api.GetAttribute(element, cname.constData(), reinterpret_cast<char *>(&valueFloat))) {
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val));
- cname = name + QByteArrayLiteral(".y");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val + 1));
- cname = name + QByteArrayLiteral(".z");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val + 2));
- cname = name + QByteArrayLiteral(".w");
- m_api.SetAttribute(element, cname.constData(), reinterpret_cast<const char *>(val + 3));
- } else {
- QByteArray cname = name + QByteArrayLiteral(".r");
- if (m_api.GetAttribute(element, cname.constData(),
- reinterpret_cast<char *>(&valueFloat))) {
- m_api.SetAttribute(element, cname.constData(),
- reinterpret_cast<const char *>(val));
- cname = name + QByteArrayLiteral(".g");
- m_api.SetAttribute(element, cname.constData(),
- reinterpret_cast<const char *>(val + 1));
- cname = name + QByteArrayLiteral(".b");
- m_api.SetAttribute(element, cname.constData(),
- reinterpret_cast<const char *>(val + 2));
- cname = name + QByteArrayLiteral(".a");
- m_api.SetAttribute(element, cname.constData(),
- reinterpret_cast<const char *>(val + 3));
- }
- }
- return;
- }
- case QMetaType::QString:
- default:
- valueStr = value.toString().toUtf8();
- valuePtr = valueStr.constData();
- break;
- }
-
- m_api.SetAttribute(element, attribute.toUtf8().constData(), valuePtr);
-}
-
-void Q3DSQmlScript::fireEvent(const QString &event)
-{
- if (!m_behavior.GetActive())
- return;
- m_api.FireEvent(m_behavior.m_Path, event.toUtf8().constData());
-}
-
-void Q3DSQmlScript::registerForEvent(const QString &event, const QJSValue &function)
-{
- registerForEvent("", event, function);
-}
-
-void Q3DSQmlScript::registerForEvent(const QString &handle, const QString &event,
- const QJSValue &function)
-{
- if (!m_behavior.GetActive())
- return;
-
- TElement *element = &m_owner;
- if (!handle.isEmpty())
- element = getElementByPath(handle);
- if (!element)
- return;
-
- if (!function.isCallable())
- return;
-
- CPresentation *presentation
- = static_cast<CPresentation *>(m_behavior.GetBelongedPresentation());
- TEventCommandHash eventHash = CHash::HashEventCommand(event.toUtf8().constData());
-
- for (auto &&callback : m_eventCallbacks) {
- if (callback.element == element && callback.eventHash == eventHash)
- return;
- }
-
- EventData *data = new EventData();
- data->function = function;
-
- m_eventCallbacks.push_back({element, eventHash, data});
-
- presentation->RegisterEventCallback(element, eventHash, &eventCallback, data);
-}
-
-void Q3DSQmlScript::unregisterForEvent(const QString &event)
-{
- unregisterForEvent("", event);
-}
-
-void Q3DSQmlScript::unregisterForEvent(const QString &handle, const QString &event)
-{
- if (!m_behavior.GetActive())
- return;
-
- TElement *element = &m_owner;
- if (!handle.isEmpty())
- element = getElementByPath(handle);
- if (!element)
- return;
-
- CPresentation *presentation
- = static_cast<CPresentation *>(m_behavior.GetBelongedPresentation());
- TEventCommandHash eventHash = CHash::HashEventCommand(event.toUtf8().constData());
- EventData *data = nullptr;
-
- for (int i = 0; i < m_eventCallbacks.size(); ++i) {
- if (m_eventCallbacks[i].element == element && m_eventCallbacks[i].eventHash == eventHash) {
- data = m_eventCallbacks[i].data;
- m_eventCallbacks.erase(m_eventCallbacks.begin() + i);
- break;
- }
- }
-
- if (data) {
- presentation->UnregisterEventCallback(element, eventHash, &eventCallback, data);
- delete data;
- }
-}
-
-QVector2D Q3DSQmlScript::getMousePosition()
-{
- CPresentation *presentation
- = static_cast<CPresentation *>(m_behavior.GetBelongedPresentation());
- qt3ds::runtime::IApplication &app = presentation->GetApplication();
-
- SInputFrame input = app.GetInputEngine().GetInputFrame();
- if (app.GetPrimaryPresentation()) {
- Q3DStudio::SMousePosition position =
- app.GetPrimaryPresentation()->GetScene()->WindowToPresentation(
- Q3DStudio::SMousePosition(static_cast<INT32>(input.m_PickX),
- static_cast<INT32>(input.m_PickY)));
-
- return QVector2D(position.m_X, position.m_Y);
- }
- return QVector2D(0, 0);
-}
-
-QMatrix4x4 Q3DSQmlScript::calculateGlobalTransform(const QString &handle)
-{
- TElement *element = &m_owner;
- if (!handle.isEmpty())
- element = getElementByPath(handle);
- if (!element)
- return QMatrix4x4();
-
- RuntimeMatrix transform;
- IScene *scene = element->GetBelongedPresentation()->GetScene();
- scene->CalculateGlobalTransform(element, transform);
- transform.FlipCoordinateSystem();
-
- return QMatrix4x4(&transform.m_Data[0][0]);
-}
-
-QVector3D Q3DSQmlScript::lookAt(const QVector3D &target)
-{
- FLOAT theMag = ::sqrtf(target.x() * target.x() + target.z() * target.z());
- FLOAT thePitch = -::atan2f(target.y(), theMag);
- FLOAT theYaw = ::atan2f(target.x(), target.z());
-
- return QVector3D(radToDeg(thePitch), radToDeg(theYaw), 0.0f);
-}
-
-QVector3D Q3DSQmlScript::matrixToEuler(const QMatrix4x4 &matrix)
-{
- CEulerAngleConverter converter;
- const float *qMatrix = matrix.constData();
- HMatrix hHatrix;
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j)
- hHatrix[i][j] = qMatrix[j * 4 + i];
- }
- EulerAngles eulerAngles = converter.Eul_FromHMatrix(hHatrix, EulOrdYXZs);
- return QVector3D(-eulerAngles.y, -eulerAngles.x, -eulerAngles.z);
-}
-
-QString Q3DSQmlScript::getParent(const QString &handle)
-{
- TElement *element = &m_owner;
- if (!handle.isEmpty())
- element = getElementByPath(handle);
- if (!element)
- return "";
-
- TElement *parent = element->GetParent();
- if (!parent)
- return "";
- return parent->m_Path.c_str();
-}
-
-void Q3DSQmlScript::setDataInputValue(const QString &name, const QVariant &value,
- qt3ds::runtime::DataInputValueRole valueRole)
-{
- m_api.SetDataInputValue(name, value, valueRole);
-}
-
-TElement *Q3DSQmlScript::getElementByPath(const QString &path)
-{
- if (!m_api.GetApplication())
- return nullptr;
-
- TElement *element = CQmlElementHelper::GetElement(
- *m_api.GetApplication(),
- m_api.GetApplication()->GetPrimaryPresentation(),
- path.toUtf8().constData(), &m_owner);
- return element;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.h b/src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.h
deleted file mode 100644
index 3ad1118f..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsqmlscript.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSQMLSCRIPT_H
-#define Q3DSQMLSCRIPT_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-#include <QtQml/qjsvalue.h>
-#include <QtGui/qvector2d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qmatrix4x4.h>
-
-#include "Qt3DSTypes.h"
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSEvent.h"
-#include "q3dsqmlbehavior.h"
-#include "Qt3DSApplication.h"
-
-namespace Q3DStudio {
-class CQmlEngine;
-
-class Q3DSQmlScript : public QObject
-{
- Q_OBJECT
-public:
- Q3DSQmlScript(CQmlEngine &api, Q3DSQmlBehavior &object, TElement &element, TElement &parent);
- ~Q3DSQmlScript();
-
- void update();
- void call(const QString &function);
- void updateProperties();
- bool hasBehavior(const TElement *behavior);
-
- float getDeltaTime();
- float getAttribute(const QString &attribute);
- void setAttribute(const QString &attribute, const QVariant &value);
- void setAttribute(const QString &handle, const QString &attribute,
- const QVariant &value);
- void fireEvent(const QString &event);
- void registerForEvent(const QString &event, const QJSValue &function);
- void registerForEvent(const QString &handle, const QString &event,
- const QJSValue &function);
- void unregisterForEvent(const QString &event);
- void unregisterForEvent(const QString &handle, const QString &event);
- QVector2D getMousePosition();
- QMatrix4x4 calculateGlobalTransform(const QString &handle);
- QVector3D lookAt(const QVector3D &target);
- QVector3D matrixToEuler(const QMatrix4x4 &matrix);
- QString getParent(const QString &handle);
- void setDataInputValue(const QString &name, const QVariant &value,
- qt3ds::runtime::DataInputValueRole valueRole
- = qt3ds::runtime::DataInputValueRole::Value);
-
- struct EventData {
- QJSValue function;
- };
-
-private:
- TElement *getElementByPath(const QString &path);
-
- CQmlEngine &m_api;
- Q3DSQmlBehavior &m_object;
- TElement &m_behavior;
- TElement &m_owner;
-
- bool m_initialized;
- bool m_lastActivationState;
-
- float m_deltaTime;
- TTimeUnit m_lastTime;
- struct EventCallbackInfo {
- TElement *element;
- TEventCommandHash eventHash;
- EventData *data;
- };
-
- QVector<std::function<void()>> m_mappedProperties;
- QVector<EventCallbackInfo> m_eventCallbacks;
-};
-}
-
-#endif // Q3DSQMLSCRIPT_H
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig.cpp b/src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig.cpp
deleted file mode 100644
index e1fa04c6..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "q3dsvariantconfig_p.h"
-
-namespace qt3ds {
-
-Q3DSVariantConfig::Q3DSVariantConfig()
-{
-
-}
-
-Q3DSVariantConfig::~Q3DSVariantConfig()
-{
- for (auto str : qAsConst(m_internalVariantList))
- delete str;
- m_internalVariantList.clear();
-}
-
-void Q3DSVariantConfig::setVariantList(const QStringList &variantList)
-{
- // Store the QStringList to be returned from the API
- m_variantList = variantList;
-
- for (auto str : qAsConst(m_internalVariantList))
- delete str;
- m_internalVariantList.clear();
-
- // Build a fixed (in mem location) list of the variant strings
- for (auto tag : variantList)
- m_internalVariantList.append(new QString(tag));
-
- // Parse the variantGroup:variant list to map using the fixed list
- m_variantFilter.clear();
- for (auto tag : qAsConst(m_internalVariantList)) {
- QStringRef refTag = QStringRef(tag);
- int separatorIdx = refTag.indexOf(QLatin1Char(':'));
- QStringRef group = refTag.left(separatorIdx);
- QStringRef variant = refTag.mid(separatorIdx + 1);
- m_variantFilter[group].append(variant);
- }
-}
-
-bool Q3DSVariantConfig::isPartOfConfig(const QStringRef &variantAttributes) const
-{
- // Variant filter is ignored when it's not defined
- // or if the object has no variant attributes
- if (m_variantFilter.isEmpty() || variantAttributes.isEmpty())
- return true;
-
- // Collect all variant tags per group from the element
- QHash<QStringRef, QVector<QStringRef>> groupToVariants;
- const QVector<QStringRef> variantTags = variantAttributes.split(
- QLatin1Char(','),
- QString::SkipEmptyParts);
-
- for (auto tag : variantTags) {
- // Break each variantGroup:value to group and value strings
- int groupSeparatorIdx = tag.indexOf(QLatin1Char(':'));
- QStringRef group = tag.left(groupSeparatorIdx);
-
- // Only collect variant tags that are relevant to variant filtering
- if (m_variantFilter.contains(group)) {
- QStringRef variant = tag.mid(groupSeparatorIdx + 1);
- groupToVariants[group].append(variant);
- }
- }
-
- // If no relevant variant tags found in element, load the element
- if (groupToVariants.isEmpty())
- return true;
-
- // Verify that the element matches the variant filtering per group.
- // To match the element must either:
- // - Have no variant tag defined for the group
- // - Have a matching tag for the group
- bool isLoaded = true;
- const auto filteredGroups = m_variantFilter.keys();
- for (auto group : filteredGroups) {
- const QVector<QStringRef> variants = groupToVariants[group];
- const QVector<QStringRef> filteredVariants = m_variantFilter[group];
-
- if (variants.size() > 0) {
- // Check if ANY of the variant values of the element matches ANY
- // of the included variants in the filter for this variant group
- bool matchesFilter = false;
- for (auto variant : variants)
- matchesFilter |= filteredVariants.contains(variant);
-
- isLoaded &= matchesFilter;
- }
- }
-
- return isLoaded;
-}
-
-}
diff --git a/src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig_p.h b/src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig_p.h
deleted file mode 100644
index 1905f44a..00000000
--- a/src/Runtime/ogl-runtime/src/runtime/q3dsvariantconfig_p.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef Q3DSVARIANTCONFIG_P_H
-#define Q3DSVARIANTCONFIG_P_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qhash.h>
-#include <QtCore/qvector.h>
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of a number of Qt sources files. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-namespace qt3ds {
-
-class Q3DSVariantConfig
-{
-public:
- Q3DSVariantConfig();
- ~Q3DSVariantConfig();
-
- inline bool operator==(const Q3DSVariantConfig &other) const
- {
- return (this->m_variantList == other.m_variantList);
- }
-
- inline bool operator!=(const Q3DSVariantConfig &other) const
- {
- return (this->m_variantList != other.m_variantList);
- }
-
- inline bool isEmpty() const { return m_variantList.isEmpty(); }
-
- void setVariantList(const QStringList &variantList);
-
- bool isPartOfConfig(const QStringRef &variantAttributes) const;
-
- inline const QStringList &variantList() const { return m_variantList; }
-
-private:
- QStringList m_variantList;
- QList<QString *> m_internalVariantList;
- QHash<QStringRef, QVector<QStringRef>> m_variantFilter;
-};
-
-};
-#endif // Q3DSVARIANTCONFIG_P_H
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp
deleted file mode 100644
index 3779aa56..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp
+++ /dev/null
@@ -1,517 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSDistanceFieldGlyphCache_p.h"
-
-#include <QtQuick/private/qsgareaallocator_p.h>
-
-#include <QtCore/qmath.h>
-#include <QtCore/qendian.h>
-#include <QtGui/qimage.h>
-
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "foundation/Qt3DSAllocator.h"
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-QT_BEGIN_NAMESPACE
-
-// Should work on most hardware. Used as stop gap until Qt 3D provides a
-// way to retrieve the system value
-#ifndef Q3DSDISTANCEFIELDGLYPHCACHE_MAXIMUM_TEXURE_SIZE
-# define Q3DSDISTANCEFIELDGLYPHCACHE_MAXIMUM_TEXURE_SIZE 2048
-#endif
-
-#if !defined(Q3DSDISTANCEFIELDGLYPHCACHE_PADDING)
-# define Q3DSDISTANCEFIELDGLYPHCACHE_PADDING 2
-#endif
-
-Q3DSDistanceFieldGlyphCache::Q3DSDistanceFieldGlyphCache(
- const QRawFont &font, qt3ds::render::IQt3DSRenderContext &context)
- : QSGDistanceFieldGlyphCache(font)
- , m_context(context)
-{
- m_maxTextureSize = Q3DSDISTANCEFIELDGLYPHCACHE_MAXIMUM_TEXURE_SIZE;
-
- loadPregeneratedCache(font);
-}
-
-Q3DSDistanceFieldGlyphCache::~Q3DSDistanceFieldGlyphCache()
-{
- for (auto &texture : m_textures)
- qt3ds::foundation::NVDelete(m_context.GetAllocator(), texture.texture);
-}
-
-int Q3DSDistanceFieldGlyphCache::maxTextureSize() const
-{
- return m_maxTextureSize;
-}
-
-Q3DSDistanceFieldGlyphCache::TextureInfo *Q3DSDistanceFieldGlyphCache::textureInfo(int index) const
-{
- while (index >= m_textures.size())
- m_textures.append(TextureInfo());
- return &m_textures[index];
-}
-
-void Q3DSDistanceFieldGlyphCache::referenceGlyphs(const QSet<glyph_t> &glyphs)
-{
- m_unusedGlyphs -= glyphs;
-}
-
-void Q3DSDistanceFieldGlyphCache::releaseGlyphs(const QSet<glyph_t> &glyphs)
-{
- m_unusedGlyphs += glyphs;
-}
-
-void Q3DSDistanceFieldGlyphCache::setTextureData(qt3ds::render::NVRenderTexture2D *texture,
- QImage &image)
-{
- bool isGLES2 = m_context.GetRenderContext().GetRenderContextType()
- == qt3ds::render::NVRenderContextValues::GLES2;
- texture->SetTextureData(qt3ds::render::toU8DataRef(image.bits(), image.byteCount()),
- 0, image.width(), image.height(),
- isGLES2 ? qt3ds::render::NVRenderTextureFormats::Alpha8
- : qt3ds::render::NVRenderTextureFormats::R8);
-}
-
-void Q3DSDistanceFieldGlyphCache::resizeTexture(TextureInfo *info, int width, int height)
-{
- QImage &image = info->copy;
- if (info->texture == nullptr) {
- info->texture = m_context.GetRenderContext().CreateTexture2D();
- info->texture->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Enum::Linear);
- info->texture->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Enum::Linear);
- setTextureData(info->texture, image);
- }
-
- qt3ds::render::STextureDetails textureDetails = info->texture->GetTextureDetails();
- if (int(textureDetails.m_Width) != width || int(textureDetails.m_Height) != height)
- setTextureData(info->texture, image);
-
- if (info->copy.width() != width || info->copy.height() != height) {
- QImage newImage(width, height, QImage::Format_Alpha8);
-
- for (int y = 0; y < info->copy.height(); ++y) {
- uchar *dest = newImage.scanLine(y);
- const uchar *src = info->copy.scanLine(y);
- ::memcpy(dest, src, size_t(info->copy.width()));
- }
-
- info->copy = newImage;
-
- setTextureData(info->texture, image);
- }
-}
-
-void Q3DSDistanceFieldGlyphCache::storeGlyphs(const QList<QDistanceField> &glyphs)
-{
- using GlyphTextureHash = QHash<TextureInfo *, QVector<glyph_t> >;
- using GlyphTextureHashConstIt = GlyphTextureHash::const_iterator;
-
- GlyphTextureHash glyphTextures;
- for (int i = 0; i < glyphs.size(); ++i) {
- QDistanceField glyph = glyphs.at(i);
- glyph_t glyphIndex = glyph.glyph();
- TexCoord c = glyphTexCoord(glyphIndex);
- TextureInfo *texInfo = m_glyphsTexture.value(glyphIndex);
-
- resizeTexture(texInfo, maxTextureSize(), texInfo->allocatedArea.height());
-
- Q_ASSERT(!glyphTextures[texInfo].contains(glyphIndex));
- glyphTextures[texInfo].append(glyphIndex);
-
- int padding = texInfo->padding;
- int expectedWidth = qCeil(c.width + c.xMargin * 2);
- glyph = glyph.copy(-padding, -padding,
- expectedWidth + padding * 2, glyph.height() + padding * 2);
-
- for (int y = 0; y < glyph.height(); ++y) {
- const uchar *src = glyph.scanLine(y);
- uchar *dest = texInfo->copy.scanLine(int(c.y) + y - padding) + (int(c.x) - padding);
- ::memcpy(dest, src, size_t(glyph.width()));
- }
- }
-
- for (GlyphTextureHashConstIt i = glyphTextures.constBegin(),
- cend = glyphTextures.constEnd(); i != cend; ++i) {
- Texture t;
- // 0 == empty texture, (i - 1) == index into m_textures
- t.textureId = uint(i.key() - m_textures.constData()) + 1;
- qt3ds::render::STextureDetails textureDetails = i.key()->texture->GetTextureDetails();
- t.size = QSize(textureDetails.m_Width, textureDetails.m_Height);
- setGlyphsTexture(i.value(), t);
-
- QImage &image = i.key()->copy;
-
- setTextureData(i.key()->texture, image);
- }
-}
-
-void Q3DSDistanceFieldGlyphCache::requestGlyphs(const QSet<glyph_t> &glyphs)
-{
- // Note: Most of this is copy-pasted from QSGDefaultDistanceFieldGlyphCache in Qt Quick.
- // All of this can probably be shared as a default implementation, since it does not
- // actually create any textures, but it might have to be either templated or based
- // on void*. For now we will just live with the duplication.
-
- QList<GlyphPosition> glyphPositions;
- QVector<glyph_t> glyphsToRender;
-
- if (m_areaAllocator == nullptr) {
- m_areaAllocator = new QSGAreaAllocator(QSize(maxTextureSize(),
- m_maxTextureCount * maxTextureSize()));
- }
-
- for (QSet<glyph_t>::const_iterator it = glyphs.constBegin(); it != glyphs.constEnd() ; ++it) {
- glyph_t glyphIndex = *it;
-
- int padding = Q3DSDISTANCEFIELDGLYPHCACHE_PADDING;
- QRectF boundingRect = glyphData(glyphIndex).boundingRect;
- int glyphWidth = qCeil(boundingRect.width()) + distanceFieldRadius() * 2;
- int glyphHeight = qCeil(boundingRect.height()) + distanceFieldRadius() * 2;
- QSize glyphSize(glyphWidth + padding * 2, glyphHeight + padding * 2);
- QRect alloc = m_areaAllocator->allocate(glyphSize);
-
- if (alloc.isNull()) {
- // Unallocate unused glyphs until we can allocated the new glyph
- while (alloc.isNull() && !m_unusedGlyphs.isEmpty()) {
- glyph_t unusedGlyph = *m_unusedGlyphs.constBegin();
-
- TexCoord unusedCoord = glyphTexCoord(unusedGlyph);
- QRectF unusedGlyphBoundingRect = glyphData(unusedGlyph).boundingRect;
- int unusedGlyphWidth = qCeil(unusedGlyphBoundingRect.width())
- + distanceFieldRadius() * 2;
- int unusedGlyphHeight = qCeil(unusedGlyphBoundingRect.height())
- + distanceFieldRadius() * 2;
- m_areaAllocator->deallocate(QRect(int(unusedCoord.x) - padding,
- int(unusedCoord.y) - padding,
- padding * 2 + unusedGlyphWidth,
- padding * 2 + unusedGlyphHeight));
-
- m_unusedGlyphs.remove(unusedGlyph);
- m_glyphsTexture.remove(unusedGlyph);
- removeGlyph(unusedGlyph);
-
- alloc = m_areaAllocator->allocate(glyphSize);
- }
-
- // Not enough space left for this glyph... skip to the next one
- if (alloc.isNull())
- continue;
- }
-
- TextureInfo *tex = textureInfo(alloc.y() / maxTextureSize());
- alloc = QRect(alloc.x(), alloc.y() % maxTextureSize(), alloc.width(), alloc.height());
-
- tex->allocatedArea |= alloc;
- Q_ASSERT(tex->padding == padding || tex->padding < 0);
- tex->padding = padding;
-
- GlyphPosition p;
- p.glyph = glyphIndex;
- p.position = alloc.topLeft() + QPoint(padding, padding);
-
- glyphPositions.append(p);
- glyphsToRender.append(glyphIndex);
- m_glyphsTexture.insert(glyphIndex, tex);
- }
-
- setGlyphsPosition(glyphPositions);
- markGlyphsToRender(glyphsToRender);
-}
-
-void Q3DSDistanceFieldGlyphCache::processPendingGlyphs()
-{
- update();
-}
-
-Q3DSDistanceFieldGlyphCache::TextureInfo *Q3DSDistanceFieldGlyphCache::textureInfoById(
- uint id) const
-{
- Q_ASSERT(id > 0);
- return textureInfo(id - 1);
-}
-
-// This is all copy-pasted from Qt Quick, as sharing it would require some refactoring, and we
-// need to work with Qt 5.12.2 at the moment.
-namespace {
- struct Qtdf {
- // We need these structs to be tightly packed, but some compilers we use do not
- // support #pragma pack(1), so we need to hardcode the offsets/sizes in the
- // file format
- enum TableSize {
- HeaderSize = 14,
- GlyphRecordSize = 46,
- TextureRecordSize = 17
- };
-
- enum Offset {
- // Header
- majorVersion = 0,
- minorVersion = 1,
- pixelSize = 2,
- textureSize = 4,
- flags = 8,
- headerPadding = 9,
- numGlyphs = 10,
-
- // Glyph record
- glyphIndex = 0,
- textureOffsetX = 4,
- textureOffsetY = 8,
- textureWidth = 12,
- textureHeight = 16,
- xMargin = 20,
- yMargin = 24,
- boundingRectX = 28,
- boundingRectY = 32,
- boundingRectWidth = 36,
- boundingRectHeight = 40,
- textureIndex = 44,
-
- // Texture record
- allocatedX = 0,
- allocatedY = 4,
- allocatedWidth = 8,
- allocatedHeight = 12,
- texturePadding = 16
-
- };
-
- template <typename T>
- static inline T fetch(const char *data, Offset offset)
- {
- return qFromBigEndian<T>(data + int(offset));
- }
- };
-}
-
-qreal Q3DSDistanceFieldGlyphCache::fontSize() const
-{
- return QT_DISTANCEFIELD_BASEFONTSIZE(m_doubleGlyphResolution);
-}
-
-bool Q3DSDistanceFieldGlyphCache::loadPregeneratedCache(const QRawFont &font)
-{
- // The pregenerated data must be loaded first, otherwise the area allocator
- // will be wrong
- if (m_areaAllocator != nullptr) {
- qWarning("Font cache must be loaded before cache is used");
- return false;
- }
-
- QByteArray qtdfTable = font.fontTable("qtdf");
- if (qtdfTable.isEmpty())
- return false;
-
- using GlyphTextureHash = QHash<TextureInfo *, QVector<glyph_t> >;
-
- GlyphTextureHash glyphTextures;
-
- if (uint(qtdfTable.size()) < Qtdf::HeaderSize) {
- qWarning("Invalid qtdf table in font '%s'",
- qPrintable(font.familyName()));
- return false;
- }
-
- const char *qtdfTableStart = qtdfTable.constData();
- const char *qtdfTableEnd = qtdfTableStart + qtdfTable.size();
-
- int padding = 0;
- int textureCount = 0;
- {
- quint8 majorVersion = Qtdf::fetch<quint8>(qtdfTableStart, Qtdf::majorVersion);
- quint8 minorVersion = Qtdf::fetch<quint8>(qtdfTableStart, Qtdf::minorVersion);
- if (majorVersion != 5 || minorVersion != 12) {
- qWarning("Invalid version of qtdf table %d.%d in font '%s'",
- majorVersion,
- minorVersion,
- qPrintable(font.familyName()));
- return false;
- }
-
- qreal pixelSize = qreal(Qtdf::fetch<quint16>(qtdfTableStart, Qtdf::pixelSize));
- m_maxTextureSize = int(Qtdf::fetch<quint32>(qtdfTableStart, Qtdf::textureSize));
- m_doubleGlyphResolution = Qtdf::fetch<quint8>(qtdfTableStart, Qtdf::flags) == 1;
- padding = Qtdf::fetch<quint8>(qtdfTableStart, Qtdf::headerPadding);
-
- if (pixelSize <= 0.0) {
- qWarning("Invalid pixel size in '%s'", qPrintable(font.familyName()));
- return false;
- }
-
- if (m_maxTextureSize <= 0) {
- qWarning("Invalid texture size in '%s'", qPrintable(font.familyName()));
- return false;
- }
-
- if (padding != Q3DSDISTANCEFIELDGLYPHCACHE_PADDING) {
- qWarning("Padding mismatch in '%s'. Font requires %d, but Qt is compiled with %d.",
- qPrintable(font.familyName()),
- padding,
- Q3DSDISTANCEFIELDGLYPHCACHE_PADDING);
- }
-
- m_referenceFont.setPixelSize(pixelSize);
-
- quint32 glyphCount = Qtdf::fetch<quint32>(qtdfTableStart, Qtdf::numGlyphs);
- m_unusedGlyphs.reserve(int(glyphCount));
-
- const char *allocatorData = qtdfTableStart + Qtdf::HeaderSize;
- {
- m_areaAllocator = new QSGAreaAllocator(QSize(0, 0));
- allocatorData = m_areaAllocator->deserialize(allocatorData,
- qtdfTableEnd - allocatorData);
- if (allocatorData == nullptr)
- return false;
- }
-
- if (m_areaAllocator->size().height() % m_maxTextureSize != 0) {
- qWarning("Area allocator size mismatch in '%s'", qPrintable(font.familyName()));
- return false;
- }
-
- textureCount = m_areaAllocator->size().height() / m_maxTextureSize;
- m_maxTextureCount = qMax(m_maxTextureCount, textureCount);
-
- const char *textureRecord = allocatorData;
- for (int i = 0; i < textureCount; ++i, textureRecord += Qtdf::TextureRecordSize) {
- if (textureRecord + Qtdf::TextureRecordSize > qtdfTableEnd) {
- qWarning("qtdf table too small in font '%s'.",
- qPrintable(font.familyName()));
- return false;
- }
-
- TextureInfo *tex = textureInfo(i);
- tex->allocatedArea.setX(int(Qtdf::fetch<quint32>(textureRecord, Qtdf::allocatedX)));
- tex->allocatedArea.setY(int(Qtdf::fetch<quint32>(textureRecord, Qtdf::allocatedY)));
- tex->allocatedArea.setWidth(int(Qtdf::fetch<quint32>(textureRecord,
- Qtdf::allocatedWidth)));
- tex->allocatedArea.setHeight(int(Qtdf::fetch<quint32>(textureRecord,
- Qtdf::allocatedHeight)));
- tex->padding = Qtdf::fetch<quint8>(textureRecord, Qtdf::texturePadding);
- }
-
- const char *glyphRecord = textureRecord;
- for (quint32 i = 0; i < glyphCount; ++i, glyphRecord += Qtdf::GlyphRecordSize) {
- if (glyphRecord + Qtdf::GlyphRecordSize > qtdfTableEnd) {
- qWarning("qtdf table too small in font '%s'.",
- qPrintable(font.familyName()));
- return false;
- }
-
- glyph_t glyph = Qtdf::fetch<quint32>(glyphRecord, Qtdf::glyphIndex);
- m_unusedGlyphs.insert(glyph);
-
- GlyphData &glyphData = emptyData(glyph);
-
-#define FROM_FIXED_POINT(value) (qreal(value)/qreal(65536))
-
- glyphData.texCoord.x
- = FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord, Qtdf::textureOffsetX));
- glyphData.texCoord.y
- = FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord, Qtdf::textureOffsetY));
- glyphData.texCoord.width
- = FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord, Qtdf::textureWidth));
- glyphData.texCoord.height
- = FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord, Qtdf::textureHeight));
- glyphData.texCoord.xMargin
- = FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord, Qtdf::xMargin));
- glyphData.texCoord.yMargin
- = FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord, Qtdf::yMargin));
- glyphData.boundingRect.setX(
- FROM_FIXED_POINT(Qtdf::fetch<qint32>(glyphRecord, Qtdf::boundingRectX)));
- glyphData.boundingRect.setY(
- FROM_FIXED_POINT(Qtdf::fetch<qint32>(glyphRecord, Qtdf::boundingRectY)));
- glyphData.boundingRect.setWidth(
- FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord,
- Qtdf::boundingRectWidth)));
- glyphData.boundingRect.setHeight(
- FROM_FIXED_POINT(Qtdf::fetch<quint32>(glyphRecord,
- Qtdf::boundingRectHeight)));
-
-#undef FROM_FIXED_POINT
-
- int textureIndex = Qtdf::fetch<quint16>(glyphRecord, Qtdf::textureIndex);
- if (textureIndex < 0 || textureIndex >= textureCount) {
- qWarning("Invalid texture index %d (texture count == %d) in '%s'",
- textureIndex,
- textureCount,
- qPrintable(font.familyName()));
- return false;
- }
-
-
- TextureInfo *texInfo = textureInfo(textureIndex);
- m_glyphsTexture.insert(glyph, texInfo);
-
- glyphTextures[texInfo].append(glyph);
- }
-
- const uchar *textureData = reinterpret_cast<const uchar *>(glyphRecord);
- for (int i = 0; i < textureCount; ++i) {
-
- TextureInfo *texInfo = textureInfo(i);
-
- int width = texInfo->allocatedArea.width();
- int height = texInfo->allocatedArea.height();
- qint64 size = width * height;
- if (reinterpret_cast<const char *>(textureData + size) > qtdfTableEnd) {
- qWarning("qtdf table too small in font '%s'.",
- qPrintable(font.familyName()));
- return false;
- }
-
- resizeTexture(texInfo, width, height);
-
- memcpy(texInfo->copy.bits(), textureData, size);
- textureData += size;
-
- QImage &image = texInfo->copy;
- setTextureData(texInfo->texture, image);
-
- QVector<glyph_t> glyphs = glyphTextures.value(texInfo);
-
- Texture t;
- t.textureId = uint(i + 1);
- t.size = texInfo->copy.size();
-
- setGlyphsTexture(glyphs, t);
- }
- }
-
- return true;
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager.cpp
deleted file mode 100644
index 750301dc..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSDistanceFieldGlyphCacheManager_p.h"
-#include "Qt3DSDistanceFieldGlyphCache_p.h"
-
-#include <QtQuick/private/qsgdefaultrendercontext_p.h>
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-QT_BEGIN_NAMESPACE
-
-namespace {
- class FontKeyAccessor : public QSGDefaultRenderContext
- {
- public:
- static QString fontKey(const QRawFont &font)
- {
- return QSGDefaultRenderContext::fontKey(font);
- }
- };
-}
-
-Q3DSDistanceFieldGlyphCacheManager::~Q3DSDistanceFieldGlyphCacheManager()
-{
- for (auto &cache : qAsConst(m_glyphCaches))
- delete cache;
-}
-
-Q3DSDistanceFieldGlyphCache *Q3DSDistanceFieldGlyphCacheManager::glyphCache(const QRawFont &font)
-{
- QString key = FontKeyAccessor::fontKey(font);
- Q3DSDistanceFieldGlyphCache *cache = m_glyphCaches.value(key);
- if (cache == nullptr) {
- cache = new Q3DSDistanceFieldGlyphCache(font, *m_context);
- m_glyphCaches.insert(key, cache);
- }
-
- return cache;
-}
-
-void Q3DSDistanceFieldGlyphCacheManager::setContext(qt3ds::render::IQt3DSRenderContext &context)
-{
- m_context = &context;
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager_p.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager_p.h
deleted file mode 100644
index 19d3c088..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCacheManager_p.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSDISTANCEFIELDGLYPHCACHEMANAGER_P_H
-#define Q3DSDISTANCEFIELDGLYPHCACHEMANAGER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qhash.h>
-#include <QtGui/qrawfont.h>
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-namespace qt3ds {
-namespace render {
-class IQt3DSRenderContext;
-}
-}
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSDistanceFieldGlyphCache;
-class Q3DSDistanceFieldGlyphCacheManager
-{
-public:
- ~Q3DSDistanceFieldGlyphCacheManager();
- Q3DSDistanceFieldGlyphCache *glyphCache(const QRawFont &font);
- void setContext(qt3ds::render::IQt3DSRenderContext &context);
-
-private:
- QHash<QString, Q3DSDistanceFieldGlyphCache *> m_glyphCaches;
- qt3ds::render::IQt3DSRenderContext *m_context;
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-#endif // Q3DSDISTANCEFIELDGLYPHCACHEMANAGER_P_H
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h
deleted file mode 100644
index 679d3ad7..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSDISTANCEFIELDGLYPHCACHE_P_H
-#define Q3DSDISTANCEFIELDGLYPHCACHE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQuick/private/qsgadaptationlayer_p.h>
-#include "render/Qt3DSRenderTexture2D.h"
-#include "Qt3DSRenderContextCore.h"
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-QT_BEGIN_NAMESPACE
-
-class QSGAreaAllocator;
-class Q3DSDistanceFieldGlyphCache : public QSGDistanceFieldGlyphCache
-{
-public:
- struct TextureInfo {
- qt3ds::render::NVRenderTexture2D *texture;
- int padding = -1;
-
- QRect allocatedArea;
- QImage copy;
- };
-
- Q3DSDistanceFieldGlyphCache(const QRawFont &font,
- qt3ds::render::IQt3DSRenderContext &context);
- ~Q3DSDistanceFieldGlyphCache() override;
-
- void requestGlyphs(const QSet<glyph_t> &glyphs) override;
- void storeGlyphs(const QList<QDistanceField> &glyphs) override;
- void referenceGlyphs(const QSet<glyph_t> &glyphs) override;
- void releaseGlyphs(const QSet<glyph_t> &glyphs) override;
-
- void processPendingGlyphs() override;
-
- TextureInfo *textureInfoById(uint textureId) const;
-
- qreal fontSize() const;
-
-private:
- bool loadPregeneratedCache(const QRawFont &font);
- TextureInfo *textureInfo(int index) const;
-
- int maxTextureSize() const;
- void resizeTexture(TextureInfo *info, int width, int height);
- void setTextureData(qt3ds::render::NVRenderTexture2D *texture, QImage &image);
-
- QSGAreaAllocator *m_areaAllocator = nullptr;
- int m_maxTextureSize = 0;
- int m_maxTextureCount = 3;
-
- mutable QVector<TextureInfo> m_textures;
- QHash<glyph_t, TextureInfo *> m_glyphsTexture;
- QSet<glyph_t> m_unusedGlyphs;
- qt3ds::render::IQt3DSRenderContext &m_context;
-};
-
-QT_END_NAMESPACE
-
-#endif // Q3DSDISTANCEFIELDGLYPHCACHE_P_H
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
deleted file mode 100644
index 290964b2..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
+++ /dev/null
@@ -1,1060 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSDistanceFieldRenderer.h"
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderContext.h"
-#include "qmath.h"
-#include "foundation/Qt3DSAllocator.h"
-
-using namespace qt3ds::render;
-
-Q3DSDistanceFieldRenderer::Q3DSDistanceFieldRenderer(NVFoundationBase &foundation)
- : m_foundation(foundation)
-{
- const QWindowList list = QGuiApplication::topLevelWindows();
- if (list.size() > 0)
- m_pixelRatio = list[0]->devicePixelRatio();
-}
-
-Q3DSDistanceFieldRenderer::~Q3DSDistanceFieldRenderer()
-{
- NVAllocatorCallback &alloc = m_context->GetAllocator();
-
- QHash<size_t, Q3DSDistanceFieldMesh>::const_iterator it;
- for (it = m_meshCache.constBegin(); it != m_meshCache.constEnd(); ++it) {
- const Q3DSDistanceFieldMesh &mesh = it.value();
- NVDelete(alloc, mesh.vertexBuffer);
- NVDelete(alloc, mesh.indexBuffer);
- NVDelete(alloc, mesh.inputAssembler);
- }
-}
-
-void Q3DSDistanceFieldRenderer::AddSystemFontDirectory(const char8_t *dir)
-{
- QString systemDir(dir);
- m_systemDirs += systemDir;
- m_fontDatabase.registerFonts({ systemDir });
-}
-
-void Q3DSDistanceFieldRenderer::AddProjectFontDirectory(const char8_t *dir)
-{
- QString projectDir(dir);
- m_projectDirs += projectDir;
- m_fontDatabase.registerFonts({ projectDir });
-}
-
-void Q3DSDistanceFieldRenderer::ClearProjectFontDirectories()
-{
- m_fontDatabase.unregisterFonts(m_projectDirs);
- m_projectDirs.clear();
-}
-
-ITextRenderer &Q3DSDistanceFieldRenderer::GetTextRenderer(NVRenderContext &)
-{
- return *this;
-}
-
-void Q3DSDistanceFieldRenderer::EndFrame()
-{
- // Remove meshes for glyphs that weren't rendered last frame
- NVAllocatorCallback &alloc = m_context->GetAllocator();
-
- QHash<size_t, Q3DSDistanceFieldMesh>::const_iterator it = m_meshCache.constBegin();
- while (it != m_meshCache.constEnd()) {
- const size_t glyphHash = it.key();
- const Q3DSDistanceFieldMesh &mesh = it.value();
- if (!m_renderedGlyphs.contains(glyphHash)) {
- NVDelete(alloc, mesh.vertexBuffer);
- NVDelete(alloc, mesh.indexBuffer);
- NVDelete(alloc, mesh.inputAssembler);
- m_meshCache.erase(it++);
- } else {
- it++;
- }
- }
- m_renderedGlyphs.clear();
-}
-
-QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo>
-Q3DSDistanceFieldRenderer::buildGlyphsPerTexture(const SText &textInfo)
-{
- if (textInfo.m_BoundingBox.x < 0 || textInfo.m_BoundingBox.y < 0)
- return QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo>();
-
- QVector2D boundingBox = QVector2D(textInfo.m_BoundingBox.x, textInfo.m_BoundingBox.y);
- const float halfWidth = boundingBox.x() / 2.0f;
- const float halfHeight = boundingBox.y() / 2.0f;
- bool hasValidBoundingBox = boundingBox.x() > 0 || boundingBox.y() > 0;
-
- QRawFont font = m_fontDatabase.findFont(textInfo.m_Font.c_str());
- font.setPixelSize(qreal(textInfo.m_FontSize));
-
- const qreal maximumWidth = boundingBox.isNull() ? qreal(0x01000000) : qreal(boundingBox.x());
- const qreal maximumHeight = boundingBox.isNull() ? qreal(0x01000000) : qreal(boundingBox.y());
-
- QTextLayout layout;
- QTextOption option = layout.textOption();
-
- QTextOption::WrapMode wrapMode;
- switch (textInfo.m_WordWrap) {
- case TextWordWrap::Clip:
- wrapMode = QTextOption::ManualWrap;
- break;
- case TextWordWrap::WrapWord:
- wrapMode = QTextOption::WrapAtWordBoundaryOrAnywhere;
- break;
- case TextWordWrap::WrapAnywhere:
- wrapMode = QTextOption::WrapAnywhere;
- break;
- case TextWordWrap::Unknown:
- wrapMode = QTextOption::ManualWrap;
- Q_ASSERT(0);
- };
- option.setWrapMode(wrapMode);
- option.setUseDesignMetrics(true);
-
- layout.setTextOption(option);
- layout.setRawFont(font);
-
- QString text = textInfo.m_Text.c_str();
- text.replace(QLatin1Char('\n'), QChar::LineSeparator);
-
- qreal width;
- qreal height;
- bool needsElide;
- do {
- needsElide = false;
-
- layout.clearLayout();
-
- float leading = textInfo.m_Leading;
- width = 0.0;
- height = qreal(-leading);
-
- QVector<QTextLayout::FormatRange> formatRanges;
-
- QTextLayout::FormatRange formatRange;
- formatRange.start = 0;
- formatRange.length = text.length();
- formatRange.format.setFontLetterSpacingType(QFont::AbsoluteSpacing);
- formatRange.format.setFontLetterSpacing(qreal(textInfo.m_Tracking));
- formatRanges.append(formatRange);
- layout.setFormats(formatRanges);
-
- layout.setText(text);
- layout.beginLayout();
-
- QTextLine previousLine;
- forever {
- QTextLine line = layout.createLine();
- if (!line.isValid())
- break;
-
- line.setLineWidth(maximumWidth);
- height += qreal(leading);
- height = qCeil(height);
-
- qreal textWidth = line.naturalTextWidth();
- line.setPosition(QPointF(0.0, height));
-
- width = qMin(maximumWidth, qMax(width, textWidth));
- height += layout.engine()->lines[line.lineNumber()].height().toReal();
-
- // Fast path for right elide
- if (textInfo.m_Elide == TextElide::ElideRight
- && previousLine.isValid()
- && height > maximumHeight) {
- break;
- }
-
- previousLine = line;
- }
- layout.endLayout();
-
- if (textInfo.m_Elide != TextElide::ElideNone && height > maximumHeight) {
- needsElide = true;
-
- QString elidedText;
- switch (textInfo.m_Elide) {
- case TextElide::ElideRight:
- if (previousLine.textStart() > 0)
- elidedText = text.left(previousLine.textStart());
-
- elidedText += layout.engine()->elidedText(
- Qt::ElideRight, QFixed::fromReal(width), 0, previousLine.textStart(),
- text.length() - previousLine.textStart());
- break;
- case TextElide::ElideLeft:
- {
- height = 0.0;
- previousLine = QTextLine();
- for (int i = layout.lineCount() - 1; i >= 0; --i) {
- qreal lineHeight = layout.lineAt(i).height();
- if (i < layout.lineCount() - 1 && height + lineHeight > maximumHeight)
- break;
- height += lineHeight;
- previousLine = layout.lineAt(i);
- }
-
- Q_ASSERT(previousLine.isValid());
- elidedText += layout.engine()->elidedText(
- Qt::ElideLeft, QFixed::fromReal(width), 0, 0,
- previousLine.textStart() + previousLine.textLength());
-
- int nextPosition = (previousLine.textStart() + previousLine.textLength());
- if (nextPosition < text.length())
- elidedText += text.mid(nextPosition);
- break;
- }
- case TextElide::ElideMiddle:
- {
- height = 0.0;
- QTextLine lastLineBefore;
- QTextLine firstLineAfter;
- for (int i = 0; i < (layout.lineCount() / 2) + (layout.lineCount() % 2); ++i) {
- qreal lineHeight = 3 * layout.lineAt(i).height();
- if (height + lineHeight > maximumHeight)
- break;
- height += lineHeight;
-
- lastLineBefore = layout.lineAt(i);
- firstLineAfter = layout.lineAt(layout.lineCount() - i - 1);
- }
-
- int nextPosition = 0;
- if (lastLineBefore.isValid()) {
- elidedText += text.left(lastLineBefore.textStart()
- + lastLineBefore.textLength());
- nextPosition = lastLineBefore.textStart() + lastLineBefore.textLength();
- }
-
- QString suffix;
- int length = text.length() - nextPosition;
- if (firstLineAfter.isValid()) {
- length = firstLineAfter.textStart() - nextPosition;
- suffix = text.mid(firstLineAfter.textStart());
- }
-
- elidedText += layout.engine()->elidedText(
- Qt::ElideMiddle, QFixed::fromReal(width), 0, nextPosition, length);
-
- elidedText += suffix;
- break;
- }
- case TextElide::ElideNone:
- Q_UNREACHABLE();
- };
-
- // Failsafe
- if (elidedText.isEmpty() || elidedText == text)
- needsElide = false;
- else
- text = elidedText;
- }
- } while (needsElide);
-
- QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo> glyphsPerTexture;
-
- float originY = float(height) / 2.0f;
- if (textInfo.m_VerticalAlignment == TextVerticalAlignment::Bottom)
- originY = float(height);
- else if (textInfo.m_VerticalAlignment == TextVerticalAlignment::Top)
- originY = 0.0;
-
- float originX = float(width) / 2.0f;
- if (textInfo.m_HorizontalAlignment == TextHorizontalAlignment::Right)
- originX = float(width);
- else if (textInfo.m_HorizontalAlignment == TextHorizontalAlignment::Left)
- originX = 0.0;
-
- float offsetY = -originY;
-
- QT3DSVec3 minimum(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), 0);
- QT3DSVec3 maximum(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max(), 0);
-
- // To match the original behavior of the sources, we don't actually align to
- // the bounding box. This is only used for word wrapping and elide. Keeping the
- // code here in case this was a mistake or we for some other reason want to change
- // it.
-#if 0
- // If there is no bounding box, then alignmentHeight == height, so we skip it
- if (!boundingBox.isNull() && text3DS->verticalAlignment() == Q3DSTextNode::Bottom)
- offsetY += float(maximumHeight - height);
- else if (!boundingBox.isNull() && text3DS->verticalAlignment() == Q3DSTextNode::Middle)
- offsetY += float(maximumHeight / 2.0 - height / 2.0);
- float alignmentWidth = boundingBox.isNull() ? float(width) : float(maximumWidth);
-#else
- float alignmentWidth = float(width);
-#endif
-
- for (int j = 0; j < layout.lineCount(); ++j) {
- QTextLine line = layout.lineAt(j);
-
- float offsetX = -originX;
- if (textInfo.m_HorizontalAlignment == TextHorizontalAlignment::Right)
- offsetX += alignmentWidth - float(line.naturalTextWidth());
- else if (textInfo.m_HorizontalAlignment == TextHorizontalAlignment::Center)
- offsetX += alignmentWidth / 2.0f - float(line.naturalTextWidth()) / 2.0f;
-
- const QList<QGlyphRun> glyphRuns = line.glyphRuns();
- for (const QGlyphRun &glyphRun : glyphRuns) {
- const QVector<quint32> glyphIndexes = glyphRun.glyphIndexes();
- const QVector<QPointF> glyphPositions = glyphRun.positions();
-
- Q3DSDistanceFieldGlyphCache *cache = m_glyphCacheManager.glyphCache(
- glyphRun.rawFont());
- cache->populate(glyphRun.glyphIndexes());
- cache->processPendingGlyphs();
-
- qreal fontPixelSize = glyphRun.rawFont().pixelSize();
-
- qreal shadowOffsetX = qreal(cache->fontSize())
- * qreal(textInfo.m_DropShadowOffsetX) / 1000.0;
- qreal shadowOffsetY = qreal(cache->fontSize())
- * qreal(textInfo.m_DropShadowOffsetY) / 1000.0;
-
- qreal maxTexMargin = cache->distanceFieldRadius();
- qreal fontScale = cache->fontScale(fontPixelSize);
- qreal margin = 2;
- qreal texMargin = margin / fontScale;
- if (texMargin > maxTexMargin) {
- texMargin = maxTexMargin;
- margin = maxTexMargin * fontScale;
- }
-
- for (int i = 0; i < glyphIndexes.size(); ++i) {
- quint32 glyphIndex = glyphIndexes.at(i);
- QPointF position = glyphPositions.at(i);
-
- QSGDistanceFieldGlyphCache::TexCoord c = cache->glyphTexCoord(glyphIndex);
- if (c.isNull())
- continue;
-
- QSGDistanceFieldGlyphCache::Metrics metrics = cache->glyphMetrics(glyphIndex,
- fontPixelSize);
- if (metrics.isNull())
- continue;
-
- metrics.width += margin * 2;
- metrics.height += margin * 2;
- metrics.baselineX -= margin;
- metrics.baselineY += margin;
- c.xMargin -= texMargin;
- c.yMargin -= texMargin;
- c.width += texMargin * 2;
- c.height += texMargin * 2;
-
- float cx1 = float(position.x() + metrics.baselineX) + offsetX;
- float cx2 = cx1 + float(metrics.width);
- float cy1 = float(position.y() - metrics.baselineY) + offsetY;
- float cy2 = cy1 + float(metrics.height);
-
- if (textInfo.m_DropShadow) {
- if (shadowOffsetX < 0.0)
- cx1 += float(shadowOffsetX * fontScale);
- else
- cx2 += float(shadowOffsetX * fontScale);
-
- if (shadowOffsetY < 0.0)
- cy1 += float(shadowOffsetY * fontScale);
- else
- cy2 += float(shadowOffsetY * fontScale);
- }
-
- float x1Clip = 1.0f;
- float x2Clip = 1.0f;
- float y1Clip = 1.0f;
- float y2Clip = 1.0f;
-
- if (hasValidBoundingBox) {
- if ((cx1 < -halfWidth && cx2 < -halfWidth)
- || (cx1 > halfWidth && cx2 > halfWidth)
- || (cy1 < -halfHeight && cy2 < -halfHeight)
- || (cy1 > halfHeight && cy2 > halfHeight)) {
- continue;
- }
-
- float xDiff = qAbs(cx1 - cx2);
- float yDiff = qAbs(cy1 - cy2);
-
- if (cx1 < -halfWidth) {
- x1Clip = 1.0f - qAbs(cx1 - (-halfWidth)) / xDiff;
- cx1 = -halfWidth;
- }
-
- if (cx2 > halfWidth) {
- x2Clip = 1.0f - qAbs(cx2 - halfWidth) / xDiff;
- cx2 = halfWidth;
- }
-
- if (cy1 < -halfHeight) {
- y1Clip = 1.0f - qAbs(cy1 - (-halfHeight)) / yDiff;
- cy1 = -halfHeight;
- }
-
- if (cy2 > halfHeight) {
- y2Clip = 1.0f - qAbs(cy2 - halfHeight) / yDiff;
- cy2 = halfHeight;
- }
- }
-
- cy1 = -cy1;
- cy2 = -cy2;
-
- if (cx1 < minimum.x)
- minimum.x = cx1;
- else if (cx1 > maximum.x)
- maximum.x = cx1;
-
- if (cx2 < minimum.x)
- minimum.x = cx2;
- else if (cx2 > maximum.x)
- maximum.x = cx2;
-
- if (cy1 < minimum.y)
- minimum.y = cy1;
- else if (cy1 > maximum.y)
- maximum.y = cy1;
-
- if (cy2 < minimum.y)
- minimum.y = cy2;
- else if (cy2 > maximum.y)
- maximum.y = cy2;
-
- if (hasValidBoundingBox) {
- if (maximum.x < halfWidth)
- maximum.x = halfWidth;
- if (minimum.x > -halfWidth)
- minimum.x = -halfWidth;
- if (maximum.y < halfHeight)
- maximum.y = halfHeight;
- if (minimum.y > -halfHeight)
- minimum.y = -halfHeight;
- }
-
- float tx1 = float(c.x + c.xMargin);
- float tx2 = tx1 + float(c.width);
- float ty1 = float(c.y + c.yMargin);
- float ty2 = ty1 + float(c.height);
-
- // Preserve original bounds of glyphs
- float ttx1 = tx1;
- float tty1 = ty1;
- float ttx2 = tx2;
- float tty2 = ty2;
-
- if (textInfo.m_DropShadow) {
- if (shadowOffsetX < 0.0)
- tx1 += float(c.width * shadowOffsetX * fontScale) / float(metrics.width);
- else
- tx2 += float(c.width * shadowOffsetX * fontScale) / float(metrics.width);
-
- if (shadowOffsetY < 0.0)
- ty1 += float(c.height * shadowOffsetY * fontScale) / float(metrics.height);
- else
- ty2 += float(c.height * shadowOffsetY * fontScale) / float(metrics.height);
- }
-
- if (hasValidBoundingBox) {
- float tx1Orig = tx1;
- float tx2Orig = tx2;
- float ty1Orig = ty1;
- float ty2Orig = ty2;
-
- float xDiff = qAbs(tx1 - tx2);
- tx1 = tx2Orig - xDiff * x1Clip;
- tx2 = tx1Orig + xDiff * x2Clip;
-
- float yDiff = qAbs(ty1 - ty2);
- ty1 = ty2Orig - yDiff * y1Clip;
- ty2 = ty1Orig + yDiff * y2Clip;
- }
-
- const QSGDistanceFieldGlyphCache::Texture *texture
- = cache->glyphTexture(glyphIndex);
- if (texture->textureId == 0) {
- qWarning() << "Empty texture for glyph" << glyphIndex;
- continue;
- }
-
- Q3DSDistanceFieldGlyphCache::TextureInfo *textureInfo = cache->textureInfoById(
- texture->textureId);
-
- GlyphInfo &glyphInfo = glyphsPerTexture[textureInfo];
- glyphInfo.fontScale = float(fontScale);
- glyphInfo.shadowOffsetX = float(shadowOffsetX);
- glyphInfo.shadowOffsetY = float(shadowOffsetY);
- glyphInfo.bounds = NVBounds3(minimum, maximum);
-
- QVector<float> &vertexes = glyphInfo.vertexes;
- vertexes.reserve(vertexes.size() + 20 + (textInfo.m_DropShadow ? 16 : 0));
-
- vertexes.append(cx1);
- vertexes.append(cy1);
- vertexes.append(0.0);
- vertexes.append(tx1);
- vertexes.append(ty1);
-
- if (textInfo.m_DropShadow) {
- vertexes.append(ttx1);
- vertexes.append(tty1);
- vertexes.append(ttx2);
- vertexes.append(tty2);
- }
-
- vertexes.append(cx2);
- vertexes.append(cy1);
- vertexes.append(0.0);
- vertexes.append(tx2);
- vertexes.append(ty1);
-
- if (textInfo.m_DropShadow) {
- vertexes.append(ttx1);
- vertexes.append(tty1);
- vertexes.append(ttx2);
- vertexes.append(tty2);
- }
-
- vertexes.append(cx2);
- vertexes.append(cy2);
- vertexes.append(0.0);
- vertexes.append(tx2);
- vertexes.append(ty2);
-
- if (textInfo.m_DropShadow) {
- vertexes.append(ttx1);
- vertexes.append(tty1);
- vertexes.append(ttx2);
- vertexes.append(tty2);
- }
-
- vertexes.append(cx1);
- vertexes.append(cy2);
- vertexes.append(0.0);
- vertexes.append(tx1);
- vertexes.append(ty2);
-
- if (textInfo.m_DropShadow) {
- vertexes.append(ttx1);
- vertexes.append(tty1);
- vertexes.append(ttx2);
- vertexes.append(tty2);
- }
- }
- }
- }
-
- return glyphsPerTexture;
-}
-
-template <typename T>
-static QVector<T> fillIndexBuffer(uint quadCount)
-{
- QVector<T> indexes;
-
- const uint triangleCount = 2 * quadCount;
- indexes.resize(3 * int(triangleCount));
-
- Q_ASSERT(indexes.size() % 6 == 0);
-
- for (uint i = 0; i < quadCount; i ++) {
- indexes[int(i * 6 + 0)] = T(i * 4 + 0);
- indexes[int(i * 6 + 1)] = T(i * 4 + 3);
- indexes[int(i * 6 + 2)] = T(i * 4 + 1);
-
- indexes[int(i * 6 + 3)] = T(i * 4 + 1);
- indexes[int(i * 6 + 4)] = T(i * 4 + 3);
- indexes[int(i * 6 + 5)] = T(i * 4 + 2);
- }
-
- return indexes;
-}
-
-void Q3DSDistanceFieldRenderer::buildShaders()
-{
- IShaderProgramGenerator &gen = m_context->GetShaderProgramGenerator();
- gen.BeginProgram();
- IShaderStageGenerator &vertexGenerator(*gen.GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(*gen.GetStage(ShaderGeneratorStages::Fragment));
-
- if (m_context->GetRenderContext().GetRenderContextType() == NVRenderContextValues::GLES2) {
- vertexGenerator.AddInclude("distancefieldtext.vert");
- fragmentGenerator.AddInclude("distancefieldtext.frag");
- } else {
- vertexGenerator.AddInclude("distancefieldtext_core.vert");
- fragmentGenerator.AddInclude("distancefieldtext_core.frag");
- }
-
- m_shader.program = gen.CompileGeneratedShader("distancefieldtext",
- SShaderCacheProgramFlags(),
- TShaderFeatureSet(), false);
-
- if (m_shader.program) {
- m_shader.mvp = NVRenderCachedShaderProperty<QT3DSMat44>(
- "mvp", *m_shader.program);
- m_shader.textureWidth = NVRenderCachedShaderProperty<QT3DSI32>(
- "textureWidth", *m_shader.program);
- m_shader.textureHeight = NVRenderCachedShaderProperty<QT3DSI32>(
- "textureHeight", *m_shader.program);
- m_shader.fontScale = NVRenderCachedShaderProperty<QT3DSF32>(
- "fontScale", *m_shader.program);
- m_shader.texture = NVRenderCachedShaderProperty<NVRenderTexture2D *>(
- "_qt_texture", *m_shader.program);
- m_shader.color = NVRenderCachedShaderProperty<QT3DSVec4>(
- "color", *m_shader.program);
- }
-
- gen.BeginProgram();
- vertexGenerator = *gen.GetStage(ShaderGeneratorStages::Vertex);
- fragmentGenerator = *gen.GetStage(ShaderGeneratorStages::Fragment);
-
- if (m_context->GetRenderContext().GetRenderContextType() == NVRenderContextValues::GLES2) {
- vertexGenerator.AddInclude("distancefieldtext_dropshadow.vert");
- fragmentGenerator.AddInclude("distancefieldtext_dropshadow.frag");
- } else {
- vertexGenerator.AddInclude("distancefieldtext_dropshadow_core.vert");
- fragmentGenerator.AddInclude("distancefieldtext_dropshadow_core.frag");
- }
-
- m_dropShadowShader.program = gen.CompileGeneratedShader("distancefieldtext_dropshadow",
- SShaderCacheProgramFlags(),
- TShaderFeatureSet(), false);
-
- if (m_dropShadowShader.program) {
- m_dropShadowShader.mvp = NVRenderCachedShaderProperty<QT3DSMat44>(
- "mvp", *m_dropShadowShader.program);
- m_dropShadowShader.textureWidth = NVRenderCachedShaderProperty<QT3DSI32>(
- "textureWidth", *m_dropShadowShader.program);
- m_dropShadowShader.textureHeight = NVRenderCachedShaderProperty<QT3DSI32>(
- "textureHeight", *m_dropShadowShader.program);
- m_dropShadowShader.fontScale = NVRenderCachedShaderProperty<QT3DSF32>(
- "fontScale", *m_dropShadowShader.program);
- m_dropShadowShader.shadowOffset = NVRenderCachedShaderProperty<QT3DSVec2>(
- "shadowOffset", *m_dropShadowShader.program);
- m_dropShadowShader.texture = NVRenderCachedShaderProperty<NVRenderTexture2D *>(
- "_qt_texture", *m_dropShadowShader.program);
- m_dropShadowShader.color = NVRenderCachedShaderProperty<QT3DSVec4>(
- "color", *m_dropShadowShader.program);
- m_dropShadowShader.shadowColor = NVRenderCachedShaderProperty<QT3DSVec4>(
- "shadowColor", *m_dropShadowShader.program);
- }
-}
-
-Q3DSDistanceFieldMesh Q3DSDistanceFieldRenderer::buildMesh(const GlyphInfo &glyphInfo,
- bool shadow)
-{
- static NVRenderVertexBufferEntry entries[] = {
- NVRenderVertexBufferEntry("vCoord", NVRenderComponentTypes::QT3DSF32, 3),
- NVRenderVertexBufferEntry("tCoord", NVRenderComponentTypes::QT3DSF32, 2, 3 * sizeof(float))
- };
-
- static NVRenderVertexBufferEntry shadowEntries[] = {
- NVRenderVertexBufferEntry("vCoord", NVRenderComponentTypes::QT3DSF32, 3),
- NVRenderVertexBufferEntry("tCoord", NVRenderComponentTypes::QT3DSF32, 2,
- 3 * sizeof(float)),
- NVRenderVertexBufferEntry("textureBounds", NVRenderComponentTypes::QT3DSF32, 4,
- 5 * sizeof(float))
- };
-
- const uint floatsPerVertex = 3 + 2 + (shadow ? 4 : 0);
- const uint stride = floatsPerVertex * sizeof(float);
- const uint offset = 0;
-
- NVRenderContext &renderContext = m_context->GetRenderContext();
- QVector<float> vertexes = glyphInfo.vertexes;
-
- Q_ASSERT(uint(vertexes.size()) % floatsPerVertex == 0);
- const uint vertexCount = uint(vertexes.size()) / floatsPerVertex;
-
- Q_ASSERT(vertexCount % 4 == 0);
- const uint quadCount = vertexCount / 4;
-
- Q3DSDistanceFieldMesh mesh;
-
- mesh.attribLayout = renderContext.CreateAttributeLayout(
- toConstDataRef(shadow ? shadowEntries : entries, shadow ? 3 : 2));
- mesh.vertexBuffer = renderContext.CreateVertexBuffer(
- NVRenderBufferUsageType::Static, size_t(vertexes.size()) * sizeof(float), stride,
- toU8DataRef(vertexes.begin(), QT3DSU32(vertexes.size())));
-
- if (vertexCount <= 0xffff) {
- QVector<QT3DSU16> indexes = fillIndexBuffer<QT3DSU16>(quadCount);
- mesh.indexBuffer = renderContext.CreateIndexBuffer(
- NVRenderBufferUsageType::Static, NVRenderComponentTypes::QT3DSU16,
- size_t(indexes.size()) * sizeof(QT3DSU16),
- toU8DataRef(indexes.begin(), QT3DSU32(indexes.size())));
- } else {
- QVector<QT3DSU32> indexes = fillIndexBuffer<QT3DSU32>(quadCount);
- mesh.indexBuffer = renderContext.CreateIndexBuffer(
- NVRenderBufferUsageType::Static, NVRenderComponentTypes::QT3DSU32,
- size_t(indexes.size()) * sizeof(QT3DSU32),
- toU8DataRef(indexes.begin(), QT3DSU32(indexes.size())));
- }
-
- mesh.inputAssembler = renderContext.CreateInputAssembler(
- mesh.attribLayout, toConstDataRef(&mesh.vertexBuffer, 1), mesh.indexBuffer,
- toConstDataRef(&stride, 1), toConstDataRef(&offset, 1));
-
- return mesh;
-}
-
-void Q3DSDistanceFieldRenderer::renderMesh(
- NVRenderInputAssembler *inputAssembler, NVRenderTexture2D *texture, const QT3DSMat44 &mvp,
- QT3DSI32 textureWidth, QT3DSI32 textureHeight, QT3DSF32 fontScale, QT3DSVec4 color)
-{
- NVRenderContext &renderContext = m_context->GetRenderContext();
- renderContext.SetCullingEnabled(false);
-
- renderContext.SetBlendFunction(NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One,
- NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One,
- NVRenderDstBlendFunc::OneMinusSrcAlpha));
- renderContext.SetBlendEquation(NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add));
-
- renderContext.SetActiveShader(m_shader.program);
- m_shader.mvp.Set(mvp);
- m_shader.textureWidth.Set(textureWidth);
- m_shader.textureHeight.Set(textureHeight);
- m_shader.fontScale.Set(fontScale);
- m_shader.texture.Set(texture);
- m_shader.color.Set(color);
-
- renderContext.SetInputAssembler(inputAssembler);
- renderContext.Draw(NVRenderDrawMode::Triangles, inputAssembler->GetIndexCount(), 0);
-}
-
-void Q3DSDistanceFieldRenderer::renderMeshWithDropShadow(
- NVRenderInputAssembler *inputAssembler, NVRenderTexture2D *texture, const QT3DSMat44 &mvp,
- QT3DSI32 textureWidth, QT3DSI32 textureHeight, QT3DSF32 fontScale, QT3DSVec2 shadowOffset,
- QT3DSVec4 color, QT3DSVec4 shadowColor)
-{
- NVRenderContext &renderContext = m_context->GetRenderContext();
- renderContext.SetCullingEnabled(false);
-
- renderContext.SetBlendFunction(NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One,
- NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One,
- NVRenderDstBlendFunc::OneMinusSrcAlpha));
- renderContext.SetBlendEquation(NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add));
-
- renderContext.SetActiveShader(m_dropShadowShader.program);
- m_dropShadowShader.mvp.Set(mvp);
- m_dropShadowShader.textureWidth.Set(textureWidth);
- m_dropShadowShader.textureHeight.Set(textureHeight);
- m_dropShadowShader.fontScale.Set(fontScale);
- m_dropShadowShader.shadowOffset.Set(shadowOffset);
- m_dropShadowShader.texture.Set(texture);
- m_dropShadowShader.color.Set(color);
- m_dropShadowShader.shadowColor.Set(shadowColor);
-
- renderContext.SetInputAssembler(inputAssembler);
- renderContext.Draw(NVRenderDrawMode::Triangles, inputAssembler->GetIndexCount(), 0);
-}
-
-namespace std {
-template<class T>
-struct hash<QVector<T>>
-{
- size_t operator()(const QVector<T> &s) const
- {
- return qHash(s);
- }
-};
-
-template<>
-struct hash<TextHorizontalAlignment::Enum>
-{
- size_t operator()(const TextHorizontalAlignment::Enum& s) const
- {
- return qHash(s);
- }
-};
-
-template<>
-struct hash<TextVerticalAlignment::Enum>
-{
- size_t operator()(const TextVerticalAlignment::Enum& s) const
- {
- return qHash(s);
- }
-};
-
-template<>
-struct hash<TextElide::Enum>
-{
- size_t operator()(const TextElide::Enum& s) const
- {
- return qHash(s);
- }
-};
-
-template<>
-struct hash<TextWordWrap::Enum>
-{
- size_t operator()(const TextWordWrap::Enum& s) const
- {
- return qHash(s);
- }
-};
-}
-
-// Copied from boost
-template <class T>
-inline void hashCombine(std::size_t &seed, const T &v)
-{
- std::hash<T> hasher;
- seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
-}
-
-size_t getTextHashValue(const SText &text)
-{
- size_t hashValue = 0;
- hashCombine(hashValue, text.m_TextColor.x);
- hashCombine(hashValue, text.m_TextColor.y);
- hashCombine(hashValue, text.m_TextColor.z);
- hashCombine(hashValue, text.m_TextColor.w);
- hashCombine(hashValue, std::string(text.m_Font.c_str()));
- hashCombine(hashValue, std::string(text.m_Text.c_str()));
- hashCombine(hashValue, text.m_Elide);
- hashCombine(hashValue, text.m_Leading);
- hashCombine(hashValue, text.m_FontSize);
- hashCombine(hashValue, text.m_Tracking);
- hashCombine(hashValue, text.m_WordWrap);
- hashCombine(hashValue, text.m_DropShadow);
- hashCombine(hashValue, text.m_BoundingBox.x);
- hashCombine(hashValue, text.m_BoundingBox.y);
- hashCombine(hashValue, text.m_DropShadowOffsetX);
- hashCombine(hashValue, text.m_DropShadowOffsetY);
- hashCombine(hashValue, text.m_DropShadowStrength);
- hashCombine(hashValue, text.m_VerticalAlignment);
- hashCombine(hashValue, text.m_HorizontalAlignment);
- return hashValue;
-}
-
-size_t getGlyphHashValue(const GlyphInfo &glyph)
-{
- size_t hashValue = 0;
- hashCombine(hashValue, glyph.vertexes);
- hashCombine(hashValue, glyph.glyphIndexes);
- hashCombine(hashValue, glyph.fontScale);
- hashCombine(hashValue, glyph.shadowOffsetX);
- hashCombine(hashValue, glyph.shadowOffsetY);
- return hashValue;
-}
-
-void Q3DSDistanceFieldRenderer::renderText(SText &text, const QT3DSMat44 &mvp)
-{
- if (!m_shader.program)
- buildShaders();
-
- float alpha = text.m_GlobalOpacity * text.m_TextColor.w;
- QT3DSVec4 textColor = QT3DSVec4(text.m_TextColor.getXYZ() * alpha, alpha);
- int shadowRgb = int(100 - int(text.m_DropShadowStrength));
- QT3DSVec4 shadowColor(shadowRgb * 0.01f * alpha, shadowRgb * 0.01f * alpha,
- shadowRgb * 0.01f * alpha, alpha);
-
- size_t textHashValue = getTextHashValue(text);
- if (!m_glyphCache.contains(textHashValue))
- m_glyphCache[textHashValue] = buildGlyphsPerTexture(text);
-
- QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo> &glyphsPerTexture
- = m_glyphCache[textHashValue];
-
- QT3DSVec3 minimum(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), 0);
- QT3DSVec3 maximum(-std::numeric_limits<float>::max(), -std::numeric_limits<float>::max(), 0);
-
- QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo>::const_iterator it;
- for (it = glyphsPerTexture.constBegin(); it != glyphsPerTexture.constEnd(); ++it) {
- const GlyphInfo &glyphInfo = it.value();
-
- if (glyphInfo.bounds.minimum.x < minimum.x)
- minimum.x = glyphInfo.bounds.minimum.x;
- if (glyphInfo.bounds.minimum.y < minimum.y)
- minimum.y = glyphInfo.bounds.minimum.y;
- if (glyphInfo.bounds.minimum.z < minimum.z)
- minimum.z = glyphInfo.bounds.minimum.z;
-
- if (glyphInfo.bounds.maximum.x > maximum.x)
- maximum.x = glyphInfo.bounds.maximum.x;
- if (glyphInfo.bounds.maximum.y > maximum.y)
- maximum.y = glyphInfo.bounds.maximum.y;
- if (glyphInfo.bounds.maximum.z > maximum.z)
- maximum.z = glyphInfo.bounds.maximum.z;
-
- size_t glyphHashValue = getGlyphHashValue(glyphInfo);
-
- if (!m_meshCache.contains(glyphHashValue))
- m_meshCache[glyphHashValue] = buildMesh(glyphInfo, text.m_DropShadow);
-
- Q3DSDistanceFieldMesh &mesh = m_meshCache[glyphHashValue];
-
- STextureDetails textureDetails = it.key()->texture->GetTextureDetails();
-
- if (text.m_DropShadow) {
- renderMeshWithDropShadow(mesh.inputAssembler, it.key()->texture, mvp,
- int(textureDetails.m_Width), int(textureDetails.m_Height),
- glyphInfo.fontScale * float(m_pixelRatio),
- QT3DSVec2(glyphInfo.shadowOffsetX, glyphInfo.shadowOffsetY),
- textColor, shadowColor);
- } else {
- renderMesh(mesh.inputAssembler, it.key()->texture, mvp,
- int(textureDetails.m_Width), int(textureDetails.m_Height),
- glyphInfo.fontScale * float(m_pixelRatio), textColor);
- }
-
- m_renderedGlyphs += glyphHashValue;
- }
-
- text.m_Bounds = NVBounds3(minimum, maximum);
-}
-
-void Q3DSDistanceFieldRenderer::renderTextDepth(SText &text, const QT3DSMat44 &mvp)
-{
- // TODO: Create a depth pass shader for distance field text
- renderText(text, mvp);
-}
-
-void Q3DSDistanceFieldRenderer::setContext(IQt3DSRenderContext &context)
-{
- m_context = &context;
- m_glyphCacheManager.setContext(context);
- buildShaders();
-}
-
-ITextRendererCore &ITextRendererCore::createDistanceFieldRenderer(NVFoundationBase &fnd)
-{
- return *QT3DS_NEW(fnd.getAllocator(), Q3DSDistanceFieldRenderer)(fnd);
-}
-
-// Unused methods:
-
-void Q3DSDistanceFieldRenderer::PreloadFonts()
-{
- Q_ASSERT(false);
-}
-
-void Q3DSDistanceFieldRenderer::BeginPreloadFonts(IThreadPool &, IPerfTimer &)
-{
- Q_ASSERT(false);
-}
-
-void Q3DSDistanceFieldRenderer::EndPreloadFonts()
-{
- Q_ASSERT(false);
-}
-
-void Q3DSDistanceFieldRenderer::ReloadFonts()
-{
- Q_ASSERT(false);
-}
-
-NVConstDataRef<SRendererFontEntry> Q3DSDistanceFieldRenderer::GetProjectFontList()
-{
- Q_ASSERT(false);
- return NVConstDataRef<SRendererFontEntry>();
-}
-
-Option<CRegisteredString> Q3DSDistanceFieldRenderer::GetFontNameForFont(CRegisteredString)
-{
- Q_ASSERT(false);
- return Option<CRegisteredString>();
-}
-
-Option<CRegisteredString> Q3DSDistanceFieldRenderer::GetFontNameForFont(const char8_t *)
-{
- Q_ASSERT(false);
- return Option<CRegisteredString>();
-}
-
-STextDimensions Q3DSDistanceFieldRenderer::MeasureText(const STextRenderInfo &, QT3DSF32,
- const char8_t *)
-{
- Q_ASSERT(false);
- return STextDimensions();
-}
-
-STextTextureDetails Q3DSDistanceFieldRenderer::RenderText(const STextRenderInfo &,
- NVRenderTexture2D &)
-{
- Q_ASSERT(false);
- return STextTextureDetails();
-}
-
-STextTextureDetails Q3DSDistanceFieldRenderer::RenderText(
- const STextRenderInfo &, NVRenderPathFontItem &, NVRenderPathFontSpecification &)
-{
- Q_ASSERT(false);
- return STextTextureDetails();
-}
-
-SRenderTextureAtlasDetails Q3DSDistanceFieldRenderer::RenderText(const STextRenderInfo &)
-{
- Q_ASSERT(false);
- return SRenderTextureAtlasDetails();
-}
-
-void Q3DSDistanceFieldRenderer::BeginFrame()
-{
- Q_ASSERT(false);
-}
-
-QT3DSI32 Q3DSDistanceFieldRenderer::CreateTextureAtlas()
-{
- Q_ASSERT(false);
- return 0;
-}
-
-STextTextureAtlasEntryDetails Q3DSDistanceFieldRenderer::RenderAtlasEntry(QT3DSU32,
- NVRenderTexture2D &)
-{
- Q_ASSERT(false);
- return STextTextureAtlasEntryDetails();
-}
-
-bool Q3DSDistanceFieldRenderer::checkAndBuildGlyphs(SText &text)
-{
- auto hashVal = getTextHashValue(text);
- if (!m_glyphCache.contains(hashVal)) {
- m_glyphCache[hashVal] = buildGlyphsPerTexture(text);
- return true;
- }
-
- return false;
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.h
deleted file mode 100644
index 3af19a98..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSDistanceFieldRenderer.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DSDISTANCEFIELDRENDERER_H
-#define QT3DSDISTANCEFIELDRENDERER_H
-
-#include "Qt3DSFontDatabase_p.h"
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderText.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-#include "Qt3DSDistanceFieldGlyphCacheManager_p.h"
-#include "Qt3DSDistanceFieldGlyphCache_p.h"
-
-namespace qt3ds {
-namespace render {
-
-struct GlyphInfo {
- QVector<float> vertexes;
- QVector<quint32> glyphIndexes;
- Q3DSDistanceFieldGlyphCache *cache;
- float fontScale;
- float shadowOffsetX;
- float shadowOffsetY;
- NVBounds3 bounds;
-};
-
-struct Q3DSDistanceFieldShader {
- NVRenderShaderProgram *program = nullptr;
- NVRenderCachedShaderProperty<QT3DSMat44> mvp;
- NVRenderCachedShaderProperty<QT3DSI32> textureWidth;
- NVRenderCachedShaderProperty<QT3DSI32> textureHeight;
- NVRenderCachedShaderProperty<QT3DSF32> fontScale;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> texture;
- NVRenderCachedShaderProperty<QT3DSVec4> color;
-};
-
-struct Q3DSDistanceFieldDropShadowShader {
- NVRenderShaderProgram *program = nullptr;
- NVRenderCachedShaderProperty<QT3DSMat44> mvp;
- NVRenderCachedShaderProperty<QT3DSI32> textureWidth;
- NVRenderCachedShaderProperty<QT3DSI32> textureHeight;
- NVRenderCachedShaderProperty<QT3DSF32> fontScale;
- NVRenderCachedShaderProperty<QT3DSVec2> shadowOffset;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> texture;
- NVRenderCachedShaderProperty<QT3DSVec4> color;
- NVRenderCachedShaderProperty<QT3DSVec4> shadowColor;
-};
-
-struct Q3DSDistanceFieldMesh
-{
- NVRenderAttribLayout *attribLayout = nullptr;
- NVRenderVertexBuffer *vertexBuffer = nullptr;
- NVRenderIndexBuffer *indexBuffer = nullptr;
- NVRenderInputAssembler *inputAssembler = nullptr;
-};
-
-class Q3DSDistanceFieldRenderer : public ITextRenderer
-{
-public:
- Q3DSDistanceFieldRenderer(NVFoundationBase &foundation);
- ~Q3DSDistanceFieldRenderer() override;
- QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo> buildGlyphsPerTexture(
- const SText &textInfo);
- void buildShaders();
- Q3DSDistanceFieldMesh buildMesh(const GlyphInfo &glyphInfo, bool shadow);
- void renderMesh(NVRenderInputAssembler *inputAssembler, NVRenderTexture2D *texture,
- const QT3DSMat44 &mvp, QT3DSI32 textureWidth, QT3DSI32 textureHeight,
- QT3DSF32 fontScale, QT3DSVec4 color);
- void renderMeshWithDropShadow(NVRenderInputAssembler *inputAssembler,
- NVRenderTexture2D *texture, const QT3DSMat44 &mvp,
- QT3DSI32 textureWidth, QT3DSI32 textureHeight,
- QT3DSF32 fontScale, QT3DSVec2 shadowOffset,
- QT3DSVec4 color, QT3DSVec4 shadowColor);
- void renderText(SText &text, const QT3DSMat44 &mvp);
- void renderTextDepth(SText &text, const QT3DSMat44 &mvp);
- void setContext(IQt3DSRenderContext &context);
-
- bool checkAndBuildGlyphs(SText &text);
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_foundation.getAllocator())
-
- void AddSystemFontDirectory(const char8_t *dir) override;
- void AddProjectFontDirectory(const char8_t *dir) override;
- void ClearProjectFontDirectories() override;
- ITextRenderer &GetTextRenderer(NVRenderContext &) override;
- void EndFrame() override;
-
- // Unused methods:
- void PreloadFonts() override;
- void BeginPreloadFonts(IThreadPool &, IPerfTimer &) override;
- void EndPreloadFonts() override;
- void ReloadFonts() override;
-
- NVConstDataRef<SRendererFontEntry> GetProjectFontList() override;
-
- Option<CRegisteredString> GetFontNameForFont(CRegisteredString) override;
- Option<CRegisteredString> GetFontNameForFont(const char8_t *) override;
-
- STextDimensions MeasureText(const STextRenderInfo &, QT3DSF32,
- const char8_t *) override;
-
- STextTextureDetails RenderText(const STextRenderInfo &,
- NVRenderTexture2D &) override;
-
- STextTextureDetails RenderText(const STextRenderInfo &, NVRenderPathFontItem &,
- NVRenderPathFontSpecification &) override;
-
- SRenderTextureAtlasDetails RenderText(const STextRenderInfo &) override;
-
- void BeginFrame() override;
-
- QT3DSI32 CreateTextureAtlas() override;
- STextTextureAtlasEntryDetails RenderAtlasEntry(QT3DSU32, NVRenderTexture2D &) override;
-
-private:
- IQt3DSRenderContext *m_context = nullptr;
- QHash<size_t, QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo>> m_glyphCache;
- QHash<size_t, Q3DSDistanceFieldMesh> m_meshCache;
-
- Q3DSFontDatabase m_fontDatabase;
- Q3DSDistanceFieldGlyphCacheManager m_glyphCacheManager;
-
- Q3DSDistanceFieldShader m_shader;
- Q3DSDistanceFieldDropShadowShader m_dropShadowShader;
- QVector<size_t> m_renderedGlyphs;
-
- QStringList m_systemDirs;
- QStringList m_projectDirs;
-
- qreal m_pixelRatio = 0.0;
-
- NVFoundationBase &m_foundation;
- volatile QT3DSI32 mRefCount = 0;
-};
-
-}
-}
-
-#endif // Qt version check
-
-#endif // QT3DSDISTANCEFIELDRENDERER_H
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase.cpp
deleted file mode 100644
index b44cdbd1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSFontDatabase_p.h"
-
-#include <QtCore/qdir.h>
-#include "qloggingcategory.h"
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-QT_BEGIN_NAMESPACE
-
-Q3DSFontDatabase::Q3DSFontDatabase()
-{
-}
-
-void Q3DSFontDatabase::registerFonts(const QStringList &directories)
-{
- const QStringList nameFilters = { QStringLiteral("*.ttf"), QStringLiteral("*.otf") };
- for (const QString &directory : directories) {
- QDir fontDir(directory);
- if (!fontDir.exists()) {
- qWarning("Attempted to register invalid font directory: %s",
- qPrintable(directory));
- continue;
- }
-
- const QFileInfoList entryInfoList = fontDir.entryInfoList(nameFilters);
- for (const QFileInfo &entryInfo : entryInfoList) {
- QRawFont font(entryInfo.absoluteFilePath(), 16);
- if (!font.isValid()) {
- qWarning("Invalid font file: %s", qPrintable(entryInfo.absoluteFilePath()));
- continue;
- }
-
- // ### Only support scalable fonts
-
- QString fontId = entryInfo.baseName();
- if (std::find_if(m_fonts.constBegin(), m_fonts.constEnd(),
- [fontId](const Font &f) { return f.fontId == fontId; })
- != m_fonts.constEnd()) {
- // already registered
- continue;
- }
-
- m_fonts.append(Font(fontId, entryInfo.absoluteFilePath()));
- }
- }
-}
-
-void Q3DSFontDatabase::unregisterFonts(const QStringList &directories)
-{
- for (const QString &directory : directories) {
- QDir dir(directory);
- QVector<Font>::iterator it = m_fonts.begin();
- while (it != m_fonts.end()) {
- if (dir == QDir(QFileInfo(it->filePath).absolutePath()))
- it = m_fonts.erase(it);
- else
- ++it;
- }
- }
-}
-
-QRawFont Q3DSFontDatabase::findFont(const QString &fontId)
-{
- for (Font &font : m_fonts) {
- if (font.fontId == fontId) {
- if (!font.rawFont.isValid())
- font.rawFont = QRawFont(font.filePath, 16);
- return font.rawFont;
- }
- }
-
- return QRawFont::fromFont(QFont());
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase_p.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase_p.h
deleted file mode 100644
index 73e03624..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSFontDatabase_p.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef Q3DSFONTDATABASE_P_H
-#define Q3DSFONTDATABASE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of a number of Qt sources files. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qvector.h>
-#include <QtGui/qrawfont.h>
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-QT_BEGIN_NAMESPACE
-
-class Q3DSSceneManager;
-class Q3DSFontDatabase
-{
-public:
- Q3DSFontDatabase();
-
- void registerFonts(const QStringList &directories);
- void unregisterFonts(const QStringList &directories);
-
- QRawFont findFont(const QString &fontId);
-
-private:
- struct Font {
- Font() = default;
- Font(const QString &id, const QString &path)
- : fontId(id)
- , filePath(path)
- {}
-
- QString fontId;
- QString filePath;
- QRawFont rawFont;
- };
-
- QVector<Font> m_fonts;
-};
-
-QT_END_NAMESPACE
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
-
-#endif // Q3DSFONTDATABASE_P_H
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderKey.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderKey.h
deleted file mode 100644
index 555c2689..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderKey.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_OFFSCREEN_RENDER_KEY_H
-#define QT3DS_OFFSCREEN_RENDER_KEY_H
-#include "Qt3DSRender.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSDiscriminatedUnion.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <>
- struct DestructTraits<CRegisteredString>
- {
- void destruct(CRegisteredString &) {}
- };
-}
-}
-
-namespace qt3ds {
-namespace render {
- struct OffscreenRendererKeyTypes
- {
- enum Enum {
- NoOffscreenRendererKey = 0,
- RegisteredString,
- VoidPtr,
- };
- };
-
- template <typename TDType>
- struct SOffscreenRendererKeyTypeMap
- {
- };
- template <>
- struct SOffscreenRendererKeyTypeMap<CRegisteredString>
- {
- enum { KeyType = OffscreenRendererKeyTypes::RegisteredString };
- };
- template <>
- struct SOffscreenRendererKeyTypeMap<void *>
- {
- enum { KeyType = OffscreenRendererKeyTypes::VoidPtr };
- };
-
- struct SOffscreenRendererKeyUnionTraits
- {
- typedef OffscreenRendererKeyTypes::Enum TIdType;
- enum {
- TBufferSize = sizeof(CRegisteredString),
- };
-
- static TIdType getNoDataId() { return OffscreenRendererKeyTypes::NoOffscreenRendererKey; }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return (TIdType)SOffscreenRendererKeyTypeMap<TDataType>::KeyType;
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case OffscreenRendererKeyTypes::RegisteredString:
- return inVisitor(*NVUnionCast<CRegisteredString *>(inData));
- case OffscreenRendererKeyTypes::VoidPtr:
- return inVisitor(*NVUnionCast<void **>(inData));
- default:
- QT3DS_ASSERT(false);
- case OffscreenRendererKeyTypes::NoOffscreenRendererKey:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case OffscreenRendererKeyTypes::RegisteredString:
- return inVisitor(*NVUnionCast<const CRegisteredString *>(inData));
- case OffscreenRendererKeyTypes::VoidPtr:
- return inVisitor(*NVUnionCast<const void **>(inData));
- default:
- QT3DS_ASSERT(false);
- case OffscreenRendererKeyTypes::NoOffscreenRendererKey:
- return inVisitor();
- }
- }
- };
-
- typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SOffscreenRendererKeyUnionTraits,
- SOffscreenRendererKeyUnionTraits::
- TBufferSize>,
- SOffscreenRendererKeyUnionTraits::TBufferSize>
- TOffscreenRendererKeyUnionType;
-
- struct SOffscreenRendererKey : public TOffscreenRendererKeyUnionType
- {
- typedef TOffscreenRendererKeyUnionType TBase;
- SOffscreenRendererKey() {}
- SOffscreenRendererKey(const CRegisteredString &str)
- : TBase(str)
- {
- }
- SOffscreenRendererKey(void *key)
- : TBase(key)
- {
- }
- SOffscreenRendererKey(const SOffscreenRendererKey &other)
- : TBase(static_cast<const TBase &>(other))
- {
- }
- SOffscreenRendererKey &operator=(const SOffscreenRendererKey &other)
- {
- TBase::operator=(other);
- return *this;
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.cpp
deleted file mode 100644
index 7d66c7a3..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.cpp
+++ /dev/null
@@ -1,498 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSOffscreenRenderManager.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSOffscreenRenderKey.h"
-#include "foundation/FastAllocator.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRenderResourceTexture2D.h"
-#include "Qt3DSRenderResourceBufferObjects.h"
-#include "Qt3DSRendererUtil.h"
-
-using namespace qt3ds::render;
-
-namespace eastl {
-template <>
-struct hash<SOffscreenRendererKey>
-{
- size_t operator()(const SOffscreenRendererKey &key) const
- {
- switch (key.getType()) {
- case OffscreenRendererKeyTypes::RegisteredString:
- return hash<CRegisteredString>()(key.getData<CRegisteredString>());
- case OffscreenRendererKeyTypes::VoidPtr:
- return hash<size_t>()(reinterpret_cast<size_t>(key.getData<void *>()));
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
- bool operator()(const SOffscreenRendererKey &lhs, const SOffscreenRendererKey &rhs) const
- {
- return lhs == rhs;
- }
-};
-}
-
-namespace {
-
-using eastl::pair;
-using eastl::make_pair;
-
-struct SRendererData : SOffscreenRenderResult
-{
- NVAllocatorCallback &m_Allocator;
- IResourceManager &m_ResourceManager;
- QT3DSU32 m_FrameCount;
- bool m_Rendering;
-
- SRendererData(NVAllocatorCallback &inAllocator, IResourceManager &inResourceManager)
- : m_Allocator(inAllocator)
- , m_ResourceManager(inResourceManager)
- , m_FrameCount(QT3DS_MAX_U32)
- , m_Rendering(false)
- {
- }
- ~SRendererData()
- {
- if (m_Texture)
- m_ResourceManager.Release(*m_Texture);
- m_Texture = NULL;
- }
- void Release() { NVDelete(m_Allocator, this); }
-};
-
-struct SScopedRenderDataRenderMarker
-{
- SRendererData &m_Data;
- SScopedRenderDataRenderMarker(SRendererData &d)
- : m_Data(d)
- {
- QT3DS_ASSERT(m_Data.m_Rendering == false);
- m_Data.m_Rendering = true;
- }
- ~SScopedRenderDataRenderMarker() { m_Data.m_Rendering = false; }
-};
-
-struct SRenderDataReleaser
-{
- SRendererData *mPtr;
- SRenderDataReleaser(SRendererData *inItem)
- : mPtr(inItem)
- {
- }
- // Transfer ownership
- SRenderDataReleaser(const SRenderDataReleaser &inOther)
- : mPtr(inOther.mPtr)
- {
- const_cast<SRenderDataReleaser &>(inOther).mPtr = NULL;
- }
-
- ~SRenderDataReleaser()
- {
- if (mPtr)
- mPtr->Release();
- }
-};
-struct SOffscreenRenderManager;
-
-struct SOffscreenRunnable : public IRenderTask
-{
- SOffscreenRenderManager &m_RenderManager;
- SRendererData &m_Data;
- SOffscreenRendererEnvironment m_DesiredEnvironment;
- SOffscreenRunnable(SOffscreenRenderManager &rm, SRendererData &data,
- SOffscreenRendererEnvironment env)
- : m_RenderManager(rm)
- , m_Data(data)
- , m_DesiredEnvironment(env)
- {
- }
- void Run() override;
-};
-
-struct SOffscreenRenderManager : public IOffscreenRenderManager
-{
- typedef nvhash_map<SOffscreenRendererKey, SRenderDataReleaser> TRendererMap;
- IQt3DSRenderContext &m_Context;
- NVAllocatorCallback &m_Allocator;
- NVScopedRefCounted<IStringTable> m_StringTable;
- NVScopedRefCounted<IResourceManager> m_ResourceManager;
- TRendererMap m_Renderers;
- SFastAllocator<> m_PerFrameAllocator;
- QT3DSU32 m_FrameCount; // cheap per-
-
- volatile QT3DSI32 mRefCount;
-
- SOffscreenRenderManager(NVAllocatorCallback &inCallback, IStringTable &inStringTable,
- IResourceManager &inManager, IQt3DSRenderContext &inContext)
- : m_Context(inContext)
- , m_Allocator(inCallback)
- , m_StringTable(inStringTable)
- , m_ResourceManager(inManager)
- , m_Renderers(inCallback, "SOffscreenRenderManager::m_Renderers")
- , m_PerFrameAllocator(inCallback, "m_PerFrameAllocator")
- , m_FrameCount(0)
- , mRefCount(0)
- {
- }
-
- virtual ~SOffscreenRenderManager() {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Allocator)
-
- Option<bool> MaybeRegisterOffscreenRenderer(const SOffscreenRendererKey &inKey,
- IOffscreenRenderer &inRenderer) override
- {
- TRendererMap::iterator theIter = m_Renderers.find(inKey);
- if (theIter != m_Renderers.end()) {
- SRendererData &theData = *(theIter->second.mPtr);
- if (theData.m_Renderer != &inRenderer) {
- if (inKey.getType() == OffscreenRendererKeyTypes::RegisteredString) {
- qCCritical(INVALID_OPERATION, "Different renderers registered under same key: %s",
- inKey.getData<CRegisteredString>().c_str());
- }
- QT3DS_ASSERT(false);
- return Empty();
- }
- return false;
- }
- RegisterOffscreenRenderer(inKey, inRenderer);
- return true;
- }
-
- void RegisterOffscreenRenderer(const SOffscreenRendererKey &inKey,
- IOffscreenRenderer &inRenderer) override
- {
- pair<TRendererMap::iterator, bool> theInsert = m_Renderers.insert(
- make_pair(inKey, QT3DS_NEW(m_Allocator, SRendererData)(m_Allocator, *m_ResourceManager)));
- QT3DS_ASSERT(theInsert.second);
- SRendererData &theData = *(theInsert.first->second.mPtr);
- theData.m_Renderer = &inRenderer;
- }
-
- bool HasOffscreenRenderer(const SOffscreenRendererKey &inKey) override
- {
- return m_Renderers.find(inKey) != m_Renderers.end();
- }
-
- IOffscreenRenderer *GetOffscreenRenderer(const SOffscreenRendererKey &inKey) override
- {
- TRendererMap::iterator theRenderer = m_Renderers.find(inKey);
- if (theRenderer != m_Renderers.end()) {
- SRendererData &theData = *theRenderer->second.mPtr;
- return theData.m_Renderer;
- }
- return NULL;
- }
- void ReleaseOffscreenRenderer(const SOffscreenRendererKey &inKey) override
- {
- m_Renderers.erase(inKey);
- }
-
- void RenderItem(SRendererData &theData, SOffscreenRendererEnvironment theDesiredEnvironment)
- {
- NVRenderContext &theContext = m_ResourceManager->GetRenderContext();
- QT3DSVec2 thePresScaleFactor = m_Context.GetPresentationScaleFactor();
- SOffscreenRendererEnvironment theOriginalDesiredEnvironment(theDesiredEnvironment);
- // Ensure that our overall render context comes back no matter what the client does.
- qt3ds::render::NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- theContext, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
- QT3DSVec4(0, 0, 0, 0));
- qt3ds::render::NVRenderContextScopedProperty<bool> __scissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled, false);
- qt3ds::render::NVRenderContextScopedProperty<NVRenderRect> __scissorRect(
- theContext, &NVRenderContext::GetScissorRect, &NVRenderContext::SetScissorRect);
- qt3ds::render::NVRenderContextScopedProperty<NVRenderRect> __viewportRect(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport);
- qt3ds::render::NVRenderContextScopedProperty<bool> __depthWrite(
- theContext, &NVRenderContext::IsDepthWriteEnabled,
- &NVRenderContext::SetDepthWriteEnabled, false);
- qt3ds::render::NVRenderContextScopedProperty<qt3ds::render::NVRenderBoolOp::Enum> __depthFunction(
- theContext, &NVRenderContext::GetDepthFunction, &NVRenderContext::SetDepthFunction,
- qt3ds::render::NVRenderBoolOp::Less);
- qt3ds::render::NVRenderContextScopedProperty<bool> __blendEnabled(
- theContext, &NVRenderContext::IsBlendingEnabled, &NVRenderContext::SetBlendingEnabled,
- false);
- qt3ds::render::NVRenderContextScopedProperty<qt3ds::render::NVRenderBlendFunctionArgument>
- __blendFunction(theContext, &NVRenderContext::GetBlendFunction,
- &NVRenderContext::SetBlendFunction,
- qt3ds::render::NVRenderBlendFunctionArgument());
- qt3ds::render::NVRenderContextScopedProperty<qt3ds::render::NVRenderBlendEquationArgument>
- __blendEquation(theContext, &NVRenderContext::GetBlendEquation,
- &NVRenderContext::SetBlendEquation,
- qt3ds::render::NVRenderBlendEquationArgument());
- qt3ds::render::NVRenderContextScopedProperty<qt3ds::render::NVRenderFrameBufferPtr>
- __rendertarget(theContext, &NVRenderContext::GetRenderTarget,
- &NVRenderContext::SetRenderTarget);
-
- QT3DSU32 theSampleCount = 1;
- bool isMultisamplePass = false;
- if (theDesiredEnvironment.m_MSAAMode != AAModeValues::NoAA) {
- switch (theDesiredEnvironment.m_MSAAMode) {
- case AAModeValues::SSAA:
- theSampleCount = 1;
- isMultisamplePass = true;
- break;
- case AAModeValues::X2:
- theSampleCount = 2;
- isMultisamplePass = true;
- break;
- case AAModeValues::X4:
- theSampleCount = 4;
- isMultisamplePass = true;
- break;
- case AAModeValues::X8:
- theSampleCount = 8;
- isMultisamplePass = true;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- };
-
- // adjust render size for SSAA
- if (theDesiredEnvironment.m_MSAAMode == AAModeValues::SSAA) {
- CRendererUtil::GetSSAARenderSize(
- theOriginalDesiredEnvironment.m_Width, theOriginalDesiredEnvironment.m_Height,
- theDesiredEnvironment.m_Width, theDesiredEnvironment.m_Height);
- }
- }
- CResourceFrameBuffer theFrameBuffer(*m_ResourceManager);
- theFrameBuffer.EnsureFrameBuffer();
- NVRenderTexture2D *renderTargetTexture(theData.m_Texture);
- qt3ds::render::NVRenderTextureTargetType::Enum fboAttachmentType =
- qt3ds::render::NVRenderTextureTargetType::Texture2D;
- if (isMultisamplePass) {
- renderTargetTexture = NULL;
- if (theSampleCount > 1)
- fboAttachmentType = qt3ds::render::NVRenderTextureTargetType::Texture2D_MS;
- }
-
- CResourceTexture2D renderColorTexture(*m_ResourceManager, renderTargetTexture);
-
- CResourceTexture2D renderDepthStencilTexture(*m_ResourceManager);
-
- if (theSampleCount > 1)
- m_Context.GetRenderContext().SetMultisampleEnabled(true);
-
- qt3ds::render::NVRenderClearFlags theClearFlags;
- NVRenderTextureFormats::Enum theDepthStencilTextureFormat(NVRenderTextureFormats::Unknown);
- NVRenderFrameBufferAttachments::Enum theAttachmentLocation(
- NVRenderFrameBufferAttachments::Unknown);
- if (theDesiredEnvironment.m_Stencil) {
- theDepthStencilTextureFormat = NVRenderTextureFormats::Depth24Stencil8;
- theAttachmentLocation = NVRenderFrameBufferAttachments::DepthStencil;
- } else if (theDesiredEnvironment.m_Depth != OffscreenRendererDepthValues::NoDepthBuffer) {
- theAttachmentLocation = NVRenderFrameBufferAttachments::Depth;
- switch (theDesiredEnvironment.m_Depth) {
- case OffscreenRendererDepthValues::Depth16:
- theDepthStencilTextureFormat = NVRenderTextureFormats::Depth16;
- break;
- case OffscreenRendererDepthValues::Depth24:
- theDepthStencilTextureFormat = NVRenderTextureFormats::Depth24;
- break;
- case OffscreenRendererDepthValues::Depth32:
- theDepthStencilTextureFormat = NVRenderTextureFormats::Depth32;
- break;
- default:
- theAttachmentLocation = NVRenderFrameBufferAttachments::Unknown;
- theDepthStencilTextureFormat = NVRenderTextureFormats::Unknown;
- break;
- }
- }
- renderColorTexture.EnsureTexture(theDesiredEnvironment.m_Width,
- theDesiredEnvironment.m_Height,
- theDesiredEnvironment.m_Format, theSampleCount);
- theFrameBuffer->Attach(NVRenderFrameBufferAttachments::Color0, *renderColorTexture,
- fboAttachmentType);
-
- if (theDepthStencilTextureFormat != NVRenderTextureFormats::Unknown) {
- renderDepthStencilTexture.EnsureTexture(theDesiredEnvironment.m_Width,
- theDesiredEnvironment.m_Height,
- theDepthStencilTextureFormat, theSampleCount);
- theFrameBuffer->Attach(theAttachmentLocation, *renderDepthStencilTexture,
- fboAttachmentType);
- }
- // IsComplete check takes a really long time so I am not going to worry about it for now.
-
- theContext.SetRenderTarget(theFrameBuffer);
- theContext.SetViewport(
- NVRenderRect(0, 0, theDesiredEnvironment.m_Width, theDesiredEnvironment.m_Height));
- theContext.SetScissorTestEnabled(false);
-
- theContext.SetBlendingEnabled(false);
- theData.m_Renderer->Render(theDesiredEnvironment, theContext, thePresScaleFactor,
- SScene::AlwaysClear, this);
-
- if (theSampleCount > 1) {
- CResourceTexture2D theResult(*m_ResourceManager, theData.m_Texture);
-
- if (theDesiredEnvironment.m_MSAAMode != AAModeValues::SSAA) {
- // Have to downsample the FBO.
- CRendererUtil::ResolveMutisampleFBOColorOnly(
- *m_ResourceManager, theResult, m_Context.GetRenderContext(),
- theDesiredEnvironment.m_Width, theDesiredEnvironment.m_Height,
- theDesiredEnvironment.m_Format, *theFrameBuffer);
-
- m_Context.GetRenderContext().SetMultisampleEnabled(false);
- } else {
- // Resolve the FBO to the layer texture
- CRendererUtil::ResolveSSAAFBOColorOnly(
- *m_ResourceManager, theResult, theOriginalDesiredEnvironment.m_Width,
- theOriginalDesiredEnvironment.m_Height, m_Context.GetRenderContext(),
- theDesiredEnvironment.m_Width, theDesiredEnvironment.m_Height,
- theDesiredEnvironment.m_Format, *theFrameBuffer);
- }
-
- QT3DS_ASSERT(theData.m_Texture == theResult.GetTexture());
- theResult.ForgetTexture();
- } else {
- renderColorTexture.ForgetTexture();
- }
- theFrameBuffer->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer(), fboAttachmentType);
- if (theAttachmentLocation != NVRenderFrameBufferAttachments::Unknown)
- theFrameBuffer->Attach(theAttachmentLocation, NVRenderTextureOrRenderBuffer(),
- fboAttachmentType);
- }
-
- SOffscreenRenderResult GetRenderedItem(const SOffscreenRendererKey &inKey) override
- {
- TRendererMap::iterator theRenderer = m_Renderers.find(inKey);
- QT3DSVec2 thePresScaleFactor = m_Context.GetPresentationScaleFactor();
- if (theRenderer != m_Renderers.end() && theRenderer->second.mPtr->m_Rendering == false) {
- SRendererData &theData = *theRenderer->second.mPtr;
- SScopedRenderDataRenderMarker __renderMarker(theData);
-
- bool renderedThisFrame = theData.m_Texture && theData.m_FrameCount == m_FrameCount;
- theData.m_FrameCount = m_FrameCount;
- // Two different quick-out pathways.
- if (renderedThisFrame)
- return theData;
-
- SOffscreenRendererEnvironment theDesiredEnvironment =
- theData.m_Renderer->GetDesiredEnvironment(thePresScaleFactor);
- // Ensure we get a valid width and height
- theDesiredEnvironment.m_Width =
- ITextRenderer::NextMultipleOf4(theDesiredEnvironment.m_Width);
- theDesiredEnvironment.m_Height =
- ITextRenderer::NextMultipleOf4(theDesiredEnvironment.m_Height);
- if (theDesiredEnvironment.m_Width == 0 || theDesiredEnvironment.m_Height == 0) {
- return SOffscreenRenderResult();
- }
-
- NVRenderRect theViewport(0, 0, theDesiredEnvironment.m_Width,
- theDesiredEnvironment.m_Height);
- IRenderList &theRenderList(m_Context.GetRenderList());
- NVRenderContext &theContext(m_Context.GetRenderContext());
- // This happens here because if there are any fancy render steps
- SRenderListScopedProperty<bool> _scissor(theRenderList,
- &IRenderList::IsScissorTestEnabled,
- &IRenderList::SetScissorTestEnabled, false);
- SRenderListScopedProperty<NVRenderRect> _viewport(
- theRenderList, &IRenderList::GetViewport, &IRenderList::SetViewport, theViewport);
- // Some plugins don't use the render list so they need the actual gl context setup.
- qt3ds::render::NVRenderContextScopedProperty<bool> __scissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled, false);
- qt3ds::render::NVRenderContextScopedProperty<NVRenderRect> __viewportRect(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport,
- theViewport);
-
- QT3DSU32 taskId = m_Context.GetRenderList().AddRenderTask(
- *QT3DS_NEW(m_Context.GetPerFrameAllocator(),
- SOffscreenRunnable)(*this, theData, theDesiredEnvironment));
-
- SOffscreenRenderFlags theFlags =
- theData.m_Renderer->NeedsRender(theDesiredEnvironment, thePresScaleFactor, this);
- theData.m_HasTransparency = theFlags.m_HasTransparency;
- theData.m_HasChangedSinceLastFrame = theFlags.m_HasChangedSinceLastFrame;
- if (theData.m_Texture) {
- // Quick-out if the renderer doesn't need to render itself.
- if (theData.m_HasChangedSinceLastFrame == false) {
- m_Context.GetRenderList().DiscardRenderTask(taskId);
- return theData;
- }
- } else
- theData.m_HasChangedSinceLastFrame = true;
-
- // Release existing texture if it doesn't match latest environment request.
- if (theData.m_Texture) {
- STextureDetails theDetails = theData.m_Texture->GetTextureDetails();
- if (theDesiredEnvironment.m_Width != theDetails.m_Width
- || theDesiredEnvironment.m_Height != theDetails.m_Height
- || theDesiredEnvironment.m_Format != theDetails.m_Format) {
- m_ResourceManager->Release(*theData.m_Texture);
- theData.m_Texture = NULL;
- }
- }
-
- if (theData.m_Texture == NULL)
- theData.m_Texture = m_ResourceManager->AllocateTexture2D(
- theDesiredEnvironment.m_Width, theDesiredEnvironment.m_Height,
- theDesiredEnvironment.m_Format);
-
- // Add the node to the graph and get on with it.
-
- return theData;
- }
- return SOffscreenRenderResult();
- }
-
- void BeginFrame() override { m_PerFrameAllocator.reset(); }
- void EndFrame() override { ++m_FrameCount; }
-};
-
-void SOffscreenRunnable::Run()
-{
- m_RenderManager.RenderItem(m_Data, m_DesiredEnvironment);
-}
-}
-
-IOffscreenRenderManager &IOffscreenRenderManager::CreateOffscreenRenderManager(
- NVAllocatorCallback &inCallback, IStringTable &inStringTable, IResourceManager &inManager,
- IQt3DSRenderContext &inContext)
-{
- return *QT3DS_NEW(inCallback, SOffscreenRenderManager)(inCallback, inStringTable, inManager,
- inContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.h
deleted file mode 100644
index 6d821624..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOffscreenRenderManager.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_OFFSCREEN_RENDER_MANAGER_H
-#define QT3DS_OFFSCREEN_RENDER_MANAGER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSOption.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderLayer.h"
-
-namespace qt3ds {
-namespace render {
- class IResourceManager;
- struct Qt3DSRenderPickResult;
- class IGraphObjectPickQuery;
- struct OffscreenRendererDepthValues
- {
- enum Enum {
- NoDepthBuffer = 0,
- Depth16, // 16 bit depth buffer
- Depth24, // 24 bit depth buffer
- Depth32, // 32 bit depth buffer
- Depth24Stencil8 // 24 bit depth buffer 8 bit stencil buffer
- };
- };
-
- struct SOffscreenRendererEnvironment
- {
- QT3DSU32 m_Width;
- QT3DSU32 m_Height;
- NVRenderTextureFormats::Enum m_Format;
- OffscreenRendererDepthValues::Enum m_Depth;
- bool m_Stencil;
- AAModeValues::Enum m_MSAAMode;
-
- SOffscreenRendererEnvironment()
- : m_Width(0)
- , m_Height(0)
- , m_Format(NVRenderTextureFormats::Unknown)
- , m_Depth(OffscreenRendererDepthValues::NoDepthBuffer)
- , m_Stencil(false)
- , m_MSAAMode(AAModeValues::NoAA)
- {
- }
-
- SOffscreenRendererEnvironment(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inFormat)
- : m_Width(inWidth)
- , m_Height(inHeight)
- , m_Format(inFormat)
- , m_Depth(OffscreenRendererDepthValues::Depth16)
- , m_Stencil(false)
- , m_MSAAMode(AAModeValues::NoAA)
- {
- }
-
- SOffscreenRendererEnvironment(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inFormat,
- OffscreenRendererDepthValues::Enum inDepth, bool inStencil,
- AAModeValues::Enum inAAMode)
- : m_Width(inWidth)
- , m_Height(inHeight)
- , m_Format(inFormat)
- , m_Depth(inDepth)
- , m_Stencil(inStencil)
- , m_MSAAMode(inAAMode)
- {
- }
-
- SOffscreenRendererEnvironment(const SOffscreenRendererEnvironment &inOther)
- : m_Width(inOther.m_Width)
- , m_Height(inOther.m_Height)
- , m_Format(inOther.m_Format)
- , m_Depth(inOther.m_Depth)
- , m_Stencil(inOther.m_Stencil)
- , m_MSAAMode(inOther.m_MSAAMode)
- {
- }
- };
-
- struct SOffscreenRenderFlags
- {
- bool m_HasTransparency;
- bool m_HasChangedSinceLastFrame;
- SOffscreenRenderFlags()
- : m_HasTransparency(false)
- , m_HasChangedSinceLastFrame(false)
- {
- }
-
- SOffscreenRenderFlags(bool transparency, bool hasChanged)
- : m_HasTransparency(transparency)
- , m_HasChangedSinceLastFrame(hasChanged)
- {
- }
- };
-
- typedef void *SRenderInstanceId;
-
- class IOffscreenRenderer : public NVRefCounted
- {
- public:
- class IOffscreenRendererCallback
- {
- public:
- virtual void onOffscreenRendererInitialized(const QString &id) = 0;
- virtual void onOffscreenRendererFrame(const QString &id) = 0;
- protected:
- virtual ~IOffscreenRendererCallback() {}
- };
-
- protected:
- virtual ~IOffscreenRenderer() {}
- public:
- virtual void addCallback(IOffscreenRendererCallback *cb) = 0;
- // Arbitrary const char* returned to indicate the type of this renderer
- // Can be overloaded to form the basis of an RTTI type system.
- // Not currently used by the rendering system.
- virtual CRegisteredString GetOffscreenRendererType() = 0;
- virtual SOffscreenRendererEnvironment
- GetDesiredEnvironment(QT3DSVec2 inPresentationScaleFactor) = 0;
- // Returns true of this object needs to be rendered, false if this object is not dirty
- virtual SOffscreenRenderFlags
- NeedsRender(const SOffscreenRendererEnvironment &inEnvironment,
- QT3DSVec2 inPresentationScaleFactor,
- const SRenderInstanceId instanceId) = 0;
- // Returns true if the rendered result image has transparency, or false
- // if it should be treated as a completely opaque image.
- // It is the IOffscreenRenderer's job to clear any buffers (color, depth, stencil) that it
- // needs to. It should not assume that it's buffers are clear;
- // Sometimes we scale the width and height of the main presentation in order to fit a
- // window.
- // If we do so, the scale factor tells the subpresentation renderer how much the system has
- // scaled.
- virtual void Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresentationScaleFactor,
- SScene::RenderClearCommand inColorBufferNeedsClear,
- const SRenderInstanceId instanceId) = 0;
- virtual void RenderWithClear(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresentationScaleFactor,
- SScene::RenderClearCommand inColorBufferNeedsClear,
- QT3DSVec4 inclearColor,
- const SRenderInstanceId instanceId) = 0;
-
- // Implementors should implement one of the two interfaces below.
-
- // If this renderer supports picking that can return graph objects
- // then return an interface here.
- virtual IGraphObjectPickQuery *GetGraphObjectPickQuery(const SRenderInstanceId instanceId) = 0;
-
- // If you *don't* support the GraphObjectPickIterator interface, then you should implement
- // this interface
- // The system will just ask you to pick.
- // If you return true, then we will assume that you swallowed the pick and will continue no
- // further.
- // else we will assume you did not and will continue the picking algorithm.
- virtual bool Pick(const QT3DSVec2 &inMouseCoords, const QT3DSVec2 &inViewportDimensions,
- const SRenderInstanceId instanceId) = 0;
- };
-
- struct SOffscreenRenderResult
- {
- NVScopedRefCounted<IOffscreenRenderer> m_Renderer;
- NVRenderTexture2D *m_Texture;
- bool m_HasTransparency;
- bool m_HasChangedSinceLastFrame;
-
- SOffscreenRenderResult(IOffscreenRenderer &inRenderer, NVRenderTexture2D &inTexture,
- bool inTrans, bool inDirty)
- : m_Renderer(&inRenderer)
- , m_Texture(&inTexture)
- , m_HasTransparency(inTrans)
- , m_HasChangedSinceLastFrame(inDirty)
- {
- }
- SOffscreenRenderResult()
- : m_Renderer(NULL)
- , m_Texture(NULL)
- , m_HasTransparency(false)
- , m_HasChangedSinceLastFrame(false)
- {
- }
- };
-
- struct SOffscreenRendererKey;
-
- /**
- * The offscreen render manager attempts to satisfy requests for a given image under a given
- *key.
- * Renderers are throttled such that they render at most once per frame and potentially less
- *than
- * that if they don't require a new render.
- */
- class IOffscreenRenderManager : public NVRefCounted
- {
- protected:
- virtual ~IOffscreenRenderManager() {}
- public:
- // returns true if the renderer has not been registered.
- // No return value means there was an error registering this id.
- virtual Option<bool> MaybeRegisterOffscreenRenderer(const SOffscreenRendererKey &inKey,
- IOffscreenRenderer &inRenderer) = 0;
- virtual void RegisterOffscreenRenderer(const SOffscreenRendererKey &inKey,
- IOffscreenRenderer &inRenderer) = 0;
- virtual bool HasOffscreenRenderer(const SOffscreenRendererKey &inKey) = 0;
- virtual IOffscreenRenderer *GetOffscreenRenderer(const SOffscreenRendererKey &inKey) = 0;
- virtual void ReleaseOffscreenRenderer(const SOffscreenRendererKey &inKey) = 0;
-
- // This doesn't trigger rendering right away. A node is added to the render graph that
- // points to this item.
- // Thus rendering is deffered until the graph is run but we promise to render to this
- // resource.
- virtual SOffscreenRenderResult GetRenderedItem(const SOffscreenRendererKey &inKey) = 0;
- // Called by the UICRenderContext, clients don't need to call this.
- virtual void BeginFrame() = 0;
- virtual void EndFrame() = 0;
-
- static IOffscreenRenderManager &
- CreateOffscreenRenderManager(NVAllocatorCallback &inCallback, IStringTable &inStringTable,
- IResourceManager &inManager, IQt3DSRenderContext &inContext);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.cpp
deleted file mode 100644
index 4028373b..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSOldNBustedRenderPlugin.h"
-#include "SystemPrefix.h"
-#include "Qt3DSDLLManager.h"
-#include "render/Qt3DSRenderContext.h"
-
-#ifdef WIN32
-#pragma warning(disable : 4355) // this used in initializer list. I have never seen this result in
- // a physical error
-#endif
-
-namespace qt3ds {
-namespace render {
-
- COldNBustedPluginRenderer::COldNBustedPluginRenderer(IQt3DSRenderContext &inRenderContext,
- long inDLLHandle)
- : m_RenderContext(inRenderContext)
- , m_DLLHandle(inDLLHandle)
- , mRefCount(0)
- , m_OffscreenRendererType(inRenderContext.GetStringTable().RegisterStr(GetRendererName()))
- {
- if (m_DLLHandle != -1) {
- Q3DStudio::CDLLManager &theManager = Q3DStudio::CDLLManager::GetDLLManager();
-
- // Grab function procs
- m_GetTextureSizeProc = reinterpret_cast<PROC_GetDesiredTextureSize>(
- theManager.GetProc("GetDesiredTextureSize", m_DLLHandle));
- Q3DStudio_ASSERT(m_GetTextureSizeProc);
-
- m_RenderProc = reinterpret_cast<PROC_Render>(theManager.GetProc("Render", m_DLLHandle));
- Q3DStudio_ASSERT(m_RenderProc);
- }
- }
-
- NVRenderTextureFormats::Enum convertTextureFormat(ETEXTUREFORMAT fmt)
- {
- NVRenderTextureFormats::Enum ret = NVRenderTextureFormats::RGBA8;
- switch (fmt) {
-
- case ETEXTUREFORMAT_RGBA8:
- break;
-
- case ETEXTUREFORMAT_RGB8:
- ret = NVRenderTextureFormats::RGB8;
- break;
-
- default:
- break;
-
- }
- return ret;
- }
-
- SOffscreenRendererEnvironment
- COldNBustedPluginRenderer::GetDesiredEnvironment(QT3DSVec2 inPresScale)
- {
- long width, height;
- ETEXTUREFORMAT format;
-
- m_GetTextureSizeProc(&width, &height, &format);
-
- return SOffscreenRendererEnvironment(
- (QT3DSU32)(width * inPresScale.x), (QT3DSU32)(height * inPresScale.y),
- convertTextureFormat(format), OffscreenRendererDepthValues::Depth24, false,
- AAModeValues::NoAA);
- }
-
- SOffscreenRenderFlags
- COldNBustedPluginRenderer::NeedsRender(const SOffscreenRendererEnvironment & /*inEnvironment*/,
- QT3DSVec2 /*inPresScale*/,
- const SRenderInstanceId)
- {
- return SOffscreenRenderFlags(true, true);
- }
-
- // Returns true if the rendered result image has transparency, or false
- // if it should be treated as a completely opaque image.
- void COldNBustedPluginRenderer::Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 /*inPresScale*/,
- SScene::RenderClearCommand /*inClearColorBuffer*/,
- const SRenderInstanceId)
- {
- inRenderContext.PushPropertySet();
-
- m_RenderProc(inEnvironment.m_Width, inEnvironment.m_Height, 1);
-
- inRenderContext.PopPropertySet(true);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.h
deleted file mode 100644
index 2753bac6..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOldNBustedRenderPlugin.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_OLD_N_BUSTED_RENDER_PLUGIN_H
-#define QT3DS_OLD_N_BUSTED_RENDER_PLUGIN_H
-
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSRenderContextCore.h"
-#include "foundation/Qt3DSVec4.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "Qt3DSPluginDLL.h"
-
-namespace qt3ds {
-namespace render {
-
- class COldNBustedPluginRenderer;
-
- class COldNBustedPluginRenderer : public IOffscreenRenderer
- {
- public:
- IQt3DSRenderContext &m_RenderContext;
- long m_DLLHandle;
- volatile QT3DSI32 mRefCount;
- SOffscreenRendererEnvironment m_LastRenderedEnvironment;
- CRegisteredString m_OffscreenRendererType;
-
- PROC_GetDesiredTextureSize m_GetTextureSizeProc;
- PROC_Render m_RenderProc;
-
- COldNBustedPluginRenderer(IQt3DSRenderContext &inRenderContext, long inDLLHandle);
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext.GetAllocator())
-
- SOffscreenRendererEnvironment GetDesiredEnvironment(QT3DSVec2 inPresScale) override;
- virtual SOffscreenRenderFlags
- NeedsRender(const SOffscreenRendererEnvironment &inEnvironment, QT3DSVec2 inPresScale,
- const SRenderInstanceId instanceId) override;
- void Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext & /*inRenderContext*/,
- QT3DSVec2 inPresScale, SScene::RenderClearCommand inClearBuffer,
- const SRenderInstanceId instanceId) override;
- void RenderWithClear(const SOffscreenRendererEnvironment &/*inEnvironment*/,
- NVRenderContext &/*inRenderContext*/,
- QT3DSVec2 /*inPresentationScaleFactor*/,
- SScene::RenderClearCommand /*inColorBufferNeedsClear*/,
- QT3DSVec4 /*inclearColor*/,
- const SRenderInstanceId /*instanceId*/) override {}
- IGraphObjectPickQuery *GetGraphObjectPickQuery(const SRenderInstanceId instanceId) override
- {
- Q_UNUSED(instanceId);
- return NULL;
- }
- bool Pick(const QT3DSVec2 & /*inMouseCoords*/, const QT3DSVec2 & /*inViewportDimensions*/,
- const SRenderInstanceId instanceId) override
- {
- Q_UNUSED(instanceId);
- return false;
- }
- void addCallback(IOffscreenRendererCallback *cb) override
- {
-
- }
- // Used for RTTI purposes so we can safely static-cast an offscreen renderer to a
- // CPluginRenderer
- static const char *GetRendererName() { return "Plugin"; }
- CRegisteredString GetOffscreenRendererType() override { return m_OffscreenRendererType; }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp
deleted file mode 100644
index 4b74c511..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#define QT3DS_RENDER_ONSCREEN_TEXT
-#ifdef QT3DS_RENDER_ONSCREEN_TEXT
-
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderTextureAtlas.h"
-
-#include "EASTL/string.h"
-#include "EASTL/hash_set.h"
-
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/StrConvertUTF.h"
-
-#include "render/Qt3DSRenderContext.h"
-
-#include <QtGui/qpainter.h>
-#include <QtGui/qimage.h>
-#include <QtGui/qrawfont.h>
-#include <QtCore/qfile.h>
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct STextureAtlasFontEntry
-{
- STextureAtlasFontEntry()
- : m_x(0)
- , m_y(0)
- , m_width(0)
- , m_height(0)
- , m_xOffset(0)
- , m_yOffset(0)
- , m_advance(0)
- , m_s(0)
- , m_t(0)
- , m_s1(0)
- , m_t1(0)
- {
- }
-
- STextureAtlasFontEntry(float x, float y, float width, float height, float xoffset,
- float yoffset, float advance, float s, float t, float s1, float t1)
- : m_x(x)
- , m_y(y)
- , m_width(width)
- , m_height(height)
- , m_xOffset(xoffset)
- , m_yOffset(yoffset)
- , m_advance(advance)
- , m_s(s)
- , m_t(t)
- , m_s1(s1)
- , m_t1(t1)
- {
- }
-
- QT3DSF32 m_x;
- QT3DSF32 m_y;
- QT3DSF32 m_width;
- QT3DSF32 m_height;
- QT3DSF32 m_xOffset;
- QT3DSF32 m_yOffset;
- QT3DSF32 m_advance;
-
- QT3DSF32 m_s;
- QT3DSF32 m_t;
- QT3DSF32 m_s1;
- QT3DSF32 m_t1;
-};
-
-typedef eastl::basic_string<char8_t, ForwardingAllocator> TStrType;
-typedef nvhash_map<wchar_t, STextureAtlasFontEntry> TTextureAtlasMap;
-
-struct STextAtlasFont
-{
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- QT3DSU32 m_FontSize;
- TTextureAtlasMap m_AtlasEntries; ///< our entries in the atlas
-
- STextAtlasFont(NVFoundationBase &inFoundation, QT3DSU32 fontSize)
- : m_Foundation(inFoundation)
- , mRefCount(0)
- , m_FontSize(fontSize)
- , m_AtlasEntries(inFoundation.getAllocator(),
- "Qt3DSOnscreenRenderer::STextAtlasFont::m_AtlasEntrys")
- {
- }
-
- ~STextAtlasFont() { m_AtlasEntries.clear(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- static STextAtlasFont &CreateTextureAtlasFont(NVFoundationBase &inFnd, QT3DSU32 fontSize)
- {
- return *QT3DS_NEW(inFnd.getAllocator(), STextAtlasFont)(inFnd, fontSize);
- }
-};
-
-// This class is only for rendering 2D screen aligned text
-// it uses a predefined true type font and character set with various sizes
-struct Qt3DSOnscreenTextRenderer : public ITextRenderer
-{
-
- static const QT3DSI32 TEXTURE_ATLAS_DIM =
- 256; // if you change this you need to adjust STextTextureAtlas size as well
-
-private:
- NVFoundationBase &m_Foundation;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- volatile QT3DSI32 mRefCount;
- bool m_TextureAtlasInitialized; ///< true if atlas is setup
- NVScopedRefCounted<ITextureAtlas> m_TextTextureAtlas;
- NVScopedRefCounted<STextAtlasFont> m_TextFont;
- QRawFont *m_font;
-public:
- Qt3DSOnscreenTextRenderer(NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , mRefCount(0)
- , m_TextureAtlasInitialized(false)
- , m_font(nullptr)
- {
- }
-
- virtual ~Qt3DSOnscreenTextRenderer()
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- void AddSystemFontDirectory(const char8_t *) override {}
-
- virtual void AddProjectFontDirectory(CRegisteredString)
- {
- // We always render using the default font with on-screen renderer,
- // so no need to care about font directories
- }
-
- void AddProjectFontDirectory(const char8_t *inProjectDirectory) override
- {
- if (m_RenderContext)
- AddProjectFontDirectory(
- m_RenderContext->GetStringTable().RegisterStr(inProjectDirectory));
- }
-
- void loadFont()
- {
- // Ensure font. We can only render text of single size at the moment.
- // Add a size map of fonts if it ever becomes necessary to render multiple font sizes.
- if (!m_font)
- m_font = new QRawFont(QStringLiteral(":res/Font/TitilliumWeb-Regular.ttf"), 20.0);
-
- // setup texture atlas
- m_TextTextureAtlas =
- ITextureAtlas::CreateTextureAtlas(m_RenderContext->GetFoundation(), *m_RenderContext,
- TEXTURE_ATLAS_DIM, TEXTURE_ATLAS_DIM);
-
- // our list of predefined cached characters
- QString cache = QStringLiteral(" !\"#$%&'()*+,-./0123456789:;<=>?"
- "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
- "`abcdefghijklmnopqrstuvwxyz{|}~");
-
- m_TextFont = STextAtlasFont::CreateTextureAtlasFont(m_Foundation, 20);
- CreateTextureAtlasEntries(m_font, *m_TextFont, cache);
- m_TextureAtlasInitialized = true;
- }
-
- void CreateTextureAtlasEntries(QRawFont *rawFont, STextAtlasFont &font, const QString &cache)
- {
- if (m_TextureAtlasInitialized || !m_TextTextureAtlas || !rawFont)
- return;
-
- STextureAtlasRect theAtlasRect;
-
- QVector<quint32> glyphIndices = rawFont->glyphIndexesForString(cache);
- QVector<QPointF> glyphAdvances = rawFont->advancesForGlyphIndexes(glyphIndices);
-
- for (int i = 0; i < glyphIndices.size(); i++) {
- quint32 index = glyphIndices[i];
- QImage glyphImage;
-
- // blank char is not contained in a true type font
- if (cache.at(i) != QChar(' '))
- glyphImage = rawFont->alphaMapForGlyph(index, QRawFont::PixelAntialiasing);
-
- QRectF rect = rawFont->boundingRect(index);
- NVConstDataRef<QT3DSU8> bufferData(static_cast<const QT3DSU8 *>(glyphImage.bits()),
- glyphImage.byteCount());
-
- theAtlasRect = m_TextTextureAtlas->AddAtlasEntry(
- glyphImage.width(), glyphImage.height(),
- glyphImage.bytesPerLine(), glyphImage.width(), bufferData);
-
- if (theAtlasRect.m_Width != 0) {
- font.m_AtlasEntries.insert(
- eastl::make_pair(
- cache.at(i).unicode(), STextureAtlasFontEntry(
- (QT3DSF32)theAtlasRect.m_X, (QT3DSF32)theAtlasRect.m_Y,
- (QT3DSF32)theAtlasRect.m_Width, (QT3DSF32)theAtlasRect.m_Height,
- (QT3DSF32)rect.x(), (QT3DSF32)(0.0 - rect.height() - rect.y()),
- glyphAdvances[i].x(),
- theAtlasRect.m_NormX, theAtlasRect.m_NormY,
- theAtlasRect.m_NormX + theAtlasRect.m_NormWidth,
- theAtlasRect.m_NormY + theAtlasRect.m_NormHeight)));
- }
- }
- }
-
- void ClearProjectFontDirectories() override {}
-
- ITextRenderer &GetTextRenderer(NVRenderContext &inRenderContext) override
- {
- m_RenderContext = inRenderContext;
- return *this;
- }
-
- void PreloadFonts() override {}
- void ReloadFonts() override {}
-
- // unused
- NVConstDataRef<SRendererFontEntry> GetProjectFontList() override
- {
- Q_ASSERT(false);
- return NVConstDataRef<SRendererFontEntry>();
- }
-
- // unused
- Option<CRegisteredString> GetFontNameForFont(CRegisteredString) override
- {
- Q_ASSERT(false);
- return Empty();
- }
-
- // unused
- Option<CRegisteredString> GetFontNameForFont(const char8_t *) override
- {
- Q_ASSERT(false);
- return Empty();
- }
-
- // unused
- STextDimensions MeasureText(const STextRenderInfo &, QT3DSF32, const char8_t *) override
- {
- Q_ASSERT(false);
- return STextDimensions(0, 0);
- }
-
- // unused
- STextTextureDetails RenderText(const STextRenderInfo &, NVRenderTexture2D &) override
- {
- QT3DS_ASSERT(false);
- return STextTextureDetails();
- }
-
- // unused
- STextTextureDetails RenderText(const STextRenderInfo &, NVRenderPathFontItem &,
- NVRenderPathFontSpecification &) override
- {
- QT3DS_ASSERT(false);
- return STextTextureDetails();
- }
-
- SRenderTextureAtlasDetails RenderText(const STextRenderInfo &inText) override
- {
- qt3ds::foundation::IStringTable &theStringTable(m_RenderContext->GetStringTable());
-
- const wchar_t *wText = theStringTable.GetWideStr(inText.m_Text);
- QT3DSU32 length = (QT3DSU32)wcslen(wText);
-
- if (length) {
- STextAtlasFont *pFont = m_TextFont;
- const STextureAtlasFontEntry *pEntry;
- QT3DSF32 x1, y1, x2, y2;
- QT3DSF32 s, t, s1, t1;
- QT3DSF32 advance = 0.0;
- // allocate buffer for all the vertex data we need
- // we construct triangles here
- // which means character count x 6 vertices x 5 floats
- QT3DSF32 *vertexData =
- (QT3DSF32 *)QT3DS_ALLOC(m_Foundation.getAllocator(),
- length * 6 * 5 * sizeof(QT3DSF32),
- "Qt3DSOnscreenTextRenderer");
- QT3DSF32 *bufPtr = vertexData;
- if (vertexData) {
- for (size_t i = 0; i < length; ++i) {
- pEntry = &pFont->m_AtlasEntries.find(wText[i])->second;
-
- if (pEntry) {
- x1 = advance + pEntry->m_xOffset;
- x2 = x1 + pEntry->m_width * inText.m_ScaleX;
- y1 = pEntry->m_yOffset;
- y2 = y1 + pEntry->m_height * inText.m_ScaleY;
-
- s = pEntry->m_s;
- s1 = pEntry->m_s1;
- t = pEntry->m_t;
- t1 = pEntry->m_t1;
- // store vertex data
- bufPtr[0] = x1;
- bufPtr[1] = y1;
- bufPtr[2] = 0.0;
- bufPtr[3] = s;
- bufPtr[4] = t;
- bufPtr[5] = x2;
- bufPtr[6] = y1;
- bufPtr[7] = 0.0;
- bufPtr[8] = s1;
- bufPtr[9] = t;
- bufPtr[10] = x2;
- bufPtr[11] = y2;
- bufPtr[12] = 0.0;
- bufPtr[13] = s1;
- bufPtr[14] = t1;
-
- bufPtr[15] = x1;
- bufPtr[16] = y1;
- bufPtr[17] = 0.0;
- bufPtr[18] = s;
- bufPtr[19] = t;
- bufPtr[20] = x2;
- bufPtr[21] = y2;
- bufPtr[22] = 0.0;
- bufPtr[23] = s1;
- bufPtr[24] = t1;
- bufPtr[25] = x1;
- bufPtr[26] = y2;
- bufPtr[27] = 0.0;
- bufPtr[28] = s;
- bufPtr[29] = t1;
-
- advance += pEntry->m_advance * inText.m_ScaleX;
-
- bufPtr += 30;
- }
- }
-
- m_TextTextureAtlas->RelaseEntries();
-
- return SRenderTextureAtlasDetails(length * 6,
- toU8DataRef(vertexData, length * 6 * 5));
- }
- }
-
- return SRenderTextureAtlasDetails();
- }
-
- STextTextureAtlasEntryDetails RenderAtlasEntry(QT3DSU32 index,
- NVRenderTexture2D &inTexture) override
- {
- if (m_TextTextureAtlas) {
- TTextureAtlasEntryAndBuffer theEntry = m_TextTextureAtlas->GetAtlasEntryByIndex(index);
- if (theEntry.first.m_Width) {
- inTexture.SetTextureData(theEntry.second, 0, theEntry.first.m_Width,
- theEntry.first.m_Height, NVRenderTextureFormats::Alpha8);
- inTexture.SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- inTexture.SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- inTexture.SetTextureWrapS(qt3ds::render::NVRenderTextureCoordOp::ClampToEdge);
- inTexture.SetTextureWrapT(qt3ds::render::NVRenderTextureCoordOp::ClampToEdge);
- STextureDetails theTextureDetails = inTexture.GetTextureDetails();
- return STextTextureAtlasEntryDetails(theTextureDetails.m_Width,
- theTextureDetails.m_Height, theEntry.first.m_X,
- theEntry.first.m_Y);
- }
- }
-
- return STextTextureAtlasEntryDetails();
- }
- QT3DSI32 CreateTextureAtlas() override
- {
- loadFont();
-
- QT3DSI32 count = 0;
- if (m_TextTextureAtlas)
- count = m_TextTextureAtlas->GetAtlasEntryCount();
-
- return count;
- }
-
- void BeginFrame() override {}
- void EndFrame() override {}
- void BeginPreloadFonts(IThreadPool &, IPerfTimer &) override {}
- void EndPreloadFonts() override {}
-};
-}
-
-ITextRendererCore &ITextRendererCore::CreateOnscreenTextRenderer(NVFoundationBase &inFnd)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), Qt3DSOnscreenTextRenderer)(inFnd);
-}
-
-#endif // QT3DS_RENDER_ONSCREEN_TEXT
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSQtTextRenderer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSQtTextRenderer.cpp
deleted file mode 100644
index 029ccea2..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSQtTextRenderer.cpp
+++ /dev/null
@@ -1,655 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderText.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/FileTools.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderThreadPool.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "EASTL/set.h"
-#include "EASTL/list.h"
-
-#include <QPainter>
-#include <QImage>
-#include <QFontDatabase>
-#include <QDir>
-#include <QDebug>
-#include <QHash>
-#include <QGuiApplication>
-#include <QtMath>
-#include <QRawFont>
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct Qt3DSQtTextRenderer : public ITextRenderer
-{
- struct FontInfo
- {
- QString fontFileName;
- QString fontName;
- QString fontFamily;
- int fontId;
- QFont font;
-
- FontInfo() :
- fontId(-1)
- {}
-
- FontInfo(const QString &fileName, const QString &name, const QString &family, int id) :
- fontFileName(fileName)
- , fontName(name)
- , fontFamily(family)
- , fontId(id)
- {
- font.setFamily(fontFamily);
- }
-
- FontInfo(const FontInfo &other) :
- fontFileName(other.fontFileName)
- , fontName(other.fontName)
- , fontFamily(other.fontFamily)
- , fontId(other.fontId)
- , font(other.font)
- {}
-
- FontInfo &operator=(const FontInfo &other)
- {
- fontFileName = other.fontFileName;
- fontName = other.fontName;
- fontFamily = other.fontFamily;
- fontId = other.fontId;
- font = other.font;
-
- return *this;
- }
- };
-
- typedef eastl::string TStrType;
- typedef eastl::set<TStrType> TStringSet;
- typedef QHash<QString, FontInfo> TFontInfoHash;
-
- NVFoundationBase &m_foundation;
- NVScopedRefCounted<IStringTable> m_stringTable;
- NVScopedRefCounted<NVRenderContext> m_renderContext;
- NVScopedRefCounted<IPerfTimer> m_perfTimer;
- volatile QT3DSI32 mRefCount;
- nvvector<SRendererFontEntry> m_installedFonts;
-
- Sync m_PreloadSync;
-
- TStringSet m_systemFontDirs;
- TStringSet m_projectFontDirs;
- TFontInfoHash m_projectFontInfos;
- TFontInfoHash m_systemFontInfos;
- TStrType m_workspace;
-
- bool m_systemFontsInitialized;
- bool m_projectFontsInitialized;
- bool m_PreloadingFonts;
-
- QStringList m_nameFilters;
- qreal m_pixelRatio;
-
- Qt3DSQtTextRenderer(NVFoundationBase &inFoundation, IStringTable &inStrTable)
- : m_foundation(inFoundation)
- , m_stringTable(inStrTable)
- , mRefCount(0)
- , m_installedFonts(inFoundation.getAllocator(), "Qt3DSQtTextRenderer::m_installedFonts")
- , m_PreloadSync(inFoundation.getAllocator())
- , m_systemFontsInitialized(false)
- , m_projectFontsInitialized(false)
- , m_PreloadingFonts(false)
- , m_pixelRatio(1.0)
- {
- const QWindowList list = QGuiApplication::topLevelWindows();
- if (list.size() > 0)
- m_pixelRatio = list[0]->devicePixelRatio();
-
- m_nameFilters << QStringLiteral("*.ttf");
- m_nameFilters << QStringLiteral("*.otf");
- }
- virtual ~Qt3DSQtTextRenderer()
- {
- QFontDatabase::removeAllApplicationFonts();
- }
-
- QString stringToQString(const CRegisteredString &str)
- {
- return QString::fromUtf8(str.c_str());
- }
-
- QString stringToQString(const eastl::string &str)
- {
- return QString::fromUtf8(str.c_str());
- }
-
- QString stringToQString(const char8_t *str)
- {
- return QString::fromUtf8(str);
- }
-
- CRegisteredString QStringToRegisteredString(const QString &str)
- {
- return m_stringTable->RegisterStr(str.toUtf8().constData());
- }
-
- void unregisterProjectFonts()
- {
- for (FontInfo &fi : m_projectFontInfos.values())
- QFontDatabase::removeApplicationFont(fi.fontId);
- m_projectFontsInitialized = false;
- m_installedFonts.clear();
- m_projectFontInfos.clear();
- }
-
- QString getFileStem(const QString &fileName)
- {
- QString retVal;
- int dotPos = fileName.lastIndexOf(QChar('.'));
- if (dotPos < 0)
- return retVal;
- int slashPos = fileName.lastIndexOf(QChar('/'));
- retVal = fileName.mid(slashPos + 1);
- retVal.chop(fileName.length() - dotPos);
- return retVal;
- }
-
- void registerFonts(TStringSet dirSet, TFontInfoHash *fontInfos = nullptr)
- {
- for (TStringSet::const_iterator theIter = dirSet.begin(),
- theEnd = dirSet.end();
- theIter != theEnd; ++theIter) {
- QString localDir = CFileTools::NormalizePathForQtUsage(stringToQString(*theIter));
- QDir dir(localDir);
- if (!dir.exists()) {
- qWarning("Attempted to register invalid font directory: %s",
- qPrintable(localDir));
- continue;
- }
- QStringList entryList = dir.entryList(m_nameFilters);
- for (QString entry : entryList) {
- entry = dir.absoluteFilePath(entry);
- QFile file(entry);
- if (file.open(QIODevice::ReadOnly)) {
- QByteArray rawData = file.readAll();
- int fontId = QFontDatabase::addApplicationFontFromData(rawData);
- if (fontId < 0) {
- qCWarning(WARNING, "Failed to register font: %s",
- entry.toStdString().c_str());
- } else if (fontInfos) {
- QString fontName = getFileStem(entry);
- QString fontFamily;
- QStringList families = QFontDatabase::applicationFontFamilies(fontId);
- if (families.size() > 0)
- fontFamily = families.at(0);
- FontInfo fi(entry, fontName, fontFamily, fontId);
- // Detect font style and weight using a dummy QRawFont
- QRawFont rawFont(rawData, 16);
- if (rawFont.isValid()) {
- if (rawFont.style() != QFont::StyleOblique) {
- fi.font.setStyle(rawFont.style());
- fi.font.setWeight(rawFont.weight());
- }
- } else {
- qCWarning(WARNING, "Failed to determine font style: %s",
- entry.toStdString().c_str());
- }
- fontInfos->insert(fontName, fi);
- }
- } else {
- qCWarning(WARNING, "Failed to load font: %s",
- entry.toStdString().c_str());
- }
- }
- }
- }
-
- void projectCleanup()
- {
- m_projectFontsInitialized = false;
- unregisterProjectFonts();
- m_projectFontDirs.clear();
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_foundation.getAllocator())
-
- eastl::pair<TStrType, bool> AddFontDirectory(const TStrType &inDirectory, TStringSet &inDirSet)
- {
- if (inDirectory.empty()) {
- m_workspace.assign("./");
- } else {
- m_workspace.clear();
- for (const char8_t *item = inDirectory.c_str(); item && *item; ++item) {
- if (*item == '\\')
- m_workspace.append(1, '/');
- else
- m_workspace.append(1, static_cast<char8_t>(*item));
- }
- if (m_workspace.back() != '/')
- m_workspace.append(1, '/');
- }
-
- return eastl::make_pair(m_workspace, inDirSet.insert(m_workspace).second);
- }
-
- // You can have several standard font directories and these will be persistent
- void AddSystemFontDirectory(const char8_t *inDirectory) override
- {
- AddFontDirectory(inDirectory, m_systemFontDirs);
- }
-
- void AddProjectFontDirectory(const char8_t *inProjectDirectory) override
- {
- eastl::pair<TStrType, bool> theAddResult =
- AddFontDirectory(inProjectDirectory, m_projectFontDirs);
- if (theAddResult.second && m_projectFontsInitialized)
- ReloadFonts();
- }
-
- void ReloadFonts() override
- {
- unregisterProjectFonts();
- PreloadFonts();
- }
-
- void PreloadFonts() override
- {
- if (!m_systemFontsInitialized) {
- m_systemFontsInitialized = true;
- registerFonts(m_systemFontDirs, &m_systemFontInfos);
- }
-
- if (!m_projectFontsInitialized) {
- m_projectFontsInitialized = true;
- registerFonts(m_projectFontDirs, &m_projectFontInfos);
- }
- }
-
- void ClearProjectFontDirectories() override
- {
- projectCleanup();
- }
-
- static void PreloadThreadCallback(void *inData)
- {
- Qt3DSQtTextRenderer *theRenderer(reinterpret_cast<Qt3DSQtTextRenderer *>(inData));
- theRenderer->PreloadFonts();
- theRenderer->m_PreloadSync.set();
- }
-
- void BeginPreloadFonts(IThreadPool &inThreadPool, IPerfTimer &inTimer) override
- {
- m_PreloadingFonts = true;
-
- m_PreloadSync.reset();
- m_perfTimer = inTimer;
-
- inThreadPool.AddTask(this, PreloadThreadCallback, NULL);
- }
-
- void EndPreloadFonts() override
- {
- if (m_PreloadingFonts) {
- {
- SStackPerfTimer __perfTimer(*m_perfTimer, "QtText: Wait till font preloading completed");
- m_PreloadSync.wait();
- }
- }
- m_PreloadingFonts = false;
- }
-
- // Get the list of project fonts. These are the only fonts that can be displayed.
- NVConstDataRef<SRendererFontEntry> GetProjectFontList() override
- {
- PreloadFonts();
- if (m_installedFonts.empty()) {
- m_installedFonts.reserve(m_projectFontInfos.size());
- for (FontInfo &fi : m_projectFontInfos.values()) {
- m_installedFonts.push_back(SRendererFontEntry(
- fi.fontName,
- fi.fontFileName));
- }
-
- }
- return m_installedFonts;
- }
-
- Option<CRegisteredString> GetFontNameForFont(CRegisteredString inFontname) override
- {
- // This function is there to support legacy font names.
-
- QString inStr = stringToQString(inFontname);
- if (m_projectFontInfos.keys().contains(inStr))
- return inFontname;
-
- // Fall back for family name detection if not found by font name
- for (FontInfo &fi : m_projectFontInfos.values()) {
- if (inStr == fi.fontFamily)
- return QStringToRegisteredString(fi.fontName);
- }
-
- return Empty();
- }
-
- Option<CRegisteredString> GetFontNameForFont(const char8_t *inFontname) override
- {
- return GetFontNameForFont(m_stringTable->RegisterStr(inFontname));
- }
-
- ITextRenderer &GetTextRenderer(NVRenderContext &inRenderContext) override
- {
- m_renderContext = inRenderContext;
- return *this;
- }
-
- FontInfo &fontInfoForName(const CRegisteredString &fontName)
- {
- PreloadFonts();
- QString qtFontName = stringToQString(fontName);
- if (m_projectFontInfos.contains(qtFontName))
- return m_projectFontInfos[qtFontName];
-
- if (m_systemFontInfos.contains(qtFontName))
- return m_systemFontInfos[qtFontName];
-
- // Unknown font, create a system font for it
- FontInfo fi("", qtFontName, qtFontName, -1);
- m_systemFontInfos.insert(qtFontName, fi);
-
- return m_systemFontInfos[qtFontName];
- }
-
- void updateFontInfo(FontInfo &fi, const STextRenderInfo &inText,
- QT3DSF32 inTextScaleFactor = 1.0f)
- {
- qreal pixelSize = inText.m_FontSize;
- fi.font.setPixelSize(pixelSize * inTextScaleFactor);
- fi.font.setLetterSpacing(QFont::AbsoluteSpacing, qreal(inText.m_Tracking));
- }
-
- QStringList splitText(const char8_t *theText)
- {
- // Split the text into lines
- int lines = 1;
- int lineLen = 0;
- QStringList lineList;
- const char8_t *lineStartItem = nullptr;
- for (const char8_t *item = theText; item && *item; ++item) {
- if (!lineLen)
- lineStartItem = item;
- ++lineLen;
- if (*item == '\n') {
- int chopAmount = 1;
- if (lineLen > 1 && *(item - 1) == '\r')
- ++chopAmount;
-
- ++lines;
- lineList.append(QString::fromUtf8(lineStartItem, lineLen - chopAmount));
- lineLen = 0;
- }
- }
- if (lineStartItem)
- lineList.append(QString::fromUtf8(lineStartItem, lineLen));
-
- return lineList;
- }
-
- QRectF textBoundingBox(const STextRenderInfo &inText,
- const QFontMetricsF &fm, QStringList &lineList,
- QVector<qreal> &lineWidths, const char8_t *inTextOverride = nullptr)
- {
- const char8_t *theText = inTextOverride ? inTextOverride : inText.m_Text.c_str();
- lineList = splitText(theText);
-
- QRectF boundingBox;
- boundingBox.setHeight(lineList.size() * fm.height() + qCeil(qreal(lineList.size() - 1) * qreal(inText.m_Leading)));
-
- lineWidths.resize(lineList.size());
-
- for (int i = 0; i < lineList.size(); ++i) {
- // For italicized fonts the bounding box right is the correct method
- // to measure since the left offset may extend, but for
- // non-italicized fonts we need the width method to meausure
- // otherwise the resultant text will be clipped.
- QString line = lineList.at(i);
- qreal width = fm.width(line);
- qreal right = fm.boundingRect(line).right();
- // For hdpi displays, fontmetrics doesn't always calculate enough space for fonts, so
- // we add the pixel ratio to all widths to avoid clipping
- qreal lineWidth = qMax(width, right) + m_pixelRatio;
- lineWidths[i] = lineWidth;
- if (boundingBox.width() < lineWidth)
- boundingBox.setWidth(lineWidth);
- }
-
- // We don't want extra letter spacing on the last glyph, so let's remove it
- boundingBox.setRight(qMax(boundingBox.left(), boundingBox.right() - qFloor(inText.m_Tracking)));
-
- return boundingBox;
- }
-
- STextDimensions MeasureText(const STextRenderInfo &inText, QT3DSF32 inTextScaleFactor,
- const char8_t *inTextOverride) override
- {
- FontInfo &fi = fontInfoForName(inText.m_Font);
- updateFontInfo(fi, inText, inTextScaleFactor);
- QFontMetricsF fm(fi.font);
- QStringList dummyList;
- QVector<qreal> dummyWidth;
- QRectF boundingBox = textBoundingBox(inText, fm, dummyList, dummyWidth, inTextOverride);
- return STextDimensions(boundingBox.width(), boundingBox.height());
- }
-
- int alignToQtAlign(TextVerticalAlignment::Enum va)
- {
- int qtAlign(0);
- switch (va) {
- case TextVerticalAlignment::Top:
- qtAlign = Qt::AlignTop;
- break;
- case TextVerticalAlignment::Bottom:
- qtAlign = Qt::AlignBottom;
- break;
- default:
- qtAlign = Qt::AlignVCenter;
- }
-
- return qtAlign;
- }
-
- STextTextureDetails RenderText(const STextRenderInfo &inSrcText,
- NVRenderTexture2D &inTexture) override
- {
- FontInfo &fi = fontInfoForName(inSrcText.m_Font);
- updateFontInfo(fi, inSrcText);
- QFontMetricsF fm(fi.font);
- int horizontalAlignmentFlag = Qt::AlignLeft;
-
- int shadowRgb = int(2.55f * (100 - int(inSrcText.m_DropShadowStrength)));
- QStringList lineList;
- QVector<qreal> lineWidths;
- QRectF boundingBox;
- const bool dynamicTextArea = inSrcText.m_BoundingBox.isZero();
-
- if (dynamicTextArea) {
- boundingBox = textBoundingBox(inSrcText, fm, lineList, lineWidths);
- } else {
- lineList << inSrcText.m_Text.c_str();
- lineWidths << inSrcText.m_BoundingBox.x;
- boundingBox = QRectF(0, 0, inSrcText.m_BoundingBox.x, inSrcText.m_BoundingBox.y);
- }
-
- if (boundingBox.width() <= 0 || boundingBox.height() <= 0) {
- return ITextRenderer::UploadData(toU8DataRef((char *)nullptr, 0), inTexture, 4, 4,
- 0, 0,
- NVRenderTextureFormats::RGBA8, true);
- }
-
- int finalWidth = NextMultipleOf4(boundingBox.width());
- int finalHeight = NextMultipleOf4(boundingBox.height());
-
- QImage image(finalWidth, finalHeight, QImage::Format_ARGB32);
- image.fill(0);
- QPainter painter(&image);
- painter.setPen(Qt::white);
- painter.setFont(fi.font);
-
- // Translate painter to remove the extra spacing of the last letter
- qreal tracking = 0.0;
- switch (inSrcText.m_HorizontalAlignment) {
- case TextHorizontalAlignment::Center:
- horizontalAlignmentFlag = Qt::AlignHCenter;
- tracking += qreal(inSrcText.m_Tracking / 2.0f);
- break;
- case TextHorizontalAlignment::Right:
- horizontalAlignmentFlag = Qt::AlignRight;
- tracking += qreal(inSrcText.m_Tracking);
- break;
- default:
- break; // Do nothing
- }
-
- int wordWrapFlags = 0;
- if (dynamicTextArea) {
- wordWrapFlags = Qt::TextDontClip;
- } else {
- switch (inSrcText.m_WordWrap) {
- case TextWordWrap::WrapWord:
- wordWrapFlags = Qt::TextWordWrap | Qt::TextDontClip;
- break;
- case TextWordWrap::WrapAnywhere:
- wordWrapFlags = Qt::TextWrapAnywhere | Qt::TextDontClip;
- break;
- case TextWordWrap::Clip:
- default:
- break;
- }
- }
-
- int lineHeight = dynamicTextArea ? fm.height() : finalHeight;
- QT3DSF32 nextHeight = 0;
- for (int i = 0; i < lineList.size(); ++i) {
- const QString &line = lineList.at(i);
- qreal xTranslation = tracking;
- switch (inSrcText.m_HorizontalAlignment) {
- case TextHorizontalAlignment::Center:
- xTranslation += qreal(boundingBox.width() - lineWidths.at(i)) / 2.0;
- break;
- case TextHorizontalAlignment::Right:
- xTranslation += qreal(boundingBox.width() - lineWidths.at(i));
- break;
- default:
- break; // Do nothing
- }
- QRectF bound(xTranslation, qreal(nextHeight), lineWidths.at(i), lineHeight);
- QRectF actualBound;
- if (inSrcText.m_DropShadow) {
- qreal shadowOffsetX = qreal(inSrcText.m_FontSize * inSrcText.m_DropShadowOffsetX)
- / 1000.;
- qreal shadowOffsetY = qreal(inSrcText.m_FontSize * inSrcText.m_DropShadowOffsetY)
- / 1000.;
- QRectF boundShadow(xTranslation + shadowOffsetX, nextHeight + shadowOffsetY,
- qreal(lineWidths.at(i)), lineHeight);
- // shadow is a darker shade of the given font color
- painter.setPen(QColor(shadowRgb, shadowRgb, shadowRgb));
- painter.drawText(boundShadow,
- alignToQtAlign(inSrcText.m_VerticalAlignment) | wordWrapFlags
- | horizontalAlignmentFlag, line, &actualBound);
- painter.setPen(Qt::white); // coloring is done in the shader
- }
- painter.drawText(bound,
- alignToQtAlign(inSrcText.m_VerticalAlignment) | wordWrapFlags
- | horizontalAlignmentFlag, line, &actualBound);
-
- nextHeight += QT3DSF32(lineHeight) + inSrcText.m_Leading;
- }
-
- return ITextRenderer::UploadData(toU8DataRef(image.bits(), image.byteCount()), inTexture,
- image.width(), image.height(),
- image.width(), image.height(),
- NVRenderTextureFormats::RGBA8, true);
- }
-
- STextTextureDetails RenderText(const STextRenderInfo &inText,
- NVRenderPathFontItem &inPathFontItem,
- NVRenderPathFontSpecification &inFontPathSpec) override
- {
- Q_UNUSED(inText);
- Q_UNUSED(inPathFontItem);
- Q_UNUSED(inFontPathSpec);
- QT3DS_ASSERT(m_renderContext->IsPathRenderingSupported());
-
- // We do not support HW accelerated fonts (yet?)
- QT3DS_ASSERT(false);
-
- return STextTextureDetails();
- }
-
- void BeginFrame() override
- {
- // Nothing to do
- }
-
- void EndFrame() override
- {
- // Nothing to do
- }
-
- // unused for text rendering via texture atlas
- STextTextureAtlasEntryDetails RenderAtlasEntry(QT3DSU32, NVRenderTexture2D &) override
- {
- return STextTextureAtlasEntryDetails();
- }
- QT3DSI32 CreateTextureAtlas() override
- {
- return 0;
- }
- SRenderTextureAtlasDetails RenderText(const STextRenderInfo &) override
- {
- return SRenderTextureAtlasDetails();
- }
-};
-}
-
-ITextRendererCore &ITextRendererCore::CreateQtTextRenderer(NVFoundationBase &inFnd,
- IStringTable &inStrTable)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), Qt3DSQtTextRenderer)(inFnd, inStrTable);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRender.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRender.h
deleted file mode 100644
index e07dc6ec..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRender.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_H
-#define QT3DS_RENDER_H
-
-namespace qt3ds {
-class NVAllocatorCallback;
-class NVFoundationBase;
-namespace foundation {
- class CRegisteredString;
- class IStringTable;
- class CStrTableOrDataRef;
- struct SStrRemapMap;
- struct SWriteBuffer;
- struct SDataReader;
- struct SPtrOffsetMap;
- class IPerfTimer;
- class Qt3DSString;
- class Qt3DSStringUtils;
-}
-namespace intrinsics {
-}
-namespace render {
- class NVRenderTexture2D;
- class NVRenderTexture2DArray;
- class NVRenderTextureCube;
- class NVRenderImage2D;
- class NVRenderFrameBuffer;
- class NVRenderRenderBuffer;
- class NVRenderVertexBuffer;
- class NVRenderIndexBuffer;
- class NVRenderDrawIndirectBuffer;
- class NVRenderInputAssembler;
- class NVRenderAttribLayout;
- class NVRenderDepthStencilState;
- class NVRenderContext;
- class NVRenderConstantBuffer;
- class NVRenderShaderProgram;
- class NVRenderShaderConstantBase;
- struct NVRenderDrawMode;
- struct NVRenderWinding;
- struct NVRenderSrcBlendFunc;
- struct NVRenderBlendEquation;
- struct NVRenderState;
- struct NVRenderTextureCoordOp;
- struct NVRenderTextureMagnifyingOp;
- struct NVRenderDstBlendFunc;
- struct NVRenderContextValues;
- struct NVRenderClearValues;
- struct NVRenderRect;
- struct NVRenderRectF;
- struct NVRenderRenderBufferFormats;
- struct NVRenderTextureFormats;
- struct NVRenderTextureSwizzleMode;
- struct NVRenderFrameBufferAttachments;
- struct NVRenderRect;
- struct NVRenderTextureCubeFaces;
- struct STextureDetails;
- struct NVRenderShaderDataTypes;
- class NVRenderTextureOrRenderBuffer;
- struct NVRenderTextureMinifyingOp;
- struct NVReadFaces;
- struct NVRenderVertexBufferEntry;
- struct NVRenderPtrPtrMap;
- class NVRenderComputeShader;
- class NVRenderAttribLayout;
- struct NVRenderBufferAccessTypeValues;
- struct NVRenderImageAccessType;
- struct NVRenderBufferBindValues;
- struct DrawArraysIndirectCommand;
- struct NVRenderShaderTypeValue;
- class NVRenderPathRender;
- class NVRenderPathSpecification;
- class NVRenderPathFontSpecification;
- class NVRenderPathFontItem;
- struct NVRenderTextureTypeValue;
- class NVRenderProgramPipeline;
-}
-class NVPlane;
-}
-
-namespace eastl {
-}
-
-namespace qt3ds {
-
-namespace render {
- using namespace qt3ds;
- using namespace qt3ds::foundation;
- using namespace qt3ds::intrinsics;
- using qt3ds::render::NVRenderTexture2D;
- using qt3ds::render::NVRenderTexture2DArray;
- using qt3ds::render::NVRenderTextureCube;
- using qt3ds::render::NVRenderImage2D;
- using qt3ds::render::NVRenderFrameBuffer;
- using qt3ds::render::NVRenderRenderBuffer;
- using qt3ds::render::NVRenderVertexBuffer;
- using qt3ds::render::NVRenderIndexBuffer;
- using qt3ds::render::NVRenderDrawIndirectBuffer;
- using qt3ds::render::NVRenderInputAssembler;
- using qt3ds::render::NVRenderAttribLayout;
- using qt3ds::render::NVRenderDepthStencilState;
- using qt3ds::render::NVRenderContext;
- using qt3ds::render::NVRenderConstantBuffer;
- using qt3ds::render::NVRenderShaderProgram;
- using qt3ds::render::NVRenderShaderConstantBase;
- using qt3ds::render::NVRenderDrawMode;
- using qt3ds::render::NVRenderWinding;
- using qt3ds::foundation::CRegisteredString;
- using qt3ds::foundation::IStringTable;
- using qt3ds::render::NVRenderSrcBlendFunc;
- using qt3ds::render::NVRenderBlendEquation;
- using qt3ds::render::NVRenderState;
- using qt3ds::foundation::IStringTable;
- using qt3ds::foundation::CRegisteredString;
- using qt3ds::render::NVRenderTextureCoordOp;
- using qt3ds::render::NVRenderDstBlendFunc;
- using qt3ds::render::NVRenderRect;
- using qt3ds::render::NVRenderRectF;
- using qt3ds::render::NVRenderRenderBufferFormats;
- using qt3ds::render::NVRenderTextureFormats;
- using qt3ds::render::NVRenderTextureSwizzleMode;
- using qt3ds::render::NVRenderFrameBufferAttachments;
- using qt3ds::render::NVRenderRect;
- using qt3ds::render::NVRenderContextValues;
- using qt3ds::render::NVRenderClearValues;
- using qt3ds::render::STextureDetails;
- using qt3ds::render::NVRenderShaderDataTypes;
- using qt3ds::render::NVRenderTextureMagnifyingOp;
- using qt3ds::render::NVRenderTextureOrRenderBuffer;
- using qt3ds::render::NVRenderTextureMinifyingOp;
- using qt3ds::render::NVReadFaces;
- using qt3ds::render::NVRenderTextureCubeFaces;
- using qt3ds::foundation::SStrRemapMap;
- using qt3ds::foundation::SWriteBuffer;
- using qt3ds::foundation::SDataReader;
- using qt3ds::foundation::Qt3DSString;
- using qt3ds::foundation::Qt3DSStringUtils;
- using qt3ds::render::NVRenderPtrPtrMap;
- using qt3ds::foundation::CStrTableOrDataRef;
- using qt3ds::foundation::SPtrOffsetMap;
- using qt3ds::foundation::IPerfTimer;
- using qt3ds::render::NVRenderVertexBufferEntry;
- using qt3ds::render::NVRenderComputeShader;
- using qt3ds::render::NVRenderAttribLayout;
- using qt3ds::render::NVRenderBufferAccessTypeValues;
- using qt3ds::render::NVRenderImageAccessType;
- using qt3ds::render::NVRenderBufferBindValues;
- using qt3ds::render::DrawArraysIndirectCommand;
- using qt3ds::render::NVRenderShaderTypeValue;
- using qt3ds::render::NVRenderPathRender;
- using qt3ds::render::NVRenderPathSpecification;
- using qt3ds::render::NVRenderPathFontSpecification;
- using qt3ds::render::NVRenderPathFontItem;
- using qt3ds::render::NVRenderTextureTypeValue;
- using qt3ds::render::NVRenderProgramPipeline;
-
- class IQt3DSRenderContextCore;
- class IQt3DSRenderContext;
- class IQt3DSRenderer;
- class IBufferManager;
- struct SRenderMesh;
- class IRenderableObject;
- class IQt3DSRenderer;
- class IBufferManager;
- class IResourceManager;
- class IOffscreenRenderManager;
- struct SNode;
- struct SGraphObject;
- class ITextRenderer;
- class ITextRendererCore;
- class IInputStreamFactory;
- class IRefCountedInputStream;
- class IEffectSystem;
- class IEffectSystemCore;
- class IShaderCache;
- class IQt3DSRenderNodeFilter;
- class IRenderWidget;
- class IRenderWidgetContext;
- struct SShaderVertexCodeGenerator;
- struct SShaderFragmentCodeGenerator;
- class IThreadPool;
- struct SRenderMesh;
- struct SLoadedTexture;
- class IImageBatchLoader;
- class ITextTextureCache;
- class ITextTextureAtlas;
- class IRenderPluginInstance;
- class IRenderPluginClass;
- class IRenderPluginManager;
- class IRenderPluginManagerCore;
- struct SRenderPlugin;
- class IDynamicObjectSystemCore;
- class IDynamicObjectSystem;
- class IDynamicObjectClass;
- struct SRenderSubset;
- struct SModel;
- namespace dynamic {
- struct SPropertyDefinition;
- }
- struct SLight;
- struct SCamera;
- struct SCustomMaterial;
- class ICustomMaterialSystem;
- class ICustomMaterialSystemCore;
- struct SLayer;
- struct SReferencedMaterial;
- struct SPGGraphObject;
- class IPixelGraphicsRenderer;
- class IBufferLoader;
- struct SEffect;
- class IRenderList;
- class IRenderTask;
- class CResourceTexture2D;
- class IPathManagerCore;
- class IPathManager;
- struct SPath;
- struct SPathSubPath;
- class IShaderProgramGenerator;
- class IShaderStageGenerator;
- class IDefaultMaterialShaderGenerator;
- class ICustomMaterialShaderGenerator;
- struct SRenderableImage;
- class Qt3DSShadowMap;
- struct SLightmaps;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.cpp
deleted file mode 100644
index 86375566..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderClippingFrustum.h"
-
-using namespace qt3ds::render;
-
-SClippingFrustum::SClippingFrustum(const QT3DSMat44 &modelviewprojection, SClipPlane nearPlane)
-{
- SClipPlane *_cullingPlanes = mPlanes;
- const QT3DSMat44 &modelViewProjectionMat(modelviewprojection);
- const QT3DSF32 *modelviewProjection = modelViewProjectionMat.front();
-
-// update planes (http://read.pudn.com/downloads128/doc/542641/Frustum.pdf)
-// Google for Gribb plane extraction if that link doesn't work.
-// http://www.google.com/search?q=ravensoft+plane+extraction
-#define M(_x, _y) modelviewProjection[(4 * (_y)) + (_x)]
- // left plane
- _cullingPlanes[0].normal.x = M(3, 0) + M(0, 0);
- _cullingPlanes[0].normal.y = M(3, 1) + M(0, 1);
- _cullingPlanes[0].normal.z = M(3, 2) + M(0, 2);
- _cullingPlanes[0].d = M(3, 3) + M(0, 3);
- _cullingPlanes[0].d /= _cullingPlanes[0].normal.normalize();
-
- // right plane
- _cullingPlanes[1].normal.x = M(3, 0) - M(0, 0);
- _cullingPlanes[1].normal.y = M(3, 1) - M(0, 1);
- _cullingPlanes[1].normal.z = M(3, 2) - M(0, 2);
- _cullingPlanes[1].d = M(3, 3) - M(0, 3);
- _cullingPlanes[1].d /= _cullingPlanes[1].normal.normalize();
-
- // far plane
- _cullingPlanes[2].normal.x = M(3, 0) - M(2, 0);
- _cullingPlanes[2].normal.y = M(3, 1) - M(2, 1);
- _cullingPlanes[2].normal.z = M(3, 2) - M(2, 2);
- _cullingPlanes[2].d = M(3, 3) - M(2, 3);
- _cullingPlanes[2].d /= _cullingPlanes[2].normal.normalize();
-
- // bottom plane
- _cullingPlanes[3].normal.x = M(3, 0) + M(1, 0);
- _cullingPlanes[3].normal.y = M(3, 1) + M(1, 1);
- _cullingPlanes[3].normal.z = M(3, 2) + M(1, 2);
- _cullingPlanes[3].d = M(3, 3) + M(1, 3);
- _cullingPlanes[3].d /= _cullingPlanes[3].normal.normalize();
-
- // top plane
- _cullingPlanes[4].normal.x = M(3, 0) - M(1, 0);
- _cullingPlanes[4].normal.y = M(3, 1) - M(1, 1);
- _cullingPlanes[4].normal.z = M(3, 2) - M(1, 2);
- _cullingPlanes[4].d = M(3, 3) - M(1, 3);
- _cullingPlanes[4].d /= _cullingPlanes[4].normal.normalize();
-#undef M
- _cullingPlanes[5] = nearPlane;
- // http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/include/osg/Plane?rev=5328
- // setup the edges of the plane that we will clip against an axis-aligned bounding box.
- for (QT3DSU32 idx = 0; idx < 6; ++idx) {
- _cullingPlanes[idx].calculateBBoxEdges();
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.h
deleted file mode 100644
index b788ad24..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderClippingFrustum.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CLIPPING_PLANE_H
-#define QT3DS_RENDER_CLIPPING_PLANE_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSPlane.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Qt3DSBounds3.h"
-
-namespace qt3ds {
-namespace render {
-
- struct BoxEdgeFlagValues
- {
- enum Enum {
- xMax = 1,
- yMax = 1 << 1,
- zMax = 1 << 2,
- };
- };
-
- typedef NVFlags<BoxEdgeFlagValues::Enum, QT3DSU8> TRenderBoxEdge;
-
- // For an intesection test, we only need two points of the bounding box.
- // There will be a point nearest to the plane, and a point furthest from the plane.
- // We can derive these points from the plane normal equation.
- struct SPlaneBoxEdge
- {
- TRenderBoxEdge lowerEdge;
- TRenderBoxEdge upperEdge;
- };
-
- struct SClipPlane
- {
- QT3DSVec3 normal;
- QT3DSF32 d;
- SPlaneBoxEdge mEdges;
-
- // For intersection tests, we only need to know if the numerator is greater than, equal to,
- // or less than zero.
- inline QT3DSF32 distance(const QT3DSVec3 &pt) const { return normal.dot(pt) + d; }
-
- // Only works if p0 is above the line and p1 is below the plane.
- inline QT3DSVec3 intersectWithLine(const QT3DSVec3 &p0, const QT3DSVec3 &p1) const
- {
- QT3DSVec3 dir = p1 - p0;
- QT3DSVec3 pointOnPlane = normal * (-d);
-#ifdef _DEBUG
- QT3DSF32 distanceOfPoint = distance(pointOnPlane);
- QT3DS_ASSERT(NVAbs(distanceOfPoint) < 0.0001f);
-#endif
- QT3DSF32 numerator = (pointOnPlane - p0).dot(normal);
- QT3DSF32 denominator = dir.dot(normal);
-
- QT3DS_ASSERT(NVAbs(denominator) > .0001f);
- QT3DSF32 t = (numerator / denominator);
- QT3DSVec3 retval = p0 + dir * t;
-#ifdef _DEBUG
- QT3DSF32 retvalDistance = distance(retval);
- QT3DS_ASSERT(NVAbs(retvalDistance) < .0001f);
-#endif
- return retval;
- }
-
- static inline QT3DSVec3 corner(const NVBounds3 &bounds, TRenderBoxEdge edge)
- {
- return QT3DSVec3((edge & BoxEdgeFlagValues::xMax) ? bounds.maximum[0] : bounds.minimum[0],
- (edge & BoxEdgeFlagValues::yMax) ? bounds.maximum[1] : bounds.minimum[1],
- (edge & BoxEdgeFlagValues::zMax) ? bounds.maximum[2] : bounds.minimum[2]);
- }
-
- // dividing the distance numerator
-
- // I got this code from osg, but it is in graphics gems
- // as well.
- /** intersection test between plane and bounding sphere.
- return 1 if the bs is completely above plane,
- return 0 if the bs intersects the plane,
- return -1 if the bs is completely below the plane.*/
- inline int intersect(const NVBounds3 &bounds) const
- {
- // if lowest point above plane than all above.
- if (distance(corner(bounds, mEdges.lowerEdge)) > 0.0f)
- return 1;
-
- // if highest point is below plane then all below.
- if (distance(corner(bounds, mEdges.upperEdge)) < 0.0f)
- return -1;
-
- // d_lower<=0.0f && d_upper>=0.0f
- // therefore must be crossing plane.
- return 0;
- }
-
- inline void calculateBBoxEdges()
- {
- mEdges.upperEdge = TRenderBoxEdge(
- static_cast<QT3DSU8>((normal[0] >= 0.0f ? BoxEdgeFlagValues::xMax : 0)
- | (normal[1] >= 0.0f ? BoxEdgeFlagValues::yMax : 0)
- | (normal[2] >= 0.0f ? BoxEdgeFlagValues::zMax : 0)));
-
- mEdges.lowerEdge = TRenderBoxEdge((~((QT3DSU8)mEdges.upperEdge)) & 7);
- }
- };
-
- struct SClippingFrustum
- {
- SClipPlane mPlanes[6];
-
- SClippingFrustum() {}
-
- SClippingFrustum(const QT3DSMat44 &modelviewprojection, SClipPlane nearPlane);
-
- bool intersectsWith(const NVBounds3 &bounds) const
- {
- for (QT3DSU32 idx = 0; idx < 6; ++idx)
- if (mPlanes[idx].intersect(bounds) < 0)
- return false;
- return true;
- }
-
- bool intersectsWith(const QT3DSVec3 &point, QT3DSF32 radius = 0.0f) const
- {
- for (QT3DSU32 idx = 0; idx < 6; ++idx)
- if (mPlanes[idx].distance(point) < radius)
- return false;
- return true;
- }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.cpp
deleted file mode 100644
index 33e1bf6c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.cpp
+++ /dev/null
@@ -1,858 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRender.h"
-#include "EABase/eabase.h" //char16_t definition
-#include "Qt3DSRenderContextCore.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderNode.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "Qt3DSRenderCamera.h"
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderThreadPool.h"
-#include "Qt3DSRenderImageBatchLoader.h"
-#include "Qt3DSRenderTextTextureCache.h"
-#include "Qt3DSRenderTextTextureAtlas.h"
-#include "Qt3DSRenderPlugin.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderPixelGraphicsRenderer.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "Qt3DSRenderBufferLoader.h"
-#include "foundation/FastAllocator.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRenderPathManager.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-#include "Qt3DSRenderCustomMaterialShaderGenerator.h"
-#include "Qt3DSDistanceFieldRenderer.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct SRenderContextCore : public IQt3DSRenderContextCore
-{
- NVFoundationBase &m_Foundation;
- NVScopedRefCounted<IStringTable> m_StringTable;
- NVScopedRefCounted<IPerfTimer> m_PerfTimer;
- NVScopedRefCounted<IInputStreamFactory> m_InputStreamFactory;
- NVScopedRefCounted<IThreadPool> m_ThreadPool;
- NVScopedRefCounted<IDynamicObjectSystemCore> m_DynamicObjectSystem;
- NVScopedRefCounted<ICustomMaterialSystemCore> m_MaterialSystem;
- NVScopedRefCounted<IEffectSystemCore> m_EffectSystem;
- NVScopedRefCounted<IBufferLoader> m_BufferLoader;
- NVScopedRefCounted<IRenderPluginManagerCore> m_RenderPluginManagerCore;
- NVScopedRefCounted<ITextRendererCore> m_TextRenderer;
- NVScopedRefCounted<ITextRendererCore> m_OnscreenTexRenderer;
- NVScopedRefCounted<IPathManagerCore> m_PathManagerCore;
- NVScopedRefCounted<ITextRendererCore> m_distanceFieldRenderer;
-
- QT3DSI32 mRefCount;
- SRenderContextCore(NVFoundationBase &fnd, IStringTable &strTable)
- : m_Foundation(fnd)
- , m_StringTable(strTable)
- , m_PerfTimer(IPerfTimer::CreatePerfTimer(fnd))
- , m_InputStreamFactory(IInputStreamFactory::Create(fnd))
- , m_ThreadPool(IThreadPool::CreateThreadPool(fnd, 4))
- , mRefCount(0)
- {
- m_DynamicObjectSystem = IDynamicObjectSystemCore::CreateDynamicSystemCore(*this);
- m_MaterialSystem = ICustomMaterialSystemCore::CreateCustomMaterialSystemCore(*this);
- m_EffectSystem = IEffectSystemCore::CreateEffectSystemCore(*this);
- m_RenderPluginManagerCore =
- IRenderPluginManagerCore::Create(fnd, strTable, *m_InputStreamFactory);
- m_BufferLoader = IBufferLoader::Create(m_Foundation, *m_InputStreamFactory, *m_ThreadPool);
- m_PathManagerCore = IPathManagerCore::CreatePathManagerCore(*this);
- }
-
- virtual ~SRenderContextCore() {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- IStringTable &GetStringTable() override { return *m_StringTable; }
- NVFoundationBase &GetFoundation() override { return m_Foundation; }
- NVAllocatorCallback &GetAllocator() override { return m_Foundation.getAllocator(); }
- IInputStreamFactory &GetInputStreamFactory() override { return *m_InputStreamFactory; }
- IThreadPool &GetThreadPool() override { return *m_ThreadPool; }
- IDynamicObjectSystemCore &GetDynamicObjectSystemCore() override
- {
- return *m_DynamicObjectSystem;
- }
- ICustomMaterialSystemCore &GetMaterialSystemCore() override { return *m_MaterialSystem; }
- IEffectSystemCore &GetEffectSystemCore() override { return *m_EffectSystem; }
- IPerfTimer &GetPerfTimer() override { return *m_PerfTimer; }
- IBufferLoader &GetBufferLoader() override { return *m_BufferLoader; }
- IRenderPluginManagerCore &GetRenderPluginCore() override { return *m_RenderPluginManagerCore; }
- IPathManagerCore &GetPathManagerCore() override { return *m_PathManagerCore; }
- IQt3DSRenderContext &CreateRenderContext(NVRenderContext &inContext,
- const char8_t *inPrimitivesDirectory,
- bool delayedLoading) override;
- void SetTextRendererCore(ITextRendererCore &inRenderer) override { m_TextRenderer = inRenderer; }
- ITextRendererCore *GetTextRendererCore() override { return m_TextRenderer.mPtr; }
- void setDistanceFieldRenderer(ITextRendererCore &inRenderer) override
- {
- m_distanceFieldRenderer = inRenderer;
- }
- ITextRendererCore *getDistanceFieldRenderer() override { return m_distanceFieldRenderer.mPtr; }
- void SetOnscreenTextRendererCore(ITextRendererCore &inRenderer) override
- {
- m_OnscreenTexRenderer = inRenderer;
- }
- ITextRendererCore *GetOnscreenTextRendererCore() override { return m_OnscreenTexRenderer.mPtr; }
-};
-
-inline float Clamp(float val, float inMin = 0.0f, float inMax = 1.0f)
-{
- if (val < inMin)
- return inMin;
- if (val > inMax)
- return inMax;
- return val;
-}
-
-struct SPerFrameAllocator : public NVAllocatorCallback
-{
- SFastAllocator<> m_FastAllocator;
- SSAutoDeallocatorAllocator m_LargeAllocator;
-
- SPerFrameAllocator(NVAllocatorCallback &baseAllocator)
- : m_FastAllocator(baseAllocator, "PerFrameAllocation")
- , m_LargeAllocator(baseAllocator)
- {
- }
-
- inline void *allocate(size_t inSize, const char *inFile, int inLine)
- {
- if (inSize < 8192)
- return m_FastAllocator.allocate(inSize, "PerFrameAllocation", inFile, inLine, 0);
- else
- return m_LargeAllocator.allocate(inSize, "PerFrameAllocation", inFile, inLine, 0);
- }
-
- inline void *allocate(size_t inSize, const char *inFile, int inLine, int, int)
- {
- if (inSize < 8192)
- return m_FastAllocator.allocate(inSize, "PerFrameAllocation", inFile, inLine, 0);
- else
- return m_LargeAllocator.allocate(inSize, "PerFrameAllocation", inFile, inLine, 0);
- }
-
- inline void deallocate(void *, size_t) {}
-
- void reset()
- {
- m_FastAllocator.reset();
- m_LargeAllocator.deallocateAllAllocations();
- }
-
- void *allocate(size_t inSize, const char *typeName, const char *inFile, int inLine,
- int flags = 0) override
- {
- if (inSize < SFastAllocator<>::SlabSize)
- return m_FastAllocator.allocate(inSize, typeName, inFile, inLine, flags);
- else
- return m_LargeAllocator.allocate(inSize, typeName, inFile, inLine, flags);
- }
-
- void *allocate(size_t inSize, const char *typeName, const char *inFile, int inLine,
- size_t alignment, size_t alignmentOffset) override
- {
- if (inSize < SFastAllocator<>::SlabSize)
- return m_FastAllocator.allocate(inSize, typeName, inFile, inLine, alignment,
- alignmentOffset);
- else
- return m_LargeAllocator.allocate(inSize, typeName, inFile, inLine, alignment,
- alignmentOffset);
- }
-
- void deallocate(void *) override {}
-};
-
-struct SRenderContext : public IQt3DSRenderContext
-{
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- NVScopedRefCounted<IQt3DSRenderContextCore> m_CoreContext;
- NVScopedRefCounted<IStringTable> m_StringTable;
- NVScopedRefCounted<IPerfTimer> m_PerfTimer;
- NVScopedRefCounted<IInputStreamFactory> m_InputStreamFactory;
- NVScopedRefCounted<IBufferManager> m_BufferManager;
- NVScopedRefCounted<IResourceManager> m_ResourceManager;
- NVScopedRefCounted<IOffscreenRenderManager> m_OffscreenRenderManager;
- NVScopedRefCounted<IQt3DSRenderer> m_Renderer;
- NVScopedRefCounted<ITextRenderer> m_TextRenderer;
- NVScopedRefCounted<ITextRenderer> m_distanceFieldRenderer;
- NVScopedRefCounted<ITextRenderer> m_OnscreenTextRenderer;
- NVScopedRefCounted<ITextTextureCache> m_TextTextureCache;
- NVScopedRefCounted<ITextTextureAtlas> m_TextTextureAtlas;
- NVScopedRefCounted<IDynamicObjectSystem> m_DynamicObjectSystem;
- NVScopedRefCounted<IEffectSystem> m_EffectSystem;
- NVScopedRefCounted<IShaderCache> m_ShaderCache;
- NVScopedRefCounted<IThreadPool> m_ThreadPool;
- NVScopedRefCounted<IImageBatchLoader> m_ImageBatchLoader;
- NVScopedRefCounted<IRenderPluginManager> m_RenderPluginManager;
- NVScopedRefCounted<ICustomMaterialSystem> m_CustomMaterialSystem;
- NVScopedRefCounted<IPixelGraphicsRenderer> m_PixelGraphicsRenderer;
- NVScopedRefCounted<IPathManager> m_PathManager;
- NVScopedRefCounted<IShaderProgramGenerator> m_ShaderProgramGenerator;
- NVScopedRefCounted<IDefaultMaterialShaderGenerator> m_DefaultMaterialShaderGenerator;
- NVScopedRefCounted<ICustomMaterialShaderGenerator> m_CustomMaterialShaderGenerator;
- SPerFrameAllocator m_PerFrameAllocator;
- NVScopedRefCounted<IRenderList> m_RenderList;
- QT3DSU32 m_FrameCount;
- volatile QT3DSI32 mRefCount;
- // Viewport that this render context should use
- Option<NVRenderRect> m_Viewport;
- QSize m_WindowDimensions;
- ScaleModes::Enum m_ScaleMode;
- bool m_WireframeMode;
- bool m_IsInSubPresentation;
- Option<QT3DSVec4> m_SceneColor;
- Option<QT3DSVec4> m_MatteColor;
- RenderRotationValues::Enum m_Rotation;
- NVScopedRefCounted<NVRenderFrameBuffer> m_RotationFBO;
- NVScopedRefCounted<NVRenderTexture2D> m_RotationTexture;
- NVScopedRefCounted<NVRenderRenderBuffer> m_RotationDepthBuffer;
- NVRenderFrameBuffer *m_ContextRenderTarget;
- NVRenderRect m_PresentationViewport;
- QSize m_PresentationDimensions;
- QSize m_RenderPresentationDimensions;
- QSize m_PreRenderPresentationDimensions;
- QT3DSVec2 m_PresentationScale;
- NVRenderRect m_VirtualViewport;
- QPair<QT3DSF32, int> m_FPS;
- bool m_AuthoringMode;
- QVector<QT3DSF32> m_frameTimes;
-
- SRenderContext(NVRenderContext &ctx, IQt3DSRenderContextCore &inCore,
- const char8_t *inApplicationDirectory, bool delayedLoading)
- : m_RenderContext(ctx)
- , m_CoreContext(inCore)
- , m_StringTable(ctx.GetStringTable())
- , m_PerfTimer(inCore.GetPerfTimer())
- , m_InputStreamFactory(inCore.GetInputStreamFactory())
- , m_BufferManager(
- IBufferManager::Create(ctx, *m_StringTable, *m_InputStreamFactory, *m_PerfTimer))
- , m_ResourceManager(IResourceManager::CreateResourceManager(ctx))
- , m_ShaderCache(IShaderCache::CreateShaderCache(ctx, *m_InputStreamFactory, *m_PerfTimer))
- , m_ThreadPool(inCore.GetThreadPool())
- , m_RenderList(IRenderList::CreateRenderList(ctx.GetFoundation()))
- , m_PerFrameAllocator(ctx.GetAllocator())
- , m_FrameCount(0)
- , mRefCount(0)
- , m_WindowDimensions(800, 480)
- , m_ScaleMode(ScaleModes::ExactSize)
- , m_WireframeMode(false)
- , m_IsInSubPresentation(false)
- , m_Rotation(RenderRotationValues::NoRotation)
- , m_ContextRenderTarget(NULL)
- , m_PresentationScale(0, 0)
- , m_FPS(qMakePair(0.0, 0))
- , m_AuthoringMode(false)
- {
- m_BufferManager->enableReloadableResources(delayedLoading);
- m_OffscreenRenderManager = IOffscreenRenderManager::CreateOffscreenRenderManager(
- ctx.GetAllocator(), *m_StringTable, *m_ResourceManager, *this);
- m_Renderer = IQt3DSRenderer::CreateRenderer(*this);
- if (inApplicationDirectory && *inApplicationDirectory)
- m_InputStreamFactory->AddSearchDirectory(inApplicationDirectory);
-
- m_ImageBatchLoader =
- IImageBatchLoader::CreateBatchLoader(ctx.GetFoundation(), *m_InputStreamFactory,
- *m_BufferManager, *m_ThreadPool, *m_PerfTimer);
- m_RenderPluginManager = inCore.GetRenderPluginCore().GetRenderPluginManager(ctx);
- m_DynamicObjectSystem = inCore.GetDynamicObjectSystemCore().CreateDynamicSystem(*this);
- m_EffectSystem = inCore.GetEffectSystemCore().GetEffectSystem(*this);
- m_CustomMaterialSystem = inCore.GetMaterialSystemCore().GetCustomMaterialSystem(*this);
- // as does the custom material system
- m_PixelGraphicsRenderer = IPixelGraphicsRenderer::CreateRenderer(*this, *m_StringTable);
- ITextRendererCore *theTextCore = inCore.GetTextRendererCore();
- m_ShaderProgramGenerator = IShaderProgramGenerator::CreateProgramGenerator(*this);
- m_DefaultMaterialShaderGenerator =
- IDefaultMaterialShaderGenerator::CreateDefaultMaterialShaderGenerator(*this);
- m_CustomMaterialShaderGenerator =
- ICustomMaterialShaderGenerator::CreateCustomMaterialShaderGenerator(*this);
- if (theTextCore) {
- m_TextRenderer = theTextCore->GetTextRenderer(ctx);
- m_TextTextureCache = ITextTextureCache::CreateTextureCache(
- m_RenderContext->GetFoundation(), *m_TextRenderer, *m_RenderContext);
- }
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- ITextRendererCore *distanceFieldRenderer = inCore.getDistanceFieldRenderer();
- if (distanceFieldRenderer) {
- m_distanceFieldRenderer = distanceFieldRenderer->GetTextRenderer(ctx);
- static_cast<Q3DSDistanceFieldRenderer *>(m_distanceFieldRenderer.mPtr)
- ->setContext(*this);
- }
-#endif
-
- ITextRendererCore *theOnscreenTextCore = inCore.GetOnscreenTextRendererCore();
- if (theOnscreenTextCore) {
- m_OnscreenTextRenderer = theOnscreenTextCore->GetTextRenderer(ctx);
- m_TextTextureAtlas = ITextTextureAtlas::CreateTextureAtlas(
- m_RenderContext->GetFoundation(), *m_OnscreenTextRenderer, *m_RenderContext);
- }
- m_PathManager = inCore.GetPathManagerCore().OnRenderSystemInitialize(*this);
-
-#if defined (QT3DS_SHADER_PLATFORM_LIBRARY_DIR)
- const QString platformDirectory;
-#if defined(_WIN32)
- platformDirectory = QStringLiteral("res/platform/win");
-#elif defined(_LINUX)
- platformDirectory = QStringLiteral("res/platform/linux");
-#elif defined(_MACOSX)
- platformDirectory = QStringLiteral("res/platform/macos");
-#endif
- GetDynamicObjectSystem().setShaderCodeLibraryPlatformDirectory(platformDirectory);
-#endif
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext->GetAllocator());
-
- IStringTable &GetStringTable() override { return *m_StringTable; }
- NVFoundationBase &GetFoundation() override { return m_RenderContext->GetFoundation(); }
- NVAllocatorCallback &GetAllocator() override { return m_RenderContext->GetAllocator(); }
- IQt3DSRenderer &GetRenderer() override { return *m_Renderer; }
- IBufferManager &GetBufferManager() override { return *m_BufferManager; }
- IResourceManager &GetResourceManager() override { return *m_ResourceManager; }
- NVRenderContext &GetRenderContext() override { return *m_RenderContext; }
- IOffscreenRenderManager &GetOffscreenRenderManager() override
- {
- return *m_OffscreenRenderManager;
- }
- IInputStreamFactory &GetInputStreamFactory() override { return *m_InputStreamFactory; }
- IEffectSystem &GetEffectSystem() override { return *m_EffectSystem; }
- IShaderCache &GetShaderCache() override { return *m_ShaderCache; }
- IThreadPool &GetThreadPool() override { return *m_ThreadPool; }
- IImageBatchLoader &GetImageBatchLoader() override { return *m_ImageBatchLoader; }
- ITextTextureCache *GetTextureCache() override { return m_TextTextureCache.mPtr; }
- ITextTextureAtlas *GetTextureAtlas() override { return m_TextTextureAtlas.mPtr; }
- IRenderPluginManager &GetRenderPluginManager() override { return *m_RenderPluginManager; }
- IDynamicObjectSystem &GetDynamicObjectSystem() override { return *m_DynamicObjectSystem; }
- ICustomMaterialSystem &GetCustomMaterialSystem() override { return *m_CustomMaterialSystem; }
- IPixelGraphicsRenderer &GetPixelGraphicsRenderer() override { return *m_PixelGraphicsRenderer; }
- IPerfTimer &GetPerfTimer() override { return *m_PerfTimer; }
- IRenderList &GetRenderList() override { return *m_RenderList; }
- IPathManager &GetPathManager() override { return *m_PathManager; }
- IShaderProgramGenerator &GetShaderProgramGenerator() override
- {
- return *m_ShaderProgramGenerator;
- }
- IDefaultMaterialShaderGenerator &GetDefaultMaterialShaderGenerator() override
- {
- return *m_DefaultMaterialShaderGenerator;
- }
- ICustomMaterialShaderGenerator &GetCustomMaterialShaderGenerator() override
- {
- return *m_CustomMaterialShaderGenerator;
- }
- NVAllocatorCallback &GetPerFrameAllocator() override { return m_PerFrameAllocator; }
-
- QT3DSU32 GetFrameCount() override { return m_FrameCount; }
- void SetFPS(QPair<QT3DSF32, int> inFPS) override { m_FPS = inFPS; }
- QPair<QT3DSF32, int> GetFPS(void) override { return m_FPS; }
-
- void SetFrameTime(QT3DSF32 time) override
- {
- m_frameTimes.push_front(time);
- // Store only one value for now. This can be increased once we have proper graph for
- // the frame times.
- if (m_frameTimes.size() > 1)
- m_frameTimes.pop_back();
- }
- QVector<QT3DSF32> GetFrameTimes() const override
- {
- return m_frameTimes;
- }
-
- bool IsAuthoringMode() override { return m_AuthoringMode; }
- void SetAuthoringMode(bool inMode) override { m_AuthoringMode = inMode; }
-
- bool IsInSubPresentation() override { return m_IsInSubPresentation; }
- void SetInSubPresentation(bool inValue) override { m_IsInSubPresentation = inValue; }
-
- ITextRenderer *GetTextRenderer() override { return m_TextRenderer; }
-
- ITextRenderer *getDistanceFieldRenderer() override { return m_distanceFieldRenderer; }
-
- ITextRenderer *GetOnscreenTextRenderer() override { return m_OnscreenTextRenderer; }
-
- void SetSceneColor(Option<QT3DSVec4> inSceneColor) override { m_SceneColor = inSceneColor; }
- void SetMatteColor(Option<QT3DSVec4> inMatteColor) override { m_MatteColor = inMatteColor; }
-
- void SetWindowDimensions(const QSize &inWindowDimensions) override
- {
- m_WindowDimensions = inWindowDimensions;
- }
-
- QSize GetWindowDimensions() override { return m_WindowDimensions; }
-
- void SetScaleMode(ScaleModes::Enum inMode) override { m_ScaleMode = inMode; }
-
- ScaleModes::Enum GetScaleMode() override { return m_ScaleMode; }
-
- void SetWireframeMode(bool inEnable) override { m_WireframeMode = inEnable; }
-
- bool GetWireframeMode() override { return m_WireframeMode; }
-
- void SetViewport(Option<NVRenderRect> inViewport) override { m_Viewport = inViewport; }
- Option<NVRenderRect> GetViewport() const override { return m_Viewport; }
-
- IRenderWidgetContext &GetRenderWidgetContext() override
- {
- return m_Renderer->GetRenderWidgetContext();
- }
-
- eastl::pair<NVRenderRect, NVRenderRect> GetPresentationViewportAndOuterViewport() const
- {
- QSize thePresentationDimensions(m_PresentationDimensions);
- NVRenderRect theOuterViewport(GetContextViewport());
- if (m_Rotation == RenderRotationValues::Clockwise90
- || m_Rotation == RenderRotationValues::Clockwise270) {
- eastl::swap(theOuterViewport.m_Width, theOuterViewport.m_Height);
- eastl::swap(theOuterViewport.m_X, theOuterViewport.m_Y);
- }
- // Calculate the presentation viewport perhaps with the window width and height swapped.
- return eastl::make_pair(
- GetPresentationViewport(theOuterViewport, m_ScaleMode, thePresentationDimensions),
- theOuterViewport);
- }
-
- NVRenderRectF GetDisplayViewport() const override
- {
- return GetPresentationViewportAndOuterViewport().first;
- }
-
- void SetPresentationDimensions(const QSize &inPresentationDimensions) override
- {
- m_PresentationDimensions = inPresentationDimensions;
- }
- QSize GetCurrentPresentationDimensions() const override
- {
- return m_PresentationDimensions;
- }
-
- void SetRenderRotation(RenderRotationValues::Enum inRotation) override
- {
- m_Rotation = inRotation;
- }
-
- RenderRotationValues::Enum GetRenderRotation() const override { return m_Rotation; }
- QT3DSVec2 GetMousePickViewport() const override
- {
- bool renderOffscreen = m_Rotation != RenderRotationValues::NoRotation;
- if (renderOffscreen)
- return QT3DSVec2((QT3DSF32)m_PresentationViewport.m_Width,
- (QT3DSF32)m_PresentationViewport.m_Height);
- else
- return QT3DSVec2((QT3DSF32)m_WindowDimensions.width(), (QT3DSF32)m_WindowDimensions.height());
- }
- NVRenderRect GetContextViewport() const override
- {
- NVRenderRect retval;
- if (m_Viewport.hasValue())
- retval = *m_Viewport;
- else
- retval = NVRenderRect(0, 0, m_WindowDimensions.width(), m_WindowDimensions.height());
-
- return retval;
- }
-
- QT3DSVec2 GetMousePickMouseCoords(const QT3DSVec2 &inMouseCoords) const override
- {
- bool renderOffscreen = m_Rotation != RenderRotationValues::NoRotation;
- if (renderOffscreen) {
- QSize thePresentationDimensions(m_RenderPresentationDimensions);
- NVRenderRect theViewport(GetContextViewport());
- // Calculate the presentation viewport perhaps with the presentation width and height
- // swapped.
- NVRenderRect thePresentationViewport =
- GetPresentationViewport(theViewport, m_ScaleMode, thePresentationDimensions);
- // Translate pick into presentation space without rotations or anything else.
- QT3DSF32 YHeightDiff = (QT3DSF32)((QT3DSF32)m_WindowDimensions.height()
- - (QT3DSF32)thePresentationViewport.m_Height);
- QT3DSVec2 theLocalMouse((inMouseCoords.x - thePresentationViewport.m_X),
- (inMouseCoords.y - YHeightDiff + thePresentationViewport.m_Y));
- switch (m_Rotation) {
- default:
- case RenderRotationValues::NoRotation:
- QT3DS_ASSERT(false);
- break;
- case RenderRotationValues::Clockwise90:
- eastl::swap(theLocalMouse.x, theLocalMouse.y);
- theLocalMouse.y = thePresentationViewport.m_Width - theLocalMouse.y;
- break;
- case RenderRotationValues::Clockwise180:
- theLocalMouse.y = thePresentationViewport.m_Height - theLocalMouse.y;
- theLocalMouse.x = thePresentationViewport.m_Width - theLocalMouse.x;
- break;
- case RenderRotationValues::Clockwise270:
- eastl::swap(theLocalMouse.x, theLocalMouse.y);
- theLocalMouse.x = thePresentationViewport.m_Height - theLocalMouse.x;
- break;
- }
- return theLocalMouse;
- }
- return inMouseCoords;
- }
-
- NVRenderRect GetPresentationViewport(const NVRenderRect &inViewerViewport,
- ScaleModes::Enum inScaleToFit,
- const QSize &inPresDimensions) const
- {
- NVRenderRect retval;
- QT3DSI32 theWidth = inViewerViewport.m_Width;
- QT3DSI32 theHeight = inViewerViewport.m_Height;
- if (inPresDimensions.width() == 0 || inPresDimensions.height() == 0)
- return NVRenderRect(0, 0, 0, 0);
- // Setup presentation viewport. This may or may not match the physical viewport that we
- // want to setup.
- // Avoiding scaling keeps things as sharp as possible.
- if (inScaleToFit == ScaleModes::ExactSize) {
- retval.m_Width = inPresDimensions.width();
- retval.m_Height = inPresDimensions.height();
- retval.m_X = (theWidth - (QT3DSI32)inPresDimensions.width()) / 2;
- retval.m_Y = (theHeight - (QT3DSI32)inPresDimensions.height()) / 2;
- } else if (inScaleToFit == ScaleModes::ScaleToFit
- || inScaleToFit == ScaleModes::FitSelected) {
- // Scale down in such a way to preserve aspect ratio.
- float screenAspect = (float)theWidth / (float)theHeight;
- float thePresentationAspect =
- (float)inPresDimensions.width() / (float)inPresDimensions.height();
- if (screenAspect >= thePresentationAspect) {
- // if the screen height is the limiting factor
- retval.m_Y = 0;
- retval.m_Height = theHeight;
- retval.m_Width = (QT3DSI32)(thePresentationAspect * retval.m_Height);
- retval.m_X = (theWidth - retval.m_Width) / 2;
- } else {
- retval.m_X = 0;
- retval.m_Width = theWidth;
- retval.m_Height = (QT3DSI32)(retval.m_Width / thePresentationAspect);
- retval.m_Y = (theHeight - retval.m_Height) / 2;
- }
- } else {
- // Setup the viewport for everything and let the presentations figure it out.
- retval.m_X = 0;
- retval.m_Y = 0;
- retval.m_Width = theWidth;
- retval.m_Height = theHeight;
- }
- retval.m_X += inViewerViewport.m_X;
- retval.m_Y += inViewerViewport.m_Y;
- return retval;
- }
-
- void RenderText2D(QT3DSF32 x, QT3DSF32 y, qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
- const char *text) override
- {
- m_Renderer->RenderText2D(x, y, inColor, text);
- }
-
- void RenderGpuProfilerStats(QT3DSF32 x, QT3DSF32 y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor) override
- {
- m_Renderer->RenderGpuProfilerStats(x, y, inColor);
- }
-
- NVRenderRect GetPresentationViewport() const override { return m_PresentationViewport; }
- struct SBeginFrameResult
- {
- bool m_RenderOffscreen;
- QSize m_PresentationDimensions;
- bool m_ScissorTestEnabled;
- NVRenderRect m_ScissorRect;
- NVRenderRect m_Viewport;
- QSize m_FBODimensions;
- SBeginFrameResult(bool ro, QSize presDims, bool scissorEnabled,
- NVRenderRect scissorRect, NVRenderRect viewport,
- QSize fboDims)
- : m_RenderOffscreen(ro)
- , m_PresentationDimensions(presDims)
- , m_ScissorTestEnabled(scissorEnabled)
- , m_ScissorRect(scissorRect)
- , m_Viewport(viewport)
- , m_FBODimensions(fboDims)
- {
- }
- SBeginFrameResult() {}
- };
-
- // Calculated values passed from beginframe to setupRenderTarget.
- // Trying to avoid duplicate code as much as possible.
- SBeginFrameResult m_BeginFrameResult;
-
- void BeginFrame(bool firstFrame) override
- {
- m_PreRenderPresentationDimensions = m_PresentationDimensions;
- QSize thePresentationDimensions(m_PreRenderPresentationDimensions);
- NVRenderRect theContextViewport(GetContextViewport());
- m_PerFrameAllocator.reset();
- IRenderList &theRenderList(*m_RenderList);
- theRenderList.BeginFrame();
- if (m_Viewport.hasValue()) {
- theRenderList.SetScissorTestEnabled(true);
- theRenderList.SetScissorRect(theContextViewport);
- } else {
- theRenderList.SetScissorTestEnabled(false);
- }
- bool renderOffscreen = m_Rotation != RenderRotationValues::NoRotation;
- eastl::pair<NVRenderRect, NVRenderRect> thePresViewportAndOuterViewport =
- GetPresentationViewportAndOuterViewport();
- NVRenderRect theOuterViewport = thePresViewportAndOuterViewport.second;
- // Calculate the presentation viewport perhaps with the window width and height swapped.
- NVRenderRect thePresentationViewport = thePresViewportAndOuterViewport.first;
- m_PresentationViewport = thePresentationViewport;
- m_PresentationScale = QT3DSVec2(
- (QT3DSF32)thePresentationViewport.m_Width / (QT3DSF32)thePresentationDimensions.width(),
- (QT3DSF32)thePresentationViewport.m_Height / (QT3DSF32)thePresentationDimensions.height());
- QSize fboDimensions;
- if (thePresentationViewport.m_Width > 0 && thePresentationViewport.m_Height > 0) {
- if (renderOffscreen == false) {
- m_PresentationDimensions = QSize(thePresentationViewport.m_Width,
- thePresentationViewport.m_Height);
- m_RenderList->SetViewport(thePresentationViewport);
- if (thePresentationViewport.m_X || thePresentationViewport.m_Y
- || thePresentationViewport.m_Width != (QT3DSI32)theOuterViewport.m_Width
- || thePresentationViewport.m_Height != (QT3DSI32)theOuterViewport.m_Height) {
- m_RenderList->SetScissorRect(thePresentationViewport);
- m_RenderList->SetScissorTestEnabled(true);
- }
- } else {
- QT3DSU32 imageWidth = ITextRenderer::NextMultipleOf4(thePresentationViewport.m_Width);
- QT3DSU32 imageHeight =
- ITextRenderer::NextMultipleOf4(thePresentationViewport.m_Height);
- fboDimensions = QSize(imageWidth, imageHeight);
- m_PresentationDimensions = QSize(thePresentationViewport.m_Width,
- thePresentationViewport.m_Height);
- NVRenderRect theSceneViewport = NVRenderRect(0, 0, imageWidth, imageHeight);
- m_RenderList->SetScissorTestEnabled(false);
- m_RenderList->SetViewport(theSceneViewport);
- }
- }
-
- m_BeginFrameResult = SBeginFrameResult(
- renderOffscreen, m_PresentationDimensions, m_RenderList->IsScissorTestEnabled(),
- m_RenderList->GetScissor(), m_RenderList->GetViewport(), fboDimensions);
-
- m_Renderer->BeginFrame();
- m_OffscreenRenderManager->BeginFrame();
- if (m_TextRenderer)
- m_TextRenderer->BeginFrame();
- if (m_TextTextureCache)
- m_TextTextureCache->BeginFrame();
- m_ImageBatchLoader->BeginFrame(firstFrame);
- }
-
- QT3DSVec2 GetPresentationScaleFactor() const override { return m_PresentationScale; }
-
- virtual void SetupRenderTarget()
- {
- NVRenderRect theContextViewport(GetContextViewport());
- if (m_Viewport.hasValue()) {
- m_RenderContext->SetScissorTestEnabled(true);
- m_RenderContext->SetScissorRect(theContextViewport);
- } else {
- m_RenderContext->SetScissorTestEnabled(false);
- }
- {
- QT3DSVec4 theClearColor;
- if (m_MatteColor.hasValue())
- theClearColor = m_MatteColor;
- else
- theClearColor = m_SceneColor;
- m_RenderContext->SetClearColor(theClearColor);
- m_RenderContext->Clear(qt3ds::render::NVRenderClearValues::Color);
- }
- bool renderOffscreen = m_BeginFrameResult.m_RenderOffscreen;
- m_RenderContext->SetViewport(m_BeginFrameResult.m_Viewport);
- m_RenderContext->SetScissorRect(m_BeginFrameResult.m_ScissorRect);
- m_RenderContext->SetScissorTestEnabled(m_BeginFrameResult.m_ScissorTestEnabled);
-
- if (m_PresentationViewport.m_Width > 0 && m_PresentationViewport.m_Height > 0) {
- if (renderOffscreen == false) {
- if (m_RotationFBO != NULL) {
- m_ResourceManager->Release(*m_RotationFBO);
- m_ResourceManager->Release(*m_RotationTexture);
- m_ResourceManager->Release(*m_RotationDepthBuffer);
- m_RotationFBO = NULL;
- m_RotationTexture = NULL;
- m_RotationDepthBuffer = NULL;
- }
- if (m_SceneColor.hasValue() && m_SceneColor.getValue().w != 0.0f) {
- m_RenderContext->SetClearColor(m_SceneColor);
- m_RenderContext->Clear(qt3ds::render::NVRenderClearValues::Color);
- }
- } else {
- QT3DSU32 imageWidth = m_BeginFrameResult.m_FBODimensions.width();
- QT3DSU32 imageHeight = m_BeginFrameResult.m_FBODimensions.height();
- NVRenderTextureFormats::Enum theColorBufferFormat = NVRenderTextureFormats::RGBA8;
- NVRenderRenderBufferFormats::Enum theDepthBufferFormat =
- NVRenderRenderBufferFormats::Depth16;
- m_ContextRenderTarget = m_RenderContext->GetRenderTarget();
- if (m_RotationFBO == NULL) {
- m_RotationFBO = m_ResourceManager->AllocateFrameBuffer();
- m_RotationTexture = m_ResourceManager->AllocateTexture2D(
- imageWidth, imageHeight, theColorBufferFormat);
- m_RotationDepthBuffer = m_ResourceManager->AllocateRenderBuffer(
- imageWidth, imageHeight, theDepthBufferFormat);
- m_RotationFBO->Attach(NVRenderFrameBufferAttachments::Color0,
- *m_RotationTexture);
- m_RotationFBO->Attach(NVRenderFrameBufferAttachments::Depth,
- *m_RotationDepthBuffer);
- } else {
- STextureDetails theDetails = m_RotationTexture->GetTextureDetails();
- if (theDetails.m_Width != imageWidth || theDetails.m_Height != imageHeight) {
- m_RotationTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, imageWidth,
- imageHeight, theColorBufferFormat);
- m_RotationDepthBuffer->SetDimensions(
- qt3ds::render::NVRenderRenderBufferDimensions(imageWidth, imageHeight));
- }
- }
- m_RenderContext->SetRenderTarget(m_RotationFBO);
- if (m_SceneColor.hasValue()) {
- m_RenderContext->SetClearColor(m_SceneColor);
- m_RenderContext->Clear(qt3ds::render::NVRenderClearValues::Color);
- }
- }
- }
- }
-
- void RunRenderTasks() override
- {
- m_RenderList->RunRenderTasks();
- SetupRenderTarget();
- }
-
- // Note this runs before EndFrame
- virtual void TeardownRenderTarget()
- {
- if (m_RotationFBO) {
- ScaleModes::Enum theScaleToFit = m_ScaleMode;
- NVRenderRect theOuterViewport(GetContextViewport());
- m_RenderContext->SetRenderTarget(m_ContextRenderTarget);
- QSize thePresentationDimensions = GetCurrentPresentationDimensions();
- if (m_Rotation == RenderRotationValues::Clockwise90
- || m_Rotation == RenderRotationValues::Clockwise270) {
- thePresentationDimensions = QSize(thePresentationDimensions.height(),
- thePresentationDimensions.width());
- }
- m_RenderPresentationDimensions = thePresentationDimensions;
- // Calculate the presentation viewport perhaps with the presentation width and height
- // swapped.
- NVRenderRect thePresentationViewport =
- GetPresentationViewport(theOuterViewport, theScaleToFit, thePresentationDimensions);
- SCamera theCamera;
- switch (m_Rotation) {
- default:
- QT3DS_ASSERT(false);
- break;
- case RenderRotationValues::Clockwise90:
- theCamera.m_Rotation.z = 90;
- break;
- case RenderRotationValues::Clockwise180:
- theCamera.m_Rotation.z = 180;
- break;
- case RenderRotationValues::Clockwise270:
- theCamera.m_Rotation.z = 270;
- break;
- }
- TORAD(theCamera.m_Rotation.z);
- theCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- theCamera.m_Flags.SetOrthographic(true);
- m_RenderContext->SetViewport(thePresentationViewport);
- QT3DSVec2 theCameraDimensions((QT3DSF32)thePresentationViewport.m_Width,
- (QT3DSF32)thePresentationViewport.m_Height);
- theCamera.CalculateGlobalVariables(
- NVRenderRect(0, 0, (QT3DSU32)thePresentationViewport.m_Width,
- (QT3DSU32)thePresentationViewport.m_Height),
- theCameraDimensions);
- QT3DSMat44 theVP;
- theCamera.CalculateViewProjectionMatrix(theVP);
- SNode theTempNode;
- theTempNode.CalculateGlobalVariables();
- QT3DSMat44 theMVP;
- QT3DSMat33 theNormalMat;
- theTempNode.CalculateMVPAndNormalMatrix(theVP, theMVP, theNormalMat);
- m_RenderContext->SetCullingEnabled(false);
- m_RenderContext->SetBlendingEnabled(false);
- m_RenderContext->SetDepthTestEnabled(false);
- m_Renderer->RenderQuad(QT3DSVec2((QT3DSF32)m_PresentationViewport.m_Width,
- (QT3DSF32)m_PresentationViewport.m_Height),
- theMVP, *m_RotationTexture);
- }
- }
-
- void EndFrame() override
- {
- TeardownRenderTarget();
- m_ImageBatchLoader->EndFrame();
- if (m_TextTextureCache)
- m_TextTextureCache->EndFrame();
- if (m_TextRenderer)
- m_TextRenderer->EndFrame();
- if (m_distanceFieldRenderer)
- m_distanceFieldRenderer->EndFrame();
- m_OffscreenRenderManager->EndFrame();
- m_Renderer->EndFrame();
- m_CustomMaterialSystem->EndFrame();
- m_PresentationDimensions = m_PreRenderPresentationDimensions;
- ++m_FrameCount;
- }
-};
-
-IQt3DSRenderContext &SRenderContextCore::CreateRenderContext(NVRenderContext &inContext,
- const char8_t *inPrimitivesDirectory,
- bool delayedLoading)
-{
- return *QT3DS_NEW(m_Foundation.getAllocator(), SRenderContext)(inContext, *this,
- inPrimitivesDirectory,
- delayedLoading);
-}
-}
-
-IQt3DSRenderContextCore &IQt3DSRenderContextCore::Create(NVFoundationBase &fnd, IStringTable &strt)
-{
- return *QT3DS_NEW(fnd.getAllocator(), SRenderContextCore)(fnd, strt);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.h
deleted file mode 100644
index 302571d2..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderContextCore.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CONTEXT_CORE_H
-#define QT3DS_RENDER_CONTEXT_CORE_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderPresentation.h"
-
-#include <QtCore/qpair.h>
-#include <QtCore/qsize.h>
-
-namespace qt3ds {
-namespace render {
- struct ScaleModes
- {
- enum Enum {
- ExactSize = 0, // Ensure the viewport is exactly same size as application
- ScaleToFit = 1, // Resize viewport keeping aspect ratio
- ScaleToFill = 2, // Resize viewport to entire window
- FitSelected = 3, // Resize presentation to fit into viewport
- };
- };
-
- // Part of render context that does not require the render system.
- class IQt3DSRenderContextCore : public NVRefCounted
- {
- public:
- virtual IStringTable &GetStringTable() = 0;
- virtual NVFoundationBase &GetFoundation() = 0;
- virtual NVAllocatorCallback &GetAllocator() = 0;
- virtual IInputStreamFactory &GetInputStreamFactory() = 0;
- virtual IThreadPool &GetThreadPool() = 0;
- virtual IDynamicObjectSystemCore &GetDynamicObjectSystemCore() = 0;
- virtual ICustomMaterialSystemCore &GetMaterialSystemCore() = 0;
- virtual IEffectSystemCore &GetEffectSystemCore() = 0;
- virtual IPerfTimer &GetPerfTimer() = 0;
- virtual IBufferLoader &GetBufferLoader() = 0;
- virtual IRenderPluginManagerCore &GetRenderPluginCore() = 0;
- virtual IPathManagerCore &GetPathManagerCore() = 0;
- // Text renderers may be provided by clients at runtime.
- virtual void SetTextRendererCore(ITextRendererCore &inRenderer) = 0;
- virtual ITextRendererCore *GetTextRendererCore() = 0;
- virtual void setDistanceFieldRenderer(ITextRendererCore &inRenderer) = 0;
- virtual ITextRendererCore *getDistanceFieldRenderer() = 0;
- // this is our default 2D text onscreen renderer
- virtual void SetOnscreenTextRendererCore(ITextRendererCore &inRenderer) = 0;
- virtual ITextRendererCore *GetOnscreenTextRendererCore() = 0;
- // The render context maintains a reference to this object.
- virtual IQt3DSRenderContext &CreateRenderContext(NVRenderContext &inContext,
- const char8_t *inPrimitivesDirectory,
- bool delayedLoading) = 0;
-
- static IQt3DSRenderContextCore &Create(NVFoundationBase &fnd, IStringTable &strt);
- };
-
- class IQt3DSRenderContext : public NVRefCounted
- {
- protected:
- virtual ~IQt3DSRenderContext() {}
- public:
- virtual IStringTable &GetStringTable() = 0;
- virtual NVFoundationBase &GetFoundation() = 0;
- virtual NVAllocatorCallback &GetAllocator() = 0;
- virtual IQt3DSRenderer &GetRenderer() = 0;
- virtual IRenderWidgetContext &GetRenderWidgetContext() = 0;
- virtual IBufferManager &GetBufferManager() = 0;
- virtual IResourceManager &GetResourceManager() = 0;
- virtual NVRenderContext &GetRenderContext() = 0;
- virtual IOffscreenRenderManager &GetOffscreenRenderManager() = 0;
- virtual IInputStreamFactory &GetInputStreamFactory() = 0;
- virtual IEffectSystem &GetEffectSystem() = 0;
- virtual IShaderCache &GetShaderCache() = 0;
- virtual IThreadPool &GetThreadPool() = 0;
- virtual IImageBatchLoader &GetImageBatchLoader() = 0;
- virtual IRenderPluginManager &GetRenderPluginManager() = 0;
- virtual IDynamicObjectSystem &GetDynamicObjectSystem() = 0;
- virtual ICustomMaterialSystem &GetCustomMaterialSystem() = 0;
- virtual IPixelGraphicsRenderer &GetPixelGraphicsRenderer() = 0;
- virtual IPerfTimer &GetPerfTimer() = 0;
- virtual ITextTextureCache *GetTextureCache() = 0;
- virtual ITextRenderer *GetTextRenderer() = 0;
- virtual ITextRenderer *getDistanceFieldRenderer() = 0;
- virtual IRenderList &GetRenderList() = 0;
- virtual IPathManager &GetPathManager() = 0;
- virtual IShaderProgramGenerator &GetShaderProgramGenerator() = 0;
- virtual IDefaultMaterialShaderGenerator &GetDefaultMaterialShaderGenerator() = 0;
- virtual ICustomMaterialShaderGenerator &GetCustomMaterialShaderGenerator() = 0;
- // The memory used for the per frame allocator is released as the first step in BeginFrame.
- // This is useful for short lived objects and datastructures.
- virtual NVAllocatorCallback &GetPerFrameAllocator() = 0;
- // Get the number of times EndFrame has been called
- virtual QT3DSU32 GetFrameCount() = 0;
-
- // Get fps
- virtual QPair<QT3DSF32, int> GetFPS() = 0;
- // Set fps by higher level, etc application
- virtual void SetFPS(QPair<QT3DSF32, int> inFPS) = 0;
- virtual void SetFrameTime(QT3DSF32 time) = 0;
- virtual QVector<QT3DSF32> GetFrameTimes() const = 0;
-
- // Currently there are a few things that need to work differently
- // in authoring mode vs. runtime. The particle effects, for instance
- // need to be framerate-independent at runtime but framerate-dependent during
- // authoring time assuming virtual 16 ms frames.
- // Defaults to falst.
- virtual bool IsAuthoringMode() = 0;
- virtual void SetAuthoringMode(bool inMode) = 0;
-
- // This one is setup by the runtime binding
- virtual ITextRenderer *GetOnscreenTextRenderer() = 0;
- virtual ITextTextureAtlas *GetTextureAtlas() = 0;
-
- // Sub presentations change the rendering somewhat.
- virtual bool IsInSubPresentation() = 0;
- virtual void SetInSubPresentation(bool inValue) = 0;
- virtual void SetSceneColor(Option<QT3DSVec4> inSceneColor) = 0;
- virtual void SetMatteColor(Option<QT3DSVec4> inMatteColor) = 0;
-
- // Render screen aligned 2D text at x,y
- virtual void RenderText2D(QT3DSF32 x, QT3DSF32 y, qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
- const char *text) = 0;
- // render Gpu profiler values
- virtual void RenderGpuProfilerStats(QT3DSF32 x, QT3DSF32 y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor) = 0;
-
- // The reason you can set both window dimensions and an overall viewport is that the mouse
- // needs to be inverted
- // which requires the window height, and then the rest of the system really requires the
- // viewport.
- virtual void SetWindowDimensions(const QSize &inWindowDimensions) = 0;
- virtual QSize GetWindowDimensions() = 0;
-
- // In addition to the window dimensions which really have to be set, you can optionally
- // set the viewport which will force the entire viewer to render specifically to this
- // viewport.
- virtual void SetViewport(Option<NVRenderRect> inViewport) = 0;
- virtual Option<NVRenderRect> GetViewport() const = 0;
- virtual NVRenderRect GetContextViewport() const = 0;
- // Only valid between calls to Begin,End.
- virtual NVRenderRect GetPresentationViewport() const = 0;
-
- virtual void SetScaleMode(ScaleModes::Enum inMode) = 0;
- virtual ScaleModes::Enum GetScaleMode() = 0;
-
- virtual void SetWireframeMode(bool inEnable) = 0;
- virtual bool GetWireframeMode() = 0;
-
- // Return the viewport the system is using to render data to. This gives the the dimensions
- // of the rendered system. It is dependent on but not equal to the viewport.
- virtual NVRenderRectF GetDisplayViewport() const = 0;
-
- // Layers require the current presentation dimensions in order to render.
- virtual void
- SetPresentationDimensions(const QSize &inPresentationDimensions) = 0;
- virtual QSize GetCurrentPresentationDimensions() const = 0;
-
- virtual void SetRenderRotation(RenderRotationValues::Enum inRotation) = 0;
- virtual RenderRotationValues::Enum GetRenderRotation() const = 0;
-
- virtual QT3DSVec2 GetMousePickViewport() const = 0;
- virtual QT3DSVec2 GetMousePickMouseCoords(const QT3DSVec2 &inMouseCoords) const = 0;
-
- // Valid during and just after prepare for render.
- virtual QT3DSVec2 GetPresentationScaleFactor() const = 0;
-
- // Steps needed to render:
- // 1. BeginFrame - sets up new target in render graph
- // 2. Add everything you need to the render graph
- // 3. RunRenderGraph - runs the graph, rendering things to main render target
- // 4. Render any additional stuff to main render target on top of previously rendered
- // information
- // 5. EndFrame
-
- // Clients need to call this every frame in order for various subsystems to release
- // temporary per-frame allocated objects.
- // Also sets up the viewport according to SetViewportInfo
- // and the topmost presentation dimensions. Expects there to be exactly one presentation
- // dimension pushed at this point.
- // This also starts a render target in the render graph.
- virtual void BeginFrame(bool firstFrame) = 0;
-
- // This runs through the added tasks in reverse order. This is used to render dependencies
- // before rendering to the main render target.
- virtual void RunRenderTasks() = 0;
- // Now you can render to the main render target if you want to render over the top
- // of everything.
- // Next call end frame.
- virtual void EndFrame() = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialRenderContext.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialRenderContext.h
deleted file mode 100644
index 5283660c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialRenderContext.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CUSTOM_MATERIAL_RENDER_CONTEXT_H
-#define QT3DS_RENDER_CUSTOM_MATERIAL_RENDER_CONTEXT_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSMat44.h"
-#include "foundation/Qt3DSMat33.h"
-#include "Qt3DSRenderShaderKeys.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SLayerRenderData;
-
- struct SCustomMaterialRenderContext
- {
- // The lights and camera will not change per layer,
- // so that information can be set once for all the shaders.
- const SLayer &m_Layer;
- const SLayerRenderData &m_LayerData;
- NVDataRef<SLight *> m_Lights;
- const SCamera &m_Camera;
-
- // Per-object information.
- const SModel &m_Model;
- const SRenderSubset &m_Subset;
- const QT3DSMat44 &m_ModelViewProjection;
- const QT3DSMat44 &m_ModelMatrix; ///< model to world transformation
- const QT3DSMat33 &m_NormalMatrix;
- const SCustomMaterial &m_Material;
- const NVRenderTexture2D *m_DepthTexture;
- const NVRenderTexture2D *m_AOTexture;
- SShaderDefaultMaterialKey m_MaterialKey;
- SRenderableImage *m_FirstImage;
- QT3DSF32 m_Opacity;
-
- SCustomMaterialRenderContext(
- const SLayer &layer, const SLayerRenderData &data, NVDataRef<SLight *> lights,
- const SCamera &cam, const SModel &m, const SRenderSubset &subset, const QT3DSMat44 &mvp,
- const QT3DSMat44 &world, const QT3DSMat33 &nm, const SCustomMaterial &material,
- const NVRenderTexture2D *depthTex, const NVRenderTexture2D *aoTex,
- SShaderDefaultMaterialKey inMaterialKey, SRenderableImage *inFirstImage = NULL,
- QT3DSF32 opacity = 1.0)
- : m_Layer(layer)
- , m_LayerData(data)
- , m_Lights(lights)
- , m_Camera(cam)
- , m_Model(m)
- , m_Subset(subset)
- , m_ModelViewProjection(mvp)
- , m_ModelMatrix(world)
- , m_NormalMatrix(nm)
- , m_Material(material)
- , m_DepthTexture(depthTex)
- , m_AOTexture(aoTex)
- , m_MaterialKey(inMaterialKey)
- , m_FirstImage(inFirstImage)
- , m_Opacity(opacity)
- {
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.cpp
deleted file mode 100644
index 62205ecd..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.cpp
+++ /dev/null
@@ -1,1265 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderCustomMaterialShaderGenerator.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "Qt3DSRenderableImage.h"
-#include "Qt3DSRenderImage.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderLight.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderShadowMap.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderLightConstantProperties.h"
-
-using namespace qt3ds::render;
-using qt3ds::render::NVRenderCachedShaderProperty;
-using qt3ds::render::NVRenderCachedShaderBuffer;
-
-namespace {
-struct SShaderLightProperties
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- RenderLightTypes::Enum m_LightType;
- SLightSourceShader m_LightData;
- volatile QT3DSI32 mRefCount;
-
- SShaderLightProperties(NVRenderShaderProgram &inShader)
- : m_Shader(inShader)
- , m_LightType(RenderLightTypes::Directional)
- , mRefCount(0)
- {
- }
-
- void Set(const SLight *inLight)
- {
- QT3DSVec3 dir(0, 0, 1);
- if (inLight->m_LightType == RenderLightTypes::Directional) {
- dir = inLight->GetScalingCorrectDirection();
- // we lit in world sapce
- dir *= -1;
- m_LightData.m_position = QT3DSVec4(dir, 0.0);
- } else if (inLight->m_LightType == RenderLightTypes::Area) {
- dir = inLight->GetScalingCorrectDirection();
- m_LightData.m_position = QT3DSVec4(inLight->GetGlobalPos(), 1.0);
- } else {
- dir = inLight->GetGlobalPos();
- m_LightData.m_position = QT3DSVec4(dir, 1.0);
- }
-
- m_LightType = inLight->m_LightType;
-
- m_LightData.m_direction = QT3DSVec4(dir, 0.0);
-
- float normalizedBrightness = inLight->m_Brightness / 100.0f;
- m_LightData.m_diffuse = QT3DSVec4(inLight->m_DiffuseColor.getXYZ() * normalizedBrightness,
- inLight->m_DiffuseColor.w);
- m_LightData.m_specular = QT3DSVec4(inLight->m_SpecularColor.getXYZ() * normalizedBrightness,
- inLight->m_DiffuseColor.w);
-
- if (inLight->m_LightType == RenderLightTypes::Area) {
- m_LightData.m_width = inLight->m_AreaWidth;
- m_LightData.m_height = inLight->m_AreaWidth;
-
- QT3DSMat33 theDirMatrix(inLight->m_GlobalTransform.getUpper3x3());
- m_LightData.m_right =
- QT3DSVec4(theDirMatrix.transform(QT3DSVec3(1, 0, 0)), inLight->m_AreaWidth);
- m_LightData.m_up =
- QT3DSVec4(theDirMatrix.transform(QT3DSVec3(0, 1, 0)), inLight->m_AreaHeight);
- } else {
- m_LightData.m_width = 0.0;
- m_LightData.m_height = 0.0;
- m_LightData.m_right = QT3DSVec4(0.0f);
- m_LightData.m_up = QT3DSVec4(0.0f);
-
- // These components only apply to CG lights
- m_LightData.m_ambient = inLight->m_AmbientColor;
-
- m_LightData.m_constantAttenuation = 1.0;
- m_LightData.m_linearAttenuation = inLight->m_LinearFade;
- m_LightData.m_quadraticAttenuation = inLight->m_ExponentialFade;
- m_LightData.m_spotCutoff = 180.0;
- }
-
- if (m_LightType == RenderLightTypes::Point) {
- m_LightData.m_shadowView = QT3DSMat44::createIdentity();
- } else {
- m_LightData.m_shadowView = inLight->m_GlobalTransform;
- }
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-
- static SShaderLightProperties CreateLightEntry(NVRenderShaderProgram &inShader)
- {
- return SShaderLightProperties(inShader);
- }
-};
-
-/**
- * Cached texture property lookups, used one per texture so a shader generator for N
- * textures will have an array of N of these lookup objects.
- */
-struct SShaderTextureProperties
-{
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
- NVRenderCachedShaderProperty<QT3DSVec3> m_Offsets;
- NVRenderCachedShaderProperty<QT3DSVec4> m_Rotations;
- SShaderTextureProperties(const char *sampName, const char *offName, const char *rotName,
- NVRenderShaderProgram &inShader)
- : m_Sampler(sampName, inShader)
- , m_Offsets(offName, inShader)
- , m_Rotations(rotName, inShader)
- {
- }
- SShaderTextureProperties() {}
-};
-
-/* We setup some shared state on the custom material shaders */
-struct SShaderGeneratorGeneratedShader
-{
- typedef nvhash_map<QT3DSU32, SShaderTextureProperties> TCustomMaterialImagMap;
-
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- // Specific properties we know the shader has to have.
- NVRenderCachedShaderProperty<QT3DSMat44> m_ModelMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewProjMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewMatrix;
- NVRenderCachedShaderProperty<QT3DSMat33> m_NormalMatrix;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraPos;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ProjMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewportMatrix;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CamProperties;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_DepthTexture;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_AOTexture;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LightProbe;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeProps;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeOpts;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeRot;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeOfs;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LightProbe2;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbe2Props;
- NVRenderCachedShaderProperty<QT3DSI32> m_LightCount;
- NVRenderCachedShaderProperty<QT3DSI32> m_AreaLightCount;
- NVRenderCachedShaderProperty<QT3DSI32> m_ShadowMapCount;
- NVRenderCachedShaderProperty<QT3DSI32> m_ShadowCubeCount;
- NVRenderCachedShaderProperty<QT3DSF32> m_Opacity;
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_AoShadowParams;
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_LightsBuffer;
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_AreaLightsBuffer;
-
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *m_lightsProperties;
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *m_areaLightsProperties;
-
- typedef NVRenderCachedShaderPropertyArray<NVRenderTexture2D *,
- QT3DS_MAX_NUM_SHADOWS> ShadowMapPropertyArray;
- typedef NVRenderCachedShaderPropertyArray<NVRenderTextureCube *,
- QT3DS_MAX_NUM_SHADOWS> ShadowCubePropertyArray;
-
- ShadowMapPropertyArray m_shadowMaps;
- ShadowCubePropertyArray m_shadowCubes;
-
- // Cache the image property name lookups
- TCustomMaterialImagMap m_Images; // Images external to custom material usage
- volatile QT3DSI32 m_RefCount;
-
- SShaderGeneratorGeneratedShader(NVRenderShaderProgram &inShader, NVRenderContext &inContext)
- : m_Allocator(inContext.GetAllocator())
- , m_Shader(inShader)
- , m_ModelMatrix("model_matrix", inShader)
- , m_ViewProjMatrix("model_view_projection", inShader)
- , m_ViewMatrix("view_matrix", inShader)
- , m_NormalMatrix("normal_matrix", inShader)
- , m_CameraPos("camera_position", inShader)
- , m_ProjMatrix("view_projection_matrix", inShader)
- , m_ViewportMatrix("viewport_matrix", inShader)
- , m_CamProperties("camera_properties", inShader)
- , m_DepthTexture("depth_sampler", inShader)
- , m_AOTexture("ao_sampler", inShader)
- , m_LightProbe("light_probe", inShader)
- , m_LightProbeProps("light_probe_props", inShader)
- , m_LightProbeOpts("light_probe_opts", inShader)
- , m_LightProbeRot("light_probe_rotation", inShader)
- , m_LightProbeOfs("light_probe_offset", inShader)
- , m_LightProbe2("light_probe2", inShader)
- , m_LightProbe2Props("light_probe2_props", inShader)
- , m_LightCount("uNumLights", inShader)
- , m_AreaLightCount("uNumAreaLights", inShader)
- , m_ShadowMapCount("uNumShadowMaps", inShader)
- , m_ShadowCubeCount("uNumShadowCubes", inShader)
- , m_Opacity("object_opacity", inShader)
- , m_AoShadowParams("cbAoShadow", inShader)
- , m_LightsBuffer("cbBufferLights", inShader)
- , m_AreaLightsBuffer("cbBufferAreaLights", inShader)
- , m_lightsProperties(nullptr)
- , m_areaLightsProperties(nullptr)
- , m_shadowMaps("shadowMaps[0]", inShader)
- , m_shadowCubes("shadowCubes[0]", inShader)
- , m_Images(inContext.GetAllocator(), "SShaderGeneratorGeneratedShader::m_Images")
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
-
- ~SShaderGeneratorGeneratedShader()
- {
- m_Shader.release();
- delete m_lightsProperties;
- delete m_areaLightsProperties;
- }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Allocator);
- NVDelete(alloc, this);
- }
- }
-
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *GetLightProperties(int count)
- {
- if (!m_lightsProperties || m_areaLightsProperties->m_lightCountInt < count) {
- if (m_lightsProperties)
- delete m_lightsProperties;
- m_lightsProperties = new SLightConstantProperties<SShaderGeneratorGeneratedShader>
- ("lights", "uNumLights", *this, false, count);
- }
- return m_lightsProperties;
- }
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *GetAreaLightProperties(int count)
- {
- if (!m_areaLightsProperties || m_areaLightsProperties->m_lightCountInt < count) {
- if (m_areaLightsProperties)
- delete m_areaLightsProperties;
- m_areaLightsProperties = new SLightConstantProperties<SShaderGeneratorGeneratedShader>
- ("areaLights", "uNumAreaLights", *this, false, count);
- }
- return m_areaLightsProperties;
- }
-};
-
-struct SShaderGenerator : public ICustomMaterialShaderGenerator
-{
- typedef Qt3DSString TStrType;
- typedef nvhash_map<NVRenderShaderProgram *, NVScopedRefCounted<SShaderGeneratorGeneratedShader>>
- TProgramToShaderMap;
- typedef eastl::pair<size_t, NVScopedRefCounted<SShaderLightProperties>>
- TCustomMaterialLightEntry;
- typedef eastl::pair<size_t, NVRenderCachedShaderProperty<NVRenderTexture2D *>> TShadowMapEntry;
- typedef eastl::pair<size_t, NVRenderCachedShaderProperty<NVRenderTextureCube *>>
- TShadowCubeEntry;
- typedef qt3ds::foundation::nvhash_map<CRegisteredString,
- NVScopedRefCounted<qt3ds::render::NVRenderConstantBuffer>>
- TStrConstanBufMap;
-
- IQt3DSRenderContext &m_RenderContext;
- IShaderProgramGenerator &m_ProgramGenerator;
-
- const SCustomMaterial *m_CurrentMaterial;
- SShaderDefaultMaterialKey *m_CurrentKey;
- IDefaultMaterialVertexPipeline *m_CurrentPipeline;
- TShaderFeatureSet m_CurrentFeatureSet;
- NVDataRef<SLight *> m_Lights;
- SRenderableImage *m_FirstImage;
- bool m_HasTransparency;
-
- TStrType m_ImageStem;
- TStrType m_ImageSampler;
- TStrType m_ImageFragCoords;
- TStrType m_ImageRotScale;
- TStrType m_ImageOffset;
-
- eastl::string m_GeneratedShaderString;
-
- SShaderDefaultMaterialKeyProperties m_DefaultMaterialShaderKeyProperties;
- TProgramToShaderMap m_ProgramToShaderMap;
-
- nvvector<TCustomMaterialLightEntry> m_LightEntries;
-
- TStrConstanBufMap m_ConstantBuffers; ///< store all constants buffers
-
- QT3DSI32 m_RefCount;
-
- SShaderGenerator(IQt3DSRenderContext &inRc)
- : m_RenderContext(inRc)
- , m_ProgramGenerator(m_RenderContext.GetShaderProgramGenerator())
- , m_CurrentMaterial(NULL)
- , m_CurrentKey(NULL)
- , m_CurrentPipeline(NULL)
- , m_FirstImage(NULL)
- , m_HasTransparency(false)
- , m_ProgramToShaderMap(inRc.GetAllocator(), "m_ProgramToShaderMap")
- , m_LightEntries(inRc.GetAllocator(), "m_LightEntries")
- , m_ConstantBuffers(inRc.GetAllocator(), "m_ConstantBuffers")
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- m_ConstantBuffers.clear();
- NVDelete(m_RenderContext.GetAllocator(), this);
- }
- }
-
- IShaderProgramGenerator &ProgramGenerator() { return m_ProgramGenerator; }
- IDefaultMaterialVertexPipeline &VertexGenerator() { return *m_CurrentPipeline; }
- IShaderStageGenerator &FragmentGenerator()
- {
- return *m_ProgramGenerator.GetStage(ShaderGeneratorStages::Fragment);
- }
- SShaderDefaultMaterialKey &Key() { return *m_CurrentKey; }
- const SCustomMaterial &Material() { return *m_CurrentMaterial; }
- TShaderFeatureSet FeatureSet() { return m_CurrentFeatureSet; }
- bool HasTransparency() { return m_HasTransparency; }
-
- QT3DSU32
- ConvertTextureTypeValue(ImageMapTypes::Enum inType)
- {
- NVRenderTextureTypeValue::Enum retVal = NVRenderTextureTypeValue::Unknown;
-
- switch (inType) {
- case ImageMapTypes::LightmapIndirect:
- retVal = NVRenderTextureTypeValue::LightmapIndirect;
- break;
- case ImageMapTypes::LightmapRadiosity:
- retVal = NVRenderTextureTypeValue::LightmapRadiosity;
- break;
- case ImageMapTypes::LightmapShadow:
- retVal = NVRenderTextureTypeValue::LightmapShadow;
- break;
- case ImageMapTypes::Bump:
- retVal = NVRenderTextureTypeValue::Bump;
- break;
- case ImageMapTypes::Diffuse:
- retVal = NVRenderTextureTypeValue::Diffuse;
- break;
- case ImageMapTypes::Displacement:
- retVal = NVRenderTextureTypeValue::Displace;
- break;
- default:
- retVal = NVRenderTextureTypeValue::Unknown;
- break;
- }
-
- QT3DS_ASSERT(retVal != NVRenderTextureTypeValue::Unknown);
-
- return (QT3DSU32)retVal;
- }
-
- SImageVariableNames GetImageVariableNames(QT3DSU32 imageIdx) override
- {
- // convert to NVRenderTextureTypeValue
- NVRenderTextureTypeValue::Enum texType = (NVRenderTextureTypeValue::Enum)imageIdx;
- m_ImageStem.assign(NVRenderTextureTypeValue::toString(texType));
- m_ImageStem.append("_");
- m_ImageSampler = m_ImageStem;
- m_ImageSampler.append("sampler");
- m_ImageFragCoords = m_ImageStem;
- m_ImageFragCoords.append("uv_coords");
- m_ImageRotScale = m_ImageStem;
- m_ImageRotScale.append("rot_scale");
- m_ImageOffset = m_ImageStem;
- m_ImageOffset.append("offset");
-
- SImageVariableNames retVal;
- retVal.m_ImageSampler = m_ImageSampler.c_str();
- retVal.m_ImageFragCoords = m_ImageFragCoords.c_str();
- return retVal;
- }
-
- void SetImageShaderVariables(SShaderGeneratorGeneratedShader &inShader,
- SRenderableImage &inImage)
- {
- // skip displacement and emissive mask maps which are handled differently
- if (inImage.m_MapType == ImageMapTypes::Displacement
- || inImage.m_MapType == ImageMapTypes::Emissive)
- return;
-
- SShaderGeneratorGeneratedShader::TCustomMaterialImagMap::iterator iter =
- inShader.m_Images.find(inImage.m_MapType);
- if (iter == inShader.m_Images.end()) {
- SImageVariableNames names =
- GetImageVariableNames(ConvertTextureTypeValue(inImage.m_MapType));
- inShader.m_Images.insert(eastl::make_pair(
- (QT3DSU32)inImage.m_MapType,
- SShaderTextureProperties(names.m_ImageSampler, m_ImageOffset.c_str(),
- m_ImageRotScale.c_str(), inShader.m_Shader)));
- iter = inShader.m_Images.find(inImage.m_MapType);
- }
-
- SShaderTextureProperties &theShaderProps = iter->second;
- const QT3DSMat44 &textureTransform = inImage.m_Image.m_TextureTransform;
- const QT3DSF32 *dataPtr(textureTransform.front());
- QT3DSVec3 offsets(dataPtr[12], dataPtr[13], 0.0f);
- // Grab just the upper 2x2 rotation matrix from the larger matrix.
- QT3DSVec4 rotations(dataPtr[0], dataPtr[4], dataPtr[1], dataPtr[5]);
-
- // The image horizontal and vertical tiling modes need to be set here, before we set texture
- // on the shader.
- // because setting the image on the texture forces the textue to bind and immediately apply
- // any tex params.
- inImage.m_Image.m_TextureData.m_Texture->SetTextureWrapS(
- inImage.m_Image.m_HorizontalTilingMode);
- inImage.m_Image.m_TextureData.m_Texture->SetTextureWrapT(
- inImage.m_Image.m_VerticalTilingMode);
-
- theShaderProps.m_Sampler.Set(inImage.m_Image.m_TextureData.m_Texture);
- theShaderProps.m_Offsets.Set(offsets);
- theShaderProps.m_Rotations.Set(rotations);
- }
-
- void GenerateImageUVCoordinates(IShaderStageGenerator &, QT3DSU32, QT3DSU32, SRenderableImage &) override {}
-
- ///< get the light constant buffer and generate if necessary
- NVRenderConstantBuffer *GetLightConstantBuffer(const char *name, QT3DSU32 inLightCount)
- {
- NVRenderContext &theContext(m_RenderContext.GetRenderContext());
-
- // we assume constant buffer support
- QT3DS_ASSERT(theContext.GetConstantBufferSupport());
- // we only create if if we have lights
- if (!inLightCount || !theContext.GetConstantBufferSupport())
- return NULL;
-
- CRegisteredString theName = theContext.GetStringTable().RegisterStr(name);
- NVRenderConstantBuffer *pCB = theContext.GetConstantBuffer(theName);
-
- if (!pCB) {
- // create with size of all structures + int for light count
- SLightSourceShader s[QT3DS_MAX_NUM_LIGHTS];
- NVDataRef<QT3DSU8> cBuffer((QT3DSU8 *)&s, (sizeof(SLightSourceShader) * QT3DS_MAX_NUM_LIGHTS)
- + (4 * sizeof(QT3DSI32)));
- pCB = theContext.CreateConstantBuffer(
- name, qt3ds::render::NVRenderBufferUsageType::Static,
- (sizeof(SLightSourceShader) * QT3DS_MAX_NUM_LIGHTS) + (4 * sizeof(QT3DSI32)), cBuffer);
- if (!pCB) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- // init first set
- memset(&s[0], 0x0, sizeof(SLightSourceShader) * QT3DS_MAX_NUM_LIGHTS);
- QT3DSI32 cgLights[4] = {0, 0, 0, 0};
- pCB->UpdateRaw(0, NVDataRef<QT3DSU8>((QT3DSU8 *)&cgLights, sizeof(QT3DSI32) * 4));
- pCB->UpdateRaw(4 * sizeof(QT3DSI32),
- NVDataRef<QT3DSU8>((QT3DSU8 *)&s[0],
- sizeof(SLightSourceShader) * QT3DS_MAX_NUM_LIGHTS));
- pCB->Update(); // update to hardware
-
- m_ConstantBuffers.insert(eastl::make_pair(theName, pCB));
- }
-
- return pCB;
- }
-
- bool GenerateVertexShader(SShaderDefaultMaterialKey &, const char8_t *inShaderPathName)
- {
- qt3ds::render::IDynamicObjectSystem &theDynamicSystem(
- m_RenderContext.GetDynamicObjectSystem());
- Qt3DSString theShaderBuffer;
- theDynamicSystem.GetShaderSource(
- m_RenderContext.GetStringTable().RegisterStr(inShaderPathName), theShaderBuffer);
-
- eastl::string srcString(theShaderBuffer.c_str());
-
- // Check if the vertex shader portion already contains a main function
- // The same string contains both the vertex and the fragment shader
- // The last "#ifdef FRAGMENT_SHADER" should mark the start of the fragment shader
- eastl_size_t fragmentDefStart = srcString.find("#ifdef FRAGMENT_SHADER");
- eastl_size_t nextIndex = fragmentDefStart;
- while (nextIndex != eastl::string::npos) {
- nextIndex = srcString.find("#ifdef FRAGMENT_SHADER", nextIndex + 1);
- if (nextIndex != eastl::string::npos)
- fragmentDefStart = nextIndex;
- }
- eastl_size_t mainStart = srcString.find("void main()");
-
- if (mainStart != eastl::string::npos && (fragmentDefStart == eastl::string::npos
- || mainStart < fragmentDefStart)) {
- TShaderGeneratorStageFlags stages(IShaderProgramGenerator::DefaultFlags());
- ProgramGenerator().BeginProgram(stages);
- IDefaultMaterialVertexPipeline &vertexShader(VertexGenerator());
- vertexShader << "#define VERTEX_SHADER\n\n";
- vertexShader << srcString.data() << Endl;
- return true;
- }
-
- // vertex displacement
- QT3DSU32 imageIdx = 0;
- SRenderableImage *displacementImage = NULL;
- QT3DSU32 displacementImageIdx = 0;
-
- for (SRenderableImage *img = m_FirstImage; img != NULL;
- img = img->m_NextImage, ++imageIdx) {
- if (img->m_MapType == ImageMapTypes::Displacement) {
- displacementImage = img;
- displacementImageIdx = imageIdx;
- break;
- }
- }
-
- // the pipeline opens/closes up the shaders stages
- VertexGenerator().BeginVertexGeneration(displacementImageIdx, displacementImage);
- return false;
- }
-
- SShaderGeneratorGeneratedShader &GetShaderForProgram(NVRenderShaderProgram &inProgram)
- {
- eastl::pair<TProgramToShaderMap::iterator, bool> inserter =
- m_ProgramToShaderMap.insert(eastl::make_pair(
- &inProgram, NVScopedRefCounted<SShaderGeneratorGeneratedShader>(NULL)));
- if (inserter.second) {
- NVAllocatorCallback &alloc(m_RenderContext.GetRenderContext().GetAllocator());
- inserter.first->second = QT3DS_NEW(alloc, SShaderGeneratorGeneratedShader)(
- inProgram, m_RenderContext.GetRenderContext());
- }
- return *inserter.first->second;
- }
-
- virtual SShaderLightProperties *SetLight(NVRenderShaderProgram &inShader, size_t lightIdx,
- size_t shadeIdx, const SLight *inLight,
- SShadowMapEntry *inShadow, QT3DSI32 shadowIdx,
- QT3DSF32 shadowDist)
- {
- SShaderLightProperties *theLightEntry(NULL);
- for (QT3DSU32 idx = 0, end = m_LightEntries.size(); idx < end && theLightEntry == NULL;
- ++idx) {
- if (m_LightEntries[idx].first == lightIdx
- && m_LightEntries[idx].second->m_Shader.mPtr == &inShader
- && m_LightEntries[idx].second->m_LightType == inLight->m_LightType) {
- theLightEntry = m_LightEntries[idx].second;
- }
- }
- if (theLightEntry == NULL) {
- // create a new name
- eastl::string lightName;
- if (inLight->m_LightType == RenderLightTypes::Area)
- lightName = "arealights";
- else
- lightName = "lights";
- char buf[16];
- _snprintf(buf, 16, "[%d]", int(shadeIdx));
- lightName.append(buf);
-
- NVScopedRefCounted<SShaderLightProperties> theNewEntry =
- QT3DS_NEW(m_RenderContext.GetAllocator(),
- SShaderLightProperties)(SShaderLightProperties::CreateLightEntry(inShader));
- m_LightEntries.push_back(eastl::make_pair(lightIdx, theNewEntry));
- theLightEntry = theNewEntry.mPtr;
- }
- theLightEntry->Set(inLight);
- theLightEntry->m_LightData.m_shadowControls =
- QT3DSVec4(inLight->m_ShadowBias, inLight->m_ShadowFactor, shadowDist, 0.0);
- theLightEntry->m_LightData.m_shadowIdx = (inShadow) ? shadowIdx : -1;
-
- return theLightEntry;
- }
-
- void SetShadowMaps(NVRenderShaderProgram &inProgram, SShadowMapEntry *inShadow,
- QT3DSI32 &numShadowMaps, QT3DSI32 &numShadowCubes, bool shadowMap,
- SShaderGeneratorGeneratedShader::ShadowMapPropertyArray &shadowMaps,
- SShaderGeneratorGeneratedShader::ShadowCubePropertyArray &shadowCubes)
- {
- Q_UNUSED(inProgram)
- if (inShadow) {
- if (shadowMap == false && inShadow->m_DepthCube
- && (numShadowCubes < QT3DS_MAX_NUM_SHADOWS)) {
- shadowCubes.m_array[numShadowCubes] = inShadow->m_DepthCube.mPtr;
- ++numShadowCubes;
- } else if (shadowMap && inShadow->m_DepthMap
- && (numShadowMaps < QT3DS_MAX_NUM_SHADOWS)) {
- shadowMaps.m_array[numShadowMaps] = inShadow->m_DepthMap.mPtr;
- ++numShadowMaps;
- }
- }
- }
-
- void SetGlobalProperties(NVRenderShaderProgram &inProgram, const SLayer & /*inLayer*/
- ,
- SCamera &inCamera, QT3DSVec3, NVDataRef<SLight *> inLights,
- NVDataRef<QT3DSVec3>, Qt3DSShadowMap *inShadowMaps)
- {
- SShaderGeneratorGeneratedShader &theShader(GetShaderForProgram(inProgram));
- m_RenderContext.GetRenderContext().SetActiveShader(&inProgram);
-
- SCamera &theCamera(inCamera);
-
- QT3DSVec2 camProps(theCamera.m_ClipNear, theCamera.m_ClipFar);
- theShader.m_CamProperties.Set(camProps);
- theShader.m_CameraPos.Set(theCamera.GetGlobalPos());
-
- if (theShader.m_ViewMatrix.IsValid())
- theShader.m_ViewMatrix.Set(theCamera.m_GlobalTransform.getInverse());
-
- if (theShader.m_ProjMatrix.IsValid()) {
- QT3DSMat44 vProjMat;
- inCamera.CalculateViewProjectionMatrix(vProjMat);
- theShader.m_ProjMatrix.Set(vProjMat);
- }
-
- // set lights separate for area lights
- QT3DSI32 cgLights = 0, areaLights = 0;
- QT3DSI32 numShadowMaps = 0, numShadowCubes = 0;
-
- // this call setup the constant buffer for ambient occlusion and shadow
- theShader.m_AoShadowParams.Set();
-
- if (m_RenderContext.GetRenderContext().GetConstantBufferSupport()) {
- NVRenderConstantBuffer *pLightCb =
- GetLightConstantBuffer("cbBufferLights", inLights.size());
- NVRenderConstantBuffer *pAreaLightCb =
- GetLightConstantBuffer("cbBufferAreaLights", inLights.size());
-
- // Split the count between CG lights and area lights
- for (QT3DSU32 lightIdx = 0; lightIdx < inLights.size() && pLightCb; ++lightIdx) {
- SShadowMapEntry *theShadow = NULL;
- if (inShadowMaps && inLights[lightIdx]->m_CastShadow)
- theShadow = inShadowMaps->GetShadowMapEntry(lightIdx);
-
- QT3DSI32 shdwIdx = (inLights[lightIdx]->m_LightType
- != RenderLightTypes::Directional)
- ? numShadowCubes
- : numShadowMaps;
- SetShadowMaps(inProgram, theShadow, numShadowMaps, numShadowCubes,
- inLights[lightIdx]->m_LightType == RenderLightTypes::Directional,
- theShader.m_shadowMaps, theShader.m_shadowCubes);
-
- if (inLights[lightIdx]->m_LightType == RenderLightTypes::Area) {
- SShaderLightProperties *theAreaLightEntry =
- SetLight(inProgram, lightIdx, areaLights, inLights[lightIdx], theShadow,
- shdwIdx, inCamera.m_ClipFar);
-
- if (theAreaLightEntry && pAreaLightCb) {
- pAreaLightCb->UpdateRaw(
- areaLights * sizeof(SLightSourceShader) + (4 * sizeof(QT3DSI32)),
- NVDataRef<QT3DSU8>((QT3DSU8 *)&theAreaLightEntry->m_LightData,
- sizeof(SLightSourceShader)));
- }
-
- areaLights++;
- } else {
- SShaderLightProperties *theLightEntry =
- SetLight(inProgram, lightIdx, cgLights, inLights[lightIdx], theShadow,
- shdwIdx, inCamera.m_ClipFar);
-
- if (theLightEntry && pLightCb) {
- pLightCb->UpdateRaw(
- cgLights * sizeof(SLightSourceShader) + (4 * sizeof(QT3DSI32)),
- NVDataRef<QT3DSU8>((QT3DSU8 *)&theLightEntry->m_LightData,
- sizeof(SLightSourceShader)));
- }
-
- cgLights++;
- }
- }
-
- if (pLightCb) {
- pLightCb->UpdateRaw(0, NVDataRef<QT3DSU8>((QT3DSU8 *)&cgLights, sizeof(QT3DSI32)));
- theShader.m_LightsBuffer.Set();
- }
- if (pAreaLightCb) {
- pAreaLightCb->UpdateRaw(0, NVDataRef<QT3DSU8>((QT3DSU8 *)&areaLights,
- sizeof(QT3DSI32)));
- theShader.m_AreaLightsBuffer.Set();
- }
-
- theShader.m_LightCount.Set(cgLights);
- theShader.m_AreaLightCount.Set(areaLights);
- } else {
- QVector<SShaderLightProperties *> lprop;
- QVector<SShaderLightProperties *> alprop;
- for (QT3DSU32 lightIdx = 0; lightIdx < inLights.size(); ++lightIdx) {
-
- SShadowMapEntry *theShadow = NULL;
- if (inShadowMaps && inLights[lightIdx]->m_CastShadow)
- theShadow = inShadowMaps->GetShadowMapEntry(lightIdx);
-
- QT3DSI32 shdwIdx = (inLights[lightIdx]->m_LightType
- != RenderLightTypes::Directional)
- ? numShadowCubes
- : numShadowMaps;
- SetShadowMaps(inProgram, theShadow, numShadowMaps, numShadowCubes,
- inLights[lightIdx]->m_LightType == RenderLightTypes::Directional,
- theShader.m_shadowMaps, theShader.m_shadowCubes);
-
- SShaderLightProperties *p = SetLight(inProgram, lightIdx, areaLights,
- inLights[lightIdx], theShadow,
- shdwIdx, inCamera.m_ClipFar);
- if (inLights[lightIdx]->m_LightType == RenderLightTypes::Area)
- alprop.push_back(p);
- else
- lprop.push_back(p);
- }
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *lightProperties
- = theShader.GetLightProperties(lprop.size());
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *areaLightProperties
- = theShader.GetAreaLightProperties(alprop.size());
-
- lightProperties->updateLights(lprop);
- areaLightProperties->updateLights(alprop);
-
- theShader.m_LightCount.Set(lprop.size());
- theShader.m_AreaLightCount.Set(alprop.size());
- }
- for (int i = numShadowMaps; i < QT3DS_MAX_NUM_SHADOWS; ++i)
- theShader.m_shadowMaps.m_array[i] = NULL;
- for (int i = numShadowCubes; i < QT3DS_MAX_NUM_SHADOWS; ++i)
- theShader.m_shadowCubes.m_array[i] = NULL;
- theShader.m_shadowMaps.Set(numShadowMaps);
- theShader.m_shadowCubes.Set(numShadowCubes);
- theShader.m_ShadowMapCount.Set(numShadowMaps);
- theShader.m_ShadowCubeCount.Set(numShadowCubes);
- }
-
- void SetMaterialProperties(NVRenderShaderProgram &inProgram, const SCustomMaterial &inMaterial,
- const QT3DSVec2 &, const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix, const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- NVRenderTexture2D *inDepthTexture, NVRenderTexture2D *inSSaoTexture,
- SImage *inLightProbe, SImage *inLightProbe2, QT3DSF32 inProbeHorizon,
- QT3DSF32 inProbeBright, QT3DSF32 inProbe2Window, QT3DSF32 inProbe2Pos,
- QT3DSF32 inProbe2Fade, QT3DSF32 inProbeFOV)
- {
- ICustomMaterialSystem &theMaterialSystem(m_RenderContext.GetCustomMaterialSystem());
- SShaderGeneratorGeneratedShader &theShader(GetShaderForProgram(inProgram));
-
- theShader.m_ViewProjMatrix.Set(inModelViewProjection);
- theShader.m_NormalMatrix.Set(inNormalMatrix);
- theShader.m_ModelMatrix.Set(inGlobalTransform);
-
- theShader.m_DepthTexture.Set(inDepthTexture);
- theShader.m_AOTexture.Set(inSSaoTexture);
-
- theShader.m_Opacity.Set(inOpacity);
-
- qt3ds::render::SImage *theLightProbe = inLightProbe;
- qt3ds::render::SImage *theLightProbe2 = inLightProbe2;
-
- if (inMaterial.m_IblProbe && inMaterial.m_IblProbe->m_TextureData.m_Texture) {
- theLightProbe = inMaterial.m_IblProbe;
- }
-
- if (theLightProbe) {
- if (theLightProbe->m_TextureData.m_Texture) {
- NVRenderTextureCoordOp::Enum theHorzLightProbeTilingMode =
- theLightProbe->m_HorizontalTilingMode;
- NVRenderTextureCoordOp::Enum theVertLightProbeTilingMode =
- theLightProbe->m_VerticalTilingMode;
- theLightProbe->m_TextureData.m_Texture->SetTextureWrapS(
- theHorzLightProbeTilingMode);
- theLightProbe->m_TextureData.m_Texture->SetTextureWrapT(
- theVertLightProbeTilingMode);
-
- const QT3DSMat44 &textureTransform = theLightProbe->m_TextureTransform;
- // We separate rotational information from offset information so that just maybe the
- // shader
- // will attempt to push less information to the card.
- const QT3DSF32 *dataPtr(textureTransform.front());
- // The third member of the offsets contains a flag indicating if the texture was
- // premultiplied or not.
- // We use this to mix the texture alpha.
- // light_probe_offsets.w is now no longer being used to enable/disable fast IBL,
- // (it's now the only option)
- // So now, it's storing the number of mip levels in the IBL image.
- QT3DSVec4 offsets(dataPtr[12], dataPtr[13],
- theLightProbe->m_TextureData.m_TextureFlags.IsPreMultiplied() ? 1.0f
- : 0.0f,
- (float)theLightProbe->m_TextureData.m_Texture->GetNumMipmaps());
- // Fast IBL is always on;
- // inRenderContext.m_Layer.m_FastIbl ? 1.0f : 0.0f );
- // Grab just the upper 2x2 rotation matrix from the larger matrix.
- QT3DSVec4 rotations(dataPtr[0], dataPtr[4], dataPtr[1], dataPtr[5]);
-
- theShader.m_LightProbeRot.Set(rotations);
- theShader.m_LightProbeOfs.Set(offsets);
-
- if ((!inMaterial.m_IblProbe) && (inProbeFOV < 180.f)) {
- theShader.m_LightProbeOpts.Set(
- QT3DSVec4(0.01745329251994329547f * inProbeFOV, 0.0f, 0.0f, 0.0f));
- }
-
- // Also make sure to add the secondary texture, but it should only be added if the
- // primary
- // (i.e. background) texture is also there.
- if (theLightProbe2 && theLightProbe2->m_TextureData.m_Texture) {
- theLightProbe2->m_TextureData.m_Texture->SetTextureWrapS(
- theHorzLightProbeTilingMode);
- theLightProbe2->m_TextureData.m_Texture->SetTextureWrapT(
- theVertLightProbeTilingMode);
- theShader.m_LightProbe2.Set(theLightProbe2->m_TextureData.m_Texture);
- theShader.m_LightProbe2Props.Set(
- QT3DSVec4(inProbe2Window, inProbe2Pos, inProbe2Fade, 1.0f));
-
- const QT3DSMat44 &xform2 = theLightProbe2->m_TextureTransform;
- const QT3DSF32 *dataPtr(xform2.front());
-
- theShader.m_LightProbeProps.Set(
- QT3DSVec4(dataPtr[12], dataPtr[13], inProbeHorizon, inProbeBright * 0.01f));
- } else {
- theShader.m_LightProbe2Props.Set(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
- theShader.m_LightProbeProps.Set(
- QT3DSVec4(0.0f, 0.0f, inProbeHorizon, inProbeBright * 0.01f));
- }
- } else {
- theShader.m_LightProbeProps.Set(QT3DSVec4(0.0f, 0.0f, -1.0f, 0.0f));
- theShader.m_LightProbe2Props.Set(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
- }
-
- theShader.m_LightProbe.Set(theLightProbe->m_TextureData.m_Texture);
-
- } else {
- theShader.m_LightProbeProps.Set(QT3DSVec4(0.0f, 0.0f, -1.0f, 0.0f));
- theShader.m_LightProbe2Props.Set(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
- }
-
- // finally apply custom material shader properties
- theMaterialSystem.ApplyShaderPropertyValues(inMaterial, inProgram);
-
- // additional textures
- for (SRenderableImage *theImage = inFirstImage; theImage; theImage = theImage->m_NextImage)
- SetImageShaderVariables(theShader, *theImage);
- }
-
- void SetMaterialProperties(NVRenderShaderProgram &inProgram,
- const SGraphObject &inMaterial, const QT3DSVec2 &inCameraVec,
- const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix,
- const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- SLayerGlobalRenderProperties inRenderProperties) override
- {
- const SCustomMaterial &theCustomMaterial(
- reinterpret_cast<const SCustomMaterial &>(inMaterial));
- QT3DS_ASSERT(inMaterial.m_Type == GraphObjectTypes::CustomMaterial);
-
- SetGlobalProperties(inProgram, inRenderProperties.m_Layer, inRenderProperties.m_Camera,
- inRenderProperties.m_CameraDirection, inRenderProperties.m_Lights,
- inRenderProperties.m_LightDirections,
- inRenderProperties.m_ShadowMapManager);
-
- SetMaterialProperties(inProgram, theCustomMaterial, inCameraVec, inModelViewProjection,
- inNormalMatrix, inGlobalTransform, inFirstImage, inOpacity,
- inRenderProperties.m_DepthTexture, inRenderProperties.m_SSaoTexture,
- inRenderProperties.m_LightProbe, inRenderProperties.m_LightProbe2,
- inRenderProperties.m_ProbeHorizon, inRenderProperties.m_ProbeBright,
- inRenderProperties.m_Probe2Window, inRenderProperties.m_Probe2Pos,
- inRenderProperties.m_Probe2Fade, inRenderProperties.m_ProbeFOV);
- }
-
- void GenerateLightmapIndirectFunc(IShaderStageGenerator &inFragmentShader,
- SImage *pEmissiveLightmap)
- {
- inFragmentShader << "\n";
- inFragmentShader << "vec3 computeMaterialLightmapIndirect()\n{\n";
- inFragmentShader << " vec4 indirect = vec4( 0.0, 0.0, 0.0, 0.0 );\n";
- if (pEmissiveLightmap) {
- SImageVariableNames names =
- GetImageVariableNames(ConvertTextureTypeValue(ImageMapTypes::LightmapIndirect));
- inFragmentShader.AddUniform(names.m_ImageSampler, "sampler2D");
- inFragmentShader.AddUniform(m_ImageOffset, "vec3");
- inFragmentShader.AddUniform(m_ImageRotScale, "vec4");
-
- inFragmentShader << "\n indirect = evalIndirectLightmap( " << m_ImageSampler
- << ", varTexCoord1, ";
- inFragmentShader << m_ImageRotScale << ", ";
- inFragmentShader << m_ImageOffset << " );\n\n";
- }
-
- inFragmentShader << " return indirect.rgb;\n";
- inFragmentShader << "}\n\n";
- }
-
- void GenerateLightmapRadiosityFunc(IShaderStageGenerator &inFragmentShader,
- SImage *pRadiosityLightmap)
- {
- inFragmentShader << "\n";
- inFragmentShader << "vec3 computeMaterialLightmapRadiosity()\n{\n";
- inFragmentShader << " vec4 radiosity = vec4( 1.0, 1.0, 1.0, 1.0 );\n";
- if (pRadiosityLightmap) {
- SImageVariableNames names =
- GetImageVariableNames(ConvertTextureTypeValue(ImageMapTypes::LightmapRadiosity));
- inFragmentShader.AddUniform(names.m_ImageSampler, "sampler2D");
- inFragmentShader.AddUniform(m_ImageOffset, "vec3");
- inFragmentShader.AddUniform(m_ImageRotScale, "vec4");
-
- inFragmentShader << "\n radiosity = evalRadiosityLightmap( " << m_ImageSampler
- << ", varTexCoord1, ";
- inFragmentShader << m_ImageRotScale << ", ";
- inFragmentShader << m_ImageOffset << " );\n\n";
- }
-
- inFragmentShader << " return radiosity.rgb;\n";
- inFragmentShader << "}\n\n";
- }
-
- void GenerateLightmapShadowFunc(IShaderStageGenerator &inFragmentShader,
- SImage *pBakedShadowMap)
- {
- inFragmentShader << "\n";
- inFragmentShader << "vec4 computeMaterialLightmapShadow()\n{\n";
- inFragmentShader << " vec4 shadowMask = vec4( 1.0, 1.0, 1.0, 1.0 );\n";
- if (pBakedShadowMap) {
- SImageVariableNames names =
- GetImageVariableNames((QT3DSU32)NVRenderTextureTypeValue::LightmapShadow);
- // Add uniforms
- inFragmentShader.AddUniform(names.m_ImageSampler, "sampler2D");
- inFragmentShader.AddUniform(m_ImageOffset, "vec3");
- inFragmentShader.AddUniform(m_ImageRotScale, "vec4");
-
- inFragmentShader << "\n shadowMask = evalShadowLightmap( " << m_ImageSampler
- << ", texCoord0, ";
- inFragmentShader << m_ImageRotScale << ", ";
- inFragmentShader << m_ImageOffset << " );\n\n";
- }
-
- inFragmentShader << " return shadowMask;\n";
- inFragmentShader << "}\n\n";
- }
-
- void GenerateLightmapIndirectSetupCode(IShaderStageGenerator &inFragmentShader,
- SRenderableImage *pIndirectLightmap,
- SRenderableImage *pRadiosityLightmap)
- {
- if (!pIndirectLightmap && !pRadiosityLightmap)
- return;
-
- eastl::string finalValue;
-
- inFragmentShader << "\n";
- inFragmentShader << "void initializeLayerVariablesWithLightmap(void)\n{\n";
- if (pIndirectLightmap) {
- inFragmentShader
- << " vec3 lightmapIndirectValue = computeMaterialLightmapIndirect( );\n";
- finalValue.append("vec4(lightmapIndirectValue, 1.0)");
- }
- if (pRadiosityLightmap) {
- inFragmentShader
- << " vec3 lightmapRadisoityValue = computeMaterialLightmapRadiosity( );\n";
- if (finalValue.empty())
- finalValue.append("vec4(lightmapRadisoityValue, 1.0)");
- else
- finalValue.append(" + vec4(lightmapRadisoityValue, 1.0)");
- }
-
- finalValue.append(";\n");
-
- char buf[16];
- for (QT3DSU32 idx = 0; idx < Material().m_LayerCount; idx++) {
- _snprintf(buf, 16, "[%d]", idx);
- inFragmentShader << " layers" << buf << ".base += " << finalValue.c_str();
- inFragmentShader << " layers" << buf << ".layer += " << finalValue.c_str();
- }
-
- inFragmentShader << "}\n\n";
- }
-
- void GenerateLightmapShadowCode(IShaderStageGenerator &inFragmentShader,
- SRenderableImage *pBakedShadowMap)
- {
- if (pBakedShadowMap) {
- inFragmentShader << " tmpShadowTerm *= computeMaterialLightmapShadow( );\n\n";
- }
- }
-
- void ApplyEmissiveMask(IShaderStageGenerator &inFragmentShader, SImage *pEmissiveMaskMap)
- {
- inFragmentShader << "\n";
- inFragmentShader << "vec3 computeMaterialEmissiveMask()\n{\n";
- inFragmentShader << " vec3 emissiveMask = vec3( 1.0, 1.0, 1.0 );\n";
- if (pEmissiveMaskMap) {
- inFragmentShader << " texture_coordinate_info tci;\n";
- inFragmentShader << " texture_coordinate_info transformed_tci;\n";
- inFragmentShader << " tci = textureCoordinateInfo( texCoord0, tangent, binormal );\n";
- inFragmentShader << " transformed_tci = transformCoordinate( "
- "rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), ";
- inFragmentShader << "vec3( 0.000000, 0.000000, 0.000000 ), vec3( 1.000000, 1.000000, "
- "1.000000 ) ), tci );\n";
- inFragmentShader << " emissiveMask = fileTexture( "
- << pEmissiveMaskMap->m_ImageShaderName.c_str()
- << ", vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, transformed_tci, ";
- inFragmentShader << "vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), "
- "wrap_repeat, wrap_repeat, gamma_default ).tint;\n";
- }
-
- inFragmentShader << " return emissiveMask;\n";
- inFragmentShader << "}\n\n";
- }
-
- // Returns true if custom shader provides main function
- bool GenerateFragmentShader(SShaderDefaultMaterialKey &, const char8_t *inShaderPathName,
- bool hasCustomVertexShader)
- {
- qt3ds::render::IDynamicObjectSystem &theDynamicSystem(
- m_RenderContext.GetDynamicObjectSystem());
- Qt3DSString theShaderBuffer;
- theDynamicSystem.GetShaderSource(
- m_RenderContext.GetStringTable().RegisterStr(inShaderPathName), theShaderBuffer);
-
- QT3DS_ASSERT(theShaderBuffer.size() > 0);
-
- // light maps
- bool hasLightmaps = false;
- SRenderableImage *lightmapShadowImage = NULL;
- SRenderableImage *lightmapIndirectImage = NULL;
- SRenderableImage *lightmapRadisoityImage = NULL;
-
- for (SRenderableImage *img = m_FirstImage; img != NULL; img = img->m_NextImage) {
- if (img->m_MapType == ImageMapTypes::LightmapIndirect) {
- lightmapIndirectImage = img;
- hasLightmaps = true;
- } else if (img->m_MapType == ImageMapTypes::LightmapRadiosity) {
- lightmapRadisoityImage = img;
- hasLightmaps = true;
- } else if (img->m_MapType == ImageMapTypes::LightmapShadow) {
- lightmapShadowImage = img;
- }
- }
-
- if (!hasCustomVertexShader) {
- VertexGenerator().GenerateUVCoords(0);
- // for lightmaps we expect a second set of uv coordinates
- if (hasLightmaps)
- VertexGenerator().GenerateUVCoords(1);
- }
-
- IDefaultMaterialVertexPipeline &vertexShader(VertexGenerator());
- IShaderStageGenerator &fragmentShader(FragmentGenerator());
-
- eastl::string srcString(theShaderBuffer.c_str());
-
- if (m_RenderContext.GetRenderContext().GetRenderContextType()
- == NVRenderContextValues::GLES2) {
- eastl::string::size_type pos = 0;
- while ((pos = srcString.find("out vec4 fragColor", pos)) != eastl::string::npos) {
- srcString.insert(pos, "//");
- pos += int(strlen("//out vec4 fragColor"));
- }
- }
-
- fragmentShader << "#define FRAGMENT_SHADER\n\n";
-
- // Check if the fragment shader portion already contains a main function
- // The same string contains both the vertex and the fragment shader
- // The last "#ifdef FRAGMENT_SHADER" should mark the start of the fragment shader
- eastl_size_t fragmentDefStart = srcString.find("#ifdef FRAGMENT_SHADER");
- eastl_size_t nextIndex = fragmentDefStart;
- while (nextIndex != eastl::string::npos) {
- nextIndex = srcString.find("#ifdef FRAGMENT_SHADER", nextIndex + 1);
- if (nextIndex != eastl::string::npos)
- fragmentDefStart = nextIndex;
- }
- if (fragmentDefStart == eastl::string::npos)
- return false;
-
- eastl_size_t mainStart = srcString.find("void main()");
- if (mainStart != eastl::string::npos && mainStart < fragmentDefStart)
- mainStart = srcString.find("void main()", mainStart + 1);
-
- bool hasCustomFragmentShader = mainStart != eastl::string::npos;
-
- if (!hasCustomFragmentShader)
- fragmentShader.AddInclude("evalLightmaps.glsllib");
-
- // check dielectric materials
- if (!Material().IsDielectric())
- fragmentShader << "#define MATERIAL_IS_NON_DIELECTRIC 1\n\n";
- else
- fragmentShader << "#define MATERIAL_IS_NON_DIELECTRIC 0\n\n";
-
- fragmentShader << "#define QT3DS_ENABLE_RNM 0\n\n";
-
- fragmentShader << srcString.data() << Endl;
-
- if (hasCustomFragmentShader) {
- fragmentShader << "#define FRAGMENT_SHADER\n\n";
- if (!hasCustomVertexShader) {
- vertexShader.GenerateWorldNormal();
- vertexShader.GenerateVarTangentAndBinormal();
- vertexShader.GenerateWorldPosition();
-
- vertexShader.GenerateViewVector();
- }
- return true;
- }
-
- if (Material().HasLighting() && lightmapIndirectImage) {
- GenerateLightmapIndirectFunc(fragmentShader, &lightmapIndirectImage->m_Image);
- }
- if (Material().HasLighting() && lightmapRadisoityImage) {
- GenerateLightmapRadiosityFunc(fragmentShader, &lightmapRadisoityImage->m_Image);
- }
- if (Material().HasLighting() && lightmapShadowImage) {
- GenerateLightmapShadowFunc(fragmentShader, &lightmapShadowImage->m_Image);
- }
-
- if (Material().HasLighting() && (lightmapIndirectImage || lightmapRadisoityImage))
- GenerateLightmapIndirectSetupCode(fragmentShader, lightmapIndirectImage,
- lightmapRadisoityImage);
-
- if (Material().HasLighting()) {
- ApplyEmissiveMask(fragmentShader, Material().m_EmissiveMap2);
- }
-
- // setup main
- VertexGenerator().BeginFragmentGeneration();
-
- // since we do pixel lighting we always need this if lighting is enabled
- // We write this here because the functions below may also write to
- // the fragment shader
- if (Material().HasLighting()) {
- vertexShader.GenerateWorldNormal();
- vertexShader.GenerateVarTangentAndBinormal();
- vertexShader.GenerateWorldPosition();
-
- if (Material().IsSpecularEnabled())
- vertexShader.GenerateViewVector();
- }
-
- fragmentShader << " initializeBaseFragmentVariables();" << Endl;
- fragmentShader << " computeTemporaries();" << Endl;
- fragmentShader << " normal = normalize( computeNormal() );" << Endl;
- fragmentShader << " initializeLayerVariables();" << Endl;
- fragmentShader << " float alpha = clamp( evalCutout(), 0.0, 1.0 );" << Endl;
-
- if (Material().IsCutOutEnabled()) {
- fragmentShader << " if ( alpha <= 0.0f )" << Endl;
- fragmentShader << " discard;" << Endl;
- }
-
- // indirect / direct lightmap init
- if (Material().HasLighting() && (lightmapIndirectImage || lightmapRadisoityImage))
- fragmentShader << " initializeLayerVariablesWithLightmap();" << Endl;
-
- // shadow map
- GenerateLightmapShadowCode(fragmentShader, lightmapShadowImage);
-
- // main Body
- fragmentShader << "#include \"customMaterialFragBodyAO.glsllib\"" << Endl;
-
- // for us right now transparency means we render a glass style material
- if (m_HasTransparency && !Material().IsTransmissive())
- fragmentShader << " rgba = computeGlass( normal, materialIOR, alpha, rgba );" << Endl;
- if (Material().IsTransmissive())
- fragmentShader << " rgba = computeOpacity( rgba );" << Endl;
-
- if (VertexGenerator().HasActiveWireframe()) {
- fragmentShader.Append("vec3 edgeDistance = varEdgeDistance * gl_FragCoord.w;");
- fragmentShader.Append(
- "\tfloat d = min(min(edgeDistance.x, edgeDistance.y), edgeDistance.z);");
- fragmentShader.Append("\tfloat mixVal = smoothstep(0.0, 1.0, d);"); // line width 1.0
-
- fragmentShader.Append("\trgba = mix( vec4(0.0, 1.0, 0.0, 1.0), rgba, mixVal);");
- }
- fragmentShader << " rgba.a *= object_opacity;" << Endl;
- if (m_RenderContext.GetRenderContext().GetRenderContextType()
- == NVRenderContextValues::GLES2)
- fragmentShader << " gl_FragColor = rgba;" << Endl;
- else
- fragmentShader << " fragColor = rgba;" << Endl;
- return false;
- }
-
- NVRenderShaderProgram *GenerateCustomMaterialShader(const char8_t *inShaderPrefix,
- const char8_t *inCustomMaterialName)
- {
- // build a string that allows us to print out the shader we are generating to the log.
- // This is time consuming but I feel like it doesn't happen all that often and is very
- // useful to users
- // looking at the log file.
- m_GeneratedShaderString.clear();
- m_GeneratedShaderString.assign(nonNull(inShaderPrefix));
- m_GeneratedShaderString.append(inCustomMaterialName);
- SShaderDefaultMaterialKey theKey(Key());
- theKey.ToString(m_GeneratedShaderString, m_DefaultMaterialShaderKeyProperties);
-
- bool hasCustomVertexShader = GenerateVertexShader(theKey, inCustomMaterialName);
- bool hasCustomFragmentShader = GenerateFragmentShader(theKey, inCustomMaterialName,
- hasCustomVertexShader);
-
- VertexGenerator().EndVertexGeneration(hasCustomVertexShader);
- VertexGenerator().EndFragmentGeneration(hasCustomFragmentShader);
-
- NVRenderShaderProgram *program = ProgramGenerator().CompileGeneratedShader(
- m_GeneratedShaderString.c_str(), SShaderCacheProgramFlags(), FeatureSet());
- if (program && hasCustomVertexShader) {
- // Change uniforms names to match runtime 2.x uniforms
- SShaderGeneratorGeneratedShader &shader(GetShaderForProgram(*program));
- shader.m_ModelMatrix = NVRenderCachedShaderProperty<QT3DSMat44>("modelMatrix",
- *program);
- shader.m_ViewProjMatrix = NVRenderCachedShaderProperty<QT3DSMat44>(
- "modelViewProjection", *program);
- shader.m_ViewMatrix = NVRenderCachedShaderProperty<QT3DSMat44>("viewMatrix", *program);
- shader.m_NormalMatrix = NVRenderCachedShaderProperty<QT3DSMat33>("modelNormalMatrix",
- *program);
- shader.m_ProjMatrix = NVRenderCachedShaderProperty<QT3DSMat44>("viewProjectionMatrix",
- *program);
- shader.m_ViewportMatrix = NVRenderCachedShaderProperty<QT3DSMat44>("viewportMatrix",
- *program);
- shader.m_CameraPos = NVRenderCachedShaderProperty<QT3DSVec3>("eyePosition", *program);
- }
- return program;
- }
-
- virtual NVRenderShaderProgram *
- GenerateShader(const SGraphObject &inMaterial, SShaderDefaultMaterialKey inShaderDescription,
- IShaderStageGenerator &inVertexPipeline, TShaderFeatureSet inFeatureSet,
- NVDataRef<SLight *> inLights, SRenderableImage *inFirstImage,
- bool inHasTransparency, const char8_t *inShaderPrefix,
- const char8_t *inCustomMaterialName) override
- {
- QT3DS_ASSERT(inMaterial.m_Type == GraphObjectTypes::CustomMaterial);
- m_CurrentMaterial = reinterpret_cast<const SCustomMaterial *>(&inMaterial);
- m_CurrentKey = &inShaderDescription;
- m_CurrentPipeline = static_cast<IDefaultMaterialVertexPipeline *>(&inVertexPipeline);
- m_CurrentFeatureSet = inFeatureSet;
- m_Lights = inLights;
- m_FirstImage = inFirstImage;
- m_HasTransparency = inHasTransparency;
-
- return GenerateCustomMaterialShader(inShaderPrefix, inCustomMaterialName);
- }
-};
-}
-
-ICustomMaterialShaderGenerator &
-ICustomMaterialShaderGenerator::CreateCustomMaterialShaderGenerator(IQt3DSRenderContext &inRc)
-{
- return *QT3DS_NEW(inRc.GetAllocator(), SShaderGenerator)(inRc);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.h
deleted file mode 100644
index 44e2c064..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialShaderGenerator.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CUSTOM_MATERIAL_SHADER_GENERATOR_H
-#define QT3DS_RENDER_CUSTOM_MATERIAL_SHADER_GENERATOR_H
-#include "Qt3DSRenderMaterialShaderGenerator.h"
-
-namespace qt3ds {
-namespace render {
-
- class Qt3DSShadowMap;
-
- class ICustomMaterialShaderGenerator : public IMaterialShaderGenerator
- {
- public:
- SImageVariableNames GetImageVariableNames(QT3DSU32 inIdx) override = 0;
- void GenerateImageUVCoordinates(IShaderStageGenerator &inVertexPipeline, QT3DSU32 idx,
- QT3DSU32 uvSet, SRenderableImage &image) override = 0;
-
- // inPipelineName needs to be unique else the shader cache will just return shaders from
- // different pipelines.
- NVRenderShaderProgram *GenerateShader(
- const SGraphObject &inMaterial, SShaderDefaultMaterialKey inShaderDescription,
- IShaderStageGenerator &inVertexPipeline, TShaderFeatureSet inFeatureSet,
- NVDataRef<SLight *> inLights, SRenderableImage *inFirstImage, bool inHasTransparency,
- const char8_t *inVertexPipelineName, const char8_t *inCustomMaterialName = "") override = 0;
-
- // Also sets the blend function on the render context.
- virtual void
- SetMaterialProperties(NVRenderShaderProgram &inProgram, const SGraphObject &inMaterial,
- const QT3DSVec2 &inCameraVec, const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix, const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- SLayerGlobalRenderProperties inRenderProperties) override = 0;
-
- static ICustomMaterialShaderGenerator &
- CreateCustomMaterialShaderGenerator(IQt3DSRenderContext &inRenderContext);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp
deleted file mode 100644
index aaf799fd..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp
+++ /dev/null
@@ -1,2131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderCustomMaterialRenderContext.h"
-#include "Qt3DSRenderContextCore.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderDynamicObjectSystemCommands.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "Qt3DSRenderMesh.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderLayer.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "render/Qt3DSRenderComputeShader.h"
-#include "foundation/PreAllocatedAllocator.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/Qt3DSTime.h"
-#include "Qt3DSRenderDynamicObjectSystemUtil.h"
-#include "Qt3DSRenderableImage.h"
-#include "rendererimpl/Qt3DSVertexPipelineImpl.h"
-#include "rendererimpl/Qt3DSRendererImplLayerRenderData.h"
-#include "Qt3DSRenderCustomMaterialShaderGenerator.h"
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSOffscreenRenderKey.h"
-
-using namespace qt3ds::render;
-using namespace qt3ds::render::dynamic;
-using qt3ds::render::NVRenderContextScopedProperty;
-using qt3ds::render::NVRenderCachedShaderProperty;
-using qt3ds::render::NVRenderCachedShaderBuffer;
-
-SCustomMaterialVertexPipeline::SCustomMaterialVertexPipeline(IQt3DSRenderContext *inContext,
- TessModeValues::Enum inTessMode)
- : SVertexPipelineImpl(
- inContext->GetAllocator(), inContext->GetCustomMaterialShaderGenerator(),
- inContext->GetShaderProgramGenerator(), inContext->GetStringTable(), false)
- , m_Context(inContext)
- , m_TessMode(TessModeValues::NoTess)
-{
- if (m_Context->GetRenderContext().IsTessellationSupported()) {
- m_TessMode = inTessMode;
- }
-
- if (m_Context->GetRenderContext().IsGeometryStageSupported()
- && m_TessMode != TessModeValues::NoTess) {
- m_Wireframe = inContext->GetWireframeMode();
- }
-}
-
-void SCustomMaterialVertexPipeline::InitializeTessControlShader()
-{
- if (m_TessMode == TessModeValues::NoTess
- || ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl) == NULL) {
- return;
- }
-
- IShaderStageGenerator &tessCtrlShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
-
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
-
- SetupTessIncludes(ShaderGeneratorStages::TessControl, m_TessMode);
-
- tessCtrlShader.Append("void main() {\n");
-
- tessCtrlShader.Append("\tctWorldPos[0] = varWorldPos[0];");
- tessCtrlShader.Append("\tctWorldPos[1] = varWorldPos[1];");
- tessCtrlShader.Append("\tctWorldPos[2] = varWorldPos[2];");
-
- if (m_TessMode == TessModeValues::TessPhong || m_TessMode == TessModeValues::TessNPatch) {
- tessCtrlShader.Append("\tctNorm[0] = varObjectNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = varObjectNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = varObjectNormal[2];");
- }
- if (m_TessMode == TessModeValues::TessNPatch) {
- tessCtrlShader.Append("\tctTangent[0] = varObjTangent[0];");
- tessCtrlShader.Append("\tctTangent[1] = varObjTangent[1];");
- tessCtrlShader.Append("\tctTangent[2] = varObjTangent[2];");
- }
-
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
-}
-
-void SCustomMaterialVertexPipeline::InitializeTessEvaluationShader()
-{
- if (m_TessMode == TessModeValues::NoTess
- || ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval) == NULL) {
- return;
- }
-
- IShaderStageGenerator &tessEvalShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddUniform("normal_matrix", "mat3");
-
- SetupTessIncludes(ShaderGeneratorStages::TessEval, m_TessMode);
-
- if (m_TessMode == TessModeValues::TessLinear && m_DisplacementImage) {
- tessEvalShader.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
- tessEvalShader.AddUniform("model_matrix", "mat4");
- tessEvalShader.AddUniform("displace_tiling", "vec3");
- tessEvalShader.AddUniform("displaceAmount", "float");
- tessEvalShader.AddUniform(m_DisplacementImage->m_Image.m_ImageShaderName.c_str(),
- "sampler2D");
- }
-
- tessEvalShader.Append("void main() {");
-
- if (m_TessMode == TessModeValues::TessNPatch) {
- tessEvalShader.Append("\tctNorm[0] = varObjectNormalTC[0];");
- tessEvalShader.Append("\tctNorm[1] = varObjectNormalTC[1];");
- tessEvalShader.Append("\tctNorm[2] = varObjectNormalTC[2];");
-
- tessEvalShader.Append("\tctTangent[0] = varTangentTC[0];");
- tessEvalShader.Append("\tctTangent[1] = varTangentTC[1];");
- tessEvalShader.Append("\tctTangent[2] = varTangentTC[2];");
- }
-
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
-}
-
-void SCustomMaterialVertexPipeline::FinalizeTessControlShader()
-{
- IShaderStageGenerator &tessCtrlShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- // add varyings we must pass through
- typedef TStrTableStrMap::const_iterator TParamIter;
- for (TParamIter iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- tessCtrlShader << "\t" << iter->first.c_str()
- << "TC[gl_InvocationID] = " << iter->first.c_str()
- << "[gl_InvocationID];\n";
- }
-}
-
-void SCustomMaterialVertexPipeline::FinalizeTessEvaluationShader()
-{
- IShaderStageGenerator &tessEvalShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- eastl::string outExt("");
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry)
- outExt = "TE";
-
- // add varyings we must pass through
- typedef TStrTableStrMap::const_iterator TParamIter;
- if (m_TessMode == TessModeValues::TessNPatch) {
- for (TParamIter iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- tessEvalShader << "\t" << iter->first.c_str() << outExt.c_str()
- << " = gl_TessCoord.z * " << iter->first.c_str() << "TC[0] + ";
- tessEvalShader << "gl_TessCoord.x * " << iter->first.c_str() << "TC[1] + ";
- tessEvalShader << "gl_TessCoord.y * " << iter->first.c_str() << "TC[2];\n";
- }
-
- // transform the normal
- if (m_GenerationFlags & GenerationFlagValues::WorldNormal)
- tessEvalShader << "\n\tvarNormal" << outExt.c_str()
- << " = normalize(normal_matrix * teNorm);\n";
- // transform the tangent
- if (m_GenerationFlags & GenerationFlagValues::TangentBinormal) {
- tessEvalShader << "\n\tvarTangent" << outExt.c_str()
- << " = normalize(normal_matrix * teTangent);\n";
- // transform the binormal
- tessEvalShader << "\n\tvarBinormal" << outExt.c_str()
- << " = normalize(normal_matrix * teBinormal);\n";
- }
- } else {
- for (TParamIter iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- tessEvalShader << "\t" << iter->first.c_str() << outExt.c_str()
- << " = gl_TessCoord.x * " << iter->first.c_str() << "TC[0] + ";
- tessEvalShader << "gl_TessCoord.y * " << iter->first.c_str() << "TC[1] + ";
- tessEvalShader << "gl_TessCoord.z * " << iter->first.c_str() << "TC[2];\n";
- }
-
- // displacement mapping makes only sense with linear tessellation
- if (m_TessMode == TessModeValues::TessLinear && m_DisplacementImage) {
- tessEvalShader
- << "\ttexture_coordinate_info tmp = textureCoordinateInfo( varTexCoord0"
- << outExt.c_str() << ", varTangent" << outExt.c_str() << ", varBinormal"
- << outExt.c_str() << " );" << Endl;
- tessEvalShader << "\ttmp = transformCoordinate( rotationTranslationScale( vec3( "
- "0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, "
- "0.000000 ), displace_tiling ), tmp);"
- << Endl;
-
- tessEvalShader << "\tpos.xyz = defaultMaterialFileDisplacementTexture( "
- << m_DisplacementImage->m_Image.m_ImageShaderName.c_str()
- << ", displaceAmount, "
- << "tmp.position.xy";
- tessEvalShader << ", varObjectNormal" << outExt.c_str() << ", pos.xyz );" << Endl;
- tessEvalShader << "\tvarWorldPos" << outExt.c_str() << "= (model_matrix * pos).xyz;"
- << Endl;
- }
-
- // transform the normal
- tessEvalShader << "\n\tvarNormal" << outExt.c_str()
- << " = normalize(normal_matrix * varObjectNormal" << outExt.c_str()
- << ");\n";
- }
-
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;\n");
-}
-
-// Responsible for beginning all vertex and fragment generation (void main() { etc).
-void SCustomMaterialVertexPipeline::BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage)
-{
- m_DisplacementIdx = displacementImageIdx;
- m_DisplacementImage = displacementImage;
-
- TShaderGeneratorStageFlags theStages(IShaderProgramGenerator::DefaultFlags());
-
- if (m_TessMode != TessModeValues::NoTess) {
- theStages |= ShaderGeneratorStages::TessControl;
- theStages |= ShaderGeneratorStages::TessEval;
- }
- if (m_Wireframe) {
- theStages |= ShaderGeneratorStages::Geometry;
- }
-
- ProgramGenerator().BeginProgram(theStages);
-
- if (m_TessMode != TessModeValues::NoTess) {
- InitializeTessControlShader();
- InitializeTessEvaluationShader();
- }
- if (m_Wireframe) {
- InitializeWireframeGeometryShader();
- }
-
- IShaderStageGenerator &vertexShader(Vertex());
-
- // thinks we need
- vertexShader.AddInclude("viewProperties.glsllib");
- vertexShader.AddInclude("customMaterial.glsllib");
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader << "void main()" << Endl << "{" << Endl;
-
- if (displacementImage) {
- GenerateUVCoords(0);
- if (!HasTessellation()) {
- vertexShader.AddUniform("displaceAmount", "float");
- vertexShader.AddUniform("displace_tiling", "vec3");
- // we create the world position setup here
- // because it will be replaced with the displaced position
- SetCode(GenerationFlagValues::WorldPosition);
- vertexShader.AddUniform("model_matrix", "mat4");
-
- vertexShader.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
- vertexShader.AddUniform(displacementImage->m_Image.m_ImageShaderName.c_str(),
- "sampler2D");
-
- vertexShader << "\ttexture_coordinate_info tmp = textureCoordinateInfo( texCoord0, "
- "varTangent, varBinormal );"
- << Endl;
- vertexShader << "\ttmp = transformCoordinate( rotationTranslationScale( vec3( "
- "0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, "
- "0.000000 ), displace_tiling ), tmp);"
- << Endl;
-
- vertexShader << "\tvec3 displacedPos = defaultMaterialFileDisplacementTexture( "
- << displacementImage->m_Image.m_ImageShaderName.c_str()
- << ", displaceAmount, "
- << "tmp.position.xy"
- << ", attr_norm, attr_pos );" << Endl;
-
- AddInterpolationParameter("varWorldPos", "vec3");
- vertexShader.Append("\tvec3 local_model_world_position = (model_matrix * "
- "vec4(displacedPos, 1.0)).xyz;");
- AssignOutput("varWorldPos", "local_model_world_position");
- }
- }
-
- if (HasTessellation()) {
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- } else {
- vertexShader.AddUniform("model_view_projection", "mat4");
- if (displacementImage)
- vertexShader.Append(
- "\tgl_Position = model_view_projection * vec4(displacedPos, 1.0);");
- else
- vertexShader.Append("\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- }
-
- if (HasTessellation()) {
- GenerateWorldPosition();
- GenerateWorldNormal();
- GenerateObjectNormal();
- GenerateVarTangentAndBinormal();
- }
-}
-
-void SCustomMaterialVertexPipeline::BeginFragmentGeneration()
-{
- Fragment().AddUniform("object_opacity", "float");
- Fragment() << "void main()" << Endl << "{" << Endl;
-}
-
-void SCustomMaterialVertexPipeline::AssignOutput(const char8_t *inVarName,
- const char8_t *inVarValue)
-{
- Vertex() << "\t" << inVarName << " = " << inVarValue << ";\n";
-}
-
-void SCustomMaterialVertexPipeline::GenerateUVCoords(QT3DSU32 inUVSet)
-{
- if (inUVSet == 0 && SetCode(GenerationFlagValues::UVCoords))
- return;
- if (inUVSet == 1 && SetCode(GenerationFlagValues::UVCoords1))
- return;
-
- QT3DS_ASSERT(inUVSet == 0 || inUVSet == 1);
-
- if (inUVSet == 0)
- AddInterpolationParameter("varTexCoord0", "vec3");
- else if (inUVSet == 1)
- AddInterpolationParameter("varTexCoord1", "vec3");
-
- DoGenerateUVCoords(inUVSet);
-}
-
-void SCustomMaterialVertexPipeline::GenerateWorldNormal()
-{
- if (SetCode(GenerationFlagValues::WorldNormal))
- return;
- AddInterpolationParameter("varNormal", "vec3");
- DoGenerateWorldNormal();
-}
-
-void SCustomMaterialVertexPipeline::GenerateObjectNormal()
-{
- if (SetCode(GenerationFlagValues::ObjectNormal))
- return;
- DoGenerateObjectNormal();
-}
-
-void SCustomMaterialVertexPipeline::GenerateVarTangentAndBinormal()
-{
- if (SetCode(GenerationFlagValues::TangentBinormal))
- return;
- AddInterpolationParameter("varTangent", "vec3");
- AddInterpolationParameter("varBinormal", "vec3");
- AddInterpolationParameter("varObjTangent", "vec3");
- AddInterpolationParameter("varObjBinormal", "vec3");
- DoGenerateVarTangentAndBinormal();
-}
-
-void SCustomMaterialVertexPipeline::GenerateWorldPosition()
-{
- if (SetCode(GenerationFlagValues::WorldPosition))
- return;
-
- ActiveStage().AddUniform("model_matrix", "mat4");
- AddInterpolationParameter("varWorldPos", "vec3");
- AddInterpolationParameter("varObjPos", "vec3");
- DoGenerateWorldPosition();
-}
-
-// responsible for closing all vertex and fragment generation
-void SCustomMaterialVertexPipeline::EndVertexGeneration(bool customShader)
-{
- if (HasTessellation()) {
- // finalize tess control shader
- FinalizeTessControlShader();
- // finalize tess evaluation shader
- FinalizeTessEvaluationShader();
-
- TessControl().Append("}");
- TessEval().Append("}");
-
- if (m_Wireframe) {
- // finalize geometry shader
- FinalizeWireframeGeometryShader();
- Geometry().Append("}");
- }
- }
-
- if (!customShader)
- Vertex().Append("}");
-}
-
-void SCustomMaterialVertexPipeline::EndFragmentGeneration(bool customShader)
-{
- if (!customShader)
- Fragment().Append("}");
-}
-
-IShaderStageGenerator &SCustomMaterialVertexPipeline::ActiveStage()
-{
- return Vertex();
-}
-
-void SCustomMaterialVertexPipeline::AddInterpolationParameter(const char8_t *inName,
- const char8_t *inType)
-{
- m_InterpolationParameters.insert(eastl::make_pair(Str(inName), Str(inType)));
- Vertex().AddOutgoing(inName, inType);
- Fragment().AddIncoming(inName, inType);
-
- if (HasTessellation()) {
- eastl::string nameBuilder(inName);
- nameBuilder.append("TC");
- TessControl().AddOutgoing(nameBuilder.c_str(), inType);
-
- nameBuilder.assign(inName);
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry) {
- nameBuilder.append("TE");
- Geometry().AddOutgoing(inName, inType);
- }
- TessEval().AddOutgoing(nameBuilder.c_str(), inType);
- }
-}
-
-void SCustomMaterialVertexPipeline::DoGenerateUVCoords(QT3DSU32 inUVSet)
-{
- QT3DS_ASSERT(inUVSet == 0 || inUVSet == 1);
-
- if (inUVSet == 0) {
- Vertex().AddIncoming("attr_uv0", "vec2");
- Vertex() << "\tvec3 texCoord0 = vec3( attr_uv0, 0.0 );" << Endl;
- AssignOutput("varTexCoord0", "texCoord0");
- } else if (inUVSet == 1) {
- Vertex().AddIncoming("attr_uv1", "vec2");
- Vertex() << "\tvec3 texCoord1 = vec3( attr_uv1, 1.0 );" << Endl;
- AssignOutput("varTexCoord1", "texCoord1");
- }
-}
-
-void SCustomMaterialVertexPipeline::DoGenerateWorldNormal()
-{
- IShaderStageGenerator &vertexGenerator(Vertex());
- vertexGenerator.AddIncoming("attr_norm", "vec3");
- vertexGenerator.AddUniform("normal_matrix", "mat3");
-
- if (HasTessellation() == false) {
- Vertex().Append("\tvarNormal = normalize( normal_matrix * attr_norm );");
- }
-}
-
-void SCustomMaterialVertexPipeline::DoGenerateObjectNormal()
-{
- AddInterpolationParameter("varObjectNormal", "vec3");
- Vertex().Append("\tvarObjectNormal = attr_norm;");
-}
-
-void SCustomMaterialVertexPipeline::DoGenerateWorldPosition()
-{
- Vertex().Append("\tvarObjPos = attr_pos;");
- Vertex().Append("\tvec4 worldPos = (model_matrix * vec4(attr_pos, 1.0));");
- AssignOutput("varWorldPos", "worldPos.xyz");
-}
-
-void SCustomMaterialVertexPipeline::DoGenerateVarTangentAndBinormal()
-{
- Vertex().AddIncoming("attr_textan", "vec3");
- Vertex().AddIncoming("attr_binormal", "vec3");
-
- Vertex() << "\tvarTangent = normal_matrix * attr_textan;" << Endl
- << "\tvarBinormal = normal_matrix * attr_binormal;" << Endl;
-
- Vertex() << "\tvarObjTangent = attr_textan;" << Endl << "\tvarObjBinormal = attr_binormal;"
- << Endl;
-}
-
-void SCustomMaterialVertexPipeline::DoGenerateVertexColor()
-{
- Vertex().AddIncoming("attr_color", "vec3");
- Vertex().Append("\tvarColor = attr_color;");
-}
-
-
-struct SMaterialClass
-{
- NVAllocatorCallback *m_Allocator;
- IDynamicObjectClass *m_Class;
- bool m_HasTransparency;
- bool m_HasRefraction;
- bool m_HasDisplacement;
- bool m_AlwaysDirty;
- QT3DSU32 m_ShaderKey;
- QT3DSU32 m_LayerCount;
- QT3DSI32 mRefCount;
- SMaterialClass(NVAllocatorCallback &alloc, IDynamicObjectClass &inCls)
- : m_Allocator(&alloc)
- , m_Class(&inCls)
- , m_HasTransparency(false)
- , m_HasRefraction(false)
- , m_HasDisplacement(false)
- , m_AlwaysDirty(false)
- , m_ShaderKey(0)
- , m_LayerCount(0)
- , mRefCount(0)
- {
- }
-
- ~SMaterialClass() {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(*m_Allocator)
-
- void AfterWrite()
- {
- m_Allocator = NULL;
- m_Class = NULL;
- mRefCount = 0;
- }
-
- void AfterRead(NVAllocatorCallback &alloc, IDynamicObjectClass &inCls)
- {
- m_Allocator = &alloc;
- m_Class = &inCls;
- mRefCount = 0;
- }
-};
-
-typedef nvhash_map<CRegisteredString, NVScopedRefCounted<SMaterialClass>> TStringMaterialMap;
-typedef eastl::pair<CRegisteredString, CRegisteredString> TStrStrPair;
-
-namespace eastl {
-template <>
-struct hash<TStrStrPair>
-{
- size_t operator()(const TStrStrPair &item) const
- {
- return hash<CRegisteredString>()(item.first) ^ hash<CRegisteredString>()(item.second);
- }
-};
-}
-
-struct SShaderMapKey
-{
- TStrStrPair m_Name;
- eastl::vector<SShaderPreprocessorFeature> m_Features;
- TessModeValues::Enum m_TessMode;
- bool m_WireframeMode;
- SShaderDefaultMaterialKey m_MaterialKey;
- size_t m_HashCode;
- SShaderMapKey(TStrStrPair inName, TShaderFeatureSet inFeatures, TessModeValues::Enum inTessMode,
- bool inWireframeMode, SShaderDefaultMaterialKey inMaterialKey)
- : m_Name(inName)
- , m_Features(inFeatures.begin(), inFeatures.end())
- , m_TessMode(inTessMode)
- , m_WireframeMode(inWireframeMode)
- , m_MaterialKey(inMaterialKey)
- {
- m_HashCode = eastl::hash<TStrStrPair>()(m_Name)
- ^ HashShaderFeatureSet(toDataRef(m_Features.data(), (QT3DSU32)m_Features.size()))
- ^ eastl::hash<QT3DSU32>()(m_TessMode) ^ eastl::hash<bool>()(m_WireframeMode)
- ^ eastl::hash<size_t>()(inMaterialKey.hash());
- }
- bool operator==(const SShaderMapKey &inKey) const
- {
- return m_Name == inKey.m_Name && m_Features == inKey.m_Features
- && m_TessMode == inKey.m_TessMode && m_WireframeMode == inKey.m_WireframeMode
- && m_MaterialKey == inKey.m_MaterialKey;
- }
-};
-
-namespace eastl {
-template <>
-struct hash<SShaderMapKey>
-{
- size_t operator()(const SShaderMapKey &inKey) const { return inKey.m_HashCode; }
-};
-}
-
-namespace {
-
-struct SCustomMaterialTextureData
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- qt3ds::render::NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
- qt3ds::render::NVRenderTexture2D *m_Texture;
- bool m_needsMips;
- volatile QT3DSI32 mRefCount;
-
- SCustomMaterialTextureData(NVRenderShaderProgram &inShader, NVRenderTexture2D *inTexture,
- const char *inTexName, bool needMips)
- : m_Shader(inShader)
- , m_Sampler(inTexName, inShader)
- , m_Texture(inTexture)
- , m_needsMips(needMips)
- , mRefCount(0)
- {
- }
-
- void Set(const SPropertyDefinition *inDefinition)
- {
- if (m_Texture && inDefinition) {
- m_Texture->SetMagFilter(inDefinition->m_MagFilterOp);
- m_Texture->SetMinFilter(inDefinition->m_MinFilterOp);
- m_Texture->SetTextureWrapS(inDefinition->m_CoordOp);
- m_Texture->SetTextureWrapT(inDefinition->m_CoordOp);
- } else if (m_Texture) {
- // set some defaults
- m_Texture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- m_Texture->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- m_Texture->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
- }
-
- if ((m_Texture->GetNumMipmaps() == 0) && m_needsMips)
- m_Texture->GenerateMipmaps();
-
- m_Sampler.Set(m_Texture);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-
- static SCustomMaterialTextureData CreateTextureEntry(NVRenderShaderProgram &inShader,
- NVRenderTexture2D *inTexture,
- const char *inTexName, bool needMips)
- {
- return SCustomMaterialTextureData(inShader, inTexture, inTexName, needMips);
- }
-};
-
-typedef eastl::pair<CRegisteredString, NVScopedRefCounted<SCustomMaterialTextureData>>
- TCustomMaterialTextureEntry;
-
-/**
- * Cached tessellation property lookups this is on a per mesh base
- */
-struct SCustomMaterialsTessellationProperties
-{
- NVRenderCachedShaderProperty<QT3DSF32> m_EdgeTessLevel; ///< tesselation value for the edges
- NVRenderCachedShaderProperty<QT3DSF32> m_InsideTessLevel; ///< tesselation value for the inside
- NVRenderCachedShaderProperty<QT3DSF32>
- m_PhongBlend; ///< blending between linear and phong component
- NVRenderCachedShaderProperty<QT3DSVec2>
- m_DistanceRange; ///< distance range for min and max tess level
- NVRenderCachedShaderProperty<QT3DSF32> m_DisableCulling; ///< if set to 1.0 this disables backface
- ///culling optimization in the tess shader
-
- SCustomMaterialsTessellationProperties() {}
- SCustomMaterialsTessellationProperties(NVRenderShaderProgram &inShader)
- : m_EdgeTessLevel("tessLevelOuter", inShader)
- , m_InsideTessLevel("tessLevelInner", inShader)
- , m_PhongBlend("phongBlend", inShader)
- , m_DistanceRange("distanceRange", inShader)
- , m_DisableCulling("disableCulling", inShader)
- {
- }
-};
-
-/* We setup some shared state on the custom material shaders */
-struct SCustomMaterialShader
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ModelMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewProjMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewMatrix;
- NVRenderCachedShaderProperty<QT3DSMat33> m_NormalMatrix;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraPos;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ProjMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewportMatrix;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CamProperties;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_DepthTexture;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_AOTexture;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LightProbe;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeProps;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeOpts;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeRot;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeOfs;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LightProbe2;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbe2Props;
- NVRenderCachedShaderProperty<QT3DSI32> m_LightCount;
- NVRenderCachedShaderProperty<QT3DSI32> m_AreaLightCount;
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_AoShadowParams;
- SCustomMaterialsTessellationProperties m_Tessellation;
- SDynamicShaderProgramFlags m_ProgramFlags;
- volatile QT3DSI32 mRefCount;
- SCustomMaterialShader(NVRenderShaderProgram &inShader, SDynamicShaderProgramFlags inFlags)
- : m_Shader(inShader)
- , m_ModelMatrix("model_matrix", inShader)
- , m_ViewProjMatrix("model_view_projection", inShader)
- , m_ViewMatrix("view_matrix", inShader)
- , m_NormalMatrix("normal_matrix", inShader)
- , m_CameraPos("camera_position", inShader)
- , m_ProjMatrix("view_projection_matrix", inShader)
- , m_ViewportMatrix("viewport_matrix", inShader)
- , m_CamProperties("camera_properties", inShader)
- , m_DepthTexture("depth_sampler", inShader)
- , m_AOTexture("ao_sampler", inShader)
- , m_LightProbe("light_probe", inShader)
- , m_LightProbeProps("light_probe_props", inShader)
- , m_LightProbeOpts("light_probe_opts", inShader)
- , m_LightProbeRot("light_probe_rotation", inShader)
- , m_LightProbeOfs("light_probe_offset", inShader)
- , m_LightProbe2("light_probe2", inShader)
- , m_LightProbe2Props("light_probe2_props", inShader)
- , m_LightCount("uNumLights", inShader)
- , m_AreaLightCount("uNumAreaLights", inShader)
- , m_AoShadowParams("cbAoShadow", inShader)
- , m_Tessellation(inShader)
- , m_ProgramFlags(inFlags)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-};
-
-struct SMaterialOrComputeShader
-{
- SCustomMaterialShader *m_MaterialShader;
- NVRenderShaderProgram *m_ComputeShader;
- SMaterialOrComputeShader()
- : m_MaterialShader(NULL)
- , m_ComputeShader(NULL)
- {
- }
- SMaterialOrComputeShader(SCustomMaterialShader &inMaterialShader)
- : m_MaterialShader(&inMaterialShader)
- , m_ComputeShader(NULL)
- {
- }
- SMaterialOrComputeShader(NVRenderShaderProgram &inComputeShader)
- : m_MaterialShader(NULL)
- , m_ComputeShader(&inComputeShader)
- {
- QT3DS_ASSERT(inComputeShader.GetProgramType() == NVRenderShaderProgram::ProgramType::Compute);
- }
- bool IsValid() const { return m_MaterialShader || m_ComputeShader; }
- bool IsComputeShader() const { return m_ComputeShader != NULL; }
- bool IsMaterialShader() const { return m_MaterialShader != NULL; }
- SCustomMaterialShader &MaterialShader()
- {
- QT3DS_ASSERT(IsMaterialShader());
- return *m_MaterialShader;
- }
- NVRenderShaderProgram &ComputeShader()
- {
- QT3DS_ASSERT(IsComputeShader());
- return *m_ComputeShader;
- }
-};
-
-struct SCustomMaterialBuffer
-{
- CRegisteredString m_Name;
- NVScopedRefCounted<NVRenderFrameBuffer> m_FrameBuffer;
- NVScopedRefCounted<NVRenderTexture2D> m_Texture;
- SAllocateBufferFlags m_Flags;
-
- SCustomMaterialBuffer(CRegisteredString inName, NVRenderFrameBuffer &inFb,
- NVRenderTexture2D &inTexture, SAllocateBufferFlags inFlags)
- : m_Name(inName)
- , m_FrameBuffer(&inFb)
- , m_Texture(&inTexture)
- , m_Flags(inFlags)
- {
- }
- SCustomMaterialBuffer() {}
-};
-
-struct SMaterialSystem;
-typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderVertexBuffer>>
- TStringVertexBufferMap;
-typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderInputAssembler>>
- TStringAssemblerMap;
-
-struct SStringMemoryBarrierFlagMap
-{
- const char8_t *m_Name;
- qt3ds::render::NVRenderBufferBarrierValues::Enum m_Value;
- SStringMemoryBarrierFlagMap(const char8_t *nm,
- qt3ds::render::NVRenderBufferBarrierValues::Enum val)
- : m_Name(nm)
- , m_Value(val)
- {
- }
-};
-
-SStringMemoryBarrierFlagMap g_StringMemoryFlagMap[] = {
- SStringMemoryBarrierFlagMap("vertex_attribute",
- qt3ds::render::NVRenderBufferBarrierValues::VertexAttribArray),
- SStringMemoryBarrierFlagMap("element_array",
- qt3ds::render::NVRenderBufferBarrierValues::ElementArray),
- SStringMemoryBarrierFlagMap("uniform_buffer",
- qt3ds::render::NVRenderBufferBarrierValues::UniformBuffer),
- SStringMemoryBarrierFlagMap("texture_fetch",
- qt3ds::render::NVRenderBufferBarrierValues::TextureFetch),
- SStringMemoryBarrierFlagMap("shader_image_access",
- qt3ds::render::NVRenderBufferBarrierValues::ShaderImageAccess),
- SStringMemoryBarrierFlagMap("command_buffer",
- qt3ds::render::NVRenderBufferBarrierValues::CommandBuffer),
- SStringMemoryBarrierFlagMap("pixel_buffer",
- qt3ds::render::NVRenderBufferBarrierValues::PixelBuffer),
- SStringMemoryBarrierFlagMap("texture_update",
- qt3ds::render::NVRenderBufferBarrierValues::TextureUpdate),
- SStringMemoryBarrierFlagMap("buffer_update",
- qt3ds::render::NVRenderBufferBarrierValues::BufferUpdate),
- SStringMemoryBarrierFlagMap("frame_buffer",
- qt3ds::render::NVRenderBufferBarrierValues::Framebuffer),
- SStringMemoryBarrierFlagMap("transform_feedback",
- qt3ds::render::NVRenderBufferBarrierValues::TransformFeedback),
- SStringMemoryBarrierFlagMap("atomic_counter",
- qt3ds::render::NVRenderBufferBarrierValues::AtomicCounter),
- SStringMemoryBarrierFlagMap("shader_storage",
- qt3ds::render::NVRenderBufferBarrierValues::ShaderStorage),
-};
-
-struct SStringBlendFuncMap
-{
- const char8_t *m_Name;
- qt3ds::render::NVRenderSrcBlendFunc::Enum m_Value;
- SStringBlendFuncMap(const char8_t *nm, qt3ds::render::NVRenderSrcBlendFunc::Enum val)
- : m_Name(nm)
- , m_Value(val)
- {
- }
-};
-
-SStringBlendFuncMap g_BlendFuncMap[] = {
-#define QT3DS_RENDER_HANDLE_BLEND_FUNC(nm) \
- SStringBlendFuncMap(#nm, qt3ds::render::NVRenderSrcBlendFunc::nm),
-#define QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC(nm) \
- SStringBlendFuncMap(#nm, qt3ds::render::NVRenderSrcBlendFunc::nm),
- QT3DS_RENDER_ITERATE_BLEND_FUNC
-#undef QT3DS_RENDER_HANDLE_BLEND_FUNC
-#undef QT3DS_RENDER_HANDLE_SRC_BLEND_FUNC
-};
-
-struct SMaterialSystem : public ICustomMaterialSystem
-{
- typedef nvhash_map<SShaderMapKey, NVScopedRefCounted<SCustomMaterialShader>> TShaderMap;
- typedef eastl::pair<CRegisteredString, SImage *> TAllocatedImageEntry;
-
- IQt3DSRenderContextCore &m_CoreContext;
- IQt3DSRenderContext *m_Context;
- mutable qt3ds::render::SPreAllocatedAllocator m_Allocator;
- TStringMaterialMap m_StringMaterialMap;
- TShaderMap m_ShaderMap;
- nvvector<TCustomMaterialTextureEntry> m_TextureEntries;
- nvvector<SCustomMaterialBuffer> m_AllocatedBuffers;
- nvvector<TAllocatedImageEntry> m_AllocatedImages;
- bool m_UseFastBlits;
- eastl::string m_ShaderNameBuilder;
- QT3DSU64 m_LastFrameTime;
- QT3DSF32 m_MillisecondsSinceLastFrame;
- QT3DSI32 mRefCount;
-
- SMaterialSystem(IQt3DSRenderContextCore &ct)
- : m_CoreContext(ct)
- , m_Context(NULL)
- , m_Allocator(ct.GetAllocator())
- , m_StringMaterialMap(ct.GetAllocator(), "SMaterialSystem::m_StringMaterialMap")
- , m_ShaderMap(ct.GetAllocator(), "SMaterialSystem::m_ShaderMap")
- , m_TextureEntries(ct.GetAllocator(), "SMaterialSystem::m_TextureEntries")
- , m_AllocatedBuffers(ct.GetAllocator(), "SMaterialSystem::m_AllocatedBuffers")
- , m_AllocatedImages(ct.GetAllocator(), "SMaterialSystem::m_AllocatedImages")
- , m_UseFastBlits(true)
- , m_LastFrameTime(0)
- , m_MillisecondsSinceLastFrame(0)
- , mRefCount(0)
- {
- }
-
- ~SMaterialSystem()
- {
- while (m_AllocatedBuffers.size())
- m_AllocatedBuffers.replace_with_last(0);
-
- for (QT3DSU32 idx = 0; idx < m_AllocatedImages.size(); ++idx) {
- SImage *pImage = m_AllocatedImages[idx].second;
- QT3DS_FREE(m_CoreContext.GetAllocator(), pImage);
- }
- m_AllocatedImages.clear();
- }
-
- void ReleaseBuffer(QT3DSU32 inIdx)
- {
- // Don't call this on MaterialSystem destroy.
- // This causes issues for scene liftime buffers
- // because the resource manager is destroyed before
- IResourceManager &theManager(m_Context->GetResourceManager());
- SCustomMaterialBuffer &theEntry(m_AllocatedBuffers[inIdx]);
- theEntry.m_FrameBuffer->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer());
-
- theManager.Release(*theEntry.m_FrameBuffer);
- theManager.Release(*theEntry.m_Texture);
- m_AllocatedBuffers.replace_with_last(inIdx);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_CoreContext.GetAllocator())
-
- bool IsMaterialRegistered(CRegisteredString inStr) override
- {
- return m_StringMaterialMap.find(inStr) != m_StringMaterialMap.end();
- }
-
- bool RegisterMaterialClass(CRegisteredString inName,
- NVConstDataRef<dynamic::SPropertyDeclaration> inProperties) override
- {
- if (IsMaterialRegistered(inName))
- return false;
- m_CoreContext.GetDynamicObjectSystemCore().Register(
- inName, inProperties, sizeof(SCustomMaterial), GraphObjectTypes::CustomMaterial);
- IDynamicObjectClass *theClass =
- m_CoreContext.GetDynamicObjectSystemCore().GetDynamicObjectClass(inName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- SMaterialClass *theNewClass = QT3DS_NEW(m_Allocator, SMaterialClass)(m_Allocator, *theClass);
- m_StringMaterialMap.insert(eastl::make_pair(inName, theNewClass));
- return true;
- }
-
- SMaterialClass *GetMaterialClass(CRegisteredString inStr)
- {
- TStringMaterialMap::iterator theIter = m_StringMaterialMap.find(inStr);
- if (theIter != m_StringMaterialMap.end())
- return theIter->second;
- return NULL;
- }
-
- const SMaterialClass *GetMaterialClass(CRegisteredString inStr) const
- {
- return const_cast<SMaterialSystem *>(this)->GetMaterialClass(inStr);
- }
-
- virtual NVConstDataRef<SPropertyDefinition>
- GetCustomMaterialProperties(CRegisteredString inCustomMaterialName) const override
- {
- IDynamicObjectClass *theMaterialClass =
- m_CoreContext.GetDynamicObjectSystemCore().GetDynamicObjectClass(inCustomMaterialName);
-
- if (theMaterialClass)
- return theMaterialClass->GetProperties();
-
- return NVConstDataRef<SPropertyDefinition>();
- }
-
- virtual QT3DSU32 FindBuffer(CRegisteredString inName)
- {
- for (QT3DSU32 idx = 0, end = m_AllocatedBuffers.size(); idx < end; ++idx)
- if (m_AllocatedBuffers[idx].m_Name == inName)
- return idx;
- return m_AllocatedBuffers.size();
- }
-
- virtual QT3DSU32 FindAllocatedImage(CRegisteredString inName)
- {
- for (QT3DSU32 idx = 0, end = m_AllocatedImages.size(); idx < end; ++idx)
- if (m_AllocatedImages[idx].first == inName)
- return idx;
- return QT3DSU32(-1);
- }
-
- virtual bool TextureNeedsMips(const SPropertyDefinition *inPropDec,
- qt3ds::render::NVRenderTexture2D *inTexture)
- {
- if (inPropDec && inTexture) {
- return bool((inPropDec->m_MinFilterOp == NVRenderTextureMinifyingOp::LinearMipmapLinear)
- && (inTexture->GetNumMipmaps() == 0));
- }
-
- return false;
- }
-
- virtual void SetTexture(NVRenderShaderProgram &inShader, CRegisteredString inPropName,
- NVRenderTexture2D *inTexture,
- const SPropertyDefinition *inPropDec = NULL, bool needMips = false)
- {
- SCustomMaterialTextureData *theTextureEntry(NULL);
- for (QT3DSU32 idx = 0, end = m_TextureEntries.size(); idx < end && theTextureEntry == NULL;
- ++idx) {
- if (m_TextureEntries[idx].first == inPropName
- && m_TextureEntries[idx].second->m_Shader.mPtr == &inShader
- && m_TextureEntries[idx].second->m_Texture == inTexture) {
- theTextureEntry = m_TextureEntries[idx].second;
- break;
- }
- }
- if (theTextureEntry == NULL) {
- NVScopedRefCounted<SCustomMaterialTextureData> theNewEntry =
- QT3DS_NEW(m_CoreContext.GetAllocator(), SCustomMaterialTextureData)(
- SCustomMaterialTextureData::CreateTextureEntry(inShader, inTexture, inPropName,
- needMips));
- m_TextureEntries.push_back(eastl::make_pair(inPropName, theNewEntry));
- theTextureEntry = theNewEntry.mPtr;
- }
- theTextureEntry->Set(inPropDec);
- }
-
- void SetSubpresentation(NVRenderShaderProgram &inShader, CRegisteredString inPropName,
- NVRenderTexture2D *inTexture,
- const SPropertyDefinition *inPropDec)
- {
- SPropertyDefinition propDef = *inPropDec;
- propDef.m_MinFilterOp = NVRenderTextureMinifyingOp::Linear;
- propDef.m_MagFilterOp = NVRenderTextureMagnifyingOp::Linear;
- SCustomMaterialTextureData::CreateTextureEntry(inShader, inTexture, inPropName, false)
- .Set(&propDef);
- }
-
- void SetPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<CRegisteredString> inNames) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetPropertyEnumNames(inName, inPropName,
- inNames);
- }
-
- void SetPropertyTextureSettings(CRegisteredString inName, CRegisteredString inPropName,
- CRegisteredString inPropPath,
- NVRenderTextureTypeValue::Enum inTexType,
- NVRenderTextureCoordOp::Enum inCoordOp,
- NVRenderTextureMagnifyingOp::Enum inMagFilterOp,
- NVRenderTextureMinifyingOp::Enum inMinFilterOp) override
- {
- SMaterialClass *theClass = GetMaterialClass(inName);
- if (theClass && inTexType == NVRenderTextureTypeValue::Displace) {
- theClass->m_HasDisplacement = true;
- }
- m_CoreContext.GetDynamicObjectSystemCore().SetPropertyTextureSettings(
- inName, inPropName, inPropPath, inTexType, inCoordOp, inMagFilterOp, inMinFilterOp);
- }
-
- void SetMaterialClassShader(CRegisteredString inName, const char8_t *inShaderType,
- const char8_t *inShaderVersion, const char8_t *inShaderData,
- bool inHasGeomShader, bool inIsComputeShader) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetShaderData(inName, inShaderData, inShaderType,
- inShaderVersion, inHasGeomShader,
- inIsComputeShader);
- }
-
- SCustomMaterial *CreateCustomMaterial(CRegisteredString inName,
- NVAllocatorCallback &inSceneGraphAllocator) override
- {
- SCustomMaterial *theMaterial = static_cast<SCustomMaterial *>(
- m_CoreContext.GetDynamicObjectSystemCore().CreateInstance(inName,
- inSceneGraphAllocator));
- SMaterialClass *theClass = GetMaterialClass(inName);
-
- if (theMaterial) {
- QT3DSU32 key = 0, count = 0;
- if (theClass) {
- key = theClass->m_ShaderKey;
- count = theClass->m_LayerCount;
- }
- theMaterial->Initialize(key, count);
- }
-
- return theMaterial;
- }
-
- void SetCustomMaterialTransparency(CRegisteredString inName, bool inHasTransparency) override
- {
- SMaterialClass *theClass = GetMaterialClass(inName);
-
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- theClass->m_HasTransparency = inHasTransparency;
- }
-
- void SetCustomMaterialRefraction(CRegisteredString inName, bool inHasRefraction) override
- {
- SMaterialClass *theClass = GetMaterialClass(inName);
-
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- theClass->m_HasRefraction = inHasRefraction;
- }
-
- void SetCustomMaterialAlwaysDirty(CRegisteredString inName, bool inIsAlwaysDirty) override
- {
- SMaterialClass *theClass = GetMaterialClass(inName);
-
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- theClass->m_AlwaysDirty = inIsAlwaysDirty;
- }
-
- void SetCustomMaterialShaderKey(CRegisteredString inName, QT3DSU32 inShaderKey) override
- {
- SMaterialClass *theClass = GetMaterialClass(inName);
-
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- theClass->m_ShaderKey = inShaderKey;
- }
-
- void SetCustomMaterialLayerCount(CRegisteredString inName, QT3DSU32 inLayerCount) override
- {
- SMaterialClass *theClass = GetMaterialClass(inName);
-
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- theClass->m_LayerCount = inLayerCount;
- }
-
- void SetCustomMaterialCommands(CRegisteredString inName,
- NVConstDataRef<dynamic::SCommand *> inCommands) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetRenderCommands(inName, inCommands);
- }
-
- CRegisteredString GetShaderCacheKey(Qt3DSString &inShaderKeyBuffer, const char8_t *inId,
- const char8_t *inProgramMacro,
- const dynamic::SDynamicShaderProgramFlags &inFlags)
- {
- inShaderKeyBuffer.assign(inId);
- if (inProgramMacro && *inProgramMacro) {
- inShaderKeyBuffer.append("#");
- inShaderKeyBuffer.append(inProgramMacro);
- }
- if (inFlags.IsTessellationEnabled()) {
- inShaderKeyBuffer.append("#");
- inShaderKeyBuffer.append(TessModeValues::toString(inFlags.m_TessMode));
- }
- if (inFlags.IsGeometryShaderEnabled() && inFlags.m_WireframeMode) {
- inShaderKeyBuffer.append("#");
- inShaderKeyBuffer.append(inFlags.wireframeToString(inFlags.m_WireframeMode));
- }
-
- return m_CoreContext.GetStringTable().RegisterStr(inShaderKeyBuffer.c_str());
- }
-
- NVRenderShaderProgram *GetShader(SCustomMaterialRenderContext &inRenderContext,
- const SCustomMaterial &inMaterial,
- const SBindShader &inCommand, TShaderFeatureSet inFeatureSet,
- const dynamic::SDynamicShaderProgramFlags &inFlags)
- {
- ICustomMaterialShaderGenerator &theMaterialGenerator(
- m_Context->GetCustomMaterialShaderGenerator());
-
- // generate key
- Qt3DSString theShaderKeyBuffer;
- CRegisteredString theKey = GetShaderCacheKey(theShaderKeyBuffer, inCommand.m_ShaderPath,
- inCommand.m_ShaderDefine, inFlags);
-
- SCustomMaterialVertexPipeline thePipeline(m_Context,
- inRenderContext.m_Model.m_TessellationMode);
-
- NVRenderShaderProgram *theProgram = theMaterialGenerator.GenerateShader(
- inMaterial, inRenderContext.m_MaterialKey, thePipeline, inFeatureSet,
- inRenderContext.m_Lights, inRenderContext.m_FirstImage,
- (inMaterial.m_hasTransparency || inMaterial.m_hasRefraction),
- "custom material pipeline-- ", inCommand.m_ShaderPath.c_str());
-
- return theProgram;
- }
-
- SMaterialOrComputeShader BindShader(SCustomMaterialRenderContext &inRenderContext,
- const SCustomMaterial &inMaterial,
- const SBindShader &inCommand,
- TShaderFeatureSet inFeatureSet)
- {
- NVRenderShaderProgram *theProgram = NULL;
- eastl::vector<SShaderPreprocessorFeature> features;
- for (int i = 0; i < inFeatureSet.size(); ++i)
- features.push_back(inFeatureSet.mData[i]);
- features.push_back(SShaderPreprocessorFeature(m_Context->GetStringTable()
- .RegisterStr("NO_FRAG_OUTPUT"), true));
- TShaderFeatureSet featureSet(features.data(), features.size());
-
- SDynamicShaderProgramFlags theFlags(inRenderContext.m_Model.m_TessellationMode,
- inRenderContext.m_Subset.m_WireframeMode);
- theFlags.SetTessellationEnabled(inRenderContext.m_Model.m_TessellationMode
- != TessModeValues::NoTess);
- theFlags.SetGeometryShaderEnabled(inRenderContext.m_Subset.m_WireframeMode);
-
- SShaderMapKey skey = SShaderMapKey(
- TStrStrPair(inCommand.m_ShaderPath, inCommand.m_ShaderDefine), featureSet,
- theFlags.m_TessMode, theFlags.m_WireframeMode, inRenderContext.m_MaterialKey);
- eastl::pair<TShaderMap::iterator, bool> theInsertResult(m_ShaderMap.insert(
- eastl::make_pair(skey, NVScopedRefCounted<SCustomMaterialShader>(NULL))));
-
- if (theInsertResult.second) {
- theProgram = GetShader(inRenderContext, inMaterial, inCommand, featureSet, theFlags);
-
- if (theProgram) {
- theInsertResult.first->second =
- QT3DS_NEW(m_Allocator, SCustomMaterialShader)(*theProgram, theFlags);
- }
- } else if (theInsertResult.first->second)
- theProgram = theInsertResult.first->second->m_Shader;
-
- if (theProgram) {
- if (theProgram->GetProgramType() == NVRenderShaderProgram::ProgramType::Graphics) {
- if (theInsertResult.first->second) {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- theContext.SetActiveShader(theInsertResult.first->second->m_Shader);
- }
-
- return *theInsertResult.first->second;
- } else {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- theContext.SetActiveShader(theProgram);
- return *(static_cast<NVRenderShaderProgram *>(theProgram));
- }
- }
- return SMaterialOrComputeShader();
- }
-
- void DoApplyInstanceValue(SCustomMaterial & /* inMaterial */, QT3DSU8 *inDataPtr,
- CRegisteredString inPropertyName,
- NVRenderShaderDataTypes::Enum inPropertyType,
- NVRenderShaderProgram &inShader,
- const SPropertyDefinition &inDefinition)
- {
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(inPropertyName);
- using namespace qt3ds::render;
- if (theConstant) {
- if (theConstant->GetShaderConstantType() == inPropertyType) {
- if (inPropertyType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- StaticAssert<sizeof(CRegisteredString)
- == sizeof(NVRenderTexture2DPtr)>::valid_expression();
- CRegisteredString *theStrPtr = reinterpret_cast<CRegisteredString *>(inDataPtr);
- IBufferManager &theBufferManager(m_Context->GetBufferManager());
- IOffscreenRenderManager &theOffscreenRenderer(
- m_Context->GetOffscreenRenderManager());
- NVRenderTexture2D *theTexture = nullptr;
-
- if (theStrPtr->IsValid()) {
- if (theOffscreenRenderer.HasOffscreenRenderer(*theStrPtr)) {
- SOffscreenRenderResult theResult
- = theOffscreenRenderer.GetRenderedItem(*theStrPtr);
- theTexture = theResult.m_Texture;
- if (theTexture) {
- SetSubpresentation(inShader, inPropertyName, theTexture,
- &inDefinition);
- }
- } else {
- SImageTextureData theTextureData
- = theBufferManager.LoadRenderImage(*theStrPtr);
- theTexture = theTextureData.m_Texture;
- if (theTexture) {
- SetTexture(inShader, inPropertyName, theTexture, &inDefinition,
- TextureNeedsMips(&inDefinition, theTexture));
- }
- }
- }
- } else {
- switch (inPropertyType) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(type) \
- case NVRenderShaderDataTypes::type: \
- inShader.SetPropertyValue(theConstant, *(reinterpret_cast<type *>(inDataPtr))); \
- break;
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- } else {
- qCCritical(INVALID_OPERATION,
- "CustomMaterial ApplyInstanceValue command datatype and "
- "shader datatypes differ for property %s",
- inPropertyName.c_str());
- QT3DS_ASSERT(false);
- }
- }
- }
-
- void ApplyInstanceValue(SCustomMaterial &inMaterial, SMaterialClass &inClass,
- NVRenderShaderProgram &inShader, const SApplyInstanceValue &inCommand)
- {
- // sanity check
- if (inCommand.m_PropertyName.IsValid()) {
- bool canGetData =
- inCommand.m_ValueOffset + getSizeofShaderDataType(inCommand.m_ValueType)
- <= inMaterial.m_DataSectionByteSize;
- if (canGetData == false) {
- QT3DS_ASSERT(false);
- return;
- }
- QT3DSU8 *dataPtr = inMaterial.GetDataSectionBegin() + inCommand.m_ValueOffset;
- const SPropertyDefinition *theDefinition =
- inClass.m_Class->FindPropertyByName(inCommand.m_PropertyName);
- if (theDefinition)
- DoApplyInstanceValue(inMaterial, dataPtr, inCommand.m_PropertyName,
- inCommand.m_ValueType, inShader, *theDefinition);
- } else {
- NVConstDataRef<SPropertyDefinition> theDefs = inClass.m_Class->GetProperties();
- for (QT3DSU32 idx = 0, end = theDefs.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(theDefs[idx]);
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(theDefinition.m_Name);
-
- // This is fine, the property wasn't found and we continue, no problem.
- if (!theConstant)
- continue;
- QT3DSU8 *dataPtr = inMaterial.GetDataSectionBegin() + theDefinition.m_Offset;
- DoApplyInstanceValue(inMaterial, dataPtr, theDefinition.m_Name,
- theDefinition.m_DataType, inShader, theDefinition);
- }
- }
- }
-
- void ApplyBlending(const SApplyBlending &inCommand)
- {
- NVRenderContext &theContext(m_Context->GetRenderContext());
-
- theContext.SetBlendingEnabled(true);
-
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc =
- qt3ds::render::NVRenderBlendFunctionArgument(
- inCommand.m_SrcBlendFunc, inCommand.m_DstBlendFunc, inCommand.m_SrcBlendFunc,
- inCommand.m_DstBlendFunc);
-
- qt3ds::render::NVRenderBlendEquationArgument blendEqu(NVRenderBlendEquation::Add,
- NVRenderBlendEquation::Add);
-
- theContext.SetBlendFunction(blendFunc);
- theContext.SetBlendEquation(blendEqu);
- }
-
- // we currently only bind a source texture
- const NVRenderTexture2D *ApplyBufferValue(const SCustomMaterial &inMaterial,
- NVRenderShaderProgram &inShader,
- const SApplyBufferValue &inCommand,
- const NVRenderTexture2D *inSourceTexture)
- {
- const NVRenderTexture2D *theTexture = NULL;
-
- if (inCommand.m_BufferName.IsValid()) {
- QT3DSU32 bufferIdx = FindBuffer(inCommand.m_BufferName);
- if (bufferIdx < m_AllocatedBuffers.size()) {
- SCustomMaterialBuffer &theEntry(m_AllocatedBuffers[bufferIdx]);
- theTexture = theEntry.m_Texture;
- } else {
- // we must have allocated the read target before
- qCCritical(INTERNAL_ERROR,
- "CustomMaterial: ApplyBufferValue: Failed to setup read target");
- QT3DS_ASSERT(false);
- }
- } else
- theTexture = inSourceTexture;
-
- if (inCommand.m_ParamName.IsValid()) {
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(inCommand.m_ParamName);
-
- if (theConstant) {
- if (theConstant->GetShaderConstantType()
- != NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- qCCritical(INVALID_OPERATION,
- "CustomMaterial %s: Binding buffer to parameter %s that is not a texture",
- inMaterial.m_ClassName.c_str(), inCommand.m_ParamName.c_str());
- QT3DS_ASSERT(false);
- } else {
- SetTexture(inShader, inCommand.m_ParamName,
- const_cast<NVRenderTexture2D *>(theTexture));
- }
- }
- }
-
- return theTexture;
- }
-
- void AllocateBuffer(const SAllocateBuffer &inCommand, NVRenderFrameBuffer *inTarget)
- {
- STextureDetails theSourceTextureDetails;
- NVRenderTexture2D *theTexture = NULL;
- // get color attachment we always assume at location 0
- if (inTarget) {
- NVRenderTextureOrRenderBuffer theSourceTexture =
- inTarget->GetAttachment(NVRenderFrameBufferAttachments::Color0);
- // we need a texture
- if (theSourceTexture.HasTexture2D()) {
- theSourceTextureDetails = theSourceTexture.GetTexture2D()->GetTextureDetails();
- } else {
- qCCritical(INVALID_OPERATION, "CustomMaterial %s: Invalid source texture",
- inCommand.m_Name.c_str());
- QT3DS_ASSERT(false);
- return;
- }
- } else {
- NVRenderContext &theContext = m_Context->GetRenderContext();
- // if we allocate a buffer based on the default target use viewport to get the dimension
- NVRenderRect theViewport(theContext.GetViewport());
- theSourceTextureDetails.m_Height = theViewport.m_Height;
- theSourceTextureDetails.m_Width = theViewport.m_Width;
- }
-
- QT3DSU32 theWidth = (QT3DSU32)(theSourceTextureDetails.m_Width * inCommand.m_SizeMultiplier);
- QT3DSU32 theHeight = (QT3DSU32)(theSourceTextureDetails.m_Height * inCommand.m_SizeMultiplier);
- NVRenderTextureFormats::Enum theFormat = inCommand.m_Format;
- if (theFormat == NVRenderTextureFormats::Unknown)
- theFormat = theSourceTextureDetails.m_Format;
- IResourceManager &theResourceManager(m_Context->GetResourceManager());
- // size intentionally requiried every loop;
- QT3DSU32 bufferIdx = FindBuffer(inCommand.m_Name);
- if (bufferIdx < m_AllocatedBuffers.size()) {
- SCustomMaterialBuffer &theEntry(m_AllocatedBuffers[bufferIdx]);
- STextureDetails theDetails = theEntry.m_Texture->GetTextureDetails();
- if (theDetails.m_Width == theWidth && theDetails.m_Height == theHeight
- && theDetails.m_Format == theFormat) {
- theTexture = theEntry.m_Texture;
- } else {
- ReleaseBuffer(bufferIdx);
- }
- }
-
- if (theTexture == NULL) {
- NVRenderFrameBuffer *theFB(theResourceManager.AllocateFrameBuffer());
- NVRenderTexture2D *theTexture(
- theResourceManager.AllocateTexture2D(theWidth, theHeight, theFormat));
- theTexture->SetMagFilter(inCommand.m_FilterOp);
- theTexture->SetMinFilter(
- static_cast<NVRenderTextureMinifyingOp::Enum>(inCommand.m_FilterOp));
- theTexture->SetTextureWrapS(inCommand.m_TexCoordOp);
- theTexture->SetTextureWrapT(inCommand.m_TexCoordOp);
- theFB->Attach(NVRenderFrameBufferAttachments::Color0, *theTexture);
- m_AllocatedBuffers.push_back(SCustomMaterialBuffer(
- inCommand.m_Name, *theFB, *theTexture, inCommand.m_BufferFlags));
- }
- }
-
- NVRenderFrameBuffer *BindBuffer(const SCustomMaterial &inMaterial, const SBindBuffer &inCommand,
- bool &outClearTarget, QT3DSVec2 &outDestSize)
- {
- NVRenderFrameBuffer *theBuffer = NULL;
- NVRenderTexture2D *theTexture = NULL;
-
- // search for the buffer
- QT3DSU32 bufferIdx = FindBuffer(inCommand.m_BufferName);
- if (bufferIdx < m_AllocatedBuffers.size()) {
- theBuffer = m_AllocatedBuffers[bufferIdx].m_FrameBuffer;
- theTexture = m_AllocatedBuffers[bufferIdx].m_Texture;
- }
-
- if (theBuffer == NULL) {
- qCCritical(INVALID_OPERATION, "Effect %s: Failed to find buffer %s for bind",
- inMaterial.m_ClassName.c_str(), inCommand.m_BufferName.c_str());
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- if (theTexture) {
- STextureDetails theDetails(theTexture->GetTextureDetails());
- m_Context->GetRenderContext().SetViewport(
- NVRenderRect(0, 0, (QT3DSU32)theDetails.m_Width, (QT3DSU32)theDetails.m_Height));
- outDestSize = QT3DSVec2((QT3DSF32)theDetails.m_Width, (QT3DSF32)theDetails.m_Height);
- outClearTarget = inCommand.m_NeedsClear;
- }
-
- return theBuffer;
- }
-
- void computeScreenCoverage(SCustomMaterialRenderContext &inRenderContext, QT3DSI32 *xMin,
- QT3DSI32 *yMin, QT3DSI32 *xMax, QT3DSI32 *yMax)
- {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- TNVBounds2BoxPoints outPoints;
- QT3DSVec4 projMin(QT3DS_MAX_REAL);
- QT3DSVec4 projMax(-QT3DS_MAX_REAL);
-
- // get points
- inRenderContext.m_Subset.m_Bounds.expand(outPoints);
- for (QT3DSU32 idx = 0; idx < 8; ++idx) {
- QT3DSVec4 homPoint(outPoints[idx], 1.0);
- QT3DSVec4 projPoint = inRenderContext.m_ModelViewProjection.transform(homPoint);
- projPoint /= projPoint.w;
-
- if (projMin.x > projPoint.x)
- projMin.x = projPoint.x;
- if (projMin.y > projPoint.y)
- projMin.y = projPoint.y;
- if (projMin.z > projPoint.z)
- projMin.z = projPoint.z;
-
- if (projMax.x < projPoint.x)
- projMax.x = projPoint.x;
- if (projMax.y < projPoint.y)
- projMax.y = projPoint.y;
- if (projMax.z < projPoint.z)
- projMax.z = projPoint.z;
- }
-
- NVRenderRect theViewport(theContext.GetViewport());
- QT3DSI32 x1 = QT3DSI32(projMax.x * (theViewport.m_Width / 2)
- + (theViewport.m_X + (theViewport.m_Width / 2)));
- QT3DSI32 y1 = QT3DSI32(projMax.y * (theViewport.m_Height / 2)
- + (theViewport.m_Y + (theViewport.m_Height / 2)));
-
- QT3DSI32 x2 = QT3DSI32(projMin.x * (theViewport.m_Width / 2)
- + (theViewport.m_X + (theViewport.m_Width / 2)));
- QT3DSI32 y2 = QT3DSI32(projMin.y * (theViewport.m_Height / 2)
- + (theViewport.m_Y + (theViewport.m_Height / 2)));
-
- if (x1 > x2) {
- *xMin = x2;
- *xMax = x1;
- } else {
- *xMin = x1;
- *xMax = x2;
- }
- if (y1 > y2) {
- *yMin = y2;
- *yMax = y1;
- } else {
- *yMin = y1;
- *yMax = y2;
- }
- }
-
- void BlitFramebuffer(SCustomMaterialRenderContext &inRenderContext,
- const SApplyBlitFramebuffer &inCommand, NVRenderFrameBuffer *inTarget)
- {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- // we change the read/render targets here
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __framebuffer(
- theContext, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- // we may alter scissor
- NVRenderContextScopedProperty<bool> theScissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled);
-
- if (inCommand.m_DestBufferName.IsValid()) {
- QT3DSU32 bufferIdx = FindBuffer(inCommand.m_DestBufferName);
- if (bufferIdx < m_AllocatedBuffers.size()) {
- SCustomMaterialBuffer &theEntry(m_AllocatedBuffers[bufferIdx]);
- theContext.SetRenderTarget(theEntry.m_FrameBuffer);
- } else {
- // we must have allocated the read target before
- qCCritical(INTERNAL_ERROR,
- "CustomMaterial: BlitFramebuffer: Failed to setup render target");
- QT3DS_ASSERT(false);
- }
- } else {
- // our dest is the default render target
- theContext.SetRenderTarget(inTarget);
- }
-
- if (inCommand.m_SourceBufferName.IsValid()) {
- QT3DSU32 bufferIdx = FindBuffer(inCommand.m_SourceBufferName);
- if (bufferIdx < m_AllocatedBuffers.size()) {
- SCustomMaterialBuffer &theEntry(m_AllocatedBuffers[bufferIdx]);
- theContext.SetReadTarget(theEntry.m_FrameBuffer);
- theContext.SetReadBuffer(NVReadFaces::Color0);
- } else {
- // we must have allocated the read target before
- qCCritical(INTERNAL_ERROR,
- "CustomMaterial: BlitFramebuffer: Failed to setup read target");
- QT3DS_ASSERT(false);
- }
- } else {
- // our source is the default read target
- // depending on what we render we assume color0 or back
- theContext.SetReadTarget(inTarget);
- NVReadFaces::Enum value = (inTarget) ? NVReadFaces::Color0 : NVReadFaces::Back;
- theContext.SetReadBuffer(value);
- }
-
- NVRenderRect theViewport(theContext.GetViewport());
- theContext.SetScissorTestEnabled(false);
-
- if (!m_UseFastBlits) {
- // only copy sreen amount of pixels
- QT3DSI32 xMin, yMin, xMax, yMax;
- computeScreenCoverage(inRenderContext, &xMin, &yMin, &xMax, &yMax);
-
- // same dimension
- theContext.BlitFramebuffer(xMin, yMin, xMax, yMax, xMin, yMin, xMax, yMax,
- NVRenderClearValues::Color,
- NVRenderTextureMagnifyingOp::Nearest);
- } else {
- // same dimension
- theContext.BlitFramebuffer(
- theViewport.m_X, theViewport.m_Y, theViewport.m_X + theViewport.m_Width,
- theViewport.m_Y + theViewport.m_Height, theViewport.m_X, theViewport.m_Y,
- theViewport.m_X + theViewport.m_Width, theViewport.m_Y + theViewport.m_Height,
- NVRenderClearValues::Color, NVRenderTextureMagnifyingOp::Nearest);
- }
- }
-
- SLayerGlobalRenderProperties
- GetLayerGlobalRenderProperties(SCustomMaterialRenderContext &inRenderContext)
- {
- const SLayer &theLayer = inRenderContext.m_Layer;
- const SLayerRenderData &theData = inRenderContext.m_LayerData;
-
- return SLayerGlobalRenderProperties(
- theLayer, const_cast<SCamera &>(inRenderContext.m_Camera), theData.m_CameraDirection,
- inRenderContext.m_Lights, NVDataRef<QT3DSVec3>(), theData.m_ShadowMapManager.mPtr,
- const_cast<NVRenderTexture2D *>(inRenderContext.m_DepthTexture),
- const_cast<NVRenderTexture2D *>(inRenderContext.m_AOTexture), theLayer.m_LightProbe,
- theLayer.m_LightProbe2, theLayer.m_ProbeHorizon, theLayer.m_ProbeBright,
- theLayer.m_Probe2Window, theLayer.m_Probe2Pos, theLayer.m_Probe2Fade,
- theLayer.m_ProbeFov);
- }
-
- void RenderPass(SCustomMaterialRenderContext &inRenderContext, SCustomMaterialShader &inShader,
- NVRenderTexture2D * /* inSourceTexture */
- ,
- NVRenderFrameBuffer *inFrameBuffer, bool inRenderTargetNeedsClear,
- NVRenderInputAssembler &inAssembler, QT3DSU32 inCount, QT3DSU32 inOffset)
- {
- ICustomMaterialShaderGenerator &theMaterialGenerator(
- m_Context->GetCustomMaterialShaderGenerator());
-
- theMaterialGenerator.SetMaterialProperties(
- *inShader.m_Shader, inRenderContext.m_Material, QT3DSVec2(1.0, 1.0),
- inRenderContext.m_ModelViewProjection, inRenderContext.m_NormalMatrix,
- inRenderContext.m_ModelMatrix, inRenderContext.m_FirstImage, inRenderContext.m_Opacity,
- GetLayerGlobalRenderProperties(inRenderContext));
-
- NVRenderContext &theContext(m_Context->GetRenderContext());
- theContext.SetRenderTarget(inFrameBuffer);
-
- QT3DSVec4 clearColor(0.0);
- NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- theContext, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
- clearColor);
- if (inRenderTargetNeedsClear) {
- theContext.Clear(qt3ds::render::NVRenderClearValues::Color);
- }
-
- // I think the prim type should always be fetched from the
- // current mesh subset setup because there you get the actual draw mode
- // for this frame
- NVRenderDrawMode::Enum theDrawMode = inAssembler.GetPrimitiveType();
-
- // tesselation
- if (inRenderContext.m_Subset.m_PrimitiveType == NVRenderDrawMode::Patches) {
- QT3DSVec2 camProps(inRenderContext.m_Camera.m_ClipNear,
- inRenderContext.m_Camera.m_ClipFar);
- theDrawMode = inRenderContext.m_Subset.m_PrimitiveType;
- inShader.m_Tessellation.m_EdgeTessLevel.Set(inRenderContext.m_Subset.m_EdgeTessFactor);
- inShader.m_Tessellation.m_InsideTessLevel.Set(
- inRenderContext.m_Subset.m_InnerTessFactor);
- // the blend value is hardcoded
- inShader.m_Tessellation.m_PhongBlend.Set(0.75);
- // this should finally be based on some user input
- inShader.m_Tessellation.m_DistanceRange.Set(camProps);
- // enable culling
- inShader.m_Tessellation.m_DisableCulling.Set(0.0);
- }
-
- if (inRenderContext.m_Subset.m_WireframeMode) {
- NVRenderRect theViewport(theContext.GetViewport());
- QT3DSMat44 vpMatrix;
- vpMatrix.column0 = QT3DSVec4((float)theViewport.m_Width / 2.0f, 0.0, 0.0, 0.0);
- vpMatrix.column1 = QT3DSVec4(0.0, (float)theViewport.m_Height / 2.0f, 0.0, 0.0);
- vpMatrix.column2 = QT3DSVec4(0.0, 0.0, 1.0, 0.0);
- vpMatrix.column3 =
- QT3DSVec4((float)theViewport.m_Width / 2.0f + (float)theViewport.m_X,
- (float)theViewport.m_Height / 2.0f + (float)theViewport.m_Y, 0.0, 1.0);
-
- inShader.m_ViewportMatrix.Set(vpMatrix);
- }
-
- theContext.SetInputAssembler(&inAssembler);
-
- theContext.SetCullingEnabled(true);
- QT3DSU32 count = inCount;
- QT3DSU32 offset = inOffset;
-
- theContext.Draw(theDrawMode, count, offset);
- }
-
- void DoRenderCustomMaterial(SCustomMaterialRenderContext &inRenderContext,
- const SCustomMaterial &inMaterial, SMaterialClass &inClass,
- NVRenderFrameBuffer *inTarget, TShaderFeatureSet inFeatureSet)
- {
- NVRenderContext &theContext = m_Context->GetRenderContext();
- SCustomMaterialShader *theCurrentShader(NULL);
-
- NVRenderFrameBuffer *theCurrentRenderTarget(inTarget);
- NVRenderRect theOriginalViewport(theContext.GetViewport());
- NVRenderTexture2D *theCurrentSourceTexture = 0;
-
- // for refrative materials we come from the transparent render path
- // but we do not want to do blending
- bool wasBlendingEnabled = theContext.IsBlendingEnabled();
- if (inMaterial.m_hasRefraction)
- theContext.SetBlendingEnabled(false);
-
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __framebuffer(
- theContext, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport);
-
- QT3DSVec2 theDestSize;
- bool theRenderTargetNeedsClear = false;
-
- NVConstDataRef<dynamic::SCommand *> theCommands(inClass.m_Class->GetRenderCommands());
- for (QT3DSU32 commandIdx = 0, commandEnd = theCommands.size(); commandIdx < commandEnd;
- ++commandIdx) {
- const SCommand &theCommand(*theCommands[commandIdx]);
-
- switch (theCommand.m_Type) {
- case CommandTypes::AllocateBuffer:
- AllocateBuffer(static_cast<const SAllocateBuffer &>(theCommand), inTarget);
- break;
- case CommandTypes::BindBuffer:
- theCurrentRenderTarget =
- BindBuffer(inMaterial, static_cast<const SBindBuffer &>(theCommand),
- theRenderTargetNeedsClear, theDestSize);
- break;
- case CommandTypes::BindTarget:
- // Restore the previous render target and info.
- theCurrentRenderTarget = inTarget;
- theContext.SetViewport(theOriginalViewport);
- break;
- case CommandTypes::BindShader: {
- theCurrentShader = NULL;
- SMaterialOrComputeShader theBindResult =
- BindShader(inRenderContext, inMaterial,
- static_cast<const SBindShader &>(theCommand), inFeatureSet);
- if (theBindResult.IsMaterialShader())
- theCurrentShader = &theBindResult.MaterialShader();
- } break;
- case CommandTypes::ApplyInstanceValue:
- // we apply the property update explicitly at the render pass
- break;
- case CommandTypes::Render:
- if (theCurrentShader) {
- RenderPass(inRenderContext, *theCurrentShader, theCurrentSourceTexture,
- theCurrentRenderTarget, theRenderTargetNeedsClear,
- *inRenderContext.m_Subset.m_InputAssembler,
- inRenderContext.m_Subset.m_Count, inRenderContext.m_Subset.m_Offset);
- }
- // reset
- theRenderTargetNeedsClear = false;
- break;
- case CommandTypes::ApplyBlending:
- ApplyBlending(static_cast<const SApplyBlending &>(theCommand));
- break;
- case CommandTypes::ApplyBufferValue:
- if (theCurrentShader)
- ApplyBufferValue(inMaterial, *theCurrentShader->m_Shader,
- static_cast<const SApplyBufferValue &>(theCommand),
- theCurrentSourceTexture);
- break;
- case CommandTypes::ApplyBlitFramebuffer:
- BlitFramebuffer(inRenderContext,
- static_cast<const SApplyBlitFramebuffer &>(theCommand), inTarget);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- if (inMaterial.m_hasRefraction)
- theContext.SetBlendingEnabled(wasBlendingEnabled);
-
- // Release any per-frame buffers
- for (QT3DSU32 idx = 0; idx < m_AllocatedBuffers.size(); ++idx) {
- if (m_AllocatedBuffers[idx].m_Flags.IsSceneLifetime() == false) {
- ReleaseBuffer(idx);
- --idx;
- }
- }
- }
-
- const char *GetShaderName(const SCustomMaterial &inMaterial) override
- {
- SMaterialClass *theClass = GetMaterialClass(inMaterial.m_ClassName);
- if (!theClass)
- return NULL;
-
- NVConstDataRef<dynamic::SCommand *> theCommands = theClass->m_Class->GetRenderCommands();
- TShaderAndFlags thePrepassShader;
- for (QT3DSU32 idx = 0, end = theCommands.size();
- idx < end && thePrepassShader.first.mPtr == NULL; ++idx) {
- const SCommand &theCommand = *theCommands[idx];
- if (theCommand.m_Type == CommandTypes::BindShader) {
- const SBindShader &theBindCommand = static_cast<const SBindShader &>(theCommand);
- return theBindCommand.m_ShaderPath.c_str();
- }
- }
-
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- void ApplyShaderPropertyValues(const SCustomMaterial &inMaterial,
- NVRenderShaderProgram &inProgram) override
- {
- SMaterialClass *theClass = GetMaterialClass(inMaterial.m_ClassName);
- if (!theClass)
- return;
-
- SApplyInstanceValue applier;
- ApplyInstanceValue(const_cast<SCustomMaterial &>(inMaterial), *theClass, inProgram,
- applier);
- }
-
- void renderSubpresentations(SCustomMaterial &inMaterial) override
- {
- SMaterialClass *theClass = GetMaterialClass(inMaterial.m_ClassName);
- if (!theClass)
- return;
-
- NVConstDataRef<SPropertyDefinition> theDefs = theClass->m_Class->GetProperties();
- for (QT3DSU32 idx = 0, end = theDefs.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(theDefs[idx]);
- if (theDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- QT3DSU8 *dataPtr = inMaterial.GetDataSectionBegin() + theDefinition.m_Offset;
- StaticAssert<sizeof(CRegisteredString)
- == sizeof(NVRenderTexture2DPtr)>::valid_expression();
- CRegisteredString *theStrPtr = reinterpret_cast<CRegisteredString *>(dataPtr);
- IOffscreenRenderManager &theOffscreenRenderer(
- m_Context->GetOffscreenRenderManager());
-
- if (theStrPtr->IsValid()) {
- if (theOffscreenRenderer.HasOffscreenRenderer(*theStrPtr))
- theOffscreenRenderer.GetRenderedItem(*theStrPtr);
- }
- }
- }
- }
-
- virtual void PrepareTextureForRender(SMaterialClass &inClass, SCustomMaterial &inMaterial)
- {
- NVConstDataRef<SPropertyDefinition> thePropDefs = inClass.m_Class->GetProperties();
- for (QT3DSU32 idx = 0, end = thePropDefs.size(); idx < end; ++idx) {
- if (thePropDefs[idx].m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- if (thePropDefs[idx].m_TexUsageType == NVRenderTextureTypeValue::Displace) {
- SImage *pImage = NULL;
-
- // we only do this to not miss if "None" is selected
- CRegisteredString theStrPtr = *reinterpret_cast<CRegisteredString *>(
- inMaterial.GetDataSectionBegin() + thePropDefs[idx].m_Offset);
-
- if (theStrPtr.IsValid()) {
-
- QT3DSU32 index = FindAllocatedImage(thePropDefs[idx].m_ImagePath);
- if (index == QT3DSU32(-1)) {
- pImage = QT3DS_NEW(m_CoreContext.GetAllocator(), SImage)();
- m_AllocatedImages.push_back(
- eastl::make_pair(thePropDefs[idx].m_ImagePath, pImage));
- } else
- pImage = m_AllocatedImages[index].second;
-
- if (inMaterial.m_DisplacementMap != pImage) {
- inMaterial.m_DisplacementMap = pImage;
- inMaterial.m_DisplacementMap->m_ImagePath =
- thePropDefs[idx].m_ImagePath;
- inMaterial.m_DisplacementMap->m_ImageShaderName =
- thePropDefs[idx].m_Name; // this is our name in the shader
- inMaterial.m_DisplacementMap->m_VerticalTilingMode =
- thePropDefs[idx].m_CoordOp;
- inMaterial.m_DisplacementMap->m_HorizontalTilingMode =
- thePropDefs[idx].m_CoordOp;
- }
- } else {
- inMaterial.m_DisplacementMap = NULL;
- }
- } else if (thePropDefs[idx].m_TexUsageType == NVRenderTextureTypeValue::Emissive2) {
- SImage *pImage = NULL;
-
- // we only do this to not miss if "None" is selected
- CRegisteredString theStrPtr = *reinterpret_cast<CRegisteredString *>(
- inMaterial.GetDataSectionBegin() + thePropDefs[idx].m_Offset);
-
- if (theStrPtr.IsValid()) {
- QT3DSU32 index = FindAllocatedImage(thePropDefs[idx].m_ImagePath);
- if (index == QT3DSU32(-1)) {
- pImage = QT3DS_NEW(m_CoreContext.GetAllocator(), SImage)();
- m_AllocatedImages.push_back(
- eastl::make_pair(thePropDefs[idx].m_ImagePath, pImage));
- } else
- pImage = m_AllocatedImages[index].second;
-
- if (inMaterial.m_EmissiveMap2 != pImage) {
- inMaterial.m_EmissiveMap2 = pImage;
- inMaterial.m_EmissiveMap2->m_ImagePath = thePropDefs[idx].m_ImagePath;
- inMaterial.m_EmissiveMap2->m_ImageShaderName =
- thePropDefs[idx].m_Name; // this is our name in the shader
- inMaterial.m_EmissiveMap2->m_VerticalTilingMode =
- thePropDefs[idx].m_CoordOp;
- inMaterial.m_EmissiveMap2->m_HorizontalTilingMode =
- thePropDefs[idx].m_CoordOp;
- }
- } else {
- inMaterial.m_EmissiveMap2 = NULL;
- }
- }
- }
- }
- }
-
- virtual void PrepareDisplacementForRender(SMaterialClass &inClass, SCustomMaterial &inMaterial)
- {
- if (inMaterial.m_DisplacementMap == NULL)
- return;
-
- // our displacement mappin in MDL has fixed naming
- NVConstDataRef<SPropertyDefinition> thePropDefs = inClass.m_Class->GetProperties();
- for (QT3DSU32 idx = 0, end = thePropDefs.size(); idx < end; ++idx) {
- if (thePropDefs[idx].m_DataType == NVRenderShaderDataTypes::QT3DSF32
- && AreEqual(thePropDefs[idx].m_Name.c_str(), "displaceAmount")) {
- QT3DSF32 theValue = *reinterpret_cast<const QT3DSF32 *>(inMaterial.GetDataSectionBegin()
- + thePropDefs[idx].m_Offset);
- inMaterial.m_DisplaceAmount = theValue;
- } else if (thePropDefs[idx].m_DataType == NVRenderShaderDataTypes::QT3DSVec3
- && AreEqual(thePropDefs[idx].m_Name.c_str(), "displace_tiling")) {
- QT3DSVec3 theValue = *reinterpret_cast<const QT3DSVec3 *>(inMaterial.GetDataSectionBegin()
- + thePropDefs[idx].m_Offset);
- if (theValue.x != inMaterial.m_DisplacementMap->m_Scale.x
- || theValue.y != inMaterial.m_DisplacementMap->m_Scale.y) {
- inMaterial.m_DisplacementMap->m_Scale = QT3DSVec2(theValue.x, theValue.y);
- inMaterial.m_DisplacementMap->m_Flags.SetTransformDirty(true);
- }
- }
- }
- }
-
- void PrepareMaterialForRender(SMaterialClass &inClass, SCustomMaterial &inMaterial)
- {
- PrepareTextureForRender(inClass, inMaterial);
-
- if (inClass.m_HasDisplacement)
- PrepareDisplacementForRender(inClass, inMaterial);
- }
-
- // Returns true if the material is dirty and thus will produce a different render result
- // than previously. This effects things like progressive AA.
- // TODO - return more information, specifically about transparency (object is transparent,
- // object is completely transparent
- bool PrepareForRender(const SModel & /*inModel*/, const SRenderSubset & /*inSubset*/,
- SCustomMaterial &inMaterial, bool clearMaterialDirtyFlags) override
- {
- SMaterialClass *theMaterialClass = GetMaterialClass(inMaterial.m_ClassName);
- if (theMaterialClass == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- PrepareMaterialForRender(*theMaterialClass, inMaterial);
-
- inMaterial.m_hasTransparency = theMaterialClass->m_HasTransparency;
- inMaterial.m_hasRefraction = theMaterialClass->m_HasRefraction;
- inMaterial.m_hasVolumetricDF = false;
-
- bool wasDirty = inMaterial.IsDirty() || theMaterialClass->m_AlwaysDirty;
- if (clearMaterialDirtyFlags)
- inMaterial.UpdateDirtyForFrame();
-
- return wasDirty;
- }
-
- // TODO - handle UIC specific features such as vertex offsets for prog-aa and opacity.
- void RenderSubset(SCustomMaterialRenderContext &inRenderContext,
- TShaderFeatureSet inFeatureSet) override
- {
- SMaterialClass *theClass = GetMaterialClass(inRenderContext.m_Material.m_ClassName);
-
- // Ensure that our overall render context comes back no matter what the client does.
- qt3ds::render::NVRenderContextScopedProperty<qt3ds::render::NVRenderBlendFunctionArgument>
- __blendFunction(m_Context->GetRenderContext(), &NVRenderContext::GetBlendFunction,
- &NVRenderContext::SetBlendFunction,
- qt3ds::render::NVRenderBlendFunctionArgument());
- qt3ds::render::NVRenderContextScopedProperty<qt3ds::render::NVRenderBlendEquationArgument>
- __blendEquation(m_Context->GetRenderContext(), &NVRenderContext::GetBlendEquation,
- &NVRenderContext::SetBlendEquation,
- qt3ds::render::NVRenderBlendEquationArgument());
-
- NVRenderContextScopedProperty<bool> theBlendEnabled(m_Context->GetRenderContext(),
- &NVRenderContext::IsBlendingEnabled,
- &NVRenderContext::SetBlendingEnabled);
-
- DoRenderCustomMaterial(inRenderContext, inRenderContext.m_Material, *theClass,
- m_Context->GetRenderContext().GetRenderTarget(), inFeatureSet);
- }
-
- bool RenderDepthPrepass(const QT3DSMat44 &inMVP, const SCustomMaterial &inMaterial,
- const SRenderSubset &inSubset) override
- {
- SMaterialClass *theClass = GetMaterialClass(inMaterial.m_ClassName);
- NVConstDataRef<dynamic::SCommand *> theCommands = theClass->m_Class->GetRenderCommands();
- TShaderAndFlags thePrepassShader;
- for (QT3DSU32 idx = 0, end = theCommands.size();
- idx < end && thePrepassShader.first.mPtr == NULL; ++idx) {
- const SCommand &theCommand = *theCommands[idx];
- if (theCommand.m_Type == CommandTypes::BindShader) {
- const SBindShader &theBindCommand = static_cast<const SBindShader &>(theCommand);
- thePrepassShader = m_Context->GetDynamicObjectSystem().GetDepthPrepassShader(
- theBindCommand.m_ShaderPath, CRegisteredString(), TShaderFeatureSet());
- }
- }
-
- if (thePrepassShader.first.mPtr == NULL)
- return false;
-
- NVRenderContext &theContext = m_Context->GetRenderContext();
- NVRenderShaderProgram &theProgram = *thePrepassShader.first;
- theContext.SetActiveShader(&theProgram);
- theProgram.SetPropertyValue("model_view_projection", inMVP);
- theContext.SetInputAssembler(inSubset.m_InputAssemblerPoints);
- theContext.Draw(NVRenderDrawMode::Lines, inSubset.m_PosVertexBuffer->GetNumVertexes(), 0);
- return true;
- }
-
- void OnMaterialActivationChange(const SCustomMaterial &inMaterial, bool inActive) override
- {
- Q_UNUSED(inMaterial)
- Q_UNUSED(inActive)
- }
-
- void EndFrame() override
- {
- QT3DSU64 currentFrameTime = qt3ds::foundation::Time::getCurrentTimeInTensOfNanoSeconds();
- if (m_LastFrameTime) {
- QT3DSU64 timePassed = currentFrameTime - m_LastFrameTime;
- m_MillisecondsSinceLastFrame = static_cast<QT3DSF32>(timePassed / 100000.0);
- }
- m_LastFrameTime = currentFrameTime;
- }
-
- void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap,
- const char8_t * /*inProjectDir*/) const override
- {
- QT3DSU32 offset = ioBuffer.size();
- ioBuffer.write((QT3DSU32)m_StringMaterialMap.size());
- for (TStringMaterialMap::const_iterator iter = m_StringMaterialMap.begin(),
- end = m_StringMaterialMap.end();
- iter != end; ++iter) {
- size_t nameOffset = ioBuffer.size() - offset;
- (void)nameOffset;
- CRegisteredString materialName(iter->first);
- materialName.Remap(inRemapMap);
- ioBuffer.write(materialName);
- const SMaterialClass *materialClass = iter->second.mPtr;
- QT3DSU32 offset = ioBuffer.size();
- ioBuffer.write(*materialClass);
- QT3DSU8 *materialOffset = ioBuffer.begin() + offset;
- SMaterialClass *writtenClass = (SMaterialClass *)materialOffset;
- writtenClass->AfterWrite();
- ioBuffer.align(4);
- }
- }
-
- void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t * /*inProjectDir*/) override
- {
- m_Allocator.m_PreAllocatedBlock = inData;
- m_Allocator.m_OwnsMemory = false;
- qt3ds::render::SDataReader theReader(inData.begin(), inData.end());
- QT3DSU32 numMaterialClasses = theReader.LoadRef<QT3DSU32>();
- for (QT3DSU32 idx = 0; idx < numMaterialClasses; ++idx) {
- CRegisteredString clsName = theReader.LoadRef<CRegisteredString>();
- clsName.Remap(inStrDataBlock);
- IDynamicObjectClass *theDynamicCls =
- m_CoreContext.GetDynamicObjectSystemCore().GetDynamicObjectClass(clsName);
- SMaterialClass *theReadClass = theReader.Load<SMaterialClass>();
- theReader.Align(4);
- if (theDynamicCls) {
- theReadClass->AfterRead(m_Allocator, *theDynamicCls);
- m_StringMaterialMap.insert(eastl::make_pair(clsName, theReadClass));
- }
- }
- }
-
- ICustomMaterialSystem &GetCustomMaterialSystem(IQt3DSRenderContext &inContext) override
- {
- m_Context = &inContext;
-
- // check for fast blits
- NVRenderContext &theContext = m_Context->GetRenderContext();
- m_UseFastBlits = theContext.GetRenderBackendCap(
- qt3ds::render::NVRenderBackend::NVRenderBackendCaps::FastBlits);
-
- return *this;
- }
-};
-}
-
-ICustomMaterialSystemCore &
-ICustomMaterialSystemCore::CreateCustomMaterialSystemCore(IQt3DSRenderContextCore &ctx)
-{
- return *QT3DS_NEW(ctx.GetAllocator(), SMaterialSystem)(ctx);
-}
-
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h
deleted file mode 100644
index 6fe522fd..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CUSTOM_MATERIAL_SYSTEM_H
-#define QT3DS_RENDER_CUSTOM_MATERIAL_SYSTEM_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "rendererimpl/Qt3DSVertexPipelineImpl.h"
-
-namespace qt3ds {
-namespace render {
-
- namespace dynamic {
- struct SCommand; // UICRenderEffectCommands.h
- }
-
- struct SCustomMaterialRenderContext;
-
- class ICustomMaterialSystemCore : public NVRefCounted
- {
- public:
- virtual bool IsMaterialRegistered(CRegisteredString inStr) = 0;
-
- virtual bool
- RegisterMaterialClass(CRegisteredString inName,
- NVConstDataRef<dynamic::SPropertyDeclaration> inProperties) = 0;
-
- virtual NVConstDataRef<dynamic::SPropertyDefinition>
- GetCustomMaterialProperties(CRegisteredString inCustomMaterialName) const = 0;
-
- virtual void SetCustomMaterialRefraction(CRegisteredString inName,
- bool inHasRefraction) = 0;
- virtual void SetCustomMaterialTransparency(CRegisteredString inName,
- bool inHasTransparency) = 0;
- virtual void SetCustomMaterialAlwaysDirty(CRegisteredString inName,
- bool inIsAlwaysDirty) = 0;
- virtual void SetCustomMaterialShaderKey(CRegisteredString inName, QT3DSU32 inShaderKey) = 0;
- virtual void SetCustomMaterialLayerCount(CRegisteredString inName, QT3DSU32 inLayerCount) = 0;
- // The custom material commands are the actual commands that run for a given material
- // effect. The tell the system exactly
- // explicitly things like bind this shader, bind this render target, apply this property,
- // run this shader
- // See UICRenderEffectCommands.h for the list of commands.
- // These commands are copied into the effect.
- virtual void SetCustomMaterialCommands(CRegisteredString inName,
- NVConstDataRef<dynamic::SCommand *> inCommands) = 0;
-
- virtual void SetMaterialClassShader(CRegisteredString inName, const char8_t *inShaderType,
- const char8_t *inShaderVersion,
- const char8_t *inShaderData, bool inHasGeomShader,
- bool inIsComputeShader) = 0;
-
- virtual SCustomMaterial *
- CreateCustomMaterial(CRegisteredString inName,
- NVAllocatorCallback &inSceneGraphAllocator) = 0;
-
- virtual void SetPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<CRegisteredString> inNames) = 0;
-
- virtual void SetPropertyTextureSettings(CRegisteredString inEffectName,
- CRegisteredString inPropName,
- CRegisteredString inPropPath,
- NVRenderTextureTypeValue::Enum inTexType,
- NVRenderTextureCoordOp::Enum inCoordOp,
- NVRenderTextureMagnifyingOp::Enum inMagFilterOp,
- NVRenderTextureMinifyingOp::Enum inMinFilterOp) = 0;
-
- virtual void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap,
- const char8_t *inProjectDir) const = 0;
- virtual void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t *inProjectDir) = 0;
-
- virtual ICustomMaterialSystem &GetCustomMaterialSystem(IQt3DSRenderContext &inContext) = 0;
-
- static ICustomMaterialSystemCore &
- CreateCustomMaterialSystemCore(IQt3DSRenderContextCore &inContext);
- };
- // How to handle blend modes?
- class ICustomMaterialSystem : public ICustomMaterialSystemCore
- {
- public:
- // Returns true if the material is dirty and thus will produce a different render result
- // than previously. This effects things like progressive AA.
- virtual bool PrepareForRender(const SModel &inModel, const SRenderSubset &inSubset,
- SCustomMaterial &inMaterial, bool inClearDirty) = 0;
-
- virtual bool RenderDepthPrepass(const QT3DSMat44 &inMVP, const SCustomMaterial &inMaterial,
- const SRenderSubset &inSubset) = 0;
- virtual void RenderSubset(SCustomMaterialRenderContext &inRenderContext,
- TShaderFeatureSet inFeatureSet) = 0;
- virtual void OnMaterialActivationChange(const SCustomMaterial &inMaterial,
- bool inActive) = 0;
-
- // get shader name
- virtual const char *GetShaderName(const SCustomMaterial &inMaterial) = 0;
- // apply property values
- virtual void ApplyShaderPropertyValues(const SCustomMaterial &inMaterial,
- NVRenderShaderProgram &inProgram) = 0;
- virtual void renderSubpresentations(SCustomMaterial &inMaterial) = 0;
- // Called by the uiccontext so this system can clear any per-frame render information.
- virtual void EndFrame() = 0;
- };
-
- struct QT3DS_AUTOTEST_EXPORT SCustomMaterialVertexPipeline : public SVertexPipelineImpl
- {
- IQt3DSRenderContext *m_Context;
- TessModeValues::Enum m_TessMode;
-
- SCustomMaterialVertexPipeline(IQt3DSRenderContext *inContext, TessModeValues::Enum inTessMode);
- void InitializeTessControlShader();
- void InitializeTessEvaluationShader();
- void FinalizeTessControlShader();
- void FinalizeTessEvaluationShader();
-
- // Responsible for beginning all vertex and fragment generation (void main() { etc).
- virtual void BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) override;
- // The fragment shader expects a floating point constant, object_opacity to be defined
- // post this method.
- virtual void BeginFragmentGeneration() override;
- // Output variables may be mangled in some circumstances so the shader generation
- // system needs an abstraction mechanism around this.
- virtual void AssignOutput(const char8_t *inVarName, const char8_t *inVarValue) override;
- virtual void GenerateEnvMapReflection() override {}
- virtual void GenerateViewVector() override {}
- virtual void GenerateUVCoords(QT3DSU32 inUVSet) override;
- virtual void GenerateWorldNormal() override;
- virtual void GenerateObjectNormal() override;
- virtual void GenerateVarTangentAndBinormal() override;
- virtual void GenerateWorldPosition() override;
- // responsible for closing all vertex and fragment generation
- virtual void EndVertexGeneration(bool customShader) override;
- virtual void EndFragmentGeneration(bool customShader) override;
- virtual IShaderStageGenerator &ActiveStage() override;
- virtual void AddInterpolationParameter(const char8_t *inName, const char8_t *inType) override;
- virtual void DoGenerateUVCoords(QT3DSU32 inUVSet) override;
- virtual void DoGenerateWorldNormal() override;
- virtual void DoGenerateObjectNormal() override;
- virtual void DoGenerateWorldPosition() override;
- virtual void DoGenerateVarTangentAndBinormal() override;
- virtual void DoGenerateVertexColor() override;
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp
deleted file mode 100644
index 221f3296..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp
+++ /dev/null
@@ -1,1931 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "Qt3DSRenderableImage.h"
-#include "Qt3DSRenderImage.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderLight.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderShadowMap.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderLightConstantProperties.h"
-
-using namespace qt3ds::render;
-using qt3ds::render::NVRenderCachedShaderProperty;
-using qt3ds::render::NVRenderCachedShaderBuffer;
-
-namespace {
-
-const QT3DSF32 MINATTENUATION = 0;
-const QT3DSF32 MAXATTENUATION = 1000;
-
-QT3DSF32 ClampFloat(QT3DSF32 value, QT3DSF32 min, QT3DSF32 max)
-{
- return value < min ? min : ((value > max) ? max : value);
-}
-
-QT3DSF32 TranslateConstantAttenuation(QT3DSF32 attenuation)
-{
- return attenuation * .01f;
-}
-
-QT3DSF32 TranslateLinearAttenuation(QT3DSF32 attenuation)
-{
- attenuation = ClampFloat(attenuation, MINATTENUATION, MAXATTENUATION);
- return attenuation * 0.0001f;
-}
-
-QT3DSF32 TranslateQuadraticAttenuation(QT3DSF32 attenuation)
-{
- attenuation = ClampFloat(attenuation, MINATTENUATION, MAXATTENUATION);
- return attenuation * 0.0000001f;
-}
-
-/**
- * Cached texture property lookups, used one per texture so a shader generator for N
- * textures will have an array of N of these lookup objects.
- */
-struct SShaderTextureProperties
-{
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
- NVRenderCachedShaderProperty<QT3DSVec3> m_Offsets;
- NVRenderCachedShaderProperty<QT3DSVec4> m_Rotations;
- NVRenderCachedShaderProperty<QT3DSVec2> m_Size;
- SShaderTextureProperties(const char *sampName, const char *offName, const char *rotName,
- const char *sizeName,
- NVRenderShaderProgram &inShader)
- : m_Sampler(sampName, inShader)
- , m_Offsets(offName, inShader)
- , m_Rotations(rotName, inShader)
- , m_Size(sizeName, inShader)
- {
- }
- SShaderTextureProperties() {}
-};
-
-/**
- * Cached light property lookups, used one per light so a shader generator for N
- * lights will have an array of N of these lookup objects.
- */
-struct SShaderLightProperties
-{
- // Color of the light
- QT3DSVec4 m_LightColor;
- SLightSourceShader m_LightData;
-
- SShaderLightProperties() {}
-};
-
-struct SShadowMapProperties
-{
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_ShadowmapTexture; ///< shadow texture
- NVRenderCachedShaderProperty<NVRenderTextureCube *> m_ShadowCubeTexture; ///< shadow cubemap
- NVRenderCachedShaderProperty<QT3DSMat44>
- m_ShadowmapMatrix; ///< world to ligh space transform matrix
- NVRenderCachedShaderProperty<QT3DSVec4> m_ShadowmapSettings; ///< shadow rendering settings
-
- SShadowMapProperties() {}
- SShadowMapProperties(const char *shadowmapTextureName, const char *shadowcubeTextureName,
- const char *shadowmapMatrixName, const char *shadowmapSettingsName,
- NVRenderShaderProgram &inShader)
- : m_ShadowmapTexture(shadowmapTextureName, inShader)
- , m_ShadowCubeTexture(shadowcubeTextureName, inShader)
- , m_ShadowmapMatrix(shadowmapMatrixName, inShader)
- , m_ShadowmapSettings(shadowmapSettingsName, inShader)
- {
- }
-};
-
-/**
- * The results of generating a shader. Caches all possible variable names into
- * typesafe objects.
- */
-struct SShaderGeneratorGeneratedShader
-{
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- // Specific properties we know the shader has to have.
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
- NVRenderCachedShaderProperty<QT3DSMat33> m_NormalMatrix;
- NVRenderCachedShaderProperty<QT3DSMat44> m_GlobalTransform;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewProj;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewMatrix;
- NVRenderCachedShaderProperty<QT3DSVec4> m_MaterialDiffuse;
- NVRenderCachedShaderProperty<QT3DSVec4> m_MaterialProperties;
- // tint, ior
- NVRenderCachedShaderProperty<QT3DSVec4> m_MaterialSpecular;
- NVRenderCachedShaderProperty<QT3DSF32> m_BumpAmount;
- NVRenderCachedShaderProperty<QT3DSF32> m_DisplaceAmount;
- NVRenderCachedShaderProperty<QT3DSF32> m_TranslucentFalloff;
- NVRenderCachedShaderProperty<QT3DSF32> m_DiffuseLightWrap;
- NVRenderCachedShaderProperty<QT3DSF32> m_FresnelPower;
- NVRenderCachedShaderProperty<QT3DSVec3> m_DiffuseColor;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraPosition;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraDirection;
- QT3DSVec3 m_LightAmbientTotal;
- NVRenderCachedShaderProperty<QT3DSVec3> m_MaterialDiffuseLightAmbientTotal;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
-
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_DepthTexture;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_AOTexture;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LightProbe;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeProps;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeOpts;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeRot;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbeOfs;
- NVRenderCachedShaderProperty<QT3DSVec2> m_LightProbeSize;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LightProbe2;
- NVRenderCachedShaderProperty<QT3DSVec4> m_LightProbe2Props;
- NVRenderCachedShaderProperty<QT3DSVec2> m_LightProbe2Size;
-
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_AoShadowParams;
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_LightsBuffer;
-
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *m_lightConstantProperties;
-
- // Cache the image property name lookups
- nvvector<SShaderTextureProperties> m_Images;
- nvvector<SShaderLightProperties> m_Lights;
- // Cache shadow map properties
- nvvector<SShadowMapProperties> m_ShadowMaps;
-
- QT3DSI32 m_RefCount;
-
- SShaderGeneratorGeneratedShader(NVRenderShaderProgram &inShader, NVRenderContext &inContext)
- : m_Allocator(inContext.GetAllocator())
- , m_Shader(inShader)
- , m_MVP("model_view_projection", inShader)
- , m_NormalMatrix("normal_matrix", inShader)
- , m_GlobalTransform("model_matrix", inShader)
- , m_ViewProj("view_projection_matrix", inShader)
- , m_ViewMatrix("view_matrix", inShader)
- , m_MaterialDiffuse("material_diffuse", inShader)
- , m_MaterialProperties("material_properties", inShader)
- , m_MaterialSpecular("material_specular", inShader)
- , m_BumpAmount("bumpAmount", inShader)
- , m_DisplaceAmount("displaceAmount", inShader)
- , m_TranslucentFalloff("translucentFalloff", inShader)
- , m_DiffuseLightWrap("diffuseLightWrap", inShader)
- , m_FresnelPower("fresnelPower", inShader)
- , m_DiffuseColor("diffuse_color", inShader)
- , m_CameraPosition("camera_position", inShader)
- , m_CameraDirection("camera_direction", inShader)
- , m_MaterialDiffuseLightAmbientTotal("light_ambient_total", inShader)
- , m_CameraProperties("camera_properties", inShader)
- , m_DepthTexture("depth_sampler", inShader)
- , m_AOTexture("ao_sampler", inShader)
- , m_LightProbe("light_probe", inShader)
- , m_LightProbeProps("light_probe_props", inShader)
- , m_LightProbeOpts("light_probe_opts", inShader)
- , m_LightProbeRot("light_probe_rotation", inShader)
- , m_LightProbeOfs("light_probe_offset", inShader)
- , m_LightProbeSize("light_probe_size", inShader)
- , m_LightProbe2("light_probe2", inShader)
- , m_LightProbe2Props("light_probe2_props", inShader)
- , m_LightProbe2Size("light_probe2_size", inShader)
- , m_AoShadowParams("cbAoShadow", inShader)
- , m_LightsBuffer("cbBufferLights", inShader)
- , m_lightConstantProperties(NULL)
- , m_Images(inContext.GetAllocator(), "SShaderGeneratorGeneratedShader::m_Images")
- , m_Lights(inContext.GetAllocator(), "SShaderGeneratorGeneratedShader::m_Lights")
- , m_ShadowMaps(inContext.GetAllocator(), "SShaderGeneratorGeneratedShader::m_ShadowMaps")
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
- ~SShaderGeneratorGeneratedShader()
- {
- if (m_lightConstantProperties)
- delete m_lightConstantProperties;
- m_Shader.release();
- }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Allocator);
- NVDelete(alloc, this);
- }
- }
-};
-
-
-#ifndef EA_PLATFORM_WINDOWS
-#define _snprintf snprintf
-#endif
-
-struct SShaderGenerator : public IDefaultMaterialShaderGenerator
-{
- typedef Qt3DSString TStrType;
- typedef nvhash_map<NVRenderShaderProgram *, NVScopedRefCounted<SShaderGeneratorGeneratedShader>>
- TProgramToShaderMap;
- typedef qt3ds::foundation::nvhash_map<CRegisteredString,
- NVScopedRefCounted<qt3ds::render::NVRenderConstantBuffer>>
- TStrConstanBufMap;
-
- IQt3DSRenderContext &m_RenderContext;
- IShaderProgramGenerator &m_ProgramGenerator;
-
- const SDefaultMaterial *m_CurrentMaterial;
- SShaderDefaultMaterialKey *m_CurrentKey;
- Qt3DSShadowMap *m_ShadowMapManager;
- IDefaultMaterialVertexPipeline *m_CurrentPipeline;
- TShaderFeatureSet m_CurrentFeatureSet;
- NVDataRef<SLight *> m_Lights;
- SRenderableImage *m_FirstImage;
- bool m_HasTransparency;
- bool m_LightsAsSeparateUniforms;
-
- TStrType m_ImageStem;
- TStrType m_ImageSampler;
- TStrType m_ImageOffsets;
- TStrType m_ImageRotations;
- TStrType m_ImageFragCoords;
- TStrType m_ImageTemp;
- TStrType m_ImageSamplerSize;
-
- TStrType m_TexCoordTemp;
-
- TStrType m_LightStem;
- TStrType m_LightColor;
- TStrType m_LightSpecularColor;
- TStrType m_LightAttenuation;
- TStrType m_LightConstantAttenuation;
- TStrType m_LightLinearAttenuation;
- TStrType m_LightQuadraticAttenuation;
- TStrType m_NormalizedDirection;
- TStrType m_LightDirection;
- TStrType m_LightPos;
- TStrType m_LightUp;
- TStrType m_LightRt;
- TStrType m_RelativeDistance;
- TStrType m_RelativeDirection;
-
- TStrType m_ShadowMapStem;
- TStrType m_ShadowCubeStem;
- TStrType m_ShadowMatrixStem;
- TStrType m_ShadowCoordStem;
- TStrType m_ShadowControlStem;
-
- TStrType m_TempStr;
-
- eastl::string m_GeneratedShaderString;
-
- SShaderDefaultMaterialKeyProperties m_DefaultMaterialShaderKeyProperties;
- TProgramToShaderMap m_ProgramToShaderMap;
-
- TStrConstanBufMap m_ConstantBuffers; ///< store all constants buffers
-
- QT3DSI32 m_RefCount;
-
- SShaderGenerator(IQt3DSRenderContext &inRc)
- : m_RenderContext(inRc)
- , m_ProgramGenerator(m_RenderContext.GetShaderProgramGenerator())
- , m_CurrentMaterial(NULL)
- , m_CurrentKey(NULL)
- , m_ShadowMapManager(NULL)
- , m_CurrentPipeline(NULL)
- , m_FirstImage(NULL)
- , m_LightsAsSeparateUniforms(false)
- , m_ProgramToShaderMap(inRc.GetAllocator(), "m_ProgramToShaderMap")
- , m_ConstantBuffers(inRc.GetAllocator(), "m_ConstantBuffers")
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- m_ConstantBuffers.clear();
- NVDelete(m_RenderContext.GetAllocator(), this);
- }
- }
- IShaderProgramGenerator &ProgramGenerator() { return m_ProgramGenerator; }
- IDefaultMaterialVertexPipeline &VertexGenerator() { return *m_CurrentPipeline; }
- IShaderStageGenerator &FragmentGenerator()
- {
- return *m_ProgramGenerator.GetStage(ShaderGeneratorStages::Fragment);
- }
- SShaderDefaultMaterialKey &Key() { return *m_CurrentKey; }
- const SDefaultMaterial &Material() { return *m_CurrentMaterial; }
- TShaderFeatureSet FeatureSet() { return m_CurrentFeatureSet; }
- bool HasTransparency() { return m_HasTransparency; }
-
- void addFunction(IShaderStageGenerator &generator, QString functionName)
- {
- generator.AddFunction(functionName);
- }
-
- void SetupImageVariableNames(size_t imageIdx)
- {
- m_ImageStem = "image";
- char buf[16];
- _snprintf(buf, 16, "%d", int(imageIdx));
- m_ImageStem.append(buf);
- m_ImageStem.append("_");
-
- m_ImageSampler = m_ImageStem;
- m_ImageSampler.append("sampler");
- m_ImageOffsets = m_ImageStem;
- m_ImageOffsets.append("offsets");
- m_ImageRotations = m_ImageStem;
- m_ImageRotations.append("rotations");
- m_ImageFragCoords = m_ImageStem;
- m_ImageFragCoords.append("uv_coords");
- m_ImageSamplerSize = m_ImageStem;
- m_ImageSamplerSize.append("size");
- }
-
- void SetupTexCoordVariableName(size_t uvSet)
- {
- m_TexCoordTemp = "varTexCoord";
- char buf[16];
- _snprintf(buf, 16, "%d", int(uvSet));
- m_TexCoordTemp.append(buf);
- }
-
- SImageVariableNames GetImageVariableNames(QT3DSU32 inIdx) override
- {
- SetupImageVariableNames(inIdx);
- SImageVariableNames retval;
- retval.m_ImageSampler = m_ImageSampler.c_str();
- retval.m_ImageFragCoords = m_ImageFragCoords.c_str();
- return retval;
- }
-
- void AddLocalVariable(IShaderStageGenerator &inGenerator, const char8_t *inName,
- const char8_t *inType)
- {
- inGenerator << "\t" << inType << " " << inName << ";" << Endl;
- }
-
- void AddLocalVariable(IShaderStageGenerator &inGenerator, const TStrType &inName,
- const char8_t *inType)
- {
- AddLocalVariable(inGenerator, inName.c_str(), inType);
- }
-
- void GenerateImageUVCoordinates(IShaderStageGenerator &inVertexPipeline, QT3DSU32 idx, QT3DSU32 uvSet,
- SRenderableImage &image) override
- {
- IDefaultMaterialVertexPipeline &vertexShader(
- static_cast<IDefaultMaterialVertexPipeline &>(inVertexPipeline));
- IShaderStageGenerator &fragmentShader(FragmentGenerator());
- SetupImageVariableNames(idx);
- SetupTexCoordVariableName(uvSet);
- fragmentShader.AddUniform(m_ImageSampler, "sampler2D");
- vertexShader.AddUniform(m_ImageOffsets, "vec3");
- fragmentShader.AddUniform(m_ImageOffsets, "vec3");
- vertexShader.AddUniform(m_ImageRotations, "vec4");
- fragmentShader.AddUniform(m_ImageRotations, "vec4");
-
- if (image.m_Image.m_MappingMode == ImageMappingModes::Normal) {
- vertexShader << "\tuTransform = vec3( " << m_ImageRotations << ".x, "
- << m_ImageRotations << ".y, " << m_ImageOffsets << ".x );" << Endl;
- vertexShader << "\tvTransform = vec3( " << m_ImageRotations << ".z, "
- << m_ImageRotations << ".w, " << m_ImageOffsets << ".y );" << Endl;
- vertexShader.AddOutgoing(m_ImageFragCoords, "vec2");
- addFunction(vertexShader, "getTransformedUVCoords");
- vertexShader.GenerateUVCoords(uvSet);
- m_ImageTemp = m_ImageFragCoords;
- m_ImageTemp.append("temp");
- vertexShader << "\tvec2 " << m_ImageTemp << " = getTransformedUVCoords( vec3( "
- << m_TexCoordTemp << ", 1.0), uTransform, vTransform );" << Endl;
- if (image.m_Image.m_TextureData.m_TextureFlags.IsInvertUVCoords())
- vertexShader << "\t" << m_ImageTemp << ".y = 1.0 - " << m_ImageFragCoords << ".y;"
- << Endl;
-
- vertexShader.AssignOutput(m_ImageFragCoords.c_str(), m_ImageTemp.c_str());
- } else {
- fragmentShader << "\tuTransform = vec3( " << m_ImageRotations << ".x, "
- << m_ImageRotations << ".y, " << m_ImageOffsets << ".x );" << Endl;
- fragmentShader << "\tvTransform = vec3( " << m_ImageRotations << ".z, "
- << m_ImageRotations << ".w, " << m_ImageOffsets << ".y );" << Endl;
- vertexShader.GenerateEnvMapReflection();
- addFunction(fragmentShader, "getTransformedUVCoords");
- fragmentShader << "\tvec2 " << m_ImageFragCoords
- << " = getTransformedUVCoords( environment_map_reflection, uTransform, "
- "vTransform );"
- << Endl;
- if (image.m_Image.m_TextureData.m_TextureFlags.IsInvertUVCoords())
- fragmentShader << "\t" << m_ImageFragCoords << ".y = 1.0 - " << m_ImageFragCoords
- << ".y;" << Endl;
- }
- }
-
- void GenerateImageUVCoordinates(QT3DSU32 idx, SRenderableImage &image, QT3DSU32 uvSet = 0)
- {
- GenerateImageUVCoordinates(VertexGenerator(), idx, uvSet, image);
- }
-
- void GenerateImageUVCoordinates(QT3DSU32 idx, SRenderableImage &image,
- IDefaultMaterialVertexPipeline &inShader)
- {
- if (image.m_Image.m_MappingMode == ImageMappingModes::Normal) {
- SetupImageVariableNames(idx);
- inShader.AddUniform(m_ImageSampler, "sampler2D");
- inShader.AddUniform(m_ImageOffsets, "vec3");
- inShader.AddUniform(m_ImageRotations, "vec4");
-
- inShader << "\tuTransform = vec3( " << m_ImageRotations << ".x, " << m_ImageRotations
- << ".y, " << m_ImageOffsets << ".x );" << Endl;
- inShader << "\tvTransform = vec3( " << m_ImageRotations << ".z, " << m_ImageRotations
- << ".w, " << m_ImageOffsets << ".y );" << Endl;
- inShader << "\tvec2 " << m_ImageFragCoords << ";" << Endl;
- addFunction(inShader, "getTransformedUVCoords");
- inShader.GenerateUVCoords();
- inShader
- << "\t" << m_ImageFragCoords
- << " = getTransformedUVCoords( vec3( varTexCoord0, 1.0), uTransform, vTransform );"
- << Endl;
- if (image.m_Image.m_TextureData.m_TextureFlags.IsInvertUVCoords())
- inShader << "\t" << m_ImageFragCoords << ".y = 1.0 - " << m_ImageFragCoords << ".y;"
- << Endl;
- }
- }
-
- void OutputSpecularEquation(DefaultMaterialSpecularModel::Enum inSpecularModel,
- IShaderStageGenerator &fragmentShader, const char *inLightDir,
- const char *inLightSpecColor)
- {
- switch (inSpecularModel) {
- case DefaultMaterialSpecularModel::KGGX: {
- fragmentShader.AddInclude("defaultMaterialPhysGlossyBSDF.glsllib");
- fragmentShader.AddUniform("material_specular", "vec4");
- fragmentShader << "\tglobal_specular_light.rgb += lightAttenuation * specularAmount * "
- "specularColor * kggxGlossyDefaultMtl( "
- << "world_normal, tangent, -" << inLightDir << ".xyz, view_vector, "
- << inLightSpecColor
- << ".rgb, vec3(material_specular.xyz), roughnessAmount, "
- "roughnessAmount ).rgb;"
- << Endl;
- } break;
- case DefaultMaterialSpecularModel::KWard: {
- fragmentShader.AddInclude("defaultMaterialPhysGlossyBSDF.glsllib");
- fragmentShader.AddUniform("material_specular", "vec4");
- fragmentShader << "\tglobal_specular_light.rgb += lightAttenuation * specularAmount * "
- "specularColor * wardGlossyDefaultMtl( "
- << "world_normal, tangent, -" << inLightDir << ".xyz, view_vector, "
- << inLightSpecColor
- << ".rgb, vec3(material_specular.xyz), roughnessAmount, "
- "roughnessAmount ).rgb;"
- << Endl;
- } break;
- default:
- addFunction(fragmentShader, "specularBSDF");
- fragmentShader << "\tglobal_specular_light.rgb += lightAttenuation * specularAmount * "
- "specularColor * specularBSDF( "
- << "world_normal, -" << inLightDir << ".xyz, view_vector, "
- << inLightSpecColor << ".rgb, 1.0, 2.56 / (roughnessAmount + "
- "0.01), vec3(1.0), scatter_reflect ).rgb;"
- << Endl;
- break;
- }
- }
-
- void OutputDiffuseAreaLighting(IShaderStageGenerator &infragmentShader, const char *inPos,
- TStrType inLightPrefix)
- {
- m_NormalizedDirection = inLightPrefix + "_areaDir";
- AddLocalVariable(infragmentShader, m_NormalizedDirection, "vec3");
- infragmentShader << "\tlightAttenuation = calculateDiffuseAreaOld( " << m_LightDirection
- << ".xyz, " << m_LightPos << ".xyz, " << m_LightUp << ", " << m_LightRt
- << ", " << inPos << ", " << m_NormalizedDirection << " );" << Endl;
- }
-
- void OutputSpecularAreaLighting(IShaderStageGenerator &infragmentShader, const char *inPos,
- const char *inView, const char *inLightSpecColor)
- {
- addFunction(infragmentShader, "sampleAreaGlossyDefault");
- infragmentShader.AddUniform("material_specular", "vec4");
- infragmentShader << "global_specular_light.rgb += " << inLightSpecColor
- << ".rgb * lightAttenuation * shadowFac * material_specular.rgb * "
- "specularAmount * sampleAreaGlossyDefault( tanFrame, "
- << inPos << ", " << m_NormalizedDirection << ", " << m_LightPos << ".xyz, "
- << m_LightRt << ".w, " << m_LightUp << ".w, " << inView
- << ", roughnessAmount, roughnessAmount ).rgb;" << Endl;
- }
-
- void AddTranslucencyIrradiance(IShaderStageGenerator &infragmentShader, SRenderableImage *image,
- TStrType inLightPrefix, bool areaLight)
- {
- if (image == NULL)
- return;
-
- addFunction(infragmentShader, "diffuseReflectionWrapBSDF");
- if (areaLight) {
- infragmentShader << "\tglobal_diffuse_light.rgb += lightAttenuation * "
- "translucent_thickness_exp * diffuseReflectionWrapBSDF( "
- "-world_normal, "
- << m_NormalizedDirection << ", " << m_LightColor
- << ".rgb, diffuseLightWrap ).rgb;" << Endl;
- } else {
- infragmentShader << "\tglobal_diffuse_light.rgb += lightAttenuation * "
- "translucent_thickness_exp * diffuseReflectionWrapBSDF( "
- "-world_normal, "
- << "-" << m_NormalizedDirection << ", " << m_LightColor
- << ".rgb, diffuseLightWrap ).rgb;" << Endl;
- }
- }
-
- void SetupShadowMapVariableNames(size_t lightIdx)
- {
- m_ShadowMapStem = "shadowmap";
- m_ShadowCubeStem = "shadowcube";
- char buf[16];
- _snprintf(buf, 16, "%d", int(lightIdx));
- m_ShadowMapStem.append(buf);
- m_ShadowCubeStem.append(buf);
- m_ShadowMatrixStem = m_ShadowMapStem;
- m_ShadowMatrixStem.append("_matrix");
- m_ShadowCoordStem = m_ShadowMapStem;
- m_ShadowCoordStem.append("_coord");
- m_ShadowControlStem = m_ShadowMapStem;
- m_ShadowControlStem.append("_control");
- }
-
- void AddShadowMapContribution(IShaderStageGenerator &inLightShader, QT3DSU32 lightIndex,
- RenderLightTypes::Enum inType)
- {
- SetupShadowMapVariableNames(lightIndex);
-
- inLightShader.AddInclude("shadowMapping.glsllib");
- if (inType == RenderLightTypes::Directional) {
- inLightShader.AddUniform(m_ShadowMapStem, "sampler2D");
- } else {
- inLightShader.AddUniform(m_ShadowCubeStem, "samplerCube");
- }
- inLightShader.AddUniform(m_ShadowControlStem, "vec4");
- inLightShader.AddUniform(m_ShadowMatrixStem, "mat4");
-
- /*
- if ( inType == RenderLightTypes::Area )
- {
- inLightShader << "vec2 " << m_ShadowCoordStem << ";" << Endl;
- inLightShader << "\tshadow_map_occl = sampleParaboloid( " << m_ShadowMapStem << ", "
- << m_ShadowControlStem << ", "
- <<
- m_ShadowMatrixStem << ", varWorldPos, vec2(1.0, " << m_ShadowControlStem << ".z), "
- << m_ShadowCoordStem
- << " );" << Endl;
- }
- else */
- if (inType != RenderLightTypes::Directional) {
- inLightShader << "\tshadow_map_occl = sampleCubemap( " << m_ShadowCubeStem << ", "
- << m_ShadowControlStem << ", " << m_ShadowMatrixStem << ", " << m_LightPos
- << ".xyz, varWorldPos, vec2(1.0, " << m_ShadowControlStem << ".z) );"
- << Endl;
- } else
- inLightShader << "\tshadow_map_occl = sampleOrthographic( " << m_ShadowMapStem << ", "
- << m_ShadowControlStem << ", " << m_ShadowMatrixStem
- << ", varWorldPos, vec2(1.0, " << m_ShadowControlStem << ".z) );" << Endl;
- }
-
- void AddDisplacementMappingForDepthPass(IShaderStageGenerator &inShader) override
- {
- inShader.AddIncoming("attr_uv0", "vec2");
- inShader.AddIncoming("attr_norm", "vec3");
- inShader.AddUniform("displacementSampler", "sampler2D");
- inShader.AddUniform("displaceAmount", "float");
- inShader.AddUniform("displacementMap_rot", "vec4");
- inShader.AddUniform("displacementMap_offset", "vec3");
- inShader.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
-
- inShader.Append("\tvec3 uTransform = vec3( displacementMap_rot.x, displacementMap_rot.y, "
- "displacementMap_offset.x );");
- inShader.Append("\tvec3 vTransform = vec3( displacementMap_rot.z, displacementMap_rot.w, "
- "displacementMap_offset.y );");
- addFunction(inShader, "getTransformedUVCoords");
- inShader.Append("\tvec2 uv_coords = attr_uv0;");
- inShader << "\tuv_coords = getTransformedUVCoords( vec3( uv_coords, 1.0), uTransform, "
- "vTransform );\n";
- inShader << "\tvec3 displacedPos = defaultMaterialFileDisplacementTexture( "
- "displacementSampler , displaceAmount, uv_coords , attr_norm, attr_pos );"
- << Endl;
- inShader.Append("\tgl_Position = model_view_projection * vec4(displacedPos, 1.0);");
- }
-
- void AddDisplacementImageUniforms(IShaderStageGenerator &inGenerator,
- QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) override
- {
- if (displacementImage) {
- SetupImageVariableNames(displacementImageIdx);
- inGenerator.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
- inGenerator.AddUniform("model_matrix", "mat4");
- inGenerator.AddUniform("camera_position", "vec3");
- inGenerator.AddUniform("displaceAmount", "float");
- inGenerator.AddUniform(m_ImageSampler, "sampler2D");
- }
- }
-
- bool MaybeAddMaterialFresnel(IShaderStageGenerator &fragmentShader, NVConstDataRef<QT3DSU32> inKey,
- bool inFragmentHasSpecularAmount)
- {
- if (m_DefaultMaterialShaderKeyProperties.m_FresnelEnabled.GetValue(inKey)) {
- if (inFragmentHasSpecularAmount == false)
- fragmentShader << "\tfloat specularAmount = 1.0;" << Endl;
- inFragmentHasSpecularAmount = true;
- fragmentShader.AddInclude("defaultMaterialFresnel.glsllib");
- fragmentShader.AddUniform("fresnelPower", "float");
- fragmentShader.AddUniform("material_specular", "vec4");
- fragmentShader << "\tfloat fresnelRatio = defaultMaterialSimpleFresnel( world_normal, "
- "view_vector, material_specular.w, fresnelPower );"
- << Endl;
- fragmentShader << "\tspecularAmount *= fresnelRatio;" << Endl;
- }
- return inFragmentHasSpecularAmount;
- }
- void SetupLightVariableNames(size_t lightIdx, SLight &inLight)
- {
- if (m_LightsAsSeparateUniforms) {
- char buf[16];
- _snprintf(buf, 16, "light_%d", int(lightIdx));
- m_LightStem = buf;
- m_LightColor = m_LightStem;
- m_LightColor.append("_diffuse");
- m_LightDirection = m_LightStem;
- m_LightDirection.append("_direction");
- m_LightSpecularColor = m_LightStem;
- m_LightSpecularColor.append("_specular");
- if (inLight.m_LightType == RenderLightTypes::Point) {
- m_LightPos = m_LightStem;
- m_LightPos.append("_position");
- m_LightAttenuation = m_LightStem;
- m_LightAttenuation.append("_attenuation");
- } else if (inLight.m_LightType == RenderLightTypes::Area) {
- m_LightPos = m_LightStem;
- m_LightPos.append("_position");
- m_LightUp = m_LightStem;
- m_LightUp.append("_up");
- m_LightRt = m_LightStem;
- m_LightRt.append("_right");
- }
- } else {
- m_LightStem = "lights";
- char buf[16];
- _snprintf(buf, 16, "[%d].", int(lightIdx));
- m_LightStem.append(buf);
-
- m_LightColor = m_LightStem;
- m_LightColor.append("diffuse");
- m_LightDirection = m_LightStem;
- m_LightDirection.append("direction");
- m_LightSpecularColor = m_LightStem;
- m_LightSpecularColor.append("specular");
- if (inLight.m_LightType == RenderLightTypes::Point) {
- m_LightPos = m_LightStem;
- m_LightPos.append("position");
- m_LightConstantAttenuation = m_LightStem;
- m_LightConstantAttenuation.append("constantAttenuation");
- m_LightLinearAttenuation = m_LightStem;
- m_LightLinearAttenuation.append("linearAttenuation");
- m_LightQuadraticAttenuation = m_LightStem;
- m_LightQuadraticAttenuation.append("quadraticAttenuation");
- } else if (inLight.m_LightType == RenderLightTypes::Area) {
- m_LightPos = m_LightStem;
- m_LightPos.append("position");
- m_LightUp = m_LightStem;
- m_LightUp.append("up");
- m_LightRt = m_LightStem;
- m_LightRt.append("right");
- }
- }
- }
-
- void addDisplacementMapping(IDefaultMaterialVertexPipeline &inShader)
- {
- inShader.AddIncoming("attr_uv0", "vec2");
- inShader.AddIncoming("attr_norm", "vec3");
- inShader.AddUniform("displacementSampler", "sampler2D");
- inShader.AddUniform("displaceAmount", "float");
- inShader.AddUniform("displacementMap_rot", "vec4");
- inShader.AddUniform("displacementMap_offset", "vec3");
- inShader.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
-
- inShader.Append("\tvec3 uTransform = vec3( displacementMap_rot.x, displacementMap_rot.y, "
- "displacementMap_offset.x );");
- inShader.Append("\tvec3 vTransform = vec3( displacementMap_rot.z, displacementMap_rot.w, "
- "displacementMap_offset.y );");
- addFunction(inShader, "getTransformedUVCoords");
- inShader.GenerateUVCoords();
- inShader << "\tvarTexCoord0 = getTransformedUVCoords( vec3( varTexCoord0, 1.0), "
- "uTransform, vTransform );\n";
- inShader << "\tvec3 displacedPos = defaultMaterialFileDisplacementTexture( "
- "displacementSampler , displaceAmount, varTexCoord0 , attr_norm, attr_pos );"
- << Endl;
- inShader.Append("\tgl_Position = model_view_projection * vec4(displacedPos, 1.0);");
- }
-
- void GenerateTextureSwizzle(NVRenderTextureSwizzleMode::Enum swizzleMode,
- eastl::basic_string<char8_t> &texSwizzle,
- eastl::basic_string<char8_t> &lookupSwizzle)
- {
- qt3ds::render::NVRenderContextType deprecatedContextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
-
- if (!(m_RenderContext.GetRenderContext().GetRenderContextType() & deprecatedContextFlags)) {
- switch (swizzleMode) {
- case NVRenderTextureSwizzleMode::L8toR8:
- case NVRenderTextureSwizzleMode::L16toR16:
- texSwizzle.append(".rgb");
- lookupSwizzle.append(".rrr");
- break;
- case NVRenderTextureSwizzleMode::L8A8toRG8:
- texSwizzle.append(".rgba");
- lookupSwizzle.append(".rrrg");
- break;
- case NVRenderTextureSwizzleMode::A8toR8:
- texSwizzle.append(".a");
- lookupSwizzle.append(".r");
- break;
- default:
- break;
- }
- }
- }
-
- ///< get the light constant buffer and generate if necessary
- NVRenderConstantBuffer *GetLightConstantBuffer(QT3DSU32 inLightCount)
- {
- NVRenderContext &theContext(m_RenderContext.GetRenderContext());
-
- // we assume constant buffer support
- QT3DS_ASSERT(theContext.GetConstantBufferSupport());
-
- // we only create if if we have lights
- if (!inLightCount || !theContext.GetConstantBufferSupport())
- return NULL;
-
- CRegisteredString theName = theContext.GetStringTable().RegisterStr("cbBufferLights");
- NVRenderConstantBuffer *pCB = theContext.GetConstantBuffer(theName);
-
- if (!pCB) {
- // create
- SLightSourceShader s[QT3DS_MAX_NUM_LIGHTS];
- NVDataRef<QT3DSU8> cBuffer((QT3DSU8 *)&s, (sizeof(SLightSourceShader) * QT3DS_MAX_NUM_LIGHTS)
- + (4 * sizeof(QT3DSI32)));
- pCB = theContext.CreateConstantBuffer(
- theName, qt3ds::render::NVRenderBufferUsageType::Static,
- (sizeof(SLightSourceShader) * QT3DS_MAX_NUM_LIGHTS) + (4 * sizeof(QT3DSI32)), cBuffer);
- if (!pCB) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- // init first set
- memset(&s[0], 0x0, sizeof(SLightSourceShader));
- QT3DSI32 cgLights = 0;
- pCB->UpdateRaw(0, NVDataRef<QT3DSU8>((QT3DSU8 *)&cgLights, sizeof(QT3DSI32)));
- pCB->UpdateRaw(4 * sizeof(QT3DSI32),
- NVDataRef<QT3DSU8>((QT3DSU8 *)&s[0], sizeof(SLightSourceShader)));
- pCB->Update(); // update to hardware
-
- m_ConstantBuffers.insert(eastl::make_pair(theName, pCB));
- }
-
- return pCB;
- }
-
- void SetImageShaderVariables(SShaderGeneratorGeneratedShader &inShader,
- SRenderableImage &inImage, QT3DSU32 idx)
- {
- size_t numImageVariables = inShader.m_Images.size();
- for (size_t namesIdx = numImageVariables; namesIdx <= idx; ++namesIdx) {
- SetupImageVariableNames(idx);
- inShader.m_Images.push_back(
- SShaderTextureProperties(m_ImageSampler.c_str(), m_ImageOffsets.c_str(),
- m_ImageRotations.c_str(), m_ImageSamplerSize.c_str(),
- inShader.m_Shader));
- }
- SShaderTextureProperties &theShaderProps = inShader.m_Images[idx];
- const QT3DSMat44 &textureTransform = inImage.m_Image.m_TextureTransform;
- // We separate rotational information from offset information so that just maybe the shader
- // will attempt to push less information to the card.
- const QT3DSF32 *dataPtr(textureTransform.front());
- // The third member of the offsets contains a flag indicating if the texture was
- // premultiplied or not.
- // We use this to mix the texture alpha.
- QT3DSVec3 offsets(dataPtr[12], dataPtr[13],
- inImage.m_Image.m_TextureData.m_TextureFlags.IsPreMultiplied() ? 1.0f
- : 0.0f);
- // Grab just the upper 2x2 rotation matrix from the larger matrix.
- QT3DSVec4 rotations(dataPtr[0], dataPtr[4], dataPtr[1], dataPtr[5]);
-
- // The image horizontal and vertical tiling modes need to be set here, before we set texture
- // on the shader.
- // because setting the image on the texture forces the textue to bind and immediately apply
- // any tex params.
- NVRenderTexture2D *imageTexture = inImage.m_Image.m_TextureData.m_Texture;
- inImage.m_Image.m_TextureData.m_Texture->SetTextureWrapS(
- inImage.m_Image.m_HorizontalTilingMode);
- inImage.m_Image.m_TextureData.m_Texture->SetTextureWrapT(
- inImage.m_Image.m_VerticalTilingMode);
- theShaderProps.m_Sampler.Set(imageTexture);
- theShaderProps.m_Offsets.Set(offsets);
- theShaderProps.m_Rotations.Set(rotations);
- theShaderProps.m_Size.Set(QT3DSVec2(imageTexture->GetTextureDetails().m_Width,
- imageTexture->GetTextureDetails().m_Height));
- }
-
- void GenerateShadowMapOcclusion(QT3DSU32 lightIdx, bool inShadowEnabled,
- RenderLightTypes::Enum inType)
- {
- if (inShadowEnabled) {
- VertexGenerator().GenerateWorldPosition();
- AddShadowMapContribution(FragmentGenerator(), lightIdx, inType);
- /*
- VertexGenerator().AddUniform( m_ShadowMatrixStem, "mat4" );
- VertexGenerator().AddOutgoing( m_ShadowCoordStem, "vec4" );
- VertexGenerator() << "\tvec4 local_" << m_ShadowCoordStem << " = " << m_ShadowMatrixStem
- << " * vec4(local_model_world_position, 1.0);" << Endl;
- m_TempStr.assign( "local_" );
- m_TempStr.append( m_ShadowCoordStem );
- VertexGenerator().AssignOutput( m_ShadowCoordStem.c_str(), m_TempStr.c_str() );
- */
- } else {
- FragmentGenerator() << "\tshadow_map_occl = 1.0;" << Endl;
- }
- }
-
- void GenerateVertexShader()
- {
- // vertex displacement
- QT3DSU32 imageIdx = 0;
- SRenderableImage *displacementImage = NULL;
- QT3DSU32 displacementImageIdx = 0;
-
- for (SRenderableImage *img = m_FirstImage; img != NULL;
- img = img->m_NextImage, ++imageIdx) {
- if (img->m_MapType == ImageMapTypes::Displacement) {
- displacementImage = img;
- displacementImageIdx = imageIdx;
- break;
- }
- }
-
- // the pipeline opens/closes up the shaders stages
- VertexGenerator().BeginVertexGeneration(displacementImageIdx, displacementImage);
- }
-
- void GenerateFragmentShader(SShaderDefaultMaterialKey &inKey)
- {
- bool specularEnabled = Material().IsSpecularEnabled();
- bool vertexColorsEnabled = Material().IsVertexColorsEnabled();
-
- bool hasLighting = Material().HasLighting();
- bool hasImage = m_FirstImage != NULL;
-
- bool hasIblProbe = m_DefaultMaterialShaderKeyProperties.m_HasIbl.GetValue(inKey);
- bool hasSpecMap = false;
- bool hasEnvMap = false;
- bool hasEmissiveMap = false;
- bool hasLightmaps = false;
- // Pull the bump out as
- SRenderableImage *bumpImage = NULL;
- QT3DSU32 imageIdx = 0;
- QT3DSU32 bumpImageIdx = 0;
- SRenderableImage *specularAmountImage = NULL;
- QT3DSU32 specularAmountImageIdx = 0;
- SRenderableImage *roughnessImage = NULL;
- QT3DSU32 roughnessImageIdx = 0;
- // normal mapping
- SRenderableImage *normalImage = NULL;
- QT3DSU32 normalImageIdx = 0;
- // translucency map
- SRenderableImage *translucencyImage = NULL;
- QT3DSU32 translucencyImageIdx = 0;
- // lightmaps
- SRenderableImage *lightmapIndirectImage = NULL;
- QT3DSU32 lightmapIndirectImageIdx = 0;
- SRenderableImage *lightmapRadiosityImage = NULL;
- QT3DSU32 lightmapRadiosityImageIdx = 0;
- SRenderableImage *lightmapShadowImage = NULL;
- QT3DSU32 lightmapShadowImageIdx = 0;
- const bool supportStandardDerivatives
- = m_RenderContext.GetRenderContext().IsStandardDerivativesSupported();
-
- for (SRenderableImage *img = m_FirstImage; img != NULL;
- img = img->m_NextImage, ++imageIdx) {
- hasSpecMap = img->m_MapType == ImageMapTypes::Specular;
- if (img->m_MapType == ImageMapTypes::Bump) {
- bumpImage = img;
- bumpImageIdx = imageIdx;
- } else if (img->m_MapType == ImageMapTypes::SpecularAmountMap) {
- specularAmountImage = img;
- specularAmountImageIdx = imageIdx;
- } else if (img->m_MapType == ImageMapTypes::Roughness) {
- roughnessImage = img;
- roughnessImageIdx = imageIdx;
- } else if (img->m_MapType == ImageMapTypes::Normal) {
- normalImage = img;
- normalImageIdx = imageIdx;
- } else if (img->m_Image.m_MappingMode == ImageMappingModes::Environment) {
- hasEnvMap = true;
- } else if (img->m_MapType == ImageMapTypes::Translucency) {
- translucencyImage = img;
- translucencyImageIdx = imageIdx;
- } else if (img->m_MapType == ImageMapTypes::Emissive) {
- hasEmissiveMap = true;
- } else if (img->m_MapType == ImageMapTypes::LightmapIndirect) {
- lightmapIndirectImage = img;
- lightmapIndirectImageIdx = imageIdx;
- hasLightmaps = true;
- } else if (img->m_MapType == ImageMapTypes::LightmapRadiosity) {
- lightmapRadiosityImage = img;
- lightmapRadiosityImageIdx = imageIdx;
- hasLightmaps = true;
- } else if (img->m_MapType == ImageMapTypes::LightmapShadow) {
- lightmapShadowImage = img;
- lightmapShadowImageIdx = imageIdx;
- hasLightmaps = true;
- }
- }
-
- bool enableFresnel = m_DefaultMaterialShaderKeyProperties.m_FresnelEnabled.GetValue(inKey);
- bool enableSSAO = false;
- bool enableSSDO = false;
- bool enableShadowMaps = false;
- bool enableBumpNormal = normalImage || bumpImage;
-
- for (QT3DSU32 idx = 0; idx < FeatureSet().size(); ++idx) {
- eastl::string name(FeatureSet()[idx].m_Name.c_str());
- if (name == "QT3DS_ENABLE_SSAO")
- enableSSAO = FeatureSet()[idx].m_Enabled;
- else if (name == "QT3DS_ENABLE_SSDO")
- enableSSDO = FeatureSet()[idx].m_Enabled;
- else if (name == "QT3DS_ENABLE_SSM")
- enableShadowMaps = FeatureSet()[idx].m_Enabled;
- }
-
- bool includeSSAOSSDOVars = enableSSAO || enableSSDO || enableShadowMaps;
-
- VertexGenerator().BeginFragmentGeneration();
- IShaderStageGenerator &fragmentShader(FragmentGenerator());
- IDefaultMaterialVertexPipeline &vertexShader(VertexGenerator());
-
- // The fragment or vertex shaders may not use the material_properties or diffuse
- // uniforms in all cases but it is simpler to just add them and let the linker strip them.
- fragmentShader.AddUniform("material_diffuse", "vec4");
- fragmentShader.AddUniform("diffuse_color", "vec3");
- fragmentShader.AddUniform("material_properties", "vec4");
-
- // All these are needed for SSAO
- if (includeSSAOSSDOVars) {
- fragmentShader.AddInclude("SSAOCustomMaterial.glsllib");
- // fragmentShader.AddUniform( "ao_sampler", "sampler2D" );
- }
-
- if (hasIblProbe && hasLighting) {
- fragmentShader.AddInclude("sampleProbe.glsllib");
- }
-
- if (hasLighting) {
- if (!m_LightsAsSeparateUniforms)
- addFunction(fragmentShader, "sampleLightVars");
- addFunction(fragmentShader, "diffuseReflectionBSDF");
- }
-
- if (hasLighting && hasLightmaps) {
- fragmentShader.AddInclude("evalLightmaps.glsllib");
- }
-
- // view_vector, varWorldPos, world_normal are all used if there is a specular map
- // in addition to if there is specular lighting. So they are lifted up here, always
- // generated.
- // we rely on the linker to strip out what isn't necessary instead of explicitly stripping
- // it for code simplicity.
- if (hasImage) {
- fragmentShader.Append("\tvec3 uTransform;");
- fragmentShader.Append("\tvec3 vTransform;");
- }
-
- if (includeSSAOSSDOVars || hasSpecMap || hasLighting || hasEnvMap || enableFresnel
- || hasIblProbe || enableBumpNormal) {
- vertexShader.GenerateViewVector();
- vertexShader.GenerateWorldNormal();
- vertexShader.GenerateWorldPosition();
- }
- if (includeSSAOSSDOVars || specularEnabled || hasIblProbe || enableBumpNormal)
- vertexShader.GenerateVarTangentAndBinormal();
-
- if (vertexColorsEnabled)
- vertexShader.GenerateVertexColor();
- else
- fragmentShader.Append("\tvec3 vertColor = vec3(1.0);");
-
- // You do bump or normal mapping but not both
- if (bumpImage != NULL) {
- GenerateImageUVCoordinates(bumpImageIdx, *bumpImage);
- fragmentShader.AddUniform("bumpAmount", "float");
-
- fragmentShader.AddUniform(m_ImageSamplerSize, "vec2");
- fragmentShader.AddInclude("defaultMaterialBumpNoLod.glsllib");
- fragmentShader << "\tworld_normal = defaultMaterialBumpNoLod( " << m_ImageSampler
- << ", bumpAmount, " << m_ImageFragCoords
- << ", tangent, binormal, world_normal, "
- << m_ImageSamplerSize << ");" << Endl;
- // Do gram schmidt
- fragmentShader << "\tbinormal = normalize(cross(world_normal, tangent) );\n";
- fragmentShader << "\ttangent = normalize(cross(binormal, world_normal) );\n";
-
- } else if (normalImage != NULL) {
- GenerateImageUVCoordinates(normalImageIdx, *normalImage);
-
- fragmentShader.AddInclude("defaultMaterialFileNormalTexture.glsllib");
- fragmentShader.AddUniform("bumpAmount", "float");
-
- fragmentShader << "\tworld_normal = defaultMaterialFileNormalTexture( "
- << m_ImageSampler << ", bumpAmount, " << m_ImageFragCoords
- << ", tangent, binormal );" << Endl;
- }
-
- if (includeSSAOSSDOVars || specularEnabled || hasIblProbe || enableBumpNormal)
- fragmentShader << "\tmat3 tanFrame = mat3(tangent, binormal, world_normal);" << Endl;
-
- bool fragmentHasSpecularAmount = false;
-
- if (hasEmissiveMap) {
- fragmentShader.Append("\tvec3 global_emission = material_diffuse.rgb;");
- }
-
- if (hasLighting) {
- fragmentShader.AddUniform("light_ambient_total", "vec3");
-
- fragmentShader.Append(
- "\tvec4 global_diffuse_light = vec4(light_ambient_total.xyz, 1.0);");
- fragmentShader.Append("\tvec3 global_specular_light = vec3(0.0, 0.0, 0.0);");
- fragmentShader.Append("\tfloat shadow_map_occl = 1.0;");
-
- if (specularEnabled) {
- vertexShader.GenerateViewVector();
- fragmentShader.AddUniform("material_properties", "vec4");
- }
-
- if (lightmapIndirectImage != NULL) {
- GenerateImageUVCoordinates(lightmapIndirectImageIdx, *lightmapIndirectImage, 1);
- fragmentShader << "\tvec4 indirect_light = texture2D( " << m_ImageSampler << ", "
- << m_ImageFragCoords << ");" << Endl;
- fragmentShader << "\tglobal_diffuse_light += indirect_light;" << Endl;
- if (specularEnabled) {
- fragmentShader
- << "\tglobal_specular_light += indirect_light.rgb * material_properties.x;"
- << Endl;
- }
- }
-
- if (lightmapRadiosityImage != NULL) {
- GenerateImageUVCoordinates(lightmapRadiosityImageIdx, *lightmapRadiosityImage, 1);
- fragmentShader << "\tvec4 direct_light = texture2D( " << m_ImageSampler << ", "
- << m_ImageFragCoords << ");" << Endl;
- fragmentShader << "\tglobal_diffuse_light += direct_light;" << Endl;
- if (specularEnabled) {
- fragmentShader
- << "\tglobal_specular_light += direct_light.rgb * material_properties.x;"
- << Endl;
- }
- }
-
- if (translucencyImage != NULL) {
- fragmentShader.AddUniform("translucentFalloff", "float");
- fragmentShader.AddUniform("diffuseLightWrap", "float");
-
- GenerateImageUVCoordinates(translucencyImageIdx, *translucencyImage);
-
- fragmentShader << "\tvec4 translucent_depth_range = texture2D( " << m_ImageSampler
- << ", " << m_ImageFragCoords << ");" << Endl;
- fragmentShader << "\tfloat translucent_thickness = translucent_depth_range.r * "
- "translucent_depth_range.r;"
- << Endl;
- fragmentShader << "\tfloat translucent_thickness_exp = exp( translucent_thickness "
- "* translucentFalloff);"
- << Endl;
- }
-
- fragmentShader.Append("\tfloat lightAttenuation = 1.0;");
-
- AddLocalVariable(fragmentShader, "aoFactor", "float");
-
- if (hasLighting && enableSSAO)
- fragmentShader.Append("\taoFactor = customMaterialAO();");
- else
- fragmentShader.Append("\taoFactor = 1.0;");
-
- AddLocalVariable(fragmentShader, "shadowFac", "float");
-
- if (specularEnabled) {
- fragmentShader << "\tfloat specularAmount = material_properties.x;" << Endl;
- fragmentHasSpecularAmount = true;
- }
- // Fragment lighting means we can perhaps attenuate the specular amount by a texture
- // lookup.
-
- fragmentShader << "\tvec3 specularColor = vec3(1.0);" << Endl;
- if (specularAmountImage) {
- if (!specularEnabled)
- fragmentShader << "\tfloat specularAmount = 1.0;" << Endl;
- GenerateImageUVCoordinates(specularAmountImageIdx, *specularAmountImage);
- fragmentShader << "\tspecularColor = texture2D( "
- << m_ImageSampler << ", " << m_ImageFragCoords << " ).xyz;" << Endl;
- fragmentHasSpecularAmount = true;
- }
-
- fragmentShader << "\tfloat roughnessAmount = material_properties.y;" << Endl;
- if (roughnessImage) {
- GenerateImageUVCoordinates(roughnessImageIdx, *roughnessImage);
- fragmentShader << "\tfloat sampledRoughness = texture2D( "
- << m_ImageSampler << ", " << m_ImageFragCoords << " ).x;" << Endl;
- //The roughness sampled from roughness textures is Disney roughness
- //which has to be squared to get the proper value
- fragmentShader << "\troughnessAmount = roughnessAmount * "
- << "sampledRoughness * sampledRoughness;" << Endl;
- }
-
- fragmentHasSpecularAmount =
- MaybeAddMaterialFresnel(fragmentShader, inKey, fragmentHasSpecularAmount);
-
- // Iterate through all lights
- for (QT3DSU32 lightIdx = 0; lightIdx < m_Lights.size(); ++lightIdx) {
- SLight *lightNode = m_Lights[lightIdx];
- SetupLightVariableNames(lightIdx, *lightNode);
- bool isDirectional = lightNode->m_LightType == RenderLightTypes::Directional;
- bool isArea = lightNode->m_LightType == RenderLightTypes::Area;
- bool isShadow = enableShadowMaps && lightNode->m_CastShadow;
-
- fragmentShader.Append("");
- char buf[10];
- sprintf(buf, "%d", lightIdx);
-
- m_TempStr.assign("light");
- m_TempStr.append(buf);
-
- fragmentShader << "\t//Light " << buf << Endl;
- fragmentShader << "\tlightAttenuation = 1.0;" << Endl;
- if (isDirectional) {
-
- if (m_LightsAsSeparateUniforms) {
- fragmentShader.AddUniform(m_LightDirection, "vec4");
- fragmentShader.AddUniform(m_LightColor, "vec4");
- }
-
- if (enableSSDO) {
- fragmentShader << "\tshadowFac = customMaterialShadow( " << m_LightDirection
- << ".xyz, varWorldPos );" << Endl;
- } else {
- fragmentShader << "\tshadowFac = 1.0;" << Endl;
- }
-
- GenerateShadowMapOcclusion(lightIdx, enableShadowMaps && isShadow,
- lightNode->m_LightType);
-
- if (specularEnabled && enableShadowMaps && isShadow)
- fragmentShader << "\tlightAttenuation *= shadow_map_occl;" << Endl;
-
- fragmentShader << "\tglobal_diffuse_light.rgb += shadowFac * shadow_map_occl * "
- "diffuseReflectionBSDF( world_normal, "
- << "-" << m_LightDirection << ".xyz, view_vector, "
- << m_LightColor << ".rgb, 0.0 ).rgb;" << Endl;
-
- if (specularEnabled) {
- if (m_LightsAsSeparateUniforms)
- fragmentShader.AddUniform(m_LightSpecularColor, "vec4");
- OutputSpecularEquation(Material().m_SpecularModel, fragmentShader,
- m_LightDirection.c_str(),
- m_LightSpecularColor.c_str());
- }
- } else if (isArea) {
- if (m_LightsAsSeparateUniforms) {
- fragmentShader.AddUniform(m_LightColor, "vec4");
- fragmentShader.AddUniform(m_LightPos, "vec4");
- fragmentShader.AddUniform(m_LightDirection, "vec4");
- fragmentShader.AddUniform(m_LightUp, "vec4");
- fragmentShader.AddUniform(m_LightRt, "vec4");
- } else {
- addFunction(fragmentShader, "areaLightVars");
- }
- addFunction(fragmentShader, "calculateDiffuseAreaOld");
- vertexShader.GenerateWorldPosition();
- GenerateShadowMapOcclusion(lightIdx, enableShadowMaps && isShadow,
- lightNode->m_LightType);
-
- // Debug measure to make sure paraboloid sampling was projecting to the right
- // location
- // fragmentShader << "\tglobal_diffuse_light.rg += " << m_ShadowCoordStem << ";"
- // << Endl;
- m_NormalizedDirection = m_TempStr;
- m_NormalizedDirection.append("_Frame");
-
- AddLocalVariable(fragmentShader, m_NormalizedDirection, "mat3");
- fragmentShader << m_NormalizedDirection << " = mat3( " << m_LightRt << ".xyz, "
- << m_LightUp << ".xyz, -" << m_LightDirection << ".xyz );"
- << Endl;
-
- if (enableSSDO) {
- fragmentShader << "\tshadowFac = shadow_map_occl * customMaterialShadow( "
- << m_LightDirection << ".xyz, varWorldPos );" << Endl;
- } else {
- fragmentShader << "\tshadowFac = shadow_map_occl;" << Endl;
- }
-
- if (specularEnabled) {
- vertexShader.GenerateViewVector();
- if (m_LightsAsSeparateUniforms)
- fragmentShader.AddUniform(m_LightSpecularColor, "vec4");
- OutputSpecularAreaLighting(fragmentShader, "varWorldPos", "view_vector",
- m_LightSpecularColor.c_str());
- }
-
- OutputDiffuseAreaLighting(fragmentShader, "varWorldPos", m_TempStr);
- fragmentShader << "\tlightAttenuation *= shadowFac;" << Endl;
-
- AddTranslucencyIrradiance(fragmentShader, translucencyImage, m_TempStr, true);
-
- fragmentShader << "\tglobal_diffuse_light.rgb += lightAttenuation * "
- "diffuseReflectionBSDF( world_normal, "
- << m_NormalizedDirection << ", view_vector, " << m_LightColor
- << ".rgb, 0.0 ).rgb;" << Endl;
- } else {
-
- vertexShader.GenerateWorldPosition();
- GenerateShadowMapOcclusion(lightIdx, enableShadowMaps && isShadow,
- lightNode->m_LightType);
-
- if (m_LightsAsSeparateUniforms) {
- fragmentShader.AddUniform(m_LightColor, "vec4");
- fragmentShader.AddUniform(m_LightPos, "vec4");
- }
-
- m_RelativeDirection = m_TempStr;
- m_RelativeDirection.append("_relativeDirection");
-
- m_NormalizedDirection = m_RelativeDirection;
- m_NormalizedDirection.append("_normalized");
-
- m_RelativeDistance = m_TempStr;
- m_RelativeDistance.append("_distance");
-
- fragmentShader << "\tvec3 " << m_RelativeDirection << " = varWorldPos - "
- << m_LightPos << ".xyz;" << Endl;
- fragmentShader << "\tfloat " << m_RelativeDistance << " = length( "
- << m_RelativeDirection << " );" << Endl;
- fragmentShader << "\tvec3 " << m_NormalizedDirection << " = "
- << m_RelativeDirection << " / " << m_RelativeDistance << ";"
- << Endl;
-
- if (enableSSDO) {
- fragmentShader << "\tshadowFac = shadow_map_occl * customMaterialShadow( "
- << m_NormalizedDirection << ", varWorldPos );" << Endl;
- } else {
- fragmentShader << "\tshadowFac = shadow_map_occl;" << Endl;
- }
-
- addFunction(fragmentShader, "calculatePointLightAttenuation");
-
- if (m_LightsAsSeparateUniforms) {
- fragmentShader.AddUniform(m_LightAttenuation, "vec3");
- fragmentShader
- << "\tlightAttenuation = shadowFac * calculatePointLightAttenuation("
- << "vec3( " << m_LightAttenuation << ".x, " << m_LightAttenuation
- << ".y, " << m_LightAttenuation << ".z), " << m_RelativeDistance
- << ");" << Endl;
- } else {
- fragmentShader
- << "\tlightAttenuation = shadowFac * calculatePointLightAttenuation("
- << "vec3( " << m_LightConstantAttenuation << ", "
- << m_LightLinearAttenuation << ", " << m_LightQuadraticAttenuation
- << "), " << m_RelativeDistance << ");"
- << Endl;
- }
-
-
-
- AddTranslucencyIrradiance(fragmentShader, translucencyImage, m_TempStr, false);
-
- fragmentShader << "\tglobal_diffuse_light.rgb += lightAttenuation * "
- "diffuseReflectionBSDF( world_normal, "
- << "-" << m_NormalizedDirection << ", view_vector, "
- << m_LightColor << ".rgb, 0.0 ).rgb;" << Endl;
-
- if (specularEnabled) {
- if (m_LightsAsSeparateUniforms)
- fragmentShader.AddUniform(m_LightSpecularColor, "vec4");
- OutputSpecularEquation(Material().m_SpecularModel, fragmentShader,
- m_NormalizedDirection.c_str(),
- m_LightSpecularColor.c_str());
- }
- }
- }
-
- // This may be confusing but the light colors are already modulated by the base
- // material color.
- // Thus material color is the base material color * material emissive.
- // Except material_color.a *is* the actual opacity factor.
- // Furthermore object_opacity is something that may come from the vertex pipeline or
- // somewhere else.
- // We leave it up to the vertex pipeline to figure it out.
- fragmentShader << "\tglobal_diffuse_light = vec4(global_diffuse_light.xyz * aoFactor, "
- "object_opacity);"
- << Endl << "\tglobal_specular_light = vec3(global_specular_light.xyz);"
- << Endl;
- } else // no lighting.
- {
- fragmentShader << "\tvec4 global_diffuse_light = vec4(0.0, 0.0, 0.0, object_opacity);"
- << Endl << "\tvec3 global_specular_light = vec3(0.0, 0.0, 0.0);" << Endl;
-
- // We still have specular maps and such that could potentially use the fresnel variable.
- fragmentHasSpecularAmount =
- MaybeAddMaterialFresnel(fragmentShader, inKey, fragmentHasSpecularAmount);
- }
-
- if (!hasEmissiveMap)
- fragmentShader
- << "\tglobal_diffuse_light.rgb += diffuse_color.rgb * material_diffuse.rgb;"
- << Endl;
-
- // since we already modulate our material diffuse color
- // into the light color we will miss it entirely if no IBL
- // or light is used
- if (hasLightmaps && !(m_Lights.size() || hasIblProbe))
- fragmentShader << "\tglobal_diffuse_light.rgb *= diffuse_color.rgb;" << Endl;
-
- if (hasLighting && hasIblProbe) {
- vertexShader.GenerateWorldNormal();
-
- fragmentShader << "\tglobal_diffuse_light.rgb += diffuse_color.rgb * aoFactor * "
- "sampleDiffuse( tanFrame ).xyz;"
- << Endl;
-
- if (specularEnabled) {
-
- fragmentShader.AddUniform("material_specular", "vec4");
-
- fragmentShader << "\tglobal_specular_light.xyz += specularAmount * specularColor * "
- "vec3(material_specular.xyz) * sampleGlossy( tanFrame, "
- "view_vector, roughnessAmount ).xyz;"
- << Endl;
- }
- }
-
- if (hasImage) {
- fragmentShader.Append("\tvec4 texture_color;");
- QT3DSU32 idx = 0;
- for (SRenderableImage *image = m_FirstImage; image; image = image->m_NextImage, ++idx) {
- // Various maps are handled on a different locations
- if (image->m_MapType == ImageMapTypes::Bump
- || image->m_MapType == ImageMapTypes::Normal
- || image->m_MapType == ImageMapTypes::Displacement
- || image->m_MapType == ImageMapTypes::SpecularAmountMap
- || image->m_MapType == ImageMapTypes::Roughness
- || image->m_MapType == ImageMapTypes::Translucency
- || image->m_MapType == ImageMapTypes::LightmapIndirect
- || image->m_MapType == ImageMapTypes::LightmapRadiosity) {
- continue;
- }
-
- eastl::basic_string<char8_t> texSwizzle, lookupSwizzle, texLodStr;
-
- GenerateImageUVCoordinates(idx, *image, 0);
-
- GenerateTextureSwizzle(
- image->m_Image.m_TextureData.m_Texture->GetTextureSwizzleMode(), texSwizzle,
- lookupSwizzle);
-
- if (texLodStr.empty()) {
- fragmentShader << "\ttexture_color" << texSwizzle.c_str() << " = texture2D( "
- << m_ImageSampler << ", " << m_ImageFragCoords << ")"
- << lookupSwizzle.c_str() << ";" << Endl;
- } else {
- fragmentShader << "\ttexture_color" << texSwizzle.c_str() << "= textureLod( "
- << m_ImageSampler << ", " << m_ImageFragCoords << ", "
- << texLodStr.c_str() << " )" << lookupSwizzle.c_str() << ";"
- << Endl;
- }
-
- if (image->m_Image.m_TextureData.m_TextureFlags.IsPreMultiplied() == true)
- fragmentShader << "\ttexture_color.rgb = texture_color.a > 0.0 ? "
- "texture_color.rgb / texture_color.a : vec3( 0, 0, 0 );"
- << Endl;
-
- // These mapping types honestly don't make a whole ton of sense to me.
- switch (image->m_MapType) {
- case ImageMapTypes::Diffuse: // assume images are premultiplied.
- case ImageMapTypes::LightmapShadow:
- // We use image offsets.z to switch between incoming premultiplied textures or
- // not premultiplied textures.
- // If Z is 1, then we assume the incoming texture is already premultiplied, else
- // we just read the rgb value.
- fragmentShader.Append("\tglobal_diffuse_light *= texture_color;");
- break;
- case ImageMapTypes::Specular:
-
- fragmentShader.AddUniform("material_specular", "vec4");
- if (fragmentHasSpecularAmount) {
- fragmentShader.Append("\tglobal_specular_light.xyz += specularAmount * "
- "specularColor * texture_color.xyz * "
- "material_specular.xyz;");
- } else {
- fragmentShader.Append("\tglobal_specular_light.xyz += texture_color.xyz * "
- "material_specular.xyz;");
- }
- fragmentShader.Append("\tglobal_diffuse_light.a *= texture_color.a;");
- break;
- case ImageMapTypes::Opacity:
- fragmentShader.Append("\tglobal_diffuse_light.a *= texture_color.a;");
- break;
- case ImageMapTypes::Emissive:
- fragmentShader.Append(
- "\tglobal_emission *= texture_color.xyz * texture_color.a;");
- break;
- default:
- QT3DS_ASSERT(false); // fallthrough intentional
- }
- }
- }
-
- if (hasEmissiveMap) {
- fragmentShader.Append("\tglobal_diffuse_light.rgb += global_emission.rgb;");
- }
-
- // Ensure the rgb colors are in range.
- fragmentShader.Append("\tfragOutput = vec4( clamp( vertColor * global_diffuse_light.xyz + "
- "global_specular_light.xyz, 0.0, 65519.0 ), global_diffuse_light.a "
- ");");
-
- if (VertexGenerator().HasActiveWireframe()) {
- fragmentShader.Append("vec3 edgeDistance = varEdgeDistance * gl_FragCoord.w;");
- fragmentShader.Append(
- "\tfloat d = min(min(edgeDistance.x, edgeDistance.y), edgeDistance.z);");
- fragmentShader.Append("\tfloat mixVal = smoothstep(0.0, 1.0, d);"); // line width 1.0
-
- fragmentShader.Append(
- "\tfragOutput = mix( vec4(0.0, 1.0, 0.0, 1.0), fragOutput, mixVal);");
- }
- }
-
- NVRenderShaderProgram *GenerateMaterialShader(const char8_t *inShaderPrefix)
- {
- // build a string that allows us to print out the shader we are generating to the log.
- // This is time consuming but I feel like it doesn't happen all that often and is very
- // useful to users
- // looking at the log file.
-
- m_GeneratedShaderString.clear();
- m_GeneratedShaderString.assign(nonNull(inShaderPrefix));
-
- SShaderDefaultMaterialKey theKey(Key());
- theKey.ToString(m_GeneratedShaderString, m_DefaultMaterialShaderKeyProperties);
-
- m_LightsAsSeparateUniforms = !m_RenderContext.GetRenderContext().GetConstantBufferSupport();
-
- GenerateVertexShader();
- GenerateFragmentShader(theKey);
-
- VertexGenerator().EndVertexGeneration(false);
- VertexGenerator().EndFragmentGeneration(false);
-
- return ProgramGenerator().CompileGeneratedShader(m_GeneratedShaderString.c_str(),
- SShaderCacheProgramFlags(), FeatureSet());
- }
-
- virtual NVRenderShaderProgram *
- GenerateShader(const SGraphObject &inMaterial, SShaderDefaultMaterialKey inShaderDescription,
- IShaderStageGenerator &inVertexPipeline, TShaderFeatureSet inFeatureSet,
- NVDataRef<SLight *> inLights, SRenderableImage *inFirstImage,
- bool inHasTransparency, const char8_t *inVertexPipelineName, const char8_t *) override
- {
- QT3DS_ASSERT(inMaterial.m_Type == GraphObjectTypes::DefaultMaterial);
- m_CurrentMaterial = static_cast<const SDefaultMaterial *>(&inMaterial);
- m_CurrentKey = &inShaderDescription;
- m_CurrentPipeline = static_cast<IDefaultMaterialVertexPipeline *>(&inVertexPipeline);
- m_CurrentFeatureSet = inFeatureSet;
- m_Lights = inLights;
- m_FirstImage = inFirstImage;
- m_HasTransparency = inHasTransparency;
-
- return GenerateMaterialShader(inVertexPipelineName);
- }
-
- SShaderGeneratorGeneratedShader &GetShaderForProgram(NVRenderShaderProgram &inProgram)
- {
- eastl::pair<TProgramToShaderMap::iterator, bool> inserter =
- m_ProgramToShaderMap.insert(eastl::make_pair(
- &inProgram, NVScopedRefCounted<SShaderGeneratorGeneratedShader>(NULL)));
- if (inserter.second) {
- NVAllocatorCallback &alloc(m_RenderContext.GetRenderContext().GetAllocator());
- inserter.first->second = QT3DS_NEW(alloc, SShaderGeneratorGeneratedShader)(
- inProgram, m_RenderContext.GetRenderContext());
- }
- return *inserter.first->second;
- }
-
- void SetGlobalProperties(NVRenderShaderProgram &inProgram, const SLayer & /*inLayer*/
- ,
- SCamera &inCamera, QT3DSVec3 inCameraDirection,
- NVDataRef<SLight *> inLights, NVDataRef<QT3DSVec3> inLightDirections,
- Qt3DSShadowMap *inShadowMapManager)
- {
- SShaderGeneratorGeneratedShader &shader(GetShaderForProgram(inProgram));
- m_RenderContext.GetRenderContext().SetActiveShader(&inProgram);
-
- m_ShadowMapManager = inShadowMapManager;
-
- SCamera &theCamera(inCamera);
- shader.m_CameraPosition.Set(theCamera.GetGlobalPos());
- shader.m_CameraDirection.Set(inCameraDirection);
-
- QT3DSMat44 viewProj;
- if (shader.m_ViewProj.IsValid()) {
- theCamera.CalculateViewProjectionMatrix(viewProj);
- shader.m_ViewProj.Set(viewProj);
- }
-
- if (shader.m_ViewMatrix.IsValid()) {
- viewProj = theCamera.m_GlobalTransform.getInverse();
- shader.m_ViewMatrix.Set(viewProj);
- }
-
- // update the constant buffer
- shader.m_AoShadowParams.Set();
- // We can't cache light properties because they can change per object.
- QT3DSVec4 theLightAmbientTotal = QT3DSVec4(0, 0, 0, 1);
- size_t numShaderLights = shader.m_Lights.size();
- size_t numShadowLights = shader.m_ShadowMaps.size();
- for (QT3DSU32 lightIdx = 0, shadowMapIdx = 0, lightEnd = inLights.size();
- lightIdx < lightEnd && lightIdx < QT3DS_MAX_NUM_LIGHTS; ++lightIdx) {
- SLight *theLight(inLights[lightIdx]);
- if (lightIdx >= numShaderLights) {
- shader.m_Lights.push_back(SShaderLightProperties());
- ++numShaderLights;
- }
- if (shadowMapIdx >= numShadowLights && numShadowLights < QT3DS_MAX_NUM_SHADOWS) {
- if (theLight->m_Scope == NULL && theLight->m_CastShadow) {
- // PKC TODO : Fix multiple shadow issues.
- // Need to know when the list of lights changes order, and clear shadow maps
- // when that happens.
- SetupShadowMapVariableNames(lightIdx);
- shader.m_ShadowMaps.push_back(SShadowMapProperties(
- m_ShadowMapStem.c_str(), m_ShadowCubeStem.c_str(),
- m_ShadowMatrixStem.c_str(), m_ShadowControlStem.c_str(), inProgram));
- }
- }
- QT3DS_ASSERT(lightIdx < numShaderLights);
- SShaderLightProperties &theLightProperties(shader.m_Lights[lightIdx]);
- float brightness = TranslateConstantAttenuation(theLight->m_Brightness);
-
- // setup light data
- theLightProperties.m_LightColor =
- QT3DSVec4(theLight->m_DiffuseColor.getXYZ() * brightness, 1.0);
- theLightProperties.m_LightData.m_specular =
- QT3DSVec4(theLight->m_SpecularColor.getXYZ() * brightness, 1.0);
- theLightProperties.m_LightData.m_direction = QT3DSVec4(inLightDirections[lightIdx], 1.0);
-
- // TODO : This does potentially mean that we can create more shadow map entries than
- // we can actually use at once.
- if ((theLight->m_Scope == NULL) && (theLight->m_CastShadow && inShadowMapManager)) {
- SShadowMapProperties &theShadowMapProperties(shader.m_ShadowMaps[shadowMapIdx++]);
- SShadowMapEntry *pEntry = inShadowMapManager->GetShadowMapEntry(lightIdx);
- if (pEntry) {
- // add fixed scale bias matrix
- QT3DSMat44 bias(QT3DSVec4(0.5, 0.0, 0.0, 0.0), QT3DSVec4(0.0, 0.5, 0.0, 0.0),
- QT3DSVec4(0.0, 0.0, 0.5, 0.0), QT3DSVec4(0.5, 0.5, 0.5, 1.0));
-
- if (theLight->m_LightType != RenderLightTypes::Directional) {
- theShadowMapProperties.m_ShadowCubeTexture.Set(pEntry->m_DepthCube);
- theShadowMapProperties.m_ShadowmapMatrix.Set(pEntry->m_LightView);
- } else {
- theShadowMapProperties.m_ShadowmapTexture.Set(pEntry->m_DepthMap);
- theShadowMapProperties.m_ShadowmapMatrix.Set(bias * pEntry->m_LightVP);
- }
-
- theShadowMapProperties.m_ShadowmapSettings.Set(
- QT3DSVec4(theLight->m_ShadowBias, theLight->m_ShadowFactor,
- theLight->m_ShadowMapFar, 0.0f));
- } else {
- // if we have a light casting shadow we should find an entry
- QT3DS_ASSERT(false);
- }
- }
-
- if (theLight->m_LightType == RenderLightTypes::Point) {
- theLightProperties.m_LightData.m_position = QT3DSVec4(theLight->GetGlobalPos(), 1.0);
- theLightProperties.m_LightData.m_constantAttenuation = 1.0;
- theLightProperties.m_LightData.m_linearAttenuation =
- TranslateLinearAttenuation(theLight->m_LinearFade);
- theLightProperties.m_LightData.m_quadraticAttenuation =
- TranslateQuadraticAttenuation(theLight->m_ExponentialFade);
- } else if (theLight->m_LightType == RenderLightTypes::Area) {
- theLightProperties.m_LightData.m_position = QT3DSVec4(theLight->GetGlobalPos(), 1.0);
-
- QT3DSVec3 upDir = theLight->m_GlobalTransform.getUpper3x3().transform(QT3DSVec3(0, 1, 0));
- QT3DSVec3 rtDir = theLight->m_GlobalTransform.getUpper3x3().transform(QT3DSVec3(1, 0, 0));
-
- theLightProperties.m_LightData.m_up = QT3DSVec4(upDir, theLight->m_AreaHeight);
- theLightProperties.m_LightData.m_right = QT3DSVec4(rtDir, theLight->m_AreaWidth);
- }
- theLightAmbientTotal += theLight->m_AmbientColor;
- }
- shader.m_LightAmbientTotal = theLightAmbientTotal.getXYZ();
- }
-
- // Also sets the blend function on the render context.
- void SetMaterialProperties(NVRenderShaderProgram &inProgram, const SDefaultMaterial &inMaterial,
- const QT3DSVec2 &inCameraVec, const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix, const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- NVRenderTexture2D *inDepthTexture, NVRenderTexture2D *inSSaoTexture,
- SImage *inLightProbe, SImage *inLightProbe2, QT3DSF32 inProbeHorizon,
- QT3DSF32 inProbeBright, QT3DSF32 inProbe2Window, QT3DSF32 inProbe2Pos,
- QT3DSF32 inProbe2Fade, QT3DSF32 inProbeFOV)
- {
-
- NVRenderContext &context(m_RenderContext.GetRenderContext());
- SShaderGeneratorGeneratedShader &shader(GetShaderForProgram(inProgram));
- shader.m_MVP.Set(inModelViewProjection);
- shader.m_NormalMatrix.Set(inNormalMatrix);
- shader.m_GlobalTransform.Set(inGlobalTransform);
- shader.m_DepthTexture.Set(inDepthTexture);
-
- shader.m_AOTexture.Set(inSSaoTexture);
-
- qt3ds::render::SImage *theLightProbe = inLightProbe;
- qt3ds::render::SImage *theLightProbe2 = inLightProbe2;
-
- // If the material has its own IBL Override, we should use that image instead.
- if ((inMaterial.m_IblProbe) && (inMaterial.m_IblProbe->m_TextureData.m_Texture)) {
- theLightProbe = inMaterial.m_IblProbe;
- }
-
- if (theLightProbe) {
- if (theLightProbe->m_TextureData.m_Texture) {
- NVRenderTextureCoordOp::Enum theHorzLightProbeTilingMode =
- theLightProbe->m_HorizontalTilingMode;
- NVRenderTextureCoordOp::Enum theVertLightProbeTilingMode =
- theLightProbe->m_VerticalTilingMode;
- theLightProbe->m_TextureData.m_Texture->SetTextureWrapS(
- theHorzLightProbeTilingMode);
- theLightProbe->m_TextureData.m_Texture->SetTextureWrapT(
- theVertLightProbeTilingMode);
- const QT3DSMat44 &textureTransform = theLightProbe->m_TextureTransform;
- // We separate rotational information from offset information so that just maybe the
- // shader
- // will attempt to push less information to the card.
- const QT3DSF32 *dataPtr(textureTransform.front());
- // The third member of the offsets contains a flag indicating if the texture was
- // premultiplied or not.
- // We use this to mix the texture alpha.
- QT3DSVec4 offsets(dataPtr[12], dataPtr[13],
- theLightProbe->m_TextureData.m_TextureFlags.IsPreMultiplied() ? 1.0f
- : 0.0f,
- (float)theLightProbe->m_TextureData.m_Texture->GetNumMipmaps());
-
- // Grab just the upper 2x2 rotation matrix from the larger matrix.
- QT3DSVec4 rotations(dataPtr[0], dataPtr[4], dataPtr[1], dataPtr[5]);
-
- shader.m_LightProbeRot.Set(rotations);
- shader.m_LightProbeOfs.Set(offsets);
-
- if ((!inMaterial.m_IblProbe) && (inProbeFOV < 180.f)) {
- shader.m_LightProbeOpts.Set(
- QT3DSVec4(0.01745329251994329547f * inProbeFOV, 0.0f, 0.0f, 0.0f));
- }
-
- // Also make sure to add the secondary texture, but it should only be added if the
- // primary
- // (i.e. background) texture is also there.
- if (theLightProbe2 && theLightProbe2->m_TextureData.m_Texture) {
- theLightProbe2->m_TextureData.m_Texture->SetTextureWrapS(
- theHorzLightProbeTilingMode);
- theLightProbe2->m_TextureData.m_Texture->SetTextureWrapT(
- theVertLightProbeTilingMode);
- shader.m_LightProbe2.Set(theLightProbe2->m_TextureData.m_Texture);
- shader.m_LightProbe2Props.Set(
- QT3DSVec4(inProbe2Window, inProbe2Pos, inProbe2Fade, 1.0f));
-
- const QT3DSMat44 &xform2 = theLightProbe2->m_TextureTransform;
- const QT3DSF32 *dataPtr(xform2.front());
- shader.m_LightProbeProps.Set(
- QT3DSVec4(dataPtr[12], dataPtr[13], inProbeHorizon, inProbeBright * 0.01f));
- } else {
- shader.m_LightProbe2Props.Set(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
- shader.m_LightProbeProps.Set(
- QT3DSVec4(0.0f, 0.0f, inProbeHorizon, inProbeBright * 0.01f));
- }
- NVRenderTexture2D *textureImage = theLightProbe->m_TextureData.m_Texture;
- shader.m_LightProbe.Set(textureImage);
- shader.m_LightProbeSize.Set(QT3DSVec2(textureImage->GetTextureDetails().m_Width,
- textureImage->GetTextureDetails().m_Height));
- } else {
- shader.m_LightProbeProps.Set(QT3DSVec4(0.0f, 0.0f, -1.0f, 0.0f));
- shader.m_LightProbe2Props.Set(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
- }
- } else {
- shader.m_LightProbeProps.Set(QT3DSVec4(0.0f, 0.0f, -1.0f, 0.0f));
- shader.m_LightProbe2Props.Set(QT3DSVec4(0.0f, 0.0f, 0.0f, 0.0f));
- }
-
- QT3DSF32 emissivePower = 1.0;
-
- QT3DSU32 hasLighting = inMaterial.m_Lighting != DefaultMaterialLighting::NoLighting;
- if (hasLighting)
- emissivePower = inMaterial.m_EmissivePower / 100.0f;
-
- QT3DSVec4 material_diffuse = QT3DSVec4(inMaterial.m_EmissiveColor[0] * emissivePower,
- inMaterial.m_EmissiveColor[1] * emissivePower,
- inMaterial.m_EmissiveColor[2] * emissivePower, inOpacity);
- shader.m_MaterialDiffuse.Set(material_diffuse);
- shader.m_DiffuseColor.Set(inMaterial.m_DiffuseColor.getXYZ());
- QT3DSVec4 material_specular =
- QT3DSVec4(inMaterial.m_SpecularTint[0], inMaterial.m_SpecularTint[1],
- inMaterial.m_SpecularTint[2], inMaterial.m_IOR);
- shader.m_MaterialSpecular.Set(material_specular);
- shader.m_CameraProperties.Set(inCameraVec);
- shader.m_FresnelPower.Set(inMaterial.m_FresnelPower);
-
- if (context.GetConstantBufferSupport()) {
- NVRenderConstantBuffer *pLightCb = GetLightConstantBuffer(shader.m_Lights.size());
- // if we have lights we need a light buffer
- QT3DS_ASSERT(shader.m_Lights.size() == 0 || pLightCb);
-
- for (QT3DSU32 idx = 0, end = shader.m_Lights.size(); idx < end && pLightCb; ++idx) {
- shader.m_Lights[idx].m_LightData.m_diffuse =
- QT3DSVec4(shader.m_Lights[idx].m_LightColor.x * inMaterial.m_DiffuseColor.x,
- shader.m_Lights[idx].m_LightColor.y * inMaterial.m_DiffuseColor.y,
- shader.m_Lights[idx].m_LightColor.z * inMaterial.m_DiffuseColor.z, 1.0);
-
- // this is our final change update memory
- pLightCb->UpdateRaw(idx * sizeof(SLightSourceShader) + (4 * sizeof(QT3DSI32)),
- NVDataRef<QT3DSU8>((QT3DSU8 *)&shader.m_Lights[idx].m_LightData,
- sizeof(SLightSourceShader)));
- }
- // update light buffer to hardware
- if (pLightCb) {
- QT3DSI32 cgLights = shader.m_Lights.size();
- pLightCb->UpdateRaw(0, NVDataRef<QT3DSU8>((QT3DSU8 *)&cgLights, sizeof(QT3DSI32)));
- shader.m_LightsBuffer.Set();
- }
- } else {
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *pLightConstants
- = GetLightConstantProperties(shader);
-
- // if we have lights we need a light buffer
- QT3DS_ASSERT(shader.m_Lights.size() == 0 || pLightConstants);
-
- for (QT3DSU32 idx = 0, end = shader.m_Lights.size();
- idx < end && pLightConstants; ++idx) {
- shader.m_Lights[idx].m_LightData.m_diffuse =
- QT3DSVec4(shader.m_Lights[idx].m_LightColor.x * inMaterial.m_DiffuseColor.x,
- shader.m_Lights[idx].m_LightColor.y * inMaterial.m_DiffuseColor.y,
- shader.m_Lights[idx].m_LightColor.z * inMaterial.m_DiffuseColor.z, 1.0);
- }
- // update light buffer to hardware
- if (pLightConstants)
- pLightConstants->updateLights(shader);
- }
-
- shader.m_MaterialDiffuseLightAmbientTotal.Set(
- QT3DSVec3(shader.m_LightAmbientTotal.x * inMaterial.m_DiffuseColor[0],
- shader.m_LightAmbientTotal.y * inMaterial.m_DiffuseColor[1],
- shader.m_LightAmbientTotal.z * inMaterial.m_DiffuseColor[2]));
-
- shader.m_MaterialProperties.Set(QT3DSVec4(
- inMaterial.m_SpecularAmount, inMaterial.m_SpecularRoughness, emissivePower, 0.0f));
- shader.m_BumpAmount.Set(inMaterial.m_BumpAmount);
- shader.m_DisplaceAmount.Set(inMaterial.m_DisplaceAmount);
- shader.m_TranslucentFalloff.Set(inMaterial.m_TranslucentFalloff);
- shader.m_DiffuseLightWrap.Set(inMaterial.m_DiffuseLightWrap);
- QT3DSU32 imageIdx = 0;
- for (SRenderableImage *theImage = inFirstImage; theImage;
- theImage = theImage->m_NextImage, ++imageIdx)
- SetImageShaderVariables(shader, *theImage, imageIdx);
-
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc;
- qt3ds::render::NVRenderBlendEquationArgument blendEqua(NVRenderBlendEquation::Add,
- NVRenderBlendEquation::Add);
- // The blend function goes:
- // src op
- // dst op
- // src alpha op
- // dst alpha op
- // All of our shaders produce non-premultiplied values.
- switch (inMaterial.m_BlendMode) {
- case DefaultMaterialBlendMode::Screen:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::SrcAlpha, NVRenderDstBlendFunc::One,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- break;
- case DefaultMaterialBlendMode::Multiply:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::DstColor, NVRenderDstBlendFunc::Zero,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- break;
- case DefaultMaterialBlendMode::Overlay:
- // SW fallback is not using blend equation
- // note blend func is not used here anymore
- if (context.IsAdvancedBlendHwSupported() || context.IsAdvancedBlendHwSupportedKHR())
- blendEqua = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Overlay, NVRenderBlendEquation::Overlay);
- break;
- case DefaultMaterialBlendMode::ColorBurn:
- // SW fallback is not using blend equation
- // note blend func is not used here anymore
- if (context.IsAdvancedBlendHwSupported() || context.IsAdvancedBlendHwSupportedKHR())
- blendEqua = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::ColorBurn, NVRenderBlendEquation::ColorBurn);
- break;
- case DefaultMaterialBlendMode::ColorDodge:
- // SW fallback is not using blend equation
- // note blend func is not used here anymore
- if (context.IsAdvancedBlendHwSupported() || context.IsAdvancedBlendHwSupportedKHR())
- blendEqua = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::ColorDodge, NVRenderBlendEquation::ColorDodge);
- break;
- default:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::SrcAlpha, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha);
- break;
- }
- context.SetBlendFunction(blendFunc);
- context.SetBlendEquation(blendEqua);
- }
- void SetMaterialProperties(NVRenderShaderProgram &inProgram,
- const SGraphObject &inMaterial, const QT3DSVec2 &inCameraVec,
- const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix,
- const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- SLayerGlobalRenderProperties inRenderProperties) override
- {
- const SDefaultMaterial &theMaterial(static_cast<const SDefaultMaterial &>(inMaterial));
- QT3DS_ASSERT(inMaterial.m_Type == GraphObjectTypes::DefaultMaterial);
-
- SetGlobalProperties(inProgram, inRenderProperties.m_Layer, inRenderProperties.m_Camera,
- inRenderProperties.m_CameraDirection, inRenderProperties.m_Lights,
- inRenderProperties.m_LightDirections,
- inRenderProperties.m_ShadowMapManager);
- SetMaterialProperties(inProgram, theMaterial, inCameraVec, inModelViewProjection,
- inNormalMatrix, inGlobalTransform, inFirstImage, inOpacity,
- inRenderProperties.m_DepthTexture, inRenderProperties.m_SSaoTexture,
- inRenderProperties.m_LightProbe, inRenderProperties.m_LightProbe2,
- inRenderProperties.m_ProbeHorizon, inRenderProperties.m_ProbeBright,
- inRenderProperties.m_Probe2Window, inRenderProperties.m_Probe2Pos,
- inRenderProperties.m_Probe2Fade, inRenderProperties.m_ProbeFOV);
- }
-
- SLightConstantProperties<SShaderGeneratorGeneratedShader> *GetLightConstantProperties(SShaderGeneratorGeneratedShader &shader)
- {
- if (!shader.m_lightConstantProperties
- || int(shader.m_Lights.size())
- > shader.m_lightConstantProperties->m_constants.size()) {
- if (shader.m_lightConstantProperties)
- delete shader.m_lightConstantProperties;
- shader.m_lightConstantProperties
- = new SLightConstantProperties<SShaderGeneratorGeneratedShader>(
- shader, m_LightsAsSeparateUniforms);
- }
- return shader.m_lightConstantProperties;
- }
-};
-}
-
-IDefaultMaterialShaderGenerator &
-IDefaultMaterialShaderGenerator::CreateDefaultMaterialShaderGenerator(IQt3DSRenderContext &inRc)
-{
- return *QT3DS_NEW(inRc.GetAllocator(), SShaderGenerator)(inRc);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.h
deleted file mode 100644
index 7453e1db..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DEFAULT_MATERIAL_SHADER_GENERATOR_H
-#define QT3DS_RENDER_DEFAULT_MATERIAL_SHADER_GENERATOR_H
-#include "Qt3DSRenderMaterialShaderGenerator.h"
-#include "Qt3DSRenderLightConstantProperties.h"
-
-namespace qt3ds {
-namespace render {
-
- class Qt3DSShadowMap;
- struct SShaderGeneratorGeneratedShader;
-
- class IDefaultMaterialVertexPipeline : public IShaderStageGenerator
- {
- protected:
- virtual ~IDefaultMaterialVertexPipeline() {}
- public:
- // Responsible for beginning all vertex and fragment generation (void main() { etc).
- virtual void BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) = 0;
- // The fragment shader expects a floating point constant, object_opacity to be defined
- // post this method.
- virtual void BeginFragmentGeneration() = 0;
- // Output variables may be mangled in some circumstances so the shader generation system
- // needs an abstraction
- // mechanism around this.
- virtual void AssignOutput(const char8_t *inVarName, const char8_t *inVarValueExpr) = 0;
-
- /**
- * @brief Generates UV coordinates in shader code
- *
- * @param[in] inUVSet index of UV data set
- *
- * @return no return
- */
- virtual void GenerateUVCoords(QT3DSU32 inUVSet = 0) = 0;
-
- virtual void GenerateEnvMapReflection() = 0;
- virtual void GenerateViewVector() = 0;
-
- // fragment shader expects varying vertex normal
- // lighting in vertex pipeline expects world_normal
- virtual void GenerateWorldNormal() = 0; // world_normal in both vert and frag shader
- virtual void GenerateObjectNormal() = 0; // object_normal in both vert and frag shader
- virtual void
- GenerateWorldPosition() = 0; // model_world_position in both vert and frag shader
- virtual void GenerateVarTangentAndBinormal() = 0;
- virtual void GenerateVertexColor() = 0;
-
- virtual bool HasActiveWireframe() = 0; // varEdgeDistance is a valid entity
-
- // responsible for closing all vertex and fragment generation
- virtual void EndVertexGeneration(bool customShader) = 0;
- virtual void EndFragmentGeneration(bool customShader) = 0;
- };
-
- class IDefaultMaterialShaderGenerator : public IMaterialShaderGenerator
- {
- public:
- virtual void AddDisplacementImageUniforms(IShaderStageGenerator &inGenerator,
- QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) = 0;
- SImageVariableNames GetImageVariableNames(QT3DSU32 inIdx) override = 0;
- void GenerateImageUVCoordinates(IShaderStageGenerator &inVertexPipeline, QT3DSU32 idx,
- QT3DSU32 uvSet, SRenderableImage &image) override = 0;
- // Transforms attr_pos, attr_norm, and attr_uv0.
- virtual void AddDisplacementMappingForDepthPass(IShaderStageGenerator &inShader) = 0;
-
- // inPipelineName needs to be unique else the shader cache will just return shaders from
- // different pipelines.
- NVRenderShaderProgram *GenerateShader(
- const SGraphObject &inMaterial, SShaderDefaultMaterialKey inShaderDescription,
- IShaderStageGenerator &inVertexPipeline, TShaderFeatureSet inFeatureSet,
- NVDataRef<SLight *> inLights, SRenderableImage *inFirstImage, bool inHasTransparency,
- const char8_t *inVertexPipelineName, const char8_t *inCustomMaterialName = "") override = 0;
-
- // Also sets the blend function on the render context.
- virtual void
- SetMaterialProperties(NVRenderShaderProgram &inProgram, const SGraphObject &inMaterial,
- const QT3DSVec2 &inCameraVec, const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix, const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- SLayerGlobalRenderProperties inRenderProperties) override = 0;
-
- static IDefaultMaterialShaderGenerator &
- CreateDefaultMaterialShaderGenerator(IQt3DSRenderContext &inRenderContext);
-
- SLightConstantProperties<SShaderGeneratorGeneratedShader>
- *GetLightConstantProperties(SShaderGeneratorGeneratedShader &shader);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.cpp
deleted file mode 100644
index 92c337a0..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.cpp
+++ /dev/null
@@ -1,1532 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderContextCore.h"
-#include "render/Qt3DSRenderShaderConstant.h"
-#include "Qt3DSRenderDynamicObject.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/FileTools.h"
-#include "foundation/PreAllocatedAllocator.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "StringTools.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderDynamicObjectSystemCommands.h"
-#include "Qt3DSRenderDynamicObjectSystemUtil.h"
-#include "Qt3DSRenderShaderCodeGenerator.h"
-#include "foundation/Qt3DSMutex.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace qt3ds::render::dynamic;
-
-namespace {
-typedef eastl::pair<CRegisteredString, CRegisteredString> TStrStrPair;
-}
-
-namespace eastl {
-template <>
-struct hash<TStrStrPair>
-{
- size_t operator()(const TStrStrPair &item) const
- {
- return hash<CRegisteredString>()(item.first) ^ hash<CRegisteredString>()(item.second);
- }
-};
-}
-
-namespace qt3ds {
-namespace render {
- namespace dynamic {
-
- QT3DSU32 SCommand::GetSizeofCommand(const SCommand &inCommand)
- {
- switch (inCommand.m_Type) {
- case CommandTypes::AllocateBuffer:
- return sizeof(SAllocateBuffer);
- case CommandTypes::BindBuffer:
- return sizeof(SBindBuffer);
- case CommandTypes::BindTarget:
- return sizeof(SBindTarget);
- case CommandTypes::BindShader:
- return sizeof(SBindShader);
- case CommandTypes::Render:
- return sizeof(SRender);
- case CommandTypes::ApplyBufferValue:
- return sizeof(SApplyBufferValue);
- case CommandTypes::ApplyDepthValue:
- return sizeof(SApplyDepthValue);
- case CommandTypes::ApplyInstanceValue:
- return sizeof(SApplyInstanceValue);
- case CommandTypes::ApplyBlending:
- return sizeof(SApplyBlending);
- case CommandTypes::ApplyRenderState:
- return sizeof(SApplyRenderState);
- case CommandTypes::ApplyBlitFramebuffer:
- return sizeof(SApplyBlitFramebuffer);
- case CommandTypes::ApplyValue:
- return sizeof(SApplyValue)
- + static_cast<const SApplyValue &>(inCommand).m_Value.mSize;
- case CommandTypes::DepthStencil:
- return sizeof(SDepthStencil);
- case CommandTypes::AllocateImage:
- return sizeof(SAllocateImage);
- case CommandTypes::ApplyImageValue:
- return sizeof(SApplyImageValue);
- case CommandTypes::AllocateDataBuffer:
- return sizeof(SAllocateDataBuffer);
- case CommandTypes::ApplyDataBufferValue:
- return sizeof(SApplyDataBufferValue);
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- template <typename TCommandType>
- inline void CopyConstructCommandT(QT3DSU8 *inDataBuffer, const SCommand &inCommand,
- IStringTable &inStrTable)
- {
- TCommandType *theCommand = (TCommandType *)inDataBuffer;
- theCommand = new (theCommand)
- TCommandType(static_cast<const TCommandType &>(inCommand), inStrTable);
- }
-
- void SCommand::CopyConstructCommand(QT3DSU8 *inDataBuffer, const SCommand &inCommand,
- IStringTable &inStrTable)
- {
- switch (inCommand.m_Type) {
- case CommandTypes::AllocateBuffer:
- CopyConstructCommandT<SAllocateBuffer>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::BindBuffer:
- CopyConstructCommandT<SBindBuffer>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::BindTarget:
- CopyConstructCommandT<SBindTarget>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::BindShader:
- CopyConstructCommandT<SBindShader>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::Render:
- CopyConstructCommandT<SRender>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyBufferValue:
- CopyConstructCommandT<SApplyBufferValue>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyDepthValue:
- CopyConstructCommandT<SApplyDepthValue>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyInstanceValue:
- CopyConstructCommandT<SApplyInstanceValue>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyBlending:
- CopyConstructCommandT<SApplyBlending>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyRenderState:
- CopyConstructCommandT<SApplyRenderState>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyBlitFramebuffer:
- CopyConstructCommandT<SApplyBlitFramebuffer>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyValue: {
- CopyConstructCommandT<SApplyValue>(inDataBuffer, inCommand, inStrTable);
- SApplyValue &dest = *reinterpret_cast<SApplyValue *>(inDataBuffer);
- QT3DSU8 *destMem = inDataBuffer + sizeof(SApplyValue);
- const SApplyValue &src = static_cast<const SApplyValue &>(inCommand);
- memcpy(destMem, src.m_Value.mData, src.m_Value.mSize);
- dest.m_Value.mData = destMem;
- break;
- }
- case CommandTypes::DepthStencil:
- CopyConstructCommandT<SDepthStencil>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::AllocateImage:
- CopyConstructCommandT<SAllocateImage>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyImageValue:
- CopyConstructCommandT<SApplyImageValue>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::AllocateDataBuffer:
- CopyConstructCommandT<SAllocateDataBuffer>(inDataBuffer, inCommand, inStrTable);
- break;
- case CommandTypes::ApplyDataBufferValue:
- CopyConstructCommandT<SApplyDataBufferValue>(inDataBuffer, inCommand, inStrTable);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- }
-}
-}
-
-namespace {
-
-template <typename TCommandType>
-struct SCommandRemapping
-{
- template <typename TRemapper>
- static void RemapCommandData(TCommandType &, TRemapper &)
- {
- }
-};
-
-template <>
-struct SCommandRemapping<SAllocateBuffer>
-{
- template <typename TRemapper>
- static void RemapCommandData(SAllocateBuffer &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_Name);
- }
-};
-
-template <>
-struct SCommandRemapping<SAllocateImage>
-{
- template <typename TRemapper>
- static void RemapCommandData(SAllocateImage &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_Name);
- }
-};
-
-template <>
-struct SCommandRemapping<SAllocateDataBuffer>
-{
- template <typename TRemapper>
- static void RemapCommandData(SAllocateDataBuffer &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_Name);
- if (cmd.m_WrapName)
- remapper.Remap(cmd.m_WrapName);
- }
-};
-
-template <>
-struct SCommandRemapping<SBindBuffer>
-{
- template <typename TRemapper>
- static void RemapCommandData(SBindBuffer &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_BufferName);
- }
-};
-template <>
-struct SCommandRemapping<SBindShader>
-{
- template <typename TRemapper>
- static void RemapCommandData(SBindShader &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_ShaderPath);
- remapper.Remap(cmd.m_ShaderDefine);
- }
-};
-template <>
-struct SCommandRemapping<SApplyInstanceValue>
-{
- template <typename TRemapper>
- static void RemapCommandData(SApplyInstanceValue &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_PropertyName);
- }
-};
-template <>
-struct SCommandRemapping<SApplyBufferValue>
-{
- template <typename TRemapper>
- static void RemapCommandData(SApplyBufferValue &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_BufferName);
- remapper.Remap(cmd.m_ParamName);
- }
-};
-
-template <>
-struct SCommandRemapping<SApplyDepthValue>
-{
- template <typename TRemapper>
- static void RemapCommandData(SApplyDepthValue &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_ParamName);
- }
-};
-
-template <>
-struct SCommandRemapping<SApplyBlitFramebuffer>
-{
- template <typename TRemapper>
- static void RemapCommandData(SApplyBlitFramebuffer &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_SourceBufferName);
- remapper.Remap(cmd.m_DestBufferName);
- }
-};
-
-template <>
-struct SCommandRemapping<SApplyValue>
-{
- template <typename TRemapper>
- static void RemapCommandData(SApplyValue &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_PropertyName);
- }
-};
-
-template <>
-struct SCommandRemapping<SApplyDataBufferValue>
-{
- template <typename TRemapper>
- static void RemapCommandData(SApplyDataBufferValue &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_ParamName);
- }
-};
-
-template <>
-struct SCommandRemapping<SDepthStencil>
-{
- template <typename TRemapper>
- static void RemapCommandData(SDepthStencil &cmd, TRemapper &remapper)
- {
- remapper.Remap(cmd.m_BufferName);
- }
-};
-
-QT3DSU32 Align(QT3DSU32 inValue)
-{
- if (inValue % 4)
- return inValue + (4 - (inValue % 4));
- return inValue;
-}
-
-QT3DSU32 Align8(QT3DSU32 inValue)
-{
- if (inValue % 8)
- return inValue + (8 - (inValue % 8));
- return inValue;
-}
-
-inline const char *GetShaderDatatypeName(NVRenderShaderDataTypes::Enum inValue)
-{
- switch (inValue) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(type) \
- case NVRenderShaderDataTypes::type: \
- return #type;
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return "";
-}
-
-inline qt3ds::QT3DSU32 getSizeofShaderDataType(NVRenderShaderDataTypes::Enum value)
-{
- using namespace qt3ds;
- using namespace qt3ds::render;
- switch (value) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(x) \
- case NVRenderShaderDataTypes::x: \
- return sizeof(x);
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
-}
-
-struct SDynamicObjectShaderInfo
-{
- CRegisteredString m_Type; ///< shader type (GLSL or HLSL)
- CRegisteredString m_Version; ///< shader version (e.g. 330 vor GLSL)
- bool m_HasGeomShader;
- bool m_IsComputeShader;
-
- SDynamicObjectShaderInfo()
- : m_HasGeomShader(false)
- , m_IsComputeShader(false)
- {
- }
- SDynamicObjectShaderInfo(CRegisteredString inType, CRegisteredString inVersion,
- bool inHasGeomShader, bool inIsComputeShader)
- : m_Type(inType)
- , m_Version(inVersion)
- , m_HasGeomShader(inHasGeomShader)
- , m_IsComputeShader(inIsComputeShader)
- {
- }
-};
-
-struct SDynamicObjClassImpl : public IDynamicObjectClass
-{
- NVAllocatorCallback *m_Allocator;
- CRegisteredString m_Id;
- NVConstDataRef<SPropertyDefinition> m_PropertyDefinitions;
- QT3DSU32 m_PropertySectionByteSize;
- QT3DSU32 m_BaseObjectSize;
- GraphObjectTypes::Enum m_GraphObjectType;
- QT3DSU8 *m_PropertyDefaultData;
- NVConstDataRef<SCommand *> m_RenderCommands;
- volatile QT3DSI32 mRefCount;
- bool m_RequiresDepthTexture;
- bool m_RequiresCompilation;
- NVRenderTextureFormats::Enum m_OutputFormat;
-
- SDynamicObjClassImpl(
- NVAllocatorCallback &alloc, CRegisteredString id,
- NVConstDataRef<SPropertyDefinition> definitions, QT3DSU32 propertySectionByteSize,
- QT3DSU32 baseObjectSize, GraphObjectTypes::Enum objectType, QT3DSU8 *propDefaultData,
- bool inRequiresDepthTexture = false,
- NVRenderTextureFormats::Enum inOutputFormat = NVRenderTextureFormats::RGBA8)
- : m_Allocator(&alloc)
- , m_Id(id)
- , m_PropertyDefinitions(definitions)
- , m_PropertySectionByteSize(propertySectionByteSize)
- , m_BaseObjectSize(baseObjectSize)
- , m_GraphObjectType(objectType)
- , m_PropertyDefaultData(propDefaultData)
- , mRefCount(0)
- , m_RequiresDepthTexture(inRequiresDepthTexture)
- , m_RequiresCompilation(false)
- , m_OutputFormat(inOutputFormat)
- {
- }
-
- ~SDynamicObjClassImpl()
- {
- if (m_PropertyDefinitions.size()) {
- for (QT3DSU32 idx = 0, end = m_PropertyDefinitions.size(); idx < end; ++idx) {
- if (m_PropertyDefinitions[idx].m_EnumValueNames.size())
- m_Allocator->deallocate(
- (void *)m_PropertyDefinitions[idx].m_EnumValueNames.begin());
- }
- }
- ReleaseCommands();
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(*m_Allocator)
-
- template <typename TRemapperType>
- static void RemapCommand(SCommand &inCommand, TRemapperType &inRemapper)
- {
- switch (inCommand.m_Type) {
-#define QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(type) \
- case CommandTypes::type: \
- SCommandRemapping<S##type>::RemapCommandData(static_cast<S##type &>(inCommand), \
- inRemapper); \
- break;
- QT3DS_RENDER_EFFECTS_ITERATE_COMMAND_TYPES
-#undef QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- template <typename TRemapper>
- void SetupThisObjectFromMemory(NVAllocatorCallback &inAlloc, TRemapper &inRemapper,
- QT3DSU8 *inCommandStart, QT3DSU32 numEffectCommands)
- {
- m_Allocator = &inAlloc;
- mRefCount = 0;
- QT3DSU8 *theCommandPtrBegin = inCommandStart;
- QT3DSU32 theCommandOffset = 0;
- for (QT3DSU32 idx = 0; idx < numEffectCommands; ++idx) {
- SCommand *theCommand = reinterpret_cast<SCommand *>(inCommandStart + theCommandOffset);
- theCommandOffset += SCommand::GetSizeofCommand(*theCommand);
- }
- SCommand **theCommandPtrStart =
- reinterpret_cast<SCommand **>(theCommandPtrBegin + theCommandOffset);
- m_RenderCommands = NVConstDataRef<SCommand *>(theCommandPtrStart, numEffectCommands);
- // Now run through the commands, fixup strings and setup the command ptrs
- theCommandOffset = 0;
- for (QT3DSU32 idx = 0; idx < numEffectCommands; ++idx) {
- SCommand *theCommand =
- reinterpret_cast<SCommand *>(theCommandPtrBegin + theCommandOffset);
- theCommandPtrStart[idx] = theCommand;
- RemapCommand(*theCommand, inRemapper);
- theCommandOffset += SCommand::GetSizeofCommand(*theCommand);
- }
- }
-
- void ReleaseCommands()
- {
- if (m_RenderCommands.size()) {
- m_Allocator->deallocate(const_cast<SCommand *>(*m_RenderCommands.begin()));
- m_RenderCommands = NVConstDataRef<SCommand *>();
- }
- }
-
- CRegisteredString GetId() const override { return m_Id; }
- NVConstDataRef<SPropertyDefinition> GetProperties() const override
- {
- return m_PropertyDefinitions;
- }
- QT3DSU32 GetPropertySectionByteSize() const override { return m_PropertySectionByteSize; }
- const QT3DSU8 *GetDefaultValueBuffer() const override { return m_PropertyDefaultData; }
- QT3DSU32 GetBaseObjectSize() const override { return m_BaseObjectSize; }
- GraphObjectTypes::Enum GraphObjectType() const override { return m_GraphObjectType; }
- const SPropertyDefinition *FindDefinition(CRegisteredString &str) const
- {
- for (QT3DSU32 idx = 0, end = m_PropertyDefinitions.size(); idx < end; ++idx) {
- const SPropertyDefinition &def(m_PropertyDefinitions[idx]);
- if (def.m_Name == str)
- return &def;
- }
- return NULL;
- }
- const SPropertyDefinition *FindPropertyByName(CRegisteredString inName) const override
- {
- return FindDefinition(inName);
- }
- NVConstDataRef<dynamic::SCommand *> GetRenderCommands() const override
- {
- return m_RenderCommands;
- }
- bool RequiresDepthTexture() const override { return m_RequiresDepthTexture; }
- void SetRequiresDepthTexture(bool inVal) override { m_RequiresDepthTexture = inVal; }
- virtual bool RequiresCompilation() const override { return m_RequiresCompilation; }
- virtual void SetRequiresCompilation(bool inVal) override { m_RequiresCompilation = inVal; }
- NVRenderTextureFormats::Enum GetOutputTextureFormat() const override { return m_OutputFormat; }
-};
-
-struct SDataRemapper
-{
- template <typename TRemapper>
- void Remap(QT3DSU8 *inData, SPropertyDefinition &item, TRemapper &remapper)
- {
- switch (item.m_DataType) {
- default:
- break; // no remapping necessary
- case NVRenderShaderDataTypes::NVRenderTexture2DPtr:
- CRegisteredString *realData = reinterpret_cast<CRegisteredString *>(inData);
- remapper.Remap(*realData);
- break;
- }
- }
-};
-
-struct SShaderMapKey
-{
- TStrStrPair m_Name;
- eastl::vector<SShaderPreprocessorFeature> m_Features;
- TessModeValues::Enum m_TessMode;
- bool m_WireframeMode;
- size_t m_HashCode;
- SShaderMapKey(TStrStrPair inName, TShaderFeatureSet inFeatures, TessModeValues::Enum inTessMode,
- bool inWireframeMode)
- : m_Name(inName)
- , m_Features(inFeatures.begin(), inFeatures.end())
- , m_TessMode(inTessMode)
- , m_WireframeMode(inWireframeMode)
- {
- m_HashCode = eastl::hash<TStrStrPair>()(m_Name)
- ^ HashShaderFeatureSet(toDataRef(m_Features.data(), (QT3DSU32)m_Features.size()))
- ^ eastl::hash<QT3DSU32>()(m_TessMode) ^ eastl::hash<bool>()(m_WireframeMode);
- }
- bool operator==(const SShaderMapKey &inKey) const
- {
- return m_Name == inKey.m_Name && m_Features == inKey.m_Features
- && m_TessMode == inKey.m_TessMode && m_WireframeMode == inKey.m_WireframeMode;
- }
-};
-}
-
-namespace eastl {
-template <>
-struct hash<SShaderMapKey>
-{
- size_t operator()(const SShaderMapKey &inKey) const { return inKey.m_HashCode; }
-};
-}
-
-namespace {
-
-typedef nvhash_map<CRegisteredString, NVScopedRefCounted<SDynamicObjClassImpl>> TStringClassMap;
-typedef nvhash_map<CRegisteredString, char8_t *> TPathDataMap;
-typedef nvhash_map<CRegisteredString, SDynamicObjectShaderInfo> TShaderInfoMap;
-typedef nvhash_set<CRegisteredString> TPathSet;
-typedef nvhash_map<SShaderMapKey, TShaderAndFlags> TShaderMap;
-
-struct SDynamicObjectSystemCoreImpl : public IDynamicObjectSystem
-{
-};
-
-struct SDynamicObjectSystemImpl : public IDynamicObjectSystem
-{
- NVFoundationBase &m_Foundation;
- mutable qt3ds::render::SPreAllocatedAllocator m_Allocator;
- IQt3DSRenderContextCore &m_CoreContext;
- IQt3DSRenderContext *m_Context;
- TStringClassMap m_Classes;
- TPathDataMap m_ExpandedFiles;
- Qt3DSString m_ShaderKeyBuilder;
- TShaderMap m_ShaderMap;
- TShaderInfoMap m_ShaderInfoMap;
- Qt3DSString m_IncludePath;
- Qt3DSString m_IncludeSearch;
- Qt3DSString m_VertShader;
- Qt3DSString m_FragShader;
- Qt3DSString m_GeometryShader;
- QString m_shaderLibraryVersion;
- QString m_shaderLibraryPlatformDirectory;
- mutable Mutex m_PropertyLoadMutex;
- QT3DSI32 mRefCount;
-
- SDynamicObjectSystemImpl(IQt3DSRenderContextCore &inCore)
- : m_Foundation(inCore.GetFoundation())
- , m_Allocator(inCore.GetAllocator())
- , m_CoreContext(inCore)
- , m_Context(NULL)
- , m_Classes(inCore.GetAllocator(), "Classes")
- , m_ExpandedFiles(inCore.GetAllocator(), "ExpandedShaderFiles")
- , m_ShaderMap(inCore.GetAllocator(), "ShaderMap")
- , m_ShaderInfoMap(inCore.GetAllocator(), "ShaderInfoMap")
- , m_PropertyLoadMutex(inCore.GetAllocator())
- , mRefCount(0)
- {
- m_IncludeSearch = "#include \"";
- }
-
- virtual ~SDynamicObjectSystemImpl()
- {
- for (TPathDataMap::iterator iter = m_ExpandedFiles.begin(), end = m_ExpandedFiles.end();
- iter != end; ++iter)
- m_Allocator.deallocate(iter->second);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- bool IsRegistered(CRegisteredString inStr) override
- {
- return m_Classes.find(inStr) != m_Classes.end();
- }
-
- bool Register(CRegisteredString inName,
- NVConstDataRef<SPropertyDeclaration> inProperties, QT3DSU32 inBaseObjectSize,
- GraphObjectTypes::Enum inGraphObjectType) override
- {
- if (IsRegistered(inName)) {
- QT3DS_ASSERT(false);
- return false;
- }
- nvvector<SPropertyDefinition> definitions(m_Foundation.getAllocator(),
- "PropertyDefinitions");
- QT3DSU32 theCurrentOffset = 0;
- for (QT3DSU32 idx = 0, end = inProperties.size(); idx < end; ++idx) {
- const SPropertyDeclaration &thePropDec = inProperties[idx];
- CRegisteredString thePropName(
- m_CoreContext.GetStringTable().RegisterStr(thePropDec.m_Name));
- QT3DSU32 propSize = getSizeofShaderDataType(thePropDec.m_DataType);
- definitions.push_back(SPropertyDefinition(thePropName, thePropDec.m_DataType,
- theCurrentOffset, propSize));
- theCurrentOffset += propSize;
- theCurrentOffset = Align(theCurrentOffset);
- }
- QT3DSU32 dataSectionSize = theCurrentOffset;
- QT3DSU32 clsSize = Align(sizeof(SDynamicObjClassImpl));
- QT3DSU32 defSize = Align(sizeof(SPropertyDefinition) * inProperties.size());
- QT3DSU32 defaultSize = dataSectionSize;
- QT3DSU32 allocSize = clsSize + defSize + defaultSize;
- QT3DSU8 *allocData = reinterpret_cast<QT3DSU8 *>(
- m_Allocator.allocate(allocSize, "SDynamicObjClassImpl", __FILE__, __LINE__));
- QT3DSU8 *defData = allocData + clsSize;
- QT3DSU8 *defaultData = defData + defSize;
- SPropertyDefinition *defPtr = reinterpret_cast<SPropertyDefinition *>(defData);
- if (defSize)
- memCopy(defPtr, definitions.data(), defSize);
- if (defaultSize)
- memZero(defaultData, defaultSize);
- SDynamicObjClassImpl *theClass = new (allocData)
- SDynamicObjClassImpl(m_Allocator, inName, toDataRef(defPtr, inProperties.size()),
- dataSectionSize, inBaseObjectSize, inGraphObjectType, defaultData);
- m_Classes.insert(eastl::make_pair(inName, theClass));
- return true;
- }
-
- bool Unregister(CRegisteredString inName) override {
- if (!IsRegistered(inName)) {
- QT3DS_ASSERT(false);
- return false;
- }
- TStringClassMap::iterator iter = m_Classes.find(inName);
- if (iter != m_Classes.end())
- m_Classes.erase(iter);
- return true;
- }
-
- SDynamicObjClassImpl *FindClass(CRegisteredString inName)
- {
- TStringClassMap::iterator iter = m_Classes.find(inName);
- if (iter != m_Classes.end())
- return iter->second.mPtr;
- return NULL;
- }
-
- eastl::pair<const SPropertyDefinition *, SDynamicObjClassImpl *>
- FindProperty(CRegisteredString inName, CRegisteredString inPropName)
- {
- SDynamicObjClassImpl *cls = FindClass(inName);
- if (cls) {
- const SPropertyDefinition *def = cls->FindDefinition(inPropName);
- if (def)
- return eastl::make_pair(def, cls);
- }
- return eastl::pair<const SPropertyDefinition *, SDynamicObjClassImpl *>(NULL, NULL);
- }
-
- void SetPropertyDefaultValue(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<QT3DSU8> inDefaultData) override
- {
- eastl::pair<const SPropertyDefinition *, SDynamicObjClassImpl *> def =
- FindProperty(inName, inPropName);
- if (def.first && inDefaultData.size() >= def.first->m_ByteSize) {
- memCopy(def.second->m_PropertyDefaultData + def.first->m_Offset, inDefaultData.begin(),
- def.first->m_ByteSize);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void SetPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<CRegisteredString> inNames) override
- {
-
- eastl::pair<const SPropertyDefinition *, SDynamicObjClassImpl *> def =
- FindProperty(inName, inPropName);
- SPropertyDefinition *theDefinitionPtr = const_cast<SPropertyDefinition *>(def.first);
- if (theDefinitionPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- if (theDefinitionPtr->m_EnumValueNames.size()) {
- m_Foundation.getAllocator().deallocate(
- (void *)theDefinitionPtr->m_EnumValueNames.begin());
- theDefinitionPtr->m_EnumValueNames = NVConstDataRef<CRegisteredString>();
- }
- theDefinitionPtr->m_IsEnumProperty = true;
- if (inNames.size()) {
- CRegisteredString *theNameValues = (CRegisteredString *)m_Allocator.allocate(
- inNames.size() * sizeof(CRegisteredString), "PropertyEnumNames", __FILE__,
- __LINE__);
-
- memCopy(theNameValues, inNames.begin(), inNames.size() * sizeof(CRegisteredString));
- theDefinitionPtr->m_EnumValueNames =
- NVConstDataRef<CRegisteredString>(theNameValues, inNames.size());
- }
- }
-
- virtual NVConstDataRef<CRegisteredString>
- GetPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName) const override
- {
- eastl::pair<const SPropertyDefinition *, SDynamicObjClassImpl *> def =
- const_cast<SDynamicObjectSystemImpl &>(*this).FindProperty(inName, inPropName);
- if (def.first)
- return def.first->m_EnumValueNames;
- return NVConstDataRef<CRegisteredString>();
- }
-
- // Called during loading which is pretty heavily multithreaded.
- virtual NVConstDataRef<dynamic::SPropertyDefinition>
- GetProperties(CRegisteredString inName) const override
- {
- Mutex::ScopedLock __locker(m_PropertyLoadMutex);
- SDynamicObjClassImpl *cls = const_cast<SDynamicObjectSystemImpl &>(*this).FindClass(inName);
- if (cls)
- return cls->m_PropertyDefinitions;
- return NVConstDataRef<dynamic::SPropertyDefinition>();
- }
-
- void SetPropertyTextureSettings(CRegisteredString inName, CRegisteredString inPropName,
- CRegisteredString inPropPath,
- NVRenderTextureTypeValue::Enum inTexType,
- NVRenderTextureCoordOp::Enum inCoordOp,
- NVRenderTextureMagnifyingOp::Enum inMagFilterOp,
- NVRenderTextureMinifyingOp::Enum inMinFilterOp) override
- {
- eastl::pair<const SPropertyDefinition *, SDynamicObjClassImpl *> def =
- FindProperty(inName, inPropName);
- SPropertyDefinition *theDefinitionPtr = const_cast<SPropertyDefinition *>(def.first);
- if (theDefinitionPtr == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- theDefinitionPtr->m_ImagePath = inPropPath;
- theDefinitionPtr->m_TexUsageType = inTexType;
- theDefinitionPtr->m_CoordOp = inCoordOp;
- theDefinitionPtr->m_MagFilterOp = inMagFilterOp;
- theDefinitionPtr->m_MinFilterOp = inMinFilterOp;
- }
-
- IDynamicObjectClass *GetDynamicObjectClass(CRegisteredString inName) override
- {
- return FindClass(inName);
- }
-
- void SetRenderCommands(CRegisteredString inClassName,
- NVConstDataRef<dynamic::SCommand *> inCommands) override
- {
- SDynamicObjClassImpl *theClass =
- const_cast<SDynamicObjectSystemImpl &>(*this).FindClass(inClassName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- theClass->ReleaseCommands();
- QT3DSU32 commandAllocationSize = 0;
- for (QT3DSU32 idx = 0, end = inCommands.size(); idx < end; ++idx) {
- QT3DSU32 commandSize = Align(SCommand::GetSizeofCommand(*inCommands[idx]));
- commandAllocationSize += commandSize;
- }
- QT3DSU32 commandPtrSize = inCommands.size() * sizeof(SCommand *);
- QT3DSU32 totalAllocationSize = Align8(commandAllocationSize) + commandPtrSize;
- QT3DSU8 *theCommandDataBegin = (QT3DSU8 *)m_Allocator.allocate(
- totalAllocationSize, "dynamic::SCommand", __FILE__, __LINE__);
- QT3DSU8 *theCurrentCommandData(theCommandDataBegin);
- SCommand **theCommandPtrBegin =
- reinterpret_cast<SCommand **>(theCommandDataBegin + Align8(commandAllocationSize));
- SCommand **theCurrentCommandPtr = theCommandPtrBegin;
- memZero(theCommandDataBegin, totalAllocationSize);
-
- theClass->m_RequiresDepthTexture = false;
- for (QT3DSU32 idx = 0, end = inCommands.size(); idx < end; ++idx) {
- SCommand &theCommand(*inCommands[idx]);
- QT3DSU32 theCommandSize = SCommand::GetSizeofCommand(theCommand);
- SCommand::CopyConstructCommand(theCurrentCommandData, theCommand,
- m_CoreContext.GetStringTable());
- if (theCommand.m_Type == CommandTypes::ApplyDepthValue)
- theClass->m_RequiresDepthTexture = true;
- if (theCommand.m_Type == CommandTypes::BindTarget) {
- SBindTarget *bt = reinterpret_cast<SBindTarget *>(&theCommand);
- theClass->m_OutputFormat = bt->m_OutputFormat;
- }
-
- *theCurrentCommandPtr = reinterpret_cast<SCommand *>(theCurrentCommandData);
- ++theCurrentCommandPtr;
- theCurrentCommandData += Align(theCommandSize);
- }
- QT3DS_ASSERT(theCurrentCommandData - theCommandDataBegin == (int)commandAllocationSize);
- QT3DS_ASSERT((QT3DSU8 *)theCurrentCommandPtr - theCommandDataBegin == (int)totalAllocationSize);
- theClass->m_RenderCommands =
- NVConstDataRef<SCommand *>(theCommandPtrBegin, inCommands.size());
- }
-
- virtual NVConstDataRef<dynamic::SCommand *>
- GetRenderCommands(CRegisteredString inClassName) const override
- {
- SDynamicObjClassImpl *cls =
- const_cast<SDynamicObjectSystemImpl &>(*this).FindClass(inClassName);
- if (cls)
- return cls->m_RenderCommands;
- return NVConstDataRef<dynamic::SCommand *>();
- }
-
- SDynamicObject *CreateInstance(CRegisteredString inClassName,
- NVAllocatorCallback &inSceneGraphAllocator) override
- {
- SDynamicObjClassImpl *theClass = FindClass(inClassName);
- if (!theClass) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- QT3DSU32 totalObjectSize = theClass->m_BaseObjectSize + theClass->m_PropertySectionByteSize;
- SDynamicObject *retval = reinterpret_cast<SDynamicObject *>(inSceneGraphAllocator.allocate(
- totalObjectSize, inClassName.c_str(), __FILE__, __LINE__));
- new (retval)
- SDynamicObject(theClass->m_GraphObjectType, inClassName,
- theClass->m_PropertySectionByteSize, theClass->m_BaseObjectSize);
- memCopy(retval->GetDataSectionBegin(), theClass->m_PropertyDefaultData,
- theClass->m_PropertySectionByteSize);
- return retval;
- }
-
- void SetShaderData(CRegisteredString inPath, const char8_t *inData,
- const char8_t *inShaderType, const char8_t *inShaderVersion,
- bool inHasGeomShader, bool inIsComputeShader) override
- {
- inData = inData ? inData : "";
- eastl::pair<TPathDataMap::iterator, bool> theInserter =
- m_ExpandedFiles.insert(eastl::make_pair(inPath, (char8_t *)""));
- if (theInserter.second == false) {
- // Delete the existing entry.
- m_Allocator.deallocate(theInserter.first->second);
- }
- QT3DSU32 theLen = (QT3DSU32)strlen(inData) + 1;
- char8_t *newData = (char8_t *)m_Allocator.allocate(
- theLen, "SDynamicObjectSystem::SetShaderData", __FILE__, __LINE__);
- memCopy(newData, inData, theLen);
- theInserter.first->second = newData;
-
- // set shader type and version if available
- if (inShaderType || inShaderVersion || inHasGeomShader || inIsComputeShader) {
- // UdoL TODO: Add this to the load / save setction
- // In addition we should merge the source code into SDynamicObjectShaderInfo as well
- SDynamicObjectShaderInfo &theShaderInfo =
- m_ShaderInfoMap.insert(eastl::make_pair(inPath, SDynamicObjectShaderInfo()))
- .first->second;
- IStringTable &theStringTable(m_CoreContext.GetStringTable());
- theShaderInfo.m_Type = theStringTable.RegisterStr(nonNull(inShaderType));
- theShaderInfo.m_Version = theStringTable.RegisterStr(nonNull(inShaderVersion));
- theShaderInfo.m_HasGeomShader = inHasGeomShader;
- theShaderInfo.m_IsComputeShader = inIsComputeShader;
- }
-
- return;
- }
-
- CRegisteredString GetShaderCacheKey(const char8_t *inId, const char8_t *inProgramMacro,
- const dynamic::SDynamicShaderProgramFlags &inFlags)
- {
- m_ShaderKeyBuilder.assign(inId);
- if (inProgramMacro && *inProgramMacro) {
- m_ShaderKeyBuilder.append("#");
- m_ShaderKeyBuilder.append(inProgramMacro);
- }
- if (inFlags.IsTessellationEnabled()) {
- m_ShaderKeyBuilder.append("#");
- m_ShaderKeyBuilder.append(TessModeValues::toString(inFlags.m_TessMode));
- }
- if (inFlags.IsGeometryShaderEnabled() && inFlags.m_WireframeMode) {
- m_ShaderKeyBuilder.append("#");
- m_ShaderKeyBuilder.append(inFlags.wireframeToString(inFlags.m_WireframeMode));
- }
-
- return m_CoreContext.GetStringTable().RegisterStr(m_ShaderKeyBuilder.c_str());
- }
-
- void InsertShaderHeaderInformation(Qt3DSString &theReadBuffer,
- const char8_t *inPathToEffect) override
- {
- DoInsertShaderHeaderInformation(theReadBuffer, inPathToEffect);
- }
-
- void DoInsertShaderHeaderInformation(Qt3DSString &theReadBuffer,
- const char8_t *inPathToEffect)
- {
- // Now do search and replace for the headers
- for (Qt3DSString::size_type thePos = theReadBuffer.indexOf(m_IncludeSearch);
- thePos != Qt3DSString::npos;
- thePos = theReadBuffer.indexOf(m_IncludeSearch, thePos + 1)) {
- Qt3DSString::size_type theEndQuote =
- theReadBuffer.indexOf(QLatin1Char('\"'), thePos + m_IncludeSearch.size() + 1);
-
- // Indicates an unterminated include file.
- if (theEndQuote == Qt3DSString::npos) {
- qCCritical(INVALID_OPERATION, "Unterminated include in file: %s", inPathToEffect);
- theReadBuffer.clear();
- break;
- }
- Qt3DSString::size_type theActualBegin = thePos + m_IncludeSearch.size();
- Qt3DSString::iterator theIncludeBegin = theReadBuffer.begin() + theActualBegin;
- Qt3DSString::iterator theIncludeEnd = theReadBuffer.begin() + theEndQuote;
- m_IncludePath.clear();
- m_IncludePath.append(theIncludeBegin, theIncludeEnd);
- // If we haven't included the file yet this round
- Qt3DSString theIncludeBuffer;
- DoLoadShader(m_IncludePath.c_str(), theIncludeBuffer);
- theReadBuffer =
- theReadBuffer.replace(theReadBuffer.begin() + thePos,
- theReadBuffer.begin() + theEndQuote + 1,
- theIncludeBuffer);
- }
- }
-
- void DoLoadShader(const char8_t *inPathToEffect, Qt3DSString &outShaderData)
- {
- eastl::pair<TPathDataMap::iterator, bool> theInsert =
- m_ExpandedFiles.insert(eastl::make_pair(
- m_CoreContext.GetStringTable().RegisterStr(inPathToEffect), (char8_t *)""));
-
- if (theInsert.second) {
-
- const QString defaultDir = m_Context->GetDynamicObjectSystem()
- .GetShaderCodeLibraryDirectory();
- const QString platformDir = m_Context->GetDynamicObjectSystem()
- .shaderCodeLibraryPlatformDirectory();
-
- QString fullPath;
- NVScopedRefCounted<IRefCountedInputStream> theStream;
- if (!platformDir.isEmpty()) {
- QTextStream stream(&fullPath);
- stream << platformDir << QLatin1Char('/') << inPathToEffect;
- theStream = m_CoreContext.GetInputStreamFactory()
- .GetStreamForFile(fullPath.toLatin1().data());
- }
-
- if (theStream.mPtr == NULL) {
- fullPath.clear();
- QTextStream stream(&fullPath);
- stream << defaultDir << QLatin1Char('/') << inPathToEffect;
- theStream = m_CoreContext.GetInputStreamFactory()
- .GetStreamForFile(fullPath);
- if (theStream.mPtr == NULL) {
- fullPath.clear();
- QTextStream stream(&fullPath);
- stream << defaultDir << QLatin1Char('/') << inPathToEffect;
- theStream = m_CoreContext.GetInputStreamFactory()
- .GetStreamForFile(fullPath);
- }
- }
- if (theStream.mPtr != NULL) {
- QT3DSU8 readBuf[1024];
- QT3DSU32 amountRead = 0;
- do {
- amountRead = theStream->Read(NVDataRef<QT3DSU8>(readBuf, 1024));
- if (amountRead)
- outShaderData.append((const char8_t *)readBuf, amountRead);
- } while (amountRead);
- } else {
- qCCritical(INVALID_OPERATION, "Failed to find include file %s", inPathToEffect);
- QT3DS_ASSERT(false);
- }
- theInsert.first->second = (char8_t *)m_Allocator.allocate(
- outShaderData.size() + 1, "SDynamicObjectSystem::DoLoadShader", __FILE__, __LINE__);
- memCopy(theInsert.first->second, outShaderData.c_str(),
- QT3DSU32(outShaderData.size()) + 1);
- } else {
- outShaderData.assign(theInsert.first->second);
- }
-
- DoInsertShaderHeaderInformation(outShaderData, inPathToEffect);
- }
-
- void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap, const char8_t *inProjectDir) const override
- {
- QT3DSU32 startOffset = ioBuffer.size();
- ioBuffer.write((QT3DSU32)m_ExpandedFiles.size());
- for (TPathDataMap::const_iterator theIter = m_ExpandedFiles.begin();
- theIter != m_ExpandedFiles.end(); ++theIter) {
- CRegisteredString thePath(theIter->first);
- char8_t *theData = theIter->second;
- theData = theData ? theData : (char8_t *)"";
- QT3DSU32 theLen = (QT3DSU32)strlen(theData);
- thePath.Remap(inRemapMap);
- ioBuffer.write(thePath);
- ioBuffer.write(theLen + 1);
- ioBuffer.write(theData, theLen + 1);
- ioBuffer.align(sizeof(void *));
- }
- ioBuffer.write((QT3DSU32)m_Classes.size());
- SStringSaveRemapper theRemapper(m_Allocator, inRemapMap, inProjectDir,
- m_CoreContext.GetStringTable());
- for (TStringClassMap::const_iterator iter = m_Classes.begin(), end = m_Classes.end();
- iter != end; ++iter) {
- const SDynamicObjClassImpl *theClass = iter->second;
- ioBuffer.align(4);
- QT3DSU32 objOffset = ioBuffer.size();
- QT3DSU32 classOffset = objOffset - startOffset;
- (void)classOffset;
- QT3DSU32 defOffset = objOffset + sizeof(SDynamicObjClassImpl);
- QT3DSU32 dataOffset =
- defOffset + theClass->m_PropertyDefinitions.size() * sizeof(SPropertyDefinition);
- QT3DSU32 dataEnd = dataOffset + theClass->m_PropertySectionByteSize;
- QT3DSU32 writeAmount = dataEnd - objOffset;
- ioBuffer.write((const QT3DSU8 *)theClass, writeAmount);
- ioBuffer.align(4);
- QT3DSU32 cmdOffset = 0;
- QT3DSU8 *writeCommandStart = NULL;
- if (theClass->m_RenderCommands.size()) {
- // We know commands are allocated in a block.
- const SCommand &firstCommand = *theClass->m_RenderCommands[0];
- const QT3DSU8 *commandStart = reinterpret_cast<const QT3DSU8 *>(&firstCommand);
- const SCommand &lastCommand(
- *theClass->m_RenderCommands[theClass->m_RenderCommands.size() - 1]);
- const QT3DSU8 *commandEnd = reinterpret_cast<const QT3DSU8 *>(&lastCommand)
- + SCommand::GetSizeofCommand(lastCommand);
- cmdOffset = ioBuffer.size();
- ioBuffer.write(commandStart, (QT3DSU32)(commandEnd - commandStart));
- // Write location of the actual storage for the command ptr array.
- ioBuffer.writeZeros(theClass->m_RenderCommands.size() * sizeof(SCommand **));
- }
- ioBuffer.align(4);
- if (cmdOffset)
- writeCommandStart = ioBuffer.begin() + cmdOffset;
-
- SDynamicObjClassImpl *writeClass =
- (SDynamicObjClassImpl *)(ioBuffer.begin() + objOffset);
- writeClass->m_Id.Remap(inRemapMap);
- writeClass->SetupThisObjectFromMemory(m_Allocator, theRemapper, writeCommandStart,
- theClass->m_RenderCommands.size());
- for (QT3DSU32 idx = 0, end = theClass->m_PropertyDefinitions.size(); idx < end; ++idx) {
- // Moved into the loop because writing the enumerations may resize the data buffer.
- SPropertyDefinition *theDefinitions =
- (SPropertyDefinition *)(ioBuffer.begin() + defOffset);
- theDefinitions[idx].m_Name.Remap(inRemapMap);
- const SPropertyDefinition &theDefinition(theClass->m_PropertyDefinitions[idx]);
- if (theDefinitions[idx].m_EnumValueNames.size()) {
- QT3DSU32 enumOffset = ioBuffer.size();
- ioBuffer.write(theDefinition.m_EnumValueNames.begin(),
- theDefinition.m_EnumValueNames.size()
- * sizeof(CRegisteredString));
- CRegisteredString *strPtr =
- (CRegisteredString *)(ioBuffer.begin() + enumOffset);
- for (QT3DSU32 enumIdx = 0, enumEnd = theDefinition.m_EnumValueNames.size();
- enumIdx < enumEnd; ++enumIdx)
- strPtr[enumIdx].Remap(inRemapMap);
- }
- if (theDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- QT3DSU8 *theDataPtr = ioBuffer.begin() + dataOffset;
- CRegisteredString *realData =
- reinterpret_cast<CRegisteredString *>(theDataPtr + theDefinition.m_Offset);
- realData->Remap(inRemapMap);
- }
- }
- }
-
- // Write out meta information about the shader system
- QT3DSU32 numShaderInfos = (QT3DSU32)m_ShaderInfoMap.size();
- ioBuffer.write(numShaderInfos);
- for (TShaderInfoMap::const_iterator iter = m_ShaderInfoMap.begin(),
- end = m_ShaderInfoMap.end();
- iter != end; ++iter) {
- CRegisteredString infoName = iter->first;
- infoName.Remap(inRemapMap);
- ioBuffer.write(infoName);
- const SDynamicObjectShaderInfo &theInfo = iter->second;
- CRegisteredString infoType(theInfo.m_Type);
- CRegisteredString infoVersion(theInfo.m_Version);
- infoType.Remap(inRemapMap);
- infoVersion.Remap(inRemapMap);
- ioBuffer.write(infoType);
- ioBuffer.write(infoVersion);
- }
- }
-
- void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t *inProjectDir) override
- {
- m_Allocator.m_PreAllocatedBlock = inData;
- m_Allocator.m_OwnsMemory = false;
- TStr workspaceStr(ForwardingAllocator(m_Foundation.getAllocator(), "ProjPath"));
- qt3ds::render::SDataReader theReader(inData.begin(), inData.end());
- QT3DSU32 numMappedPaths = theReader.LoadRef<QT3DSU32>();
- for (QT3DSU32 idx = 0, end = numMappedPaths; idx < end; ++idx) {
- CRegisteredString theStr(theReader.LoadRef<CRegisteredString>());
- QT3DSU32 theCharLen = theReader.LoadRef<QT3DSU32>();
- char8_t *thePathData = reinterpret_cast<char8_t *>(theReader.m_CurrentPtr);
- theReader.m_CurrentPtr += theCharLen;
- theReader.Align();
- theStr.Remap(inStrDataBlock);
- m_ExpandedFiles.insert(eastl::make_pair(theStr, thePathData));
- }
- SStringLoadRemapper theRemapper(m_Allocator, inStrDataBlock, inProjectDir,
- m_CoreContext.GetStringTable());
- QT3DSU32 numClasses = theReader.LoadRef<QT3DSU32>();
- for (QT3DSU32 idx = 0, end = numClasses; idx < end; ++idx) {
- theReader.Align(4);
- size_t classOffset = static_cast<QT3DSU32>(theReader.m_CurrentPtr - inData.mData);
- (void)classOffset;
- SDynamicObjClassImpl *theClass = (SDynamicObjClassImpl *)theReader.m_CurrentPtr;
- theClass->m_Allocator = &m_Allocator;
- theReader.m_CurrentPtr += sizeof(SDynamicObjClassImpl);
- SPropertyDefinition *theDefinitions = (SPropertyDefinition *)theReader.m_CurrentPtr;
- theReader.m_CurrentPtr +=
- theClass->m_PropertyDefinitions.size() * sizeof(SPropertyDefinition);
- QT3DSU8 *theDataBuffer = theReader.m_CurrentPtr;
- theReader.m_CurrentPtr += theClass->m_PropertySectionByteSize;
- theClass->m_Id.Remap(inStrDataBlock);
- theClass->m_PropertyDefinitions = NVConstDataRef<SPropertyDefinition>(
- theDefinitions, theClass->m_PropertyDefinitions.size());
- theClass->m_PropertyDefaultData = theDataBuffer;
- theReader.Align(4);
- QT3DSU8 *theCommandStart = theReader.m_CurrentPtr;
-
- QT3DSU32 numRenderCommands = theClass->m_RenderCommands.size();
- new (theClass) SDynamicObjClassImpl(
- m_Allocator, theClass->m_Id, theClass->m_PropertyDefinitions,
- theClass->m_PropertySectionByteSize, theClass->m_BaseObjectSize,
- theClass->m_GraphObjectType, theClass->m_PropertyDefaultData,
- theClass->m_RequiresDepthTexture, theClass->m_OutputFormat);
-
- theClass->SetupThisObjectFromMemory(m_Allocator, theRemapper, theCommandStart,
- numRenderCommands);
-
- if (theClass->m_RenderCommands.size()) {
- const SCommand &theLastCommand =
- *theClass->m_RenderCommands[theClass->m_RenderCommands.size() - 1];
- const QT3DSU8 *theCommandEnd = reinterpret_cast<const QT3DSU8 *>(&theLastCommand)
- + SCommand::GetSizeofCommand(theLastCommand);
- theReader.m_CurrentPtr = const_cast<QT3DSU8 *>(theCommandEnd);
- theReader.m_CurrentPtr += theClass->m_RenderCommands.size() * sizeof(SCommand **);
- }
- theReader.Align(4);
-
- for (QT3DSU32 defIdx = 0, defEnd = theClass->m_PropertyDefinitions.size(); defIdx < defEnd;
- ++defIdx) {
- SPropertyDefinition &theDef(theDefinitions[defIdx]);
- theDef.m_Name.Remap(inStrDataBlock);
- if (theDef.m_EnumValueNames.size()) {
- CRegisteredString *theNames = (CRegisteredString *)theReader.m_CurrentPtr;
- theReader.m_CurrentPtr +=
- theDef.m_EnumValueNames.size() * sizeof(CRegisteredString);
- theDef.m_EnumValueNames =
- NVDataRef<CRegisteredString>(theNames, theDef.m_EnumValueNames.size());
- for (QT3DSU32 enumIdx = 0, enumEnd = theDef.m_EnumValueNames.size();
- enumIdx < enumEnd; ++enumIdx)
- theNames[enumIdx].Remap(inStrDataBlock);
- }
- if (theDef.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- CRegisteredString *realData =
- reinterpret_cast<CRegisteredString *>(theDataBuffer + theDef.m_Offset);
- realData->Remap(inStrDataBlock);
- }
- }
- m_Classes.insert(eastl::make_pair(theClass->m_Id, theClass));
- }
- QT3DSU32 theNumShaderInfos = theReader.LoadRef<QT3DSU32>();
- for (QT3DSU32 idx = 0, end = theNumShaderInfos; idx < end; ++idx) {
- CRegisteredString name, type, version;
- name = theReader.LoadRef<CRegisteredString>();
- type = theReader.LoadRef<CRegisteredString>();
- version = theReader.LoadRef<CRegisteredString>();
- name.Remap(inStrDataBlock);
- type.Remap(inStrDataBlock);
- version.Remap(inStrDataBlock);
- SDynamicObjectShaderInfo &theInfo =
- m_ShaderInfoMap.insert(eastl::make_pair(name, SDynamicObjectShaderInfo()))
- .first->second;
- theInfo.m_Type = type;
- theInfo.m_Version = version;
- }
- }
-
- IDynamicObjectSystem &CreateDynamicSystem(IQt3DSRenderContext &rc) override
- {
- m_Context = &rc;
- return *this;
- }
-
- QStringList getParameters(const QString &str, int begin, int end)
- {
- const QString s = str.mid(begin, end - begin + 1);
- return s.split(",");
- }
-
- void insertSnapperDirectives(QString &str)
- {
- int beginIndex = 0;
- // Snapper macros:
- // #define SNAPPER_SAMPLER2D(propName, propNiceName, texFilter, texWrap, showUI ) \
- // uniform sampler2D propName; \
- // uniform int flag##propName; \
- // uniform vec4 propName##Info; \
- // vec4 texture2D_##propName(vec2 uv) \
- // { \
- // return GetTextureValue( propName, uv, propName##Info.z ); \
- // }
- //
- // #define SNAPPER_SAMPLER2DWITHDEFAULT(propName, propNiceName, texFilter, texWrap, defaultPath, showUI ) \
- // SNAPPER_SAMPLER2D( propName, propNiceName, texFilter, texWrap, showUI )
- //
- // #define SNAPPER_SAMPLERCUBE(propName, propNiceName, texFilter, texWrap ) \
- // uniform samplerCube propName; \
- // uniform vec2 propName##UVRange; \
- // uniform int flag##propName; \
- // uniform vec2 propName##Size;
- QString snapperSampler = QStringLiteral("SNAPPER_SAMPLER2D(");
- QString snapperSamplerDefault = QStringLiteral("SNAPPER_SAMPLER2DWITHDEFAULT(");
- QString snapperSamplerCube = QStringLiteral("SNAPPER_SAMPLERCUBE(");
- QString endingBracket = QStringLiteral(")");
-
- while ((beginIndex = str.indexOf(snapperSampler, beginIndex)) >= 0) {
- int endIndex = str.indexOf(endingBracket, beginIndex);
- const QStringList list = getParameters(str, beginIndex + snapperSampler.length(),
- endIndex);
- str.remove(beginIndex, endIndex - beginIndex + 1);
- if (list.size() == 5) {
- QString insertStr;
- QTextStream stream(&insertStr);
- stream << "uniform sampler2D " << list[0] << ";\n";
- stream << "uniform int flag" << list[0] << ";\n";
- stream << "vec4 " << list[0] << "Info;\n";
- stream << "vec4 texture2D_" << list[0] << "(vec2 uv) "
- << "{ return GetTextureValue( " << list[0] << ", uv, "
- << list[0] <<"Info.z ); }\n";
- str.insert(beginIndex, insertStr);
- }
- }
- beginIndex = 0;
- while ((beginIndex = str.indexOf(snapperSamplerDefault, beginIndex)) >= 0) {
- int endIndex = str.indexOf(endingBracket, beginIndex);
- const QStringList list = getParameters(str, beginIndex + snapperSamplerDefault.length(),
- endIndex);
- str.remove(beginIndex, endIndex - beginIndex + 1);
- if (list.size() == 5) {
- QString insertStr;
- QTextStream stream(&insertStr);
- stream << "uniform sampler2D " << list[0] << ";\n";
- stream << "uniform int flag" << list[0] << ";\n";
- stream << "vec4 " << list[0] << "Info;\n";
- stream << "vec4 texture2D_" << list[0] << "(vec2 uv) "
- << "{ return GetTextureValue( " << list[0] << ", uv, "
- << list[0] <<"Info.z ); }\n";
- str.insert(beginIndex, insertStr);
- }
- }
- beginIndex = 0;
- while ((beginIndex = str.indexOf(snapperSamplerCube, beginIndex)) >= 0) {
- int endIndex = str.indexOf(endingBracket, beginIndex);
- const QStringList list = getParameters(str, beginIndex + snapperSamplerCube.length(),
- endIndex);
- str.remove(beginIndex, endIndex - beginIndex + 1);
- if (list.size() == 4) {
- QString insertStr;
- QTextStream stream(&insertStr);
- stream << "uniform samplerCube " << list[0] << ";\n";
- stream << "uniform vec2 "<< list[0] << "UVRange;\n";
- stream << "uniform int flag" << list[0] << ";\n";
- stream << "uniform vec2 "<< list[0] << "Size;\n";
- str.insert(beginIndex, insertStr);
- }
- }
- }
-
- NVRenderShaderProgram *CompileShader(CRegisteredString inId, const char8_t *inProgramSource,
- const char8_t *inGeomSource,
- CRegisteredString inProgramMacroName,
- TShaderFeatureSet inFeatureSet,
- const dynamic::SDynamicShaderProgramFlags &inFlags,
- bool inForceCompilation = false)
- {
- m_VertShader.clear();
- m_FragShader.clear();
- m_GeometryShader.clear();
- SShaderCacheProgramFlags theFlags;
-
- m_VertShader.append("#define VERTEX_SHADER\n");
- m_FragShader.append("#define FRAGMENT_SHADER\n");
-
- if (inProgramMacroName.IsValid()) {
- m_VertShader.append("#define ");
- m_VertShader.append(inProgramMacroName.c_str());
- m_VertShader.append("\n");
-
- m_FragShader.append("#define ");
- m_FragShader.append(inProgramMacroName.c_str());
- m_FragShader.append("\n");
- }
-
- if (inGeomSource && inFlags.IsGeometryShaderEnabled()) {
- theFlags.SetGeometryShaderEnabled(true);
-
- m_GeometryShader.append("#define GEOMETRY_SHADER 1\n");
- m_GeometryShader.append(inGeomSource);
-
- m_VertShader.append("#define GEOMETRY_SHADER 1\n");
- } else if (inFlags.IsGeometryShaderEnabled()) {
- theFlags.SetGeometryShaderEnabled(true);
- m_GeometryShader.append("#define USER_GEOMETRY_SHADER 1\n");
- m_GeometryShader.append(inProgramSource);
- m_VertShader.append("#define GEOMETRY_SHADER 0\n");
- m_FragShader.append("#define GEOMETRY_WIREFRAME_SHADER 0\n");
- } else {
- m_VertShader.append("#define GEOMETRY_SHADER 0\n");
- m_FragShader.append("#define GEOMETRY_WIREFRAME_SHADER 0\n");
- }
-
- if (strstr(inProgramSource, "SNAPPER_SAMPLER")) {
- QString programSource(inProgramSource);
- insertSnapperDirectives(programSource);
- QByteArray data = programSource.toLatin1();
- const char *source = data.constData();
-
- m_VertShader.append(source);
- m_FragShader.append(source);
- } else {
- m_VertShader.append(inProgramSource);
- m_FragShader.append(inProgramSource);
- }
-
- IShaderCache &theShaderCache = m_Context->GetShaderCache();
-
- CRegisteredString theKey = m_Context->GetStringTable().RegisterStr(
- GetShaderCacheKey(inId, inProgramMacroName, inFlags));
-
- if (inForceCompilation) {
- return theShaderCache.ForceCompileProgram(theKey, m_VertShader.c_str(),
- m_FragShader.c_str(), NULL, NULL,
- m_GeometryShader.c_str(), theFlags,
- inFeatureSet, false);
- }
- return theShaderCache.CompileProgram(theKey, m_VertShader.c_str(), m_FragShader.c_str(),
- NULL, NULL, m_GeometryShader.c_str(), theFlags,
- inFeatureSet);
- }
-
- // This just returns the custom material shader source without compiling
- void GetShaderSource(CRegisteredString inPath, Qt3DSString &outBuffer) override
- {
- outBuffer.clear();
- outBuffer.append("#define FRAGMENT_SHADER\n");
-
- Qt3DSString source;
- DoLoadShader(inPath, outBuffer);
- }
-
- TShaderAndFlags GetShaderProgram(CRegisteredString inPath,
- CRegisteredString inProgramMacro,
- TShaderFeatureSet inFeatureSet,
- const SDynamicShaderProgramFlags &inFlags,
- bool inForceCompilation) override
- {
- eastl::pair<const SShaderMapKey, TShaderAndFlags> theInserter(
- SShaderMapKey(TStrStrPair(inPath, inProgramMacro), inFeatureSet, inFlags.m_TessMode,
- inFlags.m_WireframeMode),
- TShaderAndFlags());
- eastl::pair<TShaderMap::iterator, bool> theInsertResult(m_ShaderMap.insert(theInserter));
- if (theInsertResult.second || inForceCompilation) {
- NVRenderShaderProgram *theProgram = m_Context->GetShaderCache().GetProgram(
- GetShaderCacheKey(inPath, inProgramMacro, inFlags), inFeatureSet);
- SDynamicShaderProgramFlags theFlags(inFlags);
- if (!theProgram || inForceCompilation) {
- SDynamicObjectShaderInfo &theShaderInfo =
- m_ShaderInfoMap.insert(eastl::make_pair(inPath, SDynamicObjectShaderInfo()))
- .first->second;
- if (theShaderInfo.m_IsComputeShader == false) {
- Qt3DSString theShaderBuffer;
- DoLoadShader(inPath, theShaderBuffer);
- if (theShaderInfo.m_HasGeomShader)
- theFlags.SetGeometryShaderEnabled(true);
- theProgram = CompileShader(inPath, theShaderBuffer.c_str(), NULL, inProgramMacro,
- inFeatureSet, theFlags, inForceCompilation);
- } else {
- Qt3DSString theShaderBuffer;
- const char8_t *shaderVersionStr = "#version 430\n";
- if ((QT3DSU32)m_Context->GetRenderContext().GetRenderContextType()
- == NVRenderContextValues::GLES3PLUS)
- shaderVersionStr = "#version 310 es\n";
- DoLoadShader(inPath, theShaderBuffer);
- theShaderBuffer.insert(0, shaderVersionStr);
- const char8_t *programSource = theShaderBuffer.c_str();
- QT3DSU32 len = (QT3DSU32)strlen(nonNull(programSource)) + 1;
- theProgram =
- m_Context->GetRenderContext()
- .CompileComputeSource(inPath.c_str(),
- NVConstDataRef<QT3DSI8>((QT3DSI8 *)programSource, len))
- .mShader;
- }
- }
- theInsertResult.first->second = TShaderAndFlags(theProgram, theFlags);
- }
- return theInsertResult.first->second;
- }
-
- TShaderAndFlags GetDepthPrepassShader(CRegisteredString inPath,
- CRegisteredString inPMacro,
- TShaderFeatureSet inFeatureSet) override
- {
- SDynamicObjectShaderInfo &theShaderInfo =
- m_ShaderInfoMap.insert(eastl::make_pair(inPath, SDynamicObjectShaderInfo()))
- .first->second;
- if (theShaderInfo.m_HasGeomShader == false)
- return TShaderAndFlags();
- // else, here we go...
- SDynamicShaderProgramFlags theFlags;
- m_ShaderKeyBuilder.assign(inPMacro.c_str());
- m_ShaderKeyBuilder.append("depthprepass");
-
- CRegisteredString theProgramMacro =
- m_Context->GetStringTable().RegisterStr(m_ShaderKeyBuilder.c_str());
-
- eastl::pair<const SShaderMapKey, TShaderAndFlags> theInserter(
- SShaderMapKey(TStrStrPair(inPath, theProgramMacro), inFeatureSet, theFlags.m_TessMode,
- theFlags.m_WireframeMode),
- TShaderAndFlags());
- eastl::pair<TShaderMap::iterator, bool> theInsertResult(m_ShaderMap.insert(theInserter));
- if (theInsertResult.second) {
- NVRenderShaderProgram *theProgram = m_Context->GetShaderCache().GetProgram(
- GetShaderCacheKey(inPath, theProgramMacro, theFlags), inFeatureSet);
- SDynamicShaderProgramFlags flags(theFlags);
- if (!theProgram) {
- Qt3DSString theShaderBuffer;
- DoLoadShader(inPath, theShaderBuffer);
- SShaderVertexCodeGenerator vertexShader(
- m_Context->GetStringTable(), m_Allocator,
- m_Context->GetRenderContext().GetRenderContextType());
- SShaderFragmentCodeGenerator fragmentShader(
- vertexShader, m_Allocator,
- m_Context->GetRenderContext().GetRenderContextType());
-
- vertexShader.AddAttribute("attr_pos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfragOutput = vec4(0.0, 0.0, 0.0, 0.0);");
- fragmentShader.Append("}");
- const char8_t *vertexSource = vertexShader.BuildShaderSource();
- const char8_t *fragmentSource = fragmentShader.BuildShaderSource();
-
- Qt3DSString programBuffer;
- programBuffer.assign("#ifdef VERTEX_SHADER\n");
- programBuffer.append(vertexSource);
- programBuffer.append("\n#endif\n");
- programBuffer.append("\n#ifdef FRAGMENT_SHADER\n");
- programBuffer.append(fragmentSource);
- programBuffer.append("\n#endif");
- flags.SetGeometryShaderEnabled(true);
- theProgram = CompileShader(inPath, programBuffer.c_str(), theShaderBuffer.c_str(),
- theProgramMacro, inFeatureSet, flags);
- }
- theInsertResult.first->second = TShaderAndFlags(theProgram, flags);
- }
- return theInsertResult.first->second;
- }
-
- virtual void setShaderCodeLibraryPlatformDirectory(const QString &directory) override
- {
- m_shaderLibraryPlatformDirectory = directory;
- }
-
- virtual QString shaderCodeLibraryPlatformDirectory() override
- {
- return m_shaderLibraryPlatformDirectory;
- }
-};
-}
-
-IDynamicObjectSystemCore &
-IDynamicObjectSystemCore::CreateDynamicSystemCore(IQt3DSRenderContextCore &rc)
-{
- return *QT3DS_NEW(rc.GetAllocator(), SDynamicObjectSystemImpl)(rc);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.h
deleted file mode 100644
index cfe022ee..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystem.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DYNAMIC_OBJECT_SYSTEM_H
-#define QT3DS_RENDER_DYNAMIC_OBJECT_SYSTEM_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSVec2.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderTessModeValues.h"
-#include "Qt3DSRenderGraphObjectTypes.h"
-#include "EASTL/utility.h"
-
-#include <QtCore/qstring.h>
-
-namespace qt3ds {
-namespace render {
- struct SDynamicObject;
-
- namespace dynamic {
-
- struct SCommand;
-
- struct SPropertyDeclaration
- {
- const char8_t *m_Name;
- // The datatypes map directly to the obvious types *except*
- // for NVRenderTexture2DPtr. This type will be interpreted as a
- // CRegisteredString (they are the same binary size)
- // and will be used to lookup the texture from the buffer manager.
- NVRenderShaderDataTypes::Enum m_DataType;
-
- SPropertyDeclaration(const char8_t *inName, NVRenderShaderDataTypes::Enum inDtype)
- : m_Name(inName)
- , m_DataType(inDtype)
- {
- }
- SPropertyDeclaration()
- : m_Name("")
- , m_DataType(NVRenderShaderDataTypes::Unknown)
- {
- }
- };
-
- struct SPropertyDefinition
- {
- CRegisteredString m_Name;
-
- //*not* relative to the presentation directory
- CRegisteredString m_ImagePath;
- // The datatypes map directly to the obvious types *except*
- // for NVRenderTexture2DPtr. This type will be interpreted as a
- // CRegisteredString and will be used to lookup the texture
- // from the buffer manager.
- NVRenderShaderDataTypes::Enum m_DataType;
- // All offsets are relative to the beginning of the SEffect
- // and are aligned to 4 byte boundaries.
- QT3DSU32 m_Offset;
- // Sizeof this datatype.
- QT3DSU32 m_ByteSize;
- NVConstDataRef<CRegisteredString> m_EnumValueNames;
-
- NVRenderTextureTypeValue::Enum
- m_TexUsageType; ///< texture usage type like diffuse, specular, ...
- // Applies to both s,t
- NVRenderTextureCoordOp::Enum m_CoordOp;
- // Set mag Filter
- NVRenderTextureMagnifyingOp::Enum m_MagFilterOp;
- // Set min Filter
- NVRenderTextureMinifyingOp::Enum m_MinFilterOp;
- bool m_IsEnumProperty;
- SPropertyDefinition()
- : m_DataType(NVRenderShaderDataTypes::Unknown)
- , m_Offset(0)
- , m_ByteSize(0)
- , m_TexUsageType(NVRenderTextureTypeValue::Unknown)
- , m_CoordOp(NVRenderTextureCoordOp::ClampToEdge)
- , m_MagFilterOp(NVRenderTextureMagnifyingOp::Linear)
- , m_MinFilterOp(NVRenderTextureMinifyingOp::Linear)
- , m_IsEnumProperty(false)
- {
- }
- SPropertyDefinition(CRegisteredString inName, NVRenderShaderDataTypes::Enum inType,
- QT3DSU32 inOffset, QT3DSU32 inByteSize)
- : m_Name(inName)
- , m_DataType(inType)
- , m_Offset(inOffset)
- , m_ByteSize(inByteSize)
- , m_TexUsageType(NVRenderTextureTypeValue::Unknown)
- , m_CoordOp(NVRenderTextureCoordOp::ClampToEdge)
- , m_MagFilterOp(NVRenderTextureMagnifyingOp::Linear)
- , m_MinFilterOp(NVRenderTextureMinifyingOp::Linear)
- , m_IsEnumProperty(false)
- {
- }
- };
-
- struct SDynamicShaderProgramFlags : public SShaderCacheProgramFlags
- {
- TessModeValues::Enum m_TessMode;
- bool m_WireframeMode;
-
- SDynamicShaderProgramFlags()
- : m_TessMode(TessModeValues::NoTess)
- , m_WireframeMode(false)
- {
- }
-
- SDynamicShaderProgramFlags(TessModeValues::Enum inTessMode, bool inWireframeMode)
- : m_TessMode(inTessMode)
- , m_WireframeMode(inWireframeMode)
- {
- }
-
- static const char *wireframeToString(bool inEnable)
- {
- if (inEnable)
- return "wireframeMode:true";
- else
- return "wireframeMode:false";
- }
- };
- }
-
- class IDynamicObjectClass
- {
- protected:
- virtual ~IDynamicObjectClass() {}
- public:
- virtual CRegisteredString GetId() const = 0;
- virtual NVConstDataRef<dynamic::SPropertyDefinition> GetProperties() const = 0;
- virtual QT3DSU32 GetPropertySectionByteSize() const = 0;
- virtual const QT3DSU8 *GetDefaultValueBuffer() const = 0;
- virtual QT3DSU32 GetBaseObjectSize() const = 0;
- virtual GraphObjectTypes::Enum GraphObjectType() const = 0;
- virtual const dynamic::SPropertyDefinition *
- FindPropertyByName(CRegisteredString inName) const = 0;
- virtual NVConstDataRef<dynamic::SCommand *> GetRenderCommands() const = 0;
- virtual bool RequiresDepthTexture() const = 0;
- virtual void SetRequiresDepthTexture(bool inRequires) = 0;
- virtual bool RequiresCompilation() const = 0;
- virtual void SetRequiresCompilation(bool inRequires) = 0;
- virtual NVRenderTextureFormats::Enum GetOutputTextureFormat() const = 0;
- };
-
- class IDynamicObjectSystemCore : public NVRefCounted
- {
- protected:
- virtual ~IDynamicObjectSystemCore() {}
- public:
- virtual bool IsRegistered(CRegisteredString inStr) = 0;
-
- virtual bool Register(CRegisteredString inName,
- NVConstDataRef<dynamic::SPropertyDeclaration> inProperties,
- QT3DSU32 inBaseObjectSize, GraphObjectTypes::Enum inGraphObjectType) = 0;
-
- virtual bool Unregister(CRegisteredString inName) = 0;
-
- // Set the default value. THis is unnecessary if the default is zero as that is what it is
- // assumed to be.
- virtual void SetPropertyDefaultValue(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<QT3DSU8> inDefaultData) = 0;
-
- virtual void SetPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<CRegisteredString> inNames) = 0;
-
- virtual NVConstDataRef<CRegisteredString>
- GetPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName) const = 0;
-
- virtual NVConstDataRef<dynamic::SPropertyDefinition>
- GetProperties(CRegisteredString inName) const = 0;
-
- virtual void SetPropertyTextureSettings(CRegisteredString inName,
- CRegisteredString inPropName,
- CRegisteredString inPropPath,
- NVRenderTextureTypeValue::Enum inTexType,
- NVRenderTextureCoordOp::Enum inCoordOp,
- NVRenderTextureMagnifyingOp::Enum inMagFilterOp,
- NVRenderTextureMinifyingOp::Enum inMinFilterOp) = 0;
-
- virtual IDynamicObjectClass *GetDynamicObjectClass(CRegisteredString inName) = 0;
-
- // The effect commands are the actual commands that run for a given effect. The tell the
- // system exactly
- // explicitly things like bind this shader, bind this render target, apply this property,
- // run this shader
- // See UICRenderEffectCommands.h for the list of commands.
- // These commands are copied into the effect.
- virtual void SetRenderCommands(CRegisteredString inClassName,
- NVConstDataRef<dynamic::SCommand *> inCommands) = 0;
- virtual NVConstDataRef<dynamic::SCommand *>
- GetRenderCommands(CRegisteredString inClassName) const = 0;
-
- virtual SDynamicObject *CreateInstance(CRegisteredString inClassName,
- NVAllocatorCallback &inSceneGraphAllocator) = 0;
-
- // scan shader for #includes and insert any found"
- virtual void InsertShaderHeaderInformation(Qt3DSString &inShader,
- const char *inLogPath) = 0;
-
- // Set the shader data for a given path. Used when a path doesn't correspond to a file but
- // the data has been
- // auto-generated. The system will look for data under this path key during the BindShader
- // effect command.
- virtual void SetShaderData(CRegisteredString inPath, const char8_t *inData,
- const char8_t *inShaderType = NULL,
- const char8_t *inShaderVersion = NULL,
- bool inHasGeomShader = false,
- bool inIsComputeShader = false) = 0;
-
- // Overall save functions for saving the class information out to the binary file.
- virtual void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap,
- const char8_t *inProjectDir) const = 0;
- virtual void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t *inProjectDir) = 0;
-
- virtual IDynamicObjectSystem &CreateDynamicSystem(IQt3DSRenderContext &rc) = 0;
-
- static IDynamicObjectSystemCore &CreateDynamicSystemCore(IQt3DSRenderContextCore &rc);
- };
-
- typedef eastl::pair<NVScopedRefCounted<NVRenderShaderProgram>,
- dynamic::SDynamicShaderProgramFlags>
- TShaderAndFlags;
-
- class IDynamicObjectSystem : public IDynamicObjectSystemCore
- {
- protected:
- virtual ~IDynamicObjectSystem() {}
-
- public:
- virtual TShaderAndFlags
- GetShaderProgram(CRegisteredString inPath, CRegisteredString inProgramMacro,
- TShaderFeatureSet inFeatureSet,
- const dynamic::SDynamicShaderProgramFlags &inFlags,
- bool inForceCompilation = false) = 0;
-
- virtual void GetShaderSource(CRegisteredString inPath, Qt3DSString &outSource) = 0;
-
- // Will return null in the case where a custom prepass shader isn't needed for this object
- // If no geom shader, then no depth prepass shader.
- virtual TShaderAndFlags GetDepthPrepassShader(CRegisteredString inPath,
- CRegisteredString inProgramMacro,
- TShaderFeatureSet inFeatureSet) = 0;
-
- virtual void setShaderCodeLibraryPlatformDirectory(const QString &directory) = 0;
- virtual QString shaderCodeLibraryPlatformDirectory() = 0;
-
- static QString GetShaderCodeLibraryDirectory() { return QStringLiteral("res/effectlib"); }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemCommands.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemCommands.h
deleted file mode 100644
index 857dfa97..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemCommands.h
+++ /dev/null
@@ -1,622 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_EFFECT_SYSTEM_COMMANDS_H
-#define QT3DS_RENDER_EFFECT_SYSTEM_COMMANDS_H
-#include "Qt3DSRender.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSFlags.h"
-
-namespace qt3ds {
-namespace render {
- namespace dynamic {
- using qt3ds::render::NVRenderBufferBarrierFlags;
-
- struct CommandTypes
- {
- enum Enum {
- Unknown = 0,
- AllocateBuffer,
- BindTarget,
- BindBuffer,
- BindShader,
- ApplyInstanceValue,
- ApplyBufferValue,
- // Apply the depth buffer as an input texture.
- ApplyDepthValue,
- Render, // Render to current FBO
- ApplyBlending,
- ApplyRenderState, // apply a render state
- ApplyBlitFramebuffer,
- ApplyValue,
- DepthStencil,
- AllocateImage,
- ApplyImageValue,
- AllocateDataBuffer,
- ApplyDataBufferValue,
- };
- };
-
-#define QT3DS_RENDER_EFFECTS_ITERATE_COMMAND_TYPES \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(AllocateBuffer) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(BindTarget) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(BindBuffer) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(BindShader) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyInstanceValue) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyBufferValue) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyDepthValue) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(Render) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyBlending) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyRenderState) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyBlitFramebuffer) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyValue) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(DepthStencil) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(AllocateImage) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyImageValue) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(AllocateDataBuffer) \
- QT3DS_RENDER_EFFECTS_HANDLE_COMMAND_TYPES(ApplyDataBufferValue)
-
- // All commands need at least two constructors. One for when they are created that should
- // setup all their member variables and one for when we are copying commands from an outside
- // entity into the effect system. We have to re-register strings in that case because we
- // can't assume the outside entity was using the same string table we are...
- struct SCommand
- {
- CommandTypes::Enum m_Type;
- SCommand(CommandTypes::Enum inType)
- : m_Type(inType)
- {
- }
- SCommand()
- : m_Type(CommandTypes::Unknown)
- {
- }
- // Implemented in UICRenderEffectSystem.cpp
- static QT3DSU32 GetSizeofCommand(const SCommand &inCommand);
- static void CopyConstructCommand(QT3DSU8 *inDataBuffer, const SCommand &inCommand,
- IStringTable &inStrTable);
- };
-
- struct AllocateBufferFlagValues
- {
- enum Enum {
- SceneLifetime = 1,
- };
- };
-
- struct SAllocateBufferFlags : public NVFlags<AllocateBufferFlagValues::Enum, QT3DSU32>
- {
- SAllocateBufferFlags(QT3DSU32 inValues)
- : NVFlags<AllocateBufferFlagValues::Enum, QT3DSU32>(inValues)
- {
- }
- SAllocateBufferFlags() {}
- void SetSceneLifetime(bool inValue)
- {
- clearOrSet(inValue, AllocateBufferFlagValues::SceneLifetime);
- }
- // If isSceneLifetime is unset the buffer is assumed to be frame lifetime and will be
- // released after this render operation.
- bool IsSceneLifetime() const
- {
- return this->operator&(AllocateBufferFlagValues::SceneLifetime);
- }
- };
-
- struct SAllocateBuffer : public SCommand
- {
- CRegisteredString m_Name;
- NVRenderTextureFormats::Enum m_Format;
- NVRenderTextureMagnifyingOp::Enum m_FilterOp;
- NVRenderTextureCoordOp::Enum m_TexCoordOp;
- QT3DSF32 m_SizeMultiplier;
- SAllocateBufferFlags m_BufferFlags;
- SAllocateBuffer()
- : SCommand(CommandTypes::AllocateBuffer)
- , m_Format(NVRenderTextureFormats::RGBA8)
- , m_FilterOp(NVRenderTextureMagnifyingOp::Linear)
- , m_TexCoordOp(NVRenderTextureCoordOp::ClampToEdge)
- , m_SizeMultiplier(1.0f)
- {
- }
- SAllocateBuffer(CRegisteredString inName, NVRenderTextureFormats::Enum inFormat,
- NVRenderTextureMagnifyingOp::Enum inFilterOp,
- NVRenderTextureCoordOp::Enum inCoordOp, QT3DSF32 inMultiplier,
- SAllocateBufferFlags inFlags)
- : SCommand(CommandTypes::AllocateBuffer)
- , m_Name(inName)
- , m_Format(inFormat)
- , m_FilterOp(inFilterOp)
- , m_TexCoordOp(inCoordOp)
- , m_SizeMultiplier(inMultiplier)
- , m_BufferFlags(inFlags)
- {
- }
- SAllocateBuffer(const SAllocateBuffer &inOther, IStringTable &inStrTable)
- : SCommand(CommandTypes::AllocateBuffer)
- , m_Name(inStrTable.RegisterStr(inOther.m_Name))
- , m_Format(inOther.m_Format)
- , m_FilterOp(inOther.m_FilterOp)
- , m_TexCoordOp(inOther.m_TexCoordOp)
- , m_SizeMultiplier(inOther.m_SizeMultiplier)
- , m_BufferFlags(inOther.m_BufferFlags)
- {
- }
- };
-
- struct SAllocateImage : public SAllocateBuffer
- {
- NVRenderImageAccessType::Enum m_Access;
-
- SAllocateImage()
- : SAllocateBuffer()
- , m_Access(NVRenderImageAccessType::ReadWrite)
- {
- m_Type = CommandTypes::AllocateImage;
- }
- SAllocateImage(CRegisteredString inName, NVRenderTextureFormats::Enum inFormat,
- NVRenderTextureMagnifyingOp::Enum inFilterOp,
- NVRenderTextureCoordOp::Enum inCoordOp, QT3DSF32 inMultiplier,
- SAllocateBufferFlags inFlags, NVRenderImageAccessType::Enum inAccess)
- : SAllocateBuffer(inName, inFormat, inFilterOp, inCoordOp, inMultiplier, inFlags)
- , m_Access(inAccess)
- {
- m_Type = CommandTypes::AllocateImage;
- }
-
- SAllocateImage(const SAllocateImage &inOther, IStringTable &inStrTable)
- : SAllocateBuffer(inStrTable.RegisterStr(inOther.m_Name), inOther.m_Format,
- inOther.m_FilterOp, inOther.m_TexCoordOp,
- inOther.m_SizeMultiplier, inOther.m_BufferFlags)
- , m_Access(inOther.m_Access)
- {
- m_Type = CommandTypes::AllocateImage;
- }
- };
-
- struct SAllocateDataBuffer : public SCommand
- {
- CRegisteredString m_Name;
- NVRenderBufferBindValues::Enum m_DataBufferType;
- CRegisteredString m_WrapName;
- NVRenderBufferBindValues::Enum m_DataBufferWrapType;
- QT3DSF32 m_Size;
- SAllocateBufferFlags m_BufferFlags;
-
- SAllocateDataBuffer()
- : SCommand(CommandTypes::AllocateDataBuffer)
- {
- }
-
- SAllocateDataBuffer(CRegisteredString inName,
- NVRenderBufferBindValues::Enum inBufferType,
- CRegisteredString inWrapName,
- NVRenderBufferBindValues::Enum inBufferWrapType, QT3DSF32 inSize,
- SAllocateBufferFlags inFlags)
- : SCommand(CommandTypes::AllocateDataBuffer)
- , m_Name(inName)
- , m_DataBufferType(inBufferType)
- , m_WrapName(inWrapName)
- , m_DataBufferWrapType(inBufferWrapType)
- , m_Size(inSize)
- , m_BufferFlags(inFlags)
- {
- }
-
- SAllocateDataBuffer(const SAllocateDataBuffer &inOther, IStringTable &inStrTable)
- : SCommand(CommandTypes::AllocateDataBuffer)
- , m_Name(inStrTable.RegisterStr(inOther.m_Name))
- , m_DataBufferType(inOther.m_DataBufferType)
- , m_WrapName(inStrTable.RegisterStr(inOther.m_WrapName))
- , m_DataBufferWrapType(inOther.m_DataBufferWrapType)
- , m_Size(inOther.m_Size)
- , m_BufferFlags(inOther.m_BufferFlags)
- {
- }
- };
-
- struct SBindTarget : public SCommand
- {
- NVRenderTextureFormats::Enum m_OutputFormat;
-
- SBindTarget(NVRenderTextureFormats::Enum inFormat = NVRenderTextureFormats::RGBA8)
- : SCommand(CommandTypes::BindTarget)
- , m_OutputFormat(inFormat)
- {
- }
- SBindTarget(const SBindTarget &inOther, IStringTable &)
- : SCommand(CommandTypes::BindTarget)
- , m_OutputFormat(inOther.m_OutputFormat)
- {
- }
- };
-
- struct SBindBuffer : public SCommand
- {
- CRegisteredString m_BufferName;
- bool m_NeedsClear;
- SBindBuffer(CRegisteredString inBufName, bool inNeedsClear)
- : SCommand(CommandTypes::BindBuffer)
- , m_BufferName(inBufName)
- , m_NeedsClear(inNeedsClear)
- {
- }
- SBindBuffer(const SBindBuffer &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::BindBuffer)
- , m_BufferName(inTable.RegisterStr(inOther.m_BufferName))
- , m_NeedsClear(inOther.m_NeedsClear)
- {
- }
- };
-
- struct SBindShader : public SCommand
- {
- CRegisteredString m_ShaderPath;
- // One GLSL file can hold multiple shaders in the case of multipass effects.
- // This makes it significantly easier for authors to reason about the shader
- // but it means we need to #define a preprocessor token to indicate which
- // effect we intend to compile at this point.
- CRegisteredString m_ShaderDefine;
- SBindShader(CRegisteredString inShaderPath,
- CRegisteredString inShaderDefine = CRegisteredString())
- : SCommand(CommandTypes::BindShader)
- , m_ShaderPath(inShaderPath)
- , m_ShaderDefine(inShaderDefine)
- {
- }
- SBindShader()
- : SCommand(CommandTypes::BindShader)
- {
- }
- SBindShader(const SBindShader &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::BindShader)
- , m_ShaderPath(inTable.RegisterStr(inOther.m_ShaderPath))
- , m_ShaderDefine(inTable.RegisterStr(inOther.m_ShaderDefine))
- {
- }
- };
-
- // The value sits immediately after the 'this' object
- // in memory.
- // If propertyName is not valid then we attempt to apply all of the effect property values
- // to the shader, ignoring ones that don't match up.
- struct SApplyInstanceValue : public SCommand
- {
- // Name of value to apply in shader
- CRegisteredString m_PropertyName;
- // type of value
- NVRenderShaderDataTypes::Enum m_ValueType;
- // offset in the effect data section of value.
- QT3DSU32 m_ValueOffset;
- SApplyInstanceValue(CRegisteredString inName, NVRenderShaderDataTypes::Enum inValueType,
- QT3DSU32 inValueOffset)
- : SCommand(CommandTypes::ApplyInstanceValue)
- , m_PropertyName(inName)
- , m_ValueType(inValueType)
- , m_ValueOffset(inValueOffset)
- {
- }
- // Default will attempt to apply all effect values to the currently bound shader
- SApplyInstanceValue()
- : SCommand(CommandTypes::ApplyInstanceValue)
- , m_ValueType(NVRenderShaderDataTypes::Unknown)
- , m_ValueOffset(0)
- {
- }
- SApplyInstanceValue(const SApplyInstanceValue &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyInstanceValue)
- , m_PropertyName(inTable.RegisterStr(inOther.m_PropertyName))
- , m_ValueType(inOther.m_ValueType)
- , m_ValueOffset(inOther.m_ValueOffset)
- {
- }
- };
-
- struct SApplyValue : public SCommand
- {
- CRegisteredString m_PropertyName;
- NVRenderShaderDataTypes::Enum m_ValueType;
- NVDataRef<QT3DSU8> m_Value;
- SApplyValue(CRegisteredString inName, NVRenderShaderDataTypes::Enum inValueType)
- : SCommand(CommandTypes::ApplyValue)
- , m_PropertyName(inName)
- , m_ValueType(inValueType)
- {
- }
- // Default will attempt to apply all effect values to the currently bound shader
- SApplyValue()
- : SCommand(CommandTypes::ApplyValue)
- , m_ValueType(NVRenderShaderDataTypes::Unknown)
- {
- }
-
- SApplyValue(const SApplyValue &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyValue)
- , m_PropertyName(inTable.RegisterStr(inOther.m_PropertyName))
- , m_ValueType(inOther.m_ValueType)
- , m_Value(inOther.m_Value)
- {
- }
- };
-
- // bind a buffer to a given shader parameter.
- struct SApplyBufferValue : public SCommand
- {
- // If no buffer name is given then the special buffer [source]
- // is assumed.
- CRegisteredString m_BufferName;
- // If no param name is given, the buffer is bound to the
- // input texture parameter (texture0).
- CRegisteredString m_ParamName;
-
- SApplyBufferValue(CRegisteredString bufferName, CRegisteredString shaderParam)
- : SCommand(CommandTypes::ApplyBufferValue)
- , m_BufferName(bufferName)
- , m_ParamName(shaderParam)
- {
- }
- SApplyBufferValue(const SApplyBufferValue &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyBufferValue)
- , m_BufferName(inTable.RegisterStr(inOther.m_BufferName))
- , m_ParamName(inTable.RegisterStr(inOther.m_ParamName))
- {
- }
- };
-
- // bind a buffer to a given shader parameter.
- struct SApplyImageValue : public SCommand
- {
- CRegisteredString m_ImageName; ///< name which the image was allocated
- CRegisteredString m_ParamName; ///< must match the name in the shader
- bool m_BindAsTexture; ///< bind image as texture
- bool m_NeedSync; ///< if true we add a memory barrier before usage
-
- SApplyImageValue(CRegisteredString bufferName, CRegisteredString shaderParam,
- bool inBindAsTexture, bool inNeedSync)
- : SCommand(CommandTypes::ApplyImageValue)
- , m_ImageName(bufferName)
- , m_ParamName(shaderParam)
- , m_BindAsTexture(inBindAsTexture)
- , m_NeedSync(inNeedSync)
- {
- }
- SApplyImageValue(const SApplyImageValue &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyImageValue)
- , m_ImageName(inTable.RegisterStr(inOther.m_ImageName))
- , m_ParamName(inTable.RegisterStr(inOther.m_ParamName))
- , m_BindAsTexture(inOther.m_BindAsTexture)
- , m_NeedSync(inOther.m_NeedSync)
- {
- }
- };
-
- // bind a buffer to a given shader parameter.
- struct SApplyDataBufferValue : public SCommand
- {
- CRegisteredString m_ParamName; ///< must match the name in the shader
- NVRenderBufferBindValues::Enum m_BindAs; ///< to which target we bind this buffer
-
- SApplyDataBufferValue(CRegisteredString inShaderParam,
- NVRenderBufferBindValues::Enum inBufferType)
- : SCommand(CommandTypes::ApplyDataBufferValue)
- , m_ParamName(inShaderParam)
- , m_BindAs(inBufferType)
- {
- }
- SApplyDataBufferValue(const SApplyDataBufferValue &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyDataBufferValue)
- , m_ParamName(inTable.RegisterStr(inOther.m_ParamName))
- , m_BindAs(inOther.m_BindAs)
- {
- }
- };
-
- struct SApplyDepthValue : public SCommand
- {
- // If no param name is given, the buffer is bound to the
- // input texture parameter (texture0).
- CRegisteredString m_ParamName;
- SApplyDepthValue(CRegisteredString param)
- : SCommand(CommandTypes::ApplyDepthValue)
- , m_ParamName(param)
- {
- }
- SApplyDepthValue(const SApplyDepthValue &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyDepthValue)
- , m_ParamName(inTable.RegisterStr(inOther.m_ParamName))
- {
- }
- };
-
- struct SRender : public SCommand
- {
- bool m_DrawIndirect;
- SRender(bool inDrawIndirect)
- : SCommand(CommandTypes::Render)
- , m_DrawIndirect(inDrawIndirect)
- {
- }
-
- SRender(const SRender &inOther, IStringTable &)
- : SCommand(CommandTypes::Render)
- , m_DrawIndirect(inOther.m_DrawIndirect)
- {
- }
- };
-
- struct SApplyBlending : public SCommand
- {
- NVRenderSrcBlendFunc::Enum m_SrcBlendFunc;
- NVRenderDstBlendFunc::Enum m_DstBlendFunc;
-
- SApplyBlending(NVRenderSrcBlendFunc::Enum inSrcBlendFunc,
- NVRenderDstBlendFunc::Enum inDstBlendFunc)
- : SCommand(CommandTypes::ApplyBlending)
- , m_SrcBlendFunc(inSrcBlendFunc)
- , m_DstBlendFunc(inDstBlendFunc)
- {
- }
-
- SApplyBlending(const SApplyBlending &inOther, IStringTable &)
- : SCommand(CommandTypes::ApplyBlending)
- , m_SrcBlendFunc(inOther.m_SrcBlendFunc)
- , m_DstBlendFunc(inOther.m_DstBlendFunc)
- {
- }
- };
-
- struct SApplyRenderState : public SCommand
- {
- NVRenderState::Enum m_RenderState;
- bool m_Enabled;
-
- SApplyRenderState(qt3ds::render::NVRenderState::Enum inRenderStateValue, bool inEnabled)
- : SCommand(CommandTypes::ApplyRenderState)
- , m_RenderState(inRenderStateValue)
- , m_Enabled(inEnabled)
- {
- }
-
- SApplyRenderState(const SApplyRenderState &inOther, IStringTable &)
- : SCommand(CommandTypes::ApplyRenderState)
- , m_RenderState(inOther.m_RenderState)
- , m_Enabled(inOther.m_Enabled)
- {
- }
- };
-
- struct SApplyBlitFramebuffer : public SCommand
- {
- // If no buffer name is given then the special buffer [source]
- // is assumed. Which is the default render target
- CRegisteredString m_SourceBufferName;
- // If no buffer name is given then the special buffer [dest]
- // is assumed. Which is the default render target
- CRegisteredString m_DestBufferName;
-
- SApplyBlitFramebuffer(CRegisteredString inSourceBufferName,
- CRegisteredString inDestBufferName)
- : SCommand(CommandTypes::ApplyBlitFramebuffer)
- , m_SourceBufferName(inSourceBufferName)
- , m_DestBufferName(inDestBufferName)
- {
- }
-
- SApplyBlitFramebuffer(const SApplyBlitFramebuffer &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::ApplyBlitFramebuffer)
- , m_SourceBufferName(inTable.RegisterStr(inOther.m_SourceBufferName))
- , m_DestBufferName(inTable.RegisterStr(inOther.m_DestBufferName))
- {
- }
- };
-
- struct DepthStencilFlagValues
- {
- enum Enum {
- NoFlagValue = 0,
- ClearStencil = 1 << 0,
- ClearDepth = 1 << 1,
- };
- };
-
- struct SDepthStencilFlags : public NVFlags<DepthStencilFlagValues::Enum>
- {
- bool HasClearStencil() const { return operator&(DepthStencilFlagValues::ClearStencil); }
- void SetClearStencil(bool value)
- {
- clearOrSet(value, DepthStencilFlagValues::ClearStencil);
- }
-
- bool HasClearDepth() const { return operator&(DepthStencilFlagValues::ClearDepth); }
- void SetClearDepth(bool value)
- {
- clearOrSet(value, DepthStencilFlagValues::ClearDepth);
- }
- };
-
- struct SDepthStencil : public SCommand
- {
- CRegisteredString m_BufferName;
- SDepthStencilFlags m_Flags;
- qt3ds::render::NVRenderStencilOp::Enum m_StencilFailOperation;
- qt3ds::render::NVRenderStencilOp::Enum m_DepthPassOperation;
- qt3ds::render::NVRenderStencilOp::Enum m_DepthFailOperation;
- qt3ds::render::NVRenderBoolOp::Enum m_StencilFunction;
- QT3DSU32 m_Reference;
- QT3DSU32 m_Mask;
-
- SDepthStencil()
- : SCommand(CommandTypes::DepthStencil)
- , m_StencilFailOperation(qt3ds::render::NVRenderStencilOp::Keep)
- , m_DepthPassOperation(qt3ds::render::NVRenderStencilOp::Keep)
- , m_DepthFailOperation(qt3ds::render::NVRenderStencilOp::Keep)
- , m_StencilFunction(qt3ds::render::NVRenderBoolOp::Equal)
- , m_Reference(0)
- , m_Mask(QT3DS_MAX_U32)
- {
- }
-
- SDepthStencil(CRegisteredString bufName, SDepthStencilFlags flags,
- qt3ds::render::NVRenderStencilOp::Enum inStencilOp,
- qt3ds::render::NVRenderStencilOp::Enum inDepthPassOp,
- qt3ds::render::NVRenderStencilOp::Enum inDepthFailOp,
- qt3ds::render::NVRenderBoolOp::Enum inStencilFunc, QT3DSU32 value, QT3DSU32 mask)
- : SCommand(CommandTypes::DepthStencil)
- , m_BufferName(bufName)
- , m_Flags(flags)
- , m_StencilFailOperation(inStencilOp)
- , m_DepthPassOperation(inDepthPassOp)
- , m_DepthFailOperation(inDepthFailOp)
- , m_StencilFunction(inStencilFunc)
- , m_Reference(value)
- , m_Mask(mask)
- {
- }
-
- SDepthStencil(const SDepthStencil &inOther, IStringTable &inTable)
- : SCommand(CommandTypes::DepthStencil)
- , m_BufferName(inTable.RegisterStr(inOther.m_BufferName))
- , m_Flags(inOther.m_Flags)
- , m_StencilFailOperation(inOther.m_StencilFailOperation)
- , m_DepthPassOperation(inOther.m_DepthPassOperation)
- , m_DepthFailOperation(inOther.m_DepthFailOperation)
- , m_StencilFunction(inOther.m_StencilFunction)
- , m_Reference(inOther.m_Reference)
- , m_Mask(inOther.m_Mask)
- {
- }
- };
- }
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemUtil.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemUtil.h
deleted file mode 100644
index b00b9963..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderDynamicObjectSystemUtil.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DYNAMIC_OBJECT_SYSTEM_UTIL_H
-#define QT3DS_RENDER_DYNAMIC_OBJECT_SYSTEM_UTIL_H
-#include "Qt3DSRender.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "StringTools.h"
-
-namespace qt3ds {
-namespace render {
- namespace dynamic {
-
- struct SStringLoadRemapper
- {
- CStrTableOrDataRef m_StrData;
- IStringTable &m_StringTable;
- Qt3DSString m_PathMapper;
- const char8_t *m_ProjectDir;
- SStringLoadRemapper(NVAllocatorCallback &alloc, CStrTableOrDataRef inData,
- const char8_t *inProjectDir, IStringTable &inStrTable)
- : m_StrData(inData)
- , m_StringTable(inStrTable)
- , m_ProjectDir(inProjectDir)
- {
- Q_UNUSED(alloc)
- }
- void Remap(CRegisteredString &inStr) { inStr.Remap(m_StrData); }
- };
-
- struct SStringSaveRemapper
- {
- const qt3ds::render::SStrRemapMap &m_Map;
- Qt3DSString m_RelativeBuffer;
- Qt3DSString m_ProjectDir;
- Qt3DSString m_FinalBuffer;
- IStringTable &m_StringTable;
- SStringSaveRemapper(NVAllocatorCallback &alloc, const qt3ds::render::SStrRemapMap &map,
- const char8_t *inProjectDir, IStringTable &inStrTable)
- : m_Map(map)
- , m_StringTable(inStrTable)
- {
- Q_UNUSED(alloc)
- m_ProjectDir.assign(inProjectDir);
- }
- void Remap(CRegisteredString &inStr) { inStr.Remap(m_Map); }
- };
-
- inline QT3DSU32 Align(QT3DSU32 inValue)
- {
- if (inValue % 4)
- return inValue + (4 - (inValue % 4));
- return inValue;
- }
-
- inline QT3DSU32 Align8(QT3DSU32 inValue)
- {
- if (inValue % 8)
- return inValue + (8 - (inValue % 8));
- return inValue;
- }
-
- inline qt3ds::QT3DSU32 getSizeofShaderDataType(NVRenderShaderDataTypes::Enum value)
- {
- using namespace qt3ds;
- using namespace qt3ds::render;
- switch (value) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(x) \
- case NVRenderShaderDataTypes::x: \
- return sizeof(x);
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- inline const char *GetShaderDatatypeName(NVRenderShaderDataTypes::Enum inValue)
- {
- switch (inValue) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(type) \
- case NVRenderShaderDataTypes::type: \
- return #type;
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return "";
- }
- }
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.cpp
deleted file mode 100644
index 65f52a64..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.cpp
+++ /dev/null
@@ -1,1872 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderEffectSystem.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-#include "StringTools.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSRenderEffect.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "Qt3DSRenderDynamicObjectSystemCommands.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderShaderConstant.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "foundation/PreAllocatedAllocator.h"
-#include "foundation/SerializationTypes.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSOffscreenRenderKey.h"
-#include "Qt3DSRenderDynamicObjectSystemUtil.h"
-
-using namespace qt3ds::render;
-using namespace qt3ds::render::dynamic;
-using qt3ds::render::NVRenderContextScopedProperty;
-using qt3ds::render::NVRenderCachedShaderProperty;
-using qt3ds::render::NVRenderCachedShaderBuffer;
-
-// None of this code will work if the size of void* changes because that would mean that
-// the alignment of some of the objects isn't 4 bytes but would be 8 bytes.
-
-typedef eastl::pair<CRegisteredString, CRegisteredString> TStrStrPair;
-
-namespace eastl {
-template <>
-struct hash<TStrStrPair>
-{
- size_t operator()(const TStrStrPair &item) const
- {
- return hash<CRegisteredString>()(item.first) ^ hash<CRegisteredString>()(item.second);
- }
-};
-}
-
-namespace {
-
-/*
- ApplyBufferValue,
- //Apply the depth buffer as an input texture.
- ApplyDepthValue,
- Render, //Render to current FBO
- */
-
-struct SEffectClass
-{
- NVAllocatorCallback *m_Allocator;
- IDynamicObjectClass *m_DynamicClass;
- volatile QT3DSI32 mRefCount;
-
- SEffectClass(NVAllocatorCallback &inFnd, IDynamicObjectClass &dynClass)
- : m_Allocator(&inFnd)
- , m_DynamicClass(&dynClass)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(*m_Allocator)
-
- void SetupThisObjectFromMemory(NVAllocatorCallback &inAlloc, IDynamicObjectClass &inClass)
- {
- m_Allocator = &inAlloc;
- m_DynamicClass = &inClass;
- mRefCount = 0;
- }
-};
-
-struct SAllocatedBufferEntry
-{
- CRegisteredString m_Name;
- NVScopedRefCounted<NVRenderFrameBuffer> m_FrameBuffer;
- NVScopedRefCounted<NVRenderTexture2D> m_Texture;
- SAllocateBufferFlags m_Flags;
- bool m_NeedsClear;
-
- SAllocatedBufferEntry(CRegisteredString inName, NVRenderFrameBuffer &inFb,
- NVRenderTexture2D &inTexture, SAllocateBufferFlags inFlags)
- : m_Name(inName)
- , m_FrameBuffer(&inFb)
- , m_Texture(&inTexture)
- , m_Flags(inFlags)
- , m_NeedsClear(true)
- {
- }
- SAllocatedBufferEntry() {}
-};
-
-struct SAllocatedImageEntry
-{
- CRegisteredString m_Name;
- NVScopedRefCounted<NVRenderImage2D> m_Image;
- NVScopedRefCounted<NVRenderTexture2D> m_Texture;
- SAllocateBufferFlags m_Flags;
-
- SAllocatedImageEntry(CRegisteredString inName, NVRenderImage2D &inImage,
- NVRenderTexture2D &inTexture, SAllocateBufferFlags inFlags)
- : m_Name(inName)
- , m_Image(&inImage)
- , m_Texture(&inTexture)
- , m_Flags(inFlags)
- {
- }
- SAllocatedImageEntry() {}
-};
-
-struct SImageEntry
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- NVRenderCachedShaderProperty<NVRenderImage2D *> m_Image;
- volatile QT3DSI32 mRefCount;
-
- SImageEntry(NVRenderShaderProgram &inShader, const char *inImageName)
- : m_Shader(inShader)
- , m_Image(inImageName, inShader)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-
- void Set(NVRenderImage2D *inImage) { m_Image.Set(inImage); }
-
- static SImageEntry CreateImageEntry(NVRenderShaderProgram &inShader, const char *inStem)
- {
- return SImageEntry(inShader, inStem);
- }
-};
-
-struct SAllocatedDataBufferEntry
-{
- CRegisteredString m_Name;
- NVScopedRefCounted<qt3ds::render::NVRenderDataBuffer> m_DataBuffer;
- NVRenderBufferBindValues::Enum m_BufferType;
- NVDataRef<QT3DSU8> m_BufferData;
- SAllocateBufferFlags m_Flags;
- bool m_NeedsClear;
-
- SAllocatedDataBufferEntry(CRegisteredString inName,
- qt3ds::render::NVRenderDataBuffer &inDataBuffer,
- NVRenderBufferBindValues::Enum inType, NVDataRef<QT3DSU8> data,
- SAllocateBufferFlags inFlags)
- : m_Name(inName)
- , m_DataBuffer(&inDataBuffer)
- , m_BufferType(inType)
- , m_BufferData(data)
- , m_Flags(inFlags)
- , m_NeedsClear(false)
- {
- }
- SAllocatedDataBufferEntry() {}
-};
-
-struct SDataBufferEntry
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderBufferBase *> m_DataBuffer;
- volatile QT3DSI32 mRefCount;
-
- SDataBufferEntry(NVRenderShaderProgram &inShader, const char *inBufferName)
- : m_Shader(inShader)
- , m_DataBuffer(inBufferName, inShader)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-
- void Set(qt3ds::render::NVRenderDataBuffer *inBuffer)
- {
- if (inBuffer)
- inBuffer->Bind();
-
- m_DataBuffer.Set();
- }
-
- static SDataBufferEntry CreateDataBufferEntry(NVRenderShaderProgram &inShader,
- const char *inStem)
- {
- return SDataBufferEntry(inShader, inStem);
- }
-};
-
-struct SEffectTextureData
-{
- NVRenderTexture2D *m_Texture;
- bool m_NeedsAlphaMultiply;
- SEffectTextureData(NVRenderTexture2D *inTexture, bool inNeedsMultiply)
- : m_Texture(inTexture)
- , m_NeedsAlphaMultiply(inNeedsMultiply)
- {
- }
- SEffectTextureData()
- : m_Texture(NULL)
- , m_NeedsAlphaMultiply(false)
- {
- }
-};
-
-struct STextureEntry
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Texture;
- NVRenderCachedShaderProperty<QT3DSVec4> m_TextureData;
- NVRenderCachedShaderProperty<QT3DSI32> m_TextureFlags;
- volatile QT3DSI32 mRefCount;
-
- STextureEntry(NVRenderShaderProgram &inShader, const char *inTexName, const char *inDataName,
- const char *inFlagName)
- : m_Shader(inShader)
- , m_Texture(inTexName, inShader)
- , m_TextureData(inDataName, inShader)
- , m_TextureFlags(inFlagName, inShader)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-
- void Set(NVRenderTexture2D *inTexture, bool inNeedsAlphaMultiply,
- const SPropertyDefinition *inDefinition)
- {
- QT3DSF32 theMixValue(inNeedsAlphaMultiply ? 0.0f : 1.0f);
- if (inTexture && inDefinition) {
- inTexture->SetMagFilter(inDefinition->m_MagFilterOp);
- inTexture->SetMinFilter(
- static_cast<NVRenderTextureMinifyingOp::Enum>(inDefinition->m_MagFilterOp));
- inTexture->SetTextureWrapS(inDefinition->m_CoordOp);
- inTexture->SetTextureWrapT(inDefinition->m_CoordOp);
- }
- m_Texture.Set(inTexture);
- if (inTexture) {
- STextureDetails theDetails(inTexture->GetTextureDetails());
- m_TextureData.Set(
- QT3DSVec4((QT3DSF32)theDetails.m_Width, (QT3DSF32)theDetails.m_Height, theMixValue, 0.0f));
- // I have no idea what these flags do.
- m_TextureFlags.Set(1);
- } else
- m_TextureFlags.Set(0);
- }
-
- static STextureEntry CreateTextureEntry(NVRenderShaderProgram &inShader, const char *inStem,
- Qt3DSString &inBuilder, Qt3DSString &inBuilder2)
- {
- inBuilder.assign(inStem);
- inBuilder.append("Info");
- inBuilder2.assign("flag");
- inBuilder2.append(inStem);
- return STextureEntry(inShader, inStem, inBuilder.c_str(), inBuilder2.c_str());
- }
-};
-
-typedef eastl::pair<CRegisteredString, NVScopedRefCounted<STextureEntry>> TNamedTextureEntry;
-typedef eastl::pair<CRegisteredString, NVScopedRefCounted<SImageEntry>> TNamedImageEntry;
-typedef eastl::pair<CRegisteredString, NVScopedRefCounted<SDataBufferEntry>> TNamedDataBufferEntry;
-}
-
-namespace qt3ds {
-namespace render {
-
- struct SEffectContext
- {
- CRegisteredString m_ClassName;
- IQt3DSRenderContext &m_Context;
- IResourceManager *m_ResourceManager;
- nvvector<SAllocatedBufferEntry> m_AllocatedBuffers;
- nvvector<SAllocatedImageEntry> m_AllocatedImages;
- nvvector<SAllocatedDataBufferEntry> m_AllocatedDataBuffers;
- nvvector<TNamedTextureEntry> m_TextureEntries;
- nvvector<TNamedImageEntry> m_ImageEntries;
- nvvector<TNamedDataBufferEntry> m_DataBufferEntries;
-
- SEffectContext(CRegisteredString inName, IQt3DSRenderContext &ctx, IResourceManager *inManager)
- : m_ClassName(inName)
- , m_Context(ctx)
- , m_ResourceManager(inManager)
- , m_AllocatedBuffers(ctx.GetAllocator(), "SEffectContext::m_AllocatedBuffers")
- , m_AllocatedImages(ctx.GetAllocator(), "SEffectContext::m_AllocatedImages")
- , m_AllocatedDataBuffers(ctx.GetAllocator(), "SEffectContext::m_AllocatedDataBuffers")
- , m_TextureEntries(ctx.GetAllocator(), "SEffectContext::m_TextureEntries")
- , m_ImageEntries(ctx.GetAllocator(), "SEffectContext::m_ImageEntries")
- , m_DataBufferEntries(ctx.GetAllocator(), "SEffectContext::m_DataBufferEntries")
- {
- }
-
- ~SEffectContext()
- {
- while (m_AllocatedBuffers.size())
- ReleaseBuffer(0);
-
- while (m_AllocatedImages.size())
- ReleaseImage(0);
-
- while (m_AllocatedDataBuffers.size())
- ReleaseDataBuffer(0);
- }
-
- void ReleaseBuffer(QT3DSU32 inIdx)
- {
- SAllocatedBufferEntry &theEntry(m_AllocatedBuffers[inIdx]);
- theEntry.m_FrameBuffer->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer());
- m_ResourceManager->Release(*theEntry.m_FrameBuffer);
- m_ResourceManager->Release(*theEntry.m_Texture);
- m_AllocatedBuffers.replace_with_last(inIdx);
- }
-
- void ReleaseImage(QT3DSU32 inIdx)
- {
- SAllocatedImageEntry &theEntry(m_AllocatedImages[inIdx]);
- m_ResourceManager->Release(*theEntry.m_Image);
- m_ResourceManager->Release(*theEntry.m_Texture);
- m_AllocatedImages.replace_with_last(inIdx);
- }
-
- void ReleaseDataBuffer(QT3DSU32 inIdx)
- {
- SAllocatedDataBufferEntry &theEntry(m_AllocatedDataBuffers[inIdx]);
- m_Context.GetAllocator().deallocate(theEntry.m_BufferData.begin());
-
- m_AllocatedDataBuffers.replace_with_last(inIdx);
- }
-
- QT3DSU32 FindBuffer(CRegisteredString inName)
- {
- for (QT3DSU32 idx = 0, end = m_AllocatedBuffers.size(); idx < end; ++idx)
- if (m_AllocatedBuffers[idx].m_Name == inName)
- return idx;
- return m_AllocatedBuffers.size();
- }
-
- QT3DSU32 FindImage(CRegisteredString inName)
- {
- for (QT3DSU32 idx = 0, end = m_AllocatedImages.size(); idx < end; ++idx)
- if (m_AllocatedImages[idx].m_Name == inName)
- return idx;
-
- return m_AllocatedImages.size();
- }
-
- QT3DSU32 FindDataBuffer(CRegisteredString inName)
- {
- for (QT3DSU32 idx = 0, end = m_AllocatedDataBuffers.size(); idx < end; ++idx) {
- if (m_AllocatedDataBuffers[idx].m_Name == inName)
- return idx;
- }
-
- return m_AllocatedDataBuffers.size();
- }
-
- void SetTexture(NVRenderShaderProgram &inShader, CRegisteredString inPropName,
- NVRenderTexture2D *inTexture, bool inNeedsMultiply,
- Qt3DSString &inStringBuilder, Qt3DSString &inStringBuilder2,
- const SPropertyDefinition *inPropDec = NULL)
- {
- STextureEntry *theTextureEntry(NULL);
- for (QT3DSU32 idx = 0, end = m_TextureEntries.size(); idx < end && theTextureEntry == NULL;
- ++idx) {
- if (m_TextureEntries[idx].first == inPropName
- && m_TextureEntries[idx].second->m_Shader.mPtr == &inShader)
- theTextureEntry = m_TextureEntries[idx].second;
- }
- if (theTextureEntry == NULL) {
- NVScopedRefCounted<STextureEntry> theNewEntry = QT3DS_NEW(
- m_Context.GetAllocator(), STextureEntry)(STextureEntry::CreateTextureEntry(
- inShader, inPropName, inStringBuilder, inStringBuilder2));
- m_TextureEntries.push_back(eastl::make_pair(inPropName, theNewEntry));
- theTextureEntry = theNewEntry.mPtr;
- }
- theTextureEntry->Set(inTexture, inNeedsMultiply, inPropDec);
- }
-
- void SetImage(NVRenderShaderProgram &inShader, CRegisteredString inPropName,
- NVRenderImage2D *inImage)
- {
- SImageEntry *theImageEntry(NULL);
- for (QT3DSU32 idx = 0, end = m_ImageEntries.size(); idx < end && theImageEntry == NULL;
- ++idx) {
- if (m_ImageEntries[idx].first == inPropName
- && m_ImageEntries[idx].second->m_Shader.mPtr == &inShader)
- theImageEntry = m_ImageEntries[idx].second;
- }
- if (theImageEntry == NULL) {
- NVScopedRefCounted<SImageEntry> theNewEntry =
- QT3DS_NEW(m_Context.GetAllocator(),
- SImageEntry)(SImageEntry::CreateImageEntry(inShader, inPropName));
- m_ImageEntries.push_back(eastl::make_pair(inPropName, theNewEntry));
- theImageEntry = theNewEntry.mPtr;
- }
-
- theImageEntry->Set(inImage);
- }
-
- void SetDataBuffer(NVRenderShaderProgram &inShader, CRegisteredString inPropName,
- qt3ds::render::NVRenderDataBuffer *inBuffer)
- {
- SDataBufferEntry *theDataBufferEntry(NULL);
- for (QT3DSU32 idx = 0, end = m_DataBufferEntries.size();
- idx < end && theDataBufferEntry == NULL; ++idx) {
- if (m_DataBufferEntries[idx].first == inPropName
- && m_DataBufferEntries[idx].second->m_Shader.mPtr == &inShader)
- theDataBufferEntry = m_DataBufferEntries[idx].second;
- }
- if (theDataBufferEntry == NULL) {
- NVScopedRefCounted<SDataBufferEntry> theNewEntry =
- QT3DS_NEW(m_Context.GetAllocator(), SDataBufferEntry)(
- SDataBufferEntry::CreateDataBufferEntry(inShader, inPropName));
- m_DataBufferEntries.push_back(eastl::make_pair(inPropName, theNewEntry));
- theDataBufferEntry = theNewEntry.mPtr;
- }
-
- theDataBufferEntry->Set(inBuffer);
- }
- };
-}
-}
-
-namespace {
-
-using qt3ds::render::NVRenderCachedShaderProperty;
-/* We setup some shared state on the effect shaders */
-struct SEffectShader
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
- NVRenderCachedShaderProperty<QT3DSVec2> m_FragColorAlphaSettings;
- NVRenderCachedShaderProperty<QT3DSVec2> m_DestSize;
- NVRenderCachedShaderProperty<QT3DSF32> m_AppFrame;
- NVRenderCachedShaderProperty<QT3DSF32> m_FPS;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraClipRange;
- STextureEntry m_TextureEntry;
- volatile QT3DSI32 mRefCount;
- SEffectShader(NVRenderShaderProgram &inShader)
- : m_Shader(inShader)
- , m_MVP("ModelViewProjectionMatrix", inShader)
- , m_FragColorAlphaSettings("FragColorAlphaSettings", inShader)
- , m_DestSize("DestSize", inShader)
- , m_AppFrame("AppFrame", inShader)
- , m_FPS("FPS", inShader)
- , m_CameraClipRange("CameraClipRange", inShader)
- , m_TextureEntry(inShader, "Texture0", "Texture0Info", "Texture0Flags")
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
-};
-
-struct SEffectSystem : public IEffectSystem
-{
- typedef nvhash_map<CRegisteredString, char8_t *> TPathDataMap;
- typedef nvhash_set<CRegisteredString> TPathSet;
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<SEffectClass>> TEffectClassMap;
- typedef nvhash_map<TStrStrPair, NVScopedRefCounted<SEffectShader>> TShaderMap;
- typedef nvvector<SEffectContext *> TContextList;
-
- IQt3DSRenderContextCore &m_CoreContext;
- IQt3DSRenderContext *m_Context;
- NVScopedRefCounted<IResourceManager> m_ResourceManager;
- mutable qt3ds::render::SPreAllocatedAllocator m_Allocator;
- // Keep from dual-including headers.
- TEffectClassMap m_EffectClasses;
- nvvector<CRegisteredString> m_EffectList;
- TContextList m_Contexts;
- Qt3DSString m_TextureStringBuilder;
- Qt3DSString m_TextureStringBuilder2;
- TShaderMap m_ShaderMap;
- NVScopedRefCounted<NVRenderDepthStencilState> m_DefaultStencilState;
- nvvector<NVScopedRefCounted<NVRenderDepthStencilState>> m_DepthStencilStates;
- volatile QT3DSI32 mRefCount;
-
- SEffectSystem(IQt3DSRenderContextCore &inContext)
- : m_CoreContext(inContext)
- , m_Context(NULL)
- , m_Allocator(inContext.GetAllocator())
- , m_EffectClasses(inContext.GetAllocator(), "SEffectSystem::m_EffectClasses")
- , m_EffectList(inContext.GetAllocator(), "SEffectSystem::m_EffectList")
- , m_Contexts(inContext.GetAllocator(), "SEffectSystem::m_Contexts")
- , m_ShaderMap(inContext.GetAllocator(), "SEffectSystem::m_ShaderMap")
- , m_DepthStencilStates(inContext.GetAllocator(), "SEffectSystem::m_DepthStencilStates")
- , mRefCount(0)
- {
- }
-
- ~SEffectSystem()
- {
- for (QT3DSU32 idx = 0, end = m_Contexts.size(); idx < end; ++idx)
- NVDelete(m_Allocator, m_Contexts[idx]);
- m_Contexts.clear();
- }
-
- SEffectContext &GetEffectContext(SEffect &inEffect)
- {
- if (inEffect.m_Context == NULL) {
- inEffect.m_Context =
- QT3DS_NEW(m_Allocator, SEffectContext)(inEffect.m_ClassName,
- *m_Context, m_ResourceManager);
- m_Contexts.push_back(inEffect.m_Context);
- }
- return *inEffect.m_Context;
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_CoreContext.GetAllocator());
-
- SEffectClass *GetEffectClass(CRegisteredString inStr)
- {
- TEffectClassMap::iterator theIter = m_EffectClasses.find(inStr);
- if (theIter != m_EffectClasses.end())
- return theIter->second;
- return NULL;
- }
- const SEffectClass *GetEffectClass(CRegisteredString inStr) const
- {
- return const_cast<SEffectSystem *>(this)->GetEffectClass(inStr);
- }
-
- bool IsEffectRegistered(CRegisteredString inStr) override
- {
- return GetEffectClass(inStr) != NULL;
- }
- NVConstDataRef<CRegisteredString> GetRegisteredEffects() override
- {
- m_EffectList.clear();
- for (TEffectClassMap::iterator theIter = m_EffectClasses.begin(),
- theEnd = m_EffectClasses.end();
- theIter != theEnd; ++theIter)
- m_EffectList.push_back(theIter->first);
- return m_EffectList;
- }
-
- // Registers an effect that runs via a single GLSL file.
- bool RegisterGLSLEffect(CRegisteredString inName, const char8_t *inPathToEffect,
- NVConstDataRef<SPropertyDeclaration> inProperties) override
- {
- if (IsEffectRegistered(inName))
- return false;
-
- m_CoreContext.GetDynamicObjectSystemCore().Register(inName, inProperties, sizeof(SEffect),
- GraphObjectTypes::Effect);
- IDynamicObjectClass &theClass =
- *m_CoreContext.GetDynamicObjectSystemCore().GetDynamicObjectClass(inName);
-
- SEffectClass *theEffect = QT3DS_NEW(m_Allocator, SEffectClass)(m_Allocator, theClass);
- m_EffectClasses.insert(eastl::make_pair(inName, theEffect));
-
- // Setup the commands required to run this effect
- StaticAssert<(sizeof(SBindShader) % 4 == 0)>::valid_expression();
- StaticAssert<(sizeof(SApplyInstanceValue) % 4 == 0)>::valid_expression();
- StaticAssert<(sizeof(SRender) % 4 == 0)>::valid_expression();
-
- QT3DSU32 commandAllocationSize = sizeof(SBindTarget);
- commandAllocationSize += sizeof(SBindShader);
- commandAllocationSize += sizeof(SApplyInstanceValue) * inProperties.size();
- commandAllocationSize += sizeof(SRender);
-
- QT3DSU32 commandCount = 3 + inProperties.size();
- QT3DSU32 commandPtrAllocationSize = commandCount * sizeof(SCommand *);
- QT3DSU32 allocationSize = Align8(commandAllocationSize) + commandPtrAllocationSize;
- QT3DSU8 *startBuffer =
- (QT3DSU8 *)m_Allocator.allocate(allocationSize, "dynamic::SCommand", __FILE__, __LINE__);
- QT3DSU8 *dataBuffer = startBuffer;
- // Setup the command buffer such that the ptrs to the commands and the commands themselves
- // are
- // all in the same block of memory. This enables quicker iteration (trivially quicker, most
- // likely)
- // but it also enables simpler memory management (single free).
- // Furthermore, for a single glsl file the effect properties map precisely into the
- // glsl file itself.
- SCommand **theFirstCommandPtr =
- (reinterpret_cast<SCommand **>(dataBuffer + Align8(commandAllocationSize)));
- SCommand **theCommandPtr = theFirstCommandPtr;
- memZero(dataBuffer, commandAllocationSize);
-
- new (dataBuffer) SBindTarget();
- *theCommandPtr = (SCommand *)dataBuffer;
- ++theCommandPtr;
- dataBuffer += sizeof(SBindTarget);
-
- new (dataBuffer) SBindShader(m_CoreContext.GetStringTable().RegisterStr(inPathToEffect));
- *theCommandPtr = (SCommand *)dataBuffer;
- ++theCommandPtr;
- dataBuffer += sizeof(SBindShader);
-
- for (QT3DSU32 idx = 0, end = inProperties.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(
- theEffect->m_DynamicClass->GetProperties()[idx]);
- new (dataBuffer) SApplyInstanceValue(theDefinition.m_Name, theDefinition.m_DataType,
- theDefinition.m_Offset);
- *theCommandPtr = (SCommand *)dataBuffer;
- ++theCommandPtr;
- dataBuffer += sizeof(SApplyInstanceValue);
- }
- new (dataBuffer) SRender(false);
- *theCommandPtr = (SCommand *)dataBuffer;
- ++theCommandPtr;
- dataBuffer += sizeof(SRender);
- // Ensure we end up *exactly* where we expected to.
- QT3DS_ASSERT(dataBuffer == startBuffer + commandAllocationSize);
- QT3DS_ASSERT(theCommandPtr - theFirstCommandPtr == (int)inProperties.size() + 3);
- m_CoreContext.GetDynamicObjectSystemCore().SetRenderCommands(
- inName, NVConstDataRef<SCommand *>(theFirstCommandPtr, commandCount));
- m_Allocator.deallocate(startBuffer);
- return true;
- }
-
- void SetEffectPropertyDefaultValue(CRegisteredString inName,
- CRegisteredString inPropName,
- NVConstDataRef<QT3DSU8> inDefaultData) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetPropertyDefaultValue(inName, inPropName,
- inDefaultData);
- }
-
- void SetEffectPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName,
- NVConstDataRef<CRegisteredString> inNames) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetPropertyEnumNames(inName, inPropName,
- inNames);
- }
-
- bool RegisterEffect(CRegisteredString inName,
- NVConstDataRef<SPropertyDeclaration> inProperties) override
- {
- if (IsEffectRegistered(inName))
- return false;
- m_CoreContext.GetDynamicObjectSystemCore().Register(inName, inProperties, sizeof(SEffect),
- GraphObjectTypes::Effect);
- IDynamicObjectClass &theClass =
- *m_CoreContext.GetDynamicObjectSystemCore().GetDynamicObjectClass(inName);
- SEffectClass *theEffect = QT3DS_NEW(m_Allocator, SEffectClass)(m_Allocator, theClass);
- m_EffectClasses.insert(eastl::make_pair(inName, theEffect));
- return true;
- }
-
- bool UnregisterEffect(CRegisteredString inName) override
- {
- if (!IsEffectRegistered(inName))
- return false;
-
- m_CoreContext.GetDynamicObjectSystemCore().Unregister(inName);
-
- TEffectClassMap::iterator iter = m_EffectClasses.find(inName);
- if (iter != m_EffectClasses.end())
- m_EffectClasses.erase(iter);
-
- for (QT3DSU32 idx = 0, end = m_Contexts.size(); idx < end; ++idx) {
- if (m_Contexts[idx]->m_ClassName == inName)
- ReleaseEffectContext(m_Contexts[idx]);
- }
- return true;
- }
-
- virtual NVConstDataRef<CRegisteredString>
- GetEffectPropertyEnumNames(CRegisteredString inName, CRegisteredString inPropName) const override
- {
- const SEffectClass *theClass = GetEffectClass(inName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- NVConstDataRef<CRegisteredString>();
- }
- const SPropertyDefinition *theDefinitionPtr =
- theClass->m_DynamicClass->FindPropertyByName(inPropName);
- if (theDefinitionPtr)
- return theDefinitionPtr->m_EnumValueNames;
- return NVConstDataRef<CRegisteredString>();
- }
-
- virtual NVConstDataRef<SPropertyDefinition>
- GetEffectProperties(CRegisteredString inEffectName) const override
- {
- const SEffectClass *theClass = GetEffectClass(inEffectName);
- if (theClass)
- return theClass->m_DynamicClass->GetProperties();
- return NVConstDataRef<SPropertyDefinition>();
- }
-
- void SetEffectPropertyTextureSettings(CRegisteredString inName,
- CRegisteredString inPropName,
- CRegisteredString inPropPath,
- NVRenderTextureTypeValue::Enum inTexType,
- NVRenderTextureCoordOp::Enum inCoordOp,
- NVRenderTextureMagnifyingOp::Enum inMagFilterOp,
- NVRenderTextureMinifyingOp::Enum inMinFilterOp) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetPropertyTextureSettings(
- inName, inPropName, inPropPath, inTexType, inCoordOp, inMagFilterOp, inMinFilterOp);
- }
-
- void SetEffectRequiresDepthTexture(CRegisteredString inEffectName, bool inValue) override
- {
- SEffectClass *theClass = GetEffectClass(inEffectName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- theClass->m_DynamicClass->SetRequiresDepthTexture(inValue);
- }
-
- bool DoesEffectRequireDepthTexture(CRegisteredString inEffectName) const override
- {
- const SEffectClass *theClass = GetEffectClass(inEffectName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- return theClass->m_DynamicClass->RequiresDepthTexture();
- }
-
- void SetEffectRequiresCompilation(CRegisteredString inEffectName, bool inValue) override
- {
- SEffectClass *theClass = GetEffectClass(inEffectName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- theClass->m_DynamicClass->SetRequiresCompilation(inValue);
- }
-
- bool DoesEffectRequireCompilation(CRegisteredString inEffectName) const override
- {
- const SEffectClass *theClass = GetEffectClass(inEffectName);
- if (theClass == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- return theClass->m_DynamicClass->RequiresCompilation();
- }
-
- void SetEffectCommands(CRegisteredString inEffectName,
- NVConstDataRef<dynamic::SCommand *> inCommands) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetRenderCommands(inEffectName, inCommands);
- }
-
- virtual NVConstDataRef<dynamic::SCommand *>
- GetEffectCommands(CRegisteredString inEffectName) const override
- {
- return m_CoreContext.GetDynamicObjectSystemCore().GetRenderCommands(inEffectName);
- }
-
- SEffect *CreateEffectInstance(CRegisteredString inEffectName,
- NVAllocatorCallback &inSceneGraphAllocator) override
- {
- SEffectClass *theClass = GetEffectClass(inEffectName);
- if (theClass == NULL)
- return NULL;
- StaticAssert<(sizeof(SEffect) % 4 == 0)>::valid_expression();
-
- SEffect *theEffect = (SEffect *)m_CoreContext.GetDynamicObjectSystemCore().CreateInstance(
- inEffectName, inSceneGraphAllocator);
- theEffect->Initialize();
- return theEffect;
- }
-
- void AllocateBuffer(SEffect &inEffect, const SAllocateBuffer &inCommand, QT3DSU32 inFinalWidth,
- QT3DSU32 inFinalHeight, NVRenderTextureFormats::Enum inSourceTextureFormat)
- {
- // Check to see if it is already allocated and if it is, is it the correct size. If both of
- // these assumptions hold, then we are good.
- NVRenderTexture2D *theBufferTexture = NULL;
- QT3DSU32 theWidth =
- ITextRenderer::NextMultipleOf4((QT3DSU32)(inFinalWidth * inCommand.m_SizeMultiplier));
- QT3DSU32 theHeight =
- ITextRenderer::NextMultipleOf4((QT3DSU32)(inFinalHeight * inCommand.m_SizeMultiplier));
- NVRenderTextureFormats::Enum resultFormat = inCommand.m_Format;
- if (resultFormat == NVRenderTextureFormats::Unknown)
- resultFormat = inSourceTextureFormat;
-
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- // size intentionally requiried every loop;
- QT3DSU32 bufferIdx = theContext.FindBuffer(inCommand.m_Name);
- if (bufferIdx < theContext.m_AllocatedBuffers.size()) {
- SAllocatedBufferEntry &theEntry(theContext.m_AllocatedBuffers[bufferIdx]);
- STextureDetails theDetails = theEntry.m_Texture->GetTextureDetails();
- if (theDetails.m_Width == theWidth && theDetails.m_Height == theHeight
- && theDetails.m_Format == resultFormat) {
- theBufferTexture = theEntry.m_Texture;
- } else {
- theContext.ReleaseBuffer(bufferIdx);
- }
- }
- }
- if (theBufferTexture == NULL) {
- SEffectContext &theContext(GetEffectContext(inEffect));
- NVRenderFrameBuffer *theFB(m_ResourceManager->AllocateFrameBuffer());
- NVRenderTexture2D *theTexture(
- m_ResourceManager->AllocateTexture2D(theWidth, theHeight, resultFormat));
- theTexture->SetMagFilter(inCommand.m_FilterOp);
- theTexture->SetMinFilter(
- static_cast<NVRenderTextureMinifyingOp::Enum>(inCommand.m_FilterOp));
- theTexture->SetTextureWrapS(inCommand.m_TexCoordOp);
- theTexture->SetTextureWrapT(inCommand.m_TexCoordOp);
- theFB->Attach(NVRenderFrameBufferAttachments::Color0, *theTexture);
- theContext.m_AllocatedBuffers.push_back(SAllocatedBufferEntry(
- inCommand.m_Name, *theFB, *theTexture, inCommand.m_BufferFlags));
- theBufferTexture = theTexture;
- }
- }
-
- void AllocateImage(SEffect &inEffect, const SAllocateImage &inCommand, QT3DSU32 inFinalWidth,
- QT3DSU32 inFinalHeight)
- {
- NVRenderImage2D *theImage = NULL;
- QT3DSU32 theWidth =
- ITextRenderer::NextMultipleOf4((QT3DSU32)(inFinalWidth * inCommand.m_SizeMultiplier));
- QT3DSU32 theHeight =
- ITextRenderer::NextMultipleOf4((QT3DSU32)(inFinalHeight * inCommand.m_SizeMultiplier));
-
- QT3DS_ASSERT(inCommand.m_Format != NVRenderTextureFormats::Unknown);
-
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- // size intentionally requiried every loop;
- QT3DSU32 imageIdx = theContext.FindImage(inCommand.m_Name);
- if (imageIdx < theContext.m_AllocatedImages.size()) {
- SAllocatedImageEntry &theEntry(theContext.m_AllocatedImages[imageIdx]);
- STextureDetails theDetails = theEntry.m_Texture->GetTextureDetails();
- if (theDetails.m_Width == theWidth && theDetails.m_Height == theHeight
- && theDetails.m_Format == inCommand.m_Format) {
- theImage = theEntry.m_Image;
- } else {
- theContext.ReleaseImage(imageIdx);
- }
- }
- }
-
- if (theImage == NULL) {
- SEffectContext &theContext(GetEffectContext(inEffect));
- // allocate an immutable texture
- NVRenderTexture2D *theTexture(m_ResourceManager->AllocateTexture2D(
- theWidth, theHeight, inCommand.m_Format, 1, true));
- theTexture->SetMagFilter(inCommand.m_FilterOp);
- theTexture->SetMinFilter(
- static_cast<NVRenderTextureMinifyingOp::Enum>(inCommand.m_FilterOp));
- theTexture->SetTextureWrapS(inCommand.m_TexCoordOp);
- theTexture->SetTextureWrapT(inCommand.m_TexCoordOp);
- NVRenderImage2D *theImage =
- (m_ResourceManager->AllocateImage2D(theTexture, inCommand.m_Access));
- theContext.m_AllocatedImages.push_back(SAllocatedImageEntry(
- inCommand.m_Name, *theImage, *theTexture, inCommand.m_BufferFlags));
- }
- }
-
- void AllocateDataBuffer(SEffect &inEffect, const SAllocateDataBuffer &inCommand)
- {
- QT3DSU32 theBufferSize = (QT3DSU32)inCommand.m_Size;
- QT3DS_ASSERT(theBufferSize);
- qt3ds::render::NVRenderDataBuffer *theDataBuffer = NULL;
- qt3ds::render::NVRenderDataBuffer *theDataWrapBuffer = NULL;
-
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- // size intentionally requiried every loop;
- QT3DSU32 bufferIdx = theContext.FindDataBuffer(inCommand.m_Name);
- if (bufferIdx < theContext.m_AllocatedDataBuffers.size()) {
- SAllocatedDataBufferEntry &theEntry(theContext.m_AllocatedDataBuffers[bufferIdx]);
- if (theEntry.m_BufferType == inCommand.m_DataBufferType
- && theEntry.m_BufferData.size() == theBufferSize) {
- theDataBuffer = theEntry.m_DataBuffer;
- } else {
- // if type and size don't match something is wrong
- QT3DS_ASSERT(false);
- }
- }
- }
-
- if (theDataBuffer == NULL) {
- SEffectContext &theContext(GetEffectContext(inEffect));
- NVRenderContext &theRenderContext(m_Context->GetRenderContext());
- QT3DSU8 *initialData = (QT3DSU8 *)theContext.m_Context.GetAllocator().allocate(
- theBufferSize, "SEffectContext::AllocateDataBuffer", __FILE__, __LINE__);
- NVDataRef<QT3DSU8> data((QT3DSU8 *)initialData, theBufferSize);
- memset(initialData, 0x0L, theBufferSize);
- if (inCommand.m_DataBufferType == NVRenderBufferBindValues::Storage) {
- theDataBuffer = theRenderContext.CreateStorageBuffer(
- inCommand.m_Name, qt3ds::render::NVRenderBufferUsageType::Dynamic, theBufferSize,
- data, NULL);
- } else if (inCommand.m_DataBufferType == NVRenderBufferBindValues::Draw_Indirect) {
- QT3DS_ASSERT(theBufferSize == sizeof(qt3ds::render::DrawArraysIndirectCommand));
- // init a draw call
- QT3DSU32 *pIndirectDrawCall = (QT3DSU32 *)initialData;
- // vertex count we draw points right now only
- // the rest we fill in by GPU
- pIndirectDrawCall[0] = 1;
- theDataBuffer = theRenderContext.CreateDrawIndirectBuffer(
- qt3ds::render::NVRenderBufferUsageType::Dynamic, theBufferSize, data);
- } else
- QT3DS_ASSERT(false);
-
- theContext.m_AllocatedDataBuffers.push_back(SAllocatedDataBufferEntry(
- inCommand.m_Name, *theDataBuffer, inCommand.m_DataBufferType, data,
- inCommand.m_BufferFlags));
-
- // create wrapper buffer
- if (inCommand.m_DataBufferWrapType == NVRenderBufferBindValues::Storage
- && inCommand.m_WrapName && theDataBuffer) {
- theDataWrapBuffer = theRenderContext.CreateStorageBuffer(
- inCommand.m_WrapName, qt3ds::render::NVRenderBufferUsageType::Dynamic,
- theBufferSize, data, theDataBuffer);
- theContext.m_AllocatedDataBuffers.push_back(SAllocatedDataBufferEntry(
- inCommand.m_WrapName, *theDataWrapBuffer, inCommand.m_DataBufferWrapType,
- NVDataRef<QT3DSU8>(), inCommand.m_BufferFlags));
- }
- }
- }
-
- NVRenderTexture2D *FindTexture(SEffect &inEffect, CRegisteredString inName)
- {
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- QT3DSU32 bufferIdx = theContext.FindBuffer(inName);
- if (bufferIdx < theContext.m_AllocatedBuffers.size()) {
- return theContext.m_AllocatedBuffers[bufferIdx].m_Texture;
- }
- }
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- NVRenderFrameBuffer *BindBuffer(SEffect &inEffect, const SBindBuffer &inCommand,
- QT3DSMat44 &outMVP, QT3DSVec2 &outDestSize)
- {
- NVRenderFrameBuffer *theBuffer = NULL;
- NVRenderTexture2D *theTexture = NULL;
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- QT3DSU32 bufferIdx = theContext.FindBuffer(inCommand.m_BufferName);
- if (bufferIdx < theContext.m_AllocatedBuffers.size()) {
- theBuffer = theContext.m_AllocatedBuffers[bufferIdx].m_FrameBuffer;
- theTexture = theContext.m_AllocatedBuffers[bufferIdx].m_Texture;
- theContext.m_AllocatedBuffers[bufferIdx].m_NeedsClear = false;
- }
- }
- if (theBuffer == NULL) {
- qCCritical(INVALID_OPERATION, "Effect %s: Failed to find buffer %s for bind",
- inEffect.m_ClassName.c_str(), inCommand.m_BufferName.c_str());
- QString errorMsg = QObject::tr("Failed to compile \"%1\" effect.\nConsider"
- " removing it from the presentation.")
- .arg(inEffect.m_ClassName.c_str());
- QT3DS_ALWAYS_ASSERT_MESSAGE(errorMsg.toUtf8());
- outMVP = QT3DSMat44::createIdentity();
- return NULL;
- }
-
- if (theTexture) {
- SCamera::SetupOrthographicCameraForOffscreenRender(*theTexture, outMVP);
- STextureDetails theDetails(theTexture->GetTextureDetails());
- m_Context->GetRenderContext().SetViewport(
- NVRenderRect(0, 0, (QT3DSU32)theDetails.m_Width, (QT3DSU32)theDetails.m_Height));
- outDestSize = QT3DSVec2((QT3DSF32)theDetails.m_Width, (QT3DSF32)theDetails.m_Height);
- }
-
- return theBuffer;
- }
-
- SEffectShader *BindShader(CRegisteredString &inEffectId, const SBindShader &inCommand)
- {
- SEffectClass *theClass = GetEffectClass(inEffectId);
- if (!theClass) {
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- bool forceCompilation = theClass->m_DynamicClass->RequiresCompilation();
-
- eastl::pair<const TStrStrPair, NVScopedRefCounted<SEffectShader>> theInserter(
- TStrStrPair(inCommand.m_ShaderPath, inCommand.m_ShaderDefine),
- NVScopedRefCounted<SEffectShader>());
- eastl::pair<TShaderMap::iterator, bool> theInsertResult(m_ShaderMap.insert(theInserter));
-
- if (theInsertResult.second || forceCompilation) {
- NVRenderShaderProgram *theProgram =
- m_Context->GetDynamicObjectSystem()
- .GetShaderProgram(inCommand.m_ShaderPath, inCommand.m_ShaderDefine,
- TShaderFeatureSet(), SDynamicShaderProgramFlags(),
- forceCompilation).first;
- if (theProgram)
- theInsertResult.first->second = QT3DS_NEW(m_Allocator, SEffectShader)(*theProgram);
- }
- if (theInsertResult.first->second) {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- theContext.SetActiveShader(theInsertResult.first->second->m_Shader);
- }
-
- return theInsertResult.first->second;
- }
-
- void DoApplyInstanceValue(SEffect &inEffect, QT3DSU8 *inDataPtr, CRegisteredString inPropertyName,
- NVRenderShaderDataTypes::Enum inPropertyType,
- NVRenderShaderProgram &inShader,
- const SPropertyDefinition &inDefinition)
- {
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(inPropertyName);
- using namespace qt3ds::render;
- if (theConstant) {
- if (theConstant->GetShaderConstantType() == inPropertyType) {
- if (inPropertyType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- StaticAssert<sizeof(CRegisteredString)
- == sizeof(NVRenderTexture2DPtr)>::valid_expression();
- CRegisteredString *theStrPtr = reinterpret_cast<CRegisteredString *>(inDataPtr);
- IBufferManager &theBufferManager(m_Context->GetBufferManager());
- IOffscreenRenderManager &theOffscreenRenderer(
- m_Context->GetOffscreenRenderManager());
- bool needsAlphaMultiply = true;
- NVRenderTexture2D *theTexture = nullptr;
- if (theStrPtr->IsValid()) {
- if (theOffscreenRenderer.HasOffscreenRenderer(*theStrPtr)) {
- SOffscreenRenderResult theResult
- = theOffscreenRenderer.GetRenderedItem(*theStrPtr);
- needsAlphaMultiply = false;
- theTexture = theResult.m_Texture;
- } else {
- SImageTextureData theTextureData
- = theBufferManager.LoadRenderImage(*theStrPtr);
- needsAlphaMultiply = true;
- theTexture = theTextureData.m_Texture;
- }
- }
- GetEffectContext(inEffect).SetTexture(
- inShader, inPropertyName, theTexture, needsAlphaMultiply,
- m_TextureStringBuilder, m_TextureStringBuilder2, &inDefinition);
- } else if (inPropertyType == NVRenderShaderDataTypes::NVRenderImage2DPtr) {
- StaticAssert<sizeof(CRegisteredString)
- == sizeof(NVRenderTexture2DPtr)>::valid_expression();
- NVRenderImage2D *theImage = NULL;
- GetEffectContext(inEffect).SetImage(inShader, inPropertyName, theImage);
- } else if (inPropertyType == NVRenderShaderDataTypes::NVRenderDataBufferPtr) {
- // we don't handle this here
- } else {
- switch (inPropertyType) {
-#define HANDLE_QT3DS_SHADER_DATA_TYPE(type) \
- case NVRenderShaderDataTypes::type: \
- inShader.SetPropertyValue(theConstant, *(reinterpret_cast<type *>(inDataPtr))); \
- break;
- ITERATE_QT3DS_SHADER_DATA_TYPES
-#undef HANDLE_QT3DS_SHADER_DATA_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- } else {
- qCCritical(INVALID_OPERATION,
- "Effect ApplyInstanceValue command datatype "
- "and shader datatypes differ for property %s",
- inPropertyName.c_str());
- QT3DS_ASSERT(false);
- }
- }
- }
-
- void ApplyInstanceValue(SEffect &inEffect, SEffectClass &inClass,
- NVRenderShaderProgram &inShader, const SApplyInstanceValue &inCommand)
- {
- // sanity check
- if (inCommand.m_PropertyName.IsValid()) {
- bool canGetData =
- inCommand.m_ValueOffset + getSizeofShaderDataType(inCommand.m_ValueType)
- <= inEffect.m_DataSectionByteSize;
- if (canGetData == false) {
- QT3DS_ASSERT(false);
- return;
- }
- QT3DSU8 *dataPtr = inEffect.GetDataSectionBegin() + inCommand.m_ValueOffset;
- const SPropertyDefinition *theDefinition =
- inClass.m_DynamicClass->FindPropertyByName(inCommand.m_PropertyName);
- if (theDefinition)
- DoApplyInstanceValue(inEffect, dataPtr, inCommand.m_PropertyName,
- inCommand.m_ValueType, inShader, *theDefinition);
- } else {
- NVConstDataRef<SPropertyDefinition> theDefs = inClass.m_DynamicClass->GetProperties();
- for (QT3DSU32 idx = 0, end = theDefs.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(theDefs[idx]);
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(theDefinition.m_Name);
-
- // This is fine, the property wasn't found and we continue, no problem.
- if (!theConstant)
- continue;
- QT3DSU8 *dataPtr = inEffect.GetDataSectionBegin() + theDefinition.m_Offset;
- DoApplyInstanceValue(inEffect, dataPtr, theDefinition.m_Name,
- theDefinition.m_DataType, inShader, theDefinition);
- }
- }
- }
-
- void ApplyValue(SEffect &inEffect, SEffectClass &inClass, NVRenderShaderProgram &inShader,
- const SApplyValue &inCommand)
- {
- if (inCommand.m_PropertyName.IsValid()) {
- QT3DSU8 *dataPtr = inCommand.m_Value.mData;
- const SPropertyDefinition *theDefinition =
- inClass.m_DynamicClass->FindPropertyByName(inCommand.m_PropertyName);
- if (theDefinition)
- DoApplyInstanceValue(inEffect, dataPtr, inCommand.m_PropertyName,
- inCommand.m_ValueType, inShader, *theDefinition);
- }
- }
-
- bool ApplyBlending(const SApplyBlending &inCommand)
- {
- NVRenderContext &theContext(m_Context->GetRenderContext());
-
- theContext.SetBlendingEnabled(true);
-
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc =
- qt3ds::render::NVRenderBlendFunctionArgument(
- inCommand.m_SrcBlendFunc, inCommand.m_DstBlendFunc, inCommand.m_SrcBlendFunc,
- inCommand.m_DstBlendFunc);
-
- qt3ds::render::NVRenderBlendEquationArgument blendEqu(NVRenderBlendEquation::Add,
- NVRenderBlendEquation::Add);
-
- theContext.SetBlendFunction(blendFunc);
- theContext.SetBlendEquation(blendEqu);
-
- return true;
- }
-
- // This has the potential to change the source texture for the current render pass
- SEffectTextureData ApplyBufferValue(SEffect &inEffect, NVRenderShaderProgram &inShader,
- const SApplyBufferValue &inCommand,
- NVRenderTexture2D &inSourceTexture,
- SEffectTextureData inCurrentSourceTexture)
- {
- SEffectTextureData theTextureToBind;
- if (inCommand.m_BufferName.IsValid()) {
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- QT3DSU32 bufferIdx = theContext.FindBuffer(inCommand.m_BufferName);
- if (bufferIdx < theContext.m_AllocatedBuffers.size()) {
- SAllocatedBufferEntry &theEntry(theContext.m_AllocatedBuffers[bufferIdx]);
- if (theEntry.m_NeedsClear) {
- NVRenderContext &theRenderContext(m_Context->GetRenderContext());
-
- theRenderContext.SetRenderTarget(theEntry.m_FrameBuffer);
- // Note that depth/stencil buffers need an explicit clear in their bind
- // commands in order to ensure
- // we clear the least amount of information possible.
-
- if (theEntry.m_Texture) {
- NVRenderTextureFormats::Enum theTextureFormat =
- theEntry.m_Texture->GetTextureDetails().m_Format;
- if (theTextureFormat != NVRenderTextureFormats::Depth16
- && theTextureFormat != NVRenderTextureFormats::Depth24
- && theTextureFormat != NVRenderTextureFormats::Depth32
- && theTextureFormat != NVRenderTextureFormats::Depth24Stencil8) {
- NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- theRenderContext, &NVRenderContext::GetClearColor,
- &NVRenderContext::SetClearColor, QT3DSVec4(0.0f));
- theRenderContext.Clear(qt3ds::render::NVRenderClearValues::Color);
- }
- }
- theEntry.m_NeedsClear = false;
- }
- theTextureToBind = SEffectTextureData(theEntry.m_Texture, false);
- }
- }
- if (theTextureToBind.m_Texture == NULL) {
- QT3DS_ASSERT(false);
- qCCritical(INVALID_OPERATION, "Effect %s: Failed to find buffer %s for bind",
- inEffect.m_ClassName.c_str(), inCommand.m_BufferName.c_str());
- QT3DS_ASSERT(false);
- }
- } else // no name means bind the source
- theTextureToBind = SEffectTextureData(&inSourceTexture, false);
-
- if (inCommand.m_ParamName.IsValid()) {
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(inCommand.m_ParamName);
-
- if (theConstant) {
- if (theConstant->GetShaderConstantType()
- != NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- qCCritical(INVALID_OPERATION,
- "Effect %s: Binding buffer to parameter %s that is not a texture",
- inEffect.m_ClassName.c_str(), inCommand.m_ParamName.c_str());
- QT3DS_ASSERT(false);
- } else {
- GetEffectContext(inEffect).SetTexture(
- inShader, inCommand.m_ParamName, theTextureToBind.m_Texture,
- theTextureToBind.m_NeedsAlphaMultiply, m_TextureStringBuilder,
- m_TextureStringBuilder2);
- }
- }
- return inCurrentSourceTexture;
- } else {
- return theTextureToBind;
- }
- }
-
- void ApplyDepthValue(SEffect &inEffect, NVRenderShaderProgram &inShader,
- const SApplyDepthValue &inCommand, NVRenderTexture2D *inTexture)
- {
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(inCommand.m_ParamName);
-
- if (theConstant) {
- if (theConstant->GetShaderConstantType()
- != NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- qCCritical(INVALID_OPERATION,
- "Effect %s: Binding buffer to parameter %s that is not a texture",
- inEffect.m_ClassName.c_str(), inCommand.m_ParamName.c_str());
- QT3DS_ASSERT(false);
- } else {
- GetEffectContext(inEffect).SetTexture(inShader, inCommand.m_ParamName, inTexture,
- false, m_TextureStringBuilder,
- m_TextureStringBuilder2);
- }
- }
- }
-
- void ApplyImageValue(SEffect &inEffect, NVRenderShaderProgram &inShader,
- const SApplyImageValue &inCommand)
- {
- SAllocatedImageEntry theImageToBind;
- if (inCommand.m_ImageName.IsValid()) {
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- QT3DSU32 bufferIdx = theContext.FindImage(inCommand.m_ImageName);
- if (bufferIdx < theContext.m_AllocatedImages.size()) {
- theImageToBind = SAllocatedImageEntry(theContext.m_AllocatedImages[bufferIdx]);
- }
- }
- }
-
- if (theImageToBind.m_Image == NULL) {
- qCCritical(INVALID_OPERATION, "Effect %s: Failed to find image %s for bind",
- inEffect.m_ClassName.c_str(), inCommand.m_ImageName.c_str());
- QT3DS_ASSERT(false);
- }
-
- if (inCommand.m_ParamName.IsValid()) {
- qt3ds::render::NVRenderShaderConstantBase *theConstant =
- inShader.GetShaderConstant(inCommand.m_ParamName);
-
- if (theConstant) {
- if (inCommand.m_NeedSync) {
- NVRenderBufferBarrierFlags flags(
- qt3ds::render::NVRenderBufferBarrierValues::TextureFetch
- | qt3ds::render::NVRenderBufferBarrierValues::TextureUpdate);
- inShader.GetRenderContext().SetMemoryBarrier(flags);
- }
-
- if (theConstant->GetShaderConstantType()
- == NVRenderShaderDataTypes::NVRenderImage2DPtr
- && !inCommand.m_BindAsTexture) {
- GetEffectContext(inEffect).SetImage(inShader, inCommand.m_ParamName,
- theImageToBind.m_Image);
- } else if (theConstant->GetShaderConstantType()
- == NVRenderShaderDataTypes::NVRenderTexture2DPtr
- && inCommand.m_BindAsTexture) {
- GetEffectContext(inEffect).SetTexture(
- inShader, inCommand.m_ParamName, theImageToBind.m_Texture, false,
- m_TextureStringBuilder, m_TextureStringBuilder2);
- } else {
- qCCritical(INVALID_OPERATION,
- "Effect %s: Binding buffer to parameter %s that is not a texture",
- inEffect.m_ClassName.c_str(), inCommand.m_ParamName.c_str());
- QT3DS_ASSERT(false);
- }
- }
- }
- }
-
- void ApplyDataBufferValue(SEffect &inEffect, NVRenderShaderProgram &inShader,
- const SApplyDataBufferValue &inCommand)
- {
- SAllocatedDataBufferEntry theBufferToBind;
- if (inCommand.m_ParamName.IsValid()) {
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- QT3DSU32 bufferIdx = theContext.FindDataBuffer(inCommand.m_ParamName);
- if (bufferIdx < theContext.m_AllocatedDataBuffers.size()) {
- theBufferToBind =
- SAllocatedDataBufferEntry(theContext.m_AllocatedDataBuffers[bufferIdx]);
- if (theBufferToBind.m_NeedsClear) {
- NVDataRef<QT3DSU8> pData = theBufferToBind.m_DataBuffer->MapBuffer();
- memset(pData.begin(), 0x0L, theBufferToBind.m_BufferData.size());
- theBufferToBind.m_DataBuffer->UnmapBuffer();
- theBufferToBind.m_NeedsClear = false;
- }
- }
- }
-
- if (theBufferToBind.m_DataBuffer == NULL) {
- qCCritical(INVALID_OPERATION, "Effect %s: Failed to find buffer %s for bind",
- inEffect.m_ClassName.c_str(), inCommand.m_ParamName.c_str());
- QT3DS_ASSERT(false);
- }
-
- qt3ds::render::NVRenderShaderBufferBase *theConstant =
- inShader.GetShaderBuffer(inCommand.m_ParamName);
-
- if (theConstant) {
- GetEffectContext(inEffect).SetDataBuffer(inShader, inCommand.m_ParamName,
- theBufferToBind.m_DataBuffer);
- } else if (theBufferToBind.m_BufferType
- == qt3ds::render::NVRenderBufferBindValues::Draw_Indirect) {
- // since we filled part of this buffer on the GPU we need a sync before usage
- NVRenderBufferBarrierFlags flags(
- qt3ds::render::NVRenderBufferBarrierValues::CommandBuffer);
- inShader.GetRenderContext().SetMemoryBarrier(flags);
- }
- }
- }
-
- void ApplyRenderStateValue(NVRenderFrameBuffer *inTarget,
- NVRenderTexture2D *inDepthStencilTexture,
- const SApplyRenderState &theCommand)
- {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- QT3DSU32 inState = (QT3DSU32)theCommand.m_RenderState;
- bool inEnable = theCommand.m_Enabled;
-
- switch (inState) {
- case NVRenderState::StencilTest: {
- if (inEnable && inTarget) {
- inTarget->Attach(NVRenderFrameBufferAttachments::DepthStencil,
- *inDepthStencilTexture);
- } else if (inTarget) {
- inTarget->Attach(NVRenderFrameBufferAttachments::DepthStencil,
- NVRenderTextureOrRenderBuffer());
- }
-
- theContext.SetStencilTestEnabled(inEnable);
- } break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- static bool CompareDepthStencilState(NVRenderDepthStencilState &inState,
- SDepthStencil &inStencil)
- {
- qt3ds::render::NVRenderStencilFunctionArgument theFunction =
- inState.GetStencilFunc(qt3ds::render::NVRenderFaces::Front);
- qt3ds::render::NVRenderStencilOperationArgument theOperation =
- inState.GetStencilOp(qt3ds::render::NVRenderFaces::Front);
-
- return theFunction.m_Function == inStencil.m_StencilFunction
- && theFunction.m_Mask == inStencil.m_Mask
- && theFunction.m_ReferenceValue == inStencil.m_Reference
- && theOperation.m_StencilFail == inStencil.m_StencilFailOperation
- && theOperation.m_DepthFail == inStencil.m_DepthFailOperation
- && theOperation.m_DepthPass == inStencil.m_DepthPassOperation;
- }
-
- void RenderPass(SEffectShader &inShader, const QT3DSMat44 &inMVP,
- SEffectTextureData inSourceTexture, NVRenderFrameBuffer *inFrameBuffer,
- QT3DSVec2 &inDestSize, const QT3DSVec2 &inCameraClipRange,
- NVRenderTexture2D *inDepthStencil, Option<SDepthStencil> inDepthStencilCommand,
- bool drawIndirect)
- {
- NVRenderContext &theContext(m_Context->GetRenderContext());
- theContext.SetRenderTarget(inFrameBuffer);
- if (inDepthStencil && inFrameBuffer) {
- inFrameBuffer->Attach(NVRenderFrameBufferAttachments::DepthStencil, *inDepthStencil);
- if (inDepthStencilCommand.hasValue()) {
- SDepthStencil &theDepthStencil(*inDepthStencilCommand);
- QT3DSU32 clearFlags = 0;
- if (theDepthStencil.m_Flags.HasClearStencil())
- clearFlags |= NVRenderClearValues::Stencil;
- if (theDepthStencil.m_Flags.HasClearDepth())
- clearFlags |= NVRenderClearValues::Depth;
-
- if (clearFlags)
- theContext.Clear(qt3ds::render::NVRenderClearFlags(clearFlags));
-
- NVRenderDepthStencilState *targetState = NULL;
- for (QT3DSU32 idx = 0, end = m_DepthStencilStates.size();
- idx < end && targetState == NULL; ++idx) {
- NVRenderDepthStencilState &theState = *m_DepthStencilStates[idx];
- if (CompareDepthStencilState(theState, theDepthStencil))
- targetState = &theState;
- }
- if (targetState == NULL) {
- qt3ds::render::NVRenderStencilFunctionArgument theFunctionArg(
- theDepthStencil.m_StencilFunction, theDepthStencil.m_Reference,
- theDepthStencil.m_Mask);
- qt3ds::render::NVRenderStencilOperationArgument theOpArg(
- theDepthStencil.m_StencilFailOperation,
- theDepthStencil.m_DepthFailOperation, theDepthStencil.m_DepthPassOperation);
- targetState = theContext.CreateDepthStencilState(
- theContext.IsDepthTestEnabled(), theContext.IsDepthWriteEnabled(),
- theContext.GetDepthFunction(), true, theFunctionArg, theFunctionArg,
- theOpArg, theOpArg);
- m_DepthStencilStates.push_back(targetState);
- }
- theContext.SetDepthStencilState(targetState);
- }
- }
-
- theContext.SetActiveShader(inShader.m_Shader);
- inShader.m_MVP.Set(inMVP);
- if (inSourceTexture.m_Texture) {
- inShader.m_TextureEntry.Set(inSourceTexture.m_Texture,
- inSourceTexture.m_NeedsAlphaMultiply, NULL);
- } else {
- qCCritical(INTERNAL_ERROR, "Failed to setup pass due to null source texture");
- QT3DS_ASSERT(false);
- }
- inShader.m_FragColorAlphaSettings.Set(QT3DSVec2(1.0f, 0.0f));
- inShader.m_DestSize.Set(inDestSize);
- if (inShader.m_AppFrame.IsValid())
- inShader.m_AppFrame.Set((QT3DSF32)m_Context->GetFrameCount());
- if (inShader.m_FPS.IsValid())
- inShader.m_FPS.Set((QT3DSF32)m_Context->GetFPS().first);
- if (inShader.m_CameraClipRange.IsValid())
- inShader.m_CameraClipRange.Set(inCameraClipRange);
-
- if (!drawIndirect)
- m_Context->GetRenderer().RenderQuad();
- else
- m_Context->GetRenderer().RenderPointsIndirect();
-
- if (inDepthStencil && inFrameBuffer) {
- inFrameBuffer->Attach(NVRenderFrameBufferAttachments::DepthStencil,
- NVRenderTextureOrRenderBuffer());
- theContext.SetDepthStencilState(m_DefaultStencilState);
- }
- }
-
- void DoRenderEffect(SEffect &inEffect, SEffectClass &inClass,
- NVRenderTexture2D &inSourceTexture, QT3DSMat44 &inMVP,
- NVRenderFrameBuffer *inTarget, bool inEnableBlendWhenRenderToTarget,
- NVRenderTexture2D *inDepthTexture, NVRenderTexture2D *inDepthStencilTexture,
- const QT3DSVec2 inCameraClipRange)
- {
- // Run through the effect commands and render the effect.
- // NVRenderTexture2D* theCurrentTexture(&inSourceTexture);
- NVRenderContext &theContext = m_Context->GetRenderContext();
-
- // Context variables that are updated during the course of a pass.
- SEffectTextureData theCurrentSourceTexture(&inSourceTexture, false);
- NVRenderTexture2D *theCurrentDepthStencilTexture = NULL;
- NVRenderFrameBuffer *theCurrentRenderTarget(inTarget);
- SEffectShader *theCurrentShader(NULL);
- NVRenderRect theOriginalViewport(theContext.GetViewport());
- bool wasScissorEnabled = theContext.IsScissorTestEnabled();
- bool wasBlendingEnabled = theContext.IsBlendingEnabled();
- // save current blending setup
- qt3ds::render::NVRenderBlendFunctionArgument theBlendFunc = theContext.GetBlendFunction();
- qt3ds::render::NVRenderBlendEquationArgument theBlendEqu = theContext.GetBlendEquation();
- bool intermediateBlendingEnabled = false;
- STextureDetails theDetails(inSourceTexture.GetTextureDetails());
- QT3DSU32 theFinalWidth = (QT3DSU32)(theDetails.m_Width);
- QT3DSU32 theFinalHeight = (QT3DSU32)(theDetails.m_Height);
- QT3DSVec2 theDestSize;
- {
- // Ensure no matter the command run goes we replace the rendering system to some
- // semblance of the approprate
- // setting.
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __framebuffer(
- theContext, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport);
- NVRenderContextScopedProperty<bool> __scissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled);
- NVRenderContextScopedProperty<bool> __stencilTest(
- theContext, &NVRenderContext::IsStencilTestEnabled,
- &NVRenderContext::SetStencilTestEnabled);
- NVRenderContextScopedProperty<qt3ds::render::NVRenderBoolOp::Enum> __depthFunction(
- theContext, &NVRenderContext::GetDepthFunction, &NVRenderContext::SetDepthFunction);
- Option<SDepthStencil> theCurrentDepthStencil;
-
- theContext.SetScissorTestEnabled(false);
- theContext.SetBlendingEnabled(false);
- theContext.SetCullingEnabled(false);
- theContext.SetDepthTestEnabled(false);
- theContext.SetDepthWriteEnabled(false);
-
- QT3DSMat44 theMVP(QT3DSMat44::createIdentity());
- NVConstDataRef<dynamic::SCommand *> theCommands =
- inClass.m_DynamicClass->GetRenderCommands();
- for (QT3DSU32 commandIdx = 0, commandEnd = theCommands.size(); commandIdx < commandEnd;
- ++commandIdx) {
- const SCommand &theCommand(*theCommands[commandIdx]);
- switch (theCommand.m_Type) {
- case CommandTypes::AllocateBuffer:
- AllocateBuffer(inEffect, static_cast<const SAllocateBuffer &>(theCommand),
- theFinalWidth, theFinalHeight, theDetails.m_Format);
- break;
-
- case CommandTypes::AllocateImage:
- AllocateImage(inEffect, static_cast<const SAllocateImage &>(theCommand),
- theFinalWidth, theFinalHeight);
- break;
-
- case CommandTypes::AllocateDataBuffer:
- AllocateDataBuffer(inEffect,
- static_cast<const SAllocateDataBuffer &>(theCommand));
- break;
-
- case CommandTypes::BindBuffer:
- theCurrentRenderTarget =
- BindBuffer(inEffect, static_cast<const SBindBuffer &>(theCommand), theMVP,
- theDestSize);
- break;
-
- case CommandTypes::BindTarget: {
- m_Context->GetRenderContext().SetRenderTarget(inTarget);
- theCurrentRenderTarget = inTarget;
- theMVP = inMVP;
- theContext.SetViewport(theOriginalViewport);
- theDestSize = QT3DSVec2((QT3DSF32)theFinalWidth, (QT3DSF32)theFinalHeight);
- // This isn't necessary if we are rendering to an offscreen buffer and not
- // compositing
- // with other objects.
- if (inEnableBlendWhenRenderToTarget) {
- theContext.SetBlendingEnabled(wasBlendingEnabled);
- theContext.SetScissorTestEnabled(wasScissorEnabled);
- // The blending setup was done before we apply the effect
- theContext.SetBlendFunction(theBlendFunc);
- theContext.SetBlendEquation(theBlendEqu);
- }
- } break;
- case CommandTypes::BindShader:
- theCurrentShader = BindShader(inEffect.m_ClassName,
- static_cast<const SBindShader &>(theCommand));
- break;
- case CommandTypes::ApplyInstanceValue:
- if (theCurrentShader)
- ApplyInstanceValue(inEffect, inClass, *theCurrentShader->m_Shader,
- static_cast<const SApplyInstanceValue &>(theCommand));
- break;
- case CommandTypes::ApplyValue:
- if (theCurrentShader)
- ApplyValue(inEffect, inClass, *theCurrentShader->m_Shader,
- static_cast<const SApplyValue &>(theCommand));
- break;
- case CommandTypes::ApplyBlending:
- intermediateBlendingEnabled =
- ApplyBlending(static_cast<const SApplyBlending &>(theCommand));
- break;
- case CommandTypes::ApplyBufferValue:
- if (theCurrentShader)
- theCurrentSourceTexture =
- ApplyBufferValue(inEffect, *theCurrentShader->m_Shader,
- static_cast<const SApplyBufferValue &>(theCommand),
- inSourceTexture, theCurrentSourceTexture);
- break;
- case CommandTypes::ApplyDepthValue:
- if (theCurrentShader)
- ApplyDepthValue(inEffect, *theCurrentShader->m_Shader,
- static_cast<const SApplyDepthValue &>(theCommand),
- inDepthTexture);
- if (!inDepthTexture) {
- qCCritical(INVALID_OPERATION,
- "Depth value command detected but no "
- "depth buffer provided for effect %s",
- inEffect.m_ClassName.c_str());
- QT3DS_ASSERT(false);
- }
- break;
- case CommandTypes::ApplyImageValue:
- if (theCurrentShader)
- ApplyImageValue(inEffect, *theCurrentShader->m_Shader,
- static_cast<const SApplyImageValue &>(theCommand));
- break;
- case CommandTypes::ApplyDataBufferValue:
- if (theCurrentShader)
- ApplyDataBufferValue(
- inEffect, *theCurrentShader->m_Shader,
- static_cast<const SApplyDataBufferValue &>(theCommand));
- break;
- case CommandTypes::DepthStencil: {
- const SDepthStencil &theDepthStencil =
- static_cast<const SDepthStencil &>(theCommand);
- theCurrentDepthStencilTexture =
- FindTexture(inEffect, theDepthStencil.m_BufferName);
- if (theCurrentDepthStencilTexture)
- theCurrentDepthStencil = theDepthStencil;
- } break;
- case CommandTypes::Render:
- if (theCurrentShader && theCurrentSourceTexture.m_Texture) {
- RenderPass(*theCurrentShader, theMVP, theCurrentSourceTexture,
- theCurrentRenderTarget, theDestSize, inCameraClipRange,
- theCurrentDepthStencilTexture, theCurrentDepthStencil,
- static_cast<const SRender &>(theCommand).m_DrawIndirect);
- }
- // Reset the source texture regardless
- theCurrentSourceTexture = SEffectTextureData(&inSourceTexture, false);
- theCurrentDepthStencilTexture = NULL;
- theCurrentDepthStencil = Option<SDepthStencil>();
- // reset intermediate blending state
- if (intermediateBlendingEnabled) {
- theContext.SetBlendingEnabled(false);
- intermediateBlendingEnabled = false;
- }
- break;
- case CommandTypes::ApplyRenderState:
- ApplyRenderStateValue(theCurrentRenderTarget, inDepthStencilTexture,
- static_cast<const SApplyRenderState &>(theCommand));
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- SetEffectRequiresCompilation(inEffect.m_ClassName, false);
-
- // reset to default stencil state
- if (inDepthStencilTexture) {
- theContext.SetDepthStencilState(m_DefaultStencilState);
- }
-
- // Release any per-frame buffers
- if (inEffect.m_Context) {
- SEffectContext &theContext(*inEffect.m_Context);
- // Query for size on every loop intentional
- for (QT3DSU32 idx = 0; idx < theContext.m_AllocatedBuffers.size(); ++idx) {
- if (theContext.m_AllocatedBuffers[idx].m_Flags.IsSceneLifetime() == false) {
- theContext.ReleaseBuffer(idx);
- --idx;
- }
- }
- for (QT3DSU32 idx = 0; idx < theContext.m_AllocatedImages.size(); ++idx) {
- if (theContext.m_AllocatedImages[idx].m_Flags.IsSceneLifetime() == false) {
- theContext.ReleaseImage(idx);
- --idx;
- }
- }
- }
- }
- }
-
- NVRenderTexture2D *RenderEffect(SEffectRenderArgument inRenderArgument) override
- {
- SEffectClass *theClass = GetEffectClass(inRenderArgument.m_Effect.m_ClassName);
- if (!theClass) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- QT3DSMat44 theMVP;
- SCamera::SetupOrthographicCameraForOffscreenRender(inRenderArgument.m_ColorBuffer, theMVP);
- // setup a render target
- NVRenderContext &theContext(m_Context->GetRenderContext());
- IResourceManager &theManager(m_Context->GetResourceManager());
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __framebuffer(
- theContext, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- STextureDetails theDetails(inRenderArgument.m_ColorBuffer.GetTextureDetails());
- QT3DSU32 theFinalWidth = ITextRenderer::NextMultipleOf4((QT3DSU32)(theDetails.m_Width));
- QT3DSU32 theFinalHeight = ITextRenderer::NextMultipleOf4((QT3DSU32)(theDetails.m_Height));
- NVRenderFrameBuffer *theBuffer = theManager.AllocateFrameBuffer();
- // UdoL Some Effects may need to run before HDR tonemap. This means we need to keep the
- // input format
- NVRenderTextureFormats::Enum theOutputFormat = NVRenderTextureFormats::RGBA8;
- if (theClass->m_DynamicClass->GetOutputTextureFormat() == NVRenderTextureFormats::Unknown)
- theOutputFormat = theDetails.m_Format;
- NVRenderTexture2D *theTargetTexture =
- theManager.AllocateTexture2D(theFinalWidth, theFinalHeight, theOutputFormat);
- theBuffer->Attach(NVRenderFrameBufferAttachments::Color0, *theTargetTexture);
- theContext.SetRenderTarget(theBuffer);
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport,
- NVRenderRect(0, 0, theFinalWidth, theFinalHeight));
-
- NVRenderContextScopedProperty<bool> __scissorEnable(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled, false);
-
- DoRenderEffect(inRenderArgument.m_Effect, *theClass, inRenderArgument.m_ColorBuffer, theMVP,
- m_Context->GetRenderContext().GetRenderTarget(), false,
- inRenderArgument.m_DepthTexture, inRenderArgument.m_DepthStencilBuffer,
- inRenderArgument.m_CameraClipRange);
-
- theBuffer->Attach(NVRenderFrameBufferAttachments::Color0, NVRenderTextureOrRenderBuffer());
- theManager.Release(*theBuffer);
- return theTargetTexture;
- }
-
- // Render the effect to the currently bound render target using this MVP
- bool RenderEffect(SEffectRenderArgument inRenderArgument, QT3DSMat44 &inMVP,
- bool inEnableBlendWhenRenderToTarget) override
- {
- SEffectClass *theClass = GetEffectClass(inRenderArgument.m_Effect.m_ClassName);
- if (!theClass) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- DoRenderEffect(inRenderArgument.m_Effect, *theClass, inRenderArgument.m_ColorBuffer, inMVP,
- m_Context->GetRenderContext().GetRenderTarget(),
- inEnableBlendWhenRenderToTarget, inRenderArgument.m_DepthTexture,
- inRenderArgument.m_DepthStencilBuffer, inRenderArgument.m_CameraClipRange);
- return true;
- }
-
- void ReleaseEffectContext(SEffectContext *inContext) override
- {
- if (inContext == NULL)
- return;
- for (QT3DSU32 idx = 0, end = m_Contexts.size(); idx < end; ++idx) {
- if (m_Contexts[idx] == inContext) {
- m_Contexts.replace_with_last(idx);
- NVDelete(m_Allocator, inContext);
- }
- }
- }
-
- void ResetEffectFrameData(SEffectContext &inContext) override
- { // Query for size on every loop intentional
- for (QT3DSU32 idx = 0; idx < inContext.m_AllocatedBuffers.size(); ++idx) {
- SAllocatedBufferEntry &theBuffer(inContext.m_AllocatedBuffers[idx]);
- if (theBuffer.m_Flags.IsSceneLifetime() == true)
- theBuffer.m_NeedsClear = true;
- }
- for (QT3DSU32 idx = 0; idx < inContext.m_AllocatedDataBuffers.size(); ++idx) {
- SAllocatedDataBufferEntry &theDataBuffer(inContext.m_AllocatedDataBuffers[idx]);
- if (theDataBuffer.m_Flags.IsSceneLifetime() == true)
- theDataBuffer.m_NeedsClear = true;
- }
- }
-
- void SetShaderData(CRegisteredString path, const char8_t *data,
- const char8_t *inShaderType, const char8_t *inShaderVersion,
- bool inHasGeomShader, bool inIsComputeShader) override
- {
- m_CoreContext.GetDynamicObjectSystemCore().SetShaderData(
- path, data, inShaderType, inShaderVersion, inHasGeomShader, inIsComputeShader);
- }
-
- void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap, const char8_t *inProjectDir) const override
- {
- ioBuffer.write((QT3DSU32)m_EffectClasses.size());
- SStringSaveRemapper theRemapper(m_Allocator, inRemapMap, inProjectDir,
- m_CoreContext.GetStringTable());
- for (TEffectClassMap::const_iterator theIter = m_EffectClasses.begin(),
- end = m_EffectClasses.end();
- theIter != end; ++theIter) {
- const SEffectClass &theClass = *theIter->second;
- CRegisteredString theClassName = theClass.m_DynamicClass->GetId();
- theClassName.Remap(inRemapMap);
- ioBuffer.write(theClassName);
- // Effect classes do not store any additional data from the dynamic object class.
- ioBuffer.write(theClass);
- }
- }
-
- void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t *inProjectDir) override
- {
- m_Allocator.m_PreAllocatedBlock = inData;
- m_Allocator.m_OwnsMemory = false;
- qt3ds::render::SDataReader theReader(inData.begin(), inData.end());
- QT3DSU32 numEffectClasses = theReader.LoadRef<QT3DSU32>();
- SStringLoadRemapper theRemapper(m_Allocator, inStrDataBlock, inProjectDir,
- m_CoreContext.GetStringTable());
- for (QT3DSU32 idx = 0, end = numEffectClasses; idx < end; ++idx) {
- CRegisteredString theClassName = theReader.LoadRef<CRegisteredString>();
- theClassName.Remap(inStrDataBlock);
- IDynamicObjectClass *theBaseClass =
- m_CoreContext.GetDynamicObjectSystemCore().GetDynamicObjectClass(theClassName);
- if (theBaseClass == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- SEffectClass *theClass = theReader.Load<SEffectClass>();
- theClass->SetupThisObjectFromMemory(m_Allocator, *theBaseClass);
- NVScopedRefCounted<SEffectClass> theClassPtr(theClass);
- m_EffectClasses.insert(eastl::make_pair(theBaseClass->GetId(), theClassPtr));
- }
- }
-
- IEffectSystem &GetEffectSystem(IQt3DSRenderContext &context) override
- {
- m_Context = &context;
-
- NVRenderContext &theContext(m_Context->GetRenderContext());
-
- m_ResourceManager = &IResourceManager::CreateResourceManager(theContext);
-
- // create default stencil state
- qt3ds::render::NVRenderStencilFunctionArgument stencilDefaultFunc(
- qt3ds::render::NVRenderBoolOp::AlwaysTrue, 0x0, 0xFF);
- qt3ds::render::NVRenderStencilOperationArgument stencilDefaultOp(
- qt3ds::render::NVRenderStencilOp::Keep, qt3ds::render::NVRenderStencilOp::Keep,
- qt3ds::render::NVRenderStencilOp::Keep);
- m_DefaultStencilState = theContext.CreateDepthStencilState(
- theContext.IsDepthTestEnabled(), theContext.IsDepthWriteEnabled(),
- theContext.GetDepthFunction(), theContext.IsStencilTestEnabled(), stencilDefaultFunc,
- stencilDefaultFunc, stencilDefaultOp, stencilDefaultOp);
-
- return *this;
- }
-
- IResourceManager &GetResourceManager() override
- {
- return *m_ResourceManager;
- }
-
- void renderSubpresentations(SEffect &inEffect) override
- {
- SEffectClass *theClass = GetEffectClass(inEffect.m_ClassName);
- if (!theClass)
- return;
-
- NVConstDataRef<SPropertyDefinition> theDefs = theClass->m_DynamicClass->GetProperties();
- for (QT3DSU32 idx = 0, end = theDefs.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(theDefs[idx]);
- if (theDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- QT3DSU8 *dataPtr = inEffect.GetDataSectionBegin() + theDefinition.m_Offset;
- StaticAssert<sizeof(CRegisteredString)
- == sizeof(NVRenderTexture2DPtr)>::valid_expression();
- CRegisteredString *theStrPtr = reinterpret_cast<CRegisteredString *>(dataPtr);
- IOffscreenRenderManager &theOffscreenRenderer(
- m_Context->GetOffscreenRenderManager());
-
- if (theStrPtr->IsValid()) {
- if (theOffscreenRenderer.HasOffscreenRenderer(*theStrPtr))
- theOffscreenRenderer.GetRenderedItem(*theStrPtr);
- }
- }
- }
- }
-};
-}
-
-IEffectSystemCore &IEffectSystemCore::CreateEffectSystemCore(IQt3DSRenderContextCore &inContext)
-{
- return *QT3DS_NEW(inContext.GetAllocator(), SEffectSystem)(inContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.h
deleted file mode 100644
index 879addc9..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEffectSystem.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_EFFECT_SYSTEM_H
-#define QT3DS_RENDER_EFFECT_SYSTEM_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSVec2.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-
-namespace qt3ds {
-namespace render {
- struct SEffect;
- struct SEffectContext;
- namespace dynamic {
- struct SCommand; // UICRenderEffectCommands.h
- }
-
- struct SEffectRenderArgument
- {
- SEffect &m_Effect;
- NVRenderTexture2D &m_ColorBuffer;
- // Some effects need the camera near and far ranges.
- QT3DSVec2 m_CameraClipRange;
- // Some effects require the depth buffer from the rendering of thelayer
- // most do not.
- NVRenderTexture2D *m_DepthTexture;
- // this is a depth preapass texture we need for some effects like bloom
- // actually we need the stencil values
- NVRenderTexture2D *m_DepthStencilBuffer;
-
- SEffectRenderArgument(SEffect &inEffect, NVRenderTexture2D &inColorBuffer,
- const QT3DSVec2 &inCameraClipRange,
- NVRenderTexture2D *inDepthTexture = NULL,
- NVRenderTexture2D *inDepthBuffer = NULL)
- : m_Effect(inEffect)
- , m_ColorBuffer(inColorBuffer)
- , m_CameraClipRange(inCameraClipRange)
- , m_DepthTexture(inDepthTexture)
- , m_DepthStencilBuffer(inDepthBuffer)
- {
- }
- };
-
- class IEffectSystemCore : public NVRefCounted
- {
- public:
- virtual bool IsEffectRegistered(CRegisteredString inStr) = 0;
- virtual NVConstDataRef<CRegisteredString> GetRegisteredEffects() = 0;
- // Register an effect class that uses exactly these commands to render.
- // Effect properties cannot change after the effect is created because that would invalidate
- // existing effect instances.
- // Effect commands, which are stored on the effect class, can change.
- virtual bool RegisterEffect(CRegisteredString inName,
- NVConstDataRef<dynamic::SPropertyDeclaration> inProperties) = 0;
-
- virtual bool UnregisterEffect(CRegisteredString inName) = 0;
-
- // Shorthand method that creates an effect and auto-generates the effect commands like such:
- // BindShader(inPathToEffect)
- // foreach( propdec in inProperties ) ApplyValue( propDecType )
- // ApplyShader()
- virtual bool
- RegisterGLSLEffect(CRegisteredString inName, const char8_t *inPathToEffect,
- NVConstDataRef<dynamic::SPropertyDeclaration> inProperties) = 0;
- // Set the default value. THis is unnecessary if the default is zero as that is what it is
- // assumed to be.
- virtual void SetEffectPropertyDefaultValue(CRegisteredString inName,
- CRegisteredString inPropName,
- NVConstDataRef<QT3DSU8> inDefaultData) = 0;
- virtual void SetEffectPropertyEnumNames(CRegisteredString inName,
- CRegisteredString inPropName,
- NVConstDataRef<CRegisteredString> inNames) = 0;
- virtual NVConstDataRef<CRegisteredString>
- GetEffectPropertyEnumNames(CRegisteredString inName,
- CRegisteredString inPropName) const = 0;
-
- virtual NVConstDataRef<dynamic::SPropertyDefinition>
- GetEffectProperties(CRegisteredString inEffectName) const = 0;
-
- virtual void SetEffectPropertyTextureSettings(
- CRegisteredString inEffectName, CRegisteredString inPropName,
- CRegisteredString inPropPath, NVRenderTextureTypeValue::Enum inTexType,
- NVRenderTextureCoordOp::Enum inCoordOp, NVRenderTextureMagnifyingOp::Enum inMagFilterOp,
- NVRenderTextureMinifyingOp::Enum inMinFilterOp) = 0;
-
- // Setting the effect commands also sets this as if there isn't a specific "apply depth
- // value"
- // command then this effect does not require the depth texture.
- // So the setter here is completely optional.
- virtual void SetEffectRequiresDepthTexture(CRegisteredString inEffectName,
- bool inValue) = 0;
- virtual bool DoesEffectRequireDepthTexture(CRegisteredString inEffectName) const = 0;
-
- virtual void SetEffectRequiresCompilation(CRegisteredString inEffectName,
- bool inValue) = 0;
- virtual bool DoesEffectRequireCompilation(CRegisteredString inEffectName) const = 0;
-
- // The effect commands are the actual commands that run for a given effect. The tell the
- // system exactly
- // explicitly things like bind this shader, bind this render target, apply this property,
- // run this shader
- // See UICRenderEffectCommands.h for the list of commands.
- // These commands are copied into the effect.
- virtual void SetEffectCommands(CRegisteredString inEffectName,
- NVConstDataRef<dynamic::SCommand *> inCommands) = 0;
- virtual NVConstDataRef<dynamic::SCommand *>
- GetEffectCommands(CRegisteredString inEffectName) const = 0;
-
- // Set the shader data for a given path. Used when a path doesn't correspond to a file but
- // the data has been
- // auto-generated. The system will look for data under this path key during the BindShader
- // effect command.
- virtual void SetShaderData(CRegisteredString inPath, const char8_t *inData,
- const char8_t *inShaderType = NULL,
- const char8_t *inShaderVersion = NULL,
- bool inHasGeomShader = false,
- bool inIsComputeShader = false) = 0;
-
- // An effect instance is just a property bag along with the name of the effect to run.
- // This instance is what is placed into the object graph.
- virtual SEffect *CreateEffectInstance(CRegisteredString inEffectName,
- NVAllocatorCallback &inSceneGraphAllocator) = 0;
-
- virtual void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap,
- const char8_t *inProjectDir) const = 0;
- virtual void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t *inProjectDir) = 0;
-
- virtual IEffectSystem &GetEffectSystem(IQt3DSRenderContext &context) = 0;
-
- virtual IResourceManager &GetResourceManager() = 0;
-
- static IEffectSystemCore &CreateEffectSystemCore(IQt3DSRenderContextCore &context);
- };
-
- /**
- * An effect is essentially a function that takes a image and produces a new image. The source
- *and dest images
- * aren't guaranteed to be the same size, the effect may enlarge or shrink the result.
- * A specialization is when you want the effect to render to the final render target instead of
- *to a separate image.
- * In this case the effect cannot enlarge or shrink the final target and it will render to the
- *destination buffer
- * using the given MVP.
- */
- class IEffectSystem : public IEffectSystemCore
- {
- protected:
- virtual ~IEffectSystem() {}
-
- public:
- // Calling release effect context with no context results in no problems.
- virtual void ReleaseEffectContext(SEffectContext *inEffect) = 0;
-
- // If the effect has a context you can call this to clear persistent buffers back to their
- // original value.
- virtual void ResetEffectFrameData(SEffectContext &inContext) = 0;
-
- // Render this effect. Returns false in the case the effect wasn't rendered and the render
- // state
- // is guaranteed to be the same as before.
- // The texture returned is allocated using the resource manager, and it is up to the caller
- // to deallocate it or return it to the temporary pool if items when necessary
- // Pass in true if you want the result image premultiplied. Most of the functions in the
- // system
- // assume non-premultiplied color for images so probably this is false.
- virtual NVRenderTexture2D *RenderEffect(SEffectRenderArgument inRenderArgument) = 0;
-
- // Render the effect to the currently bound render target using this MVP and optionally
- // enabling blending when rendering to the target
- virtual bool RenderEffect(SEffectRenderArgument inRenderArgument, QT3DSMat44 &inMVP,
- bool inEnableBlendWhenRenderToTarget) = 0;
-
- virtual void renderSubpresentations(SEffect &inEffect) = 0;
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.cpp
deleted file mode 100644
index 2732f031..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.cpp
+++ /dev/null
@@ -1,383 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//==============================================================================
-// Includes
-//==============================================================================
-#include <math.h>
-#include <float.h>
-#include <string.h>
-#include <stdio.h>
-#include "Qt3DSRenderEulerAngles.h"
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4365) // warnings on conversion from unsigned int to int
-#endif
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace qt3ds {
-namespace render {
-
- //==============================================================================
- /**
- * Constructor
- */
- CEulerAngleConverter::CEulerAngleConverter() { m_OrderInfoBuffer[0] = '\0'; }
-
- //==============================================================================
- /**
- * Destructor
- */
- CEulerAngleConverter::~CEulerAngleConverter() {}
-
- //==============================================================================
- /**
- * Constructs a Euler angle & holds it in a EulerAngles struct
- * @param theI x rotation ( radians )
- * @param theJ y rotation ( radians )
- * @param theH z rotation ( radians )
- * @param theOrder the order this angle is in namely XYZ( static ), etc.
- * use the EulOrd**** macros to generate values
- * 0 to 23 is valid
- * @return the euler angle
- */
- EulerAngles CEulerAngleConverter::Eul_(float theI, float theJ, float theH, int theOrder)
- {
- EulerAngles theEulerAngle;
- theEulerAngle.x = theI;
- theEulerAngle.y = theJ;
- theEulerAngle.z = theH;
- theEulerAngle.w = (float)theOrder;
- return theEulerAngle;
- }
-
- //==============================================================================
- /**
- * Construct quaternion from Euler angles (in radians).
- * @param theEulerAngle incoming angle( radians )
- * @return the Quaternion
- */
- Quat CEulerAngleConverter::Eul_ToQuat(EulerAngles theEulerAngle)
- {
- Quat theQuaternion;
- double a[3], ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- int i, j, k, h, n, s, f;
-
- EulGetOrd((unsigned int)theEulerAngle.w, i, j, k, h, n, s, f);
- if (f == EulFrmR) {
- float t = theEulerAngle.x;
- theEulerAngle.x = theEulerAngle.z;
- theEulerAngle.z = t;
- }
-
- if (n == EulParOdd)
- theEulerAngle.y = -theEulerAngle.y;
-
- ti = theEulerAngle.x * 0.5;
- tj = theEulerAngle.y * 0.5;
- th = theEulerAngle.z * 0.5;
-
- ci = cos(ti);
- cj = cos(tj);
- ch = cos(th);
-
- si = sin(ti);
- sj = sin(tj);
- sh = sin(th);
-
- cc = ci * ch;
- cs = ci * sh;
- sc = si * ch;
- ss = si * sh;
-
- if (s == EulRepYes) {
- a[i] = cj * (cs + sc); /* Could speed up with */
- a[j] = sj * (cc + ss); /* trig identities. */
- a[k] = sj * (cs - sc);
- theQuaternion.w = (float)(cj * (cc - ss));
- } else {
- a[i] = cj * sc - sj * cs;
- a[j] = cj * ss + sj * cc;
- a[k] = cj * cs - sj * sc;
- theQuaternion.w = (float)(cj * cc + sj * ss);
- }
- if (n == EulParOdd)
- a[j] = -a[j];
-
- theQuaternion.x = (float)a[X];
- theQuaternion.y = (float)a[Y];
- theQuaternion.z = (float)a[Z];
- return theQuaternion;
- }
-
- //==============================================================================
- /**
- * Construct matrix from Euler angles (in radians).
- * @param theEulerAngle incoming angle
- * @param theMatrix outgoing matrix
- */
- void CEulerAngleConverter::Eul_ToHMatrix(EulerAngles theEulerAngle, HMatrix theMatrix)
- {
- double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- int i, j, k, h, n, s, f;
- EulGetOrd((unsigned int)theEulerAngle.w, i, j, k, h, n, s, f);
-
- if (f == EulFrmR) {
- float t = theEulerAngle.x;
- theEulerAngle.x = theEulerAngle.z;
- theEulerAngle.z = t;
- }
-
- if (n == EulParOdd) {
- theEulerAngle.x = -theEulerAngle.x;
- theEulerAngle.y = -theEulerAngle.y;
- theEulerAngle.z = -theEulerAngle.z;
- }
-
- ti = theEulerAngle.x;
- tj = theEulerAngle.y;
- th = theEulerAngle.z;
-
- ci = cos(ti);
- cj = cos(tj);
- ch = cos(th);
-
- si = sin(ti);
- sj = sin(tj);
- sh = sin(th);
-
- cc = ci * ch;
- cs = ci * sh;
- sc = si * ch;
- ss = si * sh;
-
- if (s == EulRepYes) {
- theMatrix[i][i] = (float)cj;
- theMatrix[i][j] = (float)(sj * si);
- theMatrix[i][k] = (float)(sj * ci);
- theMatrix[j][i] = (float)(sj * sh);
- theMatrix[j][j] = (float)(-cj * ss + cc);
- theMatrix[j][k] = (float)(-cj * cs - sc);
- theMatrix[k][i] = (float)(-sj * ch);
- theMatrix[k][j] = (float)(cj * sc + cs);
- theMatrix[k][k] = (float)(cj * cc - ss);
- } else {
- theMatrix[i][i] = (float)(cj * ch);
- theMatrix[i][j] = (float)(sj * sc - cs);
- theMatrix[i][k] = (float)(sj * cc + ss);
- theMatrix[j][i] = (float)(cj * sh);
- theMatrix[j][j] = (float)(sj * ss + cc);
- theMatrix[j][k] = (float)(sj * cs - sc);
- theMatrix[k][i] = (float)(-sj);
- theMatrix[k][j] = (float)(cj * si);
- theMatrix[k][k] = (float)(cj * ci);
- }
-
- theMatrix[W][X] = 0.0;
- theMatrix[W][Y] = 0.0;
- theMatrix[W][Z] = 0.0;
- theMatrix[X][W] = 0.0;
- theMatrix[Y][W] = 0.0;
- theMatrix[Z][W] = 0.0;
- theMatrix[W][W] = 1.0;
- }
-
- //==============================================================================
- /**
- * Convert matrix to Euler angles (in radians).
- * @param theMatrix incoming matrix
- * @param theOrder 0-23, use EulOrd**** to generate this value
- * @return a set of angles in radians!!!!
- */
- EulerAngles CEulerAngleConverter::Eul_FromHMatrix(HMatrix theMatrix, int theOrder)
- {
- EulerAngles theEulerAngle;
- int i, j, k, h, n, s, f;
-
- EulGetOrd(theOrder, i, j, k, h, n, s, f);
- if (s == EulRepYes) {
- double sy = sqrt(theMatrix[i][j] * theMatrix[i][j] + theMatrix[i][k] * theMatrix[i][k]);
- if (sy > 16 * FLT_EPSILON) {
- theEulerAngle.x = (float)(atan2((double)theMatrix[i][j], (double)theMatrix[i][k]));
- theEulerAngle.y = (float)(atan2((double)sy, (double)theMatrix[i][i]));
- theEulerAngle.z = (float)(atan2((double)theMatrix[j][i], -(double)theMatrix[k][i]));
- } else {
- theEulerAngle.x = (float)(atan2(-(double)theMatrix[j][k], (double)theMatrix[j][j]));
- theEulerAngle.y = (float)(atan2((double)sy, (double)theMatrix[i][i]));
- theEulerAngle.z = 0;
- }
- } else {
- double cy = sqrt(theMatrix[i][i] * theMatrix[i][i] + theMatrix[j][i] * theMatrix[j][i]);
- if (cy > 16 * FLT_EPSILON) {
- theEulerAngle.x = (float)(atan2((double)theMatrix[k][j], (double)theMatrix[k][k]));
- theEulerAngle.y = (float)(atan2(-(double)theMatrix[k][i], (double)cy));
- theEulerAngle.z = (float)(atan2((double)theMatrix[j][i], (double)theMatrix[i][i]));
- } else {
- theEulerAngle.x = (float)(atan2(-(double)theMatrix[j][k], (double)theMatrix[j][j]));
- theEulerAngle.y = (float)(atan2(-(double)theMatrix[k][i], (double)cy));
- theEulerAngle.z = 0;
- }
- }
-
- if (n == EulParOdd) {
- theEulerAngle.x = -theEulerAngle.x;
- theEulerAngle.y = -theEulerAngle.y;
- theEulerAngle.z = -theEulerAngle.z;
- }
-
- if (f == EulFrmR) {
- float t = theEulerAngle.x;
- theEulerAngle.x = theEulerAngle.z;
- theEulerAngle.z = t;
- }
- theEulerAngle.w = (float)theOrder;
- return theEulerAngle;
- }
-
- //==============================================================================
- /**
- * Convert quaternion to Euler angles (in radians).
- * @param theQuaternion incoming quaternion
- * @param theOrder 0-23, use EulOrd**** to generate this value
- * @return the generated angles ( radians )
- */
- EulerAngles CEulerAngleConverter::Eul_FromQuat(Quat theQuaternion, int theOrder)
- {
- HMatrix theMatrix;
- double Nq = theQuaternion.x * theQuaternion.x + theQuaternion.y * theQuaternion.y
- + theQuaternion.z * theQuaternion.z + theQuaternion.w * theQuaternion.w;
- double s = (Nq > 0.0) ? (2.0 / Nq) : 0.0;
- double xs = theQuaternion.x * s;
- double ys = theQuaternion.y * s;
- double zs = theQuaternion.z * s;
- double wx = theQuaternion.w * xs;
- double wy = theQuaternion.w * ys;
- double wz = theQuaternion.w * zs;
- double xx = theQuaternion.x * xs;
- double xy = theQuaternion.x * ys;
- double xz = theQuaternion.x * zs;
- double yy = theQuaternion.y * ys;
- double yz = theQuaternion.y * zs;
- double zz = theQuaternion.z * zs;
-
- theMatrix[X][X] = (float)(1.0 - (yy + zz));
- theMatrix[X][Y] = (float)(xy - wz);
- theMatrix[X][Z] = (float)(xz + wy);
- theMatrix[Y][X] = (float)(xy + wz);
- theMatrix[Y][Y] = (float)(1.0 - (xx + zz));
- theMatrix[Y][Z] = (float)(yz - wx);
- theMatrix[Z][X] = (float)(xz - wy);
- theMatrix[Z][Y] = (float)(yz + wx);
- theMatrix[Z][Z] = (float)(1.0 - (xx + yy));
- theMatrix[W][X] = 0.0;
- theMatrix[W][Y] = 0.0;
- theMatrix[W][Z] = 0.0;
- theMatrix[X][W] = 0.0;
- theMatrix[Y][W] = 0.0;
- theMatrix[Z][W] = 0.0;
- theMatrix[W][W] = 1.0;
-
- return Eul_FromHMatrix(theMatrix, theOrder);
- }
-
- //==============================================================================
- /**
- * Dump the Order information
- */
- const char *CEulerAngleConverter::DumpOrderInfo()
- {
- long theCount = 0;
- long theOrder[24];
- char theOrderStr[24][16];
-
- ::strcpy(theOrderStr[theCount++], "EulOrdXYZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdXYXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXYXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXZr");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXZr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXYZr");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYZr");
-
- theCount = 0;
- theOrder[theCount++] = EulOrdXYZs;
- theOrder[theCount++] = EulOrdXYXs;
- theOrder[theCount++] = EulOrdXZYs;
- theOrder[theCount++] = EulOrdXZXs;
- theOrder[theCount++] = EulOrdYZXs;
- theOrder[theCount++] = EulOrdYZYs;
- theOrder[theCount++] = EulOrdYXZs;
- theOrder[theCount++] = EulOrdYXYs;
- theOrder[theCount++] = EulOrdZXYs;
- theOrder[theCount++] = EulOrdZXZs;
- theOrder[theCount++] = EulOrdZYXs;
- theOrder[theCount++] = EulOrdZYZs;
-
- theOrder[theCount++] = EulOrdZYXr;
- theOrder[theCount++] = EulOrdXYXr;
- theOrder[theCount++] = EulOrdYZXr;
- theOrder[theCount++] = EulOrdXZXr;
- theOrder[theCount++] = EulOrdXZYr;
- theOrder[theCount++] = EulOrdYZYr;
- theOrder[theCount++] = EulOrdZXYr;
- theOrder[theCount++] = EulOrdYXYr;
- theOrder[theCount++] = EulOrdYXZr;
- theOrder[theCount++] = EulOrdZXZr;
- theOrder[theCount++] = EulOrdXYZr;
- theOrder[theCount++] = EulOrdZYZr;
-
- char theSubBuf[256];
- m_OrderInfoBuffer[0] = '\0';
- for (long theIndex = 0; theIndex < 24; ++theIndex) {
- ::sprintf(theSubBuf, " %16s - %ld\n ", theOrderStr[theIndex], theOrder[theIndex]);
- ::strcat(m_OrderInfoBuffer, theSubBuf);
- }
-
- return m_OrderInfoBuffer;
- }
-}
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.h
deleted file mode 100644
index bf271e29..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderEulerAngles.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include <qmath.h>
-
-namespace qt3ds {
-namespace render {
- //==============================================================================
- // Description
- //==============================================================================
- // QuatTypes.h - Basic type declarations
- // by Ken Shoemake, shoemake@graphics.cis.upenn.edu
- // in "Graphics Gems IV", Academic Press, 1994
- typedef struct
- {
- float x, y, z, w;
- } Quat; /* Quaternion */
- typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
- enum QuatPart { X, Y, Z, W };
- typedef Quat EulerAngles; /* (x,y,z)=ang 1,2,3, w=order code */
-
-#define EulFrmS 0
-#define EulFrmR 1
-#define EulFrm(ord) ((unsigned)(ord)&1)
-#define EulRepNo 0
-#define EulRepYes 1
-#define EulRep(ord) (((unsigned)(ord) >> 1) & 1)
-#define EulParEven 0
-#define EulParOdd 1
-#define EulPar(ord) (((unsigned)(ord) >> 2) & 1)
-#define EulSafe "\000\001\002\000"
-#define EulNext "\001\002\000\001"
-#define EulAxI(ord) ((int)(EulSafe[(((unsigned)(ord) >> 3) & 3)]))
-#define EulAxJ(ord) ((int)(EulNext[EulAxI(ord) + (EulPar(ord) == EulParOdd)]))
-#define EulAxK(ord) ((int)(EulNext[EulAxI(ord) + (EulPar(ord) != EulParOdd)]))
-#define EulAxH(ord) ((EulRep(ord) == EulRepNo) ? EulAxK(ord) : EulAxI(ord))
-
-// EulGetOrd unpacks all useful information about order simultaneously.
-#define EulGetOrd(ord, i, j, k, h, n, s, f) \
- { \
- unsigned o = ord; \
- f = o & 1; \
- o = o >> 1; \
- s = o & 1; \
- o = o >> 1; \
- n = o & 1; \
- o = o >> 1; \
- i = EulSafe[o & 3]; \
- j = EulNext[i + n]; \
- k = EulNext[i + 1 - n]; \
- h = s ? k : i; \
- }
-
-// EulOrd creates an order value between 0 and 23 from 4-tuple choices.
-#define EulOrd(i, p, r, f) (((((((i) << 1) + (p)) << 1) + (r)) << 1) + (f))
-
-// Static axes
-// X = 0, Y = 1, Z = 2 ref QuatPart
-#define EulOrdXYZs EulOrd(0, EulParEven, EulRepNo, EulFrmS)
-#define EulOrdXYXs EulOrd(0, EulParEven, EulRepYes, EulFrmS)
-#define EulOrdXZYs EulOrd(0, EulParOdd, EulRepNo, EulFrmS)
-#define EulOrdXZXs EulOrd(0, EulParOdd, EulRepYes, EulFrmS)
-#define EulOrdYZXs EulOrd(1, EulParEven, EulRepNo, EulFrmS)
-#define EulOrdYZYs EulOrd(1, EulParEven, EulRepYes, EulFrmS)
-#define EulOrdYXZs EulOrd(1, EulParOdd, EulRepNo, EulFrmS)
-#define EulOrdYXYs EulOrd(1, EulParOdd, EulRepYes, EulFrmS)
-#define EulOrdZXYs EulOrd(2, EulParEven, EulRepNo, EulFrmS)
-#define EulOrdZXZs EulOrd(2, EulParEven, EulRepYes, EulFrmS)
-#define EulOrdZYXs EulOrd(2, EulParOdd, EulRepNo, EulFrmS)
-#define EulOrdZYZs EulOrd(2, EulParOdd, EulRepYes, EulFrmS)
-
-// Rotating axes
-#define EulOrdZYXr EulOrd(0, EulParEven, EulRepNo, EulFrmR)
-#define EulOrdXYXr EulOrd(0, EulParEven, EulRepYes, EulFrmR)
-#define EulOrdYZXr EulOrd(0, EulParOdd, EulRepNo, EulFrmR)
-#define EulOrdXZXr EulOrd(0, EulParOdd, EulRepYes, EulFrmR)
-#define EulOrdXZYr EulOrd(1, EulParEven, EulRepNo, EulFrmR)
-#define EulOrdYZYr EulOrd(1, EulParEven, EulRepYes, EulFrmR)
-#define EulOrdZXYr EulOrd(1, EulParOdd, EulRepNo, EulFrmR)
-#define EulOrdYXYr EulOrd(1, EulParOdd, EulRepYes, EulFrmR)
-#define EulOrdYXZr EulOrd(2, EulParEven, EulRepNo, EulFrmR)
-#define EulOrdZXZr EulOrd(2, EulParEven, EulRepYes, EulFrmR)
-#define EulOrdXYZr EulOrd(2, EulParOdd, EulRepNo, EulFrmR)
-#define EulOrdZYZr EulOrd(2, EulParOdd, EulRepYes, EulFrmR)
-
-#ifndef M_PI
-#define M_PI 3.1415926535898
-#endif
-
-#define TODEG(x) x = (float)(x * 180 / M_PI);
-#define TORAD(x) x = (float)(x / 180 * M_PI);
-
- class CEulerAngleConverter
- {
- private:
- char m_OrderInfoBuffer[1024];
-
- public:
- CEulerAngleConverter();
- virtual ~CEulerAngleConverter();
-
- public:
- EulerAngles Eul_(float ai, float aj, float ah, int order);
- Quat Eul_ToQuat(EulerAngles ea);
- void Eul_ToHMatrix(EulerAngles ea, HMatrix M);
- EulerAngles Eul_FromHMatrix(HMatrix M, int order);
- EulerAngles Eul_FromQuat(Quat q, int order);
-
- // Debug Stuff
- const char *DumpOrderInfo();
- };
-}
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGpuProfiler.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGpuProfiler.cpp
deleted file mode 100644
index 740d8a71..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGpuProfiler.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderProfiler.h"
-
-#include "EASTL/string.h"
-#include "EASTL/hash_map.h"
-
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSFoundation.h"
-
-#include "Qt3DSRenderContextCore.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderTimerQuery.h"
-#include "render/Qt3DSRenderSync.h"
-
-#define RECORDED_FRAME_DELAY 3
-#define RECORDED_FRAME_DELAY_MASK 0x0003
-
-using namespace qt3ds::render;
-
-namespace {
-
-using eastl::make_pair;
-
-struct SGpuTimerInfo
-{
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- bool m_AbsoluteTime;
- QT3DSU16 m_WriteID;
- QT3DSU16 m_ReadID;
- QT3DSU16 m_AverageTimeWriteID;
- QT3DSU64 m_AverageTime[10];
- QT3DSU32 m_FrameID[RECORDED_FRAME_DELAY];
- NVScopedRefCounted<NVRenderTimerQuery> m_TimerStartQueryObjects[RECORDED_FRAME_DELAY];
- NVScopedRefCounted<NVRenderTimerQuery> m_TimerEndQueryObjects[RECORDED_FRAME_DELAY];
- NVScopedRefCounted<NVRenderSync> m_TimerSyncObjects[RECORDED_FRAME_DELAY];
-
- SGpuTimerInfo(NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , mRefCount(0)
- , m_AbsoluteTime(false)
- , m_WriteID(0)
- , m_ReadID(0)
- , m_AverageTimeWriteID(0)
- {
- memset(m_AverageTime, 0x0, 10 * sizeof(QT3DSU64));
- }
-
- ~SGpuTimerInfo() {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- void IncrementWriteCounter()
- {
- m_WriteID++;
- m_WriteID %= RECORDED_FRAME_DELAY_MASK;
- }
-
- void IncrementReadCounter()
- {
- m_ReadID++;
- m_ReadID %= RECORDED_FRAME_DELAY_MASK;
- }
-
- void IncrementAveragedWriteCounter()
- {
- m_AverageTimeWriteID++;
- m_AverageTimeWriteID %= 10;
- }
-
- void StartTimerQuery(QT3DSU32 frameID)
- {
- m_FrameID[m_WriteID] = frameID;
-
- if (m_AbsoluteTime)
- m_TimerStartQueryObjects[m_WriteID]->SetTimerQuery();
- else
- m_TimerStartQueryObjects[m_WriteID]->Begin();
- }
-
- void EndTimerQuery()
- {
- if (m_AbsoluteTime)
- m_TimerEndQueryObjects[m_WriteID]->SetTimerQuery();
- else
- m_TimerStartQueryObjects[m_WriteID]->End();
-
- IncrementWriteCounter();
- }
-
- void AddSync()
- {
- m_TimerSyncObjects[m_WriteID]->Sync();
- m_TimerSyncObjects[m_WriteID]->Wait();
- }
-
- QT3DSF64 GetAveragedElapsedTimeInMs()
- {
- QT3DSF64 time =
- QT3DSF64(((m_AverageTime[0] + m_AverageTime[1] + m_AverageTime[2] + m_AverageTime[3]
- + m_AverageTime[4] + m_AverageTime[5] + m_AverageTime[6] + m_AverageTime[7]
- + m_AverageTime[8] + m_AverageTime[9])
- / 10)
- / 1e06);
-
- return time;
- }
-
- QT3DSF64 GetElapsedTimeInMs(QT3DSU32 frameID)
- {
- QT3DSF64 time = 0;
-
- if (((frameID - m_FrameID[m_ReadID]) < 2) || (m_ReadID == m_WriteID))
- return time;
-
- if (m_AbsoluteTime) {
- QT3DSU64 startTime, endTime;
-
- m_TimerStartQueryObjects[m_ReadID]->GetResult(&startTime);
- m_TimerEndQueryObjects[m_ReadID]->GetResult(&endTime);
-
- m_AverageTime[m_AverageTimeWriteID] = endTime - startTime;
- } else {
- QT3DSU64 elapsedTime;
-
- m_TimerStartQueryObjects[m_ReadID]->GetResult(&elapsedTime);
-
- m_AverageTime[m_AverageTimeWriteID] = elapsedTime;
- }
-
- IncrementReadCounter();
- IncrementAveragedWriteCounter();
-
- return GetAveragedElapsedTimeInMs();
- }
-};
-
-class Qt3DSCRenderGpuProfiler : public IRenderProfiler
-{
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<SGpuTimerInfo>> TStrGpuTimerInfoMap;
-
-private:
- NVFoundationBase &m_Foundation;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- IQt3DSRenderContext &m_Context;
- volatile QT3DSI32 mRefCount;
-
- TStrGpuTimerInfoMap m_StrToGpuTimerMap;
- IRenderProfiler::TStrIDVec m_StrToIDVec;
- mutable QT3DSU32 m_VertexCount;
-
-public:
- Qt3DSCRenderGpuProfiler(NVFoundationBase &inFoundation, IQt3DSRenderContext &inContext,
- NVRenderContext &inRenderContext)
- : m_Foundation(inFoundation)
- , m_RenderContext(inRenderContext)
- , m_Context(inContext)
- , mRefCount(0)
- , m_StrToGpuTimerMap(inContext.GetAllocator(), "Qt3DSRenderGpuProfiler::m_StrToGpuTimerMap")
- , m_StrToIDVec(inContext.GetAllocator(), "Qt3DSRenderGpuProfiler::m_StrToIDVec")
- , m_VertexCount(0)
- {
- }
-
- virtual ~Qt3DSCRenderGpuProfiler() { m_StrToGpuTimerMap.clear(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- void StartTimer(CRegisteredString &nameID, bool absoluteTime, bool sync) override
- {
- SGpuTimerInfo *theGpuTimerData = GetOrCreateGpuTimerInfo(nameID);
-
- if (theGpuTimerData) {
- if (sync)
- theGpuTimerData->AddSync();
-
- theGpuTimerData->m_AbsoluteTime = absoluteTime;
- theGpuTimerData->StartTimerQuery(m_Context.GetFrameCount());
- }
- }
-
- void EndTimer(CRegisteredString &nameID) override
- {
- SGpuTimerInfo *theGpuTimerData = GetOrCreateGpuTimerInfo(nameID);
-
- if (theGpuTimerData) {
- theGpuTimerData->EndTimerQuery();
- }
- }
-
- QT3DSF64 GetElapsedTime(const CRegisteredString &nameID) const override
- {
- QT3DSF64 time = 0;
- SGpuTimerInfo *theGpuTimerData = GetGpuTimerInfo(nameID);
-
- if (theGpuTimerData) {
- time = theGpuTimerData->GetElapsedTimeInMs(m_Context.GetFrameCount());
- }
-
- return time;
- }
-
- const TStrIDVec &GetTimerIDs() const override { return m_StrToIDVec; }
-
- void AddVertexCount(QT3DSU32 count) override { m_VertexCount += count; }
-
- QT3DSU32 GetAndResetTriangleCount() const override
- {
- QT3DSU32 tris = m_VertexCount / 3;
- m_VertexCount = 0;
- return tris;
- }
-
-private:
- SGpuTimerInfo *GetOrCreateGpuTimerInfo(CRegisteredString &nameID)
- {
- TStrGpuTimerInfoMap::const_iterator theIter = m_StrToGpuTimerMap.find(nameID);
- if (theIter != m_StrToGpuTimerMap.end())
- return const_cast<SGpuTimerInfo *>(theIter->second.mPtr);
-
- SGpuTimerInfo *theGpuTimerData =
- QT3DS_NEW(m_Context.GetAllocator(), SGpuTimerInfo)(m_Foundation);
-
- if (theGpuTimerData) {
- // create queries
- for (QT3DSU32 i = 0; i < RECORDED_FRAME_DELAY; i++) {
- theGpuTimerData->m_TimerStartQueryObjects[i] = m_RenderContext->CreateTimerQuery();
- theGpuTimerData->m_TimerEndQueryObjects[i] = m_RenderContext->CreateTimerQuery();
- theGpuTimerData->m_TimerSyncObjects[i] = m_RenderContext->CreateSync();
- theGpuTimerData->m_FrameID[i] = 0;
- }
- m_StrToGpuTimerMap.insert(make_pair(nameID, theGpuTimerData));
- m_StrToIDVec.push_back(nameID);
- }
-
- return theGpuTimerData;
- }
-
- SGpuTimerInfo *GetGpuTimerInfo(const CRegisteredString &nameID) const
- {
- TStrGpuTimerInfoMap::const_iterator theIter = m_StrToGpuTimerMap.find(nameID);
- if (theIter != m_StrToGpuTimerMap.end())
- return const_cast<SGpuTimerInfo *>(theIter->second.mPtr);
-
- return NULL;
- }
-};
-}
-
-IRenderProfiler &IRenderProfiler::CreateGpuProfiler(NVFoundationBase &inFnd,
- IQt3DSRenderContext &inContext,
- NVRenderContext &inRenderContext)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), Qt3DSCRenderGpuProfiler)(inFnd, inContext, inRenderContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectPickQuery.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectPickQuery.h
deleted file mode 100644
index e63cad3f..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectPickQuery.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_GRAPH_OBJECT_PICK_QUERY_H
-#define QT3DS_RENDER_GRAPH_OBJECT_PICK_QUERY_H
-
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSMat44.h"
-#include "Qt3DSRenderImage.h"
-
-namespace qt3ds {
-namespace render {
-
- class IOffscreenRenderer;
-
- struct Qt3DSRenderPickSubResult
- {
- IOffscreenRenderer *m_SubRenderer;
- QT3DSMat44 m_TextureMatrix;
- NVRenderTextureCoordOp::Enum m_HorizontalTilingMode;
- NVRenderTextureCoordOp::Enum m_VerticalTilingMode;
- QT3DSU32 m_ViewportWidth;
- QT3DSU32 m_ViewportHeight;
- Qt3DSRenderPickSubResult *m_NextSibling;
-
- Qt3DSRenderPickSubResult()
- : m_SubRenderer(NULL)
- , m_NextSibling(NULL)
- {
- }
- Qt3DSRenderPickSubResult(IOffscreenRenderer &inSubRenderer, QT3DSMat44 inTextureMatrix,
- NVRenderTextureCoordOp::Enum inHorizontalTilingMode,
- NVRenderTextureCoordOp::Enum inVerticalTilingMode, QT3DSU32 width,
- QT3DSU32 height)
- : m_SubRenderer(&inSubRenderer)
- , m_TextureMatrix(inTextureMatrix)
- , m_HorizontalTilingMode(inHorizontalTilingMode)
- , m_VerticalTilingMode(inVerticalTilingMode)
- , m_ViewportWidth(width)
- , m_ViewportHeight(height)
- , m_NextSibling(NULL)
- {
- }
- };
-
- struct Qt3DSRenderPickResult
- {
- const SGraphObject *m_HitObject;
- QT3DSF32 m_CameraDistanceSq;
- // The local coordinates in X,Y UV space where the hit occured
- QT3DSVec2 m_LocalUVCoords;
- // The local mouse coordinates will be the same on all of the sub objects.
- Qt3DSRenderPickSubResult *m_FirstSubObject;
- // The offscreen renderer that was used to render the scene graph this result was produced
- // from.
- IOffscreenRenderer *m_OffscreenRenderer;
-
- Qt3DSRenderPickResult(const SGraphObject &inHitObject, QT3DSF32 inCameraDistance,
- const QT3DSVec2 &inLocalUVCoords)
- : m_HitObject(&inHitObject)
- , m_CameraDistanceSq(inCameraDistance)
- , m_LocalUVCoords(inLocalUVCoords)
- , m_FirstSubObject(NULL)
- , m_OffscreenRenderer(NULL)
- {
- }
- Qt3DSRenderPickResult()
- : m_HitObject(NULL)
- , m_CameraDistanceSq(QT3DS_MAX_F32)
- , m_LocalUVCoords(0, 0)
- , m_FirstSubObject(NULL)
- , m_OffscreenRenderer(NULL)
- {
- }
- };
-
- class IGraphObjectPickQuery
- {
- protected:
- virtual ~IGraphObjectPickQuery() {}
-
- public:
- // Implementors have the option of batching the results to allow fewer virtual calls
- // or returning one item each pick.
- // Results are guaranteed to be returned nearest to furthest
- // If the return value has size of zero then we assume nothing more can be picked and the
- // pick
- // is finished.
- virtual Qt3DSRenderPickResult Pick(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool inPickEverything) = 0;
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.cpp
deleted file mode 100644
index 358c5aad..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.cpp
+++ /dev/null
@@ -1,670 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderGraphObjectSerializer.h"
-#include "Qt3DSRenderPresentation.h"
-#include "Qt3DSRenderNode.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSRenderText.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSRenderEffect.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "foundation/SerializationTypes.h"
-#include "StringTools.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSRenderPluginGraphObject.h"
-#include "Qt3DSRenderReferencedMaterial.h"
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderPathSubPath.h"
-#include "Qt3DSRenderPathManager.h"
-
-using namespace qt3ds::render;
-using namespace qt3ds::render::dynamic;
-
-namespace {
-typedef nvhash_set<void *> TPtrSet;
-
-void Align(MemoryBuffer<> &inBuffer)
-{
- inBuffer.align(sizeof(void *));
-}
-typedef nvvector<eastl::pair<GraphObjectTypes::Enum, QT3DSU32>> TObjectFileStatList;
-typedef SPtrOffsetMap TPtrOffsetMap;
-
-struct SSerializerWriteContext
-{
- SPtrOffsetMap &m_OffsetMap;
- SWriteBuffer &m_MemoryBuffer;
- const SStrRemapMap &m_StrRemapMap;
- QT3DSU32 m_DataBlockStart;
- IDynamicObjectSystem &m_DynamicObjectSystem;
- IPathManager &m_PathManager;
- TObjectFileStatList &m_FileSizeStats;
- Qt3DSString m_PathMapper;
- Qt3DSString m_BasePath;
- Qt3DSString m_RelativePath;
- IStringTable &m_StringTable;
- SSerializerWriteContext(SPtrOffsetMap &inOffsetMap, SWriteBuffer &inWriteBuffer,
- const SStrRemapMap &inStrMap, QT3DSU32 inDataBlockStart,
- IDynamicObjectSystem &inDynamicObjectSystem,
- IPathManager &inPathManager, TObjectFileStatList &inStats,
- NVAllocatorCallback &inAllocator, const char8_t *inProjectDirectory,
- IStringTable &inStringTable)
- : m_OffsetMap(inOffsetMap)
- , m_MemoryBuffer(inWriteBuffer)
- , m_StrRemapMap(inStrMap)
- , m_DataBlockStart(inDataBlockStart)
- , m_DynamicObjectSystem(inDynamicObjectSystem)
- , m_PathManager(inPathManager)
- , m_FileSizeStats(inStats)
- , m_StringTable(inStringTable)
- {
- Q_UNUSED(inAllocator)
- m_BasePath.assign(inProjectDirectory);
- }
-
- bool HasWrittenObject(const void *inObject) { return m_OffsetMap.contains(inObject); }
-
- QT3DSU32 &GetStatEntry(GraphObjectTypes::Enum inType) const
- {
- for (QT3DSU32 idx = 0, end = m_FileSizeStats.size(); idx < end; ++idx)
- if (m_FileSizeStats[idx].first == inType)
- return m_FileSizeStats[idx].second;
- m_FileSizeStats.push_back(eastl::make_pair(inType, (QT3DSU32)0));
- return m_FileSizeStats.back().second;
- }
-
- template <typename TObjType>
- void AddPtrOffset(const TObjType *inObject)
- {
- QT3DSU32 objOffset = m_MemoryBuffer.size() - m_DataBlockStart;
- m_OffsetMap.insert(eastl::make_pair(inObject, objOffset));
-// In debug we keep stats on how much each type of object
-// contributes to the file size.
-#ifdef _DEBUG
- GetStatEntry(inObject->m_Type) += sizeof(TObjType);
-#endif
- }
-
- void Remap(CRegisteredString &inStr) { inStr.Remap(m_StrRemapMap); }
-
- template <typename TObjType>
- void Remap(TObjType *&inPtr)
- {
- if (inPtr) {
- TPtrOffsetMap::iterator theIter = m_OffsetMap.find(inPtr);
- if (theIter != m_OffsetMap.end())
- inPtr = reinterpret_cast<TObjType *>(theIter->second);
- else {
- QT3DS_ASSERT(false);
- }
- }
- }
-
- void RemapMaterial(SGraphObject *&inPtr) { Remap(inPtr); }
-
- template <typename TObjType>
- void NullPtr(TObjType *&inPtr)
- {
- inPtr = NULL;
- }
-};
-
-///////////////////////////////////////////////////////////////////////
-// --** Reading the scene graph is heavily threaded when we are loading
-// multiple presentations in one application --**
-///////////////////////////////////////////////////////////////////////
-struct SSerializerReadContext : public SDataReader
-{
- IPathManagerCore &m_PathManager;
- IDynamicObjectSystemCore &m_DynamicObjectSystem;
- NVDataRef<QT3DSU8> m_DataBlock;
- NVDataRef<QT3DSU8> m_StrTableBlock;
- Qt3DSString m_PathMapper;
- const char8_t *m_ProjectDirectory;
-
- SSerializerReadContext(IPathManagerCore &inPathManager, IDynamicObjectSystemCore &inDynSystem,
- NVDataRef<QT3DSU8> inDataBlock, NVDataRef<QT3DSU8> inStrTable,
- NVAllocatorCallback &inAllocator, const char8_t *inProjectDirectory)
- : SDataReader(inDataBlock.begin(), inDataBlock.end())
- , m_PathManager(inPathManager)
- , m_DynamicObjectSystem(inDynSystem)
- , m_DataBlock(inDataBlock)
- , m_StrTableBlock(inStrTable)
- , m_ProjectDirectory(inProjectDirectory)
- {
- Q_UNUSED(inAllocator)
- }
- void Remap(CRegisteredString &inStr) { inStr.Remap(m_StrTableBlock); }
- template <typename TObjType>
- void Remap(TObjType *&inPtr)
- {
- if (inPtr) {
- TObjType *purePtr = inPtr;
- size_t ptrValue = reinterpret_cast<size_t>(purePtr);
- if (ptrValue < m_DataBlock.size())
- inPtr = reinterpret_cast<TObjType *>(m_DataBlock.begin() + ptrValue);
- else {
- QT3DS_ASSERT(false);
- inPtr = NULL;
- }
- }
- }
- void RemapMaterial(SGraphObject *&inPtr) { Remap(inPtr); }
- // Nulling out pointers was done on write, so we don't do it here.
- template <typename TObjType>
- void NullPtr(TObjType *&)
- {
- }
-};
-
-template <typename TObjType>
-struct SGraphObjectSerializerImpl
-{
- static TObjType *Write(const TObjType &ioObject, SSerializerWriteContext &outSavedBuffer);
- static void Remap(TObjType &inObject, SSerializerWriteContext &inRemapContext);
- static TObjType *Read(SSerializerReadContext &inReadContext);
-};
-
-struct SWriteRemapper
-{
- SSerializerWriteContext &m_WriteBuffer;
- SWriteRemapper(SSerializerWriteContext &buf)
- : m_WriteBuffer(buf)
- {
- }
- // This will happen later
- void Remap(const CRegisteredString &) {}
- void RemapPath(const CRegisteredString &) {}
-
- // We ignore objects that are saved out explicitly below.
- void Remap(const SScene *) {}
-
- void Remap(const SLayer *) {}
- // Nodes are ignored because we save them out *not* in depth first order,
- // with models, text, lights and camera saved out contiguously for in-memory
- // traversal.
- void Remap(const SNode *) {}
-#ifdef _INTEGRITYPLATFORM
- // explicit specialization of class "<unnamed>::SGraphObjectSerializerImpl<qt3ds::render::SCustomMaterial>"
- // must precede its first use struct SGraphObjectSerializerImpl<SCustomMaterial>
- template <typename TObjType>
- void Remap(const TObjType *inObj);
-#else
- template <typename TObjType>
- void Remap(const TObjType *inObj)
- {
- if (inObj)
- SGraphObjectSerializerImpl<TObjType>::Write(*inObj, m_WriteBuffer);
- }
-#endif
-
- void RemapMaterial(const SGraphObject *inObj)
- {
- if (inObj) {
- if (inObj->m_Type == GraphObjectTypes::DefaultMaterial)
- Remap(static_cast<const SDefaultMaterial *>(inObj));
- else if (inObj->m_Type == GraphObjectTypes::CustomMaterial)
- Remap(static_cast<const SCustomMaterial *>(inObj));
- else if (inObj->m_Type == GraphObjectTypes::ReferencedMaterial)
- Remap(static_cast<const SReferencedMaterial *>(inObj));
- else {
- QT3DS_ASSERT(false);
- }
- }
- }
- template <typename TObjType>
- void NullPtr(const TObjType *)
- {
- }
-};
-
-void PrepareFirstPass(const SNode &inNode, nvvector<const SNode *> &ioLightCameras,
- nvvector<const SNode *> &ioRenderable)
-{
- if (GraphObjectTypes::IsRenderableType(inNode.m_Type))
- ioRenderable.push_back(&inNode);
- else if (GraphObjectTypes::IsLightCameraType(inNode.m_Type))
- ioLightCameras.push_back(&inNode);
-
- for (const SNode *theChild = inNode.m_FirstChild; theChild; theChild = theChild->m_NextSibling)
- PrepareFirstPass(*theChild, ioLightCameras, ioRenderable);
-}
-
-template <typename TObject>
-TObject *WriteGenericGraphObjectNoRemap(const TObject &ioObject,
- SSerializerWriteContext &outSavedBuffer)
-{
- if (outSavedBuffer.HasWrittenObject(&ioObject))
- return NULL;
-
- outSavedBuffer.AddPtrOffset(&ioObject);
- QT3DSU32 theOffset = outSavedBuffer.m_MemoryBuffer.size();
- outSavedBuffer.m_MemoryBuffer.write(ioObject);
- // Probably the buffer stays aligned but we want to work to keep it that way.
- Align(outSavedBuffer.m_MemoryBuffer);
- return reinterpret_cast<TObject *>(outSavedBuffer.m_MemoryBuffer.begin() + theOffset);
-}
-
-template <typename TObject>
-TObject *WriteGenericGraphObject(const TObject &ioObject, SSerializerWriteContext &outSavedBuffer)
-{
- TObject *theObject = WriteGenericGraphObjectNoRemap(ioObject, outSavedBuffer);
- if (theObject) // The object may have already been written.
- {
- // Write mappers just follow pointers and ensure all the associated objects
- // are written out.
- SWriteRemapper theWriteRemapper(outSavedBuffer);
- const_cast<TObject &>(ioObject).Remap(theWriteRemapper);
- }
- return theObject;
-}
-
-template <typename TObject>
-TObject *ReadGenericGraphObject(SSerializerReadContext &inReadContext)
-{
- TObject *retval = inReadContext.Load<TObject>();
- inReadContext.Align();
- if (retval) {
- retval->Remap(inReadContext);
- }
- return retval;
-}
-
-template <typename TObjType>
-TObjType *SGraphObjectSerializerImpl<TObjType>::Write(const TObjType &ioObject,
- SSerializerWriteContext &outSavedBuffer)
-{
- return WriteGenericGraphObject(ioObject, outSavedBuffer);
-}
-template <typename TObjType>
-void SGraphObjectSerializerImpl<TObjType>::Remap(TObjType &ioObject,
- SSerializerWriteContext &inRemapContext)
-{
- return ioObject.Remap(inRemapContext);
-}
-
-template <typename TObjType>
-TObjType *SGraphObjectSerializerImpl<TObjType>::Read(SSerializerReadContext &inReadContext)
-{
- return ReadGenericGraphObject<TObjType>(inReadContext);
-}
-
-void RemapProperties(SDynamicObject &ioObject, SSerializerWriteContext &outSavedBuffer,
- CRegisteredString inClassName)
-{
- NVConstDataRef<SPropertyDefinition> theObjectProps =
- outSavedBuffer.m_DynamicObjectSystem.GetProperties(inClassName);
- for (QT3DSU32 idx = 0, end = theObjectProps.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDef(theObjectProps[idx]);
- if (theDef.m_DataType == qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- CRegisteredString *theStr = reinterpret_cast<CRegisteredString *>(
- ioObject.GetDataSectionBegin() + theDef.m_Offset);
- outSavedBuffer.Remap(*theStr);
- }
- }
-}
-
-void RemapProperties(SDynamicObject &ioObject, SSerializerReadContext &inReadContext)
-{
- // CN - !!Note this call is done on multiple threads simultaneously. I added a mutex just to be
- // sure even though
- // this is a read-only call; I am not certain how good the arm memory locking is when it is
- // completely unprotected.
- NVConstDataRef<SPropertyDefinition> theProperties =
- inReadContext.m_DynamicObjectSystem.GetProperties(ioObject.m_ClassName);
- for (QT3DSU32 idx = 0, end = theProperties.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(theProperties[idx]);
- if (theDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- CRegisteredString *theString = reinterpret_cast<CRegisteredString *>(
- ioObject.GetDataSectionBegin() + theDefinition.m_Offset);
- inReadContext.Remap(*theString);
- }
- }
-}
-
-template <>
-struct SGraphObjectSerializerImpl<SEffect>
-{
- static SGraphObject *Write(const SEffect &ioObject, SSerializerWriteContext &outSavedBuffer)
- {
- size_t itemOffset = outSavedBuffer.m_MemoryBuffer.size();
- SEffect *theNewEffect =
- static_cast<SEffect *>(WriteGenericGraphObjectNoRemap(ioObject, outSavedBuffer));
- if (theNewEffect) {
- theNewEffect->m_Context = NULL;
- // Writing it out is easy. Reading it back in means we have to have a correctly setup
- // IEffectManager so we
- // can remap strings.
- outSavedBuffer.m_MemoryBuffer.write(ioObject.GetDataSectionBegin(),
- ioObject.m_DataSectionByteSize);
- Align(outSavedBuffer.m_MemoryBuffer);
- SWriteRemapper theWriteRemapper(outSavedBuffer);
- // Write any connected objects.
- theNewEffect =
- reinterpret_cast<SEffect *>(outSavedBuffer.m_MemoryBuffer.begin() + itemOffset);
- theNewEffect->Remap(theWriteRemapper);
- }
- return theNewEffect;
- }
-
- static void Remap(SEffect &ioObject, SSerializerWriteContext &outSavedBuffer)
- {
- CRegisteredString theClassName = ioObject.m_ClassName;
- ioObject.Remap(outSavedBuffer);
- RemapProperties(ioObject, outSavedBuffer, theClassName);
- }
-
- static SEffect *Read(SSerializerReadContext &inReadContext)
- {
- SEffect *theEffect = ReadGenericGraphObject<SEffect>(inReadContext);
- if (theEffect) {
- inReadContext.m_CurrentPtr += theEffect->m_DataSectionByteSize;
- inReadContext.Align();
- RemapProperties(*theEffect, inReadContext);
- }
- return theEffect;
- }
-};
-
-template <>
-struct SGraphObjectSerializerImpl<SCustomMaterial>
-{
- static SGraphObject *Write(const SCustomMaterial &ioObject,
- SSerializerWriteContext &outSavedBuffer)
- {
- size_t itemOffset = outSavedBuffer.m_MemoryBuffer.size();
- SCustomMaterial *theNewObject = static_cast<SCustomMaterial *>(
- WriteGenericGraphObjectNoRemap(ioObject, outSavedBuffer));
- if (theNewObject) {
- // Writing it out is easy. Reading it back in means we have to have a correctly setup
- // IEffectManager so we
- // can remap strings.
- outSavedBuffer.m_MemoryBuffer.write(ioObject.GetDataSectionBegin(),
- ioObject.m_DataSectionByteSize);
- Align(outSavedBuffer.m_MemoryBuffer);
- theNewObject = reinterpret_cast<SCustomMaterial *>(outSavedBuffer.m_MemoryBuffer.begin()
- + itemOffset);
- SWriteRemapper theWriteRemapper(outSavedBuffer);
- // Write any connected objects.
- theNewObject->Remap(theWriteRemapper);
- }
- return theNewObject;
- }
-
- static void Remap(SCustomMaterial &ioObject, SSerializerWriteContext &outSavedBuffer)
- {
- CRegisteredString theClassName(ioObject.m_ClassName);
- ioObject.Remap(outSavedBuffer);
- RemapProperties(ioObject, outSavedBuffer, theClassName);
- }
-
- static SCustomMaterial *Read(SSerializerReadContext &inReadContext)
- {
- SCustomMaterial *theMaterial = ReadGenericGraphObject<SCustomMaterial>(inReadContext);
- if (theMaterial) {
- inReadContext.m_CurrentPtr += theMaterial->m_DataSectionByteSize;
- inReadContext.Align();
- RemapProperties(*theMaterial, inReadContext);
- }
- return theMaterial;
- }
-};
-
-#ifdef _INTEGRITYPLATFORM
- template <typename TObjType>
- void SWriteRemapper::Remap(const TObjType *inObj)
- {
- if (inObj)
- SGraphObjectSerializerImpl<TObjType>::Write(*inObj, m_WriteBuffer);
- }
-#endif
-
-template <>
-struct SGraphObjectSerializerImpl<SPathSubPath>
-{
- static SGraphObject *Write(const SPathSubPath &ioObject,
- SSerializerWriteContext &outSavedBuffer)
- {
- SPathSubPath *theObject = WriteGenericGraphObjectNoRemap(ioObject, outSavedBuffer);
- if (theObject) // The object may have already been written.
- {
- NVConstDataRef<SPathAnchorPoint> thePoints =
- outSavedBuffer.m_PathManager.GetPathSubPathBuffer(ioObject);
- outSavedBuffer.m_MemoryBuffer.write((QT3DSU32)thePoints.size());
- outSavedBuffer.m_MemoryBuffer.write(thePoints.begin(), thePoints.size());
- // Write mappers just follow pointers and ensure all the associated objects
- // are written out.
- SWriteRemapper theWriteRemapper(outSavedBuffer);
- const_cast<SPathSubPath &>(ioObject).Remap(theWriteRemapper);
- }
- return theObject;
- }
-
- static void Remap(SPathSubPath &ioObject, SSerializerWriteContext &outSavedBuffer)
- {
- ioObject.Remap(outSavedBuffer);
- }
-
- static SPathSubPath *Read(SSerializerReadContext &inReadContext)
- {
- SPathSubPath *theSubPath = ReadGenericGraphObject<SPathSubPath>(inReadContext);
- if (theSubPath) {
- QT3DSU32 numPoints = *inReadContext.Load<QT3DSU32>();
- SPathAnchorPoint *theAnchorPointBuffer =
- reinterpret_cast<qt3ds::render::SPathAnchorPoint *>(inReadContext.m_CurrentPtr);
- inReadContext.m_CurrentPtr += sizeof(SPathAnchorPoint) * numPoints;
-
- // CN - !!Note this call is done on multiple threads simultaneously. I added a mutex to
- // the path manager object
- // so this exact call is always protected. This absolutely caused crashing when it was
- // not protected approriately.
- inReadContext.m_PathManager.SetPathSubPathData(
- *theSubPath, toConstDataRef(theAnchorPointBuffer, numPoints));
- }
- return theSubPath;
- }
-};
-
-void WriteGraphObject(const SGraphObject &inObject, SSerializerWriteContext &outSavedBuffer)
-{
- SGraphObject *newObject = NULL;
- switch (inObject.m_Type) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case GraphObjectTypes::type: \
- newObject = SGraphObjectSerializerImpl<S##type>::Write( \
- static_cast<const S##type &>(inObject), outSavedBuffer); \
- break;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
-}
-
-void WriteNodeList(nvvector<const SNode *> &inList, SSerializerWriteContext &outSavedBuffer)
-{
- for (QT3DSU32 idx = 0, end = inList.size(); idx < end; ++idx)
- WriteGraphObject(*inList[idx], outSavedBuffer);
-}
-
-// Now write everything you haven't written so far, skip writing renderables or cameras or lights
-void WriteNonRenderableNonCLNode(const SNode &inNode, SSerializerWriteContext &outSavedBuffer)
-{
- if (GraphObjectTypes::IsLightCameraType(inNode.m_Type) == false
- && GraphObjectTypes::IsRenderableType(inNode.m_Type) == false) {
- WriteGraphObject(inNode, outSavedBuffer);
- }
- for (const SNode *theChild = inNode.m_FirstChild; theChild; theChild = theChild->m_NextSibling)
- WriteNonRenderableNonCLNode(*theChild, outSavedBuffer);
-}
-
-SGraphObject *ReadGraphObject(SSerializerReadContext &inContext)
-{
- if (inContext.m_CurrentPtr + sizeof(SGraphObject) < inContext.m_EndPtr) {
- SGraphObject *theObject = reinterpret_cast<SGraphObject *>(inContext.m_CurrentPtr);
- switch (theObject->m_Type) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case GraphObjectTypes::type: \
- SGraphObjectSerializerImpl<S##type>::Read(inContext); \
- break;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- QT3DS_ASSERT(false);
- theObject = NULL;
- break;
- }
- return theObject;
- }
- return NULL;
-}
-}
-
-void SGraphObjectSerializer::Save(NVFoundationBase &inFoundation,
- const SPresentation &inPresentation,
- qt3ds::render::SWriteBuffer &outSavedData,
- IDynamicObjectSystem &inDynamicObjectSystem,
- IPathManager &inPathManager, SPtrOffsetMap &outSceneGraphOffsets,
- IStringTable &inStringTable,
- NVDataRef<SGraphObject *> inExtraGraphObjects)
-{
- using namespace qt3ds::foundation;
- nvvector<const SNode *> theLightCameraList(inFoundation.getAllocator(),
- "SGraphObjectSerializer::theLightCameraList");
- nvvector<const SNode *> theRenderableList(inFoundation.getAllocator(),
- "SGraphObjectSerializer::theRenderableList");
- TObjectFileStatList theStatList(inFoundation.getAllocator(),
- "SGraphObjectSerializer::FileSizeStats");
- // We want to save out the scene graph in the order we are going to traverse it normally.
- // This is reverse depth first for the lights, cameras, and renderables and depth first for
- // everything else so we go
- // in two passes per layer.
- // We expect the incoming data buffer to be aligned already.
- QT3DS_ASSERT(outSavedData.size() % 4 == 0);
- if (inPresentation.m_Scene) {
- QT3DSU32 theDataSectionStart = outSavedData.size();
- outSavedData.writeZeros(4);
- SSerializerWriteContext theWriteContext(
- outSceneGraphOffsets, outSavedData, inStringTable.GetRemapMap(), theDataSectionStart,
- inDynamicObjectSystem, inPathManager, theStatList, inFoundation.getAllocator(),
- inPresentation.m_PresentationDirectory, inStringTable);
- // First pass, just write out the data.
- WriteGraphObject(inPresentation, theWriteContext);
- WriteGraphObject(*inPresentation.m_Scene, theWriteContext);
- for (const SLayer *theLayer = inPresentation.m_Scene->m_FirstChild; theLayer;
- theLayer = static_cast<const SLayer *>(theLayer->m_NextSibling)) {
- theLightCameraList.clear();
- theRenderableList.clear();
- PrepareFirstPass(*theLayer, theLightCameraList, theRenderableList);
- eastl::reverse(theLightCameraList.begin(), theLightCameraList.end());
- eastl::reverse(theRenderableList.begin(), theRenderableList.end());
- WriteNodeList(theLightCameraList, theWriteContext);
- WriteNodeList(theRenderableList, theWriteContext);
- }
- // Now just write everything *but* renderable objects and cameras.
- for (const SLayer *theLayer = inPresentation.m_Scene->m_FirstChild; theLayer;
- theLayer = static_cast<const SLayer *>(theLayer->m_NextSibling)) {
- WriteNonRenderableNonCLNode(*theLayer, theWriteContext);
- }
- // Write out any extra objects we haven't covered yet.
- for (QT3DSU32 idx = 0, end = inExtraGraphObjects.size(); idx < end; ++idx)
- WriteGraphObject(*inExtraGraphObjects[idx], theWriteContext);
-
- QT3DSU32 theNumObjects = theWriteContext.m_OffsetMap.size();
- QT3DSU32 *theCountPtr = reinterpret_cast<QT3DSU32 *>(outSavedData.begin() + theDataSectionStart);
- *theCountPtr = theNumObjects;
-
- // Second pass, perform remapping on all the objects to change their pointers to offsets
- for (SPtrOffsetMap::iterator theIter = outSceneGraphOffsets.begin(),
- theEnd = outSceneGraphOffsets.end();
- theIter != theEnd; ++theIter) {
- QT3DSU8 *theDataPtr = outSavedData.begin() + theDataSectionStart + theIter->second;
- SGraphObject *theGraphObj = reinterpret_cast<SGraphObject *>(theDataPtr);
- switch (theGraphObj->m_Type) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case GraphObjectTypes::type: \
- SGraphObjectSerializerImpl<S##type>::Remap(static_cast<S##type &>(*theGraphObj), \
- theWriteContext); \
- break;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- }
-#ifdef _DEBUG
- qCDebug(TRACE_INFO, "--File size stats:");
- // Tell the users how much space is used in the file based on object type:
- for (QT3DSU32 idx = 0, end = theStatList.size(); idx < end; ++idx) {
- const char *theObjType = GraphObjectTypes::GetObjectTypeName(theStatList[idx].first);
- qCDebug(TRACE_INFO, "%s - %d bytes:", theObjType, theStatList[idx].second);
- }
- qCDebug(TRACE_INFO, "--End file size stats:");
-#endif
-};
-
-SPresentation *SGraphObjectSerializer::Load(NVDataRef<QT3DSU8> inData, NVDataRef<QT3DSU8> inStrDataBlock,
- IDynamicObjectSystemCore &inDynamicObjectSystem,
- IPathManagerCore &inPathManager,
- NVAllocatorCallback &inAllocator,
- const char8_t *inProjectDirectory)
-{
- SSerializerReadContext theReadContext(inPathManager, inDynamicObjectSystem, inData,
- inStrDataBlock, inAllocator, inProjectDirectory);
- SPresentation *retval = NULL;
- if (inData.size() < 4) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- QT3DSU32 theNumObjects = theReadContext.LoadRef<QT3DSU32>();
- for (QT3DSU32 idx = 0, end = theNumObjects; idx < end; ++idx) {
- SGraphObject *theObject = ReadGraphObject(theReadContext);
- if (theObject) {
- if (theObject->m_Type == GraphObjectTypes::Presentation)
- retval = static_cast<SPresentation *>(theObject);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.h
deleted file mode 100644
index 8f8420c1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectSerializer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_GRAPH_OBJECT_SERIALZER_H
-#define QT3DS_RENDER_GRAPH_OBJECT_SERIALZER_H
-
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-class NVFoundationBase;
-}
-
-namespace qt3ds {
-namespace render {
- struct SPresentation;
- class IEffectSystem;
-
- struct SGraphObjectSerializer
- {
- // This will save the tree as it exists but clients may wish to save out extra objects in
- // addtion
- static void
- Save(NVFoundationBase &inFoundation, const SPresentation &inPresentation,
- SWriteBuffer &outSavedData, IDynamicObjectSystem &inDynamicObjectSystem,
- IPathManager &inPathManager, SPtrOffsetMap &outSceneGraphOffsets,
- IStringTable &inStringTable,
- NVDataRef<SGraphObject *> inExtraGraphObjects = NVDataRef<SGraphObject *>());
-
- // Loading requires a correctly setup effect system because the effects have arbitrary data
- // and the strings embedded in that data will
- // require string remapping.
- static SPresentation *Load(NVDataRef<QT3DSU8> inData, NVDataRef<QT3DSU8> inStrDataBlock,
- IDynamicObjectSystemCore &inDynamicObjectSystem,
- IPathManagerCore &inPathManager,
- NVAllocatorCallback &inAllocator,
- const char8_t *inProjectDirectory);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectTypes.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectTypes.h
deleted file mode 100644
index 620f6c5d..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderGraphObjectTypes.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_GRAPH_OBJECT_TYPES_H
-#define QT3DS_RENDER_GRAPH_OBJECT_TYPES_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSAssert.h"
-
-namespace qt3ds {
-namespace render {
-
-// If you need a generic switch statement, then these macros will ensure
-// you get all the types the first time.
-#define QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Presentation) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Scene) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Node) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Layer) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Light) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Camera) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Model) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(DefaultMaterial) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Image) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Text) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Effect) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(RenderPlugin) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(CustomMaterial) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(ReferencedMaterial) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(Path) \
- QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(PathSubPath)
-
- struct GraphObjectTypes
- {
- enum Enum {
- Unknown = 0,
- Presentation,
- Scene,
- Node,
- Layer,
- Light,
- Camera,
- Model,
- DefaultMaterial,
- Image,
- Text,
- Effect,
- CustomMaterial,
- RenderPlugin,
- ReferencedMaterial,
- Path,
- PathSubPath,
- Lightmaps,
- LastKnownGraphObjectType,
- };
-
- static bool IsMaterialType(Enum type)
- {
- switch (type) {
- case ReferencedMaterial:
- case CustomMaterial:
- case DefaultMaterial:
- return true;
- default:
- return false;
- }
- }
-
- static bool IsLightmapType(Enum type)
- {
- switch (type) {
- case Lightmaps:
- case DefaultMaterial:
- return true;
- default:
- return false;
- }
- }
-
- static bool IsNodeType(Enum type)
- {
- switch (type) {
- case Node:
- case Layer:
- case Light:
- case Camera:
- case Model:
- case Text:
- case Path:
- return true;
-
- default:
- break;
- }
- return false;
- }
-
- static bool IsRenderableType(Enum type)
- {
- switch (type) {
- case Model:
- case Text:
- case Path:
- return true;
- default:
- break;
- }
- return false;
- }
-
- static bool IsLightCameraType(Enum type)
- {
- switch (type) {
- case Camera:
- case Light:
- return true;
- default:
- break;
- }
- return false;
- }
- static const char *GetObjectTypeName(Enum inType)
- {
- switch (inType) {
-#define QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE(type) \
- case type: \
- return #type;
- QT3DS_RENDER_ITERATE_GRAPH_OBJECT_TYPES
-#undef QT3DS_RENDER_HANDL_GRAPH_OBJECT_TYPE
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return "";
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.cpp
deleted file mode 100644
index d699179f..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.cpp
+++ /dev/null
@@ -1,883 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2001 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSMath.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "Qt3DSRenderImageScaler.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-
-using namespace qt3ds::render;
-//==============================================================================
-// Namespace
-//==============================================================================
-CImageScaler::CImageScaler(NVAllocatorCallback &inAlloc)
- : m_Allocator(inAlloc)
-{
-}
-//==============================================================================
-/**
- * Scales the given image by the given scale factor.
- *
- * This method creates a new image based on the parameters given.
- *
- * @param inScaleMethod type of scaling operation
- * @param inOldBuffer points to the old picture
- * @param inOldWidth width of the old picture
- * @param inOldHeight height of the old picture
- * @param inNewBuffer will point to the scaled picture
- * @param inNewWidth width of the new picture
- * @param inNewHeight height of the new picture
- * @param inPlanes number of planes (1 for greyscale, 3 for rgb, etc)
- * also equivalent to the return value of the CTextureType::PixelSize method.
- */
-void CImageScaler::Scale(EScaleMethod inScaleMethod, unsigned char *inOldBuffer,
- unsigned long inOldWidth, unsigned long inOldHeight,
- unsigned char *&outNewBuffer, unsigned long inNewWidth,
- unsigned long inNewHeight, unsigned long inPlanes)
-{
- switch (inScaleMethod) {
- case SCALEMETHOD_CROP:
- CImageScaler::Crop(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer, inNewWidth,
- inNewHeight, inPlanes);
- break;
-
- case SCALEMETHOD_BILINEAR:
- CImageScaler::Bilinear(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer, inNewWidth,
- inNewHeight, inPlanes);
- break;
-
- default:
- QT3DS_ASSERT(false);
- break;
- }
-}
-
-//==============================================================================
-/**
- * Scales the given image by the given scale factor.
- *
- * This method creates a new image based on the parameters given.
- *
- * @param inScaleMethod type of scaling operation
- * @param inOldBuffer points to the old picture
- * @param inOldWidth width of the old picture
- * @param inOldHeight height of the old picture
- * @param inNewBuffer will point to the scaled picture
- * @param inNewWidth width of the new picture
- * @param inNewHeight height of the new picture
- * @param inPlanes number of planes (1 for greyscale, 3 for rgb, etc)
- * also equivalent to the return value of the CTextureType::PixelSize method.
- */
-void CImageScaler::FastScale(EScaleMethod inScaleMethod, unsigned char *inOldBuffer,
- unsigned long inOldWidth, unsigned long inOldHeight,
- unsigned char *&outNewBuffer, unsigned long inNewWidth,
- unsigned long inNewHeight, unsigned long inPlanes)
-{
- switch (inScaleMethod) {
- case SCALEMETHOD_CROP:
- CImageScaler::Crop(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer, inNewWidth,
- inNewHeight, inPlanes);
- break;
-
- case SCALEMETHOD_POINTSAMPLE:
- CImageScaler::FastPointSample(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer,
- inNewWidth, inNewHeight, inPlanes);
- break;
-
- default:
- QT3DS_ASSERT(false);
- break;
- }
-}
-
-//==============================================================================
-/**
- * Debug method that simply crops the picture instead of scaling.
- *
- * Not for use in production. This is a test method to exercise the framework.
- *
- * @param inOldBuffer points to the old picture
- * @param inOldWidth width of the old picture
- * @param inOldHeight height of the old picture
- * @param inNewBuffer will point to the scaled picture
- * @param inNewWidth width of the new picture
- * @param inNewHeight height of the new picture
- * @param inPlanes number of planes (1 for greyscale, 3 for rgb, etc)
- * also equivalent to the return value of the CTextureType::PixelSize method.
-*/
-void CImageScaler::Crop(unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight, unsigned long inPlanes)
-{
- Q_UNUSED(inOldHeight);
-
- QT3DS_ASSERT(inNewWidth <= inOldWidth);
- QT3DS_ASSERT(inNewHeight <= inOldHeight);
-
- long theMinWidth = NVMin(inOldWidth, inNewWidth);
-
- outNewBuffer = new unsigned char[inNewWidth * inNewHeight * inPlanes];
- ::memset(outNewBuffer, 0, inNewWidth * inNewHeight * inPlanes);
-
- for (unsigned long theRow = 0; theRow < inNewHeight; ++theRow) {
- ::memcpy(outNewBuffer + theRow * inNewWidth * inPlanes,
- inOldBuffer + theRow * inOldWidth * inPlanes, theMinWidth * inPlanes);
- }
-}
-
-//==============================================================================
-/**
- * Plain scaling.
- *
- * Code adopted from http://www.codeguru.com/bitmap/SmoothBitmapResizing.html
- * Preliminary formatting completed but still needs work.
- *
- * @param inOldBuffer points to the old picture
- * @param inOldWidth width of the old picture
- * @param inOldHeight height of the old picture
- * @param inNewBuffer will point to the scaled picture
- * @param inNewWidth width of the new picture
- * @param inNewHeight height of the new picture
- * @param inPlanes number of planes (1 for greyscale, 3 for rgb, etc)
- * also equivalent to the return value of the CTextureType::PixelSize method.
-*/
-void CImageScaler::Bilinear(unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight,
- unsigned long inPlanes)
-{
- QT3DS_ASSERT(inPlanes > 0);
-
- outNewBuffer = new unsigned char[inNewWidth * inNewHeight * inPlanes];
- CImageScaler::Resize(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer, inNewWidth,
- inNewHeight, inPlanes);
-}
-
-//==============================================================================
-/**
- * Fast removal of selected pixels.
- *
- * Really fast scanning of every n-th pixel. This algorithm works basically by
- * adding a fraction to the source pointer for each pixel destination, using
- * fixed point arithmetic.
- *
- * @param inOldBuffer points to the old picture
- * @param inOldWidth width of the old picture
- * @param inOldHeight height of the old picture
- * @param inNewBuffer will point to the scaled picture
- * @param inNewWidth width of the new picture
- * @param inNewHeight height of the new picture
- * @param inPlanes number of planes (1 for greyscale, 3 for rgb, etc)
- * also equivalent to the return value of the CTextureType::PixelSize method.
-*/
-void CImageScaler::FastPointSample(unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight,
- unsigned long inPlanes)
-{
- unsigned long theXAccum;
- unsigned long theYAccum;
- unsigned long theXConst;
- unsigned long theYConst;
- unsigned long theRow;
- unsigned long theColumn;
- unsigned long theAdd;
- unsigned long theSrcIndex;
- outNewBuffer = new unsigned char[inNewWidth * inNewHeight * inPlanes];
-
- // *** Debug ***
- // char dMessage[100];
- //::sprintf( dMessage, "PointSample: %ldx%ld to %ldx%ld\n",inOldInfo.m_Width, inOldInfo.m_Height, outNewInfo.m_Width, outNewInfo.m_Height );
- //::OutputDebugString( dMessage );
-
- switch (inPlanes) {
- case 4: {
- long *theSrc;
- long *theDst;
- theSrc = reinterpret_cast<long *>(inOldBuffer);
- theDst = reinterpret_cast<long *>(outNewBuffer);
- theYAccum = 0;
- theXConst = (inOldWidth << 16) / inNewWidth;
- theYConst = (inOldHeight << 16) / inNewHeight;
- unsigned long theAdd;
- for (theRow = 0; theRow < inNewHeight; theRow++) {
- theXAccum = 0;
- theSrcIndex = 0;
- for (theColumn = 0; theColumn < inNewWidth; theColumn++) {
-
- theXAccum += theXConst;
- theAdd = theXAccum >> 16;
- *theDst = theSrc[theSrcIndex];
- theDst++;
- theSrcIndex += theAdd;
- // Clear out the integer portion of the accumulator.
- theXAccum = theXAccum & 0xFFFF;
- }
-
- theYAccum += theYConst;
- theAdd = (theYAccum) >> 16;
- theSrc += theAdd * inOldWidth;
- // Clear out the integer portion of the accumulator.
- theYAccum = theYAccum & 0xFFFF;
- }
- } break;
-
- case 3: {
- unsigned char *theDest;
- unsigned char *theSource;
- theDest = reinterpret_cast<unsigned char *>(outNewBuffer);
- theSource = reinterpret_cast<unsigned char *>(inOldBuffer);
- theYAccum = 0;
- theXConst = (inOldWidth << 16) / inNewWidth;
- theYConst = (inOldHeight << 16) / inNewHeight;
- for (theRow = 0; theRow < inNewHeight; ++theRow) {
- theXAccum = 0;
- theSrcIndex = 0;
- for (theColumn = 0; theColumn < inNewWidth; ++theColumn) {
- theDest[0] = theSource[0];
- theDest[1] = theSource[1];
- theDest[2] = theSource[2];
- theDest += 3;
- theSrcIndex += 3 * (theXAccum) >> 16;
- theXAccum = theXAccum & 0xFFFF;
- }
- theYAccum += theYConst;
- theAdd = (theYAccum) >> 16;
- theSource += theAdd * inOldWidth * 3;
- theYAccum = theYAccum & 0xFFFF;
- }
- } break;
-
- case 2: {
- short *theDest;
- short *theSource;
- theDest = reinterpret_cast<short *>(outNewBuffer);
- theSource = reinterpret_cast<short *>(inOldBuffer);
- theYAccum = 0;
- theXConst = (inOldWidth << 16) / inNewWidth;
- theYConst = (inOldHeight << 16) / inNewHeight;
- for (unsigned long theY = 0; theY < inNewHeight; ++theY) {
- theXAccum = 0;
- theSrcIndex = 0;
- for (unsigned long theX = 0; theX < inNewWidth; ++theX) {
- *theDest = *theSource;
- ++theDest;
- theXAccum += theXConst;
- theSrcIndex += (theXAccum) >> 16;
- theXAccum = theXAccum & 0xFFFF;
- }
- theYAccum += theYConst;
- theAdd = (theYAccum) >> 16;
- theSource += theAdd * inOldWidth;
- theYAccum = theYAccum & 0xFFFF;
- }
- } break;
-
- case 1: {
- unsigned char *theDest;
- unsigned char *theSource;
- theDest = reinterpret_cast<unsigned char *>(outNewBuffer);
- theSource = reinterpret_cast<unsigned char *>(inOldBuffer);
- theYAccum = 0;
- theXConst = (inOldWidth << 16) / inNewWidth;
- theYConst = (inOldHeight << 16) / inNewHeight;
- for (unsigned long theY = 0; theY < inNewHeight; ++theY) {
- theXAccum = 0;
- theSrcIndex = 0;
- for (unsigned long theX = 0; theX < inNewWidth; ++theX) {
- *theDest = *theSource;
- ++theDest;
- theXAccum += theXConst;
- theSrcIndex += (theXAccum) >> 16;
- theXAccum = theXAccum & 0xFFFF;
- }
- theYAccum += theYConst;
- theAdd = (theYAccum) >> 16;
- theSource += theAdd * inOldWidth;
- theYAccum = theYAccum & 0xFFFF;
- }
- } break;
-
- default:
- QT3DS_ASSERT(false);
- break;
- }
-}
-
-//==============================================================================
-/**
- * @param inWidth
- * @param inHeight
- * @return unsigned char*
- */
-unsigned char *CImageScaler::AllocateBuffer(long inWidth, long inHeight)
-{
- unsigned char *theBuffer = new unsigned char[inHeight * inWidth * 4];
- return theBuffer;
-}
-
-//==============================================================================
-/**
- * @param ioBuffer the buffer to release
- */
-void CImageScaler::ReleaseBuffer(unsigned char *&ioBuffer)
-{
- delete[] ioBuffer;
- ioBuffer = NULL;
-}
-
-//==============================================================================
-/**
- * @param inOldBuffer points to the old picture
- * @param inOldWidth width of the old picture
- * @param inOldHeight height of the old picture
- * @param inNewBuffer will point to the scaled picture
- * @param inNewWidth width of the new picture
- * @param inNewHeight height of the new picture
- * @param inPlanes number of planes (1 for greyscale, 3 for rgb, etc)
- * also equivalent to the return value of the CTextureType::PixelSize method.
- */
-void CImageScaler::Resize(unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight,
- unsigned long inPlanes)
-{
- QT3DS_ASSERT(inPlanes == 4);
-
- // only do the temporary allocation if necessary
- if (inOldWidth < inNewWidth || inOldHeight < inNewHeight) {
- CImageScaler::ExpandRowsAndColumns(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer,
- inNewWidth, inNewHeight, inPlanes);
- return;
- } else {
- // The downsampling algorithms *do* assume four planes.
- if (inOldWidth > inNewWidth && inOldHeight > inNewHeight) {
- MemoryBuffer<> theBuffer(ForwardingAllocator(m_Allocator, "ImageScaler::TempBuffer"));
- theBuffer.reserve(inNewWidth * inOldHeight * 4);
- unsigned char *theTempBuffer = theBuffer.begin();
- CImageScaler::ReduceCols(inOldBuffer, inOldWidth, inOldHeight, theTempBuffer,
- inNewWidth);
- CImageScaler::ReduceRows(theTempBuffer, inNewWidth, inOldHeight, outNewBuffer,
- inNewHeight);
- } else if (inOldWidth > inNewWidth) {
- CImageScaler::ReduceCols(inOldBuffer, inOldWidth, inOldHeight, outNewBuffer,
- inNewWidth);
- } else if (inOldHeight > inNewHeight) {
- CImageScaler::ReduceRows(inOldBuffer, inNewWidth, inOldHeight, outNewBuffer,
- inNewHeight);
- }
- }
-}
-
-void CImageScaler::ExpandRowsAndColumns(unsigned char *inBuffer, unsigned long inWidth,
- unsigned long inHeight, unsigned char *outBuffer,
- unsigned long inDstWidth, unsigned long inDstHeight,
- unsigned long inPlanes)
-{
- if (inDstWidth < inWidth || inDstHeight < inHeight) {
- return;
- }
- /*if( inPlanes == 4 )
- {
- FastExpandRowsAndColumns( inBuffer, inWidth, inHeight,
- outBuffer, inDstWidth, inDstHeight );
- return;
- }*/
- unsigned long theYPosition;
- unsigned short theYRatio;
- unsigned short theYInvRatio;
- unsigned long theXPosition;
- unsigned short theXRatio;
- unsigned short theXInvRatio;
-
- unsigned long theRow;
- unsigned long theColumn;
- unsigned long theSrcIndex;
- unsigned long theDstIndex;
- unsigned long theSrcLineLength;
- unsigned long theTemp;
- unsigned long thePixel;
-
- theDstIndex = 0;
- theSrcIndex = 0;
- theSrcLineLength = inWidth * inPlanes;
- theYPosition = inDstHeight;
- theYRatio = 1 << 8;
- theYInvRatio = 0;
- theXInvRatio = 0;
- // Here we go....
- // This algorithm will be quite a bit hairy, if you want
- // to understand it, then look at the two expand alogorithms above
- // and realize the this is just the logical combination of the two
- for (theRow = 0; theRow < inDstHeight; theRow++) {
- // Run through all the rows, multiplying if necessary the two ratio's together
- theXPosition = inDstWidth;
- if (theYPosition < inHeight) {
- // We have crossed a row boundary
- theYRatio = (unsigned short)((theYPosition << 8) / inHeight);
- theYInvRatio = (unsigned short)((1 << 8) - theYRatio);
-
- for (theColumn = 0; theColumn < inDstWidth; theColumn++) {
- if (theXPosition < inWidth) {
- theXRatio = (unsigned short)((theXPosition << 8) / inWidth);
- theXInvRatio = (unsigned short)((1 << 8) - theXRatio);
-
- // The combination of both the x and y ratio's
- unsigned long theLeftRatio = (theXRatio * theYRatio) >> 8;
- unsigned long theRightRatio = (theXInvRatio * theYRatio) >> 8;
- unsigned long theLowLeftRatio = (theXRatio * theYInvRatio) >> 8;
- unsigned long theLowRightRatio = (theXInvRatio * theYInvRatio) >> 8;
- // We are on a row and column boundary, thus each pixel here is the
- // combination of four pixels (left right, low left, low right)
- for (thePixel = 0; thePixel < inPlanes; thePixel++) {
- // Left side first
- theTemp = (theLeftRatio * inBuffer[theSrcIndex]);
- theTemp += (theRightRatio * inBuffer[theSrcIndex + inPlanes]);
- theTemp += (theLowLeftRatio * inBuffer[theSrcIndex + theSrcLineLength]);
- theTemp += (theLowRightRatio
- * inBuffer[theSrcIndex + theSrcLineLength + inPlanes]);
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 8);
- theDstIndex++;
- theSrcIndex++;
- }
- // Reset our position calculation
- theXPosition = inDstWidth - inWidth + theXPosition;
- } else {
- for (thePixel = 0; thePixel < inPlanes; thePixel++) {
- theTemp = theYRatio * inBuffer[theSrcIndex + thePixel];
- theTemp +=
- theYInvRatio * inBuffer[theSrcIndex + theSrcLineLength + thePixel];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 8);
- theDstIndex++;
- }
- // Reset our position calculation
- theXPosition -= inWidth;
- }
- }
- // Reset our position calculation
- theYPosition = inDstHeight - inHeight + theYPosition;
- // Make the src index point to the next line
- theSrcIndex += inPlanes;
- } // Ends the if to check if we are crossing a row boundary
- // Else we are not crossing a row boundary
- else {
- for (theColumn = 0; theColumn < inDstWidth; theColumn++) {
- // If we are crossing a column boundary
- if (theXPosition < inWidth) {
- theXRatio = (unsigned short)((theXPosition << 8) / inWidth);
- theXInvRatio = (unsigned short)((1 << 8) - theXRatio);
- for (thePixel = 0; thePixel < inPlanes; thePixel++) {
- theTemp = theXRatio * inBuffer[theSrcIndex];
- theTemp += theXInvRatio * inBuffer[theSrcIndex + inPlanes];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 8);
- theSrcIndex++;
- theDstIndex++;
- }
-
- theXPosition = inDstWidth - inWidth + theXPosition;
- }
- // Else we are not crossing a column boundary
- else {
- for (thePixel = 0; thePixel < inPlanes; thePixel++) {
- outBuffer[theDstIndex] = inBuffer[theSrcIndex + thePixel];
- theDstIndex++;
- }
- theXPosition -= inWidth;
- }
- }
- // reset our y position indicator
- theYPosition -= inHeight;
- // reset the src index to the beginning the next line
- theSrcIndex += inPlanes;
- // reset src index to the beginning of this line
- theSrcIndex -= theSrcLineLength;
- } // End of else for row boundary
- } // End of for loop for iterating through all rows
-}
-
-// Assuming the number of planes is four
-
-void CImageScaler::FastExpandRowsAndColumns(unsigned char *inBuffer, unsigned long inWidth,
- unsigned long inHeight, unsigned char *outBuffer,
- unsigned long inDstWidth, unsigned long inDstHeight)
-{
-
- if (inDstWidth < inWidth || inDstHeight < inHeight) {
- return;
- }
- unsigned long theYPosition;
- unsigned short theYRatio;
- unsigned short theYInvRatio;
- unsigned long theXPosition;
- unsigned short theXRatio;
- unsigned short theXInvRatio;
- // The combination of both the x and y ratio's
- unsigned long theLeftRatio;
- unsigned long theRightRatio;
- unsigned long theLowLeftRatio;
- unsigned long theLowRightRatio;
-
- unsigned long theRow;
- unsigned long theColumn;
- unsigned long theSrcIndex;
- unsigned long theDstIndex;
- unsigned long theSrcLineLength;
- unsigned long theTemp;
-
- theDstIndex = 0;
- theSrcIndex = 0;
- theSrcLineLength = inWidth * 4;
- theYPosition = inDstHeight;
- theYInvRatio = 0;
- theXInvRatio = 0;
- // Here we go....
- // This algorithm will be quite a bit hairy, if you want
- // to understand it, then look at the two expand alogorithms above
- // and realize the this is just the logical combination of the two
- for (theRow = 0; theRow < inDstHeight; theRow++) {
- // Run through all the rows, multiplying if necessary the two ratio's together
- theXPosition = inDstWidth;
- if (theYPosition < inHeight) {
- // We have crossed a row boundary
- theYRatio = (unsigned short)((theYPosition << 8) / inHeight);
- theYInvRatio = (unsigned short)((1 << 8) - theYRatio);
-
- for (theColumn = 0; theColumn < inDstWidth; theColumn++) {
- if (theXPosition < inWidth) {
- theXRatio = (unsigned short)((theXPosition << 8) / inWidth);
- theXInvRatio = (unsigned short)((1 << 8) - theXRatio);
- theLeftRatio = (theXRatio * theYRatio) >> 8;
- theRightRatio = (theXInvRatio * theYRatio) >> 8;
- theLowLeftRatio = (theXRatio * theYInvRatio) >> 8;
- theLowRightRatio = (theXInvRatio * theYInvRatio) >> 8;
- // We are on a row and column boundary, thus each pixel here is the
- // combination of four pixels (left right, low left, low right)
-
- // Left side first
- theTemp = (inBuffer[theSrcIndex]);
- theTemp += (inBuffer[theSrcIndex + 4]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength + 4]);
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 2);
- theDstIndex++;
- theSrcIndex++;
- // Left side first
- theTemp = (inBuffer[theSrcIndex]);
- theTemp += (inBuffer[theSrcIndex + 4]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength + 4]);
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 2);
- theDstIndex++;
- theSrcIndex++;
- // Left side first
- theTemp = (inBuffer[theSrcIndex]);
- theTemp += (inBuffer[theSrcIndex + 4]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength + 4]);
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 2);
- theDstIndex++;
- theSrcIndex++;
- // Left side first
- theTemp = (inBuffer[theSrcIndex]);
- theTemp += (inBuffer[theSrcIndex + 4]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength]);
- theTemp += (inBuffer[theSrcIndex + theSrcLineLength + 4]);
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 2);
- theDstIndex++;
- theSrcIndex++;
- // Reset our position calculation
- theXPosition = inDstWidth - inWidth + theXPosition;
- } else {
-
- theTemp = inBuffer[theSrcIndex];
- theTemp += inBuffer[theSrcIndex + theSrcLineLength];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theDstIndex++;
- theTemp = inBuffer[theSrcIndex + 1];
- theTemp += inBuffer[theSrcIndex + theSrcLineLength + 1];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theDstIndex++;
- theTemp = inBuffer[theSrcIndex + 2];
- theTemp += inBuffer[theSrcIndex + theSrcLineLength + 2];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theDstIndex++;
- theTemp = inBuffer[theSrcIndex + 3];
- theTemp += inBuffer[theSrcIndex + theSrcLineLength + 3];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theDstIndex++;
- // Reset our position calculation
- theXPosition -= inWidth;
- }
- }
- // Reset our position calculation
- theYPosition = inDstHeight - inHeight + theYPosition;
- // Make the src index point to the next line
- theSrcIndex += 4;
- } // Ends the if to check if we are crossing a row boundary
- // Else we are not crossing a row boundary
- else {
- for (theColumn = 0; theColumn < inDstWidth; theColumn++) {
- // If we are crossing a column boundary
- if (theXPosition < inWidth) {
- theXRatio = (unsigned short)((theXPosition << 8) / inWidth);
- theXInvRatio = (unsigned short)((1 << 8) - theXRatio);
-
- theTemp = inBuffer[theSrcIndex];
- theTemp += inBuffer[theSrcIndex + 4];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theSrcIndex++;
- theDstIndex++;
- theTemp = inBuffer[theSrcIndex];
- theTemp += inBuffer[theSrcIndex + 4];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theSrcIndex++;
- theDstIndex++;
- theTemp = inBuffer[theSrcIndex];
- theTemp += inBuffer[theSrcIndex + 4];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theSrcIndex++;
- theDstIndex++;
- theTemp = inBuffer[theSrcIndex];
- theTemp += inBuffer[theSrcIndex + 4];
- outBuffer[theDstIndex] = (unsigned char)(theTemp >> 1);
- theSrcIndex++;
- theDstIndex++;
-
- theXPosition = inDstWidth - inWidth + theXPosition;
- }
- // Else we are not crossing a column boundary
- else {
- *((long *)(outBuffer + theDstIndex)) = *((long *)(inBuffer + theSrcIndex));
- theDstIndex += 4;
- theXPosition -= inWidth;
- }
- }
- // reset our y position indicator
- theYPosition -= inHeight;
- // reset the src index to the beginning the next line
- theSrcIndex += 4;
- // reset src index to the beginning of this line
- theSrcIndex -= theSrcLineLength;
- } // End of else for row boundary
- } // End of for loop for iterating through all rows
-}
-
-//==============================================================================
-/**
- * @param inSrcBuffer
- */
-void CImageScaler::ReduceCols(unsigned char *inSrcBuffer, long inSrcWidth, long inSrcHeight,
- unsigned char *&outDstBuffer, long inDstWidth)
-{
- long theDDAConst = static_cast<long>(1024.0 * inDstWidth / inSrcWidth);
- long theDDAAccum = 0L;
- long thePixelCount;
-
- long theSrcRow;
- long theSrcCol;
- long theDstCol;
-
- long theRedAccum;
- long theGreenAccum;
- long theBlueAccum;
- long theAlphaAccum;
-
- unsigned char *theDstPointer = outDstBuffer;
- unsigned char *theSrcPointer = inSrcBuffer;
- unsigned char *theSrcRowPointer;
- unsigned char *theDstRowPointer;
-
- long theSrcStepSize = 4;
- long theDstStepSize = 4;
-
- for (theSrcRow = 0; theSrcRow < inSrcHeight; ++theSrcRow) {
-
- theSrcRowPointer = theSrcPointer + (theSrcRow * inSrcWidth * theSrcStepSize);
- theDstRowPointer = theDstPointer + (theSrcRow * inDstWidth * theDstStepSize);
-
- theSrcCol = 0L;
- theDstCol = 0L;
- theRedAccum = 0L;
- theGreenAccum = 0L;
- theBlueAccum = 0L;
- theAlphaAccum = 0L;
- thePixelCount = 0L;
- theDDAAccum = 0L;
-
- while (theSrcCol < inSrcWidth) {
- while ((theDDAAccum < 1024L) && (theSrcCol < inSrcWidth)) {
- theRedAccum += 1024L * theSrcRowPointer[(theSrcCol * theSrcStepSize) + 0];
- theGreenAccum += 1024L * theSrcRowPointer[(theSrcCol * theSrcStepSize) + 1];
- theBlueAccum += 1024L * theSrcRowPointer[(theSrcCol * theSrcStepSize) + 2];
- theAlphaAccum += 1024L * theSrcRowPointer[(theSrcCol * theSrcStepSize) + 3];
-
- theDDAAccum += theDDAConst;
- thePixelCount += 1024L;
- ++theSrcCol;
- }
-
- theDDAAccum = (theSrcCol < inSrcWidth) ? (theDDAAccum - 1024L) : (0L);
- thePixelCount -= theDDAAccum;
-
- theRedAccum -=
- theDDAAccum * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 0];
- theGreenAccum -=
- theDDAAccum * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 1];
- theBlueAccum -=
- theDDAAccum * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 2];
- theAlphaAccum -=
- theDDAAccum * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 3];
-
- theDstRowPointer[(theDstCol * theDstStepSize) + 0] =
- (unsigned char)(theRedAccum / thePixelCount);
- theDstRowPointer[(theDstCol * theDstStepSize) + 1] =
- (unsigned char)(theGreenAccum / thePixelCount);
- theDstRowPointer[(theDstCol * theDstStepSize) + 2] =
- (unsigned char)(theBlueAccum / thePixelCount);
- theDstRowPointer[(theDstCol * theDstStepSize) + 3] =
- (unsigned char)(theAlphaAccum / thePixelCount);
-
- thePixelCount = 1024L - theDDAAccum;
- ++theDstCol;
-
- if (theDstCol >= inDstWidth) {
- break;
- }
-
- theRedAccum =
- thePixelCount * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 0];
- theGreenAccum =
- thePixelCount * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 1];
- theBlueAccum =
- thePixelCount * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 2];
- theAlphaAccum =
- thePixelCount * (long)theSrcRowPointer[((theSrcCol - 1) * theSrcStepSize) + 3];
- }
- }
-}
-
-//==============================================================================
-/**
- * @param inSrcBuffer
- */
-void CImageScaler::ReduceRows(unsigned char *inSrcBuffer, long inSrcWidth, long inSrcHeight,
- unsigned char *&outDstBuffer, long inDstHeight)
-{
- long theDDAConst = static_cast<long>(1024.0 * inDstHeight / inSrcHeight);
- long theDDAAccum = 0;
- long thePixelCount;
-
- long theSrcRow;
- long theSrcCol;
- long theDstRow;
-
- long theRedAccum;
- long theGreenAccum;
- long theBlueAccum;
- long theAlphaAccum;
-
- unsigned char *theDstPointer = outDstBuffer;
- unsigned char *theSrcPointer = inSrcBuffer;
- unsigned char *theSrcColPointer = NULL;
- unsigned char *theDstColPointer = NULL;
-
- long theStepSize = 4;
- long theSrcStride = 4 * inSrcWidth;
- long theDstStride = 4 * inSrcWidth;
-
- for (theSrcCol = 0; theSrcCol < inSrcWidth; ++theSrcCol) {
- theSrcColPointer = theSrcPointer + (theSrcCol * theStepSize);
- theDstColPointer = theDstPointer + (theSrcCol * theStepSize);
-
- theSrcRow = 0L;
- theDstRow = 0L;
- theRedAccum = 0L;
- theGreenAccum = 0L;
- theBlueAccum = 0L;
- theAlphaAccum = 0L;
- thePixelCount = 0L;
-
- theDDAAccum = 0L;
-
- while (theSrcRow < inSrcHeight) {
- while ((theDDAAccum < 1024L) && (theSrcRow < inSrcHeight)) {
- theRedAccum += 1024L * theSrcColPointer[(theSrcRow * theSrcStride) + 0];
- theGreenAccum += 1024L * theSrcColPointer[(theSrcRow * theSrcStride) + 1];
- theBlueAccum += 1024L * theSrcColPointer[(theSrcRow * theSrcStride) + 2];
- theAlphaAccum += 1024L * theSrcColPointer[(theSrcRow * theSrcStride) + 3];
-
- theDDAAccum += theDDAConst;
- thePixelCount += 1024L;
- ++theSrcRow;
- }
-
- theDDAAccum = (theSrcRow < inSrcHeight) ? (theDDAAccum - 1024L) : (0L);
- thePixelCount -= theDDAAccum;
-
- theRedAccum -=
- theDDAAccum * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 0];
- theGreenAccum -=
- theDDAAccum * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 1];
- theBlueAccum -=
- theDDAAccum * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 2];
- theAlphaAccum -=
- theDDAAccum * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 3];
-
- theDstColPointer[(theDstRow * theDstStride) + 0] =
- (unsigned char)(theRedAccum / thePixelCount);
- theDstColPointer[(theDstRow * theDstStride) + 1] =
- (unsigned char)(theGreenAccum / thePixelCount);
- theDstColPointer[(theDstRow * theDstStride) + 2] =
- (unsigned char)(theBlueAccum / thePixelCount);
- theDstColPointer[(theDstRow * theDstStride) + 3] =
- (unsigned char)(theAlphaAccum / thePixelCount);
-
- thePixelCount = 1024L - theDDAAccum;
- ++theDstRow;
-
- if (theDstRow >= inDstHeight) {
- break;
- }
-
- theRedAccum =
- thePixelCount * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 0];
- theGreenAccum =
- thePixelCount * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 1];
- theBlueAccum =
- thePixelCount * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 2];
- theAlphaAccum =
- thePixelCount * (long)theSrcColPointer[((theSrcRow - 1) * theSrcStride) + 3];
- }
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.h
deleted file mode 100644
index 27b51770..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageScaler.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2001 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Prefix
-//==============================================================================
-#ifndef __IMAGESCALER_H_
-#define __IMAGESCALER_H_
-#include "Qt3DSRender.h"
-
-namespace qt3ds {
-namespace render {
- //==============================================================================
- // Class
- //==============================================================================
- //==============================================================================
- /**
- * @class CImageScaler
- */
- //==============================================================================
- class CImageScaler
- {
- NVAllocatorCallback &m_Allocator;
-
- public:
- //==============================================================================
- // Methods
- //==============================================================================
- enum EScaleMethod {
- SCALEMETHOD_CROP = -1, // Debug only, not a scaler
- SCALEMETHOD_POINTSAMPLE = 0,
- SCALEMETHOD_BILINEAR = 1,
- };
-
- //==============================================================================
- // Methods
- //==============================================================================
-
- // Access
-
- public:
- CImageScaler(NVAllocatorCallback &inAlloc);
-
- void Scale(EScaleMethod inScaleMethod, unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight, unsigned long inChannels);
-
- void FastScale(EScaleMethod inScaleMethod, unsigned char *inOldBuffer,
- unsigned long inOldWidth, unsigned long inOldHeight,
- unsigned char *&outNewBuffer, unsigned long inNewWidth,
- unsigned long inNewHeight, unsigned long inChannels);
-
- void Crop(unsigned char *inOldBuffer, unsigned long inOldWidth, unsigned long inOldHeight,
- unsigned char *&outNewBuffer, unsigned long inNewWidth, unsigned long inNewHeight,
- unsigned long inPlanes);
-
- void Bilinear(unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight, unsigned long inPlanes);
-
- void FastPointSample(unsigned char *inOldBuffer, unsigned long inOldWidth,
- unsigned long inOldHeight, unsigned char *&outNewBuffer,
- unsigned long inNewWidth, unsigned long inNewHeight,
- unsigned long inPlanes);
-
- unsigned char *AllocateBuffer(long inWidth, long inHeight);
- void ReleaseBuffer(unsigned char *&ioBuffer);
- void Resize(unsigned char *inOldBuffer, unsigned long inOldWidth, unsigned long inOldHeight,
- unsigned char *&outNewBuffer, unsigned long inNewWidth,
- unsigned long inNewHeight, unsigned long inPlanes);
-
- // variable numbers of planes, i.e. greyscale, rb, rbg, and rgba or argb
- // Bilinear algorithms, good for quality
- void ExpandRowsAndColumns(unsigned char *inBuffer, unsigned long inWidth,
- unsigned long inHeight, unsigned char *outBuffer,
- unsigned long inDstWidth, unsigned long inDstHeight,
- unsigned long inPlanes);
-
- // The method implemented above, but with some optimizations
- // specifically, fixed the number of planes at 4
- // eliminated the new/delete allocations
- void FastExpandRowsAndColumns(unsigned char *inBuffer, unsigned long inWidth,
- unsigned long inHeight, unsigned char *outBuffer,
- unsigned long inDstWidth, unsigned long inDstHeight);
-
- void ReduceCols(unsigned char *inSrcBuffer, long inSrcWidth, long inSrcHeight,
- unsigned char *&outDstBuffer, long inDstWidth);
- void ReduceRows(unsigned char *inSrcBuffer, long inSrcWidth, long inSrcHeight,
- unsigned char *&outDstBuffer, long inDstHeight);
- };
-}
-}
-
-#endif // !defined(__IMAGESCALER_H_)
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageTextureData.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageTextureData.h
deleted file mode 100644
index aaa73d7e..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderImageTextureData.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_IMAGE_TEXTURE_DATA_H
-#define QT3DS_RENDER_IMAGE_TEXTURE_DATA_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSFlags.h"
-
-#include <QtCore/qsharedpointer.h>
-#include <QtCore/qvector.h>
-
-namespace qt3ds {
-namespace render {
-
- // forward declararion
- class Qt3DSRenderPrefilterTexture;
-
- struct ImageTextureFlagValues
- {
- enum Enum {
- HasTransparency = 1,
- InvertUVCoords = 1 << 1,
- PreMultiplied = 1 << 2,
- };
- };
-
- struct SImageTextureFlags : public NVFlags<ImageTextureFlagValues::Enum, QT3DSU32>
- {
- bool HasTransparency() const
- {
- return this->operator&(ImageTextureFlagValues::HasTransparency);
- }
- void SetHasTransparency(bool inValue)
- {
- clearOrSet(inValue, ImageTextureFlagValues::HasTransparency);
- }
-
- bool IsInvertUVCoords() const
- {
- return this->operator&(ImageTextureFlagValues::InvertUVCoords);
- }
- void SetInvertUVCoords(bool inValue)
- {
- clearOrSet(inValue, ImageTextureFlagValues::InvertUVCoords);
- }
-
- bool IsPreMultiplied() const
- {
- return this->operator&(ImageTextureFlagValues::PreMultiplied);
- }
- void SetPreMultiplied(bool inValue)
- {
- clearOrSet(inValue, ImageTextureFlagValues::PreMultiplied);
- }
- };
-
- struct SImageTextureData
- {
- NVRenderTexture2D *m_Texture;
- SImageTextureFlags m_TextureFlags;
- Qt3DSRenderPrefilterTexture *m_BSDFMipMap;
-
- SImageTextureData()
- : m_Texture(nullptr)
- , m_BSDFMipMap(nullptr)
- {
- }
-
- SImageTextureData(const SImageTextureData& data)
- : m_Texture(data.m_Texture), m_TextureFlags(data.m_TextureFlags)
- , m_BSDFMipMap(data.m_BSDFMipMap)
- {
-
- }
-
- bool operator!=(const SImageTextureData &inOther)
- {
- return m_Texture != inOther.m_Texture || m_TextureFlags != inOther.m_TextureFlags
- || m_BSDFMipMap != inOther.m_BSDFMipMap;
- }
- };
-
- struct IReloadableCallback
- {
- virtual ~IReloadableCallback() {}
- virtual void onLoad() = 0;
- virtual void onUnload() = 0;
- };
-
- struct SImage;
- struct SReloadableImageTextureData : public SImageTextureData
- {
- QString m_path;
- bool m_loaded;
- bool m_scanTransparency;
- bool m_bsdfMipmap;
- bool m_initialized;
- QVector<SImage *> m_callbacks;
-
- SReloadableImageTextureData()
- : SImageTextureData()
- , m_loaded(false), m_scanTransparency(false), m_bsdfMipmap(false), m_initialized(false)
- {
- }
- };
-
- typedef QSharedPointer<SReloadableImageTextureData> ReloadableTexturePtr;
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.cpp
deleted file mode 100644
index 1a418b1e..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderInputStreamFactory.h"
-
-#include "stdio.h"
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/string.h"
-#include "EASTL/vector.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/FileTools.h"
-#include "foundation/Qt3DSMutex.h"
-
-#include <QDir>
-#include <QDirIterator>
-#include <QFile>
-#include <QFileInfo>
-#include <QUrl>
-
-using namespace qt3ds::render;
-
-namespace {
-struct SInputStream : public IRefCountedInputStream
-{
- NVFoundationBase &m_Foundation;
- QString m_Path;
- QFile m_File;
- volatile QT3DSI32 mRefCount;
-
- SInputStream(NVFoundationBase &inFoundation, const QString &inPath)
- : m_Foundation(inFoundation)
- , m_Path(inPath)
- , m_File(inPath)
- , mRefCount(0)
- {
- m_File.open(QIODevice::ReadOnly);
- }
- virtual ~SInputStream()
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- QT3DSU32 Read(NVDataRef<QT3DSU8> data) override
- {
- return m_File.read((char *)data.begin(), data.size());
- }
-
- bool Write(NVConstDataRef<QT3DSU8> /*data*/) override
- {
- QT3DS_ASSERT(false);
- return false;
- }
-
- void SetPosition(QT3DSI64 inOffset, qt3ds::foundation::SeekPosition::Enum inEnum) override
- {
- if (inOffset > QT3DS_MAX_I32 || inOffset < QT3DS_MIN_I32) {
- qCCritical(INVALID_OPERATION, "Attempt to seek further than platform allows");
- QT3DS_ASSERT(false);
- return;
- } else {
- CFileTools::SetStreamPosition(m_File, inOffset, inEnum);
- }
- }
- QT3DSI64 GetPosition() const override
- {
- return m_File.pos();
- }
-
- static SInputStream *OpenFile(const QString &inPath, NVFoundationBase &inFoundation)
- {
- return QT3DS_NEW(inFoundation.getAllocator(), SInputStream)(inFoundation, inPath);
- }
-};
-
-typedef eastl::basic_string<char8_t, ForwardingAllocator> TStrType;
-struct SFactory : public IInputStreamFactory
-{
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
-
- Mutex m_Mutex;
- typedef Mutex::ScopedLock TScopedLock;
-
- const QString QT3DSTUDIO_TAG = QStringLiteral("qt3dstudio");
-
- SFactory(NVFoundationBase &inFoundation)
- : m_Foundation(inFoundation)
- , mRefCount(0)
- , m_Mutex(inFoundation.getAllocator())
- {
- // Add the top-level qrc directory
- if (!QDir::searchPaths(QT3DSTUDIO_TAG).contains(QLatin1String(":/")))
- QDir::addSearchPath(QT3DSTUDIO_TAG, QStringLiteral(":/"));
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- QFileInfo matchCaseInsensitiveFile(const QString& file, bool inQuiet)
- {
- if (!inQuiet) {
- // Some assets are searched for in several levels in the project structure,
- // we don't want to alert user of things that can't be fixed in the presentation
- // itself.
- qCWarning(WARNING, PERF_INFO, "Case-insensitive matching with file: %s",
- file.toLatin1().constData());
- }
- const QStringList searchDirectories = QDir::searchPaths(QT3DSTUDIO_TAG);
- for (const auto &directoryPath : searchDirectories) {
- QFileInfo fileInfo(file);
- QDirIterator it(directoryPath, {fileInfo.fileName()}, QDir::NoFilter,
- QDirIterator::Subdirectories);
- while (it.hasNext()) {
- QString filePath = it.next();
- if (filePath.compare(QDir::cleanPath(directoryPath + '/' + file),
- Qt::CaseInsensitive) == 0) {
- return QFileInfo(filePath);
- }
- }
- }
-
- return QFileInfo();
- }
-
- void AddSearchDirectory(const char8_t *inDirectory) override
- {
- TScopedLock __factoryLocker(m_Mutex);
- QString localDir = CFileTools::NormalizePathForQtUsage(inDirectory);
- QDir directory(localDir);
- if (!directory.exists()) {
- qCCritical(INTERNAL_ERROR, "Adding search directory: %s", inDirectory);
- return;
- }
-
- if (!QDir::searchPaths(QT3DSTUDIO_TAG).contains(localDir))
- QDir::addSearchPath(QT3DSTUDIO_TAG, localDir);
- }
-
-
- IRefCountedInputStream *GetStreamForFile(const QString &inFilename, bool inQuiet) override
- {
- TScopedLock __factoryLocker(m_Mutex);
- QString localFile = CFileTools::NormalizePathForQtUsage(inFilename);
- QFileInfo fileInfo = QFileInfo(localFile);
- SInputStream *inputStream = nullptr;
- // Try to match the file with the search paths
- if (!fileInfo.exists())
- fileInfo.setFile(QStringLiteral("qt3dstudio:") + localFile);
-
- // Try to match the case-insensitive file with the given search paths
- if (!fileInfo.exists())
- fileInfo = matchCaseInsensitiveFile(localFile, inQuiet);
-
- if (fileInfo.exists())
- inputStream = SInputStream::OpenFile(fileInfo.absoluteFilePath(), m_Foundation);
-
- if (!inputStream && !inQuiet) {
- // Print extensive debugging information.
- qCCritical(INTERNAL_ERROR, "Failed to find file: %s", localFile.toLatin1().constData());
- qCCritical(INTERNAL_ERROR, "Searched path: %s",
- QDir::searchPaths(QT3DSTUDIO_TAG).join(',').toLatin1().constData());
- }
- return inputStream;
- }
-
- bool GetPathForFile(const QString &inFilename, QString &outFile,
- bool inQuiet = false) override
- {
- NVScopedRefCounted<IRefCountedInputStream> theStream =
- GetStreamForFile(inFilename, inQuiet);
- if (theStream) {
- SInputStream *theRealStream = static_cast<SInputStream *>(theStream.mPtr);
- outFile = theRealStream->m_Path;
- return true;
- }
- return false;
- }
-};
-}
-
-IInputStreamFactory &IInputStreamFactory::Create(NVFoundationBase &inFoundation)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), SFactory)(inFoundation);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.h
deleted file mode 100644
index e82134b8..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderInputStreamFactory.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_INPUT_STREAM_FACTORY_H
-#define QT3DS_RENDER_INPUT_STREAM_FACTORY_H
-#include "Qt3DSRender.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "EASTL/string.h"
-
-namespace qt3ds {
-namespace render {
- class IRefCountedInputStream : public qt3ds::foundation::ISeekableIOStream, public NVRefCounted
- {
- protected:
- virtual ~IRefCountedInputStream() {}
- };
- // This class is threadsafe.
- class IInputStreamFactory : public NVRefCounted
- {
- protected:
- virtual ~IInputStreamFactory() {}
- public:
- // These directories must have a '/' on them
- virtual void AddSearchDirectory(const char8_t *inDirectory) = 0;
- virtual IRefCountedInputStream *GetStreamForFile(const QString &inFilename,
- bool inQuiet = false) = 0;
- // Return a path for this file. Returns true if GetStreamForFile would return a valid
- // stream.
- // else returns false
- virtual bool GetPathForFile(const QString &inFilename, QString &outFile,
- bool inQuiet = false) = 0;
-
- // Create an input stream factory using this foundation and an platform-optional app
- // directory
- // on android the app directory has no effect; use use the assets bundled with the APK file.
- static IInputStreamFactory &Create(NVFoundationBase &inFoundation);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderLightConstantProperties.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderLightConstantProperties.h
deleted file mode 100644
index 4dcd62c5..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderLightConstantProperties.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_RENDER_LIGHT_CONSTANT_PROPERTIES
-#define QT3DS_RENDER_LIGHT_CONSTANT_PROPERTIES
-
-#include "render/Qt3DSRenderShaderProgram.h"
-
-namespace qt3ds {
-namespace render {
-
-static const QStringList lconstantnames = {
- QStringLiteral("position"),
- QStringLiteral("direction"),
- QStringLiteral("up"),
- QStringLiteral("right"),
- QStringLiteral("diffuse"),
- QStringLiteral("ambient"),
- QStringLiteral("specular"),
- QStringLiteral("spotExponent"),
- QStringLiteral("spotCutoff"),
- QStringLiteral("constantAttenuation"),
- QStringLiteral("linearAttenuation"),
- QStringLiteral("quadraticAttenuation"),
- QStringLiteral("range"),
- QStringLiteral("width"),
- QStringLiteral("height"),
- QStringLiteral("shadowControls"),
- QStringLiteral("shadowView"),
- QStringLiteral("shadowIdx"),
- QStringLiteral("attenuation")
-};
-
-#define LCSEED QStringLiteral("%1%2")
-
-template <typename GeneratedShader>
-struct SLightConstantProperties
-{
- struct LightConstants
- {
- NVRenderCachedShaderProperty<QT3DSVec4> m_position;
- NVRenderCachedShaderProperty<QT3DSVec4> m_direction;
- NVRenderCachedShaderProperty<QT3DSVec4> m_up;
- NVRenderCachedShaderProperty<QT3DSVec4> m_right;
- NVRenderCachedShaderProperty<QT3DSVec4> m_diffuse;
- NVRenderCachedShaderProperty<QT3DSVec4> m_ambient;
- NVRenderCachedShaderProperty<QT3DSVec4> m_specular;
- NVRenderCachedShaderProperty<QT3DSF32> m_spotExponent;
- NVRenderCachedShaderProperty<QT3DSF32> m_spotCutoff;
- NVRenderCachedShaderProperty<QT3DSF32> m_constantAttenuation;
- NVRenderCachedShaderProperty<QT3DSF32> m_linearAttenuation;
- NVRenderCachedShaderProperty<QT3DSF32> m_quadraticAttenuation;
- NVRenderCachedShaderProperty<QT3DSF32> m_range;
- NVRenderCachedShaderProperty<QT3DSF32> m_width;
- NVRenderCachedShaderProperty<QT3DSF32> m_height;
- NVRenderCachedShaderProperty<QT3DSVec4> m_shadowControls;
- NVRenderCachedShaderProperty<QT3DSMat44> m_shadowView;
- NVRenderCachedShaderProperty<QT3DSI32> m_shadowIdx;
- NVRenderCachedShaderProperty<QT3DSVec3> m_attenuation;
-
- LightConstants(const QString &lightRef, render::NVRenderShaderProgram &shader)
- : m_position(LCSEED.arg(lightRef, lconstantnames[0]), shader)
- , m_direction(LCSEED.arg(lightRef).arg(lconstantnames[1]), shader)
- , m_up(LCSEED.arg(lightRef, lconstantnames[2]), shader)
- , m_right(LCSEED.arg(lightRef, lconstantnames[3]), shader)
- , m_diffuse(LCSEED.arg(lightRef, lconstantnames[4]), shader)
- , m_ambient(LCSEED.arg(lightRef, lconstantnames[5]), shader)
- , m_specular(LCSEED.arg(lightRef, lconstantnames[6]), shader)
- , m_spotExponent(LCSEED.arg(lightRef, lconstantnames[7]), shader)
- , m_spotCutoff(LCSEED.arg(lightRef, lconstantnames[8]), shader)
- , m_constantAttenuation(LCSEED.arg(lightRef, lconstantnames[9]), shader)
- , m_linearAttenuation(LCSEED.arg(lightRef, lconstantnames[10]), shader)
- , m_quadraticAttenuation(LCSEED.arg(lightRef, lconstantnames[11]), shader)
- , m_range(LCSEED.arg(lightRef, lconstantnames[12]), shader)
- , m_width(LCSEED.arg(lightRef, lconstantnames[13]), shader)
- , m_height(LCSEED.arg(lightRef, lconstantnames[14]), shader)
- , m_shadowControls(LCSEED.arg(lightRef, lconstantnames[15]), shader)
- , m_shadowView(LCSEED.arg(lightRef, lconstantnames[16]), shader)
- , m_shadowIdx(LCSEED.arg(lightRef, lconstantnames[17]), shader)
- , m_attenuation(LCSEED.arg(lightRef, lconstantnames[18]), shader)
- {
-
- }
-
- template <typename LightProps>
- void updateLights(LightProps &props)
- {
- m_position.Set(props.m_position);
- m_direction.Set(props.m_direction);
- m_up.Set(props.m_up);
- m_right.Set(props.m_right);
- m_diffuse.Set(props.m_diffuse);
- m_ambient.Set(props.m_ambient);
- m_specular.Set(props.m_specular);
- m_spotExponent.Set(props.m_spotExponent);
- m_spotCutoff.Set(props.m_spotCutoff);
- m_constantAttenuation.Set(props.m_constantAttenuation);
- m_linearAttenuation.Set(props.m_linearAttenuation);
- m_quadraticAttenuation.Set(props.m_quadraticAttenuation);
- m_range.Set(props.m_range);
- m_width.Set(props.m_width);
- m_height.Set(props.m_height);
- m_shadowControls.Set(props.m_shadowControls);
- m_shadowView.Set(props.m_shadowView);
- m_shadowIdx.Set(props.m_shadowIdx);
- m_attenuation.Set(QT3DSVec3(props.m_constantAttenuation,
- props.m_linearAttenuation,
- props.m_quadraticAttenuation));
- }
- };
-
- SLightConstantProperties(GeneratedShader &shader, bool packed)
- : m_lightCount("uNumLights", shader.m_Shader)
- {
- m_constants.resize(shader.m_Lights.size());
- for (unsigned int i = 0; i < shader.m_Lights.size(); ++i) {
- QString lref;
- if (packed)
- lref = QStringLiteral("light_%1_");
- else
- lref = QStringLiteral("lights[%1].");
- lref = lref.arg(i);
- m_constants[i] = new LightConstants(lref, shader.m_Shader);
- }
- m_lightCount.Set(shader.m_Lights.size());
- m_lightCountInt = shader.m_Lights.size();
- }
-
- SLightConstantProperties(const QString &lseed, const QString &lcount,
- GeneratedShader &shader, bool packed, int count)
- : m_lightCount(lcount, shader.m_Shader)
- {
- m_constants.resize(count);
- for (int i = 0; i < count; ++i) {
- QString lref;
- if (packed)
- lref = lseed + QStringLiteral("_%1_");
- else
- lref = lseed + QStringLiteral("[%1].");
- lref = lref.arg(i);
- m_constants[i] = new LightConstants(lref, shader.m_Shader);
- }
- m_lightCount.Set(count);
- m_lightCountInt = count;
- }
-
- ~SLightConstantProperties()
- {
- qDeleteAll(m_constants);
- }
-
- void updateLights(GeneratedShader &shader)
- {
- for (int i = 0; i < m_constants.size(); ++i)
- m_constants[i]->updateLights(shader.m_Lights[i].m_LightData);
- }
- template <typename LightProps>
- void updateLights(const QVector<LightProps*> &props)
- {
- for (int i = 0; i < m_constants.size(); ++i)
- m_constants[i]->updateLights(props[i]->m_LightData);
- }
-
- QVector<LightConstants *> m_constants;
- NVRenderCachedShaderProperty<QT3DSI32> m_lightCount;
- int m_lightCountInt;
-};
-
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialHelpers.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialHelpers.h
deleted file mode 100644
index afb799e7..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialHelpers.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_MATERIAL_HELPERS_H
-#define QT3DS_RENDER_MATERIAL_HELPERS_H
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderReferencedMaterial.h"
-
-namespace qt3ds {
-namespace render {
-
- inline bool IsMaterial(SGraphObject &obj)
- {
- return obj.m_Type == GraphObjectTypes::CustomMaterial
- || obj.m_Type == GraphObjectTypes::DefaultMaterial
- || obj.m_Type == GraphObjectTypes::ReferencedMaterial;
- }
-
- inline bool IsMaterial(SGraphObject *obj)
- {
- if (obj)
- return IsMaterial(*obj);
- return false;
- }
-
- inline bool IsImage(SGraphObject &obj) { return obj.m_Type == GraphObjectTypes::Image; }
-
- inline bool IsImage(SGraphObject *obj)
- {
- if (obj)
- return IsImage(*obj);
- return false;
- }
-
- inline SGraphObject *GetNextMaterialSibling(SGraphObject *obj)
- {
- if (obj == NULL)
- return NULL;
- if (IsMaterial(obj) == false) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- if (obj->m_Type == GraphObjectTypes::CustomMaterial)
- return static_cast<SCustomMaterial *>(obj)->m_NextSibling;
- else if (obj->m_Type == GraphObjectTypes::DefaultMaterial)
- return static_cast<SDefaultMaterial *>(obj)->m_NextSibling;
- else
- return static_cast<SReferencedMaterial *>(obj)->m_NextSibling;
- }
-
- inline void SetNextMaterialSibling(SGraphObject &obj, SGraphObject *sibling)
- {
- if (IsMaterial(obj) == false) {
- QT3DS_ASSERT(false);
- return;
- }
- if (obj.m_Type == GraphObjectTypes::CustomMaterial)
- static_cast<SCustomMaterial *>(&obj)->m_NextSibling = sibling;
- else if (obj.m_Type == GraphObjectTypes::DefaultMaterial)
- static_cast<SDefaultMaterial *>(&obj)->m_NextSibling = sibling;
- else
- static_cast<SReferencedMaterial *>(&obj)->m_NextSibling = sibling;
- }
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h
deleted file mode 100644
index e8b9880d..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_MATERIAL_SHADER_GENERATOR_H
-#define QT3DS_RENDER_MATERIAL_SHADER_GENERATOR_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSRenderShaderKeys.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-
-namespace qt3ds {
-namespace render {
-
-// these are our current shader limits
-#define QT3DS_MAX_NUM_LIGHTS 16
-#define QT3DS_MAX_NUM_SHADOWS 8
-
- // note this struct must exactly match the memory layout of the
- // struct sampleLight.glsllib and sampleArea.glsllib. If you make changes here you need
- // to adjust the code in sampleLight.glsllib and sampleArea.glsllib as well
- struct SLightSourceShader
- {
- QT3DSVec4 m_position;
- QT3DSVec4 m_direction; // Specifies the light direction in world coordinates.
- QT3DSVec4 m_up;
- QT3DSVec4 m_right;
- QT3DSVec4 m_diffuse;
- QT3DSVec4 m_ambient;
- QT3DSVec4 m_specular;
- QT3DSF32 m_spotExponent; // Specifies the intensity distribution of the light.
- QT3DSF32 m_spotCutoff; // Specifies the maximum spread angle of the light.
- QT3DSF32 m_constantAttenuation; // Specifies the constant light attenuation factor.
- QT3DSF32 m_linearAttenuation; // Specifies the linear light attenuation factor.
- QT3DSF32 m_quadraticAttenuation; // Specifies the quadratic light attenuation factor.
- QT3DSF32 m_range; // Specifies the maximum distance of the light influence
- QT3DSF32 m_width; // Specifies the width of the area light surface.
- QT3DSF32 m_height; // Specifies the height of the area light surface;
- QT3DSVec4 m_shadowControls;
- QT3DSMat44 m_shadowView;
- QT3DSI32 m_shadowIdx;
- QT3DSF32 m_padding1[3];
- };
-
- struct SLayerGlobalRenderProperties
- {
- const SLayer &m_Layer;
- SCamera &m_Camera;
- QT3DSVec3 m_CameraDirection;
- NVDataRef<SLight *> m_Lights;
- NVDataRef<QT3DSVec3> m_LightDirections;
- Qt3DSShadowMap *m_ShadowMapManager;
- NVRenderTexture2D *m_DepthTexture;
- NVRenderTexture2D *m_SSaoTexture;
- SImage *m_LightProbe;
- SImage *m_LightProbe2;
- QT3DSF32 m_ProbeHorizon;
- QT3DSF32 m_ProbeBright;
- QT3DSF32 m_Probe2Window;
- QT3DSF32 m_Probe2Pos;
- QT3DSF32 m_Probe2Fade;
- QT3DSF32 m_ProbeFOV;
-
- SLayerGlobalRenderProperties(const SLayer &inLayer, SCamera &inCamera,
- QT3DSVec3 inCameraDirection, NVDataRef<SLight *> inLights,
- NVDataRef<QT3DSVec3> inLightDirections,
- Qt3DSShadowMap *inShadowMapManager,
- NVRenderTexture2D *inDepthTexture,
- NVRenderTexture2D *inSSaoTexture, SImage *inLightProbe,
- SImage *inLightProbe2, QT3DSF32 inProbeHorizon,
- QT3DSF32 inProbeBright, QT3DSF32 inProbe2Window, QT3DSF32 inProbe2Pos,
- QT3DSF32 inProbe2Fade, QT3DSF32 inProbeFOV)
- : m_Layer(inLayer)
- , m_Camera(inCamera)
- , m_CameraDirection(inCameraDirection)
- , m_Lights(inLights)
- , m_LightDirections(inLightDirections)
- , m_ShadowMapManager(inShadowMapManager)
- , m_DepthTexture(inDepthTexture)
- , m_SSaoTexture(inSSaoTexture)
- , m_LightProbe(inLightProbe)
- , m_LightProbe2(inLightProbe2)
- , m_ProbeHorizon(inProbeHorizon)
- , m_ProbeBright(inProbeBright)
- , m_Probe2Window(inProbe2Window)
- , m_Probe2Pos(inProbe2Pos)
- , m_Probe2Fade(inProbe2Fade)
- , m_ProbeFOV(inProbeFOV)
- {
- }
- };
-
- class IMaterialShaderGenerator : public NVRefCounted
- {
- public:
- struct SImageVariableNames
- {
- const char8_t *m_ImageSampler;
- const char8_t *m_ImageFragCoords;
- };
-
- virtual SImageVariableNames GetImageVariableNames(QT3DSU32 inIdx) = 0;
- virtual void GenerateImageUVCoordinates(IShaderStageGenerator &inVertexPipeline, QT3DSU32 idx,
- QT3DSU32 uvSet, SRenderableImage &image) = 0;
-
- // inPipelineName needs to be unique else the shader cache will just return shaders from
- // different pipelines.
- virtual NVRenderShaderProgram *GenerateShader(
- const SGraphObject &inMaterial, SShaderDefaultMaterialKey inShaderDescription,
- IShaderStageGenerator &inVertexPipeline, TShaderFeatureSet inFeatureSet,
- NVDataRef<SLight *> inLights, SRenderableImage *inFirstImage, bool inHasTransparency,
- const char8_t *inVertexPipelineName, const char8_t *inCustomMaterialName = "") = 0;
-
- // Also sets the blend function on the render context.
- virtual void
- SetMaterialProperties(NVRenderShaderProgram &inProgram, const SGraphObject &inMaterial,
- const QT3DSVec2 &inCameraVec, const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 &inNormalMatrix, const QT3DSMat44 &inGlobalTransform,
- SRenderableImage *inFirstImage, QT3DSF32 inOpacity,
- SLayerGlobalRenderProperties inRenderProperties) = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMesh.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMesh.h
deleted file mode 100644
index d6959ec8..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderMesh.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_MESH_H
-#define QT3DS_RENDER_MESH_H
-#include "Qt3DSRender.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "render/Qt3DSRenderInputAssembler.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSNoCopy.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SRenderSubsetBase
- {
- QT3DSU32 m_Count;
- QT3DSU32 m_Offset;
- NVBounds3 m_Bounds; // Vertex buffer bounds
- SRenderSubsetBase() {}
- SRenderSubsetBase(const SRenderSubsetBase &inOther)
- : m_Count(inOther.m_Count)
- , m_Offset(inOther.m_Offset)
- , m_Bounds(inOther.m_Bounds)
- {
- }
-
- SRenderSubsetBase &operator=(const SRenderSubsetBase &inOther)
- {
- m_Count = inOther.m_Count;
- m_Offset = inOther.m_Offset;
- m_Bounds = inOther.m_Bounds;
- return *this;
- }
- };
-
- struct SRenderJoint
- {
- QT3DSI32 m_JointID;
- QT3DSI32 m_ParentID;
- QT3DSF32 m_invBindPose[16];
- QT3DSF32 m_localToGlobalBoneSpace[16];
- };
-
- struct SRenderSubset : public SRenderSubsetBase
- {
- NVRenderInputAssembler *m_InputAssembler;
- NVRenderInputAssembler *m_InputAssemblerDepth;
- NVRenderInputAssembler
- *m_InputAssemblerPoints; ///< similar to depth but ignores index buffer.
- NVRenderVertexBuffer *m_VertexBuffer;
- NVRenderVertexBuffer
- *m_PosVertexBuffer; ///< separate position buffer for fast depth path rendering
- NVRenderIndexBuffer *m_IndexBuffer;
- NVRenderDrawMode::Enum m_PrimitiveType; ///< primitive type used for drawing
- QT3DSF32 m_EdgeTessFactor; ///< edge tessellation amount used for tessellation shaders
- QT3DSF32 m_InnerTessFactor; ///< inner tessellation amount used for tessellation shaders
- bool m_WireframeMode; ///< true if we should draw the object as wireframe ( currently ony if
- ///tessellation is enabled )
- NVConstDataRef<SRenderJoint> m_Joints;
- CRegisteredString m_Name;
- nvvector<SRenderSubsetBase> m_SubSubsets;
-
- SRenderSubset(NVAllocatorCallback &alloc)
- : m_InputAssembler(NULL)
- , m_InputAssemblerDepth(NULL)
- , m_InputAssemblerPoints(NULL)
- , m_VertexBuffer(NULL)
- , m_PosVertexBuffer(NULL)
- , m_IndexBuffer(NULL)
- , m_PrimitiveType(NVRenderDrawMode::Triangles)
- , m_EdgeTessFactor(1.0)
- , m_InnerTessFactor(1.0)
- , m_WireframeMode(false)
- , m_SubSubsets(alloc, "SRenderSubset::m_SubSubsets")
- {
- }
- SRenderSubset(const SRenderSubset &inOther)
- : SRenderSubsetBase(inOther)
- , m_InputAssembler(inOther.m_InputAssembler)
- , m_InputAssemblerDepth(inOther.m_InputAssemblerDepth)
- , m_InputAssemblerPoints(inOther.m_InputAssemblerPoints)
- , m_VertexBuffer(inOther.m_VertexBuffer)
- , m_PosVertexBuffer(inOther.m_PosVertexBuffer)
- , m_IndexBuffer(inOther.m_IndexBuffer)
- , m_PrimitiveType(inOther.m_PrimitiveType)
- , m_EdgeTessFactor(inOther.m_EdgeTessFactor)
- , m_InnerTessFactor(inOther.m_InnerTessFactor)
- , m_WireframeMode(inOther.m_WireframeMode)
- , m_Joints(inOther.m_Joints)
- , m_Name(inOther.m_Name)
- , m_SubSubsets(inOther.m_SubSubsets)
- {
- }
- // Note that subSubsets is *not* copied.
- SRenderSubset(NVAllocatorCallback &alloc, const SRenderSubset &inOther,
- const SRenderSubsetBase &inBase)
- : SRenderSubsetBase(inBase)
- , m_InputAssembler(inOther.m_InputAssembler)
- , m_InputAssemblerDepth(inOther.m_InputAssemblerDepth)
- , m_InputAssemblerPoints(inOther.m_InputAssemblerPoints)
- , m_VertexBuffer(inOther.m_VertexBuffer)
- , m_PosVertexBuffer(inOther.m_PosVertexBuffer)
- , m_IndexBuffer(inOther.m_IndexBuffer)
- , m_PrimitiveType(inOther.m_PrimitiveType)
- , m_EdgeTessFactor(inOther.m_EdgeTessFactor)
- , m_InnerTessFactor(inOther.m_InnerTessFactor)
- , m_WireframeMode(inOther.m_WireframeMode)
- , m_Name(inOther.m_Name)
- , m_SubSubsets(alloc, "SRenderSubset::m_SubSubsets")
- {
- }
-
- SRenderSubset &operator=(const SRenderSubset &inOther)
- {
- if (this != &inOther) {
- SRenderSubsetBase::operator=(inOther);
- m_InputAssembler = inOther.m_InputAssembler;
- m_InputAssemblerDepth = inOther.m_InputAssemblerDepth;
- m_VertexBuffer = inOther.m_VertexBuffer;
- m_PosVertexBuffer = inOther.m_PosVertexBuffer;
- m_IndexBuffer = inOther.m_IndexBuffer;
- m_PrimitiveType = inOther.m_PrimitiveType;
- m_EdgeTessFactor = inOther.m_EdgeTessFactor;
- m_InnerTessFactor = inOther.m_InnerTessFactor;
- m_WireframeMode = inOther.m_WireframeMode;
- m_Joints = inOther.m_Joints;
- m_Name = inOther.m_Name;
- m_SubSubsets = inOther.m_SubSubsets;
- }
- return *this;
- }
- };
-
- struct SRenderMesh : public NoCopy
- {
- nvvector<SRenderSubset> m_Subsets;
- nvvector<SRenderJoint> m_Joints;
- NVRenderDrawMode::Enum m_DrawMode;
- NVRenderWinding::Enum m_Winding; // counterclockwise
- QT3DSU32 m_MeshId; // Id from the file of this mesh.
-
- SRenderMesh(NVRenderDrawMode::Enum inDrawMode, NVRenderWinding::Enum inWinding,
- QT3DSU32 inMeshId, NVAllocatorCallback &alloc)
- : m_Subsets(alloc, "SRenderMesh::m_Subsets")
- , m_Joints(alloc, "SRenderMesh::Joints")
- , m_DrawMode(inDrawMode)
- , m_Winding(inWinding)
- , m_MeshId(inMeshId)
- {
- }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.cpp
deleted file mode 100644
index 5b2c51d4..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.cpp
+++ /dev/null
@@ -1,1964 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderPathManager.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSContainers.h"
-#include "EASTL/string.h"
-#include "Qt3DSRenderContextCore.h"
-#include "foundation/Utils.h"
-#include "foundation/StringConversionImpl.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderInputAssembler.h"
-#include "Qt3DSRenderPath.h"
-#include "EASTL/sort.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderShaderCodeGenerator.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderPathRenderContext.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-#include "Qt3DSRenderCustomMaterialShaderGenerator.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "rendererimpl/Qt3DSVertexPipelineImpl.h"
-#include "foundation/Qt3DSMathUtils.h"
-#include "render/Qt3DSRenderPathRender.h"
-#include "render/Qt3DSRenderPathSpecification.h"
-#include "Qt3DSRenderPathSubPath.h"
-#include "Qt3DSImportPath.h"
-#include "Qt3DSRenderPathMath.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "foundation/Qt3DSMutex.h"
-
-using namespace qt3ds::render;
-using qt3ds::render::NVRenderCachedShaderProperty;
-using qt3ds::render::NVRenderCachedShaderBuffer;
-using qt3ds::render::NVRenderStencilFunctionArgument;
-using qt3ds::render::NVRenderBoolOp;
-using qt3ds::render::NVRenderStencilOperationArgument;
-using qt3ds::render::NVRenderStencilOp;
-
-typedef qt3dsimp::SPathBuffer TImportPathBuffer;
-using namespace qt3ds::render::path;
-
-typedef eastl::pair<CRegisteredString, CRegisteredString> TStrStrPair;
-
-namespace eastl {
-template <>
-struct hash<TStrStrPair>
-{
- size_t operator()(const TStrStrPair &item) const
- {
- return eastl::hash<CRegisteredString>()(item.first)
- ^ eastl::hash<CRegisteredString>()(item.second);
- }
-};
-}
-
-struct SPathShaderMapKey
-{
- CRegisteredString m_Name;
- SShaderDefaultMaterialKey m_MaterialKey;
- size_t m_HashCode;
- SPathShaderMapKey(CRegisteredString inName, SShaderDefaultMaterialKey inKey)
- : m_Name(inName)
- , m_MaterialKey(inKey)
- {
- m_HashCode = eastl::hash<TStrStrPair>()(m_Name) ^ m_MaterialKey.hash();
- }
- bool operator==(const SPathShaderMapKey &inKey) const
- {
- return m_Name == inKey.m_Name && m_MaterialKey == inKey.m_MaterialKey;
- }
-};
-
-namespace eastl {
-template <>
-struct hash<SPathShaderMapKey>
-{
- size_t operator()(const SPathShaderMapKey &inKey) const { return inKey.m_HashCode; }
-};
-}
-
-namespace {
-
-struct SPathSubPathBuffer
-{
- NVAllocatorCallback &m_Allocator;
- nvvector<SPathAnchorPoint> m_SourceData;
- SPathDirtyFlags m_Flags;
- SPathSubPath &m_SubPath;
- bool m_Closed;
-
- QT3DSI32 m_RefCount;
-
- SPathSubPathBuffer(NVAllocatorCallback &alloc, SPathSubPath &inSubPath)
- : m_Allocator(alloc)
- , m_SourceData(alloc, "m_SourceData")
- , m_SubPath(inSubPath)
- , m_Closed(false)
- , m_RefCount(0)
- {
- }
-
- void addRef() { atomicIncrement(&m_RefCount); }
- void release()
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Allocator);
- NVDelete(alloc, this);
- }
- }
-};
-
-struct SImportPathWrapper
-{
- NVAllocatorCallback &m_Alloc;
- qt3dsimp::SPathBuffer *m_Path;
- QT3DSI32 m_RefCount;
-
- SImportPathWrapper(NVAllocatorCallback &inAlloc, qt3dsimp::SPathBuffer &inPath)
- : m_Alloc(inAlloc)
- , m_Path(&inPath)
- , m_RefCount(0)
- {
- }
-
- ~SImportPathWrapper() { m_Path->Free(m_Alloc); }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Alloc);
- NVDelete(alloc, this);
- }
- }
-};
-
-typedef NVScopedRefCounted<SImportPathWrapper> TPathBufferPtr;
-
-struct SPathBuffer
-{
- NVAllocatorCallback &m_Allocator;
- nvvector<NVScopedRefCounted<SPathSubPathBuffer>> m_SubPaths;
- TPathBufferPtr m_PathBuffer;
-
- NVScopedRefCounted<NVRenderVertexBuffer> m_PatchData;
- NVScopedRefCounted<NVRenderInputAssembler> m_InputAssembler;
- NVScopedRefCounted<NVRenderPathRender> m_PathRender;
-
- QT3DSVec2 m_BeginTaperData;
- QT3DSVec2 m_EndTaperData;
- QT3DSU32 m_NumVertexes;
- PathTypes::Enum m_PathType;
- QT3DSF32 m_Width;
- QT3DSF32 m_CPUError;
- NVBounds3 m_Bounds;
- Option<STaperInformation> m_BeginTaper;
- Option<STaperInformation> m_EndTaper;
- CRegisteredString m_SourcePath;
-
- // Cached data for geometry paths
-
- SPathDirtyFlags m_Flags;
-
- QT3DSI32 m_RefCount;
-
- SPathBuffer(NVAllocatorCallback &alloc)
- : m_Allocator(alloc)
- , m_SubPaths(alloc, "m_SubPaths")
- , m_NumVertexes(0)
- , m_PathType(PathTypes::Geometry)
- , m_Width(0.0f)
- , m_CPUError(0.0f)
- , m_Bounds(NVBounds3::empty())
- , m_RefCount(0)
- {
- }
-
- void addRef() { atomicIncrement(&m_RefCount); }
- void release()
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(m_Allocator);
- NVDelete(alloc, this);
- }
- }
-
- void ClearGeometryPathData()
- {
- m_PatchData = NULL;
- m_InputAssembler = NULL;
- }
-
- void ClearPaintedPathData() { m_PathRender = NULL; }
-
- qt3dsimp::SPathBuffer GetPathData(qt3dsimp::IPathBufferBuilder &inSpec)
- {
- if (m_SubPaths.size()) {
- inSpec.Clear();
- for (QT3DSU32 idx = 0, end = m_SubPaths.size(); idx < end; ++idx) {
- const SPathSubPathBuffer &theSubPathBuffer(*m_SubPaths[idx]);
- for (QT3DSU32 equationIdx = 0, equationEnd = theSubPathBuffer.m_SourceData.size();
- equationIdx < equationEnd; ++equationIdx) {
- const SPathAnchorPoint &thePoint = theSubPathBuffer.m_SourceData[equationIdx];
- if (equationIdx == 0) {
- inSpec.MoveTo(thePoint.m_Position);
- } else {
- const SPathAnchorPoint &thePrevPoint =
- theSubPathBuffer.m_SourceData[equationIdx - 1];
- QT3DSVec2 c1 = IPathManager::GetControlPointFromAngleDistance(
- thePrevPoint.m_Position, thePrevPoint.m_OutgoingAngle,
- thePrevPoint.m_OutgoingDistance);
- QT3DSVec2 c2 = IPathManager::GetControlPointFromAngleDistance(
- thePoint.m_Position, thePoint.m_IncomingAngle,
- thePoint.m_IncomingDistance);
- QT3DSVec2 p2 = thePoint.m_Position;
- inSpec.CubicCurveTo(c1, c2, p2);
- }
- }
- if (theSubPathBuffer.m_Closed)
- inSpec.Close();
- }
- return inSpec.GetPathBuffer();
- } else if (m_PathBuffer.mPtr)
- return *m_PathBuffer.mPtr->m_Path;
- return qt3dsimp::SPathBuffer();
- }
-
- void SetPathType(PathTypes::Enum inPathType)
- {
- if (inPathType != m_PathType) {
- switch (m_PathType) {
- case PathTypes::Geometry:
- ClearGeometryPathData();
- break;
- case PathTypes::Painted:
- ClearPaintedPathData();
- break;
- default:
- QT3DS_ALWAYS_ASSERT_MESSAGE("Unexpected path type");
- // No further processing for unexpected path type
- return;
- }
- m_Flags.clearOrSet(true, PathDirtyFlagValues::PathType);
- }
- m_PathType = inPathType;
- }
-
- static Option<STaperInformation> ToTaperInfo(PathCapping::Enum capping, QT3DSF32 capOffset,
- QT3DSF32 capOpacity, QT3DSF32 capWidth)
- {
- if (capping == PathCapping::Noner)
- return Empty();
-
- return STaperInformation(capOffset, capOpacity, capWidth);
- }
-
- void SetBeginTaperInfo(PathCapping::Enum capping, QT3DSF32 capOffset, QT3DSF32 capOpacity,
- QT3DSF32 capWidth)
- {
- Option<STaperInformation> newBeginInfo =
- ToTaperInfo(capping, capOffset, capOpacity, capWidth);
- if (!OptionEquals(newBeginInfo, m_BeginTaper)) {
- m_BeginTaper = newBeginInfo;
- m_Flags.clearOrSet(true, PathDirtyFlagValues::BeginTaper);
- }
- }
-
- void SetEndTaperInfo(PathCapping::Enum capping, QT3DSF32 capOffset, QT3DSF32 capOpacity,
- QT3DSF32 capWidth)
- {
- Option<STaperInformation> newEndInfo =
- ToTaperInfo(capping, capOffset, capOpacity, capWidth);
- if (!OptionEquals(newEndInfo, m_EndTaper)) {
- m_EndTaper = newEndInfo;
- m_Flags.clearOrSet(true, PathDirtyFlagValues::EndTaper);
- }
- }
-
- void SetWidth(QT3DSF32 inWidth)
- {
- if (inWidth != m_Width) {
- m_Width = inWidth;
- m_Flags.clearOrSet(true, PathDirtyFlagValues::Width);
- }
- }
-
- void SetCPUError(QT3DSF32 inError)
- {
- if (inError != m_CPUError) {
- m_CPUError = inError;
- m_Flags.clearOrSet(true, PathDirtyFlagValues::CPUError);
- }
- }
-};
-
-struct SPathGeneratedShader
-{
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSF32> m_Width;
- NVRenderCachedShaderProperty<QT3DSF32> m_InnerTessAmount;
- NVRenderCachedShaderProperty<QT3DSF32> m_EdgeTessAmount;
- NVRenderCachedShaderProperty<QT3DSVec2> m_BeginTaperData;
- NVRenderCachedShaderProperty<QT3DSVec2> m_EndTaperData;
- NVRenderCachedShaderProperty<QT3DSMat44> m_WireframeViewMatrix;
-
- QT3DSI32 m_RefCount;
-
- SPathGeneratedShader(NVRenderShaderProgram &sh, NVAllocatorCallback &alloc)
- : m_Allocator(alloc)
- , m_Shader(sh)
- , m_Width("pathWidth", sh)
- , m_InnerTessAmount("tessInnerLevel", sh)
- , m_EdgeTessAmount("tessEdgeLevel", sh)
- , m_BeginTaperData("beginTaperInfo", sh)
- , m_EndTaperData("endTaperInfo", sh)
- , m_WireframeViewMatrix("viewport_matrix", sh)
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
- ~SPathGeneratedShader() { m_Shader.release(); }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0) {
- NVAllocatorCallback &allocator(m_Allocator);
- NVDelete(allocator, this);
- }
- }
-};
-
-struct SPathVertexPipeline : public SVertexPipelineImpl
-{
-
- SPathVertexPipeline(IShaderProgramGenerator &inProgGenerator,
- IMaterialShaderGenerator &inMaterialGenerator, NVAllocatorCallback &inAlloc,
- IStringTable &inStringTable, bool inWireframe)
- : SVertexPipelineImpl(inAlloc, inMaterialGenerator, inProgGenerator, inStringTable,
- inWireframe)
- {
- }
-
- // Trues true if the code was *not* set.
- bool SetCode(GenerationFlagValues::Enum inCode)
- {
- if (((QT3DSU32)m_GenerationFlags & inCode) != 0)
- return true;
- m_GenerationFlags |= inCode;
- return false;
- }
-
- void AssignTessEvalVarying(const char8_t *inVarName, const char8_t *inVarValueExpr)
- {
- const char8_t *ext = "";
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry)
- ext = "TE";
- TessEval() << "\t" << inVarName << ext << " = " << inVarValueExpr << ";" << Endl;
- }
-
- void AssignOutput(const char8_t *inVarName, const char8_t *inVarValueExpr) override
- {
- AssignTessEvalVarying(inVarName, inVarValueExpr);
- }
-
- void InitializeTessShaders()
- {
- IShaderStageGenerator &theTessControl(TessControl());
- IShaderStageGenerator &theTessEval(TessEval());
-
- // first setup tessellation control shader
- theTessControl.AddUniform("tessEdgeLevel", "float");
- theTessControl.AddUniform("tessInnerLevel", "float");
-
- theTessControl.AddInclude("tessellationPath.glsllib");
-
- theTessControl.Append("void main() {\n");
- theTessControl.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- theTessControl.Append("\ttessShader( tessEdgeLevel, tessInnerLevel );\n");
-
- bool hasGeometryShader =
- ProgramGenerator().GetStage(ShaderGeneratorStages::Geometry) != NULL;
-
- // second setup tessellation control shader
- eastl::string outExt("");
- if (hasGeometryShader)
- outExt = "TE";
-
- theTessEval.AddInclude("tessellationPath.glsllib");
- theTessEval.AddUniform("normal_matrix", "mat3");
- theTessEval.AddUniform("model_view_projection", "mat4");
- theTessEval.AddUniform("pathWidth", "float");
- theTessEval.AddUniform("material_diffuse", "vec4");
- AddInterpolationParameter("varTexCoord0", "vec2");
- AddInterpolationParameter("varTessOpacity", "float");
-
- theTessEval.Append("void main() {\n");
- theTessEval.Append("\tSTessShaderResult shaderResult = tessShader( pathWidth );\n");
- theTessEval.Append("\tvec3 pos = shaderResult.m_Position;\n");
- AssignTessEvalVarying("varTessOpacity", "shaderResult.m_Opacity");
- AssignTessEvalVarying("varTexCoord0", "shaderResult.m_TexCoord.xy");
- if (hasGeometryShader)
- theTessEval << "\tvec2 varTexCoord0 = shaderResult.m_TexCoord.xy;\n";
-
- theTessEval << "\tvec3 object_normal = vec3(0.0, 0.0, 1.0);\n";
- theTessEval << "\tvec3 world_normal = normal_matrix * object_normal;\n";
- theTessEval << "\tvec3 tangent = vec3( shaderResult.m_Tangent, 0.0 );\n";
- theTessEval << "\tvec3 binormal = vec3( shaderResult.m_Binormal, 0.0 );\n";
-
- // These are necessary for texture generation.
- theTessEval << "\tvec3 uTransform;" << Endl;
- theTessEval << "\tvec3 vTransform;" << Endl;
-
- if (m_DisplacementImage) {
- MaterialGenerator().GenerateImageUVCoordinates(*this, m_DisplacementIdx, 0,
- *m_DisplacementImage);
- theTessEval.AddUniform("displaceAmount", "float");
- theTessEval.AddUniform("model_matrix", "mat4");
- theTessEval.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
- IDefaultMaterialShaderGenerator::SImageVariableNames theVarNames =
- MaterialGenerator().GetImageVariableNames(m_DisplacementIdx);
-
- theTessEval.AddUniform(theVarNames.m_ImageSampler, "sampler2D");
- IDefaultMaterialShaderGenerator::SImageVariableNames theNames =
- MaterialGenerator().GetImageVariableNames(m_DisplacementIdx);
- theTessEval << "\tpos = defaultMaterialFileDisplacementTexture( "
- << theNames.m_ImageSampler << ", displaceAmount, "
- << theNames.m_ImageFragCoords << outExt.c_str() << ", vec3( 0.0, 0.0, 1.0 )"
- << ", pos.xyz );" << Endl;
- }
- }
- void FinalizeTessControlShader() {}
-
- void FinalizeTessEvaluationShader()
- {
- eastl::string outExt("");
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry)
- outExt = "TE";
-
- IShaderStageGenerator &tessEvalShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- tessEvalShader.Append("\tgl_Position = model_view_projection * vec4( pos, 1.0 );\n");
- }
-
- void BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) override
- {
- SetupDisplacement(displacementImageIdx, displacementImage);
-
- TShaderGeneratorStageFlags theStages(IShaderProgramGenerator::DefaultFlags());
- theStages |= ShaderGeneratorStages::TessControl;
- theStages |= ShaderGeneratorStages::TessEval;
- if (m_Wireframe) {
- theStages |= ShaderGeneratorStages::Geometry;
- }
- ProgramGenerator().BeginProgram(theStages);
- InitializeTessShaders();
- if (m_Wireframe) {
- InitializeWireframeGeometryShader();
- }
- // Open up each stage.
- IShaderStageGenerator &vertexShader(Vertex());
-
- vertexShader.AddIncoming("attr_pos", "vec4");
-
- // useless vert shader because real work is done in TES.
- vertexShader << "void main()\n"
- "{\n";
- vertexShader << "\tgl_Position = attr_pos;\n"; // if tessellation is enabled pass down
- // object coordinates;
- vertexShader << "}\n";
- }
-
- void BeginFragmentGeneration() override
- {
- Fragment().AddUniform("material_diffuse", "vec4");
- Fragment() << "void main()" << Endl << "{" << Endl;
- // We do not pass object opacity through the pipeline.
- Fragment() << "\tfloat object_opacity = varTessOpacity * material_diffuse.a;" << Endl;
- }
- void DoGenerateUVCoords(QT3DSU32) override
- {
- // these are always generated regardless
- }
-
- // fragment shader expects varying vertex normal
- // lighting in vertex pipeline expects world_normal
- void DoGenerateWorldNormal() override { AssignTessEvalVarying("varNormal", "world_normal"); }
- void DoGenerateObjectNormal() override
- {
- AssignTessEvalVarying("varObjectNormal", "object_normal");
- }
- void DoGenerateWorldPosition() override
- {
- TessEval().AddUniform("model_matrix", "mat4");
- TessEval()
- << "\tvec3 local_model_world_position = vec3((model_matrix * vec4(pos, 1.0)).xyz);\n";
- }
- void DoGenerateVarTangentAndBinormal() override
- {
- TessEval().AddUniform("normal_matrix", "mat3");
- AssignOutput("varTangent", "normal_matrix * tangent");
- AssignOutput("varBinormal", "normal_matrix * binormal");
- }
-
- void DoGenerateVertexColor() override
- {
- Vertex().AddIncoming("attr_color", "vec3");
- Vertex() << "\tvarColor = attr_color;" << Endl;
- }
-
- void EndVertexGeneration(bool) override
- {
-
- if (HasTessellation()) {
- // finalize tess control shader
- FinalizeTessControlShader();
- // finalize tess evaluation shader
- FinalizeTessEvaluationShader();
-
- TessControl().Append("}");
- TessEval().Append("}");
- }
- if (m_Wireframe) {
- // finalize geometry shader
- FinalizeWireframeGeometryShader();
- Geometry().Append("}");
- }
- }
-
- void EndFragmentGeneration(bool) override { Fragment().Append("}"); }
-
- void AddInterpolationParameter(const char8_t *inName, const char8_t *inType) override
- {
- m_InterpolationParameters.insert(eastl::make_pair(Str(inName), Str(inType)));
- Fragment().AddIncoming(inName, inType);
- if (HasTessellation()) {
- eastl::string nameBuilder;
- nameBuilder.assign(inName);
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry)
- nameBuilder.append("TE");
-
- TessEval().AddOutgoing(nameBuilder.c_str(), inType);
- }
- }
-
- IShaderStageGenerator &ActiveStage() override { return TessEval(); }
-};
-
-struct SPathXYGeneratedShader
-{
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSVec4> m_RectDimensions;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ModelMatrix;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraPosition;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
- QT3DSI32 m_RefCount;
-
- SPathXYGeneratedShader(NVRenderShaderProgram &sh, NVAllocatorCallback &alloc)
- : m_Allocator(alloc)
- , m_Shader(sh)
- , m_RectDimensions("uni_rect_dimensions", sh)
- , m_ModelMatrix("model_matrix", sh)
- , m_CameraPosition("camera_position", sh)
- , m_CameraProperties("camera_properties", sh)
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
- virtual ~SPathXYGeneratedShader() { m_Shader.release(); }
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0) {
- NVAllocatorCallback &allocator(m_Allocator);
- NVDelete(allocator, this);
- }
- }
-};
-
-// Helper implements the vertex pipeline for mesh subsets when bound to the default material.
-// Should be completely possible to use for custom materials with a bit of refactoring.
-struct SXYRectVertexPipeline : public SVertexPipelineImpl
-{
-
- SXYRectVertexPipeline(IShaderProgramGenerator &inProgGenerator,
- IMaterialShaderGenerator &inMaterialGenerator,
- NVAllocatorCallback &inAlloc, IStringTable &inStringTable)
- : SVertexPipelineImpl(inAlloc, inMaterialGenerator, inProgGenerator, inStringTable, false)
- {
- }
-
- void BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) override
- {
- m_DisplacementIdx = displacementImageIdx;
- m_DisplacementImage = displacementImage;
-
- TShaderGeneratorStageFlags theStages(IShaderProgramGenerator::DefaultFlags());
- ProgramGenerator().BeginProgram(theStages);
- // Open up each stage.
- IShaderStageGenerator &vertexShader(Vertex());
- vertexShader.AddIncoming("attr_pos", "vec2");
- vertexShader.AddUniform("uni_rect_dimensions", "vec4");
-
- vertexShader << "void main()" << Endl << "{" << Endl;
- vertexShader << "\tvec3 uTransform;" << Endl;
- vertexShader << "\tvec3 vTransform;" << Endl;
-
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader
- << "\tfloat posX = mix( uni_rect_dimensions.x, uni_rect_dimensions.z, attr_pos.x );"
- << Endl;
- vertexShader
- << "\tfloat posY = mix( uni_rect_dimensions.y, uni_rect_dimensions.w, attr_pos.y );"
- << Endl;
- vertexShader << "\tvec3 pos = vec3(posX, posY, 0.0 );" << Endl;
- vertexShader.Append("\tgl_Position = model_view_projection * vec4(pos, 1.0);");
- }
-
- void OutputParaboloidDepthShaders()
- {
- TShaderGeneratorStageFlags theStages(IShaderProgramGenerator::DefaultFlags());
- ProgramGenerator().BeginProgram(theStages);
- IShaderStageGenerator &vertexShader(Vertex());
- vertexShader.AddIncoming("attr_pos", "vec2");
- vertexShader.AddUniform("uni_rect_dimensions", "vec4");
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader << "void main()" << Endl << "{" << Endl;
- vertexShader
- << "\tfloat posX = mix( uni_rect_dimensions.x, uni_rect_dimensions.z, attr_pos.x );"
- << Endl;
- vertexShader
- << "\tfloat posY = mix( uni_rect_dimensions.y, uni_rect_dimensions.w, attr_pos.y );"
- << Endl;
- vertexShader << "\tvec3 pos = vec3(posX, posY, 0.0 );" << Endl;
- IShaderProgramGenerator::OutputParaboloidDepthTessEval(vertexShader);
- vertexShader << "}" << Endl;
-
- IShaderProgramGenerator::OutputParaboloidDepthFragment(Fragment());
- }
-
- void OutputCubeFaceDepthShaders()
- {
- TShaderGeneratorStageFlags theStages(IShaderProgramGenerator::DefaultFlags());
- ProgramGenerator().BeginProgram(theStages);
- IShaderStageGenerator &vertexShader(Vertex());
- IShaderStageGenerator &fragmentShader(Fragment());
- vertexShader.AddIncoming("attr_pos", "vec2");
- vertexShader.AddUniform("uni_rect_dimensions", "vec4");
- vertexShader.AddUniform("model_matrix", "mat4");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.AddOutgoing("world_pos", "vec4");
- vertexShader.Append("void main() {");
- vertexShader.Append(
- " float posX = mix( uni_rect_dimensions.x, uni_rect_dimensions.z, attr_pos.x );");
- vertexShader.Append(
- " float posY = mix( uni_rect_dimensions.y, uni_rect_dimensions.w, attr_pos.y );");
- vertexShader.Append(" world_pos = model_matrix * vec4( posX, posY, 0.0, 1.0 );");
- vertexShader.Append(" world_pos /= world_pos.w;");
- vertexShader.Append(
- " gl_Position = model_view_projection * vec4( posX, posY, 0.0, 1.0 );");
- vertexShader.Append("}");
-
- fragmentShader.AddUniform("camera_position", "vec3");
- fragmentShader.AddUniform("camera_properties", "vec2");
-
- BeginFragmentGeneration();
- fragmentShader.Append(
- "\tfloat dist = 0.5 * length( world_pos.xyz - camera_position );"); // Why?
- fragmentShader.Append(
- "\tdist = (dist - camera_properties.x) / (camera_properties.y - camera_properties.x);");
- fragmentShader.Append("\tfragOutput = vec4(dist);");
- fragmentShader.Append("}");
- }
-
- void BeginFragmentGeneration() override
- {
- Fragment().AddUniform("material_diffuse", "vec4");
- Fragment() << "void main()" << Endl << "{" << Endl;
- // We do not pass object opacity through the pipeline.
- Fragment() << "\tfloat object_opacity = material_diffuse.a;" << Endl;
- }
-
- void AssignOutput(const char8_t *inVarName, const char8_t *inVarValue) override
- {
- Vertex() << "\t" << inVarName << " = " << inVarValue << ";\n";
- }
- void DoGenerateUVCoords(QT3DSU32) override { Vertex() << "\tvarTexCoord0 = attr_pos;" << Endl; }
-
- // fragment shader expects varying vertex normal
- // lighting in vertex pipeline expects world_normal
- void DoGenerateWorldNormal() override
- {
- IShaderStageGenerator &vertexGenerator(Vertex());
- vertexGenerator.AddUniform("normal_matrix", "mat3");
- vertexGenerator.Append(
- "\tvec3 world_normal = normalize(normal_matrix * vec3( 0.0, 0.0, 1.0) ).xyz;");
- vertexGenerator.Append("\tvarNormal = world_normal;");
- }
-
- void DoGenerateObjectNormal() override
- {
- AddInterpolationParameter("varObjectNormal", "vec3");
- Vertex().Append("\tvarObjectNormal = vec3(0.0, 0.0, 1.0 );");
- }
-
- void DoGenerateWorldPosition() override
- {
- Vertex().Append("\tvec3 local_model_world_position = (model_matrix * vec4(pos, 1.0)).xyz;");
- AssignOutput("varWorldPos", "local_model_world_position");
- }
-
- void DoGenerateVarTangentAndBinormal() override
- {
- Vertex().AddIncoming("attr_textan", "vec3");
- Vertex().AddIncoming("attr_binormal", "vec3");
- Vertex() << "\tvarTangent = normal_matrix * vec3(1.0, 0.0, 0.0);" << Endl
- << "\tvarBinormal = normal_matrix * vec3(0.0, 1.0, 0.0);" << Endl;
- }
-
- void DoGenerateVertexColor() override
- {
- Vertex().AddIncoming("attr_color", "vec3");
- Vertex() << "\tvarColor = attr_color;" << Endl;
- }
-
- void EndVertexGeneration(bool) override { Vertex().Append("}"); }
-
- void EndFragmentGeneration(bool) override { Fragment().Append("}"); }
-
- void AddInterpolationParameter(const char8_t *inName, const char8_t *inType) override
- {
- m_InterpolationParameters.insert(eastl::make_pair(Str(inName), Str(inType)));
- Vertex().AddOutgoing(inName, inType);
- Fragment().AddIncoming(inName, inType);
- }
-
- IShaderStageGenerator &ActiveStage() override { return Vertex(); }
-};
-
-struct SPathManager : public IPathManager
-{
- typedef nvhash_map<SPath *, NVScopedRefCounted<SPathBuffer>> TPathBufferHash;
- typedef nvhash_map<SPathSubPath *, NVScopedRefCounted<SPathSubPathBuffer>>
- TPathSubPathBufferHash;
- typedef nvhash_map<SPathShaderMapKey, NVScopedRefCounted<SPathGeneratedShader>> TShaderMap;
- typedef nvhash_map<SPathShaderMapKey, NVScopedRefCounted<SPathXYGeneratedShader>>
- TPaintedShaderMap;
- typedef nvhash_map<CRegisteredString, TPathBufferPtr> TStringPathBufferMap;
-
- IQt3DSRenderContextCore &m_CoreContext;
- IQt3DSRenderContext *m_RenderContext;
- eastl::string m_IdBuilder;
- TPathSubPathBufferHash m_SubPathBuffers;
- TPathBufferHash m_Buffers;
- nvvector<SResultCubic> m_SubdivResult;
- nvvector<QT3DSF32> m_KeyPointVec;
- nvvector<QT3DSVec4> m_PatchBuffer;
- TShaderMap m_PathGeometryShaders;
- TPaintedShaderMap m_PathPaintedShaders;
- TStringPathBufferMap m_SourcePathBufferMap;
- Mutex m_PathBufferMutex;
-
- NVScopedRefCounted<SPathGeneratedShader> m_DepthShader;
- NVScopedRefCounted<SPathGeneratedShader> m_DepthDisplacementShader;
- NVScopedRefCounted<SPathGeneratedShader> m_GeometryShadowShader;
- NVScopedRefCounted<SPathGeneratedShader> m_GeometryCubeShadowShader;
- NVScopedRefCounted<SPathGeneratedShader> m_GeometryDisplacementShadowShader;
-
- NVScopedRefCounted<SPathXYGeneratedShader> m_PaintedDepthShader;
- NVScopedRefCounted<SPathXYGeneratedShader> m_PaintedShadowShader;
- NVScopedRefCounted<SPathXYGeneratedShader> m_PaintedCubeShadowShader;
- NVScopedRefCounted<NVRenderInputAssembler> m_PaintedRectInputAssembler;
- NVScopedRefCounted<NVRenderVertexBuffer> m_PaintedRectVertexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> m_PaintedRectIndexBuffer;
-
- nvvector<NVScopedRefCounted<NVRenderDepthStencilState>> m_DepthStencilStates;
-
- NVScopedRefCounted<NVRenderPathSpecification> m_PathSpecification;
- NVScopedRefCounted<qt3dsimp::IPathBufferBuilder> m_PathBuilder;
-
- QT3DSI32 m_RefCount;
-
- SPathManager(IQt3DSRenderContextCore &inRC)
- : m_CoreContext(inRC)
- , m_RenderContext(NULL)
- , m_SubPathBuffers(inRC.GetAllocator(), "m_SubPathBuffers")
- , m_Buffers(inRC.GetAllocator(), "m_Buffers")
- , m_SubdivResult(inRC.GetAllocator(), "m_SubdivResult")
- , m_KeyPointVec(inRC.GetAllocator(), "m_KeyPointVec")
- , m_PatchBuffer(inRC.GetAllocator(), "m_QuadStrip")
- , m_PathGeometryShaders(inRC.GetAllocator(), "m_PathGeometryShaders")
- , m_PathPaintedShaders(inRC.GetAllocator(), "m_PathPaintedShaders")
- , m_SourcePathBufferMap(inRC.GetAllocator(), "m_SourcePathBufferMap")
- , m_PathBufferMutex(inRC.GetAllocator())
- , m_DepthStencilStates(inRC.GetAllocator(), "m_DepthStencilStates")
- , m_RefCount(0)
- {
- }
-
- virtual ~SPathManager() { m_PaintedRectInputAssembler = NULL; }
-
- NVAllocatorCallback &GetAllocator() { return m_CoreContext.GetAllocator(); }
- IStringTable &GetStringTable() { return m_CoreContext.GetStringTable(); }
- NVFoundationBase &GetFoundation() { return m_CoreContext.GetFoundation(); }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVAllocatorCallback &alloc(GetAllocator());
- NVDelete(alloc, this);
- }
- }
- // Called during binary load which is heavily threaded.
- void SetPathSubPathData(const SPathSubPath &inPath,
- NVConstDataRef<SPathAnchorPoint> inPathCubicCurves) override
- {
- Mutex::ScopedLock __locker(m_PathBufferMutex);
- eastl::pair<TPathSubPathBufferHash::iterator, bool> inserter =
- m_SubPathBuffers.insert(eastl::make_pair((SPathSubPath *)&inPath,
- NVScopedRefCounted<SPathSubPathBuffer>(NULL)));
- if (!inserter.first->second)
- inserter.first->second = QT3DS_NEW(GetAllocator(), SPathSubPathBuffer)(
- GetAllocator(), const_cast<SPathSubPath &>(inPath));
- SPathSubPathBuffer &theBuffer = *inserter.first->second.mPtr;
- theBuffer.m_SourceData.assign(inPathCubicCurves.begin(), inPathCubicCurves.end());
- theBuffer.m_Flags.clearOrSet(true, PathDirtyFlagValues::SourceData);
- }
-
- SPathBuffer *GetPathBufferObject(const SPath &inPath)
- {
- eastl::pair<TPathBufferHash::iterator, bool> inserter = m_Buffers.insert(
- eastl::make_pair((SPath *)&inPath, NVScopedRefCounted<SPathBuffer>(NULL)));
- if (inserter.second) {
- inserter.first->second = QT3DS_NEW(GetAllocator(), SPathBuffer)(GetAllocator());
- }
- return inserter.first->second.mPtr;
- }
-
- SPathSubPathBuffer *GetPathBufferObject(const SPathSubPath &inSubPath)
- {
- TPathSubPathBufferHash::iterator iter = m_SubPathBuffers.find((SPathSubPath *)&inSubPath);
- if (iter != m_SubPathBuffers.end())
- return iter->second.mPtr;
- return NULL;
- }
-
- NVDataRef<SPathAnchorPoint> GetPathSubPathBuffer(const SPathSubPath &inPath) override
- {
- SPathSubPathBuffer *theBuffer = GetPathBufferObject(inPath);
- if (theBuffer)
- return toDataRef(theBuffer->m_SourceData.data(), (QT3DSU32)theBuffer->m_SourceData.size());
- return NVDataRef<SPathAnchorPoint>();
- }
-
- NVDataRef<SPathAnchorPoint> ResizePathSubPathBuffer(const SPathSubPath &inPath,
- QT3DSU32 inNumAnchors) override
- {
- SPathSubPathBuffer *theBuffer = GetPathBufferObject(inPath);
- if (theBuffer == NULL)
- SetPathSubPathData(inPath, NVConstDataRef<SPathAnchorPoint>());
- theBuffer = GetPathBufferObject(inPath);
- theBuffer->m_SourceData.resize(inNumAnchors);
- theBuffer->m_Flags.clearOrSet(true, PathDirtyFlagValues::SourceData);
- return toDataRef(theBuffer->m_SourceData.data(), (QT3DSU32)theBuffer->m_SourceData.size());
- }
-
- // This needs to be done using roots of the first derivative.
- NVBounds3 GetBounds(const SPath &inPath) override
- {
- NVBounds3 retval(NVBounds3::empty());
-
- SPathBuffer *thePathBuffer = GetPathBufferObject(inPath);
- if (thePathBuffer) {
- SPathDirtyFlags geomDirtyFlags(
- PathDirtyFlagValues::SourceData | PathDirtyFlagValues::BeginTaper
- | PathDirtyFlagValues::EndTaper | PathDirtyFlagValues::Width
- | PathDirtyFlagValues::CPUError);
-
- if ((((QT3DSU32)thePathBuffer->m_Flags) & (QT3DSU32)geomDirtyFlags) == 0) {
- return thePathBuffer->m_Bounds;
- }
- }
-
- for (SPathSubPath *theSubPath = inPath.m_FirstSubPath; theSubPath;
- theSubPath = theSubPath->m_NextSubPath) {
- SPathSubPathBuffer *theBuffer = GetPathBufferObject(*theSubPath);
- if (!theBuffer)
- continue;
-
- QT3DSU32 numAnchors = theBuffer->m_SourceData.size();
- for (QT3DSU32 idx = 0, end = numAnchors; idx < end; ++idx) {
- const SPathAnchorPoint &thePoint(theBuffer->m_SourceData[idx]);
- QT3DSVec2 position(thePoint.m_Position);
- retval.include(QT3DSVec3(position.x, position.y, 0.0f));
- if (idx) {
- QT3DSVec2 incoming(IPathManagerCore::GetControlPointFromAngleDistance(
- thePoint.m_Position, thePoint.m_IncomingAngle,
- thePoint.m_IncomingDistance));
- retval.include(QT3DSVec3(incoming.x, incoming.y, 0.0f));
- }
-
- if (idx < (numAnchors - 1)) {
- QT3DSVec2 outgoing(IPathManagerCore::GetControlPointFromAngleDistance(
- thePoint.m_Position, thePoint.m_OutgoingAngle,
- thePoint.m_OutgoingDistance));
- retval.include(QT3DSVec3(outgoing.x, outgoing.y, 0.0f));
- }
- }
- }
-
- return retval;
- }
-
- IPathManager &OnRenderSystemInitialize(IQt3DSRenderContext &context) override
- {
- m_RenderContext = &context;
- return *this;
- }
-
- // find a point that will join these two curves *if* they are not first derivative continuous
- static Option<QT3DSVec2> GetAdjoiningPoint(QT3DSVec2 prevC2, QT3DSVec2 point, QT3DSVec2 C1, QT3DSF32 pathWidth)
- {
- QT3DSVec2 incomingDxDy = (point - prevC2);
- QT3DSVec2 outgoingDxDy = (C1 - point);
- incomingDxDy.normalize();
- outgoingDxDy.normalize();
- float determinant = (incomingDxDy.x * outgoingDxDy.y) - (incomingDxDy.y * outgoingDxDy.x);
- if (fabs(determinant) > .001f) {
- float mult = determinant > 0.0f ? 1.0f : -1.0f;
- QT3DSVec2 incomingNormal(incomingDxDy.y, -incomingDxDy.x);
- QT3DSVec2 outgoingNormal(outgoingDxDy.y, -outgoingDxDy.x);
-
- QT3DSVec2 leftEdge = point + mult * incomingNormal * pathWidth;
- QT3DSVec2 rightEdge = point + mult * outgoingNormal * pathWidth;
-
- return (leftEdge + rightEdge) / 2.0f;
- }
- return Empty();
- }
-
- Option<eastl::pair<QT3DSU32, QT3DSF32>> FindBreakEquation(QT3DSF32 inTaperStart)
- {
- QT3DSF32 lengthTotal = 0;
- for (QT3DSU32 idx = 0, end = m_SubdivResult.size(); idx < end; ++idx) {
- if (lengthTotal + m_SubdivResult[idx].m_Length > inTaperStart) {
- QT3DSF32 breakTValue = (inTaperStart - lengthTotal) / m_SubdivResult[idx].m_Length;
- nvvector<SResultCubic>::iterator breakIter = m_SubdivResult.begin() + idx;
- SCubicBezierCurve theCurve(breakIter->m_P1, breakIter->m_C1, breakIter->m_C2,
- breakIter->m_P2);
- eastl::pair<SCubicBezierCurve, SCubicBezierCurve> subdivCurve =
- theCurve.SplitCubicBezierCurve(breakTValue);
- QT3DSF32 originalBreakT =
- breakIter->m_TStart + (breakIter->m_TStop - breakIter->m_TStart) * breakTValue;
- // Update the existing item to point to the second equation
- breakIter->m_P1 = subdivCurve.second.m_Points[0];
- breakIter->m_C1 = subdivCurve.second.m_Points[1];
- breakIter->m_C2 = subdivCurve.second.m_Points[2];
- breakIter->m_P2 = subdivCurve.second.m_Points[3];
- QT3DSF32 originalLength = breakIter->m_Length;
- QT3DSF32 originalStart = breakIter->m_TStart;
- breakIter->m_Length *= (1.0f - breakTValue);
- breakIter->m_TStart = originalBreakT;
- SResultCubic newCubic(subdivCurve.first.m_Points[0], subdivCurve.first.m_Points[1],
- subdivCurve.first.m_Points[2], subdivCurve.first.m_Points[3],
- breakIter->m_EquationIndex, originalStart, originalBreakT,
- originalLength * breakTValue);
-
- m_SubdivResult.insert(breakIter, newCubic);
- return eastl::make_pair(idx, breakTValue);
- }
- lengthTotal += m_SubdivResult[idx].m_Length;
- }
- return Empty();
- }
-
- bool PrepareGeometryPathForRender(const SPath &inPath, SPathBuffer &inPathBuffer)
- {
-
- m_SubdivResult.clear();
- m_KeyPointVec.clear();
- const SPath &thePath(inPath);
-
- inPathBuffer.SetBeginTaperInfo(thePath.m_BeginCapping, thePath.m_BeginCapOffset,
- thePath.m_BeginCapOpacity, thePath.m_BeginCapWidth);
- inPathBuffer.SetEndTaperInfo(thePath.m_EndCapping, thePath.m_EndCapOffset,
- thePath.m_EndCapOpacity, thePath.m_EndCapWidth);
- inPathBuffer.SetWidth(inPath.m_Width);
- inPathBuffer.SetCPUError(inPath.m_LinearError);
-
- SPathDirtyFlags geomDirtyFlags(PathDirtyFlagValues::SourceData
- | PathDirtyFlagValues::BeginTaper
- | PathDirtyFlagValues::EndTaper | PathDirtyFlagValues::Width
- | PathDirtyFlagValues::CPUError);
-
- bool retval = false;
- if (!inPathBuffer.m_PatchData
- || (((QT3DSU32)inPathBuffer.m_Flags) & (QT3DSU32)geomDirtyFlags) != 0) {
- qt3dsimp::SPathBuffer thePathData = inPathBuffer.GetPathData(*m_PathBuilder);
-
- QT3DSU32 dataIdx = 0;
- QT3DSVec2 prevPoint(0, 0);
- QT3DSU32 equationIdx = 0;
- for (QT3DSU32 commandIdx = 0, commandEnd = thePathData.m_Commands.size();
- commandIdx < commandEnd; ++commandIdx) {
- switch (thePathData.m_Commands[commandIdx]) {
- case qt3dsimp::PathCommand::MoveTo:
- prevPoint =
- QT3DSVec2(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- break;
- case qt3dsimp::PathCommand::CubicCurveTo: {
- QT3DSVec2 c1(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- QT3DSVec2 c2(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- QT3DSVec2 p2(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- OuterAdaptiveSubdivideBezierCurve(
- m_SubdivResult, m_KeyPointVec, SCubicBezierCurve(prevPoint, c1, c2, p2),
- NVMax(inPath.m_LinearError, 1.0f), equationIdx);
- ++equationIdx;
- prevPoint = p2;
- } break;
- case qt3dsimp::PathCommand::Close:
- break;
-
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- QT3DSF32 theLocalWidth = inPath.m_Width / 2.0f;
-
- QT3DSVec2 theBeginTaperData(theLocalWidth, thePath.m_GlobalOpacity);
- QT3DSVec2 theEndTaperData(theLocalWidth, thePath.m_GlobalOpacity);
-
- QT3DSF32 pathLength = 0.0f;
- for (QT3DSU32 idx = 0, end = m_SubdivResult.size(); idx < end; ++idx)
- pathLength += m_SubdivResult[idx].m_Length;
-
- if (thePath.m_BeginCapping == PathCapping::Taper
- || thePath.m_EndCapping == PathCapping::Taper) {
- QT3DSF32 maxTaperStart = pathLength / 2.0f;
- if (thePath.m_BeginCapping == PathCapping::Taper) {
- // Can't start more than halfway across the path.
- QT3DSF32 taperStart = NVMin(thePath.m_BeginCapOffset, maxTaperStart);
- QT3DSF32 endTaperWidth = thePath.m_BeginCapWidth;
- QT3DSF32 endTaperOpacity = thePath.m_GlobalOpacity * thePath.m_BeginCapOpacity;
- theBeginTaperData = QT3DSVec2(endTaperWidth, endTaperOpacity);
- // Find where we need to break the current equations.
- Option<eastl::pair<QT3DSU32, QT3DSF32>> breakEquationAndT(
- FindBreakEquation(taperStart));
- if (breakEquationAndT.hasValue()) {
- QT3DSU32 breakEquation = breakEquationAndT->first;
-
- QT3DSF32 lengthTotal = 0;
- for (QT3DSU32 idx = 0, end = breakEquation; idx <= end; ++idx) {
- SResultCubic &theCubic = m_SubdivResult[idx];
- theCubic.m_Mode = SResultCubic::BeginTaper;
-
- theCubic.m_TaperMultiplier[0] = lengthTotal / taperStart;
- lengthTotal += theCubic.m_Length;
- theCubic.m_TaperMultiplier[1] = lengthTotal / taperStart;
- }
- }
- }
- if (thePath.m_EndCapping == PathCapping::Taper) {
- QT3DSF32 taperStart = NVMin(thePath.m_EndCapOffset, maxTaperStart);
- QT3DSF32 endTaperWidth = thePath.m_EndCapWidth;
- QT3DSF32 endTaperOpacity = thePath.m_GlobalOpacity * thePath.m_EndCapOpacity;
- theEndTaperData = QT3DSVec2(endTaperWidth, endTaperOpacity);
- // Invert taper start so that the forward search works.
- Option<eastl::pair<QT3DSU32, QT3DSF32>> breakEquationAndT(
- FindBreakEquation(pathLength - taperStart));
-
- if (breakEquationAndT.hasValue()) {
- QT3DSU32 breakEquation = breakEquationAndT->first;
- ++breakEquation;
-
- QT3DSF32 lengthTotal = 0;
- for (QT3DSU32 idx = breakEquation, end = m_SubdivResult.size(); idx < end;
- ++idx) {
- SResultCubic &theCubic = m_SubdivResult[idx];
- theCubic.m_Mode = SResultCubic::EndTaper;
-
- theCubic.m_TaperMultiplier[0] = 1.0f - (lengthTotal / taperStart);
- lengthTotal += theCubic.m_Length;
- theCubic.m_TaperMultiplier[1] = 1.0f - (lengthTotal / taperStart);
- }
- }
- }
- }
-
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
- // Create quads out of each point.
- if (m_SubdivResult.empty())
- return false;
-
- // Generate patches.
- m_PatchBuffer.clear();
- QT3DSF32 pathWidth = thePath.m_Width / 2.0f;
- // texture coords
- float texCoordU = 0.0;
-
- for (QT3DSU32 idx = 0, end = m_SubdivResult.size(); idx < end; ++idx) {
- // create patches
- SResultCubic thePoint(m_SubdivResult[idx]);
-
- m_PatchBuffer.push_back(CreateVec4(thePoint.m_P1, thePoint.m_C1));
- m_PatchBuffer.push_back(CreateVec4(thePoint.m_C2, thePoint.m_P2));
-
- // Now we need to take care of cases where the control points of the adjoining
- // SubPaths
- // do not line up; i.e. there is a discontinuity of the 1st derivative
- // The simplest way to do this is to move the edge vertex to a halfway point
- // between a line bisecting the two control lines
- QT3DSVec2 incomingAdjoining(thePoint.m_P1);
- QT3DSVec2 outgoingAdjoining(thePoint.m_P2);
- if (idx) {
- SResultCubic previousCurve = m_SubdivResult[idx - 1];
- if (previousCurve.m_EquationIndex != thePoint.m_EquationIndex) {
- QT3DSF32 anchorWidth =
- thePoint.GetP1Width(pathWidth, theBeginTaperData.x, theEndTaperData.x);
- Option<QT3DSVec2> adjoining = GetAdjoiningPoint(
- previousCurve.m_C2, thePoint.m_P1, thePoint.m_C1, anchorWidth);
- if (adjoining.hasValue())
- incomingAdjoining = *adjoining;
- }
- }
- if (idx < (end - 1)) {
- SResultCubic nextCurve = m_SubdivResult[idx + 1];
- if (nextCurve.m_EquationIndex != thePoint.m_EquationIndex) {
- QT3DSF32 anchorWidth =
- thePoint.GetP2Width(pathWidth, theBeginTaperData.x, theEndTaperData.x);
- Option<QT3DSVec2> adjoining = GetAdjoiningPoint(thePoint.m_C2, thePoint.m_P2,
- nextCurve.m_C1, anchorWidth);
- if (adjoining.hasValue())
- outgoingAdjoining = *adjoining;
- }
- }
- m_PatchBuffer.push_back(CreateVec4(incomingAdjoining, outgoingAdjoining));
-
- QT3DSVec4 taperData(0.0f);
- taperData.x = thePoint.m_TaperMultiplier.x;
- taperData.y = thePoint.m_TaperMultiplier.y;
- // Note we could put a *lot* more data into this thing.
- taperData.z = (QT3DSF32)thePoint.m_Mode;
- m_PatchBuffer.push_back(taperData);
-
- // texture coord generation
- // note we only generate u here. v is generated in the tess shader
- // u coord for P1 and C1
- QT3DSVec2 udata(texCoordU, texCoordU + (thePoint.m_Length / pathLength));
- texCoordU = udata.y;
- m_PatchBuffer.push_back(QT3DSVec4(udata.x, udata.y, 0.0, 0.0));
- }
-
- // buffer size is 3.0*4.0*bufSize
- QT3DSU32 bufSize = (QT3DSU32)m_PatchBuffer.size() * sizeof(QT3DSVec4);
- QT3DSU32 stride = sizeof(QT3DSVec4);
-
- if ((!inPathBuffer.m_PatchData) || inPathBuffer.m_PatchData->Size() < bufSize) {
- inPathBuffer.m_PatchData = theRenderContext.CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Dynamic, bufSize, stride,
- toU8DataRef(m_PatchBuffer.data(), (QT3DSU32)m_PatchBuffer.size()));
- inPathBuffer.m_NumVertexes = (QT3DSU32)m_PatchBuffer.size();
- inPathBuffer.m_InputAssembler = NULL;
- } else {
- QT3DS_ASSERT(inPathBuffer.m_PatchData->Size() >= bufSize);
- inPathBuffer.m_PatchData->UpdateBuffer(
- toU8DataRef(m_PatchBuffer.data(), (QT3DSU32)m_PatchBuffer.size()));
- }
-
- if (!inPathBuffer.m_InputAssembler) {
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry(
- "attr_pos", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 4),
- };
-
- NVRenderDrawMode::Enum primType = NVRenderDrawMode::Patches;
-
- NVRenderAttribLayout *theLayout =
- theRenderContext.CreateAttributeLayout(toConstDataRef(theEntries, 1));
- // How many vertices the TCS shader has access to in order to produce its output
- // array of vertices.
- const QT3DSU32 inputPatchVertexCount = 5;
- inPathBuffer.m_InputAssembler = theRenderContext.CreateInputAssembler(
- theLayout, toConstDataRef(inPathBuffer.m_PatchData.mPtr), NULL,
- toConstDataRef(stride), toConstDataRef((QT3DSU32)0), primType,
- inputPatchVertexCount);
- }
- inPathBuffer.m_BeginTaperData = theBeginTaperData;
- inPathBuffer.m_EndTaperData = theEndTaperData;
-
- // cache bounds
- NVBounds3 bounds = GetBounds(inPath);
- inPathBuffer.m_Bounds.minimum = bounds.minimum;
- inPathBuffer.m_Bounds.maximum = bounds.maximum;
- }
-
- return retval;
- }
-
- IMaterialShaderGenerator *GetMaterialShaderGenertator(SPathRenderContext &inRenderContext)
- {
- bool isDefaultMaterial =
- (inRenderContext.m_Material.m_Type == GraphObjectTypes::DefaultMaterial);
-
- IMaterialShaderGenerator *theMaterialGenerator = NULL;
- if (isDefaultMaterial)
- theMaterialGenerator = &m_RenderContext->GetDefaultMaterialShaderGenerator();
- else
- theMaterialGenerator = &m_RenderContext->GetCustomMaterialShaderGenerator();
-
- return theMaterialGenerator;
- }
-
- CRegisteredString GetMaterialNameForKey(SPathRenderContext &inRenderContext)
- {
- bool isDefaultMaterial =
- (inRenderContext.m_Material.m_Type == GraphObjectTypes::DefaultMaterial);
-
- if (!isDefaultMaterial) {
- ICustomMaterialSystem &theMaterialSystem(m_RenderContext->GetCustomMaterialSystem());
- const SCustomMaterial &theCustomMaterial(
- reinterpret_cast<const SCustomMaterial &>(inRenderContext.m_Material));
-
- return m_RenderContext->GetStringTable().RegisterStr(
- theMaterialSystem.GetShaderName(theCustomMaterial));
- }
-
- return m_RenderContext->GetStringTable().RegisterStr("");
- }
-
- bool PreparePaintedPathForRender(const SPath &inPath, SPathBuffer &inPathBuffer)
- {
- NVRenderContext &theContext(this->m_RenderContext->GetRenderContext());
- if (!inPathBuffer.m_PathRender
- || (((QT3DSU32)inPathBuffer.m_Flags) & PathDirtyFlagValues::SourceData)) {
- if (!inPathBuffer.m_PathRender) {
- inPathBuffer.m_PathRender = theContext.CreatePathRender();
- }
-
- if (inPathBuffer.m_PathRender == NULL || m_PathSpecification == NULL) {
- // QT3DS_ASSERT( false );
- return false;
- }
-
- m_PathSpecification->Reset();
- qt3dsimp::SPathBuffer thePathData = inPathBuffer.GetPathData(*m_PathBuilder);
-
- QT3DSU32 dataIdx = 0;
- for (QT3DSU32 commandIdx = 0, commandEnd = thePathData.m_Commands.size();
- commandIdx < commandEnd; ++commandIdx) {
-
- switch (thePathData.m_Commands[commandIdx]) {
- case qt3dsimp::PathCommand::MoveTo:
- m_PathSpecification->MoveTo(
- QT3DSVec2(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]));
- dataIdx += 2;
- break;
- case qt3dsimp::PathCommand::CubicCurveTo: {
- QT3DSVec2 c1(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- QT3DSVec2 c2(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- QT3DSVec2 p2(thePathData.m_Data[dataIdx], thePathData.m_Data[dataIdx + 1]);
- dataIdx += 2;
- m_PathSpecification->CubicCurveTo(c1, c2, p2);
- } break;
- case qt3dsimp::PathCommand::Close:
- m_PathSpecification->ClosePath();
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- inPathBuffer.m_PathRender->SetPathSpecification(*m_PathSpecification);
-
- // cache bounds
- NVBounds3 bounds = GetBounds(inPath);
- inPathBuffer.m_Bounds.minimum = bounds.minimum;
- inPathBuffer.m_Bounds.maximum = bounds.maximum;
-
- return true;
- }
-
- return false;
- }
-
- bool PrepareForRender(const SPath &inPath) override
- {
- SPathBuffer *thePathBuffer = GetPathBufferObject(inPath);
- if (!thePathBuffer) {
- return false;
- }
- NVRenderContext &theContext(this->m_RenderContext->GetRenderContext());
- if (!m_PathSpecification)
- m_PathSpecification = theContext.CreatePathSpecification();
- if (!m_PathSpecification)
- return false;
- if (!m_PathBuilder)
- m_PathBuilder = qt3dsimp::IPathBufferBuilder::CreateBuilder(GetFoundation());
-
- thePathBuffer->SetPathType(inPath.m_PathType);
- bool retval = false;
- if (inPath.m_PathBuffer.IsValid() == false) {
- thePathBuffer->m_PathBuffer = NULL;
- // Ensure the SubPath list is identical and clear, percolating any dirty flags up to the
- // path buffer.
- QT3DSU32 SubPathIdx = 0;
- for (const SPathSubPath *theSubPath = inPath.m_FirstSubPath; theSubPath;
- theSubPath = theSubPath->m_NextSubPath, ++SubPathIdx) {
- SPathSubPathBuffer *theSubPathBuffer = GetPathBufferObject(*theSubPath);
- if (theSubPathBuffer == NULL)
- continue;
- thePathBuffer->m_Flags =
- (QT3DSU32)(thePathBuffer->m_Flags | theSubPathBuffer->m_Flags);
-
- if (theSubPathBuffer->m_Closed != theSubPath->m_Closed) {
- thePathBuffer->m_Flags.clearOrSet(true, PathDirtyFlagValues::SourceData);
- theSubPathBuffer->m_Closed = theSubPath->m_Closed;
- }
-
- if (thePathBuffer->m_SubPaths.size() <= SubPathIdx
- || thePathBuffer->m_SubPaths[SubPathIdx] != theSubPathBuffer) {
- thePathBuffer->m_Flags.clearOrSet(true, PathDirtyFlagValues::SourceData);
- if (thePathBuffer->m_SubPaths.size() <= SubPathIdx)
- thePathBuffer->m_SubPaths.push_back(theSubPathBuffer);
- else
- thePathBuffer->m_SubPaths[SubPathIdx] = theSubPathBuffer;
- }
-
- theSubPathBuffer->m_Flags.Clear();
- }
-
- if (SubPathIdx != thePathBuffer->m_SubPaths.size()) {
- thePathBuffer->m_SubPaths.resize(SubPathIdx);
- thePathBuffer->m_Flags.clearOrSet(true, PathDirtyFlagValues::SourceData);
- }
- } else {
- thePathBuffer->m_SubPaths.clear();
- eastl::pair<TStringPathBufferMap::iterator, bool> inserter =
- m_SourcePathBufferMap.insert(
- eastl::make_pair(inPath.m_PathBuffer, TPathBufferPtr()));
- if (inserter.second) {
- NVScopedRefCounted<IRefCountedInputStream> theStream =
- m_CoreContext.GetInputStreamFactory().GetStreamForFile(
- inPath.m_PathBuffer.c_str());
- if (theStream) {
- qt3dsimp::SPathBuffer *theNewBuffer =
- qt3dsimp::SPathBuffer::Load(*theStream, GetFoundation());
- if (theNewBuffer)
- inserter.first->second = QT3DS_NEW(GetAllocator(), SImportPathWrapper)(
- GetAllocator(), *theNewBuffer);
- }
- }
- if (thePathBuffer->m_PathBuffer != inserter.first->second) {
- thePathBuffer->m_PathBuffer = inserter.first->second;
- thePathBuffer->m_Flags.clearOrSet(true, PathDirtyFlagValues::SourceData);
- }
- }
-
- if (inPath.m_PathType == PathTypes::Geometry)
- retval = PrepareGeometryPathForRender(inPath, *thePathBuffer);
- else
- retval = PreparePaintedPathForRender(inPath, *thePathBuffer);
- thePathBuffer->m_Flags.Clear();
- return retval;
- }
-
- void SetMaterialProperties(NVRenderShaderProgram &inShader, SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties &inRenderProperties)
- {
- IMaterialShaderGenerator *theMaterialGenerator =
- GetMaterialShaderGenertator(inRenderContext);
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
- theRenderContext.SetActiveShader(&inShader);
-
- theMaterialGenerator->SetMaterialProperties(
- inShader, inRenderContext.m_Material, inRenderContext.m_CameraVec,
- inRenderContext.m_ModelViewProjection, inRenderContext.m_NormalMatrix,
- inRenderContext.m_Path.m_GlobalTransform, inRenderContext.m_FirstImage,
- inRenderContext.m_Opacity, inRenderProperties);
- }
-
- void DoRenderGeometryPath(SPathGeneratedShader &inShader, SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties &inRenderProperties,
- SPathBuffer &inPathBuffer)
- {
- if (inPathBuffer.m_InputAssembler == NULL)
- return;
-
- SetMaterialProperties(inShader.m_Shader, inRenderContext, inRenderProperties);
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
-
- inShader.m_BeginTaperData.Set(inPathBuffer.m_BeginTaperData);
- inShader.m_EndTaperData.Set(inPathBuffer.m_EndTaperData);
- if (inRenderContext.m_EnableWireframe) {
- // we need the viewport matrix
- NVRenderRect theViewport(theRenderContext.GetViewport());
- QT3DSMat44 vpMatrix;
- vpMatrix.column0 = QT3DSVec4((float)theViewport.m_Width / 2.0f, 0.0, 0.0, 0.0);
- vpMatrix.column1 = QT3DSVec4(0.0, (float)theViewport.m_Height / 2.0f, 0.0, 0.0);
- vpMatrix.column2 = QT3DSVec4(0.0, 0.0, 1.0, 0.0);
- vpMatrix.column3 =
- QT3DSVec4((float)theViewport.m_Width / 2.0f + (float)theViewport.m_X,
- (float)theViewport.m_Height / 2.0f + (float)theViewport.m_Y, 0.0, 1.0);
-
- inShader.m_WireframeViewMatrix.Set(vpMatrix);
- }
-
- QT3DSF32 tessEdgeValue = NVMin(64.0f, NVMax(1.0f, inRenderContext.m_Path.m_EdgeTessAmount));
- QT3DSF32 tessInnerValue = NVMin(64.0f, NVMax(1.0f, inRenderContext.m_Path.m_InnerTessAmount));
- inShader.m_EdgeTessAmount.Set(tessEdgeValue);
- inShader.m_InnerTessAmount.Set(tessInnerValue);
- inShader.m_Width.Set(inRenderContext.m_Path.m_Width / 2.0f);
- theRenderContext.SetInputAssembler(inPathBuffer.m_InputAssembler);
- theRenderContext.SetCullingEnabled(false);
- NVRenderDrawMode::Enum primType = NVRenderDrawMode::Patches;
- theRenderContext.Draw(primType, (QT3DSU32)inPathBuffer.m_NumVertexes, 0);
- }
-
- NVRenderDepthStencilState *GetDepthStencilState()
- {
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
- NVRenderBoolOp::Enum theDepthFunction = theRenderContext.GetDepthFunction();
- bool isDepthEnabled = theRenderContext.IsDepthTestEnabled();
- bool isStencilEnabled = theRenderContext.IsStencilTestEnabled();
- bool isDepthWriteEnabled = theRenderContext.IsDepthWriteEnabled();
- for (QT3DSU32 idx = 0, end = m_DepthStencilStates.size(); idx < end; ++idx) {
- NVRenderDepthStencilState &theState = *m_DepthStencilStates[idx];
- if (theState.GetDepthFunc() == theDepthFunction
- && theState.GetDepthEnabled() == isDepthEnabled
- && theState.GetDepthMask() == isDepthWriteEnabled)
- return &theState;
- }
- NVRenderStencilFunctionArgument theArg(NVRenderBoolOp::NotEqual, 0, 0xFF);
- NVRenderStencilOperationArgument theOpArg(NVRenderStencilOp::Keep, NVRenderStencilOp::Keep,
- NVRenderStencilOp::Zero);
- m_DepthStencilStates.push_back(theRenderContext.CreateDepthStencilState(
- isDepthEnabled, isDepthWriteEnabled, theDepthFunction, isStencilEnabled, theArg, theArg,
- theOpArg, theOpArg));
- return m_DepthStencilStates.back();
- }
-
- static void DoSetCorrectiveScale(const QT3DSMat44 &mvp, QT3DSMat44 &outScale, NVBounds3 pathBounds)
- {
- // Compute the projected locations for the paraboloid and regular projection
- // and thereby set the appropriate scaling factor.
- QT3DSVec3 points[4];
- QT3DSVec3 projReg[4], projParab[4];
- points[0] = pathBounds.minimum;
- points[1] = QT3DSVec3(pathBounds.maximum.x, pathBounds.minimum.y, pathBounds.minimum.z);
- points[2] = pathBounds.maximum;
- points[3] = QT3DSVec3(pathBounds.minimum.x, pathBounds.maximum.y, pathBounds.maximum.z);
-
- // Do the two different projections.
- for (int i = 0; i < 4; ++i) {
- QT3DSVec4 tmp;
- tmp = mvp.transform(QT3DSVec4(points[i], 1.0f));
- tmp /= tmp.w;
- projReg[i] = tmp.getXYZ();
- projParab[i] = tmp.getXYZ().getNormalized();
- projParab[i] /= projParab[i].z + 1.0f;
- }
-
- NVBounds3 boundsA, boundsB;
- for (int i = 0; i < 4; ++i) {
- boundsA.include(projReg[i]);
- boundsB.include(projParab[i]);
- }
- QT3DSF32 xscale =
- (boundsB.maximum.x - boundsB.minimum.x) / (boundsA.maximum.x - boundsA.minimum.x);
- QT3DSF32 yscale =
- (boundsB.maximum.y - boundsB.minimum.y) / (boundsA.maximum.y - boundsA.minimum.y);
- QT3DSF32 zscale = (boundsB.maximum - boundsB.minimum).magnitudeSquared()
- / (boundsA.maximum - boundsA.minimum).magnitudeSquared();
- // The default minimum here is just a stupid figure that looks good on our content because
- // we'd
- // been using it for a little while before. Just for demo.
- xscale = NVMin<QT3DSF32>(0.5333333f, NVMin<QT3DSF32>(xscale, yscale));
- yscale = NVMin<QT3DSF32>(0.5333333f, NVMin<QT3DSF32>(xscale, yscale));
- outScale.scale(QT3DSVec4(xscale, yscale, zscale, 1.0f));
- }
-
- void DoRenderPaintedPath(SPathXYGeneratedShader &inShader, SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties &inRenderProperties,
- SPathBuffer &inPathBuffer, bool isParaboloidPass = false)
- {
- if (!inPathBuffer.m_PathRender)
- return;
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
- if (!m_PaintedRectInputAssembler) {
- QT3DSVec2 vertexes[] = {
- QT3DSVec2(0.0, 0.0), QT3DSVec2(1.0, 0.0), QT3DSVec2(1.0, 1.0), QT3DSVec2(0.0, 1.0),
- };
-
- QT3DSU8 indexes[] = {
- 0, 1, 2, 2, 3, 0,
- };
-
- QT3DSU32 stride = sizeof(QT3DSVec2);
-
- NVRenderVertexBufferEntry theBufferEntries[] = { NVRenderVertexBufferEntry(
- "attr_pos", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2, 0) };
-
- m_PaintedRectVertexBuffer = theRenderContext.CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static, 4 * sizeof(QT3DSVec2), sizeof(QT3DSVec2),
- toU8DataRef(vertexes, 4));
- m_PaintedRectIndexBuffer = theRenderContext.CreateIndexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static,
- qt3ds::render::NVRenderComponentTypes::QT3DSU8, 6, toU8DataRef(indexes, 6));
- NVRenderAttribLayout *theAttribLayout =
- theRenderContext.CreateAttributeLayout(toConstDataRef(theBufferEntries, 1));
- m_PaintedRectInputAssembler = theRenderContext.CreateInputAssembler(
- theAttribLayout, toConstDataRef(m_PaintedRectVertexBuffer.mPtr),
- m_PaintedRectIndexBuffer.mPtr, toConstDataRef(stride), toConstDataRef((QT3DSU32)0),
- qt3ds::render::NVRenderDrawMode::Triangles);
- }
-
- // our current render target needs stencil
- QT3DS_ASSERT(theRenderContext.GetStencilBits() > 0);
-
- theRenderContext.SetDepthStencilState(GetDepthStencilState());
-
- // http://developer.download.nvidia.com/assets/gamedev/files/Mixing_Path_Rendering_and_3D.pdf
- theRenderContext.SetPathStencilDepthOffset(-.05f, -1.0f);
-
- // Stencil out the geometry.
- QT3DSMat44 pathMdlView = QT3DSMat44::createIdentity();
- // Why is this happening? Well, it's because the painted-on path rendering is always
- // a flat splatted 2D object. This is bad because a paraboloid projection demands a very
- // different
- // non-linear space into which we must draw. Path Rendering does not allow this sort of
- // spatial
- // warping internally, and all we end up passing in as a simple perspective projection.
- // So for the fix, I'm scaling the actual "object" size so that it fits into the correctly
- // projected
- // polygon inside the paraboloid depth pass. Obviously, this scaling factor is wrong, and
- // not generic
- // enough to cover cases like polygons covering a large spread of the FOV and so on. It's
- // really
- // just a filthy awful, morally deplorable HACK. But it's basically the quickest fix at
- // hand.
- // This is also about the only possible approach that *could* work short of rendering the
- // paths in
- // a render-to-texture pass and splatting that texture on a sufficiently tessellated quad.
- // Unless
- // there's a way to program NVPR's internal projection scheme, that is.
- // Geometry-based paths will work out better, I think, because they're actually creating
- // geometry.
- // This is essentially a 2D painting process inside a quad where the actual rendered region
- // isn't
- // exactly where NVPR thinks it should be because they're not projecting points the same
- // way.
- if (isParaboloidPass) {
- DoSetCorrectiveScale(inRenderContext.m_ModelViewProjection, pathMdlView,
- inPathBuffer.m_PathRender->GetPathObjectStrokeBox());
- }
-
- bool isStencilEnabled = theRenderContext.IsStencilTestEnabled();
- theRenderContext.SetStencilTestEnabled(true);
- theRenderContext.SetPathProjectionMatrix(inRenderContext.m_ModelViewProjection);
- theRenderContext.SetPathModelViewMatrix(pathMdlView);
-
- if (inRenderContext.m_IsStroke) {
- inPathBuffer.m_PathRender->SetStrokeWidth(inRenderContext.m_Path.m_Width);
- inPathBuffer.m_PathRender->StencilStroke();
- } else
- inPathBuffer.m_PathRender->StencilFill();
-
- // The stencil buffer will dictate whether this object renders or not. So we need to ignore
- // the depth test result.
- NVRenderBoolOp::Enum theDepthFunc = theRenderContext.GetDepthFunction();
- theRenderContext.SetDepthFunction(NVRenderBoolOp::AlwaysTrue);
- // Now render the path; this resets the stencil buffer.
- SetMaterialProperties(inShader.m_Shader, inRenderContext, inRenderProperties);
- NVBounds3 rectBounds = inPathBuffer.m_PathRender->GetPathObjectStrokeBox();
- if (isParaboloidPass) {
- rectBounds.scale(1.570796326795f);
- } // PKC : More of the same ugly hack.
- inShader.m_RectDimensions.Set(QT3DSVec4(rectBounds.minimum.x, rectBounds.minimum.y,
- rectBounds.maximum.x, rectBounds.maximum.y));
- theRenderContext.SetInputAssembler(m_PaintedRectInputAssembler);
- theRenderContext.SetCullingEnabled(false);
- // Render exactly two triangles
- theRenderContext.Draw(NVRenderDrawMode::Triangles, 6, 0);
- theRenderContext.SetStencilTestEnabled(isStencilEnabled);
- theRenderContext.SetDepthFunction(theDepthFunc);
- }
-
- void RenderDepthPrepass(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) override
- {
- SPathBuffer *thePathBuffer = GetPathBufferObject(inRenderContext.m_Path);
- if (!thePathBuffer) {
- return;
- }
-
- if (thePathBuffer->m_PathType == PathTypes::Geometry) {
- QT3DSU32 displacementIdx = 0;
- QT3DSU32 imageIdx = 0;
- SRenderableImage *displacementImage = 0;
-
- for (SRenderableImage *theImage = inRenderContext.m_FirstImage;
- theImage != NULL && displacementImage == NULL;
- theImage = theImage->m_NextImage, ++imageIdx) {
- if (theImage->m_MapType == ImageMapTypes::Displacement) {
- displacementIdx = imageIdx;
- displacementImage = theImage;
- }
- }
-
- NVScopedRefCounted<SPathGeneratedShader> &theDesiredDepthShader =
- displacementImage == NULL ? m_DepthShader : m_DepthDisplacementShader;
-
- if (!theDesiredDepthShader) {
- IDefaultMaterialShaderGenerator &theMaterialGenerator(
- m_RenderContext->GetDefaultMaterialShaderGenerator());
- SPathVertexPipeline thePipeline(
- m_RenderContext->GetShaderProgramGenerator(), theMaterialGenerator,
- m_RenderContext->GetAllocator(), m_RenderContext->GetStringTable(), false);
- thePipeline.BeginVertexGeneration(displacementIdx, displacementImage);
- thePipeline.BeginFragmentGeneration();
- thePipeline.Fragment().Append("\tfragOutput = vec4(1.0, 1.0, 1.0, 1.0);");
- thePipeline.EndVertexGeneration(false);
- thePipeline.EndFragmentGeneration(false);
- const char8_t *shaderName = "path depth";
- if (displacementImage)
- shaderName = "path depth displacement";
-
- SShaderCacheProgramFlags theFlags;
- NVRenderShaderProgram *theProgram =
- thePipeline.ProgramGenerator().CompileGeneratedShader(shaderName, theFlags,
- inFeatureSet);
- if (theProgram) {
- theDesiredDepthShader =
- QT3DS_NEW(m_RenderContext->GetAllocator(),
- SPathGeneratedShader)(*theProgram, m_RenderContext->GetAllocator());
- }
- }
- if (theDesiredDepthShader) {
- DoRenderGeometryPath(*theDesiredDepthShader, inRenderContext, inRenderProperties,
- *thePathBuffer);
- }
- } else {
- // painted path, go stroke route for now.
- if (!m_PaintedDepthShader) {
- IDefaultMaterialShaderGenerator &theMaterialGenerator(
- m_RenderContext->GetDefaultMaterialShaderGenerator());
- SXYRectVertexPipeline thePipeline(
- m_RenderContext->GetShaderProgramGenerator(), theMaterialGenerator,
- m_RenderContext->GetAllocator(), m_RenderContext->GetStringTable());
- thePipeline.BeginVertexGeneration(0, NULL);
- thePipeline.BeginFragmentGeneration();
- thePipeline.Fragment().Append("\tfragOutput = vec4(1.0, 1.0, 1.0, 1.0);");
- thePipeline.EndVertexGeneration(false);
- thePipeline.EndFragmentGeneration(false);
- const char8_t *shaderName = "path painted depth";
- SShaderCacheProgramFlags theFlags;
- NVRenderShaderProgram *theProgram =
- thePipeline.ProgramGenerator().CompileGeneratedShader(shaderName, theFlags,
- inFeatureSet);
- if (theProgram) {
- m_PaintedDepthShader =
- QT3DS_NEW(m_RenderContext->GetAllocator(), SPathXYGeneratedShader)(
- *theProgram, m_RenderContext->GetAllocator());
- }
- }
- if (m_PaintedDepthShader) {
-
- DoRenderPaintedPath(*m_PaintedDepthShader, inRenderContext, inRenderProperties,
- *thePathBuffer);
- }
- }
- }
-
- void RenderShadowMapPass(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) override
- {
- SPathBuffer *thePathBuffer = GetPathBufferObject(inRenderContext.m_Path);
- if (!thePathBuffer) {
- return;
- }
-
- if (inRenderContext.m_Material.m_Type != GraphObjectTypes::DefaultMaterial)
- return;
-
- if (thePathBuffer->m_PathType == PathTypes::Painted) {
- // painted path, go stroke route for now.
- if (!m_PaintedShadowShader) {
- IDefaultMaterialShaderGenerator &theMaterialGenerator(
- m_RenderContext->GetDefaultMaterialShaderGenerator());
- SXYRectVertexPipeline thePipeline(
- m_RenderContext->GetShaderProgramGenerator(), theMaterialGenerator,
- m_RenderContext->GetAllocator(), m_RenderContext->GetStringTable());
- thePipeline.OutputParaboloidDepthShaders();
- const char8_t *shaderName = "path painted paraboloid depth";
- SShaderCacheProgramFlags theFlags;
- NVRenderShaderProgram *theProgram =
- thePipeline.ProgramGenerator().CompileGeneratedShader(shaderName, theFlags,
- inFeatureSet);
- if (theProgram) {
- m_PaintedShadowShader =
- QT3DS_NEW(m_RenderContext->GetAllocator(), SPathXYGeneratedShader)(
- *theProgram, m_RenderContext->GetAllocator());
- }
- }
- if (m_PaintedShadowShader) {
- // Setup the shader paraboloid information.
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
- theRenderContext.SetActiveShader(&m_PaintedShadowShader->m_Shader);
-
- DoRenderPaintedPath(*m_PaintedShadowShader, inRenderContext, inRenderProperties,
- *thePathBuffer, true);
- }
- } else {
- // Until we've also got a proper path render path for this, we'll call the old-fashioned
- // stuff.
- RenderDepthPrepass(inRenderContext, inRenderProperties, inFeatureSet);
- // QT3DS_ASSERT( false );
- }
- }
-
- void RenderCubeFaceShadowPass(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) override
- {
- SPathBuffer *thePathBuffer = GetPathBufferObject(inRenderContext.m_Path);
- if (!thePathBuffer) {
- return;
- }
-
- if (inRenderContext.m_Material.m_Type != GraphObjectTypes::DefaultMaterial)
- return;
-
- if (thePathBuffer->m_PathType == PathTypes::Painted) {
- if (!m_PaintedCubeShadowShader) {
- IDefaultMaterialShaderGenerator &theMaterialGenerator(
- m_RenderContext->GetDefaultMaterialShaderGenerator());
- SXYRectVertexPipeline thePipeline(
- m_RenderContext->GetShaderProgramGenerator(), theMaterialGenerator,
- m_RenderContext->GetAllocator(), m_RenderContext->GetStringTable());
- thePipeline.OutputCubeFaceDepthShaders();
- const char8_t *shaderName = "path painted cube face depth";
- SShaderCacheProgramFlags theFlags;
- NVRenderShaderProgram *theProgram =
- thePipeline.ProgramGenerator().CompileGeneratedShader(shaderName, theFlags,
- inFeatureSet);
- if (theProgram) {
- m_PaintedCubeShadowShader =
- QT3DS_NEW(m_RenderContext->GetAllocator(), SPathXYGeneratedShader)(
- *theProgram, m_RenderContext->GetAllocator());
- }
- }
- if (m_PaintedCubeShadowShader) {
- // Setup the shader information.
- NVRenderContext &theRenderContext(m_RenderContext->GetRenderContext());
- theRenderContext.SetActiveShader(&m_PaintedCubeShadowShader->m_Shader);
-
- m_PaintedCubeShadowShader->m_CameraPosition.Set(
- inRenderContext.m_Camera.GetGlobalPos());
- m_PaintedCubeShadowShader->m_CameraProperties.Set(
- QT3DSVec2(1.0f, inRenderContext.m_Camera.m_ClipFar));
- m_PaintedCubeShadowShader->m_ModelMatrix.Set(inRenderContext.m_ModelMatrix);
-
- DoRenderPaintedPath(*m_PaintedCubeShadowShader, inRenderContext, inRenderProperties,
- *thePathBuffer, false);
- }
- } else {
- // Until we've also got a proper path render path for this, we'll call the old-fashioned
- // stuff.
- RenderDepthPrepass(inRenderContext, inRenderProperties, inFeatureSet);
- }
- }
-
- void RenderPath(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) override
- {
- SPathBuffer *thePathBuffer = GetPathBufferObject(inRenderContext.m_Path);
- if (!thePathBuffer) {
- return;
- }
-
- bool isDefaultMaterial =
- (inRenderContext.m_Material.m_Type == GraphObjectTypes::DefaultMaterial);
-
- if (thePathBuffer->m_PathType == PathTypes::Geometry) {
- IMaterialShaderGenerator *theMaterialGenerator =
- GetMaterialShaderGenertator(inRenderContext);
-
- // we need a more evolved key her for custom materials
- // the same key can still need a different shader
- SPathShaderMapKey sPathkey = SPathShaderMapKey(GetMaterialNameForKey(inRenderContext),
- inRenderContext.m_MaterialKey);
- eastl::pair<TShaderMap::iterator, bool> inserter = m_PathGeometryShaders.insert(
- eastl::make_pair(sPathkey, NVScopedRefCounted<SPathGeneratedShader>(NULL)));
- if (inserter.second) {
- SPathVertexPipeline thePipeline(
- m_RenderContext->GetShaderProgramGenerator(), *theMaterialGenerator,
- m_RenderContext->GetAllocator(), m_RenderContext->GetStringTable(),
- m_RenderContext->GetWireframeMode());
-
- NVRenderShaderProgram *theProgram = NULL;
-
- if (isDefaultMaterial) {
- theProgram = theMaterialGenerator->GenerateShader(
- inRenderContext.m_Material, inRenderContext.m_MaterialKey, thePipeline,
- inFeatureSet, inRenderProperties.m_Lights, inRenderContext.m_FirstImage,
- inRenderContext.m_Opacity < 1.0, "path geometry pipeline-- ");
- } else {
- ICustomMaterialSystem &theMaterialSystem(
- m_RenderContext->GetCustomMaterialSystem());
- const SCustomMaterial &theCustomMaterial(
- reinterpret_cast<const SCustomMaterial &>(inRenderContext.m_Material));
-
- theProgram = theMaterialGenerator->GenerateShader(
- inRenderContext.m_Material, inRenderContext.m_MaterialKey, thePipeline,
- inFeatureSet, inRenderProperties.m_Lights, inRenderContext.m_FirstImage,
- inRenderContext.m_Opacity < 1.0, "path geometry pipeline-- ",
- theMaterialSystem.GetShaderName(theCustomMaterial));
- }
-
- if (theProgram)
- inserter.first->second =
- QT3DS_NEW(m_RenderContext->GetAllocator(),
- SPathGeneratedShader)(*theProgram, m_RenderContext->GetAllocator());
- }
- if (!inserter.first->second)
- return;
-
- DoRenderGeometryPath(*inserter.first->second.mPtr, inRenderContext, inRenderProperties,
- *thePathBuffer);
- } else {
- IMaterialShaderGenerator *theMaterialGenerator =
- GetMaterialShaderGenertator(inRenderContext);
-
- // we need a more evolved key her for custom materials
- // the same key can still need a different shader
- SPathShaderMapKey sPathkey = SPathShaderMapKey(GetMaterialNameForKey(inRenderContext),
- inRenderContext.m_MaterialKey);
- eastl::pair<TPaintedShaderMap::iterator, bool> inserter = m_PathPaintedShaders.insert(
- eastl::make_pair(sPathkey, NVScopedRefCounted<SPathXYGeneratedShader>(NULL)));
-
- if (inserter.second) {
- SXYRectVertexPipeline thePipeline(
- m_RenderContext->GetShaderProgramGenerator(), *theMaterialGenerator,
- m_RenderContext->GetAllocator(), m_RenderContext->GetStringTable());
-
- NVRenderShaderProgram *theProgram = NULL;
-
- if (isDefaultMaterial) {
- theProgram = theMaterialGenerator->GenerateShader(
- inRenderContext.m_Material, inRenderContext.m_MaterialKey, thePipeline,
- inFeatureSet, inRenderProperties.m_Lights, inRenderContext.m_FirstImage,
- inRenderContext.m_Opacity < 1.0, "path painted pipeline-- ");
- } else {
- ICustomMaterialSystem &theMaterialSystem(
- m_RenderContext->GetCustomMaterialSystem());
- const SCustomMaterial &theCustomMaterial(
- reinterpret_cast<const SCustomMaterial &>(inRenderContext.m_Material));
-
- theProgram = theMaterialGenerator->GenerateShader(
- inRenderContext.m_Material, inRenderContext.m_MaterialKey, thePipeline,
- inFeatureSet, inRenderProperties.m_Lights, inRenderContext.m_FirstImage,
- inRenderContext.m_Opacity < 1.0, "path painted pipeline-- ",
- theMaterialSystem.GetShaderName(theCustomMaterial));
- }
-
- if (theProgram)
- inserter.first->second =
- QT3DS_NEW(m_RenderContext->GetAllocator(), SPathXYGeneratedShader)(
- *theProgram, m_RenderContext->GetAllocator());
- }
- if (!inserter.first->second)
- return;
-
- DoRenderPaintedPath(*inserter.first->second.mPtr, inRenderContext, inRenderProperties,
- *thePathBuffer);
- }
- }
-};
-}
-
-QT3DSVec2 IPathManagerCore::GetControlPointFromAngleDistance(QT3DSVec2 inPosition, float inIncomingAngle,
- float inIncomingDistance)
-{
- if (inIncomingDistance == 0.0f)
- return inPosition;
- float angleRad = degToRad(inIncomingAngle);
- float angleSin = NVSin(angleRad);
- float angleCos = NVCos(angleRad);
- QT3DSVec2 relativeAngles = QT3DSVec2(angleCos * inIncomingDistance, angleSin * inIncomingDistance);
- return inPosition + relativeAngles;
-}
-
-QT3DSVec2 IPathManagerCore::GetAngleDistanceFromControlPoint(QT3DSVec2 inPosition, QT3DSVec2 inControlPoint)
-{
- QT3DSVec2 relative = inControlPoint - inPosition;
- float angleRad = atan2(relative.y, relative.x);
- float distance = relative.magnitude();
- return QT3DSVec2(radToDeg(angleRad), distance);
-}
-
-IPathManagerCore &IPathManagerCore::CreatePathManagerCore(IQt3DSRenderContextCore &ctx)
-{
- return *QT3DS_NEW(ctx.GetAllocator(), SPathManager)(ctx);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.h
deleted file mode 100644
index fc7e05f1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathManager.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PATH_MANAGER_H
-#define QT3DS_RENDER_PATH_MANAGER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderShaderCache.h" //TShaderFeatureSet
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSBounds3.h"
-//#include "Qt3DSRenderDefaultMaterialShaderGenerator.h" //SLayerGlobalRenderProperties
-
-namespace qt3ds {
-namespace render {
-
- struct SLayerGlobalRenderProperties;
-
- struct SPathAnchorPoint
- {
- QT3DSVec2 m_Position;
- QT3DSF32 m_IncomingAngle;
- QT3DSF32 m_OutgoingAngle;
- QT3DSF32 m_IncomingDistance;
- QT3DSF32 m_OutgoingDistance;
- SPathAnchorPoint() {}
- SPathAnchorPoint(QT3DSVec2 inPos, QT3DSF32 inAngle, QT3DSF32 outAngle, QT3DSF32 inDis, QT3DSF32 outDis)
- : m_Position(inPos)
- , m_IncomingAngle(inAngle)
- , m_OutgoingAngle(outAngle)
- , m_IncomingDistance(inDis)
- , m_OutgoingDistance(outDis)
- {
- }
- };
-
- class IPathManagerCore : public NVRefCounted
- {
- public:
- // returns the path buffer id
- //!! Note this call is made from multiple threads simultaneously during binary load.
- //!! - see UICRenderGraphObjectSerializer.cpp
- virtual void
- SetPathSubPathData(const SPathSubPath &inPathSubPath,
- NVConstDataRef<SPathAnchorPoint> inPathSubPathAnchorPoints) = 0;
-
- virtual NVDataRef<SPathAnchorPoint>
- GetPathSubPathBuffer(const SPathSubPath &inPathSubPath) = 0;
- // Marks the PathSubPath anchor points as dirty. This will mean rebuilding any PathSubPath
- // context required to render the PathSubPath.
- virtual NVDataRef<SPathAnchorPoint>
- ResizePathSubPathBuffer(const SPathSubPath &inPathSubPath, QT3DSU32 inNumAnchors) = 0;
- virtual NVBounds3 GetBounds(const SPath &inPath) = 0;
-
- // Helper functions used in various locations
- // Angles here are in degrees because that is how they are represented in the data.
- static QT3DSVec2 GetControlPointFromAngleDistance(QT3DSVec2 inPosition, float inAngle,
- float inDistance);
-
- // Returns angle in x, distance in y.
- static QT3DSVec2 GetAngleDistanceFromControlPoint(QT3DSVec2 inPosition, QT3DSVec2 inControlPoint);
-
- virtual IPathManager &OnRenderSystemInitialize(IQt3DSRenderContext &context) = 0;
-
- static IPathManagerCore &CreatePathManagerCore(IQt3DSRenderContextCore &inContext);
- };
-
- struct SPathRenderContext; // UICRenderPathRenderContext.h
-
- class IPathManager : public IPathManagerCore
- {
- public:
- // The path segments are next expected to change after this call; changes will be ignored.
- virtual bool PrepareForRender(const SPath &inPath) = 0;
-
- virtual void RenderDepthPrepass(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) = 0;
-
- virtual void RenderShadowMapPass(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) = 0;
-
- virtual void RenderCubeFaceShadowPass(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) = 0;
-
- virtual void RenderPath(SPathRenderContext &inRenderContext,
- SLayerGlobalRenderProperties inRenderProperties,
- TShaderFeatureSet inFeatureSet) = 0;
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathMath.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathMath.h
deleted file mode 100644
index e9eb2220..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathMath.h
+++ /dev/null
@@ -1,713 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_RENDER_PATH_MATH_H
-#define QT3DS_RENDER_PATH_MATH_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec3.h"
-namespace qt3ds {
-namespace render {
-namespace path {
-// Solve quadratic equation in with a templated real number system.
-template <typename REAL>
-
-int quadratic(REAL b, REAL c, REAL rts[2])
-{
- int nquad;
- REAL dis;
- REAL rtdis;
-
- dis = b * b - 4 * c;
- rts[0] = 0;
- rts[1] = 0;
- if (b == 0) {
- if (c == 0) {
- nquad = 2;
- } else {
- if (c < 0) {
- nquad = 2;
- rts[0] = sqrt(-c);
- rts[1] = -rts[0];
- } else {
- nquad = 0;
- }
- }
- } else if (c == 0) {
- nquad = 2;
- rts[0] = -b;
- } else if (dis >= 0) {
- nquad = 2;
- rtdis = sqrt(dis);
- if (b > 0)
- rts[0] = (-b - rtdis) * (1 / REAL(2));
- else
- rts[0] = (-b + rtdis) * (1 / REAL(2));
- if (rts[0] == 0)
- rts[1] = -b;
- else
- rts[1] = c / rts[0];
- } else {
- nquad = 0;
- }
-
- return (nquad);
-} /* quadratic */
-
-float interest_range[2] = {0, 1};
-
-void cubicInflectionPoint(const QT3DSVec2 cp[4], nvvector<QT3DSF32> &key_point)
-{
- // Convert control points to cubic monomial polynomial coefficients
- const QT3DSVec2 A = cp[3] - cp[0] + (cp[1] - cp[2]) * 3.0;
- const QT3DSVec2 B = (cp[0] - cp[1] * 2.0 + cp[2]) * 3.0, C = (cp[1] - cp[0]) * 3.0;
- const QT3DSVec2 D = cp[0];
-
- double a = 3 * (B.x * A.y - A.x * B.y);
- double b = 3 * (C.x * A.y - C.y * A.x);
- double c = C.x * B.y - C.y * B.x;
-
- double roots[2];
- int solutions;
- // Is the quadratic really a degenerate line?
- if (a == 0) {
- // Is the line really a degenerate point?
- if (b == 0) {
- solutions = 0;
- } else {
- solutions = 1;
- roots[0] = c / b;
- }
- } else {
- solutions = quadratic(b / a, c / a, roots);
- }
- for (int i = 0; i < solutions; i++) {
- QT3DSF32 t = static_cast<QT3DSF32>(roots[i]);
-
- QT3DSVec2 p = ((A * t + B) * t + C) * t + D;
- if (t >= interest_range[0] && t <= interest_range[1])
- key_point.push_back(t);
- // else; Outside range of interest, ignore.
- }
-}
-
-typedef enum {
- CT_POINT,
- CT_LINE,
- CT_QUADRATIC,
- CT_CUSP,
- CT_LOOP,
- CT_SERPENTINE
-} CurveType;
-
-static inline bool isZero(double v)
-{
-#if 0
- const double eps = 6e-008;
-
- if (fabs(v) < eps)
- return true;
- else
- return false;
-#else
- return v == 0.0;
-#endif
-}
-
-inline QT3DSVec3 crossv1(const QT3DSVec2 &a, const QT3DSVec2 &b)
-{
- return QT3DSVec3(a[1] - b[1], b[0] - a[0], a[0] * b[1] - a[1] * b[0]);
-}
-
-inline bool sameVertex(const QT3DSVec2 &a, const QT3DSVec2 &b)
-{
- return (a.x == b.x && a.y == b.y);
-}
-
-inline bool sameVertex(const QT3DSVec3 &a, const QT3DSVec3 &b)
-{
- return (a.x == b.x && a.y == b.y && a.z == b.z);
-}
-
-// This function "normalizes" the input vector so the larger of its components
-// is in the range [512,1024]. Exploit integer math on the exponent bits to
-// do this without expensive DP exponentiation.
-inline void scaleTo512To1024(QT3DSVec2 &d, int e)
-{
- union {
- QT3DSU64 u64;
- double f64;
- } x;
- int ie = 10 - (int)e + 1023;
- QT3DS_ASSERT(ie > 0);
- x.u64 = ((QT3DSU64)ie) << 52;
- d *= static_cast<QT3DSF32>(x.f64);
-}
-
-inline double fastfrexp(double d, int *exponent)
-{
- union {
- QT3DSU64 u64;
- double f64;
- } x;
- x.f64 = d;
- *exponent = (((int)(x.u64 >> 52)) & 0x7ff) - 0x3ff;
- x.u64 &= (1ULL << 63) - (1ULL << 52);
- x.u64 |= (0x3ffULL << 52);
- return x.f64;
-}
-
-QT3DSVec3 CreateVec3(QT3DSVec2 xy, float z)
-{
- return QT3DSVec3(xy.x, xy.y, z);
-}
-
-QT3DSVec2 GetXY(const QT3DSVec3 &data)
-{
- return QT3DSVec2(data.x, data.y);
-}
-
-CurveType cubicDoublePoint(const QT3DSVec2 points[4], nvvector<QT3DSF32> &key_point)
-{
-#if 0
- const QT3DSVec2 AA = points[3] - points[0] + (points[1] - points[2]) * 3.0;
- const QT3DSVec3 BB = (points[0] - points[1] * 2.0 + points[2]) * 3.0;
- const QT3DSVec3 CC = (points[1] - points[0]) * 3.0, DD = points[0];
-#endif
-
- // Assume control points of the cubic curve are A, B, C, and D.
- const QT3DSVec3 A = CreateVec3(points[0], 1);
- const QT3DSVec3 B = CreateVec3(points[1], 1);
- const QT3DSVec3 C = CreateVec3(points[2], 1);
- const QT3DSVec3 D = CreateVec3(points[3], 1);
-
- // Compute the discriminant of the roots of
- // H(s,t) = -36*(d1^2*s^2 - d1*d2*s*t + (d2^2 - d1*d3)*t^2)
- // where H is the Hessian (the square matrix of second-order
- // partial derivatives of a function) of I(s,t)
- // where I(s,t) determine the inflection points of the cubic
- // Bezier curve C(s,t).
- //
- // d1, d2, and d3 functions of the determinants constructed
- // from the cubic control points.
- //
- // Recall dot(a,cross(b,c)) is determinant of a 3x3 matrix
- // with a, b, c the rows of the matrix.
- const QT3DSVec3 DC = crossv1(GetXY(D), GetXY(C));
- const QT3DSVec3 AD = crossv1(GetXY(A), GetXY(D));
- const QT3DSVec3 BA = crossv1(GetXY(B), GetXY(A));
-
- const double a1 = A.dot(DC);
- const double a2 = B.dot(AD);
- const double a3 = C.dot(BA);
- const double d1 = a1 - 2 * a2 + 3 * a3;
- const double d2 = -a2 + 3 * a3;
- const double d3 = 3 * a3;
- const double discriminant = (3 * d2 * d2 - 4 * d1 * d3);
-
- // The sign of the discriminant of I classifies the curbic curve
- // C into one of 6 classifications:
- // 1) discriminant>0 ==> serpentine
- // 2) discriminant=0 ==> cusp
- // 3) discriminant<0 ==> loop
-
- // If the discriminant or d1 are almost but not exactly zero, the
- // result is really noisy unacceptable (k,l,m) interpolation.
- // If it looks almost like a quadratic or linear case, treat it that way.
- if (isZero(discriminant) && isZero(d1)) {
- // Cusp case
-
- if (isZero(d2)) {
- // degenerate cases (points, lines, quadratics)...
- if (isZero(d3)) {
- if (sameVertex(A, B) && sameVertex(A, C) && sameVertex(A, D))
- return CT_POINT;
- else
- return CT_LINE;
- } else {
- return CT_QUADRATIC;
- }
- } else {
- return CT_CUSP;
- }
- } else if (discriminant < 0) {
- // Loop case
-
- const QT3DSF32 t = static_cast<QT3DSF32>(d2 + sqrt(-discriminant));
- QT3DSVec2 d = QT3DSVec2(t, static_cast<QT3DSF32>(2 * d1));
- QT3DSVec2 e = QT3DSVec2(static_cast<QT3DSF32>(2 * (d2 * d2 - d1 * d3)),
- static_cast<QT3DSF32>(d1 * t));
-
- // There is the situation where r2=c/t results in division by zero, but
- // in this case, the two roots represent a double root at zero so
- // subsitute l for (the otherwise NaN) m in this case.
- //
- // This situation can occur when the 1st and 2nd (or 3rd and 4th?)
- // control point of a cubic Bezier path SubPath are identical.
- if (e.x == 0 && e.y == 0)
- e = d;
-
- // d, e, or both could be very large values. To mitigate the risk of
- // floating-point overflow in subsequent calculations
- // scale both vectors to be in the range [768,1024] since their relative
- // scale of their x & y components is irrelevant.
-
- // Be careful to divide by a power-of-two to disturb mantissa bits.
-
- double d_max_mag = NVMax(fabs(d.x), fabs(d.y));
- int exponent;
- fastfrexp(d_max_mag, &exponent);
- scaleTo512To1024(d, exponent);
-
- double e_max_mag = NVMax(fabs(e.x), fabs(e.y));
- fastfrexp(e_max_mag, &exponent);
- scaleTo512To1024(e, exponent);
-
- const QT3DSVec2 roots = QT3DSVec2(d.x / d.y, e.x / e.y);
-
- double tt;
-#if 0
- tt = roots[0];
- if (tt >= interest_range[0] && tt <= interest_range[1])
- // key_point.push_back(tt);
- tt = roots[1];
- if (tt >= interest_range[0] && tt <= interest_range[1])
- // key_point.push_back(tt);
-#endif
- tt = (roots[0] + roots[1]) / 2;
- if (tt >= interest_range[0] && tt <= interest_range[1])
- key_point.push_back(static_cast<QT3DSF32>(tt));
-
- return CT_LOOP;
- } else {
- QT3DS_ASSERT(discriminant >= 0);
- cubicInflectionPoint(points, key_point);
- if (discriminant > 0) {
- // Serpentine case
- return CT_SERPENTINE;
- } else {
- // Cusp with inflection at infinity (treat like serpentine)
- return CT_CUSP;
- }
- }
-}
-
-QT3DSVec4 CreateVec4(QT3DSVec2 p1, QT3DSVec2 p2)
-{
- return QT3DSVec4(p1.x, p1.y, p2.x, p2.y);
-}
-
-QT3DSVec2 lerp(QT3DSVec2 p1, QT3DSVec2 p2, QT3DSF32 distance)
-{
- return p1 + (p2 - p1) * distance;
-}
-
-QT3DSF32 lerp(QT3DSF32 p1, QT3DSF32 p2, QT3DSF32 distance)
-{
- return p1 + (p2 - p1) * distance;
-}
-
-// Using first derivative to get tangent.
-// If this equation does not make immediate sense consider that it is the first derivative
-// of the de Casteljau bezier expansion, not the polynomial expansion.
-float TangentAt(float inT, float p1, float c1, float c2, float p2)
-{
- float a = c1 - p1;
- float b = c2 - c1 - a;
- float c = p2 - c2 - a - (2.0f * b);
- float retval = 3.0f * (a + (2.0f * b * inT) + (c * inT * inT));
- return retval;
-}
-
-QT3DSVec2 midpoint(QT3DSVec2 p1, QT3DSVec2 p2)
-{
- return lerp(p1, p2, .5f);
-}
-
-QT3DSF32 LineLength(QT3DSVec2 inStart, QT3DSVec2 inStop)
-{
- return (inStop - inStart).magnitude();
-}
-
-struct SCubicBezierCurve
-{
- QT3DSVec2 m_Points[4];
- SCubicBezierCurve(QT3DSVec2 a1, QT3DSVec2 c1, QT3DSVec2 c2, QT3DSVec2 a2)
- {
- m_Points[0] = a1;
- m_Points[1] = c1;
- m_Points[2] = c2;
- m_Points[3] = a2;
- }
-
- // Normal is of course orthogonal to the tangent.
- QT3DSVec2 NormalAt(float inT) const
- {
- QT3DSVec2 tangent = QT3DSVec2(
- TangentAt(inT, m_Points[0].x, m_Points[1].x, m_Points[2].x, m_Points[3].x),
- TangentAt(inT, m_Points[0].y, m_Points[1].y, m_Points[2].y, m_Points[3].y));
-
- QT3DSVec2 result(tangent.y, -tangent.x);
- result.normalize();
- return result;
- }
-
- eastl::pair<SCubicBezierCurve, SCubicBezierCurve> SplitCubicBezierCurve(float inT)
- {
- // compute point on curve based on inT
- // using de Casteljau algorithm
- QT3DSVec2 p12 = lerp(m_Points[0], m_Points[1], inT);
- QT3DSVec2 p23 = lerp(m_Points[1], m_Points[2], inT);
- QT3DSVec2 p34 = lerp(m_Points[2], m_Points[3], inT);
- QT3DSVec2 p123 = lerp(p12, p23, inT);
- QT3DSVec2 p234 = lerp(p23, p34, inT);
- QT3DSVec2 p1234 = lerp(p123, p234, inT);
-
- return eastl::make_pair(SCubicBezierCurve(m_Points[0], p12, p123, p1234),
- SCubicBezierCurve(p1234, p234, p34, m_Points[3]));
- }
-};
-
-#if 0
- static QT3DSVec2 NormalToLine( QT3DSVec2 startPoint, QT3DSVec2 endPoint )
- {
- QT3DSVec2 lineDxDy = endPoint - startPoint;
- QT3DSVec2 result( lineDxDy.y, -lineDxDy.x );
- result.normalize();
- return result;
- }
-#endif
-
-struct SResultCubic
-{
- enum Mode {
- Normal = 0,
- BeginTaper = 1,
- EndTaper = 2,
- };
- QT3DSVec2 m_P1;
- QT3DSVec2 m_C1;
- QT3DSVec2 m_C2;
- QT3DSVec2 m_P2;
- // Location in the original data where this cubic is taken from
- QT3DSU32 m_EquationIndex;
- QT3DSF32 m_TStart;
- QT3DSF32 m_TStop;
- QT3DSF32 m_Length;
- QT3DSVec2 m_TaperMultiplier; // normally 1, goes to zero at very end of taper if any taper.
- Mode m_Mode;
-
- SResultCubic(QT3DSVec2 inP1, QT3DSVec2 inC1, QT3DSVec2 inC2, QT3DSVec2 inP2,
- QT3DSU32 equationIndex, QT3DSF32 tStart, QT3DSF32 tStop, QT3DSF32 length)
- : m_P1(inP1)
- , m_C1(inC1)
- , m_C2(inC2)
- , m_P2(inP2)
- , m_EquationIndex(equationIndex)
- , m_TStart(tStart)
- , m_TStop(tStop)
- , m_Length(length)
- , m_TaperMultiplier(1.0f, 1.0f)
- , m_Mode(Normal)
- {
- }
- // Note the vec2 items are *not* initialized in any way here.
- SResultCubic() {}
- QT3DSF32 GetP1Width(QT3DSF32 inPathWidth, QT3DSF32 beginTaperWidth, QT3DSF32 endTaperWidth)
- {
- return GetPathWidth(inPathWidth, beginTaperWidth, endTaperWidth, 0);
- }
-
- QT3DSF32 GetP2Width(QT3DSF32 inPathWidth, QT3DSF32 beginTaperWidth, QT3DSF32 endTaperWidth)
- {
- return GetPathWidth(inPathWidth, beginTaperWidth, endTaperWidth, 1);
- }
-
- QT3DSF32 GetPathWidth(QT3DSF32 inPathWidth, QT3DSF32 beginTaperWidth, QT3DSF32 endTaperWidth,
- QT3DSU32 inTaperIndex)
- {
- QT3DSF32 retval = inPathWidth;
- switch (m_Mode) {
- case BeginTaper:
- retval = beginTaperWidth * m_TaperMultiplier[inTaperIndex];
- break;
- case EndTaper:
- retval = endTaperWidth * m_TaperMultiplier[inTaperIndex];
- break;
- default:
- break;
- }
- return retval;
- }
-};
-
-void PushLine(nvvector<SResultCubic> &ioResultVec, QT3DSVec2 inStart, QT3DSVec2 inStop,
- QT3DSU32 inEquationIndex)
-{
- QT3DSVec2 range = inStop - inStart;
- ioResultVec.push_back(SResultCubic(inStart, inStart + range * .333f,
- inStart + range * .666f, inStop, inEquationIndex,
- 0.0f, 1.0f, LineLength(inStart, inStop)));
-}
-
-struct PathDirtyFlagValues
-{
- enum Enum {
- SourceData = 1,
- PathType = 1 << 1,
- Width = 1 << 2,
- BeginTaper = 1 << 3,
- EndTaper = 1 << 4,
- CPUError = 1 << 5,
- };
-};
-
-struct SPathDirtyFlags : public NVFlags<PathDirtyFlagValues::Enum>
-{
- typedef NVFlags<PathDirtyFlagValues::Enum> TBase;
- SPathDirtyFlags() {}
- SPathDirtyFlags(int inFlags)
- : TBase(static_cast<PathDirtyFlagValues::Enum>(inFlags))
- {
- }
- void Clear()
- {
- *this = SPathDirtyFlags();
- }
-};
-
-struct STaperInformation
-{
- QT3DSF32 m_CapOffset;
- QT3DSF32 m_CapOpacity;
- QT3DSF32 m_CapWidth;
-
- STaperInformation()
- : m_CapOffset(0)
- , m_CapOpacity(0)
- , m_CapWidth(0)
- {
- }
- STaperInformation(QT3DSF32 capOffset, QT3DSF32 capOpacity, QT3DSF32 capWidth)
- : m_CapOffset(capOffset)
- , m_CapOpacity(capOpacity)
- , m_CapWidth(capWidth)
- {
- }
-
- bool operator==(const STaperInformation &inOther) const
- {
- return m_CapOffset == inOther.m_CapOffset && m_CapOpacity == inOther.m_CapOpacity
- && m_CapWidth == inOther.m_CapWidth;
- }
-};
-
-template <typename TOptData>
-bool OptionEquals(const Option<TOptData> &lhs, const Option<TOptData> &rhs)
-{
- if (lhs.hasValue() != rhs.hasValue())
- return false;
- if (lhs.hasValue())
- return lhs.getValue() == rhs.getValue();
- return true;
-}
-void OuterAdaptiveSubdivideBezierCurve(nvvector<SResultCubic> &ioResultVec,
- nvvector<QT3DSF32> &keyPointVec,
- SCubicBezierCurve inCurve, QT3DSF32 inLinearError,
- QT3DSU32 inEquationIndex);
-
-void AdaptiveSubdivideBezierCurve(nvvector<SResultCubic> &ioResultVec,
- SCubicBezierCurve &inCurve, QT3DSF32 inLinearError,
- QT3DSU32 inEquationIndex, QT3DSF32 inTStart, QT3DSF32 inTStop);
-
-// Adaptively subdivide source data to produce m_PatchData.
-void AdaptiveSubdivideSourceData(NVConstDataRef<SPathAnchorPoint> inSourceData,
- nvvector<SResultCubic> &ioResultVec,
- nvvector<QT3DSF32> &keyPointVec, QT3DSF32 inLinearError)
-{
- ioResultVec.clear();
- if (inSourceData.size() < 2)
- return;
- // Assuming no attributes in the source data.
- QT3DSU32 numEquations = (inSourceData.size() - 1);
- for (QT3DSU32 idx = 0, end = numEquations; idx < end; ++idx) {
- const SPathAnchorPoint &beginAnchor = inSourceData[idx];
- const SPathAnchorPoint &endAnchor = inSourceData[idx + 1];
-
- QT3DSVec2 anchor1(beginAnchor.m_Position);
- QT3DSVec2 control1(IPathManagerCore::GetControlPointFromAngleDistance(
- beginAnchor.m_Position, beginAnchor.m_OutgoingAngle,
- beginAnchor.m_OutgoingDistance));
-
- QT3DSVec2 control2(IPathManagerCore::GetControlPointFromAngleDistance(
- endAnchor.m_Position, endAnchor.m_IncomingAngle,
- endAnchor.m_IncomingDistance));
- QT3DSVec2 anchor2(endAnchor.m_Position);
-
- OuterAdaptiveSubdivideBezierCurve(
- ioResultVec, keyPointVec,
- SCubicBezierCurve(anchor1, control1, control2, anchor2), inLinearError, idx);
- }
-}
-
-// The outer subdivide function topologically analyzes the curve to ensure that
-// the sign of the second derivative does not change, no inflection points.
-// Once that condition is held, then we proceed with a simple adaptive subdivision algorithm
-// until the curve is accurately approximated by a straight line.
-void OuterAdaptiveSubdivideBezierCurve(nvvector<SResultCubic> &ioResultVec,
- nvvector<QT3DSF32> &keyPointVec,
- SCubicBezierCurve inCurve, QT3DSF32 inLinearError,
- QT3DSU32 inEquationIndex)
-{
- // Step 1, find what type of curve we are dealing with and the inflection points.
- keyPointVec.clear();
- CurveType theCurveType = cubicDoublePoint(inCurve.m_Points, keyPointVec);
-
- QT3DSF32 tStart = 0;
- switch (theCurveType) {
- case CT_POINT:
- ioResultVec.push_back(SResultCubic(inCurve.m_Points[0], inCurve.m_Points[0],
- inCurve.m_Points[0], inCurve.m_Points[0],
- inEquationIndex, 0.0f, 1.0f, 0.0f));
- return; // don't allow further recursion
- case CT_LINE:
- PushLine(ioResultVec, inCurve.m_Points[0], inCurve.m_Points[3], inEquationIndex);
- return; // don't allow further recursion
- case CT_CUSP:
- case CT_LOOP:
- case CT_SERPENTINE: {
- // Break the curve at the inflection points if there is one. If there aren't
- // inflection points
- // the treat as linear (degenerate case that should not happen except in limiting
- // ranges of floating point accuracy)
- if (!keyPointVec.empty()) {
- // It is not clear that the code results in a sorted vector,
- // or a vector where all values are within the range of 0-1
- if (keyPointVec.size() > 1)
- eastl::sort(keyPointVec.begin(), keyPointVec.end());
- for (QT3DSU32 idx = 0, end = (QT3DSU32)keyPointVec.size();
- idx < end && keyPointVec[idx] < 1.0f; ++idx) {
- // We have a list of T values I believe sorted from beginning to end, we
- // will create a set of bezier curves
- // Since we split the curves, tValue is relative to tSTart, not 0.
- QT3DSF32 range = 1.0f - tStart;
- QT3DSF32 splitPoint = keyPointVec[idx] - tStart;
- QT3DSF32 tValue = splitPoint / range;
- if (tValue > 0.0f) {
- eastl::pair<SCubicBezierCurve, SCubicBezierCurve> newCurves
- = inCurve.SplitCubicBezierCurve(tValue);
- AdaptiveSubdivideBezierCurve(ioResultVec, newCurves.first,
- inLinearError, inEquationIndex, tStart,
- splitPoint);
- inCurve = newCurves.second;
- tStart = splitPoint;
- }
- }
- }
- }
- // fallthrough intentional
- break;
- // fallthrough intentional
- case CT_QUADRATIC:
- break;
- }
- AdaptiveSubdivideBezierCurve(ioResultVec, inCurve, inLinearError, inEquationIndex,
- tStart, 1.0f);
-}
-
-static QT3DSF32 DistanceFromPointToLine(QT3DSVec2 inLineDxDy, QT3DSVec2 lineStart, QT3DSVec2 point)
-{
- QT3DSVec2 pointToLineStart = lineStart - point;
- return fabs((inLineDxDy.x * pointToLineStart.y) - (inLineDxDy.y * pointToLineStart.x));
-}
-
-// There are two options here. The first is to just subdivide below a given error
-// tolerance.
-// The second is to fit a quadratic to the curve and then precisely find the length of the
-// quadratic.
-// Obviously we are choosing the subdivide method at this moment but I think the fitting
-// method is probably more robust.
-QT3DSF32 LengthOfBezierCurve(SCubicBezierCurve &inCurve)
-{
- // Find distance of control points from line. Note that both control points should be
- // on same side of line else we have a serpentine which should have been removed by topological
- // analysis.
- QT3DSVec2 lineDxDy = inCurve.m_Points[3] - inCurve.m_Points[0];
- QT3DSF32 c1Distance = DistanceFromPointToLine(
- lineDxDy, inCurve.m_Points[0], inCurve.m_Points[1]);
- QT3DSF32 c2Distance = DistanceFromPointToLine(
- lineDxDy, inCurve.m_Points[0], inCurve.m_Points[2]);
- const float lineTolerance = 100.0f; // error in world coordinates, squared.
- if (c1Distance > lineTolerance || c2Distance > lineTolerance) {
- eastl::pair<SCubicBezierCurve, SCubicBezierCurve> subdivCurve
- = inCurve.SplitCubicBezierCurve(.5f);
- return LengthOfBezierCurve(subdivCurve.first)
- + LengthOfBezierCurve(subdivCurve.second);
- } else {
- return LineLength(inCurve.m_Points[0], inCurve.m_Points[3]);
- }
-}
-
-// The assumption here is the the curve type is not cusp, loop, or serpentine.
-// It is either linear or it is a constant curve meaning we can use very simple means to
-// figure out the curvature. There is a possibility to use some math to figure out the point of
-// maximum curvature, where the second derivative will have a max value. This is probably not
-// necessary.
-void AdaptiveSubdivideBezierCurve(nvvector<SResultCubic> &ioResultVec,
- SCubicBezierCurve &inCurve, QT3DSF32 inLinearError,
- QT3DSU32 inEquationIndex, QT3DSF32 inTStart, QT3DSF32 inTStop)
-{
- // Find distance of control points from line. Note that both control points should be
- // on same side of line else we have a serpentine which should have been removed by topological
- // analysis.
- QT3DSVec2 lineDxDy = inCurve.m_Points[3] - inCurve.m_Points[0];
- QT3DSF32 c1Distance = DistanceFromPointToLine(lineDxDy, inCurve.m_Points[0],
- inCurve.m_Points[1]);
- QT3DSF32 c2Distance = DistanceFromPointToLine(lineDxDy, inCurve.m_Points[0],
- inCurve.m_Points[2]);
- const float lineTolerance = inLinearError * inLinearError; // error in world coordinates
- if (c1Distance > lineTolerance || c2Distance > lineTolerance) {
- eastl::pair<SCubicBezierCurve, SCubicBezierCurve> subdivCurve
- = inCurve.SplitCubicBezierCurve(.5f);
- QT3DSF32 halfway = lerp(inTStart, inTStop, .5f);
- AdaptiveSubdivideBezierCurve(ioResultVec, subdivCurve.first, inLinearError,
- inEquationIndex, inTStart, halfway);
- AdaptiveSubdivideBezierCurve(ioResultVec, subdivCurve.second, inLinearError,
- inEquationIndex, halfway, inTStop);
- } else {
- ioResultVec.push_back(SResultCubic(inCurve.m_Points[0], inCurve.m_Points[1],
- inCurve.m_Points[2], inCurve.m_Points[3],
- inEquationIndex, inTStart, inTStop,
- LengthOfBezierCurve(inCurve)));
- }
-}
-}
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathRenderContext.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathRenderContext.h
deleted file mode 100644
index deeea281..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPathRenderContext.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PATH_RENDER_CONTEXT_H
-#define QT3DS_RENDER_PATH_RENDER_CONTEXT_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderShaderCache.h" //TShaderFeatureSet
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "Qt3DSRenderShaderKeys.h"
-#include "Qt3DSRenderableImage.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SPathRenderContext
- {
- // The lights and camera will not change per layer,
- // so that information can be set once for all the shaders.
- NVConstDataRef<SLight *> m_Lights;
- const SCamera &m_Camera;
-
- // Per-object information.
- const SPath &m_Path;
- const QT3DSMat44 &m_ModelViewProjection;
- const QT3DSMat44 &m_ModelMatrix; ///< model to world transformation
- const QT3DSMat33 &m_NormalMatrix;
-
- QT3DSF32 m_Opacity;
- const SGraphObject &m_Material;
- SShaderDefaultMaterialKey m_MaterialKey;
- SRenderableImage *m_FirstImage;
- QT3DSVec2 m_CameraVec;
-
- bool m_EnableWireframe;
- bool m_HasTransparency;
- bool m_IsStroke;
-
- SPathRenderContext(NVConstDataRef<SLight *> lights, const SCamera &cam, const SPath &p,
- const QT3DSMat44 &mvp, const QT3DSMat44 &world, const QT3DSMat33 &nm,
- QT3DSF32 inOpacity, const SGraphObject &inMaterial,
- SShaderDefaultMaterialKey inMaterialKey, SRenderableImage *inFirstImage,
- bool inWireframe, QT3DSVec2 inCameraVec, bool inHasTransparency,
- bool inIsStroke)
-
- : m_Lights(lights)
- , m_Camera(cam)
- , m_Path(p)
- , m_ModelViewProjection(mvp)
- , m_ModelMatrix(world)
- , m_NormalMatrix(nm)
- , m_Opacity(inOpacity)
- , m_Material(inMaterial)
- , m_MaterialKey(inMaterialKey)
- , m_FirstImage(inFirstImage)
- , m_CameraVec(inCameraVec)
- , m_EnableWireframe(inWireframe)
- , m_HasTransparency(inHasTransparency)
- , m_IsStroke(inIsStroke)
- {
- }
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.cpp
deleted file mode 100644
index 43f7c0b4..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderPixelGraphicsRenderer.h"
-#include "Qt3DSRenderPixelGraphicsTypes.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderShaderCodeGenerator.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderShaderCache.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-namespace {
-
-struct SPGRectShader
-{
- NVScopedRefCounted<NVRenderShaderProgram> m_RectShader;
- NVRenderShaderConstantBase *mvp;
- NVRenderShaderConstantBase *rectColor;
- NVRenderShaderConstantBase *leftright;
- NVRenderShaderConstantBase *bottomtop;
-
- SPGRectShader()
- : mvp(NULL)
- , rectColor(NULL)
- , leftright(NULL)
- , bottomtop(NULL)
- {
- }
- void SetShader(NVRenderShaderProgram *program)
- {
- m_RectShader = program;
- if (program) {
- mvp = program->GetShaderConstant("model_view_projection");
- rectColor = program->GetShaderConstant("rect_color");
- leftright = program->GetShaderConstant("leftright[0]");
- bottomtop = program->GetShaderConstant("bottomtop[0]");
- }
- }
-
- void Apply(QT3DSMat44 &inVP, const SPGRect &inObject)
- {
- if (mvp)
- m_RectShader->SetConstantValue(mvp, toConstDataRef(inVP), 1);
- if (rectColor)
- m_RectShader->SetConstantValue(rectColor, inObject.m_FillColor, 1);
- if (leftright) {
- QT3DSF32 theData[] = { inObject.m_Left, inObject.m_Right };
- m_RectShader->SetConstantValue(leftright, *theData, 2);
- }
- if (bottomtop) {
- QT3DSF32 theData[] = { inObject.m_Bottom, inObject.m_Top };
- m_RectShader->SetConstantValue(bottomtop, *theData, 2);
- }
- }
-
- operator bool() { return m_RectShader.mPtr != NULL; }
-};
-
-struct SPGRenderer : public IPixelGraphicsRenderer
-{
- IQt3DSRenderContext &m_RenderContext;
- IStringTable &m_StringTable;
- NVScopedRefCounted<NVRenderVertexBuffer> m_QuadVertexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> m_QuadIndexBuffer;
- NVScopedRefCounted<NVRenderInputAssembler> m_QuadInputAssembler;
- NVScopedRefCounted<NVRenderAttribLayout> m_QuadAttribLayout;
- SShaderVertexCodeGenerator m_VertexGenerator;
- SShaderFragmentCodeGenerator m_FragmentGenerator;
- SPGRectShader m_RectShader;
- QT3DSI32 mRefCount;
-
- SPGRenderer(IQt3DSRenderContext &ctx, IStringTable &strt)
- : m_RenderContext(ctx)
- , m_StringTable(strt)
- , m_VertexGenerator(m_StringTable, ctx.GetAllocator(),
- m_RenderContext.GetRenderContext().GetRenderContextType())
- , m_FragmentGenerator(m_VertexGenerator, ctx.GetAllocator(),
- m_RenderContext.GetRenderContext().GetRenderContextType())
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext.GetAllocator())
- void GetRectShaderProgram()
- {
- if (!m_RectShader) {
- m_VertexGenerator.Begin();
- m_FragmentGenerator.Begin();
- m_VertexGenerator.AddAttribute("attr_pos", "vec2");
- m_VertexGenerator.AddUniform("model_view_projection", "mat4");
- m_VertexGenerator.AddUniform("leftright[2]", "float");
- m_VertexGenerator.AddUniform("bottomtop[2]", "float");
- m_FragmentGenerator.AddVarying("rect_uvs", "vec2");
- m_FragmentGenerator.AddUniform("rect_color", "vec4");
- m_VertexGenerator << "void main() {" << Endl
- << "\tgl_Position = model_view_projection * vec4( "
- "leftright[int(attr_pos.x)], bottomtop[int(attr_pos.y)], 0.0, 1.0 "
- ");"
- << Endl << "\trect_uvs = attr_pos;" << Endl << "}" << Endl;
-
- m_FragmentGenerator << "void main() {" << Endl << "\tfragOutput = rect_color;" << Endl
- << "}" << Endl;
-
- m_VertexGenerator.BuildShaderSource();
- m_FragmentGenerator.BuildShaderSource();
-
- m_RectShader.SetShader(m_RenderContext.GetShaderCache().CompileProgram(
- m_StringTable.RegisterStr("PixelRectShader"),
- m_VertexGenerator.m_FinalShaderBuilder.c_str(),
- m_FragmentGenerator.m_FinalShaderBuilder.c_str(), NULL // no tess control shader
- ,
- NULL // no tess eval shader
- ,
- NULL // no geometry shader
- ,
- SShaderCacheProgramFlags(), ShaderCacheNoFeatures()));
- }
- }
- void GenerateXYQuad()
- {
- NVRenderContext &theRenderContext(m_RenderContext.GetRenderContext());
-
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2),
- };
-
- QT3DSVec2 pos[] = { QT3DSVec2(0, 0), QT3DSVec2(0, 1), QT3DSVec2(1, 1), QT3DSVec2(1, 0) };
-
- if (m_QuadVertexBuffer == NULL) {
- size_t bufSize = sizeof(pos);
- m_QuadVertexBuffer = theRenderContext.CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static, bufSize, 2 * sizeof(QT3DSF32),
- toU8DataRef(pos, 4));
- }
-
- if (m_QuadIndexBuffer == NULL) {
- QT3DSU8 indexData[] = {
- 0, 1, 2, 0, 2, 3,
- };
- m_QuadIndexBuffer = theRenderContext.CreateIndexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static,
- qt3ds::render::NVRenderComponentTypes::QT3DSU8, sizeof(indexData),
- toU8DataRef(indexData, sizeof(indexData)));
- }
-
- if (m_QuadAttribLayout == NULL) {
- // create our attribute layout
- m_QuadAttribLayout =
- theRenderContext.CreateAttributeLayout(toConstDataRef(theEntries, 1));
- }
-
- if (m_QuadInputAssembler == NULL) {
-
- // create input assembler object
- QT3DSU32 strides = m_QuadVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_QuadInputAssembler = theRenderContext.CreateInputAssembler(
- m_QuadAttribLayout, toConstDataRef(&m_QuadVertexBuffer.mPtr, 1), m_QuadIndexBuffer,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
- }
-
- void RenderPixelObject(QT3DSMat44 &inProjection, const SPGRect &inObject)
- {
- GenerateXYQuad();
- GetRectShaderProgram();
- if (m_RectShader) {
- m_RenderContext.GetRenderContext().SetActiveShader(m_RectShader.m_RectShader.mPtr);
- m_RectShader.Apply(inProjection, inObject);
-
- m_RenderContext.GetRenderContext().SetInputAssembler(m_QuadInputAssembler.mPtr);
- m_RenderContext.GetRenderContext().Draw(NVRenderDrawMode::Triangles,
- m_QuadInputAssembler->GetIndexCount(), 0);
- }
- }
-
- void RenderPixelObject(QT3DSMat44 &inProjection, const SPGVertLine &inObject)
- {
- // lines are really just rects, but they grow in width in a sort of odd way.
- // specifically, they grow the increasing coordinate on even boundaries and centered on odd
- // boundaries.
- SPGRect theRect;
- theRect.m_Top = inObject.m_Top;
- theRect.m_Bottom = inObject.m_Bottom;
- theRect.m_FillColor = inObject.m_LineColor;
- theRect.m_Left = inObject.m_X;
- theRect.m_Right = theRect.m_Left + 1.0f;
- RenderPixelObject(inProjection, theRect);
- }
-
- void RenderPixelObject(QT3DSMat44 &inProjection, const SPGHorzLine &inObject)
- {
- SPGRect theRect;
- theRect.m_Right = inObject.m_Right;
- theRect.m_Left = inObject.m_Left;
- theRect.m_FillColor = inObject.m_LineColor;
- theRect.m_Bottom = inObject.m_Y;
- theRect.m_Top = theRect.m_Bottom + 1.0f;
- RenderPixelObject(inProjection, theRect);
- }
-
- void Render(NVConstDataRef<SPGGraphObject *> inObjects) override
- {
- NVRenderContext &theRenderContext(m_RenderContext.GetRenderContext());
- theRenderContext.PushPropertySet();
- // Setup an orthographic camera that places the center at the
- // lower left of the viewport.
- NVRenderRectF theViewport = theRenderContext.GetViewport();
- // With no projection at all, we are going to get a square view box
- // with boundaries from -1,1 in all dimensions. This is close to what we want.
- theRenderContext.SetDepthTestEnabled(false);
- theRenderContext.SetDepthWriteEnabled(false);
- theRenderContext.SetScissorTestEnabled(false);
- theRenderContext.SetBlendingEnabled(true);
- theRenderContext.SetCullingEnabled(false);
- // Colors are expected to be non-premultiplied, so we premultiply alpha into them at this
- // point.
- theRenderContext.SetBlendFunction(qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::SrcAlpha, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha));
- theRenderContext.SetBlendEquation(qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add));
-
- SCamera theCamera;
- theCamera.m_Position.z = -5;
- theCamera.m_ClipNear = 1.0f;
- theCamera.m_ClipFar = 10.0f;
- theCamera.m_Flags.SetOrthographic(true);
- // Setup camera projection
- theCamera.ComputeFrustumOrtho(theViewport,
- QT3DSVec2(theViewport.m_Width, theViewport.m_Height));
- // Translate such that 0, 0 is lower left of screen.
- NVRenderRectF theIdealViewport = theViewport;
- theIdealViewport.m_X -= theViewport.m_Width / 2.0f;
- theIdealViewport.m_Y -= theViewport.m_Height / 2.0f;
- QT3DSMat44 theProjectionMatrix = NVRenderContext::ApplyVirtualViewportToProjectionMatrix(
- theCamera.m_Projection, theViewport, theIdealViewport);
- theCamera.m_Projection = theProjectionMatrix;
- // Explicitly call the node's calculate global variables so that the camera doesn't attempt
- // to change the projection we setup.
- static_cast<SNode &>(theCamera).CalculateGlobalVariables();
- QT3DSMat44 theVPMatrix(QT3DSMat44::createIdentity());
- theCamera.CalculateViewProjectionMatrix(theVPMatrix);
-
- QT3DSVec4 theTest(60, 200, 0, 1);
- QT3DSVec4 theResult = theVPMatrix.transform(theTest);
-
- (void)theTest;
- (void)theResult;
-
- for (QT3DSU32 idx = 0, end = inObjects.size(); idx < end; ++idx) {
- const SPGGraphObject &theObject(*inObjects[idx]);
-
- switch (theObject.m_Type) {
- case SGTypes::VertLine:
- RenderPixelObject(theVPMatrix, static_cast<const SPGVertLine &>(theObject));
- break;
- case SGTypes::HorzLine:
- RenderPixelObject(theVPMatrix, static_cast<const SPGHorzLine &>(theObject));
- break;
- case SGTypes::Rect:
- RenderPixelObject(theVPMatrix, static_cast<const SPGRect &>(theObject));
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- theRenderContext.PopPropertySet(false);
- }
-};
-}
-
-IPixelGraphicsRenderer &IPixelGraphicsRenderer::CreateRenderer(IQt3DSRenderContext &ctx,
- IStringTable &strt)
-{
- return *QT3DS_NEW(ctx.GetAllocator(), SPGRenderer)(ctx, strt);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.h
deleted file mode 100644
index b37cb26b..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsRenderer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PIXEL_GRAPHICS_RENDERER_H
-#define QT3DS_RENDER_PIXEL_GRAPHICS_RENDERER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSDataRef.h"
-
-namespace qt3ds {
-namespace render {
-
- // Pixel graphics are graphics described in pixels.
- // Colors are expected to be non-premultiplied, we use ROP
- // hardware to do the alpha multiply into the color.
- class IPixelGraphicsRenderer : public NVRefCounted
- {
- public:
- // Renders the node to the current viewport.
- virtual void Render(NVConstDataRef<SPGGraphObject *> inObjects) = 0;
-
- static IPixelGraphicsRenderer &CreateRenderer(IQt3DSRenderContext &ctx, IStringTable &strt);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.cpp
deleted file mode 100644
index fe32437f..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderPixelGraphicsTypes.h"
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-
-SPGGraphObject::SPGGraphObject(SGTypes::Enum inType)
- : m_Type(inType)
-{
-}
-
-SPGRect::SPGRect()
- : SPGGraphObject(SGTypes::Rect)
- , m_Left(0)
- , m_Top(0)
- , m_Right(0)
- , m_Bottom(0)
- , m_FillColor(0, 0, 0, 0)
-{
-}
-
-SPGVertLine::SPGVertLine()
- : SPGGraphObject(SGTypes::VertLine)
- , m_X(0)
- , m_Top(0)
- , m_Bottom(0)
- , m_LineColor(0, 0, 0, 0)
-{
-}
-
-SPGHorzLine::SPGHorzLine()
- : SPGGraphObject(SGTypes::HorzLine)
- , m_Y(0)
- , m_Left(0)
- , m_Right(0)
- , m_LineColor(0, 0, 0, 0)
-{
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.h
deleted file mode 100644
index 2c154c18..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPixelGraphicsTypes.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PIXEL_GRAPHICS_TYPES_H
-#define QT3DS_RENDER_PIXEL_GRAPHICS_TYPES_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec4.h"
-#include "foundation/Qt3DSMat33.h"
-#include "foundation/Qt3DSOption.h"
-
-namespace qt3ds {
-namespace render {
-
- // Vector graphics with no scaling are pixel aligned with 0,0 being the bottom,left of the
- // screen
- // with coordinates increasing to the right and up. This is opposite most window systems but it
- // preserves the normal openGL assumptions about viewports and positive Y going up in general.
- struct SGTypes
- {
- enum Enum {
- UnknownVGType = 0,
- Layer,
- Rect,
- VertLine,
- HorzLine,
- };
- };
-
- struct SPGGraphObject
- {
- SGTypes::Enum m_Type;
- SPGGraphObject(SGTypes::Enum inType);
- };
-
- struct SPGRect : public SPGGraphObject
- {
- QT3DSF32 m_Left;
- QT3DSF32 m_Top;
- QT3DSF32 m_Right;
- QT3DSF32 m_Bottom;
-
- QT3DSVec4 m_FillColor;
-
- SPGRect();
- };
-
- struct SPGVertLine : public SPGGraphObject
- {
- QT3DSF32 m_X;
- QT3DSF32 m_Top;
- QT3DSF32 m_Bottom;
- QT3DSVec4 m_LineColor;
- void SetPosition(QT3DSF32 val) { m_X = val; }
- void SetStart(QT3DSF32 val) { m_Bottom = val; }
- void SetStop(QT3DSF32 val) { m_Top = val; }
-
- SPGVertLine();
- };
-
- struct SPGHorzLine : public SPGGraphObject
- {
- QT3DSF32 m_Y;
- QT3DSF32 m_Left;
- QT3DSF32 m_Right;
- QT3DSVec4 m_LineColor;
- void SetPosition(QT3DSF32 val) { m_Y = val; }
- void SetStart(QT3DSF32 val) { m_Left = val; }
- void SetStop(QT3DSF32 val) { m_Right = val; }
-
- SPGHorzLine();
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.cpp
deleted file mode 100644
index e4e821f8..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.cpp
+++ /dev/null
@@ -1,936 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderPlugin.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/SerializationTypes.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSSystem.h"
-#include "foundation/FileTools.h"
-#include "render/Qt3DSRenderContext.h"
-#include "StringTools.h"
-#include "Qt3DSRenderPluginPropertyValue.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-
-#if defined(QT3DS_WINDOWS)
-#include "windows/DynamicLibLoader.h"
-#elif defined(QT3DS_ANDROID)
-#include "android/DynamicLibLoader.h"
-#elif defined(QT3DS_LINUX)
-#include "linux/DynamicLibLoader.h"
-#elif defined(QT3DS_APPLE)
-#include "macos/DynamicLibLoader.h"
-#elif defined(QT3DS_QNX)
-#include "qnx/DynamicLibLoader.h"
-#else
-#error "Must define an operating system type (QT3DS_WINDOWS, QT3DS_ANDROID, QT3DS_LINUX, QT3DS_APPLE, QT3DS_QNX)"
-#endif
-
-using namespace qt3ds::render;
-
-namespace {
-// Legacy definitions...
-// API version 1 definitions
-typedef struct _RenderPluginSurfaceDescriptionV1
-{
- long m_Width;
- long m_Height;
- enum QT3DSRenderPluginDepthTypes m_DepthBuffer;
- enum QT3DSRenderPluginTextureTypes m_ColorBuffer;
- TBool m_HasStencilBuffer;
-} TRenderPluginSurfaceDescriptionV1;
-
-typedef TNeedsRenderResult (*TNeedsRenderFunctionV1)(TRenderPluginClassPtr cls,
- TRenderPluginInstancePtr instance,
- TRenderPluginSurfaceDescriptionV1 surface,
- TVec2 presScaleFactor);
-
-typedef void (*TRenderFunctionV1)(TRenderPluginClassPtr cls, TRenderPluginInstancePtr instance,
- TRenderPluginSurfaceDescriptionV1 surface,
- TVec2 presScaleFactor,
- QT3DSRenderPluginColorClearState inClearColorBuffer);
-
-// End API version 1 definitions
-
-TRenderPluginSurfaceDescription ToCInterface(const SOffscreenRendererEnvironment &env)
-{
- TRenderPluginSurfaceDescription retval;
- retval.m_Width = (long)env.m_Width;
- retval.m_Height = (long)env.m_Height;
- retval.m_ColorBuffer = static_cast<QT3DSRenderPluginTextureTypes>(env.m_Format);
- retval.m_DepthBuffer = static_cast<QT3DSRenderPluginDepthTypes>(env.m_Depth);
- retval.m_HasStencilBuffer = env.m_Stencil ? TTRUE : TFALSE;
- retval.m_MSAALevel = QT3DSRenderPluginMSAALevelNoMSAA;
- // note no supersampling AA support for plugins
- // we fall back to 4xMSAA
- switch (env.m_MSAAMode) {
- case AAModeValues::X2:
- retval.m_MSAALevel = QT3DSRenderPluginMSAALevelTwo;
- break;
- case AAModeValues::SSAA:
- case AAModeValues::X4:
- retval.m_MSAALevel = QT3DSRenderPluginMSAALevelFour;
- break;
- case AAModeValues::X8:
- retval.m_MSAALevel = QT3DSRenderPluginMSAALevelEight;
- break;
- default:
- QT3DS_ASSERT(false);
- // fallthrough intentional.
- case AAModeValues::NoAA:
- break;
- };
- return retval;
-}
-
-TRenderPluginSurfaceDescriptionV1 ToCInterfaceV1(const SOffscreenRendererEnvironment &env)
-{
- TRenderPluginSurfaceDescriptionV1 retval;
- retval.m_Width = (long)env.m_Width;
- retval.m_Height = (long)env.m_Height;
- retval.m_ColorBuffer = static_cast<QT3DSRenderPluginTextureTypes>(env.m_Format);
- retval.m_DepthBuffer = static_cast<QT3DSRenderPluginDepthTypes>(env.m_Depth);
- retval.m_HasStencilBuffer = env.m_Stencil ? TTRUE : TFALSE;
- return retval;
-}
-
-TVec2 ToCInterface(const QT3DSVec2 &item)
-{
- TVec2 retval = { item.x, item.y };
- return retval;
-}
-
-QT3DSRenderPluginColorClearState ToCInterface(SScene::RenderClearCommand inClearCommand)
-{
- switch (inClearCommand) {
- case SScene::DoNotClear:
- return QT3DSRenderPluginColorClearStateDoNotClear;
- case SScene::AlwaysClear:
- return QT3DSRenderPluginColorClearStateAlwaysClear;
- default:
- QT3DS_ASSERT(false); // fallthrough intentional
- case SScene::ClearIsOptional:
- return QT3DSRenderPluginColorClearStateClearIsOptional;
- };
-}
-
-class SRenderPluginPropertyData
-{
- SRenderPluginPropertyValue m_Value;
- bool m_Dirty;
-
-public:
- SRenderPluginPropertyData()
- : m_Dirty(false)
- {
- }
- SRenderPluginPropertyData(const SRenderPluginPropertyData &other)
- : m_Value(other.m_Value)
- , m_Dirty(other.m_Dirty)
- {
- }
- SRenderPluginPropertyData &operator=(const SRenderPluginPropertyData &other)
- {
- m_Value = other.m_Value;
- m_Dirty = other.m_Dirty;
- return *this;
- }
-
- bool IsDirty() const
- {
- return m_Value.getType() != RenderPluginPropertyValueTypes::NoRenderPluginPropertyValue
- && m_Dirty;
- }
- void SetValue(const SRenderPluginPropertyValue &value)
- {
- m_Value = value;
- m_Dirty = true;
- }
-
- TRenderPluginPropertyUpdate ClearDirty(CRegisteredString inPropName)
- {
- m_Dirty = false;
- TRenderPluginPropertyUpdate retval;
- memset(&retval, 0, sizeof(TRenderPluginPropertyUpdate));
- retval.m_PropName = inPropName.c_str();
- switch (m_Value.getType()) {
- case RenderPluginPropertyValueTypes::Long: {
- retval.m_PropertyType = QT3DSRenderPluginPropertyTypeLong;
- long temp = (long)m_Value.getData<QT3DSI32>();
- retval.m_PropertyValue = *reinterpret_cast<void **>(&temp);
- } break;
- case RenderPluginPropertyValueTypes::Float: {
- retval.m_PropertyType = QT3DSRenderPluginPropertyTypeFloat;
- float temp = m_Value.getData<QT3DSF32>();
- retval.m_PropertyValue = *reinterpret_cast<void **>(&temp);
- } break;
- case RenderPluginPropertyValueTypes::Boolean: {
- retval.m_PropertyType = QT3DSRenderPluginPropertyTypeLong;
- long temp = m_Value.getData<bool>() ? TTRUE : TFALSE;
- retval.m_PropertyValue = *reinterpret_cast<void **>(&temp);
- } break;
- case RenderPluginPropertyValueTypes::String: {
- retval.m_PropertyType = QT3DSRenderPluginPropertyTypeCharPtr;
- const char *temp = m_Value.getData<CRegisteredString>().c_str();
- retval.m_PropertyValue = reinterpret_cast<void *>(const_cast<char *>(temp));
- } break;
- default:
- QT3DS_ASSERT(false);
- }
- return retval;
- }
-};
-
-typedef nvvector<SRenderPluginPropertyData> TPropertyValueList;
-
-struct IInternalPluginClass : public IRenderPluginClass
-{
- virtual void PushUpdates(TRenderPluginInstancePtr instance,
- TPropertyValueList &propertyValues) = 0;
- virtual void Update(NVConstDataRef<SRenderPropertyValueUpdate> updateBuffer,
- TPropertyValueList &propertyValues) = 0;
- virtual QT3DSI32 GetAPIVersion() = 0;
-};
-
-static NVRenderTextureFormats::Enum ToTextureFormat(QT3DSRenderPluginTextureTypes inTextureType)
-{
- switch (inTextureType) {
- default:
- case QT3DSRenderPluginTextureTypeRGBA8:
- return NVRenderTextureFormats::RGBA8;
- case QT3DSRenderPluginTextureTypeRGB8:
- return NVRenderTextureFormats::RGB8;
- case QT3DSRenderPluginTextureTypeRGB565:
- return NVRenderTextureFormats::RGB565;
- case QT3DSRenderPluginTextureTypeRGBA5551:
- return NVRenderTextureFormats::RGBA5551;
- }
-}
-
-static OffscreenRendererDepthValues::Enum ToDepthValue(QT3DSRenderPluginDepthTypes inType)
-{
- switch (inType) {
- default:
- case QT3DSRenderPluginDepthTypeDepth16:
- return OffscreenRendererDepthValues::Depth16;
- case QT3DSRenderPluginDepthTypeDepth24:
- return OffscreenRendererDepthValues::Depth24;
- case QT3DSRenderPluginDepthTypeDepth32:
- return OffscreenRendererDepthValues::Depth32;
- }
-}
-
-static AAModeValues::Enum ToAAMode(QT3DSRenderPluginMSAALevel inMode)
-{
- switch (inMode) {
- case QT3DSRenderPluginMSAALevelTwo:
- return AAModeValues::X2;
- case QT3DSRenderPluginMSAALevelFour:
- return AAModeValues::X4;
- case QT3DSRenderPluginMSAALevelEight:
- return AAModeValues::X8;
- default:
- QT3DS_ASSERT(false); // fallthrough intentional
- case QT3DSRenderPluginMSAALevelNoMSAA:
- return AAModeValues::NoAA;
- }
-}
-
-struct InstanceImpl : public IRenderPluginInstance
-{
- NVFoundationBase &m_Foundation;
- TRenderPluginInstancePtr m_Instance;
- TRenderPluginClass m_Class;
- NVScopedRefCounted<IInternalPluginClass> m_Owner;
- CRegisteredString m_RendererType;
- // Backing store of property values
- nvvector<SRenderPluginPropertyData> m_PropertyValues;
- bool m_Dirty;
- NVRenderContext *m_RenderContext;
- QT3DSI32 mRefCount;
-
- InstanceImpl(NVFoundationBase &fnd, TRenderPluginInstancePtr instance, TRenderPluginClass cls,
- IInternalPluginClass &owner, IStringTable &strTable)
- : m_Foundation(fnd)
- , m_Instance(instance)
- , m_Class(cls)
- , m_Owner(owner)
- , m_RendererType(
- strTable.RegisterStr(IRenderPluginInstance::IRenderPluginOffscreenRendererType()))
- , m_PropertyValues(m_Foundation.getAllocator(), "InstanceImpl::m_PropertyValues")
- , m_Dirty(false)
- , m_RenderContext(NULL)
- , mRefCount(0)
- {
- }
-
- virtual ~InstanceImpl() { m_Class.ReleaseInstance(m_Class.m_Class, m_Instance); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- void addCallback(IOffscreenRendererCallback *cb) override
- {
-
- }
- void CreateScriptProxy(script_State *state) override
- {
- if (m_Class.CreateInstanceScriptProxy)
- m_Class.CreateInstanceScriptProxy(m_Class.m_Class, m_Instance, state);
- }
-
- // Arbitrary const char* returned to indicate the type of this renderer
- // Can be overloaded to form the basis of an RTTI type system.
- // Not currently used by the rendering system.
- CRegisteredString GetOffscreenRendererType() override { return m_RendererType; }
-
- SOffscreenRendererEnvironment GetDesiredEnvironment(QT3DSVec2 inPresentationScaleFactor) override
- {
- if (m_Class.QueryInstanceRenderSurface) {
- QT3DSRenderPluginMSAALevel theLevel = QT3DSRenderPluginMSAALevelNoMSAA;
- TRenderPluginSurfaceDescription desc = m_Class.QueryInstanceRenderSurface(
- m_Class.m_Class, m_Instance, ToCInterface(inPresentationScaleFactor));
- if (m_Owner->GetAPIVersion() > 1)
- theLevel = desc.m_MSAALevel;
-
- return SOffscreenRendererEnvironment(
- (QT3DSU32)desc.m_Width, (QT3DSU32)desc.m_Height, ToTextureFormat(desc.m_ColorBuffer),
- ToDepthValue(desc.m_DepthBuffer), desc.m_HasStencilBuffer ? true : false,
- ToAAMode(theLevel));
- } else {
- QT3DS_ASSERT(false);
- }
- return SOffscreenRendererEnvironment();
- }
-
- // Returns true of this object needs to be rendered, false if this object is not dirty
- SOffscreenRenderFlags NeedsRender(const SOffscreenRendererEnvironment &inEnvironment,
- QT3DSVec2 inPresentationScaleFactor,
- const SRenderInstanceId instanceId) override
- {
- if (m_Dirty) {
- m_Dirty = false;
- m_Owner->PushUpdates(m_Instance, m_PropertyValues);
- }
- if (m_Class.NeedsRenderFunction) {
- if (m_Owner->GetAPIVersion() > 1) {
- TNeedsRenderResult result = m_Class.NeedsRenderFunction(
- m_Class.m_Class, m_Instance, ToCInterface(inEnvironment),
- ToCInterface(inPresentationScaleFactor));
- return SOffscreenRenderFlags(result.HasTransparency ? true : false,
- result.HasChangedSinceLastFrame ? true : false);
- } else {
- TNeedsRenderFunctionV1 theV1Function =
- reinterpret_cast<TNeedsRenderFunctionV1>(m_Class.NeedsRenderFunction);
-
- TNeedsRenderResult result =
- theV1Function(m_Class.m_Class, m_Instance, ToCInterfaceV1(inEnvironment),
- ToCInterface(inPresentationScaleFactor));
- return SOffscreenRenderFlags(result.HasTransparency ? true : false,
- result.HasChangedSinceLastFrame ? true : false);
- }
- }
- return SOffscreenRenderFlags(true, true);
- }
- // Returns true if the rendered result image has transparency, or false
- // if it should be treated as a completely opaque image.
- // It is the IOffscreenRenderer's job to clear any buffers (color, depth, stencil) that it
- // needs to. It should not assume that it's buffers are clear;
- // Sometimes we scale the width and height of the main presentation in order to fit a window.
- // If we do so, the scale factor tells the subpresentation renderer how much the system has
- // scaled.
- void Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresentationScaleFactor,
- SScene::RenderClearCommand inColorBufferNeedsClear,
- const SRenderInstanceId instanceId) override
- {
- m_RenderContext = &inRenderContext;
- if (m_Class.RenderInstance) {
- inRenderContext.PushPropertySet();
- if (m_Owner->GetAPIVersion() > 1) {
- m_Class.RenderInstance(m_Class.m_Class, m_Instance, ToCInterface(inEnvironment),
- ToCInterface(inPresentationScaleFactor),
- ToCInterface(inColorBufferNeedsClear));
- } else {
- TRenderFunctionV1 theV1Function =
- reinterpret_cast<TRenderFunctionV1>(m_Class.RenderInstance);
- theV1Function(m_Class.m_Class, m_Instance, ToCInterfaceV1(inEnvironment),
- ToCInterface(inPresentationScaleFactor),
- ToCInterface(inColorBufferNeedsClear));
- }
-
- inRenderContext.PopPropertySet(true);
- }
- }
-
- void RenderWithClear(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresScale,
- SScene::RenderClearCommand inClearBuffer, QT3DSVec4 inClearColor,
- const SRenderInstanceId id)
- {
- Q_ASSERT(false);
- }
-
- // Implementors should implement one of the two interfaces below.
-
- // If this renderer supports picking that can return graph objects
- // then return an interface here.
- IGraphObjectPickQuery *GetGraphObjectPickQuery(const SRenderInstanceId) override { return NULL; }
-
- // If you *don't* support the GraphObjectPickIterator interface, then you should implement this
- // interface
- // The system will just ask you to pick.
- // If you return true, then we will assume that you swallowed the pick and will continue no
- // further.
- // else we will assume you did not and will continue the picking algorithm.
- bool Pick(const QT3DSVec2 &inMouseCoords, const QT3DSVec2 &inViewportDimensions,
- const SRenderInstanceId instanceId) override
- {
- if (m_Class.Pick) {
- if (m_RenderContext) {
- m_RenderContext->PushPropertySet();
- bool retval = m_Class.Pick(m_Class.m_Class, m_Instance, ToCInterface(inMouseCoords),
- ToCInterface(inViewportDimensions))
- ? true
- : false;
- m_RenderContext->PopPropertySet(true);
- return retval;
- }
- }
- return false;
- }
-
- TRenderPluginInstancePtr GetRenderPluginInstance() override { return m_Instance; }
- void Update(NVConstDataRef<SRenderPropertyValueUpdate> updateBuffer) override
- {
- m_Dirty = true;
- m_Owner->Update(updateBuffer, m_PropertyValues);
- }
- IRenderPluginClass &GetPluginClass() override { return *m_Owner; }
-};
-
-typedef eastl::pair<CRegisteredString, RenderPluginPropertyValueTypes::Enum> TStringTypePair;
-
-struct PluginClassImpl : public IInternalPluginClass
-{
- typedef nvhash_map<CRegisteredString, QT3DSU32> TStringIndexMap;
- NVFoundationBase &m_Foundation;
- IStringTable &m_StringTable;
- TRenderPluginClass m_Class;
- CRegisteredString m_Type;
- CLoadedDynamicLibrary *m_DynamicLibrary;
- nvvector<SRenderPluginPropertyDeclaration> m_RegisteredProperties;
- TStringIndexMap m_ComponentNameToComponentIndexMap;
- nvvector<TStringTypePair> m_FullPropertyList;
- nvvector<TRenderPluginPropertyUpdate> m_UpdateBuffer;
- Qt3DSString m_TempString;
- QT3DSI32 m_APIVersion;
-
- QT3DSI32 mRefCount;
-
- PluginClassImpl(NVFoundationBase &fnd, IStringTable &strTable, TRenderPluginClass inClass,
- CRegisteredString inType, CLoadedDynamicLibrary *inLibrary)
- : m_Foundation(fnd)
- , m_StringTable(strTable)
- , m_Class(inClass)
- , m_Type(inType)
- , m_DynamicLibrary(inLibrary)
- , m_RegisteredProperties(m_Foundation.getAllocator(),
- "PluginClassImpl::m_RegisteredProperties")
- , m_ComponentNameToComponentIndexMap(m_Foundation.getAllocator(),
- "PluginClassImpl::m_ComponentNameToComponentIndexMap")
- , m_FullPropertyList(m_Foundation.getAllocator(), "PluginClassImpl::m_FullPropertyList")
- , m_UpdateBuffer(m_Foundation.getAllocator(), "PluginClassImpl::m_UpdateBuffer")
- , m_APIVersion(m_Class.GetRenderPluginAPIVersion(m_Class.m_Class))
- , mRefCount(0)
- {
- }
- ~PluginClassImpl()
- {
- if (m_Class.ReleaseClass)
- m_Class.ReleaseClass(m_Class.m_Class);
- if (m_DynamicLibrary)
- NVDelete(m_Foundation.getAllocator(), m_DynamicLibrary);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- NVScopedRefCounted<IRenderPluginInstance> CreateInstance() override
- {
- if (m_Class.CreateInstance) {
- TRenderPluginInstancePtr instance =
- m_Class.CreateInstance(m_Class.m_Class, m_Type.c_str());
- if (instance) {
- InstanceImpl *retval = QT3DS_NEW(m_Foundation.getAllocator(), InstanceImpl)(
- m_Foundation, instance, m_Class, *this, m_StringTable);
- return retval;
- }
- }
- return NVScopedRefCounted<IRenderPluginInstance>();
- }
-
- QT3DSI32 GetAPIVersion() override { return m_APIVersion; }
-
- void AddFullPropertyType(const char *name, RenderPluginPropertyValueTypes::Enum inType)
- {
- QT3DSU32 itemIndex = (QT3DSU32)m_FullPropertyList.size();
- CRegisteredString regName = m_StringTable.RegisterStr(name);
- bool inserted =
- m_ComponentNameToComponentIndexMap.insert(eastl::make_pair(regName, itemIndex)).second;
- if (inserted) {
- m_FullPropertyList.push_back(eastl::make_pair(regName, inType));
- } else {
- // Duplicate property declaration.
- QT3DS_ASSERT(false);
- }
- }
-
- void AddFullPropertyType(const char *name, const char *extension,
- RenderPluginPropertyValueTypes::Enum inType)
- {
- m_TempString.assign(name);
- if (!isTrivial(extension)) {
- m_TempString.append(".");
- m_TempString.append(extension);
- }
- AddFullPropertyType(m_TempString.c_str(), inType);
- }
-
- void RegisterProperty(const SRenderPluginPropertyDeclaration &dec) override
- {
- QT3DSU32 startOffset = (QT3DSU32)m_FullPropertyList.size();
-
- switch (dec.m_Type) {
-
- case SRenderPluginPropertyTypes::Vector2:
- AddFullPropertyType(dec.m_Name, "x", RenderPluginPropertyValueTypes::Float);
- AddFullPropertyType(dec.m_Name, "y", RenderPluginPropertyValueTypes::Float);
- break;
- case SRenderPluginPropertyTypes::Color:
- AddFullPropertyType(dec.m_Name, "r", RenderPluginPropertyValueTypes::Float);
- AddFullPropertyType(dec.m_Name, "g", RenderPluginPropertyValueTypes::Float);
- AddFullPropertyType(dec.m_Name, "b", RenderPluginPropertyValueTypes::Float);
- break;
- case SRenderPluginPropertyTypes::Vector3:
- AddFullPropertyType(dec.m_Name, "x", RenderPluginPropertyValueTypes::Float);
- AddFullPropertyType(dec.m_Name, "y", RenderPluginPropertyValueTypes::Float);
- AddFullPropertyType(dec.m_Name, "z", RenderPluginPropertyValueTypes::Float);
- break;
- case SRenderPluginPropertyTypes::Boolean:
- AddFullPropertyType(dec.m_Name, RenderPluginPropertyValueTypes::Boolean);
- break;
- case SRenderPluginPropertyTypes::Float:
- AddFullPropertyType(dec.m_Name, RenderPluginPropertyValueTypes::Float);
- break;
- case SRenderPluginPropertyTypes::Long:
- AddFullPropertyType(dec.m_Name, RenderPluginPropertyValueTypes::Long);
- break;
- case SRenderPluginPropertyTypes::String:
- AddFullPropertyType(dec.m_Name, RenderPluginPropertyValueTypes::String);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- m_RegisteredProperties.push_back(dec);
- m_RegisteredProperties.back().m_StartOffset = startOffset;
- }
-
- NVConstDataRef<SRenderPluginPropertyDeclaration> GetRegisteredProperties() override
- {
- return m_RegisteredProperties;
- }
-
- SRenderPluginPropertyDeclaration GetPropertyDeclaration(CRegisteredString inPropName) override
- {
- for (QT3DSU32 idx = 0, end = m_RegisteredProperties.size(); idx < end; ++idx) {
- if (m_RegisteredProperties[idx].m_Name == inPropName)
- return m_RegisteredProperties[idx];
- }
- QT3DS_ASSERT(false);
- return SRenderPluginPropertyDeclaration();
- }
-
- // From which you can get the property name breakdown
- virtual eastl::pair<CRegisteredString, RenderPluginPropertyValueTypes::Enum>
- GetPropertyValueInfo(QT3DSU32 inIndex) override
- {
- if (inIndex < m_FullPropertyList.size())
- return m_FullPropertyList[inIndex];
- QT3DS_ASSERT(false);
- return eastl::pair<CRegisteredString, RenderPluginPropertyValueTypes::Enum>(
- CRegisteredString(), RenderPluginPropertyValueTypes::NoRenderPluginPropertyValue);
- }
-
- void PushUpdates(TRenderPluginInstancePtr instance, TPropertyValueList &propertyValues) override
- {
- m_UpdateBuffer.clear();
- for (QT3DSU32 idx = 0, end = propertyValues.size(); idx < end; ++idx) {
- SRenderPluginPropertyData &theData(propertyValues[idx]);
- if (theData.IsDirty())
- m_UpdateBuffer.push_back(theData.ClearDirty(m_FullPropertyList[idx].first));
- }
- if (m_Class.UpdateInstance)
- m_Class.UpdateInstance(m_Class.m_Class, instance, m_UpdateBuffer.data(),
- (long)m_UpdateBuffer.size());
- }
-
- void Update(NVConstDataRef<SRenderPropertyValueUpdate> updateBuffer,
- TPropertyValueList &propertyValues) override
- {
- for (QT3DSU32 idx = 0, end = updateBuffer.size(); idx < end; ++idx) {
- const SRenderPropertyValueUpdate &update = updateBuffer[idx];
- TStringIndexMap::iterator iter =
- m_ComponentNameToComponentIndexMap.find(update.m_PropertyName);
- if (iter == m_ComponentNameToComponentIndexMap.end()) {
- QT3DS_ASSERT(false);
- continue;
- }
-
- QT3DSU32 propIndex = iter->second;
- if (update.m_Value.getType() != m_FullPropertyList[propIndex].second) {
- QT3DS_ASSERT(false);
- continue;
- }
- if (propIndex >= propertyValues.size())
- propertyValues.resize(propIndex + 1);
- propertyValues[propIndex].SetValue(update.m_Value);
- }
- }
-};
-
-struct PluginInstanceKey
-{
- CRegisteredString m_Path;
- void *m_InstanceKey;
- PluginInstanceKey(CRegisteredString p, void *ik)
- : m_Path(p)
- , m_InstanceKey(ik)
- {
- }
- bool operator==(const PluginInstanceKey &rhs) const
- {
- return m_Path == rhs.m_Path && m_InstanceKey == rhs.m_InstanceKey;
- }
-};
-}
-
-namespace eastl {
-template <>
-struct hash<PluginInstanceKey>
-{
- size_t operator()(const PluginInstanceKey &k) const
- {
- return hash<CRegisteredString>()(k.m_Path)
- ^ hash<size_t>()(reinterpret_cast<size_t>(k.m_InstanceKey));
- }
- bool operator()(const PluginInstanceKey &lhs, const PluginInstanceKey &rhs) const
- {
- return lhs.m_Path == rhs.m_Path && lhs.m_InstanceKey == rhs.m_InstanceKey;
- }
-};
-}
-
-namespace {
-
-struct SLoadedPluginData
-{
- CRegisteredString m_PluginPath;
- eastl::vector<SRenderPluginPropertyDeclaration> m_Properties;
-};
-
-typedef eastl::vector<SLoadedPluginData> TLoadedPluginDataList;
-
-struct PluginManagerImpl : public IRenderPluginManager, public IRenderPluginManagerCore
-{
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<IRenderPluginClass>> TLoadedClassMap;
- typedef nvhash_map<PluginInstanceKey, NVScopedRefCounted<IRenderPluginInstance>> TInstanceMap;
- NVFoundationBase &m_Foundation;
- IStringTable &m_StringTable;
- TLoadedClassMap m_LoadedClasses;
- TInstanceMap m_Instances;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- IInputStreamFactory &m_InputStreamFactory;
- QT3DSI32 mRefCount;
- TStr m_DllDir;
- TLoadedPluginDataList m_LoadedPluginData;
-
- PluginManagerImpl(NVFoundationBase &fnd, IStringTable &st, IInputStreamFactory &inFactory)
- : m_Foundation(fnd)
- , m_StringTable(st)
- , m_LoadedClasses(fnd.getAllocator(), "PluginManagerImpl::m_LoadedClasses")
- , m_Instances(fnd.getAllocator(), "PluginManagerImpl::m_Instances")
- , m_InputStreamFactory(inFactory)
- , mRefCount(0)
- , m_DllDir(ForwardingAllocator(fnd.getAllocator(), "PluginManagerImpl::m_DllDir"))
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- IRenderPluginClass *GetRenderPlugin(CRegisteredString inRelativePath) override
- {
- TLoadedClassMap::iterator iter = m_LoadedClasses.find(inRelativePath);
- if (iter != m_LoadedClasses.end())
- return iter->second;
-
- return NVScopedRefCounted<IRenderPluginClass>();
- }
-
- IRenderPluginClass *GetOrCreateRenderPlugin(CRegisteredString inRelativePath) override
- {
- TLoadedClassMap::iterator iter = m_LoadedClasses.find(inRelativePath);
- if (iter != m_LoadedClasses.end()) {
- return iter->second;
- }
-
- // We insert right here to keep us from going down this path potentially for every instance.
- iter =
- m_LoadedClasses
- .insert(eastl::make_pair(inRelativePath, NVScopedRefCounted<IRenderPluginClass>()))
- .first;
- eastl::string xmlDir, fname, extension;
-
- CFileTools::Split(inRelativePath.c_str(), xmlDir, fname, extension);
-
- eastl::string sharedLibrary(xmlDir);
- eastl::string subdir(qt3ds::foundation::System::getPlatformGLStr());
- eastl::string libdir;
- eastl::string libpath;
-
- CFileTools::CombineBaseAndRelative(xmlDir.c_str(), subdir.c_str(), libdir);
- CFileTools::CombineBaseAndRelative(libdir.c_str(), fname.c_str(), libpath);
-#ifdef _DEBUG
- libpath.append("d");
-#endif
- libpath.append(qt3ds::foundation::System::g_DLLExtension);
- eastl::string loadPath;
- if (m_DllDir.size()) {
- // Then we have to copy the dll to the dll directory before loading because the
- // filesystem
- // the plugin is on may not be executable.
- eastl::string targetFile;
- CFileTools::CombineBaseAndRelative(m_DllDir.c_str(), fname.c_str(), targetFile);
-#ifdef _DEBUG
- targetFile.append("d");
-#endif
- targetFile.append(qt3ds::foundation::System::g_DLLExtension);
-
- qCInfo(TRACE_INFO, "Copying plugin shared library from %s to %s",
- libpath.c_str(), targetFile.c_str());
-
- // try to open the library.
- NVScopedRefCounted<IRefCountedInputStream> theStream =
- m_InputStreamFactory.GetStreamForFile(libpath.c_str());
- if (!theStream) {
- qCCritical(INVALID_OPERATION, "Failed to load render plugin %s",
- libpath.c_str());
- return NULL;
- }
- CFileSeekableIOStream outStream(targetFile.c_str(), FileWriteFlags());
- if (!outStream.IsOpen()) {
- qCCritical(INVALID_OPERATION, "Failed to load render plugin %s",
- targetFile.c_str());
- return NULL;
- }
-
- QT3DSU8 buf[1024] = { 0 };
- for (QT3DSU32 len = theStream->Read(toDataRef(buf, 1024)); len;
- len = theStream->Read(toDataRef(buf, 1024))) {
- outStream.Write(toDataRef(buf, len));
- }
- loadPath = targetFile;
- } else {
- QString path;
- m_InputStreamFactory.GetPathForFile(libpath.c_str(), path);
- loadPath = path.toUtf8().data();
- }
- CLoadedDynamicLibrary *library = NULL;
- TRenderPluginClass newPluginClass;
- memSet(&newPluginClass, 0, sizeof(newPluginClass));
-
- // Do not load plugin dlls during compilation steps or when we don't have a valid render
- // context.
- // They may try opengl access at some point and that would end in disaster during binary
- // save steps.
- if ((QT3DSU32)m_RenderContext->GetRenderContextType() != NVRenderContextValues::NullContext) {
- library = CLoadedDynamicLibrary::Create(loadPath.c_str(), m_Foundation);
- if (!library) {
- // try loading it from the system instead of from this specific path. This means do
- // not use any extensions or any special
- // sauce.
- loadPath = fname;
-#ifdef _DEBUG
- loadPath.append("d");
-#endif
- library = CLoadedDynamicLibrary::Create(loadPath.c_str(), m_Foundation);
- }
- }
-
- if (library) {
- TCreateRenderPluginClassFunction CreateClass =
- reinterpret_cast<TCreateRenderPluginClassFunction>(
- library->FindFunction("CreateRenderPlugin"));
- if (CreateClass) {
- newPluginClass = CreateClass(fname.c_str());
- if (newPluginClass.m_Class) {
- // Check that the required functions are there.
- if (newPluginClass.CreateInstance == NULL
- || newPluginClass.QueryInstanceRenderSurface == NULL
- || newPluginClass.RenderInstance == NULL
- || newPluginClass.ReleaseInstance == NULL
- || newPluginClass.ReleaseClass == NULL) {
- if (newPluginClass.ReleaseClass)
- newPluginClass.ReleaseClass(newPluginClass.m_Class);
- qCCritical(INVALID_OPERATION,
- "Failed to load render plugin: %s, required functions "
- "missing. Required functions are:"
- "CreateInstance, QueryInstanceRenderSurface, "
- "RenderInstance, ReleaseInstance, ReleaseClass",
- inRelativePath.c_str());
- NVDelete(m_Foundation.getAllocator(), library);
- memSet(&newPluginClass, 0, sizeof(newPluginClass));
- }
- }
- }
- }
- if (newPluginClass.m_Class) {
- PluginClassImpl *retval = QT3DS_NEW(m_Foundation.getAllocator(), PluginClassImpl)(
- m_Foundation, m_StringTable, newPluginClass,
- m_StringTable.RegisterStr(fname.c_str()), library);
-
- iter->second = retval;
- if (newPluginClass.InitializeClassGLResources) {
- m_RenderContext->PushPropertySet();
- newPluginClass.InitializeClassGLResources(newPluginClass.m_Class, loadPath.c_str());
- m_RenderContext->PopPropertySet(true);
- }
- return iter->second;
- }
- return NULL;
- }
-
- void SetDllDir(const char *inDllDir) override { m_DllDir.assign(nonNull(inDllDir)); }
-
- IRenderPluginInstance *GetOrCreateRenderPluginInstance(CRegisteredString inRelativePath,
- void *inKey) override
- {
- PluginInstanceKey theKey(inRelativePath, inKey);
- TInstanceMap::iterator iter = m_Instances.find(theKey);
- if (iter == m_Instances.end()) {
- IRenderPluginClass *theClass = GetOrCreateRenderPlugin(inRelativePath);
- NVScopedRefCounted<IRenderPluginInstance> theInstance;
- if (theClass)
- theInstance = theClass->CreateInstance();
-
- iter = m_Instances.insert(eastl::make_pair(theKey, theInstance)).first;
- }
- return iter->second.mPtr;
- }
-
- void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap,
- const char8_t * /*inProjectDir*/) const override
- {
- QT3DSU32 numClasses = m_LoadedClasses.size();
- ioBuffer.write(numClasses);
- for (TLoadedClassMap::const_iterator iter = m_LoadedClasses.begin(),
- end = m_LoadedClasses.end();
- iter != end; ++iter) {
- CRegisteredString saveStr = iter->first;
- saveStr.Remap(inRemapMap);
- ioBuffer.write(saveStr);
- if (iter->second) {
- NVConstDataRef<SRenderPluginPropertyDeclaration> theProperties =
- const_cast<IRenderPluginClass &>((*iter->second)).GetRegisteredProperties();
- ioBuffer.write(theProperties.size());
- for (QT3DSU32 idx = 0, end = theProperties.size(); idx < end; ++idx) {
- SRenderPluginPropertyDeclaration theDec(theProperties[idx]);
- theDec.m_Name.Remap(inRemapMap);
- ioBuffer.write(theDec);
- }
- } else
- ioBuffer.write((QT3DSU32)0);
- }
- }
-
- void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t * /*inProjectDir*/) override
- {
- qt3ds::render::SDataReader theReader(inData.begin(), inData.end());
- QT3DSU32 numClasses = theReader.LoadRef<QT3DSU32>();
- ForwardingAllocator alloc(m_Foundation.getAllocator(), "tempstrings");
- qt3ds::foundation::TStr workStr(alloc);
- nvvector<SRenderPluginPropertyDeclaration> propertyBuffer(m_Foundation.getAllocator(),
- "tempprops");
- for (QT3DSU32 classIdx = 0; classIdx < numClasses; ++classIdx) {
- CRegisteredString classPath = theReader.LoadRef<CRegisteredString>();
- classPath.Remap(inStrDataBlock);
- QT3DSU32 numProperties = theReader.LoadRef<QT3DSU32>();
- propertyBuffer.clear();
- for (QT3DSU32 propIdx = 0; propIdx < numProperties; ++propIdx) {
- propertyBuffer.push_back(theReader.LoadRef<SRenderPluginPropertyDeclaration>());
- propertyBuffer.back().m_Name.Remap(inStrDataBlock);
- }
- m_LoadedPluginData.push_back(SLoadedPluginData());
- m_LoadedPluginData.back().m_PluginPath = classPath;
- m_LoadedPluginData.back().m_Properties.assign(propertyBuffer.begin(),
- propertyBuffer.end());
- }
- }
- IRenderPluginManager &GetRenderPluginManager(NVRenderContext &rc) override
- {
- m_RenderContext = rc;
- for (QT3DSU32 idx = 0, end = m_LoadedPluginData.size(); idx < end; ++idx) {
- // Now we can attempt to load the class.
- IRenderPluginClass *theClass =
- GetOrCreateRenderPlugin(m_LoadedPluginData[idx].m_PluginPath);
- if (theClass) {
- eastl::vector<SRenderPluginPropertyDeclaration> &propertyBuffer(
- m_LoadedPluginData[idx].m_Properties);
- for (QT3DSU32 propIdx = 0, propEnd = propertyBuffer.size(); propIdx < propEnd;
- ++propIdx) {
- theClass->RegisterProperty(propertyBuffer[propIdx]);
- }
- }
- }
- m_LoadedPluginData.clear();
- return *this;
- }
-};
-}
-
-IRenderPluginManagerCore &IRenderPluginManagerCore::Create(NVFoundationBase &inFoundation,
- IStringTable &strTable,
- IInputStreamFactory &inFactory)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), PluginManagerImpl)(inFoundation, strTable,
- inFactory);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.h
deleted file mode 100644
index eb71f846..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPlugin.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PLUGIN_H
-#define QT3DS_RENDER_PLUGIN_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderPluginCInterface.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "EASTL/utility.h"
-
-namespace qt3ds {
-namespace render {
-
- // UICRenderPluginPropertyValue.h
- struct SRenderPropertyValueUpdate;
-
- class IRenderPluginInstance : public IOffscreenRenderer
- {
- protected:
- virtual ~IRenderPluginInstance() {}
- public:
- static const char *IRenderPluginOffscreenRendererType() { return "IRenderPluginInstance"; }
- // If this render plugin has an instance ptr, get it.
- virtual TRenderPluginInstancePtr GetRenderPluginInstance() = 0;
- virtual void Update(NVConstDataRef<SRenderPropertyValueUpdate> updateBuffer) = 0;
- virtual IRenderPluginClass &GetPluginClass() = 0;
- virtual void CreateScriptProxy(script_State *state) = 0;
- };
- struct RenderPluginPropertyValueTypes
- {
- enum Enum {
- NoRenderPluginPropertyValue = 0,
- Boolean,
- Long,
- Float,
- String,
- };
- };
-
- struct SRenderPluginPropertyTypes
- {
- enum Enum {
- UnknownRenderPluginPropertyType = 0,
- Float,
- Vector3,
- Vector2,
- Color,
- Boolean,
- Long,
- String,
- };
- };
-
- struct SRenderPluginPropertyDeclaration
- {
- CRegisteredString m_Name;
- SRenderPluginPropertyTypes::Enum m_Type;
- // Filled in by the class, ignored if set on registered property
- QT3DSU32 m_StartOffset;
- SRenderPluginPropertyDeclaration()
- : m_Type(SRenderPluginPropertyTypes::UnknownRenderPluginPropertyType)
- {
- }
- SRenderPluginPropertyDeclaration(CRegisteredString n, SRenderPluginPropertyTypes::Enum t)
- : m_Name(n)
- , m_Type(t)
- , m_StartOffset(0)
- {
- }
- };
-
- class IRenderPluginClass : public NVRefCounted
- {
- protected:
- virtual ~IRenderPluginClass() {}
- public:
- virtual NVScopedRefCounted<IRenderPluginInstance> CreateInstance() = 0;
- virtual void RegisterProperty(const SRenderPluginPropertyDeclaration &dec) = 0;
- virtual NVConstDataRef<SRenderPluginPropertyDeclaration> GetRegisteredProperties() = 0;
- // The declaration contains an offset
- virtual SRenderPluginPropertyDeclaration
- GetPropertyDeclaration(CRegisteredString inPropName) = 0;
- // From which you can get the property name breakdown
- virtual eastl::pair<CRegisteredString, RenderPluginPropertyValueTypes::Enum>
- GetPropertyValueInfo(QT3DSU32 inIndex) = 0;
- };
-
- class IRenderPluginManager;
-
- class IRenderPluginManagerCore : public NVRefCounted
- {
- public:
- virtual void SetDllDir(const char *inDllDir) = 0;
- virtual void Load(NVDataRef<QT3DSU8> inData, CStrTableOrDataRef inStrDataBlock,
- const char8_t *inProjectDir) = 0;
- virtual IRenderPluginManager &GetRenderPluginManager(NVRenderContext &rc) = 0;
-
- static IRenderPluginManagerCore &Create(NVFoundationBase &inFoundation,
- IStringTable &strTable,
- IInputStreamFactory &inFactory);
- };
-
- class IRenderPluginManager : public NVRefCounted
- {
- public:
- virtual IRenderPluginClass *GetRenderPlugin(CRegisteredString inRelativePath) = 0;
- virtual IRenderPluginClass *GetOrCreateRenderPlugin(CRegisteredString inRelativePath) = 0;
- // Map a render plugin instance to this key. The instance's lifetime is managed by the
- // manager so a client does not
- // need to manage it.
- virtual IRenderPluginInstance *
- GetOrCreateRenderPluginInstance(CRegisteredString inRelativePath, void *inKey) = 0;
-
- virtual void Save(qt3ds::render::SWriteBuffer &ioBuffer,
- const qt3ds::render::SStrRemapMap &inRemapMap,
- const char8_t *inProjectDir) const = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginCInterface.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginCInterface.h
deleted file mode 100644
index ec7481a0..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginCInterface.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_OBJECT_RENDER_PLUGIN_H
-#define QT3DS_OBJECT_RENDER_PLUGIN_H
-
-/*
- * Below are the definitions required in order to write a render plugin for UIComposer.
- * Please note that calling anything related to opengl is explicitly not allowed except
- * during either the class gl resource initialization function or during render. Calling into
- * openGL and especially changing GL state during any other function may produce corrupt
- *rendering.
- */
-
-#ifdef _cplusplus
-#extern "C" {
-#endif
-
-enum QT3DSRenderPluginPropertyTypes {
- QT3DSRenderPluginPropertyTypeNone = 0,
- QT3DSRenderPluginPropertyTypeLong = 1,
- QT3DSRenderPluginPropertyTypeFloat = 2,
- QT3DSRenderPluginPropertyTypeCharPtr = 3,
-};
-
-enum QT3DSRenderPluginDepthTypes {
- QT3DSRenderPluginDepthTypeNoDepthBuffer = 0,
- QT3DSRenderPluginDepthTypeDepth16, // 16 bit depth buffer
- QT3DSRenderPluginDepthTypeDepth24, // 24 bit depth buffer
- QT3DSRenderPluginDepthTypeDepth32, // 32 bit depth buffer
-};
-
-enum QT3DSRenderPluginTextureTypes {
- QT3DSRenderPluginTextureTypeNoTexture = 0,
- QT3DSRenderPluginTextureTypeRGBA8, // 32 bit format
- QT3DSRenderPluginTextureTypeRGB8, // 24 bit format
- QT3DSRenderPluginTextureTypeRGB565, // 16 bit format
- QT3DSRenderPluginTextureTypeRGBA5551, // 16 bit format
-};
-
-enum QT3DSRenderPluginColorClearState {
- QT3DSRenderPluginColorClearStateClearIsOptional = 0,
- QT3DSRenderPluginColorClearStateDoNotClear,
- QT3DSRenderPluginColorClearStateAlwaysClear,
-};
-
-enum QT3DSRenderPluginMSAALevel {
- QT3DSRenderPluginMSAALevelNoMSAA = 0, // no MSAA, one also works.
- QT3DSRenderPluginMSAALevelTwo = 2, // 2 samples
- QT3DSRenderPluginMSAALevelFour = 4, // 4 samples
- QT3DSRenderPluginMSAALevelEight = 8, // 8 samples
-};
-
-typedef long TBool;
-#define TTRUE 1
-#define TFALSE 0
-
-#define QT3DS_CURRENT_RENDER_PLUGIN_API_VERSION 2
-
-typedef void *TRenderPluginInstancePtr;
-typedef void *TRenderPluginClassPtr;
-
-// We will pass the componentized properties to the instance ptr.
-typedef struct _RenderPluginPropertyUpdate
-{
- const char *m_PropName;
- enum QT3DSRenderPluginPropertyTypes m_PropertyType;
-
- // Is either a float or a long or a const char* depending on the property type.
- // for specify types of properties, example code would be:
- // float value = *((float*)&update.m_PropertyValue)
- // long value = *((long*)&update.m_PropertyValue)
- // char* value = (char*)update.m_PropertyValue
- void *m_PropertyValue;
-} TRenderPluginPropertyUpdate;
-
-typedef struct _RenderPluginSurfaceDescription
-{
- long m_Width;
- long m_Height;
- enum QT3DSRenderPluginDepthTypes m_DepthBuffer;
- enum QT3DSRenderPluginTextureTypes m_ColorBuffer;
- TBool m_HasStencilBuffer;
- QT3DSRenderPluginMSAALevel m_MSAALevel;
-} TRenderPluginSurfaceDescription;
-
-typedef struct _TVec2
-{
- float x;
- float y;
-} TVec2;
-
-typedef struct _NeedsRenderResult
-{
- TBool HasChangedSinceLastFrame;
- TBool HasTransparency;
-} TNeedsRenderResult;
-
-struct script_State;
-
-/*
- * Create a new instance object. Typename is the name of the plugin file, so for example
- * gears.plugin generates 'gears' as a type name.
- *
- * Required API function.
- *
- */
-typedef TRenderPluginInstancePtr (*TCreateInstanceFunction)(TRenderPluginClassPtr cls,
- const char *inTypeName);
-
-typedef void (*TCreateInstanceScriptProxy)(TRenderPluginClassPtr cls,
- TRenderPluginInstancePtr insPtr,
- struct script_State *state);
-
-/*
- * Update the plugin instance with a list of property updates. Properties are broken down by
- *component so for example
- * a color property named leftColor will be broken down into 'leftColor.r', 'leftColor.g',
- *'leftColor.b'. Vector
- * properties are broken down into x,y,z components. The property string has a void* member
- *that is the actual value
- * or in a charPtr property's case it is the char*.
- * Please see the comments for m_PropertyValue member of TRenderPluginPropertyUpdate struct.
- *
- * Optional API function.
- */
-typedef void (*TUpdateInstanceFunction)(TRenderPluginClassPtr cls,
- TRenderPluginInstancePtr instance,
- TRenderPluginPropertyUpdate *updates, long numUpdates);
-
-/*
- * Query used when the plugin is rendering to an image. Should return the desired
- *specifications of the plugins
- * render target.
- * presScaleFactor - the presentation scale factor when the user has requested scale to fit to
- *be used for the
- * presentation.
- *
- * Required API function.
- */
-typedef TRenderPluginSurfaceDescription (*TSurfaceQueryFunction)(TRenderPluginClassPtr cls,
- TRenderPluginInstancePtr instance,
- TVec2 presScaleFactor);
-
-/*
- * Query used by the rendering system. Should return true if the plugin will render something
- *different than it did
- * the last time it rendered. This is used so that we can cache render results and also so that we
- *can trigger the
- * progressive AA algorithm in the case where nothing has changed.
- *
- * presScaleFactor - the presentation scale factor when the user has requested scale to fit to be
- *used for the
- * presentation.
- *
- * OpenGL state may be changed in this function.
- *
- * Optional API function, returns true by default.
- */
-typedef TNeedsRenderResult (*TNeedsRenderFunction)(TRenderPluginClassPtr cls,
- TRenderPluginInstancePtr instance,
- TRenderPluginSurfaceDescription surface,
- TVec2 presScaleFactor);
-
-/*
- * Render plugin data.
- * Do not assume the surface requested is the surface given; for some cases it will be but if
- *the system has deemed it
- * appropriate to render the plugin directly to the back buffer then the surface description
- *presented could differ by
- * quite a bit.
- *
- * presScaleFactor - is the presentation scale factor when the user has requested scale to fit
- *to be used for the
- * presentation.
- * inClearColorBuffer - True if the plugin needs to clear the color buffer (when rendering to
- *texture) else false
- * (when rendering to back buffer).
- *
- * Function should return 'UICTRUE' the image produced by rendering contains transparency;
- *either every pixel wasn't
- * written to or it is desired for the plugin to blend with background objects. Else should
- *return UICFALSE.
- *
- * Required API function.
- */
-typedef void (*TRenderFunction)(TRenderPluginClassPtr cls, TRenderPluginInstancePtr instance,
- TRenderPluginSurfaceDescription surface, TVec2 presScaleFactor,
- QT3DSRenderPluginColorClearState inClearColorBuffer);
-
-/*
- * Pick - handle a mouse pick into the plugin.
- * Returns true if the pick was consumed, false otherwise.
- *
- * Option API function.
- */
-typedef TBool (*TPickFunction)(TRenderPluginClassPtr cls, TRenderPluginInstancePtr instance,
- TVec2 inMouse, TVec2 inViewport);
-
-/*
- * Release a given instance of the plugin.
- *
- * Required API function.
- */
-typedef void (*TReleaseInstanceFunction)(TRenderPluginClassPtr cls,
- TRenderPluginInstancePtr instance);
-
-/*
- * Get the plugin API version. This allows the runtime to account for API changes over time or
- * refuse to load the plugin. Plugins should return QT3DS_CURRENT_RENDER_PLUGIN_API_VERSION
- *
- * Required API function.
- */
-typedef long (*TGetAPIVersionFunction)(TRenderPluginClassPtr cls);
-
-/*
- * Initialize the resources for the class. Implementing this allows UIComposer to move
- * expensive initialization outside of the actual presentation run, thus allowing for
- * a smoother experience during the presentation at the cost of longer startup times.
- *
- * - plugin path is the path to the .plugin xml file so that clients can find resources
- * specific to their plugin relative to their .plugin file.
- *
- * OpenGL state may be changed in this function.
- *
- * Optional API function.
- */
-typedef void (*TInitializeClassGLResourcesFunction)(TRenderPluginClassPtr cls,
- const char *pluginPath);
-
-/*
- * Release the class allocated with the create proc provided in the shared library.
- *
- * Required API function.
- */
-typedef void (*TReleaseClassFunction)(TRenderPluginClassPtr cls);
-
-/*
- * Structure returned form the create class function. Unimplemented functions should be left
- *NULL.
- */
-typedef struct _RenderPluginClass
-{
- TRenderPluginClassPtr m_Class;
-
- TGetAPIVersionFunction GetRenderPluginAPIVersion;
- TInitializeClassGLResourcesFunction InitializeClassGLResources;
- TReleaseClassFunction ReleaseClass;
-
- TCreateInstanceFunction CreateInstance;
- TCreateInstanceScriptProxy CreateInstanceScriptProxy;
- TUpdateInstanceFunction UpdateInstance;
- TSurfaceQueryFunction QueryInstanceRenderSurface;
- TNeedsRenderFunction NeedsRenderFunction;
- TRenderFunction RenderInstance;
- TPickFunction Pick;
- TReleaseInstanceFunction ReleaseInstance;
-
-} TRenderPluginClass;
-
-// We look for this function name in the shared library
-#define QT3DS_RENDER_PLUGIN_CREATE_CLASS_FUNCION_NAME "CreateRenderPlugin"
-
-/*
- * Function signature we expect mapped to "CreateRenderPlugin". Example code:
- *
- extern "C" {
-
-#ifdef _WIN32
-#define PLUGIN_EXPORT_API __declspec(dllexport)
-#else
-#define PLUGIN_EXPORT_API
-#endif
-
-
-
-PLUGIN_EXPORT_API TRenderPluginClass CreateRenderPlugin( const char*)
-{
- GearClass* classItem = (GearClass*)malloc( sizeof(GearClass) );
- TRenderPluginClass retval;
- memset( &retval, 0, sizeof( TRenderPluginClass ) );
- retval.m_Class = classItem;
- retval.GetRenderPluginAPIVersion = GetAPIVersion;
- retval.CreateInstance = CreateInstance;
- retval.CreateInstanceScriptProxy = CreateInstanceScriptProxy;
- retval.UpdateInstance = UpdateInstance;
- retval.QueryInstanceRenderSurface = QuerySurface;
- retval.RenderInstance = Render;
- retval.ReleaseInstance = ReleaseInstance;
- retval.ReleaseClass = ReleaseClass;
- return retval;
-}
-
- * Required API function.
- */
-
-typedef TRenderPluginClass (*TCreateRenderPluginClassFunction)(const char *inTypeName);
-
-#ifdef _cplusplus
-}
-#endif
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginGraphObject.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginGraphObject.h
deleted file mode 100644
index c0ea66b4..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginGraphObject.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PLUGIN_GRAPH_OBJECT_H
-#define QT3DS_RENDER_PLUGIN_GRAPH_OBJECT_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-namespace qt3ds {
-namespace render {
-
- struct SRenderPlugin : public SGraphObject
- {
- CRegisteredString m_PluginPath;
- NodeFlags m_Flags;
-
- SRenderPlugin()
- : SGraphObject(GraphObjectTypes::RenderPlugin)
- {
- }
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_PluginPath);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginPropertyValue.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginPropertyValue.h
deleted file mode 100644
index a266e8d3..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderPluginPropertyValue.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PLUGIN_PROPERTY_VALUE_H
-#define QT3DS_RENDER_PLUGIN_PROPERTY_VALUE_H
-#include "Qt3DSRender.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSDiscriminatedUnion.h"
-#include "Qt3DSRenderPlugin.h"
-
-namespace qt3ds {
-namespace foundation {
-
- template <>
- struct DestructTraits<CRegisteredString>
- {
- void destruct(CRegisteredString &) {}
- };
-}
-}
-
-namespace qt3ds {
-namespace render {
-
- template <typename TDatatype>
- struct SRenderPluginPropertyValueTypeMap
- {
- };
-
- template <>
- struct SRenderPluginPropertyValueTypeMap<QT3DSI32>
- {
- enum { TypeMap = RenderPluginPropertyValueTypes::Long };
- };
- template <>
- struct SRenderPluginPropertyValueTypeMap<QT3DSF32>
- {
- enum { TypeMap = RenderPluginPropertyValueTypes::Float };
- };
- template <>
- struct SRenderPluginPropertyValueTypeMap<CRegisteredString>
- {
- enum { TypeMap = RenderPluginPropertyValueTypes::String };
- };
- template <>
- struct SRenderPluginPropertyValueTypeMap<bool>
- {
- enum { TypeMap = RenderPluginPropertyValueTypes::Boolean };
- };
-
- struct SRenderPluginPropertyValueUnionTraits
- {
- typedef RenderPluginPropertyValueTypes::Enum TIdType;
- enum {
- TBufferSize = sizeof(CRegisteredString),
- };
-
- static TIdType getNoDataId()
- {
- return RenderPluginPropertyValueTypes::NoRenderPluginPropertyValue;
- }
-
- template <typename TDataType>
- static TIdType getType()
- {
- return (TIdType)SRenderPluginPropertyValueTypeMap<TDataType>::TypeMap;
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case RenderPluginPropertyValueTypes::String:
- return inVisitor(*NVUnionCast<CRegisteredString *>(inData));
- case RenderPluginPropertyValueTypes::Float:
- return inVisitor(*NVUnionCast<QT3DSF32 *>(inData));
- case RenderPluginPropertyValueTypes::Long:
- return inVisitor(*NVUnionCast<QT3DSI32 *>(inData));
- default:
- QT3DS_ASSERT(false);
- case RenderPluginPropertyValueTypes::NoRenderPluginPropertyValue:
- return inVisitor();
- }
- }
-
- template <typename TRetType, typename TVisitorType>
- static TRetType visit(const char *inData, TIdType inType, TVisitorType inVisitor)
- {
- switch (inType) {
- case RenderPluginPropertyValueTypes::String:
- return inVisitor(*NVUnionCast<const CRegisteredString *>(inData));
- case RenderPluginPropertyValueTypes::Float:
- return inVisitor(*NVUnionCast<const QT3DSF32 *>(inData));
- case RenderPluginPropertyValueTypes::Long:
- return inVisitor(*NVUnionCast<const QT3DSI32 *>(inData));
- default:
- QT3DS_ASSERT(false);
- case RenderPluginPropertyValueTypes::NoRenderPluginPropertyValue:
- return inVisitor();
- }
- }
- };
-
- typedef qt3ds::foundation::
- DiscriminatedUnion<qt3ds::foundation::
- DiscriminatedUnionGenericBase<SRenderPluginPropertyValueUnionTraits,
- SRenderPluginPropertyValueUnionTraits::
- TBufferSize>,
- SRenderPluginPropertyValueUnionTraits::TBufferSize>
- TRenderPluginPropertyValueUnionType;
-
- struct SRenderPluginPropertyValue : public TRenderPluginPropertyValueUnionType
- {
- typedef TRenderPluginPropertyValueUnionType TBase;
- SRenderPluginPropertyValue() {}
- SRenderPluginPropertyValue(const CRegisteredString &str)
- : TBase(str)
- {
- }
- SRenderPluginPropertyValue(QT3DSI32 value)
- : TBase(value)
- {
- }
- SRenderPluginPropertyValue(QT3DSF32 value)
- : TBase(value)
- {
- }
- SRenderPluginPropertyValue(const SRenderPluginPropertyValue &other)
- : TBase(static_cast<const TBase &>(other))
- {
- }
- SRenderPluginPropertyValue &operator=(const SRenderPluginPropertyValue &other)
- {
- TBase::operator=(other);
- return *this;
- }
- };
-
- struct SRenderPropertyValueUpdate
- {
- // Should be the componentized name, so colors get .r .g .b appended
- // and vectors get .x .y etc. This interface only updates a component at a time.
- CRegisteredString m_PropertyName;
- SRenderPluginPropertyValue m_Value;
- SRenderPropertyValueUpdate() {}
- SRenderPropertyValueUpdate(CRegisteredString str, const SRenderPluginPropertyValue &v)
- : m_PropertyName(str)
- , m_Value(v)
- {
- }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderProfiler.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderProfiler.h
deleted file mode 100644
index a5941c03..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderProfiler.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PROFILER_H
-#define QT3DS_RENDER_PROFILER_H
-#include "Qt3DSRender.h"
-#include "EASTL/string.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/Qt3DSContainers.h"
-
-namespace qt3ds {
-namespace render {
-
- /**
- * Opaque profiling system for rendering.
- */
- class IRenderProfiler : public NVRefCounted
- {
- public:
- typedef nvvector<CRegisteredString> TStrIDVec;
-
- protected:
- virtual ~IRenderProfiler() {}
-
- public:
- /**
- * @brief start a timer query
- *
- * @param[in] nameID Timer ID for tracking
- * @param[in] absoluteTime If true the absolute GPU is queried
- * @param[in] sync Do a sync before starting the timer
- *
- * @return no return
- */
- virtual void StartTimer(CRegisteredString &nameID, bool absoluteTime, bool sync) = 0;
-
- /**
- * @brief stop a timer query
- *
- * @param[in] nameID Timer ID for tracking
- *
- * @return no return
- */
- virtual void EndTimer(CRegisteredString &nameID) = 0;
-
- /**
- * @brief Get elapsed timer value. Not this is an averaged time over several frames
- *
- * @param[in] nameID Timer ID for tracking
- *
- * @return no return
- */
- virtual QT3DSF64 GetElapsedTime(const CRegisteredString &nameID) const = 0;
-
- /**
- * @brief Get ID list of tracked timers
- *
- * @return ID list
- */
- virtual const TStrIDVec &GetTimerIDs() const = 0;
-
- /**
- * @brief add vertex count to current counter
- *
- * @return
- */
- virtual void AddVertexCount(QT3DSU32 count) = 0;
-
- /**
- * @brief get current vertex count and reset
- *
- * @return
- */
- virtual QT3DSU32 GetAndResetTriangleCount() const = 0;
-
- static IRenderProfiler &CreateGpuProfiler(NVFoundationBase &inFoundation,
- IQt3DSRenderContext &inContext,
- NVRenderContext &inRenderContext);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.cpp
deleted file mode 100644
index 5376b8b9..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderRay.h"
-#include "foundation/Qt3DSPlane.h"
-
-using namespace qt3ds::render;
-
-// http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm
-
-Option<QT3DSVec3> SRay::Intersect(const NVPlane &inPlane) const
-{
- QT3DSF32 Vd = inPlane.n.dot(m_Direction);
- if (fabs(Vd) < .0001f)
- return Empty();
- QT3DSF32 V0 = -1.0f * (inPlane.n.dot(m_Origin) + inPlane.d);
- QT3DSF32 t = V0 / Vd;
- return m_Origin + (m_Direction * t);
-}
-
-Option<SRayIntersectionResult> SRay::IntersectWithAABB(const QT3DSMat44 &inGlobalTransform,
- const NVBounds3 &inBounds,
- bool inForceIntersect) const
-{
- // Intersect the origin with the AABB described by bounds.
-
- // Scan each axis separately. This code basically finds the distance
- // distance from the origin to the near and far bbox planes for a given
- // axis. It then divides this distance by the direction for that axis to
- // get a range of t [near,far] that the ray intersects assuming the ray is
- // described via origin + t*(direction). Running through all three axis means
- // that you need to min/max those ranges together to find a global min/max
- // that the pick could possibly be in.
-
- // Transform pick origin and direction into the subset's space.
- QT3DSMat44 theOriginTransform = inGlobalTransform.getInverse();
-
- QT3DSVec3 theTransformedOrigin = theOriginTransform.transform(m_Origin);
- QT3DSF32 *outOriginTransformPtr(theOriginTransform.front());
- outOriginTransformPtr[12] = outOriginTransformPtr[13] = outOriginTransformPtr[14] = 0.0f;
- QT3DSVec3 theTransformedDirection = theOriginTransform.rotate(m_Direction);
-
- static const QT3DSF32 KD_FLT_MAX = 3.40282346638528860e+38;
- static const QT3DSF32 kEpsilon = 1e-5f;
-
- QT3DSF32 theMinWinner = -KD_FLT_MAX;
- QT3DSF32 theMaxWinner = KD_FLT_MAX;
-
- for (QT3DSU32 theAxis = 0; theAxis < 3; ++theAxis) {
- // Extract the ranges and direction for this axis
- QT3DSF32 theMinBox = inBounds.minimum[theAxis];
- QT3DSF32 theMaxBox = inBounds.maximum[theAxis];
- QT3DSF32 theDirectionAxis = theTransformedDirection[theAxis];
- QT3DSF32 theOriginAxis = theTransformedOrigin[theAxis];
-
- QT3DSF32 theMinAxis = -KD_FLT_MAX;
- QT3DSF32 theMaxAxis = KD_FLT_MAX;
- if (theDirectionAxis > kEpsilon) {
- theMinAxis = (theMinBox - theOriginAxis) / theDirectionAxis;
- theMaxAxis = (theMaxBox - theOriginAxis) / theDirectionAxis;
- } else if (theDirectionAxis < -kEpsilon) {
- theMinAxis = (theMaxBox - theOriginAxis) / theDirectionAxis;
- theMaxAxis = (theMinBox - theOriginAxis) / theDirectionAxis;
- } else if ((theOriginAxis < theMinBox || theOriginAxis > theMaxBox)
- && inForceIntersect == false) {
- // Pickray is roughly parallel to the plane of the slab
- // so, if the origin is not in the range, we have no intersection
- return Empty();
- }
-
- // Shrink the intersections to find the closest hit
- theMinWinner = NVMax(theMinWinner, theMinAxis);
- theMaxWinner = NVMin(theMaxWinner, theMaxAxis);
-
- if ((theMinWinner > theMaxWinner || theMaxWinner < 0) && inForceIntersect == false)
- return Empty();
- }
-
- QT3DSVec3 scaledDir = theTransformedDirection * theMinWinner;
- QT3DSVec3 newPosInLocal = theTransformedOrigin + scaledDir;
- QT3DSVec3 newPosInGlobal = inGlobalTransform.transform(newPosInLocal);
- QT3DSVec3 cameraToLocal = m_Origin - newPosInGlobal;
-
- QT3DSF32 rayLengthSquared = cameraToLocal.magnitudeSquared();
-
- QT3DSF32 xRange = inBounds.maximum.x - inBounds.minimum.x;
- QT3DSF32 yRange = inBounds.maximum.y - inBounds.minimum.y;
-
- QT3DSVec2 relXY;
- relXY.x = (newPosInLocal[0] - inBounds.minimum.x) / xRange;
- relXY.y = (newPosInLocal[1] - inBounds.minimum.y) / yRange;
-
- return SRayIntersectionResult(rayLengthSquared, relXY);
-}
-
-Option<QT3DSVec2> SRay::GetRelative(const QT3DSMat44 &inGlobalTransform, const NVBounds3 &inBounds,
- SBasisPlanes::Enum inPlane) const
-{
- QT3DSMat44 theOriginTransform = inGlobalTransform.getInverse();
-
- QT3DSVec3 theTransformedOrigin = theOriginTransform.transform(m_Origin);
- QT3DSF32 *outOriginTransformPtr(theOriginTransform.front());
- outOriginTransformPtr[12] = outOriginTransformPtr[13] = outOriginTransformPtr[14] = 0.0f;
- QT3DSVec3 theTransformedDirection = theOriginTransform.rotate(m_Direction);
-
- // The XY plane is going to be a plane with either positive or negative Z direction that runs
- // through
- QT3DSVec3 theDirection(0, 0, 1);
- QT3DSVec3 theRight(1, 0, 0);
- QT3DSVec3 theUp(0, 1, 0);
- switch (inPlane) {
- case SBasisPlanes::XY:
- break;
- case SBasisPlanes::XZ:
- theDirection = QT3DSVec3(0, 1, 0);
- theUp = QT3DSVec3(0, 0, 1);
- break;
- case SBasisPlanes::YZ:
- theDirection = QT3DSVec3(1, 0, 0);
- theRight = QT3DSVec3(0, 0, 1);
- break;
- }
- NVPlane thePlane(theDirection, theDirection.dot(theTransformedDirection) > 0.0f
- ? theDirection.dot(inBounds.maximum)
- : theDirection.dot(inBounds.minimum));
-
- SRay relativeRay(theTransformedOrigin, theTransformedDirection);
- Option<QT3DSVec3> localIsect = relativeRay.Intersect(thePlane);
- if (localIsect.hasValue()) {
- QT3DSF32 xRange = theRight.dot(inBounds.maximum) - theRight.dot(inBounds.minimum);
- QT3DSF32 yRange = theUp.dot(inBounds.maximum) - theUp.dot(inBounds.minimum);
- QT3DSF32 xOrigin = xRange / 2.0f + theRight.dot(inBounds.minimum);
- QT3DSF32 yOrigin = yRange / 2.0f + theUp.dot(inBounds.minimum);
- return QT3DSVec2((theRight.dot(*localIsect) - xOrigin) / xRange,
- (theUp.dot(*localIsect) - yOrigin) / yRange);
- }
- return Empty();
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.h
deleted file mode 100644
index 705f7089..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRay.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_RAY_H
-#define QT3DS_RENDER_RAY_H
-
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSMat44.h"
-#include "foundation/Qt3DSBounds3.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SBasisPlanes
- {
- enum Enum {
- XY = 0,
- YZ,
- XZ,
- };
- };
-
- struct SRayIntersectionResult
- {
- QT3DSF32 m_RayLengthSquared; // Length of the ray in world coordinates for the hit.
- QT3DSVec2 m_RelXY; // UV coords for further mouse picking against a offscreen-rendered object.
- SRayIntersectionResult()
- : m_RayLengthSquared(0)
- , m_RelXY(0, 0)
- {
- }
- SRayIntersectionResult(QT3DSF32 rl, QT3DSVec2 relxy)
- : m_RayLengthSquared(rl)
- , m_RelXY(relxy)
- {
- }
- };
-
- struct SRay
- {
- QT3DSVec3 m_Origin;
- QT3DSVec3 m_Direction;
- SRay()
- : m_Origin(0, 0, 0)
- , m_Direction(0, 0, 0)
- {
- }
- SRay(const QT3DSVec3 &inOrigin, const QT3DSVec3 &inDirection)
- : m_Origin(inOrigin)
- , m_Direction(inDirection)
- {
- }
- // If we are parallel, then no intersection of course.
- Option<QT3DSVec3> Intersect(const NVPlane &inPlane) const;
-
- Option<SRayIntersectionResult> IntersectWithAABB(const QT3DSMat44 &inGlobalTransform,
- const NVBounds3 &inBounds,
- bool inForceIntersect = false) const;
-
- Option<QT3DSVec2> GetRelative(const QT3DSMat44 &inGlobalTransform, const NVBounds3 &inBounds,
- SBasisPlanes::Enum inPlane) const;
-
- Option<QT3DSVec2> GetRelativeXY(const QT3DSMat44 &inGlobalTransform,
- const NVBounds3 &inBounds) const
- {
- return GetRelative(inGlobalTransform, inBounds, SBasisPlanes::XY);
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.cpp
deleted file mode 100644
index 05a7b2c4..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderRenderList.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct SRenderList : public IRenderList
-{
- typedef eastl::pair<QT3DSU32, IRenderTask *> TTaskIdTaskPair;
- typedef nvvector<TTaskIdTaskPair> TTaskList;
-
- NVFoundationBase &m_Foundation;
- TTaskList m_Tasks;
- TTaskList m_PersistentTasks;
- QT3DSU32 m_NextTaskId;
- QT3DSI32 mRefCount;
- bool m_ScissorEnabled;
- NVRenderRect m_ScissorRect;
- NVRenderRect m_Viewport;
-
- SRenderList(NVFoundationBase &fnd)
- : m_Foundation(fnd)
- , m_Tasks(fnd.getAllocator(), "m_Tasks")
- , m_PersistentTasks(fnd.getAllocator(), "m_PersistentTasks")
- , m_NextTaskId(1)
- , mRefCount(0)
- , m_ScissorEnabled(false)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- void BeginFrame() override
- {
- m_NextTaskId = 1;
- m_Tasks.clear();
- }
-
- QT3DSU32 AddRenderTask(IRenderTask &inTask) override
- {
- QT3DSU32 taskId = m_NextTaskId;
- if (inTask.persistent()) {
- m_PersistentTasks.push_back(eastl::make_pair(0, &inTask));
- taskId = 0;
- } else {
- QT3DSU32 taskId = m_NextTaskId;
- ++m_NextTaskId;
- m_Tasks.push_back(eastl::make_pair(taskId, &inTask));
- }
- return taskId;
- }
-
- void DiscardRenderTask(QT3DSU32 inTaskId) override
- {
- TTaskList::iterator iter, end;
- for (iter = m_Tasks.begin(), end = m_Tasks.end(); iter != end && iter->first != inTaskId;
- ++iter) {
- }
- if (iter != end)
- m_Tasks.erase(iter);
- }
- // This runs through the added tasks in reverse order. This is used to render dependencies
- // before rendering to the main render target.
- void RunRenderTasks() override
- {
- for (TTaskList::reverse_iterator iter = m_PersistentTasks.rbegin(),
- end = m_PersistentTasks.rend(); iter != end;
- ++iter) {
- iter->second->Run();
- }
- for (TTaskList::reverse_iterator iter = m_Tasks.rbegin(), end = m_Tasks.rend(); iter != end;
- ++iter) {
- iter->second->Run();
- }
- BeginFrame();
- }
-
- void SetScissorTestEnabled(bool enabled) override { m_ScissorEnabled = enabled; }
- void SetScissorRect(NVRenderRect rect) override { m_ScissorRect = rect; }
- void SetViewport(NVRenderRect rect) override { m_Viewport = rect; }
- bool IsScissorTestEnabled() const override { return m_ScissorEnabled; }
- NVRenderRect GetScissor() const override { return m_ScissorRect; }
- NVRenderRect GetViewport() const override { return m_Viewport; }
-};
-}
-
-IRenderList &IRenderList::CreateRenderList(NVFoundationBase &fnd)
-{
- return *QT3DS_NEW(fnd.getAllocator(), SRenderList)(fnd);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.h
deleted file mode 100644
index 957c3d78..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRenderList.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_RENDER_LIST_H
-#define QT3DS_RENDER_RENDER_LIST_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- class IRenderTask
- {
- public:
- virtual ~IRenderTask() {}
- virtual void Run() = 0;
- virtual bool persistent() const
- {
- return false;
- }
- };
-
- /**
- * The render list exists so that dependencies of the main render target can render themselves
- * completely before the main render target renders. From Maxwell GPU's on, we have a tiled
- * architecture. This tiling mechanism is sensitive to switching the render target, so we would
- * really like to render completely to a single render target and then switch. With our layered
- * render architecture, this is not very feasible unless dependencies render themselves before
- * the
- * main set of layers render themselves. Furthermore it benefits the overall software
- * architecture
- * to have a distinct split between the prepare for render step and the render step and using
- * this
- * render list allows us to avoid some level of repeated tree traversal at the cost of some
- * minimal
- * per frame allocation. The rules for using the render list are that you need to add yourself
- * before
- * your dependencies do; the list is iterated in reverse during RunRenderTasks. So a layer adds
- * itself
- * (if it is going to render offscreen) before it runs through its renderable list to prepare
- * each object
- * because it is during the renderable prepare traversale that subpresentations will get added
- * by
- * the offscreen render manager.
- */
- class IRenderList : public NVRefCounted
- {
- public:
- // Called by the render context, do not call this.
- virtual void BeginFrame() = 0;
-
- // Next tell all sub render target rendering systems to add themselves to the render list.
- // At this point
- // we agree to *not* have rendered anything, no clears or anything so if you are caching
- // render state and you detect nothing has changed it may not be necessary to swap egl
- // buffers.
- virtual QT3DSU32 AddRenderTask(IRenderTask &inTask) = 0;
- virtual void DiscardRenderTask(QT3DSU32 inTaskId) = 0;
- // This runs through the added tasks in reverse order. This is used to render dependencies
- // before rendering to the main render target.
- virtual void RunRenderTasks() = 0;
-
- // We used to use GL state to pass information down the callstack.
- // I have replaced those calls with this state here because that information
- // controls how layers size themselves (which is quite a complicated process).
- virtual void SetScissorTestEnabled(bool enabled) = 0;
- virtual void SetScissorRect(NVRenderRect rect) = 0;
- virtual void SetViewport(NVRenderRect rect) = 0;
- virtual bool IsScissorTestEnabled() const = 0;
- virtual NVRenderRect GetScissor() const = 0;
- virtual NVRenderRect GetViewport() const = 0;
-
- static IRenderList &CreateRenderList(NVFoundationBase &inFnd);
- };
-
- // Now for scoped property access.
- template <typename TDataType>
- struct SRenderListScopedProperty
- : public qt3ds::render::NVRenderGenericScopedProperty<IRenderList, TDataType>
- {
- typedef qt3ds::render::NVRenderGenericScopedProperty<IRenderList, TDataType> TBaseType;
- typedef typename TBaseType::TGetter TGetter;
- typedef typename TBaseType::TSetter TSetter;
- SRenderListScopedProperty(IRenderList &ctx, TGetter getter, TSetter setter)
- : TBaseType(ctx, getter, setter)
- {
- }
- SRenderListScopedProperty(IRenderList &ctx, TGetter getter, TSetter setter,
- const TDataType &inNewValue)
- : TBaseType(ctx, getter, setter, inNewValue)
- {
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRotationHelper.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRotationHelper.h
deleted file mode 100644
index 19ba8eb7..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderRotationHelper.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_ROTATION_HELPER_H
-#define QT3DS_RENDER_ROTATION_HELPER_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderNode.h"
-#include "EASTL/utility.h"
-
-namespace qt3ds {
-namespace render {
- /**
- * Unfortunately we still use an XYZ-Euler rotation system. This means that identical
- *rotations
- * can be represented in various ways. We need to ensure that the value that we write in the
- * inspector palette are reasonable, however, and to do this we need a least-distance function
- * from two different xyz tuples.
- */
-
- struct SRotationHelper
- {
-
- // Attempt to go for negative values intead of large positive ones
- // Goal is to keep the fabs of the angle low.
- static QT3DSF32 ToMinimalAngle(QT3DSF32 value)
- {
- QT3DSF32 epsilon = (QT3DSF32)M_PI + .001f;
- while (fabs(value) > epsilon) {
- QT3DSF32 tpi = (QT3DSF32)(2.0f * M_PI);
- if (value > 0.0f)
- value -= tpi;
- else
- value += tpi;
- }
- return value;
- }
-
- /**
- * Convert an angle to a canonical form. Return this canonical form.
- *
- * The canonical form is defined as:
- * 1. XYZ all positive.
- * 2. XYZ all less than 360.
- *
- * To do this we rely on two identities, the first is that given an angle, adding
- * (or subtracting) pi from all three components does not change the angle.
- *
- * The second is the obvious one that adding or subtracting 2*pi from any single
- * component does not change the angle.
- *
- * Note that this function works in radian space.
- */
- static QT3DSVec3 ToCanonicalFormStaticAxis(const QT3DSVec3 &inSrcAngle, QT3DSU32 inRotOrder)
- {
- // step 1 - reduce all components to less than 2*pi but greater than 0
- QT3DSVec3 retval(inSrcAngle);
- retval.x = ToMinimalAngle(retval.x);
- retval.y = ToMinimalAngle(retval.y);
- retval.z = ToMinimalAngle(retval.z);
-
- // step 2 - if any two components are equal to or greater than pi
- // then subtract pi from all three, then run two pi reduce again.
-
- QT3DSU32 greaterThanPiSum = 0;
- QT3DSF32 pi = (QT3DSF32)M_PI;
- for (QT3DSU32 idx = 0; idx < 3; ++idx)
- if (fabs(retval[idx]) >= pi)
- greaterThanPiSum++;
-
- if (greaterThanPiSum > 1) {
- // For this identity to work, the middle axis angle needs to be subtracted from
- // 180 instead of added to 180 because the previous axis *reversed* it.
- QT3DSU32 theMiddleAxis = 0;
-
- switch (inRotOrder) {
- case EulOrdXYZs:
- theMiddleAxis = 1;
- break;
- case EulOrdXZYs:
- theMiddleAxis = 2;
- break;
- case EulOrdYXZs:
- theMiddleAxis = 0;
- break;
- case EulOrdYZXs:
- theMiddleAxis = 2;
- break;
- case EulOrdZYXs:
- theMiddleAxis = 1;
- break;
- case EulOrdZXYs:
- theMiddleAxis = 0;
- break;
- case EulOrdXYZr:
- theMiddleAxis = 1;
- break;
- case EulOrdXZYr:
- theMiddleAxis = 2;
- break;
- case EulOrdYXZr:
- theMiddleAxis = 0;
- break;
- case EulOrdYZXr:
- theMiddleAxis = 2;
- break;
- case EulOrdZYXr:
- theMiddleAxis = 1;
- break;
- case EulOrdZXYr:
- theMiddleAxis = 0;
- break;
- default:
- QT3DS_ASSERT(false);
- return inSrcAngle;
- }
- for (QT3DSU32 idx = 0; idx < 3; ++idx) {
- if (idx == theMiddleAxis)
- retval[idx] = pi - retval[idx];
- else
- retval[idx] = retval[idx] > 0.0f ? retval[idx] - pi : retval[idx] + pi;
- }
- }
- return retval;
- }
-
- static QT3DSVec3 ToMinimalAngleDiff(const QT3DSVec3 inDiff)
- {
- return QT3DSVec3(ToMinimalAngle(inDiff.x), ToMinimalAngle(inDiff.y),
- ToMinimalAngle(inDiff.z));
- }
-
- /**
- * Given an old angle and a new angle, return an angle has the same rotational value
- * as the new angle *but* is as close to the old angle as possible.
- * Works in radian space. This function doesn't currently work for euler angles or
- * with Euler angles with repeating axis.
- */
- static QT3DSVec3 ToNearestAngle(const QT3DSVec3 &inOldAngle, const QT3DSVec3 &inNewAngle,
- QT3DSU32 inRotOrder)
- {
- switch (inRotOrder) {
- case EulOrdXYZs:
- case EulOrdXZYs:
- case EulOrdYXZs:
- case EulOrdYZXs:
- case EulOrdZYXs:
- case EulOrdZXYs:
- case EulOrdXYZr:
- case EulOrdXZYr:
- case EulOrdYXZr:
- case EulOrdYZXr:
- case EulOrdZYXr:
- case EulOrdZXYr: {
- QT3DSVec3 oldA = ToCanonicalFormStaticAxis(inOldAngle, inRotOrder);
- QT3DSVec3 newA = ToCanonicalFormStaticAxis(inNewAngle, inRotOrder);
- QT3DSVec3 diff = newA - oldA;
- return inOldAngle + ToMinimalAngleDiff(diff);
- } break;
- default:
- return inNewAngle;
- }
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.cpp
deleted file mode 100644
index 77d4ee64..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.cpp
+++ /dev/null
@@ -1,770 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderShaderCache.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "StringTools.h"
-#include "foundation/XML.h"
-#include "foundation/IOStreams.h"
-#include "foundation/StringConversionImpl.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "foundation/FileTools.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderer.h"
-#include <memory>
-#include "foundation/Qt3DSTime.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "EASTL/sort.h"
-
-#include <QRegularExpression>
-#include <QString>
-
-using namespace qt3ds::render;
-
-namespace {
-using qt3ds::render::NVRenderContextScopedProperty;
-const char *TessellationEnabledStr = "TessellationStageEnabled";
-const char *GeometryEnabledStr = "GeometryStageEnabled";
-inline void AppendFlagValue(Qt3DSString &inStr, const char *flag)
-{
- if (inStr.length())
- inStr.append(QLatin1Char(','));
- inStr.append(flag);
-}
-inline void CacheFlagsToStr(const SShaderCacheProgramFlags &inFlags, Qt3DSString &inString)
-{
- inString.clear();
- if (inFlags.IsTessellationEnabled())
- AppendFlagValue(inString, TessellationEnabledStr);
- if (inFlags.IsGeometryShaderEnabled())
- AppendFlagValue(inString, GeometryEnabledStr);
-}
-
-struct ShaderType
-{
- enum Enum { Vertex, TessControl, TessEval, Fragment, Geometry, Compute };
-};
-
-inline ShaderType::Enum StringToShaderType(Qt3DSString &inShaderType)
-{
- ShaderType::Enum retval = ShaderType::Vertex;
-
- if (inShaderType.size() == 0)
- return retval;
-
- if (!inShaderType.compare("VertexCode"))
- retval = ShaderType::Vertex;
- else if (!inShaderType.compare("FragmentCode"))
- retval = ShaderType::Fragment;
- else if (!inShaderType.compare("TessControlCode"))
- retval = ShaderType::TessControl;
- else if (!inShaderType.compare("TessEvalCode"))
- retval = ShaderType::TessEval;
- else if (!inShaderType.compare("GeometryCode"))
- retval = ShaderType::Geometry;
- else
- QT3DS_ASSERT(false);
-
- return retval;
-}
-
-inline SShaderCacheProgramFlags CacheFlagsToStr(const Qt3DSString &inString)
-{
- SShaderCacheProgramFlags retval;
- if (inString.indexOf(TessellationEnabledStr) != Qt3DSString::npos)
- retval.SetTessellationEnabled(true);
- if (inString.indexOf(GeometryEnabledStr) != Qt3DSString::npos)
- retval.SetGeometryShaderEnabled(true);
- return retval;
-}
-
-typedef eastl::pair<const char *, NVRenderContextValues::Enum> TStringToContextValuePair;
-
-/*GLES2 = 1 << 0,
-GL2 = 1 << 1,
-GLES3 = 1 << 2,
-GL3 = 1 << 3,
-GL4 = 1 << 4,
-NullContext = 1 << 5,*/
-TStringToContextValuePair g_StringToContextTypeValue[] = {
- TStringToContextValuePair("GLES2", NVRenderContextValues::GLES2),
- TStringToContextValuePair("GL2", NVRenderContextValues::GL2),
- TStringToContextValuePair("GLES3", NVRenderContextValues::GLES3),
- TStringToContextValuePair("GLES3PLUS", NVRenderContextValues::GLES3PLUS),
- TStringToContextValuePair("GL3", NVRenderContextValues::GL3),
- TStringToContextValuePair("GL4", NVRenderContextValues::GL4),
- TStringToContextValuePair("NullContext", NVRenderContextValues::NullContext),
-};
-
-size_t g_NumStringToContextValueEntries =
- sizeof(g_StringToContextTypeValue) / sizeof(*g_StringToContextTypeValue);
-
-inline void ContextTypeToString(qt3ds::render::NVRenderContextType inType,
- Qt3DSString &outContextType)
-{
- outContextType.clear();
- for (size_t idx = 0, end = g_NumStringToContextValueEntries; idx < end; ++idx) {
- if (inType & g_StringToContextTypeValue[idx].second) {
- if (outContextType.size())
- outContextType.append('|');
- outContextType.append(g_StringToContextTypeValue[idx].first);
- }
- }
-}
-
-inline qt3ds::render::NVRenderContextType StringToContextType(const Qt3DSString &inContextType)
-{
- qt3ds::render::NVRenderContextType retval;
- char tempBuffer[128];
- memZero(tempBuffer, 128);
- const QString::size_type lastTempBufIdx = 127;
- QString::size_type pos = 0, lastpos = 0;
- if (inContextType.size() == 0)
- return retval;
-
- do {
- pos = int(inContextType.indexOf(QLatin1Char('|'), lastpos));
- if (pos == Qt3DSString::npos)
- pos = int(inContextType.size());
- {
-
- QString::size_type sectionLen = NVMin(pos - lastpos, lastTempBufIdx);
- qt3ds::intrinsics::memCopy(tempBuffer, inContextType.toUtf8().constData() + lastpos,
- sectionLen);
- tempBuffer[lastTempBufIdx] = 0;
- for (size_t idx = 0, end = g_NumStringToContextValueEntries; idx < end; ++idx) {
- if (strcmp(g_StringToContextTypeValue[idx].first, tempBuffer) == 0)
- retval = retval | g_StringToContextTypeValue[idx].second;
- }
- }
- // iterate past the bar
- ++pos;
- lastpos = pos;
- } while (pos < inContextType.size() && pos != Qt3DSString::npos);
-
- return retval;
-}
-
-struct SShaderCacheKey
-{
- CRegisteredString m_Key;
- eastl::vector<SShaderPreprocessorFeature> m_Features;
- size_t m_HashCode;
-
- SShaderCacheKey(CRegisteredString key = CRegisteredString())
- : m_Key(key)
- , m_HashCode(0)
- {
- }
-
- SShaderCacheKey(const SShaderCacheKey &other)
- : m_Key(other.m_Key)
- , m_Features(other.m_Features)
- , m_HashCode(other.m_HashCode)
- {
- }
-
- SShaderCacheKey &operator=(const SShaderCacheKey &other)
- {
- m_Key = other.m_Key;
- m_Features = other.m_Features;
- m_HashCode = other.m_HashCode;
- return *this;
- }
-
- void GenerateHashCode()
- {
- m_HashCode = m_Key.hash();
- m_HashCode = m_HashCode
- ^ HashShaderFeatureSet(toDataRef(m_Features.data(), (QT3DSU32)m_Features.size()));
- }
- bool operator==(const SShaderCacheKey &inOther) const
- {
- return m_Key == inOther.m_Key && m_Features == inOther.m_Features;
- }
-};
-}
-
-namespace eastl {
-template <>
-struct hash<SShaderCacheKey>
-{
- size_t operator()(const SShaderCacheKey &inKey) const { return inKey.m_HashCode; }
-};
-}
-
-namespace {
-
-struct ShaderCache : public IShaderCache
-{
- typedef nvhash_map<SShaderCacheKey, NVScopedRefCounted<NVRenderShaderProgram>> TShaderMap;
- NVRenderContext &m_RenderContext;
- IPerfTimer &m_PerfTimer;
- TShaderMap m_Shaders;
- Qt3DSString m_CacheFilePath;
- Qt3DSString m_VertexCode;
- Qt3DSString m_TessCtrlCode;
- Qt3DSString m_TessEvalCode;
- Qt3DSString m_GeometryCode;
- Qt3DSString m_FragmentCode;
- Qt3DSString m_InsertStr;
- Qt3DSString m_FlagString;
- Qt3DSString m_ContextTypeString;
- SShaderCacheKey m_TempKey;
-
- NVScopedRefCounted<IDOMWriter> m_ShaderCache;
- IInputStreamFactory &m_InputStreamFactory;
- bool m_ShaderCompilationEnabled;
- volatile QT3DSI32 mRefCount;
-
- ShaderCache(NVRenderContext &ctx, IInputStreamFactory &inInputStreamFactory,
- IPerfTimer &inPerfTimer)
- : m_RenderContext(ctx)
- , m_PerfTimer(inPerfTimer)
- , m_Shaders(ctx.GetAllocator(), "ShaderCache::m_Shaders")
- , m_InputStreamFactory(inInputStreamFactory)
- , m_ShaderCompilationEnabled(true)
- , mRefCount(0)
- {
- }
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext.GetAllocator())
-
- NVRenderShaderProgram *GetProgram(CRegisteredString inKey,
- NVConstDataRef<SShaderPreprocessorFeature> inFeatures) override
- {
- m_TempKey.m_Key = inKey;
- m_TempKey.m_Features.assign(inFeatures.begin(), inFeatures.end());
- m_TempKey.GenerateHashCode();
- TShaderMap::iterator theIter = m_Shaders.find(m_TempKey);
- if (theIter != m_Shaders.end())
- return theIter->second;
- return NULL;
- }
-
- void AddBackwardCompatibilityDefines(ShaderType::Enum shaderType)
- {
- if (shaderType == ShaderType::Vertex || shaderType == ShaderType::TessControl
- || shaderType == ShaderType::TessEval || shaderType == ShaderType::Geometry) {
- m_InsertStr += "#define attribute in\n";
- m_InsertStr += "#define varying out\n";
- } else if (shaderType == ShaderType::Fragment) {
- m_InsertStr += "#define varying in\n";
- m_InsertStr += "#define texture2D texture\n";
- m_InsertStr += "#define gl_FragColor fragOutput\n";
-
- if (m_RenderContext.IsAdvancedBlendHwSupportedKHR())
- m_InsertStr += "layout(blend_support_all_equations) out;\n";
-
- m_InsertStr += "#ifndef NO_FRAG_OUTPUT\n";
- m_InsertStr += "out vec4 fragOutput;\n";
- m_InsertStr += "#endif\n";
- }
- }
-
- void AddShaderExtensionStrings(ShaderType::Enum shaderType, bool isGLES)
- {
- if (isGLES) {
- if (m_RenderContext.IsStandardDerivativesSupported())
- m_InsertStr += "#extension GL_OES_standard_derivatives : enable\n";
- else
- m_InsertStr += "#extension GL_OES_standard_derivatives : disable\n";
- }
-
- if (IQt3DSRenderer::IsGlEs3Context(m_RenderContext.GetRenderContextType())) {
- if (shaderType == ShaderType::TessControl || shaderType == ShaderType::TessEval) {
- m_InsertStr += "#extension GL_EXT_tessellation_shader : enable\n";
- } else if (shaderType == ShaderType::Geometry) {
- m_InsertStr += "#extension GL_EXT_geometry_shader : enable\n";
- } else if (shaderType == ShaderType::Vertex || shaderType == ShaderType::Fragment) {
- if (m_RenderContext.GetRenderBackendCap(render::NVRenderBackend::NVRenderBackendCaps::gpuShader5))
- m_InsertStr += "#extension GL_EXT_gpu_shader5 : enable\n";
- if (m_RenderContext.IsAdvancedBlendHwSupportedKHR())
- m_InsertStr += "#extension GL_KHR_blend_equation_advanced : enable\n";
- }
- } else {
- if (shaderType == ShaderType::Vertex || shaderType == ShaderType::Fragment
- || shaderType == ShaderType::Geometry) {
- if (m_RenderContext.GetRenderContextType() != NVRenderContextValues::GLES2) {
- m_InsertStr += "#extension GL_ARB_gpu_shader5 : enable\n";
- m_InsertStr += "#extension GL_ARB_shading_language_420pack : enable\n";
- }
- if (isGLES && m_RenderContext.IsTextureLodSupported())
- m_InsertStr += "#extension GL_EXT_shader_texture_lod : enable\n";
- if (m_RenderContext.IsShaderImageLoadStoreSupported())
- m_InsertStr += "#extension GL_ARB_shader_image_load_store : enable\n";
- if (m_RenderContext.IsAtomicCounterBufferSupported())
- m_InsertStr += "#extension GL_ARB_shader_atomic_counters : enable\n";
- if (m_RenderContext.IsStorageBufferSupported())
- m_InsertStr += "#extension GL_ARB_shader_storage_buffer_object : enable\n";
- if (m_RenderContext.IsAdvancedBlendHwSupportedKHR())
- m_InsertStr += "#extension GL_KHR_blend_equation_advanced : enable\n";
- }
- }
- }
-
- void AddShaderPreprocessor(Qt3DSString &str, CRegisteredString inKey,
- ShaderType::Enum shaderType,
- NVConstDataRef<SShaderPreprocessorFeature> inFeatures)
- {
- // Don't use shading language version returned by the driver as it might
- // differ from the context version. Instead use the context type to specify
- // the version string.
- bool isGlES = IQt3DSRenderer::IsGlEsContext(m_RenderContext.GetRenderContextType());
- m_InsertStr.clear();
- int minor = m_RenderContext.format().minorVersion();
- QString versionStr;
- QTextStream stream(&versionStr);
- stream << "#version ";
- const QT3DSU32 type = (QT3DSU32)m_RenderContext.GetRenderContextType();
- switch (type) {
- case NVRenderContextValues::GLES2:
- stream << "1" << minor << "0\n";
- break;
- case NVRenderContextValues::GL2:
- stream << "1" << minor << "0\n";
- break;
- case NVRenderContextValues::GLES3PLUS:
- case NVRenderContextValues::GLES3:
- stream << "3" << minor << "0 es\n";
- break;
- case NVRenderContextValues::GL3:
- if (minor == 3)
- stream << "3" << minor << "0\n";
- else
- stream << "1" << 3 + minor << "0\n";
- break;
- case NVRenderContextValues::GL4:
- stream << "4" << minor << "0\n";
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- m_InsertStr.append(versionStr.toLatin1().data());
-
- if (inFeatures.size()) {
- for (QT3DSU32 idx = 0, end = inFeatures.size(); idx < end; ++idx) {
- SShaderPreprocessorFeature feature(inFeatures[idx]);
- m_InsertStr.append("#define ");
- m_InsertStr.append(inFeatures[idx].m_Name.c_str());
- m_InsertStr.append(" ");
- m_InsertStr.append(feature.m_Enabled ? "1" : "0");
- m_InsertStr.append("\n");
- }
- }
-
- if (isGlES) {
- if (!IQt3DSRenderer::IsGlEs3Context(m_RenderContext.GetRenderContextType())) {
- if (shaderType == ShaderType::Fragment) {
- m_InsertStr += "#define fragOutput gl_FragData[0]\n";
- }
- } else {
- m_InsertStr += "#define texture2D texture\n";
- }
-
- // add extenions strings before any other non-processor token
- AddShaderExtensionStrings(shaderType, isGlES);
-
- // add precision qualifier depending on backend
- if (IQt3DSRenderer::IsGlEs3Context(m_RenderContext.GetRenderContextType())) {
- m_InsertStr.append("precision highp float;\n"
- "precision highp int;\n");
- if( m_RenderContext.GetRenderBackendCap(render::NVRenderBackend::NVRenderBackendCaps::gpuShader5) ) {
- m_InsertStr.append("precision mediump sampler2D;\n"
- "precision mediump sampler2DArray;\n"
- "precision mediump sampler2DShadow;\n");
- if (m_RenderContext.IsShaderImageLoadStoreSupported()) {
- m_InsertStr.append("precision mediump image2D;\n");
- }
- }
-
- AddBackwardCompatibilityDefines(shaderType);
- } else {
- // GLES2
- m_InsertStr.append("precision mediump float;\n"
- "precision mediump int;\n"
- "#define texture texture2D\n");
- if (m_RenderContext.IsTextureLodSupported())
- m_InsertStr.append("#define textureLod texture2DLodEXT\n");
- else
- m_InsertStr.append("#define textureLod(s, co, lod) texture2D(s, co)\n");
- }
- } else {
- if (!IQt3DSRenderer::IsGl2Context(m_RenderContext.GetRenderContextType())) {
- m_InsertStr += "#define texture2D texture\n";
-
- AddShaderExtensionStrings(shaderType, isGlES);
-
- m_InsertStr += "#if __VERSION__ >= 330\n";
-
- AddBackwardCompatibilityDefines(shaderType);
-
- m_InsertStr += "#else\n";
- if (shaderType == ShaderType::Fragment) {
- m_InsertStr += "#define fragOutput gl_FragData[0]\n";
- }
- m_InsertStr += "#endif\n";
- }
- }
-
- if (inKey.IsValid()) {
- m_InsertStr += "//Shader name -";
- m_InsertStr += inKey.c_str();
- m_InsertStr += "\n";
- }
-
- if (shaderType == ShaderType::TessControl) {
- m_InsertStr += "#define TESSELLATION_CONTROL_SHADER 1\n";
- m_InsertStr += "#define TESSELLATION_EVALUATION_SHADER 0\n";
- } else if (shaderType == ShaderType::TessEval) {
- m_InsertStr += "#define TESSELLATION_CONTROL_SHADER 0\n";
- m_InsertStr += "#define TESSELLATION_EVALUATION_SHADER 1\n";
- }
-
- str.insert(0, m_InsertStr);
- }
- // Compile this program overwriting any existing ones.
- NVRenderShaderProgram *
- ForceCompileProgram(CRegisteredString inKey, const char8_t *inVert, const char8_t *inFrag,
- const char8_t *inTessCtrl, const char8_t *inTessEval, const char8_t *inGeom,
- const SShaderCacheProgramFlags &inFlags,
- NVConstDataRef<SShaderPreprocessorFeature> inFeatures,
- bool separableProgram, bool fromDisk = false) override
- {
- if (m_ShaderCompilationEnabled == false)
- return NULL;
- SShaderCacheKey tempKey(inKey);
- tempKey.m_Features.assign(inFeatures.begin(), inFeatures.end());
- tempKey.GenerateHashCode();
-
- eastl::pair<TShaderMap::iterator, bool> theInserter = m_Shaders.insert(tempKey);
- if (fromDisk) {
- qCInfo(TRACE_INFO) << "Loading from persistent shader cache: '<"
- << tempKey.m_Key << ">'";
- } else {
- qCInfo(TRACE_INFO) << "Compiling into shader cache: '"
- << tempKey.m_Key << ">'";
- }
-
- if (!inVert)
- inVert = "";
- if (!inTessCtrl)
- inTessCtrl = "";
- if (!inTessEval)
- inTessEval = "";
- if (!inGeom)
- inGeom = "";
- if (!inFrag)
- inFrag = "";
-
- SStackPerfTimer __perfTimer(m_PerfTimer, "Shader Compilation");
- m_VertexCode.assign(inVert);
- m_TessCtrlCode.assign(inTessCtrl);
- m_TessEvalCode.assign(inTessEval);
- m_GeometryCode.assign(inGeom);
- m_FragmentCode.assign(inFrag);
- // Add defines and such so we can write unified shaders that work across platforms.
- // vertex and fragment shaders are optional for separable shaders
- if (!separableProgram || !m_VertexCode.isEmpty())
- AddShaderPreprocessor(m_VertexCode, inKey, ShaderType::Vertex, inFeatures);
- if (!separableProgram || !m_FragmentCode.isEmpty())
- AddShaderPreprocessor(m_FragmentCode, inKey, ShaderType::Fragment, inFeatures);
- // optional shaders
- if (inFlags.IsTessellationEnabled()) {
- QT3DS_ASSERT(m_TessCtrlCode.size() && m_TessEvalCode.size());
- AddShaderPreprocessor(m_TessCtrlCode, inKey, ShaderType::TessControl, inFeatures);
- AddShaderPreprocessor(m_TessEvalCode, inKey, ShaderType::TessEval, inFeatures);
- }
- if (inFlags.IsGeometryShaderEnabled())
- AddShaderPreprocessor(m_GeometryCode, inKey, ShaderType::Geometry, inFeatures);
-
- theInserter.first->second =
- m_RenderContext
- .CompileSource(inKey, m_VertexCode.c_str(), QT3DSU32(m_VertexCode.size()),
- m_FragmentCode.c_str(), QT3DSU32(m_FragmentCode.size()),
- m_TessCtrlCode.c_str(), QT3DSU32(m_TessCtrlCode.size()),
- m_TessEvalCode.c_str(), QT3DSU32(m_TessEvalCode.size()),
- m_GeometryCode.c_str(), QT3DSU32(m_GeometryCode.size()),
- separableProgram).mShader;
- if (theInserter.first->second) {
- if (m_ShaderCache) {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "Program");
- m_ShaderCache->Att("key", inKey.c_str());
- CacheFlagsToStr(inFlags, m_FlagString);
- if (m_FlagString.size())
- m_ShaderCache->Att("glflags", m_FlagString.c_str());
- // write out the GL version.
- {
- qt3ds::render::NVRenderContextType theContextType =
- m_RenderContext.GetRenderContextType();
- ContextTypeToString(theContextType, m_ContextTypeString);
- m_ShaderCache->Att("gl-context-type", m_ContextTypeString.c_str());
- }
- if (inFeatures.size()) {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "Features");
- for (QT3DSU32 idx = 0, end = inFeatures.size(); idx < end; ++idx) {
- m_ShaderCache->Att(inFeatures[idx].m_Name, inFeatures[idx].m_Enabled);
- }
- }
-
- {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "VertexCode");
- m_ShaderCache->Value(inVert);
- }
- {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "FragmentCode");
- m_ShaderCache->Value(inFrag);
- }
- if (m_TessCtrlCode.size()) {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "TessControlCode");
- m_ShaderCache->Value(inTessCtrl);
- }
- if (m_TessEvalCode.size()) {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "TessEvalCode");
- m_ShaderCache->Value(inTessEval);
- }
- if (m_GeometryCode.size()) {
- IDOMWriter::Scope __writeScope(*m_ShaderCache, "GeometryCode");
- m_ShaderCache->Value(inGeom);
- }
- }
- }
- return theInserter.first->second;
- }
-
- virtual NVRenderShaderProgram *
- CompileProgram(CRegisteredString inKey, const char8_t *inVert, const char8_t *inFrag,
- const char8_t *inTessCtrl, const char8_t *inTessEval, const char8_t *inGeom,
- const SShaderCacheProgramFlags &inFlags,
- NVConstDataRef<SShaderPreprocessorFeature> inFeatures, bool separableProgram) override
- {
- NVRenderShaderProgram *theProgram = GetProgram(inKey, inFeatures);
- if (theProgram)
- return theProgram;
-
- NVRenderShaderProgram *retval =
- ForceCompileProgram(inKey, inVert, inFrag, inTessCtrl, inTessEval, inGeom, inFlags,
- inFeatures, separableProgram);
- if (m_CacheFilePath.c_str() && m_ShaderCache && m_ShaderCompilationEnabled) {
- CFileSeekableIOStream theStream(m_CacheFilePath.c_str(), FileWriteFlags());
- if (theStream.IsOpen()) {
- NVScopedRefCounted<IStringTable> theStringTable(
- IStringTable::CreateStringTable(m_RenderContext.GetAllocator()));
- CDOMSerializer::WriteXMLHeader(theStream);
- CDOMSerializer::Write(m_RenderContext.GetAllocator(),
- *m_ShaderCache->GetTopElement(), theStream, *theStringTable);
- }
- }
- return retval;
- }
-
- void BootupDOMWriter()
- {
- NVScopedRefCounted<IStringTable> theStringTable(
- IStringTable::CreateStringTable(m_RenderContext.GetAllocator()));
- m_ShaderCache = IDOMWriter::CreateDOMWriter(m_RenderContext.GetAllocator(),
- "Qt3DSShaderCache", theStringTable)
- .first;
- m_ShaderCache->Att("cache_version", IShaderCache::GetShaderVersion());
- }
-
- void SetShaderCachePersistenceEnabled(const char8_t *inDirectory) override
- {
- if (inDirectory == NULL) {
- m_ShaderCache = NULL;
- return;
- }
- BootupDOMWriter();
- m_CacheFilePath = QDir(inDirectory).filePath(GetShaderCacheFileName());
-
- NVScopedRefCounted<IRefCountedInputStream> theInStream =
- m_InputStreamFactory.GetStreamForFile(m_CacheFilePath.c_str());
- if (theInStream) {
- SStackPerfTimer __perfTimer(m_PerfTimer, "ShaderCache - Load");
- NVScopedRefCounted<IStringTable> theStringTable(
- IStringTable::CreateStringTable(m_RenderContext.GetAllocator()));
- NVScopedRefCounted<IDOMFactory> theFactory(
- IDOMFactory::CreateDOMFactory(m_RenderContext.GetAllocator(), theStringTable));
- eastl::vector<SShaderPreprocessorFeature> theFeatures;
-
- SDOMElement *theElem = CDOMSerializer::Read(*theFactory, *theInStream).second;
- if (theElem) {
- NVScopedRefCounted<IDOMReader> theReader = IDOMReader::CreateDOMReader(
- m_RenderContext.GetAllocator(), *theElem, theStringTable, theFactory);
- QT3DSU32 theAttValue = 0;
- theReader->Att("cache_version", theAttValue);
- if (theAttValue == IShaderCache::GetShaderVersion()) {
- Qt3DSString loadVertexData;
- Qt3DSString loadFragmentData;
- Qt3DSString loadTessControlData;
- Qt3DSString loadTessEvalData;
- Qt3DSString loadGeometryData;
- Qt3DSString shaderTypeString;
- IStringTable &theStringTable(m_RenderContext.GetStringTable());
- for (bool success = theReader->MoveToFirstChild(); success;
- success = theReader->MoveToNextSibling()) {
- const char8_t *theKeyStr = NULL;
- theReader->UnregisteredAtt("key", theKeyStr);
-
- CRegisteredString theKey = theStringTable.RegisterStr(theKeyStr);
- if (theKey.IsValid()) {
- m_FlagString.clear();
- const char8_t *theFlagStr = "";
- SShaderCacheProgramFlags theFlags;
- if (theReader->UnregisteredAtt("glflags", theFlagStr)) {
- m_FlagString.assign(theFlagStr);
- theFlags = CacheFlagsToStr(m_FlagString);
- }
-
- m_ContextTypeString.clear();
- if (theReader->UnregisteredAtt("gl-context-type", theFlagStr))
- m_ContextTypeString.assign(theFlagStr);
-
- theFeatures.clear();
- {
- IDOMReader::Scope __featureScope(*theReader);
- if (theReader->MoveToFirstChild("Features")) {
- for (SDOMAttribute *theAttribute =
- theReader->GetFirstAttribute();
- theAttribute;
- theAttribute = theAttribute->m_NextAttribute) {
- bool featureValue = false;
- StringConversion<bool>().StrTo(theAttribute->m_Value,
- featureValue);
- theFeatures.push_back(SShaderPreprocessorFeature(
- theStringTable.RegisterStr(
- theAttribute->m_Name.c_str()),
- featureValue));
- }
- }
- }
-
- qt3ds::render::NVRenderContextType theContextType =
- StringToContextType(m_ContextTypeString);
- if (((QT3DSU32)theContextType != 0)
- && (theContextType & m_RenderContext.GetRenderContextType())
- == theContextType) {
- IDOMReader::Scope __readerScope(*theReader);
- loadVertexData.clear();
- loadFragmentData.clear();
- loadTessControlData.clear();
- loadTessEvalData.clear();
- loadGeometryData.clear();
-
- // Vertex *MUST* be the first
- // Todo deal with pure compute shader programs
- if (theReader->MoveToFirstChild("VertexCode")) {
- const char8_t *theValue = NULL;
- theReader->Value(theValue);
- loadVertexData.assign(theValue);
- while (theReader->MoveToNextSibling()) {
- theReader->Value(theValue);
-
- shaderTypeString.assign(
- theReader->GetElementName().c_str());
- ShaderType::Enum shaderType =
- StringToShaderType(shaderTypeString);
-
- if (shaderType == ShaderType::Fragment)
- loadFragmentData.assign(theValue);
- else if (shaderType == ShaderType::TessControl)
- loadTessControlData.assign(theValue);
- else if (shaderType == ShaderType::TessEval)
- loadTessEvalData.assign(theValue);
- else if (shaderType == ShaderType::Geometry)
- loadGeometryData.assign(theValue);
- }
- }
-
- if (loadVertexData.size()
- && (loadFragmentData.size() || loadGeometryData.size())) {
-
- NVRenderShaderProgram *theShader = ForceCompileProgram(
- theKey, loadVertexData.c_str(), loadFragmentData.c_str(),
- loadTessControlData.c_str(), loadTessEvalData.c_str(),
- loadGeometryData.c_str(), theFlags,
- qt3ds::foundation::toDataRef(theFeatures.data(),
- (QT3DSU32)theFeatures.size()),
- false, true /*fromDisk*/);
- // If something doesn't save or load correctly, get the runtime
- // to re-generate.
- if (!theShader)
- m_Shaders.erase(theKey);
- }
- }
- }
- }
- }
- }
- }
- }
-
- bool IsShaderCachePersistenceEnabled() const override { return m_ShaderCache != NULL; }
-
- void SetShaderCompilationEnabled(bool inEnableShaderCompilation) override
- {
- m_ShaderCompilationEnabled = inEnableShaderCompilation;
- }
-};
-}
-
-size_t qt3ds::render::HashShaderFeatureSet(NVConstDataRef<SShaderPreprocessorFeature> inFeatureSet)
-{
- size_t retval(0);
- for (QT3DSU32 idx = 0, end = inFeatureSet.size(); idx < end; ++idx) {
- // From previous implementation, it seems we need to ignore the order of the features.
- // But we need to bind the feature flag together with its name, so that the flags will
- // influence
- // the final hash not only by the true-value count.
- retval = retval
- ^ (inFeatureSet[idx].m_Name.hash() * eastl::hash<bool>()(inFeatureSet[idx].m_Enabled));
- }
- return retval;
-}
-
-bool SShaderPreprocessorFeature::operator<(const SShaderPreprocessorFeature &other) const
-{
- return strcmp(m_Name.c_str(), other.m_Name.c_str()) < 0;
-}
-
-bool SShaderPreprocessorFeature::operator==(const SShaderPreprocessorFeature &other) const
-{
- return m_Name == other.m_Name && m_Enabled == other.m_Enabled;
-}
-
-IShaderCache &IShaderCache::CreateShaderCache(NVRenderContext &inContext,
- IInputStreamFactory &inInputStreamFactory,
- IPerfTimer &inPerfTimer)
-{
- return *QT3DS_NEW(inContext.GetAllocator(), ShaderCache)(inContext, inInputStreamFactory,
- inPerfTimer);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.h
deleted file mode 100644
index 47e76f36..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCache.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_CACHE_H
-#define QT3DS_RENDER_SHADER_CACHE_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
- struct ShaderCacheProgramFlagValues
- {
- enum Enum {
- TessellationEnabled = 1 << 0, // tessellation enabled
- GeometryShaderEnabled = 1 << 1, // geometry shader enabled
- };
- };
- struct SShaderCacheProgramFlags : public NVFlags<ShaderCacheProgramFlagValues::Enum, QT3DSU32>
- {
- // tessellation enabled
- void SetTessellationEnabled(bool inValue)
- {
- clearOrSet(inValue, ShaderCacheProgramFlagValues::TessellationEnabled);
- }
- bool IsTessellationEnabled() const
- {
- return this->operator&(ShaderCacheProgramFlagValues::TessellationEnabled);
- }
- // geometry shader enabled
- void SetGeometryShaderEnabled(bool inValue)
- {
- clearOrSet(inValue, ShaderCacheProgramFlagValues::GeometryShaderEnabled);
- }
- bool IsGeometryShaderEnabled() const
- {
- return this->operator&(ShaderCacheProgramFlagValues::GeometryShaderEnabled);
- }
- };
- // There are a number of macros used to turn on or off various features. This allows those
- // features
- // to be propagated into the shader cache's caching mechanism. They will be translated into
- //#define name value where value is 1 or zero depending on if the feature is enabled or not.
- struct SShaderPreprocessorFeature
- {
- CRegisteredString m_Name;
- bool m_Enabled;
- SShaderPreprocessorFeature()
- : m_Enabled(false)
- {
- }
- SShaderPreprocessorFeature(CRegisteredString name, bool val)
- : m_Name(name)
- , m_Enabled(val)
- {
- }
- bool operator<(const SShaderPreprocessorFeature &inOther) const;
- bool operator==(const SShaderPreprocessorFeature &inOther) const;
- };
-
- typedef NVConstDataRef<SShaderPreprocessorFeature> TShaderFeatureSet;
-
- inline TShaderFeatureSet ShaderCacheNoFeatures() { return TShaderFeatureSet(); }
-
- // Hash is dependent on the order of the keys; so make sure their order is consistent!!
- size_t HashShaderFeatureSet(NVConstDataRef<SShaderPreprocessorFeature> inFeatureSet);
-
- class IShaderCache : public NVRefCounted
- {
- protected:
- virtual ~IShaderCache() {}
- public:
- // If directory is nonnull, then we attempt to load any shaders from shadercache.xml in
- // inDirectory
- // and save any new ones out to the same file. The shaders are marked by the gl version
- // used when saving.
- // If we can't open shadercache.xml from inDirectory for writing (at least), then we still
- // consider the
- // shadercache to be disabled.
- // This call immediately blocks and attempts to load all applicable shaders from the
- // shadercache.xml file in
- // the given directory.
- virtual void SetShaderCachePersistenceEnabled(const char8_t *inDirectory) = 0;
- virtual bool IsShaderCachePersistenceEnabled() const = 0;
- // It is up to the caller to ensure that inFeatures contains unique keys.
- // It is also up the the caller to ensure the keys are ordered in some way.
- virtual NVRenderShaderProgram *
- GetProgram(CRegisteredString inKey,
- NVConstDataRef<SShaderPreprocessorFeature> inFeatures) = 0;
-
- // Replace an existing program in the cache for the same key with this program.
- // The shaders returned by *CompileProgram functions can be released by this object
- // due to ForceCompileProgram or SetProjectDirectory, so clients need to either not
- // hold on to them or they need to addref/release them to ensure they still have
- // access to them.
- // The flags just tell us under what gl state to compile the program in order to hopefully
- // reduce program compilations.
- // It is up to the caller to ensure that inFeatures contains unique keys.
- // It is also up the the caller to ensure the keys are ordered in some way.
- virtual NVRenderShaderProgram *
- ForceCompileProgram(CRegisteredString inKey, const char8_t *inVert, const char8_t *inFrag,
- const char8_t *inTessCtrl, const char8_t *inTessEval,
- const char8_t *inGeom, const SShaderCacheProgramFlags &inFlags,
- TShaderFeatureSet inFeatures, bool separableProgram,
- bool fromDisk = false) = 0;
-
- // It is up to the caller to ensure that inFeatures contains unique keys.
- // It is also up the the caller to ensure the keys are ordered in some way.
- virtual NVRenderShaderProgram *
- CompileProgram(CRegisteredString inKey, const char8_t *inVert, const char8_t *inFrag,
- const char8_t *inTessCtrl, const char8_t *inTessEval, const char8_t *inGeom,
- const SShaderCacheProgramFlags &inFlags, TShaderFeatureSet inFeatures,
- bool separableProgram = false) = 0;
-
- // Used to disable any shader compilation during loading. This is used when we are just
- // interested in going from uia->binary
- // and we expect to run on a headless server of sorts. See the UICCompiler project for its
- // only current use case.
- virtual void SetShaderCompilationEnabled(bool inEnableShaderCompilation) = 0;
-
- // Upping the shader version invalidates all previous cache files.
- static QT3DSU32 GetShaderVersion() { return 4; }
- static const char8_t *GetShaderCacheFileName() { return "shadercache.xml"; }
-
- static IShaderCache &CreateShaderCache(NVRenderContext &inContext,
- IInputStreamFactory &inInputStreamFactory,
- IPerfTimer &inPerfTimer);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.cpp
deleted file mode 100644
index d84c37de..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.cpp
+++ /dev/null
@@ -1,526 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderShaderCodeGenerator.h"
-
-using namespace qt3ds::render;
-
-using eastl::make_pair;
-
-SShaderCodeGeneratorBase::SShaderCodeGeneratorBase(IStringTable &inStringTable,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType)
- : m_StringTable(inStringTable)
- , m_Codes(alloc, "SShaderCodeGenerator::m_Codes")
- , m_Includes(alloc, "SShaderCodeGenerator::m_Includes")
- , m_Uniforms(alloc, "SShaderCodeGenerator::m_Uniforms")
- , m_ConstantBuffers(alloc, "SShaderCodeGenerator::m_ConstantBuffers")
- , m_ConstantBufferParams(alloc, "SShaderCodeGenerator::m_ConstantBufferParams")
- , m_Attributes(alloc, "SShaderCodeGenerator::m_Uniforms")
- , m_RenderContextType(ctxType)
-{
-}
-void SShaderCodeGeneratorBase::Begin()
-{
- m_Uniforms.clear();
- GetVaryings().clear();
- m_Attributes.clear();
- m_Includes.clear();
- m_Codes.clear();
- m_FinalShaderBuilder.clear();
- m_CodeBuilder.clear();
- m_ConstantBuffers.clear();
- m_ConstantBufferParams.clear();
-}
-void SShaderCodeGeneratorBase::Append(const char *data)
-{
- m_CodeBuilder.append(data);
- m_CodeBuilder.append("\n");
-}
-// don't add the newline
-void SShaderCodeGeneratorBase::AppendPartial(const char *data)
-{
- m_CodeBuilder.append(data);
-}
-void SShaderCodeGeneratorBase::AddUniform(const char *name, const char *type)
-{
- m_Uniforms.insert(make_pair(m_StringTable.RegisterStr(name), m_StringTable.RegisterStr(type)));
-}
-void SShaderCodeGeneratorBase::AddUniform(TStrType &name, const char *type)
-{
- AddUniform(name.c_str(), type);
-}
-
-void SShaderCodeGeneratorBase::AddConstantBuffer(const char *name, const char *layout)
-{
- m_ConstantBuffers.insert(
- make_pair(m_StringTable.RegisterStr(name), m_StringTable.RegisterStr(layout)));
-}
-void SShaderCodeGeneratorBase::AddConstantBufferParam(const char *cbName, const char *paramName,
- const char *type)
-{
- TParamPair theParamPair(m_StringTable.RegisterStr(paramName), m_StringTable.RegisterStr(type));
- TConstantBufferParamPair theBufferParamPair(m_StringTable.RegisterStr(cbName), theParamPair);
- m_ConstantBufferParams.push_back(theBufferParamPair);
-}
-void SShaderCodeGeneratorBase::AddAttribute(const char *name, const char *type)
-{
- m_Attributes.insert(
- make_pair(m_StringTable.RegisterStr(name), m_StringTable.RegisterStr(type)));
-}
-void SShaderCodeGeneratorBase::AddAttribute(TStrType &name, const char *type)
-{
- AddAttribute(name.c_str(), type);
-}
-void SShaderCodeGeneratorBase::AddVarying(const char *name, const char *type)
-{
- GetVaryings().insert(
- make_pair(m_StringTable.RegisterStr(name), m_StringTable.RegisterStr(type)));
-}
-void SShaderCodeGeneratorBase::AddVarying(TStrType &name, const char *type)
-{
- AddVarying(name.c_str(), type);
-}
-void SShaderCodeGeneratorBase::AddLocalVariable(const char *name, const char *type, int tabCount)
-{
- for (; tabCount >= 0; --tabCount)
- m_CodeBuilder.append("\t");
- m_CodeBuilder.append(type);
- m_CodeBuilder.append(" ");
- m_CodeBuilder.append(name);
- m_CodeBuilder.append(";\n");
-}
-
-void SShaderCodeGeneratorBase::AddInclude(const char *name)
-{
- m_Includes.insert(m_StringTable.RegisterStr(name));
-}
-void SShaderCodeGeneratorBase::AddInclude(TStrType &name)
-{
- AddInclude(name.c_str());
-}
-void SShaderCodeGeneratorBase::AddLocalVariable(TStrType &name, const char *type, int tabCount)
-{
- AddLocalVariable(name.c_str(), type, tabCount);
-}
-bool SShaderCodeGeneratorBase::HasCode(Enum value)
-{
- return m_Codes.contains(value);
-}
-void SShaderCodeGeneratorBase::SetCode(Enum value)
-{
- m_Codes.insert((QT3DSU32)value);
-}
-
-void SShaderCodeGeneratorBase::SetupWorldPosition()
-{
- if (!HasCode(WorldPosition)) {
- SetCode(WorldPosition);
- AddUniform("model_matrix", "mat4");
- Append("\tvec3 varWorldPos = (model_matrix * vec4(attr_pos, 1.0)).xyz;");
- }
-}
-
-void SShaderCodeGeneratorBase::GenerateViewVector()
-{
- if (!HasCode(ViewVector)) {
- SetCode(ViewVector);
- SetupWorldPosition();
- AddInclude("viewProperties.glsllib");
- Append("\tvec3 view_vector = normalize(camera_position - varWorldPos);");
- }
-}
-
-void SShaderCodeGeneratorBase::GenerateWorldNormal()
-{
- if (!HasCode(WorldNormal)) {
- SetCode(WorldNormal);
- AddAttribute("attr_norm", "vec3");
- AddUniform("normal_matrix", "mat3");
- Append("\tvec3 world_normal = normalize(normal_matrix * objectNormal).xyz;");
- }
-}
-
-void SShaderCodeGeneratorBase::GenerateEnvMapReflection(SShaderCodeGeneratorBase &inFragmentShader)
-{
- if (!HasCode(EnvMapReflection)) {
- SetCode(EnvMapReflection);
- SetupWorldPosition();
- GenerateWorldNormal();
- AddInclude("viewProperties.glsllib");
- AddVarying("var_object_to_camera", "vec3");
- Append("\tvar_object_to_camera = normalize( varWorldPos - camera_position );");
- // World normal cannot be relied upon in the vertex shader because of bump maps.
- inFragmentShader.Append("\tvec3 environment_map_reflection = reflect( "
- "vec3(var_object_to_camera.x, var_object_to_camera.y, "
- "var_object_to_camera.z), world_normal.xyz );");
- inFragmentShader.Append("\tenvironment_map_reflection *= vec3( 0.5, 0.5, 0 );");
- inFragmentShader.Append("\tenvironment_map_reflection += vec3( 0.5, 0.5, 1.0 );");
- }
-}
-
-void SShaderCodeGeneratorBase::GenerateUVCoords()
-{
- if (!HasCode(UVCoords)) {
- SetCode(UVCoords);
- AddAttribute("attr_uv0", "vec2");
- Append("\tvec2 uv_coords = attr_uv0;");
- }
-}
-
-void SShaderCodeGeneratorBase::GenerateTextureSwizzle(NVRenderTextureSwizzleMode::Enum swizzleMode,
- eastl::basic_string<char8_t> &texSwizzle,
- eastl::basic_string<char8_t> &lookupSwizzle)
-{
- qt3ds::render::NVRenderContextType deprecatedContextFlags(NVRenderContextValues::GL2
- | NVRenderContextValues::GLES2);
-
- if (!(m_RenderContextType & deprecatedContextFlags)) {
- switch (swizzleMode) {
- case NVRenderTextureSwizzleMode::L8toR8:
- case NVRenderTextureSwizzleMode::L16toR16:
- texSwizzle.append(".rgb");
- lookupSwizzle.append(".rrr");
- break;
- case NVRenderTextureSwizzleMode::L8A8toRG8:
- texSwizzle.append(".rgba");
- lookupSwizzle.append(".rrrg");
- break;
- case NVRenderTextureSwizzleMode::A8toR8:
- texSwizzle.append(".a");
- lookupSwizzle.append(".r");
- break;
- default:
- break;
- }
- }
-}
-
-void SShaderCodeGeneratorBase::GenerateShadedWireframeBase()
-{
- // how this all work see
- // http://developer.download.nvidia.com/SDK/10.5/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf
- Append("// project points to screen space\n"
- "\tvec3 p0 = vec3(viewport_matrix * (gl_in[0].gl_Position / gl_in[0].gl_Position.w));\n"
- "\tvec3 p1 = vec3(viewport_matrix * (gl_in[1].gl_Position / gl_in[1].gl_Position.w));\n"
- "\tvec3 p2 = vec3(viewport_matrix * (gl_in[2].gl_Position / gl_in[2].gl_Position.w));\n"
- "// compute triangle heights\n"
- "\tfloat e1 = length(p1 - p2);\n"
- "\tfloat e2 = length(p2 - p0);\n"
- "\tfloat e3 = length(p1 - p0);\n"
- "\tfloat alpha = acos( (e2*e2 + e3*e3 - e1*e1) / (2.0*e2*e3) );\n"
- "\tfloat beta = acos( (e1*e1 + e3*e3 - e2*e2) / (2.0*e1*e3) );\n"
- "\tfloat ha = abs( e3 * sin( beta ) );\n"
- "\tfloat hb = abs( e3 * sin( alpha ) );\n"
- "\tfloat hc = abs( e2 * sin( alpha ) );\n");
-}
-
-void SShaderCodeGeneratorBase::AddShaderItemMap(const char *itemType,
- const TStrTableStrMap &itemMap)
-{
- m_FinalShaderBuilder.append("\n");
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end(); iter != end;
- ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(";\n");
- }
-}
-
-void SShaderCodeGeneratorBase::AddShaderConstantBufferItemMap(
- const char *itemType, const TStrTableStrMap &cbMap, TConstantBufferParamArray cbParamsArray)
-{
- m_FinalShaderBuilder.append("\n");
-
- // iterate over all constant buffers
- for (TStrTableStrMap::const_iterator iter = cbMap.begin(), end = cbMap.end(); iter != end;
- ++iter) {
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(" {\n");
- // iterate over all param entries and add match
- for (TConstantBufferParamArray::const_iterator iter1 = cbParamsArray.begin(),
- end = cbParamsArray.end();
- iter1 != end; ++iter1) {
- if (iter1->first == iter->first) {
- m_FinalShaderBuilder.append(iter1->second.second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter1->second.first);
- m_FinalShaderBuilder.append(";\n");
- }
- }
-
- m_FinalShaderBuilder.append("};\n");
- }
-}
-
-const char *SShaderCodeGeneratorBase::BuildShaderSource()
-{
- for (nvhash_set<CRegisteredString>::const_iterator iter = m_Includes.begin(),
- end = m_Includes.end();
- iter != end; ++iter) {
- m_FinalShaderBuilder.append("#include \"");
- m_FinalShaderBuilder.append(iter->c_str());
- m_FinalShaderBuilder.append("\"\n");
- }
- AddShaderItemMap("attribute", m_Attributes);
- AddShaderItemMap("uniform", m_Uniforms);
- AddShaderConstantBufferItemMap("uniform", m_ConstantBuffers, m_ConstantBufferParams);
- AddShaderItemMap("varying", GetVaryings());
- m_FinalShaderBuilder.append("\n");
- m_FinalShaderBuilder.append(m_CodeBuilder.c_str());
- return m_FinalShaderBuilder.c_str();
-}
-SShaderCodeGeneratorBase &SShaderCodeGeneratorBase::operator<<(const char *data)
-{
- m_CodeBuilder.append(data);
- return *this;
-}
-SShaderCodeGeneratorBase &SShaderCodeGeneratorBase::operator<<(const TStrType &data)
-{
- m_CodeBuilder.append(data);
- return *this;
-}
-
-SShaderCodeGeneratorBase &SShaderCodeGeneratorBase::operator<<(const SEndlType & /*data*/)
-{
- m_CodeBuilder.append("\n");
- return *this;
-}
-
-SShaderVertexCodeGenerator::SShaderVertexCodeGenerator(IStringTable &inStringTable,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType)
- : SShaderCodeGeneratorBase(inStringTable, alloc, ctxType)
- , m_Varyings(alloc, "SShaderVertexCodeGenerator::m_Varyings")
-{
-}
-TStrTableStrMap &SShaderVertexCodeGenerator::GetVaryings()
-{
- return m_Varyings;
-}
-
-SShaderTessControlCodeGenerator::SShaderTessControlCodeGenerator(
- SShaderVertexCodeGenerator &vert, NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType)
- : SShaderCodeGeneratorBase(vert.m_StringTable, alloc, ctxType)
- , m_VertGenerator(vert)
- , m_Varyings(alloc, "SShaderTessControlCodeGenerator::m_Varyings")
-{
-}
-
-// overwritten from base
-void SShaderTessControlCodeGenerator::AddShaderItemMap(const char *itemType,
- const TStrTableStrMap &itemMap)
-{
- eastl::string extVtx("");
- eastl::string extTC("");
- eastl::string type(itemType);
- if (!type.compare("varying")) {
- extVtx = "[]";
- extTC = "TC[]";
- itemType = "attribute";
- }
-
- m_FinalShaderBuilder.append("\n");
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end(); iter != end;
- ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(extVtx.c_str());
- m_FinalShaderBuilder.append(";\n");
- }
-
- // if this is varyings write output of tess control shader
- if (!extVtx.empty()) {
- m_FinalShaderBuilder.append("\n");
- itemType = "varying";
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end();
- iter != end; ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(extTC.c_str());
- m_FinalShaderBuilder.append(";\n");
- }
- }
-}
-TStrTableStrMap &SShaderTessControlCodeGenerator::GetVaryings()
-{
- return m_VertGenerator.m_Varyings;
-}
-
-SShaderTessEvalCodeGenerator::SShaderTessEvalCodeGenerator(SShaderTessControlCodeGenerator &tc,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType)
- : SShaderCodeGeneratorBase(tc.m_StringTable, alloc, ctxType)
- , m_TessControlGenerator(tc)
- , m_hasGeometryStage(false)
-{
-}
-// overwritten from base
-void SShaderTessEvalCodeGenerator::AddShaderItemMap(const char *itemType,
- const TStrTableStrMap &itemMap)
-{
- eastl::string extTC("");
- eastl::string extTE("");
- eastl::string type(itemType);
- if (!type.compare("varying")) {
- extTC = "TC[]";
- itemType = "attribute";
- }
- if (m_hasGeometryStage) {
- extTE = "TE";
- }
-
- m_FinalShaderBuilder.append("\n");
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end(); iter != end;
- ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(extTC.c_str());
- m_FinalShaderBuilder.append(";\n");
- }
-
- // if this are varyings write output of tess eval shader
- if (!extTC.empty()) {
- m_FinalShaderBuilder.append("\n");
- itemType = "varying";
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end();
- iter != end; ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(extTE.c_str());
- m_FinalShaderBuilder.append(";\n");
- }
- }
-}
-TStrTableStrMap &SShaderTessEvalCodeGenerator::GetVaryings()
-{
- return m_TessControlGenerator.m_VertGenerator.GetVaryings();
-}
-void SShaderTessEvalCodeGenerator::SetGeometryStage(bool hasGeometryStage)
-{
- m_hasGeometryStage = hasGeometryStage;
-}
-
-SShaderGeometryCodeGenerator::SShaderGeometryCodeGenerator(SShaderVertexCodeGenerator &vert,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType)
- : SShaderCodeGeneratorBase(vert.m_StringTable, alloc, ctxType)
- , m_VertGenerator(vert)
- , m_hasTessellationStage(true)
-{
-}
-
-// overwritten from base
-void SShaderGeometryCodeGenerator::AddShaderItemMap(const char *itemType,
- const TStrTableStrMap &itemMap)
-{
- eastl::string inExt("");
- eastl::string type(itemType);
- if (!type.compare("varying")) {
- itemType = "attribute";
- if (m_hasTessellationStage)
- inExt = "TE[]";
- else
- inExt = "[]";
- }
-
- m_FinalShaderBuilder.append("\n");
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end(); iter != end;
- ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(inExt.c_str());
- m_FinalShaderBuilder.append(";\n");
- }
-
- // if this are varyings write output of geometry shader
- if (!type.compare("varying")) {
- m_FinalShaderBuilder.append("\n");
- itemType = "varying";
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end();
- iter != end; ++iter) {
- m_FinalShaderBuilder.append(itemType);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->second);
- m_FinalShaderBuilder.append(" ");
- m_FinalShaderBuilder.append(iter->first);
- m_FinalShaderBuilder.append(";\n");
- }
- }
-}
-TStrTableStrMap &SShaderGeometryCodeGenerator::GetVaryings()
-{
- return m_VertGenerator.m_Varyings;
-}
-void SShaderGeometryCodeGenerator::SetTessellationStage(bool hasTessellationStage)
-{
- m_hasTessellationStage = hasTessellationStage;
-}
-
-SShaderFragmentCodeGenerator::SShaderFragmentCodeGenerator(SShaderVertexCodeGenerator &vert,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType)
- : SShaderCodeGeneratorBase(vert.m_StringTable, alloc, ctxType)
- , m_VertGenerator(vert)
-{
-}
-TStrTableStrMap &SShaderFragmentCodeGenerator::GetVaryings()
-{
- return m_VertGenerator.m_Varyings;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.h
deleted file mode 100644
index d68a3699..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGenerator.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_CODE_GENERATOR_H
-#define QT3DS_RENDER_SHADER_CODE_GENERATOR_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSContainers.h"
-#include "EASTL/string.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "StringTools.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SEndlType
- {
- };
- extern SEndlType Endl;
-
- typedef std::basic_string<char> TStrType;
- typedef eastl::pair<CRegisteredString, CRegisteredString> TParamPair;
- typedef eastl::pair<CRegisteredString, TParamPair> TConstantBufferParamPair;
- typedef nvvector<TConstantBufferParamPair> TConstantBufferParamArray;
- typedef nvhash_map<CRegisteredString, CRegisteredString> TStrTableStrMap;
-
- struct SShaderCodeGeneratorBase
- {
- enum Enum {
- Unknown = 0,
- Lighting,
- ViewVector,
- WorldNormal,
- WorldPosition,
- EnvMapReflection,
- UVCoords,
- };
- IStringTable &m_StringTable;
- nvhash_set<QT3DSU32> m_Codes; // set of enums we have included.
- nvhash_set<CRegisteredString> m_Includes;
- TStrTableStrMap m_Uniforms;
- TStrTableStrMap m_ConstantBuffers;
- TConstantBufferParamArray m_ConstantBufferParams;
- TStrTableStrMap m_Attributes;
- Qt3DSString m_FinalShaderBuilder;
- TStrType m_CodeBuilder;
- qt3ds::render::NVRenderContextType m_RenderContextType;
-
- SShaderCodeGeneratorBase(IStringTable &inStringTable, NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType);
- virtual TStrTableStrMap &GetVaryings() = 0;
- void Begin();
- void Append(const char *data);
- // don't add the newline
- void AppendPartial(const char *data);
- void AddConstantBuffer(const char *name, const char *layout);
- void AddConstantBufferParam(const char *cbName, const char *paramName, const char *type);
- void AddUniform(const char *name, const char *type);
- void AddUniform(TStrType &name, const char *type);
- void AddAttribute(const char *name, const char *type);
- void AddAttribute(TStrType &name, const char *type);
- void AddVarying(const char *name, const char *type);
- void AddVarying(TStrType &name, const char *type);
- void AddLocalVariable(const char *name, const char *type, int tabCount = 1);
- void AddLocalVariable(TStrType &name, const char *type, int tabCount = 1);
- void AddInclude(const char *name);
- void AddInclude(TStrType &name);
- bool HasCode(Enum value);
- void SetCode(Enum value);
- void SetupWorldPosition();
- void GenerateViewVector();
- void GenerateWorldNormal();
- void GenerateEnvMapReflection(SShaderCodeGeneratorBase &inFragmentShader);
- void GenerateUVCoords();
- void GenerateTextureSwizzle(NVRenderTextureSwizzleMode::Enum swizzleMode,
- eastl::basic_string<char8_t> &texSwizzle,
- eastl::basic_string<char8_t> &lookupSwizzle);
- void GenerateShadedWireframeBase();
- void AddLighting();
- const char *BuildShaderSource();
- SShaderCodeGeneratorBase &operator<<(const char *data);
- SShaderCodeGeneratorBase &operator<<(const TStrType &data);
- SShaderCodeGeneratorBase &operator<<(const SEndlType & /*data*/);
-
- protected:
- virtual void AddShaderItemMap(const char *itemType, const TStrTableStrMap &itemMap);
- void AddShaderConstantBufferItemMap(const char *itemType, const TStrTableStrMap &cbMap,
- TConstantBufferParamArray cbParamsArray);
- };
-
- struct SShaderVertexCodeGenerator : public SShaderCodeGeneratorBase
- {
- TStrTableStrMap m_Varyings;
- SShaderVertexCodeGenerator(IStringTable &inStringTable, NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType);
- TStrTableStrMap &GetVaryings() override;
- };
-
- struct SShaderTessControlCodeGenerator : public SShaderCodeGeneratorBase
- {
- SShaderVertexCodeGenerator &m_VertGenerator;
- TStrTableStrMap m_Varyings;
- SShaderTessControlCodeGenerator(SShaderVertexCodeGenerator &vert,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType);
-
- void AddShaderItemMap(const char *itemType, const TStrTableStrMap &itemMap) override;
- TStrTableStrMap &GetVaryings() override;
- };
-
- struct SShaderTessEvalCodeGenerator : public SShaderCodeGeneratorBase
- {
- SShaderTessControlCodeGenerator &m_TessControlGenerator;
- bool m_hasGeometryStage;
-
- SShaderTessEvalCodeGenerator(SShaderTessControlCodeGenerator &tc,
- NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType);
-
- void AddShaderItemMap(const char *itemType, const TStrTableStrMap &itemMap) override;
- TStrTableStrMap &GetVaryings() override;
- virtual void SetGeometryStage(bool hasGeometryStage);
- };
-
- struct SShaderGeometryCodeGenerator : public SShaderCodeGeneratorBase
- {
- SShaderVertexCodeGenerator &m_VertGenerator;
- bool m_hasTessellationStage;
-
- SShaderGeometryCodeGenerator(SShaderVertexCodeGenerator &vert, NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType);
-
- void AddShaderItemMap(const char *itemType, const TStrTableStrMap &itemMap) override;
- TStrTableStrMap &GetVaryings() override;
- virtual void SetTessellationStage(bool hasTessellationStage);
- };
-
- struct SShaderFragmentCodeGenerator : public SShaderCodeGeneratorBase
- {
- SShaderVertexCodeGenerator &m_VertGenerator;
- SShaderFragmentCodeGenerator(SShaderVertexCodeGenerator &vert, NVAllocatorCallback &alloc,
- qt3ds::render::NVRenderContextType ctxType);
- TStrTableStrMap &GetVaryings() override;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.cpp
deleted file mode 100644
index cfdf47ae..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.cpp
+++ /dev/null
@@ -1,671 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSIntrinsics.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Utils.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-
-#include <QtGui/qopengl.h>
-
-using namespace qt3ds::render;
-
-namespace {
-struct SStageGeneratorBase : public IShaderStageGenerator
-{
- NVFoundationBase &m_Foundation;
- IStringTable &m_StringTable;
- TStrTableStrMap m_Incoming;
- TStrTableStrMap *m_Outgoing;
- nvhash_set<CRegisteredString> m_Includes;
- TStrTableStrMap m_Uniforms;
- TStrTableStrMap m_ConstantBuffers;
- TConstantBufferParamArray m_ConstantBufferParams;
- Qt3DSString m_CodeBuilder;
- Qt3DSString m_FinalBuilder;
- ShaderGeneratorStages::Enum m_Stage;
- TShaderGeneratorStageFlags m_EnabledStages;
- QStringList m_addedFunctions;
-
- SStageGeneratorBase(NVFoundationBase &inFnd, IStringTable &strTable,
- ShaderGeneratorStages::Enum inStage)
-
- : m_Foundation(inFnd)
- , m_StringTable(strTable)
- , m_Incoming(inFnd.getAllocator(), "m_Incoming")
- , m_Outgoing(NULL)
- , m_Includes(inFnd.getAllocator(), "m_Includes")
- , m_Uniforms(inFnd.getAllocator(), "m_Uniforms")
- , m_ConstantBuffers(inFnd.getAllocator(), "m_ConstantBuffers")
- , m_ConstantBufferParams(inFnd.getAllocator(), "m_ConstantBufferParams")
- , m_Stage(inStage)
- {
- }
-
- virtual void Begin(TShaderGeneratorStageFlags inEnabledStages)
- {
- m_Incoming.clear();
- m_Outgoing = NULL;
- m_Includes.clear();
- m_Uniforms.clear();
- m_ConstantBuffers.clear();
- m_ConstantBufferParams.clear();
- m_CodeBuilder.clear();
- m_FinalBuilder.clear();
- m_EnabledStages = inEnabledStages;
- m_addedFunctions.clear();
- // the shared buffers will be cleared elsewhere.
- }
-
- CRegisteredString Str(const char8_t *var) { return m_StringTable.RegisterStr(var); }
-
- void AddIncoming(const char8_t *name, const char8_t *type) override
- {
- m_Incoming.insert(eastl::make_pair(Str(name), Str(type)));
- }
-
- virtual const char8_t *GetIncomingVariableName()
- {
- return "in";
- }
-
- void AddIncoming(const TStrType &name, const char8_t *type) override
- {
- AddIncoming(name.c_str(), type);
- }
-
- void AddIncoming(const QString &name, const char8_t *type) override
- {
- AddIncoming(name.toUtf8().constData(), type);
- }
-
- void AddOutgoing(const char8_t *name, const char8_t *type) override
- {
- if (m_Outgoing == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- m_Outgoing->insert(eastl::make_pair(Str(name), Str(type)));
- }
-
- void AddOutgoing(const TStrType &name, const char8_t *type) override
- {
- AddOutgoing(name.c_str(), type);
- }
-
- void AddOutgoing(const QString &name, const char8_t *type) override
- {
- AddOutgoing(name.toUtf8().constData(), type);
- }
-
- void AddUniform(const char8_t *name, const char8_t *type) override
- {
- m_Uniforms.insert(eastl::make_pair(Str(name), Str(type)));
- }
-
- void AddUniform(const TStrType &name, const char8_t *type) override
- {
- AddUniform(name.c_str(), type);
- }
-
- void AddUniform(const QString &name, const char8_t *type) override
- {
- AddUniform(name.toUtf8().constData(), type);
- }
-
- void AddConstantBuffer(const char *name, const char *layout) override
- {
- m_ConstantBuffers.insert(eastl::make_pair(Str(name), Str(layout)));
- }
-
- void AddConstantBuffer(const QString &name, const char *layout) override
- {
- AddConstantBuffer(name.toUtf8().constData(), layout);
- }
-
- void AddConstantBufferParam(const char *cbName, const char *paramName,
- const char *type) override
- {
- TParamPair theParamPair(m_StringTable.RegisterStr(paramName),
- m_StringTable.RegisterStr(type));
- TConstantBufferParamPair theBufferParamPair(m_StringTable.RegisterStr(cbName),
- theParamPair);
- m_ConstantBufferParams.push_back(theBufferParamPair);
- }
-
- void AddConstantBufferParam(const QString &cbName, const QString &paramName,
- const char *type) override
- {
- AddConstantBufferParam(cbName.toUtf8().constData(), paramName.toUtf8().constData(), type);
- }
-
- IShaderStageGenerator &operator<<(const char *data) override
- {
- m_CodeBuilder.append(nonNull(data));
- return *this;
- }
-
- IShaderStageGenerator &operator<<(const TStrType &data) override
- {
- m_CodeBuilder.append(data.c_str());
- return *this;
- }
-
- IShaderStageGenerator &operator<<(const QString &data) override
- {
- m_CodeBuilder.append(data);
- return *this;
- }
- IShaderStageGenerator &operator<<(const SEndlType & /*data*/) override
- {
- m_CodeBuilder.append("\n");
- return *this;
- }
- void Append(const char *data) override
- {
- m_CodeBuilder.append(nonNull(data));
- m_CodeBuilder.append("\n");
- }
- void AppendPartial(const char *data) override { m_CodeBuilder.append(nonNull(data)); }
- ShaderGeneratorStages::Enum Stage() const override { return m_Stage; }
-
- virtual void AddShaderItemMap(const char *itemType, const TStrTableStrMap &itemMap,
- const char8_t *inItemSuffix = "")
- {
- m_FinalBuilder.append("\n");
-
- for (TStrTableStrMap::const_iterator iter = itemMap.begin(), end = itemMap.end();
- iter != end; ++iter) {
- m_FinalBuilder.append(itemType);
- m_FinalBuilder.append(" ");
- m_FinalBuilder.append(iter->second);
- m_FinalBuilder.append(" ");
- m_FinalBuilder.append(iter->first);
- m_FinalBuilder.append(inItemSuffix);
- m_FinalBuilder.append(";\n");
- }
- }
-
- virtual void AddShaderIncomingMap() { AddShaderItemMap(GetIncomingVariableName(), m_Incoming); }
-
- virtual void AddShaderUniformMap() { AddShaderItemMap("uniform", m_Uniforms); }
-
- virtual void AddShaderOutgoingMap()
- {
- if (m_Outgoing)
- AddShaderItemMap("varying", *m_Outgoing);
- }
-
- virtual void AddShaderConstantBufferItemMap(const char *itemType, const TStrTableStrMap &cbMap,
- TConstantBufferParamArray cbParamsArray)
- {
- m_FinalBuilder.append("\n");
-
- // iterate over all constant buffers
- for (TStrTableStrMap::const_iterator iter = cbMap.begin(), end = cbMap.end(); iter != end;
- ++iter) {
- m_FinalBuilder.append(iter->second);
- m_FinalBuilder.append(" ");
- m_FinalBuilder.append(itemType);
- m_FinalBuilder.append(" ");
- m_FinalBuilder.append(iter->first);
- m_FinalBuilder.append(" {\n");
- // iterate over all param entries and add match
- for (TConstantBufferParamArray::const_iterator iter1 = cbParamsArray.begin(),
- end = cbParamsArray.end();
- iter1 != end; ++iter1) {
- if (iter1->first == iter->first) {
- m_FinalBuilder.append(iter1->second.second);
- m_FinalBuilder.append(" ");
- m_FinalBuilder.append(iter1->second.first);
- m_FinalBuilder.append(";\n");
- }
- }
-
- m_FinalBuilder.append("};\n");
- }
- }
-
- virtual void AppendShaderCode() { m_FinalBuilder.append(m_CodeBuilder); }
-
- virtual void UpdateShaderCacheFlags(SShaderCacheProgramFlags &) {}
-
- void AddInclude(const char8_t *name) override { m_Includes.insert(Str(name)); }
-
- void AddInclude(const TStrType &name) override { AddInclude(name.c_str()); }
-
- void AddInclude(const QString &name) override
- {
- QByteArray arr = name.toLatin1();
- AddInclude(arr.data());
- }
-
- virtual const char8_t *BuildShaderSource()
- {
- for (nvhash_set<CRegisteredString>::const_iterator iter = m_Includes.begin(),
- end = m_Includes.end();
- iter != end; ++iter) {
- m_FinalBuilder.append("#include \"");
- m_FinalBuilder.append(iter->c_str());
- m_FinalBuilder.append("\"\n");
- }
- AddShaderIncomingMap();
- AddShaderUniformMap();
- AddShaderConstantBufferItemMap("uniform", m_ConstantBuffers, m_ConstantBufferParams);
- AddShaderOutgoingMap();
- m_FinalBuilder.append("\n");
- AppendShaderCode();
- return m_FinalBuilder.c_str();
- }
-
- void AddFunction(const QString &functionName) override
- {
- if (!m_addedFunctions.contains(functionName)) {
- m_addedFunctions.push_back(functionName);
- QString includeName;
- QTextStream stream(&includeName);
- stream << "func" << functionName << ".glsllib";
- AddInclude(includeName);
- }
- }
-};
-
-struct SVertexShaderGenerator : public SStageGeneratorBase
-{
- SVertexShaderGenerator(NVFoundationBase &inFnd, IStringTable &strTable)
- : SStageGeneratorBase(inFnd, strTable, ShaderGeneratorStages::Vertex)
- {
- }
-
- const char8_t *GetIncomingVariableName() override { return "attribute"; }
- virtual void AddIncomingInterpolatedMap() {}
-
- virtual const char8_t *GetInterpolatedIncomingSuffix() const { return "_attr"; }
- virtual const char8_t *GetInterpolatedOutgoingSuffix() const { return ""; }
-};
-
-struct STessControlShaderGenerator : public SStageGeneratorBase
-{
- STessControlShaderGenerator(NVFoundationBase &inFnd, IStringTable &strTable)
- : SStageGeneratorBase(inFnd, strTable, ShaderGeneratorStages::TessControl)
- {
- }
-
- void AddShaderIncomingMap() override { AddShaderItemMap("attribute", m_Incoming, "[]"); }
-
- void AddShaderOutgoingMap() override
- {
- if (m_Outgoing)
- AddShaderItemMap("varying", *m_Outgoing, "[]");
- }
-
- void UpdateShaderCacheFlags(SShaderCacheProgramFlags &inFlags) override
- {
- inFlags.SetTessellationEnabled(true);
- }
-};
-
-struct STessEvalShaderGenerator : public SStageGeneratorBase
-{
- STessEvalShaderGenerator(NVFoundationBase &inFnd, IStringTable &strTable)
- : SStageGeneratorBase(inFnd, strTable, ShaderGeneratorStages::TessEval)
- {
- }
-
- void AddShaderIncomingMap() override { AddShaderItemMap("attribute", m_Incoming, "[]"); }
-
- void UpdateShaderCacheFlags(SShaderCacheProgramFlags &inFlags) override
- {
- inFlags.SetTessellationEnabled(true);
- }
-};
-
-struct SGeometryShaderGenerator : public SStageGeneratorBase
-{
- SGeometryShaderGenerator(NVFoundationBase &inFnd, IStringTable &strTable)
- : SStageGeneratorBase(inFnd, strTable, ShaderGeneratorStages::Geometry)
- {
- }
-
- void AddShaderIncomingMap() override { AddShaderItemMap("attribute", m_Incoming, "[]"); }
-
- void AddShaderOutgoingMap() override
- {
- if (m_Outgoing)
- AddShaderItemMap("varying", *m_Outgoing);
- }
- void UpdateShaderCacheFlags(SShaderCacheProgramFlags &inFlags) override
- {
- inFlags.SetGeometryShaderEnabled(true);
- }
-};
-
-struct SFragmentShaderGenerator : public SStageGeneratorBase
-{
- SFragmentShaderGenerator(NVFoundationBase &inFnd, IStringTable &strTable)
- : SStageGeneratorBase(inFnd, strTable, ShaderGeneratorStages::Fragment)
- {
- }
- void AddShaderIncomingMap() override { AddShaderItemMap("varying", m_Incoming); }
- void AddShaderOutgoingMap() override {}
-};
-
-struct SShaderGeneratedProgramOutput
-{
- // never null; so safe to call strlen on.
- const char8_t *m_VertexShader;
- const char8_t *m_TessControlShader;
- const char8_t *m_TessEvalShader;
- const char8_t *m_GeometryShader;
- const char8_t *m_FragmentShader;
-
- SShaderGeneratedProgramOutput()
- : m_VertexShader("")
- , m_TessControlShader("")
- , m_TessEvalShader("")
- , m_GeometryShader("")
- , m_FragmentShader("")
- {
- }
-
- SShaderGeneratedProgramOutput(const char8_t *vs, const char8_t *tc, const char8_t *te,
- const char8_t *gs, const char8_t *fs)
- : m_VertexShader(vs)
- , m_TessControlShader(tc)
- , m_TessEvalShader(te)
- , m_GeometryShader(gs)
- , m_FragmentShader(fs)
- {
- }
-};
-
-struct SProgramGenerator : public IShaderProgramGenerator
-{
- IQt3DSRenderContext &m_Context;
- SVertexShaderGenerator m_VS;
- STessControlShaderGenerator m_TC;
- STessEvalShaderGenerator m_TE;
- SGeometryShaderGenerator m_GS;
- SFragmentShaderGenerator m_FS;
-
- TShaderGeneratorStageFlags m_EnabledStages;
-
- QT3DSI32 m_RefCount;
-
- SProgramGenerator(IQt3DSRenderContext &inContext)
- : m_Context(inContext)
- , m_VS(inContext.GetFoundation(), inContext.GetStringTable())
- , m_TC(inContext.GetFoundation(), inContext.GetStringTable())
- , m_TE(inContext.GetFoundation(), inContext.GetStringTable())
- , m_GS(inContext.GetFoundation(), inContext.GetStringTable())
- , m_FS(inContext.GetFoundation(), inContext.GetStringTable())
- , m_RefCount(0)
- {
- }
-
- void addRef() override { atomicIncrement(&m_RefCount); }
- void release() override
- {
- atomicDecrement(&m_RefCount);
- if (m_RefCount <= 0) {
- NVFoundationBase &theFoundation(m_Context.GetFoundation());
- NVDelete(theFoundation.getAllocator(), this);
- }
- }
-
- void LinkStages()
- {
- // Link stages incoming to outgoing variables.
- SStageGeneratorBase *previous = NULL;
- QT3DSU32 theStageId = 1;
- for (QT3DSU32 idx = 0, end = (QT3DSU32)ShaderGeneratorStages::StageCount; idx < end;
- ++idx, theStageId = theStageId << 1) {
- SStageGeneratorBase *thisStage = NULL;
- ShaderGeneratorStages::Enum theStageEnum =
- static_cast<ShaderGeneratorStages::Enum>(theStageId);
- if ((m_EnabledStages & theStageEnum)) {
- thisStage = &InternalGetStage(theStageEnum);
- if (previous)
- previous->m_Outgoing = &thisStage->m_Incoming;
- previous = thisStage;
- }
- }
- }
-
- void BeginProgram(TShaderGeneratorStageFlags inEnabledStages) override
- {
- m_VS.Begin(inEnabledStages);
- m_TC.Begin(inEnabledStages);
- m_TE.Begin(inEnabledStages);
- m_GS.Begin(inEnabledStages);
- m_FS.Begin(inEnabledStages);
- m_EnabledStages = inEnabledStages;
- LinkStages();
- }
-
- TShaderGeneratorStageFlags GetEnabledStages() const override { return m_EnabledStages; }
-
- SStageGeneratorBase &InternalGetStage(ShaderGeneratorStages::Enum inStage)
- {
- switch (inStage) {
- case ShaderGeneratorStages::Vertex:
- return m_VS;
- case ShaderGeneratorStages::TessControl:
- return m_TC;
- case ShaderGeneratorStages::TessEval:
- return m_TE;
- case ShaderGeneratorStages::Geometry:
- return m_GS;
- case ShaderGeneratorStages::Fragment:
- return m_FS;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- return m_VS;
- }
- // get the stage or NULL if it has not been created.
- IShaderStageGenerator *GetStage(ShaderGeneratorStages::Enum inStage) override
- {
- if (inStage > 0 || inStage < ShaderGeneratorStages::StageCount) {
- if ((m_EnabledStages & inStage))
- return &InternalGetStage(inStage);
- } else {
- QT3DS_ASSERT(false);
- }
- return NULL;
- }
-
- qt3ds::render::NVRenderShaderProgram *
- CompileGeneratedShader(const char *inShaderName, const SShaderCacheProgramFlags &inFlags,
- TShaderFeatureSet inFeatureSet, bool separableProgram) override
- {
- // No stages enabled
- if (((QT3DSU32)m_EnabledStages) == 0) {
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- qt3ds::render::IDynamicObjectSystem &theDynamicSystem(m_Context.GetDynamicObjectSystem());
- SShaderCacheProgramFlags theCacheFlags(inFlags);
- for (QT3DSU32 stageIdx = 0, stageEnd = ShaderGeneratorStages::StageCount; stageIdx < stageEnd;
- ++stageIdx) {
- ShaderGeneratorStages::Enum stageName =
- static_cast<ShaderGeneratorStages::Enum>(1 << stageIdx);
- if (m_EnabledStages & stageName) {
- SStageGeneratorBase &theStage(InternalGetStage(stageName));
- theStage.BuildShaderSource();
- theStage.UpdateShaderCacheFlags(theCacheFlags);
- theDynamicSystem.InsertShaderHeaderInformation(theStage.m_FinalBuilder,
- inShaderName);
- }
- }
-
- const char *vertexShaderSource = m_VS.m_FinalBuilder.c_str();
- const char *tcShaderSource = m_TC.m_FinalBuilder.c_str();
- const char *teShaderSource = m_TE.m_FinalBuilder.c_str();
- const char *geShaderSource = m_GS.m_FinalBuilder.c_str();
- const char *fragmentShaderSource = m_FS.m_FinalBuilder.c_str();
-
- IShaderCache &theCache = m_Context.GetShaderCache();
- CRegisteredString theCacheKey = m_Context.GetStringTable().RegisterStr(inShaderName);
- return theCache.CompileProgram(theCacheKey, vertexShaderSource, fragmentShaderSource,
- tcShaderSource, teShaderSource, geShaderSource,
- theCacheFlags, inFeatureSet, separableProgram);
- }
-};
-};
-
-IShaderProgramGenerator &
-IShaderProgramGenerator::CreateProgramGenerator(IQt3DSRenderContext &inContext)
-{
- return *QT3DS_NEW(inContext.GetAllocator(), SProgramGenerator)(inContext);
-}
-
-void IShaderProgramGenerator::OutputParaboloidDepthVertex(IShaderStageGenerator &vertexShader)
-{
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddInclude("shadowMapping.glsllib");
- vertexShader.AddUniform("model_view_projection", "mat4");
- // vertexShader.AddUniform("model_view", "mat4");
- vertexShader.AddUniform("camera_properties", "vec2");
- // vertexShader.AddOutgoing("view_pos", "vec4");
- vertexShader.AddOutgoing("world_pos", "vec4");
-
- // Project the location onto screen space.
- // This will be horrible if you have a single large polygon. Tessellation is your friend here!
- vertexShader.Append("void main() {");
- vertexShader.Append(
- " ParaboloidMapResult data = VertexParaboloidDepth( attr_pos, model_view_projection );");
- vertexShader.Append(" gl_Position = data.m_Position;");
- vertexShader.Append(" world_pos = data.m_WorldPos;");
- vertexShader.Append("}");
-}
-
-void IShaderProgramGenerator::OutputParaboloidDepthTessEval(IShaderStageGenerator &tessEvalShader)
-{
- tessEvalShader.AddInclude("shadowMapping.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append(" ParaboloidMapResult data = VertexParaboloidDepth( vec3(pos.xyz), "
- "model_view_projection );");
- tessEvalShader.Append(" gl_Position = data.m_Position;");
- tessEvalShader.Append(" world_pos = data.m_WorldPos;");
-}
-
-void IShaderProgramGenerator::OutputParaboloidDepthFragment(IShaderStageGenerator &fragmentShader)
-{
- fragmentShader.AddInclude("shadowMappingFragment.glsllib");
- fragmentShader.AddUniform("model_view_projection", "mat4");
- fragmentShader.AddUniform("camera_properties", "vec2");
- fragmentShader.Append("void main() {");
- fragmentShader.Append(" gl_FragDepth = FragmentParaboloidDepth( world_pos, "
- "model_view_projection, camera_properties );");
- fragmentShader.Append("}");
-}
-
-void IShaderProgramGenerator::OutputCubeFaceDepthVertex(IShaderStageGenerator &vertexShader)
-{
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddUniform("model_matrix", "mat4");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.AddOutgoing("raw_pos", "vec4");
- vertexShader.AddOutgoing("world_pos", "vec4");
-
- vertexShader.Append("void main() {");
- vertexShader.Append(" world_pos = model_matrix * vec4( attr_pos, 1.0 );");
- vertexShader.Append(" world_pos /= world_pos.w;");
- vertexShader.Append(" gl_Position = model_view_projection * vec4( attr_pos, 1.0 );");
- vertexShader.Append(" raw_pos = vec4( attr_pos, 1.0 );");
- // vertexShader.Append(" gl_Position = vec4( attr_pos, 1.0 );");
- vertexShader.Append("}");
-}
-
-void IShaderProgramGenerator::OutputCubeFaceDepthGeometry(IShaderStageGenerator &geometryShader)
-{
- geometryShader.Append("layout(triangles) in;");
- geometryShader.Append("layout(triangle_strip, max_vertices = 18) out;");
- // geometryShader.AddUniform("shadow_mvp[6]", "mat4");
-
- geometryShader.AddUniform("shadow_mv0", "mat4");
- geometryShader.AddUniform("shadow_mv1", "mat4");
- geometryShader.AddUniform("shadow_mv2", "mat4");
- geometryShader.AddUniform("shadow_mv3", "mat4");
- geometryShader.AddUniform("shadow_mv4", "mat4");
- geometryShader.AddUniform("shadow_mv5", "mat4");
- geometryShader.AddUniform("projection", "mat4");
-
- geometryShader.AddUniform("model_matrix", "mat4");
- geometryShader.AddOutgoing("world_pos", "vec4");
-
- geometryShader.Append("void main() {");
- geometryShader.Append(" mat4 layerMVP[6];");
- geometryShader.Append(" layerMVP[0] = projection * shadow_mv0;");
- geometryShader.Append(" layerMVP[1] = projection * shadow_mv1;");
- geometryShader.Append(" layerMVP[2] = projection * shadow_mv2;");
- geometryShader.Append(" layerMVP[3] = projection * shadow_mv3;");
- geometryShader.Append(" layerMVP[4] = projection * shadow_mv4;");
- geometryShader.Append(" layerMVP[5] = projection * shadow_mv5;");
- geometryShader.Append(" for (int i = 0; i < 6; ++i)");
- geometryShader.Append(" {");
- geometryShader.Append(" gl_Layer = i;");
- geometryShader.Append(" for(int j = 0; j < 3; ++j)");
- geometryShader.Append(" {");
- geometryShader.Append(" world_pos = model_matrix * raw_pos[j];");
- geometryShader.Append(" world_pos /= world_pos.w;");
- geometryShader.Append(" gl_Position = layerMVP[j] * raw_pos[j];");
- geometryShader.Append(" world_pos.w = gl_Position.w;");
- geometryShader.Append(" EmitVertex();");
- geometryShader.Append(" }");
- geometryShader.Append(" EndPrimitive();");
- geometryShader.Append(" }");
- geometryShader.Append("}");
-}
-
-void IShaderProgramGenerator::OutputCubeFaceDepthFragment(IShaderStageGenerator &fragmentShader)
-{
- fragmentShader.AddUniform("camera_position", "vec3");
- fragmentShader.AddUniform("camera_properties", "vec2");
-
- fragmentShader.Append("void main() {");
- fragmentShader.Append(
- "\tvec3 camPos = vec3( camera_position.x, camera_position.y, -camera_position.z );");
- fragmentShader.Append("\tfloat dist = length( world_pos.xyz - camPos );");
- fragmentShader.Append(
- "\tdist = (dist - camera_properties.x) / (camera_properties.y - camera_properties.x);");
- // fragmentShader.Append("\tgl_FragDepth = dist;");
- fragmentShader.Append("\tfragOutput = vec4(dist, dist, dist, 1.0);");
- fragmentShader.Append("}");
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.h
deleted file mode 100644
index 6a6e967e..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderCodeGeneratorV2.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_CODE_GENERATOR_V2_H
-#define QT3DS_RENDER_SHADER_CODE_GENERATOR_V2_H
-#include "Qt3DSRenderShaderCodeGenerator.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "foundation/Qt3DSFlags.h"
-
-#include <QtCore/qstring.h>
-
-namespace qt3ds {
-namespace render {
- // So far the generator is only useful for graphics stages,
- // it doesn't seem useful for compute stages.
- struct ShaderGeneratorStages
- {
- enum Enum {
- Vertex = 1,
- TessControl = 1 << 1,
- TessEval = 1 << 2,
- Geometry = 1 << 3,
- Fragment = 1 << 4,
- StageCount = 5,
- };
- };
-
- typedef NVFlags<ShaderGeneratorStages::Enum, QT3DSU32> TShaderGeneratorStageFlags;
-
- class IShaderStageGenerator
- {
- protected:
- virtual ~IShaderStageGenerator() {}
- public:
- virtual void AddIncoming(const char8_t *name, const char8_t *type) = 0;
- virtual void AddIncoming(const TStrType &name, const char8_t *type) = 0;
- virtual void AddIncoming(const QString &name, const char8_t *type) = 0;
-
- virtual void AddOutgoing(const char8_t *name, const char8_t *type) = 0;
- virtual void AddOutgoing(const TStrType &name, const char8_t *type) = 0;
- virtual void AddOutgoing(const QString &name, const char8_t *type) = 0;
-
- virtual void AddUniform(const char8_t *name, const char8_t *type) = 0;
- virtual void AddUniform(const TStrType &name, const char8_t *type) = 0;
- virtual void AddUniform(const QString &name, const char8_t *type) = 0;
-
- virtual void AddInclude(const char8_t *name) = 0;
- virtual void AddInclude(const TStrType &name) = 0;
- virtual void AddInclude(const QString &name) = 0;
-
- virtual void AddFunction(const QString &functionName) = 0;
-
- virtual void AddConstantBuffer(const char *name, const char *layout) = 0;
- virtual void AddConstantBuffer(const QString &name, const char *layout) = 0;
- virtual void AddConstantBufferParam(const QString &cbName,
- const QString &paramName,
- const char *type) = 0;
- virtual void AddConstantBufferParam(const char *cbName, const char *paramName,
- const char *type) = 0;
-
- virtual IShaderStageGenerator &operator<<(const QString &data) = 0;
- virtual IShaderStageGenerator &operator<<(const char *data) = 0;
- virtual IShaderStageGenerator &operator<<(const TStrType &data) = 0;
- virtual IShaderStageGenerator &operator<<(const SEndlType & /*data*/) = 0;
- virtual void Append(const char *data) = 0;
- virtual void AppendPartial(const char *data) = 0;
-
- virtual ShaderGeneratorStages::Enum Stage() const = 0;
- };
-
- class IShaderProgramGenerator : public NVRefCounted
- {
- public:
- static TShaderGeneratorStageFlags DefaultFlags()
- {
- return TShaderGeneratorStageFlags(ShaderGeneratorStages::Vertex
- | ShaderGeneratorStages::Fragment);
- }
- virtual void BeginProgram(TShaderGeneratorStageFlags inEnabledStages = DefaultFlags()) = 0;
-
- virtual TShaderGeneratorStageFlags GetEnabledStages() const = 0;
-
- // get the stage or NULL if it has not been created.
- virtual IShaderStageGenerator *GetStage(ShaderGeneratorStages::Enum inStage) = 0;
-
- // Implicit call to end program.
- virtual qt3ds::render::NVRenderShaderProgram *
- CompileGeneratedShader(const char *inShaderName, const SShaderCacheProgramFlags &inFlags,
- TShaderFeatureSet inFeatureSet, bool separableProgram = false) = 0;
-
- qt3ds::render::NVRenderShaderProgram *CompileGeneratedShader(const char *inShaderName,
- bool separableProgram = false)
- {
- return CompileGeneratedShader(inShaderName, SShaderCacheProgramFlags(),
- TShaderFeatureSet(), separableProgram);
- }
-
- static IShaderProgramGenerator &CreateProgramGenerator(IQt3DSRenderContext &inContext);
-
- static void OutputParaboloidDepthVertex(IShaderStageGenerator &inGenerator);
- // By convention, the local space result of the TE is stored in vec4 pos local variable.
- // This function expects such state.
- static void OutputParaboloidDepthTessEval(IShaderStageGenerator &inGenerator);
- // Utilities shared among the various different systems.
- static void OutputParaboloidDepthFragment(IShaderStageGenerator &inGenerator);
-
- static void OutputCubeFaceDepthVertex(IShaderStageGenerator &inGenerator);
- static void OutputCubeFaceDepthGeometry(IShaderStageGenerator &inGenerator);
- static void OutputCubeFaceDepthFragment(IShaderStageGenerator &inGenerator);
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderKeys.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderKeys.h
deleted file mode 100644
index 5d02e414..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShaderKeys.h
+++ /dev/null
@@ -1,802 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_KEY_H
-#define QT3DS_RENDER_SHADER_KEY_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "EASTL/string.h"
-#include "foundation/StringConversionImpl.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderTessModeValues.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
- // We have an ever expanding set of properties we like to hash into one or more 32 bit
- // quantities.
- // Furthermore we would like this set of properties to be convertable to string
- // So the shader cache file itself is somewhat human readable/diagnosable.
- // To do this we create a set of objects that act as properties to the master shader key.
- // These objects are tallied in order to figure out their actual offset into the shader key's
- // data store. They are also run through in order to create the string shader cache key.
-
- struct SShaderKeyPropertyBase
- {
- const char *m_Name;
- QT3DSU32 m_Offset;
- SShaderKeyPropertyBase(const char *name = "")
- : m_Name(name)
- , m_Offset(0)
- {
- }
- QT3DSU32 GetOffset() const { return m_Offset; }
- void SetOffset(QT3DSU32 of) { m_Offset = of; }
-
- template <QT3DSU32 TBitWidth>
- QT3DSU32 GetMaskTemplate() const
- {
- QT3DSU32 bit = m_Offset % 32;
- QT3DSU32 startValue = (1 << TBitWidth) - 1;
- QT3DSU32 mask = startValue << bit;
- return mask;
- }
-
- QT3DSU32 GetIdx() const { return m_Offset / 32; }
- protected:
- void InternalToString(eastl::string &ioStr, const char *inBuffer) const
- {
- ioStr.append(m_Name);
- ioStr.append("=");
- ioStr.append(inBuffer);
- }
-
- static void InternalToString(eastl::string &ioStr, const char *name, bool inValue)
- {
- if (inValue) {
- ioStr.append(name);
- ioStr.append("=");
- ioStr.append(inValue ? "true" : "false");
- }
- }
- };
-
- struct SShaderKeyBoolean : public SShaderKeyPropertyBase
- {
- enum {
- BitWidth = 1,
- };
-
- SShaderKeyBoolean(const char *name = "")
- : SShaderKeyPropertyBase(name)
- {
- }
-
- QT3DSU32 GetMask() const { return GetMaskTemplate<BitWidth>(); }
- void SetValue(NVDataRef<QT3DSU32> inDataStore, bool inValue) const
- {
- QT3DSU32 idx = GetIdx();
- QT3DS_ASSERT(inDataStore.size() > idx);
- QT3DSU32 mask = GetMask();
- QT3DSU32 &target = inDataStore[idx];
- if (inValue == true) {
- target = target | mask;
- } else {
- mask = ~mask;
- target = target & mask;
- }
- }
-
- bool GetValue(NVConstDataRef<QT3DSU32> inDataStore) const
- {
- QT3DSU32 idx = GetIdx();
- QT3DSU32 mask = GetMask();
- const QT3DSU32 &target = inDataStore[idx];
- return (target & mask) ? true : false;
- }
-
- void ToString(eastl::string &ioStr, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- bool isHigh = GetValue(inKeySet);
- InternalToString(ioStr, m_Name, isHigh);
- }
- };
-
- template <QT3DSU32 TBitWidth>
- struct SShaderKeyUnsigned : public SShaderKeyPropertyBase
- {
- enum {
- BitWidth = TBitWidth,
- };
- SShaderKeyUnsigned(const char *name = "")
- : SShaderKeyPropertyBase(name)
- {
- }
- QT3DSU32 GetMask() const { return GetMaskTemplate<BitWidth>(); }
- void SetValue(NVDataRef<QT3DSU32> inDataStore, QT3DSU32 inValue) const
- {
- QT3DSU32 startValue = (1 << TBitWidth) - 1;
- // Ensure inValue is within range of bit width.
- inValue = inValue & startValue;
- QT3DSU32 bit = m_Offset % 32;
- QT3DSU32 mask = GetMask();
- QT3DSU32 idx = GetIdx();
- inValue = inValue << bit;
- QT3DSU32 &target = inDataStore[idx];
- // Get rid of existing value
- QT3DSU32 inverseMask = ~mask;
- target = target & inverseMask;
- target = target | inValue;
- }
-
- QT3DSU32 GetValue(NVConstDataRef<QT3DSU32> inDataStore) const
- {
- QT3DSU32 idx = GetIdx();
- QT3DSU32 bit = m_Offset % 32;
- QT3DSU32 mask = GetMask();
- const QT3DSU32 &target = inDataStore[idx];
-
- QT3DSU32 retval = target & mask;
- retval = retval >> bit;
- return retval;
- }
-
- void ToString(eastl::string &ioStr, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- QT3DSU32 value = GetValue(inKeySet);
- char buf[64];
- StringConversion<QT3DSU32>().ToStr(value, toDataRef(buf, 64));
- InternalToString(ioStr, buf);
- }
- };
-
- struct SShaderKeyTessellation : public SShaderKeyUnsigned<4>
- {
- enum TessellationBits {
- noTessellation = 1 << 0,
- linearTessellation = 1 << 1,
- phongTessellation = 1 << 2,
- npatchTessellation = 1 << 3
- };
-
- SShaderKeyTessellation(const char *name = "")
- : SShaderKeyUnsigned<4>(name)
- {
- }
-
- bool GetBitValue(TessellationBits swizzleBit, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return (GetValue(inKeySet) & swizzleBit) ? true : false;
- }
-
- void SetBitValue(TessellationBits swizzleBit, bool inValue, NVDataRef<QT3DSU32> inKeySet)
- {
- QT3DSU32 theValue = GetValue(inKeySet);
- QT3DSU32 mask = swizzleBit;
- if (inValue) {
- theValue = theValue | mask;
- } else {
- mask = ~mask;
- theValue = theValue & mask;
- }
- SetValue(inKeySet, theValue);
- }
-
- void SetTessellationMode(NVDataRef<QT3DSU32> inKeySet, TessModeValues::Enum tessellationMode,
- bool val)
- {
- switch (tessellationMode) {
- case TessModeValues::NoTess:
- SetBitValue(noTessellation, val, inKeySet);
- break;
- case TessModeValues::TessLinear:
- SetBitValue(linearTessellation, val, inKeySet);
- break;
- case TessModeValues::TessNPatch:
- SetBitValue(npatchTessellation, val, inKeySet);
- break;
- case TessModeValues::TessPhong:
- SetBitValue(phongTessellation, val, inKeySet);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- bool IsNoTessellation(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(noTessellation, inKeySet);
- }
- void SetNoTessellation(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(noTessellation, val, inKeySet);
- }
-
- bool IsLinearTessellation(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(linearTessellation, inKeySet);
- }
- void SetLinearTessellation(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(linearTessellation, val, inKeySet);
- }
-
- bool IsNPatchTessellation(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(npatchTessellation, inKeySet);
- }
- void SetNPatchTessellation(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(npatchTessellation, val, inKeySet);
- }
-
- bool IsPhongTessellation(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(phongTessellation, inKeySet);
- }
- void SetPhongTessellation(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(phongTessellation, val, inKeySet);
- }
-
- void ToString(eastl::string &ioStr, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- ioStr.append(m_Name);
- ioStr.append("={");
- InternalToString(ioStr, "noTessellation", IsNoTessellation(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "linearTessellation", IsLinearTessellation(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "npatchTessellation", IsNPatchTessellation(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "phongTessellation", IsPhongTessellation(inKeySet));
- ioStr.append("}");
- }
- };
-
- struct SShaderKeyTextureSwizzle : public SShaderKeyUnsigned<5>
- {
- enum TextureSwizzleBits {
- noSwizzle = 1 << 0,
- L8toR8 = 1 << 1,
- A8toR8 = 1 << 2,
- L8A8toRG8 = 1 << 3,
- L16toR16 = 1 << 4
- };
-
- SShaderKeyTextureSwizzle(const char *name = "")
- : SShaderKeyUnsigned<5>(name)
- {
- }
-
- bool GetBitValue(TextureSwizzleBits swizzleBit, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return (GetValue(inKeySet) & swizzleBit) ? true : false;
- }
-
- void SetBitValue(TextureSwizzleBits swizzleBit, bool inValue, NVDataRef<QT3DSU32> inKeySet)
- {
- QT3DSU32 theValue = GetValue(inKeySet);
- QT3DSU32 mask = swizzleBit;
- if (inValue) {
- theValue = theValue | mask;
- } else {
- mask = ~mask;
- theValue = theValue & mask;
- }
- SetValue(inKeySet, theValue);
- }
-
- void SetSwizzleMode(NVDataRef<QT3DSU32> inKeySet, NVRenderTextureSwizzleMode::Enum swizzleMode,
- bool val)
- {
- switch (swizzleMode) {
- case NVRenderTextureSwizzleMode::NoSwizzle:
- SetBitValue(noSwizzle, val, inKeySet);
- break;
- case NVRenderTextureSwizzleMode::L8toR8:
- SetBitValue(L8toR8, val, inKeySet);
- break;
- case NVRenderTextureSwizzleMode::A8toR8:
- SetBitValue(A8toR8, val, inKeySet);
- break;
- case NVRenderTextureSwizzleMode::L8A8toRG8:
- SetBitValue(L8A8toRG8, val, inKeySet);
- break;
- case NVRenderTextureSwizzleMode::L16toR16:
- SetBitValue(L16toR16, val, inKeySet);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- bool IsNoSwizzled(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(noSwizzle, inKeySet);
- }
- void SetNoSwizzled(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(noSwizzle, val, inKeySet);
- }
-
- bool IsL8Swizzled(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(L8toR8, inKeySet);
- }
- void SetL8Swizzled(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(L8toR8, val, inKeySet);
- }
-
- bool IsA8Swizzled(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(A8toR8, inKeySet);
- }
- void SetA8Swizzled(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(A8toR8, val, inKeySet);
- }
-
- bool IsL8A8Swizzled(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(L8A8toRG8, inKeySet);
- }
- void SetL8A8Swizzled(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(L8A8toRG8, val, inKeySet);
- }
-
- bool IsL16Swizzled(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(L16toR16, inKeySet);
- }
- void SetL16Swizzled(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(L16toR16, val, inKeySet);
- }
-
- void ToString(eastl::string &ioStr, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- ioStr.append(m_Name);
- ioStr.append("={");
- InternalToString(ioStr, "noswizzle", IsNoSwizzled(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "l8swizzle", IsL8Swizzled(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "a8swizzle", IsA8Swizzled(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "l8a8swizzle", IsL8A8Swizzled(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "l16swizzle", IsL16Swizzled(inKeySet));
- ioStr.append("}");
- }
- };
-
- struct SShaderKeyImageMap : public SShaderKeyUnsigned<5>
- {
- enum ImageMapBits {
- Enabled = 1 << 0,
- EnvMap = 1 << 1,
- LightProbe = 1 << 2,
- InvertUV = 1 << 3,
- Premultiplied = 1 << 4,
- };
-
- SShaderKeyImageMap(const char *name = "")
- : SShaderKeyUnsigned<5>(name)
- {
- }
-
- bool GetBitValue(ImageMapBits imageBit, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return (GetValue(inKeySet) & imageBit) ? true : false;
- }
-
- void SetBitValue(ImageMapBits imageBit, bool inValue, NVDataRef<QT3DSU32> inKeySet)
- {
- QT3DSU32 theValue = GetValue(inKeySet);
- QT3DSU32 mask = imageBit;
- if (inValue) {
- theValue = theValue | mask;
- } else {
- mask = ~mask;
- theValue = theValue & mask;
- }
- SetValue(inKeySet, theValue);
- }
-
- bool IsEnabled(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(Enabled, inKeySet);
- }
- void SetEnabled(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(Enabled, val, inKeySet);
- }
-
- bool IsEnvMap(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(EnvMap, inKeySet);
- }
- void SetEnvMap(NVDataRef<QT3DSU32> inKeySet, bool val) { SetBitValue(EnvMap, val, inKeySet); }
-
- bool IsLightProbe(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(LightProbe, inKeySet);
- }
- void SetLightProbe(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(LightProbe, val, inKeySet);
- }
-
- bool IsInvertUVMap(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(InvertUV, inKeySet);
- }
- void SetInvertUVMap(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(InvertUV, val, inKeySet);
- }
-
- bool IsPremultiplied(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return GetBitValue(Premultiplied, inKeySet);
- }
- void SetPremultiplied(NVDataRef<QT3DSU32> inKeySet, bool val)
- {
- SetBitValue(Premultiplied, val, inKeySet);
- }
-
- void ToString(eastl::string &ioStr, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- ioStr.append(m_Name);
- ioStr.append("={");
- InternalToString(ioStr, "enabled", IsEnabled(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "envMap", IsEnvMap(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "lightProbe", IsLightProbe(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "invertUV", IsInvertUVMap(inKeySet));
- ioStr.append(";");
- InternalToString(ioStr, "premultiplied", IsPremultiplied(inKeySet));
- ioStr.append("}");
- }
- };
-
- struct SShaderKeySpecularModel : SShaderKeyUnsigned<2>
- {
- SShaderKeySpecularModel(const char *name = "")
- : SShaderKeyUnsigned<2>(name)
- {
- }
-
- void SetSpecularModel(NVDataRef<QT3DSU32> inKeySet,
- qt3ds::render::DefaultMaterialSpecularModel::Enum inModel)
- {
- SetValue(inKeySet, (QT3DSU32)inModel);
- }
-
- qt3ds::render::DefaultMaterialSpecularModel::Enum
- GetSpecularModel(NVConstDataRef<QT3DSU32> inKeySet) const
- {
- return static_cast<qt3ds::render::DefaultMaterialSpecularModel::Enum>(GetValue(inKeySet));
- }
-
- void ToString(eastl::string &ioStr, NVConstDataRef<QT3DSU32> inKeySet) const
- {
- ioStr.append(m_Name);
- ioStr.append("=");
- switch (GetSpecularModel(inKeySet)) {
- case DefaultMaterialSpecularModel::KGGX:
- ioStr.append("KGGX");
- break;
- case DefaultMaterialSpecularModel::KWard:
- ioStr.append("KWard");
- break;
- case DefaultMaterialSpecularModel::Default:
- ioStr.append("Default");
- break;
- }
- ioStr.append(";");
- }
- };
-
- struct SShaderDefaultMaterialKeyProperties
- {
- enum {
- LightCount = 7,
- };
- enum ImageMapNames {
- DiffuseMap0 = 0,
- DiffuseMap1,
- DiffuseMap2,
- EmissiveMap,
- EmissiveMap2,
- SpecularMap,
- OpacityMap,
- BumpMap,
- SpecularAmountMap,
- NormalMap,
- DisplacementMap,
- TranslucencyMap,
- LightmapIndirect,
- LightmapRadiosity,
- LightmapShadow,
- RoughnessMap,
- ImageMapCount
- };
-
- SShaderKeyBoolean m_HasLighting;
- SShaderKeyBoolean m_HasIbl;
- SShaderKeyUnsigned<3> m_LightCount;
- SShaderKeyBoolean m_LightFlags[LightCount];
- SShaderKeyBoolean m_LightAreaFlags[LightCount];
- SShaderKeyBoolean m_LightShadowFlags[LightCount];
- SShaderKeyBoolean m_SpecularEnabled;
- SShaderKeyBoolean m_FresnelEnabled;
- SShaderKeyBoolean m_VertexColorsEnabled;
- SShaderKeySpecularModel m_SpecularModel;
- SShaderKeyImageMap m_ImageMaps[ImageMapCount];
- SShaderKeyTextureSwizzle m_TextureSwizzle[ImageMapCount];
- SShaderKeyTessellation m_TessellationMode;
- SShaderKeyBoolean m_HasSkinning;
- SShaderKeyBoolean m_WireframeMode;
-
- SShaderDefaultMaterialKeyProperties()
- : m_HasLighting("hasLighting")
- , m_HasIbl("hasIbl")
- , m_LightCount("lightCount")
- , m_SpecularEnabled("specularEnabled")
- , m_FresnelEnabled("fresnelEnabled")
- , m_VertexColorsEnabled("vertexColorsEnabled")
- , m_SpecularModel("specularModel")
- , m_TessellationMode("tessellationMode")
- , m_HasSkinning("hasSkinning")
- , m_WireframeMode("wireframeMode")
- {
- m_LightFlags[0].m_Name = "light0HasPosition";
- m_LightFlags[1].m_Name = "light1HasPosition";
- m_LightFlags[2].m_Name = "light2HasPosition";
- m_LightFlags[3].m_Name = "light3HasPosition";
- m_LightFlags[4].m_Name = "light4HasPosition";
- m_LightFlags[5].m_Name = "light5HasPosition";
- m_LightFlags[6].m_Name = "light6HasPosition";
- m_LightAreaFlags[0].m_Name = "light0HasArea";
- m_LightAreaFlags[1].m_Name = "light1HasArea";
- m_LightAreaFlags[2].m_Name = "light2HasArea";
- m_LightAreaFlags[3].m_Name = "light3HasArea";
- m_LightAreaFlags[4].m_Name = "light4HasArea";
- m_LightAreaFlags[5].m_Name = "light5HasArea";
- m_LightAreaFlags[6].m_Name = "light6HasArea";
- m_LightShadowFlags[0].m_Name = "light0HasShadow";
- m_LightShadowFlags[1].m_Name = "light1HasShadow";
- m_LightShadowFlags[2].m_Name = "light2HasShadow";
- m_LightShadowFlags[3].m_Name = "light3HasShadow";
- m_LightShadowFlags[4].m_Name = "light4HasShadow";
- m_LightShadowFlags[5].m_Name = "light5HasShadow";
- m_LightShadowFlags[6].m_Name = "light6HasShadow";
- m_ImageMaps[0].m_Name = "diffuseMap0";
- m_ImageMaps[1].m_Name = "diffuseMap1";
- m_ImageMaps[2].m_Name = "diffuseMap2";
- m_ImageMaps[3].m_Name = "emissiveMap";
- m_ImageMaps[4].m_Name = "emissiveMap2";
- m_ImageMaps[5].m_Name = "specularMap";
- m_ImageMaps[6].m_Name = "opacityMap";
- m_ImageMaps[7].m_Name = "bumpMap";
- m_ImageMaps[8].m_Name = "specularAmountMap";
- m_ImageMaps[9].m_Name = "normalMap";
- m_ImageMaps[10].m_Name = "displacementMap";
- m_ImageMaps[11].m_Name = "translucencyMap";
- m_ImageMaps[12].m_Name = "lightmapIndirect";
- m_ImageMaps[13].m_Name = "lightmapRadiosity";
- m_ImageMaps[14].m_Name = "lightmapShadow";
- m_ImageMaps[15].m_Name = "roughnessMap";
- m_TextureSwizzle[0].m_Name = "diffuseMap0_swizzle";
- m_TextureSwizzle[1].m_Name = "diffuseMap1_swizzle";
- m_TextureSwizzle[2].m_Name = "diffuseMap2_swizzle";
- m_TextureSwizzle[3].m_Name = "emissiveMap_swizzle";
- m_TextureSwizzle[4].m_Name = "emissiveMap2_swizzle";
- m_TextureSwizzle[5].m_Name = "specularMap_swizzle";
- m_TextureSwizzle[6].m_Name = "opacityMap_swizzle";
- m_TextureSwizzle[7].m_Name = "bumpMap_swizzle";
- m_TextureSwizzle[8].m_Name = "specularAmountMap_swizzle";
- m_TextureSwizzle[9].m_Name = "normalMap_swizzle";
- m_TextureSwizzle[10].m_Name = "displacementMap_swizzle";
- m_TextureSwizzle[11].m_Name = "translucencyMap_swizzle";
- m_TextureSwizzle[12].m_Name = "lightmapIndirect_swizzle";
- m_TextureSwizzle[13].m_Name = "lightmapRadiosity_swizzle";
- m_TextureSwizzle[14].m_Name = "lightmapShadow_swizzle";
- m_TextureSwizzle[15].m_Name = "roughnessMap_swizzle";
- SetPropertyOffsets();
- }
-
- template <typename TVisitor>
- void VisitProperties(TVisitor &inVisitor)
- {
- inVisitor.Visit(m_HasLighting);
- inVisitor.Visit(m_HasIbl);
- inVisitor.Visit(m_LightCount);
-
- for (QT3DSU32 idx = 0, end = LightCount; idx < end; ++idx) {
- inVisitor.Visit(m_LightFlags[idx]);
- }
-
- for (QT3DSU32 idx = 0, end = LightCount; idx < end; ++idx) {
- inVisitor.Visit(m_LightAreaFlags[idx]);
- }
-
- for (QT3DSU32 idx = 0, end = LightCount; idx < end; ++idx) {
- inVisitor.Visit(m_LightShadowFlags[idx]);
- }
-
- inVisitor.Visit(m_SpecularEnabled);
- inVisitor.Visit(m_FresnelEnabled);
- inVisitor.Visit(m_VertexColorsEnabled);
- inVisitor.Visit(m_SpecularModel);
-
- for (QT3DSU32 idx = 0, end = ImageMapCount; idx < end; ++idx) {
- inVisitor.Visit(m_ImageMaps[idx]);
- inVisitor.Visit(m_TextureSwizzle[idx]);
- }
-
- inVisitor.Visit(m_TessellationMode);
- inVisitor.Visit(m_HasSkinning);
- inVisitor.Visit(m_WireframeMode);
- }
-
- struct SOffsetVisitor
- {
- QT3DSU32 m_Offset;
- SOffsetVisitor()
- : m_Offset(0)
- {
- }
- template <typename TPropType>
- void Visit(TPropType &inProp)
- {
- // if we cross the 32 bit border we just move
- // to the next dword.
- // This cost a few extra bits but prevents tedious errors like
- // loosing shader key bits because they got moved beyond the 32 border
- QT3DSU32 bit = m_Offset % 32;
- if (bit + TPropType::BitWidth > 31) {
- m_Offset += 32 - bit;
- }
-
- inProp.SetOffset(m_Offset);
- m_Offset += TPropType::BitWidth;
- }
- };
-
- void SetPropertyOffsets()
- {
- SOffsetVisitor visitor;
- VisitProperties(visitor);
- // If this assert fires, then the default material key needs more bits.
- QT3DS_ASSERT(visitor.m_Offset < 224);
- }
- };
-
- struct SShaderDefaultMaterialKey
- {
- enum {
- DataBufferSize = 7,
- };
- QT3DSU32 m_DataBuffer[DataBufferSize];
- size_t m_FeatureSetHash;
-
- SShaderDefaultMaterialKey(size_t inFeatureSetHash)
- : m_FeatureSetHash(inFeatureSetHash)
- {
- for (size_t idx = 0; idx < DataBufferSize; ++idx)
- m_DataBuffer[idx] = 0;
- }
-
- SShaderDefaultMaterialKey()
- : m_FeatureSetHash(0)
- {
- for (size_t idx = 0; idx < DataBufferSize; ++idx)
- m_DataBuffer[idx] = 0;
- }
-
- size_t hash() const
- {
- size_t retval = 0;
- for (size_t idx = 0; idx < DataBufferSize; ++idx)
- retval = retval ^ eastl::hash<QT3DSU32>()(m_DataBuffer[idx]);
- return retval ^ m_FeatureSetHash;
- }
-
- bool operator==(const SShaderDefaultMaterialKey &other) const
- {
- bool retval = true;
- for (size_t idx = 0; idx < DataBufferSize && retval; ++idx)
- retval = m_DataBuffer[idx] == other.m_DataBuffer[idx];
- return retval && m_FeatureSetHash == other.m_FeatureSetHash;
- }
-
- // Cast operators to make getting properties easier.
- operator NVDataRef<QT3DSU32>() { return toDataRef(m_DataBuffer, DataBufferSize); }
-
- operator NVConstDataRef<QT3DSU32>() const
- {
- return toConstDataRef(m_DataBuffer, DataBufferSize);
- }
-
- struct SStringVisitor
- {
- eastl::string &m_Str;
- NVConstDataRef<QT3DSU32> m_KeyStore;
- SStringVisitor(eastl::string &s, NVConstDataRef<QT3DSU32> ks)
- : m_Str(s)
- , m_KeyStore(ks)
- {
- }
- template <typename TPropType>
- void Visit(const TPropType &prop)
- {
- QT3DSU32 originalSize = m_Str.size();
- if (m_Str.size())
- m_Str.append(";");
- prop.ToString(m_Str, m_KeyStore);
- // if the only thing we added was the semicolon
- // then nuke the semicolon
- if (originalSize && m_Str.size() == originalSize + 1)
- m_Str.resize(originalSize);
- }
- };
-
- void ToString(eastl::string &ioString,
- SShaderDefaultMaterialKeyProperties &inProperties) const
- {
- SStringVisitor theVisitor(ioString, *this);
- inProperties.VisitProperties(theVisitor);
- }
- };
-}
-}
-
-namespace eastl {
-template <>
-struct hash<qt3ds::render::SShaderDefaultMaterialKey>
-{
- size_t operator()(const qt3ds::render::SShaderDefaultMaterialKey &key) const
- {
- return key.hash();
- }
-};
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.cpp
deleted file mode 100644
index 983af55c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderShadowMap.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "rendererimpl/Qt3DSRendererImplLayerRenderData.h"
-#include "render/Qt3DSRenderShaderConstant.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-using namespace qt3ds::render;
-using qt3ds::render::NVRenderContextScopedProperty;
-using qt3ds::render::NVRenderCachedShaderProperty;
-
-Qt3DSShadowMap::Qt3DSShadowMap(IQt3DSRenderContext &inContext)
- : m_Context(inContext)
- , mRefCount(0)
- , m_ShadowMapList(inContext.GetAllocator(), "Qt3DSShadowMap::m_ShadowMapList")
-{
-}
-
-Qt3DSShadowMap::~Qt3DSShadowMap()
-{
- m_ShadowMapList.clear();
-}
-
-namespace {
-bool IsDepthFormat(NVRenderTextureFormats::Enum format)
-{
- switch (format) {
- case NVRenderTextureFormats::Depth16:
- case NVRenderTextureFormats::Depth24:
- case NVRenderTextureFormats::Depth32:
- case NVRenderTextureFormats::Depth24Stencil8:
- return true;
- default:
- return false;
- }
-}
-}
-
-void Qt3DSShadowMap::AddShadowMapEntry(QT3DSU32 index, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum format, QT3DSU32 samples,
- ShadowMapModes::Enum mode, ShadowFilterValues::Enum filter)
-{
- IResourceManager &theManager(m_Context.GetResourceManager());
- SShadowMapEntry *pEntry = NULL;
-
- if (index < m_ShadowMapList.size())
- pEntry = &m_ShadowMapList[index];
-
- if (pEntry) {
- if ((NULL != pEntry->m_DepthMap) && (mode == ShadowMapModes::CUBE)) {
- theManager.Release(*pEntry->m_DepthMap);
- theManager.Release(*pEntry->m_DepthCopy);
- theManager.Release(*pEntry->m_DepthRender);
- pEntry->m_DepthCube = theManager.AllocateTextureCube(width, height, format, samples);
- pEntry->m_CubeCopy = theManager.AllocateTextureCube(width, height, format, samples);
- pEntry->m_DepthRender = theManager.AllocateTexture2D(
- width, height, NVRenderTextureFormats::Depth24Stencil8, samples);
- pEntry->m_DepthMap = NULL;
- pEntry->m_DepthCopy = NULL;
- } else if ((NULL != pEntry->m_DepthCube) && (mode != ShadowMapModes::CUBE)) {
- theManager.Release(*pEntry->m_DepthCube);
- theManager.Release(*pEntry->m_CubeCopy);
- theManager.Release(*pEntry->m_DepthRender);
- pEntry->m_DepthMap = theManager.AllocateTexture2D(width, height, format, samples);
- pEntry->m_DepthCopy = theManager.AllocateTexture2D(width, height, format, samples);
- pEntry->m_DepthCube = NULL;
- pEntry->m_CubeCopy = NULL;
- pEntry->m_DepthRender = theManager.AllocateTexture2D(
- width, height, NVRenderTextureFormats::Depth24Stencil8, samples);
- } else if (NULL != pEntry->m_DepthMap) {
- STextureDetails theDetails(pEntry->m_DepthMap->GetTextureDetails());
-
- // If anything differs about the map we're looking for, let's recreate it.
- if (theDetails.m_Format != format || theDetails.m_Width != width
- || theDetails.m_Height != height || theDetails.m_SampleCount != samples) {
- // release texture
- theManager.Release(*pEntry->m_DepthMap);
- theManager.Release(*pEntry->m_DepthCopy);
- theManager.Release(*pEntry->m_DepthRender);
- pEntry->m_DepthMap = theManager.AllocateTexture2D(width, height, format, samples);
- pEntry->m_DepthCopy = theManager.AllocateTexture2D(width, height, format, samples);
- pEntry->m_DepthCube = NULL;
- pEntry->m_CubeCopy = NULL;
- pEntry->m_DepthRender = theManager.AllocateTexture2D(
- width, height, NVRenderTextureFormats::Depth24Stencil8, samples);
- }
- } else {
- STextureDetails theDetails(pEntry->m_DepthCube->GetTextureDetails());
-
- // If anything differs about the map we're looking for, let's recreate it.
- if (theDetails.m_Format != format || theDetails.m_Width != width
- || theDetails.m_Height != height || theDetails.m_SampleCount != samples) {
- // release texture
- theManager.Release(*pEntry->m_DepthCube);
- theManager.Release(*pEntry->m_CubeCopy);
- theManager.Release(*pEntry->m_DepthRender);
- pEntry->m_DepthCube =
- theManager.AllocateTextureCube(width, height, format, samples);
- pEntry->m_CubeCopy = theManager.AllocateTextureCube(width, height, format, samples);
- pEntry->m_DepthRender = theManager.AllocateTexture2D(
- width, height, NVRenderTextureFormats::Depth24Stencil8, samples);
- pEntry->m_DepthMap = NULL;
- pEntry->m_DepthCopy = NULL;
- }
- }
-
- pEntry->m_ShadowMapMode = mode;
- pEntry->m_ShadowFilterFlags = filter;
- } else if (mode == ShadowMapModes::CUBE) {
- NVRenderTextureCube *theDepthTex =
- theManager.AllocateTextureCube(width, height, format, samples);
- NVRenderTextureCube *theDepthCopy =
- theManager.AllocateTextureCube(width, height, format, samples);
- NVRenderTexture2D *theDepthTemp = theManager.AllocateTexture2D(
- width, height, NVRenderTextureFormats::Depth24Stencil8, samples);
-
- m_ShadowMapList.push_back(
- SShadowMapEntry(index, mode, filter, *theDepthTex, *theDepthCopy, *theDepthTemp));
-
- pEntry = &m_ShadowMapList.back();
- } else {
- NVRenderTexture2D *theDepthMap =
- theManager.AllocateTexture2D(width, height, format, samples);
- NVRenderTexture2D *theDepthCopy =
- theManager.AllocateTexture2D(width, height, format, samples);
- NVRenderTexture2D *theDepthTemp = theManager.AllocateTexture2D(
- width, height, NVRenderTextureFormats::Depth24Stencil8, samples);
-
- m_ShadowMapList.push_back(
- SShadowMapEntry(index, mode, filter, *theDepthMap, *theDepthCopy, *theDepthTemp));
-
- pEntry = &m_ShadowMapList.back();
- }
-
- if (pEntry) {
- // setup some texture settings
- if (pEntry->m_DepthMap) {
- pEntry->m_DepthMap->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- pEntry->m_DepthMap->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- pEntry->m_DepthMap->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- pEntry->m_DepthMap->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
-
- pEntry->m_DepthCopy->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- pEntry->m_DepthCopy->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- pEntry->m_DepthCopy->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- pEntry->m_DepthCopy->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
-
- pEntry->m_DepthRender->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- pEntry->m_DepthRender->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- pEntry->m_DepthRender->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- pEntry->m_DepthRender->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
- } else {
- pEntry->m_DepthCube->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- pEntry->m_DepthCube->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- pEntry->m_DepthCube->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- pEntry->m_DepthCube->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
-
- pEntry->m_CubeCopy->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- pEntry->m_CubeCopy->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- pEntry->m_CubeCopy->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- pEntry->m_CubeCopy->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
-
- pEntry->m_DepthRender->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- pEntry->m_DepthRender->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- pEntry->m_DepthRender->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- pEntry->m_DepthRender->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
- }
-
- pEntry->m_LightIndex = index;
- }
-}
-
-SShadowMapEntry *Qt3DSShadowMap::GetShadowMapEntry(QT3DSU32 index)
-{
- SShadowMapEntry *pEntry = NULL;
-
- for (QT3DSU32 i = 0; i < m_ShadowMapList.size(); i++) {
- pEntry = &m_ShadowMapList[i];
- if (pEntry->m_LightIndex == index)
- return pEntry;
- }
-
- return NULL;
-}
-
-Qt3DSShadowMap *Qt3DSShadowMap::Create(IQt3DSRenderContext &inContext)
-{
- return QT3DS_NEW(inContext.GetFoundation().getAllocator(), Qt3DSShadowMap)(inContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.h
deleted file mode 100644
index c5ba2eaa..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderShadowMap.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADOW_MAP_H
-#define QT3DS_RENDER_SHADOW_MAP_H
-#include "Qt3DSRenderContextCore.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSMat44.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#ifdef _INTEGRITYPLATFORM
-#include "render/Qt3DSRenderTextureCube.h"
-#endif
-
-namespace qt3ds {
-namespace render {
-
- struct SLayerRenderData;
-
- struct ShadowMapModes
- {
- enum Enum {
- SSM, ///< standard shadow mapping
- VSM, ///< variance shadow mapping
- CUBE, ///< cubemap omnidirectional shadows
- };
- };
-
- struct ShadowFilterValues
- {
- enum Enum {
- NONE = 1 << 0, ///< hard shadows
- PCF = 1 << 1, ///< Percentage close filtering
- BLUR = 1 << 2, ///< Gausian Blur
- };
- };
-
- struct SShadowMapEntry
- {
- SShadowMapEntry()
- : m_LightIndex(QT3DS_MAX_U32)
- , m_ShadowMapMode(ShadowMapModes::SSM)
- , m_ShadowFilterFlags(ShadowFilterValues::NONE)
- {
- }
-
- SShadowMapEntry(QT3DSU32 index, ShadowMapModes::Enum mode, ShadowFilterValues::Enum filter,
- NVRenderTexture2D &depthMap, NVRenderTexture2D &depthCopy,
- NVRenderTexture2D &depthTemp)
- : m_LightIndex(index)
- , m_ShadowMapMode(mode)
- , m_ShadowFilterFlags(filter)
- , m_DepthMap(depthMap)
- , m_DepthCopy(depthCopy)
- , m_DepthCube(NULL)
- , m_CubeCopy(NULL)
- , m_DepthRender(depthTemp)
- {
- }
-
- SShadowMapEntry(QT3DSU32 index, ShadowMapModes::Enum mode, ShadowFilterValues::Enum filter,
- NVRenderTextureCube &depthCube, NVRenderTextureCube &cubeTmp,
- NVRenderTexture2D &depthTemp)
- : m_LightIndex(index)
- , m_ShadowMapMode(mode)
- , m_ShadowFilterFlags(filter)
- , m_DepthMap(NULL)
- , m_DepthCopy(NULL)
- , m_DepthCube(depthCube)
- , m_CubeCopy(cubeTmp)
- , m_DepthRender(depthTemp)
- {
- }
-
- QT3DSU32 m_LightIndex; ///< the light index it belongs to
- ShadowMapModes::Enum m_ShadowMapMode; ///< shadow map method
- ShadowFilterValues::Enum m_ShadowFilterFlags; ///< shadow filter mode
-
- // PKC : Adding the DepthRender buffer allows us to have a depth+stencil format when filling
- // the shadow maps (depth+stencil is necessary), but use a more compact format for the
- // actual
- // shadow map used at shade time. See if it's worth adding.
- NVScopedRefCounted<NVRenderTexture2D> m_DepthMap; ///< shadow map texture
- NVScopedRefCounted<NVRenderTexture2D>
- m_DepthCopy; ///< shadow map buffer used during blur passes
- NVScopedRefCounted<NVRenderTextureCube> m_DepthCube; ///< shadow cube map
- NVScopedRefCounted<NVRenderTextureCube>
- m_CubeCopy; ///< cube map buffer used during the blur passes
- NVScopedRefCounted<NVRenderTexture2D>
- m_DepthRender; ///< shadow depth+stencil map used during rendering
-
- QT3DSMat44 m_LightVP; ///< light view projection matrix
- QT3DSMat44 m_LightCubeView[6]; ///< light cubemap view matrices
- QT3DSMat44 m_LightView; ///< light view transform
- };
-
- class Qt3DSShadowMap : public NVRefCounted
- {
- typedef nvvector<SShadowMapEntry> TShadowMapEntryList;
-
- public:
- IQt3DSRenderContext &m_Context;
- volatile QT3DSI32 mRefCount;
-
- public:
- Qt3DSShadowMap(IQt3DSRenderContext &inContext);
- ~Qt3DSShadowMap();
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Context.GetAllocator())
-
- /*
- * @brief Add a shadow map entry
- * This creates a new shadow map if it does not exist or changed
- *
- * @param[in] index shadow map entry index
- * @param[in] width shadow map width
- * @param[in] height shadow map height
- * @param[in] format shadow map format
- * @param[in] samples shadow map sample count
- * @param[in] mode shadow map mode like SSM, VCM
- * @param[in] filter soft shadow map mode filter like PCF
- *
- * @ return no return
- */
- void AddShadowMapEntry(QT3DSU32 index, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum format, QT3DSU32 samples,
- ShadowMapModes::Enum mode, ShadowFilterValues::Enum filter);
-
- /*
- * @brief Get a shadow map entry
- *
- * @param[in] index shadow map entry index
- *
- * @ return shadow map entry or NULL
- */
- SShadowMapEntry *GetShadowMapEntry(QT3DSU32 index);
-
- /*
- * @brief Get shadow map entry count
- *
- * @ return count of shadow map entries
- */
- QT3DSU32 GetShadowMapEntryCount() { return m_ShadowMapList.size(); }
-
- static Qt3DSShadowMap *Create(IQt3DSRenderContext &inContext);
-
- private:
- TShadowMapEntryList m_ShadowMapList; ///< List of shadow map entries
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubPresentationHelper.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubPresentationHelper.h
deleted file mode 100644
index d77c7a7f..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubPresentationHelper.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SUB_PRESENTATION_HELPER_H
-#define QT3DS_RENDER_SUB_PRESENTATION_HELPER_H
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderer.h"
-#include "render/Qt3DSRenderContext.h"
-
-namespace qt3ds {
-namespace render {
-
- // Small helper object to setup the state needed to render a sub presentation
- // correctly. Sub presentations may have transparency, and if they do then
- // then need to be rendered with pre multiple alpha disabled. If they don't,
- // then they need to be rendered with pre-multiply alpha enabled (and have the alpha channel
- // set to 1
- struct SSubPresentationHelper
- {
- IQt3DSRenderContext &m_RenderContext;
- QSize m_PreviousPresentationDimensions;
-
- bool m_WasInSubPresentation;
-
- SSubPresentationHelper(IQt3DSRenderContext &inContext,
- const QSize &inPresDimensions)
- : m_RenderContext(inContext)
- , m_PreviousPresentationDimensions(inContext.GetCurrentPresentationDimensions())
- , m_WasInSubPresentation(inContext.IsInSubPresentation())
- {
- m_RenderContext.SetInSubPresentation(true);
- m_RenderContext.SetPresentationDimensions(inPresDimensions);
- }
- ~SSubPresentationHelper()
- {
- m_RenderContext.SetInSubPresentation(m_WasInSubPresentation);
- m_RenderContext.SetPresentationDimensions(m_PreviousPresentationDimensions);
- }
- };
-}
-}
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.cpp
deleted file mode 100644
index 0b9d42d3..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderSubpresentation.h"
-#include "Qt3DSRenderRenderList.h"
-#ifdef _WIN32
-#pragma warning(disable : 4355) // this used in initializer list. I have never seen this result in
- // a physical error
-#endif
-namespace qt3ds {
-namespace render {
-
- Qt3DSRenderPickResult CSubPresentationPickQuery::Pick(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool inPickEverything)
- {
- return m_Renderer.DoGraphQueryPick(inMouseCoords, inViewportDimensions, inPickEverything);
- }
-
- CSubPresentationRenderer::CSubPresentationRenderer(IQt3DSRenderContext &inRenderContext,
- SPresentation &inPresentation)
- : m_RenderContext(inRenderContext)
- , m_Presentation(inPresentation)
- , mRefCount(0)
- , m_PickQuery(*this)
- , m_OffscreenRendererType(inRenderContext.GetStringTable().RegisterStr(GetRendererName()))
- {
- }
-
- SOffscreenRendererEnvironment
- CSubPresentationRenderer::GetDesiredEnvironment(QT3DSVec2 /*inPresScale*/)
- {
- // If we aren't using a clear color, then we are expected to blend with the background
- bool hasTransparency = m_Presentation.m_Scene->m_UseClearColor ? false : true;
- NVRenderTextureFormats::Enum format =
- hasTransparency ? NVRenderTextureFormats::RGBA8 : NVRenderTextureFormats::RGB8;
- return SOffscreenRendererEnvironment((QT3DSU32)(m_Presentation.m_PresentationDimensions.x),
- (QT3DSU32)(m_Presentation.m_PresentationDimensions.y),
- format, OffscreenRendererDepthValues::Depth16, false,
- AAModeValues::NoAA);
- }
-
- SOffscreenRenderFlags
- CSubPresentationRenderer::NeedsRender(const SOffscreenRendererEnvironment & /*inEnvironment*/,
- QT3DSVec2 /*inPresScale*/,
- const SRenderInstanceId instanceId)
- {
- bool hasTransparency = m_Presentation.m_Scene->m_UseClearColor ? false : true;
- NVRenderRect theViewportSize(m_RenderContext.GetRenderList().GetViewport());
- bool wasDirty = m_Presentation.m_Scene->PrepareForRender(
- QT3DSVec2((QT3DSF32)theViewportSize.m_Width, (QT3DSF32)theViewportSize.m_Height),
- m_RenderContext, instanceId);
- return SOffscreenRenderFlags(hasTransparency, wasDirty);
- }
-
- // Returns true if the rendered result image has transparency, or false
- // if it should be treated as a completely opaque image.
- void CSubPresentationRenderer::Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2,
- SScene::RenderClearCommand inClearColorBuffer,
- const SRenderInstanceId instanceId)
- {
- SSubPresentationHelper theHelper(
- m_RenderContext,
- QSize((QT3DSU32)inEnvironment.m_Width, (QT3DSU32)inEnvironment.m_Height));
- NVRenderRect theViewportSize(inRenderContext.GetViewport());
- m_Presentation.m_Scene->Render(
- QT3DSVec2((QT3DSF32)theViewportSize.m_Width, (QT3DSF32)theViewportSize.m_Height),
- m_RenderContext, inClearColorBuffer, instanceId);
- m_LastRenderedEnvironment = inEnvironment;
- }
-
- void CSubPresentationRenderer::RenderWithClear(
- const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresScale,
- SScene::RenderClearCommand inClearBuffer, QT3DSVec4 inClearColor,
- const SRenderInstanceId id)
- {
- Q_UNUSED(inEnvironment);
- Q_UNUSED(inPresScale);
- NVRenderRect theViewportSize(inRenderContext.GetViewport());
- m_Presentation.m_Scene->RenderWithClear(
- QT3DSVec2((QT3DSF32)theViewportSize.m_Width, (QT3DSF32)theViewportSize.m_Height),
- m_RenderContext, inClearBuffer, inClearColor, id);
- }
-
- // You know the viewport dimensions because
- Qt3DSRenderPickResult CSubPresentationRenderer::DoGraphQueryPick(
- const QT3DSVec2 &inMouseCoords, const QT3DSVec2 &inViewportDimensions, bool inPickEverything)
- {
- Qt3DSRenderPickResult thePickResult;
-
- if (m_Presentation.m_Scene && m_Presentation.m_Scene->m_FirstChild) {
- thePickResult = m_RenderContext.GetRenderer().Pick(
- *m_Presentation.m_Scene->m_FirstChild, inViewportDimensions,
- QT3DSVec2(inMouseCoords.x, inMouseCoords.y), true, inPickEverything);
- }
- return thePickResult;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.h
deleted file mode 100644
index 4adac84f..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderSubpresentation.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SUBPRESENTATION_H
-#define QT3DS_RENDER_SUBPRESENTATION_H
-
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSRenderSubPresentationHelper.h"
-#include "Qt3DSRenderPresentation.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- class CSubPresentationRenderer;
-
- struct CSubPresentationPickQuery : public IGraphObjectPickQuery
- {
- CSubPresentationRenderer &m_Renderer;
-
- CSubPresentationPickQuery(CSubPresentationRenderer &renderer)
- : m_Renderer(renderer)
- {
- }
- Qt3DSRenderPickResult Pick(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool inPickEverything) override;
- };
-
- class CSubPresentationRenderer : public IOffscreenRenderer
- {
- public:
- IQt3DSRenderContext &m_RenderContext;
- SPresentation &m_Presentation;
- volatile QT3DSI32 mRefCount;
- SOffscreenRendererEnvironment m_LastRenderedEnvironment;
- CSubPresentationPickQuery m_PickQuery;
- CRegisteredString m_OffscreenRendererType;
-
- CSubPresentationRenderer(IQt3DSRenderContext &inRenderContext, SPresentation &inPresentation);
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext.GetAllocator())
-
- SOffscreenRendererEnvironment GetDesiredEnvironment(QT3DSVec2 inPresScale) override;
- virtual SOffscreenRenderFlags
- NeedsRender(const SOffscreenRendererEnvironment &inEnvironment, QT3DSVec2 inPresScale,
- const SRenderInstanceId instanceId) override;
- void Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext & /*inRenderContext*/,
- QT3DSVec2 inPresScale, SScene::RenderClearCommand inClearBuffer,
- const SRenderInstanceId instanceId) override;
- void RenderWithClear(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext,
- QT3DSVec2 inPresScale, SScene::RenderClearCommand inClearBuffer,
- QT3DSVec4 inClearColor,
- const SRenderInstanceId instanceId) override;
- IGraphObjectPickQuery *GetGraphObjectPickQuery(const SRenderInstanceId) override { return &m_PickQuery; }
- bool Pick(const QT3DSVec2 & /*inMouseCoords*/, const QT3DSVec2 & /*inViewportDimensions*/,
- const SRenderInstanceId) override
- {
- return false;
- }
- void addCallback(IOffscreenRendererCallback *cb) override
- {
-
- }
- // Used for RTTI purposes so we can safely static-cast an offscreen renderer to a
- // CSubPresentationRenderer
- static const char *GetRendererName() { return "SubPresentation"; }
- CRegisteredString GetOffscreenRendererType() override { return m_OffscreenRendererType; }
-
- Qt3DSRenderPickResult DoGraphQueryPick(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool inPickEverything);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTaggedPointer.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTaggedPointer.h
deleted file mode 100644
index 8dd8bdd0..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTaggedPointer.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TAGGED_POINTER_H
-#define QT3DS_RENDER_TAGGED_POINTER_H
-#include "Qt3DSRender.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
-
- // User's will need to define specialize this struct in order
- // to de-tag a pointer.
- template <typename TDataType>
- struct SPointerTag
- {
- /* Expected API for runtime RTTI
- static CRegisteredString GetTag() { return g_dtype_specific_string; }
- */
- };
-
- // A pointer tagged with an identifier so we can have generic
- // user data that is still somewhat typesafe.
- struct STaggedPointer
- {
- void *m_UserData;
- QT3DSU32 m_Tag;
- STaggedPointer()
- : m_UserData(NULL)
- , m_Tag(0)
- {
- }
-
- STaggedPointer(void *inUserData, QT3DSU32 inTag)
- : m_UserData(inUserData)
- , m_Tag(inTag)
- {
- }
-
- template <typename TDataType>
- STaggedPointer(TDataType *inType)
- : m_UserData(reinterpret_cast<void *>(inType))
- , m_Tag(SPointerTag<TDataType>::GetTag())
- {
- }
-
- template <typename TDataType>
- TDataType *DynamicCast() const
- {
- if (m_Tag == SPointerTag<TDataType>::GetTag())
- return reinterpret_cast<TDataType *>(m_UserData);
- return NULL;
- }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTessModeValues.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTessModeValues.h
deleted file mode 100644
index 15ea03c9..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTessModeValues.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TESS_MODE_VALUES_H
-#define QT3DS_RENDER_TESS_MODE_VALUES_H
-#include "Qt3DSRender.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SDefaultMaterial;
- class IBufferManager;
-
- struct TessModeValues
- {
- enum Enum {
- NoTess = 0,
- TessLinear = 1,
- TessPhong = 2,
- TessNPatch = 3,
- };
-
- static const char *toString(Enum value)
- {
- switch (value) {
- case NoTess:
- return "NoTess";
- break;
- case TessLinear:
- return "TessLinear";
- break;
- case TessPhong:
- return "TessPhong";
- break;
- case TessNPatch:
- return "TessNPatch";
- break;
- default:
- return "NoTess";
- break;
- }
- }
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.cpp
deleted file mode 100644
index 81c1d232..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderTextTextureAtlas.h"
-#include "Qt3DSTextRenderer.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderContext.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct STextTextureAtlas : public ITextTextureAtlas
-{
- static const QT3DSI32 TEXTURE_ATLAS_DIM =
- 256; // if you change this you need to adjust Qt3DSOnscreenTextRenderer size as well
-
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- NVScopedRefCounted<ITextRenderer> m_TextRenderer;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
-
- STextTextureAtlas(NVFoundationBase &inFnd, ITextRenderer &inRenderer,
- NVRenderContext &inRenderContext)
- : m_Foundation(inFnd)
- , mRefCount(0)
- , m_TextRenderer(inRenderer)
- , m_RenderContext(inRenderContext)
- , m_TextureAtlasInitialized(false)
- , m_textureAtlas(NULL)
- {
- }
-
- virtual ~STextTextureAtlas()
- {
- if (m_textureAtlas) {
- m_textureAtlas->release();
- }
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- TTextRenderAtlasDetailsAndTexture RenderText(const STextRenderInfo &inText) override
- {
- SRenderTextureAtlasDetails theDetails = m_TextRenderer->RenderText(inText);
-
- return TTextRenderAtlasDetailsAndTexture(theDetails, m_textureAtlas);
- }
-
- bool IsInitialized() override { return m_TextureAtlasInitialized && m_textureAtlas; }
-
- TTextTextureAtlasDetailsAndTexture PrepareTextureAtlas() override
- {
- if (!m_TextureAtlasInitialized && !m_textureAtlas) {
- // create the texture atlas entries
- QT3DSI32 count = m_TextRenderer->CreateTextureAtlas();
-
- m_textureAtlas = m_RenderContext->CreateTexture2D();
- if (m_textureAtlas && count) {
- m_TextureAtlasInitialized = true;
- m_textureAtlas->addRef();
- // if you change the size you need to adjust Qt3DSOnscreenTextRenderer too
- if (m_RenderContext->GetRenderContextType() == NVRenderContextValues::GLES2) {
- m_textureAtlas->SetTextureData(NVDataRef<QT3DSU8>(), 0, TEXTURE_ATLAS_DIM,
- TEXTURE_ATLAS_DIM, NVRenderTextureFormats::RGBA8);
- } else {
- m_textureAtlas->SetTextureData(NVDataRef<QT3DSU8>(), 0, TEXTURE_ATLAS_DIM,
- TEXTURE_ATLAS_DIM, NVRenderTextureFormats::Alpha8);
- }
- m_textureAtlas->SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- m_textureAtlas->SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- m_textureAtlas->SetTextureWrapS(NVRenderTextureCoordOp::ClampToEdge);
- m_textureAtlas->SetTextureWrapT(NVRenderTextureCoordOp::ClampToEdge);
- qt3ds::render::STextureDetails texTexDetails = m_textureAtlas->GetTextureDetails();
- return TTextTextureAtlasDetailsAndTexture(
- STextTextureAtlasDetails(texTexDetails.m_Height, texTexDetails.m_Height, false,
- count),
- m_textureAtlas);
- }
- }
-
- return TTextTextureAtlasDetailsAndTexture(STextTextureAtlasDetails(), NULL);
- }
-
-private:
- bool m_TextureAtlasInitialized;
- NVRenderTexture2D *m_textureAtlas; // this is the actual texture which has application lifetime
-};
-
-} // namespace
-
-ITextTextureAtlas &ITextTextureAtlas::CreateTextureAtlas(NVFoundationBase &inFnd,
- ITextRenderer &inTextRenderer,
- NVRenderContext &inRenderContext)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), STextTextureAtlas)(inFnd, inTextRenderer, inRenderContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.h
deleted file mode 100644
index 7a3f1215..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureAtlas.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TEXT_TEXTURE_ATLAS_H
-#define QT3DS_RENDER_TEXT_TEXTURE_ATLAS_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSRenderText.h"
-#include "EASTL/algorithm.h"
-
-namespace qt3ds {
-namespace render {
-
- class ITextRenderer;
-
- typedef eastl::pair<STextTextureAtlasDetails, NVScopedRefCounted<NVRenderTexture2D>>
- TTextTextureAtlasDetailsAndTexture;
- typedef eastl::pair<SRenderTextureAtlasDetails, NVScopedRefCounted<NVRenderTexture2D>>
- TTextRenderAtlasDetailsAndTexture;
-
- class ITextTextureAtlas : public NVRefCounted
- {
- protected:
- virtual ~ITextTextureAtlas() {}
- public:
- virtual TTextRenderAtlasDetailsAndTexture RenderText(const STextRenderInfo &inText) = 0;
- virtual bool IsInitialized() = 0;
- virtual TTextTextureAtlasDetailsAndTexture PrepareTextureAtlas() = 0;
-
- static ITextTextureAtlas &CreateTextureAtlas(NVFoundationBase &inFnd,
- ITextRenderer &inTextRenderer,
- NVRenderContext &inRenderContext);
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.cpp
deleted file mode 100644
index 8edbecaf..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderTextTextureCache.h"
-#include "Qt3DSTextRenderer.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSPool.h"
-
-using namespace qt3ds::render;
-
-namespace eastl {
-template <>
-struct hash<STextRenderInfo>
-{
- size_t operator()(const qt3ds::render::STextRenderInfo &inInfo) const
- {
- size_t retval = hash<size_t>()(reinterpret_cast<size_t>(inInfo.m_Text.c_str()));
- retval = retval ^ hash<size_t>()(reinterpret_cast<size_t>(inInfo.m_Font.c_str()));
- retval = retval ^ hash<float>()(inInfo.m_FontSize);
- retval = retval ^ hash<int>()(static_cast<int>(inInfo.m_HorizontalAlignment));
- retval = retval ^ hash<int>()(static_cast<int>(inInfo.m_VerticalAlignment));
- retval = retval ^ hash<float>()(inInfo.m_Leading);
- retval = retval ^ hash<float>()(inInfo.m_Tracking);
- retval = retval ^ hash<bool>()(inInfo.m_DropShadow);
- retval = retval ^ hash<float>()(inInfo.m_DropShadowStrength);
- retval = retval ^ hash<float>()(inInfo.m_DropShadowOffsetX);
- retval = retval ^ hash<float>()(inInfo.m_DropShadowOffsetY);
- retval = retval ^ hash<float>()(inInfo.m_BoundingBox.x);
- retval = retval ^ hash<float>()(inInfo.m_BoundingBox.y);
- retval = retval ^ hash<int>()(static_cast<int>(inInfo.m_Elide));
- retval = retval ^ hash<int>()(static_cast<int>(inInfo.m_WordWrap));
- retval = retval ^ hash<bool>()(inInfo.m_EnableAcceleratedFont);
- return retval;
- }
-};
-}
-
-namespace {
-struct STextRenderInfoAndHash
-{
- STextRenderInfo m_Info;
- QT3DSF32 m_ScaleFactor;
- size_t m_Hashcode;
- STextRenderInfoAndHash(const STextRenderInfo &inInfo, QT3DSF32 inScaleFactor)
- : m_Info(inInfo)
- , m_ScaleFactor(inScaleFactor)
- , m_Hashcode(eastl::hash<STextRenderInfo>()(inInfo) ^ eastl::hash<float>()(inScaleFactor))
- {
- }
- bool operator==(const STextRenderInfoAndHash &inOther) const
- {
- return m_Info.m_Text == inOther.m_Info.m_Text && m_Info.m_Font == inOther.m_Info.m_Font
- && m_Info.m_FontSize == inOther.m_Info.m_FontSize
- && m_Info.m_HorizontalAlignment == inOther.m_Info.m_HorizontalAlignment
- && m_Info.m_VerticalAlignment == inOther.m_Info.m_VerticalAlignment
- && m_Info.m_Leading == inOther.m_Info.m_Leading
- && m_Info.m_Tracking == inOther.m_Info.m_Tracking
- && m_Info.m_DropShadow == inOther.m_Info.m_DropShadow
- && m_Info.m_DropShadowStrength == inOther.m_Info.m_DropShadowStrength
- && m_Info.m_DropShadowOffsetX == inOther.m_Info.m_DropShadowOffsetX
- && m_Info.m_DropShadowOffsetY == inOther.m_Info.m_DropShadowOffsetY
- && m_Info.m_BoundingBox == inOther.m_Info.m_BoundingBox
- && m_Info.m_WordWrap == inOther.m_Info.m_WordWrap
- && m_Info.m_EnableAcceleratedFont == inOther.m_Info.m_EnableAcceleratedFont
- && m_ScaleFactor == inOther.m_ScaleFactor;
- }
-};
-}
-
-namespace eastl {
-template <>
-struct hash<STextRenderInfoAndHash>
-{
- size_t operator()(const STextRenderInfoAndHash &inInfo) const { return inInfo.m_Hashcode; }
-};
-};
-
-namespace {
-
-struct STextCacheNode
-{
- STextCacheNode *m_PreviousSibling;
- STextCacheNode *m_NextSibling;
- STextRenderInfoAndHash m_RenderInfo;
- TTPathObjectAndTexture m_TextInfo;
- QT3DSU32 m_FrameCount;
-
- STextCacheNode(const STextRenderInfoAndHash &inRenderInfo,
- const TTPathObjectAndTexture &inTextInfo)
- : m_PreviousSibling(NULL)
- , m_NextSibling(NULL)
- , m_RenderInfo(inRenderInfo)
- , m_TextInfo(inTextInfo)
- , m_FrameCount(0)
- {
- }
-};
-
-typedef nvhash_map<STextRenderInfoAndHash, STextCacheNode *> TTextureInfoHash;
-
-DEFINE_INVASIVE_LIST(TextCacheNode);
-IMPLEMENT_INVASIVE_LIST(TextCacheNode, m_PreviousSibling, m_NextSibling);
-
-struct STextTextureCache : public ITextTextureCache
-{
- typedef Pool<STextCacheNode, ForwardingAllocator> TPoolType;
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- NVScopedRefCounted<ITextRenderer> m_TextRenderer;
- TTextureInfoHash m_TextureCache;
- TTextCacheNodeList m_LRUList;
- TPoolType m_CacheNodePool;
- QT3DSU32 m_HighWaterMark;
- QT3DSU32 m_FrameCount;
- QT3DSU32 m_TextureTotalBytes;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- bool m_CanUsePathRendering; ///< true if we use hardware accelerated font rendering
-
- STextTextureCache(NVFoundationBase &inFnd, ITextRenderer &inRenderer,
- NVRenderContext &inRenderContext)
- : m_Foundation(inFnd)
- , mRefCount(0)
- , m_TextRenderer(inRenderer)
- , m_TextureCache(m_Foundation.getAllocator(), "STextTextureCache::m_TextureCache")
- , m_CacheNodePool(ForwardingAllocator(m_Foundation.getAllocator(),
- "STextTextureCache::m_CacheNodePool"))
- , m_HighWaterMark(0x100000)
- , m_FrameCount(0)
- , m_TextureTotalBytes(0)
- , m_RenderContext(inRenderContext)
- {
- // hardware accelerate font rendering not ready yet
- m_CanUsePathRendering = (m_RenderContext->IsPathRenderingSupported()
- && m_RenderContext->IsProgramPipelineSupported());
- }
-
- virtual ~STextTextureCache()
- {
- for (TTextCacheNodeList::iterator iter = m_LRUList.begin(), end = m_LRUList.end();
- iter != end; ++iter)
- iter->~STextCacheNode();
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- static inline QT3DSU32 GetNumBytes(NVRenderTexture2D &inTexture)
- {
- STextureDetails theDetails(inTexture.GetTextureDetails());
- return theDetails.m_Width * theDetails.m_Height
- * NVRenderTextureFormats::getSizeofFormat(theDetails.m_Format);
- }
-
- NVScopedRefCounted<NVRenderTexture2D> InvalidateLastItem()
- {
- NVScopedRefCounted<NVRenderTexture2D> nextTexture;
- if (m_LRUList.empty() == false) {
- STextCacheNode &theEnd = m_LRUList.back();
- if (theEnd.m_FrameCount != m_FrameCount) {
- nextTexture = theEnd.m_TextInfo.second.second;
- STextureDetails theDetails = nextTexture->GetTextureDetails();
- m_TextureTotalBytes -= GetNumBytes(*nextTexture.mPtr);
- m_LRUList.remove(theEnd);
- // copy the key because the next statement will destroy memory
- m_TextureCache.erase(theEnd.m_RenderInfo);
- theEnd.~STextCacheNode();
- m_CacheNodePool.deallocate(&theEnd);
- }
- }
- return nextTexture;
- }
-
- TTPathObjectAndTexture RenderText(const STextRenderInfo &inText, QT3DSF32 inScaleFactor) override
- {
- STextRenderInfoAndHash theKey(inText, inScaleFactor);
- TTextureInfoHash::iterator theFind(
- m_TextureCache.find(theKey));
- STextCacheNode *retval = NULL;
- if (theFind != m_TextureCache.end()) {
- retval = theFind->second;
- m_LRUList.remove(*retval);
- } else {
- NVScopedRefCounted<NVRenderTexture2D> nextTexture;
- if (m_TextureTotalBytes >= m_HighWaterMark && m_LRUList.empty() == false)
- nextTexture = InvalidateLastItem();
-
- if (nextTexture.mPtr == NULL)
- nextTexture = m_RenderContext->CreateTexture2D();
-
- NVScopedRefCounted<NVRenderPathFontItem> nextPathFontItemObject;
- NVScopedRefCounted<NVRenderPathFontSpecification> nextPathFontObject;
- // HW acceleration for fonts not supported
- //if (m_CanUsePathRendering && inText.m_EnableAcceleratedFont) {
- // nextPathFontItemObject = m_RenderContext->CreatePathFontItem();
- // nextPathFontObject = m_RenderContext->CreatePathFontSpecification(inText.m_Font);
- //}
-
- STextRenderInfo theTextInfo(inText);
- theTextInfo.m_FontSize *= inScaleFactor;
- STextTextureDetails theDetails;
-
-
- // HW acceleration for fonts not supported
- //if (!m_CanUsePathRendering || !inText.m_EnableAcceleratedFont)
- theDetails = m_TextRenderer->RenderText(theTextInfo, *nextTexture.mPtr);
- //else
- // theDetails = m_TextRenderer->RenderText(theTextInfo, *nextPathFontItemObject.mPtr,
- // *nextPathFontObject.mPtr);
-
- if (fabs(inScaleFactor - 1.0f) > .001f) {
- TTPathObjectAndTexture theCanonicalDetails = RenderText(inText, 1.0f);
- theDetails.m_ScaleFactor.x =
- (QT3DSF32)theDetails.m_TextWidth / theCanonicalDetails.second.first.m_TextWidth;
- theDetails.m_ScaleFactor.y =
- (QT3DSF32)theDetails.m_TextHeight / theCanonicalDetails.second.first.m_TextHeight;
- }
- retval = m_CacheNodePool.construct(
- theKey, TTPathObjectAndTexture(
- TPathFontSpecAndPathObject(nextPathFontObject, nextPathFontItemObject),
- TTextTextureDetailsAndTexture(theDetails, nextTexture)),
- __FILE__, __LINE__);
- TTextureInfoHash::iterator insert =
- m_TextureCache.insert(eastl::make_pair(theKey, retval)).first;
- if (!m_CanUsePathRendering)
- m_TextureTotalBytes += GetNumBytes(*(retval->m_TextInfo.second.second.mPtr));
- }
- retval->m_FrameCount = m_FrameCount;
- m_LRUList.push_front(*retval);
- return retval->m_TextInfo;
- }
- // We may have one more texture in cache than this byte count, but this will be the limiting
- // factor.
- QT3DSU32 GetCacheHighWaterBytes() const override { return m_HighWaterMark; }
- // default cache size is 10 MB.
- void SetCacheHighWaterBytes(QT3DSU32 inByteCount) override { m_HighWaterMark = inByteCount; }
-
- void BeginFrame() override {}
- void EndFrame() override
- {
- // algorithm is resistant to rollover.
- ++m_FrameCount;
- // Release any texture that put us over the limit.
- // This almost guarantees thrashing if the limit is set too low. Enable at your
- // own risk at *TEST CAREFULLY*
- /*
- while( m_TextureTotalBytes >= m_HighWaterMark && m_LRUList.empty() == false )
- InvalidateLastItem();
- */
- }
-};
-}
-
-ITextTextureCache &ITextTextureCache::CreateTextureCache(NVFoundationBase &inFnd,
- ITextRenderer &inTextRenderer,
- NVRenderContext &inRenderContext)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), STextTextureCache)(inFnd, inTextRenderer, inRenderContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.h
deleted file mode 100644
index 45d40217..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTextureCache.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TEXT_TEXTURE_CACHE_H
-#define QT3DS_RENDER_TEXT_TEXTURE_CACHE_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "Qt3DSRenderText.h"
-#include "EASTL/algorithm.h"
-
-namespace qt3ds {
-namespace render {
-
- class ITextRenderer;
-
- typedef eastl::pair<NVScopedRefCounted<NVRenderPathFontSpecification>,
- NVScopedRefCounted<NVRenderPathFontItem>>
- TPathFontSpecAndPathObject;
- typedef eastl::pair<STextTextureDetails, NVScopedRefCounted<NVRenderTexture2D>>
- TTextTextureDetailsAndTexture;
- typedef eastl::pair<TPathFontSpecAndPathObject, TTextTextureDetailsAndTexture>
- TTPathObjectAndTexture;
-
- class ITextTextureCache : public NVRefCounted
- {
- protected:
- virtual ~ITextTextureCache() {}
- public:
- virtual TTPathObjectAndTexture RenderText(const STextRenderInfo &inText,
- QT3DSF32 inScaleFactor) = 0;
- // We may have one more texture in cache than this byte count, but this will be the limiting
- // factor.
- virtual QT3DSU32 GetCacheHighWaterBytes() const = 0;
- virtual void SetCacheHighWaterBytes(QT3DSU32 inNumBytes) = 0;
-
- virtual void BeginFrame() = 0;
- // We need to know the frame rhythm because we can't release anything that was touched this
- // frame.
- virtual void EndFrame() = 0;
-
- static ITextTextureCache &CreateTextureCache(NVFoundationBase &inFnd,
- ITextRenderer &inTextRenderer,
- NVRenderContext &inRenderContext);
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTypes.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTypes.h
deleted file mode 100644
index bbaaa38d..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextTypes.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TEXT_TYPES_H
-#define QT3DS_RENDER_TEXT_TYPES_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSVec2.h"
-
-namespace qt3ds {
-namespace render {
-
- struct TextHorizontalAlignment
- {
- enum Enum {
- Unknown = 0,
- Left,
- Center,
- Right,
- };
- };
-
- struct TextVerticalAlignment
- {
- enum Enum {
- Unknown = 0,
- Top,
- Middle,
- Bottom,
- };
- };
-
- struct TextWordWrap
- {
- enum Enum {
- Unknown = 0,
- Clip,
- WrapWord,
- WrapAnywhere,
- };
- };
-
- struct TextElide
- {
- enum Enum {
- ElideNone = 0,
- ElideLeft,
- ElideMiddle,
- ElideRight,
- };
- };
-
- struct STextDimensions
- {
- QT3DSU32 m_TextWidth;
- QT3DSU32 m_TextHeight;
- STextDimensions(QT3DSU32 w, QT3DSU32 h)
- : m_TextWidth(w)
- , m_TextHeight(h)
- {
- }
- STextDimensions()
- : m_TextWidth(0)
- , m_TextHeight(0)
- {
- }
- };
-
- struct STextTextureDetails : public STextDimensions
- {
- QT3DSVec2 m_ScaleFactor;
- bool m_FlipY;
- STextTextureDetails(QT3DSU32 w, QT3DSU32 h, bool inFlipY, QT3DSVec2 scaleF)
- : STextDimensions(w, h)
- , m_ScaleFactor(scaleF)
- , m_FlipY(inFlipY)
- {
- }
- STextTextureDetails()
- : m_ScaleFactor(1.0f)
- , m_FlipY(false)
- {
- }
- };
-
- struct STextTextureAtlasEntryDetails : public STextDimensions
- {
- QT3DSI32 m_X, m_Y;
- STextTextureAtlasEntryDetails(QT3DSU32 w, QT3DSU32 h, QT3DSI32 x, QT3DSI32 y)
- : STextDimensions(w, h)
- , m_X(x)
- , m_Y(y)
- {
- }
- STextTextureAtlasEntryDetails()
- : m_X(0)
- , m_Y(0)
- {
- }
- };
-
- struct SRenderTextureAtlasDetails
- {
- QT3DSU32 m_VertexCount;
- NVDataRef<QT3DSU8> m_Vertices;
-
- SRenderTextureAtlasDetails(QT3DSU32 count, NVDataRef<QT3DSU8> inVertices)
- : m_VertexCount(count)
- , m_Vertices(inVertices)
- {
- }
- SRenderTextureAtlasDetails()
- : m_VertexCount(0)
- , m_Vertices(NVDataRef<QT3DSU8>())
- {
- }
- };
-
- struct STextTextureAtlasDetails : public STextTextureDetails
- {
- QT3DSU32 m_EntryCount;
- STextTextureAtlasDetails(QT3DSU32 w, QT3DSU32 h, bool inFlipY, QT3DSU32 count)
- : STextTextureDetails(w, h, inFlipY, QT3DSVec2(1.0f))
- , m_EntryCount(count)
- {
- }
- STextTextureAtlasDetails()
- : m_EntryCount(0)
- {
- }
- };
-
- // Adding/removing a member to this object means you need to update the texture cache code
- // - UICRenderTextTextureCache.cpp
-
- struct STextRenderInfo
- {
- CRegisteredString m_Text;
- CRegisteredString m_Font;
- QT3DSF32 m_FontSize;
- TextHorizontalAlignment::Enum m_HorizontalAlignment;
- TextVerticalAlignment::Enum m_VerticalAlignment;
- QT3DSF32 m_Leading; // space between lines
- QT3DSF32 m_Tracking; // space between letters
- bool m_DropShadow;
- QT3DSF32 m_DropShadowStrength;
- QT3DSF32 m_DropShadowOffsetX;
- QT3DSF32 m_DropShadowOffsetY;
- TextWordWrap::Enum m_WordWrap;
- QT3DSVec2 m_BoundingBox;
- TextElide::Enum m_Elide;
-
- QT3DSF32 m_ScaleX; // Pixel scale in X
- QT3DSF32 m_ScaleY; // Pixel scale in Y
-
- bool m_EnableAcceleratedFont; // use NV path rendering
-
- STextRenderInfo();
- ~STextRenderInfo();
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.cpp
deleted file mode 100644
index 062e7d57..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderTextureAtlas.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderContext.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-// a algorithm based on http://clb.demon.fi/files/RectangleBinPack/
-struct STextureAtlasBinPackSL
-{
-public:
- STextureAtlasBinPackSL(NVRenderContext &inContext, QT3DSI32 width, QT3DSI32 height)
- : m_BinWidth(width)
- , m_BinHeight(height)
- , m_SkyLine(inContext.GetAllocator(), "STextureAtlasBinPackSL::m_SkyLine")
- {
- // setup first entry
- SSkylineNode theNode = { 0, 0, width };
- m_SkyLine.push_back(theNode);
- }
-
- ~STextureAtlasBinPackSL() { m_SkyLine.clear(); }
-
- /* insert new rect
- *
- */
- STextureAtlasRect Insert(QT3DSI32 width, QT3DSI32 height)
- {
- QT3DSI32 binHeight;
- QT3DSI32 binWidth;
- QT3DSI32 binIndex;
-
- STextureAtlasRect newNode = findPosition(width, height, &binWidth, &binHeight, &binIndex);
-
- if (binIndex != -1) {
- // adjust skyline nodes
- addSkylineLevelNode(binIndex, newNode);
- }
-
- return newNode;
- }
-
-private:
- /// Represents a single level (a horizontal line) of the skyline/horizon/envelope.
- struct SSkylineNode
- {
- int x; ///< The starting x-coordinate (leftmost).
- int y; ///< The y-coordinate of the skyline level line.
- int width; /// The line width. The ending coordinate (inclusive) will be x+width-1.
- };
-
- /* find position
- *
- */
- STextureAtlasRect findPosition(QT3DSI32 width, QT3DSI32 height, QT3DSI32 *binWidth, QT3DSI32 *binHeight,
- QT3DSI32 *binIndex)
- {
- *binWidth = m_BinWidth;
- *binHeight = m_BinHeight;
- *binIndex = -1;
- STextureAtlasRect newRect;
-
- for (QT3DSU32 i = 0; i < m_SkyLine.size(); ++i) {
- QT3DSI32 y = getSkylineLevel(i, width, height);
-
- if (y >= 0) {
- if ((y + height < *binHeight)
- || ((y + height == *binHeight) && m_SkyLine[i].width < *binWidth)) {
- *binHeight = y + height;
- *binIndex = i;
- *binWidth = m_SkyLine[i].width;
- newRect.m_X = m_SkyLine[i].x;
- newRect.m_Y = y;
- newRect.m_Width = width;
- newRect.m_Height = height;
- }
- }
- }
-
- return newRect;
- }
-
- /* @brief check if rectangle can be placed into the the bin
- *
- * return skyline hight
- */
- int getSkylineLevel(QT3DSU32 binIndex, QT3DSI32 width, QT3DSI32 height)
- {
- // first check width exceed
- QT3DSI32 x = m_SkyLine[binIndex].x;
- if (x + width > m_BinWidth)
- return -1;
-
- QT3DSI32 leftAlign = width;
- QT3DSU32 index = binIndex;
- QT3DSI32 y = m_SkyLine[index].y;
-
- while (leftAlign > 0) {
- y = (y > m_SkyLine[index].y) ? y : m_SkyLine[index].y;
- // check hight
- if (y + height > m_BinHeight)
- return -1;
-
- leftAlign -= m_SkyLine[index].width;
- ++index;
-
- if (index > m_SkyLine.size())
- return -1;
- }
-
- return y;
- }
-
- /* @brief add an new skyline entry
- *
- * return no return
- */
- void addSkylineLevelNode(QT3DSI32 binIndex, const STextureAtlasRect &newRect)
- {
- SSkylineNode newNode;
-
- newNode.x = newRect.m_X;
- newNode.y = newRect.m_Y + newRect.m_Height;
- newNode.width = newRect.m_Width;
- m_SkyLine.insert(m_SkyLine.begin() + binIndex, newNode);
-
- // iterate over follow up nodes and adjust
- for (QT3DSU32 i = binIndex + 1; i < m_SkyLine.size(); ++i) {
- if (m_SkyLine[i].x < m_SkyLine[i - 1].x + m_SkyLine[i - 1].width) {
- int shrink = m_SkyLine[i - 1].x + m_SkyLine[i - 1].width - m_SkyLine[i].x;
-
- m_SkyLine[i].x += shrink;
- m_SkyLine[i].width -= shrink;
-
- if (m_SkyLine[i].width <= 0) {
- m_SkyLine.erase(m_SkyLine.begin() + i);
- --i;
- } else {
- break;
- }
- } else {
- break;
- }
- }
-
- mergeSkylineLevelNodes();
- }
-
- /* @brief merge skyline node
- *
- * return no return
- */
- void mergeSkylineLevelNodes()
- {
- // check if we can merge nodes
- for (QT3DSU32 i = 0; i < m_SkyLine.size() - 1; ++i) {
- if (m_SkyLine[i].y == m_SkyLine[i + 1].y) {
- m_SkyLine[i].width += m_SkyLine[i + 1].width;
- m_SkyLine.erase(m_SkyLine.begin() + (i + 1));
- --i;
- }
- }
- }
-
- QT3DSI32 m_BinWidth;
- QT3DSI32 m_BinHeight;
-
- nvvector<SSkylineNode> m_SkyLine;
-};
-
-struct STextureAtlasEntry
-{
- STextureAtlasEntry()
- : m_X(0)
- , m_Y(0)
- , m_Width(0)
- , m_Height(0)
- , m_pBuffer(NVDataRef<QT3DSU8>())
- {
- }
- STextureAtlasEntry(QT3DSF32 x, QT3DSF32 y, QT3DSF32 w, QT3DSF32 h, NVDataRef<QT3DSU8> buffer)
- : m_X(x)
- , m_Y(y)
- , m_Width(w)
- , m_Height(h)
- , m_pBuffer(buffer)
- {
- }
- STextureAtlasEntry(const STextureAtlasEntry &entry)
- {
- m_X = entry.m_X;
- m_Y = entry.m_Y;
- m_Width = entry.m_Width;
- m_Height = entry.m_Height;
- m_pBuffer = entry.m_pBuffer;
- }
- ~STextureAtlasEntry() {}
-
- QT3DSF32 m_X, m_Y;
- QT3DSF32 m_Width, m_Height;
- NVDataRef<QT3DSU8> m_pBuffer;
-};
-
-struct STextureAtlas : public ITextureAtlas
-{
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
-
- STextureAtlas(NVFoundationBase &inFnd, NVRenderContext &inRenderContext, QT3DSI32 width,
- QT3DSI32 height)
- : m_Foundation(inFnd)
- , mRefCount(0)
- , m_RenderContext(inRenderContext)
- , m_Width(width)
- , m_Height(height)
- , m_Spacing(1)
- , m_AtlasEntrys(inFnd.getAllocator(), "STextureAtlas::m_SkyLine")
- {
- m_pBinPack =
- QT3DS_NEW(inFnd.getAllocator(), STextureAtlasBinPackSL)(inRenderContext, width, height);
- }
-
- virtual ~STextureAtlas()
- {
- RelaseEntries();
-
- if (m_pBinPack)
- NVDelete(m_Foundation.getAllocator(), m_pBinPack);
- }
-
- void RelaseEntries() override
- {
- nvvector<STextureAtlasEntry>::iterator it;
-
- for (it = m_AtlasEntrys.begin(); it != m_AtlasEntrys.end(); it++) {
- QT3DS_FREE(m_Foundation.getAllocator(), it->m_pBuffer.begin());
- }
-
- m_AtlasEntrys.clear();
- }
- QT3DSI32 GetWidth() const override { return m_Width; }
- QT3DSI32 GetHeight() const override { return m_Height; }
-
- QT3DSI32 GetAtlasEntryCount() const override { return m_AtlasEntrys.size(); }
-
- TTextureAtlasEntryAndBuffer GetAtlasEntryByIndex(QT3DSU32 index) override
- {
- if (index >= m_AtlasEntrys.size())
- return eastl::make_pair(STextureAtlasRect(), NVDataRef<QT3DSU8>());
-
- return eastl::make_pair(STextureAtlasRect((QT3DSI32)m_AtlasEntrys[index].m_X,
- (QT3DSI32)m_AtlasEntrys[index].m_Y,
- (QT3DSI32)m_AtlasEntrys[index].m_Width,
- (QT3DSI32)m_AtlasEntrys[index].m_Height),
- m_AtlasEntrys[index].m_pBuffer);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- STextureAtlasRect AddAtlasEntry(QT3DSI32 width, QT3DSI32 height, QT3DSI32 pitch,
- QT3DSI32 dataWidth, NVConstDataRef<QT3DSU8> bufferData) override
- {
- STextureAtlasRect rect;
-
- // pitch is the number of bytes per line in bufferData
- // dataWidth is the relevant data width in bufferData. Rest is padding that can be ignored.
- if (m_pBinPack) {
- QT3DSI32 paddedWith, paddedPitch, paddedHeight;
- // add spacing around the character
- paddedWith = width + 2 * m_Spacing;
- paddedPitch = dataWidth + 2 * m_Spacing;
- paddedHeight = height + 2 * m_Spacing;
- // first get entry in the texture atlas
- rect = m_pBinPack->Insert(paddedWith, paddedHeight);
- if (rect.m_Width == 0)
- return rect;
-
- // we align the data be to 4 byte
- int alignment = (4 - (paddedPitch % 4)) % 4;
- paddedPitch += alignment;
-
- // since we do spacing around the character we need to copy line by line
- QT3DSU8 *glyphBuffer =
- (QT3DSU8 *)QT3DS_ALLOC(m_Foundation.getAllocator(),
- paddedHeight * paddedPitch * sizeof(QT3DSU8), "STextureAtlas");
- if (glyphBuffer) {
- memset(glyphBuffer, 0, paddedHeight * paddedPitch);
-
- QT3DSU8 *pDst = glyphBuffer + paddedPitch + m_Spacing;
- QT3DSU8 *pSrc = const_cast<QT3DSU8 *>(bufferData.begin());
- for (QT3DSI32 i = 0; i < height; ++i) {
- memcpy(pDst, pSrc, dataWidth);
-
- pDst += paddedPitch;
- pSrc += pitch;
- }
-
- // add new entry
- m_AtlasEntrys.push_back(STextureAtlasEntry(
- (QT3DSF32)rect.m_X, (QT3DSF32)rect.m_Y, (QT3DSF32)paddedWith, (QT3DSF32)paddedHeight,
- NVDataRef<QT3DSU8>(glyphBuffer, paddedHeight * paddedPitch * sizeof(QT3DSU8))));
-
- // normalize texture coordinates
- rect.m_NormX = (QT3DSF32)rect.m_X / (QT3DSF32)m_Width;
- rect.m_NormY = (QT3DSF32)rect.m_Y / (QT3DSF32)m_Height;
- rect.m_NormWidth = (QT3DSF32)paddedWith / (QT3DSF32)m_Width;
- rect.m_NormHeight = (QT3DSF32)paddedHeight / (QT3DSF32)m_Height;
- }
- }
-
- return rect;
- }
-
-private:
- QT3DSI32 m_Width; ///< texture atlas width
- QT3DSI32 m_Height; ///< texture atlas height
- QT3DSI32 m_Spacing; ///< spacing around the entry
- nvvector<STextureAtlasEntry> m_AtlasEntrys; ///< our entries in the atlas
- STextureAtlasBinPackSL *m_pBinPack; ///< our bin packer which actually does most of the work
-};
-
-} // namespace
-
-ITextureAtlas &ITextureAtlas::CreateTextureAtlas(NVFoundationBase &inFnd,
- NVRenderContext &inRenderContext, QT3DSI32 width,
- QT3DSI32 height)
-{
- return *QT3DS_NEW(inFnd.getAllocator(), STextureAtlas)(inFnd, inRenderContext, width, height);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.h
deleted file mode 100644
index 46f7bdb5..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderTextureAtlas.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TEXTURE_ATLAS_H
-#define QT3DS_RENDER_TEXTURE_ATLAS_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "EASTL/algorithm.h"
-
-namespace qt3ds {
-namespace render {
-
- class ITextRenderer;
-
- struct STextureAtlasRect
- {
-
- STextureAtlasRect()
- : m_X(0)
- , m_Y(0)
- , m_Width(0)
- , m_Height(0)
- {
- }
-
- STextureAtlasRect(QT3DSI32 x, QT3DSI32 y, QT3DSI32 w, QT3DSI32 h)
- : m_X(x)
- , m_Y(y)
- , m_Width(w)
- , m_Height(h)
- {
- }
-
- QT3DSI32 m_X;
- QT3DSI32 m_Y;
- QT3DSI32 m_Width;
- QT3DSI32 m_Height;
-
- // normalized coordinates
- QT3DSF32 m_NormX;
- QT3DSF32 m_NormY;
- QT3DSF32 m_NormWidth;
- QT3DSF32 m_NormHeight;
- };
-
- typedef eastl::pair<STextureAtlasRect, NVDataRef<QT3DSU8>> TTextureAtlasEntryAndBuffer;
-
- /**
- * Abstract class of a texture atlas representation
- */
- class ITextureAtlas : public NVRefCounted
- {
- protected:
- virtual ~ITextureAtlas() {}
-
- public:
- virtual QT3DSI32 GetWidth() const = 0;
- virtual QT3DSI32 GetHeight() const = 0;
- virtual QT3DSI32 GetAtlasEntryCount() const = 0;
- virtual TTextureAtlasEntryAndBuffer GetAtlasEntryByIndex(QT3DSU32 index) = 0;
-
- virtual STextureAtlasRect AddAtlasEntry(QT3DSI32 width, QT3DSI32 height, QT3DSI32 pitch,
- QT3DSI32 dataWidth,
- NVConstDataRef<QT3DSU8> bufferData) = 0;
- virtual void RelaseEntries() = 0;
-
- static ITextureAtlas &CreateTextureAtlas(NVFoundationBase &inFnd,
- NVRenderContext &inRenderContext, QT3DSI32 width,
- QT3DSI32 height);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.cpp
deleted file mode 100644
index c9c73230..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderThreadPool.h"
-#include "foundation/Qt3DSThread.h"
-#include "EASTL/utility.h"
-#include "EASTL/list.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct STaskHeadOp
-{
- STask *get(STask &inTask) { return inTask.m_PreviousTask; }
- void set(STask &inTask, STask *inItem) { inTask.m_PreviousTask = inItem; }
-};
-
-struct STaskTailOp
-{
- STask *get(STask &inTask) { return inTask.m_NextTask; }
- void set(STask &inTask, STask *inItem) { inTask.m_NextTask = inItem; }
-};
-
-typedef InvasiveLinkedList<STask, STaskHeadOp, STaskTailOp> TTaskList;
-
-struct SThreadPoolThread : public Thread
-{
- IThreadPool *m_Mgr;
- SThreadPoolThread(NVFoundationBase &foundation, IThreadPool *inMgr)
- : Thread(foundation)
- , m_Mgr(inMgr)
- {
- }
- void execute(void) override
- {
- setName("Qt3DSRender Thread manager thread");
- while (!quitIsSignalled()) {
- STask task = m_Mgr->GetNextTask();
- if (task.m_Function) {
- task.CallFunction();
- m_Mgr->TaskFinished(task.m_Id);
- }
- }
- quit();
- }
-};
-
-struct SThreadPool : public IThreadPool
-{
- typedef nvhash_map<QT3DSU64, STask *> TIdTaskMap;
- typedef Mutex::ScopedLock TLockType;
- typedef Pool<STask, ForwardingAllocator> TTaskPool;
-
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- nvvector<SThreadPoolThread *> m_Threads;
- TIdTaskMap m_Tasks;
- Sync m_TaskListEvent;
- volatile bool m_Running;
- Mutex m_TaskListMutex;
- TTaskPool m_TaskPool;
- TTaskList m_TaskList;
-
- QT3DSU64 m_NextId;
-
- SThreadPool(NVFoundationBase &inBase, QT3DSU32 inMaxThreads)
- : m_Foundation(inBase)
- , mRefCount(0)
- , m_Threads(inBase.getAllocator(), "SThreadPool::m_Threads")
- , m_Tasks(inBase.getAllocator(), "SThreadPool::m_Tasks")
- , m_TaskListEvent(inBase.getAllocator())
- , m_Running(true)
- , m_TaskListMutex(m_Foundation.getAllocator())
- , m_TaskPool(ForwardingAllocator(m_Foundation.getAllocator(), "SThreadPool::m_TaskPool"))
- , m_NextId(1)
- {
- // Fire up our little pools of chaos.
- for (QT3DSU32 idx = 0; idx < inMaxThreads; ++idx) {
- m_Threads.push_back(
- QT3DS_NEW(m_Foundation.getAllocator(), SThreadPoolThread)(m_Foundation, this));
- m_Threads.back()->start(Thread::DEFAULT_STACK_SIZE);
- }
- }
-
- void MutexHeldRemoveTaskFromList(STask *theTask)
- {
- if (theTask)
- m_TaskList.remove(*theTask);
- QT3DS_ASSERT(theTask->m_NextTask == NULL);
- QT3DS_ASSERT(theTask->m_PreviousTask == NULL);
- }
-
- STask *MutexHeldNextTask()
- {
- STask *theTask = m_TaskList.front_ptr();
- if (theTask) {
- MutexHeldRemoveTaskFromList(theTask);
- }
- if (theTask) {
- QT3DS_ASSERT(m_TaskList.m_Head != theTask);
- QT3DS_ASSERT(m_TaskList.m_Tail != theTask);
- }
- return theTask;
- }
-
- virtual ~SThreadPool()
- {
- m_Running = false;
-
- m_TaskListEvent.set();
-
- for (QT3DSU32 idx = 0, end = m_Threads.size(); idx < end; ++idx)
- m_Threads[idx]->signalQuit();
-
- for (QT3DSU32 idx = 0, end = m_Threads.size(); idx < end; ++idx) {
- m_Threads[idx]->waitForQuit();
- NVDelete(m_Foundation.getAllocator(), m_Threads[idx]);
- }
-
- m_Threads.clear();
-
- TLockType __listMutexLocker(m_TaskListMutex);
-
- for (STask *theTask = MutexHeldNextTask(); theTask; theTask = MutexHeldNextTask()) {
- theTask->Cancel();
- }
-
- m_Tasks.clear();
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- void VerifyTaskList()
- {
- STask *theLastTask = NULL;
- for (STask *theTask = m_TaskList.m_Head; theTask; theTask = theTask->m_NextTask) {
- QT3DS_ASSERT(theTask->m_PreviousTask == theLastTask);
- theLastTask = theTask;
- }
- theLastTask = NULL;
- for (STask *theTask = m_TaskList.m_Tail; theTask; theTask = theTask->m_PreviousTask) {
- QT3DS_ASSERT(theTask->m_NextTask == theLastTask);
- theLastTask = theTask;
- }
- }
-
- QT3DSU64 AddTask(void *inUserData, TTaskFunction inFunction,
- TTaskFunction inCancelFunction) override
- {
- if (inFunction && m_Running) {
- TLockType __listMutexLocker(m_TaskListMutex);
- QT3DSU64 taskId = m_NextId;
- ++m_NextId;
-
- STask *theTask = (STask *)m_TaskPool.allocate(__FILE__, __LINE__);
- new (theTask) STask(inUserData, inFunction, inCancelFunction, taskId);
- TIdTaskMap::iterator theTaskIter =
- m_Tasks.insert(eastl::make_pair(taskId, theTask)).first;
-
- m_TaskList.push_back(*theTask);
- QT3DS_ASSERT(m_TaskList.m_Tail == theTask);
-
-#ifdef _DEBUG
- VerifyTaskList();
-#endif
- m_TaskListEvent.set();
- m_TaskListEvent.reset();
- return taskId;
- }
- QT3DS_ASSERT(false);
- return 0;
- }
-
- TaskStates::Enum GetTaskState(QT3DSU64 inTaskId) override
- {
- TLockType __listMutexLocker(m_TaskListMutex);
- TIdTaskMap::iterator theTaskIter = m_Tasks.find(inTaskId);
- if (theTaskIter != m_Tasks.end())
- return theTaskIter->second->m_TaskState;
- return TaskStates::UnknownTask;
- }
-
- CancelReturnValues::Enum CancelTask(QT3DSU64 inTaskId) override
- {
- TLockType __listMutexLocker(m_TaskListMutex);
- TIdTaskMap::iterator theTaskIter = m_Tasks.find(inTaskId);
- if (theTaskIter == m_Tasks.end())
- return CancelReturnValues::TaskCanceled;
- if (theTaskIter->second->m_TaskState == TaskStates::Running)
- return CancelReturnValues::TaskRunning;
-
- STask *theTask = theTaskIter->second;
- theTask->Cancel();
- MutexHeldRemoveTaskFromList(theTask);
- m_Tasks.erase(inTaskId);
- m_TaskPool.deallocate(theTask);
-
- return CancelReturnValues::TaskCanceled;
- }
-
- STask GetNextTask() override
- {
-
- if (m_Running) {
- {
- TLockType __listMutexLocker(m_TaskListMutex);
- STask *retval = MutexHeldNextTask();
- if (retval)
- return *retval;
- }
- // If we couldn't get a task then wait.
- m_TaskListEvent.wait(1000);
- }
- return STask();
- }
-
- void TaskFinished(QT3DSU64 inId) override
- {
- TLockType __listMutexLocker(m_TaskListMutex);
- TIdTaskMap::iterator theTaskIter = m_Tasks.find(inId);
- if (theTaskIter == m_Tasks.end()) {
- QT3DS_ASSERT(false);
- return;
- }
-
- STask *theTask(theTaskIter->second);
-
-#ifdef _DEBUG
- QT3DS_ASSERT(theTask->m_NextTask == NULL);
- QT3DS_ASSERT(theTask->m_PreviousTask == NULL);
-#endif
- m_TaskPool.deallocate(theTask);
- m_Tasks.erase(inId);
- return;
- }
-};
-}
-
-IThreadPool &IThreadPool::CreateThreadPool(NVFoundationBase &inFoundation, QT3DSU32 inNumThreads)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(), SThreadPool)(inFoundation, inNumThreads);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.h
deleted file mode 100644
index 990106a7..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderThreadPool.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_THREAD_POOL_H
-#define QT3DS_RENDER_THREAD_POOL_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-
-namespace qt3ds {
-namespace render {
-
- typedef void (*TTaskFunction)(void *inUserData);
-
-struct TaskStates
-{
- enum Enum {
- UnknownTask = 0,
- Queued,
- Running,
- };
-};
-
-
-struct STask
-{
- void *m_UserData;
- TTaskFunction m_Function;
- TTaskFunction m_CancelFunction;
- QT3DSU64 m_Id;
- TaskStates::Enum m_TaskState;
- STask *m_NextTask;
- STask *m_PreviousTask;
-
- STask(void *ud, TTaskFunction func, TTaskFunction cancelFunc, QT3DSU64 inId)
- : m_UserData(ud)
- , m_Function(func)
- , m_CancelFunction(cancelFunc)
- , m_Id(inId)
- , m_TaskState(TaskStates::Queued)
- , m_NextTask(NULL)
- , m_PreviousTask(NULL)
- {
- }
- STask()
- : m_UserData(NULL)
- , m_Function(NULL)
- , m_CancelFunction(NULL)
- , m_Id(0)
- , m_TaskState(TaskStates::UnknownTask)
- , m_NextTask(NULL)
- , m_PreviousTask(NULL)
- {
- }
- void CallFunction()
- {
- if (m_Function)
- m_Function(m_UserData);
- }
- void Cancel()
- {
- if (m_CancelFunction)
- m_CancelFunction(m_UserData);
- }
-};
-
-
- struct CancelReturnValues
- {
- enum Enum {
- TaskCanceled = 0,
- TaskRunning,
- TaskNotFound,
- };
- };
-
- class IThreadPool : public NVRefCounted
- {
- protected:
- virtual ~IThreadPool() {}
- public:
- // Add a task to be run at some point in the future.
- // Tasks will be run roughly in order they are given.
- // The returned value is a handle that can be used to query
- // details about the task
- // Cancel function will be called if the thread pool is destroyed or
- // of the task gets canceled.
- virtual QT3DSU64 AddTask(void *inUserData, TTaskFunction inFunction,
- TTaskFunction inCancelFunction) = 0;
- virtual TaskStates::Enum GetTaskState(QT3DSU64 inTaskId) = 0;
- virtual CancelReturnValues::Enum CancelTask(QT3DSU64 inTaskId) = 0;
-
- virtual STask GetNextTask() = 0;
- virtual void TaskFinished(QT3DSU64 inId) = 0;
-
- static IThreadPool &CreateThreadPool(NVFoundationBase &inFoundation,
- QT3DSU32 inNumThreads = 4);
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.cpp
deleted file mode 100644
index 9aad3973..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.cpp
+++ /dev/null
@@ -1,2089 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifdef QT3DS_RENDER_ENABLE_LOAD_UIP
-
-#include "Qt3DSRenderUIPLoader.h"
-#include "Qt3DSRenderPresentation.h"
-#include "Qt3DSRenderNode.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderUIPSharedTranslation.h"
-#include <vector>
-#include <map>
-#include <set>
-#ifdef EA_PLATFORM_WINDOWS
-#pragma warning(disable : 4201)
-#endif
-#include "Qt3DSDMXML.h"
-#include "Qt3DSTypes.h"
-#include "Qt3DSVector3.h"
-#include "Qt3DSMetadata.h"
-#include "Qt3DSDMWStrOps.h"
-#include "Qt3DSDMWStrOpsImpl.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSDMComposerTypeDefinitions.h"
-#include "EASTL/string.h"
-#include "foundation/StrConvertUTF.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "StringTools.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSRenderDynamicObjectSystemCommands.h"
-#include "EASTL/map.h"
-#include "Qt3DSRenderEffect.h"
-#include "Qt3DSDMMetaDataTypes.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderPlugin.h"
-#include "Qt3DSRenderPluginGraphObject.h"
-#include "Qt3DSRenderPluginPropertyValue.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderMaterialHelpers.h"
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderPathSubPath.h"
-#include "Qt3DSRenderPathManager.h"
-#include "q3dsvariantconfig_p.h"
-
-using qt3ds::foundation::Option;
-using qt3ds::foundation::Empty;
-using qt3ds::QT3DSF32;
-using qt3ds::QT3DSVec3;
-using qt3ds::foundation::nvvector;
-using qt3ds::QT3DSU32;
-using qt3ds::render::RenderLightTypes;
-using qt3ds::render::DefaultMaterialLighting;
-using qt3ds::render::ImageMappingModes;
-using qt3ds::render::DefaultMaterialBlendMode;
-using qt3ds::render::NVRenderTextureCoordOp;
-using qt3ds::foundation::IStringTable;
-using qt3ds::NVFoundationBase;
-using namespace qt3ds;
-using namespace qt3ds::foundation;
-using qt3ds::render::TIdObjectMap;
-using qt3ds::render::IBufferManager;
-using qt3ds::render::IEffectSystem;
-using qt3ds::render::SPresentation;
-using qt3ds::render::SScene;
-using qt3ds::render::SLayer;
-using qt3ds::render::SNode;
-using qt3ds::render::SLight;
-using qt3ds::render::SCamera;
-using qt3ds::render::SModel;
-using qt3ds::render::SText;
-using qt3ds::render::SDefaultMaterial;
-using qt3ds::render::SImage;
-using qt3ds::render::SGraphObject;
-using qt3ds::render::SDynamicObject;
-using qt3ds::render::SEffect;
-using qt3ds::render::SCustomMaterial;
-using qt3ds::render::GraphObjectTypes;
-using qt3ds::render::NodeFlags;
-using qt3ds::foundation::CRegisteredString;
-using qt3ds::foundation::Qt3DSString;
-using qt3ds::foundation::CFileTools;
-using qt3ds::render::SReferencedMaterial;
-using qt3ds::render::IUIPReferenceResolver;
-using qt3ds::render::SPath;
-using qt3ds::render::SPathSubPath;
-using qt3ds::render::SLightmaps;
-
-namespace qt3dsdm {
-template <>
-struct WStrOps<SFloat2>
-{
- void StrTo(const char8_t *buffer, SFloat2 &item, nvvector<char8_t> &ioTempBuf)
- {
- QT3DSU32 len = (QT3DSU32)strlen(buffer);
- ioTempBuf.resize(len + 1);
- memCopy(ioTempBuf.data(), buffer, (len + 1) * sizeof(char8_t));
- MemoryBuffer<RawAllocator> unused;
- qt3dsdm::IStringTable *theTable(NULL);
- WCharTReader reader(ioTempBuf.begin(), unused, *theTable);
- reader.ReadRef(NVDataRef<QT3DSF32>(item.m_Floats, 2));
- }
-};
-
-template <>
-struct WStrOps<SFloat3>
-{
- void StrTo(const char8_t *buffer, SFloat3 &item, nvvector<char8_t> &ioTempBuf)
- {
- QT3DSU32 len = (QT3DSU32)strlen(buffer);
- ioTempBuf.resize(len + 1);
- memCopy(ioTempBuf.data(), buffer, (len + 1) * sizeof(char8_t));
- MemoryBuffer<RawAllocator> unused;
- qt3dsdm::IStringTable *theTable(NULL);
- WCharTReader reader(ioTempBuf.begin(), unused, *theTable);
- reader.ReadRef(NVDataRef<QT3DSF32>(item.m_Floats, 3));
- }
-};
-
-template <>
-struct WStrOps<SFloat4>
-{
- void StrTo(const char8_t *buffer, SFloat4 &item, nvvector<char8_t> &ioTempBuf)
- {
- QT3DSU32 len = (QT3DSU32)strlen(buffer);
- ioTempBuf.resize(len + 1);
- memCopy(ioTempBuf.data(), buffer, (len + 1) * sizeof(char8_t));
- MemoryBuffer<RawAllocator> unused;
- qt3dsdm::IStringTable *theTable(NULL);
- WCharTReader reader(ioTempBuf.begin(), unused, *theTable);
- reader.ReadRef(NVDataRef<QT3DSF32>(item.m_Floats, 4));
- }
-};
-}
-
-namespace {
-
-typedef eastl::basic_string<char8_t> TStrType;
-struct IPropertyParser
-{
- virtual ~IPropertyParser() {}
- virtual Option<TStrType> ParseStr(const char8_t *inName) = 0;
- virtual Option<QT3DSF32> ParseFloat(const char8_t *inName) = 0;
- virtual Option<QT3DSVec2> ParseVec2(const char8_t *inName) = 0;
- virtual Option<QT3DSVec3> ParseVec3(const char8_t *inName) = 0;
- virtual Option<QT3DSVec4> ParseVec4(const char8_t *inName) = 0;
- virtual Option<bool> ParseBool(const char8_t *inName) = 0;
- virtual Option<QT3DSU32> ParseU32(const char8_t *inName) = 0;
- virtual Option<QT3DSI32> ParseI32(const char8_t *inName) = 0;
- virtual Option<SGraphObject *> ParseGraphObject(const char8_t *inName) = 0;
- virtual Option<SNode *> ParseNode(const char8_t *inName) = 0;
-};
-struct SMetaPropertyParser : public IPropertyParser
-{
- Q3DStudio::IRuntimeMetaData &m_MetaData;
- TStrType m_TempStr;
- qt3ds::foundation::CRegisteredString m_Type;
- qt3ds::foundation::CRegisteredString m_ClassId;
-
- SMetaPropertyParser(const char8_t *inType, const char8_t *inClass,
- Q3DStudio::IRuntimeMetaData &inMeta)
- : m_MetaData(inMeta)
- , m_Type(inMeta.GetStringTable()->GetRenderStringTable().RegisterStr(inType))
- , m_ClassId(inMeta.GetStringTable()->GetRenderStringTable().RegisterStr(inClass))
- {
- }
-
- qt3ds::foundation::CRegisteredString Register(const char8_t *inName)
- {
- return m_MetaData.GetStringTable()->GetRenderStringTable().RegisterStr(inName);
- }
-
- Option<TStrType> ParseStr(const char8_t *inName) override
- {
- qt3ds::foundation::CRegisteredString theName(Register(inName));
- Q3DStudio::ERuntimeDataModelDataType theType(
- m_MetaData.GetPropertyType(m_Type, theName, m_ClassId));
- if (theType != Q3DStudio::ERuntimeDataModelDataTypeObjectRef
- && theType != Q3DStudio::ERuntimeDataModelDataTypeLong4) {
- return m_MetaData.GetPropertyValueString(m_Type, theName, m_ClassId);
- }
- return Empty();
- }
- Option<QT3DSF32> ParseFloat(const char8_t *inName) override
- {
- return m_MetaData.GetPropertyValueFloat(m_Type, Register(inName), m_ClassId);
- }
- Option<QT3DSVec2> ParseVec2(const char8_t *inName) override
- {
- Option<qt3ds::QT3DSVec2> theProperty =
- m_MetaData.GetPropertyValueVector2(m_Type, Register(inName), m_ClassId);
- if (theProperty.hasValue())
- return *theProperty;
-
- return Empty();
- }
- Option<QT3DSVec3> ParseVec3(const char8_t *inName) override
- {
- Option<qt3ds::QT3DSVec3> theProperty =
- m_MetaData.GetPropertyValueVector3(m_Type, Register(inName), m_ClassId);
- if (theProperty.hasValue()) {
- return *theProperty;
- }
- return Empty();
- }
- Option<QT3DSVec4> ParseVec4(const char8_t *inName) override
- {
- Option<qt3ds::QT3DSVec4> theProperty =
- m_MetaData.GetPropertyValueVector4(m_Type, Register(inName), m_ClassId);
- if (theProperty.hasValue()) {
- return *theProperty;
- }
- return Empty();
- }
- Option<bool> ParseBool(const char8_t *inName) override
- {
- return m_MetaData.GetPropertyValueBool(m_Type, Register(inName), m_ClassId);
- }
-
- Option<QT3DSU32> ParseU32(const char8_t *inName) override
- {
- Option<QT3DSI32> retval = m_MetaData.GetPropertyValueLong(m_Type, Register(inName), m_ClassId);
- if (retval.hasValue())
- return (QT3DSU32)retval.getValue();
- return Empty();
- }
-
- Option<QT3DSI32> ParseI32(const char8_t *inName) override
- {
- Option<QT3DSI32> retval = m_MetaData.GetPropertyValueLong(m_Type, Register(inName), m_ClassId);
- if (retval.hasValue())
- return (QT3DSI32)retval.getValue();
- return Empty();
- }
-
- Option<SGraphObject *> ParseGraphObject(const char8_t *) override { return Empty(); }
- Option<SNode *> ParseNode(const char8_t *) override { return Empty(); }
-};
-
-class IDOMReferenceResolver
-{
-protected:
- virtual ~IDOMReferenceResolver() {}
-public:
- virtual SGraphObject *ResolveReference(SGraphObject &inRootObject, const char *path) = 0;
-};
-
-struct SDomReaderPropertyParser : public IPropertyParser
-{
- qt3dsdm::IDOMReader &m_Reader;
- nvvector<char8_t> &m_TempBuf;
- IDOMReferenceResolver &m_Resolver;
- SGraphObject &m_Object;
-
- SDomReaderPropertyParser(qt3dsdm::IDOMReader &reader, nvvector<char8_t> &inTempBuf,
- IDOMReferenceResolver &inResolver, SGraphObject &inObject)
- : m_Reader(reader)
- , m_TempBuf(inTempBuf)
- , m_Resolver(inResolver)
- , m_Object(inObject)
- {
- }
- Option<TStrType> ParseStr(const char8_t *inName) override
- {
- const char8_t *retval;
- if (m_Reader.Att(inName, retval))
- return TStrType(retval);
- return Empty();
- }
- Option<QT3DSF32> ParseFloat(const char8_t *inName) override
- {
- QT3DSF32 retval;
- if (m_Reader.Att(inName, retval))
- return retval;
- return Empty();
- }
- Option<QT3DSVec2> ParseVec2(const char8_t *inName) override
- {
- qt3dsdm::SFloat2 retval;
- const char8_t *tempData;
- if (m_Reader.UnregisteredAtt(inName, tempData)) {
- qt3dsdm::WStrOps<qt3dsdm::SFloat2>().StrTo(tempData, retval, m_TempBuf);
- return QT3DSVec2(retval.m_Floats[0], retval.m_Floats[1]);
- }
- return Empty();
- }
- Option<QT3DSVec3> ParseVec3(const char8_t *inName) override
- {
- qt3dsdm::SFloat3 retval;
- const char8_t *tempData;
- if (m_Reader.UnregisteredAtt(inName, tempData)) {
- qt3dsdm::WStrOps<qt3dsdm::SFloat3>().StrTo(tempData, retval, m_TempBuf);
- return QT3DSVec3(retval.m_Floats[0], retval.m_Floats[1], retval.m_Floats[2]);
- }
- return Empty();
- }
- Option<QT3DSVec4> ParseVec4(const char8_t *inName) override
- {
- qt3dsdm::SFloat4 retval;
- const char8_t *tempData;
- if (m_Reader.UnregisteredAtt(inName, tempData)) {
- qt3dsdm::WStrOps<qt3dsdm::SFloat4>().StrTo(tempData, retval, m_TempBuf);
- return QT3DSVec4(retval.m_Floats[0], retval.m_Floats[1], retval.m_Floats[2],
- retval.m_Floats[3]);
- }
- return Empty();
- }
- Option<bool> ParseBool(const char8_t *inName) override
- {
- bool retval;
- if (m_Reader.Att(inName, retval))
- return retval;
- return Empty();
- }
-
- Option<QT3DSU32> ParseU32(const char8_t *inName) override
- {
- QT3DSU32 retval;
- if (m_Reader.Att(inName, retval))
- return retval;
- return Empty();
- }
-
- Option<QT3DSI32> ParseI32(const char8_t *inName) override
- {
- QT3DSI32 retval;
- if (m_Reader.Att(inName, retval))
- return retval;
- return Empty();
- }
-
- Option<SGraphObject *> ParseGraphObject(const char8_t *inName) override
- {
- const char *temp;
- if (m_Reader.UnregisteredAtt(inName, temp)) {
- // Now we need to figure out if this is an element reference or if it is a relative path
- // from the current element.
- SGraphObject *retval = m_Resolver.ResolveReference(m_Object, temp);
- if (retval)
- return retval;
- }
- return Empty();
- }
-
- Option<SNode *> ParseNode(const char8_t *inName) override
- {
- Option<SGraphObject *> obj = ParseGraphObject(inName);
- if (obj.hasValue()) {
- if (GraphObjectTypes::IsNodeType((*obj)->m_Type))
- return static_cast<SNode *>((*obj));
- }
- return Empty();
- }
-};
-
-template <typename TDataType>
-struct SParserHelper
-{
-};
-template <>
-struct SParserHelper<TStrType>
-{
- static Option<TStrType> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseStr(inName);
- }
-};
-template <>
-struct SParserHelper<QT3DSF32>
-{
- static Option<QT3DSF32> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseFloat(inName);
- }
-};
-template <>
-struct SParserHelper<QT3DSVec2>
-{
- static Option<QT3DSVec2> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseVec2(inName);
- }
-};
-template <>
-struct SParserHelper<QT3DSVec3>
-{
- static Option<QT3DSVec3> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseVec3(inName);
- }
-};
-template <>
-struct SParserHelper<QT3DSVec4>
-{
- static Option<QT3DSVec4> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseVec4(inName);
- }
-};
-template <>
-struct SParserHelper<bool>
-{
- static Option<bool> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseBool(inName);
- }
-};
-template <>
-struct SParserHelper<QT3DSU32>
-{
- static Option<QT3DSU32> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseU32(inName);
- }
-};
-template <>
-struct SParserHelper<QT3DSI32>
-{
- static Option<QT3DSI32> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseI32(inName);
- }
-};
-template <>
-struct SParserHelper<SGraphObject *>
-{
- static Option<SGraphObject *> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseGraphObject(inName);
- }
-};
-template <>
-struct SParserHelper<SNode *>
-{
- static Option<SNode *> Parse(const char8_t *inName, IPropertyParser &inParser)
- {
- return inParser.ParseNode(inName);
- }
-};
-
-struct SPathAndAnchorIndex
-{
- SPathSubPath *m_Segment;
- QT3DSU32 m_AnchorIndex;
- SPathAndAnchorIndex(SPathSubPath *inSegment, QT3DSU32 inAnchorIndex)
- : m_Segment(inSegment)
- , m_AnchorIndex(inAnchorIndex)
- {
- }
- SPathAndAnchorIndex()
- : m_Segment(NULL)
- , m_AnchorIndex(0)
- {
- }
-};
-
-struct SRenderUIPLoader : public IDOMReferenceResolver
-{
- typedef qt3dsdm::IDOMReader::Scope TScope;
- typedef eastl::map<CRegisteredString, eastl::string> TIdStringMap;
- typedef eastl::hash_map<CRegisteredString, SPathAndAnchorIndex> TIdPathAnchorIndexMap;
- qt3dsdm::IDOMReader &m_Reader;
- Q3DStudio::IRuntimeMetaData &m_MetaData;
- IStringTable &m_StrTable;
- NVFoundationBase &m_Foundation;
- NVAllocatorCallback &m_PresentationAllocator;
- qt3ds::render::TIdObjectMap &m_ObjectMap;
- IBufferManager &m_BufferManager;
- SPresentation *m_Presentation;
- nvvector<char8_t> m_TempBuf;
- TStrType m_TempParseString;
- IEffectSystem &m_EffectSystem;
- const char8_t *m_PresentationDir;
- Qt3DSString m_PathString;
- qt3ds::render::IRenderPluginManager &m_RenderPluginManager;
- qt3ds::render::ICustomMaterialSystem &m_CustomMaterialSystem;
- qt3ds::render::IDynamicObjectSystem &m_DynamicObjectSystem;
- qt3ds::render::IPathManager &m_PathManager;
- TIdStringMap m_RenderPluginSourcePaths;
- IUIPReferenceResolver *m_ReferenceResolver;
- MemoryBuffer<RawAllocator> m_TempBuffer;
- MemoryBuffer<RawAllocator> m_ValueBuffer;
- TIdPathAnchorIndexMap m_AnchorIdToPathAndAnchorIndexMap;
- const Q3DSVariantConfig &m_variantConfig;
-
- SRenderUIPLoader(qt3dsdm::IDOMReader &inReader, const char8_t *inFullPathToPresentationFile,
- Q3DStudio::IRuntimeMetaData &inMetaData, IStringTable &inStrTable
- // Allocator for datastructures we need to parse the file.
- ,
- NVFoundationBase &inFoundation
- // Allocator used for the presentation objects themselves
- ,
- NVAllocatorCallback &inPresentationAllocator
- // Map of string ids to objects
- ,
- TIdObjectMap &ioObjectMap, IBufferManager &inBufferManager,
- IEffectSystem &inEffectSystem, const char8_t *inPresentationDir,
- qt3ds::render::IRenderPluginManager &inRPM,
- qt3ds::render::ICustomMaterialSystem &inCMS,
- qt3ds::render::IDynamicObjectSystem &inDynamicSystem,
- qt3ds::render::IPathManager &inPathManager, IUIPReferenceResolver *inResolver,
- const Q3DSVariantConfig &variantConfig)
- : m_Reader(inReader)
- , m_MetaData(inMetaData)
- , m_StrTable(inStrTable)
- , m_Foundation(inFoundation)
- , m_PresentationAllocator(inPresentationAllocator)
- , m_ObjectMap(ioObjectMap)
- , m_BufferManager(inBufferManager)
- , m_Presentation(QT3DS_NEW(inPresentationAllocator, SPresentation)())
- , m_TempBuf(inFoundation.getAllocator(), "SRenderUIPLoader::m_TempBuf")
- , m_EffectSystem(inEffectSystem)
- , m_PresentationDir(inPresentationDir)
- , m_RenderPluginManager(inRPM)
- , m_CustomMaterialSystem(inCMS)
- , m_DynamicObjectSystem(inDynamicSystem)
- , m_PathManager(inPathManager)
- , m_ReferenceResolver(inResolver)
- , m_variantConfig(variantConfig)
- {
- std::string presentationFile = inFullPathToPresentationFile;
- std::string::size_type pos = presentationFile.find_last_of("\\/");
- if (pos != std::string::npos) {
- std::string path = presentationFile.substr(0, pos);
- m_Presentation->m_PresentationDirectory = inStrTable.RegisterStr(path.c_str());
- }
- }
-
- SGraphObject *ResolveReference(SGraphObject &inRoot, const char *path) override
- {
- if (m_ReferenceResolver) {
- CRegisteredString resolvedReference =
- m_ReferenceResolver->ResolveReference(inRoot.m_Id, path);
- if (resolvedReference.IsValid()) {
- qt3ds::render::TIdObjectMap::iterator iter = m_ObjectMap.find(resolvedReference);
- if (iter != m_ObjectMap.end())
- return iter->second;
- }
- }
- return NULL;
- }
-
- static bool IsNode(GraphObjectTypes::Enum inType)
- {
- return GraphObjectTypes::IsNodeType(inType);
- }
- template <typename TDataType>
- bool ParseProperty(IPropertyParser &inParser, const char8_t *inName, TDataType &outData)
- {
- Option<TDataType> theValue(SParserHelper<TDataType>::Parse(inName, inParser));
- if (theValue.hasValue()) {
- outData = theValue;
- return true;
- }
- return false;
- }
- bool ParseOpacityProperty(IPropertyParser &inParser, const char8_t *inName, QT3DSF32 &outOpacity)
- {
- if (ParseProperty(inParser, inName, outOpacity)) {
- outOpacity /= 100.0f;
- return true;
- }
- return false;
- }
-
- bool ParseRadianProperty(IPropertyParser &inParser, const char8_t *inName, QT3DSVec3 &ioRotation)
- {
- if (ParseProperty(inParser, inName, ioRotation)) {
- TORAD(ioRotation.x);
- TORAD(ioRotation.y);
- TORAD(ioRotation.z);
- return true;
- }
- return false;
- }
- bool ParseRadianProperty(IPropertyParser &inParser, const char8_t *inName, QT3DSF32 &ioRotation)
- {
- if (ParseProperty(inParser, inName, ioRotation)) {
- TORAD(ioRotation);
- return true;
- }
- return false;
- }
-
- void ParseRotationOrder(IPropertyParser &inParser, const char8_t *inName,
- QT3DSU32 &ioRotationOrder)
- {
- if (ParseProperty(inParser, inName, m_TempParseString))
- ioRotationOrder = qt3ds::render::MapRotationOrder(m_TempParseString.c_str());
- }
- void ParseOrientation(IPropertyParser &inParser, const char8_t *inName, NodeFlags &ioFlags)
- {
- if (ParseProperty(inParser, inName, m_TempParseString)) {
- if (m_TempParseString == "Left Handed")
- ioFlags.SetLeftHanded(true);
- else
- ioFlags.SetLeftHanded(false);
- }
- }
- void ParseOrthographicProperty(IPropertyParser &inParser, const char8_t *inName,
- NodeFlags &ioFlags)
- {
- bool isOrthographic;
- if (ParseProperty(inParser, inName, isOrthographic))
- ioFlags.SetOrthographic(isOrthographic);
- }
- template <typename TEnumType>
- static bool ConvertEnumFromStr(const char8_t *inStr, TEnumType &ioEnum)
- {
- qt3ds::render::SEnumNameMap *theMap = qt3ds::render::SEnumParseMap<TEnumType>::GetMap();
- for (qt3ds::render::SEnumNameMap *item = theMap; item->m_Name; ++item) {
- // hack to match advanced overlay types, whose name start with a '*'
- const char8_t *p = inStr;
- if (*p == '*')
- ++p;
- if (qt3dsdm::AreEqual(p, item->m_Name)) {
- ioEnum = static_cast<TEnumType>(item->m_Enum);
- return true;
- }
- }
- return false;
- }
-
- template <typename TEnumType>
- void ParseEnumProperty(IPropertyParser &inParser, const char8_t *inName, TEnumType &ioEnum)
- {
- if (ParseProperty(inParser, inName, m_TempParseString)) {
- ConvertEnumFromStr(m_TempParseString.c_str(), ioEnum);
- }
- }
- void ParseAndResolveSourcePath(IPropertyParser &inParser, const char8_t *inName,
- CRegisteredString &ioString)
- {
- if (ParseProperty(inParser, inName, m_TempParseString))
- ioString = m_StrTable.RegisterStr(m_TempParseString.c_str());
- }
- void ParseProperty(IPropertyParser &inParser, const char8_t *inName, SImage *&ioImage)
- {
- if (ParseProperty(inParser, inName, m_TempParseString)) {
- TIdObjectMap::iterator theIter =
- m_ObjectMap.find(m_StrTable.RegisterStr(m_TempParseString.c_str() + 1));
- if (theIter != m_ObjectMap.end()
- && theIter->second->m_Type == GraphObjectTypes::Image) {
- ioImage = static_cast<SImage *>(theIter->second);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- }
- void ParseProperty(IPropertyParser &inParser, const char8_t *inName, CRegisteredString &ioStr)
- {
- if (ParseProperty(inParser, inName, m_TempParseString))
- ioStr = m_StrTable.RegisterStr(m_TempParseString.c_str());
- }
-
- void ParseNodeFlagsProperty(IPropertyParser &inParser, const char8_t *inName,
- qt3ds::render::NodeFlags &ioFlags,
- qt3ds::render::NodeFlagValues::Enum prop)
- {
- bool temp;
- if (ParseProperty(inParser, inName, temp))
- ioFlags.ClearOrSet(temp, prop);
- }
-
- void ParseNodeFlagsInverseProperty(IPropertyParser &inParser, const char8_t *inName,
- qt3ds::render::NodeFlags &ioFlags,
- qt3ds::render::NodeFlagValues::Enum prop)
- {
- bool temp;
- if (ParseProperty(inParser, inName, temp))
- ioFlags.ClearOrSet(!temp, prop);
- }
-
-// Create a mapping from UICRenderPropertyNames to the string in the UIP file.
-#define Scene_ClearColor "backgroundcolor"
-#define Scene_UseClearColor "bgcolorenable"
-#define Node_Rotation "rotation"
-#define Node_Position "position"
-#define Node_Scale "scale"
-#define Node_Pivot "pivot"
-#define Node_LocalOpacity "opacity"
-#define Node_RotationOrder "rotationorder"
-#define Node_LeftHanded "orientation"
-#define Layer_Variants "variants"
-#define Layer_TemporalAAEnabled "temporalaa"
-#define Layer_LayerEnableDepthTest "disabledepthtest"
-#define Layer_LayerEnableDepthPrePass "disabledepthprepass"
-#define Layer_ClearColor "backgroundcolor"
-#define Layer_Background "background"
-#define Layer_BlendType "blendtype"
-#define Layer_Size "size"
-#define Layer_Location "location"
-#define Layer_TexturePath "sourcepath"
-#define Layer_HorizontalFieldValues "horzfields"
-#define Layer_Left "left"
-#define Layer_LeftUnits "leftunits"
-#define Layer_Width "width"
-#define Layer_WidthUnits "widthunits"
-#define Layer_Right "right"
-#define Layer_RightUnits "rightunits"
-#define Layer_VerticalFieldValues "vertfields"
-#define Layer_Top "top"
-#define Layer_TopUnits "topunits"
-#define Layer_Height "height"
-#define Layer_HeightUnits "heightunits"
-#define Layer_Bottom "bottom"
-#define Layer_BottomUnits "bottomunits"
-#define Layer_AoStrength "aostrength"
-#define Layer_AoDistance "aodistance"
-#define Layer_AoSoftness "aosoftness"
-#define Layer_AoBias "aobias"
-#define Layer_AoSamplerate "aosamplerate"
-#define Layer_AoDither "aodither"
-#define Layer_ShadowStrength "shadowstrength"
-#define Layer_ShadowDist "shadowdist"
-#define Layer_ShadowSoftness "shadowsoftness"
-#define Layer_ShadowBias "shadowbias"
-#define Layer_LightProbe "lightprobe"
-#define Layer_ProbeBright "probebright"
-#define Layer_FastIbl "fastibl"
-#define Layer_ProbeHorizon "probehorizon"
-#define Layer_ProbeFov "probefov"
-#define Layer_LightProbe2 "lightprobe2"
-#define Layer_Probe2Fade "probe2fade"
-#define Layer_Probe2Window "probe2window"
-#define Layer_Probe2Pos "probe2pos"
-#define Camera_ClipNear "clipnear"
-#define Camera_ClipFar "clipfar"
-#define Camera_FOV "fov"
-#define Camera_FOVHorizontal "fovhorizontal"
-#define Camera_Orthographic "orthographic"
-#define Camera_ScaleMode "scalemode"
-#define Camera_ScaleAnchor "scaleanchor"
-#define Light_LightType "lighttype"
-#define Light_DiffuseColor "lightdiffuse"
-#define Light_SpecularColor "lightspecular"
-#define Light_AmbientColor "lightambient"
-#define Light_Brightness "brightness"
-#define Light_LinearFade "linearfade"
-#define Light_ExponentialFade "expfade"
-#define Light_AreaWidth "areawidth"
-#define Light_AreaHeight "areaheight"
-#define Light_CastShadow "castshadow"
-#define Light_ShadowBias "shdwbias"
-#define Light_ShadowFactor "shdwfactor"
-#define Light_ShadowMapRes "shdwmapres"
-#define Light_ShadowMapFar "shdwmapfar"
-#define Light_ShadowMapFov "shdwmapfov"
-#define Light_ShadowFilter "shdwfilter"
-#define Model_MeshPath "sourcepath"
-#define Model_ShadowCaster "shadowcaster"
-#define Model_TessellationMode "tessellation"
-#define Model_EdgeTess "edgetess"
-#define Model_InnerTess "innertess"
-#define Lightmaps_LightmapIndirect "lightmapindirect"
-#define Lightmaps_LightmapRadiosity "lightmapradiosity"
-#define Lightmaps_LightmapShadow "lightmapshadow"
-#define Material_Lighting "shaderlighting"
-#define Material_BlendMode "blendmode"
-#define MaterialBase_IblProbe "iblprobe"
-#define Material_DiffuseColor "diffuse"
-#define Material_DiffuseMaps_0 "diffusemap"
-#define Material_DiffuseMaps_1 "diffusemap2"
-#define Material_DiffuseMaps_2 "diffusemap3"
-#define Material_EmissivePower "emissivepower"
-#define Material_EmissiveColor "emissivecolor"
-#define Material_EmissiveMap "emissivemap"
-#define Material_EmissiveMap2 "emissivemap2"
-#define Material_SpecularReflection "specularreflection"
-#define Material_SpecularMap "specularmap"
-#define Material_SpecularModel "specularmodel"
-#define Material_SpecularTint "speculartint"
-#define Material_IOR "ior"
-#define Material_FresnelPower "fresnelPower"
-#define Material_SpecularAmount "specularamount"
-#define Material_SpecularRoughness "specularroughness"
-#define Material_RoughnessMap "roughnessmap"
-#define Material_Opacity "opacity"
-#define Material_OpacityMap "opacitymap"
-#define Material_BumpMap "bumpmap"
-#define Material_BumpAmount "bumpamount"
-#define Material_NormalMap "normalmap"
-#define Material_DisplacementMap "displacementmap"
-#define Material_DisplaceAmount "displaceamount"
-#define Material_TranslucencyMap "translucencymap"
-#define Material_TranslucentFalloff "translucentfalloff"
-#define Material_DiffuseLightWrap "diffuselightwrap"
-#define Material_ReferencedMaterial "referencedmaterial"
-#define Material_VertexColors "vertexcolors"
-#define Image_ImagePath "sourcepath"
-#define Image_OffscreenRendererId "subpresentation"
-#define Image_Scale_X "scaleu"
-#define Image_Scale_Y "scalev"
-#define Image_Pivot_X "pivotu"
-#define Image_Pivot_Y "pivotv"
-#define Image_Rotation "rotationuv"
-#define Image_Position_X "positionu"
-#define Image_Position_Y "positionv"
-#define Image_MappingMode "mappingmode"
-#define Image_HorizontalTilingMode "tilingmodehorz"
-#define Image_VerticalTilingMode "tilingmodevert"
-#define Text_Text "textstring"
-#define Text_Font "font"
-#define Text_FontSize "size"
-#define Text_HorizontalAlignment "horzalign"
-#define Text_VerticalAlignment "vertalign"
-#define Text_Leading "leading"
-#define Text_Tracking "tracking"
-#define Text_DropShadow "dropshadow"
-#define Text_DropShadowStrength "dropshadowstrength"
-#define Text_DropShadowOffsetX "dropshadowoffsetx"
-#define Text_DropShadowOffsetY "dropshadowoffsety"
-#define Text_WordWrap "wordwrap"
-#define Text_BoundingBox "boundingbox"
-#define Text_Elide "elide"
-#define Text_TextColor "textcolor"
-#define Text_BackColor "backcolor"
-#define Text_EnableAcceleratedFont "enableacceleratedfont"
-#define Layer_ProgressiveAAMode "progressiveaa"
-#define Layer_MultisampleAAMode "multisampleaa"
-#define Light_Scope "scope"
-#define Path_PathType "pathtype"
-#define Path_PaintStyle "paintstyle"
-#define Path_Width "width"
-#define Path_Opacity "opacity"
-#define Path_LinearError "linearerror"
-#define Path_EdgeTessAmount "edgetessamount"
-#define Path_InnerTessAmount "innertessamount"
-#define Path_BeginCapping "begincap"
-#define Path_BeginCapOffset "begincapoffset"
-#define Path_BeginCapOpacity "begincapopacity"
-#define Path_BeginCapWidth "begincapwidth"
-#define Path_EndCapping "endcap"
-#define Path_EndCapOffset "endcapoffset"
-#define Path_EndCapOpacity "endcapopacity"
-#define Path_EndCapWidth "endcapwidth"
-#define Path_PathBuffer "sourcepath"
-#define SubPath_Closed "closed"
-
-// Fill in implementations for the actual parse tables.
-#define HANDLE_QT3DS_RENDER_PROPERTY(type, name, dirty) \
- ParseProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_REAL_VEC2_PROPERTY(type, name, dirty) \
- ParseProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_VEC3_PROPERTY(type, name, dirty) \
- ParseProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_COLOR_PROPERTY(type, name, dirty) \
- ParseProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_RADIAN_PROPERTY(type, name, dirty) \
- ParseRadianProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_VEC3_RADIAN_PROPERTY(type, name, dirty) \
- ParseRadianProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_OPACITY_PROPERTY(type, name, dirty) \
- ParseOpacityProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_ROTATION_ORDER_PROPERTY(type, name, dirty) \
- ParseRotationOrder(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_NODE_ORIENTATION_PROPERTY(type, name, dirty) \
- ParseOrientation(inParser, type##_##name, inItem.m_Flags);
-#define HANDLE_QT3DS_RENDER_DEPTH_TEST_PROPERTY(type, name, dirty) \
- if (ParseProperty(inParser, type##_##name, inItem.m_##name)) \
- inItem.m_##name = !inItem.m_##name;
-#define HANDLE_QT3DS_NODE_FLAGS_PROPERTY(type, name, dirty) \
- ParseNodeFlagsProperty(inParser, type##_##name, inItem.m_Flags, \
- qt3ds::render::NodeFlagValues::name);
-#define HANDLE_QT3DS_NODE_FLAGS_INVERSE_PROPERTY(type, name, dirty) \
- ParseNodeFlagsInverseProperty(inParser, type##_##name, inItem.m_Flags, \
- qt3ds::render::NodeFlagValues::name);
-#define HANDLE_QT3DS_RENDER_ENUM_PROPERTY(type, name, dirty) \
- ParseEnumProperty(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY(type, name, dirty) \
- ParseAndResolveSourcePath(inParser, type##_##name, inItem.m_##name);
-#define HANDLE_QT3DS_RENDER_ARRAY_PROPERTY(type, name, index, dirty) \
- ParseProperty(inParser, type##_##name##_##index, inItem.m_##name[index]);
-#define HANDLE_QT3DS_RENDER_VEC2_PROPERTY(type, name, dirty) \
- ParseProperty(inParser, type##_##name##_##X, inItem.m_##name.x); \
- ParseProperty(inParser, type##_##name##_##Y, inItem.m_##name.y);
-#define HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY( \
- type, name, dirty) // noop by intention already handled by HANDLE_QT3DS_RENDER_COLOR_PROPERTY
-#define HANDLE_QT3DS_RENDER_TRANSFORM_VEC3_PROPERTY( \
- type, name, dirty) // noop by intention already handled by HANDLE_QT3DS_RENDER_VEC3_PROPERTY
-
- // Call the correct parser functions.
- void ParseProperties(SScene &inItem, IPropertyParser &inParser)
- {
- ITERATE_QT3DS_RENDER_SCENE_PROPERTIES
- }
- void ParseProperties(SNode &inItem, IPropertyParser &inParser)
- {
- bool eyeball;
- if (ParseProperty(inParser, "eyeball", eyeball))
- inItem.m_Flags.SetActive(eyeball);
- ITERATE_QT3DS_RENDER_NODE_PROPERTIES
- ParseProperty(inParser, "boneid", inItem.m_SkeletonId);
- bool ignoreParent = false;
- if (ParseProperty(inParser, "ignoresparent", ignoreParent))
- inItem.m_Flags.SetIgnoreParentTransform(ignoreParent);
- }
- void ParseProperties(SLayer &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SNode &>(inItem), inParser);
- ITERATE_QT3DS_RENDER_LAYER_PROPERTIES
- ParseProperty(inParser, "aosamplerate", inItem.m_AoSamplerate);
- }
- void ParseProperties(SCamera &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SNode &>(inItem), inParser);
- ITERATE_QT3DS_RENDER_CAMERA_PROPERTIES
- }
- void ParseProperties(SLight &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SNode &>(inItem), inParser);
- ITERATE_QT3DS_RENDER_LIGHT_PROPERTIES
- ParseProperty(inParser, "shdwmapres", inItem.m_ShadowMapRes);
- }
- void ParseProperties(SModel &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SNode &>(inItem), inParser);
- ITERATE_QT3DS_RENDER_MODEL_PROPERTIES
- ParseProperty(inParser, "poseroot", inItem.m_SkeletonRoot);
- }
-
- void ParseProperties(SText &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SNode &>(inItem), inParser);
- ITERATE_QT3DS_RENDER_TEXT_PROPERTIES
- }
- void ParseProperties(SLightmaps &inItem, IPropertyParser &inParser)
- {
- ITERATE_QT3DS_RENDER_LIGHTMAP_PROPERTIES
- }
- void ParseProperties(SDefaultMaterial &inItem, IPropertyParser &inParser)
- {
- ITERATE_QT3DS_RENDER_MATERIAL_PROPERTIES
- ParseProperties(inItem.m_Lightmaps, inParser);
- }
- void ParseProperties(SReferencedMaterial &inItem, IPropertyParser &inParser)
- {
- ITERATE_QT3DS_RENDER_REFERENCED_MATERIAL_PROPERTIES
- // Propagate lightmaps
- if (inItem.m_ReferencedMaterial
- && inItem.m_ReferencedMaterial->m_Type == GraphObjectTypes::DefaultMaterial)
- ParseProperties(
- static_cast<SDefaultMaterial *>(inItem.m_ReferencedMaterial)->m_Lightmaps,
- inParser);
- else if (inItem.m_ReferencedMaterial
- && inItem.m_ReferencedMaterial->m_Type == GraphObjectTypes::CustomMaterial)
- ParseProperties(
- static_cast<SCustomMaterial *>(inItem.m_ReferencedMaterial)->m_Lightmaps, inParser);
- }
- void ParseProperties(SImage &inItem, IPropertyParser &inParser)
- {
- ITERATE_QT3DS_RENDER_IMAGE_PROPERTIES
- }
- template <typename TDataType>
- void SetDynamicObjectProperty(SDynamicObject &inEffect,
- const qt3ds::render::dynamic::SPropertyDefinition &inPropDesc,
- const TDataType &inProp)
- {
- memCopy(inEffect.GetDataSectionBegin() + inPropDesc.m_Offset, &inProp, sizeof(TDataType));
- }
- template <typename TDataType>
- void SetDynamicObjectProperty(SDynamicObject &inEffect,
- const qt3ds::render::dynamic::SPropertyDefinition &inPropDesc,
- Option<TDataType> inProp)
- {
- if (inProp.hasValue()) {
- SetDynamicObjectProperty(inEffect, inPropDesc, *inProp);
- }
- }
- void ParseProperties(SCustomMaterial &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SDynamicObject &>(inItem), inParser);
- ParseProperties(inItem.m_Lightmaps, inParser);
- ITERATE_QT3DS_RENDER_CUSTOM_MATERIAL_PROPERTIES
- }
- void ParseProperties(SDynamicObject &inDynamicObject, IPropertyParser &inParser)
- {
- NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> theProperties =
- m_DynamicObjectSystem.GetProperties(inDynamicObject.m_ClassName);
-
- for (QT3DSU32 idx = 0, end = theProperties.size(); idx < end; ++idx) {
- const qt3ds::render::dynamic::SPropertyDefinition &theDefinition(theProperties[idx]);
- switch (theDefinition.m_DataType) {
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSRenderBool:
- SetDynamicObjectProperty(inDynamicObject, theDefinition,
- inParser.ParseBool(theDefinition.m_Name));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSF32:
- SetDynamicObjectProperty(inDynamicObject, theDefinition,
- inParser.ParseFloat(theDefinition.m_Name));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSI32:
- if (theDefinition.m_IsEnumProperty == false)
- SetDynamicObjectProperty(inDynamicObject, theDefinition,
- inParser.ParseU32(theDefinition.m_Name));
- else {
- Option<eastl::string> theEnum = inParser.ParseStr(theDefinition.m_Name);
- if (theEnum.hasValue()) {
- NVConstDataRef<CRegisteredString> theEnumNames =
- theDefinition.m_EnumValueNames;
- for (QT3DSU32 idx = 0, end = theEnumNames.size(); idx < end; ++idx) {
- if (theEnum->compare(theEnumNames[idx].c_str()) == 0) {
- SetDynamicObjectProperty(inDynamicObject, theDefinition, idx);
- break;
- }
- }
- }
- }
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4:
- SetDynamicObjectProperty(inDynamicObject, theDefinition,
- inParser.ParseVec4(theDefinition.m_Name));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec3:
- SetDynamicObjectProperty(inDynamicObject, theDefinition,
- inParser.ParseVec3(theDefinition.m_Name));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec2:
- SetDynamicObjectProperty(inDynamicObject, theDefinition,
- inParser.ParseVec2(theDefinition.m_Name));
- break;
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr:
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderImage2DPtr: {
- Option<eastl::string> theTexture = inParser.ParseStr(theDefinition.m_Name);
- if (theTexture.hasValue()) {
- CRegisteredString theStr;
- if (theTexture->size())
- theStr = m_StrTable.RegisterStr(theTexture->c_str());
-
- SetDynamicObjectProperty(inDynamicObject, theDefinition, theStr);
- }
- } break;
- case qt3ds::render::NVRenderShaderDataTypes::NVRenderDataBufferPtr:
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- }
- void ParseProperties(SPath &inItem, IPropertyParser &inParser)
- {
- ParseProperties(static_cast<SNode &>(inItem), inParser);
- ITERATE_QT3DS_RENDER_PATH_PROPERTIES
- }
- void ParseProperties(SPathSubPath &inItem, IPropertyParser &inParser)
- {
- ITERATE_QT3DS_RENDER_PATH_SUBPATH_PROPERTIES
- }
-
- void AddPluginPropertyUpdate(eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> &ioUpdates,
- qt3ds::render::IRenderPluginClass &,
- const qt3ds::render::SRenderPluginPropertyDeclaration &inDeclaration,
- Option<float> data)
- {
- if (data.hasValue()) {
- ioUpdates.push_back(
- qt3ds::render::SRenderPropertyValueUpdate(inDeclaration.m_Name, *data));
- }
- }
- void AddPluginPropertyUpdate(eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> &ioUpdates,
- qt3ds::render::IRenderPluginClass &inClass,
- const qt3ds::render::SRenderPluginPropertyDeclaration &inDeclaration,
- Option<QT3DSVec2> data)
- {
- if (data.hasValue()) {
- ioUpdates.push_back(qt3ds::render::SRenderPropertyValueUpdate(
- inClass.GetPropertyValueInfo(inDeclaration.m_StartOffset).first, data->x));
- ioUpdates.push_back(qt3ds::render::SRenderPropertyValueUpdate(
- inClass.GetPropertyValueInfo(inDeclaration.m_StartOffset + 1).first, data->y));
- }
- }
- void AddPluginPropertyUpdate(eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> &ioUpdates,
- qt3ds::render::IRenderPluginClass &inClass,
- const qt3ds::render::SRenderPluginPropertyDeclaration &inDeclaration,
- Option<QT3DSVec3> data)
- {
- if (data.hasValue()) {
- ioUpdates.push_back(qt3ds::render::SRenderPropertyValueUpdate(
- inClass.GetPropertyValueInfo(inDeclaration.m_StartOffset).first, data->x));
- ioUpdates.push_back(qt3ds::render::SRenderPropertyValueUpdate(
- inClass.GetPropertyValueInfo(inDeclaration.m_StartOffset + 1).first, data->y));
- ioUpdates.push_back(qt3ds::render::SRenderPropertyValueUpdate(
- inClass.GetPropertyValueInfo(inDeclaration.m_StartOffset + 2).first, data->z));
- }
- }
- void AddPluginPropertyUpdate(eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> &ioUpdates,
- qt3ds::render::IRenderPluginClass &,
- const qt3ds::render::SRenderPluginPropertyDeclaration &inDeclaration,
- Option<qt3ds::QT3DSI32> dataOpt)
- {
- if (dataOpt.hasValue()) {
- long data = static_cast<long>(*dataOpt);
- ioUpdates.push_back(
- qt3ds::render::SRenderPropertyValueUpdate(inDeclaration.m_Name, (QT3DSI32)data));
- }
- }
- void AddPluginPropertyUpdate(eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> &ioUpdates,
- qt3ds::render::IRenderPluginClass &,
- const qt3ds::render::SRenderPluginPropertyDeclaration &inDeclaration,
- Option<eastl::string> dataOpt)
- {
- if (dataOpt.hasValue()) {
- eastl::string &data = dataOpt.getValue();
- ioUpdates.push_back(qt3ds::render::SRenderPropertyValueUpdate(
- inDeclaration.m_Name, m_StrTable.RegisterStr(data.c_str())));
- }
- }
- void AddPluginPropertyUpdate(eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> &ioUpdates,
- qt3ds::render::IRenderPluginClass &,
- const qt3ds::render::SRenderPluginPropertyDeclaration &inDeclaration,
- Option<bool> dataOpt)
- {
- if (dataOpt.hasValue()) {
- bool &data = dataOpt.getValue();
- ioUpdates.push_back(
- qt3ds::render::SRenderPropertyValueUpdate(inDeclaration.m_Name, data));
- }
- }
- void ParseProperties(qt3ds::render::SRenderPlugin &inRenderPlugin, IPropertyParser &inParser)
- {
- qt3ds::render::IRenderPluginClass *theClass =
- m_RenderPluginManager.GetRenderPlugin(inRenderPlugin.m_PluginPath);
- if (theClass) {
- qt3ds::foundation::NVConstDataRef<qt3ds::render::SRenderPluginPropertyDeclaration>
- theClassProps = theClass->GetRegisteredProperties();
- if (theClassProps.size()) {
- qt3ds::render::IRenderPluginInstance *theInstance =
- m_RenderPluginManager.GetOrCreateRenderPluginInstance(
- inRenderPlugin.m_PluginPath, &inRenderPlugin);
- if (theInstance) {
- eastl::vector<qt3ds::render::SRenderPropertyValueUpdate> theUpdates;
- for (QT3DSU32 idx = 0, end = theClassProps.size(); idx < end; ++idx) {
- const qt3ds::render::SRenderPluginPropertyDeclaration &theDec(
- theClassProps[idx]);
- eastl::string tempStr;
- switch (theDec.m_Type) {
- case qt3ds::render::SRenderPluginPropertyTypes::Float:
- AddPluginPropertyUpdate(theUpdates, *theClass, theDec,
- inParser.ParseFloat(theDec.m_Name.c_str()));
- break;
- case qt3ds::render::SRenderPluginPropertyTypes::Vector2:
- AddPluginPropertyUpdate(theUpdates, *theClass, theDec,
- inParser.ParseVec2(theDec.m_Name.c_str()));
- break;
- case qt3ds::render::SRenderPluginPropertyTypes::Color:
- case qt3ds::render::SRenderPluginPropertyTypes::Vector3:
- AddPluginPropertyUpdate(theUpdates, *theClass, theDec,
- inParser.ParseVec3(theDec.m_Name.c_str()));
- break;
- case qt3ds::render::SRenderPluginPropertyTypes::Long:
- AddPluginPropertyUpdate(theUpdates, *theClass, theDec,
- inParser.ParseI32(theDec.m_Name.c_str()));
- break;
- case qt3ds::render::SRenderPluginPropertyTypes::String:
- AddPluginPropertyUpdate(theUpdates, *theClass, theDec,
- inParser.ParseStr(theDec.m_Name.c_str()));
- break;
- case qt3ds::render::SRenderPluginPropertyTypes::Boolean:
- AddPluginPropertyUpdate(theUpdates, *theClass, theDec,
- inParser.ParseBool(theDec.m_Name.c_str()));
- break;
- default:
- QT3DS_ASSERT(false);
- }
- }
- theInstance->Update(
- qt3ds::foundation::toConstDataRef(theUpdates.data(), theUpdates.size()));
- }
- }
- }
- }
-
-#undef HANDLE_QT3DS_RENDER_PROPERTY
-#undef HANDLE_QT3DS_RENDER_ENUM_PROPERTY
-#undef HANDLE_QT3DS_RENDER_RADIAN_PROPERTY
-#undef HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY
-#undef HANDLE_QT3DS_RENDER_ARRAY_PROPERTY
-#undef HANDLE_QT3DS_NODE_FLAGS_PROPERTY
-#undef HANDLE_QT3DS_ROTATION_ORDER_PROPERTY
-#undef HANDLE_QT3DS_RENDER_OPACITY_PROPERTY
-#undef HANDLE_QT3DS_NODE_ORIENTATION_PROPERTY
-#undef HANDLE_QT3DS_RENDER_DEPTH_TEST_PROPERTY
-#undef HANDLE_QT3DS_RENDER_VEC2_PROPERTY
-
- void ParseGraphPass1(SGraphObject *inParent)
- {
- TScope __elemScope(m_Reader);
- qt3dsdm::ComposerObjectTypes::Enum theObjType =
- qt3dsdm::ComposerObjectTypes::Convert(m_Reader.GetElementName());
- SGraphObject *theNewObject(NULL);
- const char8_t *theId;
- const char8_t *theVariants;
- m_Reader.Att("id", theId);
- m_Reader.Att("variants", theVariants);
-
- QString theString(theVariants);
- QStringRef theStringRef(&theString);
- bool isPartOfConfig = m_variantConfig.isPartOfConfig(theStringRef);
- if (isPartOfConfig) {
- switch (theObjType) {
- case qt3dsdm::ComposerObjectTypes::Scene: {
- SScene *theScene = QT3DS_NEW(m_PresentationAllocator, SScene)();
- theNewObject = theScene;
- m_Presentation->m_Scene = theScene;
- theScene->m_Presentation = m_Presentation;
- } break;
- case qt3dsdm::ComposerObjectTypes::Layer:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SLayer)();
- break;
- case qt3dsdm::ComposerObjectTypes::Group:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SNode)();
- break;
- case qt3dsdm::ComposerObjectTypes::Component:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SNode)();
- break;
- case qt3dsdm::ComposerObjectTypes::Camera:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SCamera)();
- break;
- case qt3dsdm::ComposerObjectTypes::Light:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SLight)();
- break;
- case qt3dsdm::ComposerObjectTypes::Model:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SModel)();
- break;
- case qt3dsdm::ComposerObjectTypes::Material:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SDefaultMaterial)();
- break;
- case qt3dsdm::ComposerObjectTypes::ReferencedMaterial:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SReferencedMaterial)();
- break;
- case qt3dsdm::ComposerObjectTypes::Image:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SImage)();
- break;
- case qt3dsdm::ComposerObjectTypes::Text:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SText)();
- break;
- case qt3dsdm::ComposerObjectTypes::Path:
- theNewObject = QT3DS_NEW(m_PresentationAllocator, SPath)();
- break;
- case qt3dsdm::ComposerObjectTypes::SubPath: {
- SPathSubPath *thePath = QT3DS_NEW(m_PresentationAllocator, SPathSubPath)();
- theNewObject = thePath;
- QT3DSU32 anchorCount = 0;
- TScope _childScope(m_Reader);
- for (bool success = m_Reader.MoveToFirstChild("PathAnchorPoint"); success;
- success = m_Reader.MoveToNextSibling("PathAnchorPoint")) {
- const char8_t *theId;
- m_Reader.Att("id", theId);
- CRegisteredString theIdStr = m_StrTable.RegisterStr(theId);
- m_AnchorIdToPathAndAnchorIndexMap.insert(
- eastl::make_pair(theIdStr, SPathAndAnchorIndex(thePath, anchorCount)));
- ++anchorCount;
- }
- m_PathManager.ResizePathSubPathBuffer(*thePath, anchorCount);
- } break;
- case qt3dsdm::ComposerObjectTypes::Effect: {
- const char8_t *effectClassId;
- m_Reader.Att("class", effectClassId);
- CRegisteredString theStr = m_StrTable.RegisterStr(effectClassId + 1);
- if (m_EffectSystem.IsEffectRegistered(theStr))
- theNewObject = m_EffectSystem.CreateEffectInstance(theStr, m_PresentationAllocator);
- } break;
- case qt3dsdm::ComposerObjectTypes::RenderPlugin: {
- const char8_t *classId;
- m_Reader.Att("class", classId);
- if (!qt3ds::foundation::isTrivial(classId)) {
- ++classId;
- TIdStringMap::iterator iter =
- m_RenderPluginSourcePaths.find(m_StrTable.RegisterStr(classId));
- if (iter != m_RenderPluginSourcePaths.end()) {
- CRegisteredString thePluginPath = m_StrTable.RegisterStr(iter->second.c_str());
- qt3ds::render::IRenderPluginClass *theClass =
- m_RenderPluginManager.GetRenderPlugin(thePluginPath);
- if (theClass) {
- qt3ds::render::SRenderPlugin *thePlugin =
- QT3DS_NEW(m_PresentationAllocator, qt3ds::render::SRenderPlugin)();
- thePlugin->m_PluginPath = thePluginPath;
- thePlugin->m_Flags.SetActive(true);
- theNewObject = thePlugin;
- }
- }
- }
- } break;
- case qt3dsdm::ComposerObjectTypes::CustomMaterial: {
- const char8_t *materialClassId;
- m_Reader.Att("class", materialClassId);
- CRegisteredString theStr = m_StrTable.RegisterStr(materialClassId + 1);
- if (m_CustomMaterialSystem.IsMaterialRegistered(theStr)) {
- theNewObject =
- m_CustomMaterialSystem.CreateCustomMaterial(theStr, m_PresentationAllocator);
- }
- } break;
- default:
- // Ignoring unknown objects entirely at this point
- break;
- }
- }
- if (theNewObject) {
- CRegisteredString theObjectId(m_StrTable.RegisterStr(theId));
- m_ObjectMap.insert(eastl::make_pair(theObjectId, theNewObject));
- theNewObject->m_Id = theObjectId;
- // setup hierarchy
- bool isParentNode;
- bool isChildNode;
- if (inParent) {
- switch (inParent->m_Type) {
- case GraphObjectTypes::Scene:
- if (theNewObject->m_Type == GraphObjectTypes::Layer) {
- static_cast<SScene *>(inParent)->AddChild(
- *static_cast<SLayer *>(theNewObject));
- }
- break;
-
- case GraphObjectTypes::DefaultMaterial:
- if (theNewObject->m_Type == GraphObjectTypes::Image) {
- static_cast<SImage *>(theNewObject)->m_Parent =
- static_cast<SDefaultMaterial *>(inParent);
- eastl::string thePath = eastl::string(theNewObject->m_Id.c_str());
- if (thePath.find("probe") != eastl::string::npos)
- static_cast<SImage *>(theNewObject)->m_MappingMode =
- ImageMappingModes::LightProbe;
- }
- break;
-
- case GraphObjectTypes::CustomMaterial:
- if (theNewObject->m_Type == GraphObjectTypes::Image) {
- static_cast<SImage *>(theNewObject)->m_Parent =
- static_cast<SCustomMaterial *>(inParent);
- eastl::string thePath = eastl::string(theNewObject->m_Id.c_str());
- if (thePath.find("probe") != eastl::string::npos) {
- static_cast<SImage *>(theNewObject)->m_MappingMode =
- ImageMappingModes::LightProbe;
- }
- } else {
- QT3DS_ASSERT(false);
- }
- break;
- case GraphObjectTypes::ReferencedMaterial:
- if (theNewObject->m_Type == GraphObjectTypes::Image) {
- // nothing to do yet
- } else {
- QT3DS_ASSERT(false);
- }
- break;
- case GraphObjectTypes::Path:
-
- if (GraphObjectTypes::IsMaterialType(theNewObject->m_Type))
- static_cast<SPath *>(inParent)->AddMaterial(theNewObject);
-
- else if (theNewObject->m_Type == GraphObjectTypes::PathSubPath)
- static_cast<SPath *>(inParent)->AddSubPath(
- *static_cast<SPathSubPath *>(theNewObject));
-
- break;
-
- default:
- isParentNode = IsNode(inParent->m_Type);
- isChildNode = IsNode(theNewObject->m_Type);
- if (isParentNode && isChildNode) {
- static_cast<SNode *>(inParent)->AddChild(
- *static_cast<SNode *>(theNewObject));
- } else if (isParentNode) {
- if (inParent->m_Type == GraphObjectTypes::Model
- && IsMaterial(theNewObject)) {
- static_cast<SModel *>(inParent)->AddMaterial(*theNewObject);
- } else {
- if (inParent->m_Type == GraphObjectTypes::Layer
- && theNewObject->m_Type == GraphObjectTypes::Effect) {
- static_cast<SLayer *>(inParent)->AddEffect(
- *static_cast<SEffect *>(theNewObject));
- } else if (inParent->m_Type == GraphObjectTypes::Layer
- && theNewObject->m_Type == GraphObjectTypes::Image) {
- eastl::string thePath = eastl::string(theNewObject->m_Id.c_str());
- if (thePath.find("probe2") != eastl::string::npos) {
- static_cast<SLayer *>(inParent)->m_LightProbe2 =
- static_cast<SImage *>(theNewObject);
- } else {
- static_cast<SLayer *>(inParent)->m_LightProbe =
- static_cast<SImage *>(theNewObject);
- }
- } else {
- if (theNewObject->m_Type == GraphObjectTypes::RenderPlugin) {
- qt3ds::render::SRenderPlugin *childObj =
- static_cast<qt3ds::render::SRenderPlugin *>(theNewObject);
- if (inParent->m_Type == GraphObjectTypes::Layer) {
- static_cast<SLayer *>(inParent)->m_RenderPlugin = childObj;
- } else {
- QT3DS_ASSERT(false);
- }
- } else {
- QT3DS_ASSERT(false);
- }
- }
- }
- } else {
- if (inParent->m_Type == GraphObjectTypes::Image
- && theNewObject->m_Type == GraphObjectTypes::RenderPlugin) {
- static_cast<SImage *>(inParent)->m_RenderPlugin =
- static_cast<qt3ds::render::SRenderPlugin *>(theNewObject);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- }
- }
- for (bool valid = m_Reader.MoveToFirstChild(); valid;
- valid = m_Reader.MoveToNextSibling())
- ParseGraphPass1(theNewObject);
- } else {
- if (isPartOfConfig) {
- // Object was of unknown type -> parse children with NULL parent
- for (bool valid = m_Reader.MoveToFirstChild(); valid;
- valid = m_Reader.MoveToNextSibling()) {
- ParseGraphPass1(NULL);
- }
- }
- // If object wasn't part of variant config -> skip children.
- // Continue parsing from next sibling with same parent.
- }
- }
-
- template <typename TObjType>
- void ParsePass2Properties(TObjType &inObject, const char8_t *inClassId)
- {
- const char8_t *theTypeName = m_Reader.GetNarrowElementName();
- SMetaPropertyParser theMetaParser(theTypeName, inClassId, m_MetaData);
- // Set default values
- ParseProperties(inObject, theMetaParser);
-
- // Now setup property values from the element itself.
- SDomReaderPropertyParser theReaderParser(m_Reader, m_TempBuf, *this, inObject);
- ParseProperties(inObject, theReaderParser);
- }
-
- // Parse the instance properties from the graph.
- void ParseGraphPass2()
- {
- TScope __instanceScope(m_Reader);
- const char8_t *theId;
- m_Reader.Att("id", theId);
- const char8_t *theClass = "";
- const char8_t *theVariants = "";
- m_Reader.Att("class", theClass);
- m_Reader.Att("variants", theVariants);
-
- QString theString(theVariants);
- QStringRef theStringRef(&theString);
- bool isPartOfConfig = m_variantConfig.isPartOfConfig(theStringRef);
- if (isPartOfConfig) {
- TIdObjectMap::iterator theObject = m_ObjectMap.find(m_StrTable.RegisterStr(theId));
- if (theObject != m_ObjectMap.end()) {
- switch (theObject->second->m_Type) {
- case GraphObjectTypes::Scene:
- ParsePass2Properties(*static_cast<SScene *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Node:
- ParsePass2Properties(*static_cast<SNode *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Layer:
- ParsePass2Properties(*static_cast<SLayer *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Camera:
- ParsePass2Properties(*static_cast<SCamera *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Light:
- ParsePass2Properties(*static_cast<SLight *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Model:
- ParsePass2Properties(*static_cast<SModel *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::DefaultMaterial:
- ParsePass2Properties(*static_cast<SDefaultMaterial *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::ReferencedMaterial:
- ParsePass2Properties(*static_cast<SReferencedMaterial *>(theObject->second),
- theClass);
- break;
- case GraphObjectTypes::Image:
- ParsePass2Properties(*static_cast<SImage *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Text:
- ParsePass2Properties(*static_cast<SText *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Effect:
- ParsePass2Properties(*static_cast<SEffect *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::RenderPlugin:
- ParsePass2Properties(*static_cast<qt3ds::render::SRenderPlugin *>(theObject->second),
- theClass);
- break;
- case GraphObjectTypes::CustomMaterial:
- ParsePass2Properties(*static_cast<SCustomMaterial *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::Path:
- ParsePass2Properties(*static_cast<SPath *>(theObject->second), theClass);
- break;
- case GraphObjectTypes::PathSubPath:
- ParsePass2Properties(*static_cast<SPathSubPath *>(theObject->second), theClass);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- }
-
- // If not part of variant config -> ignore children
- if (isPartOfConfig) {
- for (bool valid = m_Reader.MoveToFirstChild(); valid; valid = m_Reader.MoveToNextSibling())
- ParseGraphPass2();
- }
- }
-
- static bool ParseVec2(SDomReaderPropertyParser &inParser, const char *inName, QT3DSVec2 &outValue)
- {
- Option<QT3DSVec2> result = inParser.ParseVec2(inName);
-
- if (result.hasValue())
- outValue = *result;
-
- return result.hasValue();
- }
-
- static bool ParseFloat(SDomReaderPropertyParser &inParser, const char *inName, QT3DSF32 &outValue)
- {
- Option<QT3DSF32> result = inParser.ParseFloat(inName);
- if (result.hasValue())
- outValue = *result;
- return result.hasValue();
- }
-
- void ParseState(bool inSetSetValues)
- {
- TScope __slideScope(m_Reader);
- for (bool valid = m_Reader.MoveToFirstChild(); valid;
- valid = m_Reader.MoveToNextSibling()) {
- if (strcmp(m_Reader.GetNarrowElementName(), "Add") == 0
- || (inSetSetValues && strcmp(m_Reader.GetNarrowElementName(), "Set") == 0)) {
- const char8_t *theId;
- m_Reader.Att("ref", theId);
- CRegisteredString theIdStr(m_StrTable.RegisterStr(theId + 1));
- if (m_ObjectMap.contains(theIdStr)) {
- TIdObjectMap::iterator theObject = m_ObjectMap.find(theIdStr);
- if (theObject != m_ObjectMap.end()) {
- SDomReaderPropertyParser parser(m_Reader, m_TempBuf, *this, *theObject->second);
- switch (theObject->second->m_Type) {
- case GraphObjectTypes::Scene:
- ParseProperties(*reinterpret_cast<SScene *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Node:
- ParseProperties(*reinterpret_cast<SNode *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Layer:
- ParseProperties(*reinterpret_cast<SLayer *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Camera:
- ParseProperties(*reinterpret_cast<SCamera *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Light:
- ParseProperties(*reinterpret_cast<SLight *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Model:
- ParseProperties(*reinterpret_cast<SModel *>(theObject->second), parser);
- break;
- case GraphObjectTypes::DefaultMaterial:
- ParseProperties(*reinterpret_cast<SDefaultMaterial *>(theObject->second),
- parser);
- break;
- case GraphObjectTypes::ReferencedMaterial:
- ParseProperties(*static_cast<SReferencedMaterial *>(theObject->second),
- parser);
- break;
- case GraphObjectTypes::Image:
- ParseProperties(*reinterpret_cast<SImage *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Text:
- ParseProperties(*static_cast<SText *>(theObject->second), parser);
- break;
- case GraphObjectTypes::Effect:
- ParseProperties(*static_cast<SEffect *>(theObject->second), parser);
- break;
- case GraphObjectTypes::RenderPlugin:
- ParseProperties(
- *static_cast<qt3ds::render::SRenderPlugin *>(theObject->second), parser);
- break;
- case GraphObjectTypes::CustomMaterial:
- ParseProperties(
- *static_cast<qt3ds::render::SCustomMaterial *>(theObject->second),
- parser);
- break;
- case GraphObjectTypes::Path:
- ParseProperties(*static_cast<qt3ds::render::SPath *>(theObject->second),
- parser);
- break;
- case GraphObjectTypes::PathSubPath:
- ParseProperties(
- *static_cast<qt3ds::render::SPathSubPath *>(theObject->second), parser);
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- } else {
- TIdPathAnchorIndexMap::iterator iter =
- m_AnchorIdToPathAndAnchorIndexMap.find(theIdStr);
- if (iter != m_AnchorIdToPathAndAnchorIndexMap.end()) {
- SDomReaderPropertyParser parser(m_Reader, m_TempBuf, *this,
- *iter->second.m_Segment);
- NVDataRef<qt3ds::render::SPathAnchorPoint> thePathBuffer =
- m_PathManager.GetPathSubPathBuffer(*iter->second.m_Segment);
- QT3DSU32 anchorIndex = iter->second.m_AnchorIndex;
- QT3DSU32 numAnchors = thePathBuffer.size();
- if (anchorIndex < numAnchors) {
- qt3ds::render::SPathAnchorPoint &thePoint(thePathBuffer[anchorIndex]);
- ParseVec2(parser, "position", thePoint.m_Position);
- ParseFloat(parser, "incomingangle", thePoint.m_IncomingAngle);
- thePoint.m_OutgoingAngle = thePoint.m_IncomingAngle + 180.0f;
- ParseFloat(parser, "incomingdistance", thePoint.m_IncomingDistance);
- ParseFloat(parser, "outgoingdistance", thePoint.m_OutgoingDistance);
- }
- }
- }
- }
- }
- }
- }
-
- void AddPluginProperty(qt3ds::render::IRenderPluginClass &pluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Enum inPropType,
- eastl::string &tempStr, const char *propName)
- {
- tempStr.assign(propName);
- qt3ds::render::SRenderPluginPropertyDeclaration theDec(
- m_StrTable.RegisterStr(tempStr.c_str()), inPropType);
- pluginClass.RegisterProperty(theDec);
- }
-
- SPresentation *Load(bool inSetValuesFromSlides)
- {
- {
- TScope __outerScope(m_Reader);
- if (m_Reader.MoveToFirstChild("ProjectSettings")) {
- m_Reader.Att("presentationWidth", m_Presentation->m_PresentationDimensions.x);
- m_Reader.Att("presentationHeight", m_Presentation->m_PresentationDimensions.y);
- // Upsize them to a multiple of four.
- m_Presentation->m_PresentationDimensions.x =
- (QT3DSF32)qt3ds::render::ITextRenderer::NextMultipleOf4(
- (QT3DSU32)m_Presentation->m_PresentationDimensions.x);
- m_Presentation->m_PresentationDimensions.y =
- (QT3DSF32)qt3ds::render::ITextRenderer::NextMultipleOf4(
- (QT3DSU32)m_Presentation->m_PresentationDimensions.y);
- const char8_t *thePresentationRotation = "";
- if (m_Reader.Att("presentationRotation", thePresentationRotation)) {
- bool success = SRenderUIPLoader::ConvertEnumFromStr(
- thePresentationRotation, m_Presentation->m_PresentationRotation);
- (void)success;
- QT3DS_ASSERT(success);
- }
- m_Reader.Att("preferKTX", m_Presentation->m_preferKTX);
- }
- }
- {
- TScope __outerScope(m_Reader);
- if (m_Reader.MoveToFirstChild("Classes")) {
- for (bool valid = m_Reader.MoveToFirstChild(); valid;
- valid = m_Reader.MoveToNextSibling()) {
- const char8_t *idStr = "", *name = "", *sourcepath = "";
- m_Reader.Att("id", idStr);
- m_Reader.Att("name", name);
- m_Reader.Att("sourcepath", sourcepath);
- if (AreEqual(m_Reader.GetNarrowElementName(), "Effect")) {
- CRegisteredString theId(m_StrTable.RegisterStr(idStr));
- if (m_EffectSystem.IsEffectRegistered(theId) == false) {
- // File should already be loaded.
- Option<qt3dsdm::SMetaDataEffect> theEffectMetaData =
- m_MetaData.GetEffectMetaDataBySourcePath(sourcepath);
- if (theEffectMetaData.hasValue()) {
- qt3ds::render::IUIPLoader::CreateEffectClassFromMetaEffect(
- theId, m_Foundation, m_EffectSystem, *theEffectMetaData,
- m_StrTable);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- } else if (AreEqual(m_Reader.GetNarrowElementName(), "CustomMaterial")) {
- CRegisteredString theId(m_StrTable.RegisterStr(idStr));
- if (m_CustomMaterialSystem.IsMaterialRegistered(theId) == false) {
- // File should already be loaded.
- Option<qt3dsdm::SMetaDataCustomMaterial> theMetaData =
- m_MetaData.GetMaterialMetaDataBySourcePath(sourcepath);
- if (theMetaData.hasValue()) {
- qt3ds::render::IUIPLoader::CreateMaterialClassFromMetaMaterial(
- theId, m_Foundation, m_CustomMaterialSystem, *theMetaData,
- m_StrTable);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- } else if (AreEqual(m_Reader.GetNarrowElementName(), "RenderPlugin")) {
- CRegisteredString theId(m_StrTable.RegisterStr(idStr));
- m_MetaData.LoadPluginXMLFile(m_Reader.GetNarrowElementName(), idStr, name,
- sourcepath);
- eastl::vector<Q3DStudio::TRuntimeMetaDataStrType> theProperties;
- qt3ds::render::IRenderPluginClass *thePluginClass =
- m_RenderPluginManager.GetOrCreateRenderPlugin(
- m_StrTable.RegisterStr(sourcepath));
- if (thePluginClass) {
- m_RenderPluginSourcePaths.insert(
- eastl::make_pair(m_StrTable.RegisterStr(idStr), sourcepath));
- m_MetaData.GetInstanceProperties(m_Reader.GetNarrowElementName(), idStr,
- theProperties, false);
- eastl::string thePropertyStr;
- CRegisteredString metaType =
- m_MetaData.GetStringTable()->GetRenderStringTable().RegisterStr(
- m_Reader.GetNarrowElementName());
- CRegisteredString metaId =
- m_MetaData.GetStringTable()->GetRenderStringTable().RegisterStr(
- idStr);
- for (QT3DSU32 idx = 0, end = theProperties.size(); idx < end; ++idx) {
- using namespace Q3DStudio;
- CRegisteredString metaProp =
- m_MetaData.GetStringTable()->GetRenderStringTable().RegisterStr(
- theProperties[idx].c_str());
- Q3DStudio::ERuntimeDataModelDataType thePropType =
- m_MetaData.GetPropertyType(metaType, metaProp, metaId);
- switch (thePropType) {
- case ERuntimeDataModelDataTypeFloat:
- AddPluginProperty(
- *thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Float,
- thePropertyStr, metaProp.c_str());
- break;
- case ERuntimeDataModelDataTypeFloat2:
- AddPluginProperty(
- *thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Vector2,
- thePropertyStr, metaProp.c_str());
- break;
- case ERuntimeDataModelDataTypeFloat3:
- if (m_MetaData.GetAdditionalType(metaType, metaProp, metaId)
- != ERuntimeAdditionalMetaDataTypeColor)
- AddPluginProperty(
- *thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Vector3,
- thePropertyStr, metaProp.c_str());
- else
- AddPluginProperty(
- *thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Color,
- thePropertyStr, metaProp.c_str());
- break;
- case ERuntimeDataModelDataTypeLong:
- AddPluginProperty(*thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Long,
- thePropertyStr, metaProp.c_str());
- break;
- case ERuntimeDataModelDataTypeString:
- case ERuntimeDataModelDataTypeStringRef:
- AddPluginProperty(
- *thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::String,
- thePropertyStr, metaProp.c_str());
- break;
- case ERuntimeDataModelDataTypeBool:
- AddPluginProperty(
- *thePluginClass,
- qt3ds::render::SRenderPluginPropertyTypes::Boolean,
- thePropertyStr, metaProp.c_str());
- break;
- default:
- QT3DS_ASSERT(false);
- }
- }
- }
- }
- }
- }
- }
- {
- TScope __outerScope(m_Reader);
- if (m_Reader.MoveToFirstChild("BufferData")) {
- {
- TScope __imageScope(m_Reader);
- for (bool valid = m_Reader.MoveToFirstChild("ImageBuffer"); valid;
- valid = m_Reader.MoveToNextSibling()) {
- const char8_t *srcPath;
- m_Reader.UnregisteredAtt("sourcepath", srcPath);
- CRegisteredString imgPath = m_StrTable.RegisterStr(srcPath);
- bool hasTransparency = false;
- m_Reader.Att("hasTransparency", hasTransparency);
- m_BufferManager.SetImageHasTransparency(imgPath, hasTransparency);
- }
- }
- }
- }
- {
- TScope __outerScope(m_Reader);
- {
- if (m_Reader.MoveToFirstChild("Graph")) {
- {
- TScope __graphScope(m_Reader);
- for (bool valid = m_Reader.MoveToFirstChild(); valid;
- valid = m_Reader.MoveToNextSibling())
- ParseGraphPass1(NULL);
- }
- {
- TScope __graphScope(m_Reader);
- for (bool valid = m_Reader.MoveToFirstChild(); valid;
- valid = m_Reader.MoveToNextSibling())
- ParseGraphPass2();
- }
- }
- }
- }
- TScope __outerScope(m_Reader);
- if (m_Reader.MoveToFirstChild("Logic")) {
- for (bool valid = m_Reader.MoveToFirstChild("State"); valid;
- valid = m_Reader.MoveToNextSibling()) {
- {
- TScope __slideScope(m_Reader);
- ParseState(true); // parse master
- for (bool subSlide = m_Reader.MoveToFirstChild("State"); subSlide;
- subSlide = m_Reader.MoveToNextSibling("State")) {
- TScope __subSlideScope(m_Reader);
- ParseState(false); // parse slide setting only *add* values
- }
- }
- {
- TScope __slideScope(m_Reader);
- if (inSetValuesFromSlides && m_Reader.MoveToFirstChild("State"))
- ParseState(true); // parse slide setting only *set* values
- }
- }
- }
-
- return m_Presentation;
- }
-};
-}
-
-SPresentation *qt3ds::render::IUIPLoader::LoadUIPFile(
- qt3dsdm::IDOMReader &inReader, const char8_t *inFullPathToPresentationFile,
- Q3DStudio::IRuntimeMetaData &inMetaData, IStringTable &inStrTable,
- NVFoundationBase &inFoundation
- // Allocator used for the presentation objects themselves
- // this allows clients to pre-allocate a block of memory just for
- // the scene graph
- ,
- NVAllocatorCallback &inPresentationAllocator
- // Map of string ids to objects
- ,
- TIdObjectMap &ioObjectMap, IBufferManager &inBufferManager, IEffectSystem &inEffectSystem,
- const char8_t *inPresentationDir, IRenderPluginManager &inPluginManager,
- ICustomMaterialSystem &inCMS, IDynamicObjectSystem &inDynamicSystem,
- qt3ds::render::IPathManager &inPathManager, IUIPReferenceResolver *inResolver,
- const Q3DSVariantConfig &variantConfig, bool inSetValuesFromSlides)
-{
- SRenderUIPLoader theLoader(inReader, inFullPathToPresentationFile, inMetaData, inStrTable,
- inFoundation, inPresentationAllocator, ioObjectMap, inBufferManager,
- inEffectSystem, inPresentationDir, inPluginManager, inCMS,
- inDynamicSystem, inPathManager, inResolver, variantConfig);
- return theLoader.Load(inSetValuesFromSlides);
-}
-using namespace qt3dsdm;
-
-inline qt3ds::render::NVRenderTextureFormats::Enum
-ConvertTypeAndFormatToTextureFormat(const char8_t *inType, const char8_t *inFormat,
- NVFoundationBase &inFoundation)
-{
- qt3ds::render::NVRenderTextureFormats::Enum retval = qt3ds::render::NVRenderTextureFormats::RGBA8;
- if (AreEqual(inType, "ubyte")) {
- if (AreEqual(inFormat, "rgb"))
- retval = qt3ds::render::NVRenderTextureFormats::RGB8;
- else if (AreEqual(inFormat, "rgba"))
- retval = qt3ds::render::NVRenderTextureFormats::RGBA8;
- else if (AreEqual(inFormat, "alpha"))
- retval = qt3ds::render::NVRenderTextureFormats::Alpha8;
- else if (AreEqual(inFormat, "lum"))
- retval = qt3ds::render::NVRenderTextureFormats::Luminance8;
- else if (AreEqual(inFormat, "lum_alpha"))
- retval = qt3ds::render::NVRenderTextureFormats::LuminanceAlpha8;
- } else if (AreEqual(inType, "ushort")) {
- if (AreEqual(inFormat, "rgb"))
- retval = qt3ds::render::NVRenderTextureFormats::RGB565;
- else if (AreEqual(inFormat, "rgba"))
- retval = qt3ds::render::NVRenderTextureFormats::RGBA5551;
- } else {
- qCCritical(INVALID_PARAMETER, "Unsupported texture type %s, defaulting to RGBA8",
- inType);
- }
- return retval;
-}
-
-inline qt3ds::render::NVRenderTextureMagnifyingOp::Enum
-ConvertFilterToMagOp(const char8_t *inFilter, NVFoundationBase &inFoundation)
-{
- if (AreEqual(inFilter, "linear"))
- return qt3ds::render::NVRenderTextureMagnifyingOp::Linear;
- if (AreEqual(inFilter, "nearest"))
- return qt3ds::render::NVRenderTextureMagnifyingOp::Nearest;
- else {
- qCCritical(INVALID_PARAMETER, "Unsupported filter type %s, defaulting to linear",
- inFilter);
- return qt3ds::render::NVRenderTextureMagnifyingOp::Linear;
- }
-}
-
-inline qt3ds::render::NVRenderTextureCoordOp::Enum
-ConvertTextureCoordOp(const char8_t *inWrap, NVFoundationBase &inFoundation)
-{
- if (AreEqual(inWrap, "clamp"))
- return qt3ds::render::NVRenderTextureCoordOp::ClampToEdge;
- if (AreEqual(inWrap, "repeat"))
- return qt3ds::render::NVRenderTextureCoordOp::Repeat;
- else {
- qCCritical(INVALID_PARAMETER, "Unsupported wrap type %s, defaulting to clamp",
- inWrap);
- return qt3ds::render::NVRenderTextureCoordOp::ClampToEdge;
- }
-}
-
-// Re-register all strings because we can't be sure that the meta data system and the effect
-// system are sharing the same string table.
-void qt3ds::render::IUIPLoader::CreateEffectClassFromMetaEffect(
- CRegisteredString inEffectName, NVFoundationBase &inFoundation, IEffectSystem &inEffectSystem,
- const qt3dsdm::SMetaDataEffect &inMetaDataEffect, IStringTable &inStrTable)
-{
- using namespace qt3ds::render::dynamic;
- if (inEffectSystem.IsEffectRegistered(inEffectName)) {
- qCCritical(INVALID_OPERATION, "Effect %s is already registered",
- inEffectName.c_str());
- QT3DS_ASSERT(false);
- return;
- }
- nvvector<SPropertyDeclaration> thePropertyDeclarations(
- inFoundation.getAllocator(), "qt3ds::render::IUIPLoader::CreateEffectClassFromMetaEffect");
- nvvector<CRegisteredString> theEnumNames(
- inFoundation.getAllocator(), "qt3ds::render::IUIPLoader::CreateEffectClassFromMetaEffect");
- Qt3DSString theConvertStr;
- Qt3DSString theConvertShaderTypeStr;
- Qt3DSString theConvertShaderVersionStr;
-
- for (QT3DSU32 idx = 0, end = inMetaDataEffect.m_Properties.size(); idx < end; ++idx)
- thePropertyDeclarations.push_back(
- SPropertyDeclaration(inMetaDataEffect.m_Properties[idx].m_Name.c_str(),
- inMetaDataEffect.m_Properties[idx].m_DataType));
- inEffectSystem.RegisterEffect(inEffectName, thePropertyDeclarations);
- for (QT3DSU32 idx = 0, end = inMetaDataEffect.m_Properties.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(inMetaDataEffect.m_Properties[idx]);
- if (theDefinition.m_EnumValueNames.size()) {
- theEnumNames.clear();
- for (QT3DSU32 enumIdx = 0, enumEnd = theDefinition.m_EnumValueNames.size();
- enumIdx < enumEnd; ++enumIdx)
- theEnumNames.push_back(
- inStrTable.RegisterStr(theDefinition.m_EnumValueNames[enumIdx]));
- inEffectSystem.SetEffectPropertyEnumNames(
- inEffectName, inStrTable.RegisterStr(theDefinition.m_Name), theEnumNames);
- }
- if (theDefinition.m_DataType == qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr)
- inEffectSystem.SetEffectPropertyTextureSettings(
- inEffectName, inStrTable.RegisterStr(theDefinition.m_Name),
- inStrTable.RegisterStr(theDefinition.m_ImagePath), theDefinition.m_TexUsageType,
- theDefinition.m_CoordOp, theDefinition.m_MagFilterOp, theDefinition.m_MinFilterOp);
- }
- for (QT3DSU32 idx = 0, end = inMetaDataEffect.m_Shaders.size(); idx < end; ++idx) {
- const qt3dsdm::SMetaDataShader &theShader = inMetaDataEffect.m_Shaders[idx];
- theConvertStr.clear();
- theConvertStr = Qt3DSStringUtils::ConvertUTFtoQString(
- theShader.m_Code.c_str());
- theConvertShaderTypeStr = Qt3DSStringUtils::ConvertUTFtoQString(
- theShader.m_Type.c_str());
- theConvertShaderVersionStr = Qt3DSStringUtils::ConvertUTFtoQString(
- theShader.m_Version.c_str());
-
- inEffectSystem.SetShaderData(inStrTable.RegisterStr(theShader.m_Name.c_str()),
- theConvertStr.c_str(), theConvertShaderVersionStr.c_str(),
- theConvertStr.c_str(), theShader.m_HasGeomShader,
- theShader.m_IsComputeShader);
- }
-
- inEffectSystem.SetEffectCommands(inEffectName, inMetaDataEffect.m_EffectCommands);
-}
-
-void qt3ds::render::IUIPLoader::CreateMaterialClassFromMetaMaterial(
- CRegisteredString inClassName, NVFoundationBase &inFoundation,
- ICustomMaterialSystem &inMaterialSystem,
- const qt3dsdm::SMetaDataCustomMaterial &inMetaDataMaterial, IStringTable &inStrTable)
-{
- using namespace qt3ds::render::dynamic;
- if (inMaterialSystem.IsMaterialRegistered(inClassName)) {
- qCCritical(INVALID_OPERATION, "Effect %s is already registered",
- inClassName.c_str());
- QT3DS_ASSERT(false);
- return;
- }
- nvvector<SPropertyDeclaration> thePropertyDeclarations(
- inFoundation.getAllocator(),
- "qt3ds::render::IUIPLoader::CreateMaterialClassFromMetaMaterial");
- nvvector<CRegisteredString> theEnumNames(
- inFoundation.getAllocator(),
- "qt3ds::render::IUIPLoader::CreateMaterialClassFromMetaMaterial");
- Qt3DSString theConvertStr;
- Qt3DSString theConvertShaderTypeStr;
- Qt3DSString theConvertShaderVersionStr;
- for (QT3DSU32 idx = 0, end = inMetaDataMaterial.m_Properties.size(); idx < end; ++idx)
- thePropertyDeclarations.push_back(
- SPropertyDeclaration(inMetaDataMaterial.m_Properties[idx].m_Name.c_str(),
- inMetaDataMaterial.m_Properties[idx].m_DataType));
- inMaterialSystem.RegisterMaterialClass(inClassName, thePropertyDeclarations);
- for (QT3DSU32 idx = 0, end = inMetaDataMaterial.m_Properties.size(); idx < end; ++idx) {
- const SPropertyDefinition &theDefinition(inMetaDataMaterial.m_Properties[idx]);
- if (theDefinition.m_EnumValueNames.size()) {
- theEnumNames.clear();
- for (QT3DSU32 enumIdx = 0, enumEnd = theDefinition.m_EnumValueNames.size();
- enumIdx < enumEnd; ++enumIdx)
- theEnumNames.push_back(
- inStrTable.RegisterStr(theDefinition.m_EnumValueNames[enumIdx]));
- inMaterialSystem.SetPropertyEnumNames(
- inClassName, inStrTable.RegisterStr(theDefinition.m_Name), theEnumNames);
- }
- if (theDefinition.m_DataType == qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr)
- inMaterialSystem.SetPropertyTextureSettings(
- inClassName, inStrTable.RegisterStr(theDefinition.m_Name),
- inStrTable.RegisterStr(theDefinition.m_ImagePath), theDefinition.m_TexUsageType,
- theDefinition.m_CoordOp, theDefinition.m_MagFilterOp, theDefinition.m_MinFilterOp);
- }
- if (inMetaDataMaterial.m_Shaders.size()) {
- for (QT3DSU32 idx = 0, end = (QT3DSU32)inMetaDataMaterial.m_Shaders.size(); idx < end; ++idx) {
- const qt3dsdm::SMetaDataShader &theShader = inMetaDataMaterial.m_Shaders[idx];
- theConvertStr = Qt3DSStringUtils::ConvertUTFtoQString(
- theShader.m_Code.c_str());
- theConvertShaderTypeStr = Qt3DSStringUtils::ConvertUTFtoQString(
- theShader.m_Type.c_str());
- theConvertShaderVersionStr = Qt3DSStringUtils::ConvertUTFtoQString(
- theShader.m_Version.c_str());
- inMaterialSystem.SetMaterialClassShader(
- inStrTable.RegisterStr(theShader.m_Name.c_str()), theConvertShaderTypeStr.c_str(),
- theConvertShaderVersionStr.c_str(), theConvertStr.c_str(),
- theShader.m_HasGeomShader, theShader.m_IsComputeShader);
- }
- }
-
- inMaterialSystem.SetCustomMaterialCommands(inClassName,
- inMetaDataMaterial.m_CustomMaterialCommands);
- inMaterialSystem.SetCustomMaterialTransparency(inClassName,
- inMetaDataMaterial.m_HasTransparency);
- inMaterialSystem.SetCustomMaterialRefraction(inClassName, inMetaDataMaterial.m_HasRefraction);
- inMaterialSystem.SetCustomMaterialAlwaysDirty(inClassName, inMetaDataMaterial.m_AlwaysDirty);
- inMaterialSystem.SetCustomMaterialShaderKey(inClassName, inMetaDataMaterial.m_ShaderKey);
- inMaterialSystem.SetCustomMaterialLayerCount(inClassName, inMetaDataMaterial.m_LayerCount);
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.h
deleted file mode 100644
index 2b70c687..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPLoader.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_UIP_LOADER_H
-#define QT3DS_RENDER_UIP_LOADER_H
-
-#ifdef QT3DS_RENDER_ENABLE_LOAD_UIP
-
-#include "Qt3DSRender.h"
-#include "foundation/StringTable.h"
-#include <EASTL/utility.h>
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderGraphObject.h"
-#include <QtCore/qstring.h>
-
-namespace Q3DStudio {
-class IRuntimeMetaData;
-}
-
-namespace qt3dsdm {
-class IDOMReader;
-struct SMetaDataEffect;
-struct SMetaDataCustomMaterial;
-}
-
-namespace qt3ds {
-class Q3DSVariantConfig;
-
-namespace render {
-
- class IBufferManager;
-
- typedef nvhash_map<CRegisteredString, SGraphObject *> TIdObjectMap;
-
- struct IUIPReferenceResolver
- {
- protected:
- virtual ~IUIPReferenceResolver() {}
- public:
- virtual CRegisteredString ResolveReference(CRegisteredString inStart,
- const char *inReference) = 0;
- };
-
- struct SPresentation;
-
- class QT3DS_AUTOTEST_EXPORT IUIPLoader
- {
- public:
- // The reader needs to point to the top of the file, we will search
- // several objects that exist at the top level of the uip file.
- // Returns NULL if we were incapable of loading the presentation.
- static SPresentation *
- LoadUIPFile(qt3dsdm::IDOMReader &inReader
- // the full path, including the filename
- // to the presentation file
- ,
- const char8_t *inFullPathToPresentationFile,
- Q3DStudio::IRuntimeMetaData &inMetaData, IStringTable &inStrTable,
- NVFoundationBase &inFoundation
- // Allocator used for the presentation objects themselves
- // this allows clients to pre-allocate a block of memory just for
- // the scene graph
- ,
- NVAllocatorCallback &inPresentationAllocator
- // Map of string ids to objects
- ,
- TIdObjectMap &ioObjectMap
- // Buffer manager to load details about the images
- ,
- IBufferManager &inBufferManager
- // To load effects we need the effect system
- // and the presentation directory
- ,
- IEffectSystem &inEffectSystem, const char8_t *inPresentationDir,
- IRenderPluginManager &inPluginManager, ICustomMaterialSystem &inMaterialSystem,
- IDynamicObjectSystem &inDynamicSystem, qt3ds::render::IPathManager &inPathManager
- // Resolve references to objects; this is done by the main uip loader during
- // its normal mode of operation so we try to reuse that code.
- ,
- IUIPReferenceResolver *inResolver
- // Variant config defines variant groups and tags to be used to filter out
- // unneeded parts of the presentation
- ,
- const Q3DSVariantConfig &variantConfig
- // Set some initial values by going to the master slide then slide 1
- // Useful for quick testing, sort of equivalent to showing the first frame
- // of a given presentation
- ,
- bool setValuesFromSlides = false);
-
- static void CreateEffectClassFromMetaEffect(CRegisteredString inEffectName,
- NVFoundationBase &inFoundation,
- IEffectSystem &inEffectSystem,
- const qt3dsdm::SMetaDataEffect &inMetaDataEffect,
- IStringTable &inStrTable);
-
- static void CreateMaterialClassFromMetaMaterial(
- CRegisteredString inEffectName, NVFoundationBase &inFoundation,
- ICustomMaterialSystem &inEffectSystem,
- const qt3dsdm::SMetaDataCustomMaterial &inMetaDataMaterial, IStringTable &inStrTable);
- };
-}
-}
-
-#endif
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.cpp
deleted file mode 100644
index a0594933..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.cpp
+++ /dev/null
@@ -1,464 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderUIPSharedTranslation.h"
-
-namespace qt3ds {
-namespace render {
-
-#define WCHAR_T_Directional L"Directional"
-#define WCHAR_T_Point L"Point"
-#define WCHAR_T_Area L"Area"
-#define WCHAR_T_None L"None"
-#define WCHAR_T_Vertex L"Vertex"
-#define WCHAR_T_Pixel L"Pixel"
-#define WCHAR_T_Normal L"Normal"
-#define WCHAR_T_Screen L"Screen"
-#define WCHAR_T_Multiply L"Multiply"
-#define WCHAR_T_Overlay L"Overlay"
-#define WCHAR_T_ColorBurn L"ColorBurn"
-#define WCHAR_T_ColorDodge L"ColorDodge"
-#define WCHAR_T_Add L"Add"
-#define WCHAR_T_Subtract L"Subtract"
-#define WCHAR_T_UV_Mapping L"UV Mapping"
-#define WCHAR_T_Environmental_Mapping L"Environmental Mapping"
-#define WCHAR_T_Light_Probe L"Light Probe"
-#define WCHAR_T_No_Tiling L"No Tiling"
-#define WCHAR_T_Mirrored L"Mirrored"
-#define WCHAR_T_Tiled L"Tiled"
-#define WCHAR_T_Left L"Left"
-#define WCHAR_T_Center L"Center"
-#define WCHAR_T_Right L"Right"
-#define WCHAR_T_Top L"Top"
-#define WCHAR_T_Middle L"Middle"
-#define WCHAR_T_Bottom L"Bottom"
-#define WCHAR_T_ElideNone L"ElideNone"
-#define WCHAR_T_ElideLeft L"ElideLeft"
-#define WCHAR_T_ElideMiddle L"ElideMiddle"
-#define WCHAR_T_ElideRight L"ElideRight"
-#define WCHAR_T_2x L"2x"
-#define WCHAR_T_4x L"4x"
-#define WCHAR_T_8x L"8x"
-#define WCHAR_T_SSAA L"SSAA"
-#define WCHAR_T_NoRotation L"NoRotation"
-#define WCHAR_T_Clockwise90 L"90"
-#define WCHAR_T_Clockwise180 L"180"
-#define WCHAR_T_Clockwise270 L"270"
-#define WCHAR_T_Fit L"Fit"
-#define WCHAR_T_Same_Size L"Same Size"
-#define WCHAR_T_CENTER L"Center"
-#define WCHAR_T_North L"N"
-#define WCHAR_T_NorthEast L"NE"
-#define WCHAR_T_East L"E"
-#define WCHAR_T_SouthEast L"SE"
-#define WCHAR_T_South L"S"
-#define WCHAR_T_SouthWest L"SW"
-#define WCHAR_T_West L"W"
-#define WCHAR_T_NorthWest L"NW"
-#define WCHAR_T_LeftWidth L"Left/Width"
-#define WCHAR_T_LeftRight L"Left/Right"
-#define WCHAR_T_WidthRight L"Width/Right"
-#define WCHAR_T_TopHeight L"Top/Height"
-#define WCHAR_T_TopBottom L"Top/Bottom"
-#define WCHAR_T_HeightBottom L"Height/Bottom"
-#define WCHAR_T_Percent L"percent"
-#define WCHAR_T_Pixels L"pixels"
-#define WCHAR_T_Fit_Horizontal L"Fit Horizontal"
-#define WCHAR_T_Fit_Vertical L"Fit Vertical"
-#define WCHAR_T_Default L"Default"
-#define WCHAR_T_KGGX L"KGGX"
-#define WCHAR_T_KWard L"KWard"
-#define WCHAR_T_Transparent L"Transparent"
-#define WCHAR_T_Unspecified L"Unspecified"
-#define WCHAR_T_Color L"SolidColor"
-#define WCHAR_T_Linear L"Linear"
-#define WCHAR_T_Phong L"Phong"
-#define WCHAR_T_NPatch L"NPatch"
-#define WCHAR_T_Taper L"Taper"
-#define WCHAR_T_Geometry L"Geometry"
-#define WCHAR_T_Painted L"Painted"
-#define WCHAR_T_Filled L"Filled"
-#define WCHAR_T_Stroked L"Stroked"
-#define WCHAR_T_FilledAndStroked L"Filled and Stroked"
-#define WCHAR_T_Simple L"Simple"
-#define WCHAR_T_Smoke L"Smoke"
-#define WCHAR_T_Cloud L"Cloud"
-#define WCHAR_T_Fluid L"Fluid"
-#define WCHAR_T_User L"User"
-#define WCHAR_T_Clip L"Clip"
-#define WCHAR_T_WrapWord L"WrapWord"
-#define WCHAR_T_WrapAnywhere L"WrapAnywhere"
-
-#define CHAR_T_Directional "Directional"
-#define CHAR_T_Point "Point"
-#define CHAR_T_Area "Area"
-#define CHAR_T_None "None"
-#define CHAR_T_Vertex "Vertex"
-#define CHAR_T_Pixel "Pixel"
-#define CHAR_T_Normal "Normal"
-#define CHAR_T_Screen "Screen"
-#define CHAR_T_Multiply "Multiply"
-#define CHAR_T_Overlay "Overlay"
-#define CHAR_T_ColorBurn "ColorBurn"
-#define CHAR_T_ColorDodge "ColorDodge"
-#define CHAR_T_Add "Add"
-#define CHAR_T_Subtract "Subtract"
-#define CHAR_T_UV_Mapping "UV Mapping"
-#define CHAR_T_Environmental_Mapping "Environmental Mapping"
-#define CHAR_T_Light_Probe "Light Probe"
-#define CHAR_T_No_Tiling "No Tiling"
-#define CHAR_T_Mirrored "Mirrored"
-#define CHAR_T_Tiled "Tiled"
-#define CHAR_T_Left "Left"
-#define CHAR_T_Center "Center"
-#define CHAR_T_Right "Right"
-#define CHAR_T_Top "Top"
-#define CHAR_T_Middle "Middle"
-#define CHAR_T_Bottom "Bottom"
-#define CHAR_T_ElideNone "ElideNone"
-#define CHAR_T_ElideLeft "ElideLeft"
-#define CHAR_T_ElideMiddle "ElideMiddle"
-#define CHAR_T_ElideRight "ElideRight"
-#define CHAR_T_2x "2x"
-#define CHAR_T_4x "4x"
-#define CHAR_T_8x "8x"
-#define CHAR_T_SSAA "SSAA"
-#define CHAR_T_NoRotation "NoRotation"
-#define CHAR_T_Clockwise90 "90"
-#define CHAR_T_Clockwise180 "180"
-#define CHAR_T_Clockwise270 "270"
-#define CHAR_T_Fit "Fit"
-#define CHAR_T_Same_Size "Same Size"
-#define CHAR_T_CENTER "Center"
-#define CHAR_T_North "N"
-#define CHAR_T_NorthEast "NE"
-#define CHAR_T_East "E"
-#define CHAR_T_SouthEast "SE"
-#define CHAR_T_South "S"
-#define CHAR_T_SouthWest "SW"
-#define CHAR_T_West "W"
-#define CHAR_T_NorthWest "NW"
-#define CHAR_T_LeftWidth "Left/Width"
-#define CHAR_T_LeftRight "Left/Right"
-#define CHAR_T_WidthRight "Width/Right"
-#define CHAR_T_TopHeight "Top/Height"
-#define CHAR_T_TopBottom "Top/Bottom"
-#define CHAR_T_HeightBottom "Height/Bottom"
-#define CHAR_T_Percent "percent"
-#define CHAR_T_Pixels "pixels"
-#define CHAR_T_Fit_Horizontal "Fit Horizontal"
-#define CHAR_T_Fit_Vertical "Fit Vertical"
-#define CHAR_T_Default "Default"
-#define CHAR_T_KGGX "KGGX"
-#define CHAR_T_KWard "KWard"
-#define CHAR_T_Transparent "Transparent"
-#define CHAR_T_Unspecified "Unspecified"
-#define CHAR_T_Color "SolidColor"
-#define CHAR_T_Linear "Linear"
-#define CHAR_T_Phong "Phong"
-#define CHAR_T_NPatch "NPatch"
-#define CHAR_T_Taper "Taper"
-#define CHAR_T_Geometry "Geometry"
-#define CHAR_T_Painted "Painted"
-#define CHAR_T_Filled "Filled"
-#define CHAR_T_Stroked "Stroked"
-#define CHAR_T_FilledAndStroked "Filled and Stroked"
-#define CHAR_T_Simple "Simple"
-#define CHAR_T_Smoke "Smoke"
-#define CHAR_T_Cloud "Cloud"
-#define CHAR_T_Fluid "Fluid"
-#define CHAR_T_User "User"
-#define CHAR_T_Clip "Clip"
-#define CHAR_T_WrapWord "WrapWord"
-#define CHAR_T_WrapAnywhere "WrapAnywhere"
-
-#define DEFINE_NAME_MAP_ENTRY(enumval, name) \
- { \
- enumval, WCHAR_T_##name, CHAR_T_##name \
- }
- SEnumNameMap g_LightTypesMap[] = {
- DEFINE_NAME_MAP_ENTRY(RenderLightTypes::Directional, Directional),
- DEFINE_NAME_MAP_ENTRY(RenderLightTypes::Point, Point),
- DEFINE_NAME_MAP_ENTRY(RenderLightTypes::Area, Area),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_MaterialLightingMap[] = {
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialLighting::NoLighting, None),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialLighting::VertexLighting, Vertex),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialLighting::FragmentLighting, Pixel),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_BlendModeMap[] = {
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialBlendMode::Normal, Normal),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialBlendMode::Screen, Screen),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialBlendMode::Multiply, Multiply),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialBlendMode::Overlay, Overlay),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialBlendMode::ColorBurn, ColorBurn),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialBlendMode::ColorDodge, ColorDodge),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_ImageMappingModeMap[] = {
- DEFINE_NAME_MAP_ENTRY(ImageMappingModes::Normal, UV_Mapping),
- DEFINE_NAME_MAP_ENTRY(ImageMappingModes::Environment, Environmental_Mapping),
- DEFINE_NAME_MAP_ENTRY(ImageMappingModes::LightProbe, Light_Probe),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_RenderTextureCoordOpMap[] = {
- DEFINE_NAME_MAP_ENTRY(NVRenderTextureCoordOp::ClampToEdge, No_Tiling),
- DEFINE_NAME_MAP_ENTRY(NVRenderTextureCoordOp::MirroredRepeat, Mirrored),
- DEFINE_NAME_MAP_ENTRY(NVRenderTextureCoordOp::Repeat, Tiled),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_TextHorizontalAlignmentMap[] = {
- DEFINE_NAME_MAP_ENTRY(TextHorizontalAlignment::Left, Left),
- DEFINE_NAME_MAP_ENTRY(TextHorizontalAlignment::Center, Center),
- DEFINE_NAME_MAP_ENTRY(TextHorizontalAlignment::Right, Right),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_TextVerticalAlignmentMap[] = {
- DEFINE_NAME_MAP_ENTRY(TextVerticalAlignment::Top, Top),
- DEFINE_NAME_MAP_ENTRY(TextVerticalAlignment::Middle, Middle),
- DEFINE_NAME_MAP_ENTRY(TextVerticalAlignment::Bottom, Bottom),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_TextWordWrapMap[] = {
- DEFINE_NAME_MAP_ENTRY(TextWordWrap::Clip, Clip),
- DEFINE_NAME_MAP_ENTRY(TextWordWrap::WrapWord, WrapWord),
- DEFINE_NAME_MAP_ENTRY(TextWordWrap::WrapAnywhere, WrapAnywhere),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_TextElideMap[] = {
- DEFINE_NAME_MAP_ENTRY(TextElide::ElideNone, ElideNone),
- DEFINE_NAME_MAP_ENTRY(TextElide::ElideLeft, ElideLeft),
- DEFINE_NAME_MAP_ENTRY(TextElide::ElideMiddle, ElideMiddle),
- DEFINE_NAME_MAP_ENTRY(TextElide::ElideRight, ElideRight),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_ProgressiveAAValuesMap[] = {
- DEFINE_NAME_MAP_ENTRY(AAModeValues::NoAA, None),
- DEFINE_NAME_MAP_ENTRY(AAModeValues::SSAA, SSAA),
- DEFINE_NAME_MAP_ENTRY(AAModeValues::X2, 2x),
- DEFINE_NAME_MAP_ENTRY(AAModeValues::X4, 4x),
- DEFINE_NAME_MAP_ENTRY(AAModeValues::X8, 8x),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_LayerBlendTypesMap[] = {
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::Normal, Normal),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::Screen, Screen),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::Multiply, Multiply),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::Add, Add),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::Subtract, Subtract),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::Overlay, Overlay),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::ColorBurn, ColorBurn),
- DEFINE_NAME_MAP_ENTRY(LayerBlendTypes::ColorDodge, ColorDodge),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_RenderRotationValuesMap[] = {
- DEFINE_NAME_MAP_ENTRY(RenderRotationValues::NoRotation, None),
- DEFINE_NAME_MAP_ENTRY(RenderRotationValues::Clockwise90, Clockwise90),
- DEFINE_NAME_MAP_ENTRY(RenderRotationValues::Clockwise180, Clockwise180),
- DEFINE_NAME_MAP_ENTRY(RenderRotationValues::Clockwise270, Clockwise270),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_CameraScaleModesMap[] = {
- DEFINE_NAME_MAP_ENTRY(CameraScaleModes::Fit, Fit),
- DEFINE_NAME_MAP_ENTRY(CameraScaleModes::SameSize, Same_Size),
- DEFINE_NAME_MAP_ENTRY(CameraScaleModes::FitHorizontal, Fit_Horizontal),
- DEFINE_NAME_MAP_ENTRY(CameraScaleModes::FitVertical, Fit_Vertical),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_CameraScaleAnchorsMap[] = {
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::Center, Center),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::North, North),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::NorthEast, NorthEast),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::East, East),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::SouthEast, SouthEast),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::South, South),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::SouthWest, SouthWest),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::West, West),
- DEFINE_NAME_MAP_ENTRY(CameraScaleAnchors::NorthWest, NorthWest),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_HorizontalFieldValuesMap[] = {
- DEFINE_NAME_MAP_ENTRY(HorizontalFieldValues::LeftWidth, LeftWidth),
- DEFINE_NAME_MAP_ENTRY(HorizontalFieldValues::LeftRight, LeftRight),
- DEFINE_NAME_MAP_ENTRY(HorizontalFieldValues::WidthRight, WidthRight),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_VerticalFieldValuesMap[] = {
- DEFINE_NAME_MAP_ENTRY(VerticalFieldValues::TopHeight, TopHeight),
- DEFINE_NAME_MAP_ENTRY(VerticalFieldValues::TopBottom, TopBottom),
- DEFINE_NAME_MAP_ENTRY(VerticalFieldValues::HeightBottom, HeightBottom),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_LayerUnitTypesMap[] = {
- DEFINE_NAME_MAP_ENTRY(LayerUnitTypes::Percent, Percent),
- DEFINE_NAME_MAP_ENTRY(LayerUnitTypes::Pixels, Pixels),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_LayerBackgroundMap[] = {
- DEFINE_NAME_MAP_ENTRY(LayerBackground::Transparent, Transparent),
- DEFINE_NAME_MAP_ENTRY(LayerBackground::Unspecified, Unspecified),
- DEFINE_NAME_MAP_ENTRY(LayerBackground::Color, Color),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_SpecularTypesMap[] = {
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialSpecularModel::Default, Default),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialSpecularModel::KGGX, KGGX),
- DEFINE_NAME_MAP_ENTRY(DefaultMaterialSpecularModel::KWard, KWard),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_TessellationValuesMap[] = {
- DEFINE_NAME_MAP_ENTRY(TessModeValues::NoTess, None),
- DEFINE_NAME_MAP_ENTRY(TessModeValues::TessLinear, Linear),
- DEFINE_NAME_MAP_ENTRY(TessModeValues::TessPhong, Phong),
- DEFINE_NAME_MAP_ENTRY(TessModeValues::TessNPatch, NPatch),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_PathCappingValuesMap[] = {
- DEFINE_NAME_MAP_ENTRY(PathCapping::Noner, None),
- DEFINE_NAME_MAP_ENTRY(PathCapping::Taper, Taper),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_PathTypesMap[] = {
- DEFINE_NAME_MAP_ENTRY(PathTypes::Noner, None),
- DEFINE_NAME_MAP_ENTRY(PathTypes::Painted, Painted),
- DEFINE_NAME_MAP_ENTRY(PathTypes::Geometry, Geometry),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap g_PathPaintStylesMap[] = {
- DEFINE_NAME_MAP_ENTRY(PathPaintStyles::Noner, None),
- DEFINE_NAME_MAP_ENTRY(PathPaintStyles::FilledAndStroked, FilledAndStroked),
- DEFINE_NAME_MAP_ENTRY(PathPaintStyles::Filled, Filled),
- DEFINE_NAME_MAP_ENTRY(PathPaintStyles::Stroked, Stroked),
- { (QT3DSU32)-1, NULL },
- };
-
- SEnumNameMap *SEnumParseMap<RenderLightTypes::Enum>::GetMap() { return g_LightTypesMap; }
-
- SEnumNameMap *SEnumParseMap<DefaultMaterialLighting::Enum>::GetMap()
- {
- return g_MaterialLightingMap;
- }
-
- SEnumNameMap *SEnumParseMap<DefaultMaterialBlendMode::Enum>::GetMap() { return g_BlendModeMap; }
-
- SEnumNameMap *SEnumParseMap<ImageMappingModes::Enum>::GetMap() { return g_ImageMappingModeMap; }
-
- SEnumNameMap *SEnumParseMap<NVRenderTextureCoordOp::Enum>::GetMap()
- {
- return g_RenderTextureCoordOpMap;
- }
-
- SEnumNameMap *SEnumParseMap<TextHorizontalAlignment::Enum>::GetMap()
- {
- return g_TextHorizontalAlignmentMap;
- }
-
- SEnumNameMap *SEnumParseMap<TextVerticalAlignment::Enum>::GetMap()
- {
- return g_TextVerticalAlignmentMap;
- }
-
- SEnumNameMap *SEnumParseMap<TextWordWrap::Enum>::GetMap()
- {
- return g_TextWordWrapMap;
- }
-
- SEnumNameMap *SEnumParseMap<TextElide::Enum>::GetMap()
- {
- return g_TextElideMap;
- }
-
- SEnumNameMap *SEnumParseMap<AAModeValues::Enum>::GetMap() { return g_ProgressiveAAValuesMap; }
-
- SEnumNameMap *SEnumParseMap<LayerBlendTypes::Enum>::GetMap() { return g_LayerBlendTypesMap; }
-
- SEnumNameMap *SEnumParseMap<RenderRotationValues::Enum>::GetMap()
- {
- return g_RenderRotationValuesMap;
- }
-
- SEnumNameMap *SEnumParseMap<CameraScaleModes::Enum>::GetMap() { return g_CameraScaleModesMap; }
-
- SEnumNameMap *SEnumParseMap<CameraScaleAnchors::Enum>::GetMap()
- {
- return g_CameraScaleAnchorsMap;
- }
-
- SEnumNameMap *SEnumParseMap<HorizontalFieldValues::Enum>::GetMap()
- {
- return g_HorizontalFieldValuesMap;
- }
-
- SEnumNameMap *SEnumParseMap<VerticalFieldValues::Enum>::GetMap()
- {
- return g_VerticalFieldValuesMap;
- }
-
- SEnumNameMap *SEnumParseMap<LayerUnitTypes::Enum>::GetMap() { return g_LayerUnitTypesMap; }
-
- SEnumNameMap *SEnumParseMap<LayerBackground::Enum>::GetMap() { return g_LayerBackgroundMap; }
-
- SEnumNameMap *SEnumParseMap<DefaultMaterialSpecularModel::Enum>::GetMap()
- {
- return g_SpecularTypesMap;
- }
-
- SEnumNameMap *SEnumParseMap<TessModeValues::Enum>::GetMap() { return g_TessellationValuesMap; }
-
- SEnumNameMap *SEnumParseMap<PathCapping::Enum>::GetMap() { return g_PathCappingValuesMap; }
-
- SEnumNameMap *SEnumParseMap<PathTypes::Enum>::GetMap() { return g_PathTypesMap; }
-
- SEnumNameMap *SEnumParseMap<PathPaintStyles::Enum>::GetMap() { return g_PathPaintStylesMap; }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.h
deleted file mode 100644
index 16ce139d..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderUIPSharedTranslation.h
+++ /dev/null
@@ -1,485 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_UIP_SHARED_TRANSLATION_H
-#define QT3DS_RENDER_UIP_SHARED_TRANSLATION_H
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSRenderText.h"
-#include "Qt3DSDMWindowsCompatibility.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderPresentation.h"
-
-// map from qt3dsdm to qt3ds::render
-namespace qt3ds {
-namespace render {
-
- template <typename TEnumType>
- struct SEnumParseMap
- {
- };
-
- struct SEnumNameMap
- {
- QT3DSU32 m_Enum;
- const wchar_t *m_WideName;
- const char8_t *m_Name;
- };
-
- template <>
- struct SEnumParseMap<RenderLightTypes::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<DefaultMaterialLighting::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<DefaultMaterialBlendMode::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<ImageMappingModes::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<NVRenderTextureCoordOp::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<TextHorizontalAlignment::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<TextVerticalAlignment::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<TextWordWrap::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<TextElide::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<AAModeValues::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<LayerBlendTypes::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<RenderRotationValues::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<CameraScaleModes::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<CameraScaleAnchors::Enum>
- {
- static SEnumNameMap *GetMap();
- };
- template <>
- struct SEnumParseMap<HorizontalFieldValues::Enum>
- {
- static SEnumNameMap *GetMap();
- };
- template <>
- struct SEnumParseMap<VerticalFieldValues::Enum>
- {
- static SEnumNameMap *GetMap();
- };
- template <>
- struct SEnumParseMap<LayerUnitTypes::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<LayerBackground::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<DefaultMaterialSpecularModel::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<TessModeValues::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<PathCapping::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<PathTypes::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
- template <>
- struct SEnumParseMap<PathPaintStyles::Enum>
- {
- static SEnumNameMap *GetMap();
- };
-
-#define QT3DS_RENDER_WCHAR_T_XYZs L"XYZ"
-#define QT3DS_RENDER_WCHAR_T_YZXs L"YZX"
-#define QT3DS_RENDER_WCHAR_T_ZXYs L"ZXY"
-#define QT3DS_RENDER_WCHAR_T_XZYs L"XZY"
-#define QT3DS_RENDER_WCHAR_T_YXZs L"YXZ"
-#define QT3DS_RENDER_WCHAR_T_ZYXs L"ZYX"
-
-#define QT3DS_RENDER_WCHAR_T_XYZr L"XYZr"
-#define QT3DS_RENDER_WCHAR_T_YZXr L"YZXr"
-#define QT3DS_RENDER_WCHAR_T_ZXYr L"ZXYr"
-#define QT3DS_RENDER_WCHAR_T_XZYr L"XZYr"
-#define QT3DS_RENDER_WCHAR_T_YXZr L"YXZr"
-#define QT3DS_RENDER_WCHAR_T_ZYXr L"ZYXr"
-
-#define QT3DS_RENDER_CHAR_T_XYZs "XYZ"
-#define QT3DS_RENDER_CHAR_T_YZXs "YZX"
-#define QT3DS_RENDER_CHAR_T_ZXYs "ZXY"
-#define QT3DS_RENDER_CHAR_T_XZYs "XZY"
-#define QT3DS_RENDER_CHAR_T_YXZs "YXZ"
-#define QT3DS_RENDER_CHAR_T_ZYXs "ZYX"
-
-#define QT3DS_RENDER_CHAR_T_XYZr "XYZr"
-#define QT3DS_RENDER_CHAR_T_YZXr "YZXr"
-#define QT3DS_RENDER_CHAR_T_ZXYr "ZXYr"
-#define QT3DS_RENDER_CHAR_T_XZYr "XZYr"
-#define QT3DS_RENDER_CHAR_T_YXZr "YXZr"
-#define QT3DS_RENDER_CHAR_T_ZYXr "ZYXr"
-
- inline QT3DSU32 MapRotationOrder(const wchar_t *inOrderStr)
- {
-#define MAP_ROTATION_ORDER(name, postfix) \
- if (wcscmp(inOrderStr, QT3DS_RENDER_WCHAR_T_##name##postfix) == 0) { \
- return EulOrd##name##postfix; \
- }
- MAP_ROTATION_ORDER(XYZ, s);
- MAP_ROTATION_ORDER(YZX, s);
- MAP_ROTATION_ORDER(ZXY, s);
- MAP_ROTATION_ORDER(XZY, s);
- MAP_ROTATION_ORDER(YXZ, s);
- MAP_ROTATION_ORDER(ZYX, s);
- MAP_ROTATION_ORDER(XYZ, r);
- MAP_ROTATION_ORDER(YZX, r);
- MAP_ROTATION_ORDER(ZXY, r);
- MAP_ROTATION_ORDER(XZY, r);
- MAP_ROTATION_ORDER(YXZ, r);
- MAP_ROTATION_ORDER(ZYX, r);
-#undef MAP_ROTATION_ORDER
- return EulOrdYXZs;
- }
-
- inline QT3DSU32 MapRotationOrder(const char8_t *inOrderStr)
- {
-#define MAP_ROTATION_ORDER(name, postfix) \
- if (strcmp(inOrderStr, QT3DS_RENDER_CHAR_T_##name##postfix) == 0) { \
- return EulOrd##name##postfix; \
- }
- MAP_ROTATION_ORDER(XYZ, s);
- MAP_ROTATION_ORDER(YZX, s);
- MAP_ROTATION_ORDER(ZXY, s);
- MAP_ROTATION_ORDER(XZY, s);
- MAP_ROTATION_ORDER(YXZ, s);
- MAP_ROTATION_ORDER(ZYX, s);
- MAP_ROTATION_ORDER(XYZ, r);
- MAP_ROTATION_ORDER(YZX, r);
- MAP_ROTATION_ORDER(ZXY, r);
- MAP_ROTATION_ORDER(XZY, r);
- MAP_ROTATION_ORDER(YXZ, r);
- MAP_ROTATION_ORDER(ZYX, r);
-#undef MAP_ROTATION_ORDER
- return EulOrdYXZs;
- }
-
- // the goal is to unify the systems that transfer information into the UICRender library.
- // There are currently three such systems; the runtime, studio, and the uip loader that loads
- // uip files
- // directly into the render library.
- // To do this, we need to have a mapping between a generic key and a given property on every
- // object
- // along with some information about what portion of the object model this property affects.
-
- struct Qt3DSRenderDirtyFlags
- {
- enum Enum {
- Unknown = 0,
- Dirty = 1 << 0,
- TransformDirty = 1 << 1,
- TextDirty = 1 << 2,
- };
- };
-
-// Now we build out generic macros with no implementation that list all of the properties
-// on each struct that we care about. We will fill in these macros with implementation later.
-// Each macro will list the property name along with what dirty operation should get marked
-// Global parse tables that list every property used by the system.
-
-#define ITERATE_QT3DS_RENDER_SCENE_PROPERTIES \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Scene, ClearColor, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Scene, UseClearColor, Dirty)
-
-#define ITERATE_QT3DS_RENDER_NODE_PROPERTIES \
- HANDLE_QT3DS_RENDER_TRANSFORM_VEC3_PROPERTY(Node, Rotation, TransformDirty) \
- HANDLE_QT3DS_RENDER_VEC3_RADIAN_PROPERTY(Node, Rotation, TransformDirty) \
- HANDLE_QT3DS_RENDER_TRANSFORM_VEC3_PROPERTY(Node, Position, TransformDirty) \
- HANDLE_QT3DS_RENDER_VEC3_PROPERTY(Node, Position, TransformDirty) \
- HANDLE_QT3DS_RENDER_TRANSFORM_VEC3_PROPERTY(Node, Scale, TransformDirty) \
- HANDLE_QT3DS_RENDER_VEC3_PROPERTY(Node, Scale, TransformDirty) \
- HANDLE_QT3DS_RENDER_TRANSFORM_VEC3_PROPERTY(Node, Pivot, TransformDirty) \
- HANDLE_QT3DS_RENDER_VEC3_PROPERTY(Node, Pivot, TransformDirty) \
- HANDLE_QT3DS_RENDER_OPACITY_PROPERTY(Node, LocalOpacity, TransformDirty) \
- HANDLE_QT3DS_ROTATION_ORDER_PROPERTY(Node, RotationOrder, TransformDirty) \
- HANDLE_QT3DS_NODE_ORIENTATION_PROPERTY(Node, LeftHanded, TransformDirty)
-
-#define ITERATE_QT3DS_RENDER_LAYER_PROPERTIES \
- HANDLE_QT3DS_NODE_FLAGS_INVERSE_PROPERTY(Layer, LayerEnableDepthTest, Dirty) \
- HANDLE_QT3DS_NODE_FLAGS_INVERSE_PROPERTY(Layer, LayerEnableDepthPrePass, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, ProgressiveAAMode, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, MultisampleAAMode, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, TemporalAAEnabled, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Layer, ClearColor, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, BlendType, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, Background, Dirty) \
- HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY(Layer, TexturePath, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, HorizontalFieldValues, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Left, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, LeftUnits, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Width, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, WidthUnits, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Right, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, RightUnits, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, VerticalFieldValues, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Top, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, TopUnits, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Height, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, HeightUnits, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Bottom, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Layer, BottomUnits, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, AoStrength, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, AoDistance, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, AoSoftness, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, AoBias, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, AoDither, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ShadowStrength, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ShadowDist, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ShadowSoftness, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ShadowBias, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, LightProbe, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ProbeBright, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, FastIbl, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ProbeHorizon, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, ProbeFov, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, LightProbe2, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Probe2Fade, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Probe2Window, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Layer, Probe2Pos, Dirty)
-
-#define ITERATE_QT3DS_RENDER_CAMERA_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(Camera, ClipNear, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Camera, ClipFar, Dirty) \
- HANDLE_QT3DS_RENDER_RADIAN_PROPERTY(Camera, FOV, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Camera, FOVHorizontal, Dirty) \
- HANDLE_QT3DS_NODE_FLAGS_PROPERTY(Camera, Orthographic, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Camera, ScaleMode, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Camera, ScaleAnchor, Dirty)
-
-#define ITERATE_QT3DS_RENDER_LIGHT_PROPERTIES \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Light, LightType, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, Scope, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Light, DiffuseColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Light, DiffuseColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Light, SpecularColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Light, SpecularColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Light, AmbientColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Light, AmbientColor, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, Brightness, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, LinearFade, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, ExponentialFade, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, AreaWidth, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, AreaHeight, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, CastShadow, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, ShadowBias, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, ShadowFactor, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, ShadowMapFar, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, ShadowMapFov, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Light, ShadowFilter, Dirty)
-
-#define ITERATE_QT3DS_RENDER_MODEL_PROPERTIES \
- HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY(Model, MeshPath, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Model, ShadowCaster, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Model, TessellationMode, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Model, EdgeTess, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Model, InnerTess, Dirty)
-
-#define ITERATE_QT3DS_RENDER_CUSTOM_MATERIAL_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(MaterialBase, IblProbe, Dirty)
-
-#define ITERATE_QT3DS_RENDER_LIGHTMAP_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(Lightmaps, LightmapIndirect, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Lightmaps, LightmapRadiosity, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Lightmaps, LightmapShadow, Dirty)
-
-#define ITERATE_QT3DS_RENDER_MATERIAL_PROPERTIES \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Material, Lighting, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Material, BlendMode, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, VertexColors, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(MaterialBase, IblProbe, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Material, DiffuseColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Material, DiffuseColor, Dirty) \
- HANDLE_QT3DS_RENDER_ARRAY_PROPERTY(Material, DiffuseMaps, 0, Dirty) \
- HANDLE_QT3DS_RENDER_ARRAY_PROPERTY(Material, DiffuseMaps, 1, Dirty) \
- HANDLE_QT3DS_RENDER_ARRAY_PROPERTY(Material, DiffuseMaps, 2, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, EmissivePower, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Material, EmissiveColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Material, EmissiveColor, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, EmissiveMap, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, EmissiveMap2, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, SpecularReflection, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, SpecularMap, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Material, SpecularModel, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Material, SpecularTint, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Material, SpecularTint, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, FresnelPower, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, IOR, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, SpecularAmount, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, SpecularRoughness, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, RoughnessMap, Dirty) \
- HANDLE_QT3DS_RENDER_OPACITY_PROPERTY(Material, Opacity, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, OpacityMap, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, BumpMap, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, BumpAmount, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, NormalMap, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, DisplacementMap, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, DisplaceAmount, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, TranslucencyMap, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, TranslucentFalloff, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, DiffuseLightWrap, Dirty)
-
-#define ITERATE_QT3DS_RENDER_REFERENCED_MATERIAL_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(Material, ReferencedMaterial, Dirty)
-
-#define ITERATE_QT3DS_RENDER_IMAGE_PROPERTIES \
- HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY(Image, ImagePath, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Image, OffscreenRendererId, Dirty) \
- HANDLE_QT3DS_RENDER_VEC2_PROPERTY(Image, Scale, TransformDirty) \
- HANDLE_QT3DS_RENDER_VEC2_PROPERTY(Image, Pivot, TransformDirty) \
- HANDLE_QT3DS_RENDER_RADIAN_PROPERTY(Image, Rotation, TransformDirty) \
- HANDLE_QT3DS_RENDER_VEC2_PROPERTY(Image, Position, TransformDirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Image, MappingMode, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Image, HorizontalTilingMode, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Image, VerticalTilingMode, Dirty)
-
-#define ITERATE_QT3DS_RENDER_TEXT_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, Text, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, Font, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, FontSize, TextDirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Text, HorizontalAlignment, TextDirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Text, VerticalAlignment, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, Leading, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, Tracking, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, DropShadow, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, DropShadowStrength, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, DropShadowOffsetX, TextDirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, DropShadowOffsetY, TextDirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Text, WordWrap, TextDirty) \
- HANDLE_QT3DS_RENDER_REAL_VEC2_PROPERTY(Text, BoundingBox, TextDirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Text, Elide, TextDirty) \
- HANDLE_QT3DS_RENDER_COLOR_VEC3_PROPERTY(Text, TextColor, Dirty) \
- HANDLE_QT3DS_RENDER_COLOR_PROPERTY(Text, TextColor, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Text, EnableAcceleratedFont, Dirty)
-
-#define ITERATE_QT3DS_RENDER_PATH_PROPERTIES \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Path, PathType, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, Width, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, LinearError, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, EdgeTessAmount, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, InnerTessAmount, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Path, BeginCapping, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, BeginCapOffset, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, BeginCapOpacity, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, BeginCapWidth, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Path, EndCapping, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, EndCapOffset, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, EndCapOpacity, Dirty) \
- HANDLE_QT3DS_RENDER_PROPERTY(Path, EndCapWidth, Dirty) \
- HANDLE_QT3DS_RENDER_ENUM_PROPERTY(Path, PaintStyle, Dirty) \
- HANDLE_QT3DS_RENDER_SOURCEPATH_PROPERTY(Path, PathBuffer, Dirty)
-
-#define ITERATE_QT3DS_RENDER_PATH_SUBPATH_PROPERTIES \
- HANDLE_QT3DS_RENDER_PROPERTY(SubPath, Closed, Dirty)
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.cpp
deleted file mode 100644
index 311b2189..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.cpp
+++ /dev/null
@@ -1,319 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderWidgets.h"
-#include "Qt3DSRenderNode.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct SWidgetBBox : public IRenderWidget
-{
- NVBounds3 m_Bounds;
- QT3DSVec3 m_Color;
- NVRenderVertexBuffer *m_BoxVertexBuffer;
- NVRenderIndexBuffer *m_BoxIndexBuffer;
- NVRenderInputAssembler *m_BoxInputAssembler;
- NVRenderShaderProgram *m_BoxShader;
- CRegisteredString m_ItemName;
- SWidgetBBox(SNode &inNode, const NVBounds3 &inBounds, const QT3DSVec3 &inColor)
- : IRenderWidget(inNode)
- , m_Bounds(inBounds)
- , m_Color(inColor)
- , m_BoxVertexBuffer(NULL)
- , m_BoxIndexBuffer(NULL)
- , m_BoxInputAssembler(NULL)
- , m_BoxShader(NULL)
- {
- }
-
- void SetupBoxShader(IRenderWidgetContext &inContext)
- {
- m_BoxShader = inContext.GetShader(m_ItemName);
- if (!m_BoxShader) {
- qt3ds::render::IShaderProgramGenerator &theGenerator(inContext.GetProgramGenerator());
- theGenerator.BeginProgram();
- qt3ds::render::IShaderStageGenerator &theVertexGenerator(
- *theGenerator.GetStage(qt3ds::render::ShaderGeneratorStages::Vertex));
- qt3ds::render::IShaderStageGenerator &theFragmentGenerator(
- *theGenerator.GetStage(qt3ds::render::ShaderGeneratorStages::Fragment));
-
- theVertexGenerator.AddIncoming("attr_pos", "vec3");
- theVertexGenerator.AddUniform("model_view_projection", "mat4");
- theVertexGenerator.Append("void main() {");
- theVertexGenerator.Append(
- "\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- theVertexGenerator.Append("}");
- theFragmentGenerator.AddUniform("output_color", "vec3");
- theFragmentGenerator.Append("void main() {");
- theFragmentGenerator.Append("\tgl_FragColor.rgb = output_color;");
- theFragmentGenerator.Append("\tgl_FragColor.a = 1.0;");
- theFragmentGenerator.Append("}");
- m_BoxShader = inContext.CompileAndStoreShader(m_ItemName);
- }
- }
-
- void SetupBoundingBoxGraphicsObjects(IRenderWidgetContext &inContext,
- NVDataRef<QT3DSVec3> thePoints)
- {
- qt3ds::render::NVRenderVertexBufferEntry theEntry(
- "attr_pos", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3);
- m_BoxVertexBuffer = &inContext.GetOrCreateVertexBuffer(
- m_ItemName, 3 * sizeof(QT3DSF32), toU8DataRef(thePoints.begin(), thePoints.size()));
- m_BoxIndexBuffer = inContext.GetIndexBuffer(m_ItemName);
- if (!m_BoxIndexBuffer) {
- // The way the bounds lays out the bounds for the box
- // capitalization indicates whether this was a max or min value.
- enum _Indexes {
- xyz = 0,
- Xyz,
- xYz,
- xyZ,
- XYZ,
- xYZ,
- XyZ,
- XYz,
- };
- QT3DSU8 indexes[] = {
- // The toBoxBounds function lays out points such that
- // xyz, Xyz, xYz, xyZ, XYZ, xYZ, XyZ, XYz
- // Min corner
- xyz, Xyz, xyz, xYz, xyz, xyZ,
-
- // Max corner
- XYZ, xYZ, XYZ, XyZ, XYZ, XYz,
-
- // Now connect the rest of the dots.
- // the rules are that only one letter can change
- // else you are connecting *across* the box somehow.
-
- Xyz, XYz, Xyz, XyZ,
-
- xYz, XYz, xYz, xYZ,
-
- xyZ, XyZ, xyZ, xYZ,
- };
- m_BoxIndexBuffer = &inContext.GetOrCreateIndexBuffer(
- m_ItemName, qt3ds::render::NVRenderComponentTypes::QT3DSU8, sizeof(indexes),
- toU8DataRef(indexes, sizeof(indexes)));
- }
-
- m_BoxInputAssembler = inContext.GetInputAssembler(m_ItemName);
- if (!m_BoxInputAssembler && m_BoxIndexBuffer && m_BoxVertexBuffer) {
- // create our attribute layout
- NVRenderAttribLayout *theAttribLAyout =
- &inContext.CreateAttributeLayout(toConstDataRef(&theEntry, 1));
-
- QT3DSU32 strides = m_BoxVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_BoxInputAssembler = &inContext.GetOrCreateInputAssembler(
- m_ItemName, theAttribLAyout, toConstDataRef(&m_BoxVertexBuffer, 1),
- m_BoxIndexBuffer, toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
- SetupBoxShader(inContext);
- }
-
- void Render(IRenderWidgetContext &inWidgetContext, NVRenderContext &inRenderContext) override
- {
- m_ItemName = inRenderContext.GetStringTable().RegisterStr("SWidgetBBox");
- SWidgetRenderInformation theInfo(inWidgetContext.GetWidgetRenderInformation(
- *m_Node, m_Node->m_Position, RenderWidgetModes::Local));
- TNVBounds2BoxPoints thePoints;
- m_Bounds.expand(thePoints);
- QT3DSMat44 theNodeRotation;
- QT3DSMat44 theNodeToCamera = theInfo.m_NodeParentToCamera * m_Node->m_LocalTransform;
- for (QT3DSU32 idx = 0; idx < 8; ++idx)
- thePoints[idx] = theNodeToCamera.transform(thePoints[idx]);
- SetupBoundingBoxGraphicsObjects(inWidgetContext, toDataRef(thePoints, 8));
- if (m_BoxShader && m_BoxInputAssembler) {
- inRenderContext.SetBlendingEnabled(false);
- inRenderContext.SetDepthWriteEnabled(true);
- inRenderContext.SetDepthTestEnabled(true);
- inRenderContext.SetCullingEnabled(false);
- inRenderContext.SetActiveShader(m_BoxShader);
- m_BoxShader->SetPropertyValue("model_view_projection", theInfo.m_LayerProjection);
- m_BoxShader->SetPropertyValue("output_color", m_Color);
- inRenderContext.SetInputAssembler(m_BoxInputAssembler);
- inRenderContext.Draw(qt3ds::render::NVRenderDrawMode::Lines,
- m_BoxInputAssembler->GetIndexCount(), 0);
- }
- }
-};
-
-struct SWidgetAxis : public IRenderWidget
-{
- NVRenderVertexBuffer *m_AxisVertexBuffer;
- NVRenderInputAssembler *m_AxisInputAssembler;
- NVRenderShaderProgram *m_AxisShader;
- CRegisteredString m_ItemName;
-
- SWidgetAxis(SNode &inNode)
- : IRenderWidget(inNode)
- , m_AxisVertexBuffer(NULL)
- , m_AxisInputAssembler(NULL)
- , m_AxisShader(NULL)
- {
- }
-
- void SetupAxisShader(IRenderWidgetContext &inContext)
- {
- m_AxisShader = inContext.GetShader(m_ItemName);
- if (!m_AxisShader) {
- qt3ds::render::IShaderProgramGenerator &theGenerator(inContext.GetProgramGenerator());
- theGenerator.BeginProgram();
- qt3ds::render::IShaderStageGenerator &theVertexGenerator(
- *theGenerator.GetStage(qt3ds::render::ShaderGeneratorStages::Vertex));
- qt3ds::render::IShaderStageGenerator &theFragmentGenerator(
- *theGenerator.GetStage(qt3ds::render::ShaderGeneratorStages::Fragment));
- theVertexGenerator.AddIncoming("attr_pos", "vec3");
- theVertexGenerator.AddIncoming("attr_color", "vec3");
- theVertexGenerator.AddOutgoing("output_color", "vec3");
- theVertexGenerator.AddUniform("model_view_projection", "mat4");
- theVertexGenerator.Append("void main() {");
- theVertexGenerator.Append(
- "\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- theVertexGenerator.Append("\toutput_color = attr_color;");
- theVertexGenerator.Append("}");
- theFragmentGenerator.Append("void main() {");
- theFragmentGenerator.Append("\tgl_FragColor.rgb = output_color;");
- theFragmentGenerator.Append("\tgl_FragColor.a = 1.0;");
- theFragmentGenerator.Append("}");
- m_AxisShader = inContext.CompileAndStoreShader(m_ItemName);
- }
- }
-
- void SetupAxesGraphicsObjects(IRenderWidgetContext &inContext, NVDataRef<QT3DSVec3> theAxes)
- {
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- qt3ds::render::NVRenderVertexBufferEntry("attr_color",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3, 12),
- };
-
- m_AxisVertexBuffer = &inContext.GetOrCreateVertexBuffer(
- m_ItemName, 6 * sizeof(QT3DSF32), toU8DataRef(theAxes.begin(), theAxes.size()));
- m_AxisInputAssembler = inContext.GetInputAssembler(m_ItemName);
- if (!m_AxisInputAssembler && m_AxisVertexBuffer) {
- // create our attribute layout
- NVRenderAttribLayout *theAttribLAyout =
- &inContext.CreateAttributeLayout(toConstDataRef(theEntries, 2));
-
- QT3DSU32 strides = m_AxisVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_AxisInputAssembler = &inContext.GetOrCreateInputAssembler(
- m_ItemName, theAttribLAyout, toConstDataRef(&m_AxisVertexBuffer, 1), nullptr,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
- }
-
- inline QT3DSVec3 TransformDirection(const QT3DSMat33 &inMatrix, const QT3DSVec3 &inDir)
- {
- QT3DSVec3 retval = inMatrix.transform(inDir);
- return retval;
- }
-
- void Render(IRenderWidgetContext &inWidgetContext, NVRenderContext &inRenderContext) override
- {
- m_ItemName = inRenderContext.GetStringTable().RegisterStr("SWidgetAxis");
-
- SetupAxisShader(inWidgetContext);
-
- if (m_AxisShader) {
- static const QT3DSVec3 pivotCol = QT3DSVec3(0, 0, 1);
- if (m_Node->m_Parent && m_Node->m_Parent->m_Type != GraphObjectTypes::Layer) {
- m_Node->m_Parent->CalculateGlobalVariables();
- }
- QT3DSVec3 thePivot(m_Node->m_Pivot);
- if (m_Node->m_Flags.IsLeftHanded())
- thePivot.z *= -1;
-
- SWidgetRenderInformation theInfo(inWidgetContext.GetWidgetRenderInformation(
- *m_Node, QT3DSVec3(0, 0, 0), RenderWidgetModes::Local));
-
- QT3DSMat44 theNodeRotation;
- m_Node->CalculateRotationMatrix(theNodeRotation);
- if (m_Node->m_Flags.IsLeftHanded())
- SNode::FlipCoordinateSystem(theNodeRotation);
-
- QT3DSMat33 theRotationMatrix(theNodeRotation.column0.getXYZ(),
- theNodeRotation.column1.getXYZ(),
- theNodeRotation.column2.getXYZ());
-
- // Move the camera position into camera space. This is so that when we render we don't
- // have to account
- // for scaling done in the camera's MVP.
- QT3DSVec3 theItemPosition = theInfo.m_Position;
-
- QT3DSMat33 theAxisTransform = theInfo.m_NormalMatrix * theRotationMatrix;
-
- // Scale the effective pivot line end point according to node scale
- // so that pivot line always hits object center.
- thePivot = thePivot.multiply(m_Node->m_Scale);
- QT3DSVec3 pivotVec = TransformDirection(
- theAxisTransform, QT3DSVec3(-thePivot.x, -thePivot.y, -thePivot.z));
-
- QT3DSVec3 thePivotLine[] = {
- theItemPosition, pivotCol, theItemPosition + pivotVec, pivotCol
- };
-
- SetupAxesGraphicsObjects(inWidgetContext, toDataRef(thePivotLine, 4));
-
- if (m_AxisInputAssembler) {
- inRenderContext.SetBlendingEnabled(false);
- inRenderContext.SetDepthWriteEnabled(false);
- inRenderContext.SetDepthTestEnabled(false);
- inRenderContext.SetCullingEnabled(false);
- inRenderContext.SetActiveShader(m_AxisShader);
- m_AxisShader->SetPropertyValue("model_view_projection", theInfo.m_LayerProjection);
- inRenderContext.SetInputAssembler(m_AxisInputAssembler);
- // Draw line from pivot to object center.
- inRenderContext.Draw(qt3ds::render::NVRenderDrawMode::Lines, 2, 0);
- }
- }
- }
-};
-}
-
-IRenderWidget &IRenderWidget::CreateBoundingBoxWidget(SNode &inNode, const NVBounds3 &inBounds,
- const QT3DSVec3 &inColor,
- NVAllocatorCallback &inAlloc)
-{
- return *QT3DS_NEW(inAlloc, SWidgetBBox)(inNode, inBounds, inColor);
-}
-
-IRenderWidget &IRenderWidget::CreateAxisWidget(SNode &inNode, NVAllocatorCallback &inAlloc)
-{
- return *QT3DS_NEW(inAlloc, SWidgetAxis)(inNode);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.h
deleted file mode 100644
index 28cb3322..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderWidgets.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_WIDGETS_H
-#define QT3DS_RENDER_WIDGETS_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/Qt3DSMat44.h"
-#include "foundation/Qt3DSMat33.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "foundation/Qt3DSVec3.h"
-#include "EASTL/utility.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "render/Qt3DSRenderVertexBuffer.h"
-#include "render/Qt3DSRenderIndexBuffer.h"
-#include "Qt3DSRenderText.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SWidgetRenderInformation
- {
- // Just the rotation component of the nodeparenttocamera.
- QT3DSMat33 m_NormalMatrix;
- // The node parent's global transform multiplied by the inverse camera global transfrom;
- // basically the MV from model-view-projection
- QT3DSMat44 m_NodeParentToCamera;
- // Projection that accounts for layer scaling
- QT3DSMat44 m_LayerProjection;
- // Pure camera projection without layer scaling
- QT3DSMat44 m_PureProjection;
- // A look at matrix that will rotate objects facing directly up
- // the Z axis such that the point to the camera.
- QT3DSMat33 m_LookAtMatrix;
- // Conversion from world to camera position so world points not in object
- // local space can be converted to camera space without going through the node's
- // inverse global transform
- QT3DSMat44 m_CameraGlobalInverse;
- // Offset to add to the node's world position in camera space to move to the ideal camera
- // location so that scale will work. This offset should be added *after* translation into
- // camera space
- QT3DSVec3 m_WorldPosOffset;
- // Position in camera space to center the widget around
- QT3DSVec3 m_Position;
- // Scale factor to scale the widget by.
- QT3DSF32 m_Scale;
-
- // The camera used to render this object.
- SCamera *m_Camera;
- SWidgetRenderInformation(const QT3DSMat33 &inNormal, const QT3DSMat44 &inNodeParentToCamera,
- const QT3DSMat44 &inLayerProjection, const QT3DSMat44 &inProjection,
- const QT3DSMat33 &inLookAt, const QT3DSMat44 &inCameraGlobalInverse,
- const QT3DSVec3 &inWorldPosOffset, const QT3DSVec3 &inPos, QT3DSF32 inScale,
- SCamera &inCamera)
- : m_NormalMatrix(inNormal)
- , m_NodeParentToCamera(inNodeParentToCamera)
- , m_LayerProjection(inLayerProjection)
- , m_PureProjection(inProjection)
- , m_LookAtMatrix(inLookAt)
- , m_CameraGlobalInverse(inCameraGlobalInverse)
- , m_WorldPosOffset(inWorldPosOffset)
- , m_Position(inPos)
- , m_Scale(inScale)
- , m_Camera(&inCamera)
- {
- }
- SWidgetRenderInformation()
- : m_Camera(NULL)
- {
- }
- };
- typedef eastl::pair<SShaderVertexCodeGenerator &, SShaderFragmentCodeGenerator &>
- TShaderGeneratorPair;
-
- struct RenderWidgetModes
- {
- enum Enum {
- Local,
- Global,
- };
- };
- // Context used to get render data for the widget.
- class IRenderWidgetContext
- {
- protected:
- virtual ~IRenderWidgetContext() {}
- public:
- virtual NVRenderVertexBuffer &
- GetOrCreateVertexBuffer(CRegisteredString &inStr, QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> bufferData = NVConstDataRef<QT3DSU8>()) = 0;
- virtual NVRenderIndexBuffer &
- GetOrCreateIndexBuffer(CRegisteredString &inStr,
- qt3ds::render::NVRenderComponentTypes::Enum componentType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData = NVConstDataRef<QT3DSU8>()) = 0;
- virtual NVRenderAttribLayout &
- CreateAttributeLayout(NVConstDataRef<qt3ds::render::NVRenderVertexBufferEntry> attribs) = 0;
- virtual NVRenderInputAssembler &
- GetOrCreateInputAssembler(CRegisteredString &inStr, NVRenderAttribLayout *attribLayout,
- NVConstDataRef<NVRenderVertexBuffer *> buffers,
- const NVRenderIndexBuffer *indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets) = 0;
-
- virtual NVRenderVertexBuffer *GetVertexBuffer(CRegisteredString &inStr) = 0;
- virtual NVRenderIndexBuffer *GetIndexBuffer(CRegisteredString &inStr) = 0;
- virtual NVRenderInputAssembler *GetInputAssembler(CRegisteredString &inStr) = 0;
-
- virtual NVRenderShaderProgram *GetShader(CRegisteredString inStr) = 0;
- virtual IShaderProgramGenerator &GetProgramGenerator() = 0;
- // calls compile on the program generator and stores result under this name.
- virtual NVRenderShaderProgram *CompileAndStoreShader(CRegisteredString inStr) = 0;
- virtual STextDimensions MeasureText(const STextRenderInfo &inText) = 0;
- // Render text using a specific MVP
- virtual void RenderText(const STextRenderInfo &inText, const QT3DSVec3 &inTextColor,
- const QT3DSVec3 &inBackgroundColor, const QT3DSMat44 &inMVP) = 0;
- // Given a node and a point in the node's local space (most likely its pivot point), we
- // return
- // a normal matrix so you can get the axis out, a transformation from node to camera
- // a new position and a floating point scale factor so you can render in 1/2 perspective
- // mode
- // or orthographic mode if you would like to.
- virtual SWidgetRenderInformation
- GetWidgetRenderInformation(SNode &inNode, const QT3DSVec3 &inPos,
- RenderWidgetModes::Enum inWidgetMode) = 0;
- };
-
- class IRenderWidget
- {
- protected:
- virtual ~IRenderWidget() {}
- SNode *m_Node;
-
- public:
- IRenderWidget(SNode &inNode)
- : m_Node(&inNode)
- {
- }
- IRenderWidget()
- : m_Node(NULL)
- {
- }
- virtual void Render(IRenderWidgetContext &inWidgetContext,
- NVRenderContext &inRenderContext) = 0;
- SNode &GetNode() { return *m_Node; }
-
- // Pure widgets.
- static IRenderWidget &CreateBoundingBoxWidget(SNode &inNode, const NVBounds3 &inBounds,
- const QT3DSVec3 &inColor,
- NVAllocatorCallback &inAlloc);
- static IRenderWidget &CreateAxisWidget(SNode &inNode, NVAllocatorCallback &inAlloc);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderableImage.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderableImage.h
deleted file mode 100644
index 5d4aa1c4..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderableImage.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDERABLE_IMAGE_H
-#define QT3DS_RENDERABLE_IMAGE_H
-#include "Qt3DSRender.h"
-
-namespace qt3ds {
-namespace render {
-
- struct ImageMapTypes
- {
- enum Enum {
- Unknown = 0,
- Diffuse = 1,
- Opacity = 2,
- Specular = 3,
- Emissive = 4,
- Bump = 5,
- SpecularAmountMap = 6,
- Normal = 7,
- Displacement = 8,
- Translucency = 9,
- LightmapIndirect = 10,
- LightmapRadiosity = 11,
- LightmapShadow = 12,
- Roughness = 13,
- };
- };
-
- /**
- * Some precomputed information on a given image. When generating a renderable, the shader
- * generator goes through all the possible images on a material and for each valid image
- * computes this renderable image and attaches it to the renderable.
- */
- struct SRenderableImage
- {
- ImageMapTypes::Enum m_MapType;
- SImage &m_Image;
- SRenderableImage *m_NextImage;
- SRenderableImage(ImageMapTypes::Enum inMapType, SImage &inImage)
- : m_MapType(inMapType)
- , m_Image(inImage)
- , m_NextImage(NULL)
- {
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderer.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderer.h
deleted file mode 100644
index db3eee83..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRenderer.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDERER_H
-#define QT3DS_RENDERER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSFlags.h"
-#include "EASTL/algorithm.h" //pair
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSVec2.h"
-#include "Qt3DSRenderGraphObjectPickQuery.h"
-#include "Qt3DSRenderCamera.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "Qt3DSRenderRay.h"
-
-namespace qt3ds {
-namespace render {
-
- class IRenderableObject;
- struct SModel;
- struct SText;
- struct SCamera;
- struct SLight;
- struct SLayer;
- class IBufferManager;
- typedef void *SRenderInstanceId;
-
- using qt3ds::foundation::NVConstDataRef;
-
- class IQt3DSRenderNodeFilter
- {
- protected:
- virtual ~IQt3DSRenderNodeFilter() {}
- public:
- virtual bool IncludeNode(const SNode &inNode) = 0;
- };
- struct SLayerPickSetup
- {
- QT3DSMat44 m_ProjectionPreMultiply;
- QT3DSMat44 m_ViewProjection;
- NVRenderRect m_ScissorRect;
- SLayerPickSetup(const QT3DSMat44 &inProjPreMult, const QT3DSMat44 &inVP,
- const NVRenderRect &inScissor)
- : m_ProjectionPreMultiply(inProjPreMult)
- , m_ViewProjection(inVP)
- , m_ScissorRect(inScissor)
- {
- }
- SLayerPickSetup() {}
- };
-
- struct SScaleAndPosition
- {
- QT3DSVec3 m_Position;
- QT3DSF32 m_Scale;
- SScaleAndPosition(const QT3DSVec3 &inPos, QT3DSF32 inScale)
- : m_Position(inPos)
- , m_Scale(inScale)
- {
- }
- SScaleAndPosition() {}
- };
-
- class IQt3DSRenderer : public NVRefCounted
- {
- protected:
- virtual ~IQt3DSRenderer() {}
-
- public:
- virtual void EnableLayerCaching(bool inEnabled) = 0;
- virtual bool IsLayerCachingEnabled() const = 0;
- virtual void EnableLayerGpuProfiling(bool inEnabled) = 0;
- virtual bool IsLayerGpuProfilingEnabled() const = 0;
-
- // Get the camera that rendered this node last render
- virtual SCamera *GetCameraForNode(const SNode &inNode) const = 0;
- virtual Option<SCuboidRect> GetCameraBounds(const SGraphObject &inObject) = 0;
- // Called when you have changed the number or order of children of a given node.
- virtual void ChildrenUpdated(SNode &inParent) = 0;
- virtual QT3DSF32 GetTextScale(const SText &inText) = 0;
-
- // The IQt3DSRenderContext calls these, clients should not.
- virtual void BeginFrame() = 0;
- virtual void EndFrame() = 0;
-
- // Setup the vertex and index buffers (but not shader state)
- // and render the quad. The quad is setup so that its edges
- // go from -1,1 in x,y and its UV coordinates will map naturally
- // to an image.
- virtual void RenderQuad() = 0;
-
- // Render a given texture to the scene using a given transform.
- virtual void RenderQuad(const QT3DSVec2 inDimensions, const QT3DSMat44 &inMVP,
- NVRenderTexture2D &inQuadTexture) = 0;
-
- // This point rendering works uisng indirect array drawing
- // This means you need to setup a GPU buffer
- // which contains the drawing information
- virtual void RenderPointsIndirect() = 0;
-
- // Returns true if this layer or a sibling was dirty.
- virtual bool PrepareLayerForRender(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- bool inRenderSiblings = true,
- const SRenderInstanceId id = nullptr) = 0;
- virtual void RenderLayer(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions, bool clear,
- QT3DSVec4 clearColor, bool inRenderSiblings = true,
- const SRenderInstanceId id = nullptr) = 0;
-
- // Studio option to disable picking against sub renderers. This allows better interaction
- // in studio.
- // In pick siblings measn pick the layer siblings; this is the normal behavior.
- // InPickEverything means ignore the node's pick flags; this allows us to only pick things
- // that have handlers
- // in some cases and just pick everything in other things.
- virtual void PickRenderPlugins(bool inPick) = 0;
- virtual Qt3DSRenderPickResult Pick(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords, bool inPickSiblings = true,
- bool inPickEverything = false,
- const SRenderInstanceId id = nullptr) = 0;
-
- // Return the relative hit position, in UV space, of a mouse pick against this object.
- // We need the node in order to figure out which layer rendered this object.
- // We need mapper objects if this is a in a subpresentation because we have to know how
- // to map the mouse coordinates into the subpresentation. So for instance if inNode is in
- // a subpres then we need to know which image is displaying the subpres in order to map
- // the mouse coordinates into the subpres's render space.
- virtual Option<QT3DSVec2> FacePosition(SNode &inNode, NVBounds3 inBounds,
- const QT3DSMat44 &inGlobalTransform,
- const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords,
- NVDataRef<SGraphObject *> inMapperObjects,
- SBasisPlanes::Enum inIsectPlane) = 0;
-
- virtual QT3DSVec3 UnprojectToPosition(SNode &inNode, QT3DSVec3 &inPosition,
- const QT3DSVec2 &inMouseVec) const = 0;
- virtual QT3DSVec3 UnprojectWithDepth(SNode &inNode, QT3DSVec3 &inPosition,
- const QT3DSVec3 &inMouseVec) const = 0;
- virtual QT3DSVec3 ProjectPosition(SNode &inNode, const QT3DSVec3 &inPosition) const = 0;
-
- // Roughly equivalent of gluPickMatrix, allows users to setup a perspective transform that
- // will draw some sub component
- // of the layer. Used in combination with an expected viewport of 0,0,width,height the
- // viewproj matrix returned will center
- // around the center of the viewport and render just the part of the layer around this area.
- // The return value is optional because if the mouse point is completely outside the layer
- // obviously this method is irrelevant.
- virtual Option<SLayerPickSetup> GetLayerPickSetup(SLayer &inLayer,
- const QT3DSVec2 &inMouseCoords,
- const QSize &inPickDims) = 0;
-
- // Return the layer's viewport rect after the layer's member variables have been applied.
- // Uses the last rendered viewport rect.
- virtual Option<NVRenderRectF> GetLayerRect(SLayer &inLayer) = 0;
- // Testing function to allow clients to render a layer using a custom view project instead
- // of the one that would be setup
- // using the layer's camera in conjunction with the layer's position,scale.
- virtual void RunLayerRender(SLayer &inLayer, const QT3DSMat44 &inViewProjection) = 0;
-
- // This allocator is cleared every frame on BeginFrame. Objects constructed using this
- // allocator
- // Must not need their destructors called. Objects are allocate on 4 byte boundaries using
- // this allocator
- // regardless
- virtual NVAllocatorCallback &GetPerFrameAllocator() = 0;
-
- // Render the layer's rect onscreen. Will only render one frame, you need to call this
- // every frame
- // for this to work and be persistent.
- virtual void RenderLayerRect(SLayer &inLayer, const QT3DSVec3 &inColor) = 0;
- // Render widgets are things that are draw on the layer's widget texture which is then
- // rendered to the
- // scene's widget texture. You must add them every frame you wish them to be rendered; the
- // list of
- // widgets is cleared every frame.
- virtual void AddRenderWidget(IRenderWidget &inWidget) = 0;
-
- // Get a scale factor so you can have objects precisely 50 pixels. Note that this scale
- // factor
- // only applies to things drawn parallel to the camera plane; If you aren't parallel then
- // there isn't
- // a single scale factor that will work.
- // For perspective-rendered objects, we shift the object forward or backwards along the
- // vector from the camera
- // to the object so that we are working in a consistent mathematical space. So if the
- // camera is orthographic,
- // you are done.
- // If the camera is perspective, then this method will tell you want you need to scale
- // things by to account for
- // the FOV and also where the origin of the object needs to be to ensure the scale factor is
- // relevant.
- virtual SScaleAndPosition GetWorldToPixelScaleFactor(SLayer &inLayer,
- const QT3DSVec3 &inWorldPoint) = 0;
- // Called before a layer goes completely out of scope to release any rendering resources
- // related to the layer.
- virtual void ReleaseLayerRenderResources(SLayer &inLayer, const SRenderInstanceId id) = 0;
-
- // render a screen aligned 2D text
- virtual void RenderText2D(QT3DSF32 x, QT3DSF32 y, qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
- const char *text) = 0;
- // render Gpu profiler values
- virtual void RenderGpuProfilerStats(QT3DSF32 x, QT3DSF32 y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor) = 0;
-
- // Get the mouse coordinates as they relate to a given layer
- virtual Option<QT3DSVec2> GetLayerMouseCoords(SLayer &inLayer, const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool forceImageIntersect = false) const = 0;
-
- virtual IRenderWidgetContext &GetRenderWidgetContext() = 0;
-
- static bool IsGlEsContext(qt3ds::render::NVRenderContextType inContextType);
- static bool IsGlEs3Context(qt3ds::render::NVRenderContextType inContextType);
- static bool IsGl2Context(qt3ds::render::NVRenderContextType inContextType);
- static const char *GetGlslVesionString(qt3ds::render::NVRenderContextType inContextType);
-
- static IQt3DSRenderer &CreateRenderer(IQt3DSRenderContext &inContext);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.cpp
deleted file mode 100644
index 7bc108e0..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRendererUtil.h"
-#include "Qt3DSRenderResourceBufferObjects.h"
-#include "Qt3DSRenderResourceTexture2D.h"
-
-using namespace qt3ds::render;
-
-void CRendererUtil::ResolveMutisampleFBOColorOnly(IResourceManager &inManager,
- CResourceTexture2D &ioResult,
- NVRenderContext &inRenderContext, QT3DSU32 inWidth,
- QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inColorFormat,
- NVRenderFrameBuffer &inSourceFBO)
-{
- // create resolve FBO
- CResourceFrameBuffer theResolveFB(inManager);
- // Allocates the frame buffer which has the side effect of setting the current render target to
- // that frame buffer.
- theResolveFB.EnsureFrameBuffer();
- // set copy flags
- qt3ds::render::NVRenderClearFlags copyFlags(NVRenderClearValues::Color);
-
- // get / create resolve targets and attach
- ioResult.EnsureTexture(inWidth, inHeight, inColorFormat);
- theResolveFB->Attach(NVRenderFrameBufferAttachments::Color0, *ioResult);
- // CN - I don't believe we have to resolve the depth.
- // The reason is we render the depth texture specially unresolved. So there is no need to
- // resolve
- // the depth prepass texture to anything else.
-
- // 1. Make resolve buffer be the render target ( already happend )
- // 2. Make the current layer FBO the current read target
- // 3. Do the blit from MSAA to non MSAA
-
- // 2.
- inRenderContext.SetReadTarget(&inSourceFBO);
- inRenderContext.SetReadBuffer(NVReadFaces::Color0);
- // 3.
- inRenderContext.BlitFramebuffer(0, 0, inWidth, inHeight, 0, 0, inWidth, inHeight, copyFlags,
- NVRenderTextureMagnifyingOp::Nearest);
-}
-
-void CRendererUtil::ResolveSSAAFBOColorOnly(IResourceManager &inManager,
- CResourceTexture2D &ioResult, QT3DSU32 outWidth,
- QT3DSU32 outHeight, NVRenderContext &inRenderContext,
- QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inColorFormat,
- NVRenderFrameBuffer &inSourceFBO)
-{
- // create resolve FBO
- CResourceFrameBuffer theResolveFB(inManager);
- // Allocates the frame buffer which has the side effect of setting the current render target to
- // that frame buffer.
- theResolveFB.EnsureFrameBuffer();
- // set copy flags
- qt3ds::render::NVRenderClearFlags copyFlags(NVRenderClearValues::Color);
-
- // get / create resolve targets and attach
- ioResult.EnsureTexture(outWidth, outHeight, inColorFormat);
- theResolveFB->Attach(NVRenderFrameBufferAttachments::Color0, *ioResult);
- // CN - I don't believe we have to resolve the depth.
- // The reason is we render the depth texture specially unresolved. So there is no need to
- // resolve
- // the depth prepass texture to anything else.
-
- // 1. Make resolve buffer be the render target ( already happend )
- // 2. Make the current layer FBO the current read target
- // 3. Do the blit from High res to low res buffer
-
- // 2.
- inRenderContext.SetReadTarget(&inSourceFBO);
- inRenderContext.SetReadBuffer(NVReadFaces::Color0);
- // 3.
- inRenderContext.BlitFramebuffer(0, 0, inWidth, inHeight, 0, 0, outWidth, outHeight, copyFlags,
- NVRenderTextureMagnifyingOp::Linear);
-}
-
-void CRendererUtil::GetSSAARenderSize(QT3DSU32 inWidth, QT3DSU32 inHeight, QT3DSU32 &outWidth,
- QT3DSU32 &outHeight)
-{
- // we currently double width and height
- outWidth = inWidth * 2;
- outHeight = inHeight * 2;
-
- // keep aspect ration?
- // clamp to max
- if (outWidth > MAX_SSAA_DIM)
- outWidth = MAX_SSAA_DIM;
- if (outHeight > MAX_SSAA_DIM)
- outHeight = MAX_SSAA_DIM;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.h
deleted file mode 100644
index 96f36426..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSRendererUtil.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDERER_UTIL_H
-#define QT3DS_RENDERER_UTIL_H
-#include "Qt3DSRender.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-namespace qt3ds {
-namespace render {
- class CRendererUtil
- {
- static const QT3DSU32 MAX_SSAA_DIM = 8192; // max render traget size for SSAA mode
-
- public:
- static void ResolveMutisampleFBOColorOnly(IResourceManager &inManager,
- CResourceTexture2D &ioResult,
- NVRenderContext &inRenderContext, QT3DSU32 inWidth,
- QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inColorFormat,
- NVRenderFrameBuffer &inSourceFBO);
-
- static void ResolveSSAAFBOColorOnly(IResourceManager &inManager,
- CResourceTexture2D &ioResult, QT3DSU32 outWidth,
- QT3DSU32 outHeight, NVRenderContext &inRenderContext,
- QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inColorFormat,
- NVRenderFrameBuffer &inSourceFBO);
-
- static void GetSSAARenderSize(QT3DSU32 inWidth, QT3DSU32 inHeight, QT3DSU32 &outWidth,
- QT3DSU32 &outHeight);
- };
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.cpp
deleted file mode 100644
index 91a5eb78..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSTextRenderer.h"
-#include "render/Qt3DSRenderTexture2D.h"
-
-using namespace qt3ds::render;
-
-// http://acius2.blogspot.com/2007/11/calculating-next-power-of-2.html
-QT3DSU32 ITextRenderer::NextPowerOf2(QT3DSU32 input)
-{
- // Algorithm doesn't work for 0 or QT3DS_MAX_U32
- QT3DS_ASSERT(input > 0 && input < QT3DS_MAX_U32);
- input--;
- input = (input >> 1) | input;
- input = (input >> 2) | input;
- input = (input >> 4) | input;
- input = (input >> 8) | input;
- input = (input >> 16) | input;
- input++; // input is now the next highest power of 2.
- return input;
-}
-
-QT3DSU32 ITextRenderer::NextMultipleOf4(QT3DSU32 inValue)
-{
- QT3DSU32 remainder(inValue % 4);
- if (remainder != 0)
- inValue = inValue + (4 - remainder);
-
- return inValue;
-}
-
-STextTextureDetails ITextRenderer::UploadData(NVDataRef<QT3DSU8> inTextureData,
- NVRenderTexture2D &inTexture, QT3DSU32 inDataWidth,
- QT3DSU32 inDataHeight, QT3DSU32 inTextWidth,
- QT3DSU32 inTextHeight,
- NVRenderTextureFormats::Enum inFormat,
- bool inFlipYAxis)
-{
- if (inTextWidth == 0 || inTextHeight == 0) {
- QT3DSU32 black[] = { 0, 0, 0, 0 };
- inTexture.SetTextureData(toU8DataRef(black, 4), 0, 2, 2, NVRenderTextureFormats::RGBA8);
- return STextTextureDetails(2, 2, false, QT3DSVec2(1.0));
- }
- QT3DS_ASSERT(NextMultipleOf4(inDataWidth) == inDataWidth);
- QT3DSU32 theNecessaryHeight = NextMultipleOf4(inTextHeight);
- QT3DSU32 dataStride = inDataWidth * NVRenderTextureFormats::getSizeofFormat(inFormat);
- if (inTextureData.size() < dataStride * inDataHeight) {
- QT3DS_ASSERT(false);
- return STextTextureDetails();
- }
-
- STextureDetails theTextureDetails = inTexture.GetTextureDetails();
- QT3DSU32 theUploadSize = theNecessaryHeight * dataStride;
-
- NVDataRef<QT3DSU8> theUploadData = NVDataRef<QT3DSU8>(inTextureData.begin(), theUploadSize);
- inTexture.SetTextureData(theUploadData, 0, inDataWidth, theNecessaryHeight, inFormat);
- inTexture.SetMagFilter(qt3ds::render::NVRenderTextureMagnifyingOp::Linear);
- inTexture.SetMinFilter(qt3ds::render::NVRenderTextureMinifyingOp::Linear);
- return STextTextureDetails(inTextWidth, inTextHeight, inFlipYAxis, QT3DSVec2(1.0f, 1.0f));
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.h b/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.h
deleted file mode 100644
index 11c9ec6e..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/Qt3DSTextRenderer.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_TEXT_RENDERER_H
-#define QT3DS_TEXT_RENDERER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderTextTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SRendererFontEntry
- {
- QString m_FontName;
- QString m_FontFile;
- SRendererFontEntry() {}
- SRendererFontEntry(QString name, QString file)
- : m_FontName(name)
- , m_FontFile(file)
- {
- }
- };
-
- class ITextRendererCore : public NVRefCounted
- {
- public:
- // You can have several standard font directories and these will be persistent
- virtual void AddSystemFontDirectory(const char8_t *inDirectory) = 0;
- // Should be called to clear the current context.
- virtual void AddProjectFontDirectory(const char8_t *inProjectDirectory) = 0;
- virtual void ClearProjectFontDirectories() = 0;
- // Force font loading *right now*
- virtual void PreloadFonts() = 0;
- // Do not access object in between begin/end preload pairs.
- virtual void BeginPreloadFonts(IThreadPool &inThreadPool, IPerfTimer &inTimer) = 0;
- virtual void EndPreloadFonts() = 0;
- // Force a clear and reload of all of the fonts.
- virtual void ReloadFonts() = 0;
- // Get the list of project fonts. These are the only fonts that can be displayed.
- virtual NVConstDataRef<SRendererFontEntry> GetProjectFontList() = 0;
- // The name stored in the ttf file isn't the actual name we use; we use the file stems.
- // But we used to use the name. So this provides a sort of first-come-first-serve remapping
- // from ttf-name to file-stem.
- virtual Option<CRegisteredString> GetFontNameForFont(CRegisteredString inFontname) = 0;
- virtual Option<CRegisteredString> GetFontNameForFont(const char8_t *inFontname) = 0;
-
- virtual ITextRenderer &GetTextRenderer(NVRenderContext &inContext) = 0;
-
- static ITextRendererCore &CreateQtTextRenderer(NVFoundationBase &inFoundation,
- IStringTable &inStrTable);
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- static ITextRendererCore &createDistanceFieldRenderer(NVFoundationBase &inFnd);
-#endif
-
- // call this to create onscreen text renderer
- // it needs true type fonts
- static ITextRendererCore &CreateOnscreenTextRenderer(NVFoundationBase &inFoundation);
- };
- /**
- * Opaque text rendering system. Must be able to render text to an opengl texture object.
- */
- class ITextRenderer : public ITextRendererCore
- {
- protected:
- virtual ~ITextRenderer() {}
-
- public:
- // Measure text will inText if it isn't null or the text on the info if inText is null
- virtual STextDimensions MeasureText(const STextRenderInfo &inText, QT3DSF32 inTextScaleFactor,
- const char8_t *inTextOverride = NULL) = 0;
- // The system will use the 'r' channel as an alpha mask in order to render the
- // text. You can assume GetTextDimensions was called *just* prior to this.
- // It is a good idea to ensure the texture is a power of two as not all rendering systems
- // support nonpot textures. Our text rendering algorithms will render a sub-rect of the
- // image
- // assuming it is located toward the upper-left of the image and we are also capable of
- // flipping
- // the image.
- virtual STextTextureDetails RenderText(const STextRenderInfo &inText,
- NVRenderTexture2D &inTexture) = 0;
- // this is for rendering text with NV path rendering
- virtual STextTextureDetails
- RenderText(const STextRenderInfo &inText, NVRenderPathFontItem &inPathFontItem,
- NVRenderPathFontSpecification &inPathFontSpecicification) = 0;
- // this is for rednering text using a texture atlas
- virtual SRenderTextureAtlasDetails RenderText(const STextRenderInfo &inText) = 0;
-
- virtual void BeginFrame() = 0;
- virtual void EndFrame() = 0;
-
- // these two function are for texture atlas usage only
- // returns the atlas entries count
- virtual QT3DSI32 CreateTextureAtlas() = 0;
- virtual STextTextureAtlasEntryDetails RenderAtlasEntry(QT3DSU32 index,
- NVRenderTexture2D &inTexture) = 0;
-
- // Helper function to upload the texture data to the texture
- // Will resize texture as necessary and upload using texSubImage for
- // quickest upload times
- // This function expects that the dataWidth to be divisible by four and
- // that the total data height is larger then inTextHeight *and* divisible by four.
- // and that textWidth and textHeight are less than or equal to dataWidth,dataHeight
- //,can be zero, and don't need to be divisible by four (or 2).
- static STextTextureDetails
- UploadData(NVDataRef<QT3DSU8> inTextureData, NVRenderTexture2D &inTexture, QT3DSU32 inDataWidth,
- QT3DSU32 inDataHeight, QT3DSU32 inTextWidth, QT3DSU32 inTextHeight,
- NVRenderTextureFormats::Enum inFormat, bool inFlipYAxis);
-
- // Helper function to return the next power of two.
- // Fails for values of 0 or QT3DS_MAX_U32
- static QT3DSU32 NextPowerOf2(QT3DSU32 inValue);
- // If inValue is divisible by four, then return inValue
- // else next largest number that is divisible by four.
- static QT3DSU32 NextMultipleOf4(QT3DSU32 inValue);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/android/DynamicLibLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/android/DynamicLibLoader.h
deleted file mode 100644
index c968419a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/android/DynamicLibLoader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "linux/DynamicLibLoader.h"
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.cpp
deleted file mode 100644
index b9f9c200..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.cpp
+++ /dev/null
@@ -1,496 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderPresentation.h"
-#include "foundation/Qt3DSVec2.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSTextRenderer.h"
-
-#include <qmath.h>
-
-using namespace qt3ds::render;
-
-namespace {
-
-QT3DSF32 GetAspectRatio(const NVRenderRectF &inViewport)
-{
- return inViewport.m_Height != 0 ? inViewport.m_Width / inViewport.m_Height : 0.0f;
-}
-
-QT3DSF32 GetAspectRatio(const QT3DSVec2 &inDimensions)
-{
- return inDimensions.y != 0 ? inDimensions.x / inDimensions.y : 0.0f;
-}
-
-bool IsCameraVerticalAdjust(CameraScaleModes::Enum inMode, QT3DSF32 inDesignAspect,
- QT3DSF32 inActualAspect)
-{
- return (inMode == CameraScaleModes::Fit && inActualAspect >= inDesignAspect)
- || inMode == CameraScaleModes::FitVertical;
-}
-
-bool IsCameraHorizontalAdjust(CameraScaleModes::Enum inMode, QT3DSF32 inDesignAspect,
- QT3DSF32 inActualAspect)
-{
- return (inMode == CameraScaleModes::Fit && inActualAspect < inDesignAspect)
- || inMode == CameraScaleModes::FitHorizontal;
-}
-
-bool IsFitTypeScaleMode(CameraScaleModes::Enum inMode)
-{
- return inMode == CameraScaleModes::Fit || inMode == CameraScaleModes::FitHorizontal
- || inMode == CameraScaleModes::FitVertical;
-}
-
-struct SPinCameraResult
-{
- NVRenderRectF m_Viewport;
- NVRenderRectF m_VirtualViewport;
- SPinCameraResult(NVRenderRectF v, NVRenderRectF vv)
- : m_Viewport(v)
- , m_VirtualViewport(vv)
- {
- }
-};
-// Scale and transform the projection matrix to respect the camera anchor attribute
-// and the scale mode.
-SPinCameraResult PinCamera(const NVRenderRectF &inViewport, QT3DSVec2 inDesignDims,
- QT3DSMat44 &ioPerspectiveMatrix, CameraScaleModes::Enum inScaleMode,
- CameraScaleAnchors::Enum inPinLocation)
-{
- NVRenderRectF viewport(inViewport);
- NVRenderRectF idealViewport(inViewport.m_X, inViewport.m_Y, inDesignDims.x, inDesignDims.y);
- QT3DSF32 designAspect = GetAspectRatio(inDesignDims);
- QT3DSF32 actualAspect = GetAspectRatio(inViewport);
- if (IsFitTypeScaleMode(inScaleMode)) {
- idealViewport.m_Width = viewport.m_Width;
- idealViewport.m_Height = viewport.m_Height;
- }
- // We move the viewport such that the left, top of the presentation sits against the left top
- // edge
- // We only need to translate in X *if* our actual aspect > design aspect
- // And then we only need to account for whatever centering would happen.
-
- bool pinLeft = inPinLocation == CameraScaleAnchors::SouthWest
- || inPinLocation == CameraScaleAnchors::West
- || inPinLocation == CameraScaleAnchors::NorthWest;
- bool pinRight = inPinLocation == CameraScaleAnchors::SouthEast
- || inPinLocation == CameraScaleAnchors::East
- || inPinLocation == CameraScaleAnchors::NorthEast;
- bool pinTop = inPinLocation == CameraScaleAnchors::NorthWest
- || inPinLocation == CameraScaleAnchors::North
- || inPinLocation == CameraScaleAnchors::NorthEast;
- bool pinBottom = inPinLocation == CameraScaleAnchors::SouthWest
- || inPinLocation == CameraScaleAnchors::South
- || inPinLocation == CameraScaleAnchors::SouthEast;
-
- if (inScaleMode == CameraScaleModes::SameSize) {
- // In this case the perspective transform does not center the view,
- // it places it in the lower-left of the viewport.
- QT3DSF32 idealWidth = inDesignDims.x;
- QT3DSF32 idealHeight = inDesignDims.y;
- if (pinRight)
- idealViewport.m_X -= ((idealWidth - inViewport.m_Width));
- else if (!pinLeft)
- idealViewport.m_X -= ((idealWidth - inViewport.m_Width) / 2.0f);
-
- if (pinTop)
- idealViewport.m_Y -= ((idealHeight - inViewport.m_Height));
- else if (!pinBottom)
- idealViewport.m_Y -= ((idealHeight - inViewport.m_Height) / 2.0f);
- } else {
- // In this case our perspective matrix will center the view and we need to decenter
- // it as necessary
- // if we are wider than we are high
- if (IsCameraVerticalAdjust(inScaleMode, designAspect, actualAspect)) {
- if (pinLeft || pinRight) {
- QT3DSF32 idealWidth = inViewport.m_Height * designAspect;
- QT3DSI32 halfOffset = (QT3DSI32)((idealWidth - inViewport.m_Width) / 2.0f);
- halfOffset = pinLeft ? halfOffset : -1 * halfOffset;
- idealViewport.m_X += halfOffset;
- }
- } else {
- if (pinTop || pinBottom) {
- QT3DSF32 idealHeight = inViewport.m_Width / designAspect;
- QT3DSI32 halfOffset = (QT3DSI32)((idealHeight - inViewport.m_Height) / 2.0f);
- halfOffset = pinBottom ? halfOffset : -1 * halfOffset;
- idealViewport.m_Y += halfOffset;
- }
- }
- }
-
- ioPerspectiveMatrix = NVRenderContext::ApplyVirtualViewportToProjectionMatrix(
- ioPerspectiveMatrix, viewport, idealViewport);
- return SPinCameraResult(viewport, idealViewport);
-}
-}
-
-SCamera::SCamera()
- : SNode(GraphObjectTypes::Camera)
- , m_ClipNear(10)
- , m_ClipFar(10000)
- , m_FOV(60)
- , m_FOVHorizontal(false)
- , m_ScaleMode(CameraScaleModes::Fit)
- , m_ScaleAnchor(CameraScaleAnchors::Center)
-{
- TORAD(m_FOV);
- m_Projection = QT3DSMat44::createIdentity();
- m_Position = QT3DSVec3(0, 0, -600);
-}
-
-// Code for testing
-SCameraGlobalCalculationResult SCamera::CalculateGlobalVariables(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions)
-{
- bool wasDirty = SNode::CalculateGlobalVariables();
- return SCameraGlobalCalculationResult(wasDirty,
- CalculateProjection(inViewport, inDesignDimensions));
-}
-
-bool SCamera::CalculateProjection(const NVRenderRectF &inViewport, const QT3DSVec2 &inDesignDimensions)
-{
- bool retval = false;
- if (m_Flags.IsOrthographic())
- retval = ComputeFrustumOrtho(inViewport, inDesignDimensions);
- else
- retval = ComputeFrustumPerspective(inViewport, inDesignDimensions);
- if (retval) {
- QT3DSF32 *writePtr(m_Projection.front());
- m_FrustumScale.x = writePtr[0];
- m_FrustumScale.y = writePtr[5];
- PinCamera(inViewport, inDesignDimensions, m_Projection, m_ScaleMode, m_ScaleAnchor);
- }
- return retval;
-}
-
-//==============================================================================
-/**
- * Compute the projection matrix for a perspective camera
- * @return true if the computed projection matrix is valid
- */
-bool SCamera::ComputeFrustumPerspective(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions)
-{
- m_Projection = QT3DSMat44::createIdentity();
- QT3DSF32 theAngleInRadians = verticalFov(inViewport) / 2.0f;
- QT3DSF32 theDeltaZ = m_ClipFar - m_ClipNear;
- QT3DSF32 theSine = sinf(theAngleInRadians);
- QT3DSF32 designAspect = GetAspectRatio(inDesignDimensions);
- QT3DSF32 theAspectRatio = designAspect;
- if (IsFitTypeScaleMode(m_ScaleMode))
- theAspectRatio = GetAspectRatio(inViewport);
-
- if ((theDeltaZ != 0) && (theSine != 0) && (theAspectRatio != 0)) {
- QT3DSF32 *writePtr(m_Projection.front());
- writePtr[10] = -(m_ClipFar + m_ClipNear) / theDeltaZ;
- writePtr[11] = -1;
- writePtr[14] = -2 * m_ClipNear * m_ClipFar / theDeltaZ;
- writePtr[15] = 0;
-
- if (IsCameraVerticalAdjust(m_ScaleMode, designAspect, theAspectRatio)) {
- QT3DSF32 theCotangent = cosf(theAngleInRadians) / theSine;
- writePtr[0] = theCotangent / theAspectRatio;
- writePtr[5] = theCotangent;
- } else {
- QT3DSF32 theCotangent = cosf(theAngleInRadians) / theSine;
- writePtr[0] = theCotangent / designAspect;
- writePtr[5] = theCotangent * (theAspectRatio / designAspect);
- }
- return true;
- } else {
- QT3DS_ASSERT(false);
- return false;
- }
-}
-
-//==============================================================================
-/**
- * Compute the projection matrix for a orthographic camera
- * @return true if the computed projection matrix is valid
- */
-bool SCamera::ComputeFrustumOrtho(const NVRenderRectF &inViewport, const QT3DSVec2 &inDesignDimensions)
-{
- m_Projection = QT3DSMat44::createIdentity();
-
- QT3DSF32 theDeltaZ = m_ClipFar - m_ClipNear;
- QT3DSF32 halfWidth = inDesignDimensions.x / 2.0f;
- QT3DSF32 halfHeight = inDesignDimensions.y / 2.0f;
- QT3DSF32 designAspect = GetAspectRatio(inDesignDimensions);
- QT3DSF32 theAspectRatio = designAspect;
- if (IsFitTypeScaleMode(m_ScaleMode))
- theAspectRatio = GetAspectRatio(inViewport);
- if (theDeltaZ != 0) {
- QT3DSF32 *writePtr(m_Projection.front());
- writePtr[10] = -2.0f / theDeltaZ;
- writePtr[11] = 0.0f;
- writePtr[14] = -(m_ClipNear + m_ClipFar) / theDeltaZ;
- writePtr[15] = 1.0f;
- if (IsCameraVerticalAdjust(m_ScaleMode, designAspect, theAspectRatio)) {
- writePtr[0] = 1.0f / (halfHeight * theAspectRatio);
- writePtr[5] = 1.0f / halfHeight;
- } else {
- writePtr[0] = 1.0f / halfWidth;
- writePtr[5] = 1.0f / (halfWidth / theAspectRatio);
- }
- return true;
- } else {
- QT3DS_ASSERT(false);
- return false;
- }
-}
-
-QT3DSF32 SCamera::GetOrthographicScaleFactor(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions) const
-{
- if (m_ScaleMode == CameraScaleModes::SameSize)
- return 1.0f;
- QT3DSMat44 temp(QT3DSMat44::createIdentity());
- QT3DSF32 designAspect = GetAspectRatio(inDesignDimensions);
- QT3DSF32 theAspectRatio = GetAspectRatio(inViewport);
- if (m_ScaleMode == CameraScaleModes::Fit) {
- if (theAspectRatio >= designAspect) {
- return inViewport.m_Width < inDesignDimensions.x ? theAspectRatio / designAspect : 1.0f;
-
- } else {
- return inViewport.m_Height < inDesignDimensions.y ? designAspect / theAspectRatio
- : 1.0f;
- }
- } else if (m_ScaleMode == CameraScaleModes::FitVertical) {
- return (QT3DSF32)inDesignDimensions.y / (QT3DSF32)inViewport.m_Height;
- } else {
- return (QT3DSF32)inDesignDimensions.x / (QT3DSF32)inViewport.m_Width;
- }
-}
-
-QT3DSF32 SCamera::GetTextScaleFactor(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions) const
-{
- return NVMax(1.0f, 1.0f / GetOrthographicScaleFactor(inViewport, inDesignDimensions));
-}
-
-QT3DSMat33 SCamera::GetLookAtMatrix(const QT3DSVec3 &inUpDir, const QT3DSVec3 &inDirection) const
-{
- QT3DSVec3 theDirection(inDirection);
-
- theDirection.normalize();
-
- const QT3DSVec3 &theUpDir(inUpDir);
-
- // gram-shmidt orthogonalization
- QT3DSVec3 theCrossDir(theDirection.cross(theUpDir));
- theCrossDir.normalize();
- QT3DSVec3 theFinalDir(theCrossDir.cross(theDirection));
- theFinalDir.normalize();
- QT3DSF32 multiplier = 1.0f;
- if (m_Flags.IsLeftHanded())
- multiplier = -1.0f;
-
- QT3DSMat33 theResultMatrix(theCrossDir, theFinalDir, multiplier * theDirection);
- return theResultMatrix;
-}
-
-void SCamera::LookAt(const QT3DSVec3 &inCameraPos, const QT3DSVec3 &inUpDir, const QT3DSVec3 &inTargetPos)
-{
- QT3DSVec3 theDirection = inTargetPos - inCameraPos;
- if (m_Flags.IsLeftHanded())
- theDirection.z *= -1.0f;
- m_Rotation = GetRotationVectorFromRotationMatrix(GetLookAtMatrix(inUpDir, theDirection));
- m_Position = inCameraPos;
- MarkDirty(qt3ds::render::NodeTransformDirtyFlag::TransformIsDirty);
-}
-
-void SCamera::CalculateViewProjectionMatrix(QT3DSMat44 &outMatrix) const
-{
- QT3DSMat44 globalInverse = m_GlobalTransform.getInverse();
- outMatrix = m_Projection * globalInverse;
-}
-
-SCuboidRect SCamera::GetCameraBounds(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions) const
-{
- QT3DSMat44 unused(QT3DSMat44::createIdentity());
- SPinCameraResult theResult =
- PinCamera(inViewport, inDesignDimensions, unused, m_ScaleMode, m_ScaleAnchor);
- // find the normalized edges of the view frustum given the renormalization that happens when
- // pinning the camera.
- SCuboidRect normalizedCuboid(-1, 1, 1, -1);
- QT3DSVec2 translation(theResult.m_Viewport.m_X - theResult.m_VirtualViewport.m_X,
- theResult.m_Viewport.m_Y - theResult.m_VirtualViewport.m_Y);
- if (m_ScaleMode == CameraScaleModes::SameSize) {
- // the cuboid ranges are the actual divided by the ideal in this case
- QT3DSF32 xRange = 2.0f * (theResult.m_Viewport.m_Width / theResult.m_VirtualViewport.m_Width);
- QT3DSF32 yRange =
- 2.0f * (theResult.m_Viewport.m_Height / theResult.m_VirtualViewport.m_Height);
- normalizedCuboid = SCuboidRect(-1, -1 + yRange, -1 + xRange, -1);
- translation.x /= (theResult.m_VirtualViewport.m_Width / 2.0f);
- translation.y /= (theResult.m_VirtualViewport.m_Height / 2.0f);
- normalizedCuboid.Translate(translation);
- }
- // fit. This means that two parameters of the normalized cuboid will be -1, 1.
- else {
- // In this case our perspective matrix will center the view and we need to decenter
- // it as necessary
- QT3DSF32 actualAspect = GetAspectRatio(inViewport);
- QT3DSF32 designAspect = GetAspectRatio(inDesignDimensions);
- // if we are wider than we are high
- QT3DSF32 idealWidth = inViewport.m_Width;
- QT3DSF32 idealHeight = inViewport.m_Height;
-
- if (IsCameraVerticalAdjust(m_ScaleMode, designAspect, actualAspect)) {
- // then we just need to setup the left, right parameters of the cuboid because we know
- // the top
- // bottom are -1,1 due to how fit works.
- idealWidth = (QT3DSF32)ITextRenderer::NextMultipleOf4(
- (QT3DSU32)(inViewport.m_Height * designAspect + .5f));
- // halfRange should always be greater than 1.0f.
- QT3DSF32 halfRange = inViewport.m_Width / idealWidth;
- normalizedCuboid.m_Left = -halfRange;
- normalizedCuboid.m_Right = halfRange;
- translation.x = translation.x / (idealWidth / 2.0f);
- } else {
- idealHeight = (QT3DSF32)ITextRenderer::NextMultipleOf4(
- (QT3DSU32)(inViewport.m_Width / designAspect + .5f));
- QT3DSF32 halfRange = inViewport.m_Height / idealHeight;
- normalizedCuboid.m_Bottom = -halfRange;
- normalizedCuboid.m_Top = halfRange;
- translation.y = translation.y / (idealHeight / 2.0f);
- }
- normalizedCuboid.Translate(translation);
- }
- // Given no adjustment in the virtual rect, then this is what we would have.
-
- return normalizedCuboid;
-}
-
-void SCamera::SetupOrthographicCameraForOffscreenRender(NVRenderTexture2D &inTexture,
- QT3DSMat44 &outVP)
-{
- STextureDetails theDetails(inTexture.GetTextureDetails());
- SCamera theTempCamera;
- SetupOrthographicCameraForOffscreenRender(inTexture, outVP, theTempCamera);
-}
-
-void SCamera::SetupOrthographicCameraForOffscreenRender(NVRenderTexture2D &inTexture,
- QT3DSMat44 &outVP, SCamera &outCamera)
-{
- STextureDetails theDetails(inTexture.GetTextureDetails());
- SCamera theTempCamera;
- theTempCamera.m_Flags.SetOrthographic(true);
- theTempCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- QT3DSVec2 theDimensions((QT3DSF32)theDetails.m_Width, (QT3DSF32)theDetails.m_Height);
- theTempCamera.CalculateGlobalVariables(
- NVRenderRect(0, 0, theDetails.m_Width, theDetails.m_Height), theDimensions);
- theTempCamera.CalculateViewProjectionMatrix(outVP);
- outCamera = theTempCamera;
-}
-
-SRay SCamera::Unproject(const QT3DSVec2 &inViewportRelativeCoords, const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions, bool sceneCameraView) const
-{
- SRay theRay;
- QT3DSMat44 tempVal(QT3DSMat44::createIdentity());
- SPinCameraResult result =
- PinCamera(inViewport, inDesignDimensions, tempVal, m_ScaleMode, m_ScaleAnchor);
- QT3DSVec2 globalCoords = inViewport.ToAbsoluteCoords(inViewportRelativeCoords);
- QT3DSVec2 normalizedCoords =
- result.m_VirtualViewport.AbsoluteToNormalizedCoordinates(globalCoords);
- QT3DSVec3 &outOrigin(theRay.m_Origin);
- QT3DSVec3 &outDir(theRay.m_Direction);
- QT3DSVec2 inverseFrustumScale(1.0f / m_FrustumScale.x, 1.0f / m_FrustumScale.y);
- QT3DSVec2 scaledCoords(inverseFrustumScale.x * normalizedCoords.x,
- inverseFrustumScale.y * normalizedCoords.y);
-
- if (m_Flags.IsOrthographic()) {
- outOrigin.x = scaledCoords.x;
- outOrigin.y = scaledCoords.y;
- outOrigin.z = 0.0f;
-
- outDir.x = 0.0f;
- outDir.y = 0.0f;
- outDir.z = -1.0f;
- } else {
- outOrigin.x = 0.0f;
- outOrigin.y = 0.0f;
- outOrigin.z = 0.0f;
-
- outDir.x = scaledCoords.x;
- outDir.y = scaledCoords.y;
- outDir.z = -1.0f;
- }
-
- outOrigin = m_GlobalTransform.transform(outOrigin);
-
- // CalculateNormalMatrix(), but 4x4 matrix to have scale() method
- QT3DSMat44 theNormalMatrix = m_GlobalTransform.getInverse().getTranspose();
- if (sceneCameraView) {
- // When in scene camera view mode, camera scale needs to be inverted.
- // See QT3DS-3393.
- const float scaleX = m_GlobalTransform[0][0] / theNormalMatrix[0][0];
- const float scaleY = m_GlobalTransform[1][1] / theNormalMatrix[1][1];
- const float scaleZ = m_GlobalTransform[2][2] / theNormalMatrix[2][2];
- QT3DSVec4 scaleVector(scaleX, scaleY, scaleZ, 1.0);
- theNormalMatrix.scale(scaleVector);
- }
-
- outDir = theNormalMatrix.transform(outDir);
- outDir.normalize();
- /*
- char printBuf[2000];
- sprintf_s( printBuf, "normCoords %f %f outDir %f %f %f\n"
- , normalizedCoords.x, normalizedCoords.y, outDir.x, outDir.y, outDir.z );
- OutputDebugStringA( printBuf );
- */
-
- return theRay;
-}
-
-QT3DSVec3 SCamera::UnprojectToPosition(const QT3DSVec3 &inGlobalPos, const SRay &inRay) const
-{
- QT3DSVec3 theCameraDir = GetDirection();
- QT3DSVec3 theObjGlobalPos = inGlobalPos;
- QT3DSF32 theDistance = -1.0f * theObjGlobalPos.dot(theCameraDir);
- NVPlane theCameraPlane(theCameraDir, theDistance);
- return inRay.Intersect(theCameraPlane);
-}
-
-QT3DSF32 SCamera::verticalFov(QT3DSF32 aspectRatio) const
-{
- if (m_FOVHorizontal)
- return 2.0f * qAtan(qTan(qreal(m_FOV) / 2.0) / qreal(aspectRatio));
- else
- return m_FOV;
-}
-
-QT3DSF32 SCamera::verticalFov(const NVRenderRectF &inViewport) const
-{
- return verticalFov(GetAspectRatio(inViewport));
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.h
deleted file mode 100644
index be8d53e8..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCamera.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CAMERA_H
-#define QT3DS_RENDER_CAMERA_H
-#include "Qt3DSRenderNode.h"
-#include "Qt3DSRenderRay.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SCameraGlobalCalculationResult
- {
- bool m_WasDirty;
- bool m_ComputeFrustumSucceeded;
- SCameraGlobalCalculationResult(bool inWasDirty, bool inComputeSucceeded = true)
- : m_WasDirty(inWasDirty)
- , m_ComputeFrustumSucceeded(inComputeSucceeded)
- {
- }
- };
-
- struct CameraScaleModes
- {
- enum Enum {
- Fit = 0,
- SameSize,
- FitHorizontal,
- FitVertical,
- };
- };
-
- struct CameraScaleAnchors
- {
- enum Enum {
- Center = 0,
- North,
- NorthEast,
- East,
- SouthEast,
- South,
- SouthWest,
- West,
- NorthWest,
- };
- };
-
- struct SCuboidRect
- {
- QT3DSF32 m_Left;
- QT3DSF32 m_Top;
- QT3DSF32 m_Right;
- QT3DSF32 m_Bottom;
- SCuboidRect(QT3DSF32 l = 0.0f, QT3DSF32 t = 0.0f, QT3DSF32 r = 0.0f, QT3DSF32 b = 0.0f)
- : m_Left(l)
- , m_Top(t)
- , m_Right(r)
- , m_Bottom(b)
- {
- }
- void Translate(QT3DSVec2 inTranslation)
- {
- m_Left += inTranslation.x;
- m_Right += inTranslation.x;
- m_Top += inTranslation.y;
- m_Bottom += inTranslation.y;
- }
- };
-
- struct SCamera : public SNode
- {
-
- // Setting these variables should set dirty on the camera.
- QT3DSF32 m_ClipNear;
- QT3DSF32 m_ClipFar;
-
- QT3DSF32 m_FOV; // Radians
- bool m_FOVHorizontal;
-
- QT3DSMat44 m_Projection;
- CameraScaleModes::Enum m_ScaleMode;
- CameraScaleAnchors::Enum m_ScaleAnchor;
- // Record some values from creating the projection matrix
- // to use during mouse picking.
- QT3DSVec2 m_FrustumScale;
-
- SCamera();
-
- QT3DSMat33 GetLookAtMatrix(const QT3DSVec3 &inUpDir, const QT3DSVec3 &inDirection) const;
- // Set our position, rotation member variables based on the lookat target
- // Marks this object as dirty.
- // Need to test this when the camera's local transform is null.
- // Assumes parent's local transform is the identity, meaning our local transform is
- // our global transform.
- void LookAt(const QT3DSVec3 &inCameraPos, const QT3DSVec3 &inUpDir, const QT3DSVec3 &inTargetPos);
-
- SCameraGlobalCalculationResult CalculateGlobalVariables(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions);
- bool CalculateProjection(const NVRenderRectF &inViewport, const QT3DSVec2 &inDesignDimensions);
- bool ComputeFrustumOrtho(const NVRenderRectF &inViewport, const QT3DSVec2 &inDesignDimensions);
- // Used when rendering the widgets in studio. This scales the widget when in orthographic
- // mode in order to have
- // constant size on screen regardless.
- // Number is always greater than one
- QT3DSF32 GetOrthographicScaleFactor(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions) const;
- bool ComputeFrustumPerspective(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions);
- // Text may be scaled so that it doesn't appear pixellated when the camera itself is doing
- // the scaling.
- QT3DSF32 GetTextScaleFactor(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions) const;
-
- void CalculateViewProjectionMatrix(QT3DSMat44 &outMatrix) const;
-
- // If this is an orthographic camera, the cuboid properties are the distance from the center
- // point
- // to the left, top, right, and bottom edges of the view frustum in world units.
- // If this is a perspective camera, the cuboid properties are the FOV angles
- // (left,top,right,bottom)
- // of the view frustum.
-
- // Return a normalized rect that describes the area the camera is rendering to.
- // This takes into account the various camera properties (scale mode, scale anchor).
- SCuboidRect GetCameraBounds(const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions) const;
-
- // Setup a camera VP projection for rendering offscreen.
- static void SetupOrthographicCameraForOffscreenRender(NVRenderTexture2D &inTexture,
- QT3DSMat44 &outVP);
- static void SetupOrthographicCameraForOffscreenRender(NVRenderTexture2D &inTexture,
- QT3DSMat44 &outVP, SCamera &outCamera);
-
- // Unproject a point (x,y) in viewport relative coordinates meaning
- // left, bottom is 0,0 and values are increasing right,up respectively.
- SRay Unproject(const QT3DSVec2 &inLayerRelativeMouseCoords, const NVRenderRectF &inViewport,
- const QT3DSVec2 &inDesignDimensions, bool sceneCameraView = false) const;
-
- // Unproject a given coordinate to a 3d position that lies on the same camera
- // plane as inGlobalPos.
- // Expects CalculateGlobalVariables has been called or doesn't need to be.
- QT3DSVec3 UnprojectToPosition(const QT3DSVec3 &inGlobalPos, const SRay &inRay) const;
-
- QT3DSF32 verticalFov(QT3DSF32 aspectRatio) const;
- QT3DSF32 verticalFov(const NVRenderRectF &inViewport) const;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCustomMaterial.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCustomMaterial.h
deleted file mode 100644
index 593c7573..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderCustomMaterial.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_CUSTOM_MATERIAL_H
-#define QT3DS_RENDER_CUSTOM_MATERIAL_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderDynamicObject.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSRenderLightmaps.h"
-#include "foundation/Qt3DSFlags.h"
-
-namespace qt3ds {
-namespace render {
-
- // IMPORTANT: These flags matches the key produced by a MDL export file
- struct SCustomMaterialShaderKeyValues
- {
- enum Enum {
- diffuse = 1 << 0,
- specular = 1 << 1,
- glossy = 1 << 2,
- cutout = 1 << 3,
- refraction = 1 << 4,
- transparent = 1 << 5,
- displace = 1 << 6,
- volumetric = 1 << 7,
- transmissive = 1 << 8,
- };
- };
-
- typedef NVFlags<SCustomMaterialShaderKeyValues::Enum, QT3DSU32> SCustomMaterialShaderKeyFlags;
-
- struct SCustomMaterial : public SDynamicObject
- {
- private:
- // These objects are only created via the dynamic object system.
- SCustomMaterial(const SCustomMaterial &);
- SCustomMaterial &operator=(const SCustomMaterial &);
- SCustomMaterial();
-
- public:
- // lightmap section
- SLightmaps m_Lightmaps;
- // material section
- bool m_hasTransparency;
- bool m_hasRefraction;
- bool m_hasVolumetricDF;
- SImage *m_IblProbe;
- SImage *m_EmissiveMap2;
- SImage *m_DisplacementMap;
- QT3DSF32 m_DisplaceAmount; ///< depends on the object size
-
- SGraphObject *m_NextSibling;
-
- SCustomMaterialShaderKeyFlags m_ShaderKeyValues; ///< input from MDL files
- QT3DSU32 m_LayerCount; ///< input from MDL files
-
- void Initialize(QT3DSU32 inKey, QT3DSU32 inLayerCount)
- {
- m_Lightmaps.m_LightmapIndirect = NULL;
- m_Lightmaps.m_LightmapRadiosity = NULL;
- m_Lightmaps.m_LightmapShadow = NULL;
- m_hasTransparency = false;
- m_hasRefraction = false;
- m_hasVolumetricDF = false;
- m_NextSibling = NULL;
- m_DirtyFlagWithInFrame = m_Flags.IsDirty();
- m_IblProbe = NULL;
- m_EmissiveMap2 = NULL;
- m_DisplacementMap = NULL;
- m_DisplaceAmount = 0.0;
- m_ShaderKeyValues = (SCustomMaterialShaderKeyFlags)inKey;
- m_LayerCount = inLayerCount;
- }
-
- bool IsDielectric() const
- {
- return m_ShaderKeyValues & SCustomMaterialShaderKeyValues::diffuse;
- }
- bool IsSpecularEnabled() const
- {
- return m_ShaderKeyValues & SCustomMaterialShaderKeyValues::specular;
- }
- bool IsCutOutEnabled() const
- {
- return m_ShaderKeyValues & SCustomMaterialShaderKeyValues::cutout;
- }
- bool IsVolumetric() const
- {
- return m_ShaderKeyValues & SCustomMaterialShaderKeyValues::volumetric;
- }
- bool IsTransmissive() const
- {
- return m_ShaderKeyValues & SCustomMaterialShaderKeyValues::transmissive;
- }
- bool HasLighting() const { return true; }
-
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SDynamicObject::Remap(inRemapper);
- m_Lightmaps.Remap(inRemapper);
- inRemapper.Remap(m_IblProbe);
- inRemapper.RemapMaterial(m_NextSibling);
- inRemapper.Remap(m_EmissiveMap2);
- inRemapper.Remap(m_DisplacementMap);
- }
-
- // Dirty
- bool m_DirtyFlagWithInFrame;
- bool IsDirty() const { return m_Flags.IsDirty() || m_DirtyFlagWithInFrame; }
- void UpdateDirtyForFrame()
- {
- m_DirtyFlagWithInFrame = m_Flags.IsDirty();
- m_Flags.SetDirty(false);
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.cpp
deleted file mode 100644
index e18a84d2..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderDefaultMaterial.h"
-
-using namespace qt3ds::render;
-
-SDefaultMaterial::SDefaultMaterial()
- : SGraphObject(GraphObjectTypes::DefaultMaterial)
- , m_IblProbe(NULL)
- , m_Lighting(DefaultMaterialLighting::VertexLighting)
- , m_BlendMode(DefaultMaterialBlendMode::Normal)
- , m_DiffuseColor(1, 1, 1, 1)
- , m_EmissivePower(0)
- , m_EmissiveMap(NULL)
- , m_EmissiveMap2(NULL)
- , m_EmissiveColor(1, 1, 1, 1)
- , m_SpecularReflection(NULL)
- , m_SpecularMap(NULL)
- , m_SpecularModel(DefaultMaterialSpecularModel::Default)
- , m_SpecularTint(1, 1, 1, 1)
- , m_IOR(.2f)
- , m_FresnelPower(0.0f)
- , m_SpecularAmount(0)
- , m_SpecularRoughness(50)
- , m_RoughnessMap(NULL)
- , m_Opacity(1)
- , m_OpacityMap(NULL)
- , m_BumpMap(NULL)
- , m_BumpAmount(0.f)
- , m_NormalMap(NULL)
- , m_DisplacementMap(NULL)
- , m_DisplaceAmount(0.f)
- , m_TranslucencyMap(NULL)
- , m_TranslucentFalloff(0.f)
- , m_DiffuseLightWrap(0.f)
- , m_VertexColors(false)
- , m_NextSibling(NULL)
- , m_Parent(NULL)
-{
- m_Lightmaps.m_LightmapIndirect = NULL;
- m_Lightmaps.m_LightmapRadiosity = NULL;
- m_Lightmaps.m_LightmapShadow = NULL;
-
- m_DiffuseMaps[0] = NULL;
- m_DiffuseMaps[2] = NULL;
- m_DiffuseMaps[1] = NULL;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.h
deleted file mode 100644
index 48c8d0ba..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDefaultMaterial.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DEFAULT_MATERIAL_H
-#define QT3DS_RENDER_DEFAULT_MATERIAL_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSVec3.h"
-#include "Qt3DSRenderMaterialDirty.h"
-#include "Qt3DSRenderLightmaps.h"
-
-namespace qt3ds {
-namespace render {
- struct DefaultMaterialLighting
- {
- enum Enum {
- NoLighting = 0,
- VertexLighting,
- FragmentLighting
- };
- };
- struct DefaultMaterialBlendMode
- {
- enum Enum {
- Normal = 0,
- Screen,
- Multiply,
- Overlay,
- ColorBurn,
- ColorDodge
- };
- };
-
- struct DefaultMaterialSpecularModel
- {
- enum Enum {
- Default = 0,
- KGGX,
- KWard
- };
- };
-
- struct SImage;
-
- struct QT3DS_AUTOTEST_EXPORT SDefaultMaterial : SGraphObject
- {
- CMaterialDirty m_Dirty;
- // lightmap section
- SLightmaps m_Lightmaps;
- // material section
- SImage *m_IblProbe;
- DefaultMaterialLighting::Enum m_Lighting; // defaults to vertex
- DefaultMaterialBlendMode::Enum m_BlendMode; // defaults to normal
- QT3DSVec4 m_DiffuseColor; // colors are 0-1 normalized
- SImage *m_DiffuseMaps[3];
- QT3DSF32 m_EmissivePower; // 0-100, defaults to 0
- QT3DSVec4 m_EmissiveColor;
- SImage *m_EmissiveMap;
- SImage *m_EmissiveMap2;
- SImage *m_SpecularReflection;
- SImage *m_SpecularMap;
- DefaultMaterialSpecularModel::Enum m_SpecularModel;
- QT3DSVec4 m_SpecularTint;
- QT3DSF32 m_IOR;
- QT3DSF32 m_FresnelPower;
- QT3DSF32 m_SpecularAmount; // 0-??, defaults to 0
- QT3DSF32 m_SpecularRoughness; // 0-??, defaults to 50
- SImage *m_RoughnessMap;
- QT3DSF32 m_Opacity; // 0-1
- SImage *m_OpacityMap;
- SImage *m_BumpMap;
- QT3DSF32 m_BumpAmount; // 0-??
- SImage *m_NormalMap;
- SImage *m_DisplacementMap;
- QT3DSF32 m_DisplaceAmount; // 0-??
- SImage *m_TranslucencyMap;
- QT3DSF32 m_TranslucentFalloff; // 0 - ??
- QT3DSF32 m_DiffuseLightWrap; // 0 - 1
- bool m_VertexColors;
- // Materials are stored as a linked list on models.
- SGraphObject *m_NextSibling;
- SModel *m_Parent;
-
- SDefaultMaterial();
-
- bool IsSpecularEnabled() const { return m_SpecularAmount > .01f; }
- bool IsFresnelEnabled() const { return m_FresnelPower > 0.0f; }
- bool IsVertexColorsEnabled() const { return m_VertexColors; }
- bool HasLighting() const { return m_Lighting != DefaultMaterialLighting::NoLighting; }
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- m_Lightmaps.Remap(inRemapper);
- inRemapper.Remap(m_IblProbe);
- inRemapper.Remap(m_DiffuseMaps[0]);
- inRemapper.Remap(m_DiffuseMaps[1]);
- inRemapper.Remap(m_DiffuseMaps[2]);
- inRemapper.Remap(m_EmissiveMap);
- inRemapper.Remap(m_EmissiveMap2);
- inRemapper.Remap(m_SpecularReflection);
- inRemapper.Remap(m_SpecularMap);
- inRemapper.Remap(m_RoughnessMap);
- inRemapper.Remap(m_OpacityMap);
- inRemapper.Remap(m_BumpMap);
- inRemapper.Remap(m_NormalMap);
- inRemapper.Remap(m_DisplacementMap);
- inRemapper.Remap(m_TranslucencyMap);
- inRemapper.RemapMaterial(m_NextSibling);
- inRemapper.Remap(m_Parent);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.cpp
deleted file mode 100644
index 2e1e6a07..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderDynamicObject.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "foundation/FileTools.h"
-#include "StringTools.h"
-
-#include <QtCore/qdir.h>
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-
-SDynamicObject::SDynamicObject(GraphObjectTypes::Enum inType, CRegisteredString inObjName,
- QT3DSU32 inDSByteSize, QT3DSU32 thisObjSize)
- : SGraphObject(inType)
- , m_ClassName(inObjName)
- , m_DataSectionByteSize(inDSByteSize)
- , m_ThisObjectSize(thisObjSize)
-{
-}
-
-template <typename TDataType>
-void SDynamicObject::SetPropertyValueT(const dynamic::SPropertyDefinition &inDefinition,
- const TDataType &inValue)
-{
- if (sizeof(inValue) != inDefinition.m_ByteSize) {
- QT3DS_ASSERT(false);
- return;
- }
- memCopy(GetDataSectionBegin() + inDefinition.m_Offset, &inValue, sizeof(inValue));
-}
-
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- bool inValue)
-{
- SetPropertyValueT(inDefinition, inValue);
-}
-
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- QT3DSF32 inValue)
-{
- SetPropertyValueT(inDefinition, inValue);
-}
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- QT3DSF32 inValue, QT3DSU32 inOffset)
-{
- if (sizeof(QT3DSF32) > (inDefinition.m_ByteSize - inOffset)) {
- QT3DS_ASSERT(false);
- return;
- }
- memCopy(GetDataSectionBegin() + inDefinition.m_Offset + inOffset, &inValue, sizeof(inValue));
-}
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const QT3DSVec2 &inValue)
-{
- SetPropertyValueT(inDefinition, inValue);
-}
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const QT3DSVec3 &inValue)
-{
- SetPropertyValueT(inDefinition, inValue);
-}
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const QT3DSVec4 &inValue)
-{
- SetPropertyValueT(inDefinition, inValue);
-}
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- QT3DSI32 inValue)
-{
- SetPropertyValueT(inDefinition, inValue);
-}
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- CRegisteredString inValue)
-{
- QT3DS_ASSERT(inDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr);
- SetPropertyValueT(inDefinition, inValue);
-}
-
-template <typename TStrType>
-void SDynamicObject::SetStrPropertyValueT(dynamic::SPropertyDefinition &inDefinition,
- const char8_t *inValue, const char8_t *inProjectDir,
- TStrType &ioWorkspace, IStringTable &inStrTable)
-{
- if (inValue == NULL)
- inValue = "";
- if (inDefinition.m_DataType == NVRenderShaderDataTypes::QT3DSI32) {
- NVConstDataRef<CRegisteredString> theEnumValues = inDefinition.m_EnumValueNames;
- for (QT3DSI32 idx = 0, end = (QT3DSI32)theEnumValues.size(); idx < end; ++idx) {
- if (strcmp(theEnumValues[idx].c_str(), inValue) == 0) {
- SetPropertyValueT(inDefinition, idx);
- break;
- }
- }
- } else if (inDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderTexture2DPtr) {
- if (inProjectDir == NULL)
- inProjectDir = "";
- if (CFileTools::RequiresCombineBaseAndRelative(inValue)) {
- QString absolute = QDir(inProjectDir).filePath(inValue);
- ioWorkspace.assign(absolute.toLatin1().constData());
- SetPropertyValueT(inDefinition, inStrTable.RegisterStr(ioWorkspace.c_str()));
- // We also adjust the image path in the definition
- // I could not find a better place
- inDefinition.m_ImagePath = inStrTable.RegisterStr(ioWorkspace.c_str());
- } else {
- SetPropertyValueT(inDefinition, inStrTable.RegisterStr(inValue));
- }
- } else if (inDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderImage2DPtr) {
- SetPropertyValueT(inDefinition, inStrTable.RegisterStr(inValue));
- } else if (inDefinition.m_DataType == NVRenderShaderDataTypes::NVRenderDataBufferPtr) {
- SetPropertyValueT(inDefinition, inStrTable.RegisterStr(inValue));
- } else {
- QT3DS_ASSERT(false);
- }
-}
-
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const char8_t *inValue, const char8_t *inProjectDir,
- Qt3DSString &ioWorkspace, IStringTable &inStrTable)
-{
- SetStrPropertyValueT(const_cast<dynamic::SPropertyDefinition &>(inDefinition), inValue,
- inProjectDir, ioWorkspace, inStrTable);
-}
-
-void SDynamicObject::SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const char8_t *inValue, const char8_t *inProjectDir,
- eastl::string &ioWorkspace, IStringTable &inStrTable)
-{
- SetStrPropertyValueT(const_cast<dynamic::SPropertyDefinition &>(inDefinition), inValue,
- inProjectDir, ioWorkspace, inStrTable);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.h
deleted file mode 100644
index 92ab3b2a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderDynamicObject.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_DYNAMIC_OBJECT_H
-#define QT3DS_RENDER_DYNAMIC_OBJECT_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "Qt3DSRenderNode.h"
-#include "EASTL/string.h"
-#include "StringTools.h"
-
-namespace qt3ds {
-namespace render {
-
- namespace dynamic {
- struct SPropertyDefinition;
- }
-
- // Dynamic objects are objects that have variable number of properties during runtime.
- struct SDynamicObject : public SGraphObject
- {
- CRegisteredString m_ClassName;
- NodeFlags m_Flags;
- QT3DSU32 m_DataSectionByteSize;
- QT3DSU32 m_ThisObjectSize;
-
- SDynamicObject(GraphObjectTypes::Enum inType, CRegisteredString inClassName,
- QT3DSU32 inDSByteSize, QT3DSU32 thisObjSize);
-
- QT3DSU8 *GetDataSectionBegin()
- {
- QT3DSU8 *thisObjectStart = reinterpret_cast<QT3DSU8 *>(this);
- QT3DSU8 *retval = thisObjectStart + m_ThisObjectSize;
- QT3DS_ASSERT((reinterpret_cast<size_t>(retval) % 4 == 0));
- return retval;
- }
-
- const QT3DSU8 *GetDataSectionBegin() const
- {
- return const_cast<SDynamicObject *>(this)->GetDataSectionBegin();
- }
-
- QT3DSU8 *GetDataSectionEnd() { return GetDataSectionBegin() + m_DataSectionByteSize; }
-
- template <typename TDataType>
- void SetPropertyValueT(const dynamic::SPropertyDefinition &inDefinition,
- const TDataType &inType);
- template <typename TStrType>
- void SetStrPropertyValueT(dynamic::SPropertyDefinition &inDefinition,
- const char8_t *inValue, const char8_t *inProjectDir,
- TStrType &ioWorkspace, IStringTable &inStrTable);
-
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition, bool inValue);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition, QT3DSF32 inValue);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition, QT3DSF32 inValue,
- QT3DSU32 inOffset);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const QT3DSVec2 &inValue);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const QT3DSVec3 &inValue);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const QT3DSVec4 &inValue);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition, QT3DSI32 inValue);
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- CRegisteredString inValue);
-
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const char8_t *inValue, const char8_t *inProjectDir,
- Qt3DSString &ioWorkspace, IStringTable &inStrTable);
-
- void SetPropertyValue(const dynamic::SPropertyDefinition &inDefinition,
- const char8_t *inValue, const char8_t *inProjectDir,
- eastl::string &ioWorkspace, IStringTable &inStrTable);
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_ClassName);
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.cpp
deleted file mode 100644
index f074b6b1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderEffect.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec3.h"
-#include "StringTools.h"
-#include "foundation/FileTools.h"
-
-using namespace qt3ds::render;
-
-void SEffect::Initialize()
-{
- m_Layer = NULL;
- m_NextEffect = NULL;
- m_Context = NULL;
-}
-
-void SEffect::SetActive(bool inActive, IEffectSystem &inManager)
-{
- if (m_Flags.IsActive() != inActive) {
- m_Flags.SetActive(inActive);
- if (m_Context)
- inManager.ResetEffectFrameData(*m_Context);
- m_Flags.SetDirty(true);
- }
-}
-
-void SEffect::Reset(IEffectSystem &inSystem)
-{
- if (m_Context)
- inSystem.ResetEffectFrameData(*m_Context);
- m_Flags.SetDirty(true);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.h
deleted file mode 100644
index c11c214c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderEffect.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_EFFECT_H
-#define QT3DS_RENDER_EFFECT_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "Qt3DSRenderNode.h"
-#include "EASTL/string.h"
-#include "Qt3DSRenderDynamicObject.h"
-
-namespace qt3ds {
-namespace render {
- struct SLayer;
- struct SEffectContext;
-
- // Effects are post-render effect applied to the layer. There can be more than one of
- // them and they have completely variable properties.
- // see IEffectManager in order to create these effects.
- // The data for the effect immediately follows the effect
- struct SEffect : public SDynamicObject
- {
- private:
- // These objects are only created via the dynamic object system.
- SEffect(const SEffect &);
- SEffect &operator=(const SEffect &);
- SEffect();
-
- public:
- SLayer *m_Layer;
- SEffect *m_NextEffect;
- // Opaque pointer to context type implemented by the effect system.
- // May be null in which case the effect system will generate a new context
- // the first time it needs to render this effect.
- SEffectContext *m_Context;
-
- void Initialize();
-
- // If our active flag value changes, then we ask the effect manager
- // to reset our context.
- void SetActive(bool inActive, IEffectSystem &inSystem);
-
- void Reset(IEffectSystem &inSystem);
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SDynamicObject::Remap(inRemapper);
- inRemapper.Remap(m_Layer);
- inRemapper.Remap(m_NextEffect);
- inRemapper.NullPtr(m_Context);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderGraphObject.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderGraphObject.h
deleted file mode 100644
index 58c48ed1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderGraphObject.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_GRAPH_OBJECT_H
-#define QT3DS_RENDER_GRAPH_OBJECT_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderTaggedPointer.h"
-#include "Qt3DSRenderGraphObjectTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- // Types should be setup on construction. Change the type
- // at your own risk as the type is used for RTTI purposes.
- struct QT3DS_AUTOTEST_EXPORT SGraphObject
- {
- // Id's help debugging the object and are optionally set
- CRegisteredString m_Id;
- // Type is used for RTTI purposes down the road.
- GraphObjectTypes::Enum m_Type;
- STaggedPointer m_UserData;
-
- SGraphObject(GraphObjectTypes::Enum inType)
- : m_Type(inType)
- {
- }
- SGraphObject(const SGraphObject &inCloningObject, NVAllocatorCallback & /*inAllocator*/)
- : m_Id(inCloningObject.m_Id)
- , m_Type(inCloningObject.m_Type)
- {
- }
-
- // If you change any detail of the scene graph, or even *breath* on a
- // scene graph object, you need to bump this binary version so at least
- // we know if we can load a file or not.
- static QT3DSU32 GetSceneGraphBinaryVersion() { return 1; }
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- inRemapper.Remap(m_Id);
- inRemapper.NullPtr(m_UserData.m_UserData);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp
deleted file mode 100644
index 1cbd6015..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSOffscreenRenderKey.h"
-#include "Qt3DSRenderPlugin.h"
-#include "Qt3DSRenderPluginGraphObject.h"
-
-using namespace qt3ds::render;
-
-SImage::SImage()
- : SGraphObject(GraphObjectTypes::Image)
- , m_RenderPlugin(nullptr)
- , m_LastFrameOffscreenRenderer(nullptr)
- , m_Parent(nullptr)
- , m_Scale(1, 1)
- , m_Pivot(0, 0)
- , m_Rotation(0)
- , m_Position(0, 0)
- , m_MappingMode(ImageMappingModes::Normal)
- , m_HorizontalTilingMode(NVRenderTextureCoordOp::ClampToEdge)
- , m_VerticalTilingMode(NVRenderTextureCoordOp::ClampToEdge)
-{
- m_Flags.SetActive(true);
- m_Flags.SetDirty(true);
- m_Flags.SetTransformDirty(true);
-}
-
-static void HandleOffscreenResult(SImage &theImage, SImageTextureData &newImage,
- SOffscreenRenderResult &theResult, bool &replaceTexture,
- bool &wasDirty)
-{
- newImage.m_Texture = theResult.m_Texture;
- newImage.m_TextureFlags.SetHasTransparency(theResult.m_HasTransparency);
- newImage.m_TextureFlags.SetPreMultiplied(true);
- wasDirty = wasDirty || theResult.m_HasChangedSinceLastFrame;
- theImage.m_LastFrameOffscreenRenderer = theResult.m_Renderer;
- replaceTexture = true;
-}
-
-bool SImage::ClearDirty(IBufferManager &inBufferManager, IOffscreenRenderManager &inRenderManager,
- IRenderPluginManager &inPluginManager, bool forIbl)
-{
-
- bool wasDirty = m_Flags.IsDirty();
- m_Flags.SetDirty(false);
- SImageTextureData newImage;
- bool replaceTexture(false);
- if (m_RenderPlugin && m_RenderPlugin->m_Flags.IsActive()) {
- IRenderPluginInstance *theInstance = inPluginManager.GetOrCreateRenderPluginInstance(
- m_RenderPlugin->m_PluginPath, m_RenderPlugin);
- if (theInstance) {
- inRenderManager.MaybeRegisterOffscreenRenderer(theInstance, *theInstance);
- SOffscreenRenderResult theResult = inRenderManager.GetRenderedItem(theInstance);
- HandleOffscreenResult(*this, newImage, theResult, replaceTexture, wasDirty);
- }
- }
-
- if (newImage.m_Texture == nullptr) {
- if (m_OffscreenRendererId.IsValid()) {
- SOffscreenRenderResult theResult =
- inRenderManager.GetRenderedItem(m_OffscreenRendererId);
- HandleOffscreenResult(*this, newImage, theResult, replaceTexture, wasDirty);
- }
- }
-
- if (newImage.m_Texture == nullptr) {
- m_LastFrameOffscreenRenderer = nullptr;
- if (m_ImagePath.IsValid()) {
- if (!m_LoadedTextureData
- || m_LoadedTextureData->m_path != QString::fromUtf8(m_ImagePath.c_str())) {
- if (m_LoadedTextureData)
- m_LoadedTextureData->m_callbacks.removeOne(this);
- m_LoadedTextureData = inBufferManager.CreateReloadableImage(m_ImagePath, false,
- forIbl);
- m_LoadedTextureData->m_callbacks.push_back(this);
- }
- if (m_LoadedTextureData) {
- if (m_LoadedTextureData->m_loaded) {
- newImage.m_Texture = m_LoadedTextureData->m_Texture;
- newImage.m_TextureFlags = m_LoadedTextureData->m_TextureFlags;
- newImage.m_BSDFMipMap = m_LoadedTextureData->m_BSDFMipMap;
- }
- replaceTexture = m_TextureData.m_Texture != newImage.m_Texture;
- }
- }
- }
-
- if (replaceTexture) {
- wasDirty = true;
- m_TextureData = newImage;
- }
-
- if (m_Flags.IsTransformDirty()) {
- wasDirty = true;
- CalculateTextureTransform();
- }
- return wasDirty;
-}
-
-void SImage::CalculateTextureTransform()
-{
- m_Flags.SetTransformDirty(false);
-
- m_TextureTransform = QT3DSMat44::createIdentity();
-
- QT3DSMat44 translation(QT3DSMat44::createIdentity());
- QT3DSMat44 rotation(QT3DSMat44::createIdentity());
- QT3DSMat44 scale(QT3DSMat44::createIdentity());
-
- translation.column3[0] = m_Position.x;
- translation.column3[1] = m_Position.y;
- scale.column0[0] = m_Scale.x;
- scale.column1[1] = m_Scale.y;
- rotation.rotate(m_Rotation, QT3DSVec3(0, 0, 1));
-
- // Setup the pivot.
- m_TextureTransform.column3[0] = m_Pivot.x;
- m_TextureTransform.column3[1] = m_Pivot.y;
- m_TextureTransform = m_TextureTransform * rotation;
- m_TextureTransform = m_TextureTransform * scale;
- m_TextureTransform = m_TextureTransform * translation;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.h
deleted file mode 100644
index 9b71d3f1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderImage.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_IMAGE_H
-#define QT3DS_RENDER_IMAGE_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "foundation/StringTable.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "Qt3DSRenderNode.h"
-#include "foundation/Qt3DSVec2.h"
-#include "Qt3DSRenderImageTextureData.h"
-#include "EASTL/utility.h"
-
-namespace qt3ds {
-namespace render {
- class IQt3DSRenderContext;
- class IOffscreenRenderManager;
- class IOffscreenRenderer;
- struct ImageMappingModes
- {
- enum Enum {
- Normal = 0, // UV mapping
- Environment = 1,
- LightProbe = 2,
- };
- };
-
- struct QT3DS_AUTOTEST_EXPORT SImage : public SGraphObject
- {
- // Complete path to the file;
- //*not* relative to the presentation directory
- CRegisteredString m_ImagePath;
- CRegisteredString m_ImageShaderName; ///< for custom materials we don't generate the name
-
- // Presentation id.
- CRegisteredString m_OffscreenRendererId; // overrides source path if available
- SRenderPlugin *m_RenderPlugin; // Overrides everything if available.
- IOffscreenRenderer *m_LastFrameOffscreenRenderer;
- SGraphObject *m_Parent;
-
- SImageTextureData m_TextureData;
- ReloadableTexturePtr m_LoadedTextureData;
-
- NodeFlags m_Flags; // only dirty, transform dirty, and active apply
-
- QT3DSVec2 m_Scale;
- QT3DSVec2 m_Pivot;
- QT3DSF32 m_Rotation; // Radians.
- QT3DSVec2 m_Position;
- ImageMappingModes::Enum m_MappingMode;
- NVRenderTextureCoordOp::Enum m_HorizontalTilingMode;
- NVRenderTextureCoordOp::Enum m_VerticalTilingMode;
-
- // Setting any of the above variables means this object is dirty.
- // Setting any of the vec2 properties means this object's transform is dirty
-
- QT3DSMat44 m_TextureTransform;
-
- SImage();
- // Renders the sub presentation
- // Or finds the image.
- // and sets up the texture transform
- bool ClearDirty(IBufferManager &inBufferManager, IOffscreenRenderManager &inRenderManager,
- IRenderPluginManager &pluginManager, bool forIbl = false);
-
- void CalculateTextureTransform();
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_ImagePath);
- inRemapper.Remap(m_OffscreenRendererId);
- // Null out objects that should be null when loading from file.
- inRemapper.NullPtr(m_LastFrameOffscreenRenderer);
- inRemapper.NullPtr(m_TextureData.m_Texture);
- inRemapper.Remap(m_RenderPlugin);
- inRemapper.Remap(m_Parent);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.cpp
deleted file mode 100644
index 36a826cb..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderEffect.h"
-
-using namespace qt3ds::render;
-
-SLayer::SLayer()
- : SNode(GraphObjectTypes::Layer)
- , m_Scene(NULL)
- , m_FirstEffect(NULL)
- , m_RenderPlugin(NULL)
- , m_ProgressiveAAMode(AAModeValues::NoAA)
- , m_MultisampleAAMode(AAModeValues::NoAA)
- , m_Background(LayerBackground::Transparent)
- , m_ClearColor(0.0f)
- , m_BlendType(LayerBlendTypes::Normal)
- , m_HorizontalFieldValues(HorizontalFieldValues::LeftWidth)
- , m_Left(0)
- , m_LeftUnits(LayerUnitTypes::Percent)
- , m_Width(100.0f)
- , m_WidthUnits(LayerUnitTypes::Percent)
- , m_Right(0)
- , m_RightUnits(LayerUnitTypes::Percent)
- , m_VerticalFieldValues(VerticalFieldValues::TopHeight)
- , m_Top(0)
- , m_TopUnits(LayerUnitTypes::Percent)
- , m_Height(100.0f)
- , m_HeightUnits(LayerUnitTypes::Percent)
- , m_Bottom(0)
- , m_BottomUnits(LayerUnitTypes::Percent)
- , m_AoStrength(0)
- , m_AoDistance(5.0f)
- , m_AoSoftness(50.0f)
- , m_AoBias(0)
- , m_AoSamplerate(2)
- , m_AoDither(false)
- , m_ShadowStrength(0)
- , m_ShadowDist(10)
- , m_ShadowSoftness(100.0f)
- , m_ShadowBias(0)
- , m_LightProbe(NULL)
- , m_ProbeBright(100.0f)
- , m_FastIbl(false)
- , m_ProbeHorizon(-1.0f)
- , m_ProbeFov(180.0f)
- , m_LightProbe2(NULL)
- , m_Probe2Fade(1.0f)
- , m_Probe2Window(1.0f)
- , m_Probe2Pos(0.5f)
- , m_TemporalAAEnabled(false)
-{
- m_Flags.SetLayerRenderToTarget(true);
- m_Flags.SetLayerEnableDepthTest(true);
- m_Flags.SetLayerEnableDepthPrepass(true);
-}
-
-void SLayer::AddEffect(SEffect &inEffect)
-{
- // Effects need to be rendered in reverse order as described in the file.
- inEffect.m_NextEffect = m_FirstEffect;
- m_FirstEffect = &inEffect;
- inEffect.m_Layer = this;
-}
-
-SEffect *SLayer::GetLastEffect()
-{
- if (m_FirstEffect) {
- SEffect *theEffect = m_FirstEffect;
- // Empty loop intentional
- for (; theEffect->m_NextEffect; theEffect = theEffect->m_NextEffect) {
- }
- QT3DS_ASSERT(theEffect->m_NextEffect == NULL);
- return theEffect;
- }
- return NULL;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.h
deleted file mode 100644
index 5c08e917..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLayer.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_LAYER_H
-#define QT3DS_RENDER_LAYER_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderNode.h"
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderer.h"
-
-namespace qt3ds {
-namespace render {
- class IQt3DSRenderContext;
- struct SPresentation;
- struct SScene;
- struct SEffect;
-
- struct AAModeValues
- {
- enum Enum {
- NoAA = 0,
- SSAA = 1,
- X2 = 2,
- X4 = 4,
- X8 = 8
- };
- };
-
- struct HorizontalFieldValues
- {
- enum Enum {
- LeftWidth = 0,
- LeftRight,
- WidthRight
- };
- };
-
- struct VerticalFieldValues
- {
- enum Enum {
- TopHeight = 0,
- TopBottom,
- HeightBottom
- };
- };
-
- struct LayerUnitTypes
- {
- enum Enum {
- Percent = 0,
- Pixels
- };
- };
-
- struct LayerBackground
- {
- enum Enum {
- Transparent = 0,
- Unspecified,
- Color
- };
- };
-
- struct LayerBlendTypes
- {
- enum Enum {
- Normal = 0,
- Screen,
- Multiply,
- Add,
- Subtract,
- Overlay,
- ColorBurn,
- ColorDodge
- };
- };
-
- // A layer is a special node. It *always* presents its global transform
- // to children as the identity. It also can optionally have a width or height
- // different than the overlying context. You can think of layers as the transformation
- // between a 3d scene graph and a 2D texture.
- struct QT3DS_AUTOTEST_EXPORT SLayer : public SNode
- {
- SScene *m_Scene;
-
- // First effect in a list of effects.
- SEffect *m_FirstEffect;
-
- // If a layer has a valid texture path (one that resolves to either a
- // an on-disk image or a offscreen renderer), then it does not render its
- // own source path. Instead, it renders the offscreen renderer. Used in this manner,
- // offscreen renderer's also have the option (if they support it) to render directly to the
- // render target given a specific viewport (that is also scissored if necessary).
- qt3ds::foundation::CRegisteredString m_TexturePath;
-
- SRenderPlugin *m_RenderPlugin; // Overrides texture path if available.
-
- AAModeValues::Enum m_ProgressiveAAMode;
- AAModeValues::Enum m_MultisampleAAMode;
- LayerBackground::Enum m_Background;
- QT3DSVec4 m_ClearColor;
-
- LayerBlendTypes::Enum m_BlendType;
-
- HorizontalFieldValues::Enum m_HorizontalFieldValues;
- QT3DSF32 m_Left;
- LayerUnitTypes::Enum m_LeftUnits;
- QT3DSF32 m_Width;
- LayerUnitTypes::Enum m_WidthUnits;
- QT3DSF32 m_Right;
- LayerUnitTypes::Enum m_RightUnits;
-
- VerticalFieldValues::Enum m_VerticalFieldValues;
- QT3DSF32 m_Top;
- LayerUnitTypes::Enum m_TopUnits;
- QT3DSF32 m_Height;
- LayerUnitTypes::Enum m_HeightUnits;
- QT3DSF32 m_Bottom;
- LayerUnitTypes::Enum m_BottomUnits;
-
- // Ambient occlusion
- QT3DSF32 m_AoStrength;
- QT3DSF32 m_AoDistance;
- QT3DSF32 m_AoSoftness;
- QT3DSF32 m_AoBias;
- QT3DSI32 m_AoSamplerate;
- bool m_AoDither;
-
- // Direct occlusion
- QT3DSF32 m_ShadowStrength;
- QT3DSF32 m_ShadowDist;
- QT3DSF32 m_ShadowSoftness;
- QT3DSF32 m_ShadowBias;
-
- // IBL
- SImage *m_LightProbe;
- QT3DSF32 m_ProbeBright;
- bool m_FastIbl;
- QT3DSF32 m_ProbeHorizon;
- QT3DSF32 m_ProbeFov;
- SImage *m_LightProbe2;
- QT3DSF32 m_Probe2Fade;
- QT3DSF32 m_Probe2Window;
- QT3DSF32 m_Probe2Pos;
-
- bool m_TemporalAAEnabled;
-
- SLayer();
-
- void AddEffect(SEffect &inEffect);
-
- SEffect *GetLastEffect();
-
- LayerBlendTypes::Enum GetLayerBlend()
- {
- return m_BlendType;
- }
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SNode::Remap(inRemapper);
- inRemapper.Remap(m_Scene);
- inRemapper.Remap(m_FirstEffect);
- inRemapper.Remap(m_TexturePath);
- inRemapper.Remap(m_RenderPlugin);
- inRemapper.Remap(m_LightProbe);
- inRemapper.Remap(m_LightProbe2);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.cpp
deleted file mode 100644
index 5c983243..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderLight.h"
-
-using namespace qt3ds::render;
-
-SLight::SLight()
- : SNode(GraphObjectTypes::Light)
- , m_LightType(RenderLightTypes::Directional)
- , m_Scope(NULL)
- , m_DiffuseColor(1, 1, 1, 1)
- , m_SpecularColor(1, 1, 1, 1)
- , m_AmbientColor(0, 0, 0, 1)
- , m_Brightness(100)
- , m_LinearFade(0)
- , m_ExponentialFade(0)
- , m_AreaWidth(0)
- , m_AreaHeight(0)
- , m_CastShadow(false)
- , m_ShadowBias(0.0f)
- , m_ShadowFactor(5.0f)
- , m_ShadowMapRes(9)
- , m_ShadowMapFar(5000.0f)
- , m_ShadowMapFov(90.0f)
- , m_ShadowFilter(35.0f)
-{
- m_Flags.SetPointLight(0);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.h
deleted file mode 100644
index 10f2b866..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLight.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_LIGHT_H
-#define QT3DS_RENDER_LIGHT_H
-#include "Qt3DSRenderNode.h"
-
-namespace qt3ds {
-namespace render {
-
- struct RenderLightTypes
- {
- enum Enum {
- Unknown = 0,
- Directional,
- Point,
- Area,
- };
- };
-
- struct SImage;
-
- struct QT3DS_AUTOTEST_EXPORT SLight : public SNode
- {
- RenderLightTypes::Enum m_LightType; // Directional
- SNode *m_Scope;
- QT3DSVec4 m_DiffuseColor; // colors are 0-1 normalized
- QT3DSVec4 m_SpecularColor; // colors are 0-1 normalized
- QT3DSVec4 m_AmbientColor; // colors are 0-1 normalized
-
- // The variables below are in the same range as Studio
- // Only valid if node is a point light
- QT3DSF32 m_Brightness; // 0-200
- QT3DSF32 m_LinearFade; // 0-200
- QT3DSF32 m_ExponentialFade; // 0-200
-
- QT3DSF32 m_AreaWidth; // 0.01-inf
- QT3DSF32 m_AreaHeight; // 0.01-inf
-
- bool m_CastShadow; // true if this light produce shadows
- QT3DSF32 m_ShadowBias; // depth shift to avoid self-shadowing artifacts
- QT3DSF32 m_ShadowFactor; // Darkening factor for ESMs
- QT3DSU32 m_ShadowMapRes; // Resolution of shadow map
- QT3DSF32 m_ShadowMapFar; // Far clip plane for the shadow map
- QT3DSF32 m_ShadowMapFov; // Field of View for the shadow map
- QT3DSF32 m_ShadowFilter; // Shadow map filter step size
-
- // Defaults to directional light
- SLight();
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SNode::Remap(inRemapper);
- inRemapper.Remap(m_Scope);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.cpp
deleted file mode 100644
index 0e5e6c60..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderLightmaps.h"
-
-using namespace qt3ds::render;
-
-SLightmaps::SLightmaps()
- : SGraphObject(GraphObjectTypes::Lightmaps)
- , m_LightmapIndirect(NULL)
- , m_LightmapRadiosity(NULL)
- , m_LightmapShadow(NULL)
-{
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.h
deleted file mode 100644
index 4480aea4..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderLightmaps.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_RENDER_LIGHTMAPS_H
-#define QT3DS_RENDER_LIGHTMAPS_H
-
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderMaterialDirty.h"
-
-namespace qt3ds {
-namespace render {
-
- struct MaterialLightmapsUsage
- {
- enum Enum {
- Dynamic = 0,
- Baked,
- DynamicAndBaked,
- };
- };
-
- struct QT3DS_AUTOTEST_EXPORT SLightmaps : public SGraphObject
- {
- CMaterialDirty m_Dirty;
-
- SImage *m_LightmapIndirect;
- SImage *m_LightmapRadiosity;
- SImage *m_LightmapShadow;
-
- SLightmaps();
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_LightmapIndirect);
- inRemapper.Remap(m_LightmapRadiosity);
- inRemapper.Remap(m_LightmapShadow);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderMaterialDirty.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderMaterialDirty.h
deleted file mode 100644
index c04c1b6b..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderMaterialDirty.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_MATERIAL_DIRTY_H
-#define QT3DS_RENDER_MATERIAL_DIRTY_H
-
-namespace qt3ds {
-namespace render {
- class CMaterialDirty
- {
- private:
- bool m_Dirty;
- bool m_DirtyFlagWithInFrame;
-
- public:
- CMaterialDirty()
- : m_Dirty(true)
- , m_DirtyFlagWithInFrame(m_Dirty)
- {
- }
-
- void SetDirty() { m_Dirty = m_DirtyFlagWithInFrame = true; }
- bool IsDirty() const { return m_Dirty || m_DirtyFlagWithInFrame; }
- void ClearDirty() { m_DirtyFlagWithInFrame = m_Dirty = false; }
- void UpdateDirtyForFrame()
- {
- m_DirtyFlagWithInFrame = m_Dirty;
- m_Dirty = false;
- }
- };
-}
-}
-
-#endif // QT3DS_RENDER_MATERIAL_DIRTY_H
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.cpp
deleted file mode 100644
index a78396c5..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSRenderMaterialHelpers.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderMesh.h"
-
-using namespace qt3ds::render;
-
-SModel::SModel()
- : SNode(GraphObjectTypes::Model)
- , m_FirstMaterial(NULL)
- , m_SkeletonRoot(-1)
- , m_TessellationMode(TessModeValues::NoTess)
- , m_EdgeTess(1.0)
- , m_InnerTess(1.0)
- , m_WireframeMode(false)
- , m_ShadowCaster(true)
-{
-}
-
-void SModel::AddMaterial(SGraphObject &inMaterial)
-{
- if (m_FirstMaterial == NULL)
- m_FirstMaterial = &inMaterial;
- else {
- SGraphObject *lastMaterial;
- // empty loop intentional
- for (lastMaterial = m_FirstMaterial; lastMaterial && GetNextMaterialSibling(lastMaterial);
- lastMaterial = GetNextMaterialSibling(lastMaterial)) {
- }
- SetNextMaterialSibling(*lastMaterial, &inMaterial);
- }
- if (inMaterial.m_Type == GraphObjectTypes::DefaultMaterial)
- static_cast<SDefaultMaterial &>(inMaterial).m_Parent = this;
-}
-
-NVBounds3 SModel::GetModelBounds(IBufferManager &inManager) const
-{
- NVBounds3 retval;
- retval.setEmpty();
- SRenderMesh *theMesh = inManager.LoadMesh(m_MeshPath);
- if (theMesh) {
- for (QT3DSU32 idx = 0, end = theMesh->m_Subsets.size(); idx < end; ++idx)
- retval.include(theMesh->m_Subsets[idx].m_Bounds);
- }
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.h
deleted file mode 100644
index cc5c4e27..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderModel.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_MODEL_H
-#define QT3DS_RENDER_MODEL_H
-
-#include "Qt3DSRenderNode.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderTessModeValues.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SDefaultMaterial;
- class IBufferManager;
-
- struct QT3DS_AUTOTEST_EXPORT SModel : public SNode
- {
- // Complete path to the file;
- //*not* relative to the presentation directory
- CRegisteredString m_MeshPath;
- SGraphObject *m_FirstMaterial;
- QT3DSI32 m_SkeletonRoot;
- TessModeValues::Enum m_TessellationMode;
- QT3DSF32 m_EdgeTess;
- QT3DSF32 m_InnerTess;
- bool m_WireframeMode;
- bool m_ShadowCaster;
-
- SModel();
-
- void AddMaterial(SGraphObject &inMaterial);
-
- NVBounds3 GetModelBounds(IBufferManager &inManager) const;
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SNode::Remap(inRemapper);
- inRemapper.RemapMaterial(m_FirstMaterial);
- inRemapper.Remap(m_MeshPath);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.cpp
deleted file mode 100644
index bf47bb8d..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.cpp
+++ /dev/null
@@ -1,499 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderModel.h"
-#include "Qt3DSRenderNode.h"
-#include "Qt3DSRenderText.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderPathManager.h"
-#include "Qt3DSRenderPath.h"
-
-using namespace qt3ds::render;
-
-SNode::SNode(GraphObjectTypes::Enum inGraphObjectType)
- : SGraphObject(inGraphObjectType)
- , m_Rotation(0, 0, 0) // Radians
- , m_Position(0, 0, 0)
- , m_Scale(1, 1, 1)
- , m_Pivot(0, 0, 0)
- , m_RotationOrder(EulOrdYXZs)
- , m_LocalOpacity(1.0f)
- , m_GlobalOpacity(1.0f)
- , m_SkeletonId(-1)
- , m_Parent(NULL)
- , m_NextSibling(NULL)
- , m_PreviousSibling(NULL)
- , m_FirstChild(NULL)
- , m_DFSIndex(0)
-{
- m_Flags.SetDirty(true);
- m_Flags.SetTransformDirty(true);
- m_Flags.SetLeftHanded(true);
- m_Flags.SetActive(true);
- m_Flags.SetLocallyPickable(true);
-}
-
-SNode::SNode(const SNode &inCloningObject, NVAllocatorCallback &inAllocator)
- : SGraphObject(inCloningObject, inAllocator)
- , m_Rotation(inCloningObject.m_Rotation) // Radians
- , m_Position(inCloningObject.m_Position)
- , m_Scale(inCloningObject.m_Scale)
- , m_Pivot(inCloningObject.m_Pivot)
- , m_RotationOrder(inCloningObject.m_RotationOrder)
- , m_LocalOpacity(inCloningObject.m_LocalOpacity)
- , m_LocalTransform(inCloningObject.m_LocalTransform)
- , m_GlobalTransform(inCloningObject.m_GlobalTransform)
- , m_GlobalOpacity(inCloningObject.m_GlobalOpacity)
- , m_SkeletonId(inCloningObject.m_SkeletonId)
- , m_Parent(NULL)
- , m_NextSibling(NULL)
- , m_PreviousSibling(NULL)
- , m_FirstChild(NULL)
- , m_DFSIndex(0)
-{
- m_Flags.SetDirty(true);
- m_Flags.SetTransformDirty(true);
- m_Flags.SetLeftHanded(true);
- m_Flags.SetActive(true);
- m_Flags.SetLocallyPickable(true);
-
- // for ( SNode* theChild = m_FirstChild; theChild != NULL; theChild = theChild->m_NextSibling )
- //{
- // SNode* theClonedChild = static_cast<SNode*>( CGraphObjectFactory::CloneGraphObject(
- //*theChild, inAllocator ) );
- // AddChild( *theClonedChild );
- //}
-}
-
-// Sets this object dirty and walks down the graph setting all
-// children who are not dirty to be dirty.
-void SNode::MarkDirty(NodeTransformDirtyFlag::Enum inTransformDirty)
-{
- if (m_Flags.IsTransformDirty() == false)
- m_Flags.SetTransformDirty(inTransformDirty != NodeTransformDirtyFlag::TransformNotDirty);
- if (m_Flags.IsDirty() == false) {
- m_Flags.SetDirty(true);
- for (SNode *child = m_FirstChild; child; child = child->m_NextSibling)
- child->MarkDirty(inTransformDirty);
- }
-}
-
-// Calculate global transform and opacity
-// Walks up the graph ensure all parents are not dirty so they have
-// valid global transforms.
-
-bool SNode::CalculateGlobalVariables()
-{
- bool retval = m_Flags.IsDirty();
- if (retval) {
- m_Flags.SetDirty(false);
- if (m_Flags.IsTransformDirty())
- CalculateLocalTransform();
- m_GlobalOpacity = m_LocalOpacity;
- if (m_Parent) {
- // Layer transforms do not flow down but affect the final layer's rendered
- // representation.
- retval = m_Parent->CalculateGlobalVariables() || retval;
- if (m_Parent->m_Type != GraphObjectTypes::Layer) {
- m_GlobalOpacity *= m_Parent->m_GlobalOpacity;
- if (m_Flags.IsIgnoreParentTransform() == false)
- m_GlobalTransform = m_Parent->m_GlobalTransform * m_LocalTransform;
- else
- m_GlobalTransform = m_LocalTransform;
- } else
- m_GlobalTransform = m_LocalTransform;
-
- m_Flags.SetGlobalActive(m_Flags.IsActive() && m_Parent->m_Flags.IsGloballyActive());
- m_Flags.SetGloballyPickable(m_Flags.IsLocallyPickable()
- || m_Parent->m_Flags.IsGloballyPickable());
- } else {
- m_GlobalTransform = m_LocalTransform;
- m_Flags.SetGlobalActive(m_Flags.IsActive());
- m_Flags.SetGloballyPickable(m_Flags.IsLocallyPickable());
- }
- }
- // We always clear dirty in a reasonable manner but if we aren't active
- // there is no reason to tell the universe if we are dirty or not.
- return retval && m_Flags.IsActive();
-}
-
-// Create some mapping of euler angles to their axis mapping.
-#define ITERATE_POSSIBLE_EULER_ANGLES \
- HANDLE_EULER_ANGLE(EulOrdXYZs, X, Y, Z) \
- HANDLE_EULER_ANGLE(EulOrdXYXs, X, Y, X) \
- HANDLE_EULER_ANGLE(EulOrdXZYs, X, Z, Y) \
- HANDLE_EULER_ANGLE(EulOrdXZXs, X, Z, X) \
- HANDLE_EULER_ANGLE(EulOrdYZXs, Y, Z, X) \
- HANDLE_EULER_ANGLE(EulOrdYZYs, Y, Z, Y) \
- HANDLE_EULER_ANGLE(EulOrdYXZs, Y, X, Z) \
- HANDLE_EULER_ANGLE(EulOrdYXYs, Y, X, Y) \
- HANDLE_EULER_ANGLE(EulOrdZXYs, Z, X, Y) \
- HANDLE_EULER_ANGLE(EulOrdZXZs, Z, X, Z) \
- HANDLE_EULER_ANGLE(EulOrdZYXs, Z, Y, X) \
- HANDLE_EULER_ANGLE(EulOrdZYZs, Z, Y, Z) \
- HANDLE_EULER_ANGLE(EulOrdZYXr, Z, Y, X) \
- HANDLE_EULER_ANGLE(EulOrdXYXr, X, Y, X) \
- HANDLE_EULER_ANGLE(EulOrdYZXr, Y, Z, X) \
- HANDLE_EULER_ANGLE(EulOrdXZXr, X, Z, X) \
- HANDLE_EULER_ANGLE(EulOrdXZYr, X, Z, Y) \
- HANDLE_EULER_ANGLE(EulOrdYZYr, Y, Z, Y) \
- HANDLE_EULER_ANGLE(EulOrdZXYr, Z, X, Y) \
- HANDLE_EULER_ANGLE(EulOrdYXYr, Y, X, Y) \
- HANDLE_EULER_ANGLE(EulOrdYXZr, Y, X, Z) \
- HANDLE_EULER_ANGLE(EulOrdZXZr, Z, X, Z) \
- HANDLE_EULER_ANGLE(EulOrdXYZr, X, Y, Z) \
- HANDLE_EULER_ANGLE(EulOrdZYZr, Z, Y, Z)
-
-inline EulerAngles RotationAndOrderToShoemake(QT3DSVec3 inRotation, QT3DSU32 inOrder)
-{
- EulerAngles retval;
- retval.w = (QT3DSF32)inOrder;
- int X = 0;
- int Y = 1;
- int Z = 2;
-
- switch (inOrder) {
-#define HANDLE_EULER_ANGLE(order, xIdx, yIdx, zIdx) \
- case order: \
- retval.x = -inRotation[xIdx]; \
- retval.y = -inRotation[yIdx]; \
- retval.z = -inRotation[zIdx]; \
- break;
- ITERATE_POSSIBLE_EULER_ANGLES
-#undef HANDLE_EULER_ANGLE
- default:
- QT3DS_ASSERT(false);
- retval.x = inRotation[X];
- retval.y = inRotation[Y];
- retval.z = inRotation[Z];
- break;
- }
- return retval;
-}
-
-QT3DSVec3 SNode::GetRotationVectorFromRotationMatrix(const QT3DSMat33 &inMatrix) const
-{
- QT3DSMat44 theConvertMatrix(inMatrix, QT3DSVec3(0, 0, 0));
- if (m_Flags.IsLeftHanded())
- SNode::FlipCoordinateSystem(theConvertMatrix);
- qt3ds::render::CEulerAngleConverter theConverter;
- qt3ds::render::HMatrix *theHMatrix =
- reinterpret_cast<qt3ds::render::HMatrix *>(theConvertMatrix.front());
- qt3ds::render::EulerAngles theAngles = theConverter.Eul_FromHMatrix(*theHMatrix, m_RotationOrder);
- return GetRotationVectorFromEulerAngles(theAngles);
-}
-
-QT3DSVec3 SNode::GetRotationVectorFromEulerAngles(const EulerAngles &inAngles)
-{
- QT3DSVec3 retval(0, 0, 0);
- int X = 0;
- int Y = 1;
- int Z = 2;
- switch ((int)inAngles.w) {
-#define HANDLE_EULER_ANGLE(order, xIdx, yIdx, zIdx) \
- case order: \
- retval[xIdx] = -inAngles.x; \
- retval[yIdx] = -inAngles.y; \
- retval[zIdx] = -inAngles.z; \
- break;
- ITERATE_POSSIBLE_EULER_ANGLES
-#undef HANDLE_EULER_ANGLE
- default:
- QT3DS_ASSERT(false);
- retval.x = inAngles.x;
- retval.y = inAngles.y;
- retval.z = inAngles.z;
- break;
- }
-
- return retval;
-}
-
-void SNode::CalculateRotationMatrix(QT3DSMat44 &outMatrix) const
-{
- StaticAssert<sizeof(QT3DSMat44) == sizeof(HMatrix)>::valid_expression();
- CEulerAngleConverter theConverter;
- EulerAngles theAngles(RotationAndOrderToShoemake(m_Rotation, (int)m_RotationOrder));
- HMatrix *theMatrix = reinterpret_cast<HMatrix *>(&outMatrix);
- theConverter.Eul_ToHMatrix(theAngles, *theMatrix);
-}
-
-void SNode::FlipCoordinateSystem(QT3DSMat44 &inMatrix)
-{
- QT3DSF32 *writePtr(inMatrix.front());
- // rotation conversion
- writePtr[0 * 4 + 2] *= -1;
- writePtr[1 * 4 + 2] *= -1;
- writePtr[2 * 4 + 0] *= -1;
- writePtr[2 * 4 + 1] *= -1;
-
- // translation conversion
- writePtr[3 * 4 + 2] *= -1;
-}
-
-void SNode::CalculateLocalTransform()
-{
- m_Flags.SetTransformDirty(false);
- bool leftHanded = m_Flags.IsLeftHanded();
- m_LocalTransform = QT3DSMat44::createIdentity();
- m_GlobalTransform = m_LocalTransform;
- QT3DSF32 *writePtr = m_LocalTransform.front();
- QT3DSVec3 theScaledPivot(-m_Pivot[0] * m_Scale[0], -m_Pivot[1] * m_Scale[1],
- -m_Pivot[2] * m_Scale[2]);
- m_LocalTransform.column0[0] = m_Scale[0];
- m_LocalTransform.column1[1] = m_Scale[1];
- m_LocalTransform.column2[2] = m_Scale[2];
-
- writePtr[12] = theScaledPivot[0];
- writePtr[13] = theScaledPivot[1];
- if (leftHanded)
- writePtr[14] = theScaledPivot[2];
- else
- writePtr[14] = -theScaledPivot[2];
-
- QT3DSMat44 theRotationTransform;
- CalculateRotationMatrix(theRotationTransform);
- // may need column conversion in here somewhere.
- m_LocalTransform = theRotationTransform * m_LocalTransform;
-
- writePtr[12] += m_Position[0];
- writePtr[13] += m_Position[1];
- if (leftHanded)
- writePtr[14] = writePtr[14] + m_Position[2];
- else
- writePtr[14] = writePtr[14] - m_Position[2];
-
- if (leftHanded) {
- FlipCoordinateSystem(m_LocalTransform);
- }
-}
-
-void SNode::SetLocalTransformFromMatrix(QT3DSMat44 &inTransform)
-{
- m_Flags.SetTransformDirty(true);
-
- // clear pivot
- m_Pivot[0] = m_Pivot[1] = m_Pivot[2] = 0.0f;
-
- // set translation
- m_Position[0] = inTransform[3][0];
- m_Position[1] = inTransform[3][1];
- m_Position[2] = inTransform[3][2];
- // set scale
- m_Scale[0] = inTransform.column0.magnitude();
- m_Scale[1] = inTransform.column1.magnitude();
- m_Scale[2] = inTransform.column2.magnitude();
-
- // make sure there is no zero value
- m_Scale[0] = (m_Scale[0] == 0.0) ? 1.0f : m_Scale[0];
- m_Scale[1] = (m_Scale[1] == 0.0) ? 1.0f : m_Scale[1];
- m_Scale[2] = (m_Scale[2] == 0.0) ? 1.0f : m_Scale[2];
-
- // extract rotation by first dividing through scale value
- float invScaleX = 1.0f / m_Scale[0];
- float invScaleY = 1.0f / m_Scale[1];
- float invScaleZ = 1.0f / m_Scale[2];
-
- inTransform[0][0] *= invScaleX;
- inTransform[0][1] *= invScaleX;
- inTransform[0][2] *= invScaleX;
- inTransform[1][0] *= invScaleY;
- inTransform[1][1] *= invScaleY;
- inTransform[1][2] *= invScaleY;
- inTransform[2][0] *= invScaleZ;
- inTransform[2][1] *= invScaleZ;
- inTransform[2][2] *= invScaleZ;
-
- QT3DSMat33 theRotationMatrix(inTransform.column0.getXYZ(), inTransform.column1.getXYZ(),
- inTransform.column2.getXYZ());
- m_Rotation = GetRotationVectorFromRotationMatrix(theRotationMatrix);
-}
-
-void SNode::AddChild(SNode &inChild)
-{
- if (inChild.m_Parent)
- inChild.m_Parent->RemoveChild(inChild);
- inChild.m_Parent = this;
- if (m_FirstChild == nullptr) {
- m_FirstChild = &inChild;
- inChild.m_NextSibling = nullptr;
- inChild.m_PreviousSibling = nullptr;
- } else {
- SNode *lastChild = GetLastChild();
- if (lastChild) {
- lastChild->m_NextSibling = &inChild;
- inChild.m_PreviousSibling = lastChild;
- inChild.m_NextSibling = nullptr;
- } else {
- QT3DS_ASSERT(false); // no last child but first child isn't null?
- }
- }
-}
-
-void SNode::RemoveChild(SNode &inChild)
-{
- if (inChild.m_Parent != this) {
- QT3DS_ASSERT(false);
- return;
- }
- for (SNode *child = m_FirstChild; child; child = child->m_NextSibling) {
- if (child == &inChild) {
- if (child->m_PreviousSibling)
- child->m_PreviousSibling->m_NextSibling = child->m_NextSibling;
- if (child->m_NextSibling)
- child->m_NextSibling->m_PreviousSibling = child->m_PreviousSibling;
- child->m_Parent = NULL;
- if (m_FirstChild == child)
- m_FirstChild = child->m_NextSibling;
- child->m_NextSibling = NULL;
- child->m_PreviousSibling = NULL;
- return;
- }
- }
- QT3DS_ASSERT(false);
-}
-
-SNode *SNode::GetLastChild()
-{
- SNode *lastChild = NULL;
- // empty loop intentional
- for (lastChild = m_FirstChild; lastChild && lastChild->m_NextSibling;
- lastChild = lastChild->m_NextSibling) {
- }
- return lastChild;
-}
-
-void SNode::RemoveFromGraph()
-{
- if (m_Parent)
- m_Parent->RemoveChild(*this);
-
- m_NextSibling = NULL;
-
- // Orphan all of my children.
- SNode *nextSibling = NULL;
- for (SNode *child = m_FirstChild; child != NULL; child = nextSibling) {
- child->m_PreviousSibling = NULL;
- child->m_Parent = NULL;
- nextSibling = child->m_NextSibling;
- child->m_NextSibling = NULL;
- }
-}
-
-NVBounds3 SNode::GetBounds(IBufferManager &inManager, IPathManager &inPathManager,
- bool inIncludeChildren, IQt3DSRenderNodeFilter *inChildFilter) const
-{
- NVBounds3 retval;
- retval.setEmpty();
- if (inIncludeChildren)
- retval = GetChildBounds(inManager, inPathManager, inChildFilter);
-
- if (m_Type == GraphObjectTypes::Model)
- retval.include(static_cast<const SModel *>(this)->GetModelBounds(inManager));
- else if (m_Type == GraphObjectTypes::Text)
- retval.include(static_cast<const SText *>(this)->GetTextBounds());
- else if (m_Type == GraphObjectTypes::Path)
- retval.include(inPathManager.GetBounds(*static_cast<const SPath *>(this)));
- return retval;
-}
-
-NVBounds3 SNode::GetChildBounds(IBufferManager &inManager, IPathManager &inPathManager,
- IQt3DSRenderNodeFilter *inChildFilter) const
-{
- NVBounds3 retval;
- retval.setEmpty();
- for (SNode *child = m_FirstChild; child != NULL; child = child->m_NextSibling) {
- if (inChildFilter == NULL || inChildFilter->IncludeNode(*child)) {
- NVBounds3 childBounds;
- if (child->m_Flags.IsTransformDirty())
- child->CalculateLocalTransform();
- childBounds = child->GetBounds(inManager, inPathManager);
- if (childBounds.isEmpty() == false) {
- // Transform the bounds into our local space.
- childBounds.transform(child->m_LocalTransform);
- retval.include(childBounds);
- }
- }
- }
- return retval;
-}
-
-QT3DSVec3 SNode::GetGlobalPos() const
-{
- return m_GlobalTransform.getPosition();
-}
-
-QT3DSVec3 SNode::GetDirection() const
-{
- const QT3DSF32 *dataPtr(m_GlobalTransform.front());
- QT3DSVec3 retval(dataPtr[8], dataPtr[9], dataPtr[10]);
- retval.normalize();
- return retval;
-}
-
-QT3DSVec3 SNode::GetScalingCorrectDirection() const
-{
- QT3DSMat33 theDirMatrix(m_GlobalTransform.getUpper3x3().getInverse().getTranspose());
- QT3DSVec3 theOriginalDir(0, 0, -1);
- QT3DSVec3 retval = theDirMatrix.transform(theOriginalDir);
- retval.normalize();
- return retval;
-}
-
-QT3DSVec3 SNode::GetGlobalPivot() const
-{
- QT3DSVec3 retval(m_Position);
- retval.z *= -1;
-
- if (m_Parent && m_Parent->m_Type != GraphObjectTypes::Layer)
- return m_Parent->m_GlobalTransform.transform(retval);
-
- return retval;
-}
-
-void SNode::CalculateMVPAndNormalMatrix(const QT3DSMat44 &inViewProjection, QT3DSMat44 &outMVP,
- QT3DSMat33 &outNormalMatrix) const
-{
- outMVP = inViewProjection * m_GlobalTransform;
- CalculateNormalMatrix(outNormalMatrix);
-}
-
-void SNode::GetMatrixUpper3x3(QT3DSMat33 &outDest, const QT3DSMat44 &inSrc)
-{
- outDest.column0 = QT3DSVec3(inSrc.column0[0], inSrc.column0[1], inSrc.column0[2]);
- outDest.column1 = QT3DSVec3(inSrc.column1[0], inSrc.column1[1], inSrc.column1[2]);
- outDest.column2 = QT3DSVec3(inSrc.column2[0], inSrc.column2[1], inSrc.column2[2]);
-}
-
-void SNode::CalculateNormalMatrix(QT3DSMat33 &outNormalMatrix) const
-{
- GetMatrixUpper3x3(outNormalMatrix, m_GlobalTransform);
- outNormalMatrix = outNormalMatrix.getInverse().getTranspose();
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.h
deleted file mode 100644
index 87a1500c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderNode.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_NODE_H
-#define QT3DS_RENDER_NODE_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "foundation/Qt3DSMat44.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Qt3DSNoCopy.h"
-#include "Qt3DSRenderEulerAngles.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SModel;
- struct SLight;
- struct SCamera;
- struct SText;
- struct SNode;
- class IBufferManager;
-
- class INodeQueue
- {
- protected:
- virtual ~INodeQueue() {}
- public:
- virtual void Enqueue(SModel &inModel) = 0;
- virtual void Enqueue(SLight &inLight) = 0;
- virtual void Enqueue(SCamera &inCamera) = 0;
- // virtual void Enqueue( SText& inText ) = 0;
- };
-
- struct NodeFlagValues
- {
- enum Enum {
- Dirty = 1,
- TransformDirty = 1 << 1,
- Active = 1 << 2, ///< Is this exact object active
- LeftHanded = 1 << 3,
- Orthographic = 1 << 4,
- PointLight = 1 << 5,
- GlobalActive = 1 << 6, ///< set based in Active and if a parent is active.
- TextDirty = 1 << 7,
- LocallyPickable = 1 << 8,
- GloballyPickable = 1 << 9,
- LayerEnableDepthTest = 1 << 10,
- LayerRenderToTarget = 1 << 11, ///< Does this layer render to the normal render target,
- ///or is it offscreen-only
- ForceLayerOffscreen = 1 << 12, ///< Forces a layer to always use the offscreen rendering
- ///mechanism. This can be usefulf or caching purposes.
- IgnoreParentTransform = 1 << 13,
- LayerEnableDepthPrePass = 1 << 14, ///< True when we render a depth pass before
- };
- };
-
- struct NodeTransformDirtyFlag
- {
- enum Enum {
- TransformNotDirty,
- TransformIsDirty,
- };
- };
- struct NodeFlags : public NVFlags<NodeFlagValues::Enum, QT3DSU32>
- {
- NodeFlags()
- : NVFlags<NodeFlagValues::Enum, QT3DSU32>((QT3DSU32)0)
- {
- }
- void ClearOrSet(bool value, NodeFlagValues::Enum enumVal) { clearOrSet(value, enumVal); }
- void SetActive(bool value) { ClearOrSet(value, NodeFlagValues::Active); }
- bool IsActive() const { return this->operator&(NodeFlagValues::Active); }
-
- void SetGlobalActive(bool value) { ClearOrSet(value, NodeFlagValues::GlobalActive); }
- bool IsGloballyActive() const { return this->operator&(NodeFlagValues::GlobalActive); }
-
- void SetTransformDirty(bool value) { ClearOrSet(value, NodeFlagValues::TransformDirty); }
- bool IsTransformDirty() const { return this->operator&(NodeFlagValues::TransformDirty); }
-
- void SetDirty(bool value) { ClearOrSet(value, NodeFlagValues::Dirty); }
- bool IsDirty() const { return this->operator&(NodeFlagValues::Dirty); }
-
- bool IsLeftHanded() const { return this->operator&(NodeFlagValues::LeftHanded); }
- void SetLeftHanded(bool value) { ClearOrSet(value, NodeFlagValues::LeftHanded); }
-
- bool IsOrthographic() const { return this->operator&(NodeFlagValues::Orthographic); }
- void SetOrthographic(bool value) { ClearOrSet(value, NodeFlagValues::Orthographic); }
-
- bool IsPointLight() const { return this->operator&(NodeFlagValues::PointLight); }
- void SetPointLight(bool value) { ClearOrSet(value, NodeFlagValues::PointLight); }
-
- bool IsTextDirty() const { return this->operator&(NodeFlagValues::TextDirty); }
- void SetTextDirty(bool value) { ClearOrSet(value, NodeFlagValues::TextDirty); }
-
- bool IsLocallyPickable() const { return this->operator&(NodeFlagValues::LocallyPickable); }
- void SetLocallyPickable(bool value) { ClearOrSet(value, NodeFlagValues::LocallyPickable); }
-
- bool IsGloballyPickable() const
- {
- return this->operator&(NodeFlagValues::GloballyPickable);
- }
- void SetGloballyPickable(bool value)
- {
- ClearOrSet(value, NodeFlagValues::GloballyPickable);
- }
-
- bool IsLayerRenderToTarget() const
- {
- return this->operator&(NodeFlagValues::LayerRenderToTarget);
- }
- void SetLayerRenderToTarget(bool value)
- {
- ClearOrSet(value, NodeFlagValues::LayerRenderToTarget);
- }
-
- bool IsLayerEnableDepthTest() const
- {
- return this->operator&(NodeFlagValues::LayerEnableDepthTest);
- }
- void SetLayerEnableDepthTest(bool value)
- {
- ClearOrSet(value, NodeFlagValues::LayerEnableDepthTest);
- }
-
- bool IsForceLayerOffscreen() const
- {
- return this->operator&(NodeFlagValues::ForceLayerOffscreen);
- }
- void SetForceLayerOffscreen(bool value)
- {
- ClearOrSet(value, NodeFlagValues::ForceLayerOffscreen);
- }
-
- bool IsIgnoreParentTransform() const
- {
- return this->operator&(NodeFlagValues::IgnoreParentTransform);
- }
- void SetIgnoreParentTransform(bool value)
- {
- ClearOrSet(value, NodeFlagValues::IgnoreParentTransform);
- }
-
- bool IsLayerEnableDepthPrepass() const
- {
- return this->operator&(NodeFlagValues::LayerEnableDepthPrePass);
- }
- void SetLayerEnableDepthPrepass(bool value)
- {
- ClearOrSet(value, NodeFlagValues::LayerEnableDepthPrePass);
- }
- };
-
- struct QT3DS_AUTOTEST_EXPORT SNode : public SGraphObject
- {
- // changing any one of these means you have to
- // set this object dirty
- QT3DSVec3 m_Rotation; // Radians
- QT3DSVec3 m_Position;
- QT3DSVec3 m_Scale;
- QT3DSVec3 m_Pivot;
- QT3DSU32 m_RotationOrder; // UICEulerOrder::EulOrd, defaults YXZs
-
- // This only sets dirty, not transform dirty
- // Opacity of 1 means opaque, opacity of zero means transparent.
- QT3DSF32 m_LocalOpacity;
-
- // results of clearing dirty.
- NodeFlags m_Flags;
- // These end up right handed
- QT3DSMat44 m_LocalTransform;
- QT3DSMat44 m_GlobalTransform;
- QT3DSF32 m_GlobalOpacity;
- QT3DSI32 m_SkeletonId;
-
- // node graph members.
- SNode *m_Parent;
- SNode *m_NextSibling;
- SNode *m_PreviousSibling;
- SNode *m_FirstChild;
- // Property maintained solely by the render system.
- // Depth-first-search index assigned and maintained by render system.
- QT3DSU32 m_DFSIndex;
-
- SNode(GraphObjectTypes::Enum inType = GraphObjectTypes::Node);
- SNode(const SNode &inCloningObject, NVAllocatorCallback &inAllocator);
- ~SNode() {}
-
- // Sets this object dirty and walks down the graph setting all
- // children who are not dirty to be dirty.
- void MarkDirty(NodeTransformDirtyFlag::Enum inTransformDirty =
- NodeTransformDirtyFlag::TransformNotDirty);
-
- void AddChild(SNode &inChild);
- void RemoveChild(SNode &inChild);
- SNode *GetLastChild();
-
- // Remove this node from the graph.
- // It is no longer the the parent's child lists
- // and all of its children no longer have a parent
- // finally they are no longer siblings of each other.
- void RemoveFromGraph();
-
- // Calculate global transform and opacity
- // Walks up the graph ensure all parents are not dirty so they have
- // valid global transforms.
- bool CalculateGlobalVariables();
-
- // Given our rotation order and handedness, calculate the final rotation matrix
- // Only the upper 3x3 of this matrix is filled in.
- // If this object is left handed, then you need to call FlipCoordinateSystem
- // to get a result identical to the result produced in CalculateLocalTransform
- void CalculateRotationMatrix(QT3DSMat44 &outMatrix) const;
-
- // Get a rotation vector that would produce the given 3x.3 matrix.
- // Takes m_RotationOrder and m_Flags.IsLeftHandled into account.
- // Returns a rotation vector in radians.
- QT3DSVec3 GetRotationVectorFromRotationMatrix(const QT3DSMat33 &inMatrix) const;
-
- static QT3DSVec3 GetRotationVectorFromEulerAngles(const EulerAngles &inAngles);
-
- // Flip a matrix from left-handed to right-handed and vice versa
- static void FlipCoordinateSystem(QT3DSMat44 &ioMatrix);
-
- // Force the calculation of the local transform
- void CalculateLocalTransform();
-
- /**
- * @brief setup local tranform from a matrix.
- * This function decomposes a SRT matrix.
- * This will fail if this matrix contains non-affine transformations
- *
- * @param inTransform[in] input transformation
- *
- * @return true backend type
- */
- void SetLocalTransformFromMatrix(QT3DSMat44 &inTransform);
-
- // Get the bounds of us and our children in our local space.
- NVBounds3 GetBounds(IBufferManager &inManager, IPathManager &inPathManager,
- bool inIncludeChildren = true,
- IQt3DSRenderNodeFilter *inChildFilter = NULL) const;
- NVBounds3 GetChildBounds(IBufferManager &inManager, IPathManager &inPathManager,
- IQt3DSRenderNodeFilter *inChildFilter = NULL) const;
- // Assumes CalculateGlobalVariables has already been called.
- QT3DSVec3 GetGlobalPos() const;
- QT3DSVec3 GetGlobalPivot() const;
- // Pulls the 3rd column out of the global transform.
- QT3DSVec3 GetDirection() const;
- // Multiplies (0,0,-1) by the inverse transpose of the upper 3x3 of the global transform.
- // This is correct w/r/t to scaling and which the above getDirection is not.
- QT3DSVec3 GetScalingCorrectDirection() const;
-
- // outMVP and outNormalMatrix are returned ready to upload to openGL, meaning they are
- // row-major.
- void CalculateMVPAndNormalMatrix(const QT3DSMat44 &inViewProjection, QT3DSMat44 &outMVP,
- QT3DSMat33 &outNormalMatrix) const;
-
- // This should be in a utility file somewhere
- static void GetMatrixUpper3x3(QT3DSMat33 &inDest, const QT3DSMat44 &inSrc);
- void CalculateNormalMatrix(QT3DSMat33 &outNormalMatrix) const;
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_Parent);
- inRemapper.Remap(m_FirstChild);
- inRemapper.Remap(m_NextSibling);
- inRemapper.Remap(m_PreviousSibling);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.cpp
deleted file mode 100644
index bc637680..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderPathSubPath.h"
-
-using namespace qt3ds::render;
-
-void SPath::AddSubPath(SPathSubPath &inSegment)
-{
- SPathSubPath *lastSegment = NULL;
- inSegment.m_Path = this;
- inSegment.m_NextSubPath = NULL;
- if (m_FirstSubPath) {
- // find last segment
- for (lastSegment = m_FirstSubPath; lastSegment && lastSegment->m_NextSubPath;
- lastSegment = lastSegment->m_NextSubPath)
- ;
- lastSegment->m_NextSubPath = &inSegment;
- } else
- m_FirstSubPath = &inSegment;
-}
-
-void SPath::ClearSubPaths()
-{
- SPathSubPath *nextSegment = NULL;
- for (SPathSubPath *theSegment = m_FirstSubPath; theSegment; theSegment = nextSegment) {
- nextSegment = theSegment->m_NextSubPath;
- theSegment->m_Path = NULL;
- theSegment->m_NextSubPath = NULL;
- }
- m_FirstSubPath = NULL;
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.h
deleted file mode 100644
index 7db3ef50..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPath.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PATH_H
-#define QT3DS_RENDER_PATH_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderNode.h"
-
-namespace qt3ds {
-namespace render {
- struct PathCapping
- {
- enum Enum {
- Noner = 0,
- Taper = 1,
- };
- };
-
- struct PathTypes
- {
- enum Enum {
- Noner = 0,
- Painted,
- Geometry,
- };
- };
-
- struct PathPaintStyles
- {
- enum Enum {
- Noner = 0,
- FilledAndStroked,
- Filled,
- Stroked,
- };
- };
-
- struct SPath : public SNode
- {
- PathTypes::Enum m_PathType;
- QT3DSF32 m_Width;
- QT3DSF32 m_LinearError;
- QT3DSF32 m_EdgeTessAmount;
- QT3DSF32 m_InnerTessAmount;
- PathCapping::Enum m_BeginCapping;
- QT3DSF32 m_BeginCapOffset;
- QT3DSF32 m_BeginCapOpacity;
- QT3DSF32 m_BeginCapWidth;
- PathCapping::Enum m_EndCapping;
- QT3DSF32 m_EndCapOffset;
- QT3DSF32 m_EndCapOpacity;
- QT3DSF32 m_EndCapWidth;
- SGraphObject *m_Material;
- SGraphObject *m_SecondMaterial;
- // Paths can either be immediate - children attached define path
- // or they can link to a path buffer that defines the path.
- SPathSubPath *m_FirstSubPath;
- CRegisteredString m_PathBuffer;
- PathPaintStyles::Enum m_PaintStyle;
-
- bool m_WireframeMode;
- // Loaded onto the card just as data.
- SPath()
- : SNode(GraphObjectTypes::Path)
- , m_PathType(PathTypes::Geometry)
- , m_Width(5.0f)
- , m_LinearError(100.0f)
- , m_EdgeTessAmount(8.0f)
- , m_InnerTessAmount(1.0f)
- , m_BeginCapping(PathCapping::Noner)
- , m_BeginCapOffset(10.0f)
- , m_BeginCapOpacity(.2f)
- , m_BeginCapWidth(0.0f)
- , m_EndCapping(PathCapping::Noner)
- , m_EndCapOffset(10.0f)
- , m_EndCapOpacity(.2f)
- , m_EndCapWidth(0.0f)
- , m_Material(NULL)
- , m_SecondMaterial(NULL)
- , m_FirstSubPath(NULL)
- , m_PaintStyle(PathPaintStyles::Stroked)
- , m_WireframeMode(false)
- {
- }
-
- bool IsStroked() const
- {
- return m_PaintStyle == PathPaintStyles::Stroked
- || m_PaintStyle == PathPaintStyles::FilledAndStroked;
- }
-
- bool IsFilled() const
- {
- return m_PaintStyle == PathPaintStyles::Filled
- || m_PaintStyle == PathPaintStyles::FilledAndStroked;
- }
-
- void AddMaterial(SGraphObject *inMaterial)
- {
- if (m_Material == NULL)
- m_Material = inMaterial;
- else
- m_SecondMaterial = inMaterial;
- }
-
- void ClearMaterials()
- {
- m_Material = NULL;
- m_SecondMaterial = NULL;
- }
-
- void AddSubPath(SPathSubPath &inSubPath);
- void ClearSubPaths();
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SNode::Remap(inRemapper);
- inRemapper.Remap(m_PathBuffer);
- inRemapper.RemapMaterial(m_Material);
- inRemapper.RemapMaterial(m_SecondMaterial);
- inRemapper.Remap(m_FirstSubPath);
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPathSubPath.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPathSubPath.h
deleted file mode 100644
index ed1f9beb..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPathSubPath.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PATH_SEGMENT_H
-#define QT3DS_RENDER_PATH_SEGMENT_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-
-namespace qt3ds {
-namespace render {
- struct SPathSubPath : public SGraphObject
- {
- SPath *m_Path;
- SPathSubPath *m_NextSubPath;
- bool m_Closed;
-
- SPathSubPath()
- : SGraphObject(GraphObjectTypes::PathSubPath)
- , m_Path(NULL)
- , m_NextSubPath(NULL)
- , m_Closed(false)
- {
- }
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_Path);
- inRemapper.Remap(m_NextSubPath);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.cpp
deleted file mode 100644
index 6403959e..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderPresentation.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderContextCore.h"
-
-using namespace qt3ds::render;
-
-void SPresentation::Render(IQt3DSRenderContext &inContext)
-{
- if (m_Scene) {
- NVRenderRect theViewportSize(inContext.GetRenderContext().GetViewport());
- m_Scene->Render(QT3DSVec2((QT3DSF32)theViewportSize.m_Width, (QT3DSF32)theViewportSize.m_Height),
- inContext);
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.h
deleted file mode 100644
index 2403e3b8..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderPresentation.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PRESENTATION_H
-#define QT3DS_RENDER_PRESENTATION_H
-
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "Qt3DSRenderScene.h"
-#include "foundation/Qt3DSVec2.h"
-
-namespace qt3ds {
-namespace render {
-
- struct RenderRotationValues
- {
- enum Enum {
- NoRotation = 0,
- Clockwise90,
- Clockwise180,
- Clockwise270,
- };
- };
-
- struct SPresentation : public SGraphObject
- {
- QT3DSVec2 m_PresentationDimensions;
- RenderRotationValues::Enum m_PresentationRotation;
- bool m_preferKTX;
- SScene *m_Scene;
-
- CRegisteredString m_PresentationDirectory;
-
- SPresentation()
- : SGraphObject(GraphObjectTypes::Presentation)
- , m_PresentationDimensions(800, 400)
- , m_PresentationRotation(RenderRotationValues::NoRotation)
- , m_preferKTX(false)
- , m_Scene(NULL)
- {
- }
-
- SPresentation(QT3DSF32 w, QT3DSF32 h, bool preferKTX, CRegisteredString presDir)
- : SGraphObject(GraphObjectTypes::Presentation)
- , m_PresentationDimensions(w, h)
- , m_PresentationRotation(RenderRotationValues::NoRotation)
- , m_preferKTX(preferKTX)
- , m_Scene(NULL)
- , m_PresentationDirectory(presDir)
- {
- }
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_Scene);
- inRemapper.Remap(m_PresentationDirectory);
- }
-
- void Render(IQt3DSRenderContext &inContext);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderReferencedMaterial.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderReferencedMaterial.h
deleted file mode 100644
index d2043f0d..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderReferencedMaterial.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_REFERENCED_MATERIAL_H
-#define QT3DS_RENDER_REFERENCED_MATERIAL_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderGraphObject.h"
-#include "Qt3DSRenderMaterialDirty.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SReferencedMaterial : SGraphObject
- {
- CMaterialDirty m_Dirty;
- SGraphObject *m_ReferencedMaterial;
- SGraphObject *m_NextSibling;
- SReferencedMaterial()
- : SGraphObject(GraphObjectTypes::ReferencedMaterial)
- , m_ReferencedMaterial(NULL)
- , m_NextSibling(NULL)
- {
- }
-
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.RemapMaterial(m_ReferencedMaterial);
- inRemapper.RemapMaterial(m_NextSibling);
- }
- };
-}
-}
-
-#endif // QT3DS_RENDER_REFERENCED_MATERIAL_H
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp
deleted file mode 100644
index 7917bd7a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderContextCore.h"
-#include "render/Qt3DSRenderContext.h"
-
-using namespace qt3ds::render;
-
-SScene::SScene()
- : SGraphObject(GraphObjectTypes::Scene)
- , m_Presentation(NULL)
- , m_FirstChild(NULL)
- , m_ClearColor(0.0f)
- , m_UseClearColor(true)
- , m_Dirty(true)
-{
-}
-
-void SScene::AddChild(SLayer &inLayer)
-{
- if (m_FirstChild == NULL)
- m_FirstChild = &inLayer;
- else
- GetLastChild()->m_NextSibling = &inLayer;
- inLayer.m_Scene = this;
-}
-
-SLayer *SScene::GetLastChild()
-{
- // empty loop intentional
- SLayer *child;
- for (child = m_FirstChild; child && child->m_NextSibling;
- child = (SLayer *)child->m_NextSibling) {
- }
-
- return child;
-}
-
-bool SScene::PrepareForRender(const QT3DSVec2 &inViewportDimensions, IQt3DSRenderContext &inContext,
- const SRenderInstanceId id)
-{
- // We need to iterate through the layers in reverse order and ask them to render.
- bool wasDirty = m_Dirty;
- m_Dirty = false;
- if (m_FirstChild) {
- wasDirty |=
- inContext.GetRenderer().PrepareLayerForRender(*m_FirstChild, inViewportDimensions,
- true, id);
- }
- return wasDirty;
-}
-
-void SScene::Render(const QT3DSVec2 &inViewportDimensions, IQt3DSRenderContext &inContext,
- RenderClearCommand inClearColorBuffer, const SRenderInstanceId id)
-{
- if ((inClearColorBuffer == SScene::ClearIsOptional && m_UseClearColor)
- || inClearColorBuffer == SScene::AlwaysClear) {
- QT3DSF32 clearColorAlpha
- = inContext.IsInSubPresentation() && !m_UseClearColor ? 0.0f : 1.0f;
- QT3DSVec4 clearColor(0.0f, 0.0f, 0.0f, clearColorAlpha);
- if (m_UseClearColor) {
- clearColor.x = m_ClearColor.x;
- clearColor.y = m_ClearColor.y;
- clearColor.z = m_ClearColor.z;
- clearColor.w = m_ClearColor.w;
- }
- // Maybe clear and reset to previous clear color after we leave.
- qt3ds::render::NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- inContext.GetRenderContext(), &NVRenderContext::GetClearColor,
- &NVRenderContext::SetClearColor, clearColor);
- inContext.GetRenderContext().Clear(qt3ds::render::NVRenderClearValues::Color);
- }
- if (m_FirstChild) {
- inContext.GetRenderer().RenderLayer(*m_FirstChild, inViewportDimensions, m_UseClearColor,
- m_ClearColor, true, id);
- }
-}
-void SScene::RenderWithClear(const QT3DSVec2 &inViewportDimensions,
- IQt3DSRenderContext &inContext,
- RenderClearCommand inClearColorBuffer,
- QT3DSVec4 inClearColor,
- const SRenderInstanceId id)
-{
- // If this scene is not using clear color, we set the color
- // to background color from parent layer. This allows
- // fully transparent subpresentations (both scene and layer(s) transparent)
- // to inherit color from the layer that contains them.
- if (!m_UseClearColor) {
- m_ClearColor = inClearColor;
- m_UseClearColor = true;
- }
- Render(inViewportDimensions, inContext, inClearColorBuffer, id);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.h
deleted file mode 100644
index 8c4d3fec..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderScene.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SCENE_H
-#define QT3DS_RENDER_SCENE_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSVec4.h"
-#include "Qt3DSRenderGraphObject.h"
-
-namespace qt3ds {
-namespace render {
- struct SLayer;
- struct SPresentation;
- typedef void *SRenderInstanceId;
-
- struct SScene : public SGraphObject
- {
- SPresentation *m_Presentation;
- SLayer *m_FirstChild;
- QT3DSVec4 m_ClearColor;
- bool m_UseClearColor;
- bool m_Dirty;
-
- enum RenderClearCommand {
- ClearIsOptional = 0,
- DoNotClear = 1,
- AlwaysClear = 2,
- };
-
- SScene();
-
- void AddChild(SLayer &inLayer);
- SLayer *GetLastChild();
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SGraphObject::Remap(inRemapper);
- inRemapper.Remap(m_Presentation);
- inRemapper.Remap(m_FirstChild);
- }
- // returns true if any of the layers were dirty or if this object was dirty
- bool PrepareForRender(const QT3DSVec2 &inViewportDimensions, IQt3DSRenderContext &inContext,
- const SRenderInstanceId id = nullptr);
- void Render(const QT3DSVec2 &inViewportDimensions, IQt3DSRenderContext &inContext,
- RenderClearCommand command = ClearIsOptional,
- const SRenderInstanceId id = nullptr);
- void RenderWithClear(const QT3DSVec2 &inViewportDimensions, IQt3DSRenderContext &inContext,
- RenderClearCommand inClearColorBuffer,
- QT3DSVec4 inclearColor, const SRenderInstanceId id = nullptr);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.cpp b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.cpp
deleted file mode 100644
index 40a20c48..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderText.h"
-
-using namespace qt3ds::render;
-
-STextRenderInfo::STextRenderInfo()
- : m_FontSize(24)
- , m_HorizontalAlignment(TextHorizontalAlignment::Center)
- , m_VerticalAlignment(TextVerticalAlignment::Middle)
- , m_Leading(0)
- , m_Tracking(0)
- , m_DropShadow(false)
- , m_DropShadowStrength(80)
- , m_DropShadowOffsetX(0)
- , m_DropShadowOffsetY(0)
- , m_WordWrap(TextWordWrap::WrapWord)
- , m_BoundingBox(QT3DSVec2(0 ,0))
- , m_Elide(TextElide::ElideNone)
- , m_ScaleX(0)
- , m_ScaleY(0)
- , m_EnableAcceleratedFont(false)
-{
-}
-
-STextRenderInfo::~STextRenderInfo()
-{
-}
-
-SText::SText()
- : SNode(GraphObjectTypes::Text)
- , m_TextColor(1, 1, 1, 1)
- , m_TextTexture(nullptr)
-{
- m_Bounds.setEmpty();
-}
-
-NVBounds3 SText::GetTextBounds() const
-{
- return m_Bounds;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.h b/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.h
deleted file mode 100644
index 13f5748a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/graphobjects/Qt3DSRenderText.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_TEXT_H
-#define QT3DS_RENDER_TEXT_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderNode.h"
-#include "Qt3DSRenderTextTypes.h"
-
-namespace qt3ds {
-namespace render {
-
- struct SText : public SNode, public STextRenderInfo
- {
- // Change any of these properties and you can expect
- // that the text will force an expensive re-layer and render.
- // For these you need to set TextDirty.
-
- // These properties can change every frame with no additional cost.
- QT3DSVec4 m_TextColor;
- // Setup and utilized by the rendering system
- NVRenderTexture2D *m_TextTexture;
- STextTextureDetails m_TextTextureDetails;
- // used for nv path rendering
- NVRenderPathFontItem *m_PathFontItem;
- NVRenderPathFontSpecification *m_PathFontDetails;
-
- NVBounds3 m_Bounds;
-
- SText();
-
- NVBounds3 GetTextBounds() const;
-
- // Generic method used during serialization
- // to remap string and object pointers
- template <typename TRemapperType>
- void Remap(TRemapperType &inRemapper)
- {
- SNode::Remap(inRemapper);
- inRemapper.Remap(m_Text);
- inRemapper.Remap(m_Font);
- inRemapper.NullPtr(m_TextTexture);
- inRemapper.NullPtr(m_PathFontItem);
- inRemapper.NullPtr(m_PathFontDetails);
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/linux/DynamicLibLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/linux/DynamicLibLoader.h
deleted file mode 100644
index cc5d077c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/linux/DynamicLibLoader.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_LINUX_DYNAMIC_LIB_LOADER_H
-#define QT3DS_LINUX_DYNAMIC_LIB_LOADER_H
-#include <dlfcn.h>
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-
-namespace qt3ds {
-namespace render {
- using namespace qt3ds;
- using namespace qt3ds::render;
-
- class CLoadedDynamicLibrary
- {
- void *m_DLLHandle;
- CLoadedDynamicLibrary(void *hdl)
- : m_DLLHandle(hdl)
- {
- }
- CLoadedDynamicLibrary(const CLoadedDynamicLibrary &);
- CLoadedDynamicLibrary &operator=(const CLoadedDynamicLibrary &);
-
- public:
- ~CLoadedDynamicLibrary()
- {
- if (m_DLLHandle)
- {
-#ifndef _INTEGRITYPLATFORM
- ::dlclose(m_DLLHandle);
-#endif
- }
- m_DLLHandle = 0;
- }
- void *FindFunction(const char *name)
- {
-#ifndef _INTEGRITYPLATFORM
- return ::dlsym(m_DLLHandle, name);
-#else
- qWarning() << "CLoadedDynamicLibrary::FindFunction returns NULL!";
- return NULL;
-#endif
- }
- static CLoadedDynamicLibrary *Create(const char *inFullDllPath, NVFoundationBase &fnd)
- {
-#ifndef _INTEGRITYPLATFORM
- void *hdl = ::dlopen(inFullDllPath, RTLD_NOW);
- if (hdl == 0) {
- const char *error = ::dlerror();
- qCCritical(INVALID_OPERATION, "Failed to load dynamic library %s: %s",
- inFullDllPath, error);
- return NULL;
- }
- return QT3DS_NEW(fnd.getAllocator(), CLoadedDynamicLibrary)(hdl);
-#else
- qWarning() << "CLoadedDynamicLibrary::Create returns NULL!";
- return NULL;
-#endif
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/macos/DynamicLibLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/macos/DynamicLibLoader.h
deleted file mode 100644
index c968419a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/macos/DynamicLibLoader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "linux/DynamicLibLoader.h"
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.cpp b/src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.cpp
deleted file mode 100644
index f1bdd4d9..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "q3dsqmlrender.h"
-#include "q3dsqmlstreamservice.h"
-#include "render/Qt3DSRenderContext.h"
-
-#include <QSize>
-#include <QOpenGLContext>
-
-Q3DSQmlRender::Q3DSQmlRender(IQt3DSRenderContext &inRenderContext, const char *asset)
- : m_RenderContext(inRenderContext)
- , m_qmlStreamRenderer(nullptr)
- , m_offscreenRenderType(inRenderContext.GetStringTable().RegisterStr(GetRendererName()))
- , m_assetString(inRenderContext.GetStringTable().RegisterStr(asset))
- , m_callback(nullptr)
- , mRefCount(0)
-{
-
-}
-
-Q3DSQmlRender::~Q3DSQmlRender()
-{
- m_qmlStreamRenderer =
- IQ3DSQmlStreamService::getQmlStreamService()->getRenderer(m_assetString.c_str());
- if (m_qmlStreamRenderer)
- m_qmlStreamRenderer->uninitialize();
-}
-
-CRegisteredString Q3DSQmlRender::GetOffscreenRendererType()
-{
- return m_offscreenRenderType;
-}
-
-NVRenderTextureFormats::Enum convertTextureFormat(E_TEXTURE_FORMAT fmt)
-{
- NVRenderTextureFormats::Enum ret;
-
- switch (fmt) {
- case E_TEXTURE_RGBA8:
- ret = NVRenderTextureFormats::RGBA8;
- break;
- default:
- ret = NVRenderTextureFormats::Unknown;
- break;
- }
-
- return ret;
-}
-
-SOffscreenRendererEnvironment Q3DSQmlRender::GetDesiredEnvironment(QT3DSVec2 inPresScale)
-{
- QSize size(0, 0);
- E_TEXTURE_FORMAT format = E_TEXTURE_UNKNOWN;
-
- if (!m_qmlStreamRenderer)
- initializeRenderer();
-
- if (m_qmlStreamRenderer) {
- size = m_qmlStreamRenderer->getDesiredSize();
- format = m_qmlStreamRenderer->getDesiredFormat();
- }
- return SOffscreenRendererEnvironment(
- (QT3DSU32)(size.width() * inPresScale.x), (QT3DSU32)(size.height() * inPresScale.y),
- convertTextureFormat(format), OffscreenRendererDepthValues::Depth24, false,
- AAModeValues::NoAA);
-}
-
-SOffscreenRenderFlags Q3DSQmlRender::NeedsRender(const SOffscreenRendererEnvironment &inEnvironment,
- QT3DSVec2 inPresentationScaleFactor,
- const SRenderInstanceId instanceId)
-{
- Q_UNUSED(inEnvironment);
- Q_UNUSED(inPresentationScaleFactor);
- Q_UNUSED(instanceId);
- bool render = false;
- if (!m_qmlStreamRenderer)
- initializeRenderer();
- if (m_qmlStreamRenderer)
- render = m_qmlStreamRenderer->isUpdateRequested();
- return SOffscreenRenderFlags(false, render);
-}
-
-void Q3DSQmlRender::Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresentationScaleFactor,
- SScene::RenderClearCommand inColorBufferNeedsClear,
- const SRenderInstanceId instanceId)
-{
- Q_UNUSED(inEnvironment)
- Q_UNUSED(inPresentationScaleFactor)
- Q_UNUSED(inColorBufferNeedsClear)
- Q_UNUSED(instanceId)
- if (m_qmlStreamRenderer) {
- inRenderContext.PushPropertySet();
-
- m_qmlStreamRenderer->render();
-
- inRenderContext.PopPropertySet(true);
-
- if (m_callback)
- m_callback->onOffscreenRendererFrame(QString(m_assetString.c_str()));
- }
-}
-
-void Q3DSQmlRender::initializeRenderer()
-{
- m_qmlStreamRenderer
- = IQ3DSQmlStreamService::getQmlStreamService()->getRenderer(m_assetString.c_str());
- if (m_qmlStreamRenderer) {
- if (!m_qmlStreamRenderer->initialize(
- QT_PREPEND_NAMESPACE(QOpenGLContext)::currentContext(),
- QT_PREPEND_NAMESPACE(QOpenGLContext)::currentContext()->surface())) {
- m_qmlStreamRenderer = nullptr;
- } else if (m_callback) {
- m_callback->onOffscreenRendererInitialized(QString(m_assetString.c_str()));
- }
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.h b/src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.h
deleted file mode 100644
index 99b395de..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/q3dsqmlrender.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_QML_RENDER_H
-#define QT3DS_QML_RENDER_H
-
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSRenderContextCore.h"
-
-class IQt3DS;
-
-using namespace qt3ds::render;
-
-class IQ3DSQmlStreamService;
-class IQ3DSQmlStreamRenderer;
-
-class Q3DSQmlRender : public IOffscreenRenderer
-{
-public:
- Q3DSQmlRender(IQt3DSRenderContext &inRenderContext, const char *asset);
- ~Q3DSQmlRender();
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext.GetAllocator())
-
- CRegisteredString GetOffscreenRendererType() override;
-
- SOffscreenRendererEnvironment GetDesiredEnvironment(QT3DSVec2 inPresentationScaleFactor) override;
-
- // Returns true of this object needs to be rendered, false if this object is not dirty
- SOffscreenRenderFlags NeedsRender(const SOffscreenRendererEnvironment &inEnvironment,
- QT3DSVec2 inPresentationScaleFactor,
- const SRenderInstanceId instanceId) override;
-
- void Render(const SOffscreenRendererEnvironment &inEnvironment,
- NVRenderContext &inRenderContext, QT3DSVec2 inPresentationScaleFactor,
- SScene::RenderClearCommand inColorBufferNeedsClear,
- const SRenderInstanceId instanceId) override;
- void RenderWithClear(const SOffscreenRendererEnvironment &/*inEnvironment*/,
- NVRenderContext &/*inRenderContext*/,
- QT3DSVec2 /*inPresentationScaleFactor*/,
- SScene::RenderClearCommand /*inColorBufferNeedsClear*/,
- QT3DSVec4 /*inclearColor*/,
- const SRenderInstanceId /*instanceId*/) override {}
-
- IGraphObjectPickQuery *GetGraphObjectPickQuery(const SRenderInstanceId instanceId) override
- {
- Q_UNUSED(instanceId)
- return nullptr;
- }
- bool Pick(const QT3DSVec2 &inMouseCoords, const QT3DSVec2 &inViewportDimensions,
- const SRenderInstanceId instanceId) override
- {
- Q_UNUSED(inMouseCoords)
- Q_UNUSED(inViewportDimensions)
- Q_UNUSED(instanceId)
- return false;
- }
- void addCallback(IOffscreenRendererCallback *cb) override
- {
- m_callback = cb;
- }
- static const char *GetRendererName() { return "qml-render"; }
-private:
-
- void initializeRenderer();
-
- IQt3DSRenderContext &m_RenderContext;
- IQ3DSQmlStreamRenderer *m_qmlStreamRenderer;
- CRegisteredString m_offscreenRenderType;
- CRegisteredString m_assetString;
- IOffscreenRendererCallback *m_callback;
- volatile QT3DSI32 mRefCount;
-};
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/qnx/DynamicLibLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/qnx/DynamicLibLoader.h
deleted file mode 100644
index c968419a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/qnx/DynamicLibLoader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "linux/DynamicLibLoader.h"
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.cpp b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.cpp
deleted file mode 100644
index fff7e32f..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.cpp
+++ /dev/null
@@ -1,543 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderableObjects.h"
-#include "Qt3DSRendererImpl.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderCustomMaterialRenderContext.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderPathManager.h"
-#include "Qt3DSRenderPathRenderContext.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-
-using qt3ds::foundation::CRegisteredString;
-
-namespace qt3ds {
-namespace render {
- struct SRenderableImage;
- struct SShaderGeneratorGeneratedShader;
- struct SSubsetRenderable;
- using eastl::make_pair;
- using eastl::reverse;
-
- STextScaleAndOffset::STextScaleAndOffset(NVRenderTexture2D &inTexture,
- const STextTextureDetails &inTextDetails,
- const STextRenderInfo &inInfo)
- : m_TextOffset(0, 0)
- , m_TextScale(1, 1)
-
- {
- NVRenderTexture2D &theTexture = inTexture;
- STextureDetails theDetails(theTexture.GetTextureDetails());
- QT3DSVec2 textDimensions(inTextDetails.m_TextWidth / 2.0f, inTextDetails.m_TextHeight / 2.0f);
- textDimensions.x /= inTextDetails.m_ScaleFactor.x;
- textDimensions.y /= inTextDetails.m_ScaleFactor.y;
- QT3DSVec2 theTextScale(textDimensions.x, textDimensions.y);
- QT3DSVec2 theTextOffset(0, 0);
-
- // Set the offsets to use after scaling the rect coordinates.
- switch (inInfo.m_HorizontalAlignment) {
- case TextHorizontalAlignment::Left:
- theTextOffset[0] = theTextScale[0];
- break;
- case TextHorizontalAlignment::Center:
- break;
- case TextHorizontalAlignment::Right:
- theTextOffset[0] = -theTextScale[0];
- break;
- default:
- break;
- }
-
- switch (inInfo.m_VerticalAlignment) {
- case TextVerticalAlignment::Top:
- theTextOffset[1] = -theTextScale[1];
- break;
- case TextVerticalAlignment::Middle:
- break;
- case TextVerticalAlignment::Bottom:
- theTextOffset[1] = theTextScale[1];
- break;
- default:
- break;
- }
- m_TextScale = theTextScale;
- m_TextOffset = theTextOffset;
- }
-
- void SSubsetRenderableBase::RenderShadowMapPass(const QT3DSVec2 &inCameraVec,
- const SLight *inLight, const SCamera &inCamera,
- SShadowMapEntry *inShadowMapEntry)
- {
- NVRenderContext &context(m_Generator.GetContext());
- SRenderableDepthPrepassShader *shader = NULL;
- NVRenderInputAssembler *pIA = NULL;
-
- /*
- if ( inLight->m_LightType == RenderLightTypes::Area )
- shader = m_Generator.GetParaboloidDepthShader( m_TessellationMode );
- else if ( inLight->m_LightType == RenderLightTypes::Directional )
- shader = m_Generator.GetOrthographicDepthShader( m_TessellationMode );
- else if ( inLight->m_LightType == RenderLightTypes::Point )
- shader = m_Generator.GetCubeShadowDepthShader( m_TessellationMode ); // This
- will change to include a geometry shader pass.
- */
-
- if (inLight->m_LightType == RenderLightTypes::Directional)
- shader = m_Generator.GetOrthographicDepthShader(m_TessellationMode);
- else
- shader = m_Generator.GetCubeShadowDepthShader(m_TessellationMode);
-
- if (shader == NULL || inShadowMapEntry == NULL)
- return;
-
- // for phong and npatch tesselleation we need the normals too
- if (m_TessellationMode == TessModeValues::NoTess
- || m_TessellationMode == TessModeValues::TessLinear)
- pIA = m_Subset.m_InputAssemblerDepth;
- else
- pIA = m_Subset.m_InputAssembler;
-
- QT3DSMat44 theModelViewProjection = inShadowMapEntry->m_LightVP * m_GlobalTransform;
- // QT3DSMat44 theModelView = inLight->m_GlobalTransform.getInverse() * m_GlobalTransform;
-
- context.SetActiveShader(&shader->m_Shader);
- shader->m_MVP.Set(theModelViewProjection);
- shader->m_CameraPosition.Set(inCamera.m_Position);
- shader->m_GlobalTransform.Set(m_GlobalTransform);
- shader->m_CameraProperties.Set(inCameraVec);
- /*
- shader->m_CameraDirection.Set( inCamera.GetDirection() );
-
- shader->m_ShadowMV[0].Set( inShadowMapEntry->m_LightCubeView[0] * m_GlobalTransform );
- shader->m_ShadowMV[1].Set( inShadowMapEntry->m_LightCubeView[1] * m_GlobalTransform );
- shader->m_ShadowMV[2].Set( inShadowMapEntry->m_LightCubeView[2] * m_GlobalTransform );
- shader->m_ShadowMV[3].Set( inShadowMapEntry->m_LightCubeView[3] * m_GlobalTransform );
- shader->m_ShadowMV[4].Set( inShadowMapEntry->m_LightCubeView[4] * m_GlobalTransform );
- shader->m_ShadowMV[5].Set( inShadowMapEntry->m_LightCubeView[5] * m_GlobalTransform );
- shader->m_Projection.Set( inCamera.m_Projection );
- */
-
- // tesselation
- if (m_TessellationMode != TessModeValues::NoTess) {
- // set uniforms we need
- shader->m_Tessellation.m_EdgeTessLevel.Set(m_Subset.m_EdgeTessFactor);
- shader->m_Tessellation.m_InsideTessLevel.Set(m_Subset.m_InnerTessFactor);
- // the blend value is hardcoded
- shader->m_Tessellation.m_PhongBlend.Set(0.75);
- // set distance range value
- shader->m_Tessellation.m_DistanceRange.Set(inCameraVec);
- // disable culling
- shader->m_Tessellation.m_DisableCulling.Set(1.0);
- }
-
- context.SetInputAssembler(pIA);
- context.Draw(m_Subset.m_PrimitiveType, m_Subset.m_Count, m_Subset.m_Offset);
- }
-
- void SSubsetRenderableBase::RenderDepthPass(const QT3DSVec2 &inCameraVec,
- SRenderableImage *inDisplacementImage,
- float inDisplacementAmount)
- {
- NVRenderContext &context(m_Generator.GetContext());
- SRenderableDepthPrepassShader *shader = NULL;
- NVRenderInputAssembler *pIA = NULL;
- SRenderableImage *displacementImage = inDisplacementImage;
-
- if (m_Subset.m_PrimitiveType != NVRenderDrawMode::Patches)
- shader = m_Generator.GetDepthPrepassShader(displacementImage != NULL);
- else
- shader = m_Generator.GetDepthTessPrepassShader(m_TessellationMode,
- displacementImage != NULL);
-
- if (shader == NULL)
- return;
-
- // for phong and npatch tesselleation or displacement mapping we need the normals (and uv's)
- // too
- if ((m_TessellationMode == TessModeValues::NoTess
- || m_TessellationMode == TessModeValues::TessLinear)
- && !displacementImage)
- pIA = m_Subset.m_InputAssemblerDepth;
- else
- pIA = m_Subset.m_InputAssembler;
-
- context.SetActiveShader(&shader->m_Shader);
- context.SetCullingEnabled(true);
-
- shader->m_MVP.Set(m_ModelContext.m_ModelViewProjection);
-
- if (displacementImage) {
- // setup image transform
- const QT3DSMat44 &textureTransform = displacementImage->m_Image.m_TextureTransform;
- const QT3DSF32 *dataPtr(textureTransform.front());
- QT3DSVec3 offsets(dataPtr[12], dataPtr[13],
- displacementImage->m_Image.m_TextureData.m_TextureFlags.IsPreMultiplied()
- ? 1.0f
- : 0.0f);
- QT3DSVec4 rotations(dataPtr[0], dataPtr[4], dataPtr[1], dataPtr[5]);
- displacementImage->m_Image.m_TextureData.m_Texture->SetTextureWrapS(
- displacementImage->m_Image.m_HorizontalTilingMode);
- displacementImage->m_Image.m_TextureData.m_Texture->SetTextureWrapT(
- displacementImage->m_Image.m_VerticalTilingMode);
-
- shader->m_DisplaceAmount.Set(inDisplacementAmount);
- shader->m_DisplacementProps.m_Offsets.Set(offsets);
- shader->m_DisplacementProps.m_Rotations.Set(rotations);
- shader->m_DisplacementProps.m_Sampler.Set(
- displacementImage->m_Image.m_TextureData.m_Texture);
- }
-
- // tesselation
- if (m_TessellationMode != TessModeValues::NoTess) {
- // set uniforms we need
- shader->m_GlobalTransform.Set(m_GlobalTransform);
-
- if (m_Generator.GetLayerRenderData() && m_Generator.GetLayerRenderData()->m_Camera)
- shader->m_CameraPosition.Set(
- m_Generator.GetLayerRenderData()->m_Camera->GetGlobalPos());
- else if (m_Generator.GetLayerRenderData()->m_Camera)
- shader->m_CameraPosition.Set(QT3DSVec3(0.0, 0.0, 1.0));
-
- shader->m_Tessellation.m_EdgeTessLevel.Set(m_Subset.m_EdgeTessFactor);
- shader->m_Tessellation.m_InsideTessLevel.Set(m_Subset.m_InnerTessFactor);
- // the blend value is hardcoded
- shader->m_Tessellation.m_PhongBlend.Set(0.75);
- // set distance range value
- shader->m_Tessellation.m_DistanceRange.Set(inCameraVec);
- // enable culling
- shader->m_Tessellation.m_DisableCulling.Set(0.0);
- }
-
- context.SetInputAssembler(pIA);
- context.Draw(m_Subset.m_PrimitiveType, m_Subset.m_Count, m_Subset.m_Offset);
- }
-
- // An interface to the shader generator that is available to the renderables
-
- void SSubsetRenderable::Render(const QT3DSVec2 &inCameraVec, TShaderFeatureSet inFeatureSet)
- {
- NVRenderContext &context(m_Generator.GetContext());
-
- SShaderGeneratorGeneratedShader *shader = m_Generator.GetShader(*this, inFeatureSet);
- if (shader == NULL)
- return;
-
- context.SetActiveShader(&shader->m_Shader);
-
- m_Generator.GetQt3DSContext().GetDefaultMaterialShaderGenerator().SetMaterialProperties(
- shader->m_Shader, m_Material, inCameraVec, m_ModelContext.m_ModelViewProjection,
- m_ModelContext.m_NormalMatrix, m_ModelContext.m_Model.m_GlobalTransform, m_FirstImage,
- m_Opacity, m_Generator.GetLayerGlobalRenderProperties());
-
- // tesselation
- if (m_Subset.m_PrimitiveType == NVRenderDrawMode::Patches) {
- shader->m_Tessellation.m_EdgeTessLevel.Set(m_Subset.m_EdgeTessFactor);
- shader->m_Tessellation.m_InsideTessLevel.Set(m_Subset.m_InnerTessFactor);
- // the blend value is hardcoded
- shader->m_Tessellation.m_PhongBlend.Set(0.75);
- // this should finally be based on some user input
- shader->m_Tessellation.m_DistanceRange.Set(inCameraVec);
- // enable culling
- shader->m_Tessellation.m_DisableCulling.Set(0.0);
-
- if (m_Subset.m_WireframeMode) {
- // we need the viewport matrix
- NVRenderRect theViewport(context.GetViewport());
- QT3DSMat44 vpMatrix;
- vpMatrix.column0 = QT3DSVec4((float)theViewport.m_Width / 2.0f, 0.0, 0.0, 0.0);
- vpMatrix.column1 = QT3DSVec4(0.0, (float)theViewport.m_Height / 2.0f, 0.0, 0.0);
- vpMatrix.column2 = QT3DSVec4(0.0, 0.0, 1.0, 0.0);
- vpMatrix.column3 =
- QT3DSVec4((float)theViewport.m_Width / 2.0f + (float)theViewport.m_X,
- (float)theViewport.m_Height / 2.0f + (float)theViewport.m_Y, 0.0, 1.0);
-
- shader->m_ViewportMatrix.Set(vpMatrix);
- }
- }
-
- context.SetCullingEnabled(true);
- context.SetInputAssembler(m_Subset.m_InputAssembler);
- context.Draw(m_Subset.m_PrimitiveType, m_Subset.m_Count, m_Subset.m_Offset);
- }
-
- void SSubsetRenderable::RenderDepthPass(const QT3DSVec2 &inCameraVec)
- {
- SRenderableImage *displacementImage = NULL;
- for (SRenderableImage *theImage = m_FirstImage;
- theImage != NULL && displacementImage == NULL; theImage = theImage->m_NextImage) {
- if (theImage->m_MapType == ImageMapTypes::Displacement)
- displacementImage = theImage;
- }
- SSubsetRenderableBase::RenderDepthPass(inCameraVec, displacementImage,
- m_Material.m_DisplaceAmount);
- }
-
- void STextRenderable::Render(const QT3DSVec2 &inCameraVec)
- {
- NVRenderContext &context(m_Generator.GetContext());
-
- if (!m_Text.m_PathFontDetails) {
-
- STextRenderHelper theInfo = m_Generator.GetShader(*this, false);
- if (theInfo.m_Shader == NULL)
- return;
- // All of our shaders produce premultiplied values.
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha);
-
- qt3ds::render::NVRenderBlendEquationArgument blendEqu(NVRenderBlendEquation::Add,
- NVRenderBlendEquation::Add);
-
- context.SetBlendFunction(blendFunc);
- context.SetBlendEquation(blendEqu);
- QT3DSVec4 theColor(m_Text.m_TextColor.x, m_Text.m_TextColor.y, m_Text.m_TextColor.z,
- m_Text.m_GlobalOpacity);
-
- STextShader &shader(*theInfo.m_Shader);
- shader.Render(*m_Text.m_TextTexture, *this, theColor, m_ModelViewProjection,
- inCameraVec, context, theInfo.m_QuadInputAssembler,
- theInfo.m_QuadInputAssembler.GetIndexCount(), m_Text.m_TextTextureDetails,
- QT3DSVec3(0, 0, 0));
- } else {
- QT3DS_ASSERT(context.IsPathRenderingSupported() && context.IsProgramPipelineSupported());
-
- STextRenderHelper theInfo = m_Generator.GetShader(*this, true);
- if (theInfo.m_Shader == NULL)
- return;
-
- // All of our shaders produce premultiplied values.
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha);
-
- qt3ds::render::NVRenderBlendEquationArgument blendEqu(NVRenderBlendEquation::Add,
- NVRenderBlendEquation::Add);
-
- context.SetBlendFunction(blendFunc);
- context.SetBlendEquation(blendEqu);
- QT3DSVec4 theColor(m_Text.m_TextColor.x, m_Text.m_TextColor.y, m_Text.m_TextColor.z,
- m_Text.m_GlobalOpacity);
- STextShader &shader(*theInfo.m_Shader);
-
- shader.RenderPath(*m_Text.m_PathFontItem, *m_Text.m_PathFontDetails, *this, theColor,
- m_ViewProjection, m_GlobalTransform, inCameraVec, context,
- m_Text.m_TextTextureDetails, QT3DSVec3(0, 0, 0));
- }
- }
-
- void STextRenderable::RenderDepthPass(const QT3DSVec2 &inCameraVec)
- {
- NVRenderContext &context(m_Generator.GetContext());
- STextDepthShader *theDepthShader = m_Generator.GetTextDepthShader();
- if (theDepthShader == NULL)
- return;
-
- if (!m_Text.m_PathFontDetails) {
- // we may change stencil test state
- qt3ds::render::NVRenderContextScopedProperty<bool> __stencilTest(
- context, &NVRenderContext::IsStencilTestEnabled,
- &NVRenderContext::SetStencilTestEnabled, true);
-
- NVRenderShaderProgram &theShader(theDepthShader->m_Shader);
- context.SetCullingEnabled(false);
- context.SetActiveShader(&theShader);
- theDepthShader->m_MVP.Set(m_ModelViewProjection);
- theDepthShader->m_Sampler.Set(m_Text.m_TextTexture);
- const STextScaleAndOffset &theScaleAndOffset(*this);
- theDepthShader->m_Dimensions.Set(
- QT3DSVec4(theScaleAndOffset.m_TextScale.x, theScaleAndOffset.m_TextScale.y,
- theScaleAndOffset.m_TextOffset.x, theScaleAndOffset.m_TextOffset.y));
- theDepthShader->m_CameraProperties.Set(inCameraVec);
-
- STextureDetails theTextureDetails = m_Text.m_TextTexture->GetTextureDetails();
- const STextTextureDetails &theTextTextureDetails(m_Text.m_TextTextureDetails);
- QT3DSF32 theWidthScale =
- (QT3DSF32)theTextTextureDetails.m_TextWidth / (QT3DSF32)theTextureDetails.m_Width;
- QT3DSF32 theHeightScale =
- (QT3DSF32)theTextTextureDetails.m_TextHeight / (QT3DSF32)theTextureDetails.m_Height;
- theDepthShader->m_TextDimensions.Set(
- QT3DSVec3(theWidthScale, theHeightScale, theTextTextureDetails.m_FlipY ? 1.0f : 0.0f));
- context.SetInputAssembler(&theDepthShader->m_QuadInputAssembler);
- context.Draw(NVRenderDrawMode::Triangles,
- theDepthShader->m_QuadInputAssembler.GetIndexCount(), 0);
- } else {
- qt3ds::render::NVRenderBoolOp::Enum theDepthFunction = context.GetDepthFunction();
- bool isDepthEnabled = context.IsDepthTestEnabled();
- bool isStencilEnabled = context.IsStencilTestEnabled();
- bool isDepthWriteEnabled = context.IsDepthWriteEnabled();
- qt3ds::render::NVRenderStencilFunctionArgument theArg(qt3ds::render::NVRenderBoolOp::NotEqual,
- 0, 0xFF);
- qt3ds::render::NVRenderStencilOperationArgument theOpArg(
- qt3ds::render::NVRenderStencilOp::Keep, qt3ds::render::NVRenderStencilOp::Keep,
- qt3ds::render::NVRenderStencilOp::Zero);
- NVScopedRefCounted<NVRenderDepthStencilState> depthStencilState =
- context.CreateDepthStencilState(isDepthEnabled, isDepthWriteEnabled,
- theDepthFunction, false, theArg, theArg, theOpArg,
- theOpArg);
-
- context.SetActiveShader(NULL);
- context.SetCullingEnabled(false);
-
- context.SetDepthStencilState(depthStencilState);
-
- // setup transform
- QT3DSMat44 offsetMatrix = QT3DSMat44::createIdentity();
- offsetMatrix.setPosition(QT3DSVec3(
- m_TextOffset.x - (QT3DSF32)m_Text.m_TextTextureDetails.m_TextWidth / 2.0f,
- m_TextOffset.y - (QT3DSF32)m_Text.m_TextTextureDetails.m_TextHeight / 2.0f, 0.0));
-
- QT3DSMat44 pathMatrix = m_Text.m_PathFontItem->GetTransform();
-
- context.SetPathProjectionMatrix(m_ViewProjection);
- context.SetPathModelViewMatrix(m_GlobalTransform * offsetMatrix * pathMatrix);
-
- // first pass
- m_Text.m_PathFontDetails->StencilFillPathInstanced(*m_Text.m_PathFontItem);
-
- // second pass
- context.SetStencilTestEnabled(true);
- m_Text.m_PathFontDetails->CoverFillPathInstanced(*m_Text.m_PathFontItem);
-
- context.SetStencilTestEnabled(isStencilEnabled);
- context.SetDepthFunction(theDepthFunction);
- }
- }
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- void SDistanceFieldRenderable::Render(const QT3DSVec2 &inCameraVec)
- {
- m_distanceFieldText.renderText(m_text, m_mvp);
- }
-
- void SDistanceFieldRenderable::RenderDepthPass(const QT3DSVec2 &inCameraVec)
- {
- m_distanceFieldText.renderTextDepth(m_text, m_mvp);
- }
-#endif
-
- void SCustomMaterialRenderable::Render(const QT3DSVec2 & /*inCameraVec*/,
- const SLayerRenderData &inLayerData,
- const SLayer &inLayer, NVDataRef<SLight *> inLights,
- const SCamera &inCamera,
- const NVRenderTexture2D *inDepthTexture,
- const NVRenderTexture2D *inSsaoTexture,
- TShaderFeatureSet inFeatureSet)
- {
- IQt3DSRenderContext &qt3dsContext(m_Generator.GetQt3DSContext());
- SCustomMaterialRenderContext theRenderContext(
- inLayer, inLayerData, inLights, inCamera, m_ModelContext.m_Model, m_Subset,
- m_ModelContext.m_ModelViewProjection, m_GlobalTransform, m_ModelContext.m_NormalMatrix,
- m_Material, inDepthTexture, inSsaoTexture, m_ShaderDescription, m_FirstImage,
- m_Opacity);
-
- qt3dsContext.GetCustomMaterialSystem().RenderSubset(theRenderContext, inFeatureSet);
- }
-
- void SCustomMaterialRenderable::RenderDepthPass(const QT3DSVec2 &inCameraVec,
- const SLayer & /*inLayer*/,
- NVConstDataRef<SLight *> /*inLights*/
- ,
- const SCamera & /*inCamera*/,
- const NVRenderTexture2D * /*inDepthTexture*/)
- {
-
- IQt3DSRenderContext &qt3dsContext(m_Generator.GetQt3DSContext());
- if (!qt3dsContext.GetCustomMaterialSystem().RenderDepthPrepass(
- m_ModelContext.m_ModelViewProjection, m_Material, m_Subset)) {
- SRenderableImage *displacementImage = NULL;
- for (SRenderableImage *theImage = m_FirstImage;
- theImage != NULL && displacementImage == NULL; theImage = theImage->m_NextImage) {
- if (theImage->m_MapType == ImageMapTypes::Displacement)
- displacementImage = theImage;
- }
-
- SSubsetRenderableBase::RenderDepthPass(inCameraVec, displacementImage,
- m_Material.m_DisplaceAmount);
- }
- }
-
- void SPathRenderable::RenderDepthPass(const QT3DSVec2 &inCameraVec, const SLayer & /*inLayer*/,
- NVConstDataRef<SLight *> inLights,
- const SCamera &inCamera,
- const NVRenderTexture2D * /*inDepthTexture*/)
- {
- IQt3DSRenderContext &qt3dsContext(m_Generator.GetQt3DSContext());
- SPathRenderContext theRenderContext(
- inLights, inCamera, m_Path, m_ModelViewProjection, m_GlobalTransform, m_NormalMatrix,
- m_Opacity, m_Material, m_ShaderDescription, m_FirstImage, qt3dsContext.GetWireframeMode(),
- inCameraVec, false, m_IsStroke);
-
- qt3dsContext.GetPathManager().RenderDepthPrepass(
- theRenderContext, m_Generator.GetLayerGlobalRenderProperties(), TShaderFeatureSet());
- }
-
- void SPathRenderable::Render(const QT3DSVec2 &inCameraVec, const SLayer & /*inLayer*/,
- NVConstDataRef<SLight *> inLights, const SCamera &inCamera,
- const NVRenderTexture2D * /*inDepthTexture*/
- ,
- const NVRenderTexture2D * /*inSsaoTexture*/
- ,
- TShaderFeatureSet inFeatureSet)
- {
- IQt3DSRenderContext &qt3dsContext(m_Generator.GetQt3DSContext());
- SPathRenderContext theRenderContext(
- inLights, inCamera, m_Path, m_ModelViewProjection, m_GlobalTransform, m_NormalMatrix,
- m_Opacity, m_Material, m_ShaderDescription, m_FirstImage, qt3dsContext.GetWireframeMode(),
- inCameraVec, m_RenderableFlags.HasTransparency(), m_IsStroke);
-
- qt3dsContext.GetPathManager().RenderPath(
- theRenderContext, m_Generator.GetLayerGlobalRenderProperties(), inFeatureSet);
- }
-
- void SPathRenderable::RenderShadowMapPass(const QT3DSVec2 &inCameraVec, const SLight *inLight,
- const SCamera &inCamera,
- SShadowMapEntry *inShadowMapEntry)
- {
- NVConstDataRef<SLight *> theLights;
- IQt3DSRenderContext &qt3dsContext(m_Generator.GetQt3DSContext());
-
- QT3DSMat44 theModelViewProjection = inShadowMapEntry->m_LightVP * m_GlobalTransform;
- SPathRenderContext theRenderContext(
- theLights, inCamera, m_Path, theModelViewProjection, m_GlobalTransform, m_NormalMatrix,
- m_Opacity, m_Material, m_ShaderDescription, m_FirstImage, qt3dsContext.GetWireframeMode(),
- inCameraVec, false, m_IsStroke);
-
- if (inLight->m_LightType != RenderLightTypes::Directional) {
- qt3dsContext.GetPathManager().RenderCubeFaceShadowPass(
- theRenderContext, m_Generator.GetLayerGlobalRenderProperties(),
- TShaderFeatureSet());
- } else
- qt3dsContext.GetPathManager().RenderShadowMapPass(
- theRenderContext, m_Generator.GetLayerGlobalRenderProperties(),
- TShaderFeatureSet());
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.h
deleted file mode 100644
index a369f7a1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRenderableObjects.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_IMPL_RENDERABLE_OBJECTS_H
-#define QT3DS_RENDER_IMPL_RENDERABLE_OBJECTS_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSFlags.h"
-#include "Qt3DSRenderModel.h"
-#include "foundation/Qt3DSContainers.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "Qt3DSRenderCustomMaterial.h"
-#include "Qt3DSRenderText.h"
-#include "Qt3DSRenderMesh.h"
-#include "Qt3DSRenderShaderKeys.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "Qt3DSRenderableImage.h"
-#include "Qt3DSDistanceFieldRenderer.h"
-
-namespace qt3ds {
-namespace render {
-
- struct RenderPreparationResultFlagValues
- {
- enum Enum {
- HasTransparency = 1 << 0,
- CompletelyTransparent = 1 << 1,
- Dirty = 1 << 2,
- Pickable = 1 << 3,
- DefaultMaterialMeshSubset = 1 << 4,
- Text = 1 << 5,
- Custom = 1 << 6,
- CustomMaterialMeshSubset = 1 << 7,
- HasRefraction = 1 << 8,
- Path = 1 << 9,
- ShadowCaster = 1 << 10,
- DistanceField = 1 << 11,
- };
- };
-
- struct SRenderableObjectFlags : public NVFlags<RenderPreparationResultFlagValues::Enum, QT3DSU32>
- {
- void ClearOrSet(bool value, RenderPreparationResultFlagValues::Enum enumVal)
- {
- if (value)
- this->operator|=(enumVal);
- else
- clear(enumVal);
- }
-
- void SetHasTransparency(bool inHasTransparency)
- {
- ClearOrSet(inHasTransparency, RenderPreparationResultFlagValues::HasTransparency);
- }
- bool HasTransparency() const
- {
- return this->operator&(RenderPreparationResultFlagValues::HasTransparency);
- }
- bool HasRefraction() const
- {
- return this->operator&(RenderPreparationResultFlagValues::HasRefraction);
- }
- void SetCompletelyTransparent(bool inTransparent)
- {
- ClearOrSet(inTransparent, RenderPreparationResultFlagValues::CompletelyTransparent);
- }
- bool IsCompletelyTransparent() const
- {
- return this->operator&(RenderPreparationResultFlagValues::CompletelyTransparent);
- }
- void SetDirty(bool inDirty)
- {
- ClearOrSet(inDirty, RenderPreparationResultFlagValues::Dirty);
- }
- bool IsDirty() const { return this->operator&(RenderPreparationResultFlagValues::Dirty); }
- void SetPickable(bool inPickable)
- {
- ClearOrSet(inPickable, RenderPreparationResultFlagValues::Pickable);
- }
- bool GetPickable() const
- {
- return this->operator&(RenderPreparationResultFlagValues::Pickable);
- }
-
- // Mutually exclusive values
- void SetDefaultMaterialMeshSubset(bool inMeshSubset)
- {
- ClearOrSet(inMeshSubset, RenderPreparationResultFlagValues::DefaultMaterialMeshSubset);
- }
- bool IsDefaultMaterialMeshSubset() const
- {
- return this->operator&(RenderPreparationResultFlagValues::DefaultMaterialMeshSubset);
- }
-
- void SetCustomMaterialMeshSubset(bool inMeshSubset)
- {
- ClearOrSet(inMeshSubset, RenderPreparationResultFlagValues::CustomMaterialMeshSubset);
- }
- bool IsCustomMaterialMeshSubset() const
- {
- return this->operator&(RenderPreparationResultFlagValues::CustomMaterialMeshSubset);
- }
-
- void SetText(bool inText) { ClearOrSet(inText, RenderPreparationResultFlagValues::Text); }
- bool IsText() const { return this->operator&(RenderPreparationResultFlagValues::Text); }
-
- void setDistanceField(bool inText)
- {
- ClearOrSet(inText, RenderPreparationResultFlagValues::DistanceField);
- }
-
- bool isDistanceField() const
- {
- return this->operator&(RenderPreparationResultFlagValues::DistanceField);
- }
-
- void SetCustom(bool inCustom)
- {
- ClearOrSet(inCustom, RenderPreparationResultFlagValues::Custom);
- }
- bool IsCustom() const { return this->operator&(RenderPreparationResultFlagValues::Custom); }
-
- void SetPath(bool inPath) { ClearOrSet(inPath, RenderPreparationResultFlagValues::Path); }
- bool IsPath() const { return this->operator&(RenderPreparationResultFlagValues::Path); }
-
- void SetShadowCaster(bool inCaster)
- {
- ClearOrSet(inCaster, RenderPreparationResultFlagValues::ShadowCaster);
- }
- bool IsShadowCaster() const
- {
- return this->operator&(RenderPreparationResultFlagValues::ShadowCaster);
- }
- };
-
- struct SNodeLightEntry
- {
- SLight *m_Light;
- QT3DSU32 m_LightIndex;
- SNodeLightEntry *m_NextNode;
- SNodeLightEntry()
- : m_Light(NULL)
- , m_NextNode(NULL)
- {
- }
- SNodeLightEntry(SLight *inLight, QT3DSU32 inLightIndex)
- : m_Light(inLight)
- , m_LightIndex(inLightIndex)
- , m_NextNode(NULL)
- {
- }
- };
-
- DEFINE_INVASIVE_SINGLE_LIST(NodeLightEntry);
-
- IMPLEMENT_INVASIVE_SINGLE_LIST(NodeLightEntry, m_NextNode);
-
- struct SRenderableObject;
-
- typedef void (*TRenderFunction)(SRenderableObject &inObject, const QT3DSVec2 &inCameraProperties);
-
- struct SRenderableObject
- {
- // Variables used for picking
- const QT3DSMat44 &m_GlobalTransform;
- const NVBounds3 &m_Bounds;
- SRenderableObjectFlags m_RenderableFlags;
- // For rough sorting for transparency and for depth
- QT3DSVec3 m_WorldCenterPoint;
- QT3DSF32 m_CameraDistanceSq;
- TessModeValues::Enum m_TessellationMode;
- bool m_ShadowCaster;
- // For custom renderable objects the render function must be defined
- TRenderFunction m_RenderFunction;
- TNodeLightEntryList m_ScopedLights;
- SRenderableObject(SRenderableObjectFlags inFlags, QT3DSVec3 inWorldCenterPt,
- const QT3DSMat44 &inGlobalTransform, const NVBounds3 &inBounds,
- TessModeValues::Enum inTessMode = TessModeValues::NoTess,
- bool inShadowCaster = true, TRenderFunction inFunction = nullptr)
-
- : m_GlobalTransform(inGlobalTransform)
- , m_Bounds(inBounds)
- , m_RenderableFlags(inFlags)
- , m_WorldCenterPoint(inWorldCenterPt)
- , m_CameraDistanceSq(0)
- , m_TessellationMode(inTessMode)
- , m_ShadowCaster(inShadowCaster)
- , m_RenderFunction(inFunction)
- {
- }
- bool operator<(SRenderableObject *inOther) const
- {
- return m_CameraDistanceSq < inOther->m_CameraDistanceSq;
- }
- };
-
- typedef nvvector<SRenderableObject *> TRenderableObjectList;
-
- // Different subsets from the same model will get the same
- // model context so we can generate the MVP and normal matrix once
- // and only once per subset.
- struct SModelContext
- {
- const SModel &m_Model;
- QT3DSMat44 m_ModelViewProjection;
- QT3DSMat33 m_NormalMatrix;
-
- SModelContext(const SModel &inModel, const QT3DSMat44 &inViewProjection)
- : m_Model(inModel)
- {
- m_Model.CalculateMVPAndNormalMatrix(inViewProjection, m_ModelViewProjection,
- m_NormalMatrix);
- }
- SModelContext(const SModelContext &inOther)
- : m_Model(inOther.m_Model)
- {
- // The default copy constructor for these objects is pretty darn slow.
- memCopy(&m_ModelViewProjection, &inOther.m_ModelViewProjection,
- sizeof(m_ModelViewProjection));
- memCopy(&m_NormalMatrix, &inOther.m_NormalMatrix, sizeof(m_NormalMatrix));
- }
- };
-
- typedef nvvector<SModelContext *> TModelContextPtrList;
-
- class Qt3DSRendererImpl;
- struct SLayerRenderData;
- struct SShadowMapEntry;
-
- struct SSubsetRenderableBase : public SRenderableObject
- {
- Qt3DSRendererImpl &m_Generator;
- const SModelContext &m_ModelContext;
- SRenderSubset m_Subset;
- QT3DSF32 m_Opacity;
-
- SSubsetRenderableBase(SRenderableObjectFlags inFlags, QT3DSVec3 inWorldCenterPt,
- Qt3DSRendererImpl &gen, const SRenderSubset &subset,
- const SModelContext &modelContext, QT3DSF32 inOpacity)
-
- : SRenderableObject(inFlags, inWorldCenterPt, modelContext.m_Model.m_GlobalTransform,
- m_Subset.m_Bounds)
- , m_Generator(gen)
- , m_ModelContext(modelContext)
- , m_Subset(subset)
- , m_Opacity(inOpacity)
- {
- }
- void RenderShadowMapPass(const QT3DSVec2 &inCameraVec, const SLight *inLight,
- const SCamera &inCamera, SShadowMapEntry *inShadowMapEntry);
-
- void RenderDepthPass(const QT3DSVec2 &inCameraVec, SRenderableImage *inDisplacementImage,
- float inDisplacementAmount);
- };
-
- /**
- * A renderable that corresponds to a subset (a part of a model).
- * These are created per subset per layer and are responsible for actually
- * rendering this type of object.
- */
- struct SSubsetRenderable : public SSubsetRenderableBase
- {
- const SDefaultMaterial &m_Material;
- SRenderableImage *m_FirstImage;
- SShaderDefaultMaterialKey m_ShaderDescription;
- NVConstDataRef<QT3DSMat44> m_Bones;
-
- SSubsetRenderable(SRenderableObjectFlags inFlags, QT3DSVec3 inWorldCenterPt,
- Qt3DSRendererImpl &gen, const SRenderSubset &subset,
- const SDefaultMaterial &mat, const SModelContext &modelContext,
- QT3DSF32 inOpacity, SRenderableImage *inFirstImage,
- SShaderDefaultMaterialKey inShaderKey,
- NVConstDataRef<QT3DSMat44> inBoneGlobals)
-
- : SSubsetRenderableBase(inFlags, inWorldCenterPt, gen, subset, modelContext, inOpacity)
- , m_Material(mat)
- , m_FirstImage(inFirstImage)
- , m_ShaderDescription(inShaderKey)
- , m_Bones(inBoneGlobals)
- {
- m_RenderableFlags.SetDefaultMaterialMeshSubset(true);
- m_RenderableFlags.SetCustom(false);
- m_RenderableFlags.SetText(false);
- m_RenderableFlags.setDistanceField(false);
- }
-
- void Render(const QT3DSVec2 &inCameraVec, TShaderFeatureSet inFeatureSet);
-
- void RenderDepthPass(const QT3DSVec2 &inCameraVec);
-
- DefaultMaterialBlendMode::Enum getBlendingMode()
- {
- return m_Material.m_BlendMode;
- }
- };
-
- struct SCustomMaterialRenderable : public SSubsetRenderableBase
- {
- const SCustomMaterial &m_Material;
- SRenderableImage *m_FirstImage;
- SShaderDefaultMaterialKey m_ShaderDescription;
-
- SCustomMaterialRenderable(SRenderableObjectFlags inFlags, QT3DSVec3 inWorldCenterPt,
- Qt3DSRendererImpl &gen, const SRenderSubset &subset,
- const SCustomMaterial &mat, const SModelContext &modelContext,
- QT3DSF32 inOpacity, SRenderableImage *inFirstImage,
- SShaderDefaultMaterialKey inShaderKey)
- : SSubsetRenderableBase(inFlags, inWorldCenterPt, gen, subset, modelContext, inOpacity)
- , m_Material(mat)
- , m_FirstImage(inFirstImage)
- , m_ShaderDescription(inShaderKey)
- {
- m_RenderableFlags.SetCustomMaterialMeshSubset(true);
- }
-
- void Render(const QT3DSVec2 &inCameraVec, const SLayerRenderData &inLayerData,
- const SLayer &inLayer, NVDataRef<SLight *> inLights, const SCamera &inCamera,
- const NVRenderTexture2D *inDepthTexture, const NVRenderTexture2D *inSsaoTexture,
- TShaderFeatureSet inFeatureSet);
-
- void RenderDepthPass(const QT3DSVec2 &inCameraVec, const SLayer &inLayer,
- NVConstDataRef<SLight *> inLights, const SCamera &inCamera,
- const NVRenderTexture2D *inDepthTexture);
- };
-
- struct STextScaleAndOffset
- {
- QT3DSVec2 m_TextOffset;
- QT3DSVec2 m_TextScale;
- STextScaleAndOffset(const QT3DSVec2 &inTextOffset, const QT3DSVec2 &inTextScale)
- : m_TextOffset(inTextOffset)
- , m_TextScale(inTextScale)
- {
- }
- STextScaleAndOffset(NVRenderTexture2D &inTexture, const STextTextureDetails &inTextDetails,
- const STextRenderInfo &inInfo);
- };
-
- struct STextRenderable : public SRenderableObject, public STextScaleAndOffset
- {
- Qt3DSRendererImpl &m_Generator;
- const SText &m_Text;
- NVRenderTexture2D &m_Texture;
- QT3DSMat44 m_ModelViewProjection;
- QT3DSMat44 m_ViewProjection;
-
- STextRenderable(SRenderableObjectFlags inFlags, QT3DSVec3 inWorldCenterPt,
- Qt3DSRendererImpl &gen, const SText &inText, const NVBounds3 &inBounds,
- const QT3DSMat44 &inModelViewProjection, const QT3DSMat44 &inViewProjection,
- NVRenderTexture2D &inTextTexture, const QT3DSVec2 &inTextOffset,
- const QT3DSVec2 &inTextScale)
- : SRenderableObject(inFlags, inWorldCenterPt, inText.m_GlobalTransform, inBounds)
- , STextScaleAndOffset(inTextOffset, inTextScale)
- , m_Generator(gen)
- , m_Text(inText)
- , m_Texture(inTextTexture)
- , m_ModelViewProjection(inModelViewProjection)
- , m_ViewProjection(inViewProjection)
- {
- m_RenderableFlags.SetDefaultMaterialMeshSubset(false);
- m_RenderableFlags.SetCustom(false);
- m_RenderableFlags.SetText(true);
- m_RenderableFlags.setDistanceField(false);
- }
-
- void Render(const QT3DSVec2 &inCameraVec);
- void RenderDepthPass(const QT3DSVec2 &inCameraVec);
- };
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- struct SDistanceFieldRenderable : public SRenderableObject
- {
- Q3DSDistanceFieldRenderer &m_distanceFieldText;
- QT3DSMat44 m_mvp;
- SText &m_text;
-
- SDistanceFieldRenderable(SRenderableObjectFlags flags, QT3DSVec3 worldCenterPt,
- SText &text, const NVBounds3 &bounds, const QT3DSMat44 &mvp,
- Q3DSDistanceFieldRenderer &distanceFieldText)
- : SRenderableObject(flags, worldCenterPt, text.m_GlobalTransform, bounds)
- , m_distanceFieldText(distanceFieldText)
- , m_mvp(mvp)
- , m_text(text)
- {
- m_RenderableFlags.SetDefaultMaterialMeshSubset(false);
- m_RenderableFlags.SetCustom(false);
- m_RenderableFlags.SetText(false);
- m_RenderableFlags.setDistanceField(true);
- m_distanceFieldText.checkAndBuildGlyphs(text);
- }
-
- void Render(const QT3DSVec2 &inCameraVec);
- void RenderDepthPass(const QT3DSVec2 &inCameraVec);
- };
-#endif
-
- struct SPathRenderable : public SRenderableObject
- {
- Qt3DSRendererImpl &m_Generator;
- SPath &m_Path;
- NVBounds3 m_Bounds;
- QT3DSMat44 m_ModelViewProjection;
- QT3DSMat33 m_NormalMatrix;
- const SGraphObject &m_Material;
- QT3DSF32 m_Opacity;
- SRenderableImage *m_FirstImage;
- SShaderDefaultMaterialKey m_ShaderDescription;
- bool m_IsStroke;
-
- SPathRenderable(SRenderableObjectFlags inFlags, QT3DSVec3 inWorldCenterPt,
- Qt3DSRendererImpl &gen, const QT3DSMat44 &inGlobalTransform,
- NVBounds3 &inBounds, SPath &inPath, const QT3DSMat44 &inModelViewProjection,
- const QT3DSMat33 inNormalMat, const SGraphObject &inMaterial, QT3DSF32 inOpacity,
- SShaderDefaultMaterialKey inShaderKey, bool inIsStroke)
-
- : SRenderableObject(inFlags, inWorldCenterPt, inGlobalTransform, m_Bounds)
- , m_Generator(gen)
- , m_Path(inPath)
- , m_Bounds(inBounds)
- , m_ModelViewProjection(inModelViewProjection)
- , m_NormalMatrix(inNormalMat)
- , m_Material(inMaterial)
- , m_Opacity(inOpacity)
- , m_FirstImage(NULL)
- , m_ShaderDescription(inShaderKey)
- , m_IsStroke(inIsStroke)
- {
- m_RenderableFlags.SetPath(true);
- }
- void Render(const QT3DSVec2 &inCameraVec, const SLayer &inLayer,
- NVConstDataRef<SLight *> inLights, const SCamera &inCamera,
- const NVRenderTexture2D *inDepthTexture, const NVRenderTexture2D *inSsaoTexture,
- TShaderFeatureSet inFeatureSet);
-
- void RenderDepthPass(const QT3DSVec2 &inCameraVec, const SLayer &inLayer,
- NVConstDataRef<SLight *> inLights, const SCamera &inCamera,
- const NVRenderTexture2D *inDepthTexture);
-
- void RenderShadowMapPass(const QT3DSVec2 &inCameraVec, const SLight *inLight,
- const SCamera &inCamera, SShadowMapEntry *inShadowMapEntry);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp
deleted file mode 100644
index 0b3f6655..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp
+++ /dev/null
@@ -1,2051 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRendererImpl.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "EASTL/sort.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderPresentation.h"
-#include "Qt3DSRenderEffect.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "Qt3DSRenderTextTextureCache.h"
-#include "Qt3DSRenderTextTextureAtlas.h"
-#include "Qt3DSRenderMaterialHelpers.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-#include <stdlib.h>
-
-#ifdef _WIN32
-#pragma warning(disable : 4355)
-#endif
-
-// Quick tests you can run to find performance problems
-
-//#define QT3DS_RENDER_DISABLE_HARDWARE_BLENDING 1
-//#define QT3DS_RENDER_DISABLE_LIGHTING 1
-//#define QT3DS_RENDER_DISABLE_TEXTURING 1
-//#define QT3DS_RENDER_DISABLE_TRANSPARENCY 1
-//#define QT3DS_RENDER_DISABLE_FRUSTUM_CULLING 1
-
-// If you are fillrate bound then sorting opaque objects can help in some circumstances
-//#define QT3DS_RENDER_DISABLE_OPAQUE_SORT 1
-
-using qt3ds::foundation::CRegisteredString;
-
-namespace qt3ds {
-namespace render {
-
- struct SRenderableImage;
- struct SShaderGeneratorGeneratedShader;
- struct SSubsetRenderable;
- using eastl::make_pair;
- using eastl::reverse;
- using eastl::stable_sort;
-
- SEndlType Endl;
-
- static SRenderInstanceId combineLayerAndId(const SLayer *layer, const SRenderInstanceId id)
- {
- uint64_t x = (uint64_t)layer;
- x += 31u * (uint64_t)id;
- return (SRenderInstanceId)x;
- }
-
- Qt3DSRendererImpl::Qt3DSRendererImpl(IQt3DSRenderContext &ctx)
- : m_qt3dsContext(ctx)
- , m_Context(ctx.GetRenderContext())
- , m_BufferManager(ctx.GetBufferManager())
- , m_OffscreenRenderManager(ctx.GetOffscreenRenderManager())
- , m_StringTable(IStringTable::CreateStringTable(ctx.GetAllocator()))
- , m_LayerShaders(ctx.GetAllocator(), "Qt3DSRendererImpl::m_LayerShaders")
- , m_Shaders(ctx.GetAllocator(), "Qt3DSRendererImpl::m_Shaders")
- , m_ConstantBuffers(ctx.GetAllocator(), "Qt3DSRendererImpl::m_ConstantBuffers")
- , m_TextShader(ctx.GetAllocator())
- , m_TextPathShader(ctx.GetAllocator())
- , m_TextWidgetShader(ctx.GetAllocator())
- , m_TextOnscreenShader(ctx.GetAllocator())
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- , m_LayerBlendTexture(ctx.GetResourceManager())
- , m_BlendFB(NULL)
-#endif
- , m_InstanceRenderMap(ctx.GetAllocator(), "Qt3DSRendererImpl::m_InstanceRenderMap")
- , m_LastFrameLayers(ctx.GetAllocator(), "Qt3DSRendererImpl::m_LastFrameLayers")
- , mRefCount(0)
- , m_LastPickResults(ctx.GetAllocator(), "Qt3DSRendererImpl::m_LastPickResults")
- , m_CurrentLayer(NULL)
- , m_WidgetVertexBuffers(ctx.GetAllocator(), "Qt3DSRendererImpl::m_WidgetVertexBuffers")
- , m_WidgetIndexBuffers(ctx.GetAllocator(), "Qt3DSRendererImpl::m_WidgetIndexBuffers")
- , m_WidgetShaders(ctx.GetAllocator(), "Qt3DSRendererImpl::m_WidgetShaders")
- , m_WidgetInputAssembler(ctx.GetAllocator(), "Qt3DSRendererImpl::m_WidgetInputAssembler")
- , m_BoneIdNodeMap(ctx.GetAllocator(), "Qt3DSRendererImpl::m_BoneIdNodeMap")
- , m_PickRenderPlugins(true)
- , m_LayerCachingEnabled(true)
- , m_LayerGPuProfilingEnabled(false)
- {
- }
- Qt3DSRendererImpl::~Qt3DSRendererImpl()
- {
- m_LayerShaders.clear();
- for (TShaderMap::iterator iter = m_Shaders.begin(), end = m_Shaders.end(); iter != end;
- ++iter)
- NVDelete(m_Context->GetAllocator(), iter->second);
-
- m_Shaders.clear();
- m_InstanceRenderMap.clear();
- m_ConstantBuffers.clear();
- }
-
- void Qt3DSRendererImpl::addRef() { atomicIncrement(&mRefCount); }
-
- void Qt3DSRendererImpl::release() { QT3DS_IMPLEMENT_REF_COUNT_RELEASE(m_Context->GetAllocator()); }
-
- void Qt3DSRendererImpl::ChildrenUpdated(SNode &inParent)
- {
- if (inParent.m_Type == GraphObjectTypes::Layer) {
- TInstanceRenderMap::iterator theIter
- = m_InstanceRenderMap.find(static_cast<SRenderInstanceId>(&inParent));
- if (theIter == m_InstanceRenderMap.end()) {
- // The layer is not in main presentation, but it might be in subpresentation
- theIter = m_InstanceRenderMap.begin();
- while (theIter != m_InstanceRenderMap.end()) {
- if (static_cast<SNode *>(&theIter->second.mPtr->m_Layer) == &inParent)
- break;
- theIter++;
- }
- }
- if (theIter != m_InstanceRenderMap.end()) {
- theIter->second->m_CamerasAndLights.clear();
- theIter->second->m_RenderableNodes.clear();
- }
- } else if (inParent.m_Parent)
- ChildrenUpdated(*inParent.m_Parent);
- }
-
- QT3DSF32 Qt3DSRendererImpl::GetTextScale(const SText &inText)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inText);
- if (theData)
- return theData->m_TextScale;
- return 1.0f;
- }
-
- static inline SLayer *GetNextLayer(SLayer &inLayer)
- {
- if (inLayer.m_NextSibling && inLayer.m_NextSibling->m_Type == GraphObjectTypes::Layer)
- return static_cast<SLayer *>(inLayer.m_NextSibling);
- return NULL;
- }
-
- static inline void MaybePushLayer(SLayer &inLayer, nvvector<SLayer *> &outLayerList)
- {
- inLayer.CalculateGlobalVariables();
- if (inLayer.m_Flags.IsGloballyActive() && inLayer.m_Flags.IsLayerRenderToTarget())
- outLayerList.push_back(&inLayer);
- }
- static void BuildRenderableLayers(SLayer &inLayer, nvvector<SLayer *> &renderableLayers,
- bool inRenderSiblings)
- {
- MaybePushLayer(inLayer, renderableLayers);
- if (inRenderSiblings) {
- for (SLayer *theNextLayer = GetNextLayer(inLayer); theNextLayer;
- theNextLayer = GetNextLayer(*theNextLayer))
- MaybePushLayer(*theNextLayer, renderableLayers);
- }
- }
-
- void Qt3DSRendererImpl::EnableLayerGpuProfiling(bool inEnabled)
- {
- if (m_LayerGPuProfilingEnabled != inEnabled) {
- TInstanceRenderMap::iterator theIter;
- for (theIter = m_InstanceRenderMap.begin(); theIter != m_InstanceRenderMap.end();
- theIter++) {
- SLayerRenderData *data = theIter->second;
- if (!inEnabled)
- data->m_LayerProfilerGpu = nullptr;
- else
- data->CreateGpuProfiler();
- }
- }
- m_LayerGPuProfilingEnabled = inEnabled;
- }
-
- bool Qt3DSRendererImpl::PrepareLayerForRender(SLayer &inLayer,
- const QT3DSVec2 &inViewportDimensions,
- bool inRenderSiblings,
- const SRenderInstanceId id)
- {
- (void)inViewportDimensions;
- nvvector<SLayer *> renderableLayers(m_qt3dsContext.GetPerFrameAllocator(), "LayerVector");
- // Found by fair roll of the dice.
- renderableLayers.reserve(4);
-
- BuildRenderableLayers(inLayer, renderableLayers, inRenderSiblings);
-
- bool retval = false;
-
- for (nvvector<SLayer *>::reverse_iterator iter = renderableLayers.rbegin(),
- end = renderableLayers.rend();
- iter != end; ++iter) {
- // Store the previous state of if we were rendering a layer.
- SLayer *theLayer = *iter;
- SLayerRenderData *theRenderData = GetOrCreateLayerRenderDataForNode(*theLayer, id);
-
- if (theRenderData) {
- theRenderData->PrepareForRender();
- retval = retval || theRenderData->m_LayerPrepResult->m_Flags.WasDirty();
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- return retval;
- }
-
- void Qt3DSRendererImpl::RenderLayer(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- bool clear, QT3DSVec4 clearColor, bool inRenderSiblings,
- const SRenderInstanceId id)
- {
- (void)inViewportDimensions;
- nvvector<SLayer *> renderableLayers(m_qt3dsContext.GetPerFrameAllocator(), "LayerVector");
- // Found by fair roll of the dice.
- renderableLayers.reserve(4);
-
- BuildRenderableLayers(inLayer, renderableLayers, inRenderSiblings);
-
- NVRenderContext &theRenderContext(m_qt3dsContext.GetRenderContext());
- qt3ds::render::NVRenderFrameBuffer *theFB = theRenderContext.GetRenderTarget();
- for (nvvector<SLayer *>::reverse_iterator iter = renderableLayers.rbegin(),
- end = renderableLayers.rend();
- iter != end; ++iter) {
- SLayer *theLayer = *iter;
- SLayerRenderData *theRenderData = GetOrCreateLayerRenderDataForNode(*theLayer, id);
- SLayerRenderPreparationResult &prepRes(*theRenderData->m_LayerPrepResult);
- LayerBlendTypes::Enum layerBlend = prepRes.GetLayer()->GetLayerBlend();
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- if ((layerBlend == LayerBlendTypes::Overlay ||
- layerBlend == LayerBlendTypes::ColorBurn ||
- layerBlend == LayerBlendTypes::ColorDodge) &&
- !theRenderContext.IsAdvancedBlendHwSupported() &&
- !theRenderContext.IsAdvancedBlendHwSupportedKHR()) {
- // Create and set up FBO and texture for advanced blending SW fallback
- NVRenderRect viewport = theRenderContext.GetViewport();
- m_LayerBlendTexture.EnsureTexture(viewport.m_Width + viewport.m_X,
- viewport.m_Height + viewport.m_Y,
- NVRenderTextureFormats::RGBA8);
- if (m_BlendFB == NULL)
- m_BlendFB = theRenderContext.CreateFrameBuffer();
- m_BlendFB->Attach(NVRenderFrameBufferAttachments::Color0, *m_LayerBlendTexture);
- theRenderContext.SetRenderTarget(m_BlendFB);
- theRenderContext.SetScissorTestEnabled(false);
- QT3DSVec4 color(0.0f);
- if (clear)
- color = clearColor;
-
- QT3DSVec4 origColor = theRenderContext.GetClearColor();
- theRenderContext.SetClearColor(color);
- theRenderContext.Clear(qt3ds::render::NVRenderClearValues::Color);
- theRenderContext.SetClearColor(origColor);
- theRenderContext.SetRenderTarget(theFB);
- break;
- } else {
- m_LayerBlendTexture.ReleaseTexture();
- }
-#endif
- }
- for (nvvector<SLayer *>::reverse_iterator iter = renderableLayers.rbegin(),
- end = renderableLayers.rend();
- iter != end; ++iter) {
- // Store the previous state of if we were rendering a layer.
- SLayer *theLayer = *iter;
- SLayerRenderData *theRenderData = GetOrCreateLayerRenderDataForNode(*theLayer, id);
-
- if (theRenderData) {
- if (theRenderData->m_LayerPrepResult->IsLayerVisible())
- theRenderData->RunnableRenderToViewport(theFB);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- }
-
- SLayer *Qt3DSRendererImpl::GetLayerForNode(const SNode &inNode) const
- {
- if (inNode.m_Type == GraphObjectTypes::Layer) {
- return &const_cast<SLayer &>(static_cast<const SLayer &>(inNode));
- }
- if (inNode.m_Parent)
- return GetLayerForNode(*inNode.m_Parent);
- return NULL;
- }
-
- SLayerRenderData *Qt3DSRendererImpl::GetOrCreateLayerRenderDataForNode(const SNode &inNode,
- const SRenderInstanceId id)
- {
- const SLayer *theLayer = GetLayerForNode(inNode);
- if (theLayer) {
- TInstanceRenderMap::const_iterator theIter
- = m_InstanceRenderMap.find(combineLayerAndId(theLayer, id));
- if (theIter != m_InstanceRenderMap.end())
- return const_cast<SLayerRenderData *>(theIter->second.mPtr);
-
- SLayerRenderData *theRenderData = QT3DS_NEW(m_Context->GetAllocator(), SLayerRenderData)(
- const_cast<SLayer &>(*theLayer), *this);
- m_InstanceRenderMap.insert(make_pair(combineLayerAndId(theLayer, id), theRenderData));
-
- // create a profiler if enabled
- if (IsLayerGpuProfilingEnabled() && theRenderData)
- theRenderData->CreateGpuProfiler();
-
- return theRenderData;
- }
- return NULL;
- }
-
- SCamera *Qt3DSRendererImpl::GetCameraForNode(const SNode &inNode) const
- {
- SLayerRenderData *theLayer =
- const_cast<Qt3DSRendererImpl &>(*this).GetOrCreateLayerRenderDataForNode(inNode);
- if (theLayer)
- return theLayer->m_Camera;
- return NULL;
- }
-
- Option<SCuboidRect> Qt3DSRendererImpl::GetCameraBounds(const SGraphObject &inObject)
- {
- if (GraphObjectTypes::IsNodeType(inObject.m_Type)) {
- const SNode &theNode = static_cast<const SNode &>(inObject);
- SLayerRenderData *theLayer = GetOrCreateLayerRenderDataForNode(theNode);
- if (theLayer->GetOffscreenRenderer() == false) {
- SCamera *theCamera = theLayer->m_Camera;
- if (theCamera)
- return theCamera->GetCameraBounds(
- theLayer->m_LayerPrepResult->GetLayerToPresentationViewport(),
- theLayer->m_LayerPrepResult->GetPresentationDesignDimensions());
- }
- }
- return Option<SCuboidRect>();
- }
-
- void Qt3DSRendererImpl::DrawScreenRect(NVRenderRectF inRect, const QT3DSVec3 &inColor)
- {
- SCamera theScreenCamera;
- theScreenCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- NVRenderRectF theViewport(m_Context->GetViewport());
- theScreenCamera.m_Flags.SetOrthographic(true);
- theScreenCamera.CalculateGlobalVariables(theViewport,
- QT3DSVec2(theViewport.m_Width, theViewport.m_Height));
- GenerateXYQuad();
- if (!m_ScreenRectShader) {
- IShaderProgramGenerator &theGenerator(GetProgramGenerator());
- theGenerator.BeginProgram();
- IShaderStageGenerator &vertexGenerator(
- *theGenerator.GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *theGenerator.GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddUniform("rectangle_dims", "vec3");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append(
- "\tgl_Position = model_view_projection * vec4(attr_pos * rectangle_dims, 1.0);");
- vertexGenerator.Append("}");
- fragmentGenerator.AddUniform("output_color", "vec3");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tgl_FragColor.rgb = output_color;");
- fragmentGenerator.Append("\tgl_FragColor.a = 1.0;");
- fragmentGenerator.Append("}");
- // No flags enabled
- m_ScreenRectShader = theGenerator.CompileGeneratedShader(
- "DrawScreenRect", SShaderCacheProgramFlags(), TShaderFeatureSet());
- }
- if (m_ScreenRectShader) {
- // Fudge the rect by one pixel to ensure we see all the corners.
- if (inRect.m_Width > 1)
- inRect.m_Width -= 1;
- if (inRect.m_Height > 1)
- inRect.m_Height -= 1;
- inRect.m_X += 1;
- inRect.m_Y += 1;
- // Figure out the rect center.
- SNode theNode;
-
- QT3DSVec2 rectGlobalCenter = inRect.Center();
- QT3DSVec2 rectCenter(theViewport.ToNormalizedRectRelative(rectGlobalCenter));
- theNode.m_Position.x = rectCenter.x;
- theNode.m_Position.y = rectCenter.y;
- theNode.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- theNode.CalculateGlobalVariables();
- QT3DSMat44 theViewProjection;
- theScreenCamera.CalculateViewProjectionMatrix(theViewProjection);
- QT3DSMat44 theMVP;
- QT3DSMat33 theNormal;
- theNode.CalculateMVPAndNormalMatrix(theViewProjection, theMVP, theNormal);
- m_Context->SetBlendingEnabled(false);
- m_Context->SetDepthWriteEnabled(false);
- m_Context->SetDepthTestEnabled(false);
- m_Context->SetCullingEnabled(false);
- m_Context->SetActiveShader(m_ScreenRectShader);
- m_ScreenRectShader->SetPropertyValue("model_view_projection", theMVP);
- m_ScreenRectShader->SetPropertyValue("output_color", inColor);
- m_ScreenRectShader->SetPropertyValue(
- "rectangle_dims", QT3DSVec3(inRect.m_Width / 2.0f, inRect.m_Height / 2.0f, 0.0f));
- }
- if (!m_RectInputAssembler) {
- QT3DS_ASSERT(m_QuadVertexBuffer);
- QT3DSU8 indexData[] = { 0, 1, 1, 2, 2, 3, 3, 0 };
-
- m_RectIndexBuffer = m_Context->CreateIndexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static,
- qt3ds::render::NVRenderComponentTypes::QT3DSU8, sizeof(indexData),
- toConstDataRef(indexData, sizeof(indexData)));
-
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- };
-
- // create our attribute layout
- m_RectAttribLayout = m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 1));
-
- QT3DSU32 strides = m_QuadVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_RectInputAssembler = m_Context->CreateInputAssembler(
- m_RectAttribLayout, toConstDataRef(&m_QuadVertexBuffer.mPtr, 1), m_RectIndexBuffer,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
-
- m_Context->SetInputAssembler(m_RectInputAssembler);
- m_Context->Draw(NVRenderDrawMode::Lines, m_RectIndexBuffer->GetNumIndices(), 0);
- }
-
- void Qt3DSRendererImpl::SetupWidgetLayer()
- {
- NVRenderContext &theContext = m_qt3dsContext.GetRenderContext();
-
- if (!m_WidgetTexture) {
- IResourceManager &theManager = m_qt3dsContext.GetResourceManager();
- m_WidgetTexture = theManager.AllocateTexture2D(m_BeginFrameViewport.m_Width,
- m_BeginFrameViewport.m_Height,
- NVRenderTextureFormats::RGBA8);
- m_WidgetFBO = theManager.AllocateFrameBuffer();
- m_WidgetFBO->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer(*m_WidgetTexture));
- theContext.SetRenderTarget(m_WidgetFBO);
-
- // NVRenderRect theScissorRect( 0, 0, m_BeginFrameViewport.m_Width,
- // m_BeginFrameViewport.m_Height );
- // NVRenderContextScopedProperty<NVRenderRect> __scissorRect( theContext,
- // &NVRenderContext::GetScissorRect, &NVRenderContext::SetScissorRect, theScissorRect );
- qt3ds::render::NVRenderContextScopedProperty<bool> __scissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled, false);
- m_Context->SetClearColor(QT3DSVec4(0, 0, 0, 0));
- m_Context->Clear(NVRenderClearValues::Color);
-
- } else
- theContext.SetRenderTarget(m_WidgetFBO);
- }
-
- void Qt3DSRendererImpl::BeginFrame()
- {
- for (QT3DSU32 idx = 0, end = m_LastFrameLayers.size(); idx < end; ++idx)
- m_LastFrameLayers[idx]->ResetForFrame();
- m_LastFrameLayers.clear();
- m_BeginFrameViewport = m_qt3dsContext.GetRenderList().GetViewport();
- }
- void Qt3DSRendererImpl::EndFrame()
- {
- if (m_WidgetTexture) {
- using qt3ds::render::NVRenderContextScopedProperty;
- // Releasing the widget FBO can set it as the active frame buffer.
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __fbo(
- *m_Context, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- STextureDetails theDetails = m_WidgetTexture->GetTextureDetails();
- m_Context->SetBlendingEnabled(true);
- // Colors are expected to be non-premultiplied, so we premultiply alpha into them at
- // this point.
- m_Context->SetBlendFunction(qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha));
- m_Context->SetBlendEquation(qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add));
-
- m_Context->SetDepthTestEnabled(false);
- m_Context->SetScissorTestEnabled(false);
- m_Context->SetViewport(m_BeginFrameViewport);
- SCamera theCamera;
- theCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- theCamera.m_Flags.SetOrthographic(true);
- QT3DSVec2 theTextureDims((QT3DSF32)theDetails.m_Width, (QT3DSF32)theDetails.m_Height);
- theCamera.CalculateGlobalVariables(
- NVRenderRect(0, 0, theDetails.m_Width, theDetails.m_Height), theTextureDims);
- QT3DSMat44 theViewProj;
- theCamera.CalculateViewProjectionMatrix(theViewProj);
- RenderQuad(theTextureDims, theViewProj, *m_WidgetTexture);
-
- IResourceManager &theManager(m_qt3dsContext.GetResourceManager());
- theManager.Release(*m_WidgetFBO);
- theManager.Release(*m_WidgetTexture);
- m_WidgetTexture = NULL;
- m_WidgetFBO = NULL;
- }
- }
-
- inline bool PickResultLessThan(const Qt3DSRenderPickResult &lhs, const Qt3DSRenderPickResult &rhs)
- {
- return FloatLessThan(lhs.m_CameraDistanceSq, rhs.m_CameraDistanceSq);
- }
-
- inline QT3DSF32 ClampUVCoord(QT3DSF32 inUVCoord, NVRenderTextureCoordOp::Enum inCoordOp)
- {
- if (inUVCoord > 1.0f || inUVCoord < 0.0f) {
- switch (inCoordOp) {
- default:
- QT3DS_ASSERT(false);
- break;
- case NVRenderTextureCoordOp::ClampToEdge:
- inUVCoord = NVMin(inUVCoord, 1.0f);
- inUVCoord = NVMax(inUVCoord, 0.0f);
- break;
- case NVRenderTextureCoordOp::Repeat: {
- QT3DSF32 multiplier = inUVCoord > 0.0f ? 1.0f : -1.0f;
- QT3DSF32 clamp = fabs(inUVCoord);
- clamp = clamp - floor(clamp);
- if (multiplier < 0)
- inUVCoord = 1.0f - clamp;
- else
- inUVCoord = clamp;
- } break;
- case NVRenderTextureCoordOp::MirroredRepeat: {
- QT3DSF32 multiplier = inUVCoord > 0.0f ? 1.0f : -1.0f;
- QT3DSF32 clamp = fabs(inUVCoord);
- if (multiplier > 0.0f)
- clamp -= 1.0f;
- QT3DSU32 isMirrored = ((QT3DSU32)clamp) % 2 == 0;
- QT3DSF32 remainder = clamp - floor(clamp);
- inUVCoord = remainder;
- if (isMirrored) {
- if (multiplier > 0.0f)
- inUVCoord = 1.0f - inUVCoord;
- } else {
- if (multiplier < 0.0f)
- inUVCoord = 1.0f - remainder;
- }
- } break;
- }
- }
- return inUVCoord;
- }
-
- static eastl::pair<QT3DSVec2, QT3DSVec2>
- GetMouseCoordsAndViewportFromSubObject(QT3DSVec2 inLocalHitUVSpace,
- Qt3DSRenderPickSubResult &inSubResult)
- {
- QT3DSMat44 theTextureMatrix(inSubResult.m_TextureMatrix);
- QT3DSVec3 theNewUVCoords(
- theTextureMatrix.transform(QT3DSVec3(inLocalHitUVSpace.x, inLocalHitUVSpace.y, 0)));
- theNewUVCoords.x = ClampUVCoord(theNewUVCoords.x, inSubResult.m_HorizontalTilingMode);
- theNewUVCoords.y = ClampUVCoord(theNewUVCoords.y, inSubResult.m_VerticalTilingMode);
- QT3DSVec2 theViewportDimensions =
- QT3DSVec2((QT3DSF32)inSubResult.m_ViewportWidth, (QT3DSF32)inSubResult.m_ViewportHeight);
- QT3DSVec2 theMouseCoords(theNewUVCoords.x * theViewportDimensions.x,
- (1.0f - theNewUVCoords.y) * theViewportDimensions.y);
-
- return eastl::make_pair(theMouseCoords, theViewportDimensions);
- }
-
- SPickResultProcessResult Qt3DSRendererImpl::ProcessPickResultList(bool inPickEverything)
- {
- if (m_LastPickResults.empty())
- return SPickResultProcessResult();
- // Things are rendered in a particular order and we need to respect that ordering.
- eastl::stable_sort(m_LastPickResults.begin(), m_LastPickResults.end(), PickResultLessThan);
-
- // We need to pick against sub objects basically somewhat recursively
- // but if we don't hit any sub objects and the parent isn't pickable then
- // we need to move onto the next item in the list.
- // We need to keep in mind that theQuery->Pick will enter this method in a later
- // stack frame so *if* we get to sub objects we need to pick against them but if the pick
- // completely misses *and* the parent object locally pickable is false then we need to move
- // onto the next object.
-
- QT3DSU32 maxPerFrameAllocationPickResultCount =
- SFastAllocator<>::SlabSize / sizeof(Qt3DSRenderPickResult);
- QT3DSU32 numToCopy =
- NVMin(maxPerFrameAllocationPickResultCount, (QT3DSU32)m_LastPickResults.size());
- QT3DSU32 numCopyBytes = numToCopy * sizeof(Qt3DSRenderPickResult);
- Qt3DSRenderPickResult *thePickResults = reinterpret_cast<Qt3DSRenderPickResult *>(
- GetPerFrameAllocator().allocate(numCopyBytes, "tempPickData", __FILE__, __LINE__));
- memCopy(thePickResults, m_LastPickResults.data(), numCopyBytes);
- m_LastPickResults.clear();
- bool foundValidResult = false;
- SPickResultProcessResult thePickResult(thePickResults[0]);
- for (size_t idx = 0; idx < numToCopy && foundValidResult == false; ++idx) {
- thePickResult = thePickResults[idx];
- // Here we do a hierarchy. Picking against sub objects takes precedence.
- // If picking against the sub object doesn't return a valid result *and*
- // the current object isn't globally pickable then we move onto the next object returned
- // by the pick query.
- if (thePickResult.m_HitObject != NULL && thePickResult.m_FirstSubObject != NULL
- && m_PickRenderPlugins) {
- QT3DSVec2 theUVCoords(thePickResult.m_LocalUVCoords.x,
- thePickResult.m_LocalUVCoords.y);
- IOffscreenRenderer *theSubRenderer(thePickResult.m_FirstSubObject->m_SubRenderer);
- eastl::pair<QT3DSVec2, QT3DSVec2> mouseAndViewport =
- GetMouseCoordsAndViewportFromSubObject(theUVCoords,
- *thePickResult.m_FirstSubObject);
- QT3DSVec2 theMouseCoords = mouseAndViewport.first;
- QT3DSVec2 theViewportDimensions = mouseAndViewport.second;
- IGraphObjectPickQuery *theQuery = theSubRenderer->GetGraphObjectPickQuery(this);
- if (theQuery) {
- Qt3DSRenderPickResult theInnerPickResult =
- theQuery->Pick(theMouseCoords, theViewportDimensions, inPickEverything);
- if (theInnerPickResult.m_HitObject) {
- thePickResult = theInnerPickResult;
- thePickResult.m_OffscreenRenderer = theSubRenderer;
- foundValidResult = true;
- thePickResult.m_WasPickConsumed = true;
- } else if (GraphObjectTypes::IsNodeType(thePickResult.m_HitObject->m_Type)) {
- const SNode *theNode =
- static_cast<const SNode *>(thePickResult.m_HitObject);
- if (theNode->m_Flags.IsGloballyPickable() == true) {
- foundValidResult = true;
- thePickResult.m_WasPickConsumed = true;
- }
- }
- } else {
- // If the sub renderer doesn't consume the pick then we return the picked object
- // itself. So no matter what, if we get to here the pick was consumed.
- thePickResult.m_WasPickConsumed = true;
- bool wasPickConsumed =
- theSubRenderer->Pick(theMouseCoords, theViewportDimensions, this);
- if (wasPickConsumed) {
- thePickResult.m_HitObject = NULL;
- foundValidResult = true;
- }
- }
- } else {
- foundValidResult = true;
- thePickResult.m_WasPickConsumed = true;
- }
- }
- return thePickResult;
- }
-
- Qt3DSRenderPickResult Qt3DSRendererImpl::Pick(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords, bool inPickSiblings,
- bool inPickEverything, const SRenderInstanceId id)
- {
- m_LastPickResults.clear();
-
- SLayer *theLayer = &inLayer;
- // Stepping through how the original runtime did picking it picked layers in order
- // stopping at the first hit. So objects on the top layer had first crack at the pick
- // vector itself.
- do {
- if (theLayer->m_Flags.IsActive()) {
- TInstanceRenderMap::iterator theIter
- = m_InstanceRenderMap.find(combineLayerAndId(theLayer, id));
- if (theIter != m_InstanceRenderMap.end()) {
- m_LastPickResults.clear();
- GetLayerHitObjectList(*theIter->second, inViewportDimensions, inMouseCoords,
- inPickEverything, m_LastPickResults,
- GetPerFrameAllocator());
- SPickResultProcessResult retval(ProcessPickResultList(inPickEverything));
- if (retval.m_WasPickConsumed)
- return retval;
- } else {
- // QT3DS_ASSERT( false );
- }
- }
-
- if (inPickSiblings)
- theLayer = GetNextLayer(*theLayer);
- else
- theLayer = NULL;
- } while (theLayer != NULL);
-
- return Qt3DSRenderPickResult();
- }
-
- static inline Option<QT3DSVec2> IntersectRayWithNode(const SNode &inNode,
- SRenderableObject &inRenderableObject,
- const SRay &inPickRay)
- {
- if (inRenderableObject.m_RenderableFlags.IsText()) {
- STextRenderable &theRenderable = static_cast<STextRenderable &>(inRenderableObject);
- if (&theRenderable.m_Text == &inNode) {
- return inPickRay.GetRelativeXY(inRenderableObject.m_GlobalTransform,
- inRenderableObject.m_Bounds);
- }
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- } else if (inRenderableObject.m_RenderableFlags.isDistanceField()) {
- SDistanceFieldRenderable &theRenderable = static_cast<SDistanceFieldRenderable &>(
- inRenderableObject);
- if (&theRenderable.m_text == &inNode) {
- return inPickRay.GetRelativeXY(inRenderableObject.m_GlobalTransform,
- inRenderableObject.m_Bounds);
- }
-#endif
- } else if (inRenderableObject.m_RenderableFlags.IsDefaultMaterialMeshSubset()) {
- SSubsetRenderable &theRenderable = static_cast<SSubsetRenderable &>(inRenderableObject);
- if (&theRenderable.m_ModelContext.m_Model == &inNode)
- return inPickRay.GetRelativeXY(inRenderableObject.m_GlobalTransform,
- inRenderableObject.m_Bounds);
- } else if (inRenderableObject.m_RenderableFlags.IsCustomMaterialMeshSubset()) {
- SCustomMaterialRenderable &theRenderable =
- static_cast<SCustomMaterialRenderable &>(inRenderableObject);
- if (&theRenderable.m_ModelContext.m_Model == &inNode)
- return inPickRay.GetRelativeXY(inRenderableObject.m_GlobalTransform,
- inRenderableObject.m_Bounds);
- } else {
- QT3DS_ASSERT(false);
- }
- return Empty();
- }
-
- static inline Qt3DSRenderPickSubResult ConstructSubResult(SImage &inImage)
- {
- STextureDetails theDetails = inImage.m_TextureData.m_Texture->GetTextureDetails();
- return Qt3DSRenderPickSubResult(*inImage.m_LastFrameOffscreenRenderer,
- inImage.m_TextureTransform, inImage.m_HorizontalTilingMode,
- inImage.m_VerticalTilingMode, theDetails.m_Width,
- theDetails.m_Height);
- }
-
- Option<QT3DSVec2> Qt3DSRendererImpl::FacePosition(SNode &inNode, NVBounds3 inBounds,
- const QT3DSMat44 &inGlobalTransform,
- const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords,
- NVDataRef<SGraphObject *> inMapperObjects,
- SBasisPlanes::Enum inPlane)
- {
- SLayerRenderData *theLayerData = GetOrCreateLayerRenderDataForNode(inNode);
- if (theLayerData == NULL)
- return Empty();
- // This function assumes the layer was rendered to the scene itself. There is another
- // function
- // for completely offscreen layers that don't get rendered to the scene.
- bool wasRenderToTarget(theLayerData->m_Layer.m_Flags.IsLayerRenderToTarget());
- if (wasRenderToTarget == false || theLayerData->m_Camera == NULL
- || theLayerData->m_LayerPrepResult.hasValue() == false
- || theLayerData->m_LastFrameOffscreenRenderer.mPtr != NULL)
- return Empty();
-
- QT3DSVec2 theMouseCoords(inMouseCoords);
- QT3DSVec2 theViewportDimensions(inViewportDimensions);
-
- for (QT3DSU32 idx = 0, end = inMapperObjects.size(); idx < end; ++idx) {
- SGraphObject &currentObject = *inMapperObjects[idx];
- if (currentObject.m_Type == GraphObjectTypes::Layer) {
- // The layer knows its viewport so it can take the information directly.
- // This is extremely counter intuitive but a good sign.
- } else if (currentObject.m_Type == GraphObjectTypes::Image) {
- SImage &theImage = static_cast<SImage &>(currentObject);
- SModel *theParentModel = NULL;
- if (theImage.m_Parent
- && theImage.m_Parent->m_Type == GraphObjectTypes::DefaultMaterial) {
- SDefaultMaterial *theMaterial =
- static_cast<SDefaultMaterial *>(theImage.m_Parent);
- if (theMaterial) {
- theParentModel = theMaterial->m_Parent;
- }
- }
- if (theParentModel == NULL) {
- QT3DS_ASSERT(false);
- return Empty();
- }
- NVBounds3 theModelBounds = theParentModel->GetBounds(
- GetQt3DSContext().GetBufferManager(), GetQt3DSContext().GetPathManager(), false);
-
- if (theModelBounds.isEmpty()) {
- QT3DS_ASSERT(false);
- return Empty();
- }
- Option<QT3DSVec2> relativeHit =
- FacePosition(*theParentModel, theModelBounds, theParentModel->m_GlobalTransform,
- theViewportDimensions, theMouseCoords, NVDataRef<SGraphObject *>(),
- SBasisPlanes::XY);
- if (relativeHit.isEmpty()) {
- return Empty();
- }
- Qt3DSRenderPickSubResult theResult = ConstructSubResult(theImage);
- QT3DSVec2 hitInUVSpace = (*relativeHit) + QT3DSVec2(.5f, .5f);
- eastl::pair<QT3DSVec2, QT3DSVec2> mouseAndViewport =
- GetMouseCoordsAndViewportFromSubObject(hitInUVSpace, theResult);
- theMouseCoords = mouseAndViewport.first;
- theViewportDimensions = mouseAndViewport.second;
- }
- }
-
- Option<SRay> theHitRay = theLayerData->m_LayerPrepResult->GetPickRay(
- theMouseCoords, theViewportDimensions, false);
- if (theHitRay.hasValue() == false)
- return Empty();
-
- // Scale the mouse coords to change them into the camera's numerical space.
- SRay thePickRay = *theHitRay;
- Option<QT3DSVec2> newValue = thePickRay.GetRelative(inGlobalTransform, inBounds, inPlane);
- return newValue;
- }
-
- Qt3DSRenderPickResult
- Qt3DSRendererImpl::PickOffscreenLayer(SLayer &/*inLayer*/, const QT3DSVec2 & /*inViewportDimensions*/
- ,
- const QT3DSVec2 & /*inMouseCoords*/
- ,
- bool /*inPickEverything*/)
- {
- return Qt3DSRenderPickResult();
- }
-
- QT3DSVec3 Qt3DSRendererImpl::UnprojectToPosition(SNode &inNode, QT3DSVec3 &inPosition,
- const QT3DSVec2 &inMouseVec) const
- {
- // Translate mouse into layer's coordinates
- SLayerRenderData *theData =
- const_cast<Qt3DSRendererImpl &>(*this).GetOrCreateLayerRenderDataForNode(inNode);
- if (theData == NULL || theData->m_Camera == NULL) {
- return QT3DSVec3(0, 0, 0);
- } // QT3DS_ASSERT( false ); return QT3DSVec3(0,0,0); }
-
- QSize theWindow = m_qt3dsContext.GetWindowDimensions();
- QT3DSVec2 theDims((QT3DSF32)theWindow.width(), (QT3DSF32)theWindow.height());
-
- SLayerRenderPreparationResult &thePrepResult(*theData->m_LayerPrepResult);
- SRay theRay = thePrepResult.GetPickRay(inMouseVec, theDims, true);
-
- return theData->m_Camera->UnprojectToPosition(inPosition, theRay);
- }
-
- QT3DSVec3 Qt3DSRendererImpl::UnprojectWithDepth(SNode &inNode, QT3DSVec3 &,
- const QT3DSVec3 &inMouseVec) const
- {
- // Translate mouse into layer's coordinates
- SLayerRenderData *theData =
- const_cast<Qt3DSRendererImpl &>(*this).GetOrCreateLayerRenderDataForNode(inNode);
- if (theData == NULL || theData->m_Camera == NULL) {
- return QT3DSVec3(0, 0, 0);
- } // QT3DS_ASSERT( false ); return QT3DSVec3(0,0,0); }
-
- // Flip the y into gl coordinates from window coordinates.
- QT3DSVec2 theMouse(inMouseVec.x, inMouseVec.y);
- NVReal theDepth = inMouseVec.z;
-
- SLayerRenderPreparationResult &thePrepResult(*theData->m_LayerPrepResult);
- QSize theWindow = m_qt3dsContext.GetWindowDimensions();
- SRay theRay = thePrepResult.GetPickRay(
- theMouse, QT3DSVec2((QT3DSF32)theWindow.width(), (QT3DSF32)theWindow.height()), true);
- QT3DSVec3 theTargetPosition = theRay.m_Origin + theRay.m_Direction * theDepth;
- if (inNode.m_Parent != NULL && inNode.m_Parent->m_Type != GraphObjectTypes::Layer)
- theTargetPosition =
- inNode.m_Parent->m_GlobalTransform.getInverse().transform(theTargetPosition);
- // Our default global space is right handed, so if you are left handed z means something
- // opposite.
- if (inNode.m_Flags.IsLeftHanded())
- theTargetPosition.z *= -1;
- return theTargetPosition;
- }
-
- QT3DSVec3 Qt3DSRendererImpl::ProjectPosition(SNode &inNode, const QT3DSVec3 &inPosition) const
- {
- // Translate mouse into layer's coordinates
- SLayerRenderData *theData =
- const_cast<Qt3DSRendererImpl &>(*this).GetOrCreateLayerRenderDataForNode(inNode);
- if (theData == NULL || theData->m_Camera == NULL) {
- return QT3DSVec3(0, 0, 0);
- }
-
- QT3DSMat44 viewProj;
- theData->m_Camera->CalculateViewProjectionMatrix(viewProj);
- QT3DSVec4 projPos = viewProj.transform(QT3DSVec4(inPosition, 1.0f));
- projPos.x /= projPos.w;
- projPos.y /= projPos.w;
-
- NVRenderRectF theViewport = theData->m_LayerPrepResult->GetLayerToPresentationViewport();
- QT3DSVec2 theDims((QT3DSF32)theViewport.m_Width, (QT3DSF32)theViewport.m_Height);
- projPos.x += 1.0;
- projPos.y += 1.0;
- projPos.x *= 0.5;
- projPos.y *= 0.5;
- QT3DSVec3 cameraToObject = theData->m_Camera->GetGlobalPos() - inPosition;
- projPos.z = sqrtf(cameraToObject.dot(cameraToObject));
- QT3DSVec3 mouseVec = QT3DSVec3(projPos.x, projPos.y, projPos.z);
- mouseVec.x *= theDims.x;
- mouseVec.y *= theDims.y;
-
- mouseVec.x += theViewport.m_X;
- mouseVec.y += theViewport.m_Y;
-
- // Flip the y into window coordinates so it matches the mouse.
- QSize theWindow = m_qt3dsContext.GetWindowDimensions();
- mouseVec.y = theWindow.height() - mouseVec.y;
-
- return mouseVec;
- }
-
- Option<SLayerPickSetup> Qt3DSRendererImpl::GetLayerPickSetup(SLayer &inLayer,
- const QT3DSVec2 &inMouseCoords,
- const QSize &inPickDims)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inLayer);
- if (theData == NULL || theData->m_Camera == NULL) {
- QT3DS_ASSERT(false);
- return Empty();
- }
- QSize theWindow = m_qt3dsContext.GetWindowDimensions();
- QT3DSVec2 theDims((QT3DSF32)theWindow.width(), (QT3DSF32)theWindow.height());
- // The mouse is relative to the layer
- Option<QT3DSVec2> theLocalMouse = GetLayerMouseCoords(*theData, inMouseCoords, theDims, false);
- if (theLocalMouse.hasValue() == false) {
- return Empty();
- }
-
- SLayerRenderPreparationResult &thePrepResult(*theData->m_LayerPrepResult);
- if (thePrepResult.GetCamera() == NULL) {
- return Empty();
- }
- // Perform gluPickMatrix and pre-multiply it into the view projection
- QT3DSMat44 theTransScale(QT3DSMat44::createIdentity());
- SCamera &theCamera(*thePrepResult.GetCamera());
-
- NVRenderRectF layerToPresentation = thePrepResult.GetLayerToPresentationViewport();
- // Offsetting is already taken care of in the camera's projection.
- // All we need to do is to scale and translate the image.
- layerToPresentation.m_X = 0;
- layerToPresentation.m_Y = 0;
- QT3DSVec2 theMouse(*theLocalMouse);
- // The viewport will need to center at this location
- QT3DSVec2 viewportDims((QT3DSF32)inPickDims.width(), (QT3DSF32)inPickDims.height());
- QT3DSVec2 bottomLeft =
- QT3DSVec2(theMouse.x - viewportDims.x / 2.0f, theMouse.y - viewportDims.y / 2.0f);
- // For some reason, and I haven't figured out why yet, the offsets need to be backwards for
- // this to work.
- // bottomLeft.x = layerToPresentation.m_Width - bottomLeft.x;
- // bottomLeft.y = layerToPresentation.m_Height - bottomLeft.y;
- // Virtual rect is relative to the layer.
- NVRenderRectF thePickRect(bottomLeft.x, bottomLeft.y, viewportDims.x, viewportDims.y);
- QT3DSMat44 projectionPremult(QT3DSMat44::createIdentity());
- projectionPremult = render::NVRenderContext::ApplyVirtualViewportToProjectionMatrix(
- projectionPremult, layerToPresentation, thePickRect);
- projectionPremult = projectionPremult.getInverse();
-
- QT3DSMat44 globalInverse = theCamera.m_GlobalTransform.getInverse();
- QT3DSMat44 theVP = theCamera.m_Projection * globalInverse;
- // For now we won't setup the scissor, so we may be off by inPickDims at most because
- // GetLayerMouseCoords will return
- // false if the mouse is too far off the layer.
- return SLayerPickSetup(projectionPremult, theVP,
- NVRenderRect(0, 0, (QT3DSU32)layerToPresentation.m_Width,
- (QT3DSU32)layerToPresentation.m_Height));
- }
-
- Option<NVRenderRectF> Qt3DSRendererImpl::GetLayerRect(SLayer &inLayer)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inLayer);
- if (theData == NULL || theData->m_Camera == NULL) {
- QT3DS_ASSERT(false);
- return Empty();
- }
- SLayerRenderPreparationResult &thePrepResult(*theData->m_LayerPrepResult);
- return thePrepResult.GetLayerToPresentationViewport();
- }
-
- // This doesn't have to be cheap.
- void Qt3DSRendererImpl::RunLayerRender(SLayer &inLayer, const QT3DSMat44 &inViewProjection)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inLayer);
- if (theData == NULL || theData->m_Camera == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- theData->PrepareAndRender(inViewProjection);
- }
-
- void Qt3DSRendererImpl::AddRenderWidget(IRenderWidget &inWidget)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inWidget.GetNode());
- if (theData)
- theData->AddRenderWidget(inWidget);
- }
-
- void Qt3DSRendererImpl::RenderLayerRect(SLayer &inLayer, const QT3DSVec3 &inColor)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inLayer);
- if (theData)
- theData->m_BoundingRectColor = inColor;
- }
-
- SScaleAndPosition Qt3DSRendererImpl::GetWorldToPixelScaleFactor(const SCamera &inCamera,
- const QT3DSVec3 &inWorldPoint,
- SLayerRenderData &inRenderData)
- {
- if (inCamera.m_Flags.IsOrthographic() == true) {
- // There are situations where the camera can scale.
- return SScaleAndPosition(
- inWorldPoint,
- inCamera.GetOrthographicScaleFactor(
- inRenderData.m_LayerPrepResult->GetLayerToPresentationViewport(),
- inRenderData.m_LayerPrepResult->GetPresentationDesignDimensions()));
- } else {
- QT3DSVec3 theCameraPos(0, 0, 0);
- QT3DSVec3 theCameraDir(0, 0, -1);
- SRay theRay(theCameraPos, inWorldPoint - theCameraPos);
- NVPlane thePlane(theCameraDir, -600);
- QT3DSVec3 theItemPosition(inWorldPoint);
- Option<QT3DSVec3> theIntersection = theRay.Intersect(thePlane);
- if (theIntersection.hasValue())
- theItemPosition = *theIntersection;
- // The special number comes in from physically measuring how off we are on the screen.
- QT3DSF32 theScaleFactor = (1.0f / inCamera.m_Projection.column1[1]);
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inCamera);
- QT3DSU32 theHeight = theData->m_LayerPrepResult->GetTextureDimensions().height();
- QT3DSF32 theScaleMultiplier = 600.0f / ((QT3DSF32)theHeight / 2.0f);
- theScaleFactor *= theScaleMultiplier;
-
- return SScaleAndPosition(theItemPosition, theScaleFactor);
- }
- }
-
- SScaleAndPosition Qt3DSRendererImpl::GetWorldToPixelScaleFactor(SLayer &inLayer,
- const QT3DSVec3 &inWorldPoint)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inLayer);
- if (theData == NULL || theData->m_Camera == NULL) {
- QT3DS_ASSERT(false);
- return SScaleAndPosition();
- }
- return GetWorldToPixelScaleFactor(*theData->m_Camera, inWorldPoint, *theData);
- }
-
- void Qt3DSRendererImpl::ReleaseLayerRenderResources(SLayer &inLayer, const SRenderInstanceId id)
- {
- TInstanceRenderMap::iterator theIter
- = m_InstanceRenderMap.find(combineLayerAndId(&inLayer, id));
- if (theIter != m_InstanceRenderMap.end()) {
- TLayerRenderList::iterator theLastFrm = eastl::find(
- m_LastFrameLayers.begin(), m_LastFrameLayers.end(), theIter->second.mPtr);
- if (theLastFrm != m_LastFrameLayers.end()) {
- theIter->second->ResetForFrame();
- m_LastFrameLayers.erase(theLastFrm);
- }
- m_InstanceRenderMap.erase(theIter);
- }
- }
-
- void Qt3DSRendererImpl::RenderQuad(const QT3DSVec2 inDimensions, const QT3DSMat44 &inMVP,
- NVRenderTexture2D &inQuadTexture)
- {
- m_Context->SetCullingEnabled(false);
- SLayerSceneShader *theShader = GetSceneLayerShader();
- NVRenderContext &theContext(*m_Context);
- theContext.SetActiveShader(&theShader->m_Shader);
- theShader->m_MVP.Set(inMVP);
- theShader->m_Dimensions.Set(inDimensions);
- theShader->m_Sampler.Set(&inQuadTexture);
-
- GenerateXYQuad();
- theContext.SetInputAssembler(m_QuadInputAssembler);
- theContext.Draw(NVRenderDrawMode::Triangles, m_QuadIndexBuffer->GetNumIndices(), 0);
- }
-
- void Qt3DSRendererImpl::RenderQuad()
- {
- m_Context->SetCullingEnabled(false);
- GenerateXYQuad();
- m_Context->SetInputAssembler(m_QuadInputAssembler);
- m_Context->Draw(NVRenderDrawMode::Triangles, m_QuadIndexBuffer->GetNumIndices(), 0);
- }
-
- void Qt3DSRendererImpl::RenderPointsIndirect()
- {
- m_Context->SetCullingEnabled(false);
- GenerateXYZPoint();
- m_Context->SetInputAssembler(m_PointInputAssembler);
- m_Context->DrawIndirect(NVRenderDrawMode::Points, 0);
- }
-
- void Qt3DSRendererImpl::LayerNeedsFrameClear(SLayerRenderData &inLayer)
- {
- m_LastFrameLayers.push_back(&inLayer);
- }
-
- void Qt3DSRendererImpl::BeginLayerDepthPassRender(SLayerRenderData &inLayer)
- {
- m_CurrentLayer = &inLayer;
- }
-
- void Qt3DSRendererImpl::EndLayerDepthPassRender() { m_CurrentLayer = NULL; }
-
- void Qt3DSRendererImpl::BeginLayerRender(SLayerRenderData &inLayer)
- {
- m_CurrentLayer = &inLayer;
- // Remove all of the shaders from the layer shader set
- // so that we can only apply the camera and lighting properties to
- // shaders that are in the layer.
- m_LayerShaders.clear();
- }
- void Qt3DSRendererImpl::EndLayerRender() { m_CurrentLayer = NULL; }
-
-// Allocate an object that lasts only this frame.
-#define RENDER_FRAME_NEW(type) \
- new (m_PerFrameAllocator.m_FastAllocator.allocate(sizeof(type), __FILE__, __LINE__)) type
-
- void Qt3DSRendererImpl::PrepareImageForIbl(SImage &inImage)
- {
- if (inImage.m_TextureData.m_Texture && inImage.m_TextureData.m_Texture->GetNumMipmaps() < 1)
- inImage.m_TextureData.m_Texture->GenerateMipmaps();
- }
-
- bool NodeContainsBoneRoot(SNode &childNode, QT3DSI32 rootID)
- {
- for (SNode *childChild = childNode.m_FirstChild; childChild != NULL;
- childChild = childChild->m_NextSibling) {
- if (childChild->m_SkeletonId == rootID)
- return true;
- }
-
- return false;
- }
-
- void FillBoneIdNodeMap(SNode &childNode, nvhash_map<long, SNode *> &ioMap)
- {
- if (childNode.m_SkeletonId >= 0)
- ioMap[childNode.m_SkeletonId] = &childNode;
- for (SNode *childChild = childNode.m_FirstChild; childChild != NULL;
- childChild = childChild->m_NextSibling)
- FillBoneIdNodeMap(*childChild, ioMap);
- }
-
- bool Qt3DSRendererImpl::PrepareTextureAtlasForRender()
- {
- ITextTextureAtlas *theTextureAtlas = m_qt3dsContext.GetTextureAtlas();
- if (theTextureAtlas == NULL)
- return false;
-
- // this is a one time creation
- if (!theTextureAtlas->IsInitialized()) {
- NVRenderContext &theContext(*m_Context);
- NVScopedRefCounted<NVRenderVertexBuffer> mVertexBuffer;
- NVScopedRefCounted<NVRenderInputAssembler> mInputAssembler;
- NVScopedRefCounted<NVRenderAttribLayout> mAttribLayout;
- // temporay FB
- using qt3ds::render::NVRenderContextScopedProperty;
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __fbo(
- *m_Context, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
-
- ITextRenderer &theTextRenderer(*m_qt3dsContext.GetOnscreenTextRenderer());
- TTextTextureAtlasDetailsAndTexture theResult = theTextureAtlas->PrepareTextureAtlas();
- if (!theResult.first.m_EntryCount) {
- QT3DS_ASSERT(theResult.first.m_EntryCount);
- return false;
- }
-
- // generate the index buffer we need
- GenerateXYQuad();
-
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- qt3ds::render::NVRenderVertexBufferEntry(
- "attr_uv", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2, 12),
- };
-
- // create our attribute layout
- mAttribLayout = m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 2));
-
- NVRenderFrameBuffer *theAtlasFB(
- m_qt3dsContext.GetResourceManager().AllocateFrameBuffer());
- theAtlasFB->Attach(NVRenderFrameBufferAttachments::Color0, *theResult.second);
- m_qt3dsContext.GetRenderContext().SetRenderTarget(theAtlasFB);
-
- // this texture contains our single entries
- NVRenderTexture2D *theTexture = nullptr;
- if (m_Context->GetRenderContextType() == NVRenderContextValues::GLES2) {
- theTexture = m_qt3dsContext.GetResourceManager()
- .AllocateTexture2D(32, 32, NVRenderTextureFormats::RGBA8);
- } else {
- theTexture = m_qt3dsContext.GetResourceManager()
- .AllocateTexture2D(32, 32, NVRenderTextureFormats::Alpha8);
- }
- m_Context->SetClearColor(QT3DSVec4(0, 0, 0, 0));
- m_Context->Clear(NVRenderClearValues::Color);
- m_Context->SetDepthTestEnabled(false);
- m_Context->SetScissorTestEnabled(false);
- m_Context->SetCullingEnabled(false);
- m_Context->SetBlendingEnabled(false);
- m_Context->SetViewport(
- NVRenderRect(0, 0, theResult.first.m_TextWidth, theResult.first.m_TextHeight));
-
- SCamera theCamera;
- theCamera.m_ClipNear = -1.0;
- theCamera.m_ClipFar = 1.0;
- theCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- theCamera.m_Flags.SetOrthographic(true);
- QT3DSVec2 theTextureDims((QT3DSF32)theResult.first.m_TextWidth,
- (QT3DSF32)theResult.first.m_TextHeight);
- theCamera.CalculateGlobalVariables(
- NVRenderRect(0, 0, theResult.first.m_TextWidth, theResult.first.m_TextHeight),
- theTextureDims);
- // We want a 2D lower left projection
- QT3DSF32 *writePtr(theCamera.m_Projection.front());
- writePtr[12] = -1;
- writePtr[13] = -1;
-
- // generate render stuff
- // We dynamicall update the vertex buffer
- QT3DSF32 tempBuf[20];
- QT3DSF32 *bufPtr = tempBuf;
- QT3DSU32 bufSize = 20 * sizeof(QT3DSF32); // 4 vertices 3 pos 2 tex
- NVDataRef<QT3DSU8> vertData((QT3DSU8 *)bufPtr, bufSize);
- mVertexBuffer = theContext.CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Dynamic, 20 * sizeof(QT3DSF32),
- 3 * sizeof(QT3DSF32) + 2 * sizeof(QT3DSF32), vertData);
- QT3DSU32 strides = mVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- mInputAssembler = theContext.CreateInputAssembler(
- mAttribLayout, toConstDataRef(&mVertexBuffer.mPtr, 1), m_QuadIndexBuffer.mPtr,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
-
- NVRenderShaderProgram *theShader = GetTextAtlasEntryShader();
- STextShader theTextShader(*theShader);
-
- if (theShader) {
- theContext.SetActiveShader(theShader);
- theTextShader.m_MVP.Set(theCamera.m_Projection);
-
- // we are going through all entries and render to the FBO
- for (QT3DSU32 i = 0; i < theResult.first.m_EntryCount; i++) {
- STextTextureAtlasEntryDetails theDetails =
- theTextRenderer.RenderAtlasEntry(i, *theTexture);
- // update vbo
- // we need to mirror coordinates
- QT3DSF32 x1 = (QT3DSF32)theDetails.m_X;
- QT3DSF32 x2 = (QT3DSF32)theDetails.m_X + theDetails.m_TextWidth;
- QT3DSF32 y1 = (QT3DSF32)theDetails.m_Y;
- QT3DSF32 y2 = (QT3DSF32)theDetails.m_Y + theDetails.m_TextHeight;
-
- QT3DSF32 box[4][5] = {
- { x1, y1, 0, 0, 1 },
- { x1, y2, 0, 0, 0 },
- { x2, y2, 0, 1, 0 },
- { x2, y1, 0, 1, 1 },
- };
-
- NVDataRef<QT3DSU8> vertData((QT3DSU8 *)box, bufSize);
- mVertexBuffer->UpdateBuffer(vertData, false);
-
- theTextShader.m_Sampler.Set(theTexture);
-
- theContext.SetInputAssembler(mInputAssembler);
- theContext.Draw(NVRenderDrawMode::Triangles, m_QuadIndexBuffer->GetNumIndices(),
- 0);
- }
- }
-
- m_qt3dsContext.GetResourceManager().Release(*theTexture);
- m_qt3dsContext.GetResourceManager().Release(*theAtlasFB);
-
- return true;
- }
-
- return theTextureAtlas->IsInitialized();
- }
-
- Option<QT3DSVec2> Qt3DSRendererImpl::GetLayerMouseCoords(SLayerRenderData &inLayerRenderData,
- const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool forceImageIntersect) const
- {
- if (inLayerRenderData.m_LayerPrepResult.hasValue())
- return inLayerRenderData.m_LayerPrepResult->GetLayerMouseCoords(
- inMouseCoords, inViewportDimensions, forceImageIntersect);
- return Empty();
- }
-
- void Qt3DSRendererImpl::GetLayerHitObjectList(SLayerRenderData &inLayerRenderData,
- const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inPresCoords, bool inPickEverything,
- TPickResultArray &outIntersectionResult,
- NVAllocatorCallback &inTempAllocator)
- {
- // This function assumes the layer was rendered to the scene itself. There is another
- // function
- // for completely offscreen layers that don't get rendered to the scene.
- bool wasRenderToTarget(inLayerRenderData.m_Layer.m_Flags.IsLayerRenderToTarget());
- if (wasRenderToTarget && inLayerRenderData.m_Camera != NULL) {
- Option<SRay> theHitRay;
- if (inLayerRenderData.m_LayerPrepResult.hasValue()) {
- theHitRay = inLayerRenderData.m_LayerPrepResult->GetPickRay(
- inPresCoords, inViewportDimensions, false, m_Context->isSceneCameraView());
- }
- if (inLayerRenderData.m_LastFrameOffscreenRenderer.mPtr == NULL) {
- if (theHitRay.hasValue()) {
- // Scale the mouse coords to change them into the camera's numerical space.
- SRay thePickRay = *theHitRay;
- for (QT3DSU32 idx = inLayerRenderData.m_OpaqueObjects.size(), end = 0; idx > end;
- --idx) {
- SRenderableObject *theRenderableObject =
- inLayerRenderData.m_OpaqueObjects[idx - 1];
- if (inPickEverything
- || theRenderableObject->m_RenderableFlags.GetPickable())
- IntersectRayWithSubsetRenderable(thePickRay, *theRenderableObject,
- outIntersectionResult,
- inTempAllocator);
- }
- for (QT3DSU32 idx = inLayerRenderData.m_TransparentObjects.size(), end = 0;
- idx > end; --idx) {
- SRenderableObject *theRenderableObject =
- inLayerRenderData.m_TransparentObjects[idx - 1];
- if (inPickEverything
- || theRenderableObject->m_RenderableFlags.GetPickable())
- IntersectRayWithSubsetRenderable(thePickRay, *theRenderableObject,
- outIntersectionResult,
- inTempAllocator);
- }
- }
- } else {
- IGraphObjectPickQuery *theQuery =
- inLayerRenderData.m_LastFrameOffscreenRenderer->GetGraphObjectPickQuery(this);
- if (theQuery) {
- Qt3DSRenderPickResult theResult =
- theQuery->Pick(inPresCoords, inViewportDimensions, inPickEverything);
- if (theResult.m_HitObject) {
- theResult.m_OffscreenRenderer =
- inLayerRenderData.m_LastFrameOffscreenRenderer;
- outIntersectionResult.push_back(theResult);
- }
- } else
- inLayerRenderData.m_LastFrameOffscreenRenderer->Pick(inPresCoords,
- inViewportDimensions,
- this);
- }
- }
- }
-
- static inline Qt3DSRenderPickSubResult ConstructSubResult(SRenderableImage &inImage)
- {
- return ConstructSubResult(inImage.m_Image);
- }
-
- void Qt3DSRendererImpl::IntersectRayWithSubsetRenderable(
- const SRay &inRay, SRenderableObject &inRenderableObject,
- TPickResultArray &outIntersectionResultList, NVAllocatorCallback &inTempAllocator)
- {
- Option<SRayIntersectionResult> theIntersectionResultOpt(inRay.IntersectWithAABB(
- inRenderableObject.m_GlobalTransform, inRenderableObject.m_Bounds));
- if (theIntersectionResultOpt.hasValue() == false)
- return;
- SRayIntersectionResult &theResult(*theIntersectionResultOpt);
-
- // Leave the coordinates relative for right now.
- const SGraphObject *thePickObject = NULL;
- if (inRenderableObject.m_RenderableFlags.IsDefaultMaterialMeshSubset())
- thePickObject =
- &static_cast<SSubsetRenderable *>(&inRenderableObject)->m_ModelContext.m_Model;
- else if (inRenderableObject.m_RenderableFlags.IsText())
- thePickObject = &static_cast<STextRenderable *>(&inRenderableObject)->m_Text;
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- else if (inRenderableObject.m_RenderableFlags.isDistanceField())
- thePickObject = &static_cast<SDistanceFieldRenderable *>(&inRenderableObject)->m_text;
-#endif
- else if (inRenderableObject.m_RenderableFlags.IsCustomMaterialMeshSubset())
- thePickObject = &static_cast<SCustomMaterialRenderable *>(&inRenderableObject)
- ->m_ModelContext.m_Model;
- else if (inRenderableObject.m_RenderableFlags.IsPath())
- thePickObject = &static_cast<SPathRenderable *>(&inRenderableObject)->m_Path;
-
- if (thePickObject != NULL) {
- outIntersectionResultList.push_back(Qt3DSRenderPickResult(
- *thePickObject, theResult.m_RayLengthSquared, theResult.m_RelXY));
-
- // For subsets, we know we can find images on them which may have been the result
- // of rendering a sub-presentation.
- if (inRenderableObject.m_RenderableFlags.IsDefaultMaterialMeshSubset()) {
- Qt3DSRenderPickSubResult *theLastResult = NULL;
- for (SRenderableImage *theImage =
- static_cast<SSubsetRenderable *>(&inRenderableObject)->m_FirstImage;
- theImage != NULL; theImage = theImage->m_NextImage) {
- if (theImage->m_Image.m_LastFrameOffscreenRenderer != NULL
- && theImage->m_Image.m_TextureData.m_Texture != NULL) {
- Qt3DSRenderPickSubResult *theSubResult =
- (Qt3DSRenderPickSubResult *)inTempAllocator.allocate(
- sizeof(Qt3DSRenderPickSubResult), "Qt3DSRenderPickSubResult",
- __FILE__, __LINE__);
-
- new (theSubResult) Qt3DSRenderPickSubResult(ConstructSubResult(*theImage));
- if (theLastResult == NULL)
- outIntersectionResultList.back().m_FirstSubObject = theSubResult;
- else
- theLastResult->m_NextSibling = theSubResult;
- theLastResult = theSubResult;
- }
- }
- }
- }
- }
-
-#ifndef EA_PLATFORM_WINDOWS
-#define _snprintf snprintf
-#endif
-
- NVRenderShaderProgram *Qt3DSRendererImpl::CompileShader(CRegisteredString inName,
- const char8_t *inVert,
- const char8_t *inFrag)
- {
- GetProgramGenerator().BeginProgram();
- GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex)->Append(inVert);
- GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment)->Append(inFrag);
- return GetProgramGenerator().CompileGeneratedShader(inName);
- }
-
- const QT3DSF32 MINATTENUATION = 0;
- const QT3DSF32 MAXATTENUATION = 1000;
-
- QT3DSF32 ClampFloat(QT3DSF32 value, QT3DSF32 min, QT3DSF32 max)
- {
- return value < min ? min : ((value > max) ? max : value);
- }
-
- QT3DSF32 TranslateConstantAttenuation(QT3DSF32 attenuation) { return attenuation * .01f; }
-
- QT3DSF32 TranslateLinearAttenuation(QT3DSF32 attenuation)
- {
- attenuation = ClampFloat(attenuation, MINATTENUATION, MAXATTENUATION);
- return attenuation * 0.0001f;
- }
-
- QT3DSF32 TranslateQuadraticAttenuation(QT3DSF32 attenuation)
- {
- attenuation = ClampFloat(attenuation, MINATTENUATION, MAXATTENUATION);
- return attenuation * 0.0000001f;
- }
-
- SShaderGeneratorGeneratedShader *Qt3DSRendererImpl::GetShader(SSubsetRenderable &inRenderable,
- TShaderFeatureSet inFeatureSet)
- {
- if (m_CurrentLayer == NULL) {
- QT3DS_ASSERT(false);
- return NULL;
- }
- TShaderMap::iterator theFind = m_Shaders.find(inRenderable.m_ShaderDescription);
- SShaderGeneratorGeneratedShader *retval = NULL;
- if (theFind == m_Shaders.end()) {
- // Generate the shader.
- NVRenderShaderProgram *theShader(GenerateShader(inRenderable, inFeatureSet));
- if (theShader) {
- SShaderGeneratorGeneratedShader *theGeneratedShader =
- (SShaderGeneratorGeneratedShader *)m_Context->GetAllocator().allocate(
- sizeof(SShaderGeneratorGeneratedShader), "SShaderGeneratorGeneratedShader",
- __FILE__, __LINE__);
- new (theGeneratedShader) SShaderGeneratorGeneratedShader(
- m_StringTable->RegisterStr(m_GeneratedShaderString.c_str()), *theShader);
- m_Shaders.insert(make_pair(inRenderable.m_ShaderDescription, theGeneratedShader));
- retval = theGeneratedShader;
- }
- // We still insert something because we don't to attempt to generate the same bad shader
- // twice.
- else
- m_Shaders.insert(make_pair(inRenderable.m_ShaderDescription,
- (SShaderGeneratorGeneratedShader *)NULL));
- } else
- retval = theFind->second;
-
- if (retval != NULL) {
- if (!m_LayerShaders.contains(*retval)) {
- m_LayerShaders.insert(*retval);
- }
- if (m_CurrentLayer && m_CurrentLayer->m_Camera) {
- SCamera &theCamera(*m_CurrentLayer->m_Camera);
- if (m_CurrentLayer->m_CameraDirection.hasValue() == false)
- m_CurrentLayer->m_CameraDirection = theCamera.GetScalingCorrectDirection();
- }
- }
- return retval;
- }
- static QT3DSVec3 g_fullScreenRectFace[] = {
- QT3DSVec3(-1, -1, 0), QT3DSVec3(-1, 1, 0), QT3DSVec3(1, 1, 0), QT3DSVec3(1, -1, 0),
- };
-
- static QT3DSVec2 g_fullScreenRectUVs[] = { QT3DSVec2(0, 0), QT3DSVec2(0, 1), QT3DSVec2(1, 1),
- QT3DSVec2(1, 0) };
-
- void Qt3DSRendererImpl::GenerateXYQuad()
- {
- if (m_QuadInputAssembler)
- return;
-
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- qt3ds::render::NVRenderVertexBufferEntry("attr_uv",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2, 12),
- };
-
- QT3DSF32 tempBuf[20];
- QT3DSF32 *bufPtr = tempBuf;
- QT3DSVec3 *facePtr(g_fullScreenRectFace);
- QT3DSVec2 *uvPtr(g_fullScreenRectUVs);
- for (int j = 0; j < 4; j++, ++facePtr, ++uvPtr, bufPtr += 5) {
- bufPtr[0] = facePtr->x;
- bufPtr[1] = facePtr->y;
- bufPtr[2] = facePtr->z;
- bufPtr[3] = uvPtr->x;
- bufPtr[4] = uvPtr->y;
- }
- m_QuadVertexBuffer = m_Context->CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static, 20 * sizeof(QT3DSF32),
- 3 * sizeof(QT3DSF32) + 2 * sizeof(QT3DSF32), toU8DataRef(tempBuf, 20));
-
- QT3DSU8 indexData[] = {
- 0, 1, 2, 0, 2, 3,
- };
- m_QuadIndexBuffer = m_Context->CreateIndexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static, qt3ds::render::NVRenderComponentTypes::QT3DSU8,
- sizeof(indexData), toU8DataRef(indexData, sizeof(indexData)));
-
- // create our attribute layout
- m_QuadAttribLayout = m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 2));
-
- // create input assembler object
- QT3DSU32 strides = m_QuadVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_QuadInputAssembler = m_Context->CreateInputAssembler(
- m_QuadAttribLayout, toConstDataRef(&m_QuadVertexBuffer.mPtr, 1), m_QuadIndexBuffer,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
-
- void Qt3DSRendererImpl::GenerateXYZPoint()
- {
- if (m_PointInputAssembler)
- return;
-
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- qt3ds::render::NVRenderVertexBufferEntry("attr_uv",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2, 12),
- };
-
- QT3DSF32 tempBuf[5];
- tempBuf[0] = tempBuf[1] = tempBuf[2] = 0.0;
- tempBuf[3] = tempBuf[4] = 0.0;
-
- m_PointVertexBuffer = m_Context->CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static, 5 * sizeof(QT3DSF32),
- 3 * sizeof(QT3DSF32) + 2 * sizeof(QT3DSF32), toU8DataRef(tempBuf, 5));
-
- // create our attribute layout
- m_PointAttribLayout = m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 2));
-
- // create input assembler object
- QT3DSU32 strides = m_PointVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_PointInputAssembler = m_Context->CreateInputAssembler(
- m_PointAttribLayout, toConstDataRef(&m_PointVertexBuffer.mPtr, 1), NULL,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
-
- eastl::pair<NVRenderVertexBuffer *, NVRenderIndexBuffer *> Qt3DSRendererImpl::GetXYQuad()
- {
- if (!m_QuadInputAssembler)
- GenerateXYQuad();
-
- return eastl::make_pair(m_QuadVertexBuffer.mPtr, m_QuadIndexBuffer.mPtr);
- }
-
- SLayerGlobalRenderProperties Qt3DSRendererImpl::GetLayerGlobalRenderProperties()
- {
- SLayerRenderData &theData = *m_CurrentLayer;
- SLayer &theLayer = theData.m_Layer;
- if (theData.m_CameraDirection.hasValue() == false)
- theData.m_CameraDirection = theData.m_Camera->GetScalingCorrectDirection();
-
- return SLayerGlobalRenderProperties(
- theLayer, *theData.m_Camera, *theData.m_CameraDirection, theData.m_Lights,
- theData.m_LightDirections, theData.m_ShadowMapManager.mPtr, theData.m_LayerDepthTexture,
- theData.m_LayerSsaoTexture, theLayer.m_LightProbe, theLayer.m_LightProbe2,
- theLayer.m_ProbeHorizon, theLayer.m_ProbeBright, theLayer.m_Probe2Window,
- theLayer.m_Probe2Pos, theLayer.m_Probe2Fade, theLayer.m_ProbeFov);
- }
-
- void Qt3DSRendererImpl::GenerateXYQuadStrip()
- {
- if (m_QuadStripInputAssembler)
- return;
-
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- qt3ds::render::NVRenderVertexBufferEntry("attr_uv",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2, 12),
- };
-
- // this buffer is filled dynmically
- m_QuadStripVertexBuffer =
- m_Context->CreateVertexBuffer(qt3ds::render::NVRenderBufferUsageType::Dynamic, 0,
- 3 * sizeof(QT3DSF32) + 2 * sizeof(QT3DSF32) // stride
- ,
- NVDataRef<QT3DSU8>());
-
- // create our attribute layout
- m_QuadStripAttribLayout = m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 2));
-
- // create input assembler object
- QT3DSU32 strides = m_QuadStripVertexBuffer->GetStride();
- QT3DSU32 offsets = 0;
- m_QuadStripInputAssembler = m_Context->CreateInputAssembler(
- m_QuadStripAttribLayout, toConstDataRef(&m_QuadStripVertexBuffer.mPtr, 1), NULL,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1));
- }
-
- void Qt3DSRendererImpl::UpdateCbAoShadow(const SLayer *pLayer, const SCamera *pCamera,
- CResourceTexture2D &inDepthTexture)
- {
- if (m_Context->GetConstantBufferSupport()) {
- CRegisteredString theName = m_Context->GetStringTable().RegisterStr("cbAoShadow");
- NVRenderConstantBuffer *pCB = m_Context->GetConstantBuffer(theName);
-
- if (!pCB) {
- // the size is determined automatically later on
- pCB = m_Context->CreateConstantBuffer(
- theName, qt3ds::render::NVRenderBufferUsageType::Static, 0, NVDataRef<QT3DSU8>());
- if (!pCB) {
- QT3DS_ASSERT(false);
- return;
- }
- m_ConstantBuffers.insert(eastl::make_pair(theName, pCB));
-
- // Add paramters. Note should match the appearance in the shader program
- pCB->AddParam(m_Context->GetStringTable().RegisterStr("ao_properties"),
- qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4, 1);
- pCB->AddParam(m_Context->GetStringTable().RegisterStr("ao_properties2"),
- qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4, 1);
- pCB->AddParam(m_Context->GetStringTable().RegisterStr("shadow_properties"),
- qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4, 1);
- pCB->AddParam(m_Context->GetStringTable().RegisterStr("aoScreenConst"),
- qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4, 1);
- pCB->AddParam(m_Context->GetStringTable().RegisterStr("UvToEyeConst"),
- qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4, 1);
- }
-
- // update values
- QT3DSVec4 aoProps(pLayer->m_AoStrength * 0.01f, pLayer->m_AoDistance * 0.4f,
- pLayer->m_AoSoftness * 0.02f, pLayer->m_AoBias);
- pCB->UpdateParam("ao_properties", NVDataRef<QT3DSU8>((QT3DSU8 *)&aoProps, 1));
- QT3DSVec4 aoProps2((QT3DSF32)pLayer->m_AoSamplerate, (pLayer->m_AoDither) ? 1.0f : 0.0f, 0.0f,
- 0.0f);
- pCB->UpdateParam("ao_properties2", NVDataRef<QT3DSU8>((QT3DSU8 *)&aoProps2, 1));
- QT3DSVec4 shadowProps(pLayer->m_ShadowStrength * 0.01f, pLayer->m_ShadowDist,
- pLayer->m_ShadowSoftness * 0.01f, pLayer->m_ShadowBias);
- pCB->UpdateParam("shadow_properties", NVDataRef<QT3DSU8>((QT3DSU8 *)&shadowProps, 1));
-
- QT3DSF32 R2 = pLayer->m_AoDistance * pLayer->m_AoDistance * 0.16f;
- QT3DSF32 rw = 100, rh = 100;
-
- if (inDepthTexture && inDepthTexture.GetTexture()) {
- rw = (QT3DSF32)inDepthTexture.GetTexture()->GetTextureDetails().m_Width;
- rh = (QT3DSF32)inDepthTexture.GetTexture()->GetTextureDetails().m_Height;
- }
- QT3DSF32 fov = (pCamera) ? pCamera->verticalFov(rw / rh) : 1.0f;
- QT3DSF32 tanHalfFovY = tanf(0.5f * fov * (rh / rw));
- QT3DSF32 invFocalLenX = tanHalfFovY * (rw / rh);
-
- QT3DSVec4 aoScreenConst(1.0f / R2, rh / (2.0f * tanHalfFovY), 1.0f / rw, 1.0f / rh);
- pCB->UpdateParam("aoScreenConst", NVDataRef<QT3DSU8>((QT3DSU8 *)&aoScreenConst, 1));
- QT3DSVec4 UvToEyeConst(2.0f * invFocalLenX, -2.0f * tanHalfFovY, -invFocalLenX,
- tanHalfFovY);
- pCB->UpdateParam("UvToEyeConst", NVDataRef<QT3DSU8>((QT3DSU8 *)&UvToEyeConst, 1));
-
- // update buffer to hardware
- pCB->Update();
- }
- }
-
- // widget context implementation
-
- NVRenderVertexBuffer &Qt3DSRendererImpl::GetOrCreateVertexBuffer(CRegisteredString &inStr,
- QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderVertexBuffer *retval = GetVertexBuffer(inStr);
- if (retval) {
- // we update the buffer
- retval->UpdateBuffer(bufferData, false);
- return *retval;
- }
- retval = m_Context->CreateVertexBuffer(qt3ds::render::NVRenderBufferUsageType::Dynamic,
- bufferData.size(), stride, bufferData);
- m_WidgetVertexBuffers.insert(eastl::make_pair(inStr, retval));
- return *retval;
- }
- NVRenderIndexBuffer &
- Qt3DSRendererImpl::GetOrCreateIndexBuffer(CRegisteredString &inStr,
- qt3ds::render::NVRenderComponentTypes::Enum componentType,
- size_t size, NVConstDataRef<QT3DSU8> bufferData)
- {
- NVRenderIndexBuffer *retval = GetIndexBuffer(inStr);
- if (retval) {
- // we update the buffer
- retval->UpdateBuffer(bufferData, false);
- return *retval;
- }
-
- retval = m_Context->CreateIndexBuffer(qt3ds::render::NVRenderBufferUsageType::Dynamic,
- componentType, size, bufferData);
- m_WidgetIndexBuffers.insert(eastl::make_pair(inStr, retval));
- return *retval;
- }
-
- NVRenderAttribLayout &Qt3DSRendererImpl::CreateAttributeLayout(
- NVConstDataRef<qt3ds::render::NVRenderVertexBufferEntry> attribs)
- {
- // create our attribute layout
- NVRenderAttribLayout *theAttribLAyout = m_Context->CreateAttributeLayout(attribs);
- return *theAttribLAyout;
- }
-
- NVRenderInputAssembler &Qt3DSRendererImpl::GetOrCreateInputAssembler(
- CRegisteredString &inStr, NVRenderAttribLayout *attribLayout,
- NVConstDataRef<NVRenderVertexBuffer *> buffers, const NVRenderIndexBuffer *indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets)
- {
- NVRenderInputAssembler *retval = GetInputAssembler(inStr);
- if (retval)
- return *retval;
-
- retval =
- m_Context->CreateInputAssembler(attribLayout, buffers, indexBuffer, strides, offsets);
- m_WidgetInputAssembler.insert(eastl::make_pair(inStr, retval));
- return *retval;
- }
-
- NVRenderVertexBuffer *Qt3DSRendererImpl::GetVertexBuffer(CRegisteredString &inStr)
- {
- TStrVertBufMap::iterator theIter = m_WidgetVertexBuffers.find(inStr);
- if (theIter != m_WidgetVertexBuffers.end())
- return theIter->second;
- return NULL;
- }
-
- NVRenderIndexBuffer *Qt3DSRendererImpl::GetIndexBuffer(CRegisteredString &inStr)
- {
- TStrIndexBufMap::iterator theIter = m_WidgetIndexBuffers.find(inStr);
- if (theIter != m_WidgetIndexBuffers.end())
- return theIter->second;
- return NULL;
- }
-
- NVRenderInputAssembler *Qt3DSRendererImpl::GetInputAssembler(CRegisteredString &inStr)
- {
- TStrIAMap::iterator theIter = m_WidgetInputAssembler.find(inStr);
- if (theIter != m_WidgetInputAssembler.end())
- return theIter->second;
- return NULL;
- }
-
- NVRenderShaderProgram *Qt3DSRendererImpl::GetShader(CRegisteredString inStr)
- {
- TStrShaderMap::iterator theIter = m_WidgetShaders.find(inStr);
- if (theIter != m_WidgetShaders.end())
- return theIter->second;
- return NULL;
- }
-
- NVRenderShaderProgram *Qt3DSRendererImpl::CompileAndStoreShader(CRegisteredString inStr)
- {
- NVRenderShaderProgram *newProgram = GetProgramGenerator().CompileGeneratedShader(inStr);
- if (newProgram)
- m_WidgetShaders.insert(eastl::make_pair(inStr, newProgram));
- return newProgram;
- }
-
- IShaderProgramGenerator &Qt3DSRendererImpl::GetProgramGenerator()
- {
- return m_qt3dsContext.GetShaderProgramGenerator();
- }
-
- STextDimensions Qt3DSRendererImpl::MeasureText(const STextRenderInfo &inText)
- {
- if (m_qt3dsContext.GetTextRenderer() != NULL)
- return m_qt3dsContext.GetTextRenderer()->MeasureText(inText, 0);
- return STextDimensions();
- }
-
- void Qt3DSRendererImpl::RenderText(const STextRenderInfo &inText, const QT3DSVec3 &inTextColor,
- const QT3DSVec3 &inBackgroundColor, const QT3DSMat44 &inMVP)
- {
- if (m_qt3dsContext.GetTextRenderer() != NULL) {
- ITextRenderer &theTextRenderer(*m_qt3dsContext.GetTextRenderer());
- NVRenderTexture2D *theTexture = m_qt3dsContext.GetResourceManager().AllocateTexture2D(
- 32, 32, NVRenderTextureFormats::RGBA8);
- STextTextureDetails theTextTextureDetails =
- theTextRenderer.RenderText(inText, *theTexture);
- STextRenderHelper theTextHelper(GetTextWidgetShader());
- if (theTextHelper.m_Shader != NULL) {
- m_qt3dsContext.GetRenderContext().SetBlendingEnabled(false);
- STextScaleAndOffset theScaleAndOffset(*theTexture, theTextTextureDetails, inText);
- theTextHelper.m_Shader->Render(*theTexture, theScaleAndOffset,
- QT3DSVec4(inTextColor, 1.0f), inMVP, QT3DSVec2(0, 0),
- GetContext(), theTextHelper.m_QuadInputAssembler,
- theTextHelper.m_QuadInputAssembler.GetIndexCount(),
- theTextTextureDetails, inBackgroundColor);
- }
- m_qt3dsContext.GetResourceManager().Release(*theTexture);
- }
- }
-
- void Qt3DSRendererImpl::RenderText2D(QT3DSF32 x, QT3DSF32 y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
- const char *text)
- {
- if (m_qt3dsContext.GetOnscreenTextRenderer() != NULL) {
- GenerateXYQuadStrip();
-
- if (PrepareTextureAtlasForRender()) {
- TTextRenderAtlasDetailsAndTexture theRenderTextDetails;
- ITextTextureAtlas *theTextureAtlas = m_qt3dsContext.GetTextureAtlas();
- QSize theWindow = m_qt3dsContext.GetWindowDimensions();
-
- const wchar_t *wText = m_StringTable->GetWideStr(text);
- STextRenderInfo theInfo;
- theInfo.m_Text = m_StringTable->RegisterStr(wText);
- theInfo.m_FontSize = 20;
- // text scale 2% of screen we don't scale Y though because it becomes unreadable
- theInfo.m_ScaleX = (theWindow.width() / 100.0f) * 1.5f / (theInfo.m_FontSize);
- theInfo.m_ScaleY = 1.0f;
-
- theRenderTextDetails = theTextureAtlas->RenderText(theInfo);
-
- if (theRenderTextDetails.first.m_Vertices.size()) {
- STextRenderHelper theTextHelper(GetOnscreenTextShader());
- if (theTextHelper.m_Shader != NULL) {
- // setup 2D projection
- SCamera theCamera;
- theCamera.m_ClipNear = -1.0;
- theCamera.m_ClipFar = 1.0;
-
- theCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- theCamera.m_Flags.SetOrthographic(true);
- QT3DSVec2 theWindowDim((QT3DSF32)theWindow.width(), (QT3DSF32)theWindow.height());
- theCamera.CalculateGlobalVariables(
- NVRenderRect(0, 0, theWindow.width(), theWindow.height()),
- theWindowDim);
- // We want a 2D lower left projection
- QT3DSF32 *writePtr(theCamera.m_Projection.front());
- writePtr[12] = -1;
- writePtr[13] = -1;
-
- // upload vertices
- m_QuadStripVertexBuffer->UpdateBuffer(theRenderTextDetails.first.m_Vertices,
- false);
-
- theTextHelper.m_Shader->Render2D(
- *theRenderTextDetails.second, QT3DSVec4(inColor, 1.0f),
- theCamera.m_Projection, GetContext(),
- theTextHelper.m_QuadInputAssembler,
- theRenderTextDetails.first.m_VertexCount, QT3DSVec2(x, y));
- }
- // we release the memory here
- QT3DS_FREE(m_Context->GetAllocator(),
- theRenderTextDetails.first.m_Vertices.begin());
- }
- }
- }
- }
-
- void Qt3DSRendererImpl::RenderGpuProfilerStats(QT3DSF32 x, QT3DSF32 y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor)
- {
- if (!IsLayerGpuProfilingEnabled())
- return;
-
- char messageLine[1024];
- TInstanceRenderMap::const_iterator theIter;
-
- QT3DSF32 startY = y;
-
- for (theIter = m_InstanceRenderMap.begin(); theIter != m_InstanceRenderMap.end(); theIter++) {
- QT3DSF32 startX = x;
- const SLayerRenderData *theLayerRenderData = theIter->second;
- const SLayer *theLayer = &theLayerRenderData->m_Layer;
-
- if (theLayer->m_Flags.IsActive() && theLayerRenderData->m_LayerProfilerGpu.mPtr) {
- const IRenderProfiler::TStrIDVec &idList =
- theLayerRenderData->m_LayerProfilerGpu->GetTimerIDs();
- if (!idList.empty()) {
- startY -= 22;
- startX += 20;
- RenderText2D(startX, startY, inColor, theLayer->m_Id);
- IRenderProfiler::TStrIDVec::const_iterator theIdIter = idList.begin();
- for (theIdIter = idList.begin(); theIdIter != idList.end(); theIdIter++) {
- startY -= 22;
- sprintf(messageLine, "%s: %.3f ms", theIdIter->c_str(),
- theLayerRenderData->m_LayerProfilerGpu->GetElapsedTime(*theIdIter));
- RenderText2D(startX + 20, startY, inColor, messageLine);
- }
- }
- }
- }
- }
-
- // Given a node and a point in the node's local space (most likely its pivot point), we return
- // a normal matrix so you can get the axis out, a transformation from node to camera
- // a new position and a floating point scale factor so you can render in 1/2 perspective mode
- // or orthographic mode if you would like to.
- SWidgetRenderInformation
- Qt3DSRendererImpl::GetWidgetRenderInformation(SNode &inNode, const QT3DSVec3 &inPos,
- RenderWidgetModes::Enum inWidgetMode)
- {
- SLayerRenderData *theData = GetOrCreateLayerRenderDataForNode(inNode);
- SCamera *theCamera = theData->m_Camera;
- if (theCamera == NULL || theData->m_LayerPrepResult.hasValue() == false) {
- QT3DS_ASSERT(false);
- return SWidgetRenderInformation();
- }
- QT3DSMat44 theGlobalTransform(QT3DSMat44::createIdentity());
- if (inNode.m_Parent != NULL && inNode.m_Parent->m_Type != GraphObjectTypes::Layer
- && !inNode.m_Flags.IsIgnoreParentTransform())
- theGlobalTransform = inNode.m_Parent->m_GlobalTransform;
- QT3DSMat44 theCameraInverse(theCamera->m_GlobalTransform.getInverse());
- QT3DSMat44 theNodeParentToCamera;
- if (inWidgetMode == RenderWidgetModes::Local)
- theNodeParentToCamera = theCameraInverse * theGlobalTransform;
- else
- theNodeParentToCamera = theCameraInverse;
-
- QT3DSMat33 theNormalMat(theNodeParentToCamera.column0.getXYZ(),
- theNodeParentToCamera.column1.getXYZ(),
- theNodeParentToCamera.column2.getXYZ());
- theNormalMat = theNormalMat.getInverse().getTranspose();
- theNormalMat.column0.normalize();
- theNormalMat.column1.normalize();
- theNormalMat.column2.normalize();
-
- QT3DSMat44 theTranslation(QT3DSMat44::createIdentity());
- theTranslation.column3.x = inNode.m_Position.x;
- theTranslation.column3.y = inNode.m_Position.y;
- theTranslation.column3.z = inNode.m_Position.z;
- theTranslation.column3.z *= -1.0f;
-
- theGlobalTransform = theGlobalTransform * theTranslation;
-
- QT3DSMat44 theNodeToParentPlusTranslation = theCameraInverse * theGlobalTransform;
- QT3DSVec3 thePos = theNodeToParentPlusTranslation.transform(inPos);
- SScaleAndPosition theScaleAndPos = GetWorldToPixelScaleFactor(*theCamera, thePos, *theData);
- QT3DSMat33 theLookAtMatrix(QT3DSMat33::createIdentity());
- if (theCamera->m_Flags.IsOrthographic() == false) {
- QT3DSVec3 theNodeToCamera = theScaleAndPos.m_Position;
- theNodeToCamera.normalize();
- QT3DSVec3 theOriginalAxis = QT3DSVec3(0, 0, -1);
- QT3DSVec3 theRotAxis = theOriginalAxis.cross(theNodeToCamera);
- QT3DSF32 theAxisLen = theRotAxis.normalize();
- if (theAxisLen > .05f) {
- QT3DSF32 theRotAmount = acos(theOriginalAxis.dot(theNodeToCamera));
- QT3DSQuat theQuat(theRotAmount, theRotAxis);
- theLookAtMatrix = QT3DSMat33(theQuat);
- }
- }
- QT3DSVec3 thePosInWorldSpace = theGlobalTransform.transform(inPos);
- QT3DSVec3 theCameraPosInWorldSpace = theCamera->GetGlobalPos();
- QT3DSVec3 theCameraOffset = thePosInWorldSpace - theCameraPosInWorldSpace;
- QT3DSVec3 theDir = theCameraOffset;
- theDir.normalize();
- // Things should be 600 units from the camera, as that is how all of our math is setup.
- theCameraOffset = 600.0f * theDir;
- return SWidgetRenderInformation(
- theNormalMat, theNodeParentToCamera, theCamera->m_Projection, theCamera->m_Projection,
- theLookAtMatrix, theCameraInverse, theCameraOffset, theScaleAndPos.m_Position,
- theScaleAndPos.m_Scale, *theCamera);
- }
-
- Option<QT3DSVec2> Qt3DSRendererImpl::GetLayerMouseCoords(SLayer &inLayer,
- const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool forceImageIntersect) const
- {
- SLayerRenderData *theData =
- const_cast<Qt3DSRendererImpl &>(*this).GetOrCreateLayerRenderDataForNode(inLayer);
- return GetLayerMouseCoords(*theData, inMouseCoords, inViewportDimensions,
- forceImageIntersect);
- }
-
- bool IQt3DSRenderer::IsGlEsContext(qt3ds::render::NVRenderContextType inContextType)
- {
- qt3ds::render::NVRenderContextType esContextTypes(NVRenderContextValues::GLES2
- | NVRenderContextValues::GLES3
- | NVRenderContextValues::GLES3PLUS);
-
- if ((inContextType & esContextTypes))
- return true;
-
- return false;
- }
-
- bool IQt3DSRenderer::IsGlEs3Context(qt3ds::render::NVRenderContextType inContextType)
- {
- if (inContextType == NVRenderContextValues::GLES3
- || inContextType == NVRenderContextValues::GLES3PLUS)
- return true;
-
- return false;
- }
-
- bool IQt3DSRenderer::IsGl2Context(qt3ds::render::NVRenderContextType inContextType)
- {
- if (inContextType == NVRenderContextValues::GL2)
- return true;
-
- return false;
- }
-
- IQt3DSRenderer &IQt3DSRenderer::CreateRenderer(IQt3DSRenderContext &inContext)
- {
- return *QT3DS_NEW(inContext.GetAllocator(), Qt3DSRendererImpl)(inContext);
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h
deleted file mode 100644
index 906afd69..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h
+++ /dev/null
@@ -1,549 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_SHADER_GENERATOR_IMPL_H
-#define QT3DS_RENDER_SHADER_GENERATOR_IMPL_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRenderableObjects.h"
-#include "Qt3DSRendererImplShaders.h"
-#include "Qt3DSRendererImplLayerRenderData.h"
-#include "foundation/Qt3DSFlags.h"
-#include "Qt3DSRenderMesh.h"
-#include "Qt3DSRenderModel.h"
-#include "foundation/Qt3DSBounds3.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "Qt3DSRenderDefaultMaterial.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSInvasiveSet.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderRay.h"
-#include "Qt3DSRenderText.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSRendererImplLayerRenderHelper.h"
-#include "Qt3DSRenderWidgets.h"
-#include "Qt3DSRenderShaderCodeGenerator.h"
-#include "Qt3DSRenderClippingFrustum.h"
-#include "foundation/Qt3DSUnionCast.h"
-#include "foundation/FastAllocator.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "Qt3DSRenderShaderKeys.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderProfiler.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-
-namespace qt3ds {
-namespace render {
-
- inline bool FloatLessThan(QT3DSF32 lhs, QT3DSF32 rhs)
- {
- QT3DSF32 diff = lhs - rhs;
- if (fabs(diff) < .001)
- return false;
- return diff < 0.0f ? true : false;
- }
- inline bool ISRenderObjectPtrLessThan(const SRenderableObject *lhs,
- const SRenderableObject *rhs)
- {
- return FloatLessThan(lhs->m_CameraDistanceSq, rhs->m_CameraDistanceSq);
- }
- inline bool ISRenderObjectPtrGreatThan(const SRenderableObject *lhs,
- const SRenderableObject *rhs)
- {
- return FloatLessThan(rhs->m_CameraDistanceSq, lhs->m_CameraDistanceSq);
- }
- inline bool NonZero(float inValue) { return fabs(inValue) > .001f; }
- inline bool NonZero(QT3DSU32 inValue) { return inValue != 0; }
- inline bool IsZero(float inValue) { return fabs(inValue) < .001f; }
- inline bool IsNotOne(float inValue) { return fabs(1.0f - inValue) > .001f; }
-
- inline bool IsRectEdgeInBounds(QT3DSI32 inNewRectOffset, QT3DSI32 inNewRectWidth,
- QT3DSI32 inCurrentRectOffset, QT3DSI32 inCurrentRectWidth)
- {
- QT3DSI32 newEnd = inNewRectOffset + inNewRectWidth;
- QT3DSI32 currentEnd = inCurrentRectOffset + inCurrentRectWidth;
- return inNewRectOffset >= inCurrentRectOffset && newEnd <= currentEnd;
- }
-
- struct STextRenderHelper
- {
- STextShader *m_Shader;
- NVRenderInputAssembler &m_QuadInputAssembler;
- STextRenderHelper(STextShader *inShader, NVRenderInputAssembler &inQuadInputAssembler)
- : m_Shader(inShader)
- , m_QuadInputAssembler(inQuadInputAssembler)
- {
- }
- };
-
- struct SPickResultProcessResult : public Qt3DSRenderPickResult
- {
- SPickResultProcessResult(const Qt3DSRenderPickResult &inSrc)
- : Qt3DSRenderPickResult(inSrc)
- , m_WasPickConsumed(false)
- {
- }
- SPickResultProcessResult()
- : m_WasPickConsumed(false)
- {
- }
- bool m_WasPickConsumed;
- };
-
- struct STextShaderPtr
- {
- NVAllocatorCallback &m_Allocator;
- bool m_HasGeneratedShader;
- STextShader *m_Shader;
- STextShaderPtr(NVAllocatorCallback &alloc)
- : m_Allocator(alloc)
- , m_HasGeneratedShader(false)
- , m_Shader(NULL)
- {
- }
- bool HasGeneratedShader() { return m_HasGeneratedShader; }
- void Set(STextShader *inShader)
- {
- m_Shader = inShader;
- m_HasGeneratedShader = true;
- }
- ~STextShaderPtr()
- {
- if (m_Shader)
- NVDelete(m_Allocator, m_Shader);
- }
- operator STextShader *() { return m_Shader; }
- };
-
- class QT3DS_AUTOTEST_EXPORT Qt3DSRendererImpl : public IQt3DSRenderer, public IRenderWidgetContext
- {
- typedef nvhash_map<SShaderDefaultMaterialKey, SShaderGeneratorGeneratedShader *> TShaderMap;
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderConstantBuffer>>
- TStrConstanBufMap;
- typedef nvhash_map<SRenderInstanceId, NVScopedRefCounted<SLayerRenderData>,
- eastl::hash<SRenderInstanceId>> TInstanceRenderMap;
- typedef nvvector<SLayerRenderData *> TLayerRenderList;
- typedef nvvector<Qt3DSRenderPickResult> TPickResultArray;
-
- // Items to implement the widget context.
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderVertexBuffer>>
- TStrVertBufMap;
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderIndexBuffer>>
- TStrIndexBufMap;
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderShaderProgram>>
- TStrShaderMap;
- typedef nvhash_map<CRegisteredString, NVScopedRefCounted<NVRenderInputAssembler>> TStrIAMap;
-
- typedef nvhash_map<long, SNode *> TBoneIdNodeMap;
-
- IQt3DSRenderContext &m_qt3dsContext;
- NVScopedRefCounted<NVRenderContext> m_Context;
- NVScopedRefCounted<IBufferManager> m_BufferManager;
- NVScopedRefCounted<IOffscreenRenderManager> m_OffscreenRenderManager;
- NVScopedRefCounted<IStringTable> m_StringTable;
- InvasiveSet<SShaderGeneratorGeneratedShader, SGGSGet, SGGSSet> m_LayerShaders;
- // For rendering bounding boxes.
- NVScopedRefCounted<NVRenderVertexBuffer> m_BoxVertexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> m_BoxIndexBuffer;
- NVScopedRefCounted<NVRenderShaderProgram> m_BoxShader;
- NVScopedRefCounted<NVRenderShaderProgram> m_ScreenRectShader;
-
- NVScopedRefCounted<NVRenderVertexBuffer> m_AxisVertexBuffer;
- NVScopedRefCounted<NVRenderShaderProgram> m_AxisShader;
-
- // X,Y quad, broken down into 2 triangles and normalized over
- //-1,1.
- NVScopedRefCounted<NVRenderVertexBuffer> m_QuadVertexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> m_QuadIndexBuffer;
- NVScopedRefCounted<NVRenderIndexBuffer> m_RectIndexBuffer;
- NVScopedRefCounted<NVRenderInputAssembler> m_QuadInputAssembler;
- NVScopedRefCounted<NVRenderInputAssembler> m_RectInputAssembler;
- NVScopedRefCounted<NVRenderAttribLayout> m_QuadAttribLayout;
- NVScopedRefCounted<NVRenderAttribLayout> m_RectAttribLayout;
-
- // X,Y triangle strip quads in screen coord dynamiclly setup
- NVScopedRefCounted<NVRenderVertexBuffer> m_QuadStripVertexBuffer;
- NVScopedRefCounted<NVRenderInputAssembler> m_QuadStripInputAssembler;
- NVScopedRefCounted<NVRenderAttribLayout> m_QuadStripAttribLayout;
-
- // X,Y,Z point which is used for instanced based rendering of points
- NVScopedRefCounted<NVRenderVertexBuffer> m_PointVertexBuffer;
- NVScopedRefCounted<NVRenderInputAssembler> m_PointInputAssembler;
- NVScopedRefCounted<NVRenderAttribLayout> m_PointAttribLayout;
-
- Option<NVScopedRefCounted<SLayerSceneShader>> m_SceneLayerShader;
- Option<NVScopedRefCounted<SLayerProgAABlendShader>> m_LayerProgAAShader;
-
- TShaderMap m_Shaders;
- TStrConstanBufMap m_ConstantBuffers; ///< store the the shader constant buffers
- // Option is true if we have attempted to generate the shader.
- // This does not mean we were successul, however.
- Option<NVScopedRefCounted<SDefaultMaterialRenderableDepthShader>>
- m_DefaultMaterialDepthPrepassShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_DepthPrepassShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_DepthPrepassShaderDisplaced;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_DepthTessLinearPrepassShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>>
- m_DepthTessLinearPrepassShaderDisplaced;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_DepthTessPhongPrepassShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_DepthTessNPatchPrepassShader;
- Option<NVScopedRefCounted<STextDepthShader>> m_TextDepthPrepassShader;
- Option<NVScopedRefCounted<SDefaultAoPassShader>> m_DefaultAoPassShader;
- Option<NVScopedRefCounted<SDefaultAoPassShader>> m_FakeDepthShader;
- Option<NVScopedRefCounted<SDefaultAoPassShader>> m_FakeCubemapDepthShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_ParaboloidDepthShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_ParaboloidDepthTessLinearShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_ParaboloidDepthTessPhongShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_ParaboloidDepthTessNPatchShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_CubemapDepthShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_CubemapDepthTessLinearShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_CubemapDepthTessPhongShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_CubemapDepthTessNPatchShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> m_OrthographicDepthShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>>
- m_OrthographicDepthTessLinearShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>>
- m_OrthographicDepthTessPhongShader;
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>>
- m_OrthographicDepthTessNPatchShader;
- Option<NVScopedRefCounted<SShadowmapPreblurShader>> m_CubeShadowBlurXShader;
- Option<NVScopedRefCounted<SShadowmapPreblurShader>> m_CubeShadowBlurYShader;
- Option<NVScopedRefCounted<SShadowmapPreblurShader>> m_OrthoShadowBlurXShader;
- Option<NVScopedRefCounted<SShadowmapPreblurShader>> m_OrthoShadowBlurYShader;
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- Option<NVScopedRefCounted<SAdvancedModeBlendShader>> m_AdvancedModeOverlayBlendShader;
- Option<NVScopedRefCounted<SAdvancedModeBlendShader>> m_AdvancedModeColorBurnBlendShader;
- Option<NVScopedRefCounted<SAdvancedModeBlendShader>> m_AdvancedModeColorDodgeBlendShader;
-#endif
- // Text shaders may be generated on demand.
- STextShaderPtr m_TextShader;
- STextShaderPtr m_TextPathShader;
- STextShaderPtr m_TextWidgetShader;
- STextShaderPtr m_TextOnscreenShader;
-
- // Overlay used to render all widgets.
- NVRenderRect m_BeginFrameViewport;
- NVScopedRefCounted<NVRenderTexture2D> m_WidgetTexture;
- NVScopedRefCounted<NVRenderFrameBuffer> m_WidgetFBO;
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- // Advanced blend mode SW fallback
- CResourceTexture2D m_LayerBlendTexture;
- NVScopedRefCounted<NVRenderFrameBuffer> m_BlendFB;
-#endif
- // Allocator for temporary data that is cleared after every layer.
- TInstanceRenderMap m_InstanceRenderMap;
- TLayerRenderList m_LastFrameLayers;
- volatile QT3DSI32 mRefCount;
-
- // Set from the first layer.
- TPickResultArray m_LastPickResults;
-
- // Temporary information stored only when rendering a particular layer.
- SLayerRenderData *m_CurrentLayer;
- QT3DSMat44 m_ViewProjection;
- eastl::string m_GeneratedShaderString;
-
- TStrVertBufMap m_WidgetVertexBuffers;
- TStrIndexBufMap m_WidgetIndexBuffers;
- TStrShaderMap m_WidgetShaders;
- TStrIAMap m_WidgetInputAssembler;
-
- TBoneIdNodeMap m_BoneIdNodeMap;
-
- bool m_PickRenderPlugins;
- bool m_LayerCachingEnabled;
- bool m_LayerGPuProfilingEnabled;
- SShaderDefaultMaterialKeyProperties m_DefaultMaterialShaderKeyProperties;
-
- public:
- Qt3DSRendererImpl(IQt3DSRenderContext &ctx);
- virtual ~Qt3DSRendererImpl();
- SShaderDefaultMaterialKeyProperties &DefaultMaterialShaderKeyProperties()
- {
- return m_DefaultMaterialShaderKeyProperties;
- }
-
- // NVRefCounted
- void addRef() override;
- void release() override;
-
- void EnableLayerCaching(bool inEnabled) override { m_LayerCachingEnabled = inEnabled; }
- bool IsLayerCachingEnabled() const override { return m_LayerCachingEnabled; }
-
- void EnableLayerGpuProfiling(bool inEnabled) override;
- bool IsLayerGpuProfilingEnabled() const override { return m_LayerGPuProfilingEnabled; }
-
- // Calls prepare layer for render
- // and then do render layer.
- bool PrepareLayerForRender(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- bool inRenderSiblings, const SRenderInstanceId id) override;
- void RenderLayer(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- bool clear, QT3DSVec4 clearColor, bool inRenderSiblings,
- const SRenderInstanceId id) override;
- void ChildrenUpdated(SNode &inParent) override;
- QT3DSF32 GetTextScale(const SText &inText) override;
-
- SCamera *GetCameraForNode(const SNode &inNode) const override;
- Option<SCuboidRect> GetCameraBounds(const SGraphObject &inObject) override;
- virtual SLayer *GetLayerForNode(const SNode &inNode) const;
- SLayerRenderData *GetOrCreateLayerRenderDataForNode(const SNode &inNode,
- const SRenderInstanceId id = nullptr);
-
- IRenderWidgetContext &GetRenderWidgetContext()
- {
- return *this;
- }
-
- void BeginFrame() override;
- void EndFrame() override;
-
- void PickRenderPlugins(bool inPick) override { m_PickRenderPlugins = inPick; }
- Qt3DSRenderPickResult Pick(SLayer &inLayer, const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords, bool inPickSiblings,
- bool inPickEverything,
- const SRenderInstanceId id) override;
-
- virtual Option<QT3DSVec2>
- FacePosition(SNode &inNode, NVBounds3 inBounds, const QT3DSMat44 &inGlobalTransform,
- const QT3DSVec2 &inViewportDimensions, const QT3DSVec2 &inMouseCoords,
- NVDataRef<SGraphObject *> inMapperObjects, SBasisPlanes::Enum inPlane) override;
-
- virtual Qt3DSRenderPickResult PickOffscreenLayer(SLayer &inLayer,
- const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords,
- bool inPickEverything);
-
- QT3DSVec3 UnprojectToPosition(SNode &inNode, QT3DSVec3 &inPosition,
- const QT3DSVec2 &inMouseVec) const override;
- QT3DSVec3 UnprojectWithDepth(SNode &inNode, QT3DSVec3 &inPosition,
- const QT3DSVec3 &inMouseVec) const override;
- QT3DSVec3 ProjectPosition(SNode &inNode, const QT3DSVec3 &inPosition) const override;
-
- Option<SLayerPickSetup> GetLayerPickSetup(SLayer &inLayer,
- const QT3DSVec2 &inMouseCoords,
- const QSize &inPickDims) override;
-
- Option<NVRenderRectF> GetLayerRect(SLayer &inLayer) override;
-
- void RunLayerRender(SLayer &inLayer, const QT3DSMat44 &inViewProjection) override;
-
- // Note that this allocator is completely reset on BeginFrame.
- NVAllocatorCallback &GetPerFrameAllocator() override
- {
- return m_qt3dsContext.GetPerFrameAllocator();
- }
- void RenderLayerRect(SLayer &inLayer, const QT3DSVec3 &inColor) override;
- void AddRenderWidget(IRenderWidget &inWidget) override;
-
- SScaleAndPosition GetWorldToPixelScaleFactor(SLayer &inLayer,
- const QT3DSVec3 &inWorldPoint) override;
- SScaleAndPosition GetWorldToPixelScaleFactor(const SCamera &inCamera,
- const QT3DSVec3 &inWorldPoint,
- SLayerRenderData &inRenderData);
-
- void ReleaseLayerRenderResources(SLayer &inLayer, const SRenderInstanceId id) override;
-
- void RenderQuad(const QT3DSVec2 inDimensions, const QT3DSMat44 &inMVP,
- NVRenderTexture2D &inQuadTexture) override;
- void RenderQuad() override;
-
- void RenderPointsIndirect() override;
-
- // render a screen aligned 2D text
- void RenderText2D(QT3DSF32 x, QT3DSF32 y, qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
- const char *text) override;
- bool PrepareTextureAtlasForRender();
-
- // render Gpu profiler values
- void RenderGpuProfilerStats(QT3DSF32 x, QT3DSF32 y,
- qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor) override;
-
- // Callback during the layer render process.
- void LayerNeedsFrameClear(SLayerRenderData &inLayer);
- void BeginLayerDepthPassRender(SLayerRenderData &inLayer);
- void EndLayerDepthPassRender();
- void BeginLayerRender(SLayerRenderData &inLayer);
- void EndLayerRender();
- void PrepareImageForIbl(SImage &inImage);
-
- NVRenderShaderProgram *CompileShader(CRegisteredString inName, const char8_t *inVert,
- const char8_t *inFrame);
-
- NVRenderShaderProgram *GenerateShader(SSubsetRenderable &inRenderable,
- TShaderFeatureSet inFeatureSet);
- SShaderGeneratorGeneratedShader *GetShader(SSubsetRenderable &inRenderable,
- TShaderFeatureSet inFeatureSet);
-
- SDefaultAoPassShader *GetDefaultAoPassShader(TShaderFeatureSet inFeatureSet);
- SDefaultAoPassShader *GetFakeDepthShader(TShaderFeatureSet inFeatureSet);
- SDefaultAoPassShader *GetFakeCubeDepthShader(TShaderFeatureSet inFeatureSet);
- SDefaultMaterialRenderableDepthShader *GetRenderableDepthShader();
-
- SRenderableDepthPrepassShader *GetParaboloidDepthShader(TessModeValues::Enum inTessMode);
- SRenderableDepthPrepassShader *GetParaboloidDepthNoTessShader();
- SRenderableDepthPrepassShader *GetParaboloidDepthTessLinearShader();
- SRenderableDepthPrepassShader *GetParaboloidDepthTessPhongShader();
- SRenderableDepthPrepassShader *GetParaboloidDepthTessNPatchShader();
- SRenderableDepthPrepassShader *GetCubeShadowDepthShader(TessModeValues::Enum inTessMode);
- SRenderableDepthPrepassShader *GetCubeDepthNoTessShader();
- SRenderableDepthPrepassShader *GetCubeDepthTessLinearShader();
- SRenderableDepthPrepassShader *GetCubeDepthTessPhongShader();
- SRenderableDepthPrepassShader *GetCubeDepthTessNPatchShader();
- SRenderableDepthPrepassShader *GetOrthographicDepthShader(TessModeValues::Enum inTessMode);
- SRenderableDepthPrepassShader *GetOrthographicDepthNoTessShader();
- SRenderableDepthPrepassShader *GetOrthographicDepthTessLinearShader();
- SRenderableDepthPrepassShader *GetOrthographicDepthTessPhongShader();
- SRenderableDepthPrepassShader *GetOrthographicDepthTessNPatchShader();
-
- SRenderableDepthPrepassShader *GetDepthPrepassShader(bool inDisplaced);
- SRenderableDepthPrepassShader *GetDepthTessPrepassShader(TessModeValues::Enum inTessMode,
- bool inDisplaced);
- SRenderableDepthPrepassShader *GetDepthTessLinearPrepassShader(bool inDisplaced);
- SRenderableDepthPrepassShader *GetDepthTessPhongPrepassShader();
- SRenderableDepthPrepassShader *GetDepthTessNPatchPrepassShader();
- STextDepthShader *GetTextDepthShader();
- STextRenderHelper GetShader(STextRenderable &inRenderable, bool inUsePathRendering);
- STextRenderHelper GetTextShader(bool inUsePathRendering);
- STextRenderHelper GetTextWidgetShader();
- STextRenderHelper GetOnscreenTextShader();
- SLayerSceneShader *GetSceneLayerShader();
- NVRenderShaderProgram *GetTextAtlasEntryShader();
- void GenerateXYQuad();
- void GenerateXYQuadStrip();
- void GenerateXYZPoint();
- eastl::pair<NVRenderVertexBuffer *, NVRenderIndexBuffer *> GetXYQuad();
- SLayerProgAABlendShader *GetLayerProgAABlendShader();
- SShadowmapPreblurShader *GetCubeShadowBlurXShader();
- SShadowmapPreblurShader *GetCubeShadowBlurYShader();
- SShadowmapPreblurShader *GetOrthoShadowBlurXShader();
- SShadowmapPreblurShader *GetOrthoShadowBlurYShader();
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- SAdvancedModeBlendShader *GetAdvancedBlendModeShader(AdvancedBlendModes::Enum blendMode);
- SAdvancedModeBlendShader *GetOverlayBlendModeShader();
- SAdvancedModeBlendShader *GetColorBurnBlendModeShader();
- SAdvancedModeBlendShader *GetColorDodgeBlendModeShader();
-#endif
- SLayerRenderData *GetLayerRenderData() { return m_CurrentLayer; }
- SLayerGlobalRenderProperties GetLayerGlobalRenderProperties();
- void UpdateCbAoShadow(const SLayer *pLayer, const SCamera *pCamera,
- CResourceTexture2D &inDepthTexture);
-
- NVRenderContext &GetContext() { return *m_Context; }
-
- IQt3DSRenderContext &GetQt3DSContext() { return m_qt3dsContext; }
-
- void DrawScreenRect(NVRenderRectF inRect, const QT3DSVec3 &inColor);
- // Binds an offscreen texture. Widgets are rendered last.
- void SetupWidgetLayer();
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- NVScopedRefCounted<NVRenderTexture2D> GetLayerBlendTexture()
- {
- return m_LayerBlendTexture.GetTexture();
- }
-
- NVScopedRefCounted<NVRenderFrameBuffer> GetBlendFB()
- {
- return m_BlendFB;
- }
-#endif
- // widget context implementation
- virtual NVRenderVertexBuffer &
- GetOrCreateVertexBuffer(CRegisteredString &inStr, QT3DSU32 stride,
- NVConstDataRef<QT3DSU8> bufferData = NVConstDataRef<QT3DSU8>()) override;
- virtual NVRenderIndexBuffer &
- GetOrCreateIndexBuffer(CRegisteredString &inStr,
- qt3ds::render::NVRenderComponentTypes::Enum componentType, size_t size,
- NVConstDataRef<QT3DSU8> bufferData = NVConstDataRef<QT3DSU8>()) override;
- virtual NVRenderAttribLayout &
- CreateAttributeLayout(NVConstDataRef<qt3ds::render::NVRenderVertexBufferEntry> attribs) override;
- virtual NVRenderInputAssembler &
- GetOrCreateInputAssembler(CRegisteredString &inStr, NVRenderAttribLayout *attribLayout,
- NVConstDataRef<NVRenderVertexBuffer *> buffers,
- const NVRenderIndexBuffer *indexBuffer,
- NVConstDataRef<QT3DSU32> strides, NVConstDataRef<QT3DSU32> offsets) override;
-
- NVRenderVertexBuffer *GetVertexBuffer(CRegisteredString &inStr) override;
- NVRenderIndexBuffer *GetIndexBuffer(CRegisteredString &inStr) override;
- NVRenderInputAssembler *GetInputAssembler(CRegisteredString &inStr) override;
-
- NVRenderShaderProgram *GetShader(CRegisteredString inStr) override;
- NVRenderShaderProgram *CompileAndStoreShader(CRegisteredString inStr) override;
- IShaderProgramGenerator &GetProgramGenerator() override;
-
- STextDimensions MeasureText(const STextRenderInfo &inText) override;
- void RenderText(const STextRenderInfo &inText, const QT3DSVec3 &inTextColor,
- const QT3DSVec3 &inBackgroundColor, const QT3DSMat44 &inMVP) override;
-
- // Given a node and a point in the node's local space (most likely its pivot point), we
- // return
- // a normal matrix so you can get the axis out, a transformation from node to camera
- // a new position and a floating point scale factor so you can render in 1/2 perspective
- // mode
- // or orthographic mode if you would like to.
- virtual SWidgetRenderInformation
- GetWidgetRenderInformation(SNode &inNode, const QT3DSVec3 &inPos,
- RenderWidgetModes::Enum inWidgetMode) override;
-
- Option<QT3DSVec2> GetLayerMouseCoords(SLayer &inLayer, const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool forceImageIntersect = false) const override;
-
- protected:
- Option<QT3DSVec2> GetLayerMouseCoords(SLayerRenderData &inLayer, const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inViewportDimensions,
- bool forceImageIntersect = false) const;
- SPickResultProcessResult ProcessPickResultList(bool inPickEverything);
- // If the mouse y coordinates need to be flipped we expect that to happen before entry into
- // this function
- void GetLayerHitObjectList(SLayerRenderData &inLayer, const QT3DSVec2 &inViewportDimensions,
- const QT3DSVec2 &inMouseCoords, bool inPickEverything,
- TPickResultArray &outIntersectionResult,
- NVAllocatorCallback &inTempAllocator);
- void IntersectRayWithSubsetRenderable(const SRay &inRay,
- SRenderableObject &inRenderableObject,
- TPickResultArray &outIntersectionResultList,
- NVAllocatorCallback &inTempAllocator);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp
deleted file mode 100644
index 362a6027..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp
+++ /dev/null
@@ -1,2220 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRendererImpl.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderEffect.h"
-#include "EASTL/sort.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderPresentation.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "Qt3DSOffscreenRenderKey.h"
-#include "Qt3DSRenderPlugin.h"
-#include "Qt3DSRenderPluginGraphObject.h"
-#include "Qt3DSRenderResourceBufferObjects.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "Qt3DSRenderMaterialHelpers.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderTextTextureCache.h"
-#include "Qt3DSRenderTextTextureAtlas.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRendererUtil.h"
-
-#ifdef WIN32
-#pragma warning(disable : 4355)
-#endif
-
-#define QT3DS_CACHED_POST_EFFECT
-const float QT3DS_DEGREES_TO_RADIANS = 0.0174532925199f;
-
-namespace qt3ds {
-namespace render {
- using eastl::reverse;
- using eastl::stable_sort;
- using qt3ds::render::NVRenderContextScopedProperty;
- using qt3ds::QT3DSVec2;
-
- SLayerRenderData::SLayerRenderData(SLayer &inLayer, Qt3DSRendererImpl &inRenderer)
- : SLayerRenderPreparationData(inLayer, inRenderer)
- , m_LayerTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_TemporalAATexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerDepthTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerPrepassDepthTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerWidgetTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerSsaoTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerMultisampleTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerMultisamplePrepassDepthTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerMultisampleWidgetTexture(inRenderer.GetQt3DSContext().GetResourceManager())
- , m_LayerCachedTexture(NULL)
- , m_AdvancedBlendDrawTexture(NULL)
- , m_AdvancedBlendBlendTexture(NULL)
- , m_AdvancedModeDrawFB(NULL)
- , m_AdvancedModeBlendFB(NULL)
- , m_ProgressiveAAPassIndex(0)
- , m_TemporalAAPassIndex(0)
- , m_NonDirtyTemporalAAPassIndex(0)
- , m_TextScale(1.0f)
- , mRefCount(0)
- , m_DepthBufferFormat(NVRenderTextureFormats::Unknown)
- {
- }
-
- SLayerRenderData::~SLayerRenderData()
- {
- IResourceManager &theResourceManager(m_Renderer.GetQt3DSContext().GetResourceManager());
- if (m_LayerCachedTexture && m_LayerCachedTexture != m_LayerTexture)
- theResourceManager.Release(*m_LayerCachedTexture);
- if (m_AdvancedModeDrawFB) {
- m_AdvancedModeDrawFB->release();
- m_AdvancedModeDrawFB = NULL;
- }
- if (m_AdvancedModeBlendFB) {
- m_AdvancedModeBlendFB->release();
- m_AdvancedModeBlendFB = NULL;
- }
- if (m_AdvancedBlendBlendTexture)
- m_AdvancedBlendBlendTexture = NULL;
- if (m_AdvancedBlendDrawTexture)
- m_AdvancedBlendDrawTexture = NULL;
- }
- void SLayerRenderData::PrepareForRender(const QSize &inViewportDimensions)
- {
- SLayerRenderPreparationData::PrepareForRender(inViewportDimensions);
- SLayerRenderPreparationResult &thePrepResult(*m_LayerPrepResult);
- IResourceManager &theResourceManager(m_Renderer.GetQt3DSContext().GetResourceManager());
- // at that time all values shoud be updated
- m_Renderer.UpdateCbAoShadow(&m_Layer, m_Camera, m_LayerDepthTexture);
-
- // Generate all necessary lighting keys
-
- if (thePrepResult.m_Flags.WasLayerDataDirty()) {
- m_ProgressiveAAPassIndex = 0;
- }
-
- // Get rid of the layer texture if we aren't rendering to texture this frame.
- if (m_LayerTexture && !thePrepResult.m_Flags.ShouldRenderToTexture()) {
- if (m_LayerCachedTexture && m_LayerCachedTexture != m_LayerTexture) {
- theResourceManager.Release(*m_LayerCachedTexture);
- m_LayerCachedTexture = NULL;
- }
-
- m_LayerTexture.ReleaseTexture();
- m_LayerDepthTexture.ReleaseTexture();
- m_LayerWidgetTexture.ReleaseTexture();
- m_LayerSsaoTexture.ReleaseTexture();
- m_LayerMultisampleTexture.ReleaseTexture();
- m_LayerMultisamplePrepassDepthTexture.ReleaseTexture();
- m_LayerMultisampleWidgetTexture.ReleaseTexture();
- }
-
- if (NeedsWidgetTexture() == false)
- m_LayerWidgetTexture.ReleaseTexture();
-
- if (m_LayerDepthTexture && !thePrepResult.m_Flags.RequiresDepthTexture())
- m_LayerDepthTexture.ReleaseTexture();
-
- if (m_LayerSsaoTexture && !thePrepResult.m_Flags.RequiresSsaoPass())
- m_LayerSsaoTexture.ReleaseTexture();
-
- m_Renderer.LayerNeedsFrameClear(*this);
-
- // Clean up the texture cache if layer dimensions changed
- if (inViewportDimensions.width() != m_previousDimensions.width()
- || inViewportDimensions.height() != m_previousDimensions.height()) {
- m_LayerTexture.ReleaseTexture();
- m_LayerDepthTexture.ReleaseTexture();
- m_LayerSsaoTexture.ReleaseTexture();
- m_LayerWidgetTexture.ReleaseTexture();
- m_LayerPrepassDepthTexture.ReleaseTexture();
- m_TemporalAATexture.ReleaseTexture();
- m_LayerMultisampleTexture.ReleaseTexture();
- m_LayerMultisamplePrepassDepthTexture.ReleaseTexture();
- m_LayerMultisampleWidgetTexture.ReleaseTexture();
-
- m_previousDimensions.setWidth(inViewportDimensions.width());
- m_previousDimensions.setHeight(inViewportDimensions.height());
-
- theResourceManager.DestroyFreeSizedResources();
-
- // Effect system uses different resource manager, so clean that up too
- m_Renderer.GetQt3DSContext().GetEffectSystem().GetResourceManager()
- .DestroyFreeSizedResources();
- }
- }
-
- NVRenderTextureFormats::Enum SLayerRenderData::GetDepthBufferFormat()
- {
- if (m_DepthBufferFormat == NVRenderTextureFormats::Unknown) {
- QT3DSU32 theExistingDepthBits = m_Renderer.GetContext().GetDepthBits();
- QT3DSU32 theExistingStencilBits = m_Renderer.GetContext().GetStencilBits();
- switch (theExistingDepthBits) {
- case 32:
- m_DepthBufferFormat = NVRenderTextureFormats::Depth32;
- break;
- case 24:
- // check if we have stencil bits
- if (theExistingStencilBits > 0)
- m_DepthBufferFormat =
- NVRenderTextureFormats::Depth24Stencil8; // currently no stencil usage
- // should be Depth24Stencil8 in
- // this case
- else
- m_DepthBufferFormat = NVRenderTextureFormats::Depth24;
- break;
- case 16:
- m_DepthBufferFormat = NVRenderTextureFormats::Depth16;
- break;
- default:
- QT3DS_ASSERT(false);
- m_DepthBufferFormat = NVRenderTextureFormats::Depth16;
- break;
- }
- }
- return m_DepthBufferFormat;
- }
-
- NVRenderFrameBufferAttachments::Enum
- SLayerRenderData::GetFramebufferDepthAttachmentFormat(NVRenderTextureFormats::Enum depthFormat)
- {
- NVRenderFrameBufferAttachments::Enum fmt = NVRenderFrameBufferAttachments::Depth;
-
- switch (depthFormat) {
- case NVRenderTextureFormats::Depth16:
- case NVRenderTextureFormats::Depth24:
- case NVRenderTextureFormats::Depth32:
- fmt = NVRenderFrameBufferAttachments::Depth;
- break;
- case NVRenderTextureFormats::Depth24Stencil8:
- fmt = NVRenderFrameBufferAttachments::DepthStencil;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
-
- return fmt;
- }
-
- void SLayerRenderData::RenderAoPass()
- {
- m_Renderer.BeginLayerDepthPassRender(*this);
-
- NVRenderContext &theContext(m_Renderer.GetContext());
- SDefaultAoPassShader *shader = m_Renderer.GetDefaultAoPassShader(GetShaderFeatureSet());
- if (shader == NULL)
- return;
-
- // Set initial state
- theContext.SetBlendingEnabled(false);
- theContext.SetDepthWriteEnabled(false);
- theContext.SetDepthTestEnabled(false);
- theContext.SetActiveShader(&(shader->m_Shader));
-
- // Setup constants
- shader->m_CameraDirection.Set(m_CameraDirection);
- shader->m_ViewMatrix.Set(m_Camera->m_GlobalTransform);
-
- shader->m_DepthTexture.Set(m_LayerDepthTexture);
- shader->m_DepthSamplerSize.Set(QT3DSVec2(m_LayerDepthTexture->GetTextureDetails().m_Width,
- m_LayerDepthTexture->GetTextureDetails().m_Height));
-
- // Important uniforms for AO calculations
- QT3DSVec2 theCameraProps = QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar);
- shader->m_CameraProperties.Set(theCameraProps);
- shader->m_AoShadowParams.Set();
-
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
-
- m_Renderer.EndLayerDepthPassRender();
- }
-
- void SLayerRenderData::RenderFakeDepthMapPass(NVRenderTexture2D *theDepthTex,
- NVRenderTextureCube *theDepthCube)
- {
- m_Renderer.BeginLayerDepthPassRender(*this);
-
- NVRenderContext &theContext(m_Renderer.GetContext());
- SDefaultAoPassShader *shader = theDepthTex
- ? m_Renderer.GetFakeDepthShader(GetShaderFeatureSet())
- : m_Renderer.GetFakeCubeDepthShader(GetShaderFeatureSet());
- if (shader == NULL)
- return;
-
- // Set initial state
- theContext.SetBlendingEnabled(false);
- theContext.SetDepthWriteEnabled(false);
- theContext.SetDepthTestEnabled(false);
- theContext.SetActiveShader(&(shader->m_Shader));
-
- // Setup constants
- shader->m_CameraDirection.Set(m_CameraDirection);
- shader->m_ViewMatrix.Set(m_Camera->m_GlobalTransform);
-
- shader->m_DepthTexture.Set(theDepthTex);
- shader->m_CubeTexture.Set(theDepthCube);
- shader->m_DepthSamplerSize.Set(QT3DSVec2(theDepthTex->GetTextureDetails().m_Width,
- theDepthTex->GetTextureDetails().m_Height));
-
- // Important uniforms for AO calculations
- QT3DSVec2 theCameraProps = QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar);
- shader->m_CameraProperties.Set(theCameraProps);
- shader->m_AoShadowParams.Set();
-
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
- }
-
- namespace {
-
- void computeFrustumBounds(const SCamera &inCamera, const NVRenderRectF &inViewPort,
- QT3DSVec3 &ctrBound, QT3DSVec3 camVerts[8])
- {
- QT3DSVec3 camEdges[4];
-
- const QT3DSF32 *dataPtr(inCamera.m_GlobalTransform.front());
- QT3DSVec3 camX(dataPtr[0], dataPtr[1], dataPtr[2]);
- QT3DSVec3 camY(dataPtr[4], dataPtr[5], dataPtr[6]);
- QT3DSVec3 camZ(dataPtr[8], dataPtr[9], dataPtr[10]);
-
- float tanFOV = tanf(inCamera.verticalFov(inViewPort) * 0.5f);
- float asTanFOV = tanFOV * inViewPort.m_Width / inViewPort.m_Height;
- camEdges[0] = -asTanFOV * camX + tanFOV * camY + camZ;
- camEdges[1] = asTanFOV * camX + tanFOV * camY + camZ;
- camEdges[2] = asTanFOV * camX - tanFOV * camY + camZ;
- camEdges[3] = -asTanFOV * camX - tanFOV * camY + camZ;
-
- for (int i = 0; i < 4; ++i) {
- camEdges[i].x = -camEdges[i].x;
- camEdges[i].y = -camEdges[i].y;
- }
-
- camVerts[0] = inCamera.m_Position + camEdges[0] * inCamera.m_ClipNear;
- camVerts[1] = inCamera.m_Position + camEdges[0] * inCamera.m_ClipFar;
- camVerts[2] = inCamera.m_Position + camEdges[1] * inCamera.m_ClipNear;
- camVerts[3] = inCamera.m_Position + camEdges[1] * inCamera.m_ClipFar;
- camVerts[4] = inCamera.m_Position + camEdges[2] * inCamera.m_ClipNear;
- camVerts[5] = inCamera.m_Position + camEdges[2] * inCamera.m_ClipFar;
- camVerts[6] = inCamera.m_Position + camEdges[3] * inCamera.m_ClipNear;
- camVerts[7] = inCamera.m_Position + camEdges[3] * inCamera.m_ClipFar;
-
- ctrBound = camVerts[0];
- for (int i = 1; i < 8; ++i) {
- ctrBound += camVerts[i];
- }
- ctrBound *= 0.125f;
- }
-
- void SetupCameraForShadowMap(const QT3DSVec2 &inCameraVec, NVRenderContext & /*inContext*/,
- const NVRenderRectF &inViewport, const SCamera &inCamera,
- const SLight *inLight, SCamera &theCamera)
- {
- // setup light matrix
- QT3DSU32 mapRes = 1 << inLight->m_ShadowMapRes;
- NVRenderRectF theViewport(0.0f, 0.0f, (float)mapRes, (float)mapRes);
- theCamera.m_ClipNear = 1.0f;
- theCamera.m_ClipFar = inLight->m_ShadowMapFar;
- // Setup camera projection
- QT3DSVec3 inLightPos = inLight->GetGlobalPos();
- QT3DSVec3 inLightDir = inLight->GetDirection();
-
- if (inLight->m_Flags.IsLeftHanded())
- inLightPos.z = -inLightPos.z;
-
- inLightPos -= inLightDir * inCamera.m_ClipNear;
- theCamera.m_FOV = inLight->m_ShadowMapFov * QT3DS_DEGREES_TO_RADIANS;
-
- if (inLight->m_LightType == RenderLightTypes::Directional) {
- QT3DSVec3 frustBounds[8], boundCtr;
- computeFrustumBounds(inCamera, inViewport, boundCtr, frustBounds);
-
- QT3DSVec3 forward = inLightDir;
- forward.normalize();
- QT3DSVec3 right = forward.cross(QT3DSVec3(0, 1, 0));
- right.normalize();
- QT3DSVec3 up = right.cross(forward);
- up.normalize();
-
- // Calculate bounding box of the scene camera frustum
- float minDistanceZ = std::numeric_limits<float>::max();
- float maxDistanceZ = -std::numeric_limits<float>::max();
- float minDistanceY = std::numeric_limits<float>::max();
- float maxDistanceY = -std::numeric_limits<float>::max();
- float minDistanceX = std::numeric_limits<float>::max();
- float maxDistanceX = -std::numeric_limits<float>::max();
- for (int i = 0; i < 8; ++i) {
- float distanceZ = frustBounds[i].dot(forward);
- if (distanceZ < minDistanceZ)
- minDistanceZ = distanceZ;
- if (distanceZ > maxDistanceZ)
- maxDistanceZ = distanceZ;
- float distanceY = frustBounds[i].dot(up);
- if (distanceY < minDistanceY)
- minDistanceY = distanceY;
- if (distanceY > maxDistanceY)
- maxDistanceY = distanceY;
- float distanceX = frustBounds[i].dot(right);
- if (distanceX < minDistanceX)
- minDistanceX = distanceX;
- if (distanceX > maxDistanceX)
- maxDistanceX = distanceX;
- }
-
- // Apply bounding box parameters to shadow map camera projection matrix
- // so that the whole scene is fit inside the shadow map
- inLightPos = boundCtr;
- theViewport.m_Height = abs(maxDistanceY - minDistanceY);
- theViewport.m_Width = abs(maxDistanceX - minDistanceX);
- theCamera.m_ClipNear = -abs(maxDistanceZ - minDistanceZ);
- theCamera.m_ClipFar = abs(maxDistanceZ - minDistanceZ);
- }
-
- theCamera.m_Flags.SetLeftHanded(false);
-
- theCamera.m_Flags.ClearOrSet(inLight->m_LightType == RenderLightTypes::Directional,
- NodeFlagValues::Orthographic);
- theCamera.m_Parent = NULL;
- theCamera.m_Pivot = inLight->m_Pivot;
-
- if (inLight->m_LightType != RenderLightTypes::Point) {
- theCamera.LookAt(inLightPos, QT3DSVec3(0, 1.0, 0), inLightPos + inLightDir);
- } else {
- theCamera.LookAt(inLightPos, QT3DSVec3(0, 1.0, 0), QT3DSVec3(0, 0, 0));
- }
-
- theCamera.CalculateGlobalVariables(theViewport,
- QT3DSVec2(theViewport.m_Width, theViewport.m_Height));
- }
- }
-
- void SetupCubeShadowCameras(const SLight *inLight, SCamera inCameras[6])
- {
- // setup light matrix
- QT3DSU32 mapRes = 1 << inLight->m_ShadowMapRes;
- NVRenderRectF theViewport(0.0f, 0.0f, (float)mapRes, (float)mapRes);
- QT3DSVec3 rotOfs[6];
-
- QT3DS_ASSERT(inLight != NULL);
- QT3DS_ASSERT(inLight->m_LightType != RenderLightTypes::Directional);
-
- QT3DSVec3 inLightPos = inLight->GetGlobalPos();
- if (inLight->m_Flags.IsLeftHanded())
- inLightPos.z = -inLightPos.z;
-
- rotOfs[0] = QT3DSVec3(0.f, -NVHalfPi, NVPi);
- rotOfs[1] = QT3DSVec3(0.f, NVHalfPi, NVPi);
- rotOfs[2] = QT3DSVec3(NVHalfPi, 0.f, 0.f);
- rotOfs[3] = QT3DSVec3(-NVHalfPi, 0.f, 0.f);
- rotOfs[4] = QT3DSVec3(0.f, NVPi, -NVPi);
- rotOfs[5] = QT3DSVec3(0.f, 0.f, NVPi);
-
- for (int i = 0; i < 6; ++i) {
- inCameras[i].m_Flags.SetLeftHanded(false);
-
- inCameras[i].m_Flags.ClearOrSet(false, NodeFlagValues::Orthographic);
- inCameras[i].m_Parent = NULL;
- inCameras[i].m_Pivot = inLight->m_Pivot;
- inCameras[i].m_ClipNear = 1.0f;
- inCameras[i].m_ClipFar = NVMax<QT3DSF32>(2.0f, inLight->m_ShadowMapFar);
- inCameras[i].m_FOV = inLight->m_ShadowMapFov * QT3DS_DEGREES_TO_RADIANS;
-
- inCameras[i].m_Position = inLightPos;
- inCameras[i].m_Rotation = rotOfs[i];
- inCameras[i].CalculateGlobalVariables(
- theViewport, QT3DSVec2(theViewport.m_Width, theViewport.m_Height));
- }
-
- /*
- if ( inLight->m_LightType == RenderLightTypes::Point ) return;
-
- QT3DSVec3 viewDirs[6];
- QT3DSVec3 viewUp[6];
- QT3DSMat33 theDirMatrix( inLight->m_GlobalTransform.getUpper3x3() );
-
- viewDirs[0] = theDirMatrix.transform( QT3DSVec3( 1.f, 0.f, 0.f ) );
- viewDirs[2] = theDirMatrix.transform( QT3DSVec3( 0.f, -1.f, 0.f ) );
- viewDirs[4] = theDirMatrix.transform( QT3DSVec3( 0.f, 0.f, 1.f ) );
- viewDirs[0].normalize(); viewDirs[2].normalize(); viewDirs[4].normalize();
- viewDirs[1] = -viewDirs[0];
- viewDirs[3] = -viewDirs[2];
- viewDirs[5] = -viewDirs[4];
-
- viewUp[0] = viewDirs[2];
- viewUp[1] = viewDirs[2];
- viewUp[2] = viewDirs[5];
- viewUp[3] = viewDirs[4];
- viewUp[4] = viewDirs[2];
- viewUp[5] = viewDirs[2];
-
- for (int i = 0; i < 6; ++i)
- {
- inCameras[i].LookAt( inLightPos, viewUp[i], inLightPos + viewDirs[i] );
- inCameras[i].CalculateGlobalVariables( theViewport, QT3DSVec2( theViewport.m_Width,
- theViewport.m_Height ) );
- }
- */
- }
-
- inline void RenderRenderableShadowMapPass(SLayerRenderData &inData, SRenderableObject &inObject,
- const QT3DSVec2 &inCameraProps, TShaderFeatureSet,
- QT3DSU32 lightIndex, const SCamera &inCamera)
- {
- if (!inObject.m_RenderableFlags.IsShadowCaster())
- return;
-
- SShadowMapEntry *pEntry = inData.m_ShadowMapManager->GetShadowMapEntry(lightIndex);
-
- if (inObject.m_RenderableFlags.IsDefaultMaterialMeshSubset())
- static_cast<SSubsetRenderableBase &>(inObject).RenderShadowMapPass(
- inCameraProps, inData.m_Lights[lightIndex], inCamera, pEntry);
- else if (inObject.m_RenderableFlags.IsCustomMaterialMeshSubset()) {
- static_cast<SSubsetRenderableBase &>(inObject).RenderShadowMapPass(
- inCameraProps, inData.m_Lights[lightIndex], inCamera, pEntry);
- } else if (inObject.m_RenderableFlags.IsPath()) {
- static_cast<SPathRenderable &>(inObject).RenderShadowMapPass(
- inCameraProps, inData.m_Lights[lightIndex], inCamera, pEntry);
- }
- }
-
- void SLayerRenderData::RenderShadowCubeBlurPass(CResourceFrameBuffer *theFB,
- NVRenderTextureCube *target0,
- NVRenderTextureCube *target1, QT3DSF32 filterSz,
- QT3DSF32 clipFar)
- {
- NVRenderContext &theContext(m_Renderer.GetContext());
-
- SShadowmapPreblurShader *shaderX = m_Renderer.GetCubeShadowBlurXShader();
- SShadowmapPreblurShader *shaderY = m_Renderer.GetCubeShadowBlurYShader();
-
- if (shaderX == NULL)
- return;
- if (shaderY == NULL)
- return;
- // if ( theShader == NULL ) return;
-
- // Enable drawing to 6 color attachment buffers for cubemap passes
- qt3ds::QT3DSI32 buffers[6] = { 0, 1, 2, 3, 4, 5 };
- qt3ds::foundation::NVConstDataRef<qt3ds::QT3DSI32> bufferList(buffers, 6);
- theContext.SetDrawBuffers(bufferList);
-
- // Attach framebuffer targets
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color0, *target1,
- NVRenderTextureCubeFaces::CubePosX);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color1, *target1,
- NVRenderTextureCubeFaces::CubeNegX);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color2, *target1,
- NVRenderTextureCubeFaces::CubePosY);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color3, *target1,
- NVRenderTextureCubeFaces::CubeNegY);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color4, *target1,
- NVRenderTextureCubeFaces::CubePosZ);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color5, *target1,
- NVRenderTextureCubeFaces::CubeNegZ);
-
- // Set initial state
- theContext.SetBlendingEnabled(false);
- theContext.SetDepthWriteEnabled(false);
- theContext.SetDepthTestEnabled(false);
- // theContext.SetColorWritesEnabled(true);
- theContext.SetActiveShader(&(shaderX->m_Shader));
-
- shaderX->m_CameraProperties.Set(QT3DSVec2(filterSz, clipFar));
- shaderX->m_DepthCube.Set(target0);
-
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
-
- theContext.SetActiveShader(&(shaderY->m_Shader));
-
- // Lather, Rinse, and Repeat for the Y-blur pass
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color0, *target0,
- NVRenderTextureCubeFaces::CubePosX);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color1, *target0,
- NVRenderTextureCubeFaces::CubeNegX);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color2, *target0,
- NVRenderTextureCubeFaces::CubePosY);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color3, *target0,
- NVRenderTextureCubeFaces::CubeNegY);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color4, *target0,
- NVRenderTextureCubeFaces::CubePosZ);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color5, *target0,
- NVRenderTextureCubeFaces::CubeNegZ);
-
- shaderY->m_CameraProperties.Set(QT3DSVec2(filterSz, clipFar));
- shaderY->m_DepthCube.Set(target1);
-
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
-
- theContext.SetDepthWriteEnabled(true);
- theContext.SetDepthTestEnabled(true);
- // theContext.SetColorWritesEnabled(false);
-
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color0, NVRenderTextureOrRenderBuffer(),
- NVRenderTextureCubeFaces::CubePosX);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color1, NVRenderTextureOrRenderBuffer(),
- NVRenderTextureCubeFaces::CubeNegX);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color2, NVRenderTextureOrRenderBuffer(),
- NVRenderTextureCubeFaces::CubePosY);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color3, NVRenderTextureOrRenderBuffer(),
- NVRenderTextureCubeFaces::CubeNegY);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color4, NVRenderTextureOrRenderBuffer(),
- NVRenderTextureCubeFaces::CubePosZ);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color5, NVRenderTextureOrRenderBuffer(),
- NVRenderTextureCubeFaces::CubeNegZ);
-
- theContext.SetDrawBuffers(qt3ds::foundation::toConstDataRef((qt3ds::QT3DSI32)0));
- }
-
- void SLayerRenderData::RenderShadowMapBlurPass(CResourceFrameBuffer *theFB,
- NVRenderTexture2D *target0,
- NVRenderTexture2D *target1, QT3DSF32 filterSz,
- QT3DSF32 clipFar)
- {
- NVRenderContext &theContext(m_Renderer.GetContext());
-
- SShadowmapPreblurShader *shaderX = m_Renderer.GetOrthoShadowBlurXShader();
- SShadowmapPreblurShader *shaderY = m_Renderer.GetOrthoShadowBlurYShader();
-
- if (shaderX == NULL)
- return;
- if (shaderY == NULL)
- return;
-
- // Attach framebuffer target
- (*theFB)->Attach(NVRenderFrameBufferAttachments::Color0, *target1);
- //(*theFB)->Attach( NVRenderFrameBufferAttachments::DepthStencil, *target1 );
-
- // Set initial state
- theContext.SetBlendingEnabled(false);
- theContext.SetDepthWriteEnabled(false);
- theContext.SetDepthTestEnabled(false);
- theContext.SetColorWritesEnabled(true);
- theContext.SetActiveShader(&(shaderX->m_Shader));
-
- shaderX->m_CameraProperties.Set(QT3DSVec2(filterSz, clipFar));
- shaderX->m_DepthMap.Set(target0);
-
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
-
- (*theFB)->Attach(NVRenderFrameBufferAttachments::Color0, *target0);
- //(*theFB)->Attach( NVRenderFrameBufferAttachments::DepthStencil, *target0 );
- theContext.SetActiveShader(&(shaderY->m_Shader));
-
- shaderY->m_CameraProperties.Set(QT3DSVec2(filterSz, clipFar));
- shaderY->m_DepthMap.Set(target1);
-
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
-
- theContext.SetDepthWriteEnabled(true);
- theContext.SetDepthTestEnabled(true);
- theContext.SetColorWritesEnabled(false);
-
- //(*theFB)->Attach( NVRenderFrameBufferAttachments::DepthStencil,
- //NVRenderTextureOrRenderBuffer() );
- (*theFB)->Attach(NVRenderFrameBufferAttachments::Color0, NVRenderTextureOrRenderBuffer());
- }
-
- void SLayerRenderData::RenderShadowMapPass(CResourceFrameBuffer *theFB)
- {
- SStackPerfTimer ___timer(m_Renderer.GetQt3DSContext().GetPerfTimer(),
- "SLayerRenderData::RenderShadowMapPass");
-
- if (m_Camera == NULL || !GetShadowMapManager())
- return;
-
- // Check if we have anything to render
- if (m_OpaqueObjects.size() == 0 || m_Lights.size() == 0)
- return;
-
- m_Renderer.BeginLayerDepthPassRender(*this);
-
- NVRenderContext &theRenderContext(m_Renderer.GetContext());
-
- // we may change the viewport
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theRenderContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport);
-
- // disable color writes
- // theRenderContext.SetColorWritesEnabled( false );
- theRenderContext.SetColorWritesEnabled(true);
- theRenderContext.SetDepthWriteEnabled(true);
- theRenderContext.SetCullingEnabled(false);
- theRenderContext.SetClearColor(QT3DSVec4(1.0f));
-
- // we render the shadow map with a slight offset to prevent shadow acne and cull the front
- // faces
- NVScopedRefCounted<qt3ds::render::NVRenderRasterizerState> rsdefaultstate =
- theRenderContext.CreateRasterizerState(0.0, 0.0, qt3ds::render::NVRenderFaces::Back);
- NVScopedRefCounted<qt3ds::render::NVRenderRasterizerState> rsstate =
- theRenderContext.CreateRasterizerState(1.5, 2.0, qt3ds::render::NVRenderFaces::Front);
- theRenderContext.SetRasterizerState(rsstate);
-
- qt3ds::render::NVRenderClearFlags clearFlags(qt3ds::render::NVRenderClearValues::Depth
- | qt3ds::render::NVRenderClearValues::Stencil
- | qt3ds::render::NVRenderClearValues::Color);
-
- for (QT3DSU32 i = 0; i < m_Lights.size(); i++) {
- // don't render shadows when not casting
- if (m_Lights[i]->m_CastShadow == false)
- continue;
- SShadowMapEntry *pEntry = m_ShadowMapManager->GetShadowMapEntry(i);
- if (pEntry && pEntry->m_DepthMap && pEntry->m_DepthCopy && pEntry->m_DepthRender) {
- SCamera theCamera;
-
- QT3DSVec2 theCameraProps = QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar);
- SetupCameraForShadowMap(theCameraProps, m_Renderer.GetContext(),
- __viewport.m_InitialValue, *m_Camera,
- m_Lights[i], theCamera);
- // we need this matrix for the final rendering
- theCamera.CalculateViewProjectionMatrix(pEntry->m_LightVP);
- pEntry->m_LightView = theCamera.m_GlobalTransform.getInverse();
-
- STextureDetails theDetails(pEntry->m_DepthMap->GetTextureDetails());
- theRenderContext.SetViewport(
- NVRenderRect(0, 0, (QT3DSU32)theDetails.m_Width, (QT3DSU32)theDetails.m_Height));
-
- (*theFB)->Attach(NVRenderFrameBufferAttachments::Color0, *pEntry->m_DepthMap);
- (*theFB)->Attach(NVRenderFrameBufferAttachments::DepthStencil,
- *pEntry->m_DepthRender);
- theRenderContext.Clear(clearFlags);
-
- RunRenderPass(RenderRenderableShadowMapPass, false, true, true, i, theCamera);
- RenderShadowMapBlurPass(theFB, pEntry->m_DepthMap, pEntry->m_DepthCopy,
- m_Lights[i]->m_ShadowFilter, m_Lights[i]->m_ShadowMapFar);
- } else if (pEntry && pEntry->m_DepthCube && pEntry->m_CubeCopy
- && pEntry->m_DepthRender) {
- SCamera theCameras[6];
-
- SetupCubeShadowCameras(m_Lights[i], theCameras);
-
- // pEntry->m_LightView = m_Lights[i]->m_LightType == RenderLightTypes::Point ?
- // QT3DSMat44::createIdentity()
- // : m_Lights[i]->m_GlobalTransform;
- pEntry->m_LightView = QT3DSMat44::createIdentity();
-
- STextureDetails theDetails(pEntry->m_DepthCube->GetTextureDetails());
- theRenderContext.SetViewport(
- NVRenderRect(0, 0, (QT3DSU32)theDetails.m_Width, (QT3DSU32)theDetails.m_Height));
-
- // int passes = m_Lights[i]->m_LightType == RenderLightTypes::Point ? 6 : 5;
- int passes = 6;
- for (int k = 0; k < passes; ++k) {
- // theCameras[k].CalculateViewProjectionMatrix( pEntry->m_LightCubeVP[k] );
- pEntry->m_LightCubeView[k] = theCameras[k].m_GlobalTransform.getInverse();
- theCameras[k].CalculateViewProjectionMatrix(pEntry->m_LightVP);
-
- // Geometry shader multiplication really doesn't work unless you have a
- // 6-layered 3D depth texture...
- // Otherwise, you have no way to depth test while rendering...
- // which more or less completely defeats the purpose of having a cubemap render
- // target.
- NVRenderTextureCubeFaces::Enum curFace =
- (NVRenderTextureCubeFaces::Enum)(k + 1);
- //(*theFB)->AttachFace( NVRenderFrameBufferAttachments::DepthStencil,
- //*pEntry->m_DepthCube, curFace );
- (*theFB)->Attach(NVRenderFrameBufferAttachments::DepthStencil,
- *pEntry->m_DepthRender);
- (*theFB)->AttachFace(NVRenderFrameBufferAttachments::Color0,
- *pEntry->m_DepthCube, curFace);
- (*theFB)->IsComplete();
- theRenderContext.Clear(clearFlags);
-
- RunRenderPass(RenderRenderableShadowMapPass, false, true, true, i,
- theCameras[k]);
- }
-
- RenderShadowCubeBlurPass(theFB, pEntry->m_DepthCube, pEntry->m_CubeCopy,
- m_Lights[i]->m_ShadowFilter, m_Lights[i]->m_ShadowMapFar);
- }
- }
-
- (*theFB)->Attach(NVRenderFrameBufferAttachments::Depth, NVRenderTextureOrRenderBuffer());
- (*theFB)->Attach(NVRenderFrameBufferAttachments::Color0, NVRenderTextureOrRenderBuffer());
-
- // enable color writes
- theRenderContext.SetColorWritesEnabled(true);
- theRenderContext.SetCullingEnabled(true);
- theRenderContext.SetClearColor(QT3DSVec4(0.0f));
- // reset rasterizer state
- theRenderContext.SetRasterizerState(rsdefaultstate);
-
- m_Renderer.EndLayerDepthPassRender();
- }
-
- inline void RenderRenderableDepthPass(SLayerRenderData &inData, SRenderableObject &inObject,
- const QT3DSVec2 &inCameraProps, TShaderFeatureSet, QT3DSU32,
- const SCamera &inCamera)
- {
- if (inObject.m_RenderableFlags.IsDefaultMaterialMeshSubset()) {
- static_cast<SSubsetRenderable &>(inObject).RenderDepthPass(inCameraProps);
- } else if (inObject.m_RenderableFlags.IsText()) {
- static_cast<STextRenderable &>(inObject).RenderDepthPass(inCameraProps);
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- } else if (inObject.m_RenderableFlags.isDistanceField()) {
- static_cast<SDistanceFieldRenderable &>(inObject).RenderDepthPass(inCameraProps);
-#endif
- } else if (inObject.m_RenderableFlags.IsCustomMaterialMeshSubset()) {
- static_cast<SCustomMaterialRenderable &>(inObject).RenderDepthPass(
- inCameraProps, inData.m_Layer, inData.m_Lights, inCamera, NULL);
- } else if (inObject.m_RenderableFlags.IsPath()) {
- static_cast<SPathRenderable &>(inObject).RenderDepthPass(
- inCameraProps, inData.m_Layer, inData.m_Lights, inCamera, NULL);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void SLayerRenderData::RenderDepthPass(bool inEnableTransparentDepthWrite)
- {
- SStackPerfTimer ___timer(m_Renderer.GetQt3DSContext().GetPerfTimer(),
- "SLayerRenderData::RenderDepthPass");
- if (m_Camera == NULL)
- return;
-
- // Avoid running this method if possible.
- if ((inEnableTransparentDepthWrite == false
- && (m_OpaqueObjects.size() == 0
- || m_Layer.m_Flags.IsLayerEnableDepthPrepass() == false))
- || m_Layer.m_Flags.IsLayerEnableDepthTest() == false)
- return;
-
- m_Renderer.BeginLayerDepthPassRender(*this);
-
- NVRenderContext &theRenderContext(m_Renderer.GetContext());
-
- // disable color writes
- theRenderContext.SetColorWritesEnabled(false);
- theRenderContext.SetDepthWriteEnabled(true);
-
- qt3ds::render::NVRenderClearFlags clearFlags(qt3ds::render::NVRenderClearValues::Stencil
- | qt3ds::render::NVRenderClearValues::Depth);
- theRenderContext.Clear(clearFlags);
-
- RunRenderPass(RenderRenderableDepthPass, false, true, inEnableTransparentDepthWrite, 0,
- *m_Camera);
-
- // enable color writes
- theRenderContext.SetColorWritesEnabled(true);
-
- m_Renderer.EndLayerDepthPassRender();
- }
-
- inline void RenderRenderable(SLayerRenderData &inData, SRenderableObject &inObject,
- const QT3DSVec2 &inCameraProps, TShaderFeatureSet inFeatureSet, QT3DSU32,
- const SCamera &inCamera)
- {
- if (inObject.m_RenderableFlags.IsDefaultMaterialMeshSubset())
- static_cast<SSubsetRenderable &>(inObject).Render(inCameraProps, inFeatureSet);
- else if (inObject.m_RenderableFlags.IsText())
- static_cast<STextRenderable &>(inObject).Render(inCameraProps);
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- else if (inObject.m_RenderableFlags.isDistanceField())
- static_cast<SDistanceFieldRenderable &>(inObject).Render(inCameraProps);
-#endif
- else if (inObject.m_RenderableFlags.IsCustomMaterialMeshSubset()) {
- // PKC : Need a better place to do this.
- SCustomMaterialRenderable &theObject =
- static_cast<SCustomMaterialRenderable &>(inObject);
- if (!inData.m_Layer.m_LightProbe && theObject.m_Material.m_IblProbe)
- inData.SetShaderFeature("QT3DS_ENABLE_LIGHT_PROBE",
- theObject.m_Material.m_IblProbe->m_TextureData.m_Texture
- != NULL);
- else if (inData.m_Layer.m_LightProbe)
- inData.SetShaderFeature("QT3DS_ENABLE_LIGHT_PROBE",
- inData.m_Layer.m_LightProbe->m_TextureData.m_Texture
- != NULL);
-
- static_cast<SCustomMaterialRenderable &>(inObject).Render(
- inCameraProps, inData, inData.m_Layer, inData.m_Lights, inCamera,
- inData.m_LayerDepthTexture, inData.m_LayerSsaoTexture, inFeatureSet);
- } else if (inObject.m_RenderableFlags.IsPath()) {
- static_cast<SPathRenderable &>(inObject).Render(
- inCameraProps, inData.m_Layer, inData.m_Lights, inCamera,
- inData.m_LayerDepthTexture, inData.m_LayerSsaoTexture, inFeatureSet);
- } else {
- QT3DS_ASSERT(false);
- }
- }
-
- void SLayerRenderData::RunRenderPass(TRenderRenderableFunction inRenderFn,
- bool inEnableBlending, bool inEnableDepthWrite,
- bool inEnableTransparentDepthWrite, QT3DSU32 indexLight,
- const SCamera &inCamera, CResourceFrameBuffer *theFB)
- {
- NVRenderContext &theRenderContext(m_Renderer.GetContext());
- theRenderContext.SetDepthFunction(qt3ds::render::NVRenderBoolOp::LessThanOrEqual);
- theRenderContext.SetBlendingEnabled(false);
- QT3DSVec2 theCameraProps = QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar);
- NVDataRef<SRenderableObject *> theOpaqueObjects = GetOpaqueRenderableObjects();
- bool usingDepthBuffer =
- m_Layer.m_Flags.IsLayerEnableDepthTest() && theOpaqueObjects.size() > 0;
-
- if (usingDepthBuffer) {
- theRenderContext.SetDepthTestEnabled(true);
- theRenderContext.SetDepthWriteEnabled(inEnableDepthWrite);
- } else {
- theRenderContext.SetDepthWriteEnabled(false);
- theRenderContext.SetDepthTestEnabled(false);
- }
-
- for (QT3DSU32 idx = 0, end = theOpaqueObjects.size(); idx < end; ++idx) {
- SRenderableObject &theObject(*theOpaqueObjects[idx]);
- SScopedLightsListScope lightsScope(m_Lights, m_LightDirections, m_SourceLightDirections,
- theObject.m_ScopedLights);
- SetShaderFeature(m_CGLightingFeatureName, m_Lights.empty() == false);
- inRenderFn(*this, theObject, theCameraProps, GetShaderFeatureSet(), indexLight,
- inCamera);
- }
-
- // transparent objects
- if (inEnableBlending || m_Layer.m_Flags.IsLayerEnableDepthTest() == false) {
- theRenderContext.SetBlendingEnabled(true && inEnableBlending);
- theRenderContext.SetDepthWriteEnabled(inEnableTransparentDepthWrite);
-
- NVDataRef<SRenderableObject *> theTransparentObjects = GetTransparentRenderableObjects();
- // Assume all objects have transparency if the layer's depth test enabled flag is true.
- if (m_Layer.m_Flags.IsLayerEnableDepthTest() == true) {
- for (QT3DSU32 idx = 0, end = theTransparentObjects.size(); idx < end; ++idx) {
- SRenderableObject &theObject(*theTransparentObjects[idx]);
- if (!(theObject.m_RenderableFlags.IsCompletelyTransparent())) {
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- // SW fallback for advanced blend modes.
- // Renders transparent objects to a separate FBO and blends them in shader
- // with the opaque items and background.
- DefaultMaterialBlendMode::Enum blendMode
- = DefaultMaterialBlendMode::Enum::Normal;
- if (theObject.m_RenderableFlags.IsDefaultMaterialMeshSubset())
- blendMode = static_cast<SSubsetRenderable &>(theObject).getBlendingMode();
- bool useBlendFallback = (blendMode == DefaultMaterialBlendMode::Overlay ||
- blendMode == DefaultMaterialBlendMode::ColorBurn ||
- blendMode == DefaultMaterialBlendMode::ColorDodge) &&
- !theRenderContext.IsAdvancedBlendHwSupported() &&
- !theRenderContext.IsAdvancedBlendHwSupportedKHR() &&
- m_LayerPrepassDepthTexture;
- if (useBlendFallback)
- SetupDrawFB(true);
-#endif
- SScopedLightsListScope lightsScope(m_Lights, m_LightDirections,
- m_SourceLightDirections,
- theObject.m_ScopedLights);
- SetShaderFeature(m_CGLightingFeatureName, m_Lights.empty() == false);
-
- inRenderFn(*this, theObject, theCameraProps, GetShaderFeatureSet(),
- indexLight, inCamera);
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- // SW fallback for advanced blend modes.
- // Continue blending after transparent objects have been rendered to a FBO
- if (useBlendFallback) {
- BlendAdvancedToFB(blendMode, true, theFB);
- // restore blending status
- theRenderContext.SetBlendingEnabled(inEnableBlending);
- // restore depth test status
- theRenderContext.SetDepthTestEnabled(usingDepthBuffer);
- theRenderContext.SetDepthWriteEnabled(inEnableTransparentDepthWrite);
- }
-#endif
- }
- }
- }
- // If the layer doesn't have depth enabled then we have to render via an alternate route
- // where the transparent objects vector could have both opaque and transparent objects.
- else {
- for (QT3DSU32 idx = 0, end = theTransparentObjects.size(); idx < end; ++idx) {
- SRenderableObject &theObject(*theTransparentObjects[idx]);
- if (!(theObject.m_RenderableFlags.IsCompletelyTransparent())) {
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- DefaultMaterialBlendMode::Enum blendMode
- = DefaultMaterialBlendMode::Enum::Normal;
- if (theObject.m_RenderableFlags.IsDefaultMaterialMeshSubset())
- blendMode = static_cast<SSubsetRenderable &>(theObject).getBlendingMode();
- bool useBlendFallback = (blendMode == DefaultMaterialBlendMode::Overlay ||
- blendMode == DefaultMaterialBlendMode::ColorBurn ||
- blendMode == DefaultMaterialBlendMode::ColorDodge) &&
- !theRenderContext.IsAdvancedBlendHwSupported() &&
- !theRenderContext.IsAdvancedBlendHwSupportedKHR();
-
- if (theObject.m_RenderableFlags.HasTransparency()) {
- theRenderContext.SetBlendingEnabled(true && inEnableBlending);
- // If we have SW fallback for blend mode, render to a FBO and blend back.
- // Slow as this must be done per-object (transparent and opaque items
- // are mixed, not batched)
- if (useBlendFallback)
- SetupDrawFB(false);
- }
-#endif
- SScopedLightsListScope lightsScope(m_Lights, m_LightDirections,
- m_SourceLightDirections,
- theObject.m_ScopedLights);
- SetShaderFeature(m_CGLightingFeatureName, m_Lights.empty() == false);
- inRenderFn(*this, theObject, theCameraProps, GetShaderFeatureSet(),
- indexLight, inCamera);
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- if (useBlendFallback) {
- BlendAdvancedToFB(blendMode, false, theFB);
- // restore blending status
- theRenderContext.SetBlendingEnabled(inEnableBlending);
-
- }
-#endif
- }
- }
- }
- }
- }
-
- void SLayerRenderData::Render(CResourceFrameBuffer *theFB)
- {
- SStackPerfTimer ___timer(m_Renderer.GetQt3DSContext().GetPerfTimer(),
- "SLayerRenderData::Render");
- if (m_Camera == NULL)
- return;
-
- m_Renderer.BeginLayerRender(*this);
- RunRenderPass(RenderRenderable, true, !m_Layer.m_Flags.IsLayerEnableDepthPrepass(), false,
- 0, *m_Camera, theFB);
- m_Renderer.EndLayerRender();
- }
-
- void SLayerRenderData::CreateGpuProfiler()
- {
- if (m_Renderer.GetContext().IsTimerQuerySupported()) {
- m_LayerProfilerGpu = IRenderProfiler::CreateGpuProfiler(
- m_Renderer.GetContext().GetFoundation(), m_Renderer.GetQt3DSContext(),
- m_Renderer.GetContext());
- }
- }
-
- void SLayerRenderData::StartProfiling(CRegisteredString &nameID, bool sync)
- {
- if (m_LayerProfilerGpu.mPtr) {
- m_LayerProfilerGpu->StartTimer(nameID, false, sync);
- }
- }
-
- void SLayerRenderData::EndProfiling(CRegisteredString &nameID)
- {
- if (m_LayerProfilerGpu.mPtr) {
- m_LayerProfilerGpu->EndTimer(nameID);
- }
- }
-
- void SLayerRenderData::StartProfiling(const char *nameID, bool sync)
- {
- if (m_LayerProfilerGpu.mPtr) {
- CRegisteredString theStr(
- m_Renderer.GetQt3DSContext().GetStringTable().RegisterStr(nameID));
- m_LayerProfilerGpu->StartTimer(theStr, false, sync);
- }
- }
-
- void SLayerRenderData::EndProfiling(const char *nameID)
- {
- if (m_LayerProfilerGpu.mPtr) {
- CRegisteredString theStr(
- m_Renderer.GetQt3DSContext().GetStringTable().RegisterStr(nameID));
- m_LayerProfilerGpu->EndTimer(theStr);
- }
- }
-
- void SLayerRenderData::AddVertexCount(QT3DSU32 count)
- {
- if (m_LayerProfilerGpu.mPtr) {
- m_LayerProfilerGpu->AddVertexCount(count);
- }
- }
-
- // Assumes the viewport is setup appropriately to render the widget.
- void SLayerRenderData::RenderRenderWidgets()
- {
- if (m_Camera) {
- NVRenderContext &theContext(m_Renderer.GetContext());
- for (QT3DSU32 idx = 0, end = m_IRenderWidgets.size(); idx < end; ++idx) {
- IRenderWidget &theWidget = *m_IRenderWidgets[idx];
- theWidget.Render(m_Renderer, theContext);
- }
- }
- }
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- void SLayerRenderData::BlendAdvancedEquationSwFallback(NVRenderTexture2D *drawTexture,
- NVRenderTexture2D *layerTexture,
- AdvancedBlendModes::Enum blendMode)
- {
- NVRenderContext &theContext(m_Renderer.GetContext());
- SAdvancedModeBlendShader *shader = m_Renderer.GetAdvancedBlendModeShader(blendMode);
- if (shader == NULL)
- return;
-
- theContext.SetActiveShader(&(shader->m_Shader));
-
- shader->m_baseLayer.Set(layerTexture);
- shader->m_blendLayer.Set(drawTexture);
- // Draw a fullscreen quad
- m_Renderer.RenderQuad();
- }
-
- void SLayerRenderData::SetupDrawFB(bool depthEnabled)
- {
- NVRenderContext &theRenderContext(m_Renderer.GetContext());
- // create drawing FBO and texture, if not existing
- if (!m_AdvancedModeDrawFB)
- m_AdvancedModeDrawFB = theRenderContext.CreateFrameBuffer();
- if (!m_AdvancedBlendDrawTexture) {
- m_AdvancedBlendDrawTexture = theRenderContext.CreateTexture2D();
- NVRenderRect theViewport = m_Renderer.GetQt3DSContext().GetRenderList().GetViewport();
- m_AdvancedBlendDrawTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0,
- theViewport.m_Width,
- theViewport.m_Height,
- NVRenderTextureFormats::RGBA8);
- m_AdvancedModeDrawFB->Attach(NVRenderFrameBufferAttachments::Color0,
- *m_AdvancedBlendDrawTexture);
- // Use existing depth prepass information when rendering transparent objects to a FBO
- if (depthEnabled)
- m_AdvancedModeDrawFB->Attach(NVRenderFrameBufferAttachments::Depth,
- *m_LayerPrepassDepthTexture);
- }
- theRenderContext.SetRenderTarget(m_AdvancedModeDrawFB);
- // make sure that depth testing is on in order to render just the
- // depth-passed objects (=transparent objects) and leave background intact
- if (depthEnabled)
- theRenderContext.SetDepthTestEnabled(true);
- theRenderContext.SetBlendingEnabled(false);
- // clear color commonly is the layer background, make sure that it is all-zero here
- QT3DSVec4 originalClrColor = theRenderContext.GetClearColor();
- theRenderContext.SetClearColor(QT3DSVec4(0.0));
- theRenderContext.Clear(NVRenderClearValues::Color);
- theRenderContext.SetClearColor(originalClrColor);
-
- }
- void SLayerRenderData::BlendAdvancedToFB(DefaultMaterialBlendMode::Enum blendMode,
- bool depthEnabled, CResourceFrameBuffer *theFB)
- {
- NVRenderContext &theRenderContext(m_Renderer.GetContext());
- NVRenderRect theViewport = m_Renderer.GetQt3DSContext().GetRenderList().GetViewport();
- AdvancedBlendModes::Enum advancedMode;
-
- switch (blendMode) {
- case DefaultMaterialBlendMode::Overlay:
- advancedMode = AdvancedBlendModes::Overlay;
- break;
- case DefaultMaterialBlendMode::ColorBurn:
- advancedMode = AdvancedBlendModes::ColorBurn;
- break;
- case DefaultMaterialBlendMode::ColorDodge:
- advancedMode = AdvancedBlendModes::ColorDodge;
- break;
- default:
- Q_UNREACHABLE();
- }
- // create blending FBO and texture if not existing
- if (!m_AdvancedModeBlendFB)
- m_AdvancedModeBlendFB = theRenderContext.CreateFrameBuffer();
- if (!m_AdvancedBlendBlendTexture) {
- m_AdvancedBlendBlendTexture = theRenderContext.CreateTexture2D();
- m_AdvancedBlendBlendTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0,
- theViewport.m_Width,
- theViewport.m_Height,
- NVRenderTextureFormats::RGBA8);
- m_AdvancedModeBlendFB->Attach(NVRenderFrameBufferAttachments::Color0,
- *m_AdvancedBlendBlendTexture);
- }
- theRenderContext.SetRenderTarget(m_AdvancedModeBlendFB);
-
- // Blend transparent objects with SW fallback shaders.
- // Disable depth testing as transparent objects have already been
- // depth-checked; here we want to run shader for all layer pixels
- if (depthEnabled)
- {
- theRenderContext.SetDepthTestEnabled(false);
- theRenderContext.SetDepthWriteEnabled(false);
- }
- BlendAdvancedEquationSwFallback(m_AdvancedBlendDrawTexture, m_LayerTexture, advancedMode);
- theRenderContext.SetRenderTarget(*theFB);
- // setup read target
- theRenderContext.SetReadTarget(m_AdvancedModeBlendFB);
- theRenderContext.SetReadBuffer(NVReadFaces::Color0);
- theRenderContext.BlitFramebuffer(0, 0, theViewport.m_Width, theViewport.m_Height,
- 0, 0, theViewport.m_Width, theViewport.m_Height,
- NVRenderClearValues::Color,
- NVRenderTextureMagnifyingOp::Nearest);
- }
-#endif
-
- void SLayerRenderData::RenderToViewport()
- {
- if (m_LayerPrepResult->IsLayerVisible()) {
- if (GetOffscreenRenderer()) {
- if (m_Layer.m_Background == LayerBackground::Color) {
- m_LastFrameOffscreenRenderer->RenderWithClear(
- CreateOffscreenRenderEnvironment(), m_Renderer.GetContext(),
- m_Renderer.GetQt3DSContext().GetPresentationScaleFactor(),
- SScene::AlwaysClear, m_Layer.m_ClearColor, &m_Layer);
- } else {
- m_LastFrameOffscreenRenderer->Render(
- CreateOffscreenRenderEnvironment(), m_Renderer.GetContext(),
- m_Renderer.GetQt3DSContext().GetPresentationScaleFactor(),
- SScene::ClearIsOptional, &m_Layer);
- }
- } else {
- RenderDepthPass(false);
- Render();
- RenderRenderWidgets();
- }
- }
- }
- // These are meant to be pixel offsets, so you need to divide them by the width/height
- // of the layer respectively.
- const QT3DSVec2 s_VertexOffsets[SLayerRenderPreparationData::MAX_AA_LEVELS] = {
- QT3DSVec2(-0.170840f, -0.553840f), // 1x
- QT3DSVec2(0.162960f, -0.319340f), // 2x
- QT3DSVec2(0.360260f, -0.245840f), // 3x
- QT3DSVec2(-0.561340f, -0.149540f), // 4x
- QT3DSVec2(0.249460f, 0.453460f), // 5x
- QT3DSVec2(-0.336340f, 0.378260f), // 6x
- QT3DSVec2(0.340000f, 0.166260f), // 7x
- QT3DSVec2(0.235760f, 0.527760f), // 8x
- };
-
- // Blend factors are in the form of (frame blend factor, accumulator blend factor)
- const QT3DSVec2 s_BlendFactors[SLayerRenderPreparationData::MAX_AA_LEVELS] = {
- QT3DSVec2(0.500000f, 0.500000f), // 1x
- QT3DSVec2(0.333333f, 0.666667f), // 2x
- QT3DSVec2(0.250000f, 0.750000f), // 3x
- QT3DSVec2(0.200000f, 0.800000f), // 4x
- QT3DSVec2(0.166667f, 0.833333f), // 5x
- QT3DSVec2(0.142857f, 0.857143f), // 6x
- QT3DSVec2(0.125000f, 0.875000f), // 7x
- QT3DSVec2(0.111111f, 0.888889f), // 8x
- };
-
- const QT3DSVec2 s_TemporalVertexOffsets[SLayerRenderPreparationData::MAX_TEMPORAL_AA_LEVELS] = {
- QT3DSVec2(.3f, .3f), QT3DSVec2(-.3f, -.3f)
- };
-
- static inline void OffsetProjectionMatrix(QT3DSMat44 &inProjectionMatrix, QT3DSVec2 inVertexOffsets)
- {
- inProjectionMatrix.column3.x =
- inProjectionMatrix.column3.x + inProjectionMatrix.column3.w * inVertexOffsets.x;
- inProjectionMatrix.column3.y =
- inProjectionMatrix.column3.y + inProjectionMatrix.column3.w * inVertexOffsets.y;
- }
-
- CRegisteredString depthPassStr;
-
- // Render this layer's data to a texture. Required if we have any effects,
- // prog AA, or if forced.
- void SLayerRenderData::RenderToTexture()
- {
- QT3DS_ASSERT(m_LayerPrepResult->m_Flags.ShouldRenderToTexture());
- SLayerRenderPreparationResult &thePrepResult(*m_LayerPrepResult);
- NVRenderContext &theRenderContext(m_Renderer.GetContext());
- QSize theLayerTextureDimensions = thePrepResult.GetTextureDimensions();
- QSize theLayerOriginalTextureDimensions = theLayerTextureDimensions;
- NVRenderTextureFormats::Enum DepthTextureFormat = NVRenderTextureFormats::Depth24Stencil8;
- NVRenderTextureFormats::Enum ColorTextureFormat = NVRenderTextureFormats::RGBA8;
- if (thePrepResult.m_LastEffect
- && theRenderContext.GetRenderContextType() != NVRenderContextValues::GLES2) {
- if (m_Layer.m_Background != LayerBackground::Transparent)
- ColorTextureFormat = NVRenderTextureFormats::R11G11B10;
- else
- ColorTextureFormat = NVRenderTextureFormats::RGBA16F;
- }
- NVRenderTextureFormats::Enum ColorSSAOTextureFormat = NVRenderTextureFormats::RGBA8;
-
- bool needsRender = false;
- QT3DSU32 sampleCount = 1;
- // check multsample mode and MSAA texture support
- if (m_Layer.m_MultisampleAAMode != AAModeValues::NoAA
- && theRenderContext.AreMultisampleTexturesSupported())
- sampleCount = (QT3DSU32)m_Layer.m_MultisampleAAMode;
-
- bool isMultisamplePass = false;
- if (theRenderContext.GetRenderContextType() != NVRenderContextValues::GLES2)
- isMultisamplePass =
- (sampleCount > 1) || (m_Layer.m_MultisampleAAMode == AAModeValues::SSAA);
-
- qt3ds::render::NVRenderTextureTargetType::Enum thFboAttachTarget =
- qt3ds::render::NVRenderTextureTargetType::Texture2D;
-
- // If the user has disabled all layer caching this has the side effect of disabling the
- // progressive AA algorithm.
- if (thePrepResult.m_Flags.WasLayerDataDirty()
- || thePrepResult.m_Flags.WasDirty()
- || m_Renderer.IsLayerCachingEnabled() == false
- || thePrepResult.m_Flags.ShouldRenderToTexture()) {
- m_ProgressiveAAPassIndex = 0;
- m_NonDirtyTemporalAAPassIndex = 0;
- needsRender = true;
- }
-
- CResourceTexture2D *renderColorTexture = &m_LayerTexture;
- CResourceTexture2D *renderPrepassDepthTexture = &m_LayerPrepassDepthTexture;
- CResourceTexture2D *renderWidgetTexture = &m_LayerWidgetTexture;
- NVRenderContextScopedProperty<bool> __multisampleEnabled(
- theRenderContext, &NVRenderContext::IsMultisampleEnabled,
- &NVRenderContext::SetMultisampleEnabled);
- theRenderContext.SetMultisampleEnabled(false);
- if (isMultisamplePass) {
- renderColorTexture = &m_LayerMultisampleTexture;
- renderPrepassDepthTexture = &m_LayerMultisamplePrepassDepthTexture;
- renderWidgetTexture = &m_LayerMultisampleWidgetTexture;
- // for SSAA we don't use MS textures
- if (m_Layer.m_MultisampleAAMode != AAModeValues::SSAA)
- thFboAttachTarget = qt3ds::render::NVRenderTextureTargetType::Texture2D_MS;
- }
- QT3DSU32 maxTemporalPassIndex = m_Layer.m_TemporalAAEnabled ? 2 : 0;
-
- // If all the dimensions match then we do not have to re-render the layer.
- if (m_LayerTexture.TextureMatches(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(), ColorTextureFormat)
- && (!thePrepResult.m_Flags.RequiresDepthTexture()
- || m_LayerDepthTexture.TextureMatches(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(),
- DepthTextureFormat))
- && m_ProgressiveAAPassIndex >= thePrepResult.m_MaxAAPassIndex
- && m_NonDirtyTemporalAAPassIndex >= maxTemporalPassIndex && needsRender == false) {
- return;
- }
-
- // adjust render size for SSAA
- if (m_Layer.m_MultisampleAAMode == AAModeValues::SSAA) {
- QT3DSU32 ow, oh;
- CRendererUtil::GetSSAARenderSize(theLayerOriginalTextureDimensions.width(),
- theLayerOriginalTextureDimensions.height(),
- ow, oh);
- theLayerTextureDimensions = QSize(ow, oh);
- }
-
- // If our pass index == thePreResult.m_MaxAAPassIndex then
- // we shouldn't get into here.
-
- IResourceManager &theResourceManager = m_Renderer.GetQt3DSContext().GetResourceManager();
- bool hadLayerTexture = true;
-
- if (renderColorTexture->EnsureTexture(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(),
- ColorTextureFormat, sampleCount)) {
- m_ProgressiveAAPassIndex = 0;
- m_NonDirtyTemporalAAPassIndex = 0;
- hadLayerTexture = false;
- }
-
- if (thePrepResult.m_Flags.RequiresDepthTexture()) {
- // The depth texture doesn't need to be multisample, the prepass depth does.
- if (m_LayerDepthTexture.EnsureTexture(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(),
- DepthTextureFormat)) {
- // Depth textures are generally not bilinear filtered.
- m_LayerDepthTexture->SetMinFilter(NVRenderTextureMinifyingOp::Nearest);
- m_LayerDepthTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Nearest);
- m_ProgressiveAAPassIndex = 0;
- m_NonDirtyTemporalAAPassIndex = 0;
- }
- }
-
- if (thePrepResult.m_Flags.RequiresSsaoPass()) {
- if (m_LayerSsaoTexture.EnsureTexture(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(),
- ColorSSAOTextureFormat)) {
- m_LayerSsaoTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- m_LayerSsaoTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- m_ProgressiveAAPassIndex = 0;
- m_NonDirtyTemporalAAPassIndex = 0;
- }
- }
-
- QT3DS_ASSERT(!thePrepResult.m_Flags.RequiresDepthTexture() || m_LayerDepthTexture);
- QT3DS_ASSERT(!thePrepResult.m_Flags.RequiresSsaoPass() || m_LayerSsaoTexture);
-
- CResourceTexture2D theLastLayerTexture(theResourceManager);
- SLayerProgAABlendShader *theBlendShader = NULL;
- QT3DSU32 aaFactorIndex = 0;
- bool isProgressiveAABlendPass =
- m_ProgressiveAAPassIndex && m_ProgressiveAAPassIndex < thePrepResult.m_MaxAAPassIndex;
- bool isTemporalAABlendPass = m_Layer.m_TemporalAAEnabled && m_ProgressiveAAPassIndex == 0;
-
- if (isProgressiveAABlendPass || isTemporalAABlendPass) {
- theBlendShader = m_Renderer.GetLayerProgAABlendShader();
- if (theBlendShader) {
- m_LayerTexture.EnsureTexture(theLayerOriginalTextureDimensions.width(),
- theLayerOriginalTextureDimensions.height(),
- ColorTextureFormat);
- QT3DSVec2 theVertexOffsets;
- if (isProgressiveAABlendPass) {
- theLastLayerTexture.StealTexture(m_LayerTexture);
- aaFactorIndex = (m_ProgressiveAAPassIndex - 1);
- theVertexOffsets = s_VertexOffsets[aaFactorIndex];
- } else {
- if (m_TemporalAATexture.GetTexture())
- theLastLayerTexture.StealTexture(m_TemporalAATexture);
- else {
- if (hadLayerTexture) {
- theLastLayerTexture.StealTexture(m_LayerTexture);
- }
- }
- theVertexOffsets = s_TemporalVertexOffsets[m_TemporalAAPassIndex];
- ++m_TemporalAAPassIndex;
- ++m_NonDirtyTemporalAAPassIndex;
- m_TemporalAAPassIndex = m_TemporalAAPassIndex % MAX_TEMPORAL_AA_LEVELS;
- }
- if (theLastLayerTexture.GetTexture()) {
- theVertexOffsets.x =
- theVertexOffsets.x / (theLayerOriginalTextureDimensions.width() / 2.0f);
- theVertexOffsets.y =
- theVertexOffsets.y / (theLayerOriginalTextureDimensions.height() / 2.0f);
- // Run through all models and update MVP.
- // run through all texts and update MVP.
- // run through all path and update MVP.
-
- // TODO - optimize this exact matrix operation.
- for (QT3DSU32 idx = 0, end = m_ModelContexts.size(); idx < end; ++idx) {
- QT3DSMat44 &originalProjection(m_ModelContexts[idx]->m_ModelViewProjection);
- OffsetProjectionMatrix(originalProjection, theVertexOffsets);
- }
- for (QT3DSU32 idx = 0, end = m_OpaqueObjects.size(); idx < end; ++idx) {
- if (m_OpaqueObjects[idx]->m_RenderableFlags.IsPath()) {
- SPathRenderable &theRenderable =
- static_cast<SPathRenderable &>(*m_OpaqueObjects[idx]);
- OffsetProjectionMatrix(theRenderable.m_ModelViewProjection,
- theVertexOffsets);
- }
- }
- for (QT3DSU32 idx = 0, end = m_TransparentObjects.size(); idx < end; ++idx) {
- if (m_TransparentObjects[idx]->m_RenderableFlags.IsText()) {
- STextRenderable &theRenderable =
- static_cast<STextRenderable &>(*m_TransparentObjects[idx]);
- OffsetProjectionMatrix(theRenderable.m_ModelViewProjection,
- theVertexOffsets);
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- } else if (m_TransparentObjects[idx]->m_RenderableFlags
- .isDistanceField()) {
- SDistanceFieldRenderable &theRenderable
- = static_cast<SDistanceFieldRenderable &>(
- *m_TransparentObjects[idx]);
- OffsetProjectionMatrix(theRenderable.m_mvp,
- theVertexOffsets);
-#endif
- } else if (m_TransparentObjects[idx]->m_RenderableFlags.IsPath()) {
- SPathRenderable &theRenderable =
- static_cast<SPathRenderable &>(*m_TransparentObjects[idx]);
- OffsetProjectionMatrix(theRenderable.m_ModelViewProjection,
- theVertexOffsets);
- }
- }
- }
- }
- }
- if (theLastLayerTexture.GetTexture() == NULL) {
- isProgressiveAABlendPass = false;
- isTemporalAABlendPass = false;
- }
- // Sometimes we will have stolen the render texture.
- renderColorTexture->EnsureTexture(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(), ColorTextureFormat,
- sampleCount);
-
- if (!isTemporalAABlendPass)
- m_TemporalAATexture.ReleaseTexture();
-
- // Allocating a frame buffer can cause it to be bound, so we need to save state before this
- // happens.
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __framebuf(
- theRenderContext, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- // Match the bit depth of the current render target to avoid popping when we switch from aa
- // to non aa layers
- // We have to all this here in because once we change the FB by allocating an FB we are
- // screwed.
- NVRenderTextureFormats::Enum theDepthFormat(GetDepthBufferFormat());
- NVRenderFrameBufferAttachments::Enum theDepthAttachmentFormat(
- GetFramebufferDepthAttachmentFormat(theDepthFormat));
-
- // Definitely disable the scissor rect if it is running right now.
- NVRenderContextScopedProperty<bool> __scissorEnabled(
- theRenderContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled, false);
- CResourceFrameBuffer theFB(theResourceManager);
- // Allocates the frame buffer which has the side effect of setting the current render target
- // to that frame buffer.
- theFB.EnsureFrameBuffer();
-
- bool hasDepthObjects = m_OpaqueObjects.size() > 0;
- bool requiresDepthStencilBuffer =
- hasDepthObjects || thePrepResult.m_Flags.RequiresStencilBuffer();
- NVRenderRect theNewViewport(0, 0, theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height());
- {
- theRenderContext.SetRenderTarget(theFB);
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theRenderContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport,
- theNewViewport);
- QT3DSVec4 clearColor(0.0f);
- if (m_Layer.m_Background == LayerBackground::Color)
- clearColor = m_Layer.m_ClearColor;
-
- NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- theRenderContext, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
- clearColor);
- if (requiresDepthStencilBuffer) {
- if (renderPrepassDepthTexture->EnsureTexture(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(),
- theDepthFormat, sampleCount)) {
- (*renderPrepassDepthTexture)->SetMinFilter(NVRenderTextureMinifyingOp::Nearest);
- (*renderPrepassDepthTexture)
- ->SetMagFilter(NVRenderTextureMagnifyingOp::Nearest);
- }
- }
-
- if (thePrepResult.m_Flags.RequiresDepthTexture() && m_ProgressiveAAPassIndex == 0) {
- // Setup FBO with single depth buffer target.
- // Note this does not use multisample.
- NVRenderFrameBufferAttachments::Enum theAttachment =
- GetFramebufferDepthAttachmentFormat(DepthTextureFormat);
- theFB->Attach(theAttachment, *m_LayerDepthTexture);
-
- // In this case transparent objects also may write their depth.
- RenderDepthPass(true);
- theFB->Attach(theAttachment, NVRenderTextureOrRenderBuffer());
- }
-
- if (thePrepResult.m_Flags.RequiresSsaoPass() && m_ProgressiveAAPassIndex == 0
- && m_Camera != nullptr) {
- StartProfiling("AO pass", false);
- // Setup FBO with single color buffer target
- theFB->Attach(NVRenderFrameBufferAttachments::Color0, *m_LayerSsaoTexture);
- theRenderContext.Clear(qt3ds::render::NVRenderClearValues::Color);
- RenderAoPass();
- theFB->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer());
- EndProfiling("AO pass");
- }
-
- if (thePrepResult.m_Flags.RequiresShadowMapPass() && m_ProgressiveAAPassIndex == 0) {
- // shadow map path
- RenderShadowMapPass(&theFB);
- }
-
- if (sampleCount > 1) {
- theRenderContext.SetMultisampleEnabled(true);
- }
-
- qt3ds::render::NVRenderClearFlags clearFlags = qt3ds::render::NVRenderClearValues::Color;
-
- // render depth prepass
- if ((*renderPrepassDepthTexture)) {
- theFB->Attach(theDepthAttachmentFormat, **renderPrepassDepthTexture,
- thFboAttachTarget);
-
- if (m_Layer.m_Flags.IsLayerEnableDepthPrepass()) {
- StartProfiling("Depth pass", false);
- RenderDepthPass(false);
- EndProfiling("Depth pass");
- } else {
- clearFlags |= (qt3ds::render::NVRenderClearValues::Depth);
- clearFlags |= (qt3ds::render::NVRenderClearValues::Stencil);
- // enable depth write for the clear below
- theRenderContext.SetDepthWriteEnabled(true);
- }
- }
-
- theFB->Attach(NVRenderFrameBufferAttachments::Color0, **renderColorTexture,
- thFboAttachTarget);
- if (m_Layer.m_Background != LayerBackground::Unspecified)
- theRenderContext.Clear(clearFlags);
-
- // We don't clear the depth buffer because the layer render code we are about to call
- // will do this.
- StartProfiling("Render pass", false);
- Render(&theFB);
- // Debug measure to view the depth map to ensure we're rendering it correctly.
- //if (m_Layer.m_TemporalAAEnabled) {
- // RenderFakeDepthMapPass(m_ShadowMapManager->GetShadowMapEntry(0)->m_DepthMap,
- // m_ShadowMapManager->GetShadowMapEntry(0)->m_DepthCube);
- //}
- EndProfiling("Render pass");
-
- // Now before going further, we downsample and resolve the multisample information.
- // This allows all algorithms running after
- // this point to run unchanged.
- if (isMultisamplePass) {
- if (m_Layer.m_MultisampleAAMode != AAModeValues::SSAA) {
- // Resolve the FBO to the layer texture
- CRendererUtil::ResolveMutisampleFBOColorOnly(
- theResourceManager, m_LayerTexture, theRenderContext,
- theLayerTextureDimensions.width(), theLayerTextureDimensions.height(),
- ColorTextureFormat, *theFB);
-
- theRenderContext.SetMultisampleEnabled(false);
- } else {
- // Resolve the FBO to the layer texture
- CRendererUtil::ResolveSSAAFBOColorOnly(
- theResourceManager, m_LayerTexture,
- theLayerOriginalTextureDimensions.width(),
- theLayerOriginalTextureDimensions.height(), theRenderContext,
- theLayerTextureDimensions.width(), theLayerTextureDimensions.height(),
- ColorTextureFormat, *theFB);
- }
- }
-
- // CN - when I tried to get anti-aliased widgets I lost all transparency on the widget
- // layer which made it overwrite the object you were
- // manipulating. When I tried to use parallel nsight on it the entire studio
- // application crashed on startup.
- if (NeedsWidgetTexture()) {
- m_LayerWidgetTexture.EnsureTexture(theLayerTextureDimensions.width(),
- theLayerTextureDimensions.height(),
- NVRenderTextureFormats::RGBA8);
- theRenderContext.SetRenderTarget(theFB);
- theFB->Attach(NVRenderFrameBufferAttachments::Color0, *m_LayerWidgetTexture);
- theFB->Attach(GetFramebufferDepthAttachmentFormat(DepthTextureFormat),
- *m_LayerDepthTexture);
- theRenderContext.SetClearColor(QT3DSVec4(0.0f));
- theRenderContext.Clear(qt3ds::render::NVRenderClearValues::Color);
- // We should already have the viewport and everything setup for this.
- RenderRenderWidgets();
- }
-
- if (theLastLayerTexture.GetTexture() != NULL
- && (isProgressiveAABlendPass || isTemporalAABlendPass)) {
- theRenderContext.SetViewport(
- NVRenderRect(0, 0, theLayerOriginalTextureDimensions.width(),
- theLayerOriginalTextureDimensions.height()));
- CResourceTexture2D targetTexture(
- theResourceManager, theLayerOriginalTextureDimensions.width(),
- theLayerOriginalTextureDimensions.height(), ColorTextureFormat);
- theFB->Attach(theDepthAttachmentFormat,
- NVRenderTextureOrRenderBuffer());
- theFB->Attach(NVRenderFrameBufferAttachments::Color0, *targetTexture);
- QT3DSVec2 theBlendFactors;
- if (isProgressiveAABlendPass)
- theBlendFactors = s_BlendFactors[aaFactorIndex];
- else
- theBlendFactors = QT3DSVec2(.5f, .5f);
-
- theRenderContext.SetDepthTestEnabled(false);
- theRenderContext.SetBlendingEnabled(false);
- theRenderContext.SetCullingEnabled(false);
- theRenderContext.SetActiveShader(theBlendShader->m_Shader);
- theBlendShader->m_AccumSampler.Set(theLastLayerTexture);
- theBlendShader->m_LastFrame.Set(m_LayerTexture);
- theBlendShader->m_BlendFactors.Set(theBlendFactors);
- m_Renderer.RenderQuad();
- theFB->Attach(NVRenderFrameBufferAttachments::Color0,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- if (isTemporalAABlendPass)
- m_TemporalAATexture.StealTexture(m_LayerTexture);
- m_LayerTexture.StealTexture(targetTexture);
- }
-
- m_LayerTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- m_LayerTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
-
- // Don't remember why needs widget texture is false here.
- // Should have commented why progAA plus widgets is a fail.
- if (m_ProgressiveAAPassIndex < thePrepResult.m_MaxAAPassIndex
- && NeedsWidgetTexture() == false)
- ++m_ProgressiveAAPassIndex;
-
-// now we render all post effects
-#ifdef QT3DS_CACHED_POST_EFFECT
- ApplyLayerPostEffects();
-#endif
-
- if (m_LayerPrepassDepthTexture) {
- // Detach any depth buffers.
- theFB->Attach(theDepthAttachmentFormat, qt3ds::render::NVRenderTextureOrRenderBuffer(),
- thFboAttachTarget);
- }
-
- theFB->Attach(NVRenderFrameBufferAttachments::Color0,
- qt3ds::render::NVRenderTextureOrRenderBuffer(), thFboAttachTarget);
- // Let natural scoping rules destroy the other stuff.
- }
- }
-
- void SLayerRenderData::ApplyLayerPostEffects()
- {
- if (m_Layer.m_FirstEffect == NULL) {
- if (m_LayerCachedTexture) {
- IResourceManager &theResourceManager(m_Renderer.GetQt3DSContext().GetResourceManager());
- theResourceManager.Release(*m_LayerCachedTexture);
- m_LayerCachedTexture = NULL;
- }
- return;
- }
-
- IEffectSystem &theEffectSystem(m_Renderer.GetQt3DSContext().GetEffectSystem());
- IResourceManager &theResourceManager(m_Renderer.GetQt3DSContext().GetResourceManager());
- // we use the non MSAA buffer for the effect
- NVRenderTexture2D *theLayerColorTexture = m_LayerTexture;
- NVRenderTexture2D *theLayerDepthTexture = m_LayerDepthTexture;
-
- NVRenderTexture2D *theCurrentTexture = theLayerColorTexture;
- for (SEffect *theEffect = m_Layer.m_FirstEffect; theEffect;
- theEffect = theEffect->m_NextEffect) {
- if (theEffect->m_Flags.IsActive() && m_Camera) {
- StartProfiling(theEffect->m_ClassName, false);
-
- NVRenderTexture2D *theRenderedEffect = theEffectSystem.RenderEffect(
- SEffectRenderArgument(*theEffect, *theCurrentTexture,
- QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar),
- theLayerDepthTexture, m_LayerPrepassDepthTexture));
-
- EndProfiling(theEffect->m_ClassName);
-
- // If the texture came from rendering a chain of effects, then we don't need it
- // after this.
- if (theCurrentTexture != theLayerColorTexture)
- theResourceManager.Release(*theCurrentTexture);
-
- theCurrentTexture = theRenderedEffect;
-
- if (!theRenderedEffect) {
- QString errorMsg = QObject::tr("Failed to compile \"%1\" effect.\nConsider"
- " removing it from the presentation.")
- .arg(theEffect->m_ClassName.c_str());
- QT3DS_ALWAYS_ASSERT_MESSAGE(errorMsg.toUtf8());
- break;
- }
- }
- }
-
- if (m_LayerCachedTexture && m_LayerCachedTexture != m_LayerTexture) {
- theResourceManager.Release(*m_LayerCachedTexture);
- m_LayerCachedTexture = NULL;
- }
-
- if (theCurrentTexture != m_LayerTexture)
- m_LayerCachedTexture = theCurrentTexture;
- }
-
- inline bool AnyCompletelyNonTransparentObjects(TRenderableObjectList &inObjects)
- {
- for (QT3DSU32 idx = 0, end = inObjects.size(); idx < end; ++idx) {
- if (inObjects[idx]->m_RenderableFlags.IsCompletelyTransparent() == false)
- return true;
- }
- return false;
- }
-
- void SLayerRenderData::RunnableRenderToViewport(qt3ds::render::NVRenderFrameBuffer *theFB)
- {
- // If we have an effect, an opaque object, or any transparent objects that aren't completely
- // transparent
- // or an offscreen renderer or a layer widget texture
- // Then we can't possible affect the resulting render target.
- bool needsToRender = m_Layer.m_FirstEffect != NULL || m_OpaqueObjects.empty() == false
- || AnyCompletelyNonTransparentObjects(m_TransparentObjects) || GetOffscreenRenderer()
- || m_LayerWidgetTexture || m_BoundingRectColor.hasValue()
- || m_Layer.m_Background == LayerBackground::Color;
-
- if (needsToRender == false)
- return;
-
- NVRenderContext &theContext(m_Renderer.GetContext());
- theContext.resetStates();
-
- NVRenderContextScopedProperty<NVRenderFrameBuffer *> __fbo(
- theContext, &NVRenderContext::GetRenderTarget, &NVRenderContext::SetRenderTarget);
- qt3ds::render::NVRenderRect theCurrentViewport = theContext.GetViewport();
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport);
- NVRenderContextScopedProperty<bool> theScissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled);
- NVRenderContextScopedProperty<qt3ds::render::NVRenderRect> theScissorRect(
- theContext, &NVRenderContext::GetScissorRect, &NVRenderContext::SetScissorRect);
- SLayerRenderPreparationResult &thePrepResult(*m_LayerPrepResult);
- NVRenderRectF theScreenRect(thePrepResult.GetLayerToPresentationViewport());
-
- bool blendingEnabled = m_Layer.m_Background != LayerBackground::Unspecified;
- if (!thePrepResult.m_Flags.ShouldRenderToTexture()) {
- theContext.SetViewport(
- m_LayerPrepResult->GetLayerToPresentationViewport().ToIntegerRect());
- theContext.SetScissorTestEnabled(true);
- theContext.SetScissorRect(
- m_LayerPrepResult->GetLayerToPresentationScissorRect().ToIntegerRect());
- if (m_Layer.m_Background == LayerBackground::Color) {
- NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
- theContext, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
- m_Layer.m_ClearColor);
- theContext.Clear(NVRenderClearValues::Color);
- }
- RenderToViewport();
- } else {
-// First, render the layer along with whatever progressive AA is appropriate.
-// The render graph should have taken care of the render to texture step.
-#ifdef QT3DS_CACHED_POST_EFFECT
- NVRenderTexture2D *theLayerColorTexture =
- (m_LayerCachedTexture) ? m_LayerCachedTexture : m_LayerTexture;
-#else
- // Then render all but the last effect
- IEffectSystem &theEffectSystem(m_Renderer.GetQt3DSContext().GetEffectSystem());
- IResourceManager &theResourceManager(m_Renderer.GetQt3DSContext().GetResourceManager());
- // we use the non MSAA buffer for the effect
- NVRenderTexture2D *theLayerColorTexture = m_LayerTexture;
- NVRenderTexture2D *theLayerDepthTexture = m_LayerDepthTexture;
-
- NVRenderTexture2D *theCurrentTexture = theLayerColorTexture;
- for (SEffect *theEffect = m_Layer.m_FirstEffect;
- theEffect && theEffect != thePrepResult.m_LastEffect;
- theEffect = theEffect->m_NextEffect) {
- if (theEffect->m_Flags.IsActive() && m_Camera) {
- StartProfiling(theEffect->m_ClassName, false);
-
- NVRenderTexture2D *theRenderedEffect = theEffectSystem.RenderEffect(
- SEffectRenderArgument(*theEffect, *theCurrentTexture,
- QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar),
- theLayerDepthTexture, m_LayerPrepassDepthTexture));
-
- EndProfiling(theEffect->m_ClassName);
-
- // If the texture came from rendering a chain of effects, then we don't need it
- // after this.
- if (theCurrentTexture != theLayerColorTexture)
- theResourceManager.Release(*theCurrentTexture);
-
- theCurrentTexture = theRenderedEffect;
- }
- }
-#endif
- // Now the last effect or straight to the scene if we have no last effect
- // There are two cases we need to consider here. The first is when we shouldn't
- // transform
- // the result and thus we need to setup an MVP that just maps to the viewport width and
- // height.
- // The second is when we are expected to render to the scene using some global
- // transform.
- QT3DSMat44 theFinalMVP(QT3DSMat44::createIdentity());
- SCamera theTempCamera;
- NVRenderRect theLayerViewport(
- thePrepResult.GetLayerToPresentationViewport().ToIntegerRect());
- NVRenderRect theLayerClip(
- thePrepResult.GetLayerToPresentationScissorRect().ToIntegerRect());
-
- {
- QT3DSMat33 ignored;
- QT3DSMat44 theViewProjection;
- // We could cache these variables
- theTempCamera.m_Flags.SetOrthographic(true);
- theTempCamera.MarkDirty(NodeTransformDirtyFlag::TransformIsDirty);
- // Move the camera back far enough that we can see everything
- QT3DSF32 theCameraSetback(10);
- // Attempt to ensure the layer can never be clipped.
- theTempCamera.m_Position.z = -theCameraSetback;
- theTempCamera.m_ClipFar = 2.0f * theCameraSetback;
- // Render the layer texture to the entire viewport.
- SCameraGlobalCalculationResult theResult = theTempCamera.CalculateGlobalVariables(
- theLayerViewport,
- QT3DSVec2((QT3DSF32)theLayerViewport.m_Width, (QT3DSF32)theLayerViewport.m_Height));
- theTempCamera.CalculateViewProjectionMatrix(theViewProjection);
- SNode theTempNode;
- theFinalMVP = theViewProjection;
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc;
- qt3ds::render::NVRenderBlendEquationArgument blendEqu;
-
- switch (m_Layer.m_BlendType) {
- case LayerBlendTypes::Screen:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::SrcAlpha, NVRenderDstBlendFunc::One,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add);
- break;
- case LayerBlendTypes::Multiply:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::DstColor, NVRenderDstBlendFunc::Zero,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add);
- break;
- case LayerBlendTypes::Add:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add);
- break;
- case LayerBlendTypes::Subtract:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::ReverseSubtract,
- NVRenderBlendEquation::ReverseSubtract);
- break;
- case LayerBlendTypes::Overlay:
- // SW fallback doesn't use blend equation
- // note blend func is not used here anymore
- if (theContext.IsAdvancedBlendHwSupported() ||
- theContext.IsAdvancedBlendHwSupportedKHR())
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Overlay, NVRenderBlendEquation::Overlay);
- break;
- case LayerBlendTypes::ColorBurn:
- // SW fallback doesn't use blend equation
- // note blend func is not used here anymore
- if (theContext.IsAdvancedBlendHwSupported() ||
- theContext.IsAdvancedBlendHwSupportedKHR())
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::ColorBurn, NVRenderBlendEquation::ColorBurn);
- break;
- case LayerBlendTypes::ColorDodge:
- // SW fallback doesn't use blend equation
- // note blend func is not used here anymore
- if (theContext.IsAdvancedBlendHwSupported() ||
- theContext.IsAdvancedBlendHwSupportedKHR())
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::ColorDodge, NVRenderBlendEquation::ColorDodge);
- break;
- default:
- blendFunc = qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha);
- blendEqu = qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add);
- break;
- }
- theContext.SetBlendFunction(blendFunc);
- theContext.SetBlendEquation(blendEqu);
- theContext.SetBlendingEnabled(blendingEnabled);
- theContext.SetDepthTestEnabled(false);
- }
-
- {
- theContext.SetScissorTestEnabled(true);
- theContext.SetViewport(theLayerViewport);
- theContext.SetScissorRect(theLayerClip);
-
- // Remember the camera we used so we can get a valid pick ray
- m_SceneCamera = theTempCamera;
- theContext.SetDepthTestEnabled(false);
-#ifndef QT3DS_CACHED_POST_EFFECT
- if (thePrepResult.m_LastEffect && m_Camera) {
- StartProfiling(thePrepResult.m_LastEffect->m_ClassName, false);
- // inUseLayerMPV is true then we are rendering directly to the scene and thus we
- // should enable blending
- // for the final render pass. Else we should leave it.
- theEffectSystem.RenderEffect(
- SEffectRenderArgument(*thePrepResult.m_LastEffect, *theCurrentTexture,
- QT3DSVec2(m_Camera->m_ClipNear, m_Camera->m_ClipFar),
- theLayerDepthTexture, m_LayerPrepassDepthTexture),
- theFinalMVP, blendingEnabled);
- EndProfiling(thePrepResult.m_LastEffect->m_ClassName);
- // If the texture came from rendering a chain of effects, then we don't need it
- // after this.
- if (theCurrentTexture != theLayerColorTexture)
- theResourceManager.Release(*theCurrentTexture);
- } else
-#endif
- {
- theContext.SetCullingEnabled(false);
- theContext.SetBlendingEnabled(blendingEnabled);
- theContext.SetDepthTestEnabled(false);
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- NVScopedRefCounted<NVRenderTexture2D> screenTexture =
- m_Renderer.GetLayerBlendTexture();
- NVScopedRefCounted<NVRenderFrameBuffer> blendFB = m_Renderer.GetBlendFB();
-
- // Layer blending for advanced blending modes if SW fallback is needed
- // rendering to FBO and blending with separate shader
- if (screenTexture) {
- // Blending is enabled only if layer background has been chosen transparent
- // Layers with advanced blending modes
- if (blendingEnabled && (m_Layer.m_BlendType == LayerBlendTypes::Overlay ||
- m_Layer.m_BlendType == LayerBlendTypes::ColorBurn ||
- m_Layer.m_BlendType == LayerBlendTypes::ColorDodge)) {
- theContext.SetScissorTestEnabled(false);
- theContext.SetBlendingEnabled(false);
-
- // Get part matching to layer from screen texture and
- // use that for blending
- qt3ds::render::NVRenderTexture2D *blendBlitTexture;
- blendBlitTexture = theContext.CreateTexture2D();
- blendBlitTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0,
- theLayerViewport.m_Width,
- theLayerViewport.m_Height,
- NVRenderTextureFormats::RGBA8);
- qt3ds::render::NVRenderFrameBuffer *blitFB;
- blitFB = theContext.CreateFrameBuffer();
- blitFB->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer(*blendBlitTexture));
- blendFB->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer(*screenTexture));
- theContext.SetRenderTarget(blitFB);
- theContext.SetReadTarget(blendFB);
- theContext.SetReadBuffer(NVReadFaces::Color0);
- theContext.BlitFramebuffer(theLayerViewport.m_X, theLayerViewport.m_Y,
- theLayerViewport.m_Width +
- theLayerViewport.m_X,
- theLayerViewport.m_Height +
- theLayerViewport.m_Y,
- 0, 0,
- theLayerViewport.m_Width,
- theLayerViewport.m_Height,
- NVRenderClearValues::Color,
- NVRenderTextureMagnifyingOp::Nearest);
-
- qt3ds::render::NVRenderTexture2D *blendResultTexture;
- blendResultTexture = theContext.CreateTexture2D();
- blendResultTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0,
- theLayerViewport.m_Width,
- theLayerViewport.m_Height,
- NVRenderTextureFormats::RGBA8);
- qt3ds::render::NVRenderFrameBuffer *resultFB;
- resultFB = theContext.CreateFrameBuffer();
- resultFB->Attach(NVRenderFrameBufferAttachments::Color0,
- NVRenderTextureOrRenderBuffer(*blendResultTexture));
- theContext.SetRenderTarget(resultFB);
-
- AdvancedBlendModes::Enum advancedMode;
- switch (m_Layer.m_BlendType) {
- case LayerBlendTypes::Overlay:
- advancedMode = AdvancedBlendModes::Overlay;
- break;
- case LayerBlendTypes::ColorBurn:
- advancedMode = AdvancedBlendModes::ColorBurn;
- break;
- case LayerBlendTypes::ColorDodge:
- advancedMode = AdvancedBlendModes::ColorDodge;
- break;
- default:
- advancedMode = AdvancedBlendModes::None;
- break;
- }
-
- theContext.SetViewport(NVRenderRect(0, 0, theLayerViewport.m_Width,
- theLayerViewport.m_Height));
- BlendAdvancedEquationSwFallback(theLayerColorTexture, blendBlitTexture,
- advancedMode);
- blitFB->release();
- // save blending result to screen texture for use with other layers
- theContext.SetViewport(theLayerViewport);
- theContext.SetRenderTarget(blendFB);
- m_Renderer.RenderQuad(QT3DSVec2((QT3DSF32)theLayerViewport.m_Width,
- (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *blendResultTexture);
- // render the blended result
- theContext.SetRenderTarget(theFB);
- theContext.SetScissorTestEnabled(true);
- m_Renderer.RenderQuad(QT3DSVec2((QT3DSF32)theLayerViewport.m_Width,
- (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *blendResultTexture);
- resultFB->release();
- } else {
- // Layers with normal blending modes
- // save result for future use
- theContext.SetViewport(theLayerViewport);
- theContext.SetScissorTestEnabled(false);
- theContext.SetBlendingEnabled(true);
- theContext.SetRenderTarget(blendFB);
- m_Renderer.RenderQuad(QT3DSVec2((QT3DSF32)theLayerViewport.m_Width,
- (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *theLayerColorTexture);
- theContext.SetRenderTarget(theFB);
- theContext.SetScissorTestEnabled(true);
- theContext.SetViewport(theCurrentViewport);
- m_Renderer.RenderQuad(QT3DSVec2((QT3DSF32)theLayerViewport.m_Width,
- (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *theLayerColorTexture);
- }
- } else {
- // No advanced blending SW fallback needed
- m_Renderer.RenderQuad(QT3DSVec2((QT3DSF32)theLayerViewport.m_Width,
- (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *theLayerColorTexture);
- }
-#else
- m_Renderer.RenderQuad(QT3DSVec2((QT3DSF32)theLayerViewport.m_Width,
- (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *theLayerColorTexture);
-#endif
- }
- if (m_LayerWidgetTexture) {
- theContext.SetBlendingEnabled(false);
- m_Renderer.SetupWidgetLayer();
- SLayerRenderPreparationResult &thePrepResult(*m_LayerPrepResult);
- NVRenderRectF thePresRect(thePrepResult.GetPresentationViewport());
- NVRenderRectF theLayerRect(thePrepResult.GetLayerToPresentationViewport());
-
- // Ensure we remove any offsetting in the layer rect that was caused simply by
- // the
- // presentation rect offsetting but then use a new rect.
- NVRenderRectF theWidgetLayerRect(theLayerRect.m_X - thePresRect.m_X,
- theLayerRect.m_Y - thePresRect.m_Y,
- theLayerRect.m_Width, theLayerRect.m_Height);
- theContext.SetScissorTestEnabled(false);
- theContext.SetViewport(theWidgetLayerRect.ToIntegerRect());
- m_Renderer.RenderQuad(
- QT3DSVec2((QT3DSF32)theLayerViewport.m_Width, (QT3DSF32)theLayerViewport.m_Height),
- theFinalMVP, *m_LayerWidgetTexture);
- }
- }
- } // End offscreen render code.
-
- if (m_BoundingRectColor.hasValue()) {
- NVRenderContextScopedProperty<NVRenderRect> __viewport(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport);
- NVRenderContextScopedProperty<bool> theScissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled);
- NVRenderContextScopedProperty<qt3ds::render::NVRenderRect> theScissorRect(
- theContext, &NVRenderContext::GetScissorRect, &NVRenderContext::SetScissorRect);
- m_Renderer.SetupWidgetLayer();
- // Setup a simple viewport to render to the entire presentation viewport.
- theContext.SetViewport(
- NVRenderRect(0, 0, (QT3DSU32)thePrepResult.GetPresentationViewport().m_Width,
- (QT3DSU32)thePrepResult.GetPresentationViewport().m_Height));
-
- NVRenderRectF thePresRect(thePrepResult.GetPresentationViewport());
-
- // Remove any offsetting from the presentation rect since the widget layer is a
- // stand-alone fbo.
- NVRenderRectF theWidgetScreenRect(theScreenRect.m_X - thePresRect.m_X,
- theScreenRect.m_Y - thePresRect.m_Y,
- theScreenRect.m_Width, theScreenRect.m_Height);
- theContext.SetScissorTestEnabled(false);
- m_Renderer.DrawScreenRect(theWidgetScreenRect, *m_BoundingRectColor);
- }
- theContext.SetBlendFunction(qt3ds::render::NVRenderBlendFunctionArgument(
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::OneMinusSrcAlpha));
- theContext.SetBlendEquation(qt3ds::render::NVRenderBlendEquationArgument(
- NVRenderBlendEquation::Add, NVRenderBlendEquation::Add));
- }
-
-#define RENDER_FRAME_NEW(type) QT3DS_NEW(m_Renderer.GetPerFrameAllocator(), type)
-
- void SLayerRenderData::AddLayerRenderStep()
- {
- SStackPerfTimer __perfTimer(m_Renderer.GetQt3DSContext().GetPerfTimer(),
- "SLayerRenderData::AddLayerRenderStep");
- QT3DS_ASSERT(m_Camera);
- if (!m_Camera)
- return;
-
- IRenderList &theGraph(m_Renderer.GetQt3DSContext().GetRenderList());
-
- qt3ds::render::NVRenderRect theCurrentViewport = theGraph.GetViewport();
- if (!m_LayerPrepResult.hasValue())
- PrepareForRender(
- QSize(theCurrentViewport.m_Width, theCurrentViewport.m_Height));
- }
-
- void SLayerRenderData::PrepareForRender()
- {
- // When we render to the scene itself (as opposed to an offscreen buffer somewhere)
- // then we use the MVP of the layer somewhat.
- NVRenderRect theViewport = m_Renderer.GetQt3DSContext().GetRenderList().GetViewport();
- PrepareForRender(
- QSize((QT3DSU32)theViewport.m_Width, (QT3DSU32)theViewport.m_Height));
- }
-
- void SLayerRenderData::ResetForFrame()
- {
- SLayerRenderPreparationData::ResetForFrame();
- m_BoundingRectColor.setEmpty();
- }
-
- void SLayerRenderData::PrepareAndRender(const QT3DSMat44 &inViewProjection)
- {
- TRenderableObjectList theTransparentObjects(m_TransparentObjects);
- TRenderableObjectList theOpaqueObjects(m_OpaqueObjects);
- theTransparentObjects.clear();
- theOpaqueObjects.clear();
- m_ModelContexts.clear();
- SLayerRenderPreparationResultFlags theFlags;
- PrepareRenderablesForRender(inViewProjection, Empty(), 1.0, theFlags);
- RenderDepthPass(false);
- Render();
- }
-
- struct SLayerRenderToTextureRunnable : public IRenderTask
- {
- SLayerRenderData &m_Data;
- SLayerRenderToTextureRunnable(SLayerRenderData &d)
- : m_Data(d)
- {
- }
-
- void Run() override { m_Data.RenderToTexture(); }
- };
-
- static inline OffscreenRendererDepthValues::Enum
- GetOffscreenRendererDepthValue(NVRenderTextureFormats::Enum inBufferFormat)
- {
- switch (inBufferFormat) {
- case NVRenderTextureFormats::Depth32:
- return OffscreenRendererDepthValues::Depth32;
- case NVRenderTextureFormats::Depth24:
- return OffscreenRendererDepthValues::Depth24;
- case NVRenderTextureFormats::Depth24Stencil8:
- return OffscreenRendererDepthValues::Depth24;
- default:
- QT3DS_ASSERT(false); // fallthrough intentional
- case NVRenderTextureFormats::Depth16:
- return OffscreenRendererDepthValues::Depth16;
- }
- }
-
- SOffscreenRendererEnvironment SLayerRenderData::CreateOffscreenRenderEnvironment()
- {
- OffscreenRendererDepthValues::Enum theOffscreenDepth(
- GetOffscreenRendererDepthValue(GetDepthBufferFormat()));
- NVRenderRect theViewport = m_Renderer.GetQt3DSContext().GetRenderList().GetViewport();
- return SOffscreenRendererEnvironment(theViewport.m_Width, theViewport.m_Height,
- NVRenderTextureFormats::RGBA8, theOffscreenDepth,
- false, AAModeValues::NoAA);
- }
-
- IRenderTask &SLayerRenderData::CreateRenderToTextureRunnable()
- {
- return *RENDER_FRAME_NEW(SLayerRenderToTextureRunnable)(*this);
- }
-
- void SLayerRenderData::addRef() { atomicIncrement(&mRefCount); }
-
- void SLayerRenderData::release() { QT3DS_IMPLEMENT_REF_COUNT_RELEASE(m_Allocator); }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.h
deleted file mode 100644
index 4e237b0b..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDERER_IMPL_LAYER_RENDER_DATA_H
-#define QT3DS_RENDERER_IMPL_LAYER_RENDER_DATA_H
-#include "Qt3DSRender.h"
-#include "Qt3DSRendererImplLayerRenderPreparationData.h"
-#include "Qt3DSRenderResourceBufferObjects.h"
-
-namespace qt3ds {
-namespace render {
-
-struct AdvancedBlendModes
-{
- enum Enum {
- None = 0,
- Overlay,
- ColorBurn,
- ColorDodge
- };
-};
- struct QT3DS_AUTOTEST_EXPORT SLayerRenderData : public SLayerRenderPreparationData
- {
-
- // Layers can be rendered offscreen for many reasons; effects, progressive aa,
- // or just because a flag forces it. If they are rendered offscreen we can then
- // cache the result so we don't render the layer again if it isn't dirty.
- CResourceTexture2D m_LayerTexture;
- CResourceTexture2D m_TemporalAATexture;
- // Sometimes we need to render our depth buffer to a depth texture.
- CResourceTexture2D m_LayerDepthTexture;
- CResourceTexture2D m_LayerPrepassDepthTexture;
- CResourceTexture2D m_LayerWidgetTexture;
- CResourceTexture2D m_LayerSsaoTexture;
- // if we render multisampled we need resolve buffers
- CResourceTexture2D m_LayerMultisampleTexture;
- CResourceTexture2D m_LayerMultisamplePrepassDepthTexture;
- CResourceTexture2D m_LayerMultisampleWidgetTexture;
- // the texture contains the render result inclusive post effects
- NVRenderTexture2D *m_LayerCachedTexture;
-
- NVRenderTexture2D *m_AdvancedBlendDrawTexture;
- NVRenderTexture2D *m_AdvancedBlendBlendTexture;
- qt3ds::render::NVRenderFrameBuffer *m_AdvancedModeDrawFB;
- qt3ds::render::NVRenderFrameBuffer *m_AdvancedModeBlendFB;
-
- // True if this layer was rendered offscreen.
- // If this object has no value then this layer wasn't rendered at all.
- SOffscreenRendererEnvironment m_LastOffscreenRenderEnvironment;
-
- // GPU profiler per layer
- NVScopedRefCounted<IRenderProfiler> m_LayerProfilerGpu;
-
- SCamera m_SceneCamera;
- QT3DSVec2 m_SceneDimensions;
-
- // ProgressiveAA algorithm details.
- QT3DSU32 m_ProgressiveAAPassIndex;
- // Increments every frame regardless to provide appropriate jittering
- QT3DSU32 m_TemporalAAPassIndex;
- // Ensures we don't stop on an in-between frame; we will run two frames after the dirty flag
- // is clear.
- QT3DSU32 m_NonDirtyTemporalAAPassIndex;
- QT3DSF32 m_TextScale;
-
- volatile QT3DSI32 mRefCount;
- Option<QT3DSVec3> m_BoundingRectColor;
- NVRenderTextureFormats::Enum m_DepthBufferFormat;
-
- QSize m_previousDimensions;
-
- SLayerRenderData(SLayer &inLayer, Qt3DSRendererImpl &inRenderer);
-
- virtual ~SLayerRenderData();
-
- void PrepareForRender();
-
- // Internal Call
- void PrepareForRender(const QSize &inViewportDimensions) override;
-
- NVRenderTextureFormats::Enum GetDepthBufferFormat();
- NVRenderFrameBufferAttachments::Enum
- GetFramebufferDepthAttachmentFormat(NVRenderTextureFormats::Enum depthFormat);
-
- // Render this layer assuming viewport and RT are setup. Just renders exactly this item
- // no effects.
- void RenderDepthPass(bool inEnableTransparentDepthWrite = false);
- void RenderAoPass();
- void RenderFakeDepthMapPass(NVRenderTexture2D *theDepthTex,
- NVRenderTextureCube *theDepthCube);
- void RenderShadowMapPass(CResourceFrameBuffer *theFB);
- void RenderShadowCubeBlurPass(CResourceFrameBuffer *theFB, NVRenderTextureCube *target0,
- NVRenderTextureCube *target1, QT3DSF32 filterSz, QT3DSF32 clipFar);
- void RenderShadowMapBlurPass(CResourceFrameBuffer *theFB, NVRenderTexture2D *target0,
- NVRenderTexture2D *target1, QT3DSF32 filterSz, QT3DSF32 clipFar);
-
- void Render(CResourceFrameBuffer *theFB = NULL);
- void ResetForFrame() override;
-
- void CreateGpuProfiler();
- void StartProfiling(CRegisteredString &nameID, bool sync);
- void EndProfiling(CRegisteredString &nameID);
- void StartProfiling(const char *nameID, bool sync);
- void EndProfiling(const char *nameID);
- void AddVertexCount(QT3DSU32 count);
-
- void RenderToViewport();
- // Render this layer's data to a texture. Required if we have any effects,
- // prog AA, or if forced.
- void RenderToTexture();
-
- void ApplyLayerPostEffects();
-
- void RunnableRenderToViewport(qt3ds::render::NVRenderFrameBuffer *theFB);
-
- void AddLayerRenderStep();
-
- void RenderRenderWidgets();
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- void BlendAdvancedEquationSwFallback(NVRenderTexture2D *drawTexture,
- NVRenderTexture2D *m_LayerTexture,
- AdvancedBlendModes::Enum blendMode);
-#endif
- // test method to render this layer to a given view projection without running the entire
- // layer setup system. This assumes the client has setup the viewport, scissor, and render
- // target
- // the way they want them.
- void PrepareAndRender(const QT3DSMat44 &inViewProjection);
-
- SOffscreenRendererEnvironment CreateOffscreenRenderEnvironment() override;
- IRenderTask &CreateRenderToTextureRunnable() override;
-
- void addRef();
- void release();
-
- protected:
- // Used for both the normal passes and the depth pass.
- // When doing the depth pass, we disable blending completely because it does not really make
- // sense
- // to write blend equations into
- void RunRenderPass(TRenderRenderableFunction renderFn, bool inEnableBlending,
- bool inEnableDepthWrite, bool inEnableTransparentDepthWrite,
- QT3DSU32 indexLight, const SCamera &inCamera,
- CResourceFrameBuffer *theFB = NULL);
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- //Functions for advanced blending mode fallback
- void SetupDrawFB(bool depthEnabled);
- void BlendAdvancedToFB(DefaultMaterialBlendMode::Enum blendMode, bool depthEnabled,
- CResourceFrameBuffer *theFB);
-#endif
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.cpp b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.cpp
deleted file mode 100644
index 07ee5132..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRendererImplLayerRenderHelper.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSTextRenderer.h"
-
-using namespace qt3ds::render;
-
-namespace {
-// left/top
-QT3DSF32 GetMinValue(QT3DSF32 start, QT3DSF32 width, QT3DSF32 value, LayerUnitTypes::Enum units)
-{
- if (units == LayerUnitTypes::Pixels)
- return start + value;
-
- return start + (value * width / 100.0f);
-}
-
-// width/height
-QT3DSF32 GetValueLen(QT3DSF32 width, QT3DSF32 value, LayerUnitTypes::Enum units)
-{
- if (units == LayerUnitTypes::Pixels)
- return value;
-
- return width * value / 100.0f;
-}
-
-// right/bottom
-QT3DSF32 GetMaxValue(QT3DSF32 start, QT3DSF32 width, QT3DSF32 value, LayerUnitTypes::Enum units)
-{
- if (units == LayerUnitTypes::Pixels)
- return start + width - value;
-
- return start + width - (value * width / 100.0f);
-}
-
-QT3DSVec2 ToRectRelativeCoords(const QT3DSVec2 &inCoords, const NVRenderRectF &inRect)
-{
- return QT3DSVec2(inCoords.x - inRect.m_X, inCoords.y - inRect.m_Y);
-}
-}
-
-SLayerRenderHelper::SLayerRenderHelper()
- : m_Layer(NULL)
- , m_Camera(NULL)
- , m_Offscreen(false)
-{
-}
-
-SLayerRenderHelper::SLayerRenderHelper(const NVRenderRectF &inPresentationViewport,
- const NVRenderRectF &inPresentationScissor,
- const QT3DSVec2 &inPresentationDesignDimensions,
- SLayer &inLayer, bool inOffscreen,
- qt3ds::render::ScaleModes::Enum inScaleMode,
- qt3ds::QT3DSVec2 inScaleFactor)
- : m_PresentationViewport(inPresentationViewport)
- , m_PresentationScissor(inPresentationScissor)
- , m_PresentationDesignDimensions(inPresentationDesignDimensions)
- , m_Layer(&inLayer)
- , m_Offscreen(inOffscreen)
- , m_ScaleMode(inScaleMode)
- , m_ScaleFactor(inScaleFactor)
-{
- {
- QT3DSF32 left = m_Layer->m_Left;
- QT3DSF32 right = m_Layer->m_Right;
- QT3DSF32 width = m_Layer->m_Width;
-
- if (m_ScaleMode == qt3ds::render::ScaleModes::FitSelected) {
- if (m_Layer->m_LeftUnits == LayerUnitTypes::Pixels)
- left *= m_ScaleFactor.x;
-
- if (m_Layer->m_RightUnits == LayerUnitTypes::Pixels)
- right *= m_ScaleFactor.x;
-
- if (m_Layer->m_WidthUnits == LayerUnitTypes::Pixels)
- width *= m_ScaleFactor.x;
- }
-
- QT3DSF32 horzMin = GetMinValue(inPresentationViewport.m_X, inPresentationViewport.m_Width,
- left, m_Layer->m_LeftUnits);
- QT3DSF32 horzWidth = GetValueLen(inPresentationViewport.m_Width, width, m_Layer->m_WidthUnits);
- QT3DSF32 horzMax = GetMaxValue(inPresentationViewport.m_X, inPresentationViewport.m_Width,
- right, m_Layer->m_RightUnits);
-
- switch (inLayer.m_HorizontalFieldValues) {
- case HorizontalFieldValues::LeftWidth:
- m_Viewport.m_X = horzMin;
- m_Viewport.m_Width = horzWidth;
- break;
- case HorizontalFieldValues::LeftRight:
- m_Viewport.m_X = horzMin;
- m_Viewport.m_Width = horzMax - horzMin;
- break;
- case HorizontalFieldValues::WidthRight:
- m_Viewport.m_Width = horzWidth;
- m_Viewport.m_X = horzMax - horzWidth;
- break;
- }
- }
- {
- QT3DSF32 top = m_Layer->m_Top;
- QT3DSF32 bottom = m_Layer->m_Bottom;
- QT3DSF32 height = m_Layer->m_Height;
-
- if (m_ScaleMode == qt3ds::render::ScaleModes::FitSelected) {
-
- if (m_Layer->m_TopUnits == LayerUnitTypes::Pixels)
- top *= m_ScaleFactor.y;
-
- if (m_Layer->m_BottomUnits == LayerUnitTypes::Pixels)
- bottom *= m_ScaleFactor.y;
-
- if (m_Layer->m_HeightUnits == LayerUnitTypes::Pixels)
- height *= m_ScaleFactor.y;
- }
-
- QT3DSF32 vertMin = GetMinValue(inPresentationViewport.m_Y, inPresentationViewport.m_Height,
- bottom, m_Layer->m_BottomUnits);
- QT3DSF32 vertWidth =
- GetValueLen(inPresentationViewport.m_Height, height, m_Layer->m_HeightUnits);
- QT3DSF32 vertMax = GetMaxValue(inPresentationViewport.m_Y, inPresentationViewport.m_Height,
- top, m_Layer->m_TopUnits);
-
- switch (inLayer.m_VerticalFieldValues) {
- case VerticalFieldValues::HeightBottom:
- m_Viewport.m_Y = vertMin;
- m_Viewport.m_Height = vertWidth;
- break;
- case VerticalFieldValues::TopBottom:
- m_Viewport.m_Y = vertMin;
- m_Viewport.m_Height = vertMax - vertMin;
- break;
- case VerticalFieldValues::TopHeight:
- m_Viewport.m_Height = vertWidth;
- m_Viewport.m_Y = vertMax - vertWidth;
- break;
- }
- }
-
- m_Viewport.m_Width = NVMax(1.0f, m_Viewport.m_Width);
- m_Viewport.m_Height = NVMax(1.0f, m_Viewport.m_Height);
- // Now force the viewport to be a multiple of four in width and height. This is because
- // when rendering to a texture we have to respect this and not forcing it causes scaling issues
- // that are noticeable especially in situations where customers are using text and such.
- QT3DSF32 originalWidth = m_Viewport.m_Width;
- QT3DSF32 originalHeight = m_Viewport.m_Height;
-
- m_Viewport.m_Width = (QT3DSF32)ITextRenderer::NextMultipleOf4((QT3DSU32)m_Viewport.m_Width);
- m_Viewport.m_Height = (QT3DSF32)ITextRenderer::NextMultipleOf4((QT3DSU32)m_Viewport.m_Height);
-
- // Now fudge the offsets to account for this slight difference
- m_Viewport.m_X += (originalWidth - m_Viewport.m_Width) / 2.0f;
- m_Viewport.m_Y += (originalHeight - m_Viewport.m_Height) / 2.0f;
-
- m_Scissor = m_Viewport;
- m_Scissor.EnsureInBounds(inPresentationScissor);
- QT3DS_ASSERT(m_Scissor.m_Width >= 0.0f);
- QT3DS_ASSERT(m_Scissor.m_Height >= 0.0f);
-}
-
-// This is the viewport the camera will use to setup the projection.
-NVRenderRectF SLayerRenderHelper::GetLayerRenderViewport() const
-{
- if (m_Offscreen)
- return NVRenderRectF(0, 0, m_Viewport.m_Width, (QT3DSF32)m_Viewport.m_Height);
- else
- return m_Viewport;
-}
-
-QSize SLayerRenderHelper::GetTextureDimensions() const
-{
- QT3DSU32 width = (QT3DSU32)m_Viewport.m_Width;
- QT3DSU32 height = (QT3DSU32)m_Viewport.m_Height;
- return QSize(ITextRenderer::NextMultipleOf4(width),
- ITextRenderer::NextMultipleOf4(height));
-}
-
-SCameraGlobalCalculationResult SLayerRenderHelper::SetupCameraForRender(SCamera &inCamera)
-{
- m_Camera = &inCamera;
- NVRenderRectF rect = GetLayerRenderViewport();
- if (m_ScaleMode == ScaleModes::FitSelected) {
- rect.m_Width =
- (QT3DSF32)(ITextRenderer::NextMultipleOf4((QT3DSU32)(rect.m_Width / m_ScaleFactor.x)));
- rect.m_Height =
- (QT3DSF32)(ITextRenderer::NextMultipleOf4((QT3DSU32)(rect.m_Height / m_ScaleFactor.y)));
- }
- return m_Camera->CalculateGlobalVariables(rect, m_PresentationDesignDimensions);
-}
-
-Option<QT3DSVec2> SLayerRenderHelper::GetLayerMouseCoords(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inWindowDimensions,
- bool inForceIntersect) const
-{
- // First invert the y so we are dealing with numbers in a normal coordinate space.
- // Second, move into our layer's coordinate space
- QT3DSVec2 correctCoords(inMouseCoords.x, inWindowDimensions.y - inMouseCoords.y);
- QT3DSVec2 theLocalMouse = m_Viewport.ToRectRelative(correctCoords);
-
- QT3DSF32 theRenderRectWidth = m_Viewport.m_Width;
- QT3DSF32 theRenderRectHeight = m_Viewport.m_Height;
- // Crop the mouse to the rect. Apply no further translations.
- if (inForceIntersect == false
- && (theLocalMouse.x < 0.0f || theLocalMouse.x >= theRenderRectWidth
- || theLocalMouse.y < 0.0f || theLocalMouse.y >= theRenderRectHeight)) {
- return Empty();
- }
- return theLocalMouse;
-}
-
-Option<SRay> SLayerRenderHelper::GetPickRay(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inWindowDimensions,
- bool inForceIntersect,
- bool sceneCameraView) const
-{
- if (m_Camera == NULL)
- return Empty();
- Option<QT3DSVec2> theCoords(
- GetLayerMouseCoords(inMouseCoords, inWindowDimensions, inForceIntersect));
- if (theCoords.hasValue()) {
- // The cameras projection is different if we are onscreen vs. offscreen.
- // When offscreen, we need to move the mouse coordinates into a local space
- // to the layer.
- return m_Camera->Unproject(*theCoords, m_Viewport, m_PresentationDesignDimensions,
- sceneCameraView);
- }
- return Empty();
-}
-
-bool SLayerRenderHelper::IsLayerVisible() const
-{
- return m_Scissor.m_Height >= 2.0f && m_Scissor.m_Width >= 2.0f;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.h
deleted file mode 100644
index 616ebe1a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderHelper.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSVec2.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderContextCore.h"
-
-namespace qt3ds {
-namespace render {
-
- /** An independent, testable entity to encapsulate taking at least:
- * layer, current viewport rect, current scissor rect, presentation design dimensions
- * and producing a set of rectangles:
- * layer viewport rect (inside viewport rect and calculated using outer viewport rect info)
- * layer scissor rect (inside current scissor rect)
- * layer camera rect (may be the viewport rect)
- *
- * In the case where we have to render offscreen for this layer then we need to handle produce
- * a set of texture dimensions and the layer camera rect ends up being same size but with no
- *offsets.
- *
- * This object should handle part of any translation from screenspace to global space.
- * I am using language level access control on this object because it needs specific
- * interface design that will enable future modifications.
- */
- struct SLayerRenderHelper
- {
- private:
- NVRenderRectF m_PresentationViewport;
- NVRenderRectF m_PresentationScissor;
- QT3DSVec2 m_PresentationDesignDimensions;
- SLayer *m_Layer;
- SCamera *m_Camera;
- bool m_Offscreen;
-
- NVRenderRectF m_Viewport;
- NVRenderRectF m_Scissor;
-
- ScaleModes::Enum m_ScaleMode;
- QT3DSVec2 m_ScaleFactor;
-
- public:
- SLayerRenderHelper();
-
- SLayerRenderHelper(const NVRenderRectF &inPresentationViewport,
- const NVRenderRectF &inPresentationScissor,
- const QT3DSVec2 &inPresentationDesignDimensions, SLayer &inLayer,
- bool inOffscreen, qt3ds::render::ScaleModes::Enum inScaleMode,
- qt3ds::QT3DSVec2 inScaleFactor);
-
- NVRenderRectF GetPresentationViewport() const { return m_PresentationViewport; }
- NVRenderRectF GetPresentationScissor() const { return m_PresentationScissor; }
- QT3DSVec2 GetPresentationDesignDimensions() const { return m_PresentationDesignDimensions; }
- SLayer *GetLayer() const { return m_Layer; }
- SCamera *GetCamera() const { return m_Camera; }
- bool IsOffscreen() const { return m_Offscreen; }
-
- // Does not differ whether offscreen or not, simply states how this layer maps to the
- // presentation
- NVRenderRectF GetLayerToPresentationViewport() const { return m_Viewport; }
- // Does not differ whether offscreen or not, scissor rect of how this layer maps to
- // presentation.
- NVRenderRectF GetLayerToPresentationScissorRect() const { return m_Scissor; }
-
- QSize GetTextureDimensions() const;
-
- SCameraGlobalCalculationResult SetupCameraForRender(SCamera &inCamera);
-
- Option<QT3DSVec2> GetLayerMouseCoords(const QT3DSVec2 &inMouseCoords,
- const QT3DSVec2 &inWindowDimensions,
- bool inForceIntersect) const;
-
- Option<SRay> GetPickRay(const QT3DSVec2 &inMouseCoords, const QT3DSVec2 &inWindowDimensions,
- bool inForceIntersect, bool sceneCameraView = false) const;
-
- // Checks the various viewports and determines if the layer is visible or not.
- bool IsLayerVisible() const;
-
- private:
- // Viewport used when actually rendering. In the case where this is an offscreen item then
- // it may be
- // different than the layer to presentation viewport.
- NVRenderRectF GetLayerRenderViewport() const;
- };
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp
deleted file mode 100644
index 4f274574..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp
+++ /dev/null
@@ -1,1479 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderer.h"
-#include "Qt3DSRendererImpl.h"
-#include "Qt3DSRenderLayer.h"
-#include "Qt3DSRenderEffect.h"
-#include "EASTL/sort.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderCamera.h"
-#include "Qt3DSRenderScene.h"
-#include "Qt3DSRenderPresentation.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "Qt3DSTextRenderer.h"
-#include "Qt3DSRenderEffectSystem.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "Qt3DSOffscreenRenderKey.h"
-#include "Qt3DSRenderPlugin.h"
-#include "Qt3DSRenderPluginGraphObject.h"
-#include "Qt3DSRenderResourceBufferObjects.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/AutoDeallocatorAllocator.h"
-#include "Qt3DSRenderMaterialHelpers.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderCustomMaterialSystem.h"
-#include "Qt3DSRenderTextTextureCache.h"
-#include "Qt3DSRenderTextTextureAtlas.h"
-#include "Qt3DSRenderRenderList.h"
-#include "Qt3DSRenderPath.h"
-#include "Qt3DSRenderPathManager.h"
-
-#ifdef _WIN32
-#pragma warning(disable : 4355)
-#endif
-namespace qt3ds {
-namespace render {
- using eastl::reverse;
- using eastl::stable_sort;
- using qt3ds::render::NVRenderContextScopedProperty;
- using qt3ds::QT3DSVec2;
-
- namespace {
- void MaybeQueueNodeForRender(SNode &inNode, nvvector<SRenderableNodeEntry> &outRenderables,
- nvvector<SNode *> &outCamerasAndLights, QT3DSU32 &ioDFSIndex)
- {
- ++ioDFSIndex;
- inNode.m_DFSIndex = ioDFSIndex;
- if (GraphObjectTypes::IsRenderableType(inNode.m_Type))
- outRenderables.push_back(inNode);
- else if (GraphObjectTypes::IsLightCameraType(inNode.m_Type))
- outCamerasAndLights.push_back(&inNode);
-
- for (SNode *theChild = inNode.m_FirstChild; theChild != NULL;
- theChild = theChild->m_NextSibling)
- MaybeQueueNodeForRender(*theChild, outRenderables, outCamerasAndLights, ioDFSIndex);
- }
-
- bool HasValidLightProbe(SImage *inLightProbeImage)
- {
- return inLightProbeImage && inLightProbeImage->m_TextureData.m_Texture;
- }
- }
-
- SDefaultMaterialPreparationResult::SDefaultMaterialPreparationResult(
- SShaderDefaultMaterialKey inKey)
- : m_FirstImage(NULL)
- , m_Opacity(1.0f)
- , m_MaterialKey(inKey)
- , m_Dirty(false)
- {
- }
-
-#define MAX_AA_LEVELS 8
-
- SLayerRenderPreparationData::SLayerRenderPreparationData(SLayer &inLayer,
- Qt3DSRendererImpl &inRenderer)
- : m_Layer(inLayer)
- , m_Renderer(inRenderer)
- , m_Allocator(inRenderer.GetContext().GetAllocator())
- , m_RenderableNodeLightEntryPool(
- ForwardingAllocator(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_RenderableNodes"))
- , m_RenderableNodes(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_RenderableNodes")
- , m_LightToNodeMap(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_LightToNodeMap")
- , m_CamerasAndLights(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_CamerasAndLights")
- , m_Camera(NULL)
- , m_Lights(inRenderer.GetContext().GetAllocator(), "SLayerRenderPreparationData::m_Lights")
- , m_OpaqueObjects(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_OpaqueObjects")
- , m_TransparentObjects(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_TransparentObjects")
- , m_RenderedOpaqueObjects(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_RenderedOpaqueObjects")
- , m_RenderedTransparentObjects(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_RenderedTransparentObjects")
- , m_IRenderWidgets(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_IRenderWidgets")
- , m_SourceLightDirections(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_SourceLightDirections")
- , m_LightDirections(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_LightDirections")
- , m_ModelContexts(inRenderer.GetContext().GetAllocator(),
- "SLayerRenderPreparationData::m_ModelContexts")
- , m_CGLightingFeatureName(
- inRenderer.GetContext().GetStringTable().RegisterStr("QT3DS_ENABLE_CG_LIGHTING"))
- , m_FeaturesDirty(true)
- , m_FeatureSetHash(0)
- , m_TooManyLightsError(false)
- {
- }
-
- SLayerRenderPreparationData::~SLayerRenderPreparationData() {}
-
- bool SLayerRenderPreparationData::NeedsWidgetTexture() const
- {
- return m_IRenderWidgets.size() > 0;
- }
-
- void SLayerRenderPreparationData::SetShaderFeature(CRegisteredString theStr, bool inValue)
- {
- SShaderPreprocessorFeature item(theStr, inValue);
- eastl::vector<SShaderPreprocessorFeature>::iterator iter = m_Features.begin(),
- end = m_Features.end();
-
- // empty loop intentional.
- for (; iter != end && ((iter->m_Name == theStr) == false); ++iter)
- ;
-
- if (iter != end) {
- if (iter->m_Enabled != inValue) {
- iter->m_Enabled = inValue;
- m_FeaturesDirty = true;
- m_FeatureSetHash = 0;
- }
- } else {
- m_Features.push_back(item);
- m_FeaturesDirty = true;
- m_FeatureSetHash = 0;
- }
- }
-
- void SLayerRenderPreparationData::SetShaderFeature(const char *inName, bool inValue)
- {
- CRegisteredString theStr(m_Renderer.GetQt3DSContext().GetStringTable().RegisterStr(inName));
- SetShaderFeature(theStr, inValue);
- }
-
- NVConstDataRef<SShaderPreprocessorFeature> SLayerRenderPreparationData::GetShaderFeatureSet()
- {
- if (m_FeaturesDirty) {
- eastl::sort(m_Features.begin(), m_Features.end());
- m_FeaturesDirty = false;
- }
- return toConstDataRef(m_Features.data(), (QT3DSU32)m_Features.size());
- }
-
- size_t SLayerRenderPreparationData::GetShaderFeatureSetHash()
- {
- if (!m_FeatureSetHash)
- m_FeatureSetHash = HashShaderFeatureSet(GetShaderFeatureSet());
- return m_FeatureSetHash;
- }
-
- bool SLayerRenderPreparationData::GetShadowMapManager()
- {
- if (m_ShadowMapManager.mPtr)
- return true;
-
- m_ShadowMapManager.mPtr = Qt3DSShadowMap::Create(m_Renderer.GetQt3DSContext());
-
- return m_ShadowMapManager.mPtr != NULL;
- }
-
- bool SLayerRenderPreparationData::GetOffscreenRenderer()
- {
- if (m_LastFrameOffscreenRenderer.mPtr)
- return true;
-
- if (m_Layer.m_RenderPlugin && m_Layer.m_RenderPlugin->m_Flags.IsActive()) {
- IRenderPluginInstance *theInstance =
- m_Renderer.GetQt3DSContext().GetRenderPluginManager().GetOrCreateRenderPluginInstance(
- m_Layer.m_RenderPlugin->m_PluginPath, m_Layer.m_RenderPlugin);
- if (theInstance) {
- m_Renderer.GetQt3DSContext()
- .GetOffscreenRenderManager()
- .MaybeRegisterOffscreenRenderer(&theInstance, *theInstance);
- m_LastFrameOffscreenRenderer = theInstance;
- }
- }
- if (m_LastFrameOffscreenRenderer.mPtr == NULL)
- m_LastFrameOffscreenRenderer =
- m_Renderer.GetQt3DSContext().GetOffscreenRenderManager().GetOffscreenRenderer(
- m_Layer.m_TexturePath);
- return m_LastFrameOffscreenRenderer.mPtr != NULL;
- }
-
- QT3DSVec3 SLayerRenderPreparationData::GetCameraDirection()
- {
- if (m_CameraDirection.hasValue() == false) {
- if (m_Camera)
- m_CameraDirection = m_Camera->GetScalingCorrectDirection();
- else
- m_CameraDirection = QT3DSVec3(0, 0, -1);
- }
- return *m_CameraDirection;
- }
-
- // Per-frame cache of renderable objects post-sort.
- NVDataRef<SRenderableObject *> SLayerRenderPreparationData::GetOpaqueRenderableObjects()
- {
- if (m_RenderedOpaqueObjects.empty() == false || m_Camera == NULL)
- return m_RenderedOpaqueObjects;
- if (m_Layer.m_Flags.IsLayerEnableDepthTest() && m_OpaqueObjects.empty() == false) {
- QT3DSVec3 theCameraDirection(GetCameraDirection());
- QT3DSVec3 theCameraPosition = m_Camera->GetGlobalPos();
- m_RenderedOpaqueObjects.assign(m_OpaqueObjects.begin(), m_OpaqueObjects.end());
- // Setup the object's sorting information
- for (QT3DSU32 idx = 0, end = m_RenderedOpaqueObjects.size(); idx < end; ++idx) {
- SRenderableObject &theInfo = *m_RenderedOpaqueObjects[idx];
- QT3DSVec3 difference = theInfo.m_WorldCenterPoint - theCameraPosition;
- theInfo.m_CameraDistanceSq = difference.dot(theCameraDirection);
- }
-
- ForwardingAllocator alloc(m_Renderer.GetPerFrameAllocator(), "SortAllocations");
- // Render nearest to furthest objects
- eastl::merge_sort(m_RenderedOpaqueObjects.begin(), m_RenderedOpaqueObjects.end(), alloc,
- ISRenderObjectPtrLessThan);
- }
- return m_RenderedOpaqueObjects;
- }
-
- // If layer depth test is false, this may also contain opaque objects.
- NVDataRef<SRenderableObject *> SLayerRenderPreparationData::GetTransparentRenderableObjects()
- {
- if (m_RenderedTransparentObjects.empty() == false || m_Camera == NULL)
- return m_RenderedTransparentObjects;
-
- m_RenderedTransparentObjects.assign(m_TransparentObjects.begin(),
- m_TransparentObjects.end());
-
- if (m_Layer.m_Flags.IsLayerEnableDepthTest() == false)
- m_RenderedTransparentObjects.insert(m_RenderedTransparentObjects.end(),
- m_OpaqueObjects.begin(), m_OpaqueObjects.end());
-
- if (m_RenderedTransparentObjects.empty() == false) {
- QT3DSVec3 theCameraDirection(GetCameraDirection());
- QT3DSVec3 theCameraPosition = m_Camera->GetGlobalPos();
-
- // Setup the object's sorting information
- for (QT3DSU32 idx = 0, end = m_RenderedTransparentObjects.size(); idx < end; ++idx) {
- SRenderableObject &theInfo = *m_RenderedTransparentObjects[idx];
- QT3DSVec3 difference = theInfo.m_WorldCenterPoint - theCameraPosition;
- theInfo.m_CameraDistanceSq = difference.dot(theCameraDirection);
- }
- ForwardingAllocator alloc(m_Renderer.GetPerFrameAllocator(), "SortAllocations");
- // render furthest to nearest.
- eastl::merge_sort(m_RenderedTransparentObjects.begin(),
- m_RenderedTransparentObjects.end(), alloc,
- ISRenderObjectPtrGreatThan);
- }
-
- return m_RenderedTransparentObjects;
- }
-
-#define MAX_LAYER_WIDGETS 200
-
- void SLayerRenderPreparationData::AddRenderWidget(IRenderWidget &inWidget)
- {
- // The if the layer is not active then the widget can't be displayed.
- // Furthermore ResetForFrame won't be called below which leads to stale
- // widgets in the m_IRenderWidgets array. These stale widgets would get rendered
- // the next time the layer was active potentially causing a crash.
- if (!m_Layer.m_Flags.IsActive())
- return;
-
- // Ensure we clear the widget layer always
- m_Renderer.LayerNeedsFrameClear(*static_cast<SLayerRenderData *>(this));
-
- if (m_IRenderWidgets.size() < MAX_LAYER_WIDGETS)
- m_IRenderWidgets.push_back(&inWidget);
- }
-
-#define RENDER_FRAME_NEW(type) QT3DS_NEW(m_Renderer.GetPerFrameAllocator(), type)
-
-#define QT3DS_RENDER_MINIMUM_RENDER_OPACITY .01f
-
- SShaderDefaultMaterialKey
- SLayerRenderPreparationData::GenerateLightingKey(DefaultMaterialLighting::Enum inLightingType)
- {
- SShaderDefaultMaterialKey theGeneratedKey(GetShaderFeatureSetHash());
- const bool lighting = inLightingType != DefaultMaterialLighting::NoLighting;
- m_Renderer.DefaultMaterialShaderKeyProperties().m_HasLighting.SetValue(theGeneratedKey,
- lighting);
- if (lighting) {
- const bool lightProbe = m_Layer.m_LightProbe
- && m_Layer.m_LightProbe->m_TextureData.m_Texture;
- m_Renderer.DefaultMaterialShaderKeyProperties().m_HasIbl.SetValue(theGeneratedKey,
- lightProbe);
-
- QT3DSU32 numLights = (QT3DSU32)m_Lights.size();
- if (numLights > SShaderDefaultMaterialKeyProperties::LightCount
- && m_TooManyLightsError == false) {
- m_TooManyLightsError = true;
- numLights = SShaderDefaultMaterialKeyProperties::LightCount;
- qCCritical(INVALID_OPERATION, "Too many lights on layer, max is 7");
- QT3DS_ASSERT(false);
- }
- m_Renderer.DefaultMaterialShaderKeyProperties().m_LightCount.SetValue(theGeneratedKey,
- numLights);
-
- for (QT3DSU32 lightIdx = 0, lightEnd = m_Lights.size();
- lightIdx < lightEnd; ++lightIdx) {
- SLight *theLight(m_Lights[lightIdx]);
- const bool isDirectional = theLight->m_LightType == RenderLightTypes::Directional;
- const bool isArea = theLight->m_LightType == RenderLightTypes::Area;
- const bool castShadowsArea = (theLight->m_LightType != RenderLightTypes::Area)
- && (theLight->m_CastShadow);
-
- m_Renderer.DefaultMaterialShaderKeyProperties().m_LightFlags[lightIdx]
- .SetValue(theGeneratedKey, !isDirectional);
- m_Renderer.DefaultMaterialShaderKeyProperties().m_LightAreaFlags[lightIdx]
- .SetValue(theGeneratedKey, isArea);
- m_Renderer.DefaultMaterialShaderKeyProperties().m_LightShadowFlags[lightIdx]
- .SetValue(theGeneratedKey, castShadowsArea);
- }
- }
- return theGeneratedKey;
- }
-
- bool SLayerRenderPreparationData::PrepareTextForRender(
- SText &inText, const QT3DSMat44 &inViewProjection,
- QT3DSF32 inTextScaleFactor, SLayerRenderPreparationResultFlags &ioFlags)
- {
- ITextTextureCache *theTextRenderer = m_Renderer.GetQt3DSContext().GetTextureCache();
- if (theTextRenderer == NULL)
- return false;
-
- SRenderableObjectFlags theFlags;
- theFlags.SetHasTransparency(true);
- theFlags.SetCompletelyTransparent(inText.m_GlobalOpacity < .01f);
- theFlags.SetPickable(true);
- bool retval = false;
-
- if (theFlags.IsCompletelyTransparent() == false) {
- retval = inText.m_Flags.IsDirty() || inText.m_Flags.IsTextDirty();
- inText.m_Flags.SetTextDirty(false);
- QT3DSMat44 theMVP;
- QT3DSMat33 theNormalMatrix;
- inText.CalculateMVPAndNormalMatrix(inViewProjection, theMVP, theNormalMatrix);
-
- SRenderableObject *theRenderable = nullptr;
-
-#if QT_VERSION >= QT_VERSION_CHECK(5,12,2)
- Q3DSDistanceFieldRenderer *distanceFieldText
- = static_cast<Q3DSDistanceFieldRenderer *>(
- m_Renderer.GetQt3DSContext().getDistanceFieldRenderer());
- theRenderable = RENDER_FRAME_NEW(SDistanceFieldRenderable)(
- theFlags, inText.GetGlobalPos(), inText, inText.m_Bounds, theMVP,
- *distanceFieldText);
-#else
- TTPathObjectAndTexture theResult
- = theTextRenderer->RenderText(inText, inTextScaleFactor);
- inText.m_TextTexture = theResult.second.second.mPtr;
- inText.m_TextTextureDetails = theResult.second.first;
- inText.m_PathFontItem = theResult.first.second;
- inText.m_PathFontDetails = theResult.first.first;
- STextScaleAndOffset theScaleAndOffset(*inText.m_TextTexture,
- inText.m_TextTextureDetails, inText);
- QT3DSVec2 theTextScale(theScaleAndOffset.m_TextScale);
- QT3DSVec2 theTextOffset(theScaleAndOffset.m_TextOffset);
- QT3DSVec3 minimum(theTextOffset[0] - theTextScale[0],
- theTextOffset[1] - theTextScale[1], 0);
- QT3DSVec3 maximum(theTextOffset[0] + theTextScale[0],
- theTextOffset[1] + theTextScale[1], 0);
- inText.m_Bounds = NVBounds3(minimum, maximum);
-
- if (inText.m_PathFontDetails)
- ioFlags.SetRequiresStencilBuffer(true);
-
- theRenderable = RENDER_FRAME_NEW(STextRenderable)(
- theFlags, inText.GetGlobalPos(), m_Renderer, inText, inText.m_Bounds, theMVP,
- inViewProjection, *inText.m_TextTexture, theTextOffset, theTextScale);
-#endif
- // After preparation, do not push object back to queue if it is not
- // active, because we prepare text elements regardless of their
- // visibility (=active status).
- if (inText.m_Flags.IsGloballyActive())
- m_TransparentObjects.push_back(theRenderable);
- }
- return retval;
- }
-
- eastl::pair<bool, SGraphObject *>
- SLayerRenderPreparationData::ResolveReferenceMaterial(SGraphObject *inMaterial)
- {
- bool subsetDirty = false;
- bool badIdea = false;
- SGraphObject *theSourceMaterialObject(inMaterial);
- SGraphObject *theMaterialObject(inMaterial);
- while (theMaterialObject
- && theMaterialObject->m_Type == GraphObjectTypes::ReferencedMaterial && !badIdea) {
- SReferencedMaterial *theRefMaterial =
- static_cast<SReferencedMaterial *>(theMaterialObject);
- theMaterialObject = theRefMaterial->m_ReferencedMaterial;
- if (theMaterialObject == theSourceMaterialObject) {
- badIdea = true;
- }
-
- if (theRefMaterial == theSourceMaterialObject) {
- theRefMaterial->m_Dirty.UpdateDirtyForFrame();
- }
- subsetDirty = subsetDirty | theRefMaterial->m_Dirty.IsDirty();
- }
- if (badIdea) {
- theMaterialObject = NULL;
- }
- return eastl::make_pair(subsetDirty, theMaterialObject);
- }
-
- bool SLayerRenderPreparationData::PreparePathForRender(
- SPath &inPath, const QT3DSMat44 &inViewProjection,
- const Option<SClippingFrustum> &inClipFrustum, SLayerRenderPreparationResultFlags &ioFlags)
- {
- SRenderableObjectFlags theSharedFlags;
- theSharedFlags.SetPickable(true);
- QT3DSF32 subsetOpacity = inPath.m_GlobalOpacity;
- bool retval = inPath.m_Flags.IsDirty();
- inPath.m_Flags.SetDirty(false);
- QT3DSMat44 theMVP;
- QT3DSMat33 theNormalMatrix;
-
- inPath.CalculateMVPAndNormalMatrix(inViewProjection, theMVP, theNormalMatrix);
- NVBounds3 theBounds(this->m_Renderer.GetQt3DSContext().GetPathManager().GetBounds(inPath));
-
- if (inPath.m_GlobalOpacity >= QT3DS_RENDER_MINIMUM_RENDER_OPACITY
- && inClipFrustum.hasValue()) {
- // Check bounding box against the clipping planes
- NVBounds3 theGlobalBounds = theBounds;
- theGlobalBounds.transform(inPath.m_GlobalTransform);
- if (inClipFrustum->intersectsWith(theGlobalBounds) == false)
- subsetOpacity = 0.0f;
- }
-
- SGraphObject *theMaterials[2] = { inPath.m_Material, inPath.m_SecondMaterial };
-
- if (inPath.m_PathType == PathTypes::Geometry
- || inPath.m_PaintStyle != PathPaintStyles::FilledAndStroked)
- theMaterials[1] = NULL;
-
- // We need to fill material to be the first one rendered so the stroke goes on top.
- // In the timeline, however, this is reversed.
-
- if (theMaterials[1])
- eastl::swap(theMaterials[1], theMaterials[0]);
-
- for (QT3DSU32 idx = 0, end = 2; idx < end; ++idx) {
- if (theMaterials[idx] == NULL)
- continue;
-
- SRenderableObjectFlags theFlags = theSharedFlags;
-
- eastl::pair<bool, SGraphObject *> theMaterialAndDirty(
- ResolveReferenceMaterial(theMaterials[idx]));
- SGraphObject *theMaterial(theMaterialAndDirty.second);
- retval = retval || theMaterialAndDirty.first;
-
- if (theMaterial != NULL && theMaterial->m_Type == GraphObjectTypes::DefaultMaterial) {
- SDefaultMaterial *theDefaultMaterial = static_cast<SDefaultMaterial *>(theMaterial);
- // Don't clear dirty flags if the material was referenced.
- bool clearMaterialFlags = theMaterial == inPath.m_Material;
- SDefaultMaterialPreparationResult prepResult(PrepareDefaultMaterialForRender(
- *theDefaultMaterial, theFlags, subsetOpacity, clearMaterialFlags));
-
- theFlags = prepResult.m_RenderableFlags;
- if (inPath.m_PathType == PathTypes::Geometry) {
- if ((inPath.m_BeginCapping != PathCapping::Noner
- && inPath.m_BeginCapOpacity < 1.0f)
- || (inPath.m_EndCapping != PathCapping::Noner
- && inPath.m_EndCapOpacity < 1.0f))
- theFlags.SetHasTransparency(true);
- } else {
- ioFlags.SetRequiresStencilBuffer(true);
- }
- retval = retval || prepResult.m_Dirty;
- bool isStroke = true;
- if (idx == 0 && inPath.m_PathType == PathTypes::Painted) {
- if (inPath.m_PaintStyle == PathPaintStyles::Filled
- || inPath.m_PaintStyle == PathPaintStyles::FilledAndStroked)
- isStroke = false;
- }
-
- SPathRenderable *theRenderable = RENDER_FRAME_NEW(SPathRenderable)(
- theFlags, inPath.GetGlobalPos(), m_Renderer, inPath.m_GlobalTransform,
- theBounds, inPath, theMVP, theNormalMatrix, *theMaterial, prepResult.m_Opacity,
- prepResult.m_MaterialKey, isStroke);
- theRenderable->m_FirstImage = prepResult.m_FirstImage;
-
- IQt3DSRenderContext &qt3dsContext(m_Renderer.GetQt3DSContext());
- IPathManager &thePathManager = qt3dsContext.GetPathManager();
- retval = thePathManager.PrepareForRender(inPath) || retval;
- retval |= (inPath.m_WireframeMode != qt3dsContext.GetWireframeMode());
- inPath.m_WireframeMode = qt3dsContext.GetWireframeMode();
-
- if (theFlags.HasTransparency())
- m_TransparentObjects.push_back(theRenderable);
- else
- m_OpaqueObjects.push_back(theRenderable);
- } else if (theMaterial != NULL
- && theMaterial->m_Type == GraphObjectTypes::CustomMaterial) {
- SCustomMaterial *theCustomMaterial = static_cast<SCustomMaterial *>(theMaterial);
- // Don't clear dirty flags if the material was referenced.
- // bool clearMaterialFlags = theMaterial == inPath.m_Material;
- SDefaultMaterialPreparationResult prepResult(
- PrepareCustomMaterialForRender(*theCustomMaterial, theFlags, subsetOpacity));
-
- theFlags = prepResult.m_RenderableFlags;
- if (inPath.m_PathType == PathTypes::Geometry) {
- if ((inPath.m_BeginCapping != PathCapping::Noner
- && inPath.m_BeginCapOpacity < 1.0f)
- || (inPath.m_EndCapping != PathCapping::Noner
- && inPath.m_EndCapOpacity < 1.0f))
- theFlags.SetHasTransparency(true);
- } else {
- ioFlags.SetRequiresStencilBuffer(true);
- }
-
- retval = retval || prepResult.m_Dirty;
- bool isStroke = true;
- if (idx == 0 && inPath.m_PathType == PathTypes::Painted) {
- if (inPath.m_PaintStyle == PathPaintStyles::Filled
- || inPath.m_PaintStyle == PathPaintStyles::FilledAndStroked)
- isStroke = false;
- }
-
- SPathRenderable *theRenderable = RENDER_FRAME_NEW(SPathRenderable)(
- theFlags, inPath.GetGlobalPos(), m_Renderer, inPath.m_GlobalTransform,
- theBounds, inPath, theMVP, theNormalMatrix, *theMaterial, prepResult.m_Opacity,
- prepResult.m_MaterialKey, isStroke);
- theRenderable->m_FirstImage = prepResult.m_FirstImage;
-
- IQt3DSRenderContext &qt3dsContext(m_Renderer.GetQt3DSContext());
- IPathManager &thePathManager = qt3dsContext.GetPathManager();
- retval = thePathManager.PrepareForRender(inPath) || retval;
- retval |= (inPath.m_WireframeMode != qt3dsContext.GetWireframeMode());
- inPath.m_WireframeMode = qt3dsContext.GetWireframeMode();
-
- if (theFlags.HasTransparency())
- m_TransparentObjects.push_back(theRenderable);
- else
- m_OpaqueObjects.push_back(theRenderable);
- }
- }
- return retval;
- }
-
- void SLayerRenderPreparationData::PrepareImageForRender(
- SImage &inImage, ImageMapTypes::Enum inMapType, SRenderableImage *&ioFirstImage,
- SRenderableImage *&ioNextImage, SRenderableObjectFlags &ioFlags,
- SShaderDefaultMaterialKey &inShaderKey, QT3DSU32 inImageIndex)
- {
- IQt3DSRenderContext &qt3dsContext(m_Renderer.GetQt3DSContext());
- IBufferManager &bufferManager = qt3dsContext.GetBufferManager();
- IOffscreenRenderManager &theOffscreenRenderManager(
- qt3dsContext.GetOffscreenRenderManager());
- IRenderPluginManager &theRenderPluginManager(qt3dsContext.GetRenderPluginManager());
- if (inImage.ClearDirty(bufferManager, theOffscreenRenderManager, theRenderPluginManager))
- ioFlags |= RenderPreparationResultFlagValues::Dirty;
-
- // All objects with offscreen renderers are pickable so we can pass the pick through to the
- // offscreen renderer and let it deal with the pick.
- if (inImage.m_LastFrameOffscreenRenderer != NULL) {
- ioFlags.SetPickable(true);
- ioFlags |= RenderPreparationResultFlagValues::HasTransparency;
- }
-
- if (inImage.m_TextureData.m_Texture) {
- if (inImage.m_TextureData.m_TextureFlags.HasTransparency()
- && (inMapType == ImageMapTypes::Diffuse
- || inMapType == ImageMapTypes::Opacity
- || inMapType == ImageMapTypes::Translucency)) {
- ioFlags |= RenderPreparationResultFlagValues::HasTransparency;
- }
- // Textures used in general have linear characteristics.
- // PKC -- The filters are properly set already. Setting them here only overrides what
- // would
- // otherwise be a correct setting.
- // inImage.m_TextureData.m_Texture->SetMinFilter( NVRenderTextureMinifyingOp::Linear );
- // inImage.m_TextureData.m_Texture->SetMagFilter( NVRenderTextureMagnifyingOp::Linear );
-
- SRenderableImage *theImage = RENDER_FRAME_NEW(SRenderableImage)(inMapType, inImage);
- SShaderKeyImageMap &theKeyProp =
- m_Renderer.DefaultMaterialShaderKeyProperties().m_ImageMaps[inImageIndex];
-
- theKeyProp.SetEnabled(inShaderKey, true);
- switch (inImage.m_MappingMode) {
- default:
- QT3DS_ASSERT(false);
- // fallthrough intentional
- case ImageMappingModes::Normal:
- break;
- case ImageMappingModes::Environment:
- theKeyProp.SetEnvMap(inShaderKey, true);
- break;
- case ImageMappingModes::LightProbe:
- theKeyProp.SetLightProbe(inShaderKey, true);
- break;
- }
-
- if (inImage.m_TextureData.m_TextureFlags.IsInvertUVCoords())
- theKeyProp.SetInvertUVMap(inShaderKey, true);
- if (ioFirstImage == NULL)
- ioFirstImage = theImage;
- else
- ioNextImage->m_NextImage = theImage;
-
- // assume offscreen renderer produces non-premultiplied image
- if (inImage.m_LastFrameOffscreenRenderer == nullptr
- && inImage.m_TextureData.m_TextureFlags.IsPreMultiplied())
- theKeyProp.SetPremultiplied(inShaderKey, true);
-
- SShaderKeyTextureSwizzle &theSwizzleKeyProp =
- m_Renderer.DefaultMaterialShaderKeyProperties().m_TextureSwizzle[inImageIndex];
- theSwizzleKeyProp.SetSwizzleMode(
- inShaderKey, inImage.m_TextureData.m_Texture->GetTextureSwizzleMode(), true);
-
- ioNextImage = theImage;
- }
- }
-
- SDefaultMaterialPreparationResult SLayerRenderPreparationData::PrepareDefaultMaterialForRender(
- SDefaultMaterial &inMaterial, SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity,
- bool inClearDirtyFlags)
- {
- SDefaultMaterial *theMaterial = &inMaterial;
- SDefaultMaterialPreparationResult retval(GenerateLightingKey(theMaterial->m_Lighting));
- retval.m_RenderableFlags = inExistingFlags;
- SRenderableObjectFlags &renderableFlags(retval.m_RenderableFlags);
- SShaderDefaultMaterialKey &theGeneratedKey(retval.m_MaterialKey);
- retval.m_Opacity = inOpacity;
- QT3DSF32 &subsetOpacity(retval.m_Opacity);
-
- if (theMaterial->m_Dirty.IsDirty()) {
- renderableFlags |= RenderPreparationResultFlagValues::Dirty;
- }
- subsetOpacity *= theMaterial->m_Opacity;
- if (inClearDirtyFlags)
- theMaterial->m_Dirty.UpdateDirtyForFrame();
-
- SRenderableImage *firstImage = NULL;
-
- // set wireframe mode
- m_Renderer.DefaultMaterialShaderKeyProperties().m_WireframeMode.SetValue(
- theGeneratedKey, m_Renderer.GetQt3DSContext().GetWireframeMode());
-
- if (theMaterial->m_IblProbe && CheckLightProbeDirty(*theMaterial->m_IblProbe)) {
- m_Renderer.PrepareImageForIbl(*theMaterial->m_IblProbe);
- }
-
- if (!m_Renderer.DefaultMaterialShaderKeyProperties().m_HasIbl.GetValue(theGeneratedKey)) {
- bool lightProbeValid = HasValidLightProbe(theMaterial->m_IblProbe);
- SetShaderFeature("QT3DS_ENABLE_LIGHT_PROBE", lightProbeValid);
- m_Renderer.DefaultMaterialShaderKeyProperties().m_HasIbl.SetValue(theGeneratedKey,
- lightProbeValid);
- // SetShaderFeature( "QT3DS_ENABLE_IBL_FOV",
- // m_Renderer.GetLayerRenderData()->m_Layer.m_ProbeFov < 180.0f );
- }
-
- if (subsetOpacity >= QT3DS_RENDER_MINIMUM_RENDER_OPACITY) {
-
- if (theMaterial->m_BlendMode != DefaultMaterialBlendMode::Normal
- || theMaterial->m_OpacityMap) {
- renderableFlags |= RenderPreparationResultFlagValues::HasTransparency;
- }
-
- bool specularEnabled = theMaterial->IsSpecularEnabled();
- m_Renderer.DefaultMaterialShaderKeyProperties().m_SpecularEnabled.SetValue(
- theGeneratedKey, specularEnabled);
- if (specularEnabled) {
- m_Renderer.DefaultMaterialShaderKeyProperties().m_SpecularModel.SetSpecularModel(
- theGeneratedKey, theMaterial->m_SpecularModel);
- }
-
- m_Renderer.DefaultMaterialShaderKeyProperties().m_FresnelEnabled.SetValue(
- theGeneratedKey, theMaterial->IsFresnelEnabled());
-
- m_Renderer.DefaultMaterialShaderKeyProperties().m_VertexColorsEnabled.SetValue(
- theGeneratedKey, theMaterial->IsVertexColorsEnabled());
-
- // Run through the material's images and prepare them for render.
- // this may in fact set pickable on the renderable flags if one of the images
- // links to a sub presentation or any offscreen rendered object.
- SRenderableImage *nextImage = NULL;
-#define CHECK_IMAGE_AND_PREPARE(img, imgtype, shadercomponent) \
- if ((img)) \
- PrepareImageForRender(*(img), imgtype, firstImage, nextImage, renderableFlags, \
- theGeneratedKey, shadercomponent);
-
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_DiffuseMaps[0], ImageMapTypes::Diffuse,
- SShaderDefaultMaterialKeyProperties::DiffuseMap0);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_DiffuseMaps[1], ImageMapTypes::Diffuse,
- SShaderDefaultMaterialKeyProperties::DiffuseMap1);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_DiffuseMaps[2], ImageMapTypes::Diffuse,
- SShaderDefaultMaterialKeyProperties::DiffuseMap2);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_EmissiveMap, ImageMapTypes::Emissive,
- SShaderDefaultMaterialKeyProperties::EmissiveMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_EmissiveMap2, ImageMapTypes::Emissive,
- SShaderDefaultMaterialKeyProperties::EmissiveMap2);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_SpecularReflection, ImageMapTypes::Specular,
- SShaderDefaultMaterialKeyProperties::SpecularMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_RoughnessMap, ImageMapTypes::Roughness,
- SShaderDefaultMaterialKeyProperties::RoughnessMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_OpacityMap, ImageMapTypes::Opacity,
- SShaderDefaultMaterialKeyProperties::OpacityMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_BumpMap, ImageMapTypes::Bump,
- SShaderDefaultMaterialKeyProperties::BumpMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_SpecularMap, ImageMapTypes::SpecularAmountMap,
- SShaderDefaultMaterialKeyProperties::SpecularAmountMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_NormalMap, ImageMapTypes::Normal,
- SShaderDefaultMaterialKeyProperties::NormalMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_DisplacementMap, ImageMapTypes::Displacement,
- SShaderDefaultMaterialKeyProperties::DisplacementMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_TranslucencyMap, ImageMapTypes::Translucency,
- SShaderDefaultMaterialKeyProperties::TranslucencyMap);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_Lightmaps.m_LightmapIndirect,
- ImageMapTypes::LightmapIndirect,
- SShaderDefaultMaterialKeyProperties::LightmapIndirect);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_Lightmaps.m_LightmapRadiosity,
- ImageMapTypes::LightmapRadiosity,
- SShaderDefaultMaterialKeyProperties::LightmapRadiosity);
- CHECK_IMAGE_AND_PREPARE(theMaterial->m_Lightmaps.m_LightmapShadow,
- ImageMapTypes::LightmapShadow,
- SShaderDefaultMaterialKeyProperties::LightmapShadow);
- }
-#undef CHECK_IMAGE_AND_PREPARE
-
- if (subsetOpacity < QT3DS_RENDER_MINIMUM_RENDER_OPACITY) {
- subsetOpacity = 0.0f;
- // You can still pick against completely transparent objects(or rather their bounding
- // box)
- // you just don't render them.
- renderableFlags |= RenderPreparationResultFlagValues::HasTransparency;
- renderableFlags |= RenderPreparationResultFlagValues::CompletelyTransparent;
- }
-
- if (IsNotOne(subsetOpacity))
- renderableFlags |= RenderPreparationResultFlagValues::HasTransparency;
-
- retval.m_FirstImage = firstImage;
- if (retval.m_RenderableFlags.IsDirty())
- retval.m_Dirty = true;
- return retval;
- }
-
- SDefaultMaterialPreparationResult SLayerRenderPreparationData::PrepareCustomMaterialForRender(
- SCustomMaterial &inMaterial, SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity)
- {
- SDefaultMaterialPreparationResult retval(GenerateLightingKey(
- DefaultMaterialLighting::FragmentLighting)); // always fragment lighting
- retval.m_RenderableFlags = inExistingFlags;
- SRenderableObjectFlags &renderableFlags(retval.m_RenderableFlags);
- SShaderDefaultMaterialKey &theGeneratedKey(retval.m_MaterialKey);
- retval.m_Opacity = inOpacity;
- QT3DSF32 &subsetOpacity(retval.m_Opacity);
-
- // If the custom material uses subpresentations, those have to be rendered before
- // the custom material itself
- m_Renderer.GetQt3DSContext().GetCustomMaterialSystem().renderSubpresentations(inMaterial);
-
- // set wireframe mode
- m_Renderer.DefaultMaterialShaderKeyProperties().m_WireframeMode.SetValue(
- theGeneratedKey, m_Renderer.GetQt3DSContext().GetWireframeMode());
-
- if (subsetOpacity < QT3DS_RENDER_MINIMUM_RENDER_OPACITY) {
- subsetOpacity = 0.0f;
- // You can still pick against completely transparent objects(or rather their bounding
- // box)
- // you just don't render them.
- renderableFlags |= RenderPreparationResultFlagValues::HasTransparency;
- renderableFlags |= RenderPreparationResultFlagValues::CompletelyTransparent;
- }
-
- if (IsNotOne(subsetOpacity))
- renderableFlags |= RenderPreparationResultFlagValues::HasTransparency;
-
- SRenderableImage *firstImage = NULL;
- SRenderableImage *nextImage = NULL;
-
-#define CHECK_IMAGE_AND_PREPARE(img, imgtype, shadercomponent) \
- if ((img)) \
- PrepareImageForRender(*(img), imgtype, firstImage, nextImage, renderableFlags, \
- theGeneratedKey, shadercomponent);
-
- CHECK_IMAGE_AND_PREPARE(inMaterial.m_DisplacementMap, ImageMapTypes::Displacement,
- SShaderDefaultMaterialKeyProperties::DisplacementMap);
- CHECK_IMAGE_AND_PREPARE(inMaterial.m_Lightmaps.m_LightmapIndirect,
- ImageMapTypes::LightmapIndirect,
- SShaderDefaultMaterialKeyProperties::LightmapIndirect);
- CHECK_IMAGE_AND_PREPARE(inMaterial.m_Lightmaps.m_LightmapRadiosity,
- ImageMapTypes::LightmapRadiosity,
- SShaderDefaultMaterialKeyProperties::LightmapRadiosity);
- CHECK_IMAGE_AND_PREPARE(inMaterial.m_Lightmaps.m_LightmapShadow,
- ImageMapTypes::LightmapShadow,
- SShaderDefaultMaterialKeyProperties::LightmapShadow);
-#undef CHECK_IMAGE_AND_PREPARE
-
- retval.m_FirstImage = firstImage;
- return retval;
- }
-
- bool SLayerRenderPreparationData::PrepareModelForRender(
- SModel &inModel, const QT3DSMat44 &inViewProjection,
- const Option<SClippingFrustum> &inClipFrustum, TNodeLightEntryList &inScopedLights)
- {
- IQt3DSRenderContext &qt3dsContext(m_Renderer.GetQt3DSContext());
- IBufferManager &bufferManager = qt3dsContext.GetBufferManager();
- SRenderMesh *theMesh = bufferManager.LoadMesh(inModel.m_MeshPath);
- if (theMesh == NULL)
- return false;
-
- SGraphObject *theSourceMaterialObject = inModel.m_FirstMaterial;
- SModelContext &theModelContext =
- *RENDER_FRAME_NEW(SModelContext)(inModel, inViewProjection);
- m_ModelContexts.push_back(&theModelContext);
-
- bool subsetDirty = false;
-
- SScopedLightsListScope lightsScope(m_Lights, m_LightDirections, m_SourceLightDirections,
- inScopedLights);
- SetShaderFeature(m_CGLightingFeatureName, m_Lights.empty() == false);
- for (QT3DSU32 idx = 0, end = theMesh->m_Subsets.size(); idx < end && theSourceMaterialObject;
- ++idx, theSourceMaterialObject = GetNextMaterialSibling(theSourceMaterialObject)) {
- SRenderSubset &theOuterSubset(theMesh->m_Subsets[idx]);
- {
- SRenderSubset &theSubset(theOuterSubset);
- SRenderableObjectFlags renderableFlags;
- renderableFlags.SetPickable(false);
- renderableFlags.SetShadowCaster(inModel.m_ShadowCaster);
- QT3DSF32 subsetOpacity = inModel.m_GlobalOpacity;
- QT3DSVec3 theModelCenter(theSubset.m_Bounds.getCenter());
- theModelCenter = inModel.m_GlobalTransform.transform(theModelCenter);
-
- if (subsetOpacity >= QT3DS_RENDER_MINIMUM_RENDER_OPACITY
- && inClipFrustum.hasValue()) {
- // Check bounding box against the clipping planes
- NVBounds3 theGlobalBounds = theSubset.m_Bounds;
- theGlobalBounds.transform(theModelContext.m_Model.m_GlobalTransform);
- if (inClipFrustum->intersectsWith(theGlobalBounds) == false)
- subsetOpacity = 0.0f;
- }
-
- // For now everything is pickable. Eventually we want to have localPickable and
- // globalPickable set on the node during
- // updates and have the runtime tell us what is pickable and what is not pickable.
- // Completely transparent models cannot be pickable. But models with completely
- // transparent materials
- // still are. This allows the artist to control pickability in a somewhat
- // fine-grained style.
- bool canModelBePickable = inModel.m_GlobalOpacity > .01f;
- renderableFlags.SetPickable(canModelBePickable
- && (theModelContext.m_Model.m_Flags.IsGloballyPickable()
- || renderableFlags.GetPickable()));
- SRenderableObject *theRenderableObject(NULL);
- eastl::pair<bool, SGraphObject *> theMaterialObjectAndDirty =
- ResolveReferenceMaterial(theSourceMaterialObject);
- SGraphObject *theMaterialObject = theMaterialObjectAndDirty.second;
- subsetDirty = subsetDirty || theMaterialObjectAndDirty.first;
- if (theMaterialObject == NULL)
- continue;
-
- // set tessellation
- if (inModel.m_TessellationMode != TessModeValues::NoTess) {
- theSubset.m_PrimitiveType = NVRenderDrawMode::Patches;
- // set tessellation factor
- theSubset.m_EdgeTessFactor = inModel.m_EdgeTess;
- theSubset.m_InnerTessFactor = inModel.m_InnerTess;
- // update the vertex ver patch count in the input assembler
- // currently we only support triangle patches so count is always 3
- theSubset.m_InputAssembler->SetPatchVertexCount(3);
- theSubset.m_InputAssemblerDepth->SetPatchVertexCount(3);
- // check wireframe mode
- theSubset.m_WireframeMode = qt3dsContext.GetWireframeMode();
-
- subsetDirty =
- subsetDirty | (theSubset.m_WireframeMode != inModel.m_WireframeMode);
- inModel.m_WireframeMode = qt3dsContext.GetWireframeMode();
- } else {
- theSubset.m_PrimitiveType = theSubset.m_InputAssembler->GetPrimitiveType();
- theSubset.m_InputAssembler->SetPatchVertexCount(1);
- theSubset.m_InputAssemblerDepth->SetPatchVertexCount(1);
- // currently we allow wirframe mode only if tessellation is on
- theSubset.m_WireframeMode = false;
-
- subsetDirty =
- subsetDirty | (theSubset.m_WireframeMode != inModel.m_WireframeMode);
- inModel.m_WireframeMode = false;
- }
- // Only clear flags on the materials in this direct hierarchy. Do not clear them of
- // this
- // references materials in another hierarchy.
- bool clearMaterialDirtyFlags = theMaterialObject == theSourceMaterialObject;
-
- if (theMaterialObject == NULL)
- continue;
-
- if (theMaterialObject->m_Type == GraphObjectTypes::DefaultMaterial) {
- SDefaultMaterial &theMaterial(
- static_cast<SDefaultMaterial &>(*theMaterialObject));
- SDefaultMaterialPreparationResult theMaterialPrepResult(
- PrepareDefaultMaterialForRender(theMaterial, renderableFlags, subsetOpacity,
- clearMaterialDirtyFlags));
- SShaderDefaultMaterialKey theGeneratedKey = theMaterialPrepResult.m_MaterialKey;
- subsetOpacity = theMaterialPrepResult.m_Opacity;
- SRenderableImage *firstImage(theMaterialPrepResult.m_FirstImage);
- subsetDirty |= theMaterialPrepResult.m_Dirty;
- renderableFlags = theMaterialPrepResult.m_RenderableFlags;
-
- m_Renderer.DefaultMaterialShaderKeyProperties()
- .m_TessellationMode.SetTessellationMode(theGeneratedKey,
- inModel.m_TessellationMode, true);
-
- NVConstDataRef<QT3DSMat44> boneGlobals;
- if (theSubset.m_Joints.size()) {
- QT3DS_ASSERT(false);
- }
-
- theRenderableObject = RENDER_FRAME_NEW(SSubsetRenderable)(
- renderableFlags, theModelCenter, m_Renderer, theSubset, theMaterial,
- theModelContext, subsetOpacity, firstImage, theGeneratedKey, boneGlobals);
- subsetDirty = subsetDirty || renderableFlags.IsDirty();
-
- } // if type == DefaultMaterial
- else if (theMaterialObject->m_Type == GraphObjectTypes::CustomMaterial) {
- SCustomMaterial &theMaterial(
- static_cast<SCustomMaterial &>(*theMaterialObject));
-
- ICustomMaterialSystem &theMaterialSystem(
- qt3dsContext.GetCustomMaterialSystem());
- subsetDirty |= theMaterialSystem.PrepareForRender(
- theModelContext.m_Model, theSubset, theMaterial, clearMaterialDirtyFlags);
-
- SDefaultMaterialPreparationResult theMaterialPrepResult(
- PrepareCustomMaterialForRender(theMaterial, renderableFlags,
- subsetOpacity));
- SShaderDefaultMaterialKey theGeneratedKey = theMaterialPrepResult.m_MaterialKey;
- subsetOpacity = theMaterialPrepResult.m_Opacity;
- SRenderableImage *firstImage(theMaterialPrepResult.m_FirstImage);
- renderableFlags = theMaterialPrepResult.m_RenderableFlags;
-
- // prepare for render tells us if the object is transparent
- if (theMaterial.m_hasTransparency)
- renderableFlags |= RenderPreparationResultFlagValues::HasTransparency;
- // prepare for render tells us if the object is transparent
- if (theMaterial.m_hasRefraction)
- renderableFlags |= RenderPreparationResultFlagValues::HasRefraction;
-
- m_Renderer.DefaultMaterialShaderKeyProperties()
- .m_TessellationMode.SetTessellationMode(theGeneratedKey,
- inModel.m_TessellationMode, true);
-
- if (theMaterial.m_IblProbe && CheckLightProbeDirty(*theMaterial.m_IblProbe)) {
- m_Renderer.PrepareImageForIbl(*theMaterial.m_IblProbe);
- }
-
- theRenderableObject = RENDER_FRAME_NEW(SCustomMaterialRenderable)(
- renderableFlags, theModelCenter, m_Renderer, theSubset, theMaterial,
- theModelContext, subsetOpacity, firstImage, theGeneratedKey);
- }
- if (theRenderableObject) {
- theRenderableObject->m_ScopedLights = inScopedLights;
- // set tessellation
- theRenderableObject->m_TessellationMode = inModel.m_TessellationMode;
-
- if (theRenderableObject->m_RenderableFlags.HasTransparency()
- || theRenderableObject->m_RenderableFlags.HasRefraction()) {
- m_TransparentObjects.push_back(theRenderableObject);
- } else {
- m_OpaqueObjects.push_back(theRenderableObject);
- }
- }
- }
- }
- return subsetDirty;
- }
-
- bool SLayerRenderPreparationData::PrepareRenderablesForRender(
- const QT3DSMat44 &inViewProjection, const Option<SClippingFrustum> &inClipFrustum,
- QT3DSF32 inTextScaleFactor, SLayerRenderPreparationResultFlags &ioFlags)
- {
- SStackPerfTimer __timer(m_Renderer.GetQt3DSContext().GetPerfTimer(),
- "SLayerRenderData::PrepareRenderablesForRender");
- m_ViewProjection = inViewProjection;
- QT3DSF32 theTextScaleFactor = inTextScaleFactor;
- bool wasDataDirty = false;
- bool hasTextRenderer = m_Renderer.GetQt3DSContext().GetTextRenderer() != NULL;
- for (QT3DSU32 idx = 0, end = m_RenderableNodes.size(); idx < end; ++idx) {
- SRenderableNodeEntry &theNodeEntry(m_RenderableNodes[idx]);
- SNode *theNode = theNodeEntry.m_Node;
- wasDataDirty = wasDataDirty || theNode->m_Flags.IsDirty();
- switch (theNode->m_Type) {
- case GraphObjectTypes::Model: {
- SModel *theModel = static_cast<SModel *>(theNode);
- theModel->CalculateGlobalVariables();
- if (theModel->m_Flags.IsGloballyActive()) {
- bool wasModelDirty = PrepareModelForRender(
- *theModel, inViewProjection, inClipFrustum, theNodeEntry.m_Lights);
- wasDataDirty = wasDataDirty || wasModelDirty;
- }
- } break;
- case GraphObjectTypes::Text: {
- if (hasTextRenderer) {
- SText *theText = static_cast<SText *>(theNode);
- theText->CalculateGlobalVariables();
- // Omit check for global active flag intentionally and force
- // render preparation for all Text items. This eliminates
- // large delay for distance field text items becoming active
- // mid-animation.
- bool wasTextDirty = PrepareTextForRender(*theText, inViewProjection,
- theTextScaleFactor, ioFlags);
- wasDataDirty = wasDataDirty || wasTextDirty;
-
- }
- } break;
- case GraphObjectTypes::Path: {
- SPath *thePath = static_cast<SPath *>(theNode);
- thePath->CalculateGlobalVariables();
- if (thePath->m_Flags.IsGloballyActive()) {
- bool wasPathDirty =
- PreparePathForRender(*thePath, inViewProjection, inClipFrustum, ioFlags);
- wasDataDirty = wasDataDirty || wasPathDirty;
- }
- } break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
- return wasDataDirty;
- }
-
- bool SLayerRenderPreparationData::CheckLightProbeDirty(SImage &inLightProbe)
- {
- IQt3DSRenderContext &theContext(m_Renderer.GetQt3DSContext());
- return inLightProbe.ClearDirty(theContext.GetBufferManager(),
- theContext.GetOffscreenRenderManager(),
- theContext.GetRenderPluginManager(), true);
- }
-
- struct SLightNodeMarker
- {
- SLight *m_Light;
- QT3DSU32 m_LightIndex;
- QT3DSU32 m_FirstValidIndex;
- QT3DSU32 m_JustPastLastValidIndex;
- bool m_AddOrRemove;
- SLightNodeMarker()
- : m_Light(NULL)
- , m_FirstValidIndex(0)
- , m_JustPastLastValidIndex(0)
- , m_AddOrRemove(false)
- {
- }
- SLightNodeMarker(SLight &inLight, QT3DSU32 inLightIndex, SNode &inNode, bool aorm)
- : m_Light(&inLight)
- , m_LightIndex(inLightIndex)
- , m_AddOrRemove(aorm)
- {
- if (inNode.m_Type == GraphObjectTypes::Layer) {
- m_FirstValidIndex = 0;
- m_JustPastLastValidIndex = QT3DS_MAX_U32;
- } else {
- m_FirstValidIndex = inNode.m_DFSIndex;
- SNode *lastChild = NULL;
- SNode *firstChild = inNode.m_FirstChild;
- // find deepest last child
- while (firstChild) {
- for (SNode *childNode = firstChild; childNode;
- childNode = childNode->m_NextSibling)
- lastChild = childNode;
-
- if (lastChild)
- firstChild = lastChild->m_FirstChild;
- else
- firstChild = NULL;
- }
- if (lastChild)
- // last valid index would be the last child index + 1
- m_JustPastLastValidIndex = lastChild->m_DFSIndex + 1;
- else // no children.
- m_JustPastLastValidIndex = m_FirstValidIndex + 1;
- }
- }
- };
-
- // m_Layer.m_Camera->CalculateViewProjectionMatrix(m_ViewProjection);
- void
- SLayerRenderPreparationData::PrepareForRender(const QSize &inViewportDimensions)
- {
- SStackPerfTimer __timer(m_Renderer.GetQt3DSContext().GetPerfTimer(),
- "SLayerRenderData::PrepareForRender");
- if (m_LayerPrepResult.hasValue())
- return;
-
- m_Features.clear();
- m_FeatureSetHash = 0;
- QT3DSVec2 thePresentationDimensions((QT3DSF32)inViewportDimensions.width(),
- (QT3DSF32)inViewportDimensions.height());
- IRenderList &theGraph(m_Renderer.GetQt3DSContext().GetRenderList());
- NVRenderRect theViewport(theGraph.GetViewport());
- NVRenderRect theScissor(theGraph.GetViewport());
- if (theGraph.IsScissorTestEnabled())
- theScissor = m_Renderer.GetContext().GetScissorRect();
- bool wasDirty = false;
- bool wasDataDirty = false;
- wasDirty = m_Layer.m_Flags.IsDirty();
- // The first pass is just to render the data.
- QT3DSU32 maxNumAAPasses = m_Layer.m_ProgressiveAAMode == AAModeValues::NoAA
- ? (QT3DSU32)0
- : (QT3DSU32)(m_Layer.m_ProgressiveAAMode) + 1;
- maxNumAAPasses = NVMin((QT3DSU32)(MAX_AA_LEVELS + 1), maxNumAAPasses);
- SEffect *theLastEffect = NULL;
- // Uncomment the line below to disable all progressive AA.
- // maxNumAAPasses = 0;
-
- SLayerRenderPreparationResult thePrepResult;
- bool hasOffscreenRenderer = GetOffscreenRenderer();
-
- bool SSAOEnabled = (m_Layer.m_AoStrength > 0.0f && m_Layer.m_AoDistance > 0.0f);
- bool SSDOEnabled = (m_Layer.m_ShadowStrength > 0.0f && m_Layer.m_ShadowDist > 0.0f);
- SetShaderFeature("QT3DS_ENABLE_SSAO", SSAOEnabled);
- SetShaderFeature("QT3DS_ENABLE_SSDO", SSDOEnabled);
- bool requiresDepthPrepass = (hasOffscreenRenderer == false) && (SSAOEnabled || SSDOEnabled);
- SetShaderFeature("QT3DS_ENABLE_SSM", false); // by default no shadow map generation
-
- if (m_Layer.m_Flags.IsActive()) {
- // Get the layer's width and height.
- IEffectSystem &theEffectSystem(m_Renderer.GetQt3DSContext().GetEffectSystem());
- for (SEffect *theEffect = m_Layer.m_FirstEffect; theEffect;
- theEffect = theEffect->m_NextEffect) {
- if (theEffect->m_Flags.IsDirty()) {
- wasDirty = true;
- theEffect->m_Flags.SetDirty(false);
- }
- if (theEffect->m_Flags.IsActive()) {
- // If the effect uses subpresentations, those have to be rendered before
- // the effect itself
- theEffectSystem.renderSubpresentations(*theEffect);
- theLastEffect = theEffect;
- if (hasOffscreenRenderer == false
- && theEffectSystem.DoesEffectRequireDepthTexture(theEffect->m_ClassName))
- requiresDepthPrepass = true;
- }
- }
- if (m_Layer.m_Flags.IsDirty()) {
- wasDirty = true;
- m_Layer.CalculateGlobalVariables();
- }
-
- bool shouldRenderToTexture = true;
-
- if (hasOffscreenRenderer) {
- // We don't render to texture with offscreen renderers, we just render them to the
- // viewport.
- shouldRenderToTexture = false;
- // Progaa disabled when using offscreen rendering.
- maxNumAAPasses = 0;
- }
-
- thePrepResult = SLayerRenderPreparationResult(SLayerRenderHelper(
- theViewport, theScissor, m_Layer.m_Scene->m_Presentation->m_PresentationDimensions,
- m_Layer, shouldRenderToTexture, m_Renderer.GetQt3DSContext().GetScaleMode(),
- m_Renderer.GetQt3DSContext().GetPresentationScaleFactor()));
- thePrepResult.m_LastEffect = theLastEffect;
- thePrepResult.m_MaxAAPassIndex = maxNumAAPasses;
- thePrepResult.m_Flags.SetRequiresDepthTexture(requiresDepthPrepass
- || NeedsWidgetTexture());
- thePrepResult.m_Flags.SetShouldRenderToTexture(shouldRenderToTexture);
- if (m_Renderer.GetContext().GetRenderContextType() != NVRenderContextValues::GLES2)
- thePrepResult.m_Flags.SetRequiresSsaoPass(SSAOEnabled);
-
- if (thePrepResult.IsLayerVisible()) {
- if (shouldRenderToTexture) {
- m_Renderer.GetQt3DSContext().GetRenderList().AddRenderTask(
- CreateRenderToTextureRunnable());
- }
- if (m_Layer.m_LightProbe && CheckLightProbeDirty(*m_Layer.m_LightProbe)) {
- m_Renderer.PrepareImageForIbl(*m_Layer.m_LightProbe);
- wasDataDirty = true;
- }
-
- bool lightProbeValid = HasValidLightProbe(m_Layer.m_LightProbe);
-
- SetShaderFeature("QT3DS_ENABLE_LIGHT_PROBE", lightProbeValid);
- SetShaderFeature("QT3DS_ENABLE_IBL_FOV", m_Layer.m_ProbeFov < 180.0f);
-
- if (lightProbeValid && m_Layer.m_LightProbe2
- && CheckLightProbeDirty(*m_Layer.m_LightProbe2)) {
- m_Renderer.PrepareImageForIbl(*m_Layer.m_LightProbe2);
- wasDataDirty = true;
- }
-
- SetShaderFeature("QT3DS_ENABLE_LIGHT_PROBE_2",
- lightProbeValid && HasValidLightProbe(m_Layer.m_LightProbe2));
-
- // Push nodes in reverse depth first order
- if (m_RenderableNodes.empty()) {
- m_CamerasAndLights.clear();
- QT3DSU32 dfsIndex = 0;
- for (SNode *theChild = m_Layer.m_FirstChild; theChild;
- theChild = theChild->m_NextSibling)
- MaybeQueueNodeForRender(*theChild, m_RenderableNodes, m_CamerasAndLights,
- dfsIndex);
- reverse(m_CamerasAndLights.begin(), m_CamerasAndLights.end());
- reverse(m_RenderableNodes.begin(), m_RenderableNodes.end());
- m_LightToNodeMap.clear();
- }
- m_Camera = NULL;
- m_Lights.clear();
- m_OpaqueObjects.clear();
- m_TransparentObjects.clear();
- nvvector<SLightNodeMarker> theLightNodeMarkers(m_Renderer.GetPerFrameAllocator(),
- "LightNodeMarkers");
- m_SourceLightDirections.clear();
-
- for (QT3DSU32 idx = 0, end = m_CamerasAndLights.size(); idx < end; ++idx) {
- SNode *theNode(m_CamerasAndLights[idx]);
- wasDataDirty = wasDataDirty || theNode->m_Flags.IsDirty();
- switch (theNode->m_Type) {
- case GraphObjectTypes::Camera: {
- SCamera *theCamera = static_cast<SCamera *>(theNode);
- if (theCamera->m_Flags.IsActive()) {
- // Only proceed with camera nodes which are currently active.
- // SetupCameraForRender() sets the camera used for picking and
- // updates global state e.g. IsGloballyActive()
- SCameraGlobalCalculationResult theResult =
- thePrepResult.SetupCameraForRender(*theCamera);
- wasDataDirty = wasDataDirty || theResult.m_WasDirty;
- if (theCamera->m_Flags.IsGloballyActive())
- m_Camera = theCamera;
- if (theResult.m_ComputeFrustumSucceeded == false) {
- qCCritical(INTERNAL_ERROR, "Failed to calculate camera frustum");
- }
- }
- } break;
- case GraphObjectTypes::Light: {
- SLight *theLight = static_cast<SLight *>(theNode);
- bool lightResult = theLight->CalculateGlobalVariables();
- wasDataDirty = lightResult || wasDataDirty;
- // Note we setup the light index such that it is completely invariant of if
- // the
- // light is active or scoped.
- QT3DSU32 lightIndex = (QT3DSU32)m_SourceLightDirections.size();
- m_SourceLightDirections.push_back(QT3DSVec3(0.0f));
- // Note we still need a light check when building the renderable light list.
- // We also cannot cache shader-light bindings based on layers any more
- // because
- // the number of lights for a given renderable does not depend on the layer
- // as it used to but
- // additional perhaps on the light's scoping rules.
- if (theLight->m_Flags.IsGloballyActive()) {
- if (theLight->m_Scope == NULL) {
- m_Lights.push_back(theLight);
- if (m_Renderer.GetContext().GetRenderContextType()
- != NVRenderContextValues::GLES2
- && theLight->m_CastShadow && GetShadowMapManager()) {
- // PKC -- use of "res" as an exponent of two is an annoying
- // artifact of the XML interface
- // I'll change this with an enum interface later on, but that's
- // less important right now.
- QT3DSU32 mapSize = 1 << theLight->m_ShadowMapRes;
- ShadowMapModes::Enum mapMode =
- (theLight->m_LightType != RenderLightTypes::Directional)
- ? ShadowMapModes::CUBE
- : ShadowMapModes::VSM;
- m_ShadowMapManager->AddShadowMapEntry(
- m_Lights.size() - 1, mapSize, mapSize,
- NVRenderTextureFormats::R16F, 1, mapMode,
- ShadowFilterValues::NONE);
- thePrepResult.m_Flags.SetRequiresShadowMapPass(true);
- SetShaderFeature("QT3DS_ENABLE_SSM", true);
- }
- }
- TLightToNodeMap::iterator iter =
- m_LightToNodeMap.insert(eastl::make_pair(theLight, (SNode *)NULL))
- .first;
- SNode *oldLightScope = iter->second;
- SNode *newLightScope = theLight->m_Scope;
-
- if (oldLightScope != newLightScope) {
- iter->second = newLightScope;
- if (oldLightScope)
- theLightNodeMarkers.push_back(SLightNodeMarker(
- *theLight, lightIndex, *oldLightScope, false));
- if (newLightScope)
- theLightNodeMarkers.push_back(SLightNodeMarker(
- *theLight, lightIndex, *newLightScope, true));
- }
- if (newLightScope) {
- m_SourceLightDirections.back() =
- theLight->GetScalingCorrectDirection();
- }
- }
- } break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- }
-
- if (theLightNodeMarkers.empty() == false) {
- for (QT3DSU32 idx = 0, end = m_RenderableNodes.size(); idx < end; ++idx) {
- SRenderableNodeEntry &theNodeEntry(m_RenderableNodes[idx]);
- QT3DSU32 nodeDFSIndex = theNodeEntry.m_Node->m_DFSIndex;
- for (QT3DSU32 markerIdx = 0, markerEnd = theLightNodeMarkers.size();
- markerIdx < markerEnd; ++markerIdx) {
- SLightNodeMarker &theMarker = theLightNodeMarkers[markerIdx];
- if (nodeDFSIndex >= theMarker.m_FirstValidIndex
- && nodeDFSIndex < theMarker.m_JustPastLastValidIndex) {
- if (theMarker.m_AddOrRemove) {
- SNodeLightEntry *theNewEntry =
- m_RenderableNodeLightEntryPool.construct(
- theMarker.m_Light, theMarker.m_LightIndex, __FILE__,
- __LINE__);
- theNodeEntry.m_Lights.push_back(*theNewEntry);
- } else {
- for (TNodeLightEntryList::iterator
- lightIter = theNodeEntry.m_Lights.begin(),
- lightEnd = theNodeEntry.m_Lights.end();
- lightIter != lightEnd; ++lightIter) {
- if (lightIter->m_Light == theMarker.m_Light) {
- SNodeLightEntry &theEntry = *lightIter;
- theNodeEntry.m_Lights.remove(theEntry);
- m_RenderableNodeLightEntryPool.deallocate(&theEntry);
- break;
- }
- }
- }
- }
- }
- }
- }
-
- QT3DSF32 theTextScaleFactor = 1.0f;
- if (m_Camera) {
- m_Camera->CalculateViewProjectionMatrix(m_ViewProjection);
- theTextScaleFactor = m_Camera->GetTextScaleFactor(
- thePrepResult.GetLayerToPresentationViewport(),
- thePrepResult.GetPresentationDesignDimensions());
- SClipPlane nearPlane;
- QT3DSMat33 theUpper33(m_Camera->m_GlobalTransform.getUpper3x3InverseTranspose());
-
- QT3DSVec3 dir(theUpper33.transform(QT3DSVec3(0, 0, -1)));
- dir.normalize();
- nearPlane.normal = dir;
- QT3DSVec3 theGlobalPos = m_Camera->GetGlobalPos() + m_Camera->m_ClipNear * dir;
- nearPlane.d = -(dir.dot(theGlobalPos));
- // the near plane's bbox edges are calculated in the clipping frustum's
- // constructor.
- m_ClippingFrustum = SClippingFrustum(m_ViewProjection, nearPlane);
- } else {
- m_ViewProjection = QT3DSMat44::createIdentity();
- }
-
- // Setup the light directions here.
-
- for (QT3DSU32 lightIdx = 0, lightEnd = m_Lights.size(); lightIdx < lightEnd;
- ++lightIdx) {
- m_LightDirections.push_back(m_Lights[lightIdx]->GetScalingCorrectDirection());
- }
-
- m_ModelContexts.clear();
- if (GetOffscreenRenderer() == false) {
- bool renderablesDirty =
- PrepareRenderablesForRender(m_ViewProjection,
- m_ClippingFrustum,
- theTextScaleFactor, thePrepResult.m_Flags);
- wasDataDirty = wasDataDirty || renderablesDirty;
- if (thePrepResult.m_Flags.RequiresStencilBuffer())
- thePrepResult.m_Flags.SetShouldRenderToTexture(true);
- } else {
- NVRenderRect theViewport =
- thePrepResult.GetLayerToPresentationViewport().ToIntegerRect();
- bool theScissor = true;
- NVRenderRect theScissorRect =
- thePrepResult.GetLayerToPresentationScissorRect().ToIntegerRect();
- // This happens here because if there are any fancy render steps
- IRenderList &theRenderList(m_Renderer.GetQt3DSContext().GetRenderList());
- NVRenderContext &theContext(m_Renderer.GetContext());
- SRenderListScopedProperty<bool> _listScissorEnabled(
- theRenderList, &IRenderList::IsScissorTestEnabled,
- &IRenderList::SetScissorTestEnabled, theScissor);
- SRenderListScopedProperty<NVRenderRect> _listViewport(
- theRenderList, &IRenderList::GetViewport, &IRenderList::SetViewport,
- theViewport);
- SRenderListScopedProperty<NVRenderRect> _listScissor(
- theRenderList, &IRenderList::GetScissor, &IRenderList::SetScissorRect,
- theScissorRect);
- // Some plugins don't use the render list so they need the actual gl context
- // setup.
- qt3ds::render::NVRenderContextScopedProperty<bool> __scissorEnabled(
- theContext, &NVRenderContext::IsScissorTestEnabled,
- &NVRenderContext::SetScissorTestEnabled, true);
- qt3ds::render::NVRenderContextScopedProperty<NVRenderRect> __scissorRect(
- theContext, &NVRenderContext::GetScissorRect,
- &NVRenderContext::SetScissorRect, theScissorRect);
- qt3ds::render::NVRenderContextScopedProperty<NVRenderRect> __viewportRect(
- theContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport,
- theViewport);
- SOffscreenRenderFlags theResult = m_LastFrameOffscreenRenderer->NeedsRender(
- CreateOffscreenRenderEnvironment(),
- m_Renderer.GetQt3DSContext().GetPresentationScaleFactor(), &m_Layer);
- wasDataDirty = wasDataDirty || theResult.m_HasChangedSinceLastFrame;
- }
- }
- }
- wasDirty = wasDirty || wasDataDirty;
- thePrepResult.m_Flags.SetWasDirty(wasDirty);
- thePrepResult.m_Flags.SetLayerDataDirty(wasDataDirty);
-
- m_LayerPrepResult = thePrepResult;
-
- // Per-frame cache of renderable objects post-sort.
- GetOpaqueRenderableObjects();
- // If layer depth test is false, this may also contain opaque objects.
- GetTransparentRenderableObjects();
-
- GetCameraDirection();
- }
-
- void SLayerRenderPreparationData::ResetForFrame()
- {
- m_TransparentObjects.clear_unsafe();
- m_OpaqueObjects.clear_unsafe();
- m_LayerPrepResult.setEmpty();
- // The check for if the camera is or is not null is used
- // to figure out if this layer was rendered at all.
- m_Camera = NULL;
- m_LastFrameOffscreenRenderer = NULL;
- m_IRenderWidgets.clear_unsafe();
- m_CameraDirection.setEmpty();
- m_LightDirections.clear_unsafe();
- m_RenderedOpaqueObjects.clear_unsafe();
- m_RenderedTransparentObjects.clear_unsafe();
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h
deleted file mode 100644
index 5b8d6e10..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h
+++ /dev/null
@@ -1,367 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDERER_IMPL_LAYER_RENDER_PREPARATION_DATA_H
-#define QT3DS_RENDERER_IMPL_LAYER_RENDER_PREPARATION_DATA_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSFlags.h"
-#include "Qt3DSRendererImplLayerRenderHelper.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderableObjects.h"
-#include "Qt3DSRenderClippingFrustum.h"
-#include "Qt3DSRenderResourceTexture2D.h"
-#include "Qt3DSOffscreenRenderManager.h"
-#include "Qt3DSRenderProfiler.h"
-#include "Qt3DSRenderShadowMap.h"
-#include "foundation/Qt3DSPool.h"
-#include "Qt3DSRenderableObjects.h"
-
-namespace qt3ds {
-namespace render {
- struct SLayerRenderData;
- class Qt3DSRendererImpl;
- struct SRenderableObject;
-
- struct LayerRenderPreparationResultFlagValues
- {
- enum Enum {
- // Was the data in this layer dirty (meaning re-render to texture, possibly)
- WasLayerDataDirty = 1,
- // Was the data in this layer dirty *or* this layer *or* any effect dirty.
- WasDirty = 1 << 1,
- // An effect or flag or rotation on the layer dictates this object should
- // render to the texture.
- ShouldRenderToTexture = 1 << 2,
- // Some effects require depth texturing, this should be set on the effect
- // instance.
- RequiresDepthTexture = 1 << 3,
-
- // Should create independent viewport
- // If we aren't rendering to texture we still may have width/height manipulations
- // that require our own viewport.
- ShouldCreateIndependentViewport = 1 << 4,
-
- // SSAO should be done in a separate pass
- // Note that having an AO pass necessitates a DepthTexture so this flag should
- // never be set without the RequiresDepthTexture flag as well.
- RequiresSsaoPass = 1 << 5,
-
- // if some light cause shadow
- // we need a separate per light shadow map pass
- RequiresShadowMapPass = 1 << 6,
-
- // Currently we use a stencil-cover algorithm to render bezier curves.
- RequiresStencilBuffer = 1 << 7
- };
- };
-
- struct SLayerRenderPreparationResultFlags
- : public NVFlags<LayerRenderPreparationResultFlagValues::Enum, QT3DSU32>
- {
- bool WasLayerDataDirty() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::WasLayerDataDirty);
- }
- void SetLayerDataDirty(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::WasLayerDataDirty);
- }
-
- bool WasDirty() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::WasDirty);
- }
- void SetWasDirty(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::WasDirty);
- }
-
- bool ShouldRenderToTexture() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::ShouldRenderToTexture);
- }
- void SetShouldRenderToTexture(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::ShouldRenderToTexture);
- }
-
- bool RequiresDepthTexture() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::RequiresDepthTexture);
- }
- void SetRequiresDepthTexture(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::RequiresDepthTexture);
- }
-
- bool ShouldCreateIndependentViewport() const
- {
- return this->operator&(
- LayerRenderPreparationResultFlagValues::ShouldCreateIndependentViewport);
- }
- void SetShouldCreateIndependentViewport(bool inValue)
- {
- clearOrSet(inValue,
- LayerRenderPreparationResultFlagValues::ShouldCreateIndependentViewport);
- }
-
- bool RequiresSsaoPass() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::RequiresSsaoPass);
- }
- void SetRequiresSsaoPass(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::RequiresSsaoPass);
- }
-
- bool RequiresShadowMapPass() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::RequiresShadowMapPass);
- }
- void SetRequiresShadowMapPass(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::RequiresShadowMapPass);
- }
-
- bool RequiresStencilBuffer() const
- {
- return this->operator&(LayerRenderPreparationResultFlagValues::RequiresStencilBuffer);
- }
- void SetRequiresStencilBuffer(bool inValue)
- {
- clearOrSet(inValue, LayerRenderPreparationResultFlagValues::RequiresStencilBuffer);
- }
- };
-
- struct SLayerRenderPreparationResult : public SLayerRenderHelper
- {
- SEffect *m_LastEffect;
- SLayerRenderPreparationResultFlags m_Flags;
- QT3DSU32 m_MaxAAPassIndex;
- SLayerRenderPreparationResult()
- : m_LastEffect(NULL)
- , m_MaxAAPassIndex(0)
- {
- }
- SLayerRenderPreparationResult(const SLayerRenderHelper &inHelper)
- : SLayerRenderHelper(inHelper)
- , m_LastEffect(NULL)
- , m_MaxAAPassIndex(0)
- {
- }
- };
-
- struct SRenderableNodeEntry
- {
- SNode *m_Node;
- TNodeLightEntryList m_Lights;
- SRenderableNodeEntry()
- : m_Node(NULL)
- {
- }
- SRenderableNodeEntry(SNode &inNode)
- : m_Node(&inNode)
- {
- }
- };
-
- struct SScopedLightsListScope
- {
- nvvector<SLight *> &m_LightsList;
- nvvector<QT3DSVec3> &m_LightDirList;
- QT3DSU32 m_ListOriginalSize;
- SScopedLightsListScope(nvvector<SLight *> &inLights, nvvector<QT3DSVec3> &inDestLightDirList,
- nvvector<QT3DSVec3> &inSrcLightDirList,
- TNodeLightEntryList &inScopedLights)
- : m_LightsList(inLights)
- , m_LightDirList(inDestLightDirList)
- , m_ListOriginalSize(m_LightsList.size())
- {
- for (TNodeLightEntryList::iterator iter = inScopedLights.begin(),
- end = inScopedLights.end();
- iter != end; ++iter) {
- m_LightsList.push_back(iter->m_Light);
- m_LightDirList.push_back(inSrcLightDirList[iter->m_LightIndex]);
- }
- }
- ~SScopedLightsListScope()
- {
- m_LightsList.resize(m_ListOriginalSize);
- m_LightDirList.resize(m_ListOriginalSize);
- }
- };
-
- struct SDefaultMaterialPreparationResult
- {
- SRenderableImage *m_FirstImage;
- QT3DSF32 m_Opacity;
- SRenderableObjectFlags m_RenderableFlags;
- SShaderDefaultMaterialKey m_MaterialKey;
- bool m_Dirty;
-
- SDefaultMaterialPreparationResult(SShaderDefaultMaterialKey inMaterialKey);
- };
-
- // Data used strictly in the render preparation step.
- struct SLayerRenderPreparationData
- {
- typedef void (*TRenderRenderableFunction)(SLayerRenderData &inData,
- SRenderableObject &inObject,
- const QT3DSVec2 &inCameraProps,
- TShaderFeatureSet inShaderFeatures,
- QT3DSU32 lightIndex, const SCamera &inCamera);
- typedef nvhash_map<SLight *, SNode *> TLightToNodeMap;
- typedef Pool<SNodeLightEntry, ForwardingAllocator> TNodeLightEntryPoolType;
-
- enum Enum {
- MAX_AA_LEVELS = 8,
- MAX_TEMPORAL_AA_LEVELS = 2,
- };
-
- SLayer &m_Layer;
- Qt3DSRendererImpl &m_Renderer;
- NVAllocatorCallback &m_Allocator;
- // List of nodes we can render, not all may be active. Found by doing a depth-first
- // search through m_FirstChild if length is zero.
-
- TNodeLightEntryPoolType m_RenderableNodeLightEntryPool;
- nvvector<SRenderableNodeEntry> m_RenderableNodes;
- TLightToNodeMap m_LightToNodeMap; // map of lights to nodes to cache if we have looked up a
- // given scoped light yet.
- // Built at the same time as the renderable nodes map.
- // these are processed so they are available when the shaders for the models
- // are being generated.
- nvvector<SNode *> m_CamerasAndLights;
-
- // Results of prepare for render.
- SCamera *m_Camera;
- nvvector<SLight *> m_Lights; // Only contains lights that are global.
- TRenderableObjectList m_OpaqueObjects;
- TRenderableObjectList m_TransparentObjects;
- // Sorted lists of the rendered objects. There may be other transforms applied so
- // it is simplest to duplicate the lists.
- TRenderableObjectList m_RenderedOpaqueObjects;
- TRenderableObjectList m_RenderedTransparentObjects;
- QT3DSMat44 m_ViewProjection;
- SClippingFrustum m_ClippingFrustum;
- Option<SLayerRenderPreparationResult> m_LayerPrepResult;
- // Widgets drawn at particular times during the rendering process
- nvvector<IRenderWidget *> m_IRenderWidgets;
- Option<QT3DSVec3> m_CameraDirection;
- // Scoped lights need a level of indirection into a light direction list. The source light
- // directions list is as long as there are lights on the layer. It holds invalid
- // information for
- // any lights that are not both active and scoped; but the relative position for a given
- // light
- // in this list is completely constant and immutable; this relative position is saved on a
- // structure
- // and used when looking up the light direction for a given light.
- nvvector<QT3DSVec3> m_SourceLightDirections;
- nvvector<QT3DSVec3> m_LightDirections;
- TModelContextPtrList m_ModelContexts;
- NVScopedRefCounted<IOffscreenRenderer> m_LastFrameOffscreenRenderer;
-
- eastl::vector<SShaderPreprocessorFeature> m_Features;
- CRegisteredString m_CGLightingFeatureName;
- bool m_FeaturesDirty;
- size_t m_FeatureSetHash;
- bool m_TooManyLightsError;
-
- // shadow mapps
- NVScopedRefCounted<Qt3DSShadowMap> m_ShadowMapManager;
-
- SLayerRenderPreparationData(SLayer &inLayer, Qt3DSRendererImpl &inRenderer);
- virtual ~SLayerRenderPreparationData();
- bool GetOffscreenRenderer();
- bool GetShadowMapManager();
- bool NeedsWidgetTexture() const;
-
- SShaderDefaultMaterialKey GenerateLightingKey(DefaultMaterialLighting::Enum inLightingType);
-
- void PrepareImageForRender(SImage &inImage, ImageMapTypes::Enum inMapType,
- SRenderableImage *&ioFirstImage, SRenderableImage *&ioNextImage,
- SRenderableObjectFlags &ioFlags,
- SShaderDefaultMaterialKey &ioGeneratedShaderKey,
- QT3DSU32 inImageIndex);
-
- SDefaultMaterialPreparationResult
- PrepareDefaultMaterialForRender(SDefaultMaterial &inMaterial,
- SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity,
- bool inClearMaterialFlags);
-
- SDefaultMaterialPreparationResult
- PrepareCustomMaterialForRender(SCustomMaterial &inMaterial,
- SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity);
-
- bool PrepareModelForRender(SModel &inModel, const QT3DSMat44 &inViewProjection,
- const Option<SClippingFrustum> &inClipFrustum,
- TNodeLightEntryList &inScopedLights);
-
- bool PrepareTextForRender(SText &inText, const QT3DSMat44 &inViewProjection,
- QT3DSF32 inTextScaleFactor,
- SLayerRenderPreparationResultFlags &ioFlags);
- bool PreparePathForRender(SPath &inPath, const QT3DSMat44 &inViewProjection,
- const Option<SClippingFrustum> &inClipFrustum,
- SLayerRenderPreparationResultFlags &ioFlags);
- // Helper function used during PRepareForRender and PrepareAndRender
- bool PrepareRenderablesForRender(const QT3DSMat44 &inViewProjection,
- const Option<SClippingFrustum> &inClipFrustum,
- QT3DSF32 inTextScaleFactor,
- SLayerRenderPreparationResultFlags &ioFlags);
-
- // returns true if this object will render something different than it rendered the last
- // time.
- virtual void PrepareForRender(const QSize &inViewportDimensions);
- bool CheckLightProbeDirty(SImage &inLightProbe);
- void AddRenderWidget(IRenderWidget &inWidget);
- void SetShaderFeature(const char *inName, bool inValue);
- void SetShaderFeature(CRegisteredString inName, bool inValue);
- NVConstDataRef<SShaderPreprocessorFeature> GetShaderFeatureSet();
- size_t GetShaderFeatureSetHash();
- // The graph object is not const because this traversal updates dirty state on the objects.
- eastl::pair<bool, SGraphObject *> ResolveReferenceMaterial(SGraphObject *inMaterial);
-
- QT3DSVec3 GetCameraDirection();
- // Per-frame cache of renderable objects post-sort.
- NVDataRef<SRenderableObject *> GetOpaqueRenderableObjects();
- // If layer depth test is false, this may also contain opaque objects.
- NVDataRef<SRenderableObject *> GetTransparentRenderableObjects();
-
- virtual void ResetForFrame();
-
- // The render list and gl context are setup for what the embedded item will
- // need.
- virtual SOffscreenRendererEnvironment CreateOffscreenRenderEnvironment() = 0;
-
- virtual IRenderTask &CreateRenderToTextureRunnable() = 0;
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp
deleted file mode 100644
index a3d3fab5..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp
+++ /dev/null
@@ -1,3007 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRendererImpl.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSRenderLight.h"
-#include "Qt3DSRenderContextCore.h"
-#include "Qt3DSRenderShaderCache.h"
-#include "Qt3DSRenderDynamicObjectSystem.h"
-#include "Qt3DSRenderShaderCodeGeneratorV2.h"
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-#include "Qt3DSVertexPipelineImpl.h"
-
-// This adds support for the depth buffers in the shader so we can do depth
-// texture-based effects.
-#define QT3DS_RENDER_SUPPORT_DEPTH_TEXTURE 1
-
-namespace qt3ds {
-namespace render {
-
- void STextShader::Render(NVRenderTexture2D &inTexture,
- const STextScaleAndOffset &inScaleAndOffset, const QT3DSVec4 &inTextColor,
- const QT3DSMat44 &inMVP, const QT3DSVec2 &inCameraVec,
- NVRenderContext &inRenderContext,
- NVRenderInputAssembler &inInputAssemblerBuffer, QT3DSU32 count,
- const STextTextureDetails &inTextTextureDetails,
- const QT3DSVec3 &inBackgroundColor)
- {
- inRenderContext.SetCullingEnabled(false);
- inRenderContext.SetActiveShader(&m_Shader);
- m_MVP.Set(inMVP);
- m_Sampler.Set(&inTexture);
- m_TextColor.Set(inTextColor);
- m_Dimensions.Set(QT3DSVec4(inScaleAndOffset.m_TextScale.x, inScaleAndOffset.m_TextScale.y,
- inScaleAndOffset.m_TextOffset.x, inScaleAndOffset.m_TextOffset.y));
- m_CameraProperties.Set(inCameraVec);
- STextureDetails theTextureDetails = inTexture.GetTextureDetails();
- QT3DSF32 theWidthScale =
- (QT3DSF32)inTextTextureDetails.m_TextWidth / (QT3DSF32)theTextureDetails.m_Width;
- QT3DSF32 theHeightScale =
- (QT3DSF32)inTextTextureDetails.m_TextHeight / (QT3DSF32)theTextureDetails.m_Height;
- m_BackgroundColor.Set(inBackgroundColor);
-
- m_TextDimensions.Set(
- QT3DSVec3(theWidthScale, theHeightScale, inTextTextureDetails.m_FlipY ? 1.0f : 0.0f));
- inRenderContext.SetInputAssembler(&inInputAssemblerBuffer);
- inRenderContext.Draw(NVRenderDrawMode::Triangles, count, 0);
- }
-
- void STextShader::RenderPath(NVRenderPathFontItem &inPathFontItem,
- NVRenderPathFontSpecification &inPathFontSpec,
- const STextScaleAndOffset &inScaleAndOffset,
- const QT3DSVec4 &inTextColor, const QT3DSMat44 &inViewProjection,
- const QT3DSMat44 &inModel, const QT3DSVec2 &,
- NVRenderContext &inRenderContext,
- const STextTextureDetails &inTextTextureDetails,
- const QT3DSVec3 &inBackgroundColor)
- {
- qt3ds::render::NVRenderBoolOp::Enum theDepthFunction = inRenderContext.GetDepthFunction();
- bool isDepthEnabled = inRenderContext.IsDepthTestEnabled();
- bool isStencilEnabled = inRenderContext.IsStencilTestEnabled();
- bool isDepthWriteEnabled = inRenderContext.IsDepthWriteEnabled();
- qt3ds::render::NVRenderStencilFunctionArgument theArg(qt3ds::render::NVRenderBoolOp::NotEqual, 0,
- 0xFF);
- qt3ds::render::NVRenderStencilOperationArgument theOpArg(qt3ds::render::NVRenderStencilOp::Keep,
- qt3ds::render::NVRenderStencilOp::Keep,
- qt3ds::render::NVRenderStencilOp::Zero);
- NVScopedRefCounted<NVRenderDepthStencilState> depthStencilState =
- inRenderContext.CreateDepthStencilState(isDepthEnabled, isDepthWriteEnabled,
- theDepthFunction, false, theArg, theArg,
- theOpArg, theOpArg);
-
- inRenderContext.SetActiveShader(NULL);
- inRenderContext.SetCullingEnabled(false);
-
- inRenderContext.SetDepthStencilState(depthStencilState);
-
- // setup transform
- QT3DSMat44 offsetMatrix = QT3DSMat44::createIdentity();
- offsetMatrix.setPosition(QT3DSVec3(
- inScaleAndOffset.m_TextOffset.x - (QT3DSF32)inTextTextureDetails.m_TextWidth / 2.0f,
- inScaleAndOffset.m_TextOffset.y - (QT3DSF32)inTextTextureDetails.m_TextHeight / 2.0f,
- 0.0));
-
- QT3DSMat44 pathMatrix = inPathFontItem.GetTransform();
-
- inRenderContext.SetPathProjectionMatrix(inViewProjection);
- inRenderContext.SetPathModelViewMatrix(inModel * offsetMatrix * pathMatrix);
-
- // first pass
- inPathFontSpec.StencilFillPathInstanced(inPathFontItem);
-
- // second pass
- inRenderContext.SetActiveProgramPipeline(m_ProgramPipeline);
- m_TextColor.Set(inTextColor);
- m_BackgroundColor.Set(inBackgroundColor);
-
- inRenderContext.SetStencilTestEnabled(true);
- inPathFontSpec.CoverFillPathInstanced(inPathFontItem);
-
- inRenderContext.SetStencilTestEnabled(isStencilEnabled);
- inRenderContext.SetDepthFunction(theDepthFunction);
-
- inRenderContext.SetActiveProgramPipeline(NULL);
- }
-
- void STextShader::Render2D(NVRenderTexture2D &inTexture, const QT3DSVec4 &inTextColor,
- const QT3DSMat44 &inMVP, NVRenderContext &inRenderContext,
- NVRenderInputAssembler &inInputAssemblerBuffer, QT3DSU32 count,
- QT3DSVec2 inVertexOffsets)
- {
- // inRenderContext.SetCullingEnabled( false );
- inRenderContext.SetBlendingEnabled(true);
- inRenderContext.SetDepthWriteEnabled(false);
- inRenderContext.SetDepthTestEnabled(false);
-
- inRenderContext.SetActiveShader(&m_Shader);
-
- qt3ds::render::NVRenderBlendFunctionArgument blendFunc(
- NVRenderSrcBlendFunc::SrcAlpha, NVRenderDstBlendFunc::OneMinusSrcAlpha,
- NVRenderSrcBlendFunc::One, NVRenderDstBlendFunc::One);
- qt3ds::render::NVRenderBlendEquationArgument blendEqu(NVRenderBlendEquation::Add,
- NVRenderBlendEquation::Add);
-
- inRenderContext.SetBlendFunction(blendFunc);
- inRenderContext.SetBlendEquation(blendEqu);
-
- m_MVP.Set(inMVP);
- m_Sampler.Set(&inTexture);
- m_TextColor.Set(inTextColor);
- m_VertexOffsets.Set(inVertexOffsets);
-
- inRenderContext.SetInputAssembler(&inInputAssemblerBuffer);
- inRenderContext.Draw(NVRenderDrawMode::Triangles, count, 0);
- }
-
- using eastl::make_pair;
-
- static inline void AddVertexDepth(SShaderVertexCodeGenerator &vertexShader)
- {
- // near plane, far plane
- vertexShader.AddInclude("viewProperties.glsllib");
- vertexShader.AddVarying("vertex_depth", "float");
- // the w coordinate is the unormalized distance to the object from the camera
- // We want the normalized distance, with 0 representing the far plane and 1 representing
- // the near plane, of the object in the vertex depth variable.
-
- vertexShader << "\tvertex_depth = calculateVertexDepth( camera_properties, gl_Position );"
- << Endl;
- }
-
- // Helper implements the vertex pipeline for mesh subsets when bound to the default material.
- // Should be completely possible to use for custom materials with a bit of refactoring.
- struct SSubsetMaterialVertexPipeline : public SVertexPipelineImpl
- {
- Qt3DSRendererImpl &m_Renderer;
- SSubsetRenderable &m_Renderable;
- TessModeValues::Enum m_TessMode;
-
- SSubsetMaterialVertexPipeline(Qt3DSRendererImpl &renderer, SSubsetRenderable &renderable,
- bool inWireframeRequested)
- : SVertexPipelineImpl(renderer.GetQt3DSContext().GetAllocator(),
- renderer.GetQt3DSContext().GetDefaultMaterialShaderGenerator(),
- renderer.GetQt3DSContext().GetShaderProgramGenerator(),
- renderer.GetQt3DSContext().GetStringTable(), false)
- , m_Renderer(renderer)
- , m_Renderable(renderable)
- , m_TessMode(TessModeValues::NoTess)
- {
- if (m_Renderer.GetContext().IsTessellationSupported()) {
- m_TessMode = renderable.m_TessellationMode;
- }
-
- if (m_Renderer.GetContext().IsGeometryStageSupported()
- && m_TessMode != TessModeValues::NoTess)
- m_Wireframe = inWireframeRequested;
- }
-
- void InitializeTessControlShader()
- {
- if (m_TessMode == TessModeValues::NoTess
- || ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl) == NULL)
- return;
-
- IShaderStageGenerator &tessCtrlShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
-
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
-
- SetupTessIncludes(ShaderGeneratorStages::TessControl, m_TessMode);
-
- tessCtrlShader.Append("void main() {\n");
-
- tessCtrlShader.Append("\tctWorldPos[0] = varWorldPos[0];");
- tessCtrlShader.Append("\tctWorldPos[1] = varWorldPos[1];");
- tessCtrlShader.Append("\tctWorldPos[2] = varWorldPos[2];");
-
- if (m_TessMode == TessModeValues::TessPhong
- || m_TessMode == TessModeValues::TessNPatch) {
- tessCtrlShader.Append("\tctNorm[0] = varObjectNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = varObjectNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = varObjectNormal[2];");
- }
- if (m_TessMode == TessModeValues::TessNPatch) {
- tessCtrlShader.Append("\tctTangent[0] = varTangent[0];");
- tessCtrlShader.Append("\tctTangent[1] = varTangent[1];");
- tessCtrlShader.Append("\tctTangent[2] = varTangent[2];");
- }
-
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- }
- void InitializeTessEvaluationShader()
- {
- if (m_TessMode == TessModeValues::NoTess
- || ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval) == NULL)
- return;
-
- IShaderStageGenerator &tessEvalShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- SetupTessIncludes(ShaderGeneratorStages::TessEval, m_TessMode);
-
- if (m_TessMode == TessModeValues::TessLinear)
- m_Renderer.GetQt3DSContext()
- .GetDefaultMaterialShaderGenerator()
- .AddDisplacementImageUniforms(tessEvalShader, m_DisplacementIdx,
- m_DisplacementImage);
-
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddUniform("normal_matrix", "mat3");
-
- tessEvalShader.Append("void main() {");
-
- if (m_TessMode == TessModeValues::TessNPatch) {
- tessEvalShader.Append("\tctNorm[0] = varObjectNormalTC[0];");
- tessEvalShader.Append("\tctNorm[1] = varObjectNormalTC[1];");
- tessEvalShader.Append("\tctNorm[2] = varObjectNormalTC[2];");
-
- tessEvalShader.Append("\tctTangent[0] = varTangentTC[0];");
- tessEvalShader.Append("\tctTangent[1] = varTangentTC[1];");
- tessEvalShader.Append("\tctTangent[2] = varTangentTC[2];");
- }
-
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- }
-
- void FinalizeTessControlShader()
- {
- IShaderStageGenerator &tessCtrlShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- // add varyings we must pass through
- typedef TStrTableStrMap::const_iterator TParamIter;
- for (TParamIter iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- tessCtrlShader << "\t" << iter->first.c_str()
- << "TC[gl_InvocationID] = " << iter->first.c_str()
- << "[gl_InvocationID];\n";
- }
- }
-
- void FinalizeTessEvaluationShader()
- {
- IShaderStageGenerator &tessEvalShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- eastl::string outExt("");
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry)
- outExt = "TE";
-
- // add varyings we must pass through
- typedef TStrTableStrMap::const_iterator TParamIter;
- if (m_TessMode == TessModeValues::TessNPatch) {
- for (TParamIter iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- tessEvalShader << "\t" << iter->first.c_str() << outExt.c_str()
- << " = gl_TessCoord.z * " << iter->first.c_str() << "TC[0] + ";
- tessEvalShader << "gl_TessCoord.x * " << iter->first.c_str() << "TC[1] + ";
- tessEvalShader << "gl_TessCoord.y * " << iter->first.c_str() << "TC[2];\n";
- }
-
- // transform the normal
- if (m_GenerationFlags & GenerationFlagValues::WorldNormal)
- tessEvalShader << "\n\tvarNormal" << outExt.c_str()
- << " = normalize(normal_matrix * teNorm);\n";
- // transform the tangent
- if (m_GenerationFlags & GenerationFlagValues::TangentBinormal) {
- tessEvalShader << "\n\tvarTangent" << outExt.c_str()
- << " = normalize(normal_matrix * teTangent);\n";
- // transform the binormal
- tessEvalShader << "\n\tvarBinormal" << outExt.c_str()
- << " = normalize(normal_matrix * teBinormal);\n";
- }
- } else {
- for (TParamIter iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- tessEvalShader << "\t" << iter->first.c_str() << outExt.c_str()
- << " = gl_TessCoord.x * " << iter->first.c_str() << "TC[0] + ";
- tessEvalShader << "gl_TessCoord.y * " << iter->first.c_str() << "TC[1] + ";
- tessEvalShader << "gl_TessCoord.z * " << iter->first.c_str() << "TC[2];\n";
- }
-
- // displacement mapping makes only sense with linear tessellation
- if (m_TessMode == TessModeValues::TessLinear && m_DisplacementImage) {
- IDefaultMaterialShaderGenerator::SImageVariableNames theNames =
- m_Renderer.GetQt3DSContext()
- .GetDefaultMaterialShaderGenerator()
- .GetImageVariableNames(m_DisplacementIdx);
- tessEvalShader << "\tpos.xyz = defaultMaterialFileDisplacementTexture( "
- << theNames.m_ImageSampler << ", displaceAmount, "
- << theNames.m_ImageFragCoords << outExt.c_str();
- tessEvalShader << ", varObjectNormal" << outExt.c_str() << ", pos.xyz );"
- << Endl;
- tessEvalShader << "\tvarWorldPos" << outExt.c_str()
- << "= (model_matrix * pos).xyz;" << Endl;
- tessEvalShader << "\tvarViewVector" << outExt.c_str()
- << "= normalize(camera_position - "
- << "varWorldPos" << outExt.c_str() << ");" << Endl;
- }
-
- // transform the normal
- tessEvalShader << "\n\tvarNormal" << outExt.c_str()
- << " = normalize(normal_matrix * varObjectNormal" << outExt.c_str()
- << ");\n";
- }
-
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;\n");
- }
-
- void BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) override
- {
- m_DisplacementIdx = displacementImageIdx;
- m_DisplacementImage = displacementImage;
-
- TShaderGeneratorStageFlags theStages(IShaderProgramGenerator::DefaultFlags());
- if (m_TessMode != TessModeValues::NoTess) {
- theStages |= ShaderGeneratorStages::TessControl;
- theStages |= ShaderGeneratorStages::TessEval;
- }
- if (m_Wireframe) {
- theStages |= ShaderGeneratorStages::Geometry;
- }
- ProgramGenerator().BeginProgram(theStages);
- if (m_TessMode != TessModeValues::NoTess) {
- InitializeTessControlShader();
- InitializeTessEvaluationShader();
- }
- if (m_Wireframe) {
- InitializeWireframeGeometryShader();
- }
- // Open up each stage.
- IShaderStageGenerator &vertexShader(Vertex());
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader << "void main()" << Endl << "{" << Endl;
- vertexShader << "\tvec3 uTransform;" << Endl;
- vertexShader << "\tvec3 vTransform;" << Endl;
-
- if (displacementImage) {
- GenerateUVCoords();
- MaterialGenerator().GenerateImageUVCoordinates(*this, displacementImageIdx, 0,
- *displacementImage);
- if (!HasTessellation()) {
- vertexShader.AddUniform("displaceAmount", "float");
- // we create the world position setup here
- // because it will be replaced with the displaced position
- SetCode(GenerationFlagValues::WorldPosition);
- vertexShader.AddUniform("model_matrix", "mat4");
-
- vertexShader.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
- IDefaultMaterialShaderGenerator::SImageVariableNames theVarNames =
- MaterialGenerator().GetImageVariableNames(displacementImageIdx);
-
- vertexShader.AddUniform(theVarNames.m_ImageSampler, "sampler2D");
-
- vertexShader
- << "\tvec3 displacedPos = defaultMaterialFileDisplacementTexture( "
- << theVarNames.m_ImageSampler << ", displaceAmount, "
- << theVarNames.m_ImageFragCoords << ", attr_norm, attr_pos );" << Endl;
- AddInterpolationParameter("varWorldPos", "vec3");
- vertexShader.Append("\tvec3 local_model_world_position = (model_matrix * "
- "vec4(displacedPos, 1.0)).xyz;");
- AssignOutput("varWorldPos", "local_model_world_position");
- }
- }
- // for tessellation we pass on the position in object coordinates
- // Also note that gl_Position is written in the tess eval shader
- if (HasTessellation())
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- else {
- vertexShader.AddUniform("model_view_projection", "mat4");
- if (displacementImage)
- vertexShader.Append(
- "\tgl_Position = model_view_projection * vec4(displacedPos, 1.0);");
- else
- vertexShader.Append(
- "\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- }
-
- if (HasTessellation()) {
- GenerateWorldPosition();
- GenerateWorldNormal();
- GenerateObjectNormal();
- GenerateVarTangentAndBinormal();
- }
- }
-
- void BeginFragmentGeneration() override
- {
- Fragment().AddUniform("material_diffuse", "vec4");
- Fragment() << "void main()" << Endl << "{" << Endl;
- // We do not pass object opacity through the pipeline.
- Fragment() << "\tfloat object_opacity = material_diffuse.a;" << Endl;
- }
-
- void AssignOutput(const char8_t *inVarName, const char8_t *inVarValue) override
- {
- Vertex() << "\t" << inVarName << " = " << inVarValue << ";\n";
- }
- void DoGenerateUVCoords(QT3DSU32 inUVSet = 0) override
- {
- QT3DS_ASSERT(inUVSet == 0 || inUVSet == 1);
-
- if (inUVSet == 0) {
- Vertex().AddIncoming("attr_uv0", "vec2");
- Vertex() << "\tvarTexCoord0 = attr_uv0;" << Endl;
- } else if (inUVSet == 1) {
- Vertex().AddIncoming("attr_uv1", "vec2");
- Vertex() << "\tvarTexCoord1 = attr_uv1;" << Endl;
- }
- }
-
- // fragment shader expects varying vertex normal
- // lighting in vertex pipeline expects world_normal
- void DoGenerateWorldNormal() override
- {
- IShaderStageGenerator &vertexGenerator(Vertex());
- vertexGenerator.AddIncoming("attr_norm", "vec3");
- vertexGenerator.AddUniform("normal_matrix", "mat3");
- if (HasTessellation() == false) {
- vertexGenerator.Append(
- "\tvec3 world_normal = normalize(normal_matrix * attr_norm).xyz;");
- vertexGenerator.Append("\tvarNormal = world_normal;");
- }
- }
- void DoGenerateObjectNormal() override
- {
- AddInterpolationParameter("varObjectNormal", "vec3");
- Vertex().Append("\tvarObjectNormal = attr_norm;");
- }
- void DoGenerateWorldPosition() override
- {
- Vertex().Append(
- "\tvec3 local_model_world_position = (model_matrix * vec4(attr_pos, 1.0)).xyz;");
- AssignOutput("varWorldPos", "local_model_world_position");
- }
-
- void DoGenerateVarTangentAndBinormal() override
- {
- Vertex().AddIncoming("attr_textan", "vec3");
- Vertex().AddIncoming("attr_binormal", "vec3");
-
- bool hasNPatchTessellation = m_TessMode == TessModeValues::TessNPatch;
-
- if (!hasNPatchTessellation) {
- Vertex() << "\tvarTangent = normal_matrix * attr_textan;" << Endl
- << "\tvarBinormal = normal_matrix * attr_binormal;" << Endl;
- } else {
- Vertex() << "\tvarTangent = attr_textan;" << Endl
- << "\tvarBinormal = attr_binormal;" << Endl;
- }
- }
-
- void DoGenerateVertexColor() override
- {
- Vertex().AddIncoming("attr_color", "vec3");
- Vertex().Append("\tvarColor = attr_color;");
- }
-
- void EndVertexGeneration(bool) override
- {
-
- if (HasTessellation()) {
- // finalize tess control shader
- FinalizeTessControlShader();
- // finalize tess evaluation shader
- FinalizeTessEvaluationShader();
-
- TessControl().Append("}");
- TessEval().Append("}");
- }
- if (m_Wireframe) {
- // finalize geometry shader
- FinalizeWireframeGeometryShader();
- Geometry().Append("}");
- }
- Vertex().Append("}");
- }
-
- void EndFragmentGeneration(bool) override { Fragment().Append("}"); }
-
- void AddInterpolationParameter(const char8_t *inName, const char8_t *inType) override
- {
- m_InterpolationParameters.insert(eastl::make_pair(Str(inName), Str(inType)));
- Vertex().AddOutgoing(inName, inType);
- Fragment().AddIncoming(inName, inType);
- if (HasTessellation()) {
- eastl::string nameBuilder(inName);
- nameBuilder.append("TC");
- TessControl().AddOutgoing(nameBuilder.c_str(), inType);
-
- nameBuilder.assign(inName);
- if (ProgramGenerator().GetEnabledStages() & ShaderGeneratorStages::Geometry) {
- nameBuilder.append("TE");
- Geometry().AddOutgoing(inName, inType);
- }
- TessEval().AddOutgoing(nameBuilder.c_str(), inType);
- }
- }
-
- IShaderStageGenerator &ActiveStage() override { return Vertex(); }
- };
-
- NVRenderShaderProgram *Qt3DSRendererImpl::GenerateShader(SSubsetRenderable &inRenderable,
- TShaderFeatureSet inFeatureSet)
- {
- // build a string that allows us to print out the shader we are generating to the log.
- // This is time consuming but I feel like it doesn't happen all that often and is very
- // useful to users
- // looking at the log file.
- QLatin1String logPrefix("mesh subset pipeline-- ");
-
- m_GeneratedShaderString.clear();
- m_GeneratedShaderString.assign(logPrefix.data());
-
- SShaderDefaultMaterialKey theKey(inRenderable.m_ShaderDescription);
- theKey.ToString(m_GeneratedShaderString, m_DefaultMaterialShaderKeyProperties);
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey =
- m_qt3dsContext.GetStringTable().RegisterStr(m_GeneratedShaderString.c_str());
- NVRenderShaderProgram *cachedProgram = theCache.GetProgram(theCacheKey, inFeatureSet);
- if (cachedProgram)
- return cachedProgram;
-
- SSubsetMaterialVertexPipeline pipeline(
- *this, inRenderable,
- m_DefaultMaterialShaderKeyProperties.m_WireframeMode.GetValue(theKey));
- return m_qt3dsContext.GetDefaultMaterialShaderGenerator().GenerateShader(
- inRenderable.m_Material, inRenderable.m_ShaderDescription, pipeline, inFeatureSet,
- m_CurrentLayer->m_Lights, inRenderable.m_FirstImage,
- inRenderable.m_RenderableFlags.HasTransparency(),
- logPrefix.data());
- }
-
- // -------------- Special cases for shadows -------------------
-
- SRenderableDepthPrepassShader *
- Qt3DSRendererImpl::GetParaboloidDepthShader(TessModeValues::Enum inTessMode)
- {
- if (!m_qt3dsContext.GetRenderContext().IsTessellationSupported()
- || inTessMode == TessModeValues::NoTess) {
- return GetParaboloidDepthNoTessShader();
- } else if (inTessMode == TessModeValues::TessLinear) {
- return GetParaboloidDepthTessLinearShader();
- } else if (inTessMode == TessModeValues::TessPhong) {
- return GetParaboloidDepthTessPhongShader();
- } else if (inTessMode == TessModeValues::TessNPatch) {
- return GetParaboloidDepthTessNPatchShader();
- }
-
- return GetParaboloidDepthNoTessShader();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetParaboloidDepthNoTessShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_ParaboloidDepthShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("paraboloid depth shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- IShaderProgramGenerator::OutputParaboloidDepthVertex(vertexShader);
- IShaderProgramGenerator::OutputParaboloidDepthFragment(fragmentShader);
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetParaboloidDepthTessLinearShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_ParaboloidDepthTessLinearShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("paraboloid depth tess linear shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- // vertexShader.AddOutgoing("world_pos", "vec4");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- // vertexShader.Append("\tworld_pos = attr_pos;");
- vertexShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationLinear.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- // tessCtrlShader.AddOutgoing( "outUVTC", "vec2" );
- // tessCtrlShader.AddOutgoing( "outNormalTC", "vec3" );
- tessCtrlShader.Append("void main() {\n");
- // tessCtrlShader.Append("\tctWorldPos[0] = outWorldPos[0];");
- // tessCtrlShader.Append("\tctWorldPos[1] = outWorldPos[1];");
- // tessCtrlShader.Append("\tctWorldPos[2] = outWorldPos[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationLinear.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- IShaderProgramGenerator::OutputParaboloidDepthTessEval(tessEvalShader);
- tessEvalShader.Append("}");
-
- IShaderProgramGenerator::OutputParaboloidDepthFragment(fragmentShader);
- }
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetParaboloidDepthTessPhongShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_ParaboloidDepthTessPhongShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("paraboloid depth tess phong shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- // vertexShader.AddOutgoing("world_pos", "vec4");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- // vertexShader.Append("\tworld_pos = attr_pos;");
- vertexShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationPhong.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- // tessCtrlShader.AddOutgoing( "outUVTC", "vec2" );
- // tessCtrlShader.AddOutgoing( "outNormalTC", "vec3" );
- tessCtrlShader.Append("void main() {\n");
- // tessCtrlShader.Append("\tctWorldPos[0] = outWorldPos[0];");
- // tessCtrlShader.Append("\tctWorldPos[1] = outWorldPos[1];");
- // tessCtrlShader.Append("\tctWorldPos[2] = outWorldPos[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationPhong.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- IShaderProgramGenerator::OutputParaboloidDepthTessEval(tessEvalShader);
- tessEvalShader.Append("}");
-
- IShaderProgramGenerator::OutputParaboloidDepthFragment(fragmentShader);
- }
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetParaboloidDepthTessNPatchShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_ParaboloidDepthTessNPatchShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("paraboloid depth tess NPatch shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- // vertexShader.AddOutgoing("world_pos", "vec4");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- // vertexShader.Append("\tworld_pos = attr_pos;");
- vertexShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationNPatch.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- // tessCtrlShader.AddOutgoing( "outUVTC", "vec2" );
- // tessCtrlShader.AddOutgoing( "outNormalTC", "vec3" );
- tessCtrlShader.Append("void main() {\n");
- // tessCtrlShader.Append("\tctWorldPos[0] = outWorldPos[0];");
- // tessCtrlShader.Append("\tctWorldPos[1] = outWorldPos[1];");
- // tessCtrlShader.Append("\tctWorldPos[2] = outWorldPos[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationNPatch.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- IShaderProgramGenerator::OutputParaboloidDepthTessEval(tessEvalShader);
- tessEvalShader.Append("}");
-
- IShaderProgramGenerator::OutputParaboloidDepthFragment(fragmentShader);
- }
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *
- Qt3DSRendererImpl::GetCubeShadowDepthShader(TessModeValues::Enum inTessMode)
- {
- if (!m_qt3dsContext.GetRenderContext().IsTessellationSupported()
- || inTessMode == TessModeValues::NoTess) {
- return GetCubeDepthNoTessShader();
- } else if (inTessMode == TessModeValues::TessLinear) {
- return GetCubeDepthTessLinearShader();
- } else if (inTessMode == TessModeValues::TessPhong) {
- return GetCubeDepthTessPhongShader();
- } else if (inTessMode == TessModeValues::TessNPatch) {
- return GetCubeDepthTessNPatchShader();
- }
-
- return GetCubeDepthNoTessShader();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetCubeDepthNoTessShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_CubemapDepthShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("cubemap face depth shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
-
- if (!depthShaderProgram) {
- // GetProgramGenerator().BeginProgram(
- // TShaderGeneratorStageFlags(ShaderGeneratorStages::Vertex |
- // ShaderGeneratorStages::Fragment | ShaderGeneratorStages::Geometry) );
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- // IShaderStageGenerator& geometryShader( *GetProgramGenerator().GetStage(
- // ShaderGeneratorStages::Geometry ) );
-
- IShaderProgramGenerator::OutputCubeFaceDepthVertex(vertexShader);
- // IShaderProgramGenerator::OutputCubeFaceDepthGeometry( geometryShader );
- IShaderProgramGenerator::OutputCubeFaceDepthFragment(fragmentShader);
- } else if (theCache.IsShaderCachePersistenceEnabled()) {
- // we load from shader cache set default shader stages
- GetProgramGenerator().BeginProgram();
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetCubeDepthTessLinearShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_CubemapDepthTessLinearShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("cubemap face depth linear tess shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
-
- if (!depthShaderProgram) {
- // GetProgramGenerator().BeginProgram(
- // TShaderGeneratorStageFlags(ShaderGeneratorStages::Vertex |
- // ShaderGeneratorStages::Fragment | ShaderGeneratorStages::Geometry) );
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- // IShaderStageGenerator& geometryShader( *GetProgramGenerator().GetStage(
- // ShaderGeneratorStages::Geometry ) );
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("}");
-
- // IShaderProgramGenerator::OutputCubeFaceDepthGeometry( geometryShader );
- IShaderProgramGenerator::OutputCubeFaceDepthFragment(fragmentShader);
-
- tessCtrlShader.AddInclude("tessellationLinear.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationLinear.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddUniform("model_matrix", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tworld_pos = model_matrix * pos;");
- tessEvalShader.Append("\tworld_pos /= world_pos.w;");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
- tessEvalShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetCubeDepthTessPhongShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_CubemapDepthTessPhongShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("cubemap face depth phong tess shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
-
- if (!depthShaderProgram) {
- // GetProgramGenerator().BeginProgram(
- // TShaderGeneratorStageFlags(ShaderGeneratorStages::Vertex |
- // ShaderGeneratorStages::Fragment | ShaderGeneratorStages::Geometry) );
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- // IShaderStageGenerator& geometryShader( *GetProgramGenerator().GetStage(
- // ShaderGeneratorStages::Geometry ) );
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddIncoming("attr_norm", "vec3");
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("}");
-
- // IShaderProgramGenerator::OutputCubeFaceDepthGeometry( geometryShader );
- IShaderProgramGenerator::OutputCubeFaceDepthFragment(fragmentShader);
-
- tessCtrlShader.AddInclude("tessellationPhong.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctNorm[0] = outNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = outNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationPhong.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddUniform("model_matrix", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tworld_pos = model_matrix * pos;");
- tessEvalShader.Append("\tworld_pos /= world_pos.w;");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
- tessEvalShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetCubeDepthTessNPatchShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_CubemapDepthTessNPatchShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("cubemap face depth npatch tess shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
-
- if (!depthShaderProgram) {
- // GetProgramGenerator().BeginProgram(
- // TShaderGeneratorStageFlags(ShaderGeneratorStages::Vertex |
- // ShaderGeneratorStages::Fragment | ShaderGeneratorStages::Geometry) );
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- // IShaderStageGenerator& geometryShader( *GetProgramGenerator().GetStage(
- // ShaderGeneratorStages::Geometry ) );
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddIncoming("attr_norm", "vec3");
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("}");
-
- // IShaderProgramGenerator::OutputCubeFaceDepthGeometry( geometryShader );
- IShaderProgramGenerator::OutputCubeFaceDepthFragment(fragmentShader);
-
- tessCtrlShader.AddOutgoing("outNormalTC", "vec3");
- tessCtrlShader.AddInclude("tessellationNPatch.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctNorm[0] = outNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = outNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append(
- "\toutNormalTC[gl_InvocationID] = outNormal[gl_InvocationID];\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationNPatch.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddUniform("model_matrix", "mat4");
- tessEvalShader.AddOutgoing("world_pos", "vec4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tctNorm[0] = outNormalTC[0];");
- tessEvalShader.Append("\tctNorm[1] = outNormalTC[1];");
- tessEvalShader.Append("\tctNorm[2] = outNormalTC[2];");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tworld_pos = model_matrix * pos;");
- tessEvalShader.Append("\tworld_pos /= world_pos.w;");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
- tessEvalShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *
- Qt3DSRendererImpl::GetOrthographicDepthShader(TessModeValues::Enum inTessMode)
- {
- if (!m_qt3dsContext.GetRenderContext().IsTessellationSupported()
- || inTessMode == TessModeValues::NoTess) {
- return GetOrthographicDepthNoTessShader();
- } else if (inTessMode == TessModeValues::TessLinear) {
- return GetOrthographicDepthTessLinearShader();
- } else if (inTessMode == TessModeValues::TessPhong) {
- return GetOrthographicDepthTessPhongShader();
- } else if (inTessMode == TessModeValues::TessNPatch) {
- return GetOrthographicDepthTessNPatchShader();
- }
-
- return GetOrthographicDepthNoTessShader();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetOrthographicDepthNoTessShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_OrthographicDepthShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("orthographic depth shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader.AddOutgoing("outDepth", "vec3");
- vertexShader.Append("void main() {");
- vertexShader.Append(
- " gl_Position = model_view_projection * vec4( attr_pos, 1.0 );");
- vertexShader.Append(" outDepth.x = gl_Position.z / gl_Position.w;");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfloat depth = (outDepth.x + 1.0) * 0.5;");
- fragmentShader.Append("\tfragOutput = vec4(depth);");
- fragmentShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetOrthographicDepthTessLinearShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_OrthographicDepthTessLinearShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("orthographic depth tess linear shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfloat depth = (outDepth.x + 1.0) * 0.5;");
- fragmentShader.Append("\tfragOutput = vec4(depth);");
- fragmentShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationLinear.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationLinear.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddOutgoing("outDepth", "vec3");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
- tessEvalShader.Append("\toutDepth.x = gl_Position.z / gl_Position.w;");
- tessEvalShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetOrthographicDepthTessPhongShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_OrthographicDepthTessPhongShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("orthographic depth tess phong shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddIncoming("attr_norm", "vec3");
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfloat depth = (outDepth.x + 1.0) * 0.5;");
- fragmentShader.Append("\tfragOutput = vec4(depth);");
- fragmentShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationPhong.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctNorm[0] = outNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = outNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationPhong.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddOutgoing("outDepth", "vec3");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
- tessEvalShader.Append("\toutDepth.x = gl_Position.z / gl_Position.w;");
- tessEvalShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetOrthographicDepthTessNPatchShader()
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthShader =
- m_OrthographicDepthTessNPatchShader;
-
- if (theDepthShader.hasValue() == false) {
- TStrType name;
- name.assign("orthographic depth tess npatch shader");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddIncoming("attr_norm", "vec3");
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
- fragmentShader.AddUniform("model_view_projection", "mat4");
- fragmentShader.AddUniform("camera_properties", "vec2");
- fragmentShader.AddUniform("camera_position", "vec3");
- fragmentShader.AddUniform("camera_direction", "vec3");
- fragmentShader.AddInclude("depthpass.glsllib");
-
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- // fragmentShader.Append("\tfragOutput = vec4(0.0, 0.0, 0.0, 0.0);");
- fragmentShader.Append("\tfloat depth = (outDepth.x - camera_properties.x) / "
- "(camera_properties.y - camera_properties.x);");
- fragmentShader.Append("\tfragOutput = vec4(depth);");
- fragmentShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationNPatch.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.AddOutgoing("outNormalTC", "vec3");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctNorm[0] = outNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = outNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationNPatch.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.AddUniform("model_matrix", "mat4");
- tessEvalShader.AddOutgoing("outDepth", "vec3");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
- tessEvalShader.Append("\toutDepth.x = gl_Position.z / gl_Position.w;");
- tessEvalShader.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
-
- return theDepthShader.getValue();
- }
-
- // ---------------------------------
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetDepthPrepassShader(bool inDisplaced)
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthPrePassShader =
- (!inDisplaced) ? m_DepthPrepassShader : m_DepthPrepassShaderDisplaced;
-
- if (theDepthPrePassShader.hasValue() == false) {
- // check if we do displacement mapping
- TStrType name;
- name.assign("depth prepass shader");
- if (inDisplaced)
- name.append(" displacement");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
-
- vertexShader.Append("void main() {");
-
- if (inDisplaced) {
- GetQt3DSContext()
- .GetDefaultMaterialShaderGenerator()
- .AddDisplacementMappingForDepthPass(vertexShader);
- } else {
- vertexShader.Append(
- "\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- }
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfragOutput = vec4(0.0, 0.0, 0.0, 0.0);");
- fragmentShader.Append("}");
- } else if (theCache.IsShaderCachePersistenceEnabled()) {
- // we load from shader cache set default shader stages
- GetProgramGenerator().BeginProgram();
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthPrePassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthPrePassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
- return theDepthPrePassShader.getValue();
- }
-
- SRenderableDepthPrepassShader *
- Qt3DSRendererImpl::GetDepthTessPrepassShader(TessModeValues::Enum inTessMode, bool inDisplaced)
- {
- if (!m_qt3dsContext.GetRenderContext().IsTessellationSupported()
- || inTessMode == TessModeValues::NoTess) {
- return GetDepthPrepassShader(inDisplaced);
- } else if (inTessMode == TessModeValues::TessLinear) {
- return GetDepthTessLinearPrepassShader(inDisplaced);
- } else if (inTessMode == TessModeValues::TessPhong) {
- return GetDepthTessPhongPrepassShader();
- } else if (inTessMode == TessModeValues::TessNPatch) {
- return GetDepthTessNPatchPrepassShader();
- }
-
- return GetDepthPrepassShader(inDisplaced);
- }
-
- SRenderableDepthPrepassShader *
- Qt3DSRendererImpl::GetDepthTessLinearPrepassShader(bool inDisplaced)
- {
- Option<NVScopedRefCounted<SRenderableDepthPrepassShader>> &theDepthPrePassShader =
- (!inDisplaced) ? m_DepthTessLinearPrepassShader
- : m_DepthTessLinearPrepassShaderDisplaced;
-
- if (theDepthPrePassShader.hasValue() == false) {
- // check if we do displacement mapping
- TStrType name;
- name.assign("depth tess linear prepass shader");
- if (inDisplaced)
- name.append(" displacement");
-
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey = m_qt3dsContext.GetStringTable().RegisterStr(name.c_str());
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexShader.AddIncoming("attr_pos", "vec3");
- if (inDisplaced) {
- vertexShader.AddIncoming("attr_uv0", "vec2");
- vertexShader.AddIncoming("attr_norm", "vec3");
-
- vertexShader.AddUniform("displacementMap_rot", "vec4");
- vertexShader.AddUniform("displacementMap_offset", "vec3");
-
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.AddOutgoing("outUV", "vec2");
- }
- vertexShader.AddOutgoing("outWorldPos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader.AddUniform("model_matrix", "mat4");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- if (inDisplaced) {
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("\tvec3 uTransform = vec3( displacementMap_rot.x, "
- "displacementMap_rot.y, displacementMap_offset.x );");
- vertexShader.Append("\tvec3 vTransform = vec3( displacementMap_rot.z, "
- "displacementMap_rot.w, displacementMap_offset.y );");
- vertexShader.AddInclude(
- "defaultMaterialLighting.glsllib"); // getTransformedUVCoords is in the
- // lighting code addition.
- vertexShader << "\tvec2 uv_coords = attr_uv0;" << Endl;
- vertexShader << "\toutUV = getTransformedUVCoords( vec3( uv_coords, 1.0), "
- "uTransform, vTransform );\n";
- }
- vertexShader.Append("\toutWorldPos = (model_matrix * vec4(attr_pos, 1.0)).xyz;");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfragOutput = vec4(0.0, 0.0, 0.0, 0.0);");
- fragmentShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationLinear.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.AddOutgoing("outUVTC", "vec2");
- tessCtrlShader.AddOutgoing("outNormalTC", "vec3");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctWorldPos[0] = outWorldPos[0];");
- tessCtrlShader.Append("\tctWorldPos[1] = outWorldPos[1];");
- tessCtrlShader.Append("\tctWorldPos[2] = outWorldPos[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
-
- if (inDisplaced) {
- tessCtrlShader.Append("\toutUVTC[gl_InvocationID] = outUV[gl_InvocationID];");
- tessCtrlShader.Append(
- "\toutNormalTC[gl_InvocationID] = outNormal[gl_InvocationID];");
- }
-
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationLinear.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- if (inDisplaced) {
- tessEvalShader.AddUniform("displacementSampler", "sampler2D");
- tessEvalShader.AddUniform("displaceAmount", "float");
- tessEvalShader.AddInclude("defaultMaterialFileDisplacementTexture.glsllib");
- }
- tessEvalShader.AddOutgoing("outUV", "vec2");
- tessEvalShader.AddOutgoing("outNormal", "vec3");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
-
- if (inDisplaced) {
- tessEvalShader << "\toutUV = gl_TessCoord.x * outUVTC[0] + gl_TessCoord.y * "
- "outUVTC[1] + gl_TessCoord.z * outUVTC[2];"
- << Endl;
- tessEvalShader
- << "\toutNormal = gl_TessCoord.x * outNormalTC[0] + gl_TessCoord.y * "
- "outNormalTC[1] + gl_TessCoord.z * outNormalTC[2];"
- << Endl;
- tessEvalShader
- << "\tvec3 displacedPos = defaultMaterialFileDisplacementTexture( "
- "displacementSampler , displaceAmount, outUV , outNormal, pos.xyz );"
- << Endl;
- tessEvalShader.Append(
- "\tgl_Position = model_view_projection * vec4(displacedPos, 1.0);");
- } else
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;");
-
- tessEvalShader.Append("}");
- } else if (theCache.IsShaderCachePersistenceEnabled()) {
- // we load from shader cache set default shader stages
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- }
-
- SShaderCacheProgramFlags theFlags;
- theFlags.SetTessellationEnabled(true);
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- name.c_str(), theFlags, TShaderFeatureSet());
-
- if (depthShaderProgram) {
- theDepthPrePassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- theDepthPrePassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
- return theDepthPrePassShader->mPtr;
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetDepthTessPhongPrepassShader()
- {
- if (m_DepthTessPhongPrepassShader.hasValue() == false) {
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey =
- m_qt3dsContext.GetStringTable().RegisterStr("depth tess phong prepass shader");
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddIncoming("attr_norm", "vec3");
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.AddOutgoing("outWorldPos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader.AddUniform("model_matrix", "mat4");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("\toutWorldPos = (model_matrix * vec4(attr_pos, 1.0)).xyz;");
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfragOutput = vec4(0.0, 0.0, 0.0, 0.0);");
- fragmentShader.Append("}");
-
- tessCtrlShader.AddInclude("tessellationPhong.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctWorldPos[0] = outWorldPos[0];");
- tessCtrlShader.Append("\tctWorldPos[1] = outWorldPos[1];");
- tessCtrlShader.Append("\tctWorldPos[2] = outWorldPos[2];");
- tessCtrlShader.Append("\tctNorm[0] = outNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = outNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationPhong.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;\n");
- tessEvalShader.Append("}");
- } else if (theCache.IsShaderCachePersistenceEnabled()) {
- // we load from shader cache set default shader stages
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- }
-
- SShaderCacheProgramFlags theFlags;
- theFlags.SetTessellationEnabled(true);
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- "depth tess phong prepass shader", theFlags, TShaderFeatureSet());
-
- if (depthShaderProgram) {
- m_DepthTessPhongPrepassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- m_DepthTessPhongPrepassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
- return m_DepthTessPhongPrepassShader->mPtr;
- }
-
- SRenderableDepthPrepassShader *Qt3DSRendererImpl::GetDepthTessNPatchPrepassShader()
- {
- if (m_DepthTessNPatchPrepassShader.hasValue() == false) {
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey =
- m_qt3dsContext.GetStringTable().RegisterStr("depth tess npatch prepass shader");
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &vertexShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &tessCtrlShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessControl));
- IShaderStageGenerator &tessEvalShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::TessEval));
- IShaderStageGenerator &fragmentShader(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexShader.AddIncoming("attr_pos", "vec3");
- vertexShader.AddIncoming("attr_norm", "vec3");
- vertexShader.AddOutgoing("outNormal", "vec3");
- vertexShader.AddOutgoing("outWorldPos", "vec3");
- vertexShader.AddUniform("model_view_projection", "mat4");
- vertexShader.AddUniform("model_matrix", "mat4");
- vertexShader.Append("void main() {");
- vertexShader.Append("\tgl_Position = vec4(attr_pos, 1.0);");
- vertexShader.Append("\toutWorldPos = (model_matrix * vec4(attr_pos, 1.0)).xyz;");
- vertexShader.Append("\toutNormal = attr_norm;");
- vertexShader.Append("}");
- fragmentShader.Append("void main() {");
- fragmentShader.Append("\tfragOutput = vec4(0.0, 0.0, 0.0, 0.0);");
- fragmentShader.Append("}");
-
- tessCtrlShader.AddOutgoing("outNormalTC", "vec3");
- tessCtrlShader.AddInclude("tessellationNPatch.glsllib");
- tessCtrlShader.AddUniform("tessLevelInner", "float");
- tessCtrlShader.AddUniform("tessLevelOuter", "float");
- tessCtrlShader.Append("void main() {\n");
- tessCtrlShader.Append("\tctWorldPos[0] = outWorldPos[0];");
- tessCtrlShader.Append("\tctWorldPos[1] = outWorldPos[1];");
- tessCtrlShader.Append("\tctWorldPos[2] = outWorldPos[2];");
- tessCtrlShader.Append("\tctNorm[0] = outNormal[0];");
- tessCtrlShader.Append("\tctNorm[1] = outNormal[1];");
- tessCtrlShader.Append("\tctNorm[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tctTangent[0] = outNormal[0];"); // we don't care for the tangent
- tessCtrlShader.Append("\tctTangent[1] = outNormal[1];");
- tessCtrlShader.Append("\tctTangent[2] = outNormal[2];");
- tessCtrlShader.Append(
- "\tgl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;");
- tessCtrlShader.Append("\ttessShader( tessLevelOuter, tessLevelInner);\n");
- tessCtrlShader.Append(
- "\toutNormalTC[gl_InvocationID] = outNormal[gl_InvocationID];\n");
- tessCtrlShader.Append("}");
-
- tessEvalShader.AddInclude("tessellationNPatch.glsllib");
- tessEvalShader.AddUniform("model_view_projection", "mat4");
- tessEvalShader.Append("void main() {");
- tessEvalShader.Append("\tctNorm[0] = outNormalTC[0];");
- tessEvalShader.Append("\tctNorm[1] = outNormalTC[1];");
- tessEvalShader.Append("\tctNorm[2] = outNormalTC[2];");
- tessEvalShader.Append(
- "\tctTangent[0] = outNormalTC[0];"); // we don't care for the tangent
- tessEvalShader.Append("\tctTangent[1] = outNormalTC[1];");
- tessEvalShader.Append("\tctTangent[2] = outNormalTC[2];");
- tessEvalShader.Append("\tvec4 pos = tessShader( );\n");
- tessEvalShader.Append("\tgl_Position = model_view_projection * pos;\n");
- tessEvalShader.Append("}");
- } else if (theCache.IsShaderCachePersistenceEnabled()) {
- // we load from shader cache set default shader stages
- GetProgramGenerator().BeginProgram(TShaderGeneratorStageFlags(
- ShaderGeneratorStages::Vertex | ShaderGeneratorStages::TessControl
- | ShaderGeneratorStages::TessEval | ShaderGeneratorStages::Fragment));
- }
-
- SShaderCacheProgramFlags theFlags;
- theFlags.SetTessellationEnabled(true);
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- "depth tess npatch prepass shader", theFlags, TShaderFeatureSet());
-
- if (depthShaderProgram) {
- m_DepthTessNPatchPrepassShader = NVScopedRefCounted<SRenderableDepthPrepassShader>(
- QT3DS_NEW(GetContext().GetAllocator(),
- SRenderableDepthPrepassShader)(*depthShaderProgram, GetContext()));
- } else {
- m_DepthTessNPatchPrepassShader =
- NVScopedRefCounted<SRenderableDepthPrepassShader>();
- }
- }
- return m_DepthTessNPatchPrepassShader->mPtr;
- }
-
- SDefaultAoPassShader *Qt3DSRendererImpl::GetDefaultAoPassShader(TShaderFeatureSet inFeatureSet)
- {
- if (m_DefaultAoPassShader.hasValue() == false) {
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey =
- m_qt3dsContext.GetStringTable().RegisterStr("fullscreen AO pass shader");
- NVRenderShaderProgram *aoPassShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!aoPassShaderProgram) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &theVertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &theFragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- theVertexGenerator.AddIncoming("attr_pos", "vec3");
- theVertexGenerator.AddIncoming("attr_uv", "vec2");
- theVertexGenerator.AddOutgoing("uv_coords", "vec2");
- theVertexGenerator.Append("void main() {");
- theVertexGenerator.Append("\tgl_Position = vec4(attr_pos.xy, 0.5, 1.0 );");
- theVertexGenerator.Append("\tuv_coords = attr_uv;");
- theVertexGenerator.Append("}");
-
- // fragmentGenerator.AddInclude( "SSAOCustomMaterial.glsllib" );
- theFragmentGenerator.AddInclude("viewProperties.glsllib");
- theFragmentGenerator.AddInclude("screenSpaceAO.glsllib");
- if (m_Context->GetRenderContextType() == NVRenderContextValues::GLES2) {
- theFragmentGenerator
- << "\tuniform vec4 ao_properties;" << Endl
- << "\tuniform vec4 ao_properties2;" << Endl
- << "\tuniform vec4 shadow_properties;" << Endl
- << "\tuniform vec4 aoScreenConst;" << Endl
- << "\tuniform vec4 UvToEyeConst;" << Endl;
- } else {
- theFragmentGenerator
- << "layout (std140) uniform cbAoShadow { " << Endl << "\tvec4 ao_properties;"
- << Endl << "\tvec4 ao_properties2;" << Endl << "\tvec4 shadow_properties;"
- << Endl << "\tvec4 aoScreenConst;" << Endl << "\tvec4 UvToEyeConst;" << Endl
- << "};" << Endl;
- }
- theFragmentGenerator.AddUniform("camera_direction", "vec3");
- theFragmentGenerator.AddUniform("depth_sampler", "sampler2D");
- theFragmentGenerator.Append("void main() {");
- theFragmentGenerator << "\tfloat aoFactor;" << Endl;
- theFragmentGenerator << "\tvec3 screenNorm;" << Endl;
-
- // We're taking multiple depth samples and getting the derivatives at each of them
- // to get a more
- // accurate view space normal vector. When we do only one, we tend to get bizarre
- // values at the edges
- // surrounding objects, and this also ends up giving us weird AO values.
- // If we had a proper screen-space normal map, that would also do the trick.
- if (m_Context->GetRenderContextType() == NVRenderContextValues::GLES2) {
- theFragmentGenerator.AddUniform("depth_sampler_size", "vec2");
- theFragmentGenerator.Append("\tivec2 iCoords = ivec2( gl_FragCoord.xy );");
- theFragmentGenerator.Append("\tfloat depth = getDepthValue( "
- "texture2D(depth_sampler, vec2(iCoords)"
- " / depth_sampler_size), camera_properties );");
- theFragmentGenerator.Append(
- "\tdepth = depthValueToLinearDistance( depth, camera_properties );");
- theFragmentGenerator.Append("\tdepth = (depth - camera_properties.x) / "
- "(camera_properties.y - camera_properties.x);");
- theFragmentGenerator.Append("\tfloat depth2 = getDepthValue( "
- "texture2D(depth_sampler, vec2(iCoords+ivec2(1))"
- " / depth_sampler_size), camera_properties );");
- theFragmentGenerator.Append(
- "\tdepth2 = depthValueToLinearDistance( depth, camera_properties );");
- theFragmentGenerator.Append("\tfloat depth3 = getDepthValue( "
- "texture2D(depth_sampler, vec2(iCoords-ivec2(1))"
- " / depth_sampler_size), camera_properties );");
- } else {
- theFragmentGenerator.Append("\tivec2 iCoords = ivec2( gl_FragCoord.xy );");
- theFragmentGenerator.Append("\tfloat depth = getDepthValue( "
- "texelFetch(depth_sampler, iCoords, 0), "
- "camera_properties );");
- theFragmentGenerator.Append(
- "\tdepth = depthValueToLinearDistance( depth, camera_properties );");
- theFragmentGenerator.Append("\tdepth = (depth - camera_properties.x) / "
- "(camera_properties.y - camera_properties.x);");
- theFragmentGenerator.Append("\tfloat depth2 = getDepthValue( "
- "texelFetch(depth_sampler, iCoords+ivec2(1), 0), "
- "camera_properties );");
- theFragmentGenerator.Append(
- "\tdepth2 = depthValueToLinearDistance( depth, camera_properties );");
- theFragmentGenerator.Append("\tfloat depth3 = getDepthValue( "
- "texelFetch(depth_sampler, iCoords-ivec2(1), 0), "
- "camera_properties );");
- }
- theFragmentGenerator.Append(
- "\tdepth3 = depthValueToLinearDistance( depth, camera_properties );");
- theFragmentGenerator.Append("\tvec3 tanU = vec3(10, 0, dFdx(depth));");
- theFragmentGenerator.Append("\tvec3 tanV = vec3(0, 10, dFdy(depth));");
- theFragmentGenerator.Append("\tscreenNorm = normalize(cross(tanU, tanV));");
- theFragmentGenerator.Append("\ttanU = vec3(10, 0, dFdx(depth2));");
- theFragmentGenerator.Append("\ttanV = vec3(0, 10, dFdy(depth2));");
- theFragmentGenerator.Append("\tscreenNorm += normalize(cross(tanU, tanV));");
- theFragmentGenerator.Append("\ttanU = vec3(10, 0, dFdx(depth3));");
- theFragmentGenerator.Append("\ttanV = vec3(0, 10, dFdy(depth3));");
- theFragmentGenerator.Append("\tscreenNorm += normalize(cross(tanU, tanV));");
- theFragmentGenerator.Append("\tscreenNorm = -normalize(screenNorm);");
-
- theFragmentGenerator.Append("\taoFactor = \
- SSambientOcclusion( depth_sampler, screenNorm, ao_properties, ao_properties2, \
- camera_properties, aoScreenConst, UvToEyeConst );");
-
- theFragmentGenerator.Append(
- "\tgl_FragColor = vec4(aoFactor, aoFactor, aoFactor, 1.0);");
-
- theFragmentGenerator.Append("}");
- }
-
- aoPassShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- "fullscreen AO pass shader", SShaderCacheProgramFlags(), inFeatureSet);
-
- if (aoPassShaderProgram) {
- m_DefaultAoPassShader = NVScopedRefCounted<SDefaultAoPassShader>(
- QT3DS_NEW(GetContext().GetAllocator(), SDefaultAoPassShader)(*aoPassShaderProgram,
- GetContext()));
- } else {
- m_DefaultAoPassShader = NVScopedRefCounted<SDefaultAoPassShader>();
- }
- }
- return m_DefaultAoPassShader->mPtr;
- }
-
- SDefaultAoPassShader *Qt3DSRendererImpl::GetFakeDepthShader(TShaderFeatureSet inFeatureSet)
- {
- if (m_FakeDepthShader.hasValue() == false) {
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey =
- m_qt3dsContext.GetStringTable().RegisterStr("depth display shader");
- NVRenderShaderProgram *depthShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!depthShaderProgram) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &theVertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &theFragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- theVertexGenerator.AddIncoming("attr_pos", "vec3");
- theVertexGenerator.AddIncoming("attr_uv", "vec2");
- theVertexGenerator.AddOutgoing("uv_coords", "vec2");
- theVertexGenerator.Append("void main() {");
- theVertexGenerator.Append("\tgl_Position = vec4(attr_pos.xy, 0.5, 1.0 );");
- theVertexGenerator.Append("\tuv_coords = attr_uv;");
- theVertexGenerator.Append("}");
-
- theFragmentGenerator.AddUniform("depth_sampler", "sampler2D");
- theFragmentGenerator.Append("void main() {");
- theFragmentGenerator.Append("\tivec2 iCoords = ivec2( gl_FragCoord.xy );");
- theFragmentGenerator.Append(
- "\tfloat depSample = texelFetch(depth_sampler, iCoords, 0).x;");
- theFragmentGenerator.Append(
- "\tgl_FragColor = vec4( depSample, depSample, depSample, 1.0 );");
- theFragmentGenerator.Append("\treturn;");
- theFragmentGenerator.Append("}");
- }
-
- depthShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- "depth display shader", SShaderCacheProgramFlags(), inFeatureSet);
-
- if (depthShaderProgram) {
- m_FakeDepthShader = NVScopedRefCounted<SDefaultAoPassShader>(
- QT3DS_NEW(GetContext().GetAllocator(), SDefaultAoPassShader)(
- *depthShaderProgram, GetContext()));
- } else {
- m_FakeDepthShader = NVScopedRefCounted<SDefaultAoPassShader>();
- }
- }
- return m_FakeDepthShader->mPtr;
- }
-
- SDefaultAoPassShader *Qt3DSRendererImpl::GetFakeCubeDepthShader(TShaderFeatureSet inFeatureSet)
- {
- if (!m_FakeCubemapDepthShader.hasValue()) {
- IShaderCache &theCache = m_qt3dsContext.GetShaderCache();
- CRegisteredString theCacheKey =
- m_qt3dsContext.GetStringTable().RegisterStr("cube depth display shader");
- NVRenderShaderProgram *cubeShaderProgram =
- theCache.GetProgram(theCacheKey, TShaderFeatureSet());
- if (!cubeShaderProgram) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &theVertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &theFragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- theVertexGenerator.AddIncoming("attr_pos", "vec3");
- theVertexGenerator.AddIncoming("attr_uv", "vec2");
- theVertexGenerator.AddOutgoing("sample_dir", "vec3");
- theVertexGenerator.Append("void main() {");
- theVertexGenerator.Append("\tgl_Position = vec4(attr_pos.xy, 0.5, 1.0 );");
- theVertexGenerator.Append(
- "\tsample_dir = vec3(4.0 * (attr_uv.x - 0.5), -1.0, 4.0 * (attr_uv.y - 0.5));");
- theVertexGenerator.Append("}");
- theFragmentGenerator.AddUniform("depth_cube", "samplerCube");
- theFragmentGenerator.Append("void main() {");
- theFragmentGenerator.Append(
- "\tfloat smpDepth = texture( depth_cube, sample_dir ).x;");
- theFragmentGenerator.Append(
- "\tgl_FragColor = vec4(smpDepth, smpDepth, smpDepth, 1.0);");
- theFragmentGenerator.Append("}");
- }
-
- cubeShaderProgram = GetProgramGenerator().CompileGeneratedShader(
- "cube depth display shader", SShaderCacheProgramFlags(), inFeatureSet);
-
- if (cubeShaderProgram) {
- m_FakeCubemapDepthShader = NVScopedRefCounted<SDefaultAoPassShader>(
- QT3DS_NEW(GetContext().GetAllocator(), SDefaultAoPassShader)(*cubeShaderProgram,
- GetContext()));
- } else {
- m_FakeCubemapDepthShader = NVScopedRefCounted<SDefaultAoPassShader>();
- }
- }
- return m_FakeCubemapDepthShader.getValue();
- }
-
- STextRenderHelper Qt3DSRendererImpl::GetTextShader(bool inUsePathRendering)
- {
- STextShaderPtr &thePtr = (!inUsePathRendering) ? m_TextShader : m_TextPathShader;
- if (thePtr.HasGeneratedShader())
- return STextRenderHelper(thePtr, *m_QuadInputAssembler);
-
- NVRenderShaderProgram *theShader = NULL;
- NVRenderProgramPipeline *thePipeline = NULL;
-
- if (!inUsePathRendering) {
- GetProgramGenerator().BeginProgram();
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- // xy of text dimensions are scaling factors, zw are offset factors.
- vertexGenerator.AddUniform("text_dimensions", "vec4");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator
- << "\tvec3 textPos = vec3(attr_pos.x * text_dimensions.x + text_dimensions.z"
- << ", attr_pos.y * text_dimensions.y + text_dimensions.w"
- << ", attr_pos.z);" << Endl;
-
- vertexGenerator.Append("\tgl_Position = model_view_projection * vec4(textPos, 1.0);");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
-
- fragmentGenerator.AddUniform("text_textcolor", "vec4");
- fragmentGenerator.AddUniform("text_textdimensions", "vec3");
- fragmentGenerator.AddUniform("text_image", "sampler2D");
- fragmentGenerator.AddUniform("text_backgroundcolor", "vec3");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec2 theCoords = uv_coords;");
- // Enable rendering from a sub-rect
-
- fragmentGenerator
- << "\ttheCoords.x = theCoords.x * text_textdimensions.x;" << Endl
- << "\ttheCoords.y = theCoords.y * text_textdimensions.y;" << Endl
- // flip the y uv coord if the dimension's z variable is set
- << "\tif ( text_textdimensions.z > 0.0 ) theCoords.y = 1.0 - theCoords.y;" << Endl;
- fragmentGenerator.Append(
- "\tvec4 c = texture2D(text_image, theCoords);");
- fragmentGenerator.Append(
- "\tfragOutput = vec4(mix(text_backgroundcolor.rgb, "
- "text_textcolor.rgb, c.rgb), c.a) * text_textcolor.a;");
-
- vertexGenerator.Append("}");
- fragmentGenerator.Append("}");
- const char *shaderName = "text shader";
- theShader = GetProgramGenerator().CompileGeneratedShader(
- shaderName, SShaderCacheProgramFlags(), TShaderFeatureSet(), false);
- } else {
- GetProgramGenerator().BeginProgram(
- TShaderGeneratorStageFlags(ShaderGeneratorStages::Fragment));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- fragmentGenerator.AddUniform("text_textcolor", "vec4");
- fragmentGenerator.AddUniform("text_backgroundcolor", "vec3");
-
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tfragOutput = vec4(mix(text_backgroundcolor.rgb, "
- "text_textcolor.rgb, text_textcolor.a), text_textcolor.a );");
- fragmentGenerator.Append("}");
-
- const char *shaderName = "text path shader";
- theShader = GetProgramGenerator().CompileGeneratedShader(
- shaderName, SShaderCacheProgramFlags(), TShaderFeatureSet(), true);
-
- // setup program pipeline
- if (theShader) {
- thePipeline = GetContext().CreateProgramPipeline();
- if (thePipeline) {
- thePipeline->SetProgramStages(
- theShader,
- qt3ds::render::NVRenderShaderTypeFlags(NVRenderShaderTypeValue::Fragment));
- }
- }
- }
-
- if (theShader == NULL) {
- thePtr.Set(NULL);
- } else {
- GenerateXYQuad();
- thePtr.Set(QT3DS_NEW(m_Context->GetAllocator(), STextShader)(*theShader, thePipeline));
- }
- return STextRenderHelper(thePtr, *m_QuadInputAssembler);
- }
-
- STextDepthShader *Qt3DSRendererImpl::GetTextDepthShader()
- {
- if (m_TextDepthPrepassShader.hasValue() == false) {
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- // xy of text dimensions are scaling factors, zw are offset factors.
- vertexGenerator.AddUniform("text_dimensions", "vec4");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator
- << "\tvec3 textPos = vec3(attr_pos.x * text_dimensions.x + text_dimensions.z"
- << ", attr_pos.y * text_dimensions.y + text_dimensions.w"
- << ", attr_pos.z);" << Endl;
-
- vertexGenerator.Append("\tgl_Position = model_view_projection * vec4(textPos, 1.0);");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
-
- fragmentGenerator.AddUniform("text_textdimensions", "vec3");
- fragmentGenerator.AddUniform("text_image", "sampler2D");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec2 theCoords = uv_coords;");
- // Enable rendering from a sub-rect
-
- fragmentGenerator
- << "\ttheCoords.x = theCoords.x * text_textdimensions.x;" << Endl
- << "\ttheCoords.y = theCoords.y * text_textdimensions.y;" << Endl
- // flip the y uv coord if the dimension's z variable is set
- << "\tif ( text_textdimensions.z > 0.0 ) theCoords.y = 1.0 - theCoords.y;" << Endl;
- fragmentGenerator.Append("\tfloat alpha_mask = texture2D( text_image, theCoords ).r;");
- fragmentGenerator.Append("\tif ( alpha_mask < .05 ) discard;");
- vertexGenerator.Append("}");
- fragmentGenerator.Append("}");
- const char *shaderName = "text depth shader";
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- shaderName, SShaderCacheProgramFlags(), TShaderFeatureSet());
- if (theShader == NULL) {
- m_TextDepthPrepassShader = NVScopedRefCounted<STextDepthShader>();
- } else {
- GenerateXYQuad();
- m_TextDepthPrepassShader = NVScopedRefCounted<STextDepthShader>(
- QT3DS_NEW(m_Context->GetAllocator(), STextDepthShader)(
- m_Context->GetAllocator(), *theShader, *m_QuadInputAssembler));
- }
- }
- return m_TextDepthPrepassShader->mPtr;
- }
-
- STextRenderHelper Qt3DSRendererImpl::GetTextWidgetShader()
- {
- if (m_TextWidgetShader.HasGeneratedShader())
- return STextRenderHelper(m_TextWidgetShader, *m_QuadInputAssembler);
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- // xy of text dimensions are scaling factors, zw are offset factors.
- vertexGenerator.AddUniform("text_dimensions", "vec4");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator
- << "\tvec3 textPos = vec3(attr_pos.x * text_dimensions.x + text_dimensions.z"
- << ", attr_pos.y * text_dimensions.y + text_dimensions.w"
- << ", attr_pos.z);" << Endl;
-
- vertexGenerator.Append("\tgl_Position = model_view_projection * vec4(textPos, 1.0);");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("text_textcolor", "vec4");
- fragmentGenerator.AddUniform("text_textdimensions", "vec3");
- fragmentGenerator.AddUniform("text_image", "sampler2D");
- fragmentGenerator.AddUniform("text_backgroundcolor", "vec3");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec2 theCoords = uv_coords;");
- // Enable rendering from a sub-rect
-
- fragmentGenerator << "\ttheCoords.x = theCoords.x * text_textdimensions.x;" << Endl
- << "\ttheCoords.y = theCoords.y * text_textdimensions.y;" << Endl
- // flip the y uv coord if the dimension's z variable is set
- << "\tif ( text_textdimensions.z > 0.0 ) theCoords.y = 1.0 - theCoords.y;"
- << Endl;
- fragmentGenerator.Append(
- "\tfloat alpha_mask = texture2D( text_image, theCoords ).r * text_textcolor.a;");
- fragmentGenerator.Append("\tfragOutput = vec4(mix(text_backgroundcolor.rgb, "
- "text_textcolor.rgb, alpha_mask), 1.0 );");
- fragmentGenerator.Append("}");
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "text widget shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (theShader == NULL)
- m_TextWidgetShader.Set(NULL);
- else {
- GenerateXYQuad();
- m_TextWidgetShader.Set(QT3DS_NEW(m_Context->GetAllocator(), STextShader)(*theShader));
- }
- return STextRenderHelper(m_TextWidgetShader, *m_QuadInputAssembler);
- }
-
- STextRenderHelper Qt3DSRendererImpl::GetOnscreenTextShader()
- {
- if (m_TextOnscreenShader.HasGeneratedShader())
- return STextRenderHelper(m_TextOnscreenShader, *m_QuadStripInputAssembler);
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddUniform("vertex_offsets", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
-
- vertexGenerator.Append("\tvec3 pos = attr_pos + vec3(vertex_offsets, 0.0);");
- vertexGenerator.Append("\tgl_Position = model_view_projection * vec4(pos, 1.0);");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("text_textcolor", "vec4");
- fragmentGenerator.AddUniform("text_image", "sampler2D");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tfloat alpha = texture2D( text_image, uv_coords ).a;");
- fragmentGenerator.Append(
- "\tfragOutput = vec4(text_textcolor.r, text_textcolor.g, text_textcolor.b, alpha);");
- fragmentGenerator.Append("}");
-
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "onscreen texture shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- if (theShader == NULL)
- m_TextOnscreenShader.Set(NULL);
- else {
- GenerateXYQuadStrip();
- m_TextOnscreenShader.Set(QT3DS_NEW(m_Context->GetAllocator(), STextShader)(*theShader));
- }
- return STextRenderHelper(m_TextOnscreenShader, *m_QuadStripInputAssembler);
- }
-
- NVRenderShaderProgram *Qt3DSRendererImpl::GetTextAtlasEntryShader()
- {
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
-
- vertexGenerator.Append("\tgl_Position = model_view_projection * vec4(attr_pos, 1.0);");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("text_image", "sampler2D");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tfloat alpha = texture2D( text_image, uv_coords ).a;");
- fragmentGenerator.Append("\tfragOutput = vec4(alpha, alpha, alpha, alpha);");
- fragmentGenerator.Append("}");
-
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "texture atlas entry shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- return theShader;
- }
-
- STextRenderHelper Qt3DSRendererImpl::GetShader(STextRenderable & /*inRenderable*/,
- bool inUsePathRendering)
- {
- return GetTextShader(inUsePathRendering);
- }
-
- SLayerSceneShader *Qt3DSRendererImpl::GetSceneLayerShader()
- {
- if (m_SceneLayerShader.hasValue())
- return m_SceneLayerShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
-
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- // xy of text dimensions are scaling factors, zw are offset factors.
- vertexGenerator.AddUniform("layer_dimensions", "vec2");
- vertexGenerator.AddUniform("model_view_projection", "mat4");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator << "\tvec3 layerPos = vec3(attr_pos.x * layer_dimensions.x / 2.0"
- << ", attr_pos.y * layer_dimensions.y / 2.0"
- << ", attr_pos.z);" << Endl;
-
- vertexGenerator.Append("\tgl_Position = model_view_projection * vec4(layerPos, 1.0);");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("layer_image", "sampler2D");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec2 theCoords = uv_coords;\n");
- fragmentGenerator.Append("\tvec4 theLayerTexture = texture2D( layer_image, theCoords );\n");
- fragmentGenerator.Append("\tif( theLayerTexture.a == 0.0 ) discard;\n");
- fragmentGenerator.Append("\tfragOutput = theLayerTexture;\n");
- fragmentGenerator.Append("}");
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "layer shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
- NVScopedRefCounted<SLayerSceneShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SLayerSceneShader)(*theShader);
- m_SceneLayerShader = retval;
- return m_SceneLayerShader.getValue();
- }
-
- SLayerProgAABlendShader *Qt3DSRendererImpl::GetLayerProgAABlendShader()
- {
- if (m_LayerProgAAShader.hasValue())
- return m_LayerProgAAShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
- fragmentGenerator.AddUniform("accumulator", "sampler2D");
- fragmentGenerator.AddUniform("last_frame", "sampler2D");
- fragmentGenerator.AddUniform("blend_factors", "vec2");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec4 accum = texture2D( accumulator, uv_coords );");
- fragmentGenerator.Append("\tvec4 lastFrame = texture2D( last_frame, uv_coords );");
- fragmentGenerator.Append(
- "\tgl_FragColor = accum*blend_factors.y + lastFrame*blend_factors.x;");
- fragmentGenerator.Append("}");
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "layer progressiveAA blend shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
- NVScopedRefCounted<SLayerProgAABlendShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SLayerProgAABlendShader)(*theShader);
- m_LayerProgAAShader = retval;
- return m_LayerProgAAShader.getValue();
- }
-
- SShadowmapPreblurShader *Qt3DSRendererImpl::GetCubeShadowBlurXShader()
- {
- if (m_CubeShadowBlurXShader.hasValue())
- return m_CubeShadowBlurXShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- // vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords.xy = attr_pos.xy;");
- vertexGenerator.Append("}");
-
- // This with the ShadowBlurYShader design for a 2-pass 5x5 (sigma=1.0)
- // Weights computed using -- http://dev.theomader.com/gaussian-kernel-calculator/
- fragmentGenerator.AddUniform("camera_properties", "vec2");
- fragmentGenerator.AddUniform("depthCube", "samplerCube");
- // fragmentGenerator.AddUniform("depthSrc", "sampler2D");
- fragmentGenerator.Append("layout(location = 0) out vec4 frag0;");
- fragmentGenerator.Append("layout(location = 1) out vec4 frag1;");
- fragmentGenerator.Append("layout(location = 2) out vec4 frag2;");
- fragmentGenerator.Append("layout(location = 3) out vec4 frag3;");
- fragmentGenerator.Append("layout(location = 4) out vec4 frag4;");
- fragmentGenerator.Append("layout(location = 5) out vec4 frag5;");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tfloat ofsScale = camera_properties.x / 2500.0;");
- fragmentGenerator.Append("\tvec3 dir0 = vec3(1.0, -uv_coords.y, -uv_coords.x);");
- fragmentGenerator.Append("\tvec3 dir1 = vec3(-1.0, -uv_coords.y, uv_coords.x);");
- fragmentGenerator.Append("\tvec3 dir2 = vec3(uv_coords.x, 1.0, uv_coords.y);");
- fragmentGenerator.Append("\tvec3 dir3 = vec3(uv_coords.x, -1.0, -uv_coords.y);");
- fragmentGenerator.Append("\tvec3 dir4 = vec3(uv_coords.x, -uv_coords.y, 1.0);");
- fragmentGenerator.Append("\tvec3 dir5 = vec3(-uv_coords.x, -uv_coords.y, -1.0);");
- fragmentGenerator.Append("\tfloat depth0;");
- fragmentGenerator.Append("\tfloat depth1;");
- fragmentGenerator.Append("\tfloat depth2;");
- fragmentGenerator.Append("\tfloat outDepth;");
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir0).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir0 + vec3(0.0, 0.0, -ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir0 + vec3(0.0, 0.0, ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir0 + vec3(0.0, 0.0, -2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir0 + vec3(0.0, 0.0, 2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag0 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir1).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir1 + vec3(0.0, 0.0, -ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir1 + vec3(0.0, 0.0, ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir1 + vec3(0.0, 0.0, -2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir1 + vec3(0.0, 0.0, 2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag1 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir2).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir2 + vec3(-ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir2 + vec3(ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir2 + vec3(-2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir2 + vec3(2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag2 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir3).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir3 + vec3(-ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir3 + vec3(ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir3 + vec3(-2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir3 + vec3(2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag3 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir4).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir4 + vec3(-ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir4 + vec3(ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir4 + vec3(-2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir4 + vec3(2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag4 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir5).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir5 + vec3(-ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir5 + vec3(ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir5 + vec3(-2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir5 + vec3(2.0*ofsScale, 0.0, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag5 = vec4(outDepth);");
-
- fragmentGenerator.Append("}");
-
- CRegisteredString featureName(m_StringTable->RegisterStr("NO_FRAG_OUTPUT"));
- SShaderPreprocessorFeature noFragOutputFeature(featureName, true);
-
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "cubemap shadow blur X shader", SShaderCacheProgramFlags(),
- TShaderFeatureSet(&noFragOutputFeature, 1));
- NVScopedRefCounted<SShadowmapPreblurShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SShadowmapPreblurShader)(*theShader);
- m_CubeShadowBlurXShader = retval;
- return m_CubeShadowBlurXShader.getValue();
- }
-
- SShadowmapPreblurShader *Qt3DSRendererImpl::GetCubeShadowBlurYShader()
- {
- if (m_CubeShadowBlurYShader.hasValue())
- return m_CubeShadowBlurYShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- // vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords.xy = attr_pos.xy;");
- vertexGenerator.Append("}");
-
- // This with the ShadowBlurXShader design for a 2-pass 5x5 (sigma=1.0)
- // Weights computed using -- http://dev.theomader.com/gaussian-kernel-calculator/
- fragmentGenerator.AddUniform("camera_properties", "vec2");
- fragmentGenerator.AddUniform("depthCube", "samplerCube");
- // fragmentGenerator.AddUniform("depthSrc", "sampler2D");
- fragmentGenerator.Append("layout(location = 0) out vec4 frag0;");
- fragmentGenerator.Append("layout(location = 1) out vec4 frag1;");
- fragmentGenerator.Append("layout(location = 2) out vec4 frag2;");
- fragmentGenerator.Append("layout(location = 3) out vec4 frag3;");
- fragmentGenerator.Append("layout(location = 4) out vec4 frag4;");
- fragmentGenerator.Append("layout(location = 5) out vec4 frag5;");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tfloat ofsScale = camera_properties.x / 2500.0;");
- fragmentGenerator.Append("\tvec3 dir0 = vec3(1.0, -uv_coords.y, -uv_coords.x);");
- fragmentGenerator.Append("\tvec3 dir1 = vec3(-1.0, -uv_coords.y, uv_coords.x);");
- fragmentGenerator.Append("\tvec3 dir2 = vec3(uv_coords.x, 1.0, uv_coords.y);");
- fragmentGenerator.Append("\tvec3 dir3 = vec3(uv_coords.x, -1.0, -uv_coords.y);");
- fragmentGenerator.Append("\tvec3 dir4 = vec3(uv_coords.x, -uv_coords.y, 1.0);");
- fragmentGenerator.Append("\tvec3 dir5 = vec3(-uv_coords.x, -uv_coords.y, -1.0);");
- fragmentGenerator.Append("\tfloat depth0;");
- fragmentGenerator.Append("\tfloat depth1;");
- fragmentGenerator.Append("\tfloat depth2;");
- fragmentGenerator.Append("\tfloat outDepth;");
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir0).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir0 + vec3(0.0, -ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir0 + vec3(0.0, ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir0 + vec3(0.0, -2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir0 + vec3(0.0, 2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag0 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir1).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir1 + vec3(0.0, -ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir1 + vec3(0.0, ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir1 + vec3(0.0, -2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir1 + vec3(0.0, 2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag1 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir2).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir2 + vec3(0.0, 0.0, -ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir2 + vec3(0.0, 0.0, ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir2 + vec3(0.0, 0.0, -2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir2 + vec3(0.0, 0.0, 2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag2 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir3).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir3 + vec3(0.0, 0.0, -ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir3 + vec3(0.0, 0.0, ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir3 + vec3(0.0, 0.0, -2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir3 + vec3(0.0, 0.0, 2.0*ofsScale)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag3 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir4).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir4 + vec3(0.0, -ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir4 + vec3(0.0, ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir4 + vec3(0.0, -2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir4 + vec3(0.0, 2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag4 = vec4(outDepth);");
-
- fragmentGenerator.Append("\tdepth0 = texture(depthCube, dir5).x;");
- fragmentGenerator.Append(
- "\tdepth1 = texture(depthCube, dir5 + vec3(0.0, -ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth1 += texture(depthCube, dir5 + vec3(0.0, ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 = texture(depthCube, dir5 + vec3(0.0, -2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\tdepth2 += texture(depthCube, dir5 + vec3(0.0, 2.0*ofsScale, 0.0)).x;");
- fragmentGenerator.Append(
- "\toutDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfrag5 = vec4(outDepth);");
-
- fragmentGenerator.Append("}");
-
- CRegisteredString featureName(m_StringTable->RegisterStr("NO_FRAG_OUTPUT"));
- SShaderPreprocessorFeature noFragOutputFeature(featureName, true);
-
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "cubemap shadow blur Y shader", SShaderCacheProgramFlags(),
- TShaderFeatureSet(&noFragOutputFeature, 1));
- NVScopedRefCounted<SShadowmapPreblurShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SShadowmapPreblurShader)(*theShader);
- m_CubeShadowBlurYShader = retval;
- return m_CubeShadowBlurYShader.getValue();
- }
-
- SShadowmapPreblurShader *Qt3DSRendererImpl::GetOrthoShadowBlurXShader()
- {
- if (m_OrthoShadowBlurXShader.hasValue())
- return m_OrthoShadowBlurXShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords.xy = attr_uv.xy;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("camera_properties", "vec2");
- fragmentGenerator.AddUniform("depthSrc", "sampler2D");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec2 ofsScale = vec2( camera_properties.x / 7680.0, 0.0 );");
- fragmentGenerator.Append("\tfloat depth0 = texture(depthSrc, uv_coords).x;");
- fragmentGenerator.Append("\tfloat depth1 = texture(depthSrc, uv_coords + ofsScale).x;");
- fragmentGenerator.Append("\tdepth1 += texture(depthSrc, uv_coords - ofsScale).x;");
- fragmentGenerator.Append(
- "\tfloat depth2 = texture(depthSrc, uv_coords + 2.0 * ofsScale).x;");
- fragmentGenerator.Append("\tdepth2 += texture(depthSrc, uv_coords - 2.0 * ofsScale).x;");
- fragmentGenerator.Append(
- "\tfloat outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfragOutput = vec4(outDepth);");
- fragmentGenerator.Append("}");
-
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "shadow map blur X shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
- NVScopedRefCounted<SShadowmapPreblurShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SShadowmapPreblurShader)(*theShader);
- m_OrthoShadowBlurXShader = retval;
- return m_OrthoShadowBlurXShader.getValue();
- }
-
- SShadowmapPreblurShader *Qt3DSRendererImpl::GetOrthoShadowBlurYShader()
- {
- if (m_OrthoShadowBlurYShader.hasValue())
- return m_OrthoShadowBlurYShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords.xy = attr_uv.xy;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("camera_properties", "vec2");
- fragmentGenerator.AddUniform("depthSrc", "sampler2D");
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec2 ofsScale = vec2( 0.0, camera_properties.x / 7680.0 );");
- fragmentGenerator.Append("\tfloat depth0 = texture(depthSrc, uv_coords).x;");
- fragmentGenerator.Append("\tfloat depth1 = texture(depthSrc, uv_coords + ofsScale).x;");
- fragmentGenerator.Append("\tdepth1 += texture(depthSrc, uv_coords - ofsScale).x;");
- fragmentGenerator.Append(
- "\tfloat depth2 = texture(depthSrc, uv_coords + 2.0 * ofsScale).x;");
- fragmentGenerator.Append("\tdepth2 += texture(depthSrc, uv_coords - 2.0 * ofsScale).x;");
- fragmentGenerator.Append(
- "\tfloat outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2;");
- fragmentGenerator.Append("\tfragOutput = vec4(outDepth);");
- fragmentGenerator.Append("}");
-
- NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
- "shadow map blur Y shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
- NVScopedRefCounted<SShadowmapPreblurShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SShadowmapPreblurShader)(*theShader);
- m_OrthoShadowBlurYShader = retval;
- return m_OrthoShadowBlurYShader.getValue();
- }
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- SAdvancedModeBlendShader *
- Qt3DSRendererImpl::GetAdvancedBlendModeShader(AdvancedBlendModes::Enum blendMode)
- {
- // Select between blend equations.
- if (blendMode == AdvancedBlendModes::Overlay) {
- return GetOverlayBlendModeShader();
- } else if (blendMode == AdvancedBlendModes::ColorBurn) {
- return GetColorBurnBlendModeShader();
- } else if (blendMode == AdvancedBlendModes::ColorDodge) {
- return GetColorDodgeBlendModeShader();
- }
- return {};
- }
-
- SAdvancedModeBlendShader *Qt3DSRendererImpl::GetOverlayBlendModeShader()
- {
- if (m_AdvancedModeOverlayBlendShader.hasValue())
- return m_AdvancedModeOverlayBlendShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("base_layer", "sampler2D");
- fragmentGenerator.AddUniform("blend_layer", "sampler2D");
-
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec4 base = texture2D(base_layer, uv_coords);");
- fragmentGenerator.Append("\tif (base.a != 0.0) base.rgb /= base.a;");
- fragmentGenerator.Append("\telse base = vec4(0.0);");
- fragmentGenerator.Append("\tvec4 blend = texture2D(blend_layer, uv_coords);");
- fragmentGenerator.Append("\tif (blend.a != 0.0) blend.rgb /= blend.a;");
- fragmentGenerator.Append("\telse blend = vec4(0.0);");
-
- fragmentGenerator.Append("\tvec4 res = vec4(0.0);");
- fragmentGenerator.Append("\tfloat p0 = base.a * blend.a;");
- fragmentGenerator.Append("\tfloat p1 = base.a * (1.0 - blend.a);");
- fragmentGenerator.Append("\tfloat p2 = blend.a * (1.0 - base.a);");
- fragmentGenerator.Append("\tres.a = p0 + p1 + p2;");
-
- NVRenderShaderProgram *theShader;
- fragmentGenerator.Append(
- "\tfloat f_rs_rd = (base.r < 0.5? (2.0 * base.r * blend.r) : "
- "(1.0 - 2.0 * (1.0 - base.r) * (1.0 - blend.r)));");
- fragmentGenerator.Append(
- "\tfloat f_gs_gd = (base.g < 0.5? (2.0 * base.g * blend.g) : "
- "(1.0 - 2.0 * (1.0 - base.g) * (1.0 - blend.g)));");
- fragmentGenerator.Append(
- "\tfloat f_bs_bd = (base.b < 0.5? (2.0 * base.b * blend.b) : "
- "(1.0 - 2.0 * (1.0 - base.b) * (1.0 - blend.b)));");
- fragmentGenerator.Append("\tres.r = f_rs_rd * p0 + base.r * p1 + blend.r * p2;");
- fragmentGenerator.Append("\tres.g = f_gs_gd * p0 + base.g * p1 + blend.g * p2;");
- fragmentGenerator.Append("\tres.b = f_bs_bd * p0 + base.b * p1 + blend.b * p2;");
- fragmentGenerator.Append("\tgl_FragColor = vec4(res.rgb * res.a, res.a);");
- fragmentGenerator.Append("}");
- theShader = GetProgramGenerator().CompileGeneratedShader(
- "advanced overlay shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
-
- NVScopedRefCounted<SAdvancedModeBlendShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SAdvancedModeBlendShader)(*theShader);
- m_AdvancedModeOverlayBlendShader = retval;
- return m_AdvancedModeOverlayBlendShader.getValue();
- }
-
- SAdvancedModeBlendShader *Qt3DSRendererImpl::GetColorBurnBlendModeShader()
- {
- if (m_AdvancedModeColorBurnBlendShader.hasValue())
- return m_AdvancedModeColorBurnBlendShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("base_layer", "sampler2D");
- fragmentGenerator.AddUniform("blend_layer", "sampler2D");
-
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec4 base = texture2D(base_layer, uv_coords);");
- fragmentGenerator.Append("\tif (base.a != 0.0) base.rgb /= base.a;");
- fragmentGenerator.Append("\telse base = vec4(0.0);");
- fragmentGenerator.Append("\tvec4 blend = texture2D(blend_layer, uv_coords);");
- fragmentGenerator.Append("\tif (blend.a != 0.0) blend.rgb /= blend.a;");
- fragmentGenerator.Append("\telse blend = vec4(0.0);");
-
- fragmentGenerator.Append("\tvec4 res = vec4(0.0);");
- fragmentGenerator.Append("\tfloat p0 = base.a * blend.a;");
- fragmentGenerator.Append("\tfloat p1 = base.a * (1.0 - blend.a);");
- fragmentGenerator.Append("\tfloat p2 = blend.a * (1.0 - base.a);");
- fragmentGenerator.Append("\tres.a = p0 + p1 + p2;");
-
- NVRenderShaderProgram *theShader;
- fragmentGenerator.Append(
- "\tfloat f_rs_rd = ((base.r == 1.0) ? 1.0 : "
- "(blend.r == 0.0) ? 0.0 : 1.0 - min(1.0, ((1.0 - base.r) / blend.r)));");
- fragmentGenerator.Append(
- "\tfloat f_gs_gd = ((base.g == 1.0) ? 1.0 : "
- "(blend.g == 0.0) ? 0.0 : 1.0 - min(1.0, ((1.0 - base.g) / blend.g)));");
- fragmentGenerator.Append(
- "\tfloat f_bs_bd = ((base.b == 1.0) ? 1.0 : "
- "(blend.b == 0.0) ? 0.0 : 1.0 - min(1.0, ((1.0 - base.b) / blend.b)));");
- fragmentGenerator.Append("\tres.r = f_rs_rd * p0 + base.r * p1 + blend.r * p2;");
- fragmentGenerator.Append("\tres.g = f_gs_gd * p0 + base.g * p1 + blend.g * p2;");
- fragmentGenerator.Append("\tres.b = f_bs_bd * p0 + base.b * p1 + blend.b * p2;");
- fragmentGenerator.Append("\tgl_FragColor = vec4(res.rgb * res.a, res.a);");
- fragmentGenerator.Append("}");
-
- theShader = GetProgramGenerator().CompileGeneratedShader(
- "advanced colorBurn shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
- NVScopedRefCounted<SAdvancedModeBlendShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SAdvancedModeBlendShader)(*theShader);
- m_AdvancedModeColorBurnBlendShader = retval;
- return m_AdvancedModeColorBurnBlendShader.getValue();
-
- }
-
- SAdvancedModeBlendShader *Qt3DSRendererImpl::GetColorDodgeBlendModeShader()
- {
- if (m_AdvancedModeColorDodgeBlendShader.hasValue())
- return m_AdvancedModeColorDodgeBlendShader.getValue();
-
- GetProgramGenerator().BeginProgram();
-
- IShaderStageGenerator &vertexGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Vertex));
- IShaderStageGenerator &fragmentGenerator(
- *GetProgramGenerator().GetStage(ShaderGeneratorStages::Fragment));
- vertexGenerator.AddIncoming("attr_pos", "vec3");
- vertexGenerator.AddIncoming("attr_uv", "vec2");
- vertexGenerator.AddOutgoing("uv_coords", "vec2");
- vertexGenerator.Append("void main() {");
- vertexGenerator.Append("\tgl_Position = vec4(attr_pos, 1.0 );");
- vertexGenerator.Append("\tuv_coords = attr_uv;");
- vertexGenerator.Append("}");
-
- fragmentGenerator.AddUniform("base_layer", "sampler2D");
- fragmentGenerator.AddUniform("blend_layer", "sampler2D");
-
- fragmentGenerator.Append("void main() {");
- fragmentGenerator.Append("\tvec4 base = texture2D(base_layer, uv_coords);");
- fragmentGenerator.Append("\tif (base.a != 0.0) base.rgb /= base.a;");
- fragmentGenerator.Append("\telse base = vec4(0.0);");
- fragmentGenerator.Append("\tvec4 blend = texture2D(blend_layer, uv_coords);");
- fragmentGenerator.Append("\tif (blend.a != 0.0) blend.rgb /= blend.a;");
- fragmentGenerator.Append("\telse blend = vec4(0.0);");
-
- fragmentGenerator.Append("\tvec4 res = vec4(0.0);");
- fragmentGenerator.Append("\tfloat p0 = base.a * blend.a;");
- fragmentGenerator.Append("\tfloat p1 = base.a * (1.0 - blend.a);");
- fragmentGenerator.Append("\tfloat p2 = blend.a * (1.0 - base.a);");
- fragmentGenerator.Append("\tres.a = p0 + p1 + p2;");
-
- NVRenderShaderProgram *theShader;
- fragmentGenerator.Append(
- "\tfloat f_rs_rd = ((base.r == 0.0) ? 0.0 : "
- "(blend.r == 1.0) ? 1.0 : min(base.r / (1.0 - blend.r), 1.0));");
- fragmentGenerator.Append(
- "\tfloat f_gs_gd = ((base.g == 0.0) ? 0.0 : "
- "(blend.g == 1.0) ? 1.0 : min(base.g / (1.0 - blend.g), 1.0));");
- fragmentGenerator.Append(
- "\tfloat f_bs_bd = ((base.b == 0.0) ? 0.0 : "
- "(blend.b == 1.0) ? 1.0 : min(base.b / (1.0 - blend.b), 1.0));");
- fragmentGenerator.Append("\tres.r = f_rs_rd * p0 + base.r * p1 + blend.r * p2;");
- fragmentGenerator.Append("\tres.g = f_gs_gd * p0 + base.g * p1 + blend.g * p2;");
- fragmentGenerator.Append("\tres.b = f_bs_bd * p0 + base.b * p1 + blend.b * p2;");
-
- fragmentGenerator.Append("\tgl_FragColor = vec4(res.rgb * res.a, res.a);");
- fragmentGenerator.Append("}");
- theShader = GetProgramGenerator().CompileGeneratedShader(
- "advanced colorDodge shader", SShaderCacheProgramFlags(), TShaderFeatureSet());
- NVScopedRefCounted<SAdvancedModeBlendShader> retval;
- if (theShader)
- retval = QT3DS_NEW(m_Context->GetAllocator(), SAdvancedModeBlendShader)(*theShader);
- m_AdvancedModeColorDodgeBlendShader = retval;
- return m_AdvancedModeColorDodgeBlendShader.getValue();
-
- }
-#endif
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.h
deleted file mode 100644
index 1ac85dbf..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.h
+++ /dev/null
@@ -1,452 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDERER_IMPL_SHADERS_H
-#define QT3DS_RENDERER_IMPL_SHADERS_H
-#include "Qt3DSRender.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-#include "render/Qt3DSRenderProgramPipeline.h"
-
-namespace qt3ds {
-namespace render {
- using qt3ds::render::NVRenderCachedShaderProperty;
- using qt3ds::render::NVRenderCachedShaderBuffer;
-
- /**
- * Cached tessellation property lookups this is on a per mesh base
- */
- struct SShaderTessellationProperties
- {
- NVRenderCachedShaderProperty<QT3DSF32> m_EdgeTessLevel; ///< tesselation value for the edges
- NVRenderCachedShaderProperty<QT3DSF32> m_InsideTessLevel; ///< tesselation value for the inside
- NVRenderCachedShaderProperty<QT3DSF32>
- m_PhongBlend; ///< blending between linear and phong component
- NVRenderCachedShaderProperty<QT3DSVec2>
- m_DistanceRange; ///< distance range for min and max tess level
- NVRenderCachedShaderProperty<QT3DSF32> m_DisableCulling; ///< if set to 1.0 this disables
- ///backface culling optimization in
- ///the tess shader
-
- SShaderTessellationProperties() {}
- SShaderTessellationProperties(NVRenderShaderProgram &inShader)
- : m_EdgeTessLevel("tessLevelOuter", inShader)
- , m_InsideTessLevel("tessLevelInner", inShader)
- , m_PhongBlend("phongBlend", inShader)
- , m_DistanceRange("distanceRange", inShader)
- , m_DisableCulling("disableCulling", inShader)
- {
- }
- };
-
- /**
- * The results of generating a shader. Caches all possible variable names into
- * typesafe objects.
- */
- struct SShaderGeneratorGeneratedShader
- {
- QT3DSU32 m_LayerSetIndex;
- CRegisteredString m_QueryString;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewportMatrix;
- SShaderTessellationProperties m_Tessellation;
-
- SShaderGeneratorGeneratedShader(CRegisteredString inQueryString,
- NVRenderShaderProgram &inShader)
- : m_LayerSetIndex(QT3DS_MAX_U32)
- , m_QueryString(inQueryString)
- , m_Shader(inShader)
- , m_ViewportMatrix("viewport_matrix", inShader)
- , m_Tessellation(inShader)
- {
- m_Shader.addRef();
- }
- ~SShaderGeneratorGeneratedShader() { m_Shader.release(); }
- static QT3DSU32 GetLayerIndex(const SShaderGeneratorGeneratedShader &inShader)
- {
- return inShader.m_LayerSetIndex;
- }
- static void SetLayerIndex(SShaderGeneratorGeneratedShader &inShader, QT3DSU32 idx)
- {
- inShader.m_LayerSetIndex = idx;
- }
- };
-
- struct SDefaultMaterialRenderableDepthShader
- {
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
-
- QT3DSI32 m_RefCount;
- SDefaultMaterialRenderableDepthShader(NVRenderShaderProgram &inShader,
- NVRenderContext &inContext)
- : m_Allocator(inContext.GetAllocator())
- , m_Shader(inShader)
- , m_MVP("model_view_projection", inShader)
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
-
- ~SDefaultMaterialRenderableDepthShader() { m_Shader.release(); }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0)
- NVDelete(m_Allocator, this);
- }
- };
-
- /**
- * Cached texture property lookups, used one per texture so a shader generator for N
- * textures will have an array of N of these lookup objects.
- */
- struct SShaderTextureProperties
- {
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
- NVRenderCachedShaderProperty<QT3DSVec3> m_Offsets;
- NVRenderCachedShaderProperty<QT3DSVec4> m_Rotations;
- SShaderTextureProperties(const char *sampName, const char *offName, const char *rotName,
- NVRenderShaderProgram &inShader)
- : m_Sampler(sampName, inShader)
- , m_Offsets(offName, inShader)
- , m_Rotations(rotName, inShader)
- {
- }
- SShaderTextureProperties() {}
- };
-
- struct SRenderableDepthPrepassShader
- {
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
- NVRenderCachedShaderProperty<QT3DSMat44> m_GlobalTransform;
- NVRenderCachedShaderProperty<QT3DSMat44> m_Projection;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraPosition;
- NVRenderCachedShaderProperty<QT3DSF32> m_DisplaceAmount;
- SShaderTextureProperties m_DisplacementProps;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraDirection;
- // NVRenderCachedShaderProperty<QT3DSMat44> m_ShadowMV[6];
-
- QT3DSI32 m_RefCount;
- // Cache the tessellation property name lookups
- SShaderTessellationProperties m_Tessellation;
-
- SRenderableDepthPrepassShader(NVRenderShaderProgram &inShader, NVRenderContext &inContext)
- : m_Allocator(inContext.GetAllocator())
- , m_Shader(inShader)
- , m_MVP("model_view_projection", inShader)
- , m_GlobalTransform("model_matrix", inShader)
- , m_Projection("projection", inShader)
- , m_CameraPosition("camera_position", inShader)
- , m_DisplaceAmount("displaceAmount", inShader)
- , m_DisplacementProps("displacementSampler", "displacementMap_offset",
- "displacementMap_rot", inShader)
- , m_CameraProperties("camera_properties", inShader)
- , m_CameraDirection("camera_direction", inShader)
- , m_RefCount(0)
- , m_Tessellation(inShader)
- {
- /*
- m_ShadowMV[0].m_Shader = &inShader;
- m_ShadowMV[0].m_Constant = inShader.GetShaderConstant( "shadow_mv0" );
- m_ShadowMV[1].m_Shader = &inShader;
- m_ShadowMV[1].m_Constant = inShader.GetShaderConstant( "shadow_mv1" );
- m_ShadowMV[2].m_Shader = &inShader;
- m_ShadowMV[2].m_Constant = inShader.GetShaderConstant( "shadow_mv2" );
- m_ShadowMV[3].m_Shader = &inShader;
- m_ShadowMV[3].m_Constant = inShader.GetShaderConstant( "shadow_mv3" );
- m_ShadowMV[4].m_Shader = &inShader;
- m_ShadowMV[4].m_Constant = inShader.GetShaderConstant( "shadow_mv4" );
- m_ShadowMV[5].m_Shader = &inShader;
- m_ShadowMV[5].m_Constant = inShader.GetShaderConstant( "shadow_mv5" );
- */
- m_Shader.addRef();
- }
-
- ~SRenderableDepthPrepassShader() { m_Shader.release(); }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0)
- NVDelete(m_Allocator, this);
- }
- };
-
- struct SDefaultAoPassShader
- {
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_ViewMatrix;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
- NVRenderCachedShaderProperty<QT3DSVec3> m_CameraDirection;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_DepthTexture;
- NVRenderCachedShaderProperty<NVRenderTextureCube *> m_CubeTexture;
- NVRenderCachedShaderProperty<QT3DSVec2> m_DepthSamplerSize;
-
- NVRenderCachedShaderBuffer<qt3ds::render::NVRenderShaderConstantBuffer *> m_AoShadowParams;
- QT3DSI32 m_RefCount;
-
- SDefaultAoPassShader(NVRenderShaderProgram &inShader, NVRenderContext &inContext)
- : m_Allocator(inContext.GetAllocator())
- , m_Shader(inShader)
- , m_ViewMatrix("view_matrix", inShader)
- , m_CameraProperties("camera_properties", inShader)
- , m_CameraDirection("camera_direction", inShader)
- , m_DepthTexture("depth_sampler", inShader)
- , m_CubeTexture("depth_cube", inShader)
- , m_DepthSamplerSize("depth_sampler_size", inShader)
- , m_AoShadowParams("cbAoShadow", inShader)
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
- ~SDefaultAoPassShader() { m_Shader.release(); }
-
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0)
- NVDelete(m_Allocator, this);
- }
- };
-
- struct STextShader
- {
- NVRenderShaderProgram &m_Shader;
-
- NVScopedRefCounted<NVRenderProgramPipeline> m_ProgramPipeline;
-
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
- // Dimensions and offsetting of the image.
- NVRenderCachedShaderProperty<QT3DSVec4> m_Dimensions;
- // The fourth member of text color is the opacity
- NVRenderCachedShaderProperty<QT3DSVec4> m_TextColor;
- NVRenderCachedShaderProperty<QT3DSVec3> m_BackgroundColor;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
- // Dimensions and offsetting of the texture
- NVRenderCachedShaderProperty<QT3DSVec3> m_TextDimensions;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
- // Used only for onscreen text
- NVRenderCachedShaderProperty<QT3DSVec2> m_VertexOffsets;
-
- STextShader(NVRenderShaderProgram &shader, NVRenderProgramPipeline *pipeline = NULL)
- : m_Shader(shader)
- , m_ProgramPipeline(pipeline)
- , m_MVP("model_view_projection", shader)
- , m_Dimensions("text_dimensions", shader)
- , m_TextColor("text_textcolor", shader)
- , m_BackgroundColor("text_backgroundcolor", shader)
- , m_Sampler("text_image", shader)
- , m_TextDimensions("text_textdimensions", shader)
- , m_CameraProperties("camera_properties", shader)
- , m_VertexOffsets("vertex_offsets", shader)
- {
- if (!pipeline)
- m_Shader.addRef();
- }
- ~STextShader()
- {
- if (!m_ProgramPipeline.mPtr)
- m_Shader.release();
- }
- void Render(NVRenderTexture2D &inTexture, const STextScaleAndOffset &inScaleAndOffset,
- const QT3DSVec4 &inTextColor, const QT3DSMat44 &inMVP, const QT3DSVec2 &inCameraVec,
- NVRenderContext &inRenderContext,
- NVRenderInputAssembler &inInputAssemblerBuffer, QT3DSU32 count,
- const STextTextureDetails &inTextTextureDetails,
- const QT3DSVec3 &inBackgroundColor);
-
- void RenderPath(NVRenderPathFontItem &inPathFontItem,
- NVRenderPathFontSpecification &inPathFontSpec,
- const STextScaleAndOffset &inScaleAndOffset, const QT3DSVec4 &inTextColor,
- const QT3DSMat44 &inViewProjection, const QT3DSMat44 &inModel,
- const QT3DSVec2 &inCameraVec, NVRenderContext &inRenderContext,
- const STextTextureDetails &inTextTextureDetails,
- const QT3DSVec3 &inBackgroundColor);
-
- void Render2D(NVRenderTexture2D &inTexture, const QT3DSVec4 &inTextColor, const QT3DSMat44 &inMVP,
- NVRenderContext &inRenderContext,
- NVRenderInputAssembler &inInputAssemblerBuffer, QT3DSU32 count,
- QT3DSVec2 inVertexOffsets);
- };
-
- struct STextDepthShader
- {
- NVAllocatorCallback &m_Allocator;
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
- // Dimensions and offsetting of the image.
- NVRenderCachedShaderProperty<QT3DSVec4> m_Dimensions;
- NVRenderCachedShaderProperty<QT3DSVec3> m_TextDimensions;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
- NVRenderInputAssembler &m_QuadInputAssembler;
- QT3DSI32 m_RefCount;
-
- STextDepthShader(NVAllocatorCallback &alloc, NVRenderShaderProgram &prog,
- NVRenderInputAssembler &assembler)
- : m_Allocator(alloc)
- , m_Shader(prog)
- , m_MVP("model_view_projection", prog)
- , m_Dimensions("text_dimensions", prog)
- , m_TextDimensions("text_textdimensions", prog)
- , m_CameraProperties("camera_properties", prog)
- , m_Sampler("text_image", prog)
- , m_QuadInputAssembler(assembler)
- , m_RefCount(0)
- {
- m_Shader.addRef();
- }
- ~STextDepthShader() { m_Shader.release(); }
- void addRef() { ++m_RefCount; }
- void release()
- {
- --m_RefCount;
- if (m_RefCount <= 0)
- NVDelete(m_Allocator, this);
- }
- };
-
- struct SLayerProgAABlendShader
- {
- NVScopedRefCounted<NVRenderShaderProgram> m_Shader;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_AccumSampler;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_LastFrame;
- NVRenderCachedShaderProperty<QT3DSVec2> m_BlendFactors;
- volatile QT3DSI32 mRefCount;
- SLayerProgAABlendShader(NVRenderShaderProgram &inShader)
- : m_Shader(inShader)
- , m_AccumSampler("accumulator", inShader)
- , m_LastFrame("last_frame", inShader)
- , m_BlendFactors("blend_factors", inShader)
- , mRefCount(0)
- {
- }
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader->GetRenderContext().GetAllocator())
- };
-
- struct SLayerSceneShader
- {
- NVRenderShaderProgram &m_Shader;
-
- NVRenderCachedShaderProperty<QT3DSMat44> m_MVP;
- // Dimensions and offsetting of the image.
- NVRenderCachedShaderProperty<QT3DSVec2> m_Dimensions;
- // The fourth member of text color is the opacity
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_Sampler;
-
- volatile QT3DSI32 mRefCount;
-
- SLayerSceneShader(NVRenderShaderProgram &inShader)
- : m_Shader(inShader)
- , m_MVP("model_view_projection", inShader)
- , m_Dimensions("layer_dimensions", inShader)
- , m_Sampler("layer_image", inShader)
- , mRefCount(0)
- {
- m_Shader.addRef();
- }
- ~SLayerSceneShader() { m_Shader.release(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader.GetRenderContext().GetAllocator())
- };
-
- struct SShadowmapPreblurShader
- {
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<QT3DSVec2> m_CameraProperties;
- NVRenderCachedShaderProperty<NVRenderTextureCube *> m_DepthCube;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_DepthMap;
-
- volatile QT3DSI32 mRefCount;
-
- SShadowmapPreblurShader(NVRenderShaderProgram &inShader)
- : m_Shader(inShader)
- , m_CameraProperties("camera_properties", inShader)
- , m_DepthCube("depthCube", inShader)
- , m_DepthMap("depthSrc", inShader)
- , mRefCount(0)
- {
- m_Shader.addRef();
- }
- ~SShadowmapPreblurShader() { m_Shader.release(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader.GetRenderContext().GetAllocator())
- };
-
-#ifdef ADVANCED_BLEND_SW_FALLBACK
- struct SAdvancedModeBlendShader
- {
- NVRenderShaderProgram &m_Shader;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_baseLayer;
- NVRenderCachedShaderProperty<NVRenderTexture2D *> m_blendLayer;
-
- volatile QT3DSI32 mRefCount;
-
- SAdvancedModeBlendShader(NVRenderShaderProgram &inShader)
- : m_Shader(inShader)
- , m_baseLayer("base_layer", inShader)
- , m_blendLayer("blend_layer", inShader)
- , mRefCount(0)
- {
- m_Shader.addRef();
- }
- ~SAdvancedModeBlendShader() { m_Shader.release(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Shader.GetRenderContext().GetAllocator())
-
- };
-#endif
-
- struct SGGSGet
- {
- QT3DSU32 operator()(const SShaderGeneratorGeneratedShader &inShader)
- {
- return inShader.m_LayerSetIndex;
- }
- };
- struct SGGSSet
- {
- void operator()(SShaderGeneratorGeneratedShader &inShader, QT3DSU32 idx)
- {
- inShader.m_LayerSetIndex = idx;
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSVertexPipelineImpl.h b/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSVertexPipelineImpl.h
deleted file mode 100644
index a9b5e7b2..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/rendererimpl/Qt3DSVertexPipelineImpl.h
+++ /dev/null
@@ -1,463 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_VERTEX_PIPELINE_IMPL_H
-#define QT3DS_VERTEX_PIPELINE_IMPL_H
-#include "Qt3DSRenderDefaultMaterialShaderGenerator.h"
-
-namespace qt3ds {
-namespace render {
- // Baseclass for the vertex pipelines to be sure we have consistent implementations.
- struct SVertexPipelineImpl : public IDefaultMaterialVertexPipeline
- {
- struct GenerationFlagValues
- {
- enum Enum {
- UVCoords = 1,
- EnvMapReflection = 1 << 1,
- ViewVector = 1 << 2,
- WorldNormal = 1 << 3,
- ObjectNormal = 1 << 4,
- WorldPosition = 1 << 5,
- TangentBinormal = 1 << 6,
- UVCoords1 = 1 << 7,
- VertexColor = 1 << 8,
- };
- };
-
- typedef TStrTableStrMap::const_iterator TParamIter;
- typedef NVFlags<GenerationFlagValues::Enum> TGenerationFlags;
-
- IMaterialShaderGenerator &m_MaterialGenerator;
- IShaderProgramGenerator &m_ProgramGenerator;
- IStringTable &m_StringTable;
- Qt3DSString m_TempString;
-
- TGenerationFlags m_GenerationFlags;
- bool m_Wireframe;
- TStrTableStrMap m_InterpolationParameters;
- QT3DSU32 m_DisplacementIdx;
- SRenderableImage *m_DisplacementImage;
- QStringList m_addedFunctions;
-
- SVertexPipelineImpl(NVAllocatorCallback &inAllocator, IMaterialShaderGenerator &inMaterial,
- IShaderProgramGenerator &inProgram, IStringTable &inStringTable,
- bool inWireframe // only works if tessellation is true
- )
-
- : m_MaterialGenerator(inMaterial)
- , m_ProgramGenerator(inProgram)
- , m_StringTable(inStringTable)
- , m_Wireframe(inWireframe)
- , m_InterpolationParameters(inAllocator, "m_InterpolationParameters")
- , m_DisplacementIdx(0)
- , m_DisplacementImage(NULL)
- {
- }
-
- // Trues true if the code was *not* set.
- bool SetCode(GenerationFlagValues::Enum inCode)
- {
- if (((QT3DSU32)m_GenerationFlags & inCode) != 0)
- return true;
- m_GenerationFlags |= inCode;
- return false;
- }
- bool HasCode(GenerationFlagValues::Enum inCode)
- {
- return ((QT3DSU32)(m_GenerationFlags & inCode)) != 0;
- }
- IShaderProgramGenerator &ProgramGenerator() { return m_ProgramGenerator; }
- IShaderStageGenerator &Vertex()
- {
- return *ProgramGenerator().GetStage(ShaderGeneratorStages::Vertex);
- }
- IShaderStageGenerator &TessControl()
- {
- return *ProgramGenerator().GetStage(ShaderGeneratorStages::TessControl);
- }
- IShaderStageGenerator &TessEval()
- {
- return *ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval);
- }
- IShaderStageGenerator &Geometry()
- {
- return *ProgramGenerator().GetStage(ShaderGeneratorStages::Geometry);
- }
- IShaderStageGenerator &Fragment()
- {
- return *ProgramGenerator().GetStage(ShaderGeneratorStages::Fragment);
- }
- IMaterialShaderGenerator &MaterialGenerator() { return m_MaterialGenerator; }
-
- void SetupDisplacement(QT3DSU32 displacementImageIdx, SRenderableImage *displacementImage)
- {
- m_DisplacementIdx = displacementImageIdx;
- m_DisplacementImage = displacementImage;
- }
-
- CRegisteredString Str(const char8_t *inItem) { return m_StringTable.RegisterStr(inItem); }
-
- bool HasTessellation() const
- {
- return m_ProgramGenerator.GetEnabledStages() & ShaderGeneratorStages::TessEval;
- }
- bool HasGeometryStage() const
- {
- return m_ProgramGenerator.GetEnabledStages() & ShaderGeneratorStages::Geometry;
- }
- bool HasDisplacment() const { return m_DisplacementImage != NULL; }
-
- void InitializeWireframeGeometryShader()
- {
- if (m_Wireframe && ProgramGenerator().GetStage(ShaderGeneratorStages::Geometry)
- && ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval)) {
- IShaderStageGenerator &geometryShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::Geometry));
- // currently geometry shader is only used for drawing wireframe
- if (m_Wireframe) {
- geometryShader.AddUniform("viewport_matrix", "mat4");
- geometryShader.AddOutgoing("varEdgeDistance", "vec3");
- geometryShader.Append("layout (triangles) in;");
- geometryShader.Append("layout (triangle_strip, max_vertices = 3) out;");
- geometryShader.Append("void main() {");
-
- // how this all work see
- // http://developer.download.nvidia.com/SDK/10.5/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf
-
- geometryShader.Append(
- "// project points to screen space\n"
- "\tvec3 p0 = vec3(viewport_matrix * (gl_in[0].gl_Position / "
- "gl_in[0].gl_Position.w));\n"
- "\tvec3 p1 = vec3(viewport_matrix * (gl_in[1].gl_Position / "
- "gl_in[1].gl_Position.w));\n"
- "\tvec3 p2 = vec3(viewport_matrix * (gl_in[2].gl_Position / "
- "gl_in[2].gl_Position.w));\n"
- "// compute triangle heights\n"
- "\tfloat e1 = length(p1 - p2);\n"
- "\tfloat e2 = length(p2 - p0);\n"
- "\tfloat e3 = length(p1 - p0);\n"
- "\tfloat alpha = acos( (e2*e2 + e3*e3 - e1*e1) / (2.0*e2*e3) );\n"
- "\tfloat beta = acos( (e1*e1 + e3*e3 - e2*e2) / (2.0*e1*e3) );\n"
- "\tfloat ha = abs( e3 * sin( beta ) );\n"
- "\tfloat hb = abs( e3 * sin( alpha ) );\n"
- "\tfloat hc = abs( e2 * sin( alpha ) );\n");
- }
- }
- }
-
- void FinalizeWireframeGeometryShader()
- {
- IShaderStageGenerator &geometryShader(
- *ProgramGenerator().GetStage(ShaderGeneratorStages::Geometry));
-
- if (m_Wireframe == true && ProgramGenerator().GetStage(ShaderGeneratorStages::Geometry)
- && ProgramGenerator().GetStage(ShaderGeneratorStages::TessEval)) {
- const char8_t *theExtension("TE[");
- // we always assume triangles
- for (int i = 0; i < 3; i++) {
- char buf[10];
- sprintf(buf, "%d", i);
- for (TStrTableStrMap::const_iterator iter = m_InterpolationParameters.begin(),
- end = m_InterpolationParameters.end();
- iter != end; ++iter) {
- geometryShader << "\t" << iter->first.c_str() << " = "
- << iter->first.c_str() << theExtension << buf << "];\n";
- }
-
- geometryShader << "\tgl_Position = gl_in[" << buf << "].gl_Position;\n";
- // the triangle distance is interpolated through the shader stage
- if (i == 0)
- geometryShader << "\n\tvarEdgeDistance = vec3(ha*"
- << "gl_in[" << buf << "].gl_Position.w, 0.0, 0.0);\n";
- else if (i == 1)
- geometryShader << "\n\tvarEdgeDistance = vec3(0.0, hb*"
- << "gl_in[" << buf << "].gl_Position.w, 0.0);\n";
- else if (i == 2)
- geometryShader << "\n\tvarEdgeDistance = vec3(0.0, 0.0, hc*"
- << "gl_in[" << buf << "].gl_Position.w);\n";
-
- // submit vertex
- geometryShader << "\tEmitVertex();\n";
- }
- // end primitive
- geometryShader << "\tEndPrimitive();\n";
- }
- }
-
- virtual void SetupTessIncludes(ShaderGeneratorStages::Enum inStage,
- TessModeValues::Enum inTessMode)
- {
- IShaderStageGenerator &tessShader(*ProgramGenerator().GetStage(inStage));
-
- // depending on the selected tessellation mode chose program
- switch (inTessMode) {
- case TessModeValues::TessPhong:
- tessShader.AddInclude("tessellationPhong.glsllib");
- break;
- case TessModeValues::TessNPatch:
- tessShader.AddInclude("tessellationNPatch.glsllib");
- break;
- default:
- QT3DS_ASSERT(false); // fallthrough intentional
- case TessModeValues::TessLinear:
- tessShader.AddInclude("tessellationLinear.glsllib");
- break;
- }
- }
-
- void GenerateUVCoords(QT3DSU32 inUVSet = 0) override
- {
- if (inUVSet == 0 && SetCode(GenerationFlagValues::UVCoords))
- return;
- if (inUVSet == 1 && SetCode(GenerationFlagValues::UVCoords1))
- return;
-
- QT3DS_ASSERT(inUVSet == 0 || inUVSet == 1);
-
- if (inUVSet == 0)
- AddInterpolationParameter("varTexCoord0", "vec2");
- else if (inUVSet == 1)
- AddInterpolationParameter("varTexCoord1", "vec2");
-
- DoGenerateUVCoords(inUVSet);
- }
- void GenerateEnvMapReflection() override
- {
- if (SetCode(GenerationFlagValues::EnvMapReflection))
- return;
-
- GenerateWorldPosition();
- GenerateWorldNormal();
- IShaderStageGenerator &activeGenerator(ActiveStage());
- activeGenerator.AddInclude("viewProperties.glsllib");
- AddInterpolationParameter("var_object_to_camera", "vec3");
- activeGenerator.Append("\tvar_object_to_camera = normalize( local_model_world_position "
- "- camera_position );");
- // World normal cannot be relied upon in the vertex shader because of bump maps.
- Fragment().Append("\tvec3 environment_map_reflection = reflect( "
- "normalize(var_object_to_camera), world_normal.xyz );");
- Fragment().Append("\tenvironment_map_reflection *= vec3( 0.5, 0.5, 0 );");
- Fragment().Append("\tenvironment_map_reflection += vec3( 0.5, 0.5, 1.0 );");
- }
- void GenerateViewVector() override
- {
- if (SetCode(GenerationFlagValues::ViewVector))
- return;
- GenerateWorldPosition();
- IShaderStageGenerator &activeGenerator(ActiveStage());
- activeGenerator.AddInclude("viewProperties.glsllib");
- AddInterpolationParameter("varViewVector", "vec3");
- activeGenerator.Append("\tvec3 local_view_vector = normalize(camera_position - "
- "local_model_world_position);");
- AssignOutput("varViewVector", "local_view_vector");
- Fragment() << "\tvec3 view_vector = normalize(varViewVector);" << Endl;
- }
-
- // fragment shader expects varying vertex normal
- // lighting in vertex pipeline expects world_normal
- void GenerateWorldNormal() override
- {
- if (SetCode(GenerationFlagValues::WorldNormal))
- return;
- AddInterpolationParameter("varNormal", "vec3");
- DoGenerateWorldNormal();
- Fragment().Append("\tvec3 world_normal = normalize( varNormal );");
- }
- void GenerateObjectNormal() override
- {
- if (SetCode(GenerationFlagValues::ObjectNormal))
- return;
- DoGenerateObjectNormal();
- Fragment().Append("\tvec3 object_normal = normalize(varObjectNormal);");
- }
- void GenerateWorldPosition() override
- {
- if (SetCode(GenerationFlagValues::WorldPosition))
- return;
-
- ActiveStage().AddUniform("model_matrix", "mat4");
- AddInterpolationParameter("varWorldPos", "vec3");
- DoGenerateWorldPosition();
-
- AssignOutput("varWorldPos", "local_model_world_position");
- }
- void GenerateVarTangentAndBinormal() override
- {
- if (SetCode(GenerationFlagValues::TangentBinormal))
- return;
- AddInterpolationParameter("varTangent", "vec3");
- AddInterpolationParameter("varBinormal", "vec3");
- DoGenerateVarTangentAndBinormal();
- Fragment() << "\tvec3 tangent = normalize(varTangent);" << Endl
- << "\tvec3 binormal = normalize(varBinormal);" << Endl;
- }
- void GenerateVertexColor() override
- {
- if (SetCode(GenerationFlagValues::VertexColor))
- return;
- AddInterpolationParameter("varColor", "vec3");
- DoGenerateVertexColor();
- Fragment().Append("\tvec3 vertColor = varColor;");
- }
-
- bool HasActiveWireframe() override { return m_Wireframe; }
-
- // IShaderStageGenerator interface
- void AddIncoming(const char8_t *name, const char8_t *type) override
- {
- ActiveStage().AddIncoming(name, type);
- }
- void AddIncoming(const TStrType &name, const char8_t *type) override
- {
- AddIncoming(name.c_str(), type);
- }
- void AddIncoming(const QString &name, const char8_t *type) override
- {
- AddIncoming(name.toUtf8().constData(), type);
- }
-
- void AddOutgoing(const char8_t *name, const char8_t *type) override
- {
- AddInterpolationParameter(name, type);
- }
- void AddOutgoing(const TStrType &name, const char8_t *type) override
- {
- AddOutgoing(name.c_str(), type);
- }
- void AddOutgoing(const QString &name, const char8_t *type) override
- {
- AddOutgoing(name.toUtf8().constData(), type);
- }
- void AddUniform(const QString &name, const char8_t *type) override
- {
- AddUniform(name.toUtf8().constData(), type);
- }
-
- void AddUniform(const char8_t *name, const char8_t *type) override
- {
- ActiveStage().AddUniform(name, type);
- }
- void AddUniform(const TStrType &name, const char8_t *type) override
- {
- AddUniform(name.c_str(), type);
- }
-
- void AddInclude(const char8_t *name) override { ActiveStage().AddInclude(name); }
- void AddInclude(const TStrType &name) override { AddInclude(name.c_str()); }
- void AddInclude(const QString &name) override
- {
- QByteArray arr = name.toLatin1();
- AddInclude(arr.data());
- }
-
- void AddFunction(const QString &functionName) override
- {
- if (!m_addedFunctions.contains(functionName)) {
- m_addedFunctions.push_back(functionName);
- QString includeName;
- QTextStream stream(&includeName);
- stream << "func" << functionName << ".glsllib";
- AddInclude(includeName);
- }
- }
-
- void AddConstantBuffer(const char *name, const char *layout) override
- {
- ActiveStage().AddConstantBuffer(name, layout);
- }
- void AddConstantBuffer(const QString &name, const char *layout) override
- {
- AddConstantBuffer(name.toUtf8().constData(), layout);
- }
-
- void AddConstantBufferParam(const char *cbName, const char *paramName,
- const char *type) override
- {
- ActiveStage().AddConstantBufferParam(cbName, paramName, type);
- }
- void AddConstantBufferParam(const QString &cbName, const QString &paramName,
- const char *type) override
- {
- AddConstantBufferParam(cbName.toUtf8().constData(),
- paramName.toUtf8().constData(), type);
- }
-
- IShaderStageGenerator &operator<<(const char *data) override
- {
- ActiveStage() << data;
- return *this;
- }
- IShaderStageGenerator &operator<<(const TStrType &data) override
- {
- ActiveStage() << data;
- return *this;
- }
- IShaderStageGenerator &operator<<(const QString &data) override
- {
- ActiveStage() << data;
- return *this;
- }
- IShaderStageGenerator &operator<<(const SEndlType &data) override
- {
- ActiveStage() << data;
- return *this;
- }
- void Append(const char *data) override { ActiveStage().Append(data); }
- void AppendPartial(const char *data) override { ActiveStage().Append(data); }
-
- ShaderGeneratorStages::Enum Stage() const override
- {
- return const_cast<SVertexPipelineImpl *>(this)->ActiveStage().Stage();
- }
-
- void BeginVertexGeneration(QT3DSU32 displacementImageIdx,
- SRenderableImage *displacementImage) override = 0;
- void AssignOutput(const char8_t *inVarName, const char8_t *inVarValueExpr) override = 0;
- void EndVertexGeneration(bool customShader) override = 0;
-
- void BeginFragmentGeneration() override = 0;
- void EndFragmentGeneration(bool customShader) override = 0;
-
- virtual IShaderStageGenerator &ActiveStage() = 0;
- virtual void AddInterpolationParameter(const char8_t *inParamName,
- const char8_t *inParamType) = 0;
-
- virtual void DoGenerateUVCoords(QT3DSU32 inUVSet) = 0;
- virtual void DoGenerateWorldNormal() = 0;
- virtual void DoGenerateObjectNormal() = 0;
- virtual void DoGenerateWorldPosition() = 0;
- virtual void DoGenerateVarTangentAndBinormal() = 0;
- virtual void DoGenerateVertexColor() = 0;
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.cpp
deleted file mode 100644
index 963186ff..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderBufferLoader.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSSync.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSRenderThreadPool.h"
-
-using namespace qt3ds::render;
-
-namespace {
-struct SBufferLoader;
-struct SBufferLoadResult : public ILoadedBuffer
-{
- NVFoundationBase &m_Foundation;
- CRegisteredString m_Path;
- IBufferLoaderCallback *m_UserData;
- NVDataRef<QT3DSU8> m_Data;
- QT3DSI32 mRefCount;
-
- SBufferLoadResult(NVFoundationBase &fnd, CRegisteredString p, IBufferLoaderCallback *ud,
- NVDataRef<QT3DSU8> data)
- : m_Foundation(fnd)
- , m_Path(p)
- , m_UserData(ud)
- , m_Data(data)
- , mRefCount(0)
- {
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation.getAllocator())
-
- CRegisteredString Path() override { return m_Path; }
- // Data is released when the buffer itself is released.
- NVDataRef<QT3DSU8> Data() override { return m_Data; }
- IBufferLoaderCallback *UserData() override { return m_UserData; }
-
- static SBufferLoadResult *Allocate(QT3DSU32 inBufferSize, NVFoundationBase &fnd,
- CRegisteredString p,
- NVScopedRefCounted<IBufferLoaderCallback> ud)
- {
- size_t allocSize = sizeof(SBufferLoadResult) + inBufferSize;
- QT3DSU8 *allocMem =
- (QT3DSU8 *)fnd.getAllocator().allocate(allocSize, "ILoadedBuffer", __FILE__, __LINE__);
- if (allocMem == NULL)
- return NULL;
- QT3DSU8 *bufferStart = allocMem + sizeof(SBufferLoadResult);
- NVDataRef<QT3DSU8> dataBuffer = toDataRef(bufferStart, inBufferSize);
- return new (allocMem) SBufferLoadResult(fnd, p, ud, dataBuffer);
- }
-};
-struct SLoadedBufferImpl
-{
- SBufferLoader &m_Loader;
- QT3DSU64 m_JobId;
- QT3DSU64 m_LoadId;
- CRegisteredString m_Path;
- NVScopedRefCounted<IBufferLoaderCallback> m_UserData;
- bool m_Quiet;
- volatile bool m_Cancel;
- NVScopedRefCounted<SBufferLoadResult> m_Result;
- SLoadedBufferImpl *m_NextBuffer;
- SLoadedBufferImpl *m_PreviousBuffer;
-
- SLoadedBufferImpl(SBufferLoader &l, CRegisteredString inPath,
- NVScopedRefCounted<IBufferLoaderCallback> ud, bool inQuiet, QT3DSU64 loadId)
- : m_Loader(l)
- , m_JobId(0)
- , m_LoadId(loadId)
- , m_Path(inPath)
- , m_UserData(ud)
- , m_Quiet(inQuiet)
- , m_Cancel(false)
- , m_NextBuffer(NULL)
- , m_PreviousBuffer(NULL)
- {
- }
-};
-
-DEFINE_INVASIVE_LIST(LoadedBufferImpl);
-IMPLEMENT_INVASIVE_LIST(LoadedBufferImpl, m_PreviousBuffer, m_NextBuffer);
-
-struct SBufferLoader : public IBufferLoader
-{
- NVFoundationBase &m_Foundation;
- NVScopedRefCounted<IInputStreamFactory> m_Factory;
- NVScopedRefCounted<IThreadPool> m_ThreadPool;
-
- Mutex m_BuffersToLoadMutex;
- TLoadedBufferImplList m_BuffersToLoad;
-
- Mutex m_BuffersLoadingMutex;
- TLoadedBufferImplList m_BuffersLoading;
-
- Mutex m_LoadedBuffersMutex;
- TLoadedBufferImplList m_LoadedBuffers;
-
- Sync m_BufferLoadedEvent;
-
- QT3DSU64 m_NextBufferId;
-
- QT3DSI32 mRefCount;
-
- SBufferLoader(NVFoundationBase &fnd, IInputStreamFactory &fac, IThreadPool &tp)
- : m_Foundation(fnd)
- , m_Factory(fac)
- , m_ThreadPool(tp)
- , m_BuffersToLoadMutex(fnd.getAllocator())
- , m_BuffersLoadingMutex(fnd.getAllocator())
- , m_LoadedBuffersMutex(fnd.getAllocator())
- , m_BufferLoadedEvent(fnd.getAllocator())
- , m_NextBufferId(1)
- , mRefCount(0)
- {
- m_BufferLoadedEvent.reset();
- }
-
- virtual ~SBufferLoader()
- {
- {
- Mutex::ScopedLock __locker(m_BuffersToLoadMutex);
- for (TLoadedBufferImplList::iterator iter = m_BuffersToLoad.begin(),
- end = m_BuffersToLoad.end();
- iter != end; ++iter) {
- m_ThreadPool->CancelTask(iter->m_JobId);
- }
- }
-
- // Pull any remaining buffers out of the thread system.
- while (WillLoadedBuffersBeAvailable()) {
- NextLoadedBuffer();
- }
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- static void InitializeActiveLoadingBuffer(SLoadedBufferImpl &theBuffer)
- {
- Mutex::ScopedLock theLocker(theBuffer.m_Loader.m_BuffersToLoadMutex);
- Mutex::ScopedLock theSecondLocker(theBuffer.m_Loader.m_BuffersLoadingMutex);
- theBuffer.m_Loader.m_BuffersToLoad.remove(theBuffer);
- theBuffer.m_Loader.m_BuffersLoading.push_back(theBuffer);
- }
-
- static void SetBufferAsLoaded(SLoadedBufferImpl &theBuffer)
- {
- Mutex::ScopedLock theSecondLocker(theBuffer.m_Loader.m_BuffersLoadingMutex);
- Mutex::ScopedLock theLocker(theBuffer.m_Loader.m_LoadedBuffersMutex);
- theBuffer.m_Loader.m_BuffersLoading.remove(theBuffer);
- theBuffer.m_Loader.m_LoadedBuffers.push_back(theBuffer);
- theBuffer.m_Loader.m_BufferLoadedEvent.set();
- theBuffer.m_Loader.m_BufferLoadedEvent.reset();
- }
-
- static void LoadNextBuffer(void *loader)
- {
- SLoadedBufferImpl &theBuffer = *reinterpret_cast<SLoadedBufferImpl *>(loader);
-
- InitializeActiveLoadingBuffer(theBuffer);
- NVScopedRefCounted<IRefCountedInputStream> theStream =
- theBuffer.m_Loader.m_Factory->GetStreamForFile(theBuffer.m_Path.c_str(),
- theBuffer.m_Quiet);
- if (theStream && theBuffer.m_Cancel == false) {
- theStream->SetPosition(0, SeekPosition::End);
- QT3DSI64 theFileLen = theStream->GetPosition();
- if (theFileLen > 0 && theFileLen < (QT3DSU32)QT3DS_MAX_U32) {
- QT3DSU32 required = (QT3DSU32)theFileLen;
- theBuffer.m_Result =
- SBufferLoadResult::Allocate(required, theBuffer.m_Loader.m_Foundation,
- theBuffer.m_Path, theBuffer.m_UserData);
- QT3DSU32 amountRead = 0;
- QT3DSU32 total = amountRead;
- if (theBuffer.m_Result && theBuffer.m_Cancel == false) {
- NVDataRef<QT3DSU8> theDataBuffer(theBuffer.m_Result->m_Data);
- theStream->SetPosition(0, SeekPosition::Begin);
- amountRead = theStream->Read(theDataBuffer);
- total += amountRead;
- // Ensure we keep trying, not all file systems allow huge reads.
- while (total < required && amountRead > 0 && theBuffer.m_Cancel == false) {
- NVDataRef<QT3DSU8> newBuffer(theDataBuffer.mData + total, required - total);
- amountRead = theStream->Read(newBuffer);
- total += amountRead;
- }
- }
- if (theBuffer.m_Cancel || total != required) {
- theBuffer.m_Result->m_Data = NVDataRef<QT3DSU8>();
- }
- }
- }
-
- // only callback if the file was successfully loaded.
- if (theBuffer.m_UserData) {
- if (theBuffer.m_Cancel == false && theBuffer.m_Result.mPtr
- && theBuffer.m_Result->m_Data.size()) {
- theBuffer.m_UserData->OnBufferLoaded(*theBuffer.m_Result.mPtr);
- } else {
- if (theBuffer.m_Cancel)
- theBuffer.m_UserData->OnBufferLoadCancelled(theBuffer.m_Path);
- else
- theBuffer.m_UserData->OnBufferLoadFailed(theBuffer.m_Path);
- }
- }
-
- SetBufferAsLoaded(theBuffer);
- }
- static void CancelNextBuffer(void *loader)
- {
- SLoadedBufferImpl &theBuffer = *reinterpret_cast<SLoadedBufferImpl *>(loader);
- theBuffer.m_Cancel = true;
- InitializeActiveLoadingBuffer(theBuffer);
-
- if (theBuffer.m_UserData)
- theBuffer.m_UserData->OnBufferLoadCancelled(theBuffer.m_Path);
-
- SetBufferAsLoaded(theBuffer);
- }
-
- // nonblocking. Quiet failure is passed to the input stream factory.
- QT3DSU64 QueueForLoading(CRegisteredString inPath,
- IBufferLoaderCallback *inUserData = NULL,
- bool inQuietFailure = false) override
- {
- SLoadedBufferImpl &theBuffer = *QT3DS_NEW(m_Foundation.getAllocator(), SLoadedBufferImpl)(
- *this, inPath, inUserData, inQuietFailure, m_NextBufferId);
- ++m_NextBufferId;
- {
- Mutex::ScopedLock theLocker(m_BuffersToLoadMutex);
- m_BuffersToLoad.push_back(theBuffer);
- }
- theBuffer.m_JobId = m_ThreadPool->AddTask(&theBuffer, LoadNextBuffer, CancelNextBuffer);
- return theBuffer.m_LoadId;
- }
-
- void CancelBufferLoad(QT3DSU64 inBufferId) override
- {
- {
- Mutex::ScopedLock theLocker(m_BuffersToLoadMutex);
- SLoadedBufferImpl *theLoadedBuffer = NULL;
- for (TLoadedBufferImplList::iterator iter = m_BuffersToLoad.begin(),
- end = m_BuffersToLoad.end();
- iter != end && theLoadedBuffer == NULL; ++iter) {
- if (iter->m_LoadId == inBufferId) {
- theLoadedBuffer = &(*iter);
- // both cancellation attempts are necessary. The user will still get
- // a load result, it will just have no data.
- theLoadedBuffer->m_Cancel = true;
- m_ThreadPool->CancelTask(theLoadedBuffer->m_JobId);
- }
- }
- }
- }
-
- // If we were will to wait, will we ever get another buffer
- bool WillLoadedBuffersBeAvailable() override
- {
- Mutex::ScopedLock theLocker(m_BuffersToLoadMutex);
- Mutex::ScopedLock theSecondLocker(m_BuffersLoadingMutex);
- return AreLoadedBuffersAvailable() || m_BuffersToLoad.empty() == false
- || m_BuffersLoading.empty() == false;
- }
- // Will nextLoadedBuffer block or not?
- bool AreLoadedBuffersAvailable() override
- {
- Mutex::ScopedLock theLocker(m_LoadedBuffersMutex);
- return m_LoadedBuffers.empty() == false;
- }
-
- // blocking, be careful with this. No order guarantees here.
- NVScopedRefCounted<ILoadedBuffer> NextLoadedBuffer() override
- {
- while (!AreLoadedBuffersAvailable()) {
- m_BufferLoadedEvent.wait();
- }
- SLoadedBufferImpl *theBuffer;
- {
- Mutex::ScopedLock theLocker(m_LoadedBuffersMutex);
- theBuffer = m_LoadedBuffers.back_ptr();
- m_LoadedBuffers.remove(*theBuffer);
- }
- NVScopedRefCounted<ILoadedBuffer> retval(theBuffer->m_Result);
- if (retval.mPtr == NULL) {
- retval = SBufferLoadResult::Allocate(0, m_Foundation, theBuffer->m_Path,
- theBuffer->m_UserData);
- }
- NVDelete(m_Foundation.getAllocator(), theBuffer);
- return retval;
- }
-};
-}
-
-IBufferLoader &IBufferLoader::Create(NVFoundationBase &fnd, IInputStreamFactory &inFactory,
- IThreadPool &inThreadPool)
-{
- return *QT3DS_NEW(fnd.getAllocator(), SBufferLoader)(fnd, inFactory, inThreadPool);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.h
deleted file mode 100644
index 8d75e259..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferLoader.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BUFFER_LOADED_H
-#define QT3DS_RENDER_BUFFER_LOADED_H
-
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace render {
-
- class IBufferLoaderCallback;
-
- class ILoadedBuffer : public NVRefCounted
- {
- public:
- virtual CRegisteredString Path() = 0;
- // Data is released when the buffer itself is released.
- virtual NVDataRef<QT3DSU8> Data() = 0;
- virtual IBufferLoaderCallback *UserData() = 0;
- };
-
- class IBufferLoaderCallback : public NVRefCounted
- {
- public:
- virtual void OnBufferLoaded(ILoadedBuffer &inBuffer) = 0;
- virtual void OnBufferLoadFailed(CRegisteredString inPath) = 0;
- virtual void OnBufferLoadCancelled(CRegisteredString inPath) = 0;
- };
-
- // Job of this object is to load buffers all the way to memory as fast as possible.
- class IBufferLoader : public NVRefCounted
- {
- public:
- // nonblocking. Quiet failure is passed to the input stream factory.
- // Returns handle to loading buffer
- virtual QT3DSU64 QueueForLoading(CRegisteredString inPath,
- IBufferLoaderCallback *inUserData = NULL,
- bool inQuietFailure = false) = 0;
- // Cancel a buffer that has not made it to the loaded buffers list.
- virtual void CancelBufferLoad(QT3DSU64 inBufferId) = 0;
- // If we were will to wait, will we ever get another buffer
- virtual bool WillLoadedBuffersBeAvailable() = 0;
- // Will nextLoadedBuffer block or not?
- virtual bool AreLoadedBuffersAvailable() = 0;
-
- // blocking, be careful with this. No guarantees about timely return here.
- virtual NVScopedRefCounted<ILoadedBuffer> NextLoadedBuffer() = 0;
-
- static IBufferLoader &Create(NVFoundationBase &fnd, IInputStreamFactory &inFactory,
- IThreadPool &inThreadPool);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
deleted file mode 100644
index eb23f3d0..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
+++ /dev/null
@@ -1,1092 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifdef _WIN32
-#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
-#endif
-#include "Qt3DSRender.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "EASTL/string.h"
-#include "foundation/Qt3DSAllocator.h"
-#include "render/Qt3DSRenderContext.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "EASTL/hash_map.h"
-#include "foundation/FileTools.h"
-#include "Qt3DSImportMesh.h"
-#include "Qt3DSRenderMesh.h"
-#include "foundation/Qt3DSAllocatorCallback.h"
-#include "Qt3DSRenderLoadedTexture.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSRenderImageScaler.h"
-#include "Qt3DSRenderImage.h"
-#include "Qt3DSTextRenderer.h"
-#include "foundation/Qt3DSPerfTimer.h"
-#include "foundation/Qt3DSMutex.h"
-#include "Qt3DSRenderPrefilterTexture.h"
-#include <QtCore/qdir.h>
-
-using namespace qt3ds::render;
-
-namespace {
-
-using eastl::hash;
-using eastl::pair;
-using eastl::make_pair;
-typedef eastl::basic_string<char8_t, ForwardingAllocator> TStr;
-struct StrHasher
-{
- size_t operator()(const TStr &str) const
- {
- return hash<const char8_t *>()((const char8_t *)str.c_str());
- }
-};
-
-struct StrEq
-{
- bool operator()(const TStr &lhs, const TStr &rhs) const { return lhs == rhs; }
-};
-
-struct SImageEntry : public SImageTextureData
-{
- bool m_Loaded;
- SImageEntry()
- : SImageTextureData(), m_Loaded(false)
- {
- }
- SImageEntry(const SImageEntry &entry)
- : SImageTextureData(entry), m_Loaded(entry.m_Loaded)
- {
-
- }
-};
-
-struct SPrimitiveEntry
-{
- // Name of the primitive as it will be in the UIP file
- CRegisteredString m_PrimitiveName;
- // Name of the primitive file on the filesystem
- CRegisteredString m_FileName;
-};
-
-struct SBufferManager : public IBufferManager
-{
- typedef eastl::hash_set<CRegisteredString, eastl::hash<CRegisteredString>,
- eastl::equal_to<CRegisteredString>, ForwardingAllocator>
- TStringSet;
- typedef nvhash_map<CRegisteredString, SImageEntry> TImageMap;
- typedef nvhash_map<CRegisteredString, SRenderMesh *> TMeshMap;
- typedef nvhash_map<CRegisteredString, CRegisteredString> TAliasImageMap;
-
- NVScopedRefCounted<NVRenderContext> m_Context;
- NVScopedRefCounted<IStringTable> m_StrTable;
- NVScopedRefCounted<IInputStreamFactory> m_InputStreamFactory;
- IPerfTimer &m_PerfTimer;
- volatile QT3DSI32 mRefCount;
- TStr m_PathBuilder;
- TImageMap m_ImageMap;
- Mutex m_LoadedImageSetMutex;
- TStringSet m_LoadedImageSet;
- TAliasImageMap m_AliasImageMap;
- TMeshMap m_MeshMap;
- SPrimitiveEntry m_PrimitiveNames[5];
- nvvector<qt3ds::render::NVRenderVertexBufferEntry> m_EntryBuffer;
- bool m_GPUSupportsDXT;
- bool m_reloadableResources;
-
- QHash<QString, ReloadableTexturePtr> m_reloadableTextures;
-
- static const char8_t *GetPrimitivesDirectory() { return "res//primitives"; }
-
- SBufferManager(NVRenderContext &ctx, IStringTable &strTable,
- IInputStreamFactory &inInputStreamFactory, IPerfTimer &inTimer)
- : m_Context(ctx)
- , m_StrTable(strTable)
- , m_InputStreamFactory(inInputStreamFactory)
- , m_PerfTimer(inTimer)
- , mRefCount(0)
- , m_PathBuilder(ForwardingAllocator(ctx.GetAllocator(), "SBufferManager::m_PathBuilder"))
- , m_ImageMap(ctx.GetAllocator(), "SBufferManager::m_ImageMap")
- , m_LoadedImageSetMutex(ctx.GetAllocator())
- , m_LoadedImageSet(
- ForwardingAllocator(ctx.GetAllocator(), "SBufferManager::m_LoadedImageSet"))
- , m_AliasImageMap(ctx.GetAllocator(), "SBufferManager::m_AliasImageMap")
- , m_MeshMap(ctx.GetAllocator(), "SBufferManager::m_MeshMap")
- , m_EntryBuffer(ctx.GetAllocator(), "SBufferManager::m_EntryBuffer")
- , m_GPUSupportsDXT(ctx.AreDXTImagesSupported())
- , m_reloadableResources(false)
- {
- }
- virtual ~SBufferManager() { Clear(); }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Context->GetAllocator())
-
- CRegisteredString CombineBaseAndRelative(const char8_t *inBase,
- const char8_t *inRelative) override
- {
- CFileTools::CombineBaseAndRelative(inBase, inRelative, m_PathBuilder);
- return m_StrTable->RegisterStr(m_PathBuilder.c_str());
- }
-
- void SetImageHasTransparency(CRegisteredString inImagePath, bool inHasTransparency) override
- {
- pair<TImageMap::iterator, bool> theImage =
- m_ImageMap.insert(make_pair(inImagePath, SImageEntry()));
- theImage.first->second.m_TextureFlags.SetHasTransparency(inHasTransparency);
- }
-
- bool GetImageHasTransparency(CRegisteredString inSourcePath) const override
- {
- TImageMap::const_iterator theIter = m_ImageMap.find(inSourcePath);
- if (theIter != m_ImageMap.end())
- return theIter->second.m_TextureFlags.HasTransparency();
- return false;
- }
-
- void SetImageTransparencyToFalseIfNotSet(CRegisteredString inSourcePath) override
- {
- pair<TImageMap::iterator, bool> theImage =
- m_ImageMap.insert(make_pair(inSourcePath, SImageEntry()));
- // If we did actually insert something
- if (theImage.second)
- theImage.first->second.m_TextureFlags.SetHasTransparency(false);
- }
-
- void SetInvertImageUVCoords(CRegisteredString inImagePath, bool inShouldInvertCoords) override
- {
- pair<TImageMap::iterator, bool> theImage =
- m_ImageMap.insert(make_pair(inImagePath, SImageEntry()));
- theImage.first->second.m_TextureFlags.SetInvertUVCoords(inShouldInvertCoords);
- }
-
- bool IsImageLoaded(CRegisteredString inSourcePath) override
- {
- Mutex::ScopedLock __locker(m_LoadedImageSetMutex);
- return m_LoadedImageSet.find(inSourcePath) != m_LoadedImageSet.end();
- }
-
- bool AliasImagePath(CRegisteredString inSourcePath, CRegisteredString inAliasPath,
- bool inIgnoreIfLoaded) override
- {
- if (inSourcePath.IsValid() == false || inAliasPath.IsValid() == false)
- return false;
- // If the image is loaded then we ignore this call in some cases.
- if (inIgnoreIfLoaded && IsImageLoaded(inSourcePath))
- return false;
- m_AliasImageMap.insert(eastl::make_pair(inSourcePath, inAliasPath));
- return true;
- }
-
- void UnaliasImagePath(CRegisteredString inSourcePath) override
- {
- m_AliasImageMap.erase(inSourcePath);
- }
-
- CRegisteredString GetImagePath(CRegisteredString inSourcePath) override
- {
- TAliasImageMap::iterator theAliasIter = m_AliasImageMap.find(inSourcePath);
- if (theAliasIter != m_AliasImageMap.end())
- return theAliasIter->second;
- return inSourcePath;
- }
-
- CRegisteredString getImagePath(const QString &path)
- {
- TAliasImageMap::iterator theAliasIter
- = m_AliasImageMap.find(m_StrTable->RegisterStr(qPrintable(path)));
- if (theAliasIter != m_AliasImageMap.end())
- return theAliasIter->second;
- return m_StrTable->RegisterStr(qPrintable(path));
- }
-
- static inline int wrapMod(int a, int base)
- {
- int ret = a % base;
- if (ret < 0)
- ret += base;
- return ret;
- }
-
- static inline void getWrappedCoords(int &sX, int &sY, int width, int height)
- {
- if (sY < 0) {
- sX -= width >> 1;
- sY = -sY;
- }
- if (sY >= height) {
- sX += width >> 1;
- sY = height - sY;
- }
- sX = wrapMod(sX, width);
- sY = wrapMod(sY, height);
- }
-
- template <typename V, typename C>
- void iterateAll(const V &vv, C c)
- {
- for (const auto x : vv)
- c(x);
- }
-
- void loadTextureImage(SReloadableImageTextureData &data)
- {
- CRegisteredString imagePath = getImagePath(data.m_path);
- TImageMap::iterator theIter = m_ImageMap.find(imagePath);
- if ((theIter == m_ImageMap.end() || theIter->second.m_Loaded == false)
- && imagePath.IsValid()) {
- NVScopedReleasable<SLoadedTexture> theLoadedImage;
- SImageTextureData textureData;
-
- doImageLoad(imagePath, theLoadedImage);
-
- if (theLoadedImage) {
- textureData = LoadRenderImage(imagePath, *theLoadedImage, data.m_scanTransparency,
- data.m_bsdfMipmap);
- data.m_Texture = textureData.m_Texture;
- data.m_TextureFlags = textureData.m_TextureFlags;
- data.m_BSDFMipMap = textureData.m_BSDFMipMap;
- data.m_loaded = true;
- iterateAll(data.m_callbacks, [](SImage *img){ img->m_Flags.SetDirty(true); });
- } else {
- // We want to make sure that bad path fails once and doesn't fail over and over
- // again which could slow down the system quite a bit.
- pair<TImageMap::iterator, bool> theImage =
- m_ImageMap.insert(make_pair(imagePath, SImageEntry()));
- theImage.first->second.m_Loaded = true;
- qCWarning(WARNING, "Failed to load image: %s", imagePath.c_str());
- theIter = theImage.first;
- }
- } else {
- SImageEntry textureData = theIter->second;
- if (textureData.m_Loaded) {
- data.m_Texture = textureData.m_Texture;
- data.m_TextureFlags = textureData.m_TextureFlags;
- data.m_BSDFMipMap = textureData.m_BSDFMipMap;
- data.m_loaded = true;
- iterateAll(data.m_callbacks, [](SImage *img){ img->m_Flags.SetDirty(true); });
- }
- }
- }
-
- void unloadTextureImage(SReloadableImageTextureData &data)
- {
- CRegisteredString r = m_StrTable->RegisterStr(qPrintable(data.m_path));
- data.m_loaded = false;
- data.m_Texture = nullptr;
- data.m_BSDFMipMap = nullptr;
- data.m_TextureFlags = {};
- iterateAll(data.m_callbacks, [](SImage *img){ img->m_Flags.SetDirty(true); });
- InvalidateBuffer(r);
- }
-
- void loadSet(const QSet<QString> &imageSet) override
- {
- for (const auto &x : imageSet) {
- if (!m_reloadableTextures.contains(x)) {
- auto img = CreateReloadableImage(m_StrTable->RegisterStr(qPrintable(x)), false,
- false);
- img->m_initialized = false;
- loadTextureImage(*m_reloadableTextures[x]);
- } else if (!m_reloadableTextures[x]->m_loaded) {
- loadTextureImage(*m_reloadableTextures[x]);
- }
- }
- }
-
- void unloadSet(const QSet<QString> &imageSet) override
- {
- for (const auto &x : imageSet) {
- if (m_reloadableTextures.contains(x)) {
- if (m_reloadableTextures[x]->m_loaded)
- unloadTextureImage(*m_reloadableTextures[x]);
- }
- }
- }
-
- virtual ReloadableTexturePtr CreateReloadableImage(CRegisteredString inSourcePath,
- bool inForceScanForTransparency,
- bool inBsdfMipmaps) override
- {
- QString path = QString::fromLatin1(inSourcePath.c_str());
- const bool inserted = m_reloadableTextures.contains(path);
- if (!inserted || (inserted && m_reloadableTextures[path]->m_initialized == false)) {
- if (!inserted)
- m_reloadableTextures.insert(path, ReloadableTexturePtr::create());
- m_reloadableTextures[path]->m_path = path;
- m_reloadableTextures[path]->m_scanTransparency = inForceScanForTransparency;
- m_reloadableTextures[path]->m_bsdfMipmap = inBsdfMipmaps;
- m_reloadableTextures[path]->m_initialized = true;
-
- if (!m_reloadableResources)
- loadTextureImage(*m_reloadableTextures[path]);
-
- CRegisteredString imagePath = getImagePath(path);
- TImageMap::iterator theIter = m_ImageMap.find(imagePath);
- if (theIter != m_ImageMap.end()) {
- SImageEntry textureData = theIter->second;
- if (textureData.m_Loaded) {
- m_reloadableTextures[path]->m_Texture = textureData.m_Texture;
- m_reloadableTextures[path]->m_TextureFlags = textureData.m_TextureFlags;
- m_reloadableTextures[path]->m_BSDFMipMap = textureData.m_BSDFMipMap;
- m_reloadableTextures[path]->m_loaded = true;
- }
- }
- }
- return m_reloadableTextures[path];
- }
-
- void doImageLoad(CRegisteredString inImagePath,
- NVScopedReleasable<SLoadedTexture> &theLoadedImage)
- {
- SStackPerfTimer __perfTimer(m_PerfTimer, "Image Decompression");
- theLoadedImage = SLoadedTexture::Load(
- inImagePath.c_str(), m_Context->GetFoundation(), *m_InputStreamFactory,
- true, m_Context->GetRenderContextType());
- // Hackish solution to custom materials not finding their textures if they are used
- // in sub-presentations.
- if (!theLoadedImage) {
- if (QDir(inImagePath.c_str()).isRelative()) {
- QString searchPath = inImagePath.c_str();
- if (searchPath.startsWith(QLatin1String("./")))
- searchPath.prepend(QLatin1Char('.'));
- int loops = 0;
- while (!theLoadedImage && ++loops <= 3) {
- theLoadedImage = SLoadedTexture::Load(
- searchPath.toUtf8(), m_Context->GetFoundation(),
- *m_InputStreamFactory, true,
- m_Context->GetRenderContextType());
- searchPath.prepend(QLatin1String("../"));
- }
- } else {
- // Some textures, for example environment maps for custom materials,
- // have absolute path at this point. It points to the wrong place with
- // the new project structure, so we need to split it up and construct
- // the new absolute path here.
- QString wholePath = inImagePath.c_str();
- QStringList splitPath = wholePath.split(QLatin1String("../"));
- if (splitPath.size() > 1) {
- QString searchPath = splitPath.at(0) + splitPath.at(1);
- int loops = 0;
- while (!theLoadedImage && ++loops <= 3) {
- theLoadedImage = SLoadedTexture::Load(
- searchPath.toUtf8(), m_Context->GetFoundation(),
- *m_InputStreamFactory, true,
- m_Context->GetRenderContextType());
- searchPath = splitPath.at(0);
- for (int i = 0; i < loops; i++)
- searchPath.append(QLatin1String("../"));
- searchPath.append(splitPath.at(1));
- }
- }
- }
- }
- }
-
- void enableReloadableResources(bool enable) override
- {
- m_reloadableResources = enable;
- }
-
- bool isReloadableResourcesEnabled() const override
- {
- return m_reloadableResources;
- }
-
- SImageTextureData LoadRenderImage(CRegisteredString inImagePath,
- SLoadedTexture &inLoadedImage,
- bool inForceScanForTransparency, bool inBsdfMipmaps) override
- {
- SStackPerfTimer __perfTimer(m_PerfTimer, "Image Upload");
- {
- Mutex::ScopedLock __mapLocker(m_LoadedImageSetMutex);
- m_LoadedImageSet.insert(inImagePath);
- }
- pair<TImageMap::iterator, bool> theImage =
- m_ImageMap.insert(make_pair(inImagePath, SImageEntry()));
- bool wasInserted = theImage.second;
- theImage.first->second.m_Loaded = true;
- // inLoadedImage.EnsureMultiplerOfFour( m_Context->GetFoundation(), inImagePath.c_str() );
-
- NVRenderTexture2D *theTexture = m_Context->CreateTexture2D();
- if (inLoadedImage.data) {
- qt3ds::render::NVRenderTextureFormats::Enum destFormat = inLoadedImage.format;
- if (inBsdfMipmaps) {
- if (m_Context->GetRenderContextType() == render::NVRenderContextValues::GLES2)
- destFormat = qt3ds::render::NVRenderTextureFormats::RGBA8;
- else
- destFormat = qt3ds::render::NVRenderTextureFormats::RGBA16F;
- }
- else {
- theTexture->SetTextureData(
- NVDataRef<QT3DSU8>((QT3DSU8 *)inLoadedImage.data, inLoadedImage.dataSizeInBytes), 0,
- inLoadedImage.width, inLoadedImage.height, inLoadedImage.format, destFormat);
- {
- static int enable = qEnvironmentVariableIntValue("QT3DS_GENERATE_MIPMAPS");
- if (enable) {
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::LinearMipmapLinear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- theTexture->GenerateMipmaps();
- }
- }
- }
-
- if (inBsdfMipmaps
- && NVRenderTextureFormats::isUncompressedTextureFormat(inLoadedImage.format)) {
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::LinearMipmapLinear);
- Qt3DSRenderPrefilterTexture *theBSDFMipMap = theImage.first->second.m_BSDFMipMap;
- if (theBSDFMipMap == NULL) {
- theBSDFMipMap = Qt3DSRenderPrefilterTexture::Create(
- m_Context, inLoadedImage.width, inLoadedImage.height, *theTexture,
- destFormat, m_Context->GetFoundation());
- theImage.first->second.m_BSDFMipMap = theBSDFMipMap;
- }
-
- if (theBSDFMipMap) {
- theBSDFMipMap->Build(inLoadedImage.data, inLoadedImage.dataSizeInBytes,
- inLoadedImage.format);
- }
- }
- } else if (inLoadedImage.dds) {
- theImage.first->second.m_Texture = theTexture;
- bool supportsDXT = m_GPUSupportsDXT;
- bool isDXT = NVRenderTextureFormats::isCompressedTextureFormat(inLoadedImage.format);
- bool requiresDecompression = (supportsDXT == false && isDXT) || false;
- // test code for DXT decompression
- // if ( isDXT ) requiresDecompression = true;
- if (requiresDecompression) {
- qCWarning(WARNING, PERF_INFO,
- "Image %s is DXT format which is unsupported by "
- "the graphics subsystem, decompressing in CPU",
- inImagePath.c_str());
- }
- STextureData theDecompressedImage;
- for (int idx = 0; idx < inLoadedImage.dds->numMipmaps; ++idx) {
- if (inLoadedImage.dds->mipwidth[idx] && inLoadedImage.dds->mipheight[idx]) {
- if (requiresDecompression == false) {
- theTexture->SetTextureData(
- toU8DataRef((char *)inLoadedImage.dds->data[idx],
- (QT3DSU32)inLoadedImage.dds->size[idx]),
- (QT3DSU8)idx, (QT3DSU32)inLoadedImage.dds->mipwidth[idx],
- (QT3DSU32)inLoadedImage.dds->mipheight[idx], inLoadedImage.format);
- } else {
- theDecompressedImage =
- inLoadedImage.DecompressDXTImage(idx, &theDecompressedImage);
-
- if (theDecompressedImage.data) {
- theTexture->SetTextureData(
- toU8DataRef((char *)theDecompressedImage.data,
- (QT3DSU32)theDecompressedImage.dataSizeInBytes),
- (QT3DSU8)idx, (QT3DSU32)inLoadedImage.dds->mipwidth[idx],
- (QT3DSU32)inLoadedImage.dds->mipheight[idx],
- theDecompressedImage.format);
- }
- }
- }
- }
- if (theDecompressedImage.data)
- inLoadedImage.ReleaseDecompressedTexture(theDecompressedImage);
- }
- if (wasInserted == true || inForceScanForTransparency)
- theImage.first->second.m_TextureFlags.SetHasTransparency(
- inLoadedImage.ScanForTransparency());
- theImage.first->second.m_Texture = theTexture;
- return theImage.first->second;
- }
-
- SImageTextureData LoadRenderImage(CRegisteredString inImagePath,
- bool inForceScanForTransparency, bool inBsdfMipmaps) override
- {
- inImagePath = GetImagePath(inImagePath);
-
- if (!inImagePath.IsValid())
- return SImageEntry();
-
- TImageMap::iterator theIter = m_ImageMap.find(inImagePath);
- if (theIter == m_ImageMap.end() && inImagePath.IsValid()) {
- NVScopedReleasable<SLoadedTexture> theLoadedImage;
-
- doImageLoad(inImagePath, theLoadedImage);
-
- if (theLoadedImage) {
- return LoadRenderImage(inImagePath, *theLoadedImage, inForceScanForTransparency,
- inBsdfMipmaps);
- } else {
- // We want to make sure that bad path fails once and doesn't fail over and over
- // again
- // which could slow down the system quite a bit.
- pair<TImageMap::iterator, bool> theImage =
- m_ImageMap.insert(make_pair(inImagePath, SImageEntry()));
- theImage.first->second.m_Loaded = true;
- qCWarning(WARNING, "Failed to load image: %s", inImagePath.c_str());
- theIter = theImage.first;
- }
- }
- return theIter->second;
- }
-
- qt3dsimp::SMultiLoadResult LoadPrimitive(const char8_t *inRelativePath)
- {
- CRegisteredString theName(m_StrTable->RegisterStr(inRelativePath));
- if (m_PrimitiveNames[0].m_PrimitiveName.IsValid() == false) {
- IStringTable &strTable(m_Context->GetStringTable());
- m_PrimitiveNames[0].m_PrimitiveName = strTable.RegisterStr("#Rectangle");
- m_PrimitiveNames[0].m_FileName = strTable.RegisterStr("Rectangle.mesh");
- m_PrimitiveNames[1].m_PrimitiveName = strTable.RegisterStr("#Sphere");
- m_PrimitiveNames[1].m_FileName = strTable.RegisterStr("Sphere.mesh");
- m_PrimitiveNames[2].m_PrimitiveName = strTable.RegisterStr("#Cube");
- m_PrimitiveNames[2].m_FileName = strTable.RegisterStr("Cube.mesh");
- m_PrimitiveNames[3].m_PrimitiveName = strTable.RegisterStr("#Cone");
- m_PrimitiveNames[3].m_FileName = strTable.RegisterStr("Cone.mesh");
- m_PrimitiveNames[4].m_PrimitiveName = strTable.RegisterStr("#Cylinder");
- m_PrimitiveNames[4].m_FileName = strTable.RegisterStr("Cylinder.mesh");
- }
- for (size_t idx = 0; idx < 5; ++idx) {
- if (m_PrimitiveNames[idx].m_PrimitiveName == theName) {
- CFileTools::CombineBaseAndRelative(GetPrimitivesDirectory(),
- m_PrimitiveNames[idx].m_FileName, m_PathBuilder);
- QT3DSU32 id = 1;
- NVScopedRefCounted<IRefCountedInputStream> theInStream(
- m_InputStreamFactory->GetStreamForFile(m_PathBuilder.c_str()));
- if (theInStream)
- return qt3dsimp::Mesh::LoadMulti(m_Context->GetAllocator(), *theInStream, id);
- else {
- qCCritical(INTERNAL_ERROR, "Unable to find mesh primitive %s",
- m_PathBuilder.c_str());
- return qt3dsimp::SMultiLoadResult();
- }
- }
- }
- return qt3dsimp::SMultiLoadResult();
- }
-
- virtual NVConstDataRef<QT3DSU8> CreatePackedPositionDataArray(
- const qt3dsimp::SMultiLoadResult &inResult)
- {
- // we assume a position consists of 3 floats
- QT3DSU32 vertexCount = inResult.m_Mesh->m_VertexBuffer.m_Data.size()
- / inResult.m_Mesh->m_VertexBuffer.m_Stride;
- QT3DSU32 dataSize = vertexCount * 3 * sizeof(QT3DSF32);
- QT3DSF32 *posData = static_cast<QT3DSF32 *>(
- QT3DS_ALLOC(m_Context->GetAllocator(), dataSize,
- "SRenderMesh::CreatePackedPositionDataArray"));
- QT3DSU8 *baseOffset = reinterpret_cast<QT3DSU8 *>(inResult.m_Mesh);
- // copy position data
- if (posData) {
- QT3DSF32 *srcData = reinterpret_cast<QT3DSF32 *>(
- inResult.m_Mesh->m_VertexBuffer.m_Data.begin(baseOffset));
- QT3DSU32 srcStride = inResult.m_Mesh->m_VertexBuffer.m_Stride / sizeof(QT3DSF32);
- QT3DSF32 *dstData = posData;
- QT3DSU32 dstStride = 3;
-
- for (QT3DSU32 i = 0; i < vertexCount; ++i) {
- dstData[0] = srcData[0];
- dstData[1] = srcData[1];
- dstData[2] = srcData[2];
-
- dstData += dstStride;
- srcData += srcStride;
- }
-
- return toConstDataRef(reinterpret_cast<const qt3ds::QT3DSU8 *>(posData), dataSize);
- }
-
- return NVConstDataRef<QT3DSU8>();
- }
-
- SRenderMesh *createRenderMesh(const qt3dsimp::SMultiLoadResult &result)
- {
- SRenderMesh *theNewMesh = QT3DS_NEW(m_Context->GetAllocator(), SRenderMesh)(
- qt3ds::render::NVRenderDrawMode::Triangles,
- qt3ds::render::NVRenderWinding::CounterClockwise, result.m_Id,
- m_Context->GetAllocator());
- QT3DSU8 *baseAddress = reinterpret_cast<QT3DSU8 *>(result.m_Mesh);
- NVConstDataRef<QT3DSU8> theVBufData(
- result.m_Mesh->m_VertexBuffer.m_Data.begin(baseAddress),
- result.m_Mesh->m_VertexBuffer.m_Data.size());
-
- NVRenderVertexBuffer *theVertexBuffer = m_Context->CreateVertexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static,
- result.m_Mesh->m_VertexBuffer.m_Data.m_Size,
- result.m_Mesh->m_VertexBuffer.m_Stride, theVBufData);
-
- // create a tight packed position data VBO
- // this should improve our depth pre pass rendering
- NVRenderVertexBuffer *thePosVertexBuffer = nullptr;
- NVConstDataRef<QT3DSU8> posData = CreatePackedPositionDataArray(result);
- if (posData.size()) {
- thePosVertexBuffer
- = m_Context->CreateVertexBuffer(qt3ds::render::NVRenderBufferUsageType::Static,
- posData.size(), 3 * sizeof(QT3DSF32), posData);
- }
-
- NVRenderIndexBuffer *theIndexBuffer = nullptr;
- if (result.m_Mesh->m_IndexBuffer.m_Data.size()) {
- using qt3ds::render::NVRenderComponentTypes;
- QT3DSU32 theIndexBufferSize = result.m_Mesh->m_IndexBuffer.m_Data.size();
- NVRenderComponentTypes::Enum bufComponentType =
- result.m_Mesh->m_IndexBuffer.m_ComponentType;
- QT3DSU32 sizeofType
- = qt3ds::render::NVRenderComponentTypes::getSizeofType(bufComponentType);
-
- if (sizeofType == 2 || sizeofType == 4) {
- // Ensure type is unsigned; else things will fail in rendering pipeline.
- if (bufComponentType == NVRenderComponentTypes::QT3DSI16)
- bufComponentType = NVRenderComponentTypes::QT3DSU16;
- if (bufComponentType == NVRenderComponentTypes::QT3DSI32)
- bufComponentType = NVRenderComponentTypes::QT3DSU32;
-
- NVConstDataRef<QT3DSU8> theIBufData(
- result.m_Mesh->m_IndexBuffer.m_Data.begin(baseAddress),
- result.m_Mesh->m_IndexBuffer.m_Data.size());
- theIndexBuffer = m_Context->CreateIndexBuffer(
- qt3ds::render::NVRenderBufferUsageType::Static, bufComponentType,
- theIndexBufferSize, theIBufData);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- nvvector<qt3ds::render::NVRenderVertexBufferEntry> &theEntryBuffer(m_EntryBuffer);
- theEntryBuffer.resize(result.m_Mesh->m_VertexBuffer.m_Entries.size());
- for (QT3DSU32 entryIdx = 0,
- entryEnd = result.m_Mesh->m_VertexBuffer.m_Entries.size();
- entryIdx < entryEnd; ++entryIdx) {
- theEntryBuffer[entryIdx]
- = result.m_Mesh->m_VertexBuffer.m_Entries.index(baseAddress, entryIdx)
- .ToVertexBufferEntry(baseAddress);
- }
- // create our attribute layout
- NVRenderAttribLayout *theAttribLayout
- = m_Context->CreateAttributeLayout(theEntryBuffer);
- // create our attribute layout for depth pass
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry(
- "attr_pos", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- };
- NVRenderAttribLayout *theAttribLayoutDepth
- = m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 1));
-
- // create input assembler object
- QT3DSU32 strides = result.m_Mesh->m_VertexBuffer.m_Stride;
- QT3DSU32 offsets = 0;
- NVRenderInputAssembler *theInputAssembler = m_Context->CreateInputAssembler(
- theAttribLayout, toConstDataRef(&theVertexBuffer, 1), theIndexBuffer,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1),
- result.m_Mesh->m_DrawMode);
-
- // create depth input assembler object
- QT3DSU32 posStrides = thePosVertexBuffer ? 3 * sizeof(QT3DSF32) : strides;
- NVRenderInputAssembler *theInputAssemblerDepth = m_Context->CreateInputAssembler(
- theAttribLayoutDepth,
- toConstDataRef(thePosVertexBuffer ? &thePosVertexBuffer : &theVertexBuffer, 1),
- theIndexBuffer, toConstDataRef(&posStrides, 1), toConstDataRef(&offsets, 1),
- result.m_Mesh->m_DrawMode);
-
- NVRenderInputAssembler *theInputAssemblerPoints = m_Context->CreateInputAssembler(
- theAttribLayoutDepth,
- toConstDataRef(thePosVertexBuffer ? &thePosVertexBuffer : &theVertexBuffer, 1),
- nullptr, toConstDataRef(&posStrides, 1), toConstDataRef(&offsets, 1),
- NVRenderDrawMode::Points);
-
- if (!theInputAssembler || !theInputAssemblerDepth || !theInputAssemblerPoints) {
- QT3DS_ASSERT(false);
- return nullptr;
- }
- theNewMesh->m_Joints.resize(result.m_Mesh->m_Joints.size());
- for (QT3DSU32 jointIdx = 0, jointEnd = result.m_Mesh->m_Joints.size();
- jointIdx < jointEnd; ++jointIdx) {
- const qt3dsimp::Joint &theImportJoint(
- result.m_Mesh->m_Joints.index(baseAddress, jointIdx));
- SRenderJoint &theNewJoint(theNewMesh->m_Joints[jointIdx]);
- theNewJoint.m_JointID = theImportJoint.m_JointID;
- theNewJoint.m_ParentID = theImportJoint.m_ParentID;
- memCopy(theNewJoint.m_invBindPose, theImportJoint.m_invBindPose,
- 16 * sizeof(QT3DSF32));
- memCopy(theNewJoint.m_localToGlobalBoneSpace,
- theImportJoint.m_localToGlobalBoneSpace, 16 * sizeof(QT3DSF32));
- }
-
- for (QT3DSU32 subsetIdx = 0, subsetEnd = result.m_Mesh->m_Subsets.size();
- subsetIdx < subsetEnd; ++subsetIdx) {
- SRenderSubset theSubset(m_Context->GetAllocator());
- const qt3dsimp::MeshSubset &source(
- result.m_Mesh->m_Subsets.index(baseAddress, subsetIdx));
- theSubset.m_Bounds = source.m_Bounds;
- theSubset.m_Count = source.m_Count;
- theSubset.m_Offset = source.m_Offset;
- theSubset.m_Joints = theNewMesh->m_Joints;
- theSubset.m_Name = m_StrTable->RegisterStr(source.m_Name.begin(baseAddress));
- theVertexBuffer->addRef();
- theSubset.m_VertexBuffer = theVertexBuffer;
- if (thePosVertexBuffer) {
- thePosVertexBuffer->addRef();
- theSubset.m_PosVertexBuffer = thePosVertexBuffer;
- }
- if (theIndexBuffer) {
- theIndexBuffer->addRef();
- theSubset.m_IndexBuffer = theIndexBuffer;
- }
- theSubset.m_InputAssembler = theInputAssembler;
- theSubset.m_InputAssemblerDepth = theInputAssemblerDepth;
- theSubset.m_InputAssemblerPoints = theInputAssemblerPoints;
- theSubset.m_PrimitiveType = result.m_Mesh->m_DrawMode;
- theInputAssembler->addRef();
- theInputAssemblerDepth->addRef();
- theSubset.m_InputAssemblerPoints->addRef();
- theNewMesh->m_Subsets.push_back(theSubset);
- }
- // If we want to, we can break up models into sub-subsets.
- // These are assumed to use the same material as the outer subset but have fewer triangles
- // and should have a more exact bounding box. This sort of thing helps with using the
- // frustum culling system but it is really done incorrectly.
- // It should be done via some sort of oct-tree mechanism and so that the sub-subsets
- // are spatially sorted and it should only be done upon save-to-binary with the
- // results saved out to disk. As you can see, doing it properly requires some real
- // engineering effort so it is somewhat unlikely it will ever happen.
- // Or it could be done on import if someone really wants to change the mesh buffer
- // format. Either way it isn't going to happen here and it isn't going to happen this way
- // but this is a working example of using the technique.
-#ifdef QT3DS_RENDER_GENERATE_SUB_SUBSETS
- Option<qt3ds::render::NVRenderVertexBufferEntry> thePosAttrOpt
- = theVertexBuffer->GetEntryByName("attr_pos");
- bool hasPosAttr = thePosAttrOpt.hasValue()
- && thePosAttrOpt->m_ComponentType == qt3ds::render::NVRenderComponentTypes::QT3DSF32
- && thePosAttrOpt->m_NumComponents == 3;
-
- for (size_t subsetIdx = 0, subsetEnd = theNewMesh->m_Subsets.size();
- subsetIdx < subsetEnd; ++subsetIdx) {
- SRenderSubset &theOuterSubset = theNewMesh->m_Subsets[subsetIdx];
- if (theOuterSubset.m_Count && theIndexBuffer
- && theIndexBuffer->GetComponentType()
- == qt3ds::render::NVRenderComponentTypes::QT3DSU16
- && theNewMesh->m_DrawMode == NVRenderDrawMode::Triangles && hasPosAttr) {
- // Num tris in a sub subset.
- QT3DSU32 theSubsetSize = 3334 * 3; // divisible by three.
- size_t theNumSubSubsets = ((theOuterSubset.m_Count - 1) / theSubsetSize) + 1;
- QT3DSU32 thePosAttrOffset = thePosAttrOpt->m_FirstItemOffset;
- const QT3DSU8 *theVertData = result.m_Mesh->m_VertexBuffer.m_Data.begin();
- const QT3DSU8 *theIdxData = result.m_Mesh->m_IndexBuffer.m_Data.begin();
- QT3DSU32 theVertStride = result.m_Mesh->m_VertexBuffer.m_Stride;
- QT3DSU32 theOffset = theOuterSubset.m_Offset;
- QT3DSU32 theCount = theOuterSubset.m_Count;
- for (size_t subSubsetIdx = 0, subSubsetEnd = theNumSubSubsets;
- subSubsetIdx < subSubsetEnd; ++subSubsetIdx) {
- SRenderSubsetBase theBase;
- theBase.m_Offset = theOffset;
- theBase.m_Count = NVMin(theSubsetSize, theCount);
- theBase.m_Bounds.setEmpty();
- theCount -= theBase.m_Count;
- theOffset += theBase.m_Count;
- // Create new bounds.
- // Offset is in item size, not bytes.
- const QT3DSU16 *theSubsetIdxData
- = reinterpret_cast<const QT3DSU16 *>(theIdxData + theBase.m_Offset * 2);
- for (size_t theIdxIdx = 0, theIdxEnd = theBase.m_Count;
- theIdxIdx < theIdxEnd; ++theIdxIdx) {
- QT3DSU32 theVertOffset = theSubsetIdxData[theIdxIdx] * theVertStride;
- theVertOffset += thePosAttrOffset;
- QT3DSVec3 thePos = *(
- reinterpret_cast<const QT3DSVec3 *>(theVertData + theVertOffset));
- theBase.m_Bounds.include(thePos);
- }
- theOuterSubset.m_SubSubsets.push_back(theBase);
- }
- } else {
- SRenderSubsetBase theBase;
- theBase.m_Bounds = theOuterSubset.m_Bounds;
- theBase.m_Count = theOuterSubset.m_Count;
- theBase.m_Offset = theOuterSubset.m_Offset;
- theOuterSubset.m_SubSubsets.push_back(theBase);
- }
- }
-#endif
- if (posData.size()) {
- m_Context->GetAllocator().deallocate(
- static_cast<void *>(const_cast<qt3ds::QT3DSU8 *>(posData.begin())));
- }
-
- return theNewMesh;
- }
-
- void loadCustomMesh(const QString &name, qt3dsimp::Mesh *mesh) override
- {
- if (!name.isEmpty() && mesh) {
- CRegisteredString meshName = m_StrTable->RegisterStr(name);
- pair<TMeshMap::iterator, bool> theMesh
- = m_MeshMap.insert({ meshName, static_cast<SRenderMesh *>(nullptr) });
- // Only create the mesh if it doesn't yet exist
- if (theMesh.second) {
- qt3dsimp::SMultiLoadResult result;
- result.m_Mesh = mesh;
- theMesh.first->second = createRenderMesh(result);
- }
- }
- }
-
- SRenderMesh *LoadMesh(CRegisteredString inMeshPath) override
- {
- if (inMeshPath.IsValid() == false)
- return nullptr;
- pair<TMeshMap::iterator, bool> theMesh =
- m_MeshMap.insert(make_pair(inMeshPath, static_cast<SRenderMesh *>(nullptr)));
- if (theMesh.second) {
- // Check to see if this is primitive
- qt3dsimp::SMultiLoadResult theResult = LoadPrimitive(inMeshPath);
-
- // Attempt a load from the filesystem if this mesh isn't a primitive.
- if (!theResult.m_Mesh) {
- m_PathBuilder = inMeshPath;
- TStr::size_type pound = m_PathBuilder.rfind('#');
- QT3DSU32 id = 0;
- if (pound != TStr::npos) {
- id = QT3DSU32(atoi(m_PathBuilder.c_str() + pound + 1));
- m_PathBuilder.erase(m_PathBuilder.begin() + pound, m_PathBuilder.end());
- }
- NVScopedRefCounted<IRefCountedInputStream> theStream(
- m_InputStreamFactory->GetStreamForFile(m_PathBuilder.c_str()));
- if (theStream) {
- theResult = qt3dsimp::Mesh::LoadMulti(
- m_Context->GetAllocator(), *theStream, id);
- }
- if (!theResult.m_Mesh)
- qCWarning(WARNING, "Failed to load mesh: %s", m_PathBuilder.c_str());
- }
-
- if (theResult.m_Mesh) {
- theMesh.first->second = createRenderMesh(theResult);
- m_Context->GetAllocator().deallocate(theResult.m_Mesh);
- }
- }
- return theMesh.first->second;
- }
-
- SRenderMesh *CreateMesh(Qt3DSBCharPtr inSourcePath, QT3DSU8 *inVertData, QT3DSU32 inNumVerts,
- QT3DSU32 inVertStride, QT3DSU32 *inIndexData, QT3DSU32 inIndexCount,
- qt3ds::NVBounds3 inBounds) override
- {
- CRegisteredString sourcePath = m_StrTable->RegisterStr(inSourcePath);
-
- // eastl::pair<CRegisteredString, SRenderMesh*> thePair(sourcePath, (SRenderMesh*)NULL);
- pair<TMeshMap::iterator, bool> theMesh;
- // Make sure there isn't already a buffer entry for this mesh.
- if (m_MeshMap.contains(sourcePath)) {
- theMesh = make_pair<TMeshMap::iterator, bool>(m_MeshMap.find(sourcePath), true);
- } else {
- theMesh = m_MeshMap.insert(make_pair(sourcePath, (SRenderMesh *)NULL));
- }
-
- if (theMesh.second == true) {
- SRenderMesh *theNewMesh = QT3DS_NEW(m_Context->GetAllocator(), SRenderMesh)(
- qt3ds::render::NVRenderDrawMode::Triangles,
- qt3ds::render::NVRenderWinding::CounterClockwise, 0, m_Context->GetAllocator());
-
- // If we failed to create the RenderMesh, return a failure.
- if (!theNewMesh) {
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- // Get rid of any old mesh that was sitting here and fill it with a new one.
- // NOTE : This is assuming that the source of our mesh data doesn't do its own memory
- // management and always returns new buffer pointers every time.
- // Don't know for sure if that's what we'll get from our intended sources, but that's
- // easily
- // adjustable by looking for matching pointers in the Subsets.
- if (theNewMesh && theMesh.first->second != NULL) {
- delete theMesh.first->second;
- theMesh.first->second = NULL;
- }
-
- theMesh.first->second = theNewMesh;
- QT3DSU32 vertDataSize = inNumVerts * inVertStride;
- NVConstDataRef<QT3DSU8> theVBufData(inVertData, vertDataSize);
- // NVConstDataRef<QT3DSU8> theVBufData( theResult.m_Mesh->m_VertexBuffer.m_Data.begin(
- // baseAddress )
- // , theResult.m_Mesh->m_VertexBuffer.m_Data.size() );
-
- NVRenderVertexBuffer *theVertexBuffer =
- m_Context->CreateVertexBuffer(qt3ds::render::NVRenderBufferUsageType::Static,
- vertDataSize, inVertStride, theVBufData);
- NVRenderIndexBuffer *theIndexBuffer = NULL;
- if (inIndexData != NULL && inIndexCount > 3) {
- NVConstDataRef<QT3DSU8> theIBufData((QT3DSU8 *)inIndexData, inIndexCount * sizeof(QT3DSU32));
- theIndexBuffer =
- m_Context->CreateIndexBuffer(qt3ds::render::NVRenderBufferUsageType::Static,
- qt3ds::render::NVRenderComponentTypes::QT3DSU32,
- inIndexCount * sizeof(QT3DSU32), theIBufData);
- }
-
- // WARNING
- // Making an assumption here about the contents of the stream
- // PKC TODO : We may have to consider some other format.
- qt3ds::render::NVRenderVertexBufferEntry theEntries[] = {
- qt3ds::render::NVRenderVertexBufferEntry("attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3),
- qt3ds::render::NVRenderVertexBufferEntry(
- "attr_uv", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 2, 12),
- qt3ds::render::NVRenderVertexBufferEntry(
- "attr_norm", qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3, 18),
- };
-
- // create our attribute layout
- NVRenderAttribLayout *theAttribLayout =
- m_Context->CreateAttributeLayout(toConstDataRef(theEntries, 3));
- /*
- // create our attribute layout for depth pass
- qt3ds::render::NVRenderVertexBufferEntry theEntriesDepth[] = {
- qt3ds::render::NVRenderVertexBufferEntry( "attr_pos",
- qt3ds::render::NVRenderComponentTypes::QT3DSF32, 3 ),
- };
- NVRenderAttribLayout* theAttribLayoutDepth = m_Context->CreateAttributeLayout(
- toConstDataRef( theEntriesDepth, 1 ) );
- */
- // create input assembler object
- QT3DSU32 strides = inVertStride;
- QT3DSU32 offsets = 0;
- NVRenderInputAssembler *theInputAssembler = m_Context->CreateInputAssembler(
- theAttribLayout, toConstDataRef(&theVertexBuffer, 1), theIndexBuffer,
- toConstDataRef(&strides, 1), toConstDataRef(&offsets, 1),
- qt3ds::render::NVRenderDrawMode::Triangles);
-
- if (!theInputAssembler) {
- QT3DS_ASSERT(false);
- return NULL;
- }
-
- // Pull out just the mesh object name from the total path
- eastl::string fullName(inSourcePath);
- eastl::string subName(inSourcePath);
- if (fullName.rfind("#") != eastl::string::npos) {
- subName = fullName.substr(fullName.rfind("#"), eastl::string::npos);
- }
-
- theNewMesh->m_Joints.clear();
- SRenderSubset theSubset(m_Context->GetAllocator());
- theSubset.m_Bounds = inBounds;
- theSubset.m_Count = inIndexCount;
- theSubset.m_Offset = 0;
- theSubset.m_Joints = theNewMesh->m_Joints;
- theSubset.m_Name = m_StrTable->RegisterStr(subName.c_str());
- theVertexBuffer->addRef();
- theSubset.m_VertexBuffer = theVertexBuffer;
- theSubset.m_PosVertexBuffer = NULL;
- if (theIndexBuffer)
- theIndexBuffer->addRef();
- theSubset.m_IndexBuffer = theIndexBuffer;
- theSubset.m_InputAssembler = theInputAssembler;
- theSubset.m_InputAssemblerDepth = theInputAssembler;
- theSubset.m_InputAssemblerPoints = theInputAssembler;
- theSubset.m_PrimitiveType = qt3ds::render::NVRenderDrawMode::Triangles;
- theSubset.m_InputAssembler->addRef();
- theSubset.m_InputAssemblerDepth->addRef();
- theSubset.m_InputAssemblerPoints->addRef();
- theNewMesh->m_Subsets.push_back(theSubset);
- }
-
- return theMesh.first->second;
- }
-
- void ReleaseMesh(SRenderMesh &inMesh)
- {
- for (QT3DSU32 subsetIdx = 0, subsetEnd = inMesh.m_Subsets.size(); subsetIdx < subsetEnd;
- ++subsetIdx) {
- inMesh.m_Subsets[subsetIdx].m_VertexBuffer->release();
- if (inMesh.m_Subsets[subsetIdx].m_PosVertexBuffer) // can be NULL
- inMesh.m_Subsets[subsetIdx].m_PosVertexBuffer->release();
- if (inMesh.m_Subsets[subsetIdx].m_IndexBuffer) // can be NULL
- inMesh.m_Subsets[subsetIdx].m_IndexBuffer->release();
- inMesh.m_Subsets[subsetIdx].m_InputAssembler->release();
- inMesh.m_Subsets[subsetIdx].m_InputAssemblerDepth->release();
- if (inMesh.m_Subsets[subsetIdx].m_InputAssemblerPoints)
- inMesh.m_Subsets[subsetIdx].m_InputAssemblerPoints->release();
- }
- NVDelete(m_Context->GetAllocator(), &inMesh);
- }
- void ReleaseTexture(SImageEntry &inEntry)
- {
- if (inEntry.m_Texture)
- inEntry.m_Texture->release();
- if (inEntry.m_BSDFMipMap)
- inEntry.m_BSDFMipMap->release();
- }
- void Clear() override
- {
- m_reloadableTextures.clear();
- for (TMeshMap::iterator iter = m_MeshMap.begin(), end = m_MeshMap.end(); iter != end;
- ++iter) {
- SRenderMesh *theMesh = iter->second;
- if (theMesh)
- ReleaseMesh(*theMesh);
- }
- m_MeshMap.clear();
- for (TImageMap::iterator iter = m_ImageMap.begin(), end = m_ImageMap.end(); iter != end;
- ++iter) {
- SImageEntry &theEntry = iter->second;
- ReleaseTexture(theEntry);
- }
- m_ImageMap.clear();
- m_AliasImageMap.clear();
- {
- Mutex::ScopedLock __locker(m_LoadedImageSetMutex);
- m_LoadedImageSet.clear();
- }
- }
- void InvalidateBuffer(CRegisteredString inSourcePath) override
- {
- {
- TMeshMap::iterator iter = m_MeshMap.find(inSourcePath);
- if (iter != m_MeshMap.end()) {
- if (iter->second)
- ReleaseMesh(*iter->second);
- m_MeshMap.erase(iter);
- return;
- }
- }
- {
- TImageMap::iterator iter = m_ImageMap.find(inSourcePath);
- if (iter != m_ImageMap.end()) {
- SImageEntry &theEntry = iter->second;
- ReleaseTexture(theEntry);
- m_ImageMap.erase(inSourcePath);
- {
- Mutex::ScopedLock __locker(m_LoadedImageSetMutex);
- m_LoadedImageSet.erase(inSourcePath);
- }
- }
- }
- }
- IStringTable &GetStringTable() override { return *m_StrTable; }
-};
-}
-
-IBufferManager &IBufferManager::Create(NVRenderContext &inRenderContext, IStringTable &inStrTable,
- IInputStreamFactory &inFactory, IPerfTimer &inPerfTimer)
-{
- return *QT3DS_NEW(inRenderContext.GetAllocator(), SBufferManager)(inRenderContext, inStrTable,
- inFactory, inPerfTimer);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
deleted file mode 100644
index 070ab675..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_BUFFER_MANAGER_H
-#define QT3DS_RENDER_BUFFER_MANAGER_H
-#include "Qt3DSRender.h"
-#include "EASTL/utility.h" //pair
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderImageTextureData.h"
-#include "foundation/Qt3DSBounds3.h"
-
-namespace qt3dsimp {
- struct Mesh;
-}
-
-namespace qt3ds {
-namespace render {
-
- class IBufferManager : public NVRefCounted
- {
- protected:
- virtual ~IBufferManager() {}
-
- public:
- // Path manipulation used to get the final path form a base path plus relative extension
- virtual CRegisteredString CombineBaseAndRelative(const char8_t *inBase,
- const char8_t *inRelative) = 0;
- virtual void SetImageHasTransparency(CRegisteredString inSourcePath,
- bool inHasTransparency) = 0;
- virtual bool GetImageHasTransparency(CRegisteredString inSourcePath) const = 0;
- virtual void SetImageTransparencyToFalseIfNotSet(CRegisteredString inSourcePath) = 0;
- virtual void SetInvertImageUVCoords(CRegisteredString inSourcePath,
- bool inShouldInvertCoords) = 0;
-
- // Returns true if this image has been loaded into memory
- // This call is threadsafe. Nothing else on this object is guaranteed to be.
- virtual bool IsImageLoaded(CRegisteredString inSourcePath) = 0;
-
- // Alias one image path with another image path. Optionally this object will ignore the
- // call if
- // the source path is already loaded. Aliasing is currently used to allow a default image
- // to be shown
- // in place of an image that is loading offline.
- // Returns true if the image was aliased, false otherwise.
- virtual bool AliasImagePath(CRegisteredString inSourcePath, CRegisteredString inAliasPath,
- bool inIgnoreIfLoaded) = 0;
- virtual void UnaliasImagePath(CRegisteredString inSourcePath) = 0;
-
- // Returns the given source path unless the source path is aliased; in which case returns
- // the aliased path.
- virtual CRegisteredString GetImagePath(CRegisteredString inSourcePath) = 0;
- // Returns a texture and a boolean indicating if this texture has transparency in it or not.
- // Can't name this LoadImage because that gets mangled by windows to LoadImageA (uggh)
- // In some cases we need to only scan particular images for transparency.
- virtual SImageTextureData LoadRenderImage(CRegisteredString inImagePath,
- SLoadedTexture &inTexture,
- bool inForceScanForTransparency = false,
- bool inBsdfMipmaps = false) = 0;
- virtual SImageTextureData LoadRenderImage(CRegisteredString inSourcePath,
- bool inForceScanForTransparency = false,
- bool inBsdfMipmaps = false) = 0;
-
- virtual ReloadableTexturePtr CreateReloadableImage(CRegisteredString inSourcePath,
- bool inForceScanForTransparency = false,
- bool inBsdfMipmaps = false) = 0;
- virtual void enableReloadableResources(bool enable) = 0;
- virtual bool isReloadableResourcesEnabled() const = 0;
-
- virtual void loadSet(const QSet<QString> &imageSet) = 0;
- virtual void unloadSet(const QSet<QString> &imageSet) = 0;
-
- virtual void loadCustomMesh(const QString &name, qt3dsimp::Mesh *mesh) = 0;
- virtual SRenderMesh *LoadMesh(CRegisteredString inSourcePath) = 0;
-
- virtual SRenderMesh *CreateMesh(const char *inSourcePath, QT3DSU8 *inVertData,
- QT3DSU32 inNumVerts, QT3DSU32 inVertStride, QT3DSU32 *inIndexData,
- QT3DSU32 inIndexCount, qt3ds::NVBounds3 inBounds) = 0;
-
- // Remove *all* buffers from the buffer manager;
- virtual void Clear() = 0;
- virtual void InvalidateBuffer(CRegisteredString inSourcePath) = 0;
- virtual IStringTable &GetStringTable() = 0;
-
- static IBufferManager &Create(NVRenderContext &inRenderContext, IStringTable &inStrTable,
- IInputStreamFactory &inInputStreamFactory,
- IPerfTimer &inTimer);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.cpp
deleted file mode 100644
index e2cfbed1..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderImageBatchLoader.h"
-#include "foundation/Qt3DSMutex.h"
-#include "foundation/Qt3DSSync.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/StringTable.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSRenderBufferManager.h"
-#include "Qt3DSRenderThreadPool.h"
-#include "Qt3DSRenderImageScaler.h"
-#include "Qt3DSRenderLoadedTexture.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSPool.h"
-#include "foundation/Qt3DSPerfTimer.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct SImageLoaderBatch;
-typedef Mutex::ScopedLock TScopedLock;
-
-struct SLoadingImage
-{
- SImageLoaderBatch *m_Batch;
- CRegisteredString m_SourcePath;
- QT3DSU64 m_TaskId;
- SLoadingImage *m_Tail;
-
- // Called from main thread
- SLoadingImage(CRegisteredString inSourcePath)
- : m_Batch(NULL)
- , m_SourcePath(inSourcePath)
- , m_TaskId(0)
- , m_Tail(NULL)
- {
- }
- SLoadingImage()
- : m_Batch(NULL)
- , m_TaskId(0)
- , m_Tail(NULL)
- {
- }
- // Called from main thread
- void Setup(SImageLoaderBatch &inBatch);
-
- // Called from loader thread
- static void LoadImage(void *inImg);
-
- // Potentially called from loader thread
- static void TaskCancelled(void *inImg);
-};
-
-struct SLoadingImageTailOp
-{
- SLoadingImage *get(SLoadingImage &inImg) { return inImg.m_Tail; }
- void set(SLoadingImage &inImg, SLoadingImage *inItem) { inImg.m_Tail = inItem; }
-};
-
-typedef InvasiveSingleLinkedList<SLoadingImage, SLoadingImageTailOp> TLoadingImageList;
-
-struct SBatchLoader;
-
-struct SImageLoaderBatch
-{
- // All variables setup in main thread and constant from then on except
- // loaded image count.
- SBatchLoader &m_Loader;
- NVScopedRefCounted<IImageLoadListener> m_LoadListener;
- Sync m_LoadEvent;
- Mutex m_LoadMutex;
- TLoadingImageList m_Images;
-
- TImageBatchId m_BatchId;
- // Incremented in main thread
- QT3DSU32 m_LoadedOrCanceledImageCount;
- QT3DSU32 m_FinalizedImageCount;
- QT3DSU32 m_NumImages;
- NVRenderContextType m_contextType;
- bool m_preferKTX;
-
- // Called from main thread
- static SImageLoaderBatch *CreateLoaderBatch(SBatchLoader &inLoader, TImageBatchId inBatchId,
- NVConstDataRef<CRegisteredString> inSourcePaths,
- CRegisteredString inImageTillLoaded,
- IImageLoadListener *inListener,
- NVRenderContextType contextType,
- bool preferKTX);
-
- // Called from main thread
- SImageLoaderBatch(SBatchLoader &inLoader, IImageLoadListener *inLoadListener,
- const TLoadingImageList &inImageList, TImageBatchId inBatchId,
- QT3DSU32 inImageCount, NVRenderContextType contextType,
- bool preferKTX);
-
- // Called from main thread
- ~SImageLoaderBatch();
-
- // Called from main thread
- bool IsLoadingFinished()
- {
- Mutex::ScopedLock __locker(m_LoadMutex);
- return m_LoadedOrCanceledImageCount >= m_NumImages;
- }
-
- bool IsFinalizedFinished()
- {
- Mutex::ScopedLock __locker(m_LoadMutex);
- return m_FinalizedImageCount >= m_NumImages;
- }
-
- void IncrementLoadedImageCount()
- {
- Mutex::ScopedLock __locker(m_LoadMutex);
- ++m_LoadedOrCanceledImageCount;
- }
- void IncrementFinalizedImageCount()
- {
- Mutex::ScopedLock __locker(m_LoadMutex);
- ++m_FinalizedImageCount;
- }
- // Called from main thread
- void Cancel();
- void Cancel(CRegisteredString inSourcePath);
-};
-
-struct SBatchLoadedImage
-{
- CRegisteredString m_SourcePath;
- SLoadedTexture *m_Texture;
- SImageLoaderBatch *m_Batch;
- SBatchLoadedImage()
- : m_Texture(NULL)
- , m_Batch(NULL)
- {
- }
-
- // Called from loading thread
- SBatchLoadedImage(CRegisteredString inSourcePath, SLoadedTexture *inTexture,
- SImageLoaderBatch &inBatch)
- : m_SourcePath(inSourcePath)
- , m_Texture(inTexture)
- , m_Batch(&inBatch)
- {
- }
-
- // Called from main thread
- bool Finalize(IBufferManager &inMgr);
-};
-
-struct SBatchLoader : public IImageBatchLoader
-{
- typedef nvhash_map<TImageBatchId, SImageLoaderBatch *> TImageLoaderBatchMap;
- typedef nvhash_map<CRegisteredString, TImageBatchId> TSourcePathToBatchMap;
- typedef Pool<SLoadingImage, ForwardingAllocator> TLoadingImagePool;
- typedef Pool<SImageLoaderBatch, ForwardingAllocator> TBatchPool;
-
- // Accessed from loader thread
- NVFoundationBase &m_Foundation;
- volatile QT3DSI32 mRefCount;
- // Accessed from loader thread
- IInputStreamFactory &m_InputStreamFactory;
- //!!Not threadsafe! accessed only from main thread
- IBufferManager &m_BufferManager;
- // Accessed from main thread
- IThreadPool &m_ThreadPool;
- // Accessed from both threads
- IPerfTimer &m_PerfTimer;
- // main thread
- TImageBatchId m_NextBatchId;
- // main thread
- TImageLoaderBatchMap m_Batches;
- // main thread
- Mutex m_LoaderMutex;
-
- // Both loader and main threads
- nvvector<SBatchLoadedImage> m_LoadedImages;
- // main thread
- nvvector<TImageBatchId> m_FinishedBatches;
- // main thread
- TSourcePathToBatchMap m_SourcePathToBatches;
- // main thread
- nvvector<SLoadingImage> m_LoaderBuilderWorkspace;
- TLoadingImagePool m_LoadingImagePool;
- TBatchPool m_BatchPool;
-
- SBatchLoader(NVFoundationBase &inFoundation, IInputStreamFactory &inFactory,
- IBufferManager &inBufferManager, IThreadPool &inThreadPool, IPerfTimer &inTimer)
- : m_Foundation(inFoundation)
- , mRefCount(0)
- , m_InputStreamFactory(inFactory)
- , m_BufferManager(inBufferManager)
- , m_ThreadPool(inThreadPool)
- , m_PerfTimer(inTimer)
- , m_NextBatchId(1)
- , m_Batches(inFoundation.getAllocator(), "SBatchLoader::m_Batches")
- , m_LoaderMutex(inFoundation.getAllocator())
- , m_LoadedImages(inFoundation.getAllocator(), "SBatchLoader::m_LoadedImages")
- , m_FinishedBatches(inFoundation.getAllocator(), "SBatchLoader::m_FinishedBatches")
- , m_SourcePathToBatches(inFoundation.getAllocator(), "SBatchLoader::m_SourcePathToBatches")
- , m_LoaderBuilderWorkspace(inFoundation.getAllocator(),
- "SBatchLoader::m_LoaderBuilderWorkspace")
- , m_LoadingImagePool(
- ForwardingAllocator(inFoundation.getAllocator(), "SBatchLoader::m_LoadingImagePool"))
- , m_BatchPool(ForwardingAllocator(inFoundation.getAllocator(), "SBatchLoader::m_BatchPool"))
- {
- }
-
- virtual ~SBatchLoader()
- {
- nvvector<TImageBatchId> theCancelledBatches(m_Foundation.getAllocator(), "~SBatchLoader");
- for (TImageLoaderBatchMap::iterator theIter = m_Batches.begin(), theEnd = m_Batches.end();
- theIter != theEnd; ++theIter) {
- theIter->second->Cancel();
- theCancelledBatches.push_back(theIter->second->m_BatchId);
- }
- for (QT3DSU32 idx = 0, end = theCancelledBatches.size(); idx < end; ++idx)
- BlockUntilLoaded(theCancelledBatches[idx]);
-
- QT3DS_ASSERT(m_Batches.size() == 0);
- }
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE(m_Foundation.getAllocator())
-
- // Returns an ID to the load request. Request a block of images to be loaded.
- // Also takes an image that the buffer system will return when requested for the given source
- // paths
- // until said path is loaded.
- // An optional listener can be passed in to get callbacks about the batch.
- TImageBatchId LoadImageBatch(NVConstDataRef<CRegisteredString> inSourcePaths,
- CRegisteredString inImageTillLoaded,
- IImageLoadListener *inListener,
- NVRenderContextType contextType,
- bool preferKTX) override
- {
- if (inSourcePaths.size() == 0)
- return 0;
-
- TScopedLock __loaderLock(m_LoaderMutex);
-
- TImageBatchId theBatchId = 0;
-
- // Empty loop intentional to find an unused batch id.
- for (theBatchId = m_NextBatchId; m_Batches.find(theBatchId) != m_Batches.end();
- ++m_NextBatchId, theBatchId = m_NextBatchId) {
- }
-
- SImageLoaderBatch *theBatch(SImageLoaderBatch::CreateLoaderBatch(
- *this, theBatchId, inSourcePaths, inImageTillLoaded, inListener, contextType, preferKTX));
- if (theBatch) {
- m_Batches.insert(eastl::make_pair(theBatchId, theBatch));
- return theBatchId;
- }
- return 0;
- }
-
- void CancelImageBatchLoading(TImageBatchId inBatchId) override
- {
- SImageLoaderBatch *theBatch(GetBatch(inBatchId));
- if (theBatch)
- theBatch->Cancel();
- }
-
- // Blocks if the image is currently in-flight
- void CancelImageLoading(CRegisteredString inSourcePath) override
- {
- TScopedLock __loaderLock(m_LoaderMutex);
- TSourcePathToBatchMap::iterator theIter = m_SourcePathToBatches.find(inSourcePath);
- if (theIter != m_SourcePathToBatches.end()) {
- TImageBatchId theBatchId = theIter->second;
- TImageLoaderBatchMap::iterator theBatchIter = m_Batches.find(theBatchId);
- if (theBatchIter != m_Batches.end())
- theBatchIter->second->Cancel(inSourcePath);
- }
- }
-
- SImageLoaderBatch *GetBatch(TImageBatchId inId)
- {
- TScopedLock __loaderLock(m_LoaderMutex);
- TImageLoaderBatchMap::iterator theIter = m_Batches.find(inId);
- if (theIter != m_Batches.end())
- return theIter->second;
- return NULL;
- }
-
- void BlockUntilLoaded(TImageBatchId inId) override
- {
- for (SImageLoaderBatch *theBatch = GetBatch(inId); theBatch; theBatch = GetBatch(inId)) {
- // Only need to block if images aren't loaded. Don't need to block if they aren't
- // finalized.
- if (!theBatch->IsLoadingFinished()) {
- theBatch->m_LoadEvent.wait(200);
- theBatch->m_LoadEvent.reset();
- }
- BeginFrame(true);
- }
- }
- void ImageLoaded(SLoadingImage &inImage, SLoadedTexture *inTexture)
- {
- TScopedLock __loaderLock(m_LoaderMutex);
- m_LoadedImages.push_back(
- SBatchLoadedImage(inImage.m_SourcePath, inTexture, *inImage.m_Batch));
- inImage.m_Batch->IncrementLoadedImageCount();
- inImage.m_Batch->m_LoadEvent.set();
- }
- // These are called by the render context, users don't need to call this.
- void BeginFrame(bool firstFrame) override
- {
- TScopedLock __loaderLock(m_LoaderMutex);
- // Pass 1 - send out all image loaded signals
- for (QT3DSU32 idx = 0, end = m_LoadedImages.size(); idx < end; ++idx) {
-
- m_SourcePathToBatches.erase(m_LoadedImages[idx].m_SourcePath);
- m_LoadedImages[idx].Finalize(m_BufferManager);
- m_LoadedImages[idx].m_Batch->IncrementFinalizedImageCount();
- if (m_LoadedImages[idx].m_Batch->IsFinalizedFinished())
- m_FinishedBatches.push_back(m_LoadedImages[idx].m_Batch->m_BatchId);
- if (!firstFrame)
- break;
- }
- if (firstFrame)
- m_LoadedImages.clear();
- else if (m_LoadedImages.size())
- m_LoadedImages.erase(m_LoadedImages.begin());
- // pass 2 - clean up any existing batches.
- for (QT3DSU32 idx = 0, end = m_FinishedBatches.size(); idx < end; ++idx) {
- TImageLoaderBatchMap::iterator theIter = m_Batches.find(m_FinishedBatches[idx]);
- if (theIter != m_Batches.end()) {
- SImageLoaderBatch *theBatch = theIter->second;
- if (theBatch->m_LoadListener)
- theBatch->m_LoadListener->OnImageBatchComplete(theBatch->m_BatchId);
- m_Batches.erase(m_FinishedBatches[idx]);
- theBatch->~SImageLoaderBatch();
- m_BatchPool.deallocate(theBatch);
- }
- }
- m_FinishedBatches.clear();
- }
-
- void EndFrame() override {}
-};
-
-void SLoadingImage::Setup(SImageLoaderBatch &inBatch)
-{
- m_Batch = &inBatch;
- m_TaskId = inBatch.m_Loader.m_ThreadPool.AddTask(this, LoadImage, TaskCancelled);
-}
-
-void SLoadingImage::LoadImage(void *inImg)
-{
- SLoadingImage *theThis = reinterpret_cast<SLoadingImage *>(inImg);
- SStackPerfTimer theTimer(theThis->m_Batch->m_Loader.m_PerfTimer, "Image Decompression");
- if (theThis->m_Batch->m_Loader.m_BufferManager.IsImageLoaded(theThis->m_SourcePath) == false) {
- SLoadedTexture *theTexture = SLoadedTexture::Load(
- theThis->m_SourcePath.c_str(), theThis->m_Batch->m_Loader.m_Foundation,
- theThis->m_Batch->m_Loader.m_InputStreamFactory, true,
- theThis->m_Batch->m_contextType,
- theThis->m_Batch->m_preferKTX);
- // if ( theTexture )
- // theTexture->EnsureMultiplerOfFour( theThis->m_Batch->m_Loader.m_Foundation,
- //theThis->m_SourcePath.c_str() );
-
- theThis->m_Batch->m_Loader.ImageLoaded(*theThis, theTexture);
- } else {
- theThis->m_Batch->m_Loader.ImageLoaded(*theThis, NULL);
- }
-}
-
-void SLoadingImage::TaskCancelled(void *inImg)
-{
- SLoadingImage *theThis = reinterpret_cast<SLoadingImage *>(inImg);
- theThis->m_Batch->m_Loader.ImageLoaded(*theThis, NULL);
-}
-
-bool SBatchLoadedImage::Finalize(IBufferManager &inMgr)
-{
- if (m_Texture) {
- // PKC : We'll look at the path location to see if the image is in the standard
- // location for IBL light probes or a standard hdr format and decide to generate BSDF
- // miplevels (if the image doesn't have
- // mipmaps of its own that is).
- eastl::string thepath(m_SourcePath);
- bool isIBL = (thepath.find(".hdr") != eastl::string::npos)
- || (thepath.find("\\IBL\\") != eastl::string::npos)
- || (thepath.find("/IBL/") != eastl::string::npos);
- inMgr.LoadRenderImage(m_SourcePath, *m_Texture, false, isIBL);
- inMgr.UnaliasImagePath(m_SourcePath);
- }
- if (m_Batch->m_LoadListener)
- m_Batch->m_LoadListener->OnImageLoadComplete(
- m_SourcePath, m_Texture ? ImageLoadResult::Succeeded : ImageLoadResult::Failed);
-
- if (m_Texture) {
- m_Texture->release();
- return true;
- }
-
- return false;
-}
-
-SImageLoaderBatch *
-SImageLoaderBatch::CreateLoaderBatch(SBatchLoader &inLoader, TImageBatchId inBatchId,
- NVConstDataRef<CRegisteredString> inSourcePaths,
- CRegisteredString inImageTillLoaded,
- IImageLoadListener *inListener,
- NVRenderContextType contextType,
- bool preferKTX)
-{
- TLoadingImageList theImages;
- QT3DSU32 theLoadingImageCount = 0;
- for (QT3DSU32 idx = 0, end = inSourcePaths.size(); idx < end; ++idx) {
- CRegisteredString theSourcePath(inSourcePaths[idx]);
-
- if (theSourcePath.IsValid() == false)
- continue;
-
- if (inLoader.m_BufferManager.IsImageLoaded(theSourcePath))
- continue;
-
- eastl::pair<SBatchLoader::TSourcePathToBatchMap::iterator, bool> theInserter =
- inLoader.m_SourcePathToBatches.insert(eastl::make_pair(inSourcePaths[idx], inBatchId));
-
- // If the loader has already seen this image.
- if (theInserter.second == false)
- continue;
-
- if (inImageTillLoaded.IsValid()) {
- // Alias the image so any further requests for this source path will result in
- // the default images (image till loaded).
- bool aliasSuccess =
- inLoader.m_BufferManager.AliasImagePath(theSourcePath, inImageTillLoaded, true);
- (void)aliasSuccess;
- QT3DS_ASSERT(aliasSuccess);
- }
-
- theImages.push_front(
- *inLoader.m_LoadingImagePool.construct(theSourcePath, __FILE__, __LINE__));
- ++theLoadingImageCount;
- }
- if (theImages.empty() == false) {
- SImageLoaderBatch *theBatch =
- (SImageLoaderBatch *)inLoader.m_BatchPool.allocate(__FILE__, __LINE__);
- new (theBatch)
- SImageLoaderBatch(inLoader, inListener, theImages, inBatchId, theLoadingImageCount,
- contextType, preferKTX);
- return theBatch;
- }
- return NULL;
-}
-
-SImageLoaderBatch::SImageLoaderBatch(SBatchLoader &inLoader, IImageLoadListener *inLoadListener,
- const TLoadingImageList &inImageList, TImageBatchId inBatchId,
- QT3DSU32 inImageCount, NVRenderContextType contextType,
- bool preferKTX)
- : m_Loader(inLoader)
- , m_LoadListener(inLoadListener)
- , m_LoadEvent(inLoader.m_Foundation.getAllocator())
- , m_LoadMutex(inLoader.m_Foundation.getAllocator())
- , m_Images(inImageList)
- , m_BatchId(inBatchId)
- , m_LoadedOrCanceledImageCount(0)
- , m_FinalizedImageCount(0)
- , m_NumImages(inImageCount)
- , m_contextType(contextType)
- , m_preferKTX(preferKTX)
-{
- for (TLoadingImageList::iterator iter = m_Images.begin(), end = m_Images.end(); iter != end;
- ++iter) {
- iter->Setup(*this);
- }
-}
-
-SImageLoaderBatch::~SImageLoaderBatch()
-{
- for (TLoadingImageList::iterator iter = m_Images.begin(), end = m_Images.end(); iter != end;
- ++iter) {
- TLoadingImageList::iterator temp(iter);
- ++iter;
- m_Loader.m_LoadingImagePool.deallocate(temp.m_Obj);
- }
-}
-
-void SImageLoaderBatch::Cancel()
-{
- for (TLoadingImageList::iterator iter = m_Images.begin(), end = m_Images.end(); iter != end;
- ++iter)
- m_Loader.m_ThreadPool.CancelTask(iter->m_TaskId);
-}
-
-void SImageLoaderBatch::Cancel(CRegisteredString inSourcePath)
-{
- for (TLoadingImageList::iterator iter = m_Images.begin(), end = m_Images.end(); iter != end;
- ++iter) {
- if (iter->m_SourcePath == inSourcePath) {
- m_Loader.m_ThreadPool.CancelTask(iter->m_TaskId);
- break;
- }
- }
-}
-}
-
-IImageBatchLoader &IImageBatchLoader::CreateBatchLoader(NVFoundationBase &inFoundation,
- IInputStreamFactory &inFactory,
- IBufferManager &inBufferManager,
- IThreadPool &inThreadPool,
- IPerfTimer &inTimer)
-{
- return *QT3DS_NEW(inFoundation.getAllocator(),
- SBatchLoader)(inFoundation, inFactory, inBufferManager, inThreadPool, inTimer);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.h
deleted file mode 100644
index bc1773ce..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderImageBatchLoader.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_THREADED_IMAGE_LOADER_H
-#define QT3DS_RENDER_THREADED_IMAGE_LOADER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
- struct ImageLoadResult
- {
- enum Enum {
- Succeeded,
- Failed,
- };
- };
-
- class IImageLoadListener : public NVRefCounted
- {
- protected:
- virtual ~IImageLoadListener() {}
-
- public:
- virtual void OnImageLoadComplete(CRegisteredString inPath,
- ImageLoadResult::Enum inResult) = 0;
- virtual void OnImageBatchComplete(QT3DSU64 inBatch) = 0;
- };
-
- typedef QT3DSU32 TImageBatchId;
-
- class IImageBatchLoader : public NVRefCounted
- {
- protected:
- virtual ~IImageBatchLoader() {}
-
- public:
- // Returns an ID to the load request. Request a block of images to be loaded.
- // Also takes an image that the buffer system will return when requested for the given
- // source paths
- // until said path is loaded.
- // An optional listener can be passed in to get callbacks about the batch.
- virtual TImageBatchId LoadImageBatch(NVConstDataRef<CRegisteredString> inSourcePaths,
- CRegisteredString inImageTillLoaded,
- IImageLoadListener *inListener,
- NVRenderContextType type,
- bool preferKTX) = 0;
- // Blocks if any of the images in the batch are in flight
- virtual void CancelImageBatchLoading(TImageBatchId inBatchId) = 0;
- // Blocks if the image is currently in-flight
- virtual void CancelImageLoading(CRegisteredString inSourcePath) = 0;
- // Block until every image in the batch is loaded.
- virtual void BlockUntilLoaded(TImageBatchId inId) = 0;
-
- // These are called by the render context, users don't need to call this.
- virtual void BeginFrame(bool firstFrame) = 0;
- virtual void EndFrame() = 0;
-
- static IImageBatchLoader &CreateBatchLoader(NVFoundationBase &inFoundation,
- IInputStreamFactory &inFactory,
- IBufferManager &inBufferManager,
- IThreadPool &inThreadPool, IPerfTimer &inTimer);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp
deleted file mode 100644
index 11762733..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp
+++ /dev/null
@@ -1,715 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderLoadedTexture.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSDMWindowsCompatibility.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSRenderImageScaler.h"
-#include "Qt3DSTextRenderer.h"
-#include <QImage>
-
-using namespace qt3ds::render;
-
-SLoadedTexture *SLoadedTexture::LoadQImage(const QString &inPath, QT3DSI32 flipVertical,
- NVFoundationBase &fnd,
- NVRenderContextType renderContextType)
-{
- Q_UNUSED(flipVertical)
- Q_UNUSED(renderContextType)
- SLoadedTexture *retval(NULL);
- NVAllocatorCallback &alloc(fnd.getAllocator());
- QImage image(inPath);
- const QImage::Format format = image.format();
- switch (format) {
- case QImage::Format_RGBA64:
- image = image.convertToFormat(QImage::Format_RGBA8888);
- break;
- case QImage::Format_RGBX64:
- image = image.convertToFormat(QImage::Format_RGBX8888);
- break;
- default:
- break;
- }
- image = image.mirrored();
- image = image.rgbSwapped();
- retval = QT3DS_NEW(alloc, SLoadedTexture)(alloc);
- retval->width = image.width();
- retval->height = image.height();
- retval->components = image.pixelFormat().channelCount();
- retval->image = image;
- retval->data = (void*)retval->image.bits();
- retval->dataSizeInBytes = image.byteCount();
- retval->setFormatFromComponents();
- return retval;
-}
-
-
-namespace {
-
-/**
- !!Large section of code ripped from FreeImage!!
-
-*/
-// ----------------------------------------------------------
-// Structures used by DXT textures
-// ----------------------------------------------------------
-typedef QT3DSU8 BYTE;
-typedef QT3DSU16 WORD;
-
-typedef struct tagColor8888
-{
- BYTE b;
- BYTE g;
- BYTE r;
- BYTE a;
-} Color8888;
-
-typedef struct tagColor565
-{
- WORD b : 5;
- WORD g : 6;
- WORD r : 5;
-} Color565;
-
-typedef struct tagDXTColBlock
-{
- Color565 colors[2];
- BYTE row[4];
-} DXTColBlock;
-
-typedef struct tagDXTAlphaBlockExplicit
-{
- WORD row[4];
-} DXTAlphaBlockExplicit;
-
-typedef struct tagDXTAlphaBlock3BitLinear
-{
- BYTE alpha[2];
- BYTE data[6];
-} DXTAlphaBlock3BitLinear;
-
-typedef struct tagDXT1Block
-{
- DXTColBlock color;
-} DXT1Block;
-
-typedef struct tagDXT3Block
-{ // also used by dxt2
- DXTAlphaBlockExplicit alpha;
- DXTColBlock color;
-} DXT3Block;
-
-typedef struct tagDXT5Block
-{ // also used by dxt4
- DXTAlphaBlock3BitLinear alpha;
- DXTColBlock color;
-} DXT5Block;
-
-static void GetBlockColors(const DXTColBlock &block, Color8888 colors[4], bool isDXT1)
-{
- int i;
- for (i = 0; i < 2; i++) {
- colors[i].a = 0xff;
- colors[i].r = (BYTE)(block.colors[i].r * 0xff / 0x1f);
- colors[i].g = (BYTE)(block.colors[i].g * 0xff / 0x3f);
- colors[i].b = (BYTE)(block.colors[i].b * 0xff / 0x1f);
- }
-
- WORD *wCol = (WORD *)block.colors;
- if (wCol[0] > wCol[1] || !isDXT1) {
- // 4 color block
- for (i = 0; i < 2; i++) {
- colors[i + 2].a = 0xff;
- colors[i + 2].r =
- (BYTE)((WORD(colors[0].r) * (2 - i) + WORD(colors[1].r) * (1 + i)) / 3);
- colors[i + 2].g =
- (BYTE)((WORD(colors[0].g) * (2 - i) + WORD(colors[1].g) * (1 + i)) / 3);
- colors[i + 2].b =
- (BYTE)((WORD(colors[0].b) * (2 - i) + WORD(colors[1].b) * (1 + i)) / 3);
- }
- } else {
- // 3 color block, number 4 is transparent
- colors[2].a = 0xff;
- colors[2].r = (BYTE)((WORD(colors[0].r) + WORD(colors[1].r)) / 2);
- colors[2].g = (BYTE)((WORD(colors[0].g) + WORD(colors[1].g)) / 2);
- colors[2].b = (BYTE)((WORD(colors[0].b) + WORD(colors[1].b)) / 2);
-
- colors[3].a = 0x00;
- colors[3].g = 0x00;
- colors[3].b = 0x00;
- colors[3].r = 0x00;
- }
-}
-
-struct DXT_INFO_1
-{
- typedef DXT1Block Block;
- enum { isDXT1 = 1, bytesPerBlock = 8 };
-};
-
-struct DXT_INFO_3
-{
- typedef DXT3Block Block;
- enum { isDXT1 = 1, bytesPerBlock = 16 };
-};
-
-struct DXT_INFO_5
-{
- typedef DXT5Block Block;
- enum { isDXT1 = 1, bytesPerBlock = 16 };
-};
-
-template <class INFO>
-class DXT_BLOCKDECODER_BASE
-{
-protected:
- Color8888 m_colors[4];
- const typename INFO::Block *m_pBlock;
- unsigned m_colorRow;
-
-public:
- void Setup(const BYTE *pBlock)
- {
- m_pBlock = (const typename INFO::Block *)pBlock;
- GetBlockColors(m_pBlock->color, m_colors, INFO::isDXT1);
- }
-
- void SetY(int y) { m_colorRow = m_pBlock->color.row[y]; }
-
- void GetColor(int x, int y, Color8888 &color)
- {
- Q_UNUSED(y)
- unsigned bits = (m_colorRow >> (x * 2)) & 3;
- color = m_colors[bits];
- std::swap(color.r, color.b);
- }
-};
-
-class DXT_BLOCKDECODER_1 : public DXT_BLOCKDECODER_BASE<DXT_INFO_1>
-{
-public:
- typedef DXT_INFO_1 INFO;
-};
-
-class DXT_BLOCKDECODER_3 : public DXT_BLOCKDECODER_BASE<DXT_INFO_3>
-{
-public:
- typedef DXT_BLOCKDECODER_BASE<DXT_INFO_3> base;
- typedef DXT_INFO_3 INFO;
-
-protected:
- unsigned m_alphaRow;
-
-public:
- void SetY(int y)
- {
- base::SetY(y);
- m_alphaRow = m_pBlock->alpha.row[y];
- }
-
- void GetColor(int x, int y, Color8888 &color)
- {
- base::GetColor(x, y, color);
- const unsigned bits = (m_alphaRow >> (x * 4)) & 0xF;
- color.a = (BYTE)((bits * 0xFF) / 0xF);
- }
-};
-
-class DXT_BLOCKDECODER_5 : public DXT_BLOCKDECODER_BASE<DXT_INFO_5>
-{
-public:
- typedef DXT_BLOCKDECODER_BASE<DXT_INFO_5> base;
- typedef DXT_INFO_5 INFO;
-
-protected:
- unsigned m_alphas[8];
- unsigned m_alphaBits;
- int m_offset;
-
-public:
- void Setup(const BYTE *pBlock)
- {
- base::Setup(pBlock);
-
- const DXTAlphaBlock3BitLinear &block = m_pBlock->alpha;
- m_alphas[0] = block.alpha[0];
- m_alphas[1] = block.alpha[1];
- if (m_alphas[0] > m_alphas[1]) {
- // 8 alpha block
- for (int i = 0; i < 6; i++) {
- m_alphas[i + 2] = ((6 - i) * m_alphas[0] + (1 + i) * m_alphas[1] + 3) / 7;
- }
- } else {
- // 6 alpha block
- for (int i = 0; i < 4; i++) {
- m_alphas[i + 2] = ((4 - i) * m_alphas[0] + (1 + i) * m_alphas[1] + 2) / 5;
- }
- m_alphas[6] = 0;
- m_alphas[7] = 0xFF;
- }
- }
-
- void SetY(int y)
- {
- base::SetY(y);
- int i = y / 2;
- const DXTAlphaBlock3BitLinear &block = m_pBlock->alpha;
- m_alphaBits = unsigned(block.data[0 + i * 3]) | (unsigned(block.data[1 + i * 3]) << 8)
- | (unsigned(block.data[2 + i * 3]) << 16);
- m_offset = (y & 1) * 12;
- }
-
- void GetColor(int x, int y, Color8888 &color)
- {
- base::GetColor(x, y, color);
- unsigned bits = (m_alphaBits >> (x * 3 + m_offset)) & 7;
- color.a = (BYTE)m_alphas[bits];
- std::swap(color.r, color.b);
- }
-};
-
-template <class DECODER>
-void DecodeDXTBlock(BYTE *dstData, const BYTE *srcBlock, long dstPitch, int bw, int bh)
-{
- DECODER decoder;
- decoder.Setup(srcBlock);
- for (int y = 0; y < bh; y++) {
- // Note that this assumes the pointer is pointing to the *last* valid start
- // row.
- BYTE *dst = dstData - y * dstPitch;
- decoder.SetY(y);
- for (int x = 0; x < bw; x++) {
- decoder.GetColor(x, y, (Color8888 &)*dst);
- dst += 4;
- }
- }
-}
-
-struct STextureDataWriter
-{
- QT3DSU32 m_Width;
- QT3DSU32 m_Height;
- QT3DSU32 m_Stride;
- QT3DSU32 m_NumComponents;
- STextureData &m_TextureData;
- STextureDataWriter(QT3DSU32 w, QT3DSU32 h, bool hasA, STextureData &inTd, NVAllocatorCallback &alloc)
- : m_Width(w)
- , m_Height(h)
- , m_Stride(hasA ? m_Width * 4 : m_Width * 3)
- , m_NumComponents(hasA ? 4 : 3)
- , m_TextureData(inTd)
- {
- QT3DSU32 dataSize = m_Stride * m_Height;
- if (dataSize > m_TextureData.dataSizeInBytes) {
- alloc.deallocate(m_TextureData.data);
- m_TextureData.data =
- alloc.allocate(dataSize, "SLoadedTexture::DecompressDXTImage", __FILE__, __LINE__);
- m_TextureData.dataSizeInBytes = dataSize;
- }
- memZero(m_TextureData.data, m_TextureData.dataSizeInBytes);
- m_TextureData.format = hasA ? NVRenderTextureFormats::RGBA8 : NVRenderTextureFormats::RGB8;
- }
-
- void WritePixel(QT3DSU32 X, QT3DSU32 Y, QT3DSU8 *pixelData)
- {
- if (X < m_Width && Y < m_Height) {
- char *textureData = reinterpret_cast<char *>(m_TextureData.data);
- QT3DSU32 offset = Y * m_Stride + X * m_NumComponents;
-
- for (QT3DSU32 idx = 0; idx < m_NumComponents; ++idx)
- QT3DS_ASSERT(textureData[offset + idx] == 0);
-
- memCopy(textureData + offset, pixelData, m_NumComponents);
- }
- }
-
- // Incoming pixels are assumed to be RGBA or RGBX, 32 bit in any case
- void WriteBlock(QT3DSU32 X, QT3DSU32 Y, QT3DSU32 width, QT3DSU32 height, QT3DSU8 *pixelData)
- {
- QT3DSU32 offset = 0;
- for (QT3DSU32 yidx = 0; yidx < height; ++yidx) {
- for (QT3DSU32 xidx = 0; xidx < width; ++xidx, offset += 4) {
- WritePixel(X + xidx, Y + (height - yidx - 1), pixelData + offset);
- }
- }
- }
- bool Finished() { return false; }
-};
-
-struct STextureAlphaScanner
-{
- bool &m_Alpha;
-
- STextureAlphaScanner(bool &inAlpha)
- : m_Alpha(inAlpha)
- {
- }
-
- void WriteBlock(QT3DSU32 X, QT3DSU32 Y, QT3DSU32 width, QT3DSU32 height, QT3DSU8 *pixelData)
- {
- Q_UNUSED(X)
- Q_UNUSED(Y)
- QT3DSU32 offset = 0;
- for (QT3DSU32 yidx = 0; yidx < height; ++yidx) {
- for (QT3DSU32 xidx = 0; xidx < width; ++xidx, offset += 4) {
- if (pixelData[offset + 3] < 255)
- m_Alpha = true;
- }
- }
- }
-
- // If we detect alpha we can stop right there.
- bool Finished() { return m_Alpha; }
-};
-// Scan the dds image's mipmap 0 level for alpha.
-template <class DECODER, class TWriterType>
-static void DecompressDDS(void *inSrc, QT3DSU32 inDataSize, QT3DSU32 inWidth, QT3DSU32 inHeight,
- TWriterType ioWriter)
-{
- typedef typename DECODER::INFO INFO;
- typedef typename INFO::Block Block;
- (void)inDataSize;
-
- const QT3DSU8 *pbSrc = (const QT3DSU8 *)inSrc;
- // Each DX block is composed of 16 pixels. Free image decodes those
- // pixels into a 4x4 block of data.
- QT3DSU8 pbDstData[4 * 4 * 4];
- // The decoder decodes backwards
- // So we need to point to the last line.
- QT3DSU8 *pbDst = pbDstData + 48;
-
- int width = (int)inWidth;
- int height = (int)inHeight;
- int lineStride = 16;
- for (int y = 0; y < height && ioWriter.Finished() == false; y += 4) {
- int yPixels = NVMin(height - y, 4);
- for (int x = 0; x < width && ioWriter.Finished() == false; x += 4) {
- int xPixels = NVMin(width - x, 4);
- DecodeDXTBlock<DECODER>(pbDst, pbSrc, lineStride, xPixels, yPixels);
- pbSrc += INFO::bytesPerBlock;
- ioWriter.WriteBlock(x, y, xPixels, yPixels, pbDstData);
- }
- }
-}
-
-bool ScanDDSForAlpha(Qt3DSDDSImage *dds)
-{
- bool hasAlpha = false;
- switch (dds->format) {
- case qt3ds::render::NVRenderTextureFormats::RGBA_DXT1:
- DecompressDDS<DXT_BLOCKDECODER_1>(dds->data[0], dds->size[0], dds->mipwidth[0],
- dds->mipheight[0], STextureAlphaScanner(hasAlpha));
- break;
- case qt3ds::render::NVRenderTextureFormats::RGBA_DXT3:
- DecompressDDS<DXT_BLOCKDECODER_3>(dds->data[0], dds->size[0], dds->mipwidth[0],
- dds->mipheight[0], STextureAlphaScanner(hasAlpha));
- break;
- case qt3ds::render::NVRenderTextureFormats::RGBA_DXT5:
- DecompressDDS<DXT_BLOCKDECODER_5>(dds->data[0], dds->size[0], dds->mipwidth[0],
- dds->mipheight[0], STextureAlphaScanner(hasAlpha));
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- return hasAlpha;
-}
-
-bool ScanImageForAlpha(const void *inData, QT3DSU32 inWidth, QT3DSU32 inHeight, QT3DSU32 inPixelSizeInBytes,
- QT3DSU8 inAlphaSizeInBits)
-{
- const QT3DSU8 *rowPtr = reinterpret_cast<const QT3DSU8 *>(inData);
- bool hasAlpha = false;
- if (inAlphaSizeInBits == 0)
- return hasAlpha;
- if (inPixelSizeInBytes != 2 && inPixelSizeInBytes != 4) {
- QT3DS_ASSERT(false);
- return false;
- }
- if (inAlphaSizeInBits > 8) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- QT3DSU32 alphaRightShift = inPixelSizeInBytes * 8 - inAlphaSizeInBits;
- QT3DSU32 maxAlphaValue = (1 << inAlphaSizeInBits) - 1;
-
- for (QT3DSU32 rowIdx = 0; rowIdx < inHeight && hasAlpha == false; ++rowIdx) {
- for (QT3DSU32 idx = 0; idx < inWidth && hasAlpha == false;
- ++idx, rowPtr += inPixelSizeInBytes) {
- QT3DSU32 pixelValue = 0;
- if (inPixelSizeInBytes == 2)
- pixelValue = *(reinterpret_cast<const QT3DSU16 *>(rowPtr));
- else
- pixelValue = *(reinterpret_cast<const QT3DSU32 *>(rowPtr));
- pixelValue = pixelValue >> alphaRightShift;
- if (pixelValue < maxAlphaValue)
- hasAlpha = true;
- }
- }
- return hasAlpha;
-}
-}
-
-SLoadedTexture::~SLoadedTexture()
-{
- if (dds) {
- if (dds->dataBlock)
- QT3DS_FREE(m_Allocator, dds->dataBlock);
-
- QT3DS_FREE(m_Allocator, dds);
- } else if (data && image.byteCount() <= 0) {
- m_Allocator.deallocate(data);
- }
- if (m_Palette)
- m_Allocator.deallocate(m_Palette);
- if (m_TransparencyTable)
- m_Allocator.deallocate(m_TransparencyTable);
-}
-
-void SLoadedTexture::release()
-{
- NVAllocatorCallback *theAllocator(&m_Allocator);
- this->~SLoadedTexture();
- theAllocator->deallocate(this);
-}
-
-bool SLoadedTexture::ScanForTransparency()
-{
- switch (format) {
- case NVRenderTextureFormats::SRGB8A8:
- case NVRenderTextureFormats::RGBA8:
- if (!data) { // dds
- return true;
- } else {
- return ScanImageForAlpha(data, width, height, 4, 8);
- }
- break;
- // Scan the image.
- case NVRenderTextureFormats::SRGB8:
- case NVRenderTextureFormats::RGB8:
- return false;
- break;
- case NVRenderTextureFormats::RGB565:
- return false;
- break;
- case NVRenderTextureFormats::RGBA5551:
- if (!data) { // dds
- return true;
- } else {
- return ScanImageForAlpha(data, width, height, 2, 1);
- }
- break;
- case NVRenderTextureFormats::Alpha8:
- return true;
- break;
- case NVRenderTextureFormats::Luminance8:
- return false;
- break;
- case NVRenderTextureFormats::LuminanceAlpha8:
- if (!data) { // dds
- return true;
- } else {
- return ScanImageForAlpha(data, width, height, 2, 8);
- }
- break;
- case NVRenderTextureFormats::RGB_DXT1:
- return false;
- break;
- case NVRenderTextureFormats::RGBA_DXT3:
- case NVRenderTextureFormats::RGBA_DXT1:
- case NVRenderTextureFormats::RGBA_DXT5:
- if (dds) {
- return ScanDDSForAlpha(dds);
- } else {
- QT3DS_ASSERT(false);
- return false;
- }
- break;
- case NVRenderTextureFormats::RGB9E5:
- return false;
- break;
- case NVRenderTextureFormats::RG32F:
- case NVRenderTextureFormats::RGB32F:
- case NVRenderTextureFormats::RGBA16F:
- case NVRenderTextureFormats::RGBA32F:
- // PKC TODO : For now, since IBL will be the main consumer, we'll just pretend there's no
- // alpha.
- // Need to do a proper scan down the line, but doing it for floats is a little different
- // from
- // integer scans.
- return false;
- break;
- default:
- break;
- }
- QT3DS_ASSERT(false);
- return false;
-}
-
-void SLoadedTexture::EnsureMultiplerOfFour(NVFoundationBase &inFoundation, const char *inPath)
-{
- if (width % 4 || height % 4) {
- qCWarning(PERF_WARNING,
- "Image %s has non multiple of four width or height; perf hit for scaling", inPath);
- if (data) {
- QT3DSU32 newWidth = ITextRenderer::NextMultipleOf4(width);
- QT3DSU32 newHeight = ITextRenderer::NextMultipleOf4(height);
- QT3DSU32 newDataSize = newWidth * newHeight * components;
- NVAllocatorCallback &theAllocator(inFoundation.getAllocator());
- QT3DSU8 *newData = (QT3DSU8 *)(theAllocator.allocate(newDataSize, "Scaled Image Data",
- __FILE__, __LINE__));
- CImageScaler theScaler(theAllocator);
- if (components == 4) {
- theScaler.FastExpandRowsAndColumns((unsigned char *)data, width, height, newData,
- newWidth, newHeight);
- } else
- theScaler.ExpandRowsAndColumns((unsigned char *)data, width, height, newData,
- newWidth, newHeight, components);
-
- theAllocator.deallocate(data);
- data = newData;
- width = newWidth;
- height = newHeight;
- dataSizeInBytes = newDataSize;
- }
- }
-}
-
-STextureData SLoadedTexture::DecompressDXTImage(int inMipMapIdx, STextureData *inOptLastImage)
-{
- STextureData retval;
- if (inOptLastImage)
- retval = *inOptLastImage;
-
- if (dds == NULL || inMipMapIdx >= dds->numMipmaps) {
- QT3DS_ASSERT(false);
- ReleaseDecompressedTexture(retval);
- return STextureData();
- }
- char *srcData = (char *)dds->data[inMipMapIdx];
- int srcDataSize = dds->size[inMipMapIdx];
- QT3DSU32 imgWidth = (QT3DSU32)dds->mipwidth[inMipMapIdx];
- QT3DSU32 imgHeight = (QT3DSU32)dds->mipheight[inMipMapIdx];
-
- switch (format) {
- case NVRenderTextureFormats::RGB_DXT1:
- DecompressDDS<DXT_BLOCKDECODER_1>(
- srcData, srcDataSize, imgWidth, imgHeight,
- STextureDataWriter(imgWidth, imgHeight, false, retval, m_Allocator));
- break;
- case NVRenderTextureFormats::RGBA_DXT1:
- DecompressDDS<DXT_BLOCKDECODER_1>(
- srcData, srcDataSize, imgWidth, imgHeight,
- STextureDataWriter(imgWidth, imgHeight, true, retval, m_Allocator));
- break;
- case NVRenderTextureFormats::RGBA_DXT3:
- DecompressDDS<DXT_BLOCKDECODER_3>(
- srcData, srcDataSize, imgWidth, imgHeight,
- STextureDataWriter(imgWidth, imgHeight, true, retval, m_Allocator));
- break;
- case NVRenderTextureFormats::RGBA_DXT5:
- DecompressDDS<DXT_BLOCKDECODER_5>(
- srcData, srcDataSize, imgWidth, imgHeight,
- STextureDataWriter(imgWidth, imgHeight, true, retval, m_Allocator));
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- return retval;
-}
-
-void SLoadedTexture::ReleaseDecompressedTexture(STextureData inImage)
-{
- if (inImage.data)
- m_Allocator.deallocate(inImage.data);
-}
-
-#ifndef EA_PLATFORM_WINDOWS
-#define stricmp strcasecmp
-#endif
-
-SLoadedTexture *SLoadedTexture::Load(const QString &inPath, NVFoundationBase &inFoundation,
- IInputStreamFactory &inFactory, bool inFlipY,
- NVRenderContextType renderContextType, bool preferKTX)
-{
- if (inPath.isEmpty())
- return nullptr;
-
- // Check KTX path first
- QString path = inPath;
- QString ktxSource = inPath;
- if (preferKTX) {
- ktxSource = ktxSource.left(ktxSource.lastIndexOf(QLatin1Char('.')));
- ktxSource.append(QLatin1String(".ktx"));
- }
-
- SLoadedTexture *theLoadedImage = nullptr;
- // We will get invalid error logs of files not found if we don't force quiet mode
- // If the file is actually missing, it will be logged later (loaded image is null)
- NVScopedRefCounted<IRefCountedInputStream> theStream(
- inFactory.GetStreamForFile(preferKTX ? ktxSource : inPath, true));
- if (!theStream.mPtr) {
- if (preferKTX)
- theStream = inFactory.GetStreamForFile(inPath, true);
- else
- return nullptr;
- } else {
- path = ktxSource;
- }
- QString fileName;
- inFactory.GetPathForFile(path, fileName, true);
- if (theStream.mPtr && path.size() > 3) {
- if (path.endsWith(QLatin1String("png"), Qt::CaseInsensitive)
- || path.endsWith(QLatin1String("jpg"), Qt::CaseInsensitive)
- || path.endsWith(QLatin1String("peg"), Qt::CaseInsensitive)) {
- theLoadedImage = LoadQImage(fileName, inFlipY, inFoundation, renderContextType);
- } else if (path.endsWith(QLatin1String("dds"), Qt::CaseInsensitive)) {
- theLoadedImage = LoadDDS(*theStream, inFlipY, inFoundation, renderContextType);
- } else if (path.endsWith(QLatin1String("gif"), Qt::CaseInsensitive)) {
- theLoadedImage = LoadGIF(*theStream, !inFlipY, inFoundation, renderContextType);
- } else if (path.endsWith(QLatin1String("bmp"), Qt::CaseInsensitive)) {
- theLoadedImage = LoadBMP(*theStream, !inFlipY, inFoundation, renderContextType);
- } else if (path.endsWith(QLatin1String("hdr"), Qt::CaseInsensitive)) {
- theLoadedImage = LoadHDR(*theStream, inFoundation, renderContextType);
- } else if (path.endsWith(QLatin1String("ktx"), Qt::CaseInsensitive)) {
- theLoadedImage = LoadKTX(*theStream, inFlipY, inFoundation, renderContextType);
- } else {
- qCWarning(INTERNAL_ERROR, "Unrecognized image extension: %s", qPrintable(inPath));
- }
- }
-
- return theLoadedImage;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.h
deleted file mode 100644
index f0194000..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_LOADED_TEXTURE_H
-#define QT3DS_RENDER_LOADED_TEXTURE_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSSimpleTypes.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-#include "Qt3DSRenderLoadedTextureDDS.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include <QImage>
-
-namespace qt3ds {
-namespace foundation {
- class ISeekableIOStream;
- class IInStream;
-}
-}
-
-namespace qt3ds {
-namespace render {
-
- class IInputStreamFactory;
-
- struct STextureData
- {
- void *data;
- QT3DSU32 dataSizeInBytes;
- qt3ds::render::NVRenderTextureFormats::Enum format;
- STextureData()
- : data(NULL)
- , dataSizeInBytes(0)
- , format(qt3ds::render::NVRenderTextureFormats::Unknown)
- {
- }
- };
- struct ExtendedTextureFormats
- {
- enum Enum {
- NoExtendedFormat = 0,
- Palettized,
- CustomRGB,
- };
- };
- // Utility class used for loading image data from disk.
- // Supports jpg, png, and dds.
- struct SLoadedTexture : public NVReleasable
- {
- private:
- ~SLoadedTexture();
-
- public:
- NVAllocatorCallback &m_Allocator;
- QT3DSI32 width;
- QT3DSI32 height;
- QT3DSI32 components;
- void *data;
- QImage image;
- QT3DSU32 dataSizeInBytes;
- qt3ds::render::NVRenderTextureFormats::Enum format;
- Qt3DSDDSImage *dds;
- ExtendedTextureFormats::Enum m_ExtendedFormat;
- // Used for palettized images.
- void *m_Palette;
- QT3DSI32 m_CustomMasks[3];
- int m_BitCount;
- char8_t m_BackgroundColor[3];
- uint8_t *m_TransparencyTable;
- int32_t m_TransparentPaletteIndex;
-
- SLoadedTexture(NVAllocatorCallback &inAllocator)
- : m_Allocator(inAllocator)
- , width(0)
- , height(0)
- , components(0)
- , data(NULL)
- , image(0)
- , dataSizeInBytes(0)
- , format(qt3ds::render::NVRenderTextureFormats::RGBA8)
- , dds(NULL)
- , m_ExtendedFormat(ExtendedTextureFormats::NoExtendedFormat)
- , m_Palette(NULL)
- , m_BitCount(0)
- , m_TransparencyTable(NULL)
- , m_TransparentPaletteIndex(-1)
- {
- m_CustomMasks[0] = 0;
- m_CustomMasks[1] = 0;
- m_CustomMasks[2] = 0;
- m_BackgroundColor[0] = 0;
- m_BackgroundColor[1] = 0;
- m_BackgroundColor[2] = 0;
- }
- void setFormatFromComponents()
- {
- switch (components) {
- case 1: // undefined, but in this context probably luminance
- format = qt3ds::render::NVRenderTextureFormats::Luminance8;
- break;
- case 2:
- format = qt3ds::render::NVRenderTextureFormats::LuminanceAlpha8;
- break;
- case 3:
- format = qt3ds::render::NVRenderTextureFormats::RGB8;
- break;
-
- default:
- // fallthrough intentional
- case 4:
- format = qt3ds::render::NVRenderTextureFormats::RGBA8;
- break;
- }
- }
-
- void EnsureMultiplerOfFour(NVFoundationBase &inFoundation, const char *inPath);
- // Returns true if this image has a pixel less than 255.
- bool ScanForTransparency();
-
- // Be sure to call this or risk leaking an enormous amount of memory
- void release() override;
-
- // Not all video cards support dxt compression. Giving the last image allows
- // this object to potentially reuse the memory
- STextureData DecompressDXTImage(int inMipMapIdx, STextureData *inOptLastImage = NULL);
- void ReleaseDecompressedTexture(STextureData inImage);
-
- static SLoadedTexture *Load(const QString &inPath, NVFoundationBase &inAllocator,
- IInputStreamFactory &inFactory, bool inFlipY = true,
- NVRenderContextType renderContextType
- = NVRenderContextValues::NullContext, bool preferKTX = false);
- static SLoadedTexture *LoadDDS(IInStream &inStream, QT3DSI32 flipVertical,
- NVFoundationBase &fnd,
- NVRenderContextType renderContextType);
- static SLoadedTexture *LoadKTX(IInStream &inStream, QT3DSI32 flipVertical,
- NVFoundationBase &fnd,
- NVRenderContextType renderContextType);
- static SLoadedTexture *LoadBMP(ISeekableIOStream &inStream, bool inFlipY,
- NVFoundationBase &inFnd,
- NVRenderContextType renderContextType);
- static SLoadedTexture *LoadGIF(ISeekableIOStream &inStream, bool inFlipY,
- NVFoundationBase &inFnd,
- NVRenderContextType renderContextType);
- static SLoadedTexture *LoadHDR(ISeekableIOStream &inStream, NVFoundationBase &inFnd,
- NVRenderContextType renderContextType);
-
- static SLoadedTexture *LoadQImage(const QString &inPath, QT3DSI32 flipVertical,
- NVFoundationBase &fnd,
- NVRenderContextType renderContextType);
-
- private:
- // Implemented in the bmp loader.
- void FreeImagePostProcess(bool inFlipY);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureBMP.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureBMP.cpp
deleted file mode 100644
index 29e75a89..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureBMP.cpp
+++ /dev/null
@@ -1,1262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// ==========================================================
-// BMP Loader and Writer
-//
-// Design and implementation by
-// - Floris van den Berg (flvdberg@wxs.nl)
-// - Markus Loibl (markus.loibl@epost.de)
-// - Martin Weber (martweb@gmx.net)
-// - Herve Drolon (drolon@infonie.fr)
-// - Michal Novotny (michal@etc.cz)
-//
-// This file is part of FreeImage 3
-//
-// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
-// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
-// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
-// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
-// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
-// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
-// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
-// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
-// THIS DISCLAIMER.
-//
-// Use at your own risk!
-// ==========================================================
-
-#include "Qt3DSRenderLoadedTextureFreeImageCompat.h"
-
-// ----------------------------------------------------------
-// Constants + headers
-// ----------------------------------------------------------
-
-static const BYTE RLE_COMMAND = 0;
-static const BYTE RLE_ENDOFLINE = 0;
-static const BYTE RLE_ENDOFBITMAP = 1;
-static const BYTE RLE_DELTA = 2;
-
-static const BYTE BI_RGB = 0;
-static const BYTE BI_RLE8 = 1;
-static const BYTE BI_RLE4 = 2;
-static const BYTE BI_BITFIELDS = 3;
-
-// ----------------------------------------------------------
-
-#ifdef _WIN32
-#pragma pack(push, 1)
-#else
-#pragma pack(1)
-#endif
-
-typedef struct tagBITMAPCOREHEADER
-{
- DWORD bcSize;
- WORD bcWidth;
- WORD bcHeight;
- WORD bcPlanes;
- WORD bcBitCnt;
-} BITMAPCOREHEADER, *PBITMAPCOREHEADER;
-
-typedef struct tagBITMAPINFOOS2_1X_HEADER
-{
- DWORD biSize;
- WORD biWidth;
- WORD biHeight;
- WORD biPlanes;
- WORD biBitCount;
-} BITMAPINFOOS2_1X_HEADER, *PBITMAPINFOOS2_1X_HEADER;
-
-typedef struct tagBITMAPFILEHEADER
-{
- WORD bfType;
- DWORD bfSize;
- WORD bfReserved1;
- WORD bfReserved2;
- DWORD bfOffBits;
-} BITMAPFILEHEADER, *PBITMAPFILEHEADER;
-
-
-#ifdef _WIN32
-#pragma pack(pop)
-#else
-#pragma pack()
-#endif
-
-// ==========================================================
-// Plugin Interface
-// ==========================================================
-
-static int s_format_id;
-
-// ==========================================================
-// Internal functions
-// ==========================================================
-
-#ifdef FREEIMAGE_BIGENDIAN
-static void SwapInfoHeader(BITMAPINFOHEADER *header)
-{
- SwapLong(&header->biSize);
- SwapLong((DWORD *)&header->biWidth);
- SwapLong((DWORD *)&header->biHeight);
- SwapShort(&header->biPlanes);
- SwapShort(&header->biBitCount);
- SwapLong(&header->biCompression);
- SwapLong(&header->biSizeImage);
- SwapLong((DWORD *)&header->biXPelsPerMeter);
- SwapLong((DWORD *)&header->biYPelsPerMeter);
- SwapLong(&header->biClrUsed);
- SwapLong(&header->biClrImportant);
-}
-
-static void SwapCoreHeader(BITMAPCOREHEADER *header)
-{
- SwapLong(&header->bcSize);
- SwapShort(&header->bcWidth);
- SwapShort(&header->bcHeight);
- SwapShort(&header->bcPlanes);
- SwapShort(&header->bcBitCnt);
-}
-
-static void SwapOS21XHeader(BITMAPINFOOS2_1X_HEADER *header)
-{
- SwapLong(&header->biSize);
- SwapShort(&header->biWidth);
- SwapShort(&header->biHeight);
- SwapShort(&header->biPlanes);
- SwapShort(&header->biBitCount);
-}
-
-static void SwapFileHeader(BITMAPFILEHEADER *header)
-{
- SwapShort(&header->bfType);
- SwapLong(&header->bfSize);
- SwapShort(&header->bfReserved1);
- SwapShort(&header->bfReserved2);
- SwapLong(&header->bfOffBits);
-}
-#endif
-
-// --------------------------------------------------------------------------
-
-/**
-Load uncompressed image pixels for 1-, 4-, 8-, 16-, 24- and 32-bit dib
-@param io FreeImage IO
-@param handle FreeImage IO handle
-@param dib Image to be loaded
-@param height Image height
-@param pitch Image pitch
-@param bit_count Image bit-depth (1-, 4-, 8-, 16-, 24- or 32-bit)
-*/
-static void LoadPixelData(FreeImageIO *io, fi_handle handle, FIBITMAP *dib, int height, int pitch,
- int bit_count)
-{
- (void)bit_count;
- // Load pixel data
- // NB: height can be < 0 for BMP data
- if (height > 0) {
- io->read_proc((void *)FreeImage_GetBits(dib), height * pitch, 1, handle);
- } else {
- int positiveHeight = abs(height);
- for (int c = 0; c < positiveHeight; ++c) {
- io->read_proc((void *)FreeImage_GetScanLine(dib, positiveHeight - c - 1), pitch, 1,
- handle);
- }
- }
-
-// swap as needed
-#ifdef FREEIMAGE_BIGENDIAN
- if (bit_count == 16) {
- for (unsigned y = 0; y < FreeImage_GetHeight(dib); y++) {
- WORD *pixel = (WORD *)FreeImage_GetScanLine(dib, y);
- for (unsigned x = 0; x < FreeImage_GetWidth(dib); x++) {
- SwapShort(pixel);
- pixel++;
- }
- }
- }
-#endif
-
-#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB
- if (bit_count == 24 || bit_count == 32) {
- for (unsigned y = 0; y < FreeImage_GetHeight(dib); y++) {
- BYTE *pixel = FreeImage_GetScanLine(dib, y);
- for (unsigned x = 0; x < FreeImage_GetWidth(dib); x++) {
- INPLACESWAP(pixel[0], pixel[2]);
- pixel += (bit_count >> 3);
- }
- }
- }
-#endif
-}
-
-/**
-Load image pixels for 4-bit RLE compressed dib
-@param io FreeImage IO
-@param handle FreeImage IO handle
-@param width Image width
-@param height Image height
-@param dib Image to be loaded
-@return Returns TRUE if successful, returns FALSE otherwise
-*/
-static BOOL LoadPixelDataRLE4(FreeImageIO *io, fi_handle handle, int width, int height,
- FIBITMAP *dib)
-{
- int status_byte = 0;
- BYTE second_byte = 0;
- int bits = 0;
-
- BYTE *pixels = NULL; // temporary 8-bit buffer
-
- try {
- height = abs(height);
-
- pixels = (BYTE *)malloc(width * height * sizeof(BYTE));
- if (!pixels)
- throw(1);
- memset(pixels, 0, width * height * sizeof(BYTE));
-
- BYTE *q = pixels;
- BYTE *end = pixels + height * width;
-
- for (int scanline = 0; scanline < height;) {
- if (q < pixels || q >= end) {
- break;
- }
- if (io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
- if (status_byte != 0) {
- status_byte = (int)MIN((size_t)status_byte, (size_t)(end - q));
- // Encoded mode
- if (io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
- for (int i = 0; i < status_byte; i++) {
- *q++ = (BYTE)((i & 0x01) ? (second_byte & 0x0f) : ((second_byte >> 4) & 0x0f));
- }
- bits += status_byte;
- } else {
- // Escape mode
- if (io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
- switch (status_byte) {
- case RLE_ENDOFLINE: {
- // End of line
- bits = 0;
- scanline++;
- q = pixels + scanline * width;
- } break;
-
- case RLE_ENDOFBITMAP:
- // End of bitmap
- q = end;
- break;
-
- case RLE_DELTA: {
- // read the delta values
-
- BYTE delta_x = 0;
- BYTE delta_y = 0;
-
- if (io->read_proc(&delta_x, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
- if (io->read_proc(&delta_y, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
-
- // apply them
-
- bits += delta_x;
- scanline += delta_y;
- q = pixels + scanline * width + bits;
- } break;
-
- default: {
- // Absolute mode
- status_byte = (int)MIN((size_t)status_byte, (size_t)(end - q));
- for (int i = 0; i < status_byte; i++) {
- if ((i & 0x01) == 0) {
- if (io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
- }
- *q++ =
- (BYTE)((i & 0x01) ? (second_byte & 0x0f) : ((second_byte >> 4) & 0x0f));
- }
- bits += status_byte;
- // Read pad byte
- if (((status_byte & 0x03) == 1) || ((status_byte & 0x03) == 2)) {
- BYTE padding = 0;
- if (io->read_proc(&padding, sizeof(BYTE), 1, handle) != 1) {
- throw(1);
- }
- }
- } break;
- }
- }
- }
-
- {
- // Convert to 4-bit
- for (int y = 0; y < height; y++) {
- const BYTE *src = (BYTE *)pixels + y * width;
- BYTE *dst = FreeImage_GetScanLine(dib, y);
-
- BOOL hinibble = TRUE;
-
- for (int cols = 0; cols < width; cols++) {
- if (hinibble) {
- dst[cols >> 1] = (src[cols] << 4);
- } else {
- dst[cols >> 1] |= src[cols];
- }
-
- hinibble = !hinibble;
- }
- }
- }
-
- free(pixels);
-
- return TRUE;
-
- } catch (int) {
- if (pixels)
- free(pixels);
- return FALSE;
- }
-}
-
-/**
-Load image pixels for 8-bit RLE compressed dib
-@param io FreeImage IO
-@param handle FreeImage IO handle
-@param width Image width
-@param height Image height
-@param dib Image to be loaded
-@return Returns TRUE if successful, returns FALSE otherwise
-*/
-static BOOL LoadPixelDataRLE8(FreeImageIO *io, fi_handle handle, int width, int height,
- FIBITMAP *dib)
-{
- BYTE status_byte = 0;
- BYTE second_byte = 0;
- int scanline = 0;
- int bits = 0;
-
- for (;;) {
- if (io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) {
- return FALSE;
- }
-
- switch (status_byte) {
- case RLE_COMMAND:
- if (io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) {
- return FALSE;
- }
-
- switch (status_byte) {
- case RLE_ENDOFLINE:
- bits = 0;
- scanline++;
- break;
-
- case RLE_ENDOFBITMAP:
- return TRUE;
-
- case RLE_DELTA: {
- // read the delta values
-
- BYTE delta_x = 0;
- BYTE delta_y = 0;
-
- if (io->read_proc(&delta_x, sizeof(BYTE), 1, handle) != 1) {
- return FALSE;
- }
- if (io->read_proc(&delta_y, sizeof(BYTE), 1, handle) != 1) {
- return FALSE;
- }
-
- // apply them
-
- bits += delta_x;
- scanline += delta_y;
-
- break;
- }
-
- default: {
- if (scanline >= abs(height)) {
- return TRUE;
- }
-
- int count = MIN((int)status_byte, width - bits);
-
- BYTE *sline = FreeImage_GetScanLine(dib, scanline);
-
- if (io->read_proc((void *)(sline + bits), sizeof(BYTE) * count, 1, handle) != 1) {
- return FALSE;
- }
-
- // align run length to even number of bytes
-
- if ((status_byte & 1) == 1) {
- if (io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) {
- return FALSE;
- }
- }
-
- bits += status_byte;
-
- break;
- }
- }
-
- break;
-
- default: {
- if (scanline >= abs(height)) {
- return TRUE;
- }
-
- int count = MIN((int)status_byte, width - bits);
-
- BYTE *sline = FreeImage_GetScanLine(dib, scanline);
-
- if (io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) {
- return FALSE;
- }
-
- for (int i = 0; i < count; i++) {
- *(sline + bits) = second_byte;
-
- bits++;
- }
-
- break;
- }
- }
- }
-}
-
-// --------------------------------------------------------------------------
-
-static FIBITMAP *LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags,
- unsigned bitmap_bits_offset)
-{
- FIBITMAP *dib = NULL;
- (void)flags;
- try {
- // load the info header
-
- BITMAPINFOHEADER bih;
-
- io->read_proc(&bih, sizeof(BITMAPINFOHEADER), 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapInfoHeader(&bih);
-#endif
-
- // keep some general information about the bitmap
-
- int used_colors = bih.biClrUsed;
- int width = bih.biWidth;
- int height = bih.biHeight; // WARNING: height can be < 0 => check each call using 'height'
- // as a parameter
- int alloc_height = abs(height);
- int bit_count = bih.biBitCount;
- int compression = bih.biCompression;
- int pitch = CalculatePitch(CalculateLine(width, bit_count));
-
- switch (bit_count) {
- case 1:
- case 4:
- case 8: {
- if ((used_colors <= 0) || (used_colors > CalculateUsedPaletteEntries(bit_count)))
- used_colors = CalculateUsedPaletteEntries(bit_count);
-
- // allocate enough memory to hold the bitmap (header, palette, pixels) and read the
- // palette
-
- dib = FreeImage_Allocate(width, alloc_height, bit_count, io);
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information
- FreeImage_SetDotsPerMeterX(dib, bih.biXPelsPerMeter);
- FreeImage_SetDotsPerMeterY(dib, bih.biYPelsPerMeter);
-
- // load the palette
-
- io->read_proc(FreeImage_GetPalette(dib), used_colors * sizeof(RGBQUAD), 1, handle);
-#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB
- RGBQUAD *pal = FreeImage_GetPalette(dib);
- for (int i = 0; i < used_colors; i++) {
- INPLACESWAP(pal[i].rgbRed, pal[i].rgbBlue);
- }
-#endif
-
- // seek to the actual pixel data.
- // this is needed because sometimes the palette is larger than the entries it contains
- // predicts
-
- if (bitmap_bits_offset > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)
- + (used_colors * sizeof(RGBQUAD))))
- io->seek_proc(handle, bitmap_bits_offset, SEEK_SET);
-
- // read the pixel data
-
- switch (compression) {
- case BI_RGB:
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
- return dib;
-
- case BI_RLE4:
- if (LoadPixelDataRLE4(io, handle, width, height, dib)) {
- return dib;
- } else {
- throw "Error encountered while decoding RLE4 BMP data";
- }
- break;
-
- case BI_RLE8:
- if (LoadPixelDataRLE8(io, handle, width, height, dib)) {
- return dib;
- } else {
- throw "Error encountered while decoding RLE8 BMP data";
- }
- break;
-
- default:
- throw "compression type not supported";
- }
- } break; // 1-, 4-, 8-bit
-
- case 16: {
- if (bih.biCompression == BI_BITFIELDS) {
- DWORD bitfields[3];
-
- io->read_proc(bitfields, 3 * sizeof(DWORD), 1, handle);
-
- dib = FreeImage_Allocate(width, alloc_height, bit_count, bitfields[0], bitfields[1],
- bitfields[2], io);
- } else {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI16_555_RED_MASK,
- FI16_555_GREEN_MASK, FI16_555_BLUE_MASK, io);
- }
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information
- FreeImage_SetDotsPerMeterX(dib, bih.biXPelsPerMeter);
- FreeImage_SetDotsPerMeterY(dib, bih.biYPelsPerMeter);
-
- // load pixel data and swap as needed if OS is Big Endian
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- return dib;
- } break; // 16-bit
-
- case 24:
- case 32: {
- if (bih.biCompression == BI_BITFIELDS) {
- DWORD bitfields[3];
-
- io->read_proc(bitfields, 3 * sizeof(DWORD), 1, handle);
-
- dib = FreeImage_Allocate(width, alloc_height, bit_count, bitfields[0], bitfields[1],
- bitfields[2], io);
- } else {
- if (bit_count == 32) {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI_RGBA_RED_MASK,
- FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, io);
- } else {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI_RGBA_RED_MASK,
- FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, io);
- }
- }
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information
- FreeImage_SetDotsPerMeterX(dib, bih.biXPelsPerMeter);
- FreeImage_SetDotsPerMeterY(dib, bih.biYPelsPerMeter);
-
- // Skip over the optional palette
- // A 24 or 32 bit DIB may contain a palette for faster color reduction
-
- if (used_colors > 0) {
- io->seek_proc(handle, used_colors * sizeof(RGBQUAD), SEEK_CUR);
- } else if ((bih.biCompression != BI_BITFIELDS)
- && (bitmap_bits_offset
- > sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER))) {
- io->seek_proc(handle, bitmap_bits_offset, SEEK_SET);
- }
-
- // read in the bitmap bits
- // load pixel data and swap as needed if OS is Big Endian
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- // check if the bitmap contains transparency, if so enable it in the header
-
- return dib;
- } break; // 24-, 32-bit
- }
- } catch (const char *message) {
- if (dib) {
- FreeImage_Unload(dib);
- }
- if (message) {
- FreeImage_OutputMessageProc(s_format_id, message, io);
- }
- }
-
- return NULL;
-}
-
-// --------------------------------------------------------------------------
-
-static FIBITMAP *LoadOS22XBMP(FreeImageIO *io, fi_handle handle, int flags,
- unsigned bitmap_bits_offset)
-{
- FIBITMAP *dib = NULL;
- (void)flags;
- try {
- // load the info header
-
- BITMAPINFOHEADER bih;
-
- io->read_proc(&bih, sizeof(BITMAPINFOHEADER), 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapInfoHeader(&bih);
-#endif
-
- // keep some general information about the bitmap
-
- int used_colors = bih.biClrUsed;
- int width = bih.biWidth;
- int height = bih.biHeight; // WARNING: height can be < 0 => check each read_proc using
- // 'height' as a parameter
- int alloc_height = abs(height);
- int bit_count = bih.biBitCount;
- int compression = bih.biCompression;
- int pitch = CalculatePitch(CalculateLine(width, bit_count));
-
- switch (bit_count) {
- case 1:
- case 4:
- case 8: {
- if ((used_colors <= 0) || (used_colors > CalculateUsedPaletteEntries(bit_count)))
- used_colors = CalculateUsedPaletteEntries(bit_count);
-
- // allocate enough memory to hold the bitmap (header, palette, pixels) and read the
- // palette
-
- dib = FreeImage_Allocate(width, alloc_height, bit_count, io);
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information
- FreeImage_SetDotsPerMeterX(dib, bih.biXPelsPerMeter);
- FreeImage_SetDotsPerMeterY(dib, bih.biYPelsPerMeter);
-
- // load the palette
-
- io->seek_proc(handle, sizeof(BITMAPFILEHEADER) + bih.biSize, SEEK_SET);
-
- RGBQUAD *pal = FreeImage_GetPalette(dib);
-
- for (int count = 0; count < used_colors; count++) {
- FILE_BGR bgr;
-
- io->read_proc(&bgr, sizeof(FILE_BGR), 1, handle);
-
- pal[count].rgbRed = bgr.r;
- pal[count].rgbGreen = bgr.g;
- pal[count].rgbBlue = bgr.b;
- }
-
- // seek to the actual pixel data.
- // this is needed because sometimes the palette is larger than the entries it contains
- // predicts
-
- if (bitmap_bits_offset
- > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (used_colors * 3)))
- io->seek_proc(handle, bitmap_bits_offset, SEEK_SET);
-
- // read the pixel data
-
- switch (compression) {
- case BI_RGB:
- // load pixel data
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
- return dib;
-
- case BI_RLE4:
- if (LoadPixelDataRLE4(io, handle, width, height, dib)) {
- return dib;
- } else {
- throw "Error encountered while decoding RLE4 BMP data";
- }
- break;
-
- case BI_RLE8:
- if (LoadPixelDataRLE8(io, handle, width, height, dib)) {
- return dib;
- } else {
- throw "Error encountered while decoding RLE8 BMP data";
- }
- break;
-
- default:
- throw "compression type not supported";
- }
- }
-
- case 16: {
- if (bih.biCompression == 3) {
- DWORD bitfields[3];
-
- io->read_proc(bitfields, 3 * sizeof(DWORD), 1, handle);
-
- dib = FreeImage_Allocate(width, alloc_height, bit_count, bitfields[0], bitfields[1],
- bitfields[2], io);
- } else {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI16_555_RED_MASK,
- FI16_555_GREEN_MASK, FI16_555_BLUE_MASK, io);
- }
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information
- FreeImage_SetDotsPerMeterX(dib, bih.biXPelsPerMeter);
- FreeImage_SetDotsPerMeterY(dib, bih.biYPelsPerMeter);
-
- if (bitmap_bits_offset
- > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (used_colors * 3))) {
- io->seek_proc(handle, bitmap_bits_offset, SEEK_SET);
- }
-
- // load pixel data and swap as needed if OS is Big Endian
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- return dib;
- }
-
- case 24:
- case 32: {
- if (bit_count == 32) {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI_RGBA_RED_MASK,
- FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, io);
- } else {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI_RGBA_RED_MASK,
- FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, io);
- }
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information
- FreeImage_SetDotsPerMeterX(dib, bih.biXPelsPerMeter);
- FreeImage_SetDotsPerMeterY(dib, bih.biYPelsPerMeter);
-
- // Skip over the optional palette
- // A 24 or 32 bit DIB may contain a palette for faster color reduction
-
- if (bitmap_bits_offset
- > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (used_colors * 3)))
- io->seek_proc(handle, bitmap_bits_offset, SEEK_SET);
-
- // read in the bitmap bits
- // load pixel data and swap as needed if OS is Big Endian
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- return dib;
- }
- }
- } catch (const char *message) {
- if (dib)
- FreeImage_Unload(dib);
-
- FreeImage_OutputMessageProc(s_format_id, message, io);
- }
-
- return NULL;
-}
-
-// --------------------------------------------------------------------------
-
-static FIBITMAP *LoadOS21XBMP(FreeImageIO *io, fi_handle handle, int flags,
- unsigned bitmap_bits_offset)
-{
- FIBITMAP *dib = NULL;
- (void)flags;
- try {
- BITMAPINFOOS2_1X_HEADER bios2_1x;
-
- io->read_proc(&bios2_1x, sizeof(BITMAPINFOOS2_1X_HEADER), 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapOS21XHeader(&bios2_1x);
-#endif
- // keep some general information about the bitmap
-
- int used_colors = 0;
- int width = bios2_1x.biWidth;
- int height = bios2_1x.biHeight; // WARNING: height can be < 0 => check each read_proc using
- // 'height' as a parameter
- int alloc_height = abs(height);
- int bit_count = bios2_1x.biBitCount;
- int pitch = CalculatePitch(CalculateLine(width, bit_count));
-
- switch (bit_count) {
- case 1:
- case 4:
- case 8: {
- used_colors = CalculateUsedPaletteEntries(bit_count);
-
- // allocate enough memory to hold the bitmap (header, palette, pixels) and read the
- // palette
-
- dib = FreeImage_Allocate(width, alloc_height, bit_count, io);
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information to default values (72 dpi in english units)
- FreeImage_SetDotsPerMeterX(dib, 2835);
- FreeImage_SetDotsPerMeterY(dib, 2835);
-
- // load the palette
-
- RGBQUAD *pal = FreeImage_GetPalette(dib);
-
- for (int count = 0; count < used_colors; count++) {
- FILE_BGR bgr;
-
- io->read_proc(&bgr, sizeof(FILE_BGR), 1, handle);
-
- pal[count].rgbRed = bgr.r;
- pal[count].rgbGreen = bgr.g;
- pal[count].rgbBlue = bgr.b;
- }
-
- // Skip over the optional palette
- // A 24 or 32 bit DIB may contain a palette for faster color reduction
-
- io->seek_proc(handle, bitmap_bits_offset, SEEK_SET);
-
- // read the pixel data
-
- // load pixel data
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- return dib;
- }
-
- case 16: {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI16_555_RED_MASK,
- FI16_555_GREEN_MASK, FI16_555_BLUE_MASK, io);
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information to default values (72 dpi in english units)
- FreeImage_SetDotsPerMeterX(dib, 2835);
- FreeImage_SetDotsPerMeterY(dib, 2835);
-
- // load pixel data and swap as needed if OS is Big Endian
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- return dib;
- }
-
- case 24:
- case 32: {
- if (bit_count == 32) {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI_RGBA_RED_MASK,
- FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, io);
- } else {
- dib = FreeImage_Allocate(width, alloc_height, bit_count, FI_RGBA_RED_MASK,
- FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, io);
- }
-
- if (dib == NULL)
- throw "DIB allocation failed";
-
- // set resolution information to default values (72 dpi in english units)
- FreeImage_SetDotsPerMeterX(dib, 2835);
- FreeImage_SetDotsPerMeterY(dib, 2835);
-
- // Skip over the optional palette
- // A 24 or 32 bit DIB may contain a palette for faster color reduction
-
- // load pixel data and swap as needed if OS is Big Endian
- LoadPixelData(io, handle, dib, height, pitch, bit_count);
-
- // check if the bitmap contains transparency, if so enable it in the header
-
- return dib;
- }
- }
- } catch (const char *message) {
- if (dib)
- FreeImage_Unload(dib);
-
- FreeImage_OutputMessageProc(s_format_id, message, io);
- }
-
- return NULL;
-}
-
-// ==========================================================
-// Plugin Implementation
-// ==========================================================
-
-// ----------------------------------------------------------
-
-static FIBITMAP *DoLoadBMP(FreeImageIO *io, fi_handle handle, int flags)
-{
- if (handle != NULL) {
- BITMAPFILEHEADER bitmapfileheader;
- DWORD type = 0;
- BYTE magic[2];
-
- // we use this offset value to make seemingly absolute seeks relative in the file
-
- long offset_in_file = io->tell_proc(handle);
-
- // read the magic
-
- io->read_proc(&magic, sizeof(magic), 1, handle);
-
- // compare the magic with the number we know
-
- // somebody put a comment here explaining the purpose of this loop
- while (memcmp(&magic, "BA", 2) == 0) {
- io->read_proc(&bitmapfileheader.bfSize, sizeof(DWORD), 1, handle);
- io->read_proc(&bitmapfileheader.bfReserved1, sizeof(WORD), 1, handle);
- io->read_proc(&bitmapfileheader.bfReserved2, sizeof(WORD), 1, handle);
- io->read_proc(&bitmapfileheader.bfOffBits, sizeof(DWORD), 1, handle);
- io->read_proc(&magic, sizeof(magic), 1, handle);
- }
-
- // read the fileheader
-
- io->seek_proc(handle, (0 - (int)sizeof(magic)), SEEK_CUR);
- io->read_proc(&bitmapfileheader, (int)sizeof(BITMAPFILEHEADER), 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapFileHeader(&bitmapfileheader);
-#endif
-
- // read the first byte of the infoheader
-
- io->read_proc(&type, sizeof(DWORD), 1, handle);
- io->seek_proc(handle, 0 - (int)sizeof(DWORD), SEEK_CUR);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapLong(&type);
-#endif
-
- // call the appropriate load function for the found bitmap type
-
- if (type == 40)
- return LoadWindowsBMP(io, handle, flags, offset_in_file + bitmapfileheader.bfOffBits);
-
- if (type == 12)
- return LoadOS21XBMP(io, handle, flags, offset_in_file + bitmapfileheader.bfOffBits);
-
- if (type <= 64)
- return LoadOS22XBMP(io, handle, flags, offset_in_file + bitmapfileheader.bfOffBits);
-
- char buf[256];
- sprintf(buf, "unknown bmp subtype with id %d", type);
- FreeImage_OutputMessageProc(s_format_id, buf, io);
- }
-
- return NULL;
-}
-
-template <QT3DSU32 TBitWidth>
-struct SPaletteIndexer
-{
- static inline uint32_t IndexOf(const uint8_t *inData, uint32_t inPos)
- {
- uint32_t divisor = 8 / TBitWidth;
- uint32_t byte = inPos / divisor;
- uint32_t modulus = inPos % divisor;
- uint32_t shift = TBitWidth * modulus;
- uint32_t mask = (1 << TBitWidth) - 1;
- mask = mask << shift;
- uint32_t byteData = inData[byte];
- return (byteData & mask) >> shift;
- }
-};
-
-template <>
-struct SPaletteIndexer<1>
-{
- static inline uint32_t IndexOf(const uint8_t *inData, uint32_t inPos)
- {
- uint32_t byte = (inPos / 8);
- uint32_t bit = 1 << (7 - (inPos % 8));
- uint32_t byteData = inData[byte];
- return (byteData & bit) ? 1 : 0;
- }
-};
-
-template <>
-struct SPaletteIndexer<8>
-{
- static inline uint32_t IndexOf(const uint8_t *inData, uint32_t inPos)
- {
- uint32_t byte = inPos;
- uint32_t bit = 0xFF;
- uint32_t byteData = inData[byte];
- return byteData & bit;
- }
-};
-
-static inline void assignQuad(uint8_t *dest, const RGBQUAD &quad)
-{
- dest[0] = quad.rgbRed;
- dest[1] = quad.rgbGreen;
- dest[2] = quad.rgbBlue;
-}
-
-template <QT3DSU32 bitCount>
-inline void LoadPalettized(bool inFlipY, const RGBQUAD *palette, void *data, uint8_t *newData,
- int width, int height, int components, int transparentIndex)
-{
- const uint8_t *oldData = (const uint8_t *)data;
- int pitch = CalculatePitch(CalculateLine(width, bitCount));
- for (uint32_t h = 0; h < (uint32_t)height; ++h) {
- uint32_t relHeight = h;
- if (inFlipY)
- relHeight = ((uint32_t)height) - h - 1;
- for (uint32_t w = 0; w < (uint32_t)width; ++w) {
- const uint8_t *dataLine = oldData + pitch * h;
- uint32_t pos = width * relHeight + w;
- uint32_t paletteIndex = SPaletteIndexer<bitCount>::IndexOf(dataLine, w);
- const RGBQUAD &theQuad = palette[paletteIndex];
- uint8_t *writePtr = newData + (pos * components);
- assignQuad(writePtr, theQuad);
- if (paletteIndex == (uint32_t)transparentIndex && components == 4) {
- writePtr[3] = 0;
- }
- }
- }
-}
-
-inline int firstHighBit(int data)
-{
- if (data == 0)
- return 0;
- int idx = 0;
- while ((data % 2) == 0) {
- data = data >> 1;
- ++idx;
- }
- return idx;
-}
-
-struct SMaskData
-{
- uint32_t mask;
- uint32_t shift;
- uint32_t max;
-
- SMaskData(int inMask)
- {
- mask = inMask;
- shift = firstHighBit(mask);
- max = mask >> shift;
- }
-
- inline uint8_t MapColor(uint32_t color) const
- {
- uint32_t intermediateValue = (color & mask) >> shift;
- return (uint8_t)((intermediateValue * 255) / max);
- }
-};
-
-template <QT3DSU32>
-struct ColorAccess
-{
-};
-
-template <>
-struct ColorAccess<16>
-{
- static uint32_t GetPixelWidth() { return 2; }
- static uint32_t GetColor(const char8_t *src)
- {
- return (uint32_t) * reinterpret_cast<const QT3DSU16 *>(src);
- }
-};
-
-template <>
-struct ColorAccess<24>
-{
- static uint32_t GetPixelWidth() { return 3; }
- static uint32_t GetColor(const char8_t *src)
- {
- return (uint32_t)(*reinterpret_cast<const QT3DSU32 *>(src) & 0xFFFFFF);
- }
-};
-
-template <>
-struct ColorAccess<32>
-{
- static uint32_t GetPixelWidth() { return 4; }
- static uint32_t GetColor(const char8_t *src)
- {
- return *reinterpret_cast<const uint32_t *>(src);
- }
-};
-
-template <QT3DSU32 TBitCount>
-inline void LoadMasked(bool inFlipY, QT3DSI32 *inMasks, void *data, uint8_t *newData, int width,
- int height)
-{
- const char8_t *oldData = (const char8_t *)data;
- SMaskData rMask(inMasks[0]);
- SMaskData gMask(inMasks[1]);
- SMaskData bMask(inMasks[2]);
- for (int h = 0; h < height; ++h) {
- int relHeight = h;
- if (inFlipY)
- relHeight = height - h - 1;
- for (int w = 0; w < width; ++w) {
- int pos = width * relHeight + w;
- const char8_t *readPtr = oldData + (pos * ColorAccess<TBitCount>::GetPixelWidth());
- uint8_t *writePtr = newData + (pos * 3);
- uint32_t colorVal = ColorAccess<TBitCount>::GetColor(readPtr);
- writePtr[0] = rMask.MapColor(colorVal);
- writePtr[1] = gMask.MapColor(colorVal);
- writePtr[2] = bMask.MapColor(colorVal);
- }
- }
-}
-
-void SLoadedTexture::FreeImagePostProcess(bool inFlipY)
-{
- // We always convert 32 bit RGBA
- if (m_ExtendedFormat != ExtendedTextureFormats::NoExtendedFormat) {
-
- QT3DSU32 stride = 3 * width;
- format = NVRenderTextureFormats::RGB8;
- components = 3;
- if (m_ExtendedFormat == ExtendedTextureFormats::Palettized && m_TransparentPaletteIndex > -1
- && m_TransparentPaletteIndex < 256) {
- stride = 4 * width;
- components = 4;
- format = NVRenderTextureFormats::RGBA8;
- }
- QT3DSU32 byteSize = height * stride;
- uint8_t *newData =
- (uint8_t *)m_Allocator.allocate(byteSize, "texture data", __FILE__, __LINE__);
- if (format == NVRenderTextureFormats::RGBA8)
- memSet(newData, 255, byteSize);
- switch (m_ExtendedFormat) {
- case ExtendedTextureFormats::Palettized: {
- RGBQUAD *palette = (RGBQUAD *)m_Palette;
- switch (m_BitCount) {
- case 1:
- LoadPalettized<1>(inFlipY, palette, data, newData, width, height, components,
- m_TransparentPaletteIndex);
- break;
- case 2:
- LoadPalettized<2>(inFlipY, palette, data, newData, width, height, components,
- m_TransparentPaletteIndex);
- break;
- case 4:
- LoadPalettized<4>(inFlipY, palette, data, newData, width, height, components,
- m_TransparentPaletteIndex);
- break;
- case 8:
- LoadPalettized<8>(inFlipY, palette, data, newData, width, height, components,
- m_TransparentPaletteIndex);
- break;
- default:
- QT3DS_ASSERT(false);
- memSet(newData, 0, byteSize);
- break;
- }
- } break;
- case ExtendedTextureFormats::CustomRGB: {
- switch (m_BitCount) {
- case 16:
- LoadMasked<16>(inFlipY, m_CustomMasks, data, newData, width, height);
- break;
- case 24:
- LoadMasked<24>(inFlipY, m_CustomMasks, data, newData, width, height);
- break;
- case 32:
- LoadMasked<32>(inFlipY, m_CustomMasks, data, newData, width, height);
- break;
- default:
- QT3DS_ASSERT(false);
- memSet(newData, 0, byteSize);
- break;
- }
- } break;
- default:
- QT3DS_ASSERT(false);
- memSet(newData, 0, byteSize);
- break;
- }
- m_Allocator.deallocate(data);
- if (m_Palette)
- m_Allocator.deallocate(m_Palette);
- data = newData;
- m_Palette = NULL;
- m_BitCount = 0;
- this->dataSizeInBytes = byteSize;
- m_ExtendedFormat = ExtendedTextureFormats::NoExtendedFormat;
- }
-}
-
-SLoadedTexture *SLoadedTexture::LoadBMP(ISeekableIOStream &inStream, bool inFlipY,
- NVFoundationBase &inFnd,
- qt3ds::render::NVRenderContextType renderContextType)
-{
- Q_UNUSED(renderContextType)
- FreeImageIO theIO(inFnd.getAllocator(), inFnd);
- SLoadedTexture *retval = DoLoadBMP(&theIO, &inStream, 0);
- if (retval)
- retval->FreeImagePostProcess(inFlipY);
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.cpp
deleted file mode 100644
index 19d41d11..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.cpp
+++ /dev/null
@@ -1,695 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderLoadedTextureDDS.h"
-#include "Qt3DSRenderLoadedTextureFreeImageCompat.h"
-
-using namespace qt3ds::render;
-
-namespace qt3ds {
-namespace render {
-
- static int s_exception_string;
-
- //================================================================================
- // DXT data-layout structure definitions.
- typedef struct
- {
- QT3DSU16 col0; // 16-bit 565 interpolant endpoints
- QT3DSU16 col1;
- QT3DSU8 row[4]; // 4x4 * 2bpp color-index == 4 bytes.
- } DXTColBlock;
-
- typedef struct
- {
- QT3DSU16 row[4]; // 4x4 * 4bpp alpha == 8 bytes. (pure 4-bit alpha values)
- } DXT3AlphaBlock;
-
- typedef struct
- {
- QT3DSU8 alpha0; // 8-bit alpha interpolant endpoints
- QT3DSU8 alpha1;
- QT3DSU8 row[6]; // 4x4 * 3bpp alpha-index == 48bits == 6 bytes.
- } DXT5AlphaBlock;
-
- typedef struct
- {
- QT3DSU8 red;
- QT3DSU8 green;
- QT3DSU8 blue;
- QT3DSU8 alpha;
- } Color8888;
-
-//================================================================================
-// Various DDS file defines
-
-#define DDSD_CAPS 0x00000001l
-#define DDSD_HEIGHT 0x00000002l
-#define DDSD_WIDTH 0x00000004l
-#define DDSD_PIXELFORMAT 0x00001000l
-#define DDS_ALPHAPIXELS 0x00000001l
-#define DDS_FOURCC 0x00000004l
-#define DDS_PITCH 0x00000008l
-#define DDS_COMPLEX 0x00000008l
-#define DDS_RGB 0x00000040l
-#define DDS_TEXTURE 0x00001000l
-#define DDS_MIPMAPCOUNT 0x00020000l
-#define DDS_LINEARSIZE 0x00080000l
-#define DDS_VOLUME 0x00200000l
-#define DDS_MIPMAP 0x00400000l
-#define DDS_DEPTH 0x00800000l
-
-#define DDS_CUBEMAP 0x00000200L
-#define DDS_CUBEMAP_POSITIVEX 0x00000400L
-#define DDS_CUBEMAP_NEGATIVEX 0x00000800L
-#define DDS_CUBEMAP_POSITIVEY 0x00001000L
-#define DDS_CUBEMAP_NEGATIVEY 0x00002000L
-#define DDS_CUBEMAP_POSITIVEZ 0x00004000L
-#define DDS_CUBEMAP_NEGATIVEZ 0x00008000L
-
-#define FOURCC_DXT1 0x31545844 //(MAKEFOURCC('D','X','T','1'))
-#define FOURCC_DXT3 0x33545844 //(MAKEFOURCC('D','X','T','3'))
-#define FOURCC_DXT5 0x35545844 //(MAKEFOURCC('D','X','T','5'))
-
-#define DDS_MAGIC_FLIPPED 0x0F7166ED
-
- //================================================================================
- // DDS file format structures.
- typedef struct _DDS_PIXELFORMAT
- {
- QT3DSU32 dwSize;
- QT3DSU32 dwFlags;
- QT3DSU32 dwFourCC;
- QT3DSU32 dwRGBBitCount;
- QT3DSU32 dwRBitMask;
- QT3DSU32 dwGBitMask;
- QT3DSU32 dwBBitMask;
- QT3DSU32 dwABitMask;
- } DDS_PIXELFORMAT;
-
- typedef struct _DDS_HEADER
- {
- QT3DSU32 dwSize;
- QT3DSU32 dwFlags;
- QT3DSU32 dwHeight;
- QT3DSU32 dwWidth;
- QT3DSU32 dwPitchOrLinearSize;
- QT3DSU32 dwDepth;
- QT3DSU32 dwMipMapCount;
- QT3DSU32 dwReserved1[11];
- DDS_PIXELFORMAT ddspf;
- QT3DSU32 dwCaps1;
- QT3DSU32 dwCaps2;
- QT3DSU32 dwReserved2[3];
- } DDS_HEADER;
-
- //================================================================================
- // helper functions
- //================================================================================
-
- // helper macros.
- static inline void NvSwapChar(QT3DSU8 &a, QT3DSU8 &b)
- {
- QT3DSU8 tmp;
- tmp = a;
- a = b;
- b = tmp;
- }
-
- static inline void NvSwapShort(QT3DSU16 &a, QT3DSU16 &b)
- {
- QT3DSU16 tmp;
- tmp = a;
- a = b;
- b = tmp;
- }
-
- //================================================================================
- //================================================================================
- static void flip_blocks_dxtc1(DXTColBlock *line, QT3DSI32 numBlocks)
- {
- DXTColBlock *curblock = line;
- QT3DSI32 i;
-
- for (i = 0; i < numBlocks; i++) {
- NvSwapChar(curblock->row[0], curblock->row[3]);
- NvSwapChar(curblock->row[1], curblock->row[2]);
- curblock++;
- }
- }
-
- //================================================================================
- //================================================================================
- static void flip_blocks_dxtc3(DXTColBlock *line, QT3DSI32 numBlocks)
- {
- DXTColBlock *curblock = line;
- DXT3AlphaBlock *alphablock;
- QT3DSI32 i;
-
- for (i = 0; i < numBlocks; i++) {
- alphablock = (DXT3AlphaBlock *)curblock;
-
- NvSwapShort(alphablock->row[0], alphablock->row[3]);
- NvSwapShort(alphablock->row[1], alphablock->row[2]);
- curblock++;
-
- NvSwapChar(curblock->row[0], curblock->row[3]);
- NvSwapChar(curblock->row[1], curblock->row[2]);
- curblock++;
- }
- }
-
- static void flip_dxt5_alpha(DXT5AlphaBlock *block)
- {
- QT3DSI8 gBits[4][4];
-
- const QT3DSU32 mask = 0x00000007; // bits = 00 00 01 11
- QT3DSU32 bits = 0;
- memcpy(&bits, &block->row[0], sizeof(QT3DSI8) * 3);
-
- gBits[0][0] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[0][1] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[0][2] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[0][3] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[1][0] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[1][1] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[1][2] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[1][3] = (QT3DSI8)(bits & mask);
-
- bits = 0;
- memcpy(&bits, &block->row[3], sizeof(QT3DSI8) * 3);
-
- gBits[2][0] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[2][1] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[2][2] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[2][3] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[3][0] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[3][1] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[3][2] = (QT3DSI8)(bits & mask);
- bits >>= 3;
- gBits[3][3] = (QT3DSI8)(bits & mask);
-
- bits = (gBits[3][0] << 0) | (gBits[3][1] << 3) | (gBits[3][2] << 6) | (gBits[3][3] << 9)
- | (gBits[2][0] << 12) | (gBits[2][1] << 15) | (gBits[2][2] << 18) | (gBits[2][3] << 21);
- memcpy(&block->row[0], &bits, 3);
-
- bits = (gBits[1][0] << 0) | (gBits[1][1] << 3) | (gBits[1][2] << 6) | (gBits[1][3] << 9)
- | (gBits[0][0] << 12) | (gBits[0][1] << 15) | (gBits[0][2] << 18) | (gBits[0][3] << 21);
- memcpy(&block->row[3], &bits, 3);
- }
-
- static void flip_blocks_dxtc5(DXTColBlock *line, QT3DSI32 numBlocks)
- {
- DXTColBlock *curblock = line;
- DXT5AlphaBlock *alphablock;
- QT3DSI32 i;
-
- for (i = 0; i < numBlocks; i++) {
- alphablock = (DXT5AlphaBlock *)curblock;
-
- flip_dxt5_alpha(alphablock);
- curblock++;
-
- NvSwapChar(curblock->row[0], curblock->row[3]);
- NvSwapChar(curblock->row[1], curblock->row[2]);
- curblock++;
- }
- }
-
- static void flip_data_vertical(FreeImageIO *io, QT3DSI8 *image, QT3DSI32 width, QT3DSI32 height,
- Qt3DSDDSImage *info)
- {
- if (info->compressed) {
- QT3DSI32 linesize, j;
- DXTColBlock *top;
- DXTColBlock *bottom;
- QT3DSI8 *tmp;
- void (*flipblocks)(DXTColBlock *, QT3DSI32) = NULL;
- QT3DSI32 xblocks = width / 4;
- QT3DSI32 yblocks = height / 4;
- QT3DSI32 blocksize;
-
- switch (info->format) {
- case qt3ds::render::NVRenderTextureFormats::RGBA_DXT1:
- blocksize = 8;
- flipblocks = &flip_blocks_dxtc1;
- break;
- case qt3ds::render::NVRenderTextureFormats::RGBA_DXT3:
- blocksize = 16;
- flipblocks = &flip_blocks_dxtc3;
- break;
- case qt3ds::render::NVRenderTextureFormats::RGBA_DXT5:
- blocksize = 16;
- flipblocks = &flip_blocks_dxtc5;
- break;
- default:
- return;
- }
-
- linesize = xblocks * blocksize;
- tmp = (QT3DSI8 *)QT3DS_ALLOC(io->m_Allocator, linesize, "flip_data_vertical compressed");
-
- for (j = 0; j < (yblocks >> 1); j++) {
- top = (DXTColBlock *)(void *)(image + j * linesize);
- bottom = (DXTColBlock *)(void *)(image + (((yblocks - j) - 1) * linesize));
-
- (*flipblocks)(top, xblocks);
- (*flipblocks)(bottom, xblocks);
-
- memcpy(tmp, bottom, linesize);
- memcpy(bottom, top, linesize);
- memcpy(top, tmp, linesize);
- }
-
- // Catch the middle row of blocks if there is one
- // The loop above will skip the middle row
- if (yblocks & 0x01) {
- DXTColBlock *middle = (DXTColBlock *)(void *)(image + (yblocks >> 1) * linesize);
- (*flipblocks)(middle, xblocks);
- }
-
- QT3DS_FREE(io->m_Allocator, tmp);
- } else {
- QT3DSI32 linesize = width * info->bytesPerPixel;
- QT3DSI32 j;
- QT3DSI8 *top;
- QT3DSI8 *bottom;
- QT3DSI8 *tmp;
-
- // much simpler - just compute the line length and swap each row
- tmp = (QT3DSI8 *)QT3DS_ALLOC(io->m_Allocator, linesize, "flip_data_vertical");
- ;
-
- for (j = 0; j < (height >> 1); j++) {
- top = (QT3DSI8 *)(image + j * linesize);
- bottom = (QT3DSI8 *)(image + (((height - j) - 1) * linesize));
-
- memcpy(tmp, bottom, linesize);
- memcpy(bottom, top, linesize);
- memcpy(top, tmp, linesize);
- }
-
- QT3DS_FREE(io->m_Allocator, tmp);
- }
- }
-
- static QT3DSI32 size_image(QT3DSI32 width, QT3DSI32 height, const Qt3DSDDSImage *image)
- {
- if (image->compressed) {
- return ((width + 3) / 4) * ((height + 3) / 4)
- * (image->format == qt3ds::render::NVRenderTextureFormats::RGBA_DXT1 ? 8 : 16);
- } else {
- return width * height * image->bytesPerPixel;
- }
- }
-
- static QT3DSI32 total_image_data_size(Qt3DSDDSImage *image)
- {
- QT3DSI32 i, j, index = 0, size = 0, w, h;
- QT3DSI32 cubeCount = image->cubemap ? 6 : 1;
-
- for (j = 0; j < cubeCount; j++) {
- w = image->width;
- h = image->height;
-
- for (i = 0; i < image->numMipmaps; i++) // account for base plus each mip
- {
- image->size[index] = size_image(w, h, image);
- image->mipwidth[index] = w;
- image->mipheight[index] = h;
- size += image->size[index];
- if (w != 1) {
- w >>= 1;
- }
- if (h != 1) {
- h >>= 1;
- }
-
- index++;
- }
- }
-
- return (size);
- }
-
- void *Qt3DSDDSAllocDataBlock(FreeImageIO *io, Qt3DSDDSImage *image)
- {
- if (image) {
- QT3DSI32 i;
- QT3DSI32 size = total_image_data_size(image);
- image->dataBlock =
- QT3DS_ALLOC(io->m_Allocator, size,
- "Qt3DSDDSAllocDataBlock"); // no need to calloc, as we fill every bit...
- if (image->dataBlock == NULL) {
- return NULL;
- }
-
- image->data[0] = image->dataBlock;
-
- QT3DSI32 planes = image->numMipmaps * (image->cubemap ? 6 : 1);
-
- for (i = 1; i < planes; i++) // account for base plus each mip
- {
- image->data[i] =
- (void *)(((size_t)(image->data[i - 1])) + (size_t)image->size[i - 1]);
- }
-
- return (image->dataBlock); // in case caller wants to sanity check...
- }
- return (NULL);
- }
-
- static FIBITMAP *DoLoadDDS(FreeImageIO *io, IInStream &inStream, QT3DSI32 flipVertical)
- {
- FIBITMAP *dib = NULL;
- DDS_HEADER ddsh;
- QT3DSI8 filecode[4];
- Qt3DSDDSImage *image = NULL;
- bool needsBGRASwap = false;
- ;
- bool isAllreadyFlipped = false;
-
- try {
- // check file code
- inStream.Read(filecode, 4);
- if (memcmp(filecode, "DDS ", 4)) {
- throw "Invalid DDS file";
- }
-
- image = (Qt3DSDDSImage *)QT3DS_ALLOC(io->m_Allocator, sizeof(Qt3DSDDSImage), "DoLoadDDS");
- if (image == NULL) {
- throw "Qt3DSDDSImage allocation failed";
- }
- memset(image, 0, sizeof(Qt3DSDDSImage));
-
- // read in DDS header
- inStream.Read(&ddsh, 1);
-
- // check if image is a cubempap
- if (ddsh.dwCaps2 & DDS_CUBEMAP) {
- const QT3DSI32 allFaces = DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_POSITIVEY
- | DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEX | DDS_CUBEMAP_NEGATIVEY
- | DDS_CUBEMAP_NEGATIVEZ;
-
- if ((ddsh.dwCaps2 & allFaces) != allFaces) {
- throw "Not all cubemap faces defined - not supported";
- }
-
- image->cubemap = 1;
- } else {
- image->cubemap = 0;
- }
-
- // check if image is a volume texture
- if ((ddsh.dwCaps2 & DDS_VOLUME) && (ddsh.dwDepth > 0)) {
- throw "Volume textures not supported";
- }
-
- // allocated the memory for the structure we return
- dib = QT3DS_NEW(io->m_Allocator, SLoadedTexture)(io->m_Allocator);
- if (dib == NULL) {
- throw "DIB allocation failed";
- }
-
- // figure out what the image format is
- if (ddsh.ddspf.dwFlags & DDS_FOURCC) {
- switch (ddsh.ddspf.dwFourCC) {
- case FOURCC_DXT1:
- image->format = qt3ds::render::NVRenderTextureFormats::RGBA_DXT1;
- image->components = 3;
- image->compressed = 1;
- image->alpha = 0; // Ugh - for backwards compatibility
- dib->format = qt3ds::render::NVRenderTextureFormats::RGB_DXT1;
- break;
- case FOURCC_DXT3:
- image->format = qt3ds::render::NVRenderTextureFormats::RGBA_DXT3;
- image->components = 4;
- image->compressed = 1;
- image->alpha = 1;
- dib->format = qt3ds::render::NVRenderTextureFormats::RGBA_DXT3;
- break;
- case FOURCC_DXT5:
- image->format = qt3ds::render::NVRenderTextureFormats::RGBA_DXT5;
- image->components = 4;
- image->compressed = 1;
- image->alpha = 1;
- dib->format = qt3ds::render::NVRenderTextureFormats::RGBA_DXT5;
- break;
- default:
- throw "Unsupported FOURCC code";
- }
- } else {
- // Check for a supported pixel format
- if ((ddsh.ddspf.dwRGBBitCount == 32) && (ddsh.ddspf.dwRBitMask == 0x000000FF)
- && (ddsh.ddspf.dwGBitMask == 0x0000FF00)
- && (ddsh.ddspf.dwBBitMask == 0x00FF0000)
- && (ddsh.ddspf.dwABitMask == 0xFF000000)) {
- // We support D3D's A8B8G8R8, which is actually RGBA in linear
- // memory, equivalent to GL's RGBA
- image->format = qt3ds::render::NVRenderTextureFormats::RGBA8;
- image->components = 4;
- image->componentFormat = qt3ds::render::NVRenderComponentTypes::QT3DSU8;
- image->bytesPerPixel = 4;
- image->alpha = 1;
- image->compressed = 0;
- dib->format = qt3ds::render::NVRenderTextureFormats::RGBA8;
- } else if ((ddsh.ddspf.dwRGBBitCount == 32) && (ddsh.ddspf.dwRBitMask == 0x00FF0000)
- && (ddsh.ddspf.dwGBitMask == 0x0000FF00)
- && (ddsh.ddspf.dwBBitMask == 0x000000FF)
- && (ddsh.ddspf.dwABitMask == 0xFF000000)) {
- // We support D3D's A8R8G8B8, which is actually BGRA in linear
- // memory, need to be
- image->format = qt3ds::render::NVRenderTextureFormats::RGBA8;
- image->components = 4;
- image->componentFormat = qt3ds::render::NVRenderComponentTypes::QT3DSU8;
- image->bytesPerPixel = 4;
- image->alpha = 1;
- image->compressed = 0;
- needsBGRASwap = true;
- dib->format = qt3ds::render::NVRenderTextureFormats::RGBA8;
- } else if ((ddsh.ddspf.dwRGBBitCount == 16) && (ddsh.ddspf.dwRBitMask == 0x0000F800)
- && (ddsh.ddspf.dwGBitMask == 0x000007E0)
- && (ddsh.ddspf.dwBBitMask == 0x0000001F)
- && (ddsh.ddspf.dwABitMask == 0x00000000)) {
- // We support D3D's R5G6B5, which is actually RGB in linear
- // memory. It is equivalent to GL's GL_UNSIGNED_SHORT_5_6_5
- image->format = qt3ds::render::NVRenderTextureFormats::RGB8;
- image->components = 3;
- image->alpha = 0;
- image->componentFormat = qt3ds::render::NVRenderComponentTypes::QT3DSU16;
- image->bytesPerPixel = 2;
- image->compressed = 0;
- dib->format = qt3ds::render::NVRenderTextureFormats::RGB8;
- } else if ((ddsh.ddspf.dwRGBBitCount == 8) && (ddsh.ddspf.dwRBitMask == 0x00000000)
- && (ddsh.ddspf.dwGBitMask == 0x00000000)
- && (ddsh.ddspf.dwBBitMask == 0x00000000)
- && (ddsh.ddspf.dwABitMask == 0x000000FF)) {
- // We support D3D's A8
- image->format = qt3ds::render::NVRenderTextureFormats::Alpha8;
- image->components = 1;
- image->alpha = 1;
- image->componentFormat = qt3ds::render::NVRenderComponentTypes::QT3DSU8;
- image->bytesPerPixel = 1;
- image->compressed = 0;
- dib->format = qt3ds::render::NVRenderTextureFormats::Alpha8;
- } else if ((ddsh.ddspf.dwRGBBitCount == 8) && (ddsh.ddspf.dwRBitMask == 0x000000FF)
- && (ddsh.ddspf.dwGBitMask == 0x00000000)
- && (ddsh.ddspf.dwBBitMask == 0x00000000)
- && (ddsh.ddspf.dwABitMask == 0x00000000)) {
- // We support D3D's L8 (flagged as 8 bits of red only)
- image->format = qt3ds::render::NVRenderTextureFormats::Luminance8;
- image->components = 1;
- image->alpha = 0;
- image->componentFormat = qt3ds::render::NVRenderComponentTypes::QT3DSU8;
- image->bytesPerPixel = 1;
- image->compressed = 0;
- dib->format = qt3ds::render::NVRenderTextureFormats::Luminance8;
- } else if ((ddsh.ddspf.dwRGBBitCount == 16) && (ddsh.ddspf.dwRBitMask == 0x000000FF)
- && (ddsh.ddspf.dwGBitMask == 0x00000000)
- && (ddsh.ddspf.dwBBitMask == 0x00000000)
- && (ddsh.ddspf.dwABitMask == 0x0000FF00)) {
- // We support D3D's A8L8 (flagged as 8 bits of red and 8 bits of alpha)
- image->format = qt3ds::render::NVRenderTextureFormats::LuminanceAlpha8;
- image->components = 2;
- image->alpha = 1;
- image->componentFormat = qt3ds::render::NVRenderComponentTypes::QT3DSU8;
- image->bytesPerPixel = 2;
- image->compressed = 0;
- dib->format = qt3ds::render::NVRenderTextureFormats::LuminanceAlpha8;
- } else {
- throw "not a DXTC or supported RGB(A) format image";
- }
- }
-
- // detect flagging to indicate this texture was stored in a y-inverted fashion
- if (!(ddsh.dwFlags & DDS_LINEARSIZE)) {
- if (ddsh.dwPitchOrLinearSize == DDS_MAGIC_FLIPPED) {
- isAllreadyFlipped = true;
- }
- }
-
- flipVertical = (isAllreadyFlipped != (flipVertical ? true : false)) ? 1 : 0;
-
- // store primary surface width/height/numMipmaps
- image->width = ddsh.dwWidth;
- image->height = ddsh.dwHeight;
- image->numMipmaps = ddsh.dwFlags & DDS_MIPMAPCOUNT ? ddsh.dwMipMapCount : 1;
-
- if (image->numMipmaps > QT3DS_DDS_MAX_MIPMAPS) {
- throw "Too many mipmaps: max 16";
- }
-
- // allocate the meta datablock for all mip storage.
- Qt3DSDDSAllocDataBlock(io, image);
- if (image->dataBlock == NULL) {
- throw "Failed to allocate memory for image data storage";
- }
-
- dib->width = image->width;
- dib->height = image->height;
- dib->dds = image;
-
- QT3DSI32 faces = image->cubemap ? 6 : 1;
-
- QT3DSI32 index = 0;
- for (QT3DSI32 j = 0; j < faces; j++) {
- // load all surfaces for the image
- QT3DSI32 width = image->width;
- QT3DSI32 height = image->height;
-
- for (QT3DSI32 i = 0; i < image->numMipmaps; i++) {
- // Get the size, read in the data.
- inStream.Read(
- NVDataRef<QT3DSU8>((QT3DSU8 *)image->data[index], (QT3DSU32)image->size[index]));
-
- // Flip in Y for OpenGL if needed
- if (flipVertical)
- flip_data_vertical(io, (QT3DSI8 *)image->data[index], width, height, image);
-
- // shrink to next power of 2
- width >>= 1;
- height >>= 1;
-
- if (!width)
- width = 1;
-
- if (!height)
- height = 1;
-
- // make sure DXT isn't <4 on a side...
- if (image->compressed) {
- if (width < 4)
- width = 4;
- if (height < 4)
- height = 4;
- }
-
- index++;
- }
- }
-
- if (needsBGRASwap) {
- QT3DSI32 index = 0;
- QT3DSI32 k;
-
- for (k = 0; k < faces; k++) {
- QT3DSI32 width = image->width;
- QT3DSI32 height = image->height;
-
- for (QT3DSI32 i = 0; i < image->numMipmaps; i++) {
- QT3DSI8 *data = (QT3DSI8 *)(image->data[index]);
- QT3DSI32 pixels = width * height;
- QT3DSI32 j;
-
- for (j = 0; j < pixels; j++) {
- QT3DSI8 temp = data[0];
- data[0] = data[2];
- data[2] = temp;
-
- data += 4;
- }
-
- // shrink to next power of 2
- width >>= 1;
- height >>= 1;
-
- if (!width)
- width = 1;
-
- if (!height)
- height = 1;
-
- index++;
- }
- }
- }
- } catch (const char *message) {
- if (image) {
- if (image->dataBlock)
- QT3DS_FREE(io->m_Allocator, image->dataBlock);
-
- QT3DS_FREE(io->m_Allocator, image);
- }
- if (dib) {
- FreeImage_Unload(dib);
- }
- if (message) {
- FreeImage_OutputMessageProc(s_exception_string, message, io);
- }
- }
-
- return dib;
- }
-
- SLoadedTexture *SLoadedTexture::LoadDDS(IInStream &inStream, QT3DSI32 flipVertical,
- NVFoundationBase &inFnd,
- qt3ds::render::NVRenderContextType renderContextType)
- {
- Q_UNUSED(renderContextType)
- FreeImageIO theIO(inFnd.getAllocator(), inFnd);
- SLoadedTexture *retval = DoLoadDDS(&theIO, inStream, flipVertical);
-
- return retval;
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.h
deleted file mode 100644
index 8490b474..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureDDS.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#ifndef QT3DS_RENDER_LOAD_DDS_H
-#define QT3DS_RENDER_LOAD_DDS_H
-
-namespace qt3ds {
-namespace render {
-
-/** The maximum number of mipmap levels (per texture or per cubemap face) */
-#define QT3DS_DDS_MAX_MIPMAPS (16)
-
-/** The number of cubemap faces that must exist in a cubemap-bearing DDS file */
-#define QT3DS_DDS_NUM_CUBEMAP_FACES (6)
-
- /** The master DDS structure for loading and saving
-
- This is the master DDS structure. It shouldn't be allocated by hand,
- always use NVHHDDSAlloc/NVHHDDSAllocData/NVHHDDSFree to manage them properly.
- */
-
- struct Qt3DSDDSImage
- {
- /** Width of the overall texture in texels */
- int width;
- /** Height of the overall texture in texels */
- int height;
- /** Number of color/alpha components per texel 1-4 */
- int components;
- /** The GL type of each color component (noncompressed textures only) */
- int componentFormat;
- /** The number of bytes per pixel (noncompressed textures only) */
- int bytesPerPixel;
- /** Nonzero if the format is DXT-compressed */
- int compressed;
- /** The number of levels in the mipmap pyramid (including the base level) */
- int numMipmaps;
- /** If nonzero, then the file contains 6 cubemap faces */
- int cubemap;
- /** The format of the loaded texture data */
- int format;
- /** The GL internal format of the loaded texture data(compressed textures only) */
- int internalFormat;
- /** Nonzero if the texture data includes alpha */
- int alpha;
- /** Base of the allocated block of all texel data */
- void *dataBlock;
- /** Pointers to the mipmap levels for the texture or each cubemap face */
- void *data[QT3DS_DDS_MAX_MIPMAPS * QT3DS_DDS_NUM_CUBEMAP_FACES];
- /** Array of sizes of the mipmap levels for the texture or each cubemap face */
- int size[QT3DS_DDS_MAX_MIPMAPS * QT3DS_DDS_NUM_CUBEMAP_FACES];
- /** Array of widths of the mipmap levels for the texture or each cubemap face */
- int mipwidth[QT3DS_DDS_MAX_MIPMAPS * QT3DS_DDS_NUM_CUBEMAP_FACES];
- /** Array of heights of the mipmap levels for the texture or each cubemap face */
- int mipheight[QT3DS_DDS_MAX_MIPMAPS * QT3DS_DDS_NUM_CUBEMAP_FACES];
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureFreeImageCompat.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureFreeImageCompat.h
deleted file mode 100644
index 13f317bd..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureFreeImageCompat.h
+++ /dev/null
@@ -1,413 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_LOADED_TEXTURE_FREEIMAGE_COMPAT_H
-#define QT3DS_RENDER_LOADED_TEXTURE_FREEIMAGE_COMPAT_H
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSRenderLoadedTexture.h"
-#include "EASTL/algorithm.h"
-#include <stdlib.h>
-#ifndef _MACOSX
-#ifndef _INTEGRITYPLATFORM
-#include <malloc.h>
-#endif
-#endif
-
-// We use a compatibility layer so we can easily convert freeimage code to load our texture formats
-// where necessary.
-
-namespace qt3ds {
-namespace render {
- using namespace qt3ds::foundation;
-
- typedef int32_t BOOL;
- typedef uint8_t BYTE;
- typedef uint16_t WORD;
- typedef uint32_t DWORD;
- typedef int32_t LONG;
-
-#define FREEIMAGE_COLORORDER_BGR 0
-#define FREEIMAGE_COLORORDER_RGB 1
-
-#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR
-
- typedef ISeekableIOStream *fi_handle;
-
- struct FreeImageIO
- {
- NVAllocatorCallback &m_Allocator;
- NVFoundationBase &m_Foundation;
- int (*read_proc)(void *data, int size, int itemSize, fi_handle handle);
- void (*seek_proc)(fi_handle handle, int offset, int pos);
- int (*tell_proc)(fi_handle handle);
- static inline int reader(void *data, int size, int itemSize, fi_handle handle)
- {
- NVDataRef<QT3DSU8> theData(toDataRef((QT3DSU8 *)data, (QT3DSU32)size * itemSize));
- QT3DSU32 amount = handle->Read(theData);
- return (int)amount;
- }
- static inline void seeker(fi_handle handle, int offset, int pos)
- {
- SeekPosition::Enum seekPos(SeekPosition::Begin);
- /*
-#define SEEK_CUR 1
-#define SEEK_END 2
-#define SEEK_SET 0*/
- switch (pos) {
- case 0:
- seekPos = SeekPosition::Begin;
- break;
- case 1:
- seekPos = SeekPosition::Current;
- break;
- case 2:
- seekPos = SeekPosition::End;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- handle->SetPosition(offset, seekPos);
- }
- static inline int teller(fi_handle handle) { return (int)handle->GetPosition(); }
- FreeImageIO(NVAllocatorCallback &alloc, NVFoundationBase &fnd)
- : m_Allocator(alloc)
- , m_Foundation(fnd)
- , read_proc(reader)
- , seek_proc(seeker)
- , tell_proc(teller)
- {
- }
- };
-
- typedef SLoadedTexture FIBITMAP;
- inline BYTE *FreeImage_GetBits(FIBITMAP *bmp) { return (BYTE *)bmp->data; }
-
- inline int FreeImage_GetHeight(FIBITMAP *bmp) { return bmp->height; }
- inline int FreeImage_GetWidth(FIBITMAP *bmp) { return bmp->width; }
-
-#define INPLACESWAP(x, y) eastl::swap(x, y)
-#define MIN(x, y) NVMin(x, y)
-#define MAX(x, y) NVMax(x, y)
-
-#define TRUE 1
-#define FALSE 0
-
- typedef struct tagBITMAPINFOHEADER
- {
- DWORD biSize;
- LONG biWidth;
- LONG biHeight;
- WORD biPlanes;
- WORD biBitCount;
- DWORD biCompression;
- DWORD biSizeImage;
- LONG biXPelsPerMeter;
- LONG biYPelsPerMeter;
- DWORD biClrUsed;
- DWORD biClrImportant;
- } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
-
- typedef struct tagRGBQUAD
- {
-#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
- BYTE rgbBlue;
- BYTE rgbGreen;
- BYTE rgbRed;
-#else
- BYTE rgbRed;
- BYTE rgbGreen;
- BYTE rgbBlue;
-#endif // FREEIMAGE_COLORORDER
- BYTE rgbReserved;
- } RGBQUAD;
-
- typedef struct tagRGBTRIPLE
- {
-#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
- BYTE rgbtBlue;
- BYTE rgbtGreen;
- BYTE rgbtRed;
-#else
- BYTE rgbtRed;
- BYTE rgbtGreen;
- BYTE rgbtBlue;
-#endif // FREEIMAGE_COLORORDER
- } RGBTRIPLE;
-
- typedef struct tagBITMAPINFO
- {
- BITMAPINFOHEADER bmiHeader;
- RGBQUAD bmiColors[1];
- } BITMAPINFO, *PBITMAPINFO;
-
- typedef struct tagFILE_RGBA
- {
- unsigned char r, g, b, a;
- } FILE_RGBA;
-
- typedef struct tagFILE_BGRA
- {
- unsigned char b, g, r, a;
- } FILE_BGRA;
-
- typedef struct tagFILE_RGB
- {
- unsigned char r, g, b;
- } FILE_RGB;
-
- typedef struct tagFILE_BGR
- {
- unsigned char b, g, r;
- } FILE_BGR;
-
-// Indexes for byte arrays, masks and shifts for treating pixels as words ---
-// These coincide with the order of RGBQUAD and RGBTRIPLE -------------------
-
-#ifndef FREEIMAGE_BIGENDIAN
-#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
-// Little Endian (x86 / MS Windows, Linux) : BGR(A) order
-#define FI_RGBA_RED 2
-#define FI_RGBA_GREEN 1
-#define FI_RGBA_BLUE 0
-#define FI_RGBA_ALPHA 3
-#define FI_RGBA_RED_MASK 0x00FF0000
-#define FI_RGBA_GREEN_MASK 0x0000FF00
-#define FI_RGBA_BLUE_MASK 0x000000FF
-#define FI_RGBA_ALPHA_MASK 0xFF000000
-#define FI_RGBA_RED_SHIFT 16
-#define FI_RGBA_GREEN_SHIFT 8
-#define FI_RGBA_BLUE_SHIFT 0
-#define FI_RGBA_ALPHA_SHIFT 24
-#else
-// Little Endian (x86 / MaxOSX) : RGB(A) order
-#define FI_RGBA_RED 0
-#define FI_RGBA_GREEN 1
-#define FI_RGBA_BLUE 2
-#define FI_RGBA_ALPHA 3
-#define FI_RGBA_RED_MASK 0x000000FF
-#define FI_RGBA_GREEN_MASK 0x0000FF00
-#define FI_RGBA_BLUE_MASK 0x00FF0000
-#define FI_RGBA_ALPHA_MASK 0xFF000000
-#define FI_RGBA_RED_SHIFT 0
-#define FI_RGBA_GREEN_SHIFT 8
-#define FI_RGBA_BLUE_SHIFT 16
-#define FI_RGBA_ALPHA_SHIFT 24
-#endif // FREEIMAGE_COLORORDER
-#else
-#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
-// Big Endian (PPC / none) : BGR(A) order
-#define FI_RGBA_RED 2
-#define FI_RGBA_GREEN 1
-#define FI_RGBA_BLUE 0
-#define FI_RGBA_ALPHA 3
-#define FI_RGBA_RED_MASK 0x0000FF00
-#define FI_RGBA_GREEN_MASK 0x00FF0000
-#define FI_RGBA_BLUE_MASK 0xFF000000
-#define FI_RGBA_ALPHA_MASK 0x000000FF
-#define FI_RGBA_RED_SHIFT 8
-#define FI_RGBA_GREEN_SHIFT 16
-#define FI_RGBA_BLUE_SHIFT 24
-#define FI_RGBA_ALPHA_SHIFT 0
-#else
-// Big Endian (PPC / Linux, MaxOSX) : RGB(A) order
-#define FI_RGBA_RED 0
-#define FI_RGBA_GREEN 1
-#define FI_RGBA_BLUE 2
-#define FI_RGBA_ALPHA 3
-#define FI_RGBA_RED_MASK 0xFF000000
-#define FI_RGBA_GREEN_MASK 0x00FF0000
-#define FI_RGBA_BLUE_MASK 0x0000FF00
-#define FI_RGBA_ALPHA_MASK 0x000000FF
-#define FI_RGBA_RED_SHIFT 24
-#define FI_RGBA_GREEN_SHIFT 16
-#define FI_RGBA_BLUE_SHIFT 8
-#define FI_RGBA_ALPHA_SHIFT 0
-#endif // FREEIMAGE_COLORORDER
-#endif // FREEIMAGE_BIGENDIAN
-
-#define FI_RGBA_RGB_MASK (FI_RGBA_RED_MASK | FI_RGBA_GREEN_MASK | FI_RGBA_BLUE_MASK)
-
-// The 16bit macros only include masks and shifts, since each color element is not byte aligned
-
-#define FI16_555_RED_MASK 0x7C00
-#define FI16_555_GREEN_MASK 0x03E0
-#define FI16_555_BLUE_MASK 0x001F
-#define FI16_555_RED_SHIFT 10
-#define FI16_555_GREEN_SHIFT 5
-#define FI16_555_BLUE_SHIFT 0
-#define FI16_565_RED_MASK 0xF800
-#define FI16_565_GREEN_MASK 0x07E0
-#define FI16_565_BLUE_MASK 0x001F
-#define FI16_565_RED_SHIFT 11
-#define FI16_565_GREEN_SHIFT 5
-#define FI16_565_BLUE_SHIFT 0
-
- inline unsigned char HINIBBLE(unsigned char byte) { return byte & 0xF0; }
-
- inline unsigned char LOWNIBBLE(unsigned char byte) { return byte & 0x0F; }
-
- inline int CalculateUsedBits(int bits)
- {
- int bit_count = 0;
- unsigned bit = 1;
-
- for (unsigned i = 0; i < 32; i++) {
- if ((bits & bit) == bit) {
- bit_count++;
- }
-
- bit <<= 1;
- }
-
- return bit_count;
- }
-
- inline int CalculateLine(int width, int bitdepth) { return ((width * bitdepth) + 7) / 8; }
-
- inline int CalculatePitch(int line) { return (line + 3) & ~3; }
-
- inline int CalculateUsedPaletteEntries(int bit_count)
- {
- if ((bit_count >= 1) && (bit_count <= 8))
- return 1 << bit_count;
-
- return 0;
- }
-
- inline unsigned char *CalculateScanLine(unsigned char *bits, unsigned pitch, int scanline)
- {
- return (bits + (pitch * scanline));
- }
-
- inline void ReplaceExtension(char *result, const char *filename, const char *extension)
- {
- for (size_t i = strlen(filename) - 1; i > 0; --i) {
- if (filename[i] == '.') {
- memcpy(result, filename, i);
- result[i] = '.';
- memcpy(result + i + 1, extension, strlen(extension) + 1);
- return;
- }
- }
-
- memcpy(result, filename, strlen(filename));
- result[strlen(filename)] = '.';
- memcpy(result + strlen(filename) + 1, extension, strlen(extension) + 1);
- }
-
- inline BYTE *FreeImage_GetScanLine(FIBITMAP *bmp, int height)
- {
- return CalculateScanLine(
- (BYTE *)bmp->data, CalculatePitch(CalculateLine(bmp->width, bmp->m_BitCount)), height);
- }
-
-#define DLL_CALLCONV
-
-// ignored for now.
-#define FreeImage_SetDotsPerMeterX(img, dots)
-#define FreeImage_SetDotsPerMeterY(img, dots)
-
- inline SLoadedTexture *FreeImage_Allocate(int width, int height, int bit_count, FreeImageIO *io)
- {
- SLoadedTexture *theTexture = QT3DS_NEW(io->m_Allocator, SLoadedTexture)(io->m_Allocator);
- int pitch = CalculatePitch(CalculateLine(width, bit_count));
- QT3DSU32 dataSize = (QT3DSU32)(height * pitch);
- theTexture->dataSizeInBytes = dataSize;
- theTexture->data = io->m_Allocator.allocate(dataSize, "image data", __FILE__, __LINE__);
- memZero(theTexture->data, dataSize);
- theTexture->width = width;
- theTexture->height = height;
- theTexture->m_BitCount = bit_count;
- // If free image asks us for a palette, we change our format at that time.
- theTexture->m_ExtendedFormat = ExtendedTextureFormats::CustomRGB;
- return theTexture;
- }
-
- inline SLoadedTexture *FreeImage_Allocate(int width, int height, int bit_count, int rmask,
- int gmask, int bmask, FreeImageIO *io)
- {
- SLoadedTexture *retval = FreeImage_Allocate(width, height, bit_count, io);
- retval->m_CustomMasks[0] = rmask;
- retval->m_CustomMasks[1] = gmask;
- retval->m_CustomMasks[2] = bmask;
- return retval;
- }
-
- inline RGBQUAD *FreeImage_GetPalette(SLoadedTexture *texture)
- {
- if (texture->m_Palette == NULL) {
- texture->m_ExtendedFormat = ExtendedTextureFormats::Palettized;
- QT3DSU32 memory = 256 * sizeof(RGBQUAD);
- if (memory) {
- texture->m_Palette =
- texture->m_Allocator.allocate(memory, "texture palette", __FILE__, __LINE__);
- memZero(texture->m_Palette, memory);
- }
- }
- return (RGBQUAD *)texture->m_Palette;
- }
-
- inline void FreeImage_Unload(SLoadedTexture *texture) { texture->release(); }
- inline void FreeImage_OutputMessageProc(int, const char *message, FreeImageIO *io)
- {
- Q_UNUSED(io);
- qCCritical(INVALID_OPERATION, "Error loading image: %s", message);
- }
-
- inline void FreeImage_SetBackgroundColor(SLoadedTexture *texture, RGBQUAD *inColor)
- {
- if (inColor) {
- texture->m_BackgroundColor[0] = inColor->rgbRed;
- texture->m_BackgroundColor[1] = inColor->rgbGreen;
- texture->m_BackgroundColor[2] = inColor->rgbBlue;
- } else
- memSet(texture->m_BackgroundColor, 0, 3);
- }
-
- inline void FreeImage_SetTransparencyTable(SLoadedTexture *texture, BYTE *table, int size)
- {
- if (texture->m_TransparencyTable)
- texture->m_Allocator.deallocate(texture->m_TransparencyTable);
- texture->m_TransparencyTable = NULL;
- if (table && size) {
- texture->m_TransparencyTable = (uint8_t *)texture->m_Allocator.allocate(
- size, "texture transparency table", __FILE__, __LINE__);
- memCopy(texture->m_TransparencyTable, table, size);
- }
- }
-}
-}
-
-using namespace qt3ds::render;
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureGIF.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureGIF.cpp
deleted file mode 100644
index ece4d3a3..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureGIF.cpp
+++ /dev/null
@@ -1,851 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// ==========================================================
-// GIF Loader and Writer
-//
-// Design and implementation by
-// - Ryan Rubley <ryan@lostreality.org>
-// - Raphael Gaquer <raphael.gaquer@alcer.com>
-//
-// This file is part of FreeImage 3
-//
-// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
-// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
-// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
-// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
-// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
-// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
-// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
-// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
-// THIS DISCLAIMER.
-//
-// Use at your own risk!
-// ==========================================================
-#ifdef _MSC_VER
-#pragma warning(disable : 4786) // identifier was truncated to 'number' characters
-#endif
-
-#include "Qt3DSRenderLoadedTextureFreeImageCompat.h"
-#include "EASTL/vector.h"
-#include "EASTL/string.h"
-// ==========================================================
-// Metadata declarations
-// ==========================================================
-
-#define GIF_DISPOSAL_UNSPECIFIED 0
-#define GIF_DISPOSAL_LEAVE 1
-#define GIF_DISPOSAL_BACKGROUND 2
-#define GIF_DISPOSAL_PREVIOUS 3
-
-// ==========================================================
-// Constant/Typedef declarations
-// ==========================================================
-
-struct GIFinfo
-{
- BOOL read;
- // only really used when reading
- size_t global_color_table_offset;
- int global_color_table_size;
- BYTE background_color;
- eastl::vector<size_t> application_extension_offsets;
- eastl::vector<size_t> comment_extension_offsets;
- eastl::vector<size_t> graphic_control_extension_offsets;
- eastl::vector<size_t> image_descriptor_offsets;
-
- GIFinfo()
- : read(0)
- , global_color_table_offset(0)
- , global_color_table_size(0)
- , background_color(0)
- {
- }
-};
-
-struct PageInfo
-{
- PageInfo(int d, int l, int t, int w, int h)
- {
- disposal_method = d;
- left = (WORD)l;
- top = (WORD)t;
- width = (WORD)w;
- height = (WORD)h;
- }
- int disposal_method;
- WORD left, top, width, height;
-};
-
-// GIF defines a max of 12 bits per code
-#define MAX_LZW_CODE 4096
-
-class StringTable
-{
-public:
- StringTable();
- ~StringTable();
- void Initialize(int minCodeSize);
- BYTE *FillInputBuffer(int len);
- void CompressStart(int bpp, int width);
- int CompressEnd(BYTE *buf); // 0-4 bytes
- bool Compress(BYTE *buf, int *len);
- bool Decompress(BYTE *buf, int *len);
- void Done(void);
-
-protected:
- bool m_done;
-
- int m_minCodeSize, m_clearCode, m_endCode, m_nextCode;
-
- int m_bpp, m_slack; // Compressor information
-
- int m_prefix; // Compressor state variable
- int m_codeSize, m_codeMask; // Compressor/Decompressor state variables
- int m_oldCode; // Decompressor state variable
- int m_partial, m_partialSize; // Compressor/Decompressor bit buffer
-
- int firstPixelPassed; // A specific flag that indicates if the first pixel
- // of the whole image had already been read
-
- eastl::string m_strings[MAX_LZW_CODE]; // This is what is really the "string table" data for the
- // Decompressor
- int *m_strmap;
-
- // input buffer
- BYTE *m_buffer;
- int m_bufferSize, m_bufferRealSize, m_bufferPos, m_bufferShift;
-
- void ClearCompressorTable(void);
- void ClearDecompressorTable(void);
-};
-
-#define GIF_PACKED_LSD_HAVEGCT 0x80
-#define GIF_PACKED_LSD_COLORRES 0x70
-#define GIF_PACKED_LSD_GCTSORTED 0x08
-#define GIF_PACKED_LSD_GCTSIZE 0x07
-#define GIF_PACKED_ID_HAVELCT 0x80
-#define GIF_PACKED_ID_INTERLACED 0x40
-#define GIF_PACKED_ID_LCTSORTED 0x20
-#define GIF_PACKED_ID_RESERVED 0x18
-#define GIF_PACKED_ID_LCTSIZE 0x07
-#define GIF_PACKED_GCE_RESERVED 0xE0
-#define GIF_PACKED_GCE_DISPOSAL 0x1C
-#define GIF_PACKED_GCE_WAITINPUT 0x02
-#define GIF_PACKED_GCE_HAVETRANS 0x01
-
-#define GIF_BLOCK_IMAGE_DESCRIPTOR 0x2C
-#define GIF_BLOCK_EXTENSION 0x21
-#define GIF_BLOCK_TRAILER 0x3B
-
-#define GIF_EXT_PLAINTEXT 0x01
-#define GIF_EXT_GRAPHIC_CONTROL 0xF9
-#define GIF_EXT_COMMENT 0xFE
-#define GIF_EXT_APPLICATION 0xFF
-
-#define GIF_INTERLACE_PASSES 4
-static int g_GifInterlaceOffset[GIF_INTERLACE_PASSES] = { 0, 4, 2, 1 };
-static int g_GifInterlaceIncrement[GIF_INTERLACE_PASSES] = { 8, 8, 4, 2 };
-
-StringTable::StringTable()
-{
- m_buffer = NULL;
- firstPixelPassed = 0; // Still no pixel read
- // Maximum number of entries in the map is MAX_LZW_CODE * 256
- // (aka 2**12 * 2**8 => a 20 bits key)
- // This Map could be optmized to only handle MAX_LZW_CODE * 2**(m_bpp)
- m_strmap = (int *)new int[1 << 20];
-}
-
-StringTable::~StringTable()
-{
- if (m_buffer != NULL) {
- delete[] m_buffer;
- }
- if (m_strmap != NULL) {
- delete[] m_strmap;
- m_strmap = NULL;
- }
-}
-
-void StringTable::Initialize(int minCodeSize)
-{
- m_done = false;
-
- m_bpp = 8;
- m_minCodeSize = minCodeSize;
- m_clearCode = 1 << m_minCodeSize;
- if (m_clearCode > MAX_LZW_CODE) {
- m_clearCode = MAX_LZW_CODE;
- }
- m_endCode = m_clearCode + 1;
-
- m_partial = 0;
- m_partialSize = 0;
-
- m_bufferSize = 0;
- ClearCompressorTable();
- ClearDecompressorTable();
-}
-
-BYTE *StringTable::FillInputBuffer(int len)
-{
- if (m_buffer == NULL) {
- m_buffer = new BYTE[len];
- m_bufferRealSize = len;
- } else if (len > m_bufferRealSize) {
- delete[] m_buffer;
- m_buffer = new BYTE[len];
- m_bufferRealSize = len;
- }
- m_bufferSize = len;
- m_bufferPos = 0;
- m_bufferShift = 8 - m_bpp;
- return m_buffer;
-}
-
-void StringTable::CompressStart(int bpp, int width)
-{
- m_bpp = bpp;
- m_slack = (8 - ((width * bpp) % 8)) % 8;
-
- m_partial |= m_clearCode << m_partialSize;
- m_partialSize += m_codeSize;
- ClearCompressorTable();
-}
-
-int StringTable::CompressEnd(BYTE *buf)
-{
- int len = 0;
-
- // output code for remaining prefix
- m_partial |= m_prefix << m_partialSize;
- m_partialSize += m_codeSize;
- while (m_partialSize >= 8) {
- *buf++ = (BYTE)m_partial;
- m_partial >>= 8;
- m_partialSize -= 8;
- len++;
- }
-
- // add the end of information code and flush the entire buffer out
- m_partial |= m_endCode << m_partialSize;
- m_partialSize += m_codeSize;
- while (m_partialSize > 0) {
- *buf++ = (BYTE)m_partial;
- m_partial >>= 8;
- m_partialSize -= 8;
- len++;
- }
-
- // most this can be is 4 bytes. 7 bits in m_partial to start + 12 for the
- // last code + 12 for the end code = 31 bits total.
- return len;
-}
-
-bool StringTable::Compress(BYTE *buf, int *len)
-{
- if (m_bufferSize == 0 || m_done) {
- return false;
- }
-
- int mask = (1 << m_bpp) - 1;
- BYTE *bufpos = buf;
- while (m_bufferPos < m_bufferSize) {
- // get the current pixel value
- char ch = (char)((m_buffer[m_bufferPos] >> m_bufferShift) & mask);
-
- // The next prefix is :
- // <the previous LZW code (on 12 bits << 8)> | <the code of the current pixel (on 8 bits)>
- int nextprefix = (((m_prefix) << 8) & 0xFFF00) + (ch & 0x000FF);
- if (firstPixelPassed) {
-
- if (m_strmap[nextprefix] > 0) {
- m_prefix = m_strmap[nextprefix];
- } else {
- m_partial |= m_prefix << m_partialSize;
- m_partialSize += m_codeSize;
- // grab full bytes for the output buffer
- while (m_partialSize >= 8 && bufpos - buf < *len) {
- *bufpos++ = (BYTE)m_partial;
- m_partial >>= 8;
- m_partialSize -= 8;
- }
-
- // add the code to the "table map"
- m_strmap[nextprefix] = m_nextCode;
-
- // increment the next highest valid code, increase the code size
- if (m_nextCode == (1 << m_codeSize)) {
- m_codeSize++;
- }
- m_nextCode++;
-
- // if we're out of codes, restart the string table
- if (m_nextCode == MAX_LZW_CODE) {
- m_partial |= m_clearCode << m_partialSize;
- m_partialSize += m_codeSize;
- ClearCompressorTable();
- }
-
- // Only keep the 8 lowest bits (prevent problems with "negative chars")
- m_prefix = ch & 0x000FF;
- }
-
- // increment to the next pixel
- if (m_bufferShift > 0
- && !(m_bufferPos + 1 == m_bufferSize && m_bufferShift <= m_slack)) {
- m_bufferShift -= m_bpp;
- } else {
- m_bufferPos++;
- m_bufferShift = 8 - m_bpp;
- }
-
- // jump out here if the output buffer is full
- if (bufpos - buf == *len) {
- return true;
- }
-
- } else {
- // Specific behavior for the first pixel of the whole image
-
- firstPixelPassed = 1;
- // Only keep the 8 lowest bits (prevent problems with "negative chars")
- m_prefix = ch & 0x000FF;
-
- // increment to the next pixel
- if (m_bufferShift > 0
- && !(m_bufferPos + 1 == m_bufferSize && m_bufferShift <= m_slack)) {
- m_bufferShift -= m_bpp;
- } else {
- m_bufferPos++;
- m_bufferShift = 8 - m_bpp;
- }
-
- // jump out here if the output buffer is full
- if (bufpos - buf == *len) {
- return true;
- }
- }
- }
-
- m_bufferSize = 0;
- *len = (int)(bufpos - buf);
-
- return true;
-}
-
-bool StringTable::Decompress(BYTE *buf, int *len)
-{
- if (m_bufferSize == 0 || m_done) {
- return false;
- }
-
- BYTE *bufpos = buf;
- for (; m_bufferPos < m_bufferSize; m_bufferPos++) {
- m_partial |= (int)m_buffer[m_bufferPos] << m_partialSize;
- m_partialSize += 8;
- while (m_partialSize >= m_codeSize) {
- int code = m_partial & m_codeMask;
- m_partial >>= m_codeSize;
- m_partialSize -= m_codeSize;
-
- if (code > m_nextCode || (m_nextCode == MAX_LZW_CODE && code != m_clearCode)
- || code == m_endCode) {
- m_done = true;
- *len = (int)(bufpos - buf);
- return true;
- }
- if (code == m_clearCode) {
- ClearDecompressorTable();
- continue;
- }
-
- // add new string to string table, if not the first pass since a clear code
- if (m_oldCode != MAX_LZW_CODE) {
- m_strings[m_nextCode] =
- m_strings[m_oldCode] + m_strings[code == m_nextCode ? m_oldCode : code][0];
- }
-
- if ((int)m_strings[code].size() > *len - (bufpos - buf)) {
- // out of space, stuff the code back in for next time
- m_partial <<= m_codeSize;
- m_partialSize += m_codeSize;
- m_partial |= code;
- m_bufferPos++;
- *len = (int)(bufpos - buf);
- return true;
- }
-
- // output the string into the buffer
- memcpy(bufpos, m_strings[code].data(), m_strings[code].size());
- bufpos += m_strings[code].size();
-
- // increment the next highest valid code, add a bit to the mask if we need to increase
- // the code size
- if (m_oldCode != MAX_LZW_CODE && m_nextCode < MAX_LZW_CODE) {
- if (++m_nextCode < MAX_LZW_CODE) {
- if ((m_nextCode & m_codeMask) == 0) {
- m_codeSize++;
- m_codeMask |= m_nextCode;
- }
- }
- }
-
- m_oldCode = code;
- }
- }
-
- m_bufferSize = 0;
- *len = (int)(bufpos - buf);
-
- return true;
-}
-
-void StringTable::Done(void)
-{
- m_done = true;
-}
-
-void StringTable::ClearCompressorTable(void)
-{
- if (m_strmap) {
- memset(m_strmap, 0xFF, sizeof(unsigned int) * (1 << 20));
- }
- m_nextCode = m_endCode + 1;
-
- m_prefix = 0;
- m_codeSize = m_minCodeSize + 1;
-}
-
-void StringTable::ClearDecompressorTable(void)
-{
- for (int i = 0; i < m_clearCode; i++) {
- m_strings[i].resize(1);
- m_strings[i][0] = (char)i;
- }
- m_nextCode = m_endCode + 1;
-
- m_codeSize = m_minCodeSize + 1;
- m_codeMask = (1 << m_codeSize) - 1;
- m_oldCode = MAX_LZW_CODE;
-}
-
-// ==========================================================
-// Plugin Interface
-// ==========================================================
-
-static int s_format_id;
-
-// ==========================================================
-// Plugin Implementation
-// ==========================================================
-
-static BOOL DLL_CALLCONV Validate(FreeImageIO *io, fi_handle handle)
-{
- char buf[6];
- if (io->read_proc(buf, 6, 1, handle) < 1) {
- return FALSE;
- }
-
- BOOL bResult = FALSE;
- if (!strncmp(buf, "GIF", 3)) {
- if (buf[3] >= '0' && buf[3] <= '9' && buf[4] >= '0' && buf[4] <= '9' && buf[5] >= 'a'
- && buf[5] <= 'z') {
- bResult = TRUE;
- }
- }
-
- io->seek_proc(handle, -6, SEEK_CUR);
-
- return bResult;
-}
-
-// ----------------------------------------------------------
-
-static void *DLL_CALLCONV Open(FreeImageIO *io, fi_handle handle)
-{
- GIFinfo *info = new GIFinfo;
- if (info == NULL) {
- return NULL;
- }
- BOOL read = TRUE;
-
- // 25/02/2008 MDA: Not safe to memset GIFinfo structure with VS 2008 (safe iterators),
- // perform initialization in constructor instead.
- // memset(info, 0, sizeof(GIFinfo));
-
- info->read = read;
- try {
- // Header
- if (!Validate(io, handle)) {
- throw "Not a GIF file";
- }
- io->seek_proc(handle, 6, SEEK_CUR);
-
- // Logical Screen Descriptor
- io->seek_proc(handle, 4, SEEK_CUR);
- BYTE packed;
- if (io->read_proc(&packed, 1, 1, handle) < 1) {
- throw "EOF reading Logical Screen Descriptor";
- }
- if (io->read_proc(&info->background_color, 1, 1, handle) < 1) {
- throw "EOF reading Logical Screen Descriptor";
- }
- io->seek_proc(handle, 1, SEEK_CUR);
-
- // Global Color Table
- if (packed & GIF_PACKED_LSD_HAVEGCT) {
- info->global_color_table_offset = io->tell_proc(handle);
- info->global_color_table_size = 2 << (packed & GIF_PACKED_LSD_GCTSIZE);
- io->seek_proc(handle, 3 * info->global_color_table_size, SEEK_CUR);
- }
-
- // Scan through all the rest of the blocks, saving offsets
- size_t gce_offset = 0;
- BYTE block = 0;
- while (block != GIF_BLOCK_TRAILER) {
- if (io->read_proc(&block, 1, 1, handle) < 1) {
- throw "EOF reading blocks";
- }
- if (block == GIF_BLOCK_IMAGE_DESCRIPTOR) {
- info->image_descriptor_offsets.push_back(io->tell_proc(handle));
- // GCE may be 0, meaning no GCE preceded this ID
- info->graphic_control_extension_offsets.push_back(gce_offset);
- gce_offset = 0;
-
- io->seek_proc(handle, 8, SEEK_CUR);
- if (io->read_proc(&packed, 1, 1, handle) < 1) {
- throw "EOF reading Image Descriptor";
- }
-
- // Local Color Table
- if (packed & GIF_PACKED_ID_HAVELCT) {
- io->seek_proc(handle, 3 * (2 << (packed & GIF_PACKED_ID_LCTSIZE)), SEEK_CUR);
- }
-
- // LZW Minimum Code Size
- io->seek_proc(handle, 1, SEEK_CUR);
- } else if (block == GIF_BLOCK_EXTENSION) {
- BYTE ext;
- if (io->read_proc(&ext, 1, 1, handle) < 1) {
- throw "EOF reading extension";
- }
-
- if (ext == GIF_EXT_GRAPHIC_CONTROL) {
- // overwrite previous offset if more than one GCE found before an ID
- gce_offset = io->tell_proc(handle);
- } else if (ext == GIF_EXT_COMMENT) {
- info->comment_extension_offsets.push_back(io->tell_proc(handle));
- } else if (ext == GIF_EXT_APPLICATION) {
- info->application_extension_offsets.push_back(io->tell_proc(handle));
- }
- } else if (block == GIF_BLOCK_TRAILER) {
- continue;
- } else {
- throw "Invalid GIF block found";
- }
-
- // Data Sub-blocks
- BYTE len;
- if (io->read_proc(&len, 1, 1, handle) < 1) {
- throw "EOF reading sub-block";
- }
- while (len != 0) {
- io->seek_proc(handle, len, SEEK_CUR);
- if (io->read_proc(&len, 1, 1, handle) < 1) {
- throw "EOF reading sub-block";
- }
- }
- }
- } catch (const char *msg) {
- FreeImage_OutputMessageProc(s_format_id, msg, io);
- delete info;
- return NULL;
- }
-
- return info;
-}
-
-static FIBITMAP *DLL_CALLCONV DoLoadGIF(FreeImageIO *io, fi_handle handle, int flags, void *data)
-{
- if (data == NULL) {
- return NULL;
- }
- (void)flags;
- GIFinfo *info = (GIFinfo *)data;
-
- int page = 0;
- FIBITMAP *dib = NULL;
- try {
- bool have_transparent = false, no_local_palette = false, interlaced = false;
- int disposal_method = GIF_DISPOSAL_LEAVE, transparent_color = 0;
- WORD left, top, width, height;
- BYTE packed, b;
- WORD w;
-
- // Image Descriptor
- io->seek_proc(handle, (long)info->image_descriptor_offsets[page], SEEK_SET);
- io->read_proc(&left, 2, 1, handle);
- io->read_proc(&top, 2, 1, handle);
- io->read_proc(&width, 2, 1, handle);
- io->read_proc(&height, 2, 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapShort(&left);
- SwapShort(&top);
- SwapShort(&width);
- SwapShort(&height);
-#endif
- io->read_proc(&packed, 1, 1, handle);
- interlaced = (packed & GIF_PACKED_ID_INTERLACED) ? true : false;
- no_local_palette = (packed & GIF_PACKED_ID_HAVELCT) ? false : true;
-
- int bpp = 8;
- if (!no_local_palette) {
- int size = 2 << (packed & GIF_PACKED_ID_LCTSIZE);
- if (size <= 2)
- bpp = 1;
- else if (size <= 16)
- bpp = 4;
- } else if (info->global_color_table_offset != 0) {
- if (info->global_color_table_size <= 2)
- bpp = 1;
- else if (info->global_color_table_size <= 16)
- bpp = 4;
- }
- dib = FreeImage_Allocate(width, height, bpp, io);
- if (dib == NULL) {
- throw "DIB allocated failed";
- }
-
- // Palette
- RGBQUAD *pal = FreeImage_GetPalette(dib);
- if (!no_local_palette) {
- int size = 2 << (packed & GIF_PACKED_ID_LCTSIZE);
-
- int i = 0;
- while (i < size) {
- io->read_proc(&pal[i].rgbRed, 1, 1, handle);
- io->read_proc(&pal[i].rgbGreen, 1, 1, handle);
- io->read_proc(&pal[i].rgbBlue, 1, 1, handle);
- i++;
- }
- } else if (info->global_color_table_offset != 0) {
- long pos = io->tell_proc(handle);
- io->seek_proc(handle, (long)info->global_color_table_offset, SEEK_SET);
-
- int i = 0;
- while (i < info->global_color_table_size) {
- io->read_proc(&pal[i].rgbRed, 1, 1, handle);
- io->read_proc(&pal[i].rgbGreen, 1, 1, handle);
- io->read_proc(&pal[i].rgbBlue, 1, 1, handle);
- i++;
- }
-
- io->seek_proc(handle, pos, SEEK_SET);
- } else {
- // its legal to have no palette, but we're going to generate *something*
- for (int i = 0; i < 256; i++) {
- pal[i].rgbRed = (BYTE)i;
- pal[i].rgbGreen = (BYTE)i;
- pal[i].rgbBlue = (BYTE)i;
- }
- }
-
- // LZW Minimum Code Size
- io->read_proc(&b, 1, 1, handle);
- StringTable *stringtable = new StringTable;
- stringtable->Initialize(b);
-
- // Image Data Sub-blocks
- int x = 0, xpos = 0, y = 0, shift = 8 - bpp, mask = (1 << bpp) - 1, interlacepass = 0;
- BYTE *scanline = FreeImage_GetScanLine(dib, height - 1);
- BYTE buf[4096];
- io->read_proc(&b, 1, 1, handle);
- while (b) {
- io->read_proc(stringtable->FillInputBuffer(b), b, 1, handle);
- int size = sizeof(buf);
- while (stringtable->Decompress(buf, &size)) {
- for (int i = 0; i < size; i++) {
- scanline[xpos] |= (buf[i] & mask) << shift;
- if (shift > 0) {
- shift -= bpp;
- } else {
- xpos++;
- shift = 8 - bpp;
- }
- if (++x >= width) {
- if (interlaced) {
- y += g_GifInterlaceIncrement[interlacepass];
- if (y >= height && ++interlacepass < GIF_INTERLACE_PASSES) {
- y = g_GifInterlaceOffset[interlacepass];
- }
- } else {
- y++;
- }
- if (y >= height) {
- stringtable->Done();
- break;
- }
- x = xpos = 0;
- shift = 8 - bpp;
- scanline = FreeImage_GetScanLine(dib, height - y - 1);
- }
- }
- size = sizeof(buf);
- }
- io->read_proc(&b, 1, 1, handle);
- }
-
- if (page == 0) {
- QT3DSU32 idx;
-
- // Logical Screen Descriptor
- io->seek_proc(handle, 6, SEEK_SET);
- WORD logicalwidth, logicalheight;
- io->read_proc(&logicalwidth, 2, 1, handle);
- io->read_proc(&logicalheight, 2, 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapShort(&logicalwidth);
- SwapShort(&logicalheight);
-#endif
-
- // Global Color Table
- if (info->global_color_table_offset != 0) {
- RGBQUAD globalpalette[256];
- io->seek_proc(handle, (long)info->global_color_table_offset, SEEK_SET);
- int i = 0;
- while (i < info->global_color_table_size) {
- io->read_proc(&globalpalette[i].rgbRed, 1, 1, handle);
- io->read_proc(&globalpalette[i].rgbGreen, 1, 1, handle);
- io->read_proc(&globalpalette[i].rgbBlue, 1, 1, handle);
- globalpalette[i].rgbReserved = 0;
- i++;
- }
- // background color
- if (info->background_color < info->global_color_table_size) {
- FreeImage_SetBackgroundColor(dib, &globalpalette[info->background_color]);
- }
- }
-
- // Application Extension
- LONG loop = 1; // If no AE with a loop count is found, the default must be 1
- for (idx = 0; idx < info->application_extension_offsets.size(); idx++) {
- io->seek_proc(handle, (long)info->application_extension_offsets[idx], SEEK_SET);
- io->read_proc(&b, 1, 1, handle);
- if (b == 11) { // All AEs start with an 11 byte sub-block to determine what type of
- // AE it is
- char buf[11];
- io->read_proc(buf, 11, 1, handle);
- if (!memcmp(buf, "NETSCAPE2.0", 11)
- || !memcmp(buf, "ANIMEXTS1.0",
- 11)) { // Not everybody recognizes ANIMEXTS1.0 but it is valid
- io->read_proc(&b, 1, 1, handle);
- if (b == 3) { // we're supposed to have a 3 byte sub-block now
- io->read_proc(&b, 1, 1,
- handle); // this should be 0x01 but isn't really important
- io->read_proc(&w, 2, 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapShort(&w);
-#endif
- loop = w;
- if (loop > 0)
- loop++;
- break;
- }
- }
- }
- }
- }
-
- // Graphic Control Extension
- if (info->graphic_control_extension_offsets[page] != 0) {
- io->seek_proc(handle, (long)(info->graphic_control_extension_offsets[page] + 1),
- SEEK_SET);
- io->read_proc(&packed, 1, 1, handle);
- io->read_proc(&w, 2, 1, handle);
-#ifdef FREEIMAGE_BIGENDIAN
- SwapShort(&w);
-#endif
- io->read_proc(&b, 1, 1, handle);
- have_transparent = (packed & GIF_PACKED_GCE_HAVETRANS) ? true : false;
- disposal_method = (packed & GIF_PACKED_GCE_DISPOSAL) >> 2;
-
- transparent_color = b;
- if (have_transparent) {
- int size = 1 << bpp;
- if (transparent_color <= size) {
- BYTE table[256];
- memset(table, 0xFF, size);
- table[transparent_color] = 0;
- FreeImage_SetTransparencyTable(dib, table, size);
- dib->m_TransparentPaletteIndex = b;
- }
- }
- }
- b = (BYTE)disposal_method;
-
- delete stringtable;
-
- } catch (const char *msg) {
- if (dib != NULL) {
- FreeImage_Unload(dib);
- }
- FreeImage_OutputMessageProc(s_format_id, msg, io);
- return NULL;
- }
-
- return dib;
-}
-
-static void DLL_CALLCONV Close(void *data)
-{
- if (data == NULL) {
- return;
- }
- GIFinfo *info = (GIFinfo *)data;
- delete info;
-}
-
-SLoadedTexture *SLoadedTexture::LoadGIF(ISeekableIOStream &inStream, bool inFlipY,
- NVFoundationBase &inFnd,
- qt3ds::render::NVRenderContextType renderContextType)
-{
- Q_UNUSED(renderContextType)
- FreeImageIO theIO(inFnd.getAllocator(), inFnd);
- void *gifData = Open(&theIO, &inStream);
- if (gifData) {
- SLoadedTexture *retval = DoLoadGIF(&theIO, &inStream, 0, gifData);
- Close(gifData);
- if (retval)
- retval->FreeImagePostProcess(inFlipY);
- return retval;
- }
- return NULL;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureHDR.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureHDR.cpp
deleted file mode 100644
index defff295..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureHDR.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// ==========================================================
-// Radiance RGBE .HDR Loader
-// Decodes Radiance RGBE HDR image into FP16 texture buffer.
-//
-// Implementation by
-// Parashar Krishnamachari (parashark@nvidia.com)
-//
-// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
-// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
-// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
-// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
-// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
-// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
-// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
-// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
-// THIS DISCLAIMER.
-//
-// Use at your own risk!
-// ==========================================================
-
-#include "Qt3DSRenderLoadedTextureFreeImageCompat.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-typedef unsigned char RGBE[4];
-#define R 0
-#define G 1
-#define B 2
-#define E 3
-
-#define MINELEN 8 // minimum scanline length for encoding
-#define MAXELEN 0x7fff // maximum scanline length for encoding
-
-static int s_format_id;
-
-static float convertComponent(int exponent, int val)
-{
- float v = val / (256.0f);
- float d = powf(2.0f, (float)exponent - 128.0f);
- return v * d;
-}
-
-static void decrunchScanlineOld(FreeImageIO *io, fi_handle handle, RGBE *scanline, int width)
-{
- int i;
- int rshift = 0;
-
- while (width > 0) {
- io->read_proc(scanline, 4, 1, handle);
-
- // The older version of RLE encodes the length in the exponent.
- // and marks a run with 1, 1, 1 in RGB. This is differentiated from
- // a raw value of 1, 1, 1, by having a exponent of 0;
- if (scanline[0][R] == 1 && scanline[0][G] == 1 && scanline[0][B] == 1) {
- for (i = (scanline[0][E] << rshift); i > 0; --i) {
- memcpy(&scanline[0][0], &scanline[-1][0], 4);
- ++scanline;
- --width;
- }
- rshift += 8;
- } else {
- ++scanline;
- --width;
- rshift = 0;
- }
- }
-}
-
-static void decrunchScanline(FreeImageIO *io, fi_handle handle, RGBE *scanline, int width)
-{
- if ((width < MINELEN) || (width > MAXELEN)) {
- decrunchScanlineOld(io, handle, scanline, width);
- return;
- }
-
- char c;
- io->read_proc(&c, 1, 1, handle);
- if (c != 2) {
- io->seek_proc(handle, -1, SEEK_CUR);
- decrunchScanlineOld(io, handle, scanline, width);
- return;
- }
-
- io->read_proc(&(scanline[0][G]), 1, 1, handle);
- io->read_proc(&(scanline[0][B]), 1, 1, handle);
- io->read_proc(&c, 1, 1, handle);
-
- if (scanline[0][G] != 2 || scanline[0][B] & 128) {
- scanline[0][R] = 2;
- scanline[0][E] = c;
- decrunchScanlineOld(io, handle, scanline + 1, width - 1);
- }
-
- // RLE-encoded version does a separate buffer for each channel per scanline
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < width;) {
- unsigned char code, val;
- io->read_proc(&code, 1, 1, handle);
- if (code
- > 128) // RLE-encoded run... read 1 value and copy it forward for some n count.
- {
- code &= 127;
- io->read_proc(&val, 1, 1, handle);
- while (code--)
- scanline[j++][i] = val;
- } else // Not a run, so we read it as raw data
- {
- // Note -- we store each pixel in memory 4 bytes apart, so we can't just
- // do one long read.
- while (code--)
- io->read_proc(&(scanline[j++][i]), 1, 1, handle);
- }
- }
- }
-}
-
-static void decodeScanlineToTexture(RGBE *scanline, int width, void *outBuf, QT3DSU32 offset,
- NVRenderTextureFormats::Enum inFormat)
-{
- float rgbaF32[4];
-
- for (int i = 0; i < width; ++i) {
- rgbaF32[R] = convertComponent(scanline[i][E], scanline[i][R]);
- rgbaF32[G] = convertComponent(scanline[i][E], scanline[i][G]);
- rgbaF32[B] = convertComponent(scanline[i][E], scanline[i][B]);
- rgbaF32[3] = 1.0f;
-
- QT3DSU8 *target = reinterpret_cast<QT3DSU8 *>(outBuf);
- target += offset;
- NVRenderTextureFormats::encodeToPixel(
- rgbaF32, target, i * NVRenderTextureFormats::getSizeofFormat(inFormat), inFormat);
- }
-}
-
-static FIBITMAP *DoLoadHDR(FreeImageIO *io, fi_handle handle,
- NVRenderTextureFormats::Enum inFormat = NVRenderTextureFormats::RGB32F)
-{
- FIBITMAP *dib = NULL;
- try {
- if (handle != NULL) {
- char str[200];
- int i;
-
- // Make sure it's a Radiance RGBE file
- io->read_proc(str, 10, 1, handle);
- if (memcmp(str, "#?RADIANCE", 10)) {
- throw "Invalid HDR file";
- }
-
- io->seek_proc(handle, 1, SEEK_CUR);
-
- // Get the command string (it's not really important for us; We're always assuming
- // 32bit_rle_rgbe is the format
- // we're just reading it to skip ahead the correct number of bytes).
- i = 0;
- char c = 0, prevC;
- do {
- prevC = c;
- io->read_proc(&c, 1, 1, handle);
- str[i++] = c;
- } while (!(c == 0xa && prevC == 0xa));
-
- // Get the resolution string (it will be NULL-terminated for us)
- char res[200];
- i = 0;
- do {
- io->read_proc(&c, 1, 1, handle);
- res[i++] = c;
- } while (c != 0xa);
- res[i] = 0;
-
- int width, height;
- if (!sscanf(res, "-Y %d +X %d", &height, &width)) {
- throw "Error encountered while loading HDR stream : could not determine image "
- "resolution!";
- }
- int bytesPerPixel = NVRenderTextureFormats::getSizeofFormat(inFormat);
- dib = FreeImage_Allocate(width, height, bytesPerPixel * 8, io);
- if (dib == NULL) {
- throw "DIB allocation failed";
- }
-
- dib->format = inFormat;
- dib->components = NVRenderTextureFormats::getNumberOfComponent(inFormat);
-
- // Allocate a scanline worth of RGBE data
- RGBE *scanline = new RGBE[width];
- if (!scanline) {
- throw "Error encountered while loading HDR stream : could not buffer scanlines!";
- }
-
- // Go through all the scanlines
- for (int y = 0; y < height; ++y) {
- QT3DSU32 byteOfs = (height - 1 - y) * width * bytesPerPixel;
- decrunchScanline(io, handle, scanline, width);
- decodeScanlineToTexture(scanline, width, dib->data, byteOfs, inFormat);
- }
- }
- return dib;
- } catch (const char *message) {
- if (dib) {
- FreeImage_Unload(dib);
- }
- if (message) {
- FreeImage_OutputMessageProc(s_format_id, message, io);
- }
- }
-
- return NULL;
-}
-
-SLoadedTexture *SLoadedTexture::LoadHDR(ISeekableIOStream &inStream, NVFoundationBase &inFnd,
- qt3ds::render::NVRenderContextType renderContextType)
-{
- FreeImageIO theIO(inFnd.getAllocator(), inFnd);
- SLoadedTexture *retval = nullptr;
- if (renderContextType == qt3ds::render::NVRenderContextValues::GLES2)
- retval = DoLoadHDR(&theIO, &inStream, NVRenderTextureFormats::RGBA8);
- else
- retval = DoLoadHDR(&theIO, &inStream, NVRenderTextureFormats::RGBA16F);
-
-
- // Let's just assume we don't support this just yet.
- // if ( retval )
- // retval->FreeImagePostProcess( inFlipY );
- return retval;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.cpp
deleted file mode 100644
index b1d4b050..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/IOStreams.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-#include "Qt3DSRenderLoadedTexture.h"
-#include "Qt3DSRenderLoadedTextureKTX.h"
-#include "Qt3DSRenderLoadedTextureDDS.h"
-
-#include <qendian.h>
-#include <qopengltexture.h>
-
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-
-namespace qt3ds {
-namespace render {
-
-static inline int blockSizeForTextureFormat(int format)
-{
- switch (format) {
- case QOpenGLTexture::RGB8_ETC1:
- case QOpenGLTexture::RGB8_ETC2:
- case QOpenGLTexture::SRGB8_ETC2:
- case QOpenGLTexture::RGB8_PunchThrough_Alpha1_ETC2:
- case QOpenGLTexture::SRGB8_PunchThrough_Alpha1_ETC2:
- case QOpenGLTexture::R11_EAC_UNorm:
- case QOpenGLTexture::R11_EAC_SNorm:
- case QOpenGLTexture::RGB_DXT1:
- return 8;
-
- default:
- return 16;
- }
-}
-
-static inline int runtimeFormat(quint32 internalFormat)
-{
- switch (internalFormat) {
- case QOpenGLTexture::RGB8_ETC1:
- return NVRenderTextureFormats::RGB8_ETC1;
- case QOpenGLTexture::RGB8_ETC2:
- return NVRenderTextureFormats::RGB8_ETC2;
- case QOpenGLTexture::SRGB8_ETC2:
- return NVRenderTextureFormats::SRGB8_ETC2;
- case QOpenGLTexture::RGB8_PunchThrough_Alpha1_ETC2:
- return NVRenderTextureFormats::RGB8_PunchThrough_Alpha1_ETC2;
- case QOpenGLTexture::SRGB8_PunchThrough_Alpha1_ETC2:
- return NVRenderTextureFormats::SRGB8_PunchThrough_Alpha1_ETC2;
- case QOpenGLTexture::R11_EAC_UNorm:
- return NVRenderTextureFormats::R11_EAC_UNorm;
- case QOpenGLTexture::R11_EAC_SNorm:
- return NVRenderTextureFormats::R11_EAC_SNorm;
- case QOpenGLTexture::RGB_DXT1:
- return NVRenderTextureFormats::RGB_DXT1;
- case QOpenGLTexture::RGBA_DXT1:
- return NVRenderTextureFormats::RGBA_DXT3;
- case QOpenGLTexture::RGBA_DXT3:
- return NVRenderTextureFormats::RGBA_DXT3;
- case QOpenGLTexture::RGBA_DXT5:
- return NVRenderTextureFormats::RGBA_DXT5;
- default:
- break;
- }
- return NVRenderTextureFormats::Unknown;
-}
-
-static inline int imageSize(QT3DSI32 width, QT3DSI32 height, const Qt3DSDDSImage *image)
-{
- return ((width + 3) / 4) * ((height + 3) / 4)
- * blockSizeForTextureFormat(image->internalFormat);
-}
-
-static inline quint32 totalImageDataSize(Qt3DSDDSImage *image)
-{
- int i, j;
- int index = 0;
- quint32 size = 0;
- int w, h;
- int cubeCount = image->cubemap ? 6 : 1;
-
- for (j = 0; j < cubeCount; j++) {
- w = image->width;
- h = image->height;
-
- for (i = 0; i < image->numMipmaps; i++) // account for base plus each mip
- {
- size += 4; // image size is saved in the file
- image->size[index] = imageSize(w, h, image);
- image->mipwidth[index] = w;
- image->mipheight[index] = h;
- size += quint32(image->size[index]);
- if (w != 1)
- w >>= 1;
- if (h != 1)
- h >>= 1;
-
- index++;
- }
- }
-
- return (size);
-}
-
-static inline quint32 alignedOffset(quint32 offset, quint32 byteAlign)
-{
- return (offset + byteAlign - 1) & ~(byteAlign - 1);
-}
-
-inline SLoadedTexture *loadKtx(NVAllocatorCallback &allocator, IInStream &inStream,
- QT3DSI32 flipVertical)
-{
- static const int KTX_IDENTIFIER_LENGTH = 12;
- static const char ktxIdentifier[KTX_IDENTIFIER_LENGTH] = {
- '\xAB', 'K', 'T', 'X', ' ', '1', '1', '\xBB', '\r', '\n', '\x1A', '\n'
- };
- static const quint32 platformEndianIdentifier = 0x04030201;
- static const quint32 inversePlatformEndianIdentifier = 0x01020304;
-
- struct KTXHeader {
- quint8 identifier[KTX_IDENTIFIER_LENGTH];
- quint32 endianness;
- quint32 glType;
- quint32 glTypeSize;
- quint32 glFormat;
- quint32 glInternalFormat;
- quint32 glBaseInternalFormat;
- quint32 pixelWidth;
- quint32 pixelHeight;
- quint32 pixelDepth;
- quint32 numberOfArrayElements;
- quint32 numberOfFaces;
- quint32 numberOfMipmapLevels;
- quint32 bytesOfKeyValueData;
- };
-
- KTXHeader header;
- if (inStream.Read(header) != sizeof(header)
- || qstrncmp(reinterpret_cast<char *>(header.identifier),
- ktxIdentifier, KTX_IDENTIFIER_LENGTH) != 0
- || (header.endianness != platformEndianIdentifier
- && header.endianness != inversePlatformEndianIdentifier)) {
- return nullptr;
- }
-
- const bool isInverseEndian = (header.endianness == inversePlatformEndianIdentifier);
- auto decode = [isInverseEndian](quint32 val) {
- return isInverseEndian ? qbswap<quint32>(val) : val;
- };
-
- const bool isCompressed = decode(header.glType) == 0 && decode(header.glFormat) == 0
- && decode(header.glTypeSize) == 1;
- if (!isCompressed) {
- qWarning("Uncompressed ktx texture data is not supported");
- return nullptr;
- }
-
- if (decode(header.numberOfArrayElements) != 0) {
- qWarning("Array ktx textures not supported");
- return nullptr;
- }
-
- if (decode(header.pixelDepth) != 0) {
- qWarning("Only 2D and cube ktx textures are supported");
- return nullptr;
- }
-
- const int bytesToSkip = int(decode(header.bytesOfKeyValueData));
- QVector<uint8_t> skipData;
- skipData.resize(bytesToSkip);
- if (inStream.Read(NVDataRef<uint8_t>(skipData.data(), bytesToSkip)) != bytesToSkip) {
- qWarning("Unexpected end of ktx data");
- return nullptr;
- }
-
- // now for each mipmap level we have (arrays and 3d textures not supported here)
- // uint32 imageSize
- // for each array element
- // for each face
- // for each z slice
- // compressed data
- // padding so that each face data starts at an offset that is a multiple of 4
- // padding so that each imageSize starts at an offset that is a multiple of 4
-
- Qt3DSDDSImage *image = (Qt3DSDDSImage *)QT3DS_ALLOC(allocator, sizeof(Qt3DSDDSImage), "DoLoadDDS");
-
- const quint32 level0Width = decode(header.pixelWidth);
- const quint32 level0Height = decode(header.pixelHeight);
- quint32 faceCount = decode(header.numberOfFaces);
- const quint32 mipMapLevels = decode(header.numberOfMipmapLevels);
- const quint32 format = decode(header.glInternalFormat);
- image->numMipmaps = int(mipMapLevels);
- image->cubemap = faceCount == 6 ? 6 : 0;
- image->internalFormat = int(format);
- image->format = runtimeFormat(format);
- image->width = int(level0Width);
- image->height = int(level0Height);
- image->compressed = 1;
- quint32 totalSize = totalImageDataSize(image);
- image->dataBlock = QT3DS_ALLOC(allocator, totalSize, "Qt3DSDDSAllocDataBlock");
- if (inStream.Read(NVDataRef<uint8_t>(reinterpret_cast<uint8_t*>(image->dataBlock), totalSize))
- != totalSize) {
- QT3DS_FREE(allocator, image);
- return nullptr;
- }
-
- SLoadedTexture *result = QT3DS_NEW(allocator, SLoadedTexture)(allocator);
- result->dds = image;
- result->width = int(level0Width);
- result->height = int(level0Height);
- result->format = static_cast<NVRenderTextureFormats::Enum>(image->format);
-
- // TODO: Proper support for cubemaps should be implemented at some point.
- if (faceCount > 1) {
- qWarning("Multiple faces (cubemaps) not currently supported in ktx");
- faceCount = 1;
- }
-
- uint8_t *p = reinterpret_cast<uint8_t *>(image->dataBlock);
- uint8_t *basep = p;
-
- for (quint32 mip = 0; mip < mipMapLevels; ++mip) {
- if (p + 4 - basep > totalSize)
- break;
- const quint32 imageSize = *reinterpret_cast<const quint32 *>(p);
- p += 4;
- for (quint32 face = 0; face < faceCount; ++face) {
- const quint32 nextOffset = quint32(p + imageSize - basep);
- if (nextOffset > totalSize)
- break;
- image->data[mip] = reinterpret_cast<void *>(p);
- p = basep + alignedOffset(nextOffset, 4);
- }
- }
-
- return result;
-}
-
-SLoadedTexture *SLoadedTexture::LoadKTX(IInStream &inStream, QT3DSI32 flipVertical,
- NVFoundationBase &inFnd,
- qt3ds::render::NVRenderContextType renderContextType)
-{
- Q_UNUSED(renderContextType)
- SLoadedTexture *retval = loadKtx(inFnd.getAllocator(), inStream, flipVertical);
-
- return retval;
-}
-
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.h
deleted file mode 100644
index 3a2d7628..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTextureKTX.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_RENDER_LOAD_KTX_H
-#define QT3DS_RENDER_LOAD_KTX_H
-
-namespace qt3ds {
-namespace render {
-
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.cpp
deleted file mode 100644
index 023964f5..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.cpp
+++ /dev/null
@@ -1,599 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSRenderPrefilterTexture.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderShaderProgram.h"
-
-#include <string>
-
-using namespace qt3ds;
-using namespace qt3ds::render;
-using namespace qt3ds::foundation;
-
-Qt3DSRenderPrefilterTexture::Qt3DSRenderPrefilterTexture(NVRenderContext *inNVRenderContext,
- QT3DSI32 inWidth, QT3DSI32 inHeight,
- NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat,
- NVFoundationBase &inFnd)
- : m_Foundation(inFnd)
- , mRefCount(0)
- , m_Texture2D(inTexture2D)
- , m_DestinationFormat(inDestFormat)
- , m_Width(inWidth)
- , m_Height(inHeight)
- , m_NVRenderContext(inNVRenderContext)
-{
- // Calculate mip level
- int maxDim = inWidth >= inHeight ? inWidth : inHeight;
-
- m_MaxMipMapLevel = static_cast<int>(logf((float)maxDim) / logf(2.0f));
- // no concept of sizeOfFormat just does'nt make sense
- m_SizeOfFormat = NVRenderTextureFormats::getSizeofFormat(m_DestinationFormat);
- m_NoOfComponent = NVRenderTextureFormats::getNumberOfComponent(m_DestinationFormat);
-}
-
-Qt3DSRenderPrefilterTexture *
-Qt3DSRenderPrefilterTexture::Create(NVRenderContext *inNVRenderContext, QT3DSI32 inWidth, QT3DSI32 inHeight,
- NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd)
-{
- Qt3DSRenderPrefilterTexture *theBSDFMipMap = NULL;
-
- if (inNVRenderContext->IsComputeSupported()) {
- theBSDFMipMap = QT3DS_NEW(inFnd.getAllocator(), Qt3DSRenderPrefilterTextureCompute)(
- inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd);
- }
-
- if (!theBSDFMipMap) {
- theBSDFMipMap = QT3DS_NEW(inFnd.getAllocator(), Qt3DSRenderPrefilterTextureCPU)(
- inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat, inFnd);
- }
-
- if (theBSDFMipMap)
- theBSDFMipMap->addRef();
-
- return theBSDFMipMap;
-}
-
-Qt3DSRenderPrefilterTexture::~Qt3DSRenderPrefilterTexture()
-{
-}
-
-//------------------------------------------------------------------------------------
-// CPU based filtering
-//------------------------------------------------------------------------------------
-
-Qt3DSRenderPrefilterTextureCPU::Qt3DSRenderPrefilterTextureCPU(
- NVRenderContext *inNVRenderContext, int inWidth, int inHeight, NVRenderTexture2D &inTexture2D,
- NVRenderTextureFormats::Enum inDestFormat, NVFoundationBase &inFnd)
- : Qt3DSRenderPrefilterTexture(inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat,
- inFnd)
-{
-}
-
-inline int Qt3DSRenderPrefilterTextureCPU::wrapMod(int a, int base)
-{
- return (a >= 0) ? a % base : (a % base) + base;
-}
-
-inline void Qt3DSRenderPrefilterTextureCPU::getWrappedCoords(int &sX, int &sY, int width, int height)
-{
- if (sY < 0) {
- sX -= width >> 1;
- sY = -sY;
- }
- if (sY >= height) {
- sX += width >> 1;
- sY = height - sY;
- }
- sX = wrapMod(sX, width);
-}
-
-STextureData
-Qt3DSRenderPrefilterTextureCPU::CreateBsdfMipLevel(STextureData &inCurMipLevel,
- STextureData &inPrevMipLevel, int width,
- int height) //, IPerfTimer& inPerfTimer )
-{
- STextureData retval;
- int newWidth = width >> 1;
- int newHeight = height >> 1;
- newWidth = newWidth >= 1 ? newWidth : 1;
- newHeight = newHeight >= 1 ? newHeight : 1;
-
- if (inCurMipLevel.data) {
- retval = inCurMipLevel;
- retval.dataSizeInBytes =
- newWidth * newHeight * NVRenderTextureFormats::getSizeofFormat(inPrevMipLevel.format);
- } else {
- retval.dataSizeInBytes =
- newWidth * newHeight * NVRenderTextureFormats::getSizeofFormat(inPrevMipLevel.format);
- retval.format = inPrevMipLevel.format; // inLoadedImage.format;
- retval.data = m_Foundation.getAllocator().allocate(
- retval.dataSizeInBytes, "Bsdf Scaled Image Data", __FILE__, __LINE__);
- }
-
- for (int y = 0; y < newHeight; ++y) {
- for (int x = 0; x < newWidth; ++x) {
- float accumVal[4];
- accumVal[0] = 0;
- accumVal[1] = 0;
- accumVal[2] = 0;
- accumVal[3] = 0;
- for (int sy = -2; sy <= 2; ++sy) {
- for (int sx = -2; sx <= 2; ++sx) {
- int sampleX = sx + (x << 1);
- int sampleY = sy + (y << 1);
- getWrappedCoords(sampleX, sampleY, width, height);
-
- // Cauchy filter (this is simply because it's the easiest to evaluate, and
- // requires no complex
- // functions).
- float filterPdf = 1.f / (1.f + float(sx * sx + sy * sy) * 2.f);
- // With FP HDR formats, we're not worried about intensity loss so much as
- // unnecessary energy gain,
- // whereas with LDR formats, the fear with a continuous normalization factor is
- // that we'd lose
- // intensity and saturation as well.
- filterPdf /= (NVRenderTextureFormats::getSizeofFormat(retval.format) >= 8)
- ? 4.71238898f
- : 4.5403446f;
- // filterPdf /= 4.5403446f; // Discrete normalization factor
- // filterPdf /= 4.71238898f; // Continuous normalization factor
- float curPix[4];
- QT3DSI32 byteOffset = (sampleY * width + sampleX)
- * NVRenderTextureFormats::getSizeofFormat(retval.format);
- if (byteOffset < 0) {
- sampleY = height + sampleY;
- byteOffset = (sampleY * width + sampleX)
- * NVRenderTextureFormats::getSizeofFormat(retval.format);
- }
-
- NVRenderTextureFormats::decodeToFloat(inPrevMipLevel.data, byteOffset, curPix,
- retval.format);
-
- accumVal[0] += filterPdf * curPix[0];
- accumVal[1] += filterPdf * curPix[1];
- accumVal[2] += filterPdf * curPix[2];
- accumVal[3] += filterPdf * curPix[3];
- }
- }
-
- QT3DSU32 newIdx =
- (y * newWidth + x) * NVRenderTextureFormats::getSizeofFormat(retval.format);
-
- NVRenderTextureFormats::encodeToPixel(accumVal, retval.data, newIdx, retval.format);
- }
- }
-
- return retval;
-}
-
-void Qt3DSRenderPrefilterTextureCPU::Build(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat)
-{
-
- m_InternalFormat = inFormat;
- m_SizeOfInternalFormat = NVRenderTextureFormats::getSizeofFormat(m_InternalFormat);
- m_InternalNoOfComponent = NVRenderTextureFormats::getNumberOfComponent(m_InternalFormat);
-
- m_Texture2D.SetTextureData(NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize), 0,
- m_Width, m_Height, inFormat, m_DestinationFormat);
-
- STextureData theMipImage;
- STextureData prevImage;
- prevImage.data = inTextureData;
- prevImage.dataSizeInBytes = inTextureDataSize;
- prevImage.format = inFormat;
- int curWidth = m_Width;
- int curHeight = m_Height;
- int size = NVRenderTextureFormats::getSizeofFormat(m_InternalFormat);
- for (int idx = 1; idx <= m_MaxMipMapLevel; ++idx) {
- theMipImage =
- CreateBsdfMipLevel(theMipImage, prevImage, curWidth, curHeight); //, m_PerfTimer );
- curWidth = curWidth >> 1;
- curHeight = curHeight >> 1;
- curWidth = curWidth >= 1 ? curWidth : 1;
- curHeight = curHeight >= 1 ? curHeight : 1;
- inTextureDataSize = curWidth * curHeight * size;
-
- m_Texture2D.SetTextureData(toU8DataRef((char *)theMipImage.data, (QT3DSU32)inTextureDataSize),
- (QT3DSU8)idx, (QT3DSU32)curWidth, (QT3DSU32)curHeight, theMipImage.format,
- m_DestinationFormat);
-
- if (prevImage.data == inTextureData)
- prevImage = STextureData();
-
- STextureData temp = prevImage;
- prevImage = theMipImage;
- theMipImage = temp;
- }
- QT3DS_FREE(m_Foundation.getAllocator(), theMipImage.data);
- QT3DS_FREE(m_Foundation.getAllocator(), prevImage.data);
-}
-
-//------------------------------------------------------------------------------------
-// GL compute based filtering
-//------------------------------------------------------------------------------------
-
-static const char *computeUploadShader(std::string &prog, NVRenderTextureFormats::Enum inFormat,
- bool binESContext)
-{
- if (binESContext) {
- prog += "#version 310 es\n"
- "#extension GL_ARB_compute_shader : enable\n"
- "precision highp float;\n"
- "precision highp int;\n"
- "precision mediump image2D;\n";
- } else {
- prog += "#version 430\n"
- "#extension GL_ARB_compute_shader : enable\n";
- }
-
- if (inFormat == NVRenderTextureFormats::RGBA8) {
- prog += "// Set workgroup layout;\n"
- "layout (local_size_x = 16, local_size_y = 16) in;\n\n"
- "layout (rgba8, binding = 1) readonly uniform image2D inputImage;\n\n"
- "layout (rgba16f, binding = 2) writeonly uniform image2D outputImage;\n\n"
- "void main()\n"
- "{\n"
- " if ( gl_GlobalInvocationID.x >= gl_NumWorkGroups.x || gl_GlobalInvocationID.y "
- ">= gl_NumWorkGroups.y )\n"
- " return;\n"
- " vec4 value = imageLoad(inputImage, ivec2(gl_GlobalInvocationID.xy));\n"
- " imageStore( outputImage, ivec2(gl_GlobalInvocationID.xy), value );\n"
- "}\n";
- } else {
- prog += "float convertToFloat( in uint inValue )\n"
- "{\n"
- " uint v = inValue & uint(0xFF);\n"
- " float f = float(v)/256.0;\n"
- " return f;\n"
- "}\n";
-
- prog += "int getMod( in int inValue, in int mod )\n"
- "{\n"
- " int v = mod * (inValue/mod);\n"
- " return inValue - v;\n"
- "}\n";
-
- prog += "vec4 getRGBValue( in int byteNo, vec4 inVal, vec4 inVal1 )\n"
- "{\n"
- " vec4 result= vec4(0.0);\n"
- " if( byteNo == 0) {\n"
- " result.r = inVal.r;\n"
- " result.g = inVal.g;\n"
- " result.b = inVal.b;\n"
- " }\n"
- " else if( byteNo == 1) {\n"
- " result.r = inVal.g;\n"
- " result.g = inVal.b;\n"
- " result.b = inVal.a;\n"
- " }\n"
- " else if( byteNo == 2) {\n"
- " result.r = inVal.b;\n"
- " result.g = inVal.a;\n"
- " result.b = inVal1.r;\n"
- " }\n"
- " else if( byteNo == 3) {\n"
- " result.r = inVal.a;\n"
- " result.g = inVal1.r;\n"
- " result.b = inVal1.g;\n"
- " }\n"
- " return result;\n"
- "}\n";
-
- prog += "// Set workgroup layout;\n"
- "layout (local_size_x = 16, local_size_y = 16) in;\n\n"
- "layout (rgba8, binding = 1) readonly uniform image2D inputImage;\n\n"
- "layout (rgba16f, binding = 2) writeonly uniform image2D outputImage;\n\n"
- "void main()\n"
- "{\n"
- " vec4 result = vec4(0.0);\n"
- " if ( gl_GlobalInvocationID.x >= gl_NumWorkGroups.x || gl_GlobalInvocationID.y "
- ">= gl_NumWorkGroups.y )\n"
- " return;\n"
- " int xpos = (int(gl_GlobalInvocationID.x)*3)/4;\n"
- " int xmod = getMod(int(gl_GlobalInvocationID.x)*3, 4);\n"
- " ivec2 readPos = ivec2(xpos, gl_GlobalInvocationID.y);\n"
- " vec4 value = imageLoad(inputImage, readPos);\n"
- " vec4 value1 = imageLoad(inputImage, ivec2(readPos.x + 1, readPos.y));\n"
- " result = getRGBValue( xmod, value, value1);\n"
- " imageStore( outputImage, ivec2(gl_GlobalInvocationID.xy), result );\n"
- "}\n";
- }
- return prog.c_str();
-}
-
-static const char *computeWorkShader(std::string &prog, bool binESContext)
-{
- if (binESContext) {
- prog += "#version 310 es\n"
- "#extension GL_ARB_compute_shader : enable\n"
- "precision highp float;\n"
- "precision highp int;\n"
- "precision mediump image2D;\n";
- } else {
- prog += "#version 430\n"
- "#extension GL_ARB_compute_shader : enable\n";
- }
-
- prog += "int wrapMod( in int a, in int base )\n"
- "{\n"
- " return ( a >= 0 ) ? a % base : -(a % base) + base;\n"
- "}\n";
-
- prog += "void getWrappedCoords( inout int sX, inout int sY, in int width, in int height )\n"
- "{\n"
- " if (sY < 0) { sX -= width >> 1; sY = -sY; }\n"
- " if (sY >= height) { sX += width >> 1; sY = height - sY; }\n"
- " sX = wrapMod( sX, width );\n"
- "}\n";
-
- prog += "// Set workgroup layout;\n"
- "layout (local_size_x = 16, local_size_y = 16) in;\n\n"
- "layout (rgba16f, binding = 1) readonly uniform image2D inputImage;\n\n"
- "layout (rgba16f, binding = 2) writeonly uniform image2D outputImage;\n\n"
- "void main()\n"
- "{\n"
- " int prevWidth = int(gl_NumWorkGroups.x) << 1;\n"
- " int prevHeight = int(gl_NumWorkGroups.y) << 1;\n"
- " if ( gl_GlobalInvocationID.x >= gl_NumWorkGroups.x || gl_GlobalInvocationID.y >= "
- "gl_NumWorkGroups.y )\n"
- " return;\n"
- " vec4 accumVal = vec4(0.0);\n"
- " for ( int sy = -2; sy <= 2; ++sy )\n"
- " {\n"
- " for ( int sx = -2; sx <= 2; ++sx )\n"
- " {\n"
- " int sampleX = sx + (int(gl_GlobalInvocationID.x) << 1);\n"
- " int sampleY = sy + (int(gl_GlobalInvocationID.y) << 1);\n"
- " getWrappedCoords(sampleX, sampleY, prevWidth, prevHeight);\n"
- " if ((sampleY * prevWidth + sampleX) < 0 )\n"
- " sampleY = prevHeight + sampleY;\n"
- " ivec2 pos = ivec2(sampleX, sampleY);\n"
- " vec4 value = imageLoad(inputImage, pos);\n"
- " float filterPdf = 1.0 / ( 1.0 + float(sx*sx + sy*sy)*2.0 );\n"
- " filterPdf /= 4.71238898;\n"
- " accumVal[0] += filterPdf * value.r;\n"
- " accumVal[1] += filterPdf * value.g;\n"
- " accumVal[2] += filterPdf * value.b;\n"
- " accumVal[3] += filterPdf * value.a;\n"
- " }\n"
- " }\n"
- " imageStore( outputImage, ivec2(gl_GlobalInvocationID.xy), accumVal );\n"
- "}\n";
-
- return prog.c_str();
-}
-
-inline NVConstDataRef<QT3DSI8> toRef(const char *data)
-{
- size_t len = strlen(data) + 1;
- return NVConstDataRef<QT3DSI8>((const QT3DSI8 *)data, (QT3DSU32)len);
-}
-
-static bool isGLESContext(NVRenderContext *context)
-{
- NVRenderContextType ctxType = context->GetRenderContextType();
-
- // Need minimum of GL3 or GLES3
- if (ctxType == NVRenderContextValues::GLES2 || ctxType == NVRenderContextValues::GLES3
- || ctxType == NVRenderContextValues::GLES3PLUS) {
- return true;
- }
-
- return false;
-}
-
-#define WORKGROUP_SIZE 16
-
-Qt3DSRenderPrefilterTextureCompute::Qt3DSRenderPrefilterTextureCompute(
- NVRenderContext *inNVRenderContext, QT3DSI32 inWidth, QT3DSI32 inHeight,
- NVRenderTexture2D &inTexture2D, NVRenderTextureFormats::Enum inDestFormat,
- NVFoundationBase &inFnd)
- : Qt3DSRenderPrefilterTexture(inNVRenderContext, inWidth, inHeight, inTexture2D, inDestFormat,
- inFnd)
- , m_BSDFProgram(NULL)
- , m_UploadProgram_RGBA8(NULL)
- , m_UploadProgram_RGB8(NULL)
- , m_Level0Tex(NULL)
- , m_TextureCreated(false)
-{
-}
-
-Qt3DSRenderPrefilterTextureCompute::~Qt3DSRenderPrefilterTextureCompute()
-{
- m_UploadProgram_RGB8 = NULL;
- m_UploadProgram_RGBA8 = NULL;
- m_BSDFProgram = NULL;
- m_Level0Tex = NULL;
-}
-
-void Qt3DSRenderPrefilterTextureCompute::createComputeProgram(NVRenderContext *context)
-{
- std::string computeProg;
-
- if (!m_BSDFProgram) {
- m_BSDFProgram = context
- ->CompileComputeSource(
- "Compute BSDF mipmap shader",
- toRef(computeWorkShader(computeProg, isGLESContext(context))))
- .mShader;
- }
-}
-
-NVRenderShaderProgram *Qt3DSRenderPrefilterTextureCompute::getOrCreateUploadComputeProgram(
- NVRenderContext *context, NVRenderTextureFormats::Enum inFormat)
-{
- std::string computeProg;
-
- if (inFormat == NVRenderTextureFormats::RGB8) {
- if (!m_UploadProgram_RGB8) {
- m_UploadProgram_RGB8 =
- context
- ->CompileComputeSource(
- "Compute BSDF mipmap level 0 RGB8 shader",
- toRef(computeUploadShader(computeProg, inFormat, isGLESContext(context))))
- .mShader;
- }
-
- return m_UploadProgram_RGB8;
- } else {
- if (!m_UploadProgram_RGBA8) {
- m_UploadProgram_RGBA8 =
- context
- ->CompileComputeSource(
- "Compute BSDF mipmap level 0 RGBA8 shader",
- toRef(computeUploadShader(computeProg, inFormat, isGLESContext(context))))
- .mShader;
- }
-
- return m_UploadProgram_RGBA8;
- }
-}
-
-void Qt3DSRenderPrefilterTextureCompute::CreateLevel0Tex(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat)
-{
- NVRenderTextureFormats::Enum theFormat = inFormat;
- QT3DSI32 theWidth = m_Width;
-
- // Since we cannot use RGB format in GL compute
- // we treat it as a RGBA component format
- if (inFormat == NVRenderTextureFormats::RGB8) {
- // This works only with 4 byte aligned data
- QT3DS_ASSERT(m_Width % 4 == 0);
- theFormat = NVRenderTextureFormats::RGBA8;
- theWidth = (m_Width * 3) / 4;
- }
-
- if (m_Level0Tex == NULL) {
- m_Level0Tex = m_NVRenderContext->CreateTexture2D();
- m_Level0Tex->SetTextureStorage(1, theWidth, m_Height, theFormat, theFormat,
- NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize));
- } else {
- m_Level0Tex->SetTextureSubData(NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize), 0,
- 0, 0, theWidth, m_Height, theFormat);
- }
-}
-
-void Qt3DSRenderPrefilterTextureCompute::Build(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat)
-{
- bool needMipUpload = (inFormat != m_DestinationFormat);
- // re-upload data
- if (!m_TextureCreated) {
- m_Texture2D.SetTextureStorage(
- m_MaxMipMapLevel + 1, m_Width, m_Height, m_DestinationFormat, inFormat, (needMipUpload)
- ? NVDataRef<QT3DSU8>()
- : NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize));
- m_Texture2D.addRef();
- // create a compute shader (if not aloread done) which computes the BSDF mipmaps for this
- // texture
- createComputeProgram(m_NVRenderContext);
-
- if (!m_BSDFProgram) {
- QT3DS_ASSERT(false);
- return;
- }
-
- m_TextureCreated = true;
- } else if (!needMipUpload) {
- m_Texture2D.SetTextureSubData(NVDataRef<QT3DSU8>((QT3DSU8 *)inTextureData, inTextureDataSize), 0,
- 0, 0, m_Width, m_Height, inFormat);
- }
-
- if (needMipUpload) {
- CreateLevel0Tex(inTextureData, inTextureDataSize, inFormat);
- }
-
- NVScopedRefCounted<NVRenderImage2D> theInputImage;
- NVScopedRefCounted<NVRenderImage2D> theOutputImage;
- theInputImage =
- m_NVRenderContext->CreateImage2D(&m_Texture2D, NVRenderImageAccessType::ReadWrite);
- theOutputImage =
- m_NVRenderContext->CreateImage2D(&m_Texture2D, NVRenderImageAccessType::ReadWrite);
-
- if (needMipUpload && m_Level0Tex) {
- NVRenderShaderProgram *uploadProg =
- getOrCreateUploadComputeProgram(m_NVRenderContext, inFormat);
- if (!uploadProg)
- return;
-
- m_NVRenderContext->SetActiveShader(uploadProg);
-
- NVScopedRefCounted<NVRenderImage2D> theInputImage0;
- theInputImage0 =
- m_NVRenderContext->CreateImage2D(m_Level0Tex, NVRenderImageAccessType::ReadWrite);
-
- theInputImage0->SetTextureLevel(0);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedinputImage0("inputImage",
- *uploadProg);
- theCachedinputImage0.Set(theInputImage0);
-
- theOutputImage->SetTextureLevel(0);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedOutputImage("outputImage",
- *uploadProg);
- theCachedOutputImage.Set(theOutputImage);
-
- m_NVRenderContext->DispatchCompute(uploadProg, m_Width, m_Height, 1);
-
- // sync
- NVRenderBufferBarrierFlags flags(NVRenderBufferBarrierValues::ShaderImageAccess);
- m_NVRenderContext->SetMemoryBarrier(flags);
- }
-
- int width = m_Width >> 1;
- int height = m_Height >> 1;
-
- m_NVRenderContext->SetActiveShader(m_BSDFProgram);
-
- for (int i = 1; i <= m_MaxMipMapLevel; ++i) {
- theOutputImage->SetTextureLevel(i);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedOutputImage("outputImage",
- *m_BSDFProgram);
- theCachedOutputImage.Set(theOutputImage);
- theInputImage->SetTextureLevel(i - 1);
- NVRenderCachedShaderProperty<NVRenderImage2D *> theCachedinputImage("inputImage",
- *m_BSDFProgram);
- theCachedinputImage.Set(theInputImage);
-
- m_NVRenderContext->DispatchCompute(m_BSDFProgram, width, height, 1);
-
- width = width > 2 ? width >> 1 : 1;
- height = height > 2 ? height >> 1 : 1;
-
- // sync
- NVRenderBufferBarrierFlags flags(NVRenderBufferBarrierValues::ShaderImageAccess);
- m_NVRenderContext->SetMemoryBarrier(flags);
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.h
deleted file mode 100644
index e633eb14..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderPrefilterTexture.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_PREFILTER_TEXTURE_H
-#define QT3DS_RENDER_PREFILTER_TEXTURE_H
-#include "foundation/Qt3DSAtomic.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "Qt3DSRender.h"
-
-#include "Qt3DSTypes.h"
-#include "Qt3DSRenderLoadedTexture.h"
-
-namespace qt3ds {
-namespace render {
-
- class Qt3DSRenderPrefilterTexture : public NVRefCounted
- {
- public:
- Qt3DSRenderPrefilterTexture(NVRenderContext *inNVRenderContext, QT3DSI32 inWidth, QT3DSI32 inHeight,
- NVRenderTexture2D &inTexture,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
- virtual ~Qt3DSRenderPrefilterTexture();
-
- virtual void Build(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat) = 0;
-
- static Qt3DSRenderPrefilterTexture *Create(NVRenderContext *inNVRenderContext, QT3DSI32 inWidth,
- QT3DSI32 inHeight, NVRenderTexture2D &inTexture,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
-
- protected:
- NVFoundationBase &m_Foundation; ///< Foundation class for allocations and other base things
- volatile QT3DSI32 mRefCount; ///< reference count
-
- NVRenderTexture2D &m_Texture2D;
- NVRenderTextureFormats::Enum m_InternalFormat;
- NVRenderTextureFormats::Enum m_DestinationFormat;
-
- QT3DSI32 m_Width;
- QT3DSI32 m_Height;
- QT3DSI32 m_MaxMipMapLevel;
- QT3DSI32 m_SizeOfFormat;
- QT3DSI32 m_SizeOfInternalFormat;
- QT3DSI32 m_InternalNoOfComponent;
- QT3DSI32 m_NoOfComponent;
- NVRenderContext *m_NVRenderContext;
- };
-
- class Qt3DSRenderPrefilterTextureCPU : public Qt3DSRenderPrefilterTexture
- {
- public:
- Qt3DSRenderPrefilterTextureCPU(NVRenderContext *inNVRenderContext, QT3DSI32 inWidth,
- QT3DSI32 inHeight, NVRenderTexture2D &inTexture,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
-
- void Build(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat) override;
-
- STextureData CreateBsdfMipLevel(STextureData &inCurMipLevel, STextureData &inPrevMipLevel,
- QT3DSI32 width, QT3DSI32 height);
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- int wrapMod(int a, int base);
- void getWrappedCoords(int &sX, int &sY, int width, int height);
- };
-
- class Qt3DSRenderPrefilterTextureCompute : public Qt3DSRenderPrefilterTexture
- {
- public:
- Qt3DSRenderPrefilterTextureCompute(NVRenderContext *inNVRenderContext, QT3DSI32 inWidth,
- QT3DSI32 inHeight, NVRenderTexture2D &inTexture,
- NVRenderTextureFormats::Enum inDestFormat,
- qt3ds::NVFoundationBase &inFnd);
- ~Qt3DSRenderPrefilterTextureCompute();
-
- void Build(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat) override;
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_Foundation)
-
- private:
- void CreateLevel0Tex(void *inTextureData, QT3DSI32 inTextureDataSize,
- NVRenderTextureFormats::Enum inFormat);
-
- NVScopedRefCounted<NVRenderShaderProgram> m_BSDFProgram;
- NVScopedRefCounted<NVRenderShaderProgram> m_UploadProgram_RGBA8;
- NVScopedRefCounted<NVRenderShaderProgram> m_UploadProgram_RGB8;
- NVScopedRefCounted<NVRenderTexture2D> m_Level0Tex;
- bool m_TextureCreated;
-
- void createComputeProgram(NVRenderContext *context);
- NVRenderShaderProgram *
- getOrCreateUploadComputeProgram(NVRenderContext *context,
- NVRenderTextureFormats::Enum inFormat);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.cpp
deleted file mode 100644
index 25fbb414..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderResourceBufferObjects.h"
-
-using namespace qt3ds::render;
-
-/*
- IResourceManager& m_ResourceManager;
- NVRenderFrameBuffer* m_FrameBuffer;
- */
-
-CResourceFrameBuffer::CResourceFrameBuffer(IResourceManager &mgr)
- : m_ResourceManager(mgr)
- , m_FrameBuffer(NULL)
-{
-}
-
-CResourceFrameBuffer::~CResourceFrameBuffer()
-{
- ReleaseFrameBuffer();
-}
-
-bool CResourceFrameBuffer::EnsureFrameBuffer()
-{
- if (!m_FrameBuffer) {
- m_FrameBuffer = m_ResourceManager.AllocateFrameBuffer();
- return true;
- }
- return false;
-}
-
-void CResourceFrameBuffer::ReleaseFrameBuffer()
-{
- if (m_FrameBuffer) {
- m_ResourceManager.Release(*m_FrameBuffer);
- }
-}
-
-CResourceRenderBuffer::CResourceRenderBuffer(IResourceManager &mgr)
- : m_ResourceManager(mgr)
- , m_RenderBuffer(NULL)
-{
-}
-
-CResourceRenderBuffer::~CResourceRenderBuffer()
-{
- ReleaseRenderBuffer();
-}
-
-bool CResourceRenderBuffer::EnsureRenderBuffer(QT3DSU32 width, QT3DSU32 height,
- NVRenderRenderBufferFormats::Enum storageFormat)
-{
- if (m_RenderBuffer == NULL || m_Dimensions.m_Width != width || m_Dimensions.m_Height != height
- || m_StorageFormat != storageFormat) {
- if (m_RenderBuffer == NULL || m_StorageFormat != storageFormat) {
- ReleaseRenderBuffer();
- m_RenderBuffer = m_ResourceManager.AllocateRenderBuffer(width, height, storageFormat);
- } else
- m_RenderBuffer->SetDimensions(
- qt3ds::render::NVRenderRenderBufferDimensions(width, height));
- m_Dimensions = m_RenderBuffer->GetDimensions();
- m_StorageFormat = m_RenderBuffer->GetStorageFormat();
- return true;
- }
- return false;
-}
-
-void CResourceRenderBuffer::ReleaseRenderBuffer()
-{
- if (m_RenderBuffer) {
- m_ResourceManager.Release(*m_RenderBuffer);
- m_RenderBuffer = NULL;
- }
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.h
deleted file mode 100644
index fb54c4dc..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceBufferObjects.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_RESOURCE_BUFFER_OBJECTS_H
-#define QT3DS_RENDER_RESOURCE_BUFFER_OBJECTS_H
-#include "Qt3DSRender.h"
-#include "render/Qt3DSRenderContext.h"
-#include "Qt3DSRenderResourceManager.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-
-namespace qt3ds {
-namespace render {
- class CResourceFrameBuffer
- {
- protected:
- IResourceManager &m_ResourceManager;
- NVRenderFrameBuffer *m_FrameBuffer;
-
- public:
- CResourceFrameBuffer(IResourceManager &mgr);
- ~CResourceFrameBuffer();
- bool EnsureFrameBuffer();
- void ReleaseFrameBuffer();
-
- IResourceManager &GetResourceManager() { return m_ResourceManager; }
- operator NVRenderFrameBuffer *() { return m_FrameBuffer; }
- NVRenderFrameBuffer *operator->()
- {
- QT3DS_ASSERT(m_FrameBuffer);
- return m_FrameBuffer;
- }
- NVRenderFrameBuffer &operator*()
- {
- QT3DS_ASSERT(m_FrameBuffer);
- return *m_FrameBuffer;
- }
- };
-
- class CResourceRenderBuffer
- {
- protected:
- IResourceManager &m_ResourceManager;
- NVRenderRenderBuffer *m_RenderBuffer;
- qt3ds::render::NVRenderRenderBufferFormats::Enum m_StorageFormat;
- qt3ds::render::NVRenderRenderBufferDimensions m_Dimensions;
-
- public:
- CResourceRenderBuffer(IResourceManager &mgr);
- ~CResourceRenderBuffer();
- bool EnsureRenderBuffer(QT3DSU32 width, QT3DSU32 height,
- NVRenderRenderBufferFormats::Enum storageFormat);
- void ReleaseRenderBuffer();
-
- operator NVRenderRenderBuffer *() { return m_RenderBuffer; }
- NVRenderRenderBuffer *operator->()
- {
- QT3DS_ASSERT(m_RenderBuffer);
- return m_RenderBuffer;
- }
- NVRenderRenderBuffer &operator*()
- {
- QT3DS_ASSERT(m_RenderBuffer);
- return *m_RenderBuffer;
- }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.cpp
deleted file mode 100644
index 35936885..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderResourceManager.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderFrameBuffer.h"
-#include "render/Qt3DSRenderRenderBuffer.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderTexture2DArray.h"
-#include "render/Qt3DSRenderTextureCube.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Qt3DSContainers.h"
-
-using namespace qt3ds::render;
-
-namespace {
-
-struct SResourceManager : public IResourceManager
-{
- NVScopedRefCounted<NVRenderContext> m_RenderContext;
- // Complete list of all allocated objects
- nvvector<NVScopedRefCounted<NVRefCounted>> m_AllocatedObjects;
-
- nvvector<NVRenderFrameBuffer *> m_FreeFrameBuffers;
- nvvector<NVRenderRenderBuffer *> m_FreeRenderBuffers;
- nvvector<NVRenderTexture2D *> m_FreeTextures;
- nvvector<NVRenderTexture2DArray *> m_FreeTexArrays;
- nvvector<NVRenderTextureCube *> m_FreeTexCubes;
- nvvector<NVRenderImage2D *> m_FreeImages;
-
- volatile QT3DSI32 mRefCount;
-
- SResourceManager(NVRenderContext &ctx)
- : m_RenderContext(ctx)
- , m_AllocatedObjects(ctx.GetAllocator(), "SResourceManager::m_FrameBuffers")
- , m_FreeFrameBuffers(ctx.GetAllocator(), "SResourceManager::m_FreeFrameBuffers")
- , m_FreeRenderBuffers(ctx.GetAllocator(), "SResourceManager::m_FreeRenderBuffers")
- , m_FreeTextures(ctx.GetAllocator(), "SResourceManager::m_FreeTextures")
- , m_FreeTexArrays(ctx.GetAllocator(), "SResourceManager::m_FreeTexArrays")
- , m_FreeTexCubes(ctx.GetAllocator(), "SResourceManager::m_FreeTexCubes")
- , m_FreeImages(ctx.GetAllocator(), "SResourceManager::m_FreeImages")
- , mRefCount(0)
- {
- }
- virtual ~SResourceManager() {}
-
- QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_RenderContext->GetAllocator())
-
- NVRenderFrameBuffer *AllocateFrameBuffer() override
- {
- if (m_FreeFrameBuffers.empty() == true) {
- NVRenderFrameBuffer *newBuffer = m_RenderContext->CreateFrameBuffer();
- m_AllocatedObjects.push_back(newBuffer);
- m_FreeFrameBuffers.push_back(newBuffer);
- }
- NVRenderFrameBuffer *retval = m_FreeFrameBuffers.back();
- m_FreeFrameBuffers.pop_back();
- return retval;
- }
- void Release(NVRenderFrameBuffer &inBuffer) override
- {
- if (inBuffer.HasAnyAttachment()) {
- // Ensure the framebuffer has no attachments.
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color0,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color1,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color2,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color3,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color4,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color5,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color6,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Color7,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Depth,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- inBuffer.Attach(NVRenderFrameBufferAttachments::Stencil,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- if (m_RenderContext->IsDepthStencilSupported())
- inBuffer.Attach(NVRenderFrameBufferAttachments::DepthStencil,
- qt3ds::render::NVRenderTextureOrRenderBuffer());
- }
-#ifdef _DEBUG
- nvvector<NVRenderFrameBuffer *>::iterator theFind =
- eastl::find(m_FreeFrameBuffers.begin(), m_FreeFrameBuffers.end(), &inBuffer);
- QT3DS_ASSERT(theFind == m_FreeFrameBuffers.end());
-#endif
- m_FreeFrameBuffers.push_back(&inBuffer);
- }
-
- virtual NVRenderRenderBuffer *
- AllocateRenderBuffer(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderRenderBufferFormats::Enum inBufferFormat) override
- {
- // Look for one of this specific size and format.
- QT3DSU32 existingMatchIdx = m_FreeRenderBuffers.size();
- for (QT3DSU32 idx = 0, end = existingMatchIdx; idx < end; ++idx) {
- NVRenderRenderBuffer *theBuffer = m_FreeRenderBuffers[idx];
- qt3ds::render::NVRenderRenderBufferDimensions theDims = theBuffer->GetDimensions();
- NVRenderRenderBufferFormats::Enum theFormat = theBuffer->GetStorageFormat();
- if (theDims.m_Width == inWidth && theDims.m_Height == inHeight
- && theFormat == inBufferFormat) {
- // Replace idx with last for efficient erasure (that reorders the vector).
- m_FreeRenderBuffers.replace_with_last(idx);
- return theBuffer;
- } else if (theFormat == inBufferFormat)
- existingMatchIdx = idx;
- }
- // If a specific exact match couldn't be found, just use the buffer with
- // the same format and resize it.
- if (existingMatchIdx < m_FreeRenderBuffers.size()) {
- NVRenderRenderBuffer *theBuffer = m_FreeRenderBuffers[existingMatchIdx];
- m_FreeRenderBuffers.replace_with_last(existingMatchIdx);
- theBuffer->SetDimensions(qt3ds::render::NVRenderRenderBufferDimensions(inWidth, inHeight));
- return theBuffer;
- }
-
- NVRenderRenderBuffer *theBuffer =
- m_RenderContext->CreateRenderBuffer(inBufferFormat, inWidth, inHeight);
- m_AllocatedObjects.push_back(theBuffer);
- return theBuffer;
- }
- void Release(NVRenderRenderBuffer &inBuffer) override
- {
-#ifdef _DEBUG
- nvvector<NVRenderRenderBuffer *>::iterator theFind =
- eastl::find(m_FreeRenderBuffers.begin(), m_FreeRenderBuffers.end(), &inBuffer);
- QT3DS_ASSERT(theFind == m_FreeRenderBuffers.end());
-#endif
- m_FreeRenderBuffers.push_back(&inBuffer);
- }
- NVRenderTexture2D *SetupAllocatedTexture(NVRenderTexture2D &inTexture)
- {
- inTexture.SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- inTexture.SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return &inTexture;
- }
- NVRenderTexture2D *AllocateTexture2D(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inTextureFormat,
- QT3DSU32 inSampleCount, bool immutable) override
- {
- bool inMultisample =
- inSampleCount > 1 && m_RenderContext->AreMultisampleTexturesSupported();
- for (QT3DSU32 idx = 0, end = m_FreeTextures.size(); idx < end; ++idx) {
- NVRenderTexture2D *theTexture = m_FreeTextures[idx];
- STextureDetails theDetails = theTexture->GetTextureDetails();
- if (theDetails.m_Width == inWidth && theDetails.m_Height == inHeight
- && inTextureFormat == theDetails.m_Format
- && theTexture->GetSampleCount() == inSampleCount) {
- m_FreeTextures.replace_with_last(idx);
- return SetupAllocatedTexture(*theTexture);
- }
- }
- // else resize an existing texture. This is very expensive
- // note that MSAA textures are not resizable ( in GLES )
- /*
- if ( !m_FreeTextures.empty() && !inMultisample )
- {
- NVRenderTexture2D* theTexture = m_FreeTextures.back();
- m_FreeTextures.pop_back();
-
- // note we could re-use a former MSAA texture
- // this causes a entiere destroy of the previous texture object
- theTexture->SetTextureData( NVDataRef<QT3DSU8>(), 0, inWidth, inHeight, inTextureFormat
- );
-
- return SetupAllocatedTexture( *theTexture );
- }*/
- // else create a new texture.
- NVRenderTexture2D *theTexture = m_RenderContext->CreateTexture2D();
-
- if (inMultisample)
- theTexture->SetTextureDataMultisample(inSampleCount, inWidth, inHeight,
- inTextureFormat);
- else if (immutable)
- theTexture->SetTextureStorage(1, inWidth, inHeight, inTextureFormat);
- else
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, inWidth, inHeight, inTextureFormat);
-
- m_AllocatedObjects.push_back(theTexture);
- return SetupAllocatedTexture(*theTexture);
- }
- void Release(NVRenderTexture2D &inBuffer) override
- {
-#ifdef _DEBUG
- nvvector<NVRenderTexture2D *>::iterator theFind =
- eastl::find(m_FreeTextures.begin(), m_FreeTextures.end(), &inBuffer);
- QT3DS_ASSERT(theFind == m_FreeTextures.end());
-#endif
- m_FreeTextures.push_back(&inBuffer);
- }
-
- NVRenderTexture2DArray *AllocateTexture2DArray(QT3DSU32 inWidth, QT3DSU32 inHeight, QT3DSU32 inSlices,
- NVRenderTextureFormats::Enum inTextureFormat,
- QT3DSU32 inSampleCount) override
- {
- bool inMultisample =
- inSampleCount > 1 && m_RenderContext->AreMultisampleTexturesSupported();
- for (QT3DSU32 idx = 0, end = m_FreeTexArrays.size(); idx < end; ++idx) {
- NVRenderTexture2DArray *theTexture = m_FreeTexArrays[idx];
- STextureDetails theDetails = theTexture->GetTextureDetails();
- if (theDetails.m_Width == inWidth && theDetails.m_Height == inHeight
- && theDetails.m_Depth == inSlices && inTextureFormat == theDetails.m_Format
- && theTexture->GetSampleCount() == inSampleCount) {
- m_FreeTexArrays.replace_with_last(idx);
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return theTexture;
- }
- }
-
- // else resize an existing texture. This should be fairly quick at the driver level.
- // note that MSAA textures are not resizable ( in GLES )
- if (!m_FreeTexArrays.empty() && !inMultisample) {
- NVRenderTexture2DArray *theTexture = m_FreeTexArrays.back();
- m_FreeTexArrays.pop_back();
-
- // note we could re-use a former MSAA texture
- // this causes a entiere destroy of the previous texture object
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, inWidth, inHeight, inSlices,
- inTextureFormat);
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return theTexture;
- }
-
- // else create a new texture.
- NVRenderTexture2DArray *theTexture = NULL;
-
- if (!inMultisample) {
- theTexture = m_RenderContext->CreateTexture2DArray();
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, inWidth, inHeight, inSlices,
- inTextureFormat);
- } else {
- // Not supported yet
- return NULL;
- }
-
- m_AllocatedObjects.push_back(theTexture);
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return theTexture;
- }
-
- void Release(NVRenderTexture2DArray &inBuffer) override
- {
-#ifdef _DEBUG
- nvvector<NVRenderTexture2DArray *>::iterator theFind =
- eastl::find(m_FreeTexArrays.begin(), m_FreeTexArrays.end(), &inBuffer);
- QT3DS_ASSERT(theFind == m_FreeTexArrays.end());
-#endif
- m_FreeTexArrays.push_back(&inBuffer);
- }
-
- NVRenderTextureCube *AllocateTextureCube(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inTextureFormat,
- QT3DSU32 inSampleCount) override
- {
- bool inMultisample =
- inSampleCount > 1 && m_RenderContext->AreMultisampleTexturesSupported();
- for (QT3DSU32 idx = 0, end = m_FreeTexCubes.size(); idx < end; ++idx) {
- NVRenderTextureCube *theTexture = m_FreeTexCubes[idx];
- STextureDetails theDetails = theTexture->GetTextureDetails();
- if (theDetails.m_Width == inWidth && theDetails.m_Height == inHeight
- && inTextureFormat == theDetails.m_Format
- && theTexture->GetSampleCount() == inSampleCount) {
- m_FreeTexCubes.replace_with_last(idx);
-
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return theTexture;
- }
- }
-
- // else resize an existing texture. This should be fairly quick at the driver level.
- // note that MSAA textures are not resizable ( in GLES )
- if (!m_FreeTexCubes.empty() && !inMultisample) {
- NVRenderTextureCube *theTexture = m_FreeTexCubes.back();
- m_FreeTexCubes.pop_back();
-
- // note we could re-use a former MSAA texture
- // this causes a entire destroy of the previous texture object
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubePosX,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubeNegX,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubePosY,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubeNegY,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubePosZ,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubeNegZ,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return theTexture;
- }
-
- // else create a new texture.
- NVRenderTextureCube *theTexture = NULL;
-
- if (!inMultisample) {
- theTexture = m_RenderContext->CreateTextureCube();
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubePosX,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubeNegX,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubePosY,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubeNegY,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubePosZ,
- inWidth, inHeight, inTextureFormat);
- theTexture->SetTextureData(NVDataRef<QT3DSU8>(), 0, NVRenderTextureCubeFaces::CubeNegZ,
- inWidth, inHeight, inTextureFormat);
- } else {
- // Not supported yet
- return NULL;
- }
-
- m_AllocatedObjects.push_back(theTexture);
- theTexture->SetMinFilter(NVRenderTextureMinifyingOp::Linear);
- theTexture->SetMagFilter(NVRenderTextureMagnifyingOp::Linear);
- return theTexture;
- }
-
- void Release(NVRenderTextureCube &inBuffer) override
- {
-#ifdef _DEBUG
- nvvector<NVRenderTextureCube *>::iterator theFind =
- eastl::find(m_FreeTexCubes.begin(), m_FreeTexCubes.end(), &inBuffer);
- QT3DS_ASSERT(theFind == m_FreeTexCubes.end());
-#endif
- m_FreeTexCubes.push_back(&inBuffer);
- }
-
- NVRenderImage2D *AllocateImage2D(NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess) override
- {
- if (m_FreeImages.empty() == true) {
- NVRenderImage2D *newImage = m_RenderContext->CreateImage2D(inTexture, inAccess);
- if (newImage) {
- m_AllocatedObjects.push_back(newImage);
- m_FreeImages.push_back(newImage);
- }
- }
-
- NVRenderImage2D *retval = m_FreeImages.back();
- m_FreeImages.pop_back();
-
- return retval;
- }
-
- void Release(NVRenderImage2D &inBuffer) override
- {
-#ifdef _DEBUG
- nvvector<NVRenderImage2D *>::iterator theFind =
- eastl::find(m_FreeImages.begin(), m_FreeImages.end(), &inBuffer);
- QT3DS_ASSERT(theFind == m_FreeImages.end());
-#endif
- m_FreeImages.push_back(&inBuffer);
- }
-
- NVRenderContext &GetRenderContext() override { return *m_RenderContext; }
-
- void RemoveObjectAllocation(NVRefCounted *obj) {
- for (QT3DSU32 idx = 0, end = m_AllocatedObjects.size(); idx < end; ++idx) {
- if (obj == m_AllocatedObjects[idx]) {
- m_AllocatedObjects.replace_with_last(idx);
- break;
- }
- }
- }
-
- void DestroyFreeSizedResources()
- {
- for (int idx = m_FreeRenderBuffers.size() - 1; idx >= 0; --idx) {
- NVRenderRenderBuffer *obj = m_FreeRenderBuffers[idx];
- m_FreeRenderBuffers.replace_with_last(idx);
- RemoveObjectAllocation(obj);
- }
- for (int idx = m_FreeTextures.size() - 1; idx >= 0; --idx) {
- NVRenderTexture2D *obj = m_FreeTextures[idx];
- m_FreeTextures.replace_with_last(idx);
- RemoveObjectAllocation(obj);
- }
- for (int idx = m_FreeTexArrays.size() - 1; idx >= 0; --idx) {
- NVRenderTexture2DArray *obj = m_FreeTexArrays[idx];
- m_FreeTexArrays.replace_with_last(idx);
- RemoveObjectAllocation(obj);
- }
- for (int idx = m_FreeTexCubes.size() - 1; idx >= 0; --idx) {
- NVRenderTextureCube *obj = m_FreeTexCubes[idx];
- m_FreeTexCubes.replace_with_last(idx);
- RemoveObjectAllocation(obj);
- }
- }
-};
-}
-
-IResourceManager &IResourceManager::CreateResourceManager(NVRenderContext &inContext)
-{
- return *QT3DS_NEW(inContext.GetAllocator(), SResourceManager)(inContext);
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.h
deleted file mode 100644
index 675d644c..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceManager.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_RESOURCE_MANAGER_H
-#define QT3DS_RENDER_RESOURCE_MANAGER_H
-#include "Qt3DSRender.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "render/Qt3DSRenderBaseTypes.h"
-
-namespace qt3ds {
-namespace render {
- /**
- * Implements simple pooling of render resources
- */
- class IResourceManager : public NVRefCounted
- {
- protected:
- virtual ~IResourceManager() {}
-
- public:
- virtual NVRenderFrameBuffer *AllocateFrameBuffer() = 0;
- virtual void Release(NVRenderFrameBuffer &inBuffer) = 0;
- virtual NVRenderRenderBuffer *
- AllocateRenderBuffer(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderRenderBufferFormats::Enum inBufferFormat) = 0;
- virtual void Release(NVRenderRenderBuffer &inBuffer) = 0;
- virtual NVRenderTexture2D *AllocateTexture2D(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inTextureFormat,
- QT3DSU32 inSampleCount = 1,
- bool immutable = false) = 0;
- virtual void Release(NVRenderTexture2D &inBuffer) = 0;
- virtual NVRenderTexture2DArray *
- AllocateTexture2DArray(QT3DSU32 inWidth, QT3DSU32 inHeight, QT3DSU32 inSlices,
- NVRenderTextureFormats::Enum inTextureFormat,
- QT3DSU32 inSampleCount = 1) = 0;
- virtual void Release(NVRenderTexture2DArray &inBuffer) = 0;
- virtual NVRenderTextureCube *
- AllocateTextureCube(QT3DSU32 inWidth, QT3DSU32 inHeight,
- NVRenderTextureFormats::Enum inTextureFormat,
- QT3DSU32 inSampleCount = 1) = 0;
- virtual void Release(NVRenderTextureCube &inBuffer) = 0;
- virtual NVRenderImage2D *AllocateImage2D(NVRenderTexture2D *inTexture,
- NVRenderImageAccessType::Enum inAccess) = 0;
- virtual void Release(NVRenderImage2D &inBuffer) = 0;
-
- virtual NVRenderContext &GetRenderContext() = 0;
- virtual void DestroyFreeSizedResources() = 0;
-
- static IResourceManager &CreateResourceManager(NVRenderContext &inContext);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.cpp b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.cpp
deleted file mode 100644
index e877cbc9..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DSRenderResourceTexture2D.h"
-
-using namespace qt3ds::render;
-
-CResourceTexture2D::CResourceTexture2D(IResourceManager &mgr, NVRenderTexture2D *inTexture)
- : m_ResourceManager(mgr)
- , m_Texture(inTexture)
-{
- if (inTexture)
- m_TextureDetails = inTexture->GetTextureDetails();
-}
-
-CResourceTexture2D::CResourceTexture2D(IResourceManager &mgr, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples)
- : m_ResourceManager(mgr)
- , m_Texture(NULL)
-{
- EnsureTexture(width, height, inFormat, inSamples);
-}
-
-CResourceTexture2D::~CResourceTexture2D()
-{
- ReleaseTexture();
-}
-
-// Returns true if the texture was allocated, false if nothing changed (no allocation).
-bool CResourceTexture2D::TextureMatches(QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples)
-{
- return m_Texture && m_TextureDetails.m_Width == width && m_TextureDetails.m_Height == height
- && m_TextureDetails.m_Format == inFormat && m_TextureDetails.m_SampleCount == inSamples;
-}
-
-bool CResourceTexture2D::EnsureTexture(QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples)
-{
- if (TextureMatches(width, height, inFormat, inSamples))
- return false;
-
- if (m_Texture && inSamples > 1) {
- // we cannot resize MSAA textures though release first
- ReleaseTexture();
- }
-
- if (!m_Texture)
- m_Texture = m_ResourceManager.AllocateTexture2D(width, height, inFormat, inSamples);
- else {
- // multisampled textures are immuteable
- QT3DS_ASSERT(inSamples == 1);
- m_Texture->SetTextureData(NVDataRef<QT3DSU8>(), 0, width, height, inFormat);
- }
-
- m_TextureDetails = m_Texture->GetTextureDetails();
- return true;
-}
-
-void CResourceTexture2D::ReleaseTexture()
-{
- if (m_Texture) {
- m_ResourceManager.Release(*m_Texture);
- ForgetTexture();
- }
-}
-
-void CResourceTexture2D::ForgetTexture()
-{
- m_Texture = NULL;
-}
-
-void CResourceTexture2D::StealTexture(CResourceTexture2D &inOther)
-{
- ReleaseTexture();
- m_Texture = inOther.m_Texture;
- m_TextureDetails = inOther.m_TextureDetails;
- inOther.m_Texture = NULL;
-}
-
-CResourceTexture2DArray::CResourceTexture2DArray(IResourceManager &mgr)
- : m_ResourceManager(mgr)
- , m_Texture(NULL)
-{
-}
-
-CResourceTexture2DArray::CResourceTexture2DArray(IResourceManager &mgr, QT3DSU32 width, QT3DSU32 height,
- QT3DSU32 slices,
- NVRenderTextureFormats::Enum inFormat,
- QT3DSU32 inSamples)
- : m_ResourceManager(mgr)
- , m_Texture(NULL)
-{
- EnsureTexture(width, height, slices, inFormat, inSamples);
-}
-
-CResourceTexture2DArray::~CResourceTexture2DArray()
-{
- ReleaseTexture();
-}
-
-bool CResourceTexture2DArray::TextureMatches(QT3DSU32 width, QT3DSU32 height, QT3DSU32 slices,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples)
-{
- return m_Texture && m_TextureDetails.m_Depth == slices && m_TextureDetails.m_Width == width
- && m_TextureDetails.m_Height == height && m_TextureDetails.m_Format == inFormat
- && m_TextureDetails.m_SampleCount == inSamples;
-}
-
-bool CResourceTexture2DArray::EnsureTexture(QT3DSU32 width, QT3DSU32 height, QT3DSU32 slices,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples)
-{
- if (TextureMatches(width, height, slices, inFormat, inSamples))
- return false;
-
- if (m_Texture && inSamples > 1) {
- // we cannot resize MSAA textures though release first
- ReleaseTexture();
- }
-
- if (!m_Texture)
- m_Texture =
- m_ResourceManager.AllocateTexture2DArray(width, height, slices, inFormat, inSamples);
- else {
- // multisampled textures are immuteable
- QT3DS_ASSERT(inSamples == 1);
- m_Texture->SetTextureData(NVDataRef<QT3DSU8>(), 0, width, height, slices, inFormat);
- }
-
- m_TextureDetails = m_Texture->GetTextureDetails();
- return true;
-}
-
-void CResourceTexture2DArray::ReleaseTexture()
-{
- if (m_Texture) {
- m_ResourceManager.Release(*m_Texture);
- m_Texture = NULL;
- }
-}
-
-void CResourceTexture2DArray::StealTexture(CResourceTexture2DArray &inOther)
-{
- ReleaseTexture();
- m_Texture = inOther.m_Texture;
- m_TextureDetails = inOther.m_TextureDetails;
- inOther.m_Texture = NULL;
-}
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.h b/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.h
deleted file mode 100644
index eb54713a..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/resourcemanager/Qt3DSRenderResourceTexture2D.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_RENDER_RESOURCE_TEXTURE_2D_H
-#define QT3DS_RENDER_RESOURCE_TEXTURE_2D_H
-#include "Qt3DSRender.h"
-#include "render/Qt3DSRenderContext.h"
-#include "render/Qt3DSRenderTexture2D.h"
-#include "render/Qt3DSRenderTexture2DArray.h"
-#include "Qt3DSRenderResourceManager.h"
-
-namespace qt3ds {
-namespace render {
- class CResourceTexture2D
- {
- protected:
- IResourceManager &m_ResourceManager;
- NVRenderTexture2D *m_Texture;
- STextureDetails m_TextureDetails;
-
- public:
- CResourceTexture2D(IResourceManager &mgr, NVRenderTexture2D *inTexture = NULL);
- // create and allocate the texture right away.
- CResourceTexture2D(IResourceManager &mgr, QT3DSU32 width, QT3DSU32 height,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples = 1);
- ~CResourceTexture2D();
- // Returns true if the texture matches the specs, false if the texture needs to be
- // reallocated
- bool TextureMatches(QT3DSU32 width, QT3DSU32 height, NVRenderTextureFormats::Enum inFormat,
- QT3DSU32 inSamples = 1);
-
- // Returns true if the texture was allocated, false if nothing changed (no allocation).
- // Note this is the exact opposite of TextureMatches.
- bool EnsureTexture(QT3DSU32 width, QT3DSU32 height, NVRenderTextureFormats::Enum inFormat,
- QT3DSU32 inSamples = 1);
-
- // Force release the texture.
- void ReleaseTexture();
- NVRenderTexture2D &operator*()
- {
- QT3DS_ASSERT(m_Texture);
- return *m_Texture;
- }
- NVRenderTexture2D *operator->()
- {
- QT3DS_ASSERT(m_Texture);
- return m_Texture;
- }
- operator NVRenderTexture2D *() { return m_Texture; }
- NVRenderTexture2D *GetTexture() { return m_Texture; }
- void ForgetTexture();
- // Enforces single ownership rules.
- void StealTexture(CResourceTexture2D &inOther);
- };
-
- class CResourceTexture2DArray
- {
- protected:
- IResourceManager &m_ResourceManager;
- qt3ds::render::NVRenderTexture2DArray *m_Texture;
- STextureDetails m_TextureDetails;
-
- public:
- CResourceTexture2DArray(IResourceManager &mgr);
- // create and allocate the texture right away.
- CResourceTexture2DArray(IResourceManager &mgr, QT3DSU32 width, QT3DSU32 height, QT3DSU32 slices,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples = 1);
- ~CResourceTexture2DArray();
- // Returns true if the texture matches the specs, false if the texture needs to be
- // reallocated
- bool TextureMatches(QT3DSU32 width, QT3DSU32 height, QT3DSU32 slices,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples = 1);
-
- // Returns true if the texture was allocated, false if nothing changed (no allocation).
- // Note this is the exact opposite of TextureMatches.
- bool EnsureTexture(QT3DSU32 width, QT3DSU32 height, QT3DSU32 slices,
- NVRenderTextureFormats::Enum inFormat, QT3DSU32 inSamples = 1);
-
- // Force release the texture.
- void ReleaseTexture();
- qt3ds::render::NVRenderTexture2DArray &operator*()
- {
- QT3DS_ASSERT(m_Texture);
- return *m_Texture;
- }
- qt3ds::render::NVRenderTexture2DArray *operator->()
- {
- QT3DS_ASSERT(m_Texture);
- return m_Texture;
- }
- operator qt3ds::render::NVRenderTexture2DArray *() { return m_Texture; }
- qt3ds::render::NVRenderTexture2DArray *GetTexture() { return m_Texture; }
- // Enforces single ownership rules.
- void StealTexture(CResourceTexture2DArray &inOther);
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/runtimerender/windows/DynamicLibLoader.h b/src/Runtime/ogl-runtime/src/runtimerender/windows/DynamicLibLoader.h
deleted file mode 100644
index 09b028bc..00000000
--- a/src/Runtime/ogl-runtime/src/runtimerender/windows/DynamicLibLoader.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_WINDOWS_DYNAMIC_LIB_LOADER_H
-#define QT3DS_WINDOWS_DYNAMIC_LIB_LOADER_H
-
-#include "foundation/Qt3DSFoundation.h"
-#include "foundation/Qt3DSBroadcastingAllocator.h"
-
-#include <QLibrary>
-
-namespace qt3ds {
-namespace render {
- using namespace qt3ds;
- // using namespace qt3ds::render;
-
- class CLoadedDynamicLibrary
- {
- QLibrary* m_DLLHandle;
- CLoadedDynamicLibrary(QLibrary* hdl)
- : m_DLLHandle(hdl)
- {
- }
- CLoadedDynamicLibrary(const CLoadedDynamicLibrary &);
- CLoadedDynamicLibrary &operator=(const CLoadedDynamicLibrary &);
-
- public:
- ~CLoadedDynamicLibrary()
- {
- if (m_DLLHandle) {
- m_DLLHandle->unload();
- delete m_DLLHandle;
- }
- m_DLLHandle = 0;
- }
- void *FindFunction(const char *name) { return (void*)m_DLLHandle->resolve(name); }
- static CLoadedDynamicLibrary *Create(const char *inFullDllPath, NVFoundationBase &fnd)
- {
- QLibrary* hdl = new QLibrary(inFullDllPath);
- if (!hdl->load()) {
- qCCritical(INVALID_OPERATION, "Failed to load dynamic library %s: %s",
- inFullDllPath, qPrintable(hdl->errorString()));
-
- delete hdl;
- return nullptr;
- }
- return QT3DS_NEW(fnd.getAllocator(), CLoadedDynamicLibrary)(hdl);
- }
- };
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/src.pro b/src/Runtime/ogl-runtime/src/src.pro
deleted file mode 100644
index 0cb56c88..00000000
--- a/src/Runtime/ogl-runtime/src/src.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS += \
- 3rdparty \
- dm \
- qmlstreamer \
- ogl-runtime-static \
- ogl-runtime-dylib \
- api
diff --git a/src/Runtime/ogl-runtime/src/state/Qt3DSState.h b/src/Runtime/ogl-runtime/src/state/Qt3DSState.h
deleted file mode 100644
index 7f10f941..00000000
--- a/src/Runtime/ogl-runtime/src/state/Qt3DSState.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_STATE_H
-#define QT3DS_STATE_H
-
-namespace qt3ds {
-class NVAllocatorCallback;
-class NVFoundationBase;
-namespace foundation {
- class CRegisteredString;
- class IStringTable;
- class IOutStream;
- class IInStream;
- class IDOMFactory;
- struct SDOMAttribute;
- struct SDOMElement;
- struct SNamespacePairNode;
- class SocketStream;
-}
-
-namespace intrinsics {
-}
-}
-
-namespace qt3ds {
-namespace state {
-
- using namespace qt3ds;
- using namespace qt3ds::foundation;
- using namespace qt3ds::intrinsics;
- using qt3ds::foundation::CRegisteredString;
- using qt3ds::foundation::IStringTable;
- class IStateContext;
- class IStateInterpreter;
- class IStateLogger;
- class IExecutionContext;
- class IScriptContext;
- struct SSCXML;
- struct SState;
- struct STransition;
- struct SParallel;
- struct SFinal;
- struct SHistory;
- struct SOnEntry;
- struct SOnExit;
- struct SSend;
- struct SRaise;
- struct SIf;
- struct SElseIf;
- struct SElse;
- struct SLog;
- struct SAssign;
- struct SScript;
- struct SDataModel;
- struct SData;
- struct SStateNode;
- struct SCancel;
-
- namespace editor {
- class IEditor;
- class IEditorObject;
- }
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/state/Qt3DSStateScriptContext.h b/src/Runtime/ogl-runtime/src/state/Qt3DSStateScriptContext.h
deleted file mode 100644
index 49b119ea..00000000
--- a/src/Runtime/ogl-runtime/src/state/Qt3DSStateScriptContext.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QT3DS_STATE_SCRIPT_CONTEXT_H
-#define QT3DS_STATE_SCRIPT_CONTEXT_H
-#pragma once
-#include "Qt3DSState.h"
-#include "Qt3DSStateTypes.h"
-#include "foundation/Qt3DSRefCounted.h"
-#include "foundation/Qt3DSOption.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace state {
-
- class IScriptEvent : public IEvent
- {
- public:
- // returns true on success, false if error.execution should be signaled.
- virtual bool SetParam(CRegisteredString inName, const char8_t *inExpression) = 0;
- // Sets the expression as a string
- virtual bool SetParamStr(CRegisteredString inName, const char8_t *inStr) = 0;
- virtual bool SetDataExpr(const char8_t *inExpression) = 0;
- virtual bool SetDataStr(const char8_t *inStr) = 0;
- };
-
- struct SScriptExecutionResult
- {
- const char8_t *m_Result;
- const char8_t *m_Error;
- SScriptExecutionResult(const char8_t *inData, const char8_t *inError)
- : m_Result(inData)
- , m_Error(inError)
- {
- }
- SScriptExecutionResult()
- : m_Result("")
- , m_Error("")
- {
- }
- bool Valid() const { return m_Error == NULL || *m_Error == 0; }
- const char8_t *Result() const
- {
- QT3DS_ASSERT(Valid());
- return m_Result;
- }
- const char8_t *Error() const
- {
- QT3DS_ASSERT(!Valid());
- return m_Error;
- }
- };
-
- class IScriptContext : public NVRefCounted
- {
- protected:
- virtual ~IScriptContext() {}
- public:
- // Should functions returning options return othing
- virtual Option<bool> ExecuteCondition(const char8_t *inCond) = 0;
- // Used for logging.
- // Error and result are good until next call into the script context.
- virtual SScriptExecutionResult ExecuteExpressionToString(const char8_t *inExpr) = 0;
-
- // If return value is false, error is signaled with GetErrorInfo.
- virtual bool Assign(const char8_t *inVariable, const char8_t *inExpr) = 0;
- // Assign a string to this variable location.
- virtual void AssignStr(const char8_t *inVariable, const char8_t *inStr) = 0;
-
- // If return value is false, error is signaled via GetErrorInfo.
- // The actual pointer and content used for inscript is expected to not change during
- // execution of the system.
- // it is legal for contexts to cache information based off the script pointer value.
- virtual bool ExecuteScript(const char8_t *inScript) = 0;
- // Always return 1 result
- virtual int ExecuteStr(const char8_t *inScript, bool withRet) = 0;
-
- // Return true on success, false on failure, and Empty on error.
- virtual Option<bool> BeginForeach(const char8_t *inArray, const char8_t *inItem,
- const char8_t *inIdxVar = "") = 0;
- virtual Option<bool> NextForeach(const char8_t *inItem, const char8_t *inIdxVar = "") = 0;
- virtual void CancelForeach() = 0;
-
- virtual void SetCurrentEvent(TEventPtr inEvent) = 0;
- virtual void ClearCurrentEvent() = 0;
- // Create an event we can attach extra data do.
- virtual IScriptEvent *CreateScriptEvent(CRegisteredString inName) = 0;
-
- virtual const char8_t *GetErrorInfo() = 0;
-
- virtual void SetInterpreter(IStateInterpreter &inInterpreter) = 0;
-
- virtual CRegisteredString GetContextType() { return CRegisteredString(); }
- };
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/state/Qt3DSStateTypes.h b/src/Runtime/ogl-runtime/src/state/Qt3DSStateTypes.h
deleted file mode 100644
index 26aee0e0..00000000
--- a/src/Runtime/ogl-runtime/src/state/Qt3DSStateTypes.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_STATE_TYPES_H
-#define QT3DS_STATE_TYPES_H
-#include "Qt3DSState.h"
-#include "foundation/StringTable.h"
-#include "foundation/Qt3DSInvasiveLinkedList.h"
-#include "foundation/Qt3DSFlags.h"
-#include "foundation/Qt3DSDataRef.h"
-#include "foundation/Qt3DSContainers.h"
-#include "foundation/StringTable.h"
-#include "foundation/TaggedPointer.h"
-#include "foundation/Qt3DSVec2.h"
-#include "foundation/Qt3DSVec3.h"
-#include "foundation/Qt3DSAtomic.h"
-#include "foundation/Utils.h"
-
-namespace qt3ds {
-namespace state {
- // Events, because they created both inside and outside
- // the state system by various parties.
- class IEvent : public NVRefCounted
- {
- protected:
- virtual ~IEvent() {}
- public:
- virtual CRegisteredString GetName() const = 0;
- // Optional type string for rtti. No string means this is an opaque event
- // that cannot be safely cast to any specific event type.
- virtual CRegisteredString GetEventType() const { return CRegisteredString(); }
- };
-
- typedef NVScopedRefCounted<IEvent> TEventPtr;
-
- DEFINE_INVASIVE_SINGLE_LIST(Data);
-
- struct SDataModel
- {
- CRegisteredString m_Id;
- const char8_t *m_Source;
- const char8_t *m_Expression;
- TDataList m_Data;
-
- SDataModel()
- : m_Source(nullptr)
- , m_Expression(nullptr)
- {
- }
- };
-
- struct SData
- {
- CRegisteredString m_Id;
- const char8_t *m_Source;
- const char8_t *m_Expression;
- SData *m_NextSibling;
- SData()
- : m_Source(nullptr)
- , m_Expression(nullptr)
- , m_NextSibling(nullptr)
- {
- }
- };
-
- IMPLEMENT_INVASIVE_SINGLE_LIST(Data, m_NextSibling);
-}
-}
-
-#endif
diff --git a/src/Runtime/ogl-runtime/src/state/Qt3DSStateVisualBindingContextCommands.h b/src/Runtime/ogl-runtime/src/state/Qt3DSStateVisualBindingContextCommands.h
deleted file mode 100644
index 4d08f695..00000000
--- a/src/Runtime/ogl-runtime/src/state/Qt3DSStateVisualBindingContextCommands.h
+++ /dev/null
@@ -1,348 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#ifndef QT3DS_STATE_VISUAL_BINDING_CONTEXT_COMMANDS_H
-#define QT3DS_STATE_VISUAL_BINDING_CONTEXT_COMMANDS_H
-#include "Qt3DSState.h"
-#include "foundation/StringTable.h"
-
-namespace qt3ds {
-namespace state {
-
- struct VisualStateCommandTypes
- {
- enum Enum {
- NoVisualStateCommand = 0,
- GotoSlide,
- CallFunction,
- SetAttribute,
- GotoSlideRelative,
- FireEvent,
- PresentationAttribute,
- PlaySound,
- };
- };
-
- struct SlidePlaybackModes
- {
- enum Enum {
- StopAtEnd = 0,
- Looping,
- PingPong,
- Ping,
- PlaythroughTo,
- };
- };
-
- struct SGotoSlideData
- {
- Option<SlidePlaybackModes::Enum> m_Mode;
- Option<CRegisteredString> m_PlaythroughTo;
- Option<QT3DSU32> m_StartTime;
- QT3DSF32 m_Rate;
- bool m_Reverse;
- Option<bool> m_Paused;
- SGotoSlideData()
- : m_Rate(1.0f)
- , m_Reverse(false)
- {
- }
- };
-
- // All the element references in this file need to be absolute, meaning they
- // must begin with a presentationid:. The is because the state machine exists at the
- // application level where all presentations are pretty much equal and must be referenced
- // by id.
-
- // Go to a particular slide.
-
- /*
- a. If the slide attribute references a slide name not present on the time context an error must
- be logged each time the executable would have been run, and the executable ignored.
- b. If the time context is already on the slide referenced, no change is made to the time
- context.
- The slide does not restart. */
- struct SGotoSlide
- {
- CRegisteredString m_Component;
- CRegisteredString m_Slide;
- SGotoSlideData m_GotoSlideData;
- SGotoSlide(CRegisteredString cmd = CRegisteredString(),
- CRegisteredString slide = CRegisteredString())
- : m_Component(cmd)
- , m_Slide(slide)
- {
- }
- bool operator==(const SGotoSlide &inOther) const
- {
- return m_Component == inOther.m_Component && m_Slide == inOther.m_Slide;
- }
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_Component);
- inRemapper.Remap(m_Slide);
- }
- };
-
- /*
- 1. A <call.../> executable must have a element="..." attribute that references a behavior
- element in one of the presentation assets for the application.
- a. If the element attribute is missing, or references an element that cannot be found,
- an error must be logged each time the executable would have been run, and the executable
- ignored.
- b. If the element attribute references an element that is not a behavior then an error
- must be logged each time the executable would have been run, and the executable ignored.
- 2. A <call.../> executable must have a handler="..." attribute that references a function value
- in the table associated with the behavior element.
- a. If the handler attribute is missing, or references a value that is not a function
- value, an error must be logged each time the executable would have been run, and the executable
- ignored.
- 3. A <call.../> executable may have an args="..." attribute that specifies an expression to
- evaluate.
- a. If the result of evaluating this expression is a single value, it is passed as the
- first argument to the behavior's function.
- b. If the result of evaluating this expression is a table, it is treated as a list that
- is unpack'd, the numeric properties sent as arguments in order.
- c. If the result of evaluating this expression is an error, an error message must be
- logged and the executable ignored.
- The function is not invoked with no parameters.
- */
- struct SCallFunction
- {
- CRegisteredString m_Behavior;
- CRegisteredString m_Handler;
- CRegisteredString m_Arguments;
- SCallFunction(CRegisteredString behavior = CRegisteredString(),
- CRegisteredString hdler = CRegisteredString(),
- CRegisteredString args = CRegisteredString())
- : m_Behavior(behavior)
- , m_Handler(hdler)
- , m_Arguments(args)
- {
- }
- bool operator==(const SCallFunction &inOther) const
- {
- return m_Behavior == inOther.m_Behavior && m_Handler == inOther.m_Handler
- && m_Arguments == inOther.m_Arguments;
- }
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_Behavior);
- inRemapper.Remap(m_Handler);
- inRemapper.Remap(m_Arguments);
- }
- };
-
- /*
- 1. A <set-attribute.../> executable must have an element="..." attribute that references an
- element in one of the presentation assets for the application.
- a. If the element attribute is missing, or references an element that cannot be found,
- an error must be logged each time the executable would have been run, and the executable
- ignored.
- 2. A <set-attribute.../> executable must have an attribute="..." attribute that references an
- attribute on the referenced element.
- a. If the attribute attribute is missing, or references an attribute not present on the
- element, an error must be logged each time the executable would have been run, and the
- executable ignored.
- 3. A <set-attribute.../> executable must have an value="..." attribute that describes the value
- to set.
- a. The contents of this attribute are evaluated as an expression and the result used
- to set the attribute.
- i. If the result of evaluating this expression does not match the type of the
- attribute on the element then an error must be logged and the executable ignored.
- 4. If a single visual state has both <goto-slide/> and <set-attribute/> executables, and the
- slide change affects the same attribute as the set-attribute executable, then the set-attribute
- executable must take effect (be applied after the slide change occurs).
- In the future we may wish to have the order of this interaction controllable by the
- ordering of the executables.
- */
- struct SSetAttribute
- {
- CRegisteredString m_Element;
- CRegisteredString m_Attribute;
- CRegisteredString m_Value;
- SSetAttribute(CRegisteredString elem = CRegisteredString(),
- CRegisteredString att = CRegisteredString(),
- CRegisteredString val = CRegisteredString())
- : m_Element(elem)
- , m_Attribute(att)
- , m_Value(val)
- {
- }
- bool operator==(const SSetAttribute &inOther) const
- {
- return m_Element == inOther.m_Element && m_Attribute == inOther.m_Attribute
- && m_Value == inOther.m_Value;
- }
-
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_Element);
- inRemapper.Remap(m_Attribute);
- inRemapper.Remap(m_Value);
- }
- };
-
- /*
- 4. A rel="..." attribute must have either the value next or prev.
- a. If the rel attribute has a different value an error must be logged each time the
- executable would have been run, and the executable ignored.
- b. A value of next causes the time context to go to the next slide.
- i. If the time context is at the last slide, and there is no wrap attribute, or
- the wrap attribute does not have a value of true, then no change occurs to the time context.
- The slide does not restart.
- ii. If the time context is at the last slide and there exists a wrap attribute
- with a value of true then the time context is taken to the first slide.
- c. A value of prev causes the time context to go to the previous slide.
- i. If the time context is at the first slide, and there is no wrap attribute, or
- the wrap attribute does not have a value of true, then no change occurs to the time context.
- The slide does not restart.
- ii. If the time context is at the last first and there exists a wrap attribute
- with a value of true then the time context is taken to the last slide.
- */
- struct SGotoSlideRelative
- {
- CRegisteredString m_Component;
- enum Enum {
- Next = 0,
- Previous,
- Error,
- };
- Enum m_Direction;
- bool m_Wrap;
- SGotoSlideData m_GotoSlideData;
- SGotoSlideRelative(CRegisteredString comp = CRegisteredString(), Enum dir = Next,
- bool wrap = false)
- : m_Component(comp)
- , m_Direction(dir)
- , m_Wrap(wrap)
- {
- }
- bool operator==(const SGotoSlideRelative &inOther) const
- {
- return m_Component == inOther.m_Component && m_Direction == inOther.m_Direction
- && m_Wrap == inOther.m_Wrap;
- }
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_Component);
- }
- };
-
- /*
- 1. A <fire-event.../> executable must have an element="..." attribute that references an element
- in one of the presentation assets for the application.
- a. If the element attribute is missing, or references an element that cannot be found,
- an error must be logged each time the executable would have been run, and the executable
- ignored.
- 2. A <fire-event.../> executable must have an event="..." attribute that describes the event
- name to fire.
- a. If the event attribute is missing an error must be logged each time the executable
- would have been run, and the executable ignored.
- */
- struct SFireEvent
- {
- CRegisteredString m_Element;
- CRegisteredString m_Event;
- SFireEvent(CRegisteredString elem, CRegisteredString evt)
- : m_Element(elem)
- , m_Event(evt)
- {
- }
- SFireEvent() {}
- bool operator==(const SFireEvent &inOther) const
- {
- return m_Element == inOther.m_Element && m_Event == inOther.m_Event;
- }
-
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_Element);
- inRemapper.Remap(m_Event);
- }
- };
-
- struct SPresentationAttribute
- {
- CRegisteredString m_Presentation;
- CRegisteredString m_Attribute;
- CRegisteredString m_Value;
- SPresentationAttribute(CRegisteredString pres, CRegisteredString att, CRegisteredString val)
- : m_Presentation(pres)
- , m_Attribute(att)
- , m_Value(val)
- {
- }
- SPresentationAttribute() {}
- bool operator==(const SPresentationAttribute &inOther) const
- {
- return m_Presentation == inOther.m_Presentation && m_Attribute == inOther.m_Attribute
- && m_Value == inOther.m_Value;
- }
-
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_Presentation);
- inRemapper.Remap(m_Attribute);
- inRemapper.Remap(m_Value);
- }
- };
-
- struct SPlaySound
- {
- CRegisteredString m_SoundFilePath;
- SPlaySound(CRegisteredString inSoundFilePath)
- : m_SoundFilePath(inSoundFilePath)
- {
- }
- SPlaySound() {}
- bool operator==(const SPlaySound &inOther) const
- {
- return m_SoundFilePath == inOther.m_SoundFilePath;
- }
-
- template <typename TRemapper>
- void Remap(TRemapper &inRemapper)
- {
- inRemapper.Remap(m_SoundFilePath);
- }
- };
-
- // defined in UICStateVisualBindingContextValues.h
- struct SVisualStateCommand;
-}
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSArray.h b/src/Runtime/ogl-runtime/src/system/Qt3DSArray.h
deleted file mode 100644
index 805b8b0a..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSArray.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSMemorySettings.h"
-#include "Qt3DSMemory.h"
-#include "Qt3DSPlatformSpecific.h"
-
-#ifdef WIN32
-#pragma warning(disable : 4625) // copy constructor could not be generated because a base class copy
- // constructor is inaccessible
-#pragma warning(disable : 4626) // assignment operator could not be generated because a base class
- // assignment operator is inaccessible
-#endif
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants
-//==============================================================================
-#define NVARRAY_NOTFOUND -1
-
-//==============================================================================
-/**
- * Ordered Collection also knows as a vector.
- *
- * Use Reserve or the constructor parameter if you know how many slots
- * will be needed to prevent frequent reallocations during growth.
- *
- * The array grows by DEFAULT_GROWFACTOR aka 20% whenever it overflows. By
- * setting the factor to 0 it will still clamp to 1 and instead grow the
- * array by one slot at a time. This is not ideal but given a pooled memory
- * manager you will not thrash memory too much since you will grow inside
- * each pool chunk and only reallocate when switching pools.
- *
- * Naming of CArray instances are used to enable memory tracking of arrays
- * that have gone berzerk or less frequently used instances that could be
- * released after usage.
- *
- * The FOR_ARRAY macro is the preferred way to process all array slots.
- */
-template <class T>
-class CArray
-{
-//==============================================================================
-// Constants
-//==============================================================================
-#define DEFAULT_GROWFACTOR 1.2f
-
- //==============================================================================
- // Types
- //==============================================================================
-public:
- typedef T TType; ///< Easy access to template type
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- CHAR m_Name[32]; ///< Allows easy ID using memory reporting
- T *m_Data; ///< Allocated memory containing array data
- INT32 m_Capacity; ///< Max number of slots possible
- INT32 m_Count; ///< Current number of slots in array
- FLOAT m_GrowFactor; ///< Factor by which array grows when out of space
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- inline CArray(const INT32 inCapacity = 0, const FLOAT inGrowFactor = DEFAULT_GROWFACTOR,
- const CHAR *inName = NULL);
- inline CArray(const CArray<T> &);
- inline ~CArray();
-
-public: // Management
- inline void SetName(const CHAR *inName = NULL);
- inline INT32 GetCount() const;
- inline INT32 GetCapacity() const;
- inline void Clear(const BOOL inRelease = true);
- inline void Reserve(const INT32 inCapacity, const BOOL inExpand = false);
-
-public: // Stack access
- void Push(const T &inValue);
- inline const T &Pop();
- inline const T &Top() const;
-
-public: // Random access
- inline INT32 GetIndex(const T &inValue) const;
- inline T &operator[](const INT32 inIndex) const;
- inline void Remove(const INT32 inIndex);
-
-public: // FOR_ARRAY iteration
- inline T *Begin() const;
- inline T *End() const;
-
-private: // Disabled Copy Construction
- inline CArray<T> &operator=(const CArray<T> &);
-};
-
-} // namespace Q3DStudio
-
-//==============================================================================
-// Template code
-//==============================================================================
-#include "Qt3DSArray.inl"
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSArray.inl b/src/Runtime/ogl-runtime/src/system/Qt3DSArray.inl
deleted file mode 100644
index a9667fd2..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSArray.inl
+++ /dev/null
@@ -1,287 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2007 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- *
- * @param inCapacity preallocated number of slots to avoid growth reallocation
- * @param inGrowFactor factor by which the array grows when out of space
- * @param inName 32 byte unique identifier for memory tracking
- */
-template <typename T> inline
-CArray<T>::CArray( const INT32 inCapacity, const FLOAT inGrowFactor, const CHAR* inName ) :
- m_Data( NULL ),
- m_Capacity( 0 ),
- m_Count( 0 ),
- m_GrowFactor( inGrowFactor )
-{
- // Disallow negative growth
- if ( m_GrowFactor < 1.0f )
- m_GrowFactor = DEFAULT_GROWFACTOR;
-
- SetName( inName );
- Reserve( inCapacity );
-}
-
-//==============================================================================
-/**
- * Berger's Copy Constructor.
- */
-template <typename T> inline
-CArray<T>::CArray( const CArray<T>& inOther ) :
- m_Data( NULL ),
- m_Capacity( 0 ),
- m_Count( 0 ),
- m_GrowFactor( inOther.m_GrowFactor )
-{
- // Disallow negative growth
- if ( m_GrowFactor < 1.0f )
- m_GrowFactor = DEFAULT_GROWFACTOR;
-
- SetName( inOther.m_Name );
- Reserve( inOther.m_Capacity );
- FOR_ARRAY( T, theTemp, inOther )
- {
- Push( *theTemp );
- }
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-template <class T> inline
-CArray<T>::~CArray( )
-{
- Clear( true );
-}
-
-//==============================================================================
-/**
- * Name an array instance to easily identify it during memory reporting.
- * @param inName 32 byte unique identifier
- */
-template <class T> inline
-void CArray<T>::SetName( const CHAR* inName /*= NULL*/ )
-{
- Q3DStudio_sprintf( m_Name, sizeof( m_Name ), "%s", inName ? inName : "CArray<T>" );
-}
-
-//==============================================================================
-/**
- * Count is the number of elements in the array.
- * @return current count of the array
- */
-template <class T> inline
-INT32 CArray<T>::GetCount( ) const
-{
- return m_Count;
-}
-
-//==============================================================================
-/**
- * Get the capacity of the array
- * Capacity reflects the max count before reallocation happens.
- * @return capacity of the array
- */
-template <class T> inline
-INT32 CArray<T>::GetCapacity( ) const
-{
- return m_Capacity;
-}
-
-//==============================================================================
-/**
- * Clear the array by reducing the number of elements to zero.
- *
- * Using the release flag keeps the memory load low but could be
- * suboptimal in situations where you are always using roughly the same
- * number of elements. In that scenario, the array would have to build up
- * and reallocate up to the same number of elements every time causing
- * stress on the system. Clearing but keeping the buffer by setting
- * release to false is optimal in that case.
- *
- * @param inRelease true to release memory, false keeps old buffer
- */
-template <class T> inline
-void CArray<T>::Clear( const BOOL inRelease )
-{
- m_Count = 0;
-
- if ( inRelease )
- {
- Q3DStudio_free( m_Data, T, m_Capacity );
- m_Capacity = 0;
- m_Data = NULL;
- }
- else
- Q3DStudio_memset( m_Data, 0 , sizeof( T ) * m_Capacity );
-}
-
-//==============================================================================
-/**
- * Allocate enough memory to store T.
- *
- * If current memory is not sufficient, new block of memory is allocated and
- * data in current memory is copied to the new block of memory. Data pointer will
- * point to the new block of memory and current memory is released.
- *
- * @param inCapacity indicate the amount of memory required.
- * @param inExpand true to not only allocate but also extend array
- */
-template <class T> inline
-void CArray<T>::Reserve( const INT32 inCapacity, const BOOL inExpand )
-{
- if ( inCapacity > m_Capacity )
- {
- T* theData = Q3DStudio_allocate_desc( T, inCapacity, m_Name );
- Q3DStudio_memset( theData, 0 , sizeof( T ) * inCapacity );
- if ( m_Data != NULL )
- {
- Q3DStudio_memcpy( theData, m_Data, sizeof( T ) * m_Count );
- Q3DStudio_free( m_Data, T, m_Capacity );
- }
- m_Data = theData;
- m_Capacity = inCapacity;
- }
-
- if ( inExpand )
- m_Count = inCapacity;
-}
-
-//==============================================================================
-/**
- * Insert T to the end of the array
- * @param inValue value of datatype T
- */
-template <class T> inline
-void CArray<T>::Push( const T& inValue )
-{
- if ( m_Count == m_Capacity )
- Reserve( static_cast<INT32>( m_GrowFactor * m_Capacity ) + 1 );
-
- m_Data[m_Count++] = inValue;
-}
-
-//==============================================================================
-/**
- * Remove and retrieve T which is at the end of the array
- * @return value of datatype T
- */
-template <class T> inline
-const T& CArray<T>::Pop( )
-{
- return m_Data[--m_Count];
-}
-
-//==============================================================================
-/**
- * Get T which is at the end of the array
- * @return reference of value of datatype T
- */
-template <class T> inline
-const T& CArray<T>::Top( ) const
-{
- return m_Data[m_Count - 1];
-}
-
-//==============================================================================
-/**
- * Get index of first element that matches inValue
- * @return index of element matching T or INDEX_NOTFOUND
- */
-template <class T> inline
-INT32 CArray<T>::GetIndex( const T& inValue ) const
-{
- for ( INT32 theIndex = 0; theIndex < m_Count; ++theIndex )
- if ( inValue == m_Data[theIndex] )
- return theIndex;
- return NVARRAY_NOTFOUND;
-}
-
-//==============================================================================
-/**
- * Get the element at a particular index position of the array.
- * @note Range checking is only done is debug builds.
- * @param inIndex the index of the array
- * @return reference of value of datatype T
- */
-template <class T> inline
-T& CArray<T>::operator[]( const INT32 inIndex ) const
-{
- Q3DStudio_ASSERT( inIndex >= 0 && inIndex < m_Capacity );
- return m_Data[inIndex];
-}
-
-//==============================================================================
-/**
- * Remove T that resides at a particular index position of the array.
- * Other T data with higher index value is shifted to occupy the empty slot
- * created in the removal process.
- * @param inIndex the index of the array
- */
-template <class T> inline
-void CArray<T>::Remove( const INT32 inIndex )
-{
- Q3DStudio_memmove( m_Data + inIndex, m_Data + inIndex + 1, sizeof( T ) * ( m_Count - inIndex - 1 ) );
- --m_Count;
-}
-
-//==============================================================================
-/**
- * Get T at the first index of the array.
- * Mainly used for FOR_ARRAY macro implementation
- * @return pointer to first value in array
- */
-template <class T> inline
-T* CArray<T>::Begin( ) const
-{
- return m_Data;
-}
-
-//==============================================================================
-/**
- * Get T at the last index of the array.
- * Mainly used for FOR_ARRAY macro implementation
- * @return pointer to one beyond last value in array
- */
-template <class T> inline
-T* CArray<T>::End( ) const
-{
- return m_Data + m_Count;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSAssert.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSAssert.cpp
deleted file mode 100644
index 63d38768..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSAssert.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSAssert.h"
-#include "foundation/Qt3DSLogging.h"
-//==============================================================================
-// Platform Specific Includes
-//==============================================================================
-#if defined(_PCPLATFORM)
-#pragma warning(push, 3)
-#include <Windows.h>
-#include <crtdbg.h>
-#pragma warning(pop)
-#endif // #if defined (_PCPLATFORM)
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Global Variables
-//==============================================================================
-CAssert::TFunction CAssert::s_AssertFunction = CAssert::Default; ///< Default assert function
-
-//==============================================================================
-/**
- * Default method for asserts
- */
-void CAssert::Default(const CHAR *inAssert, const CHAR *inFile, INT32 inLine,
- const CHAR *inFunction)
-{
- // Use logger to report the string first
- qCCritical (qt3ds::INTERNAL_ERROR) << "Assertion failed: " << inFile << " " << inLine
- << " " << inAssert << " " << inFunction;
-
-#if defined(_DEBUG) && defined(_PCPLATFORM) && defined(QT3DS_VC)
- if (_CrtDbgReport(_CRT_ASSERT, inFile, inLine, inFunction, "Assertion Failed") == 1)
- ::DebugBreak();
-#endif // _DEBUG & _PCPLATFORM
-}
-
-//==============================================================================
-/**
- * Method for setting the assert function
- */
-void CAssert::SetFunction(TFunction inAssert)
-{
- s_AssertFunction = inAssert;
-}
-
-//==============================================================================
-/**
- * Method for getting the assert function
- */
-CAssert::TFunction CAssert::GetFunction()
-{
- return s_AssertFunction;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSAssert.h b/src/Runtime/ogl-runtime/src/system/Qt3DSAssert.h
deleted file mode 100644
index a64ca7f6..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSAssert.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSTypes.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Static gateway for all asserts.
- *
- * By setting your own assert function you can redirect all Runtime asserts.
- * By default it uses the internal Default method that uses CLog for output
- * and displays a dialog on Windows PCs.
- */
-class CAssert
-{
- //==============================================================================
- // Typedefs
- //==============================================================================
-public:
- typedef void (*TFunction)(const Q3DStudio::CHAR *inAssert, const Q3DStudio::CHAR *inFile,
- Q3DStudio::INT32 inLine, const Q3DStudio::CHAR *inFunction);
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- static TFunction s_AssertFunction; ///< Function pointer to active assert function
-
- //==============================================================================
- // Methods
- //==============================================================================
-private: // Hidden Constructor
- CAssert();
-
-public: // Static Usage
- static void Default(const Q3DStudio::CHAR *inAssert, const Q3DStudio::CHAR *inFile,
- Q3DStudio::INT32 inLine, const Q3DStudio::CHAR *inFunction);
-
-public: // Static Configuration
- static void SetFunction(TFunction inAssert);
- static TFunction GetFunction();
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSAudioPlayer.h b/src/Runtime/ogl-runtime/src/system/Qt3DSAudioPlayer.h
deleted file mode 100644
index 3b6f3ef8..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSAudioPlayer.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008-2012 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-namespace Q3DStudio {
-
-class IAudioPlayer
-{
-public:
- virtual ~IAudioPlayer() {}
- virtual bool PlaySoundFile(const char *inFilePath) = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSBasicPluginDLL.h b/src/Runtime/ogl-runtime/src/system/Qt3DSBasicPluginDLL.h
deleted file mode 100644
index 63a2d1f6..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSBasicPluginDLL.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//==============================================================================
-// Includes
-//==============================================================================
-#pragma once
-
-#include <QtGlobal>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//==============================================================================
-// Enums
-//==============================================================================
-typedef enum _EDLLSTATUS { EDLLSTATUS_FAIL = 0, EDLLSTATUS_OK } EDLLSTATUS;
-
-// GetPluginType should return this
-typedef enum _EDLLTYPE {
- EDLLTYPE_UNKNOWN = 0,
- EDLLTYPE_RENDERABLE_PLUGIN,
- EDLLTYPE_CUSTOM_OBJECT,
-} EDLLTYPE;
-
-//==============================================================================
-// Function declarations
-//==============================================================================
-
-//==============================================================================
-/**
- * Return the plugin type.
- * @return plugin type
- */
-typedef long (*PROC_GetPluginType)();
-Q_DECL_EXPORT long GetPluginType();
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSBezierEval.h b/src/Runtime/ogl-runtime/src/system/Qt3DSBezierEval.h
deleted file mode 100644
index c4d733a3..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSBezierEval.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Generic Bezier parametric curve evaluation at a given parametric value.
- * @param inP0 control point P0
- * @param inP1 control point P1
- * @param inP2 control point P2
- * @param inP3 control point P3
- * @param inS the variable
- * @return the evaluated value on the bezier curve
- */
-inline FLOAT EvaluateBezierCurve(FLOAT inP0, FLOAT inP1, FLOAT inP2, FLOAT inP3, const FLOAT inS)
-{
- // Using:
- // Q(s) = Sum i=0 to 3 ( Pi * Bi,3(s))
- // where:
- // Pi is a control point and
- // Bi,3 is a basis function such that:
- //
- // B0,3(s) = (1 - s)^3
- // B1,3(s) = (3 * s) * (1 - s)^2
- // B2,3(s) = (3 * s^2) * (1 - s)
- // B3,3(s) = s^3
-
- /* FLOAT theSSquared = inS * inS; //
- t^2
- FLOAT theSCubed = theSSquared * inS; //
- t^3
-
- FLOAT theSDifference = 1 - inS; // (1 -
- t)
- FLOAT theSDifferenceSquared = theSDifference * theSDifference; // (1 -
- t)^2
- FLOAT theSDifferenceCubed = theSDifferenceSquared * theSDifference; // (1 - t)^3
-
- FLOAT theFirstTerm = theSDifferenceCubed; // (1 -
- t)^3
- FLOAT theSecondTerm = ( 3 * inS ) * theSDifferenceSquared; // (3 * t) * (1
- - t)^2
- FLOAT theThirdTerm = ( 3 * theSSquared ) * theSDifference; // (3 * t^2) *
- (1 - t)
- FLOAT theFourthTerm = theSCubed; //
- t^3
-
- // Q(t) = ( p0 * (1 - t)^3 ) + ( p1 * (3 * t) * (1 - t)^2 ) + ( p2 * (3 * t^2) * (1 - t)
- ) + ( p3 * t^3 )
- return ( inP0 * theFirstTerm ) + ( inP1 * theSecondTerm ) + ( inP2 * theThirdTerm ) + (
- inP3 * theFourthTerm );*/
-
- FLOAT theFactor = inS * inS;
- inP1 *= 3 * inS;
- inP2 *= 3 * theFactor;
- theFactor *= inS;
- inP3 *= theFactor;
-
- theFactor = 1 - inS;
- inP2 *= theFactor;
- theFactor *= 1 - inS;
- inP1 *= theFactor;
- theFactor *= 1 - inS;
- inP0 *= theFactor;
-
- return inP0 + inP1 + inP2 + inP3;
-}
-
-//==============================================================================
-/**
- * Inverse Bezier parametric curve evaluation to get parametric value for a given output.
- * This is equal to finding the root(s) of the Bezier cubic equation.
- * @param inP0 control point P0
- * @param inP1 control point P1
- * @param inP2 control point P2
- * @param inP3 control point P3
- * @param inX the variable
- * @return the evaluated value
- */
-inline FLOAT EvaluateInverseBezierCurve(const FLOAT inP0, const FLOAT inP1, const FLOAT inP2,
- const FLOAT inP3, const FLOAT inX)
-{
- FLOAT theResult = 0;
-
- // Using:
- // Q(s) = Sum i=0 to 3 ( Pi * Bi,3(s))
- // where:
- // Pi is a control point and
- // Bi,3 is a basis function such that:
- //
- // B0,3(s) = (1 - s)^3
- // B1,3(s) = (3 * s) * (1 - s)^2
- // B2,3(s) = (3 * s^2) * (1 - s)
- // B3,3(s) = s^3
-
- // The Bezier cubic equation:
- // inX = inP0*(1-s)^3 + inP1*(3*s)*(1-s)^2 + inP2*(3*s^2)*(1-s) + inP3*s^3
- // = s^3*( -inP0 + 3*inP1 - 3*inP2 +inP3 ) + s^2*( 3*inP0 - 6*inP1 + 3*inP2 ) + s*( -3*inP0
- // + 3*inP1 ) + inP0
- // For cubic eqn of the form: c[0] + c[1]*x + c[2]*x^2 + c[3]*x^3 = 0
- FLOAT theConstants[4];
- theConstants[0] = static_cast<FLOAT>(inP0 - inX);
- theConstants[1] = static_cast<FLOAT>(-3 * inP0 + 3 * inP1);
- theConstants[2] = static_cast<FLOAT>(3 * inP0 - 6 * inP1 + 3 * inP2);
- theConstants[3] = static_cast<FLOAT>(-inP0 + 3 * inP1 - 3 * inP2 + inP3);
-
- FLOAT theSolution[3] = { 0 };
-
- if (theConstants[3] == 0) {
- if (theConstants[2] == 0) {
- if (theConstants[1] == 0)
- theResult = 0;
- else
- theResult = -theConstants[0] / theConstants[1]; // linear
- } else {
- // quadratic
- INT32 theNumRoots = CCubicRoots::SolveQuadric(theConstants, theSolution);
- theResult = static_cast<FLOAT>(theSolution[theNumRoots / 2]);
- }
- } else {
- INT32 theNumRoots = CCubicRoots::SolveCubic(theConstants, theSolution);
- theResult = static_cast<FLOAT>(theSolution[theNumRoots / 3]);
- }
-
- return theResult;
-}
-
-inline FLOAT EvaluateBezierKeyframe(FLOAT inTime, FLOAT inTime1, FLOAT inValue1, FLOAT inC1Time,
- FLOAT inC1Value, FLOAT inC2Time, FLOAT inC2Value, FLOAT inTime2,
- FLOAT inValue2)
-{
-
- // The special case of C1Time=0 and C2Time=0 is used to indicate Studio-native animation.
- // Studio uses a simplified version of the bezier animation where the time control points
- // are equally spaced between the starting and ending times. This avoids calling the expensive
- // InverseBezierCurve function to find the right 's' given 't'.
- FLOAT theParameter;
- if (inC1Time == 0 && inC2Time == 0) {
- // Special case signaling that it's ok to treat time as "s"
- // This is done by assuming that Key1Val,Key1C1,Key1C2,Key2Val (aka P0,P1,P2,P3)
- // are evenly distributed over time.
- theParameter = (inTime - inTime1) / (inTime2 - inTime1);
- } else {
- // Compute the "s" parameter on the Bezier given the time
- theParameter = EvaluateInverseBezierCurve(inTime1, inC1Time, inC2Time, inTime2, inTime);
- if (theParameter <= 0.0f)
- return inValue1;
- if (theParameter >= 1.0f)
- return inValue2;
- }
-
- return EvaluateBezierCurve(inValue1, inC1Value, inC2Value, inValue2, theParameter);
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.cpp
deleted file mode 100644
index 2a9331d1..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSBoundingBox.h"
-#include "Qt3DSMatrix.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor - creates an empty BoundingBox
- */
-CBoundingBox::CBoundingBox()
- : m_Min(1.0f, 1.0f, 1.0f)
- , m_Max(-1.0f, -1.0f, -1.0f)
-{
-}
-
-//==============================================================================
-/**
- * Make BoundingBox invalid
- */
-void CBoundingBox::SetEmpty()
-{
- m_Min.Set(1.0f, 1.0f, 1.0f);
- m_Max.Set(-1.0f, -1.0f, -1.0f);
-}
-
-//==============================================================================
-/**
- * Is the BoundingBox empty?
- * @return true if bounding box is empty, false otherwise
- */
-BOOL CBoundingBox::IsEmpty() const
-{
- return (m_Min.m_X > m_Max.m_X);
-}
-
-//==============================================================================
-/**
- * Add a point to the BoundingBox
- * @param inPoint a 3D point
- */
-void CBoundingBox::Add(const RuntimeVector3 &inPoint)
-{
- if (IsEmpty()) {
- m_Min = inPoint;
- m_Max = inPoint;
- } else {
- m_Min.Minimize(inPoint);
- m_Max.Maximize(inPoint);
- }
-}
-
-//==============================================================================
-/**
- * Add another BoundingBox to this BoundingBox
- * @param inBox a 3D BoundingBox
- */
-void CBoundingBox::Add(const CBoundingBox &inBox)
-{
- if (!inBox.IsEmpty()) {
- Add(inBox.GetMin());
- Add(inBox.GetMax());
- }
-}
-
-//==============================================================================
-/**
- * Get the bounding box's smallest position
- * @return the smallest position of the bounding box
- */
-const RuntimeVector3 &CBoundingBox::GetMin() const
-{
- return m_Min;
-}
-
-//==============================================================================
-/**
- * Get the bounding box's largest position
- * @return the largest position of the bounding box
- */
-const RuntimeVector3 &CBoundingBox::GetMax() const
-{
- return m_Max;
-}
-
-//==============================================================================
-/**
- * Apply a transform to the BoundingBox
- * @param inMatrix a 4x4 trasnform matrix
- */
-void CBoundingBox::Transform(const RuntimeMatrix &inMatrix)
-{
- // Apply transform to the 8 corners of the BoundingBox and renormalize to majox axes
- CBoundingBox theTransformedBox;
- RuntimeVector3 theCorners[8];
-
- theCorners[0].Set(m_Min.m_X, m_Min.m_Y, m_Min.m_Z);
- theCorners[1].Set(m_Min.m_X, m_Min.m_Y, m_Max.m_Z);
- theCorners[2].Set(m_Min.m_X, m_Max.m_Y, m_Min.m_Z);
- theCorners[3].Set(m_Min.m_X, m_Max.m_Y, m_Max.m_Z);
- theCorners[4].Set(m_Max.m_X, m_Min.m_Y, m_Min.m_Z);
- theCorners[5].Set(m_Max.m_X, m_Min.m_Y, m_Max.m_Z);
- theCorners[6].Set(m_Max.m_X, m_Max.m_Y, m_Min.m_Z);
- theCorners[7].Set(m_Max.m_X, m_Max.m_Y, m_Max.m_Z);
-
- for (INT32 theIndex = 0; theIndex < 8; ++theIndex) {
- theCorners[theIndex].Transform(inMatrix);
- theTransformedBox.Add(theCorners[theIndex]);
- }
- *this = theTransformedBox;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.h b/src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.h
deleted file mode 100644
index 988a9ba8..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSBoundingBox.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSVector3.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class RuntimeMatrix;
-
-//==============================================================================
-/**
- * Axis aligned 3D bounding box construction and manipulation.
- *
- * Initial construction creates an inverted box signifying an Empty box instead
- * of an infinitely small box at 0,0,0. Keep this in mind when asking for
- * Min or max on a box that has had no points added to it.
- *
- * Transforming a box simply transforms all eight corners to span a new
- * axis aligned bounding box. Successive transformations can thus create a
- * non-optimal box, much larger than needed.
- */
-class CBoundingBox
-{
- //==============================================================================
- // Fields
- //==============================================================================
-public:
- RuntimeVector3 m_Min; ///< box minimum corner point
- RuntimeVector3 m_Max; ///< box maximum corner point
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CBoundingBox();
-
-public: // Functions
- BOOL IsEmpty() const;
- void SetEmpty();
- void Add(const RuntimeVector3 &inPoint);
- void Add(const CBoundingBox &inBox);
- const RuntimeVector3 &GetMin() const;
- const RuntimeVector3 &GetMax() const;
- void Transform(const RuntimeMatrix &inMatrix);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.h b/src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.h
deleted file mode 100644
index be921673..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Circular array. Not growable for now.
- * The "streamlined" interface acts like a resource pool where construction of
- * item T is minimized.
- */
-template <class T>
-class CCircularArray
-{
- //==============================================================================
- // Types
- //==============================================================================
-public:
- typedef T TType; ///< Easy access to template type
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- CHAR m_Name[32]; ///< Allows easy ID if it grows too much
- T *m_Data; ///< Allocated memory containing array data
- INT32 m_Capacity; ///< Max number of elements possible
- INT32 m_Count; ///< Current number of elements in array
-
- INT32 m_Begin; ///< circular list indices
- INT32 m_End; ///< circular list indices
-
- // For 32-bit alignment
- BOOL m_Full; ///< flag to indicate circular list is full
- BOOL m_Paddings[3]; ///< Padding
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- inline CCircularArray(const INT32 inCapacity = 0, const CHAR *inName = NULL);
- inline ~CCircularArray();
-
-public: // Management
- inline INT32 GetCount() const;
- inline INT32 GetCapacity() const;
- inline void Clear(const BOOL inRelease = false);
- inline void Reserve(const INT32 inCapacity);
-
-public: // Stack access
- inline T &NewEntry();
- inline void Pop();
- inline T &Top();
-
-public: // Status
- BOOL IsEmpty() const;
- BOOL IsFull() const;
-
-protected: // Internal methods
- void Increment(INT32 &outIndex);
- void Decrement(INT32 &outIndex);
- void UpdateFullStatus();
-};
-
-} // namespace Q3DStudio
-
-//==============================================================================
-// Template code
-//==============================================================================
-#include "Qt3DSCircularArray.inl"
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.inl b/src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.inl
deleted file mode 100644
index 0d7f081f..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSCircularArray.inl
+++ /dev/null
@@ -1,225 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2007 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- */
-template <typename T> inline
-CCircularArray<T>::CCircularArray( const INT32 inCapacity, const CHAR* inName ) :
- m_Data( NULL ),
- m_Capacity( 0 ),
- m_Count( 0 ),
- m_Begin( 0 ),
- m_End( 0 ),
- m_Full( false )
-{
- Q3DStudio_sprintf( m_Name, sizeof( m_Name ), "%s", inName ? inName : "CircularArray" );
- Reserve( inCapacity );
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-template <class T> inline
-CCircularArray<T>::~CCircularArray( )
-{
- Clear( true );
-}
-
-//==============================================================================
-/**
- * Get the number of items in the array
- * @return the number of items in the array
- */
-template <class T> inline
-INT32 CCircularArray<T>::GetCount( ) const
-{
- return m_Count;
-}
-
-//==============================================================================
-/**
- * Get the capacity of the array
- * @return the capacity of the array
- */
-template <class T> inline
-INT32 CCircularArray<T>::GetCapacity( ) const
-{
- return m_Capacity;
-}
-
-//==============================================================================
-/**
- * Remove all items from the array
- * @param inRelease if true, release the allocated memory, if false, reset
- * parameters back to zero.
- */
-template <class T> inline
-void CCircularArray<T>::Clear( const BOOL inRelease )
-{
- m_Count = 0;
- m_Begin = 0;
- m_End = 0;
- m_Full = false;
-
- if ( inRelease )
- {
- Q3DStudio_free( m_Data, T, m_Capacity );
- m_Capacity = 0;
- m_Data = NULL;
- }
-}
-
-//==============================================================================
-/**
- * Change capacity of the array
- * Assume no expansion for circular array
- * @param inCapacity the new capacity to set
- */
-template <class T> inline
-void CCircularArray<T>::Reserve( const INT32 inCapacity )
-{
- Q3DStudio_ASSERT( !m_Data );
- T* theData = Q3DStudio_allocate_desc( T, inCapacity, m_Name );
- m_Data = theData;
- m_Capacity = inCapacity;
-}
-
-//==============================================================================
-/**
- * Create a new uninitialized item at the end of the array.
- * The returned reference is used to initialize the item.
- * @return a reference to the item
- */
-template <class T> inline
-T& CCircularArray<T>::NewEntry( )
-{
- Q3DStudio_ASSERT( !IsFull( ) );
- T& theResult = m_Data[m_End];
- Increment( m_End );
- UpdateFullStatus( );
- ++m_Count;
- return theResult;
-}
-
-//==============================================================================
-/**
- * Remove the top entry from the array
- */
-template <class T> inline
-void CCircularArray<T>::Pop( )
-{
- Q3DStudio_ASSERT( !IsEmpty( ) );
- Increment( m_Begin );
- m_Full = false;
- --m_Count;
-}
-
-//==============================================================================
-/**
- * Get the top item from the
- * @return a reference to the item
- */
-template <class T> inline
-T& CCircularArray<T>::Top( )
-{
- Q3DStudio_ASSERT( !IsEmpty( ) );
- return m_Data[m_Begin];
-}
-
-//==============================================================================
-/**
- * Check if the array is empty
- * @return true if empty, false otherwise.
- */
-template <class T> inline
-BOOL CCircularArray<T>::IsEmpty( ) const
-{
- return ( m_Begin == m_End ) && !m_Full;
-}
-
-//==============================================================================
-/**
- * Check if the array is full
- * @return true if full, false otherwise.
- */
-template <class T> inline
-BOOL CCircularArray<T>::IsFull( ) const
-{
- return m_Full;
-}
-
-//==============================================================================
-/**
- * Increment index of the array
- * @param outIndex the index to increment
- */
-template <class T> inline
-void CCircularArray<T>::Increment( INT32& outIndex )
-{
- ++outIndex;
- // circular list wrap-around
- if ( outIndex >= m_Capacity )
- outIndex = 0;
-}
-
-//==============================================================================
-/**
- * Decrement index of the array
- * @param outIndex the index to decrement
- */
-template <class T> inline
-void CCircularArray<T>::Decrement( INT32& outIndex )
-{
- --outIndex;
- // circular list wrap-around
- if ( outIndex < 0 )
- outIndex = m_Capacity - 1;
-}
-
-//==============================================================================
-/**
- * Update the status of the m_Full flag.
- * This is an internal method for use ONLY AFTER a item has been added to the array.
- */
-template <class T> inline
-void CCircularArray<T>::UpdateFullStatus( )
-{
- m_Full = ( m_End == m_Begin );
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSColor.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSColor.cpp
deleted file mode 100644
index a44d488b..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSColor.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSColor.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- * @param inColor 32 bit represenation of the color
- */
-CColor::CColor(const Q3DStudio::UINT32 inColor)
- : m_Color(inColor)
-{
-}
-
-//==============================================================================
-/**
- * Constructor
- * @param inRed 8 bit represenation of the red component
- * @param inGreen 8 bit representation of the green component
- * @param inBlue 8 bit representation of the blue component
- * @param inAlpha 8 bit representation of the transparency component
- */
-CColor::CColor(const UINT8 inRed, const UINT8 inGreen, const UINT8 inBlue, const UINT8 inAlpha)
- : m_Red(inRed)
- , m_Green(inGreen)
- , m_Blue(inBlue)
- , m_Alpha(inAlpha)
-{
-}
-
-//==============================================================================
-/**
- * Set the color to a blend between the two given colors.
- * @param inColor1 Color representing factor 0
- * @param inColor2 Color representing factor 1.0
- * @param inFactor Blend factor where 0.5 is an even mix of the two colors
- */
-void CColor::Interpolate(const CColor &inColor1, const CColor &inColor2, const FLOAT inFactor)
-{
- // m_Red = static_cast<UINT8>( rand() % 256 );//( 1.0f - inFactor ) * inColor1.m_Red +
- //inFactor * inColor2.m_Red );
- // m_Green = static_cast<UINT8>( rand() % 256 );//( 1.0f - inFactor ) * inColor1.m_Green +
- //inFactor * inColor2.m_Green );
- // m_Blue = static_cast<UINT8>( rand() % 256 );//( 1.0f - inFactor ) * inColor1.m_Blue +
- //inFactor * inColor2.m_Blue );
- // m_Alpha = 255;//static_cast<UINT8>( ( 1.0f - inFactor ) * inColor1.m_Alpha + inFactor *
- //inColor2.m_Alpha );
-
- m_Red = static_cast<UINT8>((1.0f - inFactor) * inColor1.m_Red + inFactor * inColor2.m_Red);
- m_Green =
- static_cast<UINT8>((1.0f - inFactor) * inColor1.m_Green + inFactor * inColor2.m_Green);
- m_Blue = static_cast<UINT8>((1.0f - inFactor) * inColor1.m_Blue + inFactor * inColor2.m_Blue);
- m_Alpha =
- static_cast<UINT8>((1.0f - inFactor) * inColor1.m_Alpha + inFactor * inColor2.m_Alpha);
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSColor.h b/src/Runtime/ogl-runtime/src/system/Qt3DSColor.h
deleted file mode 100644
index b917f46b..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSColor.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Express a color and transparency using 32 bits.
- */
-class CColor
-{
- //==============================================================================
- // Fields
- //==============================================================================
-public:
- union {
- UINT32 m_Color; ///< 32bit representation of the color
- struct
- {
- UINT8 m_Red; ///< Red component 0-255
- UINT8 m_Green; ///< Green component 0-255
- UINT8 m_Blue; ///< Blue component 0-255
- UINT8 m_Alpha; ///< Transparency component 0-255
- };
- };
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CColor(const UINT32 inColor);
- CColor(const UINT8 inRed = 255, const UINT8 inGreen = 255, const UINT8 inBlue = 255,
- const UINT8 inAlpha = 255);
-
-public: // Setters
- void SetColor(const UINT32 inColor) { m_Color = inColor; }
- void SetRed(const UINT8 inRed) { m_Red = inRed; }
- void SetGreen(const UINT8 inGreen) { m_Green = inGreen; }
- void SetBlue(const UINT8 inBlue) { m_Blue = inBlue; }
- void SetAlpha(const UINT8 inAlpha) { m_Alpha = inAlpha; }
-
-public: // Getters
- UINT32 GetColor() const { return m_Color; }
- UINT8 GetRed() const { return m_Red; }
- UINT8 GetGreen() const { return m_Green; }
- UINT8 GetBlue() const { return m_Blue; }
- UINT8 GetAlpha() const { return m_Alpha; }
-
-public: // Utilities
- void Interpolate(const CColor &inColor1, const CColor &inColor2, const FLOAT inFactor);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSConfig.h b/src/Runtime/ogl-runtime/src/system/Qt3DSConfig.h
deleted file mode 100644
index 49c644da..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSConfig.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// This file should only contain macros that configure the build environment
-// and build options.
-//==============================================================================
-#include "Qt3DSMemorySettings.h"
-
-/// Number of chars to evaluate when generating a hash from a string.
-/// Verify that hash strings are unique after changing this value.
-#ifndef HASH_LIMIT
-#define HASH_LIMIT 100
-#endif // HASH_LIMIT
-
-/// Define this macro use use sync primitives(mutex/critical sections) when accessing
-/// shared data structures
-#ifndef Q3DStudio_USE_SYNC_PRIMITIVES
-#define Q3DStudio_USE_SYNC_PRIMITIVES 1
-#endif // Q3DStudio_USE_SYNC_PRIMITIVES
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.cpp
deleted file mode 100644
index ebcc54b8..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSCubicRoots.h"
-#include "Qt3DSDataLogger.h"
-#include "Qt3DSCubicRootsImpl.h"
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.h b/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.h
deleted file mode 100644
index b5ac0530..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRoots.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Wrapper class to functions that solve cubic equations.
- *
- * The function suite is taken from Graphics Gems:
- * Roots3And4.c
- *
- * Utility functions to find cubic and quartic roots,
- * coefficients are passed like this:
- *
- * c[0] + c[1]*x + c[2]*x^2 + c[3]*x^3 + c[4]*x^4 = 0
- *
- * The functions return the number of non-complex roots and
- * put the values into the s array.
- *
- * Author: Jochen Schwarze (schwarze@isa.de)
- *
- * Jan 26, 1990 Version for Graphics Gems
- * Oct 11, 1990 Fixed sign problem for negative q's in SolveQuartic
- * (reported by Mark Podlipec),
- * Old-style function definitions,
- * IsZero() as a macro
- * Nov 23, 1990 Some systems do not declare acos() and cbrt() in
- * <math.h>, though the functions exist in the library.
- * If large coefficients are used, EQN_EPS should be
- * reduced considerably (e.g. to 1E-30), results will be
- * correct but multiple roots might be reported more
- * than once.
- */
-class CCubicRoots
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public:
- static INT32 SolveQuadric(FLOAT inConstants[3], FLOAT outSolutions[2]);
- static INT32 SolveCubic(FLOAT inConstants[4], FLOAT outSolutions[3]);
- // static int SolveQuartic( FLOAT c[5], FLOAT s[4] );
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRootsImpl.h b/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRootsImpl.h
deleted file mode 100644
index 8cca59f9..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSCubicRootsImpl.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants used by the functions
-//==============================================================================
-const FLOAT M_PHI = 3.14159265358979323846f;
-
-/* epsilon surrounding for near zero values */
-const FLOAT EQN_EPS = 1e-9f;
-
-#define ISZERO(x) ((x) > -EQN_EPS && (x) < EQN_EPS)
-
-// cube-root
-#ifndef CUBEROOT
-#define CUBEROOT(x) \
- ((x) > 0.0 ? static_cast<FLOAT>(pow((x), 1.0f / 3.0f)) \
- : ((x) < 0.0 ? -static_cast<FLOAT>(pow(-(x), 1.0f / 3.0f)) : 0.0f))
-#endif
-
-//==============================================================================
-/**
- * Find the root/s to a quadratic equation.
- *
- * The equation is of the form: c[2]*x^2 + c[1]*x + c[0] = 0
- * Note that this will fail if c[2] is zero, or this is a linear equation.
- *
- * @param inConstants The array of constants to the equation; see form above
- * @param outSolutions The array of solutions to the equation
- * @return the number of solutions for the equation
- */
-INT32 CCubicRoots::SolveQuadric(FLOAT inConstants[3], FLOAT outSolutions[2])
-{
-#ifdef _PERF_LOG
- PerfLogMathEvent1 thePerfLog(DATALOGGER_CUBICROOT);
-#endif
- FLOAT theP, theQ, theD;
- INT32 theResult = 0;
-
- /* normal form: x^2 + px + theQ = 0 */
-
- theP = inConstants[1] / (2 * inConstants[2]);
- theQ = inConstants[0] / inConstants[2];
-
- theD = theP * theP - theQ;
-
- if (ISZERO(theD)) {
- outSolutions[0] = -theP;
- theResult = 1;
- } else if (theD < 0.0f) {
- theResult = 0;
- } else if (theD > 0.0f) {
- FLOAT theSquareRootD = sqrtf(theD);
-
- outSolutions[0] = theSquareRootD - theP;
- outSolutions[1] = -theSquareRootD - theP;
- theResult = 2;
- }
-
- return theResult;
-}
-
-//==============================================================================
-/**
- * Find the root/s to a cubic equation.
- *
- * The equation is of the form: c[3]*x^3 + c[2]*x^2 + c[1]*x + c[0] = 0
- * Note that this will fail if c[3] is zero, or this is a quadratic equation.
- *
- * @param inConstants The array of constants to the equation; see form above
- * @param outSolutions The array of solutions to the equation
- * @return the number of solutions for the equation
- */
-INT32 CCubicRoots::SolveCubic(FLOAT inConstants[4], FLOAT outSolutions[3])
-{
-#ifdef _PERF_LOG
- PerfLogMathEvent1 thePerfLog(DATALOGGER_CUBICROOT);
-#endif
-
- INT32 theResult;
- FLOAT theSubstitute;
- FLOAT theVariableA, theVariableB, theVariableC;
- FLOAT theASquared, theVariableP, theVariableQ;
- FLOAT thePCubed, theVariableD;
-
- /* normal form: x^3 + Ax^2 + Bx + C = 0 */
-
- theVariableA = inConstants[2] / inConstants[3];
- theVariableB = inConstants[1] / inConstants[3];
- theVariableC = inConstants[0] / inConstants[3];
-
- /* substitute x = y - A/3 to eliminate quadric term:
- x^3 +px + q = 0 */
-
- theASquared = theVariableA * theVariableA;
- theVariableP = 1.0f / 3.0f * (-1.0f / 3.0f * theASquared + theVariableB);
- theVariableQ = 1.0f / 2.0f * (2.0f / 27.0f * theVariableA * theASquared
- - 1.0f / 3.0f * theVariableA * theVariableB + theVariableC);
-
- /* use Cardano's formula */
-
- thePCubed = theVariableP * theVariableP * theVariableP;
- theVariableD = theVariableQ * theVariableQ + thePCubed;
-
- if (ISZERO(theVariableD)) {
- if (ISZERO(theVariableQ)) /* one triple solution */
- {
- outSolutions[0] = 0;
- theResult = 1;
- } else /* one single and one double solution */
- {
- FLOAT theVariableU = CUBEROOT(-theVariableQ);
- outSolutions[0] = 2.0f * theVariableU;
- outSolutions[1] = -theVariableU;
- theResult = 2;
- }
- } else if (theVariableD < 0.0f) /* Casus irreducibilis: three real solutions */
- {
- FLOAT thePhi = 1.0f / 3.0f * static_cast<FLOAT>(acos(-theVariableQ / sqrtf(-thePCubed)));
- FLOAT theVariableT = 2.0f * sqrtf(-theVariableP);
-
- outSolutions[0] = theVariableT * static_cast<FLOAT>(cos(thePhi));
- outSolutions[1] = -theVariableT * static_cast<FLOAT>(cos(thePhi + M_PHI / 3.0f));
- outSolutions[2] = -theVariableT * static_cast<FLOAT>(cos(thePhi - M_PHI / 3.0f));
- theResult = 3;
- } else /* one real solution */
- {
- FLOAT theSquareRootD = sqrtf(theVariableD);
- FLOAT theVariableU = CUBEROOT(theSquareRootD - theVariableQ);
- FLOAT theVariableV = -CUBEROOT(theSquareRootD + theVariableQ);
-
- outSolutions[0] = theVariableU + theVariableV;
- theResult = 1;
- }
-
- /* resubstitute */
- theSubstitute = 1.0f / 3.0f * theVariableA;
-
- for (INT32 theIndex = 0; theIndex < theResult; ++theIndex)
- outSolutions[theIndex] -= theSubstitute;
-
- return theResult;
-}
-
-}; // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.cpp
deleted file mode 100644
index c6f6d80d..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//==============================================================================
-// Includes
-//==============================================================================
-#include "SystemPrefix.h"
-#include "Qt3DSDLLManager.h"
-#include "Qt3DSBasicPluginDLL.h"
-#include <QDebug>
-#ifdef _LINUXPLATFORM
-#include <dlfcn.h>
-#endif
-
-using namespace Q3DStudio;
-
-//==============================================================================
-/**
- * Comparator for DLL instances.
- * Compares by plugin type and handle
- */
-namespace Q3DStudio {
-bool operator==(const _SDLLInfo &inInfo1, const _SDLLInfo &inInfo2)
-{
- return (inInfo1.m_Type == inInfo2.m_Type) && (inInfo1.m_Handle == inInfo2.m_Handle);
-}
-}
-
-//==============================================================================
-/**
- * Singleton getter
- */
-CDLLManager &CDLLManager::GetDLLManager()
-{
- static CDLLManager theDLLManager = CDLLManager();
- return theDLLManager;
-}
-
-//==============================================================================
-/**
- * CTOR
- */
-CDLLManager::CDLLManager()
-{
-}
-
-//==============================================================================
-/**
- * DTOR
- */
-CDLLManager::~CDLLManager()
-{
-}
-
-//==============================================================================
-/**
- * Cleanup
- */
-void CDLLManager::Cleanup()
-{
- m_LoadedLibraries.Clear(true);
-}
-
-//==============================================================================
-/**
- * Loads a DLL/shared library given a path to the library plugin and the plugin
- * type to expect.
- */
-long CDLLManager::LoadLibrary(const char *inLibraryPath, long inPluginType)
-{
- long theEmptyIndex = NVARRAY_NOTFOUND;
-#ifdef _PCPLATFORM
- DLLHANDLE theHandle = ::LoadLibraryA(inLibraryPath);
-#endif
-
-#ifdef _LINUXPLATFORM
- DLLHANDLE theHandle = ::dlopen(inLibraryPath, RTLD_NOW);
-
- if (!theHandle) {
- const char *error = ::dlerror();
- qWarning() << "Failed to load shared library, error:" << QStringLiteral("%1, full path: %2").arg(error).arg(inLibraryPath);
- }
-
-#endif
-
-#ifdef _INTEGRITYPLATFORM
- DLLHANDLE theHandle = 0;
- qWarning() << "CDLLManager::LoadLibrary handle is zero!";
-#endif
-
- Q3DStudio_ASSERT(theHandle);
-
- if (theHandle != NULL) {
- SDLLInfo theInfo;
- PROC_GetPluginType theProc =
- reinterpret_cast<PROC_GetPluginType>(GetProc("GetPluginType", theHandle));
- Q3DStudio_ASSERT(theProc);
-
- if (theProc) {
- theInfo.m_Type = theProc();
-
- if (theInfo.m_Type == inPluginType) {
- theEmptyIndex = m_LoadedLibraries.GetIndex(theInfo);
- theInfo.m_Handle = theHandle;
-
- if (theEmptyIndex == NVARRAY_NOTFOUND) {
- m_LoadedLibraries.Push(theInfo);
- theEmptyIndex = m_LoadedLibraries.GetCount() - 1;
- } else
- m_LoadedLibraries[theEmptyIndex] = theInfo;
- }
- }
-
- if (theEmptyIndex == NVARRAY_NOTFOUND) {
-#ifdef _PCPLATFORM
- ::FreeLibrary(theHandle);
-#endif
-
-#ifdef _LINUXPLATFORM
- ::dlclose(theHandle);
-#endif
- }
- }
-
- return theEmptyIndex;
-}
-
-//==============================================================================
-/**
- * Unloads a DLL given a handle
- */
-void CDLLManager::UnloadLibrary(const long inHandle)
-{
- if (inHandle >= 0 && inHandle < m_LoadedLibraries.GetCount()) {
-#ifdef _PCPLATFORM
- ::FreeLibrary(m_LoadedLibraries[inHandle].m_Handle);
-#endif
-
-#ifdef _LINUXPLATFORM
- ::dlclose(m_LoadedLibraries[inHandle].m_Handle);
-#endif
-
- m_LoadedLibraries[inHandle] = SDLLInfo();
- }
-}
-
-//==============================================================================
-/**
- * Retrieves a DLL proc given the proc name
- */
-void *CDLLManager::GetProc(const char *inProcName, long inHandle)
-{
- if (inHandle >= 0 && inHandle < m_LoadedLibraries.GetCount())
- return GetProc(inProcName, m_LoadedLibraries[inHandle].m_Handle);
-
- return NULL;
-}
-
-//==============================================================================
-/**
- * Retrieves a DLL proc fiven the proc name
- */
-void *CDLLManager::GetProc(const char *inProcName, const DLLHANDLE inHandle)
-{
-#ifdef _PCPLATFORM
-#ifdef QT3DS_VC
- return ::GetProcAddress(inHandle, inProcName);
-#else
- return (void *)(::GetProcAddress(inHandle, inProcName));
-#endif
-#endif
-
-#ifdef _LINUXPLATFORM
- return ::dlsym(inHandle, inProcName);
-#endif
-
-#ifdef _INTEGRITYPLATFORM
- qWarning() << "CDLLManager::GetProc returns NULL!";
- return NULL;
-#endif
-}
-
-//==============================================================================
-/**
- * Retrieves the plugin type for the DLL
- */
-template <typename EEnumType>
-EEnumType CDLLManager::GetPluginType(long inHandle)
-{
- if (inHandle >= 0 && inHandle < m_LoadedLibraries.GetCount())
- return static_cast<EEnumType>(m_LoadedLibraries[inHandle].m_Type);
-
- return 0;
-}
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.h b/src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.h
deleted file mode 100644
index d670af2e..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDLLManager.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//==============================================================================
-// Includes
-//==============================================================================
-#pragma once
-
-#ifdef _PCPLATFORM
-#pragma warning(push, 3)
-#include <windows.h>
-#pragma warning(pop)
-#endif
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-#ifdef _PCPLATFORM
-typedef HMODULE DLLHANDLE;
-#endif
-
-#if defined(_LINUXPLATFORM) || defined(_INTEGRITYPLATFORM)
-typedef void *DLLHANDLE;
-#endif
-
-typedef struct _SDLLInfo
-{
- long m_Type; ///< Plugin type
- DLLHANDLE m_Handle; ///< DLL handle
-
- _SDLLInfo()
- : m_Type(0)
- , m_Handle(NULL)
-
- {
- }
-
-} SDLLInfo;
-
-//==============================================================================
-/**
- * Loads DLLs and queries for DLL functions
- */
-class CDLLManager
-{
-public:
- static CDLLManager &GetDLLManager();
-
-protected:
- CDLLManager();
- virtual ~CDLLManager();
-
-public:
- long LoadLibrary(const char *inLibraryPath, long inPluginType);
- void UnloadLibrary(const long inHandle);
- void *GetProc(const char *inProcName, long inHandle);
- template <typename EEnumType>
- EEnumType GetPluginType(long inHandle);
- void Cleanup();
-
-protected:
- void *GetProc(const char *inProcName, const DLLHANDLE inHandle);
-
-protected:
- CArray<Q3DStudio::SDLLInfo> m_LoadedLibraries;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.cpp
deleted file mode 100644
index 2f45f012..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSDataLogger.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-CDataLogger::SExternalFunctors CDataLogger::m_Functors;
-CDataLogger::EDataLoggerLevel CDataLogger::m_LogLevel = CDataLogger::LOG_LEVEL_INVALID;
-BOOL CDataLogger::m_Enabled = false;
-
-// Developers - change out the = NULL to = class::LogEntry to log specific stuff.
-template <>
-TPerfLogGeneralEvent1::TLogEntryInternal TPerfLogGeneralEvent1::m_InternalLogFunc = NULL;
-template <>
-TPerfLogGeneralEvent2::TLogEntryInternal TPerfLogGeneralEvent2::m_InternalLogFunc = NULL;
-
-template <>
-TPerfLogRenderEvent1::TLogEntryInternal TPerfLogRenderEvent1::m_InternalLogFunc = NULL;
-template <>
-TPerfLogSceneEvent1::TLogEntryInternal TPerfLogSceneEvent1::m_InternalLogFunc = NULL;
-
-template <>
-TPerfLogMathEvent1::TLogEntryInternal TPerfLogMathEvent1::m_InternalLogFunc = NULL;
-template <>
-TPerfLogPresentationEvent1::TLogEntryInternal TPerfLogPresentationEvent1::m_InternalLogFunc = NULL;
-template <>
-TPerfLogRenderEvent2::TLogEntryInternal TPerfLogRenderEvent2::m_InternalLogFunc = NULL;
-
-//==============================================================================
-/**
- * Set the application supplied functors to use for getting time and handling
- * the writing out of data
- */
-void CDataLogger::SetFunctors(SExternalFunctors inFunctors)
-{
- m_Functors = inFunctors;
-}
-
-//==============================================================================
-/**
-* Call into the specified functors to make stuff happen
-*/
-void CDataLogger::LogEntry(UINT32 inEntryEnum, BOOL inStartFlag)
-{
- if (m_Enabled && m_Functors.m_GetTimeFunc && m_Functors.m_WriteFunc && m_Functors.m_UserData) {
- // Initialize to the correct values
- SPerfLogEntry theEntry(inEntryEnum, inStartFlag,
- m_Functors.m_GetTimeFunc(m_Functors.m_UserData));
- m_Functors.m_WriteFunc(m_Functors.m_UserData, theEntry);
- }
-}
-
-//==============================================================================
-/**
-* Enable logging
-*/
-void CDataLogger::Enable()
-{
- SetLogLevel(m_LogLevel);
- m_Enabled = true;
-}
-
-//==============================================================================
-/**
-* Disable logging
-*/
-void CDataLogger::Disable()
-{
- m_Enabled = false;
-}
-
-//==============================================================================
-/**
- * XXX
- */
-void CDataLogger::SetLogLevel(EDataLoggerLevel inLogLevel)
-{
- switch (inLogLevel) {
- // No logging
- case LOG_LEVEL_NONE:
- TPerfLogGeneralEvent1::Disable();
- TPerfLogGeneralEvent2::Disable();
-
- TPerfLogRenderEvent1::Disable();
- TPerfLogSceneEvent1::Disable();
-
- TPerfLogMathEvent1::Disable();
- TPerfLogPresentationEvent1::Disable();
- TPerfLogRenderEvent2::Disable();
- break;
-
- case LOG_LEVEL_3:
- TPerfLogMathEvent1::Enable();
- TPerfLogPresentationEvent1::Enable();
- TPerfLogRenderEvent2::Enable();
-
- case LOG_LEVEL_2:
- TPerfLogRenderEvent1::Enable();
- TPerfLogSceneEvent1::Enable();
-
- case LOG_LEVEL_1:
- TPerfLogGeneralEvent1::Enable();
- TPerfLogGeneralEvent2::Enable();
- break;
-
- case LOG_LEVEL_INVALID:
- default:
- m_LogLevel = LOG_LEVEL_INVALID;
- return;
- break;
- }
- m_LogLevel = inLogLevel;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.h b/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.h
deleted file mode 100644
index b834edab..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _DATA_LOGGER_H_
-#define _DATA_LOGGER_H_
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTypes.h"
-#include "Qt3DSDataLoggerEnums.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-typedef TTimeUnit TDataLoggerTimeUnit;
-
-//==============================================================================
-/**
-* The structure that holds all the info we collect
-*/
-struct SPerfLogEntry
-{
- UINT32 m_EntryEnum : 31;
- UINT32 m_StartBool : 1;
-
- TDataLoggerTimeUnit m_Time;
-
- SPerfLogEntry(UINT32 inEntryEnum, BOOL inStartFlag, TDataLoggerTimeUnit inTime)
- : m_EntryEnum(inEntryEnum)
- , m_StartBool(inStartFlag ? 1U : 0U)
- , m_Time(inTime)
- {
- // Make sure our enums never use the high bit
- Q3DStudio_ASSERT(false == (inEntryEnum & (1 << 31)));
- }
-};
-
-//==============================================================================
-/**
-* The stack based helper class that wraps the actually logging of start and end messages
-* for use with start/end time logging.
-*/
-template <typename T>
-class CPerfLogPairedEventWrapper
-{
-public:
- typedef void (*TLogEntryInternal)(UINT32 inEntryEnum, BOOL inStartFlag);
-
-private:
- UINT32 m_EntryEnum;
- static TLogEntryInternal m_InternalLogFunc;
-
-private:
- static void LogEntry(UINT32 inEntryEnum, BOOL inStartFlag);
-
-public:
- CPerfLogPairedEventWrapper(UINT32 inEntryEnum);
- ~CPerfLogPairedEventWrapper();
-
- static void Enable();
- static void Disable();
-};
-
-//==============================================================================
-/**
-*/
-class CPerfLogPairedEventWrapperDummy
-{
-public:
- CPerfLogPairedEventWrapperDummy(UINT32 /*inEntryEnum*/) {}
- ~CPerfLogPairedEventWrapperDummy() {}
-};
-
-// Dummy structs, so we get one 'type' of class per log event
-// so we can turn things on and off
-struct SPerfLogGeneralEvent1
-{
-};
-struct SPerfLogGeneralEvent2
-{
-};
-
-struct SPerfLogRenderEvent1
-{
-};
-struct SPerfLogSceneEvent1
-{
-};
-
-struct SPerfLogMathEvent1
-{
-};
-struct SPerfLogPresentationEvent1
-{
-};
-struct SPerfLogRenderEvent2
-{
-};
-
-// level 0
-// no profiling at all...
-
-// level 1
-typedef CPerfLogPairedEventWrapper<SPerfLogGeneralEvent1>
- TPerfLogGeneralEvent1; // Frame, update presentations, update scene, render scene
-typedef CPerfLogPairedEventWrapper<SPerfLogGeneralEvent2>
- TPerfLogGeneralEvent2; // Event processing and manager updates,
-// call frame and slide callbacks,
-// opaque, transparent, layer render, finalize drawlist and pick
-// level 2
-typedef CPerfLogPairedEventWrapper<SPerfLogRenderEvent1>
- TPerfLogRenderEvent1; // More detailed rendering
-typedef CPerfLogPairedEventWrapper<SPerfLogSceneEvent1>
- TPerfLogSceneEvent1; // More detailed scene update
-
-// level 3
-typedef CPerfLogPairedEventWrapper<SPerfLogMathEvent1> TPerfLogMathEvent1; // vector and matrix math
-typedef CPerfLogPairedEventWrapper<SPerfLogPresentationEvent1>
- TPerfLogPresentationEvent1; // More detailed scene update
-typedef CPerfLogPairedEventWrapper<SPerfLogRenderEvent2> TPerfLogRenderEvent2; //
-
-// Defines
-#ifdef _PERF_LOG
-#define PerfLogGeneralEvent1(inEventID) TPerfLogGeneralEvent1 thePerfLog(inEventID);
-#define PerfLogGeneralEvent2(inEventID) TPerfLogGeneralEvent2 thePerfLog(inEventID);
-
-#define PerfLogRenderEvent1(inEventID) TPerfLogRenderEvent1 thePerfLog(inEventID);
-#define PerfLogSceneEvent1(inEventID) TPerfLogSceneEvent1 thePerfLog(inEventID);
-
-#define PerfLogMathEvent1(inEventID) TPerfLogMathEvent1 thePerfLog(inEventID);
-#define PerfLogPresentationEvent1(inEventID) TPerfLogPresentationEvent1 thePerfLog(inEventID);
-#define PerfLogRenderEvent2(inEventID) TPerfLogRenderEvent2 thePerfLog(inEventID);
-#else
-#define PerfLogGeneralEvent1(inEventID)
-#define PerfLogGeneralEvent2(inEventID)
-
-#define PerfLogRenderEvent1(inEventID)
-#define PerfLogSceneEvent1(inEventID)
-
-#define PerfLogMathEvent1(inEventID)
-#define PerfLogPresentationEvent1(inEventID)
-#define PerfLogRenderEvent2(inEventID)
-#endif
-
-//==============================================================================
-/**
-*/
-class CDataLogger
-{
-private:
- // App level function to write this out to a stream/file... set externally
- typedef void (*TDataLoggerWriteFunc)(void *inUserData, SPerfLogEntry inEntry);
- typedef TDataLoggerTimeUnit (*TGetTimeFunc)(void *inUserData);
-
-public:
- struct SExternalFunctors
- {
- void *m_UserData;
- TDataLoggerWriteFunc m_WriteFunc;
- TGetTimeFunc m_GetTimeFunc;
-
- SExternalFunctors()
- : m_UserData(NULL)
- , m_WriteFunc(NULL)
- , m_GetTimeFunc(NULL)
- {
- }
- };
-
- enum EDataLoggerLevel {
- LOG_LEVEL_NONE,
- LOG_LEVEL_1,
- LOG_LEVEL_2,
- LOG_LEVEL_3,
- LOG_LEVEL_INVALID, // use this if you want to selectively enable or disable loggers
- };
-
-private:
- static SExternalFunctors m_Functors;
- static EDataLoggerLevel m_LogLevel;
- static BOOL m_Enabled;
-
-public:
- static void SetFunctors(SExternalFunctors inFunctors);
- static void LogEntry(UINT32 inEntryEnum, BOOL inStartFlag);
- static void Enable();
- static void Disable();
-
- static void SetLogLevel(EDataLoggerLevel inLogLevel);
-};
-
-} // namespace Q3DStudio
-
-#include "Qt3DSDataLogger.hpp"
-
-#endif // _DATA_LOGGER_H_
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.hpp b/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.hpp
deleted file mode 100644
index 0900c4a4..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLogger.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSDataLogger.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
-* Constructor
-*/
-template <typename T>
-CPerfLogPairedEventWrapper<T>::CPerfLogPairedEventWrapper(UINT32 inEntryEnum)
- : m_EntryEnum(inEntryEnum)
-{
- if (m_InternalLogFunc)
- m_InternalLogFunc(m_EntryEnum, true);
-}
-
-//==============================================================================
-/**
-* Destructor
-*/
-template <typename T>
-CPerfLogPairedEventWrapper<T>::~CPerfLogPairedEventWrapper()
-{
- if (m_InternalLogFunc)
- m_InternalLogFunc(m_EntryEnum, false);
-}
-
-//==============================================================================
-/**
-* Logger functions
-*/
-template <typename T>
-void CPerfLogPairedEventWrapper<T>::LogEntry(UINT32 inEntryEnum, BOOL inStartFlag)
-{
- CDataLogger::LogEntry(inEntryEnum, inStartFlag);
-}
-
-//==============================================================================
-/**
- * Enable logging
- */
-template <typename T>
-void CPerfLogPairedEventWrapper<T>::Enable()
-{
- m_InternalLogFunc = LogEntry;
-}
-
-//==============================================================================
-/**
-* Disable logging
-*/
-template <typename T>
-void CPerfLogPairedEventWrapper<T>::Disable()
-{
- m_InternalLogFunc = NULL;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerEnums.h b/src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerEnums.h
deleted file mode 100644
index 27320e19..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerEnums.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef _DATA_LOGGER_ENUMS_H_
-#define _DATA_LOGGER_ENUMS_H_
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-// TODO ah - for now, these are all specific to paired events. Later we will
-// extend this to support single events which may or may not have timestamps
-// for example, every matrix multiple would log a single event with no time
-enum EDataLoggerEvents {
- //
- DATALOGGER_FRAME, /// Time spent in a application frame ( UpdatePresentations, UpdateScenes, and
- /// Render )
-
- // DATALOGGER_FRAME
- // CRuntime
- DATALOGGER_UPDATEPRESENTATIONS, /// Time spent updating all presentations
- DATALOGGER_UPDATESCENES, /// Time spent updating all scenes
- DATALOGGER_RENDERSCENES, /// Time spent rendering all scenes
-
- // DATALOGGER_UPDATEPRESENTATIONS
- // CPresentation::Update
- DATALOGGER_PROCESSEVENTS, /// Time spent in ProcessEventCommandQueue
- DATALOGGER_ELEMENTMANAGERUPDATE, /// Time spent in CElementManager::Update doing activate and
- /// deactivate scans
- DATALOGGER_ANIMATIONMANAGERUPDATE, /// Time spent in CAnimationManager::Update
-
- // More detailed presentation update
- DATALOGGER_PROCESSCOMMAND, /// xxx
- DATALOGGER_PROCESSEVENT, /// xxx
- DATALOGGER_PROCESSEVENTBUBBLING, /// xxx
-
- // DATALOGGER_UPDATESCENES
- // CScene::Update
- DATALOGGER_PROCESSDIRTYLIST, /// Time spent in CScene::ProcessDirtyList
- DATALOGGER_CALCULATETRANSFORM, /// Time spent in CScene::CalculateGlobalTransform
- DATALOGGER_SCENEUPDATE, /// Time spent in CScene::Update recursion
-
- // More detailed scene update
- DATALOGGER_SCANNODEATTRIBUTES, /// Time
- DATALOGGER_PUSHNODE, /// Time
-
- // DATALOGGER_RENDERSCENES
- // CRenderEngine
- DATALOGGER_RENDERLAYER, /// Time spent rendering the contents of a layer
- DATALOGGER_RENDEROPAQUE, /// Time spent rendering all opaque items
- DATALOGGER_RENDERTRANSPARENT, /// Time spent rendering all transparent items
- DATALOGGER_FINALIZEDRAWLIST, /// Time spent finalizing the draw list
- DATALOGGER_PICK, /// Time spent in pick code
-
- // More detailed rendering
- DATALOGGER_RENDER_SORTDISTANCE, /// asdf
- DATALOGGER_RENDER_SETOPACITY, /// asdf
- DATALOGGER_RENDER_DRAWMODEL, /// asdf
- DATALOGGER_RENDER_DRAWTEXT, /// asdf
- DATALOGGER_RENDER_CLEARBUFFER, /// asdf
- DATALOGGER_RENDER_ZWRITEENABLE, /// asdf
- DATALOGGER_RENDER_CHECKRESIZE, /// asdf
- DATALOGGER_RENDER_SETATTRIBUTES, /// asdf
- DATALOGGER_RENDER_TEXTUPDATE, /// asdf
- DATALOGGER_RENDER_CAMERAUPDATE, /// asdf
-
- // super specific low level gl calls
- DATALOGGER_TEXTURESTATE_APPLY, /// asdf
- DATALOGGER_GEOMETRY_DRAW, /// asdf
- DATALOGGER_MATERIAL_APPLY, /// asdf
- DATALOGGER_SETSHADER, /// asdf
-
- // vector math
- DATALOGGER_VECTOR, /// asdf
- DATALOGGER_MATRIX, /// asdf
- DATALOGGER_CUBICROOT, /// asdf
-
- //
- DATALOGGER_COUNTERTEST, /// Time spent in counter test code
- DATALOGGER_COUNTERTESTX, /// Time spent in counter test code
-
- DATALOGGEREVENTCOUNT /// Event count
-};
-
-// CPerfLogPairedEventWrapperx thePerfLog( xxx );
-
-} // namespace Q3DStudio
-
-#endif // _DATA_LOGGER_ENUMS_H_
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerViewer.h b/src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerViewer.h
deleted file mode 100644
index 0eaf9f6a..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSDataLoggerViewer.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef AKDATALOGGERVIEWER_H_INCLUDED
-#define AKDATALOGGERVIEWER_H_INCLUDED
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTypes.h"
-#include "Qt3DSDataLogger.h"
-#include "Qt3DSDataLoggerEnums.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-// Helps interpret and analyse data logger entries
-class CDataLoggerViewer
-{
-public:
- typedef CArray<SPerfLogEntry> TPerfLogEntryList;
-
-public:
- CDataLoggerViewer(TPerfLogEntryList *inPerfLogEntryList);
- CDataLoggerViewer(const char *inFilename);
- virtual ~CDataLoggerViewer();
-
-public:
- float GetAverageTimeInMsForEntry(enum EDataLoggerEvents inEventType);
- void ResetPerfLogEntry(enum EDataLoggerEvents inEventType);
- void ResetAllEntries();
-
-public:
- static bool ProcessKeyEvent(char inKey, TPerfLogEntryList *inList);
-
-protected:
- TPerfLogEntryList *m_PerfLogEntryList;
- bool m_Dispose;
-};
-
-} // namespace NVUI
-
-#endif // AKDATALOGGERVIEWER_H_INCLUDED
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSEGLTimer.h b/src/Runtime/ogl-runtime/src/system/Qt3DSEGLTimer.h
deleted file mode 100644
index 4c9f4ce2..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSEGLTimer.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSTimer.h"
-#include "Qt3DSTypes.h"
-
-// You have to include egl before including this file.
-
-typedef EGLuint64NV(EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void);
-typedef EGLuint64NV(EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void);
-extern EGLuint64NV eglSystemTimeFrequency;
-extern PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC eglGetSystemTimeFrequencyNVProc;
-extern PFNEGLGETSYSTEMTIMENVPROC eglGetSystemTimeNVProc;
-
-namespace Q3DStudio {
-
-struct SEGLTimeProvider : public Q3DStudio::ITimeProvider
-{
-public:
- Q3DStudio::INT64 m_TimeFrequency;
- SEGLTimeProvider()
- : m_TimeFrequency(0)
- {
- }
- virtual Q3DStudio::INT64 GetCurrentTimeMicroSeconds()
- {
- // This can be called before EGL is initialized.
- if (eglGetSystemTimeFrequencyNVProc == NULL || eglGetSystemTimeNVProc == NULL)
- return 0;
-
- if (!m_TimeFrequency) {
- // Time frequency converts to seconds.
- m_TimeFrequency = eglGetSystemTimeFrequencyNVProc();
- // We need it to conver to microseconds
- m_TimeFrequency = m_TimeFrequency / 1000000ULL;
- }
- Q3DStudio::INT64 currentTime = eglGetSystemTimeNVProc();
- currentTime = currentTime / m_TimeFrequency;
- return currentTime;
- }
-};
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSEndian.h b/src/Runtime/ogl-runtime/src/system/Qt3DSEndian.h
deleted file mode 100644
index f8913a72..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSEndian.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2010 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Constants
-//==============================================================================
-
-#define QT3DS_LITTLE_ENDIAN false
-#define QT3DS_BIG_ENDIAN true
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.cpp
deleted file mode 100644
index 7c4364fc..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.cpp
+++ /dev/null
@@ -1,390 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include <math.h>
-#include <float.h>
-#include <string.h>
-#include <stdio.h>
-#include "Qt3DSEulerAngles.h"
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4365) // warnings on conversion from unsigned int to int
-#endif
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- */
-CEulerAngleConverter::CEulerAngleConverter()
-{
- m_OrderInfoBuffer[0] = '\0';
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CEulerAngleConverter::~CEulerAngleConverter()
-{
-}
-
-//==============================================================================
-/**
- * Constructs a Euler angle & holds it in a EulerAngles struct
- * @param theI x rotation ( radians )
- * @param theJ y rotation ( radians )
- * @param theH z rotation ( radians )
- * @param theOrder the order this angle is in namely XYZ( static ), etc.
- * use the EulOrd**** macros to generate values
- * 0 to 23 is valid
- * @return the euler angle
- */
-EulerAngles CEulerAngleConverter::Eul_(float theI, float theJ, float theH, int theOrder)
-{
- EulerAngles theEulerAngle;
- theEulerAngle.x = theI;
- theEulerAngle.y = theJ;
- theEulerAngle.z = theH;
- theEulerAngle.w = (float)theOrder;
- return theEulerAngle;
-}
-
-//==============================================================================
-/**
- * Construct quaternion from Euler angles (in radians).
- * @param theEulerAngle incoming angle( radians )
- * @return the Quaternion
- */
-Quat CEulerAngleConverter::Eul_ToQuat(EulerAngles theEulerAngle)
-{
- Quat theQuaternion;
- double a[3], ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- int i, j, k, h, n, s, f;
-
- EulGetOrd((unsigned int)theEulerAngle.w, i, j, k, h, n, s, f);
- if (f == EulFrmR) {
- float t = theEulerAngle.x;
- theEulerAngle.x = theEulerAngle.z;
- theEulerAngle.z = t;
- }
-
- if (n == EulParOdd)
- theEulerAngle.y = -theEulerAngle.y;
-
- ti = theEulerAngle.x * 0.5;
- tj = theEulerAngle.y * 0.5;
- th = theEulerAngle.z * 0.5;
-
- ci = cos(ti);
- cj = cos(tj);
- ch = cos(th);
-
- si = sin(ti);
- sj = sin(tj);
- sh = sin(th);
-
- cc = ci * ch;
- cs = ci * sh;
- sc = si * ch;
- ss = si * sh;
-
- if (s == EulRepYes) {
- a[i] = cj * (cs + sc); /* Could speed up with */
- a[j] = sj * (cc + ss); /* trig identities. */
- a[k] = sj * (cs - sc);
- theQuaternion.w = (float)(cj * (cc - ss));
- } else {
- a[i] = cj * sc - sj * cs;
- a[j] = cj * ss + sj * cc;
- a[k] = cj * cs - sj * sc;
- theQuaternion.w = (float)(cj * cc + sj * ss);
- }
- if (n == EulParOdd)
- a[j] = -a[j];
-
- theQuaternion.x = (float)a[X];
- theQuaternion.y = (float)a[Y];
- theQuaternion.z = (float)a[Z];
- return theQuaternion;
-}
-
-//==============================================================================
-/**
- * Construct matrix from Euler angles (in radians).
- * @param theEulerAngle incoming angle
- * @param theMatrix outgoing matrix
- */
-void CEulerAngleConverter::Eul_ToHMatrix(EulerAngles theEulerAngle, HMatrix theMatrix)
-{
- double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- int i, j, k, h, n, s, f;
- EulGetOrd((unsigned int)theEulerAngle.w, i, j, k, h, n, s, f);
-
- if (f == EulFrmR) {
- float t = theEulerAngle.x;
- theEulerAngle.x = theEulerAngle.z;
- theEulerAngle.z = t;
- }
-
- if (n == EulParOdd) {
- theEulerAngle.x = -theEulerAngle.x;
- theEulerAngle.y = -theEulerAngle.y;
- theEulerAngle.z = -theEulerAngle.z;
- }
-
- ti = theEulerAngle.x;
- tj = theEulerAngle.y;
- th = theEulerAngle.z;
-
- ci = cos(ti);
- cj = cos(tj);
- ch = cos(th);
-
- si = sin(ti);
- sj = sin(tj);
- sh = sin(th);
-
- cc = ci * ch;
- cs = ci * sh;
- sc = si * ch;
- ss = si * sh;
-
- if (s == EulRepYes) {
- theMatrix[i][i] = (float)cj;
- theMatrix[i][j] = (float)(sj * si);
- theMatrix[i][k] = (float)(sj * ci);
- theMatrix[j][i] = (float)(sj * sh);
- theMatrix[j][j] = (float)(-cj * ss + cc);
- theMatrix[j][k] = (float)(-cj * cs - sc);
- theMatrix[k][i] = (float)(-sj * ch);
- theMatrix[k][j] = (float)(cj * sc + cs);
- theMatrix[k][k] = (float)(cj * cc - ss);
- } else {
- theMatrix[i][i] = (float)(cj * ch);
- theMatrix[i][j] = (float)(sj * sc - cs);
- theMatrix[i][k] = (float)(sj * cc + ss);
- theMatrix[j][i] = (float)(cj * sh);
- theMatrix[j][j] = (float)(sj * ss + cc);
- theMatrix[j][k] = (float)(sj * cs - sc);
- theMatrix[k][i] = (float)(-sj);
- theMatrix[k][j] = (float)(cj * si);
- theMatrix[k][k] = (float)(cj * ci);
- }
-
- theMatrix[W][X] = 0.0;
- theMatrix[W][Y] = 0.0;
- theMatrix[W][Z] = 0.0;
- theMatrix[X][W] = 0.0;
- theMatrix[Y][W] = 0.0;
- theMatrix[Z][W] = 0.0;
- theMatrix[W][W] = 1.0;
-}
-
-//==============================================================================
-/**
- * Convert matrix to Euler angles (in radians).
- * @param theMatrix incoming matrix
- * @param theOrder 0-23, use EulOrd**** to generate this value
- * @return a set of angles in radians!!!!
- */
-EulerAngles CEulerAngleConverter::Eul_FromHMatrix(HMatrix theMatrix, int theOrder)
-{
- EulerAngles theEulerAngle;
- int i, j, k, h, n, s, f;
-
- EulGetOrd(theOrder, i, j, k, h, n, s, f);
- if (s == EulRepYes) {
- double sy = sqrt(theMatrix[i][j] * theMatrix[i][j] + theMatrix[i][k] * theMatrix[i][k]);
- if (sy > 16 * FLT_EPSILON) {
- theEulerAngle.x = (float)(atan2((double)theMatrix[i][j], (double)theMatrix[i][k]));
- theEulerAngle.y = (float)(atan2((double)sy, (double)theMatrix[i][i]));
- theEulerAngle.z = (float)(atan2((double)theMatrix[j][i], -(double)theMatrix[k][i]));
- } else {
- theEulerAngle.x = (float)(atan2(-(double)theMatrix[j][k], (double)theMatrix[j][j]));
- theEulerAngle.y = (float)(atan2((double)sy, (double)theMatrix[i][i]));
- theEulerAngle.z = 0;
- }
- } else {
- double cy = sqrt(theMatrix[i][i] * theMatrix[i][i] + theMatrix[j][i] * theMatrix[j][i]);
- if (cy > 16 * FLT_EPSILON) {
- theEulerAngle.x = (float)(atan2((double)theMatrix[k][j], (double)theMatrix[k][k]));
- theEulerAngle.y = (float)(atan2(-(double)theMatrix[k][i], (double)cy));
- theEulerAngle.z = (float)(atan2((double)theMatrix[j][i], (double)theMatrix[i][i]));
- } else {
- theEulerAngle.x = (float)(atan2(-(double)theMatrix[j][k], (double)theMatrix[j][j]));
- theEulerAngle.y = (float)(atan2(-(double)theMatrix[k][i], (double)cy));
- theEulerAngle.z = 0;
- }
- }
-
- if (n == EulParOdd) {
- theEulerAngle.x = -theEulerAngle.x;
- theEulerAngle.y = -theEulerAngle.y;
- theEulerAngle.z = -theEulerAngle.z;
- }
-
- if (f == EulFrmR) {
- float t = theEulerAngle.x;
- theEulerAngle.x = theEulerAngle.z;
- theEulerAngle.z = t;
- }
- theEulerAngle.w = (float)theOrder;
- return theEulerAngle;
-}
-
-//==============================================================================
-/**
- * Convert quaternion to Euler angles (in radians).
- * @param theQuaternion incoming quaternion
- * @param theOrder 0-23, use EulOrd**** to generate this value
- * @return the generated angles ( radians )
- */
-EulerAngles CEulerAngleConverter::Eul_FromQuat(Quat theQuaternion, int theOrder)
-{
- HMatrix theMatrix;
- double Nq = theQuaternion.x * theQuaternion.x + theQuaternion.y * theQuaternion.y
- + theQuaternion.z * theQuaternion.z + theQuaternion.w * theQuaternion.w;
- double s = (Nq > 0.0) ? (2.0 / Nq) : 0.0;
- double xs = theQuaternion.x * s;
- double ys = theQuaternion.y * s;
- double zs = theQuaternion.z * s;
- double wx = theQuaternion.w * xs;
- double wy = theQuaternion.w * ys;
- double wz = theQuaternion.w * zs;
- double xx = theQuaternion.x * xs;
- double xy = theQuaternion.x * ys;
- double xz = theQuaternion.x * zs;
- double yy = theQuaternion.y * ys;
- double yz = theQuaternion.y * zs;
- double zz = theQuaternion.z * zs;
-
- theMatrix[X][X] = (float)(1.0 - (yy + zz));
- theMatrix[X][Y] = (float)(xy - wz);
- theMatrix[X][Z] = (float)(xz + wy);
- theMatrix[Y][X] = (float)(xy + wz);
- theMatrix[Y][Y] = (float)(1.0 - (xx + zz));
- theMatrix[Y][Z] = (float)(yz - wx);
- theMatrix[Z][X] = (float)(xz - wy);
- theMatrix[Z][Y] = (float)(yz + wx);
- theMatrix[Z][Z] = (float)(1.0 - (xx + yy));
- theMatrix[W][X] = 0.0;
- theMatrix[W][Y] = 0.0;
- theMatrix[W][Z] = 0.0;
- theMatrix[X][W] = 0.0;
- theMatrix[Y][W] = 0.0;
- theMatrix[Z][W] = 0.0;
- theMatrix[W][W] = 1.0;
-
- return Eul_FromHMatrix(theMatrix, theOrder);
-}
-
-//==============================================================================
-/**
- * Dump the Order information
- */
-const char *CEulerAngleConverter::DumpOrderInfo()
-{
- long theCount = 0;
- long theOrder[24];
- char theOrderStr[24][16];
-
- ::strcpy(theOrderStr[theCount++], "EulOrdXYZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdXYXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXYs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYXs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYZs");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXYXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZXr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXZYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYZYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXYr");
- ::strcpy(theOrderStr[theCount++], "EulOrdYXZr");
- ::strcpy(theOrderStr[theCount++], "EulOrdZXZr");
- ::strcpy(theOrderStr[theCount++], "EulOrdXYZr");
- ::strcpy(theOrderStr[theCount++], "EulOrdZYZr");
-
- theCount = 0;
- theOrder[theCount++] = EulOrdXYZs;
- theOrder[theCount++] = EulOrdXYXs;
- theOrder[theCount++] = EulOrdXZYs;
- theOrder[theCount++] = EulOrdXZXs;
- theOrder[theCount++] = EulOrdYZXs;
- theOrder[theCount++] = EulOrdYZYs;
- theOrder[theCount++] = EulOrdYXZs;
- theOrder[theCount++] = EulOrdYXYs;
- theOrder[theCount++] = EulOrdZXYs;
- theOrder[theCount++] = EulOrdZXZs;
- theOrder[theCount++] = EulOrdZYXs;
- theOrder[theCount++] = EulOrdZYZs;
-
- theOrder[theCount++] = EulOrdZYXr;
- theOrder[theCount++] = EulOrdXYXr;
- theOrder[theCount++] = EulOrdYZXr;
- theOrder[theCount++] = EulOrdXZXr;
- theOrder[theCount++] = EulOrdXZYr;
- theOrder[theCount++] = EulOrdYZYr;
- theOrder[theCount++] = EulOrdZXYr;
- theOrder[theCount++] = EulOrdYXYr;
- theOrder[theCount++] = EulOrdYXZr;
- theOrder[theCount++] = EulOrdZXZr;
- theOrder[theCount++] = EulOrdXYZr;
- theOrder[theCount++] = EulOrdZYZr;
-
- char theSubBuf[256];
- m_OrderInfoBuffer[0] = '\0';
- for (long theIndex = 0; theIndex < 24; ++theIndex) {
- ::sprintf(theSubBuf, " %16s - %ld\n ", theOrderStr[theIndex], theOrder[theIndex]);
- ::strcat(m_OrderInfoBuffer, theSubBuf);
- }
-
- return m_OrderInfoBuffer;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.h b/src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.h
deleted file mode 100644
index d0f53c56..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSEulerAngles.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include <qmath.h>
-
-namespace Q3DStudio {
-//==============================================================================
-// Description
-//==============================================================================
-// QuatTypes.h - Basic type declarations
-// by Ken Shoemake, shoemake@graphics.cis.upenn.edu
-// in "Graphics Gems IV", Academic Press, 1994
-typedef struct
-{
- float x, y, z, w;
-} Quat; /* Quaternion */
-typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
-enum QuatPart { X, Y, Z, W };
-typedef Quat EulerAngles; /* (x,y,z)=ang 1,2,3, w=order code */
-
-#define EulFrmS 0
-#define EulFrmR 1
-#define EulFrm(ord) ((unsigned)(ord)&1)
-#define EulRepNo 0
-#define EulRepYes 1
-#define EulRep(ord) (((unsigned)(ord) >> 1) & 1)
-#define EulParEven 0
-#define EulParOdd 1
-#define EulPar(ord) (((unsigned)(ord) >> 2) & 1)
-#define EulSafe "\000\001\002\000"
-#define EulNext "\001\002\000\001"
-#define EulAxI(ord) ((int)(EulSafe[(((unsigned)(ord) >> 3) & 3)]))
-#define EulAxJ(ord) ((int)(EulNext[EulAxI(ord) + (EulPar(ord) == EulParOdd)]))
-#define EulAxK(ord) ((int)(EulNext[EulAxI(ord) + (EulPar(ord) != EulParOdd)]))
-#define EulAxH(ord) ((EulRep(ord) == EulRepNo) ? EulAxK(ord) : EulAxI(ord))
-
-// EulGetOrd unpacks all useful information about order simultaneously.
-#define EulGetOrd(ord, i, j, k, h, n, s, f) \
- { \
- unsigned o = ord; \
- f = o & 1; \
- o = o >> 1; \
- s = o & 1; \
- o = o >> 1; \
- n = o & 1; \
- o = o >> 1; \
- i = EulSafe[o & 3]; \
- j = EulNext[i + n]; \
- k = EulNext[i + 1 - n]; \
- h = s ? k : i; \
- }
-
-// EulOrd creates an order value between 0 and 23 from 4-tuple choices.
-#define EulOrd(i, p, r, f) (((((((i) << 1) + (p)) << 1) + (r)) << 1) + (f))
-
-// Static axes
-// X = 0, Y = 1, Z = 2 ref QuatPart
-#define EulOrdXYZs EulOrd(0, EulParEven, EulRepNo, EulFrmS)
-#define EulOrdXYXs EulOrd(0, EulParEven, EulRepYes, EulFrmS)
-#define EulOrdXZYs EulOrd(0, EulParOdd, EulRepNo, EulFrmS)
-#define EulOrdXZXs EulOrd(0, EulParOdd, EulRepYes, EulFrmS)
-#define EulOrdYZXs EulOrd(1, EulParEven, EulRepNo, EulFrmS)
-#define EulOrdYZYs EulOrd(1, EulParEven, EulRepYes, EulFrmS)
-#define EulOrdYXZs EulOrd(1, EulParOdd, EulRepNo, EulFrmS)
-#define EulOrdYXYs EulOrd(1, EulParOdd, EulRepYes, EulFrmS)
-#define EulOrdZXYs EulOrd(2, EulParEven, EulRepNo, EulFrmS)
-#define EulOrdZXZs EulOrd(2, EulParEven, EulRepYes, EulFrmS)
-#define EulOrdZYXs EulOrd(2, EulParOdd, EulRepNo, EulFrmS)
-#define EulOrdZYZs EulOrd(2, EulParOdd, EulRepYes, EulFrmS)
-
-// Rotating axes
-#define EulOrdZYXr EulOrd(0, EulParEven, EulRepNo, EulFrmR)
-#define EulOrdXYXr EulOrd(0, EulParEven, EulRepYes, EulFrmR)
-#define EulOrdYZXr EulOrd(0, EulParOdd, EulRepNo, EulFrmR)
-#define EulOrdXZXr EulOrd(0, EulParOdd, EulRepYes, EulFrmR)
-#define EulOrdXZYr EulOrd(1, EulParEven, EulRepNo, EulFrmR)
-#define EulOrdYZYr EulOrd(1, EulParEven, EulRepYes, EulFrmR)
-#define EulOrdZXYr EulOrd(1, EulParOdd, EulRepNo, EulFrmR)
-#define EulOrdYXYr EulOrd(1, EulParOdd, EulRepYes, EulFrmR)
-#define EulOrdYXZr EulOrd(2, EulParEven, EulRepNo, EulFrmR)
-#define EulOrdZXZr EulOrd(2, EulParEven, EulRepYes, EulFrmR)
-#define EulOrdXYZr EulOrd(2, EulParOdd, EulRepNo, EulFrmR)
-#define EulOrdZYZr EulOrd(2, EulParOdd, EulRepYes, EulFrmR)
-
-#ifndef M_PI
-#define M_PI 3.1415926535898
-#endif
-
-#define TODEG(x) x = (float)(x * 180 / M_PI);
-#define TORAD(x) x = (float)(x / 180 * M_PI);
-
-class CEulerAngleConverter
-{
-private:
- char m_OrderInfoBuffer[1024];
-
-public:
- CEulerAngleConverter();
- virtual ~CEulerAngleConverter();
-
-public:
- EulerAngles Eul_(float ai, float aj, float ah, int order);
- Quat Eul_ToQuat(EulerAngles ea);
- void Eul_ToHMatrix(EulerAngles ea, HMatrix M);
- EulerAngles Eul_FromHMatrix(HMatrix M, int order);
- EulerAngles Eul_FromQuat(Quat q, int order);
-
- // Debug Stuff
- const char *DumpOrderInfo();
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFNDTimer.h b/src/Runtime/ogl-runtime/src/system/Qt3DSFNDTimer.h
deleted file mode 100644
index 8241e2ed..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFNDTimer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSTimer.h"
-#include "Qt3DSTypes.h"
-#include "foundation/Qt3DSTime.h"
-
-namespace Q3DStudio {
-class Qt3DSFNDTimer : public ITimeProvider
-{
- Q3DStudio::INT64 GetCurrentTimeMicroSeconds() override
- {
- return qt3ds::foundation::Time::getCurrentTimeInTensOfNanoSeconds() / 100;
- }
-};
-}
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFile.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSFile.cpp
deleted file mode 100644
index a26b7351..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFile.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSFile.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// OS level memory routines
-//==============================================================================
-#if defined(_XENONPLATFORM) || defined(_PCPLATFORM) || defined(_PS3PLATFORM) \
- || defined(_TEGRAPLATFORM) || defined(_LINUXPLATFORM) || defined(_INTEGRITYPLATFORM)
-CFile::TOpen CFile::s_Open = &fopen;
-CFile::TClose CFile::s_Close = &fclose;
-CFile::TRead CFile::s_Read = &fread;
-CFile::TWrite CFile::s_Write = &fwrite;
-CFile::TTell CFile::s_Tell = &ftell;
-CFile::TSeek CFile::s_Seek = &fseek;
-#else
-#error "A platform must be defined"
-#endif
-
-//==============================================================================
-/**
- * Overrides basic memory allocation/deallocation routines
- * @param inOpen fopen replacement method
- * @param inClose fclose replacement method
- * @param inRead fread replacement method
- * @param inWrite fwrite replacement method
- */
-void CFile::SetFileFunctions(const TOpen inOpen, const TClose inClose, const TRead inRead,
- const TWrite inWrite, const TTell inTell, const TSeek inSeek)
-{
- s_Open = inOpen;
- s_Close = inClose;
- s_Read = inRead;
- s_Write = inWrite;
- s_Tell = inTell;
- s_Seek = inSeek;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFile.h b/src/Runtime/ogl-runtime/src/system/Qt3DSFile.h
deleted file mode 100644
index e970cd2d..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFile.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTypes.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Single overridable exit point for all low level file calls.
- */
-class CFile
-{
- //==============================================================================
- // Typedefs
- //==============================================================================
-public:
- typedef enum _E_SEEK {
- E_SEEK_SET = SEEK_SET,
- E_SEEK_CUR = SEEK_CUR,
- E_SEEK_END = SEEK_END
- } E_SEEK;
-
- typedef TFile *(*TOpen)(const char *inFileName, const char *inMode);
- typedef int (*TClose)(TFile *inFile);
- typedef TFileSize (*TRead)(void *inBuffer, TFileSize inSize, TFileSize inCount, TFile *inFile);
- typedef TFileSize (*TWrite)(const void *inBuffer, TFileSize inSize, TFileSize inCount,
- TFile *inFile);
- typedef long (*TTell)(TFile *inFile);
- typedef int (*TSeek)(TFile *inFile, long inOffset, int inOrigin);
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- static TOpen s_Open; ///< function pointer to fopen operation
- static TClose s_Close; ///< function pointer to fclose operation
- static TRead s_Read; ///< function pointer to fread operation
- static TWrite s_Write; ///< function pointer to fwrite operation
- static TTell s_Tell; ///< function pointer to ftell operation
- static TSeek s_Seek; ///< function pointer to fseek operation
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Memory override
- static void SetFileFunctions(const TOpen inOpen, const TClose inClose, const TRead inRead,
- const TWrite inWrite, const TTell inTell, const TSeek inSeek);
-
-public: // Function access
- static TOpen Open() { return s_Open; }
- static TClose Close() { return s_Close; }
- static TRead Read() { return s_Read; }
- static TWrite Write() { return s_Write; }
- static TTell Tell() { return s_Tell; }
- static TSeek Seek() { return s_Seek; }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.cpp
deleted file mode 100644
index 202e4ae7..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "SystemPrefix.h"
-#include "Qt3DSFile.h"
-#include "Qt3DSFileStream.h"
-#include "foundation/Qt3DSLogging.h"
-
-#include <QtCore/qthread.h>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- * @param inFilename the file to open
- * @param inMode the file mode to use
- */
-CFileStream::CFileStream(const CHAR *inFilePath, const CHAR *inMode, BOOL inKeepTrying)
- : m_FileStream(NULL)
- , m_Endian(QT3DS_LITTLE_ENDIAN)
- , m_KeepTrying(inKeepTrying)
-{
- m_TempBuffer.Reserve(sizeof(MATRIX16)); // Preallocated some space
- if (inFilePath)
- Open(inFilePath, inMode);
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CFileStream::~CFileStream()
-{
- Close();
-}
-
-//==============================================================================
-/**
- * Open file.
- * @param inFilename the file to open
- * @param inMode the file mode ( read/write ) to use
- */
-void CFileStream::Open(const CHAR *inFilePath, const CHAR *inMode)
-{
- Close();
- m_FileStream = CFile::Open()(inFilePath, inMode);
- while (m_KeepTrying && !m_FileStream) {
- QThread::msleep(10);
- m_FileStream = CFile::Open()(inFilePath, inMode);
- }
-
- if (m_FileStream)
- m_FilePath = inFilePath;
-}
-
-//==============================================================================
-/**
- * Close file.
- */
-void CFileStream::Close()
-{
- if (m_FileStream) {
- CFile::Close()(m_FileStream);
- m_FileStream = NULL;
- }
-}
-
-//==============================================================================
-/**
- * Check if there is an opened file.
- * @return TRUE if opened, FALSE otherwise.
- */
-BOOL CFileStream::IsOpen() const
-{
- return m_FileStream != NULL;
-}
-
-//==============================================================================
-/**
- * Access the source path of a file stream.
- * @return an empty string if the stream is not open
- */
-const CHAR *CFileStream::GetFilePath() const
-{
- return m_FilePath.toLatin1().constData();
-}
-
-//==============================================================================
-/**
- * Read from stream into memory.
- * @param outMemory the destination of the read
- * @param inByteCount the amount to read
- * @return the number of bytes actually read
- */
-INT32 CFileStream::ReadRawCopy(void *inDestination, const UINT32 inByteCount)
-{
- INT32 lastRead = 0;
- INT32 totalRead = 0;
- do {
- if (totalRead) {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "Failed to read expected amount, retrying, expected "
- << inByteCount << " bytes, got "<< totalRead <<" bytes";
- }
- lastRead = static_cast<INT32>(CFile::Read()(((char *)inDestination) + totalRead, 1,
- inByteCount - totalRead, m_FileStream));
- totalRead += lastRead;
- } while (lastRead && totalRead < (INT32)inByteCount);
-
- if (totalRead != (INT32)inByteCount) {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "Failed to read expected amount, retrying, expected "
- << inByteCount << " bytes, got "<< totalRead <<" bytes";
-
- // Zero out remaining destination buffer.
- // This can, in some cases, avoid a crash and allow the system to survive a partial
- // read.
- INT32 amountLeft = inByteCount - totalRead;
- memset(((char *)inDestination) + totalRead, 0, amountLeft);
- }
- return totalRead;
-}
-
-//==============================================================================
-/**
- * Reads data into internal buffer and return the data pointer for it.
- * @param outMemory pointer to internal data buffer
- * @param inByteCount the amount to read
- * @return the number of bytes actually read
- */
-INT32 CFileStream::ReadRaw(const void *&inPtr, const UINT32 inByteCount)
-{
- m_TempBuffer.Reserve(static_cast<INT32>(inByteCount));
- INT32 theReadSize = ReadRawCopy(m_TempBuffer.Begin(), inByteCount);
- if (theReadSize != (INT32)inByteCount) {
- qCWarning(qt3ds::INVALID_OPERATION)
- << "Failed to read expected amount, retrying, expected "<< inByteCount
- << " bytes, got "<< theReadSize <<" bytes";
- }
- inPtr = m_TempBuffer.Begin();
- return theReadSize;
-}
-
-//==============================================================================
-/**
- * Write from memory to stream.
- * @param inMemory the buffer to write from
- * @param inByteCount the amount to write
- * @return the number of bytes actually written
- */
-INT32 CFileStream::WriteRaw(const void *inSource, const UINT32 inByteCount)
-{
- return static_cast<INT32>(CFile::Write()(inSource, 1, inByteCount, m_FileStream));
-}
-
-//==============================================================================
-/**
- * Offsets the file position by the specified number of bytes
- */
-void CFileStream::Offset(const INT32 inByteCount)
-{
- CFile::Seek()(m_FileStream, inByteCount, CFile::E_SEEK_CUR);
-}
-
-//==============================================================================
-/**
- * Returns the current position of the file stream
- */
-IStream::TStreamPosition CFileStream::Current()
-{
- return static_cast<INT32>(CFile::Tell()(m_FileStream));
-}
-
-//==============================================================================
-/**
- * Sets the stream to the specified position within the file
- */
-void CFileStream::Set(const TStreamPosition &inPosition)
-{
- CFile::Seek()(m_FileStream, inPosition, CFile::E_SEEK_SET);
-}
-
-//==============================================================================
-/**
- * Set the endianess of the file.
- * @warning endian support not implemented
- */
-void CFileStream::SetEndian(const BOOL inEndian)
-{
- m_Endian = inEndian;
-}
-
-//==============================================================================
-/**
- * Get the endianess of the file.
- * @warning endian support not implemented
- */
-BOOL CFileStream::GetEndian()
-{
- return m_Endian;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.h b/src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.h
deleted file mode 100644
index 49e272f4..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFileStream.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSIFileStream.h"
-#include "Qt3DSArray.h"
-#include "Qt3DSEndian.h"
-
-#include <QtCore/QString>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * File stream base class.
- */
-class CFileStream : public IFileStream
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CFileStream(const CHAR *inFilePath = NULL, const CHAR *inMode = "rb",
- BOOL inKeepTrying = false);
- virtual ~CFileStream();
-
-public: // Serializing
- INT32 ReadRawCopy(void *inDestination, const UINT32 inByteCount) override;
- INT32 ReadRaw(const void *&inPtr, const UINT32 inByteCount) override;
- INT32 WriteRaw(const void *inSource, const UINT32 inByteCount) override;
-
- // Seeking
- void Offset(const INT32 inOffset) override;
- TStreamPosition Current() override;
- void Set(const TStreamPosition &inPosition) override;
-
-public: // File Operation
- void Open(const CHAR *inFilePath, const CHAR *inMode) override;
- void Close() override;
- BOOL IsOpen() const override;
- const CHAR *GetFilePath() const override;
-
-public: // Endianess
- void SetEndian(const BOOL inEndian);
- BOOL GetEndian();
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- TFile *m_FileStream;
- QString m_FilePath;
- CArray<UINT8> m_TempBuffer;
- BOOL m_Endian;
- BOOL m_KeepTrying;
- CHAR m_Unused[2]; ///< (padding)
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.h b/src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.h
deleted file mode 100644
index 9f971d81..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include <QtCore/QDebug>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Fixed size Ordered Collection that doesn't support growing.
- */
-template <class T, int Size>
-class CFixedArray
-{
- //==============================================================================
- // Typedefs
- //==============================================================================
-public:
- typedef T TType; ///< Easy access to template type
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- T m_Data[Size]; ///< Allocated memory containing array data
- INT32 m_Capacity; ///< Max number of elements possible
- INT32 m_Count; ///< Current number of elements in array
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- inline CFixedArray();
- inline ~CFixedArray();
-
-public: // Management
- inline void Clear();
- inline INT32 GetCount() const;
- inline INT32 GetCapacity() const;
-
-public: // Stack access
- inline void Push(const T &inValue);
- inline const T &Pop();
-
-public: // Array access
- inline T &operator[](const INT32 inIndex);
- inline void Remove(const INT32 inIndex);
-};
-
-} // namespace Q3DStudio
-
-//==============================================================================
-// Template code
-//==============================================================================
-#include "Qt3DSFixedArray.inl"
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.inl b/src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.inl
deleted file mode 100644
index 55242243..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFixedArray.inl
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1999-2007 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- */
-template <class T, int Size>
-inline CFixedArray<T, Size>::CFixedArray()
- : m_Capacity(Size)
- , m_Count(0)
-{
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-template <class T, int Size>
-inline CFixedArray<T, Size>::~CFixedArray()
-{
-}
-
-//==============================================================================
-/**
- * Remove all elements in the array
- */
-template <class T, int Size>
-inline void CFixedArray<T, Size>::Clear()
-{
- m_Count = 0;
-}
-
-//==============================================================================
-/**
- * Get current count of T in the array
- * @return current count of the array
- */
-template <class T, int Size>
-inline INT32 CFixedArray<T, Size>::GetCount() const
-{
- return m_Count;
-}
-
-//==============================================================================
-/**
- * Get the capacity of the array
- * Capacity reflects the allocated memory size
- * @return capacity of the array
- */
-template <class T, int Size>
-inline INT32 CFixedArray<T, Size>::GetCapacity() const
-{
- return m_Capacity;
-}
-
-//==============================================================================
-/**
- * Insert T to the end of the array
- * @param inValue value of datatype T
- */
-template <class T, int Size>
-inline void CFixedArray<T, Size>::Push(const T &inValue)
-{
- if (m_Count == m_Capacity) {
- qWarning("Trying to push to many objects onto a CFixedArray", "Capacity=%d", m_Capacity);
- return;
- }
-
- m_Data[m_Count] = inValue;
- ++m_Count;
-}
-
-//==============================================================================
-/**
- * Remove and retrieve T which is at the end of the array
- * @return value of datatype T
- */
-template <class T, int Size>
-inline const T &CFixedArray<T, Size>::Pop()
-{
- if (m_Count == 0)
- return {};
-
- --m_Count;
- return m_Data[m_Count];
-}
-
-//==============================================================================
-/**
- * Get T at a particular index position of the array.
- * Need to ensure only valid index is allowed
- * Clear( ) will set the m_counter = 0
- * @param inIndex the index of the array
- * @return reference of value of datatype T
- */
-template <class T, int Size>
-inline T &CFixedArray<T, Size>::operator[](const INT32 inIndex)
-{
- Q3DStudio_ASSERT(inIndex < m_Capacity);
-
- return m_Data[inIndex];
-}
-
-//==============================================================================
-/**
- * Removes a specific entry from the array.
- * Moves all entries below it up, expensive.
- * @param inIndex the index of the entry
- */
-template <class T, int Size>
-inline void CFixedArray<T, Size>::Remove(const INT32 inIndex)
-{
- Q3DStudio_memmove(m_Data + inIndex, m_Data + inIndex + 1, sizeof(T) * (m_Count - inIndex - 1));
- --m_Count;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.cpp
deleted file mode 100644
index e96c3ce1..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2010 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "SystemPrefix.h"
-#include "Qt3DSFunctionWrappers.h"
-
-using namespace Q3DStudio;
-
-//==============================================================================
-/**
-* CTOR
-*/
-IFunctionWrapper::IFunctionWrapper()
- : m_Cost(0)
-{
-}
-
-//==============================================================================
-/**
-* Retrieve the cost associated with this function.
-* Should be zero or greater
-*/
-INT32 IFunctionWrapper::GetCost()
-{
- return m_Cost;
-}
-
-//==============================================================================
-/**
-* Sets the cost associated with this function.
-*/
-void IFunctionWrapper::SetCost(const INT32 inCost)
-{
- m_Cost = inCost;
-} \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.h b/src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.h
deleted file mode 100644
index 8fff62de..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSFunctionWrappers.h
+++ /dev/null
@@ -1,416 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2010 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-
-namespace Q3DStudio {
-
-//==============================================================================
-/**
-* Interface for a function wrapper with an associated cost.
-*/
-class IFunctionWrapper
-{
-public:
- IFunctionWrapper();
- virtual ~IFunctionWrapper(){}
-
-public:
- virtual void Execute() = 0;
- INT32 GetCost();
- void SetCost(const INT32 inCost);
-
-protected:
- INT32 m_Cost;
-};
-
-//==============================================================================
-/**
-* 2 arguments function wrapper
-*/
-template <typename TArg1, typename TArg2>
-class CFunctionWrapper2Args : public IFunctionWrapper
-{
-public:
- typedef void (*TFunction)(TArg1 inArg1, TArg2 inArg2);
-
-public:
- CFunctionWrapper2Args(TFunction, TArg1 inArg1, TArg2 inArg2);
-
-public:
- virtual void Execute();
-
-protected:
- TFunction m_Function;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
-};
-
-// Unused
-/*
-template <typename TArg1, typename TArg2, typename TArg3>
-class CFunctionWrapper3Args : public IFunctionWrapper
-{
- public:
- typedef void ( *TFunction )( TArg1 inArg1, TArg2 inArg2, TArg3 inArg3 );
-
- public:
- CFunctionWrapper3Args( TFunction inFunction, TArg1 inArg1, TArg2 inArg2, TArg3
-inArg3 );
-
- public:
- virtual void Execute( );
-
- protected:
- TFunction m_Function;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
- TArg3 m_Arg3;
-};
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4>
-class CFunctionWrapper4Args : public IFunctionWrapper
-{
- public:
- typedef void ( *TFunction )( TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4 inArg4
-);
-
- public:
- CFunctionWrapper4Args( TFunction inFunction, TArg1 inArg1, TArg2 inArg2, TArg3
-inArg3, TArg4 inArg4 );
-
- public:
- virtual void Execute( );
-
- protected:
- TFunction m_Function;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
- TArg3 m_Arg3;
- TArg4 m_Arg4;
-};
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename
-TArg6, typename TArg7, typename TArg8>
-class CFunctionWrapper8Args : public IFunctionWrapper
-{
- public:
- typedef void ( *TFunction )( TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4 inArg4,
-TArg5 inArg5, TArg6 inArg6, TArg7 inArg7, TArg8 inArg8 );
-
- public:
- CFunctionWrapper8Args( TFunction inFunction, TArg1 inArg1, TArg2 inArg2, TArg3
-inArg3, TArg4 inArg4, TArg5 inArg5, TArg6 inArg6, TArg7 inArg7, TArg8 inArg8 );
-
- public:
- virtual void Execute( );
-
- protected:
- TFunction m_Function;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
- TArg3 m_Arg3;
- TArg4 m_Arg4;
- TArg5 m_Arg5;
- TArg6 m_Arg6;
- TArg7 m_Arg7;
- TArg8 m_Arg8;
-};
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename
-TArg6, typename TArg7, typename TArg8, typename TArg9>
-class CFunctionWrapper9Args : public IFunctionWrapper
-{
- public:
- typedef void ( *TFunction )( TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4 inArg4,
-TArg5 inArg5, TArg6 inArg6, TArg7 inArg7, TArg8 inArg8, TArg9 inArg9 );
-
- public:
- CFunctionWrapper9Args( TFunction inFunction, TArg1 inArg1, TArg2 inArg2, TArg3
-inArg3, TArg4 inArg4, TArg5 inArg5, TArg6 inArg6, TArg7 inArg7, TArg8 inArg8, TArg9 inArg9 );
-
- public:
- virtual void Execute( );
-
- protected:
- TFunction m_Function;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
- TArg3 m_Arg3;
- TArg4 m_Arg4;
- TArg5 m_Arg5;
- TArg6 m_Arg6;
- TArg7 m_Arg7;
- TArg8 m_Arg8;
- TArg9 m_Arg9;
-};
-*/
-
-//==============================================================================
-/**
-* 1 argument member function wrapper
-*/
-template <typename TObject, typename TReturn, typename TArg1>
-class CMemberFunctionWrapper1Args : public IFunctionWrapper
-{
-public:
- typedef TReturn (TObject::*TFunction)(TArg1 inArg1);
-
-public:
- CMemberFunctionWrapper1Args(TObject *inObject, TFunction inFunction, TArg1 inArg1);
-
-public:
- virtual void Execute();
-
-protected:
- TFunction m_Function;
- TObject *m_Object;
- TArg1 m_Arg1;
-};
-
-//==============================================================================
-/**
-* 2 argument member function wrapper
-*/
-template <typename TObject, typename TReturn, typename TArg1, typename TArg2>
-class CMemberFunctionWrapper2Args : public IFunctionWrapper
-{
-public:
- typedef TReturn (TObject::*TFunction)(TArg1 inArg1, TArg2 inArg2);
-
-public:
- CMemberFunctionWrapper2Args(TObject *inObject, TFunction inFunction, TArg1 inArg1,
- TArg2 inArg2);
-
-public:
- virtual void Execute();
-
-protected:
- TFunction m_Function;
- TObject *m_Object;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
-};
-
-//==============================================================================
-/**
-* 6 argument member function wrapper
-*/
-template <typename TObject, typename TReturn, typename TArg1, typename TArg2, typename TArg3,
- typename TArg4, typename TArg5, typename TArg6>
-class CMemberFunctionWrapper6Args : public IFunctionWrapper
-{
-public:
- typedef TReturn (TObject::*TFunction)(TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4 inArg4,
- TArg5 inArg5, TArg6 inArg6);
-
-public:
- CMemberFunctionWrapper6Args(TObject *inObject, TFunction inFunction, TArg1 inArg1, TArg2 inArg2,
- TArg3 inArg3, TArg4 inArg4, TArg5 inArg5, TArg6 inArg6);
-
-public:
- virtual void Execute();
-
-protected:
- TFunction m_Function;
- TObject *m_Object;
- TArg1 m_Arg1;
- TArg2 m_Arg2;
- TArg3 m_Arg3;
- TArg4 m_Arg4;
- TArg5 m_Arg5;
- TArg6 m_Arg6;
-};
-
-// Implementation
-template <typename TArg1, typename TArg2>
-CFunctionWrapper2Args<TArg1, TArg2>::CFunctionWrapper2Args(TFunction inFunction, TArg1 inArg1,
- TArg2 inArg2)
- : m_Function(inFunction)
- , m_Arg1(inArg1)
- , m_Arg2(inArg2)
-{
-}
-
-template <typename TArg1, typename TArg2>
-void CFunctionWrapper2Args<TArg1, TArg2>::Execute()
-{
- m_Function(m_Arg1, m_Arg2);
-}
-
-// Unused
-/*
-template <typename TArg1, typename TArg2, typename TArg3>
-CFunctionWrapper3Args<TArg1, TArg2, TArg3>::CFunctionWrapper3Args( TFunction inFunction, TArg1
-inArg1, TArg2 inArg2, TArg3 inArg3 )
-: m_Function( inFunction ),
- m_Arg1( inArg1 ),
- m_Arg2( inArg2 ),
- m_Arg3( inArg3 )
-{
-}
-
-template <typename TArg1, typename TArg2, typename TArg3>
-void CFunctionWrapper3Args<TArg1, TArg2, TArg3>::Execute( )
-{
- m_Function( m_Arg1, m_Arg2, m_Arg3 );
-}
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4>
-CFunctionWrapper4Args<TArg1, TArg2, TArg3, TArg4>::CFunctionWrapper4Args( TFunction inFunction,
-TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4 inArg4 )
-: m_Function( inFunction ),
- m_Arg1( inArg1 ),
- m_Arg2( inArg2 ),
- m_Arg3( inArg3 ),
- m_Arg4( inArg4 )
-{
-}
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4>
-void CFunctionWrapper4Args<TArg1, TArg2, TArg3, TArg4>::Execute( )
-{
- m_Function( m_Arg1, m_Arg2, m_Arg3, m_Arg4 );
-}
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename
-TArg6, typename TArg7, typename TArg8>
-CFunctionWrapper8Args<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7,
-TArg8>::CFunctionWrapper8Args( TFunction inFunction, TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4
-inArg4, TArg5 inArg5, TArg6 inArg6, TArg7 inArg7, TArg8 inArg8 )
-: m_Function( inFunction ),
- m_Arg1( inArg1 ),
- m_Arg2( inArg2 ),
- m_Arg3( inArg3 ),
- m_Arg4( inArg4 ),
- m_Arg5( inArg5 ),
- m_Arg6( inArg6 ),
- m_Arg7( inArg7 ),
- m_Arg8( inArg8 )
-
-{
-}
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename
-TArg6, typename TArg7, typename TArg8>
-void CFunctionWrapper8Args<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>::Execute( )
-{
- m_Function( m_Arg1, m_Arg2, m_Arg3, m_Arg4, m_Arg5, m_Arg6, m_Arg7, m_Arg8 );
-}
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename
-TArg6, typename TArg7, typename TArg8, typename TArg9>
-CFunctionWrapper9Args<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8,
-TArg9>::CFunctionWrapper9Args( TFunction inFunction, TArg1 inArg1, TArg2 inArg2, TArg3 inArg3, TArg4
-inArg4, TArg5 inArg5, TArg6 inArg6, TArg7 inArg7, TArg8 inArg8, TArg9 inArg9 )
-: m_Function( inFunction ),
- m_Arg1( inArg1 ),
- m_Arg2( inArg2 ),
- m_Arg3( inArg3 ),
- m_Arg4( inArg4 ),
- m_Arg5( inArg5 ),
- m_Arg6( inArg6 ),
- m_Arg7( inArg7 ),
- m_Arg8( inArg8 ),
- m_Arg9( inArg9 )
-{
-}
-
-template <typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename
-TArg6, typename TArg7, typename TArg8, typename TArg9>
-void CFunctionWrapper9Args<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>::Execute(
-)
-{
- m_Function( m_Arg1, m_Arg2, m_Arg3, m_Arg4, m_Arg5, m_Arg6, m_Arg7, m_Arg8, m_Arg9 );
-}
-*/
-
-template <typename TObject, typename TReturn, typename TArg1>
-CMemberFunctionWrapper1Args<TObject, TReturn, TArg1>::CMemberFunctionWrapper1Args(
- TObject *inObject, TFunction inFunction, TArg1 inArg1)
- : m_Function(inFunction)
- , m_Object(inObject)
- , m_Arg1(inArg1)
-{
-}
-
-template <typename TObject, typename TReturn, typename TArg1>
-void CMemberFunctionWrapper1Args<TObject, TReturn, TArg1>::Execute()
-{
- (m_Object->*m_Function)(m_Arg1);
-}
-
-template <typename TObject, typename TReturn, typename TArg1, typename TArg2>
-CMemberFunctionWrapper2Args<TObject, TReturn, TArg1, TArg2>::CMemberFunctionWrapper2Args(
- TObject *inObject, TFunction inFunction, TArg1 inArg1, TArg2 inArg2)
- : m_Function(inFunction)
- , m_Object(inObject)
- , m_Arg1(inArg1)
- , m_Arg2(inArg2)
-{
-}
-
-template <typename TObject, typename TReturn, typename TArg1, typename TArg2>
-void CMemberFunctionWrapper2Args<TObject, TReturn, TArg1, TArg2>::Execute()
-{
- (m_Object->*m_Function)(m_Arg1, m_Arg2);
-}
-
-template <typename TObject, typename TReturn, typename TArg1, typename TArg2, typename TArg3,
- typename TArg4, typename TArg5, typename TArg6>
-CMemberFunctionWrapper6Args<TObject, TReturn, TArg1, TArg2, TArg3, TArg4, TArg5,
- TArg6>::CMemberFunctionWrapper6Args(TObject *inObject,
- TFunction inFunction, TArg1 inArg1,
- TArg2 inArg2, TArg3 inArg3,
- TArg4 inArg4, TArg5 inArg5,
- TArg6 inArg6)
- : m_Function(inFunction)
- , m_Object(inObject)
- , m_Arg1(inArg1)
- , m_Arg2(inArg2)
- , m_Arg3(inArg3)
- , m_Arg4(inArg4)
- , m_Arg5(inArg5)
- , m_Arg6(inArg6)
-{
-}
-
-template <typename TObject, typename TReturn, typename TArg1, typename TArg2, typename TArg3,
- typename TArg4, typename TArg5, typename TArg6>
-void CMemberFunctionWrapper6Args<TObject, TReturn, TArg1, TArg2, TArg3, TArg4, TArg5,
- TArg6>::Execute()
-{
- (m_Object->*m_Function)(m_Arg1, m_Arg2, m_Arg3, m_Arg4, m_Arg5, m_Arg6);
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSHash.h b/src/Runtime/ogl-runtime/src/system/Qt3DSHash.h
deleted file mode 100644
index 8baa2dba..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSHash.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSConfig.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Utility class transforming a string into a hash value.
- */
-class CHash
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Static utility
- //==============================================================================
- /**
- * We use the hashing algorithm called "sdbm".
- *
- * This algorithm was created from sdbm (a public-domain reimplementation
- * of ndbm) database library. It was found to do well in scrambling bits,
- * causing better distribution of the keys and fewer splits. it also happens
- * to be a good general hashing function with good distribution. the actual
- * function is hash(i) = hash(i - 1) * 65599 + str[i]; what is included below
- * is the faster version used in gawk. [there is even a faster, duff-device
- * version] the magic constant 65599 was picked out of thin air while
- * experimenting with different constants, and turns out to be a prime. this
- * is one of the algorithms used in berkeley db (see sleepycat) and elsewhere.
- *
- * @param inString the string to hash
- * @return the hash value
- */
- static TStringHash HashString(const CHAR *inString)
- {
- TStringHash theHash = 0;
- INT32 theChar = *inString;
- INT32 theCount = 0;
- while (theChar && (theCount < HASH_LIMIT)) {
- theChar = *inString++;
- theHash = theChar + (theHash << 6) + (theHash << 16) - theHash;
- ++theCount;
- }
-
- return theHash;
- }
-
- //==============================================================================
- /**
- * 31-bit hash with MSB set to 0
- *
- * @param inString the string to hash
- * @return the 31-bit hash value
- */
- static TEventCommandHash HashEventCommand(const CHAR *inString)
- {
- return HashString(inString) & 0x7fffffff;
- }
-
- //==============================================================================
- /**
- * 26-bit hash with MSBs all set to 0
- *
- * @param inString the string to hash
- * @return the 26-bit hash value
- */
- static TAttributeHash HashAttribute(const CHAR *inString)
- {
- return HashString(inString) & 0x03ffffff;
- }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSIFileStream.h b/src/Runtime/ogl-runtime/src/system/Qt3DSIFileStream.h
deleted file mode 100644
index 0b432601..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSIFileStream.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSIStream.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * File stream interface
- */
-class IFileStream : public IStream
-{
-public:
- virtual void Open(const CHAR *inFilePath, const CHAR *inMode) = 0;
- virtual void Close() = 0;
- virtual BOOL IsOpen() const = 0;
- virtual const CHAR *GetFilePath() const = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSIStream.h b/src/Runtime/ogl-runtime/src/system/Qt3DSIStream.h
deleted file mode 100644
index a4c11955..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSIStream.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Pure virtual interface providing the stream for class serialization.
- */
-class IStream
-{
- //==============================================================================
- // Typedef
- //==============================================================================
-public:
- typedef INT32 TStreamPosition;
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- virtual ~IStream(){}
-
-public: // Serializing
- virtual INT32 ReadRawCopy(void *inDestination, const UINT32 inByteCount) = 0;
- virtual INT32 ReadRaw(const void *&inPtr, const UINT32 inByteCount) = 0;
- virtual INT32 WriteRaw(const void *inSource, const UINT32 inByteCount) = 0;
-
- // Seeking
- virtual void Offset(const INT32 inOffset) = 0;
- virtual TStreamPosition Current() = 0;
- virtual void Set(const TStreamPosition &inPosition) = 0;
-
-public: // Template Readers that make a copy
- template <typename T>
- INT32 ReadCopy(T &outValue);
- template <typename T>
- INT32 ReadArrayCopy(T *outValue, const UINT32 inCount);
-
-public: // Template Readers that access value directly
- template <typename T>
- INT32 Read(const T *&inPtr);
- template <typename T>
- INT32 ReadArray(const T *&inPtr, UINT32 inCount);
-
-public: // Template Writers
- template <typename T>
- INT32 Write(const T &inValue);
- template <typename T>
- INT32 WriteArray(const T *inValue, const UINT32 inCount);
-};
-
-/** Notes concerning usage of Read or ReadCopy (and ReadArray and ReadArrayCopy)**/
-/**
-If the value being read fits into 4 bytes (i.e float, int/long), either Read/ReadCopy can be used.
-However, if the read value is going to be accessed frequently (in loops etc), ReadCopy is
-recommended so a copy is available instead of dereferencing.
-
-ReadCopy should be used if the data read is an array or is significantly larger than 4 bytes (like
-vectors or matrixes).
-
-For cases where the value is to be stored in a persistant data structures, ReadCopy should be used.
-
-One important thing about Read/ReadArray, is that the pointer returned is only valid before the next
-Read/ReadyArray is called.
-There is no guarantee that the pointer data will remain unchanged during subsequent calls to
-Read/ReadArray.
-**/
-
-//==============================================================================
-/**
- * Read and assign a value by copying.
- */
-template <typename T>
-INT32 IStream::ReadCopy(T &outValue)
-{
- return ReadRawCopy(&outValue, sizeof(T));
-}
-
-//==============================================================================
-/**
- * Read and copy data to a preallocated array.
- */
-template <typename T>
-INT32 IStream::ReadArrayCopy(T *outValue, const UINT32 inCount)
-{
- return ReadRawCopy(outValue, sizeof(T) * inCount);
-}
-
-//==============================================================================
-/**
- * Obtain a pointer directly to the data.
- */
-template <typename T>
-INT32 IStream::Read(const T *&inPtr)
-{
- return ReadRaw(reinterpret_cast<const void *&>(inPtr), sizeof(T));
-}
-
-//==============================================================================
-/**
- * Obtain a pointer directly to the array data.
- */
-template <typename T>
-INT32 IStream::ReadArray(const T *&inPtr, const UINT32 inCount)
-{
- return ReadRaw(reinterpret_cast<const void *&>(inPtr), sizeof(T) * inCount);
-}
-
-//==============================================================================
-/**
- * Write a value.
- */
-template <typename T>
-INT32 IStream::Write(const T &inValue)
-{
- return WriteRaw(&inValue, sizeof(T));
-}
-
-//==============================================================================
-/**
- * Write an array of values.
- */
-template <typename T>
-INT32 IStream::WriteArray(const T *inValue, const UINT32 inCount)
-{
- return WriteRaw(inValue, sizeof(T) * inCount);
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSITimer.h b/src/Runtime/ogl-runtime/src/system/Qt3DSITimer.h
deleted file mode 100644
index e73fbb95..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSITimer.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * @interface ITimer
- * The base functionality of the timer used by the Kernel
- *
- * Implement this interface per-platform to obtain the required functionality
- */
-class ITimer
-{
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- virtual ~ITimer() {}
-
-public: // Operation
- virtual void Start() = 0;
- virtual void Stop() = 0;
- virtual void Reset() = 0;
- virtual TTimeUnit GetTimeMilliSecs() = 0;
- virtual TMicroSeconds GetTimeMicroSecs() = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMacros.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMacros.h
deleted file mode 100644
index fbc40b4d..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMacros.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSAssert.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Easy iterations over arrays.
- * @param array_type element type
- * @param array_element element variable name getting each entry
- * @param array_container element array we are traversing
- */
-#define FOR_ARRAY(array_type, array_element, array_container) \
- for (array_type *array_element = (array_container).Begin(); \
- array_element != (array_container).End(); ++array_element)
-
-#define FOR_ARRAY_REVERSE(array_type, array_element, array_container) \
- for (array_type *array_element = (array_container).End() - 1; \
- array_element != (array_container).Begin() - 1; --array_element)
-
-//==============================================================================
-/**
- * Return the smallest of two numbers/objects.
- * @param inA one value to compare
- * @param inB another value to compare
- * @return a reference, not a copy, to the smallest of the two values
- */
-template <class T>
-inline const T Q3DStudio_abs(const T &inVal)
-{
- return inVal >= 0 ? inVal : -inVal;
-}
-
-//==============================================================================
-/**
- * Return the smallest of two numbers/objects.
- * @param inA one value to compare
- * @param inB another value to compare
- * @return a reference, not a copy, to the smallest of the two values
- */
-template <typename T>
-inline const T &Q3DStudio_min(const T &inA, const T &inB)
-{
- return inA < inB ? inA : inB;
-}
-
-//==============================================================================
-/**
- * Return the largest of two numbers/objects.
- * @param inA one value to compare
- * @param inB another value to compare
- * @return a reference, not a copy, to the largest of the two values
- */
-template <class T>
-inline const T &Q3DStudio_max(const T &inA, const T &inB)
-{
- return inA > inB ? inA : inB;
-}
-
-//==============================================================================
-/**
- * Return the smallest of three values.
- * @param inA one value to compare
- * @param inB another value to compare
- * @param inC a third value to compare
- * @return a reference, not a copy, to the smallest of the three values
- */
-template <class T>
-inline const T &Q3DStudio_min3(const T &inA, const T &inB, const T &inC)
-{
- return inA < inB ? Q3DStudio_min(inA, inC) : Q3DStudio_min(inB, inC);
-}
-
-//==============================================================================
-/**
- * Return the largest of three values.
- * @param inA one value to compare
- * @param inB another value to compare
- * @param inC a third value to compare
- * @return a reference, not a copy, to the largest of the three values
- */
-template <class T>
-inline const T &Q3DStudio_max3(const T &inA, const T &inB, const T &inC)
-{
- return inA > inB ? Q3DStudio_max(inA, inC) : Q3DStudio_max(inB, inC);
-}
-
-//==============================================================================
-/**
- * Make sure a value is in-bounds between two other values.
- * @param inVal the value to clamp
- * @param inMin the lowest inclusive value
- * @param inMax the highest inclusive value
- * @return a reference to inVal if the value is in bounds,
- inMin if lower than the minimum value, or
- inMax if higher than maximum value.
- */
-template <class T>
-inline const T &Q3DStudio_clamp(const T &inVal, const T &inMin, const T &inMax)
-{
- if (inVal <= inMin)
- return inMin;
- else if (inVal >= inMax)
- return inMax;
-
- return inVal;
-}
-
-//==============================================================================
-/**
- * Return the identified lower and higher values.
- * @param inA one value to compare
- * @param inB another value to compare
- * @param outMin is assigned to the lower of the two compared values
- * @param outMax is assigned to the higher of the two compared values
- */
-template <class T>
-inline void Q3DStudio_minmax(const T &inA, const T &inB, T &outMin, T &outMax)
-{
- if (inA < inB) {
- outMin = inA;
- outMax = inB;
- } else {
- outMin = inB;
- outMax = inA;
- }
-}
-
-//==============================================================================
-/**
- * Identify needed parameters that are not currently referenced.
- */
-#define Q3DStudio_UNREFERENCED_PARAMETER(P) \
- { \
- (void)P; \
- }
-
-//==============================================================================
-/**
- * Assert
- */
-#if defined(_DEBUG) || defined(_PROFILE)
-#define Q3DStudio_ASSERT(inExpression) \
- { \
- if (!(inExpression)) \
- Q3DStudio::CAssert::GetFunction()(#inExpression, __FILE__, __LINE__, __FUNCTION__); \
- }
-#else
-#define Q3DStudio_ASSERT(inExpression) ((void)0)
-#endif // _DEBUG or _PROFILE
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.cpp
deleted file mode 100644
index b5310d0e..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.cpp
+++ /dev/null
@@ -1,897 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMatrix.h"
-#include "Qt3DSVector3.h"
-#include "Qt3DSEulerAngles.h"
-#include "Qt3DSDataLogger.h"
-#include <math.h>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants
-//==============================================================================
-FLOAT g_IdentityInit[4][4] = { { 1.0f, 0.0f, 0.0f, 0.0f },
- { 0.0f, 1.0f, 0.0f, 0.0f },
- { 0.0f, 0.0f, 1.0f, 0.0f },
- { 0.0f, 0.0f, 0.0f, 1.0f } };
-
-const RuntimeMatrix RuntimeMatrix::IDENTITY = RuntimeMatrix(g_IdentityInit);
-extern const FLOAT RUNTIME_EPSILON;
-
-//==============================================================================
-/**
- * Empty constructor.
- * Initializes this matrix to the identity matrix.
- */
-RuntimeMatrix::RuntimeMatrix(const BOOL inInitializeIdentity /*= true*/)
-{
- if (inInitializeIdentity)
- Q3DStudio_memcpy(&m_Data, &IDENTITY, sizeof(m_Data));
-}
-
-//==============================================================================
-/**
- * Copy constructor.
- * @param inMatrix the source matrix to copy
- */
-RuntimeMatrix::RuntimeMatrix(const RuntimeMatrix &inMatrix)
-{
- Q3DStudio_memcpy(&m_Data, &inMatrix.m_Data, sizeof(m_Data));
-}
-
-//==============================================================================
-/**
- * Assignment constructor.
- * Initializes the matrix from an array.
- * @param inComponents an array of 16 values
- */
-RuntimeMatrix::RuntimeMatrix(const FLOAT inComponents[4][4])
-{
- if (inComponents)
- Q3DStudio_memcpy(&m_Data, inComponents, sizeof(m_Data));
-}
-
-//==============================================================================
-/**
- * Sets this matrix to a NULL matrix with all values at zero.
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Zero()
-{
- Q3DStudio_memset(&m_Data, 0, sizeof(m_Data));
- return *this;
-}
-
-//==============================================================================
-/**
- * Sets the matrix to the identity matrix.
- * @return reference to this matrix
- */
-RuntimeMatrix &RuntimeMatrix::Identity()
-{
- Q3DStudio_memcpy(&m_Data, &IDENTITY, sizeof(m_Data));
- return *this;
-}
-
-//==============================================================================
-/**
- * Copies the elements from another matrix.
- * @param inMatrix the source matrix
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Set(const RuntimeMatrix &inMatrix)
-{
- Q3DStudio_memcpy(&m_Data, &inMatrix.m_Data, sizeof(m_Data));
- return *this;
-}
-
-//==============================================================================
-/**
- * Copies the given components to this matrix.
- * @param inComponents an array of 16 components
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Set(const FLOAT inComponents[4][4])
-{
- if (inComponents)
- Q3DStudio_memcpy(&m_Data, inComponents, sizeof(m_Data));
- return *this;
-}
-
-//==============================================================================
-/**
- * Heavily optimized assignment method. This has the same result as creating
- * four full 4x4 matrices and multiplying them together.
- * @todo Look into optimized code.
- * @param inTranslation translation coordinates
- * @param inRotation Euler angle rotations
- * @param inScale scaling dimensions
- * @param inPivot pivot offset vector
- * @param inRotationOrder rotation order
- * @param inCoordinateSystem the coordindate system
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Set(const RuntimeVector3 &inTranslation, const RuntimeVector3 &inRotation,
- const RuntimeVector3 &inScale, const RuntimeVector3 &inPivot, const UINT8 inRotationOrder,
- const UINT8 inCoordinateSystem)
-{
- // *this = m_ScaleMatrix * m_PivotMatrix * m_RotMatrix * m_TransMatrix; // Distributed
- //original - plain speak
-
- RuntimeVector3 theScaledPivot;
- theScaledPivot.m_X = -inPivot.m_X * inScale.m_X;
- theScaledPivot.m_Y = -inPivot.m_Y * inScale.m_Y;
- theScaledPivot.m_Z = -inPivot.m_Z * inScale.m_Z;
-
- // This would take care of rotation in the right order
- RuntimeMatrix theRotation;
- theRotation.SetRotate(inRotation, inRotationOrder, inCoordinateSystem);
-
- Q3DStudio_memcpy(&m_Data, &IDENTITY, sizeof(m_Data));
- m_Data[0][0] = inScale.m_X;
- m_Data[1][1] = inScale.m_Y;
- m_Data[2][2] = inScale.m_Z;
-
- m_Data[3][0] = theScaledPivot.m_X;
- m_Data[3][1] = theScaledPivot.m_Y;
-
- if (inCoordinateSystem == ORIENTATION_LEFT_HANDED)
- m_Data[3][2] = theScaledPivot.m_Z;
- else
- m_Data[3][2] = -theScaledPivot.m_Z;
-
- MultiplyAffine(theRotation); // This could be optimized to only 9 multiplications instead of 16
- // if you do them by hand
-
- m_Data[3][0] += inTranslation.m_X;
- m_Data[3][1] += inTranslation.m_Y;
-
- if (inCoordinateSystem == ORIENTATION_LEFT_HANDED)
- m_Data[3][2] += inTranslation.m_Z;
- else
- m_Data[3][2] += -inTranslation.m_Z;
-
- if (inCoordinateSystem == ORIENTATION_LEFT_HANDED)
- return FlipCoordinateSystem();
-
- return *this;
-}
-
-//==============================================================================
-/**
- * Sets the translation portion of the matrix without affecting the rest.
- *
- * If you want a pure translation matrix you must make sure to start with
- * the identity matrix.
- * @param inTranslate a translation vector
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::SetTranslate(const RuntimeVector3 &inTranslate)
-{
- m_Data[3][0] = inTranslate.m_X;
- m_Data[3][1] = inTranslate.m_Y;
- m_Data[3][2] = inTranslate.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Sets the rotation portion of the matrix without affecting the rest.
- *
- * FYI: The rotate and scale portions overlap. If you want a pure scale matrix
- * you must make sure to start with the identity matrix.
- * @param inRotation a quaternion describing the rotation
- * @return reference to this modified matrix
- */
-// CMatrix& CMatrix::SetRotate( const CQuaternion& inRotation )
-//{
-// inRotation.ToMatrix( *this );
-// return *this;
-//}
-
-//==============================================================================
-/**
- * Sets the rotation portion of the matrix without affecting the rest.
- *
- * FYI: The rotate and scale portions overlap. If you want a pure rotation matrix
- * you must make sure to start with the identity matrix.
- * @param inRotation Euler angle rotation
- * @param inRotationOrder rotation order
- * @param inCoordinateSystem the coordindate system
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::SetRotate(const RuntimeVector3 &inRotation, const UINT8 inRotationOrder,
- const UINT8 inCoordinateSystem)
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
- Q3DStudio_UNREFERENCED_PARAMETER(inCoordinateSystem);
-
- EulerAngles theEulerAngles;
- switch (inRotationOrder) {
- case ROTATIONORDER_XYZ:
- theEulerAngles.x = inRotation.m_X;
- theEulerAngles.y = inRotation.m_Y;
- theEulerAngles.z = inRotation.m_Z;
- theEulerAngles.w = EulOrdXYZs;
- break;
- case ROTATIONORDER_XYZR:
- theEulerAngles.x = inRotation.m_X;
- theEulerAngles.y = inRotation.m_Y;
- theEulerAngles.z = inRotation.m_Z;
- theEulerAngles.w = EulOrdXYZr;
- break;
- case ROTATIONORDER_YZX:
- theEulerAngles.x = inRotation.m_Y;
- theEulerAngles.y = inRotation.m_Z;
- theEulerAngles.z = inRotation.m_X;
- theEulerAngles.w = EulOrdYZXs;
- break;
- case ROTATIONORDER_YZXR:
- theEulerAngles.x = inRotation.m_Y;
- theEulerAngles.y = inRotation.m_Z;
- theEulerAngles.z = inRotation.m_X;
- theEulerAngles.w = EulOrdYZXr;
- break;
- case ROTATIONORDER_ZXY:
- theEulerAngles.x = inRotation.m_Z;
- theEulerAngles.y = inRotation.m_X;
- theEulerAngles.z = inRotation.m_Y;
- theEulerAngles.w = EulOrdZXYs;
- break;
- case ROTATIONORDER_ZXYR:
- theEulerAngles.x = inRotation.m_Z;
- theEulerAngles.y = inRotation.m_X;
- theEulerAngles.z = inRotation.m_Y;
- theEulerAngles.w = EulOrdZXYr;
- break;
- case ROTATIONORDER_XZY:
- theEulerAngles.x = inRotation.m_X;
- theEulerAngles.y = inRotation.m_Z;
- theEulerAngles.z = inRotation.m_Y;
- theEulerAngles.w = EulOrdXZYs;
- break;
- case ROTATIONORDER_XZYR:
- theEulerAngles.x = inRotation.m_X;
- theEulerAngles.y = inRotation.m_Z;
- theEulerAngles.z = inRotation.m_Y;
- theEulerAngles.w = EulOrdXZYr;
- break;
- case ROTATIONORDER_YXZ:
- theEulerAngles.x = inRotation.m_Y;
- theEulerAngles.y = inRotation.m_X;
- theEulerAngles.z = inRotation.m_Z;
- theEulerAngles.w = EulOrdYXZs;
- break;
- case ROTATIONORDER_YXZR:
- theEulerAngles.x = inRotation.m_Y;
- theEulerAngles.y = inRotation.m_X;
- theEulerAngles.z = inRotation.m_Z;
- theEulerAngles.w = EulOrdYXZr;
- break;
- case ROTATIONORDER_ZYX:
- theEulerAngles.x = inRotation.m_Z;
- theEulerAngles.y = inRotation.m_Y;
- theEulerAngles.z = inRotation.m_X;
- theEulerAngles.w = EulOrdZYXs;
- break;
- case ROTATIONORDER_ZYXR:
- theEulerAngles.x = inRotation.m_Z;
- theEulerAngles.y = inRotation.m_Y;
- theEulerAngles.z = inRotation.m_X;
- theEulerAngles.w = EulOrdZYXr;
- break;
- default: // defaults to Studio's rotation type
- theEulerAngles.x = inRotation.m_Y;
- theEulerAngles.y = inRotation.m_X;
- theEulerAngles.z = inRotation.m_Z;
- theEulerAngles.w = EulOrdYXZs;
- break;
- }
-
- theEulerAngles.x *= -1;
- theEulerAngles.y *= -1;
- theEulerAngles.z *= -1;
-
- CEulerAngleConverter theConverter;
- theConverter.Eul_ToHMatrix(theEulerAngles, m_Data);
-
- return *this;
-}
-
-//==============================================================================
-/**
- * Sets the scale portion of the matrix without affecting the rest.
- *
- * FYI: The rotate and scale portions overlap. If you want a pure scale matrix
- * you must make sure to start with the identity matrix.
- * @param inScale scale vector
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::SetScale(const RuntimeVector3 &inScale)
-{
- m_Data[0][0] = inScale.m_X;
- m_Data[1][1] = inScale.m_Y;
- m_Data[2][2] = inScale.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Check this matrix against the identity matrix.
- * @return true if this matrix is equivalent to the identity matrix
- */
-BOOL RuntimeMatrix::IsIdentity() const
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- return *this == IDENTITY;
-}
-
-//==============================================================================
-/**
- * Checks to see if this matrix is affine.
- * An affine matrix has the last row being [ 0 0 0 1 ]
- * @return true if the matrix is affine
- */
-BOOL RuntimeMatrix::IsAffine() const
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- return m_Data[0][3] == 0 && m_Data[1][3] == 0 && m_Data[2][3] == 0 && m_Data[3][3] == 1.0f;
-}
-
-//==============================================================================
-/**
- * Appends the matrix to include a translation. Equivalent to post-multiplying
- * this matrix with a transformation matrix derived from the given vector.
- * @param inTranslation transformation vector applied
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Translate(const RuntimeVector3 &inTranslation)
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- m_Data[3][0] += inTranslation.m_X;
- m_Data[3][1] += inTranslation.m_Y;
- m_Data[3][2] += inTranslation.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Appends the matrix to include a rotation. Equivalent to post-multiplying
- * this matrix with a rotation matrix derived from the given quaternion.
- * @param inRotation the rotation quaternion applied
- * @return reference to this modified matrix
- */
-// CMatrix& CMatrix::Rotate( const CQuaternion& inRotation )
-//{
-// CMatrix theRotation;
-// return MultiplyAffine( inRotation.ToMatrix( theRotation ) );
-//}
-
-//==============================================================================
-/**
- * Appends the matrix to include scaling. Equivalent to post-multiplying
- * this matrix with a scale matrix derived from the given vector.
- * @param inScale the scale vector applied
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Scale(const RuntimeVector3 &inScale)
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- m_Data[0][0] *= inScale.m_X;
- m_Data[0][1] *= inScale.m_X;
- m_Data[0][2] *= inScale.m_X;
-
- m_Data[1][0] *= inScale.m_Y;
- m_Data[1][1] *= inScale.m_Y;
- m_Data[1][2] *= inScale.m_Y;
-
- m_Data[2][0] *= inScale.m_Z;
- m_Data[2][1] *= inScale.m_Z;
- m_Data[2][2] *= inScale.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Flips the matrix elements around the identity diagonal.
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::Transpose()
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- FLOAT theSwap = m_Data[1][0];
- m_Data[1][0] = m_Data[0][1];
- m_Data[0][1] = theSwap;
-
- theSwap = m_Data[2][0];
- m_Data[2][0] = m_Data[0][2];
- m_Data[0][2] = theSwap;
-
- theSwap = m_Data[3][0];
- m_Data[3][0] = m_Data[0][3];
- m_Data[0][3] = theSwap;
-
- theSwap = m_Data[2][1];
- m_Data[2][1] = m_Data[1][2];
- m_Data[1][2] = theSwap;
-
- theSwap = m_Data[3][1];
- m_Data[3][1] = m_Data[1][3];
- m_Data[1][3] = theSwap;
-
- theSwap = m_Data[3][2];
- m_Data[3][2] = m_Data[2][3];
- m_Data[2][3] = theSwap;
-
- return *this;
-}
-
-//==============================================================================
-/**
- * Compute the inverse of a 3D affine matrix; i.e. a matrix with a
- * dimensionality of 4 where the bottom row has the entries (0, 0, 0, 1).
- *
- * This procedure treats the 4 by 4 matrix as a block matrix and
- * calculates the inverse of one submatrix for a significant performance
- * improvement over a general procedure that can invert any non-singular matrix:
-@code
- | | -1 | -1 -1 |
- | A C | | A -C A |
- -1 | | | |
- M = | | = | |
- | 0 1 | | 0 1 |
- | | | |
-@endcode
- * where M is a 4 by 4 matrix,
- * A is the 3 by 3 upper left submatrix of M,
- * C is the 3 by 1 upper right submatrix of M.
- *
- * @return the determinant of matrix
- */
-FLOAT RuntimeMatrix::Invert()
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- const FLOAT PRECISIONLIMIT = 1.0e-07f;
- FLOAT thePositiveDet = 0.0f;
- FLOAT theNegativeDet = 0.0f;
- FLOAT theTempDet;
-
- // Calculate the determinant of submatrix A and determine if the
- // the matrix is singular as limited by the float precision.
- theTempDet = m_Data[0][0] * m_Data[1][1] * m_Data[2][2];
- if (theTempDet >= 0.0f)
- thePositiveDet += theTempDet;
- else
- theNegativeDet += theTempDet;
-
- theTempDet = m_Data[0][1] * m_Data[1][2] * m_Data[2][0];
- if (theTempDet >= 0.0f)
- thePositiveDet += theTempDet;
- else
- theNegativeDet += theTempDet;
-
- theTempDet = m_Data[0][2] * m_Data[1][0] * m_Data[2][1];
- if (theTempDet >= 0.0f)
- thePositiveDet += theTempDet;
- else
- theNegativeDet += theTempDet;
-
- theTempDet = -m_Data[0][2] * m_Data[1][1] * m_Data[2][0];
- if (theTempDet >= 0.0f)
- thePositiveDet += theTempDet;
- else
- theNegativeDet += theTempDet;
-
- theTempDet = -m_Data[0][1] * m_Data[1][0] * m_Data[2][2];
- if (theTempDet >= 0.0f)
- thePositiveDet += theTempDet;
- else
- theNegativeDet += theTempDet;
-
- theTempDet = -m_Data[0][0] * m_Data[1][2] * m_Data[2][1];
- if (theTempDet >= 0.0f)
- thePositiveDet += theTempDet;
- else
- theNegativeDet += theTempDet;
-
- // Is the submatrix A nonsingular? (i.e. there is an inverse?)
- FLOAT theDeterminant = thePositiveDet + theNegativeDet;
- if (theDeterminant != 0
- || ::fabs(theDeterminant / (thePositiveDet - theNegativeDet)) >= PRECISIONLIMIT) {
- RuntimeMatrix theInverse;
- FLOAT theInvDeterminant = 1.0f / theDeterminant;
-
- // Calculate inverse(A) = adj(A) / det(A)
- theInverse.m_Data[0][0] =
- (m_Data[1][1] * m_Data[2][2] - m_Data[1][2] * m_Data[2][1]) * theInvDeterminant;
- theInverse.m_Data[1][0] =
- -(m_Data[1][0] * m_Data[2][2] - m_Data[1][2] * m_Data[2][0]) * theInvDeterminant;
- theInverse.m_Data[2][0] =
- (m_Data[1][0] * m_Data[2][1] - m_Data[1][1] * m_Data[2][0]) * theInvDeterminant;
- theInverse.m_Data[0][1] =
- -(m_Data[0][1] * m_Data[2][2] - m_Data[0][2] * m_Data[2][1]) * theInvDeterminant;
- theInverse.m_Data[1][1] =
- (m_Data[0][0] * m_Data[2][2] - m_Data[0][2] * m_Data[2][0]) * theInvDeterminant;
- theInverse.m_Data[2][1] =
- -(m_Data[0][0] * m_Data[2][1] - m_Data[0][1] * m_Data[2][0]) * theInvDeterminant;
- theInverse.m_Data[0][2] =
- (m_Data[0][1] * m_Data[1][2] - m_Data[0][2] * m_Data[1][1]) * theInvDeterminant;
- theInverse.m_Data[1][2] =
- -(m_Data[0][0] * m_Data[1][2] - m_Data[0][2] * m_Data[1][0]) * theInvDeterminant;
- theInverse.m_Data[2][2] =
- (m_Data[0][0] * m_Data[1][1] - m_Data[0][1] * m_Data[1][0]) * theInvDeterminant;
-
- // Calculate -C * inverse(A)
- theInverse.m_Data[3][0] =
- -(m_Data[3][0] * theInverse.m_Data[0][0] + m_Data[3][1] * theInverse.m_Data[1][0]
- + m_Data[3][2] * theInverse.m_Data[2][0]);
- theInverse.m_Data[3][1] =
- -(m_Data[3][0] * theInverse.m_Data[0][1] + m_Data[3][1] * theInverse.m_Data[1][1]
- + m_Data[3][2] * theInverse.m_Data[2][1]);
- theInverse.m_Data[3][2] =
- -(m_Data[3][0] * theInverse.m_Data[0][2] + m_Data[3][1] * theInverse.m_Data[1][2]
- + m_Data[3][2] * theInverse.m_Data[2][2]);
-
- // assign ourselves to the inverse
- *this = theInverse;
- }
-
- return theDeterminant;
-}
-
-//==============================================================================
-/**
- * Fast multiplication of two affine 4x4 matrices. No affine pre-check.
- * @todo MF - Convert to SSE Assembly Code
- * @param inMatrix the source matrix
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::MultiplyAffine(const RuntimeMatrix &inMatrix)
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- FLOAT theMult[4][4];
-
- theMult[0][0] = m_Data[0][0] * inMatrix.m_Data[0][0] + m_Data[0][1] * inMatrix.m_Data[1][0]
- + m_Data[0][2] * inMatrix.m_Data[2][0];
- theMult[0][1] = m_Data[0][0] * inMatrix.m_Data[0][1] + m_Data[0][1] * inMatrix.m_Data[1][1]
- + m_Data[0][2] * inMatrix.m_Data[2][1];
- theMult[0][2] = m_Data[0][0] * inMatrix.m_Data[0][2] + m_Data[0][1] * inMatrix.m_Data[1][2]
- + m_Data[0][2] * inMatrix.m_Data[2][2];
- theMult[0][3] = 0;
-
- theMult[1][0] = m_Data[1][0] * inMatrix.m_Data[0][0] + m_Data[1][1] * inMatrix.m_Data[1][0]
- + m_Data[1][2] * inMatrix.m_Data[2][0];
- theMult[1][1] = m_Data[1][0] * inMatrix.m_Data[0][1] + m_Data[1][1] * inMatrix.m_Data[1][1]
- + m_Data[1][2] * inMatrix.m_Data[2][1];
- theMult[1][2] = m_Data[1][0] * inMatrix.m_Data[0][2] + m_Data[1][1] * inMatrix.m_Data[1][2]
- + m_Data[1][2] * inMatrix.m_Data[2][2];
- theMult[1][3] = 0;
-
- theMult[2][0] = m_Data[2][0] * inMatrix.m_Data[0][0] + m_Data[2][1] * inMatrix.m_Data[1][0]
- + m_Data[2][2] * inMatrix.m_Data[2][0];
- theMult[2][1] = m_Data[2][0] * inMatrix.m_Data[0][1] + m_Data[2][1] * inMatrix.m_Data[1][1]
- + m_Data[2][2] * inMatrix.m_Data[2][1];
- theMult[2][2] = m_Data[2][0] * inMatrix.m_Data[0][2] + m_Data[2][1] * inMatrix.m_Data[1][2]
- + m_Data[2][2] * inMatrix.m_Data[2][2];
- theMult[2][3] = 0;
-
- theMult[3][0] = m_Data[3][0] * inMatrix.m_Data[0][0] + m_Data[3][1] * inMatrix.m_Data[1][0]
- + m_Data[3][2] * inMatrix.m_Data[2][0] + inMatrix.m_Data[3][0];
- theMult[3][1] = m_Data[3][0] * inMatrix.m_Data[0][1] + m_Data[3][1] * inMatrix.m_Data[1][1]
- + m_Data[3][2] * inMatrix.m_Data[2][1] + inMatrix.m_Data[3][1];
- theMult[3][2] = m_Data[3][0] * inMatrix.m_Data[0][2] + m_Data[3][1] * inMatrix.m_Data[1][2]
- + m_Data[3][2] * inMatrix.m_Data[2][2] + inMatrix.m_Data[3][2];
- theMult[3][3] = 1.0f;
-
- return Set(theMult);
-}
-
-//==============================================================================
-/**
- * Standard matrix multiplication
- * @todo MF - Convert to SSE Assembly Code
- * @param inMatrix matrix to multiply with
- */
-RuntimeMatrix &RuntimeMatrix::Multiply(const RuntimeMatrix &inMatrix)
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- FLOAT theMult[4][4];
-
- theMult[0][0] = m_Data[0][0] * inMatrix.m_Data[0][0] + m_Data[1][0] * inMatrix.m_Data[0][1]
- + m_Data[2][0] * inMatrix.m_Data[0][2] + m_Data[3][0] * inMatrix.m_Data[0][3];
- theMult[0][1] = m_Data[0][1] * inMatrix.m_Data[0][0] + m_Data[1][1] * inMatrix.m_Data[0][1]
- + m_Data[2][1] * inMatrix.m_Data[0][2] + m_Data[3][1] * inMatrix.m_Data[0][3];
- theMult[0][2] = m_Data[0][2] * inMatrix.m_Data[0][0] + m_Data[1][2] * inMatrix.m_Data[0][1]
- + m_Data[2][2] * inMatrix.m_Data[0][2] + m_Data[3][2] * inMatrix.m_Data[0][3];
- theMult[0][3] = m_Data[0][3] * inMatrix.m_Data[0][0] + m_Data[1][3] * inMatrix.m_Data[0][1]
- + m_Data[2][3] * inMatrix.m_Data[0][2] + m_Data[3][3] * inMatrix.m_Data[0][3];
- theMult[1][0] = m_Data[0][0] * inMatrix.m_Data[1][0] + m_Data[1][0] * inMatrix.m_Data[1][1]
- + m_Data[2][0] * inMatrix.m_Data[1][2] + m_Data[3][0] * inMatrix.m_Data[1][3];
- theMult[1][1] = m_Data[0][1] * inMatrix.m_Data[1][0] + m_Data[1][1] * inMatrix.m_Data[1][1]
- + m_Data[2][1] * inMatrix.m_Data[1][2] + m_Data[3][1] * inMatrix.m_Data[1][3];
- theMult[1][2] = m_Data[0][2] * inMatrix.m_Data[1][0] + m_Data[1][2] * inMatrix.m_Data[1][1]
- + m_Data[2][2] * inMatrix.m_Data[1][2] + m_Data[3][2] * inMatrix.m_Data[1][3];
- theMult[1][3] = m_Data[0][3] * inMatrix.m_Data[1][0] + m_Data[1][3] * inMatrix.m_Data[1][1]
- + m_Data[2][3] * inMatrix.m_Data[1][2] + m_Data[3][3] * inMatrix.m_Data[1][3];
- theMult[2][0] = m_Data[0][0] * inMatrix.m_Data[2][0] + m_Data[1][0] * inMatrix.m_Data[2][1]
- + m_Data[2][0] * inMatrix.m_Data[2][2] + m_Data[3][0] * inMatrix.m_Data[2][3];
- theMult[2][1] = m_Data[0][1] * inMatrix.m_Data[2][0] + m_Data[1][1] * inMatrix.m_Data[2][1]
- + m_Data[2][1] * inMatrix.m_Data[2][2] + m_Data[3][1] * inMatrix.m_Data[2][3];
- theMult[2][2] = m_Data[0][2] * inMatrix.m_Data[2][0] + m_Data[1][2] * inMatrix.m_Data[2][1]
- + m_Data[2][2] * inMatrix.m_Data[2][2] + m_Data[3][2] * inMatrix.m_Data[2][3];
- theMult[2][3] = m_Data[0][3] * inMatrix.m_Data[2][0] + m_Data[1][3] * inMatrix.m_Data[2][1]
- + m_Data[2][3] * inMatrix.m_Data[2][2] + m_Data[3][3] * inMatrix.m_Data[2][3];
-
- theMult[3][0] = m_Data[0][0] * inMatrix.m_Data[3][0] + m_Data[1][0] * inMatrix.m_Data[3][1]
- + m_Data[2][0] * inMatrix.m_Data[3][2] + m_Data[3][0] * inMatrix.m_Data[3][3];
- theMult[3][1] = m_Data[0][1] * inMatrix.m_Data[3][0] + m_Data[1][1] * inMatrix.m_Data[3][1]
- + m_Data[2][1] * inMatrix.m_Data[3][2] + m_Data[3][1] * inMatrix.m_Data[3][3];
- theMult[3][2] = m_Data[0][2] * inMatrix.m_Data[3][0] + m_Data[1][2] * inMatrix.m_Data[3][1]
- + m_Data[2][2] * inMatrix.m_Data[3][2] + m_Data[3][2] * inMatrix.m_Data[3][3];
- theMult[3][3] = m_Data[0][3] * inMatrix.m_Data[3][0] + m_Data[1][3] * inMatrix.m_Data[3][1]
- + m_Data[2][3] * inMatrix.m_Data[3][2] + m_Data[3][3] * inMatrix.m_Data[3][3];
-
- return Set(theMult);
-}
-
-//==============================================================================
-/**
- * Toggle between left-hand and right-hand coordinate system
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::FlipCoordinateSystem()
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- // rotation conversion
- m_Data[0][2] *= -1;
- m_Data[1][2] *= -1;
- m_Data[2][0] *= -1;
- m_Data[2][1] *= -1;
-
- // translation conversion
- m_Data[3][2] *= -1;
-
- return *this;
-}
-
-//==============================================================================
-/**
- * Rotate this matrix to align with the rotation of the specified matrix.
- *
- * @param inMatrix the maxtrix we are cloning.
- * @param inMirrorFlag flag indicating that we should flip the z and face the opposite
- *direction.
- * @return This matrix after the rotation.
- */
-RuntimeMatrix &RuntimeMatrix::CloneRotation(const RuntimeMatrix &inMatrix, BOOL inMirrorFlag /*= false*/)
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- // Create the axes
- RuntimeVector3 theZ(inMatrix.Get(2, 0), inMatrix.Get(2, 1), inMatrix.Get(2, 2));
- if (inMirrorFlag)
- theZ *= -1;
- RuntimeVector3 theY(inMatrix.Get(1, 0), inMatrix.Get(1, 1), inMatrix.Get(1, 2));
- RuntimeVector3 theX(theY);
- theX.CrossProduct(theZ);
-
- // Normalize
- theX.Normalize();
- theY.Normalize();
- theZ.Normalize();
-
- // Copy it into the matrix
- m_Data[0][0] = theX.m_X;
- m_Data[0][1] = theX.m_Y;
- m_Data[0][2] = theX.m_Z;
-
- m_Data[1][0] = theY.m_X;
- m_Data[1][1] = theY.m_Y;
- m_Data[1][2] = theY.m_Z;
-
- m_Data[2][0] = theZ.m_X;
- m_Data[2][1] = theZ.m_Y;
- m_Data[2][2] = theZ.m_Z;
-
- return *this;
-}
-
-//==============================================================================
-/**
- * Compute the square distance between the position vectors of two transforms.
- * @param inMatrix the other transform, signifying a global object position for example
- * @return the square of the "distance" between the two transforms
- */
-FLOAT RuntimeMatrix::SquareDistance(const RuntimeMatrix &inMatrix) const
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- FLOAT theResult = 0;
- FLOAT theFactor;
-
- theFactor = m_Data[3][0] - inMatrix.m_Data[3][0];
- theFactor *= theFactor;
- theResult += theFactor;
-
- theFactor = m_Data[3][1] - inMatrix.m_Data[3][1];
- theFactor *= theFactor;
- theResult += theFactor;
-
- theFactor = m_Data[3][2] - inMatrix.m_Data[3][2];
- theFactor *= theFactor;
- theResult += theFactor;
-
- return theResult;
-}
-
-//==============================================================================
-/**
- * Simple assignment operator.
- * @param inMatrix new matrix being assigned
- * @return reference to this modified matrix
- */
-RuntimeMatrix &RuntimeMatrix::operator=(const RuntimeMatrix &inMatrix)
-{
- Q3DStudio_memcpy(&m_Data, &inMatrix.m_Data, sizeof(m_Data));
- return *this;
-}
-
-//==============================================================================
-/**
- * Compares this matrix's elements with another matrix's and returns true
- * if the matrices are equivalent.
- * @param inMatrix the matrix we are comparing against
- * @return true if all elements are within EPSILON of each other.
- */
-BOOL RuntimeMatrix::operator==(const RuntimeMatrix &inMatrix) const
-{
- PerfLogMathEvent1(DATALOGGER_MATRIX);
-
- for (INT32 iRow = 0; iRow < 4; ++iRow) {
- for (INT32 iCol = 0; iCol < 4; ++iCol) {
- if (::fabs(m_Data[iRow][iCol] - inMatrix.m_Data[iRow][iCol]) > RUNTIME_EPSILON)
- return false;
- }
- }
- return true;
-}
-
-//==============================================================================
-/**
- * Compares this matrix's elements with another matrix's and returns true
- * if the matrices are not equivalent.
- * @param inMatrix the matrix we are comparing against
- * @return true if one or more elements are more than EPSILON from each other
- */
-BOOL RuntimeMatrix::operator!=(const RuntimeMatrix &inMatrix) const
-{
- // Reuse same code path..
- return !(*this == inMatrix);
-}
-
-//==============================================================================
-/**
- * Standardized conversion to string.
- * @param outString string becoming a representation for the matrix
- */
-// void CMatrix::ToString( AK_STRING& outString ) const
-//{
-// INT8 theBuffer[ 256 ];
-//
-// Q3DStudio_sprintf
-// (
-// theBuffer, 255,
-// "%.2f %.2f %.2f %.2f "
-// "%.2f %.2f %.2f %.2f "
-// "%.2f %.2f %.2f %.2f "
-// "%.2f %.2f %.2f %.2f",
-//
-// m_Data.m[ 0 ][ 0 ],
-// m_Data.m[ 0 ][ 1 ],
-// m_Data.m[ 0 ][ 2 ],
-// m_Data.m[ 0 ][ 3 ],
-//
-// m_Data.m[ 1 ][ 0 ],
-// m_Data.m[ 1 ][ 1 ],
-// m_Data.m[ 1 ][ 2 ],
-// m_Data.m[ 1 ][ 3 ],
-//
-// m_Data.m[ 2 ][ 0 ],
-// m_Data.m[ 2 ][ 1 ],
-// m_Data.m[ 2 ][ 2 ],
-// m_Data.m[ 2 ][ 3 ],
-//
-// m_Data.m[ 3 ][ 0 ],
-// m_Data.m[ 3 ][ 1 ],
-// m_Data.m[ 3 ][ 2 ],
-// m_Data.m[ 3 ][ 3 ]
-// );
-//
-// outString = theBuffer;
-//}
-//
-////==============================================================================
-///**
-// * Standardized conversion from string.
-// * @param inString string being a representation for the matrix
-// */
-// void CMatrix::FromString( const AK_STRING& inString )
-//{
-// std::sscanf
-// (
-// inString.c_str( ),
-//
-// "%f %f %f %f "
-// "%f %f %f %f "
-// "%f %f %f %f "
-// "%f %f %f %f",
-//
-// &m_Data.m[ 0 ][ 0 ],
-// &m_Data.m[ 0 ][ 1 ],
-// &m_Data.m[ 0 ][ 2 ],
-// &m_Data.m[ 0 ][ 3 ],
-//
-// &m_Data.m[ 1 ][ 0 ],
-// &m_Data.m[ 1 ][ 1 ],
-// &m_Data.m[ 1 ][ 2 ],
-// &m_Data.m[ 1 ][ 3 ],
-//
-// &m_Data.m[ 2 ][ 0 ],
-// &m_Data.m[ 2 ][ 1 ],
-// &m_Data.m[ 2 ][ 2 ],
-// &m_Data.m[ 2 ][ 3 ],
-//
-// &m_Data.m[ 3 ][ 0 ],
-// &m_Data.m[ 3 ][ 1 ],
-// &m_Data.m[ 3 ][ 2 ],
-// &m_Data.m[ 3 ][ 3 ]
-// );
-//}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.h
deleted file mode 100644
index 4ef74420..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMatrix.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class RuntimeVector3;
-
-//==============================================================================
-/**
- * A row major matrix for 3D transformation.
- *
- * Matrix[row][column]
-@code
- | 0 1 2 3 | or | 00 01 02 03 | or | Xx Xy Xz w |
- | 4 5 6 7 | | 10 11 12 13 | | Yx Yy Yz w |
- | 8 9 A B | | 20 21 22 23 | | Zx Zy Zz w |
- | C D E F | | 30 31 32 33 | | Tx Ty Tz w |
-@endcode
- * Rotations are concatenated in the the following order: YXZ
- * All rotations are clockwise when viewed down the positive axis
- * towards the origin.
- */
-class RuntimeMatrix
-{
- //==============================================================================
- // Enumerations
- //==============================================================================
-public:
- enum ERotationOrder {
- ROTATIONORDER_XYZ = 0,
- ROTATIONORDER_YZX,
- ROTATIONORDER_ZXY,
- ROTATIONORDER_XZY,
- ROTATIONORDER_YXZ,
- ROTATIONORDER_ZYX,
-
- ROTATIONORDER_XYZR,
- ROTATIONORDER_YZXR,
- ROTATIONORDER_ZXYR,
- ROTATIONORDER_XZYR,
- ROTATIONORDER_YXZR,
- ROTATIONORDER_ZYXR
- };
-
- enum EOrientation { ORIENTATION_LEFT_HANDED = 0, ORIENTATION_RIGHT_HANDED };
-
- //==============================================================================
- // Constants
- //==============================================================================
-public:
- static const RuntimeMatrix IDENTITY; ///< Enabling fast initialization from static identity matrix
-
- //==============================================================================
- // Fields
- //==============================================================================
-public:
- FLOAT m_Data[4][4]; ///< 16 elements in a 4 x 4
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- RuntimeMatrix(const BOOL inInitializeIdentity = true);
- RuntimeMatrix(const RuntimeMatrix &inMatrix);
- RuntimeMatrix(const FLOAT inComponents[4][4]);
-
-public: // Initialization
- RuntimeMatrix &Zero();
- RuntimeMatrix &Identity();
-
- RuntimeMatrix &Set(const RuntimeMatrix &inMatrix);
- RuntimeMatrix &Set(const FLOAT inComponents[4][4]);
- RuntimeMatrix &Set(const RuntimeVector3 &inTranslation, const RuntimeVector3 &inRotation, const RuntimeVector3 &inScale,
- const RuntimeVector3 &inPivot, const UINT8 inRotationOrder,
- const UINT8 inCoordinateSystem);
-
- RuntimeMatrix &SetTranslate(const RuntimeVector3 &inTranslate);
- RuntimeMatrix &SetRotate(const RuntimeVector3 &inRotation, const UINT8 inRotationOrder = ROTATIONORDER_XYZ,
- const UINT8 inCoordinateSystem = ORIENTATION_LEFT_HANDED);
- RuntimeMatrix &SetScale(const RuntimeVector3 &inScale);
-
-public: // Functions
- BOOL IsIdentity() const;
- BOOL IsAffine() const;
- RuntimeMatrix &Translate(const RuntimeVector3 &inTranslate);
- RuntimeMatrix &Scale(const RuntimeVector3 &inScale);
- RuntimeMatrix &Transpose();
- FLOAT Invert();
- RuntimeMatrix &MultiplyAffine(const RuntimeMatrix &inMatrix);
- RuntimeMatrix &Multiply(const RuntimeMatrix &inMatrix);
- RuntimeMatrix &FlipCoordinateSystem();
- RuntimeMatrix &CloneRotation(const RuntimeMatrix &inMatrix, BOOL inMirrorFlag = false);
- FLOAT SquareDistance(const RuntimeMatrix &inMatrix) const;
-
-public: // Operators
- RuntimeMatrix &operator=(const RuntimeMatrix &inMatrix);
- BOOL operator==(const RuntimeMatrix &inMatrix) const;
- BOOL operator!=(const RuntimeMatrix &inMatrix) const;
-
-public: // Script based accessors
- inline FLOAT Get(const INT32 inRow, const INT32 inColumn) const
- {
- return m_Data[inRow][inColumn];
- }
- inline void Set(const INT32 inRow, const INT32 inColumn, const FLOAT inValue)
- {
- m_Data[inRow][inColumn] = inValue;
- }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemory.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemory.cpp
deleted file mode 100644
index 17fa5c86..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemory.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemory.h"
-
-//==============================================================================
-// OS level memory routines
-//==============================================================================
-Q3DStudio::CMemory::TMalloc Q3DStudio::CMemory::s_Malloc = NULL;
-Q3DStudio::CMemory::TRealloc Q3DStudio::CMemory::s_Realloc = NULL;
-Q3DStudio::CMemory::TFree Q3DStudio::CMemory::s_Free = NULL;
-
-//==============================================================================
-/**
- * Overrides basic memory allocation/deallocation routines
- * @param inMalloc memory allocation routine
- * @param inFree memory deallocation routine
- * @param inRealloc memory reallocation routine
- */
-void Q3DStudio::CMemory::SetMemoryFunctions(const TMalloc inMalloc, const TFree inFree,
- const TRealloc inRealloc)
-{
- s_Malloc = inMalloc;
- s_Realloc = inRealloc;
- s_Free = inFree;
-}
-
-static Q3DStudio::CMemoryManager *s_globalManager = nullptr;
-static Q3DStudio::CMemoryHeap *s_globalHeap = nullptr;
-
-//==============================================================================
-/**
- * Boot up the pooled memory manager and return it.
- * @note The manager has to be initialized before use:
- * GetMemoryManager( ).Initialize( "GlobalManager", g_ChunkSize, g_ChunkCount );
- * @return Q3DStudio::CMemoryManager reference to the global object
- */
-Q3DStudio::CMemoryManager &GetMemoryManager()
-{
- if (!s_globalManager)
- s_globalManager = new Q3DStudio::CMemoryManager;
- return *s_globalManager;
-}
-
-//==============================================================================
-/**
- * Return a reference to the global heap object.
- * @return Q3DStudio::CMemoryHeap reference to the global object
- */
-Q3DStudio::CMemoryHeap &GetMemoryHeap()
-{
- if (!s_globalHeap)
- s_globalHeap = new Q3DStudio::CMemoryHeap;
- return *s_globalHeap;
-}
-
-//==============================================================================
-// Q3DStudio_new operator prototypes (5 args)
-//==============================================================================
-void *operator new(size_t inReportedSize, size_t inOfficialSize, const char *inType,
- const char *inFile, int inLine)
-{
- Q3DStudio_UNREFERENCED_PARAMETER(inReportedSize);
- Q3DStudio_ASSERT(inReportedSize == inOfficialSize);
-
- return Q3DStudio_HANDLER_NEW.Allocate(static_cast<const Q3DStudio::INT32>(inOfficialSize),
- inType, inFile, inLine);
-}
-
-//==============================================================================
-/**
- * Override 'operator delete' in order to track memory usage.
- *
- * So what's the use of the overloaded delete with special arguments? There is
- * actually one case in which it will be called--when an exception is thrown
- * during object construction. As you might recall, there is a contract implicit
- * in the language that if an exception happens during the construction of an object,
- * the memory for this object will be automatically deallocated. It so happens
- * that during object's construction the compiler is still aware of which version
- * of operator new was called to allocate memory. It is therefore able to generate
- * a call to the corresponding version of delete, in case an exception is thrown.
- * After the successful completion of construction, this information is no longer
- * available and the compiler has no means to guess which version of global delete
- * is appropriate for a given object.
- */
-void operator delete(void *inReportedAddress, size_t inOfficialSize, const char *, const char *,
- int)
-{
- Q3DStudio_HANDLER_NEW.Free(inReportedAddress,
- static_cast<const Q3DStudio::INT32>(inOfficialSize));
-}
-
-//==============================================================================
-// Q3DStudio_virtual_new operators (4 args)
-//==============================================================================
-void *operator new(size_t inReportedSize, const char *inType, const char *inFile, int inLine)
-{
- return Q3DStudio::CMemoryFilter::Allocate(static_cast<Q3DStudio::INT32>(inReportedSize), inType,
- inFile, inLine, false);
-}
-
-void operator delete(void *inReportedAddress, const char *, const char *, int)
-{
- Q3DStudio::CMemoryFilter::Free(inReportedAddress);
-}
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemory.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemory.h
deleted file mode 100644
index cc04bf73..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemory.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#ifndef _INTEGRITYPLATFORM
-#include <memory.h>
-#endif
-#include "Qt3DSMemoryHeap.h"
-#include "Qt3DSMemoryManager.h"
-#include "Qt3DSMemoryFilter.h"
-#include "Qt3DSMemoryStatistics.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Single overridable exit point for all low level memory calls.
- */
-class CMemory
-{
- //==============================================================================
- // Typedefs
- //==============================================================================
-public:
- typedef void *(*TMalloc)(size_t inSize);
- typedef void (*TFree)(void *inPtr);
- typedef void *(*TRealloc)(void *inPtr, size_t inSize);
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- static TMalloc s_Malloc; ///< function pointer to malloc operation
- static TFree s_Free; ///< function pointer to free operation
- static TRealloc s_Realloc; ///< function pointer to realloc operation
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Memory override
- static void SetMemoryFunctions(const TMalloc inMalloc, const TFree inFree,
- const TRealloc inRealloc);
-
-public: // Function access
- static TMalloc Malloc() { return s_Malloc; }
- static TFree Free() { return s_Free; }
- static TRealloc Realloc() { return s_Realloc; }
-};
-
-} // namespace Q3DStudio
-
-//==============================================================================
-// Globals
-//==============================================================================
-Q3DStudio::CMemoryManager &GetMemoryManager();
-Q3DStudio::CMemoryHeap &GetMemoryHeap();
-
-//==============================================================================
-// Handlers
-//==============================================================================
-#ifndef Q3DStudio_HANDLER_NEW
-#define Q3DStudio_HANDLER_NEW GetMemoryManager()
-#endif // Q3DStudio_HANDLER_NEW
-
-#ifndef Q3DStudio_HANDLER_ALLOC
-#define Q3DStudio_HANDLER_ALLOC GetMemoryManager()
-#endif // Q3DStudio_HANDLER_ALLOC
-
-#ifndef Q3DStudio_HANDLER_FILTER
-#define Q3DStudio_HANDLER_FILTER GetMemoryManager()
-#endif // Q3DStudio_HANDLER_FILTER
-
-//==============================================================================
-// Q3DStudio new defines
-//==============================================================================
-#undef new
-#undef delete
-
-#ifndef Q3DStudio_new
-#define Q3DStudio_new(type) new (sizeof(type), "class " #type, __FILE__, __LINE__)
-#endif // Q3DStudio_new
-
-#ifndef Q3DStudio_delete
-#define Q3DStudio_delete(ptr, type) \
- if (ptr) { \
- reinterpret_cast<type *>(ptr)->~type(); \
- Q3DStudio_HANDLER_NEW.Free(ptr, sizeof(type)); \
- }
-#endif // Q3DStudio_delete
-
-#ifndef Q3DStudio_virtual_new
-#define Q3DStudio_virtual_new(type) new ("class " #type, __FILE__, __LINE__)
-#endif // Q3DStudio_virtual_new
-
-#ifndef Q3DStudio_virtual_delete
-#define Q3DStudio_virtual_delete(ptr, type) \
- if (ptr) { \
- static_cast<type *>(ptr)->~type(); \
- Q3DStudio::CMemoryFilter::Free(ptr); \
- }
-#endif // Q3DStudio_virtual_delete
-
-//==============================================================================
-// Q3DStudio alloc defines
-//==============================================================================
-#ifndef Q3DStudio_allocate
-#define Q3DStudio_allocate(type, count) \
- reinterpret_cast<type *>(Q3DStudio_HANDLER_ALLOC.Allocate( \
- static_cast<Q3DStudio::INT32>(sizeof(type) * (count)), #type "[]", __FILE__, __LINE__))
-#endif // Q3DStudio_allocate
-
-#ifndef Q3DStudio_allocate_desc
-#define Q3DStudio_allocate_desc(type, count, desc) \
- reinterpret_cast<type *>(Q3DStudio_HANDLER_ALLOC.Allocate( \
- static_cast<Q3DStudio::INT32>(sizeof(type) * (count)), desc, __FILE__, __LINE__))
-#endif // Q3DStudio_allocate_desc
-
-#ifndef Q3DStudio_reallocate
-#define Q3DStudio_reallocate(ptr, type, oldcount, newcount) \
- reinterpret_cast<type *>(Q3DStudio_HANDLER_ALLOC.Reallocate( \
- ptr, static_cast<Q3DStudio::INT32>(sizeof(type) * (oldcount)), \
- static_cast<INT32>(sizeof(type) * (newcount)), #type "[]", __FILE__, __LINE__))
-#endif // Q3DStudio_reallocate
-
-#ifndef Q3DStudio_reallocate_desc
-#define Q3DStudio_reallocate_desc(ptr, type, oldcount, newcount, desc) \
- reinterpret_cast<type *>(Q3DStudio_HANDLER_ALLOC.Reallocate( \
- ptr, static_cast<Q3DStudio::INT32>(sizeof(type) * (oldcount)), \
- static_cast<INT32>(sizeof(type) * (newcount)), desc, __FILE__, __LINE__))
-#endif // Q3DStudio_reallocate_desc
-
-#ifndef Q3DStudio_free
-#define Q3DStudio_free(ptr, type, count) \
- Q3DStudio_HANDLER_ALLOC.Free(ptr, static_cast<Q3DStudio::INT32>(sizeof(type) * (count)))
-#endif // Q3DStudio_free
-
-//==============================================================================
-// Q3DStudio_new - operator prototypes (5 args)
-//==============================================================================
-void *operator new(size_t inReportedSize, size_t inOfficialSize, const char *inType,
- const char *inFile, int inLine);
-void operator delete(void *inReportedAddress, size_t inOfficialSize, const char *, const char *,
- int);
-
-//==============================================================================
-// Q3DStudio_virtual_new and new - operator prototypes (4 args)
-//==============================================================================
-void *operator new(size_t inReportedSize, const char *inType, const char *inFile, int inLine);
-void operator delete(void *inReportedAddress, const char *, const char *, int);
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.cpp
deleted file mode 100644
index f6d6591c..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryFilter.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Allocate a chunk of memory and add a header to track it.
- * @param inSize size of requested memory block, in bytes
- * @param inType allocation description
- * @param inFile file name
- * @param inFunction method name
- * @param inLine line number
- * @param inClear true to clear allocated memory to zero
- * @return void* a pointer to a memory block large enough to hold inSize bytes
- */
-void *CMemoryFilter::Allocate(const INT32 inSize, const CHAR *inType, const CHAR *inFile,
- const INT32 inLine, const BOOL inClear)
-{
- const INT32 theTotalSize = inSize + Q3DStudio_MEMORY_ALIGNMENT;
-
- INT32 *theMemory = reinterpret_cast<INT32 *>(
- Q3DStudio_HANDLER_FILTER.Allocate(theTotalSize, inType, inFile, inLine));
-
- theMemory[0] = FILTER_DOGTAG;
- theMemory[1] = theTotalSize;
-
- if (inClear)
- Q3DStudio_memset(reinterpret_cast<INT8 *>(theMemory) + Q3DStudio_MEMORY_ALIGNMENT, 0,
- inSize);
-
- return reinterpret_cast<INT8 *>(theMemory) + Q3DStudio_MEMORY_ALIGNMENT;
-}
-
-//==============================================================================
-/**
- * Free a block of memory that was allocated and tagged here.
- * @param inPointer pointer given in a previous filter allocation
- */
-void CMemoryFilter::Free(void *inPointer)
-{
- if (!inPointer)
- return;
-
- INT32 *theMemory =
- reinterpret_cast<INT32 *>(reinterpret_cast<INT8 *>(inPointer) - Q3DStudio_MEMORY_ALIGNMENT);
-
- // Sanity check: Did we allocate this memory in the first place?
- // If this throws we may be calling Q3DStudio_virtual_delete on memory that was getten from
- // Q3DStudio_new
- Q3DStudio_ASSERT(FILTER_DOGTAG == theMemory[0]);
- Q3DStudio_HANDLER_FILTER.Free(theMemory, theMemory[1]);
-}
-
-//==============================================================================
-/**
- * Re-allocate an existing chunk of memory and track it.
- * @param inPointer pointer given in a previous allocation
- * @param inNewSize size of requested memory block, in bytes
- * @param inNewType new allocation description
- * @param inFile file name
- * @param inFunction method name
- * @param inLine line number
- * @return void* a pointer to a memory block large enough to hold inSize bytes
- */
-void *CMemoryFilter::Reallocate(void *inPointer, const INT32 inNewSize, const CHAR *inNewType,
- const CHAR *inFile, const INT32 inLine)
-{
- INT32 *theNewMemory = NULL;
- const INT32 theTotalSize = inNewSize + Q3DStudio_MEMORY_ALIGNMENT;
-
- // Dogtag is not valid if the old pointer is NULL
- if (inPointer) {
- INT32 *theOldMemory = reinterpret_cast<INT32 *>(reinterpret_cast<INT8 *>(inPointer)
- - Q3DStudio_MEMORY_ALIGNMENT);
- Q3DStudio_ASSERT(FILTER_DOGTAG == theOldMemory[0]);
- theNewMemory = reinterpret_cast<INT32 *>(Q3DStudio_HANDLER_FILTER.Reallocate(
- theOldMemory, theOldMemory[1], theTotalSize, inNewType, inFile, inLine));
- } else {
- theNewMemory = reinterpret_cast<INT32 *>(
- Q3DStudio_HANDLER_FILTER.Reallocate(NULL, 0, theTotalSize, inNewType, inFile, inLine));
- }
-
- theNewMemory[0] = FILTER_DOGTAG;
- theNewMemory[1] = theTotalSize;
- return reinterpret_cast<INT8 *>(theNewMemory) + Q3DStudio_MEMORY_ALIGNMENT;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.h
deleted file mode 100644
index df9367da..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryFilter.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Aggregation interface for legacy calls that don't remember allocation size.
- *
- * CMemoryManager and its pools require that the size must be sent along with
- * any call, including the Free call. Normal memory calls do not require this
- * information and this filter class is used to intercept these calls and
- * add a header to each call before forwarded to the manager. This thin class
- * allows old school calls such as malloc and free to still use the advantages
- * of a pooled memory system without impacting the cleanliness and memory
- * footprint of the modern system.
- */
-class CMemoryFilter
-{
- //==============================================================================
- // Constants
- //==============================================================================
-protected:
- const static INT32 FILTER_DOGTAG = 0x1337f1d0;
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Allocation Deallocation
- static void *Allocate(const INT32 inSize, const CHAR *inType, const CHAR *inFile,
- const INT32 inLine, const BOOL inClear);
- static void Free(void *inPointer);
- static void *Reallocate(void *inPointer, const INT32 inNewSize, const CHAR *inNewType,
- const CHAR *inFile, const INT32 inLine);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.cpp
deleted file mode 100644
index 4ab36178..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemory.h"
-#include "Qt3DSMemoryHeap.h"
-#include "Qt3DSMemoryStatistics.h"
-#include "Qt3DSIStream.h"
-#include "foundation/Qt3DSLogging.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Static Initialzation
-//==============================================================================
-CMemoryProbe CMemoryHeap::s_Probe;
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
-CMemoryHeap::TMemoryReport CMemoryHeap::s_MemoryReport;
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-
-//==============================================================================
-/**
- * Allocate a chunk of memory and potentially track it.
- * @param inSize size of requested memory block, in bytes
- * @param inDescription allocation description such as class name or pool name
- * @param inFile file name
- * @param inFunction method name
- * @param inLine line number
- * @return void* a pointer to a memory block large enough to hold inSize bytes
- */
-void *CMemoryHeap::Allocate(const INT32 inSize, const CHAR *inDescription, const CHAR *inFile,
- const INT32 inLine)
-{
- // Always track stats and trigger snapshot if this is a new record
- s_Probe.Allocate(inSize);
-
- // Check if we are exceeding the max memory limit
- if (Q3DStudio_MEMORY_LIMIT > 0
- && s_Probe.GetBytes(Q3DStudio::MEMSCOPE_GLOBAL, Q3DStudio::MEMVALUE_CURRENT)
- > Q3DStudio_MEMORY_LIMIT) {
- qCCritical (qt3ds::OUT_OF_MEMORY)
- << "Q3DStudio_MEMORY_UNIT exceeded " << Q3DStudio_MEMORY_LIMIT;
- Q3DStudio_ASSERT(false);
- }
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
- void *theAllocatedPtr = CMemory::Malloc()(static_cast<const size_t>(inSize));
- if (s_MemoryReport.GetCount() < s_MemoryReport.GetCapacity()) {
- SReportEntry theEntry = { theAllocatedPtr, inSize, inDescription, inFile, inLine };
- s_MemoryReport.Push(theEntry);
- } else {
- static BOOL s_FullWarning = false;
- if (!s_FullWarning) {
- qCWarning (qt3ds::TRACE_INFO) << "HeapTracker full. "
- << "Please increase Q3DStudio_MEMORY_HEAPTRACKINGSIZE("
- << Q3DStudio_MEMORY_HEAPTRACKINGSIZE << ") "
- << "to track all allocation and tune your pools to avoid "
- << "hitting the heap.";
- s_FullWarning = true;
- }
- }
- return theAllocatedPtr;
-#else
- Q3DStudio_UNREFERENCED_PARAMETER(inLine);
- Q3DStudio_UNREFERENCED_PARAMETER(inFile);
- Q3DStudio_UNREFERENCED_PARAMETER(inDescription);
-
- return CMemory::Malloc()(static_cast<const size_t>(inSize));
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-}
-
-//==============================================================================
-/**
- * Free a block of memory allocated using CMemoryHeap::Allocate
- * @param inPointer pointer given in a previous allocation
- * @param inSize size of given memory block, in bytes
- */
-void CMemoryHeap::Free(void *inPointer, INT32 inSize)
-{
- // No-Op on NULL
- if (!inPointer)
- return;
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
- RemoveReport(inPointer);
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-
- s_Probe.Free(inSize);
- return CMemory::Free()(inPointer);
-}
-
-//==============================================================================
-/**
- * Re-allocate an existing chunk of memory and potentially track it.
- * @param inPointer pointer given in a previous allocation
- * @param inOldSize size of current memory block, in bytes
- * @param inNewSize size of requested memory block, in bytes
- * @param inNewDescription allocation description such as class name or pool name
- * @param inFile file name
- * @param inFunction method name
- * @param inLine line number
- * @return void* a pointer to a memory block large enough to hold inSize bytes
- */
-void *CMemoryHeap::Reallocate(void *inPointer, const INT32 inOldSize, const INT32 inNewSize,
- const CHAR *inNewDescription, const CHAR *inFile, const INT32 inLine)
-{
- // Make sure this isn't a new malloc
- if (!inPointer)
- return Allocate(inNewSize, inNewDescription, inFile, inLine);
-
- // Always track stats and record new high if it's a record
- s_Probe.Allocate(inNewSize);
- s_Probe.Free(inOldSize);
-
- // Check if we are exceeding the max memory limit
- Q3DStudio_ASSERT(Q3DStudio_MEMORY_LIMIT == 0
- ? true
- : s_Probe.GetBytes(Q3DStudio::MEMSCOPE_GLOBAL, Q3DStudio::MEMVALUE_CURRENT)
- < Q3DStudio_MEMORY_LIMIT);
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
- RemoveReport(inPointer);
-
- void *theReallocatedPtr = CMemory::Realloc()(inPointer, static_cast<const size_t>(inNewSize));
-
- SReportEntry theEntry = { theReallocatedPtr, inNewSize, inNewDescription, inFile, inLine };
- s_MemoryReport.Push(theEntry);
-
- return theReallocatedPtr;
-#else
- return CMemory::Realloc()(inPointer, static_cast<const size_t>(inNewSize));
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-}
-
-//==============================================================================
-/**
- * Retrieves memory info about a particular allocation
- * @param inPointer allocated memory
- * @return SMemoryHeapReportEntry* memory report
- */
-CMemoryHeap::SReportEntry *CMemoryHeap::FindReport(void *inPointer)
-{
- Q3DStudio_UNREFERENCED_PARAMETER(inPointer);
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
- INT32 theEnd = s_MemoryReport.GetCount();
- for (INT32 theIndex = 0; theIndex < theEnd; ++theIndex)
- if (s_MemoryReport[theIndex].m_AllocatedPointer == inPointer)
- return &s_MemoryReport[theIndex];
-
- Q3DStudio_ASSERT(false);
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-
- return NULL;
-}
-
-//==============================================================================
-/**
- * Removes memory info due to a deallocation.
- * @param inPointer allocated memory
- */
-void CMemoryHeap::RemoveReport(void *inPointer)
-{
- Q3DStudio_UNREFERENCED_PARAMETER(inPointer);
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
- INT32 theEnd = s_MemoryReport.GetCount();
- for (INT32 theIndex = 0; theIndex < theEnd; ++theIndex) {
- if (s_MemoryReport[theIndex].m_AllocatedPointer == inPointer) {
- s_MemoryReport.Remove(theIndex);
- return;
- }
- }
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-}
-
-//==============================================================================
-/**
- * The memory probe records basic heap activity
- * @return reference to probe
- */
-CMemoryProbe &CMemoryHeap::GetProbe()
-{
- return s_Probe;
-}
-
-//==============================================================================
-/**
- * The report records all heap activity
- * @return pointer to report if tracking is on, or NULL
- */
-CMemoryHeap::TMemoryReport *CMemoryHeap::GetReport()
-{
-#if Q3DStudio_MEMORY_HEAPTRACKING
- return &s_MemoryReport;
-#else
- return NULL;
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.h
deleted file mode 100644
index ba7c1306..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryHeap.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryProbe.h"
-#include "Qt3DSFixedArray.h"
-#include "Qt3DSMemorySettings.h"
-
-//==============================================================================
-/**
- * Low level entry points to the heap.
- *
- * Do not call these directly. Use Q3DStudio_new or Q3DStudio_allocate instead since
- * those use the pools.
- * @see CMemoryHeap
- */
-#define Q3DStudio_heap_allocate(size, desc) \
- Q3DStudio::CMemoryHeap::Allocate(size, desc, __FILE__, __LINE__)
-#define Q3DStudio_heap_reallocate(ptr, oldsize, newsize, newdesc) \
- Q3DStudio::CMemoryHeap::Reallocate(ptr, oldsize, newsize, newdesc, __FILE__, _LINE__)
-#define Q3DStudio_heap_free(ptr, size) Q3DStudio::CMemoryHeap::Free(ptr, size)
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class IStream;
-
-//==============================================================================
-/**
- * Last memory interface before calls to memory callbacks or OS malloc.
- *
- * First of all, don't call this class directy. Use the macros
- * Q3DStudio_heap_allocate and Q3DStudio_heap_free instead since they fill out file,
- * line and function parameters for the tracking system.
- *
- * This is the single exit point for all heap memory allocations. Change this
- * code to redirect memory to your own subsystems or add more tracking code to
- * measure memory usage. Note however that most memory requests during runtime
- * will never reach this point since memory pools will handle those requests.
- * Large memory requests and emergency scenarios will still end up here.
- *
- * @note This class contains the only three real memory calls in Runtime.
- */
-class CMemoryHeap
-{
- //==============================================================================
- // Structs
- //==============================================================================
-public:
- /// Simple memory log entry
- struct SReportEntry
- {
- const void *m_AllocatedPointer; ///< allocated pointer
- INT32 m_Size; ///< size in bytes
- const CHAR *m_Description; ///< simple description
- const CHAR *m_File; ///< filename
- INT32 m_Line; ///< line number
- };
-
- //==============================================================================
- // Typedefs
- //==============================================================================
-public:
- typedef CFixedArray<SReportEntry, Q3DStudio_MEMORY_HEAPTRACKINGSIZE> TMemoryReport;
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- static CMemoryProbe s_Probe; ///< Light overall allocation statistics
-#if Q3DStudio_MEMORY_HEAPTRACKING
- static TMemoryReport s_MemoryReport; ///< Storage for memory logs
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Allocation/Deallocation
- static void *Allocate(const INT32 inSize, const CHAR *inDescription, const CHAR *inFile,
- const INT32 inLine);
- static void Free(void *inPointer, INT32 inSize);
- static void *Reallocate(void *inPointer, const INT32 inOldSize, const INT32 inNewSize,
- const CHAR *inNewDescription, const CHAR *inFile, const INT32 inLine);
-
-public: // Statistics
- static CMemoryProbe &GetProbe();
- static TMemoryReport *GetReport();
-
-protected: // Low level memory overview
- static SReportEntry *FindReport(void *inPointer);
- static void RemoveReport(void *inPointer);
-
-public: // Report request
- static void Report(IStream *inStream = NULL);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.cpp
deleted file mode 100644
index a1ace59e..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.cpp
+++ /dev/null
@@ -1,453 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemory.h"
-#include "Qt3DSMemoryManager.h"
-#include "Qt3DSMemoryHeap.h"
-#include "Qt3DSMemoryProbe.h"
-#include "Qt3DSMemoryTracker.h"
-#include "Qt3DSMemoryStatistics.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Create a new empty memory pool manager.
- *
- * The manager must be initialized before use or it will forward all requests
- * to the heap.
- */
-CMemoryManager::CMemoryManager()
-{
- // Set default allocations functions if they are not already set
- if (NULL == CMemory::Malloc())
- CMemory::SetMemoryFunctions(&malloc, &free, &realloc);
-
- CMemoryStatistics::AddManager(this);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- Q3DStudio_memset(m_Histogram, 0, sizeof(m_Histogram));
- CMemoryStatistics::Overhead() += sizeof(m_Histogram);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-}
-
-//==============================================================================
-/**
- * Create a new initialized memory pool manager.
- *
- * @param inName short description of manager used in tracker
- * @param inChunkSize array of values describing the chunk size of each pool
- * @param inChunkCount array of values describing the number of chunks in each pool
- */
-CMemoryManager::CMemoryManager(const CHAR *inName,
- const INT32 inChunkSize[Q3DStudio_MEMORY_POOLCOUNT],
- const INT32 inChunkCount[Q3DStudio_MEMORY_POOLCOUNT])
-{
- // Set default allocations functions if they are not already set
- if (NULL == CMemory::Malloc())
- CMemory::SetMemoryFunctions(&malloc, &free, &realloc);
-
- CMemoryStatistics::AddManager(this);
- Initialize(inName, inChunkSize, inChunkCount);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- Q3DStudio_memset(m_Histogram, 0, sizeof(m_Histogram));
- CMemoryStatistics::Overhead() -= sizeof(m_Histogram);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-}
-
-//==============================================================================
-/**
- * Release the memory manager and all owned pools.
- *
- * Nobody better point to memory in these pool because the it will be
- * invalid after this.
- */
-CMemoryManager::~CMemoryManager()
-{
- CMemoryStatistics::RemoveManager(this);
- Release();
-}
-
-//==============================================================================
-/**
- * Configure the pool manager into separate pools of different chunk sizes.
- *
- * The chunk size array has to be increasing values such as:
- * inChunkSize = { 8, 16, 32, 64, 96, 128, 256, 512, 1024 }
- * but count doesn't:
- * inChunkCount = { 500, 200, 1000, 200, 200, 100, 250, 50, 20 }
- *
- * The global memory manager settings are initialized in AKMemory.h
- *
- * @param inName short description of manager used in tracker
- * @param inChunkSize array of Q3DStudio_MEMORY_POOLCOUNT values describing the chunk size
- *of each pool
- * @param inChunkCount array of Q3DStudio_MEMORY_POOLCOUNT values describing the number of
- *chunks in each pool
- */
-void CMemoryManager::Initialize(const CHAR *inName,
- const INT32 inChunkSize[Q3DStudio_MEMORY_POOLCOUNT],
- const INT32 inChunkCount[Q3DStudio_MEMORY_POOLCOUNT])
-{
- // Don't initialize more than once
- Q3DStudio_ASSERT(m_Pool[0].GetChunkCount() == 0);
- Q3DStudio_sprintf(m_Name, sizeof(m_Name), "%s", inName);
-
- for (INT32 thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT; ++thePoolIndex) {
- // Make sure pool are aligned to Q3DStudio_MEMORY_ALIGNMENT or smaller than
- // Q3DStudio_MEMORY_ALIGNMENT
- Q3DStudio_ASSERT(inChunkSize[thePoolIndex] < Q3DStudio_MEMORY_ALIGNMENT
- || (inChunkSize[thePoolIndex] % Q3DStudio_MEMORY_ALIGNMENT) == 0);
- m_Pool[thePoolIndex].Initialize(inName, inChunkSize[thePoolIndex],
- inChunkCount[thePoolIndex]);
- }
-}
-
-//==============================================================================
-/**
- * Release all the memory allocated in Initialize - essentially "uninitialize".
- */
-void CMemoryManager::Release()
-{
- for (INT32 thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT; ++thePoolIndex)
- m_Pool[thePoolIndex].Release();
-}
-
-//==============================================================================
-// ALLOCATION AND DEALLOCATION
-//==============================================================================
-
-//==============================================================================
-/**
- * Fetch a new chunk of memory from the smallest pool possible
- * @param inSize size of requested memory block, in bytes
- * @param inType allocation description such as class name or pool name
- * @param inFile file name
- * @param inFunction method name
- * @param inLine line number
- * @return void* a pointer to a memory block large enough to hold inSize bytes
- */
-void *CMemoryManager::Allocate(INT32 inSize, const CHAR *inType, const CHAR *inFile,
- const INT32 inLine)
-{
- Q3DStudio_ASSERT(inSize >= 0);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_Histogram[Q3DStudio_min<INT32>(inSize, 511)].Add(1);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-
-#if Q3DStudio_MEMORY_LINETRACKING
- inSize += sizeof(CMemoryTracker::SMemoryInfo); // make room for SMemoryInfo
-#endif // Q3DStudio_MEMORY_LINETRACKING
-
- // Find the smallest pool that fits
- void *thePointer = NULL;
- INT32 thePoolIndex = 0;
- while (thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT) {
- // Does this pool fit?
- if (inSize <= m_Pool[thePoolIndex].GetChunkSize()) {
- thePointer = m_Pool[thePoolIndex].Allocate();
- break;
- }
- ++thePoolIndex;
- }
-
- // // Record the amount of wasted bytes in this chunk
- if (thePointer) {
- // Basic tracking
- m_ManagerData.m_Aligned.Allocate(inSize);
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_PoolData[thePoolIndex].m_Aligned.Allocate(inSize);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- }
- // If not, we go to the heap for now.
- else {
- // REFACTOR: Use the next pool size up instead?
- thePointer = CMemoryHeap::Allocate(inSize, inType, inFile, inLine);
- m_ManagerData.m_Overflow.Allocate(inSize);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- if (thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT)
- m_PoolData[thePoolIndex].m_Overflow.Allocate(
- inSize); // Heap allocation due to full memory pool
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- }
-
-#if Q3DStudio_MEMORY_LINETRACKING
- CMemoryTracker::SMemoryInfo *theMemoryInfo =
- reinterpret_cast<CMemoryTracker::SMemoryInfo *>(thePointer);
-
- theMemoryInfo->m_DogTag = CMemoryTracker::TRACKER_DOGTAG;
- theMemoryInfo->m_Line = static_cast<INT16>(inLine);
- theMemoryInfo->m_Size = static_cast<INT16>(inSize - sizeof(CMemoryTracker::SMemoryInfo));
- theMemoryInfo->m_File = inFile;
- theMemoryInfo->m_Type = inType;
-
- m_LineTracker.Remember(theMemoryInfo);
- thePointer = reinterpret_cast<CMemoryTracker::SMemoryInfo *>(thePointer) + 1;
-#endif // Q3DStudio_MEMORY_LINETRACKING
-
- return thePointer;
-}
-
-//==============================================================================
-/**
- * Release a chunk of memory.
- * @param inPointer pointer to memory to be reused
- * @param inSize size of the memory we are releasing, in bytes
- */
-void CMemoryManager::Free(void *inPointer, INT32 inSize)
-{
- if (!inPointer)
- return;
-
- Q3DStudio_ASSERT(inSize >= 0);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_Histogram[Q3DStudio_min<INT32>(inSize, 511)].Delete(1);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-
-#if Q3DStudio_MEMORY_LINETRACKING
- inPointer = reinterpret_cast<CMemoryTracker::SMemoryInfo *>(inPointer) - 1;
- m_LineTracker.Forget(reinterpret_cast<CMemoryTracker::SMemoryInfo *>(inPointer));
- inSize += sizeof(CMemoryTracker::SMemoryInfo);
-#endif // Q3DStudio_MEMORY_LINETRACKING
-
- // Did we get a valid pool?
- INT32 thePoolIndex = FetchPoolIndex(inPointer);
- if (thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT) {
- m_Pool[thePoolIndex].Free(inPointer);
- m_ManagerData.m_Aligned.Free(inSize);
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_PoolData[thePoolIndex].m_Aligned.Free(inSize);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- } else {
- CMemoryHeap::Free(inPointer, inSize);
- m_ManagerData.m_Overflow.Free(inSize);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- if (inSize <= m_Pool[Q3DStudio_MEMORY_POOLCOUNT - 1].GetChunkSize())
- for (thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT; ++thePoolIndex)
- if (inSize <= m_Pool[thePoolIndex].GetChunkSize()) {
- m_PoolData[thePoolIndex].m_Overflow.Free(inSize);
- // This is driving me crazy -CN.
- // Q3DStudio_ASSERT( m_PoolData[thePoolIndex].m_Overflow.GetCalls(
- // MEMSCOPE_GLOBAL, MEMVALUE_CURRENT ) >= 0 );
- break;
- }
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- }
-}
-
-//==============================================================================
-/**
- * Grow the existing memory allocated
- *
- * @param inOldPointer pointer given in a previous allocation
- * @param inOldSize size of current memory block, in bytes
- * @param inNewSize size of requested memory block, in bytes
- * @param inNewType allocation description such as class name or pool name
- * @param inFile file name
- * @param inFunction method name
- * @param inLine line number
- * @return void* a pointer to a memory block large enough to hold inSize bytes
- */
-void *CMemoryManager::Reallocate(void *inOldPointer, const INT32 inOldSize, const INT32 inNewSize,
- const CHAR *inNewType, const CHAR *inFile, const INT32 inLine)
-{
- Q3DStudio_ASSERT(inOldSize >= 0 && inNewSize >= 0);
-
- // It's legal to pass NULL as old pointer to realloc
- if (!inOldPointer)
- return Allocate(inNewSize, inNewType, inFile, inLine);
-
- if (inNewSize == 0) {
- Free(inOldPointer, inOldSize);
- return NULL;
- }
-
- // Get a new bigger chunk and transfer old data to it
- void *thePointer = Allocate(inNewSize, inNewType, inFile, inLine);
- Q3DStudio_memcpy(thePointer, inOldPointer, Q3DStudio_min(inOldSize, inNewSize));
-
- // Release old data
- Free(inOldPointer, inOldSize);
- return thePointer;
-}
-
-//==============================================================================
-// IMPLEMENTATION
-//==============================================================================
-
-//==============================================================================
-/**
- * Find the pool that owns the given pointer.
- * @param inPointer pointer to memory to be found
- * @return INT32 index of pool or Q3DStudio_MEMORY_POOLCOUNT if the chunk can't be found
- */
-INT32 CMemoryManager::FetchPoolIndex(const void *inPointer)
-{
- // Find pool that owns the pointer
- INT32 thePoolIndex = 0;
- while (thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT) {
- if (m_Pool[thePoolIndex].OwnsChunk(inPointer))
- return thePoolIndex;
- ++thePoolIndex;
- }
-
- return Q3DStudio_MEMORY_POOLCOUNT;
-}
-
-//==============================================================================
-// STATISTICS
-//==============================================================================
-
-//==============================================================================
-/**
- * Return the text identifier of the manager
- * @return the name, max 32 bytes long
- */
-const CHAR *CMemoryManager::GetName()
-{
- return m_Name;
-}
-
-//==============================================================================
-/**
- * Reset all probe statistics
- */
-void CMemoryManager::Reset()
-{
- m_ManagerData.m_Aligned.Reset();
- m_ManagerData.m_Overflow.Reset();
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- for (INT32 thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT; ++thePoolIndex) {
- m_Pool[thePoolIndex].GetProbe().Reset();
- m_PoolData[thePoolIndex].m_Aligned.Reset();
- m_PoolData[thePoolIndex].m_Overflow.Reset();
- }
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-}
-
-//==============================================================================
-/**
- * Retrieve a particular memory pool
- * @param inPoolIndex index of the pool
- * @return SPoolData& is a reference to the indicated pool data
- */
-CMemoryPool &CMemoryManager::GetPool(const INT32 inPoolIndex)
-{
- Q3DStudio_ASSERT(inPoolIndex < Q3DStudio_MEMORY_POOLCOUNT && inPoolIndex >= 0);
- return m_Pool[inPoolIndex];
-}
-
-//==============================================================================
-/**
- * Retrieve a particular memory pool
- * @param inPoolIndex index of the pool
- * @return SPoolData& is a reference to the indicated pool data
- */
-CMemoryManager::SPoolData *CMemoryManager::GetPoolData(const INT32 inPoolIndex)
-{
- Q3DStudio_UNREFERENCED_PARAMETER(inPoolIndex);
- Q3DStudio_ASSERT(inPoolIndex < Q3DStudio_MEMORY_POOLCOUNT && inPoolIndex >= 0);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- return m_PoolData + inPoolIndex;
-#else
- return NULL;
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-}
-
-//==============================================================================
-/**
- * Retrieve the number of bytes that were allocated on the heap
- * @return CMemoryProbe as the heap statistics
- */
-CMemoryManager::SPoolData &CMemoryManager::GetManagerData()
-{
- return m_ManagerData;
-}
-
-//==============================================================================
-/**
- * Sum the high level statistics of all the pools.
- * @return CMemoryProbe as the statistics, calculated on the spot
- */
-CMemoryProbe CMemoryManager::GetProbe()
-{
- CMemoryProbe theProbe;
-#if Q3DStudio_MEMORY_POOLTRACKING
- for (INT32 thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT; ++thePoolIndex)
- theProbe.Combine(m_Pool[thePoolIndex].GetProbe());
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- return theProbe;
-}
-
-//==============================================================================
-/**
- * Fetch the tracker if enabled by setting Q3DStudio_MEMORY_LINETRACKING
- * @return CMemoryTracker pointer or NULL
- */
-CMemoryTracker *CMemoryManager::GetLineTracker()
-{
-#if Q3DStudio_MEMORY_LINETRACKING
- return &m_LineTracker;
-#else
- return NULL;
-#endif // Q3DStudio_MEMORY_LINETRACKING
-}
-
-//==============================================================================
-/**
- * Fetch the histogram if enabled by setting Q3DStudio_MEMORY_HISTOGRAM.
- * The histogram counts all requested allocations of the specific size.
- * @return UINT16 array of 512 values, or NULL
- */
-const CMemoryProbe::SValue *CMemoryManager::GetHistogram()
-{
-#if Q3DStudio_MEMORY_POOLTRACKING
- return m_Histogram;
-#else
- return NULL;
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.h
deleted file mode 100644
index fa54fce7..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryManager.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryPool.h"
-#include "Qt3DSMemoryProbe.h"
-#include "Qt3DSMemoryTracker.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class CMemoryTracker;
-
-//==============================================================================
-/**
- * Allocation switch-board forwarding requests to pools.
- *
- * This is a memory pool hub acting as a complete heap replacement. The number
- * of pools is hardcoded in Q3DStudio_MEMORY_POOLCOUNT but can be changed with a
- * recompile. The main manager is created in AKMemory and is preconfigured to
- * be generous with memory. Tune these values to match your title since
- * unused chunks are wasteful.
- *
- * @note A pool manager survives fine even when not initialized. In this state
- * it simply forwards each request to the CMemoryHeap. This setup is intentional
- * to enable the default manager to survive long enough to allow future runtime
- * initialization based on complexity of the level or presentation being loaded.
- */
-class CMemoryManager
-{
- //==============================================================================
- // Structs
- //==============================================================================
-public:
- /// External pool usage information
- struct SPoolData
- {
- CMemoryProbe
- m_Aligned; ///< Exact sum of memory use (28byte struct in 32byte pool is still 28 here)
- CMemoryProbe m_Overflow; ///< Failed memory allocation because the pool was full
- };
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- CHAR m_Name[32]; ///< Manager identifier for statistics
- CMemoryPool m_Pool[Q3DStudio_MEMORY_POOLCOUNT]; ///< Actual pool memory objects
- SPoolData m_ManagerData; ///< Track allocations forwarded to heap because they were too large
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- SPoolData
- m_PoolData[Q3DStudio_MEMORY_POOLCOUNT]; ///< Trace pools of different sizes with their usage
- CMemoryProbe::SValue
- m_Histogram[512]; ///< Allocation histogram if active using Q3DStudio_MEMORY_HEAPTRACKING
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-
-#if Q3DStudio_MEMORY_LINETRACKING
- CMemoryTracker
- m_LineTracker; ///< Line allocation tracker if active using Q3DStudio_MEMORY_LINETRACKING
-#endif // Q3DStudio_MEMORY_LINETRACKING
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CMemoryManager();
- CMemoryManager(const CHAR *inName, const INT32 inChunkSize[Q3DStudio_MEMORY_POOLCOUNT],
- const INT32 inChunkCount[Q3DStudio_MEMORY_POOLCOUNT]);
- ~CMemoryManager();
-
-public: // Initialization
- void Initialize(const CHAR *inName, const INT32 inChunkSize[Q3DStudio_MEMORY_POOLCOUNT],
- const INT32 inChunkCount[Q3DStudio_MEMORY_POOLCOUNT]);
- void Release();
-
-public: // Allocation and Deallocation
- void *Allocate(INT32 inSize, const CHAR *inType, const CHAR *inFile, const INT32 inLine);
- void Free(void *inOldPointer, INT32 inSize);
- void *Reallocate(void *inOldPointer, const INT32 inOldSize, const INT32 inNewSize,
- const CHAR *inNewType, const CHAR *inFile, const INT32 inLine);
-
-protected: // Implementation
- INT32 FetchPoolIndex(const void *inPointer);
-
-public: // Statistics
- void Reset();
- const CHAR *GetName();
- CMemoryPool &GetPool(const INT32 inPoolIndex);
- SPoolData *GetPoolData(const INT32 inPoolIndex);
- SPoolData &GetManagerData();
- CMemoryProbe GetProbe();
- CMemoryTracker *GetLineTracker();
- const CMemoryProbe::SValue *GetHistogram();
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.cpp
deleted file mode 100644
index 44545d45..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryPool.h"
-#include "Qt3DSMemoryHeap.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Create a new memory pool.
- *
- */
-CMemoryPool::CMemoryPool()
- : m_ChunkSize(0)
- , m_ChunkCount(0)
- , m_Ceiling(NULL)
- , m_Memory(NULL)
- , m_Top(NULL)
- , m_Hole(NULL)
-{
- m_Description[0] = '\0';
-}
-
-//==============================================================================
-/**
- * Release the memory pool.
- *
- * Nobody better point to this pool because it's illegal after this.
- * We could blast the memory in debug mode to trigger bugs early but most
- * compilers already do this.
- */
-CMemoryPool::~CMemoryPool()
-{
- Release();
-}
-
-//==============================================================================
-/**
- * Configure the memory pool.
- *
- * The pool will allocate inChunkSize * inChunkCount bytes of memory from
- * the heap using Q3DStudio_new, aligned on 4 byte boundaries.
- *
- * @param inName short description of pool - used in tracker
- * @param inChunkSize size in bytes of each memory block, aka chunk
- * @param inChunkCount number of chunks the pool holds
- */
-void CMemoryPool::Initialize(const CHAR *inName, const INT32 inChunkSize, const INT32 inChunkCount)
-{
- Q3DStudio_ASSERT(!m_Memory);
-
- // Round up chunk size to the next even pointer size
- // It needs to be at least pointer size to store the hole linked list
- INT32 theRoundedChunkSize =
- static_cast<INT32>(((inChunkSize + sizeof(void *) - 1) / sizeof(void *)) * sizeof(void *));
-
- // Create pool description
- Q3DStudio_sprintf(m_Description, sizeof(m_Description), "POOL: %s(%dx%d)", inName,
- theRoundedChunkSize, inChunkCount);
-
- // Reserve memory pool
- m_ChunkSize = theRoundedChunkSize;
- m_ChunkCount = inChunkCount;
- m_Memory = reinterpret_cast<INT8 *>(
- Q3DStudio_heap_allocate(m_ChunkSize * m_ChunkCount, m_Description));
- m_Top = m_Memory;
- m_Ceiling = m_Memory + m_ChunkSize * m_ChunkCount;
-}
-
-//==============================================================================
-/**
- * Release all the memory allocated in Initialize - essentially "uninitialize".
- */
-void CMemoryPool::Release()
-{
- Q3DStudio_heap_free(m_Memory, m_ChunkSize * m_ChunkCount);
-
- m_ChunkSize = 0, m_ChunkCount = 0;
- m_Ceiling = NULL;
- m_Memory = NULL;
- m_Top = NULL;
- m_Hole = NULL;
-}
-
-//==============================================================================
-// ALLOCATION AND DEALLOCATION
-//==============================================================================
-
-//==============================================================================
-/**
- * Fetch a new chunk of memory.
- *
- * If there is a pool hole we use that, otherwise feed of the head.
- * Every alloction is tracked in m_Statistics.
- * @return a pointer to inChunkSize bytes of usable memory
- */
-void *CMemoryPool::Allocate()
-{
- if (m_Hole)
- return PopHole();
- else
- return UseTop();
-}
-
-//==============================================================================
-/**
- * Release a chunk of memory and track changes in statistics
- * @param inChunk a pointer to memory to be reused
- */
-void CMemoryPool::Free(void *inChunk)
-{
- Q3DStudio_ASSERT(OwnsChunk(inChunk));
- PushHole(inChunk);
-}
-
-//==============================================================================
-/**
- * Verify that a pointer is owned by a specific pool
- * @param inChunk a pointer to be checked
- * @return BOOL true if the chunk is owned by this pool
- */
-BOOL CMemoryPool::OwnsChunk(const void *inChunk) const
-{
-#ifdef _DEBUG
- // Scan all holes to prevent double releasing memory
- if (!(inChunk >= m_Ceiling || inChunk < m_Memory)) {
- // No freeing anything above the top?
- Q3DStudio_ASSERT(inChunk < m_Top);
-
- // Not freeing any holes?
- void *theHoleChunk = m_Hole;
- while (theHoleChunk) {
- Q3DStudio_ASSERT(inChunk != theHoleChunk);
- theHoleChunk = reinterpret_cast<void *>(*reinterpret_cast<size_t *>(theHoleChunk));
- }
- }
-#endif // DEBUG
-
- return !(inChunk >= m_Ceiling || inChunk < m_Memory);
-}
-
-//==============================================================================
-/**
- * Quick check to see if there are chunks available
- * @return BOOL true if the pool has available chunks
- */
-BOOL CMemoryPool::IsFull() const
-{
- return m_Hole == NULL && GetFreeTops() == 0;
-}
-
-//==============================================================================
-/**
- * Get the total number of free chunks in this pool.
- * @return INT32 is the nunber of free chunks
- */
-INT32 CMemoryPool::GetFreeChunks() const
-{
- return GetFreeTops() + GetFreeHoles();
-}
-
-//==============================================================================
-/**
- * Get the number of holes in this pool.
- * @return INT32 is the nunber of holes
- */
-INT32 CMemoryPool::GetFreeHoles() const
-{
- INT32 theHoleCounter = 0;
- void *theHoleChunk = m_Hole;
-
- // Walk the hole list until there are no more holes
- while (theHoleChunk) {
- theHoleChunk = reinterpret_cast<void *>(*reinterpret_cast<size_t *>(theHoleChunk));
- ++theHoleCounter;
- }
-
- return theHoleCounter;
-}
-
-//==============================================================================
-/**
- * Get the number of chunks left at the top.
- * @return INT32 is the nunber of continous chunks at the top
- */
-INT32 CMemoryPool::GetFreeTops() const
-{
- return static_cast<INT32>((m_Ceiling - m_Top)) / m_ChunkSize;
-}
-
-//==============================================================================
-// IMPLEMENTATION
-//==============================================================================
-
-//==============================================================================
-/**
- * Return a chunch from the top.
- *
- * The top is only used if no pool holes are available.
- * @return a pointer to the chunk at the top
- */
-void *CMemoryPool::UseTop()
-{
- // Out of memory?
- // This is not assert since it may happen during normal runtime.
- if (m_Top >= m_Ceiling)
- return NULL;
-
- void *theChunk = m_Top;
- m_Top += m_ChunkSize;
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_Probe.Allocate(m_ChunkSize);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- return theChunk;
-}
-
-//==============================================================================
-/**
- * Add a new hole to the pool list.
- *
- * The holes are used in a stack-like fashion so the chunk we push in most
- * recently is the first one to be returned next New call.
- * The holes are linked by using the first four bytes to point to the next
- * chunk. We are hijacking them to create a linked list of free chunks.
- * @param inChunk is the just deleted chunk
- */
-void CMemoryPool::PushHole(void *inChunk)
-{
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_Probe.Free(m_ChunkSize);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-
- // Set the pushed chunk to be the new top hole after we
- // link the content of the new chunk to the last top.
- *reinterpret_cast<size_t *>(inChunk) = reinterpret_cast<size_t>(m_Hole);
- m_Hole = inChunk;
-}
-
-//==============================================================================
-/**
- * Get the topmost hole as our chunk.
- *
- * Return the latest hole and relink the list of holes to the top.
- * @return void* is the most recently deleted chunk
- */
-void *CMemoryPool::PopHole()
-{
- Q3DStudio_ASSERT(m_Hole);
-
- // Return the old hole as our new chunk after we
- // set the hole to the second hole in the list.
- void *theChunk = m_Hole;
- m_Hole = reinterpret_cast<void *>(*reinterpret_cast<size_t *>(m_Hole));
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- m_Probe.Allocate(m_ChunkSize);
-#endif // Q3DStudio_MEMORY_POOLTRACKING
- return theChunk;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.h
deleted file mode 100644
index 01b2e418..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryPool.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryProbe.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Managed memory allocation using fixed-size chunks.
- *
- * The pool class implements a generic algorithm that favors reusing recently
- * used memory chunks instead of returning memory continously. Yet, a fresh
- * pool will always return chunks positioned side by side.
- *
- * If a chunk is freed it will be the first to be returned next time a fresh
- * chunk is new'ed. This makes the cache lines happier. Deleted chunks are
- * maintained by linking to each other instead of being stored in a separate
- * memory consuming array.
- */
-class CMemoryPool
-{
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- INT32 m_ChunkSize; ///< size in bytes of each chunk
- INT32 m_ChunkCount; ///< number of chunks in pool
-
- INT8 *m_Ceiling; ///< ceiling memory pointer
- INT8 *m_Memory; ///< base memory pointer, INT8 for easy pointer arithemtic
- INT8 *m_Top; ///< edge of free continous memory
- void *m_Hole; ///< first dis-continous memory chunk if any
-
- CMemoryProbe m_Probe; ///< call and byte data on pool usage
- CHAR m_Description[32]; ///< short description of this pool
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CMemoryPool();
- ~CMemoryPool();
-
-public: // Initialization
- void Initialize(const CHAR *inName, const INT32 inChunkSize, const INT32 inChunkCount);
- void Release();
-
-public: // Allocation and Deallocation
- void *Allocate();
- void Free(void *inChunk);
- BOOL IsFull() const;
- BOOL OwnsChunk(const void *inChunk) const;
-
-protected: // Implementation
- void *UseTop();
- void PushHole(void *inChunk);
- void *PopHole();
-
-public: // Statistics and reports
- INT32 GetFreeHoles() const;
- INT32 GetFreeTops() const;
- INT32 GetFreeChunks() const;
- INT32 GetChunkSize() const { return m_ChunkSize; }
- INT32 GetChunkCount() const { return m_ChunkCount; }
- CMemoryProbe &GetProbe() { return m_Probe; }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.cpp
deleted file mode 100644
index 4e977ee1..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryProbe.h"
-#include "Qt3DSMemoryStatistics.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor - records its size with the statistics class
- */
-CMemoryProbe::CMemoryProbe()
-{
- CMemoryStatistics::Overhead() += sizeof(CMemoryProbe);
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CMemoryProbe::~CMemoryProbe()
-{
- CMemoryStatistics::Overhead() -= sizeof(CMemoryProbe);
-}
-
-//==============================================================================
-/**
- * Track the number related to incrementing memory.
- * @param inByteAmount amount of bytes being allocated
- */
-void CMemoryProbe::Allocate(const INT32 inByteAmount)
-{
- if (inByteAmount > 0) {
- m_Calls[MEMSCOPE_RESET].Add(1);
- m_Bytes[MEMSCOPE_RESET].Add(inByteAmount);
-
- m_Calls[MEMSCOPE_GLOBAL].Add(1);
- m_Bytes[MEMSCOPE_GLOBAL].Add(inByteAmount);
- }
-}
-
-//==============================================================================
-/**
- * Track the number related to incrementing memory.
- * @param inByteAmount amount of bytes being deallocted
- */
-void CMemoryProbe::Free(const INT32 inByteAmount)
-{
- Q3DStudio_ASSERT(inByteAmount >= 0);
- if (inByteAmount > 0) {
- m_Calls[MEMSCOPE_RESET].Delete(1);
- m_Bytes[MEMSCOPE_RESET].Delete(inByteAmount);
-
- m_Calls[MEMSCOPE_GLOBAL].Delete(1);
- m_Bytes[MEMSCOPE_GLOBAL].Delete(inByteAmount);
- }
-}
-
-//==============================================================================
-/**
- * Reset all local statistics. Global values are not reset.
- */
-void CMemoryProbe::Reset()
-{
- m_Calls[MEMSCOPE_RESET].Reset();
- m_Bytes[MEMSCOPE_RESET].Reset();
-}
-
-//==============================================================================
-/**
- * Helper method for adding statistics used by manager to add pool usage.
- * @param inProbe is the stats being added
- */
-void CMemoryProbe::Combine(const CMemoryProbe &inProbe)
-{
- m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_ADDS] +=
- inProbe.m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_ADDS];
- m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_DELETES] +=
- inProbe.m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_DELETES];
- m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_PEAK] +=
- inProbe.m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_PEAK];
- m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_CURRENT] +=
- inProbe.m_Calls[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_CURRENT];
-
- m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_ADDS] +=
- inProbe.m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_ADDS];
- m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_DELETES] +=
- inProbe.m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_DELETES];
- m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_PEAK] +=
- inProbe.m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_PEAK];
- m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_CURRENT] +=
- inProbe.m_Bytes[MEMSCOPE_GLOBAL].m_Value[MEMVALUE_CURRENT];
-
- m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_ADDS] +=
- inProbe.m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_ADDS];
- m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_DELETES] +=
- inProbe.m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_DELETES];
- m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_PEAK] +=
- inProbe.m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_PEAK];
- m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_CURRENT] +=
- inProbe.m_Calls[MEMSCOPE_RESET].m_Value[MEMVALUE_CURRENT];
-
- m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_ADDS] +=
- inProbe.m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_ADDS];
- m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_DELETES] +=
- inProbe.m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_DELETES];
- m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_PEAK] +=
- inProbe.m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_PEAK];
- m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_CURRENT] +=
- inProbe.m_Bytes[MEMSCOPE_RESET].m_Value[MEMVALUE_CURRENT];
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.h
deleted file mode 100644
index 5f0844e8..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryProbe.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include "Qt3DSMacros.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Memory Tracking Enums
-//==============================================================================
-
-/// Track a value - remembering peak and add/del count
-enum EMemoryValue {
- MEMVALUE_ADDS = 0, ///< For example: allocation call count or bytes allocated
- MEMVALUE_DELETES, ///< For example: free call count or bytes deallocated
- MEMVALUE_PEAK, ///< Peak of the current value since the last reset
- MEMVALUE_CURRENT, ///< Current count
- MEMVALUECOUNT
-};
-
-/// Differentiate between full session (global) or since last reset (local)
-enum EMemoryScope {
- MEMSCOPE_RESET = 0, ///< Since last reset
- MEMSCOPE_GLOBAL, ///< Since process start
- MEMSCOPECOUNT
-};
-
-//==============================================================================
-/**
- * Memory allocation counter tracking bytes or calls.
- *
- * A probe instance can be placed to track either number of allocations
- * or the bytes of each allocation. CMemoryManager and CMemoryHeap both
- * record statistics using this class. 64 bytes.
- */
-class CMemoryProbe
-{
- //==============================================================================
- // Structs
- //==============================================================================
-public:
- //==============================================================================
- /**
- * Intelligent number that tracks current, peak, incr. and decr.
- *
- * This value remembers how the amount added, the amount deleted, the highest
- * value, while keeping a current value. These are used by CMemoryProbe when
- * tracking memory allocations.
- */
- struct SValue
- {
- // Fields
- INT32 m_Value[MEMVALUECOUNT]; ///< Four aspects (add,del,current,peak) we are tracking
-
- // Methods
- SValue() { Reset(); }
- void Reset()
- {
- m_Value[MEMVALUE_ADDS] = 0;
- m_Value[MEMVALUE_DELETES] = 0;
- m_Value[MEMVALUE_PEAK] = 0;
- m_Value[MEMVALUE_CURRENT] = 0;
- }
-
- void Delete(INT32 inAmount)
- {
- Q3DStudio_ASSERT(inAmount >= 0);
- m_Value[MEMVALUE_DELETES] += inAmount;
- m_Value[MEMVALUE_CURRENT] -= inAmount;
- }
-
- void Add(INT32 inAmount)
- {
- Q3DStudio_ASSERT(inAmount >= 0);
- m_Value[MEMVALUE_ADDS] += inAmount;
- m_Value[MEMVALUE_CURRENT] += inAmount;
- m_Value[MEMVALUE_PEAK] =
- Q3DStudio_max(m_Value[MEMVALUE_PEAK], m_Value[MEMVALUE_CURRENT]);
- }
- };
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- SValue m_Calls[MEMSCOPECOUNT]; ///< Memory call count
- SValue m_Bytes[MEMSCOPECOUNT]; ///< Memory allocation amount
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Constructor
- CMemoryProbe();
- ~CMemoryProbe();
-
-public: // Operations
- void Reset();
- void Allocate(const INT32 inByteAmount);
- void Free(const INT32 inByteAmount);
- void Combine(const CMemoryProbe &inProbe);
-
-public: // Accessors
- INT32 GetCalls(const EMemoryScope inScope, const EMemoryValue inValue) const
- {
- return m_Calls[inScope].m_Value[inValue];
- }
- INT32 GetBytes(const EMemoryScope inScope, const EMemoryValue inValue) const
- {
- return m_Bytes[inScope].m_Value[inValue];
- }
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemorySettings.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemorySettings.h
deleted file mode 100644
index 54002424..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemorySettings.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTypes.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * GlobalMemoryManager constants
- * NOTE THAT THESE NUMBERS BELOW SHOULD BE ADJUSTED TO FIT YOUR APPLICATION.
- *
- * See the Memory Management section in the documentation for guidelines
- * on memory diagnostics that enable you to optimize these values:
- */
-
-//==============================================================================
-// Memory Pool Configuration
-//==============================================================================
-
-#ifndef Q3DStudio_MEMORY_POOLCOUNT
-#define Q3DStudio_MEMORY_POOLCOUNT 12
-#endif // Q3DStudio_MEMORY_POOLCOUNT
-
-/// A memory pool has a chunk size that defines he size in bytes of each slot
-/// and a chunk count defining how many slots there are of that size.
-/// The pools below thus has 128 slots of 4 bytes, 256 slots of 8 bytes etc:
-const INT32 g_ChunkSize[Q3DStudio_MEMORY_POOLCOUNT] = { 4, 8, 16, 32, 48, 64,
- 96, 128, 160, 256, 384, 640 };
-const INT32 g_ChunkCount[Q3DStudio_MEMORY_POOLCOUNT] = { 128, 256, 256, 1536, 128, 128,
- 256, 64, 32, 32, 32, 32 };
-
-//==============================================================================
-// Memory Settings
-//==============================================================================
-
-/// Define the upper memory limit used by Runtime.
-/// 0 = unlimited
-#ifndef Q3DStudio_MEMORY_LIMIT
-#define Q3DStudio_MEMORY_LIMIT 0
-#endif // Q3DStudio_MEMORY_LIMIT
-
-// Pool sizes and diagnostics are aligned to the required boundary.
-#ifndef Q3DStudio_MEMORY_ALIGNMENT
-#define Q3DStudio_MEMORY_ALIGNMENT 8
-#endif // Q3DStudio_MEMORY_ALIGNMENT
-
-//==============================================================================
-// Memory Diagnostics
-//==============================================================================
-
-/// Note that the simple report is always on. (F1 in Quarterback)
-
-/// CMemoryHeap usage report. (F2 in Quarterback)
-/// Tracks large allocations such as pool buffers, managers and overflows.
-/// Not much overhead since most allocations should be intercepted by pools.
-#ifndef Q3DStudio_MEMORY_HEAPTRACKING
-#define Q3DStudio_MEMORY_HEAPTRACKING 0
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-
-/// Max number of 20 byte SReportEntry heap entries
-/// Increase this number if you get a log warning but you should really tune
-/// your memory pools to avoid hitting the heap.
-#ifndef Q3DStudio_MEMORY_HEAPTRACKINGSIZE
-#define Q3DStudio_MEMORY_HEAPTRACKINGSIZE 4000
-#endif // Q3DStudio_MEMORY_HEAPTRACKINGSIZE
-
-/// Invasive allocation tracker. (F3 in Quarterback)
-/// Track detailed memory usage per allocation through CMemoryManager by tracking
-/// every Runtime allocation, line by line using __FILE__ and __LINE__.
-/// Note that this adds a 16byte SMemoryInfo to each allocation and thus
-/// changes pool usage.
-/// === Do not tune pools with line tracking enabled! ===
-#ifndef Q3DStudio_MEMORY_LINETRACKING
-#define Q3DStudio_MEMORY_LINETRACKING 0
-#endif // Q3DStudio_MEMORY_LINETRACKING
-
-// Hashbin size of entries pointing to SMemoryInfo allocation headers
-#ifndef Q3DStudio_MEMORY_LINETRACKINGSIZE
-#define Q3DStudio_MEMORY_LINETRACKINGSIZE (128 * 1024)
-#endif // Q3DStudio_MEMORY_LINETRACKINGSIZE
-
-/// CMemoryManager pooled memory usage report. (F5-F8 in Quarterback)
-/// Track most used allocation sizes to tune pool sizes and count.
-/// Enabled by default since it allows tracking precise presentation
-/// memory usage without much of an overhead.
-/// It also includes a histogram when showing Reset data (F5,F6)
-#ifndef Q3DStudio_MEMORY_POOLTRACKING
-#ifdef _DEBUG
-#define Q3DStudio_MEMORY_POOLTRACKING 1
-#else
-#define Q3DStudio_MEMORY_POOLTRACKING 0
-#endif
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.cpp
deleted file mode 100644
index 2f5eba0e..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.cpp
+++ /dev/null
@@ -1,647 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSIStream.h"
-#include "Qt3DSMemoryStatistics.h"
-#include "Qt3DSMemoryTracker.h"
-#include "Qt3DSMemoryHeap.h"
-#include "foundation/Qt3DSLogging.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Static Fields
-//==============================================================================
-INT32 CMemoryStatistics::s_Overhead = 0;
-CMemoryManager *CMemoryStatistics::s_PoolManagers[MANAGERCOUNT] = { NULL };
-
-//==============================================================================
-// REGISTRATION
-//==============================================================================
-
-//==============================================================================
-/**
- * Add the manager from the static list done automatically on manager construction.
- * @param inManager the manager we are beginning to track
- */
-void CMemoryStatistics::AddManager(CMemoryManager *inManager)
-{
- INT32 theIndex = 0;
- while (s_PoolManagers[theIndex] && theIndex < MANAGERCOUNT - 1)
- ++theIndex;
-
- if (!s_PoolManagers[theIndex]) {
- s_PoolManagers[theIndex] = inManager;
- } else {
- qCWarning(qt3ds::TRACE_INFO)
- << "Could not add memory manager tracker. Limit: " << MANAGERCOUNT;
- }
-}
-
-//==============================================================================
-/**
- * Remove the manager from the static list done automatically on manager deletion.
- * @param inManager the manager we are ceasing to track
- */
-void CMemoryStatistics::RemoveManager(CMemoryManager *inManager)
-{
- INT32 theIndex = 0;
- while (inManager != s_PoolManagers[theIndex] && theIndex < MANAGERCOUNT - 1)
- ++theIndex;
-
- if (inManager == s_PoolManagers[theIndex])
- s_PoolManagers[theIndex] = NULL;
-}
-
-//==============================================================================
-/**
- * Read/write access to the static tracking field that keeps tab on how
- * much memory we are spending _tracking_ memory.
- * @return reference to the field tracking the overhead in bytes
- */
-INT32 &CMemoryStatistics::Overhead()
-{
- return s_Overhead;
-}
-
-//==============================================================================
-// OPERATION
-//==============================================================================
-
-//==============================================================================
-/**
- * Reset all memory probes
- */
-void CMemoryStatistics::Reset()
-{
- qCInfo(qt3ds::TRACE_INFO) << "Resetting Memory Statistics";
- CMemoryHeap::GetProbe().Reset();
-
- for (INT32 theIndex = 0; theIndex < MANAGERCOUNT; ++theIndex)
- if (s_PoolManagers[theIndex])
- s_PoolManagers[theIndex]->Reset();
-}
-
-//==============================================================================
-// ACCESS
-//==============================================================================
-
-//==============================================================================
-/**
- * Quick access to memory usage of the first memory manager.
- * @param inPeak is true if you want the peak, false if you want the current state
- * @return the current explict usage in bytes
- */
-INT32 CMemoryStatistics::GetRequestedBytes(BOOL inPeak /*=false*/)
-{
- Q3DStudio_ASSERT(s_PoolManagers[0]);
-
- EMemoryValue theValue = inPeak ? MEMVALUE_PEAK : MEMVALUE_CURRENT;
- CMemoryManager::SPoolData &theUsageData = s_PoolManagers[0]->GetManagerData();
-
- return theUsageData.m_Aligned.GetBytes(MEMSCOPE_RESET, theValue)
- + theUsageData.m_Overflow.GetBytes(MEMSCOPE_RESET, theValue);
-}
-
-//==============================================================================
-/**
- * Quick access to heap usage.
- * @param inPeak is true if you want the peak, false if you want the current state
- * @return the current heap usage in bytes
- */
-INT32 CMemoryStatistics::GetHeapBytes(BOOL inPeak /*=false*/)
-{
- return Q3DStudio::CMemoryHeap::GetProbe().GetBytes(MEMSCOPE_RESET,
- inPeak ? MEMVALUE_PEAK : MEMVALUE_CURRENT);
-}
-
-//==============================================================================
-/**
- * Fill out a SFactSheet with memory statistics.
- * @param outFacts is filled out with factoids showing the system state
- * @param inPeak is true if you want the peak, false if you want the current state
- * @param inGlobal is true if you want values since process start, false since last reset
- */
-void CMemoryStatistics::GetFacts(SFactSheet &outFacts, BOOL inPeak /*= true*/,
- BOOL inGlobal /*= true*/)
-{
- INT32 thePresentationBytes = 0;
- Q3DStudio_UNREFERENCED_PARAMETER(thePresentationBytes);
- Q3DStudio_memset(&outFacts, 0, sizeof(SFactSheet));
-
- // Translate flags to enumerations
- EMemoryScope theScope = inGlobal ? MEMSCOPE_GLOBAL : MEMSCOPE_RESET;
- EMemoryValue theValue = inPeak ? MEMVALUE_PEAK : MEMVALUE_CURRENT;
-
- // Capture heap state
- outFacts.m_HeapState.m_Bytes = CMemoryHeap::GetProbe().GetBytes(theScope, theValue);
- outFacts.m_HeapState.m_Calls = CMemoryHeap::GetProbe().GetCalls(theScope, theValue);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- INT32 theTotalChunks = 0;
- INT32 theTotalBytes = 0;
-
- // Scan all registered pool managers
- Q3DStudio_sprintf(outFacts.m_ManagerState.m_Name, 32, "All Managers");
- for (INT32 theManagerIndex = 0; theManagerIndex < MANAGERCOUNT; ++theManagerIndex) {
- CMemoryManager *theManager = s_PoolManagers[theManagerIndex];
- SFactoid &theManagerFact = outFacts.m_Manager[theManagerIndex];
- INT32 theManagerChunks = 0;
- INT32 theManagerBytes = 0;
-
- // Ignore empty managers
- if (!theManager)
- break;
-
- // Scan each pool in the manager
- Q3DStudio_sprintf(theManagerFact.m_Name, 32, " %s", theManager->GetName());
- for (INT32 thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT; ++thePoolIndex) {
- CMemoryPool &thePool = theManager->GetPool(thePoolIndex);
- CMemoryManager::SPoolData *thePoolData = theManager->GetPoolData(thePoolIndex);
- Q3DStudio_ASSERT(thePoolData);
-
- SFactoid &thePoolFact = outFacts.m_Pool[theManagerIndex][thePoolIndex];
- INT32 theUsed = thePool.GetProbe().GetCalls(theScope, theValue);
- INT32 theAlign = thePoolData->m_Aligned.GetBytes(theScope, theValue);
-
- // Ignore empty pools
- if (thePool.GetChunkCount() == 0)
- break;
-
- // Extract all the factoids
- Q3DStudio_sprintf(thePoolFact.m_Name, 32, " %d: %4db x %4d", thePoolIndex,
- thePool.GetChunkSize(), thePool.GetChunkCount());
- thePoolFact.m_Bytes = thePool.GetChunkSize() * thePool.GetChunkCount();
- thePoolFact.m_Calls = thePool.GetProbe().GetCalls(theScope, theValue);
- thePoolFact.m_Used = 100 * theUsed / thePool.GetChunkCount();
-
- thePoolFact.m_Align = 100;
- if (theUsed > 0)
- thePoolFact.m_Align = 100 * theAlign / (theUsed * thePool.GetChunkSize());
- thePoolFact.m_Miss = thePoolData->m_Overflow.GetCalls(theScope, theValue);
-
- thePresentationBytes += theAlign + thePoolData->m_Overflow.GetBytes(theScope, theValue);
-
- theManagerFact.m_Bytes += thePoolFact.m_Bytes;
- theManagerFact.m_Calls += thePoolFact.m_Calls;
- theManagerFact.m_Used += theUsed;
- theManagerFact.m_Align += theAlign;
- theManagerFact.m_Miss += thePoolFact.m_Miss;
-
- outFacts.m_ManagerState.m_Bytes += thePoolFact.m_Bytes;
- outFacts.m_ManagerState.m_Calls += thePoolFact.m_Calls;
- outFacts.m_ManagerState.m_Used += theUsed;
- outFacts.m_ManagerState.m_Align += theAlign;
- outFacts.m_ManagerState.m_Miss += thePoolFact.m_Miss;
-
- theManagerChunks += thePool.GetChunkCount();
- theManagerBytes += theUsed * thePool.GetChunkSize();
- }
-
- thePresentationBytes +=
- theManager->GetManagerData().m_Overflow.GetBytes(theScope, theValue);
-
- // Both the manager sub-total and grand-total need to track bytes separately
- // since the percentages can't just be added or averaged. Those totals
- // are instead weighted and this is the tracking math that does it.
- theTotalChunks += theManagerChunks;
- theTotalBytes += theManagerBytes;
-
- theManagerFact.m_Used = 0;
- if (theManagerChunks > 0)
- theManagerFact.m_Used = 100 * theManagerFact.m_Used / theManagerChunks;
-
- theManagerFact.m_Align = 100;
- if (theManagerBytes > 0)
- theManagerFact.m_Align = 100 * theManagerFact.m_Align / theManagerBytes;
-
- CullHistogram(theManager->GetHistogram(), theValue, outFacts.m_Histogram[theManagerIndex]);
- }
-
- // Again this is the grand-total separate percentage computation that has
- // to be done in the end when all sums have been added.
- outFacts.m_ManagerState.m_Used = 0;
- if (theTotalChunks > 0)
- outFacts.m_ManagerState.m_Used = 100 * outFacts.m_ManagerState.m_Used / theTotalChunks;
-
- outFacts.m_ManagerState.m_Align = 100;
- if (theTotalBytes > 0)
- outFacts.m_ManagerState.m_Align = 100 * outFacts.m_ManagerState.m_Align / theTotalBytes;
-
-#endif // Q3DStudio_MEMORY_POOLTRACKING
-
- // return thePresentationBytes;
-}
-
-//==============================================================================
-/**
- * Find the HISTOGRAMLIMIT highest performers in the histogram.
- * @param inHistogram array of CMemoryManager::HISTOGRAMCOUNT values
- * each showing the number of allocation of that bytesize
- * @param outResults collects the highest points of the histogram
- */
-void CMemoryStatistics::CullHistogram(const CMemoryProbe::SValue *inHistogram,
- const EMemoryValue inValue,
- SHistogramScore outResults[HISTOGRAMCOUNT])
-{
- // Always clear even if there is no data
- Q3DStudio_memset(outResults, 0, sizeof(SHistogramScore));
-
- // Return quickly when no data
- if (!inHistogram)
- return;
-
- // Scan full histogram
- INT32 theLowestIndex = 0;
- for (UINT16 theSize = 0; theSize < 512; ++theSize) {
- // Is this count higher than the lowest recorded count?
- if (inHistogram[theSize].m_Value[inValue] > outResults[theLowestIndex].m_Count) {
- outResults[theLowestIndex].m_Count = inHistogram[theSize].m_Value[inValue];
- outResults[theLowestIndex].m_Size = theSize;
-
- // Find new low in high score
- theLowestIndex = 0;
- for (UINT16 theResult = 1; theResult < HISTOGRAMCOUNT; ++theResult)
- if (outResults[theResult].m_Count < outResults[theLowestIndex].m_Count)
- theLowestIndex = theResult;
- }
- }
-
- // Sort histogram - brute force for now so don't call this all the time
- ::qsort(outResults, 10, sizeof(SHistogramScore), CompareHistogram);
-}
-
-//==============================================================================
-/**
- * Helper comparison function for CullHistogram
- */
-int CMemoryStatistics::CompareHistogram(const void *arg1, const void *arg2)
-{
- return reinterpret_cast<const SHistogramScore *>(arg2)->m_Count
- - reinterpret_cast<const SHistogramScore *>(arg1)->m_Count;
-}
-
-//==============================================================================
-/**
- * Helper comparison function for CMemoryStatistics::HeapReport
- */
-int CMemoryStatistics::CompareHeap(const void *inEntry1, const void *inEntry2)
-{
- return reinterpret_cast<const CMemoryHeap::SReportEntry *>(inEntry1)->m_Size
- - reinterpret_cast<const CMemoryHeap::SReportEntry *>(inEntry2)->m_Size;
-}
-
-//==============================================================================
-// REPORTING
-//==============================================================================
-
-//==============================================================================
-/**
- * Simple memory usage report covering both bytes allocated and call count.
- * @param inStream the stream we are sending the report or NULL to use logger
- */
-void CMemoryStatistics::SimpleReport(IStream *inStream /*=NULL*/)
-{
- CHAR theReportBuffer[REPORTSIZE];
- CMemoryProbe theProbe;
-
- // Basic info is always available
- Report(inStream, "\n --- RUNTIME SIMPLE MEMORY REPORT ---\n");
-
- // Only the first manager is reported for now
- Q3DStudio_ASSERT(s_PoolManagers[0]);
- theProbe = s_PoolManagers[0]->GetManagerData().m_Aligned;
- theProbe.Combine(s_PoolManagers[0]->GetManagerData().m_Overflow);
- Report(inStream, "PRESENTATION: Current Peak Alloc Free\n");
- Q3DStudio_sprintf(theReportBuffer, sizeof(theReportBuffer),
- "Global:%12dk(%4d)%8dk(%4d)%8dk(%4d)%8dk(%4d)\n",
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_CURRENT) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_CURRENT),
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_PEAK) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_PEAK),
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_ADDS) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_ADDS),
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_DELETES) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_DELETES));
- Report(inStream, theReportBuffer);
- Q3DStudio_sprintf(theReportBuffer, sizeof(theReportBuffer),
- "Reset: %12dk(%4d)%8dk(%4d)%8dk(%4d)%8dk(%4d)\n",
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_CURRENT) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_CURRENT),
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_PEAK) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_PEAK),
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_ADDS) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_ADDS),
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_DELETES) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_DELETES));
- Report(inStream, theReportBuffer);
-
- // Overflow is memory not serviced by memory pools - removed to make the simple report...
- // simpler
- /* theProbe = s_PoolManagers[0]->GetManagerData( ).m_Overflow;
- Report( inStream, "OVERFLOW:\n" );
- Q3DStudio_sprintf( theReportBuffer, sizeof( theReportBuffer ),
- "Global:%12ldk(%4ld)%8ldk(%4ld)%8ldk(%4ld)%8ldk(%4ld)\n",
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_CURRENT )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_CURRENT ),
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_PEAK )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_PEAK ),
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_ADDS )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_ADDS ),
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_DELETES )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_DELETES ) );
- Report( inStream, theReportBuffer );
- Q3DStudio_sprintf( theReportBuffer, sizeof( theReportBuffer ), "Reset:
- %12ldk(%4ld)%8ldk(%4ld)%8ldk(%4ld)%8ldk(%4ld)\n",
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_CURRENT )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_CURRENT ),
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_PEAK )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_PEAK ),
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_ADDS )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_ADDS ),
- theProbe.GetBytes( MEMSCOPE_GLOBAL, MEMVALUE_DELETES )/1024,
- theProbe.GetCalls( MEMSCOPE_GLOBAL, MEMVALUE_DELETES ) );
- Report( inStream, theReportBuffer );*/
-
- // All managers share the same heap
- theProbe = CMemoryHeap::GetProbe();
- Report(inStream, "HEAP:\n");
- Q3DStudio_sprintf(theReportBuffer, sizeof(theReportBuffer),
- "Global:%12dk(%4d)%8dk(%4d)%8dk(%4d)%8dk(%4d)\n",
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_CURRENT) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_CURRENT),
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_PEAK) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_PEAK),
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_ADDS) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_ADDS),
- theProbe.GetBytes(MEMSCOPE_GLOBAL, MEMVALUE_DELETES) / 1024,
- theProbe.GetCalls(MEMSCOPE_GLOBAL, MEMVALUE_DELETES));
- Report(inStream, theReportBuffer);
- Q3DStudio_sprintf(theReportBuffer, sizeof(theReportBuffer),
- "Reset: %12dk(%4d)%8dk(%4d)%8dk(%4d)%8dk(%4d)\n",
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_CURRENT) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_CURRENT),
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_PEAK) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_PEAK),
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_ADDS) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_ADDS),
- theProbe.GetBytes(MEMSCOPE_RESET, MEMVALUE_DELETES) / 1024,
- theProbe.GetCalls(MEMSCOPE_RESET, MEMVALUE_DELETES));
- Report(inStream, theReportBuffer);
-
- Q3DStudio_sprintf(theReportBuffer, sizeof(theReportBuffer), "Tracking overhead: %dk\n",
-#if Q3DStudio_MEMORY_HEAPTRACKING
- (s_Overhead + sizeof(CMemoryHeap::TMemoryReport)) / 1024);
-#else
- s_Overhead / 1024);
-#endif // Q3DStudio_MEMORY_HEAPTRACKING
-
- Report(inStream, theReportBuffer);
-}
-
-//==============================================================================
-/**
- * Output the memory report log.
- *
- * The is always watched by a CMemoryProbe that records all activity. Most
- * individual allocations will not be recorded though since they are handled
- * by memory pools.
- *
- * A probe records three axis of information (value, scope and call/bytes).
- *
- * # Value (current,peak,add,del) tracks the current value along with its
- * peak value, and also separately tracks adds(allocations) and deletes(frees)
- * such that current = add - del.
- * # Scope (local,global) tracks values since last reset or dawn of heap.
- * # Call/Bytes tracks separately bytes and calls so you can distinguish between
- * many small allocations and a few large.
- *
- * @param inStream the stream we are sending the report or NULL to use logger
- */
-void CMemoryStatistics::HeapReport(IStream *inStream /*=NULL*/)
-{
- Report(inStream, "\n --- RUNTIME HEAP MEMORY REPORT ---\n");
-
-#if Q3DStudio_MEMORY_HEAPTRACKING
- // Detailed info needs Q3DStudio_MEMORY_HEAPTRACKING defined
- INT32 theCount = CMemoryHeap::GetReport()->GetCount();
- ::qsort(&CMemoryHeap::GetReport()[0], static_cast<size_t>(theCount),
- sizeof(CMemoryHeap::SReportEntry), CompareHeap);
-
- CHAR theReportBuffer[REPORTSIZE];
- for (INT32 theIndex = 0; theIndex < theCount; ++theIndex) {
- CMemoryHeap::SReportEntry &theEntry = CMemoryHeap::GetReport()->operator[](theIndex);
- Q3DStudio_sprintf(theReportBuffer, sizeof(theReportBuffer),
- "%3d. %8d bytes - \"%s\" - %s (%d)\n", theIndex, theEntry.m_Size,
- theEntry.m_Description, theEntry.m_File, theEntry.m_Line);
- Report(inStream, theReportBuffer);
- }
-#else
- Report(inStream, " Unavailable: Q3DStudio_MEMORY_HEAPTRACKING not defined in this build\n");
-#endif
-}
-
-/* Example output of CMemoryStatistics::Report
-
-=POOL= HEAP CALLS USED ALIGN MISSES
----------------------------------------------------------------
-All Managers 722k 38 72% 19%
-
- Global 482k
- 0: 16b x 1024 16k 2182 3% 13%
- 1: 32b x 2048 64k 4123 96% 9% 38
- 2: 48b x 512 24k 212 72% 21%
- 3: 64b x 512 32k 454 11% 3%
- .
- 8: 512b x 128 64k 68 64% 22%
-*/
-
-//==============================================================================
-/**
- * Return a text buffer describing the state of the memory system.
- */
-void CMemoryStatistics::PoolReport(BOOL inPeak /*= true*/, BOOL inGlobal /*= true*/,
- IStream *inStream /*=NULL*/)
-{
- CHAR theLine[256] = { 0 };
- SFactSheet theFacts;
-
- GetFacts(theFacts, inPeak, inGlobal);
-
- Report(inStream, "\n --- RUNTIME POOL MEMORY REPORT ---\n");
- Q3DStudio_sprintf(theLine, 256,
- "Mode: %s %s\nTotal Heap: %7dk(%d)\nPresentation: %7dk\n",
- inGlobal ? "GLOBAL" : "RESET", inPeak ? "PEAK" : "CURRENT",
- theFacts.m_HeapState.m_Bytes / 1024, theFacts.m_HeapState.m_Calls,
- GetRequestedBytes(inPeak) / 1024);
- Report(inStream, theLine);
-
-#if Q3DStudio_MEMORY_POOLTRACKING
- Report(inStream, "=POOLS= HEAP HITS USED ALIGN MISS"
- "\n");
- Report(inStream, "-----------------------------------------------------------------"
- "\n");
- Q3DStudio_sprintf(theLine, 256, "All Managers %7dk %8d %5d%% %5d%% %6d"
- "\n\n",
- theFacts.m_ManagerState.m_Bytes / 1024, theFacts.m_ManagerState.m_Calls,
- theFacts.m_ManagerState.m_Used, theFacts.m_ManagerState.m_Align,
- theFacts.m_ManagerState.m_Miss);
- Report(inStream, theLine);
-
- for (INT32 theManagerIndex = 0; theManagerIndex < MANAGERCOUNT; ++theManagerIndex) {
- SFactoid &theManagerFact = theFacts.m_Manager[theManagerIndex];
- if (theManagerFact.m_Bytes > 0) {
- Q3DStudio_sprintf(theLine, 256, "%-20s %7dk %8d %5d%% %5d%% %6d\n",
- theManagerFact.m_Name, theManagerFact.m_Bytes / 1024,
- theManagerFact.m_Calls, theManagerFact.m_Used, theManagerFact.m_Align,
- theManagerFact.m_Miss);
- Report(inStream, theLine);
-
- for (INT32 thePoolIndex = 0; thePoolIndex < Q3DStudio_MEMORY_POOLCOUNT;
- ++thePoolIndex) {
- SFactoid &thePoolFact = theFacts.m_Pool[theManagerIndex][thePoolIndex];
- if (theManagerFact.m_Bytes > 0) {
- Q3DStudio_sprintf(theLine, 256, "%-20s %7dk %8d %5d%% %5d%% %6d\n",
- thePoolFact.m_Name, thePoolFact.m_Bytes / 1024,
- thePoolFact.m_Calls, thePoolFact.m_Used, thePoolFact.m_Align,
- thePoolFact.m_Miss);
- Report(inStream, theLine);
- }
- }
-
- // Histogram only valid for Current-Reset
- if (inGlobal) {
- Report(inStream, " Histogram: Only available in RESET mode\n");
- } else {
- Q3DStudio_sprintf(
- theLine, 256,
- " Histogram: 1:%3db(%3d) 2:%3db(%3d) 3:%3db(%3d) 4:%3db(%3d) 5:%3db(%3d)\n",
- theFacts.m_Histogram[theManagerIndex][0].m_Size,
- theFacts.m_Histogram[theManagerIndex][0].m_Count,
- theFacts.m_Histogram[theManagerIndex][1].m_Size,
- theFacts.m_Histogram[theManagerIndex][1].m_Count,
- theFacts.m_Histogram[theManagerIndex][2].m_Size,
- theFacts.m_Histogram[theManagerIndex][2].m_Count,
- theFacts.m_Histogram[theManagerIndex][3].m_Size,
- theFacts.m_Histogram[theManagerIndex][3].m_Count,
- theFacts.m_Histogram[theManagerIndex][4].m_Size,
- theFacts.m_Histogram[theManagerIndex][4].m_Count);
- Report(inStream, theLine);
- Q3DStudio_sprintf(
- theLine, 256,
- " 6:%3db(%3d) 7:%3db(%3d) 8:%3db(%3d) 9:%3db(%3d) 10:%3db(%3d)\n",
- theFacts.m_Histogram[theManagerIndex][5].m_Size,
- theFacts.m_Histogram[theManagerIndex][5].m_Count,
- theFacts.m_Histogram[theManagerIndex][6].m_Size,
- theFacts.m_Histogram[theManagerIndex][6].m_Count,
- theFacts.m_Histogram[theManagerIndex][7].m_Size,
- theFacts.m_Histogram[theManagerIndex][7].m_Count,
- theFacts.m_Histogram[theManagerIndex][8].m_Size,
- theFacts.m_Histogram[theManagerIndex][8].m_Count,
- theFacts.m_Histogram[theManagerIndex][9].m_Size,
- theFacts.m_Histogram[theManagerIndex][9].m_Count);
- Report(inStream, theLine);
- }
- }
- }
-#else
- Report(inStream, " Unavailable: Q3DStudio_MEMORY_POOLTRACKING not defined in this build\n");
-#endif
-}
-
-//==============================================================================
-/**
- * Dump the low-level memory list stored in each manager's hash bin.
- *
- * @note Q3DStudio_MEMORY_LINETRACKING has to be set to 1 in AKMemorySettings.h or
- * the compiler for this method to save out any data.
- *
- * @param inStream the stream we are sending the report or NULL to use logger
- */
-void CMemoryStatistics::LineReport(IStream *inStream /*=NULL*/)
-{
- Report(inStream, "\n--- RUNTIME LINE MEMORY REPORT ---\n");
-#if Q3DStudio_MEMORY_LINETRACKING
- Report(inStream, "ADDR, SIZE, TYPE, LINE, FILE, \n");
-
- INT32 theTotalBytes = 0;
- for (INT32 theManagerIndex = 0; theManagerIndex < MANAGERCOUNT; ++theManagerIndex)
- if (s_PoolManagers[theManagerIndex] && s_PoolManagers[theManagerIndex]->GetLineTracker())
- theTotalBytes += s_PoolManagers[theManagerIndex]->GetLineTracker()->Report(inStream);
-
- CHAR theTotal[64];
- theTotal[0] = '\0';
-
- Q3DStudio_sprintf(theTotal, sizeof(theTotal), "TOTAL: , %8d\n", theTotalBytes);
- Report(inStream, theTotal);
-#else
- Report(inStream, " Unavailable: Q3DStudio_MEMORY_LINETRACKING not defined in this build\n");
-#endif // Q3DStudio_MEMORY_LINETRACKING
-}
-
-//==============================================================================
-/**
- * Output to log or stream if available.
- * @param inMessage string to be reported
- * @param inStream stream to be used or output to log if NULL
- */
-void CMemoryStatistics::Report(IStream *inStream, const CHAR *inMessage)
-{
- if (inStream)
- inStream->WriteRaw(inMessage, (INT32)::strlen(inMessage));
- else
- qCInfo(qt3ds::TRACE_INFO) << inMessage;
-}
-
-//==============================================================================
-/**
- * Output full memory report to log or stream if available.
- * @param inStream stream to be used or output to log if NULL
- */
-void CMemoryStatistics::FullReport(IStream *inStream /*=NULL*/)
-{
- SimpleReport(inStream);
- HeapReport(inStream);
- LineReport(inStream);
- PoolReport(false, false, inStream);
- PoolReport(true, false, inStream);
- PoolReport(false, true, inStream);
- PoolReport(true, true, inStream);
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.h
deleted file mode 100644
index 81e30434..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryStatistics.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryManager.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Static facade to memory statistics and allocation tracking data.
- *
- * Use this class to examine the memory state of the system at any point.
- * Heap, managers and pools are are connected to this point by registering
- * themselves on creation. Initiate the extraction of the collected data
- * using this interface.
- */
-class CMemoryStatistics
-{
- //==============================================================================
- // Constants
- //==============================================================================
-public:
- const static INT32 REPORTSIZE = 256; ///< Max size of single report string
- const static INT32 MANAGERCOUNT = 5; ///< Fixed number of managers tracked
- const static INT32 HISTOGRAMCOUNT = 10; ///< Fixed number of managers tracked
-
- //==============================================================================
- // Structs
- //==============================================================================
-public:
- /// One row of statistics on allocation
- struct SFactoid
- {
- CHAR m_Name[32]; ///< Ascii identifier - manager name or pool description
- INT32 m_Bytes; ///< Bytes used - full pool size for example - zero if factoid unused
- INT32 m_Calls; ///< Function calls, i.e number of allocations
- INT32 m_Used; ///< Discrete chunk usage in percent - 10 used of 200 gives a value 5
- INT32 m_Align; ///< Packed efficiency in percent - all 24byte structs in 32byte pool give a
- ///value 75
- INT32 m_Miss; ///< Allocation misses - due to full pools for example
- };
-
- /// Tuple describing one data point in a histogram
- struct SHistogramScore
- {
- INT32 m_Size; ///< Allocation request in bytes
- INT32 m_Count; ///< Number of allocation requests
- };
-
- /// Set of factoids describing a system memory state
- struct SFactSheet
- {
- SFactoid m_HeapState; ///< Heap facts
- SFactoid m_ManagerState; ///< Combined manager facts
- SFactoid m_Manager[MANAGERCOUNT]; ///< Individual manager facts
- SHistogramScore m_Histogram[MANAGERCOUNT][HISTOGRAMCOUNT]; ///< Top allocation requests
- ///sorted by bytes, global and
- ///never reset
- SFactoid m_Pool[MANAGERCOUNT][Q3DStudio_MEMORY_POOLCOUNT]; ///< Individual pool facts
- };
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- static INT32 s_Overhead; ///< Memory tracking structures report in here
- static CMemoryManager
- *s_PoolManagers[MANAGERCOUNT]; ///< Pointers to all created memory pool managers
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Registration
- static void AddManager(CMemoryManager *inManager);
- static void RemoveManager(CMemoryManager *inManager);
- static INT32 &Overhead();
-
-public: // Access
- static void Reset();
- static void GetFacts(SFactSheet &outFacts, const BOOL inPeak = false,
- const BOOL inGlobal = false);
- static INT32 GetRequestedBytes(const BOOL inPeak = false);
- static INT32 GetHeapBytes(const BOOL inPeak = false);
-
-public: // Reporting
- static void SimpleReport(IStream *inStream = NULL);
- static void HeapReport(IStream *inStream = NULL);
- static void PoolReport(const BOOL inPeak = false, const BOOL inGlobal = false,
- IStream *inStream = NULL);
- static void LineReport(IStream *inStream = NULL);
-
- static void FullReport(IStream *inStream = NULL);
- static void Report(IStream *inStream, const CHAR *inString);
-
-protected: // Utility
- static void CullHistogram(const CMemoryProbe::SValue *inHistogram, const EMemoryValue inValue,
- SHistogramScore outResults[HISTOGRAMCOUNT]);
- static int CompareHeap(const void *arg1, const void *arg2);
- static int CompareHistogram(const void *arg1, const void *arg2);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.cpp
deleted file mode 100644
index 8aef9519..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSMemoryTracker.h"
-#include "foundation/Qt3DSLogging.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Construct and reset the tracker.
- */
-CMemoryTracker::CMemoryTracker()
- : m_TrackingOverhead(0)
-{
- Q3DStudio_memset(&m_TrackingHashBin, 0, sizeof(m_TrackingHashBin));
- CMemoryStatistics::Overhead() += sizeof(m_TrackingHashBin);
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CMemoryTracker::~CMemoryTracker()
-{
- CMemoryStatistics::Overhead() -= sizeof(m_TrackingHashBin);
-}
-
-//==============================================================================
-/**
- * Add information about allocation
- * @param inPtr contains info about a new allocation
- */
-void CMemoryTracker::Remember(SMemoryInfo *inPointer)
-{
- if (inPointer) {
- // Update global tracking
- m_TrackingOverhead += sizeof(SMemoryInfo);
-
- // Locate a suitable hashbin
- size_t theHashBin =
- (reinterpret_cast<size_t>(inPointer) >> 2) % Q3DStudio_MEMORY_LINETRACKINGSIZE;
- size_t theStartHashBin = theHashBin;
-
- while (m_TrackingHashBin[theHashBin]) {
- ++theHashBin;
- if (theHashBin >= Q3DStudio_MEMORY_LINETRACKINGSIZE)
- theHashBin = 0;
-
- if (theHashBin == theStartHashBin) {
- // We've run out of room in the hashbin.
- // Abort and increase the bin size.
- qCCritical(qt3ds::OUT_OF_MEMORY)
- << "Memory Tracker Error: Ran out of room in tracker hashbin "
- << Q3DStudio_MEMORY_LINETRACKINGSIZE;
- // exit( -1 );
- }
- }
-
- // Set WatchGuard and store the pointer in the hash bin
- inPointer->m_DogTag = TRACKER_DOGTAG;
- m_TrackingHashBin[theHashBin] = inPointer;
- }
-}
-
-//==============================================================================
-/**
- * Remove information on an allocation
- * @param inPtr contains info about the allocation we are releasing
- */
-void CMemoryTracker::Forget(SMemoryInfo *inPointer)
-{
- if (inPointer) {
- // Update global tracking
- m_TrackingOverhead -= sizeof(SMemoryInfo);
-
- // Locate the pointer in the hash bin
- size_t theHashBin = Q3DStudio_max<size_t>(0, (reinterpret_cast<size_t>(inPointer) >> 2)
- % Q3DStudio_MEMORY_LINETRACKINGSIZE);
- size_t theStartHashBin = theHashBin;
-
- while (m_TrackingHashBin[theHashBin] != inPointer) {
- ++theHashBin;
- if (theHashBin >= Q3DStudio_MEMORY_LINETRACKINGSIZE)
- theHashBin = 0;
-
- if (theHashBin == theStartHashBin) {
- // We were unable to locate the pointer in the hash bin.
- // This is really bad, but not catastrophic
- qCWarning(qt3ds::OUT_OF_MEMORY)
- << "Memory Tracker Warning. Can't find pointer in tracker hashbin";
- return;
- }
- }
-
- // Verify watch guard. Something is trashing memory if this call fails.
- Q3DStudio_ASSERT(m_TrackingHashBin[theHashBin]->m_DogTag == TRACKER_DOGTAG);
-
- // Clear the pointer from the hash bin
- m_TrackingHashBin[theHashBin] = NULL;
- }
-}
-
-//==============================================================================
-/**
- * Dump the memory list stored in the hash bin.
- * @param inFileName the report filename or NULL to dump to the logger
- */
-INT32 CMemoryTracker::Report(IStream *inStream /*=NULL*/)
-{
- INT32 theTotalBytes = 0;
- CHAR theLine[256];
-
- for (INT32 theBinIndex = 0; theBinIndex < Q3DStudio_MEMORY_LINETRACKINGSIZE; ++theBinIndex) {
- if (m_TrackingHashBin[theBinIndex]) {
- CMemoryTracker::SMemoryInfo *theInfo = m_TrackingHashBin[theBinIndex];
-
- Q3DStudio_sprintf(theLine, sizeof(theLine), "0x%p, %8d, %s, %s(%hd)\n", theInfo,
- theInfo->m_Size, theInfo->m_Type, theInfo->m_File, theInfo->m_Line);
-
- CMemoryStatistics::Report(inStream, theLine);
- theTotalBytes += theInfo->m_Size;
- }
- }
-
- return theTotalBytes;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.h b/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.h
deleted file mode 100644
index ee6ce699..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSMemoryTracker.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Low level memory statistics tracking each individual allocation.
- *
- * This class is instantiated in each CMemoryManager if tracking is enabled
- * by setting ENABLE_MEMORY_LINETRACKING to 1 in AKConfig.h for the build
- * configuration you want.
- *
- * Tracking is much more invasive than simple statistics since it records each
- * individual allocation and deallocation. The overhead can be seen mostly in
- * the memory load since we store a tracking hashbin of all memory allocation
- * and a 16 byte SMemoryInfo structure is prepended to each allocation no matter
- * how small. This mode should be used when debugging memory to track down
- * individual allocations. It's turned off by default and should stay off
- * most of the time.
- *
- * The tracking information is usually dumped to a comma delimited .csv file
- * for easy viewing as a spreadsheet of data. This action is initiated by
- * pressing CTRL-F1 in Quarterback on the PC but can be added to any viewer
- * by calling CMemoryStatistics::TrackingDump.
- */
-class CMemoryTracker
-{
- //==============================================================================
- // Constants
- //==============================================================================
-public:
- const static UINT16 TRACKER_DOGTAG = 0xbead; ///< Watch guard value in SMemoryTrackInfo
-
- //==============================================================================
- // Structs
- //==============================================================================
-public:
- /// 16 bytes of details on each allocation when tracking is enabled
- struct SMemoryInfo
- {
- UINT16 m_DogTag; ///< 0xbead - asserting this to track overwrites
- INT16 m_Line; ///< line from which the allocation occurred
- INT32 m_Size; ///< allocation size in bytes
- const CHAR *m_File; ///< file from which the allocation occurred
- const CHAR *m_Type; ///< type of allocation, usually class name
- };
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- INT32 m_TrackingOverhead; ///< memory used to track allocations in bytes
- SMemoryInfo *m_TrackingHashBin[Q3DStudio_MEMORY_LINETRACKINGSIZE]; ///< hash table of all
- ///tracked allocations
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CMemoryTracker();
- ~CMemoryTracker();
-
-public: // Tracking
- void Remember(SMemoryInfo *inData);
- void Forget(SMemoryInfo *inData);
-
-public: // Reporting
- INT32 Report(IStream *inStream = NULL);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSPlatformSpecific.h b/src/Runtime/ogl-runtime/src/system/Qt3DSPlatformSpecific.h
deleted file mode 100644
index 3fc34016..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSPlatformSpecific.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#if defined(_PCPLATFORM)
-
-#define Q3DStudio_memcpy(inDest, inSource, inCount) \
- memcpy(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memmove(inDest, inSource, inCount) \
- memmove(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memset(inDest, inChar, inCount) \
- memset(inDest, inChar, static_cast<size_t>(inCount))
-#define Q3DStudio_memcmp(inDest, inSource, inCount) \
- memcmp(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_sprintf _snprintf
-#define Q3DStudio_stricmp(inStr1, inStr2) _stricmp(inStr1, inStr2)
-#define Q3DStudio_strnicmp(inStr1, inStr2, inCount) _strnicmp(inStr1, inStr2, inCount)
-#define Q3DStudio_tolower tolower
-#define Q3DStudio_restrict /*__restrict*/
-#define Q3DStudio_dcbt(inOffset, inAddress)
-#define Q3DStudio_strcpy(inDest, inSize, inSource) strcpy_s(inDest, inSize, inSource)
-#define Q3DStudio_strcat(inDest, inSize, inSource) strcat_s(inDest, inSize, inSource)
-#define Q3DStudio_fopen fopen_s
-#define Q3DStudio_sleepmillisec(inMillisec) Sleep(inMillisec)
-#define Q3DStudio_getpid GetCurrentProcessId
-
-#elif defined(_TEGRAPLATFORM)
-
-#define Q3DStudio_memcpy(inDest, inSource, inCount) \
- memcpy(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memmove(inDest, inSource, inCount) \
- memmove(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memset(inDest, inChar, inCount) \
- memset(inDest, inChar, static_cast<size_t>(inCount))
-#define Q3DStudio_memcmp(inDest, inSource, inCount) \
- memcmp(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_sprintf _snprintf
-#define Q3DStudio_stricmp(inStr1, inStr2) _stricmp(inStr1, inStr2)
-#define Q3DStudio_strnicmp(inStr1, inStr2, inCount) _strnicmp(inStr1, inStr2, inCount)
-#define Q3DStudio_tolower tolower
-#define Q3DStudio_restrict /*__restrict*/
-#define Q3DStudio_dcbt(inOffset, inAddress)
-#define Q3DStudio_strcpy(inDest, inSize, inSource) strcpy_s(inDest, inSize, inSource)
-#define Q3DStudio_strcat(inDest, inSize, inSource) strcat_s(inDest, inSize, inSource)
-#define Q3DStudio_fopen(inFilePtr, inFilename, inMode) fopen_s(inFilePtr, inFilename, inMode)
-#define Q3DStudio_sleepmillisec(inMillisec) Sleep(inMillisec)
-#define Q3DStudio_getpid GetCurrentProcessId
-
-#elif defined(_XENONPLATFORM)
-
-#include <xtl.h>
-#define Q3DStudio_memcpy(inDest, inSource, inCount) \
- memcpy(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memmove(inDest, inSource, inCount) \
- memmove(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memset(inDest, inChar, inCount) \
- memset(inDest, inChar, static_cast<size_t>(inCount))
-#define Q3DStudio_memcmp(inDest, inSource, inCount) \
- memcmp(inDest, inSource, static_cast<size_t>(inCount))
-//#define Q3DStudio_memcpy( inDest, inSource, inCount ) XMemCpy( inDest, inSource,
-//static_cast<SIZE_T>( inCount ) )
-//#define Q3DStudio_memset( inDest, inChar, inCount ) XMemSet( inDest, inChar,
-//static_cast<SIZE_T>( inCount ) )
-#define Q3DStudio_sprintf _snprintf
-#define Q3DStudio_tolower tolower
-#define Q3DStudio_restrict /*__restrict*/
-#define Q3DStudio_dcbt(inOffset, inAddress) __dcbt(inOffset, inAddress)
-#define Q3DStudio_strcpy(inDest, inSize, inSource) strcpy_s(inDest, inSize, inSource)
-#define Q3DStudio_strcat(inDest, inSize, inSource) strcat_s(inDest, inSize, inSource)
-#define Q3DStudio_fopen(inFilePtr, inFilename, inMode) fopen_s(inFilePtr, inFilename, inMode)
-#define Q3DStudio_sleepmillisec(inMillisec) Sleep(inMillisec)
-#define Q3DStudio_getpid GetCurrentProcessId
-#define Q3DStudio_strnicmp(inStr1, inStr2, inCount) _strnicmp(inStr1, inStr2, inCount)
-#define Q3DStudio_stricmp(inStr1, inStr2) _stricmp(inStr1, inStr2)
-
-#elif defined(_PS3PLATFORM)
-
-#define Q3DStudio_memcpy(inDest, inSource, inCount) \
- memcpy(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memmove(inDest, inSource, inCount) \
- memmove(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memset(inDest, inChar, inCount) \
- memset(inDest, inChar, static_cast<size_t>(inCount))
-#define Q3DStudio_memcmp(inDest, inSource, inCount) \
- memcmp(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_sprintf snprintf
-#define Q3DStudio_tolower std::tolower
-#define Q3DStudio_restrict
-#define Q3DStudio_dcbt(inOffset, inAddress)
-#define Q3DStudio_strcpy(inDest, inSize, inSource) strcpy(inDest, inSource)
-#define Q3DStudio_strcat(inDest, inSize, inSource) strcat(inDest, inSource)
-#define Q3DStudio_fopen(inFilePtr, inFilename, inMode) *(inFilePtr) = fopen(inFilename, inMode)
-#define Q3DStudio_sleepmillisec(inMillisec) \
- { \
- struct timespec theSleepTime = { inMillisec / 1000, (inMillisec % 1000) * 1000000 }; \
- ::nanosleep(&theSleepTime, NULL); \
- }
-#define Q3DStudio_getpid getpid
-#define Q3DStudio_stricmp(inStr1, inStr2) strcasecmp(inStr1, inStr2)
-#define Q3DStudio_strnicmp(inStr1, inStr2, inCount) strncasecmp(inStr1, inStr2, inCount)
-
-#elif defined(_LINUXPLATFORM) || defined(_INTEGRITYPLATFORM)
-#include <time.h>
-#define Q3DStudio_memcpy(inDest, inSource, inCount) \
- memcpy(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memmove(inDest, inSource, inCount) \
- memmove(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_memset(inDest, inChar, inCount) \
- memset(inDest, inChar, static_cast<size_t>(inCount))
-#define Q3DStudio_memcmp(inDest, inSource, inCount) \
- memcmp(inDest, inSource, static_cast<size_t>(inCount))
-#define Q3DStudio_sprintf snprintf
-#define Q3DStudio_stricmp(inStr1, inStr2) strcasecmp(inStr1, inStr2)
-#define Q3DStudio_strnicmp(inStr1, inStr2, inCount) strncasecmp(inStr1, inStr2, inCount)
-#define Q3DStudio_tolower tolower
-#define Q3DStudio_restrict /*__restrict*/
-#define Q3DStudio_dcbt(inOffset, inAddress)
-#define Q3DStudio_strcpy(inDest, inSize, inSource) strcpy(inDest, inSource)
-#define Q3DStudio_strcat(inDest, inSize, inSource) strcat(inDest, inSource)
-#define Q3DStudio_fopen(inFilePtr, inFilename, inMode) *(inFilePtr) = fopen(inFilename, inMode)
-#define Q3DStudio_sleepmillisec(inMillisec) \
- { \
- struct timespec theSleepTime = { inMillisec / 1000, (inMillisec % 1000) * 1000000 }; \
- ::nanosleep(&theSleepTime, NULL); \
- }
-#define Q3DStudio_getpid getpid
-
-#else
-#error "A platform must be defined"
-#endif
-
-//==============================================================================
-/** @def Q3DStudio_dcbt( inOffset, inAddress )
- * @brief Data Cache Block Touch - Loads the block of memory containing
- * the specified address into the data cache.
- *
- * A program uses the dcbt instruction to request a cache block fetch before
- * it is actually needed by the program. This prevents stalls in the pipeline.
- */
-
-//==============================================================================
-/** @def Q3DStudio_restrict
- * @brief Cross platform macro for pointer aliasing.
- *
- * Performance Implications of Pointer Aliasing
- *
- * Doug Cook
- * Silicon Graphics, Inc.
- * August, 1997
- *
- * Pointer aliasing can have a severe impact on program performance.
- * Understanding its implications is critical to writing high-performance code.
- * This document provides a brief introduction to the problem, and suggests
- * several approaches to solving it through source-code restructuring, compiler
- * options, and C or C++ language extensions.
- *
- * *Aliasing*
- *
- * Here's a brief overview of aliasing. Consider the following function:
- *
- * void process_data(float *in, float *out, float gain, int nsamps)
- * {
- * int i;
- * for (i = 0; i < nsamps; i++) {
- * out[i] = in[i] * gain;
- * }
- * }
- *
- * In C or C++, it is legal for the parameters in and out to point to
- * overlapping regions in memory. When this happens, in and out are said to be
- * aliases. When the compiler optimizes the function, it does not in general
- * know whether in and out are aliases. It must therefore assume that any
- * store through out can affect the memory pointed to by in, which severely
- * limits its ability to reorder or parallelize the code (For some simple
- * cases, the compiler could analyze the entire program to determine that two
- * pointers cannot be aliases. But in general, it is impossible for the
- * compiler to determine whether or not two pointers are aliases, so to be
- * safe, it must assume that they are).
- */
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSTimer.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSTimer.cpp
deleted file mode 100644
index d9e82eb9..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSTimer.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSTimer.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- */
-CTimer::CTimer(ITimeProvider &inProvider)
- : m_TimeProvider(inProvider)
- , m_IsRunning(false)
-{
- Start();
-}
-
-//==============================================================================
-/**
- * Start the timer
- */
-void CTimer::Start()
-{
- if (!m_IsRunning)
- m_StartTime = m_TimeProvider.GetCurrentTimeMicroSeconds();
- m_IsRunning = true;
-}
-
-//==============================================================================
-/**
- * Stop the timer
- */
-void CTimer::Stop()
-{
- if (m_IsRunning)
- m_StartTime = m_TimeProvider.GetCurrentTimeMicroSeconds() - m_StartTime;
-
- m_IsRunning = false;
-}
-
-//==============================================================================
-/**
- * Reset the timer
- */
-void CTimer::Reset()
-{
- if (m_IsRunning)
- m_StartTime = m_TimeProvider.GetCurrentTimeMicroSeconds();
- else
- m_StartTime = 0;
-}
-
-//==============================================================================
-/**
- * Gets the current time in milliseconds.
- * @return the current time since timer was started(in miliseconds),
- * or time when it was stopped
- */
-TTimeUnit CTimer::GetTimeMilliSecs()
-{
- return GetTimeMicroSecs() / 1000;
-}
-
-//=============================================================================
-/**
- * Get the number of usecs elapsed since start was called.
- * If the timer is running then this will return the time from when start was
- * called. If the timer is stopped then this will return the amount of time
- * between the start and last stop.
- * @return returns the elasped micro second.
- */
-TMicroSeconds CTimer::GetTimeMicroSecs()
-{
- if (m_IsRunning)
- return m_TimeProvider.GetCurrentTimeMicroSeconds() - m_StartTime;
- else
- return m_StartTime;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSTimer.h b/src/Runtime/ogl-runtime/src/system/Qt3DSTimer.h
deleted file mode 100644
index 278bd4b4..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSTimer.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSITimer.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-
-//==============================================================================
-/**
- * Time provider interface abstracting time from the usage of time.
- */
-class ITimeProvider
-{
-protected:
- virtual ~ITimeProvider() {}
-public:
- virtual INT64 GetCurrentTimeMicroSeconds() = 0;
-};
-
-// Pause in a way that is completely transparent to the underlying system.
-class CPausingTimeProvider : public ITimeProvider
-{
- ITimeProvider &m_Provider;
- INT64 m_PauseOffset;
- INT64 m_Offset;
- bool m_Paused;
-
-public:
- CPausingTimeProvider(ITimeProvider &inProvider)
- : m_Provider(inProvider)
- , m_PauseOffset(0)
- , m_Offset(0)
- , m_Paused(false)
- {
- }
-
- INT64 GetCurrentTimeMicroSeconds() override
- {
- INT64 currentTime = 0;
- if (m_Paused)
- currentTime = m_PauseOffset;
- else
- currentTime = m_Provider.GetCurrentTimeMicroSeconds();
-
- return currentTime - m_Offset;
- }
-
- void Pause()
- {
- if (!m_Paused) {
- m_Paused = true;
- m_PauseOffset = m_Provider.GetCurrentTimeMicroSeconds();
- }
- }
-
- void UnPause()
- {
- if (m_Paused) {
- m_Paused = false;
- INT64 timePaused = m_Provider.GetCurrentTimeMicroSeconds() - m_PauseOffset;
- m_Offset += timePaused;
- }
- }
-
- bool IsPaused() { return m_Paused; }
-
- void Reset() { m_PauseOffset = m_Offset = 0; }
-};
-
-//==============================================================================
-/**
- * @class CTimer
- * @brief A very simple platform optimized utility class to return lapsed time
- *
- * Gets current time based on the time lapsed from the point where timer is started.
- */
-
-class CTimer : public ITimer
-{
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- ITimeProvider &m_TimeProvider;
- INT64 m_StartTime;
- BOOL m_IsRunning; // Whether this timer is running or stopped
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CTimer(ITimeProvider &inProvider);
-
-public: // Operation
- void Start() override;
- void Stop() override;
- void Reset() override;
- TTimeUnit GetTimeMilliSecs() override;
- TMicroSeconds GetTimeMicroSecs() override;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSTypes.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSTypes.cpp
deleted file mode 100644
index 25d41c8b..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSTypes.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Return 2^inBitCount - 1.
- * @param inBitCount number of bits available
- * @param inUnsigned true if all bits are available
- * @return the higest number the bits can represent
- */
-INT32 Q3DStudio_maxbits(const INT32 inBitCount, const BOOL inUnsigned)
-{
- Q3DStudio_ASSERT(inBitCount < 32);
- if (inUnsigned)
- return (1 << inBitCount) - 1;
- else
- return (1 << (inBitCount - 1)) - 1;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSTypes.h b/src/Runtime/ogl-runtime/src/system/Qt3DSTypes.h
deleted file mode 100644
index 65d57da8..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSTypes.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include <QtCore/qglobal.h>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Typedefs
-//==============================================================================
-typedef bool BOOL; ///< true or false, usually 8 bits
-typedef qint8 INT8; ///< A signed 8-bit integer, not a character
-typedef quint8 UINT8; ///< An unsigned 8-bit integer 0-255, not a character
-typedef qint16 INT16; ///< A signed 16-bit integer
-typedef quint16 UINT16; ///< An unsigned 16-bit integer
-typedef qint32 INT32; ///< A signed 32-bit integer
-typedef quint32 UINT32; ///< An unsigned 32-bit integer
-typedef float FLOAT; ///< A 32-bit floating point number
-typedef char CHAR; ///< String character, not a number
-typedef qint64 INT64;
-typedef quint64 UINT64;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-//==============================================================================
-// Max constants and computation
-//==============================================================================
-INT32 Q3DStudio_maxbits(const INT32 inBitCount, const BOOL inUnsigned);
-
-#define AKMAX_INT8 static_cast<INT8>(0x7F)
-#define AKMAX_UINT8 static_cast<UINT8>(0xFF)
-#define AKMAX_INT16 static_cast<INT16>(0x7FFF)
-#define AKMAX_UINT16 static_cast<UINT16>(0xFFFF)
-#define AKMAX_INT32 0x7FFFFFFFL
-#define AKMAX_UINT32 0xFFFFFFFFUL
-
-#define Q3DStudio_INT64_C(x) x
-#define Q3DStudio_UINT64_C(x) x
-
-typedef FILE TFile;
-typedef size_t TFileSize;
-
-struct VECTOR4
-{
- union {
- FLOAT v[4];
- UINT32 u[4];
- };
-
- FLOAT &x() { return v[0]; }
- FLOAT &y() { return v[1]; }
- FLOAT &z() { return v[2]; }
- FLOAT &w() { return v[3]; }
-};
-
-struct MATRIX16
-{
- union {
- VECTOR4 v[4];
- FLOAT m[4][4];
- FLOAT f[16];
- };
-
- FLOAT &_11() { return f[0]; }
- FLOAT &_12() { return f[1]; }
- FLOAT &_13() { return f[2]; }
- FLOAT &_14() { return f[3]; }
- FLOAT &_21() { return f[4]; }
- FLOAT &_22() { return f[5]; }
- FLOAT &_23() { return f[6]; }
- FLOAT &_24() { return f[7]; }
- FLOAT &_31() { return f[8]; }
- FLOAT &_32() { return f[9]; }
- FLOAT &_33() { return f[10]; }
- FLOAT &_34() { return f[11]; }
- FLOAT &_41() { return f[12]; }
- FLOAT &_42() { return f[13]; }
- FLOAT &_43() { return f[14]; }
- FLOAT &_44() { return f[15]; }
-};
-
-typedef INT64 TMicroSeconds; ///< Time in microseconds
-typedef INT64 TTimeUnit; ///< Time in milliseconds
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSVector3.cpp b/src/Runtime/ogl-runtime/src/system/Qt3DSVector3.cpp
deleted file mode 100644
index 2d790f95..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSVector3.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "SystemPrefix.h"
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSVector3.h"
-#include "Qt3DSMatrix.h"
-#include "Qt3DSDataLogger.h"
-#include <math.h>
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants
-//==============================================================================
-extern const float RUNTIME_EPSILON = 0.0001f;
-const float RUNTIME_SQUARE_EPSILON = 0.000001f;
-
-//==============================================================================
-/**
- * Simple constructor - creates a NULL vector.
- */
-RuntimeVector3::RuntimeVector3()
- : m_X(0.0f)
- , m_Y(0.0f)
- , m_Z(0.0f)
-{
-}
-
-//==============================================================================
-/**
- * Construction from three array value.
- * @param inVector the source array
- */
-RuntimeVector3::RuntimeVector3(const float inVector[3])
- : m_X(inVector[0])
- , m_Y(inVector[1])
- , m_Z(inVector[2])
-{
-}
-
-//==============================================================================
-/**
- * Construction from three coordinates.
- * @param inX the m_X coordinate
- * @param inY the m_Y coordinate
- * @param inZ the m_Z coordinate
- */
-RuntimeVector3::RuntimeVector3(const float inX, const float inY, const float inZ)
- : m_X(inX)
- , m_Y(inY)
- , m_Z(inZ)
-{
-}
-
-//==============================================================================
-/**
- * Copy constructor
- * @param inVector the source vector
- */
-RuntimeVector3::RuntimeVector3(const RuntimeVector3 &inVector)
- : m_X(inVector.m_X)
- , m_Y(inVector.m_Y)
- , m_Z(inVector.m_Z)
-{
-}
-
-//==============================================================================
-/**
- * Assignment of coordinates.
- * @param inX the m_X coordinate
- * @param inY the m_Y coordinate
- * @param inZ the m_Z coordinate
- * @return a reference to this modified vector
- */
-RuntimeVector3 &RuntimeVector3::Set(const float inX, const float inY, const float inZ)
-{
- m_X = inX;
- m_Y = inY;
- m_Z = inZ;
- return *this;
-}
-
-//==============================================================================
-/**
- * Assignment of coordinates using another vector.
- * @param inVector the vector to be copied.
- * @return a reference to this modified vector
- */
-RuntimeVector3 &RuntimeVector3::Set(const RuntimeVector3 &inVector)
-{
- m_X = inVector.m_X;
- m_Y = inVector.m_Y;
- m_Z = inVector.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Compare this vector with another. Exact match is not needed but instead
- * an error of EPSILON is allowed.
- * @param inVector the vector we are compared with
- * @return true if the vectors are close to identical
- * @see EPSILON
- */
-bool RuntimeVector3::operator==(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
-
- return (::fabsf(m_X - inVector.m_X) < RUNTIME_EPSILON) && (::fabsf(m_Y - inVector.m_Y) < RUNTIME_EPSILON)
- && (::fabsf(m_Z - inVector.m_Z) < RUNTIME_EPSILON);
-}
-
-//==============================================================================
-/**
- * Compare this vector with another. Exact match is not needed but instead
- * an error of EPSILON is allowed.
- * @param inVector the vector we are compared with
- * @return true if the vectors are not even close to identical
- * @see EPSILON
- */
-bool RuntimeVector3::operator!=(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
-
- return (::fabsf(m_X - inVector.m_X) > RUNTIME_EPSILON) || (::fabsf(m_Y - inVector.m_Y) > RUNTIME_EPSILON)
- || (::fabsf(m_Z - inVector.m_Z) > RUNTIME_EPSILON);
-}
-
-//==============================================================================
-/**
- * Add this vector with another but do not modify this vector.
- * @param inVector the second vector being added
- * @return a new vector
- */
-RuntimeVector3 RuntimeVector3::operator+(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
-
- return RuntimeVector3(m_X + inVector.m_X, m_Y + inVector.m_Y, m_Z + inVector.m_Z);
-}
-
-//==============================================================================
-/**
- * Add two vectors but do not modify this vector.
- * @param inVector vector being subtracted
- * @return a new vector
- */
-RuntimeVector3 RuntimeVector3::operator-(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return RuntimeVector3(m_X - inVector.m_X, m_Y - inVector.m_Y, m_Z - inVector.m_Z);
-}
-
-//==============================================================================
-/**
- * Get a scaled copy of this vector.
- * @param inFactor the factor that scales each coordinate
- * @return a new scaled vector
- */
-RuntimeVector3 RuntimeVector3::operator*(float inFactor) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return RuntimeVector3(m_X * inFactor, m_Y * inFactor, m_Z * inFactor);
-}
-
-//==============================================================================
-/**
- * Invert the vector.
- * @return the inverted copy of this vector
- */
-RuntimeVector3 RuntimeVector3::operator-() const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return RuntimeVector3(-m_X, -m_Y, -m_Z);
-}
-
-//==============================================================================
-/**
- * Simple assignment.
- * @param inVector the new vector
- * @return a reference to this modified vector
- */
-RuntimeVector3 &RuntimeVector3::operator=(const RuntimeVector3 &inVector)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- if (&inVector != this) {
- m_X = inVector.m_X;
- m_Y = inVector.m_Y;
- m_Z = inVector.m_Z;
- }
- return *this;
-}
-
-//==============================================================================
-/**
- * Increment this vector.
- * @param inVector has the coordinates by which this vector will be incremented
- * @return a reference to this modified vector
- */
-RuntimeVector3 &RuntimeVector3::operator+=(const RuntimeVector3 &inVector)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- m_X += inVector.m_X;
- m_Y += inVector.m_Y;
- m_Z += inVector.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Decrement this vector.
- * @param inVector has the coordinates by which this vector will be decremented
- * @return a reference to this modified vector
- */
-RuntimeVector3 &RuntimeVector3::operator-=(const RuntimeVector3 &inVector)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- m_X -= inVector.m_X;
- m_Y -= inVector.m_Y;
- m_Z -= inVector.m_Z;
- return *this;
-}
-
-//==============================================================================
-/**
- * Scale this vector by a factor.
- * @param inFactor the scale factor
- * @return a reference to this modified vector
- */
-RuntimeVector3 &RuntimeVector3::operator*=(float inFactor)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- m_X *= inFactor;
- m_Y *= inFactor;
- m_Z *= inFactor;
- return *this;
-}
-
-//==============================================================================
-/**
- * Calculates the squared distance between this vector and another.
- * This is often used in sorting situations where the real distance isn't needed.
- * @param inVector vector to which the distance is being calculated
- * @return the squared distance between vectors
- */
-float RuntimeVector3::DistanceSquared(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return (m_X - inVector.m_X) * (m_X - inVector.m_X) + (m_Y - inVector.m_Y) * (m_Y - inVector.m_Y)
- + (m_Z - inVector.m_Z) * (m_Z - inVector.m_Z);
-}
-
-//==============================================================================
-/**
- * Calculates the distance between this vector and another.
- * @param inVector vector to which the distance is being calculated
- * @return the distance between vectors
- */
-float RuntimeVector3::Distance(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return ::sqrtf((m_X - inVector.m_X) * (m_X - inVector.m_X)
- + (m_Y - inVector.m_Y) * (m_Y - inVector.m_Y)
- + (m_Z - inVector.m_Z) * (m_Z - inVector.m_Z));
-}
-
-//==============================================================================
-/**
- * Calculates the squared length (squared magnitude) of the current vector.
- * @return the squared length of this vector
- */
-float RuntimeVector3::LengthSquared() const
-{
- return m_X * m_X + m_Y * m_Y + m_Z * m_Z;
-}
-
-//==============================================================================
-/**
- * Calculates the length (magnitude) of the current vector.
- * @return the length of this vector
- */
-float RuntimeVector3::Length() const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return ::sqrtf(m_X * m_X + m_Y * m_Y + m_Z * m_Z);
-}
-
-//==============================================================================
-/**
- * Calculates the dot product of this vector and another.
- * @param inVector vector measuring with
- * @return the dot product
- * @see operator*
- */
-float RuntimeVector3::DotProduct(const RuntimeVector3 &inVector) const
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- return m_X * inVector.m_X + m_Y * inVector.m_Y + m_Z * inVector.m_Z;
-}
-
-//==============================================================================
-/**
- * Calculates the cross product of this vector and another and modifies this vector
- * @param inVector other vector
- * @return this cross product vector
- * @see operator%
- * @see operator%=
- */
-RuntimeVector3 &RuntimeVector3::CrossProduct(const RuntimeVector3 &inVector)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- float theX = m_Y * inVector.m_Z - m_Z * inVector.m_Y;
- float theY = m_Z * inVector.m_X - m_X * inVector.m_Z;
- float theZ = m_X * inVector.m_Y - m_Y * inVector.m_X;
-
- m_X = theX;
- m_Y = theY;
- m_Z = theZ;
-
- return *this;
-}
-
-//==============================================================================
-/**
- * Normalizes the current vector making it a unit vector.
- * The normalized vector is defined to be: V_norm = V / Magnitude(V).
- * @return this normalized vector
-*/
-RuntimeVector3 &RuntimeVector3::Normalize()
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- float theLengthSquared = LengthSquared();
- if ((theLengthSquared > RUNTIME_SQUARE_EPSILON) && ::fabsf(theLengthSquared - 1.0f) > RUNTIME_SQUARE_EPSILON) {
- float theInvLength = 1.0f / ::sqrtf(theLengthSquared);
- m_X *= theInvLength;
- m_Y *= theInvLength;
- m_Z *= theInvLength;
- }
- return *this;
-}
-
-//==============================================================================
-/**
- * Modifies the current vector to contain elements that are the minimum between
- * this vector and another.
- * @param inVector vector that whose elements are tested against the
- * current vector to build the minimum.
- * @return this minimized vector
-*/
-RuntimeVector3 &RuntimeVector3::Minimize(const RuntimeVector3 &inVector)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- m_X = Q3DStudio_min<float>(m_X, inVector.m_X);
- m_Y = Q3DStudio_min<float>(m_Y, inVector.m_Y);
- m_Z = Q3DStudio_min<float>(m_Z, inVector.m_Z);
- return *this;
-}
-
-//==============================================================================
-/**
- * Modifies the current vector to contain elements that are the maximum between
- * this vector and another.
- * @param inVector vector that whose elements are tested against the
- * current vector to build the maximum.
- * @return this maximized vector
-*/
-RuntimeVector3 &RuntimeVector3::Maximize(const RuntimeVector3 &inVector)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- m_X = Q3DStudio_max<float>(m_X, inVector.m_X);
- m_Y = Q3DStudio_max<float>(m_Y, inVector.m_Y);
- m_Z = Q3DStudio_max<float>(m_Z, inVector.m_Z);
- return *this;
-}
-
-//==============================================================================
-/**
- * Modifies the current vector by performing a linear interpolation
- * between the current vector and the given vector.
- *
- * If inFactor is 0.0 then this vector remains unchanged. If inFactor is
- * 1.0 then this vector becomes inDestVector. If inFactor is between 0.0-1.0
- * then this vector becomes a vector between this old vector and inDestVector
- * proportionally interpolated based in inFactor. If inFactor is less than 0
- * or more than 1 then this vector is extrapolated.
- *
- * @param inDestVector Second vector for the interpolation
- * @param inFactor Weight for the interpolation
- * @return this interpolated vector
- */
-RuntimeVector3 &RuntimeVector3::InterpolateLinear(const RuntimeVector3 &inDestVector, float inFactor)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- m_X += inFactor * (inDestVector.m_X - m_X);
- m_Y += inFactor * (inDestVector.m_Y - m_Y);
- m_Z += inFactor * (inDestVector.m_Z - m_Z);
- return *this;
-}
-
-//==============================================================================
-/**
- * Transforms this vector by the given matrix.
- *
- * The matrix is row column of the form Matrix[row][column]:
-@code
- | m0 m1 m2 w |
- | m4 m5 m6 w |
- | m8 m9 m10 w |
- | tX tY tZ w |
-@endcode
- * @param inMatrix transform matrix
- * @return this transformed vector
- */
-RuntimeVector3 &RuntimeVector3::Transform(const RuntimeMatrix &inMatrix)
-{
- PerfLogMathEvent1(DATALOGGER_VECTOR);
- float theX = m_X;
- float theY = m_Y;
- float theZ = m_Z;
-
- m_X = theX * inMatrix.Get(0, 0) + theY * inMatrix.Get(1, 0) + theZ * inMatrix.Get(2, 0);
- m_Y = theX * inMatrix.Get(0, 1) + theY * inMatrix.Get(1, 1) + theZ * inMatrix.Get(2, 1);
- m_Z = theX * inMatrix.Get(0, 2) + theY * inMatrix.Get(1, 2) + theZ * inMatrix.Get(2, 2);
-
- m_X += inMatrix.Get(3, 0);
- m_Y += inMatrix.Get(3, 1);
- m_Z += inMatrix.Get(3, 2);
-
- return *this;
-}
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/Qt3DSVector3.h b/src/Runtime/ogl-runtime/src/system/Qt3DSVector3.h
deleted file mode 100644
index 08df028b..00000000
--- a/src/Runtime/ogl-runtime/src/system/Qt3DSVector3.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#ifdef WIN32
-#pragma warning(disable : 4201)
-#endif
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class RuntimeMatrix;
-
-//==============================================================================
-/**
- * 3D vector with automatic notification on change.
- *
- * This implementation of a 3D vector along with all the sibling and helper
- * classes in the geometry section, try to strike a balance between clean code,
- * ease-of-use and speed. Fields are public and most methods are designed to
- * give the impression of a very intelligent and capable structure. Heavier
- * code such as intersections is encouraged to be added externally instead
- * of here.
- *
- * The vector is a member of the geometry classes next to CMatrix and CRotation
- * @see CMatrix
- * @see CRotation
- */
-class RuntimeVector3
-{
- //==============================================================================
- // Fields
- //==============================================================================
-public:
- union {
- float m[3];
- struct
- {
- float m_X;
- float m_Y;
- float m_Z;
- };
- };
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- RuntimeVector3();
- RuntimeVector3(const float inVector[3]);
- RuntimeVector3(const float inX, const float inY, const float inZ);
- RuntimeVector3(const RuntimeVector3 &inVector);
-
-public: // Initialization
- RuntimeVector3 &Set(const float inX, const float inY, const float inZ);
- RuntimeVector3 &Set(const RuntimeVector3 &inVector);
-
-public: // Functions
- float DistanceSquared(const RuntimeVector3 &inVector) const;
- float Distance(const RuntimeVector3 &inVector) const;
- float LengthSquared() const;
- float Length() const;
- float DotProduct(const RuntimeVector3 &inVector) const;
- RuntimeVector3 &CrossProduct(const RuntimeVector3 &inVector);
- RuntimeVector3 &Normalize();
- RuntimeVector3 &Minimize(const RuntimeVector3 &inVector);
- RuntimeVector3 &Maximize(const RuntimeVector3 &inVector);
- RuntimeVector3 &InterpolateLinear(const RuntimeVector3 &inDestVector, float inFactor);
- RuntimeVector3 &Transform(const RuntimeMatrix &inMatrix);
-
-public: // Operators
- bool operator==(const RuntimeVector3 &inVector) const;
- bool operator!=(const RuntimeVector3 &inVector) const;
- RuntimeVector3 operator+(const RuntimeVector3 &inVector) const;
- RuntimeVector3 operator-(const RuntimeVector3 &inVector) const;
- RuntimeVector3 operator*(float inFactor) const;
- RuntimeVector3 &operator=(const RuntimeVector3 &inVector);
- RuntimeVector3 &operator+=(const RuntimeVector3 &inVector);
- RuntimeVector3 &operator-=(const RuntimeVector3 &inVector);
- RuntimeVector3 &operator*=(float inFactor);
- RuntimeVector3 operator-() const;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/system/SystemPrefix.h b/src/Runtime/ogl-runtime/src/system/SystemPrefix.h
deleted file mode 100644
index aa1ba185..00000000
--- a/src/Runtime/ogl-runtime/src/system/SystemPrefix.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#ifdef _WIN32
-//==============================================================================
-// DEFINES
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
-//==============================================================================
-// DISABLED WARNINGS
-//
-// Note that most of these warnings are tuned off by default by the compiler
-// even at warning level 4. Using option /Wall turns on all warnings and makes
-// even standard Microsoft include files cry. We had to turn off these or
-// turn off warnings individually for each standard include file which was
-// too much work. Point is that /Wall is like Warning Level 5 and this brings
-// it down to about Warning level 4.5, still way above /W4.
-#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
-#pragma warning(disable : 4511) // copy constructor could not be generated
-#pragma warning(disable : 4512) // assignment operator could not be generated
-#pragma warning(disable : 4514) // unreferenced inline function has been removed
-#pragma warning(disable : 4619) // #pragma warning : there is no warning number '4619' (in string.h)
-#pragma warning(disable : 4625) // copy constructor could not be generated because a base class copy
- // constructor is inaccessible
-#pragma warning(disable : 4626) // assignment operator could not be generated because a base class
- // assignment operator is inaccessible
-#pragma warning(disable : 4826) // Conversion from 'const void *' to 'void *' is sign-extended
-#pragma warning(disable : 4996) // _snprintf' was declared deprecated
-#pragma warning(disable : 4711) // function selected for automatic inline expansion
-#pragma warning(disable : 4710) // function not inlined
-#pragma warning(disable : 4355) // 'this' : used in base member initializer list
-
-#pragma warning(disable : 4640) // construction of local static object is not thread-safe
-#pragma warning(disable : 4127) // conditional expression is constant
-#pragma warning( \
- disable : 4738) // storing 32-bit float result in memory, possible loss of performance
-#endif //_WIN32
-
-//==============================================================================
-// STD INCLUDES - Standard includes MUST come first
-#include <stdlib.h> // Standard functions
-#include <stdio.h> // File and IO
-#ifndef _INTEGRITYPLATFORM
-#include <memory.h> // memset, memcpy
-#endif
-#include <string.h> // strlen
-#include <math.h> // Bezier math - pow, acos, cos, sqrt
-#include <ctype.h> // _tolower
-
-#if defined(_LINUXPLATFORM) || defined(_INTEGRITYPLATFORM)
-#include <stdint.h>
-#endif
-
-//==============================================================================
-// OUR INCLUDES
-#include "Qt3DSTypes.h"
-#include "Qt3DSPlatformSpecific.h"
-#include "Qt3DSAssert.h"
-#include "Qt3DSMacros.h"
-#include "Qt3DSConfig.h"
-#include "Qt3DSMemorySettings.h"
-#include "Qt3DSMemory.h"
-#include "Qt3DSArray.h"
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSIPresentation.h b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSIPresentation.h
deleted file mode 100644
index a9d36446..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSIPresentation.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include "Qt3DSEventCallbacks.h"
-
-namespace qt3ds {
-namespace runtime {
- class IApplication;
- class IActivityZone;
- class IAnimationSystem;
- class ISlideSystem;
- class ILogicSystem;
- class IParametersSystem;
-}
-}
-
-namespace qt3ds {
-namespace foundation {
- class IStringTable;
-}
-}
-
-namespace Q3DStudio {
-
-class IComponentManager;
-class IEventManager;
-class IScene;
-class IScriptBridge;
-class CPresentationFrameData;
-class CTimePolicy;
-using qt3ds::runtime::ISlideSystem;
-using qt3ds::runtime::IAnimationSystem;
-using qt3ds::runtime::ILogicSystem;
-using qt3ds::runtime::IParametersSystem;
-
-// Method used to translate from presentation size to window size
-enum EScaleMode {
- SCALEMODE_FREE, // Free scaling mode
- SCALEMODE_EXACT, // Fixed presentation size
- SCALEMODE_ASPECT, // Maintain aspect ratio
- SCALEMODE_UNKNOWN, // ERROR! - Uninitialized scale mode
-};
-
-struct SPresentationSize
-{
- SPresentationSize()
- : m_Width(0)
- , m_Height(0)
- , m_ScaleMode(0)
- {
- }
- UINT16 m_Width; // Native width of the presentation
- UINT16 m_Height; // Native height of the presentation
- UINT8 m_ScaleMode; // Presentation to window scale method
- UINT8 m_Padding[3];
-};
-
-/**
- * @interface IPresentation
- * Base interface of the presentation.
- */
-class IPresentation
-{
-public: // Construction
- IPresentation() {}
- virtual ~IPresentation() {}
-
-public: // Execution
- virtual void ClearDirtyList() = 0;
- virtual void PreUpdate(const TTimeUnit inGlobalTime) = 0;
- virtual void BeginUpdate() = 0;
- virtual void EndUpdate() = 0;
- virtual void PostUpdate(const TTimeUnit inGlobalTime) = 0;
-
-public: // Bridge Control
- virtual void SetScene(IScene *inScene) = 0;
- virtual IScene *GetScene() const = 0;
- virtual IScriptBridge *GetScriptBridgeQml() = 0;
-
-public: // Commands and Events
- virtual void FireEvent(const TEventCommandHash inEventType, TElement *inTarget,
- const UVariant *inArg1 = nullptr, const UVariant *inArg2 = nullptr,
- const EAttributeType inType1 = ATTRIBUTETYPE_NONE,
- const EAttributeType inType2 = ATTRIBUTETYPE_NONE) = 0;
- virtual void FireCommand(const TEventCommandHash inEventType, TElement *inTarget,
- const UVariant *inArg1 = nullptr, const UVariant *inArg2 = nullptr,
- const EAttributeType inType1 = ATTRIBUTETYPE_NONE,
- const EAttributeType inType2 = ATTRIBUTETYPE_NONE) = 0;
- virtual void FlushEventCommandQueue(void) = 0;
- virtual void ProcessEvent(SEventCommand &) = 0;
-
-public: // Manager Access
- virtual IComponentManager &GetComponentManager() = 0;
- virtual ISlideSystem &GetSlideSystem() = 0;
- virtual IAnimationSystem &GetAnimationSystem() = 0;
- virtual ILogicSystem &GetLogicSystem() = 0;
- virtual IParametersSystem &GetParametersSystem() = 0;
-
- virtual qt3ds::foundation::IStringTable &GetStringTable() = 0;
- virtual qt3ds::runtime::IApplication &GetApplication() = 0;
- virtual qt3ds::runtime::IActivityZone *GetActivityZone() = 0;
-
-public: // Hooks and callbacks
- virtual void OnPresentationLoaded() = 0;
-
-public: // Full file path
- virtual void SetFilePath(const CHAR *inPath) = 0;
- virtual QString GetFilePath() const = 0;
- virtual QString getProjectPath() const = 0;
- virtual TElement *GetRoot() = 0;
- virtual void SetRoot(TElement &inRoot) = 0;
-
-public: // Configuration access
- virtual SPresentationSize GetSize() const = 0;
- virtual void SetSize(const SPresentationSize &inSize) = 0;
- virtual void SetElementPath(TElement &inElement, const char8_t *inPath) = 0;
- virtual qt3ds::foundation::CRegisteredString GetElementPath(TElement &inElement) = 0;
-
-public: // Event Callbacks
- virtual void RegisterEventCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData) = 0;
- virtual BOOL UnregisterEventCallback(TElement *inElement, const TEventCommandHash inEventHash,
- const TEventCallback inCallback, void *inContextData) = 0;
-
-public: // FrameData access
- virtual CPresentationFrameData &GetFrameData() = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParser.h b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParser.h
deleted file mode 100644
index c3b4611b..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParser.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "foundation/StringTable.h"
-#include <EASTL/string.h>
-
-namespace qt3ds {
-namespace state {
- struct SSetAttribute;
- namespace debugger {
- class ISceneGraphRuntimeDebugger;
- }
-}
-}
-
-namespace qt3ds {
-namespace render {
- class IInputStreamFactory;
-}
-}
-
-//==============================================================================
-// Forwards
-//==============================================================================
-namespace qt3dsdm {
-class IDOMReader;
-class IStringTable;
-}
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-using namespace qt3ds::foundation;
-//==============================================================================
-// Forwards
-//==============================================================================
-class IRuntimeMetaData;
-class IPresentation;
-
-struct UIPElementTypes
-{
- enum Enum {
- Unknown = 0,
- Scene = 1,
- Node,
- Layer,
- Component,
- Group,
- Behavior,
- Model,
- Light,
- Camera,
- Image,
- Material,
- Text,
- Effect,
- RenderPlugin,
- CustomMaterial,
- ReferencedMaterial,
- Path,
- PathAnchorPoint,
- PathSubPath,
- };
-};
-
-struct SElementAndType
-{
- UIPElementTypes::Enum m_Type;
- TElement *m_Element;
- SElementAndType(UIPElementTypes::Enum inType, TElement *elem)
- : m_Type(inType)
- , m_Element(elem)
- {
- }
-};
-
-// Ensure these elements exist and if the attribute isn't empty ensure the attribute is referenced.
-struct SElementAttributeReference
-{
- eastl::string m_Path;
- eastl::string m_Attribute;
- SElementAttributeReference(const eastl::string &p, const eastl::string &a)
- : m_Path(p)
- , m_Attribute(a)
- {
- }
-};
-//==============================================================================
-/**
- * @class CUIPParser
- * @brief Class for parsing UIP file
- */
-
-class IUIPParser : public NVReleasable
-{
-protected:
- virtual ~IUIPParser() {}
-public: // Parse UIP file
- virtual BOOL Load(IPresentation &inPresentation,
- NVConstDataRef<SElementAttributeReference> inStateReferences) = 0;
- virtual qt3dsdm::IDOMReader &GetDOMReader() = 0;
- virtual IRuntimeMetaData &GetMetaData() = 0;
- // Mapping back from file id to element id, needed to hook elements up to their respective
- // parsed
- // counterparts.
- virtual SElementAndType GetElementForID(const char *inStringId) = 0;
- virtual eastl::string ResolveReference(const char *inStringId, const char *inReferance) = 0;
- // The rendering system needs to know every sourcepath found during parse of the UIP file
- // so that it can do things like register images as opaque/transparent as well as preload
- // mesh files (and possibly font files).
- virtual NVConstDataRef<eastl::string> GetSourcePaths() const = 0;
-
- virtual QVector<QString> GetSlideSourcePaths() const = 0;
-
- // Creation function
- static IUIPParser &Create(const QString &inFileName, IRuntimeMetaData &inMetaData,
- qt3ds::render::IInputStreamFactory &inStreamFactory,
- qt3ds::foundation::IStringTable &inStrTable);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.cpp b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.cpp
deleted file mode 100644
index ab6d751d..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.cpp
+++ /dev/null
@@ -1,738 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-#ifdef EA_PLATFORM_WINDOWS
-#pragma warning(disable : 4396) // specializer warning nonsense
-#endif
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSUIPParserActionHelper.h"
-#include "Qt3DSUIPParserObjectRefHelper.h"
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSCommandEventTypes.h"
-
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMXML.h"
-#include "Qt3DSDMWStrOpsImpl.h"
-#include "Qt3DSMetadata.h"
-#include "Qt3DSEulerAngles.h"
-#include "Qt3DSLogicSystem.h"
-#include "Qt3DSParametersSystem.h"
-
-using namespace qt3dsdm;
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Constructor
- */
-CUIPParserActionHelper::CUIPParserActionHelper(CUIPParserImpl *inUIPParser,
- CUIPParserObjectRefHelper *inObjRefHelper,
- IRuntimeMetaData &inMetaData)
- : m_UIPParser(inUIPParser)
- , m_ObjRefHelper(inObjRefHelper)
- , m_MetaData(inMetaData)
-{
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CUIPParserActionHelper::~CUIPParserActionHelper()
-{
-}
-
-void CUIPParserActionHelper::CacheAction(qt3dsdm::IDOMReader &inReader,
- const char8_t *inActionOwnerId)
-{
- if (IsTrivial(inActionOwnerId))
- return;
-
- IDOMReader::Scope __childScope(inReader);
-
- const char *theRef;
- if (inReader.Att("ref", theRef)) {
- // Ignore "ref" because we are only interested in new actions
- return;
- }
-
- // Parse the action
- SActionInfo theAction;
- inReader.Att("id", theAction.m_Id);
- theAction.m_Owner = inActionOwnerId;
-
- const char *tempStr;
- if (inReader.Att("triggerObject", tempStr))
- theAction.m_TriggerObject = m_UIPParser->ParseObjectRefId(tempStr, inActionOwnerId);
- inReader.Att("event", theAction.m_Event);
- if (inReader.Att("targetObject", tempStr))
- theAction.m_TargetObject = m_UIPParser->ParseObjectRefId(tempStr, inActionOwnerId);
- if (inReader.Att("handler", tempStr)) {
- theAction.m_Handler = tempStr;
- CacheHandlerArguments(inReader, theAction);
- }
-
- // Only proceeds if we can find the elements
- if (theAction.m_TargetObject.empty() || theAction.m_TriggerObject.empty()
- || theAction.m_Owner.empty()) {
- qCWarning(qt3ds::INVALID_OPERATION) << "Action invalid, id: " << theAction.m_Id.c_str();
- return;
- }
-
- m_ActionMap[theAction.m_Id] = theAction;
-
- // Build up logic tables to be processed by BuildAction later
- // There are 2 tables involved:
- // 1. The Listener-To-Events tables - multimap of each listener to all events it is listening to
- // 2. The Listener-Event-To-Actions table - multimap of each listener-event pair to all actions
- // it triggers
- // note: The struct for Action is a pair of EventAction node and its owner
- AddListenerEventPair(theAction.m_TriggerObject, theAction.m_Event);
-
- SListenerEventNamePair theListenerEventPair(theAction.m_TriggerObject, theAction.m_Event);
- TEventActionOwnerPair theLogicOwnerPair(theAction.m_Id, theAction.m_Owner);
- m_ListenerEventActionsMap.insert(eastl::make_pair(theListenerEventPair, theLogicOwnerPair));
-}
-
-void CUIPParserActionHelper::AddListenerEventPair(eastl::string inListener,
- const eastl::string &inEventName)
-{
- // Check for dupes
- TListenerEventsNameMap::iterator theStartItr = m_ListenerEventsNameMap.lower_bound(inListener);
- TListenerEventsNameMap::iterator theEndItr = m_ListenerEventsNameMap.upper_bound(inListener);
- for (; theStartItr != theEndItr; ++theStartItr) {
- if (theStartItr->second == inEventName)
- return;
- }
-
- m_ListenerEventsNameMap.insert(eastl::make_pair(inListener, inEventName));
-}
-
-void CUIPParserActionHelper::CacheHandlerArguments(qt3dsdm::IDOMReader &inReader,
- SActionInfo &inAction)
-{
- IDOMReader::Scope __handlerArgScope(inReader);
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- SHandlerArgumentInfo theArg;
- inReader.Att("name", theArg.m_Name);
- inReader.Att("value", theArg.m_Value);
- inAction.m_HandlerArgs.push_back(theArg);
- }
- if (inAction.m_Handler == "Set Property") {
- SHandlerArgumentInfo theHandlerArg1 = inAction.m_HandlerArgs[0];
- SElementData *targetData = m_UIPParser->GetElementData(inAction.m_TargetObject.c_str());
- if (targetData && !theHandlerArg1.m_Value.empty()) {
- m_UIPParser->m_ParseElementManager.MarkAttributeAsReferenced(
- *targetData, theHandlerArg1.m_Value.c_str());
- }
- }
-}
-
-SElement *CUIPParserActionHelper::GetElement(const eastl::string &inElementName)
-{
- return m_UIPParser->GetElement(inElementName.c_str());
-}
-
-void CUIPParserActionHelper::GetActionSectionCount(
- CUIPParserImpl::SActionSectionCount &outActionCount)
-{
- // There are 2 tables involved:
- // 1. The Listener-To-Events tables - multimap of each listener to all events it is listening to
- // 2. The Listener-Event-To-Actions table - multimap of each listener-event pair to all actions
- // it triggers
- // note: The struct for Action is a pair of EventAction node and its owner
-
- // Get the count to reserve
- // Iterate through each listener
- for (TListenerEventsNameMap::iterator theListenerItr = m_ListenerEventsNameMap.begin();
- theListenerItr != m_ListenerEventsNameMap.end();) {
- ++outActionCount.m_TriggerElementCount;
-
- INT32 theEventCount =
- static_cast<INT32>(m_ListenerEventsNameMap.count(theListenerItr->first));
- for (INT32 theEventCounter = 0; theEventCounter < theEventCount;
- ++theEventCounter, ++theListenerItr) {
- ++outActionCount.m_TriggerEventCount;
-
- // iterate through each listener-event pair
- SListenerEventNamePair thePair(theListenerItr->first, theListenerItr->second);
- TListenerEventActionsMap::iterator theActionsItr =
- m_ListenerEventActionsMap.lower_bound(thePair);
- INT32 theActionCount = static_cast<INT32>(m_ListenerEventActionsMap.count(thePair));
- for (INT32 theActionCounter = 0; theActionCounter < theActionCount;
- ++theActionCounter) {
- eastl::string theActionId = theActionsItr->second.first;
- outActionCount.m_ActionCount +=
- GetActionCount(theActionId, outActionCount.m_StringAttrCount,
- outActionCount.m_CustomParamCount);
- ++theActionsItr;
- }
- }
- }
-}
-
-void CUIPParserActionHelper::BuildActions(IPresentation &inPresentation)
-{
- // Now we start building
- // Iterate through each listener
- for (TListenerEventsNameMap::iterator theListenerItr = m_ListenerEventsNameMap.begin();
- theListenerItr != m_ListenerEventsNameMap.end();) {
- TElement *theElement = GetElement(theListenerItr->first);
-
- INT32 theEventCount =
- static_cast<INT32>(m_ListenerEventsNameMap.count(theListenerItr->first));
- for (INT32 theEventCounter = 0; theEventCounter < theEventCount;
- ++theEventCounter, ++theListenerItr) {
- UINT32 theEventName =
- CHash::HashEventCommand(theListenerItr->second.c_str()); // UINT32: HashedName
-
- // iterate through each listener-event pair
- SListenerEventNamePair thePair(theListenerItr->first, theListenerItr->second);
- TListenerEventActionsMap::iterator theActionsItr =
- m_ListenerEventActionsMap.lower_bound(thePair);
- INT32 theActionCount = static_cast<INT32>(m_ListenerEventActionsMap.count(thePair));
- for (INT32 theActionCounter = 0; theActionCounter < theActionCount;
- ++theActionCounter) {
- eastl::string theActionId = theActionsItr->second.first;
- if (theElement)
- BuildAction(*theElement, theEventName, inPresentation, theActionId);
- ++theActionsItr;
- }
- }
- }
-}
-
-union UTypeConverter {
- SAttributeKey m_Key;
- INT32 m_IntData;
-};
-
-struct SActionAdder
-{
- ILogicSystem &m_LogicSystem;
- TElement &m_EventElement;
- UINT32 m_EventName;
- TElement *m_Owner;
- TElement *m_Target;
-
- SActionAdder(ILogicSystem &inLogicSystem, TElement &inEventElement, UINT32 inEventName,
- TElement *inOwner, TElement *inTarget)
- : m_LogicSystem(inLogicSystem)
- , m_EventElement(inEventElement)
- , m_EventName(inEventName)
- , m_Owner(inOwner)
- , m_Target(inTarget)
- {
- }
-
- INT32 AddAction(TEventCommandHash inCommand, UINT32 inArg1 = 0, UINT32 inArg2 = 0)
- {
- UVariant arg1Var;
- UVariant arg2Var;
- arg1Var.m_INT32 = (INT32)inArg1;
- arg2Var.m_INT32 = (INT32)inArg2;
- return m_LogicSystem.AddAction(m_EventElement, m_EventName, m_Target, m_Owner, inCommand,
- arg1Var, arg2Var, true);
- }
-};
-
-void CUIPParserActionHelper::BuildAction(TElement &inElement, UINT32 inEventName,
- IPresentation &inPresentation,
- const eastl::string &inActionId)
-{
- ILogicSystem &theLogicBuilder = inPresentation.GetLogicSystem();
- IParametersSystem &theParamSystem = inPresentation.GetParametersSystem();
- TActionMap::iterator theIter = m_ActionMap.find(inActionId);
- if (theIter == m_ActionMap.end()) {
- Q3DStudio_ASSERT(false);
- qCWarning(qt3ds::INVALID_OPERATION) << "Can't find action, id: " << inActionId.c_str();
- return;
- }
-
- SActionInfo theAction = theIter->second;
- INT32 theAddActionIndex = -1; // the index of newly added action. If there are more than 1
- // actions, the index points to the firstly added action.
- SActionAdder theAdder(theLogicBuilder, inElement, inEventName, GetElement(theAction.m_Owner),
- GetElement(theAction.m_TargetObject));
-
- // The list of applicable handler is loaded from metadata xml file (if it is non-custom handler)
- bool theIsCustomHandler = IsCustomHandler(theAction);
-
- if (theIsCustomHandler) {
- // Argument 1 - param table start index
- INT32 paramGroup = theParamSystem.CreateParameterGroup();
-
- // First param is the handler name we want to invoke for the custom action.
- ExportCustomActionParameters(inPresentation, theParamSystem, paramGroup,
- theAction.m_Handler.c_str(), ERuntimeDataModelDataTypeString,
- ERuntimeAdditionalMetaDataTypeNone);
-
- int theHandlerArgumentCount = theAction.m_HandlerArgs.size();
- ERuntimeDataModelDataType theType;
- ERuntimeAdditionalMetaDataType theAdditionalType;
- // Actual handler parameters to pass in.
- for (int theIndex = 0; theIndex < theHandlerArgumentCount; ++theIndex) {
- GetHandlerArgumentType(theAction, theIndex, theType, theAdditionalType);
- ExportCustomActionParameters(inPresentation, theParamSystem, paramGroup,
- theAction.m_HandlerArgs[theIndex].m_Value.c_str(), theType,
- theAdditionalType);
- }
- theAddActionIndex = theAdder.AddAction(COMMAND_CUSTOMACTION, (UINT32)paramGroup);
- } else if (theAction.m_Handler == "Set Property") // Plain set action
- {
- // ArgumentOne - HashPropertyName
- // ArgumentTwo - Value
- SHandlerArgumentInfo theHandlerArg1 = theAction.m_HandlerArgs[0];
- SHandlerArgumentInfo theHandlerArg2 = theAction.m_HandlerArgs[1];
-
- eastl::string thePropertyName = theHandlerArg1.m_Value;
- SElementData *theTargetObject =
- m_UIPParser->GetElementData(theAction.m_TargetObject.c_str());
- if (theTargetObject) {
- SElementPropertyInfo *theProperty = m_UIPParser->m_ParseElementManager.FindProperty(
- *theTargetObject, thePropertyName.c_str());
- if (theProperty) {
- TPropertyDescAndValueList theProperties;
- ERuntimeDataModelDataType theType = theProperty->m_DataType;
- ERuntimeAdditionalMetaDataType theAdditionalType = theProperty->m_AdditionalType;
-
- m_UIPParser->GetAttributeList(inPresentation, theProperties, theType,
- theAdditionalType, thePropertyName.c_str(),
- theHandlerArg2.m_Value.c_str(),
- theProperty->m_PropertyNames);
-
- UINT32 theActionCount = theProperties.size();
- Q3DStudio_ASSERT(theActionCount > 0);
- for (UINT32 theActionIndex = 0; theActionIndex < theActionCount; ++theActionIndex) {
- INT32 actionId = theAdder.AddAction(
- COMMAND_SETPROPERTY, theProperties[theActionIndex].first.GetNameHash(),
- theProperties[theActionIndex].second.m_INT32);
- if (theActionIndex == 0)
- theAddActionIndex = actionId;
- }
- }
- }
- } else if (theAction.m_Handler == "Fire Event") // Fire the selected event on the element
- {
- theAddActionIndex = theAdder.AddAction(
- COMMAND_FIREEVENT, CHash::HashEventCommand(theAction.m_HandlerArgs[0].m_Value.c_str()));
- } else if (theAction.m_Handler == "Go to Slide") // Switch slides
- {
- theAddActionIndex = theAdder.AddAction(
- COMMAND_GOTOSLIDENAME, CHash::HashString(theAction.m_HandlerArgs[0].m_Value.c_str()));
- } else if (theAction.m_Handler == "Next Slide") // Switch slides
- {
- theAddActionIndex = theAdder.AddAction(COMMAND_GOTONEXTSLIDE);
- } else if (theAction.m_Handler == "Previous Slide") // Switch slides
- {
- theAddActionIndex = theAdder.AddAction(COMMAND_GOTOPREVIOUSSLIDE);
- } else if (theAction.m_Handler == "Preceding Slide") // Switch slides
- {
- theAddActionIndex = theAdder.AddAction(COMMAND_BACKSLIDE);
- } else if (theAction.m_Handler == "Play") // Play
- {
- theAddActionIndex = theAdder.AddAction(COMMAND_PLAY);
- } else if (theAction.m_Handler == "Pause") // Pause
- {
- theAddActionIndex = theAdder.AddAction(COMMAND_PAUSE);
- } else if (theAction.m_Handler == "Go to Time") // Goto Time
- {
- float theTime = 0;
- const char *theValue = theAction.m_HandlerArgs[0].m_Value.c_str();
- if (!IsTrivial(theValue))
- WStrOps<float>().StrTo(theValue, theTime);
-
- theAddActionIndex =
- theAdder.AddAction(COMMAND_GOTOTIME, static_cast<UINT32>(theTime * 1000.0f));
-
- bool thePause = false;
- theValue = theAction.m_HandlerArgs[1].m_Value.c_str();
- if (!IsTrivial(theValue))
- WStrOps<bool>().StrTo(theValue, thePause);
- theAdder.AddAction(thePause ? COMMAND_PAUSE : COMMAND_PLAY);
- } else if (theAction.m_Handler == "Emit Signal") // Emit a signal
- {
- qt3ds::foundation::CStringHandle theStringHandle;
- if (!theAction.m_HandlerArgs[0].m_Value.empty()) {
- const char *theValue = theAction.m_HandlerArgs[0].m_Value.c_str();
- theStringHandle = inPresentation.GetStringTable().GetHandle(theValue);
- }
- theAddActionIndex = theAdder.AddAction(COMMAND_EMITSIGNAL, theStringHandle.handle());
- } else {
- Q3DStudio_ASSERT(false); // what sort of crazy action is this?
- }
-
- if (theAddActionIndex > -1)
- m_ActionIdentifierMap[theAction.m_Id] = theAddActionIndex;
-}
-
-INT32 CUIPParserActionHelper::GetActionCount(const eastl::string &inActionId)
-{
- INT32 theStringAttrCount = 0;
- INT32 theCustomParamCount = 0;
- return GetActionCount(inActionId, theStringAttrCount, theCustomParamCount);
-}
-
-INT32 CUIPParserActionHelper::GetActionCount(const eastl::string &inActionId,
- INT32 &outStringAttrCount, INT32 &outCustomParamCount)
-{
- INT32 theActionCount = 0;
-
- TActionMap::iterator theIter = m_ActionMap.find(inActionId);
- if (theIter == m_ActionMap.end()) {
- Q3DStudio_ASSERT(false);
- qCWarning(qt3ds::INVALID_OPERATION) << "Can't find action, id: " << inActionId.c_str();
- return theActionCount;
- }
-
- SActionInfo theAction = theIter->second;
-
- // The list of applicable handler is loaded from metadata xml file (if it is non-custom handler)
- bool theIsCustomHandler = IsCustomHandler(theAction);
-
- if (theIsCustomHandler) {
- theActionCount = 1;
-
- // First param is the handler name we want to invoke for the custom action.
- ++outStringAttrCount;
- ++outCustomParamCount;
-
- int theHandlerArgumentCount = theAction.m_HandlerArgs.size();
- ERuntimeDataModelDataType theType;
- ERuntimeAdditionalMetaDataType theAdditionalType;
- // Actual handler parameters to pass in.
- for (int theIndex = 0; theIndex < theHandlerArgumentCount; ++theIndex) {
- GetHandlerArgumentType(theAction, theIndex, theType, theAdditionalType);
- GetCustomActionParametersCount(theType, theAdditionalType, outStringAttrCount,
- outCustomParamCount);
- }
- }
-
- else if (theAction.m_Handler == "Set Property") // Plain set action
- {
- SHandlerArgumentInfo theHandlerArg1 = theAction.m_HandlerArgs[0];
-
- eastl::string thePropertyName = theHandlerArg1.m_Value;
- SElementData *theData = m_UIPParser->GetElementData(theAction.m_TargetObject.c_str());
- if (theData) {
- SElementPropertyInfo *thePropertyInfo =
- m_UIPParser->m_ParseElementManager.GetOrCreateProperty(*theData,
- thePropertyName.c_str());
- if (thePropertyInfo) {
- theActionCount = thePropertyInfo->m_Arity;
- if (m_UIPParser->IsStringType(thePropertyInfo->m_DataType))
- ++outStringAttrCount;
- }
- }
- }
-
- else if (theAction.m_Handler == "Fire Event" // Fire the selected event on the element
- || theAction.m_Handler == "Go to Slide" // Switch slides
- || theAction.m_Handler == "Next Slide" // Switch slides
- || theAction.m_Handler == "Previous Slide" // Switch slides
- || theAction.m_Handler == "Preceding Slide" // Switch slides
- || theAction.m_Handler == "Play" // Play
- || theAction.m_Handler == "Pause" // Pause
- ) {
- theActionCount = 1;
- }
-
- else if (theAction.m_Handler == "Go to Time") // Goto Time
- {
- theActionCount = 2;
- } else if (theAction.m_Handler == "Play Sound") // Play Sound
- {
- theActionCount = 1;
- ++outStringAttrCount;
- } else if (theAction.m_Handler == "Emit Signal") // Emit Signal
- {
- theActionCount = 1;
- ++outStringAttrCount;
- } else {
- Q3DStudio_ASSERT(false); // what sort of crazy action is this?
- }
-
- return theActionCount;
-}
-
-INT32 CUIPParserActionHelper::GetActionIndex(const eastl::string &inActionId)
-{
- TActionIdentifierMap::iterator theFind = m_ActionIdentifierMap.find(inActionId);
- if (theFind != m_ActionIdentifierMap.end())
- return theFind->second;
- Q3DStudio_ASSERT(false);
- return -1;
-}
-
-bool CUIPParserActionHelper::IsCustomHandler(const SActionInfo &inAction)
-{
- const char *theClass = m_ObjRefHelper->GetClass(inAction.m_TargetObject);
- if (!IsTrivial(theClass))
- return m_MetaData.IsCustomHandler(theClass, inAction.m_Handler.c_str());
- return false;
-}
-
-void CUIPParserActionHelper::GetHandlerArgumentType(
- const SActionInfo &inAction, int inArgumentIndex, ERuntimeDataModelDataType &outType,
- ERuntimeAdditionalMetaDataType &outAdditionalType)
-{
- const char *theClass = m_ObjRefHelper->GetClass(inAction.m_TargetObject);
- return m_MetaData.GetHandlerArgumentType(theClass, inAction.m_Handler.c_str(),
- inAction.m_HandlerArgs[inArgumentIndex].m_Name.c_str(),
- outType, outAdditionalType);
-}
-
-void CUIPParserActionHelper::GetCustomActionParametersCount(
- ERuntimeDataModelDataType inDataType, ERuntimeAdditionalMetaDataType inAdditionalType,
- INT32 &outStringAttrCount, INT32 &outCustomParamCount)
-{
- // This function should match ExportCustomActionParameters
- switch (inDataType) {
- case ERuntimeDataModelDataTypeFloat:
- case ERuntimeDataModelDataTypeLong:
- case ERuntimeDataModelDataTypeBool: {
- outCustomParamCount += 1;
- break;
- }
- case ERuntimeDataModelDataTypeFloat2: {
- outCustomParamCount += 2;
- break;
- }
- case ERuntimeDataModelDataTypeFloat3: {
- if (inAdditionalType == ERuntimeAdditionalMetaDataTypeColor) {
- // Append rgba
- outCustomParamCount += 4;
- } else {
- // Append xyz
- outCustomParamCount += 3;
- }
- break;
- }
- // default to string
- default: {
- outCustomParamCount += 1;
- outStringAttrCount += 1;
- }
- }
-}
-
-namespace {
-
- using qt3ds::foundation::IStringTable;
-
- struct SCustomParameterParseInfoFloat
- {
- typedef float TParseType;
- static const char8_t *Name() { return "float"; }
- static TParseType Default() { return 0; }
- static Q3DStudio::UVariant ToVariant(const TParseType &inParseType)
- {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = inParseType;
- return retval;
- }
- };
-
- struct SCustomParameterParseInfoLong
- {
- typedef QT3DSI32 TParseType;
- static const char8_t *Name() { return "long"; }
- static TParseType Default() { return 0; }
- static Q3DStudio::UVariant ToVariant(const TParseType &inParseType)
- {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = static_cast<float>(inParseType);
- return retval;
- }
- };
-
- struct SCustomParameterParseInfoBool
- {
- typedef bool TParseType;
- static const char8_t *Name() { return "bool"; }
- static TParseType Default() { return false; }
- static Q3DStudio::UVariant ToVariant(const TParseType &inParseType)
- {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = static_cast<float>(inParseType);
- return retval;
- }
- };
-
- struct SCustomParameterParseInfoFloat2
- {
- typedef SFloat2 TParseType;
- static const char8_t *Name() { return "float2"; }
- static TParseType Default() { return SFloat2(0, 0); }
- static QT3DSU32 NumParameters() { return 2; }
- static Q3DStudio::UVariant ToVariant(QT3DSU32 inIdx, const TParseType &inParseType)
- {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = static_cast<float>(inParseType[inIdx]);
- return retval;
- }
- };
-
- struct SCustomParameterParseInfoFloat3
- {
- typedef SFloat3 TParseType;
- static const char8_t *Name() { return "float3"; }
- static const char8_t **Extensions()
- {
- static const char8_t *retval[] = { ".x", ".y", ".z", NULL };
- return retval;
- }
- static TParseType Default() { return SFloat3(0, 0, 0); }
- static QT3DSU32 NumParameters() { return 3; }
- static Q3DStudio::UVariant ToVariant(QT3DSU32 inIdx, const TParseType &inParseType)
- {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = static_cast<float>(inParseType[inIdx]);
- return retval;
- }
- };
-
- struct SCustomParameterParseInfoColor
- {
- typedef SFloat3 TParseType;
- static const char8_t *Name() { return "color4"; }
- static TParseType Default() { return SFloat3(0, 0, 0); }
- static QT3DSU32 NumParameters() { return 4; }
- static Q3DStudio::UVariant ToVariant(QT3DSU32 inIdx, const TParseType &inParseType)
- {
- if (inIdx < 3) {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = static_cast<float>(inParseType[inIdx]) * 255.0f;
- return retval;
- } else {
- Q3DStudio::UVariant retval;
- retval.m_FLOAT = 255.0f;
- return retval;
- }
- }
- };
-
- template <typename TParseInfo>
- struct ParseParameter
- {
- void operator()(WCharTReader &inReader, const char *inValue, IParametersSystem &inSystem,
- QT3DSI32 inGroupId)
- {
- typename TParseInfo::TParseType theValue = TParseInfo::Default();
- if (!IsTrivial(inValue))
- inReader.Read(theValue);
- Q3DStudio::UVariant theVarValue = TParseInfo::ToVariant(theValue);
- inSystem.AddParameter(inGroupId, CHash::HashString(TParseInfo::Name()), theVarValue);
- }
- };
-
- template <typename TParseInfo>
- struct ParseAggregateParameter
- {
- void operator()(WCharTReader &inReader, const char *inValue, IParametersSystem &inSystem,
- QT3DSI32 inGroupId)
- {
- typename TParseInfo::TParseType theValue = TParseInfo::Default();
- if (!IsTrivial(inValue))
- inReader.ReadRef(NVDataRef<float>(&theValue[0], TParseInfo::NumParameters()));
-
- for (QT3DSU32 idx = 0, end = TParseInfo::NumParameters(); idx < end; ++idx) {
- Q3DStudio::UVariant theVarValue = TParseInfo::ToVariant(idx, theValue);
- inSystem.AddParameter(inGroupId, CHash::HashString(TParseInfo::Name()),
- theVarValue);
- }
- }
- };
-}
-
-void CUIPParserActionHelper::ExportCustomActionParameters(
- IPresentation &inPresentation, IParametersSystem &inParamSystem, QT3DSI32 inParamGroupId,
- const char *inValue, ERuntimeDataModelDataType inDataType,
- ERuntimeAdditionalMetaDataType inAdditionalType)
-{
- // Create a destructible value
- m_UIPParser->m_ValueBuffer.clear();
- m_UIPParser->m_ValueBuffer.write(inValue, (QT3DSU32)strlen(inValue) + 1);
- // Clear the destination buffer
- m_UIPParser->m_TempBuffer.clear();
- WCharTReader theReader((char8_t *)m_UIPParser->m_ValueBuffer.begin(), m_UIPParser->m_TempBuffer,
- *m_UIPParser->GetDOMReader().GetStringTable());
-
- // The function should match CUIPParserActionHelper::GetCustomActionParametersCount
- switch (inDataType) {
- case ERuntimeDataModelDataTypeFloat: {
- ParseParameter<SCustomParameterParseInfoFloat>()(theReader, inValue, inParamSystem,
- inParamGroupId);
- break;
- }
- case ERuntimeDataModelDataTypeLong: {
- ParseParameter<SCustomParameterParseInfoLong>()(theReader, inValue, inParamSystem,
- inParamGroupId);
- break;
- }
- case ERuntimeDataModelDataTypeBool: {
- ParseParameter<SCustomParameterParseInfoBool>()(theReader, inValue, inParamSystem,
- inParamGroupId);
- break;
- }
- case ERuntimeDataModelDataTypeFloat2: {
- ParseAggregateParameter<SCustomParameterParseInfoFloat2>()(theReader, inValue,
- inParamSystem, inParamGroupId);
- break;
- }
- case ERuntimeDataModelDataTypeFloat3: {
- if (inAdditionalType == ERuntimeAdditionalMetaDataTypeColor) {
- ParseAggregateParameter<SCustomParameterParseInfoColor>()(
- theReader, inValue, inParamSystem, inParamGroupId);
- } else {
- ParseAggregateParameter<SCustomParameterParseInfoFloat3>()(
- theReader, inValue, inParamSystem, inParamGroupId);
- }
- break;
- }
- // default to string
- default: {
- UVariant theValue;
- theValue.m_StringHandle = inPresentation.GetStringTable().GetHandle(inValue);
- inParamSystem.AddParameter(inParamGroupId, CHash::HashString("string"), theValue);
- break;
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.h b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.h
deleted file mode 100644
index 3d9d44ce..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserActionHelper.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSUIPParserImpl.h"
-
-namespace qt3ds {
-namespace runtime {
- class IParametersSystem;
-}
-}
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-using qt3ds::runtime::IParametersSystem;
-//==============================================================================
-// Forwards
-//==============================================================================
-
-//==============================================================================
-/**
- * @class CUIPParserActionHelper
- * @brief Class for parsing UIP file - Action
- */
-class CUIPParserActionHelper
-{
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- CUIPParserImpl *m_UIPParser;
- CUIPParserObjectRefHelper *m_ObjRefHelper;
- IRuntimeMetaData &m_MetaData; ///< Reference to Metadata
-
- typedef eastl::map<eastl::string, INT32> TActionIdentifierMap; ///< Mapping of the string that
- ///uniquely identify the action
- ///to the index created
- TActionIdentifierMap m_ActionIdentifierMap;
-
- struct SHandlerArgumentInfo
- {
- eastl::string m_Name;
- eastl::string m_Value;
-
- SHandlerArgumentInfo() {}
- };
- typedef eastl::vector<SHandlerArgumentInfo> THandlerArguments; ///< List of handler arguments
- struct SActionInfo
- {
- eastl::string m_Id;
-
- // Where the action is added to
- eastl::string m_Owner; // Absolute path of owner object
-
- // Trigger object
- eastl::string m_TriggerObject; // Absolute path of trigger object
- eastl::string m_Event;
-
- // Target object
- eastl::string m_TargetObject; // Absolute path of target object
- eastl::string m_Handler;
- THandlerArguments m_HandlerArgs;
-
- SActionInfo() {}
- };
- typedef eastl::map<eastl::string, SActionInfo> TActionMap; ///< Map of action id and action info
-
- TActionMap m_ActionMap;
-
- // There are 2 tables involved:
- // 1. The Listener-To-Events tables - multimap of each listener to all events it is listening to
- // 2. The Listener-Event-To-Actions table - multimap of each listener-event pair to all actions
- // it triggers
- // note: The struct for Action is a pair of EventAction node and its owner
- struct SListenerEventNamePair
- {
- eastl::string m_Listener;
- eastl::string m_Event;
-
- SListenerEventNamePair(eastl::string inListener, const eastl::string &inEvent)
- : m_Listener(inListener)
- , m_Event(inEvent)
- {
- }
-
- bool operator<(const SListenerEventNamePair &inListenerEventPair) const
- {
- if (m_Listener == inListenerEventPair.m_Listener)
- return m_Event < inListenerEventPair.m_Event;
- return m_Listener < inListenerEventPair.m_Listener;
- }
- };
-
- typedef eastl::pair<eastl::string, eastl::string>
- TEventActionOwnerPair; ///< One listener(source) can listen to multiple events
- typedef eastl::multimap<eastl::string, eastl::string>
- TListenerEventsNameMap; ///< One listener(source)-event pair can trigger multiple actions
- typedef eastl::multimap<SListenerEventNamePair, TEventActionOwnerPair> TListenerEventActionsMap;
-
- TListenerEventsNameMap m_ListenerEventsNameMap;
- TListenerEventActionsMap m_ListenerEventActionsMap;
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CUIPParserActionHelper(CUIPParserImpl *inUIPParser, CUIPParserObjectRefHelper *inObjRefHelper,
- IRuntimeMetaData &inMetaData);
- virtual ~CUIPParserActionHelper();
-
-public:
- void CacheAction(qt3dsdm::IDOMReader &inReader, const char8_t *inOwnerId);
- void BuildActions(IPresentation &inPresentation);
- void GetActionSectionCount(CUIPParserImpl::SActionSectionCount &outActionCount);
- INT32 GetActionCount(const eastl::string &inActionId);
- INT32 GetActionIndex(const eastl::string &inActionId);
-
-protected: // Action helper
- void AddListenerEventPair(eastl::string inListener, const eastl::string &inEventName);
- void CacheHandlerArguments(qt3dsdm::IDOMReader &inReader, SActionInfo &inAction);
- void BuildAction(TElement &inElement, UINT32 inEventName, IPresentation &inPresentation,
- const eastl::string &inActionId);
- INT32 GetActionCount(const eastl::string &inActionId, INT32 &outStringAttrCount,
- INT32 &outCustomParamCount);
- bool IsCustomHandler(const SActionInfo &inAction);
- void GetHandlerArgumentType(const SActionInfo &inAction, int inArgumentIndex,
- ERuntimeDataModelDataType &outType,
- ERuntimeAdditionalMetaDataType &outAdditionalType);
- void GetCustomActionParametersCount(ERuntimeDataModelDataType inDataType,
- ERuntimeAdditionalMetaDataType inAdditionalType,
- INT32 &outStringAttrCount, INT32 &outCustomParamCount);
- void ExportCustomActionParameters(IPresentation &inPresentation,
- IParametersSystem &inParamSystem, QT3DSI32 inParamGroup,
- const char *inDataValue, ERuntimeDataModelDataType inDataType,
- ERuntimeAdditionalMetaDataType inAdditionalType);
-
- inline SElement *GetElement(const eastl::string &inElementName);
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.cpp b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.cpp
deleted file mode 100644
index 9f7641b0..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.cpp
+++ /dev/null
@@ -1,2610 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-#ifdef EA_PLATFORM_WINDOWS
-#pragma warning(disable : 4396) // specializer warning nonsense
-#endif
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSIPresentation.h"
-#include "Qt3DSIScriptBridge.h"
-#include "Qt3DSAttributeHashes.h"
-#include "Qt3DSCommandEventTypes.h"
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMComposerTypeDefinitions.h"
-#include "Qt3DSDMWStrOpsImpl.h"
-#include "Qt3DSUIPParserActionHelper.h"
-#include "Qt3DSUIPParserObjectRefHelper.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSRuntimeFactory.h"
-#include "foundation/Qt3DSFoundation.h"
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSAnimationSystem.h"
-#include "Qt3DSSlideSystem.h"
-
-using namespace qt3dsdm;
-
-#ifndef M_PI
-#define M_PI 3.1415926535898
-#endif
-
-#define TODEG(x) x = (float)(x * 180 / M_PI);
-#define TORAD(x) x = (float)(x / 180 * M_PI);
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-TStrType SParseElementManager::RegisterStr(const char8_t *inStr)
-{
- return m_MetaData.GetStringTable()->GetRenderStringTable().RegisterStr(inStr);
-}
-SElementData &SParseElementManager::GetOrCreateElementData(const char8_t *inIdOrRef,
- const char8_t *inElemType,
- const char8_t *inElemClassId)
-{
- if (inIdOrRef == NULL)
- inIdOrRef = "";
- if (inIdOrRef[0] == '#')
- ++inIdOrRef;
- if (inElemClassId == NULL)
- inElemClassId = "";
- if (inElemClassId[0] == '#')
- ++inElemClassId;
- if (inElemType == NULL)
- inElemType = "";
- TStrType theStr = RegisterStr(inIdOrRef);
- eastl::pair<TIdElementMap::iterator, bool> theInserter =
- m_ElementMap.insert(eastl::make_pair(theStr, SElementData(theStr)));
- SElementData &retval(theInserter.first->second);
- if (theInserter.second) {
- retval.m_Class = RegisterStr(inElemClassId);
- retval.m_Type = RegisterStr(inElemType);
- }
- return retval;
-}
-SElementData *SParseElementManager::FindElementData(const char8_t *inIdOrRef)
-{
- if (inIdOrRef == NULL)
- inIdOrRef = "";
- if (inIdOrRef[0] == '#')
- ++inIdOrRef;
- TStrType theStr = RegisterStr(inIdOrRef);
- TIdElementMap::iterator theIter = m_ElementMap.find(theStr);
- if (theIter != m_ElementMap.end())
- return &theIter->second;
- return NULL;
-}
-static void SetPropertyValueHash(eastl::string &inWorkspace, const char8_t *inExtension,
- qt3ds::QT3DSU32 *&ioHashes, eastl::string::size_type originalSize,
- CRegisteredString *&ioPropNames,
- qt3ds::foundation::IStringTable &ioStringTable)
-{
- if (inExtension && *inExtension)
- inWorkspace.append(inExtension);
- *ioHashes = Q3DStudio::CHash::HashAttribute(inWorkspace.c_str());
- *ioPropNames = ioStringTable.RegisterStr(inWorkspace.c_str());
- ++ioHashes;
- ++ioPropNames;
- inWorkspace.resize(originalSize);
-}
-static eastl::pair<qt3ds::QT3DSU32, eastl::string::size_type>
-SetupPropertyWorkspace(const char8_t *inPropName, eastl::string &ioWorkspace)
-{
- qt3ds::QT3DSU32 outSubIndex = 0;
- ioWorkspace.assign(inPropName ? inPropName : "");
- eastl::string::size_type thePeriodPos = ioWorkspace.find('.');
- if (thePeriodPos != eastl::string::npos) {
- if (thePeriodPos < ioWorkspace.size() - 1) {
- switch (ioWorkspace[thePeriodPos + 1]) {
- default:
- QT3DS_ASSERT(false);
- case 'r':
- case 'x':
- break;
- case 'g':
- case 'y':
- outSubIndex = 1;
- break;
- case 'b':
- case 'z':
- outSubIndex = 2;
- break;
- case 'a':
- case 'w':
- outSubIndex = 3;
- break;
- }
- }
- ioWorkspace.resize(thePeriodPos);
- }
- return eastl::make_pair(ioWorkspace.size(), outSubIndex);
-}
-SElementPropertyInfo *SParseElementManager::GetOrCreateProperty(SElementData &inData,
- const char8_t *inPropertyName)
-{
- SElementData &theData(inData);
- SElementPropertyInfo *retvalPtr = FindProperty(inData, inPropertyName);
- if (retvalPtr)
- return retvalPtr;
-
- eastl::string::size_type thePeriodPos =
- SetupPropertyWorkspace(inPropertyName, m_Workspace).first;
- TStrType theStr = RegisterStr(m_Workspace.c_str());
-
- if (m_MetaData.IsPropertyExist(inData.m_Type, theStr, inData.m_Class) == false)
- return NULL;
-
- eastl::pair<TAttrMap::iterator, bool> theInserter =
- theData.m_PropertyMap.insert(eastl::make_pair(theStr, SElementPropertyInfo(theStr)));
- SElementPropertyInfo &retval(theInserter.first->second);
- if (theInserter.second) {
- qt3ds::intrinsics::memZero(retval.m_PropertyHashes, sizeof(retval.m_PropertyHashes));
- qt3ds::QT3DSU32 *thePropHashes(retval.m_PropertyHashes);
- CRegisteredString *thePropNames(retval.m_PropertyNames);
- retval.m_DataType = m_MetaData.GetPropertyType(theData.m_Type, theStr, theData.m_Class);
- retval.m_AdditionalType =
- m_MetaData.GetAdditionalType(theData.m_Type, theStr, theData.m_Class);
- if (retval.m_DataType != ERuntimeDataModelDataTypeNone) {
- switch (retval.m_DataType) {
- default:
- retval.m_Arity = 1;
- break;
- case ERuntimeDataModelDataTypeFloat2:
- retval.m_Arity = 2;
- break;
- case ERuntimeDataModelDataTypeFloat3:
- retval.m_Arity = 3;
- break;
- case ERuntimeDataModelDataTypeFloat4:
- retval.m_Arity = 4;
- break;
- }
- if (retval.m_Arity > 1) {
- if (retval.m_Arity == 2) {
- SetPropertyValueHash(m_Workspace, ".x", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".y", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- } else if (retval.m_Arity == 3) {
- if (m_MetaData.GetAdditionalType(theData.m_Type, theStr, theData.m_Class)
- == ERuntimeAdditionalMetaDataTypeColor) {
- SetPropertyValueHash(m_Workspace, ".r", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".g", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".b", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- } else {
- SetPropertyValueHash(m_Workspace, ".x", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".y", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".z", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- }
- } else if (retval.m_Arity == 4) {
- if (m_MetaData.GetAdditionalType(theData.m_Type, theStr, theData.m_Class)
- == ERuntimeAdditionalMetaDataTypeColor) {
- SetPropertyValueHash(m_Workspace, ".r", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".g", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".b", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- SetPropertyValueHash(m_Workspace, ".a", thePropHashes, thePeriodPos,
- thePropNames, m_StringTable);
- }
- }
- } else {
- retval.m_PropertyHashes[0] = Q3DStudio::CHash::HashAttribute(theStr.c_str());
- retval.m_PropertyNames[0] = m_StringTable.RegisterStr(m_Workspace.c_str());
- }
- }
- }
- return &retval;
-}
-
-SElementPropertyInfo *SParseElementManager::GetOrCreateProperty(const char8_t *inIdOrRef,
- const char8_t *inElemType,
- const char8_t *inElemClassId,
- const char8_t *inPropertyName)
-{
- return GetOrCreateProperty(GetOrCreateElementData(inIdOrRef, inElemType, inElemClassId),
- inPropertyName);
-}
-
-eastl::pair<SElementPropertyInfo *, qt3ds::QT3DSU32>
-SParseElementManager::FindPropertyWithSubIndex(SElementData &inElement,
- const char8_t *inPropertyName)
-{
- qt3ds::QT3DSU32 subIndex = SetupPropertyWorkspace(inPropertyName, m_Workspace).second;
- TStrType theStr = RegisterStr(m_Workspace.c_str());
- TAttrMap::iterator theIter = inElement.m_PropertyMap.find(theStr);
- SElementPropertyInfo *retval = NULL;
- if (theIter != inElement.m_PropertyMap.end())
- retval = &theIter->second;
- return eastl::make_pair(retval, subIndex);
-}
-
-SElementPropertyInfo *SParseElementManager::FindProperty(SElementData &inElement,
- const char8_t *inPropertyName)
-{
- return FindPropertyWithSubIndex(inElement, inPropertyName).first;
-}
-SElementPropertyInfo *SParseElementManager::FindProperty(const char8_t *inIdOrRef,
- const char8_t *inPropertyName)
-{
- SElementData *theData(FindElementData(inIdOrRef));
- if (theData)
- return FindProperty(*theData, inPropertyName);
- return NULL;
-}
-
-void SParseElementManager::MarkAttributeAsReferenced(SElementData &inElement,
- const char8_t *inPropertyName)
-{
- SElementPropertyInfo *theProp = GetOrCreateProperty(inElement, inPropertyName);
- if (theProp)
- theProp->m_ElementFlag = true;
-}
-
-void SParseElementManager::MarkAttributeAsReferenced(const char8_t *inElement,
- const char8_t *inPropertyName)
-{
- SElementData *theData = FindElementData(inElement);
- if (theData)
- MarkAttributeAsReferenced(*theData, inPropertyName);
-}
-
-void SParseElementManager::MarkAllAttributesAsReferenced(SElementData &inElement,
- bool searchParent)
-{
- m_PropertyList.clear();
- m_MetaData.GetInstanceProperties(inElement.m_Type, inElement.m_Class, m_PropertyList,
- searchParent);
- for (QT3DSU32 idx = 0, end = m_PropertyList.size(); idx < end; ++idx)
- MarkAttributeAsReferenced(inElement, m_PropertyList[idx].c_str());
-}
-
-TStrType SParseSlideManager::RegisterId(const char8_t *inStr)
-{
- if (!inStr)
- inStr = "";
- if (*inStr == '#')
- ++inStr;
- return RegisterStr(inStr);
-}
-
-SParseSlideManager::~SParseSlideManager()
-{
- for (QT3DSU32 idx = 0, end = m_Animations.size(); idx < end; ++idx)
- delete m_Animations[idx];
- m_Animations.clear();
-}
-
-SParseSlide &SParseSlideManager::GetOrCreateSlide(const char8_t *inSlideId, qt3ds::QT3DSI32 inSlideIndex)
-{
- TStrType theSlideId(RegisterId(inSlideId));
- return m_SlideMap.insert(eastl::make_pair(theSlideId, SParseSlide(theSlideId, inSlideIndex)))
- .first->second;
-}
-
-SParseSlide *SParseSlideManager::FindSlide(const char8_t *inSlideId)
-{
- TStrType theSlideId(RegisterId(inSlideId));
- TSlideIdToParseSlideMap::iterator theIter = m_SlideMap.find(theSlideId);
- if (theIter != m_SlideMap.end())
- return &theIter->second;
- return NULL;
-}
-
-void SParseSlideManager::SetAnimationData(SParseSlide &inSlide, const char8_t *inInstanceId,
- const char8_t *inPropertyName,
- const char8_t *inKeyframeData,
- SParseSlideAnimationTypes::Enum inType, bool inIsDynamic,
- bool inIsActive)
-{
- TStrType thePropertyName(RegisterStr(inPropertyName));
- SElementData *theElemData = m_ElementManager.FindElementData(inInstanceId);
- if (theElemData == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- eastl::pair<SElementPropertyInfo *, qt3ds::QT3DSU32> theProperty =
- m_ElementManager.FindPropertyWithSubIndex(*theElemData, thePropertyName);
- if (theProperty.first == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
- qt3ds::QT3DSU32 thePropertyHash = theProperty.first->m_PropertyHashes[theProperty.second];
- // Parse the keyframe data into floating point numbers.
- if (inKeyframeData == NULL)
- inKeyframeData = "";
- m_KeyframeParseBuffer.clear();
- m_KeyframeParseBuffer.assign(inKeyframeData);
- m_KeyframeParseFloatBuffer.clear();
- char8_t *theBufData = const_cast<char8_t *>(m_KeyframeParseBuffer.c_str());
-
- char8_t *theStartPtr = qt3dsdm::FindNextNonWhitespace(theBufData);
- while (theStartPtr && *theStartPtr) {
- char8_t *nextPtr = qt3dsdm::FindNextWhitespace(theStartPtr);
- if (nextPtr && *nextPtr)
- *nextPtr = 0;
- else
- nextPtr = NULL;
- QT3DSF32 temp;
- WStrOps<QT3DSF32>().StrTo(theStartPtr, temp);
- m_KeyframeParseFloatBuffer.push_back(temp);
- theStartPtr = nextPtr;
- if (theStartPtr)
- theStartPtr = FindNextNonWhitespace(theStartPtr + 1);
- }
- // Don't create animations with no keyframes.
- if (m_KeyframeParseFloatBuffer.empty()) {
- return;
- }
-
- SParseSlideAnimationEntry *theEntry =
- new SParseSlideAnimationEntry(inSlide.m_SlideId, theElemData->m_Id, thePropertyName,
- thePropertyHash, inType, NULL, 0, inIsDynamic);
- theEntry->m_KeyframeData = m_KeyframeParseFloatBuffer;
- m_Animations.push_back(theEntry);
- switch (inType) {
- case SParseSlideAnimationTypes::Linear:
- m_AnimationKeyframeCount += m_KeyframeParseFloatBuffer.size() / 2;
- break;
- case SParseSlideAnimationTypes::Bezier:
- m_AnimationKeyframeCount += m_KeyframeParseFloatBuffer.size() / 6;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- case SParseSlideAnimationTypes::EaseInOut:
- m_AnimationKeyframeCount += m_KeyframeParseFloatBuffer.size() / 4;
- break;
- }
-
- ReferenceAnimation(inSlide, *theEntry, inIsActive);
-}
-
-void SParseSlideManager::ReferenceAnimation(SParseSlide &inSlide,
- const SParseSlideAnimationEntry &inSource,
- bool inIsActive)
-{
- TAnimationList &theList =
- inSlide.m_Animations.insert(eastl::make_pair(inSource.m_InstanceId, TAnimationList()))
- .first->second;
- theList.push_back(SParseAnimationRef(inSlide.m_SlideId, inSource.m_InstanceId,
- inSource.m_PropertyName, &inSource, inIsActive));
- m_SlideAnimationCount++;
-}
-
-TAnimationList *SParseSlideManager::GetAnimationsForInstance(SParseSlide &inSlide,
- const char8_t *inInstanceId)
-{
- SElementData *theElemData = m_ElementManager.FindElementData(inInstanceId);
- if (theElemData) {
- TInstanceIdAnimationMap::iterator theAnimations =
- inSlide.m_Animations.find(theElemData->m_Id);
- if (theAnimations != inSlide.m_Animations.end())
- return &theAnimations->second;
- }
- return NULL;
-}
-
-SParseSlideActionEntry &SParseSlideManager::GetOrCreateAction(SParseSlide &inSlide,
- const char8_t *inActionId,
- qt3ds::QT3DSI32 inActionCount,
- bool inActive)
-{
- TStrType theActionId(RegisterId(inActionId));
- SParseSlideActionEntry theAction(inSlide.m_SlideId, theActionId, inActionCount, inActive);
- memZero(theAction.m_Actions, sizeof(theAction.m_Actions));
- TActionList::iterator theIter =
- eastl::find(inSlide.m_ActionList.begin(), inSlide.m_ActionList.end(), theAction);
- if (theIter != inSlide.m_ActionList.end())
- return *theIter;
- inSlide.m_ActionList.push_back(theAction);
- m_ActionCount += inActionCount;
- return inSlide.m_ActionList.back();
-}
-
-SParseSlideActionEntry *SParseSlideManager::FindAction(SParseSlide &inSlide,
- const char8_t *inActionId)
-{
- TStrType theActionId(RegisterId(inActionId));
- SParseSlideActionEntry theAction(inSlide.m_SlideId, theActionId, 0, false);
- TActionList::iterator theIter =
- eastl::find(inSlide.m_ActionList.begin(), inSlide.m_ActionList.end(), theAction);
- if (theIter != inSlide.m_ActionList.end())
- return &(*theIter);
- return NULL;
-}
-
-//==============================================================================
-/**
- * Constructor
- * @param inFileName name of UIP file
- */
-CUIPParserImpl::CUIPParserImpl(const QString &inFileName, IRuntimeMetaData &inMetaData,
- IInputStreamFactory &inFactory,
- qt3ds::foundation::IStringTable &inStringTable)
- : m_MetaData(inMetaData)
- , m_InputStreamFactory(inFactory)
- , m_ParseElementManager(inMetaData, inStringTable)
- , m_ParseSlideManager(inMetaData, m_ParseElementManager)
-{
- // Setup DOMSerializer and DOMReader to read the file
- std::shared_ptr<qt3dsdm::IStringTable> theStrTable(inMetaData.GetStringTable());
- shared_ptr<qt3dsdm::IDOMFactory> theFactory(qt3dsdm::IDOMFactory::CreateDOMFactory(theStrTable));
- TInputStreamPtr theInStream(inFactory.GetStreamForFile(inFileName));
- qt3dsdm::SDOMElement *topElement = NULL;
- if (theInStream)
- topElement = CDOMSerializer::Read(*theFactory, *theInStream);
- if (!topElement) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Could not open UIP file: " << inFileName.toLatin1().constData();
- } else {
- eastl::pair<std::shared_ptr<IDOMWriter>, std::shared_ptr<IDOMReader>> theWriteReader =
- IDOMWriter::CreateDOMWriter(theFactory, *topElement, theStrTable);
- m_DOMWriter = theWriteReader.first;
- m_DOMReader = theWriteReader.second;
- if (!AreEqual(m_DOMReader->GetNarrowElementName(), "UIP")) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Invalid UIP file: " << inFileName.toLatin1().constData();
- }
- }
-
- // Create Helper class
- m_ObjectRefHelper = new CUIPParserObjectRefHelper(m_MetaData);
- m_ActionHelper = new CUIPParserActionHelper(this, m_ObjectRefHelper, m_MetaData);
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CUIPParserImpl::~CUIPParserImpl()
-{
- // Delete Helper class
- delete m_ObjectRefHelper;
- m_ObjectRefHelper = NULL;
-
- delete m_ActionHelper;
- m_ActionHelper = NULL;
-}
-
-//==============================================================================
-/**
- * Load a presentation from a UIP file.
- * @param inPresentation presentation written to
- * @return a flag indicating whether or not we successfully loaded the file
- */
-BOOL CUIPParserImpl::Load(IPresentation &inPresentation,
- NVConstDataRef<SElementAttributeReference> inStateReferences)
-{
- m_CurrentPresentation = &inPresentation;
- if (!m_DOMReader) {
- qCCritical(qt3ds::INVALID_PARAMETER) << "CUIPParserImpl::Load, No DOM reader";
- return FALSE;
- }
-
- BOOL theLoadResult = m_DOMReader->MoveToFirstChild("Project");
-
- // Load project settings
- if (theLoadResult)
- theLoadResult &= LoadProjectSettings(inPresentation, *m_DOMReader);
-
- // First, we need to load the classes, because the class information will be stored in metadata
- if (theLoadResult)
- theLoadResult &= LoadClasses(inPresentation, *m_DOMReader);
-
- // Next is to cache the scene graph because we need the id-name information to resolve object
- // reference
- m_ObjectRefHelper->CacheGraph(*m_DOMReader, *m_DOMWriter);
-
- // Next is to cache the required attributes. This will be used to build Element
- // We also need to cache the actions because we need to know the ActionCount to reserve the
- // memory
- {
- IDOMReader::Scope __graphScope(*m_DOMReader);
- m_DOMReader->MoveToFirstChild("Graph");
- CacheGraphRequiredAttributes(*m_DOMReader);
- }
-
- {
- IDOMReader::Scope __logicScope(*m_DOMReader);
- m_DOMReader->MoveToFirstChild("Logic");
- {
-
- IDOMReader::Scope __stateScope(*m_DOMReader);
- for (BOOL theSuccess = m_DOMReader->MoveToFirstChild("State"); theSuccess;
- theSuccess = m_DOMReader->MoveToNextSibling("State")) {
- IDOMReader::Scope __subSlideScope(*m_DOMReader);
- if (theLoadResult)
- theLoadResult &= CacheLogicRequiredAttributes(*m_DOMReader);
- }
- }
- }
-
- // go through all the references and make sure the elements exist and if they do ensure the
- // attributes are marked as referenced.
- for (QT3DSU32 idx = 0, end = inStateReferences.size(); idx < end; ++idx) {
- const SElementAttributeReference &reference = inStateReferences[idx];
- // All references are absolute, so the start node doesn't really matter.
- CRegisteredString result = m_ObjectRefHelper->ParseObjectRefId(reference.m_Path, "Scene");
- if (result.IsValid() == false) {
- qCCritical(INVALID_OPERATION, "Failed to resolve reference: %s",
- reference.m_Path.c_str());
- } else {
- m_ParseElementManager.MarkAttributeAsReferenced(result.c_str(),
- reference.m_Attribute.c_str());
- }
- }
-
- if (theLoadResult)
- CacheClassRequiredAttributes(*m_DOMReader);
-
- ComputeAndReserveMemory(inPresentation, *m_DOMReader);
-
- // Now we are ready to load the scene graph
- if (theLoadResult)
- theLoadResult &= LoadGraph(inPresentation, *m_DOMReader);
- if (theLoadResult)
- theLoadResult &= LoadLogic(inPresentation, *m_DOMReader);
-
- return theLoadResult;
-}
-
-IDOMReader &CUIPParserImpl::GetDOMReader()
-{
- return *m_DOMReader.get();
-}
-
-//==============================================================================
-/**
- * Load Project Settings
- * @param inPresentation presentation written to
- * @return a flag indicating whether or not we successfully loaded the file
- */
-BOOL CUIPParserImpl::LoadProjectSettings(IPresentation &inPresentation, IDOMReader &inReader)
-{
- IDOMReader::Scope __projectSettingsScope(inReader);
-
- if (inReader.MoveToFirstChild("ProjectSettings")) {
- SPresentationSize thePresentationSize;
- qt3ds::QT3DSI32 theWidth, theHeight;
-
- if (inReader.Att("presentationWidth", theWidth))
- thePresentationSize.m_Width = static_cast<UINT16>(theWidth);
- if (inReader.Att("presentationHeight", theHeight))
- thePresentationSize.m_Height = static_cast<UINT16>(theHeight);
- thePresentationSize.m_ScaleMode = SCALEMODE_EXACT; // ScaleMode is always EXACT
-
- inPresentation.SetSize(thePresentationSize);
-
- return true;
- } else
- return false;
-}
-
-BOOL CUIPParserImpl::LoadClasses(IPresentation & /*inPresentation*/, IDOMReader &inReader)
-{
- IDOMReader::Scope __classesScope(inReader);
-
- if (inReader.MoveToFirstChild("Classes")) {
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- const char *theSourcePath;
- const char *theId;
- const char *theName;
- // Read the sourcepath and id
- if (inReader.Att("sourcepath", theSourcePath) && inReader.Att("id", theId)) {
- // Read the name
- if (!inReader.Att("name", theName))
- theName = theId;
-
- bool theLoadFlag = false;
- QString theFullPath(theSourcePath);
-
- if (theFullPath.endsWith(".qml")) {
- theLoadFlag = m_MetaData.LoadScriptFile(inReader.GetNarrowElementName(), theId,
- theName, theFullPath.toUtf8().data());
- if (theLoadFlag)
- m_IdScriptMap[theId] = theSourcePath;
- } else if (theFullPath.endsWith(".effect")) {
- theLoadFlag = m_MetaData.LoadEffectXMLFile(inReader.GetNarrowElementName(),
- theId, theName,
- theFullPath.toUtf8().data());
- } else if (theFullPath.endsWith(".material") || theFullPath.endsWith(".shader")) {
- theLoadFlag = m_MetaData.LoadMaterialXMLFile(
- inReader.GetNarrowElementName(), theId, theName,
- theFullPath.toUtf8().data());
- } else if (theFullPath.endsWith(".plugin")) {
- theLoadFlag = m_MetaData.LoadPluginXMLFile(inReader.GetNarrowElementName(),
- theId, theName,
- theFullPath.toUtf8().data());
- }
-
- if (!theLoadFlag) {
- // What file is this?!?
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Could not load sourcepath file: "
- << theFullPath.toLatin1().constData();
- }
- }
- }
- }
-
- // Always return true. Failing to load classes should not block the rest of the system.
- return true;
-}
-
-BOOL CUIPParserImpl::LoadGraph(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __childScope(inReader);
-
- m_NumGraphElements = 0;
- m_NumGraphComponents = 0;
- m_NumGraphAttributes = 0;
-
- bool theLoadResult = inReader.MoveToFirstChild("Graph");
- if (theLoadResult) {
- theLoadResult &= LoadSceneGraph(inPresentation, inReader);
- if (theLoadResult)
- PatchSceneElementRef();
- }
-
- return theLoadResult;
-}
-
-using qt3ds::runtime::element::SPropertyDesc;
-using qt3ds::runtime::element::TPropertyDescAndValue;
-
-void CUIPParserImpl::GetMetaAttribute(IPresentation &inPresentation,
- TPropertyDescAndValueList &outDescList, TStrType inType,
- TStrType inName, TStrType inClassId,
- CRegisteredString *inAttStrNames)
-{
- ERuntimeDataModelDataType thePropertyType =
- m_MetaData.GetPropertyType(inType, inName, inClassId);
-
- // TODO: Handle all other types
- switch (thePropertyType) {
- case ERuntimeDataModelDataTypeFloat:
- AddFloatAttribute(outDescList, inAttStrNames[0],
- m_MetaData.GetPropertyValueFloat(inType, inName, inClassId));
- break;
- case ERuntimeDataModelDataTypeFloat2: {
- QT3DSVec2 vec2 = m_MetaData.GetPropertyValueVector2(inType, inName, inClassId);
- SFloat2 theValue(vec2.x, vec2.y);
- AddFloat2Attribute(outDescList, inAttStrNames, theValue);
- break;
- }
- case ERuntimeDataModelDataTypeFloat3: {
- QT3DSVec3 vec3 = m_MetaData.GetPropertyValueVector3(inType, inName, inClassId);
- SFloat3 theValue(vec3.x, vec3.y, vec3.z);
- ERuntimeAdditionalMetaDataType theAdditionalType =
- m_MetaData.GetAdditionalType(inType, inName, inClassId);
- AddFloat3Attribute(outDescList, theAdditionalType, inAttStrNames, theValue);
- break;
- }
- case ERuntimeDataModelDataTypeFloat4: {
- QT3DSVec4 vec4 = m_MetaData.GetPropertyValueVector4(inType, inName, inClassId);
- SFloat4 theValue(vec4.x, vec4.y, vec4.z, vec4.w);
- ERuntimeAdditionalMetaDataType theAdditionalType =
- m_MetaData.GetAdditionalType(inType, inName, inClassId);
- AddFloat4Attribute(outDescList, theAdditionalType, inAttStrNames, theValue);
- break;
- }
- case ERuntimeDataModelDataTypeLong:
- AddLongAttribute(outDescList, inAttStrNames[0],
- m_MetaData.GetPropertyValueLong(inType, inName, inClassId));
- break;
- case ERuntimeDataModelDataTypeString: {
- Option<eastl::string> theRuntimeStr =
- m_MetaData.GetPropertyValueString(inType, inName, inClassId);
- if (theRuntimeStr.hasValue())
- AddStringAttribute(inPresentation, outDescList, inAttStrNames[0],
- theRuntimeStr->c_str());
- else
- AddStringAttribute(inPresentation, outDescList, inAttStrNames[0], "");
- } break;
- case ERuntimeDataModelDataTypeBool:
- AddBoolAttribute(outDescList, inAttStrNames[0],
- m_MetaData.GetPropertyValueBool(inType, inName, inClassId));
- break;
- case ERuntimeDataModelDataTypeLong4:
- AddElementRefAttribute(outDescList, inAttStrNames[0], NULL);
- break;
- case ERuntimeDataModelDataTypeObjectRef: {
- // Object ref is converted to string path
- eastl::string theRuntimeStr =
- m_MetaData.GetPropertyValueObjectRef(inType, inName, inClassId);
- eastl::string theObjectRef = m_ObjectRefHelper->BuildReferenceString(theRuntimeStr);
- AddStringAttribute(inPresentation, outDescList, inAttStrNames[0], theObjectRef.c_str());
- break;
- }
- default:
- QT3DS_ASSERT(false);
- }
-}
-
-void CUIPParserImpl::AddFloatAttribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, float &inValue)
-{
- UVariant theValue;
- theValue.m_FLOAT = inValue;
- outDescList.push_back(
- eastl::make_pair(SPropertyDesc(inAttStrName, ATTRIBUTETYPE_FLOAT), theValue));
-}
-
-void CUIPParserImpl::AddLongAttribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, qt3ds::QT3DSI32 &inValue)
-{
- UVariant theValue;
- theValue.m_INT32 = inValue;
- outDescList.push_back(
- eastl::make_pair(SPropertyDesc(inAttStrName, ATTRIBUTETYPE_INT32), theValue));
-}
-
-void CUIPParserImpl::AddBoolAttribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, bool &inValue)
-{
- UVariant theValue;
- theValue.m_INT32 = inValue;
- outDescList.push_back(
- eastl::make_pair(SPropertyDesc(inAttStrName, ATTRIBUTETYPE_BOOL), theValue));
-}
-
-void CUIPParserImpl::AddFloat2Attribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString *inAttStrNames, SFloat2 &inValue)
-{
- for (long theIndex = 0; theIndex < 2; ++theIndex) {
- UVariant theValue;
- theValue.m_FLOAT = inValue[theIndex];
- outDescList.push_back(eastl::make_pair(
- SPropertyDesc(inAttStrNames[theIndex], ATTRIBUTETYPE_FLOAT), theValue));
- }
-}
-
-void CUIPParserImpl::AddFloat3Attribute(TPropertyDescAndValueList &outDescList,
- ERuntimeAdditionalMetaDataType inAdditionalType,
- CRegisteredString *inAttStrNames, SFloat3 &inValue)
-{
- for (long theIndex = 0; theIndex < 3; ++theIndex) {
- float theValue = inValue[theIndex];
- if (inAdditionalType == ERuntimeAdditionalMetaDataTypeRotation)
- TORAD(theValue);
- UVariant theVarValue;
- theVarValue.m_FLOAT = theValue;
- outDescList.push_back(eastl::make_pair(
- SPropertyDesc(inAttStrNames[theIndex], ATTRIBUTETYPE_FLOAT), theVarValue));
- }
-}
-
-void CUIPParserImpl::AddFloat4Attribute(TPropertyDescAndValueList &outDescList,
- ERuntimeAdditionalMetaDataType inAdditionalType,
- CRegisteredString *inAttStrNames, SFloat4 &inValue)
-{
- for (long i = 0; i < 4; ++i) {
- UVariant varVal;
- varVal.m_FLOAT = inValue[i];
- outDescList.push_back(eastl::make_pair(
- SPropertyDesc(inAttStrNames[i], ATTRIBUTETYPE_FLOAT), varVal));
- }
-}
-
-
-void CUIPParserImpl::AddStringAttribute(IPresentation &inPresentation,
- TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, const char *inValue)
-{
- qt3ds::foundation::CStringHandle theString = inPresentation.GetStringTable().GetHandle(inValue);
- UVariant theValue;
- theValue.m_StringHandle = theString.handle();
- outDescList.push_back(
- eastl::make_pair(SPropertyDesc(inAttStrName, ATTRIBUTETYPE_STRING), theValue));
- if (CHash::HashAttribute(inAttStrName.c_str()) == Q3DStudio::ATTRIBUTE_SOURCEPATH && inValue
- && *inValue)
- AddSourcePath(inValue);
-}
-
-void CUIPParserImpl::AddElementRefAttribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, SElement *inElement)
-{
- UVariant theValue;
- if (inElement) {
- theValue.m_ElementHandle = inElement->GetHandle();
- QT3DS_ASSERT(theValue.m_ElementHandle);
- } else
- theValue.m_ElementHandle = 0;
- outDescList.push_back(
- eastl::make_pair(SPropertyDesc(inAttStrName, ATTRIBUTETYPE_ELEMENTREF), theValue));
-}
-
-void CUIPParserImpl::GetAttributeList(IPresentation &inPresentation,
- TPropertyDescAndValueList &outDescList, TStrType inType,
- TStrType inName, TStrType inClassId, const char *inValue,
- CRegisteredString *inPropNameStrs)
-{
- ERuntimeDataModelDataType theDataType = m_MetaData.GetPropertyType(inType, inName, inClassId);
- ERuntimeAdditionalMetaDataType theAdditionalType =
- m_MetaData.GetAdditionalType(inType, inName, inClassId);
-
- GetAttributeList(inPresentation, outDescList, theDataType, theAdditionalType, inName, inValue,
- inPropNameStrs);
-}
-
-void CUIPParserImpl::GetAttributeList(IPresentation &inPresentation,
- TPropertyDescAndValueList &outDescList,
- ERuntimeDataModelDataType inDataType,
- ERuntimeAdditionalMetaDataType inAdditionalType, const char *,
- const char *inValue, CRegisteredString *inPropNameStrs)
-{
- // Create a destructible value
- m_ValueBuffer.clear();
- m_TempBuffer.clear();
- m_ValueBuffer.write(inValue, (QT3DSU32)strlen(inValue) + 1);
- WCharTReader theReader((char8_t *)m_ValueBuffer.begin(), m_TempBuffer,
- *m_DOMReader->GetStringTable());
-
- // TODO: Handle all other types
- // Note that the default value should be consistent with the SetDefault method of
- // TDataModelValue
- switch (inDataType) {
- case ERuntimeDataModelDataTypeLong: {
- qt3ds::QT3DSI32 theValue = 0;
- if (!IsTrivial(inValue))
- theReader.Read(theValue);
- AddLongAttribute(outDescList, inPropNameStrs[0], theValue);
- break;
- }
- case ERuntimeDataModelDataTypeFloat: {
- float theValue = 0;
- if (!IsTrivial(inValue))
- theReader.Read(theValue);
- AddFloatAttribute(outDescList, inPropNameStrs[0], theValue);
- break;
- }
- case ERuntimeDataModelDataTypeFloat2: {
- SFloat2 theValue(0);
- if (!IsTrivial(inValue))
- theReader.ReadRef(NVDataRef<QT3DSF32>(&theValue[0], 2));
- AddFloat2Attribute(outDescList, inPropNameStrs, theValue);
- break;
- }
- case ERuntimeDataModelDataTypeFloat3: {
- SFloat3 theValue(0);
- if (!IsTrivial(inValue))
- theReader.ReadRef(NVDataRef<QT3DSF32>(&theValue[0], 3));
- AddFloat3Attribute(outDescList, inAdditionalType, inPropNameStrs, theValue);
- break;
- }
- case ERuntimeDataModelDataTypeFloat4: {
- SFloat4 theValue(0);
- if (!IsTrivial(inValue))
- theReader.ReadRef(NVDataRef<QT3DSF32>(&theValue[0], 4));
- AddFloat4Attribute(outDescList, inAdditionalType, inPropNameStrs, theValue);
- break;
- }
- case ERuntimeDataModelDataTypeBool: {
- bool theValue = false;
- if (!IsTrivial(inValue))
- theReader.Read(theValue);
- AddBoolAttribute(outDescList, inPropNameStrs[0], theValue);
- break;
- }
- case ERuntimeDataModelDataTypeStringRef:
- case ERuntimeDataModelDataTypeString: {
- const char *theDataPtr = "";
- if (!IsTrivial(inValue))
- theReader.Read(theDataPtr);
- AddStringAttribute(inPresentation, outDescList, inPropNameStrs[0], theDataPtr);
- break;
- }
- case ERuntimeDataModelDataTypeLong4: {
- const char *theDataPtr = NULL;
- if (!IsTrivial(inValue))
- theReader.Read(theDataPtr);
- SElement *theElementData = GetElement(theDataPtr);
- AddElementRefAttribute(outDescList, inPropNameStrs[0], theElementData);
- break;
- }
- case ERuntimeDataModelDataTypeObjectRef: {
- // Object ref is converted to string path
- const char *theDataPtr = NULL;
- if (!IsTrivial(inValue))
- theReader.Read(theDataPtr);
- if (theDataPtr) {
- eastl::string theObjectRef = m_ObjectRefHelper->BuildReferenceString(theDataPtr);
- AddStringAttribute(inPresentation, outDescList, inPropNameStrs[0],
- theObjectRef.c_str());
- }
- break;
- }
- default:
- QT3DS_ASSERT(false);
- }
-}
-
-//==============================================================================
-/**
- * Looks up the EElementType from the asset type.
- */
-EElementType GetElementType(const char *inType)
-{
- if (AreEqual(inType, "Scene") || AreEqual(inType, "Layer") || AreEqual(inType, "Group")
- || AreEqual(inType, "Model") || AreEqual(inType, "Path"))
- return ELEMENTTYPE_NODE;
-
- else if (AreEqual(inType, "Camera"))
- return ELEMENTTYPE_CAMERA;
-
- else if (AreEqual(inType, "Light"))
- return ELEMENTTYPE_LIGHT;
-
- else if (AreEqual(inType, "Component"))
- return ELEMENTTYPE_COMPONENT;
-
- else if (AreEqual(inType, "Material"))
- return ELEMENTTYPE_MATERIAL;
-
- else if (AreEqual(inType, "Image"))
- return ELEMENTTYPE_TEXTURE;
-
- else if (AreEqual(inType, "Behavior"))
- return ELEMENTTYPE_BEHAVIOR;
-
- else if (AreEqual(inType, "Text"))
- return ELEMENTTYPE_TEXT;
-
- else if (AreEqual(inType, "PathAnchorPoint"))
- return ELEMENTTYPE_PATHANCHORPOINT;
-
- else if (AreEqual(inType, "SubPath"))
- return ELEMENTTYPE_SUBPATH;
-
- else
- return ELEMENTTYPE_UNKNOWN;
-}
-
-//==============================================================================
-/**
- * Build out the graph.
- * @param inPresentation presentation written to
- * @return a flag indicating whether or not we successfully loaded the file
- */
-BOOL CUIPParserImpl::LoadSceneGraph(IPresentation &inPresentation, IDOMReader &inReader,
- qt3ds::runtime::element::SElement *inNewStyleParent)
-{
- IDOMReader::Scope __childScope(inReader);
- IScriptBridge *theScriptBridgeQml = inPresentation.GetScriptBridgeQml();
-
- eastl::string theFileString;
- qt3ds::runtime::IApplication &theApp(inPresentation.GetApplication());
- qt3ds::runtime::IElementAllocator &theElemAllocator(theApp.GetElementAllocator());
- TPropertyDescAndValueList theProperties;
- using qt3ds::runtime::element::SPropertyDesc;
- qt3ds::foundation::IStringTable &theStringTable(inPresentation.GetStringTable());
- // build out the graph.
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- theProperties.clear();
- const char *theId;
- inReader.Att("id", theId);
- const char *theClass;
- inReader.Att("class", theClass);
- const char *theType(inReader.GetNarrowElementName());
- eastl::string theName(m_ObjectRefHelper->GetName(theId).c_str());
- // Get default end time from metadata
- UINT32 theLoopTime = 0;
- bool isComponent = false;
- bool isBehavior = false;
-
- // Create SElement
- if (AreEqual(theType, "Scene") || AreEqual(theType, "Component")) {
- // TDataModelValue theValue;
- theLoopTime = m_MetaData.GetPropertyValueLong(m_MetaData.Register(theType),
- m_MetaData.Register("endtime"));
- Q3DStudio_ASSERT(theLoopTime != 0); // Something is wrong here
- isComponent = true;
- } else {
- if (AreEqual(theType, "Behavior") && !IsTrivial(theClass)) {
- // Find the sourcepath and load the script
- ++theClass; // remove the '#'
- TIdSourcePathMap::iterator theSourcePathIter = m_IdScriptMap.find(theClass);
- if (theSourcePathIter != m_IdScriptMap.end()) {
- theFileString.assign(theSourcePathIter->second);
-
-// For non-windows platforms, we need to reverse the slashes
-#ifndef EA_PLATFORM_WINDOWS
- for (eastl::string::size_type thePos = theFileString.find('\\');
- thePos != eastl::string::npos;
- thePos = theFileString.find('\\', thePos + 1)) {
- theFileString.replace(thePos, 1, 1, '/');
- }
-#endif
- isBehavior = true;
- UVariant theValue;
- theValue.m_StringHandle =
- inPresentation.GetStringTable().GetHandle(theFileString.c_str());
- theProperties.push_back(eastl::make_pair(
- SPropertyDesc(theStringTable.RegisterStr("behaviorscripts"),
- ATTRIBUTETYPE_STRING),
- theValue));
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Could not load Behavior script: " << theClass;
- }
- }
- }
-
- SElementData &theElementData =
- m_ParseElementManager.GetOrCreateElementData(theId, theType, theClass);
-
- const char8_t *theSourcePath;
- if (inReader.UnregisteredAtt("sourcepath", theSourcePath))
- AddSourcePath(theSourcePath);
-
- TAttrMap &theList = theElementData.m_PropertyMap;
-
- const char *theAttribute;
- for (TAttrMap::iterator theIter = theList.begin(), theMapEnd = theList.end();
- theIter != theMapEnd; ++theIter) {
- if (theIter->second.m_ElementFlag) {
- // Parse the property value from uip, this will overwrite the default value
- const TStrType &thePropertyName(theIter->first);
- CRegisteredString *thePropertyNames = theIter->second.m_PropertyNames;
- size_t theListSize = theProperties.size();
- if (inReader.Att(thePropertyName.c_str(), theAttribute)) {
- ERuntimeDataModelDataType theDataType = m_MetaData.GetPropertyType(
- theElementData.m_Type, thePropertyName, theElementData.m_Class);
- if (theDataType == ERuntimeDataModelDataTypeLong4) {
- AddElementRefToPatch(theProperties, theElementData, thePropertyName.c_str(),
- theAttribute);
- } else
- GetAttributeList(inPresentation, theProperties, theElementData.m_Type,
- thePropertyName, theElementData.m_Class, theAttribute,
- thePropertyNames);
- } else {
- GetMetaAttribute(inPresentation, theProperties, theElementData.m_Type,
- thePropertyName, theElementData.m_Class, thePropertyNames);
- }
- size_t theNumAtts = theProperties.size() - theListSize;
- QT3DS_ASSERT(theNumAtts == (size_t)theIter->second.m_Arity);
- (void)theNumAtts;
- }
- }
- qt3ds::runtime::element::SElement &theNewElem = theElemAllocator.CreateElement(
- theStringTable.RegisterStr(theName.c_str()), theStringTable.RegisterStr(theType),
- theStringTable.RegisterStr(theElementData.m_Class.c_str()),
- toConstDataRef(theProperties.data(), (QT3DSU32)theProperties.size()), &inPresentation,
- inNewStyleParent, isComponent);
- theElementData.m_Element = &theNewElem;
-
- if (inPresentation.GetRoot() == NULL)
- inPresentation.SetRoot(theNewElem);
-
- eastl::string thePath;
- // build out the full path to the element for debugging
- for (CUIPParserObjectRefHelper::SGraphNode *theNode =
- this->m_ObjectRefHelper->GetNode(theId);
- theNode; theNode = theNode->m_Parent) {
- if (thePath.length())
- thePath.insert(0, ".");
- thePath.insert(0, theNode->m_Name);
- }
- if (thePath.size())
- theNewElem.m_Path = m_ParseElementManager.m_StringTable.RegisterStr(thePath.c_str());
-
- if (isBehavior) {
- if (theFileString.find(".qml") != eastl::string::npos) {
- theScriptBridgeQml->LoadScript(&inPresentation, &theNewElem,
- theFileString.c_str());
- }
- }
- LoadSceneGraph(inPresentation, inReader, &theNewElem);
- }
-
- return true;
-}
-
-//==============================================================================
-/**
- * This method will parse through the graph sections to cache those attributes that
- * should never be optimized
- */
-void CUIPParserImpl::CacheGraphRequiredAttributes(qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __childScope(inReader);
-
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- const char *theId;
- inReader.Att("id", theId);
- const char *theType(inReader.GetNarrowElementName());
- const char *theClass = "";
- inReader.Att("class", theClass);
- SElementData &theData =
- m_ParseElementManager.GetOrCreateElementData(theId, theType, theClass);
- // name and sourcepath are never optimized out.
- m_ParseElementManager.MarkAttributeAsReferenced(theData, "name");
- // not everything needs to be in the time graph.
- if (AreEqual(theType, "Scene") == false && AreEqual(theType, "Material") == false
- && AreEqual(theType, "CustomMaterial") == false && AreEqual(theType, "Image") == false
- && AreEqual(theType, "RenderPlugin") == false) {
- SElementPropertyInfo *theProp =
- m_ParseElementManager.GetOrCreateProperty(theData, "starttime");
- theProp->m_SlideFlag = true;
- theProp->m_SlideForceFlag = true;
- theProp->m_ElementFlag = true;
- theProp = m_ParseElementManager.GetOrCreateProperty(theData, "endtime");
- theProp->m_SlideFlag = true;
- theProp->m_SlideForceFlag = true;
- theProp->m_ElementFlag = true;
- }
-
- // Probably not the most optimal thing to expose this attribute for all elements that
- // support it, since it is not really needed except during initialization
- m_ParseElementManager.MarkAttributeAsReferenced(theData, "controlledproperty");
- m_ParseElementManager.MarkAttributeAsReferenced(theData, "observedproperty");
-
- // Behaviors need all attributes possible on the object on them all the time.
- if (AreEqual(theType, "Behavior") || AreEqual(theType, "RenderPlugin")) {
- m_ParseElementManager.MarkAllAttributesAsReferenced(theData);
- }
-
- // Recursive
- CacheGraphRequiredAttributes(inReader);
- }
-}
-
-//==============================================================================
-/**
- * This method will parse through the logic sections to cache those attributes that
- * will be changed and thus needs to be at the SElement
- */
-BOOL CUIPParserImpl::CacheLogicRequiredAttributes(qt3dsdm::IDOMReader &inReader,
- qt3ds::QT3DSI32 inSlideIndex,
- SParseSlide *inParentSlide)
-{
- IDOMReader::Scope __stateScope(inReader);
- eastl::string theSlideId = GetSlideId(inReader);
- SParseSlide &theSlide = m_ParseSlideManager.GetOrCreateSlide(theSlideId.c_str(), inSlideIndex);
- eastl::hash_set<TStrType> theCommandInstances;
- QT3DSU32 slideAnimActions = 0;
-
- {
- IDOMReader::Scope __commandLoopScope(inReader);
- for (BOOL theSuccess = inReader.MoveToFirstChild(); theSuccess;
- theSuccess = inReader.MoveToNextSibling()) {
- IDOMReader::Scope __commandScope(inReader);
- if (AreEqual(inReader.GetNarrowElementName(), "Add")
- || AreEqual(inReader.GetNarrowElementName(), "Set")) {
- bool isSet = AreEqual(inReader.GetNarrowElementName(), "Set");
-
- const char *theRef;
- if (inReader.Att("ref", theRef)) {
- theRef++; // remove the '#'
-
- // Set/Add command applied to an element *not* in the scene graph.
- SElementData *theData = m_ParseElementManager.FindElementData(theRef);
- if (theData == NULL) {
- QT3DS_ASSERT(false);
- continue;
- }
- // If this element has controlledproperty, need to mark all as referenced
- // in order for datainput initialisation to find attributes that
- // are controlled
- // TODO: we could parse out the exact controlled property names and
- // set only those as referenced. In this case we might have to expand vec3
- // type attributes to component parts
- const char *ctrldProp;
- const char *observedProp;
- inReader.Att("controlledproperty", ctrldProp);
- inReader.Att("observedproperty", observedProp);
- if (ctrldProp || observedProp)
- m_ParseElementManager.MarkAllAttributesAsReferenced(*theData, true);
-
- theCommandInstances.insert(theData->m_Id);
- if (isSet) {
- for (eastl::pair<const char *, const char *> theAtt =
- inReader.GetNarrowFirstAttribute();
- !IsTrivial(theAtt.first); theAtt = inReader.GetNarrowNextAttribute()) {
- if (AreEqual(theAtt.first, "ref") || AreEqual(theAtt.first, "shy"))
- continue;
-
- SElementPropertyInfo *theProperty =
- m_ParseElementManager.GetOrCreateProperty(*theData, theAtt.first);
- // This property exists on both the elements and the slides.
- if (theProperty) {
- theProperty->m_ElementFlag = true;
- theProperty->m_SlideFlag = true;
- }
- }
- // Run through parent animations and forward them *if* this set command does
- // not have this property present.
- if (inParentSlide) {
- TAnimationList *theAnimations =
- m_ParseSlideManager.GetAnimationsForInstance(*inParentSlide,
- theData->m_Id);
- if (theAnimations != NULL) {
- for (QT3DSU32 animIdx = 0, animEnd = theAnimations->size();
- animIdx < animEnd; ++animIdx) {
- SParseAnimationRef &theEntry((*theAnimations)[animIdx]);
- const char8_t *propValue = "";
- SElementPropertyInfo *thePropInfo =
- m_ParseElementManager.FindProperty(
- *theData, theEntry.m_PropertyName.c_str());
- if (!thePropInfo) {
- QT3DS_ASSERT(false);
- continue;
- }
- // If the attribute doesn't exist in the command, then we
- // forward the animation to here
- if (inReader.Att(thePropInfo->m_PropertyName, propValue)
- == false) {
- ++slideAnimActions;
- m_ParseSlideManager.ReferenceAnimation(
- theSlide, *theEntry.m_Animation, true);
- }
- }
- }
- }
- }
-
- // find all the animations, regardless of add or set.
- {
- IDOMReader::Scope __animationScope(inReader);
- for (BOOL theAnimScopeSuccess = inReader.MoveToFirstChild("AnimationTrack");
- theAnimScopeSuccess;
- theAnimScopeSuccess = inReader.MoveToNextSibling("AnimationTrack")) {
- const char *theProperty;
- const char8_t *theValue = "";
- inReader.Value(theValue);
- if (theValue != NULL && *theValue
- && inReader.UnregisteredAtt("property", theProperty)) {
- m_ParseElementManager.MarkAttributeAsReferenced(*theData,
- theProperty);
- // PreParse the animation at this point. This allows us to easily
- // count animations.
- bool isDynamic = false;
- inReader.Att("dynamic", isDynamic);
- SParseSlideAnimationTypes::Enum theParseType =
- SParseSlideAnimationTypes::EaseInOut;
- const char8_t *animType;
- if (inReader.Att("type", animType)) {
- if (AreEqual(animType, "EaseInOut")) {
- } else if (AreEqual(animType, "Bezier"))
- theParseType = SParseSlideAnimationTypes::Bezier;
- else if (AreEqual(animType, "Linear"))
- theParseType = SParseSlideAnimationTypes::Linear;
- else {
- QT3DS_ASSERT(false);
- }
- }
- ++slideAnimActions;
- m_ParseSlideManager.SetAnimationData(
- theSlide, theData->m_Id, theProperty, theValue, theParseType,
- isDynamic, inSlideIndex != 0);
- }
- }
- }
-
- // find all the actions
- {
- IDOMReader::Scope __actionScope(inReader);
- for (BOOL theActionScopeSuccess = inReader.MoveToFirstChild("Action");
- theActionScopeSuccess;
- theActionScopeSuccess = inReader.MoveToNextSibling("Action")) {
- const char8_t *theActionId;
- // Don't cache reference actions
- if (inReader.Att("id", theActionId)) {
- m_ActionHelper->CacheAction(inReader, theData->m_Id);
- bool active = true;
- inReader.Att("eyeball", active);
- ++slideAnimActions;
- m_ParseSlideManager.GetOrCreateAction(
- theSlide, theActionId,
- m_ActionHelper->GetActionCount(theActionId), active);
- }
- }
- }
- }
- }
- }
- }
- // Now forward all animations from the parent slide that are for instances that we haven't
- // covered at all on this slide.
- if (inParentSlide) {
- for (TInstanceIdAnimationMap::iterator theIter = inParentSlide->m_Animations.begin(),
- theEnd = inParentSlide->m_Animations.end();
- theIter != theEnd; ++theIter) {
- if (theCommandInstances.find(theIter->first) == theCommandInstances.end()) {
- TAnimationList &theList(theIter->second);
- for (QT3DSU32 animIdx = 0, animEnd = theList.size(); animIdx < animEnd; ++animIdx) {
- SParseAnimationRef &theEntry(theList[animIdx]);
- m_ParseSlideManager.ReferenceAnimation(theSlide, *theEntry.m_Animation, true);
- ++slideAnimActions;
- }
- }
- }
- // Forward action creation onto this slide.
- for (TActionList::iterator theIter = inParentSlide->m_ActionList.begin(),
- theEnd = inParentSlide->m_ActionList.end();
- theIter != theEnd; ++theIter) {
- SParseSlideActionEntry &theAction(*theIter);
- m_ParseSlideManager.GetOrCreateAction(theSlide, theAction.m_ActionId,
- theAction.m_ActionCount, theAction.m_Active);
- ++slideAnimActions;
- }
- }
-
- eastl::vector<eastl::string> theChildSlideIds;
-
- for (BOOL theSuccess = inReader.MoveToFirstChild("State"); theSuccess;
- theSuccess = inReader.MoveToNextSibling("State")) {
- IDOMReader::Scope __subSlideScope(inReader);
- ++inSlideIndex;
- theChildSlideIds.push_back(GetSlideId(inReader));
- CacheLogicRequiredAttributes(inReader, inSlideIndex, &theSlide);
- }
-
- // Pull all child animations up into this slide, but set them to deactivated.
- for (QT3DSU32 childSlideIdx = 0, childSlideEnd = theChildSlideIds.size();
- childSlideIdx < childSlideEnd; ++childSlideIdx) {
- SParseSlide *theChildSlide =
- m_ParseSlideManager.FindSlide(theChildSlideIds[childSlideIdx].c_str());
- if (theChildSlide) {
- // Add animations that did not original in this slide to this slide.
- for (TInstanceIdAnimationMap::iterator theIter = theChildSlide->m_Animations.begin(),
- theEnd = theChildSlide->m_Animations.end();
- theIter != theEnd; ++theIter) {
- TAnimationList &theList(theIter->second);
- for (QT3DSU32 animIdx = 0, animEnd = theList.size(); animIdx < animEnd; ++animIdx) {
- SParseAnimationRef &theEntry(theList[animIdx]);
- if (theEntry.m_Animation
- && theEntry.m_Animation->m_SlideId != theSlide.m_SlideId) {
- m_ParseSlideManager.ReferenceAnimation(theSlide, *theEntry.m_Animation,
- false);
- ++slideAnimActions;
- }
- }
- }
- for (TActionList::iterator theIter = theChildSlide->m_ActionList.begin(),
- theEnd = theChildSlide->m_ActionList.end();
- theIter != theEnd; ++theIter) {
- SParseSlideActionEntry &theEntry(*theIter);
- // This deactivates actions that may be active on another slide.
- m_ParseSlideManager.GetOrCreateAction(theSlide, theEntry.m_ActionId,
- theEntry.m_ActionCount, false);
- ++slideAnimActions;
- }
- }
- }
- // qt3ds::NVFoundationBase& fnd(
- // m_CurrentPresentation->GetApplication().GetRuntimeFactory().GetFoundation() );
- // fnd.error( QT3DS_TRACE, "Loading slide %s, %d anim actions", theSlideId.c_str(),
- // slideAnimActions );
-
- return TRUE;
-}
-
-void CUIPParserImpl::CacheClassRequiredAttributes(qt3dsdm::IDOMReader &inReader)
-{
- {
- // First, we parse Graph section to cache custom attributes specified by the class
- IDOMReader::Scope __graphScope(inReader);
- inReader.MoveToFirstChild("Graph");
- CacheClassSceneAttributes(inReader);
- }
- if (!m_IdClassMap.empty()) {
- // Next, we parse Logic section to update the references
- IDOMReader::Scope __logicScope(inReader);
- inReader.MoveToFirstChild("Logic");
- CacheClassStateAttributes(inReader);
- }
-}
-
-void CUIPParserImpl::CacheClassSceneAttributes(IDOMReader &inReader)
-{
- IDOMReader::Scope __childScope(inReader);
- // build out the graph.
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- const char *theId;
- const char *theClass;
- if (inReader.Att("class", theClass) && inReader.Att("id", theId)) {
- // Add to id-class map
- m_IdClassMap[theId] = theClass;
- }
- CacheClassSceneAttributes(inReader);
- }
-}
-
-void CUIPParserImpl::CacheClassStateAttributes(IDOMReader &inReader)
-{
- IDOMReader::Scope __childScope(inReader);
-
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "State"))
- CacheClassStateAttributes(inReader);
- else if (AreEqual(inReader.GetNarrowElementName(), "Add")
- || AreEqual(inReader.GetNarrowElementName(), "Set")) {
- const char *theRef;
- if (inReader.Att("ref", theRef)) {
- theRef++; // remove the '#'
-
- // Find the class, if any
- TIdClassMap::iterator theIter = m_IdClassMap.find(theRef);
- if (theIter != m_IdClassMap.end()) {
- // Get References of the class
- eastl::vector<eastl::string> theReferences;
- m_MetaData.GetReferences("", theReferences, theIter->second.c_str());
- if (!theReferences.empty()) {
- // Cache the references
- m_ObjectRefHelper->MarkAllReferencedAttributes(
- theRef, theReferences, inReader, m_ParseElementManager);
- }
- }
- }
- }
- }
-}
-
-//==============================================================================
-/**
- * For ElementRef type, there could be times where the SElement isn't created yet, thus
- * this method cache those Long4 type and add an empty attribute into the SElement
- */
-void CUIPParserImpl::AddElementRefToPatch(TPropertyDescAndValueList &outDescList,
- SElementData &inElement, const char *inName,
- const char *inValue)
-{
- SElementRefCache theElementRefData;
- theElementRefData.m_Element = &inElement;
- theElementRefData.m_Name = inName;
- theElementRefData.m_Value = inValue;
- m_ElementRefCache.push_back(theElementRefData);
-
- UVariant theValue;
- theValue.m_ElementHandle = 0;
- outDescList.push_back(
- eastl::make_pair(SPropertyDesc(m_ParseElementManager.m_StringTable.RegisterStr(inName),
- ATTRIBUTETYPE_ELEMENTREF),
- theValue));
-}
-
-//==============================================================================
-/**
- * For those Long4 type that was not loaded correctly, go through all of them and
- * fix up the ElementRef
- */
-void CUIPParserImpl::PatchSceneElementRef()
-{
- for (eastl::vector<SElementRefCache>::iterator theIter = m_ElementRefCache.begin();
- theIter != m_ElementRefCache.end(); ++theIter) {
- SElementRefCache &theCache = *theIter;
-
- SElementData *theElementData = GetElementData(theCache.m_Value.c_str());
-
- SElement *theElement = theCache.m_Element->m_Element;
- UVariant *theValue = theElement->FindPropertyValue(
- m_ParseElementManager.RegisterStr(theCache.m_Value.c_str()));
- if (theValue) {
- theValue->m_ElementHandle = 0;
- if (theElementData->m_Element) {
- theValue->m_ElementHandle = theElementData->m_Element->GetHandle();
- QT3DS_ASSERT(theValue->m_ElementHandle);
- }
- }
- }
-}
-
-BOOL CUIPParserImpl::LoadLogic(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __logicScope(inReader);
-
- m_NumSlides = 0;
- m_NumSlideElements = 0;
- m_NumSlideAttributes = 0;
- m_NumAnimationTracks = 0;
- m_NumAnimationKeys = 0;
- m_NumSlideAnimations = 0;
- m_NumSlideActions = 0;
-
- bool theStatus = true;
-
- // Build all of the animation objects that we have tallied up.
- for (QT3DSU32 animIdx = 0, animEnd = m_ParseSlideManager.m_Animations.size(); animIdx < animEnd;
- ++animIdx) {
- SParseSlideAnimationEntry &theEntry = *m_ParseSlideManager.m_Animations[animIdx];
- SElementData *theData = m_ParseElementManager.FindElementData(theEntry.m_InstanceId);
- // Generate valid animation indexes while we are at it.
- LoadAnimationTrack(inPresentation, *theData, theEntry);
- }
-
- if (inReader.MoveToFirstChild("Logic")) {
-
- // Action
- m_ActionHelper->BuildActions(inPresentation);
-
- for (BOOL theSuccess = inReader.MoveToFirstChild("State"); theSuccess;
- theSuccess = inReader.MoveToNextSibling("State")) {
- theStatus &= LoadStateGraph(inPresentation, inReader);
- }
- }
-
- return theStatus;
-}
-
-//==============================================================================
-/**
- * Load the State (Slides)
- * @param inPresentation presentation written to
- * @return a flag indicating whether or not we successfully loaded the file
- */
-BOOL CUIPParserImpl::LoadStateGraph(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __slideScope(inReader);
-
- BOOL theStatus = true;
-
- SElement *theComponent = NULL;
- const char8_t *theAttribute;
- if (inReader.UnregisteredAtt("component", theAttribute))
- theComponent = GetElement(theAttribute);
- if (theComponent) {
- INT32 theSlideIndex = 0;
- LoadState(inPresentation, theComponent, theSlideIndex, inReader);
-
- for (BOOL theResult = inReader.MoveToFirstChild("State"); theResult;
- theResult = inReader.MoveToNextSibling("State")) {
- if (theStatus)
- theStatus &= LoadState(inPresentation, theComponent, ++theSlideIndex, inReader);
- }
- } else {
- if (theAttribute) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Slide load failure!! Failed to find component: " << theAttribute;
- } else {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Slide load failure!! Failed to find component.";
- }
- }
-
- return theStatus;
-}
-
-//==============================================================================
-/**
- * Load the State (Slides)
- * @param inPresentation presentation written to
- * @return a flag indicating whether or not we successfully loaded the file
- */
-BOOL CUIPParserImpl::LoadState(IPresentation &inPresentation, SElement *inComponent,
- INT32 inSlideIndex, qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __stateScope(inReader);
-
- BOOL theResult = true;
- ISlideSystem &theBuilder = inPresentation.GetSlideSystem();
-
- eastl::string theSlideName = GetSlideName(inReader);
-
- qt3ds::runtime::SSlidePlayInformation thePlayMode = GetPlayMode(inReader);
- thePlayMode.m_PlayThroughTo = (QT3DSU8)GetPlayThroughTo(inSlideIndex, inReader);
- // Setup with the default value from the metadata
- INT32 theMinTime = m_MetaData.GetPropertyValueLong(m_MetaData.Register("Asset"),
- m_MetaData.Register("starttime"));
- INT32 theMaxTime = m_MetaData.GetPropertyValueLong(m_MetaData.Register("Asset"),
- m_MetaData.Register("endtime"));
-
- theBuilder.AddSlide(*inComponent, theSlideName.c_str(), thePlayMode.m_PlayMode,
- thePlayMode.m_Paused, thePlayMode.m_PlayThroughTo, theMinTime, theMaxTime);
- m_NumSlides++;
-
- m_SlideElements.clear();
- m_SlideElements.insert(inComponent);
-
- BOOL theActiveFlag = (inSlideIndex != 0);
- theBuilder.AddSlideElement(*inComponent, theActiveFlag);
- ProcessStateRef(inPresentation, inComponent, inSlideIndex == 0, inReader);
-
- m_NumSlideElements++;
-
- theMaxTime = 0;
- theResult &=
- LoadSlideElements(inPresentation, inReader, inSlideIndex == 0, inComponent, &theMaxTime);
- if (theMaxTime != 0)
- theBuilder.SetSlideMaxTime((QT3DSU32)theMaxTime);
-
- return theResult;
-}
-
-//==============================================================================
-/**
- * Process the state information to add all the animations and actions that might be setup
- */
-BOOL CUIPParserImpl::ProcessStateRef(IPresentation &inPresentation, SElement *inComponent,
- bool inMaster, qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __stateScope(inReader);
- eastl::string theSlideId = GetSlideId(inReader);
- for (BOOL theResult = inReader.MoveToFirstChild("Set"); theResult;
- theResult = inReader.MoveToNextSibling("Set")) {
- const char8_t *theElementRef;
- if (inReader.UnregisteredAtt("ref", theElementRef)
- && GetElement(theElementRef) == inComponent)
- ProcessSlideAnimAction(inPresentation, theSlideId, inMaster, inReader);
- }
- return TRUE;
-}
-
-void CUIPParserImpl::ComputeAndReserveMemory(IPresentation & /*inPresentation*/,
- qt3dsdm::IDOMReader &inReader)
-{
- SGraphSectionCount theGraphSectionCount;
- SLogicSectionCount theLogicSectionCount;
- SActionSectionCount theActionSectionCount;
-
- {
- IDOMReader::Scope __graphScope(inReader);
- if (inReader.MoveToFirstChild("Graph"))
- DoGraphSectionCount(inReader, theGraphSectionCount);
- }
- DoLogicSectionCount(inReader, theLogicSectionCount);
- m_ActionHelper->GetActionSectionCount(theActionSectionCount);
-}
-
-void CUIPParserImpl::DoGraphSectionCount(qt3dsdm::IDOMReader &inReader,
- SGraphSectionCount &outGraphCounter)
-{
- IDOMReader::Scope __graphScope(inReader);
-
- for (bool theResult = inReader.MoveToFirstChild(); theResult;
- theResult = inReader.MoveToNextSibling()) {
- const char *theTypeStr(inReader.GetNarrowElementName());
- if (AreEqual(theTypeStr, "Scene") || AreEqual(theTypeStr, "Component"))
- outGraphCounter.m_ComponentCount++;
- else
- outGraphCounter.m_ElementCount++;
-
- const char *theIdStr;
- inReader.Att("id", theIdStr);
- const char *theClassStr;
- inReader.Att("class", theClassStr);
-
- // For Behavior, we are adding a string attribute ATTRIBUTE_BEHAVIORSCRIPTS
- if (AreEqual(theTypeStr, "Behavior") && !IsTrivial(theClassStr)) {
- ++theClassStr; // remove the '#'
- TIdSourcePathMap::iterator theSourcePathIter = m_IdScriptMap.find(theClassStr);
- if (theSourcePathIter != m_IdScriptMap.end()) {
- outGraphCounter.m_AttributeCount++;
- outGraphCounter.m_StringAttrCount++;
- }
- }
- SElementData *theData = m_ParseElementManager.FindElementData(theIdStr);
-
- if (theData) {
- TAttrMap &thePropertyMap = theData->m_PropertyMap;
-
- // TODO: Maybe we should make m_IdAttributesMap only stores those valid attributes and
- // also those attributes that already converted to Runtime type (e.g. position to
- // position.x .y .z )
- // then we can really stop calling all the IsValidAttribute all over the place
- // and we can simple just use the size of the vector here.
- for (TAttrMap::iterator theIter = thePropertyMap.begin(), theEnd = thePropertyMap.end();
- theIter != theEnd; ++theIter) {
- if (theIter->second.m_ElementFlag == false)
- continue;
- TStrType thePropertyName(theIter->first);
- outGraphCounter.m_AttributeCount += theIter->second.m_Arity;
- if (IsStringType(theIter->second.m_DataType))
- outGraphCounter.m_StringAttrCount += 1;
- }
- }
-
- DoGraphSectionCount(inReader, outGraphCounter);
- }
-}
-
-void CUIPParserImpl::DoLogicSectionCount(qt3dsdm::IDOMReader &inReader,
- SLogicSectionCount &outLogicCounter)
-{
- IDOMReader::Scope __logicCountScope(inReader);
-
- if (inReader.MoveToFirstChild("Logic")) {
- for (bool theResult = inReader.MoveToFirstChild("State"); theResult;
- theResult = inReader.MoveToNextSibling("State")) {
- DoStateSectionCount(inReader, 0, outLogicCounter);
- }
- }
-}
-
-void CUIPParserImpl::DoStateSectionCount(qt3dsdm::IDOMReader &inReader, Q3DStudio::INT32 inStateIndex,
- SLogicSectionCount &outLogicCounter)
-{
- IDOMReader::Scope __slideCountScope(inReader);
-
- outLogicCounter.m_SlideCount++;
-
- INT32 theChildSlideCount = inReader.CountChildren("State");
- outLogicCounter.m_SlideElementCount++; // this slide is also an element
- Q3DStudio::INT32 theChildStateIndex(inStateIndex + 1);
-
- for (bool theResult = inReader.MoveToFirstChild(); theResult;
- theResult = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "State")) {
- DoStateSectionCount(inReader, theChildStateIndex, outLogicCounter);
- ++theChildStateIndex;
- } else if (AreEqual(inReader.GetNarrowElementName(), "Add")
- || AreEqual(inReader.GetNarrowElementName(), "Set")) {
- // SlideMultipler is used as follows:
- // For every element, animation or action, the slide is used to turn on/off them
- // Hence, if it is inside master, it will have an entry in the master and all the child
- // slides in the SlideManager ( hence, theChildSlideCount + 1 )
- // if it is local, it will have an entry in the master and it's slide, ( thus 2 )
- // the assumption made here is that State in uip is definitely 2 level, hence if it has
- // no child slides, it is definitely master
- INT32 theSlideMultiplier;
- if (theChildSlideCount == 0)
- theSlideMultiplier = 2;
- else
- theSlideMultiplier = theChildSlideCount + 1;
- DoRefSectionCount(inReader, theSlideMultiplier, inStateIndex, outLogicCounter);
- }
- }
-}
-
-//==============================================================================
-/**
- * @ param inNumSlideMultiplier To know how this is used, see comments on the place
- *where SlideMultipler is calculated
- */
-void CUIPParserImpl::DoRefSectionCount(qt3dsdm::IDOMReader &inReader, INT32 inNumSlideMultiplier,
- INT32, SLogicSectionCount &outLogicCounter)
-{
- IDOMReader::Scope __refCountScope(inReader);
- const char8_t *theElementRef;
- inReader.UnregisteredAtt("ref", theElementRef);
- SElementData *theData(m_ParseElementManager.FindElementData(theElementRef));
- if (theData == NULL) {
- QT3DS_ASSERT(false);
- return;
- }
-
- if (AreEqual(inReader.GetNarrowElementName(), "Add"))
- outLogicCounter.m_SlideElementCount += inNumSlideMultiplier;
-
- // There are cases where some attributes only appear in the local slide element, but not at the
- // master slide. e.g. endTime.
- // For these attributes, we must make sure that it is added to the slide element attribute of
- // the master, so that everything will work correctly.
- // This is done via the slide force flag on the element property object.
- for (TAttrMap::iterator theIter = theData->m_PropertyMap.begin(),
- theEnd = theData->m_PropertyMap.end();
- theIter != theEnd; ++theIter) {
- const char8_t *theAttValue = "";
- bool hasAtt = inReader.UnregisteredAtt(theIter->first.c_str(), theAttValue);
- if (theIter->second.m_SlideFlag == true
- && (theIter->second.m_SlideForceFlag == true || hasAtt == true)) {
- outLogicCounter.m_SlideAttributeCount += theIter->second.m_Arity * inNumSlideMultiplier;
- }
- // Strings we may still load regardless
- if (hasAtt && IsStringType(theIter->second.m_DataType))
- outLogicCounter.m_StringAttrCount += 1;
- }
- // Always add padding for now till I can figure out exactly why padding is needed
- // and find a minimal way to handle it.
- outLogicCounter.m_PaddingCount += inNumSlideMultiplier;
-}
-
-qt3ds::runtime::SSlidePlayInformation CUIPParserImpl::GetPlayMode(qt3dsdm::IDOMReader &inReader)
-{
- using qt3ds::runtime::PlayMode;
-
- qt3ds::runtime::SSlidePlayInformation thePlayInformation;
- // Setup with the default value from the metadata
- eastl::string thePlayMode = m_MetaData.GetPropertyValueString(m_MetaData.Register("Slide"),
- m_MetaData.Register("playmode"));
- PlayMode::Enum theMode = PlayMode::StopAtEnd;
-
- if (thePlayMode == "Looping") {
- theMode = PlayMode::Looping;
- } else if (thePlayMode == "PingPong") {
- theMode = PlayMode::PingPong;
- } else if (thePlayMode == "Ping") {
- theMode = PlayMode::Ping;
- } else if (thePlayMode == "Play Through To...") {
- theMode = PlayMode::PlayThroughTo;
- }
- thePlayInformation.m_PlayMode = theMode;
-
- eastl::string theInitialPlayState = m_MetaData.GetPropertyValueString(
- m_MetaData.Register("Slide"), m_MetaData.Register("initialplaystate"));
- if (theInitialPlayState == "Pause")
- thePlayInformation.m_Paused = true;
-
- const char *theAttribute;
- if (inReader.Att("playmode", theAttribute)) {
- if (AreEqual(theAttribute, "Play Through To...")) {
- thePlayInformation.m_PlayMode = PlayMode::PlayThroughTo;
- } else if (AreEqual(theAttribute, "Stop at end")) {
- thePlayInformation.m_PlayMode = PlayMode::StopAtEnd;
- } else if (AreEqual(theAttribute, "Looping")) {
- thePlayInformation.m_PlayMode = PlayMode::Looping;
- } else if (AreEqual(theAttribute, "PingPong")) {
- thePlayInformation.m_PlayMode = PlayMode::PingPong;
- } else if (AreEqual(theAttribute, "Ping")) {
- thePlayInformation.m_PlayMode = PlayMode::Ping;
- }
- }
-
- if (inReader.Att("initialplaystate", theAttribute)) {
- if (AreEqual(theAttribute, "Play"))
- thePlayInformation.m_Paused = false;
- else
- thePlayInformation.m_Paused = true;
- }
-
- return thePlayInformation;
-}
-
-INT32 CUIPParserImpl::GetPlayThroughTo(INT32 inCurrentSlideIndex, qt3dsdm::IDOMReader &inReader)
-{
- // Just hardcode it to Next since we know from the metadata the default is Next.
- // If we want to query from MetaData, need to write accessor to get back SStringOrInt
- INT32 thePlayThroughTo = inCurrentSlideIndex + 1;
-
- const char *theAttribute;
- if (inReader.Att("playthroughto", theAttribute) && *theAttribute) {
- if (AreEqual(theAttribute, "Previous"))
- thePlayThroughTo = inCurrentSlideIndex - 1;
- else if (AreEqual(theAttribute, "Next"))
- thePlayThroughTo = inCurrentSlideIndex + 1;
- else if (theAttribute[0] == '#') {
- theAttribute++;
- SParseSlide *theSlide = m_ParseSlideManager.FindSlide(theAttribute);
- if (theSlide)
- thePlayThroughTo = theSlide->m_SlideIndex;
- else
- Q_ASSERT(!"Slide Not Found");
- }
- }
-
- return thePlayThroughTo;
-}
-
-eastl::string CUIPParserImpl::GetSlideName(qt3dsdm::IDOMReader &inReader)
-{
- eastl::string theSlideName;
- if (!inReader.Att("name", theSlideName))
- inReader.Att("id", theSlideName);
- return theSlideName;
-}
-
-eastl::string CUIPParserImpl::GetSlideId(qt3dsdm::IDOMReader &inReader)
-{
- eastl::string theSlideId;
- if (!inReader.Att("id", theSlideId))
- inReader.Att("component", theSlideId);
- return theSlideId;
-}
-
-// In the event we added something to the slide, we return the element data.
-SElementData *CUIPParserImpl::AddSlideElement(IPresentation &inPresentation, bool inMaster,
- qt3dsdm::IDOMReader &inReader, INT32 *outMaxTime)
-{
- ISlideSystem &theBuilder = inPresentation.GetSlideSystem();
-
- SElementData *theElementData = NULL;
- const char8_t *theElementRef = "";
- if (inReader.UnregisteredAtt("ref", theElementRef))
- theElementData = m_ParseElementManager.FindElementData(theElementRef);
-
- SElement *theElement = theElementData ? theElementData->m_Element : NULL;
- if (theElement) {
- if (m_SlideElements.find(theElement) == m_SlideElements.end()) {
- const char *theEyeball;
- bool theActiveFlag = !(
- inMaster || (inReader.Att("eyeball", theEyeball) && AreEqual(theEyeball, "False")));
-
- m_SlideElements.insert(theElement);
- theBuilder.AddSlideElement(*theElement, theActiveFlag);
- m_NumSlideElements++;
- if (outMaxTime) {
- INT32 theElementMaxTime = 0;
- SElement *theParent = theElement->GetParent();
- if (theParent && theParent->IsComponent() && theElement) {
- // Ignore material durations (in practice this is always a material container)
- qt3dsdm::ComposerObjectTypes::Enum composerType(
- qt3dsdm::ComposerObjectTypes::Convert(theElementData->m_Type.c_str()));
- if (composerType != qt3dsdm::ComposerObjectTypes::Material
- && inReader.Att("endtime", theElementMaxTime) == false) {
- theElementMaxTime = m_MetaData.GetPropertyValueLong(
- theElementData->m_Type, m_MetaData.Register("endtime"),
- theElementData->m_Class);
- }
- *outMaxTime = NVMax(*outMaxTime, theElementMaxTime);
- }
- }
- } else
- theElementData = NULL;
- }
-
- return theElementData;
-}
-
-BOOL CUIPParserImpl::LoadSlideElements(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader,
- bool inMaster, SElement *inComponent, INT32 *outMaxTime)
-{
- BOOL theSuccess = true;
-
- {
- IDOMReader::Scope __childScope(inReader);
- eastl::string theSlideId = GetSlideId(inReader);
- eastl::string theActionIdStr;
- // Setup the add/set commands for this slide.
- {
- IDOMReader::Scope __slideScope(inReader);
- // Load all the animations for this slide right now:
-
- SParseSlide *theSlide = m_ParseSlideManager.FindSlide(theSlideId.c_str());
- // All animations and actions added to the master slide are deactivated.
- QT3DSU32 animActions = 0;
- if (theSlide) {
- bool canActivateFlag = !inMaster;
- ISlideSystem &theBuilder = inPresentation.GetSlideSystem();
- for (TInstanceIdAnimationMap::iterator
- theInstAnimIter = theSlide->m_Animations.begin(),
- theInstAnimEnd = theSlide->m_Animations.end();
- theInstAnimIter != theInstAnimEnd; ++theInstAnimIter) {
- const TAnimationList &theAnimList(theInstAnimIter->second);
- for (QT3DSU32 theAnimIdx = 0, theAnimEnd = theAnimList.size();
- theAnimIdx < theAnimEnd; ++theAnimIdx) {
- theBuilder.AddSlideAnimAction(
- true, theAnimList[theAnimIdx].m_Animation->m_AnimationIndex,
- theAnimList[theAnimIdx].m_Active && canActivateFlag);
- ++animActions;
- }
- }
- // Build the actions for this slide.
- for (TActionList::iterator theActionIter = theSlide->m_ActionList.begin(),
- theActionEnd = theSlide->m_ActionList.end();
- theActionIter != theActionEnd; ++theActionIter) {
- SParseSlideActionEntry &theActionEntry(*theActionIter);
- theActionIdStr.assign(theActionEntry.m_ActionId.c_str());
- qt3ds::QT3DSI32 theActionIndex = m_ActionHelper->GetActionIndex(theActionIdStr);
- for (qt3ds::QT3DSI32 idx = 0; idx < theActionEntry.m_ActionCount; ++idx) {
- qt3ds::runtime::SSlideAnimAction *theSlideData =
- theBuilder.AddSlideAnimAction(false, theActionIndex + idx,
- theActionEntry.m_Active
- && canActivateFlag);
- theActionEntry.m_Actions[idx] = theSlideData;
- ++animActions;
- }
- }
-
- // qt3ds::NVFoundationBase& fnd(
- // inPresentation.GetApplication().GetRuntimeFactory().GetFoundation() );
- // fnd.error( QT3DS_TRACE, "Loading slide %s, %d anim actions", theSlideId.c_str(),
- // animActions );
- }
- for (BOOL theResult = inReader.MoveToFirstChild(); theResult;
- theResult = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "Add")
- || AreEqual(inReader.GetNarrowElementName(), "Set")) {
- SElementData *theAddedElement =
- AddSlideElement(inPresentation, inMaster, inReader, outMaxTime);
- if (theAddedElement && theAddedElement->m_Element) {
- LoadSlideElementAttrs(inPresentation, inMaster, *theAddedElement, inReader,
- inComponent);
- // This can define actions or set the active
- ProcessSlideAnimAction(inPresentation, theSlideId, inMaster, inReader);
- }
- }
- }
- }
- // Pull add commands from child slides into master slide with active=false
- // else things won't get reset when we switch slides.
- {
- // All child state adds go into this object with active set to false
- IDOMReader::Scope __masterScope(inReader);
- for (BOOL theResult = inReader.MoveToFirstChild("State"); theResult;
- theResult = inReader.MoveToNextSibling("State")) {
- IDOMReader::Scope __childScope(inReader);
- for (BOOL theResult = inReader.MoveToFirstChild("Add"); theResult;
- theResult = inReader.MoveToNextSibling("Add")) {
- // Add the slide element, setting the active flag to false.
- AddSlideElement(inPresentation, inMaster, inReader, outMaxTime);
- }
- }
- }
- // Pull add commands from master slide for objects in this slide.
- // We do this after we process the add/set commands for this slide so that objects already
- // added
- // get ignored. If we do pull an object forward then we have to set all of the force-set
- // properties as well
- // as account for a possible end-time difference.
- {
- IDOMReader::Scope __childScope(inReader);
- inReader.Leave();
- if (AreEqual(inReader.GetNarrowElementName(), "State")) {
- TPropertyDescAndValueList theProperties;
- for (BOOL theResult = inReader.MoveToFirstChild("Add"); theResult;
- theResult = inReader.MoveToNextSibling("Add")) {
- theProperties.clear();
- SElementData *theData =
- AddSlideElement(inPresentation, inMaster, inReader, NULL);
- if (theData) {
- // Add all forced attributes to this slide.
- for (TAttrMap::iterator theIter = theData->m_PropertyMap.begin(),
- theEnd = theData->m_PropertyMap.end();
- theIter != theEnd; ++theIter) {
- if (theIter->second.m_SlideForceFlag) {
- GetMetaAttribute(inPresentation, theProperties, theData->m_Type,
- theIter->first, theData->m_Class,
- theIter->second.m_PropertyNames);
- }
- }
- ISlideSystem &theBuilder = inPresentation.GetSlideSystem();
- for (TPropertyDescAndValueList::iterator theIter = theProperties.begin();
- theIter != theProperties.end(); ++theIter) {
- theBuilder.AddSlideAttribute(theIter->first.GetAttributeKey(),
- theIter->second);
- m_NumSlideAttributes++;
- }
-
- // Ensure the actual end time is accounted for.
- if (outMaxTime && theData->m_Element) {
- SElement *theParent = theData->m_Element->GetParent();
- if (theParent && theParent->IsComponent()) {
- // Ignore material durations
- // (in practice this is always a material container)
- qt3dsdm::ComposerObjectTypes::Enum composerType(
- qt3dsdm::ComposerObjectTypes::Convert(theData->m_Type.c_str()));
- if (composerType != qt3dsdm::ComposerObjectTypes::Material) {
- long theoutMaxTime = (long)*outMaxTime;
- long theMaxTime = m_MetaData.GetPropertyValueLong(
- theData->m_Type, m_MetaData.Register("endtime"),
- theData->m_Class);
- *outMaxTime = NVMax(theoutMaxTime, theMaxTime);
- }
- }
- }
- }
- }
- }
- }
- }
- return theSuccess;
-}
-
-BOOL CUIPParserImpl::LoadSlideElementAttrs(IPresentation &inPresentation, bool,
- SElementData &inElementData, qt3dsdm::IDOMReader &inReader,
- SElement *inComponent)
-{
- ISlideSystem &theBuilder = inPresentation.GetSlideSystem();
-
- TPropertyDescAndValueList theAttributeList;
-
- const char8_t *theRef = "";
- inReader.Att("ref", theRef);
- if (theRef && *theRef && theRef[0] == '#')
- ++theRef;
- bool isSet = AreEqual(inReader.GetNarrowElementName(), "Set");
- const char8_t *sourcepath;
- if (inReader.UnregisteredAtt("sourcepath", sourcepath)) {
- AddSourcePath(sourcepath);
- theBuilder.AddSourcePath(sourcepath);
- m_slideSourcePaths.push_back(QString::fromLatin1(sourcepath));
- }
-
- // We don't force set attributes when a given component has a set command within one of its
- // child states. This happens in the case of actions (but nothing else).
- bool shouldForce = inElementData.m_Element != inComponent;
- for (TAttrMap::iterator theIter = inElementData.m_PropertyMap.begin(),
- theEnd = inElementData.m_PropertyMap.end();
- theIter != theEnd; ++theIter) {
- const char8_t *theAttValue = "";
- bool hasAtt = inReader.UnregisteredAtt(theIter->first, theAttValue);
- QT3DSU32 previousListSize = theAttributeList.size();
- if (hasAtt == false) {
- // StartTime and EndTime in Master Slide are useless, so set it to the value in the
- // metadata.
- // if we look at the uip file, if the element doesn't have endTime, it means is 10000ms,
- // and not really the value in the master slide
- // this make it special from other attributes
- if (theIter->second.m_SlideForceFlag && shouldForce)
- GetMetaAttribute(inPresentation, theAttributeList, inElementData.m_Type,
- theIter->first, inElementData.m_Class,
- theIter->second.m_PropertyNames);
- } else {
- // Only use the attribute list from set blocks to set values into the slide, not from
- // add attributes
- // This isn't completely correct
- GetAttributeList(inPresentation, theAttributeList, inElementData.m_Type, theIter->first,
- inElementData.m_Class, theAttValue, theIter->second.m_PropertyNames);
- }
- if (isSet == false && theIter->second.m_SlideForceFlag == false) {
- if (inElementData.m_Element != NULL && theIter->second.m_ElementFlag) {
- for (QT3DSU32 idx = previousListSize, end = theAttributeList.size(); idx < end;
- ++idx) {
- UVariant *theValue = inElementData.m_Element->FindPropertyValue(
- theAttributeList[idx].first.m_Name);
- if (theValue) {
- *theValue = theAttributeList[idx].second;
- }
- }
- }
- theAttributeList.resize(previousListSize);
- }
- }
- for (TPropertyDescAndValueList::iterator theIter = theAttributeList.begin();
- theIter != theAttributeList.end(); ++theIter) {
- theBuilder.AddSlideAttribute(theIter->first.GetAttributeKey(), theIter->second);
- m_NumSlideAttributes++;
- }
-
- return TRUE;
-}
-
-void CUIPParserImpl::LoadAnimationTrack(IPresentation &inPresentation, SElementData &inElementData,
- SParseSlideAnimationEntry &inAnimation)
-{
- SElementPropertyInfo *theInfo =
- m_ParseElementManager.FindProperty(inElementData, inAnimation.m_PropertyName);
- if (theInfo == NULL)
- return;
- UINT32 theHashedKey = inAnimation.m_PropertyHash;
- bool theIsDynamic = inAnimation.m_IsDynamic;
- INT32 theIndex = inPresentation.GetAnimationSystem().CreateAnimationTrack(
- *inElementData.m_Element, theHashedKey, theIsDynamic);
- inAnimation.m_AnimationIndex = theIndex;
- m_NumAnimationTracks++;
- bool isRotation = theInfo->m_AdditionalType == ERuntimeAdditionalMetaDataTypeRotation;
- LoadAnimationKeys(inPresentation, inAnimation, isRotation);
-}
-
-void CUIPParserImpl::LoadAnimationKeys(IPresentation &inPresentation,
- const SParseSlideAnimationEntry &inAnimation,
- bool inIsRotation)
-{
-
- NVConstDataRef<qt3ds::QT3DSF32> theFloatValues(inAnimation.m_KeyframeData.data(),
- (qt3ds::QT3DSU32)inAnimation.m_KeyframeData.size());
- switch (inAnimation.m_AnimationType) {
- case SParseSlideAnimationTypes::Linear:
- LoadLinearKeys(inPresentation, theFloatValues, inIsRotation);
- break;
- case SParseSlideAnimationTypes::Bezier:
- LoadBezierKeys(inPresentation, theFloatValues, inIsRotation);
- break;
- default:
- QT3DS_ASSERT(false);
- case SParseSlideAnimationTypes::EaseInOut:
- LoadEaseInOutKeys(inPresentation, theFloatValues, inIsRotation);
- break;
- }
-}
-
-BOOL CUIPParserImpl::LoadBezierKeys(IPresentation &inPresentation, NVConstDataRef<float> &inValues,
- bool inIsRotation)
-{
- QT3DS_ASSERT(inValues.size() % 6 == 0);
- if (inValues.size() % 6 != 0)
- return FALSE;
-
- IAnimationSystem &theBuilder = inPresentation.GetAnimationSystem();
-
- float theTime;
- float theValue;
- float theC1Time;
- float theC1Value;
- float theC2Time;
- float theC2Value;
-
- const float *theIter = inValues.begin();
-
- long theNumKeys = inValues.size() / 6;
- QT3DS_ASSERT(theNumKeys > 0);
- for (long theIndex = 0; theIndex < theNumKeys; ++theIndex) {
- theTime = *theIter * 1000.0f;
- ++theIter;
- theValue = *theIter;
- ++theIter;
- ++theIter; // just increment the iterator, C2Time is set below
- ++theIter; // just increment the iterator, C2Value is set below
- theC1Time = *theIter * 1000.0f;
- ++theIter;
- theC1Value = *theIter;
- ++theIter;
-
- if (theIndex == theNumKeys - 1) {
- // Last keyframe
- theC2Time = 0.0f;
- theC2Value = 0.0f;
- } else {
- theC2Time = *(theIter + 2) * 1000.0f; // access the next inTangentTime
- theC2Value = *(theIter + 3); // access the next inTangentValue
- }
-
- if (inIsRotation) {
- TORAD(theValue);
- TORAD(theC1Value);
- TORAD(theC2Value);
- }
-
- theBuilder.AddKey(theTime, theValue, theC1Time, theC1Value, theC2Time, theC2Value);
- m_NumAnimationKeys++;
- }
- return TRUE;
-}
-
-BOOL CUIPParserImpl::LoadLinearKeys(IPresentation &inPresentation, NVConstDataRef<float> &inValues,
- bool inIsRotation)
-{
- QT3DS_ASSERT(inValues.size() % 2 == 0);
- if (inValues.size() % 2 != 0)
- return FALSE;
-
- const float *theIter = inValues.begin();
-
- long theNumKeys = inValues.size() / 2;
- float *theEaseInOutValues = new float[theNumKeys * 4];
- float *theEaseInOutPtr = theEaseInOutValues;
- for (long theKeyIndex = 0; theKeyIndex < theNumKeys; ++theKeyIndex) {
- *theEaseInOutPtr++ = *theIter++;
- *theEaseInOutPtr++ = *theIter++;
- *theEaseInOutPtr++ = 0.0f;
- *theEaseInOutPtr++ = 0.0f;
- }
-
- NVConstDataRef<float> theFloatValues =
- NVConstDataRef<float>(theEaseInOutValues, theNumKeys * 4);
- BOOL theStatus = LoadEaseInOutKeys(inPresentation, theFloatValues, inIsRotation);
-
- delete[] theEaseInOutValues;
-
- return theStatus;
-}
-
-CUIPParserImpl::SEaseInEaseOutKeyframe CUIPParserImpl::ParseEaseInOutKey(const float *&inFloatIter)
-{
- CUIPParserImpl::SEaseInEaseOutKeyframe theKeyframe;
- theKeyframe.m_Time = *inFloatIter;
- ++inFloatIter;
- theKeyframe.m_Value = *inFloatIter;
- ++inFloatIter;
- theKeyframe.m_EaseIn = *inFloatIter;
- ++inFloatIter;
- theKeyframe.m_EaseOut = *inFloatIter;
- ++inFloatIter;
- return theKeyframe;
-}
-
-BOOL CUIPParserImpl::LoadEaseInOutKeys(IPresentation &inPresentation,
- NVConstDataRef<float> &inValues, bool inIsRotation)
-{
- QT3DS_ASSERT(inValues.size() % 4 == 0);
- if (inValues.size() % 4 != 0)
- return FALSE;
-
- long theNumKeys = inValues.size() / 4;
-
- float *theBezierValues = new float[theNumKeys * 6];
- float *theBezierPtr = theBezierValues;
-
- SEaseInEaseOutKeyframe thePreviousKeyframe;
- thePreviousKeyframe.m_Value = 0.0f;
- SEaseInEaseOutKeyframe theCurrentKeyframe;
- theCurrentKeyframe.m_Value = 0.0f;
- SEaseInEaseOutKeyframe theNextKeyframe;
- theNextKeyframe.m_Value = 0.0f;
-
- const float *theIter = inValues.begin();
-
- if (theNumKeys > 0) {
- theCurrentKeyframe = ParseEaseInOutKey(theIter);
- float *theNextValuePtr = NULL;
- float theNextValue;
-
- if (theNumKeys > 1) {
- theNextKeyframe = ParseEaseInOutKey(theIter);
- theNextValue = theNextKeyframe.m_Value;
- theNextValuePtr = &theNextValue;
- }
- CreateBezierKeyframeFromEaseInEaseOutKeyframe(NULL, theCurrentKeyframe, theNextValuePtr,
- theBezierPtr);
- }
-
- for (long theKeyIndex = 1; theKeyIndex < theNumKeys; ++theKeyIndex) {
- thePreviousKeyframe = theCurrentKeyframe;
- theCurrentKeyframe = theNextKeyframe;
-
- float theLastValue = thePreviousKeyframe.m_Value;
- float *theNextValuePtr = NULL;
- float theNextValue;
- if (theKeyIndex + 1 < theNumKeys) {
- theNextKeyframe = ParseEaseInOutKey(theIter);
- theNextValue = theNextKeyframe.m_Value;
- theNextValuePtr = &theNextValue;
- }
- CreateBezierKeyframeFromEaseInEaseOutKeyframe(&theLastValue, theCurrentKeyframe,
- theNextValuePtr, theBezierPtr);
- }
-
- NVConstDataRef<float> theFloatValues = NVConstDataRef<float>(theBezierValues, theNumKeys * 6);
- BOOL theStatus = LoadBezierKeys(inPresentation, theFloatValues, inIsRotation);
-
- delete[] theBezierValues;
- return theStatus;
-}
-
-inline float AnimationClamp(float inLowerBound, float inUpperBound, float inValue)
-{
- if (inValue < inLowerBound)
- return inLowerBound;
- if (inValue > inUpperBound)
- return inUpperBound;
- return inValue;
-}
-
-void CUIPParserImpl::CreateBezierKeyframeFromEaseInEaseOutKeyframe(
- float *inPreviousValue, SEaseInEaseOutKeyframe &inCurrent, float *inNextValue,
- float *&outBezierValues)
-{
- float theValue = inCurrent.m_Value;
- float theSeconds = inCurrent.m_Time;
- float inSeconds = 0.f;
- float inValue = 0.f;
- float outSeconds = 0.f;
- float outValue = 0.f;
- const double oneThird = 1.0 / 3.0;
- if (inPreviousValue) {
- float thePercent = 1.0f - AnimationClamp(0.0f, 1.0f, inCurrent.m_EaseIn / 100.f);
- double theAmount = 1.0f - thePercent * oneThird;
- inValue = *inPreviousValue + (float)(((inCurrent.m_Value - *inPreviousValue) * theAmount));
- }
- if (inNextValue) {
- float thePercent = 1.0f - AnimationClamp(0.0f, 1.0f, inCurrent.m_EaseOut / 100.f);
- double theAmount = thePercent * oneThird;
- outValue = (float)(inCurrent.m_Value + ((*inNextValue - inCurrent.m_Value) * theAmount));
- }
-
- *outBezierValues++ = theSeconds;
- *outBezierValues++ = theValue;
- *outBezierValues++ = inSeconds;
- *outBezierValues++ = inValue;
- *outBezierValues++ = outSeconds;
- *outBezierValues++ = outValue;
-}
-
-BOOL CUIPParserImpl::ProcessSlideAnimAction(IPresentation &inPresentation, eastl::string &inSlideId,
- bool inMaster, qt3dsdm::IDOMReader &inReader)
-{
- IDOMReader::Scope __animationScope(inReader);
-
- BOOL theStatus = true;
-
- for (BOOL theResult = inReader.MoveToFirstChild("Action"); theResult;
- theResult = inReader.MoveToNextSibling("Action")) {
- // Get the active flag
- const char *theEyeball;
- bool theActiveFlag =
- !(inMaster || (inReader.Att("eyeball", theEyeball) && AreEqual(theEyeball, "False")));
- theStatus &= AddSlideAction(inPresentation, inSlideId, theActiveFlag, inReader);
- }
-
- return theStatus;
-}
-
-BOOL CUIPParserImpl::AddSlideAction(IPresentation &, eastl::string &inSlideId, bool inActive,
- qt3dsdm::IDOMReader &inReader)
-{
- SParseSlide *theSlide = m_ParseSlideManager.FindSlide(inSlideId.c_str());
- if (theSlide == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
-
- // Get the Action id
- const char *theRef;
- if (inReader.Att("ref", theRef)) {
- theRef++; // remove the '#'
- SParseSlideActionEntry *theEntry = m_ParseSlideManager.FindAction(*theSlide, theRef);
- if (theEntry == NULL) {
- QT3DS_ASSERT(false);
- return false;
- }
- for (qt3ds::QT3DSI32 actIdx = 0; actIdx < theEntry->m_ActionCount; ++actIdx) {
- if (theEntry->m_Actions[actIdx])
- theEntry->m_Actions[actIdx]->m_Active = inActive ? 1 : 0;
- }
- } else {
- const char8_t *theActionId;
- inReader.Att("id", theActionId);
- SParseSlideActionEntry *theEntry = m_ParseSlideManager.FindAction(*theSlide, theActionId);
- QT3DS_ASSERT(theEntry);
- // Check to ensure this action was created.
- (void)theEntry;
- }
-
- return TRUE;
-}
-
-bool CUIPParserImpl::IsStringType(ERuntimeDataModelDataType inDataType)
-{
- if (inDataType == ERuntimeDataModelDataTypeStringRef
- || inDataType == ERuntimeDataModelDataTypeString
- || inDataType == ERuntimeDataModelDataTypeObjectRef)
- return true;
- return false;
-}
-
-SElementData *CUIPParserImpl::GetElementData(TStrType inElementName)
-{
- return m_ParseElementManager.FindElementData(inElementName);
-}
-
-//==============================================================================
-/**
- * Helper function to to get the SElement object from the element name
- */
-SElementData *CUIPParserImpl::GetElementData(const char8_t *inElementName)
-{
- const char8_t *theElementName(inElementName);
- if (!IsTrivial(inElementName) && inElementName[0] == '#')
- ++theElementName;
- return GetElementData(m_MetaData.Register(theElementName));
-}
-
-SElement *CUIPParserImpl::GetElement(const char8_t *inElementName)
-{
- SElementData *theData(GetElementData(inElementName));
- if (theData)
- return theData->m_Element;
- return NULL;
-}
-
-SElementData *CUIPParserImpl::ParseObjectRef(const eastl::string &inObjectPath,
- const char8_t *inOwnerId)
-{
- TStrType theId(ParseObjectRefId(inObjectPath, inOwnerId));
- return GetElementData(theId);
-}
-
-TStrType CUIPParserImpl::ParseObjectRefId(const eastl::string &inObjectPath,
- const char8_t *inOwnerId)
-{
- return m_ObjectRefHelper->ParseObjectRefId(inObjectPath, inOwnerId);
-}
-
-SElementAndType CUIPParserImpl::GetElementForID(const char *inElementName)
-{
- SElementData *theData = m_ParseElementManager.FindElementData(inElementName);
- if (theData == NULL)
- return SElementAndType(UIPElementTypes::Unknown, NULL);
-
- qt3dsdm::ComposerObjectTypes::Enum theComposerType(
- qt3dsdm::ComposerObjectTypes::Convert(theData->m_Type.c_str()));
- UIPElementTypes::Enum theUIPType(UIPElementTypes::Unknown);
- switch (theComposerType) {
- case qt3dsdm::ComposerObjectTypes::Scene:
- theUIPType = UIPElementTypes::Scene;
- break;
- case qt3dsdm::ComposerObjectTypes::Layer:
- theUIPType = UIPElementTypes::Layer;
- break;
- case qt3dsdm::ComposerObjectTypes::Group:
- theUIPType = UIPElementTypes::Group;
- break;
- case qt3dsdm::ComposerObjectTypes::Component:
- theUIPType = UIPElementTypes::Component;
- break;
- case qt3dsdm::ComposerObjectTypes::Camera:
- theUIPType = UIPElementTypes::Camera;
- break;
- case qt3dsdm::ComposerObjectTypes::Light:
- theUIPType = UIPElementTypes::Light;
- break;
- case qt3dsdm::ComposerObjectTypes::Model:
- theUIPType = UIPElementTypes::Model;
- break;
- case qt3dsdm::ComposerObjectTypes::Material:
- theUIPType = UIPElementTypes::Material;
- break;
- case qt3dsdm::ComposerObjectTypes::Image:
- theUIPType = UIPElementTypes::Image;
- break;
- case qt3dsdm::ComposerObjectTypes::Behavior:
- theUIPType = UIPElementTypes::Behavior;
- break;
- case qt3dsdm::ComposerObjectTypes::Text:
- theUIPType = UIPElementTypes::Text;
- break;
- case qt3dsdm::ComposerObjectTypes::Effect:
- theUIPType = UIPElementTypes::Effect;
- break;
- case qt3dsdm::ComposerObjectTypes::CustomMaterial:
- theUIPType = UIPElementTypes::CustomMaterial;
- break;
- case qt3dsdm::ComposerObjectTypes::ReferencedMaterial:
- theUIPType = UIPElementTypes::ReferencedMaterial;
- break;
- case qt3dsdm::ComposerObjectTypes::RenderPlugin:
- theUIPType = UIPElementTypes::RenderPlugin;
- break;
- case qt3dsdm::ComposerObjectTypes::Path:
- theUIPType = UIPElementTypes::Path;
- break;
- case qt3dsdm::ComposerObjectTypes::PathAnchorPoint:
- theUIPType = UIPElementTypes::PathAnchorPoint;
- break;
- case qt3dsdm::ComposerObjectTypes::SubPath:
- theUIPType = UIPElementTypes::PathSubPath;
- break;
- default:
- QT3DS_ASSERT(false);
- break;
- }
- return SElementAndType(theUIPType, theData->m_Element);
-}
-
-eastl::string CUIPParserImpl::ResolveReference(const char *inStringId, const char *inReference)
-{
- SElementData *theData = ParseObjectRef(inReference, inStringId);
- if (theData) {
- return theData->m_Id.c_str();
- }
- return eastl::string();
-}
-
-IRuntimeMetaData &CUIPParserImpl::GetMetaData()
-{
- return m_MetaData;
-}
-
-IUIPParser &IUIPParser::Create(const QString &inFileName, IRuntimeMetaData &inMetaData,
- IInputStreamFactory &inFactory,
- qt3ds::foundation::IStringTable &inStrTable)
-{
- CUIPParserImpl &retval = *new CUIPParserImpl(inFileName, inMetaData, inFactory, inStrTable);
- return retval;
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.h b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.h
deleted file mode 100644
index 585dd857..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserImpl.h
+++ /dev/null
@@ -1,672 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-/*
-This is the main file responsible for conversion from the uip format into the runtime's data format.
-The runtime works in a sort of global space so any object, be it an animation, action or element,
-once
-activated stays activated. Furthermore it is important that the runtime declare and set the fewest
-number
-of properties possible to still get the right answer. In order to achieve this the runtime relies
-on the
-rendering system to have the initial state of the entire scene graph, including state that is only
-"Add"
-commands declared in slides.
-
-Given that you understand master slide/ slide distinction, an accurate description would be to do
-this:
-1. Move all parse objects (actions, animations, elements) to be master objects and deactivate them.
-2. Running through the list of nonmaster slides, activate the objects on those slides that would be
-activated.
-3. Now remove properties that are both unreferenced and applied 1 or fewer times.
-
-
-The parsing system does this in reverse order so the passes look like:
-1. Load meta data information (scripts, effects) to have a complete meta data model.
-1. Build element graph. This is used during attribute lookup
-2. Figure out which attributes will be on the elements in the graph by resolving behavior
-references, action references and
- Animations, and Set command attribute applications.
-
- During this pass we also build the set of actions and animations which will appear on each
-slide. This involves both promoting
- actions/animations that appear on the master slide to child slides and pulling
-animations/actions declared on all child slides
- onto the master slide.
-
-3. Count the objects that we will need. The runtime currently requires fixed object counts that
-can't be exceeded
- thus we have to effectively preallocate all runtime objects.
-
-4. Run through the file again and build the actual runtime datastructures. Actions and animations
-are built from
- an intermediate memory representation but the set commands and element activations are built
-via running through
- the file.
-
-
-Care needs to be taken so the runtime can survive poorly formed or just meaningless uip files.
-Studio is only *one*
-system for producing UIP files, clients are free to use code generates (like ruby scripts and such)
-to build their final
-uip files so we need to be careful that we are as robust as possible and can tolerate gracefully
-some level of incorrect
-uip file data.
-*/
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSUIPParser.h"
-#include "Qt3DSTypes.h"
-#include "Qt3DSMetadata.h"
-#include "Qt3DSRenderInputStreamFactory.h"
-#include "Qt3DSSlideSystem.h"
-#include "Qt3DSDMDataTypes.h"
-#include "foundation/Qt3DSMemoryBuffer.h"
-#include <EASTL/map.h>
-#include <EASTL/set.h>
-#include <EASTL/hash_map.h>
-#include "Qt3DSElementSystem.h"
-#include "Qt3DSSlideSystem.h"
-
-namespace qt3ds {
-namespace render {
- class IRefCountedInputStream;
-}
-}
-
-namespace qt3dsdm {
-class IDOMReader;
-class IDOMWriter;
-}
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Forwards
-//==============================================================================
-class IPresentation;
-class SElementBuilder;
-class CContractBuilder;
-class CAnimationBuilder;
-class CLogicBuilder;
-class CSlideBuilder;
-class IRuntimeMetaData;
-class CUIPParserActionHelper;
-class CUIPParserObjectRefHelper;
-
-typedef eastl::vector<qt3ds::runtime::element::TPropertyDescAndValue> TPropertyDescAndValueList;
-
-using qt3ds::render::IInputStreamFactory;
-using qt3ds::render::IRefCountedInputStream;
-typedef NVScopedRefCounted<IRefCountedInputStream> TInputStreamPtr;
-typedef qt3ds::foundation::CRegisteredString TStrType;
-using qt3ds::runtime::element::SElement;
-
-struct SElementPropertyInfo
-{
- enum Enum {
- MaxArity = 4,
- };
- TStrType m_PropertyName;
- ERuntimeDataModelDataType m_DataType;
- ERuntimeAdditionalMetaDataType m_AdditionalType;
- // Number of sub components of the property, 1-4
- qt3ds::QT3DSU32 m_Arity;
- qt3ds::QT3DSU32 m_PropertyHashes[MaxArity];
- CRegisteredString m_PropertyNames[MaxArity];
- bool m_ElementFlag; // True if this property exists on the element. Some properties do not.
- bool m_SlideFlag; // True if this property exists on the slides at all.
- // starttime,endtime are forced to be on the slides whether they are in the UIP or not.
- bool m_SlideForceFlag; // True if this property is *forced* on the slides whether it needs to be
- // there or not
-
- SElementPropertyInfo(TStrType inPropName)
- : m_PropertyName(inPropName)
- , m_DataType(ERuntimeDataModelDataTypeNone)
- , m_Arity(0)
- , m_ElementFlag(false)
- , m_SlideFlag(false)
- , m_SlideForceFlag(false)
- {
- memZero(m_PropertyHashes, sizeof(m_PropertyHashes));
- }
- bool operator<(const SElementPropertyInfo &inOther) const
- {
- return m_PropertyName < inOther.m_PropertyName;
- }
-};
-
-typedef eastl::hash_map<TStrType, SElementPropertyInfo> TAttrMap;
-
-struct SElementData
-{
- SElement *m_Element;
- TStrType m_Id;
- TStrType m_Type;
- TStrType m_Class;
- TAttrMap m_PropertyMap;
-
- SElementData(TStrType inId)
- : m_Element(NULL)
- , m_Id(inId)
- {
- }
- void SetElement(SElement *inElement, TStrType inType, TStrType inClass)
- {
- m_Element = inElement;
- m_Type = inType;
- m_Class = inClass;
- }
-};
-
-typedef eastl::hash_map<TStrType, SElementData> TIdElementMap;
-
-struct SParseElementManager
-{
- IRuntimeMetaData &m_MetaData;
- TIdElementMap m_ElementMap;
- // Temporary variables for various algorithms
- eastl::string m_Workspace;
- eastl::vector<eastl::string> m_PropertyList;
- qt3ds::foundation::IStringTable &m_StringTable;
-
- SParseElementManager(IRuntimeMetaData &inMetaData, qt3ds::foundation::IStringTable &inStrTable)
- : m_MetaData(inMetaData)
- , m_StringTable(inStrTable)
- {
- }
- TStrType RegisterStr(const char8_t *inStr);
- SElementData &GetOrCreateElementData(const char8_t *inElemIdOrRef, const char8_t *inElemType,
- const char8_t *inElemClassId);
- SElementData *FindElementData(const char8_t *inIdOrRef);
- // We don't allow creation of properties that don't exist in the meta data in the first place.
- SElementPropertyInfo *GetOrCreateProperty(SElementData &inData, const char8_t *inPropertyName);
- SElementPropertyInfo *GetOrCreateProperty(const char8_t *inIdOrRef, const char8_t *inElemType,
- const char8_t *inElemClassId,
- const char8_t *inPropertyName);
- SElementPropertyInfo *FindProperty(SElementData &inElement, const char8_t *inPropertyName);
- SElementPropertyInfo *FindProperty(const char8_t *inIdOrRef, const char8_t *inPropertyName);
- eastl::pair<SElementPropertyInfo *, qt3ds::QT3DSU32>
- FindPropertyWithSubIndex(SElementData &inElement, const char8_t *inPropertyName);
- // Attribute marking stage; mark which attributes will be kept on elements at all.
- void MarkAttributeAsReferenced(SElementData &inElement, const char8_t *inPropertyName);
- void MarkAttributeAsReferenced(const char8_t *inElement, const char8_t *inPropertyName);
- void MarkAllAttributesAsReferenced(SElementData &inElement, bool searchParent = false);
-};
-
-struct SParseSlideActionEntry
-{
- TStrType m_SlideId;
- TStrType m_ActionId;
- qt3ds::QT3DSI32 m_ActionCount;
- bool m_Active;
- qt3ds::runtime::SSlideAnimAction *m_Actions[SElementPropertyInfo::MaxArity];
-
- SParseSlideActionEntry(TStrType inSlideId, TStrType inActionId, qt3ds::QT3DSI32 inActionCount,
- bool inActive)
- : m_SlideId(inSlideId)
- , m_ActionId(inActionId)
- , m_ActionCount(inActionCount)
- , m_Active(inActive)
- {
- memZero(m_Actions, sizeof(m_Actions));
- }
- SParseSlideActionEntry()
- : m_ActionCount(0)
- , m_Active(false)
- {
- }
- // Partial equals, used for finding object in vector.
- bool operator==(const SParseSlideActionEntry &inOther) const
- {
- return m_SlideId == inOther.m_SlideId && m_ActionId == inOther.m_ActionId;
- }
-};
-
-typedef eastl::vector<SParseSlideActionEntry> TActionList;
-
-struct SParseSlideAnimationTypes
-{
- enum Enum {
- NoAnimation = 0,
- Linear,
- EaseInOut,
- Bezier,
- };
-};
-
-struct SParseSlideAnimationEntry
-{
- TStrType m_SlideId;
- TStrType m_InstanceId;
- TStrType m_PropertyName;
- qt3ds::QT3DSU32 m_PropertyHash;
- qt3ds::QT3DSI32 m_AnimationIndex;
- eastl::vector<float> m_KeyframeData;
- SParseSlideAnimationTypes::Enum m_AnimationType;
- bool m_IsDynamic;
-
- SParseSlideAnimationEntry()
- : m_AnimationIndex(-1)
- , m_KeyframeData("")
- , m_AnimationType(SParseSlideAnimationTypes::NoAnimation)
- , m_IsDynamic(false)
- {
- }
- SParseSlideAnimationEntry(TStrType inSlideId, TStrType inInstanceId, TStrType inPropertyName,
- qt3ds::QT3DSU32 inPropHash, SParseSlideAnimationTypes::Enum inAnimType,
- const float *inKeyframeData, qt3ds::QT3DSU32 inNumFloats, bool inIsDynamic)
- : m_SlideId(inSlideId)
- , m_InstanceId(inInstanceId)
- , m_PropertyName(inPropertyName)
- , m_PropertyHash(inPropHash)
- , m_AnimationType(inAnimType)
- , m_IsDynamic(inIsDynamic)
- {
- m_KeyframeData.insert(m_KeyframeData.begin(), inKeyframeData, inKeyframeData + inNumFloats);
- }
-};
-
-struct SParseAnimationRef
-{
- TStrType m_SlideId;
- TStrType m_InstanceId;
- TStrType m_PropertyName;
- bool m_Active;
- const SParseSlideAnimationEntry *m_Animation;
-
- SParseAnimationRef(TStrType inSlideId, TStrType inInstanceId, TStrType inPropName,
- const SParseSlideAnimationEntry *inAnimation, bool inActive)
- : m_SlideId(inSlideId)
- , m_InstanceId(inInstanceId)
- , m_PropertyName(inPropName)
- , m_Active(inActive)
- , m_Animation(inAnimation)
- {
- }
- SParseAnimationRef()
- : m_Active(false)
- , m_Animation(NULL)
- {
- }
- // Partial equals, used for finding object in vector.
- bool operator==(const SParseAnimationRef &inOther) const
- {
- return m_SlideId == inOther.m_SlideId && m_InstanceId == inOther.m_InstanceId
- && m_PropertyName == inOther.m_PropertyName;
- }
-};
-
-typedef eastl::vector<SParseAnimationRef> TAnimationList;
-
-typedef eastl::hash_map<TStrType, TAnimationList> TInstanceIdAnimationMap;
-
-struct SParseSlide
-{
- TStrType m_SlideId;
- qt3ds::QT3DSI32 m_SlideIndex;
- TActionList m_ActionList;
- TInstanceIdAnimationMap m_Animations;
-
- SParseSlide(TStrType inId, qt3ds::QT3DSI32 inSlideIndex)
- : m_SlideId(inId)
- , m_SlideIndex(inSlideIndex)
- {
- }
- SParseSlide() {}
-};
-
-typedef eastl::hash_map<TStrType, SParseSlide> TSlideIdToParseSlideMap;
-
-struct SParseSlideManager
-{
- IRuntimeMetaData &m_MetaData;
- SParseElementManager &m_ElementManager;
- TSlideIdToParseSlideMap m_SlideMap;
- eastl::vector<SParseSlideAnimationEntry *> m_Animations;
- qt3ds::QT3DSI32 m_SlideAnimationCount;
- qt3ds::QT3DSI32 m_AnimationKeyframeCount;
- qt3ds::QT3DSI32 m_ActionCount;
- eastl::vector<qt3ds::QT3DSF32> m_KeyframeParseFloatBuffer;
- eastl::string m_KeyframeParseBuffer;
-
- SParseSlideManager(IRuntimeMetaData &inMD, SParseElementManager &inElemMgr)
- : m_MetaData(inMD)
- , m_ElementManager(inElemMgr)
- , m_SlideAnimationCount(0)
- , m_AnimationKeyframeCount(0)
- , m_ActionCount(0)
- {
- }
- ~SParseSlideManager();
- TStrType RegisterId(const char8_t *inStr);
- TStrType RegisterStr(const char8_t *inStr) { return m_ElementManager.RegisterStr(inStr); }
- SParseSlide &GetOrCreateSlide(const char8_t *inSlideId, qt3ds::QT3DSI32 inSlideIndex);
- SParseSlide *FindSlide(const char8_t *inSlideId);
- // Create an animation and reference that animation
- void SetAnimationData(SParseSlide &inSlide, const char8_t *inInstanceId,
- const char8_t *inPropertyName, const char8_t *inKeyframeData,
- SParseSlideAnimationTypes::Enum inType, bool inIsDynamic,
- bool inIsActive);
- // Reference an animation.
- void ReferenceAnimation(SParseSlide &inSlide, const SParseSlideAnimationEntry &inSource,
- bool inIsActive);
- TAnimationList *GetAnimationsForInstance(SParseSlide &inSlide, const char8_t *inInstanceId);
- SParseSlideActionEntry &GetOrCreateAction(SParseSlide &inSlide, const char8_t *inActionId,
- qt3ds::QT3DSI32 inActionCount, bool inEyeball);
- SParseSlideActionEntry *FindAction(SParseSlide &inSlide, const char8_t *inActionId);
-};
-
-//==============================================================================
-/**
- * @class CUIPParserImpl
- * @brief Class for parsing UIP file
- */
-class CUIPParserImpl : public IUIPParser
-{
-
- typedef eastl::basic_string<char8_t> TNarrowStr;
-
- //==============================================================================
- // Fields
- //==============================================================================
-protected:
- std::shared_ptr<qt3dsdm::IDOMReader> m_DOMReader;
- std::shared_ptr<qt3dsdm::IDOMWriter> m_DOMWriter;
- IRuntimeMetaData &m_MetaData; ///< Reference to Metadata
- IInputStreamFactory &m_InputStreamFactory;
- SParseElementManager m_ParseElementManager; ///< Map of id, SElement*
- SParseSlideManager m_ParseSlideManager;
-
- CUIPParserActionHelper *m_ActionHelper; ///< Action Helper
- CUIPParserObjectRefHelper *m_ObjectRefHelper; ///< Object Reference Helper
-
- typedef eastl::set<SElement *> TAddedSlideElements;
- TAddedSlideElements m_SlideElements; ///< Caching of slide elements added, so that we don't need
- ///to pass this around
-
- typedef eastl::map<eastl::string, eastl::string> TIdSourcePathMap;
- TIdSourcePathMap m_IdScriptMap; ///< Map of the class id and script sourcepath
-
- typedef eastl::map<eastl::string, eastl::string> TIdClassMap;
- TIdClassMap m_IdClassMap; ///< Map of id and class reference
-
- typedef eastl::set<eastl::string> TStringSet;
- typedef eastl::vector<eastl::string> TStringVector;
-
- TStringSet m_SourcePathSet;
- TStringVector m_SourcePathList;
-
- QVector<QString> m_slideSourcePaths;
-
- struct SElementRefCache
- {
- SElementData *m_Element;
- eastl::string m_Name;
- eastl::string m_Value;
- };
- eastl::vector<SElementRefCache> m_ElementRefCache; ///< Cache those element refs in the scene
- ///graph that needs to be patch later
-
- struct SEaseInEaseOutKeyframe
- {
- float m_Time;
- float m_Value;
- float m_EaseIn;
- float m_EaseOut;
- };
-
- struct SGraphSectionCount
- {
- INT32 m_ElementCount;
- INT32 m_ComponentCount;
- INT32 m_AttributeCount;
- INT32 m_StringAttrCount;
-
- SGraphSectionCount()
- : m_ElementCount(0)
- , m_ComponentCount(0)
- , m_AttributeCount(0)
- , m_StringAttrCount(0)
- {
- }
- };
-
- struct SLogicSectionCount
- {
- INT32 m_SlideCount;
- INT32 m_SlideElementCount;
- INT32 m_SlideAttributeCount;
- INT32 m_StringAttrCount;
- INT32 m_PaddingCount;
-
- SLogicSectionCount()
- : m_SlideCount(0)
- , m_SlideElementCount(0)
- , m_SlideAttributeCount(0)
- , m_StringAttrCount(0)
- , m_PaddingCount(0)
- {
- }
- };
-
- struct SActionSectionCount
- {
- INT32 m_TriggerElementCount;
- INT32 m_TriggerEventCount;
- INT32 m_ActionCount;
- INT32 m_StringAttrCount;
- INT32 m_CustomParamCount;
-
- SActionSectionCount()
- : m_TriggerElementCount(0)
- , m_TriggerEventCount(0)
- , m_ActionCount(0)
- , m_StringAttrCount(0)
- , m_CustomParamCount(0)
- {
- }
- };
-
- long m_NumGraphElements; /// eclee testing only, must remove
- long m_NumGraphComponents; /// eclee testing only, must remove
- long m_NumGraphAttributes; /// eclee testing only, must remove
- long m_NumSlides; /// eclee testing only, must remove
- long m_NumSlideElements; /// eclee testing only, must remove
- long m_NumSlideAttributes; /// eclee testing only, must remove
- long m_NumAnimationTracks; /// eclee testing only, must remove
- long m_NumAnimationKeys; /// eclee testing only, must remove
- long m_NumSlideAnimations; /// eclee testing only, must remove
- long m_NumSlideActions; /// klarinda testing only, must remove
-
- // temporarily this is here
- qt3ds::foundation::MemoryBuffer<RawAllocator> m_TempBuffer;
- qt3ds::foundation::MemoryBuffer<RawAllocator> m_ValueBuffer;
-
- IPresentation *m_CurrentPresentation;
-
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CUIPParserImpl(const QString &inFileName, IRuntimeMetaData &inMetaData,
- IInputStreamFactory &inFactory, qt3ds::foundation::IStringTable &inStringTable);
- virtual ~CUIPParserImpl();
-
-public: // Parse UIP file
- BOOL Load(IPresentation &inPresentation,
- NVConstDataRef<SElementAttributeReference> inStateReferences) override;
- qt3dsdm::IDOMReader &GetDOMReader() override;
- IRuntimeMetaData &GetMetaData() override;
- SElementAndType GetElementForID(const char *inStringId) override;
- eastl::string ResolveReference(const char *inStringId, const char *inReferance) override;
- NVConstDataRef<eastl::string> GetSourcePaths() const override
- {
- return NVConstDataRef<eastl::string>(m_SourcePathList.data(), m_SourcePathList.size());
- }
- QVector<QString> GetSlideSourcePaths() const override
- {
- return m_slideSourcePaths;
- }
-
-protected: // Operation
- BOOL LoadProjectSettings(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader);
- BOOL LoadClasses(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader);
- BOOL LoadGraph(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader);
- BOOL LoadSceneGraph(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader,
- qt3ds::runtime::element::SElement *inNewStyleParent = NULL);
- BOOL LoadLogic(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader);
- BOOL LoadStateGraph(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader);
-
-protected: // Memory Counter
- void ComputeAndReserveMemory(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader);
- void DoGraphSectionCount(qt3dsdm::IDOMReader &inReader, SGraphSectionCount &outGraphCounter);
- void DoLogicSectionCount(qt3dsdm::IDOMReader &inReader, SLogicSectionCount &outLogicCounter);
- void DoStateSectionCount(qt3dsdm::IDOMReader &inReader, INT32 inSlideIndex,
- SLogicSectionCount &outLogicCounter);
- void DoRefSectionCount(qt3dsdm::IDOMReader &inReader, INT32 inNumSlideMultiplier,
- INT32 inSlideIndex, SLogicSectionCount &outLogicCounter);
-
-protected: // Scene graph heler
- void CacheGraphRequiredAttributes(qt3dsdm::IDOMReader &inReader);
- BOOL CacheLogicRequiredAttributes(qt3dsdm::IDOMReader &inReader, qt3ds::QT3DSI32 inSlideIndex = 0,
- SParseSlide *inParentSlide = NULL);
- void CacheClassRequiredAttributes(qt3dsdm::IDOMReader &inReader);
- void CacheClassSceneAttributes(qt3dsdm::IDOMReader &inReader);
- void CacheClassStateAttributes(qt3dsdm::IDOMReader &inReader);
- void AddElementRefToPatch(TPropertyDescAndValueList &outDescList, SElementData &inElement,
- const char *inName, const char *inValue);
- void PatchSceneElementRef();
-
-protected: // Slide helper
- BOOL LoadState(IPresentation &inPresentation, SElement *inComponent, INT32 inSlideIndex,
- qt3dsdm::IDOMReader &inReader);
- qt3ds::runtime::SSlidePlayInformation GetPlayMode(qt3dsdm::IDOMReader &inReader);
- INT32 GetPlayThroughTo(INT32 inCurrentSlideIndex, qt3dsdm::IDOMReader &inReader);
- eastl::string GetSlideName(qt3dsdm::IDOMReader &inReader);
- eastl::string GetSlideId(qt3dsdm::IDOMReader &inReader);
- BOOL LoadSlideElements(IPresentation &inPresentation, qt3dsdm::IDOMReader &inReader,
- bool inMaster, SElement *inComponent, INT32 *outMaxTime = NULL);
- SElementData *AddSlideElement(IPresentation &inPresentation, bool inMaster,
- qt3dsdm::IDOMReader &inReader, INT32 *outMaxTime = NULL);
- BOOL LoadSlideElementAttrs(IPresentation &inPresentation, bool inMaster,
- SElementData &inElementData, qt3dsdm::IDOMReader &inReader,
- SElement *inComponent);
- BOOL ProcessStateRef(IPresentation &inPresentation, SElement *inComponent, bool inMaster,
- qt3dsdm::IDOMReader &inReader);
-
-protected: // Animation helper
- void LoadAnimationTrack(IPresentation &inPresentation, SElementData &inElementData,
- SParseSlideAnimationEntry &inAnimation);
- void LoadAnimationKeys(IPresentation &inPresentation,
- const SParseSlideAnimationEntry &inAnimation, bool inIsRotation);
- BOOL LoadBezierKeys(IPresentation &inPresentation, NVConstDataRef<float> &inValues,
- bool inIsRotation);
- BOOL LoadLinearKeys(IPresentation &inPresentation, NVConstDataRef<float> &inValues,
- bool inIsRotation);
- BOOL LoadEaseInOutKeys(IPresentation &inPresentation, NVConstDataRef<float> &inValues,
- bool inIsRotation);
- SEaseInEaseOutKeyframe ParseEaseInOutKey(const float *&inFloatIter);
- BOOL ProcessSlideAnimAction(IPresentation &inPresentation, eastl::string &inSlideId,
- bool inMaster, qt3dsdm::IDOMReader &inReader);
- BOOL AddSlideAction(IPresentation &inPresentation, eastl::string &inSlideId, bool inActive,
- qt3dsdm::IDOMReader &inReader);
- void CreateBezierKeyframeFromEaseInEaseOutKeyframe(float *inPreviousValue,
- SEaseInEaseOutKeyframe &inCurrent,
- float *inNextValue, float *&outBezierValues);
-
-protected: // Helper methods
- bool IsStringType(ERuntimeDataModelDataType inDataType);
- void GetAttributeList(IPresentation &inPresentation, TPropertyDescAndValueList &outDescList,
- TStrType inType, TStrType inName, TStrType inClassId, const char *inValue,
- CRegisteredString *inPropNameStrs);
- void GetAttributeList(IPresentation &inPresentation, TPropertyDescAndValueList &outDescList,
- ERuntimeDataModelDataType inDataType,
- ERuntimeAdditionalMetaDataType inAdditionalType, const char *inName,
- const char *inValue, CRegisteredString *inPropNameStrs);
-
- SElementData *GetElementData(TStrType inElementName);
- SElementData *GetElementData(const char8_t *inElementName);
- SElement *GetElement(const char8_t *inElementName);
- // Returns the data type and a boolean indicating if this attribute is actually used on a
- // particular slide.
- eastl::pair<ERuntimeDataModelDataType, bool>
- GetAttributeType(const char8_t *inElementName, const char8_t *inPropertyName,
- const SElementData &inElementData);
- SElementData *ParseObjectRef(const eastl::string &inObjectPath, const char8_t *inOwnerId);
- TStrType ParseObjectRefId(const eastl::string &inObjectPath, const char8_t *inOwnerId);
-
- void GetMetaAttribute(IPresentation &inPresentation, TPropertyDescAndValueList &outDescList,
- TStrType inType, TStrType inName, TStrType inClassId,
- CRegisteredString *inAttStrNames);
-
-protected:
- void AddFloatAttribute(TPropertyDescAndValueList &outDescList, CRegisteredString inAttStrName,
- float &inValue);
- void AddLongAttribute(TPropertyDescAndValueList &outDescList, CRegisteredString inAttStrName,
- qt3ds::QT3DSI32 &inValue);
- void AddBoolAttribute(TPropertyDescAndValueList &outDescList, CRegisteredString inAttStrName,
- bool &inValue);
- void AddFloat2Attribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString *inAttStrNames, qt3dsdm::SFloat2 &inValue);
- void AddFloat3Attribute(TPropertyDescAndValueList &outDescList,
- ERuntimeAdditionalMetaDataType inAdditionalType,
- CRegisteredString *inAttStrNames, qt3dsdm::SFloat3 &inValue);
- void AddFloat4Attribute(TPropertyDescAndValueList &outDescList,
- ERuntimeAdditionalMetaDataType inAdditionalType,
- CRegisteredString *inAttStrNames, qt3dsdm::SFloat4 &inValue);
- void AddStringAttribute(IPresentation &inPresentation, TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, const char *inValue);
- void AddElementRefAttribute(TPropertyDescAndValueList &outDescList,
- CRegisteredString inAttStrName, SElement *inElement);
-
- void AddSourcePath(const char *inValue)
- {
- if (m_SourcePathSet.find(inValue) == m_SourcePathSet.end()) {
- m_SourcePathSet.insert(inValue);
- m_SourcePathList.push_back(eastl::string(inValue));
- }
- }
-
-public: //
- void release() override { delete this; }
-
- //==============================================================================
- // Friends
- //==============================================================================
- friend class CUIPParserActionHelper;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp
deleted file mode 100644
index 19af2a9d..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp
+++ /dev/null
@@ -1,1005 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "RuntimePrefix.h"
-#ifdef EA_PLATFORM_WINDOWS
-#pragma warning(disable : 4100) // std::variant
-#pragma warning(disable : 4396) // specializer warning nonsense
-#endif
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSUIPParserObjectRefHelper.h"
-
-#include "Qt3DSDMPrefix.h"
-#include "Qt3DSDMXML.h"
-#include "Qt3DSMetadata.h"
-using namespace qt3dsdm;
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-// Constants
-//==============================================================================
-static const char PATH_DELIMITER = '.'; // can only be single char!
-static const char PATH_LINE_END = '\n';
-
-//==============================================================================
-/**
- * Constructor
- */
-CUIPParserObjectRefHelper::CUIPParserObjectRefHelper(IRuntimeMetaData &inMetaData)
- : m_MetaData(inMetaData)
- , m_MaterialStr(m_MetaData.Register("Material"))
-{
- BuildImageNamePropertyList();
-
- if (m_LayerImageIdToNameMap.empty()) {
- {
- TLightProbeAndNamePair theNamePair =
- eastl::make_pair<eastl::string, eastl::string>("Layer_lightprobe", "lightprobe");
- m_LayerImageIdToNameMap.insert(theNamePair);
- }
- {
- TLightProbeAndNamePair theNamePair =
- eastl::make_pair<eastl::string, eastl::string>("Layer_lightprobe2", "lightprobe2");
- m_LayerImageIdToNameMap.insert(theNamePair);
- }
- }
-}
-
-//==============================================================================
-/**
- * Destructor
- */
-CUIPParserObjectRefHelper::~CUIPParserObjectRefHelper()
-{
- // Delete SGraphNode
- for (TGraphNodeMap::iterator theIter = m_GraphNodeMap.begin(); theIter != m_GraphNodeMap.end();
- ++theIter)
- delete theIter->second;
- m_GraphNodeMap.clear();
- m_RootNode = NULL;
-}
-
-namespace {
- void StoreTopLevelAliasAttributes(
- IDOMReader &inReader,
- eastl::vector<eastl::pair<eastl::string, eastl::string>> &copiedAttributes)
- {
- for (eastl::pair<const char8_t *, const char8_t *> att = inReader.GetNarrowFirstAttribute();
- !isTrivial(att.first); att = inReader.GetNarrowNextAttribute()) {
- if (!AreEqual(att.first, "scale") && !AreEqual(att.first, "position")
- && !AreEqual(att.first, "rotation") && !AreEqual(att.first, "pivot")
- && !AreEqual(att.first, "endtime") && !AreEqual(att.first, "eyeball")
- && !AreEqual(att.first, "ref") && !AreEqual(att.first, "id")
- && !AreEqual(att.first, "name") && !AreEqual(att.first, "orientation")
- && !AreEqual(att.first, "rotationorder")) // note that sourcepath does come through.
- {
- copiedAttributes.push_back(eastl::make_pair(att.first, att.second));
- }
- }
- }
-}
-
-void CUIPParserObjectRefHelper::CacheGraph(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inWriter)
-{
- {
- // First, we parse Graph section to build the scene graph
- IDOMReader::Scope __graphScope(inReader);
- inReader.MoveToFirstChild("Graph");
- CacheSceneGraph(inReader);
- }
- void *logicScopeItem = NULL;
- {
- // Next, we parse Logic section to update the node name and image information
- IDOMReader::Scope __logicScope(inReader);
- inReader.MoveToFirstChild("Logic");
- logicScopeItem = inReader.GetScope();
- CacheStateGraph(inReader);
- }
- if (m_SceneGraphAliasList.empty() == false) {
- IDOMReader::Scope __aliasScope(inReader);
- // Now we expand aliases
- eastl::hash_map<TStrType, TStrType> oldToNewIdMap;
- std::shared_ptr<qt3dsdm::IDOMFactory> theFactory = inWriter.GetFactory();
- std::shared_ptr<qt3dsdm::IStringTable> theStrTable = inReader.GetStringTable();
- qt3dsdm::SDOMElement *theSlidesRoot = theFactory->NextElement("AliasSlides");
- eastl::pair<std::shared_ptr<qt3dsdm::IDOMWriter>, std::shared_ptr<qt3dsdm::IDOMReader>>
- slideWriterReaderPair =
- qt3dsdm::IDOMWriter::CreateDOMWriter(theFactory, *theSlidesRoot, theStrTable);
- std::shared_ptr<qt3dsdm::IDOMWriter> slideWriter = slideWriterReaderPair.first;
-
- {
- IDOMReader::Scope __loopScope(inReader);
- for (QT3DSU32 idx = 0, end = m_SceneGraphAliasList.size(); idx < end; ++idx) {
- inReader.SetScope(m_SceneGraphAliasList[idx]);
- const char8_t *reference;
- SGraphNode *referencedNode = NULL;
- const char8_t *theIdStr;
- inReader.Att("id", theIdStr);
- SGraphNode *aliasNode = NULL;
- TGraphNodeMap::iterator iter = m_GraphNodeMap.find(m_MetaData.Register(theIdStr));
- if (iter != m_GraphNodeMap.end())
- aliasNode = iter->second;
-
- if (inReader.UnregisteredAtt("referencednode", reference)) {
- TStrType theSourceElemId = ParseObjectRefId(reference, theIdStr);
- iter = m_GraphNodeMap.find(theSourceElemId);
- if (iter != m_GraphNodeMap.end())
- referencedNode = iter->second;
- }
- if (referencedNode == NULL || aliasNode == NULL) {
- QT3DS_ASSERT(false);
- continue;
- }
- inReader.SetScope(referencedNode->m_ReaderContext);
- oldToNewIdMap.clear();
- std::shared_ptr<qt3dsdm::IDOMFactory> theFactory = inWriter.GetFactory();
- std::shared_ptr<qt3dsdm::IStringTable> theStrTable = inReader.GetStringTable();
- qt3dsdm::SDOMElement *theRoot = theFactory->NextElement(inReader.GetElementName());
- std::shared_ptr<qt3dsdm::IDOMWriter> copyWriter =
- qt3dsdm::IDOMWriter::CreateDOMWriter(theFactory, *theRoot, theStrTable).first;
-
- // Step one is just to copy the scene graph generating ids.
- SGraphNode *theParent = aliasNode->m_Parent;
- aliasNode->m_Class = referencedNode->m_Class;
- aliasNode->m_Type = referencedNode->m_Type;
- // Copy the alias id
- copyWriter->Att("id", theIdStr);
- eastl::vector<eastl::pair<eastl::string, eastl::string>> copiedAttributes;
- StoreTopLevelAliasAttributes(inReader, copiedAttributes);
- for (QT3DSU32 idx = 0, end = copiedAttributes.size(); idx < end; ++idx) {
- copyWriter->Att(copiedAttributes[idx].first.c_str(),
- copiedAttributes[idx].second.c_str());
- }
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "Alias"))
- continue;
- qt3dsdm::IDOMReader::Scope __loopScoper(inReader);
- qt3dsdm::IDOMWriter::Scope writerScope(*copyWriter,
- inReader.GetNarrowElementName());
- CopySceneGraph(inReader, *copyWriter, *slideWriter, oldToNewIdMap,
- aliasNode->m_Name.c_str(), theIdStr, *aliasNode);
- }
- if (referencedNode->m_MasterSlide) {
- inReader.SetScope(referencedNode->m_MasterSlide);
- CopyStates(inReader, *slideWriter, oldToNewIdMap, aliasNode->m_Name.c_str(),
- theIdStr);
- }
- // Set the scope to point at the alias node.
- inReader.SetScope(aliasNode->m_ReaderContext);
- inWriter.ReplaceCurrent(*theRoot);
- // Now find the owning component.
- SGraphNode *theComponent = theParent;
- while (theComponent && theComponent->m_MasterSlide == NULL)
- theComponent = theComponent->m_Parent;
-
- if (theComponent && theComponent->m_MasterSlide) {
- inReader.SetScope(theComponent->m_MasterSlide);
- // Copy any state commands that have entries in the old to new map.
- CopyStateCommands(inReader, inWriter, oldToNewIdMap, aliasNode->m_Name.c_str(),
- referencedNode->m_Id, theIdStr);
- } else {
- QT3DS_ASSERT(false);
- }
- }
- } // End of loop scope.
-
- {
- // Next, we parse Logic section to update the node name and image information
- {
- IDOMReader::Scope __logicScope(inReader);
- inReader.SetScope(theSlidesRoot);
- // Cache the new items and their names and such.
- CacheStateGraph(inReader);
- }
-
- inReader.MoveToFirstChild("Logic");
- inWriter.AppendChildren(*theSlidesRoot);
- }
-
- /*
-#if defined _DEBUG && defined _WIN32
- {
- qt3dsdm::SDOMElement* theElem = inWriter.GetTopElement();
- {
- qt3ds::foundation::CFileSeekableIOStream theWriter( "c:\\temp.xml",
-FileWriteFlags() );
- qt3dsdm::CDOMSerializer::Write( *theElem, theWriter );
- }
- }
-#endif
- */
- }
-
-}
-
-void CUIPParserObjectRefHelper::CacheSceneGraph(IDOMReader &inReader, SGraphNode *inParent)
-{
- IDOMReader::Scope __childScope(inReader);
-
- // build out the graph.
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "Alias")) {
- CacheSceneGraphNode(inReader, inParent);
- m_SceneGraphAliasList.push_back(inReader.GetScope());
- } else {
- SGraphNode &theNode(CacheSceneGraphNode(inReader, inParent));
- CacheSceneGraph(inReader, &theNode);
- }
- }
-}
-
-CUIPParserObjectRefHelper::SGraphNode &
-CUIPParserObjectRefHelper::CacheSceneGraphNode(qt3dsdm::IDOMReader &inReader, SGraphNode *inParent)
-{
- SGraphNode *theNode = new SGraphNode();
- const char8_t *theIdStr;
- inReader.Att("id", theIdStr);
- theNode->m_Id = m_MetaData.Register(theIdStr);
- theNode->m_Type = m_MetaData.Register(inReader.GetNarrowElementName());
- const char8_t *theClassStr;
- inReader.Att("class", theClassStr);
- theNode->m_Class = m_MetaData.Register(theClassStr);
- const char *theNameStr;
- theNode->m_ReaderContext = inReader.GetScope();
-
- if (inParent && inParent->m_Type == m_MetaData.Register("Layer")
- && theNode->m_Type == m_MetaData.Register("Image")) {
- TLightProbeIdToNameMap::iterator theFind = m_LayerImageIdToNameMap.find(theIdStr);
- if (theFind != m_LayerImageIdToNameMap.end())
- theNode->m_Name = m_MetaData.Register(theFind->second.c_str());
- } else if (!inReader.Att("name", theNameStr)) {
- Option<eastl::string> theNameStrOpt = m_MetaData.GetPropertyValueString(
- theNode->m_Type, m_MetaData.Register("name"), theNode->m_Class);
- if (theNameStrOpt.hasValue())
- theNode->m_Name = m_MetaData.Register(theNameStrOpt->c_str());
- } else
- theNode->m_Name = m_MetaData.Register(theNameStr);
-
- if (inParent) {
- theNode->m_Parent = inParent;
- inParent->m_Children.push_back(theNode);
- } else {
- m_RootNode = theNode;
- }
-
- m_GraphNodeMap[theNode->m_Id] = theNode;
- return *theNode;
-}
-
-void CUIPParserObjectRefHelper::CacheStateGraph(IDOMReader &inReader)
-{
- IDOMReader::Scope __childScope(inReader);
- const char8_t *component;
- if (inReader.UnregisteredAtt("component", component)) {
- TGraphNodeMap::iterator iter = m_GraphNodeMap.find(m_MetaData.Register(component + 1));
- if (iter != m_GraphNodeMap.end()) {
- iter->second->m_MasterSlide = inReader.GetScope();
- }
- }
-
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "State"))
- CacheStateGraph(inReader);
- else if (AreEqual(inReader.GetNarrowElementName(), "Add")
- || AreEqual(inReader.GetNarrowElementName(), "Set")) {
- const char *theRef;
- const char *theName;
- if (inReader.Att("ref", theRef)) {
- theRef++; // remove the '#'
- SGraphNode *theNode = GetNode(theRef);
- if (theNode) {
- // Overwrite the name. This assumes that "name" property is always linked.
- if (inReader.Att("name", theName)) {
- theNode->m_Name = m_MetaData.Register(theName);
- }
-
- // Special case for material. Image properties refer to instances.
- // For example: Scene.Layer.Rectangle.Material.diffusemap.rotationuv ->
- // diffusemap refers to Image instance
- // So if we find image instance, overwrite the name of the image with the
- // property name.
- // This assumes that user can't rename image property
- if (theNode->m_Type == m_MaterialStr && !theNode->m_Children.empty()) {
- for (TImageNamePropertyList::iterator theProp =
- m_ImageNamePropertyList.begin();
- theProp != m_ImageNamePropertyList.end(); ++theProp) {
- const char *theImageInstance;
- if (inReader.Att(theProp->c_str(), theImageInstance)) {
- ++theImageInstance; // remove the '#'
- SGraphNode *theImageNode = GetNode(theImageInstance);
- QT3DS_ASSERT(theImageNode && theImageNode->m_Parent == theNode);
- if (theImageNode)
- theImageNode->m_Name = *theProp;
- }
- }
- }
-
- }
- }
- }
- }
-}
-
-void CUIPParserObjectRefHelper::CopySceneGraph(qt3dsdm::IDOMReader &inReader,
- qt3dsdm::IDOMWriter &inWriter,
- qt3dsdm::IDOMWriter &inSlideWriter,
- TStrToStrMap &inMap, const char *inAliasName,
- const char *inAliasId, SGraphNode &inParent)
-{
- qt3dsdm::IDOMReader::Scope __graphScope(inReader);
- // Assume the element itself is already copied.
- // Run through attributes and duplicate them, but for any id attributes generate a new id.
- const char8_t *tempItem;
- if (!inReader.Att("id", tempItem)) {
- QT3DS_ASSERT(false);
- return;
- }
- SGraphNode *theParent = &inParent;
- eastl::string idGenerator(inAliasName);
- idGenerator.append("-");
- idGenerator.append(tempItem);
- while (m_GraphNodeMap.find(m_MetaData.Register(idGenerator.c_str())) != m_GraphNodeMap.end())
- idGenerator.append("_");
- inWriter.Att("id", idGenerator.c_str());
- TStrType srcId = m_MetaData.Register(tempItem);
- TStrType newId = m_MetaData.Register(idGenerator.c_str());
- inMap[srcId] = newId;
- SGraphNode *srcNode = m_GraphNodeMap.find(srcId)->second;
- SGraphNode *newNode = new SGraphNode();
- newNode->m_Class = srcNode->m_Class;
- newNode->m_Id = newId;
- newNode->m_Name = srcNode->m_Name;
- newNode->m_Type = srcNode->m_Type;
- newNode->m_Parent = &inParent;
- theParent = newNode;
- m_GraphNodeMap[newId] = newNode;
- inParent.m_Children.push_back(newNode);
-
- {
- qt3dsdm::IDOMReader::Scope __childrenScope(inReader);
-
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "Alias"))
- continue;
- qt3dsdm::IDOMWriter::Scope __newNode(inWriter, inReader.GetNarrowElementName());
- CopySceneGraph(inReader, inWriter, inSlideWriter, inMap, inAliasName, inAliasId,
- *theParent);
- }
- }
- TGraphNodeMap::iterator iter = m_GraphNodeMap.find(m_MetaData.Register(tempItem));
- if (iter == m_GraphNodeMap.end()) {
- QT3DS_ASSERT(false);
- return;
- }
- SGraphNode *targetNode = iter->second;
-
- for (eastl::pair<const char8_t *, const char8_t *> att = inReader.GetNarrowFirstAttribute();
- !isTrivial(att.first); att = inReader.GetNarrowNextAttribute()) {
- if (AreEqual(att.first, "id"))
- continue;
- Q3DStudio::ERuntimeDataModelDataType theDataType = m_MetaData.GetPropertyType(
- targetNode->m_Type, m_MetaData.Register(att.first), targetNode->m_Class);
- // Ensure we use new ids for this datatype. This ensures that we go
- if (theDataType == ERuntimeDataModelDataTypeLong4) {
- TStrToStrMap::iterator aliasIdName = inMap.find(m_MetaData.Register(att.second));
- if (aliasIdName != inMap.end())
- inWriter.Att(att.first, aliasIdName->second.c_str());
- else {
- QT3DS_ASSERT(false);
- }
- } else
- inWriter.Att(att.first, att.second);
- }
- if (targetNode->m_MasterSlide) {
- inReader.SetScope(targetNode->m_MasterSlide);
- CopyStates(inReader, inSlideWriter, inMap, inAliasName, inAliasId);
- }
-}
-
-void CUIPParserObjectRefHelper::CopyStates(qt3dsdm::IDOMReader &inReader,
- qt3dsdm::IDOMWriter &inSlideWriter, TStrToStrMap &inMap,
- const char *inAliasName, const char *inAliasId)
-{
- qt3dsdm::IDOMReader::Scope __stateScope(inReader);
- qt3dsdm::IDOMWriter::Scope stateScope(inSlideWriter, "State");
- CopyAttributes(inReader, inSlideWriter, inMap, inAliasName, inAliasId);
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- if (AreEqual(inReader.GetNarrowElementName(), "State"))
- CopyStates(inReader, inSlideWriter, inMap, inAliasName, inAliasId);
- else {
- CopyHierarchy(inReader, inSlideWriter, inMap, inAliasName, inAliasId);
- }
- }
-}
-
-eastl::pair<const char8_t *, const char8_t *> CUIPParserObjectRefHelper::ProcessAliasAttribute(
- const char8_t *inObjId, eastl::pair<const char8_t *, const char8_t *> inAttribute,
- eastl::string &ioStrBuilder, TStrToStrMap &inMap)
-{
- inObjId = nonNull(inObjId);
- if (inObjId[0] == '#')
- ++inObjId;
- SGraphNode *theNode = GetNode(nonNull(inObjId));
- if (theNode == NULL)
- return inAttribute;
- const char8_t *propName = inAttribute.first;
- const char8_t *propValue = inAttribute.second;
- ERuntimeAdditionalMetaDataType thePropertyType = m_MetaData.GetAdditionalType(
- theNode->m_Type, m_MetaData.Register(propName), theNode->m_Class);
- if (thePropertyType == ERuntimeAdditionalMetaDataTypeImage
- || thePropertyType == ERuntimeAdditionalMetaDataTypeObjectRef) {
- propValue = nonNull(propValue);
- if (propValue[0] == '#')
- ++propValue;
- TStrToStrMap::iterator iter = inMap.find(m_MetaData.Register(propValue));
- if (iter != inMap.end()) {
- ioStrBuilder.assign("#");
- ioStrBuilder.append(iter->second);
- propValue = ioStrBuilder.c_str();
- } else
- propValue = inAttribute.second;
- }
- return eastl::make_pair(propName, propValue);
-}
-
-void CUIPParserObjectRefHelper::CopyAttributes(qt3dsdm::IDOMReader &inReader,
- qt3dsdm::IDOMWriter &inSlideWriter,
- TStrToStrMap &inMap, const char *inAliasName,
- const char *inAliasId)
-{
- eastl::string builder;
- const char8_t *elemId = "";
- for (eastl::pair<const char8_t *, const char8_t *> att = inReader.GetNarrowFirstAttribute();
- !isTrivial(att.first); att = inReader.GetNarrowNextAttribute()) {
- if (AreEqual(att.first, "component")) {
- TStrToStrMap::iterator iter = inMap.find(m_MetaData.Register(att.second + 1));
- builder.assign("#");
- if (iter != inMap.end()) {
- builder.append(iter->second);
- } else {
- builder.append(inAliasId);
- }
- inSlideWriter.Att(att.first, builder.c_str());
- } else if (AreEqual(att.first, "id")) {
- builder.assign(inAliasName);
- builder.append("-");
- builder.append(att.second);
- // cannot be
- while (m_SlideIdSet.find(m_MetaData.Register(builder.c_str())) != m_SlideIdSet.end())
- builder.append("_");
- inSlideWriter.Att(att.first, builder.c_str());
- m_SlideIdSet.insert(m_MetaData.Register(builder.c_str()));
- inMap[m_MetaData.Register(att.second)] = m_MetaData.Register(builder.c_str());
- } else if (AreEqual(att.first, "ref")) {
- const char8_t *refItem = att.second;
- if (!isTrivial(refItem)) {
- ++refItem;
- elemId = refItem;
- TStrToStrMap::iterator iter = inMap.find(m_MetaData.Register(refItem));
- if (iter != inMap.end()) {
- builder.assign("#");
- builder.append(iter->second.c_str());
- inSlideWriter.Att("ref", builder.c_str());
- } else {
- QT3DS_ASSERT(false);
- }
- }
- } else {
- att = ProcessAliasAttribute(elemId, att, builder, inMap);
- inSlideWriter.Att(att.first, att.second);
- }
- }
-}
-
-void CUIPParserObjectRefHelper::CopyHierarchy(qt3dsdm::IDOMReader &inReader,
- qt3dsdm::IDOMWriter &inSlideWriter, TStrToStrMap &inMap,
- const char *inAliasName, const char *inAliasId)
-{
- qt3dsdm::IDOMReader::Scope __commandScope(inReader);
- qt3dsdm::IDOMWriter::Scope __writerScope(inSlideWriter, inReader.GetNarrowElementName());
- CopyAttributes(inReader, inSlideWriter, inMap, inAliasName, inAliasId);
- const char8_t *childData;
- if (inReader.Value(childData)) {
- inSlideWriter.Value(childData);
- }
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling())
- CopyHierarchy(inReader, inSlideWriter, inMap, inAliasName, inAliasId);
-}
-
-void CUIPParserObjectRefHelper::CopyStateCommands(qt3dsdm::IDOMReader &inReader,
- qt3dsdm::IDOMWriter &inWriter,
- TStrToStrMap &oldToNewIdMap,
- const char *inAliasName, const char *inOldId,
- const char *inNewId)
-{
- qt3dsdm::IDOMReader::Scope __commandScope(inReader);
- qt3dsdm::SDOMElement *theSlidesRoot = NULL;
- eastl::pair<std::shared_ptr<qt3dsdm::IDOMWriter>, std::shared_ptr<qt3dsdm::IDOMReader>>
- slideWriterReaderPair;
- std::shared_ptr<qt3dsdm::IDOMWriter> commandWriter;
- {
- qt3dsdm::IDOMReader::Scope __loopScope(inReader);
- eastl::vector<eastl::pair<eastl::string, eastl::string>> copiedAttributes;
- void *destCommand = NULL;
- eastl::string strBuilder;
- for (bool success = inReader.MoveToFirstChild(); success;
- success = inReader.MoveToNextSibling()) {
- qt3dsdm::IDOMReader::Scope childScope(inReader);
- if (AreEqual(inReader.GetNarrowElementName(), "State"))
- CopyStateCommands(inReader, inWriter, oldToNewIdMap, inAliasName, inOldId, inNewId);
- else {
- const char8_t *refItem = "";
- if (inReader.Att("ref", refItem) && !isTrivial(refItem)) {
- ++refItem;
- TStrToStrMap::iterator iter = oldToNewIdMap.find(m_MetaData.Register(refItem));
- if (iter != oldToNewIdMap.end()) {
- if (theSlidesRoot == NULL) {
- std::shared_ptr<qt3dsdm::IDOMFactory> theFactory =
- inWriter.GetFactory();
- std::shared_ptr<qt3dsdm::IStringTable> theStrTable =
- inReader.GetStringTable();
- theSlidesRoot = theFactory->NextElement("AliasSlides");
- slideWriterReaderPair = qt3dsdm::IDOMWriter::CreateDOMWriter(
- theFactory, *theSlidesRoot, theStrTable);
- commandWriter = slideWriterReaderPair.first;
- }
- qt3dsdm::IDOMWriter::Scope elemScope(*commandWriter,
- inReader.GetNarrowElementName());
- for (eastl::pair<const char8_t *, const char8_t *> att =
- inReader.GetNarrowFirstAttribute();
- !isTrivial(att.first); att = inReader.GetNarrowNextAttribute()) {
- if (AreEqual(att.first, "ref")) {
- strBuilder.assign("#");
- strBuilder.append(iter->second);
- commandWriter->Att("ref", strBuilder.c_str());
- } else {
-
- att =
- ProcessAliasAttribute(refItem, att, strBuilder, oldToNewIdMap);
- commandWriter->Att(att.first, att.second);
- }
- }
- for (bool commandChild = inReader.MoveToFirstChild(); commandChild;
- commandChild = inReader.MoveToNextSibling()) {
- qt3dsdm::IDOMReader::Scope commandChildScope(inReader);
- CopyHierarchy(inReader, *commandWriter, oldToNewIdMap, inAliasName, "");
- }
- } else if (AreEqual(refItem, inOldId)) {
- StoreTopLevelAliasAttributes(inReader, copiedAttributes);
- } else if (AreEqual(refItem, inNewId))
- destCommand = inReader.GetScope();
- }
- }
- }
- if (copiedAttributes.size() && destCommand) {
- inReader.SetScope(destCommand);
- for (QT3DSU32 idx = 0, end = copiedAttributes.size(); idx < end; ++idx) {
- eastl::pair<eastl::string, eastl::string> &theItem(copiedAttributes[idx]);
- inWriter.Att(theItem.first.c_str(), theItem.second.c_str());
- }
- }
- }
- if (commandWriter)
- inWriter.AppendChildren(*commandWriter->GetTopElement());
-}
-
-CUIPParserObjectRefHelper::SGraphNode *CUIPParserObjectRefHelper::GetNode(const char *inId)
-{
- if (IsTrivial(inId))
- return NULL;
- if (inId[0] == '#')
- ++inId;
- TGraphNodeMap::iterator theIter = m_GraphNodeMap.find(m_MetaData.Register(inId));
- if (theIter != m_GraphNodeMap.end())
- return theIter->second;
- return NULL;
-}
-
-CUIPParserObjectRefHelper::SGraphNode *CUIPParserObjectRefHelper::GetNode(eastl::string inId)
-{
- return GetNode(inId.c_str());
-}
-
-CUIPParserObjectRefHelper::TStrType CUIPParserObjectRefHelper::GetName(const eastl::string &inId)
-{
- SGraphNode *theNode = GetNode(inId.c_str());
- if (theNode)
- return theNode->m_Name;
- QT3DS_ASSERT(false);
- return m_MetaData.Register(inId.c_str());
-}
-
-CUIPParserObjectRefHelper::TStrType CUIPParserObjectRefHelper::GetType(const eastl::string &inId)
-{
- SGraphNode *theNode = GetNode(inId.c_str());
- if (theNode)
- return theNode->m_Type;
- QT3DS_ASSERT(false);
- return m_MetaData.Register(inId.c_str());
-}
-
-CUIPParserObjectRefHelper::TStrType CUIPParserObjectRefHelper::GetClass(const eastl::string &inId)
-{
- SGraphNode *theNode = GetNode(inId.c_str());
- if (theNode)
- return theNode->m_Class;
- QT3DS_ASSERT(false);
- return m_MetaData.Register(inId.c_str());
-}
-
-CUIPParserObjectRefHelper::TStrType
-CUIPParserObjectRefHelper::ParseObjectRefId(const eastl::string &inObjectPath,
- const char8_t *inOwnerId)
-{
- if (inObjectPath.empty()) {
- QT3DS_ASSERT(false);
- return TStrType();
- } else if (inObjectPath[0] == '#') {
- // Absolute path
- return m_MetaData.Register(inObjectPath.substr(1).c_str());
- } else {
- // Relative path
- SGraphNode *theNode = GetNode(inOwnerId);
-
- // Split the string based on PATH_DELIMITER
- eastl::string theStr = inObjectPath;
- eastl::string theCurrentPart;
- eastl::string::size_type thePos;
- while (theNode) {
- thePos = theStr.find(PATH_DELIMITER);
- theCurrentPart = theStr.substr(0, thePos);
-
- if (theCurrentPart == "parent") {
- theNode = theNode->m_Parent;
- } else if (theCurrentPart == "this") {
- // Do nothing because theNode points to itself
- } else if (theCurrentPart == "Scene") {
- theNode = m_RootNode;
- } else {
- SGraphNode *theFoundChild = NULL;
- for (QT3DSU32 childIdx = 0;
- childIdx < theNode->m_Children.size() && theFoundChild == NULL; ++childIdx) {
- if (AreEqual(theNode->m_Children[childIdx]->m_Name, theCurrentPart.c_str()))
- theFoundChild = theNode->m_Children[childIdx];
- }
- theNode = theFoundChild;
- }
-
- if (thePos == eastl::string::npos)
- break;
-
- // Move on to the next token
- theStr = theStr.substr(thePos + 1);
- }
-
- if (theNode)
- return theNode->m_Id;
-
- return TStrType();
- }
-}
-
-eastl::string CUIPParserObjectRefHelper::BuildReferenceString(eastl::string inObjectPath)
-{
- if (inObjectPath.empty()) {
- // QT3DS_ASSERT( false );
- return "";
- } else if (inObjectPath[0] == '#') {
- // Absolute path
- return BuildAbsoluteReferenceString(inObjectPath.substr(1));
- } else {
- // Relative path
- return inObjectPath;
- }
-}
-
-eastl::string CUIPParserObjectRefHelper::BuildAbsoluteReferenceString(eastl::string inId)
-{
- return BuildAbsoluteReferenceString(GetNode(inId));
-}
-
-eastl::string CUIPParserObjectRefHelper::BuildAbsoluteReferenceString(SGraphNode *inNode)
-{
- if (inNode == NULL)
- return "";
-
- eastl::string theNameStart;
- eastl::string theNameEnd(inNode->m_Name);
-
- SGraphNode *theParent = inNode->m_Parent;
- if (theParent) {
- theNameStart.assign(BuildAbsoluteReferenceString(theParent));
- theNameStart.append(".");
- }
- theNameStart += theNameEnd;
- return theNameStart;
-}
-
-void CUIPParserObjectRefHelper::MarkAllReferencedAttributes(
- eastl::string inId, const eastl::vector<eastl::string> &inReferences,
- qt3dsdm::IDOMReader &inReader, SParseElementManager &outIdAttributesMap)
-{
- IDOMReader::Scope __scope(inReader);
- eastl::string theReferencesTokenizer;
- eastl::string theCurrentReference;
- eastl::string theReferenceTokenizer;
- eastl::string theCurrentString;
- eastl::string::size_type startPos = 0;
- eastl::string::size_type endPos = 0;
- eastl::string::size_type theReferencesTokenizerPos = 0;
- eastl::string::size_type theReferenceTokenizerPos = 0;
- SGraphNode *theBaseInstance = GetNode(inId);
- SGraphNode *theCurrentInstance = theBaseInstance;
- eastl::vector<SGraphNode *> theInstanceList;
-
- for (QT3DSU32 theRefIdx = 0, theRefEnd = inReferences.size(); theRefIdx < theRefEnd; ++theRefIdx) {
- // Split the string based on PATH_LINE_END
- theReferencesTokenizer = inReferences[theRefIdx];
- theReferencesTokenizerPos = 0;
- while (theReferencesTokenizerPos != eastl::string::npos
- && !theReferencesTokenizer.empty()) {
- theCurrentInstance = theBaseInstance;
- theReferencesTokenizerPos = theReferencesTokenizer.find(PATH_LINE_END);
- theCurrentReference = theReferencesTokenizer.substr(0, theReferencesTokenizerPos);
-
- // Move to the next token
- theReferencesTokenizer = theReferencesTokenizer.substr(theReferencesTokenizerPos + 1);
-
- // trim whitespace from the beginning and the end of the string
- startPos = theCurrentReference.find_first_not_of("\n\r\t ");
- endPos = theCurrentReference.find_last_not_of("\n\r\t ");
- if (startPos != eastl::string::npos)
- theCurrentReference = theCurrentReference.substr(startPos, endPos - startPos + 1);
-
- // Split the string based on PATH_DELIMITER
- theReferenceTokenizer = theCurrentReference;
- theReferenceTokenizerPos = 0;
- theInstanceList.clear();
- while (theReferenceTokenizerPos != eastl::string::npos
- && !theReferenceTokenizer.empty()) {
- theReferenceTokenizerPos = theReferenceTokenizer.find(PATH_DELIMITER);
- theCurrentString = theReferenceTokenizer.substr(0, theReferenceTokenizerPos);
-
- // Move to the next token
- theReferenceTokenizer = theReferenceTokenizer.substr(theReferenceTokenizerPos + 1);
-
- if (theReferenceTokenizerPos != eastl::string::npos) {
- theCurrentInstance = GetReferenceNode(theCurrentInstance, theCurrentString,
- theInstanceList, inReader);
- } else {
- if (theInstanceList.size() == 0 && theCurrentInstance)
- theInstanceList.push_back(theCurrentInstance);
- if (!MarkAttributeAsReferenced(theBaseInstance, theInstanceList,
- theCurrentString, inReader,
- outIdAttributesMap)) {
- qCCritical(qt3ds::INVALID_OPERATION)
- << "Unable to parse reference: "
- << theBaseInstance->m_Id.c_str() << " : "
- << theCurrentReference.c_str();
- }
- }
- }
- }
- }
-}
-
-//==============================================================================
-/**
- * Helper method to find the VAsset via the name which is the child of inAsset.
- */
-CUIPParserObjectRefHelper::SGraphNode *
-CUIPParserObjectRefHelper::GetReferenceNode(SGraphNode *inInstance, eastl::string &inAssetName,
- eastl::vector<SGraphNode *> &outInstanceList,
- qt3dsdm::IDOMReader &inReader)
-{
- if (!inInstance)
- return NULL;
-
- SGraphNode *theReturnInstance = NULL;
-
- if (inAssetName == "Scene") {
- theReturnInstance = m_RootNode;
- } else if (inAssetName == "parent") {
- theReturnInstance = inInstance->m_Parent;
- } else if (inAssetName == "children") {
- outInstanceList.insert(outInstanceList.end(), inInstance->m_Children.begin(),
- inInstance->m_Children.end());
- } else if (inAssetName == "descendants") {
- for (SGraphNode::TGraphNodeList::iterator theChildren = inInstance->m_Children.begin();
- theChildren != inInstance->m_Children.end(); ++theChildren) {
- outInstanceList.push_back(*theChildren);
- GetReferenceNode(*theChildren, inAssetName, outInstanceList, inReader);
- }
- } else if (inAssetName[0] == '[' && inAssetName[inAssetName.length() - 1] == ']') {
- // For example: [targetElement].position
- // targetElement should be an Object picker specifying which element to preserve.
- eastl::string theAssetName = inAssetName.substr(1, inAssetName.length() - 2);
-
- // Check if the target element property exists and get the property value
- eastl::string theValue;
- if (!inReader.Att(theAssetName.c_str(), theValue)) {
- // Try to find the parent context and get the element name from there.
- if (AreEqual(inReader.GetElementName(), L"Set")) {
- IDOMReader::Scope __setScope(inReader);
- const char8_t *refValue = "";
- inReader.Att("ref", refValue);
- inReader.Leave();
- inReader.Leave();
- for (bool success = inReader.MoveToFirstChild("Add"); success;
- success = inReader.MoveToNextSibling("Add")) {
- const char8_t *newRef;
- inReader.Att("ref", newRef);
- if (AreEqual(newRef, refValue)) {
- inReader.Att(theAssetName.c_str(), theValue);
- break;
- }
- }
- }
- if (theValue.empty()) {
- Option<TRuntimeMetaDataStrType> theRef = m_MetaData.GetPropertyValueObjectRef(
- inInstance->m_Type, m_MetaData.Register(theAssetName.c_str()),
- inInstance->m_Class);
- if (theRef.hasValue())
- theValue = *theRef;
- }
- }
- if (!IsTrivial(theValue.c_str())) {
- // Get the target element id
- eastl::string theTargetElement =
- ParseObjectRefId(theValue, inInstance->m_Id.c_str()).c_str();
- if (theTargetElement != "") {
- // Get the corresponding instance
- theReturnInstance = GetNode(theTargetElement);
- }
- }
- } else {
- // Get the child with the specified name.
- // Note that name is not unique and so this will only return the first child that matches
- // the name
- for (SGraphNode::TGraphNodeList::iterator theChildren = inInstance->m_Children.begin();
- theChildren != inInstance->m_Children.end(); ++theChildren) {
- if (AreEqual((*theChildren)->m_Name.c_str(), inAssetName.c_str())) {
- theReturnInstance = *theChildren;
- break;
- }
- }
- }
- return theReturnInstance;
-}
-
-bool CUIPParserObjectRefHelper::MarkAttributeAsReferenced(
- SGraphNode *inBaseInstance, eastl::vector<SGraphNode *> &inInstanceList,
- eastl::string &inAttributeName, qt3dsdm::IDOMReader &inReader,
- SParseElementManager &outIdAttributesMap)
-{
- bool theRet(false);
- eastl::vector<SGraphNode *>::iterator theIter = inInstanceList.begin();
- eastl::vector<SGraphNode *>::iterator theEnd = inInstanceList.end();
- for (; theIter != theEnd; ++theIter) {
- SGraphNode *theCurrentInstance = *theIter;
-
- if (inAttributeName == "all") {
- eastl::vector<TRuntimeMetaDataStrType> theProperties;
- m_MetaData.GetInstanceProperties(theCurrentInstance->m_Type.c_str(),
- theCurrentInstance->m_Class.c_str(), theProperties,
- true);
-
- if (theProperties.size() > 0) {
- SElementData *theData =
- outIdAttributesMap.FindElementData(theCurrentInstance->m_Id.c_str());
- if (theData) {
- for (QT3DSU32 theIndex = 0; theIndex < theProperties.size(); ++theIndex)
- outIdAttributesMap.MarkAttributeAsReferenced(
- *theData, theProperties[theIndex].c_str());
- }
- theRet = true;
- }
- } else {
- eastl::string theAttributeName = inAttributeName;
- if (inAttributeName[0] == '[' && inAttributeName[inAttributeName.length() - 1] == ']') {
- // For example: parent.[targetProp]
- // targetProp should be a string specifying which property to preserve
- theAttributeName = theAttributeName.substr(1, theAttributeName.length() - 2);
-
- // Get the targetProp property value from the uip file
- const char *theValue;
- if (inReader.Att(theAttributeName.c_str(), theValue)) {
- theAttributeName = theValue;
- } else {
- // Query metadata value of base instance
- theAttributeName = m_MetaData.GetPropertyValueString(
- inBaseInstance->m_Type, m_MetaData.Register(theAttributeName.c_str()),
- inBaseInstance->m_Class);
- }
- }
-
- // Check if the property exists
- if (m_MetaData.IsPropertyExist(theCurrentInstance->m_Type,
- m_MetaData.Register(theAttributeName.c_str()),
- theCurrentInstance->m_Class)) {
- MarkPreserveFlag(theCurrentInstance, theAttributeName, outIdAttributesMap);
- theRet = true;
- } else {
- // check whether the attribute name has ".", strip those after that and try again
- eastl::string::size_type theIndex = theAttributeName.rfind('.');
- if (theIndex != eastl::string::npos) {
- theAttributeName = theAttributeName.substr(0, theIndex);
- if (m_MetaData.IsPropertyExist(theCurrentInstance->m_Type,
- m_MetaData.Register(theAttributeName.c_str()),
- theCurrentInstance->m_Class)) {
- MarkPreserveFlag(theCurrentInstance, theAttributeName, outIdAttributesMap);
- theRet = true;
- }
- }
- }
- }
- }
-
- return theRet;
-}
-
-void CUIPParserObjectRefHelper::MarkPreserveFlag(SGraphNode *inInstance, eastl::string inProperty,
- SParseElementManager &outIdAttributesMap)
-{
- outIdAttributesMap.MarkAttributeAsReferenced(inInstance->m_Id.c_str(), inProperty.c_str());
-}
-
-void CUIPParserObjectRefHelper::BuildImageNamePropertyList()
-{
- // Special case for material
- // Material's Image properties (such as diffuse map, etc) point to Image instances
- eastl::vector<TRuntimeMetaDataStrType> theProperties;
- m_MetaData.GetInstanceProperties("Material", NULL, theProperties, true);
-
- size_t thePropertyCount = theProperties.size();
- for (QT3DSU32 thePropertyIndex = 0; thePropertyIndex < thePropertyCount; ++thePropertyIndex) {
- eastl::string theProperty = theProperties[thePropertyIndex];
- ERuntimeAdditionalMetaDataType theAdditionalMetaDataType =
- m_MetaData.GetAdditionalType(m_MaterialStr, m_MetaData.Register(theProperty.c_str()));
-
- if (theAdditionalMetaDataType == ERuntimeAdditionalMetaDataTypeImage) {
- m_ImageNamePropertyList.insert(m_MetaData.Register(theProperty.c_str()));
- }
- }
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.h b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.h
deleted file mode 100644
index fcd16985..00000000
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include "Qt3DSUIPParser.h"
-#include "Qt3DSUIPParserImpl.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * @class CUIPParserObjectRefHelper
- * @brief Class for parsing UIP file - Object Reference Helper
- */
-class CUIPParserObjectRefHelper
-{
- typedef qt3ds::foundation::CRegisteredString TStrType;
-
-public:
- typedef eastl::hash_map<TStrType, TStrType> TStrToStrMap;
-
- /// Tree structure to cache scene graph information. This is used to resolve relative object
- /// reference
- struct SGraphNode
- {
- typedef eastl::vector<SGraphNode *> TGraphNodeList;
-
- TStrType m_Id; // node id
- TStrType m_Name; // name of the node. the name can be default from metadata, specified in
- // graph section, or specified in logic section.
- TStrType m_Type; // for example: Layer, Camera, Model
- TStrType
- m_Class; // class id. usually used by Behavior or objects that have custom properties.
- void *m_ReaderContext; // Context to warp back to this node.
- void *m_MasterSlide;
- SGraphNode *m_Parent;
- TGraphNodeList m_Children;
- SGraphNode()
- : m_ReaderContext(NULL)
- , m_MasterSlide(NULL)
- , m_Parent(NULL)
- {
- }
- };
- //==============================================================================
- // Fields
- //==============================================================================
-private:
- typedef eastl::hash_set<TStrType> TImageNamePropertyList;
- IRuntimeMetaData &m_MetaData; ///< Reference to Metadata
- typedef eastl::hash_map<TStrType, SGraphNode *> TGraphNodeMap;
- SGraphNode *m_RootNode;
- TGraphNodeMap m_GraphNodeMap;
- TImageNamePropertyList m_SlideIdSet;
-
- // List of Image property names, for example diffusemap, normalmap, etc
- // This is to handle material and images. Material's Image properties point to instances.
- TImageNamePropertyList m_ImageNamePropertyList;
- TStrType m_MaterialStr;
- eastl::vector<void *> m_SceneGraphAliasList;
-
- typedef eastl::pair<eastl::string, eastl::string> TLightProbeAndNamePair;
- typedef eastl::map<eastl::string, eastl::string> TLightProbeIdToNameMap;
- TLightProbeIdToNameMap m_LayerImageIdToNameMap;
- //==============================================================================
- // Methods
- //==============================================================================
-public: // Construction
- CUIPParserObjectRefHelper(IRuntimeMetaData &inMetaData);
- virtual ~CUIPParserObjectRefHelper();
-
- void CacheGraph(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inWriter);
- SGraphNode *GetNode(const char *inId);
- SGraphNode *GetNode(eastl::string inId);
- TStrType GetName(const eastl::string &inId); // return the node name given the node id
- TStrType GetType(const eastl::string &inId); // return the node type given the node id
- TStrType GetClass(const eastl::string &inId); // return the node class given the node id
-
- TStrType ParseObjectRefId(const eastl::string &inObjectPath, const char8_t *inOwnerId);
- eastl::string BuildReferenceString(eastl::string inObjectPath);
- void MarkAllReferencedAttributes(eastl::string inId,
- const eastl::vector<eastl::string> &inReferences,
- qt3dsdm::IDOMReader &inReader,
- SParseElementManager &outIdAttributesMap);
-
-private:
- void CacheSceneGraph(qt3dsdm::IDOMReader &inReader, SGraphNode *inParent = NULL);
- SGraphNode &CacheSceneGraphNode(qt3dsdm::IDOMReader &inReader, SGraphNode *inParent = NULL);
- void CacheStateGraph(qt3dsdm::IDOMReader &inReader);
-
- void CopySceneGraph(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inWriter,
- qt3dsdm::IDOMWriter &inSlideWriter, TStrToStrMap &inMap,
- const char *inAliasName, const char *inAliasId, SGraphNode &inParent);
- void CopyStates(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inSlideWriter,
- TStrToStrMap &inMap, const char *inAliasName, const char *inAliasId);
- void CopyAttributes(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inSlideWriter,
- TStrToStrMap &inMap, const char *inAliasName, const char *inAliasId);
- void CopyHierarchy(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inSlideWriter,
- TStrToStrMap &inMap, const char *inAliasName, const char *inAliasId);
- void CopyStateCommands(qt3dsdm::IDOMReader &inReader, qt3dsdm::IDOMWriter &inWriter,
- TStrToStrMap &oldToNewIdMap, const char *inAliasName,
- const char *inOldId, const char *inNewId);
- // Helper method for Preseve Attributes
- SGraphNode *GetReferenceNode(SGraphNode *inInstance, eastl::string &inAssetName,
- eastl::vector<SGraphNode *> &outInstanceList,
- qt3dsdm::IDOMReader &inReader);
- bool MarkAttributeAsReferenced(SGraphNode *inBaseInstance,
- eastl::vector<SGraphNode *> &inInstanceList,
- eastl::string &inAttributeName, qt3dsdm::IDOMReader &inReader,
- SParseElementManager &outIdAttributesMap);
- void MarkPreserveFlag(SGraphNode *inInstance, eastl::string inProperty,
- SParseElementManager &outIdAttributesMap);
- eastl::pair<const char8_t *, const char8_t *>
- ProcessAliasAttribute(const char8_t *inObjId,
- eastl::pair<const char8_t *, const char8_t *> inAttribute,
- eastl::string &ioStrBuilder, TStrToStrMap &inMap);
-
- eastl::string BuildAbsoluteReferenceString(eastl::string inId);
- eastl::string BuildAbsoluteReferenceString(SGraphNode *inNode);
-
- // Special case for material and images. Material's Image properties point to instances.
- void BuildImageNamePropertyList();
-};
-
-} // namespace Q3DStudio
diff --git a/src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.cpp b/src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.cpp
deleted file mode 100644
index b9fb9763..00000000
--- a/src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 - 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "Qt3DSAudioPlayerImpl.h"
-#include "foundation/Qt3DSLogging.h"
-#include <QDebug>
-
-#ifdef PLATFORM_HAS_QT_MULTIMEDIA_LIB
-#include <QSound>
-#endif // PLATFORM_HAS_QT_MULTIMEDIA_LIB
-
-namespace Q3DSViewer {
-
-Qt3DSAudioPlayerImpl::Qt3DSAudioPlayerImpl()
-{
-}
-
-Qt3DSAudioPlayerImpl::~Qt3DSAudioPlayerImpl()
-{
-}
-
-bool Qt3DSAudioPlayerImpl::PlaySoundFile(const char *inFilePath)
-{
-#ifdef PLATFORM_HAS_QT_MULTIMEDIA_LIB
- QSound::play(QString(inFilePath));
- return true;
-#else
- Q_UNUSED(inFilePath)
- qCWarning(qt3ds::WARNING, "Qt3DSAudioPlayerImpl::PlaySoundFile: no QT multimedia lib on this platform");
- return false;
-#endif // PLATFORM_HAS_QT_MULTIMEDIA_LIB
-}
-}
diff --git a/src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.h b/src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.h
deleted file mode 100644
index bba5bd6a..00000000
--- a/src/Runtime/ogl-runtime/src/viewer/Qt3DSAudioPlayerImpl.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 - 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_VIEWER_LIB_QT3DS_AUDIO_PLAYER_IMPL_H
-#define QT3DS_VIEWER_LIB_QT3DS_AUDIO_PLAYER_IMPL_H
-
-#include "Qt3DSAudioPlayer.h"
-#include "qt3dsruntimeglobal.h"
-
-namespace Q3DSViewer {
-
-class QT3DS_RUNTIME_API Qt3DSAudioPlayerImpl : public Q3DStudio::IAudioPlayer
-{
-public:
- Qt3DSAudioPlayerImpl();
- virtual ~Qt3DSAudioPlayerImpl();
- bool PlaySoundFile(const char *inFilePath) override;
-};
-}
-
-#endif // !QT3DS_VIEWER_LIB_QT3DS_AUDIO_PLAYER_IMPL_H
diff --git a/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.cpp b/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.cpp
deleted file mode 100644
index 094f140f..00000000
--- a/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.cpp
+++ /dev/null
@@ -1,993 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 - 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <algorithm>
-
-#include "EnginePrefix.h"
-#include "Qt3DSRuntimeView.h"
-#include "Qt3DSViewerApp.h"
-#include "Qt3DSTegraInputEngine.h"
-#include "Qt3DSInputFrame.h" // keyboard mapping
-#include "foundation/Qt3DSTime.h"
-#include "Qt3DSFNDTimer.h"
-#include "Qt3DSAudioPlayer.h"
-#include "Qt3DSImportMesh.h"
-
-#include <QList>
-#include <QFileInfo>
-#include <QDebug>
-
-#ifdef _MACOSX
-#include <mach-o/dyld.h>
-#endif
-
-namespace qt3ds {
-void Qt3DSAssert(const char *exp, const char *file, int line, bool *ignore)
-{
- Q_UNUSED(ignore)
- qCritical() << "Assertion thrown: " << file << " " << line << " " << exp;
-}
-}
-
-#ifndef EASTL_DEBUG_BREAK
-void EASTL_DEBUG_BREAK()
-{
- qFatal("EASTL_DEBUG_BREAK: Assertion blown");
-}
-
-#endif
-
-#ifdef _WIN32
-#include <Xinput.h>
-#include <ShellAPI.h>
-#include "Qt3DSInputFrame.h"
-
-void HandleController(Q3DStudio::IRuntimeView &inView)
-{
- static const class XInputLibrary
- {
- private:
- typedef DWORD(__stdcall *GetStateFunction)(DWORD, XINPUT_STATE *);
-
- public:
- XInputLibrary()
- : m_module(NULL)
- , GetState(NULL)
- {
- m_module = LoadLibraryA("XINPUT9_1_0.DLL");
- if (m_module != NULL) {
- GetState = reinterpret_cast<GetStateFunction>(GetProcAddress(m_module,
- "XInputGetState"));
- }
- }
-
- ~XInputLibrary()
- {
- if (m_module != NULL)
- FreeLibrary(m_module);
- }
-
- GetStateFunction GetState;
-
- private:
- HMODULE m_module;
- } library;
-
- static const DWORD MAX_USERS = 4;
- static const Q3DStudio::FLOAT STICK_RANGE = 32767;
- static const Q3DStudio::FLOAT TRIGGER_RANGE = 255;
-
- static const struct ButtonEntry
- {
- WORD XBoxButton;
- Q3DStudio::INT32 button;
- } buttonMap[] = {
- { XINPUT_GAMEPAD_START, Q3DStudio::BUTTON_START },
- { XINPUT_GAMEPAD_BACK, Q3DStudio::BUTTON_SELECT },
- { XINPUT_GAMEPAD_LEFT_THUMB, Q3DStudio::BUTTON_THUMBL },
- { XINPUT_GAMEPAD_RIGHT_THUMB, Q3DStudio::BUTTON_THUMBR },
- { XINPUT_GAMEPAD_LEFT_SHOULDER, Q3DStudio::BUTTON_L1 },
- { XINPUT_GAMEPAD_RIGHT_SHOULDER, Q3DStudio::BUTTON_R1 },
- { XINPUT_GAMEPAD_A, Q3DStudio::BUTTON_A },
- { XINPUT_GAMEPAD_B, Q3DStudio::BUTTON_B },
- { XINPUT_GAMEPAD_X, Q3DStudio::BUTTON_X },
- { XINPUT_GAMEPAD_Y, Q3DStudio::BUTTON_Y } };
-
- static DWORD userLastPacketNumber[MAX_USERS] = { 0 };
- static WORD userLastButtons[MAX_USERS] = { 0 };
-
- Q3DStudio::CInputEngine *input = inView.GetInputEngine();
- if (input != NULL && library.GetState) {
- // for each controller
- for (DWORD userIndex = 0; userIndex < MAX_USERS; ++userIndex) {
- DWORD &lastPacketNumber = userLastPacketNumber[userIndex];
- WORD &lastButtons = userLastButtons[userIndex];
-
- // get the state
- XINPUT_STATE state = { 0 };
- if (library.GetState(userIndex, &state) == ERROR_SUCCESS
- && state.dwPacketNumber != lastPacketNumber) {
- using namespace Q3DStudio;
- const XINPUT_GAMEPAD &gamepad = state.Gamepad;
- const WORD &buttons = gamepad.wButtons;
-
- // handle button changes
- DWORD buttonChanges = buttons ^ lastButtons;
- for (size_t buttonMapIndex = 0;
- buttonMapIndex < sizeof(buttonMap) / sizeof(buttonMap[0]); ++buttonMapIndex) {
- const ButtonEntry &buttonEntry = buttonMap[buttonMapIndex];
- if (buttonEntry.XBoxButton & buttonChanges) {
- input->HandleButton(buttonEntry.button,
- buttons & buttonEntry.XBoxButton);
- }
- }
-
- // handle gamepad
- if (buttons & XINPUT_GAMEPAD_DPAD_LEFT)
- input->HandleAxis(AXIS_HAT_X, -1);
- else if (buttons & XINPUT_GAMEPAD_DPAD_RIGHT)
- input->HandleAxis(AXIS_HAT_X, 1);
- else
- input->HandleAxis(AXIS_HAT_X, 0);
- if (buttons & XINPUT_GAMEPAD_DPAD_UP)
- input->HandleAxis(AXIS_HAT_Y, -1);
- else if (buttons & XINPUT_GAMEPAD_DPAD_DOWN)
- input->HandleAxis(AXIS_HAT_Y, 1);
- else
- input->HandleAxis(AXIS_HAT_Y, 0);
-
- // handle sticks and triggers
- input->HandleAxis(AXIS_X, gamepad.sThumbLX / STICK_RANGE);
- input->HandleAxis(AXIS_Y, gamepad.sThumbLY / -STICK_RANGE);
- input->HandleAxis(AXIS_Z, gamepad.sThumbRX / STICK_RANGE);
- input->HandleAxis(AXIS_RZ, gamepad.sThumbRY / -STICK_RANGE);
- input->HandleAxis(AXIS_LTRIGGER, gamepad.bLeftTrigger / TRIGGER_RANGE);
- input->HandleAxis(AXIS_RTRIGGER, gamepad.bRightTrigger / TRIGGER_RANGE);
-
- // save the state
- lastButtons = buttons;
- lastPacketNumber = state.dwPacketNumber;
- }
- }
- }
-}
-#endif
-
-using namespace Q3DStudio;
-
-struct WindowRect
-{
- int x;
- int y;
- int width;
- int height;
-};
-
-void PerfLogSetStringData(const char *)
-{
-} // Dummy defination when TCP perf logging isnt used
-
-Q3DStudio::Qt3DSFNDTimer g_GlobalTimeProvider;
-
-qint64 GetTimeUST()
-{
- // this needs to be nano seconds
- Q3DStudio::ITimeProvider &theTimer = g_GlobalTimeProvider;
- return theTimer.GetCurrentTimeMicroSeconds() * 1000;
-}
-
-void initResource() {
- // init runtime static resources
- Q_INIT_RESOURCE(res);
-}
-
-namespace Q3DSViewer {
-
-struct SWindowSystemImpl : public Q3DStudio::IWindowSystem
-{
- QSize m_size;
- int m_OffscreenID;
- int m_DepthBitCount;
-
- QSize GetWindowDimensions() override { return m_size; }
- void SetWindowDimensions(const QSize &inSize) override
- {
- m_size = inSize;
- }
- // For platforms that support it, we get the egl info for render plugins
- // Feel free to return NULL.
- SEGLInfo *GetEGLInfo() override { return nullptr; }
- // on some systems we allow our default render target to be a offscreen buffer
- // otherwise return 0;
- int GetDefaultRenderTargetID() override { return m_OffscreenID; }
- // returns the depth buffer bit count for the render window
- int GetDepthBitCount() override { return m_DepthBitCount; }
-};
-
-class Q3DSViewerAppImpl
-{
-public:
- Q3DSViewerAppImpl(Q3DStudio::IAudioPlayer *inAudioPlayer)
- : m_view(nullptr)
- , m_appInitSuccessful(false)
- , m_AudioPlayer(inAudioPlayer)
- {
-#ifndef EMBEDDED_LINUX
- initResource();
-#endif
- }
- Q3DStudio::IRuntimeView *m_view;
- bool m_appInitSuccessful; ///< true if m_view is initialized successful
-
- std::vector<int> m_mouseButtons;
- Q3DStudio::IWindowSystem *m_WindowSystem;
-
- IAudioPlayer *m_AudioPlayer;
- QVector<QMouseEvent *> m_pendingEvents;
-
- QString m_error;
- qt3dsimp::MeshBuilder *m_meshBuilder = nullptr;
-
- void queueMouseEvent(int button, int pressed, int x, int y)
- {
- QMouseEvent *e = new QMouseEvent(pressed ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease,
- QPointF(x, y), (Qt::MouseButton)button,
- (Qt::MouseButtons)button, 0);
- e->setTimestamp(static_cast<ulong>(GetTimeUST()));
- m_pendingEvents.append(e);
- }
-
- qt3dsimp::Mesh *buildMesh(const Q3DSViewer::MeshData &meshData, QString &error)
- {
- using namespace qt3dsimp;
- using namespace qt3ds::render;
-
- // Do some basic validation of the meshData
- if (meshData.m_vertexBuffer.size() == 0) {
- error = QObject::tr("Vertex buffer empty");
- return nullptr;
- }
- if (meshData.m_attributeCount == 0) {
- error = QObject::tr("No attributes defined");
- return nullptr;
- }
-
- if (!m_meshBuilder)
- m_meshBuilder = &MeshBuilder::CreateMeshBuilder();
- m_meshBuilder->Reset();
- m_meshBuilder->SetDrawParameters(
- static_cast<NVRenderDrawMode::Enum>(meshData.m_primitiveType),
- NVRenderWinding::CounterClockwise);
-
- // The expectation is that the vertex buffer included in meshData is already properly
- // formatted and doesn't need further processing.
-
- // Validate attributes
- QVector<NVRenderVertexBufferEntry> vBufEntries;
- NVRenderComponentTypes::Enum indexBufferComponentType = NVRenderComponentTypes::Unknown;
- int indexBufferTypeSize = 0;
- for (int i = 0; i < meshData.m_attributeCount; ++i) {
- const Q3DSViewer::MeshData::Attribute &att = meshData.m_attributes[i];
- auto componentType = static_cast<NVRenderComponentTypes::Enum>(att.componentType);
- if (att.semantic == Q3DSViewer::MeshData::Attribute::IndexSemantic) {
- indexBufferComponentType = componentType;
- indexBufferTypeSize = att.typeSize();
- } else {
- const char *name = nullptr;
- switch (att.semantic) {
- case MeshData::Attribute::PositionSemantic:
- name = Mesh::GetPositionAttrName();
- break;
- case MeshData::Attribute::NormalSemantic:
- name = Mesh::GetNormalAttrName();
- break;
- case MeshData::Attribute::TexCoordSemantic:
- name = Mesh::GetUVAttrName();
- break;
- case MeshData::Attribute::TangentSemantic:
- name = Mesh::GetTexTanAttrName();
- break;
- case MeshData::Attribute::BinormalSemantic:
- name = Mesh::GetTexBinormalAttrName();
- break;
- default:
- error = QObject::tr("Warning: Invalid attribute semantic: %1")
- .arg(att.semantic);
- return nullptr;
- }
- vBufEntries << NVRenderVertexBufferEntry(name, componentType,
- QT3DSU32(att.componentCount()),
- QT3DSU32(att.offset));
- }
- }
- m_meshBuilder->SetVertexBuffer(
- toConstDataRef(reinterpret_cast<const NVRenderVertexBufferEntry *>(
- vBufEntries.constData()), QT3DSU32(vBufEntries.count())),
- QT3DSU32(meshData.m_stride),
- toConstDataRef(const_cast<QT3DSU8 *>(reinterpret_cast<const QT3DSU8 *>(
- meshData.m_vertexBuffer.constData())),
- QT3DSU32(meshData.m_vertexBuffer.size())));
-
- int vertexCount = 0;
- if (indexBufferComponentType != NVRenderComponentTypes::Unknown) {
- m_meshBuilder->SetIndexBuffer(
- toConstDataRef(const_cast<QT3DSU8 *>(reinterpret_cast<const QT3DSU8 *>(
- meshData.m_indexBuffer.constData())),
- QT3DSU32(meshData.m_indexBuffer.size())),
- indexBufferComponentType);
- vertexCount = meshData.m_indexBuffer.size() / indexBufferTypeSize;
- } else {
- vertexCount = meshData.m_vertexBuffer.size() / meshData.m_stride;
- }
-
- m_meshBuilder->AddMeshSubset(Mesh::s_DefaultName, QT3DSU32(vertexCount));
-
- return &m_meshBuilder->GetMesh();
- }
-};
-
-///< @brief contructor
-Q3DSViewerApp::Q3DSViewerApp(void *glContext, Q3DStudio::IAudioPlayer *inAudioPlayer,
- QElapsedTimer *startupTimer)
- : m_Impl(*new Q3DSViewerAppImpl(inAudioPlayer))
- , m_startupTimer(startupTimer)
-{
- Q_UNUSED(glContext)
- m_Impl.m_WindowSystem = new SWindowSystemImpl();
-}
-
-///< @brief destructor
-Q3DSViewerApp::~Q3DSViewerApp()
-{
- qDeleteAll(m_Impl.m_pendingEvents);
-
- if (m_Impl.m_meshBuilder)
- m_Impl.m_meshBuilder->Release();
-
- delete m_Impl.m_AudioPlayer;
-
- if (m_Impl.m_view) {
- disconnect(m_Impl.m_view->signalProxy(), nullptr);
-
- m_Impl.m_view->Cleanup();
- m_Impl.m_view->release();
-
- if (GetMemoryManager().GetLineTracker())
- GetMemoryManager().GetLineTracker()->Report();
-
- GetMemoryManager().Release();
- }
- delete static_cast<SWindowSystemImpl *>(m_Impl.m_WindowSystem);
-}
-
-void Q3DSViewerApp::setOffscreenId(int offscreenID)
-{
- static_cast<SWindowSystemImpl *>(m_Impl.m_WindowSystem)->m_OffscreenID
- = offscreenID;
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine())
- m_Impl.m_view->GetTegraRenderEngine()->ensureRenderTarget();
-}
-
-bool Q3DSViewerApp::InitializeApp(int winWidth, int winHeight, const QSurfaceFormat &format,
- int offscreenID, const QString &source,
- const QStringList &variantList,
- bool delayedLoading,
- qt3ds::Qt3DSAssetVisitor *assetVisitor)
-{
- bool hasValidPresentationFile = !source.isEmpty();
-
- QFileInfo info(source);
- if (!info.exists()) {
- m_Impl.m_error
- = QObject::tr("Failed to initialize viewer, presentation doesn't exist");
- qCritical() << m_Impl.m_error;
- return false;
- }
-
- m_Impl.m_WindowSystem->SetWindowDimensions(QSize(winWidth, winHeight));
-
- // create our internal application
- if (hasValidPresentationFile && !m_Impl.m_view) {
- static_cast<SWindowSystemImpl *>(m_Impl.m_WindowSystem)->m_OffscreenID = offscreenID;
- static_cast<SWindowSystemImpl *>(m_Impl.m_WindowSystem)->m_DepthBitCount
- = format.depthBufferSize();
-
- // create internal app
- m_Impl.m_view = &IRuntimeView::Create(g_GlobalTimeProvider, *m_Impl.m_WindowSystem,
- m_Impl.m_AudioPlayer, m_startupTimer);
-
- if (assetVisitor)
- m_Impl.m_view->setAssetVisitor(assetVisitor);
-
- m_Impl.m_appInitSuccessful = m_Impl.m_view->BeginLoad(source, variantList);
-
- if (m_Impl.m_appInitSuccessful == false) {
- m_Impl.m_error = QObject::tr("Viewer launch failure! Failed to load: '%1'").arg(source);
- m_Impl.m_error.append("\n");
- qCritical() << m_Impl.m_error;
- return false;
- }
-
- bool success = m_Impl.m_view->InitializeGraphics(format, delayedLoading);
- if (!success) {
- m_Impl.m_error = QObject::tr("Viewer launch failure! Failed to load: '%1'").arg(source);
- m_Impl.m_error.append("\n");
- qCritical() << m_Impl.m_error;
- return false;
- }
-
- // Connect signals
- connect(m_Impl.m_view->signalProxy(),
- &QRuntimeViewSignalProxy::SigSlideEntered, this, &Q3DSViewerApp::SigSlideEntered);
- connect(m_Impl.m_view->signalProxy(),
- &QRuntimeViewSignalProxy::SigSlideExited, this, &Q3DSViewerApp::SigSlideExited);
- connect(m_Impl.m_view->signalProxy(),
- &QRuntimeViewSignalProxy::SigCustomSignal, this, &Q3DSViewerApp::SigCustomSignal);
- connect(m_Impl.m_view->signalProxy(), &QRuntimeViewSignalProxy::SigDataOutputValueUpdated,
- this, &Q3DSViewerApp::SigDataOutputValueUpdated);
- QMetaObject::Connection *presReadyconn = new QMetaObject::Connection();
- *presReadyconn = connect(m_Impl.m_view->signalProxy(),
- &QRuntimeViewSignalProxy::SigPresentationReady, [&, presReadyconn]{
- // We receive presentation ready signal from runtime when animations and properties
- // have been updated.
- Q_EMIT SigPresentationReady();
- disconnect(*presReadyconn);
- delete presReadyconn;
- });
- connect(m_Impl.m_view->signalProxy(), &QRuntimeViewSignalProxy::SigElementsCreated, this,
- &Q3DSViewerApp::SigElementsCreated);
- connect(m_Impl.m_view->signalProxy(), &QRuntimeViewSignalProxy::SigMaterialsCreated, this,
- &Q3DSViewerApp::SigMaterialsCreated);
-
- Resize(winWidth, winHeight);
-
- Q_EMIT SigPresentationLoaded();
- }
- return true;
-}
-
-bool Q3DSViewerApp::IsInitialised(void)
-{
- return m_Impl.m_view != nullptr && m_Impl.m_appInitSuccessful;
-}
-
-int Q3DSViewerApp::GetWindowHeight()
-{
- return m_Impl.m_WindowSystem->GetWindowDimensions().width();
-}
-
-int Q3DSViewerApp::GetWindowWidth()
-{
- return m_Impl.m_WindowSystem->GetWindowDimensions().height();
-}
-
-void Q3DSViewerApp::setupSearchPath(std::vector<std::string> &cmdLineArgs)
-{
- // setup some additional search path
- // index 0 contains the module directory
-#ifdef _MACOSX
- char buf[2056];
- uint32_t bufsize = 2056;
- _NSGetExecutablePath(buf, &bufsize);
- std::string theModuleDirectory = buf;
-#else
- std::string theModuleDirectory = cmdLineArgs[0];
-#endif
- std::string::size_type pos = theModuleDirectory.rfind('\\');
- if (pos == std::string::npos)
- pos = theModuleDirectory.rfind('/');
-
- // Include the slash
- theModuleDirectory = theModuleDirectory.substr(0, pos + 1);
-
- // TODO: Search path needs to be set up properly
- //NvFAppendSearchPath(theModuleDirectory.c_str());
-}
-
-void Q3DSViewerApp::Render()
-{
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine()) {
- if (m_Impl.m_appInitSuccessful) {
- for (QEvent *e : m_Impl.m_pendingEvents) {
- m_Impl.m_view->HandleMessage(e);
- delete e;
- }
- m_Impl.m_pendingEvents.clear();
-#ifdef WIN32
- HandleController(*m_Impl.m_view);
-#endif
-
- m_Impl.m_view->Render();
- }
- }
-}
-
-void Q3DSViewerApp::SaveState()
-{
- if (!m_Impl.m_view)
- return;
-
- if (m_Impl.m_view->GetTegraRenderEngine()) {
- ITegraRenderStateManager &manager =
- m_Impl.m_view->GetTegraRenderEngine()->GetTegraRenderStateManager();
-
- manager.SaveAllState();
- }
-}
-
-void Q3DSViewerApp::RestoreState()
-{
- if (!m_Impl.m_view)
- return;
-
- if (m_Impl.m_view->GetTegraRenderEngine()) {
- ITegraRenderStateManager &manager =
- m_Impl.m_view->GetTegraRenderEngine()->GetTegraRenderStateManager();
-
- manager.RestoreAllState();
- }
-}
-
-bool Q3DSViewerApp::WasLastFrameDirty()
-{
- if (m_Impl.m_view)
- return m_Impl.m_view->WasLastFrameDirty();
- return false;
-}
-
-QString Q3DSViewerApp::error()
-{
- QString error = m_Impl.m_error;
- m_Impl.m_error.clear();
- return error;
-}
-
-void Q3DSViewerApp::setDelayedLoading(bool enable)
-{
- if (!m_Impl.m_view)
- return;
- m_Impl.m_view->setDelayedLoading(enable);
-}
-
-void Q3DSViewerApp::preloadSlide(const QString &slide)
-{
- if (!m_Impl.m_view)
- return;
- m_Impl.m_view->preloadSlide(slide);
-}
-
-void Q3DSViewerApp::unloadSlide(const QString &slide)
-{
- if (!m_Impl.m_view)
- return;
- m_Impl.m_view->unloadSlide(slide);
-}
-
-void Q3DSViewerApp::Resize(int width, int height)
-{
- QSize oldSize = m_Impl.m_WindowSystem->GetWindowDimensions();
- QSize newSize(width, height);
- m_Impl.m_WindowSystem->SetWindowDimensions(newSize);
-
- if (m_Impl.m_appInitSuccessful && m_Impl.m_view
- && m_Impl.m_view->GetTegraRenderEngine()) {
- QResizeEvent event = QResizeEvent(newSize, oldSize);
- m_Impl.m_view->HandleMessage(&event);
- }
-}
-
-void Q3DSViewerApp::HandleKeyInput(Q3DStudio::EKeyCode inKeyCode, bool isPressed)
-{
- if (!m_Impl.m_view || inKeyCode == Q3DStudio::KEY_NOKEY)
- return;
-
- CInputEngine *input = m_Impl.m_view->GetInputEngine();
- if (input)
- input->HandleKeyboard(inKeyCode, isPressed);
-}
-
-void Q3DSViewerApp::HandleMouseMove(int x, int y, bool isPressed)
-{
- if (!m_Impl.m_view)
- return;
-
- CInputEngine *input = m_Impl.m_view->GetInputEngine();
- if (input) {
- input->BeginPickInput();
- input->EndPickInput();
- input->SetPickInput(static_cast<Q3DStudio::FLOAT>(x), static_cast<Q3DStudio::FLOAT>(y),
- isPressed);
- }
-
-}
-
-void Q3DSViewerApp::HandleMousePress(int x, int y, int mouseButton, bool isPressed)
-{
- if (!m_Impl.m_view)
- return;
-
- bool hasButton
- = std::find(m_Impl.m_mouseButtons.begin(), m_Impl.m_mouseButtons.end(), mouseButton)
- != m_Impl.m_mouseButtons.end();
-
- if ((mouseButton == 1 || mouseButton == 2)) {
- // We keep track of the mouse presses because there are situations where the application
- // will not give us a mouse
- // up for each mouse down. This ameleorates the effects of those slightly misbehaving
- // applications.
- if (isPressed == hasButton) {
- bool localIsPressed = !isPressed;
- // Slightly recursive call in order to handle situations where we aren't getting
- // the mouse up with the corresponding mouse down or vice versa.
- HandleMousePress(x, y, mouseButton, localIsPressed);
- HandleMousePress(x, y, mouseButton, isPressed);
- } else {
- if (isPressed) {
- m_Impl.m_mouseButtons.push_back(mouseButton);
- qCInfo(qt3ds::TRACE_INFO)
- << "ViewerApp: Mouse down of frame "
- << m_Impl.m_view->GetFrameCount();
- } else {
- m_Impl.m_mouseButtons.erase(std::remove(m_Impl.m_mouseButtons.begin(),
- m_Impl.m_mouseButtons.end(), mouseButton),
- m_Impl.m_mouseButtons.end());
- }
-
- CInputEngine *input = m_Impl.m_view->GetInputEngine();
-
- if (input) {
- input->BeginPickInput();
- input->SetPickInput(static_cast<Q3DStudio::FLOAT>(x),
- static_cast<Q3DStudio::FLOAT>(y), isPressed);
- input->EndPickInput();
-
- m_Impl.queueMouseEvent(mouseButton, isPressed ? 1 : 0, x, y);
- }
- }
- }
-}
-
-void Q3DSViewerApp::HandleMouseWheel(int x, int y, int orientation, int numSteps)
-{
- if (!m_Impl.m_view)
- return;
-
- CInputEngine *input = m_Impl.m_view->GetInputEngine();
- if (input) {
- input->SetPickInput(static_cast<Q3DStudio::FLOAT>(x), static_cast<Q3DStudio::FLOAT>(y), 0);
- input->SetScrollValue(orientation == 0 ? VSCROLLWHEEL : HSCROLLWHEEL, numSteps);
- }
-}
-
-void Q3DSViewerApp::GoToSlideByName(const char *elementPath, const char *slideName)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->GoToSlideByName(elementPath, slideName);
-}
-
-void Q3DSViewerApp::GoToSlideByIndex(const char *elementPath, const int slideIndex)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->GoToSlideByIndex(elementPath, slideIndex);
-}
-
-void Q3DSViewerApp::GoToSlideRelative(const char *elementPath, const bool next, const bool wrap)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->GoToSlideRelative(elementPath, next, wrap);
-}
-
-bool Q3DSViewerApp::GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName)
-{
- if (!m_Impl.m_view)
- return false;
-
- return m_Impl.m_view->GetSlideInfo(elementPath, currentIndex, previousIndex,
- currentName, previousName);
-}
-
-void Q3DSViewerApp::SetPresentationActive(const char *presId, const bool active)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->SetPresentationAttribute(presId, nullptr, active ? "True" : "False");
-}
-
-void Q3DSViewerApp::GoToTime(const char *elementPath, const float time)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->GoToTime(elementPath, time);
-}
-
-void Q3DSViewerApp::PlaySoundFile(const char *soundPath)
-{
- if (!m_Impl.m_AudioPlayer || !soundPath)
- return;
-
- m_Impl.m_AudioPlayer->PlaySoundFile(soundPath);
-}
-
-void Q3DSViewerApp::SetAttribute(const char *elementPath, const char *attributeName,
- const char *value)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->SetAttribute(elementPath, attributeName, value);
-}
-
-bool Q3DSViewerApp::GetAttribute(const char *elementPath, const char *attributeName, void *value)
-{
- if (!m_Impl.m_view)
- return false;
-
- return m_Impl.m_view->GetAttribute(elementPath, attributeName, value);
-}
-
-void Q3DSViewerApp::FireEvent(const char *elementPath, const char *evtName)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->FireEvent(elementPath, evtName);
-}
-
-bool Q3DSViewerApp::PeekCustomAction(std::string &outElementPath, std::string &outActionName)
-{
- if (!m_Impl.m_view)
- return false;
-
- char *theElementPath = nullptr;
- char *theActioName = nullptr;
- bool retVal = m_Impl.m_view->PeekCustomAction(theElementPath, theActioName);
-
- if (theElementPath)
- outElementPath = theElementPath;
- if (theActioName)
- outActionName = theActioName;
-
- return retVal;
-}
-
-bool Q3DSViewerApp::RegisterScriptCallback(ViewerCallbackType::Enum inCallbackType,
- const qml_Function inCallback, void *inUserData)
-{
- if (!m_Impl.m_view)
- return false;
-
- // convert to int
- int callbackType = 0;
- if (inCallbackType == Q3DSViewer::ViewerCallbackType::CALLBACK_ON_INIT)
- callbackType = 1;
- else if (inCallbackType == Q3DSViewer::ViewerCallbackType::CALLBACK_ON_UPDATE)
- callbackType = 2;
- else
- return false;
-
- bool retVal = m_Impl.m_view->RegisterScriptCallback(callbackType, inCallback, inUserData);
-
- return retVal;
-}
-
-void Q3DSViewerApp::SetScaleMode(ViewerScaleModes::Enum inScale)
-{
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine()) {
- m_Impl.m_view->GetTegraRenderEngine()->SetScaleMode(
- static_cast<TegraRenderScaleModes::Enum>(inScale));
- }
-}
-
-ViewerScaleModes::Enum Q3DSViewerApp::GetScaleMode()
-{
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine()) {
- return static_cast<ViewerScaleModes::Enum>(
- m_Impl.m_view->GetTegraRenderEngine()->GetScaleMode());
- }
-
- return ViewerScaleModes::ExactSize;
-}
-
-void Q3DSViewerApp::setMatteColor(const QColor &color)
-{
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine()) {
- m_Impl.m_view->GetTegraRenderEngine()->SetMatteColor(
- qt3ds::QT3DSVec4(color.redF(), color.greenF(),
- color.blueF(), color.alphaF()));
- }
-}
-
-void Q3DSViewerApp::setShowOnScreenStats(bool inShow)
-{
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine())
- m_Impl.m_view->showOnScreenStats(inShow);
-}
-
-void Q3DSViewerApp::SetShadeMode(ViewerShadeModes::Enum inShadeMode)
-{
- if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine()) {
- StaticAssert<ViewerShadeModes::Shaded == TegraRenderShadeModes::Shaded>::valid_expression();
- StaticAssert<ViewerShadeModes::ShadedWireframe
- == TegraRenderShadeModes::ShadedWireframe>::valid_expression();
- StaticAssert<ViewerShadeModes::Wireframe
- == TegraRenderShadeModes::Wireframe>::valid_expression();
-
- m_Impl.m_view->GetTegraRenderEngine()->SetShadeMode(
- static_cast<TegraRenderShadeModes::Enum>(inShadeMode));
- }
-}
-
-void Q3DSViewerApp::SetGlobalAnimationTime(qint64 inMilliSecs)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->SetGlobalAnimationTime(inMilliSecs);
-}
-
-void Q3DSViewerApp::SetDataInputValue(
- const QString &name, const QVariant &value, qt3ds::runtime::DataInputValueRole valueRole)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->SetDataInputValue(name, value, int(valueRole));
-}
-
-void Q3DSViewerApp::setPresentationId(const QString &id)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->setPresentationId(id);
-}
-
-QList<QString> Q3DSViewerApp::dataInputs() const
-{
- if (!m_Impl.m_view)
- return {};
-
- return m_Impl.m_view->dataInputs();
-}
-
-QList<QString> Q3DSViewerApp::dataOutputs() const
-{
- if (!m_Impl.m_view)
- return {};
-
- return m_Impl.m_view->dataOutputs();
-}
-
-float Q3DSViewerApp::dataInputMax(const QString &name) const
-{
- if (!m_Impl.m_view)
- return 0.0f;
-
- return m_Impl.m_view->dataInputMax(name);
-}
-
-float Q3DSViewerApp::dataInputMin(const QString &name) const
-{
- if (!m_Impl.m_view)
- return 0.0f;
-
- return m_Impl.m_view->dataInputMin(name);
-}
-
-void Q3DSViewerApp::createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->createElements(parentElementPath, slideName, properties);
-}
-
-void Q3DSViewerApp::deleteElements(const QStringList &elementPaths)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->deleteElements(elementPaths);
-}
-
-void Q3DSViewerApp::createMaterials(const QString &elementPath,
- const QStringList &materialDefinitions)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->createMaterials(elementPath, materialDefinitions);
-}
-
-void Q3DSViewerApp::deleteMaterials(const QString &elementPath, const QStringList &materialNames)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->deleteMaterials(elementPath, materialNames);
-}
-
-void Q3DSViewerApp::createMeshes(const QHash<QString, Q3DSViewer::MeshData> &meshData)
-{
- if (!m_Impl.m_view)
- return;
-
- QString error;
- QHashIterator<QString, Q3DSViewer::MeshData> dataIter(meshData);
- while (dataIter.hasNext()) {
- dataIter.next();
- // Mesh creation needs to be done one by one, as Mesh pointers are not valid
- // after builder is reused
- qt3dsimp::Mesh *mesh = m_Impl.buildMesh(dataIter.value(), error);
- if (mesh) {
- m_Impl.m_view->createMesh(dataIter.key(), mesh);
- } else {
- QString errorMsg = QObject::tr("Creating mesh '%1' failed: %2")
- .arg(dataIter.key()).arg(error);
- qWarning() << __FUNCTION__ << errorMsg;
- SigMeshesCreated(meshData.keys(), error);
- return;
- }
- }
- m_Impl.m_meshBuilder->Reset();
- SigMeshesCreated(meshData.keys(), error);
-}
-
-void Q3DSViewerApp::deleteMeshes(const QStringList &meshNames)
-{
- if (!m_Impl.m_view)
- return;
-
- m_Impl.m_view->deleteMeshes(meshNames);
-}
-
-Q3DSViewerApp &Q3DSViewerApp::Create(void *glContext, Q3DStudio::IAudioPlayer *inAudioPlayer,
- QElapsedTimer *startupTimer)
-{
- return *Q3DStudio_virtual_new(Q3DSViewerApp) Q3DSViewerApp(glContext, inAudioPlayer,
- startupTimer);
-}
-
-void Q3DSViewerApp::Release()
-{
- Q3DStudio_virtual_delete(this, Q3DSViewerApp);
-}
-
-} // end namespace
diff --git a/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.h b/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.h
deleted file mode 100644
index 975e3b12..00000000
--- a/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerApp.h
+++ /dev/null
@@ -1,524 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 - 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_VIEWER_H
-#define QT3DS_VIEWER_H
-
-#include "qt3dsruntimeglobal.h"
-#include "Qt3DSApplication.h"
-#include "Qt3DSInputDefs.h"
-
-#include <string>
-#include <vector>
-#include <QObject>
-#include <QtCore/qelapsedtimer.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qstringlist.h>
-#include <QtGui/qsurfaceformat.h>
-
-namespace Q3DStudio {
-class IRuntimeView;
-class IWindowSystem;
-class IAudioPlayer;
-}
-
-namespace qt3ds {
-class Qt3DSAssetVisitor
-{
-public:
- virtual void visit(const char *path) = 0;
- virtual void visit(const char *type, const char *id, const char *src, const char *args) = 0;
-};
-}
-
-namespace Q3DSViewer {
-
-typedef void (*qml_Function)(void *inUserData);
-
-// not must match the NDDRuntime see
-// UICQmlEngine.h
-struct ViewerCallbackType
-{
- enum Enum {
- CALLBACK_ON_INIT = 1,
- CALLBACK_ON_UPDATE = 2,
- };
-};
-
-struct ViewerContextType
-{
- enum Enum { GL_ES2 = 0, GL_ES3, GL_ES31, GL_ES32, GL_2, GL_3_3, GL_4 };
-};
-
-struct ViewerScaleModes
-{
- enum Enum {
- ExactSize = 0, // Ensure the viewport is exactly same size as application
- ScaleToFit = 1, // Resize viewport keeping aspect ratio
- ScaleToFill = 2, // Resize viewport to entire window
- };
-};
-
-struct ViewerShadeModes
-{
- enum Enum {
- Shaded = 0, // Geometry is shaded only
- ShadedWireframe = 1, // Wireframe is drawn on top shaded geometry
- Wireframe = 2, // Wireframe only
- };
-};
-
-// Intermediate struct to transfer mesh data between studio3d module and runtime
-struct MeshData
-{
- // All enums must match the ones defined by Q3DSGeometry class in studio3d module
- enum PrimitiveType { // Must match also internal NVRenderDrawMode
- UnknownType = 0,
- Points,
- LineStrip,
- LineLoop,
- Lines,
- TriangleStrip,
- TriangleFan,
- Triangles, // Default primitive type
- Patches
- };
-
- struct Attribute {
- enum Semantic {
- UnknownSemantic = 0,
- IndexSemantic,
- PositionSemantic, // attr_pos
- NormalSemantic, // attr_norm
- TexCoordSemantic, // attr_uv0
- TangentSemantic, // attr_textan
- BinormalSemantic // attr_binormal
- };
- enum ComponentType { // Must match also internal NVRenderComponentTypes
- DefaultType = 0,
- U8Type,
- I8Type,
- U16Type,
- I16Type,
- U32Type, // Default for IndexSemantic
- I32Type,
- U64Type,
- I64Type,
- F16Type,
- F32Type, // Default for other semantics
- F64Type
- };
-
- int typeSize() const
- {
- switch (componentType) {
- case U8Type: return 1;
- case I8Type: return 1;
- case U16Type: return 2;
- case I16Type: return 2;
- case U32Type: return 4;
- case I32Type: return 4;
- case U64Type: return 8;
- case I64Type: return 8;
- case F16Type: return 2;
- case F32Type: return 4;
- case F64Type: return 8;
- default:
- Q_ASSERT(false);
- return 0;
- }
- }
-
- int componentCount() const
- {
- switch (semantic) {
- case IndexSemantic: return 1;
- case PositionSemantic: return 3;
- case NormalSemantic: return 3;
- case TexCoordSemantic: return 2;
- case TangentSemantic: return 3;
- case BinormalSemantic: return 3;
- default:
- Q_ASSERT(false);
- return 0;
- }
- }
-
- Semantic semantic = PositionSemantic;
- ComponentType componentType = F32Type;
- int offset = 0;
- };
-
- static const int MAX_ATTRIBUTES = 6;
-
- void clear()
- {
- m_vertexBuffer.clear();
- m_indexBuffer.clear();
- m_attributeCount = 0;
- m_primitiveType = Triangles;
- }
-
- QByteArray m_vertexBuffer;
- QByteArray m_indexBuffer;
-
- Attribute m_attributes[MAX_ATTRIBUTES];
- int m_attributeCount = 0;
- PrimitiveType m_primitiveType = Triangles;
- int m_stride = 0;
-};
-
-class Q3DSViewerAppImpl;
-class QT3DS_RUNTIME_API Q3DSViewerApp : public QObject
-{
- Q_OBJECT
-private:
- Q3DSViewerApp(void *glContext, Q3DStudio::IAudioPlayer *inAudioPlayer,
- QElapsedTimer *startupTimer);
- ~Q3DSViewerApp();
-
-public:
- /**
- * @brief Initialize viewer app
- *
- * @param[in] winWidth window width
- * @param[in] winHeight window height
- * @param[in] format OpenGL API version
- * @param[in] offscreenID ID of an OpenGL FBO we should render to by default
- * @param[in] source string to presentation source
- *
- * @return true on success
- */
- bool InitializeApp(int winWidth, int winHeight, const QSurfaceFormat& format,
- int offscreenID, const QString &source,
- const QStringList &variantList,
- bool delayedLoading,
- qt3ds::Qt3DSAssetVisitor *assetVisitor = nullptr);
-
- bool IsInitialised(void);
- void setOffscreenId(int offscreenID);
-
-
- /*
- * @brief handle window resize
- *
- * @param[in] width new width
- * @param[in] height new size
- *
- * @return no return
- */
- void Resize(int width, int height);
-
- /*
- * @brief does the actual scene rendering
- *
- * @return no return
- */
- void Render();
-
- /*
- * @brief handle keyboard input
- *
- * @param[in] keyEvent event
- * @param[in] isPressed true if key pressed
- *
- * @return no return
- */
- void HandleKeyInput(Q3DStudio::EKeyCode inKeyCode, bool isPressed);
-
- /*
- * @brief handle mouse move input
- *
- * @param[in] x mouse pos x
- * @param[in] y mouse pos y
- * @param[in] mouseButton mouse button id
- * @param[in] isPressed true if key pressed
- *
- * @return no return
- */
- void HandleMouseMove(int x, int y, bool isPressed);
-
- /*
- * @brief handle mouse press events
- *
- * @param[in] x mouse pos x
- * @param[in] y mouse pos y
- * @param[in] mouseButton mouse button id
- * @param[in] isPressed true if key pressed
- *
- * @return no return
- */
- void HandleMousePress(int x, int y, int mouseButton, bool isPressed);
-
- /*
- * @brief handle mouse wheel events
- *
- * @param[in] x mouse pos x
- * @param[in] y mouse pos y
- * @param[in] orientation 0 vertical, 1 horizontal
- * @param[in] numSteps how much the wheel has turned
- *
- * @return no return
- */
- void HandleMouseWheel(int x, int y, int orientation, int numSteps);
-
- /*
- * @brief Scale scene to adjsut to window size regarding width and height
- *
- * @param[in] inScale true if scale false if unscale
- *
- * @return no return
- */
- void SetScaleMode(ViewerScaleModes::Enum inScaleMode);
-
- ViewerScaleModes::Enum GetScaleMode();
-
- void setMatteColor(const QColor &color);
- void setShowOnScreenStats(bool s);
-
- /*
- * @brief Set the shading mode
- *
- * @param[in] inShadeMode the selected shade mode
- *
- * @return no return
- */
- void SetShadeMode(ViewerShadeModes::Enum inShadeMode);
-
- /*
- * @brief Save current render state
- *
- * @return no return
- */
- void SaveState();
- /*
- * @brief Restore current render state
- *
- * @return no return
- */
- void RestoreState();
-
- /// event call back slots
-
- /*
- * @brief Go to a slide by name
- *
- * @param[in] elementPath where to find the element
- * @param[in] slideName slide name
- *
- * @return no return
- */
- void GoToSlideByName(const char *elementPath, const char *slideName);
-
- /*
- * @brief Go to a slide by index
- *
- * @param[in] elementPath where to find the element
- * @param[in] slideIndex slide index
- *
- * @return no return
- */
- void GoToSlideByIndex(const char *elementPath, const int slideIndex);
-
- /*
- * @brief Go to relative slide
- *
- * @param[in] elementPath where to find the element
- * @param[in] next next or previous
- * @param[in] wrap wrap to beginning if end is reached
- *
- * @return no return
- */
- void GoToSlideRelative(const char *elementPath, const bool next, const bool wrap);
-
- bool GetSlideInfo(const char *elementPath, int &currentIndex, int &previousIndex,
- QString &currentName, QString &previousName);
-
- /*
- * @brief Set presentation active or inactive
- *
- * @param[in] presId presentation id (name without .uip)
- * @param[in] active set active or inactive
- *
- * @return no return
- */
- void SetPresentationActive(const char *presId, const bool active);
-
- /*
- * @brief Go to a certain time
- *
- * @param[in] elementPath where to find the element
- * @param[in] time time to move
- *
- * @return no return
- */
- void GoToTime(const char *elementPath, const float time);
-
- /*
- * @brief Play a sound
- *
- * @param[in] soundPath sound file to play
- *
- * @return no return
- */
- void PlaySoundFile(const char *soundPath);
-
- /*
- * @brief Set attribute values
- *
- * @param[in] elementPath where to find the element
- * @param[in] attributeName attribute name
- * @param[in] value new value of the attribute
- *
- * @return no return
- */
- void SetAttribute(const char *elementPath, const char *attributeName, const char *value);
-
- /*
- * @brief Get attribute values
- *
- * @param[in] elementPath where to find the element
- * @param[in] attributeName attribute name
- * @param[out] value current attribute values
- *
- * @return true if successful
- */
- bool GetAttribute(const char *elementPath, const char *attributeName, void *value);
-
- /*
- * @brief Fire an event
- *
- * @param[in] elementPath where to find the element to fire the event on
- * @param[in] evtName the string that identifies and defines the event
- *
- * @return no return
- */
- void FireEvent(const char *elementPath, const char *evtName);
-
- /*
- * @brief Peek a custom action from the queue
- * Note the action is remvoved from the queue
- *
- * @param[out] outElementPath element path
- * @param[out] actionName action name
- *
- * @return true if action available
- */
- bool PeekCustomAction(std::string &outElementPath, std::string &actionName);
-
- /**
- * @brief Register a callback
- *
- * @param[in] callbackType callback type
- * @param[in] inCallback pointer to callback
- * @param[in] inCallback pointer to user data
- *
- * @return true on success
- */
- bool RegisterScriptCallback(ViewerCallbackType::Enum callbackType,
- const qml_Function inCallback, void *inUserData);
-
- bool WasLastFrameDirty();
-
- int GetWindowHeight();
- int GetWindowWidth();
-
- void SetGlobalAnimationTime(qint64 inMilliSecs);
-
- void SetDataInputValue(const QString &name, const QVariant &value,
- qt3ds::runtime::DataInputValueRole valueRole
- = qt3ds::runtime::DataInputValueRole::Value);
-
- QList<QString> dataInputs() const;
- QList<QString> dataOutputs() const;
-
- float dataInputMax(const QString &name) const;
- float dataInputMin(const QString &name) const;
-
- void createElements(const QString &parentElementPath, const QString &slideName,
- const QVector<QHash<QString, QVariant>> &properties);
- void deleteElements(const QStringList &elementPaths);
- void createMaterials(const QString &elementPath, const QStringList &materialDefinitions);
- void deleteMaterials(const QString &elementPath, const QStringList &materialNames);
- void createMeshes(const QHash<QString, Q3DSViewer::MeshData> &meshData);
- void deleteMeshes(const QStringList &meshNames);
-
- QString error();
-
- void setPresentationId(const QString &id);
- void preloadSlide(const QString &slide);
- void unloadSlide(const QString &slide);
- void setDelayedLoading(bool enable);
-
-private:
- /*
- * @brief parse command line arguments this fills in our
- * global command line variables
- *
- * @param[in] cmdLineArgs string to command line parameter
- *
- * @return no return
- */
- void handleCmdLineArguments(std::vector<std::string> &cmdLineArgs);
- /*
- * @brief setup search path.
- * This functions setup additonal search path for resoruces
- *
- * @param[in] cmdLineArgs string to command line parameter
- *
- * @return no return
- */
- void setupSearchPath(std::vector<std::string> &cmdLineArgs);
-
-private:
- Q3DSViewerAppImpl &m_Impl;
- QElapsedTimer *m_startupTimer;
- bool m_presentationReady = false;
-
-public:
- static Q3DSViewerApp &Create(void *glContext, Q3DStudio::IAudioPlayer *inAudioPlayer = nullptr,
- QElapsedTimer *startupTimer = nullptr);
- void Release();
-
-Q_SIGNALS:
- void SigSlideEntered(const QString &elementPath, unsigned int index, const QString &name);
- void SigSlideExited(const QString &elementPath, unsigned int index, const QString &name);
- void SigCustomSignal(const QString &elementPath, const QString &name);
- void SigElementsCreated(const QStringList &elementPaths, const QString &error);
- void SigMaterialsCreated(const QStringList &materialNames, const QString &error);
- void SigMeshesCreated(const QStringList &meshNames, const QString &error);
- void SigDataOutputValueUpdated(const QString &name, const QVariant &newValue);
- void SigPresentationReady();
- void SigPresentationLoaded();
-};
-
-} // end namespace
-
-#endif // QT3DS_VIEWER_H
diff --git a/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerTimer.h b/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerTimer.h
deleted file mode 100644
index de679ce9..00000000
--- a/src/Runtime/ogl-runtime/src/viewer/Qt3DSViewerTimer.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 - 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DS_ELAPSED_TIMER_H
-#define QT3DS_ELAPSED_TIMER_H
-#include <QElapsedTimer>
-
-namespace Q3DSViewer {
-
-///< @brief this class implementes a elapsed timer using QElapsedTimer
-class Qt3DSElapsedTimer
-{
-public:
- QElapsedTimer m_elapsedTimer;
- QElapsedTimer::ClockType m_clockType;
-
- Qt3DSElapsedTimer()
- {
- m_clockType = QElapsedTimer::clockType();
- reset();
- }
-
- void reset() { m_elapsedTimer.start(); }
-
- qint64 getNanoSeconds()
- {
- qint64 time = m_elapsedTimer.nsecsElapsed();
- reset();
- return time;
- }
-};
-
-///< @brief this class implementes a timer using QElapsedTimer
-class Qt3DSTimer
-{
-public:
- QElapsedTimer m_timer;
-
- Qt3DSTimer() { start(); }
-
- void start() { m_timer.start(); }
-
- qint64 getNanoSeconds() { return static_cast<qint64>(m_timer.elapsed() * 1000 * 1000); }
-};
-
-///< @brief this class implementes a circular buffer
-template <typename TDataType, unsigned long TBufferSize = 20>
-struct NumericCircularBuffer
-{
- unsigned long m_TotalNumElements; ///< holds the current number of elements
- unsigned long m_NumElements; ///< restricts the size to TBufferSize and wrappes around
- unsigned long m_NextIndex; ///< next index
- TDataType m_RunningTotal; ///< summed value of all entries
- TDataType m_Elements[TBufferSize]; ///< element buffer
-
- NumericCircularBuffer() { clear(); }
- void clear()
- {
- m_TotalNumElements = 0;
- m_NumElements = 0;
- m_NextIndex = 0;
- m_RunningTotal = 0;
- memset(m_Elements, 0, sizeof(TDataType) * TBufferSize);
- }
-
- void push_back(const TDataType &data)
- {
- if (m_NumElements < TBufferSize)
- ++m_NumElements;
- else
- m_RunningTotal -= m_Elements[m_NextIndex];
- m_RunningTotal += data;
- ++m_TotalNumElements;
- m_Elements[m_NextIndex] = data;
- m_NextIndex = (m_NextIndex + 1) % TBufferSize;
- }
- unsigned long size() const { return m_NumElements; }
- TDataType average() const
- {
- TDataType mySize = ((TDataType)size());
- if (mySize)
- return m_RunningTotal / mySize;
- return 0;
- }
-
- unsigned long getTotalItems() const { return m_TotalNumElements; }
-
- static unsigned long getBufferSize() { return TBufferSize; }
-};
-
-} // end namspace
-
-#endif // QT3DS_ELAPSED_TIMER_H
diff --git a/src/Runtime/ogl-runtime/src/viewer/qt3dsruntimeglobal.h b/src/Runtime/ogl-runtime/src/viewer/qt3dsruntimeglobal.h
deleted file mode 100644
index 6732c85d..00000000
--- a/src/Runtime/ogl-runtime/src/viewer/qt3dsruntimeglobal.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DSRUNTIMEGLOBAL_H
-#define QT3DSRUNTIMEGLOBAL_H
-
-#include <QtCore/QtGlobal>
-
-#ifndef _INTEGRITYPLATFORM
-#if defined QT3DS_RUNTIME_EXPORTS
-#define QT3DS_RUNTIME_API Q_DECL_EXPORT
-#else
-#define QT3DS_RUNTIME_API Q_DECL_IMPORT
-#endif
-#else
-#define QT3DS_RUNTIME_API
-#endif
-
-#endif // QT3DSRUNTIMEGLOBAL_H
diff --git a/src/Runtime/ogl-runtime/testres.qrc b/src/Runtime/ogl-runtime/testres.qrc
deleted file mode 100644
index 7b3c20bc..00000000
--- a/src/Runtime/ogl-runtime/testres.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file alias="aluminium.shader">../../Studio/Content/Material Library/aluminum.shader</file>
- <file alias="asphalt.shader">../../Studio/Content/Material Library/asphalt.shader</file>
- <file alias="concrete.shader">../../Studio/Content/Material Library/concrete.shader</file>
- <file alias="copper.shader">../../Studio/Content/Material Library/copper.shader</file>
- <file alias="porcelain.shader">../../Studio/Content/Material Library/porcelain.shader</file>
- <file alias="simple_glass.shader">../../Studio/Content/Material Library/simple_glass.shader</file>
- <file alias="Desaturate.effect">../../Studio/Content/Effect Library/Desaturate.effect</file>
- <file alias="Gaussian Blur.effect">../../Studio/Content/Effect Library/Gaussian Blur.effect</file>
- <file alias="Sepia.effect">../../Studio/Content/Effect Library/Sepia.effect</file>
- <file alias="Bloom.effect">../../Studio/Content/Effect Library/Bloom.effect</file>
- </qresource>
-</RCC>
diff --git a/src/Runtime/ogl-runtime/tools/attributehashes/AttributeHashes.cpp b/src/Runtime/ogl-runtime/tools/attributehashes/AttributeHashes.cpp
deleted file mode 100644
index b72b0b02..00000000
--- a/src/Runtime/ogl-runtime/tools/attributehashes/AttributeHashes.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1993-2009 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
-
-#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
-#define _WIN32_WINNT \
- 0x0501 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
-//==============================================================================
-// Includes
-//==============================================================================
-#include <stdio.h>
-
-#if defined(_PCPLATFORM) || defined(_TEGRAPLATFORM)
-#include <tchar.h>
-#endif
-
-#include <string.h>
-#include <ctype.h>
-#include <vector>
-#include <fstream>
-#include <string>
-
-#include "Qt3DSConfig.h"
-#include "Qt3DSTypes.h"
-#include "Qt3DSKernelTypes.h"
-#include "Qt3DSHash.h"
-
-//==============================================================================
-// Types
-//==============================================================================
-typedef std::vector<std::string> TStringList;
-
-//==============================================================================
-// Constants
-//==============================================================================
-const char g_Text[] = "Qt3DSAttributeHashes.txt";
-const char g_Include[] = "Qt3DSAttributeHashes.h";
-const char g_Source[] = "Qt3DSAttributeHashes.cpp";
-const char g_TestString[] = "qt.io";
-
-//==============================================================================
-// Globals
-//==============================================================================
-TStringList g_StringList;
-TStringList g_EnumList;
-
-//==============================================================================
-/**
- * Convert a string to an enum entry and write it out
- */
-void WriteEnumEntry(FILE *inDestination, const char *inEnum, const char *inString)
-{
- // Save out the enum
- if (inEnum) {
- // Right justify the value by cutting a string of spaces
- char thePadding[] = " ";
- int theLength = (int)strlen(inEnum);
- theLength = theLength > 30 ? 30 : theLength;
- thePadding[30 - theLength] = '\0';
-
- // "ATTRIBUTE_NAME = 0x04CECA21, // name"
- fprintf(inDestination, " %s = %s0x%08X, // %s\n", inEnum, thePadding,
- Q3DStudio::CHash::HashAttribute(inString), inString);
- } else
- fprintf(inDestination, "\n");
-}
-
-//==============================================================================
-/**
- * Write out the enum section
- */
-void WriteEnum(FILE *inDestination)
-{
- // Enum entry
- fprintf(inDestination, "/// Key for the CElement attribute-value pair\n"
- "enum EAttribute {\n");
-
- // Write all enums
- for (TStringList::size_type theIndex = 0; theIndex < g_EnumList.size(); ++theIndex)
- if (!g_StringList[theIndex].empty())
- WriteEnumEntry(inDestination, g_EnumList[theIndex].c_str(),
- g_StringList[theIndex].c_str());
-
- // Enum Footer
- fprintf(inDestination, "}; // enum EAttribute\n"
- "\n"
- "#define AK_STRING_QT_IO \"%s\"\n",
- g_TestString);
-}
-
-//==============================================================================
-/**
- * Convert strings to enums
- */
-void ProcessEnums()
-{
- // Write all enums
- for (TStringList::iterator theAttribute = g_StringList.begin();
- theAttribute != g_StringList.end(); ++theAttribute) {
- std::string theEnum = std::string("ATTRIBUTE_");
- theEnum += *theAttribute;
-
- // Replace all '.' with '_'
- // Make uppercase
- for (std::string::size_type thePosition = 0; thePosition < theEnum.length();
- ++thePosition) {
- if (theEnum[thePosition] == '.')
- theEnum[thePosition] = '_';
-
- if (theEnum[thePosition] == '\n' || theEnum[thePosition] == '\r')
- theEnum[thePosition] = '\0';
-
- theEnum[thePosition] = static_cast<char>(toupper(theEnum[thePosition]));
- }
-
- g_EnumList.push_back(theEnum);
- }
-}
-
-//==============================================================================
-/**
- * Write out lookup function section
- */
-void WriteLookup(FILE *inDestination)
-{
- // Lookup function entry
- fprintf(inDestination, "\n"
- "\n"
- "/// Function providing reverse hash lookup\n"
- "const char *GetAttributeString(const EAttribute inAttribute)\n"
- "{\n"
- " switch (inAttribute) {\n");
-
- // Write all enums
- for (TStringList::size_type theIndex = 0; theIndex < g_EnumList.size(); ++theIndex)
- if (!g_StringList[theIndex].empty())
- fprintf(inDestination, " case %s: return \"%s\";\n", g_EnumList[theIndex].c_str(),
- g_StringList[theIndex].c_str());
-
- // End function
- fprintf(inDestination,
- " default: {\n"
- " static char s_UnknownHash[16];\n"
- " sprintf(s_UnknownHash, \"(0x%%08X)\", inAttribute);\n"
- " return s_UnknownHash;\n"
- " }\n"
- " }\n"
- "}\n");
-}
-
-//==============================================================================
-/**
- * Single lookup to check new strings
- */
-int SingleLookup(const char *inString)
-{
- fprintf(stdout, "String: %s\n", inString);
- fprintf(stdout, "Hash: 0x%08X\n", Q3DStudio::CHash::HashAttribute(inString));
- return 0;
-}
-
-//==============================================================================
-/**
- * Main function.
- * Open two files, read lines from source and write enum entry to destination.
- */
-int main(int argc, char *argv[])
-{
- // Application notice
- fprintf(
- stdout,
- "AttributeHashes\nConverting a string or a file of strings into enums of hashes...\n\n");
-
- // Checking a single string?
- if (argc > 1)
- return SingleLookup(argv[1]);
-
- // Standard file conversion
- fprintf(stdout, "Input: %s\n", g_Text);
- fprintf(stdout, "Output: %s, %s\n\n", g_Include, g_Source);
-
- // Open source
- std::ifstream theText(g_Text);
- if (!theText) {
- fprintf(stderr, "Failed: Could not input text file, set working directory to "
- "src\\Runtime\\ogl-runtime\\src\\runtime and try again.\n");
- return -1;
- }
-
- // Add all the strings in text file
- while (theText) {
- std::string theLine;
- theText >> theLine;
- g_StringList.push_back(theLine);
- }
- theText.close();
-
- // Add unit test string
- g_StringList.push_back(g_TestString);
-
- // Process all string to enums
- ProcessEnums();
-
- // Open include file
- FILE *theInclude = NULL;
- fopen_s(&theInclude, g_Include, "w");
- if (!theInclude) {
- fprintf(stderr, "Failed: Could not open output include file\n");
- return -1;
- }
-
- const char* theFileHeader =
- "/****************************************************************************\n"
- "**\n"
- "** Copyright (C) 1993-2009 NVIDIA Corporation.\n"
- "** Copyright (C) 2019 The Qt Company Ltd.\n"
- "** Contact: https://www.qt.io/licensing/\n"
- "**\n"
- "** This file is part of Qt 3D Studio.\n"
- "**\n"
- "** $QT_BEGIN_LICENSE:GPL$\n"
- "** Commercial License Usage\n"
- "** Licensees holding valid commercial Qt licenses may use this file in\n"
- "** accordance with the commercial license agreement provided with the\n"
- "** Software or, alternatively, in accordance with the terms contained in\n"
- "** a written agreement between you and The Qt Company. For licensing terms\n"
- "** and conditions see https://www.qt.io/terms-conditions. For further\n"
- "** information use the contact form at https://www.qt.io/contact-us.\n"
- "**\n"
- "** GNU General Public License Usage\n"
- "** Alternatively, this file may be used under the terms of the GNU\n"
- "** General Public License version 3 or (at your option) any later version\n"
- "** approved by the KDE Free Qt Foundation. The licenses are as published by\n"
- "** the Free Software Foundation and appearing in the file LICENSE.GPL3\n"
- "** included in the packaging of this file. Please review the following\n"
- "** information to ensure the GNU General Public License requirements will\n"
- "** be met: https://www.gnu.org/licenses/gpl-3.0.html.\n"
- "**\n"
- "** $QT_END_LICENSE$\n"
- "**\n"
- "****************************************************************************/\n\n";
-
- // Header
- fprintf(theInclude, theFileHeader);
- fprintf(
- theInclude,
- "#pragma once\n"
- "\n"
- "//==============================================================================\n"
- "// Namespace\n"
- "//==============================================================================\n"
- "namespace Q3DStudio {\n"
- "\n"
- "// !!!!! AUTOGENERATED CODE - DO NOT MODIFY MANUALLY !!!!!\n"
- "\n"
- "// Run the AttributeHashes project to regenerate this file from Attributehashes.txt list\n"
- "\n");
-
- WriteEnum(theInclude);
-
- // Footer
- fprintf(theInclude, "\n"
- "/// Function providing reverse hash lookup\n"
- "const char *GetAttributeString(const EAttribute inAttribute);\n"
- "\n"
- "} // namespace Q3DStudio\n"
- "\n");
-
- // Close include
- fclose(theInclude);
-
- // Open source file
- FILE *theSource = NULL;
- fopen_s(&theSource, g_Source, "w");
- if (!theSource) {
- fprintf(stderr, "Failed: Could not open output source file\n");
- return -1;
- }
-
- fprintf(theSource, theFileHeader);
-
- // Source
- fprintf(
- theSource,
- "#include \"RuntimePrefix.h\"\n"
- "\n"
- "//==============================================================================\n"
- "// Includes\n"
- "//==============================================================================\n"
- "#include \"Qt3DSAttributeHashes.h\"\n"
- "\n"
- "//==============================================================================\n"
- "// Namespace\n"
- "//==============================================================================\n"
- "namespace Q3DStudio {\n"
- "\n"
- "// !!!!! AUTOGENERATED CODE - DO NOT MODIFY MANUALLY !!!!!\n"
- "\n"
- "// Run the AttributeHashes project to regenerate this file from Attributehashes.txt list\n"
- "\n");
-
- WriteLookup(theSource);
-
- // Footer
- fprintf(theSource, "\n"
- "} // namespace Q3DStudio\n"
- "\n");
-
- // Close include
- fclose(theSource);
-
- // Completed
- fprintf(stdout, "Completed converting %d string to hashes.\n", int(g_StringList.size()));
- return 0;
-}
diff --git a/src/Runtime/ogl-runtime/tools/attributehashes/attributehashes.pro b/src/Runtime/ogl-runtime/tools/attributehashes/attributehashes.pro
deleted file mode 100644
index 986084e0..00000000
--- a/src/Runtime/ogl-runtime/tools/attributehashes/attributehashes.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = AttributeHashes
-CONFIG += console
-
-win32 {
-LIBS += \
- -lws2_32
-}
-
-include(../../commoninclude.pri)
-
-SOURCES += AttributeHashes.cpp
-
-load(qt_tool)
-
-INSTALLS -= target
diff --git a/src/Runtime/ogl-runtime/tools/tools.pro b/src/Runtime/ogl-runtime/tools/tools.pro
deleted file mode 100644
index 7c62eaea..00000000
--- a/src/Runtime/ogl-runtime/tools/tools.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-
-!boot2qt:!integrity:!qnx {
- SUBDIRS += viewer
-}
-
-win32 {
- SUBDIRS += attributehashes
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/Viewer.qrc b/src/Runtime/ogl-runtime/tools/viewer/Viewer.qrc
deleted file mode 100644
index c808dca5..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/Viewer.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file alias="images/arrow.png">resources/images/arrow.png</file>
- <file alias="images/arrow@2x.png">resources/images/arrow@2x.png</file>
- <file alias="images/check.png">resources/images/check.png</file>
- <file alias="images/check@2x.png">resources/images/check@2x.png</file>
- <file>qml/main.qml</file>
- <file>qml/StyledMenu.qml</file>
- <file>qml/StyledMenuButton.qml</file>
- <file>qml/StyledMenuItem.qml</file>
- <file>qml/StyledMenuSeparator.qml</file>
- <file>qml/StyledButton.qml</file>
- </qresource>
-</RCC>
diff --git a/src/Runtime/ogl-runtime/tools/viewer/android/AndroidManifest.xml b/src/Runtime/ogl-runtime/tools/viewer/android/AndroidManifest.xml
deleted file mode 100644
index 3697a9a7..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/android/AndroidManifest.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0"?>
-<manifest package="org.qtproject.qt3dviewer" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.1" android:versionCode="1" android:installLocation="auto">
- <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:icon="@drawable/icon">
- <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleTop">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
-
- <!-- Application arguments -->
- <!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
- <!-- Application arguments -->
-
- <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
- <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
- <meta-data android:name="android.app.repository" android:value="default"/>
- <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
- <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
- <!-- Deploy Qt libs as part of package -->
- <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
- <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
- <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
- <!-- Run with local libs -->
- <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
- <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
- <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
- <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
- <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
- <!-- Messages maps -->
- <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
- <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
- <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
- <!-- Messages maps -->
-
- <!-- Splash screen -->
- <!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
- <!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
- <!-- Splash screen -->
-
- <!-- Background running -->
- <!-- Warning: changing this value to true may cause unexpected crashes if the
- application still try to draw after
- "applicationStateChanged(Qt::ApplicationSuspended)"
- signal is sent! -->
- <meta-data android:name="android.app.background_running" android:value="false"/>
- <!-- Background running -->
-
- <!-- auto screen scale factor -->
- <meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
- <!-- auto screen scale factor -->
-
- <!-- extract android style -->
- <!-- available android:values :
- * full - useful QWidget & Quick Controls 1 apps
- * minimal - useful for Quick Controls 2 apps, it is much faster than "full"
- * none - useful for apps that don't use any of the above Qt modules
- -->
- <meta-data android:name="android.app.extract_android_style" android:value="full"/>
- <!-- extract android style -->
- </activity>
-
- <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
-
- </application>
-
- <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
- <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
-
- <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
- Remove the comment if you do not require these default permissions. -->
- <!-- %%INSERT_PERMISSIONS -->
-
- <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
- Remove the comment if you do not require these default features. -->
- <!-- %%INSERT_FEATURES -->
-
-</manifest>
diff --git a/src/Runtime/ogl-runtime/tools/viewer/main.cpp b/src/Runtime/ogl-runtime/tools/viewer/main.cpp
deleted file mode 100644
index 12abd3b2..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/main.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 - 2016 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "viewer.h"
-
-#include <QtGui/qguiapplication.h>
-#include <QtGui/qtouchdevice.h>
-#include <QtGui/qscreen.h>
-#include <QtCore/qcommandlineparser.h>
-#include <QtCore/qfile.h>
-#include <QtCore/qtimer.h>
-#include <QtGui/qopenglcontext.h>
-#include <QtStudio3D/q3dssurfaceviewer.h>
-#include <QtStudio3D/private/q3dsimagesequencegenerator_p.h>
-#include <QtQml/qqmlapplicationengine.h>
-#include <QtQml/qqmlengine.h>
-#include <QtQml/qqmlcontext.h>
-
-static QSurfaceFormat findIdealGLVersion()
-{
- QSurfaceFormat fmt;
- fmt.setProfile(QSurfaceFormat::CoreProfile);
-
- // Advanced: Try 4.3 core (so we get compute shaders for instance)
- fmt.setVersion(4, 3);
- QOpenGLContext ctx;
- ctx.setFormat(fmt);
- if (ctx.create() && ctx.format().version() >= qMakePair(4, 3))
- return fmt;
-
- // Basic: Stick with 3.3 for now to keep less fortunate,
- // Mesa-based systems happy
- fmt.setVersion(3, 3);
- ctx.setFormat(fmt);
- if (ctx.create())
- return fmt;
-
- // We tried...
- return QSurfaceFormat::defaultFormat();
-}
-
-static QSurfaceFormat findIdealGLESVersion()
-{
- QSurfaceFormat fmt;
-
- // Advanced: Try 3.1 (so we get compute shaders for instance)
- fmt.setVersion(3, 1);
- QOpenGLContext ctx;
- ctx.setFormat(fmt);
- if (ctx.create())
- return fmt;
-
- // Basic: OpenGL ES 3.0 is a hard requirement at the moment since we can
- // only generate 300 es shaders, uniform buffers are mandatory.
- fmt.setVersion(3, 0);
- ctx.setFormat(fmt);
- if (ctx.create())
- return fmt;
-
- // We tried...
- return QSurfaceFormat::defaultFormat();
-}
-
-int main(int argc, char *argv[])
-{
-#if defined(Q_OS_MACOS)
- QSurfaceFormat openGLFormat;
- openGLFormat.setRenderableType(QSurfaceFormat::OpenGL);
- openGLFormat.setProfile(QSurfaceFormat::CoreProfile);
- openGLFormat.setMajorVersion(4);
- openGLFormat.setMinorVersion(1);
- openGLFormat.setStencilBufferSize(8);
- QSurfaceFormat::setDefaultFormat(openGLFormat);
-#endif
-
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QCoreApplication::setOrganizationName("The Qt Company");
- QCoreApplication::setOrganizationDomain("qt.io");
- QCoreApplication::setApplicationName("Qt 3D Viewer");
-
- QGuiApplication a(argc, argv);
-
-#if !defined(Q_OS_MACOS)
- QSurfaceFormat fmt;
- if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL)
- fmt = findIdealGLVersion();
- else
- fmt = findIdealGLESVersion();
- fmt.setDepthBufferSize(24);
- fmt.setStencilBufferSize(8);
- QSurfaceFormat::setDefaultFormat(fmt);
-#endif
-
- QCommandLineParser parser;
- parser.addHelpOption();
- parser.addPositionalArgument(
- "file",
- QCoreApplication::translate("main", "The presentation file to open."),
- QCoreApplication::translate("main", "[file]"));
-
- parser.addOption({"sequence",
- QCoreApplication::translate("main",
- "Generates an image sequence.\n"
- "The file argument must be specified.\n"""
- "Specifying any of the seq-* arguments\n"
- "implies setting this option.")});
- parser.addOption({"seq-start",
- QCoreApplication::translate("main",
- "Start time of the sequence in\n"
- "milliseconds.\n"
- "The default value is 0."),
- QCoreApplication::translate("main", "ms"), QString::number(0)});
- parser.addOption({"seq-end",
- QCoreApplication::translate("main",
- "End time of the sequence in\n"
- "milliseconds.\n"
- "The default value is 1000."),
- QCoreApplication::translate("main", "ms"), QString::number(1000)});
- parser.addOption({"seq-fps",
- QCoreApplication::translate("main",
- "Frames per second for the sequence.\n"
- "The default value is 60."),
- QCoreApplication::translate("main", "fps"), QString::number(60)});
- parser.addOption({"seq-interval",
- QCoreApplication::translate("main",
- "Time interval between frames in\n"
- "the sequence in milliseconds. The seq-fps argument is ignored"
- "if this argument is used."),
- QCoreApplication::translate("main", "ms"), QString::number(0)});
- parser.addOption({"seq-width",
- QCoreApplication::translate("main",
- "Width of the image sequence.\n"
- "The default value is 1920."),
- QCoreApplication::translate("main", "pixels"), QString::number(1920)});
- parser.addOption({"seq-height",
- QCoreApplication::translate("main",
- "Height of the image sequence.\n"
- "The default value is 1080."),
- QCoreApplication::translate("main", "pixels"), QString::number(1080)});
- parser.addOption({"seq-outpath",
- QCoreApplication::translate("main",
- "Output path of the image sequence.\n"
- "The default value is the current directory."),
- QCoreApplication::translate("main", "path"), QStringLiteral(".")});
- parser.addOption({"seq-outfile",
- QCoreApplication::translate("main",
- "Output filename base for the image\n"
- "sequence.\n"
- "The default value is derived from the presentation filename."),
- QCoreApplication::translate("main", "file"), QStringLiteral("")});
- parser.addOption({"connect",
- QCoreApplication::translate("main",
- "If this parameter is specified, the viewer\n"
- "is started in connection mode.\n"
- "The default value is 36000."),
- QCoreApplication::translate("main", "port"), QString::number(36000)});
- parser.addOption({"fullscreen",
- QCoreApplication::translate("main",
- "Starts the viewer in fullscreen mode.\n")});
- parser.addOption({"maximized",
- QCoreApplication::translate("main",
- "Starts the viewer in maximized mode.")});
- parser.addOption({"windowgeometry",
- QCoreApplication::translate("main",
- "Specifies the initial\n"
- "window geometry using the X11-syntax.\n"
- "For example: 1000x800+50+50"),
- QCoreApplication::translate("main", "geometry"), QStringLiteral("")});
- parser.addOption({"mattecolor",
- QCoreApplication::translate("main",
- "Specifies custom matte color\n"
- "using #000000 syntax.\n"
- "For example, white matte: #ffffff"),
- QCoreApplication::translate("main", "color"), QStringLiteral("#333333")});
- parser.addOption({"showstats",
- QCoreApplication::translate("main",
- "Show render statistics on screen.")});
- parser.addOption({"scalemode",
- QCoreApplication::translate("main",
- "Specifies scaling mode.\n"
- "The default value is 'center'."),
- QCoreApplication::translate("main", "center|fit|fill"),
- QStringLiteral("center")});
- QCommandLineOption variantListOption({QStringLiteral("v"),
- QStringLiteral("variants")},
- QObject::tr("Gives list of variant groups and variants\n"
- "to be loaded from the presentation.\n"
- "For example VarGroupA:var1,VarGroupB:var4"),
- QStringLiteral("variants"));
- parser.addOption(variantListOption);
-
- parser.process(a);
-
- const QStringList files = parser.positionalArguments();
- if (files.count() > 1) {
- qWarning() << "Only one presentation file can be given.";
- parser.showHelp(-1);
- }
-
- bool generateSequence = parser.isSet("sequence") || parser.isSet("seq-start")
- || parser.isSet("seq-end") || parser.isSet("seq-fps")
- || parser.isSet("seq-interval") || parser.isSet("seq-width")
- || parser.isSet("seq-height") || parser.isSet("seq-outpath")
- || parser.isSet("seq-outfile");
-
- QStringList variantList;
- if (parser.isSet(variantListOption)) {
- QString variantOption = parser.value(variantListOption);
- variantList = variantOption.split(QLatin1Char(','),
- QString::SkipEmptyParts);
- }
-
-#ifndef Q_OS_ANDROID
- Q3DSImageSequenceGenerator *generator = nullptr;
-#endif
- Viewer viewer(generateSequence);
-
- // Figure out control size multiplier for devices using touch screens to ensure all controls
- // have minimum usable size.
- qreal sizeMultiplier = 1.0;
- const auto touchDevices = QTouchDevice::devices();
- if (touchDevices.size() > 0) {
- // Find out the actual screen logical pixel size. Typically touch devices we care about
- // only have a single screen, so we just check primary screen.
- const auto screens = QGuiApplication::screens();
- if (screens.size() > 0) {
- QScreen *screen = screens.at(0);
- qreal dpi = screen->physicalDotsPerInch() / screen->devicePixelRatio();
- sizeMultiplier = dpi / 40.0; // divider chosen empirically
- }
- }
-
- QQmlApplicationEngine engine;
- // Set import paths so that standalone installation works
- QString extraImportPath1(QStringLiteral("%1/qml"));
- engine.addImportPath(extraImportPath1.arg(QGuiApplication::applicationDirPath()));
-#ifdef Q_OS_MACOS
- QString extraImportPath2(QStringLiteral("%1/../../../../qml"));
- engine.addImportPath(extraImportPath2.arg(QGuiApplication::applicationDirPath()));
-#endif
-
- QQmlContext *ctx = engine.rootContext();
- ctx->setContextProperty(QStringLiteral("_menuBackgroundColor"), QColor("#404244"));
- ctx->setContextProperty(QStringLiteral("_menuSelectionColor"), QColor("#46a2da"));
- ctx->setContextProperty(QStringLiteral("_menuBorderColor"), QColor("#727476"));
- ctx->setContextProperty(QStringLiteral("_dialogBorderColor"), QColor("#404244"));
- ctx->setContextProperty(QStringLiteral("_dialogBackgroundColor"), QColor("#2e2f30"));
- ctx->setContextProperty(QStringLiteral("_dialogFieldColor"), QColor("#404244"));
- ctx->setContextProperty(QStringLiteral("_dialogFieldBorderColor"), QColor("#262829"));
- ctx->setContextProperty(QStringLiteral("_textColor"), QColor("#ffffff"));
- ctx->setContextProperty(QStringLiteral("_disabledColor"), QColor("#727476"));
- ctx->setContextProperty(QStringLiteral("_fontSize"), int(12 * sizeMultiplier));
- ctx->setContextProperty(QStringLiteral("_controlBaseHeight"), int(24 * sizeMultiplier));
- ctx->setContextProperty(QStringLiteral("_controlBaseWidth"), int(80 * sizeMultiplier));
- ctx->setContextProperty(QStringLiteral("_controlPadding"), int(12 * sizeMultiplier));
- ctx->setContextProperty(QStringLiteral("_viewerHelper"), &viewer);
- qmlRegisterUncreatableType<Viewer>(
- "Qt3DStudioViewer", 1, 0, "ViewerHelper",
- QCoreApplication::translate("main",
- "Creation of ViewerHelper not allowed from QML"));
- engine.load(QUrl(QLatin1String("qrc:/qml/main.qml")));
- Q_ASSERT(engine.rootObjects().size() > 0);
- QWindow *appWindow = qobject_cast<QWindow *>(engine.rootObjects().at(0));
- Q_ASSERT(appWindow);
- viewer.setQmlRootObject(appWindow);
-
- if (parser.isSet(QStringLiteral("windowgeometry"))) {
- int width = 1280;
- int height = 768;
- int x = 50;
- int y = 50;
- QString geometryStr = parser.value(QStringLiteral("windowgeometry"));
- const QStringList splitPlus = geometryStr.split(QLatin1Char('+'));
- if (splitPlus.size() > 0) {
- const QStringList splitX = splitPlus[0].split(QLatin1Char('x'));
- if (splitX.size() >= 2) {
- width = splitX[0].toInt();
- height = splitX[1].toInt();
- }
- if (splitPlus.size() >= 3) {
- x = splitPlus[1].toInt();
- y = splitPlus[2].toInt();
- }
- }
- appWindow->setGeometry(x, y, width, height);
- }
- if (parser.isSet(QStringLiteral("fullscreen")))
- appWindow->setVisibility(QWindow::FullScreen);
- else if (parser.isSet(QStringLiteral("maximized")))
- appWindow->setVisibility(QWindow::Maximized);
-
- if (parser.isSet(QStringLiteral("mattecolor"))) {
- QColor matteColor(parser.value("mattecolor"));
- if (matteColor != Qt::black) {
- appWindow->setProperty("showMatteColor", QVariant::fromValue<QColor>(matteColor));
- appWindow->setProperty("matteColor", QVariant::fromValue<QColor>(matteColor));
- }
- }
- if (parser.isSet(QStringLiteral("showstats")))
- appWindow->setProperty("showRenderStats", true);
- if (parser.isSet(QStringLiteral("scalemode"))) {
- QString scaleStr(parser.value("scalemode"));
- if (scaleStr == QStringLiteral("fit"))
- appWindow->setProperty("scaleMode", Q3DSViewerSettings::ScaleModeFit);
- else if (scaleStr == QStringLiteral("fill"))
- appWindow->setProperty("scaleMode", Q3DSViewerSettings::ScaleModeFill);
- else
- appWindow->setProperty("scaleMode", Q3DSViewerSettings::ScaleModeCenter);
- }
-
- viewer.setVariantList(variantList);
-
-#ifndef Q_OS_ANDROID
- if (generateSequence) {
- if (files.count() != 1) {
- qWarning() << "Presentation file is required for generating an image sequence.";
- parser.showHelp(-1);
- }
- generator = new Q3DSImageSequenceGenerator;
- QObject::connect(generator, &Q3DSImageSequenceGenerator::progress,
- &viewer, &Viewer::generatorProgress);
- QObject::connect(generator, &Q3DSImageSequenceGenerator::finished,
- &viewer, &Viewer::generatorFinished);
- viewer.setGeneratorDetails(files.first());
- generator->generateImageSequence(
- files.first(),
- parser.value("seq-start").toDouble(),
- parser.value("seq-end").toDouble(),
- parser.value("seq-fps").toDouble(),
- parser.value("seq-interval").toDouble(),
- parser.value("seq-width").toInt(),
- parser.value("seq-height").toInt(),
- parser.value("seq-outpath"),
- parser.value("seq-outfile"));
- } else
-#endif
- if (!files.isEmpty()) {
- // Load the presentation after window has been exposed to give QtQuick time to construct
- // the application window properly
- QTimer *exposeTimer = new QTimer(appWindow);
- QObject::connect(exposeTimer, &QTimer::timeout, [&](){
- if (appWindow->isExposed()) {
- exposeTimer->stop();
- exposeTimer->deleteLater();
- viewer.loadFile(files.first());
- }
- });
- exposeTimer->start(0);
- } else {
- viewer.setContentView(Viewer::ConnectView);
- if (parser.isSet(QStringLiteral("connect")))
- viewer.setConnectPort(parser.value(QStringLiteral("connect")).toInt());
- viewer.connectRemote();
- }
-
- return a.exec();
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledButton.qml b/src/Runtime/ogl-runtime/tools/viewer/qml/StyledButton.qml
deleted file mode 100644
index 400179de..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledButton.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2
-
-Button {
- id: control
- implicitWidth: _controlBaseWidth
- implicitHeight: _controlBaseHeight
-
- contentItem: Text {
- width: _controlBaseWidth
- text: control.text
- height: _controlBaseHeight
- font.pixelSize: _fontSize
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- background: Rectangle {
- color: control.down ? _menuSelectionColor : _dialogFieldColor
- border.color: _dialogFieldBorderColor
- radius: 2
- }
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenu.qml b/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenu.qml
deleted file mode 100644
index 6275dbc6..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenu.qml
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2
-
-Menu {
- id: control
-
- property alias hovered: menuArea.containsMouse
-
- width: contentItem.width + leftPadding + rightPadding
- height: contentItem.height + topPadding + bottomPadding
- padding: 1 // For background border
- x: 0
- y: parent.height
- closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnEscape
-
- contentItem: MouseArea {
- id: menuArea
- hoverEnabled: true
- height: list.height
- width: list.width
- ListView {
- id: list
- boundsBehavior: Flickable.StopAtBounds
- clip: true
- model: control.contentModel
- currentIndex: control.currentIndex
- highlightRangeMode: ListView.ApplyRange
- highlightMoveDuration: 0
- Component.onCompleted: {
- var maxItemWidth = 0;
- var maxShortcutWidth = 0;
- var totalHeight = 0
- var extraWidth = 0
- var i;
- for (i = control.contentData.length - 1; i >= 0; --i) {
- if (control.contentData[i].itemWidth !== undefined) {
- maxItemWidth = Math.max(maxItemWidth, control.contentData[i].itemWidth);
- maxShortcutWidth = Math.max(maxShortcutWidth,
- control.contentData[i].shortcutWidth);
- }
- totalHeight += control.contentData[i].height
- }
- maxItemWidth += _controlPadding // minimum item spacer
- for (i = control.contentData.length - 1; i >= 0; --i) {
- if (control.contentData[i].itemSpacerWidth !== undefined) {
- control.contentData[i].itemSpacerWidth
- = maxItemWidth - control.contentData[i].itemWidth;
- control.contentData[i].shortcutSpacerWidth
- = maxShortcutWidth - control.contentData[i].shortcutWidth;
- }
- }
- width = maxItemWidth + maxShortcutWidth + extraWidth
- + control.contentData[0].leftPadding + control.contentData[0].rightPadding
- + control.contentData[0].arrowWidth + control.contentData[0].checkMarkWidth;
- height = totalHeight
- }
- }
- }
-
- background: Rectangle {
- width: control.width
- height: control.height
- color: _menuBackgroundColor
- border.color: _menuBorderColor
- }
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuButton.qml b/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuButton.qml
deleted file mode 100644
index b5290c3d..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuButton.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2
-
-Button {
- id: control
-
- property Menu menu: null
- property ApplicationWindow window: null
-
- onPressed: {
- if (menu.visible)
- menu.close();
- else
- menu.open();
- }
-
- onHoveredChanged: {
- if (hovered && window.menuOpen) {
- window.closeMenus();
- menu.open();
- }
- }
-
- hoverEnabled: true
- width: contentItem.contentWidth + leftPadding + rightPadding
- leftPadding: _controlPadding
- rightPadding: _controlPadding
- height: _controlBaseHeight
- contentItem: Text {
- text: control.text
- font.pixelSize: _fontSize
- opacity: enabled ? 1.0 : 0.3
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- background: Rectangle {
- opacity: enabled ? 1 : 0.3
- color: control.down || control.hovered
- ? _menuSelectionColor : _menuBackgroundColor
- }
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuItem.qml b/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuItem.qml
deleted file mode 100644
index 79049a90..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuItem.qml
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2
-
-MenuItem {
- id: control
-
- property alias shortcut: shortcut.sequence
- property string shortcutText
- property alias itemSpacerWidth: itemSpacer.width
- property alias shortcutSpacerWidth: shortcutSpacer.width
- property alias itemWidth: itemLabel.width
- property alias shortcutWidth: shortcutLabel.width
- property bool showArrow: false
- property int arrowWidth: arrow.width
- property int checkMarkWidth: checkMark.width
- property bool showCheckMark: false
- property Menu arrowMenu: null
-
- hoverEnabled: true
- width: contentItem.width + leftPadding + rightPadding
- height: contentItem.height + topPadding + bottomPadding
- padding: 0
- leftPadding: 0
- rightPadding: 0
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- if (showArrow) {
- if (!arrowMenu.visible) {
- arrowMenuDelay.stop();
- arrowMenu.open();
- }
- } else {
- mouse.accepted = false;
- }
- }
- }
-
- onHoveredChanged: {
- if (showArrow)
- arrowMenuDelay.start();
- }
-
- Timer {
- id: arrowMenuDelay
- interval: 500
- repeat: false
- onTriggered: {
- if (arrowMenu.visible) {
- if (!control.hovered && !arrowMenu.hovered)
- arrowMenu.close();
- } else {
- if (control.hovered)
- arrowMenu.open();
- }
- }
- }
-
- Shortcut {
- id: shortcut
- context: Qt.ApplicationShortcut
- onActivated: control.triggered()
- }
-
- contentItem: Row {
- width: checkMark.width + itemLabel.width + itemSpacer.width
- + shortcutLabel.width + shortcutSpacer.width + arrow.width
- height: _controlBaseHeight
- Item {
- id: checkMark
- width: 16
- height: _controlBaseHeight
- Image {
- anchors.fill: parent
- visible: control.showCheckMark
- fillMode: Image.Pad
- source: "qrc:/images/check.png"
- }
- }
- Label {
- id: itemLabel
- text: control.text
- font.pixelSize: _fontSize
- horizontalAlignment: Text.AlignLeft
- color: control.enabled ? _textColor : _disabledColor
- verticalAlignment: Text.AlignVCenter
- clip: true
- width: contentWidth
- height: _controlBaseHeight
- }
- Item {
- id: itemSpacer
- width: _controlPadding
- height: _controlBaseHeight
- }
- Label {
- id: shortcutLabel
- text: shortcut.nativeText === "" ? control.shortcutText : shortcut.nativeText
- font.pixelSize: _fontSize
- horizontalAlignment: Text.AlignLeft
- color: control.enabled ? _textColor : _disabledColor
- verticalAlignment: Text.AlignVCenter
- clip: true
- width: contentWidth
- height: _controlBaseHeight
- }
- Item {
- id: shortcutSpacer
- width: 0
- height: _controlBaseHeight
- }
- Item {
- id: arrow
- width: 16
- height: _controlBaseHeight
- Image {
- anchors.fill: parent
- visible: control.showArrow
- fillMode: Image.Pad
- source: "qrc:/images/arrow.png"
- }
- }
- }
- background: Rectangle {
- width: control.width
- height: control.height
- color: control.hovered ? _menuSelectionColor : _menuBackgroundColor
- }
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuSeparator.qml b/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuSeparator.qml
deleted file mode 100644
index 344d6678..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/qml/StyledMenuSeparator.qml
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2
-
-MenuSeparator {
- id: control
- padding: 0
- topPadding: 0
- bottomPadding: 0
- leftPadding: 0
- rightPadding: 0
- width: parent.width
- height: 1
- contentItem: Rectangle {
- width: control.width - control.leftPadding - control.rightPadding
- height: 1
- color: _menuBorderColor
- }
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/qml/main.qml b/src/Runtime/ogl-runtime/tools/viewer/qml/main.qml
deleted file mode 100644
index 1357f396..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/qml/main.qml
+++ /dev/null
@@ -1,594 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2
-import QtQuick.Dialogs 1.2
-import Qt3DStudioViewer 1.0
-import QtStudio3D.OpenGL 2.4
-import QtQuick.Window 2.2
-
-ApplicationWindow {
- id: window
- width: 1280
- height: 768
- visible: true
- title: qsTr("Qt 3D Studio Viewer")
-
- property bool menuOpen: fileMenu.visible || viewMenu.visible
- property Item loadedContent: contentLoader ? contentLoader.item : null
- property string error
- property int previousVisibility
-
- property color showMatteColor: Qt.rgba(0.2, 0.2, 0.2, 1)
- property color hideMatteColor: Qt.rgba(0, 0, 0, 1)
- property color matteColor: hideMatteColor
- property bool showRenderStats: false
- property int scaleMode: ViewerSettings.ScaleModeCenter
-
- function closeMenus() {
- fileMenu.close();
- scaleMenu.close();
- viewMenu.close();
- }
-
- Component.onCompleted: {
- _viewerHelper.restoreWindowState(window);
- previousVisibility = visibility;
- }
-
- onClosing: {
- _viewerHelper.storeWindowState(window);
- }
-
- Timer {
- id: infoTimer
- repeat: false
- interval: 5000
-
- onTriggered: {
- infoOverlay.visible = false;
- }
- }
-
- Rectangle {
- id: infoOverlay
- visible: false
- color: "black"
- border.color: _dialogBorderColor
- x: parent.width * 0.2
- y: parent.height * 0.4
- width: parent.width * 0.6
- height: parent.height * 0.2
- z: 20
- Label {
- id: infoLabel
- anchors.fill: parent
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: window.width / 40
- }
- }
-
- Connections {
- target: _viewerHelper
- onShowInfoOverlay: {
- // Show a brief info overlay
- infoLabel.text = infoStr;
- infoOverlay.visible = true;
- infoTimer.restart();
- }
- }
-
- MouseArea {
- property int swipeStart: 0
-
- anchors.fill: parent
- z: 10
- enabled: !ipEntry.visible
-
- onPressed: {
- if (window.visibility === Window.FullScreen)
- swipeStart = mouse.y;
- _viewerHelper.handleMousePress(mouse.x, mouse.y, mouse.button, mouse.buttons,
- mouse.modifiers);
- mouse.accepted = true;
- }
- onReleased: {
- _viewerHelper.handleMouseRelease(mouse.x, mouse.y, mouse.button, mouse.buttons,
- mouse.modifiers);
- mouse.accepted = true;
- }
- onPositionChanged: {
- // Swipe down to exit fullscreen mode
- if (window.visibility === Window.FullScreen && mouse.y > swipeStart + (height / 8)) {
- window.visibility = window.previousVisibility;
- } else {
- _viewerHelper.handleMouseMove(mouse.x, mouse.y, mouse.button, mouse.buttons,
- mouse.modifiers);
- }
- }
- }
-
- DropArea {
- anchors.fill: parent
- onEntered: {
- if (drag.hasUrls) {
- var filename = _viewerHelper.convertUrlListToFilename(drag.urls);
- if (filename === "")
- drag.accepted = false;
- }
- }
- onDropped: {
- if (drop.hasUrls) {
- var filename = _viewerHelper.convertUrlListToFilename(drop.urls);
- if (filename === "")
- drag.accepted = false;
- else
- _viewerHelper.loadFile(filename);
- }
- }
- }
-
- Loader {
- id: contentLoader
- anchors.fill: parent
- sourceComponent: {
- switch (_viewerHelper.contentView) {
- case ViewerHelper.StudioView:
- return studioContent;
- case ViewerHelper.ConnectView:
- return connectContent;
- case ViewerHelper.SequenceView:
- return sequenceContent;
- default:
- return emptyContent;
- }
- }
- Timer {
- id: asyncContentChanger
- repeat: false
- interval: 0
- property int view: ViewerHelper.DefaultView
- function changeView(newView) {
- view = newView;
- start();
- }
-
- onTriggered: {
- _viewerHelper.contentView = view;
- }
- }
- }
-
- Component {
- id: emptyContent
- Rectangle {
- color: "black"
- Label {
- anchors.fill: parent
- text: window.error
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: width / 80
- }
- }
- }
-
- Component {
- id: studioContent
- Studio3D {
- id: studio3D
-
- property alias hiderVisible: hider.visible
-
- focus: true
- ViewerSettings {
- matteColor: window.matteColor
- showRenderStats: window.showRenderStats
- scaleMode: window.scaleMode
- }
-
- // Hider item keeps the Studio3D hidden until it starts running and we reset the
- // animation time to the start
- Rectangle {
- id: hider
- color: "black"
- anchors.fill: parent
- }
-
- Timer {
- id: revealTimer
- repeat: false
- interval: 0
- onTriggered: {
- hider.visible = false;
- }
- }
-
- onRunningChanged: {
- if (running) {
- // Successfully opened a presentation, update the open folder
- _viewerHelper.openFolder = presentation.source.toString();
- // Force the animation to start from the beginning, as the first frame render
- // can take some time as shaders are compiled on-demand
- // Localization note: "Scene" needs to be the same as the default "Scene"
- // element name generated in the Studio application.
- presentation.goToTime(qsTr("Scene"), 0);
- revealTimer.start();
- }
- }
- onErrorChanged: {
- if (error.length > 0) {
- window.error = error;
- asyncContentChanger.changeView(ViewerHelper.DefaultView);
- }
- }
- }
- }
-
- Component {
- id: connectContent
- Rectangle {
- color: "black"
- Label {
- anchors.fill: parent
- text: _viewerHelper.connectText
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: width / 40
- }
- }
- }
-
- Component {
- id: sequenceContent
- Rectangle {
- property alias mainText: mainLabel.text
- property alias detailsText: detailsLabel.text
- color: "black"
- Item {
- anchors.fill: parent
- Label {
- id: mainLabel
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignBottom
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottomMargin: _controlPadding
- height: parent.height / 2
- font.pixelSize: width / 40
- text: qsTr("Image sequence generation initializing...")
- }
- Label {
- id: detailsLabel
- color: _textColor
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignTop
- anchors.top: mainLabel.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.topMargin: _controlPadding
- height: parent.height / 2
- font.pixelSize: width / 50
- }
- }
- }
- }
-
- Rectangle {
- id: ipEntry
- visible: false
- color: _dialogBackgroundColor
- border.color: _dialogBorderColor
- y: (parent.height - height) / 2
- x: (parent.width - width) / 2
- z: 100
- width: connectionEntry.width + (2 * _controlPadding)
- height: connectionEntry.height + (2 * _controlPadding)
-
- onVisibleChanged: {
- if (visible) {
- connectText.forceActiveFocus();
- connectText.selectAll();
- }
- }
-
- Grid {
- id: connectionEntry
- spacing: _controlPadding
- columns: 2
- y: _controlPadding
- x: _controlPadding
- Label {
- id: ipEntryLabel
- width: _controlBaseWidth
- height: _controlBaseHeight
- text: qsTr("Enter IP port:")
- color: _textColor
- font.pixelSize: _fontSize
- verticalAlignment: Text.AlignVCenter
- padding: _controlPadding / 2
- }
- TextField {
- id: connectText
- width: _controlBaseWidth
- height: _controlBaseHeight
- font.pixelSize: _fontSize
- color: _textColor
- selectByMouse: true
- padding: _controlPadding / 6
- enabled: ipEntry.visible
- text: _viewerHelper.connectPort
- validator: IntValidator {
- bottom: 1
- top: 65535
- }
-
- onAccepted: {
- if (ipEntry.visible) {
- _viewerHelper.contentView = ViewerHelper.ConnectView;
- _viewerHelper.connectPort = Number(text);
- _viewerHelper.connectRemote();
- ipEntry.visible = false;
- infoOverlay.visible = false;
- }
- }
-
- background: Rectangle {
- id: textBackground
- color: _dialogFieldColor
- border.width: 1
- border.color: _dialogFieldBorderColor
- radius: 2
- }
- }
- StyledButton {
- id: connectButton
- width: _controlBaseWidth
- text: qsTr("Connect")
- onClicked: {
- _viewerHelper.contentView = ViewerHelper.ConnectView;
- _viewerHelper.connectPort = Number(connectText.text);
- _viewerHelper.connectRemote();
- ipEntry.visible = false;
- infoOverlay.visible = false;
- }
- }
- StyledButton {
- id: cancelButton
- width: _controlBaseWidth
- text: qsTr("Cancel")
- onClicked: {
- ipEntry.visible = false;
- }
- }
- }
- }
-
- Component {
- id: fileDialogComponent
- FileDialog {
- id: fileDialog
- title: qsTr("Choose Presentation or Project")
- folder: _viewerHelper.openFolder
- nameFilters: [qsTr("All supported formats (*.uip *.uia)"),
- qsTr("Studio UI Presentation (*.uip)"),
- qsTr("Application file (*.uia)")]
- onAccepted: {
- _viewerHelper.contentView = ViewerHelper.StudioView;
- contentLoader.item.presentation.setSource(fileUrls[0]);
- }
- }
- }
-
- header: Rectangle {
- height: _controlBaseHeight
- color: _menuBackgroundColor
- visible: window.visibility !== Window.FullScreen
-
- Row {
- anchors.fill: parent
- StyledMenuButton {
- id: fileButton
- text: qsTr("File")
- menu: fileMenu
- window: window
-
- StyledMenu {
- id: fileMenu
- StyledMenuItem {
- text: qsTr("Open...")
- shortcut: StandardKey.Open
- enabled: _viewerHelper.contentView !== ViewerHelper.SequenceView
- onTriggered: {
- if (enabled) {
- fileDialogLoader.sourceComponent = fileDialogComponent;
- fileDialogLoader.item.open();
- }
- }
- Loader {
- id: fileDialogLoader
- sourceComponent: Item {}
- }
- }
- StyledMenuItem {
- text: _viewerHelper.connected ? qsTr("Disconnect") : qsTr("Connect...")
- shortcut: "F9"
- enabled: _viewerHelper.contentView !== ViewerHelper.SequenceView
- onTriggered: {
- if (enabled) {
- if (_viewerHelper.connected)
- _viewerHelper.disconnectRemote();
- else
- ipEntry.visible = !ipEntry.visible;
- }
- }
- }
- StyledMenuItem {
- text: qsTr("Reload")
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- shortcut: "F5"
- onTriggered: {
- if (enabled) {
- contentLoader.item.hiderVisible = true;
- contentLoader.item.reset();
- }
- }
- }
- StyledMenuSeparator {}
- StyledMenuItem {
- text: qsTr("Quit")
- shortcut: "Ctrl+Q"
- onTriggered: {
- window.close();
- }
- }
- }
- }
- StyledMenuButton {
- id: viewButton
- text: qsTr("View")
- menu: viewMenu
- window: window
-
- StyledMenu {
- id: viewMenu
- StyledMenuItem {
- text: qsTr("Show Matte")
- shortcut: "Ctrl+D"
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- showCheckMark: window.matteColor !== window.hideMatteColor
- onTriggered: {
- if (enabled) {
- if (window.matteColor === window.hideMatteColor)
- window.matteColor = window.showMatteColor;
- else
- window.matteColor = window.hideMatteColor;
- }
- }
- }
- StyledMenuItem {
- id: scaleMenuItem
- text: qsTr("Scale Mode")
- showArrow: true
- arrowMenu: scaleMenu
- shortcut: "Ctrl+Shift+S"
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- onTriggered: {
- if (enabled) {
- scaleMenu.close();
- if (window.scaleMode === ViewerSettings.ScaleModeCenter)
- window.scaleMode = ViewerSettings.ScaleModeFit;
- else if (window.scaleMode === ViewerSettings.ScaleModeFit)
- window.scaleMode = ViewerSettings.ScaleModeFill;
- else if (window.scaleMode === ViewerSettings.ScaleModeFill)
- window.scaleMode = ViewerSettings.ScaleModeCenter;
- }
- }
-
- StyledMenu {
- id: scaleMenu
- x: parent.width
- y: 0
-
- StyledMenuItem {
- id: scaleCenter
- text: qsTr("Center")
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- showCheckMark: window.scaleMode === ViewerSettings.ScaleModeCenter
- onTriggered: {
- if (enabled)
- window.scaleMode = ViewerSettings.ScaleModeCenter;
- }
- }
- StyledMenuItem {
- id: scaleFit
- text: qsTr("Scale to Fit")
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- showCheckMark: window.scaleMode === ViewerSettings.ScaleModeFit
- onTriggered: {
- if (enabled)
- window.scaleMode = ViewerSettings.ScaleModeFit;
- }
- }
- StyledMenuItem {
- id: scaleFill
- text: qsTr("Scale to Fill")
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- showCheckMark: window.scaleMode === ViewerSettings.ScaleModeFill
- onTriggered: {
- if (enabled)
- window.scaleMode = ViewerSettings.ScaleModeFill;
- }
- }
- }
- }
- StyledMenuItem {
- text: qsTr("Show Render Statistics")
- shortcut: "F7"
- enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- showCheckMark: window.showRenderStats
- onTriggered: {
- if (enabled)
- window.showRenderStats = !window.showRenderStats;
- }
- }
- StyledMenuSeparator {}
- StyledMenuItem {
- text: qsTr("Full Screen")
- shortcut: "F11"
- Shortcut {
- sequence: "ESC"
- context: Qt.ApplicationShortcut
- enabled: window.visibility === Window.FullScreen
- onActivated: {
- window.visibility = window.previousVisibility;
- }
- }
-
- onTriggered: {
- if (window.visibility !== Window.FullScreen) {
- window.previousVisibility = window.visibility
- window.visibility = Window.FullScreen;
- } else {
- window.visibility = window.previousVisibility;
- }
- }
- }
- }
- }
- }
- }
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.cpp b/src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.cpp
deleted file mode 100644
index cdfa5b05..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "remotedeploymentreceiver.h"
-#include "viewer.h"
-
-#include <QtNetwork>
-
-RemoteDeploymentReceiver::RemoteDeploymentReceiver(int serverPort, QObject *parent)
- : QObject(parent)
- , m_tcpServer(0)
- , m_connection(0)
- , m_temporaryDir(0)
- , m_serverPort(serverPort)
- , m_projectDeployed(false)
-{
- m_incoming.setVersion(QDataStream::Qt_5_8);
-}
-
-RemoteDeploymentReceiver::~RemoteDeploymentReceiver()
-{
- delete m_temporaryDir;
- m_temporaryDir = 0;
-}
-
-void RemoteDeploymentReceiver::setPort(int value)
-{
- m_serverPort = value;
-}
-
-QString RemoteDeploymentReceiver::startServer()
-{
- if (m_tcpServer)
- return QString();
-
- m_tcpServer = new QTcpServer(this);
- if (!m_tcpServer->listen(QHostAddress::Any, m_serverPort)) {
- QString error = tr("Can't start the remote connection: '%1'")
- .arg(m_tcpServer->errorString());
- delete m_tcpServer;
- m_tcpServer = 0;
- return error;
- }
-
- QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
- // use the first non-localhost IPv4 address
- for (int i = 0; i < ipAddressesList.size(); ++i) {
- if (ipAddressesList.at(i) != QHostAddress::LocalHost
- && ipAddressesList.at(i).toIPv4Address()) {
- m_hostAddress = ipAddressesList.at(i);
- break;
- }
- }
-
- // if we did not find one, use IPv4 localhost
- if (m_hostAddress.isNull())
- m_hostAddress = QHostAddress(QHostAddress::LocalHost);
-
- m_serverPort = m_tcpServer->serverPort();
- connect(m_tcpServer, SIGNAL(newConnection()),
- this, SLOT(acceptRemoteConnection()));
- return QString();
-}
-
-void RemoteDeploymentReceiver::disconnectRemote()
-{
- if (m_connection)
- m_connection->disconnectFromHost();
-}
-
-void RemoteDeploymentReceiver::acceptRemoteConnection()
-{
- Q_ASSERT(m_tcpServer);
- Q_ASSERT(!m_connection);
- m_connection = m_tcpServer->nextPendingConnection();
- Q_ASSERT(m_connection);
-
- m_incoming.setDevice(m_connection);
-
- connect(m_connection, &QTcpSocket::disconnected,
- this, &RemoteDeploymentReceiver::acceptRemoteDisconnection);
-
- connect(m_connection, &QTcpSocket::readyRead,
- this, &RemoteDeploymentReceiver::readProject);
-
- Q_EMIT(remoteConnected());
-}
-
-void RemoteDeploymentReceiver::acceptRemoteDisconnection()
-{
- Q_ASSERT(m_tcpServer);
- Q_ASSERT(m_connection);
- m_connection->deleteLater();
- m_connection = 0;
-
- m_incoming.setDevice(0);
-
- Q_EMIT(remoteDisconnected());
-}
-
-void RemoteDeploymentReceiver::readProject()
-{
- m_projectDeployed = false;
- Q_EMIT(projectChanging());
-
- m_incoming.startTransaction();
-
- int totalBytes = 0;
- m_incoming >> totalBytes;
-
- Viewer *viewer = qobject_cast<Viewer *>(parent());
- if (viewer && totalBytes != 0) {
- viewer->updateProgress(
- 100 * ((double)m_connection->bytesAvailable() / (double)totalBytes));
- }
-
- if (m_connection->bytesAvailable() < totalBytes) {
- m_incoming.rollbackTransaction();
- return;
- }
-
- int numberOfFiles = 0;
- QString projectFile;
- m_incoming >> numberOfFiles;
- m_incoming >> projectFile;
-
- QVector<QPair<QString, QByteArray> > files;
- for (int i = 0; i < numberOfFiles; ++i) {
- QString fileName;
- QByteArray fileContents;
- m_incoming >> fileName;
- m_incoming >> fileContents;
- files.append(qMakePair(fileName, fileContents));
- }
-
- if (!m_incoming.commitTransaction()) {
- m_incoming.abortTransaction();
- qWarning() << "Error transferring remote project in one payload";
- return;
- }
-
- QFileInfo currentProject(m_projectFile);
- if (projectFile != currentProject.fileName()) {
- delete m_temporaryDir;
- m_temporaryDir = 0;
- }
-
- if (!m_temporaryDir)
- m_temporaryDir = new QTemporaryDir;
-
- Q_ASSERT(m_temporaryDir->isValid());
-
- for (const auto &file : qAsConst(files)) {
- QString filePath = m_temporaryDir->path() + QDir::separator() + file.first;
- QFile tmpFile(filePath);
- QDir tmpFileDir = QFileInfo(tmpFile).absoluteDir();
- if (!tmpFileDir.exists())
- tmpFileDir.mkpath(".");
- if (!tmpFile.open(QIODevice::WriteOnly)) {
- delete m_temporaryDir;
- m_temporaryDir = 0;
- qWarning() << "Error opening temporary file for remote project:"
- << filePath;
- return;
- }
-
- if (file.first == projectFile)
- m_projectFile = filePath;
-
- tmpFile.write(file.second);
- tmpFile.close();
- }
-
- m_projectDeployed = true;
- Q_EMIT(projectChanged());
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.h b/src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.h
deleted file mode 100644
index 49f7de3f..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/remotedeploymentreceiver.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef REMOTEDEPLOYMENTRECEIVER_H
-#define REMOTEDEPLOYMENTRECEIVER_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qdatastream.h>
-#include <QtCore/qtemporarydir.h>
-#include <QtNetwork/qtcpserver.h>
-
-class RemoteDeploymentReceiver : public QObject
-{
- Q_OBJECT
-public:
- explicit RemoteDeploymentReceiver(int serverPort, QObject *parent);
- ~RemoteDeploymentReceiver();
-
- QString startServer();
- void disconnectRemote();
-
- QHostAddress hostAddress() const { return m_hostAddress; }
- int serverPort() const { return m_serverPort; }
- void setServerPort(int port) { m_serverPort = port; }
- bool isConnected() const { return m_connection; }
- bool isProjectDeployed() const { return m_connection && m_projectDeployed; }
- QString fileName() const { return m_projectFile; }
-
-Q_SIGNALS:
- void projectChanged();
- void projectChanging();
- void remoteConnected();
- void remoteDisconnected();
-
-private Q_SLOTS:
- void acceptRemoteConnection();
- void acceptRemoteDisconnection();
- void readProject();
- void setPort(int value);
-
-private:
- QTcpServer *m_tcpServer = nullptr;
- QTcpSocket *m_connection = nullptr;
- QHostAddress m_hostAddress;
- QDataStream m_incoming;
- QTemporaryDir *m_temporaryDir = nullptr;
- QString m_projectFile;
- bool m_projectDeployed;
- int m_serverPort;
-};
-
-#endif // REMOTEDEPLOYMENTRECEIVER_H
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.ico b/src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.ico
deleted file mode 100644
index c15cd68a..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.ico
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.svg b/src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.svg
deleted file mode 100644
index 69a14f48..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/3D-studio-viewer.svg
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="512px" height="512px" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
- <title>icon_512x512</title>
- <desc>Created with Sketch.</desc>
- <defs>
- <polygon id="path-1" points="64 0 0 48 0 112 64 160 128 112 128 48"></polygon>
- <path d="M45.6534039,84.7089559 L45.6534039,97.4054197 L15.0588235,128 L0,112.941176 L30.1176471,82.8235294 L43.7426612,82.8235294 C35.3039365,74.0299707 30.1176471,62.091235 30.1176471,48.9411765 C30.1176471,21.9117111 52.0293581,0 79.0588235,0 C106.088289,0 128,21.9117111 128,48.9411765 C128,75.9706419 106.088289,97.8823529 79.0588235,97.8823529 C66.1449913,97.8823529 54.3993526,92.8807218 45.6534039,84.7089559 Z M79.0588235,82.8235294 C97.7715303,82.8235294 112.941176,67.6538833 112.941176,48.9411765 C112.941176,30.2284697 97.7715303,15.0588235 79.0588235,15.0588235 C60.3461167,15.0588235 45.1764706,30.2284697 45.1764706,48.9411765 C45.1764706,67.6538833 60.3461167,82.8235294 79.0588235,82.8235294 Z" id="path-2"></path>
- </defs>
- <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
- <g id="icon_512x512">
- <g id="Group-3" transform="translate(56.000000, 88.000000)">
- <g id="Page-1-Copy">
- <polygon id="Fill-1" fill="#41CD52" points="0 288.0032 328 288.0032 384 232.0032 384 0.0032 56 0.0032 0 56.0032"></polygon>
- <g id="Group-6" transform="translate(72.000000, 48.000000)" fill="#FFFFFF">
- <path d="M39.3792,138.3936 C44.8752,147.8176 55.4752,152.6656 71.0512,152.6656 C86.6272,152.6656 97.0992,147.9536 102.5952,138.6496 C107.9552,129.3456 110.7072,113.5216 110.7072,91.4016 C110.7072,69.1536 107.9632,53.0576 102.3312,42.9776 C96.7072,32.9056 86.3632,27.9216 71.0512,27.9216 C55.8752,27.9216 45.3952,32.8896 39.6432,42.9776 C34.0112,53.0656 31.1312,69.0256 31.1312,91.1456 C31.1312,113.1296 33.8832,128.9616 39.3792,138.3936 L39.3792,138.3936 Z M70.9232,176.2256 C45.6592,176.2256 27.9952,169.4096 18.0432,155.8016 C8.0992,142.2016 3.1232,120.5936 3.1232,91.2736 C3.1232,61.8336 8.2272,39.9696 18.3072,25.7056 C28.3872,11.4416 46.0512,4.2416 70.9232,4.2416 C95.9152,4.2416 113.4592,11.3056 123.4032,25.5696 C133.4832,39.7056 138.4512,61.5616 138.4512,91.1536 C138.4512,110.6496 136.3632,126.3536 132.3072,138.2656 C128.1152,150.2976 121.4432,159.4656 112.0192,165.7536 L132.4352,198.6016 L107.4352,210.2336 L85.8432,174.7776 C82.6992,175.8016 77.7232,176.1376 70.9232,176.1376 L70.9232,176.2256 Z" id="Fill-2"></path>
- <path d="M198.66,71.5184 L198.66,125.0464 C198.66,134.9984 199.444,141.5344 200.884,144.8064 C202.316,148.0784 206.116,149.6544 212.004,149.6544 L231.9,148.7984 L233.076,170.0064 C222.212,172.1024 213.972,173.1424 208.212,173.1424 C194.468,173.1424 185.044,170.0064 179.94,163.7184 C174.836,157.4384 172.22,145.5344 172.22,127.9984 L172.22,71.5824 L153.764,71.5824 L153.764,48.9424 L172.348,48.9424 L172.348,13.7344 L198.66,13.7344 L198.66,48.9424 L232.164,48.9424 L232.164,71.4544 L198.66,71.5184 Z" id="Fill-4"></path>
- </g>
- </g>
- <g id="Group" transform="translate(280.000000, 176.000000)">
- <g id="Path-29">
- <use fill="#D8D8D8" fill-rule="evenodd" xlink:href="#path-1"></use>
- <path stroke="#FFFFFF" stroke-width="7" d="M64,-4.375 L131.5,46.25 L131.5,113.75 L64,164.375 L-3.5,113.75 L-3.5,46.25 L64,-4.375 Z"></path>
- </g>
- <polygon id="Path-27" fill="#81CFFF" points="0 48 64 96 128 48 64 0"></polygon>
- <polygon id="Path-28-Copy" fill="#1F83C1" transform="translate(96.000000, 104.000000) scale(-1, 1) translate(-96.000000, -104.000000) " points="64 48 64 112 128 160 128 96"></polygon>
- <polygon id="Path-28" fill="#2696DA" points="0 48 0 112 64 160 64 96"></polygon>
- </g>
- <g id="Group-2" transform="translate(200.000000, 208.000000)">
- <g id="Combined-Shape">
- <use fill="#707070" fill-rule="evenodd" xlink:href="#path-2"></use>
- <path stroke="#FFFFFF" stroke-width="7" d="M49.1534039,92.0264501 L49.1534039,98.8551671 L15.0588235,132.949747 L-4.94974747,112.941176 L28.6678996,79.3235294 L36.3089911,79.3235294 C30.0728186,70.5670745 26.6176471,60.0229376 26.6176471,48.9411765 C26.6176471,19.9787144 50.0963615,-3.5 79.0588235,-3.5 C108.021286,-3.5 131.5,19.9787144 131.5,48.9411765 C131.5,77.9036385 108.021286,101.382353 79.0588235,101.382353 C68.1809425,101.382353 57.8185023,98.0537262 49.1534039,92.0264501 Z M79.0588235,79.3235294 C95.8385337,79.3235294 109.441176,65.7208867 109.441176,48.9411765 C109.441176,32.1614663 95.8385337,18.5588235 79.0588235,18.5588235 C62.2791133,18.5588235 48.6764706,32.1614663 48.6764706,48.9411765 C48.6764706,65.7208867 62.2791133,79.3235294 79.0588235,79.3235294 Z"></path>
- </g>
- </g>
- </g>
- </g>
- </g>
-</svg> \ No newline at end of file
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow.png b/src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow.png
deleted file mode 100644
index 40ebda88..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow@2x.png b/src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow@2x.png
deleted file mode 100644
index 1a21ee06..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/arrow@2x.png
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/check.png b/src/Runtime/ogl-runtime/tools/viewer/resources/images/check.png
deleted file mode 100644
index 5c1ef70a..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/check.png
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/check@2x.png b/src/Runtime/ogl-runtime/tools/viewer/resources/images/check@2x.png
deleted file mode 100644
index ed730bfe..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/check@2x.png
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/tools/viewer/resources/images/viewer.icns b/src/Runtime/ogl-runtime/tools/viewer/resources/images/viewer.icns
deleted file mode 100644
index b718d75c..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/resources/images/viewer.icns
+++ /dev/null
Binary files differ
diff --git a/src/Runtime/ogl-runtime/tools/viewer/viewer.cpp b/src/Runtime/ogl-runtime/tools/viewer/viewer.cpp
deleted file mode 100644
index bb6af59f..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/viewer.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qsettings.h>
-#include <QtCore/qfileinfo.h>
-#include <QtStudio3D/private/q3dsviewersettings_p.h>
-#include <QtStudio3D/private/q3dspresentation_p.h>
-#include <QtGui/qguiapplication.h>
-#include <QtGui/qscreen.h>
-#include <QtQuick/qquickwindow.h>
-
-#include "viewer.h"
-#include "q3dspresentationitem_p.h"
-
-Viewer::Viewer(bool generatorMode, QObject *parent)
- : QObject(parent)
- , m_generatorMode(generatorMode)
-{
- if (m_generatorMode)
- setContentView(SequenceView);
-
- m_connectTextResetTimer.setInterval(5000);
- m_connectTextResetTimer.setSingleShot(true);
- connect(&m_connectTextResetTimer, &QTimer::timeout, this, &Viewer::resetConnectionInfoText);
-}
-
-Viewer::~Viewer()
-{
-}
-
-void Viewer::connectRemote()
-{
- if (m_remoteDeploymentReceiver) {
- delete m_remoteDeploymentReceiver;
- m_remoteDeploymentReceiver = 0;
- Q_EMIT connectedChanged();
- }
-
- m_remoteDeploymentReceiver = new RemoteDeploymentReceiver(m_connectPort, this);
- QString error = m_remoteDeploymentReceiver->startServer();
- if (!error.isEmpty()) {
- delete m_remoteDeploymentReceiver;
- m_remoteDeploymentReceiver = nullptr;
- setContentView(DefaultView);
- m_qmlRootObject->setProperty("error", QVariant(error));
- return;
- }
-
- resetConnectionInfoText();
-
- connect(m_remoteDeploymentReceiver, &RemoteDeploymentReceiver::remoteConnected,
- this, &Viewer::remoteConnected);
-
- connect(m_remoteDeploymentReceiver, &RemoteDeploymentReceiver::remoteDisconnected,
- this, &Viewer::remoteDisconnected);
-
- connect(m_remoteDeploymentReceiver, &RemoteDeploymentReceiver::projectChanging,
- this, &Viewer::remoteProjectChanging);
-
- connect(m_remoteDeploymentReceiver, &RemoteDeploymentReceiver::projectChanged,
- this, &Viewer::loadRemoteDeploymentReceiver);
-
- Q_EMIT connectedChanged();
-}
-
-void Viewer::disconnectRemote()
-{
- m_remoteDeploymentReceiver->disconnectRemote();
-}
-
-void Viewer::setVariantList(const QStringList &variantList)
-{
- if (m_variantList != variantList) {
- m_variantList = variantList;
- Q_EMIT variantListChanged();
- }
-}
-
-QStringList Viewer::variantList() const
-{
- return m_variantList;
-}
-
-// Used to load files via command line and when using remote deployment
-void Viewer::loadFile(const QString &filename)
-{
- QString targetFilename = filename;
- // Try to find the application (*.uia) file for loading instead of the presentation (*.uip)
- // in case we are connected to remote sender.
- if (isConnected() && targetFilename.endsWith(QStringLiteral(".uip"))) {
- targetFilename.chop(4);
- targetFilename.append(QStringLiteral(".uia"));
- QFileInfo targetfileInfo(targetFilename);
- // uia not found, revert to given uip
- if (!targetfileInfo.exists())
- targetFilename = filename;
- }
-
- QFileInfo fileInfo(targetFilename);
- if (!fileInfo.exists()) {
- setContentView(DefaultView);
- m_qmlRootObject->setProperty(
- "error", QVariant(tr("Tried to load nonexistent file %1").arg(targetFilename)));
- return;
- }
-
- QUrl sourceUrl = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
-
- setContentView(StudioView);
-
- if (qmlStudio()) {
- qmlStudio()->presentation()->setVariantList(m_variantList);
- qmlStudio()->presentation()->setSource(sourceUrl);
- }
-}
-
-QString Viewer::convertUrlListToFilename(const QList<QUrl> &list)
-{
- for (const QUrl &url : list) {
- QString str = url.toLocalFile();
- if (!str.isEmpty()) {
- if (QFileInfo(str).suffix() == QStringLiteral("uip")
- || QFileInfo(str).suffix() == QStringLiteral("uia")) {
- return str;
- }
- }
- }
- return QString();
-}
-
-void Viewer::restoreWindowState(QWindow *window)
-{
- QSettings settings;
- QRect geo = settings.value(QStringLiteral("WindowGeometry"), QRect()).toRect();
- int visibility = settings.value(QStringLiteral("WindowVisibility"),
- QWindow::Windowed).toInt();
-
- // Do not restore geometry if resulting geometry means the center of the window
- // would be offscreen on the virtual desktop
- QRect vgeo = window->screen()->availableVirtualGeometry();
- QPoint center(geo.x() + geo.width() / 2, geo.y() + geo.height() / 2);
- bool offscreen = center.x() > vgeo.width() || center.x() < 0
- || center.y() > vgeo.height() || center.y() < 0;
-
- if (!offscreen && !geo.isNull()) {
- // The first geometry set at startup may adjust the geometry according to pixel
- // ratio if mouse cursor is on different screen than where window goes and the
- // two screens have different pixel ratios. Setting geometry twice seems to
- // work around this.
- geo.adjust(0, 0, -1, 0);
- window->setGeometry(geo);
- geo.adjust(0, 0, 1, 0);
- window->setGeometry(geo);
- }
-
- window->setVisibility(QWindow::Visibility(visibility));
-}
-
-void Viewer::storeWindowState(QWindow *window)
-{
- QSettings settings;
- settings.setValue(QStringLiteral("WindowGeometry"), window->geometry());
- settings.setValue(QStringLiteral("WindowState"), window->visibility());
-}
-
-// Since we need mouse events for handling the swipe gesture in viewer, we need to generate
-// a fake event for the presentation.
-void Viewer::handleMousePress(int x, int y, int button, int buttons, int modifiers)
-{
- if (qmlStudio()) {
- QMouseEvent fakeEvent(QEvent::MouseButtonPress,
- QPointF(x, y) * qmlStudio()->window()->devicePixelRatio(),
- Qt::MouseButton(button),
- Qt::MouseButtons(buttons),
- Qt::KeyboardModifiers(modifiers));
- qmlStudio()->presentation()->mousePressEvent(&fakeEvent);
- }
-}
-
-void Viewer::handleMouseRelease(int x, int y, int button, int buttons, int modifiers)
-{
- if (qmlStudio()) {
- QMouseEvent fakeEvent(QEvent::MouseButtonRelease,
- QPointF(x, y) * qmlStudio()->window()->devicePixelRatio(),
- Qt::MouseButton(button),
- Qt::MouseButtons(buttons),
- Qt::KeyboardModifiers(modifiers));
- qmlStudio()->presentation()->mouseReleaseEvent(&fakeEvent);
- }
-}
-
-void Viewer::handleMouseMove(int x, int y, int button, int buttons, int modifiers)
-{
- if (qmlStudio()) {
- QMouseEvent fakeEvent(QEvent::MouseMove,
- QPointF(x, y) * qmlStudio()->window()->devicePixelRatio(),
- Qt::MouseButton(button),
- Qt::MouseButtons(buttons),
- Qt::KeyboardModifiers(modifiers));
- qmlStudio()->presentation()->mouseMoveEvent(&fakeEvent);
- }
-}
-
-void Viewer::setContentView(Viewer::ContentView view)
-{
- if (view != m_contentView) {
- m_qmlStudio = nullptr;
- m_contentView = view;
- Q_EMIT contentViewChanged();
- }
-}
-
-Viewer::ContentView Viewer::contentView() const
-{
- return m_contentView;
-}
-
-void Viewer::setOpenFolder(const QUrl &folder)
-{
- QString localFolder = folder.toLocalFile();
- QFileInfo fi(localFolder);
- QString newDir;
- if (fi.isDir())
- newDir = fi.absoluteFilePath();
- else
- newDir = fi.absolutePath();
- if (newDir != m_openFileDir) {
- m_openFileDir = newDir;
- QSettings settings;
- settings.setValue(QStringLiteral("DirectoryOfLastOpen"), m_openFileDir);
- Q_EMIT openFolderChanged();
- }
-}
-
-QUrl Viewer::openFolder()
-{
- if (m_openFileDir.size() == 0) {
- QSettings settings;
- m_openFileDir = settings.value(QStringLiteral("DirectoryOfLastOpen"),
- QString("")).toString();
-#ifdef Q_OS_ANDROID
- if (m_openFileDir.isEmpty())
- m_openFileDir = QStringLiteral("/sdcard/qt3dviewer"); // Add default folder for Android
-#endif
- }
- return QUrl::fromLocalFile(m_openFileDir);
-}
-
-void Viewer::setConnectPort(int port)
-{
- if (m_connectPort != port) {
- QSettings settings;
- m_connectPort = port;
- settings.setValue(QStringLiteral("ConnectPort"), m_connectPort);
- Q_EMIT connectPortChanged();
- }
-}
-
-int Viewer::connectPort()
-{
- if (m_connectPort < 0) {
- QSettings settings;
- m_connectPort = settings.value(QStringLiteral("ConnectPort"), 36000).toInt();
- }
- return m_connectPort;
-}
-
-QString Viewer::connectText() const
-{
- return m_connectText;
-}
-
-bool Viewer::isConnected() const
-{
- return m_remoteDeploymentReceiver ? m_remoteDeploymentReceiver->isConnected() : false;
-}
-
-void Viewer::setQmlRootObject(QObject *obj)
-{
- m_qmlRootObject = obj;
-}
-
-void Viewer::loadRemoteDeploymentReceiver()
-{
- Q_ASSERT(m_remoteDeploymentReceiver);
- const QString remote = m_remoteDeploymentReceiver->fileName();
- QMetaObject::invokeMethod(this, "loadFile", Qt::QueuedConnection, Q_ARG(QString, remote));
-}
-
-void Viewer::remoteProjectChanging()
-{
- if (m_contentView != ConnectView)
- setContentView(ConnectView);
- m_connectText = tr("Loading remote project...");
- Q_EMIT connectTextChanged();
-}
-
-void Viewer::remoteConnected()
-{
- m_connectText = tr("Remote Connected");
- Q_EMIT connectTextChanged();
- Q_EMIT connectedChanged();
- if (m_contentView != ConnectView)
- Q_EMIT showInfoOverlay(m_connectText);
-}
-
-void Viewer::remoteDisconnected()
-{
- m_connectText = tr("Remote Disconnected");
- Q_EMIT connectTextChanged();
- Q_EMIT connectedChanged();
- if (m_contentView != ConnectView) {
- Q_EMIT showInfoOverlay(m_connectText);
- } else {
- // Start timer to reset connection info text
- m_connectTextResetTimer.start();
- }
-}
-
-void Viewer::resetConnectionInfoText()
-{
- m_connectText.clear();
- QTextStream stream(&m_connectText);
- stream << tr("Use IP: %1 and Port: %2\n"
- "in Qt 3D Studio Editor to connect to this viewer.\n\n"
- "Use File/Open... to open a local presentation.")
- .arg(m_remoteDeploymentReceiver->hostAddress().toString())
- .arg(QString::number(m_connectPort));
- Q_EMIT connectTextChanged();
-}
-
-Q3DSStudio3D *Viewer::qmlStudio()
-{
- if (m_contentView == StudioView) {
- if (!m_qmlStudio) {
- QObject *loadedContent = m_qmlRootObject->property("loadedContent").value<QObject *>();
- m_qmlStudio = static_cast<Q3DSStudio3D *>(loadedContent);
- }
- } else {
- m_qmlStudio = nullptr;
- }
- return m_qmlStudio;
-}
-
-void Viewer::generatorProgress(int totalFrames, int frameCount)
-{
- QString progressString;
- if (frameCount >= totalFrames) {
- progressString =
- QCoreApplication::translate(
- "main", "Image sequence generation done! (%2 frames generated)")
- .arg(totalFrames);
- } else {
- progressString =
- QCoreApplication::translate("main", "Image sequence generation progress: %1 / %2")
- .arg(frameCount).arg(totalFrames);
- }
- QObject *loadedContent = m_qmlRootObject->property("loadedContent").value<QObject *>();
- loadedContent->setProperty("mainText", progressString);
-}
-
-void Viewer::generatorFinished(bool success, const QString &details)
-{
- QObject *loadedContent = m_qmlRootObject->property("loadedContent").value<QObject *>();
- if (success) {
- loadedContent->setProperty("detailsText", details);
- } else {
- QString mainString =
- QCoreApplication::translate("main", "Image sequence generation failed:");
- loadedContent->setProperty("mainText", mainString);
- loadedContent->setProperty("detailsText", details);
- }
-}
-
-void Viewer::updateProgress(int percent)
-{
- // Don't wait for 100%, as it'll already start loading and text isn't updated anymore
- if (percent >= 99)
- m_connectText = tr("Loading remote project...");
- else
- m_connectText = QStringLiteral("Receiving (%1%)").arg(percent);
- Q_EMIT connectTextChanged();
-}
-
-void Viewer::setGeneratorDetails(const QString &filename)
-{
- QObject *loadedContent = m_qmlRootObject->property("loadedContent").value<QObject *>();
- loadedContent->setProperty("detailsText", filename);
-}
diff --git a/src/Runtime/ogl-runtime/tools/viewer/viewer.h b/src/Runtime/ogl-runtime/tools/viewer/viewer.h
deleted file mode 100644
index 1ce514ad..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/viewer.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef VIEWER_H
-#define VIEWER_H
-
-#include "remotedeploymentreceiver.h"
-
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qtimer.h>
-#include <QtGui/qwindow.h>
-#include "q3dsstudio3d_p.h"
-
-class Viewer : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(ContentView contentView READ contentView WRITE setContentView NOTIFY contentViewChanged)
- Q_PROPERTY(QUrl openFolder READ openFolder WRITE setOpenFolder NOTIFY openFolderChanged)
- Q_PROPERTY(int connectPort READ connectPort WRITE setConnectPort NOTIFY connectPortChanged)
- Q_PROPERTY(QString connectText READ connectText NOTIFY connectTextChanged)
- Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged)
- Q_PROPERTY(QStringList variantList READ variantList WRITE setVariantList NOTIFY variantListChanged)
-
-public:
- enum ContentView {
- DefaultView,
- StudioView,
- ConnectView,
- SequenceView
- };
-
- Q_ENUM(ContentView)
-
- explicit Viewer(bool generatorMode, QObject *parent = nullptr);
- ~Viewer();
-
- Q_INVOKABLE void connectRemote();
- Q_INVOKABLE void disconnectRemote();
- Q_INVOKABLE void loadFile(const QString &filename);
- Q_INVOKABLE QString convertUrlListToFilename(const QList<QUrl> &list);
- Q_INVOKABLE void restoreWindowState(QWindow *window);
- Q_INVOKABLE void storeWindowState(QWindow *window);
-
- Q_INVOKABLE void handleMousePress(int x, int y, int button, int buttons, int modifiers);
- Q_INVOKABLE void handleMouseRelease(int x, int y, int button, int buttons, int modifiers);
- Q_INVOKABLE void handleMouseMove(int x, int y, int button, int buttons, int modifiers);
-
- void setVariantList(const QStringList &variantList);
- QStringList variantList() const;
- void setContentView(ContentView view);
- ContentView contentView() const;
- void setOpenFolder(const QUrl &folder);
- QUrl openFolder(); // not const since it potentially updates from settings
- void setConnectPort(int port);
- int connectPort(); // not const since it potentially updates from settings
- QString connectText() const;
- bool isConnected() const;
-
- void setQmlRootObject(QObject *obj);
-
- void loadProject(const QByteArray &data);
- void updateProgress(int percent);
- void setGeneratorDetails(const QString &filename);
-
-public Q_SLOTS:
- void generatorProgress(int totalFrames, int frameCount);
- void generatorFinished(bool success, const QString &details);
-
-private Q_SLOTS:
- void loadRemoteDeploymentReceiver();
- void remoteProjectChanging();
- void remoteConnected();
- void remoteDisconnected();
- void resetConnectionInfoText();
-
-Q_SIGNALS:
- void contentViewChanged();
- void openFolderChanged();
- void connectPortChanged();
- void connectTextChanged();
- void connectedChanged();
- void variantListChanged();
- void showInfoOverlay(const QString &infoStr);
-
-private:
- Q3DSStudio3D *qmlStudio();
-
- QString m_openFileDir;
- QStringList m_variantList;
- RemoteDeploymentReceiver *m_remoteDeploymentReceiver = nullptr;
- bool m_generatorMode = false;
- ContentView m_contentView = DefaultView;
- QObject *m_qmlRootObject = nullptr;
- int m_connectPort = -1;
- QString m_connectText;
- Q3DSStudio3D *m_qmlStudio = nullptr;
- QTimer m_connectTextResetTimer;
-};
-
-#endif // VIEWER_H
diff --git a/src/Runtime/ogl-runtime/tools/viewer/viewer.pro b/src/Runtime/ogl-runtime/tools/viewer/viewer.pro
deleted file mode 100644
index cad56640..00000000
--- a/src/Runtime/ogl-runtime/tools/viewer/viewer.pro
+++ /dev/null
@@ -1,49 +0,0 @@
-include($$PWD/../../commoninclude.pri)
-
-TEMPLATE = app
-TARGET = Qt3DViewer
-QT += qml quickcontrols2 studio3d-private
-
-INCLUDEPATH += $$PWD/../../src/api/studio3dqml
-INCLUDEPATH += $$PWD/../../src/api/studio3d
-
-RESOURCES += Viewer.qrc
-RC_ICONS = resources/images/3D-studio-viewer.ico
-
-ICON = resources/images/viewer.icns
-
-SOURCES += \
- $$PWD/../../src/api/studio3dqml/q3dsstudio3d.cpp \
- $$PWD/../../src/api/studio3dqml/q3dsrenderer.cpp \
- $$PWD/../../src/api/studio3dqml/q3dspresentationitem.cpp \
- main.cpp \
- viewer.cpp \
- remotedeploymentreceiver.cpp
-
-HEADERS += \
- $$PWD/../../src/api/studio3dqml/q3dsstudio3d_p.h \
- $$PWD/../../src/api/studio3dqml/q3dsrenderer_p.h \
- $$PWD/../../src/api/studio3dqml/q3dspresentationitem_p.h \
- viewer.h \
- remotedeploymentreceiver.h
-
-android: {
-SOURCES += \
- $$PWD/../../src/api/studio3d/q3dsviewersettings.cpp \
- $$PWD/../../src/api/studio3d/q3dspresentation.cpp \
- $$PWD/../../src/api/studio3d/q3dsdatainput.cpp
-
-HEADERS += \
- $$PWD/../../src/api/studio3d/q3dsviewersettings.h \
- $$PWD/../../src/api/studio3d/q3dspresentation.h \
- $$PWD/../../src/api/studio3d/q3dsdatainput.h
-}
-
-LIBS += \
- -lqt3dsopengl$$qtPlatformTargetSuffix() \
- -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
-
-macos:QMAKE_RPATHDIR += @executable_path/../../../../lib
-
-target.path = $$[QT_INSTALL_BINS]
-INSTALLS += target
diff --git a/src/Runtime/ogl-runtime/utils.pri b/src/Runtime/ogl-runtime/utils.pri
deleted file mode 100644
index 8d56baa4..00000000
--- a/src/Runtime/ogl-runtime/utils.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-# Add our static libs to target dependencies so we detect changes to them
-defineReplace(fixLibPredeps) {
- # TODO Needs something more clever once debug libs are correctly suffixed
- for(lib, $${2}) {
- PREDEPS *= $${1}/$${QMAKE_PREFIX_STATICLIB}$${lib}$$qtPlatformTargetSuffix().$${QMAKE_EXTENSION_STATICLIB}
- }
- return($$PREDEPS)
-}